@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.
Files changed (76) hide show
  1. package/README.md +30 -103
  2. package/dist/{AddBlocks-0-e393Fn.js → AddBlocks--G1jvF_h.js} +5 -4
  3. package/dist/AddBlocks-kQZRgF1n.cjs +3 -0
  4. package/dist/{BrandingOptions-HtNCJO9_.cjs → BrandingOptions-3zuS6-D8.cjs} +1 -1
  5. package/dist/{BrandingOptions-QqqJ-YRb.js → BrandingOptions-dwNB6XlX.js} +1 -1
  6. package/dist/{CanvasArea-pZz5czrV.cjs → CanvasArea-SzwU-7i5.cjs} +2 -2
  7. package/dist/{CanvasArea-0hMAhzxn.js → CanvasArea-YM7NWbx0.js} +72 -71
  8. package/dist/CurrentPage-Fw-gGZIK.cjs +1 -0
  9. package/dist/{CurrentPage-UOkxZISs.js → CurrentPage-iC1tGuWi.js} +6 -5
  10. package/dist/Layers-bvtrSZ0e.cjs +1 -0
  11. package/dist/{Layers-TB-Lriju.js → Layers-tvGxr-fn.js} +7 -6
  12. package/dist/{MarkAsGlobalBlock-Pa8po8qP.js → MarkAsGlobalBlock-hUoxbVet.js} +1 -1
  13. package/dist/{MarkAsGlobalBlock-5h3wP4zj.cjs → MarkAsGlobalBlock-wqHaABl_.cjs} +1 -1
  14. package/dist/{PagesPanel-ffrNyFyp.cjs → PagesPanel-IHkdL59C.cjs} +1 -1
  15. package/dist/{PagesPanel-mAMSbYPt.js → PagesPanel-w32nyAEE.js} +6 -5
  16. package/dist/{ProjectPanel-XvsYajju.js → ProjectPanel-1yH8uzoo.js} +7 -6
  17. package/dist/ProjectPanel-Rt_C00rp.cjs +1 -0
  18. package/dist/{Settings-8AbHXcDP.js → Settings-MbtN9j5p.js} +6 -5
  19. package/dist/Settings-zqxhKtAP.cjs +1 -0
  20. package/dist/SidePanels-PcCVJHFu.cjs +1 -0
  21. package/dist/{SidePanels-LQg3mdC4.js → SidePanels-WDSKmDRO.js} +7 -6
  22. package/dist/{Topbar-wA6jhMj9.js → Topbar-QBbGJftd.js} +1 -1
  23. package/dist/{Topbar-A3WZDrK4.cjs → Topbar-p07CgA1J.cjs} +1 -1
  24. package/dist/{UnsplashImages-mzIO1QeT.js → UnsplashImages-NOdXhrYp.js} +1 -1
  25. package/dist/{UnsplashImages-E8zPMgJf.cjs → UnsplashImages-RobUmAqJ.cjs} +1 -1
  26. package/dist/{UploadImages-qMeaY4sk.js → UploadImages-_yFxI_3x.js} +1 -1
  27. package/dist/{UploadImages-qEuDUEMn.cjs → UploadImages-oRvUykXU.cjs} +1 -1
  28. package/dist/{add-page-modal-oER3yE4F.js → add-page-modal-1C4AYlR3.js} +7 -6
  29. package/dist/add-page-modal-c20toln3.cjs +1 -0
  30. package/dist/{confirm-alert-rDSai_jQ.js → confirm-alert-LM4La_do.js} +1 -1
  31. package/dist/{confirm-alert-tH8UCCSF.cjs → confirm-alert-exrulqxB.cjs} +1 -1
  32. package/dist/core.cjs +1 -1
  33. package/dist/core.js +56 -55
  34. package/dist/{delete-page-modal-QzQdrLYI.js → delete-page-modal-ZkdZdhkf.js} +6 -5
  35. package/dist/{delete-page-modal-ShTRkqkB.cjs → delete-page-modal-sMfhH69k.cjs} +1 -1
  36. package/dist/{form-MlgUSEy_.cjs → form-0TlI-dUt.cjs} +1 -1
  37. package/dist/{form-vWeEsG9Y.js → form-rvWlnmcr.js} +1 -1
  38. package/dist/{functions-hmbWDcnW.js → functions-JFP-oMsY.js} +28 -27
  39. package/dist/{functions-eu6BbvqO.cjs → functions-KMQYiBHf.cjs} +2 -2
  40. package/dist/{index-pCHSFoQO.cjs → index-8dYzEcE3.cjs} +2 -2
  41. package/dist/{index-mLIwGF5W.js → index-UPQtDmUs.js} +3 -3
  42. package/dist/{index-T5MFAHA0.cjs → index-lH7BBNlu.cjs} +1 -1
  43. package/dist/{index-G55KtqnU.js → index-pgz9p5Yh.js} +2 -2
  44. package/dist/lib.cjs +1 -1
  45. package/dist/lib.d.ts +3 -9
  46. package/dist/lib.js +93 -152
  47. package/dist/page-viewer-1EuLsHyz.cjs +1 -0
  48. package/dist/{page-viewer-X3IEOrUC.js → page-viewer-3860AKDT.js} +29 -28
  49. package/dist/{project-general-setting-HZeYf9A1.cjs → project-general-setting-Bg7qIWUd.cjs} +1 -1
  50. package/dist/{project-general-setting-oujmeWOG.js → project-general-setting-mg_zEkzX.js} +7 -6
  51. package/dist/{project-seo-setting-_X6ckVa4.js → project-seo-setting-6Q0gFmHY.js} +2 -2
  52. package/dist/{project-seo-setting-3FZQXaTn.cjs → project-seo-setting-8B9pZPZN.cjs} +1 -1
  53. package/dist/render.cjs +1 -1
  54. package/dist/render.js +1 -1
  55. package/dist/single-page-detail-52Xz-XJ7.cjs +1 -0
  56. package/dist/{single-page-detail-SxboE7TI.js → single-page-detail-Asn7bb7f.js} +8 -7
  57. package/dist/studio.cjs +1 -1
  58. package/dist/studio.js +5 -4
  59. package/dist/tailwind-config-OxLD7oFU.cjs +1 -0
  60. package/dist/tailwind-config-d1VL1lzE.js +62 -0
  61. package/dist/tailwind.cjs +1 -0
  62. package/dist/tailwind.d.ts +80 -0
  63. package/dist/tailwind.js +24 -0
  64. package/dist/ui.cjs +1 -1
  65. package/dist/ui.d.ts +1 -1
  66. package/dist/ui.js +1 -1
  67. package/package.json +8 -3
  68. package/dist/AddBlocks-p68Cz79o.cjs +0 -3
  69. package/dist/CurrentPage-phMDH1Ub.cjs +0 -1
  70. package/dist/Layers-NKZXi2LV.cjs +0 -1
  71. package/dist/ProjectPanel-1ywILLme.cjs +0 -1
  72. package/dist/Settings-hdmnT_mI.cjs +0 -1
  73. package/dist/SidePanels-xaNrI3oK.cjs +0 -1
  74. package/dist/add-page-modal-9deiA1W9.cjs +0 -1
  75. package/dist/page-viewer-GPNN1H92.cjs +0 -1
  76. package/dist/single-page-detail-ILshOKys.cjs +0 -1
