@chaibuilder/sdk 1.2.17 → 1.2.19

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 (91) hide show
  1. package/dist/AddBlocks-KeHVFaIr.cjs +1 -0
  2. package/dist/{AddBlocks--SllKzEG.js → AddBlocks-gcTaEIKO.js} +5 -4
  3. package/dist/BrandingOptions-I2I8w6E9.cjs +1 -0
  4. package/dist/{BrandingOptions-IqtZrxqX.js → BrandingOptions-bfiFY0VR.js} +11 -10
  5. package/dist/{CanvasArea-iLUw-tom.cjs → CanvasArea-JfHkTnQD.cjs} +1 -1
  6. package/dist/{CanvasArea-T1XNnB7d.js → CanvasArea-xvMCbQDL.js} +8 -7
  7. package/dist/{CurrentPage-TCduhO-X.js → CurrentPage-0Ap2N0uc.js} +13 -12
  8. package/dist/CurrentPage-vj52UxMA.cjs +1 -0
  9. package/dist/ListTree-Vq0_s1wC.cjs +1 -0
  10. package/dist/ListTree-k-QMO740.js +96 -0
  11. package/dist/{Outline-3IPrK7F-.js → Outline-HI6-c9nf.js} +96 -92
  12. package/dist/Outline-fAflJ_lN.cjs +1 -0
  13. package/dist/{PagesPanel-7goyNL8t.js → PagesPanel-Pk-C1956.js} +7 -6
  14. package/dist/PagesPanel-ug8Tmva6.cjs +1 -0
  15. package/dist/{ProjectPanel-CdPFwsXg.js → ProjectPanel-_KQBhuPO.js} +8 -7
  16. package/dist/ProjectPanel-o8-6cPX-.cjs +1 -0
  17. package/dist/Settings-Cc9eV4VG.cjs +1 -0
  18. package/dist/{Settings-pva9XRUC.js → Settings-XtAatoiu.js} +5 -4
  19. package/dist/{SidePanels-u5QXQrWL.js → SidePanels-O52zKXbH.js} +134 -133
  20. package/dist/SidePanels-ugRobm34.cjs +1 -0
  21. package/dist/Topbar-e5MGWX9n.cjs +1 -0
  22. package/dist/{Topbar-S3zgo3N8.js → Topbar-oTx7a12r.js} +5 -4
  23. package/dist/{UnsplashImages-132gZ842.js → UnsplashImages-5A21uzMK.js} +5 -4
  24. package/dist/UnsplashImages-KSbKGs91.cjs +1 -0
  25. package/dist/UploadImages-V42YSRVO.cjs +1 -0
  26. package/dist/{UploadImages-tr54Ik1I.js → UploadImages-V_54lCAO.js} +5 -4
  27. package/dist/{add-page-modal-AsP5g0Fp.js → add-page-modal-dKQLw7RQ.js} +17 -16
  28. package/dist/add-page-modal-xMedOdsp.cjs +1 -0
  29. package/dist/{confirm-alert-dYoU1ln_.js → confirm-alert-8GP3bKH_.js} +5 -4
  30. package/dist/{confirm-alert-bw0VBgoG.cjs → confirm-alert-KtW-4OjG.cjs} +1 -1
  31. package/dist/core.cjs +1 -1
  32. package/dist/core.d.ts +3 -2
  33. package/dist/core.js +47 -46
  34. package/dist/defaultTheme-7Lk2zq60.cjs +1 -0
  35. package/dist/{defaultTheme-s0cpA5Oy.js → defaultTheme-gunU_Fe5.js} +31 -33
  36. package/dist/{delete-page-modal-_Hy6ls6b.js → delete-page-modal-Zb5ld6O-.js} +7 -6
  37. package/dist/delete-page-modal-lebJCBBe.cjs +1 -0
  38. package/dist/email-blocks.cjs +1 -1
  39. package/dist/email-blocks.js +79 -79
  40. package/dist/email.cjs +1 -1
  41. package/dist/email.d.ts +3 -2
  42. package/dist/email.js +6 -5
  43. package/dist/{form-jzX2YXUO.cjs → form-o6_55v8F.cjs} +1 -1
  44. package/dist/{form-f13cs-An.js → form-yyU2x7So.js} +1 -1
  45. package/dist/{index-4xyhDki2.cjs → index-BMZLAJUV.cjs} +1 -1
  46. package/dist/{index-0JU8vPT_.cjs → index-JdnF6lYP.cjs} +42 -42
  47. package/dist/{index-MaXiXghQ.js → index-WP7IRkij.js} +915 -915
  48. package/dist/{index-ugsWasKp.js → index-lFcrvDFC.js} +3 -3
  49. package/dist/index-thKfFhmr.cjs +1 -0
  50. package/dist/{index-eyVVbA05.js → index-yILWlilS.js} +3142 -3132
  51. package/dist/lib.cjs +1 -1
  52. package/dist/lib.js +1 -1
  53. package/dist/{page-viewer-P5Im9RfR.js → page-viewer-3QXwPGpg.js} +11 -10
  54. package/dist/page-viewer-DTIblLiz.cjs +1 -0
  55. package/dist/{project-general-setting-R3pVVXmY.js → project-general-setting-UalRmyHm.js} +8 -7
  56. package/dist/project-general-setting-g7WhM3hc.cjs +1 -0
  57. package/dist/{project-seo-setting-pGpm3-6U.js → project-seo-setting-8FsvPSPl.js} +6 -5
  58. package/dist/project-seo-setting-xoeLQVj3.cjs +1 -0
  59. package/dist/render.cjs +1 -1
  60. package/dist/render.d.ts +10 -0
  61. package/dist/render.js +164 -78
  62. package/dist/{single-page-detail-m-THVQnz.js → single-page-detail-GaB85dNv.js} +9 -8
  63. package/dist/single-page-detail-XdBysrE_.cjs +1 -0
  64. package/dist/studio.cjs +1 -1
  65. package/dist/studio.d.ts +3 -2
  66. package/dist/studio.js +6 -5
  67. package/dist/ui.cjs +1 -1
  68. package/dist/ui.d.ts +1 -1
  69. package/dist/ui.js +140 -139
  70. package/dist/{useAddBlockByDrop-6qaL4Ufz.cjs → useAddBlockByDrop-6EbioQV4.cjs} +1 -1
  71. package/dist/{useAddBlockByDrop-vGme3brY.js → useAddBlockByDrop-BIK2fdgj.js} +1 -1
  72. package/package.json +2 -1
  73. package/dist/AddBlocks-7TF41ISQ.cjs +0 -1
  74. package/dist/BrandingOptions-uKE1vuWd.cjs +0 -1
  75. package/dist/CurrentPage-N5hSL1xB.cjs +0 -1
  76. package/dist/Outline-g4TXJ-hK.cjs +0 -1
  77. package/dist/PagesPanel-qI3sijis.cjs +0 -1
  78. package/dist/ProjectPanel-bMllQ4_a.cjs +0 -1
  79. package/dist/Settings-8f4ivm4-.cjs +0 -1
  80. package/dist/SidePanels-7HqZM4-j.cjs +0 -1
  81. package/dist/Topbar-poeqjjZb.cjs +0 -1
  82. package/dist/UnsplashImages-BOypn-e5.cjs +0 -1
  83. package/dist/UploadImages-giiNNHKq.cjs +0 -1
  84. package/dist/add-page-modal-ajpd-Gmw.cjs +0 -1
  85. package/dist/defaultTheme-1XwPZT2b.cjs +0 -1
  86. package/dist/delete-page-modal-H4JOWYZe.cjs +0 -1
  87. package/dist/index-MQH3blB-.cjs +0 -1
  88. package/dist/page-viewer-Xj9v8mji.cjs +0 -1
  89. package/dist/project-general-setting--5DT1RoW.cjs +0 -1
  90. package/dist/project-seo-setting-3DzzF83_.cjs +0 -1
  91. package/dist/single-page-detail-nJzGUDym.cjs +0 -1
