@charisol/plexo-sdk 2.0.21 → 2.0.23

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.
@@ -0,0 +1,7 @@
1
+ import React from 'react';
2
+ /** Pictures, logos and videos shared with Strata: pick what to bring in (by link, nothing is copied) or send up. */
3
+ export declare const AssetsView: React.FC<{
4
+ projectId: string;
5
+ projectName?: string;
6
+ onBack: () => void;
7
+ }>;
@@ -0,0 +1,6 @@
1
+ import React from 'react';
2
+ import type { DesignSystem } from '../../design/types';
3
+ /** Copy the brand as rules, CSS or SCSS. SOL is given the rules automatically, so this is for everyone else who builds with the brand. */
4
+ export declare const BrandGuideCard: React.FC<{
5
+ designSystem: DesignSystem;
6
+ }>;
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import type { StrataSync } from './useStrataSync';
3
- /** What a sync would do, in plain terms — and a choice wherever both sides changed the same thing. */
3
+ /** What a sync would do, in plain terms — and a side-by-side choice wherever both sides changed the same thing. */
4
4
  export declare const ReviewView: React.FC<{
5
5
  sync: StrataSync;
6
6
  onBack: () => void;
@@ -5,4 +5,5 @@ export declare const StrataCard: React.FC<{
5
5
  sync: ReturnType<typeof useStrataSync>;
6
6
  syncedAt?: string;
7
7
  onReview: () => void;
8
+ onAssets?: () => void;
8
9
  }>;
@@ -39,6 +39,10 @@ export interface StrataSync {
39
39
  check(): Promise<void>;
40
40
  pull(resolutions?: Resolutions): Promise<void>;
41
41
  push(resolutions?: Resolutions): Promise<void>;
42
+ /** Carries out a review in one go: Strata's choices come in, mine are sent. */
43
+ apply(resolutions?: Resolutions): Promise<void>;
44
+ /** Makes the brand here exactly Strata's. */
45
+ replaceWithStrata(): Promise<void>;
42
46
  /** Keep the site up to date with Strata on its own (see `planAutoUpdate`). */
43
47
  autoUpdate: boolean;
44
48
  setAutoUpdate(on: boolean): void;
@@ -1,15 +1,11 @@
1
1
  import React from 'react';
2
2
  /** The name to show for a stored value: a stack ("'Inter', ui-sans-serif…") or a bare name. */
3
3
  export declare const fontNameOf: (value: string | undefined) => string;
4
- /**
5
- * One font picker for everything: search, every family shown in its own letters, grouped the way people think about type
6
- * (Your fonts, Popular, Serif, Sans serif…), and — when the host can store files — "Add a font" to use the brand's own.
7
- * `onChange` gets the CSS font stack to store (`'Inter', ui-sans-serif, …`); `value` can be a stack or a bare name.
8
- */
9
4
  export declare const FontPicker: React.FC<{
10
5
  value: string | undefined;
11
6
  onChange: (stack: string, name: string) => void;
12
7
  label?: string;
13
8
  placeholder?: string;
14
- className?: string;
9
+ className?: string; /** Offer the brand's fonts as links that follow the brand (for fonts on pages, not for setting the brand itself). */
10
+ brandLink?: boolean;
15
11
  }>;
@@ -9,16 +9,9 @@ export interface SolSectionSummary {
9
9
  preview: string;
10
10
  /** Designed by hand (not built from a section kind): it can be moved, copied or removed, but not edited by content. */
11
11
  freeForm?: boolean;
12
- /** For a hand-designed section: the elements inside it that can be changed with `updateElement` (the words, link or picture description of each). */
12
+ /** For a hand-designed section: its elements as an outline, each with the id the element commands use. */
13
13
  elements?: SolElementSummary[];
14
14
  }
15
- export interface SolElementSummary {
16
- id: string;
17
- type: string;
18
- text?: string;
19
- href?: string;
20
- alt?: string;
21
- }
22
15
  export interface SolDesignSummary {
23
16
  pages: Array<{
24
17
  id: string;
@@ -34,8 +27,22 @@ export interface SolDesignSummary {
34
27
  bodyFont?: string;
35
28
  neutrals: string;
36
29
  roundness: string;
30
+ /** The brand's rules and exact variable names (colours, fonts, sizes, spacing, corners), so SOL builds with the brand and not around it. */
31
+ guidelines: string;
37
32
  };
38
33
  }
34
+ export interface SolElementSummary {
35
+ id: string;
36
+ type: string;
37
+ /** Only when it differs from the type, e.g. "Hero card". */
38
+ name?: string;
39
+ text?: string;
40
+ href?: string;
41
+ alt?: string;
42
+ /** The settings that decide how it is laid out and looks, so SOL can restructure it. */
43
+ styles?: Record<string, string | number | boolean>;
44
+ children?: SolElementSummary[];
45
+ }
39
46
  export declare function describeSection(node: DocumentNode): SolSectionSummary;
40
47
  /** A compact, JSON-friendly picture of the site (pages, their sections in order, the brand) for the model to read. */
41
48
  export declare function describeDesign(pages: PageDefinition[], designSystem: DesignSystem): SolDesignSummary;
@@ -0,0 +1,46 @@
1
+ import { z } from 'zod';
2
+ import type { DocumentNode, ElementStyles } from '../types/editor';
3
+ /** The kinds of element SOL may create. (Existing complex ones — carousels, forms, tables — can be moved, copied and restyled.) */
4
+ export declare const CREATABLE_TYPES: readonly ["container", "card", "heading", "paragraph", "button", "image", "badge", "divider", "spacer", "icon"];
5
+ /** Every style setting an element can carry (the editor's ElementStyles). Anything else SOL invents is dropped, and it is told so. */
6
+ export declare const STYLE_KEYS: ReadonlySet<string>;
7
+ /** Keeps the style settings the editor knows, with plain values; returns what it had to leave out. */
8
+ export declare function cleanStyles(input: unknown): {
9
+ styles: Partial<ElementStyles>;
10
+ dropped: string[];
11
+ };
12
+ export declare function cleanProps(input: unknown): Record<string, string | number | boolean>;
13
+ export interface ElementSpec {
14
+ /** Optional: a short id (letters, numbers, - and _) so later changes in the same answer can refer to this element. */
15
+ id?: string;
16
+ type: string;
17
+ name?: string;
18
+ content?: string;
19
+ props?: Record<string, unknown>;
20
+ styles?: Record<string, unknown>;
21
+ /** Different settings for tablets and phones, e.g. {"mobile": {"fontSize": "34px"}}. */
22
+ responsive?: {
23
+ tablet?: Record<string, unknown>;
24
+ mobile?: Record<string, unknown>;
25
+ };
26
+ hidden?: boolean;
27
+ children?: ElementSpec[];
28
+ }
29
+ export declare const elementSpecSchema: z.ZodType<ElementSpec>;
30
+ export interface Built {
31
+ node: DocumentNode;
32
+ dropped: string[];
33
+ }
34
+ /** Builds real nodes from a spec. Throws a plain-English Error when the spec can't be built. */
35
+ export declare function buildElement(spec: ElementSpec, taken: Set<string>, opts?: {
36
+ section?: boolean;
37
+ }): Built;
38
+ export declare const mapNode: (n: DocumentNode, id: string, fn: (n: DocumentNode) => DocumentNode) => DocumentNode;
39
+ export declare const hasNode: (n: DocumentNode, id: string) => boolean;
40
+ export declare const allIds: (n: DocumentNode, into?: Set<string>) => Set<string>;
41
+ export declare function findIn(n: DocumentNode, id: string): DocumentNode | null;
42
+ export declare function removeFrom(n: DocumentNode, id: string): DocumentNode;
43
+ /** Puts `child` into the element `parentId` at `index` (or the end). */
44
+ export declare function insertInto(root: DocumentNode, parentId: string, child: DocumentNode, index?: number): DocumentNode;
45
+ /** A copy with fresh ids all the way down. */
46
+ export declare function cloneFresh(n: DocumentNode, taken: Set<string>): DocumentNode;
@@ -2,4 +2,4 @@
2
2
  * A ready-made system prompt for the host's AI. Send it with `context.catalog` and `context.design` (both come with every
3
3
  * `onAskSol` call) so SOL knows what can be built and what the site looks like right now.
4
4
  */
5
- export declare const SOL_SYSTEM_PROMPT = "You are SOL, a friendly assistant inside a website builder. The site owner is not technical: speak plainly, never mention JSON, ids, code or \"blocks\" in what you say to them.\n\nYou are given two JSON documents: \"catalog\" (every kind of section you can add, its layouts and the fields you can fill in) and \"design\" (the site's pages, their sections in order, and the brand). Only use kinds, layouts and fields that appear in the catalog, and only refer to pages and sections by the ids in \"design\".\n\nWhen the owner asks for a change, reply with one or two short, warm sentences explaining what you suggest, then a fenced block of changes like this:\n\n```plexo-commands\n[\n {\"op\": \"addSection\", \"pageId\": \"<page id>\", \"kind\": \"hero\", \"variant\": \"<layout id>\", \"content\": {\"headline\": \"...\"}, \"afterSectionId\": \"<section id>\"},\n {\"op\": \"updateSection\", \"sectionId\": \"<section id>\", \"content\": {\"heading\": \"...\"}, \"variant\": \"<layout id>\", \"style\": {\"background\": \"surface\", \"align\": \"center\", \"spacing\": \"airy\"}},\n {\"op\": \"updateElement\", \"nodeId\": \"<element id>\", \"text\": \"...\", \"href\": \"/about\", \"alt\": \"...\", \"style\": {\"fontSize\": \"56px\", \"fontWeight\": \"700\", \"textAlign\": \"center\", \"textColor\": \"#111111\", \"lineHeight\": \"1.1\", \"letterSpacing\": \"-0.02em\", \"textTransform\": \"none\"}},\n {\"op\": \"removeSection\", \"sectionId\": \"<section id>\"},\n {\"op\": \"moveSection\", \"sectionId\": \"<section id>\", \"index\": 0},\n {\"op\": \"duplicateSection\", \"sectionId\": \"<section id>\"},\n {\"op\": \"setBrand\", \"tokens\": {\"primaryColor\": \"#1D4ED8\", \"headingFont\": \"Poppins\", \"bodyFont\": \"Inter\", \"neutrals\": \"warm\", \"roundness\": \"round\"}},\n {\"op\": \"addPage\", \"name\": \"About\", \"templateId\": \"<optional, from catalog.pageTemplates>\"},\n {\"op\": \"renamePage\", \"pageId\": \"<page id>\", \"name\": \"Our story\"}\n]\n```\n\nRules:\n- The owner always reviews and approves your changes before anything happens, so suggest them confidently, but keep each suggestion small and focused.\n- Content keys are the field paths from the catalog (\"headline\", \"items.0.title\"). A list field needs the whole list. Keep text within each field's \"max\".\n- Write real, specific copy for the owner's business; never lorem ipsum.\n- Sections marked freeForm in \"design\" were designed by hand, so they have no fields: change what is inside them with updateElement, using the element ids listed in that section's \"elements\" (headlines, paragraphs, buttons, pictures). \"text\" replaces its words, \"href\" its link, \"alt\" a picture's description, and \"style\" only the keys shown above. Each updateElement changes one element; send one per element. For a managed section (one with a kind) always use updateSection instead.\n- When the owner has selected an element, \"Asking about\" gives its id: edit that element, not a different one. Make real, specific changes: a punchier headline is new words, not a restyle.\n- If you only need to answer a question or give advice, reply in plain text with no block.";
5
+ export declare const SOL_SYSTEM_PROMPT = "You are SOL, a friendly assistant inside a website builder. The site owner is not technical: speak plainly, never mention JSON, ids, code or \"blocks\" in what you say to them.\n\nYou are given two JSON documents: \"catalog\" (every kind of section you can add, its layouts and the fields you can fill in) and \"design\" (the site's pages, their sections in order, and the brand). Only use kinds, layouts and fields that appear in the catalog, and only refer to pages and sections by the ids in \"design\".\n\nWhen the owner asks for a change, reply with one or two short, warm sentences explaining what you suggest, then a fenced block of changes like this:\n\n```plexo-commands\n[\n {\"op\": \"addSection\", \"pageId\": \"<page id>\", \"kind\": \"hero\", \"variant\": \"<layout id>\", \"content\": {\"headline\": \"...\"}, \"afterSectionId\": \"<section id>\"},\n {\"op\": \"updateSection\", \"sectionId\": \"<section id>\", \"content\": {\"heading\": \"...\"}, \"variant\": \"<layout id>\", \"style\": {\"background\": \"surface\", \"align\": \"center\", \"spacing\": \"airy\"}},\n {\"op\": \"updateElement\", \"nodeId\": \"<element id>\", \"text\": \"...\", \"href\": \"/about\", \"src\": \"https://...\", \"alt\": \"...\", \"name\": \"...\", \"hidden\": false, \"style\": {\"fontSize\": \"56px\", \"textColor\": \"#111\", \"display\": \"grid\"}, \"responsive\": {\"mobile\": {\"fontSize\": \"34px\"}, \"tablet\": {}}},\n {\"op\": \"addElement\", \"parentId\": \"<section, container or card id>\", \"element\": {\"type\": \"heading\", \"content\": \"...\", \"props\": {\"level\": 2}, \"styles\": {}}, \"afterNodeId\": \"<sibling id>\"},\n {\"op\": \"removeElement\", \"nodeId\": \"<element id>\"},\n {\"op\": \"moveElement\", \"nodeId\": \"<element id>\", \"parentId\": \"<group id>\", \"index\": 0},\n {\"op\": \"duplicateElement\", \"nodeId\": \"<element id>\"},\n {\"op\": \"addCustomSection\", \"pageId\": \"<page id>\", \"element\": {\"type\": \"section\", \"name\": \"Offer\", \"styles\": {\"backgroundColor\": \"#F4EFE6\"}, \"children\": []}, \"afterSectionId\": \"<section id>\"},\n {\"op\": \"replaceSection\", \"sectionId\": \"<section id>\", \"element\": {\"type\": \"section\", \"children\": []}},\n {\"op\": \"removeSection\", \"sectionId\": \"<section id>\"},\n {\"op\": \"moveSection\", \"sectionId\": \"<section id>\", \"index\": 0},\n {\"op\": \"duplicateSection\", \"sectionId\": \"<section id>\"},\n {\"op\": \"setBrand\", \"tokens\": {\"primaryColor\": \"#1D4ED8\", \"headingFont\": \"Poppins\", \"bodyFont\": \"Inter\", \"neutrals\": \"warm\", \"roundness\": \"round\"}},\n {\"op\": \"addPage\", \"name\": \"About\", \"templateId\": \"<optional, from catalog.pageTemplates>\"},\n {\"op\": \"renamePage\", \"pageId\": \"<page id>\", \"name\": \"Our story\"}\n]\n```\n\nRules:\n- The owner always reviews and approves your changes before anything happens, so suggest them confidently, but keep each suggestion small and focused.\n- Content keys are the field paths from the catalog (\"headline\", \"items.0.title\"). A list field needs the whole list. Keep text within each field's \"max\".\n- Write real, specific copy for the owner's business; never lorem ipsum.\n- Sections marked freeForm were designed by hand, so they have no fields. \"design\" lists each one as an outline of elements (id, type, words, link, the settings that decide its layout and look). You can change ANYTHING in them: updateElement for words, links, pictures and any look setting (also per screen with \"responsive\"); addElement, removeElement, moveElement and duplicateElement to restructure; replaceSection to rebuild a whole section from a fresh element tree; addCustomSection to build a new hand-designed section.\n- Elements you can create: container (a group; make columns with display \"grid\" and gridColumns or gridTemplateColumns, a row with display \"flex\" and flexDirection \"row\"), card, heading, paragraph, button, image (props src and alt), badge, divider, spacer, icon (props iconName). Give new elements real settings (padding, gap, colours, font sizes), use brand variables like var(--color-brand-primary-500) where they fit, set mobile settings (responsive.mobile) for anything wide, and give an element a short \"id\" if a later change in the same answer needs to refer to it.\n- Each element command changes one thing; send as many as needed. For a ready-made section (one with a kind) use updateSection; only use replaceSection on one when it truly needs a different structure \u2014 it becomes hand-designed afterwards.\n- When the owner has selected an element, \"Asking about\" gives its id: edit that element, not a different one. Make real, specific changes: a punchier headline is new words, not a restyle.\n- Stay on brand: \"design.brand.guidelines\" lists the brand's exact variables. Colour, font, size, spacing and corner settings should use them as var(--name) (e.g. var(--color-action-primary-bg), var(--space-6)), never a made-up hex colour or pixel value, so the site follows the brand when it changes in Strata.\n- If you only need to answer a question or give advice, reply in plain text with no block.";
@@ -59,31 +59,58 @@ export declare const updateSectionSchema: z.ZodObject<{
59
59
  pinned: z.ZodOptional<z.ZodBoolean>;
60
60
  }, z.core.$strict>>;
61
61
  }, z.core.$strip>;
62
- /** Changes one element inside a hand-designed section (a headline, a paragraph, a button, an image): its words, link, picture description or look. */
62
+ /** Changes one element inside a hand-designed section: its words, link, picture or description, name, visibility, or any style setting (also per screen). */
63
63
  export declare const updateElementSchema: z.ZodObject<{
64
64
  op: z.ZodLiteral<"updateElement">;
65
65
  nodeId: z.ZodString;
66
66
  text: z.ZodOptional<z.ZodString>;
67
67
  href: z.ZodOptional<z.ZodString>;
68
68
  alt: z.ZodOptional<z.ZodString>;
69
- style: z.ZodOptional<z.ZodObject<{
70
- fontSize: z.ZodOptional<z.ZodString>;
71
- fontWeight: z.ZodOptional<z.ZodString>;
72
- textAlign: z.ZodOptional<z.ZodEnum<{
73
- left: "left";
74
- right: "right";
75
- center: "center";
76
- }>>;
77
- textColor: z.ZodOptional<z.ZodString>;
78
- lineHeight: z.ZodOptional<z.ZodString>;
79
- letterSpacing: z.ZodOptional<z.ZodString>;
80
- textTransform: z.ZodOptional<z.ZodEnum<{
81
- none: "none";
82
- capitalize: "capitalize";
83
- lowercase: "lowercase";
84
- uppercase: "uppercase";
85
- }>>;
86
- }, z.core.$strict>>;
69
+ src: z.ZodOptional<z.ZodString>;
70
+ name: z.ZodOptional<z.ZodString>;
71
+ hidden: z.ZodOptional<z.ZodBoolean>;
72
+ style: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
73
+ responsive: z.ZodOptional<z.ZodObject<{
74
+ tablet: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
75
+ mobile: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
76
+ }, z.core.$strip>>;
77
+ }, z.core.$strip>;
78
+ /** Adds a new element (or a whole group of them) inside a hand-designed section. */
79
+ export declare const addElementSchema: z.ZodObject<{
80
+ op: z.ZodLiteral<"addElement">;
81
+ parentId: z.ZodString;
82
+ element: z.ZodType<import("./elements").ElementSpec, unknown, z.core.$ZodTypeInternals<import("./elements").ElementSpec, unknown>>;
83
+ index: z.ZodOptional<z.ZodNumber>;
84
+ afterNodeId: z.ZodOptional<z.ZodString>;
85
+ }, z.core.$strip>;
86
+ export declare const removeElementSchema: z.ZodObject<{
87
+ op: z.ZodLiteral<"removeElement">;
88
+ nodeId: z.ZodString;
89
+ }, z.core.$strip>;
90
+ export declare const moveElementSchema: z.ZodObject<{
91
+ op: z.ZodLiteral<"moveElement">;
92
+ nodeId: z.ZodString;
93
+ parentId: z.ZodOptional<z.ZodString>;
94
+ index: z.ZodOptional<z.ZodNumber>;
95
+ afterNodeId: z.ZodOptional<z.ZodString>;
96
+ }, z.core.$strip>;
97
+ export declare const duplicateElementSchema: z.ZodObject<{
98
+ op: z.ZodLiteral<"duplicateElement">;
99
+ nodeId: z.ZodString;
100
+ }, z.core.$strip>;
101
+ /** Adds a brand-new hand-designed section built from an element tree. */
102
+ export declare const addCustomSectionSchema: z.ZodObject<{
103
+ index: z.ZodOptional<z.ZodNumber>;
104
+ afterSectionId: z.ZodOptional<z.ZodString>;
105
+ op: z.ZodLiteral<"addCustomSection">;
106
+ pageId: z.ZodString;
107
+ element: z.ZodType<import("./elements").ElementSpec, unknown, z.core.$ZodTypeInternals<import("./elements").ElementSpec, unknown>>;
108
+ }, z.core.$strip>;
109
+ /** Rebuilds a section from an element tree (keeps its place). A ready-made section becomes hand-designed. */
110
+ export declare const replaceSectionSchema: z.ZodObject<{
111
+ op: z.ZodLiteral<"replaceSection">;
112
+ sectionId: z.ZodString;
113
+ element: z.ZodType<import("./elements").ElementSpec, unknown, z.core.$ZodTypeInternals<import("./elements").ElementSpec, unknown>>;
87
114
  }, z.core.$strip>;
88
115
  export declare const removeSectionSchema: z.ZodObject<{
89
116
  op: z.ZodLiteral<"removeSection">;
@@ -177,24 +204,42 @@ export declare const solCommandSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
177
204
  text: z.ZodOptional<z.ZodString>;
178
205
  href: z.ZodOptional<z.ZodString>;
179
206
  alt: z.ZodOptional<z.ZodString>;
180
- style: z.ZodOptional<z.ZodObject<{
181
- fontSize: z.ZodOptional<z.ZodString>;
182
- fontWeight: z.ZodOptional<z.ZodString>;
183
- textAlign: z.ZodOptional<z.ZodEnum<{
184
- left: "left";
185
- right: "right";
186
- center: "center";
187
- }>>;
188
- textColor: z.ZodOptional<z.ZodString>;
189
- lineHeight: z.ZodOptional<z.ZodString>;
190
- letterSpacing: z.ZodOptional<z.ZodString>;
191
- textTransform: z.ZodOptional<z.ZodEnum<{
192
- none: "none";
193
- capitalize: "capitalize";
194
- lowercase: "lowercase";
195
- uppercase: "uppercase";
196
- }>>;
197
- }, z.core.$strict>>;
207
+ src: z.ZodOptional<z.ZodString>;
208
+ name: z.ZodOptional<z.ZodString>;
209
+ hidden: z.ZodOptional<z.ZodBoolean>;
210
+ style: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
211
+ responsive: z.ZodOptional<z.ZodObject<{
212
+ tablet: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
213
+ mobile: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
214
+ }, z.core.$strip>>;
215
+ }, z.core.$strip>, z.ZodObject<{
216
+ op: z.ZodLiteral<"addElement">;
217
+ parentId: z.ZodString;
218
+ element: z.ZodType<import("./elements").ElementSpec, unknown, z.core.$ZodTypeInternals<import("./elements").ElementSpec, unknown>>;
219
+ index: z.ZodOptional<z.ZodNumber>;
220
+ afterNodeId: z.ZodOptional<z.ZodString>;
221
+ }, z.core.$strip>, z.ZodObject<{
222
+ op: z.ZodLiteral<"removeElement">;
223
+ nodeId: z.ZodString;
224
+ }, z.core.$strip>, z.ZodObject<{
225
+ op: z.ZodLiteral<"moveElement">;
226
+ nodeId: z.ZodString;
227
+ parentId: z.ZodOptional<z.ZodString>;
228
+ index: z.ZodOptional<z.ZodNumber>;
229
+ afterNodeId: z.ZodOptional<z.ZodString>;
230
+ }, z.core.$strip>, z.ZodObject<{
231
+ op: z.ZodLiteral<"duplicateElement">;
232
+ nodeId: z.ZodString;
233
+ }, z.core.$strip>, z.ZodObject<{
234
+ index: z.ZodOptional<z.ZodNumber>;
235
+ afterSectionId: z.ZodOptional<z.ZodString>;
236
+ op: z.ZodLiteral<"addCustomSection">;
237
+ pageId: z.ZodString;
238
+ element: z.ZodType<import("./elements").ElementSpec, unknown, z.core.$ZodTypeInternals<import("./elements").ElementSpec, unknown>>;
239
+ }, z.core.$strip>, z.ZodObject<{
240
+ op: z.ZodLiteral<"replaceSection">;
241
+ sectionId: z.ZodString;
242
+ element: z.ZodType<import("./elements").ElementSpec, unknown, z.core.$ZodTypeInternals<import("./elements").ElementSpec, unknown>>;
198
243
  }, z.core.$strip>, z.ZodObject<{
199
244
  op: z.ZodLiteral<"removeSection">;
200
245
  sectionId: z.ZodString;
@@ -0,0 +1,7 @@
1
+ import type { DesignSystem } from '../design/types';
2
+ /** Every token as a CSS custom property, the way Strata exports it. */
3
+ export declare function brandCss(ds: DesignSystem): string;
4
+ /** Every token as a SCSS variable that points at its CSS variable, so a change of brand still flows through. */
5
+ export declare function brandScss(ds: DesignSystem): string;
6
+ /** What a builder (human or AI) needs to know to make something on-brand, in plain language with the exact variable names. */
7
+ export declare function brandGuidelines(ds: DesignSystem): string;
@@ -1,5 +1,5 @@
1
1
  import type { DesignComponent, DesignToken } from '../design/types';
2
- import type { StrataProjectSummary, StrataPushPayload, StrataPushResult, StrataSnapshot } from './types';
2
+ import type { StrataAsset, StrataProjectSummary, StrataPushPayload, StrataPushResult, StrataSnapshot } from './types';
3
3
  export type StrataErrorKind = 'expired' | 'forbidden' | 'not_found' | 'conflict' | 'invalid' | 'network' | 'server';
4
4
  /** An error from Strata, already in words a site owner can act on. */
5
5
  export declare class StrataError extends Error {
@@ -29,6 +29,17 @@ export declare function createStrataClient(opts: StrataClientOptions): {
29
29
  }): Promise<StrataProjectSummary>;
30
30
  pull(projectId: string): Promise<StrataSnapshot>;
31
31
  push(projectId: string, payload: StrataPushPayload, baseRevision?: string): Promise<StrataPushResult>;
32
+ /** The pictures and videos in a project (anything else Strata keeps, such as fonts and documents, is left out). */
33
+ listAssets(projectId: string): Promise<StrataAsset[]>;
34
+ /** Puts a file into a project's assets. */
35
+ uploadAsset(projectId: string, input: {
36
+ name: string;
37
+ type: string;
38
+ role?: string;
39
+ file: Blob;
40
+ fileName: string;
41
+ metadata?: Record<string, unknown>;
42
+ }): Promise<void>;
32
43
  me(): Promise<{
33
44
  email?: string;
34
45
  name?: string;
@@ -6,3 +6,4 @@ export * from './types';
6
6
  export { planSync, applySync, hasAnything, summarize, baseOf } from './merge';
7
7
  export { createStrataClient, StrataError, tokenFromStrata, componentFromStrata, projectFromStrata, type StrataClient, type StrataClientOptions, type StrataErrorKind } from './client';
8
8
  export { planAutoUpdate, type AutoUpdatePlan, type AutoUpdateStatus, type AutoUpdateConflict } from './autoUpdate';
9
+ export { brandCss, brandScss, brandGuidelines } from './brandGuide';
@@ -41,6 +41,18 @@ export interface StrataPushResult {
41
41
  message: string;
42
42
  }>;
43
43
  }
44
+ /** A picture or video held in a Strata project. It stays where it is: Plexo uses its link and never copies the file. */
45
+ export interface StrataAsset {
46
+ id: string;
47
+ name: string;
48
+ kind: 'image' | 'video';
49
+ /** The address Strata serves it from. */
50
+ url: string;
51
+ /** What the owner called it in Strata: a logo, an illustration… */
52
+ type?: string;
53
+ role?: string;
54
+ mimeType?: string;
55
+ }
44
56
  export interface StrataAdapter {
45
57
  status(): Promise<StrataStatus>;
46
58
  /**
@@ -66,6 +78,17 @@ export interface StrataAdapter {
66
78
  * switch only applies each time the editor is opened.
67
79
  */
68
80
  setAutoUpdate?(projectId: string, enabled: boolean): Promise<void>;
81
+ /** The pictures and videos in a Strata project. Absent → the editor hides asset sharing. */
82
+ listAssets?(projectId: string): Promise<StrataAsset[]>;
83
+ /** Adds the chosen Strata assets to this site's images, by link (nothing is downloaded). */
84
+ importAssets?(projectId: string, assetIds: string[]): Promise<{
85
+ added: number;
86
+ }>;
87
+ /** Sends the chosen images from this site's library to Strata. Ones Strata already has are skipped. */
88
+ sendAssets?(projectId: string, mediaIds: string[]): Promise<{
89
+ sent: number;
90
+ skipped: number;
91
+ }>;
69
92
  /** How that server-side updating is going, in words for the owner ("Strata has changes that need your review…"). */
70
93
  autoUpdateStatus?(): Promise<{
71
94
  enabled: boolean;
@@ -1,5 +1,5 @@
1
- import { A as e, An as t, At as n, C as r, Dn as i, E as a, Fn as o, Ft as ee, Ln as te, Mn as s, Mt as c, N as l, Nn as u, Nt as d, On as f, Ot as p, P as m, Pn as h, Pt as g, Tn as _, _ as v, a as y, c as b, ct as x, d as S, dt as C, f as w, g as T, gn as E, h as D, hn as O, i as k, it as A, j as ne, jn as j, jt as M, kt as N, l as P, lt as F, m as I, n as L, nt as R, o as z, ot as B, p as V, r as H, rt as U, s as W, st as G, t as K, u as q, ut as J, v as Y } from "./v1-CbLDWK6q.js";
2
- import { n as X, t as Z } from "./lint-CV3DmM0X.js";
1
+ import { A as e, An as t, At as n, C as r, Dn as i, E as a, Fn as o, Ft as ee, Ln as te, Mn as s, Mt as c, N as l, Nn as u, Nt as d, On as f, Ot as p, P as m, Pn as h, Pt as g, Tn as _, _ as v, a as y, c as b, ct as x, d as S, dt as C, f as w, g as T, gn as E, h as D, hn as O, i as k, it as A, j as ne, jn as j, jt as M, kt as N, l as P, lt as F, m as I, n as L, nt as R, o as z, ot as B, p as V, r as H, rt as U, s as W, st as G, t as K, u as q, ut as J, v as Y } from "./v1--XVVNQh9.js";
2
+ import { a as X, i as Z } from "./brandGuide-DgoZ7spo.js";
3
3
  //#region src/v2/compile/react.ts
4
4
  var re = /^[A-Z][A-Za-z0-9]*$/, Q = (e) => JSON.stringify(e);
5
5
  function ie(e) {
package/dist/v2-strata.js CHANGED
@@ -1,2 +1,3 @@
1
- import { a as e, c as t, d as n, i as r, l as i, n as a, o, r as s, s as c, t as l, u } from "./client-4pKkAJ3Y.js";
2
- export { l as StrataError, c as applySync, t as baseOf, a as componentFromStrata, s as createStrataClient, i as hasAnything, o as planAutoUpdate, u as planSync, r as projectFromStrata, n as summarize, e as tokenFromStrata };
1
+ import { n as e, r as t, t as n } from "./brandGuide-DgoZ7spo.js";
2
+ import { a as r, c as i, d as a, i as o, l as s, n as c, o as l, r as u, s as d, t as f, u as p } from "./client-B1Crj0DN.js";
3
+ export { f as StrataError, d as applySync, i as baseOf, n as brandCss, e as brandGuidelines, t as brandScss, c as componentFromStrata, u as createStrataClient, s as hasAnything, l as planAutoUpdate, p as planSync, o as projectFromStrata, a as summarize, r as tokenFromStrata };