@vectoriox/iox-ui 5.50.0 → 5.52.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/design-core/index.d.ts +27 -0
- package/fesm2022/vectoriox-iox-ui-design-core.mjs +24 -0
- package/fesm2022/vectoriox-iox-ui-design-core.mjs.map +1 -1
- package/fesm2022/vectoriox-iox-ui-generation-core.mjs +30 -6
- package/fesm2022/vectoriox-iox-ui-generation-core.mjs.map +1 -1
- package/fesm2022/vectoriox-iox-ui-harness-core.mjs +445 -311
- package/fesm2022/vectoriox-iox-ui-harness-core.mjs.map +1 -1
- package/generation-core/index.d.ts +30 -10
- package/harness-core/index.d.ts +131 -1
- package/package.json +1 -1
- package/src/design-core/flavor-spec.generated.ts +24 -0
- package/src/design-core/style-presets.ts +3 -0
- package/src/generation-core/site-build-run.ts +34 -7
- package/src/harness-core/business-types.ts +2 -0
- package/src/harness-core/harness-spec.generated.ts +240 -120
- package/src/harness-core/rank.ts +17 -1
package/src/harness-core/rank.ts
CHANGED
|
@@ -5,6 +5,7 @@ import type { AnimateId } from '@vectoriox/iox-ui/design-core';
|
|
|
5
5
|
|
|
6
6
|
import { AvoidRule, BUSINESS_TYPES, BusinessType, isLookRule, LookRule, userAvoidRule } from './business-types';
|
|
7
7
|
import { lookMatches, presetLook } from './look';
|
|
8
|
+
import { AnalysisLocale } from './site-analysis';
|
|
8
9
|
|
|
9
10
|
/**
|
|
10
11
|
* Which styles suit a business, best first (AI plan rev 3 §3f, H3) — Design ▸ Look's order. Pure and
|
|
@@ -45,6 +46,8 @@ export interface RankedPreset {
|
|
|
45
46
|
reasonKind: RankReason;
|
|
46
47
|
/** In English, from the contract (the UI may localise `reasonKind` + `sharedMoods` instead). */
|
|
47
48
|
reason: string;
|
|
49
|
+
/** A good fit's reason in Hebrew (the contract has Hebrew for good fits; `presetReason` picks). */
|
|
50
|
+
reasonHe?: string;
|
|
48
51
|
sharedMoods: MoodId[];
|
|
49
52
|
/** Catalogue position — ties keep it. */
|
|
50
53
|
order: number;
|
|
@@ -113,10 +116,23 @@ export function rankStylePresets(
|
|
|
113
116
|
: goodAt >= 0 && type ? [RankReason.GoodFit, type.good[goodAt].reason]
|
|
114
117
|
: sharedMoods.length ? [RankReason.SharedMoods, moodsLine(sharedMoods)]
|
|
115
118
|
: [RankReason.None, ''];
|
|
116
|
-
|
|
119
|
+
const reasonHe = reasonKind === RankReason.GoodFit && type ? type.good[goodAt].reasonHe : undefined;
|
|
120
|
+
return { id: preset.id, fit, score, reasonKind, reason, ...(reasonHe ? { reasonHe } : {}), sharedMoods, order };
|
|
117
121
|
}).sort((a, b) => b.score - a.score || a.order - b.order);
|
|
118
122
|
}
|
|
119
123
|
|
|
124
|
+
/**
|
|
125
|
+
* The line a style's card shows (its title): why it sits where it does, else what the style is — in the studio's
|
|
126
|
+
* language where the contract has it. Decided 2026-10-25: good fits and descriptions have Hebrew (the name stays a
|
|
127
|
+
* proper name); a type's or the owner's advice and the shared-moods line are English in the contract yet.
|
|
128
|
+
*/
|
|
129
|
+
export function presetReason(ranked: RankedPreset, preset: StylePreset | undefined, locale: string | null | undefined): string {
|
|
130
|
+
const hebrew = locale === AnalysisLocale.He;
|
|
131
|
+
if (hebrew && ranked.reasonKind === RankReason.GoodFit && ranked.reasonHe) return ranked.reasonHe;
|
|
132
|
+
if (ranked.reason) return ranked.reason;
|
|
133
|
+
return (hebrew ? preset?.blurbHe : preset?.blurb) ?? '';
|
|
134
|
+
}
|
|
135
|
+
|
|
120
136
|
// ── References: a reading of pictures or a site, as style (plan §3k, R4) ─────────────────────────────────
|
|
121
137
|
export enum StyleReadSourceKind {
|
|
122
138
|
Image = 'image',
|