@chaibuilder/sdk 1.2.104 → 1.2.106
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-xKHFmP7r.js → CodeEditor-IHn5dpOk.js} +1 -1
- package/dist/{CodeEditor-BOeEt5yL.cjs → CodeEditor-xvbde46w.cjs} +1 -1
- package/dist/{Topbar-Z4cQD_EP.js → Topbar-21XY-_r9.js} +1 -1
- package/dist/{Topbar-Ulmx0c7w.cjs → Topbar-N7Q15CNR.cjs} +1 -1
- package/dist/{UnsplashImages-z3brw7hu.cjs → UnsplashImages-K0zYRuZY.cjs} +1 -1
- package/dist/{UnsplashImages-C9snpLoA.js → UnsplashImages-cgDgay1j.js} +1 -1
- package/dist/{UploadImages-zMZiwU9y.cjs → UploadImages-UnrnhGxR.cjs} +1 -1
- package/dist/{UploadImages-yrFhyBgy.js → UploadImages-mC_nhMam.js} +1 -1
- package/dist/core.cjs +1 -1
- package/dist/core.d.ts +1 -1
- package/dist/core.js +1 -1
- package/dist/{index-dB_zEyAf.js → index-FXBj1MyA.js} +559 -533
- package/dist/index-px4Uiw4o.cjs +63 -0
- package/dist/web-blocks.cjs +2 -2
- package/dist/web-blocks.js +108 -107
- package/package.json +1 -1
- package/dist/index-7bVOae6Z.cjs +0 -63
|
@@ -5,7 +5,7 @@ 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
7
|
import { a as Skeleton, B as Button, aA as ContextMenu, aB as ContextMenuTrigger, aC as ContextMenuContent, aD as ContextMenuItem, P as Tooltip, Q as TooltipTrigger, R as TooltipContent, C as Card, z as CardHeader, G as CardDescription, H as CardContent, L as Label, T as Textarea, E as CardFooter, D as Dialog, t as DialogTrigger, u as DialogContent, v as DialogHeader, x as DialogTitle, y as DialogDescription, w as DialogFooter, W as Popover, X as PopoverTrigger, Y as PopoverContent, ar as Command, at as CommandInput, au as CommandList, av as CommandEmpty, aw as CommandGroup, ax as CommandItem, K as Tabs, M as TabsList, N as TabsTrigger, O as TabsContent, d as Switch, A as Accordion, f as AccordionItem, g as AccordionTrigger, h as AccordionContent, ao as useToast, I as Input$1, V as TooltipPortal, a8 as DropdownMenu, a9 as DropdownMenuTrigger, aa as DropdownMenuContent, S as ScrollArea, ae as DropdownMenuLabel, af as DropdownMenuSeparator, ah as DropdownMenuGroup, ab as DropdownMenuItem, ag as DropdownMenuShortcut, k as AlertDialog, m as AlertDialogContent, n as AlertDialogHeader, p as AlertDialogTitle, l as AlertDialogTrigger, q as AlertDialogDescription, o as AlertDialogFooter, s as AlertDialogCancel, r as AlertDialogAction, ac as DropdownMenuCheckboxItem, Z as HoverCard, _ as HoverCardTrigger, $ as HoverCardContent, b as Separator, i as Badge, a0 as Select, a3 as SelectTrigger, a2 as SelectValue, a4 as SelectContent, a6 as SelectItem, U as TooltipProvider, aq as Toaster } from "./context-menu-YGd09SE1.js";
|
|
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, 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";
|
|
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";
|
|
11
11
|
import { getBlockComponent, useChaiBlocks, getChaiDataProviders, useGlobalStylingPresets, syncBlocksWithDefaults } from "@chaibuilder/runtime";
|
|
@@ -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, ChevronDownIcon, 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 = (b) => o.get(b), d = (b,
|
|
93
|
-
(define_import_meta_env_default$2 ? "production" : void 0) !== "production" && Object.freeze(
|
|
92
|
+
const c = (b) => o.get(b), d = (b, k) => {
|
|
93
|
+
(define_import_meta_env_default$2 ? "production" : void 0) !== "production" && Object.freeze(k);
|
|
94
94
|
const C = o.get(b);
|
|
95
|
-
if (o.set(b,
|
|
96
|
-
const R = "v" in
|
|
95
|
+
if (o.set(b, k), r.has(b) || r.set(b, C), C && hasPromiseAtomValue(C)) {
|
|
96
|
+
const R = "v" in k ? k.v instanceof Promise ? k.v : Promise.resolve(k.v) : Promise.reject(k.e);
|
|
97
97
|
cancelPromise(C.v, R);
|
|
98
98
|
}
|
|
99
|
-
}, u = (b,
|
|
99
|
+
}, u = (b, k, C) => {
|
|
100
100
|
const R = /* @__PURE__ */ new Map();
|
|
101
101
|
let I = !1;
|
|
102
102
|
C.forEach((L, P) => {
|
|
103
|
-
!L && P === b && (L =
|
|
104
|
-
}), (I ||
|
|
105
|
-
}, p = (b,
|
|
103
|
+
!L && P === b && (L = k), L ? (R.set(P, L), k.d.get(P) !== L && (I = !0)) : (define_import_meta_env_default$2 ? "production" : void 0) !== "production" && console.warn("[Bug] atom state not found");
|
|
104
|
+
}), (I || k.d.size !== R.size) && (k.d = R);
|
|
105
|
+
}, p = (b, k, C) => {
|
|
106
106
|
const R = c(b), I = {
|
|
107
107
|
d: (R == null ? void 0 : R.d) || /* @__PURE__ */ new Map(),
|
|
108
|
-
v:
|
|
108
|
+
v: k
|
|
109
109
|
};
|
|
110
110
|
if (C && u(b, I, C), R && isEqualAtomValue(R, I) && R.d === I.d)
|
|
111
111
|
return R;
|
|
@@ -115,75 +115,75 @@ const hasInitialValue = (o) => "init" in o, isActuallyWritableAtom = (o) => !!o.
|
|
|
115
115
|
I.v = R.v;
|
|
116
116
|
}
|
|
117
117
|
return d(b, I), I;
|
|
118
|
-
}, m = (b,
|
|
119
|
-
if (isPromiseLike$2(
|
|
118
|
+
}, m = (b, k, C, R) => {
|
|
119
|
+
if (isPromiseLike$2(k)) {
|
|
120
120
|
let I;
|
|
121
121
|
const L = new Promise((P, V) => {
|
|
122
|
-
let
|
|
123
|
-
|
|
122
|
+
let M = !1;
|
|
123
|
+
k.then(
|
|
124
124
|
(O) => {
|
|
125
|
-
if (
|
|
126
|
-
|
|
127
|
-
const
|
|
125
|
+
if (!M) {
|
|
126
|
+
M = !0;
|
|
127
|
+
const $ = c(b), H = p(
|
|
128
128
|
b,
|
|
129
129
|
L,
|
|
130
130
|
C
|
|
131
131
|
);
|
|
132
|
-
resolvePromise(L, O), P(O), (
|
|
132
|
+
resolvePromise(L, O), P(O), ($ == null ? void 0 : $.d) !== H.d && N(b, H, $ == null ? void 0 : $.d);
|
|
133
133
|
}
|
|
134
134
|
},
|
|
135
135
|
(O) => {
|
|
136
|
-
if (
|
|
137
|
-
|
|
138
|
-
const
|
|
136
|
+
if (!M) {
|
|
137
|
+
M = !0;
|
|
138
|
+
const $ = c(b), H = p(
|
|
139
139
|
b,
|
|
140
140
|
L,
|
|
141
141
|
C
|
|
142
142
|
);
|
|
143
|
-
rejectPromise(L, O), V(O), (
|
|
143
|
+
rejectPromise(L, O), V(O), ($ == null ? void 0 : $.d) !== H.d && N(b, H, $ == null ? void 0 : $.d);
|
|
144
144
|
}
|
|
145
145
|
}
|
|
146
146
|
), I = (O) => {
|
|
147
|
-
|
|
148
|
-
(
|
|
149
|
-
(
|
|
147
|
+
M || (M = !0, O.then(
|
|
148
|
+
($) => resolvePromise(L, $),
|
|
149
|
+
($) => rejectPromise(L, $)
|
|
150
150
|
), P(O));
|
|
151
151
|
};
|
|
152
152
|
});
|
|
153
|
-
return L.orig =
|
|
153
|
+
return L.orig = k, L.status = "pending", registerCancelPromise(L, (P) => {
|
|
154
154
|
P && I(P), R == null || R();
|
|
155
155
|
}), p(b, L, C);
|
|
156
156
|
}
|
|
157
|
-
return p(b,
|
|
158
|
-
}, x = (b,
|
|
157
|
+
return p(b, k, C);
|
|
158
|
+
}, x = (b, k, C) => {
|
|
159
159
|
const R = c(b), I = {
|
|
160
160
|
d: (R == null ? void 0 : R.d) || /* @__PURE__ */ new Map(),
|
|
161
|
-
e:
|
|
161
|
+
e: k
|
|
162
162
|
};
|
|
163
163
|
return C && u(b, I, C), R && isEqualAtomError(R, I) && R.d === I.d ? R : (d(b, I), I);
|
|
164
164
|
}, g = (b) => {
|
|
165
|
-
const
|
|
166
|
-
if (
|
|
165
|
+
const k = c(b);
|
|
166
|
+
if (k && (k.d.forEach((M, O) => {
|
|
167
167
|
O !== b && !n.has(O) && g(O);
|
|
168
|
-
}), Array.from(
|
|
169
|
-
const
|
|
170
|
-
return
|
|
171
|
-
|
|
168
|
+
}), Array.from(k.d).every(([M, O]) => {
|
|
169
|
+
const $ = c(M);
|
|
170
|
+
return M === b || $ === O || // TODO This is a hack, we should find a better solution.
|
|
171
|
+
$ && !hasPromiseAtomValue($) && isEqualAtomValue($, O);
|
|
172
172
|
})))
|
|
173
|
-
return
|
|
173
|
+
return k;
|
|
174
174
|
const C = /* @__PURE__ */ new Map();
|
|
175
175
|
let R = !0;
|
|
176
|
-
const I = (
|
|
177
|
-
if (
|
|
178
|
-
const
|
|
179
|
-
if (
|
|
180
|
-
return C.set(
|
|
181
|
-
if (hasInitialValue(
|
|
182
|
-
return C.set(
|
|
176
|
+
const I = (M) => {
|
|
177
|
+
if (M === b) {
|
|
178
|
+
const $ = c(M);
|
|
179
|
+
if ($)
|
|
180
|
+
return C.set(M, $), returnAtomValue($);
|
|
181
|
+
if (hasInitialValue(M))
|
|
182
|
+
return C.set(M, void 0), M.init;
|
|
183
183
|
throw new Error("no atom init");
|
|
184
184
|
}
|
|
185
|
-
const O = g(
|
|
186
|
-
return C.set(
|
|
185
|
+
const O = g(M);
|
|
186
|
+
return C.set(M, O), returnAtomValue(O);
|
|
187
187
|
};
|
|
188
188
|
let L, P;
|
|
189
189
|
const V = {
|
|
@@ -191,38 +191,38 @@ const hasInitialValue = (o) => "init" in o, isActuallyWritableAtom = (o) => !!o.
|
|
|
191
191
|
return L || (L = new AbortController()), L.signal;
|
|
192
192
|
},
|
|
193
193
|
get setSelf() {
|
|
194
|
-
return (define_import_meta_env_default$2 ? "production" : void 0) !== "production" && !isActuallyWritableAtom(b) && console.warn("setSelf function cannot be used with read-only atom"), !P && isActuallyWritableAtom(b) && (P = (
|
|
194
|
+
return (define_import_meta_env_default$2 ? "production" : void 0) !== "production" && !isActuallyWritableAtom(b) && console.warn("setSelf function cannot be used with read-only atom"), !P && isActuallyWritableAtom(b) && (P = (...M) => {
|
|
195
195
|
if ((define_import_meta_env_default$2 ? "production" : void 0) !== "production" && R && console.warn("setSelf function cannot be called in sync"), !R)
|
|
196
|
-
return B(b,
|
|
196
|
+
return B(b, ...M);
|
|
197
197
|
}), P;
|
|
198
198
|
}
|
|
199
199
|
};
|
|
200
200
|
try {
|
|
201
|
-
const
|
|
201
|
+
const M = b.read(I, V);
|
|
202
202
|
return m(
|
|
203
203
|
b,
|
|
204
|
-
|
|
204
|
+
M,
|
|
205
205
|
C,
|
|
206
206
|
() => L == null ? void 0 : L.abort()
|
|
207
207
|
);
|
|
208
|
-
} catch (
|
|
209
|
-
return x(b,
|
|
208
|
+
} catch (M) {
|
|
209
|
+
return x(b, M, C);
|
|
210
210
|
} finally {
|
|
211
211
|
R = !1;
|
|
212
212
|
}
|
|
213
213
|
}, E = (b) => returnAtomValue(g(b)), j = (b) => {
|
|
214
|
-
let
|
|
215
|
-
return
|
|
216
|
-
}, f = (b,
|
|
217
|
-
const
|
|
218
|
-
|
|
214
|
+
let k = n.get(b);
|
|
215
|
+
return k || (k = w(b)), k;
|
|
216
|
+
}, f = (b, k) => !k.l.size && (!k.t.size || k.t.size === 1 && k.t.has(b)), _ = (b) => {
|
|
217
|
+
const k = n.get(b);
|
|
218
|
+
k && f(b, k) && A(b);
|
|
219
219
|
}, v = (b) => {
|
|
220
|
-
const
|
|
220
|
+
const k = /* @__PURE__ */ new Map(), C = /* @__PURE__ */ new WeakMap(), R = (L) => {
|
|
221
221
|
const P = n.get(L);
|
|
222
222
|
P == null || P.t.forEach((V) => {
|
|
223
|
-
V !== L && (
|
|
223
|
+
V !== L && (k.set(
|
|
224
224
|
V,
|
|
225
|
-
(
|
|
225
|
+
(k.get(V) || /* @__PURE__ */ new Set()).add(L)
|
|
226
226
|
), C.set(V, (C.get(V) || 0) + 1), R(V));
|
|
227
227
|
});
|
|
228
228
|
};
|
|
@@ -230,89 +230,89 @@ const hasInitialValue = (o) => "init" in o, isActuallyWritableAtom = (o) => !!o.
|
|
|
230
230
|
const I = (L) => {
|
|
231
231
|
const P = n.get(L);
|
|
232
232
|
P == null || P.t.forEach((V) => {
|
|
233
|
-
var
|
|
233
|
+
var M;
|
|
234
234
|
if (V !== L) {
|
|
235
235
|
let O = C.get(V);
|
|
236
236
|
if (O && C.set(V, --O), !O) {
|
|
237
|
-
let
|
|
238
|
-
if (
|
|
237
|
+
let $ = !!((M = k.get(V)) != null && M.size);
|
|
238
|
+
if ($) {
|
|
239
239
|
const H = c(V), F = g(V);
|
|
240
|
-
|
|
240
|
+
$ = !H || !isEqualAtomValue(H, F);
|
|
241
241
|
}
|
|
242
|
-
|
|
242
|
+
$ || k.forEach((H) => H.delete(V));
|
|
243
243
|
}
|
|
244
244
|
I(V);
|
|
245
245
|
}
|
|
246
246
|
});
|
|
247
247
|
};
|
|
248
248
|
I(b);
|
|
249
|
-
}, S = (b, ...
|
|
249
|
+
}, S = (b, ...k) => {
|
|
250
250
|
let C = !0;
|
|
251
251
|
const R = (P) => returnAtomValue(g(P)), I = (P, ...V) => {
|
|
252
|
-
let
|
|
252
|
+
let M;
|
|
253
253
|
if (P === b) {
|
|
254
254
|
if (!hasInitialValue(P))
|
|
255
255
|
throw new Error("atom not writable");
|
|
256
|
-
const O = c(P),
|
|
257
|
-
(!O || !isEqualAtomValue(O,
|
|
256
|
+
const O = c(P), $ = m(P, V[0]);
|
|
257
|
+
(!O || !isEqualAtomValue(O, $)) && v(P);
|
|
258
258
|
} else
|
|
259
|
-
|
|
259
|
+
M = S(P, ...V);
|
|
260
260
|
if (!C) {
|
|
261
261
|
const O = D();
|
|
262
262
|
(define_import_meta_env_default$2 ? "production" : void 0) !== "production" && l.forEach(
|
|
263
|
-
(
|
|
263
|
+
($) => $({ type: "async-write", flushed: O })
|
|
264
264
|
);
|
|
265
265
|
}
|
|
266
|
-
return
|
|
267
|
-
}, L = b.write(R, I, ...
|
|
266
|
+
return M;
|
|
267
|
+
}, L = b.write(R, I, ...k);
|
|
268
268
|
return C = !1, L;
|
|
269
|
-
}, B = (b, ...
|
|
270
|
-
const C = S(b, ...
|
|
269
|
+
}, B = (b, ...k) => {
|
|
270
|
+
const C = S(b, ...k), R = D();
|
|
271
271
|
return (define_import_meta_env_default$2 ? "production" : void 0) !== "production" && l.forEach(
|
|
272
272
|
(I) => I({ type: "write", flushed: R })
|
|
273
273
|
), C;
|
|
274
|
-
},
|
|
274
|
+
}, w = (b, k) => {
|
|
275
275
|
const C = {
|
|
276
|
-
t: new Set(
|
|
276
|
+
t: new Set(k && [k]),
|
|
277
277
|
l: /* @__PURE__ */ new Set()
|
|
278
278
|
};
|
|
279
279
|
if (n.set(b, C), (define_import_meta_env_default$2 ? "production" : void 0) !== "production" && i.add(b), g(b).d.forEach((R, I) => {
|
|
280
280
|
const L = n.get(I);
|
|
281
|
-
L ? L.t.add(b) : I !== b &&
|
|
281
|
+
L ? L.t.add(b) : I !== b && w(I, b);
|
|
282
282
|
}), g(b), isActuallyWritableAtom(b) && b.onMount) {
|
|
283
283
|
const R = b.onMount((...I) => B(b, ...I));
|
|
284
284
|
R && (C.u = R);
|
|
285
285
|
}
|
|
286
286
|
return C;
|
|
287
|
-
},
|
|
288
|
-
var
|
|
289
|
-
const C = (
|
|
287
|
+
}, A = (b) => {
|
|
288
|
+
var k;
|
|
289
|
+
const C = (k = n.get(b)) == null ? void 0 : k.u;
|
|
290
290
|
C && C(), n.delete(b), (define_import_meta_env_default$2 ? "production" : void 0) !== "production" && i.delete(b);
|
|
291
291
|
const R = c(b);
|
|
292
292
|
R ? (hasPromiseAtomValue(R) && cancelPromise(R.v), R.d.forEach((I, L) => {
|
|
293
293
|
if (L !== b) {
|
|
294
294
|
const P = n.get(L);
|
|
295
|
-
P && (P.t.delete(b), f(L, P) &&
|
|
295
|
+
P && (P.t.delete(b), f(L, P) && A(L));
|
|
296
296
|
}
|
|
297
297
|
})) : (define_import_meta_env_default$2 ? "production" : void 0) !== "production" && console.warn("[Bug] could not find atom state to unmount", b);
|
|
298
|
-
}, N = (b,
|
|
299
|
-
const R = new Set(
|
|
298
|
+
}, N = (b, k, C) => {
|
|
299
|
+
const R = new Set(k.d.keys());
|
|
300
300
|
C == null || C.forEach((I, L) => {
|
|
301
301
|
if (R.has(L)) {
|
|
302
302
|
R.delete(L);
|
|
303
303
|
return;
|
|
304
304
|
}
|
|
305
305
|
const P = n.get(L);
|
|
306
|
-
P && (P.t.delete(b), f(L, P) &&
|
|
306
|
+
P && (P.t.delete(b), f(L, P) && A(L));
|
|
307
307
|
}), R.forEach((I) => {
|
|
308
308
|
const L = n.get(I);
|
|
309
|
-
L ? L.t.add(b) : n.has(b) &&
|
|
309
|
+
L ? L.t.add(b) : n.has(b) && w(I, b);
|
|
310
310
|
});
|
|
311
311
|
}, D = () => {
|
|
312
312
|
let b;
|
|
313
313
|
for ((define_import_meta_env_default$2 ? "production" : void 0) !== "production" && (b = /* @__PURE__ */ new Set()); r.size; ) {
|
|
314
|
-
const
|
|
315
|
-
r.clear(),
|
|
314
|
+
const k = Array.from(r);
|
|
315
|
+
r.clear(), k.forEach(([C, R]) => {
|
|
316
316
|
const I = c(C);
|
|
317
317
|
if (I) {
|
|
318
318
|
I.d !== (R == null ? void 0 : R.d) && N(C, I, R == null ? void 0 : R.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
|
-
}, T = (b,
|
|
328
|
+
return a.forEach((k) => k("state")), b;
|
|
329
|
+
}, T = (b, k) => {
|
|
330
330
|
const C = j(b), R = D(), I = C.l;
|
|
331
|
-
return I.add(
|
|
331
|
+
return I.add(k), (define_import_meta_env_default$2 ? "production" : void 0) !== "production" && (a.forEach((L) => L("sub")), l.forEach(
|
|
332
332
|
(L) => L({ type: "sub", flushed: R })
|
|
333
333
|
)), () => {
|
|
334
|
-
I.delete(
|
|
334
|
+
I.delete(k), _(b), (define_import_meta_env_default$2 ? "production" : void 0) !== "production" && (a.forEach((L) => L("unsub")), l.forEach((L) => L({ 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: T,
|
|
341
341
|
// store dev methods (these are tentative and subject to change without notice)
|
|
342
|
-
dev_subscribe_store: (b,
|
|
342
|
+
dev_subscribe_store: (b, k) => k !== 2 ? (console.warn(
|
|
343
343
|
"The current StoreListener revision is 2. The older ones are deprecated."
|
|
344
344
|
), a.add(b), () => {
|
|
345
345
|
a.delete(b);
|
|
@@ -352,9 +352,9 @@ const hasInitialValue = (o) => "init" in o, isActuallyWritableAtom = (o) => !!o.
|
|
|
352
352
|
dev_restore_atoms: (b) => {
|
|
353
353
|
for (const [C, R] of b)
|
|
354
354
|
hasInitialValue(C) && (m(C, R), v(C));
|
|
355
|
-
const
|
|
355
|
+
const k = D();
|
|
356
356
|
l.forEach(
|
|
357
|
-
(C) => C({ type: "restore", flushed:
|
|
357
|
+
(C) => C({ type: "restore", flushed: k })
|
|
358
358
|
);
|
|
359
359
|
}
|
|
360
360
|
} : {
|
|
@@ -386,27 +386,27 @@ function splitAtom(o, n) {
|
|
|
386
386
|
m[E] = f;
|
|
387
387
|
return;
|
|
388
388
|
}
|
|
389
|
-
const
|
|
390
|
-
const B = S(l),
|
|
391
|
-
if (N < 0 || N >=
|
|
389
|
+
const _ = (S) => {
|
|
390
|
+
const B = S(l), w = S(o), N = a(w, B == null ? void 0 : B.arr).keyList.indexOf(j);
|
|
391
|
+
if (N < 0 || N >= w.length) {
|
|
392
392
|
const D = c[a(c).keyList.indexOf(j)];
|
|
393
393
|
if (D)
|
|
394
394
|
return D;
|
|
395
395
|
throw new Error("splitAtom: index out of bounds for read");
|
|
396
396
|
}
|
|
397
|
-
return
|
|
398
|
-
}, v = (S, B,
|
|
399
|
-
const
|
|
397
|
+
return w[N];
|
|
398
|
+
}, v = (S, B, w) => {
|
|
399
|
+
const A = S(l), N = S(o), T = a(N, A == null ? void 0 : A.arr).keyList.indexOf(j);
|
|
400
400
|
if (T < 0 || T >= N.length)
|
|
401
401
|
throw new Error("splitAtom: index out of bounds for write");
|
|
402
|
-
const b = isFunction(
|
|
402
|
+
const b = isFunction(w) ? w(N[T]) : w;
|
|
403
403
|
B(o, [
|
|
404
404
|
...N.slice(0, T),
|
|
405
405
|
b,
|
|
406
406
|
...N.slice(T + 1)
|
|
407
407
|
]);
|
|
408
408
|
};
|
|
409
|
-
m[E] = isWritable(o) ? atom(
|
|
409
|
+
m[E] = isWritable(o) ? atom(_, v) : atom(_);
|
|
410
410
|
}), p && p.keyList.length === x.length && p.keyList.every((g, E) => g === x[E]) ? u = p : u = { arr: c, atomList: m, keyList: x }, r.set(c, u), u;
|
|
411
411
|
}, l = atom((c) => {
|
|
412
412
|
const d = c(l), u = c(o);
|
|
@@ -1179,7 +1179,7 @@ const useBlocksStoreManager = () => {
|
|
|
1179
1179
|
return r.map((l) => {
|
|
1180
1180
|
if (a.includes(l._id)) {
|
|
1181
1181
|
const i = find(n, { _id: l._id });
|
|
1182
|
-
return {
|
|
1182
|
+
return merge({}, l, { ...omit(i, "_id") });
|
|
1183
1183
|
}
|
|
1184
1184
|
return l;
|
|
1185
1185
|
});
|
|
@@ -1195,22 +1195,22 @@ const useBlocksStoreManager = () => {
|
|
|
1195
1195
|
updateBlocksProps: c
|
|
1196
1196
|
} = useBlocksStoreManager();
|
|
1197
1197
|
return {
|
|
1198
|
-
moveBlocks: (j, f,
|
|
1198
|
+
moveBlocks: (j, f, _) => {
|
|
1199
1199
|
const v = map(j, (B) => {
|
|
1200
|
-
const
|
|
1201
|
-
return { _id: B, oldParent:
|
|
1200
|
+
const A = n.find((T) => T._id === B)._parent || null, D = n.filter((T) => A ? T._parent === A : !T._parent).map((T) => T._id).indexOf(B);
|
|
1201
|
+
return { _id: B, oldParent: A, oldPosition: D };
|
|
1202
1202
|
}), S = v.find(({ _id: B }) => B === j[0]);
|
|
1203
|
-
S && S.oldParent === f && S.oldPosition ===
|
|
1204
|
-
undo: () => each(v, ({ _id: B, oldParent:
|
|
1205
|
-
i([B],
|
|
1203
|
+
S && S.oldParent === f && S.oldPosition === _ || (i(j, f, _), o({
|
|
1204
|
+
undo: () => each(v, ({ _id: B, oldParent: w, oldPosition: A }) => {
|
|
1205
|
+
i([B], w, A);
|
|
1206
1206
|
}),
|
|
1207
|
-
redo: () => i(j, f,
|
|
1207
|
+
redo: () => i(j, f, _)
|
|
1208
1208
|
}));
|
|
1209
1209
|
},
|
|
1210
|
-
addBlocks: (j, f,
|
|
1211
|
-
a(j, f,
|
|
1210
|
+
addBlocks: (j, f, _) => {
|
|
1211
|
+
a(j, f, _), o({
|
|
1212
1212
|
undo: () => l(map(j, "_id")),
|
|
1213
|
-
redo: () => a(j, f,
|
|
1213
|
+
redo: () => a(j, f, _)
|
|
1214
1214
|
});
|
|
1215
1215
|
},
|
|
1216
1216
|
removeBlocks: (j) => {
|
|
@@ -1221,15 +1221,15 @@ const useBlocksStoreManager = () => {
|
|
|
1221
1221
|
redo: () => l(map(j, "_id"))
|
|
1222
1222
|
});
|
|
1223
1223
|
},
|
|
1224
|
-
updateBlocks: (j, f,
|
|
1224
|
+
updateBlocks: (j, f, _) => {
|
|
1225
1225
|
let v = [];
|
|
1226
|
-
if (
|
|
1227
|
-
v = map(j, (S) => ({ _id: S, ...
|
|
1226
|
+
if (_)
|
|
1227
|
+
v = map(j, (S) => ({ _id: S, ..._ }));
|
|
1228
1228
|
else {
|
|
1229
1229
|
const S = keys(f);
|
|
1230
1230
|
v = map(j, (B) => {
|
|
1231
|
-
const
|
|
1232
|
-
return each(S, (N) =>
|
|
1231
|
+
const w = n.find((N) => N._id === B), A = { _id: B };
|
|
1232
|
+
return each(S, (N) => A[N] = w[N]), A;
|
|
1233
1233
|
});
|
|
1234
1234
|
}
|
|
1235
1235
|
c(map(j, (S) => ({ _id: S, ...f }))), o({
|
|
@@ -1238,7 +1238,7 @@ const useBlocksStoreManager = () => {
|
|
|
1238
1238
|
});
|
|
1239
1239
|
},
|
|
1240
1240
|
updateBlocksRuntime: (j, f) => {
|
|
1241
|
-
c(map(j, (
|
|
1241
|
+
c(map(j, (_) => ({ _id: _, ...f })));
|
|
1242
1242
|
},
|
|
1243
1243
|
setNewBlocks: (j) => {
|
|
1244
1244
|
r(j), o({
|
|
@@ -1248,9 +1248,9 @@ const useBlocksStoreManager = () => {
|
|
|
1248
1248
|
},
|
|
1249
1249
|
updateMultipleBlocksProps: (j) => {
|
|
1250
1250
|
let f = [];
|
|
1251
|
-
f = map(j, (
|
|
1252
|
-
const v = keys(
|
|
1253
|
-
return each(v, (
|
|
1251
|
+
f = map(j, (_) => {
|
|
1252
|
+
const v = keys(_), S = n.find((w) => w._id === _._id), B = {};
|
|
1253
|
+
return each(v, (w) => B[w] = S[w]), B;
|
|
1254
1254
|
}), c(j), o({
|
|
1255
1255
|
undo: () => c(f),
|
|
1256
1256
|
redo: () => c(j)
|
|
@@ -1265,8 +1265,8 @@ const useBlocksStoreManager = () => {
|
|
|
1265
1265
|
const { _id: j } = i[E];
|
|
1266
1266
|
i[E]._id = generateUUID();
|
|
1267
1267
|
const f = filter(i, { _parent: j });
|
|
1268
|
-
for (let
|
|
1269
|
-
f[
|
|
1268
|
+
for (let _ = 0; _ < f.length; _++)
|
|
1269
|
+
f[_]._parent = i[E]._id;
|
|
1270
1270
|
}
|
|
1271
1271
|
const u = first(i);
|
|
1272
1272
|
let p, m;
|
|
@@ -1277,13 +1277,13 @@ const useBlocksStoreManager = () => {
|
|
|
1277
1277
|
return { addCoreBlock: useCallback(
|
|
1278
1278
|
(i, c, d) => {
|
|
1279
1279
|
if (has(i, "blocks")) {
|
|
1280
|
-
const
|
|
1281
|
-
return a(
|
|
1280
|
+
const _ = i.blocks;
|
|
1281
|
+
return a(_, c, d);
|
|
1282
1282
|
}
|
|
1283
1283
|
const u = generateUUID(), p = getBlockDefaultProps(i.props), m = [];
|
|
1284
|
-
forIn(p, (
|
|
1285
|
-
if (startsWith(
|
|
1286
|
-
const S =
|
|
1284
|
+
forIn(p, (_, v) => {
|
|
1285
|
+
if (startsWith(_, SLOT_KEY)) {
|
|
1286
|
+
const S = _.replace(SLOT_KEY, "");
|
|
1287
1287
|
m.push({
|
|
1288
1288
|
_id: S,
|
|
1289
1289
|
_type: "Slot",
|
|
@@ -2661,7 +2661,7 @@ const useLanguages = () => {
|
|
|
2661
2661
|
const c = updatePropsForLanguage(l, n, r);
|
|
2662
2662
|
o(a, c, i);
|
|
2663
2663
|
},
|
|
2664
|
-
[
|
|
2664
|
+
[n, r, o]
|
|
2665
2665
|
);
|
|
2666
2666
|
}, useUpdateMultipleBlocksProps = () => {
|
|
2667
2667
|
const { updateMultipleBlocksProps: o } = useBlocksStoreUndoableActions();
|
|
@@ -2697,7 +2697,7 @@ const useLanguages = () => {
|
|
|
2697
2697
|
await n(a._id, a);
|
|
2698
2698
|
o(r);
|
|
2699
2699
|
},
|
|
2700
|
-
[o]
|
|
2700
|
+
[n, o]
|
|
2701
2701
|
);
|
|
2702
2702
|
}, useUpdateBlocksPropsRealtime = () => {
|
|
2703
2703
|
const { updateBlocksRuntime: o } = useBlocksStoreUndoableActions(), { selectedLang: n } = useLanguages(), r = useSelectedBlock();
|
|
@@ -2706,7 +2706,7 @@ const useLanguages = () => {
|
|
|
2706
2706
|
const i = updatePropsForLanguage(l, n, r);
|
|
2707
2707
|
o(a, i);
|
|
2708
2708
|
},
|
|
2709
|
-
[
|
|
2709
|
+
[n, r, o]
|
|
2710
2710
|
);
|
|
2711
2711
|
}, selectedBreakpointsAtom = atomWithStorage("selectedBreakpoints", ["XS", "MD", "XL"]), useSelectedBreakpoints = () => {
|
|
2712
2712
|
const [o, n] = useAtom$1(selectedBreakpointsAtom);
|
|
@@ -3062,26 +3062,26 @@ const useDnd = () => {
|
|
|
3062
3062
|
g.preventDefault(), g.stopPropagation(), throttledDragOver(g);
|
|
3063
3063
|
},
|
|
3064
3064
|
onDrop: (g) => {
|
|
3065
|
-
var
|
|
3066
|
-
const E = dropTarget, f = getOrientation(E) === "vertical" ? g.clientY + ((
|
|
3065
|
+
var w;
|
|
3066
|
+
const E = dropTarget, f = getOrientation(E) === "vertical" ? g.clientY + ((w = iframeDocument == null ? void 0 : iframeDocument.defaultView) == null ? void 0 : w.scrollY) : g.clientX;
|
|
3067
3067
|
dropIndex = calculateDropIndex(f, possiblePositions);
|
|
3068
|
-
const
|
|
3069
|
-
if ((
|
|
3068
|
+
const _ = d, v = E.getAttribute("data-block-id"), S = dropTarget.getAttribute("data-dnd-dragged") !== "yes";
|
|
3069
|
+
if ((_ == null ? void 0 : _._id) === v || !S) {
|
|
3070
3070
|
x();
|
|
3071
3071
|
return;
|
|
3072
3072
|
}
|
|
3073
|
-
if (!has(
|
|
3074
|
-
a(
|
|
3073
|
+
if (!has(_, "_id")) {
|
|
3074
|
+
a(_, v === "canvas" ? null : v, dropIndex), setTimeout(x, 300);
|
|
3075
3075
|
return;
|
|
3076
3076
|
}
|
|
3077
3077
|
let B = E.getAttribute("data-block-id");
|
|
3078
|
-
B === null && (B = g.target.parentElement.getAttribute("data-block-id")), c([
|
|
3078
|
+
B === null && (B = g.target.parentElement.getAttribute("data-block-id")), c([_._id], B === "canvas" ? null : B, dropIndex), x(), setTimeout(removePlaceholder, 300);
|
|
3079
3079
|
},
|
|
3080
3080
|
onDragEnter: (g) => {
|
|
3081
3081
|
const E = g, j = E.target;
|
|
3082
3082
|
dropTarget = j;
|
|
3083
|
-
const f = j.getAttribute("data-block-id"),
|
|
3084
|
-
p(f), E.stopPropagation(), E.preventDefault(), possiblePositions = [],
|
|
3083
|
+
const f = j.getAttribute("data-block-id"), _ = j.getAttribute("data-dnd-dragged") !== "yes";
|
|
3084
|
+
p(f), E.stopPropagation(), E.preventDefault(), possiblePositions = [], _ && calculatePossiblePositions(j), r(!0), l(""), i([]);
|
|
3085
3085
|
},
|
|
3086
3086
|
onDragLeave: (g) => {
|
|
3087
3087
|
g.target.getAttribute("data-block-id") === "canvas" && (p(null), r(!1), removePlaceholder(), possiblePositions = []);
|
|
@@ -3293,16 +3293,16 @@ const useHandleCanvasDblClick = () => {
|
|
|
3293
3293
|
}, [r, d]);
|
|
3294
3294
|
const E = get(o, "headingFont", "DM Sans"), j = get(o, "bodyFont", "DM Sans");
|
|
3295
3295
|
return useEffect(() => {
|
|
3296
|
-
const f = get(o, "primaryColor", "#000"),
|
|
3297
|
-
colors: [f,
|
|
3296
|
+
const f = get(o, "primaryColor", "#000"), _ = get(o, "secondaryColor", "#FFF"), v = get(o, "bodyBgLightColor", "#fff"), S = get(o, "bodyBgDarkColor", "#000"), B = get(o, "bodyTextDarkColor", "#000"), w = get(o, "bodyTextLightColor", "#fff"), A = s({
|
|
3297
|
+
colors: [f, _],
|
|
3298
3298
|
names: ["primary", "secondary"]
|
|
3299
3299
|
});
|
|
3300
|
-
set(
|
|
3300
|
+
set(A, "primary.DEFAULT", f), set(A, "secondary.DEFAULT", _);
|
|
3301
3301
|
const N = {
|
|
3302
3302
|
"bg-light": v,
|
|
3303
3303
|
"bg-dark": S,
|
|
3304
3304
|
"text-dark": B,
|
|
3305
|
-
"text-light":
|
|
3305
|
+
"text-light": w
|
|
3306
3306
|
}, D = get(o, "roundedCorners", "0");
|
|
3307
3307
|
!u || !u.tailwind || (u.tailwind.config = {
|
|
3308
3308
|
darkMode: "class",
|
|
@@ -3322,7 +3322,7 @@ const useHandleCanvasDblClick = () => {
|
|
|
3322
3322
|
borderRadius: {
|
|
3323
3323
|
DEFAULT: `${D || "0"}px`
|
|
3324
3324
|
},
|
|
3325
|
-
colors: { ...N, ...
|
|
3325
|
+
colors: { ...N, ...A }
|
|
3326
3326
|
}
|
|
3327
3327
|
},
|
|
3328
3328
|
plugins: [
|
|
@@ -3484,14 +3484,14 @@ function applyLanguage(o, n, r) {
|
|
|
3484
3484
|
}
|
|
3485
3485
|
function BlocksRendererStatic({ blocks: o, allBlocks: n }) {
|
|
3486
3486
|
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(), x = useCallback((f) => getStyleAttrs(f, d), [d]), [g] = useChaiExternalData(), [E] = useAtom$1(inlineEditingActiveAtom), j = useCallback(
|
|
3487
|
-
(f) => f.reduce((
|
|
3487
|
+
(f) => f.reduce((_, v) => {
|
|
3488
3488
|
const S = get(u, v, {});
|
|
3489
|
-
return { ...
|
|
3489
|
+
return { ..._, ...S };
|
|
3490
3490
|
}, {}),
|
|
3491
3491
|
[u]
|
|
3492
3492
|
);
|
|
3493
3493
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: React__default.Children.toArray(
|
|
3494
|
-
o.map((f,
|
|
3494
|
+
o.map((f, _) => {
|
|
3495
3495
|
if (E === f._id || p.includes(f._id))
|
|
3496
3496
|
return null;
|
|
3497
3497
|
const v = {}, S = filter(n, { _parent: f._id });
|
|
@@ -3499,13 +3499,13 @@ function BlocksRendererStatic({ blocks: o, allBlocks: n }) {
|
|
|
3499
3499
|
const C = m(f);
|
|
3500
3500
|
v.children = /* @__PURE__ */ jsxRuntimeExports.jsx(RenderGlobalBlock, { blocks: filter(C, (R) => !R._parent), allBlocks: C });
|
|
3501
3501
|
}
|
|
3502
|
-
const B = getBlockComponent(f._type),
|
|
3503
|
-
if (isNull(
|
|
3502
|
+
const B = getBlockComponent(f._type), w = get(B, "server", !1), A = w ? RSCBlock : get(B, "builderComponent", get(B, "component", null));
|
|
3503
|
+
if (isNull(A))
|
|
3504
3504
|
return /* @__PURE__ */ jsxRuntimeExports.jsx("noscript", { children: `<!-- ${f == null ? void 0 : f._type} not registered -->` });
|
|
3505
3505
|
const N = has(B, "getBlockStateFrom") ? B == null ? void 0 : B.getBlockStateFrom(f, n) : [], D = j(N), T = x(f);
|
|
3506
3506
|
if (get(T, "__isHidden", !1) && !includes(a, f._id))
|
|
3507
3507
|
return null;
|
|
3508
|
-
const b = i && isDescendant(i._id, f._id, n),
|
|
3508
|
+
const b = i && isDescendant(i._id, f._id, n), k = {
|
|
3509
3509
|
...includes(a, f._id) ? { "force-show": "" } : {},
|
|
3510
3510
|
"data-block-id": f._id,
|
|
3511
3511
|
"data-block-type": f._type,
|
|
@@ -3519,9 +3519,9 @@ function BlocksRendererStatic({ blocks: o, allBlocks: n }) {
|
|
|
3519
3519
|
...c === f._id && !b ? { "data-drop": "yes" } : {},
|
|
3520
3520
|
...includes(l, f._id) ? { "data-cut-block": "yes" } : {}
|
|
3521
3521
|
};
|
|
3522
|
-
return
|
|
3523
|
-
blockProps:
|
|
3524
|
-
index:
|
|
3522
|
+
return w ? /* @__PURE__ */ jsxRuntimeExports.jsx(RSCBlock, { block: f, blockProps: k }) : /* @__PURE__ */ jsxRuntimeExports.jsx(Suspense, { children: React__default.createElement(A, {
|
|
3523
|
+
blockProps: k,
|
|
3524
|
+
index: _,
|
|
3525
3525
|
...applyBindings(applyLanguage(f, r, B), g),
|
|
3526
3526
|
...omit(T, ["__isHidden"]),
|
|
3527
3527
|
...v,
|
|
@@ -3576,41 +3576,41 @@ const useAllDataProviders = () => useMemo(() => getChaiDataProviders(), []), Blo
|
|
|
3576
3576
|
n(i);
|
|
3577
3577
|
}, []), /* @__PURE__ */ jsxRuntimeExports.jsx("div", { id: "main-content", className: "h-full w-full p-8 pb-0", ref: a, children: o });
|
|
3578
3578
|
}, getElementByStyleId = (o, n) => o.querySelector(`[data-style-id="${n}"]`), StaticCanvas = () => {
|
|
3579
|
-
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, x] = useState([]), [, g] = useState([]), [, E] = useAtom$1(canvasIframeAtom), [j, f] = useSelectedStylingBlocks(),
|
|
3580
|
-
u((N) => ({ ...N, width:
|
|
3579
|
+
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, x] = useState([]), [, g] = useState([]), [, E] = useAtom$1(canvasIframeAtom), [j, f] = useSelectedStylingBlocks(), _ = useBuilderProp("loading", !1), v = useBuilderProp("htmlDir", "ltr"), S = (A) => {
|
|
3580
|
+
u((N) => ({ ...N, width: A }));
|
|
3581
3581
|
};
|
|
3582
3582
|
useEffect(() => {
|
|
3583
3583
|
if (!c.current)
|
|
3584
3584
|
return;
|
|
3585
|
-
const { clientWidth:
|
|
3586
|
-
u({ width:
|
|
3585
|
+
const { clientWidth: A, clientHeight: N } = c.current;
|
|
3586
|
+
u({ width: A, height: N });
|
|
3587
3587
|
}, [c, n]);
|
|
3588
|
-
const B = (
|
|
3589
|
-
const { top: D } =
|
|
3588
|
+
const B = (A, N = 0) => {
|
|
3589
|
+
const { top: D } = A.getBoundingClientRect();
|
|
3590
3590
|
return D + N >= 0 && D - N <= window.innerHeight;
|
|
3591
3591
|
};
|
|
3592
3592
|
useEffect(() => {
|
|
3593
|
-
var
|
|
3593
|
+
var A, N;
|
|
3594
3594
|
if (a && a.type !== "Multiple" && i.current) {
|
|
3595
3595
|
const D = getElementByDataBlockId(i.current.contentDocument, a._id);
|
|
3596
|
-
D && (B(D) || (N = (
|
|
3596
|
+
D && (B(D) || (N = (A = i.current) == null ? void 0 : A.contentWindow) == null || N.scrollTo({ top: D.offsetTop, behavior: "smooth" }), x([D]));
|
|
3597
3597
|
}
|
|
3598
3598
|
}, [a]), useEffect(() => {
|
|
3599
3599
|
if (!isEmpty(j) && i.current) {
|
|
3600
|
-
const
|
|
3600
|
+
const A = getElementByStyleId(
|
|
3601
3601
|
i.current.contentDocument,
|
|
3602
3602
|
first(j).id
|
|
3603
3603
|
);
|
|
3604
|
-
g(
|
|
3604
|
+
g(A ? [A] : [null]);
|
|
3605
3605
|
} else
|
|
3606
3606
|
g([null]);
|
|
3607
3607
|
}, [j]);
|
|
3608
|
-
const
|
|
3609
|
-
let
|
|
3610
|
-
return
|
|
3608
|
+
const w = useMemo(() => {
|
|
3609
|
+
let A = IframeInitialContent;
|
|
3610
|
+
return A = A.replace("__HTML_DIR__", v), o === "offline" && (A = A.replace(
|
|
3611
3611
|
"https://old.chaibuilder.com/offline/tailwind.cdn.js",
|
|
3612
3612
|
"/offline/tailwind.cdn.js"
|
|
3613
|
-
),
|
|
3613
|
+
), 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;
|
|
3614
3614
|
}, [o, v]);
|
|
3615
3615
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(ResizableCanvasWrapper, { onMount: S, onResize: S, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
3616
3616
|
"div",
|
|
@@ -3629,7 +3629,7 @@ const useAllDataProviders = () => useMemo(() => getChaiDataProviders(), []), Blo
|
|
|
3629
3629
|
id: "canvas-iframe",
|
|
3630
3630
|
style: { ...p, ...isEmpty(p) ? { width: `${n}px` } : {} },
|
|
3631
3631
|
className: "relative mx-auto box-content h-full w-full max-w-full shadow-lg transition-all duration-300 ease-linear",
|
|
3632
|
-
initialContent:
|
|
3632
|
+
initialContent: w,
|
|
3633
3633
|
children: [
|
|
3634
3634
|
/* @__PURE__ */ jsxRuntimeExports.jsx(KeyboardHandler, {}),
|
|
3635
3635
|
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
@@ -3641,7 +3641,7 @@ const useAllDataProviders = () => useMemo(() => getChaiDataProviders(), []), Blo
|
|
|
3641
3641
|
),
|
|
3642
3642
|
/* @__PURE__ */ jsxRuntimeExports.jsx(HeadTags, {}),
|
|
3643
3643
|
/* @__PURE__ */ jsxRuntimeExports.jsx(Provider, { children: /* @__PURE__ */ jsxRuntimeExports.jsxs(Canvas, { children: [
|
|
3644
|
-
|
|
3644
|
+
_ ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "h-full p-4", children: /* @__PURE__ */ jsxRuntimeExports.jsx(Skeleton, { className: "h-full" }) }) : /* @__PURE__ */ jsxRuntimeExports.jsx(StaticBlocksRenderer, {}),
|
|
3645
3645
|
/* @__PURE__ */ jsxRuntimeExports.jsx(AddBlockAtBottom, {}),
|
|
3646
3646
|
/* @__PURE__ */ jsxRuntimeExports.jsx("br", {}),
|
|
3647
3647
|
/* @__PURE__ */ jsxRuntimeExports.jsx("br", {}),
|
|
@@ -3752,7 +3752,7 @@ const useAllDataProviders = () => useMemo(() => getChaiDataProviders(), []), Blo
|
|
|
3752
3752
|
l !== o.length - 1 && /* @__PURE__ */ jsxRuntimeExports.jsx(ChevronRight, { className: "rtl:rotate-180", size: 16 })
|
|
3753
3753
|
] }, l))
|
|
3754
3754
|
] }) });
|
|
3755
|
-
}, CodeEditor$1 = React__default.lazy(() => import("./CodeEditor-
|
|
3755
|
+
}, CodeEditor$1 = React__default.lazy(() => import("./CodeEditor-IHn5dpOk.js")), CanvasArea = () => {
|
|
3756
3756
|
const [o] = useCodeEditor(), n = useBuilderProp("onError", noop);
|
|
3757
3757
|
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: [
|
|
3758
3758
|
/* @__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, {}) }) }),
|
|
@@ -3827,8 +3827,8 @@ const useAllDataProviders = () => useMemo(() => getChaiDataProviders(), []), Blo
|
|
|
3827
3827
|
showHeading: o = !0,
|
|
3828
3828
|
className: n = ""
|
|
3829
3829
|
}) => {
|
|
3830
|
-
const [r, a] = useBrandingOptions(), [l] = useBlocksContainer(), i = React.useRef(r), { t: c } = useTranslation(), d = ({ formData:
|
|
3831
|
-
|
|
3830
|
+
const [r, a] = useBrandingOptions(), [l] = useBlocksContainer(), i = React.useRef(r), { t: c } = useTranslation(), d = ({ formData: w }, A) => {
|
|
3831
|
+
A && (a(w), i.current = w);
|
|
3832
3832
|
}, {
|
|
3833
3833
|
bodyFont: u,
|
|
3834
3834
|
headingFont: p,
|
|
@@ -3838,7 +3838,7 @@ const useAllDataProviders = () => useMemo(() => getChaiDataProviders(), []), Blo
|
|
|
3838
3838
|
bodyBgDarkColor: E,
|
|
3839
3839
|
secondaryColor: j,
|
|
3840
3840
|
bodyBgLightColor: f,
|
|
3841
|
-
roundedCorners:
|
|
3841
|
+
roundedCorners: _
|
|
3842
3842
|
} = r;
|
|
3843
3843
|
let v = {
|
|
3844
3844
|
headingFont: y({
|
|
@@ -3853,7 +3853,7 @@ const useAllDataProviders = () => useMemo(() => getChaiDataProviders(), []), Blo
|
|
|
3853
3853
|
}),
|
|
3854
3854
|
roundedCorners: s$1({
|
|
3855
3855
|
title: c("theme_config.rounded_corner"),
|
|
3856
|
-
default: parseInt(
|
|
3856
|
+
default: parseInt(_ || 5, 10)
|
|
3857
3857
|
}),
|
|
3858
3858
|
primaryColor: h({ title: c("theme_config.primary"), default: m }),
|
|
3859
3859
|
secondaryColor: h({ title: c("theme_config.secondary"), default: j })
|
|
@@ -3881,9 +3881,9 @@ const useAllDataProviders = () => useMemo(() => getChaiDataProviders(), []), Blo
|
|
|
3881
3881
|
type: "object",
|
|
3882
3882
|
properties: {}
|
|
3883
3883
|
}, B = {};
|
|
3884
|
-
return Object.keys(v).forEach((
|
|
3885
|
-
const
|
|
3886
|
-
return S.properties || (S.properties = {}), S.properties[
|
|
3884
|
+
return Object.keys(v).forEach((w) => {
|
|
3885
|
+
const A = v[w];
|
|
3886
|
+
return S.properties || (S.properties = {}), S.properties[w] = A.schema, B[w] = A.uiSchema, !0;
|
|
3887
3887
|
}), /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: cn("flex h-full w-full select-none flex-col", n), children: [
|
|
3888
3888
|
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,
|
|
3889
3889
|
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
@@ -4079,13 +4079,13 @@ function BiExpandVertical(o) {
|
|
|
4079
4079
|
const Node = memo(({ node: o, style: n, dragHandle: r }) => {
|
|
4080
4080
|
const a = useBuilderProp("outlineMenuItems", []), { t: l } = useTranslation(), [i, , c] = useHiddenBlockIds(), [, d] = useHighlightBlockId(), [u] = useAtom$1(canvasIframeAtom);
|
|
4081
4081
|
let p = null;
|
|
4082
|
-
const m = o.children.length > 0, { id: x, data: g, isSelected: E, willReceiveDrop: j, isDragging: f, isEditing:
|
|
4082
|
+
const m = o.children.length > 0, { id: x, data: g, isSelected: E, willReceiveDrop: j, isDragging: f, isEditing: _, handleClick: v } = o, S = (T) => {
|
|
4083
4083
|
T.stopPropagation(), !i.includes(x) && o.toggle();
|
|
4084
4084
|
}, B = (T) => {
|
|
4085
4085
|
T.isInternal && (p = T.isOpen, T.isOpen && T.close());
|
|
4086
|
-
}, A = (T) => {
|
|
4087
|
-
T.isInternal && p !== null && (p ? T.open() : T.close(), p = null);
|
|
4088
4086
|
}, w = (T) => {
|
|
4087
|
+
T.isInternal && p !== null && (p ? T.open() : T.close(), p = null);
|
|
4088
|
+
}, A = (T) => {
|
|
4089
4089
|
T.stopPropagation(), !o.isOpen && !i.includes(x) && o.toggle(), v(T);
|
|
4090
4090
|
};
|
|
4091
4091
|
useEffect(() => {
|
|
@@ -4096,17 +4096,17 @@ const Node = memo(({ node: o, style: n, dragHandle: r }) => {
|
|
|
4096
4096
|
}, [j, o, f]);
|
|
4097
4097
|
const N = useMemo(() => {
|
|
4098
4098
|
const T = Object.keys(g), b = [];
|
|
4099
|
-
for (let
|
|
4100
|
-
if (T[
|
|
4101
|
-
const C = g[T[
|
|
4099
|
+
for (let k = 0; k < T.length; k++)
|
|
4100
|
+
if (T[k].endsWith("_attrs")) {
|
|
4101
|
+
const C = g[T[k]], R = Object.keys(C).join("|");
|
|
4102
4102
|
R.match(/x-data/) && b.push("data"), R.match(/x-on/) && b.push("event"), R.match(/x-show|x-if/) && b.push("show");
|
|
4103
4103
|
}
|
|
4104
4104
|
return b;
|
|
4105
4105
|
}, [g]), D = (T, b) => {
|
|
4106
|
-
const
|
|
4106
|
+
const k = u.contentDocument || u.contentWindow.document, C = k.querySelector(`[data-block-id=${T}]`);
|
|
4107
4107
|
C && C.setAttribute("data-drop", b);
|
|
4108
4108
|
const R = C.getBoundingClientRect(), I = u.getBoundingClientRect();
|
|
4109
|
-
R.top >= I.top && R.left >= I.left && R.bottom <= I.bottom && R.right <= I.right || (
|
|
4109
|
+
R.top >= I.top && R.left >= I.left && R.bottom <= I.bottom && R.right <= I.right || (k.documentElement.scrollTop = C.offsetTop - I.top);
|
|
4110
4110
|
};
|
|
4111
4111
|
return x === ROOT_TEMP_KEY ? /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
4112
4112
|
"button",
|
|
@@ -4122,12 +4122,12 @@ const Node = memo(({ node: o, style: n, dragHandle: r }) => {
|
|
|
4122
4122
|
"div",
|
|
4123
4123
|
{
|
|
4124
4124
|
onMouseEnter: () => d(x),
|
|
4125
|
-
onClick:
|
|
4125
|
+
onClick: A,
|
|
4126
4126
|
style: n,
|
|
4127
4127
|
"data-node-id": x,
|
|
4128
4128
|
ref: i.includes(x) ? null : r,
|
|
4129
4129
|
onDragStart: () => B(o),
|
|
4130
|
-
onDragEnd: () =>
|
|
4130
|
+
onDragEnd: () => w(o),
|
|
4131
4131
|
onDragOver: (T) => {
|
|
4132
4132
|
T.preventDefault(), D(x, "yes");
|
|
4133
4133
|
},
|
|
@@ -4155,7 +4155,7 @@ const Node = memo(({ node: o, style: n, dragHandle: r }) => {
|
|
|
4155
4155
|
),
|
|
4156
4156
|
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center", children: [
|
|
4157
4157
|
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "-mt-0.5 h-3 w-3", children: /* @__PURE__ */ jsxRuntimeExports.jsx(TypeIcon, { type: g == null ? void 0 : g._type }) }),
|
|
4158
|
-
|
|
4158
|
+
_ ? /* @__PURE__ */ jsxRuntimeExports.jsx(Input, { node: o }) : /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
4159
4159
|
"div",
|
|
4160
4160
|
{
|
|
4161
4161
|
className: "ml-2 flex items-center gap-x-1 truncate text-[11px]",
|
|
@@ -4624,8 +4624,8 @@ function ExpandableObject(o) {
|
|
|
4624
4624
|
useEffect(() => {
|
|
4625
4625
|
x.current ? j(p(d, r, n)) : x.current = !0;
|
|
4626
4626
|
}, [p]);
|
|
4627
|
-
const f = g ? u.collapseIcon : u.expandIcon,
|
|
4628
|
-
|
|
4627
|
+
const f = g ? u.collapseIcon : u.expandIcon, _ = g ? "collapse JSON" : "expand JSON", v = useComponentId(), S = d + 1, B = a.length - 1, w = (A) => {
|
|
4628
|
+
A.key === " " && (A.preventDefault(), E());
|
|
4629
4629
|
};
|
|
4630
4630
|
return /* @__PURE__ */ createElement("div", {
|
|
4631
4631
|
className: u.basicChildStyle,
|
|
@@ -4633,16 +4633,16 @@ function ExpandableObject(o) {
|
|
|
4633
4633
|
}, /* @__PURE__ */ createElement("span", {
|
|
4634
4634
|
className: f,
|
|
4635
4635
|
onClick: E,
|
|
4636
|
-
onKeyDown:
|
|
4636
|
+
onKeyDown: w,
|
|
4637
4637
|
role: "button",
|
|
4638
4638
|
tabIndex: 0,
|
|
4639
|
-
"aria-label":
|
|
4639
|
+
"aria-label": _,
|
|
4640
4640
|
"aria-expanded": g,
|
|
4641
4641
|
"aria-controls": g ? v : void 0
|
|
4642
4642
|
}), n && (m ? /* @__PURE__ */ createElement("span", {
|
|
4643
4643
|
className: u.clickableLabel,
|
|
4644
4644
|
onClick: E,
|
|
4645
|
-
onKeyDown:
|
|
4645
|
+
onKeyDown: w,
|
|
4646
4646
|
role: "button",
|
|
4647
4647
|
tabIndex: -1
|
|
4648
4648
|
}, n, ":") : /* @__PURE__ */ createElement("span", {
|
|
@@ -4651,10 +4651,10 @@ function ExpandableObject(o) {
|
|
|
4651
4651
|
className: u.punctuation
|
|
4652
4652
|
}, i), g ? /* @__PURE__ */ createElement("div", {
|
|
4653
4653
|
id: v
|
|
4654
|
-
}, a.map((
|
|
4655
|
-
key:
|
|
4656
|
-
field:
|
|
4657
|
-
value:
|
|
4654
|
+
}, a.map((A, N) => /* @__PURE__ */ createElement(DataRender, {
|
|
4655
|
+
key: A[0] || N,
|
|
4656
|
+
field: A[0],
|
|
4657
|
+
value: A[1],
|
|
4658
4658
|
style: u,
|
|
4659
4659
|
lastElement: N === B,
|
|
4660
4660
|
level: S,
|
|
@@ -4663,11 +4663,11 @@ function ExpandableObject(o) {
|
|
|
4663
4663
|
}))) : /* @__PURE__ */ createElement("span", {
|
|
4664
4664
|
className: u.collapsedContent,
|
|
4665
4665
|
onClick: E,
|
|
4666
|
-
onKeyDown:
|
|
4666
|
+
onKeyDown: w,
|
|
4667
4667
|
role: "button",
|
|
4668
4668
|
tabIndex: -1,
|
|
4669
4669
|
"aria-hidden": !0,
|
|
4670
|
-
"aria-label":
|
|
4670
|
+
"aria-label": _,
|
|
4671
4671
|
"aria-expanded": g
|
|
4672
4672
|
}), /* @__PURE__ */ createElement("span", {
|
|
4673
4673
|
className: u.punctuation
|
|
@@ -4858,7 +4858,7 @@ const ViewData = ({ data: o, fullView: n }) => {
|
|
|
4858
4858
|
value: j,
|
|
4859
4859
|
className: `cursor-pointer ${m ? "flex items-center justify-between" : "flex flex-col items-start justify-start"}`,
|
|
4860
4860
|
onSelect: (f) => {
|
|
4861
|
-
r(find(E, (
|
|
4861
|
+
r(find(E, (_) => _ === f) || null), g(!1);
|
|
4862
4862
|
},
|
|
4863
4863
|
children: [
|
|
4864
4864
|
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center gap-x-2", children: [
|
|
@@ -4890,8 +4890,8 @@ const ViewData = ({ data: o, fullView: n }) => {
|
|
|
4890
4890
|
const f = get(j === "PROP" ? u : p, E, "");
|
|
4891
4891
|
if (isArray$1(f))
|
|
4892
4892
|
return "list";
|
|
4893
|
-
const
|
|
4894
|
-
return
|
|
4893
|
+
const _ = typeof f;
|
|
4894
|
+
return _ === "string" ? "text" : _ === "object" ? "model" : _;
|
|
4895
4895
|
}
|
|
4896
4896
|
},
|
|
4897
4897
|
[u, p]
|
|
@@ -5137,7 +5137,7 @@ const ViewData = ({ data: o, fullView: n }) => {
|
|
|
5137
5137
|
}
|
|
5138
5138
|
)
|
|
5139
5139
|
] });
|
|
5140
|
-
}, UnsplashImages = React__default.lazy(() => import("./UnsplashImages-
|
|
5140
|
+
}, UnsplashImages = React__default.lazy(() => import("./UnsplashImages-cgDgay1j.js")), UploadImages = React__default.lazy(() => import("./UploadImages-mC_nhMam.js")), ImagesPanel = ({
|
|
5141
5141
|
isModalView: o = !1,
|
|
5142
5142
|
onSelect: n = () => {
|
|
5143
5143
|
}
|
|
@@ -5301,8 +5301,8 @@ const ImagePickerModal$1 = ImagePickerModal, ImagePickerField = ({ value: o, onC
|
|
|
5301
5301
|
const f = n[j];
|
|
5302
5302
|
if (includes(["slot", "styles"], f.type))
|
|
5303
5303
|
return;
|
|
5304
|
-
const
|
|
5305
|
-
c.properties[
|
|
5304
|
+
const _ = j;
|
|
5305
|
+
c.properties[_] = getBlockJSONFromSchemas(f, u, g), d[_] = getBlockJSONFromUISchemas(f);
|
|
5306
5306
|
}), useEffect(() => {
|
|
5307
5307
|
i(r);
|
|
5308
5308
|
}, [o, p]);
|
|
@@ -5404,29 +5404,29 @@ const ImagePickerModal$1 = ImagePickerModal, ImagePickerField = ({ value: o, onC
|
|
|
5404
5404
|
}), a;
|
|
5405
5405
|
};
|
|
5406
5406
|
function BlockSettings() {
|
|
5407
|
-
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: f },
|
|
5408
|
-
if (
|
|
5409
|
-
const S =
|
|
5407
|
+
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: f }, _, v) => {
|
|
5408
|
+
if (_ && (c == null ? void 0 : c._id) === n._id) {
|
|
5409
|
+
const S = _.replace("root.", "");
|
|
5410
5410
|
a([n._id], { [S]: get(f, S) }, v);
|
|
5411
5411
|
}
|
|
5412
5412
|
}, m = useCallback(
|
|
5413
|
-
debounce(({ formData: f },
|
|
5414
|
-
p({ formData: f },
|
|
5413
|
+
debounce(({ formData: f }, _, v) => {
|
|
5414
|
+
p({ formData: f }, _, v), d(f);
|
|
5415
5415
|
}, 1500),
|
|
5416
5416
|
[n == null ? void 0 : n._id, o]
|
|
5417
|
-
), x = ({ formData: f },
|
|
5418
|
-
if (
|
|
5419
|
-
const v =
|
|
5417
|
+
), x = ({ formData: f }, _) => {
|
|
5418
|
+
if (_) {
|
|
5419
|
+
const v = _.replace("root.", "");
|
|
5420
5420
|
r(
|
|
5421
5421
|
[n._id],
|
|
5422
5422
|
convertDotNotationToObject(v, get(f, v.split(".")))
|
|
5423
|
-
), m({ formData: f },
|
|
5423
|
+
), m({ formData: f }, _, { [v]: get(c, v) });
|
|
5424
5424
|
}
|
|
5425
5425
|
}, g = keys(get(i, "_bindings", {})), E = useMemo(() => {
|
|
5426
5426
|
const f = cloneDeep(get(l, "props", {}));
|
|
5427
|
-
return each(f, (
|
|
5428
|
-
get(
|
|
5429
|
-
}), u && each(g, (
|
|
5427
|
+
return each(f, (_, v) => {
|
|
5428
|
+
get(_, "hidden", !1) && delete f[v];
|
|
5429
|
+
}), u && each(g, (_) => delete f[_]), f;
|
|
5430
5430
|
}, [l, g, u]), j = get(l, "server", !1);
|
|
5431
5431
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "overflow-x-hidden px-px", children: [
|
|
5432
5432
|
u ? /* @__PURE__ */ jsxRuntimeExports.jsxs(Accordion, { type: "multiple", defaultValue: ["STATIC", "BINDING"], className: "mt-4 h-full w-full", children: [
|
|
@@ -5515,14 +5515,14 @@ const askAiProcessingAtom = atom$1(!1), useAskAi = () => {
|
|
|
5515
5515
|
if (l) {
|
|
5516
5516
|
n(!0), a(null);
|
|
5517
5517
|
try {
|
|
5518
|
-
const f = x === "content" ? cloneDeep(getBlockWithChildren(g, d)) : [cloneDeep(d.find((
|
|
5518
|
+
const f = x === "content" ? cloneDeep(getBlockWithChildren(g, d)) : [cloneDeep(d.find((w) => w._id === g))];
|
|
5519
5519
|
set(f, "0._parent", null);
|
|
5520
|
-
const
|
|
5521
|
-
if (
|
|
5522
|
-
a(
|
|
5520
|
+
const _ = u === p ? "" : u, v = await l(x, promptWithLanguage(E, m, x), f, _), { blocks: S, error: B } = v;
|
|
5521
|
+
if (B) {
|
|
5522
|
+
a(B);
|
|
5523
5523
|
return;
|
|
5524
5524
|
}
|
|
5525
|
-
x === "styles" ? c(
|
|
5525
|
+
x === "styles" ? c(S) : i(S), j && j(v);
|
|
5526
5526
|
} catch (f) {
|
|
5527
5527
|
a(f);
|
|
5528
5528
|
} finally {
|
|
@@ -5530,12 +5530,24 @@ const askAiProcessingAtom = atom$1(!1), useAskAi = () => {
|
|
|
5530
5530
|
}
|
|
5531
5531
|
}
|
|
5532
5532
|
},
|
|
5533
|
-
[
|
|
5533
|
+
[
|
|
5534
|
+
l,
|
|
5535
|
+
n,
|
|
5536
|
+
d,
|
|
5537
|
+
u,
|
|
5538
|
+
p,
|
|
5539
|
+
m,
|
|
5540
|
+
c,
|
|
5541
|
+
i
|
|
5542
|
+
]
|
|
5534
5543
|
),
|
|
5535
5544
|
loading: o,
|
|
5536
5545
|
error: r
|
|
5537
5546
|
};
|
|
5538
5547
|
};
|
|
5548
|
+
function FaLanguage$1(o) {
|
|
5549
|
+
return GenIcon({ tag: "svg", attr: { viewBox: "0 0 640 512" }, child: [{ tag: "path", attr: { d: "M152.1 236.2c-3.5-12.1-7.8-33.2-7.8-33.2h-.5s-4.3 21.1-7.8 33.2l-11.1 37.5H163zM616 96H336v320h280c13.3 0 24-10.7 24-24V120c0-13.3-10.7-24-24-24zm-24 120c0 6.6-5.4 12-12 12h-11.4c-6.9 23.6-21.7 47.4-42.7 69.9 8.4 6.4 17.1 12.5 26.1 18 5.5 3.4 7.3 10.5 4.1 16.2l-7.9 13.9c-3.4 5.9-10.9 7.8-16.7 4.3-12.6-7.8-24.5-16.1-35.4-24.9-10.9 8.7-22.7 17.1-35.4 24.9-5.8 3.5-13.3 1.6-16.7-4.3l-7.9-13.9c-3.2-5.6-1.4-12.8 4.2-16.2 9.3-5.7 18-11.7 26.1-18-7.9-8.4-14.9-17-21-25.7-4-5.7-2.2-13.6 3.7-17.1l6.5-3.9 7.3-4.3c5.4-3.2 12.4-1.7 16 3.4 5 7 10.8 14 17.4 20.9 13.5-14.2 23.8-28.9 30-43.2H412c-6.6 0-12-5.4-12-12v-16c0-6.6 5.4-12 12-12h64v-16c0-6.6 5.4-12 12-12h16c6.6 0 12 5.4 12 12v16h64c6.6 0 12 5.4 12 12zM0 120v272c0 13.3 10.7 24 24 24h280V96H24c-13.3 0-24 10.7-24 24zm58.9 216.1L116.4 167c1.7-4.9 6.2-8.1 11.4-8.1h32.5c5.1 0 9.7 3.3 11.4 8.1l57.5 169.1c2.6 7.8-3.1 15.9-11.4 15.9h-22.9a12 12 0 0 1-11.5-8.6l-9.4-31.9h-60.2l-9.1 31.8c-1.5 5.1-6.2 8.7-11.5 8.7H70.3c-8.2 0-14-8.1-11.4-15.9z" }, child: [] }] })(o);
|
|
5550
|
+
}
|
|
5539
5551
|
function FaMoon(o) {
|
|
5540
5552
|
return GenIcon({ tag: "svg", attr: { viewBox: "0 0 512 512" }, child: [{ tag: "path", attr: { d: "M283.211 512c78.962 0 151.079-35.925 198.857-94.792 7.068-8.708-.639-21.43-11.562-19.35-124.203 23.654-238.262-71.576-238.262-196.954 0-72.222 38.662-138.635 101.498-174.394 9.686-5.512 7.25-20.197-3.756-22.23A258.156 258.156 0 0 0 283.211 0c-141.309 0-256 114.511-256 256 0 141.309 114.511 256 256 256z" }, child: [] }] })(o);
|
|
5541
5553
|
}
|
|
@@ -5665,23 +5677,23 @@ const AskAIStyles = ({ blockId: o }) => {
|
|
|
5665
5677
|
keys: ["name"]
|
|
5666
5678
|
});
|
|
5667
5679
|
function ManualClasses() {
|
|
5668
|
-
var
|
|
5669
|
-
const { t: o } = useTranslation(), [n] = useSelectedStylingBlocks(), r = useSelectedBlock(), a = useAddClassesToBlocks(), l = useRemoveClassesFromBlocks(), [i] = useSelectedBlockIds(), c = useBuilderProp("askAiCallBack", null), [d, u] = useState(""), { toast: p } = useToast(), m = (
|
|
5680
|
+
var A;
|
|
5681
|
+
const { t: o } = useTranslation(), [n] = useSelectedStylingBlocks(), r = useSelectedBlock(), a = useAddClassesToBlocks(), l = useRemoveClassesFromBlocks(), [i] = useSelectedBlockIds(), c = useBuilderProp("askAiCallBack", null), [d, u] = useState(""), { toast: p } = useToast(), m = (A = first(n)) == null ? void 0 : A.prop, x = reject((get(r, m, "").replace(STYLES_KEY, "").split(",").pop() || "").split(" "), isEmpty), g = () => {
|
|
5670
5682
|
const N = d.trim().toLowerCase().replace(/ +(?= )/g, "").split(" ");
|
|
5671
5683
|
a(i, N, !0), u("");
|
|
5672
5684
|
}, [E, j] = useState([]), f = ({ value: N }) => {
|
|
5673
5685
|
const D = N.trim().toLowerCase(), T = D.match(/.+:/g);
|
|
5674
5686
|
let b = [];
|
|
5675
5687
|
if (T && T.length > 0) {
|
|
5676
|
-
const [
|
|
5688
|
+
const [k] = T, C = D.replace(k, "");
|
|
5677
5689
|
b = fuse.search(C).map((I) => ({
|
|
5678
5690
|
...I,
|
|
5679
|
-
item: { ...I.item, name:
|
|
5691
|
+
item: { ...I.item, name: k + I.item.name }
|
|
5680
5692
|
}));
|
|
5681
5693
|
} else
|
|
5682
5694
|
b = fuse.search(D);
|
|
5683
5695
|
return j(map(b, "item"));
|
|
5684
|
-
},
|
|
5696
|
+
}, _ = () => {
|
|
5685
5697
|
j([]);
|
|
5686
5698
|
}, v = (N) => N.name, S = (N) => /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "rounded-md p-1", children: N.name }), B = {
|
|
5687
5699
|
autoComplete: "off",
|
|
@@ -5695,7 +5707,7 @@ function ManualClasses() {
|
|
|
5695
5707
|
},
|
|
5696
5708
|
onChange: (N, { newValue: D }) => u(D),
|
|
5697
5709
|
className: "w-full rounded-md text-xs px-2 hover:outline-0 bg-background border-border py-1"
|
|
5698
|
-
},
|
|
5710
|
+
}, w = () => {
|
|
5699
5711
|
if (navigator.clipboard === void 0) {
|
|
5700
5712
|
p({
|
|
5701
5713
|
title: o("clipboard_not_supported"),
|
|
@@ -5718,7 +5730,7 @@ function ManualClasses() {
|
|
|
5718
5730
|
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center gap-x-2 text-muted-foreground", children: [
|
|
5719
5731
|
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: o("classes") }),
|
|
5720
5732
|
/* @__PURE__ */ jsxRuntimeExports.jsxs(Tooltip, { children: [
|
|
5721
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(TooltipTrigger, { asChild: !0, children: /* @__PURE__ */ jsxRuntimeExports.jsx(CopyIcon, { onClick:
|
|
5733
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(TooltipTrigger, { asChild: !0, children: /* @__PURE__ */ jsxRuntimeExports.jsx(CopyIcon, { onClick: w, className: "cursor-pointer" }) }),
|
|
5722
5734
|
/* @__PURE__ */ jsxRuntimeExports.jsx(TooltipContent, { children: /* @__PURE__ */ jsxRuntimeExports.jsx("p", { children: o("copy_classes_to_clipboard") }) })
|
|
5723
5735
|
] })
|
|
5724
5736
|
] }),
|
|
@@ -5736,7 +5748,7 @@ function ManualClasses() {
|
|
|
5736
5748
|
{
|
|
5737
5749
|
suggestions: E,
|
|
5738
5750
|
onSuggestionsFetchRequested: f,
|
|
5739
|
-
onSuggestionsClearRequested:
|
|
5751
|
+
onSuggestionsClearRequested: _,
|
|
5740
5752
|
getSuggestionValue: v,
|
|
5741
5753
|
renderSuggestion: S,
|
|
5742
5754
|
inputProps: B,
|
|
@@ -6428,50 +6440,50 @@ const RangeChoices = ({ property: o, onChange: n }) => {
|
|
|
6428
6440
|
},
|
|
6429
6441
|
a
|
|
6430
6442
|
)) }), THROTTLE_TIME = 50, AdvanceChoices = (o) => {
|
|
6431
|
-
const [n, r] = useState(!1), [a, l] = useState(""), { currentClass: i, onChange: c, classPrefix: d, cssProperty: u, units: p, negative: m } = o, [x, g] = useState(u != null && u.toLowerCase().includes("width") ? "%" : p[0]), [E, j] = useState(!1), [f,
|
|
6443
|
+
const [n, r] = useState(!1), [a, l] = useState(""), { currentClass: i, onChange: c, classPrefix: d, cssProperty: u, units: p, negative: m } = o, [x, g] = useState(u != null && u.toLowerCase().includes("width") ? "%" : p[0]), [E, j] = useState(!1), [f, _] = useState(""), [v, S] = useState(!1), [B, w] = useState(!1);
|
|
6432
6444
|
useEffect(() => {
|
|
6433
|
-
const { value: b, unit:
|
|
6434
|
-
if (
|
|
6445
|
+
const { value: b, unit: k } = getClassValueAndUnit(i);
|
|
6446
|
+
if (k === "") {
|
|
6435
6447
|
l(b), g(u != null && u.toLowerCase().includes("width") ? "%" : first(p));
|
|
6436
6448
|
return;
|
|
6437
6449
|
}
|
|
6438
|
-
g(
|
|
6450
|
+
g(k), l(k === "class" || isEmpty(b) ? "" : b);
|
|
6439
6451
|
}, [i, u, p]);
|
|
6440
|
-
const
|
|
6452
|
+
const A = useThrottledCallback((b) => c(b), [c], THROTTLE_TIME), N = useThrottledCallback((b) => c(b, !1), [c], THROTTLE_TIME), D = useCallback(
|
|
6441
6453
|
(b = !1) => {
|
|
6442
|
-
const
|
|
6443
|
-
if (get(
|
|
6454
|
+
const k = getUserInputValues(`${a}`, p);
|
|
6455
|
+
if (get(k, "error", !1)) {
|
|
6444
6456
|
j(!0);
|
|
6445
6457
|
return;
|
|
6446
6458
|
}
|
|
6447
|
-
const C = get(
|
|
6459
|
+
const C = get(k, "unit") !== "" ? get(k, "unit") : x;
|
|
6448
6460
|
if (C === "auto" || C === "none") {
|
|
6449
|
-
|
|
6461
|
+
A(`${d}${C}`);
|
|
6450
6462
|
return;
|
|
6451
6463
|
}
|
|
6452
|
-
if (get(
|
|
6464
|
+
if (get(k, "value") === "")
|
|
6453
6465
|
return;
|
|
6454
|
-
const I = `${get(
|
|
6455
|
-
b ? N(I) :
|
|
6466
|
+
const I = `${get(k, "value", "").startsWith("-") ? "-" : ""}${d}[${get(k, "value", "").replace("-", "")}${C === "-" ? "" : C}]`;
|
|
6467
|
+
b ? N(I) : A(I);
|
|
6456
6468
|
},
|
|
6457
|
-
[
|
|
6469
|
+
[A, N, a, x, d, p]
|
|
6458
6470
|
), T = useCallback(
|
|
6459
6471
|
(b) => {
|
|
6460
|
-
const
|
|
6461
|
-
if (get(
|
|
6472
|
+
const k = getUserInputValues(`${a}`, p);
|
|
6473
|
+
if (get(k, "error", !1)) {
|
|
6462
6474
|
j(!0);
|
|
6463
6475
|
return;
|
|
6464
6476
|
}
|
|
6465
6477
|
if (b === "auto" || b === "none") {
|
|
6466
|
-
|
|
6478
|
+
A(`${d}${b}`);
|
|
6467
6479
|
return;
|
|
6468
6480
|
}
|
|
6469
|
-
if (get(
|
|
6481
|
+
if (get(k, "value") === "")
|
|
6470
6482
|
return;
|
|
6471
|
-
const C = get(
|
|
6472
|
-
|
|
6483
|
+
const C = get(k, "unit") !== "" ? get(k, "unit") : b, I = `${get(k, "value", "").startsWith("-") ? "-" : ""}${d}[${get(k, "value", "").replace("-", "")}${C === "-" ? "" : C}]`;
|
|
6484
|
+
A(I);
|
|
6473
6485
|
},
|
|
6474
|
-
[
|
|
6486
|
+
[A, a, d, p]
|
|
6475
6487
|
);
|
|
6476
6488
|
return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex w-full flex-col", children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex items-center justify-start", children: x === "class" ? /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
|
|
6477
6489
|
/* @__PURE__ */ jsxRuntimeExports.jsx("input", { className: "w-20 rounded py-1", readOnly: !0, value: i }),
|
|
@@ -6491,23 +6503,23 @@ const RangeChoices = ({ property: o, onChange: n }) => {
|
|
|
6491
6503
|
onKeyDown: (b) => {
|
|
6492
6504
|
if (b.keyCode !== 38 && b.keyCode !== 40)
|
|
6493
6505
|
return;
|
|
6494
|
-
b.preventDefault(),
|
|
6495
|
-
const
|
|
6496
|
-
let C = isNaN$1(
|
|
6506
|
+
b.preventDefault(), w(!0);
|
|
6507
|
+
const k = parseInt$1(b.target.value);
|
|
6508
|
+
let C = isNaN$1(k) ? 0 : k;
|
|
6497
6509
|
b.keyCode === 38 && (C += 1), b.keyCode === 40 && (C -= 1);
|
|
6498
6510
|
const R = `${C}`, L = `${R.startsWith("-") ? "-" : ""}${d}[${R.replace("-", "")}${x === "-" ? "" : x}]`;
|
|
6499
6511
|
N(L);
|
|
6500
6512
|
},
|
|
6501
6513
|
onKeyUp: (b) => {
|
|
6502
|
-
B && (b.preventDefault(),
|
|
6514
|
+
B && (b.preventDefault(), w(!1));
|
|
6503
6515
|
},
|
|
6504
6516
|
onBlur: () => D(),
|
|
6505
6517
|
onChange: (b) => {
|
|
6506
6518
|
j(!1), l(b.target.value);
|
|
6507
6519
|
},
|
|
6508
6520
|
onClick: (b) => {
|
|
6509
|
-
var
|
|
6510
|
-
(
|
|
6521
|
+
var k;
|
|
6522
|
+
(k = b == null ? void 0 : b.target) == null || k.select(), r(!1);
|
|
6511
6523
|
},
|
|
6512
6524
|
value: v ? f : a,
|
|
6513
6525
|
className: "h-6 w-14 rounded rounded-r-none border border-transparent bg-background pl-2 text-sm focus-visible:outline-0".concat(
|
|
@@ -6546,16 +6558,16 @@ const RangeChoices = ({ property: o, onChange: n }) => {
|
|
|
6546
6558
|
{
|
|
6547
6559
|
onDragStart: () => S(!0),
|
|
6548
6560
|
onDragEnd: (b) => {
|
|
6549
|
-
if (
|
|
6561
|
+
if (_(() => ""), S(!1), isEmpty(b))
|
|
6550
6562
|
return;
|
|
6551
|
-
const
|
|
6552
|
-
|
|
6563
|
+
const k = `${b}`, R = `${k.startsWith("-") ? "-" : ""}${d}[${k.replace("-", "")}${x === "-" ? "" : x}]`;
|
|
6564
|
+
A(R);
|
|
6553
6565
|
},
|
|
6554
6566
|
onDrag: (b) => {
|
|
6555
6567
|
if (isEmpty(b))
|
|
6556
6568
|
return;
|
|
6557
|
-
|
|
6558
|
-
const
|
|
6569
|
+
_(b);
|
|
6570
|
+
const k = `${b}`, R = `${k.startsWith("-") ? "-" : ""}${d}[${k.replace("-", "")}${x === "-" ? "" : x}]`;
|
|
6559
6571
|
N(R);
|
|
6560
6572
|
},
|
|
6561
6573
|
currentValue: a,
|
|
@@ -6653,7 +6665,7 @@ const RangeChoices = ({ property: o, onChange: n }) => {
|
|
|
6653
6665
|
"2xl": "1536px"
|
|
6654
6666
|
}, getBreakpoint = (o) => `${o.toUpperCase()} ${BREAKPOINTS[o] ? `(${BREAKPOINTS[o]} & up)` : ""}`, BlockStyle = (o) => {
|
|
6655
6667
|
const { t: n } = useTranslation(), { type: r = "icons", label: a, property: l, onEmitChange: i = () => {
|
|
6656
|
-
}, units: c, negative: d = !1 } = o, [u] = useDarkMode(), [p] = useStylingState(), [, m] = useCanvasWidth(), x = useCurrentClassByProperty(l), g = useAddClassesToBlocks(), E = useRemoveClassesFromBlocks(), [j] = useSelectedBlockIds(), f = useMemo(() => get(x, "fullCls", ""), [x]),
|
|
6668
|
+
}, units: c, negative: d = !1 } = o, [u] = useDarkMode(), [p] = useStylingState(), [, m] = useCanvasWidth(), x = useCurrentClassByProperty(l), g = useAddClassesToBlocks(), E = useRemoveClassesFromBlocks(), [j] = useSelectedBlockIds(), f = useMemo(() => get(x, "fullCls", ""), [x]), _ = useCallback(
|
|
6657
6669
|
(N, D = !0) => {
|
|
6658
6670
|
const T = { dark: u, mq: m, mod: p, cls: N, property: l, fullCls: "" };
|
|
6659
6671
|
(u || p !== "") && (T.mq = "xs");
|
|
@@ -6667,7 +6679,7 @@ const RangeChoices = ({ property: o, onChange: n }) => {
|
|
|
6667
6679
|
useEffect(() => {
|
|
6668
6680
|
i(S, x);
|
|
6669
6681
|
}, [S, i, x]);
|
|
6670
|
-
const [, , B] = useCanvasWidth(),
|
|
6682
|
+
const [, , B] = useCanvasWidth(), w = useCallback(
|
|
6671
6683
|
(N) => {
|
|
6672
6684
|
B({
|
|
6673
6685
|
xs: 400,
|
|
@@ -6679,9 +6691,9 @@ const RangeChoices = ({ property: o, onChange: n }) => {
|
|
|
6679
6691
|
}[N]);
|
|
6680
6692
|
},
|
|
6681
6693
|
[B]
|
|
6682
|
-
),
|
|
6683
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx(BlockStyleProvider, { canChange: S, canReset: x &&
|
|
6684
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "relative w-[70px] truncate text-xs text-foreground", children: /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: `text-[11px] ${x && !
|
|
6694
|
+
), A = get(x, "dark", null) === u && get(x, "mod", null) === p && get(x, "mq", null) === m;
|
|
6695
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(BlockStyleProvider, { canChange: S, canReset: x && A, children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "group flex flex-row items-center py-2 first:pt-0 last:pb-0", children: [
|
|
6696
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "relative w-[70px] truncate text-xs text-foreground", children: /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: `text-[11px] ${x && !A ? "text-foreground" : ""}`, children: n(a) }) }),
|
|
6685
6697
|
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex flex-row items-center", children: [
|
|
6686
6698
|
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "w-[150px]", children: [
|
|
6687
6699
|
r === "arbitrary" ? /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
@@ -6690,17 +6702,17 @@ const RangeChoices = ({ property: o, onChange: n }) => {
|
|
|
6690
6702
|
currentClass: get(x, "cls", ""),
|
|
6691
6703
|
classPrefix: get(CLASS_PREFIXES, l, ""),
|
|
6692
6704
|
units: c || [],
|
|
6693
|
-
onChange:
|
|
6705
|
+
onChange: _,
|
|
6694
6706
|
negative: d,
|
|
6695
6707
|
cssProperty: l
|
|
6696
6708
|
}
|
|
6697
6709
|
) : null,
|
|
6698
|
-
r === "icons" && /* @__PURE__ */ jsxRuntimeExports.jsx(IconChoices, { property: l, onChange:
|
|
6699
|
-
r === "range" && /* @__PURE__ */ jsxRuntimeExports.jsx(RangeChoices, { property: l, onChange:
|
|
6700
|
-
r === "color" && /* @__PURE__ */ jsxRuntimeExports.jsx(ColorChoice, { property: l, onChange:
|
|
6701
|
-
r === "dropdown" && /* @__PURE__ */ jsxRuntimeExports.jsx(DropDownChoices, { label: a, property: l, onChange:
|
|
6710
|
+
r === "icons" && /* @__PURE__ */ jsxRuntimeExports.jsx(IconChoices, { property: l, onChange: _ }),
|
|
6711
|
+
r === "range" && /* @__PURE__ */ jsxRuntimeExports.jsx(RangeChoices, { property: l, onChange: _ }),
|
|
6712
|
+
r === "color" && /* @__PURE__ */ jsxRuntimeExports.jsx(ColorChoice, { property: l, onChange: _ }),
|
|
6713
|
+
r === "dropdown" && /* @__PURE__ */ jsxRuntimeExports.jsx(DropDownChoices, { label: a, property: l, onChange: _ })
|
|
6702
6714
|
] }),
|
|
6703
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `w-[30px] cursor-pointer ${f ? "visible" : "invisible"}`, children:
|
|
6715
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `w-[30px] cursor-pointer ${f ? "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 && x ? /* @__PURE__ */ jsxRuntimeExports.jsxs(Tooltip, { delayDuration: 100, children: [
|
|
6704
6716
|
/* @__PURE__ */ jsxRuntimeExports.jsx(TooltipTrigger, { asChild: !0, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
6705
6717
|
"button",
|
|
6706
6718
|
{
|
|
@@ -6720,7 +6732,7 @@ const RangeChoices = ({ property: o, onChange: n }) => {
|
|
|
6720
6732
|
"button",
|
|
6721
6733
|
{
|
|
6722
6734
|
type: "button",
|
|
6723
|
-
onClick: () =>
|
|
6735
|
+
onClick: () => w(get(x, "mq")),
|
|
6724
6736
|
className: "block w-full cursor-default text-right font-semibold text-blue-500",
|
|
6725
6737
|
children: [
|
|
6726
6738
|
"Switch to ",
|
|
@@ -6977,12 +6989,12 @@ const BlockCard = ({
|
|
|
6977
6989
|
library: n,
|
|
6978
6990
|
parentId: r = void 0
|
|
6979
6991
|
}) => {
|
|
6980
|
-
const [a, l] = useState(!1), i = useBuilderProp("getUILibraryBlock", noop), { addCoreBlock: c, addPredefinedBlock: d } = useAddBlock(), [, u] = useSelectedBlockIds(), [, p] = useHighlightBlockId(), m = get(o, "name", get(o, "label")), x = useFeature("dnd"), [, g] = useAtom$1(draggedBlockAtom), E = (
|
|
6981
|
-
const v = has(
|
|
6982
|
-
return
|
|
6992
|
+
const [a, l] = useState(!1), i = useBuilderProp("getUILibraryBlock", noop), { addCoreBlock: c, addPredefinedBlock: d } = useAddBlock(), [, u] = useSelectedBlockIds(), [, p] = useHighlightBlockId(), m = get(o, "name", get(o, "label")), x = useFeature("dnd"), [, g] = useAtom$1(draggedBlockAtom), E = (_) => {
|
|
6993
|
+
const v = has(_, "styles_attrs.data-page-section");
|
|
6994
|
+
return _._type === "Box" && v;
|
|
6983
6995
|
}, j = useCallback(
|
|
6984
|
-
async (
|
|
6985
|
-
if (
|
|
6996
|
+
async (_) => {
|
|
6997
|
+
if (_.stopPropagation(), has(o, "component")) {
|
|
6986
6998
|
c(o, r), emitChaiBuilderMsg({ name: CHAI_BUILDER_EVENTS.CLOSE_ADD_BLOCK });
|
|
6987
6999
|
return;
|
|
6988
7000
|
}
|
|
@@ -6991,18 +7003,18 @@ const BlockCard = ({
|
|
|
6991
7003
|
isEmpty(v) || d(syncBlocksWithDefaults(v), r), emitChaiBuilderMsg({ name: CHAI_BUILDER_EVENTS.CLOSE_ADD_BLOCK });
|
|
6992
7004
|
},
|
|
6993
7005
|
[o]
|
|
6994
|
-
), f = async (
|
|
7006
|
+
), f = async (_) => {
|
|
6995
7007
|
const v = await i(n, o);
|
|
6996
7008
|
let S = r;
|
|
6997
7009
|
if (E(first(v)) && (S = null), !isEmpty(v)) {
|
|
6998
7010
|
const B = { blocks: v, uiLibrary: !0, parent: S };
|
|
6999
|
-
if (
|
|
7000
|
-
const
|
|
7001
|
-
|
|
7002
|
-
|
|
7011
|
+
if (_.dataTransfer.setData("text/plain", JSON.stringify(B)), o.preview) {
|
|
7012
|
+
const w = new Image();
|
|
7013
|
+
w.src = o.preview, w.onload = () => {
|
|
7014
|
+
_.dataTransfer.setDragImage(w, 0, 0);
|
|
7003
7015
|
};
|
|
7004
7016
|
} else
|
|
7005
|
-
|
|
7017
|
+
_.dataTransfer.setDragImage(new Image(), 0, 0);
|
|
7006
7018
|
g(B), setTimeout(() => {
|
|
7007
7019
|
u([]), p(null), emitChaiBuilderMsg({ name: CHAI_BUILDER_EVENTS.CLOSE_ADD_BLOCK });
|
|
7008
7020
|
}, 200);
|
|
@@ -7054,7 +7066,7 @@ const BlockCard = ({
|
|
|
7054
7066
|
/* @__PURE__ */ jsxRuntimeExports.jsx(Skeleton, { className: "col-span-3 h-full" }),
|
|
7055
7067
|
/* @__PURE__ */ jsxRuntimeExports.jsx(Skeleton, { className: "col-span-9 h-full" })
|
|
7056
7068
|
] });
|
|
7057
|
-
const
|
|
7069
|
+
const _ = filter(g, (S, B) => B % 2 === 0), v = filter(g, (S, B) => B % 2 === 1);
|
|
7058
7070
|
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: [
|
|
7059
7071
|
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex h-full max-h-full w-60 flex-col gap-1 px-1 pr-2", children: [
|
|
7060
7072
|
/* @__PURE__ */ jsxRuntimeExports.jsx(UILibrariesSelect, { library: c == null ? void 0 : c.uuid, setLibrary: r, uiLibraries: a }),
|
|
@@ -7090,7 +7102,7 @@ const BlockCard = ({
|
|
|
7090
7102
|
children: [
|
|
7091
7103
|
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "grid grid-cols-2 gap-2 px-2", children: [
|
|
7092
7104
|
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex flex-col gap-1", children: React__default.Children.toArray(
|
|
7093
|
-
|
|
7105
|
+
_.map((S) => /* @__PURE__ */ jsxRuntimeExports.jsx(BlockCard, { parentId: o, block: S, library: c }))
|
|
7094
7106
|
) }),
|
|
7095
7107
|
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex flex-col gap-1", children: React__default.Children.toArray(
|
|
7096
7108
|
v.map((S) => /* @__PURE__ */ jsxRuntimeExports.jsx(BlockCard, { parentId: o, block: S, library: c }))
|
|
@@ -7647,7 +7659,201 @@ function FaCheck(o) {
|
|
|
7647
7659
|
function FaFilePen(o) {
|
|
7648
7660
|
return GenIcon({ tag: "svg", attr: { viewBox: "0 0 576 512" }, child: [{ tag: "path", attr: { d: "M0 64C0 28.7 28.7 0 64 0H224V128c0 17.7 14.3 32 32 32H384V299.6l-94.7 94.7c-8.2 8.2-14 18.5-16.8 29.7l-15 60.1c-2.3 9.4-1.8 19 1.4 27.8H64c-35.3 0-64-28.7-64-64V64zm384 64H256V0L384 128zM549.8 235.7l14.4 14.4c15.6 15.6 15.6 40.9 0 56.6l-29.4 29.4-71-71 29.4-29.4c15.6-15.6 40.9-15.6 56.6 0zM311.9 417L441.1 287.8l71 71L382.9 487.9c-4.1 4.1-9.2 7-14.9 8.4l-60.1 15c-5.5 1.4-11.2-.2-15.2-4.2s-5.6-9.7-4.2-15.2l15-60.1c1.4-5.6 4.3-10.8 8.4-14.9z" }, child: [] }] })(o);
|
|
7649
7661
|
}
|
|
7650
|
-
|
|
7662
|
+
function FaLanguage(o) {
|
|
7663
|
+
return GenIcon({ tag: "svg", attr: { viewBox: "0 0 640 512" }, child: [{ tag: "path", attr: { d: "M0 128C0 92.7 28.7 64 64 64H256h48 16H576c35.3 0 64 28.7 64 64V384c0 35.3-28.7 64-64 64H320 304 256 64c-35.3 0-64-28.7-64-64V128zm320 0V384H576V128H320zM178.3 175.9c-3.2-7.2-10.4-11.9-18.3-11.9s-15.1 4.7-18.3 11.9l-64 144c-4.5 10.1 .1 21.9 10.2 26.4s21.9-.1 26.4-10.2l8.9-20.1h73.6l8.9 20.1c4.5 10.1 16.3 14.6 26.4 10.2s14.6-16.3 10.2-26.4l-64-144zM160 233.2L179 276H141l19-42.8zM448 164c11 0 20 9 20 20v4h44 16c11 0 20 9 20 20s-9 20-20 20h-2l-1.6 4.5c-8.9 24.4-22.4 46.6-39.6 65.4c.9 .6 1.8 1.1 2.7 1.6l18.9 11.3c9.5 5.7 12.5 18 6.9 27.4s-18 12.5-27.4 6.9l-18.9-11.3c-4.5-2.7-8.8-5.5-13.1-8.5c-10.6 7.5-21.9 14-34 19.4l-3.6 1.6c-10.1 4.5-21.9-.1-26.4-10.2s.1-21.9 10.2-26.4l3.6-1.6c6.4-2.9 12.6-6.1 18.5-9.8l-12.2-12.2c-7.8-7.8-7.8-20.5 0-28.3s20.5-7.8 28.3 0l14.6 14.6 .5 .5c12.4-13.1 22.5-28.3 29.8-45H448 376c-11 0-20-9-20-20s9-20 20-20h52v-4c0-11 9-20 20-20z" }, child: [] }] })(o);
|
|
7664
|
+
}
|
|
7665
|
+
function FaStar(o) {
|
|
7666
|
+
return GenIcon({ tag: "svg", attr: { viewBox: "0 0 576 512" }, child: [{ tag: "path", attr: { d: "M316.9 18C311.6 7 300.4 0 288.1 0s-23.4 7-28.8 18L195 150.3 51.4 171.5c-12 1.8-22 10.2-25.7 21.7s-.7 24.2 7.9 32.7L137.8 329 113.2 474.7c-2 12 3 24.2 12.9 31.3s23 8 33.8 2.3l128.3-68.5 128.3 68.5c10.8 5.7 23.9 4.9 33.8-2.3s14.9-19.3 12.9-31.3L438.5 329 542.7 225.9c8.6-8.5 11.7-21.2 7.9-32.7s-13.7-19.9-25.7-21.7L381.2 150.3 316.9 18z" }, child: [] }] })(o);
|
|
7667
|
+
}
|
|
7668
|
+
const LANGUAGES = {
|
|
7669
|
+
ab: "Abkhazian",
|
|
7670
|
+
aa: "Afar",
|
|
7671
|
+
af: "Afrikaans",
|
|
7672
|
+
ak: "Akan",
|
|
7673
|
+
sq: "Albanian",
|
|
7674
|
+
am: "Amharic",
|
|
7675
|
+
ar: "Arabic",
|
|
7676
|
+
an: "Aragonese",
|
|
7677
|
+
hy: "Armenian",
|
|
7678
|
+
as: "Assamese",
|
|
7679
|
+
av: "Avaric",
|
|
7680
|
+
ae: "Avestan",
|
|
7681
|
+
ay: "Aymara",
|
|
7682
|
+
az: "Azerbaijani",
|
|
7683
|
+
bm: "Bambara",
|
|
7684
|
+
ba: "Bashkir",
|
|
7685
|
+
eu: "Basque",
|
|
7686
|
+
be: "Belarusian",
|
|
7687
|
+
bn: "Bengali",
|
|
7688
|
+
bh: "Bihari",
|
|
7689
|
+
bi: "Bislama",
|
|
7690
|
+
bs: "Bosnian",
|
|
7691
|
+
br: "Breton",
|
|
7692
|
+
bg: "Bulgarian",
|
|
7693
|
+
my: "Burmese",
|
|
7694
|
+
ca: "Catalan",
|
|
7695
|
+
ch: "Chamorro",
|
|
7696
|
+
ce: "Chechen",
|
|
7697
|
+
ny: "Chichewa",
|
|
7698
|
+
zh: "Chinese",
|
|
7699
|
+
"zh-Hans": "Chinese (Simplified)",
|
|
7700
|
+
"zh-Hant": "Chinese (Traditional)",
|
|
7701
|
+
cv: "Chuvash",
|
|
7702
|
+
kw: "Cornish",
|
|
7703
|
+
co: "Corsican",
|
|
7704
|
+
cr: "Cree",
|
|
7705
|
+
hr: "Croatian",
|
|
7706
|
+
cs: "Czech",
|
|
7707
|
+
da: "Danish",
|
|
7708
|
+
dv: "Maldivian",
|
|
7709
|
+
nl: "Dutch",
|
|
7710
|
+
dz: "Dzongkha",
|
|
7711
|
+
en: "English",
|
|
7712
|
+
eo: "Esperanto",
|
|
7713
|
+
et: "Estonian",
|
|
7714
|
+
ee: "Ewe",
|
|
7715
|
+
fo: "Faroese",
|
|
7716
|
+
fj: "Fijian",
|
|
7717
|
+
fi: "Finnish",
|
|
7718
|
+
fr: "French",
|
|
7719
|
+
ff: "Fula, Pular",
|
|
7720
|
+
gl: "Galician",
|
|
7721
|
+
gd: "Gaelic (Scottish)",
|
|
7722
|
+
gv: "Manx",
|
|
7723
|
+
ka: "Georgian",
|
|
7724
|
+
de: "German",
|
|
7725
|
+
el: "Greek",
|
|
7726
|
+
kl: "Kalaallisut",
|
|
7727
|
+
gn: "Guarani",
|
|
7728
|
+
gu: "Gujarati",
|
|
7729
|
+
ht: "Haitian Creole",
|
|
7730
|
+
ha: "Hausa",
|
|
7731
|
+
he: "Hebrew",
|
|
7732
|
+
hz: "Herero",
|
|
7733
|
+
hi: "Hindi",
|
|
7734
|
+
ho: "Hiri Motu",
|
|
7735
|
+
hu: "Hungarian",
|
|
7736
|
+
is: "Icelandic",
|
|
7737
|
+
io: "Ido",
|
|
7738
|
+
ig: "Igbo",
|
|
7739
|
+
id: "Indonesian",
|
|
7740
|
+
ia: "Interlingua",
|
|
7741
|
+
ie: "Interlingue",
|
|
7742
|
+
iu: "Inuktitut",
|
|
7743
|
+
ik: "Inupiak",
|
|
7744
|
+
ga: "Irish",
|
|
7745
|
+
it: "Italian",
|
|
7746
|
+
ja: "Japanese",
|
|
7747
|
+
jv: "Javanese",
|
|
7748
|
+
kn: "Kannada",
|
|
7749
|
+
kr: "Kanuri",
|
|
7750
|
+
ks: "Kashmiri",
|
|
7751
|
+
kk: "Kazakh",
|
|
7752
|
+
km: "Khmer",
|
|
7753
|
+
ki: "Kikuyu",
|
|
7754
|
+
rw: "Kinyarwanda",
|
|
7755
|
+
rn: "Kirundi",
|
|
7756
|
+
ky: "Kyrgyz",
|
|
7757
|
+
kv: "Komi",
|
|
7758
|
+
kg: "Kongo",
|
|
7759
|
+
ko: "Korean",
|
|
7760
|
+
ku: "Kurdish",
|
|
7761
|
+
kj: "Kwanyama",
|
|
7762
|
+
lo: "Lao",
|
|
7763
|
+
la: "Latin",
|
|
7764
|
+
lv: "Latvian",
|
|
7765
|
+
li: "Limburgish",
|
|
7766
|
+
ln: "Lingala",
|
|
7767
|
+
lt: "Lithuanian",
|
|
7768
|
+
lu: "Luga-Katanga",
|
|
7769
|
+
lg: "Luganda, Ganda",
|
|
7770
|
+
lb: "Luxembourgish",
|
|
7771
|
+
mk: "Macedonian",
|
|
7772
|
+
mg: "Malagasy",
|
|
7773
|
+
ms: "Malay",
|
|
7774
|
+
ml: "Malayalam",
|
|
7775
|
+
mt: "Maltese",
|
|
7776
|
+
mi: "Maori",
|
|
7777
|
+
mr: "Marathi",
|
|
7778
|
+
mh: "Marshallese",
|
|
7779
|
+
mo: "Moldavian",
|
|
7780
|
+
mn: "Mongolian",
|
|
7781
|
+
na: "Nauru",
|
|
7782
|
+
nv: "Navajo",
|
|
7783
|
+
ng: "Ndonga",
|
|
7784
|
+
nd: "Northern Ndebele",
|
|
7785
|
+
ne: "Nepali",
|
|
7786
|
+
no: "Norwegian",
|
|
7787
|
+
nb: "Norwegian bokmål",
|
|
7788
|
+
nn: "Norwegian nynorsk",
|
|
7789
|
+
ii: "Sichuan Yi",
|
|
7790
|
+
oc: "Occitan",
|
|
7791
|
+
oj: "Ojibwe",
|
|
7792
|
+
cu: "Old Church Slavonic",
|
|
7793
|
+
or: "Oriya",
|
|
7794
|
+
om: "Oromo",
|
|
7795
|
+
os: "Ossetian",
|
|
7796
|
+
pi: "Pāli",
|
|
7797
|
+
ps: "Pashto, Pushto",
|
|
7798
|
+
fa: "Persian (Farsi)",
|
|
7799
|
+
pl: "Polish",
|
|
7800
|
+
pt: "Portuguese",
|
|
7801
|
+
pa: "Punjabi (Eastern)",
|
|
7802
|
+
qu: "Quechua",
|
|
7803
|
+
rm: "Romansh",
|
|
7804
|
+
ro: "Romanian",
|
|
7805
|
+
ru: "Russian",
|
|
7806
|
+
se: "Sami",
|
|
7807
|
+
sm: "Samoan",
|
|
7808
|
+
sg: "Sango",
|
|
7809
|
+
sa: "Sanskrit",
|
|
7810
|
+
sr: "Serbian",
|
|
7811
|
+
sh: "Serbo-Croatian",
|
|
7812
|
+
st: "Sesotho",
|
|
7813
|
+
tn: "Setswana",
|
|
7814
|
+
sn: "Shona",
|
|
7815
|
+
sd: "Sindhi",
|
|
7816
|
+
si: "Sinhalese",
|
|
7817
|
+
ss: "Swati",
|
|
7818
|
+
sk: "Slovak",
|
|
7819
|
+
sl: "Slovenian",
|
|
7820
|
+
so: "Somali",
|
|
7821
|
+
nr: "Southern Ndebele",
|
|
7822
|
+
es: "Spanish",
|
|
7823
|
+
su: "Sundanese",
|
|
7824
|
+
sw: "Swahili (Kiswahili)",
|
|
7825
|
+
sv: "Swedish",
|
|
7826
|
+
tl: "Tagalog",
|
|
7827
|
+
ty: "Tahitian",
|
|
7828
|
+
tg: "Tajik",
|
|
7829
|
+
ta: "Tamil",
|
|
7830
|
+
tt: "Tatar",
|
|
7831
|
+
te: "Telugu",
|
|
7832
|
+
th: "Thai",
|
|
7833
|
+
bo: "Tibetan",
|
|
7834
|
+
ti: "Tigrinya",
|
|
7835
|
+
to: "Tonga",
|
|
7836
|
+
ts: "Tsonga",
|
|
7837
|
+
tr: "Turkish",
|
|
7838
|
+
tk: "Turkmen",
|
|
7839
|
+
tw: "Twi",
|
|
7840
|
+
ug: "Uyghur",
|
|
7841
|
+
uk: "Ukrainian",
|
|
7842
|
+
ur: "Urdu",
|
|
7843
|
+
uz: "Uzbek",
|
|
7844
|
+
ve: "Venda",
|
|
7845
|
+
vi: "Vietnamese",
|
|
7846
|
+
vo: "Volapük",
|
|
7847
|
+
wa: "Wallon",
|
|
7848
|
+
cy: "Welsh",
|
|
7849
|
+
wo: "Wolof",
|
|
7850
|
+
fy: "Western Frisian",
|
|
7851
|
+
xh: "Xhosa",
|
|
7852
|
+
yi: "Yiddish",
|
|
7853
|
+
yo: "Yoruba",
|
|
7854
|
+
za: "Zhuang, Chuang",
|
|
7855
|
+
zu: "Zulu"
|
|
7856
|
+
}, QUICK_PROMPTS = [
|
|
7651
7857
|
{
|
|
7652
7858
|
name: "Improve writing",
|
|
7653
7859
|
icon: FaFilePen,
|
|
@@ -7658,6 +7864,7 @@ const QUICK_PROMPTS = [
|
|
|
7658
7864
|
icon: FaRecycle,
|
|
7659
7865
|
prompt: "Discard current placeholder content and replace with meaningful relevant content."
|
|
7660
7866
|
},
|
|
7867
|
+
//TODO: Add tone options
|
|
7661
7868
|
// {
|
|
7662
7869
|
// name: "Change tone",
|
|
7663
7870
|
// icon: MegaphoneIcon,
|
|
@@ -7669,12 +7876,6 @@ const QUICK_PROMPTS = [
|
|
|
7669
7876
|
icon: CheckIcon,
|
|
7670
7877
|
prompt: "Fix grammar in all text elements. Ensuring the text is grammatically correct and free of errors."
|
|
7671
7878
|
},
|
|
7672
|
-
// {
|
|
7673
|
-
// name: "Translate",
|
|
7674
|
-
// icon: GlobeIcon,
|
|
7675
|
-
// subMenus: ["English", "Spanish", "French", "German", "Italian", "Portuguese", "Chinese", "Japanese", "Korean"],
|
|
7676
|
-
// prompt: "Translate all text elements to a __LANG__ language.",
|
|
7677
|
-
// },
|
|
7678
7879
|
{
|
|
7679
7880
|
name: "Make longer",
|
|
7680
7881
|
icon: ArrowUpIcon,
|
|
@@ -7697,32 +7898,36 @@ const QUICK_PROMPTS = [
|
|
|
7697
7898
|
}
|
|
7698
7899
|
];
|
|
7699
7900
|
function QuickPrompts({ onClick: o }) {
|
|
7700
|
-
const { loading: n } = useAskAi(), { t: r } = useTranslation();
|
|
7701
|
-
return
|
|
7702
|
-
|
|
7901
|
+
const { loading: n } = useAskAi(), { t: r } = useTranslation(), { selectedLang: a, fallbackLang: l } = useLanguages(), i = [...QUICK_PROMPTS];
|
|
7902
|
+
return a && a !== l && i.splice(0, 0, {
|
|
7903
|
+
name: `Translate to ${get(LANGUAGES, a, a)}`,
|
|
7904
|
+
icon: FaLanguage$1,
|
|
7905
|
+
prompt: `Translate the content to ${get(LANGUAGES, a, a)}. Maintain same tone, style and length.`
|
|
7906
|
+
}), /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: n ? "pointer-events-none opacity-50" : "", children: /* @__PURE__ */ jsxRuntimeExports.jsx("ul", { className: "space-y-2", children: i.map(
|
|
7907
|
+
({ name: c, icon: d, subMenus: u, prompt: p }) => u ? /* @__PURE__ */ jsxRuntimeExports.jsxs(Popover, { children: [
|
|
7703
7908
|
/* @__PURE__ */ jsxRuntimeExports.jsx(PopoverTrigger, { asChild: !0, children: /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
7704
7909
|
"li",
|
|
7705
7910
|
{
|
|
7706
7911
|
className: "flex cursor-pointer items-center space-x-2 rounded p-1 pl-2 text-sm hover:bg-gray-100 dark:hover:bg-gray-800",
|
|
7707
7912
|
children: [
|
|
7708
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
7709
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { children:
|
|
7913
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(d, { className: "h-4 w-4" }),
|
|
7914
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: c })
|
|
7710
7915
|
]
|
|
7711
7916
|
},
|
|
7712
|
-
|
|
7917
|
+
c
|
|
7713
7918
|
) }),
|
|
7714
7919
|
/* @__PURE__ */ jsxRuntimeExports.jsx(PopoverContent, { side: "right", children: /* @__PURE__ */ jsxRuntimeExports.jsx("ul", { children: /* @__PURE__ */ jsxRuntimeExports.jsx("li", { children: "Happy" }) }) })
|
|
7715
7920
|
] }) : /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
7716
7921
|
"li",
|
|
7717
7922
|
{
|
|
7718
|
-
onClick: () => o(
|
|
7923
|
+
onClick: () => o(p),
|
|
7719
7924
|
className: "flex cursor-pointer items-center space-x-2 rounded p-1 text-sm hover:bg-gray-100 dark:hover:bg-gray-800",
|
|
7720
7925
|
children: [
|
|
7721
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
7722
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: r(
|
|
7926
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(d, { className: "h-4 w-4" }),
|
|
7927
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: r(c) })
|
|
7723
7928
|
]
|
|
7724
7929
|
},
|
|
7725
|
-
|
|
7930
|
+
c
|
|
7726
7931
|
)
|
|
7727
7932
|
) }) });
|
|
7728
7933
|
}
|
|
@@ -7922,32 +8127,32 @@ const AIUserPrompt = ({ blockId: o }) => {
|
|
|
7922
8127
|
return;
|
|
7923
8128
|
}
|
|
7924
8129
|
if (i) {
|
|
7925
|
-
const
|
|
7926
|
-
r(
|
|
8130
|
+
const w = [...a, { key: i, value: d }];
|
|
8131
|
+
r(w), l(a), c(""), u(""), g("");
|
|
7927
8132
|
}
|
|
7928
|
-
},
|
|
7929
|
-
const
|
|
7930
|
-
r(
|
|
7931
|
-
}, v = (
|
|
7932
|
-
m(
|
|
8133
|
+
}, _ = (w) => {
|
|
8134
|
+
const A = a.filter((N, D) => D !== w);
|
|
8135
|
+
r(A), l(A);
|
|
8136
|
+
}, v = (w) => {
|
|
8137
|
+
m(w), c(a[w].key), u(a[w].value);
|
|
7933
8138
|
}, S = () => {
|
|
7934
8139
|
if (i.startsWith("@")) {
|
|
7935
8140
|
g("Attribute keys cannot start with '@'");
|
|
7936
8141
|
return;
|
|
7937
8142
|
}
|
|
7938
8143
|
if (p !== null && i) {
|
|
7939
|
-
const
|
|
7940
|
-
|
|
8144
|
+
const w = [...a];
|
|
8145
|
+
w[p] = { key: i, value: d }, r(w), l(w), m(null), c(""), u(""), g("");
|
|
7941
8146
|
}
|
|
7942
|
-
}, B = (
|
|
7943
|
-
|
|
8147
|
+
}, B = (w) => {
|
|
8148
|
+
w.key === "Enter" && !w.shiftKey && (w.preventDefault(), p !== null ? S() : f());
|
|
7944
8149
|
};
|
|
7945
8150
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "max-w-full", children: [
|
|
7946
8151
|
/* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
7947
8152
|
"form",
|
|
7948
8153
|
{
|
|
7949
|
-
onSubmit: (
|
|
7950
|
-
|
|
8154
|
+
onSubmit: (w) => {
|
|
8155
|
+
w.preventDefault(), p !== null ? S() : f();
|
|
7951
8156
|
},
|
|
7952
8157
|
className: "space-y-3",
|
|
7953
8158
|
children: [
|
|
@@ -7963,7 +8168,7 @@ const AIUserPrompt = ({ blockId: o }) => {
|
|
|
7963
8168
|
id: "attrKey",
|
|
7964
8169
|
ref: E,
|
|
7965
8170
|
value: i,
|
|
7966
|
-
onChange: (
|
|
8171
|
+
onChange: (w) => c(w.target.value),
|
|
7967
8172
|
placeholder: "Key",
|
|
7968
8173
|
className: "h-8 text-sm"
|
|
7969
8174
|
}
|
|
@@ -7981,7 +8186,7 @@ const AIUserPrompt = ({ blockId: o }) => {
|
|
|
7981
8186
|
rows: 2,
|
|
7982
8187
|
ref: j,
|
|
7983
8188
|
value: d,
|
|
7984
|
-
onChange: (
|
|
8189
|
+
onChange: (w) => u(w.target.value),
|
|
7985
8190
|
onKeyDown: B,
|
|
7986
8191
|
placeholder: "Value",
|
|
7987
8192
|
className: "bg-background text-sm"
|
|
@@ -7994,22 +8199,22 @@ const AIUserPrompt = ({ blockId: o }) => {
|
|
|
7994
8199
|
]
|
|
7995
8200
|
}
|
|
7996
8201
|
),
|
|
7997
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "mt-4 space-y-1 overflow-y-auto", children: a.map((
|
|
8202
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "mt-4 space-y-1 overflow-y-auto", children: a.map((w, A) => /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center justify-between rounded bg-muted p-1.5 text-sm", children: [
|
|
7998
8203
|
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "mr-2 flex flex-col", children: [
|
|
7999
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "truncate font-semibold", children:
|
|
8000
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-wrap max-w-[200px] text-muted-foreground", children:
|
|
8204
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "truncate font-semibold", children: w.key }),
|
|
8205
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-wrap max-w-[200px] text-muted-foreground", children: w.value.toString() })
|
|
8001
8206
|
] }),
|
|
8002
8207
|
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex-shrink-0", children: [
|
|
8003
|
-
/* @__PURE__ */ jsxRuntimeExports.jsxs(Button, { variant: "ghost", size: "icon", className: "h-6 w-6", onClick: () => v(
|
|
8208
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs(Button, { variant: "ghost", size: "icon", className: "h-6 w-6", onClick: () => v(A), children: [
|
|
8004
8209
|
/* @__PURE__ */ jsxRuntimeExports.jsx(Edit2, { className: "h-3 w-3" }),
|
|
8005
8210
|
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "sr-only", children: "Edit attribute" })
|
|
8006
8211
|
] }),
|
|
8007
|
-
/* @__PURE__ */ jsxRuntimeExports.jsxs(Button, { variant: "ghost", size: "icon", className: "h-6 w-6", onClick: () =>
|
|
8212
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs(Button, { variant: "ghost", size: "icon", className: "h-6 w-6", onClick: () => _(A), children: [
|
|
8008
8213
|
/* @__PURE__ */ jsxRuntimeExports.jsx(X, { className: "h-3 w-3" }),
|
|
8009
8214
|
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "sr-only", children: "Remove attribute" })
|
|
8010
8215
|
] })
|
|
8011
8216
|
] })
|
|
8012
|
-
] },
|
|
8217
|
+
] }, A)) })
|
|
8013
8218
|
] });
|
|
8014
8219
|
}), BlockAttributesEditor = React.memo(() => {
|
|
8015
8220
|
const o = useSelectedBlock(), [n, r] = useState([]), [a] = useSelectedStylingBlocks(), l = useUpdateBlocksProps(), i = `${get(a, "0.prop")}_attrs`;
|
|
@@ -8194,221 +8399,42 @@ const TabletIcon = ({ landscape: o = !1 }) => /* @__PURE__ */ jsxRuntimeExports.
|
|
|
8194
8399
|
] })
|
|
8195
8400
|
] })
|
|
8196
8401
|
] }) });
|
|
8197
|
-
}, LANGUAGES = {
|
|
8198
|
-
ab: "Abkhazian",
|
|
8199
|
-
aa: "Afar",
|
|
8200
|
-
af: "Afrikaans",
|
|
8201
|
-
ak: "Akan",
|
|
8202
|
-
sq: "Albanian",
|
|
8203
|
-
am: "Amharic",
|
|
8204
|
-
ar: "Arabic",
|
|
8205
|
-
an: "Aragonese",
|
|
8206
|
-
hy: "Armenian",
|
|
8207
|
-
as: "Assamese",
|
|
8208
|
-
av: "Avaric",
|
|
8209
|
-
ae: "Avestan",
|
|
8210
|
-
ay: "Aymara",
|
|
8211
|
-
az: "Azerbaijani",
|
|
8212
|
-
bm: "Bambara",
|
|
8213
|
-
ba: "Bashkir",
|
|
8214
|
-
eu: "Basque",
|
|
8215
|
-
be: "Belarusian",
|
|
8216
|
-
bn: "Bengali",
|
|
8217
|
-
bh: "Bihari",
|
|
8218
|
-
bi: "Bislama",
|
|
8219
|
-
bs: "Bosnian",
|
|
8220
|
-
br: "Breton",
|
|
8221
|
-
bg: "Bulgarian",
|
|
8222
|
-
my: "Burmese",
|
|
8223
|
-
ca: "Catalan",
|
|
8224
|
-
ch: "Chamorro",
|
|
8225
|
-
ce: "Chechen",
|
|
8226
|
-
ny: "Chichewa",
|
|
8227
|
-
zh: "Chinese",
|
|
8228
|
-
"zh-Hans": "Chinese (Simplified)",
|
|
8229
|
-
"zh-Hant": "Chinese (Traditional)",
|
|
8230
|
-
cv: "Chuvash",
|
|
8231
|
-
kw: "Cornish",
|
|
8232
|
-
co: "Corsican",
|
|
8233
|
-
cr: "Cree",
|
|
8234
|
-
hr: "Croatian",
|
|
8235
|
-
cs: "Czech",
|
|
8236
|
-
da: "Danish",
|
|
8237
|
-
dv: "Maldivian",
|
|
8238
|
-
nl: "Dutch",
|
|
8239
|
-
dz: "Dzongkha",
|
|
8240
|
-
en: "English",
|
|
8241
|
-
eo: "Esperanto",
|
|
8242
|
-
et: "Estonian",
|
|
8243
|
-
ee: "Ewe",
|
|
8244
|
-
fo: "Faroese",
|
|
8245
|
-
fj: "Fijian",
|
|
8246
|
-
fi: "Finnish",
|
|
8247
|
-
fr: "French",
|
|
8248
|
-
ff: "Fula, Pular",
|
|
8249
|
-
gl: "Galician",
|
|
8250
|
-
gd: "Gaelic (Scottish)",
|
|
8251
|
-
gv: "Manx",
|
|
8252
|
-
ka: "Georgian",
|
|
8253
|
-
de: "German",
|
|
8254
|
-
el: "Greek",
|
|
8255
|
-
kl: "Kalaallisut",
|
|
8256
|
-
gn: "Guarani",
|
|
8257
|
-
gu: "Gujarati",
|
|
8258
|
-
ht: "Haitian Creole",
|
|
8259
|
-
ha: "Hausa",
|
|
8260
|
-
he: "Hebrew",
|
|
8261
|
-
hz: "Herero",
|
|
8262
|
-
hi: "Hindi",
|
|
8263
|
-
ho: "Hiri Motu",
|
|
8264
|
-
hu: "Hungarian",
|
|
8265
|
-
is: "Icelandic",
|
|
8266
|
-
io: "Ido",
|
|
8267
|
-
ig: "Igbo",
|
|
8268
|
-
id: "Indonesian",
|
|
8269
|
-
ia: "Interlingua",
|
|
8270
|
-
ie: "Interlingue",
|
|
8271
|
-
iu: "Inuktitut",
|
|
8272
|
-
ik: "Inupiak",
|
|
8273
|
-
ga: "Irish",
|
|
8274
|
-
it: "Italian",
|
|
8275
|
-
ja: "Japanese",
|
|
8276
|
-
jv: "Javanese",
|
|
8277
|
-
kn: "Kannada",
|
|
8278
|
-
kr: "Kanuri",
|
|
8279
|
-
ks: "Kashmiri",
|
|
8280
|
-
kk: "Kazakh",
|
|
8281
|
-
km: "Khmer",
|
|
8282
|
-
ki: "Kikuyu",
|
|
8283
|
-
rw: "Kinyarwanda",
|
|
8284
|
-
rn: "Kirundi",
|
|
8285
|
-
ky: "Kyrgyz",
|
|
8286
|
-
kv: "Komi",
|
|
8287
|
-
kg: "Kongo",
|
|
8288
|
-
ko: "Korean",
|
|
8289
|
-
ku: "Kurdish",
|
|
8290
|
-
kj: "Kwanyama",
|
|
8291
|
-
lo: "Lao",
|
|
8292
|
-
la: "Latin",
|
|
8293
|
-
lv: "Latvian",
|
|
8294
|
-
li: "Limburgish",
|
|
8295
|
-
ln: "Lingala",
|
|
8296
|
-
lt: "Lithuanian",
|
|
8297
|
-
lu: "Luga-Katanga",
|
|
8298
|
-
lg: "Luganda, Ganda",
|
|
8299
|
-
lb: "Luxembourgish",
|
|
8300
|
-
mk: "Macedonian",
|
|
8301
|
-
mg: "Malagasy",
|
|
8302
|
-
ms: "Malay",
|
|
8303
|
-
ml: "Malayalam",
|
|
8304
|
-
mt: "Maltese",
|
|
8305
|
-
mi: "Maori",
|
|
8306
|
-
mr: "Marathi",
|
|
8307
|
-
mh: "Marshallese",
|
|
8308
|
-
mo: "Moldavian",
|
|
8309
|
-
mn: "Mongolian",
|
|
8310
|
-
na: "Nauru",
|
|
8311
|
-
nv: "Navajo",
|
|
8312
|
-
ng: "Ndonga",
|
|
8313
|
-
nd: "Northern Ndebele",
|
|
8314
|
-
ne: "Nepali",
|
|
8315
|
-
no: "Norwegian",
|
|
8316
|
-
nb: "Norwegian bokmål",
|
|
8317
|
-
nn: "Norwegian nynorsk",
|
|
8318
|
-
ii: "Sichuan Yi",
|
|
8319
|
-
oc: "Occitan",
|
|
8320
|
-
oj: "Ojibwe",
|
|
8321
|
-
cu: "Old Church Slavonic",
|
|
8322
|
-
or: "Oriya",
|
|
8323
|
-
om: "Oromo",
|
|
8324
|
-
os: "Ossetian",
|
|
8325
|
-
pi: "Pāli",
|
|
8326
|
-
ps: "Pashto, Pushto",
|
|
8327
|
-
fa: "Persian (Farsi)",
|
|
8328
|
-
pl: "Polish",
|
|
8329
|
-
pt: "Portuguese",
|
|
8330
|
-
pa: "Punjabi (Eastern)",
|
|
8331
|
-
qu: "Quechua",
|
|
8332
|
-
rm: "Romansh",
|
|
8333
|
-
ro: "Romanian",
|
|
8334
|
-
ru: "Russian",
|
|
8335
|
-
se: "Sami",
|
|
8336
|
-
sm: "Samoan",
|
|
8337
|
-
sg: "Sango",
|
|
8338
|
-
sa: "Sanskrit",
|
|
8339
|
-
sr: "Serbian",
|
|
8340
|
-
sh: "Serbo-Croatian",
|
|
8341
|
-
st: "Sesotho",
|
|
8342
|
-
tn: "Setswana",
|
|
8343
|
-
sn: "Shona",
|
|
8344
|
-
sd: "Sindhi",
|
|
8345
|
-
si: "Sinhalese",
|
|
8346
|
-
ss: "Swati",
|
|
8347
|
-
sk: "Slovak",
|
|
8348
|
-
sl: "Slovenian",
|
|
8349
|
-
so: "Somali",
|
|
8350
|
-
nr: "Southern Ndebele",
|
|
8351
|
-
es: "Spanish",
|
|
8352
|
-
su: "Sundanese",
|
|
8353
|
-
sw: "Swahili (Kiswahili)",
|
|
8354
|
-
sv: "Swedish",
|
|
8355
|
-
tl: "Tagalog",
|
|
8356
|
-
ty: "Tahitian",
|
|
8357
|
-
tg: "Tajik",
|
|
8358
|
-
ta: "Tamil",
|
|
8359
|
-
tt: "Tatar",
|
|
8360
|
-
te: "Telugu",
|
|
8361
|
-
th: "Thai",
|
|
8362
|
-
bo: "Tibetan",
|
|
8363
|
-
ti: "Tigrinya",
|
|
8364
|
-
to: "Tonga",
|
|
8365
|
-
ts: "Tsonga",
|
|
8366
|
-
tr: "Turkish",
|
|
8367
|
-
tk: "Turkmen",
|
|
8368
|
-
tw: "Twi",
|
|
8369
|
-
ug: "Uyghur",
|
|
8370
|
-
uk: "Ukrainian",
|
|
8371
|
-
ur: "Urdu",
|
|
8372
|
-
uz: "Uzbek",
|
|
8373
|
-
ve: "Venda",
|
|
8374
|
-
vi: "Vietnamese",
|
|
8375
|
-
vo: "Volapük",
|
|
8376
|
-
wa: "Wallon",
|
|
8377
|
-
cy: "Welsh",
|
|
8378
|
-
wo: "Wolof",
|
|
8379
|
-
fy: "Western Frisian",
|
|
8380
|
-
xh: "Xhosa",
|
|
8381
|
-
yi: "Yiddish",
|
|
8382
|
-
yo: "Yoruba",
|
|
8383
|
-
za: "Zhuang, Chuang",
|
|
8384
|
-
zu: "Zulu"
|
|
8385
8402
|
}, LanguageSelector = () => {
|
|
8386
8403
|
const { fallbackLang: o, languages: n, selectedLang: r, setSelectedLang: a } = useLanguages(), l = (r == null ? void 0 : r.length) > 0 ? r : o, i = useMemo(() => {
|
|
8387
8404
|
const c = [];
|
|
8388
|
-
return forEach(uniq([...n
|
|
8405
|
+
return forEach(uniq([o, ...n]), (d) => {
|
|
8389
8406
|
const u = get(LANGUAGES, d);
|
|
8390
8407
|
u && c.push({ key: d, value: u, default: d === o });
|
|
8391
8408
|
}), c;
|
|
8392
8409
|
}, [o, n]);
|
|
8393
|
-
return isEmpty(n) ? /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center gap-x-1 text-sm", children: [
|
|
8394
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
8395
|
-
get(LANGUAGES, l)
|
|
8396
|
-
l === o && /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "h-full pl-1 text-[10px] leading-4 text-green-400", children: "Default" })
|
|
8410
|
+
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: [
|
|
8411
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(FaLanguage, { className: "h-4 w-4" }),
|
|
8412
|
+
get(LANGUAGES, l)
|
|
8397
8413
|
] }) : /* @__PURE__ */ jsxRuntimeExports.jsxs(DropdownMenu, { children: [
|
|
8398
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(DropdownMenuTrigger, { asChild: !0, children: /* @__PURE__ */ jsxRuntimeExports.jsxs(Button, { size: "sm", variant: "
|
|
8399
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
8400
|
-
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-
|
|
8414
|
+
/* @__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: [
|
|
8415
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(FaLanguage, { className: "h-4 w-4" }),
|
|
8416
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center space-x-2", children: [
|
|
8401
8417
|
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
|
|
8402
8418
|
" ",
|
|
8403
8419
|
get(LANGUAGES, l)
|
|
8404
8420
|
] }),
|
|
8405
|
-
|
|
8421
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(ChevronDownIcon, { className: "h-4 w-4" })
|
|
8406
8422
|
] })
|
|
8407
8423
|
] }) }),
|
|
8408
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(DropdownMenuContent, { children: map(i, (c) => /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
8409
|
-
|
|
8410
|
-
|
|
8411
|
-
|
|
8424
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(DropdownMenuContent, { className: "border-border", children: map(i, (c) => /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
8425
|
+
DropdownMenuItem,
|
|
8426
|
+
{
|
|
8427
|
+
className: cn(
|
|
8428
|
+
"flex cursor-pointer items-center text-sm",
|
|
8429
|
+
c.key === l && "!bg-blue-500 text-white hover:!text-white"
|
|
8430
|
+
),
|
|
8431
|
+
onClick: () => a(c.key),
|
|
8432
|
+
children: [
|
|
8433
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: c.value }),
|
|
8434
|
+
c.key === o ? /* @__PURE__ */ jsxRuntimeExports.jsx(FaStar, { className: "ml-2 h-4 w-4 text-yellow-400" }) : null
|
|
8435
|
+
]
|
|
8436
|
+
}
|
|
8437
|
+
)) })
|
|
8412
8438
|
] });
|
|
8413
8439
|
}, CanvasTopBar = () => {
|
|
8414
8440
|
const o = useBuilderProp("darkMode", !0), [n] = useCanvasZoom();
|
|
@@ -8650,10 +8676,10 @@ const PageDataProviders = () => {
|
|
|
8650
8676
|
n.map((f) => map(i, "providerKey").includes(f.providerKey) ? null : { value: f.providerKey, label: f.name }),
|
|
8651
8677
|
(f) => !isNull(f)
|
|
8652
8678
|
), g = (f) => {
|
|
8653
|
-
const
|
|
8654
|
-
c((v) => [...v,
|
|
8679
|
+
const _ = find(n, { providerKey: f });
|
|
8680
|
+
c((v) => [...v, _]), a((v) => [...v, { providerKey: _.providerKey, args: {} }]), u(""), l("UNSAVED");
|
|
8655
8681
|
}, E = (f) => {
|
|
8656
|
-
c((
|
|
8682
|
+
c((_) => filter(_, (v) => v.providerKey !== f.providerKey)), a((_) => filter(_, (v) => v.providerKey !== f.providerKey)), l("UNSAVED");
|
|
8657
8683
|
}, j = (f) => m(f);
|
|
8658
8684
|
return isEmpty(n) ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: /* @__PURE__ */ jsxRuntimeExports.jsxs("p", { className: "mb-1.5 p-4 text-xs text-gray-500", children: [
|
|
8659
8685
|
o("no_data_providers"),
|
|
@@ -8750,7 +8776,7 @@ const PageDataProviders = () => {
|
|
|
8750
8776
|
function AiFillDatabase(o) {
|
|
8751
8777
|
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);
|
|
8752
8778
|
}
|
|
8753
|
-
const TopBar = lazy(() => import("./Topbar-
|
|
8779
|
+
const TopBar = lazy(() => import("./Topbar-21XY-_r9.js"));
|
|
8754
8780
|
function useSidebarMenuItems(o) {
|
|
8755
8781
|
const n = o === "SINGLE_SIDE_PANEL", { t: r } = useTranslation(), a = useBuilderProp("dataBindingSupport", !1), l = useBuilderProp("askAiCallBack", null);
|
|
8756
8782
|
return useMemo(() => {
|