@chaibuilder/sdk 1.1.14 → 1.1.16

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 (58) hide show
  1. package/dist/AddBlocks-1DrS62uN.js +222 -0
  2. package/dist/AddBlocks-jqRRefXj.cjs +1 -0
  3. package/dist/BrandingOptions-TRVyCvVq.cjs +1 -0
  4. package/dist/{BrandingOptions-4qzTYdj5.js → BrandingOptions-zFJ28xmJ.js} +18 -19
  5. package/dist/CanvasArea-5oxRxEDL.cjs +59 -0
  6. package/dist/CanvasArea-j8iIkWN-.js +1438 -0
  7. package/dist/{CurrentPage-zxrdTVsG.cjs → CurrentPage-CsENtl7b.cjs} +1 -1
  8. package/dist/{CurrentPage-spjJpQSM.js → CurrentPage-cNRrM2vd.js} +1 -1
  9. package/dist/{Layers-QNAlCI4j.js → Layers-6Fa_6Vy2.js} +2 -2
  10. package/dist/{Layers-YyBChBtg.cjs → Layers-r6pP4nDP.cjs} +1 -1
  11. package/dist/MarkAsGlobalBlock-CDmEHNx7.cjs +1 -0
  12. package/dist/{MarkAsGlobalBlock-xOHhiMDl.js → MarkAsGlobalBlock-uhj0kGZo.js} +23 -23
  13. package/dist/{PagesPanel-BeJrveus.cjs → PagesPanel-UXqoXG-j.cjs} +1 -1
  14. package/dist/{PagesPanel--LI-BoSj.js → PagesPanel-s2qoPZc-.js} +2 -2
  15. package/dist/{ProjectPanel-VNj0jXca.js → ProjectPanel-9z6zVYBb.js} +2 -2
  16. package/dist/{ProjectPanel-MjcAymKT.cjs → ProjectPanel-izG3GYtn.cjs} +1 -1
  17. package/dist/Settings-iLeODb_n.js +2188 -0
  18. package/dist/Settings-olFxwKg4.cjs +1 -0
  19. package/dist/SidePanels-1QED7mo6.cjs +1 -0
  20. package/dist/{SidePanels-4lvmnnlw.js → SidePanels-CWAz1HdY.js} +125 -124
  21. package/dist/add-page-modal-rn0OScnT.cjs +1 -0
  22. package/dist/{add-page-modal-fZnKopNf.js → add-page-modal-vT0-45wi.js} +6 -7
  23. package/dist/controls-QnyBNkXG.cjs +36 -0
  24. package/dist/controls-kEuiMMDf.js +4600 -0
  25. package/dist/core.cjs +1 -1
  26. package/dist/core.js +1 -1
  27. package/dist/{delete-page-modal-P_KKu12n.cjs → delete-page-modal-EZ4gIG3s.cjs} +1 -1
  28. package/dist/{delete-page-modal-fRoXPfhG.js → delete-page-modal-hWmFarnh.js} +1 -1
  29. package/dist/index-Ge20J9Pa.cjs +206 -0
  30. package/dist/{index-CQz6j3ex.js → index-TWBwhGkh.js} +4957 -4262
  31. package/dist/mockServiceWorker.js +10 -18
  32. package/dist/{page-viewer-39ZtxLzx.js → page-viewer-TZC26UCW.js} +2 -2
  33. package/dist/{page-viewer-_lc8vqU4.cjs → page-viewer-yH4HdYhv.cjs} +1 -1
  34. package/dist/{project-general-setting-CCVuGyHh.js → project-general-setting-SjVbcwgp.js} +7 -8
  35. package/dist/project-general-setting-eEQDxjVm.cjs +1 -0
  36. package/dist/{project-seo-setting-Wo7E46w7.js → project-seo-setting-EhqUcTKy.js} +7 -8
  37. package/dist/project-seo-setting-N0OnBCvh.cjs +1 -0
  38. package/dist/single-page-detail-76T7ZZzC.cjs +1 -0
  39. package/dist/{single-page-detail-r1GJF00l.js → single-page-detail-ePzFhs8m.js} +47 -48
  40. package/dist/studio.cjs +1 -1
  41. package/dist/studio.js +1 -1
  42. package/package.json +3 -2
  43. package/dist/AddBlocks-AG_J7s2Z.cjs +0 -1
  44. package/dist/AddBlocks-FsdsASNp.js +0 -222
  45. package/dist/BrandingOptions-xBuqDpj0.cjs +0 -1
  46. package/dist/CanvasArea-4m1-c1yq.cjs +0 -59
  47. package/dist/CanvasArea-U3egqewu.js +0 -1434
  48. package/dist/MarkAsGlobalBlock-LXDkmFUr.cjs +0 -1
  49. package/dist/Settings-BrYkhn3H.cjs +0 -1
  50. package/dist/Settings-LZJwbkO6.js +0 -2189
  51. package/dist/SidePanels-_5oUp-eI.cjs +0 -1
  52. package/dist/add-page-modal-rWhPuGd9.cjs +0 -1
  53. package/dist/controls-G0puEH71.js +0 -120
  54. package/dist/controls-aHZq-q4b.cjs +0 -1
  55. package/dist/index-1Dr-VtaT.cjs +0 -206
  56. package/dist/project-general-setting-LEzDhwoq.cjs +0 -1
  57. package/dist/project-seo-setting-orwH-Ufg.cjs +0 -1
  58. package/dist/single-page-detail-jkDYF7lW.cjs +0 -1
