@vectoriox/iox-ui 5.48.0 → 5.49.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/harness-core/index.d.ts
CHANGED
|
@@ -2279,9 +2279,21 @@ interface MotionInput {
|
|
|
2279
2279
|
businessType?: string | null;
|
|
2280
2280
|
avoid?: ReadonlyArray<string>;
|
|
2281
2281
|
}
|
|
2282
|
+
/** Where the start came from, structured (the screen words it in its own language). */
|
|
2283
|
+
interface MotionBasis {
|
|
2284
|
+
/** The kind of business it started from (null: no type matched, the style's own). */
|
|
2285
|
+
type: string | null;
|
|
2286
|
+
/** The style made How animated calmer than the business (or the references) wanted. */
|
|
2287
|
+
calmerStyle: boolean;
|
|
2288
|
+
/** The references set How animated. */
|
|
2289
|
+
references: boolean;
|
|
2290
|
+
/** The owner asked for little movement: all three were capped. */
|
|
2291
|
+
littleMovement: boolean;
|
|
2292
|
+
}
|
|
2282
2293
|
interface MotionStart extends DesignMotion {
|
|
2283
2294
|
/** Why, in English — one line per step the start took. */
|
|
2284
2295
|
why: string[];
|
|
2296
|
+
basis: MotionBasis;
|
|
2285
2297
|
}
|
|
2286
2298
|
/** The owner asked for little movement (`USER_AVOID_IDS`). */
|
|
2287
2299
|
declare const LITTLE_MOVEMENT_AVOID = "lots-of-motion";
|
|
@@ -2345,6 +2357,13 @@ declare function oklchHue(hex: string): {
|
|
|
2345
2357
|
chroma: number;
|
|
2346
2358
|
} | null;
|
|
2347
2359
|
declare function lintDesign(site: LintSite, typeId: string, types?: ReadonlyArray<BusinessType>): LintFinding[];
|
|
2360
|
+
/**
|
|
2361
|
+
* Rev 3.1: two levels above what this kind of business usually wears (Subtle → Lively) is advice, never a block.
|
|
2362
|
+
* Structured, so Design ▸ Motion says it in the studio's language: `usual` = the level the type wears.
|
|
2363
|
+
*/
|
|
2364
|
+
declare function motionAdvice(typeId: string | null | undefined, animate: AnimateId | string | null | undefined, types?: ReadonlyArray<BusinessType>): {
|
|
2365
|
+
usual: AnimateId;
|
|
2366
|
+
} | null;
|
|
2348
2367
|
|
|
2349
2368
|
/**
|
|
2350
2369
|
* What the reading of a prompt returns (AI plan rev 3 §3d): one of the 30 kinds of business (and the two
|
|
@@ -2494,5 +2513,5 @@ declare function addressesIn(text: string): string[];
|
|
|
2494
2513
|
/** The words without one address (removing its chip): every spelling of it, and the space it leaves. */
|
|
2495
2514
|
declare function withoutAddress(text: string, address: string): string;
|
|
2496
2515
|
|
|
2497
|
-
export { ANIMATE_ADVICE_STEPS, AnalysisIssueCode, AnalysisLocale, AvoidCheck, BUSINESS_TYPES, BUSINESS_TYPE_IDS, BookingNeed, COPY_LENGTH_ORDER, CopyLength, HARNESS_SOURCE, LITTLE_MOVEMENT_AVOID, LITTLE_MOVEMENT_CAP, LintKind, MAX_ANALYSIS_MOODS, NEEDS, NEED_IDS, NeedSource, PresetFit, RANK_WEIGHTS, READ_ANIMATE, READ_WEIGHTS, RankReason, SPEC_ANALYSIS_SHAPE, SPEC_BUSINESS_TYPES, SPEC_HARNESS_EXAMPLES, SPEC_HARNESS_SOURCE, SPEC_NEEDS, SPEC_STRUCTURES, SPEC_USER_AVOIDS, STRUCTURES, StyleReadGround, StyleReadHeadings, StyleReadMotion, StyleReadSourceKind, USER_AVOID_IDS, VoiceFormality, VoicePerson, addressesIn, analysisPromptContext, businessTypeById, calmerChoice, inferNeeds, isLookRule, lintDesign, lookMatches, mapStyleRead, matchBusinessType, matchBusinessTypes, motionFor, normalizeAddress, oklchHue, presetHasSerifHeadings, presetLook, rankStylePresets, rankWithReferences, userAvoidRule, validateSiteAnalysis, withoutAddress };
|
|
2498
|
-
export type { AnalysisContext, AnalysisIssue, AnalysisValidation, AvoidRule, BusinessType, BusinessTypeMatch, CheckRule, FactRead, GoodFit, LintFinding, LintSite, LookCondition, LookDesign, LookRule, MotionInput, MotionStart, NeedDef, NeedId, PromptContext, PromptContextOptions, PromptSection, RankInput, RankedPreset, SiteAnalysis, SiteNeed, StructureId, StyleHints, StyleRead, UserAvoidId };
|
|
2516
|
+
export { ANIMATE_ADVICE_STEPS, AnalysisIssueCode, AnalysisLocale, AvoidCheck, BUSINESS_TYPES, BUSINESS_TYPE_IDS, BookingNeed, COPY_LENGTH_ORDER, CopyLength, HARNESS_SOURCE, LITTLE_MOVEMENT_AVOID, LITTLE_MOVEMENT_CAP, LintKind, MAX_ANALYSIS_MOODS, NEEDS, NEED_IDS, NeedSource, PresetFit, RANK_WEIGHTS, READ_ANIMATE, READ_WEIGHTS, RankReason, SPEC_ANALYSIS_SHAPE, SPEC_BUSINESS_TYPES, SPEC_HARNESS_EXAMPLES, SPEC_HARNESS_SOURCE, SPEC_NEEDS, SPEC_STRUCTURES, SPEC_USER_AVOIDS, STRUCTURES, StyleReadGround, StyleReadHeadings, StyleReadMotion, StyleReadSourceKind, USER_AVOID_IDS, VoiceFormality, VoicePerson, addressesIn, analysisPromptContext, businessTypeById, calmerChoice, inferNeeds, isLookRule, lintDesign, lookMatches, mapStyleRead, matchBusinessType, matchBusinessTypes, motionAdvice, motionFor, normalizeAddress, oklchHue, presetHasSerifHeadings, presetLook, rankStylePresets, rankWithReferences, userAvoidRule, validateSiteAnalysis, withoutAddress };
|
|
2517
|
+
export type { AnalysisContext, AnalysisIssue, AnalysisValidation, AvoidRule, BusinessType, BusinessTypeMatch, CheckRule, FactRead, GoodFit, LintFinding, LintSite, LookCondition, LookDesign, LookRule, MotionBasis, MotionInput, MotionStart, NeedDef, NeedId, PromptContext, PromptContextOptions, PromptSection, RankInput, RankedPreset, SiteAnalysis, SiteNeed, StructureId, StyleHints, StyleRead, UserAvoidId };
|
package/package.json
CHANGED
package/src/harness-core/lint.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { DesignChoices, DesignMotion, parseHexColor, rgbToOklab, SPEC_AXES } from '@vectoriox/iox-ui/design-core';
|
|
1
|
+
import { AnimateId, DesignChoices, DesignMotion, parseHexColor, rgbToOklab, SPEC_AXES } from '@vectoriox/iox-ui/design-core';
|
|
2
2
|
import type { FactKey } from '@vectoriox/iox-ui/generation-core';
|
|
3
3
|
|
|
4
4
|
import { AvoidCheck, BUSINESS_TYPES, BusinessType, COPY_LENGTH_ORDER, CopyLength, isLookRule } from './business-types';
|
|
@@ -85,10 +85,22 @@ export function lintDesign(site: LintSite, typeId: string, types: ReadonlyArray<
|
|
|
85
85
|
}
|
|
86
86
|
}
|
|
87
87
|
}
|
|
88
|
-
|
|
89
|
-
if (
|
|
90
|
-
const usual = (SPEC_AXES.animations as Readonly<Record<string, { label: string }>>)[
|
|
88
|
+
const advice = motionAdvice(type.id, site.design.animate, types);
|
|
89
|
+
if (advice) {
|
|
90
|
+
const usual = (SPEC_AXES.animations as Readonly<Record<string, { label: string }>>)[advice.usual].label;
|
|
91
91
|
out.push({ kind: LintKind.Look, say: `${type.label} sites usually move less (${usual}); this much movement as people scroll can feel restless.` });
|
|
92
92
|
}
|
|
93
93
|
return out;
|
|
94
94
|
}
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* Rev 3.1: two levels above what this kind of business usually wears (Subtle → Lively) is advice, never a block.
|
|
98
|
+
* Structured, so Design ▸ Motion says it in the studio's language: `usual` = the level the type wears.
|
|
99
|
+
*/
|
|
100
|
+
export function motionAdvice(
|
|
101
|
+
typeId: string | null | undefined, animate: AnimateId | string | null | undefined, types: ReadonlyArray<BusinessType> = BUSINESS_TYPES,
|
|
102
|
+
): { usual: AnimateId } | null {
|
|
103
|
+
const type = typeId ? types.find(t => t.id === typeId) : undefined;
|
|
104
|
+
if (!type || !animate || !ANIMATE_ORDER.includes(animate)) return null;
|
|
105
|
+
return ANIMATE_ORDER.indexOf(animate) >= ANIMATE_ORDER.indexOf(type.moves.animate) + ANIMATE_ADVICE_STEPS ? { usual: type.moves.animate } : null;
|
|
106
|
+
}
|
|
@@ -15,9 +15,22 @@ export interface MotionInput {
|
|
|
15
15
|
avoid?: ReadonlyArray<string>;
|
|
16
16
|
}
|
|
17
17
|
|
|
18
|
+
/** Where the start came from, structured (the screen words it in its own language). */
|
|
19
|
+
export interface MotionBasis {
|
|
20
|
+
/** The kind of business it started from (null: no type matched, the style's own). */
|
|
21
|
+
type: string | null;
|
|
22
|
+
/** The style made How animated calmer than the business (or the references) wanted. */
|
|
23
|
+
calmerStyle: boolean;
|
|
24
|
+
/** The references set How animated. */
|
|
25
|
+
references: boolean;
|
|
26
|
+
/** The owner asked for little movement: all three were capped. */
|
|
27
|
+
littleMovement: boolean;
|
|
28
|
+
}
|
|
29
|
+
|
|
18
30
|
export interface MotionStart extends DesignMotion {
|
|
19
31
|
/** Why, in English — one line per step the start took. */
|
|
20
32
|
why: string[];
|
|
33
|
+
basis: MotionBasis;
|
|
21
34
|
}
|
|
22
35
|
|
|
23
36
|
/** The owner asked for little movement (`USER_AVOID_IDS`). */
|
|
@@ -53,9 +66,11 @@ export function motionFor(
|
|
|
53
66
|
const wanted = ref ?? base.animate;
|
|
54
67
|
let out: DesignMotion = { scroll: base.scroll, animate: calmerChoice('animate', wanted, preset.moves.animate), between: base.between };
|
|
55
68
|
const why = [type ? `${type.label}: ${triple(base)}` : `${preset.name}: the style's own`];
|
|
56
|
-
|
|
57
|
-
if (
|
|
69
|
+
const basis: MotionBasis = { type: type?.id ?? null, calmerStyle: out.animate !== wanted, references: !!(ref && type), littleMovement: false };
|
|
70
|
+
if (basis.calmerStyle) why.push(`${preset.name} moves less (${label('animate', preset.moves.animate)})`);
|
|
71
|
+
if (basis.references) why.push(`your references: ${label('animate', ref!)}`);
|
|
58
72
|
if ((input.avoid ?? []).includes(LITTLE_MOVEMENT_AVOID)) {
|
|
73
|
+
basis.littleMovement = true;
|
|
59
74
|
out = {
|
|
60
75
|
scroll: calmerChoice('scroll', out.scroll, LITTLE_MOVEMENT_CAP.scroll),
|
|
61
76
|
animate: calmerChoice('animate', out.animate, LITTLE_MOVEMENT_CAP.animate),
|
|
@@ -63,5 +78,5 @@ export function motionFor(
|
|
|
63
78
|
};
|
|
64
79
|
why.push('you asked for little movement');
|
|
65
80
|
}
|
|
66
|
-
return { ...out, why };
|
|
81
|
+
return { ...out, why, basis };
|
|
67
82
|
}
|