@chaibuilder/sdk 1.2.23 → 1.2.25

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 (186) hide show
  1. package/README.md +6 -5
  2. package/dist/AddBlocks-Ol3iIVKa.js +207 -0
  3. package/dist/AddBlocks-a1c-7Ewz.cjs +1 -0
  4. package/dist/BrandingOptions-6rnt0UaA.cjs +1 -0
  5. package/dist/{BrandingOptions-eUSoIgjj.js → BrandingOptions-iTyWpwTs.js} +40 -54
  6. package/dist/CanvasArea-R4ogF9AT.cjs +55 -0
  7. package/dist/{CanvasArea-ulUy_rmB.js → CanvasArea-dZjng782.js} +340 -324
  8. package/dist/ChaiBuilderEditor-m30yoOgJ.cjs +163 -0
  9. package/dist/ChaiBuilderEditor-vP4at00I.js +27974 -0
  10. package/dist/{Class-lGzsNBOK.js → Class-ahc3NIbq.js} +26 -29
  11. package/dist/Class-eieto7e-.cjs +1 -0
  12. package/dist/Controls-3Cc1XYXg.js +105 -0
  13. package/dist/Controls-ky25Ebo3.cjs +1 -0
  14. package/dist/CurrentPage-3gQTH0Zt.cjs +1 -0
  15. package/dist/{CurrentPage-SFhXzQMy.js → CurrentPage-Kmfp-kFk.js} +41 -55
  16. package/dist/Functions-Hvon6AMZ.cjs +1 -0
  17. package/dist/Functions-NzT2Six_.js +15 -0
  18. package/dist/ImagesPanel-J1RlG7xG.cjs +1 -0
  19. package/dist/ImagesPanel-Wb0GF_NA.js +29 -0
  20. package/dist/ListTree-CZ-mtjZ9.cjs +1 -0
  21. package/dist/{ListTree-ZeVWczTF.js → ListTree-N3jeD790.js} +92 -102
  22. package/dist/{MODIFIERS-dytZ-osO.js → MODIFIERS-CNqNUapY.js} +10 -4
  23. package/dist/MODIFIERS-o1p3VnpS.cjs +1 -0
  24. package/dist/PagesPanel-Gi0z6gaf.cjs +1 -0
  25. package/dist/PagesPanel-u1IB-nRr.js +48 -0
  26. package/dist/ProjectPanel-EydGZmMW.js +71 -0
  27. package/dist/ProjectPanel-kiiljG4H.cjs +1 -0
  28. package/dist/{STRINGS--j49GZJP.js → STRINGS-b432aBJJ.js} +2 -2
  29. package/dist/Settings-8ilCSH8b.cjs +1 -0
  30. package/dist/{Settings-FZWm8Fc3.js → Settings-jCcd-VE6.js} +407 -401
  31. package/dist/SidePanels-T36C6Lhc.cjs +1 -0
  32. package/dist/{SidePanels-wrkkpcGE.js → SidePanels-pHMYprpW.js} +107 -117
  33. package/dist/Topbar-CvWQuspR.cjs +1 -0
  34. package/dist/Topbar-pbIDUE_B.js +122 -0
  35. package/dist/UnsplashImages-KBZPd9dv.cjs +1 -0
  36. package/dist/{UnsplashImages-eZedbK2J.js → UnsplashImages-L7x_3RQf.js} +50 -63
  37. package/dist/UploadImages-GkkJVAgG.cjs +1 -0
  38. package/dist/{UploadImages-71QziLbr.js → UploadImages-zdEJRLD8.js} +37 -60
  39. package/dist/accordion-oPUeqPCZ.js +42 -0
  40. package/dist/accordion-ynvFtV_p.cjs +1 -0
  41. package/dist/add-page-modal-9SGv2hgc.cjs +1 -0
  42. package/dist/add-page-modal-JCDXZIPW.js +95 -0
  43. package/dist/alert-dialog-P9xMMB6C.cjs +1 -0
  44. package/dist/alert-dialog-rypfO5ly.js +64 -0
  45. package/dist/badge-E-S7CqUt.cjs +1 -0
  46. package/dist/badge-tEwO7C51.js +23 -0
  47. package/dist/block-helpers-OKHmRRol.cjs +1 -0
  48. package/dist/block-helpers-oSFpSsGz.js +23 -0
  49. package/dist/command-BxR6jaCI.cjs +1 -0
  50. package/dist/command-Pn3HKDuV.js +97 -0
  51. package/dist/confirm-alert-uNm0lZ0y.cjs +1 -0
  52. package/dist/confirm-alert-wR5_VJ1l.js +36 -0
  53. package/dist/context-menu-8dC9uGXj.js +122 -0
  54. package/dist/context-menu-IgLbIuth.cjs +1 -0
  55. package/dist/{controls-OfJWSEqC.js → controls-IS5qnRce.js} +20 -85
  56. package/dist/controls-L7DPvB0m.cjs +1 -0
  57. package/dist/core.cjs +1 -1
  58. package/dist/core.d.ts +7 -4
  59. package/dist/core.js +150 -75
  60. package/dist/{defaultTheme-D8B4-wHO.js → defaultTheme-4kA60XdB.js} +6 -8
  61. package/dist/defaultTheme-mrkeGFGI.cjs +1 -0
  62. package/dist/delete-page-modal-7KmP1elv.js +67 -0
  63. package/dist/delete-page-modal-SgfwvfNu.cjs +1 -0
  64. package/dist/dropdown-menu-El86_9Uo.js +124 -0
  65. package/dist/dropdown-menu-SiHzqWwZ.cjs +1 -0
  66. package/dist/email-blocks.cjs +1 -1
  67. package/dist/email-blocks.js +3 -292
  68. package/dist/email.cjs +1 -1
  69. package/dist/email.d.ts +5 -2
  70. package/dist/email.js +18 -37
  71. package/dist/{form-zKUMQFuB.js → form-0_RLz2TB.js} +12 -12
  72. package/dist/form-W58AVUdf.cjs +1 -0
  73. package/dist/hover-card-KUwpDkW8.cjs +1 -0
  74. package/dist/hover-card-q138xxXR.js +45 -0
  75. package/dist/{html-to-json-ngX9ef2u.js → html-to-json-2xtb7520.js} +41 -41
  76. package/dist/{html-to-json-efmv1pCj.cjs → html-to-json-uSnxl72F.cjs} +1 -1
  77. package/dist/iconBase-gbUAAO2L.cjs +1 -0
  78. package/dist/iconBase-h4DuR_XT.js +63 -0
  79. package/dist/index-9MmykVSc.cjs +1 -0
  80. package/dist/index-hElOGcFr.js +2200 -0
  81. package/dist/index-lDTsQp7h.js +188 -0
  82. package/dist/index-rq5Y9ZDy.cjs +1 -0
  83. package/dist/jsx-runtime-JYMCiFoE.cjs +27 -0
  84. package/dist/{jsx-runtime-WbnYoNE9.js → jsx-runtime-Sp0orL4X.js} +106 -109
  85. package/dist/label-KaP7MRrs.js +10 -0
  86. package/dist/label-tFm8HZdb.cjs +1 -0
  87. package/dist/lib.cjs +2 -2
  88. package/dist/lib.js +62 -66
  89. package/dist/link-WbcKdQ9k.cjs +1 -0
  90. package/dist/link-xuhP-4dN.js +196 -0
  91. package/dist/page-viewer-Hx5hxHKm.cjs +1 -0
  92. package/dist/{page-viewer-7AwzWRtB.js → page-viewer-NnOwmAmu.js} +44 -58
  93. package/dist/popover-a84pbVhQ.js +23 -0
  94. package/dist/popover-fKjgcRUx.cjs +1 -0
  95. package/dist/{project-general-setting-pYPoqvqd.js → project-general-setting-9ju3TDju.js} +35 -43
  96. package/dist/project-general-setting-FxkwjvJz.cjs +1 -0
  97. package/dist/{project-seo-setting-zXKOcjep.js → project-seo-setting-36CdUszM.js} +23 -40
  98. package/dist/project-seo-setting-RU7qiXxb.cjs +1 -0
  99. package/dist/render.cjs +1 -1
  100. package/dist/render.js +13 -14
  101. package/dist/scroll-area-FiHvy-TZ.cjs +1 -0
  102. package/dist/scroll-area-ewXbxc3n.js +30 -0
  103. package/dist/select-7bjg-rr9.cjs +1 -0
  104. package/dist/select-POGdEDHT.js +75 -0
  105. package/dist/separator-3Civ-6hb.cjs +1 -0
  106. package/dist/separator-SctTn0Qi.js +18 -0
  107. package/dist/single-page-detail-beY0MT1b.cjs +1 -0
  108. package/dist/{single-page-detail-q2TDxN-P.js → single-page-detail-hD1jKZ8k.js} +65 -73
  109. package/dist/skeleton-STeL9VrJ.cjs +1 -0
  110. package/dist/skeleton-lu8e7q2y.js +239 -0
  111. package/dist/studio.cjs +1 -1
  112. package/dist/studio.d.ts +5 -2
  113. package/dist/studio.js +24 -40
  114. package/dist/tabs-_4WbA1cc.cjs +1 -0
  115. package/dist/tabs-yQ3oGziM.js +106 -0
  116. package/dist/textarea-1kZEh7ki.cjs +1 -0
  117. package/dist/textarea-b2QvVhrK.js +73 -0
  118. package/dist/ui.cjs +1 -1
  119. package/dist/ui.js +364 -159
  120. package/dist/useAddBlock-8pxOEYIl.cjs +1 -0
  121. package/dist/useAddBlock-FEKFJNwQ.js +69 -0
  122. package/dist/useChaiExternalData-fkFgoS80.js +6 -0
  123. package/dist/useChaiExternalData-rwoAZ6uU.cjs +1 -0
  124. package/dist/useDarkMode-7i57segK.cjs +1 -0
  125. package/dist/useDarkMode-8VHJlYyE.js +23 -0
  126. package/dist/useSelectedBreakpoints-6NK5qd7T.js +10 -0
  127. package/dist/useSelectedBreakpoints-7ONXb-vN.cjs +1 -0
  128. package/dist/useStylingState-Iuj84yvc.js +186 -0
  129. package/dist/useStylingState-OIvJMV6p.cjs +1 -0
  130. package/dist/useUiLibraries-nCdauJ4N.cjs +1 -0
  131. package/dist/useUiLibraries-psyWFbNc.js +12 -0
  132. package/dist/useUpdateBlocksProps-Unn8lUyj.cjs +1 -0
  133. package/dist/useUpdateBlocksProps-vWcDp-P9.js +23 -0
  134. package/dist/utils-dze1SGvB.js +6 -0
  135. package/dist/utils-qK_SjzzV.cjs +1 -0
  136. package/dist/web-blocks.cjs +1 -6
  137. package/dist/web-blocks.js +3 -1153
  138. package/package.json +1 -1
  139. package/dist/AddBlocks-b0Vk6eqO.js +0 -206
  140. package/dist/AddBlocks-bgu08YJC.cjs +0 -1
  141. package/dist/BrandingOptions-AljW1cXz.cjs +0 -1
  142. package/dist/CanvasArea-dp1tzDkK.cjs +0 -55
  143. package/dist/Class-PoYusiA5.cjs +0 -1
  144. package/dist/CurrentPage-rWHgPomd.cjs +0 -1
  145. package/dist/Functions-7jnEwJyw.js +0 -15
  146. package/dist/Functions-N3yhPYKY.cjs +0 -1
  147. package/dist/ListTree-5n8U4-IF.cjs +0 -1
  148. package/dist/MODIFIERS-0g14w5RS.cjs +0 -1
  149. package/dist/PagesPanel-IkZjy0Gn.js +0 -64
  150. package/dist/PagesPanel-sBN51kKZ.cjs +0 -1
  151. package/dist/ProjectPanel-e98TJLfI.js +0 -85
  152. package/dist/ProjectPanel-lbQH31jc.cjs +0 -1
  153. package/dist/Settings-qytQoyTv.cjs +0 -1
  154. package/dist/SidePanels-YRIM1IPq.cjs +0 -1
  155. package/dist/Topbar-LUyDFBkK.js +0 -129
  156. package/dist/Topbar-NOSnWo7V.cjs +0 -1
  157. package/dist/UnsplashImages-f-ObKOC-.cjs +0 -1
  158. package/dist/UploadImages-oOnccvT9.cjs +0 -1
  159. package/dist/_commonjsHelpers-UyOWmZb0.js +0 -8
  160. package/dist/_commonjsHelpers-wDK0ZLPo.cjs +0 -1
  161. package/dist/add-page-modal-g3fd00P5.cjs +0 -1
  162. package/dist/add-page-modal-yQ6qL6Ui.js +0 -104
  163. package/dist/confirm-alert-3flAvzWH.js +0 -60
  164. package/dist/confirm-alert-LQsGNYz8.cjs +0 -1
  165. package/dist/controls-KK2oLIa8.cjs +0 -1
  166. package/dist/defaultTheme-7VqqhOcp.cjs +0 -1
  167. package/dist/delete-page-modal-iMmkPec0.js +0 -83
  168. package/dist/delete-page-modal-tzZmqGzE.cjs +0 -1
  169. package/dist/empty-slot-ZBlsQi6m.js +0 -15
  170. package/dist/empty-slot-nzYOgZuS.cjs +0 -1
  171. package/dist/form-LBHtTduy.cjs +0 -1
  172. package/dist/index--dUsFH1I.cjs +0 -1
  173. package/dist/index-HD1UKc4P.js +0 -3079
  174. package/dist/index-YpnaudSM.js +0 -63
  175. package/dist/index-bOWwCMRF.cjs +0 -206
  176. package/dist/index-e0c8PmRQ.js +0 -205
  177. package/dist/index-ecnGWzh9.cjs +0 -1
  178. package/dist/index-fvMaxES9.cjs +0 -1
  179. package/dist/index-gi1LIOCw.cjs +0 -1
  180. package/dist/index-m4WGov7e.js +0 -2202
  181. package/dist/index-uLtBNl55.js +0 -39503
  182. package/dist/jsx-runtime-Z_BpKhVy.cjs +0 -27
  183. package/dist/page-viewer-5gTszT-n.cjs +0 -1
  184. package/dist/project-general-setting-52CTYL_w.cjs +0 -1
  185. package/dist/project-seo-setting-jTweI1DX.cjs +0 -1
  186. package/dist/single-page-detail-jy2SPcp1.cjs +0 -1
