@vectoriox/iox-ui 5.120.0 → 5.122.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/assist-core/index.d.ts +246 -18
- package/fesm2022/vectoriox-iox-ui-assist-core.mjs +692 -16
- package/fesm2022/vectoriox-iox-ui-assist-core.mjs.map +1 -1
- package/package.json +1 -1
- package/src/assist-core/assist-turn.ts +6 -3
- package/src/assist-core/brief.ts +2 -0
- package/src/assist-core/page-edits.ts +33 -12
- package/src/assist-core/page-sections.ts +371 -0
- package/src/assist-core/page-style.ts +6 -3
- package/src/assist-core/page-words.ts +23 -1
- package/src/assist-core/public-api.ts +2 -0
- package/src/assist-core/site-look.ts +321 -0
- package/src/assist-core/surfaces.ts +6 -3
package/assist-core/index.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { AiStep, JsonSchema, PlanWordContext, AdjustAxis, AdjustKind, SerializedNode } from '@vectoriox/iox-ui/generation-core';
|
|
1
|
+
import { AiStep, JsonSchema, PlanWordContext, AdjustAxis, AdjustKind, SerializedNode, SectionInput } from '@vectoriox/iox-ui/generation-core';
|
|
2
|
+
import { DesignChoices, DesignMode } from '@vectoriox/iox-ui/design-core';
|
|
2
3
|
|
|
3
4
|
/**
|
|
4
5
|
* The surfaces AI Assist runs on (ai-assist-plan §2, §4): each screen that offers a prompt registers ONE spec — what it
|
|
@@ -75,7 +76,8 @@ declare enum AssistPermission {
|
|
|
75
76
|
PageUpdate = "page_update",
|
|
76
77
|
PageDelete = "page_delete",
|
|
77
78
|
StorageAll = "storage_all",
|
|
78
|
-
ProductsAll = "products_all"
|
|
79
|
+
ProductsAll = "products_all",
|
|
80
|
+
SettingsAll = "settings_all"
|
|
79
81
|
}
|
|
80
82
|
declare enum SurfaceStatus {
|
|
81
83
|
Built = "built",
|
|
@@ -186,7 +188,9 @@ declare enum AssistIssueCode {
|
|
|
186
188
|
/** Looks like an e-mail, phone, price or time nobody gave (generation-core `factIssues`, R-H2). */
|
|
187
189
|
InventedFact = "inventedFact",
|
|
188
190
|
/** A word this site must not use. */
|
|
189
|
-
AvoidWord = "avoidWord"
|
|
191
|
+
AvoidWord = "avoidWord",
|
|
192
|
+
/** A look whose colours fail the contrast audit in a mode the site is worn in (family `look`, R4). */
|
|
193
|
+
Contrast = "contrast"
|
|
190
194
|
}
|
|
191
195
|
interface AssistIssue {
|
|
192
196
|
readonly code: AssistIssueCode;
|
|
@@ -633,9 +637,9 @@ interface SizeEdit {
|
|
|
633
637
|
readonly step: string;
|
|
634
638
|
}
|
|
635
639
|
/** Any edit of family `style`. */
|
|
636
|
-
type
|
|
640
|
+
type NodeStyleEdit = StyleEdit | SchemeEdit | SizeEdit;
|
|
637
641
|
/** The answer → the edits it makes. */
|
|
638
|
-
declare function decodeStyleAnswers(answers: ReadonlyArray<unknown>):
|
|
642
|
+
declare function decodeStyleAnswers(answers: ReadonlyArray<unknown>): NodeStyleEdit[];
|
|
639
643
|
declare const isStyleEdit: (e: object) => e is StyleEdit;
|
|
640
644
|
declare const isSchemeEdit: (e: object) => e is SchemeEdit;
|
|
641
645
|
declare const isSizeEdit: (e: object) => e is SizeEdit;
|
|
@@ -644,7 +648,10 @@ declare enum PageChangeOp {
|
|
|
644
648
|
Words = "words",
|
|
645
649
|
Style = "style",
|
|
646
650
|
Scheme = "scheme",
|
|
647
|
-
Size = "size"
|
|
651
|
+
Size = "size",
|
|
652
|
+
Section = "section",
|
|
653
|
+
/** The site's look (family `look`, AI2e) — every page follows. */
|
|
654
|
+
Look = "look"
|
|
648
655
|
}
|
|
649
656
|
interface StyleChange {
|
|
650
657
|
readonly op: PageChangeOp.Style | PageChangeOp.Scheme | PageChangeOp.Size;
|
|
@@ -681,7 +688,209 @@ interface StyleEditsOutcome {
|
|
|
681
688
|
* handle not in the focus, a style the target may not take, a scheme on a target that takes none are refused (re-asked
|
|
682
689
|
* once by the server, never repaired here); an edit that changes nothing is dropped.
|
|
683
690
|
*/
|
|
684
|
-
declare function applyStyleEdits(layout: ReadonlyArray<SerializedNode>, edits: ReadonlyArray<
|
|
691
|
+
declare function applyStyleEdits(layout: ReadonlyArray<SerializedNode>, edits: ReadonlyArray<NodeStyleEdit>, ctx: StyleEditContext): StyleEditsOutcome;
|
|
692
|
+
|
|
693
|
+
/**
|
|
694
|
+
* Surface S1 (the builder, this page), family `sections` (ai-assist-plan AI2d; ai-session-panel-plan `addSection` /
|
|
695
|
+
* `removeSection` / `moveSection` / `swapPattern`): a section is added, removed, moved or swapped for another — and every
|
|
696
|
+
* section Ask adds is a library pattern stamped by generation-core's `composeSection`, the SAME recipe the builder palette's
|
|
697
|
+
* ready-made sections and the composer use (R-H9). The model names a pattern from a closed list and a place by handle;
|
|
698
|
+
* it never writes a node. The same pure functions run on the server (the check on a copy) and in the builder (the trial).
|
|
699
|
+
*/
|
|
700
|
+
/**
|
|
701
|
+
* The library patterns Ask may add or swap to — those `composeSection` stamps on their own with no Site Plan behind
|
|
702
|
+
* them. Not offered: headers and footers (globals), lists and products (they need a content source — a Pages & data
|
|
703
|
+
* change), Scenes and the owner's film (the look's motion decides them, and a page holds one).
|
|
704
|
+
*/
|
|
705
|
+
declare const ASK_SECTION_PATTERNS: ReadonlyArray<string>;
|
|
706
|
+
/** Where an added or moved section goes when it is first on the page. */
|
|
707
|
+
declare const SECTION_START = "start";
|
|
708
|
+
/** The library pattern a section root was stamped from, by its label (the composer names a root by its pattern). */
|
|
709
|
+
declare function sectionPatternOf(root: Pick<SerializedNode, 'label'>): string | undefined;
|
|
710
|
+
/** The patterns Ask offers, as the model and the owner read them: id → its name ("Hero — words centred"). */
|
|
711
|
+
declare function askSectionPatternNames(): Record<string, string>;
|
|
712
|
+
/** A section of the page the family may name: its root, its name, and whether it is in the focus (may be removed, moved, swapped). */
|
|
713
|
+
interface SectionTarget {
|
|
714
|
+
readonly id: string;
|
|
715
|
+
readonly label: string;
|
|
716
|
+
readonly focus: boolean;
|
|
717
|
+
}
|
|
718
|
+
/** Every section of the page by handle (`s0`…) — `after` may name any of them; only focus ones may be changed. */
|
|
719
|
+
type SectionMap = Readonly<Record<string, SectionTarget>>;
|
|
720
|
+
declare enum SectionsAnswerKey {
|
|
721
|
+
Add = "add",
|
|
722
|
+
Remove = "remove",
|
|
723
|
+
Move = "move",
|
|
724
|
+
Swap = "swap",
|
|
725
|
+
Note = "note"
|
|
726
|
+
}
|
|
727
|
+
/**
|
|
728
|
+
* The strict format of family `sections` — ONE request: `add [{pattern, after}]`, `remove [{handle}]`,
|
|
729
|
+
* `move [{handle, after}]`, `swap [{handle, pattern}]`, `note`. Handles are enums of the page's sections (the focus's for
|
|
730
|
+
* what may change), patterns an enum of {@link ASK_SECTION_PATTERNS}. Whether an op makes sense is the check's.
|
|
731
|
+
*/
|
|
732
|
+
declare function sectionsJsonSchema(sections: SectionMap): {
|
|
733
|
+
parts: JsonSchema[];
|
|
734
|
+
handles: string[][];
|
|
735
|
+
};
|
|
736
|
+
interface SectionAdd {
|
|
737
|
+
readonly add: string;
|
|
738
|
+
readonly after: string;
|
|
739
|
+
}
|
|
740
|
+
interface SectionRemove {
|
|
741
|
+
readonly remove: string;
|
|
742
|
+
}
|
|
743
|
+
interface SectionMove {
|
|
744
|
+
readonly move: string;
|
|
745
|
+
readonly after: string;
|
|
746
|
+
}
|
|
747
|
+
interface SectionSwap {
|
|
748
|
+
readonly swap: string;
|
|
749
|
+
readonly pattern: string;
|
|
750
|
+
}
|
|
751
|
+
/** Any edit of family `sections`. */
|
|
752
|
+
type SectionEdit = SectionAdd | SectionRemove | SectionMove | SectionSwap;
|
|
753
|
+
declare const isSectionEdit: (e: object) => e is SectionEdit;
|
|
754
|
+
/** The answer → the edits it makes. */
|
|
755
|
+
declare function decodeSectionsAnswers(answers: ReadonlyArray<unknown>): SectionEdit[];
|
|
756
|
+
declare enum SectionChangeKind {
|
|
757
|
+
Add = "add",
|
|
758
|
+
Remove = "remove",
|
|
759
|
+
Move = "move",
|
|
760
|
+
Swap = "swap"
|
|
761
|
+
}
|
|
762
|
+
interface SectionChange {
|
|
763
|
+
readonly op: PageChangeOp.Section;
|
|
764
|
+
readonly kind: SectionChangeKind;
|
|
765
|
+
/** The section's handle (`s2`), or `new` for one added. */
|
|
766
|
+
readonly handle: string;
|
|
767
|
+
/** The node the card outlines — the new root of an added or swapped section, the moved one; a removed one's id (gone). */
|
|
768
|
+
readonly nodeId: string;
|
|
769
|
+
readonly label: string;
|
|
770
|
+
/** The pattern added or swapped to. */
|
|
771
|
+
readonly pattern?: string;
|
|
772
|
+
/** Where it stood / stands, or what it was / is, as the owner reads it. */
|
|
773
|
+
readonly before: string;
|
|
774
|
+
readonly after: string;
|
|
775
|
+
/** A swap: the owner's words and pictures the new section had no place for (still in the old one — Discard keeps it). */
|
|
776
|
+
readonly notPlaced?: number;
|
|
777
|
+
}
|
|
778
|
+
interface SectionEditContext {
|
|
779
|
+
readonly sections: SectionMap;
|
|
780
|
+
/** The studio's name and pages, as the palette composes with (`composeSection`). */
|
|
781
|
+
readonly input?: SectionInput;
|
|
782
|
+
/** A fresh node id (the builder's); default a stable `ask-s<n>` no node of the page holds. */
|
|
783
|
+
readonly newId?: () => string;
|
|
784
|
+
}
|
|
785
|
+
interface SectionEditsOutcome {
|
|
786
|
+
readonly ok: boolean;
|
|
787
|
+
readonly result: SerializedNode[];
|
|
788
|
+
readonly changes: ReadonlyArray<SectionChange>;
|
|
789
|
+
readonly issues: ReadonlyArray<AssistIssue>;
|
|
790
|
+
}
|
|
791
|
+
/**
|
|
792
|
+
* Family `sections`, applied — the SAME check on the server and in the builder. All or none; never mutates its input.
|
|
793
|
+
* Swaps redraw in place, then removals, moves and additions, each placed by the ORIGINAL handles. Refused (re-asked once
|
|
794
|
+
* by the server, never repaired): a handle not on the page or not in the focus, a pattern not offered, a section given two
|
|
795
|
+
* changes, a place that is the section itself or one removed in the same answer, a swap of a section holding a form,
|
|
796
|
+
* content-bound words or a Scene.
|
|
797
|
+
*/
|
|
798
|
+
declare function applySectionEdits(layout: ReadonlyArray<SerializedNode>, edits: ReadonlyArray<SectionEdit>, ctx: SectionEditContext): SectionEditsOutcome;
|
|
799
|
+
|
|
800
|
+
/**
|
|
801
|
+
* Surface S1 (the builder), family `look` (ai-assist-plan §4 AI2e; ai-session-panel-plan `setLook` / `setMotion`): the
|
|
802
|
+
* SITE's look and motion — every page follows — changed only along the contract's own axes: a style preset, the brand
|
|
803
|
+
* colour, the background tint, corners, pill buttons, spacing, the type pairing, the colour mode, speed, scrolling, how
|
|
804
|
+
* animated and the change between pages. Never a token value, never CSS. A preset brings its whole look and keeps the
|
|
805
|
+
* site's own Scrolling · How animated · Between pages (MO-D3, as Design ▸ Look does); a type pairing is one of the worn
|
|
806
|
+
* style's own. The colour is checked by the SAME audit the contract gates every preset with (`auditDesignContrast`, in
|
|
807
|
+
* every mode the look is worn) — a colour that fails is refused, never worn (R4: the AA gate decides the colour).
|
|
808
|
+
* The SAME pure functions run on the server (the check) and in the builder (the trial through the Design side-card's
|
|
809
|
+
* own trial): `lookJsonSchema`, `decodeLookAnswers`, `applyLookEdits`.
|
|
810
|
+
*/
|
|
811
|
+
/** One axis of the look, as the answer names it and the change card says it. */
|
|
812
|
+
declare enum LookAxis {
|
|
813
|
+
Style = "style",
|
|
814
|
+
Colour = "colour",
|
|
815
|
+
Tint = "tint",
|
|
816
|
+
Corners = "corners",
|
|
817
|
+
Buttons = "buttons",
|
|
818
|
+
Spacing = "spacing",
|
|
819
|
+
Type = "type",
|
|
820
|
+
Mode = "mode",
|
|
821
|
+
Speed = "speed",
|
|
822
|
+
Scrolling = "scrolling",
|
|
823
|
+
Entrances = "entrances",
|
|
824
|
+
Between = "between"
|
|
825
|
+
}
|
|
826
|
+
/** How the card names each axis (the builder translates it by the axis). */
|
|
827
|
+
declare const LOOK_AXIS_LABELS: Readonly<Record<LookAxis, string>>;
|
|
828
|
+
/** The axes in the order a card lists them (and the answer asks them). */
|
|
829
|
+
declare const LOOK_AXES: ReadonlyArray<LookAxis>;
|
|
830
|
+
/** The answer's extra key. Every axis is required; `''` keeps it as it is. */
|
|
831
|
+
declare enum LookAnswerKey {
|
|
832
|
+
Note = "note"
|
|
833
|
+
}
|
|
834
|
+
/** "Keep it as it is" — strict outputs require every key. */
|
|
835
|
+
declare const LOOK_KEEP = "";
|
|
836
|
+
/** `buttons`: pill-shaped or as the look draws them. */
|
|
837
|
+
declare enum LookButtons {
|
|
838
|
+
Pill = "pill",
|
|
839
|
+
Look = "look"
|
|
840
|
+
}
|
|
841
|
+
/** How the owner reads a colour mode. */
|
|
842
|
+
declare const MODE_LABELS: Readonly<Record<DesignMode, string>>;
|
|
843
|
+
/** A colour as the look stores it (`#RRGGBB`), or null. */
|
|
844
|
+
declare function lookHex(value: string): string | null;
|
|
845
|
+
/** How the owner reads one axis of a set of choices. */
|
|
846
|
+
declare function lookAxisValue(choices: DesignChoices, axis: LookAxis): {
|
|
847
|
+
readonly id: string;
|
|
848
|
+
readonly label: string;
|
|
849
|
+
};
|
|
850
|
+
/** The look as the brief says it — one readable value per axis (the model reads the site's look before changing it). */
|
|
851
|
+
type LookSummary = Readonly<Record<LookAxis, string>>;
|
|
852
|
+
declare function summarizeLook(choices: DesignChoices): LookSummary;
|
|
853
|
+
interface LookSchemas {
|
|
854
|
+
/** One request: every axis plus a note. */
|
|
855
|
+
readonly parts: ReadonlyArray<JsonSchema>;
|
|
856
|
+
/** No handles — the look is the site's. */
|
|
857
|
+
readonly handles: ReadonlyArray<ReadonlyArray<string>>;
|
|
858
|
+
}
|
|
859
|
+
/** Family `look`'s ONE strict format: every axis required, `''` keeps it; the ids listed and described from the contract. */
|
|
860
|
+
declare function lookJsonSchema(current: DesignChoices | null | undefined): LookSchemas;
|
|
861
|
+
/** The look the answer asks for — the axes it names, nothing else. */
|
|
862
|
+
interface SiteLookEdit {
|
|
863
|
+
readonly look: Readonly<Partial<Record<LookAxis, string>>>;
|
|
864
|
+
}
|
|
865
|
+
declare const isSiteLookEdit: (e: unknown) => e is SiteLookEdit;
|
|
866
|
+
/** The answer as ONE edit (or none, when every axis is kept). */
|
|
867
|
+
declare function decodeLookAnswers(answers: ReadonlyArray<unknown>): SiteLookEdit[];
|
|
868
|
+
/** One axis the turn changed, as the card says it. */
|
|
869
|
+
interface SiteLookChange {
|
|
870
|
+
readonly op: PageChangeOp.Look;
|
|
871
|
+
readonly axis: LookAxis;
|
|
872
|
+
/** The axis as the card names it ("Corners"). */
|
|
873
|
+
readonly label: string;
|
|
874
|
+
/** The ids, and how the owner reads them. */
|
|
875
|
+
readonly from: string;
|
|
876
|
+
readonly to: string;
|
|
877
|
+
readonly before: string;
|
|
878
|
+
readonly after: string;
|
|
879
|
+
}
|
|
880
|
+
interface LookEditsOutcome {
|
|
881
|
+
readonly ok: boolean;
|
|
882
|
+
/** The look the trial wears (the current one when not ok). */
|
|
883
|
+
readonly choices: DesignChoices;
|
|
884
|
+
readonly changes: ReadonlyArray<SiteLookChange>;
|
|
885
|
+
readonly issues: ReadonlyArray<AssistIssue>;
|
|
886
|
+
}
|
|
887
|
+
/**
|
|
888
|
+
* The answer on the current look: a style first (its whole look, the site's motion kept, the mode kept when the style
|
|
889
|
+
* offers it), then every other axis named. Refused, all or none: an id the axis does not have, a colour that is not one,
|
|
890
|
+
* a pairing the style does not offer, a mode the style was not drawn in, and a colour, tint or mode that fails the contrast
|
|
891
|
+
* audit in a mode the site is worn in. A look that is exactly an audited style is not re-audited (the contract gated it).
|
|
892
|
+
*/
|
|
893
|
+
declare function applyLookEdits(current: DesignChoices | null | undefined, edits: ReadonlyArray<SiteLookEdit>): LookEditsOutcome;
|
|
685
894
|
|
|
686
895
|
/**
|
|
687
896
|
* Surface S1 (the builder, this page), family `words` (ai-assist-plan §4, ai-session-panel-plan §3b–§3d): the page as
|
|
@@ -738,6 +947,8 @@ interface PageSectionSummary {
|
|
|
738
947
|
readonly parts: ReadonlyArray<PagePart>;
|
|
739
948
|
/** Family `style`: the elements of the section that may take another element style, colour scheme or size step. */
|
|
740
949
|
readonly looks?: ReadonlyArray<PageLook>;
|
|
950
|
+
/** Family `sections`: the library pattern the section was stamped from, when it is one Ask offers. */
|
|
951
|
+
readonly pattern?: string;
|
|
741
952
|
}
|
|
742
953
|
interface PageFocus {
|
|
743
954
|
readonly scope: AssistScope;
|
|
@@ -753,6 +964,8 @@ interface PageFocus {
|
|
|
753
964
|
/** How the owner reads the style and scheme ids the looks name. */
|
|
754
965
|
readonly styleNames?: Readonly<Record<string, string>>;
|
|
755
966
|
readonly schemeNames?: Readonly<Record<string, string>>;
|
|
967
|
+
/** Family `sections`: the library sections Ask may add or swap to, by id → name. */
|
|
968
|
+
readonly sectionPatterns?: Readonly<Record<string, string>>;
|
|
756
969
|
}
|
|
757
970
|
interface PageAround {
|
|
758
971
|
/** The other sections, one line each. */
|
|
@@ -763,6 +976,8 @@ interface PageAround {
|
|
|
763
976
|
}>;
|
|
764
977
|
/** The site's other pages, by name. */
|
|
765
978
|
readonly pages: ReadonlyArray<string>;
|
|
979
|
+
/** Family `look`: the look the whole site wears, one readable value per axis (AI2e). */
|
|
980
|
+
readonly look?: LookSummary;
|
|
766
981
|
}
|
|
767
982
|
type PageBrief = Brief<PageFocus, PageAround>;
|
|
768
983
|
interface PageBriefContext {
|
|
@@ -778,6 +993,8 @@ interface PageBriefContext {
|
|
|
778
993
|
readonly pages?: ReadonlyArray<string>;
|
|
779
994
|
readonly owner?: string | null;
|
|
780
995
|
readonly memory?: ReadonlyArray<string>;
|
|
996
|
+
/** The look the site wears (its stored choices) — said in the brief so "rounder", "darker", "calmer" read from it. */
|
|
997
|
+
readonly look?: DesignChoices | null;
|
|
781
998
|
}
|
|
782
999
|
interface SummarizedPage {
|
|
783
1000
|
readonly brief: PageBrief;
|
|
@@ -789,6 +1006,8 @@ interface SummarizedPage {
|
|
|
789
1006
|
readonly nodes: Readonly<Record<string, string>>;
|
|
790
1007
|
/** Family `style`: the focus's targets — what a style request carries and the check may write. */
|
|
791
1008
|
readonly looks: LookMap;
|
|
1009
|
+
/** Family `sections`: every section of the page by handle; the focus's may be removed, moved or swapped. */
|
|
1010
|
+
readonly sections: SectionMap;
|
|
792
1011
|
}
|
|
793
1012
|
/**
|
|
794
1013
|
* The page as the model sees it. The selection decides the focus: a node → its section in full, its own parts as
|
|
@@ -877,15 +1096,17 @@ declare function pageWriteLocale(layout: ReadonlyArray<SerializedNode>, ctx: {
|
|
|
877
1096
|
}): string;
|
|
878
1097
|
|
|
879
1098
|
/**
|
|
880
|
-
* Surface S1's answer as ONE thing (AI2b
|
|
881
|
-
* styles (`{ handle, style }`), schemes (`{ handle, scheme }`), size steps (`{ handle, axis, step }`)
|
|
882
|
-
* order on a copy, all or none.
|
|
883
|
-
*
|
|
1099
|
+
* Surface S1's answer as ONE thing (AI2b–AI2d): the edits of every family a page turn routed to — words (`{ handle, value }`),
|
|
1100
|
+
* styles (`{ handle, style }`), schemes (`{ handle, scheme }`), size steps (`{ handle, axis, step }`), sections
|
|
1101
|
+
* (`{ add | remove | move | swap }`) — applied in that order on a copy, all or none. Sections go last: every handle the
|
|
1102
|
+
* other families name is read on the page as it stood. The site's look (`{ look }`, AI2e) changes no node: it is applied
|
|
1103
|
+
* on `ctx.look` (the look the site wears) and comes back as `look`, the choices the trial wears. The server checks each family as it is asked; the builder's trial
|
|
1104
|
+
* applies the turn's edits through this, so both read one rule.
|
|
884
1105
|
*/
|
|
885
|
-
type PageEdit = WordEdit | StyleEdit | SchemeEdit | SizeEdit;
|
|
886
|
-
type PageChange = WordChange | StyleChange;
|
|
1106
|
+
type PageEdit = WordEdit | StyleEdit | SchemeEdit | SizeEdit | SectionEdit | SiteLookEdit;
|
|
1107
|
+
type PageChange = WordChange | StyleChange | SectionChange | SiteLookChange;
|
|
887
1108
|
interface PageEditContext extends Omit<WordEditContext, 'handles' | 'never'> {
|
|
888
|
-
readonly summary: Pick<SummarizedPage, 'handles' | 'looks'> & {
|
|
1109
|
+
readonly summary: Pick<SummarizedPage, 'handles' | 'looks'> & Partial<Pick<SummarizedPage, 'sections'>> & {
|
|
889
1110
|
readonly brief: {
|
|
890
1111
|
readonly rules: {
|
|
891
1112
|
readonly never: WordEditContext['never'];
|
|
@@ -894,12 +1115,19 @@ interface PageEditContext extends Omit<WordEditContext, 'handles' | 'never'> {
|
|
|
894
1115
|
};
|
|
895
1116
|
/** The builder's registry baseline; default the saved shape's (`serializedBaselineStyles`). */
|
|
896
1117
|
readonly baseline?: BaselineStyles;
|
|
1118
|
+
/** Family `sections`: the studio's name and pages (what the palette composes with) and the builder's fresh ids. */
|
|
1119
|
+
readonly sectionInput?: SectionEditContext['input'];
|
|
1120
|
+
readonly newId?: SectionEditContext['newId'];
|
|
1121
|
+
/** Family `look`: the look the site wears (its stored choices); absent = the default look. */
|
|
1122
|
+
readonly look?: DesignChoices | null;
|
|
897
1123
|
}
|
|
898
1124
|
interface PageEditsOutcome {
|
|
899
1125
|
readonly ok: boolean;
|
|
900
1126
|
readonly result: SerializedNode[];
|
|
901
1127
|
readonly changes: ReadonlyArray<PageChange>;
|
|
902
1128
|
readonly issues: ReadonlyArray<AssistIssue>;
|
|
1129
|
+
/** Family `look`: the choices the turn's look wears — present only when the turn changed the look. */
|
|
1130
|
+
readonly look?: DesignChoices;
|
|
903
1131
|
}
|
|
904
1132
|
declare function applyPageEdits(layout: ReadonlyArray<SerializedNode>, edits: ReadonlyArray<PageEdit>, ctx: PageEditContext): PageEditsOutcome;
|
|
905
1133
|
|
|
@@ -952,9 +1180,9 @@ interface AssistTurnRequest {
|
|
|
952
1180
|
};
|
|
953
1181
|
}
|
|
954
1182
|
/** What a turn proposes, per family: a field's value (`fields`), a part's words (`words`), an element's style or a section's scheme (`style`). */
|
|
955
|
-
type AssistEdit = FieldEdit | WordEdit | StyleEdit | SchemeEdit | SizeEdit;
|
|
1183
|
+
type AssistEdit = FieldEdit | WordEdit | StyleEdit | SchemeEdit | SizeEdit | SectionEdit | SiteLookEdit;
|
|
956
1184
|
/** What a turn changed, as the card says it. */
|
|
957
|
-
type AssistChange = FieldChange | WordChange | StyleChange;
|
|
1185
|
+
type AssistChange = FieldChange | WordChange | StyleChange | SectionChange | SiteLookChange;
|
|
958
1186
|
/** POST's 202 answer. */
|
|
959
1187
|
interface AssistTurnAccepted {
|
|
960
1188
|
readonly turnId: string;
|
|
@@ -1065,5 +1293,5 @@ declare function turnLocale(sentence: string, fields: ReadonlyArray<AssistField>
|
|
|
1065
1293
|
/** The language's own name in the admin's language (`en` → "English" / "אנגלית"). */
|
|
1066
1294
|
declare const languageName: (locale: string, uiLang: string) => string;
|
|
1067
1295
|
|
|
1068
|
-
export { AROUND_ITEMS_MAX, AROUND_TEXT_CHARS, ASK_STYLE_SETS, ASSIST_MODEL_AUTO, ASSIST_POLL_MS, ASSIST_ROUTES, AssistBriefError, AssistBudgetError, AssistFieldKind, AssistIssueCode, AssistPathError, AssistPermission, AssistRefusalCode, AssistRouteKey, AssistScope, AssistStep, AssistSurface, AssistTurnStatus, BOOLEAN_FALSE, BOOLEAN_TRUE, CommitKind, EditFamily, FIELDS_PER_PART, FIELD_HANDLE_PREFIX, FOCUS_TEXT_CHARS, FieldsAnswerKey, ItemSuggestionKind, LOCALE_NAME_LANGUAGES, MAX_ASSIST_PROPERTIES, MAX_ROUTE_PROPERTIES, MAX_SENTENCE_CHARS, MEMORY_TURNS, NEW_TARGET, NONE_TEXT, NeverWriteReason, PAGE_WORD_SLOTS, PageChangeOp, PagePartKind, PageSuggestionKind, RouteAnswerKey, SHORTEN_FROM_CHARS, SHORTEN_HEADING_FROM_CHARS, SHORTEN_TEXT_FROM_CHARS, SIBLING_HANDLE_PREFIX, SURFACES, StyleAnswerKey, SurfaceStatus, WORDS_PER_PART, WordsAnswerKey, adjustAxesOf, applyFieldEdits, applyPageEdits, applyStyleEdits, applyWordEdits, askableStyles, assertAssistBudget, assistBudgetIssues, assistFactIssues, assistFields, assistPath, assistSession, assistSessionKey, builtSurfaces, clipText, commitOf, containsHtml, decodeFieldsAnswers, decodeStyleAnswers, decodeWordsAnswers, escapeText, fieldHandle, fieldsJsonSchema, fieldsNamedIn, isEmptyFieldValue, isPlainRecord, isSchemeEdit, isSessionOf, isSizeEdit, isStyleEdit, isTerminalTurn, isWritable, itemLocales, itemSuggestions, languageName, lookNames, memoryLine, namedLocale, pageLooks, pageSuggestions, pageWriteLocale, paragraphsToRichText, primaryLocale, readFieldValue, readLocaleValues, readRoute, readableWords, resolveHandle, richTextParagraphs, routeJsonSchema, sectionLabel, serializedBaselineStyles, sessionMemory, styleJsonSchema, summarizeItem, summarizePage, surfacePermissions, surfaceSpec, titleField, turnLocale, unknownHandles, validateTurnRequest, wordsJsonSchema };
|
|
1069
|
-
export type { AssistChange, AssistEdit, AssistField, AssistIssue, AssistMemoryLine, AssistModelChoice, AssistRoute, AssistSession, AssistTarget, AssistTurn, AssistTurnAccepted, AssistTurnRefusal, AssistTurnRequest, AssistWordContext, BaselineStyles, Brief, BriefRules, BriefValue, ContentControllerDef, ContentPropertyDef, ContentRecord, ContentTypeSchema, FieldChange, FieldEdit, FieldEditContext, FieldEditsOutcome, FieldsSchemaOptions, FieldsSchemas, HandleMap, HandleResolution, HandleTarget, ItemAround, ItemBrief, ItemBriefContext, ItemBriefField, ItemFocus, ItemSuggestion, ItemSummary,
|
|
1296
|
+
export { AROUND_ITEMS_MAX, AROUND_TEXT_CHARS, ASK_SECTION_PATTERNS, ASK_STYLE_SETS, ASSIST_MODEL_AUTO, ASSIST_POLL_MS, ASSIST_ROUTES, AssistBriefError, AssistBudgetError, AssistFieldKind, AssistIssueCode, AssistPathError, AssistPermission, AssistRefusalCode, AssistRouteKey, AssistScope, AssistStep, AssistSurface, AssistTurnStatus, BOOLEAN_FALSE, BOOLEAN_TRUE, CommitKind, EditFamily, FIELDS_PER_PART, FIELD_HANDLE_PREFIX, FOCUS_TEXT_CHARS, FieldsAnswerKey, ItemSuggestionKind, LOCALE_NAME_LANGUAGES, LOOK_AXES, LOOK_AXIS_LABELS, LOOK_KEEP, LookAnswerKey, LookAxis, LookButtons, MAX_ASSIST_PROPERTIES, MAX_ROUTE_PROPERTIES, MAX_SENTENCE_CHARS, MEMORY_TURNS, MODE_LABELS, NEW_TARGET, NONE_TEXT, NeverWriteReason, PAGE_WORD_SLOTS, PageChangeOp, PagePartKind, PageSuggestionKind, RouteAnswerKey, SECTION_START, SHORTEN_FROM_CHARS, SHORTEN_HEADING_FROM_CHARS, SHORTEN_TEXT_FROM_CHARS, SIBLING_HANDLE_PREFIX, SURFACES, SectionChangeKind, SectionsAnswerKey, StyleAnswerKey, SurfaceStatus, WORDS_PER_PART, WordsAnswerKey, adjustAxesOf, applyFieldEdits, applyLookEdits, applyPageEdits, applySectionEdits, applyStyleEdits, applyWordEdits, askSectionPatternNames, askableStyles, assertAssistBudget, assistBudgetIssues, assistFactIssues, assistFields, assistPath, assistSession, assistSessionKey, builtSurfaces, clipText, commitOf, containsHtml, decodeFieldsAnswers, decodeLookAnswers, decodeSectionsAnswers, decodeStyleAnswers, decodeWordsAnswers, escapeText, fieldHandle, fieldsJsonSchema, fieldsNamedIn, isEmptyFieldValue, isPlainRecord, isSchemeEdit, isSectionEdit, isSessionOf, isSiteLookEdit, isSizeEdit, isStyleEdit, isTerminalTurn, isWritable, itemLocales, itemSuggestions, languageName, lookAxisValue, lookHex, lookJsonSchema, lookNames, memoryLine, namedLocale, pageLooks, pageSuggestions, pageWriteLocale, paragraphsToRichText, primaryLocale, readFieldValue, readLocaleValues, readRoute, readableWords, resolveHandle, richTextParagraphs, routeJsonSchema, sectionLabel, sectionPatternOf, sectionsJsonSchema, serializedBaselineStyles, sessionMemory, styleJsonSchema, summarizeItem, summarizeLook, summarizePage, surfacePermissions, surfaceSpec, titleField, turnLocale, unknownHandles, validateTurnRequest, wordsJsonSchema };
|
|
1297
|
+
export type { AssistChange, AssistEdit, AssistField, AssistIssue, AssistMemoryLine, AssistModelChoice, AssistRoute, AssistSession, AssistTarget, AssistTurn, AssistTurnAccepted, AssistTurnRefusal, AssistTurnRequest, AssistWordContext, BaselineStyles, Brief, BriefRules, BriefValue, ContentControllerDef, ContentPropertyDef, ContentRecord, ContentTypeSchema, FieldChange, FieldEdit, FieldEditContext, FieldEditsOutcome, FieldsSchemaOptions, FieldsSchemas, HandleMap, HandleResolution, HandleTarget, ItemAround, ItemBrief, ItemBriefContext, ItemBriefField, ItemFocus, ItemSuggestion, ItemSummary, LookEditsOutcome, LookMap, LookSchemas, LookSummary, LookTarget, NeverWrite, NodeStyleEdit, PageAround, PageBrief, PageBriefContext, PageChange, PageEdit, PageEditContext, PageEditsOutcome, PageFocus, PageLook, PagePart, PageSectionSummary, PageSuggestion, SchemeEdit, SectionAdd, SectionChange, SectionEdit, SectionEditContext, SectionEditsOutcome, SectionMap, SectionMove, SectionRemove, SectionSwap, SectionTarget, SiteLookChange, SiteLookEdit, SizeEdit, StyleChange, StyleEdit, StyleEditContext, StyleEditsOutcome, StyleSchemas, SummarizedItem, SummarizedPage, SurfaceSpec, WalkedLook, WordChange, WordEdit, WordEditContext, WordEditsOutcome, WordsSchemas, WrittenWords };
|