@chaibuilder/sdk 0.1.17 → 0.1.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-6fc9d7de.cjs +3 -0
- package/dist/{AddBlocks-7b723045.js → AddBlocks-d5a8235d.js} +49 -45
- package/dist/BrandingOptions-e44ef105.cjs +1 -0
- package/dist/{BrandingOptions-b0624d8f.js → BrandingOptions-e77f91bc.js} +11 -7
- package/dist/CanvasArea-50356121.js +1311 -0
- package/dist/CanvasArea-a09ed911.cjs +46 -0
- package/dist/{CurrentPage-e0c8b063.js → CurrentPage-0dd3a1fe.js} +18 -14
- package/dist/CurrentPage-19086054.cjs +1 -0
- package/dist/{ImagesPanel-68a11293.cjs → ImagesPanel-0db5c72f.cjs} +1 -1
- package/dist/{ImagesPanel-996761b1.js → ImagesPanel-38c44785.js} +1 -1
- package/dist/Layers-2dd7336a.cjs +1 -0
- package/dist/{Layers-20ce5cb3.js → Layers-e17bbf6a.js} +144 -142
- package/dist/{MarkAsGlobalBlock-96dd248c.js → MarkAsGlobalBlock-3a58a10b.js} +15 -11
- package/dist/MarkAsGlobalBlock-d4fe0af6.cjs +1 -0
- package/dist/{PagesPanel-6f5393e8.js → PagesPanel-68bb4554.js} +12 -8
- package/dist/PagesPanel-fa54f8c4.cjs +1 -0
- package/dist/ProjectPanel-750e4a4f.cjs +1 -0
- package/dist/{ProjectPanel-b027fc0d.js → ProjectPanel-decfe6bb.js} +12 -8
- package/dist/{Settings-5bae2bdf.js → Settings-27bb6012.js} +909 -640
- package/dist/Settings-c18e276b.cjs +1 -0
- package/dist/SidePanels-839ecfae.js +243 -0
- package/dist/SidePanels-90ac74bf.cjs +1 -0
- package/dist/Topbar-57cd1611.cjs +1 -0
- package/dist/{Topbar-ba10ddd1.js → Topbar-d3dc4a34.js} +23 -19
- package/dist/{UnsplashImages-f761ad96.cjs → UnsplashImages-0d091e33.cjs} +1 -1
- package/dist/{UnsplashImages-47374e0c.js → UnsplashImages-10c95b63.js} +1 -1
- package/dist/{UploadImages-33c1507a.cjs → UploadImages-10439fde.cjs} +1 -1
- package/dist/{UploadImages-f0ba3215.js → UploadImages-b14bd152.js} +1 -1
- package/dist/_commonjsHelpers-10dfc225.js +8 -0
- package/dist/_commonjsHelpers-87b0abe8.cjs +1 -0
- package/dist/{add-page-modal-b5f3aeab.js → add-page-modal-da3e0ad5.js} +14 -11
- package/dist/add-page-modal-f49ebaf3.cjs +1 -0
- package/dist/card-14e1d020.cjs +1 -0
- package/dist/card-f8f4f985.js +33 -0
- package/dist/core.cjs +1 -1
- package/dist/core.d.ts +6 -4
- package/dist/core.js +63 -59
- package/dist/{delete-page-modal-b1d253ae.js → delete-page-modal-3aa66051.js} +10 -6
- package/dist/delete-page-modal-6667ee2b.cjs +1 -0
- package/dist/{form-bf09d392.js → form-725e3191.js} +3 -3
- package/dist/{form-5d04c9b3.cjs → form-99b51245.cjs} +1 -1
- package/dist/index-976ec896.cjs +164 -0
- package/dist/index-ca7c3430.js +31068 -0
- package/dist/{link-6467eda6.js → link-2af5de8b.js} +1 -1
- package/dist/{link-4585b2d6.cjs → link-86ac8848.cjs} +1 -1
- package/dist/{page-viewer-11b81948.js → page-viewer-3e7a6d70.js} +19 -15
- package/dist/page-viewer-5f00c933.cjs +1 -0
- package/dist/project-general-setting-a23cc2c4.cjs +1 -0
- package/dist/{project-general-setting-9f37b1ac.js → project-general-setting-c8aa9370.js} +9 -7
- package/dist/{project-seo-setting-3f645a02.cjs → project-seo-setting-a9403f1d.cjs} +1 -1
- package/dist/{project-seo-setting-e9587467.js → project-seo-setting-c1980ec3.js} +3 -3
- package/dist/render.cjs +1 -1
- package/dist/render.js +1 -1
- package/dist/{scroll-area-9f64a082.js → scroll-area-83bd9e8f.js} +7 -7
- package/dist/{scroll-area-088530b9.cjs → scroll-area-bb343b86.cjs} +1 -1
- package/dist/{single-page-detail-085b82ca.js → single-page-detail-55638cb1.js} +32 -30
- package/dist/single-page-detail-a4b59a16.cjs +1 -0
- package/dist/style.css +1 -1
- package/dist/textarea-20b2f6b2.cjs +1 -0
- package/dist/textarea-9dfb6a32.js +45 -0
- package/dist/ui.cjs +1 -1
- package/dist/ui.js +74 -73
- package/dist/useChaiExternalData-192c7896.js +5 -0
- package/dist/useChaiExternalData-a90e8aac.cjs +1 -0
- package/package.json +5 -3
- package/dist/AddBlocks-3d30d446.cjs +0 -3
- package/dist/BrandingOptions-daafdabf.cjs +0 -1
- package/dist/CanvasArea-93be7e7b.cjs +0 -60
- package/dist/CanvasArea-d301c4ef.js +0 -1459
- package/dist/CurrentPage-478eb8a0.cjs +0 -1
- package/dist/Layers-85854772.cjs +0 -1
- package/dist/MarkAsGlobalBlock-5a36e8ad.cjs +0 -1
- package/dist/PagesPanel-39cc0156.cjs +0 -1
- package/dist/ProjectPanel-027fb151.cjs +0 -1
- package/dist/Settings-d9dc47d7.cjs +0 -1
- package/dist/SidePanels-9ac03c5d.js +0 -149
- package/dist/SidePanels-fe464a57.cjs +0 -1
- package/dist/Topbar-e00f11e0.cjs +0 -1
- package/dist/_commonjsHelpers-5a53b418.cjs +0 -1
- package/dist/_commonjsHelpers-d4512b9c.js +0 -6
- package/dist/add-page-modal-b267650f.cjs +0 -1
- package/dist/delete-page-modal-04b3677b.cjs +0 -1
- package/dist/index-1e878777.cjs +0 -2
- package/dist/index-95757b80.js +0 -5028
- package/dist/page-viewer-f41c53e3.cjs +0 -1
- package/dist/project-general-setting-51da3f18.cjs +0 -1
- package/dist/single-page-detail-a251b327.cjs +0 -1
- package/dist/textarea-0750bcd2.js +0 -73
- package/dist/textarea-a338ede6.cjs +0 -1
|
@@ -1,18 +1,24 @@
|
|
|
1
1
|
import { j as e } from "./jsx-runtime-944c88e2.js";
|
|
2
|
-
import { nth as k, startsWith as
|
|
3
|
-
import { BoxModelIcon as G, BoxIcon as $, DragHandleHorizontalIcon as K, ViewHorizontalIcon as
|
|
2
|
+
import { nth as k, startsWith as P, has as H, map as v, isUndefined as L, find as V, isEmpty as z, includes as F } from "lodash";
|
|
3
|
+
import { BoxModelIcon as G, BoxIcon as $, DragHandleHorizontalIcon as K, ViewHorizontalIcon as Y, BorderAllIcon as q, BorderTopIcon as Q, TableIcon as U, DropdownMenuIcon as W, RadiobuttonIcon as X, InputIcon as J, ButtonIcon as B, CheckboxIcon as Z, GroupIcon as ee, SpaceBetweenVerticallyIcon as se, ColumnsIcon as te, RowsIcon as y, TextIcon as C, SketchLogoIcon as oe, DividerHorizontalIcon as ne, CodeIcon as re, CursorTextIcon as ae, VideoIcon as ce, Link1Icon as le, HeadingIcon as ie, ImageIcon as de, TriangleRightIcon as xe, GlobeIcon as ue, CopyIcon as me, ClipboardCopyIcon as pe, ScissorsIcon as ge, ClipboardIcon as je, TrashIcon as he, DoubleArrowDownIcon as fe, StackIcon as Ie } from "@radix-ui/react-icons";
|
|
4
4
|
import { useDrop as be, useDragLayer as ke } from "react-dnd";
|
|
5
5
|
import { useDragOver as Be, Tree as ye } from "@minoru/react-dnd-treeview";
|
|
6
6
|
import { useTranslation as Ce } from "react-i18next";
|
|
7
|
-
import {
|
|
7
|
+
import { A as ve, V as we, i as g, m as Se, q as De, n as Te, o as Ne, t as Me, D as Oe, W as Re, B as Ee, h as Ae, j as _e, d as Pe, X as He, b as Le, Y as Ve } from "./index-ca7c3430.js";
|
|
8
|
+
import { DatabaseIcon as ze } from "lucide-react";
|
|
8
9
|
import { c as w } from "./utils-ac68b2c8.js";
|
|
9
|
-
import { useMemo as Fe, lazy as
|
|
10
|
-
import { S as
|
|
11
|
-
import { D as
|
|
12
|
-
import { C as
|
|
13
|
-
import { u as
|
|
14
|
-
import { S as Je } from "./scroll-area-
|
|
15
|
-
import { useAtom as
|
|
10
|
+
import { useMemo as Fe, lazy as Ge, useState as $e, Suspense as Ke, useCallback as S } from "react";
|
|
11
|
+
import { S as Ye } from "./MODIFIERS-c2e02614.js";
|
|
12
|
+
import { D as qe, a as Qe } from "./dialog-3d4e82ed.js";
|
|
13
|
+
import { C as Ue, a as We, b as Xe, c as d } from "./context-menu-e1c240ce.js";
|
|
14
|
+
import { u as D } from "./useBuilderProp-81a14920.js";
|
|
15
|
+
import { S as Je } from "./scroll-area-83bd9e8f.js";
|
|
16
|
+
import { useAtom as Ze } from "jotai";
|
|
17
|
+
import "./_commonjsHelpers-10dfc225.js";
|
|
18
|
+
import "clsx";
|
|
19
|
+
import "@radix-ui/react-scroll-area";
|
|
20
|
+
import "react-dom";
|
|
21
|
+
import "@floating-ui/react-dom";
|
|
16
22
|
import "i18next";
|
|
17
23
|
import "flagged";
|
|
18
24
|
import "react-hotkeys-hook";
|
|
@@ -22,9 +28,7 @@ import "himalaya";
|
|
|
22
28
|
import "redux-undo";
|
|
23
29
|
import "@react-hookz/web";
|
|
24
30
|
import "@chaibuilder/blocks";
|
|
25
|
-
import "lucide-react";
|
|
26
31
|
import "sonner";
|
|
27
|
-
import "clsx";
|
|
28
32
|
import "tailwind-merge";
|
|
29
33
|
import "@radix-ui/react-dialog";
|
|
30
34
|
import "@radix-ui/react-context-menu";
|
|
@@ -32,8 +36,7 @@ import "@radix-ui/react-slot";
|
|
|
32
36
|
import "class-variance-authority";
|
|
33
37
|
import "@radix-ui/react-tooltip";
|
|
34
38
|
import "@radix-ui/react-toast";
|
|
35
|
-
|
|
36
|
-
const N = (s) => {
|
|
39
|
+
const T = (s) => {
|
|
37
40
|
switch (s.type) {
|
|
38
41
|
case "Image":
|
|
39
42
|
return /* @__PURE__ */ e.jsx(de, {});
|
|
@@ -44,17 +47,17 @@ const N = (s) => {
|
|
|
44
47
|
case "Link":
|
|
45
48
|
return /* @__PURE__ */ e.jsx(le, {});
|
|
46
49
|
case "Video":
|
|
47
|
-
return /* @__PURE__ */ e.jsx(ae, {});
|
|
48
|
-
case "RichText":
|
|
49
50
|
return /* @__PURE__ */ e.jsx(ce, {});
|
|
51
|
+
case "RichText":
|
|
52
|
+
return /* @__PURE__ */ e.jsx(ae, {});
|
|
50
53
|
case "Button":
|
|
51
54
|
return /* @__PURE__ */ e.jsx(B, {});
|
|
52
55
|
case "CustomHTML":
|
|
53
56
|
return /* @__PURE__ */ e.jsx(re, {});
|
|
54
57
|
case "Divider":
|
|
55
|
-
return /* @__PURE__ */ e.jsx(oe, {});
|
|
56
|
-
case "Icon":
|
|
57
58
|
return /* @__PURE__ */ e.jsx(ne, {});
|
|
59
|
+
case "Icon":
|
|
60
|
+
return /* @__PURE__ */ e.jsx(oe, {});
|
|
58
61
|
case "List":
|
|
59
62
|
return /* @__PURE__ */ e.jsx(y, {});
|
|
60
63
|
case "Paragraph":
|
|
@@ -73,28 +76,30 @@ const N = (s) => {
|
|
|
73
76
|
return /* @__PURE__ */ e.jsx(B, {});
|
|
74
77
|
case "Input":
|
|
75
78
|
case "TextArea":
|
|
76
|
-
return /* @__PURE__ */ e.jsx(X, {});
|
|
77
|
-
case "Radio":
|
|
78
79
|
return /* @__PURE__ */ e.jsx(J, {});
|
|
80
|
+
case "Radio":
|
|
81
|
+
return /* @__PURE__ */ e.jsx(X, {});
|
|
79
82
|
case "Select":
|
|
80
83
|
return /* @__PURE__ */ e.jsx(W, {});
|
|
81
84
|
case "Table":
|
|
82
|
-
return /* @__PURE__ */ e.jsx(
|
|
85
|
+
return /* @__PURE__ */ e.jsx(U, {});
|
|
83
86
|
case "TableHead":
|
|
84
87
|
return /* @__PURE__ */ e.jsx(Q, {});
|
|
85
88
|
case "TableBody":
|
|
86
89
|
return /* @__PURE__ */ e.jsx(q, {});
|
|
87
90
|
case "TableRow":
|
|
88
|
-
return /* @__PURE__ */ e.jsx(
|
|
91
|
+
return /* @__PURE__ */ e.jsx(Y, {});
|
|
89
92
|
case "TableCell":
|
|
90
93
|
return /* @__PURE__ */ e.jsx(K, {});
|
|
94
|
+
case "DataProvider":
|
|
95
|
+
return /* @__PURE__ */ e.jsx(ze, { size: 16 });
|
|
91
96
|
case "Box":
|
|
92
97
|
return /* @__PURE__ */ e.jsx($, {});
|
|
93
98
|
default:
|
|
94
99
|
return /* @__PURE__ */ e.jsx(G, {});
|
|
95
100
|
}
|
|
96
101
|
};
|
|
97
|
-
function
|
|
102
|
+
function es(s = "") {
|
|
98
103
|
const t = {
|
|
99
104
|
xs: "390px",
|
|
100
105
|
sm: "640px",
|
|
@@ -108,42 +113,42 @@ function Ze(s = "") {
|
|
|
108
113
|
if (new RegExp(/\b(sm|md|lg|xl|2xl):hidden\b/).test(s))
|
|
109
114
|
return "Visible on mobile";
|
|
110
115
|
if (s.match(/(^| )hidden( |$)/g)) {
|
|
111
|
-
const
|
|
116
|
+
const a = new RegExp(
|
|
112
117
|
// checks if any of the display property is set for any higher media query
|
|
113
118
|
/\b(sm|md|lg|xl|2xl):(block|grid|flex|inline|inline-grid|inline-flex|inline-block)\b/
|
|
114
|
-
),
|
|
115
|
-
if (k(
|
|
116
|
-
return `Visible >=${t[k(
|
|
119
|
+
), c = s.match(a);
|
|
120
|
+
if (k(c, 1))
|
|
121
|
+
return `Visible >=${t[k(c, 1)]}`;
|
|
117
122
|
}
|
|
118
123
|
return "";
|
|
119
124
|
}
|
|
120
|
-
const
|
|
125
|
+
const ss = (s) => {
|
|
121
126
|
let t = "";
|
|
122
|
-
return Object.keys(s).forEach((
|
|
123
|
-
|
|
127
|
+
return Object.keys(s).forEach((o) => {
|
|
128
|
+
P(s[o], Ye) && (t = s[o]);
|
|
124
129
|
}), t;
|
|
125
|
-
},
|
|
130
|
+
}, ts = (s) => {
|
|
126
131
|
var m;
|
|
127
|
-
const [, t] = ve(), [
|
|
132
|
+
const [, t] = ve(), [o] = we(), { isSelected: r } = s, { id: a, data: c } = s.node, l = s.depth * 10, x = (i) => {
|
|
128
133
|
i.stopPropagation(), s.onToggle(s.node.id);
|
|
129
|
-
}, j = Be(
|
|
130
|
-
const i =
|
|
131
|
-
return
|
|
134
|
+
}, j = Be(a, s.isOpen, s.onToggle), u = Fe(() => {
|
|
135
|
+
const i = ss(s.node.data);
|
|
136
|
+
return es(i);
|
|
132
137
|
}, [s.node.data]);
|
|
133
138
|
return (
|
|
134
139
|
// eslint-disable-next-line jsx-a11y/click-events-have-key-events,jsx-a11y/no-static-element-interactions
|
|
135
140
|
/* @__PURE__ */ e.jsx(
|
|
136
141
|
"div",
|
|
137
142
|
{
|
|
138
|
-
onMouseEnter: () => t(
|
|
143
|
+
onMouseEnter: () => t(a),
|
|
139
144
|
className: w(
|
|
140
145
|
"group flex w-full items-center justify-between space-x-px py-px ",
|
|
141
146
|
r ? "bg-blue-500 text-white" : "hover:bg-gray-200 dark:hover:bg-gray-800"
|
|
142
147
|
),
|
|
143
148
|
onClick: (i) => {
|
|
144
|
-
i.stopPropagation(), !
|
|
149
|
+
i.stopPropagation(), !o.includes(a) && s.onSelect(a);
|
|
145
150
|
},
|
|
146
|
-
onContextMenu: () => s.onSelect(
|
|
151
|
+
onContextMenu: () => s.onSelect(a),
|
|
147
152
|
style: { paddingInlineStart: l },
|
|
148
153
|
...j,
|
|
149
154
|
children: /* @__PURE__ */ e.jsxs("div", { className: "flex items-center", children: [
|
|
@@ -155,7 +160,7 @@ const es = (s) => {
|
|
|
155
160
|
}
|
|
156
161
|
),
|
|
157
162
|
/* @__PURE__ */ e.jsxs("button", { type: "button", className: "flex items-center", children: [
|
|
158
|
-
/* @__PURE__ */ e.jsx("div", { className: "-mt-1 h-3 w-3", children: /* @__PURE__ */ e.jsx(
|
|
163
|
+
/* @__PURE__ */ e.jsx("div", { className: "-mt-1 h-3 w-3", children: /* @__PURE__ */ e.jsx(T, { type: c == null ? void 0 : c._type }) }),
|
|
159
164
|
/* @__PURE__ */ e.jsx("div", { className: "ml-2 truncate text-[11px]", children: ((m = s.node.data) == null ? void 0 : m._name) || s.node.text }),
|
|
160
165
|
u ? /* @__PURE__ */ e.jsxs(
|
|
161
166
|
"span",
|
|
@@ -173,34 +178,34 @@ const es = (s) => {
|
|
|
173
178
|
}
|
|
174
179
|
)
|
|
175
180
|
);
|
|
176
|
-
},
|
|
177
|
-
var
|
|
181
|
+
}, os = (s) => {
|
|
182
|
+
var o;
|
|
178
183
|
const { item: t } = s.monitorProps;
|
|
179
184
|
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: [
|
|
180
|
-
/* @__PURE__ */ e.jsx("div", { className: "", children: /* @__PURE__ */ e.jsx(
|
|
185
|
+
/* @__PURE__ */ e.jsx("div", { className: "", children: /* @__PURE__ */ e.jsx(T, { type: (o = t == null ? void 0 : t.data) == null ? void 0 : o._type }) }),
|
|
181
186
|
/* @__PURE__ */ e.jsx("div", { className: "ml-2 truncate text-[11px]", children: t.text })
|
|
182
187
|
] });
|
|
183
188
|
}, ns = (s) => {
|
|
184
189
|
const t = s.depth * 10 + 16;
|
|
185
190
|
return /* @__PURE__ */ e.jsx("div", { className: "absolute right-0 top-0 h-0.5 -translate-y-1/2 transform bg-green-500", style: { left: t } });
|
|
186
|
-
},
|
|
187
|
-
const [s] = g(), [, t] =
|
|
191
|
+
}, rs = Ge(() => import("./MarkAsGlobalBlock-3a58a10b.js")), as = () => {
|
|
192
|
+
const [s] = g(), [, t] = Te();
|
|
188
193
|
return /* @__PURE__ */ e.jsxs(d, { className: "flex items-center gap-x-4 text-xs", onClick: () => t(s), children: [
|
|
189
194
|
/* @__PURE__ */ e.jsx(ge, {}),
|
|
190
195
|
" Cut"
|
|
191
196
|
] });
|
|
192
197
|
}, cs = () => {
|
|
193
|
-
const [s] = g(), [, t] =
|
|
198
|
+
const [s] = g(), [, t] = Ne();
|
|
194
199
|
return /* @__PURE__ */ e.jsxs(d, { className: "flex items-center gap-x-4 text-xs", onClick: () => t(s), children: [
|
|
195
200
|
/* @__PURE__ */ e.jsx(je, {}),
|
|
196
201
|
" Copy"
|
|
197
202
|
] });
|
|
198
|
-
},
|
|
199
|
-
const [s] = g(), t = Me(),
|
|
203
|
+
}, ls = () => {
|
|
204
|
+
const [s] = g(), t = Me(), o = Oe();
|
|
200
205
|
return /* @__PURE__ */ e.jsxs(
|
|
201
206
|
d,
|
|
202
207
|
{
|
|
203
|
-
disabled: (
|
|
208
|
+
disabled: (o == null ? void 0 : o._type) === "Slot",
|
|
204
209
|
className: "flex items-center gap-x-4 text-xs",
|
|
205
210
|
onClick: () => t(s),
|
|
206
211
|
children: [
|
|
@@ -209,14 +214,14 @@ const es = (s) => {
|
|
|
209
214
|
]
|
|
210
215
|
}
|
|
211
216
|
);
|
|
212
|
-
},
|
|
217
|
+
}, is = ({
|
|
213
218
|
id: s = null,
|
|
214
219
|
openMarkAsGlobalModal: t
|
|
215
220
|
}) => {
|
|
216
|
-
const [
|
|
217
|
-
r(
|
|
218
|
-
}, [
|
|
219
|
-
return /* @__PURE__ */ e.jsxs(
|
|
221
|
+
const [o] = g(), r = Se(), { pasteBlocks: a, canPaste: c } = De(), l = D("globalBlocksSupport", !1), x = S(() => {
|
|
222
|
+
r(o);
|
|
223
|
+
}, [o, r]);
|
|
224
|
+
return /* @__PURE__ */ e.jsxs(Xe, { className: "text-xs", children: [
|
|
220
225
|
l && /* @__PURE__ */ e.jsx(d, { className: "flex items-center gap-x-4 border-b text-xs", onClick: t, children: /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-x-4", children: [
|
|
221
226
|
/* @__PURE__ */ e.jsx(ue, {}),
|
|
222
227
|
" Mark as global"
|
|
@@ -225,89 +230,89 @@ const es = (s) => {
|
|
|
225
230
|
/* @__PURE__ */ e.jsx(me, {}),
|
|
226
231
|
" Duplicate"
|
|
227
232
|
] }),
|
|
228
|
-
/* @__PURE__ */ e.jsx(
|
|
233
|
+
/* @__PURE__ */ e.jsx(as, {}),
|
|
229
234
|
/* @__PURE__ */ e.jsx(cs, {}),
|
|
230
235
|
/* @__PURE__ */ e.jsxs(
|
|
231
236
|
d,
|
|
232
237
|
{
|
|
233
238
|
className: "flex items-center gap-x-4 text-xs",
|
|
234
|
-
onClick: () =>
|
|
235
|
-
disabled: !
|
|
239
|
+
onClick: () => a(s),
|
|
240
|
+
disabled: !c,
|
|
236
241
|
children: [
|
|
237
242
|
/* @__PURE__ */ e.jsx(pe, {}),
|
|
238
243
|
" Paste"
|
|
239
244
|
]
|
|
240
245
|
}
|
|
241
246
|
),
|
|
242
|
-
/* @__PURE__ */ e.jsx(
|
|
247
|
+
/* @__PURE__ */ e.jsx(ls, {})
|
|
243
248
|
] });
|
|
244
|
-
},
|
|
245
|
-
const [
|
|
249
|
+
}, ds = ({ children: s, id: t = null }) => {
|
|
250
|
+
const [o, r] = $e(!1);
|
|
246
251
|
return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
247
|
-
/* @__PURE__ */ e.jsx(
|
|
248
|
-
/* @__PURE__ */ e.jsxs(
|
|
249
|
-
/* @__PURE__ */ e.jsx(
|
|
250
|
-
/* @__PURE__ */ e.jsx(
|
|
252
|
+
/* @__PURE__ */ e.jsx(qe, { open: o, onOpenChange: r, children: o && /* @__PURE__ */ e.jsx(Qe, { children: /* @__PURE__ */ e.jsx(Ke, { fallback: /* @__PURE__ */ e.jsx("div", { className: "h-96 w-full animate-pulse bg-gray-200" }), children: /* @__PURE__ */ e.jsx(rs, { closeModal: () => r(!1), id: t }) }) }) }),
|
|
253
|
+
/* @__PURE__ */ e.jsxs(Ue, { children: [
|
|
254
|
+
/* @__PURE__ */ e.jsx(We, { children: s }),
|
|
255
|
+
/* @__PURE__ */ e.jsx(is, { id: t, openMarkAsGlobalModal: () => r(!0) })
|
|
251
256
|
] })
|
|
252
257
|
] });
|
|
253
|
-
},
|
|
254
|
-
const { addCoreBlock: s } = Re(), t =
|
|
258
|
+
}, xs = () => {
|
|
259
|
+
const { addCoreBlock: s } = Re(), t = D("getExternalPredefinedBlock");
|
|
255
260
|
return S(
|
|
256
|
-
async (
|
|
257
|
-
const { block: r, dropTargetId:
|
|
258
|
-
if (
|
|
261
|
+
async (o) => {
|
|
262
|
+
const { block: r, dropTargetId: a, relativeIndex: c } = o;
|
|
263
|
+
if (H(r, "format")) {
|
|
259
264
|
const l = await t(r);
|
|
260
|
-
return s({ blocks: l },
|
|
265
|
+
return s({ blocks: l }, a === 0 ? null : a, c);
|
|
261
266
|
}
|
|
262
|
-
return s(r,
|
|
267
|
+
return s(r, a === 0 ? null : a, c);
|
|
263
268
|
},
|
|
264
269
|
[s]
|
|
265
270
|
);
|
|
266
271
|
};
|
|
267
|
-
function
|
|
272
|
+
function us(s) {
|
|
268
273
|
return v(s, (t) => {
|
|
269
|
-
const { data:
|
|
274
|
+
const { data: o } = t;
|
|
270
275
|
return {
|
|
271
|
-
...
|
|
276
|
+
...o,
|
|
272
277
|
_parent: t.parent === 0 ? null : t.parent
|
|
273
278
|
};
|
|
274
279
|
});
|
|
275
280
|
}
|
|
276
|
-
const
|
|
277
|
-
const s = Ee(), [t] = Ae(), [
|
|
278
|
-
const { dragSource: f, destinationIndex: I, relativeIndex: b, dropTargetId: E, monitor: A } = p, _ =
|
|
281
|
+
const Xs = () => {
|
|
282
|
+
const s = Ee(), [t] = Ae(), [o, r, a] = g(), [, c] = _e(), { t: l } = Ce(), { createSnapshot: x } = Pe(), j = He(), u = xs(), [, m] = Ze(Le), i = async (n, p) => {
|
|
283
|
+
const { dragSource: f, destinationIndex: I, relativeIndex: b, dropTargetId: E, monitor: A } = p, _ = us(n);
|
|
279
284
|
t(_), f ? x() : (await u({
|
|
280
285
|
block: A.getItem(),
|
|
281
286
|
dropTargetId: E,
|
|
282
287
|
destinationIndex: I,
|
|
283
288
|
relativeIndex: b
|
|
284
289
|
}), m(!1));
|
|
285
|
-
},
|
|
286
|
-
id:
|
|
287
|
-
text:
|
|
288
|
-
parent:
|
|
289
|
-
droppable: !L(V(s, { _parent:
|
|
290
|
-
data:
|
|
290
|
+
}, N = v(s, (n) => ({
|
|
291
|
+
id: n._id,
|
|
292
|
+
text: n._type,
|
|
293
|
+
parent: n._parent || 0,
|
|
294
|
+
droppable: !L(V(s, { _parent: n._id })),
|
|
295
|
+
data: n
|
|
291
296
|
})), M = () => {
|
|
292
|
-
r([]),
|
|
297
|
+
r([]), c([]);
|
|
293
298
|
}, [{ isOver: h }, O] = be(() => ({
|
|
294
299
|
accept: ["CHAI_BLOCK"],
|
|
295
|
-
collect: (
|
|
296
|
-
canDrop:
|
|
297
|
-
isOver:
|
|
300
|
+
collect: (n) => ({
|
|
301
|
+
canDrop: n.canDrop(),
|
|
302
|
+
isOver: n.isOver()
|
|
298
303
|
}),
|
|
299
|
-
drop: (
|
|
304
|
+
drop: (n) => {
|
|
300
305
|
(async () => (await u({
|
|
301
|
-
block:
|
|
306
|
+
block: n,
|
|
302
307
|
dropTargetId: "",
|
|
303
308
|
destinationIndex: 0,
|
|
304
309
|
relativeIndex: 0
|
|
305
310
|
}), m(!1)))();
|
|
306
311
|
}
|
|
307
|
-
})), { isDragging: R } = ke((
|
|
308
|
-
isDragging:
|
|
312
|
+
})), { isDragging: R } = ke((n) => ({
|
|
313
|
+
isDragging: n.isDragging()
|
|
309
314
|
}));
|
|
310
|
-
return /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.
|
|
315
|
+
return /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsx(
|
|
311
316
|
"div",
|
|
312
317
|
{
|
|
313
318
|
onClick: () => M(),
|
|
@@ -315,59 +320,56 @@ const qs = () => {
|
|
|
315
320
|
"-mx-1 -mt-1 flex h-full select-none flex-col space-y-1",
|
|
316
321
|
R ? "bg-green-50/80" : "bg-background"
|
|
317
322
|
),
|
|
318
|
-
children:
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
{
|
|
323
|
-
|
|
324
|
-
className:
|
|
325
|
-
children:
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
}
|
|
366
|
-
) })
|
|
367
|
-
]
|
|
323
|
+
children: z(s) ? /* @__PURE__ */ e.jsxs(
|
|
324
|
+
"div",
|
|
325
|
+
{
|
|
326
|
+
ref: O,
|
|
327
|
+
className: `mx-1 mt-4 h-full p-6 text-center text-sm text-gray-400 ${h ? "bg-blue-200" : ""}`,
|
|
328
|
+
children: [
|
|
329
|
+
h ? /* @__PURE__ */ e.jsx(fe, { className: "mx-auto h-12 w-12 animate-bounce" }) : /* @__PURE__ */ e.jsx(Ie, { className: "mx-auto h-10 w-10" }),
|
|
330
|
+
/* @__PURE__ */ e.jsx("p", { className: "mt-2", children: l(h ? "drop_here_message" : "tree_view_no_blocks") })
|
|
331
|
+
]
|
|
332
|
+
}
|
|
333
|
+
) : /* @__PURE__ */ e.jsx(Je, { id: "layers-view", className: "no-scrollbar h-full overflow-y-auto p-1", children: /* @__PURE__ */ e.jsx(
|
|
334
|
+
ye,
|
|
335
|
+
{
|
|
336
|
+
initialOpen: j,
|
|
337
|
+
extraAcceptTypes: ["CHAI_BLOCK"],
|
|
338
|
+
tree: N,
|
|
339
|
+
rootId: 0,
|
|
340
|
+
render: (n, { depth: p, isOpen: f, onToggle: I }) => /* @__PURE__ */ e.jsx(ds, { id: n.id, children: /* @__PURE__ */ e.jsx(
|
|
341
|
+
ts,
|
|
342
|
+
{
|
|
343
|
+
onSelect: (b) => {
|
|
344
|
+
c([]), r([b]);
|
|
345
|
+
},
|
|
346
|
+
isSelected: F(o, n.id),
|
|
347
|
+
node: n,
|
|
348
|
+
depth: p,
|
|
349
|
+
isOpen: f,
|
|
350
|
+
onToggle: I,
|
|
351
|
+
toggleIds: a
|
|
352
|
+
}
|
|
353
|
+
) }),
|
|
354
|
+
dragPreviewRender: (n) => /* @__PURE__ */ e.jsx(os, { monitorProps: n }),
|
|
355
|
+
onDrop: i,
|
|
356
|
+
classes: {
|
|
357
|
+
root: "h-full pt-2",
|
|
358
|
+
draggingSource: "opacity-30",
|
|
359
|
+
dropTarget: "bg-green-100",
|
|
360
|
+
placeholder: "relative"
|
|
361
|
+
},
|
|
362
|
+
sort: !1,
|
|
363
|
+
insertDroppableFirst: !1,
|
|
364
|
+
canDrop: Ve,
|
|
365
|
+
dropTargetOffset: 2,
|
|
366
|
+
enableAnimateExpand: !0,
|
|
367
|
+
placeholderRender: (n, { depth: p }) => /* @__PURE__ */ e.jsx(ns, { node: n, depth: p })
|
|
368
|
+
}
|
|
369
|
+
) })
|
|
368
370
|
}
|
|
369
371
|
) });
|
|
370
372
|
};
|
|
371
373
|
export {
|
|
372
|
-
|
|
374
|
+
Xs as default
|
|
373
375
|
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { j as l } from "./jsx-runtime-944c88e2.js";
|
|
2
2
|
import { GlobeIcon as m } from "@radix-ui/react-icons";
|
|
3
3
|
import { useState as n } from "react";
|
|
4
|
-
import { B as
|
|
5
|
-
import {
|
|
4
|
+
import { B as e } from "./useBuilderProp-81a14920.js";
|
|
5
|
+
import { a1 as c } from "./index-ca7c3430.js";
|
|
6
6
|
import "react-i18next";
|
|
7
7
|
import { capitalize as p } from "lodash";
|
|
8
8
|
import "@radix-ui/react-slot";
|
|
@@ -13,6 +13,10 @@ import "tailwind-merge";
|
|
|
13
13
|
import "@radix-ui/react-tooltip";
|
|
14
14
|
import "@radix-ui/react-toast";
|
|
15
15
|
import "jotai";
|
|
16
|
+
import "./_commonjsHelpers-10dfc225.js";
|
|
17
|
+
import "@radix-ui/react-scroll-area";
|
|
18
|
+
import "react-dom";
|
|
19
|
+
import "@floating-ui/react-dom";
|
|
16
20
|
import "i18next";
|
|
17
21
|
import "flagged";
|
|
18
22
|
import "react-dnd";
|
|
@@ -27,8 +31,8 @@ import "@react-hookz/web";
|
|
|
27
31
|
import "@chaibuilder/blocks";
|
|
28
32
|
import "lucide-react";
|
|
29
33
|
import "sonner";
|
|
30
|
-
const
|
|
31
|
-
const
|
|
34
|
+
const T = ({ id: o = null, closeModal: i }) => {
|
|
35
|
+
const r = c(), [t, a] = n("");
|
|
32
36
|
return /* @__PURE__ */ l.jsxs(l.Fragment, { children: [
|
|
33
37
|
/* @__PURE__ */ l.jsx("h1", { className: "text-lg font-bold", children: "Mark as Global" }),
|
|
34
38
|
/* @__PURE__ */ l.jsxs("div", { className: "py-2 text-sm", children: [
|
|
@@ -50,27 +54,27 @@ const K = ({ id: o = null, closeModal: t }) => {
|
|
|
50
54
|
{
|
|
51
55
|
placeholder: "Eg: Header, Footer ",
|
|
52
56
|
className: "mt-2 w-full",
|
|
53
|
-
value:
|
|
54
|
-
onChange: (
|
|
57
|
+
value: t,
|
|
58
|
+
onChange: (s) => a(s.target.value)
|
|
55
59
|
}
|
|
56
60
|
)
|
|
57
61
|
] }),
|
|
58
62
|
/* @__PURE__ */ l.jsxs("div", { className: "flex items-center justify-end gap-x-4", children: [
|
|
59
63
|
/* @__PURE__ */ l.jsx(
|
|
60
|
-
|
|
64
|
+
e,
|
|
61
65
|
{
|
|
62
66
|
onClick: () => {
|
|
63
|
-
|
|
67
|
+
r(o, p(t)), i();
|
|
64
68
|
},
|
|
65
|
-
disabled:
|
|
69
|
+
disabled: t.length <= 2,
|
|
66
70
|
variant: "default",
|
|
67
71
|
children: "Mark as Global"
|
|
68
72
|
}
|
|
69
73
|
),
|
|
70
|
-
/* @__PURE__ */ l.jsx(
|
|
74
|
+
/* @__PURE__ */ l.jsx(e, { variant: "outline", onClick: i, children: "Cancel" })
|
|
71
75
|
] })
|
|
72
76
|
] });
|
|
73
77
|
};
|
|
74
78
|
export {
|
|
75
|
-
|
|
79
|
+
T as default
|
|
76
80
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-5c3ac4f7.cjs"),u=require("@radix-ui/react-icons"),o=require("react"),i=require("./useBuilderProp-5e57d0c8.cjs"),c=require("./index-976ec896.cjs");require("react-i18next");const x=require("lodash");require("@radix-ui/react-slot");require("class-variance-authority");require("./utils-3c452dd0.cjs");require("clsx");require("tailwind-merge");require("@radix-ui/react-tooltip");require("@radix-ui/react-toast");require("jotai");require("./_commonjsHelpers-87b0abe8.cjs");require("@radix-ui/react-scroll-area");require("react-dom");require("@floating-ui/react-dom");require("i18next");require("flagged");require("react-dnd");require("@minoru/react-dnd-treeview");require("react-hotkeys-hook");require("flat-to-nested");require("./html-to-json-78bfa1f3.cjs");require("./MODIFIERS-70fef873.cjs");require("himalaya");require("redux-undo");require("@react-hookz/web");require("@chaibuilder/blocks");require("lucide-react");require("sonner");const m=({id:t=null,closeModal:s})=>{const l=c.useMarkAsGlobalBlock(),[r,a]=o.useState("");return e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx("h1",{className:"text-lg font-bold",children:"Mark as Global"}),e.jsxRuntimeExports.jsxs("div",{className:"py-2 text-sm",children:["Note: Global blocks are single instances. Editing global blocks will be reflected on all pages using these blocks. ",e.jsxRuntimeExports.jsx("br",{}),e.jsxRuntimeExports.jsxs("ul",{className:"mt-4 list-inside list-disc space-y-1",children:[e.jsxRuntimeExports.jsxs("li",{children:["Global blocks are indicated with ",e.jsxRuntimeExports.jsx(u.GlobeIcon,{className:"inline"})," icon in left sidebar"]}),e.jsxRuntimeExports.jsx("li",{children:'Global blocks are available under "Global" category'})]})]}),e.jsxRuntimeExports.jsxs("div",{className:"my-4",children:[e.jsxRuntimeExports.jsx("label",{className:"block text-sm font-medium text-gray-400",children:"Enter global block name"}),e.jsxRuntimeExports.jsx("input",{placeholder:"Eg: Header, Footer ",className:"mt-2 w-full",value:r,onChange:n=>a(n.target.value)})]}),e.jsxRuntimeExports.jsxs("div",{className:"flex items-center justify-end gap-x-4",children:[e.jsxRuntimeExports.jsx(i.Button,{onClick:()=>{l(t,x.capitalize(r)),s()},disabled:r.length<=2,variant:"default",children:"Mark as Global"}),e.jsxRuntimeExports.jsx(i.Button,{variant:"outline",onClick:s,children:"Cancel"})]})]})};exports.default=m;
|
|
@@ -1,7 +1,13 @@
|
|
|
1
1
|
import { j as t } from "./jsx-runtime-944c88e2.js";
|
|
2
|
-
import
|
|
2
|
+
import i, { Suspense as p } from "react";
|
|
3
3
|
import { sortBy as a, filter as d, get as n } from "lodash";
|
|
4
|
-
import {
|
|
4
|
+
import { Q as l, R as c } from "./index-ca7c3430.js";
|
|
5
|
+
import "./_commonjsHelpers-10dfc225.js";
|
|
6
|
+
import "clsx";
|
|
7
|
+
import "@radix-ui/react-scroll-area";
|
|
8
|
+
import "react-dom";
|
|
9
|
+
import "@floating-ui/react-dom";
|
|
10
|
+
import "jotai";
|
|
5
11
|
import "i18next";
|
|
6
12
|
import "react-i18next";
|
|
7
13
|
import "flagged";
|
|
@@ -11,12 +17,10 @@ import "./useBuilderProp-81a14920.js";
|
|
|
11
17
|
import "@radix-ui/react-slot";
|
|
12
18
|
import "class-variance-authority";
|
|
13
19
|
import "./utils-ac68b2c8.js";
|
|
14
|
-
import "clsx";
|
|
15
20
|
import "tailwind-merge";
|
|
16
21
|
import "@radix-ui/react-tooltip";
|
|
17
22
|
import "@radix-ui/react-icons";
|
|
18
23
|
import "@radix-ui/react-toast";
|
|
19
|
-
import "jotai";
|
|
20
24
|
import "react-hotkeys-hook";
|
|
21
25
|
import "flat-to-nested";
|
|
22
26
|
import "./html-to-json-8397fab5.js";
|
|
@@ -27,17 +31,17 @@ import "@react-hookz/web";
|
|
|
27
31
|
import "@chaibuilder/blocks";
|
|
28
32
|
import "lucide-react";
|
|
29
33
|
import "sonner";
|
|
30
|
-
const x =
|
|
31
|
-
const { data:
|
|
34
|
+
const x = i.lazy(() => import("./add-page-modal-da3e0ad5.js")), g = i.lazy(() => import("./page-viewer-3e7a6d70.js")), U = () => {
|
|
35
|
+
const { data: o = [], isLoading: e } = l(), { data: r } = c(), m = a(d(o, { type: "STATIC" }), (s) => n(s, "uuid") === (r == null ? void 0 : r.homepage) ? 0 : 1);
|
|
32
36
|
return /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
|
|
33
37
|
/* @__PURE__ */ t.jsxs("div", { className: "flex items-center justify-between rounded-md bg-background/30 p-1", children: [
|
|
34
38
|
/* @__PURE__ */ t.jsx("h1", { className: "px-1 font-semibold", children: "Pages" }),
|
|
35
39
|
/* @__PURE__ */ t.jsx(p, { fallback: /* @__PURE__ */ t.jsx("div", { className: "text-sm text-blue-500 underline", children: "+ New Page" }), children: /* @__PURE__ */ t.jsx(x, {}) })
|
|
36
40
|
] }),
|
|
37
41
|
/* @__PURE__ */ t.jsx("hr", { className: "-mx-1" }),
|
|
38
|
-
/* @__PURE__ */ t.jsx("div", { className: "-mx-1 divide-y-2", children: /* @__PURE__ */ t.jsx(g, { isLoading:
|
|
42
|
+
/* @__PURE__ */ t.jsx("div", { className: "-mx-1 divide-y-2", children: /* @__PURE__ */ t.jsx(g, { isLoading: e, pages: m }) })
|
|
39
43
|
] });
|
|
40
44
|
};
|
|
41
45
|
export {
|
|
42
|
-
|
|
46
|
+
U as default
|
|
43
47
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-5c3ac4f7.cjs"),i=require("react"),s=require("lodash"),u=require("./index-976ec896.cjs");require("./_commonjsHelpers-87b0abe8.cjs");require("clsx");require("@radix-ui/react-scroll-area");require("react-dom");require("@floating-ui/react-dom");require("jotai");require("i18next");require("react-i18next");require("flagged");require("react-dnd");require("@minoru/react-dnd-treeview");require("./useBuilderProp-5e57d0c8.cjs");require("@radix-ui/react-slot");require("class-variance-authority");require("./utils-3c452dd0.cjs");require("tailwind-merge");require("@radix-ui/react-tooltip");require("@radix-ui/react-icons");require("@radix-ui/react-toast");require("react-hotkeys-hook");require("flat-to-nested");require("./html-to-json-78bfa1f3.cjs");require("./MODIFIERS-70fef873.cjs");require("himalaya");require("redux-undo");require("@react-hookz/web");require("@chaibuilder/blocks");require("lucide-react");require("sonner");const x=i.lazy(()=>Promise.resolve().then(()=>require("./add-page-modal-f49ebaf3.cjs"))),q=i.lazy(()=>Promise.resolve().then(()=>require("./page-viewer-5f00c933.cjs"))),c=()=>{const{data:t=[],isLoading:n}=u.usePages(),{data:r}=u.useProject(),o=s.sortBy(s.filter(t,{type:"STATIC"}),a=>s.get(a,"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(i.Suspense,{fallback:e.jsxRuntimeExports.jsx("div",{className:"text-sm text-blue-500 underline",children:"+ New Page"}),children:e.jsxRuntimeExports.jsx(x,{})})]}),e.jsxRuntimeExports.jsx("hr",{className:"-mx-1"}),e.jsxRuntimeExports.jsx("div",{className:"-mx-1 divide-y-2",children:e.jsxRuntimeExports.jsx(q,{isLoading:n,pages:o})})]})};exports.default=c;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-5c3ac4f7.cjs"),r=require("react"),x=require("lodash"),s=require("./accordion-0afd8143.cjs"),a=require("./index-976ec896.cjs");require("@radix-ui/react-accordion");require("@radix-ui/react-icons");require("./utils-3c452dd0.cjs");require("clsx");require("tailwind-merge");require("./_commonjsHelpers-87b0abe8.cjs");require("@radix-ui/react-scroll-area");require("react-dom");require("@floating-ui/react-dom");require("jotai");require("i18next");require("react-i18next");require("flagged");require("react-dnd");require("@minoru/react-dnd-treeview");require("./useBuilderProp-5e57d0c8.cjs");require("@radix-ui/react-slot");require("class-variance-authority");require("@radix-ui/react-tooltip");require("@radix-ui/react-toast");require("react-hotkeys-hook");require("flat-to-nested");require("./html-to-json-78bfa1f3.cjs");require("./MODIFIERS-70fef873.cjs");require("himalaya");require("redux-undo");require("@react-hookz/web");require("@chaibuilder/blocks");require("lucide-react");require("sonner");const d=r.lazy(()=>Promise.resolve().then(()=>require("./project-general-setting-a23cc2c4.cjs"))),m=r.lazy(()=>Promise.resolve().then(()=>require("./project-seo-setting-a9403f1d.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 j(){const t=a.useUpdateProject(),{data:u}=a.useProject(),[i,o]=r.useState(l(u||{})),n=r.useRef(i);return r.useEffect(()=>()=>{x.isEqual(u,n.current)||t.mutate(n.current,{onSuccess:()=>o(n.current)})},[n]),r.useEffect(()=>{n.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(m,{_projectData:i,seany:o})})})]})]})})]})}exports.default=j;
|