@@ -1,294 +1,5 @@
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
- import { E as m } from "./empty-slot-ZBlsQi6m.js";
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
- import "./_commonjsHelpers-UyOWmZb0.js";
9
- import "react";
10
- import "./Functions-7jnEwJyw.js";
11
- import "clsx";
12
- import "tailwind-merge";
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
- };
17
- r(M, {
18
- type: "Email/Container",
19
- label: "Container",
20
- group: "basic",
21
- category: "core",
22
- canAcceptBlock: () => !0,
23
- canMove: () => !0,
24
- canDelete: () => !1,
25
- canDuplicate: () => !1,
26
- canBeNested: (e) => !e
27
- });
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
- label: "Section",
32
- group: "basic",
33
- category: "core",
34
- icon: p,
35
- props: {
36
- align: d({
37
- title: "Align",
38
- default: "",
39
- options: [
40
- { value: "", title: "None" },
41
- { value: "left", title: "left" },
42
- { value: "center", title: "center" },
43
- { value: "right", title: "right" }
44
- ]
45
- })
46
- },
47
- canAcceptBlock: () => !0
48
- });
49
- const $ = ({ blockProps: e, styles: t, children: l }) => /* @__PURE__ */ o.jsx(x, { ...e, ...t, children: l });
50
- r($, {
51
- type: "Email/Row",
52
- label: "Row",
53
- group: "basic",
54
- category: "core",
55
- icon: p,
56
- blocks: [
57
- { _type: "Email/Row", _id: "a" },
58
- { _type: "Email/Column", _id: "b", _parent: "a" }
59
- ],
60
- props: {
61
- styles: a({ default: "" })
62
- },
63
- canAcceptBlock: (e) => e === "Email/Column"
64
- });
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
- };
69
- r(q, {
70
- type: "Email/Column",
71
- label: "Column",
72
- group: "basic",
73
- category: "core",
74
- icon: p,
75
- props: {
76
- styles: a({ default: "" }),
77
- align: d({
78
- title: "Align",
79
- default: "",
80
- options: [
81
- { value: "", title: "None" },
82
- { value: "left", title: "left" },
83
- { value: "center", title: "center" },
84
- { value: "right", title: "right" }
85
- ]
86
- })
87
- },
88
- canAcceptBlock: () => !0,
89
- canBeNested: (e) => e === "Email/Row"
90
- });
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
- label: "Heading",
95
- group: "basic",
96
- category: "core",
97
- icon: S,
98
- builderComponent: J,
99
- props: {
100
- content: s({ title: "Content", default: "Enter your heading here..." }),
101
- styles: a({ default: "text-xl" }),
102
- level: d({
103
- title: "Level",
104
- default: "h1",
105
- binding: !1,
106
- options: [
107
- { value: "h1", title: "h1" },
108
- { value: "h2", title: "h2" },
109
- { value: "h3", title: "h3" },
110
- { value: "h4", title: "h4" },
111
- { value: "h5", title: "h5" },
112
- { value: "h6", title: "h6" }
113
- ]
114
- })
115
- },
116
- canAcceptBlock: (e) => ["Email/Link", "Email/RawText"].includes(e)
117
- });
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
- label: "Text",
122
- group: "basic",
123
- category: "core",
124
- icon: h,
125
- builderComponent: V,
126
- props: {
127
- content: u({
128
- title: "Content",
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
- }),
131
- styles: a({ default: "" })
132
- },
133
- canAcceptBlock: (e) => ["Email/Link", "Email/RawText"].includes(e)
134
- });
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
- label: "Raw Text",
139
- group: "basic",
140
- category: "core",
141
- icon: h,
142
- hidden: !0,
143
- builderComponent: F,
144
- props: {
145
- content: u({
146
- title: "Content",
147
- default: "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam in dui mauris. "
148
- })
149
- }
150
- });
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
- label: "Button",
155
- group: "basic",
156
- category: "core",
157
- builderComponent: K,
158
- props: {
159
- content: s({ title: "Content", default: "Click me" }),
160
- link: g({ title: "Link", default: { href: "https://chaibuilder.com", target: "_blank", type: "url" } }),
161
- styles: a({ default: "bg-primary text-white px-4 py-2 rounded-md" })
162
- }
163
- });
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
- };
168
- r(O, {
169
- type: "Link",
170
- label: "Link",
171
- group: "basic",
172
- category: "core",
173
- icon: P,
174
- blocks: [
175
- {
176
- _id: "a",
177
- _type: "Link"
178
- },
179
- {
180
- _id: "b",
181
- _parent: "a",
182
- _type: "RawText",
183
- content: "I am a link."
184
- }
185
- ],
186
- builderComponent: Q,
187
- props: {
188
- content: s({ title: "Content", default: "I am a link." }),
189
- link: g({ title: "Link", default: { href: "https://chaibuilder.com", target: "_blank", type: "url" } }),
190
- styles: a({ default: "font-bold text-blue-500" })
191
- },
192
- canAcceptBlock: () => !0
193
- });
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
- label: "Preview",
198
- group: "basic",
199
- category: "core",
200
- builderComponent: Y,
201
- canAcceptBlock: () => !0,
202
- canDuplicate: () => !1,
203
- props: {
204
- content: u({ default: "Preview content", title: "Content" })
205
- }
206
- });
207
- const Z = ({ blockProps: e, content: t }) => /* @__PURE__ */ o.jsx(I, { children: t, ...e });
208
- r(Z, {
209
- type: "Email/Markdown",
210
- label: "Markdown",
211
- group: "basic",
212
- category: "core",
213
- props: {
214
- content: u({ default: "# This is a ~~strikethrough~~", title: "Markdown" })
215
- }
216
- });
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
- label: "Image",
221
- group: "basic",
222
- category: "core",
223
- icon: p,
224
- builderComponent: te,
225
- props: {
226
- styles: a({ default: "w-full" }),
227
- image: _({
228
- title: "Image",
229
- default: "https://fakeimg.pl/400x200?text=Choose&font=bebas"
230
- }),
231
- alt: s({ title: "Alt", default: "" }),
232
- width: s({ title: "Width", default: "" }),
233
- height: s({ title: "Height", default: "" })
234
- }
235
- });
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
- label: "Divider",
240
- group: "basic",
241
- category: "core",
242
- icon: D,
243
- builderComponent: oe,
244
- props: {
245
- styles: a({ default: "w-full h-2" })
246
- }
247
- });
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
- label: "Code Block",
252
- group: "basic",
253
- category: "core",
254
- hidden: !0,
255
- icon: b,
256
- builderComponent: ne,
257
- props: {
258
- styles: a({ default: "" }),
259
- code: u({ title: "Code", default: "console.log('Hello, world!');" }),
260
- theme: s({ title: "Theme", default: "dracula" }),
261
- lineNumbers: A({
262
- title: "Line number",
263
- default: !1
264
- }),
265
- language: d({
266
- title: "Language",
267
- default: "javascript",
268
- binding: !1,
269
- options: [
270
- { value: "javascript", title: "JavaScript" },
271
- { value: "html", title: "HTML" },
272
- { value: "css", title: "CSS" }
273
- //add more options
274
- ]
275
- })
276
- }
277
- });
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
- label: "Code Inline",
282
- group: "basic",
283
- category: "core",
284
- icon: b,
285
- builderComponent: ae,
286
- props: {
287
- styles: a({ default: "" }),
288
- code: u({ title: "Code", default: "console.log('Hello, world!');" })
289
- }
290
- });
291
- const xe = k;
1
+ import { noop as o } from "lodash-es";
2
+ const m = o;
292
3
  export {
293
- xe as loadEmailBlocks
4
+ m as loadEmailBlocks
294
5
  };
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-bOWwCMRF.cjs"),r=require("@radix-ui/react-icons"),o=require("lodash-es");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("react");require("i18next");require("react-i18next");require("./index-fvMaxES9.cjs");require("./Functions-N3yhPYKY.cjs");require("clsx");require("tailwind-merge");require("@chaibuilder/runtime");require("jotai");require("./STRINGS-gPz7CUOk.cjs");require("@react-hookz/web");require("./MODIFIERS-0g14w5RS.cjs");require("@radix-ui/react-toggle");require("class-variance-authority");require("./Class-PoYusiA5.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-hotkeys-hook");const n=[{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}],s=i=>{const u={...i,filterChaiBlock:t=>o.includes(t.type,"Email/"),importHTMLSupport:!1,dataBindingSupport:!1,breakpoints:n};return e.jsxRuntimeExports.jsx(q.ChaiBuilderEditor,{...u})};exports.ChaiBuilderEmail=s;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-JYMCiFoE.cjs"),o=require("./ChaiBuilderEditor-m30yoOgJ.cjs"),r=require("@radix-ui/react-icons"),n=require("lodash-es");require("react");require("./MODIFIERS-o1p3VnpS.cjs");require("clsx");require("@radix-ui/react-scroll-area");require("react-dom");require("@floating-ui/react-dom");require("jotai");require("i18next");require("react-i18next");require("flagged");require("./skeleton-STeL9VrJ.cjs");require("@radix-ui/react-slot");require("class-variance-authority");require("./utils-qK_SjzzV.cjs");require("tailwind-merge");require("@radix-ui/react-tooltip");require("@radix-ui/react-toast");require("./Functions-Hvon6AMZ.cjs");require("react-hotkeys-hook");require("@react-hookz/web");require("@chaibuilder/runtime");const s=[{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}],l=i=>{const t={...i,filterChaiBlock:u=>n.includes(u.type,"Email/"),importHTMLSupport:!1,dataBindingSupport:!1,breakpoints:s};return e.jsxRuntimeExports.jsx(o.ChaiBuilderEditor,{...t})};exports.ChaiBuilderEmail=l;
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
+ hideSaveButton?: boolean;
27
28
  filterChaiBlock?: (block: any) => boolean;