@@ -1,13 +1,14 @@
1
1
  import { j as e } from "./jsx-runtime-NV737rRe.js";
2
- import { PlusIcon as E, Half2Icon as V } from "@radix-ui/react-icons";
3
- import p, { useState as u, useEffect as L, useMemo as M, lazy as g, Suspense as f } from "react";
4
- import { useAtom as A } from "jotai";
5
- import { b as v, d as P, A as H, j as I, a as F, f as R, g as _ } from "./lodash-3gkdNK5u.js";
6
- import { ak as O, al as Y, am as J, an as U, ao as $, D as q, E as G, F as Z, G as Q, H as W, I as X, J as ee, K as se, ap as ae, s as re, t as le, aq as ie, ar as te, as as oe, at as ne, au as S, i as k, av as ce, aw as de, B as j, S as T, ax as me, ay as xe, az as z, aA as K } from "./index-0OqmBgqo.js";
7
- import { ListTreeIcon as C, DatabaseIcon as pe } from "lucide-react";
8
- import { getChaiDataProviders as ue } from "@chaibuilder/runtime";
9
- import { E as he } from "./index-CQz6j3ex.js";
10
- import { d as fe } from "./utils-XsPKXMVo.js";
2
+ import { PlusIcon as V, Half2Icon as M } from "@radix-ui/react-icons";
3
+ import p, { useState as u, useEffect as H, useMemo as I, lazy as y, Suspense as j } from "react";
4
+ import { useAtom as P } from "jotai";
5
+ import { b as g, d as T, A as L, j as F, a as O, f as R, g as J } from "./lodash-3gkdNK5u.js";
6
+ import { ak as U, al as $, am as q, an as G, ao as Y, D as Z, E as Q, F as W, G as X, H as ee, I as se, J as re, K as ae, ap as le, s as ie, t as te, aq as oe, ar as ne, as as ce, at as de, au as _, i as C, av as me, aw as xe, B as b, S as z, ax as pe, ay as ue, az as K, aA as B } from "./index-0OqmBgqo.js";
7
+ import { ListTreeIcon as D, DatabaseIcon as he } from "lucide-react";
8
+ import { getChaiDataProviders as fe } from "@chaibuilder/runtime";
9
+ import { useTranslation as S } from "react-i18next";
10
+ import { E as ve } from "./index-TWBwhGkh.js";
11
+ import { d as je } from "./utils-XsPKXMVo.js";
11
12
  import "./MODIFIERS-MLfpKQY1.js";
12
13
  import "@radix-ui/react-toggle";
13
14
  import "class-variance-authority";
@@ -35,7 +36,6 @@ import "react-quill";
35
36
  import "flat-to-nested";
36
37
  import "redux-undo";
37
38
  import "@react-hookz/web";
38
- import "react-i18next";
39
39
  import "i18next";
40
40
  import "clsx";
41
41
  import "@floating-ui/react-dom";
@@ -48,84 +48,85 @@ import "sonner";
48
48
  import "./html-to-json-Y5M0N8PH.js";
49
49
  import "himalaya";
50
50
  import "tailwind-merge";
