@chaibuilder/sdk 1.2.18 → 1.2.20

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.
Files changed (101) hide show
  1. package/dist/{AddBlocks-uCdu9Xpr.js → AddBlocks-VIWJkaHJ.js} +24 -25
  2. package/dist/AddBlocks-X9eh8OWJ.cjs +1 -0
  3. package/dist/{BrandingOptions-JbHRN7V5.js → BrandingOptions-5ss0k1nb.js} +12 -13
  4. package/dist/BrandingOptions-PzPdafIT.cjs +1 -0
  5. package/dist/CanvasArea-TTGqlBKO.js +908 -0
  6. package/dist/CanvasArea-hoyr4dfb.cjs +55 -0
  7. package/dist/CurrentPage-EddxgHU-.cjs +1 -0
  8. package/dist/{CurrentPage-AlOLPG4o.js → CurrentPage-a3T2uy8Q.js} +10 -12
  9. package/dist/ListTree-kergCZrw.js +126 -0
  10. package/dist/ListTree-tADrgsqZ.cjs +1 -0
  11. package/dist/Outline-3IHYlOzF.cjs +1 -0
  12. package/dist/Outline-rNFJGkap.js +294 -0
  13. package/dist/{PagesPanel-VbSQHEu_.js → PagesPanel-0bL28ofN.js} +5 -7
  14. package/dist/PagesPanel-B33hWN11.cjs +1 -0
  15. package/dist/ProjectPanel-qtRTXNOP.cjs +1 -0
  16. package/dist/{ProjectPanel-fqux215P.js → ProjectPanel-sBRkUXnY.js} +15 -17
  17. package/dist/{Settings-IhWI1ice.js → Settings-HgGe1ANj.js} +587 -554
  18. package/dist/Settings-rXxS3RGM.cjs +1 -0
  19. package/dist/{SidePanels-lMCXrchR.js → SidePanels-R_g9rSjP.js} +132 -134
  20. package/dist/SidePanels-aAm-2A3s.cjs +1 -0
  21. package/dist/{Topbar-DYiisBtw.js → Topbar-AUTKpVHO.js} +3 -4
  22. package/dist/Topbar-cXtxVswU.cjs +1 -0
  23. package/dist/TypeIcon-ElNNPazl.cjs +1 -0
  24. package/dist/TypeIcon-qO96rNbV.js +69 -0
  25. package/dist/{UnsplashImages-lGLcqo4M.js → UnsplashImages-1RFHZIte.js} +13 -14
  26. package/dist/UnsplashImages-p34UJJWJ.cjs +1 -0
  27. package/dist/UploadImages-CLfyNo1i.cjs +1 -0
  28. package/dist/{UploadImages-06m6vjbL.js → UploadImages-G2orrhmZ.js} +8 -9
  29. package/dist/{add-page-modal-mEbIXSKX.js → add-page-modal-DUthvJNJ.js} +7 -9
  30. package/dist/add-page-modal-KCy_Khfe.cjs +1 -0
  31. package/dist/confirm-alert-T8vimDRx.cjs +1 -0
  32. package/dist/{confirm-alert-YETlIRpE.js → confirm-alert-nk2WQHud.js} +3 -4
  33. package/dist/{controls-Dy1qa8Dc.cjs → controls-KK2oLIa8.cjs} +1 -1
  34. package/dist/{controls-XPXGHKht.js → controls-OfJWSEqC.js} +29 -28
  35. package/dist/core.cjs +1 -1
  36. package/dist/core.d.ts +2 -1
  37. package/dist/core.js +45 -47
  38. package/dist/defaultTheme-7Lk2zq60.cjs +1 -0
  39. package/dist/{defaultTheme-s0cpA5Oy.js → defaultTheme-gunU_Fe5.js} +31 -33
  40. package/dist/{delete-page-modal-J_SmPWrw.js → delete-page-modal-WvWRQUgU.js} +8 -10
  41. package/dist/delete-page-modal-_pFjWLJn.cjs +1 -0
  42. package/dist/email-blocks.cjs +1 -1
  43. package/dist/email-blocks.js +81 -81
  44. package/dist/email.cjs +1 -1
  45. package/dist/email.d.ts +2 -0
  46. package/dist/email.js +4 -6
  47. package/dist/{form-Y0Vb4m04.cjs → form-YnnWtUGk.cjs} +1 -1
  48. package/dist/{form-2xJcQs_Y.js → form-kXQX4L2W.js} +1 -1
  49. package/dist/{index-627XtO9e.js → index--Pt4B5bv.js} +3 -3
  50. package/dist/index-DeHH1q_1.cjs +1 -0
  51. package/dist/{index-3TQsdso6.cjs → index-JqRQZLN5.cjs} +1 -1
  52. package/dist/{index-LF3KXx4u.js → index-QIbDWoML.js} +8308 -8162
  53. package/dist/{index-ZwpjuB-N.cjs → index-e5cgISUO.cjs} +51 -51
  54. package/dist/{index-ZBqiaKhx.js → index-la4rqGKN.js} +802 -794
  55. package/dist/lib.cjs +1 -1
  56. package/dist/lib.js +1 -1
  57. package/dist/page-viewer-6phtctz6.cjs +1 -0
  58. package/dist/{page-viewer-7u0SWWmO.js → page-viewer-s_lHBVfx.js} +6 -8
  59. package/dist/project-general-setting-SaNOMXEl.cjs +1 -0
  60. package/dist/{project-general-setting-SqC85J7F.js → project-general-setting-gj4A0X5W.js} +7 -9
  61. package/dist/{project-seo-setting-TlQherop.js → project-seo-setting-aCPg-IIc.js} +5 -6
  62. package/dist/project-seo-setting-bMDdgKRZ.cjs +1 -0
  63. package/dist/render.cjs +1 -1
  64. package/dist/render.d.ts +10 -0
  65. package/dist/render.js +164 -78
  66. package/dist/{single-page-detail-ClZYIdSO.js → single-page-detail-TP-cxVIT.js} +36 -38
  67. package/dist/single-page-detail-er8i2FIF.cjs +1 -0
  68. package/dist/studio.cjs +1 -1
  69. package/dist/studio.d.ts +2 -0
  70. package/dist/studio.js +4 -6
  71. package/dist/ui.cjs +1 -1
  72. package/dist/ui.d.ts +1 -1
  73. package/dist/ui.js +130 -131
  74. package/dist/{useAddBlockByDrop-E343zoB3.cjs → useAddBlockByDrop-LSV8adwE.cjs} +1 -1
  75. package/dist/{useAddBlockByDrop-sPX4lN-O.js → useAddBlockByDrop-_vczk5o_.js} +1 -1
  76. package/dist/web-blocks.cjs +1 -1
  77. package/dist/web-blocks.js +1 -1
  78. package/package.json +4 -14
  79. package/dist/AddBlocks-5Q5w5lPJ.cjs +0 -1
  80. package/dist/BrandingOptions-xrGQI1Kn.cjs +0 -1
  81. package/dist/CanvasArea-aWzbzB9p.js +0 -1403
  82. package/dist/CanvasArea-oUIvLfdq.cjs +0 -60
  83. package/dist/CurrentPage-atmd8UrZ.cjs +0 -1
  84. package/dist/Outline-oGoAdnBw.js +0 -355
  85. package/dist/Outline-uMUTwN-R.cjs +0 -1
  86. package/dist/PagesPanel-nN3QUwXp.cjs +0 -1
  87. package/dist/ProjectPanel-UIEFhref.cjs +0 -1
  88. package/dist/Settings-8qUW0Iow.cjs +0 -1
  89. package/dist/SidePanels-cOHgPE9y.cjs +0 -1
  90. package/dist/Topbar-vLD-rWl5.cjs +0 -1
  91. package/dist/UnsplashImages-1JWfKlBc.cjs +0 -1
  92. package/dist/UploadImages-T4MYMOhW.cjs +0 -1
  93. package/dist/add-page-modal-niwhffYL.cjs +0 -1
  94. package/dist/confirm-alert-ZpEIxh3X.cjs +0 -1
  95. package/dist/defaultTheme-1XwPZT2b.cjs +0 -1
  96. package/dist/delete-page-modal-sOqRlmKb.cjs +0 -1
  97. package/dist/index-T3wfa1kz.cjs +0 -1
  98. package/dist/page-viewer-6UDraUKW.cjs +0 -1
  99. package/dist/project-general-setting-AW5Vtmgx.cjs +0 -1
  100. package/dist/project-seo-setting-cWiNZcxW.cjs +0 -1
  101. package/dist/single-page-detail-kJUW6FE9.cjs +0 -1