@@ -1,21 +1,21 @@
1
1
  import { j as e } from "./jsx-runtime-WbnYoNE9.js";
2
- import { nth as k, startsWith as _, map as C, isUndefined as H, find as A, isEmpty as L, includes as P } from "lodash-es";
3
- import { BoxModelIcon as V, BoxIcon as F, DragHandleHorizontalIcon as z, ViewHorizontalIcon as $, BorderAllIcon as q, BorderTopIcon as K, TableIcon as U, DropdownMenuIcon as Y, RadiobuttonIcon as Q, InputIcon as G, ButtonIcon as v, CheckboxIcon as W, GroupIcon as X, SpaceBetweenVerticallyIcon as J, ColumnsIcon as Z, RowsIcon as B, TextIcon as w, SketchLogoIcon as ee, DividerHorizontalIcon as te, CodeIcon as se, CursorTextIcon as re, VideoIcon as ne, Link1Icon as oe, HeadingIcon as ae, ImageIcon as ce, TriangleRightIcon as ie, TrashIcon as le, CopyIcon as xe, DoubleArrowDownIcon as de, StackIcon as me } from "@radix-ui/react-icons";
2
+ import { nth as v, startsWith as _, map as T, isUndefined as H, find as A, isEmpty as L, includes as P } from "lodash-es";
3
+ import { BoxModelIcon as V, BoxIcon as F, DragHandleHorizontalIcon as z, ViewHorizontalIcon as $, BorderAllIcon as q, BorderTopIcon as K, TableIcon as U, DropdownMenuIcon as Y, RadiobuttonIcon as Q, InputIcon as G, ButtonIcon as B, CheckboxIcon as W, GroupIcon as X, SpaceBetweenVerticallyIcon as J, ColumnsIcon as Z, RowsIcon as w, TextIcon as C, SketchLogoIcon as ee, DividerHorizontalIcon as te, CodeIcon as se, CursorTextIcon as oe, VideoIcon as re, Link1Icon as ne, HeadingIcon as ae, ImageIcon as ce, TriangleRightIcon as ie, TrashIcon as le, CopyIcon as de, DoubleArrowDownIcon as xe, StackIcon as me } from "@radix-ui/react-icons";
4
4
  import { useDrop as ue, useDragLayer as pe } from "react-dnd";
5
5
  import { useDragOver as ge, Tree as he } from "@minoru/react-dnd-treeview";
6
6
  import { useTranslation as je } from "react-i18next";
7
- import { Y as be, X as Ie, h as fe, ap as ye, aq as ke, ar as ve, r as f, s as Be, a1 as T, bq as D, aS as we, t as Ce, br as Te, aR as De, bs as Se, bt as Ne, E as Oe, aM as Re, ac as Me, bu as Ee, bg as _e, bv as He } from "./index-MaXiXghQ.js";
7
+ import { Y as be, X as fe, h as Ie, ap as ye, aq as ke, ar as ve, r as I, s as Be, a1 as D, bq as N, aS as we, t as Ce, br as Te, aR as De, bs as Ne, bt as Se, E as Oe, aM as Re, ac as Me, bu as Ee, bg as _e, bv as He } from "./index-WP7IRkij.js";
8
8
  import { DatabaseIcon as Ae } from "lucide-react";
9
9
  import { useMemo as Le, useCallback as Pe } from "react";
10
10
  import { a as Ve } from "./MODIFIERS-WQdaNvb8.js";
11
11
  import { c as S } from "./Functions-7jnEwJyw.js";
12
- import { a as Fe } from "./index-eyVVbA05.js";
13
- import { u as ze } from "./useAddBlockByDrop-vGme3brY.js";
12
+ import { a as Fe, d as ze } from "./index-yILWlilS.js";
13
+ import { u as $e } from "./useAddBlockByDrop-BIK2fdgj.js";
14
14
  import "./_commonjsHelpers-UyOWmZb0.js";
15
15
  import "@chaibuilder/runtime";
16
16
  import "jotai";
17
- import "flat-to-nested";
18
17
  import "@react-hookz/web";
18
+ import "flat-to-nested";
19
19
  import "@radix-ui/react-toggle";
20
20
  import "class-variance-authority";
21
21
  import "./Class-3k8xjeiM.js";
@@ -42,27 +42,28 @@ import "@radix-ui/react-context-menu";
42
42
  import "react-icons-picker";
43
43
  import "react-dom";
44
44
  import "react-quill";
45
+ import "lodash";
45
46
  import "i18next";
46
47
  import "@floating-ui/react-dom";
47
48
  import "react-textarea-autosize";
48
49
  import "flagged";
49
50
  import "react-hotkeys-hook";
