@aglyn/plugins-ai 1.0.0-beta.292 → 1.0.0-beta.296
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/package.json +17 -17
- package/src/lib/components/ai-job-links.d.ts +15 -2
- package/src/lib/components/ai-job-links.js +24 -3
- package/src/lib/components/ai-job-links.js.map +1 -1
- package/src/lib/components/ai-job-requests.d.ts +9 -0
- package/src/lib/components/ai-job-requests.js +34 -0
- package/src/lib/components/ai-job-requests.js.map +1 -1
- package/src/lib/components/ai-site-build-page.component.js +28 -2
- package/src/lib/components/ai-site-build-page.component.js.map +1 -1
- package/src/lib/components/ai-site-import-job.component.js +5 -4
- package/src/lib/components/ai-site-import-job.component.js.map +1 -1
- package/src/lib/components/ai-site-import-start.component.js +3 -3
- package/src/lib/components/ai-site-import-start.component.js.map +1 -1
- package/src/lib/components/ai-site-start-card.component.d.ts +1 -1
- package/src/lib/components/ai-site-start-card.component.js +129 -29
- package/src/lib/components/ai-site-start-card.component.js.map +1 -1
- package/src/lib/components/ai-site-start-steps.component.d.ts +15 -3
- package/src/lib/components/ai-site-start-steps.component.js +42 -25
- package/src/lib/components/ai-site-start-steps.component.js.map +1 -1
- package/src/lib/components/ai-site-style-previews.d.ts +17 -0
- package/src/lib/components/ai-site-style-previews.js +26 -95
- package/src/lib/components/ai-site-style-previews.js.map +1 -1
- package/src/lib/components/assist-jobs-drawer.component.d.ts +7 -1
- package/src/lib/components/assist-jobs-drawer.component.js +20 -6
- package/src/lib/components/assist-jobs-drawer.component.js.map +1 -1
- package/src/lib/components/assist-page-change-card.component.d.ts +44 -0
- package/src/lib/components/assist-page-change-card.component.js +166 -0
- package/src/lib/components/assist-page-change-card.component.js.map +1 -0
- package/src/lib/components/assist-panel.component.d.ts +105 -1
- package/src/lib/components/assist-panel.component.js +224 -29
- package/src/lib/components/assist-panel.component.js.map +1 -1
- package/src/lib/declarations.server.js +22 -0
- package/src/lib/declarations.server.js.map +1 -1
- package/src/lib/jobs/ai-job-edit-step.d.ts +62 -16
- package/src/lib/jobs/ai-job-edit-step.js +172 -61
- package/src/lib/jobs/ai-job-edit-step.js.map +1 -1
- package/src/lib/jobs/ai-job-import-step.d.ts +21 -2
- package/src/lib/jobs/ai-job-import-step.js +179 -49
- package/src/lib/jobs/ai-job-import-step.js.map +1 -1
- package/src/lib/jobs/ai-job-layout-language.d.ts +27 -3
- package/src/lib/jobs/ai-job-layout-language.js +156 -113
- package/src/lib/jobs/ai-job-layout-language.js.map +1 -1
- package/src/lib/jobs/ai-job-layout-step.js +56 -17
- package/src/lib/jobs/ai-job-layout-step.js.map +1 -1
- package/src/lib/jobs/ai-job-navigation-step.js +4 -2
- package/src/lib/jobs/ai-job-navigation-step.js.map +1 -1
- package/src/lib/jobs/ai-job-page-language.d.ts +25 -15
- package/src/lib/jobs/ai-job-page-language.js +120 -66
- package/src/lib/jobs/ai-job-page-language.js.map +1 -1
- package/src/lib/jobs/ai-job-page-step.js +27 -7
- package/src/lib/jobs/ai-job-page-step.js.map +1 -1
- package/src/lib/jobs/ai-job-site-datasets.d.ts +12 -4
- package/src/lib/jobs/ai-job-site-datasets.js +36 -16
- package/src/lib/jobs/ai-job-site-datasets.js.map +1 -1
- package/src/lib/jobs/ai-jobs.js +6 -2
- package/src/lib/jobs/ai-jobs.js.map +1 -1
- package/src/lib/jobs/ai-layout-stock-photos.d.ts +50 -1
- package/src/lib/jobs/ai-layout-stock-photos.js +586 -35
- package/src/lib/jobs/ai-layout-stock-photos.js.map +1 -1
- package/src/lib/jobs/ai-site-import-compile.d.ts +147 -0
- package/src/lib/jobs/ai-site-import-compile.js +1143 -0
- package/src/lib/jobs/ai-site-import-compile.js.map +1 -0
- package/src/lib/jobs/ai-site-import-document.d.ts +9 -36
- package/src/lib/jobs/ai-site-import-document.js +23 -489
- package/src/lib/jobs/ai-site-import-document.js.map +1 -1
- package/src/lib/jobs/ai-site-import-look.d.ts +54 -7
- package/src/lib/jobs/ai-site-import-look.js +163 -52
- package/src/lib/jobs/ai-site-import-look.js.map +1 -1
- package/src/lib/jobs/ai-site-import-publish.d.ts +7 -1
- package/src/lib/jobs/ai-site-import-publish.js +19 -5
- package/src/lib/jobs/ai-site-import-publish.js.map +1 -1
- package/src/lib/jobs/ai-site-late-photos.js +4 -2
- package/src/lib/jobs/ai-site-late-photos.js.map +1 -1
- package/src/lib/jobs/ai-site-publish.d.ts +10 -1
- package/src/lib/jobs/ai-site-publish.js +8 -3
- package/src/lib/jobs/ai-site-publish.js.map +1 -1
- package/src/lib/jobs/fixtures/ai-stock-photo-agl4092-1029-recordings.d.ts +23 -0
- package/src/lib/jobs/fixtures/ai-stock-photo-agl4092-1029-recordings.js +677 -0
- package/src/lib/jobs/fixtures/ai-stock-photo-agl4092-1029-recordings.js.map +1 -0
- package/src/lib/layout-language/ai-layout-compiler.d.ts +26 -0
- package/src/lib/layout-language/ai-layout-compiler.js +677 -33
- package/src/lib/layout-language/ai-layout-compiler.js.map +1 -1
- package/src/lib/layout-language/ai-layout-frame-hollows.js +5 -1
- package/src/lib/layout-language/ai-layout-frame-hollows.js.map +1 -1
- package/src/lib/layout-language/ai-layout-frame-source.d.ts +196 -0
- package/src/lib/layout-language/ai-layout-frame-source.js +726 -0
- package/src/lib/layout-language/ai-layout-frame-source.js.map +1 -0
- package/src/lib/layout-language/ai-layout-frame.d.ts +22 -0
- package/src/lib/layout-language/ai-layout-frame.js +121 -29
- package/src/lib/layout-language/ai-layout-frame.js.map +1 -1
- package/src/lib/layout-language/ai-layout-language.d.ts +103 -37
- package/src/lib/layout-language/ai-layout-language.js +85 -120
- package/src/lib/layout-language/ai-layout-language.js.map +1 -1
- package/src/lib/model/ai-credit-estimate.d.ts +11 -7
- package/src/lib/model/ai-credit-estimate.js +11 -7
- package/src/lib/model/ai-credit-estimate.js.map +1 -1
- package/src/lib/model/ai-edit-job.d.ts +33 -16
- package/src/lib/model/ai-edit-job.js +50 -34
- package/src/lib/model/ai-edit-job.js.map +1 -1
- package/src/lib/model/ai-job-activity.d.ts +6 -11
- package/src/lib/model/ai-job-activity.js +8 -15
- package/src/lib/model/ai-job-activity.js.map +1 -1
- package/src/lib/model/ai-jobs.types.d.ts +6 -0
- package/src/lib/model/ai-jobs.types.js.map +1 -1
- package/src/lib/model/ai-site-import.d.ts +307 -13
- package/src/lib/model/ai-site-import.js +227 -19
- package/src/lib/model/ai-site-import.js.map +1 -1
- package/src/lib/model/ai-site-inventory.d.ts +6 -0
- package/src/lib/model/ai-site-inventory.js.map +1 -1
- package/src/lib/model/ai-site-look.d.ts +65 -1
- package/src/lib/model/ai-site-look.js +141 -23
- package/src/lib/model/ai-site-look.js.map +1 -1
- package/src/lib/model/ai-site-photos.d.ts +2 -0
- package/src/lib/model/ai-site-photos.js.map +1 -1
- package/src/lib/model/ai-site-start-steps.d.ts +4 -3
- package/src/lib/model/ai-site-start-steps.js +11 -3
- package/src/lib/model/ai-site-start-steps.js.map +1 -1
- package/src/lib/model/ai-site-start.d.ts +23 -2
- package/src/lib/model/ai-site-start.js +25 -3
- package/src/lib/model/ai-site-start.js.map +1 -1
- package/src/lib/model/assist-edit.d.ts +18 -1
- package/src/lib/model/assist-edit.js +7 -0
- package/src/lib/model/assist-edit.js.map +1 -1
- package/src/lib/model/assist-page-change.d.ts +86 -0
- package/src/lib/model/assist-page-change.js +86 -0
- package/src/lib/model/assist-page-change.js.map +1 -0
- package/src/lib/providers/routing.d.ts +11 -0
- package/src/lib/providers/routing.js +23 -0
- package/src/lib/providers/routing.js.map +1 -1
- package/src/lib/runtime/ai-doctrine-validators.d.ts +4 -2
- package/src/lib/runtime/ai-doctrine-validators.js +7 -2
- package/src/lib/runtime/ai-doctrine-validators.js.map +1 -1
- package/src/lib/runtime/ai-eval.js +3 -1
- package/src/lib/runtime/ai-eval.js.map +1 -1
- package/src/lib/runtime/ai-icon-library.d.ts +4 -0
- package/src/lib/runtime/ai-icon-library.js +4 -0
- package/src/lib/runtime/ai-icon-library.js.map +1 -1
- package/src/lib/runtime/ai-node-tree.d.ts +5 -0
- package/src/lib/runtime/ai-node-tree.js +23 -4
- package/src/lib/runtime/ai-node-tree.js.map +1 -1
- package/src/lib/runtime/ai-palette.d.ts +2 -0
- package/src/lib/runtime/ai-palette.generated.js +19 -3
- package/src/lib/runtime/ai-palette.generated.js.map +1 -1
- package/src/lib/runtime/ai-palette.js +2 -1
- package/src/lib/runtime/ai-palette.js.map +1 -1
- package/src/lib/runtime/site-inventory.d.ts +8 -1
- package/src/lib/runtime/site-inventory.js +18 -0
- package/src/lib/runtime/site-inventory.js.map +1 -1
- package/src/lib/server/assist-build.js +2 -0
- package/src/lib/server/assist-build.js.map +1 -1
- package/src/lib/server/assist-chat.js +51 -2
- package/src/lib/server/assist-chat.js.map +1 -1
- package/src/lib/server/assist-edit.d.ts +54 -2
- package/src/lib/server/assist-edit.js +219 -30
- package/src/lib/server/assist-edit.js.map +1 -1
- package/src/lib/server/assist-page-change.d.ts +62 -0
- package/src/lib/server/assist-page-change.js +140 -0
- package/src/lib/server/assist-page-change.js.map +1 -0
- package/src/lib/site-import/fixtures/site-layout-recordings.d.ts +50 -0
- package/src/lib/site-import/fixtures/site-layout-recordings.js +86 -0
- package/src/lib/site-import/fixtures/site-layout-recordings.js.map +1 -0
- package/src/lib/site-import/site-import-crawl.d.ts +18 -1
- package/src/lib/site-import/site-import-crawl.js +70 -10
- package/src/lib/site-import/site-import-crawl.js.map +1 -1
- package/src/lib/site-import/site-import-css.d.ts +110 -0
- package/src/lib/site-import/site-import-css.js +826 -0
- package/src/lib/site-import/site-import-css.js.map +1 -0
- package/src/lib/site-import/site-import-html.d.ts +116 -1
- package/src/lib/site-import/site-import-html.js +538 -46
- package/src/lib/site-import/site-import-html.js.map +1 -1
- package/src/lib/site-import/site-import-layout.d.ts +79 -0
- package/src/lib/site-import/site-import-layout.js +1608 -0
- package/src/lib/site-import/site-import-layout.js.map +1 -0
- package/src/lib/site-import/site-import-nav.d.ts +40 -0
- package/src/lib/site-import/site-import-nav.js +437 -0
- package/src/lib/site-import/site-import-nav.js.map +1 -0
- package/src/lib/site-import/site-import-page.d.ts +8 -1
- package/src/lib/site-import/site-import-page.js +24 -2
- package/src/lib/site-import/site-import-page.js.map +1 -1
- package/src/lib/assets/site-styles/beauty.webp +0 -0
- package/src/lib/assets/site-styles/blog.webp +0 -0
- package/src/lib/assets/site-styles/business.webp +0 -0
- package/src/lib/assets/site-styles/coming-soon.webp +0 -0
- package/src/lib/assets/site-styles/education.webp +0 -0
- package/src/lib/assets/site-styles/events.webp +0 -0
- package/src/lib/assets/site-styles/fitness.webp +0 -0
- package/src/lib/assets/site-styles/landing.webp +0 -0
- package/src/lib/assets/site-styles/music.webp +0 -0
- package/src/lib/assets/site-styles/nonprofit.webp +0 -0
- package/src/lib/assets/site-styles/personal.webp +0 -0
- package/src/lib/assets/site-styles/photography.webp +0 -0
- package/src/lib/assets/site-styles/portfolio.webp +0 -0
- package/src/lib/assets/site-styles/professional.webp +0 -0
- package/src/lib/assets/site-styles/realestate.webp +0 -0
- package/src/lib/assets/site-styles/restaurant.webp +0 -0
- package/src/lib/assets/site-styles/store.webp +0 -0
- package/src/lib/assets/site-styles/studio.webp +0 -0
- package/src/lib/assets/site-styles/trades.webp +0 -0
- package/src/lib/assets/site-styles/wellness.webp +0 -0
- package/src/lib/assets/site-styles/yoga.webp +0 -0
- package/src/lib/site-import/site-import-review.d.ts +0 -40
- package/src/lib/site-import/site-import-review.js +0 -149
- package/src/lib/site-import/site-import-review.js.map +0 -1
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
* See the License for the specific language governing permissions and
|
|
15
15
|
* limitations under the License.
|
|
16
16
|
*/
|
|
17
|
-
import type { HostTheme, HostThemeSchemeColors } from '@aglyn/shared-data-types';
|
|
17
|
+
import type { HostTheme, HostThemeFontCategory, HostThemeSchemeColors } from '@aglyn/shared-data-types';
|
|
18
18
|
import { type AiSiteMotionStyle } from '../layout-language/ai-layout-motion';
|
|
19
19
|
import type { AiTool } from '../runtime/ai-runtime';
|
|
20
20
|
import { type AiSiteBase, type AiSiteButtons, type AiSiteChroma, type AiSiteCorners, type AiSiteDensity, type AiSiteGround, type AiSiteKind, type AiSiteRhythm } from './ai-site-kinds';
|
|
@@ -92,7 +92,33 @@ export interface AiSiteStyle {
|
|
|
92
92
|
* pages move in its kind's mood.
|
|
93
93
|
*/
|
|
94
94
|
motion?: AiSiteMotionStyle;
|
|
95
|
+
/**
|
|
96
|
+
* A site brought in's own page ground (AGL-4108), `#rrggbb`: the color its
|
|
97
|
+
* source's pages sit on, where it is light enough for the theme's text.
|
|
98
|
+
* Absent, the ground is drawn as `ground` says.
|
|
99
|
+
*/
|
|
100
|
+
page?: string;
|
|
101
|
+
/**
|
|
102
|
+
* A site brought in's own type (AGL-4108): the families its source sets
|
|
103
|
+
* its body and its headings in, where the theme font catalog has them,
|
|
104
|
+
* loaded in place of the pairing's. The pairing still sets the weights and
|
|
105
|
+
* the scale they are drawn at. Absent on every other site, whose type is
|
|
106
|
+
* the pairing's alone.
|
|
107
|
+
*/
|
|
108
|
+
sourceFonts?: {
|
|
109
|
+
body: AiSiteSourceFont;
|
|
110
|
+
heading: AiSiteSourceFont | null;
|
|
111
|
+
} | null;
|
|
112
|
+
}
|
|
113
|
+
/** A family a site brought in is set in (AGL-4108), with the weights the catalog says it has. */
|
|
114
|
+
export interface AiSiteSourceFont {
|
|
115
|
+
family: string;
|
|
116
|
+
category: HostThemeFontCategory;
|
|
117
|
+
/** The upright weights the family offers. */
|
|
118
|
+
weights: number[];
|
|
95
119
|
}
|
|
120
|
+
/** The weights of `wanted` a family offers, each the nearest it has where it lacks one. */
|
|
121
|
+
export declare function aiSiteFontWeightsIn(wanted: readonly number[], offered: readonly number[]): number[];
|
|
96
122
|
/** What the model may choose, every field optional. */
|
|
97
123
|
export type AiSiteLookAnswer = Partial<Pick<AiSiteStyle, 'base' | 'hue' | 'accent' | 'ground' | 'fonts' | 'corners' | 'buttons' | 'cards' | 'fields' | 'eyebrow' | 'header' | 'brand' | 'motion'>>;
|
|
98
124
|
/**
|
|
@@ -188,3 +214,41 @@ export declare const AI_SITE_DISPLAY_BOOST: Readonly<Record<string, {
|
|
|
188
214
|
* and dialog styles, its control heights — stays the base's.
|
|
189
215
|
*/
|
|
190
216
|
export declare function aiSiteTheme(style: AiSiteStyle, base: HostTheme): HostTheme;
|
|
217
|
+
/** A kind's first look as a built-in theme with a brand over it, and the style answers that say the same. */
|
|
218
|
+
export interface AiSiteKindDefaultLook {
|
|
219
|
+
/** The `builtin` starter theme a site created in this style starts with. */
|
|
220
|
+
theme: {
|
|
221
|
+
kind: 'builtin';
|
|
222
|
+
base: string;
|
|
223
|
+
brand: {
|
|
224
|
+
light: Record<string, string>;
|
|
225
|
+
dark?: Record<string, string>;
|
|
226
|
+
};
|
|
227
|
+
fonts: string | null;
|
|
228
|
+
};
|
|
229
|
+
/** The same look as the AI start's style answers name it (`fp-starter-{kind}-ai`). */
|
|
230
|
+
answerStyle: {
|
|
231
|
+
base: string;
|
|
232
|
+
hue?: number;
|
|
233
|
+
ground: AiSiteGround;
|
|
234
|
+
fonts: string | null;
|
|
235
|
+
corners: AiSiteCorners;
|
|
236
|
+
buttons: AiSiteButtons;
|
|
237
|
+
};
|
|
238
|
+
}
|
|
239
|
+
/**
|
|
240
|
+
* A kind of site's FIRST look (AGL-4049), the one a site created in that
|
|
241
|
+
* style starts with and the one the platform's own starter listings carry:
|
|
242
|
+
* the kind's first base theme the deployment has (`starter`, or a built-in
|
|
243
|
+
* whose preset `known.presetIds` holds), its first font pairing the platform
|
|
244
|
+
* has, and a brand primary from the midpoint of its first hue range, colored
|
|
245
|
+
* as {@link aiSiteColors} colors one. A kind that suits any hue keeps the
|
|
246
|
+
* base's own colors. One derivation, so the style a person picks in Create
|
|
247
|
+
* site and the seeded `fp-starter-{kind}-base` listing look the same.
|
|
248
|
+
*
|
|
249
|
+
* Deterministic: no draw, the seed is the kind's id.
|
|
250
|
+
*/
|
|
251
|
+
export declare function aiSiteKindDefaultLook(kind: AiSiteKind, known: {
|
|
252
|
+
presetIds: ReadonlySet<string>;
|
|
253
|
+
pairingIds?: ReadonlySet<string>;
|
|
254
|
+
}): AiSiteKindDefaultLook;
|
|
@@ -80,6 +80,15 @@ const DENSITIES = [
|
|
|
80
80
|
'regular',
|
|
81
81
|
'airy'
|
|
82
82
|
];
|
|
83
|
+
/** The weights of `wanted` a family offers, each the nearest it has where it lacks one. */ export function aiSiteFontWeightsIn(wanted, offered) {
|
|
84
|
+
if (!offered.length) return [
|
|
85
|
+
...new Set(wanted)
|
|
86
|
+
].sort((a, b)=>a - b);
|
|
87
|
+
const nearest = (weight)=>offered.reduce((best, each)=>Math.abs(each - weight) < Math.abs(best - weight) ? each : best, offered[0]);
|
|
88
|
+
return [
|
|
89
|
+
...new Set(wanted.map(nearest))
|
|
90
|
+
].sort((a, b)=>a - b);
|
|
91
|
+
}
|
|
83
92
|
// ── The seed ─────────────────────────────────────────────────────────────
|
|
84
93
|
/** A job's seed: FNV-1a over its id. */ export function aiSiteSeed(jobId) {
|
|
85
94
|
let hash = 0x811c9dc5;
|
|
@@ -780,7 +789,9 @@ const START_L = {
|
|
|
780
789
|
}
|
|
781
790
|
};
|
|
782
791
|
const ground = grounds[style.ground];
|
|
783
|
-
|
|
792
|
+
// A site brought in keeps the ground its source's pages sit on (AGL-4108), where its text reads on it.
|
|
793
|
+
const own = style.page && /^#[0-9a-f]{6}$/i.test(style.page) && aiHexOklch(style.page).L >= 0.9 ? style.page.toLowerCase() : null;
|
|
794
|
+
const background = own != null ? own : aiOklchHex(ground.L, ground.C * groundChroma, ground.h);
|
|
784
795
|
const paper = aiOklchHex(ground.paper[0], ground.paper[1] * groundChroma, ground.h);
|
|
785
796
|
// The brand color: a button label reads on it, so it reads on the page too.
|
|
786
797
|
let primaryMain;
|
|
@@ -1241,7 +1252,7 @@ function isRecord(value) {
|
|
|
1241
1252
|
* site's own; whatever the base sets beyond them — its focus rings, its menu
|
|
1242
1253
|
* and dialog styles, its control heights — stays the base's.
|
|
1243
1254
|
*/ export function aiSiteTheme(style, base) {
|
|
1244
|
-
var _aiSiteFontPairing, _base_typography, _base_shape, _base_components;
|
|
1255
|
+
var _aiSiteFontPairing, _base_typography, _base_shape, _base_components, _style_sourceFonts;
|
|
1245
1256
|
var _theme_fonts;
|
|
1246
1257
|
const pairing = (_aiSiteFontPairing = aiSiteFontPairing(style.fonts)) != null ? _aiSiteFontPairing : AI_SITE_FONT_PAIRINGS[0];
|
|
1247
1258
|
const colors = aiSiteColors(style);
|
|
@@ -1273,37 +1284,54 @@ function isRecord(value) {
|
|
|
1273
1284
|
components: merged((_base_components = base.components) != null ? _base_components : {}, componentsFor(style))
|
|
1274
1285
|
});
|
|
1275
1286
|
delete theme.darkScheme;
|
|
1276
|
-
|
|
1287
|
+
// A site brought in is set in its source's own families (AGL-4108), at the
|
|
1288
|
+
// weights the pairing draws with, as near as each family has them.
|
|
1289
|
+
const headingWeights = [
|
|
1290
|
+
pairing.heading.weight,
|
|
1291
|
+
pairing.heading.sub
|
|
1292
|
+
];
|
|
1293
|
+
const source = (_style_sourceFonts = style.sourceFonts) != null ? _style_sourceFonts : null;
|
|
1294
|
+
const body = (source == null ? void 0 : source.body) ? {
|
|
1295
|
+
family: source.body.family,
|
|
1296
|
+
category: source.body.category,
|
|
1297
|
+
weights: aiSiteFontWeightsIn(pairing.body.weights, source.body.weights)
|
|
1298
|
+
} : {
|
|
1299
|
+
family: pairing.body.family,
|
|
1300
|
+
category: pairing.body.category,
|
|
1301
|
+
weights: [
|
|
1302
|
+
...pairing.body.weights
|
|
1303
|
+
]
|
|
1304
|
+
};
|
|
1305
|
+
const heading = source ? source.heading ? {
|
|
1306
|
+
family: source.heading.family,
|
|
1307
|
+
category: source.heading.category,
|
|
1308
|
+
weights: aiSiteFontWeightsIn(headingWeights, source.heading.weights)
|
|
1309
|
+
} : _extends({}, body, {
|
|
1310
|
+
weights: aiSiteFontWeightsIn(headingWeights, source.body.weights)
|
|
1311
|
+
}) : {
|
|
1312
|
+
family: pairing.heading.family,
|
|
1313
|
+
category: pairing.heading.category,
|
|
1314
|
+
weights: [
|
|
1315
|
+
...new Set(headingWeights)
|
|
1316
|
+
].sort((a, b)=>a - b)
|
|
1317
|
+
};
|
|
1318
|
+
const sameFamily = heading.family.toLowerCase() === body.family.toLowerCase();
|
|
1277
1319
|
theme = writeThemeFonts(theme, {
|
|
1278
|
-
body: {
|
|
1279
|
-
family: pairing.body.family,
|
|
1280
|
-
category: pairing.body.category,
|
|
1281
|
-
weights: [
|
|
1282
|
-
...pairing.body.weights
|
|
1283
|
-
],
|
|
1320
|
+
body: _extends({}, body, {
|
|
1284
1321
|
source: 'google'
|
|
1285
|
-
},
|
|
1286
|
-
heading: sameFamily ? null : {
|
|
1287
|
-
family: pairing.heading.family,
|
|
1288
|
-
category: pairing.heading.category,
|
|
1289
|
-
weights: [
|
|
1290
|
-
...new Set([
|
|
1291
|
-
pairing.heading.weight,
|
|
1292
|
-
pairing.heading.sub
|
|
1293
|
-
])
|
|
1294
|
-
].sort((a, b)=>a - b),
|
|
1322
|
+
}),
|
|
1323
|
+
heading: sameFamily ? null : _extends({}, heading, {
|
|
1295
1324
|
source: 'google'
|
|
1296
|
-
}
|
|
1325
|
+
})
|
|
1297
1326
|
});
|
|
1298
|
-
// A
|
|
1327
|
+
// A heading in the body's family loads the heading weights too.
|
|
1299
1328
|
if (sameFamily && ((_theme_fonts = theme.fonts) == null ? void 0 : _theme_fonts[0])) {
|
|
1300
1329
|
var _theme_fonts__weights;
|
|
1301
1330
|
theme.fonts[0] = _extends({}, theme.fonts[0], {
|
|
1302
1331
|
weights: [
|
|
1303
1332
|
...new Set([
|
|
1304
1333
|
...(_theme_fonts__weights = theme.fonts[0].weights) != null ? _theme_fonts__weights : [],
|
|
1305
|
-
|
|
1306
|
-
pairing.heading.sub
|
|
1334
|
+
...heading.weights
|
|
1307
1335
|
])
|
|
1308
1336
|
].sort((a, b)=>a - b)
|
|
1309
1337
|
});
|
|
@@ -1316,5 +1344,95 @@ function isRecord(value) {
|
|
|
1316
1344
|
}
|
|
1317
1345
|
return theme;
|
|
1318
1346
|
}
|
|
1347
|
+
// ── A kind's first look (AGL-4049) ──────────────────────────────────────────
|
|
1348
|
+
/** The midpoint of a kind's first hue range, or `null` when it spans the whole wheel (any hue suits it). */ function firstHueOf(hues) {
|
|
1349
|
+
var _ref;
|
|
1350
|
+
const [from, to] = (_ref = hues == null ? void 0 : hues[0]) != null ? _ref : [
|
|
1351
|
+
0,
|
|
1352
|
+
360
|
|
1353
|
+
];
|
|
1354
|
+
const span = from <= to ? to - from : 360 - from + to;
|
|
1355
|
+
if (span >= 360) return null;
|
|
1356
|
+
return Math.round(from + span / 2) % 360;
|
|
1357
|
+
}
|
|
1358
|
+
/**
|
|
1359
|
+
* A kind of site's FIRST look (AGL-4049), the one a site created in that
|
|
1360
|
+
* style starts with and the one the platform's own starter listings carry:
|
|
1361
|
+
* the kind's first base theme the deployment has (`starter`, or a built-in
|
|
1362
|
+
* whose preset `known.presetIds` holds), its first font pairing the platform
|
|
1363
|
+
* has, and a brand primary from the midpoint of its first hue range, colored
|
|
1364
|
+
* as {@link aiSiteColors} colors one. A kind that suits any hue keeps the
|
|
1365
|
+
* base's own colors. One derivation, so the style a person picks in Create
|
|
1366
|
+
* site and the seeded `fp-starter-{kind}-base` listing look the same.
|
|
1367
|
+
*
|
|
1368
|
+
* Deterministic: no draw, the seed is the kind's id.
|
|
1369
|
+
*/ export function aiSiteKindDefaultLook(kind, known) {
|
|
1370
|
+
var _known_pairingIds, _family_bases_find, _family_fonts_find;
|
|
1371
|
+
const family = kind.look;
|
|
1372
|
+
const pairingIds = (_known_pairingIds = known.pairingIds) != null ? _known_pairingIds : new Set(AI_SITE_FONT_PAIRINGS.map((pairing)=>pairing.id));
|
|
1373
|
+
const base = (_family_bases_find = family.bases.find((name)=>name === 'starter' || known.presetIds.has(`theme-presets.${name}`))) != null ? _family_bases_find : 'starter';
|
|
1374
|
+
const fonts = (_family_fonts_find = family.fonts.find((id)=>pairingIds.has(id))) != null ? _family_fonts_find : null;
|
|
1375
|
+
const hue = firstHueOf(family.hues);
|
|
1376
|
+
const ground = family.grounds[0];
|
|
1377
|
+
const corners = family.corners[0];
|
|
1378
|
+
const colors = hue === null ? null : aiSiteColors({
|
|
1379
|
+
v: 1,
|
|
1380
|
+
kind: kind.id,
|
|
1381
|
+
base,
|
|
1382
|
+
seed: aiSiteSeed(kind.id),
|
|
1383
|
+
hue,
|
|
1384
|
+
accent: hue,
|
|
1385
|
+
chroma: family.chroma,
|
|
1386
|
+
ground,
|
|
1387
|
+
fonts: fonts != null ? fonts : '',
|
|
1388
|
+
corners,
|
|
1389
|
+
buttons: family.buttons,
|
|
1390
|
+
// Not read by the colors; named so the style is whole.
|
|
1391
|
+
cards: 'flat',
|
|
1392
|
+
fields: 'outlined',
|
|
1393
|
+
eyebrow: 'caps',
|
|
1394
|
+
header: 'line',
|
|
1395
|
+
headerAlign: 'start',
|
|
1396
|
+
rhythm: 'calm',
|
|
1397
|
+
headingScale: family.headingScale,
|
|
1398
|
+
density: family.density,
|
|
1399
|
+
brand: null
|
|
1400
|
+
});
|
|
1401
|
+
const primary = (scheme)=>{
|
|
1402
|
+
var _colors_scheme;
|
|
1403
|
+
const value = colors == null ? void 0 : (_colors_scheme = colors[scheme]) == null ? void 0 : _colors_scheme.primary;
|
|
1404
|
+
return value && typeof value === 'object' && typeof value.main === 'string' ? value.main : null;
|
|
1405
|
+
};
|
|
1406
|
+
const light = primary('light');
|
|
1407
|
+
const dark = primary('dark');
|
|
1408
|
+
const brand = light && dark ? {
|
|
1409
|
+
light: {
|
|
1410
|
+
primary: light
|
|
1411
|
+
},
|
|
1412
|
+
dark: {
|
|
1413
|
+
primary: dark
|
|
1414
|
+
}
|
|
1415
|
+
} : {
|
|
1416
|
+
light: {}
|
|
1417
|
+
};
|
|
1418
|
+
return {
|
|
1419
|
+
theme: {
|
|
1420
|
+
kind: 'builtin',
|
|
1421
|
+
base,
|
|
1422
|
+
brand,
|
|
1423
|
+
fonts
|
|
1424
|
+
},
|
|
1425
|
+
answerStyle: _extends({
|
|
1426
|
+
base
|
|
1427
|
+
}, hue === null ? {} : {
|
|
1428
|
+
hue
|
|
1429
|
+
}, {
|
|
1430
|
+
ground,
|
|
1431
|
+
fonts,
|
|
1432
|
+
corners,
|
|
1433
|
+
buttons: family.buttons
|
|
1434
|
+
})
|
|
1435
|
+
};
|
|
1436
|
+
}
|
|
1319
1437
|
|
|
1320
1438
|
//# sourceMappingURL=ai-site-look.js.map
|