@charisol/plexo-sdk 2.0.20 → 2.0.21

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.
@@ -14,6 +14,11 @@ export interface ApplyResult {
14
14
  designSystem: DesignSystem;
15
15
  results: CommandResult[];
16
16
  }
17
+ /** Exported for the commands' plain-language summary. */
18
+ export declare function elementLabel(pages: PageDefinition[], nodeId: string): {
19
+ label: string;
20
+ page?: string;
21
+ };
17
22
  /**
18
23
  * Applies SOL's suggested changes. Pure and immutable; never throws. Each command is checked on its own: good ones apply,
19
24
  * bad ones are reported in plain English and leave everything else untouched.
@@ -9,6 +9,15 @@ 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). */
13
+ elements?: SolElementSummary[];
14
+ }
15
+ export interface SolElementSummary {
16
+ id: string;
17
+ type: string;
18
+ text?: string;
19
+ href?: string;
20
+ alt?: string;
12
21
  }
13
22
  export interface SolDesignSummary {
14
23
  pages: Array<{
@@ -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\": \"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: you may move, copy or remove them but not edit their content. Add a new section instead.\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\", \"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.";
@@ -59,6 +59,32 @@ 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. */
63
+ export declare const updateElementSchema: z.ZodObject<{
64
+ op: z.ZodLiteral<"updateElement">;
65
+ nodeId: z.ZodString;
66
+ text: z.ZodOptional<z.ZodString>;
67
+ href: z.ZodOptional<z.ZodString>;
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>>;
87
+ }, z.core.$strip>;
62
88
  export declare const removeSectionSchema: z.ZodObject<{
63
89
  op: z.ZodLiteral<"removeSection">;
64
90
  sectionId: z.ZodString;
@@ -145,6 +171,30 @@ export declare const solCommandSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
145
171
  }>>;
146
172
  pinned: z.ZodOptional<z.ZodBoolean>;
147
173
  }, z.core.$strict>>;
174
+ }, z.core.$strip>, z.ZodObject<{
175
+ op: z.ZodLiteral<"updateElement">;
176
+ nodeId: z.ZodString;
177
+ text: z.ZodOptional<z.ZodString>;
178
+ href: z.ZodOptional<z.ZodString>;
179
+ 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>>;
148
198
  }, z.core.$strip>, z.ZodObject<{
149
199
  op: z.ZodLiteral<"removeSection">;
150
200
  sectionId: z.ZodString;
@@ -1,4 +1,4 @@
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-DQojvrOj.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-CbLDWK6q.js";
2
2
  import { n as X, t as Z } from "./lint-CV3DmM0X.js";
3
3
  //#region src/v2/compile/react.ts
4
4
  var re = /^[A-Z][A-Za-z0-9]*$/, Q = (e) => JSON.stringify(e);
package/dist/v2.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { $ as e, $t as t, A as n, At as r, B as i, Bt as a, C as o, Ct as s, D as c, Dt as l, E as u, Et as d, F as f, Ft as p, G as m, Gt as h, H as g, Ht as _, I as v, It as y, J as b, Jt as x, K as S, Kt as C, L as w, Lt as T, M as E, Mt as D, N as O, Nt as k, O as A, Ot as j, P as M, Pt as N, Q as P, Qt as ee, R as F, Rt as te, S as ne, St as re, T as I, Tt as ie, U as L, Ut as R, V as ae, Vt as oe, W as se, Wt as ce, X as le, Xt as ue, Y as de, Yt as fe, Z as z, Zt as pe, _ as me, _t as he, a as ge, an as _e, at as ve, b as ye, bt as be, c as xe, ct as Se, d as Ce, dt as we, en as Te, et as Ee, f as De, ft as Oe, g as ke, gt as Ae, h as je, ht as Me, i as Ne, in as Pe, it as Fe, j as Ie, jt as Le, k as Re, kt as ze, l as Be, lt as Ve, m as He, mt as Ue, nn as We, nt as Ge, o as Ke, ot as qe, p as Je, pt as Ye, q as B, qt as Xe, r as Ze, rn as Qe, rt as V, s as $e, st as et, t as tt, tn as nt, tt as rt, u as it, ut as at, v as ot, vt as st, w as ct, wt as lt, x as ut, xt as dt, y as ft, yt as pt, z as mt, zt as ht } from "./InlineColorPicker-BaWBhgH4.js";
2
2
  import { a as gt, o as _t } from "./colorUtils-BaVkGjFC.js";
3
- import { $ as vt, $t as yt, A as bt, An as xt, At as St, B as Ct, Bt as wt, C as Tt, Cn as Et, Ct as Dt, D as Ot, Dn as kt, Dt as At, E as jt, En as Mt, Et as Nt, F as Pt, Ft, G as It, Gt as Lt, H as Rt, Ht as zt, I as Bt, In as Vt, It as Ht, J as Ut, Jt as Wt, K as Gt, Kt, L as qt, Ln as Jt, Lt as Yt, M as Xt, Mn as Zt, Mt as Qt, N as $t, Nn as en, Nt as tn, O as nn, On as rn, Ot as an, Pn as on, Pt as sn, Q as cn, Qt as ln, R as un, Rn as dn, Rt as fn, S as pn, Sn as mn, St as hn, T as gn, Tn as _n, Tt as vn, U as yn, Ut as bn, V as xn, Vt as Sn, W as Cn, Wt as wn, X as Tn, Xt as En, Y as Dn, Yt as On, Z as kn, Zt as An, _n as jn, _t as Mn, an as Nn, at as Pn, b as Fn, bn as In, bt as Ln, c as Rn, cn as zn, ct as Bn, d as Vn, dn as Hn, en as Un, et as Wn, f as Gn, fn as Kn, ft as qn, g as Jn, gn as Yn, gt as Xn, h as Zn, ht as Qn, in as $n, it as er, j as tr, jn as nr, jt as rr, k as ir, kn as ar, kt as or, l as sr, ln as cr, lt as lr, m as ur, mn as dr, mt as fr, n as pr, nn as mr, nt as hr, on as gr, ot as _r, p as vr, pn as yr, pt as br, q as xr, qt as Sr, r as Cr, rn as wr, rt as Tr, s as Er, sn as Dr, st as Or, t as kr, tn as Ar, tt as jr, u as Mr, un as Nr, ut as Pr, vn as Fr, vt as Ir, w as Lr, wn as Rr, wt as zr, x as Br, xn as Vr, xt as Hr, y as Ur, yn as Wr, yt as Gr, z as Kr, zt as qr } from "./v1-DQojvrOj.js";
3
+ import { $ as vt, $t as yt, A as bt, An as xt, At as St, B as Ct, Bt as wt, C as Tt, Cn as Et, Ct as Dt, D as Ot, Dn as kt, Dt as At, E as jt, En as Mt, Et as Nt, F as Pt, Ft, G as It, Gt as Lt, H as Rt, Ht as zt, I as Bt, In as Vt, It as Ht, J as Ut, Jt as Wt, K as Gt, Kt, L as qt, Ln as Jt, Lt as Yt, M as Xt, Mn as Zt, Mt as Qt, N as $t, Nn as en, Nt as tn, O as nn, On as rn, Ot as an, Pn as on, Pt as sn, Q as cn, Qt as ln, R as un, Rn as dn, Rt as fn, S as pn, Sn as mn, St as hn, T as gn, Tn as _n, Tt as vn, U as yn, Ut as bn, V as xn, Vt as Sn, W as Cn, Wt as wn, X as Tn, Xt as En, Y as Dn, Yt as On, Z as kn, Zt as An, _n as jn, _t as Mn, an as Nn, at as Pn, b as Fn, bn as In, bt as Ln, c as Rn, cn as zn, ct as Bn, d as Vn, dn as Hn, en as Un, et as Wn, f as Gn, fn as Kn, ft as qn, g as Jn, gn as Yn, gt as Xn, h as Zn, ht as Qn, in as $n, it as er, j as tr, jn as nr, jt as rr, k as ir, kn as ar, kt as or, l as sr, ln as cr, lt as lr, m as ur, mn as dr, mt as fr, n as pr, nn as mr, nt as hr, on as gr, ot as _r, p as vr, pn as yr, pt as br, q as xr, qt as Sr, r as Cr, rn as wr, rt as Tr, s as Er, sn as Dr, st as Or, t as kr, tn as Ar, tt as jr, u as Mr, un as Nr, ut as Pr, vn as Fr, vt as Ir, w as Lr, wn as Rr, wt as zr, x as Br, xn as Vr, xt as Hr, y as Ur, yn as Wr, yt as Gr, z as Kr, zt as qr } from "./v1-CbLDWK6q.js";
4
4
  import { A as Jr, C as Yr, D as Xr, E as Zr, F as Qr, I as $r, L as ei, M as ti, N as ni, O as ri, P as ii, S as ai, T as oi, _ as si, a as ci, b as li, c as ui, d as di, f as fi, g as pi, h as mi, i as hi, j as gi, k as _i, l as vi, m as yi, n as bi, o as xi, p as Si, r as Ci, s as wi, t as Ti, u as Ei, v as Di, w as Oi, x as ki, y as Ai } from "./lint-CV3DmM0X.js";
5
5
  import { d as ji, o as Mi, s as Ni, t as Pi, u as Fi } from "./client-4pKkAJ3Y.js";
6
6
  import Ii, { createContext as Li, forwardRef as Ri, useCallback as H, useContext as zi, useDeferredValue as Bi, useEffect as U, useImperativeHandle as Vi, useLayoutEffect as Hi, useMemo as W, useRef as G, useState as K } from "react";
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@charisol/plexo-sdk",
3
3
  "private": false,
4
- "version": "2.0.20",
4
+ "version": "2.0.21",
5
5
  "description": "Plexo visual email and landing page builder SDK — drag-and-drop template editor with AI integration.",
6
6
  "keywords": [
7
7
  "email-builder",