@chaibuilder/sdk 1.2.18 → 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.
- package/dist/AddBlocks-KeHVFaIr.cjs +1 -0
- package/dist/{AddBlocks-uCdu9Xpr.js → AddBlocks-gcTaEIKO.js} +5 -4
- package/dist/BrandingOptions-I2I8w6E9.cjs +1 -0
- package/dist/{BrandingOptions-JbHRN7V5.js → BrandingOptions-bfiFY0VR.js} +5 -4
- package/dist/{CanvasArea-oUIvLfdq.cjs → CanvasArea-JfHkTnQD.cjs} +1 -1
- package/dist/{CanvasArea-aWzbzB9p.js → CanvasArea-xvMCbQDL.js} +8 -7
- package/dist/{CurrentPage-AlOLPG4o.js → CurrentPage-0Ap2N0uc.js} +13 -12
- package/dist/CurrentPage-vj52UxMA.cjs +1 -0
- package/dist/ListTree-Vq0_s1wC.cjs +1 -0
- package/dist/ListTree-k-QMO740.js +96 -0
- package/dist/{Outline-oGoAdnBw.js → Outline-HI6-c9nf.js} +96 -92
- package/dist/Outline-fAflJ_lN.cjs +1 -0
- package/dist/{PagesPanel-VbSQHEu_.js → PagesPanel-Pk-C1956.js} +7 -6
- package/dist/PagesPanel-ug8Tmva6.cjs +1 -0
- package/dist/{ProjectPanel-fqux215P.js → ProjectPanel-_KQBhuPO.js} +8 -7
- package/dist/ProjectPanel-o8-6cPX-.cjs +1 -0
- package/dist/Settings-Cc9eV4VG.cjs +1 -0
- package/dist/{Settings-IhWI1ice.js → Settings-XtAatoiu.js} +5 -4
- package/dist/{SidePanels-lMCXrchR.js → SidePanels-O52zKXbH.js} +134 -133
- package/dist/SidePanels-ugRobm34.cjs +1 -0
- package/dist/Topbar-e5MGWX9n.cjs +1 -0
- package/dist/{Topbar-DYiisBtw.js → Topbar-oTx7a12r.js} +5 -4
- package/dist/{UnsplashImages-lGLcqo4M.js → UnsplashImages-5A21uzMK.js} +5 -4
- package/dist/UnsplashImages-KSbKGs91.cjs +1 -0
- package/dist/UploadImages-V42YSRVO.cjs +1 -0
- package/dist/{UploadImages-06m6vjbL.js → UploadImages-V_54lCAO.js} +5 -4
- package/dist/{add-page-modal-mEbIXSKX.js → add-page-modal-dKQLw7RQ.js} +17 -16
- package/dist/add-page-modal-xMedOdsp.cjs +1 -0
- package/dist/{confirm-alert-YETlIRpE.js → confirm-alert-8GP3bKH_.js} +5 -4
- package/dist/{confirm-alert-ZpEIxh3X.cjs → confirm-alert-KtW-4OjG.cjs} +1 -1
- package/dist/core.cjs +1 -1
- package/dist/core.d.ts +1 -0
- package/dist/core.js +47 -46
- package/dist/defaultTheme-7Lk2zq60.cjs +1 -0
- package/dist/{defaultTheme-s0cpA5Oy.js → defaultTheme-gunU_Fe5.js} +31 -33
- package/dist/{delete-page-modal-J_SmPWrw.js → delete-page-modal-Zb5ld6O-.js} +7 -6
- package/dist/delete-page-modal-lebJCBBe.cjs +1 -0
- package/dist/email-blocks.cjs +1 -1
- package/dist/email-blocks.js +79 -79
- package/dist/email.cjs +1 -1
- package/dist/email.d.ts +1 -0
- package/dist/email.js +6 -5
- package/dist/{form-Y0Vb4m04.cjs → form-o6_55v8F.cjs} +1 -1
- package/dist/{form-2xJcQs_Y.js → form-yyU2x7So.js} +1 -1
- package/dist/{index-3TQsdso6.cjs → index-BMZLAJUV.cjs} +1 -1
- package/dist/{index-ZwpjuB-N.cjs → index-JdnF6lYP.cjs} +42 -42
- package/dist/{index-ZBqiaKhx.js → index-WP7IRkij.js} +739 -739
- package/dist/{index-627XtO9e.js → index-lFcrvDFC.js} +3 -3
- package/dist/index-thKfFhmr.cjs +1 -0
- package/dist/{index-LF3KXx4u.js → index-yILWlilS.js} +3142 -3132
- package/dist/lib.cjs +1 -1
- package/dist/lib.js +1 -1
- package/dist/{page-viewer-7u0SWWmO.js → page-viewer-3QXwPGpg.js} +11 -10
- package/dist/page-viewer-DTIblLiz.cjs +1 -0
- package/dist/{project-general-setting-SqC85J7F.js → project-general-setting-UalRmyHm.js} +8 -7
- package/dist/project-general-setting-g7WhM3hc.cjs +1 -0
- package/dist/{project-seo-setting-TlQherop.js → project-seo-setting-8FsvPSPl.js} +6 -5
- package/dist/project-seo-setting-xoeLQVj3.cjs +1 -0
- package/dist/render.cjs +1 -1
- package/dist/render.d.ts +10 -0
- package/dist/render.js +164 -78
- package/dist/{single-page-detail-ClZYIdSO.js → single-page-detail-GaB85dNv.js} +9 -8
- package/dist/single-page-detail-XdBysrE_.cjs +1 -0
- package/dist/studio.cjs +1 -1
- package/dist/studio.d.ts +1 -0
- package/dist/studio.js +6 -5
- package/dist/ui.cjs +1 -1
- package/dist/ui.d.ts +1 -1
- package/dist/ui.js +140 -139
- package/dist/{useAddBlockByDrop-E343zoB3.cjs → useAddBlockByDrop-6EbioQV4.cjs} +1 -1
- package/dist/{useAddBlockByDrop-sPX4lN-O.js → useAddBlockByDrop-BIK2fdgj.js} +1 -1
- package/package.json +2 -1
- package/dist/AddBlocks-5Q5w5lPJ.cjs +0 -1
- package/dist/BrandingOptions-xrGQI1Kn.cjs +0 -1
- package/dist/CurrentPage-atmd8UrZ.cjs +0 -1
- package/dist/Outline-uMUTwN-R.cjs +0 -1
- package/dist/PagesPanel-nN3QUwXp.cjs +0 -1
- package/dist/ProjectPanel-UIEFhref.cjs +0 -1
- package/dist/Settings-8qUW0Iow.cjs +0 -1
- package/dist/SidePanels-cOHgPE9y.cjs +0 -1
- package/dist/Topbar-vLD-rWl5.cjs +0 -1
- package/dist/UnsplashImages-1JWfKlBc.cjs +0 -1
- package/dist/UploadImages-T4MYMOhW.cjs +0 -1
- package/dist/add-page-modal-niwhffYL.cjs +0 -1
- package/dist/defaultTheme-1XwPZT2b.cjs +0 -1
- package/dist/delete-page-modal-sOqRlmKb.cjs +0 -1
- package/dist/index-T3wfa1kz.cjs +0 -1
- package/dist/page-viewer-6UDraUKW.cjs +0 -1
- package/dist/project-general-setting-AW5Vtmgx.cjs +0 -1
- package/dist/project-seo-setting-cWiNZcxW.cjs +0 -1
- package/dist/single-page-detail-kJUW6FE9.cjs +0 -1
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
import { j as e } from "./jsx-runtime-WbnYoNE9.js";
|
|
2
|
-
import { nth as
|
|
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
|
|
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
|
|
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-
|
|
13
|
-
import { u as
|
|
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
|
|
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(
|
|
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 "
|
|
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(
|
|
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(
|
|
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(
|
|
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
|
|
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
|
-
),
|
|
131
|
-
if (
|
|
132
|
-
return `Visible >=${s[
|
|
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
|
-
|
|
137
|
+
function Ke(t) {
|
|
138
|
+
return t.split("/").pop();
|
|
139
|
+
}
|
|
140
|
+
const Ue = (t) => {
|
|
137
141
|
let s = "";
|
|
138
|
-
return Object.keys(t).forEach((
|
|
139
|
-
_(t[
|
|
142
|
+
return Object.keys(t).forEach((r) => {
|
|
143
|
+
_(t[r], Ve) && (s = t[r]);
|
|
140
144
|
}), s;
|
|
141
|
-
},
|
|
145
|
+
}, Ye = (t) => {
|
|
142
146
|
var u;
|
|
143
|
-
const [, s] = be(), [
|
|
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(
|
|
146
|
-
const a =
|
|
147
|
-
return
|
|
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(
|
|
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(), !
|
|
164
|
+
a.stopPropagation(), !r.includes(n) && t.onSelect(n);
|
|
161
165
|
},
|
|
162
|
-
onContextMenu: () => t.onSelect(
|
|
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:
|
|
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(
|
|
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(
|
|
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
|
-
},
|
|
206
|
-
var
|
|
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(
|
|
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
|
-
},
|
|
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
|
-
},
|
|
216
|
-
const [t] =
|
|
219
|
+
}, We = () => {
|
|
220
|
+
const [t] = I(), s = Be(), r = D();
|
|
217
221
|
return /* @__PURE__ */ e.jsxs(
|
|
218
|
-
|
|
222
|
+
N,
|
|
219
223
|
{
|
|
220
|
-
disabled: !we(
|
|
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
|
-
},
|
|
230
|
-
const [t] =
|
|
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
|
-
|
|
239
|
+
N,
|
|
236
240
|
{
|
|
237
|
-
disabled: !De(
|
|
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(
|
|
245
|
+
/* @__PURE__ */ e.jsx(de, {}),
|
|
242
246
|
" Duplicate"
|
|
243
247
|
]
|
|
244
248
|
}
|
|
245
249
|
),
|
|
246
|
-
/* @__PURE__ */ e.jsx(
|
|
250
|
+
/* @__PURE__ */ e.jsx(We, {})
|
|
247
251
|
] });
|
|
248
|
-
},
|
|
249
|
-
/* @__PURE__ */ e.jsx(
|
|
250
|
-
/* @__PURE__ */ e.jsx(
|
|
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
|
|
253
|
-
return
|
|
254
|
-
const { data:
|
|
256
|
+
function Ze(t) {
|
|
257
|
+
return T(t, (s) => {
|
|
258
|
+
const { data: r } = s;
|
|
255
259
|
return {
|
|
256
|
-
...
|
|
260
|
+
...r,
|
|
257
261
|
_parent: s.parent === 0 ? null : s.parent
|
|
258
262
|
};
|
|
259
263
|
});
|
|
260
264
|
}
|
|
261
|
-
const
|
|
262
|
-
const [t] = Oe(), { setNewBlocks: s } = Re(), [
|
|
263
|
-
const { dragSource: j, relativeIndex: b, dropTargetId:
|
|
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
|
|
266
|
-
s(
|
|
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
|
|
271
|
-
}, u =
|
|
272
|
-
id:
|
|
273
|
-
text:
|
|
274
|
-
parent:
|
|
275
|
-
droppable: !H(A(t, { _parent:
|
|
276
|
-
data:
|
|
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([]),
|
|
279
|
-
}, [{ isOver: h },
|
|
282
|
+
c([]), n([]);
|
|
283
|
+
}, [{ isOver: h }, R] = ue(() => ({
|
|
280
284
|
accept: ["CHAI_BLOCK"],
|
|
281
|
-
collect: (
|
|
282
|
-
canDrop:
|
|
283
|
-
isOver:
|
|
285
|
+
collect: (o) => ({
|
|
286
|
+
canDrop: o.canDrop(),
|
|
287
|
+
isOver: o.isOver()
|
|
284
288
|
}),
|
|
285
|
-
drop: (
|
|
286
|
-
(async () => await
|
|
287
|
-
block:
|
|
289
|
+
drop: (o) => {
|
|
290
|
+
(async () => await x({
|
|
291
|
+
block: o,
|
|
288
292
|
dropTargetId: "",
|
|
289
293
|
relativeIndex: 0
|
|
290
294
|
}))();
|
|
291
295
|
}
|
|
292
|
-
})), { isDragging:
|
|
293
|
-
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
|
-
|
|
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:
|
|
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(
|
|
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: (
|
|
321
|
-
|
|
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: (
|
|
324
|
-
|
|
327
|
+
onSelect: (f) => {
|
|
328
|
+
n([]), c([f]);
|
|
325
329
|
},
|
|
326
|
-
isSelected: P(
|
|
327
|
-
node:
|
|
328
|
-
depth:
|
|
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: (
|
|
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: (
|
|
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
|
-
|
|
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-
|
|
4
|
+
import { u as l, a as c } from "./index-lFcrvDFC.js";
|
|
5
5
|
import "./_commonjsHelpers-UyOWmZb0.js";
|
|
6
|
-
import "./index-
|
|
6
|
+
import "./index-yILWlilS.js";
|
|
7
7
|
import "i18next";
|
|
8
8
|
import "react-i18next";
|
|
9
|
-
import "./index-
|
|
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-
|
|
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-mEbIXSKX.js")), u = i.lazy(() =>
|
|
|
63
64
|
] });
|
|
64
65
|
};
|
|
65
66
|
export {
|
|
66
|
-
|
|
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-
|
|
5
|
-
import { b as h, a as g } from "./index-
|
|
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-
|
|
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-
|
|
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
|
|
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
|
-
|
|
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;
|