@vectoriox/iox-ui 5.56.1 → 5.58.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 (36) hide show
  1. package/composite-core/index.d.ts +3 -3
  2. package/design-core/index.d.ts +40 -2
  3. package/fesm2022/vectoriox-iox-ui-composite-core.mjs +6 -10
  4. package/fesm2022/vectoriox-iox-ui-composite-core.mjs.map +1 -1
  5. package/fesm2022/vectoriox-iox-ui-design-core.mjs +46 -1
  6. package/fesm2022/vectoriox-iox-ui-design-core.mjs.map +1 -1
  7. package/fesm2022/vectoriox-iox-ui-generation-core.mjs +4231 -897
  8. package/fesm2022/vectoriox-iox-ui-generation-core.mjs.map +1 -1
  9. package/fesm2022/vectoriox-iox-ui-harness-core.mjs +24 -10
  10. package/fesm2022/vectoriox-iox-ui-harness-core.mjs.map +1 -1
  11. package/fesm2022/vectoriox-iox-ui.mjs +27 -1
  12. package/fesm2022/vectoriox-iox-ui.mjs.map +1 -1
  13. package/generation-core/index.d.ts +3774 -1101
  14. package/harness-core/index.d.ts +24 -9
  15. package/index.d.ts +22 -1
  16. package/package.json +1 -1
  17. package/src/composite-core/accordion-runtime.ts +2 -1
  18. package/src/composite-core/lightbox.ts +5 -6
  19. package/src/design-core/entrance-timing.ts +56 -0
  20. package/src/design-core/public-api.ts +1 -0
  21. package/src/generation-core/ai-run.ts +21 -0
  22. package/src/generation-core/audit-site.ts +32 -0
  23. package/src/generation-core/compose-site.ts +213 -42
  24. package/src/generation-core/entrances.ts +82 -13
  25. package/src/generation-core/patterns.ts +127 -15
  26. package/src/generation-core/public-api.ts +3 -2
  27. package/src/generation-core/showcase.ts +81 -0
  28. package/src/generation-core/site-plan-schema.ts +21 -8
  29. package/src/generation-core/site-plan.model.ts +75 -4
  30. package/src/generation-core/site-spec.generated.ts +4019 -1174
  31. package/src/generation-core/validate-site-plan.ts +129 -21
  32. package/src/harness-core/harness-spec.generated.ts +3 -3
  33. package/src/harness-core/public-api.ts +1 -0
  34. package/src/harness-core/reference-colour.ts +15 -3
  35. package/src/harness-core/site-audit-view.ts +10 -0
  36. package/src/harness-core/starting-design.ts +8 -4
@@ -1,4 +1,4 @@
1
- import { MOOD_IDS, MOOD_LABELS, STYLE_PRESETS, flavorPackById, parseFontFamilies, SPEC_AXES, parseHexColor, rgbToOklab, presetChoices, toHexColor, stylePresetById, auditDesignContrast, designTokenRows } from '@vectoriox/iox-ui/design-core';
1
+ import { MOOD_IDS, MOOD_LABELS, STYLE_PRESETS, flavorPackById, parseFontFamilies, SPEC_AXES, parseHexColor, rgbToOklab, presetChoices, toHexColor, stylePresetById, resolveTokenValues, designTokenRows, wcagContrastRatio, auditDesignContrast } from '@vectoriox/iox-ui/design-core';
2
2
  import { shapeKeys, requiredShapeKeys, PathIssueCollector, isPlainObject, pathAt, FACT_KEYS, jsonText, jsonOneOf, jsonListOf, jsonShapedObject, jsonClosedObject, describeShapeKey, SPEC_SITE_LIBRARY, patternById, SITE_FACT_LABELS, SITE_TEMPLATES, STUDIO_TEMPLATE, jsonInteger } from '@vectoriox/iox-ui/generation-core';
3
3
 
4
4
  // GENERATED from iox-ai-guidance flavor-spec.v1.json — do not edit; re-run scripts/gen-flavor-spec.mjs
@@ -138,7 +138,7 @@ const SPEC_STRUCTURES = {
138
138
  "About",
139
139
  "Contact"
140
140
  ],
141
- "shipped": false
141
+ "shipped": true
142
142
  },
143
143
  "place": {
144
144
  "label": "Place",
@@ -146,11 +146,11 @@ const SPEC_STRUCTURES = {
146
146
  "pages": [
147
147
  "Home",
148
148
  "Menu",
149
- "Visit (hours + map)",
149
+ "Visit (hours and address)",
150
150
  "About",
151
151
  "Contact"
152
152
  ],
153
- "shipped": false
153
+ "shipped": true
154
154
  }
155
155
  };
