@chaibuilder/sdk 1.2.114-beta.3 → 1.2.114-beta.4
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/{CodeEditor-boaZFqJd.js → CodeEditor-8UTaC8Qy.js} +1 -1
- package/dist/{CodeEditor-nPQ4Pdxr.cjs → CodeEditor-IwSP8_Yq.cjs} +1 -1
- package/dist/{Topbar-0pmugPN3.js → Topbar-FpOsNd7c.js} +1 -1
- package/dist/{Topbar-G1b9ruO9.cjs → Topbar-IG2XwIS9.cjs} +1 -1
- package/dist/{UnsplashImages-0fV76PhK.cjs → UnsplashImages-fFLJEvwV.cjs} +1 -1
- package/dist/{UnsplashImages-HB4yl97_.js → UnsplashImages-il4RCHAD.js} +1 -1
- package/dist/{UploadImages--hbSU70S.js → UploadImages-9axJYIUJ.js} +1 -1
- package/dist/{UploadImages-I0cbWKRe.cjs → UploadImages-ZQamiSt8.cjs} +1 -1
- package/dist/core.cjs +1 -1
- package/dist/core.js +1 -1
- package/dist/{index-xOwty2sb.js → index-CgMV6n_4.js} +263 -263
- package/dist/{index-fCgMeSfm.cjs → index-GlhR43K2.cjs} +4 -4
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
var z = Object.defineProperty;
|
|
2
|
-
var
|
|
3
|
-
var F = (o, n, r) => (
|
|
2
|
+
var W = (o, n, r) => n in o ? z(o, n, { enumerable: !0, configurable: !0, writable: !0, value: r }) : o[n] = r;
|
|
3
|
+
var F = (o, n, r) => (W(o, typeof n != "symbol" ? n + "" : n, r), r);
|
|
4
4
|
import { j as jsxRuntimeExports } from "./jsx-runtime-Sp0orL4X.js";
|
|
5
5
|
import * as React from "react";
|
|
6
6
|
import React__default, { createContext, useReducer, useEffect, useDebugValue, useCallback, useContext, useState, useMemo, Component, Children, Suspense, useRef, memo, createElement, lazy } from "react";
|
|
@@ -93,32 +93,32 @@ const hasInitialValue = (o) => "init" in o, isActuallyWritableAtom = (o) => !!o.
|
|
|
93
93
|
(define_import_meta_env_default$2 ? "production" : void 0) !== "production" && Object.freeze(v);
|
|
94
94
|
const C = o.get(m);
|
|
95
95
|
if (o.set(m, v), r.has(m) || r.set(m, C), C && hasPromiseAtomValue(C)) {
|
|
96
|
-
const
|
|
97
|
-
cancelPromise(C.v,
|
|
96
|
+
const w = "v" in v ? v.v instanceof Promise ? v.v : Promise.resolve(v.v) : Promise.reject(v.e);
|
|
97
|
+
cancelPromise(C.v, w);
|
|
98
98
|
}
|
|
99
99
|
}, u = (m, v, C) => {
|
|
100
|
-
const
|
|
100
|
+
const w = /* @__PURE__ */ new Map();
|
|
101
101
|
let I = !1;
|
|
102
|
-
C.forEach((
|
|
103
|
-
!
|
|
104
|
-
}), (I || v.d.size !==
|
|
102
|
+
C.forEach((T, P) => {
|
|
103
|
+
!T && P === m && (T = v), T ? (w.set(P, T), v.d.get(P) !== T && (I = !0)) : (define_import_meta_env_default$2 ? "production" : void 0) !== "production" && console.warn("[Bug] atom state not found");
|
|
104
|
+
}), (I || v.d.size !== w.size) && (v.d = w);
|
|
105
105
|
}, p = (m, v, C) => {
|
|
106
|
-
const
|
|
107
|
-
d: (
|
|
106
|
+
const w = c(m), I = {
|
|
107
|
+
d: (w == null ? void 0 : w.d) || /* @__PURE__ */ new Map(),
|
|
108
108
|
v
|
|
109
109
|
};
|
|
110
|
-
if (C && u(m, I, C),
|
|
111
|
-
return
|
|
112
|
-
if (
|
|
113
|
-
if (
|
|
114
|
-
return
|
|
115
|
-
I.v =
|
|
110
|
+
if (C && u(m, I, C), w && isEqualAtomValue(w, I) && w.d === I.d)
|
|
111
|
+
return w;
|
|
112
|
+
if (w && hasPromiseAtomValue(w) && hasPromiseAtomValue(I) && isEqualPromiseAtomValue(w, I)) {
|
|
113
|
+
if (w.d === I.d)
|
|
114
|
+
return w;
|
|
115
|
+
I.v = w.v;
|
|
116
116
|
}
|
|
117
117
|
return d(m, I), I;
|
|
118
|
-
}, g = (m, v, C,
|
|
118
|
+
}, g = (m, v, C, w) => {
|
|
119
119
|
if (isPromiseLike$2(v)) {
|
|
120
120
|
let I;
|
|
121
|
-
const
|
|
121
|
+
const T = new Promise((P, O) => {
|
|
122
122
|
let M = !1;
|
|
123
123
|
v.then(
|
|
124
124
|
(V) => {
|
|
@@ -126,10 +126,10 @@ const hasInitialValue = (o) => "init" in o, isActuallyWritableAtom = (o) => !!o.
|
|
|
126
126
|
M = !0;
|
|
127
127
|
const $ = c(m), H = p(
|
|
128
128
|
m,
|
|
129
|
-
|
|
129
|
+
T,
|
|
130
130
|
C
|
|
131
131
|
);
|
|
132
|
-
resolvePromise(
|
|
132
|
+
resolvePromise(T, V), P(V), ($ == null ? void 0 : $.d) !== H.d && N(m, H, $ == null ? void 0 : $.d);
|
|
133
133
|
}
|
|
134
134
|
},
|
|
135
135
|
(V) => {
|
|
@@ -137,30 +137,30 @@ const hasInitialValue = (o) => "init" in o, isActuallyWritableAtom = (o) => !!o.
|
|
|
137
137
|
M = !0;
|
|
138
138
|
const $ = c(m), H = p(
|
|
139
139
|
m,
|
|
140
|
-
|
|
140
|
+
T,
|
|
141
141
|
C
|
|
142
142
|
);
|
|
143
|
-
rejectPromise(
|
|
143
|
+
rejectPromise(T, V), O(V), ($ == null ? void 0 : $.d) !== H.d && N(m, H, $ == null ? void 0 : $.d);
|
|
144
144
|
}
|
|
145
145
|
}
|
|
146
146
|
), I = (V) => {
|
|
147
147
|
M || (M = !0, V.then(
|
|
148
|
-
($) => resolvePromise(
|
|
149
|
-
($) => rejectPromise(
|
|
148
|
+
($) => resolvePromise(T, $),
|
|
149
|
+
($) => rejectPromise(T, $)
|
|
150
150
|
), P(V));
|
|
151
151
|
};
|
|
152
152
|
});
|
|
153
|
-
return
|
|
154
|
-
P && I(P),
|
|
155
|
-
}), p(m,
|
|
153
|
+
return T.orig = v, T.status = "pending", registerCancelPromise(T, (P) => {
|
|
154
|
+
P && I(P), w == null || w();
|
|
155
|
+
}), p(m, T, C);
|
|
156
156
|
}
|
|
157
157
|
return p(m, v, C);
|
|
158
158
|
}, f = (m, v, C) => {
|
|
159
|
-
const
|
|
160
|
-
d: (
|
|
159
|
+
const w = c(m), I = {
|
|
160
|
+
d: (w == null ? void 0 : w.d) || /* @__PURE__ */ new Map(),
|
|
161
161
|
e: v
|
|
162
162
|
};
|
|
163
|
-
return C && u(m, I, C),
|
|
163
|
+
return C && u(m, I, C), w && isEqualAtomError(w, I) && w.d === I.d ? w : (d(m, I), I);
|
|
164
164
|
}, x = (m) => {
|
|
165
165
|
const v = c(m);
|
|
166
166
|
if (v && (v.d.forEach((M, V) => {
|
|
@@ -172,7 +172,7 @@ const hasInitialValue = (o) => "init" in o, isActuallyWritableAtom = (o) => !!o.
|
|
|
172
172
|
})))
|
|
173
173
|
return v;
|
|
174
174
|
const C = /* @__PURE__ */ new Map();
|
|
175
|
-
let
|
|
175
|
+
let w = !0;
|
|
176
176
|
const I = (M) => {
|
|
177
177
|
if (M === m) {
|
|
178
178
|
const $ = c(M);
|
|
@@ -185,14 +185,14 @@ const hasInitialValue = (o) => "init" in o, isActuallyWritableAtom = (o) => !!o.
|
|
|
185
185
|
const V = x(M);
|
|
186
186
|
return C.set(M, V), returnAtomValue(V);
|
|
187
187
|
};
|
|
188
|
-
let
|
|
188
|
+
let T, P;
|
|
189
189
|
const O = {
|
|
190
190
|
get signal() {
|
|
191
|
-
return
|
|
191
|
+
return T || (T = new AbortController()), T.signal;
|
|
192
192
|
},
|
|
193
193
|
get setSelf() {
|
|
194
194
|
return (define_import_meta_env_default$2 ? "production" : void 0) !== "production" && !isActuallyWritableAtom(m) && console.warn("setSelf function cannot be used with read-only atom"), !P && isActuallyWritableAtom(m) && (P = (...M) => {
|
|
195
|
-
if ((define_import_meta_env_default$2 ? "production" : void 0) !== "production" &&
|
|
195
|
+
if ((define_import_meta_env_default$2 ? "production" : void 0) !== "production" && w && console.warn("setSelf function cannot be called in sync"), !w)
|
|
196
196
|
return _(m, ...M);
|
|
197
197
|
}), P;
|
|
198
198
|
}
|
|
@@ -203,35 +203,35 @@ const hasInitialValue = (o) => "init" in o, isActuallyWritableAtom = (o) => !!o.
|
|
|
203
203
|
m,
|
|
204
204
|
M,
|
|
205
205
|
C,
|
|
206
|
-
() =>
|
|
206
|
+
() => T == null ? void 0 : T.abort()
|
|
207
207
|
);
|
|
208
208
|
} catch (M) {
|
|
209
209
|
return f(m, M, C);
|
|
210
210
|
} finally {
|
|
211
|
-
|
|
211
|
+
w = !1;
|
|
212
212
|
}
|
|
213
213
|
}, j = (m) => returnAtomValue(x(m)), E = (m) => {
|
|
214
214
|
let v = n.get(m);
|
|
215
215
|
return v || (v = R(m)), v;
|
|
216
216
|
}, b = (m, v) => !v.l.size && (!v.t.size || v.t.size === 1 && v.t.has(m)), k = (m) => {
|
|
217
217
|
const v = n.get(m);
|
|
218
|
-
v && b(m, v) &&
|
|
218
|
+
v && b(m, v) && B(m);
|
|
219
219
|
}, S = (m) => {
|
|
220
|
-
const v = /* @__PURE__ */ new Map(), C = /* @__PURE__ */ new WeakMap(),
|
|
221
|
-
const P = n.get(
|
|
220
|
+
const v = /* @__PURE__ */ new Map(), C = /* @__PURE__ */ new WeakMap(), w = (T) => {
|
|
221
|
+
const P = n.get(T);
|
|
222
222
|
P == null || P.t.forEach((O) => {
|
|
223
|
-
O !==
|
|
223
|
+
O !== T && (v.set(
|
|
224
224
|
O,
|
|
225
|
-
(v.get(O) || /* @__PURE__ */ new Set()).add(
|
|
226
|
-
), C.set(O, (C.get(O) || 0) + 1),
|
|
225
|
+
(v.get(O) || /* @__PURE__ */ new Set()).add(T)
|
|
226
|
+
), C.set(O, (C.get(O) || 0) + 1), w(O));
|
|
227
227
|
});
|
|
228
228
|
};
|
|
229
|
-
|
|
230
|
-
const I = (
|
|
231
|
-
const P = n.get(
|
|
229
|
+
w(m);
|
|
230
|
+
const I = (T) => {
|
|
231
|
+
const P = n.get(T);
|
|
232
232
|
P == null || P.t.forEach((O) => {
|
|
233
233
|
var M;
|
|
234
|
-
if (O !==
|
|
234
|
+
if (O !== T) {
|
|
235
235
|
let V = C.get(O);
|
|
236
236
|
if (V && C.set(O, --V), !V) {
|
|
237
237
|
let $ = !!((M = v.get(O)) != null && M.size);
|
|
@@ -246,9 +246,9 @@ const hasInitialValue = (o) => "init" in o, isActuallyWritableAtom = (o) => !!o.
|
|
|
246
246
|
});
|
|
247
247
|
};
|
|
248
248
|
I(m);
|
|
249
|
-
},
|
|
249
|
+
}, A = (m, ...v) => {
|
|
250
250
|
let C = !0;
|
|
251
|
-
const
|
|
251
|
+
const w = (P) => returnAtomValue(x(P)), I = (P, ...O) => {
|
|
252
252
|
let M;
|
|
253
253
|
if (P === m) {
|
|
254
254
|
if (!hasInitialValue(P))
|
|
@@ -256,7 +256,7 @@ const hasInitialValue = (o) => "init" in o, isActuallyWritableAtom = (o) => !!o.
|
|
|
256
256
|
const V = c(P), $ = g(P, O[0]);
|
|
257
257
|
(!V || !isEqualAtomValue(V, $)) && S(P);
|
|
258
258
|
} else
|
|
259
|
-
M =
|
|
259
|
+
M = A(P, ...O);
|
|
260
260
|
if (!C) {
|
|
261
261
|
const V = L();
|
|
262
262
|
(define_import_meta_env_default$2 ? "production" : void 0) !== "production" && l.forEach(
|
|
@@ -264,62 +264,62 @@ const hasInitialValue = (o) => "init" in o, isActuallyWritableAtom = (o) => !!o.
|
|
|
264
264
|
);
|
|
265
265
|
}
|
|
266
266
|
return M;
|
|
267
|
-
},
|
|
268
|
-
return C = !1,
|
|
267
|
+
}, T = m.write(w, I, ...v);
|
|
268
|
+
return C = !1, T;
|
|
269
269
|
}, _ = (m, ...v) => {
|
|
270
|
-
const C =
|
|
270
|
+
const C = A(m, ...v), w = L();
|
|
271
271
|
return (define_import_meta_env_default$2 ? "production" : void 0) !== "production" && l.forEach(
|
|
272
|
-
(I) => I({ type: "write", flushed:
|
|
272
|
+
(I) => I({ type: "write", flushed: w })
|
|
273
273
|
), C;
|
|
274
274
|
}, R = (m, v) => {
|
|
275
275
|
const C = {
|
|
276
276
|
t: new Set(v && [v]),
|
|
277
277
|
l: /* @__PURE__ */ new Set()
|
|
278
278
|
};
|
|
279
|
-
if (n.set(m, C), (define_import_meta_env_default$2 ? "production" : void 0) !== "production" && i.add(m), x(m).d.forEach((
|
|
280
|
-
const
|
|
281
|
-
|
|
279
|
+
if (n.set(m, C), (define_import_meta_env_default$2 ? "production" : void 0) !== "production" && i.add(m), x(m).d.forEach((w, I) => {
|
|
280
|
+
const T = n.get(I);
|
|
281
|
+
T ? T.t.add(m) : I !== m && R(I, m);
|
|
282
282
|
}), x(m), isActuallyWritableAtom(m) && m.onMount) {
|
|
283
|
-
const
|
|
284
|
-
|
|
283
|
+
const w = m.onMount((...I) => _(m, ...I));
|
|
284
|
+
w && (C.u = w);
|
|
285
285
|
}
|
|
286
286
|
return C;
|
|
287
|
-
},
|
|
287
|
+
}, B = (m) => {
|
|
288
288
|
var v;
|
|
289
289
|
const C = (v = n.get(m)) == null ? void 0 : v.u;
|
|
290
290
|
C && C(), n.delete(m), (define_import_meta_env_default$2 ? "production" : void 0) !== "production" && i.delete(m);
|
|
291
|
-
const
|
|
292
|
-
|
|
293
|
-
if (
|
|
294
|
-
const P = n.get(
|
|
295
|
-
P && (P.t.delete(m), b(
|
|
291
|
+
const w = c(m);
|
|
292
|
+
w ? (hasPromiseAtomValue(w) && cancelPromise(w.v), w.d.forEach((I, T) => {
|
|
293
|
+
if (T !== m) {
|
|
294
|
+
const P = n.get(T);
|
|
295
|
+
P && (P.t.delete(m), b(T, P) && B(T));
|
|
296
296
|
}
|
|
297
297
|
})) : (define_import_meta_env_default$2 ? "production" : void 0) !== "production" && console.warn("[Bug] could not find atom state to unmount", m);
|
|
298
|
-
},
|
|
299
|
-
const
|
|
300
|
-
C == null || C.forEach((I,
|
|
301
|
-
if (
|
|
302
|
-
|
|
298
|
+
}, N = (m, v, C) => {
|
|
299
|
+
const w = new Set(v.d.keys());
|
|
300
|
+
C == null || C.forEach((I, T) => {
|
|
301
|
+
if (w.has(T)) {
|
|
302
|
+
w.delete(T);
|
|
303
303
|
return;
|
|
304
304
|
}
|
|
305
|
-
const P = n.get(
|
|
306
|
-
P && (P.t.delete(m), b(
|
|
307
|
-
}),
|
|
308
|
-
const
|
|
309
|
-
|
|
305
|
+
const P = n.get(T);
|
|
306
|
+
P && (P.t.delete(m), b(T, P) && B(T));
|
|
307
|
+
}), w.forEach((I) => {
|
|
308
|
+
const T = n.get(I);
|
|
309
|
+
T ? T.t.add(m) : n.has(m) && R(I, m);
|
|
310
310
|
});
|
|
311
311
|
}, L = () => {
|
|
312
312
|
let m;
|
|
313
313
|
for ((define_import_meta_env_default$2 ? "production" : void 0) !== "production" && (m = /* @__PURE__ */ new Set()); r.size; ) {
|
|
314
314
|
const v = Array.from(r);
|
|
315
|
-
r.clear(), v.forEach(([C,
|
|
315
|
+
r.clear(), v.forEach(([C, w]) => {
|
|
316
316
|
const I = c(C);
|
|
317
317
|
if (I) {
|
|
318
|
-
I.d !== (
|
|
319
|
-
const
|
|
320
|
-
|
|
318
|
+
I.d !== (w == null ? void 0 : w.d) && N(C, I, w == null ? void 0 : w.d);
|
|
319
|
+
const T = n.get(C);
|
|
320
|
+
T && !// TODO This seems pretty hacky. Hope to fix it.
|
|
321
321
|
// Maybe we could `mountDependencies` in `setAtomState`?
|
|
322
|
-
(
|
|
322
|
+
(w && !hasPromiseAtomValue(w) && (isEqualAtomValue(w, I) || isEqualAtomError(w, I))) && (T.l.forEach((P) => P()), (define_import_meta_env_default$2 ? "production" : void 0) !== "production" && m.add(C));
|
|
323
323
|
} else
|
|
324
324
|
(define_import_meta_env_default$2 ? "production" : void 0) !== "production" && console.warn("[Bug] no atom state to flush");
|
|
325
325
|
});
|
|
@@ -327,11 +327,11 @@ const hasInitialValue = (o) => "init" in o, isActuallyWritableAtom = (o) => !!o.
|
|
|
327
327
|
if ((define_import_meta_env_default$2 ? "production" : void 0) !== "production")
|
|
328
328
|
return a.forEach((v) => v("state")), m;
|
|
329
329
|
}, D = (m, v) => {
|
|
330
|
-
const C = E(m),
|
|
331
|
-
return I.add(v), (define_import_meta_env_default$2 ? "production" : void 0) !== "production" && (a.forEach((
|
|
332
|
-
(
|
|
330
|
+
const C = E(m), w = L(), I = C.l;
|
|
331
|
+
return I.add(v), (define_import_meta_env_default$2 ? "production" : void 0) !== "production" && (a.forEach((T) => T("sub")), l.forEach(
|
|
332
|
+
(T) => T({ type: "sub", flushed: w })
|
|
333
333
|
)), () => {
|
|
334
|
-
I.delete(v), k(m), (define_import_meta_env_default$2 ? "production" : void 0) !== "production" && (a.forEach((
|
|
334
|
+
I.delete(v), k(m), (define_import_meta_env_default$2 ? "production" : void 0) !== "production" && (a.forEach((T) => T("unsub")), l.forEach((T) => T({ type: "unsub" })));
|
|
335
335
|
};
|
|
336
336
|
};
|
|
337
337
|
return (define_import_meta_env_default$2 ? "production" : void 0) !== "production" ? {
|
|
@@ -350,8 +350,8 @@ const hasInitialValue = (o) => "init" in o, isActuallyWritableAtom = (o) => !!o.
|
|
|
350
350
|
dev_get_atom_state: (m) => o.get(m),
|
|
351
351
|
dev_get_mounted: (m) => n.get(m),
|
|
352
352
|
dev_restore_atoms: (m) => {
|
|
353
|
-
for (const [C,
|
|
354
|
-
hasInitialValue(C) && (g(C,
|
|
353
|
+
for (const [C, w] of m)
|
|
354
|
+
hasInitialValue(C) && (g(C, w), S(C));
|
|
355
355
|
const v = L();
|
|
356
356
|
l.forEach(
|
|
357
357
|
(C) => C({ type: "restore", flushed: v })
|
|
@@ -386,24 +386,24 @@ function splitAtom(o, n) {
|
|
|
386
386
|
g[j] = b;
|
|
387
387
|
return;
|
|
388
388
|
}
|
|
389
|
-
const k = (
|
|
390
|
-
const _ =
|
|
391
|
-
if (
|
|
389
|
+
const k = (A) => {
|
|
390
|
+
const _ = A(l), R = A(o), N = a(R, _ == null ? void 0 : _.arr).keyList.indexOf(E);
|
|
391
|
+
if (N < 0 || N >= R.length) {
|
|
392
392
|
const L = c[a(c).keyList.indexOf(E)];
|
|
393
393
|
if (L)
|
|
394
394
|
return L;
|
|
395
395
|
throw new Error("splitAtom: index out of bounds for read");
|
|
396
396
|
}
|
|
397
|
-
return R[
|
|
398
|
-
}, S = (
|
|
399
|
-
const
|
|
400
|
-
if (D < 0 || D >=
|
|
397
|
+
return R[N];
|
|
398
|
+
}, S = (A, _, R) => {
|
|
399
|
+
const B = A(l), N = A(o), D = a(N, B == null ? void 0 : B.arr).keyList.indexOf(E);
|
|
400
|
+
if (D < 0 || D >= N.length)
|
|
401
401
|
throw new Error("splitAtom: index out of bounds for write");
|
|
402
|
-
const m = isFunction(R) ? R(
|
|
402
|
+
const m = isFunction(R) ? R(N[D]) : R;
|
|
403
403
|
_(o, [
|
|
404
|
-
...
|
|
404
|
+
...N.slice(0, D),
|
|
405
405
|
m,
|
|
406
|
-
...
|
|
406
|
+
...N.slice(D + 1)
|
|
407
407
|
]);
|
|
408
408
|
};
|
|
409
409
|
g[j] = isWritable(o) ? atom(k, S) : atom(k);
|
|
@@ -1203,12 +1203,12 @@ const useBlocksStoreManager = () => {
|
|
|
1203
1203
|
return {
|
|
1204
1204
|
moveBlocks: (E, b, k) => {
|
|
1205
1205
|
const S = map(E, (_) => {
|
|
1206
|
-
const
|
|
1207
|
-
return { _id: _, oldParent:
|
|
1208
|
-
}),
|
|
1209
|
-
|
|
1210
|
-
undo: () => each(S, ({ _id: _, oldParent: R, oldPosition:
|
|
1211
|
-
i([_], R,
|
|
1206
|
+
const B = n.find((D) => D._id === _)._parent || null, L = n.filter((D) => B ? D._parent === B : !D._parent).map((D) => D._id).indexOf(_);
|
|
1207
|
+
return { _id: _, oldParent: B, oldPosition: L };
|
|
1208
|
+
}), A = S.find(({ _id: _ }) => _ === E[0]);
|
|
1209
|
+
A && A.oldParent === b && A.oldPosition === k || (i(E, b, k), o({
|
|
1210
|
+
undo: () => each(S, ({ _id: _, oldParent: R, oldPosition: B }) => {
|
|
1211
|
+
i([_], R, B);
|
|
1212
1212
|
}),
|
|
1213
1213
|
redo: () => i(E, b, k)
|
|
1214
1214
|
}));
|
|
@@ -1220,8 +1220,8 @@ const useBlocksStoreManager = () => {
|
|
|
1220
1220
|
});
|
|
1221
1221
|
},
|
|
1222
1222
|
removeBlocks: (E) => {
|
|
1223
|
-
var
|
|
1224
|
-
const b = (
|
|
1223
|
+
var A;
|
|
1224
|
+
const b = (A = first(E)) == null ? void 0 : A._parent, S = n.filter((_) => b ? _._parent === b : !_._parent).indexOf(first(E));
|
|
1225
1225
|
l(map(E, "_id")), o({
|
|
1226
1226
|
undo: () => a(E, b, S),
|
|
1227
1227
|
redo: () => l(map(E, "_id"))
|
|
@@ -1230,17 +1230,17 @@ const useBlocksStoreManager = () => {
|
|
|
1230
1230
|
updateBlocks: (E, b, k) => {
|
|
1231
1231
|
let S = [];
|
|
1232
1232
|
if (k)
|
|
1233
|
-
S = map(E, (
|
|
1233
|
+
S = map(E, (A) => ({ _id: A, ...k }));
|
|
1234
1234
|
else {
|
|
1235
|
-
const
|
|
1235
|
+
const A = keys(b);
|
|
1236
1236
|
S = map(E, (_) => {
|
|
1237
|
-
const R = n.find((
|
|
1238
|
-
return each(
|
|
1237
|
+
const R = n.find((N) => N._id === _), B = { _id: _ };
|
|
1238
|
+
return each(A, (N) => B[N] = R[N]), B;
|
|
1239
1239
|
});
|
|
1240
1240
|
}
|
|
1241
|
-
c(map(E, (
|
|
1241
|
+
c(map(E, (A) => ({ _id: A, ...b }))), o({
|
|
1242
1242
|
undo: () => c(S),
|
|
1243
|
-
redo: () => c(map(E, (
|
|
1243
|
+
redo: () => c(map(E, (A) => ({ _id: A, ...b })))
|
|
1244
1244
|
});
|
|
1245
1245
|
},
|
|
1246
1246
|
updateBlocksRuntime: (E, b) => {
|
|
@@ -1255,8 +1255,8 @@ const useBlocksStoreManager = () => {
|
|
|
1255
1255
|
updateMultipleBlocksProps: (E) => {
|
|
1256
1256
|
let b = [];
|
|
1257
1257
|
b = map(E, (k) => {
|
|
1258
|
-
const S = keys(k),
|
|
1259
|
-
return each(S, (R) => _[R] =
|
|
1258
|
+
const S = keys(k), A = n.find((R) => R._id === k._id), _ = {};
|
|
1259
|
+
return each(S, (R) => _[R] = A[R]), _;
|
|
1260
1260
|
}), c(E), o({
|
|
1261
1261
|
undo: () => c(b),
|
|
1262
1262
|
redo: () => c(E)
|
|
@@ -1289,9 +1289,9 @@ const useBlocksStoreManager = () => {
|
|
|
1289
1289
|
const u = generateUUID(), p = getBlockDefaultProps(i.props), g = [];
|
|
1290
1290
|
forIn(p, (k, S) => {
|
|
1291
1291
|
if (startsWith(k, SLOT_KEY)) {
|
|
1292
|
-
const
|
|
1292
|
+
const A = k.replace(SLOT_KEY, "");
|
|
1293
1293
|
g.push({
|
|
1294
|
-
_id:
|
|
1294
|
+
_id: A,
|
|
1295
1295
|
_type: "Slot",
|
|
1296
1296
|
_parent: u,
|
|
1297
1297
|
_name: i.props[S].name,
|
|
@@ -3083,8 +3083,8 @@ const useDnd = () => {
|
|
|
3083
3083
|
var R;
|
|
3084
3084
|
const j = dropTarget, b = getOrientation(j) === "vertical" ? x.clientY + ((R = iframeDocument == null ? void 0 : iframeDocument.defaultView) == null ? void 0 : R.scrollY) : x.clientX;
|
|
3085
3085
|
dropIndex = calculateDropIndex(b, possiblePositions);
|
|
3086
|
-
const k = d, S = j.getAttribute("data-block-id"),
|
|
3087
|
-
if ((k == null ? void 0 : k._id) === S || !
|
|
3086
|
+
const k = d, S = j.getAttribute("data-block-id"), A = dropTarget.getAttribute("data-dnd-dragged") !== "yes";
|
|
3087
|
+
if ((k == null ? void 0 : k._id) === S || !A) {
|
|
3088
3088
|
f();
|
|
3089
3089
|
return;
|
|
3090
3090
|
}
|
|
@@ -3322,17 +3322,17 @@ const useHandleCanvasDblClick = () => {
|
|
|
3322
3322
|
}, [r, c]);
|
|
3323
3323
|
const x = get(o, "headingFont", "DM Sans"), j = get(o, "bodyFont", "DM Sans");
|
|
3324
3324
|
return useEffect(() => {
|
|
3325
|
-
const E = get(o, "primaryColor", "#000"), b = get(o, "secondaryColor", "#FFF"), k = get(o, "bodyBgLightColor", "#fff"), S = get(o, "bodyBgDarkColor", "#000"),
|
|
3325
|
+
const E = get(o, "primaryColor", "#000"), b = get(o, "secondaryColor", "#FFF"), k = get(o, "bodyBgLightColor", "#fff"), S = get(o, "bodyBgDarkColor", "#000"), A = get(o, "bodyTextDarkColor", "#000"), _ = get(o, "bodyTextLightColor", "#fff"), R = s({
|
|
3326
3326
|
colors: [E, b],
|
|
3327
3327
|
names: ["primary", "secondary"]
|
|
3328
3328
|
});
|
|
3329
3329
|
set(R, "primary.DEFAULT", E), set(R, "secondary.DEFAULT", b);
|
|
3330
|
-
const
|
|
3330
|
+
const B = {
|
|
3331
3331
|
"bg-light": k,
|
|
3332
3332
|
"bg-dark": S,
|
|
3333
|
-
"text-dark":
|
|
3333
|
+
"text-dark": A,
|
|
3334
3334
|
"text-light": _
|
|
3335
|
-
},
|
|
3335
|
+
}, N = get(o, "roundedCorners", "0");
|
|
3336
3336
|
!d || !d.tailwind || (d.tailwind.config = {
|
|
3337
3337
|
darkMode: "class",
|
|
3338
3338
|
theme: {
|
|
@@ -3349,9 +3349,9 @@ const useHandleCanvasDblClick = () => {
|
|
|
3349
3349
|
body: [j]
|
|
3350
3350
|
},
|
|
3351
3351
|
borderRadius: {
|
|
3352
|
-
DEFAULT: `${
|
|
3352
|
+
DEFAULT: `${N || "0"}px`
|
|
3353
3353
|
},
|
|
3354
|
-
colors: { ...
|
|
3354
|
+
colors: { ...B, ...R }
|
|
3355
3355
|
}
|
|
3356
3356
|
},
|
|
3357
3357
|
plugins: [
|
|
@@ -3514,8 +3514,8 @@ function applyLanguage(o, n, r) {
|
|
|
3514
3514
|
function BlocksRendererStatic({ blocks: o, allBlocks: n }) {
|
|
3515
3515
|
const { selectedLang: r } = useLanguages(), [a] = useAtom$1(xShowBlocksAtom), [l] = useCutBlockIds(), [i] = useAtom$1(draggedBlockAtom), [c] = useAtom$1(dropTargetBlockIdAtom), [, d] = useCanvasWidth(), [u] = useCanvasSettings(), [p] = useHiddenBlockIds(), { getGlobalBlocks: g } = useGlobalBlocksStore(), f = useCallback((b) => getStyleAttrs(b, d), [d]), [x] = useChaiExternalData(), [j] = useAtom$1(inlineEditingActiveAtom), E = useCallback(
|
|
3516
3516
|
(b) => b.reduce((k, S) => {
|
|
3517
|
-
const
|
|
3518
|
-
return { ...k, ...
|
|
3517
|
+
const A = get(u, S, {});
|
|
3518
|
+
return { ...k, ...A };
|
|
3519
3519
|
}, {}),
|
|
3520
3520
|
[u]
|
|
3521
3521
|
);
|
|
@@ -3523,15 +3523,15 @@ function BlocksRendererStatic({ blocks: o, allBlocks: n }) {
|
|
|
3523
3523
|
o.map((b, k) => {
|
|
3524
3524
|
if (j === b._id || p.includes(b._id))
|
|
3525
3525
|
return null;
|
|
3526
|
-
const S = {},
|
|
3527
|
-
if (S.children =
|
|
3526
|
+
const S = {}, A = filter(n, { _parent: b._id });
|
|
3527
|
+
if (S.children = A.length > 0 ? /* @__PURE__ */ jsxRuntimeExports.jsx(BlocksRendererStatic, { allBlocks: n, blocks: A }) : null, b._type === "GlobalBlock") {
|
|
3528
3528
|
const C = g(b);
|
|
3529
|
-
S.children = /* @__PURE__ */ jsxRuntimeExports.jsx(RenderGlobalBlock, { blocks: filter(C, (
|
|
3529
|
+
S.children = /* @__PURE__ */ jsxRuntimeExports.jsx(RenderGlobalBlock, { blocks: filter(C, (w) => !w._parent), allBlocks: C });
|
|
3530
3530
|
}
|
|
3531
|
-
const _ = getBlockComponent(b._type), R = get(_, "server", !1),
|
|
3532
|
-
if (isNull(
|
|
3531
|
+
const _ = getBlockComponent(b._type), R = get(_, "server", !1), B = R ? RSCBlock : get(_, "builderComponent", get(_, "component", null));
|
|
3532
|
+
if (isNull(B))
|
|
3533
3533
|
return /* @__PURE__ */ jsxRuntimeExports.jsx("noscript", { children: `<!-- ${b == null ? void 0 : b._type} not registered -->` });
|
|
3534
|
-
const
|
|
3534
|
+
const N = has(_, "getBlockStateFrom") ? _ == null ? void 0 : _.getBlockStateFrom(b, n) : [], L = E(N), D = f(b);
|
|
3535
3535
|
if (get(D, "__isHidden", !1) && !includes(a, b._id))
|
|
3536
3536
|
return null;
|
|
3537
3537
|
const m = i && isDescendant(i._id, b._id, n), v = {
|
|
@@ -3548,7 +3548,7 @@ function BlocksRendererStatic({ blocks: o, allBlocks: n }) {
|
|
|
3548
3548
|
...c === b._id && !m ? { "data-drop": "yes" } : {},
|
|
3549
3549
|
...includes(l, b._id) ? { "data-cut-block": "yes" } : {}
|
|
3550
3550
|
};
|
|
3551
|
-
return R ? /* @__PURE__ */ jsxRuntimeExports.jsx(RSCBlock, { block: b, blockProps: v }) : /* @__PURE__ */ jsxRuntimeExports.jsx(Suspense, { children: React__default.createElement(
|
|
3551
|
+
return R ? /* @__PURE__ */ jsxRuntimeExports.jsx(RSCBlock, { block: b, blockProps: v }) : /* @__PURE__ */ jsxRuntimeExports.jsx(Suspense, { children: React__default.createElement(B, {
|
|
3552
3552
|
blockProps: v,
|
|
3553
3553
|
index: k,
|
|
3554
3554
|
...applyBindings(applyLanguage(b, r, _), x),
|
|
@@ -3609,43 +3609,43 @@ const useAllDataProviders = () => useMemo(() => getChaiDataProviders(), []), Blo
|
|
|
3609
3609
|
};
|
|
3610
3610
|
return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { id: "main-content", onClick: d, className: "h-full w-full p-8 pb-0", ref: i, children: o });
|
|
3611
3611
|
}, getElementByStyleId = (o, n) => o.querySelector(`[data-style-id="${n}"]`), StaticCanvas = () => {
|
|
3612
|
-
const [o] = useAtom$1(networkModeAtom), [n] = useCanvasWidth(), [, r] = useSelectedBlockIds(), a = useSelectedBlock(), [, l] = useHighlightBlockId(), i = useRef(null), c = useRef(null), [d, u] = useState({ width: 0, height: 0 }), p = useCanvasScale(d), [g, f] = useState([]), [, x] = useState([]), [, j] = useAtom$1(canvasIframeAtom), [E, b] = useSelectedStylingBlocks(), k = useBuilderProp("loading", !1), S = useBuilderProp("htmlDir", "ltr"),
|
|
3613
|
-
u((
|
|
3612
|
+
const [o] = useAtom$1(networkModeAtom), [n] = useCanvasWidth(), [, r] = useSelectedBlockIds(), a = useSelectedBlock(), [, l] = useHighlightBlockId(), i = useRef(null), c = useRef(null), [d, u] = useState({ width: 0, height: 0 }), p = useCanvasScale(d), [g, f] = useState([]), [, x] = useState([]), [, j] = useAtom$1(canvasIframeAtom), [E, b] = useSelectedStylingBlocks(), k = useBuilderProp("loading", !1), S = useBuilderProp("htmlDir", "ltr"), A = (B) => {
|
|
3613
|
+
u((N) => ({ ...N, width: B }));
|
|
3614
3614
|
};
|
|
3615
3615
|
useEffect(() => {
|
|
3616
3616
|
if (!c.current)
|
|
3617
3617
|
return;
|
|
3618
|
-
const { clientWidth:
|
|
3619
|
-
u({ width:
|
|
3618
|
+
const { clientWidth: B, clientHeight: N } = c.current;
|
|
3619
|
+
u({ width: B, height: N });
|
|
3620
3620
|
}, [c, n]);
|
|
3621
|
-
const _ = (
|
|
3622
|
-
const { top: L } =
|
|
3623
|
-
return L +
|
|
3621
|
+
const _ = (B, N = 0) => {
|
|
3622
|
+
const { top: L } = B.getBoundingClientRect();
|
|
3623
|
+
return L + N >= 0 && L - N <= window.innerHeight;
|
|
3624
3624
|
};
|
|
3625
3625
|
useEffect(() => {
|
|
3626
|
-
var
|
|
3626
|
+
var B, N;
|
|
3627
3627
|
if (a && a.type !== "Multiple" && i.current) {
|
|
3628
3628
|
const L = getElementByDataBlockId(i.current.contentDocument, a._id);
|
|
3629
|
-
L && (_(L) || (
|
|
3629
|
+
L && (_(L) || (N = (B = i.current) == null ? void 0 : B.contentWindow) == null || N.scrollTo({ top: L.offsetTop, behavior: "smooth" }), f([L]));
|
|
3630
3630
|
}
|
|
3631
3631
|
}, [a]), useEffect(() => {
|
|
3632
3632
|
if (!isEmpty(E) && i.current) {
|
|
3633
|
-
const
|
|
3633
|
+
const B = getElementByStyleId(
|
|
3634
3634
|
i.current.contentDocument,
|
|
3635
3635
|
first(E).id
|
|
3636
3636
|
);
|
|
3637
|
-
x(
|
|
3637
|
+
x(B ? [B] : [null]);
|
|
3638
3638
|
} else
|
|
3639
3639
|
x([null]);
|
|
3640
3640
|
}, [E]);
|
|
3641
3641
|
const R = useMemo(() => {
|
|
3642
|
-
let
|
|
3643
|
-
return
|
|
3642
|
+
let B = IframeInitialContent;
|
|
3643
|
+
return B = B.replace("__HTML_DIR__", S), o === "offline" && (B = B.replace(
|
|
3644
3644
|
"https://old.chaibuilder.com/offline/tailwind.cdn.js",
|
|
3645
3645
|
"/offline/tailwind.cdn.js"
|
|
3646
|
-
),
|
|
3646
|
+
), B = B.replace("https://unpkg.com/aos@next/dist/aos.css", "/offline/aos.css"), B = B.replace("https://unpkg.com/aos@next/dist/aos.js", "/offline/aos.js")), B;
|
|
3647
3647
|
}, [o, S]);
|
|
3648
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx(ResizableCanvasWrapper, { onMount:
|
|
3648
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(ResizableCanvasWrapper, { onMount: A, onResize: A, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
3649
3649
|
"div",
|
|
3650
3650
|
{
|
|
3651
3651
|
onClick: () => {
|
|
@@ -3785,7 +3785,7 @@ const useAllDataProviders = () => useMemo(() => getChaiDataProviders(), []), Blo
|
|
|
3785
3785
|
l !== o.length - 1 && /* @__PURE__ */ jsxRuntimeExports.jsx(ChevronRight, { className: "rtl:rotate-180", size: 16 })
|
|
3786
3786
|
] }, l))
|
|
3787
3787
|
] }) });
|
|
3788
|
-
}, CodeEditor$1 = React__default.lazy(() => import("./CodeEditor-
|
|
3788
|
+
}, CodeEditor$1 = React__default.lazy(() => import("./CodeEditor-8UTaC8Qy.js")), CanvasArea = () => {
|
|
3789
3789
|
const [o] = useCodeEditor(), n = useBuilderProp("onError", noop);
|
|
3790
3790
|
return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex h-full max-h-full w-full flex-1 flex-col", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "relative flex h-full max-h-full flex-col overflow-hidden bg-gray-100/40 px-2", children: [
|
|
3791
3791
|
/* @__PURE__ */ jsxRuntimeExports.jsx(Suspense, { fallback: /* @__PURE__ */ jsxRuntimeExports.jsx(Skeleton, { className: "h-full" }), children: /* @__PURE__ */ jsxRuntimeExports.jsx(ErrorBoundary, { fallback: /* @__PURE__ */ jsxRuntimeExports.jsx(FallbackError, {}), onError: n, children: /* @__PURE__ */ jsxRuntimeExports.jsx(StaticCanvas$1, {}) }) }),
|
|
@@ -3860,8 +3860,8 @@ const useAllDataProviders = () => useMemo(() => getChaiDataProviders(), []), Blo
|
|
|
3860
3860
|
showHeading: o = !0,
|
|
3861
3861
|
className: n = ""
|
|
3862
3862
|
}) => {
|
|
3863
|
-
const [r, a] = useBrandingOptions(), [l] = useBlocksContainer(), i = React.useRef(r), { t: c } = useTranslation(), d = ({ formData: R },
|
|
3864
|
-
|
|
3863
|
+
const [r, a] = useBrandingOptions(), [l] = useBlocksContainer(), i = React.useRef(r), { t: c } = useTranslation(), d = ({ formData: R }, B) => {
|
|
3864
|
+
B && (a(R), i.current = R);
|
|
3865
3865
|
}, {
|
|
3866
3866
|
bodyFont: u,
|
|
3867
3867
|
headingFont: p,
|
|
@@ -3910,13 +3910,13 @@ const useAllDataProviders = () => useMemo(() => getChaiDataProviders(), []), Blo
|
|
|
3910
3910
|
default: x
|
|
3911
3911
|
})
|
|
3912
3912
|
});
|
|
3913
|
-
const
|
|
3913
|
+
const A = {
|
|
3914
3914
|
type: "object",
|
|
3915
3915
|
properties: {}
|
|
3916
3916
|
}, _ = {};
|
|
3917
3917
|
return Object.keys(S).forEach((R) => {
|
|
3918
|
-
const
|
|
3919
|
-
return
|
|
3918
|
+
const B = S[R];
|
|
3919
|
+
return A.properties || (A.properties = {}), A.properties[R] = B.schema, _[R] = B.uiSchema, !0;
|
|
3920
3920
|
}), /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: cn("flex h-full w-full select-none flex-col", n), children: [
|
|
3921
3921
|
o ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "rounded-md bg-background/30 p-1", children: /* @__PURE__ */ jsxRuntimeExports.jsx("h1", { className: "px-1 font-semibold", children: c("Theme Configuration") }) }) : null,
|
|
3922
3922
|
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
@@ -3929,7 +3929,7 @@ const useAllDataProviders = () => useMemo(() => getChaiDataProviders(), []), Blo
|
|
|
3929
3929
|
liveOmit: !0,
|
|
3930
3930
|
liveValidate: !0,
|
|
3931
3931
|
uiSchema: _,
|
|
3932
|
-
schema:
|
|
3932
|
+
schema: A,
|
|
3933
3933
|
formData: r,
|
|
3934
3934
|
validator,
|
|
3935
3935
|
onChange: d
|
|
@@ -4112,14 +4112,14 @@ function BiExpandVertical(o) {
|
|
|
4112
4112
|
const Node = memo(({ node: o, style: n, dragHandle: r }) => {
|
|
4113
4113
|
const a = useBuilderProp("outlineMenuItems", []), { t: l } = useTranslation(), [i, , c] = useHiddenBlockIds(), [d] = useAtom$1(canvasIframeAtom);
|
|
4114
4114
|
let u = null;
|
|
4115
|
-
const p = o.children.length > 0, { highlightBlock: g, clearHighlight: f } = useBlockHighlight(), { id: x, data: j, isSelected: E, willReceiveDrop: b, isDragging: k, isEditing: S, handleClick:
|
|
4115
|
+
const p = o.children.length > 0, { highlightBlock: g, clearHighlight: f } = useBlockHighlight(), { id: x, data: j, isSelected: E, willReceiveDrop: b, isDragging: k, isEditing: S, handleClick: A } = o, _ = (m) => {
|
|
4116
4116
|
m.stopPropagation(), !i.includes(x) && o.toggle();
|
|
4117
4117
|
}, R = (m) => {
|
|
4118
4118
|
m.isInternal && (u = m.isOpen, m.isOpen && m.close());
|
|
4119
|
-
},
|
|
4119
|
+
}, B = (m) => {
|
|
4120
4120
|
m.isInternal && u !== null && (u ? m.open() : m.close(), u = null);
|
|
4121
|
-
},
|
|
4122
|
-
m.stopPropagation(), !o.isOpen && !i.includes(x) && o.toggle(),
|
|
4121
|
+
}, N = (m) => {
|
|
4122
|
+
m.stopPropagation(), !o.isOpen && !i.includes(x) && o.toggle(), A(m);
|
|
4123
4123
|
};
|
|
4124
4124
|
useEffect(() => {
|
|
4125
4125
|
const m = setTimeout(() => {
|
|
@@ -4131,15 +4131,15 @@ const Node = memo(({ node: o, style: n, dragHandle: r }) => {
|
|
|
4131
4131
|
const m = Object.keys(j), v = [];
|
|
4132
4132
|
for (let C = 0; C < m.length; C++)
|
|
4133
4133
|
if (m[C].endsWith("_attrs")) {
|
|
4134
|
-
const
|
|
4134
|
+
const w = j[m[C]], I = Object.keys(w).join("|");
|
|
4135
4135
|
I.match(/x-data/) && v.push("data"), I.match(/x-on/) && v.push("event"), I.match(/x-show|x-if/) && v.push("show");
|
|
4136
4136
|
}
|
|
4137
4137
|
return v;
|
|
4138
4138
|
}, [j]), D = (m, v) => {
|
|
4139
|
-
const C = d.contentDocument || d.contentWindow.document,
|
|
4140
|
-
|
|
4141
|
-
const I =
|
|
4142
|
-
I.top >=
|
|
4139
|
+
const C = d.contentDocument || d.contentWindow.document, w = C.querySelector(`[data-block-id=${m}]`);
|
|
4140
|
+
w && w.setAttribute("data-drop", v);
|
|
4141
|
+
const I = w.getBoundingClientRect(), T = d.getBoundingClientRect();
|
|
4142
|
+
I.top >= T.top && I.left >= T.left && I.bottom <= T.bottom && I.right <= T.right || (C.documentElement.scrollTop = w.offsetTop - T.top);
|
|
4143
4143
|
};
|
|
4144
4144
|
return x === ROOT_TEMP_KEY ? /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
4145
4145
|
"button",
|
|
@@ -4156,12 +4156,12 @@ const Node = memo(({ node: o, style: n, dragHandle: r }) => {
|
|
|
4156
4156
|
{
|
|
4157
4157
|
onMouseEnter: () => g(x),
|
|
4158
4158
|
onMouseLeave: () => f(),
|
|
4159
|
-
onClick:
|
|
4159
|
+
onClick: N,
|
|
4160
4160
|
style: n,
|
|
4161
4161
|
"data-node-id": x,
|
|
4162
4162
|
ref: i.includes(x) ? null : r,
|
|
4163
4163
|
onDragStart: () => R(o),
|
|
4164
|
-
onDragEnd: () =>
|
|
4164
|
+
onDragEnd: () => B(o),
|
|
4165
4165
|
onDragOver: (m) => {
|
|
4166
4166
|
m.preventDefault(), D(x, "yes");
|
|
4167
4167
|
},
|
|
@@ -4629,8 +4629,8 @@ const Node = memo(({ node: o, style: n, dragHandle: r }) => {
|
|
|
4629
4629
|
const k = stringify([r]);
|
|
4630
4630
|
return hasVideoEmbed(k) && (set(a, "_type", "Video"), set(a, "url", getVideoURLFromHTML(k)), set(a, "styles", `${STYLES_KEY},absolute top-0 left-0 w-full h-full`), set(a, "controls", { autoPlay: !1, muted: !0, loop: !1, controls: !1 })), a.content = k, [a];
|
|
4631
4631
|
} else if (r.tagName === "svg") {
|
|
4632
|
-
const k = find(r.attributes, { key: "height" }), S = find(r.attributes, { key: "width" }),
|
|
4633
|
-
return a.styles = `${STYLES_KEY}, ${cn(`w-${_} h-${
|
|
4632
|
+
const k = find(r.attributes, { key: "height" }), S = find(r.attributes, { key: "width" }), A = get(k, "value") ? `[${get(k, "value")}px]` : "24px", _ = get(S, "value") ? `[${get(S, "value")}px]` : "24px", R = get(find(r.attributes, { key: "class" }), "value", "w-full h-full");
|
|
4633
|
+
return a.styles = `${STYLES_KEY}, ${cn(`w-${_} h-${A}`, R)}`.trim(), r.attributes = filter(r.attributes, (B) => !includes(["style", "width", "height", "class"], B.key)), a.icon = stringify([r]), [a];
|
|
4634
4634
|
} else if (r.tagName == "option" && n && ((b = n.block) == null ? void 0 : b._type) === "Select")
|
|
4635
4635
|
return n.block.options.push({
|
|
4636
4636
|
label: getTextContent(r.children),
|
|
@@ -4697,8 +4697,8 @@ function ExpandableObject(o) {
|
|
|
4697
4697
|
useEffect(() => {
|
|
4698
4698
|
f.current ? E(p(d, r, n)) : f.current = !0;
|
|
4699
4699
|
}, [p]);
|
|
4700
|
-
const b = x ? u.collapseIcon : u.expandIcon, k = x ? "collapse JSON" : "expand JSON", S = useComponentId(),
|
|
4701
|
-
|
|
4700
|
+
const b = x ? u.collapseIcon : u.expandIcon, k = x ? "collapse JSON" : "expand JSON", S = useComponentId(), A = d + 1, _ = a.length - 1, R = (B) => {
|
|
4701
|
+
B.key === " " && (B.preventDefault(), j());
|
|
4702
4702
|
};
|
|
4703
4703
|
return /* @__PURE__ */ createElement("div", {
|
|
4704
4704
|
className: u.basicChildStyle,
|
|
@@ -4724,13 +4724,13 @@ function ExpandableObject(o) {
|
|
|
4724
4724
|
className: u.punctuation
|
|
4725
4725
|
}, i), x ? /* @__PURE__ */ createElement("div", {
|
|
4726
4726
|
id: S
|
|
4727
|
-
}, a.map((
|
|
4728
|
-
key:
|
|
4729
|
-
field:
|
|
4730
|
-
value:
|
|
4727
|
+
}, a.map((B, N) => /* @__PURE__ */ createElement(DataRender, {
|
|
4728
|
+
key: B[0] || N,
|
|
4729
|
+
field: B[0],
|
|
4730
|
+
value: B[1],
|
|
4731
4731
|
style: u,
|
|
4732
|
-
lastElement:
|
|
4733
|
-
level:
|
|
4732
|
+
lastElement: N === _,
|
|
4733
|
+
level: A,
|
|
4734
4734
|
shouldExpandNode: p,
|
|
4735
4735
|
clickToExpandNode: g
|
|
4736
4736
|
}))) : /* @__PURE__ */ createElement("span", {
|
|
@@ -5210,7 +5210,7 @@ const ViewData = ({ data: o, fullView: n }) => {
|
|
|
5210
5210
|
}
|
|
5211
5211
|
)
|
|
5212
5212
|
] });
|
|
5213
|
-
}, UnsplashImages = React__default.lazy(() => import("./UnsplashImages-
|
|
5213
|
+
}, UnsplashImages = React__default.lazy(() => import("./UnsplashImages-il4RCHAD.js")), UploadImages = React__default.lazy(() => import("./UploadImages-9axJYIUJ.js")), ImagesPanel = ({
|
|
5214
5214
|
isModalView: o = !1,
|
|
5215
5215
|
onSelect: n = () => {
|
|
5216
5216
|
}
|
|
@@ -5305,31 +5305,33 @@ const ImagePickerModal$1 = ImagePickerModal, ImagePickerField = ({ value: o, onC
|
|
|
5305
5305
|
onChange: r
|
|
5306
5306
|
}) => {
|
|
5307
5307
|
var D;
|
|
5308
|
-
|
|
5309
|
-
const { t: a } = useTranslation(), l = useBuilderProp("searchCollectionItems", (m, v) => []), [i, c] = useState(""), [d, u] = useState(!1), [p, g] = useState("pages"), [f, x] = useState(""), [j, E] = useState([]), [b, k] = useState(-1), S = useRef(null), w = (D = n == null ? void 0 : n.find((m) => m.key === p)) == null ? void 0 : D.name;
|
|
5308
|
+
const { t: a } = useTranslation(), l = useBuilderProp("searchCollectionItems", (m, v) => []), [i, c] = useState(!1), [d, u] = useState(!1), [p, g] = useState("pages"), [f, x] = useState(""), [j, E] = useState([]), [b, k] = useState(-1), S = useRef(null), A = (D = n == null ? void 0 : n.find((m) => m.key === p)) == null ? void 0 : D.name;
|
|
5310
5309
|
useEffect(() => {
|
|
5311
|
-
|
|
5312
|
-
|
|
5313
|
-
|
|
5314
|
-
|
|
5315
|
-
|
|
5310
|
+
if (!(o != null && o.href) || i || !startsWith(o == null ? void 0 : o.href, "collection:"))
|
|
5311
|
+
return;
|
|
5312
|
+
const m = (o == null ? void 0 : o.href) || "", v = split(m, ":"), C = get(v, 1, "pages") || "pages";
|
|
5313
|
+
g(C), x(""), E([]), k(-1), (async () => {
|
|
5314
|
+
c(!0);
|
|
5315
|
+
const w = await l(C, [get(v, 2, "pages")]);
|
|
5316
|
+
w && Array.isArray(w) && x(get(w, [0, "name"], "")), c(!1);
|
|
5316
5317
|
})();
|
|
5317
5318
|
}, [o == null ? void 0 : o.href]);
|
|
5318
|
-
const _ =
|
|
5319
|
-
|
|
5319
|
+
const _ = useDebouncedCallback(
|
|
5320
|
+
async (m) => {
|
|
5320
5321
|
if (isEmpty(m))
|
|
5321
5322
|
E([]);
|
|
5322
5323
|
else {
|
|
5323
5324
|
const v = await l(p, m);
|
|
5324
5325
|
E(v);
|
|
5325
5326
|
}
|
|
5326
|
-
c(
|
|
5327
|
-
},
|
|
5328
|
-
[p]
|
|
5327
|
+
c(!1), k(-1);
|
|
5328
|
+
},
|
|
5329
|
+
[p],
|
|
5330
|
+
300
|
|
5329
5331
|
), R = (m) => {
|
|
5330
5332
|
const v = ["collection", p, m.id];
|
|
5331
5333
|
v[1] && (r({ ...o, href: v.join(":") }), u(!1));
|
|
5332
|
-
},
|
|
5334
|
+
}, B = (m) => {
|
|
5333
5335
|
switch (m.key) {
|
|
5334
5336
|
case "ArrowDown":
|
|
5335
5337
|
m.preventDefault(), k((v) => v < j.length - 1 ? v + 1 : v);
|
|
@@ -5343,7 +5345,7 @@ const ImagePickerModal$1 = ImagePickerModal, ImagePickerField = ({ value: o, onC
|
|
|
5343
5345
|
b >= 0 && R(j[b]);
|
|
5344
5346
|
break;
|
|
5345
5347
|
case "Escape":
|
|
5346
|
-
m.preventDefault(),
|
|
5348
|
+
m.preventDefault(), N();
|
|
5347
5349
|
break;
|
|
5348
5350
|
}
|
|
5349
5351
|
};
|
|
@@ -5353,10 +5355,10 @@ const ImagePickerModal$1 = ImagePickerModal, ImagePickerField = ({ value: o, onC
|
|
|
5353
5355
|
m == null || m.scrollIntoView({ block: "nearest" });
|
|
5354
5356
|
}
|
|
5355
5357
|
}, [b]);
|
|
5356
|
-
const
|
|
5358
|
+
const N = () => {
|
|
5357
5359
|
x(""), E([]), k(-1), u(!1), r({ ...o, href: "" });
|
|
5358
5360
|
}, L = (m) => {
|
|
5359
|
-
x(m), u(!isEmpty(m)), c(
|
|
5361
|
+
x(m), u(!isEmpty(m)), c(!0), _(m);
|
|
5360
5362
|
};
|
|
5361
5363
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
|
|
5362
5364
|
/* @__PURE__ */ jsxRuntimeExports.jsx("select", { name: "collection", value: p, onChange: (m) => g(m.target.value), children: map(n, (m) => /* @__PURE__ */ jsxRuntimeExports.jsx("option", { value: m.key, children: m.name }, m.key)) }),
|
|
@@ -5367,15 +5369,15 @@ const ImagePickerModal$1 = ImagePickerModal, ImagePickerField = ({ value: o, onC
|
|
|
5367
5369
|
type: "text",
|
|
5368
5370
|
value: f,
|
|
5369
5371
|
onChange: (m) => L(m.target.value),
|
|
5370
|
-
onKeyDown:
|
|
5371
|
-
placeholder: a(`Search ${
|
|
5372
|
-
disabled: i
|
|
5372
|
+
onKeyDown: B,
|
|
5373
|
+
placeholder: a(`Search ${A}`),
|
|
5374
|
+
disabled: i,
|
|
5373
5375
|
className: "w-full rounded-md border border-gray-300 p-2 pr-16"
|
|
5374
5376
|
}
|
|
5375
5377
|
),
|
|
5376
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "absolute bottom-2 right-2 top-3 flex items-center gap-1.5", children: f && /* @__PURE__ */ jsxRuntimeExports.jsx("button", { onClick:
|
|
5378
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "absolute bottom-2 right-2 top-3 flex items-center gap-1.5", children: f && /* @__PURE__ */ jsxRuntimeExports.jsx("button", { onClick: N, className: "text-gray-400 hover:text-gray-600", title: a("Clear search"), children: /* @__PURE__ */ jsxRuntimeExports.jsx(X, { className: "h-4 w-4" }) }) })
|
|
5377
5379
|
] }),
|
|
5378
|
-
(i
|
|
5380
|
+
(i || !isEmpty(j) || d && isEmpty(j)) && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "absolute z-40 mt-2 max-h-40 w-full overflow-y-auto rounded-md border border-border bg-background shadow-lg", children: i ? /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "space-y-1 p-2", children: [
|
|
5379
5381
|
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "h-6 w-full animate-pulse rounded bg-gray-200" }),
|
|
5380
5382
|
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "h-6 w-full animate-pulse rounded bg-gray-200" })
|
|
5381
5383
|
] }) : d && isEmpty(j) ? /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center justify-center p-4 text-sm text-gray-500", children: [
|
|
@@ -5429,9 +5431,7 @@ const ImagePickerModal$1 = ImagePickerModal, ImagePickerField = ({ value: o, onC
|
|
|
5429
5431
|
type: "text",
|
|
5430
5432
|
value: i,
|
|
5431
5433
|
onChange: (p) => r({ ...n, href: p.target.value }),
|
|
5432
|
-
placeholder: a(
|
|
5433
|
-
l === "page" || l === "url" ? "Enter URL" : l === "scroll" ? "#ElementID" : "Enter details"
|
|
5434
|
-
)
|
|
5434
|
+
placeholder: a(l === "url" ? "Enter URL" : l === "scroll" ? "#ElementID" : "Enter details")
|
|
5435
5435
|
}
|
|
5436
5436
|
),
|
|
5437
5437
|
u === "url" && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center gap-x-2 text-muted-foreground", children: [
|
|
@@ -5582,8 +5582,8 @@ const ImagePickerModal$1 = ImagePickerModal, ImagePickerField = ({ value: o, onC
|
|
|
5582
5582
|
function BlockSettings() {
|
|
5583
5583
|
const { selectedLang: o } = useLanguages(), n = useSelectedBlock(), r = useUpdateBlocksPropsRealtime(), a = useUpdateBlocksProps(), l = getBlockComponent(n == null ? void 0 : n._type), i = formDataWithSelectedLang(n, o, l), [c, d] = useState(i), u = useBuilderProp("dataBindingSupport", !1), p = ({ formData: b }, k, S) => {
|
|
5584
5584
|
if (k && (c == null ? void 0 : c._id) === n._id) {
|
|
5585
|
-
const
|
|
5586
|
-
a([n._id], { [
|
|
5585
|
+
const A = k.replace("root.", "");
|
|
5586
|
+
a([n._id], { [A]: get(b, A) }, S);
|
|
5587
5587
|
}
|
|
5588
5588
|
}, g = useCallback(
|
|
5589
5589
|
debounce(({ formData: b }, k, S) => {
|
|
@@ -5693,12 +5693,12 @@ const askAiProcessingAtom = atom$1(!1), useAskAi = () => {
|
|
|
5693
5693
|
try {
|
|
5694
5694
|
const b = f === "content" ? cloneDeep(getBlockWithChildren(x, d)) : [cloneDeep(d.find((R) => R._id === x))];
|
|
5695
5695
|
set(b, "0._parent", null);
|
|
5696
|
-
const k = u === p ? "" : u, S = await l(f, promptWithLanguage(j, g, f), b, k), { blocks:
|
|
5696
|
+
const k = u === p ? "" : u, S = await l(f, promptWithLanguage(j, g, f), b, k), { blocks: A, error: _ } = S;
|
|
5697
5697
|
if (_) {
|
|
5698
5698
|
a(_);
|
|
5699
5699
|
return;
|
|
5700
5700
|
}
|
|
5701
|
-
f === "styles" ? c(
|
|
5701
|
+
f === "styles" ? c(A) : i(A), E && E(S);
|
|
5702
5702
|
} catch (b) {
|
|
5703
5703
|
a(b);
|
|
5704
5704
|
} finally {
|
|
@@ -5853,12 +5853,12 @@ const AskAIStyles = ({ blockId: o }) => {
|
|
|
5853
5853
|
keys: ["name"]
|
|
5854
5854
|
});
|
|
5855
5855
|
function ManualClasses() {
|
|
5856
|
-
var
|
|
5857
|
-
const { t: o } = useTranslation(), [n] = useSelectedStylingBlocks(), r = useSelectedBlock(), a = useAddClassesToBlocks(), l = useRemoveClassesFromBlocks(), [i] = useSelectedBlockIds(), c = useBuilderProp("askAiCallBack", null), [d, u] = useState(""), { toast: p } = useToast(), g = (
|
|
5858
|
-
const
|
|
5859
|
-
a(i,
|
|
5860
|
-
}, [j, E] = useState([]), b = ({ value:
|
|
5861
|
-
const L =
|
|
5856
|
+
var B;
|
|
5857
|
+
const { t: o } = useTranslation(), [n] = useSelectedStylingBlocks(), r = useSelectedBlock(), a = useAddClassesToBlocks(), l = useRemoveClassesFromBlocks(), [i] = useSelectedBlockIds(), c = useBuilderProp("askAiCallBack", null), [d, u] = useState(""), { toast: p } = useToast(), g = (B = first(n)) == null ? void 0 : B.prop, f = reject((get(r, g, "").replace(STYLES_KEY, "").split(",").pop() || "").split(" "), isEmpty), x = () => {
|
|
5858
|
+
const N = d.trim().toLowerCase().replace(/ +(?= )/g, "").split(" ");
|
|
5859
|
+
a(i, N, !0), u("");
|
|
5860
|
+
}, [j, E] = useState([]), b = ({ value: N }) => {
|
|
5861
|
+
const L = N.trim().toLowerCase(), D = L.match(/.+:/g);
|
|
5862
5862
|
let m = [];
|
|
5863
5863
|
if (D && D.length > 0) {
|
|
5864
5864
|
const [v] = D, C = L.replace(v, "");
|
|
@@ -5871,17 +5871,17 @@ function ManualClasses() {
|
|
|
5871
5871
|
return E(map(m, "item"));
|
|
5872
5872
|
}, k = () => {
|
|
5873
5873
|
E([]);
|
|
5874
|
-
}, S = (
|
|
5874
|
+
}, S = (N) => N.name, A = (N) => /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "rounded-md p-1", children: N.name }), _ = {
|
|
5875
5875
|
autoComplete: "off",
|
|
5876
5876
|
autoCorrect: "off",
|
|
5877
5877
|
autoCapitalize: "off",
|
|
5878
5878
|
spellCheck: !1,
|
|
5879
5879
|
placeholder: o("Enter classes separated by space"),
|
|
5880
5880
|
value: d,
|
|
5881
|
-
onKeyDown: (
|
|
5882
|
-
|
|
5881
|
+
onKeyDown: (N) => {
|
|
5882
|
+
N.key === "Enter" && d.trim() !== "" && x();
|
|
5883
5883
|
},
|
|
5884
|
-
onChange: (
|
|
5884
|
+
onChange: (N, { newValue: L }) => u(L),
|
|
5885
5885
|
className: "w-full rounded-md text-xs px-2 hover:outline-0 bg-background border-border py-1"
|
|
5886
5886
|
}, R = () => {
|
|
5887
5887
|
if (navigator.clipboard === void 0) {
|
|
@@ -5926,7 +5926,7 @@ function ManualClasses() {
|
|
|
5926
5926
|
onSuggestionsFetchRequested: b,
|
|
5927
5927
|
onSuggestionsClearRequested: k,
|
|
5928
5928
|
getSuggestionValue: S,
|
|
5929
|
-
renderSuggestion:
|
|
5929
|
+
renderSuggestion: A,
|
|
5930
5930
|
inputProps: _,
|
|
5931
5931
|
containerProps: {
|
|
5932
5932
|
className: "relative h-8 w-full gap-y-1 py-1 border-border"
|
|
@@ -5951,22 +5951,22 @@ function ManualClasses() {
|
|
|
5951
5951
|
)
|
|
5952
5952
|
] }),
|
|
5953
5953
|
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex w-full flex-wrap gap-2 overflow-x-hidden", children: React.Children.toArray(
|
|
5954
|
-
f.map((
|
|
5954
|
+
f.map((N) => /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
5955
5955
|
"div",
|
|
5956
5956
|
{
|
|
5957
5957
|
className: "group relative flex max-w-[260px] cursor-default items-center gap-x-1 truncate rounded border border-border bg-gray-200 p-px px-1.5 text-[11px] text-gray-600 hover:border-gray-300 dark:border-gray-700 dark:bg-gray-800 dark:text-gray-300",
|
|
5958
5958
|
children: [
|
|
5959
|
-
|
|
5959
|
+
N,
|
|
5960
5960
|
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
5961
5961
|
Cross2Icon,
|
|
5962
5962
|
{
|
|
5963
|
-
onClick: () => l(i, [
|
|
5963
|
+
onClick: () => l(i, [N]),
|
|
5964
5964
|
className: "invisible absolute right-1 rounded-full bg-red-400 hover:text-white group-hover:visible group-hover:cursor-pointer"
|
|
5965
5965
|
}
|
|
5966
5966
|
)
|
|
5967
5967
|
]
|
|
5968
5968
|
},
|
|
5969
|
-
|
|
5969
|
+
N
|
|
5970
5970
|
))
|
|
5971
5971
|
) })
|
|
5972
5972
|
]
|
|
@@ -6616,7 +6616,7 @@ const RangeChoices = ({ property: o, onChange: n }) => {
|
|
|
6616
6616
|
},
|
|
6617
6617
|
a
|
|
6618
6618
|
)) }), THROTTLE_TIME = 50, AdvanceChoices = (o) => {
|
|
6619
|
-
const [n, r] = useState(!1), [a, l] = useState(""), { currentClass: i, onChange: c, classPrefix: d, cssProperty: u, units: p, negative: g } = o, [f, x] = useState(u != null && u.toLowerCase().includes("width") ? "%" : p[0]), [j, E] = useState(!1), [b, k] = useState(""), [S,
|
|
6619
|
+
const [n, r] = useState(!1), [a, l] = useState(""), { currentClass: i, onChange: c, classPrefix: d, cssProperty: u, units: p, negative: g } = o, [f, x] = useState(u != null && u.toLowerCase().includes("width") ? "%" : p[0]), [j, E] = useState(!1), [b, k] = useState(""), [S, A] = useState(!1), [_, R] = useState(!1);
|
|
6620
6620
|
useEffect(() => {
|
|
6621
6621
|
const { value: m, unit: v } = getClassValueAndUnit(i);
|
|
6622
6622
|
if (v === "") {
|
|
@@ -6625,7 +6625,7 @@ const RangeChoices = ({ property: o, onChange: n }) => {
|
|
|
6625
6625
|
}
|
|
6626
6626
|
x(v), l(v === "class" || isEmpty(m) ? "" : m);
|
|
6627
6627
|
}, [i, u, p]);
|
|
6628
|
-
const
|
|
6628
|
+
const B = useThrottledCallback((m) => c(m), [c], THROTTLE_TIME), N = useThrottledCallback((m) => c(m, !1), [c], THROTTLE_TIME), L = useCallback(
|
|
6629
6629
|
(m = !1) => {
|
|
6630
6630
|
const v = getUserInputValues(`${a}`, p);
|
|
6631
6631
|
if (get(v, "error", !1)) {
|
|
@@ -6634,15 +6634,15 @@ const RangeChoices = ({ property: o, onChange: n }) => {
|
|
|
6634
6634
|
}
|
|
6635
6635
|
const C = get(v, "unit") !== "" ? get(v, "unit") : f;
|
|
6636
6636
|
if (C === "auto" || C === "none") {
|
|
6637
|
-
|
|
6637
|
+
B(`${d}${C}`);
|
|
6638
6638
|
return;
|
|
6639
6639
|
}
|
|
6640
6640
|
if (get(v, "value") === "")
|
|
6641
6641
|
return;
|
|
6642
6642
|
const I = `${get(v, "value", "").startsWith("-") ? "-" : ""}${d}[${get(v, "value", "").replace("-", "")}${C === "-" ? "" : C}]`;
|
|
6643
|
-
m ?
|
|
6643
|
+
m ? N(I) : B(I);
|
|
6644
6644
|
},
|
|
6645
|
-
[
|
|
6645
|
+
[B, N, a, f, d, p]
|
|
6646
6646
|
), D = useCallback(
|
|
6647
6647
|
(m) => {
|
|
6648
6648
|
const v = getUserInputValues(`${a}`, p);
|
|
@@ -6651,15 +6651,15 @@ const RangeChoices = ({ property: o, onChange: n }) => {
|
|
|
6651
6651
|
return;
|
|
6652
6652
|
}
|
|
6653
6653
|
if (m === "auto" || m === "none") {
|
|
6654
|
-
|
|
6654
|
+
B(`${d}${m}`);
|
|
6655
6655
|
return;
|
|
6656
6656
|
}
|
|
6657
6657
|
if (get(v, "value") === "")
|
|
6658
6658
|
return;
|
|
6659
6659
|
const C = get(v, "unit") !== "" ? get(v, "unit") : m, I = `${get(v, "value", "").startsWith("-") ? "-" : ""}${d}[${get(v, "value", "").replace("-", "")}${C === "-" ? "" : C}]`;
|
|
6660
|
-
|
|
6660
|
+
B(I);
|
|
6661
6661
|
},
|
|
6662
|
-
[
|
|
6662
|
+
[B, a, d, p]
|
|
6663
6663
|
);
|
|
6664
6664
|
return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex w-full flex-col", children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex items-center justify-start", children: f === "class" ? /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
|
|
6665
6665
|
/* @__PURE__ */ jsxRuntimeExports.jsx("input", { className: "w-20 rounded py-1", readOnly: !0, value: i }),
|
|
@@ -6683,8 +6683,8 @@ const RangeChoices = ({ property: o, onChange: n }) => {
|
|
|
6683
6683
|
const v = parseInt$1(m.target.value);
|
|
6684
6684
|
let C = isNaN$1(v) ? 0 : v;
|
|
6685
6685
|
m.keyCode === 38 && (C += 1), m.keyCode === 40 && (C -= 1);
|
|
6686
|
-
const
|
|
6687
|
-
T
|
|
6686
|
+
const w = `${C}`, T = `${w.startsWith("-") ? "-" : ""}${d}[${w.replace("-", "")}${f === "-" ? "" : f}]`;
|
|
6687
|
+
N(T);
|
|
6688
6688
|
},
|
|
6689
6689
|
onKeyUp: (m) => {
|
|
6690
6690
|
_ && (m.preventDefault(), R(!1));
|
|
@@ -6732,19 +6732,19 @@ const RangeChoices = ({ property: o, onChange: n }) => {
|
|
|
6732
6732
|
["none", "auto"].indexOf(f) !== -1 || S ? null : /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
6733
6733
|
DragStyleButton,
|
|
6734
6734
|
{
|
|
6735
|
-
onDragStart: () =>
|
|
6735
|
+
onDragStart: () => A(!0),
|
|
6736
6736
|
onDragEnd: (m) => {
|
|
6737
|
-
if (k(() => ""),
|
|
6737
|
+
if (k(() => ""), A(!1), isEmpty(m))
|
|
6738
6738
|
return;
|
|
6739
|
-
const v = `${m}`,
|
|
6740
|
-
|
|
6739
|
+
const v = `${m}`, w = `${v.startsWith("-") ? "-" : ""}${d}[${v.replace("-", "")}${f === "-" ? "" : f}]`;
|
|
6740
|
+
B(w);
|
|
6741
6741
|
},
|
|
6742
6742
|
onDrag: (m) => {
|
|
6743
6743
|
if (isEmpty(m))
|
|
6744
6744
|
return;
|
|
6745
6745
|
k(m);
|
|
6746
|
-
const v = `${m}`,
|
|
6747
|
-
|
|
6746
|
+
const v = `${m}`, w = `${v.startsWith("-") ? "-" : ""}${d}[${v.replace("-", "")}${f === "-" ? "" : f}]`;
|
|
6747
|
+
N(w);
|
|
6748
6748
|
},
|
|
6749
6749
|
currentValue: a,
|
|
6750
6750
|
unit: f,
|
|
@@ -6842,8 +6842,8 @@ const RangeChoices = ({ property: o, onChange: n }) => {
|
|
|
6842
6842
|
}, getBreakpoint = (o) => `${o.toUpperCase()} ${BREAKPOINTS[o] ? `(${BREAKPOINTS[o]} & up)` : ""}`, BlockStyle = (o) => {
|
|
6843
6843
|
const { t: n } = useTranslation(), { type: r = "icons", label: a, property: l, onEmitChange: i = () => {
|
|
6844
6844
|
}, units: c, negative: d = !1 } = o, [u] = useDarkMode(), [p] = useStylingState(), [, g] = useCanvasWidth(), f = useCurrentClassByProperty(l), x = useAddClassesToBlocks(), j = useRemoveClassesFromBlocks(), [E] = useSelectedBlockIds(), b = useMemo(() => get(f, "fullCls", ""), [f]), k = useCallback(
|
|
6845
|
-
(
|
|
6846
|
-
const D = { dark: u, mq: g, mod: p, cls:
|
|
6845
|
+
(N, L = !0) => {
|
|
6846
|
+
const D = { dark: u, mq: g, mod: p, cls: N, property: l, fullCls: "" };
|
|
6847
6847
|
(u || p !== "") && (D.mq = "xs");
|
|
6848
6848
|
const m = generateFullClsName(D);
|
|
6849
6849
|
x(E, [m], L);
|
|
@@ -6851,12 +6851,12 @@ const RangeChoices = ({ property: o, onChange: n }) => {
|
|
|
6851
6851
|
[E, u, g, p, l, x]
|
|
6852
6852
|
), S = useCallback(() => {
|
|
6853
6853
|
j(E, [b]);
|
|
6854
|
-
}, [E, b, j]),
|
|
6854
|
+
}, [E, b, j]), A = useMemo(() => canChangeClass(f, g), [f, g]);
|
|
6855
6855
|
useEffect(() => {
|
|
6856
|
-
i(
|
|
6857
|
-
}, [
|
|
6856
|
+
i(A, f);
|
|
6857
|
+
}, [A, i, f]);
|
|
6858
6858
|
const [, , _] = useCanvasWidth(), R = useCallback(
|
|
6859
|
-
(
|
|
6859
|
+
(N) => {
|
|
6860
6860
|
_({
|
|
6861
6861
|
xs: 400,
|
|
6862
6862
|
sm: 640,
|
|
@@ -6864,12 +6864,12 @@ const RangeChoices = ({ property: o, onChange: n }) => {
|
|
|
6864
6864
|
lg: 1024,
|
|
6865
6865
|
xl: 1420,
|
|
6866
6866
|
"2xl": 1920
|
|
6867
|
-
}[
|
|
6867
|
+
}[N]);
|
|
6868
6868
|
},
|
|
6869
6869
|
[_]
|
|
6870
|
-
),
|
|
6871
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx(BlockStyleProvider, { canChange:
|
|
6872
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "relative w-[70px] truncate text-xs text-foreground", children: /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: `text-[11px] ${f && !
|
|
6870
|
+
), B = get(f, "dark", null) === u && get(f, "mod", null) === p && get(f, "mq", null) === g;
|
|
6871
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(BlockStyleProvider, { canChange: A, canReset: f && B, children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "group flex flex-row items-center py-2 first:pt-0 last:pb-0", children: [
|
|
6872
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "relative w-[70px] truncate text-xs text-foreground", children: /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: `text-[11px] ${f && !B ? "text-foreground" : ""}`, children: n(a) }) }),
|
|
6873
6873
|
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex flex-row items-center", children: [
|
|
6874
6874
|
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "w-[150px]", children: [
|
|
6875
6875
|
r === "arbitrary" ? /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
@@ -6888,7 +6888,7 @@ const RangeChoices = ({ property: o, onChange: n }) => {
|
|
|
6888
6888
|
r === "color" && /* @__PURE__ */ jsxRuntimeExports.jsx(ColorChoice, { property: l, onChange: k }),
|
|
6889
6889
|
r === "dropdown" && /* @__PURE__ */ jsxRuntimeExports.jsx(DropDownChoices, { label: a, property: l, onChange: k })
|
|
6890
6890
|
] }),
|
|
6891
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `w-[30px] cursor-pointer ${b ? "visible" : "invisible"}`, children:
|
|
6891
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `w-[30px] cursor-pointer ${b ? "visible" : "invisible"}`, children: B ? /* @__PURE__ */ jsxRuntimeExports.jsx("button", { type: "button", onClick: () => S(), title: "Reset", className: "flex px-1.5 text-xs", children: /* @__PURE__ */ jsxRuntimeExports.jsx(CrossCircledIcon, { className: "h-5 w-5 text-blue-500 hover:opacity-80" }) }) : A && f ? /* @__PURE__ */ jsxRuntimeExports.jsxs(Tooltip, { delayDuration: 100, children: [
|
|
6892
6892
|
/* @__PURE__ */ jsxRuntimeExports.jsx(TooltipTrigger, { asChild: !0, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
6893
6893
|
"button",
|
|
6894
6894
|
{
|
|
@@ -7181,9 +7181,9 @@ const BlockCard = ({
|
|
|
7181
7181
|
[o]
|
|
7182
7182
|
), b = async (k) => {
|
|
7183
7183
|
const S = await i(n, o);
|
|
7184
|
-
let
|
|
7185
|
-
if (j(first(S)) && (
|
|
7186
|
-
const _ = { blocks: S, uiLibrary: !0, parent:
|
|
7184
|
+
let A = r;
|
|
7185
|
+
if (j(first(S)) && (A = null), !isEmpty(S)) {
|
|
7186
|
+
const _ = { blocks: S, uiLibrary: !0, parent: A };
|
|
7187
7187
|
if (k.dataTransfer.setData("text/plain", JSON.stringify(_)), o.preview) {
|
|
7188
7188
|
const R = new Image();
|
|
7189
7189
|
R.src = o.preview, R.onload = () => {
|
|
@@ -7232,9 +7232,9 @@ const BlockCard = ({
|
|
|
7232
7232
|
})();
|
|
7233
7233
|
}, [o, l, i, c]), { data: l || [], isLoading: i === "loading" };
|
|
7234
7234
|
}, UILibrarySection = ({ parentId: o }) => {
|
|
7235
|
-
const [n, r] = useAtom$1(selectedLibraryAtom), a = useBuilderProp("uiLibraries", []), l = useChaiBlocks(), i = values(l).filter((
|
|
7235
|
+
const [n, r] = useAtom$1(selectedLibraryAtom), a = useBuilderProp("uiLibraries", []), l = useChaiBlocks(), i = values(l).filter((A) => A.category === "custom"), c = a.find((A) => A.uuid === n) || first(a), { data: d, isLoading: u } = useLibraryBlocks(c), p = groupBy([...d, ...i], "group"), [g, f] = useState("Hero"), x = get(p, g, []), j = useRef(null), { t: E } = useTranslation(), b = (A) => {
|
|
7236
7236
|
j.current && (clearTimeout(j.current), j.current = null), j.current = setTimeout(() => {
|
|
7237
|
-
j.current && f(
|
|
7237
|
+
j.current && f(A);
|
|
7238
7238
|
}, 300);
|
|
7239
7239
|
};
|
|
7240
7240
|
if (u)
|
|
@@ -7242,7 +7242,7 @@ const BlockCard = ({
|
|
|
7242
7242
|
/* @__PURE__ */ jsxRuntimeExports.jsx(Skeleton, { className: "col-span-3 h-full" }),
|
|
7243
7243
|
/* @__PURE__ */ jsxRuntimeExports.jsx(Skeleton, { className: "col-span-9 h-full" })
|
|
7244
7244
|
] });
|
|
7245
|
-
const k = filter(x, (
|
|
7245
|
+
const k = filter(x, (A, _) => _ % 2 === 0), S = filter(x, (A, _) => _ % 2 === 1);
|
|
7246
7246
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "relative mt-2 flex h-full max-h-full overflow-hidden bg-background", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex h-full pt-2", children: [
|
|
7247
7247
|
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex h-full max-h-full w-60 flex-col gap-1 px-1 pr-2", children: [
|
|
7248
7248
|
/* @__PURE__ */ jsxRuntimeExports.jsx(UILibrariesSelect, { library: c == null ? void 0 : c.uuid, setLibrary: r, uiLibraries: a }),
|
|
@@ -7250,7 +7250,7 @@ const BlockCard = ({
|
|
|
7250
7250
|
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-xs font-bold text-gray-500", children: E("Groups") }),
|
|
7251
7251
|
/* @__PURE__ */ jsxRuntimeExports.jsx("hr", { className: "mt-1 border-border" }),
|
|
7252
7252
|
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "no-scrollbar mt-2 h-full max-h-full flex-1 overflow-y-auto pb-20", children: React__default.Children.toArray(
|
|
7253
|
-
map(p, (
|
|
7253
|
+
map(p, (A, _) => /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
7254
7254
|
"div",
|
|
7255
7255
|
{
|
|
7256
7256
|
onMouseEnter: () => b(_),
|
|
@@ -7278,10 +7278,10 @@ const BlockCard = ({
|
|
|
7278
7278
|
children: [
|
|
7279
7279
|
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "grid grid-cols-2 gap-2 px-2", children: [
|
|
7280
7280
|
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex flex-col gap-1", children: React__default.Children.toArray(
|
|
7281
|
-
k.map((
|
|
7281
|
+
k.map((A) => /* @__PURE__ */ jsxRuntimeExports.jsx(BlockCard, { parentId: o, block: A, library: c }))
|
|
7282
7282
|
) }),
|
|
7283
7283
|
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex flex-col gap-1", children: React__default.Children.toArray(
|
|
7284
|
-
S.map((
|
|
7284
|
+
S.map((A) => /* @__PURE__ */ jsxRuntimeExports.jsx(BlockCard, { parentId: o, block: A, library: c }))
|
|
7285
7285
|
) })
|
|
7286
7286
|
] }),
|
|
7287
7287
|
/* @__PURE__ */ jsxRuntimeExports.jsx("br", {}),
|
|
@@ -8366,11 +8366,11 @@ const AIUserPrompt = ({ blockId: o }) => {
|
|
|
8366
8366
|
r(R), l(a), c(""), u(""), x("");
|
|
8367
8367
|
}
|
|
8368
8368
|
}, k = (R) => {
|
|
8369
|
-
const
|
|
8370
|
-
r(
|
|
8369
|
+
const B = a.filter((N, L) => L !== R);
|
|
8370
|
+
r(B), l(B);
|
|
8371
8371
|
}, S = (R) => {
|
|
8372
8372
|
g(R), c(a[R].key), u(a[R].value);
|
|
8373
|
-
},
|
|
8373
|
+
}, A = () => {
|
|
8374
8374
|
if (i.startsWith("@")) {
|
|
8375
8375
|
x("Attribute keys cannot start with '@'");
|
|
8376
8376
|
return;
|
|
@@ -8380,14 +8380,14 @@ const AIUserPrompt = ({ blockId: o }) => {
|
|
|
8380
8380
|
R[p] = { key: i, value: d }, r(R), l(R), g(null), c(""), u(""), x("");
|
|
8381
8381
|
}
|
|
8382
8382
|
}, _ = (R) => {
|
|
8383
|
-
R.key === "Enter" && !R.shiftKey && (R.preventDefault(), p !== null ?
|
|
8383
|
+
R.key === "Enter" && !R.shiftKey && (R.preventDefault(), p !== null ? A() : b());
|
|
8384
8384
|
};
|
|
8385
8385
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "max-w-full", children: [
|
|
8386
8386
|
/* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
8387
8387
|
"form",
|
|
8388
8388
|
{
|
|
8389
8389
|
onSubmit: (R) => {
|
|
8390
|
-
R.preventDefault(), p !== null ?
|
|
8390
|
+
R.preventDefault(), p !== null ? A() : b();
|
|
8391
8391
|
},
|
|
8392
8392
|
className: "space-y-3",
|
|
8393
8393
|
children: [
|
|
@@ -8434,22 +8434,22 @@ const AIUserPrompt = ({ blockId: o }) => {
|
|
|
8434
8434
|
]
|
|
8435
8435
|
}
|
|
8436
8436
|
),
|
|
8437
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "mt-4 space-y-1 overflow-y-auto", children: a.map((R,
|
|
8437
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "mt-4 space-y-1 overflow-y-auto", children: a.map((R, B) => /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center justify-between rounded bg-muted p-1.5 text-sm", children: [
|
|
8438
8438
|
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "mr-2 flex flex-col", children: [
|
|
8439
8439
|
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "truncate font-semibold", children: R.key }),
|
|
8440
8440
|
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-wrap max-w-[200px] text-muted-foreground", children: R.value.toString() })
|
|
8441
8441
|
] }),
|
|
8442
8442
|
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex-shrink-0", children: [
|
|
8443
|
-
/* @__PURE__ */ jsxRuntimeExports.jsxs(Button, { variant: "ghost", size: "icon", className: "h-6 w-6", onClick: () => S(
|
|
8443
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs(Button, { variant: "ghost", size: "icon", className: "h-6 w-6", onClick: () => S(B), children: [
|
|
8444
8444
|
/* @__PURE__ */ jsxRuntimeExports.jsx(Edit2, { className: "h-3 w-3" }),
|
|
8445
8445
|
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "sr-only", children: "Edit attribute" })
|
|
8446
8446
|
] }),
|
|
8447
|
-
/* @__PURE__ */ jsxRuntimeExports.jsxs(Button, { variant: "ghost", size: "icon", className: "h-6 w-6", onClick: () => k(
|
|
8447
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs(Button, { variant: "ghost", size: "icon", className: "h-6 w-6", onClick: () => k(B), children: [
|
|
8448
8448
|
/* @__PURE__ */ jsxRuntimeExports.jsx(X, { className: "h-3 w-3" }),
|
|
8449
8449
|
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "sr-only", children: "Remove attribute" })
|
|
8450
8450
|
] })
|
|
8451
8451
|
] })
|
|
8452
|
-
] },
|
|
8452
|
+
] }, B)) })
|
|
8453
8453
|
] });
|
|
8454
8454
|
}), BlockAttributesEditor = React.memo(() => {
|
|
8455
8455
|
const o = useSelectedBlock(), [n, r] = useState([]), [a] = useSelectedStylingBlocks(), l = useUpdateBlocksProps(), i = `${get(a, "0.prop")}_attrs`;
|
|
@@ -8971,7 +8971,7 @@ const PageDataProviders = () => {
|
|
|
8971
8971
|
function AiFillDatabase(o) {
|
|
8972
8972
|
return GenIcon({ tag: "svg", attr: { viewBox: "0 0 1024 1024" }, child: [{ tag: "path", attr: { d: "M832 64H192c-17.7 0-32 14.3-32 32v224h704V96c0-17.7-14.3-32-32-32zM288 232c-22.1 0-40-17.9-40-40s17.9-40 40-40 40 17.9 40 40-17.9 40-40 40zM160 928c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V704H160v224zm128-136c22.1 0 40 17.9 40 40s-17.9 40-40 40-40-17.9-40-40 17.9-40 40-40zM160 640h704V384H160v256zm128-168c22.1 0 40 17.9 40 40s-17.9 40-40 40-40-17.9-40-40 17.9-40 40-40z" }, child: [] }] })(o);
|
|
8973
8973
|
}
|
|
8974
|
-
const TopBar = lazy(() => import("./Topbar-
|
|
8974
|
+
const TopBar = lazy(() => import("./Topbar-FpOsNd7c.js"));
|
|
8975
8975
|
function useSidebarMenuItems(o) {
|
|
8976
8976
|
const n = o === "SINGLE_SIDE_PANEL", { t: r } = useTranslation(), a = useBuilderProp("dataBindingSupport", !1), l = useBuilderProp("askAiCallBack", null);
|
|
8977
8977
|
return useMemo(() => {
|