@vectoriox/iox-ui 5.144.0 → 5.146.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 (39) hide show
  1. package/composite-core/index.d.ts +10 -1
  2. package/design-core/index.d.ts +386 -44
  3. package/fesm2022/vectoriox-iox-ui-assist-core.mjs +2 -1
  4. package/fesm2022/vectoriox-iox-ui-assist-core.mjs.map +1 -1
  5. package/fesm2022/vectoriox-iox-ui-composite-core.mjs +9 -6
  6. package/fesm2022/vectoriox-iox-ui-composite-core.mjs.map +1 -1
  7. package/fesm2022/vectoriox-iox-ui-design-core.mjs +523 -80
  8. package/fesm2022/vectoriox-iox-ui-design-core.mjs.map +1 -1
  9. package/fesm2022/vectoriox-iox-ui-generation-core.mjs +158 -28
  10. package/fesm2022/vectoriox-iox-ui-generation-core.mjs.map +1 -1
  11. package/fesm2022/vectoriox-iox-ui-harness-core.mjs +108 -0
  12. package/fesm2022/vectoriox-iox-ui-harness-core.mjs.map +1 -1
  13. package/fesm2022/vectoriox-iox-ui.mjs +33 -11
  14. package/fesm2022/vectoriox-iox-ui.mjs.map +1 -1
  15. package/generation-core/index.d.ts +85 -7
  16. package/harness-core/index.d.ts +91 -1
  17. package/index.d.ts +11 -4
  18. package/package.json +1 -1
  19. package/src/assist-core/site-look.ts +2 -1
  20. package/src/composite-core/shop.ts +1 -1
  21. package/src/composite-core/slider.ts +7 -4
  22. package/src/design-core/design-apply.ts +19 -2
  23. package/src/design-core/design-settings.ts +18 -7
  24. package/src/design-core/design-token.model.ts +11 -0
  25. package/src/design-core/flavor-spec.generated.ts +303 -25
  26. package/src/design-core/flavor-tokens.ts +7 -1
  27. package/src/design-core/list-classes.ts +14 -3
  28. package/src/design-core/locale-direction.ts +28 -0
  29. package/src/design-core/node-classes.ts +66 -1
  30. package/src/design-core/section-edge.ts +17 -19
  31. package/src/design-core/token-css.ts +48 -3
  32. package/src/generation-core/adjustments.ts +7 -3
  33. package/src/generation-core/compose-layout.ts +116 -3
  34. package/src/generation-core/compose-site.ts +50 -20
  35. package/src/generation-core/site-spec.generated.ts +26 -0
  36. package/src/generation-core/validate-site-plan.ts +1 -0
  37. package/src/harness-core/harness-spec.generated.ts +108 -0
  38. package/src/harness-core/starting-design.ts +1 -1
  39. package/styles/iox-design.css +38 -8
@@ -436,7 +436,7 @@ export const SPEC_TIERS = {
436
436
  "name": "space-gutter",
437
437
  "type": "spacing",
438
438
  "group": "space",
439
- "desc": "Section side padding"
439
+ "desc": "The gutter floor: the least room beside the content (px, per Spacing)"
440
440
  },