156
156
  const SPEC_BUSINESS_TYPES = [
@@ -4518,6 +4518,15 @@ function readPalette(samples) {
4518
4518
  return { palette, ground: paletteGround(palette), ...(brand ? { brand } : {}) };
4519
4519
  }
4520
4520
 
4521
+ /** The raw colour's ratio against the preset's own page ground, in its first mode — shown, never decisive. */
4522
+ function rawRatioOf(presetId, hex) {
4523
+ const preset = stylePresetById(presetId);
4524
+ const choices = preset ? presetChoices(preset.id, preset.modes[0]) : null;
4525
+ if (!preset || !choices)
4526
+ return null;
4527
+ const ground = resolveTokenValues(designTokenRows(choices), preset.modes[0])['page-bg'];
4528
+ return ground && parseHexColor(ground) ? Math.round(wcagContrastRatio(hex, ground) * 100) / 100 : null;
4529
+ }
4521
4530
  /** Every mode `presetId` offers passes the audit with `seed`. */
4522
4531
  function seedPassesPreset(presetId, seed) {
4523
4532
  const preset = stylePresetById(presetId);
@@ -4536,9 +4545,10 @@ function referenceSeed(read, presetId) {
4536
4545
  return null;
4537
4546
  const reference = read?.brand && parseHexColor(read.brand) ? read.brand : null;
4538
4547
  if (!reference)
4539
- return { seed: preset.seed, reference: null, used: false, failsIn: [] };
4548
+ return { seed: preset.seed, reference: null, used: false, failsIn: [], rawRatio: null };
4540
4549
  const { passes, failsIn } = seedPassesPreset(preset.id, reference);
4541
- return passes ? { seed: reference, reference, used: true, failsIn: [] } : { seed: preset.seed, reference, used: false, failsIn };
4550
+ const rawRatio = rawRatioOf(preset.id, reference);
4551
+ return passes ? { seed: reference, reference, used: true, failsIn: [], rawRatio } : { seed: preset.seed, reference, used: false, failsIn, rawRatio };
4542
4552
  }
4543
4553
 
4544
4554
  /**
@@ -4795,14 +4805,19 @@ const GENERATION_LIMITS = {
4795
4805
  * references — the best-ranked style with the reference colour as its seed when that colour passes AA in every mode
4796
4806
  * the style offers (`referenceSeed`). Pure.
4797
4807
  */
4798
- /** A preset for this business: its choices, Motion from the business (`motionFor`), what the owner already set kept. */
4808
+ /**
4809
+ * A preset for this business: its choices, Motion from the business (`motionFor`), the references' colour as its seed
4810
+ * when that colour passes AA in every mode the preset offers (`referenceSeed` — judged as used), and what the owner
4811
+ * already set kept. The ONE rule for a Look pick and for Build with these.
4812
+ */
4799
4813
  function presetDesign(presetId, input, kept = {}, read = null) {
4800
4814
  const base = presetChoices(presetId);
4801
4815
  if (!base)
4802
4816
  return null;
4803
4817
  const motionInput = typeof input === 'object' && input !== null ? input : { businessType: input };
4804
4818
  const start = motionFor(motionInput, presetId, read);
4805
- return { ...base, scroll: start.scroll, animate: start.animate, between: start.between, ...kept };
4819
+ const seed = referenceSeed(read, presetId);
4820
+ return { ...base, ...(seed?.used ? { seed: seed.seed } : {}), scroll: start.scroll, animate: start.animate, between: start.between, ...kept };
4806
4821
  }
4807
4822
  /** The look a business starts from: its best-ranked style (with the references' boost), at its defaults. */
4808
4823
  function startingDesign(input, read = null) {
@@ -4811,8 +4826,7 @@ function startingDesign(input, read = null) {
4811
4826
  const design = top ? presetDesign(top.id, rankInput, {}, read) : null;
4812
4827
  if (!top || !design)
4813
4828
  return null;
4814
- const seed = referenceSeed(read, top.id);
4815
- return seed?.used ? { presetId: top.id, design: { ...design, seed: seed.seed }, referenceColour: true } : { presetId: top.id, design, referenceColour: false };
4829
+ return { presetId: top.id, design, referenceColour: !!referenceSeed(read, top.id)?.used };
4816
4830
  }
4817
4831
 
4818
4832
  /**