@chaibuilder/sdk 1.0.21 → 1.0.22
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/README.md +30 -103
- package/dist/{AddBlocks-0-e393Fn.js → AddBlocks--G1jvF_h.js} +5 -4
- package/dist/AddBlocks-kQZRgF1n.cjs +3 -0
- package/dist/{BrandingOptions-HtNCJO9_.cjs → BrandingOptions-3zuS6-D8.cjs} +1 -1
- package/dist/{BrandingOptions-QqqJ-YRb.js → BrandingOptions-dwNB6XlX.js} +1 -1
- package/dist/{CanvasArea-pZz5czrV.cjs → CanvasArea-SzwU-7i5.cjs} +2 -2
- package/dist/{CanvasArea-0hMAhzxn.js → CanvasArea-YM7NWbx0.js} +72 -71
- package/dist/CurrentPage-Fw-gGZIK.cjs +1 -0
- package/dist/{CurrentPage-UOkxZISs.js → CurrentPage-iC1tGuWi.js} +6 -5
- package/dist/Layers-bvtrSZ0e.cjs +1 -0
- package/dist/{Layers-TB-Lriju.js → Layers-tvGxr-fn.js} +7 -6
- package/dist/{MarkAsGlobalBlock-Pa8po8qP.js → MarkAsGlobalBlock-hUoxbVet.js} +1 -1
- package/dist/{MarkAsGlobalBlock-5h3wP4zj.cjs → MarkAsGlobalBlock-wqHaABl_.cjs} +1 -1
- package/dist/{PagesPanel-ffrNyFyp.cjs → PagesPanel-IHkdL59C.cjs} +1 -1
- package/dist/{PagesPanel-mAMSbYPt.js → PagesPanel-w32nyAEE.js} +6 -5
- package/dist/{ProjectPanel-XvsYajju.js → ProjectPanel-1yH8uzoo.js} +7 -6
- package/dist/ProjectPanel-Rt_C00rp.cjs +1 -0
- package/dist/{Settings-8AbHXcDP.js → Settings-MbtN9j5p.js} +6 -5
- package/dist/Settings-zqxhKtAP.cjs +1 -0
- package/dist/SidePanels-PcCVJHFu.cjs +1 -0
- package/dist/{SidePanels-LQg3mdC4.js → SidePanels-WDSKmDRO.js} +7 -6
- package/dist/{Topbar-wA6jhMj9.js → Topbar-QBbGJftd.js} +1 -1
- package/dist/{Topbar-A3WZDrK4.cjs → Topbar-p07CgA1J.cjs} +1 -1
- package/dist/{UnsplashImages-mzIO1QeT.js → UnsplashImages-NOdXhrYp.js} +1 -1
- package/dist/{UnsplashImages-E8zPMgJf.cjs → UnsplashImages-RobUmAqJ.cjs} +1 -1
- package/dist/{UploadImages-qMeaY4sk.js → UploadImages-_yFxI_3x.js} +1 -1
- package/dist/{UploadImages-qEuDUEMn.cjs → UploadImages-oRvUykXU.cjs} +1 -1
- package/dist/{add-page-modal-oER3yE4F.js → add-page-modal-1C4AYlR3.js} +7 -6
- package/dist/add-page-modal-c20toln3.cjs +1 -0
- package/dist/{confirm-alert-rDSai_jQ.js → confirm-alert-LM4La_do.js} +1 -1
- package/dist/{confirm-alert-tH8UCCSF.cjs → confirm-alert-exrulqxB.cjs} +1 -1
- package/dist/core.cjs +1 -1
- package/dist/core.js +56 -55
- package/dist/{delete-page-modal-QzQdrLYI.js → delete-page-modal-ZkdZdhkf.js} +6 -5
- package/dist/{delete-page-modal-ShTRkqkB.cjs → delete-page-modal-sMfhH69k.cjs} +1 -1
- package/dist/{form-MlgUSEy_.cjs → form-0TlI-dUt.cjs} +1 -1
- package/dist/{form-vWeEsG9Y.js → form-rvWlnmcr.js} +1 -1
- package/dist/{functions-hmbWDcnW.js → functions-JFP-oMsY.js} +28 -27
- package/dist/{functions-eu6BbvqO.cjs → functions-KMQYiBHf.cjs} +2 -2
- package/dist/{index-pCHSFoQO.cjs → index-8dYzEcE3.cjs} +2 -2
- package/dist/{index-mLIwGF5W.js → index-UPQtDmUs.js} +3 -3
- package/dist/{index-T5MFAHA0.cjs → index-lH7BBNlu.cjs} +1 -1
- package/dist/{index-G55KtqnU.js → index-pgz9p5Yh.js} +2 -2
- package/dist/lib.cjs +1 -1
- package/dist/lib.d.ts +3 -9
- package/dist/lib.js +93 -152
- package/dist/page-viewer-1EuLsHyz.cjs +1 -0
- package/dist/{page-viewer-X3IEOrUC.js → page-viewer-3860AKDT.js} +29 -28
- package/dist/{project-general-setting-HZeYf9A1.cjs → project-general-setting-Bg7qIWUd.cjs} +1 -1
- package/dist/{project-general-setting-oujmeWOG.js → project-general-setting-mg_zEkzX.js} +7 -6
- package/dist/{project-seo-setting-_X6ckVa4.js → project-seo-setting-6Q0gFmHY.js} +2 -2
- package/dist/{project-seo-setting-3FZQXaTn.cjs → project-seo-setting-8B9pZPZN.cjs} +1 -1
- package/dist/render.cjs +1 -1
- package/dist/render.js +1 -1
- package/dist/single-page-detail-52Xz-XJ7.cjs +1 -0
- package/dist/{single-page-detail-SxboE7TI.js → single-page-detail-Asn7bb7f.js} +8 -7
- package/dist/studio.cjs +1 -1
- package/dist/studio.js +5 -4
- package/dist/tailwind-config-OxLD7oFU.cjs +1 -0
- package/dist/tailwind-config-d1VL1lzE.js +62 -0
- package/dist/tailwind.cjs +1 -0
- package/dist/tailwind.d.ts +80 -0
- package/dist/tailwind.js +24 -0
- package/dist/ui.cjs +1 -1
- package/dist/ui.d.ts +1 -1
- package/dist/ui.js +1 -1
- package/package.json +8 -3
- package/dist/AddBlocks-p68Cz79o.cjs +0 -3
- package/dist/CurrentPage-phMDH1Ub.cjs +0 -1
- package/dist/Layers-NKZXi2LV.cjs +0 -1
- package/dist/ProjectPanel-1ywILLme.cjs +0 -1
- package/dist/Settings-hdmnT_mI.cjs +0 -1
- package/dist/SidePanels-xaNrI3oK.cjs +0 -1
- package/dist/add-page-modal-9deiA1W9.cjs +0 -1
- package/dist/page-viewer-GPNN1H92.cjs +0 -1
- package/dist/single-page-detail-ILshOKys.cjs +0 -1
package/dist/lib.js
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { g as
|
|
2
|
-
import { b as
|
|
3
|
-
import { stringify as
|
|
4
|
-
import { includes as
|
|
5
|
-
import { a as
|
|
6
|
-
import {
|
|
1
|
+
import { g as I, c as A, a as B } from "./utils-PPBbw5bk.js";
|
|
2
|
+
import { b as me } from "./utils-PPBbw5bk.js";
|
|
3
|
+
import { stringify as k, parse as O } from "himalaya";
|
|
4
|
+
import { includes as p, get as l, isEmpty as _, forEach as N, find as x, set as m, capitalize as P, flatMapDeep as V, filter as E, omit as H, flatten as R, first as F, keys as g, map as S, parseInt as W } from "lodash";
|
|
5
|
+
import { a as ge, b as fe, g as he, d as de, c as ye } from "./functions-JFP-oMsY.js";
|
|
6
|
+
import { c as be } from "./tailwind-config-d1VL1lzE.js";
|
|
7
|
+
import { a as d } from "./MODIFIERS-MLfpKQY1.js";
|
|
7
8
|
import "clsx";
|
|
8
9
|
import "tailwind-merge";
|
|
9
10
|
import "@mhsdesign/jit-browser-tailwindcss";
|
|
@@ -12,7 +13,7 @@ import "@tailwindcss/forms";
|
|
|
12
13
|
import "@tailwindcss/typography";
|
|
13
14
|
import "@tailwindcss/aspect-ratio";
|
|
14
15
|
import "@tailwindcss/line-clamp";
|
|
15
|
-
const
|
|
16
|
+
const M = {
|
|
16
17
|
img: { alt: "alt", width: "width", height: "height", src: "image" },
|
|
17
18
|
video: {
|
|
18
19
|
src: "url",
|
|
@@ -45,28 +46,28 @@ const H = {
|
|
|
45
46
|
multiple: "multiple",
|
|
46
47
|
name: "fieldName"
|
|
47
48
|
}
|
|
48
|
-
},
|
|
49
|
-
const
|
|
50
|
-
return
|
|
51
|
-
if (
|
|
49
|
+
}, D = (e, a) => e.children.length === 1 && p(["Heading", "Paragraph", "Span", "ListItem", "Button", "Label", "TableCell", "Link"], a._type), L = (e) => e.map((a) => a.type === "text" ? l(a, "content", "") : _(a.children) ? "" : L(a.children)).join(""), v = (e) => e === null ? !0 : e, w = (e) => {
|
|
50
|
+
const a = {}, s = M[e.tagName] || {}, c = e.attributes;
|
|
51
|
+
return N(c, ({ key: t, value: i }) => {
|
|
52
|
+
if (s[t]) {
|
|
52
53
|
if (e.tagName === "img" && t === "src" && !i.startsWith("http")) {
|
|
53
|
-
const
|
|
54
|
-
|
|
54
|
+
const r = x(e.attributes, { key: "width" }), n = x(e.attributes, { key: "height" });
|
|
55
|
+
r && n ? i = `https://via.placeholder.com/${r == null ? void 0 : r.value}x${n == null ? void 0 : n.value}` : i = "https://via.placeholder.com/150x150";
|
|
55
56
|
}
|
|
56
|
-
m(
|
|
57
|
+
m(a, s[t], v(i));
|
|
57
58
|
} else
|
|
58
|
-
|
|
59
|
-
}), delete
|
|
60
|
-
},
|
|
59
|
+
p(["style", "class", "srcset"], t) || m(a, `styles_attrs.${t}`, v(i));
|
|
60
|
+
}), delete a.class, a;
|
|
61
|
+
}, X = (e, a = "styles") => {
|
|
61
62
|
if (!e.attributes)
|
|
62
|
-
return { [
|
|
63
|
-
const
|
|
64
|
-
if (
|
|
65
|
-
const c =
|
|
66
|
-
return { [
|
|
63
|
+
return { [a]: `${d},` };
|
|
64
|
+
const s = x(e.attributes, { key: "class" });
|
|
65
|
+
if (s) {
|
|
66
|
+
const c = s.value;
|
|
67
|
+
return { [a]: `${d},${c}` };
|
|
67
68
|
}
|
|
68
|
-
return { [
|
|
69
|
-
},
|
|
69
|
+
return { [a]: `${d},` };
|
|
70
|
+
}, z = (e) => {
|
|
70
71
|
switch (e.tagName) {
|
|
71
72
|
case "img":
|
|
72
73
|
return { _type: "Image" };
|
|
@@ -143,45 +144,45 @@ const H = {
|
|
|
143
144
|
return {
|
|
144
145
|
_type: "Box",
|
|
145
146
|
tag: e.tagName,
|
|
146
|
-
name: e.tagName === "div" ? "Box" :
|
|
147
|
+
name: e.tagName === "div" ? "Box" : P(e.tagName)
|
|
147
148
|
};
|
|
148
149
|
}
|
|
149
|
-
},
|
|
150
|
+
}, C = (e, a = null) => V(e, (s) => {
|
|
150
151
|
var i;
|
|
151
|
-
if (
|
|
152
|
+
if (s.type === "comment")
|
|
152
153
|
return [];
|
|
153
|
-
let c = { _id:
|
|
154
|
-
if (
|
|
155
|
-
return _(
|
|
154
|
+
let c = { _id: I() };
|
|
155
|
+
if (a && (c._parent = a.block._id), s.type === "text")
|
|
156
|
+
return _(l(s, "content", "")) ? [] : a && D(a.node, a.block) ? (m(a, "block.content", l(s, "content", "")), []) : { ...c, _type: "Text", content: l(s, "content", "") };
|
|
156
157
|
if (c = {
|
|
157
158
|
...c,
|
|
158
|
-
...
|
|
159
|
-
...w(
|
|
160
|
-
...
|
|
159
|
+
...z(s),
|
|
160
|
+
...w(s),
|
|
161
|
+
...X(s)
|
|
161
162
|
}, c._type === "Input") {
|
|
162
|
-
const
|
|
163
|
-
|
|
163
|
+
const r = c.inputType || "text";
|
|
164
|
+
r === "checkbox" ? m(c, "_type", "Checkbox") : r === "radio" && m(c, "_type", "Radio");
|
|
164
165
|
} else {
|
|
165
|
-
if (
|
|
166
|
-
return c.content =
|
|
167
|
-
if (
|
|
168
|
-
const
|
|
169
|
-
return c.styles = `${
|
|
170
|
-
} else if (
|
|
171
|
-
return
|
|
172
|
-
label:
|
|
173
|
-
...w(
|
|
166
|
+
if (s.tagName === "video")
|
|
167
|
+
return c.content = k([s]), [c];
|
|
168
|
+
if (s.tagName === "svg") {
|
|
169
|
+
const r = x(s.attributes, { key: "height" }), n = x(s.attributes, { key: "width" }), f = l(r, "value") ? `[${l(r, "value")}px]` : "full", h = l(n, "value") ? `[${l(n, "value")}px]` : "full", b = l(x(s.attributes, { key: "class" }), "value");
|
|
170
|
+
return c.styles = `${d}, ${A(`w-${h} h-${f}`, b)}`.trim(), s.attributes = E(s.attributes, (y) => !p(["style", "width", "height", "class"], y.key)), c.icon = k([s]), m(c, "styles_attrs", H(l(c, "styles_attrs") || {}, ["height", "width", "style", "class"])), [c];
|
|
171
|
+
} else if (s.tagName == "option" && a && ((i = a.block) == null ? void 0 : i._type) === "Select")
|
|
172
|
+
return a.block.options.push({
|
|
173
|
+
label: L(s.children),
|
|
174
|
+
...w(s)
|
|
174
175
|
}), [];
|
|
175
176
|
}
|
|
176
|
-
const t =
|
|
177
|
+
const t = C(s.children, { block: c, node: s });
|
|
177
178
|
return [c, ...t];
|
|
178
|
-
}),
|
|
179
|
-
const
|
|
180
|
-
return (
|
|
181
|
-
},
|
|
182
|
-
const
|
|
183
|
-
return _(e) ? [] :
|
|
184
|
-
},
|
|
179
|
+
}), U = (e) => {
|
|
180
|
+
const a = e.match(/<body[^>]*>[\s\S]*?<\/body>/);
|
|
181
|
+
return (a && a.length > 0 ? a[0].replace(/<body/, "<div").replace(/<\/body>/, "</div>") : e).replace(/\s+/g, " ").replaceAll("> <", "><").replace(/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi, "").trim();
|
|
182
|
+
}, ne = (e) => {
|
|
183
|
+
const a = O(U(e));
|
|
184
|
+
return _(e) ? [] : R(C(a));
|
|
185
|
+
}, $ = {
|
|
185
186
|
25: "1/4",
|
|
186
187
|
"33.33": "1/3",
|
|
187
188
|
50: "1/2",
|
|
@@ -239,18 +240,18 @@ const q = 16, j = 4;
|
|
|
239
240
|
function G(e) {
|
|
240
241
|
return e.indexOf("rem") !== -1 && (e = `${parseFloat(e.replace("rem", "")) * q}px`), e;
|
|
241
242
|
}
|
|
242
|
-
const
|
|
243
|
-
const
|
|
244
|
-
if (r === null)
|
|
245
|
-
return e;
|
|
246
|
-
const a = I(e);
|
|
243
|
+
const pe = (e) => {
|
|
244
|
+
const a = e.match(/\[.*\]/);
|
|
247
245
|
if (a === null)
|
|
248
246
|
return e;
|
|
249
|
-
const
|
|
250
|
-
|
|
247
|
+
const s = B(e);
|
|
248
|
+
if (s === null)
|
|
249
|
+
return e;
|
|
250
|
+
const { property: c } = s;
|
|
251
|
+
let t = F(a).replace(/\]/i, "").replace(/\[/i, "");
|
|
251
252
|
const i = e.replace(/\[.*\]/i, "");
|
|
252
253
|
t = G(t);
|
|
253
|
-
let
|
|
254
|
+
let r = e;
|
|
254
255
|
switch (c) {
|
|
255
256
|
case "top":
|
|
256
257
|
case "right":
|
|
@@ -284,27 +285,27 @@ const oe = (e) => {
|
|
|
284
285
|
case "spaceX":
|
|
285
286
|
case "spaceY":
|
|
286
287
|
if (t.indexOf("px") !== -1) {
|
|
287
|
-
const u =
|
|
288
|
-
if (
|
|
289
|
-
const
|
|
290
|
-
|
|
288
|
+
const u = S(g(Y), (o) => `${o}px`);
|
|
289
|
+
if (p(u, t)) {
|
|
290
|
+
const o = W(t.replace("px", ""), 10);
|
|
291
|
+
o === 1 ? r = `${i}px` : r = i + o / j;
|
|
291
292
|
}
|
|
292
293
|
}
|
|
293
294
|
if (t.indexOf("%") !== -1) {
|
|
294
|
-
const u =
|
|
295
|
-
if (
|
|
296
|
-
const
|
|
297
|
-
|
|
295
|
+
const u = S(g($), (o) => `${o}%`);
|
|
296
|
+
if (p(u, t)) {
|
|
297
|
+
const o = parseFloat(t.replace("%", ""));
|
|
298
|
+
r = i + l($, o);
|
|
298
299
|
}
|
|
299
300
|
}
|
|
300
|
-
t.indexOf("vw") !== -1 && parseFloat(t.replace("vw", "")) === 100 && (
|
|
301
|
+
t.indexOf("vw") !== -1 && parseFloat(t.replace("vw", "")) === 100 && (r = `${i}screen`), t.indexOf("vh") !== -1 && parseFloat(t.replace("vh", "")) === 100 && (r = `${i}screen`);
|
|
301
302
|
break;
|
|
302
303
|
case "minWidth":
|
|
303
|
-
t.indexOf("%") !== -1 && parseFloat(t.replace("%", "")) === 100 && (
|
|
304
|
+
t.indexOf("%") !== -1 && parseFloat(t.replace("%", "")) === 100 && (r = `${i}full`), t === "0px" && (r = "min-w-0");
|
|
304
305
|
break;
|
|
305
306
|
case "maxWidth":
|
|
306
|
-
t === "0px" && (
|
|
307
|
-
const
|
|
307
|
+
t === "0px" && (r = "max-w-0");
|
|
308
|
+
const n = {
|
|
308
309
|
"320px": "xs",
|
|
309
310
|
"384px": "sm",
|
|
310
311
|
"448px": "md",
|
|
@@ -321,13 +322,13 @@ const oe = (e) => {
|
|
|
321
322
|
"640px": "screen-sm",
|
|
322
323
|
"1536px": "screen-2xl"
|
|
323
324
|
};
|
|
324
|
-
|
|
325
|
+
p(g(n), t) && (r = `max-w-${n[t]}`);
|
|
325
326
|
break;
|
|
326
327
|
case "minHeight":
|
|
327
|
-
t.indexOf("%") !== -1 && parseFloat(t.replace("%", "")) === 100 && (
|
|
328
|
+
t.indexOf("%") !== -1 && parseFloat(t.replace("%", "")) === 100 && (r = `${i}full`), t === "0px" && (r = "min-h-0"), t === "100vh" && (r = "min-h-screen");
|
|
328
329
|
break;
|
|
329
330
|
case "fontSize":
|
|
330
|
-
const
|
|
331
|
+
const f = {
|
|
331
332
|
"12px": "xs",
|
|
332
333
|
"14px": "sm",
|
|
333
334
|
"16px": "base",
|
|
@@ -342,7 +343,7 @@ const oe = (e) => {
|
|
|
342
343
|
"96px": "8xl",
|
|
343
344
|
"128px": "9xl"
|
|
344
345
|
};
|
|
345
|
-
|
|
346
|
+
p(g(f), t) && (r = i + f[t]);
|
|
346
347
|
break;
|
|
347
348
|
case "lineHeight":
|
|
348
349
|
const h = {
|
|
@@ -361,10 +362,10 @@ const oe = (e) => {
|
|
|
361
362
|
"1.625": "relaxed",
|
|
362
363
|
2: "loose"
|
|
363
364
|
};
|
|
364
|
-
|
|
365
|
+
p(g(h), t) && (r = i + h[t]);
|
|
365
366
|
break;
|
|
366
367
|
case "zIndex":
|
|
367
|
-
|
|
368
|
+
r = ["0", "10", "20", "30", "40", "50"].indexOf(t) !== -1 ? `${i}${t}` : e;
|
|
368
369
|
break;
|
|
369
370
|
case "opacity":
|
|
370
371
|
const y = [
|
|
@@ -383,84 +384,24 @@ const oe = (e) => {
|
|
|
383
384
|
"90",
|
|
384
385
|
"95",
|
|
385
386
|
"100"
|
|
386
|
-
],
|
|
387
|
-
|
|
387
|
+
], T = parseFloat(t) * 100;
|
|
388
|
+
p(y, T.toString()) && (r = `opacity-${T}`);
|
|
388
389
|
break;
|
|
389
390
|
default:
|
|
390
391
|
break;
|
|
391
392
|
}
|
|
392
|
-
return
|
|
393
|
+
return r;
|
|
393
394
|
};
|
|
394
|
-
function pe() {
|
|
395
|
-
return {
|
|
396
|
-
colors: {
|
|
397
|
-
border: "hsl(var(--border))",
|
|
398
|
-
input: "hsl(var(--input))",
|
|
399
|
-
ring: "hsl(var(--ring))",
|
|
400
|
-
background: "hsl(var(--background))",
|
|
401
|
-
foreground: "hsl(var(--foreground))",
|
|
402
|
-
primary: {
|
|
403
|
-
DEFAULT: "hsl(var(--primary))",
|
|
404
|
-
foreground: "hsl(var(--primary-foreground))"
|
|
405
|
-
},
|
|
406
|
-
secondary: {
|
|
407
|
-
DEFAULT: "hsl(var(--secondary))",
|
|
408
|
-
foreground: "hsl(var(--secondary-foreground))"
|
|
409
|
-
},
|
|
410
|
-
destructive: {
|
|
411
|
-
DEFAULT: "hsl(var(--destructive))",
|
|
412
|
-
foreground: "hsl(var(--destructive-foreground))"
|
|
413
|
-
},
|
|
414
|
-
muted: {
|
|
415
|
-
DEFAULT: "hsl(var(--muted))",
|
|
416
|
-
foreground: "hsl(var(--muted-foreground))"
|
|
417
|
-
},
|
|
418
|
-
accent: {
|
|
419
|
-
DEFAULT: "hsl(var(--accent))",
|
|
420
|
-
foreground: "hsl(var(--accent-foreground))"
|
|
421
|
-
},
|
|
422
|
-
popover: {
|
|
423
|
-
DEFAULT: "hsl(var(--popover))",
|
|
424
|
-
foreground: "hsl(var(--popover-foreground))"
|
|
425
|
-
},
|
|
426
|
-
card: {
|
|
427
|
-
DEFAULT: "hsl(var(--card))",
|
|
428
|
-
foreground: "hsl(var(--card-foreground))"
|
|
429
|
-
}
|
|
430
|
-
},
|
|
431
|
-
borderRadius: {
|
|
432
|
-
lg: "var(--radius)",
|
|
433
|
-
md: "calc(var(--radius) - 2px)",
|
|
434
|
-
sm: "calc(var(--radius) - 4px)"
|
|
435
|
-
},
|
|
436
|
-
keyframes: {
|
|
437
|
-
"accordion-down": {
|
|
438
|
-
from: { height: "0" },
|
|
439
|
-
to: { height: "var(--radix-accordion-content-height)" }
|
|
440
|
-
},
|
|
441
|
-
"accordion-up": {
|
|
442
|
-
from: { height: "var(--radix-accordion-content-height)" },
|
|
443
|
-
to: { height: "0" }
|
|
444
|
-
}
|
|
445
|
-
},
|
|
446
|
-
animation: {
|
|
447
|
-
"accordion-down": "accordion-down 0.2s ease-out",
|
|
448
|
-
"accordion-up": "accordion-up 0.2s ease-out"
|
|
449
|
-
}
|
|
450
|
-
};
|
|
451
|
-
}
|
|
452
|
-
const ue = (e) => ({ ...e }), me = (e) => ({ ...e });
|
|
453
395
|
export {
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
me as styling
|
|
396
|
+
ge as addPrefixToClasses,
|
|
397
|
+
be as chaiBuilderTheme,
|
|
398
|
+
A as cn,
|
|
399
|
+
pe as convertArbitraryToTailwindClass,
|
|
400
|
+
I as generateUUID,
|
|
401
|
+
ne as getBlocksFromHTML,
|
|
402
|
+
fe as getBlocksTailwindCSS,
|
|
403
|
+
he as getBrandingClasses,
|
|
404
|
+
me as getBreakpointValue,
|
|
405
|
+
de as getStylesForBlocks,
|
|
406
|
+
ye as getStylesForPageData
|
|
466
407
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-WUGKV8jN.cjs"),t=require("react"),n=require("@radix-ui/react-icons"),o=require("./index-lH7BBNlu.cjs"),x=require("./index-8dYzEcE3.cjs");require("./MODIFIERS-WFzDQfiT.cjs");require("@radix-ui/react-toggle");require("class-variance-authority");require("./utils-It2K33fU.cjs");require("lodash");require("clsx");require("tailwind-merge");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("jotai");require("flat-to-nested");require("redux-undo");require("@chaibuilder/runtime");require("@react-hookz/web");require("react-i18next");require("i18next");require("@floating-ui/react-dom");require("react-textarea-autosize");require("flagged");require("react-dnd");require("@minoru/react-dnd-treeview");require("./lib.cjs");require("himalaya");require("./functions-KMQYiBHf.cjs");require("@mhsdesign/jit-browser-tailwindcss");require("@bobthered/tailwindcss-palette-generator");require("@tailwindcss/forms");require("@tailwindcss/typography");require("@tailwindcss/aspect-ratio");require("@tailwindcss/line-clamp");require("./tailwind-config-OxLD7oFU.cjs");require("react-hotkeys-hook");require("sonner");require("lucide-react");const q=t.lazy(()=>Promise.resolve().then(()=>require("./single-page-detail-52Xz-XJ7.cjs"))),m=({pageData:s})=>{const[r,i]=t.useState("CLOSE");return e.jsxRuntimeExports.jsxs(o.Popover,{open:r==="OPEN"||r==="ALERT"||r==="PENDING",onOpenChange:u=>{i(r==="PENDING"?"ALERT":u?"OPEN":"CLOSE")},children:[e.jsxRuntimeExports.jsx(o.PopoverTrigger,{asChild:!0,onClick:u=>{u.stopPropagation(),i("OPEN")},children:e.jsxRuntimeExports.jsx("div",{className:"flex items-center justify-between",children:r==="OPEN"||r==="ALERT"||r==="PENDING"?e.jsxRuntimeExports.jsx(n.ChevronRightIcon,{}):e.jsxRuntimeExports.jsx("div",{className:"hidden hover:text-blue-600 group-hover:flex",children:e.jsxRuntimeExports.jsx(n.GearIcon,{})})})}),e.jsxRuntimeExports.jsx(o.PopoverContent,{side:"right",align:"start",alignOffset:-35,className:"h-screen w-96",children:e.jsxRuntimeExports.jsx(t.Suspense,{fallback:e.jsxRuntimeExports.jsxs("div",{className:"flex w-full animate-pulse flex-col gap-y-3",children:[e.jsxRuntimeExports.jsx("div",{className:"bg-background-300 h-6 w-1/2"}),e.jsxRuntimeExports.jsx("div",{className:"bg-background-300 h-20 w-full"}),e.jsxRuntimeExports.jsx("div",{className:"bg-background-300 h-20 w-full"})]}),children:e.jsxRuntimeExports.jsx(q,{pageData:s,open:r,setOpen:i})})})]})},j=s=>{const[r]=x.useCurrentPage(),{data:i}=x.useProject(),u=x.useChangePage(),l=(i==null?void 0:i.homepage)===s.uuid,a=r===s.uuid,c=()=>u(s);return i?e.jsxRuntimeExports.jsxs("button",{className:`group relative flex w-full cursor-pointer items-center justify-between px-2.5 py-2 ${a?"bg-blue-200 ":""}`,onClick:c,type:"button",children:[e.jsxRuntimeExports.jsxs("div",{className:"flex text-sm items-center gap-x-1.5",children:[l?e.jsxRuntimeExports.jsx(n.HomeIcon,{}):e.jsxRuntimeExports.jsx(n.FileTextIcon,{})," ",s.name]}),e.jsxRuntimeExports.jsx(m,{pageData:s})]}):null},p=({pages:s,isLoading:r})=>r?e.jsxRuntimeExports.jsxs("div",{className:"flex animate-pulse flex-col gap-y-1 px-2.5 pt-2",children:[e.jsxRuntimeExports.jsx("div",{className:"bg-background-200 h-7 w-full"}),e.jsxRuntimeExports.jsx("div",{className:"bg-background-200 h-7 w-full"}),e.jsxRuntimeExports.jsx("div",{className:"bg-background-200 h-7 w-full"})]}):s.length===0?e.jsxRuntimeExports.jsx("div",{className:"px-2.5 pb-2 pt-4",children:"No pages"}):e.jsxRuntimeExports.jsx("div",{className:"-mb-2",children:t.Children.toArray(s.map(i=>e.jsxRuntimeExports.jsx(j,{...i})))});exports.default=p;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { j as
|
|
1
|
+
import { j as t } from "./jsx-runtime-NV737rRe.js";
|
|
2
2
|
import s, { useState as n, Suspense as l } from "react";
|
|
3
3
|
import { ChevronRightIcon as c, GearIcon as u, HomeIcon as d, FileTextIcon as x } from "@radix-ui/react-icons";
|
|
4
|
-
import { b1 as g, b2 as h, b3 as f } from "./index-
|
|
5
|
-
import { e as j, b, d as N } from "./index-
|
|
4
|
+
import { b1 as g, b2 as h, b3 as f } from "./index-pgz9p5Yh.js";
|
|
5
|
+
import { e as j, b, d as N } from "./index-UPQtDmUs.js";
|
|
6
6
|
import "./MODIFIERS-MLfpKQY1.js";
|
|
7
7
|
import "@radix-ui/react-toggle";
|
|
8
8
|
import "class-variance-authority";
|
|
@@ -45,73 +45,74 @@ import "react-dnd";
|
|
|
45
45
|
import "@minoru/react-dnd-treeview";
|
|
46
46
|
import "./lib.js";
|
|
47
47
|
import "himalaya";
|
|
48
|
-
import "./functions-
|
|
48
|
+
import "./functions-JFP-oMsY.js";
|
|
49
49
|
import "@mhsdesign/jit-browser-tailwindcss";
|
|
50
50
|
import "@bobthered/tailwindcss-palette-generator";
|
|
51
51
|
import "@tailwindcss/forms";
|
|
52
52
|
import "@tailwindcss/typography";
|
|
53
53
|
import "@tailwindcss/aspect-ratio";
|
|
54
54
|
import "@tailwindcss/line-clamp";
|
|
55
|
+
import "./tailwind-config-d1VL1lzE.js";
|
|
55
56
|
import "react-hotkeys-hook";
|
|
56
57
|
import "sonner";
|
|
57
58
|
import "lucide-react";
|
|
58
|
-
const v = s.lazy(() => import("./single-page-detail-
|
|
59
|
-
const [
|
|
60
|
-
return /* @__PURE__ */
|
|
59
|
+
const v = s.lazy(() => import("./single-page-detail-Asn7bb7f.js")), P = ({ pageData: r }) => {
|
|
60
|
+
const [e, i] = n("CLOSE");
|
|
61
|
+
return /* @__PURE__ */ t.jsxs(
|
|
61
62
|
g,
|
|
62
63
|
{
|
|
63
|
-
open:
|
|
64
|
+
open: e === "OPEN" || e === "ALERT" || e === "PENDING",
|
|
64
65
|
onOpenChange: (o) => {
|
|
65
|
-
i(
|
|
66
|
+
i(e === "PENDING" ? "ALERT" : o ? "OPEN" : "CLOSE");
|
|
66
67
|
},
|
|
67
68
|
children: [
|
|
68
|
-
/* @__PURE__ */
|
|
69
|
+
/* @__PURE__ */ t.jsx(
|
|
69
70
|
h,
|
|
70
71
|
{
|
|
71
72
|
asChild: !0,
|
|
72
73
|
onClick: (o) => {
|
|
73
74
|
o.stopPropagation(), i("OPEN");
|
|
74
75
|
},
|
|
75
|
-
children: /* @__PURE__ */
|
|
76
|
+
children: /* @__PURE__ */ t.jsx("div", { className: "flex items-center justify-between", children: e === "OPEN" || e === "ALERT" || e === "PENDING" ? /* @__PURE__ */ t.jsx(c, {}) : /* @__PURE__ */ t.jsx("div", { className: "hidden hover:text-blue-600 group-hover:flex", children: /* @__PURE__ */ t.jsx(u, {}) }) })
|
|
76
77
|
}
|
|
77
78
|
),
|
|
78
|
-
/* @__PURE__ */
|
|
79
|
+
/* @__PURE__ */ t.jsx(f, { side: "right", align: "start", alignOffset: -35, className: "h-screen w-96", children: /* @__PURE__ */ t.jsx(
|
|
79
80
|
l,
|
|
80
81
|
{
|
|
81
|
-
fallback: /* @__PURE__ */
|
|
82
|
-
/* @__PURE__ */
|
|
83
|
-
/* @__PURE__ */
|
|
84
|
-
/* @__PURE__ */
|
|
82
|
+
fallback: /* @__PURE__ */ t.jsxs("div", { className: "flex w-full animate-pulse flex-col gap-y-3", children: [
|
|
83
|
+
/* @__PURE__ */ t.jsx("div", { className: "bg-background-300 h-6 w-1/2" }),
|
|
84
|
+
/* @__PURE__ */ t.jsx("div", { className: "bg-background-300 h-20 w-full" }),
|
|
85
|
+
/* @__PURE__ */ t.jsx("div", { className: "bg-background-300 h-20 w-full" })
|
|
85
86
|
] }),
|
|
86
|
-
children: /* @__PURE__ */
|
|
87
|
+
children: /* @__PURE__ */ t.jsx(v, { pageData: r, open: e, setOpen: i })
|
|
87
88
|
}
|
|
88
89
|
) })
|
|
89
90
|
]
|
|
90
91
|
}
|
|
91
92
|
);
|
|
92
93
|
}, E = (r) => {
|
|
93
|
-
const [
|
|
94
|
-
return i ? /* @__PURE__ */
|
|
94
|
+
const [e] = j(), { data: i } = b(), o = N(), m = (i == null ? void 0 : i.homepage) === r.uuid, p = e === r.uuid, a = () => o(r);
|
|
95
|
+
return i ? /* @__PURE__ */ t.jsxs(
|
|
95
96
|
"button",
|
|
96
97
|
{
|
|
97
98
|
className: `group relative flex w-full cursor-pointer items-center justify-between px-2.5 py-2 ${p ? "bg-blue-200 " : ""}`,
|
|
98
99
|
onClick: a,
|
|
99
100
|
type: "button",
|
|
100
101
|
children: [
|
|
101
|
-
/* @__PURE__ */
|
|
102
|
-
m ? /* @__PURE__ */
|
|
102
|
+
/* @__PURE__ */ t.jsxs("div", { className: "flex text-sm items-center gap-x-1.5", children: [
|
|
103
|
+
m ? /* @__PURE__ */ t.jsx(d, {}) : /* @__PURE__ */ t.jsx(x, {}),
|
|
103
104
|
" ",
|
|
104
105
|
r.name
|
|
105
106
|
] }),
|
|
106
|
-
/* @__PURE__ */
|
|
107
|
+
/* @__PURE__ */ t.jsx(P, { pageData: r })
|
|
107
108
|
]
|
|
108
109
|
}
|
|
109
110
|
) : null;
|
|
110
|
-
},
|
|
111
|
-
/* @__PURE__ */
|
|
112
|
-
/* @__PURE__ */
|
|
113
|
-
/* @__PURE__ */
|
|
114
|
-
] }) : r.length === 0 ? /* @__PURE__ */
|
|
111
|
+
}, yt = ({ pages: r, isLoading: e }) => e ? /* @__PURE__ */ t.jsxs("div", { className: "flex animate-pulse flex-col gap-y-1 px-2.5 pt-2", children: [
|
|
112
|
+
/* @__PURE__ */ t.jsx("div", { className: "bg-background-200 h-7 w-full" }),
|
|
113
|
+
/* @__PURE__ */ t.jsx("div", { className: "bg-background-200 h-7 w-full" }),
|
|
114
|
+
/* @__PURE__ */ t.jsx("div", { className: "bg-background-200 h-7 w-full" })
|
|
115
|
+
] }) : r.length === 0 ? /* @__PURE__ */ t.jsx("div", { className: "px-2.5 pb-2 pt-4", children: "No pages" }) : /* @__PURE__ */ t.jsx("div", { className: "-mb-2", children: s.Children.toArray(r.map((i) => /* @__PURE__ */ t.jsx(E, { ...i }))) });
|
|
115
116
|
export {
|
|
116
|
-
|
|
117
|
+
yt as default
|
|
117
118
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const q=require("./jsx-runtime-WUGKV8jN.cjs"),a=require("react"),f=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const q=require("./jsx-runtime-WUGKV8jN.cjs"),a=require("react"),f=require("./index-lH7BBNlu.cjs"),o=require("./controls-aHZq-q4b.cjs"),d=require("./form-0TlI-dUt.cjs"),m=require("./index-8dYzEcE3.cjs");require("./MODIFIERS-WFzDQfiT.cjs");require("@radix-ui/react-toggle");require("class-variance-authority");require("./utils-It2K33fU.cjs");require("lodash");require("clsx");require("tailwind-merge");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("jotai");require("flat-to-nested");require("redux-undo");require("@chaibuilder/runtime");require("@react-hookz/web");require("react-i18next");require("@rjsf/core");require("@rjsf/validator-ajv8");require("i18next");require("@floating-ui/react-dom");require("react-textarea-autosize");require("flagged");require("react-dnd");require("@minoru/react-dnd-treeview");require("./lib.cjs");require("himalaya");require("./functions-KMQYiBHf.cjs");require("@mhsdesign/jit-browser-tailwindcss");require("@bobthered/tailwindcss-palette-generator");require("@tailwindcss/forms");require("@tailwindcss/typography");require("@tailwindcss/aspect-ratio");require("@tailwindcss/line-clamp");require("./tailwind-config-OxLD7oFU.cjs");require("react-hotkeys-hook");require("sonner");require("lucide-react");function j(r){const i=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(r){for(const e in r)if(e!=="default"){const u=Object.getOwnPropertyDescriptor(r,e);Object.defineProperty(i,e,u.get?u:{enumerable:!0,get:()=>r[e]})}}return i.default=r,Object.freeze(i)}const g=j(a),b=({_projectData:r,seany:i})=>{const{data:e,isLoading:u}=m.useProject();g.useEffect(()=>{e&&i(e)},[e,i]);const n=({formData:s},t)=>{i(l=>({...l,[t]:s[t]}))},c={name:o.u({title:"Project Name",default:e==null?void 0:e.name}),favicon:o.o({title:"Favicon",default:e==null?void 0:e.favicon})};return q.jsxRuntimeExports.jsx(f.ScrollArea,{className:"flex h-full select-none flex-col",children:q.jsxRuntimeExports.jsx(d.Form,{properties:c,disabled:u,formData:r,onChange:n})})};exports.default=b;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { j as i } from "./jsx-runtime-NV737rRe.js";
|
|
2
2
|
import * as l from "react";
|
|
3
|
-
import { bp as n } from "./index-
|
|
3
|
+
import { bp as n } from "./index-pgz9p5Yh.js";
|
|
4
4
|
import { u as c, o as u } from "./controls-G0puEH71.js";
|
|
5
|
-
import { F as d } from "./form-
|
|
6
|
-
import { b as x } from "./index-
|
|
5
|
+
import { F as d } from "./form-rvWlnmcr.js";
|
|
6
|
+
import { b as x } from "./index-UPQtDmUs.js";
|
|
7
7
|
import "./MODIFIERS-MLfpKQY1.js";
|
|
8
8
|
import "@radix-ui/react-toggle";
|
|
9
9
|
import "class-variance-authority";
|
|
@@ -49,17 +49,18 @@ import "react-dnd";
|
|
|
49
49
|
import "@minoru/react-dnd-treeview";
|
|
50
50
|
import "./lib.js";
|
|
51
51
|
import "himalaya";
|
|
52
|
-
import "./functions-
|
|
52
|
+
import "./functions-JFP-oMsY.js";
|
|
53
53
|
import "@mhsdesign/jit-browser-tailwindcss";
|
|
54
54
|
import "@bobthered/tailwindcss-palette-generator";
|
|
55
55
|
import "@tailwindcss/forms";
|
|
56
56
|
import "@tailwindcss/typography";
|
|
57
57
|
import "@tailwindcss/aspect-ratio";
|
|
58
58
|
import "@tailwindcss/line-clamp";
|
|
59
|
+
import "./tailwind-config-d1VL1lzE.js";
|
|
59
60
|
import "react-hotkeys-hook";
|
|
60
61
|
import "sonner";
|
|
61
62
|
import "lucide-react";
|
|
62
|
-
const
|
|
63
|
+
const Eo = ({
|
|
63
64
|
_projectData: m,
|
|
64
65
|
seany: t
|
|
65
66
|
}) => {
|
|
@@ -82,5 +83,5 @@ const Ro = ({
|
|
|
82
83
|
return /* @__PURE__ */ i.jsx(n, { className: "flex h-full select-none flex-col", children: /* @__PURE__ */ i.jsx(d, { properties: a, disabled: p, formData: m, onChange: e }) });
|
|
83
84
|
};
|
|
84
85
|
export {
|
|
85
|
-
|
|
86
|
+
Eo as default
|
|
86
87
|
};
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { j as s } from "./jsx-runtime-NV737rRe.js";
|
|
2
2
|
import { b as D, u as c, g, o as x } from "./controls-G0puEH71.js";
|
|
3
|
-
import { F as v } from "./form-
|
|
3
|
+
import { F as v } from "./form-rvWlnmcr.js";
|
|
4
4
|
import "./MODIFIERS-MLfpKQY1.js";
|
|
5
5
|
import "react";
|
|
6
6
|
import "lodash";
|
|
7
7
|
import "@rjsf/core";
|
|
8
8
|
import "@rjsf/validator-ajv8";
|
|
9
|
-
import "./index-
|
|
9
|
+
import "./index-pgz9p5Yh.js";
|
|
10
10
|
import "@radix-ui/react-toggle";
|
|
11
11
|
import "class-variance-authority";
|
|
12
12
|
import "./utils-PPBbw5bk.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("./jsx-runtime-WUGKV8jN.cjs"),i=require("./controls-aHZq-q4b.cjs"),g=require("./form-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("./jsx-runtime-WUGKV8jN.cjs"),i=require("./controls-aHZq-q4b.cjs"),g=require("./form-0TlI-dUt.cjs");require("./MODIFIERS-WFzDQfiT.cjs");require("react");require("lodash");require("@rjsf/core");require("@rjsf/validator-ajv8");require("./index-lH7BBNlu.cjs");require("@radix-ui/react-toggle");require("class-variance-authority");require("./utils-It2K33fU.cjs");require("clsx");require("tailwind-merge");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("jotai");require("flat-to-nested");require("redux-undo");require("@chaibuilder/runtime");require("@react-hookz/web");require("react-i18next");const D=({_projectData:e,seany:n})=>{var t,u,o,s,q,a;const d=({formData:f})=>{const r={...f};r.seoData.title===void 0&&(r.seoData.title=""),r.seoData.description===void 0&&(r.seoData.description=""),r.seoData.image===void 0&&(r.seoData.image=""),n(m=>({...m,...r}))},c={seoData:i.b({title:"",default:{title:((t=e.seoData)==null?void 0:t.title)||"",description:((u=e.seoData)==null?void 0:u.description)||"",image:((o=e.seoData)==null?void 0:o.image)||""},properties:{title:i.u({title:"Default Title",default:((s=e.seoData)==null?void 0:s.title)||""}),description:i.g({title:"Default Description",default:((q=e.seoData)==null?void 0:q.description)||""}),image:i.o({title:"Social Media Image",default:((a=e.seoData)==null?void 0:a.image)||""})}})};return l.jsxRuntimeExports.jsx("div",{className:"flex h-full select-none flex-col",children:l.jsxRuntimeExports.jsx(g.Form,{properties:c,formData:e,onChange:d})})};exports.default=D;
|
package/dist/render.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("./jsx-runtime-WUGKV8jN.cjs"),j=require("react"),r=require("lodash"),R=require("tailwind-merge"),l=require("./MODIFIERS-WFzDQfiT.cjs"),_=require("@chaibuilder/runtime"),x=require("./functions-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("./jsx-runtime-WUGKV8jN.cjs"),j=require("react"),r=require("lodash"),R=require("tailwind-merge"),l=require("./MODIFIERS-WFzDQfiT.cjs"),_=require("@chaibuilder/runtime"),x=require("./functions-KMQYiBHf.cjs"),q=require("react-wrap-balancer");require("@mhsdesign/jit-browser-tailwindcss");require("@bobthered/tailwindcss-palette-generator");require("@tailwindcss/forms");require("@tailwindcss/typography");require("@tailwindcss/aspect-ratio");require("@tailwindcss/line-clamp");const y=t=>{const s={};return Object.keys(t).forEach(e=>{r.isString(t[e])&&t[e].startsWith(l.SLOT_KEY)&&(s[e]=t[e].replace(l.SLOT_KEY,"").split(","))}),s},B=r.memoize((t,s)=>{const e=t.replace(l.STYLES_KEY,"").split(","),n=R.twMerge(e[0],e[1]);return x.addPrefixToClasses(n,s).replace(l.STYLES_KEY,"").trim()});function C(t,s){return r.get(t,`${s}_attrs`,{})}function O(t,s){const e={};return Object.keys(t).forEach(n=>{if(r.isString(t[n])&&t[n].startsWith(l.STYLES_KEY)){const o=B(t[n],s);e[n]={className:o,...C(t,n)}}}),e}function T(t,s){const e=r.get(t,"_bindings",{});return r.isEmpty(e)?{...t}:(r.each(e,(n,o)=>{r.isString(n)&&r.get(s,n,null)&&(t[o]=r.get(s,n,null))}),t)}function a({blocks:t,parent:s,classPrefix:e="c-",externalData:n={}}){const o=t,p=i=>O(i,e),f=s?r.filter(t,{_parent:s}):r.filter(t,i=>r.isEmpty(i._parent));return c.jsxRuntimeExports.jsx(c.jsxRuntimeExports.Fragment,{children:j.Children.toArray(f.map((i,h)=>{const d=y(i),m={};r.isEmpty(d)||Object.keys(d).forEach(u=>{m[u]=j.Children.toArray(d[u].map(E=>c.jsxRuntimeExports.jsx(a,{externalData:n,classPrefix:e,blocks:o,parent:E})))});const S=r.filter(o,{_parent:i._id});m.children=S.length>0?c.jsxRuntimeExports.jsx(a,{externalData:n,classPrefix:e,parent:i._id,blocks:o}):null;const g=_.getBlockComponent(i._type);if(g!==null){let u=i;const E=g.component;return u={...g.defaults,...i},j.createElement(E,r.omit({blockProps:{},inBuilder:!1,...u,index:h,...T(i,n),...p(u),...m},["_parent"]))}return c.jsxRuntimeExports.jsxs("noscript",{children:[i._type," not found"]})}))})}const Y=({pageData:t,externalData:s={},before:e=null,after:n=null,classPrefix:o="c-"})=>{const p=r.get(t.project,"brandingOptions",l.BRANDING_OPTIONS_DEFAULTS);return c.jsxRuntimeExports.jsxs(c.jsxRuntimeExports.Fragment,{children:[e,c.jsxRuntimeExports.jsx("div",{className:o.replace("-","")+" "+x.getBrandingClasses(p,o)+" min-h-screen",children:c.jsxRuntimeExports.jsx(q.Provider,{children:c.jsxRuntimeExports.jsx(a,{externalData:s,blocks:t.page.blocks||[],classPrefix:o})})}),n]})};exports.RenderChaiBlocks=a;exports.RenderChaiPage=Y;
|
package/dist/render.js
CHANGED
|
@@ -4,7 +4,7 @@ import { isString as E, memoize as y, get as m, isEmpty as h, each as A, filter
|
|
|
4
4
|
import { twMerge as N } from "tailwind-merge";
|
|
5
5
|
import { S as B, a as _, B as R } from "./MODIFIERS-MLfpKQY1.js";
|
|
6
6
|
import { getBlockComponent as T } from "@chaibuilder/runtime";
|
|
7
|
-
import { a as F, g as L } from "./functions-
|
|
7
|
+
import { a as F, g as L } from "./functions-JFP-oMsY.js";
|
|
8
8
|
import { Provider as Y } from "react-wrap-balancer";
|
|
9
9
|
import "@mhsdesign/jit-browser-tailwindcss";
|
|
10
10
|
import "@bobthered/tailwindcss-palette-generator";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./jsx-runtime-WUGKV8jN.cjs"),f=require("react"),c=require("lodash"),H=require("@radix-ui/react-icons"),y=require("./index-lH7BBNlu.cjs"),d=require("./controls-aHZq-q4b.cjs"),w=require("sonner"),p=require("./form-0TlI-dUt.cjs"),P=require("./index-8dYzEcE3.cjs");require("./MODIFIERS-WFzDQfiT.cjs");require("@radix-ui/react-toggle");require("class-variance-authority");require("./utils-It2K33fU.cjs");require("clsx");require("tailwind-merge");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("jotai");require("flat-to-nested");require("redux-undo");require("@chaibuilder/runtime");require("@react-hookz/web");require("react-i18next");require("@rjsf/core");require("@rjsf/validator-ajv8");require("i18next");require("@floating-ui/react-dom");require("react-textarea-autosize");require("flagged");require("react-dnd");require("@minoru/react-dnd-treeview");require("./lib.cjs");require("himalaya");require("./functions-KMQYiBHf.cjs");require("@mhsdesign/jit-browser-tailwindcss");require("@bobthered/tailwindcss-palette-generator");require("@tailwindcss/forms");require("@tailwindcss/typography");require("@tailwindcss/aspect-ratio");require("@tailwindcss/line-clamp");require("./tailwind-config-OxLD7oFU.cjs");require("react-hotkeys-hook");require("lucide-react");const z=f.lazy(()=>Promise.resolve().then(()=>require("./delete-page-modal-sMfhH69k.cjs"))),L=f.lazy(()=>Promise.resolve().then(()=>require("./confirm-alert-exrulqxB.cjs"))),E=u=>{if(!c.isString(u)||!(u.includes("/[")&&u.includes("]")))return!1;const s=/^\[((?:\.{3})?[a-zA-Z0-9_-]+)\]$/,q=/^[a-zA-Z0-9_-]+$/;let e=!0;return u.split("/").forEach(n=>{e&&(n.includes("[[")&&n.includes("]]")?e=/^\[\[\.{3}[a-zA-Z0-9_-]+\]\]$/.test(n):n.includes("[")&&n.includes("]")?e=s.test(n):e=q.test(n))}),e},h=u=>u&&c.isEmpty(u.seoData)?{...u,seoData:{title:"",description:"",image:""}}:u,G=(u,o)=>{const s=!c.isEqual(c.omit(u,["seoData"]),c.omit(o,["seoData"])),q=!c.isEqual(h(o).seoData,h(u).seoData);return s||q},Y=({open:u,setOpen:o,pageData:s})=>{const q=P.useQueryClient(),{data:e}=P.useProject(),n=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)||"")){u==="ALERT"&&o("PENDING");return}n.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:u==="ALERT",title:"Do yo want to save changes?",onCancel:()=>o("CLOSE"),onConfirm:C,disabled:m.isPending||n.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:n.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:n.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:n.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||n.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;
|