package/dist/lib.js CHANGED
@@ -1,9 +1,10 @@
1
- import { g as C, c as E, a as I } from "./utils-PPBbw5bk.js";
2
- import { b as ge } from "./utils-PPBbw5bk.js";
3
- import { stringify as T, parse as O } from "himalaya";
4
- import { includes as o, get as n, isEmpty as _, forEach as B, find as d, set as m, capitalize as F, flatMapDeep as D, filter as N, omit as P, flatten as V, first as U, keys as x, map as k, parseInt as R } from "lodash";
5
- import { a as fe, b as ye, g as _e, c as be } from "./functions-hmbWDcnW.js";
6
- import { a as f } from "./MODIFIERS-MLfpKQY1.js";
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 H = {
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
- }, W = (e, r) => e.children.length === 1 && o(["Heading", "Paragraph", "Span", "ListItem", "Button", "Label", "TableCell", "Link"], r._type), A = (e) => e.map((r) => r.type === "text" ? n(r, "content", "") : _(r.children) ? "" : A(r.children)).join(""), L = (e) => e === null ? !0 : e, w = (e) => {
49
- const r = {}, a = H[e.tagName] || {}, c = e.attributes;
50
- return B(c, ({ key: t, value: i }) => {
51
- if (a[t]) {
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 s = d(e.attributes, { key: "width" }), l = d(e.attributes, { key: "height" });
54
- s && l ? i = `https://via.placeholder.com/${s == null ? void 0 : s.value}x${l == null ? void 0 : l.value}` : i = "https://via.placeholder.com/150x150";
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(r, a[t], L(i));
57
+ m(a, s[t], v(i));
57
58
  } else
58
- o(["style", "class", "srcset"], t) || m(r, `styles_attrs.${t}`, L(i));
59
- }), delete r.class, r;
60
- }, M = (e, r = "styles") => {
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 { [r]: `${f},` };
63
- const a = d(e.attributes, { key: "class" });
64
- if (a) {
65
- const c = a.value;
66
- return { [r]: `${f},${c}` };
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 { [r]: `${f},` };
69
- }, X = (e) => {
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" : F(e.tagName)
147
+ name: e.tagName === "div" ? "Box" : P(e.tagName)
147
148
  };
148
149
  }
