@charisol/plexo-sdk 1.1.6 → 1.1.7

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/index.js CHANGED
@@ -624,6 +624,7 @@ async function Ve(e) {
624
624
  prompt: e.prompt,
625
625
  templateKind: e.templateKind,
626
626
  context: e.context,
627
+ isBlogLayout: e.isBlogLayout,
627
628
  tier: e.tier,
628
629
  externalUserId: e.externalUserId
629
630
  })
@@ -636,47 +637,49 @@ async function Ve(e) {
636
637
  }
637
638
  //#endregion
638
639
  //#region src/utilities/useAIAction.ts
639
- function He({ apiKey: e, templateKind: t, tier: n, externalUserId: r, onApply: i }) {
640
- let [a, o] = A("idle"), [s, c] = A(""), [l, u] = A(""), d = k(null), f = fe(async (a, s, l) => {
641
- d.current = {
642
- mode: a,
643
- prompt: s,
644
- context: l
645
- }, o("loading"), u("");
640
+ function He({ apiKey: e, templateKind: t, isBlogLayout: n, tier: r, externalUserId: i, onApply: a }) {
641
+ let [o, s] = A("idle"), [c, l] = A(""), [u, d] = A(""), f = k(null), p = fe(async (o, c, u) => {
642
+ f.current = {
643
+ mode: o,
644
+ prompt: c,
645
+ context: u
646
+ }, s("loading"), d("");
646
647
  try {
647
- let { summary: u, result: d } = await Ve({
648
+ let { summary: d, result: f } = await Ve({
648
649
  apiKey: e,
649
- mode: a,
650
- prompt: s,
650
+ mode: o,
651
+ prompt: c,
651
652
  templateKind: t,
652
- context: l,
653
- tier: n,
654
- externalUserId: r
653
+ context: u,
654
+ isBlogLayout: n,
655
+ tier: r,
656
+ externalUserId: i
655
657
  });
656
- i(d), c(u), o("success");
658
+ a(f), l(d), s("success");
657
659
  } catch (e) {
658
- u(e instanceof Error ? e.message : "AI request failed."), o("error");
660
+ d(e instanceof Error ? e.message : "AI request failed."), s("error");
659
661
  }
660
662
  }, [
661
663
  e,
662
664
  t,
663
665
  n,
664
666
  r,
665
- i
667
+ i,
668
+ a
666
669
  ]);
667
670
  return {
668
- status: a,
669
- summary: s,
670
- error: l,
671
- run: f,
671
+ status: o,
672
+ summary: c,
673
+ error: u,
674
+ run: p,
672
675
  retry: fe(() => {
673
- if (d.current) {
674
- let { mode: e, prompt: t, context: n } = d.current;
675
- f(e, t, n);
676
+ if (f.current) {
677
+ let { mode: e, prompt: t, context: n } = f.current;
678
+ p(e, t, n);
676
679
  }
677
- }, [f]),
680
+ }, [p]),
678
681
  reset: fe(() => {
679
- o("idle"), c(""), u("");
682
+ s("idle"), l(""), d("");
680
683
  }, [])
681
684
  };
682
685
  }
@@ -56233,6 +56236,7 @@ var zW = (e) => ({ body: {
56233
56236
  let gn = He({
56234
56237
  apiKey: ot(),
56235
56238
  templateKind: ft,
56239
+ isBlogLayout: fe,
56236
56240
  tier: lt.tier,
56237
56241
  externalUserId: y,
56238
56242
  onApply: (e) => {
@@ -7,6 +7,9 @@ export interface AIActionRequest {
7
7
  prompt: string;
8
8
  templateKind: 'EMAIL' | 'LANDING_PAGE';
9
9
  context: ElementJSON | TemplateJSON;
10
+ /** True only when editing an actual blog post template — lets the server offer the
11
+ * blog_* placeholder block types (blog_title, blog_content, etc.) to the model. */
12
+ isBlogLayout?: boolean;
10
13
  /** Optional tier override (AUTO | BASIC | MEDIUM | HIGH); omit to use the account default. */
11
14
  tier?: string;
12
15
  /**
@@ -4,6 +4,8 @@ export type AIActionStatus = 'idle' | 'loading' | 'success' | 'error';
4
4
  interface UseAIActionOptions {
5
5
  apiKey: string;
6
6
  templateKind: 'EMAIL' | 'LANDING_PAGE';
7
+ /** True only when editing an actual blog post template — see AIActionRequest.isBlogLayout. */
8
+ isBlogLayout?: boolean;
7
9
  tier?: string;
8
10
  /** Host's own end-user id — see PlexoBuilderProps.externalUserId. */
9
11
  externalUserId?: string;
@@ -22,5 +24,5 @@ interface UseAIActionResult {
22
24
  * "Edit with AI" popup and the whole-layout prompt bar: idle -> loading -> success/error,
23
25
  * with the last request remembered so the caller's bubble can offer a Retry button.
24
26
  */
25
- export declare function useAIAction({ apiKey, templateKind, tier, externalUserId, onApply }: UseAIActionOptions): UseAIActionResult;
27
+ export declare function useAIAction({ apiKey, templateKind, isBlogLayout, tier, externalUserId, onApply }: UseAIActionOptions): UseAIActionResult;
26
28
  export {};
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@charisol/plexo-sdk",
3
3
  "private": false,
4
- "version": "1.1.6",
4
+ "version": "1.1.7",
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",