@chaibuilder/sdk 1.2.109 → 1.2.110
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-heJvLZrQ.cjs → CodeEditor-CLZUUbGV.cjs} +1 -1
- package/dist/{CodeEditor-lKbkdWrD.js → CodeEditor-p_MY9fHx.js} +2 -2
- package/dist/Topbar-_edNTuUL.js +163 -0
- package/dist/Topbar-sxJsvNJQ.cjs +1 -0
- package/dist/{UnsplashImages-nAe1gyu9.js → UnsplashImages-Ud9lZ6w-.js} +10 -13
- package/dist/{UnsplashImages-8r1JNyap.cjs → UnsplashImages-qlE_2pmY.cjs} +1 -1
- package/dist/{UploadImages-PygaZXFU.js → UploadImages-bHQHGRwC.js} +2 -2
- package/dist/{UploadImages-Vws49f38.cjs → UploadImages-bZWXchWP.cjs} +1 -1
- package/dist/{context-menu-YGd09SE1.js → context-menu-FPX89OKr.js} +72 -72
- package/dist/core.cjs +1 -1
- package/dist/core.js +5 -5
- package/dist/{index-0rfWW4hY.cjs → index-2TBvmH_p.cjs} +2 -2
- package/dist/{index-OhF0-tfj.js → index-ylSqM31Z.js} +237 -270
- package/dist/ui.js +2 -2
- package/package.json +1 -1
- package/dist/Topbar-lJgYu8sz.js +0 -124
- package/dist/Topbar-mnYBenY0.cjs +0 -1
|
@@ -4,7 +4,7 @@ var U = (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";
|
|
7
|
-
import {
|
|
7
|
+
import { aq as Skeleton, B as Button, aA as ContextMenu, aB as ContextMenuTrigger, aC as ContextMenuContent, aD as ContextMenuItem, N as Tooltip, O as TooltipTrigger, P as TooltipContent, C as Card, x as CardHeader, E as CardDescription, F as CardContent, L as Label, T as Textarea, y as CardFooter, D as Dialog, r as DialogTrigger, s as DialogContent, t as DialogHeader, v as DialogTitle, w as DialogDescription, u as DialogFooter, U as Popover, V as PopoverTrigger, W as PopoverContent, ar as Command, at as CommandInput, au as CommandList, av as CommandEmpty, aw as CommandGroup, ax as CommandItem, H as Tabs, J as TabsList, K as TabsTrigger, M as TabsContent, a as Switch, A as Accordion, d as AccordionItem, e as AccordionTrigger, f as AccordionContent, an as useToast, I as Input$1, R as TooltipPortal, a6 as DropdownMenu, a7 as DropdownMenuTrigger, a8 as DropdownMenuContent, S as ScrollArea, ac as DropdownMenuLabel, ad as DropdownMenuSeparator, af as DropdownMenuGroup, a9 as DropdownMenuItem, ae as DropdownMenuShortcut, i as AlertDialog, k as AlertDialogContent, l as AlertDialogHeader, n as AlertDialogTitle, j as AlertDialogTrigger, o as AlertDialogDescription, m as AlertDialogFooter, q as AlertDialogCancel, p as AlertDialogAction, aa as DropdownMenuCheckboxItem, X as HoverCard, Y as HoverCardTrigger, Z as HoverCardContent, al as Separator, g as Badge, _ as Select, a1 as SelectTrigger, a0 as SelectValue, a2 as SelectContent, a4 as SelectItem, Q as TooltipProvider, ap as Toaster } from "./context-menu-FPX89OKr.js";
|
|
8
8
|
import { has, find, filter, flatten, map, omit, isString as isString$1, includes, without, get, compact, set, endsWith, isEmpty, forIn, isObject as isObject$1, each, first, noop, merge, keys, startsWith, range, values, flattenDeep, isNull, pick, sortBy, memoize, forEach, unset, chunk, throttle, cloneDeep, reverse, debounce, flatMapDeep, capitalize, last, startCase, truncate, isArray as isArray$1, split, toLower, reject, nth, isNumber as isNumber$1, parseInt as parseInt$1, isNaN as isNaN$1, findLast, intersection, groupBy, isFunction as isFunction$1, uniq, toUpper, round } from "lodash-es";
|
|
9
9
|
import { atom as atom$1, useAtomValue as useAtomValue$1, useAtom as useAtom$1, useSetAtom as useSetAtom$1, getDefaultStore as getDefaultStore$1 } from "jotai";
|
|
10
10
|
import { g as generateUUID, a as getBreakpointValue, c as cn, G as GenIcon } from "./iconBase-Ief2hJUZ.js";
|
|
@@ -19,7 +19,7 @@ import { useFeature, FlagsProvider } from "flagged";
|
|
|
19
19
|
import { useHotkeys } from "react-hotkeys-hook";
|
|
20
20
|
import { flip } from "@floating-ui/dom";
|
|
21
21
|
import { useFloating, shift } from "@floating-ui/react-dom";
|
|
22
|
-
import { ArrowUpIcon, PlusIcon, CopyIcon, GearIcon, TrashIcon, DragHandleDots2Icon, BoxModelIcon, BoxIcon, DragHandleHorizontalIcon, ViewHorizontalIcon, BorderAllIcon, BorderTopIcon, TableIcon, DropdownMenuIcon, RadiobuttonIcon, InputIcon, ButtonIcon, CheckboxIcon, GroupIcon, SpaceBetweenVerticallyIcon, ColumnsIcon, RowsIcon, TextIcon, SketchLogoIcon, DividerHorizontalIcon, CodeIcon, CursorTextIcon, VideoIcon, Link1Icon, HeadingIcon, ImageIcon, CardStackPlusIcon, CardStackIcon, ScissorsIcon, TriangleRightIcon, EyeOpenIcon, Cross2Icon, EyeClosedIcon, WidthIcon, HeightIcon, ArrowRightIcon, ArrowDownIcon, ArrowLeftIcon, ArrowTopLeftIcon, ArrowTopRightIcon, ArrowBottomRightIcon, ArrowBottomLeftIcon, AlignLeftIcon, AlignCenterHorizontallyIcon, AlignRightIcon, StretchHorizontallyIcon, FontItalicIcon, UnderlineIcon, OverlineIcon, LetterCaseUppercaseIcon, Cross1Icon, InfoCircledIcon, MinusIcon, TriangleDownIcon, RowSpacingIcon, CrossCircledIcon, CaretDownIcon, CaretRightIcon, CheckIcon, ResetIcon, SunIcon, DotsVerticalIcon, MobileIcon, LaptopIcon, DesktopIcon, EraserIcon,
|
|
22
|
+
import { ArrowUpIcon, PlusIcon, CopyIcon, GearIcon, TrashIcon, DragHandleDots2Icon, BoxModelIcon, BoxIcon, DragHandleHorizontalIcon, ViewHorizontalIcon, BorderAllIcon, BorderTopIcon, TableIcon, DropdownMenuIcon, RadiobuttonIcon, InputIcon, ButtonIcon, CheckboxIcon, GroupIcon, SpaceBetweenVerticallyIcon, ColumnsIcon, RowsIcon, TextIcon, SketchLogoIcon, DividerHorizontalIcon, CodeIcon, CursorTextIcon, VideoIcon, Link1Icon, HeadingIcon, ImageIcon, CardStackPlusIcon, CardStackIcon, ScissorsIcon, TriangleRightIcon, EyeOpenIcon, Cross2Icon, EyeClosedIcon, WidthIcon, HeightIcon, ArrowRightIcon, ArrowDownIcon, ArrowLeftIcon, ArrowTopLeftIcon, ArrowTopRightIcon, ArrowBottomRightIcon, ArrowBottomLeftIcon, AlignLeftIcon, AlignCenterHorizontallyIcon, AlignRightIcon, StretchHorizontallyIcon, FontItalicIcon, UnderlineIcon, OverlineIcon, LetterCaseUppercaseIcon, Cross1Icon, InfoCircledIcon, MinusIcon, TriangleDownIcon, RowSpacingIcon, CrossCircledIcon, CaretDownIcon, CaretRightIcon, CheckIcon, ResetIcon, SunIcon, DotsVerticalIcon, MobileIcon, LaptopIcon, DesktopIcon, EraserIcon, ZoomInIcon, MixerHorizontalIcon, KeyboardIcon, LightningBoltIcon } from "@radix-ui/react-icons";
|
|
23
23
|
import { createEvent } from "react-event-hook";
|
|
24
24
|
import typography$1 from "@tailwindcss/typography";
|
|
25
25
|
import forms from "@tailwindcss/forms";
|
|
@@ -89,23 +89,23 @@ const hasInitialValue = (o) => "init" in o, isActuallyWritableAtom = (o) => !!o.
|
|
|
89
89
|
const o = /* @__PURE__ */ new WeakMap(), n = /* @__PURE__ */ new WeakMap(), r = /* @__PURE__ */ new Map();
|
|
90
90
|
let a, l, i;
|
|
91
91
|
(define_import_meta_env_default$2 ? "production" : void 0) !== "production" && (a = /* @__PURE__ */ new Set(), l = /* @__PURE__ */ new Set(), i = /* @__PURE__ */ new Set());
|
|
92
|
-
const c = (f) => o.get(f), d = (f,
|
|
93
|
-
(define_import_meta_env_default$2 ? "production" : void 0) !== "production" && Object.freeze(
|
|
92
|
+
const c = (f) => o.get(f), d = (f, _) => {
|
|
93
|
+
(define_import_meta_env_default$2 ? "production" : void 0) !== "production" && Object.freeze(_);
|
|
94
94
|
const C = o.get(f);
|
|
95
|
-
if (o.set(f,
|
|
96
|
-
const w = "v" in
|
|
95
|
+
if (o.set(f, _), r.has(f) || r.set(f, C), C && hasPromiseAtomValue(C)) {
|
|
96
|
+
const w = "v" in _ ? _.v instanceof Promise ? _.v : Promise.resolve(_.v) : Promise.reject(_.e);
|
|
97
97
|
cancelPromise(C.v, w);
|
|
98
98
|
}
|
|
99
|
-
}, u = (f,
|
|
99
|
+
}, u = (f, _, C) => {
|
|
100
100
|
const w = /* @__PURE__ */ new Map();
|
|
101
101
|
let I = !1;
|
|
102
102
|
C.forEach((N, D) => {
|
|
103
|
-
!N && D === f && (N =
|
|
104
|
-
}), (I ||
|
|
105
|
-
}, p = (f,
|
|
103
|
+
!N && D === f && (N = _), N ? (w.set(D, N), _.d.get(D) !== N && (I = !0)) : (define_import_meta_env_default$2 ? "production" : void 0) !== "production" && console.warn("[Bug] atom state not found");
|
|
104
|
+
}), (I || _.d.size !== w.size) && (_.d = w);
|
|
105
|
+
}, p = (f, _, C) => {
|
|
106
106
|
const w = c(f), I = {
|
|
107
107
|
d: (w == null ? void 0 : w.d) || /* @__PURE__ */ new Map(),
|
|
108
|
-
v
|
|
108
|
+
v: _
|
|
109
109
|
};
|
|
110
110
|
if (C && u(f, I, C), w && isEqualAtomValue(w, I) && w.d === I.d)
|
|
111
111
|
return w;
|
|
@@ -115,12 +115,12 @@ const hasInitialValue = (o) => "init" in o, isActuallyWritableAtom = (o) => !!o.
|
|
|
115
115
|
I.v = w.v;
|
|
116
116
|
}
|
|
117
117
|
return d(f, I), I;
|
|
118
|
-
}, m = (f,
|
|
119
|
-
if (isPromiseLike$2(
|
|
118
|
+
}, m = (f, _, C, w) => {
|
|
119
|
+
if (isPromiseLike$2(_)) {
|
|
120
120
|
let I;
|
|
121
121
|
const N = new Promise((D, V) => {
|
|
122
122
|
let M = !1;
|
|
123
|
-
|
|
123
|
+
_.then(
|
|
124
124
|
(O) => {
|
|
125
125
|
if (!M) {
|
|
126
126
|
M = !0;
|
|
@@ -150,27 +150,27 @@ const hasInitialValue = (o) => "init" in o, isActuallyWritableAtom = (o) => !!o.
|
|
|
150
150
|
), D(O));
|
|
151
151
|
};
|
|
152
152
|
});
|
|
153
|
-
return N.orig =
|
|
153
|
+
return N.orig = _, N.status = "pending", registerCancelPromise(N, (D) => {
|
|
154
154
|
D && I(D), w == null || w();
|
|
155
155
|
}), p(f, N, C);
|
|
156
156
|
}
|
|
157
|
-
return p(f,
|
|
158
|
-
}, g = (f,
|
|
157
|
+
return p(f, _, C);
|
|
158
|
+
}, g = (f, _, C) => {
|
|
159
159
|
const w = c(f), I = {
|
|
160
160
|
d: (w == null ? void 0 : w.d) || /* @__PURE__ */ new Map(),
|
|
161
|
-
e:
|
|
161
|
+
e: _
|
|
162
162
|
};
|
|
163
163
|
return C && u(f, I, C), w && isEqualAtomError(w, I) && w.d === I.d ? w : (d(f, I), I);
|
|
164
164
|
}, x = (f) => {
|
|
165
|
-
const
|
|
166
|
-
if (
|
|
165
|
+
const _ = c(f);
|
|
166
|
+
if (_ && (_.d.forEach((M, O) => {
|
|
167
167
|
O !== f && !n.has(O) && x(O);
|
|
168
|
-
}), Array.from(
|
|
168
|
+
}), Array.from(_.d).every(([M, O]) => {
|
|
169
169
|
const $ = c(M);
|
|
170
170
|
return M === f || $ === O || // TODO This is a hack, we should find a better solution.
|
|
171
171
|
$ && !hasPromiseAtomValue($) && isEqualAtomValue($, O);
|
|
172
172
|
})))
|
|
173
|
-
return
|
|
173
|
+
return _;
|
|
174
174
|
const C = /* @__PURE__ */ new Map();
|
|
175
175
|
let w = !0;
|
|
176
176
|
const I = (M) => {
|
|
@@ -211,18 +211,18 @@ const hasInitialValue = (o) => "init" in o, isActuallyWritableAtom = (o) => !!o.
|
|
|
211
211
|
w = !1;
|
|
212
212
|
}
|
|
213
213
|
}, j = (f) => returnAtomValue(x(f)), E = (f) => {
|
|
214
|
-
let
|
|
215
|
-
return
|
|
216
|
-
}, b = (f,
|
|
217
|
-
const
|
|
218
|
-
|
|
219
|
-
},
|
|
220
|
-
const
|
|
214
|
+
let _ = n.get(f);
|
|
215
|
+
return _ || (_ = R(f)), _;
|
|
216
|
+
}, b = (f, _) => !_.l.size && (!_.t.size || _.t.size === 1 && _.t.has(f)), k = (f) => {
|
|
217
|
+
const _ = n.get(f);
|
|
218
|
+
_ && b(f, _) && A(f);
|
|
219
|
+
}, v = (f) => {
|
|
220
|
+
const _ = /* @__PURE__ */ new Map(), C = /* @__PURE__ */ new WeakMap(), w = (N) => {
|
|
221
221
|
const D = n.get(N);
|
|
222
222
|
D == null || D.t.forEach((V) => {
|
|
223
|
-
V !== N && (
|
|
223
|
+
V !== N && (_.set(
|
|
224
224
|
V,
|
|
225
|
-
(
|
|
225
|
+
(_.get(V) || /* @__PURE__ */ new Set()).add(N)
|
|
226
226
|
), C.set(V, (C.get(V) || 0) + 1), w(V));
|
|
227
227
|
});
|
|
228
228
|
};
|
|
@@ -234,19 +234,19 @@ const hasInitialValue = (o) => "init" in o, isActuallyWritableAtom = (o) => !!o.
|
|
|
234
234
|
if (V !== N) {
|
|
235
235
|
let O = C.get(V);
|
|
236
236
|
if (O && C.set(V, --O), !O) {
|
|
237
|
-
let $ = !!((M =
|
|
237
|
+
let $ = !!((M = _.get(V)) != null && M.size);
|
|
238
238
|
if ($) {
|
|
239
239
|
const H = c(V), F = x(V);
|
|
240
240
|
$ = !H || !isEqualAtomValue(H, F);
|
|
241
241
|
}
|
|
242
|
-
$ ||
|
|
242
|
+
$ || _.forEach((H) => H.delete(V));
|
|
243
243
|
}
|
|
244
244
|
I(V);
|
|
245
245
|
}
|
|
246
246
|
});
|
|
247
247
|
};
|
|
248
248
|
I(f);
|
|
249
|
-
}, S = (f, ...
|
|
249
|
+
}, S = (f, ..._) => {
|
|
250
250
|
let C = !0;
|
|
251
251
|
const w = (D) => returnAtomValue(x(D)), I = (D, ...V) => {
|
|
252
252
|
let M;
|
|
@@ -254,7 +254,7 @@ const hasInitialValue = (o) => "init" in o, isActuallyWritableAtom = (o) => !!o.
|
|
|
254
254
|
if (!hasInitialValue(D))
|
|
255
255
|
throw new Error("atom not writable");
|
|
256
256
|
const O = c(D), $ = m(D, V[0]);
|
|
257
|
-
(!O || !isEqualAtomValue(O, $)) &&
|
|
257
|
+
(!O || !isEqualAtomValue(O, $)) && v(D);
|
|
258
258
|
} else
|
|
259
259
|
M = S(D, ...V);
|
|
260
260
|
if (!C) {
|
|
@@ -264,16 +264,16 @@ const hasInitialValue = (o) => "init" in o, isActuallyWritableAtom = (o) => !!o.
|
|
|
264
264
|
);
|
|
265
265
|
}
|
|
266
266
|
return M;
|
|
267
|
-
}, N = f.write(w, I, ...
|
|
267
|
+
}, N = f.write(w, I, ..._);
|
|
268
268
|
return C = !1, N;
|
|
269
|
-
}, B = (f, ...
|
|
270
|
-
const C = S(f, ...
|
|
269
|
+
}, B = (f, ..._) => {
|
|
270
|
+
const C = S(f, ..._), w = L();
|
|
271
271
|
return (define_import_meta_env_default$2 ? "production" : void 0) !== "production" && l.forEach(
|
|
272
272
|
(I) => I({ type: "write", flushed: w })
|
|
273
273
|
), C;
|
|
274
|
-
}, R = (f,
|
|
274
|
+
}, R = (f, _) => {
|
|
275
275
|
const C = {
|
|
276
|
-
t: new Set(
|
|
276
|
+
t: new Set(_ && [_]),
|
|
277
277
|
l: /* @__PURE__ */ new Set()
|
|
278
278
|
};
|
|
279
279
|
if (n.set(f, C), (define_import_meta_env_default$2 ? "production" : void 0) !== "production" && i.add(f), x(f).d.forEach((w, I) => {
|
|
@@ -285,8 +285,8 @@ const hasInitialValue = (o) => "init" in o, isActuallyWritableAtom = (o) => !!o.
|
|
|
285
285
|
}
|
|
286
286
|
return C;
|
|
287
287
|
}, A = (f) => {
|
|
288
|
-
var
|
|
289
|
-
const C = (
|
|
288
|
+
var _;
|
|
289
|
+
const C = (_ = n.get(f)) == null ? void 0 : _.u;
|
|
290
290
|
C && C(), n.delete(f), (define_import_meta_env_default$2 ? "production" : void 0) !== "production" && i.delete(f);
|
|
291
291
|
const w = c(f);
|
|
292
292
|
w ? (hasPromiseAtomValue(w) && cancelPromise(w.v), w.d.forEach((I, N) => {
|
|
@@ -295,8 +295,8 @@ const hasInitialValue = (o) => "init" in o, isActuallyWritableAtom = (o) => !!o.
|
|
|
295
295
|
D && (D.t.delete(f), b(N, D) && A(N));
|
|
296
296
|
}
|
|
297
297
|
})) : (define_import_meta_env_default$2 ? "production" : void 0) !== "production" && console.warn("[Bug] could not find atom state to unmount", f);
|
|
298
|
-
}, T = (f,
|
|
299
|
-
const w = new Set(
|
|
298
|
+
}, T = (f, _, C) => {
|
|
299
|
+
const w = new Set(_.d.keys());
|
|
300
300
|
C == null || C.forEach((I, N) => {
|
|
301
301
|
if (w.has(N)) {
|
|
302
302
|
w.delete(N);
|
|
@@ -311,8 +311,8 @@ const hasInitialValue = (o) => "init" in o, isActuallyWritableAtom = (o) => !!o.
|
|
|
311
311
|
}, L = () => {
|
|
312
312
|
let f;
|
|
313
313
|
for ((define_import_meta_env_default$2 ? "production" : void 0) !== "production" && (f = /* @__PURE__ */ new Set()); r.size; ) {
|
|
314
|
-
const
|
|
315
|
-
r.clear(),
|
|
314
|
+
const _ = Array.from(r);
|
|
315
|
+
r.clear(), _.forEach(([C, w]) => {
|
|
316
316
|
const I = c(C);
|
|
317
317
|
if (I) {
|
|
318
318
|
I.d !== (w == null ? void 0 : w.d) && T(C, I, w == null ? void 0 : w.d);
|
|
@@ -325,13 +325,13 @@ const hasInitialValue = (o) => "init" in o, isActuallyWritableAtom = (o) => !!o.
|
|
|
325
325
|
});
|
|
326
326
|
}
|
|
327
327
|
if ((define_import_meta_env_default$2 ? "production" : void 0) !== "production")
|
|
328
|
-
return a.forEach((
|
|
329
|
-
}, P = (f,
|
|
328
|
+
return a.forEach((_) => _("state")), f;
|
|
329
|
+
}, P = (f, _) => {
|
|
330
330
|
const C = E(f), w = L(), I = C.l;
|
|
331
|
-
return I.add(
|
|
331
|
+
return I.add(_), (define_import_meta_env_default$2 ? "production" : void 0) !== "production" && (a.forEach((N) => N("sub")), l.forEach(
|
|
332
332
|
(N) => N({ type: "sub", flushed: w })
|
|
333
333
|
)), () => {
|
|
334
|
-
I.delete(
|
|
334
|
+
I.delete(_), k(f), (define_import_meta_env_default$2 ? "production" : void 0) !== "production" && (a.forEach((N) => N("unsub")), l.forEach((N) => N({ type: "unsub" })));
|
|
335
335
|
};
|
|
336
336
|
};
|
|
337
337
|
return (define_import_meta_env_default$2 ? "production" : void 0) !== "production" ? {
|
|
@@ -339,7 +339,7 @@ const hasInitialValue = (o) => "init" in o, isActuallyWritableAtom = (o) => !!o.
|
|
|
339
339
|
set: B,
|
|
340
340
|
sub: P,
|
|
341
341
|
// store dev methods (these are tentative and subject to change without notice)
|
|
342
|
-
dev_subscribe_store: (f,
|
|
342
|
+
dev_subscribe_store: (f, _) => _ !== 2 ? (console.warn(
|
|
343
343
|
"The current StoreListener revision is 2. The older ones are deprecated."
|
|
344
344
|
), a.add(f), () => {
|
|
345
345
|
a.delete(f);
|
|
@@ -351,10 +351,10 @@ const hasInitialValue = (o) => "init" in o, isActuallyWritableAtom = (o) => !!o.
|
|
|
351
351
|
dev_get_mounted: (f) => n.get(f),
|
|
352
352
|
dev_restore_atoms: (f) => {
|
|
353
353
|
for (const [C, w] of f)
|
|
354
|
-
hasInitialValue(C) && (m(C, w),
|
|
355
|
-
const
|
|
354
|
+
hasInitialValue(C) && (m(C, w), v(C));
|
|
355
|
+
const _ = L();
|
|
356
356
|
l.forEach(
|
|
357
|
-
(C) => C({ type: "restore", flushed:
|
|
357
|
+
(C) => C({ type: "restore", flushed: _ })
|
|
358
358
|
);
|
|
359
359
|
}
|
|
360
360
|
} : {
|
|
@@ -395,7 +395,7 @@ function splitAtom(o, n) {
|
|
|
395
395
|
throw new Error("splitAtom: index out of bounds for read");
|
|
396
396
|
}
|
|
397
397
|
return R[T];
|
|
398
|
-
},
|
|
398
|
+
}, v = (S, B, R) => {
|
|
399
399
|
const A = S(l), T = S(o), P = a(T, A == null ? void 0 : A.arr).keyList.indexOf(E);
|
|
400
400
|
if (P < 0 || P >= T.length)
|
|
401
401
|
throw new Error("splitAtom: index out of bounds for write");
|
|
@@ -406,7 +406,7 @@ function splitAtom(o, n) {
|
|
|
406
406
|
...T.slice(P + 1)
|
|
407
407
|
]);
|
|
408
408
|
};
|
|
409
|
-
m[j] = isWritable(o) ? atom(k,
|
|
409
|
+
m[j] = isWritable(o) ? atom(k, v) : atom(k);
|
|
410
410
|
}), p && p.keyList.length === g.length && p.keyList.every((x, j) => x === g[j]) ? u = p : u = { arr: c, atomList: m, keyList: g }, r.set(c, u), u;
|
|
411
411
|
}, l = atom((c) => {
|
|
412
412
|
const d = c(l), u = c(o);
|
|
@@ -1196,12 +1196,12 @@ const useBlocksStoreManager = () => {
|
|
|
1196
1196
|
} = useBlocksStoreManager();
|
|
1197
1197
|
return {
|
|
1198
1198
|
moveBlocks: (E, b, k) => {
|
|
1199
|
-
const
|
|
1199
|
+
const v = map(E, (B) => {
|
|
1200
1200
|
const A = n.find((P) => P._id === B)._parent || null, L = n.filter((P) => A ? P._parent === A : !P._parent).map((P) => P._id).indexOf(B);
|
|
1201
1201
|
return { _id: B, oldParent: A, oldPosition: L };
|
|
1202
|
-
}), S =
|
|
1202
|
+
}), S = v.find(({ _id: B }) => B === E[0]);
|
|
1203
1203
|
S && S.oldParent === b && S.oldPosition === k || (i(E, b, k), o({
|
|
1204
|
-
undo: () => each(
|
|
1204
|
+
undo: () => each(v, ({ _id: B, oldParent: R, oldPosition: A }) => {
|
|
1205
1205
|
i([B], R, A);
|
|
1206
1206
|
}),
|
|
1207
1207
|
redo: () => i(E, b, k)
|
|
@@ -1215,25 +1215,25 @@ const useBlocksStoreManager = () => {
|
|
|
1215
1215
|
},
|
|
1216
1216
|
removeBlocks: (E) => {
|
|
1217
1217
|
var S;
|
|
1218
|
-
const b = (S = first(E)) == null ? void 0 : S._parent,
|
|
1218
|
+
const b = (S = first(E)) == null ? void 0 : S._parent, v = n.filter((B) => b ? B._parent === b : !B._parent).indexOf(first(E));
|
|
1219
1219
|
l(map(E, "_id")), o({
|
|
1220
|
-
undo: () => a(E, b,
|
|
1220
|
+
undo: () => a(E, b, v),
|
|
1221
1221
|
redo: () => l(map(E, "_id"))
|
|
1222
1222
|
});
|
|
1223
1223
|
},
|
|
1224
1224
|
updateBlocks: (E, b, k) => {
|
|
1225
|
-
let
|
|
1225
|
+
let v = [];
|
|
1226
1226
|
if (k)
|
|
1227
|
-
|
|
1227
|
+
v = map(E, (S) => ({ _id: S, ...k }));
|
|
1228
1228
|
else {
|
|
1229
1229
|
const S = keys(b);
|
|
1230
|
-
|
|
1230
|
+
v = map(E, (B) => {
|
|
1231
1231
|
const R = n.find((T) => T._id === B), A = { _id: B };
|
|
1232
1232
|
return each(S, (T) => A[T] = R[T]), A;
|
|
1233
1233
|
});
|
|
1234
1234
|
}
|
|
1235
1235
|
c(map(E, (S) => ({ _id: S, ...b }))), o({
|
|
1236
|
-
undo: () => c(
|
|
1236
|
+
undo: () => c(v),
|
|
1237
1237
|
redo: () => c(map(E, (S) => ({ _id: S, ...b })))
|
|
1238
1238
|
});
|
|
1239
1239
|
},
|
|
@@ -1249,8 +1249,8 @@ const useBlocksStoreManager = () => {
|
|
|
1249
1249
|
updateMultipleBlocksProps: (E) => {
|
|
1250
1250
|
let b = [];
|
|
1251
1251
|
b = map(E, (k) => {
|
|
1252
|
-
const
|
|
1253
|
-
return each(
|
|
1252
|
+
const v = keys(k), S = n.find((R) => R._id === k._id), B = {};
|
|
1253
|
+
return each(v, (R) => B[R] = S[R]), B;
|
|
1254
1254
|
}), c(E), o({
|
|
1255
1255
|
undo: () => c(b),
|
|
1256
1256
|
redo: () => c(E)
|
|
@@ -1281,16 +1281,16 @@ const useBlocksStoreManager = () => {
|
|
|
1281
1281
|
return a(k, c, d);
|
|
1282
1282
|
}
|
|
1283
1283
|
const u = generateUUID(), p = getBlockDefaultProps(i.props), m = [];
|
|
1284
|
-
forIn(p, (k,
|
|
1284
|
+
forIn(p, (k, v) => {
|
|
1285
1285
|
if (startsWith(k, SLOT_KEY)) {
|
|
1286
1286
|
const S = k.replace(SLOT_KEY, "");
|
|
1287
1287
|
m.push({
|
|
1288
1288
|
_id: S,
|
|
1289
1289
|
_type: "Slot",
|
|
1290
1290
|
_parent: u,
|
|
1291
|
-
_name: i.props[
|
|
1292
|
-
_styles: i.props[
|
|
1293
|
-
_emptyStyles: i.props[
|
|
1291
|
+
_name: i.props[v].name,
|
|
1292
|
+
_styles: i.props[v].styles,
|
|
1293
|
+
_emptyStyles: i.props[v].emptyStyles
|
|
1294
1294
|
});
|
|
1295
1295
|
}
|
|
1296
1296
|
});
|
|
@@ -3077,13 +3077,13 @@ const useDnd = () => {
|
|
|
3077
3077
|
var R;
|
|
3078
3078
|
const j = dropTarget, b = getOrientation(j) === "vertical" ? x.clientY + ((R = iframeDocument == null ? void 0 : iframeDocument.defaultView) == null ? void 0 : R.scrollY) : x.clientX;
|
|
3079
3079
|
dropIndex = calculateDropIndex(b, possiblePositions);
|
|
3080
|
-
const k = d,
|
|
3081
|
-
if ((k == null ? void 0 : k._id) ===
|
|
3080
|
+
const k = d, v = j.getAttribute("data-block-id"), S = dropTarget.getAttribute("data-dnd-dragged") !== "yes";
|
|
3081
|
+
if ((k == null ? void 0 : k._id) === v || !S) {
|
|
3082
3082
|
g();
|
|
3083
3083
|
return;
|
|
3084
3084
|
}
|
|
3085
3085
|
if (!has(k, "_id")) {
|
|
3086
|
-
a(k,
|
|
3086
|
+
a(k, v === "canvas" ? null : v, dropIndex), setTimeout(g, 300);
|
|
3087
3087
|
return;
|
|
3088
3088
|
}
|
|
3089
3089
|
let B = j.getAttribute("data-block-id");
|
|
@@ -3314,14 +3314,14 @@ const useHandleCanvasDblClick = () => {
|
|
|
3314
3314
|
}, [r, c]);
|
|
3315
3315
|
const x = get(o, "headingFont", "DM Sans"), j = get(o, "bodyFont", "DM Sans");
|
|
3316
3316
|
return useEffect(() => {
|
|
3317
|
-
const E = get(o, "primaryColor", "#000"), b = get(o, "secondaryColor", "#FFF"), k = get(o, "bodyBgLightColor", "#fff"),
|
|
3317
|
+
const E = get(o, "primaryColor", "#000"), b = get(o, "secondaryColor", "#FFF"), k = get(o, "bodyBgLightColor", "#fff"), v = get(o, "bodyBgDarkColor", "#000"), S = get(o, "bodyTextDarkColor", "#000"), B = get(o, "bodyTextLightColor", "#fff"), R = s({
|
|
3318
3318
|
colors: [E, b],
|
|
3319
3319
|
names: ["primary", "secondary"]
|
|
3320
3320
|
});
|
|
3321
3321
|
set(R, "primary.DEFAULT", E), set(R, "secondary.DEFAULT", b);
|
|
3322
3322
|
const A = {
|
|
3323
3323
|
"bg-light": k,
|
|
3324
|
-
"bg-dark":
|
|
3324
|
+
"bg-dark": v,
|
|
3325
3325
|
"text-dark": S,
|
|
3326
3326
|
"text-light": B
|
|
3327
3327
|
}, T = get(o, "roundedCorners", "0");
|
|
@@ -3505,8 +3505,8 @@ function applyLanguage(o, n, r) {
|
|
|
3505
3505
|
}
|
|
3506
3506
|
function BlocksRendererStatic({ blocks: o, allBlocks: n }) {
|
|
3507
3507
|
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: m } = useGlobalBlocksStore(), g = useCallback((b) => getStyleAttrs(b, d), [d]), [x] = useChaiExternalData(), [j] = useAtom$1(inlineEditingActiveAtom), E = useCallback(
|
|
3508
|
-
(b) => b.reduce((k,
|
|
3509
|
-
const S = get(u,
|
|
3508
|
+
(b) => b.reduce((k, v) => {
|
|
3509
|
+
const S = get(u, v, {});
|
|
3510
3510
|
return { ...k, ...S };
|
|
3511
3511
|
}, {}),
|
|
3512
3512
|
[u]
|
|
@@ -3515,10 +3515,10 @@ function BlocksRendererStatic({ blocks: o, allBlocks: n }) {
|
|
|
3515
3515
|
o.map((b, k) => {
|
|
3516
3516
|
if (j === b._id || p.includes(b._id))
|
|
3517
3517
|
return null;
|
|
3518
|
-
const
|
|
3519
|
-
if (
|
|
3518
|
+
const v = {}, S = filter(n, { _parent: b._id });
|
|
3519
|
+
if (v.children = S.length > 0 ? /* @__PURE__ */ jsxRuntimeExports.jsx(BlocksRendererStatic, { allBlocks: n, blocks: S }) : null, b._type === "GlobalBlock") {
|
|
3520
3520
|
const C = m(b);
|
|
3521
|
-
|
|
3521
|
+
v.children = /* @__PURE__ */ jsxRuntimeExports.jsx(RenderGlobalBlock, { blocks: filter(C, (w) => !w._parent), allBlocks: C });
|
|
3522
3522
|
}
|
|
3523
3523
|
const B = getBlockComponent(b._type), R = get(B, "server", !1), A = R ? RSCBlock : get(B, "builderComponent", get(B, "component", null));
|
|
3524
3524
|
if (isNull(A))
|
|
@@ -3526,7 +3526,7 @@ function BlocksRendererStatic({ blocks: o, allBlocks: n }) {
|
|
|
3526
3526
|
const T = has(B, "getBlockStateFrom") ? B == null ? void 0 : B.getBlockStateFrom(b, n) : [], L = E(T), P = g(b);
|
|
3527
3527
|
if (get(P, "__isHidden", !1) && !includes(a, b._id))
|
|
3528
3528
|
return null;
|
|
3529
|
-
const f = i && isDescendant(i._id, b._id, n),
|
|
3529
|
+
const f = i && isDescendant(i._id, b._id, n), _ = {
|
|
3530
3530
|
...includes(a, b._id) ? { "force-show": "" } : {},
|
|
3531
3531
|
"data-block-id": b._id,
|
|
3532
3532
|
"data-block-type": b._type,
|
|
@@ -3540,12 +3540,12 @@ function BlocksRendererStatic({ blocks: o, allBlocks: n }) {
|
|
|
3540
3540
|
...c === b._id && !f ? { "data-drop": "yes" } : {},
|
|
3541
3541
|
...includes(l, b._id) ? { "data-cut-block": "yes" } : {}
|
|
3542
3542
|
};
|
|
3543
|
-
return R ? /* @__PURE__ */ jsxRuntimeExports.jsx(RSCBlock, { block: b, blockProps:
|
|
3544
|
-
blockProps:
|
|
3543
|
+
return R ? /* @__PURE__ */ jsxRuntimeExports.jsx(RSCBlock, { block: b, blockProps: _ }) : /* @__PURE__ */ jsxRuntimeExports.jsx(Suspense, { children: React__default.createElement(A, {
|
|
3544
|
+
blockProps: _,
|
|
3545
3545
|
index: k,
|
|
3546
3546
|
...applyBindings(applyLanguage(b, r, B), x),
|
|
3547
3547
|
...omit(P, ["__isHidden"]),
|
|
3548
|
-
...
|
|
3548
|
+
...v,
|
|
3549
3549
|
inBuilder: !0,
|
|
3550
3550
|
blockState: L
|
|
3551
3551
|
}) });
|
|
@@ -3584,20 +3584,24 @@ const useAllDataProviders = () => useMemo(() => getChaiDataProviders(), []), Blo
|
|
|
3584
3584
|
}
|
|
3585
3585
|
);
|
|
3586
3586
|
}, ResizableCanvasWrapper = ({ children: o, onMount: n, onResize: r }) => {
|
|
3587
|
-
const a = useRef(null),
|
|
3587
|
+
const [, a] = useSelectedBlockIds(), [, l] = useSelectedStylingBlocks(), i = useRef(null), c = useDebouncedCallback(
|
|
3588
3588
|
() => {
|
|
3589
|
-
const { clientWidth:
|
|
3590
|
-
r(
|
|
3589
|
+
const { clientWidth: u } = i.current;
|
|
3590
|
+
r(u);
|
|
3591
3591
|
},
|
|
3592
|
-
[
|
|
3592
|
+
[i.current],
|
|
3593
3593
|
100
|
|
3594
3594
|
);
|
|
3595
|
-
|
|
3596
|
-
const { clientWidth:
|
|
3597
|
-
n(
|
|
3598
|
-
}, [])
|
|
3595
|
+
useResizeObserver(i.current, c, i.current !== null), useEffect(() => {
|
|
3596
|
+
const { clientWidth: u } = i.current;
|
|
3597
|
+
n(u);
|
|
3598
|
+
}, []);
|
|
3599
|
+
const d = () => {
|
|
3600
|
+
a([]), l([]);
|
|
3601
|
+
};
|
|
3602
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { id: "main-content", onClick: d, className: "h-full w-full p-8 pb-0", ref: i, children: o });
|
|
3599
3603
|
}, getElementByStyleId = (o, n) => o.querySelector(`[data-style-id="${n}"]`), StaticCanvas = () => {
|
|
3600
|
-
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), [m, g] = useState([]), [, x] = useState([]), [, j] = useAtom$1(canvasIframeAtom), [E, b] = useSelectedStylingBlocks(), k = useBuilderProp("loading", !1),
|
|
3604
|
+
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), [m, g] = useState([]), [, x] = useState([]), [, j] = useAtom$1(canvasIframeAtom), [E, b] = useSelectedStylingBlocks(), k = useBuilderProp("loading", !1), v = useBuilderProp("htmlDir", "ltr"), S = (A) => {
|
|
3601
3605
|
u((T) => ({ ...T, width: A }));
|
|
3602
3606
|
};
|
|
3603
3607
|
useEffect(() => {
|
|
@@ -3628,11 +3632,11 @@ const useAllDataProviders = () => useMemo(() => getChaiDataProviders(), []), Blo
|
|
|
3628
3632
|
}, [E]);
|
|
3629
3633
|
const R = useMemo(() => {
|
|
3630
3634
|
let A = IframeInitialContent;
|
|
3631
|
-
return A = A.replace("__HTML_DIR__",
|
|
3635
|
+
return A = A.replace("__HTML_DIR__", v), o === "offline" && (A = A.replace(
|
|
3632
3636
|
"https://old.chaibuilder.com/offline/tailwind.cdn.js",
|
|
3633
3637
|
"/offline/tailwind.cdn.js"
|
|
3634
3638
|
), A = A.replace("https://unpkg.com/aos@next/dist/aos.css", "/offline/aos.css"), A = A.replace("https://unpkg.com/aos@next/dist/aos.js", "/offline/aos.js")), A;
|
|
3635
|
-
}, [o,
|
|
3639
|
+
}, [o, v]);
|
|
3636
3640
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(ResizableCanvasWrapper, { onMount: S, onResize: S, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
3637
3641
|
"div",
|
|
3638
3642
|
{
|
|
@@ -3773,7 +3777,7 @@ const useAllDataProviders = () => useMemo(() => getChaiDataProviders(), []), Blo
|
|
|
3773
3777
|
l !== o.length - 1 && /* @__PURE__ */ jsxRuntimeExports.jsx(ChevronRight, { className: "rtl:rotate-180", size: 16 })
|
|
3774
3778
|
] }, l))
|
|
3775
3779
|
] }) });
|
|
3776
|
-
}, CodeEditor$1 = React__default.lazy(() => import("./CodeEditor-
|
|
3780
|
+
}, CodeEditor$1 = React__default.lazy(() => import("./CodeEditor-p_MY9fHx.js")), CanvasArea = () => {
|
|
3777
3781
|
const [o] = useCodeEditor(), n = useBuilderProp("onError", noop);
|
|
3778
3782
|
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: [
|
|
3779
3783
|
/* @__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, {}) }) }),
|
|
@@ -3861,7 +3865,7 @@ const useAllDataProviders = () => useMemo(() => getChaiDataProviders(), []), Blo
|
|
|
3861
3865
|
bodyBgLightColor: b,
|
|
3862
3866
|
roundedCorners: k
|
|
3863
3867
|
} = r;
|
|
3864
|
-
let
|
|
3868
|
+
let v = {
|
|
3865
3869
|
headingFont: y({
|
|
3866
3870
|
title: c("theme_config.heading_font"),
|
|
3867
3871
|
default: p,
|
|
@@ -3879,8 +3883,8 @@ const useAllDataProviders = () => useMemo(() => getChaiDataProviders(), []), Blo
|
|
|
3879
3883
|
primaryColor: h({ title: c("theme_config.primary"), default: m }),
|
|
3880
3884
|
secondaryColor: h({ title: c("theme_config.secondary"), default: E })
|
|
3881
3885
|
};
|
|
3882
|
-
l || (
|
|
3883
|
-
...
|
|
3886
|
+
l || (v = {
|
|
3887
|
+
...v,
|
|
3884
3888
|
bodyBgLightColor: h({
|
|
3885
3889
|
title: c("theme_config.background"),
|
|
3886
3890
|
default: b
|
|
@@ -3902,8 +3906,8 @@ const useAllDataProviders = () => useMemo(() => getChaiDataProviders(), []), Blo
|
|
|
3902
3906
|
type: "object",
|
|
3903
3907
|
properties: {}
|
|
3904
3908
|
}, B = {};
|
|
3905
|
-
return Object.keys(
|
|
3906
|
-
const A =
|
|
3909
|
+
return Object.keys(v).forEach((R) => {
|
|
3910
|
+
const A = v[R];
|
|
3907
3911
|
return S.properties || (S.properties = {}), S.properties[R] = A.schema, B[R] = A.uiSchema, !0;
|
|
3908
3912
|
}), /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: cn("flex h-full w-full select-none flex-col", n), children: [
|
|
3909
3913
|
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,
|
|
@@ -4100,7 +4104,7 @@ function BiExpandVertical(o) {
|
|
|
4100
4104
|
const Node = memo(({ node: o, style: n, dragHandle: r }) => {
|
|
4101
4105
|
const a = useBuilderProp("outlineMenuItems", []), { t: l } = useTranslation(), [i, , c] = useHiddenBlockIds(), [d] = useAtom$1(canvasIframeAtom);
|
|
4102
4106
|
let u = null;
|
|
4103
|
-
const p = o.children.length > 0, { highlightBlock: m, clearHighlight: g } = useBlockHighlight(), { id: x, data: j, isSelected: E, willReceiveDrop: b, isDragging: k, isEditing:
|
|
4107
|
+
const p = o.children.length > 0, { highlightBlock: m, clearHighlight: g } = useBlockHighlight(), { id: x, data: j, isSelected: E, willReceiveDrop: b, isDragging: k, isEditing: v, handleClick: S } = o, B = (f) => {
|
|
4104
4108
|
f.stopPropagation(), !i.includes(x) && o.toggle();
|
|
4105
4109
|
}, R = (f) => {
|
|
4106
4110
|
f.isInternal && (u = f.isOpen, f.isOpen && f.close());
|
|
@@ -4116,16 +4120,16 @@ const Node = memo(({ node: o, style: n, dragHandle: r }) => {
|
|
|
4116
4120
|
return () => clearTimeout(f);
|
|
4117
4121
|
}, [b, o, k]);
|
|
4118
4122
|
const L = useMemo(() => {
|
|
4119
|
-
const f = Object.keys(j),
|
|
4123
|
+
const f = Object.keys(j), _ = [];
|
|
4120
4124
|
for (let C = 0; C < f.length; C++)
|
|
4121
4125
|
if (f[C].endsWith("_attrs")) {
|
|
4122
4126
|
const w = j[f[C]], I = Object.keys(w).join("|");
|
|
4123
|
-
I.match(/x-data/) &&
|
|
4127
|
+
I.match(/x-data/) && _.push("data"), I.match(/x-on/) && _.push("event"), I.match(/x-show|x-if/) && _.push("show");
|
|
4124
4128
|
}
|
|
4125
|
-
return
|
|
4126
|
-
}, [j]), P = (f,
|
|
4129
|
+
return _;
|
|
4130
|
+
}, [j]), P = (f, _) => {
|
|
4127
4131
|
const C = d.contentDocument || d.contentWindow.document, w = C.querySelector(`[data-block-id=${f}]`);
|
|
4128
|
-
w && w.setAttribute("data-drop",
|
|
4132
|
+
w && w.setAttribute("data-drop", _);
|
|
4129
4133
|
const I = w.getBoundingClientRect(), N = d.getBoundingClientRect();
|
|
4130
4134
|
I.top >= N.top && I.left >= N.left && I.bottom <= N.bottom && I.right <= N.right || (C.documentElement.scrollTop = w.offsetTop - N.top);
|
|
4131
4135
|
};
|
|
@@ -4177,7 +4181,7 @@ const Node = memo(({ node: o, style: n, dragHandle: r }) => {
|
|
|
4177
4181
|
),
|
|
4178
4182
|
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center", children: [
|
|
4179
4183
|
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "-mt-0.5 h-3 w-3", children: /* @__PURE__ */ jsxRuntimeExports.jsx(TypeIcon, { type: j == null ? void 0 : j._type }) }),
|
|
4180
|
-
|
|
4184
|
+
v ? /* @__PURE__ */ jsxRuntimeExports.jsx(Input, { node: o }) : /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
4181
4185
|
"div",
|
|
4182
4186
|
{
|
|
4183
4187
|
className: "ml-2 flex items-center gap-x-1 truncate text-[11px]",
|
|
@@ -4418,7 +4422,7 @@ const Node = memo(({ node: o, style: n, dragHandle: r }) => {
|
|
|
4418
4422
|
return o;
|
|
4419
4423
|
const n = /<video[^>]+src=['"]([^'">]+)['"]/, r = /<iframe[^>]+src=['"]([^'">]+)['"]/, a = o.match(n), l = o.match(r), i = a ? a[1] : l ? l[1] : null, c = /(?:https?:\/\/)?(?:www\.)?(?:youtube\.com\/(?:[^\/\n\s]+\/\S+\/|(?:v|e(?:mbed)?)\/|\S*?[?&]v=)|youtu\.be\/)([a-zA-Z0-9_-]{11})/, d = /(?:https?:\/\/)?(?:www\.)?player.vimeo\.com/;
|
|
4420
4424
|
return i && (c.test(i) || d.test(i)) ? i : o;
|
|
4421
|
-
},
|
|
4425
|
+
}, NAME_ATTRIBUTES = ["chai-name", "data-chai-name"], ATTRIBUTE_MAP = {
|
|
4422
4426
|
img: { alt: "alt", width: "width", height: "height", src: "image" },
|
|
4423
4427
|
video: {
|
|
4424
4428
|
src: "url",
|
|
@@ -4459,7 +4463,7 @@ const Node = memo(({ node: o, style: n, dragHandle: r }) => {
|
|
|
4459
4463
|
return {};
|
|
4460
4464
|
const n = {}, r = ATTRIBUTE_MAP[o.tagName] || {}, a = o.attributes;
|
|
4461
4465
|
return forEach(a, ({ key: l, value: i }) => {
|
|
4462
|
-
if (l
|
|
4466
|
+
if (!includes(NAME_ATTRIBUTES, l))
|
|
4463
4467
|
if (r[l]) {
|
|
4464
4468
|
if (o.tagName === "img" && l === "src" && !i.startsWith("http")) {
|
|
4465
4469
|
const c = find(o.attributes, { key: "width" }), d = find(o.attributes, { key: "height" });
|
|
@@ -4582,7 +4586,7 @@ const Node = memo(({ node: o, style: n, dragHandle: r }) => {
|
|
|
4582
4586
|
...getAttrs(r),
|
|
4583
4587
|
...getStyles(r)
|
|
4584
4588
|
}, r.attributes) {
|
|
4585
|
-
const k = r.attributes.find((
|
|
4589
|
+
const k = r.attributes.find((v) => includes(NAME_ATTRIBUTES, v.key));
|
|
4586
4590
|
k && (a._name = k.value);
|
|
4587
4591
|
}
|
|
4588
4592
|
if (i)
|
|
@@ -4600,14 +4604,14 @@ const Node = memo(({ node: o, style: n, dragHandle: r }) => {
|
|
|
4600
4604
|
];
|
|
4601
4605
|
a = {
|
|
4602
4606
|
...a,
|
|
4603
|
-
href: ((u = l.find((
|
|
4604
|
-
hrefType: ((p = l.find((
|
|
4605
|
-
autoplay: ((m = l.find((
|
|
4606
|
-
maxWidth: ((x = (g = l.find((
|
|
4607
|
-
backdropColor: ((j = l.find((
|
|
4608
|
-
galleryName: ((E = l.find((
|
|
4609
|
-
}, forEach(k, (
|
|
4610
|
-
has(a, `styles_attrs.${
|
|
4607
|
+
href: ((u = l.find((v) => v.key === "href")) == null ? void 0 : u.value) || "",
|
|
4608
|
+
hrefType: ((p = l.find((v) => v.key === "data-vbtype")) == null ? void 0 : p.value) || "video",
|
|
4609
|
+
autoplay: ((m = l.find((v) => v.key === "data-autoplay")) == null ? void 0 : m.value) === "true",
|
|
4610
|
+
maxWidth: ((x = (g = l.find((v) => v.key === "data-maxwidth")) == null ? void 0 : g.value) == null ? void 0 : x.replace("px", "")) || "",
|
|
4611
|
+
backdropColor: ((j = l.find((v) => v.key === "data-overlay")) == null ? void 0 : j.value) || "",
|
|
4612
|
+
galleryName: ((E = l.find((v) => v.key === "data-gall")) == null ? void 0 : E.value) || ""
|
|
4613
|
+
}, forEach(k, (v) => {
|
|
4614
|
+
has(a, `styles_attrs.${v}`) && delete a.styles_attrs[v];
|
|
4611
4615
|
});
|
|
4612
4616
|
}
|
|
4613
4617
|
if (a._type === "Input") {
|
|
@@ -4617,7 +4621,7 @@ const Node = memo(({ node: o, style: n, dragHandle: r }) => {
|
|
|
4617
4621
|
const k = stringify([r]);
|
|
4618
4622
|
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];
|
|
4619
4623
|
} else if (r.tagName === "svg") {
|
|
4620
|
-
const k = find(r.attributes, { key: "height" }),
|
|
4624
|
+
const k = find(r.attributes, { key: "height" }), v = find(r.attributes, { key: "width" }), S = get(k, "value") ? `[${get(k, "value")}px]` : "24px", B = get(v, "value") ? `[${get(v, "value")}px]` : "24px", R = get(find(r.attributes, { key: "class" }), "value", "w-full h-full");
|
|
4621
4625
|
return a.styles = `${STYLES_KEY}, ${cn(`w-${B} h-${S}`, R)}`.trim(), r.attributes = filter(r.attributes, (A) => !includes(["style", "width", "height", "class"], A.key)), a.icon = stringify([r]), [a];
|
|
4622
4626
|
} else if (r.tagName == "option" && n && ((b = n.block) == null ? void 0 : b._type) === "Select")
|
|
4623
4627
|
return n.block.options.push({
|
|
@@ -4685,7 +4689,7 @@ function ExpandableObject(o) {
|
|
|
4685
4689
|
useEffect(() => {
|
|
4686
4690
|
g.current ? E(p(d, r, n)) : g.current = !0;
|
|
4687
4691
|
}, [p]);
|
|
4688
|
-
const b = x ? u.collapseIcon : u.expandIcon, k = x ? "collapse JSON" : "expand JSON",
|
|
4692
|
+
const b = x ? u.collapseIcon : u.expandIcon, k = x ? "collapse JSON" : "expand JSON", v = useComponentId(), S = d + 1, B = a.length - 1, R = (A) => {
|
|
4689
4693
|
A.key === " " && (A.preventDefault(), j());
|
|
4690
4694
|
};
|
|
4691
4695
|
return /* @__PURE__ */ createElement("div", {
|
|
@@ -4699,7 +4703,7 @@ function ExpandableObject(o) {
|
|
|
4699
4703
|
tabIndex: 0,
|
|
4700
4704
|
"aria-label": k,
|
|
4701
4705
|
"aria-expanded": x,
|
|
4702
|
-
"aria-controls": x ?
|
|
4706
|
+
"aria-controls": x ? v : void 0
|
|
4703
4707
|
}), n && (m ? /* @__PURE__ */ createElement("span", {
|
|
4704
4708
|
className: u.clickableLabel,
|
|
4705
4709
|
onClick: j,
|
|
@@ -4711,7 +4715,7 @@ function ExpandableObject(o) {
|
|
|
4711
4715
|
}, n, ":")), /* @__PURE__ */ createElement("span", {
|
|
4712
4716
|
className: u.punctuation
|
|
4713
4717
|
}, i), x ? /* @__PURE__ */ createElement("div", {
|
|
4714
|
-
id:
|
|
4718
|
+
id: v
|
|
4715
4719
|
}, a.map((A, T) => /* @__PURE__ */ createElement(DataRender, {
|
|
4716
4720
|
key: A[0] || T,
|
|
4717
4721
|
field: A[0],
|
|
@@ -5198,7 +5202,7 @@ const ViewData = ({ data: o, fullView: n }) => {
|
|
|
5198
5202
|
}
|
|
5199
5203
|
)
|
|
5200
5204
|
] });
|
|
5201
|
-
}, UnsplashImages = React__default.lazy(() => import("./UnsplashImages-
|
|
5205
|
+
}, UnsplashImages = React__default.lazy(() => import("./UnsplashImages-Ud9lZ6w-.js")), UploadImages = React__default.lazy(() => import("./UploadImages-bHQHGRwC.js")), ImagesPanel = ({
|
|
5202
5206
|
isModalView: o = !1,
|
|
5203
5207
|
onSelect: n = () => {
|
|
5204
5208
|
}
|
|
@@ -5465,28 +5469,28 @@ const ImagePickerModal$1 = ImagePickerModal, ImagePickerField = ({ value: o, onC
|
|
|
5465
5469
|
}), a;
|
|
5466
5470
|
};
|
|
5467
5471
|
function BlockSettings() {
|
|
5468
|
-
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,
|
|
5472
|
+
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, v) => {
|
|
5469
5473
|
if (k && (c == null ? void 0 : c._id) === n._id) {
|
|
5470
5474
|
const S = k.replace("root.", "");
|
|
5471
|
-
a([n._id], { [S]: get(b, S) },
|
|
5475
|
+
a([n._id], { [S]: get(b, S) }, v);
|
|
5472
5476
|
}
|
|
5473
5477
|
}, m = useCallback(
|
|
5474
|
-
debounce(({ formData: b }, k,
|
|
5475
|
-
p({ formData: b }, k,
|
|
5478
|
+
debounce(({ formData: b }, k, v) => {
|
|
5479
|
+
p({ formData: b }, k, v), d(b);
|
|
5476
5480
|
}, 1500),
|
|
5477
5481
|
[n == null ? void 0 : n._id, o]
|
|
5478
5482
|
), g = ({ formData: b }, k) => {
|
|
5479
5483
|
if (k) {
|
|
5480
|
-
const
|
|
5484
|
+
const v = k.replace("root.", "");
|
|
5481
5485
|
r(
|
|
5482
5486
|
[n._id],
|
|
5483
|
-
convertDotNotationToObject(
|
|
5484
|
-
), m({ formData: b }, k, { [
|
|
5487
|
+
convertDotNotationToObject(v, get(b, v.split(".")))
|
|
5488
|
+
), m({ formData: b }, k, { [v]: get(c, v) });
|
|
5485
5489
|
}
|
|
5486
5490
|
}, x = keys(get(i, "_bindings", {})), j = useMemo(() => {
|
|
5487
5491
|
const b = cloneDeep(get(l, "props", {}));
|
|
5488
|
-
return each(b, (k,
|
|
5489
|
-
get(k, "hidden", !1) && delete b[
|
|
5492
|
+
return each(b, (k, v) => {
|
|
5493
|
+
get(k, "hidden", !1) && delete b[v];
|
|
5490
5494
|
}), u && each(x, (k) => delete b[k]), b;
|
|
5491
5495
|
}, [l, x, u]), E = get(l, "server", !1);
|
|
5492
5496
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "overflow-x-hidden px-px", children: [
|
|
@@ -5578,12 +5582,12 @@ const askAiProcessingAtom = atom$1(!1), useAskAi = () => {
|
|
|
5578
5582
|
try {
|
|
5579
5583
|
const b = g === "content" ? cloneDeep(getBlockWithChildren(x, d)) : [cloneDeep(d.find((R) => R._id === x))];
|
|
5580
5584
|
set(b, "0._parent", null);
|
|
5581
|
-
const k = u === p ? "" : u,
|
|
5585
|
+
const k = u === p ? "" : u, v = await l(g, promptWithLanguage(j, m, g), b, k), { blocks: S, error: B } = v;
|
|
5582
5586
|
if (B) {
|
|
5583
5587
|
a(B);
|
|
5584
5588
|
return;
|
|
5585
5589
|
}
|
|
5586
|
-
g === "styles" ? c(S) : i(S), E && E(
|
|
5590
|
+
g === "styles" ? c(S) : i(S), E && E(v);
|
|
5587
5591
|
} catch (b) {
|
|
5588
5592
|
a(b);
|
|
5589
5593
|
} finally {
|
|
@@ -5746,17 +5750,17 @@ function ManualClasses() {
|
|
|
5746
5750
|
const L = T.trim().toLowerCase(), P = L.match(/.+:/g);
|
|
5747
5751
|
let f = [];
|
|
5748
5752
|
if (P && P.length > 0) {
|
|
5749
|
-
const [
|
|
5753
|
+
const [_] = P, C = L.replace(_, "");
|
|
5750
5754
|
f = fuse.search(C).map((I) => ({
|
|
5751
5755
|
...I,
|
|
5752
|
-
item: { ...I.item, name:
|
|
5756
|
+
item: { ...I.item, name: _ + I.item.name }
|
|
5753
5757
|
}));
|
|
5754
5758
|
} else
|
|
5755
5759
|
f = fuse.search(L);
|
|
5756
5760
|
return E(map(f, "item"));
|
|
5757
5761
|
}, k = () => {
|
|
5758
5762
|
E([]);
|
|
5759
|
-
},
|
|
5763
|
+
}, v = (T) => T.name, S = (T) => /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "rounded-md p-1", children: T.name }), B = {
|
|
5760
5764
|
autoComplete: "off",
|
|
5761
5765
|
autoCorrect: "off",
|
|
5762
5766
|
autoCapitalize: "off",
|
|
@@ -5810,7 +5814,7 @@ function ManualClasses() {
|
|
|
5810
5814
|
suggestions: j,
|
|
5811
5815
|
onSuggestionsFetchRequested: b,
|
|
5812
5816
|
onSuggestionsClearRequested: k,
|
|
5813
|
-
getSuggestionValue:
|
|
5817
|
+
getSuggestionValue: v,
|
|
5814
5818
|
renderSuggestion: S,
|
|
5815
5819
|
inputProps: B,
|
|
5816
5820
|
containerProps: {
|
|
@@ -6501,37 +6505,37 @@ const RangeChoices = ({ property: o, onChange: n }) => {
|
|
|
6501
6505
|
},
|
|
6502
6506
|
a
|
|
6503
6507
|
)) }), THROTTLE_TIME = 50, AdvanceChoices = (o) => {
|
|
6504
|
-
const [n, r] = useState(!1), [a, l] = useState(""), { currentClass: i, onChange: c, classPrefix: d, cssProperty: u, units: p, negative: m } = o, [g, x] = useState(u != null && u.toLowerCase().includes("width") ? "%" : p[0]), [j, E] = useState(!1), [b, k] = useState(""), [
|
|
6508
|
+
const [n, r] = useState(!1), [a, l] = useState(""), { currentClass: i, onChange: c, classPrefix: d, cssProperty: u, units: p, negative: m } = o, [g, x] = useState(u != null && u.toLowerCase().includes("width") ? "%" : p[0]), [j, E] = useState(!1), [b, k] = useState(""), [v, S] = useState(!1), [B, R] = useState(!1);
|
|
6505
6509
|
useEffect(() => {
|
|
6506
|
-
const { value: f, unit:
|
|
6507
|
-
if (
|
|
6510
|
+
const { value: f, unit: _ } = getClassValueAndUnit(i);
|
|
6511
|
+
if (_ === "") {
|
|
6508
6512
|
l(f), x(u != null && u.toLowerCase().includes("width") ? "%" : first(p));
|
|
6509
6513
|
return;
|
|
6510
6514
|
}
|
|
6511
|
-
x(
|
|
6515
|
+
x(_), l(_ === "class" || isEmpty(f) ? "" : f);
|
|
6512
6516
|
}, [i, u, p]);
|
|
6513
6517
|
const A = useThrottledCallback((f) => c(f), [c], THROTTLE_TIME), T = useThrottledCallback((f) => c(f, !1), [c], THROTTLE_TIME), L = useCallback(
|
|
6514
6518
|
(f = !1) => {
|
|
6515
|
-
const
|
|
6516
|
-
if (get(
|
|
6519
|
+
const _ = getUserInputValues(`${a}`, p);
|
|
6520
|
+
if (get(_, "error", !1)) {
|
|
6517
6521
|
E(!0);
|
|
6518
6522
|
return;
|
|
6519
6523
|
}
|
|
6520
|
-
const C = get(
|
|
6524
|
+
const C = get(_, "unit") !== "" ? get(_, "unit") : g;
|
|
6521
6525
|
if (C === "auto" || C === "none") {
|
|
6522
6526
|
A(`${d}${C}`);
|
|
6523
6527
|
return;
|
|
6524
6528
|
}
|
|
6525
|
-
if (get(
|
|
6529
|
+
if (get(_, "value") === "")
|
|
6526
6530
|
return;
|
|
6527
|
-
const I = `${get(
|
|
6531
|
+
const I = `${get(_, "value", "").startsWith("-") ? "-" : ""}${d}[${get(_, "value", "").replace("-", "")}${C === "-" ? "" : C}]`;
|
|
6528
6532
|
f ? T(I) : A(I);
|
|
6529
6533
|
},
|
|
6530
6534
|
[A, T, a, g, d, p]
|
|
6531
6535
|
), P = useCallback(
|
|
6532
6536
|
(f) => {
|
|
6533
|
-
const
|
|
6534
|
-
if (get(
|
|
6537
|
+
const _ = getUserInputValues(`${a}`, p);
|
|
6538
|
+
if (get(_, "error", !1)) {
|
|
6535
6539
|
E(!0);
|
|
6536
6540
|
return;
|
|
6537
6541
|
}
|
|
@@ -6539,9 +6543,9 @@ const RangeChoices = ({ property: o, onChange: n }) => {
|
|
|
6539
6543
|
A(`${d}${f}`);
|
|
6540
6544
|
return;
|
|
6541
6545
|
}
|
|
6542
|
-
if (get(
|
|
6546
|
+
if (get(_, "value") === "")
|
|
6543
6547
|
return;
|
|
6544
|
-
const C = get(
|
|
6548
|
+
const C = get(_, "unit") !== "" ? get(_, "unit") : f, I = `${get(_, "value", "").startsWith("-") ? "-" : ""}${d}[${get(_, "value", "").replace("-", "")}${C === "-" ? "" : C}]`;
|
|
6545
6549
|
A(I);
|
|
6546
6550
|
},
|
|
6547
6551
|
[A, a, d, p]
|
|
@@ -6552,7 +6556,7 @@ const RangeChoices = ({ property: o, onChange: n }) => {
|
|
|
6552
6556
|
/* @__PURE__ */ jsxRuntimeExports.jsx(TooltipTrigger, { asChild: !0, children: /* @__PURE__ */ jsxRuntimeExports.jsx("button", { type: "button", className: "invisible ml-3 mt-1 text-blue-600 group-hover:visible", children: /* @__PURE__ */ jsxRuntimeExports.jsx(InfoCircledIcon, {}) }) }),
|
|
6553
6557
|
/* @__PURE__ */ jsxRuntimeExports.jsx(TooltipContent, { children: "Current value is using a Tailwind preset class." })
|
|
6554
6558
|
] })
|
|
6555
|
-
] }) : /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: `group relative flex items-center ${
|
|
6559
|
+
] }) : /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: `group relative flex items-center ${v ? "z-auto" : ""}`, children: [
|
|
6556
6560
|
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center rounded-md border border-border", children: [
|
|
6557
6561
|
["none", "auto"].indexOf(g) !== -1 ? null : /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
6558
6562
|
"input",
|
|
@@ -6565,8 +6569,8 @@ const RangeChoices = ({ property: o, onChange: n }) => {
|
|
|
6565
6569
|
if (f.keyCode !== 38 && f.keyCode !== 40)
|
|
6566
6570
|
return;
|
|
6567
6571
|
f.preventDefault(), R(!0);
|
|
6568
|
-
const
|
|
6569
|
-
let C = isNaN$1(
|
|
6572
|
+
const _ = parseInt$1(f.target.value);
|
|
6573
|
+
let C = isNaN$1(_) ? 0 : _;
|
|
6570
6574
|
f.keyCode === 38 && (C += 1), f.keyCode === 40 && (C -= 1);
|
|
6571
6575
|
const w = `${C}`, N = `${w.startsWith("-") ? "-" : ""}${d}[${w.replace("-", "")}${g === "-" ? "" : g}]`;
|
|
6572
6576
|
T(N);
|
|
@@ -6579,10 +6583,10 @@ const RangeChoices = ({ property: o, onChange: n }) => {
|
|
|
6579
6583
|
E(!1), l(f.target.value);
|
|
6580
6584
|
},
|
|
6581
6585
|
onClick: (f) => {
|
|
6582
|
-
var
|
|
6583
|
-
(
|
|
6586
|
+
var _;
|
|
6587
|
+
(_ = f == null ? void 0 : f.target) == null || _.select(), r(!1);
|
|
6584
6588
|
},
|
|
6585
|
-
value:
|
|
6589
|
+
value: v ? b : a,
|
|
6586
6590
|
className: "h-6 w-14 rounded rounded-r-none border border-transparent bg-background pl-2 text-sm focus-visible:outline-0".concat(
|
|
6587
6591
|
" ",
|
|
6588
6592
|
j ? "border-red-500 text-red-500" : "border-foreground/20"
|
|
@@ -6614,21 +6618,21 @@ const RangeChoices = ({ property: o, onChange: n }) => {
|
|
|
6614
6618
|
) }) })
|
|
6615
6619
|
] })
|
|
6616
6620
|
] }),
|
|
6617
|
-
["none", "auto"].indexOf(g) !== -1 ||
|
|
6621
|
+
["none", "auto"].indexOf(g) !== -1 || v ? null : /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
6618
6622
|
DragStyleButton,
|
|
6619
6623
|
{
|
|
6620
6624
|
onDragStart: () => S(!0),
|
|
6621
6625
|
onDragEnd: (f) => {
|
|
6622
6626
|
if (k(() => ""), S(!1), isEmpty(f))
|
|
6623
6627
|
return;
|
|
6624
|
-
const
|
|
6628
|
+
const _ = `${f}`, w = `${_.startsWith("-") ? "-" : ""}${d}[${_.replace("-", "")}${g === "-" ? "" : g}]`;
|
|
6625
6629
|
A(w);
|
|
6626
6630
|
},
|
|
6627
6631
|
onDrag: (f) => {
|
|
6628
6632
|
if (isEmpty(f))
|
|
6629
6633
|
return;
|
|
6630
6634
|
k(f);
|
|
6631
|
-
const
|
|
6635
|
+
const _ = `${f}`, w = `${_.startsWith("-") ? "-" : ""}${d}[${_.replace("-", "")}${g === "-" ? "" : g}]`;
|
|
6632
6636
|
T(w);
|
|
6633
6637
|
},
|
|
6634
6638
|
currentValue: a,
|
|
@@ -6734,7 +6738,7 @@ const RangeChoices = ({ property: o, onChange: n }) => {
|
|
|
6734
6738
|
x(E, [f], L);
|
|
6735
6739
|
},
|
|
6736
6740
|
[E, u, m, p, l, x]
|
|
6737
|
-
),
|
|
6741
|
+
), v = useCallback(() => {
|
|
6738
6742
|
j(E, [b]);
|
|
6739
6743
|
}, [E, b, j]), S = useMemo(() => canChangeClass(g, m), [g, m]);
|
|
6740
6744
|
useEffect(() => {
|
|
@@ -6773,7 +6777,7 @@ const RangeChoices = ({ property: o, onChange: n }) => {
|
|
|
6773
6777
|
r === "color" && /* @__PURE__ */ jsxRuntimeExports.jsx(ColorChoice, { property: l, onChange: k }),
|
|
6774
6778
|
r === "dropdown" && /* @__PURE__ */ jsxRuntimeExports.jsx(DropDownChoices, { label: a, property: l, onChange: k })
|
|
6775
6779
|
] }),
|
|
6776
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `w-[30px] cursor-pointer ${b ? "visible" : "invisible"}`, children: A ? /* @__PURE__ */ jsxRuntimeExports.jsx("button", { type: "button", onClick: () =>
|
|
6780
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `w-[30px] cursor-pointer ${b ? "visible" : "invisible"}`, children: A ? /* @__PURE__ */ jsxRuntimeExports.jsx("button", { type: "button", onClick: () => v(), 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" }) }) : S && g ? /* @__PURE__ */ jsxRuntimeExports.jsxs(Tooltip, { delayDuration: 100, children: [
|
|
6777
6781
|
/* @__PURE__ */ jsxRuntimeExports.jsx(TooltipTrigger, { asChild: !0, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
6778
6782
|
"button",
|
|
6779
6783
|
{
|
|
@@ -7051,8 +7055,8 @@ const BlockCard = ({
|
|
|
7051
7055
|
parentId: r = void 0
|
|
7052
7056
|
}) => {
|
|
7053
7057
|
const [a, l] = useState(!1), i = useBuilderProp("getUILibraryBlock", noop), { addCoreBlock: c, addPredefinedBlock: d } = useAddBlock(), [, u] = useSelectedBlockIds(), { clearHighlight: p } = useBlockHighlight(), m = get(o, "name", get(o, "label")), g = useFeature("dnd"), [, x] = useAtom$1(draggedBlockAtom), j = (k) => {
|
|
7054
|
-
const
|
|
7055
|
-
return k._type === "Box" &&
|
|
7058
|
+
const v = has(k, "styles_attrs.data-page-section");
|
|
7059
|
+
return k._type === "Box" && v;
|
|
7056
7060
|
}, E = useCallback(
|
|
7057
7061
|
async (k) => {
|
|
7058
7062
|
if (k.stopPropagation(), has(o, "component")) {
|
|
@@ -7060,15 +7064,15 @@ const BlockCard = ({
|
|
|
7060
7064
|
return;
|
|
7061
7065
|
}
|
|
7062
7066
|
l(!0);
|
|
7063
|
-
const
|
|
7064
|
-
isEmpty(
|
|
7067
|
+
const v = await i(n, o);
|
|
7068
|
+
isEmpty(v) || d(syncBlocksWithDefaults(v), r), emitChaiBuilderMsg({ name: CHAI_BUILDER_EVENTS.CLOSE_ADD_BLOCK });
|
|
7065
7069
|
},
|
|
7066
7070
|
[o]
|
|
7067
7071
|
), b = async (k) => {
|
|
7068
|
-
const
|
|
7072
|
+
const v = await i(n, o);
|
|
7069
7073
|
let S = r;
|
|
7070
|
-
if (j(first(
|
|
7071
|
-
const B = { blocks:
|
|
7074
|
+
if (j(first(v)) && (S = null), !isEmpty(v)) {
|
|
7075
|
+
const B = { blocks: v, uiLibrary: !0, parent: S };
|
|
7072
7076
|
if (k.dataTransfer.setData("text/plain", JSON.stringify(B)), o.preview) {
|
|
7073
7077
|
const R = new Image();
|
|
7074
7078
|
R.src = o.preview, R.onload = () => {
|
|
@@ -7127,7 +7131,7 @@ const BlockCard = ({
|
|
|
7127
7131
|
/* @__PURE__ */ jsxRuntimeExports.jsx(Skeleton, { className: "col-span-3 h-full" }),
|
|
7128
7132
|
/* @__PURE__ */ jsxRuntimeExports.jsx(Skeleton, { className: "col-span-9 h-full" })
|
|
7129
7133
|
] });
|
|
7130
|
-
const k = filter(x, (S, B) => B % 2 === 0),
|
|
7134
|
+
const k = filter(x, (S, B) => B % 2 === 0), v = filter(x, (S, B) => B % 2 === 1);
|
|
7131
7135
|
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: [
|
|
7132
7136
|
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex h-full max-h-full w-60 flex-col gap-1 px-1 pr-2", children: [
|
|
7133
7137
|
/* @__PURE__ */ jsxRuntimeExports.jsx(UILibrariesSelect, { library: c == null ? void 0 : c.uuid, setLibrary: r, uiLibraries: a }),
|
|
@@ -7166,7 +7170,7 @@ const BlockCard = ({
|
|
|
7166
7170
|
k.map((S) => /* @__PURE__ */ jsxRuntimeExports.jsx(BlockCard, { parentId: o, block: S, library: c }))
|
|
7167
7171
|
) }),
|
|
7168
7172
|
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex flex-col gap-1", children: React__default.Children.toArray(
|
|
7169
|
-
|
|
7173
|
+
v.map((S) => /* @__PURE__ */ jsxRuntimeExports.jsx(BlockCard, { parentId: o, block: S, library: c }))
|
|
7170
7174
|
) })
|
|
7171
7175
|
] }),
|
|
7172
7176
|
/* @__PURE__ */ jsxRuntimeExports.jsx("br", {}),
|
|
@@ -8134,14 +8138,14 @@ const AIUserPrompt = ({ blockId: o }) => {
|
|
|
8134
8138
|
size: "sm",
|
|
8135
8139
|
children: c ? /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
|
|
8136
8140
|
/* @__PURE__ */ jsxRuntimeExports.jsx(Loader, { className: "h-5 w-5 animate-spin" }),
|
|
8137
|
-
o("
|
|
8141
|
+
o("Saving... Please wait...")
|
|
8138
8142
|
] }) : o("Save")
|
|
8139
8143
|
}
|
|
8140
8144
|
),
|
|
8141
8145
|
n.trim().length > 0 ? /* @__PURE__ */ jsxRuntimeExports.jsxs(AlertDialog, { children: [
|
|
8142
8146
|
/* @__PURE__ */ jsxRuntimeExports.jsx(AlertDialogTrigger, { asChild: !0, children: /* @__PURE__ */ jsxRuntimeExports.jsx(Button, { disabled: n.trim().length === 0, variant: "ghost", className: "w-fit", size: "sm", children: c ? /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
|
|
8143
8147
|
/* @__PURE__ */ jsxRuntimeExports.jsx(Loader, { className: "h-5 w-5 animate-spin" }),
|
|
8144
|
-
o("
|
|
8148
|
+
o("Deleting... Please wait...")
|
|
8145
8149
|
] }) : o("Delete") }) }),
|
|
8146
8150
|
/* @__PURE__ */ jsxRuntimeExports.jsxs(AlertDialogContent, { children: [
|
|
8147
8151
|
/* @__PURE__ */ jsxRuntimeExports.jsxs(AlertDialogHeader, { children: [
|
|
@@ -8194,7 +8198,7 @@ const AIUserPrompt = ({ blockId: o }) => {
|
|
|
8194
8198
|
}, k = (R) => {
|
|
8195
8199
|
const A = a.filter((T, L) => L !== R);
|
|
8196
8200
|
r(A), l(A);
|
|
8197
|
-
},
|
|
8201
|
+
}, v = (R) => {
|
|
8198
8202
|
m(R), c(a[R].key), u(a[R].value);
|
|
8199
8203
|
}, S = () => {
|
|
8200
8204
|
if (i.startsWith("@")) {
|
|
@@ -8266,7 +8270,7 @@ const AIUserPrompt = ({ blockId: o }) => {
|
|
|
8266
8270
|
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-wrap max-w-[200px] text-muted-foreground", children: R.value.toString() })
|
|
8267
8271
|
] }),
|
|
8268
8272
|
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex-shrink-0", children: [
|
|
8269
|
-
/* @__PURE__ */ jsxRuntimeExports.jsxs(Button, { variant: "ghost", size: "icon", className: "h-6 w-6", onClick: () =>
|
|
8273
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs(Button, { variant: "ghost", size: "icon", className: "h-6 w-6", onClick: () => v(A), children: [
|
|
8270
8274
|
/* @__PURE__ */ jsxRuntimeExports.jsx(Edit2, { className: "h-3 w-3" }),
|
|
8271
8275
|
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "sr-only", children: "Edit attribute" })
|
|
8272
8276
|
] }),
|
|
@@ -8460,43 +8464,6 @@ const TabletIcon = ({ landscape: o = !1 }) => /* @__PURE__ */ jsxRuntimeExports.
|
|
|
8460
8464
|
] })
|
|
8461
8465
|
] })
|
|
8462
8466
|
] }) });
|
|
8463
|
-
}, LanguageSelector = () => {
|
|
8464
|
-
const { fallbackLang: o, languages: n, selectedLang: r, setSelectedLang: a } = useLanguages(), l = (r == null ? void 0 : r.length) > 0 ? r : o, i = useMemo(() => {
|
|
8465
|
-
const c = [];
|
|
8466
|
-
return forEach(uniq([o, ...n]), (d) => {
|
|
8467
|
-
const u = get(LANGUAGES, d);
|
|
8468
|
-
u && c.push({ key: d, value: u, default: d === o });
|
|
8469
|
-
}), c;
|
|
8470
|
-
}, [o, n]);
|
|
8471
|
-
return isEmpty(n) && l === "en" ? null : isEmpty(n) && l !== "en" ? /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center gap-x-1 text-sm text-blue-500 hover:text-blue-600", children: [
|
|
8472
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(FaLanguage, { className: "h-4 w-4" }),
|
|
8473
|
-
get(LANGUAGES, l)
|
|
8474
|
-
] }) : /* @__PURE__ */ jsxRuntimeExports.jsxs(DropdownMenu, { children: [
|
|
8475
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(DropdownMenuTrigger, { asChild: !0, children: /* @__PURE__ */ jsxRuntimeExports.jsxs(Button, { size: "sm", variant: "ghost", className: "flex items-center gap-x-1 text-blue-500 hover:text-blue-600", children: [
|
|
8476
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(FaLanguage, { className: "h-4 w-4" }),
|
|
8477
|
-
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center space-x-2", children: [
|
|
8478
|
-
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
|
|
8479
|
-
" ",
|
|
8480
|
-
get(LANGUAGES, l)
|
|
8481
|
-
] }),
|
|
8482
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(ChevronDownIcon, { className: "h-4 w-4" })
|
|
8483
|
-
] })
|
|
8484
|
-
] }) }),
|
|
8485
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(DropdownMenuContent, { className: "border-border", children: map(i, (c) => /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
8486
|
-
DropdownMenuItem,
|
|
8487
|
-
{
|
|
8488
|
-
className: cn(
|
|
8489
|
-
"flex cursor-pointer items-center text-sm",
|
|
8490
|
-
c.key === l && "!bg-blue-500 text-white hover:!text-white"
|
|
8491
|
-
),
|
|
8492
|
-
onClick: () => a(c.key),
|
|
8493
|
-
children: [
|
|
8494
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: c.value }),
|
|
8495
|
-
c.key === o ? /* @__PURE__ */ jsxRuntimeExports.jsx(FaStar, { className: "ml-2 h-4 w-4 text-yellow-400" }) : null
|
|
8496
|
-
]
|
|
8497
|
-
}
|
|
8498
|
-
)) })
|
|
8499
|
-
] });
|
|
8500
8467
|
}, CanvasTopBar = () => {
|
|
8501
8468
|
const o = useBuilderProp("darkMode", !0), [n] = useCanvasZoom();
|
|
8502
8469
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex h-10 items-center justify-between border-b border-border bg-background/70 px-2", children: [
|
|
@@ -8518,10 +8485,7 @@ const TabletIcon = ({ landscape: o = !1 }) => /* @__PURE__ */ jsxRuntimeExports.
|
|
|
8518
8485
|
/* @__PURE__ */ jsxRuntimeExports.jsx(Separator, { orientation: "vertical" }),
|
|
8519
8486
|
/* @__PURE__ */ jsxRuntimeExports.jsx(UndoRedo, {})
|
|
8520
8487
|
] }),
|
|
8521
|
-
/* @__PURE__ */ jsxRuntimeExports.
|
|
8522
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(LanguageSelector, {}),
|
|
8523
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(ClearCanvas, {})
|
|
8524
|
-
] })
|
|
8488
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex h-full items-center space-x-2", children: /* @__PURE__ */ jsxRuntimeExports.jsx(ClearCanvas, {}) })
|
|
8525
8489
|
] });
|
|
8526
8490
|
};
|
|
8527
8491
|
function BlockAttributesToggle() {
|
|
@@ -8738,9 +8702,9 @@ const PageDataProviders = () => {
|
|
|
8738
8702
|
(b) => !isNull(b)
|
|
8739
8703
|
), x = (b) => {
|
|
8740
8704
|
const k = find(n, { providerKey: b });
|
|
8741
|
-
c((
|
|
8705
|
+
c((v) => [...v, k]), a((v) => [...v, { providerKey: k.providerKey, args: {} }]), u(""), l("UNSAVED");
|
|
8742
8706
|
}, j = (b) => {
|
|
8743
|
-
c((k) => filter(k, (
|
|
8707
|
+
c((k) => filter(k, (v) => v.providerKey !== b.providerKey)), a((k) => filter(k, (v) => v.providerKey !== b.providerKey)), l("UNSAVED");
|
|
8744
8708
|
}, E = (b) => m(b);
|
|
8745
8709
|
return isEmpty(n) ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: /* @__PURE__ */ jsxRuntimeExports.jsxs("p", { className: "mb-1.5 p-4 text-xs text-gray-500", children: [
|
|
8746
8710
|
o("no_data_providers"),
|
|
@@ -8837,7 +8801,7 @@ const PageDataProviders = () => {
|
|
|
8837
8801
|
function AiFillDatabase(o) {
|
|
8838
8802
|
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);
|
|
8839
8803
|
}
|
|
8840
|
-
const TopBar = lazy(() => import("./Topbar-
|
|
8804
|
+
const TopBar = lazy(() => import("./Topbar-_edNTuUL.js"));
|
|
8841
8805
|
function useSidebarMenuItems(o) {
|
|
8842
8806
|
const n = o === "SINGLE_SIDE_PANEL", { t: r } = useTranslation(), a = useBuilderProp("dataBindingSupport", !1), l = useBuilderProp("askAiCallBack", null);
|
|
8843
8807
|
return useMemo(() => {
|
|
@@ -9021,69 +8985,72 @@ const RootLayout = () => {
|
|
|
9021
8985
|
] }) }) });
|
|
9022
8986
|
};
|
|
9023
8987
|
export {
|
|
9024
|
-
|
|
8988
|
+
usePasteBlocks as $,
|
|
9025
8989
|
AddBlocksPanel$1 as A,
|
|
9026
8990
|
BlockSettings as B,
|
|
9027
8991
|
ChaiSelect$1 as C,
|
|
9028
8992
|
DefaultChaiBlocks as D,
|
|
9029
|
-
|
|
8993
|
+
useGlobalBlocksStore as E,
|
|
9030
8994
|
FaCheck as F,
|
|
9031
|
-
|
|
9032
|
-
|
|
8995
|
+
useBlocksStore as G,
|
|
8996
|
+
useUndoManager as H,
|
|
9033
8997
|
ImportHTML$1 as I,
|
|
9034
|
-
|
|
9035
|
-
|
|
9036
|
-
|
|
9037
|
-
|
|
9038
|
-
|
|
8998
|
+
useBuilderReset as J,
|
|
8999
|
+
useAddBlock as K,
|
|
9000
|
+
LANGUAGES as L,
|
|
9001
|
+
useAddClassesToBlocks as M,
|
|
9002
|
+
useCanvasWidth as N,
|
|
9039
9003
|
Outline$1 as O,
|
|
9040
|
-
|
|
9041
|
-
|
|
9042
|
-
|
|
9043
|
-
|
|
9004
|
+
useCanvasZoom as P,
|
|
9005
|
+
useCopyBlockIds as Q,
|
|
9006
|
+
useCopyToClipboard as R,
|
|
9007
|
+
useCurrentPage as S,
|
|
9044
9008
|
ThemeOptions as T,
|
|
9045
9009
|
UILibraries as U,
|
|
9046
|
-
|
|
9047
|
-
|
|
9048
|
-
|
|
9049
|
-
|
|
9050
|
-
|
|
9051
|
-
|
|
9010
|
+
useCutBlockIds as V,
|
|
9011
|
+
useDarkMode as W,
|
|
9012
|
+
useDuplicateBlocks as X,
|
|
9013
|
+
useHiddenBlockIds as Y,
|
|
9014
|
+
useHighlightBlockId as Z,
|
|
9015
|
+
useBlockHighlight as _,
|
|
9052
9016
|
useSelectedBlockIds as a,
|
|
9053
|
-
|
|
9054
|
-
|
|
9055
|
-
|
|
9056
|
-
|
|
9057
|
-
|
|
9058
|
-
|
|
9059
|
-
|
|
9060
|
-
|
|
9061
|
-
|
|
9062
|
-
|
|
9063
|
-
|
|
9017
|
+
useBrandingOptions as a0,
|
|
9018
|
+
useRemoveBlocks as a1,
|
|
9019
|
+
useRemoveClassesFromBlocks as a2,
|
|
9020
|
+
useSelectedBlockCurrentClasses as a3,
|
|
9021
|
+
useSelectedBlockAllClasses as a4,
|
|
9022
|
+
useSelectedBlock as a5,
|
|
9023
|
+
useStylingBreakpoint as a6,
|
|
9024
|
+
useUILibraryBlocks as a7,
|
|
9025
|
+
useStylingState as a8,
|
|
9026
|
+
useSelectedBlocksDisplayChild as a9,
|
|
9027
|
+
useSelectedBreakpoints as aa,
|
|
9028
|
+
useSelectedStylingBlocks as ab,
|
|
9029
|
+
useLayoutVariant as ac,
|
|
9030
|
+
useBlocksStoreUndoableActions as ad,
|
|
9064
9031
|
useUpdateBlocksProps as b,
|
|
9065
9032
|
useUpdateBlocksPropsRealtime as c,
|
|
9066
9033
|
useBuilderProp as d,
|
|
9067
9034
|
useSavePage as e,
|
|
9068
9035
|
usePreviewMode as f,
|
|
9069
|
-
|
|
9070
|
-
|
|
9071
|
-
|
|
9072
|
-
|
|
9073
|
-
|
|
9074
|
-
|
|
9075
|
-
|
|
9076
|
-
|
|
9077
|
-
|
|
9078
|
-
|
|
9079
|
-
|
|
9080
|
-
|
|
9081
|
-
|
|
9082
|
-
|
|
9036
|
+
useLanguages as g,
|
|
9037
|
+
FaLanguage as h,
|
|
9038
|
+
FaStar as i,
|
|
9039
|
+
CanvasArea$1 as j,
|
|
9040
|
+
BlockStyling as k,
|
|
9041
|
+
AddBlocksDialog as l,
|
|
9042
|
+
emitChaiBuilderMsg as m,
|
|
9043
|
+
useChaiBuilderMsgListener as n,
|
|
9044
|
+
CHAI_BUILDER_EVENTS as o,
|
|
9045
|
+
AISetContext as p,
|
|
9046
|
+
AIUserPrompt as q,
|
|
9047
|
+
BlockAttributesEditor as r,
|
|
9048
|
+
ChaiBuilderEditor as s,
|
|
9049
|
+
DarkMode as t,
|
|
9083
9050
|
useCodeEditor as u,
|
|
9084
|
-
|
|
9085
|
-
|
|
9086
|
-
|
|
9087
|
-
|
|
9088
|
-
|
|
9051
|
+
Breakpoints as v,
|
|
9052
|
+
UndoRedo as w,
|
|
9053
|
+
getClassValueAndUnit as x,
|
|
9054
|
+
getBlocksFromHTML as y,
|
|
9055
|
+
useGlobalBlocksList as z
|
|
9089
9056
|
};
|