@chaibuilder/sdk 1.2.9 → 1.2.11

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 (102) hide show
  1. package/README.md +10 -12
  2. package/dist/AddBlocks-TSt8uJY4.js +218 -0
  3. package/dist/AddBlocks-k2p8Hy1n.cjs +1 -0
  4. package/dist/BrandingOptions-WyVWfFVz.cjs +1 -0
  5. package/dist/{BrandingOptions-QJJ1y5ez.js → BrandingOptions-uFTyYJZj.js} +18 -22
  6. package/dist/CanvasArea-5erOZYLy.cjs +60 -0
  7. package/dist/{CanvasArea-mlNKmCOh.js → CanvasArea-iRQqpOak.js} +465 -481
  8. package/dist/{utils-AvyFzbPC.js → Class-17XFhL48.js} +15 -16
  9. package/dist/Class-5ARpH_Tu.cjs +1 -0
  10. package/dist/CurrentPage-NzmJloN7.cjs +1 -0
  11. package/dist/{CurrentPage-lBy25sZn.js → CurrentPage-RCxTz9Mc.js} +24 -26
  12. package/dist/{Layers-3Xs4A5i8.js → Layers-tXB5Pwid.js} +124 -158
  13. package/dist/Layers-xDG7oltg.cjs +1 -0
  14. package/dist/PagesPanel-72nzYB1k.cjs +1 -0
  15. package/dist/{PagesPanel--BZhafnt.js → PagesPanel-Jaz9jvye.js} +14 -16
  16. package/dist/{ProjectPanel-YcLkM-DW.js → ProjectPanel--S014Xx3.js} +22 -24
  17. package/dist/ProjectPanel-RU0QvH6e.cjs +1 -0
  18. package/dist/Settings-5EuwaVb3.cjs +1 -0
  19. package/dist/{Settings-TAgX4hov.js → Settings-gjvl5V1k.js} +556 -579
  20. package/dist/{SidePanels-btVQQkVK.js → SidePanels-Fq3kRwR0.js} +54 -51
  21. package/dist/SidePanels-uNCxnGte.cjs +1 -0
  22. package/dist/Topbar-JqW89xI5.cjs +1 -0
  23. package/dist/{Topbar-j4t4AgCq.js → Topbar-m5dbbI1f.js} +15 -17
  24. package/dist/{UnsplashImages-41Y3q5_Q.js → UnsplashImages-GhBD6owT.js} +24 -26
  25. package/dist/UnsplashImages-vACw5hbK.cjs +1 -0
  26. package/dist/UploadImages-PzHdEKHT.cjs +1 -0
  27. package/dist/{UploadImages-xBg-kbKv.js → UploadImages-S1HgxeGb.js} +23 -25
  28. package/dist/{add-page-modal-cm8damU2.js → add-page-modal-2P5hGXOQ.js} +15 -17
  29. package/dist/add-page-modal-GAizM2Jw.cjs +1 -0
  30. package/dist/{confirm-alert-i4pM3mOt.js → confirm-alert-57Xq5foA.js} +12 -14
  31. package/dist/confirm-alert-Uf84DpdR.cjs +1 -0
  32. package/dist/core.cjs +1 -1
  33. package/dist/core.d.ts +13 -58
  34. package/dist/core.js +47 -58
  35. package/dist/defaultTheme-IH19g4fv.cjs +1 -0
  36. package/dist/defaultTheme-YY8mlQS3.js +1055 -0
  37. package/dist/delete-page-modal-MG42FdnU.cjs +1 -0
  38. package/dist/{delete-page-modal-YrIBvfFA.js → delete-page-modal-ix5IjaFW.js} +27 -29
  39. package/dist/email-blocks.cjs +1 -1
  40. package/dist/email-blocks.js +100 -81
  41. package/dist/email.cjs +1 -0
  42. package/dist/email.d.ts +116 -0
  43. package/dist/email.js +79 -0
  44. package/dist/{controls-XPXGHKht.js → empty-slot-MWycClTb.js} +61 -50
  45. package/dist/empty-slot-TF2kd-0X.cjs +1 -0
  46. package/dist/{form-VbouZlAW.cjs → form-KBb3kA8g.cjs} +1 -1
  47. package/dist/{form-OVmsLOrc.js → form-SYcFyACJ.js} +18 -18
  48. package/dist/{index-pZhGT8uT.js → index-Fj3ead-J.js} +4886 -4884
  49. package/dist/index-aiHDvS5v.cjs +1 -0
  50. package/dist/{index-N50dZnlC.cjs → index-cM3eKmlx.cjs} +25 -25
  51. package/dist/index-pNYv0oAF.js +2994 -0
  52. package/dist/lib.cjs +3 -3
  53. package/dist/lib.js +95 -1125
  54. package/dist/page-viewer-Sh99FGYk.cjs +1 -0
  55. package/dist/{page-viewer-feqJr1QI.js → page-viewer-VxqOevr4.js} +15 -17
  56. package/dist/project-general-setting-VTLHa-Ik.cjs +1 -0
  57. package/dist/{project-general-setting-SgagORzW.js → project-general-setting-nWOjPiin.js} +15 -17
  58. package/dist/{project-seo-setting-wxAGEkd_.js → project-seo-setting-70bWTwsB.js} +17 -19
  59. package/dist/project-seo-setting-ENAKc2Dl.cjs +1 -0
  60. package/dist/render.cjs +1 -1
  61. package/dist/render.d.ts +2 -0
  62. package/dist/render.js +111 -70
  63. package/dist/{single-page-detail-dnWMyg6P.js → single-page-detail-3z7TF-Yy.js} +44 -46
  64. package/dist/single-page-detail-6L38HJC4.cjs +1 -0
  65. package/dist/studio.cjs +1 -1
  66. package/dist/studio.js +13 -15
  67. package/dist/ui.cjs +1 -1
  68. package/dist/ui.d.ts +4 -4
  69. package/dist/ui.js +149 -151
  70. package/dist/{useAddBlockByDrop-inkD7Lck.cjs → useAddBlockByDrop-7mUMwNSG.cjs} +1 -1
  71. package/dist/{useAddBlockByDrop-_nwI4W3q.js → useAddBlockByDrop-tjQ5DgiO.js} +1 -1
  72. package/dist/web-blocks.cjs +1 -9
  73. package/dist/web-blocks.js +431 -442
  74. package/package.json +8 -2
  75. package/dist/AddBlocks-tMxKPoen.js +0 -225
  76. package/dist/AddBlocks-x2LkOHSj.cjs +0 -1
  77. package/dist/BrandingOptions-EzT9UYd6.cjs +0 -1
  78. package/dist/CanvasArea-xs4wM64L.cjs +0 -60
  79. package/dist/CurrentPage-aaU4F7wi.cjs +0 -1
  80. package/dist/Layers-eaHy5PK9.cjs +0 -1
  81. package/dist/MarkAsGlobalBlock-BjP-Rqlf.js +0 -88
  82. package/dist/MarkAsGlobalBlock-X5dNmZcb.cjs +0 -1
  83. package/dist/PagesPanel-gGKCV394.cjs +0 -1
  84. package/dist/ProjectPanel-yFJRy0_E.cjs +0 -1
  85. package/dist/Settings-7wlLcvoh.cjs +0 -1
  86. package/dist/SidePanels-5H4j0mIs.cjs +0 -1
  87. package/dist/Topbar-V8xCetWF.cjs +0 -1
  88. package/dist/UnsplashImages-DbHky6cj.cjs +0 -1
  89. package/dist/UploadImages-DnQ95_NW.cjs +0 -1
  90. package/dist/add-page-modal-MwS7iXn_.cjs +0 -1
  91. package/dist/confirm-alert-U7-NcG7G.cjs +0 -1
  92. package/dist/controls-Dy1qa8Dc.cjs +0 -1
  93. package/dist/delete-page-modal-5o4jXu-z.cjs +0 -1
  94. package/dist/functions-Ox_svtKm.cjs +0 -1
  95. package/dist/functions-xIebp8Aw.js +0 -23
  96. package/dist/index-H6vIwGfD.cjs +0 -1
  97. package/dist/index-niHREMmR.js +0 -2938
  98. package/dist/page-viewer-SLt8XgYv.cjs +0 -1
  99. package/dist/project-general-setting-ym0yCdOq.cjs +0 -1
  100. package/dist/project-seo-setting-Snn2nZgS.cjs +0 -1
  101. package/dist/single-page-detail-IPod1o5P.cjs +0 -1
  102. package/dist/utils-PTxFk6qT.cjs +0 -1
