@charisol/plexo-sdk 2.0.25 → 2.0.26

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,9 @@
1
+ import React from 'react';
2
+ /**
3
+ * Choose which product to sell from the owner's own list (picture, name, price), instead of typing a code. The list comes from
4
+ * the host (`products.list`); with no host list it falls back to a plain box so a standalone editor still works.
5
+ */
6
+ export declare const ProductPicker: React.FC<{
7
+ value: string;
8
+ onChange: (id: string) => void;
9
+ }>;
@@ -42,6 +42,16 @@ export interface LinkTarget {
42
42
  label: string;
43
43
  href: string;
44
44
  }
45
+ /** One thing the owner can sell, as the host lists it. The host formats the price, so the SDK knows nothing about currencies. */
46
+ export interface ProductChoice {
47
+ id: string;
48
+ name: string;
49
+ /** Already formatted for display, e.g. "$49.00" or "From $10". */
50
+ priceLabel?: string;
51
+ imageUrl?: string;
52
+ /** Free-form tag the host may use (e.g. "PHYSICAL", "COURSE"); the picker doesn't interpret it. */
53
+ kind?: string;
54
+ }
45
55
  export interface CommentTarget {
46
56
  nodeId: string;
47
57
  nodeType: string;
@@ -177,6 +187,18 @@ export interface V2HostConfig {
177
187
  colors?: string[];
178
188
  /** Pages/anchors the link picker offers (the host knows its routes). */
179
189
  linkTargets?: LinkTarget[];
190
+ /**
191
+ * The products the owner can sell, for the "Sell a product" section and the product block. The editor shows them as a searchable
192
+ * list (picture, name, price) instead of asking the owner to type a code. Absent → a plain text box, so a standalone editor still works.
193
+ */
194
+ products?: {
195
+ /** Loads the owner's products. Called when a picker opens, so the list is always fresh. A rejection shows a friendly "couldn't load" message with a retry. */
196
+ list: () => Promise<ProductChoice[]>;
197
+ /** Shows a "create a product" button when the owner has none (or wants another). Absent → no button. */
198
+ onCreate?: () => void;
199
+ /** That button's text. Default "Create a product". */
200
+ createLabel?: string;
201
+ };
180
202
  /** Viewer/commenter role: no editing, no property panels, no Save. */
181
203
  readOnly?: boolean;
182
204
  /** Clicking a node reports it via onRequestComment instead of selecting it. */
@@ -9,7 +9,7 @@
9
9
  export { V2Editor } from './V2Editor';
10
10
  export type { V2EditorProps, V2EditorRef } from './V2Editor';
11
11
  export type { V2Theme } from './theme/theme';
12
- export type { V2HostConfig, SaveState, StockImageProvider, StockImageResult, LibrarySection, MediaAsset, LinkTarget, CommentTarget, AskSolContext, AskSolIo, PageSource, HostPage, HostShell, } from './host/HostContext';
12
+ export type { V2HostConfig, SaveState, StockImageProvider, StockImageResult, LibrarySection, MediaAsset, LinkTarget, ProductChoice, CommentTarget, AskSolContext, AskSolIo, PageSource, HostPage, HostShell, } from './host/HostContext';
13
13
  export type { DocumentNode, PageDefinition, NodeType, ElementStyles, ViewportMode, } from './types/editor';
14
14
  export { convertLegacyDesign, isLegacyDesign } from './migrate/legacy';
15
15
  export type { LegacyDesign } from './migrate/legacy';
@@ -23,7 +23,7 @@ export interface DynamicProps {
23
23
  productId?: string;
24
24
  /** booking: which service to book. */
25
25
  serviceId?: string;
26
- /** product: 'detail' (a full product page), 'bare' (just the buy button); shopGrid: 'dark' cards. */
26
+ /** product: 'buy' (a card with a Buy now button and quick checkout), 'detail' (a full product page), 'bare' (just the buy button); shopGrid: 'dark' cards. */
27
27
  mode?: string;
28
28
  /** shopGrid: false → a small curated grid instead of the full searchable store. */
29
29
  storeMode?: boolean;
@@ -0,0 +1,2 @@
1
+ import type { KindDef } from '../types';
2
+ export declare const productOffer: KindDef;
@@ -5,7 +5,7 @@ import type { DocumentNode } from '../types/editor';
5
5
  * the layout keeps the words, editing is a plain form (or typing right on the page), the section is responsive by
6
6
  * construction, and an AI can change one safely by editing its content instead of guessing at layout.
7
7
  */
8
- export type SectionKind = 'announcement' | 'header' | 'hero' | 'logos' | 'features' | 'about' | 'stats' | 'steps' | 'gallery' | 'video' | 'testimonials' | 'pricing' | 'team' | 'faq' | 'cta' | 'contact' | 'footer' | 'blogList' | 'blogArticle' | 'shop' | 'productPage' | 'cartCheckout' | 'orderConfirmation' | 'orderTracking' | 'funnelSignup' | 'emailHeader' | 'emailHero' | 'emailText' | 'emailFeatures' | 'emailCta' | 'emailImage' | 'emailFooter';
8
+ export type SectionKind = 'announcement' | 'header' | 'hero' | 'logos' | 'features' | 'about' | 'stats' | 'steps' | 'gallery' | 'video' | 'testimonials' | 'pricing' | 'team' | 'faq' | 'cta' | 'contact' | 'footer' | 'blogList' | 'blogArticle' | 'shop' | 'productPage' | 'productOffer' | 'cartCheckout' | 'orderConfirmation' | 'orderTracking' | 'funnelSignup' | 'emailHeader' | 'emailHero' | 'emailText' | 'emailFeatures' | 'emailCta' | 'emailImage' | 'emailFooter';
9
9
  export type SectionBackground = 'canvas' | 'surface' | 'sunken' | 'primary' | 'inverted' | 'gradient' | 'image';
10
10
  export interface BlockStyle {
11
11
  /** Which of the brand's surfaces the section sits on. */
@@ -44,7 +44,7 @@ export interface BlockSpec {
44
44
  overrides?: Record<string, NodeOverride>;
45
45
  }
46
46
  /** What a person edits. Drives the content form, validation, and the schema an AI works against. */
47
- export type FieldType = 'text' | 'longtext' | 'image' | 'link' | 'button' | 'icon' | 'toggle' | 'select' | 'list';
47
+ export type FieldType = 'text' | 'longtext' | 'image' | 'link' | 'button' | 'icon' | 'toggle' | 'select' | 'list' | 'product';
48
48
  export interface FieldDef {
49
49
  key: string;
50
50
  label: string;
@@ -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-DzPIZH4r.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-CvbzlaB_.js";
2
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);