@chaibuilder/sdk 1.2.30 → 1.2.31
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/{CanvasArea-e829y1ts.cjs → CanvasArea-AP2VxTme.cjs} +4 -4
- package/dist/{CanvasArea-3D9rpjpk.js → CanvasArea-AgZG60eK.js} +67 -67
- package/dist/{CurrentPage-5xKDQqvg.cjs → CurrentPage-lBwqlXua.cjs} +1 -1
- package/dist/{CurrentPage-VbdmddMv.js → CurrentPage-urEDcMfR.js} +2 -2
- package/dist/{PagesPanel-_VzJ1__k.js → PagesPanel-C3yfpE0O.js} +3 -3
- package/dist/{PagesPanel-wex1zGzm.cjs → PagesPanel-QAb3JjVO.cjs} +1 -1
- package/dist/{ProjectPanel-rPNO2QsE.js → ProjectPanel--8xzmpgT.js} +3 -3
- package/dist/{ProjectPanel-N6iWd_4Z.cjs → ProjectPanel-DJHfHFni.cjs} +1 -1
- package/dist/{Settings-mlh0i_1M.cjs → Settings-alHeC0FS.cjs} +1 -1
- package/dist/{Settings-jTl7IOPc.js → Settings-oMxnykls.js} +1 -1
- package/dist/{SidePanels-jYJEFpxC.js → SidePanels-TuKVMKxP.js} +1 -1
- package/dist/{SidePanels-mx5TyZBn.cjs → SidePanels-znlH133C.cjs} +1 -1
- package/dist/{add-page-modal-v5smARyL.cjs → add-page-modal-PhWtC-ZY.cjs} +1 -1
- package/dist/{add-page-modal-o1euqbsp.js → add-page-modal-Q3c1EOw1.js} +2 -2
- package/dist/core.cjs +1 -1
- package/dist/core.js +1 -1
- package/dist/defaultTheme-9e2np_iI.cjs +1 -0
- package/dist/{defaultTheme-D8B4-wHO.js → defaultTheme-ocvEtKQ3.js} +14 -5
- package/dist/{delete-page-modal-QzRkBAct.js → delete-page-modal-9B7603s-.js} +2 -2
- package/dist/{delete-page-modal-DNjqQuop.cjs → delete-page-modal-eh0Afqbu.cjs} +1 -1
- package/dist/email.cjs +1 -1
- package/dist/email.js +1 -1
- package/dist/{index-5c_rU-9B.cjs → index-B1EMostm.cjs} +1 -1
- package/dist/{index-SEJRE2ab.js → index-FVtnWx9d.js} +1 -1
- package/dist/{index-DtBYhldP.js → index-TXu6kBv9.js} +2 -2
- package/dist/{index-DHwvjZ5z.cjs → index-tFX6mX_R.cjs} +1 -1
- package/dist/lib.cjs +3 -3
- package/dist/lib.d.ts +2 -0
- package/dist/lib.js +83 -81
- package/dist/{page-viewer-1vswRGpL.js → page-viewer-3UIfb9p1.js} +3 -3
- package/dist/{page-viewer-87wtE0pN.cjs → page-viewer-wVQGkDJd.cjs} +1 -1
- package/dist/{project-general-setting-SE9QJ6mF.js → project-general-setting-8vqXfr75.js} +2 -2
- package/dist/{project-general-setting-RSG7ZQSx.cjs → project-general-setting-LrABWutT.cjs} +1 -1
- package/dist/render.cjs +1 -1
- package/dist/render.d.ts +2 -0
- package/dist/render.js +76 -74
- package/dist/{single-page-detail-8Arndzmw.cjs → single-page-detail-76C_iDiS.cjs} +1 -1
- package/dist/{single-page-detail-bels-Cjo.js → single-page-detail-py5_WxGu.js} +3 -3
- package/dist/studio.cjs +1 -1
- package/dist/studio.js +2 -2
- package/dist/tailwind.cjs +1 -1
- package/dist/tailwind.d.ts +37 -0
- package/dist/tailwind.js +102 -11
- package/package.json +2 -2
- package/dist/defaultTheme-7VqqhOcp.cjs +0 -1
package/dist/render.js
CHANGED
|
@@ -1,22 +1,23 @@
|
|
|
1
1
|
import { j as o } from "./jsx-runtime-WbnYoNE9.js";
|
|
2
2
|
import g from "react";
|
|
3
|
-
import { isString as j, memoize as
|
|
3
|
+
import { isString as j, memoize as T, get as a, isEmpty as y, each as O, filter as h, omit as $ } from "lodash-es";
|
|
4
4
|
import { twMerge as N } from "tailwind-merge";
|
|
5
|
-
import { S as
|
|
6
|
-
import { a as R, g as
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
5
|
+
import { S as E, a as p } from "./STRINGS--j49GZJP.js";
|
|
6
|
+
import { a as R, g as w, d as W } from "./defaultTheme-ocvEtKQ3.js";
|
|
7
|
+
import { c as jt } from "./defaultTheme-ocvEtKQ3.js";
|
|
8
|
+
import { getBlockComponent as I } from "@chaibuilder/runtime";
|
|
9
|
+
import { Provider as L } from "react-wrap-balancer";
|
|
9
10
|
import { B as Y } from "./MODIFIERS-cBT31iqE.js";
|
|
10
|
-
import { render as
|
|
11
|
-
import { Tailwind as
|
|
12
|
-
import
|
|
11
|
+
import { render as H } from "@react-email/render";
|
|
12
|
+
import { Tailwind as K, Html as U, Head as V, Font as z } from "@react-email/components";
|
|
13
|
+
import G from "tailwindcss-palette-generator";
|
|
13
14
|
import "./_commonjsHelpers-UyOWmZb0.js";
|
|
14
15
|
const M = (t) => {
|
|
15
16
|
const r = {};
|
|
16
17
|
return Object.keys(t).forEach((n) => {
|
|
17
|
-
j(t[n]) && t[n].startsWith(
|
|
18
|
+
j(t[n]) && t[n].startsWith(E) && (r[n] = t[n].replace(E, "").split(","));
|
|
18
19
|
}), r;
|
|
19
|
-
}, P =
|
|
20
|
+
}, P = T((t, r) => {
|
|
20
21
|
const n = t.replace(p, "").split(","), e = N(n[0], n[1]);
|
|
21
22
|
return r ? R(e, r).replace(p, "").trim() : e.replace(p, "").trim();
|
|
22
23
|
});
|
|
@@ -37,52 +38,52 @@ function J(t, r) {
|
|
|
37
38
|
}
|
|
38
39
|
function Q(t, r) {
|
|
39
40
|
const n = a(t, "_bindings", {});
|
|
40
|
-
return y(n) ? { ...t } : (
|
|
41
|
+
return y(n) ? { ...t } : (O(n, (e, s) => {
|
|
41
42
|
j(e) && a(r, e, null) && (t[s] = a(r, e, null));
|
|
42
43
|
}), t);
|
|
43
44
|
}
|
|
44
|
-
function
|
|
45
|
-
const { components: r, blocks: n, parent: e, classPrefix: s = "", externalData: c = {} } = t,
|
|
45
|
+
function A(t) {
|
|
46
|
+
const { components: r, blocks: n, parent: e, classPrefix: s = "", externalData: c = {} } = t, d = n, l = (i) => J(i, s), F = e ? h(n, { _parent: e }) : h(n, (i) => y(i._parent));
|
|
46
47
|
return /* @__PURE__ */ o.jsx(o.Fragment, { children: g.Children.toArray(
|
|
47
|
-
|
|
48
|
+
F.map((i, _) => {
|
|
48
49
|
const C = M(i), f = {};
|
|
49
|
-
y(C) || Object.keys(C).forEach((
|
|
50
|
-
f[
|
|
51
|
-
C[
|
|
52
|
-
|
|
50
|
+
y(C) || Object.keys(C).forEach((x) => {
|
|
51
|
+
f[x] = g.Children.toArray(
|
|
52
|
+
C[x].map((S) => /* @__PURE__ */ o.jsx(
|
|
53
|
+
A,
|
|
53
54
|
{
|
|
54
55
|
externalData: c,
|
|
55
56
|
classPrefix: s,
|
|
56
|
-
blocks:
|
|
57
|
-
parent:
|
|
57
|
+
blocks: d,
|
|
58
|
+
parent: S,
|
|
58
59
|
components: r
|
|
59
60
|
}
|
|
60
61
|
))
|
|
61
62
|
);
|
|
62
63
|
});
|
|
63
|
-
const
|
|
64
|
-
f.children =
|
|
65
|
-
|
|
64
|
+
const m = h(d, { _parent: i._id });
|
|
65
|
+
f.children = m.length > 0 ? /* @__PURE__ */ o.jsx(
|
|
66
|
+
A,
|
|
66
67
|
{
|
|
67
68
|
externalData: c,
|
|
68
69
|
classPrefix: s,
|
|
69
70
|
parent: i._id,
|
|
70
|
-
blocks:
|
|
71
|
+
blocks: d,
|
|
71
72
|
components: r
|
|
72
73
|
}
|
|
73
74
|
) : null;
|
|
74
75
|
const u = a(r, i._type, null);
|
|
75
76
|
if (u !== null) {
|
|
76
|
-
let
|
|
77
|
-
const
|
|
77
|
+
let x = i;
|
|
78
|
+
const S = u;
|
|
78
79
|
return g.createElement(
|
|
79
|
-
|
|
80
|
-
|
|
80
|
+
S,
|
|
81
|
+
$(
|
|
81
82
|
{
|
|
82
|
-
...
|
|
83
|
+
...x,
|
|
83
84
|
index: _,
|
|
84
85
|
...Q(i, c),
|
|
85
|
-
...l(
|
|
86
|
+
...l(x),
|
|
86
87
|
...f
|
|
87
88
|
},
|
|
88
89
|
["_parent"]
|
|
@@ -99,47 +100,47 @@ function T(t) {
|
|
|
99
100
|
const X = (t) => {
|
|
100
101
|
const r = {};
|
|
101
102
|
return Object.keys(t).forEach((n) => {
|
|
102
|
-
j(t[n]) && t[n].startsWith(
|
|
103
|
+
j(t[n]) && t[n].startsWith(E) && (r[n] = t[n].replace(E, "").split(","));
|
|
103
104
|
}), r;
|
|
104
|
-
}, Z =
|
|
105
|
+
}, Z = T((t, r) => {
|
|
105
106
|
const n = t.replace(p, "").split(","), e = N(n[0], n[1]);
|
|
106
107
|
return r === "" ? e.replace(p, "").trim() : R(e, r).replace(p, "").trim();
|
|
107
108
|
});
|
|
108
|
-
function
|
|
109
|
+
function v(t, r) {
|
|
109
110
|
return a(t, `${r}_attrs`, {});
|
|
110
111
|
}
|
|
111
|
-
function
|
|
112
|
+
function D(t, r) {
|
|
112
113
|
const n = {};
|
|
113
114
|
return Object.keys(t).forEach((e) => {
|
|
114
115
|
if (j(t[e]) && t[e].startsWith(p)) {
|
|
115
116
|
const s = Z(t[e], r);
|
|
116
117
|
n[e] = {
|
|
117
118
|
className: s,
|
|
118
|
-
...
|
|
119
|
+
...v(t, e)
|
|
119
120
|
};
|
|
120
121
|
}
|
|
121
122
|
}), n;
|
|
122
123
|
}
|
|
123
|
-
function
|
|
124
|
+
function b(t, r) {
|
|
124
125
|
const n = a(t, "_bindings", {});
|
|
125
|
-
return y(n) ? { ...t } : (
|
|
126
|
+
return y(n) ? { ...t } : (O(n, (e, s) => {
|
|
126
127
|
j(e) && a(r, e, null) && (t[s] = a(r, e, null));
|
|
127
128
|
}), t);
|
|
128
129
|
}
|
|
129
|
-
function
|
|
130
|
+
function B({
|
|
130
131
|
blocks: t,
|
|
131
132
|
parent: r,
|
|
132
133
|
classPrefix: n = "",
|
|
133
134
|
externalData: e = {}
|
|
134
135
|
}) {
|
|
135
|
-
const s = t, c = (l) =>
|
|
136
|
+
const s = t, c = (l) => D(l, n), d = r ? h(t, { _parent: r }) : h(t, (l) => y(l._parent));
|
|
136
137
|
return /* @__PURE__ */ o.jsx(o.Fragment, { children: g.Children.toArray(
|
|
137
|
-
|
|
138
|
+
d.map((l, F) => {
|
|
138
139
|
const i = X(l), _ = {};
|
|
139
|
-
y(i) || Object.keys(i).forEach((
|
|
140
|
-
_[
|
|
141
|
-
i[
|
|
142
|
-
|
|
140
|
+
y(i) || Object.keys(i).forEach((m) => {
|
|
141
|
+
_[m] = g.Children.toArray(
|
|
142
|
+
i[m].map((u) => /* @__PURE__ */ o.jsx(
|
|
143
|
+
B,
|
|
143
144
|
{
|
|
144
145
|
externalData: e,
|
|
145
146
|
classPrefix: n,
|
|
@@ -151,7 +152,7 @@ function F({
|
|
|
151
152
|
});
|
|
152
153
|
const C = h(s, { _parent: l._id });
|
|
153
154
|
_.children = C.length > 0 ? /* @__PURE__ */ o.jsx(
|
|
154
|
-
|
|
155
|
+
B,
|
|
155
156
|
{
|
|
156
157
|
externalData: e,
|
|
157
158
|
classPrefix: n,
|
|
@@ -159,20 +160,20 @@ function F({
|
|
|
159
160
|
blocks: s
|
|
160
161
|
}
|
|
161
162
|
) : null;
|
|
162
|
-
const f =
|
|
163
|
+
const f = I(l._type);
|
|
163
164
|
if (f !== null) {
|
|
164
|
-
let
|
|
165
|
+
let m = l;
|
|
165
166
|
const u = f.component;
|
|
166
|
-
return
|
|
167
|
+
return m = { ...f.defaults, ...l }, g.createElement(
|
|
167
168
|
u,
|
|
168
|
-
|
|
169
|
+
$(
|
|
169
170
|
{
|
|
170
171
|
blockProps: {},
|
|
171
172
|
inBuilder: !1,
|
|
172
|
-
...
|
|
173
|
-
index:
|
|
174
|
-
...
|
|
175
|
-
...c(
|
|
173
|
+
...m,
|
|
174
|
+
index: F,
|
|
175
|
+
...b(l, e),
|
|
176
|
+
...c(m),
|
|
176
177
|
..._
|
|
177
178
|
},
|
|
178
179
|
["_parent"]
|
|
@@ -186,7 +187,7 @@ function F({
|
|
|
186
187
|
})
|
|
187
188
|
) });
|
|
188
189
|
}
|
|
189
|
-
const
|
|
190
|
+
const ut = ({
|
|
190
191
|
pageData: t,
|
|
191
192
|
externalData: r = {},
|
|
192
193
|
before: n = null,
|
|
@@ -199,18 +200,18 @@ const gt = ({
|
|
|
199
200
|
/* @__PURE__ */ o.jsx(
|
|
200
201
|
"div",
|
|
201
202
|
{
|
|
202
|
-
className: s.replace("-", "") + " " +
|
|
203
|
-
children: /* @__PURE__ */ o.jsx(
|
|
203
|
+
className: s.replace("-", "") + " " + w(c, s) + " min-h-screen",
|
|
204
|
+
children: /* @__PURE__ */ o.jsx(L, { children: /* @__PURE__ */ o.jsx(B, { externalData: r, blocks: t.page.blocks || [], classPrefix: s }) })
|
|
204
205
|
}
|
|
205
206
|
),
|
|
206
207
|
e
|
|
207
208
|
] });
|
|
208
|
-
},
|
|
209
|
-
const n = a(t, "primaryColor", "#000"), e = a(t, "secondaryColor", "#ccc"), s = a(t, "bodyFont", "Inter"), c = a(t, "roundedCorners", "0"),
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
return
|
|
209
|
+
}, k = (t, r = "c-") => {
|
|
210
|
+
const n = a(t, "primaryColor", "#000"), e = a(t, "secondaryColor", "#ccc"), s = a(t, "bodyFont", "Inter"), c = a(t, "roundedCorners", "0"), d = G([
|
|
211
|
+
{ color: n, name: "primary" },
|
|
212
|
+
{ color: e, name: "secondary" }
|
|
213
|
+
]);
|
|
214
|
+
return {
|
|
214
215
|
theme: {
|
|
215
216
|
fontFamily: {
|
|
216
217
|
body: [s, ...W.fontFamily.sans]
|
|
@@ -219,12 +220,12 @@ const gt = ({
|
|
|
219
220
|
borderRadius: {
|
|
220
221
|
global: `${c || "0"}px`
|
|
221
222
|
},
|
|
222
|
-
colors:
|
|
223
|
+
colors: d
|
|
223
224
|
}
|
|
224
225
|
},
|
|
225
226
|
...r ? { prefix: r } : {}
|
|
226
227
|
};
|
|
227
|
-
},
|
|
228
|
+
}, tt = (t) => ({
|
|
228
229
|
fontFamily: t,
|
|
229
230
|
fallbackFontFamily: "Verdana",
|
|
230
231
|
webFont: {
|
|
@@ -233,19 +234,20 @@ const gt = ({
|
|
|
233
234
|
},
|
|
234
235
|
fontWeight: 400,
|
|
235
236
|
fontStyle: "normal"
|
|
236
|
-
}),
|
|
237
|
-
const e =
|
|
238
|
-
return
|
|
239
|
-
/* @__PURE__ */ o.jsx(
|
|
240
|
-
/* @__PURE__ */ o.jsx(V, { children: /* @__PURE__ */ o.jsx(z, { ...
|
|
241
|
-
/* @__PURE__ */ o.jsx("body", { children: /* @__PURE__ */ o.jsx(
|
|
237
|
+
}), gt = (t, r, n = "html") => {
|
|
238
|
+
const e = k(r);
|
|
239
|
+
return H(
|
|
240
|
+
/* @__PURE__ */ o.jsx(K, { config: e, children: /* @__PURE__ */ o.jsxs(U, { lang: "en", dir: "ltr", children: [
|
|
241
|
+
/* @__PURE__ */ o.jsx(V, { children: /* @__PURE__ */ o.jsx(z, { ...tt(a(r, "bodyFont", "Verdana")) }) }),
|
|
242
|
+
/* @__PURE__ */ o.jsx("body", { children: /* @__PURE__ */ o.jsx(B, { blocks: t }) })
|
|
242
243
|
] }) }),
|
|
243
244
|
n === "html" ? { pretty: !0 } : { plainText: !0 }
|
|
244
245
|
);
|
|
245
246
|
};
|
|
246
247
|
export {
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
248
|
+
B as RenderChaiBlocks,
|
|
249
|
+
ut as RenderChaiPage,
|
|
250
|
+
A as RenderUnregisteredComponents,
|
|
251
|
+
jt as convertToBlocks,
|
|
252
|
+
gt as generateEmailTemplate
|
|
251
253
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./jsx-runtime-Z_BpKhVy.cjs"),f=require("react"),c=require("lodash-es"),H=require("@radix-ui/react-icons"),y=require("./index-12HbDLon.cjs"),d=require("./controls-KK2oLIa8.cjs"),w=require("sonner"),p=require("./form-jQj7E-hS.cjs"),P=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./jsx-runtime-Z_BpKhVy.cjs"),f=require("react"),c=require("lodash-es"),H=require("@radix-ui/react-icons"),y=require("./index-12HbDLon.cjs"),d=require("./controls-KK2oLIa8.cjs"),w=require("sonner"),p=require("./form-jQj7E-hS.cjs"),P=require("./index-B1EMostm.cjs");require("./_commonjsHelpers-wDK0ZLPo.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-YPHRtwrM.cjs");require("./Class-Zc8hpE7f.cjs");require("react-i18next");require("@radix-ui/react-toggle");require("class-variance-authority");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("@rjsf/core");require("@rjsf/validator-ajv8");require("./index-tFX6mX_R.cjs");require("i18next");require("@floating-ui/react-dom");require("flagged");require("react-hotkeys-hook");require("./html-to-json-Xhu27KFD.cjs");require("himalaya");require("lucide-react");require("./index-ecnGWzh9.cjs");const z=f.lazy(()=>Promise.resolve().then(()=>require("./delete-page-modal-eh0Afqbu.cjs"))),L=f.lazy(()=>Promise.resolve().then(()=>require("./confirm-alert-4OQlXZTJ.cjs"))),E=n=>{if(!c.isString(n)||!(n.includes("/[")&&n.includes("]")))return!1;const s=/^\[((?:\.{3})?[a-zA-Z0-9_-]+)\]$/,q=/^[a-zA-Z0-9_-]+$/;let e=!0;return n.split("/").forEach(u=>{e&&(u.includes("[[")&&u.includes("]]")?e=/^\[\[\.{3}[a-zA-Z0-9_-]+\]\]$/.test(u):u.includes("[")&&u.includes("]")?e=s.test(u):e=q.test(u))}),e},h=n=>n&&c.isEmpty(n.seoData)?{...n,seoData:{title:"",description:"",image:""}}:n,G=(n,o)=>{const s=!c.isEqual(c.omit(n,["seoData"]),c.omit(o,["seoData"])),q=!c.isEqual(h(o).seoData,h(n).seoData);return s||q},Y=({open:n,setOpen:o,pageData:s})=>{const q=P.useQueryClient(),{data:e}=P.useProject(),u=P.useUpdatePage(),m=P.useUpdateProject("Homepage updated successfully."),[i,b]=f.useState(h(s)),[a,A]=f.useState({isHomePage:(e==null?void 0:e.homepage)===s.uuid}),j=G(i,s);f.useEffect(()=>{const l=!c.isEqual(h(s),i),t=(e==null?void 0:e.homepage)!==s.uuid&&a.isHomePage;o(l||t?"PENDING":"OPEN")},[e,s,i,a,o]);const C=()=>{if(j){if(s.type==="DYNAMIC"&&!E((i==null?void 0:i.slug)||"")){n==="ALERT"&&o("PENDING");return}u.mutate(i,{onSuccess:()=>{q.invalidateQueries({refetchType:"active",queryKey:["pages",e==null?void 0:e.uuid]}),o("CLOSE"),w.toast.success("Page updated successfully.")}})}a.isHomePage&&(e==null?void 0:e.homepage)!==s.uuid&&m.mutate({...e,homepage:s==null?void 0:s.uuid},{onSuccess:()=>o("CLOSE")})},R=({formData:l},t)=>{b(g=>{var S,N;if(!t)return g;const x={[t]:l[t]};return t==="name"?x.slug=c.kebabCase((S=l[t])==null?void 0:S.replace(/\d/g,"")):t==="slug"?x.slug=(N=l[t])==null?void 0:N.replace(/\d/g,"").replace(/\s+/g,"").replace("--","-").replace("__","_"):t==="seoData"&&(x.seoData={title:l[t].title||"",description:l[t].description||"",image:l[t].image||""}),{...g,...x}})},I=({formData:l},t)=>{A(g=>{const x={[t]:l[t]};return{...g,...x}})},v={name:d.u({title:"Page Name",default:i.name}),slug:d.u({title:"Page Slug",default:i.slug})},T={seoData:d.b({title:"",description:"",default:{title:"",description:"",image:""},properties:{title:d.u({title:"Meta Title",default:i.name}),description:d.g({title:"Meta Description",default:i.slug}),image:d.o({title:"Social Media Image",default:""})}})},M={isHomePage:d.r({title:"Set as homepage",default:a.isHomePage})};return r.jsxRuntimeExports.jsxs(y.ScrollArea,{className:"flex h-full select-none flex-col",children:[r.jsxRuntimeExports.jsx(L,{open:n==="ALERT",title:"Do yo want to save changes?",onCancel:()=>o("CLOSE"),onConfirm:C,disabled:m.isPending||u.isPending}),r.jsxRuntimeExports.jsx("div",{className:"rounded-md bg-background/30 px-2.5 py-1",children:r.jsxRuntimeExports.jsx("h1",{className:"px-1 font-semibold",children:"Page Details"})}),r.jsxRuntimeExports.jsx("div",{className:"px-2.5 pt-2",children:r.jsxRuntimeExports.jsxs("div",{className:"flex flex-col space-y-2",children:[r.jsxRuntimeExports.jsx(p.Form,{title:"Basic Details",formData:i,properties:v,onChange:R,disabled:u.isPending||m.isPending}),r.jsxRuntimeExports.jsx("div",{className:"h-2 w-full"}),r.jsxRuntimeExports.jsx(p.Form,{title:"SEO Details",formData:i,properties:T,onChange:R,disabled:u.isPending||m.isPending}),(e==null?void 0:e.homepage)!==s.uuid&&s.type==="STATIC"?r.jsxRuntimeExports.jsx(p.Form,{formData:a,properties:M,onChange:I,disabled:u.isPending||m.isPending}):s.type==="STATIC"&&r.jsxRuntimeExports.jsxs("div",{className:"flex items-center gap-x-1 px-1 pt-2 text-xs font-medium text-gray-500",children:[r.jsxRuntimeExports.jsx(H.HomeIcon,{})," This is homepage"," "]}),i.type==="DYNAMIC"&&!E((i==null?void 0:i.slug)||"")&&r.jsxRuntimeExports.jsxs("small",{className:"px-1 text-red-400",children:["Add dynamic ID in page slug Eg: ",r.jsxRuntimeExports.jsx("i",{className:"underline",children:"some-url/[some-id]"})]}),r.jsxRuntimeExports.jsxs("div",{className:"my-2 flex w-full items-center justify-between gap-x-2 px-1",children:[r.jsxRuntimeExports.jsx(y.Button,{className:"w-full",type:"submit",onClick:C,disabled:(e==null?void 0:e.homepage)!==s.uuid&&a.isHomePage?!1:c.isEmpty(i.name)||c.isEmpty(i.slug)||!j||u.isPending||m.isPending||i.type==="DYNAMIC"&&!E((i==null?void 0:i.slug)||""),children:"Save"}),r.jsxRuntimeExports.jsx(z,{pageData:s,projectData:e})]})]})})]})};exports.default=Y;
|
|
@@ -6,7 +6,7 @@ import { bi as Y, B as q } from "./index-HiiWSXkE.js";
|
|
|
6
6
|
import { u as g, b as Z, g as $, o as F, r as Q } from "./controls-OfJWSEqC.js";
|
|
7
7
|
import { toast as U } from "sonner";
|
|
8
8
|
import { F as P } from "./form-yw3Uuk6v.js";
|
|
9
|
-
import { f as V, a as X, g as _, b as K } from "./index-
|
|
9
|
+
import { f as V, a as X, g as _, b as K } from "./index-TXu6kBv9.js";
|
|
10
10
|
import "./_commonjsHelpers-UyOWmZb0.js";
|
|
11
11
|
import "./Functions-7jnEwJyw.js";
|
|
12
12
|
import "clsx";
|
|
@@ -43,7 +43,7 @@ import "react-dom";
|
|
|
43
43
|
import "react-quill";
|
|
44
44
|
import "@rjsf/core";
|
|
45
45
|
import "@rjsf/validator-ajv8";
|
|
46
|
-
import "./index-
|
|
46
|
+
import "./index-FVtnWx9d.js";
|
|
47
47
|
import "i18next";
|
|
48
48
|
import "@floating-ui/react-dom";
|
|
49
49
|
import "flagged";
|
|
@@ -52,7 +52,7 @@ import "./html-to-json-ZV4QjSww.js";
|
|
|
52
52
|
import "himalaya";
|
|
53
53
|
import "lucide-react";
|
|
54
54
|
import "./index-YpnaudSM.js";
|
|
55
|
-
const O = I.lazy(() => import("./delete-page-modal-
|
|
55
|
+
const O = I.lazy(() => import("./delete-page-modal-9B7603s-.js")), J = I.lazy(() => import("./confirm-alert-EDOFRmH8.js")), h = (r) => {
|
|
56
56
|
if (!L(r) || !(r.includes("/[") && r.includes("]")))
|
|
57
57
|
return !1;
|
|
58
58
|
const s = /^\[((?:\.{3})?[a-zA-Z0-9_-]+)\]$/, u = /^[a-zA-Z0-9_-]+$/;
|
package/dist/studio.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("./jsx-runtime-Z_BpKhVy.cjs");const e=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("./jsx-runtime-Z_BpKhVy.cjs");const e=require("./index-B1EMostm.cjs");require("react");require("sonner");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("./index-tFX6mX_R.cjs");require("i18next");require("react-i18next");require("./index-12HbDLon.cjs");require("lodash-es");require("./Functions-N3yhPYKY.cjs");require("clsx");require("tailwind-merge");require("@chaibuilder/runtime");require("jotai");require("./STRINGS-gPz7CUOk.cjs");require("@react-hookz/web");require("./MODIFIERS-YPHRtwrM.cjs");require("./Class-Zc8hpE7f.cjs");require("@radix-ui/react-toggle");require("class-variance-authority");require("@radix-ui/react-switch");require("@radix-ui/react-slot");require("@radix-ui/react-accordion");require("@radix-ui/react-icons");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");require("./html-to-json-Xhu27KFD.cjs");require("himalaya");require("lucide-react");require("./index-ecnGWzh9.cjs");exports.ChaiBuilderStudio=e.ChaiBuilderStudio;
|
package/dist/studio.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import "./jsx-runtime-WbnYoNE9.js";
|
|
2
|
-
import { C as Z } from "./index-
|
|
2
|
+
import { C as Z } from "./index-TXu6kBv9.js";
|
|
3
3
|
import "react";
|
|
4
4
|
import "sonner";
|
|
5
5
|
import "./_commonjsHelpers-UyOWmZb0.js";
|
|
6
|
-
import "./index-
|
|
6
|
+
import "./index-FVtnWx9d.js";
|
|
7
7
|
import "i18next";
|
|
8
8
|
import "react-i18next";
|
|
9
9
|
import "./index-HiiWSXkE.js";
|
package/dist/tailwind.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const v=require("tailwindcss-animate"),m=require("lodash"),y=require("tailwindcss-palette-generator"),p=require("./_commonjsHelpers-wDK0ZLPo.cjs");function _(r={}){return{colors:{border:"hsl(var(--border))",input:"hsl(var(--input))",ring:"hsl(var(--ring))",background:"hsl(var(--background))",foreground:"hsl(var(--foreground))",primary:{DEFAULT:"hsl(var(--primary))",foreground:"hsl(var(--primary-foreground))"},secondary:{DEFAULT:"hsl(var(--secondary))",foreground:"hsl(var(--secondary-foreground))"},destructive:{DEFAULT:"hsl(var(--destructive))",foreground:"hsl(var(--destructive-foreground))"},muted:{DEFAULT:"hsl(var(--muted))",foreground:"hsl(var(--muted-foreground))"},accent:{DEFAULT:"hsl(var(--accent))",foreground:"hsl(var(--accent-foreground))"},popover:{DEFAULT:"hsl(var(--popover))",foreground:"hsl(var(--popover-foreground))"},card:{DEFAULT:"hsl(var(--card))",foreground:"hsl(var(--card-foreground))"}},borderRadius:{lg:"var(--radius)",md:"calc(var(--radius) - 2px)",sm:"calc(var(--radius) - 4px)"},keyframes:{"accordion-down":{from:{height:"0"},to:{height:"var(--radix-accordion-content-height)"}},"accordion-up":{from:{height:"var(--radix-accordion-content-height)"},to:{height:"0"}}},animation:{"accordion-down":"accordion-down 0.2s ease-out","accordion-up":"accordion-up 0.2s ease-out"},...r}}var u={},l={};(function(r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"default",{enumerable:!0,get:function(){return n}});function e(t,o){return{handler:t,config:o}}e.withOptions=function(t,o=()=>({})){const a=function(c){return{__options:c,handler:t(c),config:o(c)}};return a.__isOptionsFunction=!0,a.__pluginFunction=t,a.__configFunction=o,a};const n=e})(l);(function(r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"default",{enumerable:!0,get:function(){return t}});const e=n(l);function n(o){return o&&o.__esModule?o:{default:o}}const t=e.default})(u);let d=u;var b=(d.__esModule?d:{default:d}).default;const D=p.getDefaultExportFromCjs(b),F=r=>({darkMode:"class",content:[...r,"node_modules/@chaibuilder/sdk/dist/*.{js,cjs}"],theme:{container:{center:!0,padding:"2rem",screens:{"2xl":"1400px"}},extend:_()},plugins:[v]}),T=r=>{const e=r.match(/#styles:[^"]+/g)||[];return m.flatten(e.map(n=>n.replace("#styles:","").replace(","," ").replace(/ +/g," ").split(" ")))},x=r=>{const e=r.primaryColor,n=r.secondaryColor,t=r.headingFont,o=r.bodyFont,a=r.roundedCorners,c=r.bodyBgLightColor,s=r.bodyBgDarkColor,i=r.bodyTextLightColor,g=r.bodyTextDarkColor,h={bgLightMode:c,bgDarkMode:s,textLightMode:i,textDarkMode:g},f=y([{color:e,name:"primary"},{color:n,name:"secondary"}]);return{fontFamily:{heading:[t],body:[o]},extend:{borderRadius:{global:`${a||"0"}px`},colors:{...f,...h}}}},E=D(function({addBase:r,theme:e}){r({html:{scrollBehavior:"smooth"},"h1,h2,h3,h4,h5,h6":{fontFamily:e("fontFamily.heading")},body:{fontFamily:e("fontFamily.body"),color:e("colors.textLightMode"),backgroundColor:e("colors.bgLightMode")},".dark body":{color:e("colors.textDarkMode"),backgroundColor:e("colors.bgDarkMode")}})});exports.chaiBuilderPlugin=E;exports.chaiBuilderTailwindConfig=F;exports.classesExtractor=T;exports.getTheme=x;
|
package/dist/tailwind.d.ts
CHANGED
|
@@ -1,3 +1,23 @@
|
|
|
1
|
+
import { Config } from 'tailwindcss/types/config';
|
|
2
|
+
import { PluginCreator } from 'tailwindcss/types/config';
|
|
3
|
+
|
|
4
|
+
declare type BrandingOptions = {
|
|
5
|
+
bodyBgDarkColor: string;
|
|
6
|
+
bodyBgLightColor: string;
|
|
7
|
+
bodyFont: string;
|
|
8
|
+
bodyTextDarkColor: string;
|
|
9
|
+
bodyTextLightColor: string;
|
|
10
|
+
headingFont: string;
|
|
11
|
+
primaryColor: string;
|
|
12
|
+
roundedCorners: number;
|
|
13
|
+
secondaryColor: string;
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
export declare const chaiBuilderPlugin: {
|
|
17
|
+
handler: PluginCreator;
|
|
18
|
+
config?: Partial<Config>;
|
|
19
|
+
};
|
|
20
|
+
|
|
1
21
|
export declare const chaiBuilderTailwindConfig: (content: string[]) => {
|
|
2
22
|
darkMode: string;
|
|
3
23
|
content: string[];
|
|
@@ -77,4 +97,21 @@ export declare const chaiBuilderTailwindConfig: (content: string[]) => {
|
|
|
77
97
|
plugins: any[];
|
|
78
98
|
};
|
|
79
99
|
|
|
100
|
+
export declare const classesExtractor: (content: string) => string[];
|
|
101
|
+
|
|
102
|
+
export declare const getTheme: (brandingOptions: BrandingOptions) => {
|
|
103
|
+
fontFamily: {
|
|
104
|
+
heading: string[];
|
|
105
|
+
body: string[];
|
|
106
|
+
};
|
|
107
|
+
extend: {
|
|
108
|
+
borderRadius: {
|
|
109
|
+
global: string;
|
|
110
|
+
};
|
|
111
|
+
colors: {
|
|
112
|
+
[x: string]: string | Record<string, string>;
|
|
113
|
+
};
|
|
114
|
+
};
|
|
115
|
+
};
|
|
116
|
+
|
|
80
117
|
export { }
|
package/dist/tailwind.js
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
1
|
+
import m from "tailwindcss-animate";
|
|
2
|
+
import { flatten as v } from "lodash";
|
|
3
|
+
import p from "tailwindcss-palette-generator";
|
|
4
|
+
import { g as y } from "./_commonjsHelpers-UyOWmZb0.js";
|
|
5
|
+
function _(r = {}) {
|
|
3
6
|
return {
|
|
4
7
|
colors: {
|
|
5
8
|
border: "hsl(var(--border))",
|
|
@@ -58,13 +61,58 @@ function e(r = {}) {
|
|
|
58
61
|
...r
|
|
59
62
|
};
|
|
60
63
|
}
|
|
61
|
-
|
|
64
|
+
var u = {}, l = {};
|
|
65
|
+
(function(r) {
|
|
66
|
+
"use strict";
|
|
67
|
+
Object.defineProperty(r, "__esModule", {
|
|
68
|
+
value: !0
|
|
69
|
+
}), Object.defineProperty(r, "default", {
|
|
70
|
+
enumerable: !0,
|
|
71
|
+
get: function() {
|
|
72
|
+
return n;
|
|
73
|
+
}
|
|
74
|
+
});
|
|
75
|
+
function o(t, e) {
|
|
76
|
+
return {
|
|
77
|
+
handler: t,
|
|
78
|
+
config: e
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
o.withOptions = function(t, e = () => ({})) {
|
|
82
|
+
const a = function(c) {
|
|
83
|
+
return {
|
|
84
|
+
__options: c,
|
|
85
|
+
handler: t(c),
|
|
86
|
+
config: e(c)
|
|
87
|
+
};
|
|
88
|
+
};
|
|
89
|
+
return a.__isOptionsFunction = !0, a.__pluginFunction = t, a.__configFunction = e, a;
|
|
90
|
+
};
|
|
91
|
+
const n = o;
|
|
92
|
+
})(l);
|
|
93
|
+
(function(r) {
|
|
94
|
+
"use strict";
|
|
95
|
+
Object.defineProperty(r, "__esModule", {
|
|
96
|
+
value: !0
|
|
97
|
+
}), Object.defineProperty(r, "default", {
|
|
98
|
+
enumerable: !0,
|
|
99
|
+
get: function() {
|
|
100
|
+
return t;
|
|
101
|
+
}
|
|
102
|
+
});
|
|
103
|
+
const o = /* @__PURE__ */ n(l);
|
|
104
|
+
function n(e) {
|
|
105
|
+
return e && e.__esModule ? e : {
|
|
106
|
+
default: e
|
|
107
|
+
};
|
|
108
|
+
}
|
|
109
|
+
const t = o.default;
|
|
110
|
+
})(u);
|
|
111
|
+
let d = u;
|
|
112
|
+
var b = (d.__esModule ? d : { default: d }).default;
|
|
113
|
+
const D = /* @__PURE__ */ y(b), E = (r) => ({
|
|
62
114
|
darkMode: "class",
|
|
63
|
-
content: [
|
|
64
|
-
...r,
|
|
65
|
-
"node_modules/@chaibuilder/sdk/dist/*.{js,cjs}",
|
|
66
|
-
"node_modules/@chaibuilder/runtime/dist/*.{js,cjs}"
|
|
67
|
-
],
|
|
115
|
+
content: [...r, "node_modules/@chaibuilder/sdk/dist/*.{js,cjs}"],
|
|
68
116
|
theme: {
|
|
69
117
|
container: {
|
|
70
118
|
center: !0,
|
|
@@ -73,10 +121,53 @@ const d = (r) => ({
|
|
|
73
121
|
"2xl": "1400px"
|
|
74
122
|
}
|
|
75
123
|
},
|
|
76
|
-
extend:
|
|
124
|
+
extend: _()
|
|
77
125
|
},
|
|
78
|
-
plugins: [
|
|
126
|
+
plugins: [m]
|
|
127
|
+
}), L = (r) => {
|
|
128
|
+
const o = r.match(/#styles:[^"]+/g) || [];
|
|
129
|
+
return v(
|
|
130
|
+
o.map((n) => n.replace("#styles:", "").replace(",", " ").replace(/ +/g, " ").split(" "))
|
|
131
|
+
);
|
|
132
|
+
}, k = (r) => {
|
|
133
|
+
const o = r.primaryColor, n = r.secondaryColor, t = r.headingFont, e = r.bodyFont, a = r.roundedCorners, c = r.bodyBgLightColor, i = r.bodyBgDarkColor, s = r.bodyTextLightColor, g = r.bodyTextDarkColor, h = {
|
|
134
|
+
bgLightMode: c,
|
|
135
|
+
bgDarkMode: i,
|
|
136
|
+
textLightMode: s,
|
|
137
|
+
textDarkMode: g
|
|
138
|
+
}, f = p([
|
|
139
|
+
{ color: o, name: "primary" },
|
|
140
|
+
{ color: n, name: "secondary" }
|
|
141
|
+
]);
|
|
142
|
+
return {
|
|
143
|
+
fontFamily: { heading: [t], body: [e] },
|
|
144
|
+
extend: {
|
|
145
|
+
borderRadius: { global: `${a || "0"}px` },
|
|
146
|
+
colors: { ...f, ...h }
|
|
147
|
+
}
|
|
148
|
+
};
|
|
149
|
+
}, P = D(function({ addBase: r, theme: o }) {
|
|
150
|
+
r({
|
|
151
|
+
html: {
|
|
152
|
+
scrollBehavior: "smooth"
|
|
153
|
+
},
|
|
154
|
+
"h1,h2,h3,h4,h5,h6": {
|
|
155
|
+
fontFamily: o("fontFamily.heading")
|
|
156
|
+
},
|
|
157
|
+
body: {
|
|
158
|
+
fontFamily: o("fontFamily.body"),
|
|
159
|
+
color: o("colors.textLightMode"),
|
|
160
|
+
backgroundColor: o("colors.bgLightMode")
|
|
161
|
+
},
|
|
162
|
+
".dark body": {
|
|
163
|
+
color: o("colors.textDarkMode"),
|
|
164
|
+
backgroundColor: o("colors.bgDarkMode")
|
|
165
|
+
}
|
|
166
|
+
});
|
|
79
167
|
});
|
|
80
168
|
export {
|
|
81
|
-
|
|
169
|
+
P as chaiBuilderPlugin,
|
|
170
|
+
E as chaiBuilderTailwindConfig,
|
|
171
|
+
L as classesExtractor,
|
|
172
|
+
k as getTheme
|
|
82
173
|
};
|
package/package.json
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
"author": "Suraj Air",
|
|
6
6
|
"license": "BSD-3-Clause",
|
|
7
7
|
"homepage": "https://chaibuilder.com",
|
|
8
|
-
"version": "1.2.
|
|
8
|
+
"version": "1.2.31",
|
|
9
9
|
"type": "module",
|
|
10
10
|
"repository": {
|
|
11
11
|
"type": "git",
|
|
@@ -87,7 +87,6 @@
|
|
|
87
87
|
"prepare": "husky"
|
|
88
88
|
},
|
|
89
89
|
"dependencies": {
|
|
90
|
-
"@bobthered/tailwindcss-palette-generator": "3.1.1",
|
|
91
90
|
"@chaibuilder/runtime": "0.2.6",
|
|
92
91
|
"@floating-ui/dom": "1.4.5",
|
|
93
92
|
"@floating-ui/react-dom": "2.0.1",
|
|
@@ -151,6 +150,7 @@
|
|
|
151
150
|
"react-wrap-balancer": "^1.1.0",
|
|
152
151
|
"sonner": "^1.2.0",
|
|
153
152
|
"tailwind-merge": "2.3.0",
|
|
153
|
+
"tailwindcss-palette-generator": "^0.6.5",
|
|
154
154
|
"tippy.js": "^6.3.7",
|
|
155
155
|
"undo-manager": "^1.1.1",
|
|
156
156
|
"unsplash-js": "^7.0.18"
|