149
- }, $ = (e, r = null) => D(e, (a) => {
150
+ }, C = (e, a = null) => V(e, (s) => {
150
151
  var i;
151
- if (a.type === "comment")
152
+ if (s.type === "comment")
152
153
  return [];
153
- let c = { _id: C() };
154
- if (r && (c._parent = r.block._id), a.type === "text")
155
- return _(n(a, "content", "")) ? [] : r && W(r.node, r.block) ? (m(r, "block.content", n(a, "content", "")), []) : { ...c, _type: "Text", content: n(a, "content", "") };
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
- ...X(a),
159
- ...w(a),
160
- ...M(a)
159
+ ...z(s),
160
+ ...w(s),
161
+ ...X(s)
161
162
  }, c._type === "Input") {
162
- const s = c.inputType || "text";
163
- s === "checkbox" ? m(c, "_type", "Checkbox") : s === "radio" && m(c, "_type", "Radio");
163
+ const r = c.inputType || "text";
164
+ r === "checkbox" ? m(c, "_type", "Checkbox") : r === "radio" && m(c, "_type", "Radio");
164
165
  } else {
165
- if (a.tagName === "video")
166
- return c.content = T([a]), [c];
167
- if (a.tagName === "svg") {
168
- const s = d(a.attributes, { key: "height" }), l = d(a.attributes, { key: "width" }), g = n(s, "value") ? `[${n(s, "value")}px]` : "full", h = n(l, "value") ? `[${n(l, "value")}px]` : "full", b = n(d(a.attributes, { key: "class" }), "value");
169
- return c.styles = `${f}, ${E(`w-${h} h-${g}`, b)}`.trim(), a.attributes = N(a.attributes, (y) => !o(["style", "width", "height", "class"], y.key)), c.icon = T([a]), m(c, "styles_attrs", P(n(c, "styles_attrs") || {}, ["height", "width", "style", "class"])), [c];
170
- } else if (a.tagName == "option" && r && ((i = r.block) == null ? void 0 : i._type) === "Select")
171
- return r.block.options.push({
172
- label: A(a.children),
173
- ...w(a)
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 = $(a.children, { block: c, node: a });
177
+ const t = C(s.children, { block: c, node: s });
177
178
  return [c, ...t];
178
- }), z = (e) => {
179
- const r = e.match(/<body[^>]*>[\s\S]*?<\/body>/);
180
- return (r && r.length > 0 ? r[0].replace(/<body/, "<div").replace(/<\/body>/, "</div>") : e).replace(/\s+/g, " ").replaceAll("> <", "><").replace(/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi, "").trim();
181
- }, le = (e) => {
182
- const r = O(z(e));
183
- return _(e) ? [] : V($(r));
184
- }, S = {
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 oe = (e) => {
243
- const r = e.match(/\[.*\]/);
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 { property: c } = a;
250
- let t = U(r).replace(/\]/i, "").replace(/\[/i, "");
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 s = e;
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 = k(x(Y), (p) => `${p}px`);
288
- if (o(u, t)) {
289
- const p = R(t.replace("px", ""), 10);
290
- p === 1 ? s = `${i}px` : s = i + p / j;
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 = k(x(S), (p) => `${p}%`);
295
- if (o(u, t)) {
296
- const p = parseFloat(t.replace("%", ""));
297
- s = i + n(S, p);
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 && (s = `${i}screen`), t.indexOf("vh") !== -1 && parseFloat(t.replace("vh", "")) === 100 && (s = `${i}screen`);
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 && (s = `${i}full`), t === "0px" && (s = "min-w-0");
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" && (s = "max-w-0");
307
- const l = {
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
- o(x(l), t) && (s = `max-w-${l[t]}`);
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 && (s = `${i}full`), t === "0px" && (s = "min-h-0"), t === "100vh" && (s = "min-h-screen");
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 g = {
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
- o(x(g), t) && (s = i + g[t]);
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
- o(x(h), t) && (s = i + h[t]);
365
+ p(g(h), t) && (r = i + h[t]);
365
366
  break;
366
367
  case "zIndex":
367
- s = ["0", "10", "20", "30", "40", "50"].indexOf(t) !== -1 ? `${i}${t}` : e;
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
- ], v = parseFloat(t) * 100;
387
- o(y, v.toString()) && (s = `opacity-${v}`);
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 s;
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
- fe as addPrefixToClasses,
455
- pe as chaiBuilderTheme,
456
- E as cn,
457
- oe as convertArbitraryToTailwindClass,
458
- C as generateUUID,
459
- le as getBlocksFromHTML,
460
- ye as getBlocksTailwindCSS,
461
- _e as getBrandingClasses,
462
- ge as getBreakpointValue,
463
- be as getStylesForPageData,
464
- ue as selectable,
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 e } from "./jsx-runtime-NV737rRe.js";
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-G55KtqnU.js";
5
- import { e as j, b, d as N } from "./index-mLIwGF5W.js";
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-hmbWDcnW.js";
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-SxboE7TI.js")), P = ({ pageData: r }) => {
59
- const [t, i] = n("CLOSE");
60
- return /* @__PURE__ */ e.jsxs(
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: t === "OPEN" || t === "ALERT" || t === "PENDING",
64
+ open: e === "OPEN" || e === "ALERT" || e === "PENDING",
64
65
  onOpenChange: (o) => {
65
- i(t === "PENDING" ? "ALERT" : o ? "OPEN" : "CLOSE");
66
+ i(e === "PENDING" ? "ALERT" : o ? "OPEN" : "CLOSE");
66
67
  },
67
68
  children: [
68
- /* @__PURE__ */ e.jsx(
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__ */ e.jsx("div", { className: "flex items-center justify-between", children: t === "OPEN" || t === "ALERT" || t === "PENDING" ? /* @__PURE__ */ e.jsx(c, {}) : /* @__PURE__ */ e.jsx("div", { className: "hidden hover:text-blue-600 group-hover:flex", children: /* @__PURE__ */ e.jsx(u, {}) }) })
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__ */ e.jsx(f, { side: "right", align: "start", alignOffset: -35, className: "h-screen w-96", children: /* @__PURE__ */ e.jsx(
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__ */ e.jsxs("div", { className: "flex w-full animate-pulse flex-col gap-y-3", children: [
82
- /* @__PURE__ */ e.jsx("div", { className: "bg-background-300 h-6 w-1/2" }),
83
- /* @__PURE__ */ e.jsx("div", { className: "bg-background-300 h-20 w-full" }),
84
- /* @__PURE__ */ e.jsx("div", { className: "bg-background-300 h-20 w-full" })
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__ */ e.jsx(v, { pageData: r, open: t, setOpen: i })
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 [t] = j(), { data: i } = b(), o = N(), m = (i == null ? void 0 : i.homepage) === r.uuid, p = t === r.uuid, a = () => o(r);
94
- return i ? /* @__PURE__ */ e.jsxs(
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__ */ e.jsxs("div", { className: "flex text-sm items-center gap-x-1.5", children: [
102
- m ? /* @__PURE__ */ e.jsx(d, {}) : /* @__PURE__ */ e.jsx(x, {}),
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__ */ e.jsx(P, { pageData: r })
107
+ /* @__PURE__ */ t.jsx(P, { pageData: r })
107
108
  ]
108
109
  }
109
110
  ) : null;
110
- }, Oe = ({ pages: r, isLoading: t }) => t ? /* @__PURE__ */ e.jsxs("div", { className: "flex animate-pulse flex-col gap-y-1 px-2.5 pt-2", children: [
111
- /* @__PURE__ */ e.jsx("div", { className: "bg-background-200 h-7 w-full" }),
112
- /* @__PURE__ */ e.jsx("div", { className: "bg-background-200 h-7 w-full" }),
113
- /* @__PURE__ */ e.jsx("div", { className: "bg-background-200 h-7 w-full" })
114
- ] }) : r.length === 0 ? /* @__PURE__ */ e.jsx("div", { className: "px-2.5 pb-2 pt-4", children: "No pages" }) : /* @__PURE__ */ e.jsx("div", { className: "-mb-2", children: s.Children.toArray(r.map((i) => /* @__PURE__ */ e.jsx(E, { ...i }))) });
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
- Oe as default
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-T5MFAHA0.cjs"),o=require("./controls-aHZq-q4b.cjs"),d=require("./form-MlgUSEy_.cjs"),m=require("./index-pCHSFoQO.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-eu6BbvqO.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("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
+ "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-G55KtqnU.js";
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-vWeEsG9Y.js";
6
- import { b as x } from "./index-mLIwGF5W.js";
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-hmbWDcnW.js";
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 Ro = ({
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
- Ro as default
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-vWeEsG9Y.js";
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-G55KtqnU.js";
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-MlgUSEy_.cjs");require("./MODIFIERS-WFzDQfiT.cjs");require("react");require("lodash");require("@rjsf/core");require("@rjsf/validator-ajv8");require("./index-T5MFAHA0.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;
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-eu6BbvqO.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;
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-hmbWDcnW.js";
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;