@@ -1,21 +1,21 @@
1
- import { noop as f } from "lodash-es";
2
- import { j as l } from "./jsx-runtime-WbnYoNE9.js";
3
- import { Container as k, Section as y, Row as x, Column as B, Heading as C, Text as v, Button as j, Link as w, Preview as I, Markdown as L, Img as T, Hr as H, CodeBlock as R, CodeInline as _ } from "@react-email/components";
4
- import { registerChaiBlock as i } from "@chaibuilder/runtime";
1
+ import { noop as k } from "lodash-es";
2
+ import { j as o } from "./jsx-runtime-WbnYoNE9.js";
3
+ import { Container as f, Section as y, Row as x, Column as B, Heading as C, Text as v, Button as j, Link as w, Preview as E, Markdown as I, Img as L, Hr as T, CodeBlock as H, CodeInline as R } from "@react-email/components";
4
+ import { registerChaiBlock as r } from "@chaibuilder/runtime";
5
5
  import { E as m } from "./empty-slot-ZBlsQi6m.js";
6
- import { f as d, S as c, u as s, g as u, q as g, o as A, r as S } from "./controls-XPXGHKht.js";
7
- import { ImageIcon as p, HeadingIcon as P, TextIcon as h, Link1Icon as D, DividerHorizontalIcon as M, CodeSandboxLogoIcon as b } from "@radix-ui/react-icons";
6
+ import { s as d, S as a, u as s, g as u, q as g, o as _, r as A } from "./controls-OfJWSEqC.js";
7
+ import { ImageIcon as p, HeadingIcon as S, TextIcon as h, Link1Icon as P, DividerHorizontalIcon as D, CodeSandboxLogoIcon as b } from "@radix-ui/react-icons";
8
8
  import "./_commonjsHelpers-UyOWmZb0.js";
9
9
  import "react";
10
10
  import "./Functions-7jnEwJyw.js";
11
11
  import "clsx";
12
12
  import "tailwind-merge";
