@charisol/plexo-sdk 2.0.22 → 2.0.24
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/dist/{InlineColorPicker-BaWBhgH4.js → InlineColorPicker-x6ODuEQD.js} +554 -321
- package/dist/{lint-CV3DmM0X.js → brandGuide-DgoZ7spo.js} +109 -78
- package/dist/{client-4pKkAJ3Y.js → client-DUSU8g5z.js} +121 -99
- package/dist/index.js +13198 -13275
- package/dist/plexo-sdk.css +1 -1
- package/dist/utilities/playground.interfaces.d.ts +2 -1
- package/dist/{v1-CBDSeo-a.js → v1--XVVNQh9.js} +2171 -2170
- package/dist/v2/components/design/AssetsView.d.ts +7 -0
- package/dist/v2/components/design/BrandGuideCard.d.ts +6 -0
- package/dist/v2/components/design/ReviewView.d.ts +1 -1
- package/dist/v2/components/design/StrataCard.d.ts +1 -0
- package/dist/v2/components/design/useStrataSync.d.ts +4 -0
- package/dist/v2/components/fonts/FontPicker.d.ts +2 -6
- package/dist/v2/sol/describe.d.ts +2 -0
- package/dist/v2/sol/prompt.d.ts +1 -1
- package/dist/v2/strata/brandGuide.d.ts +7 -0
- package/dist/v2/strata/client.d.ts +12 -1
- package/dist/v2/strata/index.d.ts +1 -0
- package/dist/v2/strata/types.d.ts +23 -0
- package/dist/v2-compile.js +2 -2
- package/dist/v2-strata.js +3 -2
- package/dist/v2.js +3368 -2895
- package/package.json +1 -1
|
@@ -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;
|
|
@@ -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
|
}>;
|
|
@@ -27,6 +27,8 @@ export interface SolDesignSummary {
|
|
|
27
27
|
bodyFont?: string;
|
|
28
28
|
neutrals: string;
|
|
29
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;
|
|
30
32
|
};
|
|
31
33
|
}
|
|
32
34
|
export interface SolElementSummary {
|
package/dist/v2/sol/prompt.d.ts
CHANGED
|
@@ -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\", \"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- 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.";
|
|
@@ -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;
|
package/dist/v2-compile.js
CHANGED
|
@@ -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
|
|
2
|
-
import {
|
|
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 {
|
|
2
|
-
|
|
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-DUSU8g5z.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 };
|