@vectoriox/iox-ui 5.198.0 → 5.199.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.
Files changed (43) hide show
  1. package/actions-core/index.d.ts +7 -1
  2. package/data-core/index.d.ts +11 -3
  3. package/design-core/index.d.ts +26 -1
  4. package/fesm2022/vectoriox-iox-ui-actions-core.mjs +6 -1
  5. package/fesm2022/vectoriox-iox-ui-actions-core.mjs.map +1 -1
  6. package/fesm2022/vectoriox-iox-ui-data-core.mjs +30 -4
  7. package/fesm2022/vectoriox-iox-ui-data-core.mjs.map +1 -1
  8. package/fesm2022/vectoriox-iox-ui-design-core.mjs +65 -1
  9. package/fesm2022/vectoriox-iox-ui-design-core.mjs.map +1 -1
  10. package/fesm2022/vectoriox-iox-ui-generation-core.mjs +10821 -10094
  11. package/fesm2022/vectoriox-iox-ui-generation-core.mjs.map +1 -1
  12. package/fesm2022/vectoriox-iox-ui-harness-core.mjs +243 -38
  13. package/fesm2022/vectoriox-iox-ui-harness-core.mjs.map +1 -1
  14. package/generation-core/index.d.ts +463 -126
  15. package/harness-core/index.d.ts +93 -6
  16. package/package.json +1 -1
  17. package/src/actions-core/element-actions.ts +6 -0
  18. package/src/data-core/placeholder-rows.ts +29 -4
  19. package/src/design-core/menu-look.ts +23 -0
  20. package/src/design-core/node-classes.ts +39 -0
  21. package/src/generation-core/check-free.ts +17 -9
  22. package/src/generation-core/compose-free.ts +7 -2
  23. package/src/generation-core/compose-site.ts +167 -46
  24. package/src/generation-core/footer-mix.ts +161 -15
  25. package/src/generation-core/free-opening.ts +13 -2
  26. package/src/generation-core/free-wire.ts +8 -0
  27. package/src/generation-core/header-mix.ts +31 -2
  28. package/src/generation-core/legal.ts +24 -0
  29. package/src/generation-core/menu-shelves.ts +138 -0
  30. package/src/generation-core/nav-shape.ts +138 -15
  31. package/src/generation-core/node-baselines.generated.ts +1 -0
  32. package/src/generation-core/patterns.ts +7 -0
  33. package/src/generation-core/plan-wire.ts +1 -0
  34. package/src/generation-core/public-api.ts +1 -0
  35. package/src/generation-core/site-build-run.ts +8 -0
  36. package/src/generation-core/site-plan.model.ts +3 -0
  37. package/src/generation-core/site-spec.generated.ts +230 -70
  38. package/src/generation-core/validate-site-plan.ts +2 -0
  39. package/src/harness-core/business-types.ts +4 -0
  40. package/src/harness-core/harness-spec.generated.ts +189 -30
  41. package/src/harness-core/popup-stance.ts +56 -3
  42. package/src/harness-core/run-compose-context.ts +25 -5
  43. package/styles/iox-design.css +25 -0
