@vectoriox/iox-ui 5.46.0 → 5.48.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 (32) hide show
  1. package/design-core/index.d.ts +5 -3
  2. package/fesm2022/vectoriox-iox-ui-design-core.mjs +7 -4
  3. package/fesm2022/vectoriox-iox-ui-design-core.mjs.map +1 -1
  4. package/fesm2022/vectoriox-iox-ui-generation-core.mjs +351 -78
  5. package/fesm2022/vectoriox-iox-ui-generation-core.mjs.map +1 -1
  6. package/fesm2022/vectoriox-iox-ui-harness-core.mjs +4179 -0
  7. package/fesm2022/vectoriox-iox-ui-harness-core.mjs.map +1 -0
  8. package/fesm2022/vectoriox-iox-ui.mjs +29 -1
  9. package/fesm2022/vectoriox-iox-ui.mjs.map +1 -1
  10. package/generation-core/index.d.ts +252 -18
  11. package/harness-core/index.d.ts +2498 -0
  12. package/harness-core/package.json +3 -0
  13. package/index.d.ts +22 -3
  14. package/package.json +5 -1
  15. package/src/design-core/design-apply.ts +8 -4
  16. package/src/generation-core/entrances.ts +110 -0
  17. package/src/generation-core/plan-data.ts +71 -0
  18. package/src/generation-core/public-api.ts +3 -0
  19. package/src/generation-core/shape-check.ts +92 -0
  20. package/src/generation-core/site-spec.generated.ts +131 -2
  21. package/src/generation-core/validate-site-plan.ts +9 -62
  22. package/src/harness-core/business-types.ts +141 -0
  23. package/src/harness-core/harness-spec.generated.ts +3528 -0
  24. package/src/harness-core/intake.ts +85 -0
  25. package/src/harness-core/lint.ts +94 -0
  26. package/src/harness-core/look.ts +32 -0
  27. package/src/harness-core/motion.ts +67 -0
  28. package/src/harness-core/needs.ts +42 -0
  29. package/src/harness-core/prompt-context.ts +91 -0
  30. package/src/harness-core/public-api.ts +19 -0
  31. package/src/harness-core/rank.ts +226 -0
  32. package/src/harness-core/site-analysis.ts +180 -0
@@ -1,4 +1,4 @@
1
- import { DesignChoices } from '@vectoriox/iox-ui/design-core';
1
+ import { DesignChoices, AnimateId } from '@vectoriox/iox-ui/design-core';
2
2
 