441
441
  {
442
442
  "name": "space-gap",
@@ -460,7 +460,37 @@ export const SPEC_TIERS = {
460
460
  "name": "section-pad",
461
461
  "type": "spacing",
462
462
  "group": "space",
463
- "desc": "Composite: space-section space-gutter"
463
+ "desc": "Composite: space-section space-inline"
464
+ },
465
+ {
466
+ "name": "space-edge",
467
+ "type": "spacing",
468
+ "group": "space",
469
+ "desc": "THE one gutter: 4% of the page or the gutter floor, whichever is more"
470
+ },
471
+ {
472
+ "name": "column-contained",
473
+ "type": "spacing",
474
+ "group": "space",
475
+ "desc": "One centred column (per Spacing)"
476
+ },
477
+ {
478
+ "name": "column-narrow",
479
+ "type": "spacing",
480
+ "group": "space",
481
+ "desc": "A reading column — a story, a case study (per Spacing)"
482
+ },
483
+ {
484
+ "name": "content-width",
485
+ "type": "spacing",
486
+ "group": "space",
487
+ "desc": "The column in force: 100% (wide) or a column's width — the site's word; a page's word re-declares it"
488
+ },
489
+ {
490
+ "name": "space-inline",
491
+ "type": "spacing",
492
+ "group": "space",
493
+ "desc": "Composite: the ONE inline inset the header, the footer and every section read"
464
494
  },
465
495
  {
466
496
  "name": "dur-fast",
@@ -867,7 +897,7 @@ export const SPEC_TIERS = {
867
897
  {
868
898
  "name": "nav-pad",
869
899
  "type": "spacing",
870
- "default": "16px var(--iox-space-gutter)"
900
+ "default": "16px var(--iox-space-inline)"
871
901
  },
872
902
  {
873
903
  "name": "field-bg",
@@ -1727,21 +1757,27 @@ export const SPEC_AXES = {
1727
1757
  "space-section": "64px",
1728
1758
  "space-gutter": "20px",
1729
1759
  "space-gap": "16px",
1730
- "space-pad": "20px"
1760
+ "space-pad": "20px",
1761
+ "column-contained": "1200px",
1762
+ "column-narrow": "960px"
1731
1763
  },
1732
1764
  "regular": {
1733
1765
  "label": "Regular",
1734
1766
  "space-section": "96px",
1735
1767
  "space-gutter": "24px",
1736
1768
  "space-gap": "24px",
1737
- "space-pad": "24px"
1769
+ "space-pad": "24px",
1770
+ "column-contained": "1240px",
1771
+ "column-narrow": "1000px"
1738
1772
  },
1739
1773
  "airy": {
1740
1774
  "label": "Airy",
1741
1775
  "space-section": "144px",
1742
1776
  "space-gutter": "32px",
1743
1777
  "space-gap": "32px",
1744
- "space-pad": "32px"
1778
+ "space-pad": "32px",
1779
+ "column-contained": "1280px",
1780
+ "column-narrow": "1040px"
1745
1781
  }
1746
1782
  },
1747
1783
  "motions": {
@@ -1921,6 +1957,28 @@ export const SPEC_AXES = {
1921
1957
  }
1922
1958
  }
1923
1959
  },
1960
+ "columns": {
1961
+ "wide": {
1962
+ "label": "Wide",
1963
+ "column": null,
1964
+ "desc": "The window minus the gutter — as every page was before the column"
1965
+ },
1966
+ "contained": {
1967
+ "label": "Contained",
1968
+ "column": "column-contained",
1969
+ "desc": "One centred column"
1970
+ },
1971
+ "narrow": {
1972
+ "label": "Narrow",
1973
+ "column": "column-narrow",
1974
+ "desc": "A reading column — a story, a case study"
1975
+ }
1976
+ },
1977
+ "columnChoices": {
1978
+ "pre": "wide",
1979
+ "new": "contained"
1980
+ },
1981
+ "edgeShare": "4%",
1924
1982
  "scrolls": {
1925
1983
  "normal": {
1926
1984
  "label": "Normal",
@@ -5025,7 +5083,8 @@ export const SPEC_ELEMENT_STYLES = [
5025
5083
  ],
5026
5084
  "base": {
5027
5085
  "backgroundColor": "var(--iox-progress-fill)",
5028
- "height": "var(--iox-progress-height)"
5086
+ "height": "var(--iox-progress-height)",
5087
+ "minHeight": "var(--iox-progress-height)"
5029
5088
  }
5030
5089
  },
5031
5090
  {
@@ -5095,6 +5154,9 @@ export const SPEC_ELEMENT_STYLES = [
5095
5154
  "base": {
5096
5155
  "width": "var(--iox-swatch-size)",
5097
5156
  "height": "var(--iox-swatch-size)",
5157
+ "minWidth": "var(--iox-swatch-size)",
5158
+ "minHeight": "var(--iox-swatch-size)",
5159
+ "padding": "0px",
5098
5160
  "backgroundColor": "var(--iox-swatch-fill)",
5099
5161
  "borderStyle": "solid",
5100
5162
  "borderWidth": "var(--iox-border-width)",
@@ -6044,7 +6106,8 @@ export const SPEC_FLAVOR_PACKS = [
6044
6106
  "motion": "standard",
6045
6107
  "pillButtons": false,
6046
6108
  "mode": "light",
6047
- "tint": "subtle"
6109
+ "tint": "subtle",
6110
+ "column": "contained"
6048
6111
  },
6049
6112
  "seed": "#2F5BEA",
6050
6113
  "seeds": [
@@ -6746,7 +6809,42 @@ export const SPEC_FLAVOR_PACKS = [
6746
6809
  "tier": "semantic",
6747
6810
  "type": "spacing",
6748
6811
  "group": "space",
6749
- "value": "var(--iox-space-section) var(--iox-space-gutter)"
6812
+ "value": "var(--iox-space-section) var(--iox-space-inline)"
6813
+ },
6814
+ {
6815
+ "name": "space-edge",
6816
+ "tier": "semantic",
6817
+ "type": "spacing",
6818
+ "group": "space",
6819
+ "value": "max(4%, var(--iox-space-gutter))"
6820
+ },
6821
+ {
6822
+ "name": "column-contained",
6823
+ "tier": "semantic",
6824
+ "type": "spacing",
6825
+ "group": "space",
6826
+ "value": "1240px"
6827
+ },
6828
+ {
6829
+ "name": "column-narrow",
6830
+ "tier": "semantic",
6831
+ "type": "spacing",
6832
+ "group": "space",
6833
+ "value": "1000px"
6834
+ },
6835
+ {
6836
+ "name": "content-width",
6837
+ "tier": "semantic",
6838
+ "type": "spacing",
6839
+ "group": "space",
6840
+ "value": "1240px"
6841
+ },
6842
+ {
6843
+ "name": "space-inline",
6844
+ "tier": "semantic",
6845
+ "type": "spacing",
6846
+ "group": "space",
6847
+ "value": "max(var(--iox-space-edge), calc((100% - var(--iox-content-width)) / 2))"
6750
6848
  },
6751
6849
  {
6752
6850
  "name": "dur-fast",
@@ -7292,7 +7390,7 @@ export const SPEC_FLAVOR_PACKS = [
7292
7390
  "tier": "component",
7293
7391
  "type": "spacing",
7294
7392
  "group": "components",
7295
- "value": "16px var(--iox-space-gutter)"
7393
+ "value": "16px var(--iox-space-inline)"
7296
7394
  },
7297
7395
  {
7298
7396
  "name": "field-bg",
@@ -8420,7 +8518,8 @@ export const SPEC_FLAVOR_PACKS = [
8420
8518
  "motion": "calm",
8421
8519
  "pillButtons": false,
8422
8520
  "mode": "light",
8423
- "tint": "subtle"
8521
+ "tint": "subtle",
8522
+ "column": "contained"
8424
8523
  },
8425
8524
  "seed": "#7A5B36",
8426
8525
  "seeds": [
@@ -9121,7 +9220,42 @@ export const SPEC_FLAVOR_PACKS = [
9121
9220
  "tier": "semantic",
9122
9221
  "type": "spacing",
9123
9222
  "group": "space",
9124
- "value": "var(--iox-space-section) var(--iox-space-gutter)"
9223
+ "value": "var(--iox-space-section) var(--iox-space-inline)"
9224
+ },
9225
+ {
9226
+ "name": "space-edge",
9227
+ "tier": "semantic",
9228
+ "type": "spacing",
9229
+ "group": "space",
9230
+ "value": "max(4%, var(--iox-space-gutter))"
9231
+ },
9232
+ {
9233
+ "name": "column-contained",
9234
+ "tier": "semantic",
9235
+ "type": "spacing",
9236
+ "group": "space",
9237
+ "value": "1280px"
9238
+ },
9239
+ {
9240
+ "name": "column-narrow",
9241
+ "tier": "semantic",
9242
+ "type": "spacing",
9243
+ "group": "space",
9244
+ "value": "1040px"
9245
+ },
9246
+ {
9247
+ "name": "content-width",
9248
+ "tier": "semantic",
9249
+ "type": "spacing",
9250
+ "group": "space",
9251
+ "value": "1280px"
9252
+ },
9253
+ {
9254
+ "name": "space-inline",
9255
+ "tier": "semantic",
9256
+ "type": "spacing",
9257
+ "group": "space",
9258
+ "value": "max(var(--iox-space-edge), calc((100% - var(--iox-content-width)) / 2))"
9125
9259
  },
9126
9260
  {
9127
9261
  "name": "dur-fast",
@@ -9680,7 +9814,7 @@ export const SPEC_FLAVOR_PACKS = [
9680
9814
  "tier": "component",
9681
9815
  "type": "spacing",
9682
9816
  "group": "components",
9683
- "value": "16px var(--iox-space-gutter)"
9817
+ "value": "16px var(--iox-space-inline)"
9684
9818
  },
9685
9819
  {
9686
9820
  "name": "field-bg",
@@ -10820,7 +10954,8 @@ export const SPEC_FLAVOR_PACKS = [
10820
10954
  "motion": "standard",
10821
10955
  "pillButtons": false,
10822
10956
  "mode": "dark",
10823
- "tint": "subtle"
10957
+ "tint": "subtle",
10958
+ "column": "contained"
10824
10959
  },
10825
10960
  "seed": "#6E5BFF",
10826
10961
  "seeds": [
@@ -11526,7 +11661,42 @@ export const SPEC_FLAVOR_PACKS = [
11526
11661
  "tier": "semantic",
11527
11662
  "type": "spacing",
11528
11663
  "group": "space",
11529
- "value": "var(--iox-space-section) var(--iox-space-gutter)"
11664
+ "value": "var(--iox-space-section) var(--iox-space-inline)"
11665
+ },
11666
+ {
11667
+ "name": "space-edge",
11668
+ "tier": "semantic",
11669
+ "type": "spacing",
11670
+ "group": "space",
11671
+ "value": "max(4%, var(--iox-space-gutter))"
11672
+ },
11673
+ {
11674
+ "name": "column-contained",
11675
+ "tier": "semantic",
11676
+ "type": "spacing",
11677
+ "group": "space",
11678
+ "value": "1240px"
11679
+ },
11680
+ {
11681
+ "name": "column-narrow",
11682
+ "tier": "semantic",
11683
+ "type": "spacing",
11684
+ "group": "space",
11685
+ "value": "1000px"
11686
+ },
11687
+ {
11688
+ "name": "content-width",
11689
+ "tier": "semantic",
11690
+ "type": "spacing",
11691
+ "group": "space",
11692
+ "value": "1240px"
11693
+ },
11694
+ {
11695
+ "name": "space-inline",
11696
+ "tier": "semantic",
11697
+ "type": "spacing",
11698
+ "group": "space",
11699
+ "value": "max(var(--iox-space-edge), calc((100% - var(--iox-content-width)) / 2))"
11530
11700
  },
11531
11701
  {
11532
11702
  "name": "dur-fast",
@@ -12080,7 +12250,7 @@ export const SPEC_FLAVOR_PACKS = [
12080
12250
  "tier": "component",
12081
12251
  "type": "spacing",
12082
12252
  "group": "components",
12083
- "value": "16px var(--iox-space-gutter)"
12253
+ "value": "16px var(--iox-space-inline)"
12084
12254
  },
12085
12255
  {
12086
12256
  "name": "field-bg",
@@ -13210,7 +13380,8 @@ export const SPEC_FLAVOR_PACKS = [
13210
13380
  "motion": "lively",
13211
13381
  "pillButtons": true,
13212
13382
  "mode": "light",
13213
- "tint": "subtle"
13383
+ "tint": "subtle",
13384
+ "column": "contained"
13214
13385
  },
13215
13386
  "seed": "#0A66E8",
13216
13387
  "seeds": [
@@ -13929,7 +14100,42 @@ export const SPEC_FLAVOR_PACKS = [
13929
14100
  "tier": "semantic",
13930
14101
  "type": "spacing",
13931
14102
  "group": "space",
13932
- "value": "var(--iox-space-section) var(--iox-space-gutter)"
14103
+ "value": "var(--iox-space-section) var(--iox-space-inline)"
14104
+ },
14105
+ {
14106
+ "name": "space-edge",
14107
+ "tier": "semantic",
14108
+ "type": "spacing",
14109
+ "group": "space",
14110
+ "value": "max(4%, var(--iox-space-gutter))"
14111
+ },
14112
+ {
14113
+ "name": "column-contained",
14114
+ "tier": "semantic",
14115
+ "type": "spacing",
14116
+ "group": "space",
14117
+ "value": "1240px"
14118
+ },
14119
+ {
14120
+ "name": "column-narrow",
14121
+ "tier": "semantic",
14122
+ "type": "spacing",
14123
+ "group": "space",
14124
+ "value": "1000px"
14125
+ },
14126
+ {
14127
+ "name": "content-width",
14128
+ "tier": "semantic",
14129
+ "type": "spacing",
14130
+ "group": "space",
14131
+ "value": "1240px"
14132
+ },
14133
+ {
14134
+ "name": "space-inline",
14135
+ "tier": "semantic",
14136
+ "type": "spacing",
14137
+ "group": "space",
14138
+ "value": "max(var(--iox-space-edge), calc((100% - var(--iox-content-width)) / 2))"
13933
14139
  },
13934
14140
  {
13935
14141
  "name": "dur-fast",
@@ -14495,7 +14701,7 @@ export const SPEC_FLAVOR_PACKS = [
14495
14701
  "tier": "component",
14496
14702
  "type": "spacing",
14497
14703
  "group": "components",
14498
- "value": "10px 10px 10px 22px",
14704
+ "value": "10px var(--iox-space-inline)",
14499
14705
  "overridden": true
14500
14706
  },
14501
14707
  {
@@ -15644,7 +15850,8 @@ export const SPEC_FLAVOR_PACKS = [
15644
15850
  "motion": "lively",
15645
15851
  "pillButtons": true,
15646
15852
  "mode": "light",
15647
- "tint": "subtle"
15853
+ "tint": "subtle",
15854
+ "column": "contained"
15648
15855
  },
15649
15856
  "seed": "#6750A4",
15650
15857
  "seeds": [
@@ -16345,7 +16552,42 @@ export const SPEC_FLAVOR_PACKS = [
16345
16552
  "tier": "semantic",
16346
16553
  "type": "spacing",
16347
16554
  "group": "space",
16348
- "value": "var(--iox-space-section) var(--iox-space-gutter)"
16555
+ "value": "var(--iox-space-section) var(--iox-space-inline)"
16556
+ },
16557
+ {
16558
+ "name": "space-edge",
16559
+ "tier": "semantic",
16560
+ "type": "spacing",
16561
+ "group": "space",
16562
+ "value": "max(4%, var(--iox-space-gutter))"
16563
+ },
16564
+ {
16565
+ "name": "column-contained",
16566
+ "tier": "semantic",
16567
+ "type": "spacing",
16568
+ "group": "space",
16569
+ "value": "1240px"
16570
+ },
16571
+ {
16572
+ "name": "column-narrow",
16573
+ "tier": "semantic",
16574
+ "type": "spacing",
16575
+ "group": "space",
16576
+ "value": "1000px"
16577
+ },
16578
+ {
16579
+ "name": "content-width",
16580
+ "tier": "semantic",
16581
+ "type": "spacing",
16582
+ "group": "space",
16583
+ "value": "1240px"
16584
+ },
16585
+ {
16586
+ "name": "space-inline",
16587
+ "tier": "semantic",
16588
+ "type": "spacing",
16589
+ "group": "space",
16590
+ "value": "max(var(--iox-space-edge), calc((100% - var(--iox-content-width)) / 2))"
16349
16591
  },
16350
16592
  {
16351
16593
  "name": "dur-fast",
@@ -16902,7 +17144,7 @@ export const SPEC_FLAVOR_PACKS = [
16902
17144
  "tier": "component",
16903
17145
  "type": "spacing",
16904
17146
  "group": "components",
16905
- "value": "16px var(--iox-space-gutter)"
17147
+ "value": "16px var(--iox-space-inline)"
16906
17148
  },
16907
17149
  {
16908
17150
  "name": "field-bg",
@@ -18040,7 +18282,8 @@ export const SPEC_FLAVOR_PACKS = [
18040
18282
  "motion": "snappy",
18041
18283
  "pillButtons": false,
18042
18284
  "mode": "light",
18043
- "tint": "subtle"
18285
+ "tint": "subtle",
18286
+ "column": "contained"
18044
18287
  },
18045
18288
  "seed": "#FF5C39",
18046
18289
  "seeds": [
@@ -18730,7 +18973,42 @@ export const SPEC_FLAVOR_PACKS = [
18730
18973
  "tier": "semantic",
18731
18974
  "type": "spacing",
18732
18975
  "group": "space",
18733
- "value": "var(--iox-space-section) var(--iox-space-gutter)"
18976
+ "value": "var(--iox-space-section) var(--iox-space-inline)"
18977
+ },
18978
+ {
18979
+ "name": "space-edge",
18980
+ "tier": "semantic",
18981
+ "type": "spacing",
18982
+ "group": "space",
18983
+ "value": "max(4%, var(--iox-space-gutter))"
18984
+ },
18985
+ {
18986
+ "name": "column-contained",
18987
+ "tier": "semantic",
18988
+ "type": "spacing",
18989
+ "group": "space",
18990
+ "value": "1200px"
18991
+ },
18992
+ {
18993
+ "name": "column-narrow",
18994
+ "tier": "semantic",
18995
+ "type": "spacing",
18996
+ "group": "space",
18997
+ "value": "960px"
18998
+ },
18999
+ {
19000
+ "name": "content-width",
19001
+ "tier": "semantic",
19002
+ "type": "spacing",
19003
+ "group": "space",
19004
+ "value": "1200px"
19005
+ },
19006
+ {
19007
+ "name": "space-inline",
19008
+ "tier": "semantic",
19009
+ "type": "spacing",
19010
+ "group": "space",
19011
+ "value": "max(var(--iox-space-edge), calc((100% - var(--iox-content-width)) / 2))"
18734
19012
  },
18735
19013
  {
18736
19014
  "name": "dur-fast",
@@ -19296,7 +19574,7 @@ export const SPEC_FLAVOR_PACKS = [
19296
19574
  "tier": "component",
19297
19575
  "type": "spacing",
19298
19576
  "group": "components",
19299
- "value": "16px var(--iox-space-gutter)"
19577
+ "value": "16px var(--iox-space-inline)"
19300
19578
  },
19301
19579
  {
19302
19580
  "name": "field-bg",
@@ -6,6 +6,7 @@ import {
6
6
  DesignChoices, DesignTokenRow, FlavorPackV2, FlavorSpecToken, flavorSourceStamp, PRE_MOTION, USER_TOKEN_SOURCE,
7
7
  } from './design-token.model';
8
8
  import { motionCurve, motionLanguageOf } from './motion-language';
9
+ import { CONTENT_WIDTH_TOKEN, contentWidthOf } from './node-classes';
9
10
  import { stylePresetOfChoices } from './style-presets';
10
11
 
11
12
  /**
@@ -13,7 +14,8 @@ import { stylePresetOfChoices } from './style-presets';
13
14
  * its token values, so switching flavor — or any choice — rewrites token rows and nothing else.
14
15
  *
15
16
  * Layering, each step over the last (the boards' `tokenMap`, with the product's colour math):
16
- * pack tokens → chosen font pair → shape · density · motion axes → the look's motion language (AW3:
17
+ * pack tokens → chosen font pair → shape · density · motion axes → the content column (award §0c: `content-width`
18
+ * takes the column's literal AT this density — never a `var()`, DS1.1) → the look's motion language (AW3:
17
19
  * ease-enter / ease-exit from Feel) → pill-button rule →
18
20
  * the author's own font roles → every COLOUR token from the brand seed and the background tint
19
21
  * (`flavorColours`, DS9: tinted neutrals, the accent quartet, the held contrast pairs).
@@ -92,6 +94,10 @@ export function buildFlavorTokens(pack: FlavorPackV2, choices: DesignChoices): D
92
94
  ...axisValues(axes.motions, choices.motion),
93
95
  ]) set(name, value);
94
96
 
97
+ // Award §0c: the column in force, as the literal the chosen density gives its word (wide = the whole page).
98
+ const content = contentWidthOf(choices.column ?? pack.defaults.column, name => byName.get(name)?.value);
99
+ if (content) set(CONTENT_WIDTH_TOKEN, content);
100
+
95
101
  // AW3 (MB-D1, MB-D5): the look's own arrival and leave — every entrance, dialog and menu moves on them.
96
102
  const language = motionLanguageOf(choices, stylePresetOfChoices(choices)?.id);
97
103
  const tokenValue = (name: string) => byName.get(name)?.value;
@@ -4,16 +4,24 @@
4
4
  * become marker classes — `iox-list-item-packshot`, `iox-list-hover-swap` — that the shared iox-design.css draws. The
5
5
  * same decision in all three render paths (`nodeDesignClasses`), so a word is drawn by CSS alone and the canvas, both
6
6
  * engine paths and the raw SSR agree. Bindings ▸ List reads and writes the same prop. Pure.
7
+ *
8
+ * A frame whose OWN Text Direction is right-to-left also renders `iox-list-mirrored`, and the shared CSS turns what leans
9
+ * and fans the other way (R-H-AW11-8) — decided here as AW6's seams are (`nodeIsRtl`), never by `:dir(rtl)`, which a
10
+ * composed Hebrew page (a CSS `direction` per node) never matches (#116).
7
11
  */
8
12
 
13
+ import { DirectionSource, nodeIsRtl } from './locale-direction';
14
+
9
15
  /** The prop (a Container's trait) the mix is stored under. */
10
16
  export const LIST_MIX_PROP = 'listMix';
11
17
  /** Every class a mix writes starts with this — what a live re-sync removes. */
12
18
  export const LIST_CLASS_PREFIX = 'iox-list-';
19
+ /** Beside a mix's classes on a right-to-left frame: the leaning and fanning turn the other way. */
20
+ export const LIST_MIRRORED_CLASS = 'iox-list-mirrored';
13
21
 
14
22
  const WORD = /^[a-z]+:[a-z0-9-]+$/;
15
23
 
16
- interface ListMixSource {
24
+ interface ListMixSource extends DirectionSource {
17
25
  props?: Readonly<Record<string, unknown>> | null;
18
26
  traits?: ReadonlyArray<{ name?: string; default?: unknown }> | null;
19
27
  }
@@ -26,9 +34,12 @@ export function listMixWordsOf(node: ListMixSource | null | undefined): string[]
26
34
  return words.filter((w): w is string => typeof w === 'string' && WORD.test(w));
27
35
  }
28
36
 
29
- /** The marker classes a list frame renders (`iox-list-arrange-hang iox-list-hover-swap`), or '' for none. */
37
+ /** The marker classes a list frame renders (`iox-list-arrange-hang iox-list-hover-swap`, + `iox-list-mirrored` on a
38
+ * right-to-left frame), or '' for a frame with no mix. */
30
39
  export function listMixClasses(node: ListMixSource | null | undefined): string {
31
- return [...new Set(listMixWordsOf(node))].map(w => `${LIST_CLASS_PREFIX}${w.replace(':', '-')}`).join(' ');
40
+ const words = [...new Set(listMixWordsOf(node))];
41
+ if (!words.length) return '';
42
+ return [...words.map(w => `${LIST_CLASS_PREFIX}${w.replace(':', '-')}`), ...(nodeIsRtl(node) ? [LIST_MIRRORED_CLASS] : [])].join(' ');
32
43
  }
33
44
 
34
45
  /** True for a class this module writes. */
@@ -22,3 +22,31 @@ export function languageOf(locale: string | null | undefined): string {
22
22
  export function localeDirection(locale: string | null | undefined): LocaleDirection {
23
23
  return RTL_LANGUAGES.has(languageOf(locale)) ? LocaleDirection.Rtl : LocaleDirection.Ltr;
24
24
  }
25
+
26
+ /** A node's own styles, as a saved node (`styleProps`) or a builder node (`styleTraits`) carries them. */
27
+ export interface DirectionSource {
28
+ styleProps?: Readonly<Record<string, unknown>> | null;
29
+ styleTraits?: ReadonlyArray<{ traits?: ReadonlyArray<{ name?: string; default?: unknown }> | null }> | null;
30
+ }
31
+
32
+ /** The Text Direction trait and where it used to live (style-compiler `TEXT_DIRECTION_KEY` / `LEGACY_DIRECTION_KEY`). */
33
+ const DIRECTION_KEYS = ['textDirection', 'direction'];
34
+
35
+ /**
36
+ * True when the node's OWN Text Direction is right-to-left (a saved node's styleProps, a builder node's style traits);
37
+ * a node with no direction of its own reads left-to-right. THE answer for anything the shared CSS mirrors (AW6's seams,
38
+ * AW11's leaning lists): a composed Hebrew page carries its direction as each node's CSS `direction`, which `:dir(rtl)`
39
+ * cannot see, and the builder canvas sits inside the ADMIN's `<html dir>`. So design-core writes a class from the
40
+ * node's own direction instead.
41
+ */
42
+ export function nodeIsRtl(node: DirectionSource | null | undefined): boolean {
43
+ if (!node) return false;
44
+ for (const key of DIRECTION_KEYS) {
45
+ if (node.styleProps && key in node.styleProps) return node.styleProps[key] === LocaleDirection.Rtl;
46
+ }
47
+ for (const group of node.styleTraits ?? []) {
48
+ const t = group?.traits?.find(x => x?.name === DIRECTION_KEYS[0]);
49
+ if (t) return t.default === LocaleDirection.Rtl;
50
+ }
51
+ return false;
52
+ }