50
- const N = (t) => {
51
+ const O = (t) => {
51
52
  switch (t.type) {
52
53
  case "Image":
53
54
  return /* @__PURE__ */ e.jsx(ce, {});
54
55
  case "Heading":
55
56
  return /* @__PURE__ */ e.jsx(ae, {});
56
57
  case "Text":
57
- return /* @__PURE__ */ e.jsx(w, {});
58
+ return /* @__PURE__ */ e.jsx(C, {});
58
59
  case "Link":
59
- return /* @__PURE__ */ e.jsx(oe, {});
60
- case "Video":
61
60
  return /* @__PURE__ */ e.jsx(ne, {});
62
- case "RichText":
61
+ case "Video":
63
62
  return /* @__PURE__ */ e.jsx(re, {});
63
+ case "RichText":
64
+ return /* @__PURE__ */ e.jsx(oe, {});
64
65
  case "Button":
65
- return /* @__PURE__ */ e.jsx(v, {});
66
+ return /* @__PURE__ */ e.jsx(B, {});
66
67
  case "CustomHTML":
67
68
  return /* @__PURE__ */ e.jsx(se, {});
68
69
  case "Divider":
@@ -70,11 +71,11 @@ const N = (t) => {
70
71
  case "Icon":
71
72
  return /* @__PURE__ */ e.jsx(ee, {});
72
73
  case "List":
73
- return /* @__PURE__ */ e.jsx(B, {});
74
- case "Paragraph":
75
74
  return /* @__PURE__ */ e.jsx(w, {});
75
+ case "Paragraph":
76
+ return /* @__PURE__ */ e.jsx(C, {});
76
77
  case "Row":
77
- return /* @__PURE__ */ e.jsx(B, {});
78
+ return /* @__PURE__ */ e.jsx(w, {});
78
79
  case "ListItem":
79
80
  return /* @__PURE__ */ e.jsx(Z, {});
80
81
  case "LineBreak":
@@ -84,7 +85,7 @@ const N = (t) => {
84
85
  case "Checkbox":
85
86
  return /* @__PURE__ */ e.jsx(W, {});
86
87
  case "FormButton":
87
- return /* @__PURE__ */ e.jsx(v, {});
88
+ return /* @__PURE__ */ e.jsx(B, {});
88
89
  case "Input":
89
90
  case "TextArea":
90
91
  return /* @__PURE__ */ e.jsx(G, {});
@@ -110,7 +111,7 @@ const N = (t) => {
110
111
  return /* @__PURE__ */ e.jsx(V, {});
111
112
  }
112
113
  };
113
- function $e(t = "") {
114
+ function qe(t = "") {
114
115
  const s = {
115
116
  xs: "390px",
116
117
  sm: "640px",
@@ -127,39 +128,42 @@ function $e(t = "") {
127
128
  const i = new RegExp(
128
129
  // checks if any of the display property is set for any higher media query
129
130
  /\b(sm|md|lg|xl|2xl):(block|grid|flex|inline|inline-grid|inline-flex|inline-block)\b/
130
- ), o = t.match(i);
131
- if (k(o, 1))
132
- return `Visible >=${s[k(o, 1)]}`;
131
+ ), n = t.match(i);
132
+ if (v(n, 1))
133
+ return `Visible >=${s[v(n, 1)]}`;
133
134
  }
134
135
  return "";
135
136
  }
136
- const qe = (t) => {
137
+ function Ke(t) {
138
+ return t.split("/").pop();
139
+ }
140
+ const Ue = (t) => {
137
141
  let s = "";
138
- return Object.keys(t).forEach((n) => {
139
- _(t[n], Ve) && (s = t[n]);
142
+ return Object.keys(t).forEach((r) => {
143
+ _(t[r], Ve) && (s = t[r]);
140
144
  }), s;
141
- }, Ke = (t) => {
145
+ }, Ye = (t) => {
142
146
  var u;
143
- const [, s] = be(), [n] = Ie(), c = fe("outlineMenuItems", []), { isSelected: i } = t, { id: o, data: l } = t.node, p = t.depth * 10, d = (a) => {
147
+ const [, s] = be(), [r] = fe(), c = Ie("outlineMenuItems", []), { isSelected: i } = t, { id: n, data: l } = t.node, p = t.depth * 10, x = (a) => {
144
148
  a.stopPropagation(), t.onToggle(t.node.id);
145
- }, g = ge(o, t.isOpen, t.onToggle), m = Le(() => {
146
- const a = qe(t.node.data);
147
- return $e(a);
149
+ }, g = ge(n, t.isOpen, t.onToggle), m = Le(() => {
150
+ const a = Ue(t.node.data);
151
+ return qe(a);
148
152
  }, [t.node.data]);
149
153
  return (
150
154
  // eslint-disable-next-line jsx-a11y/click-events-have-key-events,jsx-a11y/no-static-element-interactions
151
155
  /* @__PURE__ */ e.jsx(
152
156
  "div",
153
157
  {
154
- onMouseEnter: () => s(o),
158
+ onMouseEnter: () => s(n),
155
159
  className: S(
156
160
  "group flex w-full items-center justify-between space-x-px py-px",
157
161
  i ? "bg-blue-500 text-white" : "text-gray-600 hover:bg-gray-200 dark:hover:bg-gray-800"
158
162
  ),
159
163
  onClick: (a) => {
160
- a.stopPropagation(), !n.includes(o) && t.onSelect(o);
164
+ a.stopPropagation(), !r.includes(n) && t.onSelect(n);
161
165
  },
162
- onContextMenu: () => t.onSelect(o),
166
+ onContextMenu: () => t.onSelect(n),
163
167
  style: { paddingInlineStart: p },
164
168
  ...g,
165
169
  children: /* @__PURE__ */ e.jsxs("div", { className: "flex w-full items-center justify-between pr-2", children: [
@@ -168,16 +172,16 @@ const qe = (t) => {
168
172
  "div",
169
173
  {
170
174
  className: `flex h-4 w-4 rotate-0 transform cursor-pointer items-center justify-center text-xs transition-transform duration-100 ${t.isOpen ? "rotate-90" : ""}`,
171
- children: t.node.droppable && /* @__PURE__ */ e.jsx("button", { onClick: d, type: "button", children: /* @__PURE__ */ e.jsx(ie, {}) })
175
+ children: t.node.droppable && /* @__PURE__ */ e.jsx("button", { onClick: x, type: "button", children: /* @__PURE__ */ e.jsx(ie, {}) })
172
176
  }
173
177
  ),
174
178
  /* @__PURE__ */ e.jsxs("button", { type: "button", className: "flex items-center", children: [
175
- /* @__PURE__ */ e.jsx("div", { className: "-mt-1 h-3 w-3", children: /* @__PURE__ */ e.jsx(N, { type: l == null ? void 0 : l._type }) }),
176
- /* @__PURE__ */ e.jsx("div", { className: "ml-2 truncate text-[11px]", children: ((u = t.node.data) == null ? void 0 : u._name) || t.node.text }),
179
+ /* @__PURE__ */ e.jsx("div", { className: "-mt-1 h-3 w-3", children: /* @__PURE__ */ e.jsx(O, { type: l == null ? void 0 : l._type }) }),
180
+ /* @__PURE__ */ e.jsx("div", { className: "ml-2 truncate text-[11px]", children: ((u = t.node.data) == null ? void 0 : u._name) || Ke(t.node.text) }),
177
181
  m ? /* @__PURE__ */ e.jsxs(
178
182
  "span",
179
183
  {
180
- className: "ml-2 flex items-center text-[10px] italic " + (i ? "text-gray-200" : "text-gray-500"),
184
+ className: "ml-2 flex items-center truncate text-[10px] italic " + (i ? "text-gray-200" : "text-gray-500"),
181
185
  children: [
182
186
  "(",
183
187
  m,
@@ -193,7 +197,7 @@ const qe = (t) => {
193
197
  {
194
198
  className: "cursor-pointer rounded bg-transparent hover:bg-white hover:text-blue-500",
195
199
  asChild: !0,
196
- children: a.item(o)
200
+ children: a.item(n)
197
201
  }
198
202
  ),
199
203
  /* @__PURE__ */ e.jsx(ve, { children: a.tooltip })
@@ -202,22 +206,22 @@ const qe = (t) => {
202
206
  }
203
207
  )
204
208
  );
205
- }, Ue = (t) => {
206
- var n;
209
+ }, Qe = (t) => {
210
+ var r;
207
211
  const { item: s } = t.monitorProps;
208
212
  return /* @__PURE__ */ e.jsxs("div", { className: "flex w-max items-center bg-blue-200 bg-opacity-30 p-1 font-semibold text-blue-700", children: [
209
- /* @__PURE__ */ e.jsx("div", { className: "", children: /* @__PURE__ */ e.jsx(N, { type: (n = s == null ? void 0 : s.data) == null ? void 0 : n._type }) }),
213
+ /* @__PURE__ */ e.jsx("div", { className: "", children: /* @__PURE__ */ e.jsx(O, { type: (r = s == null ? void 0 : s.data) == null ? void 0 : r._type }) }),
210
214
  /* @__PURE__ */ e.jsx("div", { className: "ml-2 truncate text-[11px]", children: s.text })
211
215
  ] });
212
- }, Ye = (t) => {
216
+ }, Ge = (t) => {
213
217
  const s = t.depth * 10 + 16;
214
218
  return /* @__PURE__ */ e.jsx("div", { className: "absolute right-0 top-0 h-0.5 -translate-y-1/2 transform bg-green-500", style: { left: s } });
215
- }, Qe = () => {
216
- const [t] = f(), s = Be(), n = T();
219
+ }, We = () => {
220
+ const [t] = I(), s = Be(), r = D();
217
221
  return /* @__PURE__ */ e.jsxs(
218
- D,
222
+ N,
219
223
  {
220
- disabled: !we(n == null ? void 0 : n._type),
224
+ disabled: !we(r == null ? void 0 : r._type),
221
225
  className: "flex items-center gap-x-4 text-xs",
222
226
  onClick: () => s(t),
223
227
  children: [
@@ -226,71 +230,71 @@ const qe = (t) => {
226
230
  ]
227
231
  }
228
232
  );
229
- }, Ge = () => {
230
- const [t] = f(), s = Ce(), n = T(), c = Pe(() => {
233
+ }, Xe = () => {
234
+ const [t] = I(), s = Ce(), r = D(), c = Pe(() => {
231
235
  s(t);
232
236
  }, [t, s]);
233
237
  return /* @__PURE__ */ e.jsxs(Te, { className: "text-xs", children: [
234
238
  /* @__PURE__ */ e.jsxs(
235
- D,
239
+ N,
236
240
  {
237
- disabled: !De(n == null ? void 0 : n._type),
241
+ disabled: !De(r == null ? void 0 : r._type),
238
242
  className: "flex items-center gap-x-4 text-xs",
239
243
  onClick: c,
240
244
  children: [
241
- /* @__PURE__ */ e.jsx(xe, {}),
245
+ /* @__PURE__ */ e.jsx(de, {}),
242
246
  " Duplicate"
243
247
  ]
244
248
  }
245
249
  ),
246
- /* @__PURE__ */ e.jsx(Qe, {})
250
+ /* @__PURE__ */ e.jsx(We, {})
247
251
  ] });
248
- }, We = ({ children: t }) => /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsxs(Se, { children: [
249
- /* @__PURE__ */ e.jsx(Ne, { children: t }),
250
- /* @__PURE__ */ e.jsx(Ge, {})
252
+ }, Je = ({ children: t }) => /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsxs(Ne, { children: [
253
+ /* @__PURE__ */ e.jsx(Se, { children: t }),
254
+ /* @__PURE__ */ e.jsx(Xe, {})
251
255
  ] }) });
252
- function Xe(t) {
253
- return C(t, (s) => {
254
- const { data: n } = s;
256
+ function Ze(t) {
257
+ return T(t, (s) => {
258
+ const { data: r } = s;
255
259
  return {
256
- ...n,
260
+ ...r,
257
261
  _parent: s.parent === 0 ? null : s.parent
258
262
  };
259
263
  });
260
264
  }
261
- const Yt = () => {
262
- const [t] = Oe(), { setNewBlocks: s } = Re(), [n, c, i] = f(), [, o] = Me(), { t: l } = je(), p = Fe(), d = ze(), [g] = Ee(), m = async (r, x) => {
263
- const { dragSource: j, relativeIndex: b, dropTargetId: I, monitor: y } = x;
265
+ const Wt = () => {
266
+ const [t] = Oe(), { setNewBlocks: s } = Re(), [r, c, i] = I(), [, n] = Me(), { t: l } = je(), p = Fe(), x = $e(), [g] = Ee(), m = async (o, d) => {
267
+ const { dragSource: j, relativeIndex: b, dropTargetId: f, monitor: y } = d;
264
268
  if (j) {
265
- const M = Xe(r);
266
- s(M);
269
+ const k = Ze(o);
270
+ s(k), ze("Handle Drop -> New Blocks -> ", k);
267
271
  const E = y.getItem();
268
272
  c([E.id]);
269
273
  } else
270
- await d({ block: y.getItem(), dropTargetId: I, relativeIndex: b });
271
- }, u = C(t, (r) => ({
272
- id: r._id,
273
- text: r._type,
274
- parent: r._parent || 0,
275
- droppable: !H(A(t, { _parent: r._id })),
276
- data: r
274
+ await x({ block: y.getItem(), dropTargetId: f, relativeIndex: b });
275
+ }, u = T(t, (o) => ({
276
+ id: o._id,
277
+ text: o._type,
278
+ parent: o._parent || 0,
279
+ droppable: !H(A(t, { _parent: o._id })),
280
+ data: o
277
281
  })), a = () => {
278
- c([]), o([]);
279
- }, [{ isOver: h }, O] = ue(() => ({
282
+ c([]), n([]);
283
+ }, [{ isOver: h }, R] = ue(() => ({
280
284
  accept: ["CHAI_BLOCK"],
281
- collect: (r) => ({
282
- canDrop: r.canDrop(),
283
- isOver: r.isOver()
285
+ collect: (o) => ({
286
+ canDrop: o.canDrop(),
287
+ isOver: o.isOver()
284
288
  }),
285
- drop: (r) => {
286
- (async () => await d({
287
- block: r,
289
+ drop: (o) => {
290
+ (async () => await x({
291
+ block: o,
288
292
  dropTargetId: "",
289
293
  relativeIndex: 0
290
294
  }))();
291
295
  }
292
- })), { isDragging: R } = pe((r) => ({
293
- isDragging: r.isDragging()
296
+ })), { isDragging: M } = pe((o) => ({
297
+ isDragging: o.isDragging()
294
298
  }));
295
299
  return /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsx(
296
300
  "div",
@@ -298,15 +302,15 @@ const Yt = () => {
298
302
  onClick: () => a(),
299
303
  className: S(
300
304
  "-mx-1 -mt-1 flex h-full select-none flex-col space-y-1",
301
- R ? "bg-green-50/80" : "bg-background"
305
+ M ? "bg-green-50/80" : "bg-background"
302
306
  ),
303
307
  children: L(t) ? /* @__PURE__ */ e.jsxs(
304
308
  "div",
305
309
  {
306
- ref: O,
310
+ ref: R,
307
311
  className: `mx-1 mt-4 h-full max-w-full p-6 text-center text-sm text-gray-400 ${h ? "bg-blue-200" : ""}`,
308
312
  children: [
309
- h ? /* @__PURE__ */ e.jsx(de, { className: "mx-auto h-12 w-12 animate-bounce" }) : /* @__PURE__ */ e.jsx(me, { className: "mx-auto h-10 w-10" }),
313
+ h ? /* @__PURE__ */ e.jsx(xe, { className: "mx-auto h-12 w-12 animate-bounce" }) : /* @__PURE__ */ e.jsx(me, { className: "mx-auto h-10 w-10" }),
310
314
  /* @__PURE__ */ e.jsx("p", { className: "mt-2", children: l(h ? "drop_here_message" : "tree_view_no_blocks") })
311
315
  ]
312
316
  }
@@ -317,21 +321,21 @@ const Yt = () => {
317
321
  extraAcceptTypes: ["CHAI_BLOCK"],
318
322
  tree: u,
319
323
  rootId: 0,
320
- render: (r, { depth: x, isOpen: j, onToggle: b }) => /* @__PURE__ */ e.jsx(We, { id: r.id, children: /* @__PURE__ */ e.jsx(
321
- Ke,
324
+ render: (o, { depth: d, isOpen: j, onToggle: b }) => /* @__PURE__ */ e.jsx(Je, { id: o.id, children: /* @__PURE__ */ e.jsx(
325
+ Ye,
322
326
  {
323
- onSelect: (I) => {
324
- o([]), c([I]);
327
+ onSelect: (f) => {
328
+ n([]), c([f]);
325
329
  },
326
- isSelected: P(n, r.id),
327
- node: r,
328
- depth: x,
330
+ isSelected: P(r, o.id),
331
+ node: o,
332
+ depth: d,
329
333
  isOpen: j,
330
334
  onToggle: b,
331
335
  toggleIds: i
332
336
  }
333
337
  ) }),
334
- dragPreviewRender: (r) => /* @__PURE__ */ e.jsx(Ue, { monitorProps: r }),
338
+ dragPreviewRender: (o) => /* @__PURE__ */ e.jsx(Qe, { monitorProps: o }),
335
339
  onDrop: m,
336
340
  classes: {
337
341
  root: "h-[90%] " + (g ? "pl-2" : "pt-2"),
@@ -344,12 +348,12 @@ const Yt = () => {
344
348
  canDrop: He,
345
349
  dropTargetOffset: 2,
346
350
  enableAnimateExpand: !0,
347
- placeholderRender: (r, { depth: x }) => /* @__PURE__ */ e.jsx(Ye, { node: r, depth: x })
351
+ placeholderRender: (o, { depth: d }) => /* @__PURE__ */ e.jsx(Ge, { node: o, depth: d })
348
352
  }
349
353
  ) })
350
354
  }
351
355
  ) });
352
356
  };
353
357
  export {
354
- Yt as default
358
+ Wt as default
355
359
  };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-Z_BpKhVy.cjs"),u=require("lodash-es"),s=require("@radix-ui/react-icons"),y=require("react-dnd"),v=require("@minoru/react-dnd-treeview"),O=require("react-i18next"),r=require("./index-thKfFhmr.cjs"),M=require("lucide-react"),w=require("react"),_=require("./MODIFIERS-9EwxLM8V.cjs"),T=require("./Functions-N3yhPYKY.cjs"),B=require("./index-JdnF6lYP.cjs"),H=require("./useAddBlockByDrop-6EbioQV4.cjs");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("@chaibuilder/runtime");require("jotai");require("@react-hookz/web");require("flat-to-nested");require("@radix-ui/react-toggle");require("class-variance-authority");require("./Class-MmCxz2Ay.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("lodash");require("i18next");require("@floating-ui/react-dom");require("react-textarea-autosize");require("flagged");require("react-hotkeys-hook");const C=t=>{switch(t.type){case"Image":return e.jsxRuntimeExports.jsx(s.ImageIcon,{});case"Heading":return e.jsxRuntimeExports.jsx(s.HeadingIcon,{});case"Text":return e.jsxRuntimeExports.jsx(s.TextIcon,{});case"Link":return e.jsxRuntimeExports.jsx(s.Link1Icon,{});case"Video":return e.jsxRuntimeExports.jsx(s.VideoIcon,{});case"RichText":return e.jsxRuntimeExports.jsx(s.CursorTextIcon,{});case"Button":return e.jsxRuntimeExports.jsx(s.ButtonIcon,{});case"CustomHTML":return e.jsxRuntimeExports.jsx(s.CodeIcon,{});case"Divider":return e.jsxRuntimeExports.jsx(s.DividerHorizontalIcon,{});case"Icon":return e.jsxRuntimeExports.jsx(s.SketchLogoIcon,{});case"List":return e.jsxRuntimeExports.jsx(s.RowsIcon,{});case"Paragraph":return e.jsxRuntimeExports.jsx(s.TextIcon,{});case"Row":return e.jsxRuntimeExports.jsx(s.RowsIcon,{});case"ListItem":return e.jsxRuntimeExports.jsx(s.ColumnsIcon,{});case"LineBreak":return e.jsxRuntimeExports.jsx(s.SpaceBetweenVerticallyIcon,{});case"Form":return e.jsxRuntimeExports.jsx(s.GroupIcon,{});case"Checkbox":return e.jsxRuntimeExports.jsx(s.CheckboxIcon,{});case"FormButton":return e.jsxRuntimeExports.jsx(s.ButtonIcon,{});case"Input":case"TextArea":return e.jsxRuntimeExports.jsx(s.InputIcon,{});case"Radio":return e.jsxRuntimeExports.jsx(s.RadiobuttonIcon,{});case"Select":return e.jsxRuntimeExports.jsx(s.DropdownMenuIcon,{});case"Table":return e.jsxRuntimeExports.jsx(s.TableIcon,{});case"TableHead":return e.jsxRuntimeExports.jsx(s.BorderTopIcon,{});case"TableBody":return e.jsxRuntimeExports.jsx(s.BorderAllIcon,{});case"TableRow":return e.jsxRuntimeExports.jsx(s.ViewHorizontalIcon,{});case"TableCell":return e.jsxRuntimeExports.jsx(s.DragHandleHorizontalIcon,{});case"DataProvider":return e.jsxRuntimeExports.jsx(M.DatabaseIcon,{size:16});case"Box":return e.jsxRuntimeExports.jsx(s.BoxIcon,{});default:return e.jsxRuntimeExports.jsx(s.BoxModelIcon,{})}};function A(t=""){const n={xs:"390px",sm:"640px",md:"768px",lg:"1024px",xl:"1366px","2xl":"1536px"};if(new RegExp(/\bsr-only\b/).test(t))return"Sr Only";if(new RegExp(/\b(sm|md|lg|xl|2xl):hidden\b/).test(t))return"Visible on mobile";if(t.match(/(^| )hidden( |$)/g)){const a=new RegExp(/\b(sm|md|lg|xl|2xl):(block|grid|flex|inline|inline-grid|inline-flex|inline-block)\b/),c=t.match(a);if(u.nth(c,1))return`Visible >=${n[u.nth(c,1)]}`}return""}function L(t){return t.split("/").pop()}const P=t=>{let n="";return Object.keys(t).forEach(i=>{u.startsWith(t[i],_.STYLES_KEY)&&(n=t[i])}),n},F=t=>{var g;const[,n]=r.useHighlightBlockId(),[i]=r.useHiddenBlockIds(),l=r.useBuilderProp("outlineMenuItems",[]),{isSelected:a}=t,{id:c,data:d}=t.node,R=t.depth*10,m=x=>{x.stopPropagation(),t.onToggle(t.node.id)},E=v.useDragOver(c,t.isOpen,t.onToggle),j=w.useMemo(()=>{const x=P(t.node.data);return A(x)},[t.node.data]);return e.jsxRuntimeExports.jsx("div",{onMouseEnter:()=>n(c),className:T.cn("group flex w-full items-center justify-between space-x-px py-px",a?"bg-blue-500 text-white":"text-gray-600 hover:bg-gray-200 dark:hover:bg-gray-800"),onClick:x=>{x.stopPropagation(),!i.includes(c)&&t.onSelect(c)},onContextMenu:()=>t.onSelect(c),style:{paddingInlineStart:R},...E,children:e.jsxRuntimeExports.jsxs("div",{className:"flex w-full items-center justify-between pr-2",children:[e.jsxRuntimeExports.jsxs("div",{className:"flex items-center",children:[e.jsxRuntimeExports.jsx("div",{className:`flex h-4 w-4 rotate-0 transform cursor-pointer items-center justify-center text-xs transition-transform duration-100 ${t.isOpen?"rotate-90":""}`,children:t.node.droppable&&e.jsxRuntimeExports.jsx("button",{onClick:m,type:"button",children:e.jsxRuntimeExports.jsx(s.TriangleRightIcon,{})})}),e.jsxRuntimeExports.jsxs("button",{type:"button",className:"flex items-center",children:[e.jsxRuntimeExports.jsx("div",{className:"-mt-1 h-3 w-3",children:e.jsxRuntimeExports.jsx(C,{type:d==null?void 0:d._type})}),e.jsxRuntimeExports.jsx("div",{className:"ml-2 truncate text-[11px]",children:((g=t.node.data)==null?void 0:g._name)||L(t.node.text)}),j?e.jsxRuntimeExports.jsxs("span",{className:"ml-2 flex items-center truncate text-[10px] italic "+(a?"text-gray-200":"text-gray-500"),children:["(",j,")"]}):null]})]}),e.jsxRuntimeExports.jsx("div",{className:"invisible flex items-center space-x-1 group-hover:visible",children:l.map(x=>e.jsxRuntimeExports.jsxs(r.Tooltip,{children:[e.jsxRuntimeExports.jsx(r.TooltipTrigger,{className:"cursor-pointer rounded bg-transparent hover:bg-white hover:text-blue-500",asChild:!0,children:x.item(c)}),e.jsxRuntimeExports.jsx(r.TooltipContent,{children:x.tooltip})]}))})]})})},V=t=>{var i;const{item:n}=t.monitorProps;return e.jsxRuntimeExports.jsxs("div",{className:"flex w-max items-center bg-blue-200 bg-opacity-30 p-1 font-semibold text-blue-700",children:[e.jsxRuntimeExports.jsx("div",{className:"",children:e.jsxRuntimeExports.jsx(C,{type:(i=n==null?void 0:n.data)==null?void 0:i._type})}),e.jsxRuntimeExports.jsx("div",{className:"ml-2 truncate text-[11px]",children:n.text})]})},z=t=>{const n=t.depth*10+16;return e.jsxRuntimeExports.jsx("div",{className:"absolute right-0 top-0 h-0.5 -translate-y-1/2 transform bg-green-500",style:{left:n}})},$=()=>{const[t]=r.useSelectedBlockIds(),n=r.useRemoveBlocks(),i=r.useSelectedBlock();return e.jsxRuntimeExports.jsxs(r.ContextMenuItem,{disabled:!r.canDeleteBlock(i==null?void 0:i._type),className:"flex items-center gap-x-4 text-xs",onClick:()=>n(t),children:[e.jsxRuntimeExports.jsx(s.TrashIcon,{})," Remove"]})},K=()=>{const[t]=r.useSelectedBlockIds(),n=r.useDuplicateBlocks(),i=r.useSelectedBlock(),l=w.useCallback(()=>{n(t)},[t,n]);return e.jsxRuntimeExports.jsxs(r.ContextMenuContent,{className:"text-xs",children:[e.jsxRuntimeExports.jsxs(r.ContextMenuItem,{disabled:!r.canDuplicateBlock(i==null?void 0:i._type),className:"flex items-center gap-x-4 text-xs",onClick:l,children:[e.jsxRuntimeExports.jsx(s.CopyIcon,{})," Duplicate"]}),e.jsxRuntimeExports.jsx($,{})]})},U=({children:t})=>e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:e.jsxRuntimeExports.jsxs(r.ContextMenu,{children:[e.jsxRuntimeExports.jsx(r.ContextMenuTrigger,{children:t}),e.jsxRuntimeExports.jsx(K,{})]})});function Q(t){return u.map(t,n=>{const{data:i}=n;return{...i,_parent:n.parent===0?null:n.parent}})}const Y=()=>{const[t]=r.useBlocksStore(),{setNewBlocks:n}=r.useBlocksStoreUndoableActions(),[i,l,a]=r.useSelectedBlockIds(),[,c]=r.useSelectedStylingBlocks(),{t:d}=O.useTranslation(),R=B.useExpandedIds(),m=H.useAddBlockByDrop(),[E]=r.useBlocksContainer(),j=async(o,p)=>{const{dragSource:I,relativeIndex:b,dropTargetId:q,monitor:f}=p;if(I){const k=Q(o);n(k),B.debugLog("Handle Drop -> New Blocks -> ",k);const N=f.getItem();l([N.id])}else await m({block:f.getItem(),dropTargetId:q,relativeIndex:b})},g=u.map(t,o=>({id:o._id,text:o._type,parent:o._parent||0,droppable:!u.isUndefined(u.find(t,{_parent:o._id})),data:o})),x=()=>{l([]),c([])},[{isOver:h},D]=y.useDrop(()=>({accept:["CHAI_BLOCK"],collect:o=>({canDrop:o.canDrop(),isOver:o.isOver()}),drop:o=>{(async()=>await m({block:o,dropTargetId:"",relativeIndex:0}))()}})),{isDragging:S}=y.useDragLayer(o=>({isDragging:o.isDragging()}));return e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:e.jsxRuntimeExports.jsx("div",{onClick:()=>x(),className:T.cn("-mx-1 -mt-1 flex h-full select-none flex-col space-y-1",S?"bg-green-50/80":"bg-background"),children:u.isEmpty(t)?e.jsxRuntimeExports.jsxs("div",{ref:D,className:`mx-1 mt-4 h-full max-w-full p-6 text-center text-sm text-gray-400 ${h?"bg-blue-200":""}`,children:[h?e.jsxRuntimeExports.jsx(s.DoubleArrowDownIcon,{className:"mx-auto h-12 w-12 animate-bounce"}):e.jsxRuntimeExports.jsx(s.StackIcon,{className:"mx-auto h-10 w-10"}),e.jsxRuntimeExports.jsx("p",{className:"mt-2",children:d(h?"drop_here_message":"tree_view_no_blocks")})]}):e.jsxRuntimeExports.jsx(r.ScrollArea,{id:"layers-view",className:"no-scrollbar h-full overflow-y-auto p-1",children:e.jsxRuntimeExports.jsx(v.Tree,{initialOpen:R,extraAcceptTypes:["CHAI_BLOCK"],tree:g,rootId:0,render:(o,{depth:p,isOpen:I,onToggle:b})=>e.jsxRuntimeExports.jsx(U,{id:o.id,children:e.jsxRuntimeExports.jsx(F,{onSelect:q=>{c([]),l([q])},isSelected:u.includes(i,o.id),node:o,depth:p,isOpen:I,onToggle:b,toggleIds:a})}),dragPreviewRender:o=>e.jsxRuntimeExports.jsx(V,{monitorProps:o}),onDrop:j,classes:{root:"h-[90%] "+(E?"pl-2":"pt-2"),draggingSource:"opacity-30",dropTarget:"bg-green-100",placeholder:"relative"},sort:!1,insertDroppableFirst:!1,canDrop:r.canDropBlock,dropTargetOffset:2,enableAnimateExpand:!0,placeholderRender:(o,{depth:p})=>e.jsxRuntimeExports.jsx(z,{node:o,depth:p})})})})})};exports.default=Y;
@@ -1,20 +1,20 @@
1
1
  import { j as t } from "./jsx-runtime-WbnYoNE9.js";
2
2
  import i, { Suspense as s } from "react";
3
3
  import { sortBy as a, filter as d, get as n } from "lodash-es";
4
- import { u as l, a as c } from "./index-ugsWasKp.js";
4
+ import { u as l, a as c } from "./index-lFcrvDFC.js";
5
5
  import "./_commonjsHelpers-UyOWmZb0.js";
6
- import "./index-eyVVbA05.js";
6
+ import "./index-yILWlilS.js";
7
7
  import "i18next";
8
8
  import "react-i18next";
9
- import "./index-MaXiXghQ.js";
9
+ import "./index-WP7IRkij.js";
10
10
  import "./Functions-7jnEwJyw.js";
11
11
  import "clsx";
12
12
  import "tailwind-merge";
13
13
  import "@chaibuilder/runtime";
14
14
  import "jotai";
15
- import "flat-to-nested";
16
15
  import "./MODIFIERS-WQdaNvb8.js";
17
16
  import "@react-hookz/web";
17
+ import "flat-to-nested";
18
18
  import "@radix-ui/react-toggle";
19
19
  import "class-variance-authority";
20
20
  import "./Class-3k8xjeiM.js";
@@ -40,6 +40,7 @@ import "@radix-ui/react-context-menu";
40
40
  import "react-icons-picker";
41
41
  import "react-dom";
42
42
  import "react-quill";
43
+ import "lodash";
43
44
  import "@floating-ui/react-dom";
44
45
  import "react-textarea-autosize";
45
46
  import "flagged";
@@ -51,7 +52,7 @@ import "./html-to-json-C5sExaSD.js";
51
52
  import "himalaya";
52
53
  import "lucide-react";
53
54
  import "./index-YpnaudSM.js";
54
- const x = i.lazy(() => import("./add-page-modal-AsP5g0Fp.js")), u = i.lazy(() => import("./page-viewer-P5Im9RfR.js")), ut = () => {
55
+ const x = i.lazy(() => import("./add-page-modal-dKQLw7RQ.js")), u = i.lazy(() => import("./page-viewer-3QXwPGpg.js")), gt = () => {
55
56
  const { data: o = [], isLoading: m } = l(), { data: r } = c(), p = a(d(o, { type: "STATIC" }), (e) => n(e, "uuid") === (r == null ? void 0 : r.homepage) ? 0 : 1);
56
57
  return /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
57
58
  /* @__PURE__ */ t.jsxs("div", { className: "flex items-center justify-between rounded-md bg-background/30 p-1", children: [
@@ -63,5 +64,5 @@ const x = i.lazy(() => import("./add-page-modal-AsP5g0Fp.js")), u = i.lazy(() =>
63
64
  ] });
64
65
  };
65
66
  export {
66
- ut as default
67
+ gt as default
67
68
  };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-Z_BpKhVy.cjs"),u=require("react"),i=require("lodash-es"),s=require("./index-BMZLAJUV.cjs");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("./index-JdnF6lYP.cjs");require("i18next");require("react-i18next");require("./index-thKfFhmr.cjs");require("./Functions-N3yhPYKY.cjs");require("clsx");require("tailwind-merge");require("@chaibuilder/runtime");require("jotai");require("./MODIFIERS-9EwxLM8V.cjs");require("@react-hookz/web");require("flat-to-nested");require("@radix-ui/react-toggle");require("class-variance-authority");require("./Class-MmCxz2Ay.cjs");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("lodash");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-FGufPv9R.cjs");require("himalaya");require("lucide-react");require("./index-ecnGWzh9.cjs");const a=u.lazy(()=>Promise.resolve().then(()=>require("./add-page-modal-xMedOdsp.cjs"))),x=u.lazy(()=>Promise.resolve().then(()=>require("./page-viewer-DTIblLiz.cjs"))),d=()=>{const{data:t=[],isLoading:q}=s.usePages(),{data:r}=s.useProject(),n=i.sortBy(i.filter(t,{type:"STATIC"}),o=>i.get(o,"uuid")===(r==null?void 0:r.homepage)?0:1);return e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsxs("div",{className:"flex items-center justify-between rounded-md bg-background/30 p-1",children:[e.jsxRuntimeExports.jsx("h1",{className:"px-1 font-semibold",children:"Pages"}),e.jsxRuntimeExports.jsx(u.Suspense,{fallback:e.jsxRuntimeExports.jsx("div",{className:"text-sm text-blue-500 underline",children:"+ New Page"}),children:e.jsxRuntimeExports.jsx(a,{})})]}),e.jsxRuntimeExports.jsx("hr",{className:"-mx-1"}),e.jsxRuntimeExports.jsx("div",{className:"-mx-1 divide-y-2",children:e.jsxRuntimeExports.jsx(x,{isLoading:q,pages:n})})]})};exports.default=d;
@@ -1,17 +1,17 @@
1
1
  import { j as t } from "./jsx-runtime-WbnYoNE9.js";
2
2
  import m, { useRef as x, useEffect as a, Suspense as p } from "react";
3
3
  import { isEqual as b, isEmpty as j } from "lodash-es";
4
- import { b9 as f, ba as n, bb as l, bc as c } from "./index-MaXiXghQ.js";
5
- import { b as h, a as g } from "./index-ugsWasKp.js";
4
+ import { b9 as f, ba as n, bb as l, bc as c } from "./index-WP7IRkij.js";
5
+ import { b as h, a as g } from "./index-lFcrvDFC.js";
6
6
  import "./_commonjsHelpers-UyOWmZb0.js";
7
7
  import "./Functions-7jnEwJyw.js";
8
8
  import "clsx";
9
9
  import "tailwind-merge";
10
10
  import "@chaibuilder/runtime";
11
11
  import "jotai";
12
- import "flat-to-nested";
13
12
  import "./MODIFIERS-WQdaNvb8.js";
14
13
  import "@react-hookz/web";
14
+ import "flat-to-nested";
15
15
  import "@radix-ui/react-toggle";
16
16
  import "class-variance-authority";
17
17
  import "./Class-3k8xjeiM.js";
@@ -37,8 +37,9 @@ import "@radix-ui/react-context-menu";
37
37
  import "react-icons-picker";
38
38
  import "react-dom";
39
39
  import "react-quill";
40
+ import "lodash";
40
41
  import "react-i18next";
41
- import "./index-eyVVbA05.js";
42
+ import "./index-yILWlilS.js";
42
43
  import "i18next";
43
44
  import "@floating-ui/react-dom";
44
45
  import "react-textarea-autosize";
@@ -51,11 +52,11 @@ import "./html-to-json-C5sExaSD.js";
51
52
  import "himalaya";
52
53
  import "lucide-react";
53
54
  import "./index-YpnaudSM.js";
54
- const N = m.lazy(() => import("./project-general-setting-R3pVVXmY.js")), S = m.lazy(() => import("./project-seo-setting-pGpm3-6U.js")), d = /* @__PURE__ */ t.jsx("div", { className: "px-3", children: /* @__PURE__ */ t.jsx("div", { className: "h-52 w-full animate-pulse rounded-md bg-gray-100" }) }), u = (r) => r && j(r.seoData) ? {
55
+ const N = m.lazy(() => import("./project-general-setting-UalRmyHm.js")), S = m.lazy(() => import("./project-seo-setting-8FsvPSPl.js")), d = /* @__PURE__ */ t.jsx("div", { className: "px-3", children: /* @__PURE__ */ t.jsx("div", { className: "h-52 w-full animate-pulse rounded-md bg-gray-100" }) }), u = (r) => r && j(r.seoData) ? {
55
56
  ...r,
56
57
  seoData: { title: "", description: "", image: "" }
57
58
  } : r;
58
- function St() {
59
+ function vt() {
59
60
  const r = h(), { data: s } = g(), [e, i] = m.useState(
60
61
  u(s || {})
61
62
  ), o = x(e);
@@ -84,5 +85,5 @@ function St() {
84
85
  ] });
85
86
  }
86
87
  export {
87
- St as default
88
+ vt as default
88
89
  };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-Z_BpKhVy.cjs"),r=require("react"),x=require("lodash-es"),s=require("./index-thKfFhmr.cjs"),a=require("./index-BMZLAJUV.cjs");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("./Functions-N3yhPYKY.cjs");require("clsx");require("tailwind-merge");require("@chaibuilder/runtime");require("jotai");require("./MODIFIERS-9EwxLM8V.cjs");require("@react-hookz/web");require("flat-to-nested");require("@radix-ui/react-toggle");require("class-variance-authority");require("./Class-MmCxz2Ay.cjs");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("lodash");require("react-i18next");require("./index-JdnF6lYP.cjs");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-FGufPv9R.cjs");require("himalaya");require("lucide-react");require("./index-ecnGWzh9.cjs");const d=r.lazy(()=>Promise.resolve().then(()=>require("./project-general-setting-g7WhM3hc.cjs"))),q=r.lazy(()=>Promise.resolve().then(()=>require("./project-seo-setting-xoeLQVj3.cjs"))),c=e.jsxRuntimeExports.jsx("div",{className:"px-3",children:e.jsxRuntimeExports.jsx("div",{className:"h-52 w-full animate-pulse rounded-md bg-gray-100"})}),l=t=>t&&x.isEmpty(t.seoData)?{...t,seoData:{title:"",description:"",image:""}}:t;function m(){const t=a.useUpdateProject(),{data:n}=a.useProject(),[i,o]=r.useState(l(n||{})),u=r.useRef(i);return r.useEffect(()=>()=>{x.isEqual(n,u.current)||t.mutate(u.current,{onSuccess:()=>o(u.current)})},[u]),r.useEffect(()=>{u.current=i},[i]),e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx("div",{className:"flex items-center justify-between rounded-md bg-background/30 p-1",children:e.jsxRuntimeExports.jsx("h1",{className:"px-1 font-semibold",children:"Website Settings"})}),e.jsxRuntimeExports.jsx("hr",{className:"-mx-1"}),e.jsxRuntimeExports.jsx("div",{className:"-mx-1",children:e.jsxRuntimeExports.jsxs(s.Accordion,{type:"single",className:"w-full",defaultValue:"GENERAL",children:[e.jsxRuntimeExports.jsxs(s.AccordionItem,{value:"GENERAL",className:"border-b-2 border-slate-100 dark:border-slate-800",children:[e.jsxRuntimeExports.jsx(s.AccordionTrigger,{className:"bg-slate-200 px-2.5 py-1.5 font-medium hover:bg-slate-100 hover:no-underline dark:bg-slate-900 dark:hover:bg-slate-800",children:"General Settings"}),e.jsxRuntimeExports.jsx(s.AccordionContent,{className:"px-2 pt-4 text-sm",children:e.jsxRuntimeExports.jsx(r.Suspense,{fallback:c,children:e.jsxRuntimeExports.jsx(d,{_projectData:i,seany:o})})})]}),e.jsxRuntimeExports.jsxs(s.AccordionItem,{value:"SEO",className:"border-b-2 border-slate-100 dark:border-slate-800",children:[e.jsxRuntimeExports.jsx(s.AccordionTrigger,{className:"bg-slate-200 px-2.5 py-1.5 font-medium hover:bg-slate-100 hover:no-underline dark:bg-slate-900 dark:hover:bg-slate-800",children:"SEO Settings"}),e.jsxRuntimeExports.jsx(s.AccordionContent,{className:"px-1 pt-4 text-sm",children:e.jsxRuntimeExports.jsx(r.Suspense,{fallback:c,children:e.jsxRuntimeExports.jsx(q,{_projectData:i,seany:o})})})]})]})})]})}exports.default=m;