@aglyn/plugins-ai 1.15.2 → 1.16.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.
Files changed (34) hide show
  1. package/package.json +17 -17
  2. package/src/lib/components/ai-site-import-plan.component.js +1 -1
  3. package/src/lib/components/ai-site-import-plan.component.js.map +1 -1
  4. package/src/lib/jobs/ai-job-import-step.js +6 -4
  5. package/src/lib/jobs/ai-job-import-step.js.map +1 -1
  6. package/src/lib/jobs/ai-job-page-language.d.ts +2 -0
  7. package/src/lib/jobs/ai-job-page-language.js +29 -14
  8. package/src/lib/jobs/ai-job-page-language.js.map +1 -1
  9. package/src/lib/jobs/ai-job-page-step.js +3 -1
  10. package/src/lib/jobs/ai-job-page-step.js.map +1 -1
  11. package/src/lib/jobs/ai-job-text-step.d.ts +1 -0
  12. package/src/lib/jobs/ai-job-text-step.js.map +1 -1
  13. package/src/lib/jobs/ai-site-import-compile.d.ts +9 -1
  14. package/src/lib/jobs/ai-site-import-compile.js +67 -1
  15. package/src/lib/jobs/ai-site-import-compile.js.map +1 -1
  16. package/src/lib/jobs/ai-site-import-honesty.d.ts +6 -2
  17. package/src/lib/jobs/ai-site-import-honesty.js +5 -5
  18. package/src/lib/jobs/ai-site-import-honesty.js.map +1 -1
  19. package/src/lib/jobs/ai-site-import-improve.d.ts +61 -2
  20. package/src/lib/jobs/ai-site-import-improve.js +184 -19
  21. package/src/lib/jobs/ai-site-import-improve.js.map +1 -1
  22. package/src/lib/layout-language/ai-layout-compiler.d.ts +6 -1
  23. package/src/lib/layout-language/ai-layout-compiler.js +27 -9
  24. package/src/lib/layout-language/ai-layout-compiler.js.map +1 -1
  25. package/src/lib/model/ai-site-import-fidelity.d.ts +18 -2
  26. package/src/lib/model/ai-site-import-fidelity.js +35 -11
  27. package/src/lib/model/ai-site-import-fidelity.js.map +1 -1
  28. package/src/lib/model/ai-site-import-view.js +6 -1
  29. package/src/lib/model/ai-site-import-view.js.map +1 -1
  30. package/src/lib/model/ai-site-import.d.ts +8 -1
  31. package/src/lib/model/ai-site-import.js +12 -4
  32. package/src/lib/model/ai-site-import.js.map +1 -1
  33. package/src/lib/runtime/ai-palette.generated.js +36 -5
  34. package/src/lib/runtime/ai-palette.generated.js.map +1 -1
