@chaibuilder/sdk 1.2.57 → 1.2.59
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/CanvasArea-NLbaLcFM.cjs +59 -0
- package/dist/{CanvasArea-8f_Ki3B7.js → CanvasArea-akw7npWW.js} +385 -366
- package/dist/{CurrentPage-nzo4lszx.js → CurrentPage-cOvRmEIZ.js} +2 -2
- package/dist/{CurrentPage-7aEIhzQ0.cjs → CurrentPage-pwDwQsWa.cjs} +1 -1
- package/dist/{ListTree-KUGhFsb_.js → ListTree-0iy8aBgI.js} +74 -53
- package/dist/{ListTree-A-097CZ-.cjs → ListTree-Njsk1AzL.cjs} +1 -1
- package/dist/{PagesPanel-hleqqZBo.js → PagesPanel-A3du_vDn.js} +3 -3
- package/dist/{PagesPanel-L1mI3y_6.cjs → PagesPanel-bfNUqq2a.cjs} +1 -1
- package/dist/{ProjectPanel-RXEhYr0a.js → ProjectPanel-92EtwSrh.js} +3 -3
- package/dist/{ProjectPanel-HTxa1kHv.cjs → ProjectPanel-QMaTK2Jx.cjs} +1 -1
- package/dist/{Settings-b1ZuIn4y.js → Settings-3ZuMFtd6.js} +2 -2
- package/dist/Settings-8_Twq9DO.cjs +1 -0
- package/dist/{SidePanels-_6WlMWq_.cjs → SidePanels-C8RdCe7y.cjs} +1 -1
- package/dist/{SidePanels-6hZeCR5Z.js → SidePanels-XUVc9jMH.js} +3 -3
- package/dist/{Topbar-WdGZIIZp.cjs → Topbar-EkBS5_nt.cjs} +1 -1
- package/dist/{Topbar-YfsC1DZ2.js → Topbar-VdVqOT-8.js} +1 -1
- package/dist/UILibrariesPanel-CaGLzB9c.cjs +1 -0
- package/dist/UILibrariesPanel-raxCToMd.js +216 -0
- package/dist/{add-page-modal-CtMwNEsW.js → add-page-modal-OH7DL-Yz.js} +2 -2
- package/dist/{add-page-modal-DA5P4pVu.cjs → add-page-modal-VmIvQ5ug.cjs} +1 -1
- package/dist/core.cjs +1 -1
- package/dist/core.js +1 -1
- package/dist/{delete-page-modal-TMpN1Dvm.js → delete-page-modal--g92Sj1h.js} +2 -2
- package/dist/{delete-page-modal-AvUZI9Tk.cjs → delete-page-modal-uSFaC2aS.cjs} +1 -1
- package/dist/email.cjs +1 -1
- package/dist/email.js +1 -1
- package/dist/{index-IgLSTkN6.js → index--t_K8Sw6.js} +1 -1
- package/dist/{index-zaKhyTQ6.cjs → index-4C2qT6ju.cjs} +1 -1
- package/dist/{index-sspgZwTk.cjs → index-Phf9F3An.cjs} +1 -1
- package/dist/{index--hN9ZQsP.js → index-yVCgnTlS.js} +2 -2
- package/dist/mockServiceWorker.js +18 -10
- package/dist/{page-viewer-D8nsi13f.js → page-viewer-hBsE440V.js} +3 -3
- package/dist/{page-viewer-2BMSxxfd.cjs → page-viewer-yIl2jRO8.cjs} +1 -1
- package/dist/{project-general-setting-HGjTNFRx.js → project-general-setting-9AGMKDNq.js} +2 -2
- package/dist/{project-general-setting--0hX9Otn.cjs → project-general-setting-NFCzMKqN.cjs} +1 -1
- package/dist/{single-page-detail-eMnjt_Ih.js → single-page-detail-5qDQmlL-.js} +3 -3
- package/dist/{single-page-detail-7BpYAyMO.cjs → single-page-detail-wwJYm5lF.cjs} +1 -1
- package/dist/studio.cjs +1 -1
- package/dist/studio.js +2 -2
- package/package.json +1 -1
- package/dist/CanvasArea-UisRL54b.cjs +0 -56
- package/dist/Settings-7EMwx6zL.cjs +0 -1
- package/dist/UILibrariesPanel-5QxxXYg2.js +0 -191
- package/dist/UILibrariesPanel-r8nQzXQ-.cjs +0 -1
|
@@ -0,0 +1,216 @@
|
|
|
1
|
+
import { j as e } from "./jsx-runtime-WbnYoNE9.js";
|
|
2
|
+
import { noop as S, has as y, first as p, isEmpty as I, get as B, values as P, groupBy as D, map as U, capitalize as _ } from "lodash-es";
|
|
3
|
+
import * as R from "react";
|
|
4
|
+
import L, { useState as T, useCallback as z, useEffect as G, useRef as O } from "react";
|
|
5
|
+
import { b8 as H, b9 as M, B as F, ba as J, bb as W, bc as $, bd as K, be as Y, bf as q, bg as Q, h as N, a2 as V, r as X, ad as Z, aF as ee, aG as te, aH as se, o as oe, aJ as re, S as ae, br as ne } from "./index-uLn8W3eR.js";
|
|
6
|
+
import { syncBlocksWithDefaults as ie, useChaiBlocks as le } from "@chaibuilder/runtime";
|
|
7
|
+
import { Loader as ce } from "lucide-react";
|
|
8
|
+
import { useAtom as j, atom as de } from "jotai";
|
|
9
|
+
import { c as A } from "./Functions-7jnEwJyw.js";
|
|
10
|
+
import { CaretSortIcon as me, CheckIcon as ue, CaretRightIcon as pe } from "@radix-ui/react-icons";
|
|
11
|
+
import { O as xe } from "./MODIFIERS-fd5XOmum.js";
|
|
12
|
+
import { useTranslation as E } from "react-i18next";
|
|
13
|
+
import { useFeature as fe } from "flagged";
|
|
14
|
+
import { d as he } from "./atoms-ZOWyNoiC.js";
|
|
15
|
+
import ge from "clsx";
|
|
16
|
+
import "./_commonjsHelpers-UyOWmZb0.js";
|
|
17
|
+
import "@radix-ui/react-toggle";
|
|
18
|
+
import "class-variance-authority";
|
|
19
|
+
import "./utils-VpVqnC9m.js";
|
|
20
|
+
import "tailwind-merge";
|
|
21
|
+
import "@radix-ui/react-switch";
|
|
22
|
+
import "@radix-ui/react-slot";
|
|
23
|
+
import "@radix-ui/react-accordion";
|
|
24
|
+
import "@radix-ui/react-alert-dialog";
|
|
25
|
+
import "@radix-ui/react-dialog";
|
|
26
|
+
import "@radix-ui/react-label";
|
|
27
|
+
import "@radix-ui/react-scroll-area";
|
|
28
|
+
import "@radix-ui/react-tabs";
|
|
29
|
+
import "@radix-ui/react-tooltip";
|
|
30
|
+
import "@radix-ui/react-popover";
|
|
31
|
+
import "@radix-ui/react-menubar";
|
|
32
|
+
import "@radix-ui/react-hover-card";
|
|
33
|
+
import "@radix-ui/react-select";
|
|
34
|
+
import "@radix-ui/react-dropdown-menu";
|
|
35
|
+
import "@radix-ui/react-separator";
|
|
36
|
+
import "@radix-ui/react-toast";
|
|
37
|
+
import "cmdk";
|
|
38
|
+
import "@radix-ui/react-context-menu";
|
|
39
|
+
import "react-icons-picker";
|
|
40
|
+
import "react-dom";
|
|
41
|
+
import "react-quill";
|
|
42
|
+
import "@react-hookz/web";
|
|
43
|
+
import "tree-model";
|
|
44
|
+
function je({
|
|
45
|
+
uiLibraries: t,
|
|
46
|
+
library: n,
|
|
47
|
+
setLibrary: i
|
|
48
|
+
}) {
|
|
49
|
+
var m;
|
|
50
|
+
const [d, l] = R.useState(!1), { t: s } = E();
|
|
51
|
+
return n ? /* @__PURE__ */ e.jsxs(H, { open: d, onOpenChange: l, children: [
|
|
52
|
+
/* @__PURE__ */ e.jsx(M, { asChild: !0, children: /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-x-2", children: [
|
|
53
|
+
/* @__PURE__ */ e.jsx("span", { children: s("Choose Library") }),
|
|
54
|
+
/* @__PURE__ */ e.jsxs(
|
|
55
|
+
F,
|
|
56
|
+
{
|
|
57
|
+
variant: "outline",
|
|
58
|
+
size: "sm",
|
|
59
|
+
role: "combobox",
|
|
60
|
+
"aria-expanded": d,
|
|
61
|
+
className: "w-[200px] justify-between",
|
|
62
|
+
children: [
|
|
63
|
+
n ? (m = t.find((a) => a.uuid === n)) == null ? void 0 : m.name : s("Select library"),
|
|
64
|
+
/* @__PURE__ */ e.jsx(me, { className: "ml-2 h-4 w-4 shrink-0 opacity-50" })
|
|
65
|
+
]
|
|
66
|
+
}
|
|
67
|
+
)
|
|
68
|
+
] }) }),
|
|
69
|
+
/* @__PURE__ */ e.jsx(J, { className: "w-[200px] p-0", children: /* @__PURE__ */ e.jsxs(W, { children: [
|
|
70
|
+
/* @__PURE__ */ e.jsx($, { placeholder: "Search library...", className: "h-9" }),
|
|
71
|
+
/* @__PURE__ */ e.jsxs(K, { children: [
|
|
72
|
+
/* @__PURE__ */ e.jsx(Y, { children: "No library found." }),
|
|
73
|
+
/* @__PURE__ */ e.jsx(q, { children: t.map((a) => /* @__PURE__ */ e.jsxs(
|
|
74
|
+
Q,
|
|
75
|
+
{
|
|
76
|
+
value: a.uuid,
|
|
77
|
+
onSelect: (u) => {
|
|
78
|
+
i(u), l(!1);
|
|
79
|
+
},
|
|
80
|
+
children: [
|
|
81
|
+
a.name,
|
|
82
|
+
/* @__PURE__ */ e.jsx(
|
|
83
|
+
ue,
|
|
84
|
+
{
|
|
85
|
+
className: A("ml-auto h-4 w-4", n === a.uuid ? "opacity-100" : "opacity-0")
|
|
86
|
+
}
|
|
87
|
+
)
|
|
88
|
+
]
|
|
89
|
+
},
|
|
90
|
+
a.uuid
|
|
91
|
+
)) })
|
|
92
|
+
] })
|
|
93
|
+
] }) })
|
|
94
|
+
] }) : null;
|
|
95
|
+
}
|
|
96
|
+
const be = ({
|
|
97
|
+
block: t,
|
|
98
|
+
closePopover: n,
|
|
99
|
+
library: i
|
|
100
|
+
}) => {
|
|
101
|
+
const [d, l] = T(!1), s = N("getUILibraryBlock", S), { addCoreBlock: m, addPredefinedBlock: a } = V(), [u, f] = X(), [, h] = Z(), [, b] = j(he), k = fe("dnd"), g = (o) => {
|
|
102
|
+
const r = y(o, "styles_attrs.data-page-section");
|
|
103
|
+
return o._type === "Box" && r;
|
|
104
|
+
}, c = z(
|
|
105
|
+
async (o) => {
|
|
106
|
+
if (o.stopPropagation(), y(t, "component")) {
|
|
107
|
+
m(t, p(u)), n();
|
|
108
|
+
return;
|
|
109
|
+
}
|
|
110
|
+
l(!0);
|
|
111
|
+
const r = await s(i, t);
|
|
112
|
+
let x = p(u);
|
|
113
|
+
g(p(r)) && (x = null), I(r) || a(ie(r), x), n();
|
|
114
|
+
},
|
|
115
|
+
[t]
|
|
116
|
+
), w = async (o) => {
|
|
117
|
+
const r = await s(i, t);
|
|
118
|
+
let x = p(u);
|
|
119
|
+
if (g(p(r)) && (x = null), !I(r)) {
|
|
120
|
+
const C = { blocks: r, uiLibrary: !0, parent: x };
|
|
121
|
+
if (o.dataTransfer.setData("text/plain", JSON.stringify(C)), t.preview) {
|
|
122
|
+
const v = new Image();
|
|
123
|
+
v.src = t.preview, v.onload = () => {
|
|
124
|
+
o.dataTransfer.setDragImage(v, 0, 0);
|
|
125
|
+
};
|
|
126
|
+
} else
|
|
127
|
+
o.dataTransfer.setDragImage(new Image(), 0, 0);
|
|
128
|
+
b(C), setTimeout(() => {
|
|
129
|
+
f([]), h(null), n();
|
|
130
|
+
}, 200);
|
|
131
|
+
}
|
|
132
|
+
};
|
|
133
|
+
return /* @__PURE__ */ e.jsxs(ee, { children: [
|
|
134
|
+
/* @__PURE__ */ e.jsx(te, { asChild: !0, children: /* @__PURE__ */ e.jsxs(
|
|
135
|
+
"div",
|
|
136
|
+
{
|
|
137
|
+
onClick: d ? () => {
|
|
138
|
+
} : c,
|
|
139
|
+
draggable: !0,
|
|
140
|
+
onDragStart: w,
|
|
141
|
+
className: ge(
|
|
142
|
+
"relative mt-2 cursor-pointer overflow-hidden rounded-md border border-gray-300 bg-white duration-200 hover:border-blue-500 hover:shadow-xl",
|
|
143
|
+
k ? "cursor-grab" : "cursor-pointer"
|
|
144
|
+
),
|
|
145
|
+
children: [
|
|
146
|
+
d && /* @__PURE__ */ e.jsxs("div", { className: "absolute flex h-full w-full items-center justify-center bg-black/70", children: [
|
|
147
|
+
/* @__PURE__ */ e.jsx(ce, { className: "animate-spin", size: 15, color: "white" }),
|
|
148
|
+
/* @__PURE__ */ e.jsx("span", { className: "pl-2 text-sm text-white", children: "Adding..." })
|
|
149
|
+
] }),
|
|
150
|
+
t.preview ? /* @__PURE__ */ e.jsx("img", { src: t.preview, className: "min-h-[25px] w-full rounded-md", alt: t.name }) : /* @__PURE__ */ e.jsx("div", { className: "flex h-20 items-center justify-center rounded-md border border-border border-gray-300 bg-gray-200", children: /* @__PURE__ */ e.jsx("p", { className: "max-w-xs text-center text-sm text-gray-700", children: t.name }) })
|
|
151
|
+
]
|
|
152
|
+
}
|
|
153
|
+
) }),
|
|
154
|
+
/* @__PURE__ */ e.jsx(se, { children: /* @__PURE__ */ e.jsx("p", { children: t.name }) })
|
|
155
|
+
] });
|
|
156
|
+
}, ke = de({}), we = (t) => {
|
|
157
|
+
const [n, i] = j(ke), d = N("getUILibraryBlocks", S), l = B(n, `${t == null ? void 0 : t.uuid}.blocks`, []), s = B(n, `${t == null ? void 0 : t.uuid}.loading`, !1);
|
|
158
|
+
return G(() => {
|
|
159
|
+
(async () => {
|
|
160
|
+
if (s || l.length > 0)
|
|
161
|
+
return;
|
|
162
|
+
i((a) => ({ ...a, [t == null ? void 0 : t.uuid]: { loading: !0, blocks: [] } }));
|
|
163
|
+
const m = await d(t);
|
|
164
|
+
i((a) => ({ ...a, [t == null ? void 0 : t.uuid]: { loading: !1, blocks: m || [] } }));
|
|
165
|
+
})();
|
|
166
|
+
}, [t, l, s]), { data: l, isLoading: s };
|
|
167
|
+
}, ve = oe("_selectedLibrary", null), Be = () => {
|
|
168
|
+
const [t, n] = j(ve), i = N("uiLibraries", []), d = le(), l = P(d).filter((o) => o.category === "custom"), s = i.find((o) => o.uuid === t) || p(i), { data: m, isLoading: a } = we(s), u = D([...m, ...l], "group"), [f, h] = T("Hero"), [, b] = j(re), k = B(u, f, []), { t: g } = E(), c = O(null), w = (o) => {
|
|
169
|
+
c.current && (clearTimeout(c.current), c.current = null), c.current = setTimeout(() => {
|
|
170
|
+
c.current && h(o);
|
|
171
|
+
}, 300);
|
|
172
|
+
};
|
|
173
|
+
return a ? /* @__PURE__ */ e.jsx(ae, { className: "h-full w-full" }) : /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsxs("div", { className: "relative flex h-full max-h-full w-[460px] flex-col overflow-hidden bg-background", children: [
|
|
174
|
+
s != null && s.uuid ? /* @__PURE__ */ e.jsx("div", { className: "sticky top-0 flex h-fit flex-col", children: /* @__PURE__ */ e.jsx("div", { className: "mb-2 flex flex-col justify-between rounded-md bg-background/30 p-1", children: /* @__PURE__ */ e.jsx("h1", { className: "flex w-full flex-col items-baseline truncate px-1 text-sm font-semibold xl:flex-col", children: /* @__PURE__ */ e.jsx(je, { library: s == null ? void 0 : s.uuid, setLibrary: n, uiLibraries: i }) }) }) }) : null,
|
|
175
|
+
/* @__PURE__ */ e.jsxs("div", { className: "flex h-[95%] border-t border-gray-300 pt-2", children: [
|
|
176
|
+
/* @__PURE__ */ e.jsx("div", { className: "flex h-full w-40 flex-col gap-1 px-1", children: L.Children.toArray(
|
|
177
|
+
U(u, (o, r) => /* @__PURE__ */ e.jsxs(
|
|
178
|
+
"div",
|
|
179
|
+
{
|
|
180
|
+
onMouseEnter: () => w(r),
|
|
181
|
+
onMouseLeave: () => clearTimeout(c.current),
|
|
182
|
+
onClick: () => h(r),
|
|
183
|
+
className: A(
|
|
184
|
+
"flex w-full cursor-pointer items-center justify-between rounded-md p-1 text-sm transition-all ease-in-out hover:bg-gray-200",
|
|
185
|
+
r === f ? "bg-blue-500 text-white hover:bg-blue-600" : ""
|
|
186
|
+
),
|
|
187
|
+
children: [
|
|
188
|
+
/* @__PURE__ */ e.jsx("span", { children: _(r) }),
|
|
189
|
+
/* @__PURE__ */ e.jsx(pe, { className: "ml-2 h-5 w-5" })
|
|
190
|
+
]
|
|
191
|
+
},
|
|
192
|
+
r
|
|
193
|
+
))
|
|
194
|
+
) }),
|
|
195
|
+
/* @__PURE__ */ e.jsxs(
|
|
196
|
+
ne,
|
|
197
|
+
{
|
|
198
|
+
onMouseEnter: () => c.current ? clearTimeout(c.current) : null,
|
|
199
|
+
className: "z-10 -mt-2 flex h-full max-h-full w-[300px] flex-col gap-2 border-l border-gray-300 transition-all ease-linear",
|
|
200
|
+
children: [
|
|
201
|
+
/* @__PURE__ */ e.jsx("div", { className: "sticky top-0 z-30 border-b border-gray-300 bg-gray-200 p-2 text-[9px] font-light leading-3 text-gray-500", children: g("Click on a block to add it to the page") }),
|
|
202
|
+
/* @__PURE__ */ e.jsx("div", { className: "flex flex-col gap-2 px-2", children: L.Children.toArray(
|
|
203
|
+
k.map((o) => /* @__PURE__ */ e.jsx(be, { block: o, library: s, closePopover: () => b(xe) }))
|
|
204
|
+
) }),
|
|
205
|
+
/* @__PURE__ */ e.jsx("br", {}),
|
|
206
|
+
/* @__PURE__ */ e.jsx("br", {}),
|
|
207
|
+
/* @__PURE__ */ e.jsx("br", {})
|
|
208
|
+
]
|
|
209
|
+
}
|
|
210
|
+
)
|
|
211
|
+
] })
|
|
212
|
+
] }) });
|
|
213
|
+
}, ut = () => /* @__PURE__ */ e.jsx(Be, {});
|
|
214
|
+
export {
|
|
215
|
+
ut as default
|
|
216
|
+
};
|
|
@@ -4,7 +4,7 @@ import { kebabCase as j } from "lodash-es";
|
|
|
4
4
|
import { av as C, B as u, au as b, aE as A } from "./index-uLn8W3eR.js";
|
|
5
5
|
import { g } from "./controls-yjgoZzB6.js";
|
|
6
6
|
import { F as D } from "./form-MSL4CDff.js";
|
|
7
|
-
import { e as N } from "./index
|
|
7
|
+
import { e as N } from "./index-yVCgnTlS.js";
|
|
8
8
|
import "./_commonjsHelpers-UyOWmZb0.js";
|
|
9
9
|
import "@radix-ui/react-toggle";
|
|
10
10
|
import "class-variance-authority";
|
|
@@ -42,7 +42,7 @@ import "tree-model";
|
|
|
42
42
|
import "react-i18next";
|
|
43
43
|
import "@rjsf/core";
|
|
44
44
|
import "@rjsf/validator-ajv8";
|
|
45
|
-
import "./index
|
|
45
|
+
import "./index--t_K8Sw6.js";
|
|
46
46
|
import "i18next";
|
|
47
47
|
import "@floating-ui/react-dom";
|
|
48
48
|
import "flagged";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-Z_BpKhVy.cjs"),x=require("react"),P=require("lodash-es"),t=require("./index-0FIxW0gR.cjs"),g=require("./controls-rRZhz0vu.cjs"),R=require("./form-G3PqS2Gc.cjs"),f=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-Z_BpKhVy.cjs"),x=require("react"),P=require("lodash-es"),t=require("./index-0FIxW0gR.cjs"),g=require("./controls-rRZhz0vu.cjs"),R=require("./form-G3PqS2Gc.cjs"),f=require("./index-4C2qT6ju.cjs");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("@radix-ui/react-toggle");require("class-variance-authority");require("./utils-D_vtk3zK.cjs");require("./MODIFIERS-mVmfEGgo.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-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("./Functions-N3yhPYKY.cjs");require("@chaibuilder/runtime");require("jotai");require("@react-hookz/web");require("tree-model");require("react-i18next");require("@rjsf/core");require("@rjsf/validator-ajv8");require("./index-Phf9F3An.cjs");require("i18next");require("@floating-ui/react-dom");require("flagged");require("react-hotkeys-hook");require("lucide-react");require("./index--mLLy7QQ.cjs");require("sonner");require("./html-to-json-ndxaXRT8.cjs");require("himalaya");require("lodash");const b=({closeModal:i})=>{var l,o;const u=f.useAddPage(),[r,m]=x.useState({name:"",slug:"",blocks:[],type:"STATIC",seoData:{},template:""}),p=()=>{u.mutate(r,{onSuccess:()=>i()})},j=({formData:n},s)=>{m(q=>{var d,c;const a={[s]:n[s]};return s==="name"?a.slug=P.kebabCase((d=n[s])==null?void 0:d.replace(/\d/g,"")):s==="slug"&&(a.slug=(c=n[s])==null?void 0:c.replace(/\d/g,"").replace(/\s+/g,"").replace("--","-").replace("__","_")),{...q,...a}})},h={name:g.g({title:"Page Name",default:r.name}),slug:g.g({title:"Page Slug",default:r.slug})};return e.jsxRuntimeExports.jsxs(t.DialogContent,{children:[e.jsxRuntimeExports.jsx("div",{className:"px-1 font-bold",children:"Add Page"}),e.jsxRuntimeExports.jsx(R.Form,{formData:r,properties:h,onChange:j,disabled:u.isPending}),e.jsxRuntimeExports.jsx("div",{className:"flex items-center justify-end",children:e.jsxRuntimeExports.jsx(t.Button,{type:"submit",disabled:!r.name||!r.slug||((l=r.name)==null?void 0:l.length)<2||((o=r.slug)==null?void 0:o.length)<2||u.isPending,onClick:p,children:"Add Page"})})]})},E=()=>{const[i,u]=x.useState(!1);return e.jsxRuntimeExports.jsxs(t.Dialog,{open:i,onOpenChange:()=>u(!i),children:[e.jsxRuntimeExports.jsx(t.DialogTrigger,{asChild:!0,children:e.jsxRuntimeExports.jsx(t.Button,{size:"sm",variant:"link",className:"text-blue-500",onClick:()=>u(!i),children:"+ New Page"})}),i&&e.jsxRuntimeExports.jsx(b,{closeModal:()=>u(!i)})]})};exports.default=E;
|
package/dist/core.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("./index-Phf9F3An.cjs"),e=require("./index-0FIxW0gR.cjs"),r=require("react-i18next");require("i18next");require("./jsx-runtime-Z_BpKhVy.cjs");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("react");require("clsx");require("react-dom");require("@radix-ui/react-scroll-area");require("@floating-ui/react-dom");require("jotai");require("flagged");require("lodash-es");require("./Functions-N3yhPYKY.cjs");require("tailwind-merge");require("@radix-ui/react-icons");require("react-hotkeys-hook");require("@chaibuilder/runtime");require("@react-hookz/web");require("lucide-react");require("./index--mLLy7QQ.cjs");require("@radix-ui/react-toggle");require("class-variance-authority");require("./utils-D_vtk3zK.cjs");require("./MODIFIERS-mVmfEGgo.cjs");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-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-quill");require("tree-model");exports.ChaiBuilderEditor=s.ChaiBuilderEditor;exports.useActiveModal=e.useActiveModal;exports.useActivePanel=e.useActivePanel;exports.useAddBlock=e.useAddBlock;exports.useAddBlockParent=e.useAddBlockParent;exports.useAddClassesToBlocks=e.useAddClassesToBlocks;exports.useAllBlocks=e.useAllBlocks;exports.useBlocksStore=e.useBlocksStore;exports.useBrandingOptions=e.useBrandingOptions;exports.useBuilderProp=e.useBuilderProp;exports.useBuilderReset=e.useBuilderReset;exports.useCanvasWidth=e.useCanvasWidth;exports.useCanvasZoom=e.useCanvasZoom;exports.useCodeEditor=e.useCodeEditor;exports.useCopyBlockIds=e.useCopyBlockIds;exports.useCopyToClipboard=e.useCopyToClipboard;exports.useCurrentPage=e.useCurrentPage;exports.useCutBlockIds=e.useCutBlockIds;exports.useDarkMode=e.useDarkMode;exports.useDuplicateBlocks=e.useDuplicateBlocks;exports.useGetPageData=e.useGetPageData;exports.useHiddenBlockIds=e.useHiddenBlockIds;exports.useHighlightBlockId=e.useHighlightBlockId;exports.usePasteBlocks=e.usePasteBlocks;exports.usePreviewMode=e.usePreviewMode;exports.useReadOnlyMode=e.useReadOnlyMode;exports.useRemoveBlocks=e.useRemoveBlocks;exports.useRemoveClassesFromBlocks=e.useRemoveClassesFromBlocks;exports.useSavePage=e.useSavePage;exports.useSelectedBlock=e.useSelectedBlock;exports.useSelectedBlockAllClasses=e.useSelectedBlockAllClasses;exports.useSelectedBlockCurrentClasses=e.useSelectedBlockCurrentClasses;exports.useSelectedBlockIds=e.useSelectedBlockIds;exports.useSelectedBlocksDisplayChild=e.useSelectedBlocksDisplayChild;exports.useSelectedBreakpoints=e.useSelectedBreakpoints;exports.useSelectedStylingBlocks=e.useSelectedStylingBlocks;exports.useStylingBreakpoint=e.useStylingBreakpoint;exports.useStylingState=e.useStylingState;exports.useUILibraryBlocks=e.useUILibraryBlocks;exports.useUndoManager=e.useUndoManager;exports.useUpdateBlocksProps=e.useUpdateBlocksProps;exports.useUpdateBlocksPropsRealtime=e.useUpdateBlocksPropsRealtime;Object.defineProperty(exports,"useTranslation",{enumerable:!0,get:()=>r.useTranslation});
|
package/dist/core.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { C as Z } from "./index
|
|
1
|
+
import { C as Z } from "./index--t_K8Sw6.js";
|
|
2
2
|
import { a1 as z, aq as J, a2 as K, ar as N, a3 as V, ap as Y, D as _, X as ss, h as es, u as as, a4 as os, a5 as ts, $ as rs, a6 as is, a7 as ps, a8 as ls, a9 as ms, aa as us, t as ds, ab as cs, ac as Bs, ad as ks, ae as ns, q as Cs, a0 as Ss, s as gs, af as Ps, Q as vs, ai as ys, ah as hs, ag as As, r as Is, ao as Ds, as as Ms, at as Rs, aj as fs, al as Us, ak as bs, v as xs, am as Ts, an as qs } from "./index-uLn8W3eR.js";
|
|
3
3
|
import { useTranslation as Hs } from "react-i18next";
|
|
4
4
|
import "i18next";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { j as e } from "./jsx-runtime-WbnYoNE9.js";
|
|
2
2
|
import { A as p, a as l, b as n, d, e as a, g as c, B as u } from "./index-uLn8W3eR.js";
|
|
3
|
-
import { h } from "./index
|
|
3
|
+
import { h } from "./index-yVCgnTlS.js";
|
|
4
4
|
import { TrashIcon as x } from "@radix-ui/react-icons";
|
|
5
5
|
import "./_commonjsHelpers-UyOWmZb0.js";
|
|
6
6
|
import "react";
|
|
@@ -38,7 +38,7 @@ import "jotai";
|
|
|
38
38
|
import "@react-hookz/web";
|
|
39
39
|
import "tree-model";
|
|
40
40
|
import "react-i18next";
|
|
41
|
-
import "./index
|
|
41
|
+
import "./index--t_K8Sw6.js";
|
|
42
42
|
import "i18next";
|
|
43
43
|
import "@floating-ui/react-dom";
|
|
44
44
|
import "flagged";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-Z_BpKhVy.cjs"),r=require("./index-0FIxW0gR.cjs"),l=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-Z_BpKhVy.cjs"),r=require("./index-0FIxW0gR.cjs"),l=require("./index-4C2qT6ju.cjs"),q=require("@radix-ui/react-icons");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("react");require("@radix-ui/react-toggle");require("class-variance-authority");require("./utils-D_vtk3zK.cjs");require("lodash-es");require("./MODIFIERS-mVmfEGgo.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("./Functions-N3yhPYKY.cjs");require("@chaibuilder/runtime");require("jotai");require("@react-hookz/web");require("tree-model");require("react-i18next");require("./index-Phf9F3An.cjs");require("i18next");require("@floating-ui/react-dom");require("flagged");require("react-hotkeys-hook");require("lucide-react");require("./index--mLLy7QQ.cjs");require("sonner");require("./html-to-json-ndxaXRT8.cjs");require("himalaya");require("lodash");const d=({pageData:i,projectData:t})=>{const n={},u=l.useDeletePage(),s=i.uuid===t.homepage,o=()=>{u.mutate(i,{onSuccess:()=>{n({uuid:t.homepage,slug:"/home"})}})};return e.jsxRuntimeExports.jsxs(r.AlertDialog,{children:[e.jsxRuntimeExports.jsx(r.AlertDialogTrigger,{disabled:s,children:e.jsxRuntimeExports.jsx("div",{className:`flex h-full items-center justify-center rounded-md border px-2 py-2 font-medium hover:bg-red-400 hover:text-white ${s?"cursor-not-allowed border-red-200 text-red-200":"cursor-pointer border-red-400 text-red-400"}`,children:e.jsxRuntimeExports.jsx(q.TrashIcon,{})})}),e.jsxRuntimeExports.jsxs(r.AlertDialogContent,{children:[e.jsxRuntimeExports.jsxs(r.AlertDialogTitle,{children:["Are you sure you want to delete ",e.jsxRuntimeExports.jsx("i",{className:"text-red-500",children:i.name})," page?"]}),e.jsxRuntimeExports.jsx(r.AlertDialogDescription,{children:"This action cannot be undone. This will permanently delete your page."}),e.jsxRuntimeExports.jsxs("div",{className:"flex items-center justify-end gap-x-3",children:[e.jsxRuntimeExports.jsx(r.AlertDialogCancel,{disabled:u.isPending,children:"Cancel"}),e.jsxRuntimeExports.jsx(r.Button,{variant:"destructive",onClick:o,disabled:u.isPending,children:"Yes, Delete"})]})]})]})};exports.default=d;
|
package/dist/email.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-Z_BpKhVy.cjs"),q=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-Z_BpKhVy.cjs"),q=require("./index-Phf9F3An.cjs"),r=require("@radix-ui/react-icons"),o=require("lodash-es");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("react");require("i18next");require("react-i18next");require("./index-0FIxW0gR.cjs");require("@radix-ui/react-toggle");require("class-variance-authority");require("./utils-D_vtk3zK.cjs");require("./MODIFIERS-mVmfEGgo.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("./Functions-N3yhPYKY.cjs");require("@chaibuilder/runtime");require("jotai");require("@react-hookz/web");require("tree-model");require("@floating-ui/react-dom");require("flagged");require("react-hotkeys-hook");require("lucide-react");require("./index--mLLy7QQ.cjs");const n=[{title:"Mobile",content:"Mobile email client",breakpoint:"xs",icon:e.jsxRuntimeExports.jsx(r.MobileIcon,{}),width:400},{title:"Email Client",content:"Content as seen inside an email client",breakpoint:"sm",icon:e.jsxRuntimeExports.jsx(r.MobileIcon,{className:"rotate-90"}),width:700}],s=i=>{const u={...i,filterChaiBlock:t=>o.includes(t.type,"Email/"),importHTMLSupport:!1,dataBindingSupport:!1,breakpoints:n};return e.jsxRuntimeExports.jsx(q.ChaiBuilderEditor,{...u})};exports.ChaiBuilderEmail=s;
|
package/dist/email.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { j as i } from "./jsx-runtime-WbnYoNE9.js";
|
|
2
|
-
import { C as p } from "./index
|
|
2
|
+
import { C as p } from "./index--t_K8Sw6.js";
|
|
3
3
|
import { MobileIcon as t } from "@radix-ui/react-icons";
|
|
4
4
|
import { includes as e } from "lodash-es";
|
|
5
5
|
import "./_commonjsHelpers-UyOWmZb0.js";
|
|
@@ -39715,7 +39715,7 @@ const ii1 = ({ blockId: t }) => {
|
|
|
39715
39715
|
/* @__PURE__ */ c1.jsx(oi1, { onOpen: (a) => e(a) }),
|
|
39716
39716
|
c ? null : /* @__PURE__ */ c1.jsx(ii1, { blockId: qv(t) })
|
|
39717
39717
|
] });
|
|
39718
|
-
}, di1 = ct(() => import("./SidePanels-
|
|
39718
|
+
}, di1 = ct(() => import("./SidePanels-XUVc9jMH.js")), hi1 = ct(() => import("./Topbar-VdVqOT-8.js")), ui1 = ct(() => import("./CanvasArea-akw7npWW.js")), vi1 = ct(() => import("./Settings-3ZuMFtd6.js")), gi1 = () => {
|
|
39719
39719
|
const { savePage: t } = uL(), c = W4("autoSaveSupport", !0), e = W4("autoSaveInterval", 60);
|
|
39720
39720
|
GL(() => {
|
|
39721
39721
|
c && t();
|