@aglyn/plugins-ai 1.2.0 → 1.4.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/package.json +17 -17
- package/src/lib/components/ai-insight-dialog.component.js +7 -2
- package/src/lib/components/ai-insight-dialog.component.js.map +1 -1
- package/src/lib/components/ai-job-request.component.d.ts +28 -0
- package/src/lib/components/ai-job-request.component.js +103 -0
- package/src/lib/components/ai-job-request.component.js.map +1 -0
- package/src/lib/components/ai-jobs-list-page.component.d.ts +2 -0
- package/src/lib/components/ai-jobs-list-page.component.js +2 -2
- package/src/lib/components/ai-jobs-list-page.component.js.map +1 -1
- package/src/lib/components/ai-site-build-page.component.js +36 -6
- package/src/lib/components/ai-site-build-page.component.js.map +1 -1
- package/src/lib/components/ai-site-import-job.component.js +2 -2
- package/src/lib/components/ai-site-import-job.component.js.map +1 -1
- package/src/lib/insights/ai-insight-digest.d.ts +34 -5
- package/src/lib/insights/ai-insight-digest.js +171 -10
- package/src/lib/insights/ai-insight-digest.js.map +1 -1
- package/src/lib/jobs/ai-job-import-step.d.ts +35 -2
- package/src/lib/jobs/ai-job-import-step.js +124 -12
- package/src/lib/jobs/ai-job-import-step.js.map +1 -1
- package/src/lib/jobs/ai-job-insight-step.d.ts +1 -1
- package/src/lib/jobs/ai-job-insight-step.js +5 -1
- package/src/lib/jobs/ai-job-insight-step.js.map +1 -1
- package/src/lib/jobs/ai-jobs.d.ts +6 -0
- package/src/lib/jobs/ai-jobs.js +43 -6
- package/src/lib/jobs/ai-jobs.js.map +1 -1
- package/src/lib/jobs/ai-layout-stock-photos.d.ts +13 -6
- package/src/lib/jobs/ai-layout-stock-photos.js +104 -32
- package/src/lib/jobs/ai-layout-stock-photos.js.map +1 -1
- package/src/lib/jobs/ai-site-import-compile.js +110 -23
- package/src/lib/jobs/ai-site-import-compile.js.map +1 -1
- package/src/lib/jobs/ai-site-import-document.d.ts +5 -0
- package/src/lib/jobs/ai-site-import-document.js.map +1 -1
- package/src/lib/jobs/ai-site-import-forms.d.ts +83 -0
- package/src/lib/jobs/ai-site-import-forms.js +376 -0
- package/src/lib/jobs/ai-site-import-forms.js.map +1 -0
- package/src/lib/jobs/fixtures/ai-stock-photo-agl4092-1101-recordings.d.ts +21 -0
- package/src/lib/jobs/fixtures/ai-stock-photo-agl4092-1101-recordings.js +77 -0
- package/src/lib/jobs/fixtures/ai-stock-photo-agl4092-1101-recordings.js.map +1 -0
- package/src/lib/layout-language/ai-layout-compiler.d.ts +2 -0
- package/src/lib/layout-language/ai-layout-compiler.js +215 -30
- package/src/lib/layout-language/ai-layout-compiler.js.map +1 -1
- package/src/lib/layout-language/ai-layout-language.d.ts +12 -0
- package/src/lib/layout-language/ai-layout-language.js.map +1 -1
- package/src/lib/model/ai-credit-estimate.d.ts +25 -22
- package/src/lib/model/ai-credit-estimate.js +24 -22
- package/src/lib/model/ai-credit-estimate.js.map +1 -1
- package/src/lib/model/ai-insight.d.ts +4 -0
- package/src/lib/model/ai-insight.js +1 -0
- package/src/lib/model/ai-insight.js.map +1 -1
- package/src/lib/model/ai-site-build-progress.d.ts +8 -0
- package/src/lib/model/ai-site-build-progress.js +62 -1
- package/src/lib/model/ai-site-build-progress.js.map +1 -1
- package/src/lib/model/ai-site-import-fidelity.d.ts +2 -0
- package/src/lib/model/ai-site-import-fidelity.js +41 -5
- package/src/lib/model/ai-site-import-fidelity.js.map +1 -1
- package/src/lib/model/ai-site-import-report.d.ts +60 -0
- package/src/lib/model/ai-site-import-report.js +116 -0
- package/src/lib/model/ai-site-import-report.js.map +1 -0
- package/src/lib/model/ai-site-import-view.d.ts +7 -1
- package/src/lib/model/ai-site-import-view.js +14 -2
- package/src/lib/model/ai-site-import-view.js.map +1 -1
- package/src/lib/model/ai-site-import.d.ts +49 -2
- package/src/lib/model/ai-site-import.js +81 -23
- package/src/lib/model/ai-site-import.js.map +1 -1
- package/src/lib/plugin.js +1 -1
- package/src/lib/plugin.js.map +1 -1
- package/src/lib/runtime/ai-insight-check.js +22 -6
- package/src/lib/runtime/ai-insight-check.js.map +1 -1
- package/src/lib/server/ai-insight-digest-route.js +3 -1
- package/src/lib/server/ai-insight-digest-route.js.map +1 -1
- package/src/lib/site-import/fixtures/site-layout-recordings.d.ts +4 -0
- package/src/lib/site-import/fixtures/site-layout-recordings.js +9 -4
- package/src/lib/site-import/fixtures/site-layout-recordings.js.map +1 -1
- package/src/lib/site-import/site-import-css.d.ts +10 -1
- package/src/lib/site-import/site-import-css.js +19 -12
- package/src/lib/site-import/site-import-css.js.map +1 -1
- package/src/lib/site-import/site-import-html.d.ts +17 -4
- package/src/lib/site-import/site-import-html.js +146 -17
- package/src/lib/site-import/site-import-html.js.map +1 -1
- package/src/lib/site-import/site-import-layout.js +194 -32
- package/src/lib/site-import/site-import-layout.js.map +1 -1
- package/src/lib/tools/ai-insight-tool.js +11 -3
- package/src/lib/tools/ai-insight-tool.js.map +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../../../../libs/plugins/ai/src/lib/jobs/fixtures/ai-stock-photo-agl4092-1101-recordings.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2026 Aglyn LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type { StockPhoto } from '@aglyn/aglyn/plugin-manager/stock-photo-provider'\n\n/**\n * WHAT PIXABAY ANSWERED THE RIDERS PAGE'S TWO SEARCHES ON 2026-11-01 (AGL-4092).\n *\n * The live check that day started an amateur motocross team afresh, and its\n * riders page showed a kitesurfer in the section about joining the team (photo\n * 7288297, search \"joining young rider\"). Its media library records only the\n * search that found the photo, so the two searches its slot sends before its\n * broad ones were asked of Pixabay, read-only, as the provider asks them. Every\n * other search of the replay is {@link AGL4092_1029_ANSWERS}'s.\n *\n * Each list is the first 20 hits of its answer, in its order. A hit's tags are\n * the provider's, less one that names a person and one the marketplace's naming\n * sweep refuses, neither of them read; its size is its large copy's. Each\n * contributor is a number, one per contributor; no name, no contact details.\n * Keyed as `aiAgl40921029AnswerKey` keys them.\n */\n\nconst hit = (id: number, width: number, height: number, slug: string, contributor: number, tags: string): StockPhoto =>\n ({\n provider: 'pixabay',\n id: String(id),\n width,\n height,\n pageUrl: `https://pixabay.com/photos/${slug}-${id}/`,\n photographer: `Pixabay contributor ${contributor}`,\n tags: tags.split(', ').filter(Boolean),\n downloadUrl: `https://pixabay.com/get/g${id}_1280.jpg`,\n }) as StockPhoto\n\n/** Every recorded hit, by id. */\nexport const AGL4092_1101_HITS: ReadonlyMap<string, StockPhoto> = new Map(\n [\n hit(20333, 1280, 853, 'hands-puzzle-pieces-connect', 1, 'hands, puzzle pieces, connect, connection, cooperation, holding, isolated, jigsaw, join, partnership, people, pieces, puzzle, teamwork, two, unity, monochrome, idea, concept, black and white, hands, hands, connect, connect, connection, connection, connection, cooperation, cooperation, partnership, partnership, partnership, people, people, people, people, puzzle, puzzle, puzzle, puzzle, puzzle, teamwork, teamwork, teamwork, teamwork, two, idea, idea, idea'),\n hit(3372907, 1280, 720, 'reiter-horse-water-sunset-dawn', 2, 'reiter, nature, horse, water, sunset, dawn, sky, sun, waters, mirroring, reflection, silhouette, lake, pond, bank, equestrian, ride, freedom, indians, horse wallpaper'),\n hit(407123, 1280, 853, 'biker-motorcycle-ride-vehicle', 3, 'biker, motorcycle, ride, vehicle, motorbike, road, travel, asphalt, vintage, motorcycle ride, motorcycle rider, riding, motorcycle, motorcycle, motorcycle, motorcycle, motorcycle, motorbike'),\n hit(9331340, 1280, 853, 'horse-pony-woman-nature-animal', 4, 'horse, pony, woman, nature, animal'),\n hit(9702440, 1280, 1280, 'cartoon-hands-joining-hands', 5, 'cartoon hands, joining hands, unity circle, teamwork symbol, friendship hands, hands together, support icon, diversity hands, connected hands, group unity, circle of hands, togetherness vector, cooperation symbol, helping hands, solidarity icon, team support, round hands shape, cartoon unity, collective support, friendly gesture, partnership icon'),\n hit(8209523, 1280, 854, 'horse-rider-rodeo-cowboy-show', 6, 'horse, rider, rodeo, cowboy, nature, show, agriculture, animal, livestock'),\n hit(3237649, 1280, 856, 'teamwork-match-together', 7, 'teamwork, match, together, hand in hand, connect, connection, collaboration, hands, keep, join, partnership, people, piece, puzzle, solution, team, two, unit, characters, wood, doll, articulated manikin, match, connect, connect, connect, connect, connect, collaboration, collaboration, collaboration, collaboration, join, partnership, partnership, partnership, puzzle, puzzle, solution'),\n hit(7469078, 1280, 853, 'girl-horse-happy-rider-joy-fun', 6, 'girl, horse, happy, rider, joy, fun, smile, young, nature, saddle, riding'),\n hit(7288297, 1280, 853, 'kitesurfer-young-rider-kitesurfing', 8, 'kitesurfer, young, rider, nature, kitesurfing, sea, grandparents, watching, water, line, beach'),\n hit(7200409, 1280, 854, 'cow-grassland-grazing-nomad', 9, 'cow, grassland, grazing, nomad, dornod plain, asahi, mongolia, landscape, cow, cow, cow, cow, cow, mongolia, mongolia'),\n hit(10135205, 1280, 912, 'motorcycle-motocross-race-speed', 10, 'motorcycle, motocross, race, speed, sand, adrenaline, smart, glowing, extreme sport, stunt, rappelling, helmet, armor, terrain, thrill, camera, control, tag, entertainment, gear'),\n hit(557261, 1280, 853, 'horse-silhouettes-horse-back-riding', 11, 'horse, silhouettes, horse back riding, sunset, backlighting, bow, nature, saddle'),\n hit(95032, 1280, 853, 'mountain-biking-sports-leaping', 12, 'mountain biking, sports, leaping, jumping, freeriding, biking, bike, bicycle, mountain bicycle, nature, leap, jump, desert, utah'),\n hit(5221914, 1280, 768, 'skateboard-feet-shoes-guy-skating', 13, 'skateboard, feet, shoes, guy, skating, active, wheels, outdoors, movement, speed, fun, recreation, race, sport, exercise, street, freedom, skateboard, skateboard, skateboard, shoes, shoes, shoes, shoes, shoes, skating, exercise, exercise'),\n hit(1869727, 1280, 853, 'skateboard-skater-boy-skater', 14, 'skateboard, skater boy, skater, teenager, activity, recreational, asphalt, dawn, outdoors, street, sunset, sports, nature, fun'),\n hit(10388622, 1280, 853, 'motocross-motorcycle-road-riding', 15, 'motocross, motorcycle, road, riding, adventure, travel, nature, desert, sand, dawn, sunset, sand dunes, dusty, desert ride, speed, landscape photography, enduro, off-road, feeling, outdoor'),\n hit(3066167, 1280, 719, 'snow-mountain-fat-bikes-winter', 16, 'snow, nature, mountain, fat bikes, winter, mountain bikes, mtb, biking, bicycles, adventure, cold, sports, action, outdoors, bike, cycling'),\n hit(8022334, 1280, 853, 'scooter-motorcycle-city-paris', 17, 'scooter, motorcycle, city, paris, france, away, urban, landscape, yego, paris, paris, paris, paris, paris'),\n hit(1139142, 1280, 853, 'horse-horse-head-horseback-riding', 18, 'horse, horse head, horseback riding, animal, close up, nature, riding, equine, equestrian, saddle, horse saddle, bridle'),\n hit(394205, 1280, 853, 'horses-horse-tradition-rider', 19, 'horses, nature, horse, tradition, rider, hungarian, animals, gallop, speed, horse race'),\n hit(5360648, 1280, 853, 'to-go-biking-cycle-heaven', 20, 'to go biking, windows wallpaper, cycle, heaven, cloudburst, hd wallpaper, girl, bicycle, wallpaper 4k, free wallpaper, nature, silhouette, cool backgrounds, dramatic, background, screensaver, rain, 4k wallpaper 1920x1080, clouds, rain clouds, 4k wallpaper, sunlight, pretty, pleasure, unicycle, desktop backgrounds, free background, balance, beautiful wallpaper, homeland, laptop wallpaper, bad weather, wallpaper hd, mac wallpaper, full hd wallpaper, the atmosphere, air'),\n hit(8386051, 1280, 853, 'people-man-lonely-sad-alone', 21, 'people, man, lonely, sad, alone, uninhibited, under, graffiti, motorbike, sad, sad, sad, sad, sad'),\n hit(6281973, 1280, 853, 'road-city-motorcycle-morning', 22, 'road, city, motorcycle, morning, sunlight, motorbike, vehicle, pavement, street, highway, urban, road, road, road, motorcycle, motorcycle, motorcycle, motorcycle, motorcycle, motorbike, street, highway, highway, highway, highway'),\n hit(930715, 1280, 914, 'superbike-motorsport-fast-speed', 23, 'superbike, motorsport, fast, speed, red, track, race, power, motorcycle, sport, bike, motorbike, helmet, rider, gray sports, gray bike, gray power, fast, motorcycle, motorcycle, sport, bike, bike, bike, bike, bike'),\n hit(5101069, 1280, 853, 'horse-mountains-lagoon-sea', 24, 'horse, mountains, lagoon, sea, reflections, silhouette, nature, landscape, animal, sky, outdoor, cape town, noordhoek, sunset, brown nature, brown sky, brown city, beach, brown animals, brown landscape, brown sunset, brown sea, brown mountain, brown horse, brown ocean, brown natural, horse, horse, horse, horse, horse'),\n ].map((photo) => [photo.id, photo]),\n)\n\nconst of = (...ids: number[]): StockPhoto[] => ids.map((id) => AGL4092_1101_HITS.get(String(id)) as StockPhoto)\n\n/** What each search answered on 2026-11-01. */\nexport const AGL4092_1101_ANSWERS: Readonly<Record<string, readonly StockPhoto[]>> = {\n /** horizontal, 900 wide; first 20 of 40 */\n 'joining young rider|horizontal|900|': of(20333, 3372907, 407123, 9331340, 9702440, 8209523, 3237649, 7469078, 7288297, 7200409, 10135205, 557261, 95032, 5221914, 1869727, 10388622, 3066167, 8022334, 1139142, 394205),\n /** horizontal, 900 wide; first 20 of 40 */\n 'rider|horizontal|900|': of(3372907, 407123, 9331340, 8209523, 7200409, 10135205, 10388622, 557261, 5221914, 95032, 8022334, 1869727, 3066167, 1139142, 394205, 5360648, 8386051, 6281973, 930715, 5101069),\n}\n"],"names":["hit","id","width","height","slug","contributor","tags","provider","String","pageUrl","photographer","split","filter","Boolean","downloadUrl","AGL4092_1101_HITS","Map","map","photo","of","ids","get","AGL4092_1101_ANSWERS"],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC,GAID;;;;;;;;;;;;;;;CAeC,GAED,MAAMA,MAAM,CAACC,IAAYC,OAAeC,QAAgBC,MAAcC,aAAqBC,OACxF,CAAA;QACCC,UAAU;QACVN,IAAIO,OAAOP;QACXC;QACAC;QACAM,SAAS,CAAC,2BAA2B,EAAEL,KAAK,CAAC,EAAEH,GAAG,CAAC,CAAC;QACpDS,cAAc,CAAC,oBAAoB,EAAEL,aAAa;QAClDC,MAAMA,KAAKK,KAAK,CAAC,MAAMC,MAAM,CAACC;QAC9BC,aAAa,CAAC,yBAAyB,EAAEb,GAAG,SAAS,CAAC;IACxD,CAAA;AAEF,+BAA+B,GAC/B,OAAO,MAAMc,oBAAqD,IAAIC,IACpE;IACEhB,IAAI,OAAO,MAAM,KAAK,+BAA+B,GAAG;IACxDA,IAAI,SAAS,MAAM,KAAK,kCAAkC,GAAG;IAC7DA,IAAI,QAAQ,MAAM,KAAK,iCAAiC,GAAG;IAC3DA,IAAI,SAAS,MAAM,KAAK,kCAAkC,GAAG;IAC7DA,IAAI,SAAS,MAAM,MAAM,+BAA+B,GAAG;IAC3DA,IAAI,SAAS,MAAM,KAAK,iCAAiC,GAAG;IAC5DA,IAAI,SAAS,MAAM,KAAK,2BAA2B,GAAG;IACtDA,IAAI,SAAS,MAAM,KAAK,kCAAkC,GAAG;IAC7DA,IAAI,SAAS,MAAM,KAAK,sCAAsC,GAAG;IACjEA,IAAI,SAAS,MAAM,KAAK,+BAA+B,GAAG;IAC1DA,IAAI,UAAU,MAAM,KAAK,mCAAmC,IAAI;IAChEA,IAAI,QAAQ,MAAM,KAAK,uCAAuC,IAAI;IAClEA,IAAI,OAAO,MAAM,KAAK,kCAAkC,IAAI;IAC5DA,IAAI,SAAS,MAAM,KAAK,qCAAqC,IAAI;IACjEA,IAAI,SAAS,MAAM,KAAK,gCAAgC,IAAI;IAC5DA,IAAI,UAAU,MAAM,KAAK,oCAAoC,IAAI;IACjEA,IAAI,SAAS,MAAM,KAAK,kCAAkC,IAAI;IAC9DA,IAAI,SAAS,MAAM,KAAK,iCAAiC,IAAI;IAC7DA,IAAI,SAAS,MAAM,KAAK,qCAAqC,IAAI;IACjEA,IAAI,QAAQ,MAAM,KAAK,gCAAgC,IAAI;IAC3DA,IAAI,SAAS,MAAM,KAAK,6BAA6B,IAAI;IACzDA,IAAI,SAAS,MAAM,KAAK,+BAA+B,IAAI;IAC3DA,IAAI,SAAS,MAAM,KAAK,gCAAgC,IAAI;IAC5DA,IAAI,QAAQ,MAAM,KAAK,mCAAmC,IAAI;IAC9DA,IAAI,SAAS,MAAM,KAAK,8BAA8B,IAAI;CAC3D,CAACiB,GAAG,CAAC,CAACC,QAAU;QAACA,MAAMjB,EAAE;QAAEiB;KAAM,GACnC;AAED,MAAMC,KAAK,CAAC,GAAGC,MAAgCA,IAAIH,GAAG,CAAC,CAAChB,KAAOc,kBAAkBM,GAAG,CAACb,OAAOP;AAE5F,6CAA6C,GAC7C,OAAO,MAAMqB,uBAAwE;IACnF,yCAAyC,GACzC,uCAAuCH,GAAG,OAAO,SAAS,QAAQ,SAAS,SAAS,SAAS,SAAS,SAAS,SAAS,SAAS,UAAU,QAAQ,OAAO,SAAS,SAAS,UAAU,SAAS,SAAS,SAAS;IACjN,yCAAyC,GACzC,yBAAyBA,GAAG,SAAS,QAAQ,SAAS,SAAS,SAAS,UAAU,UAAU,QAAQ,SAAS,OAAO,SAAS,SAAS,SAAS,SAAS,QAAQ,SAAS,SAAS,SAAS,QAAQ;AACrM,EAAC"}
|
|
@@ -144,6 +144,8 @@ export interface PageScope {
|
|
|
144
144
|
pageIcon: AiIconLibraryEntry;
|
|
145
145
|
/** The forms this page already places, each once. */
|
|
146
146
|
formsPlaced: Set<string>;
|
|
147
|
+
/** The tags this page has drawn. */
|
|
148
|
+
pills?: number;
|
|
147
149
|
/** Each section's repeated items, by the id of the element that draws each (AGL-3660). */
|
|
148
150
|
itemIds: string[][];
|
|
149
151
|
/** The site's design and the choices its seed made, where the page is drawn with one. */
|
|
@@ -390,12 +390,15 @@ function drawSection(page, raw, index, scope) {
|
|
|
390
390
|
...head,
|
|
391
391
|
...tail
|
|
392
392
|
].some((block)=>isWideGroup(block));
|
|
393
|
+
// A page brought in is as wide as its source runs (AGL-4083), the Container's own Max Width.
|
|
394
|
+
const maxWidth = verbatim && raw.width ? raw.width : wide ? 'lg' : 'md';
|
|
395
|
+
const roomy = maxWidth === 'lg' || maxWidth === 'xl';
|
|
393
396
|
const parts = [];
|
|
394
397
|
const headId = compileFlow(scope, head, 'full');
|
|
395
|
-
if (headId) parts.push(centered(scope, headId,
|
|
398
|
+
if (headId) parts.push(centered(scope, headId, roomy));
|
|
396
399
|
if (filled.length) parts.push(compileRow(scope, filled));
|
|
397
400
|
const tailId = compileFlow(scope, tail, 'full');
|
|
398
|
-
if (tailId) parts.push(centered(scope, tailId,
|
|
401
|
+
if (tailId) parts.push(centered(scope, tailId, roomy));
|
|
399
402
|
// A frame whose content came to nothing is taken out, leaves first.
|
|
400
403
|
for(let at = parts.length - 1; at >= 0; at -= 1){
|
|
401
404
|
var _part_nodes;
|
|
@@ -429,7 +432,7 @@ function drawSection(page, raw, index, scope) {
|
|
|
429
432
|
useFlexGap: true
|
|
430
433
|
}, null, parts, 'content');
|
|
431
434
|
const container = tree.add('muiContainer', {
|
|
432
|
-
maxWidth
|
|
435
|
+
maxWidth
|
|
433
436
|
}, {
|
|
434
437
|
py: index === 0 ? _extends({}, HERO_PADDING) : _extends({}, SECTION_PADDING)
|
|
435
438
|
}, [
|
|
@@ -1678,7 +1681,7 @@ function instances(scope, placed, items, perRow) {
|
|
|
1678
1681
|
var _scope_page_plan_sections_scope_index;
|
|
1679
1682
|
return aiLayoutFitText(words, 'alt', scope.page.options.language) || aiLayoutFitText(scope.heading, 'alt', scope.page.options.language) || aiLayoutFitText((_scope_page_plan_sections_scope_index = scope.page.plan.sections[scope.index]) == null ? void 0 : _scope_page_plan_sections_scope_index.name, 'alt', scope.page.options.language) || aiLayoutFitText(scope.page.plan.title, 'alt', scope.page.options.language) || 'A photo';
|
|
1680
1683
|
}
|
|
1681
|
-
/** A grid row of sized cells, as `compileRow` writes one, from ids already compiled. */ function designRow(scope, cells, spacing, alignItems = 'center') {
|
|
1684
|
+
/** A grid row of sized cells, as `compileRow` writes one, from ids already compiled. */ function designRow(scope, cells, spacing, alignItems = 'center', role = 'row') {
|
|
1682
1685
|
const tree = scope.page.tree;
|
|
1683
1686
|
return tree.add('muiGrid', {
|
|
1684
1687
|
container: true,
|
|
@@ -1692,7 +1695,7 @@ function instances(scope, placed, items, perRow) {
|
|
|
1692
1695
|
}, (_cell_sx = cell.sx) != null ? _cell_sx : null, [
|
|
1693
1696
|
cell.id
|
|
1694
1697
|
], 'column');
|
|
1695
|
-
}),
|
|
1698
|
+
}), role);
|
|
1696
1699
|
}
|
|
1697
1700
|
/** A section's own arrangement where the design has one; `null` to draw it the compiler's first way. */ function designSection(scope, raw, blocks) {
|
|
1698
1701
|
var _scope_words, _ref, _ref1;
|
|
@@ -2178,6 +2181,8 @@ function instances(scope, placed, items, perRow) {
|
|
|
2178
2181
|
* so the words read whatever the photo is.
|
|
2179
2182
|
*/ function panelHero(scope, flow, picture, home) {
|
|
2180
2183
|
const tree = scope.page.tree;
|
|
2184
|
+
// A page brought in keeps its source's dark ground (AGL-4083): the card takes the dark scheme's paper and words.
|
|
2185
|
+
const dark = scope.page.options.verbatim === true && scope.band === 'dark';
|
|
2181
2186
|
// The words sit on the card, never on the band the model chose.
|
|
2182
2187
|
scope.band = 'plain';
|
|
2183
2188
|
scope.centered = false;
|
|
@@ -2236,7 +2241,7 @@ function instances(scope, placed, items, perRow) {
|
|
|
2236
2241
|
xs: '48vh',
|
|
2237
2242
|
md: '56vh'
|
|
2238
2243
|
}
|
|
2239
|
-
},
|
|
2244
|
+
}, dark);
|
|
2240
2245
|
}
|
|
2241
2246
|
/**
|
|
2242
2247
|
* A portrait hero (AGL-3985): a person's own page opens on their round
|
|
@@ -3606,6 +3611,16 @@ function listingSection(scope, blocks, placed) {
|
|
|
3606
3611
|
var _block_items;
|
|
3607
3612
|
const items = ((_block_items = block.items) != null ? _block_items : []).filter(itemShows);
|
|
3608
3613
|
if (!items.length) return null;
|
|
3614
|
+
if (block.inline) {
|
|
3615
|
+
const named = items.some((item)=>{
|
|
3616
|
+
var _item_links, _item_list;
|
|
3617
|
+
return item.figure || item.badge || ((_item_links = item.links) == null ? void 0 : _item_links.length) || ((_item_list = item.list) == null ? void 0 : _item_list.length);
|
|
3618
|
+
});
|
|
3619
|
+
return scope.page.tree.add('muiStack', {
|
|
3620
|
+
spacing: named ? '2.5' : '1.25',
|
|
3621
|
+
divider: 'line'
|
|
3622
|
+
}, null, noted(scope, items.map((item)=>importedRow(scope, item))), 'rows');
|
|
3623
|
+
}
|
|
3609
3624
|
const perRow = importedAcross(block, items.length, room);
|
|
3610
3625
|
const ids = items.map((item)=>importedItem(scope, block, item));
|
|
3611
3626
|
return layOut(scope, noted(scope, ids), perRow, block.kind === 'stats' ? '4' : '3', block.kind === 'cards' ? 'cards' : block.kind);
|
|
@@ -3615,8 +3630,183 @@ function listingSection(scope, blocks, placed) {
|
|
|
3615
3630
|
if (block.kind === 'stats') return 'open';
|
|
3616
3631
|
return block.style === 'quiet' ? 'open' : 'cards';
|
|
3617
3632
|
}
|
|
3633
|
+
/** The most tags a page rounds to a pill: the fourth like style is a repeat (rule 16), and it takes the theme's corners instead. */ const AI_LAYOUT_MAX_PILLS = 3;
|
|
3634
|
+
/** An item's title with the tag the source sets on it, the two at either end of one line. */ function titled(scope, title, item) {
|
|
3635
|
+
var _scope_page_pills;
|
|
3636
|
+
const tree = scope.page.tree;
|
|
3637
|
+
const words = aiLayoutAsWritten(item.badge);
|
|
3638
|
+
if (!words) return title;
|
|
3639
|
+
scope.page.pills = ((_scope_page_pills = scope.page.pills) != null ? _scope_page_pills : 0) + 1;
|
|
3640
|
+
const badge = tree.add('muiPaper', {
|
|
3641
|
+
variant: 'elevation',
|
|
3642
|
+
elevation: '0'
|
|
3643
|
+
}, scope.page.pills <= AI_LAYOUT_MAX_PILLS ? {
|
|
3644
|
+
bgcolor: 'primary.main',
|
|
3645
|
+
borderRadius: 999
|
|
3646
|
+
} : {
|
|
3647
|
+
bgcolor: 'primary.main'
|
|
3648
|
+
}, [
|
|
3649
|
+
tree.add('muiBox', null, {
|
|
3650
|
+
color: 'primary.contrastText'
|
|
3651
|
+
}, [
|
|
3652
|
+
tree.add('muiTypography', {
|
|
3653
|
+
children: words,
|
|
3654
|
+
variant: 'overline'
|
|
3655
|
+
}, {
|
|
3656
|
+
px: 1.25
|
|
3657
|
+
}, null, 'badge')
|
|
3658
|
+
], 'badgeWords')
|
|
3659
|
+
], 'tag');
|
|
3660
|
+
return title ? tree.add('muiStack', {
|
|
3661
|
+
direction: 'row',
|
|
3662
|
+
spacing: '1',
|
|
3663
|
+
justifyContent: 'space-between',
|
|
3664
|
+
alignItems: 'center'
|
|
3665
|
+
}, null, [
|
|
3666
|
+
title,
|
|
3667
|
+
badge
|
|
3668
|
+
], 'titleRow') : badge;
|
|
3669
|
+
}
|
|
3670
|
+
/** An item's figure, and what it is for beside it: a plan's "$39" and "/mo". */ function figured(scope, item, role) {
|
|
3671
|
+
const tree = scope.page.tree;
|
|
3672
|
+
const figure = aiLayoutAsWritten(item.figure);
|
|
3673
|
+
if (!figure) return null;
|
|
3674
|
+
const number = tree.add('muiTypography', _extends({
|
|
3675
|
+
children: figure,
|
|
3676
|
+
variant: 'h3',
|
|
3677
|
+
component: 'p'
|
|
3678
|
+
}, align(scope)), accent(scope), null, role);
|
|
3679
|
+
const period = aiLayoutAsWritten(item.period);
|
|
3680
|
+
if (!period) return number;
|
|
3681
|
+
return tree.add('muiStack', _extends({
|
|
3682
|
+
direction: 'row',
|
|
3683
|
+
spacing: '1',
|
|
3684
|
+
alignItems: 'baseline'
|
|
3685
|
+
}, scope.centered ? {
|
|
3686
|
+
justifyContent: 'center'
|
|
3687
|
+
} : {}), null, [
|
|
3688
|
+
number,
|
|
3689
|
+
tree.add('muiTypography', {
|
|
3690
|
+
children: period,
|
|
3691
|
+
variant: 'body2'
|
|
3692
|
+
}, muted(scope), null, 'period')
|
|
3693
|
+
], 'price');
|
|
3694
|
+
}
|
|
3695
|
+
/** An item the source made one link as a whole is one here (AGL-4107): its words keep their places, and pressing anywhere on it goes where it went. */ function wholeLink(scope, item, title, drawn) {
|
|
3696
|
+
var _item_links;
|
|
3697
|
+
const whole = !((_item_links = item.links) == null ? void 0 : _item_links.length) && item.to ? aiLayoutImportedDestination(item.to, scope.page.plan.sections.length) : null;
|
|
3698
|
+
if (!whole || whole.kind === 'section') return drawn;
|
|
3699
|
+
return scope.page.tree.add('muiLinkBox', _extends({}, destinationProps(whole), title ? {
|
|
3700
|
+
ariaLabel: title.slice(0, 200)
|
|
3701
|
+
} : {}, whole.kind === 'href' ? {
|
|
3702
|
+
newTab: true
|
|
3703
|
+
} : {}), {
|
|
3704
|
+
height: '100%'
|
|
3705
|
+
}, [
|
|
3706
|
+
drawn
|
|
3707
|
+
], 'linked');
|
|
3708
|
+
}
|
|
3709
|
+
/**
|
|
3710
|
+
* A row of a group of a page brought in (AGL-4083): the source's own row, its
|
|
3711
|
+
* parts side by side, the group's Stack ruling one from the next. A label and
|
|
3712
|
+
* its value sit at either end of one line; a plan's name and price, its words
|
|
3713
|
+
* and its button are the three cells of a Grid, each its own line on a phone.
|
|
3714
|
+
*/ function importedRow(scope, item) {
|
|
3715
|
+
var _item_more;
|
|
3716
|
+
var _item_links, _item_list, _item_list1, _item_links1;
|
|
3717
|
+
const tree = scope.page.tree;
|
|
3718
|
+
const title = aiLayoutAsWritten(item.title);
|
|
3719
|
+
const name = (variant)=>title ? tree.add('muiTypography', {
|
|
3720
|
+
children: title,
|
|
3721
|
+
variant,
|
|
3722
|
+
component: item.label ? 'p' : itemElement(scope)
|
|
3723
|
+
}, null, null, 'title') : null;
|
|
3724
|
+
const said = [
|
|
3725
|
+
item.text,
|
|
3726
|
+
...(_item_more = item.more) != null ? _item_more : []
|
|
3727
|
+
].map((line)=>aiLayoutAsWritten(line)).filter(Boolean);
|
|
3728
|
+
const icon = sourceIcon(scope, item, '20', accent(scope));
|
|
3729
|
+
const picture = item.picture ? itemPicture(scope, item.picture) : null;
|
|
3730
|
+
if (!item.figure && !item.badge && !((_item_links = item.links) == null ? void 0 : _item_links.length) && !((_item_list = item.list) == null ? void 0 : _item_list.length)) {
|
|
3731
|
+
const label = icon ? tree.add('muiStack', {
|
|
3732
|
+
direction: 'row',
|
|
3733
|
+
spacing: '1',
|
|
3734
|
+
alignItems: 'center'
|
|
3735
|
+
}, null, [
|
|
3736
|
+
icon,
|
|
3737
|
+
name('body1')
|
|
3738
|
+
], 'label') : name('body1');
|
|
3739
|
+
const values = said.map((line)=>tree.add('muiTypography', {
|
|
3740
|
+
children: line,
|
|
3741
|
+
variant: 'body1',
|
|
3742
|
+
align: 'right'
|
|
3743
|
+
}, muted(scope), null, 'value'));
|
|
3744
|
+
const value = values.length > 1 ? tree.add('muiStack', {
|
|
3745
|
+
spacing: '0.5'
|
|
3746
|
+
}, null, values, 'values') : values[0];
|
|
3747
|
+
return wholeLink(scope, item, title, tree.add('muiStack', {
|
|
3748
|
+
direction: 'row',
|
|
3749
|
+
spacing: '3',
|
|
3750
|
+
justifyContent: 'space-between',
|
|
3751
|
+
alignItems: 'center'
|
|
3752
|
+
}, null, [
|
|
3753
|
+
picture,
|
|
3754
|
+
label,
|
|
3755
|
+
value
|
|
3756
|
+
], 'ruledRow'));
|
|
3757
|
+
}
|
|
3758
|
+
const named = [
|
|
3759
|
+
picture,
|
|
3760
|
+
icon,
|
|
3761
|
+
titled(scope, name('h6'), item),
|
|
3762
|
+
figured(_extends({}, scope, {
|
|
3763
|
+
centered: false
|
|
3764
|
+
}), item, 'figure')
|
|
3765
|
+
].filter((id)=>!!id);
|
|
3766
|
+
const words = [
|
|
3767
|
+
...said.map((line, at)=>tree.add('muiTypography', {
|
|
3768
|
+
children: line,
|
|
3769
|
+
variant: at === 0 ? 'body1' : 'body2'
|
|
3770
|
+
}, muted(scope), null, 'text')),
|
|
3771
|
+
...((_item_list1 = item.list) == null ? void 0 : _item_list1.length) ? [
|
|
3772
|
+
bullets(scope, item.list, item.listIconPath)
|
|
3773
|
+
] : []
|
|
3774
|
+
].filter((id)=>!!id);
|
|
3775
|
+
const links = ((_item_links1 = item.links) == null ? void 0 : _item_links1.length) ? itemLinks(scope, item.links) : null;
|
|
3776
|
+
const cell = (ids, role)=>ids.length === 1 ? ids[0] : tree.add('muiStack', {
|
|
3777
|
+
spacing: '1'
|
|
3778
|
+
}, null, ids, role);
|
|
3779
|
+
const row = designRow(scope, [
|
|
3780
|
+
{
|
|
3781
|
+
id: cell(named, 'rowName'),
|
|
3782
|
+
size: words.length ? 'xs:12 md:3' : links ? 'xs:12 md:9' : 'xs:12'
|
|
3783
|
+
},
|
|
3784
|
+
...words.length ? [
|
|
3785
|
+
{
|
|
3786
|
+
id: cell(words, 'rowWords'),
|
|
3787
|
+
size: links ? 'xs:12 md:6' : 'xs:12 md:9'
|
|
3788
|
+
}
|
|
3789
|
+
] : [],
|
|
3790
|
+
...links ? [
|
|
3791
|
+
{
|
|
3792
|
+
id: tree.add('muiStack', {
|
|
3793
|
+
direction: 'row'
|
|
3794
|
+
}, {
|
|
3795
|
+
justifyContent: {
|
|
3796
|
+
xs: 'flex-start',
|
|
3797
|
+
md: 'flex-end'
|
|
3798
|
+
}
|
|
3799
|
+
}, [
|
|
3800
|
+
links
|
|
3801
|
+
], 'rowActions'),
|
|
3802
|
+
size: 'xs:12 md:3'
|
|
3803
|
+
}
|
|
3804
|
+
] : []
|
|
3805
|
+
], '3', 'center', 'ruledRow');
|
|
3806
|
+
return wholeLink(scope, item, title, row);
|
|
3807
|
+
}
|
|
3618
3808
|
/** One item of a group of a page brought in, every part of it in the source's order. */ function importedItem(scope, block, item) {
|
|
3619
|
-
var _tree_nodes_shown_
|
|
3809
|
+
var _tree_nodes_shown_;
|
|
3620
3810
|
const tree = scope.page.tree;
|
|
3621
3811
|
const style = itemStyle(block);
|
|
3622
3812
|
const kind = block.kind;
|
|
@@ -3660,25 +3850,21 @@ function listingSection(scope, blocks, placed) {
|
|
|
3660
3850
|
], 'body2', muted(scope), 'label'));
|
|
3661
3851
|
} else {
|
|
3662
3852
|
var _item_more2;
|
|
3663
|
-
var _item_list,
|
|
3853
|
+
var _item_list, _item_links;
|
|
3664
3854
|
if (item.picture) parts.push(itemPicture(scope, item.picture));
|
|
3665
3855
|
parts.push(sourceIcon(scope, item, '32', style === 'cards' ? {
|
|
3666
3856
|
color: 'primary.main'
|
|
3667
3857
|
} : accent(scope)));
|
|
3668
|
-
const number =
|
|
3669
|
-
children: figure,
|
|
3670
|
-
variant: kind === 'steps' ? 'h3' : 'h4',
|
|
3671
|
-
component: 'p'
|
|
3672
|
-
}, align(scope)), accent(scope), null, kind === 'steps' ? 'number' : 'figure') : null;
|
|
3858
|
+
const number = figured(scope, item, kind === 'steps' ? 'number' : 'figure');
|
|
3673
3859
|
// A step's number leads it; a plan's price follows its name.
|
|
3674
|
-
if (kind === 'steps') parts.push(number, titleNode());
|
|
3675
|
-
else parts.push(titleNode(), number);
|
|
3860
|
+
if (kind === 'steps') parts.push(number, titled(scope, titleNode(), item));
|
|
3861
|
+
else parts.push(titled(scope, titleNode(), item), number);
|
|
3676
3862
|
parts.push(...paragraphs(scope, [
|
|
3677
3863
|
item.text,
|
|
3678
3864
|
...(_item_more2 = item.more) != null ? _item_more2 : []
|
|
3679
3865
|
], 'body1', muted(scope)));
|
|
3680
3866
|
if ((_item_list = item.list) == null ? void 0 : _item_list.length) parts.push(bullets(scope, item.list, item.listIconPath));
|
|
3681
|
-
if ((
|
|
3867
|
+
if ((_item_links = item.links) == null ? void 0 : _item_links.length) parts.push(itemLinks(scope, item.links));
|
|
3682
3868
|
}
|
|
3683
3869
|
const shown = parts.filter((id)=>!!id);
|
|
3684
3870
|
// The picture of a card is its top, edge to edge; the rest sit in its padding.
|
|
@@ -3716,19 +3902,7 @@ function listingSection(scope, blocks, placed) {
|
|
|
3716
3902
|
} else {
|
|
3717
3903
|
drawn = stack;
|
|
3718
3904
|
}
|
|
3719
|
-
|
|
3720
|
-
// words keep their places, and pressing anywhere on it goes where it went.
|
|
3721
|
-
const whole = !((_item_links = item.links) == null ? void 0 : _item_links.length) && item.to ? aiLayoutImportedDestination(item.to, scope.page.plan.sections.length) : null;
|
|
3722
|
-
if (!whole || whole.kind === 'section') return drawn;
|
|
3723
|
-
return tree.add('muiLinkBox', _extends({}, destinationProps(whole), title ? {
|
|
3724
|
-
ariaLabel: title.slice(0, 200)
|
|
3725
|
-
} : {}, whole.kind === 'href' ? {
|
|
3726
|
-
newTab: true
|
|
3727
|
-
} : {}), {
|
|
3728
|
-
height: '100%'
|
|
3729
|
-
}, [
|
|
3730
|
-
drawn
|
|
3731
|
-
], 'linked');
|
|
3905
|
+
return wholeLink(scope, item, title, drawn);
|
|
3732
3906
|
}
|
|
3733
3907
|
/** A list of a page brought in: each line as written, led by the source's mark where it drew one, a link where it was one. */ function importedList(scope, block, room) {
|
|
3734
3908
|
var _block_items, _block_columns;
|
|
@@ -4027,11 +4201,22 @@ function listingSection(scope, blocks, placed) {
|
|
|
4027
4201
|
style: 'large'
|
|
4028
4202
|
});
|
|
4029
4203
|
const picture = pictures[0].picture;
|
|
4030
|
-
|
|
4204
|
+
const opening = hero(scope, flow, {
|
|
4031
4205
|
alt: picture.alt,
|
|
4032
4206
|
given: true,
|
|
4033
4207
|
src: picture.src
|
|
4034
4208
|
}, raw.hero);
|
|
4209
|
+
return opening && raw.width ? widened(page.tree, opening, raw.width) : opening;
|
|
4210
|
+
}
|
|
4211
|
+
/** A hero of a page brought in, its columns as wide as its source runs (AGL-4083): each Container that sets the section's width, not a reading measure inside it. */ function widened(tree, id, maxWidth) {
|
|
4212
|
+
var _ref;
|
|
4213
|
+
var _node_props;
|
|
4214
|
+
const node = tree.nodes[id];
|
|
4215
|
+
if ((node == null ? void 0 : node.componentId) === 'muiContainer' && !((_node_props = node.props) == null ? void 0 : _node_props['disableGutters'])) node.props = _extends({}, node.props, {
|
|
4216
|
+
maxWidth
|
|
4217
|
+
});
|
|
4218
|
+
for (const child of (_ref = node == null ? void 0 : node.nodes) != null ? _ref : [])widened(tree, child, maxWidth);
|
|
4219
|
+
return id;
|
|
4035
4220
|
}
|
|
4036
4221
|
/** The id the compiled page's root is stored under. */ export const AI_LAYOUT_PAGE_ROOT_ID = CANVAS_ROOT_ELEMENT_ID;
|
|
4037
4222
|
|