@@ -233,6 +233,7 @@ declare const SPEC_BUSINESS_TYPES: readonly [{
233
233
  readonly stock: false;
234
234
  readonly booking: "sometimes";
235
235
  readonly sells: "offered";
236
+ readonly opening: readonly ["frame:full", "media:photo", "words:wordmark"];
236
237
  }, {
237
238
  readonly id: "interior-design";
238
239
  readonly label: "Interior designer";
@@ -338,6 +339,7 @@ declare const SPEC_BUSINESS_TYPES: readonly [{
338
339
  readonly stock: false;
339
340
  readonly booking: "none";
340
341
  readonly sells: "none";
342
+ readonly opening: readonly ["frame:full", "media:photo", "words:wordmark"];
341
343
  }, {
342
344
  readonly id: "architecture";
343
345
  readonly label: "Architect";
@@ -444,6 +446,7 @@ declare const SPEC_BUSINESS_TYPES: readonly [{
444
446
  readonly stock: false;
445
447
  readonly booking: "none";
446
448
  readonly sells: "none";
449
+ readonly opening: readonly ["frame:full", "media:photo", "words:wordmark"];
447
450
  }, {
448
451
  readonly id: "creative-studio";
449
452
  readonly label: "Design or branding studio";
@@ -538,6 +541,7 @@ declare const SPEC_BUSINESS_TYPES: readonly [{
538
541
  readonly stock: false;
539
542
  readonly booking: "none";
540
543
  readonly sells: "none";
544
+ readonly opening: readonly ["frame:full", "media:photo", "words:wordmark"];
541
545
  }, {
542
546
  readonly id: "artist";
543
547
  readonly label: "Artist or illustrator";
@@ -634,6 +638,7 @@ declare const SPEC_BUSINESS_TYPES: readonly [{
634
638
  readonly stock: false;
635
639
  readonly booking: "none";
636
640
  readonly sells: "offered";
641
+ readonly opening: readonly ["frame:full", "media:photo", "words:wordmark"];
637
642
  }, {
638
643
  readonly id: "makers";
639
644
  readonly label: "Ceramics, crafts and makers";
@@ -729,6 +734,7 @@ declare const SPEC_BUSINESS_TYPES: readonly [{
729
734
  readonly stock: false;
730
735
  readonly booking: "sometimes";
731
736
  readonly sells: "inferred";
737
+ readonly opening: readonly ["frame:full", "media:photo", "words:wordmark"];
732
738
  }, {
733
739
  readonly id: "jewellery";
734
740
  readonly label: "Jewellery";
@@ -825,6 +831,7 @@ declare const SPEC_BUSINESS_TYPES: readonly [{
825
831
  readonly stock: false;
826
832
  readonly booking: "none";
827
833
  readonly sells: "inferred";
834
+ readonly opening: readonly ["frame:full", "media:photo", "words:wordmark"];
828
835
  }, {
829
836
  readonly id: "tattoo";
830
837
  readonly label: "Tattoo or barber studio";
@@ -920,6 +927,7 @@ declare const SPEC_BUSINESS_TYPES: readonly [{
920
927
  readonly stock: false;
921
928
  readonly booking: "must";
922
929
  readonly sells: "none";
930
+ readonly opening: readonly ["frame:full", "media:photo", "words:wordmark"];
923
931
  }, {
924
932
  readonly id: "spa";
925
933
  readonly label: "Spa and massage";
@@ -1027,6 +1035,7 @@ declare const SPEC_BUSINESS_TYPES: readonly [{
1027
1035
  readonly stock: true;
1028
1036
  readonly booking: "must";
1029
1037
  readonly sells: "none";
1038
+ readonly opening: readonly ["frame:full", "media:photo", "words:wordmark"];
1030
1039
  }, {
1031
1040
  readonly id: "salon";
1032
1041
  readonly label: "Hair and beauty salon";
@@ -1127,6 +1136,7 @@ declare const SPEC_BUSINESS_TYPES: readonly [{
1127
1136
  readonly stock: true;
1128
1137
  readonly booking: "must";
1129
1138
  readonly sells: "none";
1139
+ readonly opening: readonly ["frame:full", "media:photo", "words:wordmark"];
1130
1140
  }, {
1131
1141
  readonly id: "yoga";
1132
1142
  readonly label: "Yoga or pilates studio";
@@ -1223,6 +1233,7 @@ declare const SPEC_BUSINESS_TYPES: readonly [{
1223
1233
  readonly stock: true;
1224
1234
  readonly booking: "must";
1225
1235
  readonly sells: "none";
1236
+ readonly opening: readonly ["frame:full", "media:photo", "words:wordmark"];
1226
1237
  }, {
1227
1238
  readonly id: "fitness";
1228
1239
  readonly label: "Trainer, gym or dance";
@@ -1323,6 +1334,7 @@ declare const SPEC_BUSINESS_TYPES: readonly [{
1323
1334
  readonly stock: true;
1324
1335
  readonly booking: "must";
1325
1336
  readonly sells: "none";
1337
+ readonly opening: readonly ["frame:full", "media:photo", "words:wordmark"];
1326
1338
  }, {
1327
1339
  readonly id: "therapist";
1328
1340
  readonly label: "Therapist or counsellor";
@@ -1424,6 +1436,7 @@ declare const SPEC_BUSINESS_TYPES: readonly [{
1424
1436
  readonly stock: true;
1425
1437
  readonly booking: "must";
1426
1438
  readonly sells: "never";
1439
+ readonly opening: readonly ["frame:inset", "media:photo", "words:headline"];
1427
1440
  }, {
1428
1441
  readonly id: "clinic";
1429
1442
  readonly label: "Clinic or practice";
@@ -1531,6 +1544,7 @@ declare const SPEC_BUSINESS_TYPES: readonly [{
1531
1544
  readonly stock: true;
1532
1545
  readonly booking: "must";
1533
1546
  readonly sells: "never";
1547
+ readonly opening: readonly ["frame:inset", "media:photo", "words:headline"];
1534
1548
  }, {
1535
1549
  readonly id: "dental";
1536
1550
  readonly label: "Dental practice";
@@ -1627,6 +1641,7 @@ declare const SPEC_BUSINESS_TYPES: readonly [{
1627
1641
  readonly stock: true;
1628
1642
  readonly booking: "must";
1629
1643
  readonly sells: "never";
1644
+ readonly opening: readonly ["frame:inset", "media:photo", "words:headline"];
1630
1645
  }, {
1631
1646
  readonly id: "vet";
1632
1647
  readonly label: "Vet or pet care";
@@ -1722,6 +1737,7 @@ declare const SPEC_BUSINESS_TYPES: readonly [{
1722
1737
  readonly stock: true;
1723
1738
  readonly booking: "must";
1724
1739
  readonly sells: "none";
1740
+ readonly opening: readonly ["frame:inset", "media:photo", "words:headline"];
1725
1741
  }, {
1726
1742
  readonly id: "restaurant";
1727
1743
  readonly label: "Restaurant";
@@ -1826,6 +1842,7 @@ declare const SPEC_BUSINESS_TYPES: readonly [{
1826
1842
  readonly stock: true;
1827
1843
  readonly booking: "tables";
1828
1844
  readonly sells: "none";
1845
+ readonly opening: readonly ["frame:full", "media:photo", "words:wordmark"];
1829
1846
  }, {
1830
1847
  readonly id: "cafe-bakery";
1831
1848
  readonly label: "Café or bakery";
@@ -1926,6 +1943,7 @@ declare const SPEC_BUSINESS_TYPES: readonly [{
1926
1943
  readonly stock: true;
1927
1944
  readonly booking: "none";
1928
1945
  readonly sells: "offered";
1946
+ readonly opening: readonly ["frame:full", "media:photo", "words:wordmark"];
1929
1947
  }, {
1930
1948
  readonly id: "bar-winery";
1931
1949
  readonly label: "Bar, winery or brewery";
@@ -2026,6 +2044,7 @@ declare const SPEC_BUSINESS_TYPES: readonly [{
2026
2044
  readonly stock: true;
2027
2045
  readonly booking: "none";
2028
2046
  readonly sells: "offered";
2047
+ readonly opening: readonly ["frame:full", "media:photo", "words:wordmark"];
2029
2048
  }, {
2030
2049
  readonly id: "boutique";
2031
2050
  readonly label: "Fashion or lifestyle shop";
@@ -2120,6 +2139,7 @@ declare const SPEC_BUSINESS_TYPES: readonly [{
2120
2139
  readonly stock: true;
2121
2140
  readonly booking: "none";
2122
2141
  readonly sells: "inferred";
2142
+ readonly opening: readonly ["frame:full", "media:photo", "words:wordmark"];
2123
2143
  }, {
2124
2144
  readonly id: "florist";
2125
2145
  readonly label: "Florist or plant shop";
@@ -2215,6 +2235,7 @@ declare const SPEC_BUSINESS_TYPES: readonly [{
2215
2235
  readonly stock: true;
2216
2236
  readonly booking: "none";
2217
2237
  readonly sells: "inferred";
2238
+ readonly opening: readonly ["frame:full", "media:photo", "words:wordmark"];
2218
2239
  }, {
2219
2240
  readonly id: "home-goods";
2220
2241
  readonly label: "Furniture or home goods";
@@ -2310,6 +2331,7 @@ declare const SPEC_BUSINESS_TYPES: readonly [{
2310
2331
  readonly stock: true;
2311
2332
  readonly booking: "none";
2312
2333
  readonly sells: "inferred";
2334
+ readonly opening: readonly ["frame:full", "media:photo", "words:wordmark"];
2313
2335
  }, {
2314
2336
  readonly id: "consultant";
2315
2337
  readonly label: "Consultant";
@@ -2407,6 +2429,7 @@ declare const SPEC_BUSINESS_TYPES: readonly [{
2407
2429
  readonly stock: true;
2408
2430
  readonly booking: "sometimes";
2409
2431
  readonly sells: "none";
2432
+ readonly opening: readonly ["frame:inset", "media:photo", "words:headline"];
2410
2433
  }, {
2411
2434
  readonly id: "coach";
2412
2435
  readonly label: "Life or business coach";
@@ -2497,6 +2520,7 @@ declare const SPEC_BUSINESS_TYPES: readonly [{
2497
2520
  readonly stock: true;
2498
2521
  readonly booking: "must";
2499
2522
  readonly sells: "none";
2523
+ readonly opening: readonly ["frame:inset", "media:photo", "words:headline"];
2500
2524
  }, {
2501
2525
  readonly id: "law-accounting";
2502
2526
  readonly label: "Law or accounting firm";
@@ -2600,6 +2624,7 @@ declare const SPEC_BUSINESS_TYPES: readonly [{
2600
2624
  readonly stock: true;
2601
2625
  readonly booking: "sometimes";
2602
2626
  readonly sells: "never";
2627
+ readonly opening: readonly ["frame:inset", "media:photo", "words:headline"];
2603
2628
  }, {
2604
2629
  readonly id: "real-estate";
2605
2630
  readonly label: "Real estate agent";
@@ -2699,6 +2724,7 @@ declare const SPEC_BUSINESS_TYPES: readonly [{
2699
2724
  readonly stock: false;
2700
2725
  readonly booking: "sometimes";
2701
2726
  readonly sells: "none";
2727
+ readonly opening: readonly ["frame:inset", "media:photo", "words:headline"];
2702
2728
  }, {
2703
2729
  readonly id: "nonprofit";
2704
2730
  readonly label: "Nonprofit or community";
@@ -2789,6 +2815,7 @@ declare const SPEC_BUSINESS_TYPES: readonly [{
2789
2815
  readonly stock: true;
2790
2816
  readonly booking: "none";
2791
2817
  readonly sells: "none";
2818
+ readonly opening: readonly ["frame:inset", "media:photo", "words:headline"];
2792
2819
  }, {
2793
2820
  readonly id: "venue-events";
2794
2821
  readonly label: "Venue, weddings or events";
@@ -2888,6 +2915,7 @@ declare const SPEC_BUSINESS_TYPES: readonly [{
2888
2915
  readonly stock: true;
2889
2916
  readonly booking: "tables";
2890
2917
  readonly sells: "none";
2918
+ readonly opening: readonly ["frame:full", "media:photo", "words:wordmark"];
2891
2919
  }, {
2892
2920
  readonly id: "hotel-bnb";
2893
2921
  readonly label: "Hotel, B&B or guesthouse";
@@ -2987,6 +3015,7 @@ declare const SPEC_BUSINESS_TYPES: readonly [{
2987
3015
  readonly stock: true;
2988
3016
  readonly booking: "tables";
2989
3017
  readonly sells: "none";
3018
+ readonly opening: readonly ["frame:full", "media:photo", "words:wordmark"];
2990
3019
  }, {
2991
3020
  readonly id: "classes";
2992
3021
  readonly label: "Teacher, tutor or classes";
@@ -3083,6 +3112,7 @@ declare const SPEC_BUSINESS_TYPES: readonly [{
3083
3112
  readonly stock: true;
3084
3113
  readonly booking: "must";
3085
3114
  readonly sells: "offered";
3115
+ readonly opening: readonly ["frame:inset", "media:photo", "words:headline"];
3086
3116
  }];
3087
3117
  declare const SPEC_ANALYSIS_SHAPE: {
3088
3118
  readonly analysis: {
@@ -3396,6 +3426,15 @@ declare const SPEC_STATED_FACTS: {
3396
3426
  readonly reads: "PU3";
3397
3427
  readonly feeds: "popup";
3398
3428
  };
3429
+ readonly social: {
3430
+ readonly label: {
3431
+ readonly en: "Your social links";
3432
+ readonly he: "הקישורים שלך ברשתות החברתיות";
3433
+ };
3434
+ readonly how: "only addresses of the owner's own pages on social networks that the prompt states (instagram.com/…, facebook.com/…, wa.me/…), as written and separated by spaces; never searched for, completed or guessed";
3435
+ readonly reads: "FV1";
3436
+ readonly feeds: "footer";
3437
+ };
3399
3438
  };
3400
3439
 
3401
3440
  /**
@@ -3619,6 +3658,10 @@ interface BusinessType {
3619
3658
  readonly stock: boolean;
3620
3659
  readonly booking: `${BookingNeed}`;
3621
3660
  readonly sells: `${SellingNeed}`;
3661
+ /** Pictures first (harness OPENING_PICTURE, the 2026-11-28 reference baseline): the opening words its Home takes when
3662
+ * the plan names none — the references for the type open on a picture (`frame:full`) or keep the words first beside one
3663
+ * (`frame:inset`). Null: the Home opens as its plan writes. */
3664
+ readonly opening: ReadonlyArray<string> | null;
3622
3665
  }
3623
3666
  /** The 30, in the board's order. Assignment here proves the generated data fits the type. */
3624
3667
  declare const BUSINESS_TYPES: ReadonlyArray<BusinessType>;
@@ -3920,7 +3963,10 @@ declare function motionAdvice(typeId: string | null | undefined, animate: Animat
3920
3963
  * - the Plan step's two LINES — "Show your news in a popup" exists only when the owner STATED news (`news`, a stated fact:
3921
3964
  * never inferred, never a placeholder) and the stance is offer, and starts ticked; "Invite visitors to your newsletter
3922
3965
  * in a popup" is offered when the site has a newsletter form and the stance is not never, and is never ticked by itself.
3923
- * A generated site gets a popup only from one of these two lines. Pure: no transport, no clock.
3966
+ * - the Plan step's QUESTION (popup-ask, PA-D1…PA-D4) — "Any news or an offer to announce?" — asked whenever the stance is
3967
+ * not never; it starts with the stated news when the news line would show. The owner's answer IS stated news (their
3968
+ * own words are its value and its quote); an empty answer is no news, also over news the prompt stated.
3969
+ * A generated site gets a popup only from one of these lines. Pure: no transport, no clock.
3924
3970
  */
3925
3971
  /** How a popup is suggested. */
3926
3972
  declare enum PopupStance {
@@ -3983,16 +4029,49 @@ interface PopupLine {
3983
4029
  /** Starts ticked (always the owner's to untick). */
3984
4030
  readonly ticked: boolean;
3985
4031
  }
4032
+ /** The Plan step's question (popup-ask, PA-D1): "Any news or an offer to announce?" — optional, the owner's own words. */
4033
+ interface PopupAsk {
4034
+ readonly shown: boolean;
4035
+ /** What the answer starts as: the stated news when its line would show (offer stance), else empty. */
4036
+ readonly starting: string;
4037
+ }
3986
4038
  interface PopupSuggestion {
3987
4039
  readonly stance: PopupStance;
4040
+ /** "Any news or an offer to announce?" — asked whenever the stance is not never (PA-D2). */
4041
+ readonly ask: PopupAsk;
3988
4042
  /** "Show your news in a popup — '<news>'". */
3989
4043
  readonly news: PopupLine;
3990
4044
  /** "Invite visitors to your newsletter in a popup" — never ticked by itself. */
3991
4045
  readonly newsletter: PopupLine;
3992
4046
  readonly words: PopupWords;
3993
4047
  }
3994
- /** The Plan step's popup lines for a site (PU-D12). */
4048
+ /** The longest answer a popup holds (composite-core `POPUP_BODY_MAX_CHARS`): the Plan step's field stops there, and a
4049
+ * longer one makes no popup (`checkPopup` refuses it, said) — the owner's words are never cut. */
4050
+ declare const POPUP_NEWS_MAX_CHARS = 160;
4051
+ /** A stated fact as the popup reads it: the value and the owner's words it came from. */
4052
+ interface PopupNews {
4053
+ readonly value: string;
4054
+ readonly quote: string;
4055
+ }
4056
+ /** The Plan step's popup lines and question for a site (PU-D12, PA-D1). */
3995
4057
  declare function popupSuggestion(input: PopupSuggestionInput): PopupSuggestion;
4058
+ /** The owner's answer to "Any news or an offer to announce?" as stated news (PA-D3): their own words are its value AND
4059
+ * its quote — so every figure in it is the owner's (`checkPopup`'s figure check holds by construction). White space is
4060
+ * folded to single spaces (a line break in a one-line field); nothing else changes and nothing is cut. Null: no answer. */
4061
+ declare function newsFromAnswer(answer: string | null | undefined): PopupNews | null;
4062
+ /** What the owner left on the Plan step (or what "Build with these" starts with): the news line's tick, and the question's
4063
+ * answer when they were asked — `undefined` = never asked, `''` = asked and left empty. */
4064
+ interface PopupNewsChoice {
4065
+ readonly news?: boolean;
4066
+ readonly answer?: string | null;
4067
+ }
4068
+ /**
4069
+ * The news a build's popup is stamped from (PU-D11 / PU-D12 / PA-D3) — the ONE rule, judged by the same `popupSuggestion`
4070
+ * the Plan step draws: an ANSWER counts when the question was shown (the stance is not never) and is the news, an empty
4071
+ * one meaning none — also over news the prompt stated; without an answer, the reading's stated news counts when its line
4072
+ * showed and is ticked. Null: no news popup. Never invented — every word is the owner's.
4073
+ */
4074
+ declare function popupNewsOf(input: PopupSuggestionInput, choice: PopupNewsChoice | null | undefined): PopupNews | null;
3996
4075
 
3997
4076
  /**
3998
4077
  * What the reading of a prompt returns (AI plan rev 3 §3d): one of the 30 kinds of business (and the two
@@ -4774,10 +4853,18 @@ interface ComposeRun {
4774
4853
  * - `footerNever` — what that kind of business's footer never wears (AW12-D10, harness FOOTER_NEVER), mended and said by
4775
4854
  * `checkFooter` (`type-never`);
4776
4855
  * - `headerNever` — what that kind of business's header never stands on (HI3-D12, harness HEADER_NEVER), mended to its
4777
- * own ground and said by `checkHeader` (`type-never`).
4856
+ * own ground and said by `checkHeader` (`type-never`);
4857
+ * - `opening` — pictures first: the Home opening the kind of business takes when its plan names none (harness
4858
+ * OPENING_PICTURE), given only when a picture can come (`pictureCanCome`).
4778
4859
  * An unknown or absent type gives nothing: the composer's defaults hold. (`calm` stays `composeContextOf`'s own argument.)
4779
4860
  */
4780
- declare function businessComposeContext(typeId: string | null | undefined): Pick<ComposeContext, 'businessType' | 'footerNever' | 'headerNever'>;
4861
+ declare function businessComposeContext(typeId: string | null | undefined, decisions?: Pick<BuildComposeDecisions, 'picturesRefused' | 'ownPhotos' | 'layoutPhotos'> | null): Pick<ComposeContext, 'businessType' | 'footerNever' | 'headerNever' | 'opening'>;
4862
+ /**
4863
+ * Pictures first: can a picture come for the Home's opening? Never when the owner ruled pictures out; the owner's own photo
4864
+ * always can; else stock, where the kind of business lets stock stand in (`BusinessType.stock` — never the work itself) and
4865
+ * the owner did not refuse stock. Pure.
4866
+ */
4867
+ declare function pictureCanCome(type: Pick<BusinessType, 'stock'>, decisions?: Pick<BuildComposeDecisions, 'picturesRefused' | 'ownPhotos' | 'layoutPhotos'> | null): boolean;
4781
4868
  /**
4782
4869
  * THE compose context of a build run (moved from iox-cms `site-builds.service`, iox-cms-client#111): its year, its
4783
4870
  * layouts' photos, its tier, the legal context its preflight read (AW1), whether its business is calm (AW6 — the body
@@ -4788,5 +4875,5 @@ declare function businessComposeContext(typeId: string | null | undefined): Pick
4788
4875
  */
4789
4876
  declare function runComposeContext(run: ComposeRun): ComposeContext;
4790
4877
 
4791
- export { ANIMATE_ADVICE_STEPS, AnalysisIssueCode, AnalysisLocale, AvoidCheck, BUSINESS_TYPES, BUSINESS_TYPE_IDS, BookingNeed, COPY_LENGTH_ORDER, ComposedPageState, CopyLength, FILM_IDEAS, FILM_WORDS, FilmIdea, FilmIdeaReason, FilmStance, FilmStart, GENERATION_LIMITS, HARNESS_SOURCE, LITTLE_MOVEMENT_AVOID, LITTLE_MOVEMENT_CAP, LintKind, MAX_ANALYSIS_MOODS, MAX_PIXEL_SAMPLES, MAX_READ_PICTURES, NEEDS, NEED_IDS, NeedSource, PALETTE_SIZE, PALETTE_THRESHOLDS, POPUP_WORDS, PRODUCTS_NEED, PictureRole, PicturesUnavailable, PlanChangeOutcome, PopupStance, PresetFit, RANK_WEIGHTS, READING_SHAPE, READ_ANIMATE, READ_WEIGHTS, RankReason, ReaderState, ReadingIssueCode, SITE_ANALYSIS_SCHEMA_NAME, SITE_READING_SCHEMA_NAME, SPEC_ANALYSIS_SHAPE, SPEC_BUSINESS_TYPES, SPEC_FILM_IDEAS, SPEC_HARNESS_EXAMPLES, SPEC_HARNESS_SOURCE, SPEC_NEEDS, SPEC_POPUP_STANCES, SPEC_STATED_FACTS, SPEC_STRUCTURES, SPEC_USER_AVOIDS, STATED_FACTS, STATED_FACT_KEYS, STRUCTURES, SellingNeed, SiteReadRefusal, StyleReadGround, StyleReadHeadings, StyleReadMotion, StyleReadSourceKind, USER_AVOID_IDS, VoiceFormality, VoicePerson, addressesIn, analysisFromWire, analysisPromptContext, analysisToWire, bestRankedPreset, businessComposeContext, businessTypeById, calmerChoice, decodeSiteReading, filmIdeaFor, filmIdeasOf, filmStanceFor, filmWordsIn, inferNeeds, isCalmBusiness, isCalmBusinessType, isLookRule, keywordsIn, lintDesign, lintSentence, lookMatches, mapStyleRead, matchBusinessType, matchBusinessTypes, measurePalette, mergeStyleReads, motionAdvice, motionFor, needsSell, normalizeAddress, offeredNeeds, oklchHue, paletteBrand, paletteGround, paletteSamples, pictureStyleRead, pixelSamples, popupStanceFor, popupSuggestion, popupWordsIn, presetDesign, presetHasSerifHeadings, presetLook, presetReason, presetsByFlavor, rankStylePresets, rankWithReferences, readPalette, referenceSeed, runComposeContext, seedPassesPreset, siteAnalysisJsonSchema, siteReadingJsonSchema, startingDesign, structureFor, unplacedPicturesOf, userAvoidRule, validateSiteAnalysis, validateSiteReading, withSellingNeed, withoutAddress };
4792
- export type { AiGenerationView, AnalysisContext, AnalysisIssue, AnalysisValidation, AvoidRule, BusinessType, BusinessTypeColumn, BusinessTypeFilm, BusinessTypeFooter, BusinessTypeHeader, BusinessTypeLists, BusinessTypeMatch, CheckRule, ColourSample, ComposeRun, ComposedPageView, FactRead, FilmIdeaChoice, FilmIdeaDef, FilmIdeaInput, FilmIdeaSkip, FilmWords, GenerationBuildRequest, GenerationFileView, GenerationPicturesView, GenerationReadersView, GenerationStartRequest, GoodFit, LayoutCheckRequest, LayoutPhotoView, LintFinding, LintSite, LookCondition, LookDesign, LookRule, MeasuredPicture, MotionBasis, MotionInput, MotionStart, NeedDef, NeedId, PaletteColour, PaletteReading, PictureStyle, PlanRevisionView, PopupLine, PopupSuggestion, PopupSuggestionInput, PopupWords, PresetFlavorGroup, PromptContext, PromptContextOptions, PromptSection, RankInput, RankedPreset, ReadingIssue, ReferenceSeed, RuleLine, SiteAnalysis, SiteAuditView, SiteNeed, SiteReaderView, SiteReading, StartingDesign, StatedFactDef, StatedFactKey, StructureChoice, StructureId, StyleHints, StyleRead, UnplacedPictures, UserAvoidId };
4878
+ export { ANIMATE_ADVICE_STEPS, AnalysisIssueCode, AnalysisLocale, AvoidCheck, BUSINESS_TYPES, BUSINESS_TYPE_IDS, BookingNeed, COPY_LENGTH_ORDER, ComposedPageState, CopyLength, FILM_IDEAS, FILM_WORDS, FilmIdea, FilmIdeaReason, FilmStance, FilmStart, GENERATION_LIMITS, HARNESS_SOURCE, LITTLE_MOVEMENT_AVOID, LITTLE_MOVEMENT_CAP, LintKind, MAX_ANALYSIS_MOODS, MAX_PIXEL_SAMPLES, MAX_READ_PICTURES, NEEDS, NEED_IDS, NeedSource, PALETTE_SIZE, PALETTE_THRESHOLDS, POPUP_NEWS_MAX_CHARS, POPUP_WORDS, PRODUCTS_NEED, PictureRole, PicturesUnavailable, PlanChangeOutcome, PopupStance, PresetFit, RANK_WEIGHTS, READING_SHAPE, READ_ANIMATE, READ_WEIGHTS, RankReason, ReaderState, ReadingIssueCode, SITE_ANALYSIS_SCHEMA_NAME, SITE_READING_SCHEMA_NAME, SPEC_ANALYSIS_SHAPE, SPEC_BUSINESS_TYPES, SPEC_FILM_IDEAS, SPEC_HARNESS_EXAMPLES, SPEC_HARNESS_SOURCE, SPEC_NEEDS, SPEC_POPUP_STANCES, SPEC_STATED_FACTS, SPEC_STRUCTURES, SPEC_USER_AVOIDS, STATED_FACTS, STATED_FACT_KEYS, STRUCTURES, SellingNeed, SiteReadRefusal, StyleReadGround, StyleReadHeadings, StyleReadMotion, StyleReadSourceKind, USER_AVOID_IDS, VoiceFormality, VoicePerson, addressesIn, analysisFromWire, analysisPromptContext, analysisToWire, bestRankedPreset, businessComposeContext, businessTypeById, calmerChoice, decodeSiteReading, filmIdeaFor, filmIdeasOf, filmStanceFor, filmWordsIn, inferNeeds, isCalmBusiness, isCalmBusinessType, isLookRule, keywordsIn, lintDesign, lintSentence, lookMatches, mapStyleRead, matchBusinessType, matchBusinessTypes, measurePalette, mergeStyleReads, motionAdvice, motionFor, needsSell, newsFromAnswer, normalizeAddress, offeredNeeds, oklchHue, paletteBrand, paletteGround, paletteSamples, pictureCanCome, pictureStyleRead, pixelSamples, popupNewsOf, popupStanceFor, popupSuggestion, popupWordsIn, presetDesign, presetHasSerifHeadings, presetLook, presetReason, presetsByFlavor, rankStylePresets, rankWithReferences, readPalette, referenceSeed, runComposeContext, seedPassesPreset, siteAnalysisJsonSchema, siteReadingJsonSchema, startingDesign, structureFor, unplacedPicturesOf, userAvoidRule, validateSiteAnalysis, validateSiteReading, withSellingNeed, withoutAddress };
4879
+ export type { AiGenerationView, AnalysisContext, AnalysisIssue, AnalysisValidation, AvoidRule, BusinessType, BusinessTypeColumn, BusinessTypeFilm, BusinessTypeFooter, BusinessTypeHeader, BusinessTypeLists, BusinessTypeMatch, CheckRule, ColourSample, ComposeRun, ComposedPageView, FactRead, FilmIdeaChoice, FilmIdeaDef, FilmIdeaInput, FilmIdeaSkip, FilmWords, GenerationBuildRequest, GenerationFileView, GenerationPicturesView, GenerationReadersView, GenerationStartRequest, GoodFit, LayoutCheckRequest, LayoutPhotoView, LintFinding, LintSite, LookCondition, LookDesign, LookRule, MeasuredPicture, MotionBasis, MotionInput, MotionStart, NeedDef, NeedId, PaletteColour, PaletteReading, PictureStyle, PlanRevisionView, PopupAsk, PopupLine, PopupNews, PopupNewsChoice, PopupSuggestion, PopupSuggestionInput, PopupWords, PresetFlavorGroup, PromptContext, PromptContextOptions, PromptSection, RankInput, RankedPreset, ReadingIssue, ReferenceSeed, RuleLine, SiteAnalysis, SiteAuditView, SiteNeed, SiteReaderView, SiteReading, StartingDesign, StatedFactDef, StatedFactKey, StructureChoice, StructureId, StyleHints, StyleRead, UnplacedPictures, UserAvoidId };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vectoriox/iox-ui",
3
- "version": "5.198.0",
3
+ "version": "5.199.0",
4
4
  "peerDependencies": {
5
5
  "@angular/common": ">=20.0.0",
6
6
  "@angular/core": ">=20.0.0",
@@ -236,6 +236,12 @@ export const SERVER_ELEMENT_ACTION_TYPES: ReadonlySet<string> =
236
236
  export const BEHAVIOUR_ACTION_TYPES: ReadonlySet<string> =
237
237
  new Set(['navigate', 'scrollTo', 'submitForm', 'copyToClipboard']);
238
238
 
239
+ /** FV1b (footer `holds.top`): a `scrollTo` with no target — or `self` — scrolls the PAGE to its top. The live engine's
240
+ * rule since A1c; ONE rule both renderers ask (the canvas joins once it builds against this version). */
241
+ export function scrollsToPageTop(action: { readonly type: string; readonly target?: string | null }): boolean {
242
+ return action.type === 'scrollTo' && (!action.target || action.target === 'self');
243
+ }
244
+
239
245
  /** The toast action's dispatch set (premium M5) — the engines branch on it beside DIALOG / POPOVER. */
240
246
  export const TOAST_ACTION_TYPES: ReadonlySet<string> = new Set(['showToast']);
241
247
 
@@ -10,7 +10,8 @@ import { resolveRepeaterItems } from './data-source-resolver';
10
10
  *
11
11
  * - `isNumberedPlaceholderTitle` — words and then a number (G-D1). The Publishable gate reads it as well.
12
12
  * - `isPlaceholderRow(row, titleField)` — a row marked `isSample` whose title is such a placeholder.
13
- * - `listTitleField(list)` — the field a list's card shows as its title.
13
+ * - `listTitleField(list)` — the field a list's card shows as its title; `listPlaceholderFields(list)` — that, else
14
+ * the fields a list with no title shows (a quote slider's person line, engine#41).
14
15
  * - `planPlaceholderHides(roots, resolved)` — what the live engine leaves out (G-D3): placeholder rows are dropped,
15
16
  * a list with no live row is not drawn, and its top-level section hides when only its frame is left (heading,
16
17
  * eyebrow, lead text, buttons). Pages and their nav links stay (G-D4).
@@ -47,11 +48,14 @@ function fieldOf(row: Record<string, unknown>, path: string): unknown {
47
48
  * out. `titleField` is the list's title field (`listTitleField`); without one the row's `title` / `name` / `label` is
48
49
  * read. A row with no title to read is never a placeholder: when in doubt, show it.
49
50
  */
50
- export function isPlaceholderRow(row: unknown, titleField?: string | null): boolean {
51
+ export function isPlaceholderRow(row: unknown, titleField?: string | ReadonlyArray<string> | null): boolean {
51
52
  if (!row || typeof row !== 'object' || Array.isArray(row)) return false;
52
53
  const r = row as Record<string, unknown>;
53
54
  if (r[SAMPLE_ROW_FIELD] !== true) return false;
54
- const field = titleField || PLACEHOLDER_TITLE_FALLBACK_FIELDS.find(f => typeof r[f] === 'string');
55
+ // engine#41: a list that names no title passes the fields it SHOWS — any of them still "<words> <n>" is the sample's
56
+ // unnamed line (a quote slider's "Guest 1").
57
+ if (Array.isArray(titleField) && titleField.length) return titleField.some(f => isPlaceholderRow(row, f));
58
+ const field = (typeof titleField === 'string' && titleField) || PLACEHOLDER_TITLE_FALLBACK_FIELDS.find(f => typeof r[f] === 'string');
55
59
  if (!field) return false;
56
60
  const title = fieldOf(r, field);
57
61
  return typeof title === 'string' && isNumberedPlaceholderTitle(title);
@@ -117,6 +121,27 @@ export function listTitleField(list: PlaceholderPlanNode | null | undefined): st
117
121
  return heading ? contentPath(heading, source) : null;
118
122
  }
119
123
 
124
+ /** The node types whose bound words a list SHOWS on each row. */
125
+ const SHOWN_WORD_TYPES: ReadonlySet<string> = new Set(['Heading', 'Text', 'Link', 'Button', 'ButtonBlock']);
126
+
127
+ /**
128
+ * The fields a list's rows are judged by (engine#41): its title field (`listTitleField`) when it names one, else every
129
+ * field its own parts SHOW as words (a quote slider's quote and person — the person line "Guest 1" is the sample's
130
+ * unnamed line), else `null` (then `isPlaceholderRow` falls back to title / name / label). Nested lists are not looked
131
+ * into. ONE reading for the live rule and the builder's ghost rows.
132
+ */
133
+ export function listPlaceholderFields(list: PlaceholderPlanNode | null | undefined): string | string[] | null {
134
+ const title = listTitleField(list);
135
+ if (title) return title;
136
+ const source = listSourceOf(list);
137
+ if (!list || !source) return null;
138
+ const shown = descendants(list, n => LIST_NODE_TYPES.has(n.type ?? ''))
139
+ .filter(n => SHOWN_WORD_TYPES.has(n.type ?? ''))
140
+ .map(n => contentPath(n, source))
141
+ .filter(Boolean);
142
+ return shown.length ? [...new Set(shown)] : null;
143
+ }
144
+
120
145
  /**
121
146
  * The node types that are only a list section's FRAME (G-D3): its heading, eyebrow, lead text, buttons, links, icons
122
147
  * and the boxes around them. A section left with only these hides with its list. Anything else (a picture, a video, a
@@ -162,7 +187,7 @@ export function planPlaceholderHides(
162
187
  const liveRows = (list: PlaceholderPlanNode, source: string): unknown[] | null => {
163
188
  if (!(source in data)) return null;
164
189
  const all = resolveRepeaterItems(data[source]);
165
- const title = listTitleField(list);
190
+ const title = listPlaceholderFields(list);
166
191
  const live = all.filter(r => !isPlaceholderRow(r, title));
167
192
  if (live.length !== all.length && Array.isArray(data[source])) rows[source] = live;
168
193
  return live;
@@ -60,6 +60,18 @@ export enum MenuPhoneForm {
60
60
  Full = 'full',
61
61
  }
62
62
 
63
+ /** What the menu shows besides its own head (HI2 shelves, header-builder board v2 "menu contents"): the page names (today's),
64
+ * the page names LARGE in the look's display face (Flyward's and Hotel Aurelia's full-screen index), the first four large
65
+ * with a MORE row of the rest and a picture card (Savvia's card: four names at 48px, "MÁS", small links and a reel tile),
66
+ * or pictured cards for the site's main collections beside the page names (Vonder's top panel: two category photo tiles
67
+ * and the page list). `two-levels` waits for HI6 and is drawn as the page names. */
68
+ export enum MenuShows {
69
+ Links = 'links',
70
+ Big = 'big',
71
+ WordsCard = 'words-card',
72
+ Pictures = 'pictures',
73
+ }
74
+
63
75
  /** The traits, stored in the node's props (no default: a node saved before HI2 saves none). */
64
76
  export enum MenuTrait {
65
77
  /** On the menu (the Dialog). */
@@ -67,6 +79,8 @@ export enum MenuTrait {
67
79
  Reveal = 'menuReveal',
68
80
  Hover = 'menuHover',
69
81
  Phone = 'menuPhone',
82
+ /** HI2: what the menu shows (`MenuShows`) — the shelves' parts are its children; the trait sizes them. */
83
+ Shows = 'menuShows',
70
84
  /** On the menu button AND the menu's Close (the same button, open). */
71
85
  Button = 'menuButton',
72
86
  }
@@ -76,6 +90,7 @@ export enum MenuAttribute {
76
90
  Reveal = 'data-iox-reveal',
77
91
  Hover = 'data-iox-menu-hover',
78
92
  Phone = 'data-iox-menu-phone',
93
+ Shows = 'data-iox-menu-shows',
79
94
  Button = 'data-iox-menu-button',
80
95
  }
81
96
 
@@ -89,6 +104,8 @@ export interface MenuLook {
89
104
  button: MenuButtonKind;
90
105
  hover: MenuHover;
91
106
  phone: MenuPhoneForm;
107
+ /** HI2: what it shows. */
108
+ shows: MenuShows;
92
109
  }
93
110
 
94
111
  /** Today's menu, every default (R-H4: it writes nothing). */
@@ -98,6 +115,7 @@ export const DEFAULT_MENU_LOOK: Readonly<MenuLook> = Object.freeze({
98
115
  button: MenuButtonKind.Lines,
99
116
  hover: MenuHover.Line,
100
117
  phone: MenuPhoneForm.Drawer,
118
+ shows: MenuShows.Links,
101
119
  });
102
120
 
103
121
  const valueOf = <E extends string>(values: ReadonlyArray<E>, fallback: E) => (v: unknown): E =>
@@ -108,6 +126,8 @@ export const menuRevealOf = valueOf(Object.values(MenuReveal), DEFAULT_MENU_LOOK
108
126
  export const menuButtonOf = valueOf(Object.values(MenuButtonKind), DEFAULT_MENU_LOOK.button);
109
127
  export const menuHoverOf = valueOf(Object.values(MenuHover), DEFAULT_MENU_LOOK.hover);
110
128
  export const menuPhoneOf = valueOf(Object.values(MenuPhoneForm), DEFAULT_MENU_LOOK.phone);
129
+ /** A word the product does not draw (`two-levels`, HI6) reads as the page names. */
130
+ export const menuShowsOf = valueOf(Object.values(MenuShows), DEFAULT_MENU_LOOK.shows);
111
131
 
112
132
  /** Reads a trait (`props` on a serialized node). */
113
133
  export type MenuTraitReader = (name: MenuTrait) => unknown;
@@ -119,10 +139,12 @@ export function menuDialogAttributes(read: MenuTraitReader): Record<string, stri
119
139
  const reveal = menuRevealOf(read(MenuTrait.Reveal));
120
140
  const hover = menuHoverOf(read(MenuTrait.Hover));
121
141
  const phone = menuPhoneOf(read(MenuTrait.Phone));
142
+ const shows = menuShowsOf(read(MenuTrait.Shows));
122
143
  if (form !== DEFAULT_MENU_LOOK.form) out[MenuAttribute.Form] = form;
123
144
  if (reveal !== DEFAULT_MENU_LOOK.reveal) out[MenuAttribute.Reveal] = reveal;
124
145
  if (hover !== DEFAULT_MENU_LOOK.hover) out[MenuAttribute.Hover] = hover;
125
146
  if (phone !== DEFAULT_MENU_LOOK.phone) out[MenuAttribute.Phone] = phone;
147
+ if (shows !== DEFAULT_MENU_LOOK.shows) out[MenuAttribute.Shows] = shows;
126
148
  return out;
127
149
  }
128
150
 
@@ -139,6 +161,7 @@ export function menuDialogProps(look: Partial<MenuLook>): Record<string, string>
139
161
  if (look.reveal && look.reveal !== DEFAULT_MENU_LOOK.reveal) out[MenuTrait.Reveal] = look.reveal;
140
162
  if (look.hover && look.hover !== DEFAULT_MENU_LOOK.hover) out[MenuTrait.Hover] = look.hover;
141
163
  if (look.phone && look.phone !== DEFAULT_MENU_LOOK.phone) out[MenuTrait.Phone] = look.phone;
164
+ if (look.shows && look.shows !== DEFAULT_MENU_LOOK.shows) out[MenuTrait.Shows] = look.shows;
142
165
  return out;
143
166
  }
144
167
 
@@ -50,6 +50,45 @@ const ROLE_PREFIX = 'iox-role-';
50
50
  const ROLE_SHAPE = /^[a-z][a-z0-9-]*(\.[a-z][a-z0-9-]*)*$/;
51
51
  const MARKER_PREFIX = `${ELEMENT_STYLE_MARKER_CLASS}-`;
52
52
 
53
+ /** The scheme rows that name a scheme's GROUND (what its band and its boxes are painted). */
54
+ const SCHEME_GROUND_ROWS: ReadonlyArray<string> = ['section-bg', 'bg', 'surface'];
55
+ /** The row a scheme re-declares when it changes the ink. */
56
+ const SCHEME_INK_ROW = 'text';
57
+ /** The one token a scheme row or a style value names: `var(--iox-x)` or the contract's `{{x}}` / `{{~x}}`. */
58
+ const ONE_GROUND_TOKEN = /^(?:var\(\s*--iox-([a-z0-9-]+)\s*\)|\{\{~?([a-z0-9-]+)\}\})$/;
59
+ const groundToken = (v: unknown): string | null => {
60
+ const m = ONE_GROUND_TOKEN.exec(String(v ?? '').trim());
61
+ return m ? (m[1] ?? m[2]) : null;
62
+ };
63
+ /**
64
+ * Ground token → the scheme it is the ground of, read from the contract (iox-ui#186): only a scheme that RE-DECLARES the
65
+ * ink (a dark band's words, buttons, lines) and whose ground tokens keep their meaning inside it — Inverse paints
66
+ * `inverse-bg` and never re-declares it, so a node painted `var(--iox-inverse-bg)` that wears Inverse looks the same and
67
+ * everything in it reads. Brand and Muted re-declare their own grounds (`accent`, `text-muted`), so a painted
68
+ * `var(--iox-accent)` cannot wear Brand without changing colour: those are never inferred.
69
+ */
70
+ const SCHEME_OF_GROUND: ReadonlyMap<string, ColorScheme> = (() => {
71
+ const out = new Map<string, ColorScheme>();
72
+ for (const [id, { set }] of Object.entries(SPEC_SCHEMES as Readonly<Record<string, { set: Readonly<Record<string, string>> }>>)) {
73
+ if (id === ColorScheme.Default || !(SCHEME_INK_ROW in set)) continue;
74
+ const grounds = SCHEME_GROUND_ROWS.map(row => groundToken(set[row])).filter((t): t is string => !!t);
75
+ if (!grounds.length || grounds.some(t => t in set)) continue;
76
+ for (const t of grounds) if (!out.has(t)) out.set(t, id as ColorScheme);
77
+ }
78
+ return out;
79
+ })();
80
+
81
+ /**
82
+ * The scheme a node's painted ground IS (iox-ui#186): a Section or Container whose `backgroundColor` is exactly a
83
+ * scheme's own ground token (`var(--iox-inverse-bg)`) — the free stamp gives it that scheme so every token the look
84
+ * reads inside (a button's ink and outline, a line, a link) is re-declared for the ground, not only the words someone
85
+ * coloured by hand. Null for any other value (a page token, a colour-mix, a ground a scheme re-declares).
86
+ */
87
+ export function schemeOfGround(backgroundColor: unknown): ColorScheme | null {
88
+ const token = groundToken(backgroundColor);
89
+ return token ? SCHEME_OF_GROUND.get(token) ?? null : null;
90
+ }
91
+
53
92
  /** `iox-scheme-<id>` for a known NON-default scheme, else null — an unknown id never reaches a class attribute. */
54
93
  export function colorSchemeClass(id: unknown): string | null {
55
94
  return typeof id === 'string' && id !== ColorScheme.Default && SCHEME_IDS.has(id) ? `${SCHEME_PREFIX}${id}` : null;
@@ -1,9 +1,9 @@
1
1
  import {
2
- DesignTokenLike, elementStyleById, parseHexColor, ResolvedMode, resolveTokenValues, wcagContrastRatio,
2
+ DesignTokenLike, elementStyleById, parseHexColor, ResolvedMode, schemeTokenResolver, wcagContrastRatio,
3
3
  } from '@vectoriox/iox-ui/design-core';
4
4
  import {
5
5
  FREE_ELEMENT_STYLES, FREE_HOLDERS, FREE_LEAD_ROLE, FREE_MOVES, FREE_PHONE_LAYERS, FREE_WORD_TYPES, FreeLayer, FreeNode,
6
- FreeNodeType, FreePage, FreePictures, FreePurpose, FreeStyle, FreeTrigger, walkFree,
6
+ FreeNodeType, FreePage, FreePictures, FreePurpose, freeSchemeOf, FreeStyle, FreeTrigger, walkFree,
7
7
  } from './free-wire';
8
8
  import { factIssues, PlanWordContext, WrittenText } from './plan-words';
9
9
  import { PageSectionPlan } from './site-plan.model';
@@ -391,23 +391,31 @@ function groundHex(grounds: ReadonlyArray<string | null>, values: Readonly<Recor
391
391
  return null;
392
392
  }
393
393
 
394
+ /** The node types whose words the tree pair check judges: the words, and a Button's label (iox-ui#186). */
395
+ const PAIRED_TYPES: ReadonlyArray<FreeNodeType> = [FreeNodeType.Heading, FreeNodeType.Text, FreeNodeType.Button];
396
+
394
397
  /**
395
- * THE TREE PAIR CHECK (R-H12, gate 2's tree half — `auditDesignContrast` judges the look, not a tree): each Heading's and
396
- * Text's ink token against the ground token of the nearest painted node, resolved in every mode the site shows, AA
397
- * (4.5, 3 for display / h1 / h2). A pair that is not two hex tokens (a colour-mix, a picture behind) is left to the
398
- * real-pixel check. A Button paints its own pair through its element style, which the look's audit already covers.
398
+ * THE TREE PAIR CHECK (R-H12, gate 2's tree half — `auditDesignContrast` judges the look, not a tree): each Heading's,
399
+ * Text's and Button's ink token against the ground token of the nearest painted node, resolved in every mode the site
400
+ * shows, AA (4.5, 3 for display / h1 / h2). Every token is resolved INSIDE the schemes the stamp gives the boxes above
401
+ * (`freeSchemeOf`, iox-ui#186) — so a dark band's plain `text` reads its light ink, as it renders. A Button is judged too:
402
+ * its element style paints its ink (and, when it paints none, the ground beneath shows through — an outline button on a
403
+ * band the look never audited). A pair that is not two hex tokens (a colour-mix, a picture behind) is left to the
404
+ * real-pixel check.
399
405
  */
400
406
  export function freeContrastIssues(page: FreePage, ctx: Pick<FreeJudgeContext, 'tokens' | 'modes'>): FreeIssue[] {
401
407
  const out: FreeIssue[] = [];
402
- const resolved = (ctx.modes?.length ? ctx.modes : (['light'] as ResolvedMode[])).map(mode => ({ mode, values: resolveTokenValues(ctx.tokens, mode) }));
408
+ const resolved = (ctx.modes?.length ? ctx.modes : (['light'] as ResolvedMode[])).map(mode => ({ mode, valuesIn: schemeTokenResolver(ctx.tokens, mode) }));
403
409
  for (const { node, path, up, section } of walkFree(page?.sections ?? [])) {
404
410
  if (page.sections[section]?.readyMade) continue;
405
- if (node.type !== FreeNodeType.Heading && node.type !== FreeNodeType.Text) continue;
411
+ if (!PAIRED_TYPES.includes(node.type)) continue;
406
412
  const ink = inkOf(node, up);
407
413
  if (!ink) continue;
408
414
  const grounds = groundsOf(node, up);
415
+ const schemes = up.map(freeSchemeOf).filter((s): s is string => !!s);
409
416
  const need = LARGE_STYLES.includes(node.elementStyle ?? '') ? FREE_CONTRAST.large : FREE_CONTRAST.text;
410
- for (const { mode, values } of resolved) {
417
+ for (const { mode, valuesIn } of resolved) {
418
+ const values = valuesIn(schemes.length ? schemes : 'default');
411
419
  const a = values[ink];
412
420
  const ground = groundHex(grounds, values);
413
421
  if (!a || !ground || !parseHexColor(a)) continue;