@chaibuilder/sdk 1.2.45 → 1.2.47
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/{AddBlocks-UjnfO1xM.cjs → AddBlocks-_fhhS7Lm.cjs} +1 -1
- package/dist/{AddBlocks-vkMNQu2M.js → AddBlocks-cX8vIt0V.js} +7 -7
- package/dist/{CanvasArea-DLg9e6l5.js → CanvasArea-HRipTJFS.js} +271 -263
- package/dist/CanvasArea-N3rYeBJV.cjs +55 -0
- package/dist/{ChaiBuilderEditor-iXQwbYNr.cjs → ChaiBuilderEditor-EtQOC5uy.cjs} +1 -1
- package/dist/{ChaiBuilderEditor-1K-wcF5D.js → ChaiBuilderEditor-dKHRL-Es.js} +20 -20
- package/dist/{CurrentPage-6t2cmyoQ.cjs → CurrentPage-9FijxWbn.cjs} +1 -1
- package/dist/{CurrentPage-JjZQQ8fp.js → CurrentPage-U8ms8Hs7.js} +2 -2
- package/dist/{ListTree-KsggM2ac.js → ListTree-OgLdyfQs.js} +1 -1
- package/dist/{ListTree-OTrtj3iM.cjs → ListTree-jOvHpo3_.cjs} +1 -1
- package/dist/{PagesPanel-zm1EC6Iw.cjs → PagesPanel-8Cd6UYsh.cjs} +1 -1
- package/dist/{PagesPanel-bElLBHNI.js → PagesPanel-MsUBq9Xx.js} +3 -3
- package/dist/{ProjectPanel-4zPiPARX.cjs → ProjectPanel-KmnXPfxx.cjs} +1 -1
- package/dist/{ProjectPanel-o1BnitsI.js → ProjectPanel-hsZG_Btj.js} +3 -3
- package/dist/{Settings-Bj2wI1at.js → Settings-WcLqIeQy.js} +8 -7
- package/dist/Settings-xVjTnVSf.cjs +1 -0
- package/dist/{SidePanels-9DSI8ysE.cjs → SidePanels-6zRgfZpi.cjs} +1 -1
- package/dist/{SidePanels-Q23Yldya.js → SidePanels-PmCljlnf.js} +2 -2
- package/dist/{ThemeConfiguration-GY85_LR8.js → ThemeConfiguration-mkbFdePB.js} +17 -17
- package/dist/{ThemeConfiguration-mgyKWvYY.cjs → ThemeConfiguration-pt7TTAty.cjs} +1 -1
- package/dist/{Topbar-_7BQ50Y4.cjs → Topbar--m1E08Jl.cjs} +1 -1
- package/dist/{Topbar-_T58hnmh.js → Topbar-FPywhpub.js} +1 -1
- package/dist/{UILibrariesPanel-28G5q5uW.cjs → UILibrariesPanel-HhHGcexY.cjs} +1 -1
- package/dist/{UILibrariesPanel-e9sgXFmR.js → UILibrariesPanel-VrA2X4LO.js} +1 -1
- package/dist/{UnsplashImages-2Iew1REO.js → UnsplashImages-7uAXYHPH.js} +1 -1
- package/dist/{UnsplashImages-wiV_0gCf.cjs → UnsplashImages-Yu0msAD8.cjs} +1 -1
- package/dist/{UploadImages--batsol9.js → UploadImages-5M0Q27R-.js} +1 -1
- package/dist/{UploadImages-XNNW2MnE.cjs → UploadImages-jS51ZcPG.cjs} +1 -1
- package/dist/{add-page-modal-1hTp3XOU.js → add-page-modal-6o7MAbq-.js} +3 -3
- package/dist/{add-page-modal-AvOI8Zy3.cjs → add-page-modal-KAbflupJ.cjs} +1 -1
- package/dist/{confirm-alert-8gHBC9xl.cjs → confirm-alert-dow0GlxC.cjs} +1 -1
- package/dist/{confirm-alert-pMcaye-H.js → confirm-alert-jL0z_gFv.js} +1 -1
- package/dist/core.cjs +1 -1
- package/dist/core.js +1 -1
- package/dist/{delete-page-modal--GqB4-ya.cjs → delete-page-modal-EDQZneVM.cjs} +1 -1
- package/dist/{delete-page-modal-pPp6AAO1.js → delete-page-modal-U5_JYYp7.js} +2 -2
- package/dist/email.cjs +1 -1
- package/dist/email.js +1 -1
- package/dist/{form-svmj4OQd.cjs → form-KBtrnNWh.cjs} +1 -1
- package/dist/{form-BbIs9ZUH.js → form-Sgpl2fXL.js} +1 -1
- package/dist/functions-7ybAMUuA.js +31 -0
- package/dist/functions-yvRwasT2.cjs +1 -0
- package/dist/{index-ssLLO7-s.cjs → index-HjN7LtDT.cjs} +1 -1
- package/dist/{index-GRkx-GlC.js → index-po-naEa5.js} +2 -2
- package/dist/lib.cjs +2 -3
- package/dist/lib.d.ts +11 -11
- package/dist/lib.js +175 -100
- package/dist/{page-viewer-0QMFEzfk.cjs → page-viewer-PfZEbcDZ.cjs} +1 -1
- package/dist/{page-viewer-3ne7tW8e.js → page-viewer-nLRRk7DR.js} +3 -3
- package/dist/{project-general-setting-cIjIy8PW.js → project-general-setting-D1UJdZ2D.js} +3 -3
- package/dist/{project-general-setting-oNYVjfNV.cjs → project-general-setting-HO6zeum2.cjs} +1 -1
- package/dist/{project-seo-setting-HLwPjaL2.js → project-seo-setting-VIZWEMRk.js} +2 -2
- package/dist/{project-seo-setting-5699qkWN.cjs → project-seo-setting-gT9N1tnB.cjs} +1 -1
- package/dist/render.cjs +1 -1
- package/dist/render.d.ts +2 -1
- package/dist/render.js +82 -80
- package/dist/{single-page-detail-amfiKMF_.cjs → single-page-detail-To8TcpgJ.cjs} +1 -1
- package/dist/{single-page-detail-MLxPXKfu.js → single-page-detail-lQ8fujC5.js} +4 -4
- package/dist/studio.cjs +1 -1
- package/dist/studio.js +2 -2
- package/dist/ui.cjs +1 -1
- package/dist/ui.js +1 -1
- package/dist/{useCanvasSettings-KDwtap3V.cjs → useCanvasSettings-7BXlDuLG.cjs} +1 -1
- package/dist/{useCanvasSettings-qs-7bwyA.js → useCanvasSettings-UzjYHFG5.js} +1 -1
- package/package.json +1 -1
- package/dist/CanvasArea-tyXurhEm.cjs +0 -57
- package/dist/Settings-7LXieIrg.cjs +0 -1
- package/dist/functions-ge87TVcc.js +0 -30
- package/dist/functions-sBiIevFh.cjs +0 -1
package/dist/render.js
CHANGED
|
@@ -1,30 +1,31 @@
|
|
|
1
|
-
import { j as
|
|
1
|
+
import { j as o } from "./jsx-runtime-WbnYoNE9.js";
|
|
2
2
|
import u from "react";
|
|
3
|
-
import { isString as _, memoize as N, get as
|
|
3
|
+
import { isString as _, memoize as N, get as l, isEmpty as h, each as $, filter as g, omit as R } from "lodash-es";
|
|
4
4
|
import { twMerge as T } from "tailwind-merge";
|
|
5
|
-
import { S as y, a as
|
|
6
|
-
import { a as F, g as W } from "./functions-
|
|
7
|
-
import { c as
|
|
5
|
+
import { S as y, a as f } from "./STRINGS--j49GZJP.js";
|
|
6
|
+
import { a as F, g as W } from "./functions-7ybAMUuA.js";
|
|
7
|
+
import { c as it } from "./functions-7ybAMUuA.js";
|
|
8
8
|
import { getBlockComponent as L } from "@chaibuilder/runtime";
|
|
9
9
|
import { Provider as Y } from "react-wrap-balancer";
|
|
10
10
|
import { B as I } from "./MODIFIERS-cBT31iqE.js";
|
|
11
11
|
import "./_commonjsHelpers-UyOWmZb0.js";
|
|
12
|
+
import "lodash";
|
|
12
13
|
const K = (t) => {
|
|
13
14
|
const s = {};
|
|
14
15
|
return Object.keys(t).forEach((n) => {
|
|
15
16
|
_(t[n]) && t[n].startsWith(y) && (s[n] = t[n].replace(y, "").split(","));
|
|
16
17
|
}), s;
|
|
17
18
|
}, U = N((t, s) => {
|
|
18
|
-
const n = t.replace(
|
|
19
|
-
return s ? F(r, s).replace(
|
|
19
|
+
const n = t.replace(f, "").split(","), r = T(n[0], n[1]);
|
|
20
|
+
return s ? F(r, s).replace(f, "").trim() : r.replace(f, "").trim();
|
|
20
21
|
});
|
|
21
22
|
function w(t, s) {
|
|
22
|
-
return
|
|
23
|
+
return l(t, `${s}_attrs`, {});
|
|
23
24
|
}
|
|
24
25
|
function z(t, s) {
|
|
25
26
|
const n = {};
|
|
26
27
|
return Object.keys(t).forEach((r) => {
|
|
27
|
-
if (_(t[r]) && t[r].startsWith(
|
|
28
|
+
if (_(t[r]) && t[r].startsWith(f)) {
|
|
28
29
|
const e = U(t[r], s);
|
|
29
30
|
n[r] = {
|
|
30
31
|
className: e,
|
|
@@ -34,22 +35,22 @@ function z(t, s) {
|
|
|
34
35
|
}), n;
|
|
35
36
|
}
|
|
36
37
|
function G(t, s) {
|
|
37
|
-
const n =
|
|
38
|
+
const n = l(t, "_bindings", {});
|
|
38
39
|
return h(n) ? { ...t } : ($(n, (r, e) => {
|
|
39
|
-
_(r) &&
|
|
40
|
+
_(r) && l(s, r, null) && (t[e] = l(s, r, null));
|
|
40
41
|
}), t);
|
|
41
42
|
}
|
|
42
43
|
function O(t) {
|
|
43
|
-
const { components: s, blocks: n, parent: r, classPrefix: e = "", externalData:
|
|
44
|
-
return /* @__PURE__ */
|
|
45
|
-
|
|
46
|
-
const
|
|
47
|
-
h(
|
|
48
|
-
|
|
49
|
-
|
|
44
|
+
const { components: s, blocks: n, parent: r, classPrefix: e = "", externalData: p = {} } = t, j = n, S = (c) => z(c, e), i = r ? g(n, { _parent: r }) : g(n, (c) => h(c._parent));
|
|
45
|
+
return /* @__PURE__ */ o.jsx(o.Fragment, { children: u.Children.toArray(
|
|
46
|
+
i.map((c, E) => {
|
|
47
|
+
const d = K(c), B = {};
|
|
48
|
+
h(d) || Object.keys(d).forEach((m) => {
|
|
49
|
+
B[m] = u.Children.toArray(
|
|
50
|
+
d[m].map((A) => /* @__PURE__ */ o.jsx(
|
|
50
51
|
O,
|
|
51
52
|
{
|
|
52
|
-
externalData:
|
|
53
|
+
externalData: p,
|
|
53
54
|
classPrefix: e,
|
|
54
55
|
blocks: j,
|
|
55
56
|
parent: A,
|
|
@@ -58,147 +59,148 @@ function O(t) {
|
|
|
58
59
|
))
|
|
59
60
|
);
|
|
60
61
|
});
|
|
61
|
-
const
|
|
62
|
-
|
|
62
|
+
const C = g(j, { _parent: c._id });
|
|
63
|
+
B.children = C.length > 0 ? /* @__PURE__ */ o.jsx(
|
|
63
64
|
O,
|
|
64
65
|
{
|
|
65
|
-
externalData:
|
|
66
|
+
externalData: p,
|
|
66
67
|
classPrefix: e,
|
|
67
|
-
parent:
|
|
68
|
+
parent: c._id,
|
|
68
69
|
blocks: j,
|
|
69
70
|
components: s
|
|
70
71
|
}
|
|
71
72
|
) : null;
|
|
72
|
-
const
|
|
73
|
-
if (
|
|
74
|
-
let
|
|
75
|
-
const A =
|
|
73
|
+
const a = l(s, c._type, null);
|
|
74
|
+
if (a !== null) {
|
|
75
|
+
let m = c;
|
|
76
|
+
const A = a;
|
|
76
77
|
return u.createElement(
|
|
77
78
|
A,
|
|
78
79
|
R(
|
|
79
80
|
{
|
|
80
|
-
...
|
|
81
|
+
...m,
|
|
81
82
|
index: E,
|
|
82
|
-
...G(
|
|
83
|
-
...
|
|
84
|
-
...
|
|
83
|
+
...G(c, p),
|
|
84
|
+
...S(m),
|
|
85
|
+
...B
|
|
85
86
|
},
|
|
86
87
|
["_parent"]
|
|
87
88
|
)
|
|
88
89
|
);
|
|
89
90
|
}
|
|
90
|
-
return /* @__PURE__ */
|
|
91
|
-
|
|
91
|
+
return /* @__PURE__ */ o.jsxs("noscript", { children: [
|
|
92
|
+
c._type,
|
|
92
93
|
" not found"
|
|
93
94
|
] });
|
|
94
95
|
})
|
|
95
96
|
) });
|
|
96
97
|
}
|
|
97
|
-
const
|
|
98
|
+
const q = (t) => {
|
|
98
99
|
const s = {};
|
|
99
100
|
return Object.keys(t).forEach((n) => {
|
|
100
101
|
_(t[n]) && t[n].startsWith(y) && (s[n] = t[n].replace(y, "").split(","));
|
|
101
102
|
}), s;
|
|
102
|
-
},
|
|
103
|
-
const n = t.replace(
|
|
104
|
-
return s === "" ? r.replace(
|
|
103
|
+
}, H = N((t, s) => {
|
|
104
|
+
const n = t.replace(f, "").split(","), r = T(n[0], n[1]);
|
|
105
|
+
return s === "" ? r.replace(f, "").trim() : F(r, s).replace(f, "").trim();
|
|
105
106
|
});
|
|
106
|
-
function H(t, s) {
|
|
107
|
-
return a(t, `${s}_attrs`, {});
|
|
108
|
-
}
|
|
109
107
|
function J(t, s) {
|
|
108
|
+
return l(t, `${s}_attrs`, {});
|
|
109
|
+
}
|
|
110
|
+
function M(t, s) {
|
|
110
111
|
const n = {};
|
|
111
112
|
return Object.keys(t).forEach((r) => {
|
|
112
|
-
if (_(t[r]) && t[r].startsWith(
|
|
113
|
-
const e =
|
|
113
|
+
if (_(t[r]) && t[r].startsWith(f)) {
|
|
114
|
+
const e = H(t[r], s);
|
|
114
115
|
n[r] = {
|
|
115
116
|
className: e,
|
|
116
|
-
...
|
|
117
|
+
...J(t, r)
|
|
117
118
|
};
|
|
118
119
|
}
|
|
119
120
|
}), n;
|
|
120
121
|
}
|
|
121
122
|
function P(t, s) {
|
|
122
|
-
const n =
|
|
123
|
+
const n = l(t, "_bindings", {});
|
|
123
124
|
return h(n) ? { ...t } : ($(n, (r, e) => {
|
|
124
|
-
_(r) &&
|
|
125
|
+
_(r) && l(s, r, null) && (t[e] = l(s, r, null));
|
|
125
126
|
}), t);
|
|
126
127
|
}
|
|
127
128
|
function x({
|
|
128
129
|
blocks: t,
|
|
129
130
|
parent: s,
|
|
130
131
|
classPrefix: n = "",
|
|
131
|
-
externalData: r = {}
|
|
132
|
+
externalData: r = {},
|
|
133
|
+
blockModifierCallback: e
|
|
132
134
|
}) {
|
|
133
|
-
const
|
|
134
|
-
return /* @__PURE__ */
|
|
135
|
-
|
|
136
|
-
const
|
|
137
|
-
h(
|
|
138
|
-
|
|
139
|
-
|
|
135
|
+
const p = t, j = (i) => M(i, n), S = s ? g(t, { _parent: s }) : g(t, (i) => h(i._parent));
|
|
136
|
+
return /* @__PURE__ */ o.jsx(o.Fragment, { children: u.Children.toArray(
|
|
137
|
+
S.map((i, c) => {
|
|
138
|
+
const E = q(i), d = {};
|
|
139
|
+
h(E) || Object.keys(E).forEach((a) => {
|
|
140
|
+
d[a] = u.Children.toArray(
|
|
141
|
+
E[a].map((m) => /* @__PURE__ */ o.jsx(
|
|
140
142
|
x,
|
|
141
143
|
{
|
|
142
144
|
externalData: r,
|
|
143
145
|
classPrefix: n,
|
|
144
|
-
blocks:
|
|
145
|
-
parent:
|
|
146
|
+
blocks: p,
|
|
147
|
+
parent: m
|
|
146
148
|
}
|
|
147
149
|
))
|
|
148
150
|
);
|
|
149
151
|
});
|
|
150
|
-
const B = g(
|
|
151
|
-
|
|
152
|
+
const B = g(p, { _parent: i._id });
|
|
153
|
+
d.children = B.length > 0 ? /* @__PURE__ */ o.jsx(
|
|
152
154
|
x,
|
|
153
155
|
{
|
|
154
156
|
externalData: r,
|
|
155
157
|
classPrefix: n,
|
|
156
|
-
parent:
|
|
157
|
-
blocks:
|
|
158
|
+
parent: i._id,
|
|
159
|
+
blocks: p
|
|
158
160
|
}
|
|
159
161
|
) : null;
|
|
160
|
-
const
|
|
161
|
-
if (
|
|
162
|
-
let
|
|
163
|
-
const
|
|
164
|
-
return
|
|
165
|
-
|
|
162
|
+
const C = L(i._type);
|
|
163
|
+
if (C !== null) {
|
|
164
|
+
let a = i;
|
|
165
|
+
const m = C.component;
|
|
166
|
+
return a = { ...C.defaults, ...i }, e && (a = e(a)), u.createElement(
|
|
167
|
+
m,
|
|
166
168
|
R(
|
|
167
169
|
{
|
|
168
170
|
blockProps: {},
|
|
169
171
|
inBuilder: !1,
|
|
170
|
-
...
|
|
171
|
-
index:
|
|
172
|
-
...P(
|
|
173
|
-
...
|
|
174
|
-
...
|
|
172
|
+
...a,
|
|
173
|
+
index: c,
|
|
174
|
+
...P(i, r),
|
|
175
|
+
...j(a),
|
|
176
|
+
...d
|
|
175
177
|
},
|
|
176
178
|
["_parent"]
|
|
177
179
|
)
|
|
178
180
|
);
|
|
179
181
|
}
|
|
180
|
-
return /* @__PURE__ */
|
|
181
|
-
|
|
182
|
+
return /* @__PURE__ */ o.jsxs("noscript", { children: [
|
|
183
|
+
i._type,
|
|
182
184
|
" not found"
|
|
183
185
|
] });
|
|
184
186
|
})
|
|
185
187
|
) });
|
|
186
188
|
}
|
|
187
|
-
const
|
|
189
|
+
const rt = ({
|
|
188
190
|
pageData: t,
|
|
189
191
|
externalData: s = {},
|
|
190
192
|
before: n = null,
|
|
191
193
|
after: r = null,
|
|
192
194
|
classPrefix: e = "c-"
|
|
193
195
|
}) => {
|
|
194
|
-
const
|
|
195
|
-
return /* @__PURE__ */
|
|
196
|
+
const p = l(t.project, "brandingOptions", I);
|
|
197
|
+
return /* @__PURE__ */ o.jsxs(o.Fragment, { children: [
|
|
196
198
|
n,
|
|
197
|
-
/* @__PURE__ */
|
|
199
|
+
/* @__PURE__ */ o.jsx(
|
|
198
200
|
"div",
|
|
199
201
|
{
|
|
200
|
-
className: e.replace("-", "") + " " + W(
|
|
201
|
-
children: /* @__PURE__ */
|
|
202
|
+
className: e.replace("-", "") + " " + W(p, e) + " min-h-screen",
|
|
203
|
+
children: /* @__PURE__ */ o.jsx(Y, { children: /* @__PURE__ */ o.jsx(x, { externalData: s, blocks: t.page.blocks || [], classPrefix: e }) })
|
|
202
204
|
}
|
|
203
205
|
),
|
|
204
206
|
r
|
|
@@ -206,7 +208,7 @@ const st = ({
|
|
|
206
208
|
};
|
|
207
209
|
export {
|
|
208
210
|
x as RenderChaiBlocks,
|
|
209
|
-
|
|
211
|
+
rt as RenderChaiPage,
|
|
210
212
|
O as RenderUnregisteredComponents,
|
|
211
|
-
|
|
213
|
+
it as convertToBlocks
|
|
212
214
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./jsx-runtime-Z_BpKhVy.cjs"),f=require("react"),c=require("lodash-es"),H=require("@radix-ui/react-icons"),y=require("./ChaiBuilderEditor-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./jsx-runtime-Z_BpKhVy.cjs"),f=require("react"),c=require("lodash-es"),H=require("@radix-ui/react-icons"),y=require("./ChaiBuilderEditor-EtQOC5uy.cjs"),d=require("./controls-jWJDao88.cjs"),w=require("sonner"),p=require("./form-KBtrnNWh.cjs"),P=require("./index-HjN7LtDT.cjs");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("clsx");require("react-dom");require("@radix-ui/react-scroll-area");require("@floating-ui/react-dom");require("jotai");require("i18next");require("react-i18next");require("flagged");require("./STRINGS-gPz7CUOk.cjs");require("./Functions-N3yhPYKY.cjs");require("tailwind-merge");require("@chaibuilder/runtime");require("@react-hookz/web");require("./MODIFIERS-YPHRtwrM.cjs");require("tree-model");require("./utils-K3Zk762G.cjs");require("@radix-ui/react-toggle");require("class-variance-authority");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("react-hotkeys-hook");require("lucide-react");require("@rjsf/core");require("@rjsf/validator-ajv8");require("./core.cjs");require("./html-to-json-VPWiWWGH.cjs");require("himalaya");const z=f.lazy(()=>Promise.resolve().then(()=>require("./delete-page-modal-EDQZneVM.cjs"))),L=f.lazy(()=>Promise.resolve().then(()=>require("./confirm-alert-dow0GlxC.cjs"))),E=n=>{if(!c.isString(n)||!(n.includes("/[")&&n.includes("]")))return!1;const s=/^\[((?:\.{3})?[a-zA-Z0-9_-]+)\]$/,q=/^[a-zA-Z0-9_-]+$/;let e=!0;return n.split("/").forEach(u=>{e&&(u.includes("[[")&&u.includes("]]")?e=/^\[\[\.{3}[a-zA-Z0-9_-]+\]\]$/.test(u):u.includes("[")&&u.includes("]")?e=s.test(u):e=q.test(u))}),e},h=n=>n&&c.isEmpty(n.seoData)?{...n,seoData:{title:"",description:"",image:""}}:n,G=(n,o)=>{const s=!c.isEqual(c.omit(n,["seoData"]),c.omit(o,["seoData"])),q=!c.isEqual(h(o).seoData,h(n).seoData);return s||q},Y=({open:n,setOpen:o,pageData:s})=>{const q=P.useQueryClient(),{data:e}=P.useProject(),u=P.useUpdatePage(),m=P.useUpdateProject("Homepage updated successfully."),[i,b]=f.useState(h(s)),[a,A]=f.useState({isHomePage:(e==null?void 0:e.homepage)===s.uuid}),j=G(i,s);f.useEffect(()=>{const l=!c.isEqual(h(s),i),t=(e==null?void 0:e.homepage)!==s.uuid&&a.isHomePage;o(l||t?"PENDING":"OPEN")},[e,s,i,a,o]);const C=()=>{if(j){if(s.type==="DYNAMIC"&&!E((i==null?void 0:i.slug)||"")){n==="ALERT"&&o("PENDING");return}u.mutate(i,{onSuccess:()=>{q.invalidateQueries({refetchType:"active",queryKey:["pages",e==null?void 0:e.uuid]}),o("CLOSE"),w.toast.success("Page updated successfully.")}})}a.isHomePage&&(e==null?void 0:e.homepage)!==s.uuid&&m.mutate({...e,homepage:s==null?void 0:s.uuid},{onSuccess:()=>o("CLOSE")})},R=({formData:l},t)=>{b(g=>{var S,N;if(!t)return g;const x={[t]:l[t]};return t==="name"?x.slug=c.kebabCase((S=l[t])==null?void 0:S.replace(/\d/g,"")):t==="slug"?x.slug=(N=l[t])==null?void 0:N.replace(/\d/g,"").replace(/\s+/g,"").replace("--","-").replace("__","_"):t==="seoData"&&(x.seoData={title:l[t].title||"",description:l[t].description||"",image:l[t].image||""}),{...g,...x}})},I=({formData:l},t)=>{A(g=>{const x={[t]:l[t]};return{...g,...x}})},v={name:d.l({title:"Page Name",default:i.name}),slug:d.l({title:"Page Slug",default:i.slug})},T={seoData:d.b({title:"",description:"",default:{title:"",description:"",image:""},properties:{title:d.l({title:"Meta Title",default:i.name}),description:d.g({title:"Meta Description",default:i.slug}),image:d.q({title:"Social Media Image",default:""})}})},M={isHomePage:d.r({title:"Set as homepage",default:a.isHomePage})};return r.jsxRuntimeExports.jsxs(y.ScrollArea,{className:"flex h-full select-none flex-col",children:[r.jsxRuntimeExports.jsx(L,{open:n==="ALERT",title:"Do yo want to save changes?",onCancel:()=>o("CLOSE"),onConfirm:C,disabled:m.isPending||u.isPending}),r.jsxRuntimeExports.jsx("div",{className:"rounded-md bg-background/30 px-2.5 py-1",children:r.jsxRuntimeExports.jsx("h1",{className:"px-1 font-semibold",children:"Page Details"})}),r.jsxRuntimeExports.jsx("div",{className:"px-2.5 pt-2",children:r.jsxRuntimeExports.jsxs("div",{className:"flex flex-col space-y-2",children:[r.jsxRuntimeExports.jsx(p.Form,{title:"Basic Details",formData:i,properties:v,onChange:R,disabled:u.isPending||m.isPending}),r.jsxRuntimeExports.jsx("div",{className:"h-2 w-full"}),r.jsxRuntimeExports.jsx(p.Form,{title:"SEO Details",formData:i,properties:T,onChange:R,disabled:u.isPending||m.isPending}),(e==null?void 0:e.homepage)!==s.uuid&&s.type==="STATIC"?r.jsxRuntimeExports.jsx(p.Form,{formData:a,properties:M,onChange:I,disabled:u.isPending||m.isPending}):s.type==="STATIC"&&r.jsxRuntimeExports.jsxs("div",{className:"flex items-center gap-x-1 px-1 pt-2 text-xs font-medium text-gray-500",children:[r.jsxRuntimeExports.jsx(H.HomeIcon,{})," This is homepage"," "]}),i.type==="DYNAMIC"&&!E((i==null?void 0:i.slug)||"")&&r.jsxRuntimeExports.jsxs("small",{className:"px-1 text-red-400",children:["Add dynamic ID in page slug Eg: ",r.jsxRuntimeExports.jsx("i",{className:"underline",children:"some-url/[some-id]"})]}),r.jsxRuntimeExports.jsxs("div",{className:"my-2 flex w-full items-center justify-between gap-x-2 px-1",children:[r.jsxRuntimeExports.jsx(y.Button,{className:"w-full",type:"submit",onClick:C,disabled:(e==null?void 0:e.homepage)!==s.uuid&&a.isHomePage?!1:c.isEmpty(i.name)||c.isEmpty(i.slug)||!j||u.isPending||m.isPending||i.type==="DYNAMIC"&&!E((i==null?void 0:i.slug)||""),children:"Save"}),r.jsxRuntimeExports.jsx(z,{pageData:s,projectData:e})]})]})})]})};exports.default=Y;
|
|
@@ -2,11 +2,11 @@ import { j as t } from "./jsx-runtime-WbnYoNE9.js";
|
|
|
2
2
|
import I, { useState as j, useEffect as z } from "react";
|
|
3
3
|
import { isString as L, isEmpty as x, isEqual as C, omit as y, kebabCase as q } from "lodash-es";
|
|
4
4
|
import { HomeIcon as B } from "@radix-ui/react-icons";
|
|
5
|
-
import { bf as G, B as Y } from "./ChaiBuilderEditor-
|
|
5
|
+
import { bf as G, B as Y } from "./ChaiBuilderEditor-dKHRL-Es.js";
|
|
6
6
|
import { l as g, b as Z, g as $, q as F, r as Q } from "./controls-VTdJhdSz.js";
|
|
7
7
|
import { toast as U } from "sonner";
|
|
8
|
-
import { F as P } from "./form-
|
|
9
|
-
import { f as V, a as X, g as _, b as K } from "./index-
|
|
8
|
+
import { F as P } from "./form-Sgpl2fXL.js";
|
|
9
|
+
import { f as V, a as X, g as _, b as K } from "./index-po-naEa5.js";
|
|
10
10
|
import "./_commonjsHelpers-UyOWmZb0.js";
|
|
11
11
|
import "clsx";
|
|
12
12
|
import "react-dom";
|
|
@@ -52,7 +52,7 @@ import "@rjsf/validator-ajv8";
|
|
|
52
52
|
import "./core.js";
|
|
53
53
|
import "./html-to-json-Z6R2o_fA.js";
|
|
54
54
|
import "himalaya";
|
|
55
|
-
const O = I.lazy(() => import("./delete-page-modal-
|
|
55
|
+
const O = I.lazy(() => import("./delete-page-modal-U5_JYYp7.js")), J = I.lazy(() => import("./confirm-alert-jL0z_gFv.js")), h = (r) => {
|
|
56
56
|
if (!L(r) || !(r.includes("/[") && r.includes("]")))
|
|
57
57
|
return !1;
|
|
58
58
|
const s = /^\[((?:\.{3})?[a-zA-Z0-9_-]+)\]$/, u = /^[a-zA-Z0-9_-]+$/;
|
package/dist/studio.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("./jsx-runtime-Z_BpKhVy.cjs");const e=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("./jsx-runtime-Z_BpKhVy.cjs");const e=require("./index-HjN7LtDT.cjs");require("react");require("sonner");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("./core.cjs");require("./ChaiBuilderEditor-EtQOC5uy.cjs");require("clsx");require("react-dom");require("@radix-ui/react-scroll-area");require("@floating-ui/react-dom");require("jotai");require("i18next");require("react-i18next");require("flagged");require("lodash-es");require("./STRINGS-gPz7CUOk.cjs");require("./Functions-N3yhPYKY.cjs");require("tailwind-merge");require("@chaibuilder/runtime");require("@react-hookz/web");require("./MODIFIERS-YPHRtwrM.cjs");require("tree-model");require("./utils-K3Zk762G.cjs");require("@radix-ui/react-toggle");require("class-variance-authority");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-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("react-hotkeys-hook");require("lucide-react");require("./html-to-json-VPWiWWGH.cjs");require("himalaya");exports.ChaiBuilderStudio=e.ChaiBuilderStudio;
|
package/dist/studio.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import "./jsx-runtime-WbnYoNE9.js";
|
|
2
|
-
import { C as Z } from "./index-
|
|
2
|
+
import { C as Z } from "./index-po-naEa5.js";
|
|
3
3
|
import "react";
|
|
4
4
|
import "sonner";
|
|
5
5
|
import "./_commonjsHelpers-UyOWmZb0.js";
|
|
6
6
|
import "./core.js";
|
|
7
|
-
import "./ChaiBuilderEditor-
|
|
7
|
+
import "./ChaiBuilderEditor-dKHRL-Es.js";
|
|
8
8
|
import "clsx";
|
|
9
9
|
import "react-dom";
|
|
10
10
|
import "@radix-ui/react-scroll-area";
|
package/dist/ui.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./ChaiBuilderEditor-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./ChaiBuilderEditor-EtQOC5uy.cjs");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("i18next");require("react-i18next");require("flagged");require("lodash-es");require("./STRINGS-gPz7CUOk.cjs");require("./Functions-N3yhPYKY.cjs");require("tailwind-merge");require("@chaibuilder/runtime");require("@react-hookz/web");require("./MODIFIERS-YPHRtwrM.cjs");require("tree-model");require("./utils-K3Zk762G.cjs");require("@radix-ui/react-toggle");require("class-variance-authority");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-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("react-hotkeys-hook");require("lucide-react");exports.Accordion=e.Accordion;exports.AccordionContent=e.AccordionContent;exports.AccordionItem=e.AccordionItem;exports.AccordionTrigger=e.AccordionTrigger;exports.Alert=e.Alert;exports.AlertDescription=e.AlertDescription;exports.AlertDialog=e.AlertDialog;exports.AlertDialogAction=e.AlertDialogAction;exports.AlertDialogCancel=e.AlertDialogCancel;exports.AlertDialogContent=e.AlertDialogContent;exports.AlertDialogDescription=e.AlertDialogDescription;exports.AlertDialogFooter=e.AlertDialogFooter;exports.AlertDialogHeader=e.AlertDialogHeader;exports.AlertDialogTitle=e.AlertDialogTitle;exports.AlertDialogTrigger=e.AlertDialogTrigger;exports.AlertTitle=e.AlertTitle;exports.Badge=e.Badge;exports.Button=e.Button;exports.Card=e.Card;exports.CardContent=e.CardContent;exports.CardDescription=e.CardDescription;exports.CardFooter=e.CardFooter;exports.CardHeader=e.CardHeader;exports.CardTitle=e.CardTitle;exports.Command=e.Command;exports.CommandDialog=e.CommandDialog;exports.CommandEmpty=e.CommandEmpty;exports.CommandGroup=e.CommandGroup;exports.CommandInput=e.CommandInput;exports.CommandItem=e.CommandItem;exports.CommandList=e.CommandList;exports.CommandSeparator=e.CommandSeparator;exports.CommandShortcut=e.CommandShortcut;exports.ContextMenu=e.ContextMenu;exports.ContextMenuCheckboxItem=e.ContextMenuCheckboxItem;exports.ContextMenuContent=e.ContextMenuContent;exports.ContextMenuGroup=e.ContextMenuGroup;exports.ContextMenuItem=e.ContextMenuItem;exports.ContextMenuLabel=e.ContextMenuLabel;exports.ContextMenuPortal=e.ContextMenuPortal;exports.ContextMenuRadioGroup=e.ContextMenuRadioGroup;exports.ContextMenuRadioItem=e.ContextMenuRadioItem;exports.ContextMenuSeparator=e.ContextMenuSeparator;exports.ContextMenuShortcut=e.ContextMenuShortcut;exports.ContextMenuSub=e.ContextMenuSub;exports.ContextMenuSubContent=e.ContextMenuSubContent;exports.ContextMenuSubTrigger=e.ContextMenuSubTrigger;exports.ContextMenuTrigger=e.ContextMenuTrigger;exports.Dialog=e.Dialog;exports.DialogContent=e.DialogContent;exports.DialogDescription=e.DialogDescription;exports.DialogFooter=e.DialogFooter;exports.DialogHeader=e.DialogHeader;exports.DialogTitle=e.DialogTitle;exports.DialogTrigger=e.DialogTrigger;exports.DropdownMenu=e.DropdownMenu;exports.DropdownMenuCheckboxItem=e.DropdownMenuCheckboxItem;exports.DropdownMenuContent=e.DropdownMenuContent;exports.DropdownMenuGroup=e.DropdownMenuGroup;exports.DropdownMenuItem=e.DropdownMenuItem;exports.DropdownMenuLabel=e.DropdownMenuLabel;exports.DropdownMenuPortal=e.DropdownMenuPortal;exports.DropdownMenuRadioGroup=e.DropdownMenuRadioGroup;exports.DropdownMenuRadioItem=e.DropdownMenuRadioItem;exports.DropdownMenuSeparator=e.DropdownMenuSeparator;exports.DropdownMenuShortcut=e.DropdownMenuShortcut;exports.DropdownMenuSub=e.DropdownMenuSub;exports.DropdownMenuSubContent=e.DropdownMenuSubContent;exports.DropdownMenuSubTrigger=e.DropdownMenuSubTrigger;exports.DropdownMenuTrigger=e.DropdownMenuTrigger;exports.HoverCard=e.HoverCard;exports.HoverCardContent=e.HoverCardContent;exports.HoverCardTrigger=e.HoverCardTrigger;exports.IconPickerField=e.IconPickerField;exports.ImagePickerField=e.ImagePickerField;exports.Input=e.Input;exports.Label=e.Label;exports.LinkField=e.LinkField;exports.Menubar=e.Menubar;exports.MenubarCheckboxItem=e.MenubarCheckboxItem;exports.MenubarContent=e.MenubarContent;exports.MenubarGroup=e.MenubarGroup;exports.MenubarItem=e.MenubarItem;exports.MenubarLabel=e.MenubarLabel;exports.MenubarMenu=e.MenubarMenu;exports.MenubarPortal=e.MenubarPortal;exports.MenubarRadioGroup=e.MenubarRadioGroup;exports.MenubarRadioItem=e.MenubarRadioItem;exports.MenubarSeparator=e.MenubarSeparator;exports.MenubarShortcut=e.MenubarShortcut;exports.MenubarSub=e.MenubarSub;exports.MenubarSubContent=e.MenubarSubContent;exports.MenubarSubTrigger=e.MenubarSubTrigger;exports.MenubarTrigger=e.MenubarTrigger;exports.Popover=e.Popover;exports.PopoverContent=e.PopoverContent;exports.PopoverTrigger=e.PopoverTrigger;exports.RTEField=e.RichTextEditorField;exports.ScrollArea=e.ScrollArea;exports.ScrollBar=e.ScrollBar;exports.Select=e.Select;exports.SelectContent=e.SelectContent;exports.SelectGroup=e.SelectGroup;exports.SelectItem=e.SelectItem;exports.SelectLabel=e.SelectLabel;exports.SelectSeparator=e.SelectSeparator;exports.SelectTrigger=e.SelectTrigger;exports.SelectValue=e.SelectValue;exports.Separator=e.Separator;exports.Sheet=e.Sheet;exports.SheetClose=e.SheetClose;exports.SheetContent=e.SheetContent;exports.SheetDescription=e.SheetDescription;exports.SheetFooter=e.SheetFooter;exports.SheetHeader=e.SheetHeader;exports.SheetTitle=e.SheetTitle;exports.SheetTrigger=e.SheetTrigger;exports.Skeleton=e.Skeleton;exports.Switch=e.Switch;exports.Tabs=e.Tabs;exports.TabsContent=e.TabsContent;exports.TabsList=e.TabsList;exports.TabsTrigger=e.TabsTrigger;exports.Textarea=e.Textarea;exports.Toaster=e.Toaster;exports.Toggle=e.Toggle;exports.Tooltip=e.Tooltip;exports.TooltipContent=e.TooltipContent;exports.TooltipPortal=e.TooltipPortal;exports.TooltipProvider=e.TooltipProvider;exports.TooltipTrigger=e.TooltipTrigger;exports.badgeVariants=e.badgeVariants;exports.buttonVariants=e.buttonVariants;exports.reducer=e.reducer;exports.toast=e.toast;exports.toggleVariants=e.toggleVariants;exports.useToast=e.useToast;
|
package/dist/ui.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { b5 as X, b8 as Y, b6 as Z, b7 as _, bp as J, bB as K, A as N, a3 as O, g as aa, b as ea, e as oa, f as ta, c as ra, d as sa, a as na, bq as ia, af as ba, B as pa, bk as ma, bn as ua, bm as la, bo as ca, bl as da, bD as ga, aS as Ca, cc as Ma, aV as Sa, aW as Da, aT as Ta, aX as xa, aU as Aa, ce as ha, cd as wa, bu as Ia, cf as Pa, bt as ka, ck as va, bs as Fa, ch as Ga, cl as La, cp as Ra, cg as Ha, ci as Va, cj as fa, cm as Ba, cn as ya, co as Ea, bv as $a, Z as ja, _ as qa, a1 as za, aY as Qa, $ as Ua, a0 as Wa, ab as Xa,
|
|
1
|
+
import { b5 as X, b8 as Y, b6 as Z, b7 as _, bp as J, bB as K, A as N, a3 as O, g as aa, b as ea, e as oa, f as ta, c as ra, d as sa, a as na, bq as ia, af as ba, B as pa, bk as ma, bn as ua, bm as la, bo as ca, bl as da, bD as ga, aS as Ca, cc as Ma, aV as Sa, aW as Da, aT as Ta, aX as xa, aU as Aa, ce as ha, cd as wa, bu as Ia, cf as Pa, bt as ka, ck as va, bs as Fa, ch as Ga, cl as La, cp as Ra, cg as Ha, ci as Va, cj as fa, cm as Ba, cn as ya, co as Ea, bv as $a, Z as ja, _ as qa, a1 as za, aY as Qa, $ as Ua, a0 as Wa, ab as Xa, au as Ya, az as Za, aw as _a, bg as Ja, bh as Ka, ax as Na, c4 as Oa, c8 as ae, c3 as ee, ay as oe, bi as te, c5 as re, c6 as se, c7 as ne, av as ie, ar as be, at as pe, as as me, b0 as ue, b1 as le, bd as ce, aC as de, b2 as ge, bG as Ce, bN as Me, bJ as Se, bT as De, bK as Te, bM as xe, bH as Ae, bQ as he, bO as we, bP as Ie, bL as Pe, bV as ke, bU as ve, bR as Fe, bS as Ge, bI as Le, aP as Re, aR as He, aQ as Ve, a$ as fe, bf as Be, bE as ye, a6 as Ee, a9 as $e, am as je, aa as qe, an as ze, bW as Qe, a7 as Ue, a8 as We, ap as Xe, bX as Ye, bZ as Ze, b_ as _e, c2 as Je, c0 as Ke, b$ as Ne, c1 as Oe, bY as ao, ah as eo, aq as oo, ai as to, al as ro, aj as so, ak as no, ba as io, cb as bo, by as po, ac as mo, ae as uo, be as lo, bF as co, ad as go, bC as Co, bA as Mo, c9 as So, ca as Do, bz as To, bc as xo } from "./ChaiBuilderEditor-dKHRL-Es.js";
|
|
2
2
|
import "./jsx-runtime-WbnYoNE9.js";
|
|
3
3
|
import "./_commonjsHelpers-UyOWmZb0.js";
|
|
4
4
|
import "react";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const t=require("jotai"),s=require("./ChaiBuilderEditor-
|
|
1
|
+
"use strict";const t=require("jotai"),s=require("./ChaiBuilderEditor-EtQOC5uy.cjs"),e=()=>t.useAtom(s.canvasSettingsAtom);exports.useCanvasSettings=e;
|
package/package.json
CHANGED
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
"use strict";var ne=Object.defineProperty;var oe=(o,s,e)=>s in o?ne(o,s,{enumerable:!0,configurable:!0,writable:!0,value:e}):o[s]=e;var I=(o,s,e)=>(oe(o,typeof s!="symbol"?s+"":s,e),e);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./jsx-runtime-Z_BpKhVy.cjs"),h=require("react"),c=require("lodash-es"),R=require("@radix-ui/react-icons"),i=require("./ChaiBuilderEditor-iXQwbYNr.cjs"),N=require("react-i18next"),b=require("jotai"),re=require("lucide-react"),z=require("react-dom"),E=require("prop-types"),ie=require("react-quill"),_=require("./atoms-a0H_593V.cjs"),le=require("@floating-ui/dom"),W=require("@floating-ui/react-dom"),ce=require("@react-hookz/web"),ae=require("flagged"),de=require("@tailwindcss/typography"),ue=require("@tailwindcss/forms"),pe=require("@tailwindcss/aspect-ratio"),he=require("tailwindcss-palette-generator"),xe=require("tailwind-merge"),M=require("./STRINGS-gPz7CUOk.cjs"),me=require("@chaibuilder/runtime"),ge=require("./useCanvasSettings-KDwtap3V.cjs"),fe=require("react-wrap-balancer");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("clsx");require("@radix-ui/react-scroll-area");require("i18next");require("./Functions-N3yhPYKY.cjs");require("./MODIFIERS-YPHRtwrM.cjs");require("tree-model");require("./utils-K3Zk762G.cjs");require("@radix-ui/react-toggle");require("class-variance-authority");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-hotkeys-hook");const ve=()=>{const{hasUndo:o,hasRedo:s,undo:e,redo:t}=i.useUndoManager();return r.jsxRuntimeExports.jsxs("div",{className:"flex items-center",children:[r.jsxRuntimeExports.jsx(i.Button,{disabled:!o(),size:"sm",onClick:e,className:"rounded-full",variant:"ghost",children:r.jsxRuntimeExports.jsx(R.ResetIcon,{})}),r.jsxRuntimeExports.jsx(i.Button,{disabled:!s(),onClick:t,size:"sm",className:"rounded-full",variant:"ghost",children:r.jsxRuntimeExports.jsx(R.ResetIcon,{className:"rotate-180 scale-y-[-1] transform"})})]})};function je(){const[o,s]=i.useDarkMode(),{t:e}=N.useTranslation();return r.jsxRuntimeExports.jsxs("div",{className:"flex items-center",children:[r.jsxRuntimeExports.jsx(i.Label,{htmlFor:"dark-mode-switch",children:e("dark_mode")}),r.jsxRuntimeExports.jsxs(i.Switch,{id:"dark-mode-switch",checked:o,onCheckedChange:()=>{s(!o)},className:`${o?"bg-violet-600":"bg-violet-300"}
|
|
2
|
-
relative ml-2 inline-flex h-[20px] w-[40px] shrink-0 cursor-pointer rounded-full border-2 border-transparent transition-colors duration-200 ease-in-out focus:outline-none focus-visible:ring-2 focus-visible:ring-white focus-visible:ring-opacity-75`,children:[r.jsxRuntimeExports.jsx("span",{className:"sr-only",children:e("use_setting")}),r.jsxRuntimeExports.jsx("span",{"aria-hidden":"true",className:`${o?"translate-x-5":"translate-x-0"}
|
|
3
|
-
pointer-events-none -mt-px inline-block h-[18px] w-[20px] transform rounded-full bg-white shadow-lg ring-0 transition duration-200 ease-in-out`})]})]})}const K=({landscape:o=!1})=>r.jsxRuntimeExports.jsxs("svg",{className:o?"rotate-90":"",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 13 13",xmlSpace:"preserve",width:13,height:13,children:[r.jsxRuntimeExports.jsx("g",{strokeWidth:0}),r.jsxRuntimeExports.jsx("g",{strokeLinecap:"round",strokeLinejoin:"round"}),r.jsxRuntimeExports.jsx("path",{d:"M10.65 0H2.349a.851.851 0 0 0-.851.852v11.299c0 .47.382.852.851.852h8.3a.851.851 0 0 0 .851-.852V.852A.851.851 0 0 0 10.65 0zM6.599 12.466a.367.367 0 1 1 0-.735.367.367 0 0 1 0 .735zm3.9-1.267H2.5V1h8.001v10.199z",style:{fill:"#000"}})]}),$e=[{title:"mobile_xs_title",content:"mobile_xs_content",breakpoint:"xs",icon:r.jsxRuntimeExports.jsx(R.MobileIcon,{}),width:400},{title:"mobile_sm_title",content:"mobile_sm_content",breakpoint:"sm",icon:r.jsxRuntimeExports.jsx(R.MobileIcon,{className:"rotate-90"}),width:640},{title:"tablet_md_title",content:"tablet_md_content",breakpoint:"md",icon:r.jsxRuntimeExports.jsx(K,{}),width:800},{title:"tablet_lg_title",content:"tablet_lg_content",breakpoint:"lg",icon:r.jsxRuntimeExports.jsx(K,{landscape:!0}),width:1024},{title:"desktop_xl_title",content:"desktop_xl_content",breakpoint:"xl",icon:r.jsxRuntimeExports.jsx(R.LaptopIcon,{}),width:1420},{title:"large_desktop_2xl_title",content:"large_desktop_2xl_content",breakpoint:"2xl",icon:r.jsxRuntimeExports.jsx(R.DesktopIcon,{}),width:1920}],Y=({title:o,content:s,currentBreakpoint:e,breakpoint:t,width:n,icon:u,onClick:a})=>{const{t:l}=N.useTranslation();return r.jsxRuntimeExports.jsxs(i.HoverCard,{children:[r.jsxRuntimeExports.jsx(i.HoverCardTrigger,{asChild:!0,children:r.jsxRuntimeExports.jsx(i.Button,{onClick:()=>a(n),size:"sm",variant:t===e?"secondary":"ghost",children:u})}),r.jsxRuntimeExports.jsx(i.HoverCardContent,{className:"w-52 border-border",children:r.jsxRuntimeExports.jsx("div",{className:"flex justify-between space-x-4",children:r.jsxRuntimeExports.jsxs("div",{className:"space-y-1",children:[r.jsxRuntimeExports.jsx("h4",{className:"text-sm font-semibold",children:l(o)}),r.jsxRuntimeExports.jsx("p",{className:"text-xs",children:l(s)})]})})})]})},ye=()=>{const[,o,s]=i.useCanvasWidth(),[e,t]=i.useSelectedBreakpoints(),{t:n}=N.useTranslation(),u=i.useBuilderProp("breakpoints",$e),a=l=>{e.includes(l)?e.length>2&&t(e.filter(p=>p!==l)):t(p=>[...p,l])};return u.length<4?r.jsxRuntimeExports.jsx("div",{className:"flex items-center rounded-md",children:c.map(u,l=>h.createElement(Y,{...l,onClick:s,key:l.breakpoint,currentBreakpoint:o}))}):r.jsxRuntimeExports.jsxs("div",{className:"flex items-center rounded-md",children:[c.map(u.filter(l=>c.includes(e,c.toUpper(l.breakpoint))),l=>h.createElement(Y,{...l,onClick:s,key:l.breakpoint,currentBreakpoint:o})),r.jsxRuntimeExports.jsxs(i.DropdownMenu,{children:[r.jsxRuntimeExports.jsx(i.DropdownMenuTrigger,{asChild:!0,children:r.jsxRuntimeExports.jsx("span",{className:"cursor-pointer px-2.5 hover:opacity-80",children:r.jsxRuntimeExports.jsx(R.DotsVerticalIcon,{className:"scale-90 transform"})})}),r.jsxRuntimeExports.jsxs(i.DropdownMenuContent,{className:"w-56 border-border text-xs",children:[r.jsxRuntimeExports.jsx(i.DropdownMenuLabel,{children:n("Breakpoints")}),r.jsxRuntimeExports.jsx(i.DropdownMenuSeparator,{}),c.map(u,l=>r.jsxRuntimeExports.jsx(i.DropdownMenuCheckboxItem,{disabled:l.breakpoint==="xs",onCheckedChange:()=>a(c.toUpper(l.breakpoint)),checked:c.includes(e,c.toUpper(l.breakpoint)),children:n(l.title)},l.breakpoint))]})]})]})},be=()=>{const{t:o}=N.useTranslation(),{setNewBlocks:s}=i.useBlocksStoreUndoableActions(),[,e]=i.useSelectedBlockIds(),[,t]=i.useSelectedStylingBlocks(),n=h.useCallback(()=>{s([]),e([]),t([])},[s]);return r.jsxRuntimeExports.jsx("div",{className:"flex items-center",children:r.jsxRuntimeExports.jsxs(i.AlertDialog,{children:[r.jsxRuntimeExports.jsx(i.AlertDialogTrigger,{asChild:!0,children:r.jsxRuntimeExports.jsxs(i.Button,{size:"sm",variant:"ghost",className:"flex items-center gap-x-1",children:[r.jsxRuntimeExports.jsx(R.EraserIcon,{})," ",o("clear")]})}),r.jsxRuntimeExports.jsxs(i.AlertDialogContent,{className:"border-border",children:[r.jsxRuntimeExports.jsxs(i.AlertDialogHeader,{children:[r.jsxRuntimeExports.jsx(i.AlertDialogTitle,{children:o("clear_canvas_title")}),r.jsxRuntimeExports.jsx(i.AlertDialogDescription,{children:o("clear_canvas_description")})]}),r.jsxRuntimeExports.jsxs(i.AlertDialogFooter,{children:[r.jsxRuntimeExports.jsx(i.AlertDialogCancel,{children:o("cancel")}),r.jsxRuntimeExports.jsx(i.AlertDialogAction,{onClick:n,children:o("yes")})]})]})]})})},ke=()=>{const[o,s]=b.useAtom(i.aiAssistantActiveAtom);return i.useBuilderProp("askAiCallBack",null)?r.jsxRuntimeExports.jsxs("div",{className:"flex items-center space-x-2",children:[r.jsxRuntimeExports.jsxs(i.Label,{htmlFor:"ai-assistant",className:"flex items-center gap-x-1 text-sm text-yellow-600",children:[r.jsxRuntimeExports.jsx(re.SparklesIcon,{className:"w-4"}),"AI Assistant"]}),r.jsxRuntimeExports.jsx(i.Switch,{className:"scale-90",checked:o,onCheckedChange:t=>{s(t)},id:"ai-assitantt"})]}):null},Ee=()=>{const o=i.useBuilderProp("darkMode",!1),[s]=i.useCanvasZoom();return r.jsxRuntimeExports.jsxs("div",{className:"flex h-10 items-center justify-between border-b bg-background/70 px-2",children:[r.jsxRuntimeExports.jsxs("div",{className:"flex h-full space-x-2",children:[o?r.jsxRuntimeExports.jsxs(r.jsxRuntimeExports.Fragment,{children:[r.jsxRuntimeExports.jsx(je,{}),r.jsxRuntimeExports.jsx(i.Separator,{orientation:"vertical"})]}):null,r.jsxRuntimeExports.jsx(ye,{}),r.jsxRuntimeExports.jsx(i.Separator,{orientation:"vertical"}),r.jsxRuntimeExports.jsxs("div",{className:"flex w-12 cursor-not-allowed items-center justify-center gap-x-1 space-x-0 font-medium text-gray-400",children:[r.jsxRuntimeExports.jsx(R.ZoomInIcon,{className:"h-3.5 w-3.5 flex-shrink-0"})," ",r.jsxRuntimeExports.jsxs("div",{className:"text-xs leading-3",children:[c.round(s,0),"%"]})]}),r.jsxRuntimeExports.jsx(i.Separator,{orientation:"vertical"}),r.jsxRuntimeExports.jsx(ve,{})]}),r.jsxRuntimeExports.jsxs("div",{className:"flex h-full items-center space-x-2",children:[r.jsxRuntimeExports.jsx(be,{}),r.jsxRuntimeExports.jsx(i.Separator,{orientation:"vertical"}),r.jsxRuntimeExports.jsx(ke,{})]})]})},Re=`<!doctype html>
|
|
4
|
-
<html lang="en" dir="__HTML_DIR__" class="scroll-smooth h-full overflow-y-auto">
|
|
5
|
-
<head>
|
|
6
|
-
<meta charset="UTF-8">
|
|
7
|
-
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
8
|
-
<script src="https://cdn.tailwindcss.com?plugins=forms,typography,aspect-ratio"><\/script>
|
|
9
|
-
<style>
|
|
10
|
-
html { height: 100%; overflow:auto; }
|
|
11
|
-
body { height: 100%; }
|
|
12
|
-
.air-highlight{ outline: 1px solid #42a1fc !important; outline-offset: -1px;}
|
|
13
|
-
.air-highlight-multi{ outline: 1px solid #29e503 !important; outline-offset: -1px;}
|
|
14
|
-
body{ -webkit-touch-callout: none; -webkit-user-select: none; -khtml-user-select: none;
|
|
15
|
-
-moz-user-select: none;-ms-user-select: none; user-select: none; }
|
|
16
|
-
html{
|
|
17
|
-
-ms-overflow-style: none; /* IE and Edge */
|
|
18
|
-
scrollbar-width: none; /* Firefox */
|
|
19
|
-
}
|
|
20
|
-
/** IMPORTANT: Make fields content editable in SAFARI */
|
|
21
|
-
[contenteditable] {-webkit-user-select: text;user-select: text;}
|
|
22
|
-
|
|
23
|
-
html::-webkit-scrollbar { width: 0 !important }
|
|
24
|
-
.aspect-auto{aspect-ratio: auto;}
|
|
25
|
-
.aspect-square{aspect-ratio: 1/1;}
|
|
26
|
-
.aspect-video{aspect-ratio: 16/9;}
|
|
27
|
-
.dragging [data-dnd="leaf"] { pointer-events: none; } .dragging [data-dnd="leaf"] * { pointer-events: none; }
|
|
28
|
-
.dragging [data-dnd="ignore"], .dragging [data-dnd="ignore"] * { pointer-events: none; }
|
|
29
|
-
a{ pointer-events: none !important; }
|
|
30
|
-
[contenteditable="true"], [contenteditable="true"] * { cursor: text !important; }
|
|
31
|
-
[contenteditable="true"] {
|
|
32
|
-
outline: none;
|
|
33
|
-
box-shadow: 0 0 0px 4px rgba(36, 150, 255, 0.2);
|
|
34
|
-
-webkit-user-select: text;
|
|
35
|
-
-moz-user-select: text;
|
|
36
|
-
user-select: text;
|
|
37
|
-
}
|
|
38
|
-
.frame-root .frame-content { height: 100%; }
|
|
39
|
-
[data-drop="yes"] { outline: 2px dashed orange !important; outline-offset: -2px }
|
|
40
|
-
[data-dnd="no"] { pointer-events: none !important; }
|
|
41
|
-
</style>
|
|
42
|
-
<style id="hidden-blocks"></style>
|
|
43
|
-
<style id="selected-block"></style>
|
|
44
|
-
<style id="selected-styling-block"></style>
|
|
45
|
-
<style id="highlighted-block"></style>
|
|
46
|
-
<style id="dragged-block"></style>
|
|
47
|
-
|
|
48
|
-
</head>
|
|
49
|
-
<body class="font-body antialiased h-full">
|
|
50
|
-
<div class="frame-root h-full"></div>
|
|
51
|
-
<script src="https://cdn.jsdelivr.net/npm/quill@2.0.0/dist/quill.js"><\/script>
|
|
52
|
-
</body>
|
|
53
|
-
</html>`,we=o=>{const[s]=i.useCanvasWidth(),[,e]=i.useCanvasZoom(),[t,n]=h.useState({}),u=h.useCallback(()=>{const{width:a,height:l}=o;if(a<s){const p=parseFloat((a/s).toFixed(2).toString());let d={};const g=l*p;l&&(d={height:100+(l-g)/g*100+"%"}),n({position:"relative",top:0,transform:`scale(${p})`,transformOrigin:"top left",...d,maxWidth:"none"}),e(p*100)}else n({}),e(100)},[s,o,e]);return h.useEffect(()=>{u()},[s,o,e,u]),t};let Q,X;typeof document<"u"&&(Q=document);typeof window<"u"&&(X=window);const G=h.createContext({document:Q,window:X}),T=()=>h.useContext(G),{Provider:Se,Consumer:tt}=G;class J extends h.Component{componentDidMount(){this.props.contentDidMount()}componentDidUpdate(){this.props.contentDidUpdate()}render(){return h.Children.only(this.props.children)}}I(J,"propTypes",{children:E.element.isRequired,contentDidMount:E.func.isRequired,contentDidUpdate:E.func.isRequired});class P extends h.Component{constructor(e,t){super(e,t);I(this,"setRef",e=>{this.nodeRef.current=e;const{forwardedRef:t}=this.props;typeof t=="function"?t(e):t&&(t.current=e)});I(this,"handleLoad",()=>{clearInterval(this.loadCheck),this.state.iframeLoaded||this.setState({iframeLoaded:!0})});I(this,"loadCheck",()=>setInterval(()=>{this.handleLoad()},500));this._isMounted=!1,this.nodeRef=h.createRef(),this.state={iframeLoaded:!1}}componentDidMount(){this._isMounted=!0,this.getDoc()&&this.nodeRef.current.contentWindow.addEventListener("DOMContentLoaded",this.handleLoad)}componentWillUnmount(){this._isMounted=!1,this.nodeRef.current.removeEventListener("DOMContentLoaded",this.handleLoad)}getDoc(){return this.nodeRef.current?this.nodeRef.current.contentDocument:null}getMountTarget(){const e=this.getDoc();return this.props.mountTarget?e.querySelector(this.props.mountTarget):e.body.children[0]}renderFrameContents(){if(!this._isMounted)return null;const e=this.getDoc();if(!e)return null;const t=this.props.contentDidMount,n=this.props.contentDidUpdate,u=e.defaultView||e.parentView,a=r.jsxRuntimeExports.jsx(J,{contentDidMount:t,contentDidUpdate:n,children:r.jsxRuntimeExports.jsx(Se,{value:{document:e,window:u},children:r.jsxRuntimeExports.jsx("div",{className:"frame-content",children:this.props.children})})}),l=this.getMountTarget();return[z.createPortal(this.props.head,this.getDoc().head),z.createPortal(a,l)]}render(){const e={...this.props,srcDoc:this.props.initialContent,children:void 0};return delete e.head,delete e.initialContent,delete e.mountTarget,delete e.contentDidMount,delete e.contentDidUpdate,delete e.forwardedRef,r.jsxRuntimeExports.jsx("iframe",{...e,ref:this.setRef,onLoad:this.handleLoad,children:this.state.iframeLoaded&&this.renderFrameContents()})}}I(P,"propTypes",{style:E.object,head:E.node,initialContent:E.string,mountTarget:E.string,contentDidMount:E.func,contentDidUpdate:E.func,children:E.oneOfType([E.element,E.arrayOf(E.element)])}),I(P,"defaultProps",{style:{},head:null,children:void 0,mountTarget:void 0,contentDidMount:()=>{},contentDidUpdate:()=>{},initialContent:'<!DOCTYPE html><html><head></head><body><div class="frame-root"></div></body></html>'});const Be=h.forwardRef((o,s)=>r.jsxRuntimeExports.jsx(P,{...o,forwardedRef:s}));function O(o){const s=window.getComputedStyle(o),e=s.display;if(e==="flex"){const t=s.flexDirection;return t==="column"||t==="column-reverse"?"vertical":"horizontal"}else if(e==="grid"){const t=s.gridAutoFlow,n=s.gridTemplateRows,u=s.gridTemplateColumns;return t.includes("column")||n.split(" ").length>u.split(" ").length?"vertical":"horizontal"}else if(e==="block"||e==="inline-block")return"vertical";return"horizontal"}let S=null,B=[],D=null,L=null;const Z=(o,s,e)=>{if(!S||!o)return;const t=S==null?void 0:S.getElementById("placeholder"),u=B.map(([l])=>l).reduce((l,p)=>Math.abs(p-e)<Math.abs(l-e)?p:l,0);if(!B[u])return;const a=B[u];t.style.width=s==="vertical"?a[2]+"px":"2px",t.style.height=s==="vertical"?"2px":a[2]+"px",t.style.display="block",s==="vertical"?(t.style.top=a[0]+"px",t.style.left=a[1]+"px"):(t.style.top=a[1]+"px",t.style.left=a[0]+"px")};function Ce(o,s){let e=0,t=1/0;return s.forEach((n,u)=>{const a=Math.abs(n[0]-o);a<t&&(t=a,e=u)}),e}const Ae=o=>{const e=O(o)==="horizontal";B=[],Array.from(o.children).forEach(t=>{if(t.classList.contains("pointer-events-none"))return;const n=e?t.offsetLeft:t.offsetTop,u=e?[t.offsetTop,t.clientHeight]:[t.offsetLeft,t.clientWidth];B.push([n,u[0],u[1]])})},Ie=c.throttle(o=>{const s=o.target,e=O(s);if(e==="vertical"){const t=o.clientY-s.offsetTop;Z(s,e,t)}else{const t=o.clientX-s.offsetLeft;Z(s,e,t)}},200);function F(){const o=S==null?void 0:S.getElementById("placeholder");o.style.display="none",De("pointer-none")}function De(o){document.querySelectorAll(`.${o}`).forEach(e=>{e.classList.remove(o)})}const _e=()=>{const{document:o}=T(),[s,e]=b.useAtom(i.draggingFlagAtom),{addCoreBlock:t}=i.useAddBlock(),[,n]=i.useHighlightBlockId(),[,u]=i.useSelectedBlockIds(),{moveBlocks:a}=i.useBlocksStoreUndoableActions(),[,l]=b.useAtom(i.draggedBlockIdAtom),[p,d]=b.useAtom(_.draggedBlockAtom),[,g]=b.useAtom(_.dropTargetAtom);return S=o,{isDragging:s,onDragOver:x=>{x.preventDefault(),x.stopPropagation(),Ie(x)},onDrop:x=>{D==null||D.classList.remove("drop-target");const m=D,$=O(m)==="vertical"?x.clientY:x.clientX;L=Ce($,B);const v=p,f=m.getAttribute("data-block-id");if(!c.has(v,"_id")){t(v,f==="canvas"?null:f,L),setTimeout(()=>{F()},300),B=[],e(!1),l(""),d(null),g(null);return}let k=m.getAttribute("data-block-id");k===null&&(k=x.target.parentElement.getAttribute("data-block-id")),a([v._id],k,L),F(),e(!1),l(""),setTimeout(()=>F(),300)},onDragEnter:x=>{const m=x,j=m.target;D=j;const $=j.getAttribute("data-block-id");g($),m.stopPropagation(),m.preventDefault(),B=[],Ae(j),j.classList.add("drop-target"),e(!0),n(""),u([])}}};function U(o){return o.getAttribute("data-block-id")?o:o.closest("[data-block-id]")}function Me(o){o.container.innerHTML="",o.container.parentNode.removeChild(o.container);var s=document.querySelector(".ql-toolbar");s&&s.parentNode.removeChild(s),o=null}const Ne=()=>{const o=["Heading","Paragraph","Text","Link","Span","Button"],s=i.useUpdateBlocksProps(),[,e]=i.useHighlightBlockId(),[t,n]=b.useAtom(i.inlineEditingActiveAtom);return u=>{var x;if(t)return;const a=U(u.target),l=a.getAttribute("data-block-type");if(!l||!o.includes(l))return;const p=a.cloneNode(!0);a.style.display="none",Array.from(p.attributes).forEach(m=>{m.name!=="class"&&p.removeAttribute(m.name)}),l==="Text"&&(p.style.display="inline-block"),a.parentNode.insertBefore(p,a.nextSibling);const d=new ie.Quill(p,{placeholder:"Type here..."});function g(){const m=d.getText(0,d.getLength());s([a.getAttribute("data-block-id")],{content:m}),a.removeAttribute("style"),p.removeEventListener("blur",g,!0),Me(d),n(""),e("")}p.addEventListener("blur",g,!0),p.addEventListener("keydown",m=>{(m.key==="Enter"||m.key==="Escape")&&g()}),d.focus(),(x=p.querySelector(".ql-clipboard"))==null||x.remove(),n(a.getAttribute("data-block-id"))}},Te=()=>{const[,o]=i.useSelectedStylingBlocks(),[s,e]=i.useSelectedBlockIds(),[,t]=i.useHighlightBlockId(),[n]=b.useAtom(i.inlineEditingActiveAtom),[u]=b.useAtom(i.treeRefAtom);return a=>{if(n)return;a.stopPropagation();const l=U(a.target);if(l!=null&&l.getAttribute("data-block-id")&&(l==null?void 0:l.getAttribute("data-block-id"))==="container"){e([]),o([]),t("");return}if(l!=null&&l.getAttribute("data-block-parent")){const p=l.getAttribute("data-style-prop"),d=l.getAttribute("data-style-id"),g=l.getAttribute("data-block-parent");s.includes(g)||u.closeAll(),o([{id:d,prop:p,blockId:g}]),e([g])}else if(l!=null&&l.getAttribute("data-block-id")){let p=l.getAttribute("data-block-id");s.includes(p)||u.closeAll(),e([p])}t("")}},qe=c.throttle((o,s)=>{const e=U(o.target);e!=null&&e.getAttribute("data-style-id")&&s(e.getAttribute("data-style-id"))},100),Le=()=>{const[,o]=i.useHighlightBlockId(),[s]=b.useAtom(i.inlineEditingActiveAtom);return e=>{s||qe(e,o)}},Fe=({children:o})=>{const{document:s}=T(),[e]=i.useSelectedBlockIds(),[t,n]=i.useSelectedStylingBlocks();h.useEffect(()=>{setTimeout(()=>{if(!c.isEmpty(t))return;const d=V(s,c.first(e));if(d){const g=d.getAttribute("data-style-prop");if(g){const x=d.getAttribute("data-style-id"),m=d.getAttribute("data-block-parent");n([{id:x,prop:g,blockId:m}])}}},100)},[s,e,n,t]);const u=Ne(),a=Te(),l=Le(),p=_e();return r.jsxRuntimeExports.jsx("div",{"data-block-id":"canvas",id:"canvas",onClick:a,onDoubleClick:u,onMouseMove:l,...c.omit(p,"isDragging"),className:"relative mb-5 h-full max-w-full "+(p.isDragging?"dragging":""),children:o})},V=(o,s)=>o.querySelector(`[data-block-id="${s}"]`),Pe=()=>{const{window:o}=T(),[s,e]=i.useSelectedBlockIds(),[t]=i.useBlocksStore(),[,n]=i.useSelectedStylingBlocks(),{undo:u,redo:a}=i.useUndoManager(),l=i.useDuplicateBlocks(),[,p]=i.usePreviewMode(),d=i.useRemoveBlocks(),{savePage:g}=i.useSavePage(),[x]=b.useAtom(i.inlineEditingActiveAtom),[,m]=b.useAtom(i.editLayerNameAtom),j=v=>{v.key==="Enter"&&(v.preventDefault(),s.length===1&&m(c.first(s)))},$=v=>{const f=t.find(k=>k._id===v);return f?f._parent:null};return h.useEffect(()=>{const v=f=>{if(f.key==="Escape"){e([]),n([]);return}if(j(f),!x&&(f.key==="Delete"||f.key==="Backspace")&&(f.preventDefault(),d(s)),f.ctrlKey||f.metaKey){if(f.key==="ArrowUp"){f.preventDefault();const k=s.length>0?$(s[0]):null;k&&e([k])}if(["z","y","d","x","c","p","s","v"].includes(f.key)){if(x&&["x","z","v"].includes(f.key))return!0;f.preventDefault()}f.key==="s"&&(f.stopPropagation(),f.preventDefault(),g()),f.key==="z"&&u(),f.key==="y"&&a(),f.key==="d"&&l(s)}};return o.removeEventListener("keydown",v),o.addEventListener("keydown",v),()=>{o.removeEventListener("keydown",v)}},[s,e,u,d,p,a,l,x,g,o]),null},He=({block:o,label:s})=>{const[,e]=i.useSelectedBlockIds(),[,t]=i.useHighlightBlockId(),[,n]=b.useAtom(_.draggedBlockAtom),u=ae.useFeature("dnd");return r.jsxRuntimeExports.jsxs("div",{className:"mr-10 flex cursor-grab items-center space-x-1 px-1",draggable:u?"true":"false",onDragStart:a=>{a.dataTransfer.setData("text/plain",JSON.stringify(c.pick(o,["_id","_type","_name"]))),n(o),setTimeout(()=>{e([]),t(null)},200)},children:[r.jsxRuntimeExports.jsx(R.DragHandleDots2Icon,{}),s]})},Oe=({selectedBlockElement:o,block:s})=>{const e=i.useRemoveBlocks(),t=i.useDuplicateBlocks(),[,n]=i.useSelectedBlockIds(),[,u]=i.useSelectedStylingBlocks(),[a]=b.useAtom(i.inlineEditingActiveAtom),{floatingStyles:l,refs:p,update:d}=W.useFloating({placement:"top-start",middleware:[W.shift(),le.flip()],elements:{reference:o}});ce.useResizeObserver(o,()=>d(),o!==null);const g=c.get(s,"_parent",null),x=c.isEmpty(c.get(s,"_name",""))?c.get(s,"_type",""):c.get(s,"_name","");return!o||!s||a?null:r.jsxRuntimeExports.jsx(r.jsxRuntimeExports.Fragment,{children:r.jsxRuntimeExports.jsxs("div",{role:"button",tabIndex:0,ref:p.setFloating,style:l,onClick:m=>{m.stopPropagation(),m.preventDefault()},onKeyDown:m=>m.stopPropagation(),className:"z-[99999] flex h-6 items-center bg-blue-500 py-2 text-xs text-white",children:[r.jsxRuntimeExports.jsx(He,{label:x,block:s}),r.jsxRuntimeExports.jsxs("div",{className:"flex gap-2 px-1",children:[g&&r.jsxRuntimeExports.jsx(R.ArrowUpIcon,{className:"hover:scale-105",onClick:()=>{u([]),n([g])}}),i.canDuplicateBlock(c.get(s,"_type",""))?r.jsxRuntimeExports.jsx(R.CopyIcon,{className:"hover:scale-105",onClick:()=>t([s==null?void 0:s._id])}):null,i.canDeleteBlock(c.get(s,"_type",""))?r.jsxRuntimeExports.jsx(R.TrashIcon,{className:"hover:scale-105",onClick:()=>e([s==null?void 0:s._id])}):null]})]})})},Ue=({addVariant:o,e:s})=>{o("hs-dropdown-open",[({modifySelectors:e,separator:t})=>{e(({className:n})=>`.hs-dropdown.open > .${s(`hs-dropdown-open${t}${n}`)}`)},({modifySelectors:e,separator:t})=>{e(({className:n})=>`.hs-dropdown.open .hs-dropdown-toggle .${s(`hs-dropdown-open${t}${n}`)}`)},({modifySelectors:e,separator:t})=>{e(({className:n})=>`.hs-dropdown.open > .hs-dropdown-menu > .${s(`hs-dropdown-open${t}${n}`)}`)}]),o("hs-removing",({modifySelectors:e,separator:t})=>{e(({className:n})=>`.hs-removing.${s(`hs-removing${t}${n}`)}`)}),o("hs-tooltip-shown",({modifySelectors:e,separator:t})=>{e(({className:n})=>`.hs-tooltip.show .${s(`hs-tooltip-shown${t}${n}`)}`)}),o("hs-accordion-active",[({modifySelectors:e,separator:t})=>{e(({className:n})=>`.hs-accordion.active.${s(`hs-accordion-active${t}${n}`)}`)},({modifySelectors:e,separator:t})=>{e(({className:n})=>`.hs-accordion.active > .${s(`hs-accordion-active${t}${n}`)}`)},({modifySelectors:e,separator:t})=>{e(({className:n})=>`.hs-accordion.active > .hs-accordion-toggle .${s(`hs-accordion-active${t}${n}`)}`)},({modifySelectors:e,separator:t})=>{e(({className:n})=>`.hs-accordion.active > .hs-accordion-heading > .hs-accordion-toggle .${s(`hs-accordion-active${t}${n}`)}`)},({modifySelectors:e,separator:t})=>{e(({className:n})=>`.hs-accordion.active > .hs-accordion-toggle.${s(`hs-accordion-active${t}${n}`)}`)},({modifySelectors:e,separator:t})=>{e(({className:n})=>`.hs-accordion.active > .hs-accordion-heading > .hs-accordion-toggle.${s(`hs-accordion-active${t}${n}`)}`)}]),o("hs-accordion-selected",({modifySelectors:e,separator:t})=>{e(({className:n})=>`.hs-accordion .selected.${s(`hs-accordion-selected${t}${n}`)}`)}),o("hs-collapse-open",[({modifySelectors:e,separator:t})=>{e(({className:n})=>`.hs-collapse.open .${s(`hs-collapse-open${t}${n}`)}`)},({modifySelectors:e,separator:t})=>{e(({className:n})=>`.hs-collapse.open.${s(`hs-collapse-open${t}${n}`)}`)},({modifySelectors:e,separator:t})=>{e(({className:n})=>`.hs-collapse-toggle.open .${s(`hs-collapse-open${t}${n}`)}`)},({modifySelectors:e,separator:t})=>{e(({className:n})=>`.hs-collapse-toggle.open.${s(`hs-collapse-open${t}${n}`)}`)}]),o("hs-tab-active",[({modifySelectors:e,separator:t})=>{e(({className:n})=>`[data-hs-tab].active.${s(`hs-tab-active${t}${n}`)}`)},({modifySelectors:e,separator:t})=>{e(({className:n})=>`[data-hs-tab].active .${s(`hs-tab-active${t}${n}`)}`)}]),o("hs-overlay-open",[({modifySelectors:e,separator:t})=>{e(({className:n})=>`.open.${s(`hs-overlay-open${t}${n}`)}`)},({modifySelectors:e,separator:t})=>{e(({className:n})=>`.open .${s(`hs-overlay-open${t}${n}`)}`)}]),o("hs-overlay-layout-open",[({modifySelectors:e,separator:t})=>{e(({className:n})=>`.hs-overlay-body-open.${s(`hs-overlay-layout-open${t}${n}`)}`)},({modifySelectors:e,separator:t})=>{e(({className:n})=>`.hs-overlay-body-open .${s(`hs-overlay-layout-open${t}${n}`)}`)}]),o("hs-overlay-backdrop-open",[({modifySelectors:e,separator:t})=>{e(({className:n})=>`.hs-overlay-backdrop.${s(`hs-overlay-backdrop-open${t}${n}`)}`)},({modifySelectors:e,separator:t})=>{e(({className:n})=>`.hs-overlay-backdrop .${s(`hs-overlay-backdrop-open${t}${n}`)}`)}]),o("hs-scrollspy-active",({modifySelectors:e,separator:t})=>{e(({className:n})=>`.active.${s(`hs-scrollspy-active${t}${n}`)}`)}),o("hs-carousel-active",[({modifySelectors:e,separator:t})=>{e(({className:n})=>`.active.${s(`hs-carousel-active${t}${n}`)}`)},({modifySelectors:e,separator:t})=>{e(({className:n})=>`.active .${s(`hs-carousel-active${t}${n}`)}`)}]),o("hs-carousel-disabled",[({modifySelectors:e,separator:t})=>{e(({className:n})=>`.disabled.${s(`hs-carousel${t}disabled${t}${n}`)}`)},({modifySelectors:e,separator:t})=>{e(({className:n})=>`.disabled .${s(`hs-carousel${t}disabled${t}${n}`)}`)}]),o("hs-selected",[({modifySelectors:e,separator:t})=>{e(({className:n})=>`.selected.${s(`hs-selected${t}${n}`)}`)},({modifySelectors:e,separator:t})=>{e(({className:n})=>`.selected .${s(`hs-selected${t}${n}`)}`)}]),o("hs-select-disabled",[({modifySelectors:e,separator:t})=>{e(({className:n})=>`.disabled.${s(`hs-select-disabled${t}${n}`)}`)},({modifySelectors:e,separator:t})=>{e(({className:n})=>`.disabled .${s(`hs-select-disabled${t}${n}`)}`)}]),o("hs-select-active",[({modifySelectors:e,separator:t})=>{e(({className:n})=>`.active.${s(`hs-select-active${t}${n}`)}`)},({modifySelectors:e,separator:t})=>{e(({className:n})=>`.active .${s(`hs-select-active${t}${n}`)}`)}]),o("hs-input-number-disabled",[({modifySelectors:e,separator:t})=>{e(({className:n})=>`.disabled.${s(`hs-input-number-disabled${t}${n}`)}`)},({modifySelectors:e,separator:t})=>{e(({className:n})=>`.disabled .${s(`hs-input-number-disabled${t}${n}`)}`)}]),o("hs-pin-input-active",[({modifySelectors:e,separator:t})=>{e(({className:n})=>`.active.${s(`hs-pin-input-active${t}${n}`)}`)},({modifySelectors:e,separator:t})=>{e(({className:n})=>`.active .${s(`hs-pin-input-active${t}${n}`)}`)}]),o("hs-select-opened",[({modifySelectors:e,separator:t})=>{e(({className:n})=>`.opened.${s(`hs-select-opened${t}${n}`)}`)}]),o("hs-password-active",[({modifySelectors:e,separator:t})=>{e(({className:n})=>`.active.${s(`hs-password-active${t}${n}`)}`)},({modifySelectors:e,separator:t})=>{e(({className:n})=>`.active .${s(`hs-password-active${t}${n}`)}`)}]),o("hs-stepper-active",[({modifySelectors:e,separator:t})=>{e(({className:n})=>`.active.${s(`hs-stepper-active${t}${n}`)}`)},({modifySelectors:e,separator:t})=>{e(({className:n})=>`.active .${s(`hs-stepper-active${t}${n}`)}`)}]),o("hs-stepper-success",[({modifySelectors:e,separator:t})=>{e(({className:n})=>`.success.${s(`hs-stepper-success${t}${n}`)}`)},({modifySelectors:e,separator:t})=>{e(({className:n})=>`.success .${s(`hs-stepper-success${t}${n}`)}`)}]),o("hs-stepper-completed",[({modifySelectors:e,separator:t})=>{e(({className:n})=>`.completed.${s(`hs-stepper-completed${t}${n}`)}`)},({modifySelectors:e,separator:t})=>{e(({className:n})=>`.completed .${s(`hs-stepper-completed${t}${n}`)}`)}]),o("hs-stepper-error",[({modifySelectors:e,separator:t})=>{e(({className:n})=>`.error.${s(`hs-stepper-error${t}${n}`)}`)},({modifySelectors:e,separator:t})=>{e(({className:n})=>`.error .${s(`hs-stepper-error${t}${n}`)}`)}]),o("hs-stepper-processed",[({modifySelectors:e,separator:t})=>{e(({className:n})=>`.processed.${s(`hs-stepper-processed${t}${n}`)}`)},({modifySelectors:e,separator:t})=>{e(({className:n})=>`.processed .${s(`hs-stepper-processed${t}${n}`)}`)}]),o("hs-stepper-disabled",[({modifySelectors:e,separator:t})=>{e(({className:n})=>`.disabled.${s(`hs-stepper-disabled${t}${n}`)}`)},({modifySelectors:e,separator:t})=>{e(({className:n})=>`.disabled .${s(`hs-stepper-disabled${t}${n}`)}`)}]),o("hs-stepper-skipped",[({modifySelectors:e,separator:t})=>{e(({className:n})=>`.skipped.${s(`hs-stepper-skipped${t}${n}`)}`)},({modifySelectors:e,separator:t})=>{e(({className:n})=>`.skipped .${s(`hs-stepper-skipped${t}${n}`)}`)}]),o("hs-strong-password",[({modifySelectors:e,separator:t})=>{e(({className:n})=>`.passed.${s(`hs-strong-password${t}${n}`)}`)},({modifySelectors:e,separator:t})=>{e(({className:n})=>`.passed .${s(`hs-strong-password${t}${n}`)}`)}]),o("hs-strong-password-accepted",[({modifySelectors:e,separator:t})=>{e(({className:n})=>`.accepted.${s(`hs-strong-password-accepted${t}${n}`)}`)},({modifySelectors:e,separator:t})=>{e(({className:n})=>`.accepted .${s(`hs-strong-password-accepted${t}${n}`)}`)}]),o("hs-strong-password-active",[({modifySelectors:e,separator:t})=>{e(({className:n})=>`.active.${s(`hs-strong-password-active${t}${n}`)}`)}]),o("hs-combo-box-active",[({modifySelectors:e,separator:t})=>{e(({className:n})=>`.active .${s(`hs-combo-box-active${t}${n}`)}`)},({modifySelectors:e,separator:t})=>{e(({className:n})=>`.active.${s(`hs-combo-box-active${t}${n}`)}`)}]),o("hs-combo-box-selected",[({modifySelectors:e,separator:t})=>{e(({className:n})=>`.selected .${s(`hs-combo-box-selected${t}${n}`)}`)},({modifySelectors:e,separator:t})=>{e(({className:n})=>`.selected.${s(`hs-combo-box-selected${t}${n}`)}`)}]),o("hs-combo-box-tab-active",[({modifySelectors:e,separator:t})=>{e(({className:n})=>`.active.${s(`hs-combo-box-tab-active${t}${n}`)}`)}]),o("hs-apexcharts-tooltip-dark",[({modifySelectors:e,separator:t})=>{e(({className:n})=>`.dark.${s(`hs-apexcharts-tooltip-dark${t}${n}`)}`)}]),o("hs-success",[({modifySelectors:e,separator:t})=>{e(({className:n})=>`.success .${s(`hs-success${t}${n}`)}`)},({modifySelectors:e,separator:t})=>{e(({className:n})=>`.success.${s(`hs-success${t}${n}`)}`)}]),o("hs-error",[({modifySelectors:e,separator:t})=>{e(({className:n})=>`.error .${s(`hs-error${t}${n}`)}`)},({modifySelectors:e,separator:t})=>{e(({className:n})=>`.error.${s(`hs-error${t}${n}`)}`)}]),o("hs-default-mode-active",({modifySelectors:e,separator:t})=>{e(({className:n})=>`.default .${s(`hs-default-mode-active${t}${n}`)}`)}),o("hs-dark-mode-active",({modifySelectors:e,separator:t})=>{e(({className:n})=>`.dark .${s(`hs-dark-mode-active${t}${n}`)}`)}),o("hs-auto-mode-active",({modifySelectors:e,separator:t})=>{e(({className:n})=>`.auto .${s(`hs-auto-mode-active${t}${n}`)}`)})},ze=({model:o})=>{const[s]=i.useBrandingOptions(),[e]=i.useSelectedBlockIds(),[t]=i.useDarkMode(),[n]=i.useHighlightBlockId(),[u]=i.useSelectedStylingBlocks(),[a]=b.useAtom(i.draggedBlockIdAtom),{document:l,window:p}=T(),[d]=h.useState(l==null?void 0:l.getElementById("highlighted-block")),[g]=h.useState(l==null?void 0:l.getElementById("selected-block")),[x]=h.useState(l==null?void 0:l.getElementById("selected-styling-block")),[m]=h.useState(l==null?void 0:l.getElementById("dragged-block"));h.useEffect(()=>{t?l==null||l.documentElement.classList.add("dark"):l==null||l.documentElement.classList.remove("dark")},[t,l]);const j=c.get(s,"headingFont","DM Sans"),$=c.get(s,"bodyFont","DM Sans");return h.useEffect(()=>{const v=c.get(s,"primaryColor","#000"),f=c.get(s,"secondaryColor","#FFF"),k=he([{color:v,name:"primary"},{color:f,name:"secondary"}]),w=c.get(s,"roundedCorners","0");!p||!p.tailwind||(p.tailwind.config={darkMode:"class",theme:{extend:{fontFamily:{heading:[j],body:[$]},borderRadius:{global:`${w||"0"}px`},colors:k}},plugins:[de,ue,pe,p.tailwind.plugin.withOptions(()=>Ue)]})},[s,p,j,$]),h.useEffect(()=>{g&&(g.textContent=`${c.map(e,v=>`[data-block-id="${v}"]`).join(",")}{
|
|
54
|
-
outline: 1px solid ${e.length===1?"#42a1fc":"orange"} !important; outline-offset: -1px;
|
|
55
|
-
}`)},[e,g]),h.useEffect(()=>{if(!a){m.textContent="";return}m.textContent=`[data-block-id="${a}"]{ pointer-events: none !important; opacity: 0.2 !important}`},[a]),h.useEffect(()=>{d&&(d.textContent=n?`[data-style-id="${n}"]{ outline: 1px solid #42a1fc !important; outline-offset: -1px;}`:"")},[n,e,d]),h.useEffect(()=>{x&&(x.textContent=`${c.map(u,({id:v})=>`[data-style-id="${v}"]`).join(",")}{
|
|
56
|
-
outline: 1px solid #42a1fc !important; outline-offset: -1px;
|
|
57
|
-
}`)},[u,x]),h.useEffect(()=>{const v=c.get(s,"bodyTextLightColor","#64748b"),f=c.get(s,"bodyTextDarkColor","#94a3b8"),k=c.get(s,"bodyBgLightColor","#FFFFFF"),w=c.get(s,"bodyBgDarkColor","#0f172a");l.body.className=`font-body antialiased text-[${v}] bg-[${k}] dark:text-[${f}] dark:bg-[${w}]`},[s,l,o]),o==="page"?r.jsxRuntimeExports.jsxs(r.jsxRuntimeExports.Fragment,{children:[j&&r.jsxRuntimeExports.jsx("link",{id:"heading-font",rel:"stylesheet",type:"text/css",href:`https://fonts.googleapis.com/css2?family=${j.replace(/ /g,"+")}:wght@300;400;500;600;700;800;900&display=swap`,media:"all"}),$&&j!==$&&r.jsxRuntimeExports.jsx("link",{id:"body-font",rel:"stylesheet",type:"text/css",href:`https://fonts.googleapis.com/css2?family=${$.replace(/ /g,"+")}:wght@300;400;500;600;700;800;900&display=swap`,media:"all"}),j&&r.jsxRuntimeExports.jsx("style",{children:`h1,h2,h3,h4,h5,h6{font-family: "${j}",ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";}`})]}):null},We=o=>{const s={};return Object.keys(o).forEach(e=>{c.isString(o[e])&&o[e].startsWith(M.SLOT_KEY)&&(s[e]=o[e].replace(M.SLOT_KEY,"").split(","))}),s},Ke=c.memoize(o=>{const s=o.replace(M.STYLES_KEY,"").split(",");return xe.twMerge(s[0],s[1])});function Ye(o,s){return c.get(o,`${s}_attrs`,{})}function Ze(o){const s={};return Object.keys(o).forEach(e=>{if(c.isString(o[e])&&o[e].startsWith(M.STYLES_KEY)){const t=Ke(o[e]);s[e]={className:t,"data-style-prop":e,"data-block-parent":o._id,"data-style-id":`${e}-${o._id}`,...Ye(o,e)}}}),s}function Qe(o,s){const e=c.get(o,"_bindings",{});return c.isEmpty(e)?{...o}:(c.each(e,(t,n)=>{c.isString(t)&&c.get(s,t,null)&&(o[n]=c.get(s,t,null))}),o)}function H({blocks:o}){const[s]=i.useBlocksStore(),[e]=b.useAtom(_.draggedBlockAtom),[t]=b.useAtom(_.dropTargetAtom),[n]=ge.useCanvasSettings(),u=h.useCallback(d=>Ze(d),[]),[a]=i.useChaiExternalData(),[l]=b.useAtom(i.inlineEditingActiveAtom),p=h.useCallback(d=>d.reduce((g,x)=>{const m=c.get(n,x,{});return{...g,...m}},{}),[n,s]);return r.jsxRuntimeExports.jsx(r.jsxRuntimeExports.Fragment,{children:h.Children.toArray(o.map((d,g)=>{if(l===d._id)return null;const x=We(d),m={};c.isEmpty(x)||Object.keys(x).forEach(w=>{m[w]=h.Children.toArray(x[w].map(q=>r.jsxRuntimeExports.jsx(H,{blocks:[c.find(s,{_id:q})]})))});const j=c.filter(s,{_parent:d._id});m.children=j.length?r.jsxRuntimeExports.jsx(H,{blocks:j}):null;const $=me.getBlockComponent(d._type),v=c.get($,"builderComponent",c.get($,"component",null));if(c.isNull(v))return r.jsxRuntimeExports.jsx("noscript",{children:`<!-- ${d==null?void 0:d._type} not registered -->`});const f=c.has($,"getBlockStateFrom")?$==null?void 0:$.getBlockStateFrom(d,s):[],k=p(f);return r.jsxRuntimeExports.jsx(h.Suspense,{children:h.createElement(v,{blockProps:{"data-block-id":d._id,"data-block-type":d._type,...e?{"data-dnd":i.canAcceptChildBlock(d._type,e==null?void 0:e._type)?"yes":"no"}:{},...t===d._id?{"data-drop":"yes"}:{}},index:g,...Qe(d,a),...u(d),...m,inBuilder:!0,blockState:k})})}))})}const Xe=()=>{const[o]=i.useBlocksStore(),s=c.isEmpty(o)?null:r.jsxRuntimeExports.jsx(i.BlocksExternalDataProvider,{children:r.jsxRuntimeExports.jsx(H,{blocks:c.filter(o,e=>c.isEmpty(e._parent))})});return r.jsxRuntimeExports.jsx(r.jsxRuntimeExports.Fragment,{children:s})},Ge=(o,s)=>o.querySelector(`[data-style-id="${s}"]`),Je=()=>{const[o]=b.useAtom(i.networkModeAtom),[s]=i.usePreviewMode(),[e]=i.useCanvasWidth(),[,t]=i.useSelectedBlockIds(),n=i.useSelectedBlock(),[,u]=i.useHighlightBlockId(),a=h.useRef(null),l=h.useRef(null),[p,d]=h.useState({width:0,height:0}),g=we(p),[x,m]=h.useState(0),[j,$]=h.useState([]),[,v]=h.useState([]),[,f]=b.useAtom(i.canvasIframeAtom),[k,w]=i.useSelectedStylingBlocks(),q=i.useBuilderProp("loading",!1),ee=i.useBuilderProp("htmlDir","ltr");h.useEffect(()=>{const{clientWidth:y,clientHeight:C}=l.current;d({width:y,height:C}),x===0&&m(y)},[l,e,x]);const te=(y,C=0)=>{const{top:A}=y.getBoundingClientRect();return A+C>=0&&A-C<=window.innerHeight};h.useEffect(()=>{var y,C;if(n&&n.type!=="Multiple"&&a.current){const A=V(a.current.contentDocument,n._id);A&&(te(A)||(C=(y=a.current)==null?void 0:y.contentWindow)==null||C.scrollTo({top:A.offsetTop,behavior:"smooth"}),$([A]))}},[n]),h.useEffect(()=>{if(!c.isEmpty(k)&&a.current){const y=Ge(a.current.contentDocument,c.first(k).id);v(y?[y]:[null])}else v([null])},[k]);const se=h.useMemo(()=>{let y=Re;return y=y.replace("__HTML_DIR__",ee),o==="offline"&&(y=y.replace("https://old.chaibuilder.com/offline/tailwind.cdn.js","/offline/tailwind.cdn.js"),y=y.replace("https://unpkg.com/aos@next/dist/aos.css","/offline/aos.css"),y=y.replace("https://unpkg.com/aos@next/dist/aos.js","/offline/aos.js")),y},[o]);return r.jsxRuntimeExports.jsx("div",{onClick:()=>{t([]),w([])},onMouseLeave:()=>setTimeout(()=>u(""),300),className:"relative mx-auto h-full w-full overflow-hidden",style:x>0&&!c.isEmpty(g)?{width:s?"100%":x}:{},ref:l,children:r.jsxRuntimeExports.jsxs(Be,{contentDidMount:()=>f(a.current),ref:a,id:"canvas-iframe",style:{width:`${e}px`,...g},className:"relative mx-auto box-content h-full max-w-full shadow-lg transition-all duration-300 ease-linear",initialContent:se,children:[r.jsxRuntimeExports.jsx(Pe,{}),r.jsxRuntimeExports.jsx(Oe,{block:n,selectedBlockElement:c.first(j)}),r.jsxRuntimeExports.jsx(ze,{model:"page"}),r.jsxRuntimeExports.jsx(fe.Provider,{children:r.jsxRuntimeExports.jsx(Fe,{children:q?r.jsxRuntimeExports.jsx("div",{className:"h-full p-4",children:r.jsxRuntimeExports.jsx(i.Skeleton,{className:"h-full"})}):r.jsxRuntimeExports.jsx(Xe,{})})}),r.jsxRuntimeExports.jsx("br",{}),r.jsxRuntimeExports.jsx("div",{id:"placeholder",className:"pointer-events-none absolute z-[99999] max-w-full bg-green-500 transition-transform"})]})})},Ve=()=>r.jsxRuntimeExports.jsxs("div",{className:"flex h-full w-full flex-col",children:[r.jsxRuntimeExports.jsx(Ee,{}),r.jsxRuntimeExports.jsx("div",{className:"relative h-full overflow-hidden bg-slate-800/90 bg-[linear-gradient(to_right,#222_0.5px,transparent_0.5px),linear-gradient(to_bottom,#222_0.5px,transparent_0.5px)] bg-[size:12px_12px] px-2",children:r.jsxRuntimeExports.jsx(h.Suspense,{fallback:r.jsxRuntimeExports.jsx(i.Skeleton,{className:"h-full"}),children:r.jsxRuntimeExports.jsx(i.ErrorBoundary,{children:r.jsxRuntimeExports.jsx(Je,{})})})})]});exports.default=Ve;
|