@chaibuilder/sdk 1.2.19 → 1.2.21
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-157fSrJX.cjs +1 -0
- package/dist/{AddBlocks-gcTaEIKO.js → AddBlocks-WgpssWmQ.js} +25 -27
- package/dist/{BrandingOptions-bfiFY0VR.js → BrandingOptions-4961TxX2.js} +13 -15
- package/dist/BrandingOptions-nwXR9TMl.cjs +1 -0
- package/dist/CanvasArea-_BFTu_8b.js +908 -0
- package/dist/CanvasArea-eOKWgAXR.cjs +55 -0
- package/dist/{CurrentPage-0Ap2N0uc.js → CurrentPage-VAuh7F6E.js} +13 -16
- package/dist/CurrentPage-iB6nD9Rr.cjs +1 -0
- package/dist/ListTree-dvxHTXs4.js +167 -0
- package/dist/ListTree-gTmusfso.cjs +1 -0
- package/dist/Outline-g8XFGm2t.cjs +1 -0
- package/dist/Outline-jTFv40r5.js +294 -0
- package/dist/PagesPanel-Wx9JG5qR.cjs +1 -0
- package/dist/{PagesPanel-Pk-C1956.js → PagesPanel-oky0X1Ww.js} +5 -8
- package/dist/ProjectPanel-64Xg3Y_p.cjs +1 -0
- package/dist/{ProjectPanel-_KQBhuPO.js → ProjectPanel-WjVBiB-e.js} +15 -18
- package/dist/Settings-Tlqq4mqN.cjs +1 -0
- package/dist/{Settings-XtAatoiu.js → Settings-mNRbprbx.js} +761 -709
- package/dist/SidePanels-ZF4Q2R29.cjs +1 -0
- package/dist/{SidePanels-O52zKXbH.js → SidePanels-pQImwDI6.js} +7 -10
- package/dist/Topbar-NMvzqQHW.cjs +1 -0
- package/dist/{Topbar-oTx7a12r.js → Topbar-Ny9T-7Zb.js} +3 -5
- package/dist/TypeIcon-ElNNPazl.cjs +1 -0
- package/dist/TypeIcon-qO96rNbV.js +69 -0
- package/dist/UnsplashImages-6tZv1q2_.cjs +1 -0
- package/dist/{UnsplashImages-5A21uzMK.js → UnsplashImages-Y8RGFVSh.js} +13 -15
- package/dist/UploadImages-VLlVg9Ur.cjs +1 -0
- package/dist/{UploadImages-V_54lCAO.js → UploadImages-dd8LfyFr.js} +8 -10
- package/dist/{add-page-modal-dKQLw7RQ.js → add-page-modal-1mGGtAB_.js} +16 -19
- package/dist/add-page-modal-xCUKJiZv.cjs +1 -0
- package/dist/confirm-alert-f26zJ7Js.cjs +1 -0
- package/dist/{confirm-alert-8GP3bKH_.js → confirm-alert-sc8RaWvD.js} +3 -5
- package/dist/{controls-Dy1qa8Dc.cjs → controls-KK2oLIa8.cjs} +1 -1
- package/dist/{controls-XPXGHKht.js → controls-OfJWSEqC.js} +29 -28
- package/dist/core.cjs +1 -1
- package/dist/core.d.ts +1 -1
- package/dist/core.js +45 -48
- package/dist/delete-page-modal-Qa0YqBRl.cjs +1 -0
- package/dist/{delete-page-modal-Zb5ld6O-.js → delete-page-modal-yAJNstCa.js} +8 -11
- package/dist/email-blocks.cjs +1 -1
- package/dist/email-blocks.js +5 -5
- package/dist/email.cjs +1 -1
- package/dist/email.d.ts +1 -0
- package/dist/email.js +4 -7
- package/dist/{form-yyU2x7So.js → form-Nj6Kdn3g.js} +1 -1
- package/dist/{form-o6_55v8F.cjs → form-n1Q6u16z.cjs} +1 -1
- package/dist/index-9PHdn80L.cjs +1 -0
- package/dist/{index-JdnF6lYP.cjs → index-9YNkdni8.cjs} +51 -51
- package/dist/{index-WP7IRkij.js → index-IPJAbzzO.js} +1178 -1133
- package/dist/{index-BMZLAJUV.cjs → index-PlZjGTTr.cjs} +1 -1
- package/dist/{index-lFcrvDFC.js → index-iQEapw2W.js} +3 -3
- package/dist/{index-yILWlilS.js → index-kAjyc_KA.js} +8306 -8170
- package/dist/{page-viewer-3QXwPGpg.js → page-viewer-SU_BqZDK.js} +9 -12
- package/dist/page-viewer-ZA-sJD82.cjs +1 -0
- package/dist/project-general-setting-GuQyvAHS.cjs +1 -0
- package/dist/{project-general-setting-UalRmyHm.js → project-general-setting-eEmhoFvb.js} +7 -10
- package/dist/project-seo-setting-3-vBkx2v.cjs +1 -0
- package/dist/{project-seo-setting-8FsvPSPl.js → project-seo-setting-NNvAGt4T.js} +5 -7
- package/dist/single-page-detail-Z677SWqt.cjs +1 -0
- package/dist/{single-page-detail-GaB85dNv.js → single-page-detail-nxWIy6e7.js} +36 -39
- package/dist/studio.cjs +1 -1
- package/dist/studio.d.ts +1 -0
- package/dist/studio.js +4 -7
- package/dist/ui.cjs +1 -1
- package/dist/ui.js +138 -140
- package/dist/{useAddBlockByDrop-BIK2fdgj.js → useAddBlockByDrop-V8xo-PNQ.js} +1 -1
- package/dist/{useAddBlockByDrop-6EbioQV4.cjs → useAddBlockByDrop-qRHgy8_0.cjs} +1 -1
- package/dist/web-blocks.cjs +1 -1
- package/dist/web-blocks.js +1 -1
- package/package.json +26 -38
- package/dist/AddBlocks-KeHVFaIr.cjs +0 -1
- package/dist/BrandingOptions-I2I8w6E9.cjs +0 -1
- package/dist/CanvasArea-JfHkTnQD.cjs +0 -60
- package/dist/CanvasArea-xvMCbQDL.js +0 -1404
- package/dist/CurrentPage-vj52UxMA.cjs +0 -1
- package/dist/ListTree-Vq0_s1wC.cjs +0 -1
- package/dist/ListTree-k-QMO740.js +0 -96
- package/dist/Outline-HI6-c9nf.js +0 -359
- package/dist/Outline-fAflJ_lN.cjs +0 -1
- package/dist/PagesPanel-ug8Tmva6.cjs +0 -1
- package/dist/ProjectPanel-o8-6cPX-.cjs +0 -1
- package/dist/Settings-Cc9eV4VG.cjs +0 -1
- package/dist/SidePanels-ugRobm34.cjs +0 -1
- package/dist/Topbar-e5MGWX9n.cjs +0 -1
- package/dist/UnsplashImages-KSbKGs91.cjs +0 -1
- package/dist/UploadImages-V42YSRVO.cjs +0 -1
- package/dist/add-page-modal-xMedOdsp.cjs +0 -1
- package/dist/confirm-alert-KtW-4OjG.cjs +0 -1
- package/dist/delete-page-modal-lebJCBBe.cjs +0 -1
- package/dist/index-thKfFhmr.cjs +0 -1
- package/dist/page-viewer-DTIblLiz.cjs +0 -1
- package/dist/project-general-setting-g7WhM3hc.cjs +0 -1
- package/dist/project-seo-setting-xoeLQVj3.cjs +0 -1
- package/dist/single-page-detail-XdBysrE_.cjs +0 -1
|
@@ -0,0 +1,294 @@
|
|
|
1
|
+
import { j as e } from "./jsx-runtime-WbnYoNE9.js";
|
|
2
|
+
import { nth as w, startsWith as E, map as B, isUndefined as _, find as M, isEmpty as R, includes as A } from "lodash-es";
|
|
3
|
+
import { TriangleRightIcon as P, TrashIcon as H, CopyIcon as L, DoubleArrowDownIcon as $, StackIcon as F } from "@radix-ui/react-icons";
|
|
4
|
+
import { useDrop as K, useDragLayer as U } from "react-dnd";
|
|
5
|
+
import { useDragOver as Y, Tree as q } from "@minoru/react-dnd-treeview";
|
|
6
|
+
import { useTranslation as Q } from "react-i18next";
|
|
7
|
+
import { Y as V, X as W, h as X, ap as z, aq as G, ar as J, r as y, s as Z, a1 as I, bs as C, aS as ee, t as te, bt as se, aR as oe, bu as ne, bv as re, E as ie, aM as le, ac as ae, bw as ce, bf as de, bx as me } from "./index-IPJAbzzO.js";
|
|
8
|
+
import { T as N } from "./TypeIcon-qO96rNbV.js";
|
|
9
|
+
import { useMemo as pe, useCallback as xe } from "react";
|
|
10
|
+
import { a as ue } from "./MODIFIERS-WQdaNvb8.js";
|
|
11
|
+
import { c as D } from "./Functions-7jnEwJyw.js";
|
|
12
|
+
import { a as ge, d as he } from "./index-kAjyc_KA.js";
|
|
13
|
+
import { u as fe } from "./useAddBlockByDrop-V8xo-PNQ.js";
|
|
14
|
+
import "./_commonjsHelpers-UyOWmZb0.js";
|
|
15
|
+
import "@chaibuilder/runtime";
|
|
16
|
+
import "jotai";
|
|
17
|
+
import "@react-hookz/web";
|
|
18
|
+
import "@radix-ui/react-toggle";
|
|
19
|
+
import "class-variance-authority";
|
|
20
|
+
import "./Class-3k8xjeiM.js";
|
|
21
|
+
import "clsx";
|
|
22
|
+
import "tailwind-merge";
|
|
23
|
+
import "@radix-ui/react-switch";
|
|
24
|
+
import "@radix-ui/react-slot";
|
|
25
|
+
import "@radix-ui/react-accordion";
|
|
26
|
+
import "@radix-ui/react-alert-dialog";
|
|
27
|
+
import "@radix-ui/react-dialog";
|
|
28
|
+
import "@radix-ui/react-label";
|
|
29
|
+
import "@radix-ui/react-scroll-area";
|
|
30
|
+
import "@radix-ui/react-tabs";
|
|
31
|
+
import "@radix-ui/react-tooltip";
|
|
32
|
+
import "@radix-ui/react-popover";
|
|
33
|
+
import "@radix-ui/react-menubar";
|
|
34
|
+
import "@radix-ui/react-hover-card";
|
|
35
|
+
import "@radix-ui/react-select";
|
|
36
|
+
import "@radix-ui/react-dropdown-menu";
|
|
37
|
+
import "@radix-ui/react-separator";
|
|
38
|
+
import "@radix-ui/react-toast";
|
|
39
|
+
import "cmdk";
|
|
40
|
+
import "@radix-ui/react-context-menu";
|
|
41
|
+
import "react-icons-picker";
|
|
42
|
+
import "react-dom";
|
|
43
|
+
import "react-quill";
|
|
44
|
+
import "lucide-react";
|
|
45
|
+
import "i18next";
|
|
46
|
+
import "@floating-ui/react-dom";
|
|
47
|
+
import "flagged";
|
|
48
|
+
import "react-hotkeys-hook";
|
|
49
|
+
function be(t = "") {
|
|
50
|
+
const s = {
|
|
51
|
+
xs: "390px",
|
|
52
|
+
sm: "640px",
|
|
53
|
+
md: "768px",
|
|
54
|
+
lg: "1024px",
|
|
55
|
+
xl: "1366px",
|
|
56
|
+
"2xl": "1536px"
|
|
57
|
+
};
|
|
58
|
+
if (new RegExp(/\bsr-only\b/).test(t))
|
|
59
|
+
return "Sr Only";
|
|
60
|
+
if (new RegExp(/\b(sm|md|lg|xl|2xl):hidden\b/).test(t))
|
|
61
|
+
return "Visible on mobile";
|
|
62
|
+
if (t.match(/(^| )hidden( |$)/g)) {
|
|
63
|
+
const a = new RegExp(
|
|
64
|
+
// checks if any of the display property is set for any higher media query
|
|
65
|
+
/\b(sm|md|lg|xl|2xl):(block|grid|flex|inline|inline-grid|inline-flex|inline-block)\b/
|
|
66
|
+
), r = t.match(a);
|
|
67
|
+
if (w(r, 1))
|
|
68
|
+
return `Visible >=${s[w(r, 1)]}`;
|
|
69
|
+
}
|
|
70
|
+
return "";
|
|
71
|
+
}
|
|
72
|
+
function je(t) {
|
|
73
|
+
return t.split("/").pop();
|
|
74
|
+
}
|
|
75
|
+
const ye = (t) => {
|
|
76
|
+
let s = "";
|
|
77
|
+
return Object.keys(t).forEach((n) => {
|
|
78
|
+
E(t[n], ue) && (s = t[n]);
|
|
79
|
+
}), s;
|
|
80
|
+
}, ve = (t) => {
|
|
81
|
+
var x;
|
|
82
|
+
const [, s] = V(), [n] = W(), l = X("outlineMenuItems", []), { isSelected: a } = t, { id: r, data: c } = t.node, u = t.depth * 10, m = (i) => {
|
|
83
|
+
i.stopPropagation(), t.onToggle(t.node.id);
|
|
84
|
+
}, g = Y(r, t.isOpen, t.onToggle), p = pe(() => {
|
|
85
|
+
const i = ye(t.node.data);
|
|
86
|
+
return be(i);
|
|
87
|
+
}, [t.node.data]);
|
|
88
|
+
return (
|
|
89
|
+
// eslint-disable-next-line jsx-a11y/click-events-have-key-events,jsx-a11y/no-static-element-interactions
|
|
90
|
+
/* @__PURE__ */ e.jsx(
|
|
91
|
+
"div",
|
|
92
|
+
{
|
|
93
|
+
onMouseEnter: () => s(r),
|
|
94
|
+
className: D(
|
|
95
|
+
"group flex w-full items-center justify-between space-x-px py-px",
|
|
96
|
+
a ? "bg-blue-500 text-white" : "text-gray-600 hover:bg-gray-200 dark:hover:bg-gray-800"
|
|
97
|
+
),
|
|
98
|
+
onClick: (i) => {
|
|
99
|
+
i.stopPropagation(), !n.includes(r) && t.onSelect(r);
|
|
100
|
+
},
|
|
101
|
+
onContextMenu: () => t.onSelect(r),
|
|
102
|
+
style: { paddingInlineStart: u },
|
|
103
|
+
...g,
|
|
104
|
+
children: /* @__PURE__ */ e.jsxs("div", { className: "flex w-full items-center justify-between pr-2", children: [
|
|
105
|
+
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center", children: [
|
|
106
|
+
/* @__PURE__ */ e.jsx(
|
|
107
|
+
"div",
|
|
108
|
+
{
|
|
109
|
+
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" : ""}`,
|
|
110
|
+
children: t.node.droppable && /* @__PURE__ */ e.jsx("button", { onClick: m, type: "button", children: /* @__PURE__ */ e.jsx(P, {}) })
|
|
111
|
+
}
|
|
112
|
+
),
|
|
113
|
+
/* @__PURE__ */ e.jsxs("button", { type: "button", className: "flex items-center", children: [
|
|
114
|
+
/* @__PURE__ */ e.jsx("div", { className: "-mt-1 h-3 w-3", children: /* @__PURE__ */ e.jsx(N, { type: c == null ? void 0 : c._type }) }),
|
|
115
|
+
/* @__PURE__ */ e.jsx("div", { className: "ml-2 truncate text-[11px]", children: ((x = t.node.data) == null ? void 0 : x._name) || je(t.node.text) }),
|
|
116
|
+
p ? /* @__PURE__ */ e.jsxs(
|
|
117
|
+
"span",
|
|
118
|
+
{
|
|
119
|
+
className: "ml-2 flex items-center truncate text-[10px] italic " + (a ? "text-gray-200" : "text-gray-500"),
|
|
120
|
+
children: [
|
|
121
|
+
"(",
|
|
122
|
+
p,
|
|
123
|
+
")"
|
|
124
|
+
]
|
|
125
|
+
}
|
|
126
|
+
) : null
|
|
127
|
+
] })
|
|
128
|
+
] }),
|
|
129
|
+
/* @__PURE__ */ e.jsx("div", { className: "invisible flex items-center space-x-1 group-hover:visible", children: l.map((i) => /* @__PURE__ */ e.jsxs(z, { children: [
|
|
130
|
+
/* @__PURE__ */ e.jsx(
|
|
131
|
+
G,
|
|
132
|
+
{
|
|
133
|
+
className: "cursor-pointer rounded bg-transparent hover:bg-white hover:text-blue-500",
|
|
134
|
+
asChild: !0,
|
|
135
|
+
children: i.item(r)
|
|
136
|
+
}
|
|
137
|
+
),
|
|
138
|
+
/* @__PURE__ */ e.jsx(J, { children: i.tooltip })
|
|
139
|
+
] })) })
|
|
140
|
+
] })
|
|
141
|
+
}
|
|
142
|
+
)
|
|
143
|
+
);
|
|
144
|
+
}, ke = (t) => {
|
|
145
|
+
var n;
|
|
146
|
+
const { item: s } = t.monitorProps;
|
|
147
|
+
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: [
|
|
148
|
+
/* @__PURE__ */ e.jsx("div", { className: "", children: /* @__PURE__ */ e.jsx(N, { type: (n = s == null ? void 0 : s.data) == null ? void 0 : n._type }) }),
|
|
149
|
+
/* @__PURE__ */ e.jsx("div", { className: "ml-2 truncate text-[11px]", children: s.text })
|
|
150
|
+
] });
|
|
151
|
+
}, we = (t) => {
|
|
152
|
+
const s = t.depth * 10 + 16;
|
|
153
|
+
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 } });
|
|
154
|
+
}, Be = () => {
|
|
155
|
+
const [t] = y(), s = Z(), n = I();
|
|
156
|
+
return /* @__PURE__ */ e.jsxs(
|
|
157
|
+
C,
|
|
158
|
+
{
|
|
159
|
+
disabled: !ee(n == null ? void 0 : n._type),
|
|
160
|
+
className: "flex items-center gap-x-4 text-xs",
|
|
161
|
+
onClick: () => s(t),
|
|
162
|
+
children: [
|
|
163
|
+
/* @__PURE__ */ e.jsx(H, {}),
|
|
164
|
+
" Remove"
|
|
165
|
+
]
|
|
166
|
+
}
|
|
167
|
+
);
|
|
168
|
+
}, Ie = () => {
|
|
169
|
+
const [t] = y(), s = te(), n = I(), l = xe(() => {
|
|
170
|
+
s(t);
|
|
171
|
+
}, [t, s]);
|
|
172
|
+
return /* @__PURE__ */ e.jsxs(se, { className: "text-xs", children: [
|
|
173
|
+
/* @__PURE__ */ e.jsxs(
|
|
174
|
+
C,
|
|
175
|
+
{
|
|
176
|
+
disabled: !oe(n == null ? void 0 : n._type),
|
|
177
|
+
className: "flex items-center gap-x-4 text-xs",
|
|
178
|
+
onClick: l,
|
|
179
|
+
children: [
|
|
180
|
+
/* @__PURE__ */ e.jsx(L, {}),
|
|
181
|
+
" Duplicate"
|
|
182
|
+
]
|
|
183
|
+
}
|
|
184
|
+
),
|
|
185
|
+
/* @__PURE__ */ e.jsx(Be, {})
|
|
186
|
+
] });
|
|
187
|
+
}, Ce = ({ children: t }) => /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsxs(ne, { children: [
|
|
188
|
+
/* @__PURE__ */ e.jsx(re, { children: t }),
|
|
189
|
+
/* @__PURE__ */ e.jsx(Ie, {})
|
|
190
|
+
] }) });
|
|
191
|
+
function Ne(t) {
|
|
192
|
+
return B(t, (s) => {
|
|
193
|
+
const { data: n } = s;
|
|
194
|
+
return {
|
|
195
|
+
...n,
|
|
196
|
+
_parent: s.parent === 0 ? null : s.parent
|
|
197
|
+
};
|
|
198
|
+
});
|
|
199
|
+
}
|
|
200
|
+
const kt = () => {
|
|
201
|
+
const [t] = ie(), { setNewBlocks: s } = le(), [n, l, a] = y(), [, r] = ae(), { t: c } = Q(), u = ge(), m = fe(), [g] = ce(), p = async (o, d) => {
|
|
202
|
+
const { dragSource: f, relativeIndex: b, dropTargetId: j, monitor: v } = d;
|
|
203
|
+
if (f) {
|
|
204
|
+
const k = Ne(o);
|
|
205
|
+
s(k), he("Handle Drop -> New Blocks -> ", k);
|
|
206
|
+
const T = v.getItem();
|
|
207
|
+
l([T.id]);
|
|
208
|
+
} else
|
|
209
|
+
await m({ block: v.getItem(), dropTargetId: j, relativeIndex: b });
|
|
210
|
+
}, x = B(t, (o) => ({
|
|
211
|
+
id: o._id,
|
|
212
|
+
text: o._type,
|
|
213
|
+
parent: o._parent || 0,
|
|
214
|
+
droppable: !_(M(t, { _parent: o._id })),
|
|
215
|
+
data: o
|
|
216
|
+
})), i = () => {
|
|
217
|
+
l([]), r([]);
|
|
218
|
+
}, [{ isOver: h }, S] = K(() => ({
|
|
219
|
+
accept: ["CHAI_BLOCK"],
|
|
220
|
+
collect: (o) => ({
|
|
221
|
+
canDrop: o.canDrop(),
|
|
222
|
+
isOver: o.isOver()
|
|
223
|
+
}),
|
|
224
|
+
drop: (o) => {
|
|
225
|
+
(async () => await m({
|
|
226
|
+
block: o,
|
|
227
|
+
dropTargetId: "",
|
|
228
|
+
relativeIndex: 0
|
|
229
|
+
}))();
|
|
230
|
+
}
|
|
231
|
+
})), { isDragging: O } = U((o) => ({
|
|
232
|
+
isDragging: o.isDragging()
|
|
233
|
+
}));
|
|
234
|
+
return /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsx(
|
|
235
|
+
"div",
|
|
236
|
+
{
|
|
237
|
+
onClick: () => i(),
|
|
238
|
+
className: D(
|
|
239
|
+
"-mx-1 -mt-1 flex h-full select-none flex-col space-y-1",
|
|
240
|
+
O ? "bg-green-50/80" : "bg-background"
|
|
241
|
+
),
|
|
242
|
+
children: R(t) ? /* @__PURE__ */ e.jsxs(
|
|
243
|
+
"div",
|
|
244
|
+
{
|
|
245
|
+
ref: S,
|
|
246
|
+
className: `mx-1 mt-4 h-full max-w-full p-6 text-center text-sm text-gray-400 ${h ? "bg-blue-200" : ""}`,
|
|
247
|
+
children: [
|
|
248
|
+
h ? /* @__PURE__ */ e.jsx($, { className: "mx-auto h-12 w-12 animate-bounce" }) : /* @__PURE__ */ e.jsx(F, { className: "mx-auto h-10 w-10" }),
|
|
249
|
+
/* @__PURE__ */ e.jsx("p", { className: "mt-2", children: c(h ? "drop_here_message" : "tree_view_no_blocks") })
|
|
250
|
+
]
|
|
251
|
+
}
|
|
252
|
+
) : /* @__PURE__ */ e.jsx(de, { id: "layers-view", className: "no-scrollbar h-full overflow-y-auto p-1", children: /* @__PURE__ */ e.jsx(
|
|
253
|
+
q,
|
|
254
|
+
{
|
|
255
|
+
initialOpen: u,
|
|
256
|
+
extraAcceptTypes: ["CHAI_BLOCK"],
|
|
257
|
+
tree: x,
|
|
258
|
+
rootId: 0,
|
|
259
|
+
render: (o, { depth: d, isOpen: f, onToggle: b }) => /* @__PURE__ */ e.jsx(Ce, { id: o.id, children: /* @__PURE__ */ e.jsx(
|
|
260
|
+
ve,
|
|
261
|
+
{
|
|
262
|
+
onSelect: (j) => {
|
|
263
|
+
r([]), l([j]);
|
|
264
|
+
},
|
|
265
|
+
isSelected: A(n, o.id),
|
|
266
|
+
node: o,
|
|
267
|
+
depth: d,
|
|
268
|
+
isOpen: f,
|
|
269
|
+
onToggle: b,
|
|
270
|
+
toggleIds: a
|
|
271
|
+
}
|
|
272
|
+
) }),
|
|
273
|
+
dragPreviewRender: (o) => /* @__PURE__ */ e.jsx(ke, { monitorProps: o }),
|
|
274
|
+
onDrop: p,
|
|
275
|
+
classes: {
|
|
276
|
+
root: "h-[90%] " + (g ? "pl-2" : "pt-2"),
|
|
277
|
+
draggingSource: "opacity-30",
|
|
278
|
+
dropTarget: "bg-green-100",
|
|
279
|
+
placeholder: "relative"
|
|
280
|
+
},
|
|
281
|
+
sort: !1,
|
|
282
|
+
insertDroppableFirst: !1,
|
|
283
|
+
canDrop: me,
|
|
284
|
+
dropTargetOffset: 2,
|
|
285
|
+
enableAnimateExpand: !0,
|
|
286
|
+
placeholderRender: (o, { depth: d }) => /* @__PURE__ */ e.jsx(we, { node: o, depth: d })
|
|
287
|
+
}
|
|
288
|
+
) })
|
|
289
|
+
}
|
|
290
|
+
) });
|
|
291
|
+
};
|
|
292
|
+
export {
|
|
293
|
+
kt as default
|
|
294
|
+
};
|
|
@@ -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-PlZjGTTr.cjs");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("./index-9YNkdni8.cjs");require("i18next");require("react-i18next");require("./index-9PHdn80L.cjs");require("./Functions-N3yhPYKY.cjs");require("clsx");require("tailwind-merge");require("@chaibuilder/runtime");require("jotai");require("./MODIFIERS-9EwxLM8V.cjs");require("@react-hookz/web");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("@floating-ui/react-dom");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-xCUKJiZv.cjs"))),x=u.lazy(()=>Promise.resolve().then(()=>require("./page-viewer-ZA-sJD82.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,12 +1,12 @@
|
|
|
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-iQEapw2W.js";
|
|
5
5
|
import "./_commonjsHelpers-UyOWmZb0.js";
|
|
6
|
-
import "./index-
|
|
6
|
+
import "./index-kAjyc_KA.js";
|
|
7
7
|
import "i18next";
|
|
8
8
|
import "react-i18next";
|
|
9
|
-
import "./index-
|
|
9
|
+
import "./index-IPJAbzzO.js";
|
|
10
10
|
import "./Functions-7jnEwJyw.js";
|
|
11
11
|
import "clsx";
|
|
12
12
|
import "tailwind-merge";
|
|
@@ -14,7 +14,6 @@ import "@chaibuilder/runtime";
|
|
|
14
14
|
import "jotai";
|
|
15
15
|
import "./MODIFIERS-WQdaNvb8.js";
|
|
16
16
|
import "@react-hookz/web";
|
|
17
|
-
import "flat-to-nested";
|
|
18
17
|
import "@radix-ui/react-toggle";
|
|
19
18
|
import "class-variance-authority";
|
|
20
19
|
import "./Class-3k8xjeiM.js";
|
|
@@ -40,9 +39,7 @@ import "@radix-ui/react-context-menu";
|
|
|
40
39
|
import "react-icons-picker";
|
|
41
40
|
import "react-dom";
|
|
42
41
|
import "react-quill";
|
|
43
|
-
import "lodash";
|
|
44
42
|
import "@floating-ui/react-dom";
|
|
45
|
-
import "react-textarea-autosize";
|
|
46
43
|
import "flagged";
|
|
47
44
|
import "react-dnd";
|
|
48
45
|
import "@minoru/react-dnd-treeview";
|
|
@@ -52,7 +49,7 @@ import "./html-to-json-C5sExaSD.js";
|
|
|
52
49
|
import "himalaya";
|
|
53
50
|
import "lucide-react";
|
|
54
51
|
import "./index-YpnaudSM.js";
|
|
55
|
-
const x = i.lazy(() => import("./add-page-modal-
|
|
52
|
+
const x = i.lazy(() => import("./add-page-modal-1mGGtAB_.js")), u = i.lazy(() => import("./page-viewer-SU_BqZDK.js")), ct = () => {
|
|
56
53
|
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);
|
|
57
54
|
return /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
|
|
58
55
|
/* @__PURE__ */ t.jsxs("div", { className: "flex items-center justify-between rounded-md bg-background/30 p-1", children: [
|
|
@@ -64,5 +61,5 @@ const x = i.lazy(() => import("./add-page-modal-dKQLw7RQ.js")), u = i.lazy(() =>
|
|
|
64
61
|
] });
|
|
65
62
|
};
|
|
66
63
|
export {
|
|
67
|
-
|
|
64
|
+
ct as default
|
|
68
65
|
};
|
|
@@ -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-9PHdn80L.cjs"),a=require("./index-PlZjGTTr.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("@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("react-i18next");require("./index-9YNkdni8.cjs");require("i18next");require("@floating-ui/react-dom");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-GuQyvAHS.cjs"))),m=r.lazy(()=>Promise.resolve().then(()=>require("./project-seo-setting-3-vBkx2v.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 q(){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(m,{_projectData:i,seany:o})})})]})]})})]})}exports.default=q;
|
|
@@ -1,8 +1,8 @@
|
|
|
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-IPJAbzzO.js";
|
|
5
|
+
import { b as h, a as g } from "./index-iQEapw2W.js";
|
|
6
6
|
import "./_commonjsHelpers-UyOWmZb0.js";
|
|
7
7
|
import "./Functions-7jnEwJyw.js";
|
|
8
8
|
import "clsx";
|
|
@@ -11,7 +11,6 @@ import "@chaibuilder/runtime";
|
|
|
11
11
|
import "jotai";
|
|
12
12
|
import "./MODIFIERS-WQdaNvb8.js";
|
|
13
13
|
import "@react-hookz/web";
|
|
14
|
-
import "flat-to-nested";
|
|
15
14
|
import "@radix-ui/react-toggle";
|
|
16
15
|
import "class-variance-authority";
|
|
17
16
|
import "./Class-3k8xjeiM.js";
|
|
@@ -37,12 +36,10 @@ import "@radix-ui/react-context-menu";
|
|
|
37
36
|
import "react-icons-picker";
|
|
38
37
|
import "react-dom";
|
|
39
38
|
import "react-quill";
|
|
40
|
-
import "lodash";
|
|
41
39
|
import "react-i18next";
|
|
42
|
-
import "./index-
|
|
40
|
+
import "./index-kAjyc_KA.js";
|
|
43
41
|
import "i18next";
|
|
44
42
|
import "@floating-ui/react-dom";
|
|
45
|
-
import "react-textarea-autosize";
|
|
46
43
|
import "flagged";
|
|
47
44
|
import "react-dnd";
|
|
48
45
|
import "@minoru/react-dnd-treeview";
|
|
@@ -52,38 +49,38 @@ import "./html-to-json-C5sExaSD.js";
|
|
|
52
49
|
import "himalaya";
|
|
53
50
|
import "lucide-react";
|
|
54
51
|
import "./index-YpnaudSM.js";
|
|
55
|
-
const N = m.lazy(() => import("./project-general-setting-
|
|
56
|
-
...
|
|
52
|
+
const N = m.lazy(() => import("./project-general-setting-eEmhoFvb.js")), S = m.lazy(() => import("./project-seo-setting-NNvAGt4T.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 = (e) => e && j(e.seoData) ? {
|
|
53
|
+
...e,
|
|
57
54
|
seoData: { title: "", description: "", image: "" }
|
|
58
|
-
} :
|
|
59
|
-
function
|
|
60
|
-
const
|
|
55
|
+
} : e;
|
|
56
|
+
function gt() {
|
|
57
|
+
const e = h(), { data: s } = g(), [r, i] = m.useState(
|
|
61
58
|
u(s || {})
|
|
62
|
-
), o = x(
|
|
59
|
+
), o = x(r);
|
|
63
60
|
return a(
|
|
64
61
|
() => () => {
|
|
65
|
-
b(s, o.current) ||
|
|
62
|
+
b(s, o.current) || e.mutate(o.current, {
|
|
66
63
|
onSuccess: () => i(o.current)
|
|
67
64
|
});
|
|
68
65
|
},
|
|
69
66
|
[o]
|
|
70
67
|
), a(() => {
|
|
71
|
-
o.current =
|
|
72
|
-
}, [
|
|
68
|
+
o.current = r;
|
|
69
|
+
}, [r]), /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
|
|
73
70
|
/* @__PURE__ */ t.jsx("div", { className: "flex items-center justify-between rounded-md bg-background/30 p-1", children: /* @__PURE__ */ t.jsx("h1", { className: "px-1 font-semibold", children: "Website Settings" }) }),
|
|
74
71
|
/* @__PURE__ */ t.jsx("hr", { className: "-mx-1" }),
|
|
75
72
|
/* @__PURE__ */ t.jsx("div", { className: "-mx-1", children: /* @__PURE__ */ t.jsxs(f, { type: "single", className: "w-full", defaultValue: "GENERAL", children: [
|
|
76
73
|
/* @__PURE__ */ t.jsxs(n, { value: "GENERAL", className: "border-b-2 border-slate-100 dark:border-slate-800", children: [
|
|
77
74
|
/* @__PURE__ */ t.jsx(l, { 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" }),
|
|
78
|
-
/* @__PURE__ */ t.jsx(c, { className: "px-2 pt-4 text-sm", children: /* @__PURE__ */ t.jsx(p, { fallback: d, children: /* @__PURE__ */ t.jsx(N, { _projectData:
|
|
75
|
+
/* @__PURE__ */ t.jsx(c, { className: "px-2 pt-4 text-sm", children: /* @__PURE__ */ t.jsx(p, { fallback: d, children: /* @__PURE__ */ t.jsx(N, { _projectData: r, seany: i }) }) })
|
|
79
76
|
] }),
|
|
80
77
|
/* @__PURE__ */ t.jsxs(n, { value: "SEO", className: "border-b-2 border-slate-100 dark:border-slate-800", children: [
|
|
81
78
|
/* @__PURE__ */ t.jsx(l, { 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" }),
|
|
82
|
-
/* @__PURE__ */ t.jsx(c, { className: "px-1 pt-4 text-sm", children: /* @__PURE__ */ t.jsx(p, { fallback: d, children: /* @__PURE__ */ t.jsx(S, { _projectData:
|
|
79
|
+
/* @__PURE__ */ t.jsx(c, { className: "px-1 pt-4 text-sm", children: /* @__PURE__ */ t.jsx(p, { fallback: d, children: /* @__PURE__ */ t.jsx(S, { _projectData: r, seany: i }) }) })
|
|
83
80
|
] })
|
|
84
81
|
] }) })
|
|
85
82
|
] });
|
|
86
83
|
}
|
|
87
84
|
export {
|
|
88
|
-
|
|
85
|
+
gt as default
|
|
89
86
|
};
|