@vectoriox/iox-ui 5.112.0 → 5.114.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.
@@ -788,6 +788,16 @@ export const SPEC_TIERS = {
788
788
  "type": "number",
789
789
  "default": "0.5"
790
790
  },
791
+ {
792
+ "name": "list-focus-scale",
793
+ "type": "number",
794
+ "default": "1.05"
795
+ },
796
+ {
797
+ "name": "list-rise",
798
+ "type": "size",
799
+ "default": "-10px"
800
+ },
791
801
  {
792
802
  "name": "panel-bg",
793
803
  "type": "color",
@@ -6737,6 +6747,20 @@ export const SPEC_FLAVOR_PACKS = [
6737
6747
  "group": "components",
6738
6748
  "value": "0.5"
6739
6749
  },
6750
+ {
6751
+ "name": "list-focus-scale",
6752
+ "tier": "component",
6753
+ "type": "number",
6754
+ "group": "components",
6755
+ "value": "1.05"
6756
+ },
6757
+ {
6758
+ "name": "list-rise",
6759
+ "tier": "component",
6760
+ "type": "size",
6761
+ "group": "components",
6762
+ "value": "-10px"
6763
+ },
6740
6764
  {
6741
6765
  "name": "panel-bg",
6742
6766
  "tier": "component",
@@ -9071,6 +9095,20 @@ export const SPEC_FLAVOR_PACKS = [
9071
9095
  "group": "components",
9072
9096
  "value": "0.5"
9073
9097
  },
9098
+ {
9099
+ "name": "list-focus-scale",
9100
+ "tier": "component",
9101
+ "type": "number",
9102
+ "group": "components",
9103
+ "value": "1.05"
9104
+ },
9105
+ {
9106
+ "name": "list-rise",
9107
+ "tier": "component",
9108
+ "type": "size",
9109
+ "group": "components",
9110
+ "value": "-10px"
9111
+ },
9074
9112
  {
9075
9113
  "name": "panel-bg",
9076
9114
  "tier": "component",
@@ -11413,6 +11451,20 @@ export const SPEC_FLAVOR_PACKS = [
11413
11451
  "group": "components",
11414
11452
  "value": "0.5"
11415
11453
  },
11454
+ {
11455
+ "name": "list-focus-scale",
11456
+ "tier": "component",
11457
+ "type": "number",
11458
+ "group": "components",
11459
+ "value": "1.05"
11460
+ },
11461
+ {
11462
+ "name": "list-rise",
11463
+ "tier": "component",
11464
+ "type": "size",
11465
+ "group": "components",
11466
+ "value": "-10px"
11467
+ },
11416
11468
  {
11417
11469
  "name": "panel-bg",
11418
11470
  "tier": "component",
@@ -13767,6 +13819,20 @@ export const SPEC_FLAVOR_PACKS = [
13767
13819
  "group": "components",
13768
13820
  "value": "0.5"
13769
13821
  },
13822
+ {
13823
+ "name": "list-focus-scale",
13824
+ "tier": "component",
13825
+ "type": "number",
13826
+ "group": "components",
13827
+ "value": "1.05"
13828
+ },
13829
+ {
13830
+ "name": "list-rise",
13831
+ "tier": "component",
13832
+ "type": "size",
13833
+ "group": "components",
13834
+ "value": "-10px"
13835
+ },
13770
13836
  {
13771
13837
  "name": "panel-bg",
13772
13838
  "tier": "component",
@@ -16124,6 +16190,20 @@ export const SPEC_FLAVOR_PACKS = [
16124
16190
  "group": "components",
16125
16191
  "value": "0.5"
16126
16192
  },
16193
+ {
16194
+ "name": "list-focus-scale",
16195
+ "tier": "component",
16196
+ "type": "number",
16197
+ "group": "components",
16198
+ "value": "1.05"
16199
+ },
16200
+ {
16201
+ "name": "list-rise",
16202
+ "tier": "component",
16203
+ "type": "size",
16204
+ "group": "components",
16205
+ "value": "-10px"
16206
+ },
16127
16207
  {
16128
16208
  "name": "panel-bg",
16129
16209
  "tier": "component",
@@ -18462,6 +18542,20 @@ export const SPEC_FLAVOR_PACKS = [
18462
18542
  "group": "components",
18463
18543
  "value": "0.5"
18464
18544
  },
18545
+ {
18546
+ "name": "list-focus-scale",
18547
+ "tier": "component",
18548
+ "type": "number",
18549
+ "group": "components",
18550
+ "value": "1.05"
18551
+ },
18552
+ {
18553
+ "name": "list-rise",
18554
+ "tier": "component",
18555
+ "type": "size",
18556
+ "group": "components",
18557
+ "value": "-10px"
18558
+ },
18465
18559
  {
18466
18560
  "name": "panel-bg",
18467
18561
  "tier": "component",
@@ -637,6 +637,8 @@ function galleryLayer(id: string, l: LayoutLayer, lc: LayerCtx, ctx: Ctx): Seria
637
637
  /** The width a row's card takes: three across a laptop, most of a phone's width with the next one peeking. */
638
638
  const LIST_ROW_SLIDE = `calc((100% - ${2 * SLIDE_GAP}px) / 3)`;
639
639
  const LIST_ROW_SLIDE_PHONE = '82%';
640
+ /** A deck is one card wide (LI4): a laptop's card, most of a phone. */
641
+ const LIST_DECK_WIDTH = 'min(440px, 80%)';
640
642
  const LIST_GAP = 'var(--iox-space-gap)';
641
643
  const LIST_PHOTO_ASPECT = '4 / 3';
642
644
  /** A row or a deck turns by itself this often (the wire's autoplay). */
@@ -764,11 +766,11 @@ function composeList(id: string, l: LayoutLayer, mix: LayoutListMix, source: str
764
766
  arrange = arrangeWait.drawnAs as LayoutListMix['arrange'];
765
767
  }
766
768
  const strips = arrange === LayoutListArrange.Strips;
767
- // Strips draw their own standing out (the open one, wider); any other is said until its phase draws it.
768
- if (mix.standout && mix.standout.who !== LayoutListWho.None && !(strips && mix.standout.how === LayoutListHow.Wider)) {
769
- const wait = listWait('who', mix.standout.who) ?? (mix.standout.how ? listWait('how', mix.standout.how) : null);
770
- gap(ctx, LayoutGapCode.ListLater, `${lc.path}.gallery.list.standout`,
771
- `standing out (${mix.standout.who}${mix.standout.how ? ` · ${mix.standout.how}` : ''}) is drawn ${wait ? `in ${wait.phase}` : 'by strips only'}`);
769
+ const deck = arrange === LayoutListArrange.Deck;
770
+ const standout = mix.standout && mix.standout.who !== LayoutListWho.None ? mix.standout : null;
771
+ const standWait = standout ? listWait('who', standout.who) ?? (standout.how ? listWait('how', standout.how) : null) : null;
772
+ if (standout && standWait) {
773
+ gap(ctx, LayoutGapCode.ListLater, `${lc.path}.gallery.list.standout`, `standing out (${standout.who}${standout.how ? ` · ${standout.how}` : ''}) is drawn in ${standWait.phase}`);
772
774
  }
773
775
  const masonry = arrange === LayoutListArrange.Masonry;
774
776
  const item = mix.item === LayoutListItem.Card
@@ -776,39 +778,45 @@ function composeList(id: string, l: LayoutLayer, mix: LayoutListMix, source: str
776
778
  : listPhoto(`${id}-item`, source, list, masonry);
777
779
  if (strips) return composeStrips(id, frame, item, mix, source, ctx);
778
780
  item.interactions = [...item.interactions, listArriveInteraction(item.id, mix.arrive, ctx)];
781
+ // LI4: the one that stands out — a deck's top card IS its standing out; strips draw their own (wider).
782
+ const shown = standout && !standWait && !deck ? standWrap(`${id}-stand`, item, standout) : item;
779
783
 
780
- if (arrange === LayoutListArrange.Row) {
784
+ if (arrange === LayoutListArrange.Row || deck) {
781
785
  const scrollPlays = mix.move.includes(LayoutListMove.Page) && !lc.held;
782
786
  const played = scrollPlays || lc.held;
783
787
  const drag = mix.move.includes(LayoutListMove.Drag);
784
788
  const slider = create(`${id}-slider`, T.Slider, {
785
- dir: ctx.rtl ? 'rtl' : 'ltr', effect: 'slide', slidesPerView: 'auto', spaceBetween: SLIDE_GAP,
786
- centeredSlides: mix.standout?.who === LayoutListWho.Middle, loop: 'off', freeMode: drag && !played, grabCursor: drag && !played,
789
+ // A deck (LI4) is Swiper's cards: one card on top, the rest waiting behind, dragged away or stepped.
790
+ dir: ctx.rtl ? 'rtl' : 'ltr', effect: deck ? 'cards' : 'slide', slidesPerView: deck ? 1 : 'auto', spaceBetween: deck ? 0 : SLIDE_GAP,
791
+ centeredSlides: !deck && standout?.who === LayoutListWho.Middle, loop: 'off', freeMode: !deck && drag && !played, grabCursor: drag && !played,
787
792
  speed: GALLERY_SPEED, enableParallax: false, enableAutoplay: mix.move.includes(LayoutListMove.Auto) && !played,
788
793
  autoplayDelay: LIST_AUTOPLAY_MS, autoplayDisableOnInteraction: true, enableKeyboard: true, scrollPlays,
789
794
  enableCaption: false, enableCount: false, enableNavigation: mix.move.includes(LayoutListMove.Arrows) && !played,
790
795
  [SLIDER_PLACEMENT_TRAIT]: SliderPlacement.Under, ariaLabel: l.text ?? '',
791
796
  }, NO_ELEMENT_STYLE);
792
797
  slider.bindings.push({ prop: 'source', source, path: '' });
793
- setStyleProps(slider, scrollPlays ? { width: FULL, height: FULL, minHeight: ZERO } : {
798
+ setStyleProps(slider, scrollPlays ? { width: FULL, height: FULL, minHeight: ZERO } : deck ? {
799
+ // A deck fills its holder (below); the cards behind show past its edges.
800
+ width: FULL, height: FULL, minHeight: ZERO, display: 'flex', flexDirection: 'column', overflow: 'visible',
801
+ } : {
794
802
  position: 'absolute', top: ZERO, right: ZERO, bottom: ZERO, left: ZERO, width: FULL, height: FULL, minHeight: ZERO,
795
803
  display: 'flex', flexDirection: 'column',
796
804
  });
797
- phone(slider, scrollPlays ? { height: 'auto' } : { position: 'relative', height: 'auto' });
805
+ phone(slider, scrollPlays || deck ? { height: 'auto' } : { position: 'relative', height: 'auto' });
798
806
  // A row keeps its own slide width on a phone (most of the screen, the next item peeking): the slider's phone
799
- // default is one slide the full width, unless the phone layer names its slides per view.
800
- slider.responsive![LAYOUT_PHONE_BREAKPOINT]!.inputs = { slidesPerView: 'auto' };
801
- if (mix.phone !== LayoutListPhone.Swipe) gap(ctx, LayoutGapCode.ListLater, `${lc.path}.gallery.list.phone`, `a row stays a row you swipe on a phone (${mix.phone} is a grid's)`);
807
+ // default is one slide the full width, unless the phone layer names its slides per view. A deck stays a deck.
808
+ if (!deck) slider.responsive![LAYOUT_PHONE_BREAKPOINT]!.inputs = { slidesPerView: 'auto' };
809
+ if (mix.phone !== LayoutListPhone.Swipe) gap(ctx, LayoutGapCode.ListLater, `${lc.path}.gallery.list.phone`, `a ${arrange} stays one you swipe on a phone (${mix.phone} is a grid's)`);
802
810
  const slide = create(`${id}-slide`, T.Slide, { caption: '' }, NO_ELEMENT_STYLE);
803
- setStyleProps(slide, { width: LIST_ROW_SLIDE, height: FULL, display: 'flex', aspectRatio: 'auto' });
804
- phone(slide, { width: LIST_ROW_SLIDE_PHONE });
805
- slide.children = [item];
811
+ setStyleProps(slide, { width: deck ? FULL : LIST_ROW_SLIDE, height: FULL, display: 'flex', aspectRatio: 'auto' });
812
+ if (!deck) phone(slide, { width: LIST_ROW_SLIDE_PHONE });
813
+ slide.children = [shown];
806
814
  slider.children = [slide];
807
815
  syncSliderParts(slider as unknown as CompositeNode, partFactory(`${id}-slider`));
808
816
  walkSerialized([slider], node => {
809
817
  if (node.role === SliderRole.Prev || node.role === SliderRole.Next) node.props[LAYOUT_TOOLTIP_TRAIT] = node.props['ariaLabel'];
810
818
  });
811
- frame.children = [slider];
819
+ frame.children = [deck ? deckHolder(`${id}-deck`, slider) : slider];
812
820
  return frame;
813
821
  }
814
822
 
@@ -825,11 +833,42 @@ function composeList(id: string, l: LayoutLayer, mix: LayoutListMix, source: str
825
833
  phone(items, { gridTemplateColumns: mix.phone === LayoutListPhone.TwoUp ? 'repeat(2, minmax(0, 1fr))' : 'minmax(0, 1fr)' });
826
834
  if (mix.phone === LayoutListPhone.Swipe) gap(ctx, LayoutGapCode.ListLater, `${lc.path}.gallery.list.phone`, 'a grid stacks on a phone; only a row swipes');
827
835
  }
828
- items.children = [item];
836
+ items.children = [shown];
829
837
  frame.children = [items];
830
838
  return frame;
831
839
  }
832
840
 
841
+ /**
842
+ * A deck (LI4) is a card wide, centred in its cell. The width sits on a holder, never the slider: the slider's own
843
+ * scoped `.swiper { width: 100% }` out-ranks a node's width class. On a phone the holder is the cell's width and the
844
+ * shared `.swiper.swiper-cards` rule (iox-design.css) makes the deck a centred card with its neighbours peeking.
845
+ */
846
+ function deckHolder(id: string, slider: SerializedNode): SerializedNode {
847
+ const holder = create(id, T.Container, {}, NO_ELEMENT_STYLE);
848
+ setStyleProps(holder, {
849
+ position: 'absolute', top: ZERO, right: ZERO, bottom: ZERO, left: ZERO, width: LIST_DECK_WIDTH, maxWidth: FULL, height: FULL,
850
+ minHeight: ZERO, margin: '0px auto', display: 'flex', flexDirection: 'column',
851
+ });
852
+ phone(holder, { position: 'relative', height: 'auto', width: FULL });
853
+ holder.children = [slider];
854
+ return holder;
855
+ }
856
+
857
+ /**
858
+ * Standing out (LI4): the item inside a holder whose role names who and how (`list.first-bigger`) — the shared CSS
859
+ * (iox-design.css) finds the one that stands out (the first row, Swiper's active slide, the one pointed at or focused)
860
+ * and moves it by the look's tokens; `brighter` rests the others. The holder, never the card, moves: the card keeps
861
+ * its own hover and arrival.
862
+ */
863
+ function standWrap(id: string, item: SerializedNode, standout: NonNullable<LayoutListMix['standout']>): SerializedNode {
864
+ const holder = create(id, T.Container, {}, NO_ELEMENT_STYLE);
865
+ holder.role = `${LayoutListRole.List}.${standout.who}-${standout.how ?? LayoutListHow.Raised}`;
866
+ setStyleProps(holder, { position: 'relative', display: 'flex', flexDirection: 'column', width: FULL, minHeight: ZERO });
867
+ setStyleProps(item, { flexGrow: '1' });
868
+ holder.children = [item];
869
+ return holder;
870
+ }
871
+
833
872
  /**
834
873
  * Strips (LI3): a Repeater over the list whose ONE row is a strip item holding the card (picture filling it, words on
835
874
  * the scrim) or the picture. Everything strips DO — the open one wider, pointing and focus, the phone — is the shared
@@ -24,6 +24,11 @@ export interface PlanWordContext {
24
24
  avoidWords: ReadonlyArray<string>;
25
25
  /** The owner's own facts (the analysis's, as corrected) — the only ones a plan may carry. */
26
26
  facts: Readonly<Partial<Record<FactKey, string>>>;
27
+ /**
28
+ * Other texts whose facts are the owner's too (AI Assist, R-H2): the owner's sentence, and the words already on what
29
+ * they are editing — a phone number on their own page is theirs to move or keep. Never a model's earlier answer.
30
+ */
31
+ known?: ReadonlyArray<string>;
27
32
  }
28
33
 
29
34
  /** A text a model wrote, and where. */
@@ -98,9 +103,9 @@ const MIN_PHONE_DIGITS = 8;
98
103
  /** "2019 – 2024" is two years, not a phone number. */
99
104
  const YEAR_RANGE = /^\s*\d{4}\s*[-–]\s*\d{4}\s*$/;
100
105
 
101
- function ownedKeys(facts: PlanWordContext['facts']): Set<string> {
106
+ function ownedKeys(facts: PlanWordContext['facts'], known: ReadonlyArray<string> = []): Set<string> {
102
107
  const keys = new Set<string>();
103
- for (const value of Object.values(facts)) {
108
+ for (const value of [...Object.values(facts), ...known]) {
104
109
  if (typeof value !== 'string') continue;
105
110
  for (const shape of FACT_SHAPES) for (const m of value.match(shape.pattern) ?? []) keys.add(`${shape.kind}:${shape.key(m)}`);
106
111
  }
@@ -114,7 +119,7 @@ function ownedKeys(facts: PlanWordContext['facts']): Set<string> {
114
119
  export function factIssues(texts: ReadonlyArray<WrittenText>, ctx: PlanWordContext): PlanWordIssue[] {
115
120
  const issues: PlanWordIssue[] = [];
116
121
  const avoid = [...new Set(ctx.avoidWords.map(w => w.trim()).filter(Boolean))].map(w => ({ word: w, pattern: wordPattern(w) }));
117
- const owned = ownedKeys(ctx.facts);
122
+ const owned = ownedKeys(ctx.facts, ctx.known);
118
123
  for (const { path, text } of texts) {
119
124
  const words = normalise(text);
120
125
  for (const a of avoid) if (a.pattern.test(words)) issues.push({ code: PlanWordIssueCode.AvoidWord, path, message: `uses "${a.word}" — a word this site must not use` });
@@ -7101,28 +7101,7 @@ export const SPEC_SITE_LAYOUT = {
7101
7101
  "phone.stack": "one under another",
7102
7102
  "phone.two-up": "two across"
7103
7103
  },
7104
- "waits": {
7105
- "arrange.deck": {
7106
- "phase": "LI4",
7107
- "drawnAs": "row"
7108
- },
7109
- "who.middle": {
7110
- "phase": "LI4",
7111
- "drawnAs": "none"
7112
- },
7113
- "how.bigger": {
7114
- "phase": "LI4",
7115
- "drawnAs": null
7116
- },
7117
- "how.raised": {
7118
- "phase": "LI4",
7119
- "drawnAs": null
7120
- },
7121
- "how.brighter": {
7122
- "phase": "LI4",
7123
- "drawnAs": null
7124
- }
7125
- },
7104
+ "waits": {},
7126
7105
  "defaults": {
7127
7106
  "item": "card",
7128
7107
  "arrange": "grid",
@@ -227,6 +227,45 @@ iox-gallery.iox-es-media[data-iox-empty] > .iox-gallery {
227
227
  :is(.iox-role-list-strips-swipe, .iox-role-list-strips-swipe > .repeater-wrapper) > .repeater-root > * { flex: 0 0 82%; scroll-snap-align: start; }
228
228
  }
229
229
 
230
+ /* LI4 (list-ingredients-plan.md §5): STANDING OUT — the one item a list's mix names (the first, the middle of a row =
231
+ Swiper's active slide, or the one pointed at / focused) grows (`bigger`), lifts (`raised`) or keeps its light while
232
+ the rest dim (`brighter`), by the look's tokens. The item sits in a holder whose role names who and how
233
+ (`list.first-bigger`); the HOLDER moves, never the card, so the card keeps its own hover and arrival. CSS only — the
234
+ canvas and both engine paths agree. Pointing is a mouse's (G1); focus is anyone's. Transform and opacity only. */
235
+ :where(.iox-role-list-first-bigger, .iox-role-list-first-raised, .iox-role-list-first-brighter, .iox-role-list-middle-bigger, .iox-role-list-middle-raised, .iox-role-list-middle-brighter, .iox-role-list-pointed-bigger, .iox-role-list-pointed-raised, .iox-role-list-pointed-brighter) {
236
+ transition-property: scale, translate, opacity;
237
+ transition-duration: var(--iox-dur-ui);
238
+ transition-timing-function: var(--iox-ease-standard);
239
+ }
240
+ :is(.repeater-root > :first-child, .swiper-slide:first-child) .iox-role-list-first-bigger,
241
+ .repeater-root > .iox-role-list-first-bigger:first-child,
242
+ .swiper-slide-active .iox-role-list-middle-bigger,
243
+ .iox-role-list-pointed-bigger:focus-within {
244
+ scale: var(--iox-list-focus-scale);
245
+ z-index: 1;
246
+ }
247
+ :is(.repeater-root > :first-child, .swiper-slide:first-child) .iox-role-list-first-raised,
248
+ .repeater-root > .iox-role-list-first-raised:first-child,
249
+ .swiper-slide-active .iox-role-list-middle-raised,
250
+ .iox-role-list-pointed-raised:focus-within {
251
+ translate: 0 var(--iox-list-rise);
252
+ z-index: 1;
253
+ }
254
+ :is(.repeater-root > :not(:first-child), .swiper-slide:not(:first-child)) .iox-role-list-first-brighter,
255
+ .repeater-root > .iox-role-list-first-brighter:not(:first-child),
256
+ .swiper-slide:not(.swiper-slide-active) .iox-role-list-middle-brighter,
257
+ :is(.iox-role-list, .iox-role-list-dim):has(.iox-role-list-pointed-brighter:focus-within) .iox-role-list-pointed-brighter:not(:focus-within) {
258
+ opacity: var(--iox-list-rest-opacity);
259
+ }
260
+ @media (hover: hover) and (pointer: fine) {
261
+ .iox-role-list-pointed-bigger:hover { scale: var(--iox-list-focus-scale); z-index: 1; }
262
+ .iox-role-list-pointed-raised:hover { translate: 0 var(--iox-list-rise); z-index: 1; }
263
+ :is(.iox-role-list, .iox-role-list-dim):has(.iox-role-list-pointed-brighter:hover) .iox-role-list-pointed-brighter:not(:hover) { opacity: var(--iox-list-rest-opacity); }
264
+ }
265
+ @media (prefers-reduced-motion: reduce) {
266
+ :where(.iox-role-list-first-bigger, .iox-role-list-first-raised, .iox-role-list-first-brighter, .iox-role-list-middle-bigger, .iox-role-list-middle-raised, .iox-role-list-middle-brighter, .iox-role-list-pointed-bigger, .iox-role-list-pointed-raised, .iox-role-list-pointed-brighter) { transition-property: opacity; }
267
+ }
268
+
230
269
  /* Link the whole card — the stretched link. The title's <a> is the card's ONE link (its words are the
231
270
  link's name); its ::after covers the card, so a click anywhere on it navigates. The Buttons sit above
232
271
  it and keep their own actions; the focus ring is drawn on the card. Never a link inside a link. On the