@@ -1,20 +1,24 @@
1
1
  import { j as e } from "./jsx-runtime-WbnYoNE9.js";
2
- import { nth as C, startsWith as P, map as S, includes as T, isUndefined as L, find as z, isEmpty as V } from "lodash-es";
3
- import { BoxModelIcon as F, BoxIcon as D, DragHandleHorizontalIcon as $, ViewHorizontalIcon as G, BorderAllIcon as K, BorderTopIcon as Q, TableIcon as U, DropdownMenuIcon as Y, RadiobuttonIcon as q, InputIcon as W, ButtonIcon as B, CheckboxIcon as J, GroupIcon as X, SpaceBetweenVerticallyIcon as Z, ColumnsIcon as ee, RowsIcon as v, TextIcon as w, SketchLogoIcon as te, DividerHorizontalIcon as se, CodeIcon as oe, CursorTextIcon as ne, VideoIcon as re, Link1Icon as ae, HeadingIcon as ce, ImageIcon as le, TriangleRightIcon as ie, ScissorsIcon as xe, ClipboardIcon as de, TrashIcon as me, GlobeIcon as pe, CopyIcon as ue, ClipboardCopyIcon as ge, DoubleArrowDownIcon as je, StackIcon as he } from "@radix-ui/react-icons";
4
- import { useDrop as be, useDragLayer as fe } from "react-dnd";
5
- import { useDragOver as Ie, Tree as ke } from "@minoru/react-dnd-treeview";
6
- import { useTranslation as ye } from "react-i18next";
7
- import { $ as Ce, _ as Be, j as x, n as ve, bx as i, k as we, l as Se, a7 as Te, m as De, o as Ne, i as Me, by as Oe, al as Re, am as _e, bz as Ee, bA as Ae, y as N, af as He, w as Pe, ak as Le, p as ze, bn as Ve, bB as Fe } from "./index-niHREMmR.js";
8
- import { DatabaseIcon as $e } from "lucide-react";
9
- import { useMemo as Ge, lazy as Ke, useCallback as Qe, useState as Ue, Suspense as Ye } from "react";
10
- import { a as qe } from "./MODIFIERS-RiXS5Mn1.js";
11
- import { c as k } from "./Functions-7jnEwJyw.js";
12
- import { f as We } from "./index-pZhGT8uT.js";
13
- import { u as Je } from "./useAddBlockByDrop-_nwI4W3q.js";
2
+ import { nth as k, startsWith as L, map as C, includes as T, isUndefined as P, find as V, isEmpty as F } from "lodash-es";
3
+ import { BoxModelIcon as $, BoxIcon as D, DragHandleHorizontalIcon as z, ViewHorizontalIcon as K, BorderAllIcon as U, BorderTopIcon as q, TableIcon as Q, DropdownMenuIcon as W, RadiobuttonIcon as Y, InputIcon as G, ButtonIcon as B, CheckboxIcon as J, GroupIcon as X, SpaceBetweenVerticallyIcon as Z, ColumnsIcon as ee, RowsIcon as v, TextIcon as w, SketchLogoIcon as te, DividerHorizontalIcon as se, CodeIcon as oe, CursorTextIcon as ne, VideoIcon as re, Link1Icon as ae, HeadingIcon as ce, ImageIcon as ie, TriangleRightIcon as le, TrashIcon as xe, CopyIcon as de, DoubleArrowDownIcon as me, StackIcon as pe } from "@radix-ui/react-icons";
4
+ import { useDrop as ue, useDragLayer as ge } from "react-dnd";
5
+ import { useDragOver as je, Tree as he } from "@minoru/react-dnd-treeview";
6
+ import { useTranslation as be } from "react-i18next";
7
+ import { W as fe, V as Ie, j as p, k as ye, $ as S, bo as N, aP as ke, l as Be, bp as ve, aO as we, bq as Ce, br as Te, bs as O, s as De, aJ as Se, ab as Ne, be as Oe, bt as Re } from "./index-pNYv0oAF.js";
8
+ import { DatabaseIcon as _e } from "lucide-react";
9
+ import { useMemo as Ee, useCallback as Me } from "react";
10
+ import { a as He } from "./MODIFIERS-RiXS5Mn1.js";
11
+ import { c as I } from "./Functions-7jnEwJyw.js";
12
+ import { f as Ae } from "./index-Fj3ead-J.js";
13
+ import { u as Le } from "./useAddBlockByDrop-tjQ5DgiO.js";
14
14
  import "./_commonjsHelpers-UyOWmZb0.js";
