@vectoriox/iox-ui 5.197.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.
- package/actions-core/index.d.ts +7 -1
- package/composite-core/index.d.ts +16 -2
- package/data-core/index.d.ts +11 -3
- package/design-core/index.d.ts +185 -28
- package/fesm2022/vectoriox-iox-ui-actions-core.mjs +6 -1
- package/fesm2022/vectoriox-iox-ui-actions-core.mjs.map +1 -1
- package/fesm2022/vectoriox-iox-ui-composite-core.mjs +34 -2
- package/fesm2022/vectoriox-iox-ui-composite-core.mjs.map +1 -1
- package/fesm2022/vectoriox-iox-ui-data-core.mjs +30 -4
- package/fesm2022/vectoriox-iox-ui-data-core.mjs.map +1 -1
- package/fesm2022/vectoriox-iox-ui-design-core.mjs +323 -72
- package/fesm2022/vectoriox-iox-ui-design-core.mjs.map +1 -1
- package/fesm2022/vectoriox-iox-ui-generation-core.mjs +17351 -15175
- package/fesm2022/vectoriox-iox-ui-generation-core.mjs.map +1 -1
- package/fesm2022/vectoriox-iox-ui-harness-core.mjs +243 -38
- package/fesm2022/vectoriox-iox-ui-harness-core.mjs.map +1 -1
- package/fesm2022/vectoriox-iox-ui.mjs +2 -2
- package/fesm2022/vectoriox-iox-ui.mjs.map +1 -1
- package/generation-core/index.d.ts +1703 -264
- package/harness-core/index.d.ts +93 -6
- package/package.json +1 -1
- package/src/actions-core/element-actions.ts +6 -0
- package/src/composite-core/header.ts +34 -1
- package/src/data-core/placeholder-rows.ts +29 -4
- package/src/design-core/brand.ts +58 -5
- package/src/design-core/contrast-audit.ts +49 -22
- package/src/design-core/design-apply.ts +34 -3
- package/src/design-core/flavor-fixtures.generated.ts +123 -123
- package/src/design-core/flavor-spec.generated.ts +44 -4
- package/src/design-core/flavor-tokens.ts +1 -1
- package/src/design-core/header-behaviour.ts +72 -13
- package/src/design-core/menu-look.ts +23 -0
- package/src/design-core/motion-language.ts +5 -14
- package/src/design-core/node-classes.ts +39 -0
- package/src/design-core/preloader.ts +4 -5
- package/src/generation-core/body-mix.ts +40 -102
- package/src/generation-core/check-free.ts +22 -11
- package/src/generation-core/check-layout.ts +10 -4
- package/src/generation-core/check-list.ts +3 -25
- package/src/generation-core/colour-mix.ts +296 -0
- package/src/generation-core/compose-free.ts +47 -20
- package/src/generation-core/compose-site.ts +259 -59
- package/src/generation-core/footer-mix.ts +258 -64
- package/src/generation-core/free-fallback.ts +6 -4
- package/src/generation-core/free-opening.ts +13 -2
- package/src/generation-core/free-parts.ts +87 -0
- package/src/generation-core/free-slot-words.ts +30 -0
- package/src/generation-core/free-wire.ts +8 -0
- package/src/generation-core/generation-tier.ts +6 -17
- package/src/generation-core/header-mix.ts +73 -3
- package/src/generation-core/layout-drawers.ts +3 -2
- package/src/generation-core/layout-wire.ts +10 -16
- package/src/generation-core/legal.ts +24 -0
- package/src/generation-core/list-panel.ts +3 -3
- package/src/generation-core/list-table.ts +5 -14
- package/src/generation-core/list-words.ts +2 -1
- package/src/generation-core/menu-shelves.ts +138 -0
- package/src/generation-core/nav-shape.ts +138 -15
- package/src/generation-core/node-baselines.generated.ts +1 -0
- package/src/generation-core/opening-mix.ts +7 -34
- package/src/generation-core/part-tier.ts +14 -0
- package/src/generation-core/patterns.ts +7 -0
- package/src/generation-core/plan-wire.ts +32 -43
- package/src/generation-core/public-api.ts +3 -0
- package/src/generation-core/site-build-run.ts +8 -0
- package/src/generation-core/site-plan.model.ts +3 -0
- package/src/generation-core/site-spec.generated.ts +1383 -189
- package/src/generation-core/validate-site-plan.ts +6 -5
- package/src/harness-core/business-types.ts +4 -0
- package/src/harness-core/harness-spec.generated.ts +189 -30
- package/src/harness-core/popup-stance.ts +56 -3
- package/src/harness-core/run-compose-context.ts +25 -5
- package/styles/iox-design.css +162 -3
package/harness-core/index.d.ts
CHANGED
|
@@ -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
|
-
*
|
|
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
|
|
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
|
@@ -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
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { HeaderBehaviour, HeaderEdge, headerBehaviourOf, headerEdgeOf, HeaderGround, headerGroundOf, HeaderInk, headerInkOf, headerStaysAtTop, HeaderTrait } from '@vectoriox/iox-ui/design-core';
|
|
1
|
+
import { HeaderBehaviour, HeaderBrand, headerBrandOf, HeaderEdge, headerBehaviourOf, headerEdgeOf, HeaderGround, headerGroundOf, HeaderInk, headerInkOf, HeaderShape, headerShapeFloats, headerShapeOf, headerStaysAtTop, HeaderTrait } from '@vectoriox/iox-ui/design-core';
|
|
2
2
|
|
|
3
3
|
import { CompositeNode, readProp, readStyle, writeProp, writeStyles } from './composite-node';
|
|
4
4
|
|
|
@@ -62,3 +62,36 @@ export function setHeaderGround(node: CompositeNode, ground: HeaderGround | `${H
|
|
|
62
62
|
export function headerGroundOfNode(node: CompositeNode | null | undefined): HeaderGround {
|
|
63
63
|
return headerGroundOf(node ? readProp(node, HeaderTrait.Ground) : undefined);
|
|
64
64
|
}
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* The header's outline (HI3 slice 2: bar · pill · islands) — ONE edit for the Header studio ▸ Bar and the composer. `bar`
|
|
68
|
+
* clears a stored word and writes nothing on a header that never had one (R-H4). A floating header draws its ground on
|
|
69
|
+
* the ground layer, so like a ground it is the containing block of it: a stored `static` becomes `relative`. False when
|
|
70
|
+
* nothing changed.
|
|
71
|
+
*/
|
|
72
|
+
export function setHeaderShape(node: CompositeNode, shape: HeaderShape | `${HeaderShape}`): boolean {
|
|
73
|
+
const want = headerShapeOf(shape);
|
|
74
|
+
if (headerShapeOf(readProp(node, HeaderTrait.Shape)) === want) return false;
|
|
75
|
+
const changed = writeProp(node, HeaderTrait.Shape, want === HeaderShape.Bar ? '' : want);
|
|
76
|
+
const position = readStyle(node, 'position');
|
|
77
|
+
if (headerShapeFloats(want) && (position === undefined || position === null || position === '' || position === 'static')) writeStyles(node, { position: 'relative' });
|
|
78
|
+
return changed;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
/** The header's outline as stored (Bar for a header that never chose). */
|
|
82
|
+
export function headerShapeOfNode(node: CompositeNode | null | undefined): HeaderShape {
|
|
83
|
+
return headerShapeOf(node ? readProp(node, HeaderTrait.Shape) : undefined);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
/** How the header's name sits (HI3 slice 2: fits · hangs · later) — ONE edit for the studio and the composer; `fits`
|
|
87
|
+
* clears a stored word (R-H4). False when nothing changed. */
|
|
88
|
+
export function setHeaderBrand(node: CompositeNode, brand: HeaderBrand | `${HeaderBrand}`): boolean {
|
|
89
|
+
const want = headerBrandOf(brand);
|
|
90
|
+
if (headerBrandOf(readProp(node, HeaderTrait.Brand)) === want) return false;
|
|
91
|
+
return writeProp(node, HeaderTrait.Brand, want === HeaderBrand.Fits ? '' : want);
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
/** The header's brand as stored (Fits for a header that never chose). */
|
|
95
|
+
export function headerBrandOfNode(node: CompositeNode | null | undefined): HeaderBrand {
|
|
96
|
+
return headerBrandOf(node ? readProp(node, HeaderTrait.Brand) : undefined);
|
|
97
|
+
}
|
|
@@ -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
|
-
|
|
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 =
|
|
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;
|
package/src/design-core/brand.ts
CHANGED
|
@@ -256,12 +256,64 @@ const passesText = (fg: string, bg: AccentGround) => groundList(bg).every(g => w
|
|
|
256
256
|
const bestInkHex = (bg: string) =>
|
|
257
257
|
(wcagContrastRatio(WHITE_HEX, bg) >= wcagContrastRatio(BLACK_HEX, bg) ? WHITE_HEX : BLACK_HEX);
|
|
258
258
|
|
|
259
|
+
/** How `deriveAccentTokens` derives. */
|
|
260
|
+
export interface AccentDerivationOptions {
|
|
261
|
+
/** CV-D1: the light accent is the seed itself (default). `false`: brand-500 with its ink and the next step as hover —
|
|
262
|
+
* what the contract wrote before colour v2 CV1, kept ONLY to recognise rows a machine wrote then (`legacyFlavorTokens`,
|
|
263
|
+
* `preKeptSeedDesignTokenRows`). */
|
|
264
|
+
keepSeed?: boolean;
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
/** CV-D1 (colour-v2-plan.md): the accent's hover sits at least this much OKLab L away from the kept accent (away from its ink). */
|
|
268
|
+
export const KEPT_HOVER_DL = 0.06;
|
|
269
|
+
/** CV-D1: how far the hover may walk on (0.02 a step) to keep the brand band's surfaces readable. */
|
|
270
|
+
export const KEPT_HOVER_DL_MAX = 0.3;
|
|
271
|
+
/**
|
|
272
|
+
* CV-D1: the strongest ink tint the contract lays on a Brand band's surface. Inside the accent scheme `surface` IS the
|
|
273
|
+
* accent's hover and the ink is the band's words (the contract's SCHEMES.accent); Bloom's secondary button is
|
|
274
|
+
* `color-mix(accent 22%, surface)` there — the ink mixed 22% into the hover. The hover keeps the ink at AA under it.
|
|
275
|
+
*/
|
|
276
|
+
export const BAND_SURFACE_INK_TINT = 0.22;
|
|
277
|
+
|
|
278
|
+
const mixSrgb = (a: Rgb, b: Rgb, share: number): Rgb =>
|
|
279
|
+
({ r: a.r * share + b.r * (1 - share), g: a.g * share + b.g * (1 - share), b: a.b * share + b.b * (1 - share) });
|
|
280
|
+
|
|
281
|
+
/**
|
|
282
|
+
* CV-D1 (colour-v2-plan.md §2 cause 1, §5a): the light accent IS the brand colour — a navy stays navy, a berry stays
|
|
283
|
+
* berry (it used to be brand-500 at L 0.62: a pastel with a black label). On every sRGB colour the better of a white and a
|
|
284
|
+
* black label reads at least √21 ≈ 4.58:1, so the seed always carries one (R-H-CV1). `ink` is that label. `hover` walks
|
|
285
|
+
* away from the ink (white ink: darker; black ink: lighter) at the seed's hue and chroma, from `KEPT_HOVER_DL` in 0.02
|
|
286
|
+
* steps, until the ink reads on it even with `BAND_SURFACE_INK_TINT` of the ink mixed in (the hover is the Brand band's
|
|
287
|
+
* surface); never past `KEPT_HOVER_DL_MAX`. Mirror of the contract's colour.mjs `keptAccent` (derivationFixtures hold
|
|
288
|
+
* them equal).
|
|
289
|
+
*/
|
|
290
|
+
export function keptAccent(seed: string): { accent: string; ink: string; hover: string } {
|
|
291
|
+
const own = parseHexColor(seed);
|
|
292
|
+
if (!own) throw new TypeError(`keptAccent: not a colour: "${seed}"`);
|
|
293
|
+
const lab = rgbToOklab(own);
|
|
294
|
+
const chroma = Math.hypot(lab.a, lab.b);
|
|
295
|
+
const ua = chroma > 1e-6 ? lab.a : 0.0, ub = chroma > 1e-6 ? lab.b : 1e-6;
|
|
296
|
+
const ink = wcagContrastRatio(WHITE, own) >= wcagContrastRatio(BLACK, own) ? WHITE : BLACK;
|
|
297
|
+
const away = ink === WHITE ? -1 : 1;
|
|
298
|
+
const tinted = (c: Rgb) => mixSrgb(ink, c, BAND_SURFACE_INK_TINT);
|
|
299
|
+
// judged on the float mix and on the hex it rounds to, whichever is lower (the audit and a browser may round either way)
|
|
300
|
+
const reads = (c: Rgb) => wcagContrastRatio(ink, c) >= WCAG_AA_TEXT
|
|
301
|
+
&& Math.min(wcagContrastRatio(ink, tinted(c)), wcagContrastRatio(ink, quant(tinted(c)))) >= WCAG_AA_TEXT;
|
|
302
|
+
let hover: Rgb | null = null;
|
|
303
|
+
for (let i = 0; !hover; i++) {
|
|
304
|
+
const dl = Math.min(KEPT_HOVER_DL + i * 0.02, KEPT_HOVER_DL_MAX);
|
|
305
|
+
const c = quant(atLightness(Math.min(1, Math.max(0, lab.L + away * dl)), ua, ub, chroma));
|
|
306
|
+
if (reads(c) || dl >= KEPT_HOVER_DL_MAX) hover = c;
|
|
307
|
+
}
|
|
308
|
+
return { accent: toHexColor(own), ink: toHexColor(ink), hover: toHexColor(wcagContrastRatio(ink, hover) >= WCAG_AA_TEXT ? hover : own) };
|
|
309
|
+
}
|
|
310
|
+
|
|
259
311
|
/**
|
|
260
312
|
* The quartet a seed different from the pack's own becomes, built ON `deriveBrandTokens` (its
|
|
261
313
|
* ramp and its WCAG-gated `brandInk`) — never a second colour model:
|
|
262
314
|
*
|
|
263
|
-
* - `accent` =
|
|
264
|
-
* - `accent-hover` =
|
|
315
|
+
* - `accent` = the seed itself (CV-D1, `keptAccent`), `accent-ink` = the label that reads on it
|
|
316
|
+
* - `accent-hover` = `KEPT_HOVER_DL` away from the ink, so ink-on-hover only gains contrast
|
|
265
317
|
* - `accent-text` = the first step from 500 toward the far end that clears 4.5:1 on `bg`
|
|
266
318
|
* - dark: the first of brand-300/200/400 an ink clears 4.5:1 on, the same hover rule, and
|
|
267
319
|
* `accent-text` = the first light step that clears 4.5:1 on `bgDark`
|
|
@@ -278,6 +330,7 @@ export function deriveAccentTokens(
|
|
|
278
330
|
seed: string,
|
|
279
331
|
against: AccentBackgrounds,
|
|
280
332
|
pack: Pick<FlavorPack, 'accentHueDeg'> = {},
|
|
333
|
+
options: AccentDerivationOptions = {},
|
|
281
334
|
): FlavorTokenDef[] {
|
|
282
335
|
const derived = deriveBrandTokens(seed, pack);
|
|
283
336
|
const hexOf = (name: string) => derived.find(t => t.name === name)!.value;
|
|
@@ -291,10 +344,10 @@ export function deriveAccentTokens(
|
|
|
291
344
|
const firstOn = (steps: number[], bg: AccentGround) => step(steps.find(n => passesText(step(n), bg)) ?? steps[steps.length - 1]);
|
|
292
345
|
|
|
293
346
|
const ink = hexOf('brandInk');
|
|
347
|
+
// CV-D1: the light accent is the seed itself; words keep the ramp's text step. (`ink` — the ramp's brandInk — still
|
|
348
|
+
// decides the inverse accent's label below, as before.)
|
|
294
349
|
const light = {
|
|
295
|
-
accent: step(500),
|
|
296
|
-
ink,
|
|
297
|
-
hover: hoverFor(500, ink),
|
|
350
|
+
...(options.keepSeed === false ? { accent: step(500), ink, hover: hoverFor(500, ink) } : keptAccent(seed)),
|
|
298
351
|
text: firstOn([500, 600, 700, 800, 900], against.bg),
|
|
299
352
|
};
|
|
300
353
|
|