28
29
  showDebugLogs?: boolean;
29
30
  autoSaveSupport?: boolean;
@@ -61,7 +62,7 @@ declare interface ChaiBuilderEditorProps {
61
62
  onSave?: ({ blocks, providers }: SavePageData) => Promise<boolean | Error>;
62
63
  brandingOptions?: Record<string, string>;
63
64
  onSaveBrandingOptions?: (brandingOptions: Record<string, any>) => Promise<boolean | Error>;
64
- onSyncStatusChange?: (syncStatus: "UNSAVED" | "SAVED") => void;
65
+ onSaveStateChange?: (syncStatus: "UNSAVED" | "SAVED" | "SAVING") => void;
65
66
  previewComponent?: ReactComponentType;
66
67
  sideBarComponents?: {
67
68
  bottom?: ReactComponentType[];
@@ -100,7 +101,9 @@ declare type DataProvider = {
100
101
  };
101
102
 
102
103
  declare type OutlineMenuItem = {
103
- item: (blockId: string) => ReactNode;
104
+ item: React_2.ComponentType<{
105
+ blockId: string;
106
+ }>;
104
107
  tooltip: string | ReactNode;
105
108
  };
106
109
 
package/dist/email.js CHANGED
@@ -1,47 +1,28 @@
1
- import { j as i } from "./jsx-runtime-WbnYoNE9.js";
2
- import { C as p } from "./index-uLtBNl55.js";
1
+ import { j as i } from "./jsx-runtime-Sp0orL4X.js";
2
+ import { C as p } from "./ChaiBuilderEditor-vP4at00I.js";
3
3
  import { MobileIcon as t } from "@radix-ui/react-icons";
4
4
  import { includes as e } from "lodash-es";
5
- import "./_commonjsHelpers-UyOWmZb0.js";
6
5
  import "react";
7
- import "i18next";
8
- import "react-i18next";
9
- import "./index-HD1UKc4P.js";
10
- import "./Functions-7jnEwJyw.js";
6
+ import "./MODIFIERS-CNqNUapY.js";
11
7
  import "clsx";
12
- import "tailwind-merge";
13
- import "@chaibuilder/runtime";
14
- import "jotai";
15
- import "./STRINGS--j49GZJP.js";
16
- import "@react-hookz/web";
17
- import "./MODIFIERS-dytZ-osO.js";
18
- import "@radix-ui/react-toggle";
19
- import "class-variance-authority";
20
- import "./Class-lGzsNBOK.js";
21
- import "@radix-ui/react-switch";
22
- import "@radix-ui/react-slot";
23
- import "@radix-ui/react-accordion";
24
- import "@radix-ui/react-alert-dialog";
25
- import "@radix-ui/react-dialog";
26
- import "@radix-ui/react-label";
27
8
  import "@radix-ui/react-scroll-area";
28
- import "@radix-ui/react-tabs";
29
- import "@radix-ui/react-tooltip";
30
- import "@radix-ui/react-popover";
31
- import "@radix-ui/react-menubar";
32
- import "@radix-ui/react-hover-card";
33
- import "@radix-ui/react-select";
34
- import "@radix-ui/react-dropdown-menu";
35
- import "@radix-ui/react-separator";
36
- import "@radix-ui/react-toast";
37
- import "cmdk";
38
- import "@radix-ui/react-context-menu";
39
- import "react-icons-picker";
40
9
  import "react-dom";
41
- import "react-quill";
42
10
  import "@floating-ui/react-dom";
11
+ import "jotai";
12
+ import "i18next";
13
+ import "react-i18next";
43
14
  import "flagged";
15
+ import "./skeleton-lu8e7q2y.js";
16
+ import "@radix-ui/react-slot";
17
+ import "class-variance-authority";
18
+ import "./utils-dze1SGvB.js";
19
+ import "tailwind-merge";
20
+ import "@radix-ui/react-tooltip";
21
+ import "@radix-ui/react-toast";
22
+ import "./Functions-NzT2Six_.js";
44
23
  import "react-hotkeys-hook";
24
+ import "@react-hookz/web";
25
+ import "@chaibuilder/runtime";
45
26
  const n = [
46
27
  {
47
28
  title: "Mobile",
@@ -57,7 +38,7 @@ const n = [
57
38
  icon: /* @__PURE__ */ i.jsx(t, { className: "rotate-90" }),
58
39
  width: 700
59
40
  }
60
- ], _ = (o) => {
41
+ ], A = (o) => {
61
42
  const r = {
62
43
  ...o,
63
44
  filterChaiBlock: (m) => e(m.type, "Email/"),
@@ -68,5 +49,5 @@ const n = [
68
49
  return /* @__PURE__ */ i.jsx(p, { ...r });
69
50
  };
70
51
  export {
71
- _ as ChaiBuilderEmail
52
+ A as ChaiBuilderEmail
72
53
  };
@@ -1,8 +1,8 @@
1
- import { j as u } from "./jsx-runtime-WbnYoNE9.js";
2
- import b from "@rjsf/core";
3
- import x from "@rjsf/validator-ajv8";
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-HD1UKc4P.js";
1
+ import { j as u } from "./jsx-runtime-Sp0orL4X.js";
2
+ import x from "@rjsf/core";
3
+ import $ from "@rjsf/validator-ajv8";
4
+ import { includes as h, get as a, set as F, first as P } from "lodash-es";
5
+ import { R as b, I as E, a as O, L as S } from "./link-xuhP-4dN.js";
6
6
  const d = (i, l = "") => {
7
7
  switch (i.type) {
8
8
  case "singular":
@@ -61,12 +61,12 @@ const d = (i, l = "") => {
61
61
  if (h(["slot", "styles"], t.type))
62
62
  return;
63
63
  const s = a(t, "i18n", !1) ? `${o}-${l}` : o;
64
- e.items.properties[s] = y(t, l), $(e.items, "title", a(t, "itemTitle", `${r} item`));
64
+ e.items.properties[s] = y(t, l), F(e.items, "title", a(t, "itemTitle", `${r} item`));
65
65
  }), e;
66
66
  default:
67
67
  return {};
68
68
  }
69
- }, C = ({
69
+ }, g = ({
70
70
  title: i,
71
71
  properties: l = {},
72
72
  formData: c,
@@ -89,16 +89,16 @@ const d = (i, l = "") => {
89
89
  const f = s == null ? void 0 : s.replace("root.", "").split("/").pop();
90
90
  if (!s || !f)
91
91
  return;
92
- const j = F(f.split("."));
92
+ const j = P(f.split("."));
93
93
  s && j && m({ ...t }, j);
94
94
  };
95
95
  return /* @__PURE__ */ u.jsxs(u.Fragment, { children: [
96
96
  i && /* @__PURE__ */ u.jsx("h1", { className: "px-1 text-sm font-semibold underline", children: i }),
97
97
  /* @__PURE__ */ u.jsx("div", { className: "-mx-3", children: /* @__PURE__ */ u.jsx(
98
- b,
98
+ x,
99
99
  {
100
100
  widgets: {
101
- richtext: P,
101
+ richtext: b,
102
102
  icon: E,
103
103
  image: O
104
104
  },
@@ -113,7 +113,7 @@ const d = (i, l = "") => {
113
113
  uiSchema: e,
114
114
  schema: r,
115
115
  formData: c,
116
- validator: x,
116
+ validator: $,
117
117
  onChange: o,
118
118
  disabled: n
119
119
  }
@@ -121,5 +121,5 @@ const d = (i, l = "") => {
121
121
  ] });
122
122
  };
123
123
  export {
124
- C as F
124
+ g as F
125
125
  };
@@ -0,0 +1 @@
1
+ "use strict";const f=require("./jsx-runtime-JYMCiFoE.cjs"),y=require("@rjsf/core"),E=require("@rjsf/validator-ajv8"),i=require("lodash-es"),d=require("./link-WbcKdQ9k.cjs"),h=(n,c="")=>{switch(n.type){case"singular":return n.uiSchema;case"model":const{properties:p}=n,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}-${c}`:r;u[o]=h(e,c)}),u;case"list":const{itemProperties:m}=n,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}-${c}`:r;l.items[o]=h(e,c)}),l;default:return{}}},x=(n,c="")=>{switch(n.type){case"singular":return n.schema;case"model":const{properties:p,title:u}=n,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}-${c}`:o;m.properties[s]=x(t,c)}),m;case"list":const{itemProperties:l,title:r}=n,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}-${c}`:o;e.items.properties[s]=x(t,c),i.set(e.items,"title",i.get(t,"itemTitle",`${r} item`))}),e;default:return{}}},$=({title:n,properties:c={},formData:p,onChange:u,disabled:m=!1,activeLang:l=""})=>{const r={type:"object",properties:{}},e={};Object.keys(c).forEach(t=>{const s=c[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:[n&&f.jsxRuntimeExports.jsx("h1",{className:"px-1 text-sm font-semibold underline",children:n}),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=$;
@@ -0,0 +1 @@
1
+ "use strict";const s=require("./jsx-runtime-JYMCiFoE.cjs"),m=require("@radix-ui/react-switch"),p=require("react"),i=require("./utils-qK_SjzzV.cjs"),b=require("@radix-ui/react-hover-card");function d(e){const a=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const o=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(a,t,o.get?o:{enumerable:!0,get:()=>e[t]})}}return a.default=e,Object.freeze(a)}const n=d(m),c=d(p),r=d(b),l=c.forwardRef(({className:e,...a},t)=>s.jsxRuntimeExports.jsx(n.Root,{className:i.cn("peer inline-flex h-[24px] w-[44px] shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-slate-400 focus-visible:ring-offset-2 focus-visible:ring-offset-white disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-slate-900 data-[state=unchecked]:bg-slate-200 dark:focus-visible:ring-slate-800 dark:focus-visible:ring-offset-slate-950 dark:data-[state=checked]:bg-slate-50 dark:data-[state=unchecked]:bg-slate-800",e),...a,ref:t,children:s.jsxRuntimeExports.jsx(n.Thumb,{className:i.cn("pointer-events-none block h-5 w-5 rounded-full bg-white shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0 dark:bg-slate-950")})}));l.displayName=n.Root.displayName;const g=r.Root,v=r.Trigger,u=c.forwardRef(({className:e,align:a="center",sideOffset:t=4,...o},f)=>s.jsxRuntimeExports.jsx(r.Content,{ref:f,align:a,sideOffset:t,className:i.cn("z-50 w-64 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...o}));u.displayName=r.Content.displayName;exports.HoverCard=g;exports.HoverCardContent=u;exports.HoverCardTrigger=v;exports.Switch=l;
@@ -0,0 +1,45 @@
1
+ import { j as s } from "./jsx-runtime-Sp0orL4X.js";
2
+ import * as r from "@radix-ui/react-switch";
3
+ import * as d from "react";
4
+ import { c as i } from "./utils-dze1SGvB.js";
5
+ import * as e from "@radix-ui/react-hover-card";
6
+ const c = d.forwardRef(({ className: t, ...a }, o) => /* @__PURE__ */ s.jsx(
7
+ r.Root,
8
+ {
9
+ className: i(
10
+ "peer inline-flex h-[24px] w-[44px] shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-slate-400 focus-visible:ring-offset-2 focus-visible:ring-offset-white disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-slate-900 data-[state=unchecked]:bg-slate-200 dark:focus-visible:ring-slate-800 dark:focus-visible:ring-offset-slate-950 dark:data-[state=checked]:bg-slate-50 dark:data-[state=unchecked]:bg-slate-800",
11
+ t
12
+ ),
13
+ ...a,
14
+ ref: o,
15
+ children: /* @__PURE__ */ s.jsx(
16
+ r.Thumb,
17
+ {
18
+ className: i(
19
+ "pointer-events-none block h-5 w-5 rounded-full bg-white shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0 dark:bg-slate-950"
20
+ )
21
+ }
22
+ )
23
+ }
24
+ ));
25
+ c.displayName = r.Root.displayName;
26
+ const u = e.Root, b = e.Trigger, f = d.forwardRef(({ className: t, align: a = "center", sideOffset: o = 4, ...n }, l) => /* @__PURE__ */ s.jsx(
27
+ e.Content,
28
+ {
29
+ ref: l,
30
+ align: a,
31
+ sideOffset: o,
32
+ className: i(
33
+ "z-50 w-64 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
34
+ t
35
+ ),
36
+ ...n
37
+ }
38
+ ));
39
+ f.displayName = e.Content.displayName;
40
+ export {
41
+ u as H,
42
+ c as S,
43
+ b as a,
44
+ f as b
45
+ };