15
+ import "@chaibuilder/runtime";
16
+ import "jotai";
17
+ import "flat-to-nested";
18
+ import "@react-hookz/web";
15
19
  import "@radix-ui/react-toggle";
16
20
  import "class-variance-authority";
17
- import "./utils-AvyFzbPC.js";
21
+ import "./Class-17XFhL48.js";
18
22
  import "clsx";
19
23
  import "tailwind-merge";
20
24
  import "@radix-ui/react-switch";
@@ -38,12 +42,6 @@ import "@radix-ui/react-context-menu";
38
42
  import "react-icons-picker";
39
43
  import "react-dom";
40
44
  import "react-quill";
41
- import "jotai";
42
- import "flat-to-nested";
43
- import "redux-undo";
44
- import "@chaibuilder/runtime";
45
- import "lodash";
46
- import "@react-hookz/web";
47
45
  import "i18next";
48
46
  import "@floating-ui/react-dom";
49
47
  import "react-textarea-autosize";
@@ -53,11 +51,11 @@ import "sonner";
53
51
  import "./html-to-json-57841sEK.js";
54
52
  import "himalaya";
55
53
  import "./web-blocks.js";
56
- import "./controls-XPXGHKht.js";
57
- const M = (t) => {
54
+ import "./empty-slot-MWycClTb.js";
55
+ const R = (t) => {
58
56
  switch (t.type) {
59
57
  case "Image":
60
- return /* @__PURE__ */ e.jsx(le, {});
58
+ return /* @__PURE__ */ e.jsx(ie, {});
61
59
  case "Heading":
62
60
  return /* @__PURE__ */ e.jsx(ce, {});
63
61
  case "Text":
@@ -94,30 +92,30 @@ const M = (t) => {
94
92
  return /* @__PURE__ */ e.jsx(B, {});
95
93
  case "Input":
96
94
  case "TextArea":
97
- return /* @__PURE__ */ e.jsx(W, {});
95
+ return /* @__PURE__ */ e.jsx(G, {});
98
96
  case "Radio":
99
- return /* @__PURE__ */ e.jsx(q, {});
100
- case "Select":
101
97
  return /* @__PURE__ */ e.jsx(Y, {});
98
+ case "Select":
99
+ return /* @__PURE__ */ e.jsx(W, {});
102
100
  case "Table":
103
- return /* @__PURE__ */ e.jsx(U, {});
104
- case "TableHead":
105
101
  return /* @__PURE__ */ e.jsx(Q, {});
102
+ case "TableHead":
103
+ return /* @__PURE__ */ e.jsx(q, {});
106
104
  case "TableBody":
107
- return /* @__PURE__ */ e.jsx(K, {});
105
+ return /* @__PURE__ */ e.jsx(U, {});
108
106
  case "TableRow":
109
- return /* @__PURE__ */ e.jsx(G, {});
107
+ return /* @__PURE__ */ e.jsx(K, {});
110
108
  case "TableCell":
111
- return /* @__PURE__ */ e.jsx($, {});
109
+ return /* @__PURE__ */ e.jsx(z, {});
112
110
  case "DataProvider":
113
- return /* @__PURE__ */ e.jsx($e, { size: 16 });
111
+ return /* @__PURE__ */ e.jsx(_e, { size: 16 });
114
112
  case "Box":
115
113
  return /* @__PURE__ */ e.jsx(D, {});
116
114
  default:
117
- return /* @__PURE__ */ e.jsx(F, {});
115
+ return /* @__PURE__ */ e.jsx($, {});
118
116
  }
119
117
  };
120
- function Xe(t = "") {
118
+ function Pe(t = "") {
121
119
  const s = {
122
120
  xs: "390px",
123
121
  sm: "640px",
@@ -135,23 +133,23 @@ function Xe(t = "") {
135
133
  // checks if any of the display property is set for any higher media query
136
134
  /\b(sm|md|lg|xl|2xl):(block|grid|flex|inline|inline-grid|inline-flex|inline-block)\b/
137
135
  ), c = t.match(a);
138
- if (C(c, 1))
139
- return `Visible >=${s[C(c, 1)]}`;
136
+ if (k(c, 1))
137
+ return `Visible >=${s[k(c, 1)]}`;
140
138
  }
141
139
  return "";
142
140
  }
143
- const Ze = (t) => {
141
+ const Ve = (t) => {
144
142
  let s = "";
145
143
  return Object.keys(t).forEach((o) => {
146
- P(t[o], qe) && (s = t[o]);
144
+ L(t[o], He) && (s = t[o]);
147
145
  }), s;
148
- }, et = (t) => {
149
- var g;
150
- const [, s] = Ce(), [o] = Be(), { isSelected: r } = t, { id: a, data: c } = t.node, d = t.depth * 10, m = (l) => {
151
- l.stopPropagation(), t.onToggle(t.node.id);
152
- }, j = Ie(a, t.isOpen, t.onToggle), p = Ge(() => {
153
- const l = Ze(t.node.data);
154
- return Xe(l);
146
+ }, Fe = (t) => {
147
+ var m;
148
+ const [, s] = fe(), [o] = Ie(), { isSelected: r } = t, { id: a, data: c } = t.node, u = t.depth * 10, g = (i) => {
149
+ i.stopPropagation(), t.onToggle(t.node.id);
150
+ }, x = je(a, t.isOpen, t.onToggle), d = Ee(() => {
151
+ const i = Ve(t.node.data);
152
+ return Pe(i);
155
153
  }, [t.node.data]);
156
154
  return (
157
155
  // eslint-disable-next-line jsx-a11y/click-events-have-key-events,jsx-a11y/no-static-element-interactions
@@ -159,34 +157,34 @@ const Ze = (t) => {
159
157
  "div",
160
158
  {
161
159
  onMouseEnter: () => s(a),
162
- className: k(
160
+ className: I(
163
161
  "group flex w-full items-center justify-between space-x-px py-px",
164
- r ? "bg-blue-500 text-white" : "hover:bg-gray-200 dark:hover:bg-gray-800"
162
+ r ? "bg-blue-500 text-white" : "text-gray-600 hover:bg-gray-200 dark:hover:bg-gray-800"
165
163
  ),
166
- onClick: (l) => {
167
- l.stopPropagation(), !o.includes(a) && t.onSelect(a);
164
+ onClick: (i) => {
165
+ i.stopPropagation(), !o.includes(a) && t.onSelect(a);
168
166
  },
169
167
  onContextMenu: () => t.onSelect(a),
170
- style: { paddingInlineStart: d },
171
- ...j,
168
+ style: { paddingInlineStart: u },
169
+ ...x,
172
170
  children: /* @__PURE__ */ e.jsxs("div", { className: "flex items-center", children: [
173
171
  /* @__PURE__ */ e.jsx(
174
172
  "div",
175
173
  {
176
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" : ""}`,
177
- children: t.node.droppable && /* @__PURE__ */ e.jsx("button", { onClick: m, type: "button", children: /* @__PURE__ */ e.jsx(ie, {}) })
175
+ children: t.node.droppable && /* @__PURE__ */ e.jsx("button", { onClick: g, type: "button", children: /* @__PURE__ */ e.jsx(le, {}) })
178
176
  }
179
177
  ),
180
178
  /* @__PURE__ */ e.jsxs("button", { type: "button", className: "flex items-center", children: [
181
- /* @__PURE__ */ e.jsx("div", { className: "-mt-1 h-3 w-3", children: /* @__PURE__ */ e.jsx(M, { type: c == null ? void 0 : c._type }) }),
182
- /* @__PURE__ */ e.jsx("div", { className: "ml-2 truncate text-[11px]", children: ((g = t.node.data) == null ? void 0 : g._name) || t.node.text }),
183
- p ? /* @__PURE__ */ e.jsxs(
179
+ /* @__PURE__ */ e.jsx("div", { className: "-mt-1 h-3 w-3", children: /* @__PURE__ */ e.jsx(R, { type: c == null ? void 0 : c._type }) }),
180
+ /* @__PURE__ */ e.jsx("div", { className: "ml-2 truncate text-[11px]", children: ((m = t.node.data) == null ? void 0 : m._name) || t.node.text }),
181
+ d ? /* @__PURE__ */ e.jsxs(
184
182
  "span",
185
183
  {
186
184
  className: "ml-2 flex items-center text-[10px] italic " + (r ? "text-gray-200" : "text-gray-500"),
187
185
  children: [
188
186
  "(",
189
- p,
187
+ d,
190
188
  ")"
191
189
  ]
192
190
  }
@@ -196,86 +194,55 @@ const Ze = (t) => {
196
194
  }
197
195
  )
198
196
  );
199
- }, tt = (t) => {
197
+ }, $e = (t) => {
200
198
  var o;
201
199
  const { item: s } = t.monitorProps;
202
200
  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: [
203
- /* @__PURE__ */ e.jsx("div", { className: "", children: /* @__PURE__ */ e.jsx(M, { type: (o = s == null ? void 0 : s.data) == null ? void 0 : o._type }) }),
201
+ /* @__PURE__ */ e.jsx("div", { className: "", children: /* @__PURE__ */ e.jsx(R, { type: (o = s == null ? void 0 : s.data) == null ? void 0 : o._type }) }),
204
202
  /* @__PURE__ */ e.jsx("div", { className: "ml-2 truncate text-[11px]", children: s.text })
205
203
  ] });
206
- }, st = (t) => {
204
+ }, ze = (t) => {
207
205
  const s = t.depth * 10 + 16;
208
206
  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 } });
209
- }, ot = Ke(() => import("./MarkAsGlobalBlock-BjP-Rqlf.js")), nt = () => {
210
- const [t] = x(), [, s] = ve();
211
- return /* @__PURE__ */ e.jsxs(i, { className: "flex items-center gap-x-4 text-xs", onClick: () => s(t), children: [
212
- /* @__PURE__ */ e.jsx(xe, {}),
213
- " Cut"
214
- ] });
215
- }, rt = () => {
216
- const [t] = x(), [, s] = we();
217
- return /* @__PURE__ */ e.jsxs(i, { className: "flex items-center gap-x-4 text-xs", onClick: () => s(t), children: [
218
- /* @__PURE__ */ e.jsx(de, {}),
219
- " Copy"
220
- ] });
221
- }, at = () => {
222
- const [t] = x(), s = Se(), o = Te();
207
+ }, Ke = () => {
208
+ const [t] = p(), s = ye(), o = S();
223
209
  return /* @__PURE__ */ e.jsxs(
224
- i,
210
+ N,
225
211
  {
226
- disabled: (o == null ? void 0 : o._type) === "Slot",
212
+ disabled: !ke(o == null ? void 0 : o._type),
227
213
  className: "flex items-center gap-x-4 text-xs",
228
214
  onClick: () => s(t),
229
215
  children: [
230
- /* @__PURE__ */ e.jsx(me, {}),
216
+ /* @__PURE__ */ e.jsx(xe, {}),
231
217
  " Remove"
232
218
  ]
233
219
  }
234
220
  );
235
- }, ct = ({
236
- id: t = null,
237
- openMarkAsGlobalModal: s
238
- }) => {
239
- const [o] = x(), r = De(), { pasteBlocks: a, canPaste: c } = Ne(), d = Me("globalBlocksSupport", !1), m = Qe(() => {
240
- r(o);
241
- }, [o, r]);
242
- return /* @__PURE__ */ e.jsxs(Oe, { className: "text-xs", children: [
243
- d && /* @__PURE__ */ e.jsx(i, { className: "flex items-center gap-x-4 border-b text-xs", onClick: s, children: /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-x-4", children: [
244
- /* @__PURE__ */ e.jsx(pe, {}),
245
- " Mark as global"
246
- ] }) }),
247
- /* @__PURE__ */ e.jsxs(i, { className: "flex items-center gap-x-4 text-xs", onClick: m, children: [
248
- /* @__PURE__ */ e.jsx(ue, {}),
249
- " Duplicate"
250
- ] }),
251
- /* @__PURE__ */ e.jsx(nt, {}),
252
- /* @__PURE__ */ e.jsx(rt, {}),
221
+ }, Ue = () => {
222
+ const [t] = p(), s = Be(), o = S(), r = Me(() => {
223
+ s(t);
224
+ }, [t, s]);
225
+ return /* @__PURE__ */ e.jsxs(ve, { className: "text-xs", children: [
253
226
  /* @__PURE__ */ e.jsxs(
254
- i,
227
+ N,
255
228
  {
229
+ disabled: !we(o == null ? void 0 : o._type),
256
230
  className: "flex items-center gap-x-4 text-xs",
257
- onClick: () => a(t),
258
- disabled: !c,
231
+ onClick: r,
259
232
  children: [
260
- /* @__PURE__ */ e.jsx(ge, {}),
261
- " Paste"
233
+ /* @__PURE__ */ e.jsx(de, {}),
234
+ " Duplicate"
262
235
  ]
263
236
  }
264
237
  ),
265
- /* @__PURE__ */ e.jsx(at, {})
266
- ] });
267
- }, lt = ({ children: t, id: s = null }) => {
268
- const [o, r] = Ue(!1);
269
- return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
270
- /* @__PURE__ */ e.jsx(Re, { open: o, onOpenChange: r, children: o && /* @__PURE__ */ e.jsx(_e, { children: /* @__PURE__ */ e.jsx(Ye, { fallback: /* @__PURE__ */ e.jsx("div", { className: "h-96 w-full animate-pulse bg-gray-200" }), children: /* @__PURE__ */ e.jsx(ot, { closeModal: () => r(!1), id: s }) }) }) }),
271
- /* @__PURE__ */ e.jsxs(Ee, { children: [
272
- /* @__PURE__ */ e.jsx(Ae, { children: t }),
273
- /* @__PURE__ */ e.jsx(ct, { id: s, openMarkAsGlobalModal: () => r(!0) })
274
- ] })
238
+ /* @__PURE__ */ e.jsx(Ke, {})
275
239
  ] });
276
- };
277
- function it(t) {
278
- return S(t, (s) => {
240
+ }, qe = ({ children: t }) => /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsxs(Ce, { children: [
241
+ /* @__PURE__ */ e.jsx(Te, { children: t }),
242
+ /* @__PURE__ */ e.jsx(Ue, {})
243
+ ] }) });
244
+ function Qe(t) {
245
+ return C(t, (s) => {
279
246
  const { data: o } = s;
280
247
  return {
281
248
  ...o,
@@ -283,15 +250,15 @@ function it(t) {
283
250
  };
284
251
  });
285
252
  }
286
- function xt() {
287
- const [t] = N(), [s, o] = x();
288
- return t ? (console.log("container", t), /* @__PURE__ */ e.jsxs(
253
+ function We() {
254
+ const [t] = O(), [s, o] = p();
255
+ return t ? /* @__PURE__ */ e.jsxs(
289
256
  "div",
290
257
  {
291
258
  onClick: (r) => {
292
259
  r.stopPropagation(), o(["container"]);
293
260
  },
294
- className: k(
261
+ className: I(
295
262
  "flex items-center pl-2 text-xs",
296
263
  T(s, "container") ? "bg-blue-500 text-white" : "hover:bg-gray-200 dark:hover:bg-gray-800"
297
264
  ),
@@ -301,98 +268,97 @@ function xt() {
301
268
  t._type
302
269
  ]
303
270
  }
304
- )) : null;
271
+ ) : null;
305
272
  }
306
- const ps = () => {
307
- const t = He(), [s] = Pe(), [o, r, a] = x(), [, c] = Le(), { t: d } = ye(), { createSnapshot: m } = ze(), j = We(), p = Je(), [g] = N(), l = async (n, u) => {
308
- const { dragSource: b, relativeIndex: f, dropTargetId: I, monitor: y } = u;
309
- if (b) {
310
- m();
311
- const A = it(n);
312
- s(A);
313
- const H = y.getItem();
314
- r([H.id]);
273
+ const Yt = () => {
274
+ const [t] = De(), { setNewBlocks: s } = Se(), [o, r, a] = p(), [, c] = Ne(), { t: u } = be(), g = Ae(), x = Le(), [d] = O(), m = async (n, l) => {
275
+ const { dragSource: h, relativeIndex: b, dropTargetId: f, monitor: y } = l;
276
+ if (h) {
277
+ const H = Qe(n);
278
+ s(H);
279
+ const A = y.getItem();
280
+ r([A.id]);
315
281
  } else
316
- await p({ block: y.getItem(), dropTargetId: I, relativeIndex: f });
317
- }, O = S(t, (n) => ({
282
+ await x({ block: y.getItem(), dropTargetId: f, relativeIndex: b });
283
+ }, i = C(t, (n) => ({
318
284
  id: n._id,
319
285
  text: n._type,
320
286
  parent: n._parent || 0,
321
- droppable: !L(z(t, { _parent: n._id })),
287
+ droppable: !P(V(t, { _parent: n._id })),
322
288
  data: n
323
- })), R = () => {
289
+ })), _ = () => {
324
290
  r([]), c([]);
325
- }, [{ isOver: h }, _] = be(() => ({
291
+ }, [{ isOver: j }, E] = ue(() => ({
326
292
  accept: ["CHAI_BLOCK"],
327
293
  collect: (n) => ({
328
294
  canDrop: n.canDrop(),
329
295
  isOver: n.isOver()
330
296
  }),
331
297
  drop: (n) => {
332
- (async () => await p({
298
+ (async () => await x({
333
299
  block: n,
334
300
  dropTargetId: "",
335
301
  relativeIndex: 0
336
302
  }))();
337
303
  }
338
- })), { isDragging: E } = fe((n) => ({
304
+ })), { isDragging: M } = ge((n) => ({
339
305
  isDragging: n.isDragging()
340
306
  }));
341
307
  return /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsx(
342
308
  "div",
343
309
  {
344
- onClick: () => R(),
345
- className: k(
310
+ onClick: () => _(),
311
+ className: I(
346
312
  "-mx-1 -mt-1 flex h-full select-none flex-col space-y-1",
347
- E ? "bg-green-50/80" : "bg-background"
313
+ M ? "bg-green-50/80" : "bg-background"
348
314
  ),
349
- children: V(t) ? /* @__PURE__ */ e.jsxs(
315
+ children: F(t) ? /* @__PURE__ */ e.jsxs(
350
316
  "div",
351
317
  {
352
- ref: _,
353
- className: `mx-1 mt-4 h-full max-w-full p-6 text-center text-sm text-gray-400 ${h ? "bg-blue-200" : ""}`,
318
+ ref: E,
319
+ className: `mx-1 mt-4 h-full max-w-full p-6 text-center text-sm text-gray-400 ${j ? "bg-blue-200" : ""}`,
354
320
  children: [
355
- h ? /* @__PURE__ */ e.jsx(je, { className: "mx-auto h-12 w-12 animate-bounce" }) : /* @__PURE__ */ e.jsx(he, { className: "mx-auto h-10 w-10" }),
356
- /* @__PURE__ */ e.jsx("p", { className: "mt-2", children: d(h ? "drop_here_message" : "tree_view_no_blocks") })
321
+ j ? /* @__PURE__ */ e.jsx(me, { className: "mx-auto h-12 w-12 animate-bounce" }) : /* @__PURE__ */ e.jsx(pe, { className: "mx-auto h-10 w-10" }),
322
+ /* @__PURE__ */ e.jsx("p", { className: "mt-2", children: u(j ? "drop_here_message" : "tree_view_no_blocks") })
357
323
  ]
358
324
  }
359
- ) : /* @__PURE__ */ e.jsxs(Ve, { id: "layers-view", className: "no-scrollbar h-full overflow-y-auto p-1", children: [
360
- /* @__PURE__ */ e.jsx(xt, {}),
325
+ ) : /* @__PURE__ */ e.jsxs(Oe, { id: "layers-view", className: "no-scrollbar h-full overflow-y-auto p-1", children: [
326
+ /* @__PURE__ */ e.jsx(We, {}),
361
327
  /* @__PURE__ */ e.jsx(
362
- ke,
328
+ he,
363
329
  {
364
- initialOpen: j,
330
+ initialOpen: g,
365
331
  extraAcceptTypes: ["CHAI_BLOCK"],
366
- tree: O,
332
+ tree: i,
367
333
  rootId: 0,
368
- render: (n, { depth: u, isOpen: b, onToggle: f }) => /* @__PURE__ */ e.jsx(lt, { id: n.id, children: /* @__PURE__ */ e.jsx(
369
- et,
334
+ render: (n, { depth: l, isOpen: h, onToggle: b }) => /* @__PURE__ */ e.jsx(qe, { id: n.id, children: /* @__PURE__ */ e.jsx(
335
+ Fe,
370
336
  {
371
- onSelect: (I) => {
372
- c([]), r([I]);
337
+ onSelect: (f) => {
338
+ c([]), r([f]);
373
339
  },
374
340
  isSelected: T(o, n.id),
375
341
  node: n,
376
- depth: u,
377
- isOpen: b,
378
- onToggle: f,
342
+ depth: l,
343
+ isOpen: h,
344
+ onToggle: b,
379
345
  toggleIds: a
380
346
  }
381
347
  ) }),
382
- dragPreviewRender: (n) => /* @__PURE__ */ e.jsx(tt, { monitorProps: n }),
383
- onDrop: l,
348
+ dragPreviewRender: (n) => /* @__PURE__ */ e.jsx($e, { monitorProps: n }),
349
+ onDrop: m,
384
350
  classes: {
385
- root: "h-[90%] " + (g ? "pl-2" : "pt-2"),
351
+ root: "h-[90%] " + (d ? "pl-2" : "pt-2"),
386
352
  draggingSource: "opacity-30",
387
353
  dropTarget: "bg-green-100",
388
354
  placeholder: "relative"
389
355
  },
390
356
  sort: !1,
391
357
  insertDroppableFirst: !1,
392
- canDrop: Fe,
358
+ canDrop: Re,
393
359
  dropTargetOffset: 2,
394
360
  enableAnimateExpand: !0,
395
- placeholderRender: (n, { depth: u }) => /* @__PURE__ */ e.jsx(st, { node: n, depth: u })
361
+ placeholderRender: (n, { depth: l }) => /* @__PURE__ */ e.jsx(ze, { node: n, depth: l })
396
362
  }
397
363
  )
398
364
  ] })
@@ -400,5 +366,5 @@ const ps = () => {
400
366
  ) });
401
367
  };
402
368
  export {
403
- ps as default
369
+ Yt as default
404
370
  };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-Z_BpKhVy.cjs"),x=require("lodash-es"),s=require("@radix-ui/react-icons"),y=require("react-dnd"),B=require("@minoru/react-dnd-treeview"),O=require("react-i18next"),n=require("./index-aiHDvS5v.cjs"),N=require("lucide-react"),f=require("react"),M=require("./MODIFIERS-2FeVfZQ9.cjs"),q=require("./Functions-N3yhPYKY.cjs"),_=require("./index-cM3eKmlx.cjs"),A=require("./useAddBlockByDrop-7mUMwNSG.cjs");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("@chaibuilder/runtime");require("jotai");require("flat-to-nested");require("@react-hookz/web");require("@radix-ui/react-toggle");require("class-variance-authority");require("./Class-5ARpH_Tu.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("i18next");require("@floating-ui/react-dom");require("react-textarea-autosize");require("flagged");require("react-hotkeys-hook");require("sonner");require("./html-to-json-2PeOCVey.cjs");require("himalaya");require("./web-blocks.cjs");require("./empty-slot-TF2kd-0X.cjs");const v=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(N.DatabaseIcon,{size:16});case"Box":return e.jsxRuntimeExports.jsx(s.BoxIcon,{});default:return e.jsxRuntimeExports.jsx(s.BoxModelIcon,{})}};function H(t=""){const r={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 u=new RegExp(/\b(sm|md|lg|xl|2xl):(block|grid|flex|inline|inline-grid|inline-flex|inline-block)\b/),a=t.match(u);if(x.nth(a,1))return`Visible >=${r[x.nth(a,1)]}`}return""}const L=t=>{let r="";return Object.keys(t).forEach(o=>{x.startsWith(t[o],M.STYLES_KEY)&&(r=t[o])}),r},P=t=>{var j;const[,r]=n.useHighlightBlockId(),[o]=n.useHiddenBlockIds(),{isSelected:c}=t,{id:u,data:a}=t.node,g=t.depth*10,R=l=>{l.stopPropagation(),t.onToggle(t.node.id)},m=B.useDragOver(u,t.isOpen,t.onToggle),p=f.useMemo(()=>{const l=L(t.node.data);return H(l)},[t.node.data]);return e.jsxRuntimeExports.jsx("div",{onMouseEnter:()=>r(u),className:q.cn("group flex w-full items-center justify-between space-x-px py-px",c?"bg-blue-500 text-white":"text-gray-600 hover:bg-gray-200 dark:hover:bg-gray-800"),onClick:l=>{l.stopPropagation(),!o.includes(u)&&t.onSelect(u)},onContextMenu:()=>t.onSelect(u),style:{paddingInlineStart:g},...m,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:R,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(v,{type:a==null?void 0:a._type})}),e.jsxRuntimeExports.jsx("div",{className:"ml-2 truncate text-[11px]",children:((j=t.node.data)==null?void 0:j._name)||t.node.text}),p?e.jsxRuntimeExports.jsxs("span",{className:"ml-2 flex items-center text-[10px] italic "+(c?"text-gray-200":"text-gray-500"),children:["(",p,")"]}):null]})]})})},F=t=>{var o;const{item:r}=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(v,{type:(o=r==null?void 0:r.data)==null?void 0:o._type})}),e.jsxRuntimeExports.jsx("div",{className:"ml-2 truncate text-[11px]",children:r.text})]})},V=t=>{const r=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:r}})},z=()=>{const[t]=n.useSelectedBlockIds(),r=n.useRemoveBlocks(),o=n.useSelectedBlock();return e.jsxRuntimeExports.jsxs(n.ContextMenuItem,{disabled:!n.canDeleteBlock(o==null?void 0:o._type),className:"flex items-center gap-x-4 text-xs",onClick:()=>r(t),children:[e.jsxRuntimeExports.jsx(s.TrashIcon,{})," Remove"]})},$=()=>{const[t]=n.useSelectedBlockIds(),r=n.useDuplicateBlocks(),o=n.useSelectedBlock(),c=f.useCallback(()=>{r(t)},[t,r]);return e.jsxRuntimeExports.jsxs(n.ContextMenuContent,{className:"text-xs",children:[e.jsxRuntimeExports.jsxs(n.ContextMenuItem,{disabled:!n.canDuplicateBlock(o==null?void 0:o._type),className:"flex items-center gap-x-4 text-xs",onClick:c,children:[e.jsxRuntimeExports.jsx(s.CopyIcon,{})," Duplicate"]}),e.jsxRuntimeExports.jsx(z,{})]})},K=({children:t})=>e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:e.jsxRuntimeExports.jsxs(n.ContextMenu,{children:[e.jsxRuntimeExports.jsx(n.ContextMenuTrigger,{children:t}),e.jsxRuntimeExports.jsx($,{})]})});function U(t){return x.map(t,r=>{const{data:o}=r;return{...o,_parent:r.parent===0?null:r.parent}})}function Q(){const[t]=n.useBlocksContainer(),[r,o]=n.useSelectedBlockIds();return t?e.jsxRuntimeExports.jsxs("div",{onClick:c=>{c.stopPropagation(),o(["container"])},className:q.cn("flex items-center pl-2 text-xs",x.includes(r,"container")?"bg-blue-500 text-white":"hover:bg-gray-200 dark:hover:bg-gray-800"),children:[e.jsxRuntimeExports.jsx(s.BoxIcon,{}),"  ",t._type]}):null}const Y=()=>{const[t]=n.useBlocksStore(),{setNewBlocks:r}=n.useBlocksStoreUndoableActions(),[o,c,u]=n.useSelectedBlockIds(),[,a]=n.useSelectedStylingBlocks(),{t:g}=O.useTranslation(),R=_.useExpandedIds(),m=A.useAddBlockByDrop(),[p]=n.useBlocksContainer(),j=async(i,d)=>{const{dragSource:h,relativeIndex:I,dropTargetId:b,monitor:k}=d;if(h){const D=U(i);r(D);const T=k.getItem();c([T.id])}else await m({block:k.getItem(),dropTargetId:b,relativeIndex:I})},l=x.map(t,i=>({id:i._id,text:i._type,parent:i._parent||0,droppable:!x.isUndefined(x.find(t,{_parent:i._id})),data:i})),w=()=>{c([]),a([])},[{isOver:E},C]=y.useDrop(()=>({accept:["CHAI_BLOCK"],collect:i=>({canDrop:i.canDrop(),isOver:i.isOver()}),drop:i=>{(async()=>await m({block:i,dropTargetId:"",relativeIndex:0}))()}})),{isDragging:S}=y.useDragLayer(i=>({isDragging:i.isDragging()}));return e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:e.jsxRuntimeExports.jsx("div",{onClick:()=>w(),className:q.cn("-mx-1 -mt-1 flex h-full select-none flex-col space-y-1",S?"bg-green-50/80":"bg-background"),children:x.isEmpty(t)?e.jsxRuntimeExports.jsxs("div",{ref:C,className:`mx-1 mt-4 h-full max-w-full p-6 text-center text-sm text-gray-400 ${E?"bg-blue-200":""}`,children:[E?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:g(E?"drop_here_message":"tree_view_no_blocks")})]}):e.jsxRuntimeExports.jsxs(n.ScrollArea,{id:"layers-view",className:"no-scrollbar h-full overflow-y-auto p-1",children:[e.jsxRuntimeExports.jsx(Q,{}),e.jsxRuntimeExports.jsx(B.Tree,{initialOpen:R,extraAcceptTypes:["CHAI_BLOCK"],tree:l,rootId:0,render:(i,{depth:d,isOpen:h,onToggle:I})=>e.jsxRuntimeExports.jsx(K,{id:i.id,children:e.jsxRuntimeExports.jsx(P,{onSelect:b=>{a([]),c([b])},isSelected:x.includes(o,i.id),node:i,depth:d,isOpen:h,onToggle:I,toggleIds:u})}),dragPreviewRender:i=>e.jsxRuntimeExports.jsx(F,{monitorProps:i}),onDrop:j,classes:{root:"h-[90%] "+(p?"pl-2":"pt-2"),draggingSource:"opacity-30",dropTarget:"bg-green-100",placeholder:"relative"},sort:!1,insertDroppableFirst:!1,canDrop:n.canDropBlock,dropTargetOffset:2,enableAnimateExpand:!0,placeholderRender:(i,{depth:d})=>e.jsxRuntimeExports.jsx(V,{node:i,depth:d})})]})})})};exports.default=Y;
@@ -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-cM3eKmlx.cjs");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("i18next");require("react-i18next");require("./index-aiHDvS5v.cjs");require("./Functions-N3yhPYKY.cjs");require("clsx");require("tailwind-merge");require("@chaibuilder/runtime");require("jotai");require("flat-to-nested");require("./MODIFIERS-2FeVfZQ9.cjs");require("@react-hookz/web");require("@radix-ui/react-toggle");require("class-variance-authority");require("./Class-5ARpH_Tu.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("@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-2PeOCVey.cjs");require("himalaya");require("lucide-react");require("./web-blocks.cjs");require("./empty-slot-TF2kd-0X.cjs");const a=u.lazy(()=>Promise.resolve().then(()=>require("./add-page-modal-GAizM2Jw.cjs"))),x=u.lazy(()=>Promise.resolve().then(()=>require("./page-viewer-Sh99FGYk.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,22 @@
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 { a as l, b as c } from "./index-pZhGT8uT.js";
4
+ import { a as l, b as c } from "./index-Fj3ead-J.js";
5
5
  import "./_commonjsHelpers-UyOWmZb0.js";
6
6
  import "i18next";
7
7
  import "react-i18next";
8
- import "./index-niHREMmR.js";
9
- import "@radix-ui/react-toggle";
10
- import "class-variance-authority";
11
- import "./utils-AvyFzbPC.js";
12
- import "./MODIFIERS-RiXS5Mn1.js";
8
+ import "./index-pNYv0oAF.js";
9
+ import "./Functions-7jnEwJyw.js";
13
10
  import "clsx";
14
11
  import "tailwind-merge";
12
+ import "@chaibuilder/runtime";
13
+ import "jotai";
14
+ import "flat-to-nested";
15
+ import "./MODIFIERS-RiXS5Mn1.js";
16
+ import "@react-hookz/web";
17
+ import "@radix-ui/react-toggle";
18
+ import "class-variance-authority";
19
+ import "./Class-17XFhL48.js";
15
20
  import "@radix-ui/react-switch";
16
21
  import "@radix-ui/react-slot";
17
22
  import "@radix-ui/react-accordion";
@@ -34,13 +39,6 @@ import "@radix-ui/react-context-menu";
34
39
  import "react-icons-picker";
35
40
  import "react-dom";
36
41
  import "react-quill";
37
- import "jotai";
38
- import "flat-to-nested";
39
- import "./Functions-7jnEwJyw.js";
40
- import "redux-undo";
41
- import "@chaibuilder/runtime";
42
- import "lodash";
43
- import "@react-hookz/web";
44
42
  import "@floating-ui/react-dom";
45
43
  import "react-textarea-autosize";
46
44
  import "flagged";
@@ -52,8 +50,8 @@ import "./html-to-json-57841sEK.js";
52
50
  import "himalaya";
53
51
  import "lucide-react";
54
52
  import "./web-blocks.js";
55
- import "./controls-XPXGHKht.js";
56
- const x = i.lazy(() => import("./add-page-modal-cm8damU2.js")), g = i.lazy(() => import("./page-viewer-feqJr1QI.js")), jt = () => {
53
+ import "./empty-slot-MWycClTb.js";
54
+ const x = i.lazy(() => import("./add-page-modal-2P5hGXOQ.js")), g = i.lazy(() => import("./page-viewer-VxqOevr4.js")), gt = () => {
57
55
  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);
58
56
  return /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
59
57
  /* @__PURE__ */ t.jsxs("div", { className: "flex items-center justify-between rounded-md bg-background/30 p-1", children: [
@@ -65,5 +63,5 @@ const x = i.lazy(() => import("./add-page-modal-cm8damU2.js")), g = i.lazy(() =>
65
63
  ] });
66
64
  };
67
65
  export {
68
- jt as default
66
+ gt as default
69
67
  };