51
- const ve = p.lazy(() => import("react-json-view")), je = ({ provider: a, onClose: o }) => {
52
- const [r, d] = u(null);
53
- return L(() => {
54
- a && (a.mockFn ? a.mockFn : a.dataFn)().then((n) => d(n));
55
- }, [a]), a ? /* @__PURE__ */ e.jsx(O, { onOpenChange: (t) => t ? "" : o(), defaultOpen: !0, children: /* @__PURE__ */ e.jsxs(Y, { children: [
56
- /* @__PURE__ */ e.jsxs(J, { children: [
57
- /* @__PURE__ */ e.jsxs(U, { children: [
58
- "Data Provider: ",
59
- a.name
51
+ const ge = p.lazy(() => import("react-json-view")), be = ({ provider: r, onClose: t }) => {
52
+ const { t: a } = S(), [i, m] = u(null);
53
+ return H(() => {
54
+ r && (r.mockFn ? r.mockFn : r.dataFn)().then((n) => m(n));
55
+ }, [r]), r ? /* @__PURE__ */ e.jsx(U, { onOpenChange: (o) => o ? "" : t(), defaultOpen: !0, children: /* @__PURE__ */ e.jsxs($, { children: [
56
+ /* @__PURE__ */ e.jsxs(q, { children: [
57
+ /* @__PURE__ */ e.jsxs(G, { children: [
58
+ a("data_provider"),
59
+ ": ",
60
+ r.name
60
61
  ] }),
61
- /* @__PURE__ */ e.jsx($, { children: a.description })
62
+ /* @__PURE__ */ e.jsx(Y, { children: r.description })
62
63
  ] }),
63
- /* @__PURE__ */ e.jsx(he, { children: /* @__PURE__ */ e.jsx(
64
- ve,
64
+ /* @__PURE__ */ e.jsx(ve, { children: /* @__PURE__ */ e.jsx(
65
+ ge,
65
66
  {
66
67
  style: { maxHeight: "80vh", overflowY: "auto" },
67
- name: a.providerKey,
68
+ name: r.providerKey,
68
69
  enableClipboard: !1,
69
70
  displayObjectSize: !1,
70
71
  displayDataTypes: !1,
71
- src: r
72
+ src: i
72
73
  }
73
74
  ) })
74
75
  ] }) }) : null;
75
76
  };
76
- function ge({
77
- children: a,
78
- name: o,
79
- onRemove: r
77
+ function ye({
78
+ children: r,
79
+ name: t,
80
+ onRemove: a
80
81
  }) {
81
- return /* @__PURE__ */ e.jsxs(q, { children: [
82
- /* @__PURE__ */ e.jsx(G, { asChild: !0, children: a }),
83
- /* @__PURE__ */ e.jsxs(Z, { children: [
84
- /* @__PURE__ */ e.jsxs(Q, { children: [
85
- /* @__PURE__ */ e.jsxs(W, { children: [
86
- "Are you sure, you want to remove ",
87
- /* @__PURE__ */ e.jsx("span", { className: "text-blue-500", children: o }),
88
- " provider?"
89
- ] }),
90
- /* @__PURE__ */ e.jsx(X, { children: "Your data provider will be removed from this page and all added data binding will be not visible on blocks." })
82
+ const { t: i } = S();
83
+ return /* @__PURE__ */ e.jsxs(Z, { children: [
84
+ /* @__PURE__ */ e.jsx(Q, { asChild: !0, children: r }),
85
+ /* @__PURE__ */ e.jsxs(W, { children: [
86
+ /* @__PURE__ */ e.jsxs(X, { children: [
87
+ /* @__PURE__ */ e.jsx(ee, { children: i("remove_provider_confirmation", { name: t }) }),
88
+ /* @__PURE__ */ e.jsx(se, { children: i("remove_provider_warning") })
91
89
  ] }),
92
- /* @__PURE__ */ e.jsxs(ee, { children: [
93
- /* @__PURE__ */ e.jsx(se, { children: "Cancel" }),
94
- /* @__PURE__ */ e.jsx(ae, { onClick: r, className: "bg-red-600 hover:bg-red-700", children: "Remove" })
90
+ /* @__PURE__ */ e.jsxs(re, { children: [
91
+ /* @__PURE__ */ e.jsx(ae, { children: i("cancel") }),
92
+ /* @__PURE__ */ e.jsx(le, { onClick: a, className: "bg-red-600 hover:bg-red-700", children: i("remove") })
95
93
  ] })
96
94
  ] })
97
95
  ] });
98
96
  }
99
- const be = () => {
100
- const a = M(() => ue(), []), [o, r] = re(), [, d] = A(le), [t, n] = u(
101
- v(a, (s) => P(o, "providerKey").includes(s.providerKey))
102
- ), [m, b] = u(""), [h, i] = u(null), y = v(
103
- a.map((s) => P(t, "providerKey").includes(s.providerKey) ? null : { value: s.providerKey, label: s.name }),
104
- (s) => !H(s)
105
- ), w = (s) => {
106
- const x = I(a, { providerKey: s });
107
- n((c) => [...c, x]), r((c) => [...c, { providerKey: x.providerKey, args: {} }]), b(""), d("UNSAVED");
108
- }, N = (s) => {
109
- n((x) => v(x, (c) => c.providerKey !== s.providerKey)), r((x) => v(x, (c) => c.providerKey !== s.providerKey)), d("UNSAVED");
110
- }, l = (s) => i(s);
111
- return F(a) ? /* @__PURE__ */ e.jsx("div", { children: /* @__PURE__ */ e.jsxs("p", { className: "text-gray-500 mb-1.5 text-xs p-4", children: [
112
- "You have no data providers registered. Please add a data provider to your project. ",
97
+ const Ne = () => {
98
+ const { t: r } = S(), t = I(() => fe(), []), [a, i] = ie(), [, m] = P(te), [o, n] = u(
99
+ g(t, (s) => T(a, "providerKey").includes(s.providerKey))
100
+ ), [N, f] = u(""), [c, v] = u(null), w = g(
101
+ t.map((s) => T(o, "providerKey").includes(s.providerKey) ? null : { value: s.providerKey, label: s.name }),
102
+ (s) => !L(s)
103
+ ), k = (s) => {
104
+ const x = F(t, { providerKey: s });
105
+ n((d) => [...d, x]), i((d) => [...d, { providerKey: x.providerKey, args: {} }]), f(""), m("UNSAVED");
106
+ }, l = (s) => {
107
+ n((x) => g(x, (d) => d.providerKey !== s.providerKey)), i((x) => g(x, (d) => d.providerKey !== s.providerKey)), m("UNSAVED");
108
+ }, h = (s) => v(s);
109
+ return O(t) ? /* @__PURE__ */ e.jsx("div", { children: /* @__PURE__ */ e.jsxs("p", { className: "text-gray-500 mb-1.5 text-xs p-4", children: [
110
+ r("no_data_providers"),
113
111
  /* @__PURE__ */ e.jsx("br", {}),
114
- /* @__PURE__ */ e.jsx("a", { className: "text-blue-500", href: "https://chaibuilder.com/docs/registering-data-providers", target: "_blank", children: "Learn more" })
112
+ /* @__PURE__ */ e.jsx("a", { className: "text-blue-500", href: "https://chaibuilder.com/docs/registering-data-providers", target: "_blank", children: r("learn_more") })
115
113
  ] }) }) : /* @__PURE__ */ e.jsxs("div", { className: "px-1", children: [
116
114
  /* @__PURE__ */ e.jsx("br", {}),
117
- /* @__PURE__ */ e.jsx("label", { children: /* @__PURE__ */ e.jsx("p", { className: "text-gray-500 mb-1.5 text-xs", children: "Add data providers:" }) }),
118
- /* @__PURE__ */ e.jsx("div", { className: "flex items-center space-x-1", children: /* @__PURE__ */ e.jsxs(ie, { value: m, onValueChange: (s) => w(s), children: [
119
- /* @__PURE__ */ e.jsx(te, { className: "w-full", children: /* @__PURE__ */ e.jsx(oe, { placeholder: "Select a provider" }) }),
120
- /* @__PURE__ */ e.jsxs(ne, { children: [
121
- /* @__PURE__ */ e.jsx(S, { value: "", children: "Choose" }),
122
- y.map((s) => /* @__PURE__ */ e.jsx(S, { value: s.value, children: s.label }, s.value))
115
+ /* @__PURE__ */ e.jsx("label", { children: /* @__PURE__ */ e.jsx("p", { className: "text-gray-500 mb-1.5 text-xs", children: r("add_data_providers") }) }),
116
+ /* @__PURE__ */ e.jsx("div", { className: "flex items-center space-x-1", children: /* @__PURE__ */ e.jsxs(oe, { value: N, onValueChange: (s) => k(s), children: [
117
+ /* @__PURE__ */ e.jsx(ne, { className: "w-full", children: /* @__PURE__ */ e.jsx(ce, { placeholder: r("select_provider") }) }),
118
+ /* @__PURE__ */ e.jsxs(de, { children: [
119
+ /* @__PURE__ */ e.jsx(_, { value: "", children: r("choose") }),
120
+ w.map((s) => /* @__PURE__ */ e.jsx(_, { value: s.value, children: s.label }, s.value))
123
121
  ] })
124
122
  ] }) }),
125
123
  /* @__PURE__ */ e.jsx("br", {}),
126
- /* @__PURE__ */ e.jsxs("div", { className: `border-t ${t.length ? "block" : "hidden"}`, children: [
127
- /* @__PURE__ */ e.jsx("p", { className: "text-gray-500 pt-4 pb-1.5 text-xs flex-1 font-medium", children: "Page data providers:" }),
128
- /* @__PURE__ */ e.jsx("div", { className: "space-y-2", children: t.map((s) => /* @__PURE__ */ e.jsxs(
124
+ /* @__PURE__ */ e.jsxs("div", { className: `border-t ${o.length ? "block" : "hidden"}`, children: [
125
+ /* @__PURE__ */ e.jsxs("p", { className: "text-gray-500 pt-4 pb-1.5 text-xs flex-1 font-medium", children: [
126
+ r("page_data_providers"),
127
+ ":"
128
+ ] }),
129
+ /* @__PURE__ */ e.jsx("div", { className: "space-y-2", children: o.map((s) => /* @__PURE__ */ e.jsxs(
129
130
  "div",
130
131
  {
131
132
  className: "rounded-lg border bg-card text-card-foreground shadow-sm w-full",
@@ -139,7 +140,7 @@ const be = () => {
139
140
  /* @__PURE__ */ e.jsxs(
140
141
  "button",
141
142
  {
142
- onClick: () => l(s),
143
+ onClick: () => h(s),
143
144
  className: "inline-flex items-center justify-center text-xs font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 underline-offset-4 hover:underline h-9 rounded-md px-3 text-blue-500",
144
145
  children: [
145
146
  /* @__PURE__ */ e.jsxs(
@@ -161,11 +162,11 @@ const be = () => {
161
162
  ]
162
163
  }
163
164
  ),
164
- "View Data"
165
+ r("view_data")
165
166
  ]
166
167
  }
167
168
  ),
168
- /* @__PURE__ */ e.jsx(ge, { onRemove: () => N(s), name: s.name, children: /* @__PURE__ */ e.jsxs("button", { className: "inline-flex items-center justify-center text-xs font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 underline-offset-4 hover:underline h-9 rounded-md px-3 text-red-500", children: [
169
+ /* @__PURE__ */ e.jsx(ye, { onRemove: () => l(s), name: s.name, children: /* @__PURE__ */ e.jsxs("button", { className: "inline-flex items-center justify-center text-xs font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 underline-offset-4 hover:underline h-9 rounded-md px-3 text-red-500", children: [
169
170
  /* @__PURE__ */ e.jsxs(
170
171
  "svg",
171
172
  {
@@ -186,100 +187,100 @@ const be = () => {
186
187
  ]
187
188
  }
188
189
  ),
189
- "Remove"
190
+ r("remove")
190
191
  ] }) })
191
192
  ] })
192
193
  ]
193
194
  },
194
195
  s.providerKey
195
196
  )) }),
196
- /* @__PURE__ */ e.jsx(je, { onClose: () => i(null), provider: h })
197
+ /* @__PURE__ */ e.jsx(be, { onClose: () => v(null), provider: c })
197
198
  ] })
198
199
  ] });
199
- }, ye = g(() => import("./AddBlocks-FsdsASNp.js")), D = g(() => import("./Layers-QNAlCI4j.js")), we = g(() => import("./BrandingOptions-4qzTYdj5.js")), Ne = g(() => import("./index-0OqmBgqo.js").then((a) => a.cy));
200
- let B = null;
201
- const bs = () => {
202
- const a = k("sideBarComponents.top", []), o = k("sideBarComponents.bottom", []), [r, d] = A(ce), [t, n] = u(r), [m, b] = u(null), h = {
203
- "add-blocks": ye,
204
- layers: D,
205
- "branding-options": we,
206
- images: Ne
200
+ }, we = y(() => import("./AddBlocks-1DrS62uN.js")), A = y(() => import("./Layers-6Fa_6Vy2.js")), ke = y(() => import("./BrandingOptions-zFJ28xmJ.js")), Ce = y(() => import("./index-0OqmBgqo.js").then((r) => r.cy));
201
+ let E = null;
202
+ const Ns = () => {
203
+ const r = C("sideBarComponents.top", []), t = C("sideBarComponents.bottom", []), [a, i] = P(me), [m, o] = u(a), [n, N] = u(null), f = {
204
+ "add-blocks": we,
205
+ layers: A,
206
+ "branding-options": ke,
207
+ images: Ce
207
208
  };
208
- R(a, ({ name: l, panel: s }) => {
209
- h[l] = s;
209
+ R(r, ({ name: l, panel: h }) => {
210
+ f[l] = h;
210
211
  });
211
- const i = (l) => {
212
- clearTimeout(B), y(!1), r !== "layers" && l === "layers" ? B = setTimeout(() => n("layers"), 500) : n(l), d(l);
213
- }, [, y] = A(de), w = k("dataBindingSupport", !1);
214
- function N() {
212
+ const c = (l) => {
213
+ clearTimeout(E), v(!1), a !== "layers" && l === "layers" ? E = setTimeout(() => o("layers"), 500) : o(l), i(l);
214
+ }, [, v] = P(xe), w = C("dataBindingSupport", !1);
215
+ function k() {
215
216
  const l = setTimeout(() => {
216
- m && (i("layers"), clearTimeout(m));
217
+ n && (c("layers"), clearTimeout(n));
217
218
  }, 500);
218
- b(l);
219
+ N(l);
219
220
  }
220
221
  return /* @__PURE__ */ e.jsxs("div", { className: "relative flex ", children: [
221
- r !== "layers" ? /* @__PURE__ */ e.jsx(
222
+ a !== "layers" ? /* @__PURE__ */ e.jsx(
222
223
  "div",
223
224
  {
224
- onMouseEnter: N,
225
- onClick: () => i("layers"),
225
+ onMouseEnter: k,
226
+ onClick: () => c("layers"),
226
227
  className: "fixed inset-0 bg-black/20 z-[50]"
227
228
  }
228
229
  ) : null,
229
230
  /* @__PURE__ */ e.jsxs("div", { className: "z-[100] flex h-full w-fit flex-col items-center justify-between border-b border-r border-border bg-background pt-2", children: [
230
231
  /* @__PURE__ */ e.jsxs("div", { className: "relative z-[100] flex w-14 flex-col items-center space-y-2", children: [
231
232
  /* @__PURE__ */ e.jsx(
232
- j,
233
+ b,
233
234
  {
234
235
  onClick: () => {
235
- i("add-blocks");
236
+ c("add-blocks");
236
237
  },
237
238
  size: "sm",
238
- variant: r === "add-blocks" ? "default" : "outline",
239
- children: /* @__PURE__ */ e.jsx(E, { className: "text-xl" })
239
+ variant: a === "add-blocks" ? "default" : "outline",
240
+ children: /* @__PURE__ */ e.jsx(V, { className: "text-xl" })
240
241
  }
241
242
  ),
242
243
  /* @__PURE__ */ e.jsx(
243
- j,
244
+ b,
244
245
  {
245
- onClick: () => i("layers"),
246
+ onClick: () => c("layers"),
246
247
  size: "sm",
247
- variant: r === "layers" ? "default" : "outline",
248
- children: /* @__PURE__ */ e.jsx(C, { className: "w-4" })
248
+ variant: a === "layers" ? "default" : "outline",
249
+ children: /* @__PURE__ */ e.jsx(D, { className: "w-4" })
249
250
  }
250
251
  ),
251
252
  /* @__PURE__ */ e.jsx(
252
- j,
253
+ b,
253
254
  {
254
- onClick: () => i("branding-options"),
255
+ onClick: () => c("branding-options"),
255
256
  size: "sm",
256
- variant: r === "branding-options" ? "default" : "outline",
257
- children: /* @__PURE__ */ e.jsx(V, { className: "w-4 max-w-[40px] text-xs" })
257
+ variant: a === "branding-options" ? "default" : "outline",
258
+ children: /* @__PURE__ */ e.jsx(M, { className: "w-4 max-w-[40px] text-xs" })
258
259
  }
259
260
  ),
260
261
  p.Children.toArray(
261
- a.map(({ name: l, icon: s }) => /* @__PURE__ */ e.jsx(f, { fallback: /* @__PURE__ */ e.jsx(T, { className: "h-10" }), children: /* @__PURE__ */ e.jsx(
262
- j,
262
+ r.map(({ name: l, icon: h }) => /* @__PURE__ */ e.jsx(j, { fallback: /* @__PURE__ */ e.jsx(z, { className: "h-10" }), children: /* @__PURE__ */ e.jsx(
263
+ b,
263
264
  {
264
- onClick: () => i(l),
265
+ onClick: () => c(l),
265
266
  size: "sm",
266
267
  className: "w-10",
267
- variant: r === l ? "default" : "outline",
268
- children: /* @__PURE__ */ e.jsx(s, {})
268
+ variant: a === l ? "default" : "outline",
269
+ children: /* @__PURE__ */ e.jsx(h, {})
269
270
  }
270
271
  ) }))
271
272
  )
272
273
  ] }),
273
274
  /* @__PURE__ */ e.jsx("div", { className: "relative z-[100] flex w-14 flex-col items-center space-y-2", children: p.Children.toArray(
274
- o.map((l) => /* @__PURE__ */ e.jsx(f, { fallback: /* @__PURE__ */ e.jsx(T, { className: "h-10" }), children: /* @__PURE__ */ e.jsx(l, {}) }))
275
+ t.map((l) => /* @__PURE__ */ e.jsx(j, { fallback: /* @__PURE__ */ e.jsx(z, { className: "h-10" }), children: /* @__PURE__ */ e.jsx(l, {}) }))
275
276
  ) })
276
277
  ] }),
277
278
  /* @__PURE__ */ e.jsx(
278
279
  "div",
279
280
  {
280
- className: `fixed left-14 z-[50] h-full w-96 border-r bg-background duration-500 ease-in-out ${r !== "layers" ? "translate-x-0" : "-translate-x-full"}`,
281
+ className: `fixed left-14 z-[50] h-full w-96 border-r bg-background duration-500 ease-in-out ${a !== "layers" ? "translate-x-0" : "-translate-x-full"}`,
281
282
  children: /* @__PURE__ */ e.jsx(
282
- f,
283
+ j,
283
284
  {
284
285
  fallback: /* @__PURE__ */ e.jsxs("div", { className: "flex animate-pulse flex-col gap-y-2 bg-white p-4", children: [
285
286
  /* @__PURE__ */ e.jsx("div", { className: "h-6 w-1/2 bg-gray-300" }),
@@ -289,11 +290,11 @@ const bs = () => {
289
290
  children: /* @__PURE__ */ e.jsx(
290
291
  "div",
291
292
  {
292
- className: fe("relative h-full max-h-[93%] bg-background p-1", r === "layers" ? "" : "z-[100]"),
293
+ className: je("relative h-full max-h-[93%] bg-background p-1", a === "layers" ? "" : "z-[100]"),
293
294
  onMouseEnter: () => {
294
- m && clearTimeout(m);
295
+ n && clearTimeout(n);
295
296
  },
296
- children: p.createElement(_(h, t, () => /* @__PURE__ */ e.jsx("div", {})))
297
+ children: p.createElement(J(f, m, () => /* @__PURE__ */ e.jsx("div", {})))
297
298
  }
298
299
  )
299
300
  }
@@ -301,37 +302,37 @@ const bs = () => {
301
302
  }
302
303
  ),
303
304
  /* @__PURE__ */ e.jsx("div", { className: "h-full w-60 border-r p-1", children: /* @__PURE__ */ e.jsx(
304
- f,
305
+ j,
305
306
  {
306
307
  fallback: /* @__PURE__ */ e.jsxs("div", { className: "flex animate-pulse flex-col gap-y-2 p-4", children: [
307
308
  /* @__PURE__ */ e.jsx("div", { className: "h-6 w-1/2 bg-gray-300" }),
308
309
  /* @__PURE__ */ e.jsx("div", { className: "h-16 w-full bg-gray-200" }),
309
310
  /* @__PURE__ */ e.jsx("div", { className: "h-16 w-full bg-gray-200" })
310
311
  ] }),
311
- children: w ? /* @__PURE__ */ e.jsxs(me, { defaultValue: "layers", className: "flex h-full w-full flex-col py-1", children: [
312
- /* @__PURE__ */ e.jsxs(xe, { className: "mx-1 h-10 grid grid-cols-2", children: [
313
- /* @__PURE__ */ e.jsxs(z, { value: "layers", children: [
314
- /* @__PURE__ */ e.jsx(C, { className: "h-3 mr-2" }),
312
+ children: w ? /* @__PURE__ */ e.jsxs(pe, { defaultValue: "layers", className: "flex h-full w-full flex-col py-1", children: [
313
+ /* @__PURE__ */ e.jsxs(ue, { className: "mx-1 h-10 grid grid-cols-2", children: [
314
+ /* @__PURE__ */ e.jsxs(K, { value: "layers", children: [
315
+ /* @__PURE__ */ e.jsx(D, { className: "h-3 mr-2" }),
315
316
  " Layers"
316
317
  ] }),
317
- /* @__PURE__ */ e.jsxs(z, { value: "data-provider", children: [
318
- /* @__PURE__ */ e.jsx(pe, { className: "w-3 mr-2" }),
318
+ /* @__PURE__ */ e.jsxs(K, { value: "data-provider", children: [
319
+ /* @__PURE__ */ e.jsx(he, { className: "w-3 mr-2" }),
319
320
  "Data"
320
321
  ] })
321
322
  ] }),
322
- /* @__PURE__ */ e.jsx(K, { value: "layers", className: "no-scrollbar h-full flex-1 overflow-y-auto overflow-x-hidden", children: p.createElement(D) }),
323
- /* @__PURE__ */ e.jsx(K, { value: "data-provider", className: "flex-1 overflow-y-auto overflow-x-hidden", children: /* @__PURE__ */ e.jsx(be, {}) })
323
+ /* @__PURE__ */ e.jsx(B, { value: "layers", className: "no-scrollbar h-full flex-1 overflow-y-auto overflow-x-hidden", children: p.createElement(A) }),
324
+ /* @__PURE__ */ e.jsx(B, { value: "data-provider", className: "flex-1 overflow-y-auto overflow-x-hidden", children: /* @__PURE__ */ e.jsx(Ne, {}) })
324
325
  ] }) : /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
325
326
  /* @__PURE__ */ e.jsxs("div", { className: "flex items-center bg-gray-200 rounded-md py-1", children: [
326
- /* @__PURE__ */ e.jsx(C, { className: "h-4 mr-2 ml-2" }),
327
+ /* @__PURE__ */ e.jsx(D, { className: "h-4 mr-2 ml-2" }),
327
328
  " Layers"
328
329
  ] }),
329
- /* @__PURE__ */ e.jsx("div", { className: "no-scrollbar h-full flex-1 overflow-y-auto overflow-x-hidden", children: p.createElement(D) })
330
+ /* @__PURE__ */ e.jsx("div", { className: "no-scrollbar h-full flex-1 overflow-y-auto overflow-x-hidden", children: p.createElement(A) })
330
331
  ] })
331
332
  }
332
333
  ) })
333
334
  ] });
334
335
  };
335
336
  export {
336
- bs as default
337
+ Ns as default
337
338
  };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-WUGKV8jN.cjs"),x=require("react"),P=require("./lodash-2us0VT8I.cjs"),t=require("./index-d55M5MRz.cjs"),g=require("./controls-QnyBNkXG.cjs"),R=require("./form-6qGAOYI3.cjs"),f=require("./index-Ge20J9Pa.cjs");require("./MODIFIERS-WFzDQfiT.cjs");require("@radix-ui/react-toggle");require("class-variance-authority");require("./utils-37UXq2O5.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");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("react-hotkeys-hook");require("sonner");require("./html-to-json-aAZkA0f5.cjs");require("himalaya");require("lucide-react");const b=({closeModal:i})=>{var l,o;const u=f.useAddPage(),[r,m]=x.useState({name:"",slug:"",blocks:[],type:"STATIC",seoData:{},template:""}),p=()=>{u.mutate(r,{onSuccess:()=>i()})},j=({formData:n},s)=>{m(q=>{var d,c;const a={[s]:n[s]};return s==="name"?a.slug=P.kebabCase((d=n[s])==null?void 0:d.replace(/\d/g,"")):s==="slug"&&(a.slug=(c=n[s])==null?void 0:c.replace(/\d/g,"").replace(/\s+/g,"").replace("--","-").replace("__","_")),{...q,...a}})},h={name:g.Ry({title:"Page Name",default:r.name}),slug:g.Ry({title:"Page Slug",default:r.slug})};return e.jsxRuntimeExports.jsxs(t.DialogContent,{children:[e.jsxRuntimeExports.jsx("div",{className:"px-1 font-bold",children:"Add Page"}),e.jsxRuntimeExports.jsx(R.Form,{formData:r,properties:h,onChange:j,disabled:u.isPending}),e.jsxRuntimeExports.jsx("div",{className:"flex items-center justify-end",children:e.jsxRuntimeExports.jsx(t.Button,{type:"submit",disabled:!r.name||!r.slug||((l=r.name)==null?void 0:l.length)<2||((o=r.slug)==null?void 0:o.length)<2||u.isPending,onClick:p,children:"Add Page"})})]})},C=()=>{const[i,u]=x.useState(!1);return e.jsxRuntimeExports.jsxs(t.Dialog,{open:i,onOpenChange:()=>u(!i),children:[e.jsxRuntimeExports.jsx(t.DialogTrigger,{asChild:!0,children:e.jsxRuntimeExports.jsx(t.Button,{size:"sm",variant:"link",className:"text-blue-500",onClick:()=>u(!i),children:"+ New Page"})}),i&&e.jsxRuntimeExports.jsx(b,{closeModal:()=>u(!i)})]})};exports.default=C;
@@ -2,9 +2,9 @@ import { j as t } from "./jsx-runtime-NV737rRe.js";
2
2
  import { useState as c } from "react";
3
3
  import { a0 as j } from "./lodash-3gkdNK5u.js";
4
4
  import { al as b, B as u, ak as C, ba as A } from "./index-0OqmBgqo.js";
5
- import { u as g } from "./controls-G0puEH71.js";
5
+ import { R as g } from "./controls-kEuiMMDf.js";
6
6
  import { F as D } from "./form-irY39wvJ.js";
7
- import { g as N } from "./index-CQz6j3ex.js";
7
+ import { g as N } from "./index-TWBwhGkh.js";
8
8
  import "./MODIFIERS-MLfpKQY1.js";
9
9
  import "@radix-ui/react-toggle";
10
10
  import "class-variance-authority";
@@ -39,7 +39,6 @@ import "redux-undo";
39
39
  import "@chaibuilder/runtime";
40
40
  import "@react-hookz/web";
41
41
  import "react-i18next";
42
- import "lodash";
43
42
  import "@rjsf/core";
44
43
  import "@rjsf/validator-ajv8";
45
44
  import "i18next";
@@ -53,7 +52,7 @@ import "sonner";
53
52
  import "./html-to-json-Y5M0N8PH.js";
54
53
  import "himalaya";
55
54
  import "lucide-react";
56
- const S = ({ closeModal: e }) => {
55
+ const R = ({ closeModal: e }) => {
57
56
  var p, s;
58
57
  const i = N(), [o, f] = c({
59
58
  name: "",
@@ -93,13 +92,13 @@ const S = ({ closeModal: e }) => {
93
92
  }
94
93
  ) })
95
94
  ] });
96
- }, Mt = () => {
95
+ }, St = () => {
97
96
  const [e, i] = c(!1);
98
97
  return /* @__PURE__ */ t.jsxs(C, { open: e, onOpenChange: () => i(!e), children: [
99
98
  /* @__PURE__ */ t.jsx(A, { asChild: !0, children: /* @__PURE__ */ t.jsx(u, { size: "sm", variant: "link", className: "text-blue-500", onClick: () => i(!e), children: "+ New Page" }) }),
100
- e && /* @__PURE__ */ t.jsx(S, { closeModal: () => i(!e) })
99
+ e && /* @__PURE__ */ t.jsx(R, { closeModal: () => i(!e) })
101
100
  ] });
102
101
  };
103
102
  export {
104
- Mt as default
103
+ St as default
105
104
  };