@@ -783,7 +783,14 @@ function drawSection(page, raw, index, scope) {
783
783
  // ── A row of columns ──────────────────────────────────────────────────────
784
784
  // Spans out of twelve live with the tree, so a frame's repair reads them without the compiler (AGL-3735).
785
785
  export { aiLayoutSpans };
786
- export function compileRow(scope, columns, /** How the columns sit against each other: centered on a page, top-aligned in a footer (AGL-3735). */ alignItems = 'center') {
786
+ export function compileRow(scope, columns, /**
787
+ * How the columns sit against each other: top-aligned in a footer (AGL-3735);
788
+ * on a page, centered where words stand beside a picture, else top-aligned
789
+ * (AGL-4152): words centered beside a tall form or a long column sit under a
790
+ * gap as tall as the difference, which reads as a missing block.
791
+ */ alignItems) {
792
+ const pictured = columns.some((entry)=>entry.column.length > 0 && entry.column.every((block)=>block.kind === 'image' || block.kind === 'video'));
793
+ const aligned = alignItems != null ? alignItems : pictured ? 'center' : 'flex-start';
787
794
  const tree = scope.page.tree;
788
795
  const spans = aiLayoutSpans(columns.map((entry)=>entry.weight));
789
796
  const items = columns.map((entry, position)=>{
@@ -800,7 +807,7 @@ export function compileRow(scope, columns, /** How the columns sit against each
800
807
  container: true,
801
808
  spacing: columns.length >= 3 ? '4' : '6'
802
809
  }, {
803
- alignItems
810
+ alignItems: aligned
804
811
  }, items, 'row');
805
812
  }
806
813
  /** A column of blocks, top to bottom, with buttons side by side; `null` when nothing in it compiles. */ export function compileFlow(scope, blocks, room) {
@@ -1030,22 +1037,31 @@ function compileButton(scope, block) {
1030
1037
  variant: 'contained',
1031
1038
  color: onBrand ? 'secondary' : 'primary'
1032
1039
  };
1040
+ // A filled button of a page brought in is the site's one primary (AGL-4152): on a dark band or over a photo the
1041
+ // dark scheme's primary is a lighter shade made for words on it, so the button keeps the light scheme's, the one
1042
+ // its header's button and every other page's are drawn in. Its fill carries its own words.
1043
+ const oneFill = verbatim && look.variant === 'contained' && look.color === 'primary' && (scope.band === 'dark' || !!scope.overPhoto);
1044
+ // Sized to its words, never stretched across the column a Stack would
1045
+ // stretch it over (AGL-3660), and aligned with its section.
1046
+ const place = {
1047
+ alignSelf: scope.centered ? 'center' : 'flex-start'
1048
+ };
1033
1049
  const id = scope.page.tree.add('muiButton', _extends({
1034
1050
  children: label
1035
1051
  }, look, {
1036
1052
  size: scope.index === 0 || block.style === 'large' ? 'large' : 'medium'
1037
- }, destination ? destinationProps(destination) : {}), // Sized to its words, never stretched across the column a Stack would
1038
- // stretch it over (AGL-3660), and aligned with its section.
1039
- {
1040
- alignSelf: scope.centered ? 'center' : 'flex-start'
1041
- }, null, 'button');
1053
+ }, destination ? destinationProps(destination) : {}), oneFill ? null : place, null, 'button');
1042
1054
  if (destination) linkTo(scope, id, destination);
1043
1055
  if (film !== null) ((_plays = (_scope_page = scope.page).plays) != null ? _plays : _scope_page.plays = []).push({
1044
1056
  id,
1045
1057
  film,
1046
1058
  label
1047
1059
  });
1048
- return id;
1060
+ return oneFill ? scope.page.tree.add('muiBox', {
1061
+ colorScheme: 'light'
1062
+ }, place, [
1063
+ id
1064
+ ], 'buttonScheme') : id;
1049
1065
  }
1050
1066
  /** The film a button of a page brought in plays (AGL-4140), `video:<n>`, by its index; `null` for any other destination. */ export function aiLayoutImportedFilm(to) {
1051
1067
  const match = /^video:(\d{1,3})$/.exec((to != null ? to : '').trim());
@@ -1733,7 +1749,9 @@ function instances(scope, placed, items, perRow) {
1733
1749
  // carries a style: a page of many pictures repeats no inline style (rule 16).
1734
1750
  // A source's own picture keeps the fit the source gives it (AGL-4138); a film's poster is its Video
1735
1751
  // element, filling the frame as the picture would (AGL-4140).
1736
- const fit = scope.page.options.verbatim === true && picture.given ? (_picture_fit = picture.fit) == null ? void 0 : _picture_fit.objectFit : undefined;
1752
+ // Under words laid over it, a photo fills the band edge to edge whatever the source fits it as (AGL-4152): a photo
1753
+ // fitted whole leaves bars of the scrim at its sides, a boxed picture under a header drawn as if over a hero.
1754
+ const fit = scope.page.options.verbatim === true && picture.given && role !== 'coverPhoto' ? (_picture_fit = picture.fit) == null ? void 0 : _picture_fit.objectFit : undefined;
1737
1755
  const image = picture.video ? video(scope, picture.video, picture.src ? {
1738
1756
  src: picture.src,
1739
1757
  alt: picture.alt