3
3
  declare const SPEC_SITE_PLAN_SHAPE: {
4
4
  readonly plan: {
@@ -23,7 +23,7 @@ declare const SPEC_SITE_PLAN_SHAPE: {
23
23
  readonly business: {
24
24
  readonly name: "string — the brand: the header, the hero, the copyright line";
25
25
  readonly "tagline?": "string — the hero lead and the footer line";
26
- readonly "facts?": "{ [fact]: string } — facts (email, phone, city): only the customer's own words; a blank fact is a publish-blocking placeholder, never invented";
26
+ readonly "facts?": "{ [fact]: string } — facts (email, phone, city, address, hours): only the customer's own words; a blank fact is a publish-blocking placeholder, never invented";
27
27
  };
28
28
  readonly design: {
29
29
  readonly flavorId: "string — a v2 flavor pack id";
@@ -102,6 +102,8 @@ declare const SPEC_SITE_FACTS: {
102
102
  readonly email: "Email address";
103
103
  readonly phone: "Phone number";
104
104
  readonly city: "City or area";
105
+ readonly address: "Street address";
106
+ readonly hours: "Opening hours";
105
107
  };
106
108
  declare const SPEC_SITE_PATTERNS: {
107
109
  readonly "nav.inline-cta": {
@@ -1759,6 +1761,100 @@ declare const SPEC_SITE_TEMPLATES: {
1759
1761
  };
1760
1762
  };
1761
1763
  };
1764
+ declare const SPEC_SITE_LIBRARY: readonly [{
1765
+ readonly id: "nav.inline-cta";
1766
+ readonly family: "nav";
1767
+ }, {
1768
+ readonly id: "nav.centered-logo";
1769
+ readonly family: "nav";
1770
+ }, {
1771
+ readonly id: "nav.overlay-menu";
1772
+ readonly family: "nav";
1773
+ }, {
1774
+ readonly id: "hero.split";
1775
+ readonly family: "hero";
1776
+ }, {
1777
+ readonly id: "hero.centered";
1778
+ readonly family: "hero";
1779
+ }, {
1780
+ readonly id: "hero.full-bleed-media";
1781
+ readonly family: "hero";
1782
+ }, {
1783
+ readonly id: "hero.stacked-editorial";
1784
+ readonly family: "hero";
1785
+ }, {
1786
+ readonly id: "proof.logo-strip";
1787
+ readonly family: "proof";
1788
+ }, {
1789
+ readonly id: "proof.stat-row";
1790
+ readonly family: "proof";
1791
+ }, {
1792
+ readonly id: "proof.testimonial-single";
1793
+ readonly family: "proof";
1794
+ }, {
1795
+ readonly id: "proof.testimonial-carousel";
1796
+ readonly family: "proof";
1797
+ }, {
1798
+ readonly id: "feature.triad";
1799
+ readonly family: "feature";
1800
+ }, {
1801
+ readonly id: "feature.alternating-rows";
1802
+ readonly family: "feature";
1803
+ }, {
1804
+ readonly id: "feature.icon-list";
1805
+ readonly family: "feature";
1806
+ }, {
1807
+ readonly id: "feature.tabbed";
1808
+ readonly family: "feature";
1809
+ }, {
1810
+ readonly id: "collection.card-grid";
1811
+ readonly family: "collection";
1812
+ }, {
1813
+ readonly id: "collection.masonry-gallery";
1814
+ readonly family: "collection";
1815
+ }, {
1816
+ readonly id: "collection.slider";
1817
+ readonly family: "collection";
1818
+ }, {
1819
+ readonly id: "collection.list-detail";
1820
+ readonly family: "collection";
1821
+ }, {
1822
+ readonly id: "story.long-form";
1823
+ readonly family: "story";
1824
+ }, {
1825
+ readonly id: "story.timeline";
1826
+ readonly family: "story";
1827
+ }, {
1828
+ readonly id: "story.quote-break";
1829
+ readonly family: "story";
1830
+ }, {
1831
+ readonly id: "cta.banner";
1832
+ readonly family: "cta";
1833
+ }, {
1834
+ readonly id: "cta.split-form";
1835
+ readonly family: "cta";
1836
+ }, {
1837
+ readonly id: "contact.split-map";
1838
+ readonly family: "contact";
1839
+ }, {
1840
+ readonly id: "contact.simple";
1841
+ readonly family: "contact";
1842
+ }, {
1843
+ readonly id: "faq.accordion";
1844
+ readonly family: "faq";
1845
+ }, {
1846
+ readonly id: "pricing.tiers";
1847
+ readonly family: "pricing";
1848
+ }, {
1849
+ readonly id: "footer.three-column";
1850
+ readonly family: "footer";
1851
+ }, {
1852
+ readonly id: "footer.mega";
1853
+ readonly family: "footer";
1854
+ }, {
1855
+ readonly id: "footer.minimal";
1856
+ readonly family: "footer";
1857
+ }];
1762
1858
 
1763
1859
  /** What an untouched node of one registered type saves as (`NODE_BASELINES`, generated from the live
1764
1860
  * iox-builder configs) — the builder serializer's flat `props` / `styleProps`, the trait names it has a
@@ -2190,6 +2286,51 @@ declare function setStyleProps(node: SerializedNode, values: Readonly<Record<str
2190
2286
  /** Every node of a tree, depth first. */
2191
2287
  declare function walkSerialized(nodes: ReadonlyArray<SerializedNode>, visit: (node: SerializedNode, ancestors: SerializedNode[]) => void, ancestors?: SerializedNode[]): void;
2192
2288
 
2289
+ /**
2290
+ * The ONE way a framework-free gate refuses a document "with a path, never repairs" (W1's site-plan gate, the
2291
+ * harness's analysis gate): a documented shape table (key → type text; `key?` optional, `[name]` the object's
2292
+ * own field names) whose key lists the gate READS — so the shape a model is told about is the shape refused —
2293
+ * and a collector that records each refusal at its dotted path. Generic over each gate's issue-code enum.
2294
+ */
2295
+ type ShapeEntry = Readonly<Record<string, string>>;
2296
+ type PlainObject = Record<string, unknown>;
2297
+ /** Every fixed key an object of the shape may carry. */
2298
+ declare function shapeKeys(entry: ShapeEntry): string[];
2299
+ /** The keys an object of the shape must carry. */
2300
+ declare function requiredShapeKeys(entry: ShapeEntry): string[];
2301
+ declare const isPlainObject: (v: unknown) => v is PlainObject;
2302
+ declare const isNonEmptyString: (v: unknown) => v is string;
2303
+ /** `path.key`, or `key` at the root. */
2304
+ declare const pathAt: (path: string, key: string) => string;
2305
+ interface PathIssue<C extends string> {
2306
+ code: C;
2307
+ /** Where, as a dotted path into the document (`pages[2].sections[0].binding`). */
2308
+ path: string;
2309
+ message: string;
2310
+ }
2311
+ /** The three refusals every shape gate shares, named in that gate's own code enum. */
2312
+ interface ShapeIssueCodes<C extends string> {
2313
+ /** A value of the wrong type, or a required value missing. */
2314
+ shape: C;
2315
+ /** A key the shape does not have. */
2316
+ unknownKey: C;
2317
+ /** A name used twice where it must be unique. */
2318
+ duplicate: C;
2319
+ }
2320
+ declare class PathIssueCollector<C extends string> {
2321
+ private readonly subject;
2322
+ private readonly codes;
2323
+ readonly issues: PathIssue<C>[];
2324
+ /** `subject` names the document in a refusal ("… is not part of the plan shape"). */
2325
+ constructor(subject: string, codes: ShapeIssueCodes<C>);
2326
+ add(code: C, path: string, message: string): void;
2327
+ keys(obj: PlainObject, allowed: ReadonlyArray<string>, path: string): void;
2328
+ string(obj: PlainObject, key: string, path: string, required?: boolean): string | null;
2329
+ boolean(obj: PlainObject, key: string, path: string): void;
2330
+ array(obj: PlainObject, key: string, path: string): unknown[];
2331
+ unique(values: Array<string | null>, path: (i: number) => string, what: string): void;
2332
+ }
2333
+
2193
2334
  /**
2194
2335
  * The Site Plan validator — the gate in front of the composer. The wizard's plan and (later) the AI's
2195
2336
  * plan go through the SAME checks: an unknown pattern, a slot the pattern does not declare, a source
@@ -2225,12 +2366,7 @@ declare enum SitePlanIssueCode {
2225
2366
  * its alt text. */
2226
2367
  MissingPreviewField = "missing-preview-field"
2227
2368
  }
2228
- interface SitePlanIssue {
2229
- code: SitePlanIssueCode;
2230
- /** Where, as a dotted path into the plan (`pages[2].sections[0].binding`). */
2231
- path: string;
2232
- message: string;
2233
- }
2369
+ type SitePlanIssue = PathIssue<SitePlanIssueCode>;
2234
2370
  interface SitePlanValidation {
2235
2371
  valid: boolean;
2236
2372
  issues: SitePlanIssue[];
@@ -2239,14 +2375,6 @@ declare class SitePlanError extends Error {
2239
2375
  readonly issues: ReadonlyArray<SitePlanIssue>;
2240
2376
  constructor(issues: ReadonlyArray<SitePlanIssue>);
2241
2377
  }
2242
- /** The documented plan shape (contract `site.planShape`): key → type; a key ending in `?` is optional and
2243
- * a `[name]` key stands for the object's own field names. The key lists below are READ from it, so a
2244
- * key the plan documents is a key the gate validates — and an undocumented one is refused. */
2245
- type ShapeEntry = Readonly<Record<string, string>>;
2246
- /** Every fixed key an object of the shape may carry. */
2247
- declare function shapeKeys(entry: ShapeEntry): string[];
2248
- /** The keys an object of the shape must carry. */
2249
- declare function requiredShapeKeys(entry: ShapeEntry): string[];
2250
2378
  /** The `:param` names of a route, in order. */
2251
2379
  declare function routeParams(route: string): string[];
2252
2380
  /** The plan's `$siblings.next` source of `routeSource` — what a pattern's `next.*` reads. */
@@ -2581,5 +2709,111 @@ declare function removeBarItem(globals: ReadonlyArray<SerializedNode>, itemId: s
2581
2709
  /** The bar's Items list drag-to-reorder (board 2): item `from` moves to `to`. Input not mutated. */
2582
2710
  declare function moveBarItem(globals: ReadonlyArray<SerializedNode>, from: number, to: number): BarItemsEditResult;
2583
2711
 
2584
- export { BAR_ITEMS_MAX, BAR_ITEMS_MIN, BASELINE_ROLES, BaselineRole, BindScope, CardBindTarget, ComposeError, ComposeIssueCode, DANGLING_LINK_CODES, DEFAULT_PHONE_MENU_BREAKPOINT, FACT_KEYS, GlobalSlot, NAV_PART_LABELS, NAV_SHAPE_COPY, NEUTRAL_STYLE_PROPS, NODE_BASELINES, NavPagesSource, NavRole, NavShape, NavShapeError, PRICING_PATTERN, PUBLISH_BLOCKING_PLACEHOLDERS, PatternDirective, PatternGlobalPosition, PatternOpens, PatternPlaceholder, PatternRecipe, PhoneMenuBreakpoint, PlaceholderKind, PlanDataSourceMode, PlanDataSourceType, RelativeOp, SAMPLE_IMAGE_REF, SITE_FACT_LABELS, SITE_HEADER_PATTERN, SITE_PATTERNS, SITE_PLAN_VERSION, SITE_TEMPLATES, SPEC_SITE_FACTS, SPEC_SITE_PATTERNS, SPEC_SITE_PLAN_SHAPE, SPEC_SITE_TEMPLATES, STUDIO_TEMPLATE, SitePlanError, SitePlanIssueCode, SitePlanSourceKind, SiteTemplateError, SiteTemplateId, addBarItem, altSourceScopes, assertStyleSlots, assertValidSitePlan, barIconForRoute, blocksPublish, composeNavHeader, composeSection, composeSite, createSerializedNode, findNavRoot, moveBarItem, navPages, navShapeBreakpoint, navShapeOf, nextSourceOf, nodeBindPaths, parseSampleImageRef, patternById, patternNeedsBinding, patternNodes, patternOptionalParts, patternScopes, patternSlots, patternTakesBinding, phoneMenuPages, planFromTemplate, planNavShape, releasedLayoutDefaults, removeBarItem, requiredShapeKeys, routeParams, sampleImageRef, setStyleProps, shapeKeys, siteNavPages, validateSitePlan, walkSerialized };
2585
- export type { AddBarItemResult, BarItemsEditResult, CmsDataSourcePlan, ComposeContext, ComposeIssue, ComposedDataSource, ComposedItem, ComposedNavHeader, ComposedPage, ComposedPlaceholder, ComposedRoute, ComposedSection, ComposedSite, ContentFieldPlan, ContentSeedPlan, ContentTypePlan, CreateNodeOptions, DataSourcePlan, FactKey, NavHeaderInput, NavHeaderOptions, NavPage, NavShapeOptions, NavShapeResult, NodeBaseline, PagePlan, PageSectionPlan, PatternNode, RelativeDataSourcePlan, SectionInput, SectionOptions, SerializedBinding, SerializedNode, SerializedResponsive, SiteBusiness, SitePageRef, SitePattern, SitePlan, SitePlanIssue, SitePlanSource, SitePlanValidation, SiteTemplate, TemplatePlanInput };
2712
+ /**
2713
+ * How animated (AI plan rev 3.1 §3p) — the ONE reading of the contract's `axes.animations` (what each level
2714
+ * moves, how) and `axes.animationFamilies` (which parts a section family lets move). The pieces every stamper
2715
+ * shares: the Design step's business specimen (H4-4) today, `planEntrances` in the composer (M1-6b) next. Pure.
2716
+ *
2717
+ * A level with `content` moves a section's content together, once; otherwise it names parts (heading, items,
2718
+ * media…) and each part enters on its own, items one after another. Navigation, footers and globals are a family
2719
+ * with no parts, so nothing there ever moves.
2720
+ */
2721
+ declare enum EntrancePart {
2722
+ Content = "content",
2723
+ Heading = "heading",
2724
+ Items = "items",
2725
+ Media = "media",
2726
+ RowMedia = "rowMedia",
2727
+ HeroText = "heroText"
2728
+ }
2729
+ /** What an entrance stamp is marked with — a later restamp touches only what the look made (H4-5). */
2730
+ declare const ENTRANCE_ORIGIN_LOOK = "look";
2731
+ /** The trigger every entrance plays on. */
2732
+ declare const ENTRANCE_TRIGGER = "viewportEnter";
2733
+ /** The easing every entrance plays with (only `opacity` and `transform` move). */
2734
+ declare const ENTRANCE_EASING = "ease-out";
2735
+ /** One entrance as the contract states it. */
2736
+ interface EntranceSpec {
2737
+ readonly type: string;
2738
+ readonly duration: number;
2739
+ readonly distance?: number;
2740
+ /** Items: ms added per item, up to `cap` items. */
2741
+ readonly stagger?: number;
2742
+ readonly cap?: number;
2743
+ /** The type a right-to-left page plays instead (a side-by-side row slides in from ITS side). */
2744
+ readonly mirror?: string;
2745
+ }
2746
+ /** What one section family moves at one level. `content` set = the whole content together, and no parts. */
2747
+ interface SectionEntrances {
2748
+ readonly content: EntranceSpec | null;
2749
+ readonly parts: Readonly<Partial<Record<EntrancePart, EntranceSpec>>>;
2750
+ }
2751
+ /** The interaction action a stamp carries — the shape both interaction runtimes play. */
2752
+ interface EntranceAction {
2753
+ type: string;
2754
+ target: 'self';
2755
+ duration: number;
2756
+ delay: number;
2757
+ easing: typeof ENTRANCE_EASING;
2758
+ once: true;
2759
+ params?: {
2760
+ distance: number;
2761
+ };
2762
+ }
2763
+ interface EntranceInteraction {
2764
+ id: string;
2765
+ trigger: typeof ENTRANCE_TRIGGER;
2766
+ actions: [EntranceAction];
2767
+ origin: typeof ENTRANCE_ORIGIN_LOOK;
2768
+ }
2769
+ /** What a section of `family` moves at `level` — nothing for an unknown level or family. */
2770
+ declare function sectionEntrances(level: AnimateId | string | null | undefined, family: string): SectionEntrances;
2771
+ /** The literal delay of the `index`-th item: `stagger` ms each, the last `cap` waiting no longer than the one before. */
2772
+ declare function staggerDelay(spec: EntranceSpec, index?: number): number;
2773
+ /** The action a node plays: the spec's type (mirrored on a right-to-left page), its distance and its delay. */
2774
+ declare function entranceAction(spec: EntranceSpec, opts?: {
2775
+ index?: number;
2776
+ rtl?: boolean;
2777
+ }): EntranceAction;
2778
+ /** The stamp on a node: `viewportEnter`, once, on itself (a duplicated node needs no remap), from the look. */
2779
+ declare function entranceInteraction(nodeId: string, action: EntranceAction): EntranceInteraction;
2780
+
2781
+ /**
2782
+ * What each page of a plan shows and where its data comes from (AI plan rev 3 §3d, `describePlanData`) — the
2783
+ * Plan step's data lines, in the vocabulary the builder already uses. Pure and STRUCTURED: the screen words
2784
+ * each kind in its own language ("Lists every Project", "One Project, found by its address /work/:slug").
2785
+ */
2786
+ declare enum PageDataKind {
2787
+ /** A section repeats every item of a content type. */
2788
+ List = "list",
2789
+ /** A section repeats the newest `count` items. */
2790
+ Latest = "latest",
2791
+ /** A template page: one item, found by its address — one page per item. */
2792
+ One = "one",
2793
+ /** The next (or previous) item beside the page's own. */
2794
+ Siblings = "siblings",
2795
+ /** A form: what it sends, to the studio's inbox (+ an email when Email is connected). */
2796
+ Form = "form",
2797
+ /** Words and pictures, no data. */
2798
+ Static = "static"
2799
+ }
2800
+ interface PageDataLine {
2801
+ kind: PageDataKind;
2802
+ /** The content type's label ("Projects"), for every kind that reads one. */
2803
+ contentType?: string;
2804
+ /** Latest: how many. */
2805
+ count?: number;
2806
+ /** One: the page's own address, with its parameter. */
2807
+ route?: string;
2808
+ /** Form: the form preset (`contact`). */
2809
+ form?: string;
2810
+ }
2811
+ interface PageData {
2812
+ pageKey: string;
2813
+ lines: PageDataLine[];
2814
+ }
2815
+ /** One entry per page of the plan, in plan order. */
2816
+ declare function describePlanData(plan: SitePlan): PageData[];
2817
+
2818
+ export { BAR_ITEMS_MAX, BAR_ITEMS_MIN, BASELINE_ROLES, BaselineRole, BindScope, CardBindTarget, ComposeError, ComposeIssueCode, DANGLING_LINK_CODES, DEFAULT_PHONE_MENU_BREAKPOINT, ENTRANCE_EASING, ENTRANCE_ORIGIN_LOOK, ENTRANCE_TRIGGER, EntrancePart, FACT_KEYS, GlobalSlot, NAV_PART_LABELS, NAV_SHAPE_COPY, NEUTRAL_STYLE_PROPS, NODE_BASELINES, NavPagesSource, NavRole, NavShape, NavShapeError, PRICING_PATTERN, PUBLISH_BLOCKING_PLACEHOLDERS, PageDataKind, PathIssueCollector, PatternDirective, PatternGlobalPosition, PatternOpens, PatternPlaceholder, PatternRecipe, PhoneMenuBreakpoint, PlaceholderKind, PlanDataSourceMode, PlanDataSourceType, RelativeOp, SAMPLE_IMAGE_REF, SITE_FACT_LABELS, SITE_HEADER_PATTERN, SITE_PATTERNS, SITE_PLAN_VERSION, SITE_TEMPLATES, SPEC_SITE_FACTS, SPEC_SITE_LIBRARY, SPEC_SITE_PATTERNS, SPEC_SITE_PLAN_SHAPE, SPEC_SITE_TEMPLATES, STUDIO_TEMPLATE, SitePlanError, SitePlanIssueCode, SitePlanSourceKind, SiteTemplateError, SiteTemplateId, addBarItem, altSourceScopes, assertStyleSlots, assertValidSitePlan, barIconForRoute, blocksPublish, composeNavHeader, composeSection, composeSite, createSerializedNode, describePlanData, entranceAction, entranceInteraction, findNavRoot, isNonEmptyString, isPlainObject, moveBarItem, navPages, navShapeBreakpoint, navShapeOf, nextSourceOf, nodeBindPaths, parseSampleImageRef, pathAt, patternById, patternNeedsBinding, patternNodes, patternOptionalParts, patternScopes, patternSlots, patternTakesBinding, phoneMenuPages, planFromTemplate, planNavShape, releasedLayoutDefaults, removeBarItem, requiredShapeKeys, routeParams, sampleImageRef, sectionEntrances, setStyleProps, shapeKeys, siteNavPages, staggerDelay, validateSitePlan, walkSerialized };
2819
+ export type { AddBarItemResult, BarItemsEditResult, CmsDataSourcePlan, ComposeContext, ComposeIssue, ComposedDataSource, ComposedItem, ComposedNavHeader, ComposedPage, ComposedPlaceholder, ComposedRoute, ComposedSection, ComposedSite, ContentFieldPlan, ContentSeedPlan, ContentTypePlan, CreateNodeOptions, DataSourcePlan, EntranceAction, EntranceInteraction, EntranceSpec, FactKey, NavHeaderInput, NavHeaderOptions, NavPage, NavShapeOptions, NavShapeResult, NodeBaseline, PageData, PageDataLine, PagePlan, PageSectionPlan, PathIssue, PatternNode, PlainObject, RelativeDataSourcePlan, SectionEntrances, SectionInput, SectionOptions, SerializedBinding, SerializedNode, SerializedResponsive, ShapeEntry, ShapeIssueCodes, SiteBusiness, SitePageRef, SitePattern, SitePlan, SitePlanIssue, SitePlanSource, SitePlanValidation, SiteTemplate, TemplatePlanInput };