@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.
- package/README.md +10 -12
- package/dist/AddBlocks-TSt8uJY4.js +218 -0
- package/dist/AddBlocks-k2p8Hy1n.cjs +1 -0
- package/dist/BrandingOptions-WyVWfFVz.cjs +1 -0
- package/dist/{BrandingOptions-QJJ1y5ez.js → BrandingOptions-uFTyYJZj.js} +18 -22
- package/dist/CanvasArea-5erOZYLy.cjs +60 -0
- package/dist/{CanvasArea-mlNKmCOh.js → CanvasArea-iRQqpOak.js} +465 -481
- package/dist/{utils-AvyFzbPC.js → Class-17XFhL48.js} +15 -16
- package/dist/Class-5ARpH_Tu.cjs +1 -0
- package/dist/CurrentPage-NzmJloN7.cjs +1 -0
- package/dist/{CurrentPage-lBy25sZn.js → CurrentPage-RCxTz9Mc.js} +24 -26
- package/dist/{Layers-3Xs4A5i8.js → Layers-tXB5Pwid.js} +124 -158
- package/dist/Layers-xDG7oltg.cjs +1 -0
- package/dist/PagesPanel-72nzYB1k.cjs +1 -0
- package/dist/{PagesPanel--BZhafnt.js → PagesPanel-Jaz9jvye.js} +14 -16
- package/dist/{ProjectPanel-YcLkM-DW.js → ProjectPanel--S014Xx3.js} +22 -24
- package/dist/ProjectPanel-RU0QvH6e.cjs +1 -0
- package/dist/Settings-5EuwaVb3.cjs +1 -0
- package/dist/{Settings-TAgX4hov.js → Settings-gjvl5V1k.js} +556 -579
- package/dist/{SidePanels-btVQQkVK.js → SidePanels-Fq3kRwR0.js} +54 -51
- package/dist/SidePanels-uNCxnGte.cjs +1 -0
- package/dist/Topbar-JqW89xI5.cjs +1 -0
- package/dist/{Topbar-j4t4AgCq.js → Topbar-m5dbbI1f.js} +15 -17
- package/dist/{UnsplashImages-41Y3q5_Q.js → UnsplashImages-GhBD6owT.js} +24 -26
- package/dist/UnsplashImages-vACw5hbK.cjs +1 -0
- package/dist/UploadImages-PzHdEKHT.cjs +1 -0
- package/dist/{UploadImages-xBg-kbKv.js → UploadImages-S1HgxeGb.js} +23 -25
- package/dist/{add-page-modal-cm8damU2.js → add-page-modal-2P5hGXOQ.js} +15 -17
- package/dist/add-page-modal-GAizM2Jw.cjs +1 -0
- package/dist/{confirm-alert-i4pM3mOt.js → confirm-alert-57Xq5foA.js} +12 -14
- package/dist/confirm-alert-Uf84DpdR.cjs +1 -0
- package/dist/core.cjs +1 -1
- package/dist/core.d.ts +13 -58
- package/dist/core.js +47 -58
- package/dist/defaultTheme-IH19g4fv.cjs +1 -0
- package/dist/defaultTheme-YY8mlQS3.js +1055 -0
- package/dist/delete-page-modal-MG42FdnU.cjs +1 -0
- package/dist/{delete-page-modal-YrIBvfFA.js → delete-page-modal-ix5IjaFW.js} +27 -29
- package/dist/email-blocks.cjs +1 -1
- package/dist/email-blocks.js +100 -81
- package/dist/email.cjs +1 -0
- package/dist/email.d.ts +116 -0
- package/dist/email.js +79 -0
- package/dist/{controls-XPXGHKht.js → empty-slot-MWycClTb.js} +61 -50
- package/dist/empty-slot-TF2kd-0X.cjs +1 -0
- package/dist/{form-VbouZlAW.cjs → form-KBb3kA8g.cjs} +1 -1
- package/dist/{form-OVmsLOrc.js → form-SYcFyACJ.js} +18 -18
- package/dist/{index-pZhGT8uT.js → index-Fj3ead-J.js} +4886 -4884
- package/dist/index-aiHDvS5v.cjs +1 -0
- package/dist/{index-N50dZnlC.cjs → index-cM3eKmlx.cjs} +25 -25
- package/dist/index-pNYv0oAF.js +2994 -0
- package/dist/lib.cjs +3 -3
- package/dist/lib.js +95 -1125
- package/dist/page-viewer-Sh99FGYk.cjs +1 -0
- package/dist/{page-viewer-feqJr1QI.js → page-viewer-VxqOevr4.js} +15 -17
- package/dist/project-general-setting-VTLHa-Ik.cjs +1 -0
- package/dist/{project-general-setting-SgagORzW.js → project-general-setting-nWOjPiin.js} +15 -17
- package/dist/{project-seo-setting-wxAGEkd_.js → project-seo-setting-70bWTwsB.js} +17 -19
- package/dist/project-seo-setting-ENAKc2Dl.cjs +1 -0
- package/dist/render.cjs +1 -1
- package/dist/render.d.ts +2 -0
- package/dist/render.js +111 -70
- package/dist/{single-page-detail-dnWMyg6P.js → single-page-detail-3z7TF-Yy.js} +44 -46
- package/dist/single-page-detail-6L38HJC4.cjs +1 -0
- package/dist/studio.cjs +1 -1
- package/dist/studio.js +13 -15
- package/dist/ui.cjs +1 -1
- package/dist/ui.d.ts +4 -4
- package/dist/ui.js +149 -151
- package/dist/{useAddBlockByDrop-inkD7Lck.cjs → useAddBlockByDrop-7mUMwNSG.cjs} +1 -1
- package/dist/{useAddBlockByDrop-_nwI4W3q.js → useAddBlockByDrop-tjQ5DgiO.js} +1 -1
- package/dist/web-blocks.cjs +1 -9
- package/dist/web-blocks.js +431 -442
- package/package.json +8 -2
- package/dist/AddBlocks-tMxKPoen.js +0 -225
- package/dist/AddBlocks-x2LkOHSj.cjs +0 -1
- package/dist/BrandingOptions-EzT9UYd6.cjs +0 -1
- package/dist/CanvasArea-xs4wM64L.cjs +0 -60
- package/dist/CurrentPage-aaU4F7wi.cjs +0 -1
- package/dist/Layers-eaHy5PK9.cjs +0 -1
- package/dist/MarkAsGlobalBlock-BjP-Rqlf.js +0 -88
- package/dist/MarkAsGlobalBlock-X5dNmZcb.cjs +0 -1
- package/dist/PagesPanel-gGKCV394.cjs +0 -1
- package/dist/ProjectPanel-yFJRy0_E.cjs +0 -1
- package/dist/Settings-7wlLcvoh.cjs +0 -1
- package/dist/SidePanels-5H4j0mIs.cjs +0 -1
- package/dist/Topbar-V8xCetWF.cjs +0 -1
- package/dist/UnsplashImages-DbHky6cj.cjs +0 -1
- package/dist/UploadImages-DnQ95_NW.cjs +0 -1
- package/dist/add-page-modal-MwS7iXn_.cjs +0 -1
- package/dist/confirm-alert-U7-NcG7G.cjs +0 -1
- package/dist/controls-Dy1qa8Dc.cjs +0 -1
- package/dist/delete-page-modal-5o4jXu-z.cjs +0 -1
- package/dist/functions-Ox_svtKm.cjs +0 -1
- package/dist/functions-xIebp8Aw.js +0 -23
- package/dist/index-H6vIwGfD.cjs +0 -1
- package/dist/index-niHREMmR.js +0 -2938
- package/dist/page-viewer-SLt8XgYv.cjs +0 -1
- package/dist/project-general-setting-ym0yCdOq.cjs +0 -1
- package/dist/project-seo-setting-Snn2nZgS.cjs +0 -1
- package/dist/single-page-detail-IPod1o5P.cjs +0 -1
- 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
|
|
3
|
-
import { BoxModelIcon as
|
|
4
|
-
import { useDrop as
|
|
5
|
-
import { useDragOver as
|
|
6
|
-
import { useTranslation as
|
|
7
|
-
import {
|
|
8
|
-
import { DatabaseIcon as
|
|
9
|
-
import { useMemo as
|
|
10
|
-
import { a as
|
|
11
|
-
import { c as
|
|
12
|
-
import { f as
|
|
13
|
-
import { u as
|
|
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 "./
|
|
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 "./
|
|
57
|
-
const
|
|
54
|
+
import "./empty-slot-MWycClTb.js";
|
|
55
|
+
const R = (t) => {
|
|
58
56
|
switch (t.type) {
|
|
59
57
|
case "Image":
|
|
60
|
-
return /* @__PURE__ */ e.jsx(
|
|
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(
|
|
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(
|
|
105
|
+
return /* @__PURE__ */ e.jsx(U, {});
|
|
108
106
|
case "TableRow":
|
|
109
|
-
return /* @__PURE__ */ e.jsx(
|
|
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(
|
|
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(
|
|
115
|
+
return /* @__PURE__ */ e.jsx($, {});
|
|
118
116
|
}
|
|
119
117
|
};
|
|
120
|
-
function
|
|
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 (
|
|
139
|
-
return `Visible >=${s[
|
|
136
|
+
if (k(c, 1))
|
|
137
|
+
return `Visible >=${s[k(c, 1)]}`;
|
|
140
138
|
}
|
|
141
139
|
return "";
|
|
142
140
|
}
|
|
143
|
-
const
|
|
141
|
+
const Ve = (t) => {
|
|
144
142
|
let s = "";
|
|
145
143
|
return Object.keys(t).forEach((o) => {
|
|
146
|
-
|
|
144
|
+
L(t[o], He) && (s = t[o]);
|
|
147
145
|
}), s;
|
|
148
|
-
},
|
|
149
|
-
var
|
|
150
|
-
const [, s] =
|
|
151
|
-
|
|
152
|
-
},
|
|
153
|
-
const
|
|
154
|
-
return
|
|
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:
|
|
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: (
|
|
167
|
-
|
|
164
|
+
onClick: (i) => {
|
|
165
|
+
i.stopPropagation(), !o.includes(a) && t.onSelect(a);
|
|
168
166
|
},
|
|
169
167
|
onContextMenu: () => t.onSelect(a),
|
|
170
|
-
style: { paddingInlineStart:
|
|
171
|
-
...
|
|
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:
|
|
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(
|
|
182
|
-
/* @__PURE__ */ e.jsx("div", { className: "ml-2 truncate text-[11px]", children: ((
|
|
183
|
-
|
|
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
|
-
|
|
187
|
+
d,
|
|
190
188
|
")"
|
|
191
189
|
]
|
|
192
190
|
}
|
|
@@ -196,86 +194,55 @@ const Ze = (t) => {
|
|
|
196
194
|
}
|
|
197
195
|
)
|
|
198
196
|
);
|
|
199
|
-
},
|
|
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(
|
|
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
|
-
},
|
|
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
|
-
},
|
|
210
|
-
const [t] =
|
|
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
|
-
|
|
210
|
+
N,
|
|
225
211
|
{
|
|
226
|
-
disabled: (o == null ? void 0 : o._type)
|
|
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(
|
|
216
|
+
/* @__PURE__ */ e.jsx(xe, {}),
|
|
231
217
|
" Remove"
|
|
232
218
|
]
|
|
233
219
|
}
|
|
234
220
|
);
|
|
235
|
-
},
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
}
|
|
239
|
-
|
|
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
|
-
|
|
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:
|
|
258
|
-
disabled: !c,
|
|
231
|
+
onClick: r,
|
|
259
232
|
children: [
|
|
260
|
-
/* @__PURE__ */ e.jsx(
|
|
261
|
-
"
|
|
233
|
+
/* @__PURE__ */ e.jsx(de, {}),
|
|
234
|
+
" Duplicate"
|
|
262
235
|
]
|
|
263
236
|
}
|
|
264
237
|
),
|
|
265
|
-
/* @__PURE__ */ e.jsx(
|
|
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
|
-
|
|
278
|
-
|
|
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
|
|
287
|
-
const [t] =
|
|
288
|
-
return t ?
|
|
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:
|
|
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
|
-
)
|
|
271
|
+
) : null;
|
|
305
272
|
}
|
|
306
|
-
const
|
|
307
|
-
const t =
|
|
308
|
-
const { dragSource:
|
|
309
|
-
if (
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
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
|
|
317
|
-
},
|
|
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: !
|
|
287
|
+
droppable: !P(V(t, { _parent: n._id })),
|
|
322
288
|
data: n
|
|
323
|
-
})),
|
|
289
|
+
})), _ = () => {
|
|
324
290
|
r([]), c([]);
|
|
325
|
-
}, [{ isOver:
|
|
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
|
|
298
|
+
(async () => await x({
|
|
333
299
|
block: n,
|
|
334
300
|
dropTargetId: "",
|
|
335
301
|
relativeIndex: 0
|
|
336
302
|
}))();
|
|
337
303
|
}
|
|
338
|
-
})), { isDragging:
|
|
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: () =>
|
|
345
|
-
className:
|
|
310
|
+
onClick: () => _(),
|
|
311
|
+
className: I(
|
|
346
312
|
"-mx-1 -mt-1 flex h-full select-none flex-col space-y-1",
|
|
347
|
-
|
|
313
|
+
M ? "bg-green-50/80" : "bg-background"
|
|
348
314
|
),
|
|
349
|
-
children:
|
|
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 ${
|
|
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
|
-
|
|
356
|
-
/* @__PURE__ */ e.jsx("p", { className: "mt-2", children:
|
|
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(
|
|
360
|
-
/* @__PURE__ */ e.jsx(
|
|
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
|
-
|
|
328
|
+
he,
|
|
363
329
|
{
|
|
364
|
-
initialOpen:
|
|
330
|
+
initialOpen: g,
|
|
365
331
|
extraAcceptTypes: ["CHAI_BLOCK"],
|
|
366
|
-
tree:
|
|
332
|
+
tree: i,
|
|
367
333
|
rootId: 0,
|
|
368
|
-
render: (n, { depth:
|
|
369
|
-
|
|
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: (
|
|
372
|
-
c([]), r([
|
|
337
|
+
onSelect: (f) => {
|
|
338
|
+
c([]), r([f]);
|
|
373
339
|
},
|
|
374
340
|
isSelected: T(o, n.id),
|
|
375
341
|
node: n,
|
|
376
|
-
depth:
|
|
377
|
-
isOpen:
|
|
378
|
-
onToggle:
|
|
342
|
+
depth: l,
|
|
343
|
+
isOpen: h,
|
|
344
|
+
onToggle: b,
|
|
379
345
|
toggleIds: a
|
|
380
346
|
}
|
|
381
347
|
) }),
|
|
382
|
-
dragPreviewRender: (n) => /* @__PURE__ */ e.jsx(
|
|
383
|
-
onDrop:
|
|
348
|
+
dragPreviewRender: (n) => /* @__PURE__ */ e.jsx($e, { monitorProps: n }),
|
|
349
|
+
onDrop: m,
|
|
384
350
|
classes: {
|
|
385
|
-
root: "h-[90%] " + (
|
|
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:
|
|
358
|
+
canDrop: Re,
|
|
393
359
|
dropTargetOffset: 2,
|
|
394
360
|
enableAnimateExpand: !0,
|
|
395
|
-
placeholderRender: (n, { depth:
|
|
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
|
-
|
|
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-
|
|
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-
|
|
9
|
-
import "
|
|
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 "./
|
|
56
|
-
const x = i.lazy(() => import("./add-page-modal-
|
|
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
|
-
|
|
66
|
+
gt as default
|
|
69
67
|
};
|