@vectoriox/iox-ui 5.137.0 → 5.138.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/assist-core/index.d.ts +22 -4
- package/composite-core/index.d.ts +10 -2
- package/design-core/index.d.ts +225 -20
- package/fesm2022/vectoriox-iox-ui-actions-core.mjs +12 -2
- package/fesm2022/vectoriox-iox-ui-actions-core.mjs.map +1 -1
- package/fesm2022/vectoriox-iox-ui-assist-core.mjs +29 -5
- package/fesm2022/vectoriox-iox-ui-assist-core.mjs.map +1 -1
- package/fesm2022/vectoriox-iox-ui-composite-core.mjs +18 -2
- package/fesm2022/vectoriox-iox-ui-composite-core.mjs.map +1 -1
- package/fesm2022/vectoriox-iox-ui-design-core.mjs +376 -61
- package/fesm2022/vectoriox-iox-ui-design-core.mjs.map +1 -1
- package/fesm2022/vectoriox-iox-ui-generation-core.mjs +986 -230
- package/fesm2022/vectoriox-iox-ui-generation-core.mjs.map +1 -1
- package/fesm2022/vectoriox-iox-ui-harness-core.mjs +5 -4
- package/fesm2022/vectoriox-iox-ui-harness-core.mjs.map +1 -1
- package/fesm2022/vectoriox-iox-ui-scene-core.mjs +197 -28
- package/fesm2022/vectoriox-iox-ui-scene-core.mjs.map +1 -1
- package/fesm2022/vectoriox-iox-ui.mjs +185 -11
- package/fesm2022/vectoriox-iox-ui.mjs.map +1 -1
- package/generation-core/index.d.ts +1111 -732
- package/harness-core/index.d.ts +2 -2
- package/index.d.ts +46 -2
- package/package.json +1 -1
- package/scene-core/index.d.ts +69 -13
- package/src/actions-core/element-actions.ts +14 -4
- package/src/assist-core/assist-turn.ts +3 -1
- package/src/assist-core/route-schema.ts +20 -5
- package/src/assist-core/surfaces.ts +12 -0
- package/src/composite-core/header.ts +18 -1
- package/src/design-core/design-settings.ts +14 -3
- package/src/design-core/design-token.model.ts +3 -0
- package/src/design-core/flavor-spec.generated.ts +64 -25
- package/src/design-core/graphemes.ts +16 -0
- package/src/design-core/header-behaviour.ts +20 -2
- package/src/design-core/motion-language.ts +11 -7
- package/src/design-core/node-classes.ts +10 -4
- package/src/design-core/preloader.ts +3 -4
- package/src/design-core/public-api.ts +3 -0
- package/src/design-core/scrub.ts +37 -0
- package/src/design-core/section-edge.ts +223 -0
- package/src/design-core/style-presets.ts +2 -0
- package/src/generation-core/body-mix.ts +443 -0
- package/src/generation-core/check-layout.ts +42 -4
- package/src/generation-core/compose-layout.ts +28 -6
- package/src/generation-core/compose-site.ts +26 -8
- package/src/generation-core/header-mix.ts +4 -0
- package/src/generation-core/layout-fingerprint.ts +19 -1
- package/src/generation-core/layout-language.ts +21 -1
- package/src/generation-core/layout-wire.ts +27 -2
- package/src/generation-core/node-baselines.generated.ts +7 -2
- package/src/generation-core/opening-mix.ts +32 -0
- package/src/generation-core/plan-wire.ts +1 -0
- package/src/generation-core/public-api.ts +2 -0
- package/src/generation-core/redesign-run.ts +27 -0
- package/src/generation-core/site-build-run.ts +24 -6
- package/src/generation-core/site-plan.model.ts +2 -0
- package/src/generation-core/site-spec.generated.ts +120 -58
- package/src/generation-core/text-scroll.ts +179 -0
- package/src/generation-core/validate-site-plan.ts +4 -2
- package/src/harness-core/starting-design.ts +6 -5
- package/src/scene-core/scroll-range.ts +4 -0
- package/src/scene-core/split-text.ts +216 -28
- package/styles/iox-design.css +87 -0
|
@@ -2235,6 +2235,11 @@ export const SPEC_MOTION_LANGUAGE = {
|
|
|
2235
2235
|
"window",
|
|
2236
2236
|
"lift"
|
|
2237
2237
|
],
|
|
2238
|
+
"scrub": [
|
|
2239
|
+
"never",
|
|
2240
|
+
"words",
|
|
2241
|
+
"entrances"
|
|
2242
|
+
],
|
|
2238
2243
|
"tiers": {
|
|
2239
2244
|
"arrive": {
|
|
2240
2245
|
"enter": "all",
|
|
@@ -2273,6 +2278,11 @@ export const SPEC_MOTION_LANGUAGE = {
|
|
|
2273
2278
|
"mark": "pro",
|
|
2274
2279
|
"counter": "pro",
|
|
2275
2280
|
"letters": "pro"
|
|
2281
|
+
},
|
|
2282
|
+
"scrub": {
|
|
2283
|
+
"never": "all",
|
|
2284
|
+
"words": "pro",
|
|
2285
|
+
"entrances": "pro"
|
|
2276
2286
|
}
|
|
2277
2287
|
},
|
|
2278
2288
|
"meanings": {
|
|
@@ -2299,168 +2309,192 @@ export const SPEC_MOTION_LANGUAGE = {
|
|
|
2299
2309
|
"leave": "quart-out",
|
|
2300
2310
|
"move": "rise",
|
|
2301
2311
|
"preloader": "none",
|
|
2302
|
-
"preloaderExit": "none"
|
|
2312
|
+
"preloaderExit": "none",
|
|
2313
|
+
"scrub": "never"
|
|
2303
2314
|
},
|
|
2304
2315
|
"swiss-grid": {
|
|
2305
2316
|
"arrive": "quart-out",
|
|
2306
2317
|
"leave": "quart-out",
|
|
2307
2318
|
"move": "clip",
|
|
2308
2319
|
"preloader": "none",
|
|
2309
|
-
"preloaderExit": "none"
|
|
2320
|
+
"preloaderExit": "none",
|
|
2321
|
+
"scrub": "never"
|
|
2310
2322
|
},
|
|
2311
2323
|
"trusted-advisor": {
|
|
2312
2324
|
"arrive": "quart-out",
|
|
2313
2325
|
"leave": "quart-out",
|
|
2314
2326
|
"move": "rise",
|
|
2315
2327
|
"preloader": "none",
|
|
2316
|
-
"preloaderExit": "none"
|
|
2328
|
+
"preloaderExit": "none",
|
|
2329
|
+
"scrub": "never"
|
|
2317
2330
|
},
|
|
2318
2331
|
"fresh-practice": {
|
|
2319
2332
|
"arrive": "expo-out",
|
|
2320
2333
|
"leave": "quart-out",
|
|
2321
2334
|
"move": "fade",
|
|
2322
2335
|
"preloader": "none",
|
|
2323
|
-
"preloaderExit": "none"
|
|
2336
|
+
"preloaderExit": "none",
|
|
2337
|
+
"scrub": "never"
|
|
2324
2338
|
},
|
|
2325
2339
|
"gallery-minimal": {
|
|
2326
2340
|
"arrive": "expo-out",
|
|
2327
2341
|
"leave": "quart-out",
|
|
2328
2342
|
"move": "fade",
|
|
2329
2343
|
"preloader": "none",
|
|
2330
|
-
"preloaderExit": "none"
|
|
2344
|
+
"preloaderExit": "none",
|
|
2345
|
+
"scrub": "never"
|
|
2331
2346
|
},
|
|
2332
2347
|
"warm-editorial": {
|
|
2333
2348
|
"arrive": "quart-out",
|
|
2334
2349
|
"leave": "quart-out",
|
|
2335
2350
|
"move": "mask-rise",
|
|
2336
2351
|
"preloader": "none",
|
|
2337
|
-
"preloaderExit": "none"
|
|
2352
|
+
"preloaderExit": "none",
|
|
2353
|
+
"scrub": "never"
|
|
2338
2354
|
},
|
|
2339
2355
|
"soft-spa": {
|
|
2340
2356
|
"arrive": "expo-out",
|
|
2341
2357
|
"leave": "quart-out",
|
|
2342
2358
|
"move": "blur-in",
|
|
2343
2359
|
"preloader": "none",
|
|
2344
|
-
"preloaderExit": "none"
|
|
2360
|
+
"preloaderExit": "none",
|
|
2361
|
+
"scrub": "never"
|
|
2345
2362
|
},
|
|
2346
2363
|
"quiet-luxury": {
|
|
2347
2364
|
"arrive": "expo-out",
|
|
2348
2365
|
"leave": "expo-out",
|
|
2349
2366
|
"move": "fade",
|
|
2350
2367
|
"preloader": "none",
|
|
2351
|
-
"preloaderExit": "none"
|
|
2368
|
+
"preloaderExit": "none",
|
|
2369
|
+
"scrub": "never"
|
|
2352
2370
|
},
|
|
2353
2371
|
"after-dark": {
|
|
2354
2372
|
"arrive": "expo-out",
|
|
2355
2373
|
"leave": "quart-out",
|
|
2356
2374
|
"move": "mask-rise",
|
|
2357
2375
|
"preloader": "mark",
|
|
2358
|
-
"preloaderExit": "lift"
|
|
2376
|
+
"preloaderExit": "lift",
|
|
2377
|
+
"scrub": "words"
|
|
2359
2378
|
},
|
|
2360
2379
|
"ink-studio": {
|
|
2361
2380
|
"arrive": "quart-out",
|
|
2362
2381
|
"leave": "quart-out",
|
|
2363
2382
|
"move": "mask-rise",
|
|
2364
2383
|
"preloader": "none",
|
|
2365
|
-
"preloaderExit": "none"
|
|
2384
|
+
"preloaderExit": "none",
|
|
2385
|
+
"scrub": "never"
|
|
2366
2386
|
},
|
|
2367
2387
|
"night-gallery": {
|
|
2368
2388
|
"arrive": "expo-out",
|
|
2369
2389
|
"leave": "quart-out",
|
|
2370
2390
|
"move": "blur-in",
|
|
2371
2391
|
"preloader": "none",
|
|
2372
|
-
"preloaderExit": "none"
|
|
2392
|
+
"preloaderExit": "none",
|
|
2393
|
+
"scrub": "never"
|
|
2373
2394
|
},
|
|
2374
2395
|
"tech-studio": {
|
|
2375
2396
|
"arrive": "quart-out",
|
|
2376
2397
|
"leave": "quart-out",
|
|
2377
2398
|
"move": "words-lit",
|
|
2378
2399
|
"preloader": "counter",
|
|
2379
|
-
"preloaderExit": "window"
|
|
2400
|
+
"preloaderExit": "window",
|
|
2401
|
+
"scrub": "entrances"
|
|
2380
2402
|
},
|
|
2381
2403
|
"morning-glass": {
|
|
2382
2404
|
"arrive": "expo-out",
|
|
2383
2405
|
"leave": "quart-out",
|
|
2384
2406
|
"move": "blur-in",
|
|
2385
2407
|
"preloader": "none",
|
|
2386
|
-
"preloaderExit": "none"
|
|
2408
|
+
"preloaderExit": "none",
|
|
2409
|
+
"scrub": "never"
|
|
2387
2410
|
},
|
|
2388
2411
|
"holiday-light": {
|
|
2389
2412
|
"arrive": "spring",
|
|
2390
2413
|
"leave": "quart-out",
|
|
2391
2414
|
"move": "rise",
|
|
2392
2415
|
"preloader": "none",
|
|
2393
|
-
"preloaderExit": "none"
|
|
2416
|
+
"preloaderExit": "none",
|
|
2417
|
+
"scrub": "never"
|
|
2394
2418
|
},
|
|
2395
2419
|
"frosted-portfolio": {
|
|
2396
2420
|
"arrive": "expo-out",
|
|
2397
2421
|
"leave": "quart-out",
|
|
2398
2422
|
"move": "blur-in",
|
|
2399
2423
|
"preloader": "none",
|
|
2400
|
-
"preloaderExit": "none"
|
|
2424
|
+
"preloaderExit": "none",
|
|
2425
|
+
"scrub": "never"
|
|
2401
2426
|
},
|
|
2402
2427
|
"coral-studio": {
|
|
2403
2428
|
"arrive": "pop",
|
|
2404
2429
|
"leave": "quart-out",
|
|
2405
2430
|
"move": "rise",
|
|
2406
2431
|
"preloader": "none",
|
|
2407
|
-
"preloaderExit": "none"
|
|
2432
|
+
"preloaderExit": "none",
|
|
2433
|
+
"scrub": "never"
|
|
2408
2434
|
},
|
|
2409
2435
|
"corner-cafe": {
|
|
2410
2436
|
"arrive": "spring",
|
|
2411
2437
|
"leave": "quart-out",
|
|
2412
2438
|
"move": "rise",
|
|
2413
2439
|
"preloader": "mark",
|
|
2414
|
-
"preloaderExit": "fade"
|
|
2440
|
+
"preloaderExit": "fade",
|
|
2441
|
+
"scrub": "never"
|
|
2415
2442
|
},
|
|
2416
2443
|
"kind-community": {
|
|
2417
2444
|
"arrive": "quart-out",
|
|
2418
2445
|
"leave": "quart-out",
|
|
2419
2446
|
"move": "rise",
|
|
2420
2447
|
"preloader": "none",
|
|
2421
|
-
"preloaderExit": "none"
|
|
2448
|
+
"preloaderExit": "none",
|
|
2449
|
+
"scrub": "never"
|
|
2422
2450
|
},
|
|
2423
2451
|
"little-ones": {
|
|
2424
2452
|
"arrive": "pop",
|
|
2425
2453
|
"leave": "quart-out",
|
|
2426
2454
|
"move": "rise",
|
|
2427
2455
|
"preloader": "none",
|
|
2428
|
-
"preloaderExit": "none"
|
|
2456
|
+
"preloaderExit": "none",
|
|
2457
|
+
"scrub": "never"
|
|
2429
2458
|
},
|
|
2430
2459
|
"garden-party": {
|
|
2431
2460
|
"arrive": "spring",
|
|
2432
2461
|
"leave": "quart-out",
|
|
2433
2462
|
"move": "rise",
|
|
2434
2463
|
"preloader": "none",
|
|
2435
|
-
"preloaderExit": "none"
|
|
2464
|
+
"preloaderExit": "none",
|
|
2465
|
+
"scrub": "never"
|
|
2436
2466
|
},
|
|
2437
2467
|
"bold-maker": {
|
|
2438
2468
|
"arrive": "pop",
|
|
2439
2469
|
"leave": "quart-out",
|
|
2440
2470
|
"move": "mask-rise",
|
|
2441
2471
|
"preloader": "counter",
|
|
2442
|
-
"preloaderExit": "sweep"
|
|
2472
|
+
"preloaderExit": "sweep",
|
|
2473
|
+
"scrub": "words"
|
|
2443
2474
|
},
|
|
2444
2475
|
"festival": {
|
|
2445
2476
|
"arrive": "pop",
|
|
2446
2477
|
"leave": "quart-out",
|
|
2447
2478
|
"move": "rise",
|
|
2448
2479
|
"preloader": "letters",
|
|
2449
|
-
"preloaderExit": "fade"
|
|
2480
|
+
"preloaderExit": "fade",
|
|
2481
|
+
"scrub": "never"
|
|
2450
2482
|
},
|
|
2451
2483
|
"zine": {
|
|
2452
2484
|
"arrive": "quart-out",
|
|
2453
2485
|
"leave": "quart-out",
|
|
2454
2486
|
"move": "clip",
|
|
2455
2487
|
"preloader": "letters",
|
|
2456
|
-
"preloaderExit": "sweep"
|
|
2488
|
+
"preloaderExit": "sweep",
|
|
2489
|
+
"scrub": "entrances"
|
|
2457
2490
|
},
|
|
2458
2491
|
"fresh-market": {
|
|
2459
2492
|
"arrive": "spring",
|
|
2460
2493
|
"leave": "quart-out",
|
|
2461
2494
|
"move": "rise",
|
|
2462
2495
|
"preloader": "none",
|
|
2463
|
-
"preloaderExit": "none"
|
|
2496
|
+
"preloaderExit": "none",
|
|
2497
|
+
"scrub": "never"
|
|
2464
2498
|
}
|
|
2465
2499
|
},
|
|
2466
2500
|
"leaveFor": {
|
|
@@ -2487,7 +2521,8 @@ export const SPEC_MOTION_LANGUAGE = {
|
|
|
2487
2521
|
"arrive": "enter",
|
|
2488
2522
|
"move": "fade",
|
|
2489
2523
|
"cover": "fade",
|
|
2490
|
-
"preloader": "none"
|
|
2524
|
+
"preloader": "none",
|
|
2525
|
+
"scrub": "never"
|
|
2491
2526
|
},
|
|
2492
2527
|
"coverMaxMs": {
|
|
2493
2528
|
"cover": 400,
|
|
@@ -2499,6 +2534,10 @@ export const SPEC_MOTION_LANGUAGE = {
|
|
|
2499
2534
|
"lively",
|
|
2500
2535
|
"expressive"
|
|
2501
2536
|
],
|
|
2537
|
+
"scrubLevels": [
|
|
2538
|
+
"lively",
|
|
2539
|
+
"expressive"
|
|
2540
|
+
],
|
|
2502
2541
|
"reduced": {
|
|
2503
2542
|
"enter": "fade",
|
|
2504
2543
|
"enterMaxMs": 200
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Text as a reader sees its letters (AW5 preloader, AW10 letter split): a Hebrew letter keeps its points, an emoji its
|
|
3
|
+
* joiners, a flag its pair (`Intl.Segmenter`). ONE reading for every surface that counts or splits letters. Pure.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
type GraphemeSegmenter = new (locale?: string, options?: { granularity: string }) => { segment(text: string): Iterable<{ segment: string }> };
|
|
7
|
+
|
|
8
|
+
/** A letter with the marks written on it: the fallback where `Intl.Segmenter` is missing (no joiners, no flags). */
|
|
9
|
+
const LETTER_WITH_MARKS = /\P{M}\p{M}*|\p{M}+/gu;
|
|
10
|
+
|
|
11
|
+
export function graphemes(text: string): string[] {
|
|
12
|
+
if (!text) return [];
|
|
13
|
+
const Seg = (Intl as unknown as { Segmenter?: GraphemeSegmenter }).Segmenter;
|
|
14
|
+
if (!Seg) return text.match(LETTER_WITH_MARKS) ?? [];
|
|
15
|
+
return Array.from(new Seg(undefined, { granularity: 'grapheme' }).segment(text), s => s.segment);
|
|
16
|
+
}
|
|
@@ -33,6 +33,15 @@ export enum HeaderTrait {
|
|
|
33
33
|
/** HI1b (HS-5): the mix the header was composed as — its `<ingredient>:<word>` words, space-separated (generation-core
|
|
34
34
|
* `stampHeaderMix`). Read by Bindings ▸ Header and the Header studio; no renderer reads it. */
|
|
35
35
|
Mix = 'headerMix',
|
|
36
|
+
/** AW6 (AW6-D10): `follows` — its colours follow the section under it as the page scrolls. Absent / `opening`: it
|
|
37
|
+
* wears the page's opening (#71), as before. Written by the Header studio ▸ Ground and the composer (`ink:follows`). */
|
|
38
|
+
Ink = 'headerInk',
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/** Whose colours the header wears (contract HEADER `ink`): the page's opening, or every section as it passes under it. */
|
|
42
|
+
export enum HeaderInk {
|
|
43
|
+
Opening = 'opening',
|
|
44
|
+
Follows = 'follows',
|
|
36
45
|
}
|
|
37
46
|
|
|
38
47
|
export enum HeaderAttribute {
|
|
@@ -42,6 +51,9 @@ export enum HeaderAttribute {
|
|
|
42
51
|
Edge = 'data-iox-header-edge',
|
|
43
52
|
/** Written by the header runtime while a `hides` header has stepped aside. */
|
|
44
53
|
Hidden = 'data-iox-header-hidden',
|
|
54
|
+
/** `follows` on a header whose colours follow the section under it (the header ink runtime writes the page's
|
|
55
|
+
* `data-iox-opening` as each section passes; the shared CSS cross-fades). Absent: it wears the opening. */
|
|
56
|
+
Ink = 'data-iox-header-ink',
|
|
45
57
|
}
|
|
46
58
|
|
|
47
59
|
/** What a composed header gets (the `nav.*` patterns' `header`, the palette's Navigation bar). */
|
|
@@ -68,9 +80,15 @@ export function headerStaysAtTop(behaviour: unknown): boolean {
|
|
|
68
80
|
return headerBehaviourOf(behaviour) !== HeaderBehaviour.Scrolls;
|
|
69
81
|
}
|
|
70
82
|
|
|
71
|
-
/**
|
|
72
|
-
export function
|
|
83
|
+
/** A stored ink, or Opening for anything else. */
|
|
84
|
+
export function headerInkOf(value: unknown): HeaderInk {
|
|
85
|
+
return value === HeaderInk.Follows ? HeaderInk.Follows : HeaderInk.Opening;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
/** The attributes a header renders, from its trait values — `{}` for a header that keeps today's behaviour. */
|
|
89
|
+
export function headerAttributes(behaviour: unknown, edge: unknown, ink?: unknown): Record<string, string> {
|
|
73
90
|
const out: Record<string, string> = {};
|
|
91
|
+
if (headerInkOf(ink) === HeaderInk.Follows) out[HeaderAttribute.Ink] = HeaderInk.Follows;
|
|
74
92
|
const b = headerBehaviourOf(behaviour);
|
|
75
93
|
if (b !== HeaderBehaviour.Scrolls) out[HeaderAttribute.Behaviour] = b;
|
|
76
94
|
const e = headerEdgeOf(edge);
|
|
@@ -45,17 +45,20 @@ export interface MotionLanguage {
|
|
|
45
45
|
export const isArriveId = (v: unknown): v is ArriveId => typeof v === 'string' && (ARRIVE_IDS as ReadonlyArray<string>).includes(v);
|
|
46
46
|
export const isMoveId = (v: unknown): v is MoveId => typeof v === 'string' && (MOVE_IDS as ReadonlyArray<string>).includes(v);
|
|
47
47
|
|
|
48
|
-
|
|
48
|
+
/** A style preset's own language: its Feel, Headings arrive, first-visit preloader with its exit (AW5) and By the
|
|
49
|
+
* scroll (AW10). */
|
|
50
|
+
export interface PresetMotionLanguage { arrive: ArriveId; leave: LeaveId; move: MoveId; preloader: string; preloaderExit: string; scrub: string }
|
|
51
|
+
const PRESET_LANGUAGE = L.presets as Readonly<Record<string, PresetMotionLanguage>>;
|
|
49
52
|
const LEAVE_FOR = L.leaveFor as Readonly<Record<ArriveId, LeaveId>>;
|
|
50
53
|
/** The families a word's tier is asked of: the arrive / leave curves, the heading move, the cover between pages (AW4),
|
|
51
|
-
* the first-visit preloader (AW5). */
|
|
52
|
-
export type MotionWordKind = 'arrive' | 'leave' | 'move' | 'cover' | 'preloader';
|
|
54
|
+
* the first-visit preloader (AW5), By the scroll (AW10). */
|
|
55
|
+
export type MotionWordKind = 'arrive' | 'leave' | 'move' | 'cover' | 'preloader' | 'scrub';
|
|
53
56
|
const TIERS = L.tiers as Readonly<Record<MotionWordKind, Readonly<Record<string, `${MotionWordTier}`>>>>;
|
|
54
|
-
const PLAN_FALLBACK = L.planFallback as Readonly<{ arrive: ArriveId; move: MoveId; cover: string; preloader: string }>;
|
|
57
|
+
const PLAN_FALLBACK = L.planFallback as Readonly<{ arrive: ArriveId; move: MoveId; cover: string; preloader: string; scrub: string }>;
|
|
55
58
|
|
|
56
59
|
/** A style preset's own language (its Feel, Headings arrive and first-visit preloader with its exit) — undefined for an
|
|
57
60
|
* unknown id. */
|
|
58
|
-
export function presetMotionLanguage(presetId: string | null | undefined):
|
|
61
|
+
export function presetMotionLanguage(presetId: string | null | undefined): PresetMotionLanguage | undefined {
|
|
59
62
|
return presetId ? PRESET_LANGUAGE[presetId] : undefined;
|
|
60
63
|
}
|
|
61
64
|
|
|
@@ -91,9 +94,9 @@ export function motionCurve(word: ArriveId | LeaveId, tokenValue: (name: string)
|
|
|
91
94
|
/**
|
|
92
95
|
* What a lower plan wears of a language (AW-D23, MB-D6): a Pro word is drawn as the plan's own (the contract's
|
|
93
96
|
* `planFallback`) — Feel today's arrival, a Pro move a fade, a Pro cover (AW4) a fade between pages, a preloader (AW5)
|
|
94
|
-
* none. Applied where a look is CHOSEN (a Look pick, a build); a built site keeps its words.
|
|
97
|
+
* none, By the scroll (AW10) never. Applied where a look is CHOSEN (a Look pick, a build); a built site keeps its words.
|
|
95
98
|
*/
|
|
96
|
-
export function motionLanguageForPlan<T extends Pick<DesignChoices, 'feel' | 'headings'> & { between?: DesignChoices['between']; preloader?: DesignChoices['preloader'] }>(choices: T, pro: boolean): T {
|
|
99
|
+
export function motionLanguageForPlan<T extends Pick<DesignChoices, 'feel' | 'headings'> & { between?: DesignChoices['between']; preloader?: DesignChoices['preloader']; scrub?: DesignChoices['scrub'] }>(choices: T, pro: boolean): T {
|
|
97
100
|
if (pro) return choices;
|
|
98
101
|
const proWord = (kind: MotionWordKind, word: unknown) => typeof word === 'string' && motionWordTier(kind, word) === MotionWordTier.Pro;
|
|
99
102
|
const feel = isArriveId(choices.feel) && proWord('arrive', choices.feel) ? PLAN_FALLBACK.arrive : choices.feel;
|
|
@@ -101,6 +104,7 @@ export function motionLanguageForPlan<T extends Pick<DesignChoices, 'feel' | 'he
|
|
|
101
104
|
const out = { ...choices, feel, headings };
|
|
102
105
|
if (proWord('cover', choices.between)) out.between = PLAN_FALLBACK.cover as DesignChoices['between'];
|
|
103
106
|
if (proWord('preloader', choices.preloader)) out.preloader = PLAN_FALLBACK.preloader;
|
|
107
|
+
if (proWord('scrub', choices.scrub)) out.scrub = PLAN_FALLBACK.scrub;
|
|
104
108
|
return out;
|
|
105
109
|
}
|
|
106
110
|
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { ELEMENT_STYLE_MARKER_CLASS, elementStyleClass } from './element-styles';
|
|
2
2
|
import { SPEC_SCHEME_INK, SPEC_SCHEMES } from './flavor-spec.generated';
|
|
3
|
+
import { isSectionDesignClass, sectionDesignClasses } from './section-edge';
|
|
3
4
|
|
|
4
5
|
/**
|
|
5
6
|
* The design-system classes a node renders, in BOTH renderers (builder canvas, engine component
|
|
@@ -12,7 +13,9 @@ import { SPEC_SCHEME_INK, SPEC_SCHEMES } from './flavor-spec.generated';
|
|
|
12
13
|
* `compileSchemeCss` re-declares tokens on, so everything inside re-resolves;
|
|
13
14
|
* - the composite ROLE `iox-role-<role>` (`card.media` → `iox-role-card-media`; composite-components
|
|
14
15
|
* plan §3, Card v2) — what the shared CSS keys a part's structural rules on (the badge's corner, the
|
|
15
|
-
* card's stretched link), so a role is never a renderer's private knowledge
|
|
16
|
+
* card's stretched link), so a role is never a renderer's private knowledge;
|
|
17
|
+
* - a Section's edge and shape `iox-seam-<edge>` / `iox-section-card` (AW6, `section-edge.ts`) — what the shared CSS
|
|
18
|
+
* paints a seam on.
|
|
16
19
|
*
|
|
17
20
|
* Renderers read `elementStyle`, `colorScheme` and `role` for exactly this and nothing else.
|
|
18
21
|
*/
|
|
@@ -184,15 +187,18 @@ export function hasElementStyleMarker(node: { elementStyle?: string | null } | n
|
|
|
184
187
|
return elementStyleClass(node?.elementStyle) !== null;
|
|
185
188
|
}
|
|
186
189
|
|
|
187
|
-
/** The classes a node renders: `'iox-es iox-es-card iox-scheme-inverse'` (+ a bottom bar's reserve class
|
|
190
|
+
/** The classes a node renders: `'iox-es iox-es-card iox-scheme-inverse'` (+ a bottom bar's reserve class, a section's
|
|
191
|
+
* edge or shape), or `''` for none. */
|
|
188
192
|
export function nodeDesignClasses(node: DesignClassSource | null | undefined): string {
|
|
189
193
|
const marker = elementStyleClass(node?.elementStyle);
|
|
190
|
-
return [marker ? `${ELEMENT_STYLE_MARKER_CLASS} ${marker}` : '', colorSchemeClass(colorSchemeOf(node)) ?? '', roleClass(node?.role) ?? '', barReserveClass(node) ?? ''
|
|
194
|
+
return [marker ? `${ELEMENT_STYLE_MARKER_CLASS} ${marker}` : '', colorSchemeClass(colorSchemeOf(node)) ?? '', roleClass(node?.role) ?? '', barReserveClass(node) ?? '',
|
|
195
|
+
sectionDesignClasses(node)]
|
|
191
196
|
.filter(Boolean).join(' ');
|
|
192
197
|
}
|
|
193
198
|
|
|
194
199
|
const isDesignClass = (c: string) =>
|
|
195
|
-
c === ELEMENT_STYLE_MARKER_CLASS || c.startsWith(MARKER_PREFIX) || c.startsWith(SCHEME_PREFIX) || c.startsWith(ROLE_PREFIX) || c.startsWith(BAR_RESERVE_CLASS)
|
|
200
|
+
c === ELEMENT_STYLE_MARKER_CLASS || c.startsWith(MARKER_PREFIX) || c.startsWith(SCHEME_PREFIX) || c.startsWith(ROLE_PREFIX) || c.startsWith(BAR_RESERVE_CLASS)
|
|
201
|
+
|| isSectionDesignClass(c);
|
|
196
202
|
|
|
197
203
|
/** Make an element's design classes match the node — the live switch on the canvas and the
|
|
198
204
|
* component path's one-time stamp. Removes stale ones; touches no other class. */
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { SPEC_MOTION_LANGUAGE } from './flavor-spec.generated';
|
|
2
2
|
import { MotionWordTier, motionWordTier, presetMotionLanguage } from './motion-language';
|
|
3
|
+
import { graphemes } from './graphemes';
|
|
3
4
|
|
|
4
5
|
/**
|
|
5
6
|
* THE FIRST-VISIT PRELOADER (award-ingredients-plan §5.3, AW5; Preloader board PL-D1…PL-D9) — pure, framework-free.
|
|
@@ -134,11 +135,9 @@ export function preloaderExitMotion(exit: string | null | undefined): PreloaderE
|
|
|
134
135
|
return EXIT_MOTION[exit as PreloaderPlan['exit']] ?? EXIT_MOTION[PreloaderExit.Fade];
|
|
135
136
|
}
|
|
136
137
|
|
|
137
|
-
/** A text as a reader sees its letters —
|
|
138
|
+
/** A text as a reader sees its letters — `graphemes`, kept under the name the preloader has always used. */
|
|
138
139
|
export function preloaderGraphemes(text: string): string[] {
|
|
139
|
-
|
|
140
|
-
if (!Seg) return Array.from(text);
|
|
141
|
-
return Array.from(new Seg(undefined, { granularity: 'grapheme' }).segment(text), s => s.segment);
|
|
140
|
+
return graphemes(text);
|
|
142
141
|
}
|
|
143
142
|
|
|
144
143
|
/**
|
|
@@ -19,6 +19,7 @@ export * from './flavor';
|
|
|
19
19
|
export * from './element-styles';
|
|
20
20
|
export * from './adopt';
|
|
21
21
|
export * from './node-classes';
|
|
22
|
+
export * from './section-edge';
|
|
22
23
|
export * from './field-classes';
|
|
23
24
|
export * from './empty-image';
|
|
24
25
|
export * from './node-links';
|
|
@@ -37,5 +38,7 @@ export * from './design-settings';
|
|
|
37
38
|
export * from './design-apply';
|
|
38
39
|
export * from './style-presets';
|
|
39
40
|
export * from './motion-language';
|
|
41
|
+
export * from './graphemes';
|
|
40
42
|
export * from './preloader';
|
|
41
43
|
export * from './preloader-of';
|
|
44
|
+
export * from './scrub';
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { SPEC_MOTION_LANGUAGE } from './flavor-spec.generated';
|
|
2
|
+
import type { DesignChoices } from './design-token.model';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* THE LOOK'S BY THE SCROLL (award-ingredients-plan §7.1e, AW10; board `award-text-scroll`, AW10-D5…D8) — pure,
|
|
6
|
+
* framework-free. What may follow the scroll instead of playing once as it arrives: nothing, text (a text reveal lights
|
|
7
|
+
* by the scroll), or every entrance. Stored as ONE `settings.design` row (`scrub`, absent = never); a style preset
|
|
8
|
+
* carries its own word (the contract's `MOTION.presets`), kept by a start only on a Lively or Expressive look
|
|
9
|
+
* (`SCRUB_LEVELS`, AW10-D7 — a calm business never scrubs), drawn as never on a lower plan. The first screen never
|
|
10
|
+
* scrubs (AW10-D8): its scroll motion is copy-out. The stamps are generation-core's (`scrubbedEntrance`); the runtime is
|
|
11
|
+
* the ONE `scrollProgress` runtime.
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
const L = SPEC_MOTION_LANGUAGE;
|
|
15
|
+
|
|
16
|
+
/** The look's scrub (contract MOTION `ingredients.scrub`): what may follow the scroll. */
|
|
17
|
+
export enum ScrubId {
|
|
18
|
+
/** Everything plays once as it arrives. */
|
|
19
|
+
Never = 'never',
|
|
20
|
+
/** Text may light by the scroll: a text reveal follows it, lighting from dim. */
|
|
21
|
+
Words = 'words',
|
|
22
|
+
/** Entrances may follow the scroll exactly: every entrance, a text reveal rising as it does on time. */
|
|
23
|
+
Entrances = 'entrances',
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/** Every word, in the contract's order. */
|
|
27
|
+
export const SCRUB_IDS: ReadonlyArray<string> = L.scrub;
|
|
28
|
+
/** The How animated levels a look's By the scroll is kept on (AW10-D7). */
|
|
29
|
+
export const SCRUB_LEVELS: ReadonlyArray<string> = L.scrubLevels;
|
|
30
|
+
|
|
31
|
+
export const isScrubId = (v: unknown): v is `${ScrubId}` => typeof v === 'string' && SCRUB_IDS.includes(v);
|
|
32
|
+
|
|
33
|
+
/** The look's scrub as stored: a known word, else never (a row stored before AW10 reads never). */
|
|
34
|
+
export function scrubOfChoices(choices: Pick<DesignChoices, 'scrub'> | null | undefined): ScrubId {
|
|
35
|
+
const scrub = choices?.scrub;
|
|
36
|
+
return isScrubId(scrub) ? (scrub as ScrubId) : ScrubId.Never;
|
|
37
|
+
}
|