13
- const N = ({ blockProps: e, styles: t, children: o, inBuilder: n }) => {
14
- let r = o;
15
- return o || (r = /* @__PURE__ */ l.jsx(m, { blockProps: {}, styles: {}, inBuilder: n })), /* @__PURE__ */ l.jsx(k, { ...e, ...t, children: r });
13
+ const M = ({ blockProps: e, styles: t, children: l, inBuilder: i }) => {
14
+ let n = l;
15
+ return l || (n = /* @__PURE__ */ o.jsx(m, { blockProps: {}, styles: {}, inBuilder: i })), /* @__PURE__ */ o.jsx(f, { ...e, ...t, children: n });
16
16
  };
17
- i(N, {
18
- type: "Container",
17
+ r(M, {
18
+ type: "Email/Container",
19
19
  label: "Container",
20
20
  group: "basic",
21
21
  category: "core",
@@ -25,9 +25,9 @@ i(N, {
25
25
  canDuplicate: () => !1,
26
26
  canBeNested: (e) => !e
27
27
  });
28
- const E = ({ blockProps: e, styles: t, children: o }) => /* @__PURE__ */ l.jsx(y, { ...e, ...t, children: o });
29
- i(E, {
30
- type: "Section",
28
+ const N = ({ blockProps: e, styles: t, children: l }) => /* @__PURE__ */ o.jsx(y, { ...e, ...t, children: l });
29
+ r(N, {
30
+ type: "Email/Section",
31
31
  label: "Section",
32
32
  group: "basic",
33
33
  category: "core",
@@ -46,34 +46,34 @@ i(E, {
46
46
  },
47
47
  canAcceptBlock: () => !0
48
48
  });
49
- const $ = ({ blockProps: e, styles: t, children: o }) => /* @__PURE__ */ l.jsx(x, { ...e, ...t, children: o });
50
- i($, {
51
- type: "Row",
49
+ const $ = ({ blockProps: e, styles: t, children: l }) => /* @__PURE__ */ o.jsx(x, { ...e, ...t, children: l });
50
+ r($, {
51
+ type: "Email/Row",
52
52
  label: "Row",
53
53
  group: "basic",
54
54
  category: "core",
55
55
  icon: p,
56
56
  blocks: [
57
- { _type: "Row", _id: "a" },
58
- { _type: "Column", _id: "b", _parent: "a" }
57
+ { _type: "Email/Row", _id: "a" },
58
+ { _type: "Email/Column", _id: "b", _parent: "a" }
59
59
  ],
60
60
  props: {
61
- styles: c({ default: "" })
61
+ styles: a({ default: "" })
62
62
  },
63
- canAcceptBlock: (e) => e === "Column"
63
+ canAcceptBlock: (e) => e === "Email/Column"
64
64
  });
65
- const q = ({ blockProps: e, styles: t, children: o, align: n }) => {
66
- let r = o;
67
- return o || (r = /* @__PURE__ */ l.jsx(m, { blockProps: {}, styles: {} })), /* @__PURE__ */ l.jsx(B, { ...e, ...t, align: n, children: r });
65
+ const q = ({ blockProps: e, styles: t, children: l, align: i }) => {
66
+ let n = l;
67
+ return l || (n = /* @__PURE__ */ o.jsx(m, { blockProps: {}, styles: {} })), /* @__PURE__ */ o.jsx(B, { ...e, ...t, align: i, children: n });
68
68
  };
69
- i(q, {
70
- type: "Column",
69
+ r(q, {
70
+ type: "Email/Column",
71
71
  label: "Column",
72
72
  group: "basic",
73
73
  category: "core",
74
74
  icon: p,
75
75
  props: {
76
- styles: c({ default: "" }),
76
+ styles: a({ default: "" }),
77
77
  align: d({
78
78
  title: "Align",
79
79
  default: "",
@@ -86,19 +86,19 @@ i(q, {
86
86
  })
87
87
  },
88
88
  canAcceptBlock: () => !0,
89
- canBeNested: (e) => e === "Row"
89
+ canBeNested: (e) => e === "Email/Row"
90
90
  });
91
- const z = ({ level: e, blockProps: t, styles: o, content: n }) => /* @__PURE__ */ l.jsx(C, { as: e, ...t, ...o, children: n }), J = ({ blockProps: e, styles: t, content: o }) => /* @__PURE__ */ l.jsx("h1", { ...e, ...t, children: o });
92
- i(z, {
93
- type: "Heading",
91
+ const z = ({ level: e, blockProps: t, styles: l, content: i }) => /* @__PURE__ */ o.jsx(C, { as: e, ...t, ...l, children: i }), J = ({ blockProps: e, styles: t, content: l }) => /* @__PURE__ */ o.jsx("h1", { ...e, ...t, children: l });
92
+ r(z, {
93
+ type: "Email/Heading",
94
94
  label: "Heading",
95
95
  group: "basic",
96
96
  category: "core",
97
- icon: P,
97
+ icon: S,
98
98
  builderComponent: J,
99
99
  props: {
100
100
  content: s({ title: "Content", default: "Enter your heading here..." }),
101
- styles: c({ default: "text-xl" }),
101
+ styles: a({ default: "text-xl" }),
102
102
  level: d({
103
103
  title: "Level",
104
104
  default: "h1",
@@ -113,11 +113,11 @@ i(z, {
113
113
  ]
114
114
  })
115
115
  },
116
- canAcceptBlock: (e) => ["Link", "RawText"].includes(e)
116
+ canAcceptBlock: (e) => ["Email/Link", "Email/RawText"].includes(e)
117
117
  });
118
- const U = ({ blockProps: e, styles: t, content: o }) => /* @__PURE__ */ l.jsx(v, { ...e, ...t, children: o }), V = ({ content: e, blockProps: t, styles: o }) => /* @__PURE__ */ l.jsx("p", { ...t, ...o, children: e });
119
- i(U, {
120
- type: "Text",
118
+ const U = ({ blockProps: e, styles: t, content: l }) => /* @__PURE__ */ o.jsx(v, { ...e, ...t, children: l }), V = ({ content: e, blockProps: t, styles: l }) => /* @__PURE__ */ o.jsx("p", { ...t, ...l, children: e });
119
+ r(U, {
120
+ type: "Email/Text",
121
121
  label: "Text",
122
122
  group: "basic",
123
123
  category: "core",
@@ -128,13 +128,13 @@ i(U, {
128
128
  title: "Content",
129
129
  default: "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam in dui mauris. Vivamus hendrerit arcu sed erat molestie vehicula. Sed auctor neque eu tellus rhoncus ut eleifend nibh porttitor. Ut in nulla enim."
130
130
  }),
131
- styles: c({ default: "" })
131
+ styles: a({ default: "" })
132
132
  },
133
- canAcceptBlock: (e) => ["Link", "RawText"].includes(e)
133
+ canAcceptBlock: (e) => ["Email/Link", "Email/RawText"].includes(e)
134
134
  });
135
- const W = ({ content: e }) => e, F = ({ content: e, blockProps: t }) => /* @__PURE__ */ l.jsx("span", { ...t, children: e });
136
- i(W, {
137
- type: "RawText",
135
+ const W = ({ content: e }) => e, F = ({ content: e, blockProps: t }) => /* @__PURE__ */ o.jsx("span", { ...t, children: e });
136
+ r(W, {
137
+ type: "Email/RawText",
138
138
  label: "Raw Text",
139
139
  group: "basic",
140
140
  category: "core",
@@ -148,9 +148,9 @@ i(W, {
148
148
  })
149
149
  }
150
150
  });
151
- const G = ({ blockProps: e, styles: t, link: o, content: n }) => /* @__PURE__ */ l.jsx(j, { ...e, ...t, href: o.href, children: n }), K = ({ blockProps: e, styles: t, content: o }) => /* @__PURE__ */ l.jsx("button", { type: "button", ...e, ...t, children: o });
152
- i(G, {
153
- type: "Button",
151
+ const G = ({ blockProps: e, styles: t, link: l, content: i }) => /* @__PURE__ */ o.jsx(j, { ...e, ...t, href: l.href, children: i }), K = ({ blockProps: e, styles: t, content: l }) => /* @__PURE__ */ o.jsx("button", { type: "button", ...e, ...t, children: l });
152
+ r(G, {
153
+ type: "Email/Button",
154
154
  label: "Button",
155
155
  group: "basic",
156
156
  category: "core",
@@ -158,19 +158,19 @@ i(G, {
158
158
  props: {
159
159
  content: s({ title: "Content", default: "Click me" }),
160
160
  link: g({ title: "Link", default: { href: "https://chaibuilder.com", target: "_blank", type: "url" } }),
161
- styles: c({ default: "bg-primary text-white px-4 py-2 rounded-md" })
161
+ styles: a({ default: "bg-primary text-white px-4 py-2 rounded-md" })
162
162
  }
163
163
  });
164
- const O = ({ blockProps: e, styles: t, href: o, content: n, target: r, children: a }) => /* @__PURE__ */ l.jsx(w, { ...e, ...t, href: o, target: r, children: a || n }), Q = ({ blockProps: e, styles: t, content: o, children: n }) => {
165
- let r = n;
166
- return n || (r = /* @__PURE__ */ l.jsx(m, { blockProps: {}, styles: {} })), /* @__PURE__ */ l.jsx("span", { ...e, ...t, children: r || o });
164
+ const O = ({ blockProps: e, styles: t, href: l, content: i, target: n, children: c }) => /* @__PURE__ */ o.jsx(w, { ...e, ...t, href: l, target: n, children: c || i }), Q = ({ blockProps: e, styles: t, content: l, children: i }) => {
165
+ let n = i;
166
+ return i || (n = /* @__PURE__ */ o.jsx(m, { blockProps: {}, styles: {} })), /* @__PURE__ */ o.jsx("span", { ...e, ...t, children: n || l });
167
167
  };
168
- i(O, {
168
+ r(O, {
169
169
  type: "Link",
170
170
  label: "Link",
171
171
  group: "basic",
172
172
  category: "core",
173
- icon: D,
173
+ icon: P,
174
174
  blocks: [
175
175
  {
176
176
  _id: "a",
@@ -187,13 +187,13 @@ i(O, {
187
187
  props: {
188
188
  content: s({ title: "Content", default: "I am a link." }),
189
189
  link: g({ title: "Link", default: { href: "https://chaibuilder.com", target: "_blank", type: "url" } }),
190
- styles: c({ default: "font-bold text-blue-500" })
190
+ styles: a({ default: "font-bold text-blue-500" })
191
191
  },
192
192
  canAcceptBlock: () => !0
193
193
  });
194
- const X = ({ blockProps: e, styles: t, children: o }) => /* @__PURE__ */ l.jsx(I, { ...e, ...t, children: o }), Y = ({ blockProps: e, styles: t, content: o }) => /* @__PURE__ */ l.jsx("div", { ...e, ...t, children: o });
195
- i(X, {
196
- type: "Preview",
194
+ const X = ({ blockProps: e, styles: t, children: l }) => /* @__PURE__ */ o.jsx(E, { ...e, ...t, children: l }), Y = ({ blockProps: e, styles: t, content: l }) => /* @__PURE__ */ o.jsx("div", { ...e, ...t, children: l });
195
+ r(X, {
196
+ type: "Email/Preview",
197
197
  label: "Preview",
198
198
  group: "basic",
199
199
  category: "core",
@@ -204,9 +204,9 @@ i(X, {
204
204
  content: u({ default: "Preview content", title: "Content" })
205
205
  }
206
206
  });
207
- const Z = ({ blockProps: e, content: t }) => /* @__PURE__ */ l.jsx(L, { children: t, ...e });
208
- i(Z, {
209
- type: "Markdown",
207
+ const Z = ({ blockProps: e, content: t }) => /* @__PURE__ */ o.jsx(I, { children: t, ...e });
208
+ r(Z, {
209
+ type: "Email/Markdown",
210
210
  label: "Markdown",
211
211
  group: "basic",
212
212
  category: "core",
@@ -214,17 +214,17 @@ i(Z, {
214
214
  content: u({ default: "# This is a ~~strikethrough~~", title: "Markdown" })
215
215
  }
216
216
  });
217
- const ee = ({ blockProps: e, styles: t, alt: o, image: n, width: r, height: a }) => /* @__PURE__ */ l.jsx(T, { ...e, ...t, src: n, alt: o, width: r, height: a }), te = ({ blockProps: e, styles: t, alt: o, image: n, width: r, height: a }) => /* @__PURE__ */ l.jsx("img", { ...e, ...t, src: n, alt: o, width: r, height: a });
218
- i(ee, {
219
- type: "Image",
217
+ const ee = ({ blockProps: e, styles: t, alt: l, image: i, width: n, height: c }) => /* @__PURE__ */ o.jsx(L, { ...e, ...t, src: i, alt: l, width: n, height: c }), te = ({ blockProps: e, styles: t, alt: l, image: i, width: n, height: c }) => /* @__PURE__ */ o.jsx("img", { ...e, ...t, src: i, alt: l, width: n, height: c });
218
+ r(ee, {
219
+ type: "Email/Image",
220
220
  label: "Image",
221
221
  group: "basic",
222
222
  category: "core",
223
223
  icon: p,
224
224
  builderComponent: te,
225
225
  props: {
226
- styles: c({ default: "w-full" }),
227
- image: A({
226
+ styles: a({ default: "w-full" }),
227
+ image: _({
228
228
  title: "Image",
229
229
  default: "https://fakeimg.pl/400x200?text=Choose&font=bebas"
230
230
  }),
@@ -233,32 +233,32 @@ i(ee, {
233
233
  height: s({ title: "Height", default: "" })
234
234
  }
235
235
  });
236
- const oe = ({ blockProps: e, styles: t }) => /* @__PURE__ */ l.jsx(H, { ...e, ...t }), le = ({ blockProps: e, styles: t }) => /* @__PURE__ */ l.jsx("hr", { ...e, ...t });
237
- i(oe, {
238
- type: "Divider",
236
+ const le = ({ blockProps: e, styles: t }) => /* @__PURE__ */ o.jsx(T, { ...e, ...t }), oe = ({ blockProps: e, styles: t }) => /* @__PURE__ */ o.jsx("hr", { ...e, ...t });
237
+ r(le, {
238
+ type: "Email/Divider",
239
239
  label: "Divider",
240
240
  group: "basic",
241
241
  category: "core",
242
- icon: M,
243
- builderComponent: le,
242
+ icon: D,
243
+ builderComponent: oe,
244
244
  props: {
245
- styles: c({ default: "w-full h-2" })
245
+ styles: a({ default: "w-full h-2" })
246
246
  }
247
247
  });
248
- const ne = ({ blockProps: e, styles: t, code: o, lineNumbers: n, theme: r, language: a }) => /* @__PURE__ */ l.jsx(R, { ...e, ...t, code: o, linenumbers: n, theme: r, language: a }), re = ({ blockProps: e, styles: t, code: o }) => /* @__PURE__ */ l.jsx("div", { ...e, ...t, children: /* @__PURE__ */ l.jsx("code", { children: o }) });
249
- i(ne, {
250
- type: "CodeBlock",
248
+ const ie = ({ blockProps: e, styles: t, code: l, lineNumbers: i, theme: n, language: c }) => /* @__PURE__ */ o.jsx(H, { ...e, ...t, code: l, linenumbers: i, theme: n, language: c }), ne = ({ blockProps: e, styles: t, code: l }) => /* @__PURE__ */ o.jsx("div", { ...e, ...t, children: /* @__PURE__ */ o.jsx("code", { children: l }) });
249
+ r(ie, {
250
+ type: "Email/CodeBlock",
251
251
  label: "Code Block",
252
252
  group: "basic",
253
253
  category: "core",
254
254
  hidden: !0,
255
255
  icon: b,
256
- builderComponent: re,
256
+ builderComponent: ne,
257
257
  props: {
258
- styles: c({ default: "" }),
258
+ styles: a({ default: "" }),
259
259
  code: u({ title: "Code", default: "console.log('Hello, world!');" }),
260
260
  theme: s({ title: "Theme", default: "dracula" }),
261
- lineNumbers: S({
261
+ lineNumbers: A({
262
262
  title: "Line number",
263
263
  default: !1
264
264
  }),
@@ -275,20 +275,20 @@ i(ne, {
275
275
  })
276
276
  }
277
277
  });
278
- const ie = ({ blockProps: e, styles: t, code: o }) => /* @__PURE__ */ l.jsx(_, { ...e, ...t, children: o }), ce = ({ blockProps: e, styles: t, code: o }) => /* @__PURE__ */ l.jsx("code", { ...e, ...t, children: o });
279
- i(ie, {
280
- type: "CodeInline",
278
+ const re = ({ blockProps: e, styles: t, code: l }) => /* @__PURE__ */ o.jsx(R, { ...e, ...t, children: l }), ae = ({ blockProps: e, styles: t, code: l }) => /* @__PURE__ */ o.jsx("code", { ...e, ...t, children: l });
279
+ r(re, {
280
+ type: "Email/CodeInline",
281
281
  label: "Code Inline",
282
282
  group: "basic",
283
283
  category: "core",
284
284
  icon: b,
285
- builderComponent: ce,
285
+ builderComponent: ae,
286
286
  props: {
287
- styles: c({ default: "" }),
287
+ styles: a({ default: "" }),
288
288
  code: u({ title: "Code", default: "console.log('Hello, world!');" })
289
289
  }
290
290
  });
291
- const xe = f;
291
+ const xe = k;
292
292
  export {
293
293
  xe as loadEmailBlocks
294
294
  };
package/dist/email.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-Z_BpKhVy.cjs"),q=require("./index-ZwpjuB-N.cjs"),r=require("@radix-ui/react-icons");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("react");require("i18next");require("react-i18next");require("./index-T3wfa1kz.cjs");require("lodash-es");require("./Functions-N3yhPYKY.cjs");require("clsx");require("tailwind-merge");require("@chaibuilder/runtime");require("jotai");require("flat-to-nested");require("./MODIFIERS-9EwxLM8V.cjs");require("@react-hookz/web");require("@radix-ui/react-toggle");require("class-variance-authority");require("./Class-MmCxz2Ay.cjs");require("@radix-ui/react-switch");require("@radix-ui/react-slot");require("@radix-ui/react-accordion");require("@radix-ui/react-alert-dialog");require("@radix-ui/react-dialog");require("@radix-ui/react-label");require("@radix-ui/react-scroll-area");require("@radix-ui/react-tabs");require("@radix-ui/react-tooltip");require("@radix-ui/react-popover");require("@radix-ui/react-menubar");require("@radix-ui/react-hover-card");require("@radix-ui/react-select");require("@radix-ui/react-dropdown-menu");require("@radix-ui/react-separator");require("@radix-ui/react-toast");require("cmdk");require("@radix-ui/react-context-menu");require("react-icons-picker");require("react-dom");require("react-quill");require("@floating-ui/react-dom");require("react-textarea-autosize");require("flagged");require("react-dnd");require("@minoru/react-dnd-treeview");require("react-hotkeys-hook");const t=[{title:"Mobile",content:"Mobile email client",breakpoint:"xs",icon:e.jsxRuntimeExports.jsx(r.MobileIcon,{}),width:400},{title:"Email Client",content:"Content as seen inside an email client",breakpoint:"sm",icon:e.jsxRuntimeExports.jsx(r.MobileIcon,{className:"rotate-90"}),width:700}],n=i=>{const u={...i,importHTMLSupport:!1,dataBindingSupport:!1,breakpoints:t};return e.jsxRuntimeExports.jsx(q.ChaiBuilderEditor,{...u})};exports.ChaiBuilderEmail=n;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-Z_BpKhVy.cjs"),t=require("./index-e5cgISUO.cjs"),r=require("@radix-ui/react-icons");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("react");require("i18next");require("react-i18next");require("./index-DeHH1q_1.cjs");require("lodash-es");require("./Functions-N3yhPYKY.cjs");require("clsx");require("tailwind-merge");require("@chaibuilder/runtime");require("jotai");require("./MODIFIERS-9EwxLM8V.cjs");require("@react-hookz/web");require("@radix-ui/react-toggle");require("class-variance-authority");require("./Class-MmCxz2Ay.cjs");require("@radix-ui/react-switch");require("@radix-ui/react-slot");require("@radix-ui/react-accordion");require("@radix-ui/react-alert-dialog");require("@radix-ui/react-dialog");require("@radix-ui/react-label");require("@radix-ui/react-scroll-area");require("@radix-ui/react-tabs");require("@radix-ui/react-tooltip");require("@radix-ui/react-popover");require("@radix-ui/react-menubar");require("@radix-ui/react-hover-card");require("@radix-ui/react-select");require("@radix-ui/react-dropdown-menu");require("@radix-ui/react-separator");require("@radix-ui/react-toast");require("cmdk");require("@radix-ui/react-context-menu");require("react-icons-picker");require("react-dom");require("react-quill");require("@floating-ui/react-dom");require("flagged");require("react-dnd");require("@minoru/react-dnd-treeview");require("react-hotkeys-hook");const q=[{title:"Mobile",content:"Mobile email client",breakpoint:"xs",icon:e.jsxRuntimeExports.jsx(r.MobileIcon,{}),width:400},{title:"Email Client",content:"Content as seen inside an email client",breakpoint:"sm",icon:e.jsxRuntimeExports.jsx(r.MobileIcon,{className:"rotate-90"}),width:700}],n=i=>{const u={...i,importHTMLSupport:!1,dataBindingSupport:!1,breakpoints:q};return e.jsxRuntimeExports.jsx(t.ChaiBuilderEditor,{...u})};exports.ChaiBuilderEmail=n;
package/dist/email.d.ts CHANGED
@@ -24,6 +24,7 @@ declare type ChaiBlock = {
24
24
  } & Record<string, any>;
25
25
 
26
26
  declare interface ChaiBuilderEditorProps {
27
+ showDebugLogs?: boolean;
27
28
  autoSaveSupport?: boolean;
28
29
  autoSaveInterval?: TimeInSeconds;
29
30
  breakpoints?: Breakpoint[];
@@ -77,6 +78,7 @@ declare interface ChaiBuilderEditorProps {
77
78
  outlineMenuItems?: OutlineMenuItems;
78
79
  getPages?: () => Promise<ChaiPage[]>;
79
80
  unsplashAccessKey?: string;
81
+ _flags?: Record<string, boolean>;
80
82
  }
81
83
 
82
84
  export declare const ChaiBuilderEmail: (props: ChaiBuilderEditorProps) => JSX_2.Element;
package/dist/email.js CHANGED
@@ -1,18 +1,17 @@
1
1
  import { j as t } from "./jsx-runtime-WbnYoNE9.js";
2
- import { C as m } from "./index-LF3KXx4u.js";
2
+ import { C as m } from "./index-QIbDWoML.js";
3
3
  import { MobileIcon as i } from "@radix-ui/react-icons";
4
4
  import "./_commonjsHelpers-UyOWmZb0.js";
5
5
  import "react";
6
6
  import "i18next";
7
7
  import "react-i18next";
8
- import "./index-ZBqiaKhx.js";
8
+ import "./index-la4rqGKN.js";
9
9
  import "lodash-es";
10
10
  import "./Functions-7jnEwJyw.js";
11
11
  import "clsx";
12
12
  import "tailwind-merge";
13
13
  import "@chaibuilder/runtime";
14
14
  import "jotai";
15
- import "flat-to-nested";
16
15
  import "./MODIFIERS-WQdaNvb8.js";
17
16
  import "@react-hookz/web";
18
17
  import "@radix-ui/react-toggle";
@@ -40,7 +39,6 @@ import "react-icons-picker";
40
39
  import "react-dom";
41
40
  import "react-quill";
42
41
  import "@floating-ui/react-dom";
43
- import "react-textarea-autosize";
44
42
  import "flagged";
45
43
  import "react-dnd";
46
44
  import "@minoru/react-dnd-treeview";
@@ -60,7 +58,7 @@ const p = [
60
58
  icon: /* @__PURE__ */ t.jsx(i, { className: "rotate-90" }),
61
59
  width: 700
62
60
  }
63
- ], $ = (o) => {
61
+ ], Z = (o) => {
64
62
  const r = {
65
63
  ...o,
66
64
  importHTMLSupport: !1,
@@ -70,5 +68,5 @@ const p = [
70
68
  return /* @__PURE__ */ t.jsx(m, { ...r });
71
69
  };
72
70
  export {
73
- $ as ChaiBuilderEmail
71
+ Z as ChaiBuilderEmail
74
72
  };
@@ -1 +1 @@
1
- "use strict";const f=require("./jsx-runtime-Z_BpKhVy.cjs"),y=require("@rjsf/core"),E=require("@rjsf/validator-ajv8"),i=require("lodash-es"),d=require("./index-T3wfa1kz.cjs"),h=(c,n="")=>{switch(c.type){case"singular":return c.uiSchema;case"model":const{properties:p}=c,u={};return Object.keys(p).forEach(r=>{const e=p[r];if(i.includes(["slot","styles"],e.type))return;const o=i.get(e,"i18n",!1)?`${r}-${n}`:r;u[o]=h(e,n)}),u;case"list":const{itemProperties:m}=c,l={items:{}};return Object.keys(m).forEach(r=>{const e=m[r];if(i.includes(["slot","styles"],e.type))return;const o=i.get(e,"i18n",!1)?`${r}-${n}`:r;l.items[o]=h(e,n)}),l;default:return{}}},x=(c,n="")=>{switch(c.type){case"singular":return c.schema;case"model":const{properties:p,title:u}=c,m={title:u,type:"object",properties:{}};return Object.keys(p).forEach(o=>{const t=p[o];if(i.includes(["slot","styles"],t.type))return;const s=i.get(t,"i18n",!1)?`${o}-${n}`:o;m.properties[s]=x(t,n)}),m;case"list":const{itemProperties:l,title:r}=c,e={title:r,type:"array",items:{type:"object",properties:{}}};return Object.keys(l).forEach(o=>{const t=l[o];if(i.includes(["slot","styles"],t.type))return;const s=i.get(t,"i18n",!1)?`${o}-${n}`:o;e.items.properties[s]=x(t,n),i.set(e.items,"title",i.get(t,"itemTitle",`${r} item`))}),e;default:return{}}},$=({title:c,properties:n={},formData:p,onChange:u,disabled:m=!1,activeLang:l=""})=>{const r={type:"object",properties:{}},e={};Object.keys(n).forEach(t=>{const s=n[t];if(i.includes(["slot","styles"],s.type))return;const a=i.get(s,"i18n",!1)?`${t}-${l}`:t;r.properties[a]=x(s,l),e[a]=h(s,l)});const o=({...t},s)=>{const a=s==null?void 0:s.replace("root.","").split("/").pop();if(!s||!a)return;const j=i.first(a.split("."));s&&j&&u({...t},j)};return f.jsxRuntimeExports.jsxs(f.jsxRuntimeExports.Fragment,{children:[c&&f.jsxRuntimeExports.jsx("h1",{className:"px-1 text-sm font-semibold underline",children:c}),f.jsxRuntimeExports.jsx("div",{className:"-mx-3",children:f.jsxRuntimeExports.jsx(y,{widgets:{richtext:d.RichTextEditorField,icon:d.IconPickerField,image:d.ImagePickerField},fields:{link:d.LinkField},idSeparator:".",autoComplete:"off",omitExtraData:!0,liveOmit:!0,liveValidate:!0,uiSchema:e,schema:r,formData:p,validator:E,onChange:o,disabled:m})})]})};exports.Form=$;
1
+ "use strict";const f=require("./jsx-runtime-Z_BpKhVy.cjs"),y=require("@rjsf/core"),E=require("@rjsf/validator-ajv8"),i=require("lodash-es"),d=require("./index-DeHH1q_1.cjs"),h=(c,n="")=>{switch(c.type){case"singular":return c.uiSchema;case"model":const{properties:p}=c,u={};return Object.keys(p).forEach(r=>{const e=p[r];if(i.includes(["slot","styles"],e.type))return;const o=i.get(e,"i18n",!1)?`${r}-${n}`:r;u[o]=h(e,n)}),u;case"list":const{itemProperties:m}=c,l={items:{}};return Object.keys(m).forEach(r=>{const e=m[r];if(i.includes(["slot","styles"],e.type))return;const o=i.get(e,"i18n",!1)?`${r}-${n}`:r;l.items[o]=h(e,n)}),l;default:return{}}},x=(c,n="")=>{switch(c.type){case"singular":return c.schema;case"model":const{properties:p,title:u}=c,m={title:u,type:"object",properties:{}};return Object.keys(p).forEach(o=>{const t=p[o];if(i.includes(["slot","styles"],t.type))return;const s=i.get(t,"i18n",!1)?`${o}-${n}`:o;m.properties[s]=x(t,n)}),m;case"list":const{itemProperties:l,title:r}=c,e={title:r,type:"array",items:{type:"object",properties:{}}};return Object.keys(l).forEach(o=>{const t=l[o];if(i.includes(["slot","styles"],t.type))return;const s=i.get(t,"i18n",!1)?`${o}-${n}`:o;e.items.properties[s]=x(t,n),i.set(e.items,"title",i.get(t,"itemTitle",`${r} item`))}),e;default:return{}}},$=({title:c,properties:n={},formData:p,onChange:u,disabled:m=!1,activeLang:l=""})=>{const r={type:"object",properties:{}},e={};Object.keys(n).forEach(t=>{const s=n[t];if(i.includes(["slot","styles"],s.type))return;const a=i.get(s,"i18n",!1)?`${t}-${l}`:t;r.properties[a]=x(s,l),e[a]=h(s,l)});const o=({...t},s)=>{const a=s==null?void 0:s.replace("root.","").split("/").pop();if(!s||!a)return;const j=i.first(a.split("."));s&&j&&u({...t},j)};return f.jsxRuntimeExports.jsxs(f.jsxRuntimeExports.Fragment,{children:[c&&f.jsxRuntimeExports.jsx("h1",{className:"px-1 text-sm font-semibold underline",children:c}),f.jsxRuntimeExports.jsx("div",{className:"-mx-3",children:f.jsxRuntimeExports.jsx(y,{widgets:{richtext:d.RichTextEditorField,icon:d.IconPickerField,image:d.ImagePickerField},fields:{link:d.LinkField},idSeparator:".",autoComplete:"off",omitExtraData:!0,liveOmit:!0,liveValidate:!0,uiSchema:e,schema:r,formData:p,validator:E,onChange:o,disabled:m})})]})};exports.Form=$;
@@ -2,7 +2,7 @@ import { j as u } from "./jsx-runtime-WbnYoNE9.js";
2
2
  import b from "@rjsf/core";
3
3
  import x from "@rjsf/validator-ajv8";
4
4
  import { includes as h, get as a, set as $, first as F } from "lodash-es";
5
- import { b5 as P, b6 as E, b7 as O, b8 as S } from "./index-ZBqiaKhx.js";
5
+ import { b5 as P, b6 as E, b7 as O, b8 as S } from "./index-la4rqGKN.js";
6
6
  const d = (i, l = "") => {
7
7
  switch (i.type) {
8
8
  case "singular":
@@ -18,9 +18,9 @@ var v2 = (a, t, h, v) => ({
18
18
  import { j as i } from "./jsx-runtime-WbnYoNE9.js";
19
19
  import * as b from "react";
20
20
  import H0, { lazy as A2, useCallback as g2, useState as M2, Suspense as u0, useEffect as s0 } from "react";
21
- import { C as p0 } from "./index-LF3KXx4u.js";
21
+ import { C as p0 } from "./index-QIbDWoML.js";
22
22
  import { FileTextIcon as V0, GearIcon as f0, EyeClosedIcon as m0, EyeOpenIcon as L0 } from "@radix-ui/react-icons";
23
- import { u as x0, B as Y2, A as w0, a as B0, b as C0, c as O0, d as A0, e as S0, f as y0, g as b0, h as P0 } from "./index-ZBqiaKhx.js";
23
+ import { u as x0, B as Y2, A as w0, a as B0, b as C0, c as O0, d as A0, e as S0, f as y0, g as b0, h as P0 } from "./index-la4rqGKN.js";
24
24
  import { toast as h1, Toaster as F0 } from "sonner";
25
25
  import { sortBy as D0, filter as R0, has as k0, set as T0, capitalize as E0, get as b2, omit as N0, size as P2 } from "lodash-es";
26
26
  import { g as I0 } from "./html-to-json-C5sExaSD.js";
@@ -2045,7 +2045,7 @@ const R4 = () => {
2045
2045
  ] })
2046
2046
  ] })
2047
2047
  ] });
2048
- }, I4 = () => /* @__PURE__ */ i.jsx(N4, { children: /* @__PURE__ */ i.jsx("button", { className: "border-gray-200 rounded-md p-2 mb-2 border", children: /* @__PURE__ */ i.jsx(j0, { className: "w-4 h-4 text-red-500 cursor-pointer hover:text-red-300 duration-300" }) }) }), W4 = A2(() => import("./PagesPanel-VbSQHEu_.js")), U4 = A2(() => import("./ProjectPanel-fqux215P.js")), j4 = A2(() => import("./CurrentPage-AlOLPG4o.js")), Q4 = () => /* @__PURE__ */ i.jsx("h2", { children: "Your Logo" }), K4 = () => {
2048
+ }, I4 = () => /* @__PURE__ */ i.jsx(N4, { children: /* @__PURE__ */ i.jsx("button", { className: "border-gray-200 rounded-md p-2 mb-2 border", children: /* @__PURE__ */ i.jsx(j0, { className: "w-4 h-4 text-red-500 cursor-pointer hover:text-red-300 duration-300" }) }) }), W4 = A2(() => import("./PagesPanel-0bL28ofN.js")), U4 = A2(() => import("./ProjectPanel-sBRkUXnY.js")), j4 = A2(() => import("./CurrentPage-a3T2uy8Q.js")), Q4 = () => /* @__PURE__ */ i.jsx("h2", { children: "Your Logo" }), K4 = () => {
2049
2049
  const { mutate: a } = S4();
2050
2050
  return P0("editable", !0) ? /* @__PURE__ */ i.jsx(Y2, { onClick: a, className: "bg-blue-600 text-white", children: "Publish" }) : null;
2051
2051
  }, G4 = (a) => {