@chaibuilder/sdk 0.1.20 → 0.1.22
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-a2677462.js → AddBlocks-254892c5.js} +5 -6
- package/dist/AddBlocks-a86eec32.cjs +3 -0
- package/dist/BrandingOptions-10c05f85.cjs +1 -0
- package/dist/{BrandingOptions-a95cba65.js → BrandingOptions-81fb41d9.js} +5 -6
- package/dist/{CanvasArea-ab550e9c.js → CanvasArea-7e09f98e.js} +10 -11
- package/dist/{CanvasArea-f1083634.cjs → CanvasArea-a261378b.cjs} +6 -6
- package/dist/CurrentPage-b67bee36.cjs +1 -0
- package/dist/{CurrentPage-12828412.js → CurrentPage-ce5a51fa.js} +5 -6
- package/dist/Layers-4e859d15.cjs +1 -0
- package/dist/{Layers-c429fafe.js → Layers-b3a452cc.js} +48 -49
- package/dist/{MODIFIERS-c2e02614.js → MODIFIERS-2f19c314.js} +13 -7
- package/dist/MODIFIERS-4716c669.cjs +1 -0
- package/dist/MarkAsGlobalBlock-1a1039f8.cjs +1 -0
- package/dist/{MarkAsGlobalBlock-e49bcdc9.js → MarkAsGlobalBlock-7d9f5e11.js} +5 -6
- package/dist/PagesPanel-163b7771.cjs +1 -0
- package/dist/{PagesPanel-2435351c.js → PagesPanel-2559ea9e.js} +5 -6
- package/dist/ProjectPanel-e78931cd.cjs +1 -0
- package/dist/{ProjectPanel-e2860893.js → ProjectPanel-fab32a4f.js} +6 -7
- package/dist/{Settings-17279d90.js → Settings-a2638a6e.js} +82 -83
- package/dist/Settings-d9df3548.cjs +1 -0
- package/dist/SidePanels-1439e695.cjs +1 -0
- package/dist/{SidePanels-95d3316d.js → SidePanels-aa583e71.js} +6 -7
- package/dist/Topbar-c131ef83.cjs +1 -0
- package/dist/{Topbar-8d1f6f53.js → Topbar-ef648e78.js} +15 -16
- package/dist/add-page-modal-7d645bf7.cjs +1 -0
- package/dist/{add-page-modal-b3c84063.js → add-page-modal-8c9dad17.js} +5 -6
- package/dist/core.cjs +1 -1
- package/dist/core.d.ts +4 -1
- package/dist/core.js +56 -57
- package/dist/delete-page-modal-19001f8d.cjs +1 -0
- package/dist/{delete-page-modal-f9e9eb48.js → delete-page-modal-ec091c19.js} +8 -9
- package/dist/functions-83b1de8d.js +1106 -0
- package/dist/functions-f84d5e2a.cjs +2 -0
- package/dist/{html-to-json-8397fab5.js → html-to-json-45e0e3b5.js} +1 -1
- package/dist/{html-to-json-78bfa1f3.cjs → html-to-json-aadcbf66.cjs} +1 -1
- package/dist/{index-2bda0975.cjs → index-2f61b040.cjs} +40 -40
- package/dist/{index-397e45a0.js → index-e6e838ec.js} +111 -112
- package/dist/lib.cjs +1 -1
- package/dist/lib.d.ts +38 -0
- package/dist/lib.js +56 -45
- package/dist/page-viewer-65e2ca1a.cjs +1 -0
- package/dist/{page-viewer-9c46bbbf.js → page-viewer-dec9a6d2.js} +16 -17
- package/dist/{project-general-setting-a925e417.js → project-general-setting-067afe22.js} +5 -6
- package/dist/project-general-setting-c7d95cc0.cjs +1 -0
- package/dist/render.cjs +1 -2
- package/dist/render.d.ts +5 -16
- package/dist/render.js +86 -1178
- package/dist/single-page-detail-14e7a650.cjs +1 -0
- package/dist/{single-page-detail-60eae215.js → single-page-detail-f110be66.js} +6 -7
- package/package.json +1 -1
- package/dist/AddBlocks-48294c91.cjs +0 -3
- package/dist/BrandingOptions-c2922757.cjs +0 -1
- package/dist/CurrentPage-4d4a026f.cjs +0 -1
- package/dist/Layers-7d1616f9.cjs +0 -1
- package/dist/MODIFIERS-70fef873.cjs +0 -1
- package/dist/MarkAsGlobalBlock-43d26539.cjs +0 -1
- package/dist/PagesPanel-e89d30f7.cjs +0 -1
- package/dist/ProjectPanel-b110dffd.cjs +0 -1
- package/dist/Settings-632f6372.cjs +0 -1
- package/dist/SidePanels-b8fe9623.cjs +0 -1
- package/dist/Topbar-e7e27347.cjs +0 -1
- package/dist/_commonjsHelpers-10dfc225.js +0 -8
- package/dist/_commonjsHelpers-87b0abe8.cjs +0 -1
- package/dist/add-page-modal-79f99652.cjs +0 -1
- package/dist/delete-page-modal-bfe98708.cjs +0 -1
- package/dist/page-viewer-1763df5e.cjs +0 -1
- package/dist/project-general-setting-08e5996d.cjs +0 -1
- package/dist/single-page-detail-23bfb732.cjs +0 -1
|
@@ -1,20 +1,19 @@
|
|
|
1
1
|
import { j as e } from "./jsx-runtime-944c88e2.js";
|
|
2
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
|
|
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 ne, DividerHorizontalIcon as oe, 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 { 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-
|
|
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-e6e838ec.js";
|
|
8
8
|
import { DatabaseIcon as ze } from "lucide-react";
|
|
9
9
|
import { c as w } from "./utils-ac68b2c8.js";
|
|
10
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-
|
|
11
|
+
import { S as Ye } from "./MODIFIERS-2f19c314.js";
|
|
12
12
|
import { D as qe, a as Qe } from "./dialog-3d4e82ed.js";
|
|
13
13
|
import { C as Ue, a as We, b as Xe, c as d } from "./context-menu-e1c240ce.js";
|
|
14
14
|
import { u as D } from "./useBuilderProp-81a14920.js";
|
|
15
15
|
import { S as Je } from "./scroll-area-83bd9e8f.js";
|
|
16
16
|
import { useAtom as Ze } from "jotai";
|
|
17
|
-
import "./_commonjsHelpers-10dfc225.js";
|
|
18
17
|
import "clsx";
|
|
19
18
|
import "@radix-ui/react-scroll-area";
|
|
20
19
|
import "react-dom";
|
|
@@ -23,7 +22,7 @@ import "i18next";
|
|
|
23
22
|
import "flagged";
|
|
24
23
|
import "react-hotkeys-hook";
|
|
25
24
|
import "flat-to-nested";
|
|
26
|
-
import "./html-to-json-
|
|
25
|
+
import "./html-to-json-45e0e3b5.js";
|
|
27
26
|
import "himalaya";
|
|
28
27
|
import "redux-undo";
|
|
29
28
|
import "@react-hookz/web";
|
|
@@ -55,9 +54,9 @@ const T = (s) => {
|
|
|
55
54
|
case "CustomHTML":
|
|
56
55
|
return /* @__PURE__ */ e.jsx(re, {});
|
|
57
56
|
case "Divider":
|
|
58
|
-
return /* @__PURE__ */ e.jsx(ne, {});
|
|
59
|
-
case "Icon":
|
|
60
57
|
return /* @__PURE__ */ e.jsx(oe, {});
|
|
58
|
+
case "Icon":
|
|
59
|
+
return /* @__PURE__ */ e.jsx(ne, {});
|
|
61
60
|
case "List":
|
|
62
61
|
return /* @__PURE__ */ e.jsx(y, {});
|
|
63
62
|
case "Paragraph":
|
|
@@ -124,12 +123,12 @@ function es(s = "") {
|
|
|
124
123
|
}
|
|
125
124
|
const ss = (s) => {
|
|
126
125
|
let t = "";
|
|
127
|
-
return Object.keys(s).forEach((
|
|
128
|
-
P(s[
|
|
126
|
+
return Object.keys(s).forEach((n) => {
|
|
127
|
+
P(s[n], Ye) && (t = s[n]);
|
|
129
128
|
}), t;
|
|
130
129
|
}, ts = (s) => {
|
|
131
130
|
var m;
|
|
132
|
-
const [, t] = ve(), [
|
|
131
|
+
const [, t] = ve(), [n] = we(), { isSelected: r } = s, { id: a, data: c } = s.node, l = s.depth * 10, x = (i) => {
|
|
133
132
|
i.stopPropagation(), s.onToggle(s.node.id);
|
|
134
133
|
}, j = Be(a, s.isOpen, s.onToggle), u = Fe(() => {
|
|
135
134
|
const i = ss(s.node.data);
|
|
@@ -146,7 +145,7 @@ const ss = (s) => {
|
|
|
146
145
|
r ? "bg-blue-500 text-white" : "hover:bg-gray-200 dark:hover:bg-gray-800"
|
|
147
146
|
),
|
|
148
147
|
onClick: (i) => {
|
|
149
|
-
i.stopPropagation(), !
|
|
148
|
+
i.stopPropagation(), !n.includes(a) && s.onSelect(a);
|
|
150
149
|
},
|
|
151
150
|
onContextMenu: () => s.onSelect(a),
|
|
152
151
|
style: { paddingInlineStart: l },
|
|
@@ -178,17 +177,17 @@ const ss = (s) => {
|
|
|
178
177
|
}
|
|
179
178
|
)
|
|
180
179
|
);
|
|
181
|
-
},
|
|
182
|
-
var
|
|
180
|
+
}, ns = (s) => {
|
|
181
|
+
var n;
|
|
183
182
|
const { item: t } = s.monitorProps;
|
|
184
183
|
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: [
|
|
185
|
-
/* @__PURE__ */ e.jsx("div", { className: "", children: /* @__PURE__ */ e.jsx(T, { type: (
|
|
184
|
+
/* @__PURE__ */ e.jsx("div", { className: "", children: /* @__PURE__ */ e.jsx(T, { type: (n = t == null ? void 0 : t.data) == null ? void 0 : n._type }) }),
|
|
186
185
|
/* @__PURE__ */ e.jsx("div", { className: "ml-2 truncate text-[11px]", children: t.text })
|
|
187
186
|
] });
|
|
188
|
-
},
|
|
187
|
+
}, os = (s) => {
|
|
189
188
|
const t = s.depth * 10 + 16;
|
|
190
189
|
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 } });
|
|
191
|
-
}, rs = Ge(() => import("./MarkAsGlobalBlock-
|
|
190
|
+
}, rs = Ge(() => import("./MarkAsGlobalBlock-7d9f5e11.js")), as = () => {
|
|
192
191
|
const [s] = g(), [, t] = Te();
|
|
193
192
|
return /* @__PURE__ */ e.jsxs(d, { className: "flex items-center gap-x-4 text-xs", onClick: () => t(s), children: [
|
|
194
193
|
/* @__PURE__ */ e.jsx(ge, {}),
|
|
@@ -201,11 +200,11 @@ const ss = (s) => {
|
|
|
201
200
|
" Copy"
|
|
202
201
|
] });
|
|
203
202
|
}, ls = () => {
|
|
204
|
-
const [s] = g(), t = Me(),
|
|
203
|
+
const [s] = g(), t = Me(), n = Oe();
|
|
205
204
|
return /* @__PURE__ */ e.jsxs(
|
|
206
205
|
d,
|
|
207
206
|
{
|
|
208
|
-
disabled: (
|
|
207
|
+
disabled: (n == null ? void 0 : n._type) === "Slot",
|
|
209
208
|
className: "flex items-center gap-x-4 text-xs",
|
|
210
209
|
onClick: () => t(s),
|
|
211
210
|
children: [
|
|
@@ -218,9 +217,9 @@ const ss = (s) => {
|
|
|
218
217
|
id: s = null,
|
|
219
218
|
openMarkAsGlobalModal: t
|
|
220
219
|
}) => {
|
|
221
|
-
const [
|
|
222
|
-
r(
|
|
223
|
-
}, [
|
|
220
|
+
const [n] = g(), r = Se(), { pasteBlocks: a, canPaste: c } = De(), l = D("globalBlocksSupport", !1), x = S(() => {
|
|
221
|
+
r(n);
|
|
222
|
+
}, [n, r]);
|
|
224
223
|
return /* @__PURE__ */ e.jsxs(Xe, { className: "text-xs", children: [
|
|
225
224
|
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: [
|
|
226
225
|
/* @__PURE__ */ e.jsx(ue, {}),
|
|
@@ -247,9 +246,9 @@ const ss = (s) => {
|
|
|
247
246
|
/* @__PURE__ */ e.jsx(ls, {})
|
|
248
247
|
] });
|
|
249
248
|
}, ds = ({ children: s, id: t = null }) => {
|
|
250
|
-
const [
|
|
249
|
+
const [n, r] = $e(!1);
|
|
251
250
|
return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
252
|
-
/* @__PURE__ */ e.jsx(qe, { open:
|
|
251
|
+
/* @__PURE__ */ e.jsx(qe, { open: n, onOpenChange: r, children: n && /* @__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
252
|
/* @__PURE__ */ e.jsxs(Ue, { children: [
|
|
254
253
|
/* @__PURE__ */ e.jsx(We, { children: s }),
|
|
255
254
|
/* @__PURE__ */ e.jsx(is, { id: t, openMarkAsGlobalModal: () => r(!0) })
|
|
@@ -258,8 +257,8 @@ const ss = (s) => {
|
|
|
258
257
|
}, xs = () => {
|
|
259
258
|
const { addCoreBlock: s } = Re(), t = D("getExternalPredefinedBlock");
|
|
260
259
|
return S(
|
|
261
|
-
async (
|
|
262
|
-
const { block: r, dropTargetId: a, relativeIndex: c } =
|
|
260
|
+
async (n) => {
|
|
261
|
+
const { block: r, dropTargetId: a, relativeIndex: c } = n;
|
|
263
262
|
if (H(r, "format")) {
|
|
264
263
|
const l = await t(r);
|
|
265
264
|
return s({ blocks: l }, a === 0 ? null : a, c);
|
|
@@ -271,46 +270,46 @@ const ss = (s) => {
|
|
|
271
270
|
};
|
|
272
271
|
function us(s) {
|
|
273
272
|
return v(s, (t) => {
|
|
274
|
-
const { data:
|
|
273
|
+
const { data: n } = t;
|
|
275
274
|
return {
|
|
276
|
-
...
|
|
275
|
+
...n,
|
|
277
276
|
_parent: t.parent === 0 ? null : t.parent
|
|
278
277
|
};
|
|
279
278
|
});
|
|
280
279
|
}
|
|
281
|
-
const
|
|
282
|
-
const s = Ee(), [t] = Ae(), [
|
|
283
|
-
const { dragSource: f, destinationIndex: I, relativeIndex: b, dropTargetId: E, monitor: A } = p, _ = us(
|
|
280
|
+
const Ws = () => {
|
|
281
|
+
const s = Ee(), [t] = Ae(), [n, r, a] = g(), [, c] = _e(), { t: l } = Ce(), { createSnapshot: x } = Pe(), j = He(), u = xs(), [, m] = Ze(Le), i = async (o, p) => {
|
|
282
|
+
const { dragSource: f, destinationIndex: I, relativeIndex: b, dropTargetId: E, monitor: A } = p, _ = us(o);
|
|
284
283
|
t(_), f ? x() : (await u({
|
|
285
284
|
block: A.getItem(),
|
|
286
285
|
dropTargetId: E,
|
|
287
286
|
destinationIndex: I,
|
|
288
287
|
relativeIndex: b
|
|
289
288
|
}), m(!1));
|
|
290
|
-
}, N = v(s, (
|
|
291
|
-
id:
|
|
292
|
-
text:
|
|
293
|
-
parent:
|
|
294
|
-
droppable: !L(V(s, { _parent:
|
|
295
|
-
data:
|
|
289
|
+
}, N = v(s, (o) => ({
|
|
290
|
+
id: o._id,
|
|
291
|
+
text: o._type,
|
|
292
|
+
parent: o._parent || 0,
|
|
293
|
+
droppable: !L(V(s, { _parent: o._id })),
|
|
294
|
+
data: o
|
|
296
295
|
})), M = () => {
|
|
297
296
|
r([]), c([]);
|
|
298
297
|
}, [{ isOver: h }, O] = be(() => ({
|
|
299
298
|
accept: ["CHAI_BLOCK"],
|
|
300
|
-
collect: (
|
|
301
|
-
canDrop:
|
|
302
|
-
isOver:
|
|
299
|
+
collect: (o) => ({
|
|
300
|
+
canDrop: o.canDrop(),
|
|
301
|
+
isOver: o.isOver()
|
|
303
302
|
}),
|
|
304
|
-
drop: (
|
|
303
|
+
drop: (o) => {
|
|
305
304
|
(async () => (await u({
|
|
306
|
-
block:
|
|
305
|
+
block: o,
|
|
307
306
|
dropTargetId: "",
|
|
308
307
|
destinationIndex: 0,
|
|
309
308
|
relativeIndex: 0
|
|
310
309
|
}), m(!1)))();
|
|
311
310
|
}
|
|
312
|
-
})), { isDragging: R } = ke((
|
|
313
|
-
isDragging:
|
|
311
|
+
})), { isDragging: R } = ke((o) => ({
|
|
312
|
+
isDragging: o.isDragging()
|
|
314
313
|
}));
|
|
315
314
|
return /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsx(
|
|
316
315
|
"div",
|
|
@@ -337,21 +336,21 @@ const Xs = () => {
|
|
|
337
336
|
extraAcceptTypes: ["CHAI_BLOCK"],
|
|
338
337
|
tree: N,
|
|
339
338
|
rootId: 0,
|
|
340
|
-
render: (
|
|
339
|
+
render: (o, { depth: p, isOpen: f, onToggle: I }) => /* @__PURE__ */ e.jsx(ds, { id: o.id, children: /* @__PURE__ */ e.jsx(
|
|
341
340
|
ts,
|
|
342
341
|
{
|
|
343
342
|
onSelect: (b) => {
|
|
344
343
|
c([]), r([b]);
|
|
345
344
|
},
|
|
346
|
-
isSelected: F(
|
|
347
|
-
node:
|
|
345
|
+
isSelected: F(n, o.id),
|
|
346
|
+
node: o,
|
|
348
347
|
depth: p,
|
|
349
348
|
isOpen: f,
|
|
350
349
|
onToggle: I,
|
|
351
350
|
toggleIds: a
|
|
352
351
|
}
|
|
353
352
|
) }),
|
|
354
|
-
dragPreviewRender: (
|
|
353
|
+
dragPreviewRender: (o) => /* @__PURE__ */ e.jsx(ns, { monitorProps: o }),
|
|
355
354
|
onDrop: i,
|
|
356
355
|
classes: {
|
|
357
356
|
root: "h-full pt-2",
|
|
@@ -364,12 +363,12 @@ const Xs = () => {
|
|
|
364
363
|
canDrop: Ve,
|
|
365
364
|
dropTargetOffset: 2,
|
|
366
365
|
enableAnimateExpand: !0,
|
|
367
|
-
placeholderRender: (
|
|
366
|
+
placeholderRender: (o, { depth: p }) => /* @__PURE__ */ e.jsx(os, { node: o, depth: p })
|
|
368
367
|
}
|
|
369
368
|
) })
|
|
370
369
|
}
|
|
371
370
|
) });
|
|
372
371
|
};
|
|
373
372
|
export {
|
|
374
|
-
|
|
373
|
+
Ws as default
|
|
375
374
|
};
|
|
@@ -1,4 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
var o = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
|
|
2
|
+
function t(e) {
|
|
3
|
+
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
|
|
4
|
+
}
|
|
5
|
+
const i = "#styles:", n = "#slots:", l = "#i18n", a = [
|
|
2
6
|
"hover",
|
|
3
7
|
"focus",
|
|
4
8
|
"focus-within",
|
|
@@ -47,7 +51,7 @@ const e = "#styles:", o = "#slots:", t = "#i18n", i = [
|
|
|
47
51
|
"ui-not-active",
|
|
48
52
|
"ui-not-selected",
|
|
49
53
|
"ui-not-checked"
|
|
50
|
-
],
|
|
54
|
+
], d = {
|
|
51
55
|
bodyFont: "Inter",
|
|
52
56
|
headingFont: "Inter",
|
|
53
57
|
roundedCorners: 5,
|
|
@@ -59,9 +63,11 @@ const e = "#styles:", o = "#slots:", t = "#i18n", i = [
|
|
|
59
63
|
bodyTextLightColor: "#000000"
|
|
60
64
|
};
|
|
61
65
|
export {
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
66
|
+
d as B,
|
|
67
|
+
l as I,
|
|
68
|
+
a as M,
|
|
69
|
+
i as S,
|
|
70
|
+
n as a,
|
|
71
|
+
o as c,
|
|
72
|
+
t as g
|
|
67
73
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var o=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function t(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}const l="#styles:",i="#slots:",n="#i18n",r=["hover","focus","focus-within","focus-visible","active","visited","target","first","last","only","odd","even","first-of-type","last-of-type","only-of-type","empty","disabled","checked","indeterminate","default","required","valid","invalid","in-range","out-of-range","placeholder-shown","autofill","read-only","open","before","after","first-letter","first-line","marker","selection","file","placeholder","ui-open","ui-disabled","ui-active","ui-selected","ui-checked","ui-not-open","ui-not-disabled","ui-not-active","ui-not-selected","ui-not-checked"],d={bodyFont:"Inter",headingFont:"Inter",roundedCorners:5,primaryColor:"#570df8",secondaryColor:"#f002b8",bodyBgDarkColor:"#031022",bodyBgLightColor:"#fcfcfc",bodyTextDarkColor:"#ffffff",bodyTextLightColor:"#000000"};exports.BRANDING_OPTIONS_DEFAULTS=d;exports.I18N_KEY=n;exports.MODIFIERS=r;exports.SLOT_KEY=i;exports.STYLES_KEY=l;exports.commonjsGlobal=o;exports.getDefaultExportFromCjs=t;
|
|
@@ -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-2f61b040.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("./MODIFIERS-4716c669.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-aadcbf66.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;
|
|
@@ -2,7 +2,7 @@ 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
4
|
import { B as e } from "./useBuilderProp-81a14920.js";
|
|
5
|
-
import { a1 as c } from "./index-
|
|
5
|
+
import { a1 as c } from "./index-e6e838ec.js";
|
|
6
6
|
import "react-i18next";
|
|
7
7
|
import { capitalize as p } from "lodash";
|
|
8
8
|
import "@radix-ui/react-slot";
|
|
@@ -13,7 +13,7 @@ import "tailwind-merge";
|
|
|
13
13
|
import "@radix-ui/react-tooltip";
|
|
14
14
|
import "@radix-ui/react-toast";
|
|
15
15
|
import "jotai";
|
|
16
|
-
import "./
|
|
16
|
+
import "./MODIFIERS-2f19c314.js";
|
|
17
17
|
import "@radix-ui/react-scroll-area";
|
|
18
18
|
import "react-dom";
|
|
19
19
|
import "@floating-ui/react-dom";
|
|
@@ -23,15 +23,14 @@ import "react-dnd";
|
|
|
23
23
|
import "@minoru/react-dnd-treeview";
|
|
24
24
|
import "react-hotkeys-hook";
|
|
25
25
|
import "flat-to-nested";
|
|
26
|
-
import "./html-to-json-
|
|
27
|
-
import "./MODIFIERS-c2e02614.js";
|
|
26
|
+
import "./html-to-json-45e0e3b5.js";
|
|
28
27
|
import "himalaya";
|
|
29
28
|
import "redux-undo";
|
|
30
29
|
import "@react-hookz/web";
|
|
31
30
|
import "@chaibuilder/blocks";
|
|
32
31
|
import "lucide-react";
|
|
33
32
|
import "sonner";
|
|
34
|
-
const
|
|
33
|
+
const Q = ({ id: o = null, closeModal: i }) => {
|
|
35
34
|
const r = c(), [t, a] = n("");
|
|
36
35
|
return /* @__PURE__ */ l.jsxs(l.Fragment, { children: [
|
|
37
36
|
/* @__PURE__ */ l.jsx("h1", { className: "text-lg font-bold", children: "Mark as Global" }),
|
|
@@ -76,5 +75,5 @@ const T = ({ id: o = null, closeModal: i }) => {
|
|
|
76
75
|
] });
|
|
77
76
|
};
|
|
78
77
|
export {
|
|
79
|
-
|
|
78
|
+
Q as default
|
|
80
79
|
};
|
|
@@ -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-2f61b040.cjs");require("./MODIFIERS-4716c669.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-aadcbf66.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-7d645bf7.cjs"))),q=i.lazy(()=>Promise.resolve().then(()=>require("./page-viewer-65e2ca1a.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;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { j as t } from "./jsx-runtime-944c88e2.js";
|
|
2
2
|
import i, { Suspense as p } from "react";
|
|
3
3
|
import { sortBy as a, filter as d, get as n } from "lodash";
|
|
4
|
-
import { Q as l, R as c } from "./index-
|
|
5
|
-
import "./
|
|
4
|
+
import { Q as l, R as c } from "./index-e6e838ec.js";
|
|
5
|
+
import "./MODIFIERS-2f19c314.js";
|
|
6
6
|
import "clsx";
|
|
7
7
|
import "@radix-ui/react-scroll-area";
|
|
8
8
|
import "react-dom";
|
|
@@ -23,15 +23,14 @@ import "@radix-ui/react-icons";
|
|
|
23
23
|
import "@radix-ui/react-toast";
|
|
24
24
|
import "react-hotkeys-hook";
|
|
25
25
|
import "flat-to-nested";
|
|
26
|
-
import "./html-to-json-
|
|
27
|
-
import "./MODIFIERS-c2e02614.js";
|
|
26
|
+
import "./html-to-json-45e0e3b5.js";
|
|
28
27
|
import "himalaya";
|
|
29
28
|
import "redux-undo";
|
|
30
29
|
import "@react-hookz/web";
|
|
31
30
|
import "@chaibuilder/blocks";
|
|
32
31
|
import "lucide-react";
|
|
33
32
|
import "sonner";
|
|
34
|
-
const x = i.lazy(() => import("./add-page-modal-
|
|
33
|
+
const x = i.lazy(() => import("./add-page-modal-8c9dad17.js")), g = i.lazy(() => import("./page-viewer-dec9a6d2.js")), O = () => {
|
|
35
34
|
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);
|
|
36
35
|
return /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
|
|
37
36
|
/* @__PURE__ */ t.jsxs("div", { className: "flex items-center justify-between rounded-md bg-background/30 p-1", children: [
|
|
@@ -43,5 +42,5 @@ const x = i.lazy(() => import("./add-page-modal-b3c84063.js")), g = i.lazy(() =>
|
|
|
43
42
|
] });
|
|
44
43
|
};
|
|
45
44
|
export {
|
|
46
|
-
|
|
45
|
+
O as default
|
|
47
46
|
};
|
|
@@ -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-2f61b040.cjs");require("@radix-ui/react-accordion");require("@radix-ui/react-icons");require("./utils-3c452dd0.cjs");require("clsx");require("tailwind-merge");require("./MODIFIERS-4716c669.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-aadcbf66.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-c7d95cc0.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;
|
|
@@ -2,13 +2,13 @@ import { j as e } from "./jsx-runtime-944c88e2.js";
|
|
|
2
2
|
import i, { useRef as x, useEffect as m, Suspense as n } from "react";
|
|
3
3
|
import { isEqual as j, isEmpty as b } from "lodash";
|
|
4
4
|
import { A as f, a as l, b as c, c as p } from "./accordion-c0176dc5.js";
|
|
5
|
-
import { S as h, R as g } from "./index-
|
|
5
|
+
import { S as h, R as g } from "./index-e6e838ec.js";
|
|
6
6
|
import "@radix-ui/react-accordion";
|
|
7
7
|
import "@radix-ui/react-icons";
|
|
8
8
|
import "./utils-ac68b2c8.js";
|
|
9
9
|
import "clsx";
|
|
10
10
|
import "tailwind-merge";
|
|
11
|
-
import "./
|
|
11
|
+
import "./MODIFIERS-2f19c314.js";
|
|
12
12
|
import "@radix-ui/react-scroll-area";
|
|
13
13
|
import "react-dom";
|
|
14
14
|
import "@floating-ui/react-dom";
|
|
@@ -25,19 +25,18 @@ import "@radix-ui/react-tooltip";
|
|
|
25
25
|
import "@radix-ui/react-toast";
|
|
26
26
|
import "react-hotkeys-hook";
|
|
27
27
|
import "flat-to-nested";
|
|
28
|
-
import "./html-to-json-
|
|
29
|
-
import "./MODIFIERS-c2e02614.js";
|
|
28
|
+
import "./html-to-json-45e0e3b5.js";
|
|
30
29
|
import "himalaya";
|
|
31
30
|
import "redux-undo";
|
|
32
31
|
import "@react-hookz/web";
|
|
33
32
|
import "@chaibuilder/blocks";
|
|
34
33
|
import "lucide-react";
|
|
35
34
|
import "sonner";
|
|
36
|
-
const N = i.lazy(() => import("./project-general-setting-
|
|
35
|
+
const N = i.lazy(() => import("./project-general-setting-067afe22.js")), S = i.lazy(() => import("./project-seo-setting-c1980ec3.js")), d = /* @__PURE__ */ e.jsx("div", { className: "px-3", children: /* @__PURE__ */ e.jsx("div", { className: "h-52 w-full animate-pulse rounded-md bg-gray-100" }) }), u = (t) => t && b(t.seoData) ? {
|
|
37
36
|
...t,
|
|
38
37
|
seoData: { title: "", description: "", image: "" }
|
|
39
38
|
} : t;
|
|
40
|
-
function
|
|
39
|
+
function re() {
|
|
41
40
|
const t = h(), { data: o } = g(), [r, a] = i.useState(
|
|
42
41
|
u(o || {})
|
|
43
42
|
), s = x(r);
|
|
@@ -66,5 +65,5 @@ function se() {
|
|
|
66
65
|
] });
|
|
67
66
|
}
|
|
68
67
|
export {
|
|
69
|
-
|
|
68
|
+
re as default
|
|
70
69
|
};
|