@chaibuilder/sdk 1.2.109 → 1.2.110-beta.1
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-lKbkdWrD.js → CodeEditor-jyFoM1d1.js} +2 -2
- package/dist/{CodeEditor-heJvLZrQ.cjs → CodeEditor-rOhqnKcT.cjs} +1 -1
- package/dist/Topbar-SKKQMjc1.cjs +1 -0
- package/dist/Topbar-ehvnRhOq.js +163 -0
- package/dist/{UnsplashImages-nAe1gyu9.js → UnsplashImages-Oq4_5Ihm.js} +10 -13
- package/dist/{UnsplashImages-8r1JNyap.cjs → UnsplashImages-uAq-YtFi.cjs} +1 -1
- package/dist/{UploadImages-Vws49f38.cjs → UploadImages-UlHrI-EQ.cjs} +1 -1
- package/dist/{UploadImages-PygaZXFU.js → UploadImages-zxbjgQf7.js} +2 -2
- package/dist/{context-menu-YGd09SE1.js → context-menu-FPX89OKr.js} +72 -72
- package/dist/core.cjs +1 -1
- package/dist/core.js +5 -5
- package/dist/index-T33KMBT2.cjs +63 -0
- package/dist/{index-OhF0-tfj.js → index-qV5P0VmO.js} +763 -740
- package/dist/ui.js +2 -2
- package/package.json +1 -1
- package/dist/Topbar-lJgYu8sz.js +0 -124
- package/dist/Topbar-mnYBenY0.cjs +0 -1
- package/dist/index-0rfWW4hY.cjs +0 -63
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
var z = Object.defineProperty;
|
|
2
2
|
var W = (o, n, r) => n in o ? z(o, n, { enumerable: !0, configurable: !0, writable: !0, value: r }) : o[n] = r;
|
|
3
|
-
var
|
|
3
|
+
var F = (o, n, r) => (W(o, typeof n != "symbol" ? n + "" : n, r), r);
|
|
4
4
|
import { j as jsxRuntimeExports } from "./jsx-runtime-Sp0orL4X.js";
|
|
5
5
|
import * as React from "react";
|
|
6
6
|
import React__default, { createContext, useReducer, useEffect, useDebugValue, useCallback, useContext, useState, useMemo, Component, Children, Suspense, useRef, memo, createElement, lazy } from "react";
|
|
7
|
-
import {
|
|
7
|
+
import { aq as Skeleton, B as Button, aA as ContextMenu, aB as ContextMenuTrigger, aC as ContextMenuContent, aD as ContextMenuItem, N as Tooltip, O as TooltipTrigger, P as TooltipContent, C as Card, x as CardHeader, E as CardDescription, F as CardContent, L as Label, T as Textarea, y as CardFooter, D as Dialog, r as DialogTrigger, s as DialogContent, t as DialogHeader, v as DialogTitle, w as DialogDescription, u as DialogFooter, U as Popover, V as PopoverTrigger, W as PopoverContent, ar as Command, at as CommandInput, au as CommandList, av as CommandEmpty, aw as CommandGroup, ax as CommandItem, H as Tabs, J as TabsList, K as TabsTrigger, M as TabsContent, a as Switch, A as Accordion, d as AccordionItem, e as AccordionTrigger, f as AccordionContent, an as useToast, I as Input$1, R as TooltipPortal, a6 as DropdownMenu, a7 as DropdownMenuTrigger, a8 as DropdownMenuContent, S as ScrollArea, ac as DropdownMenuLabel, ad as DropdownMenuSeparator, af as DropdownMenuGroup, a9 as DropdownMenuItem, ae as DropdownMenuShortcut, i as AlertDialog, k as AlertDialogContent, l as AlertDialogHeader, n as AlertDialogTitle, j as AlertDialogTrigger, o as AlertDialogDescription, m as AlertDialogFooter, q as AlertDialogCancel, p as AlertDialogAction, aa as DropdownMenuCheckboxItem, X as HoverCard, Y as HoverCardTrigger, Z as HoverCardContent, al as Separator, g as Badge, _ as Select$1, a1 as SelectTrigger, a0 as SelectValue, a2 as SelectContent, a4 as SelectItem, Q as TooltipProvider, ap as Toaster } from "./context-menu-FPX89OKr.js";
|
|
8
8
|
import { has, find, filter, flatten, map, omit, isString as isString$1, includes, without, get, compact, set, endsWith, isEmpty, forIn, isObject as isObject$1, each, first, noop, merge, keys, startsWith, range, values, flattenDeep, isNull, pick, sortBy, memoize, forEach, unset, chunk, throttle, cloneDeep, reverse, debounce, flatMapDeep, capitalize, last, startCase, truncate, isArray as isArray$1, split, toLower, reject, nth, isNumber as isNumber$1, parseInt as parseInt$1, isNaN as isNaN$1, findLast, intersection, groupBy, isFunction as isFunction$1, uniq, toUpper, round } from "lodash-es";
|
|
9
9
|
import { atom as atom$1, useAtomValue as useAtomValue$1, useAtom as useAtom$1, useSetAtom as useSetAtom$1, getDefaultStore as getDefaultStore$1 } from "jotai";
|
|
10
10
|
import { g as generateUUID, a as getBreakpointValue, c as cn, G as GenIcon } from "./iconBase-Ief2hJUZ.js";
|
|
@@ -19,9 +19,9 @@ import { useFeature, FlagsProvider } from "flagged";
|
|
|
19
19
|
import { useHotkeys } from "react-hotkeys-hook";
|
|
20
20
|
import { flip } from "@floating-ui/dom";
|
|
21
21
|
import { useFloating, shift } from "@floating-ui/react-dom";
|
|
22
|
-
import { ArrowUpIcon, PlusIcon, CopyIcon, GearIcon, TrashIcon, DragHandleDots2Icon, BoxModelIcon, BoxIcon, DragHandleHorizontalIcon, ViewHorizontalIcon, BorderAllIcon, BorderTopIcon, TableIcon, DropdownMenuIcon, RadiobuttonIcon, InputIcon, ButtonIcon, CheckboxIcon, GroupIcon, SpaceBetweenVerticallyIcon, ColumnsIcon, RowsIcon, TextIcon, SketchLogoIcon, DividerHorizontalIcon, CodeIcon, CursorTextIcon, VideoIcon, Link1Icon, HeadingIcon, ImageIcon, CardStackPlusIcon, CardStackIcon, ScissorsIcon, TriangleRightIcon, EyeOpenIcon, Cross2Icon, EyeClosedIcon, WidthIcon, HeightIcon, ArrowRightIcon, ArrowDownIcon, ArrowLeftIcon, ArrowTopLeftIcon, ArrowTopRightIcon, ArrowBottomRightIcon, ArrowBottomLeftIcon, AlignLeftIcon, AlignCenterHorizontallyIcon, AlignRightIcon, StretchHorizontallyIcon, FontItalicIcon, UnderlineIcon, OverlineIcon, LetterCaseUppercaseIcon, Cross1Icon, InfoCircledIcon, MinusIcon, TriangleDownIcon, RowSpacingIcon, CrossCircledIcon, CaretDownIcon, CaretRightIcon, CheckIcon, ResetIcon, SunIcon, DotsVerticalIcon, MobileIcon, LaptopIcon, DesktopIcon, EraserIcon,
|
|
22
|
+
import { ArrowUpIcon, PlusIcon, CopyIcon, GearIcon, TrashIcon, DragHandleDots2Icon, BoxModelIcon, BoxIcon, DragHandleHorizontalIcon, ViewHorizontalIcon, BorderAllIcon, BorderTopIcon, TableIcon, DropdownMenuIcon, RadiobuttonIcon, InputIcon, ButtonIcon, CheckboxIcon, GroupIcon, SpaceBetweenVerticallyIcon, ColumnsIcon, RowsIcon, TextIcon, SketchLogoIcon, DividerHorizontalIcon, CodeIcon, CursorTextIcon, VideoIcon, Link1Icon, HeadingIcon, ImageIcon, CardStackPlusIcon, CardStackIcon, ScissorsIcon, TriangleRightIcon, EyeOpenIcon, Cross2Icon, EyeClosedIcon, WidthIcon, HeightIcon, ArrowRightIcon, ArrowDownIcon, ArrowLeftIcon, ArrowTopLeftIcon, ArrowTopRightIcon, ArrowBottomRightIcon, ArrowBottomLeftIcon, AlignLeftIcon, AlignCenterHorizontallyIcon, AlignRightIcon, StretchHorizontallyIcon, FontItalicIcon, UnderlineIcon, OverlineIcon, LetterCaseUppercaseIcon, Cross1Icon, InfoCircledIcon, MinusIcon, TriangleDownIcon, RowSpacingIcon, CrossCircledIcon, CaretDownIcon, CaretRightIcon, CheckIcon, ResetIcon, SunIcon, DotsVerticalIcon, MobileIcon, LaptopIcon, DesktopIcon, EraserIcon, ZoomInIcon, MixerHorizontalIcon, KeyboardIcon, LightningBoltIcon } from "@radix-ui/react-icons";
|
|
23
23
|
import { createEvent } from "react-event-hook";
|
|
24
|
-
import typography
|
|
24
|
+
import typography from "@tailwindcss/typography";
|
|
25
25
|
import forms from "@tailwindcss/forms";
|
|
26
26
|
import aspectRatio from "@tailwindcss/aspect-ratio";
|
|
27
27
|
import { twMerge } from "tailwind-merge";
|
|
@@ -32,7 +32,7 @@ import { ErrorBoundary } from "react-error-boundary";
|
|
|
32
32
|
import { Resizable } from "re-resizable";
|
|
33
33
|
import { DatabaseIcon, GlobeIcon, ChevronRight, PlusIcon as PlusIcon$1, EyeOff, EditIcon, TrashIcon as TrashIcon$1, Check, Loader, SparklesIcon, SmileIcon, ShuffleIcon, ChevronDown, Edit2, X, LayoutTemplate, Layers, PaintBucketIcon } from "lucide-react";
|
|
34
34
|
import validator from "@rjsf/validator-ajv8";
|
|
35
|
-
import Form from "@rjsf/core";
|
|
35
|
+
import Form$1 from "@rjsf/core";
|
|
36
36
|
import { y, s as s$1, h } from "./controls-lEwMTdPQ.js";
|
|
37
37
|
import { Tree } from "react-arborist";
|
|
38
38
|
import { parse, stringify } from "himalaya";
|
|
@@ -91,235 +91,235 @@ const hasInitialValue = (o) => "init" in o, isActuallyWritableAtom = (o) => !!o.
|
|
|
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
92
|
const c = (f) => o.get(f), d = (f, v) => {
|
|
93
93
|
(define_import_meta_env_default$2 ? "production" : void 0) !== "production" && Object.freeze(v);
|
|
94
|
-
const
|
|
95
|
-
if (o.set(f, v), r.has(f) || r.set(f,
|
|
96
|
-
const
|
|
97
|
-
cancelPromise(
|
|
94
|
+
const w = o.get(f);
|
|
95
|
+
if (o.set(f, v), r.has(f) || r.set(f, w), w && hasPromiseAtomValue(w)) {
|
|
96
|
+
const A = "v" in v ? v.v instanceof Promise ? v.v : Promise.resolve(v.v) : Promise.reject(v.e);
|
|
97
|
+
cancelPromise(w.v, A);
|
|
98
98
|
}
|
|
99
|
-
}, u = (f, v,
|
|
100
|
-
const
|
|
99
|
+
}, u = (f, v, w) => {
|
|
100
|
+
const A = /* @__PURE__ */ new Map();
|
|
101
101
|
let I = !1;
|
|
102
|
-
|
|
103
|
-
!
|
|
104
|
-
}), (I || v.d.size !==
|
|
105
|
-
}, p = (f, v,
|
|
106
|
-
const
|
|
107
|
-
d: (
|
|
102
|
+
w.forEach((T, D) => {
|
|
103
|
+
!T && D === f && (T = v), T ? (A.set(D, T), v.d.get(D) !== T && (I = !0)) : (define_import_meta_env_default$2 ? "production" : void 0) !== "production" && console.warn("[Bug] atom state not found");
|
|
104
|
+
}), (I || v.d.size !== A.size) && (v.d = A);
|
|
105
|
+
}, p = (f, v, w) => {
|
|
106
|
+
const A = c(f), I = {
|
|
107
|
+
d: (A == null ? void 0 : A.d) || /* @__PURE__ */ new Map(),
|
|
108
108
|
v
|
|
109
109
|
};
|
|
110
|
-
if (
|
|
111
|
-
return
|
|
112
|
-
if (
|
|
113
|
-
if (
|
|
114
|
-
return
|
|
115
|
-
I.v =
|
|
110
|
+
if (w && u(f, I, w), A && isEqualAtomValue(A, I) && A.d === I.d)
|
|
111
|
+
return A;
|
|
112
|
+
if (A && hasPromiseAtomValue(A) && hasPromiseAtomValue(I) && isEqualPromiseAtomValue(A, I)) {
|
|
113
|
+
if (A.d === I.d)
|
|
114
|
+
return A;
|
|
115
|
+
I.v = A.v;
|
|
116
116
|
}
|
|
117
117
|
return d(f, I), I;
|
|
118
|
-
}, m = (f, v,
|
|
118
|
+
}, m = (f, v, w, A) => {
|
|
119
119
|
if (isPromiseLike$2(v)) {
|
|
120
120
|
let I;
|
|
121
|
-
const
|
|
121
|
+
const T = new Promise((D, O) => {
|
|
122
122
|
let M = !1;
|
|
123
123
|
v.then(
|
|
124
|
-
(
|
|
124
|
+
(V) => {
|
|
125
125
|
if (!M) {
|
|
126
126
|
M = !0;
|
|
127
127
|
const $ = c(f), H = p(
|
|
128
128
|
f,
|
|
129
|
-
|
|
130
|
-
|
|
129
|
+
T,
|
|
130
|
+
w
|
|
131
131
|
);
|
|
132
|
-
resolvePromise(
|
|
132
|
+
resolvePromise(T, V), D(V), ($ == null ? void 0 : $.d) !== H.d && N(f, H, $ == null ? void 0 : $.d);
|
|
133
133
|
}
|
|
134
134
|
},
|
|
135
|
-
(
|
|
135
|
+
(V) => {
|
|
136
136
|
if (!M) {
|
|
137
137
|
M = !0;
|
|
138
138
|
const $ = c(f), H = p(
|
|
139
139
|
f,
|
|
140
|
-
|
|
141
|
-
|
|
140
|
+
T,
|
|
141
|
+
w
|
|
142
142
|
);
|
|
143
|
-
rejectPromise(
|
|
143
|
+
rejectPromise(T, V), O(V), ($ == null ? void 0 : $.d) !== H.d && N(f, H, $ == null ? void 0 : $.d);
|
|
144
144
|
}
|
|
145
145
|
}
|
|
146
|
-
), I = (
|
|
147
|
-
M || (M = !0,
|
|
148
|
-
($) => resolvePromise(
|
|
149
|
-
($) => rejectPromise(
|
|
150
|
-
), D(
|
|
146
|
+
), I = (V) => {
|
|
147
|
+
M || (M = !0, V.then(
|
|
148
|
+
($) => resolvePromise(T, $),
|
|
149
|
+
($) => rejectPromise(T, $)
|
|
150
|
+
), D(V));
|
|
151
151
|
};
|
|
152
152
|
});
|
|
153
|
-
return
|
|
154
|
-
D && I(D),
|
|
155
|
-
}), p(f,
|
|
153
|
+
return T.orig = v, T.status = "pending", registerCancelPromise(T, (D) => {
|
|
154
|
+
D && I(D), A == null || A();
|
|
155
|
+
}), p(f, T, w);
|
|
156
156
|
}
|
|
157
|
-
return p(f, v,
|
|
158
|
-
}, g = (f, v,
|
|
159
|
-
const
|
|
160
|
-
d: (
|
|
157
|
+
return p(f, v, w);
|
|
158
|
+
}, g = (f, v, w) => {
|
|
159
|
+
const A = c(f), I = {
|
|
160
|
+
d: (A == null ? void 0 : A.d) || /* @__PURE__ */ new Map(),
|
|
161
161
|
e: v
|
|
162
162
|
};
|
|
163
|
-
return
|
|
163
|
+
return w && u(f, I, w), A && isEqualAtomError(A, I) && A.d === I.d ? A : (d(f, I), I);
|
|
164
164
|
}, x = (f) => {
|
|
165
165
|
const v = c(f);
|
|
166
|
-
if (v && (v.d.forEach((M,
|
|
167
|
-
|
|
168
|
-
}), Array.from(v.d).every(([M,
|
|
166
|
+
if (v && (v.d.forEach((M, V) => {
|
|
167
|
+
V !== f && !n.has(V) && x(V);
|
|
168
|
+
}), Array.from(v.d).every(([M, V]) => {
|
|
169
169
|
const $ = c(M);
|
|
170
|
-
return M === f || $ ===
|
|
171
|
-
$ && !hasPromiseAtomValue($) && isEqualAtomValue($,
|
|
170
|
+
return M === f || $ === V || // TODO This is a hack, we should find a better solution.
|
|
171
|
+
$ && !hasPromiseAtomValue($) && isEqualAtomValue($, V);
|
|
172
172
|
})))
|
|
173
173
|
return v;
|
|
174
|
-
const
|
|
175
|
-
let
|
|
174
|
+
const w = /* @__PURE__ */ new Map();
|
|
175
|
+
let A = !0;
|
|
176
176
|
const I = (M) => {
|
|
177
177
|
if (M === f) {
|
|
178
178
|
const $ = c(M);
|
|
179
179
|
if ($)
|
|
180
|
-
return
|
|
180
|
+
return w.set(M, $), returnAtomValue($);
|
|
181
181
|
if (hasInitialValue(M))
|
|
182
|
-
return
|
|
182
|
+
return w.set(M, void 0), M.init;
|
|
183
183
|
throw new Error("no atom init");
|
|
184
184
|
}
|
|
185
|
-
const
|
|
186
|
-
return
|
|
185
|
+
const V = x(M);
|
|
186
|
+
return w.set(M, V), returnAtomValue(V);
|
|
187
187
|
};
|
|
188
|
-
let
|
|
189
|
-
const
|
|
188
|
+
let T, D;
|
|
189
|
+
const O = {
|
|
190
190
|
get signal() {
|
|
191
|
-
return
|
|
191
|
+
return T || (T = new AbortController()), T.signal;
|
|
192
192
|
},
|
|
193
193
|
get setSelf() {
|
|
194
194
|
return (define_import_meta_env_default$2 ? "production" : void 0) !== "production" && !isActuallyWritableAtom(f) && console.warn("setSelf function cannot be used with read-only atom"), !D && isActuallyWritableAtom(f) && (D = (...M) => {
|
|
195
|
-
if ((define_import_meta_env_default$2 ? "production" : void 0) !== "production" &&
|
|
196
|
-
return
|
|
195
|
+
if ((define_import_meta_env_default$2 ? "production" : void 0) !== "production" && A && console.warn("setSelf function cannot be called in sync"), !A)
|
|
196
|
+
return _(f, ...M);
|
|
197
197
|
}), D;
|
|
198
198
|
}
|
|
199
199
|
};
|
|
200
200
|
try {
|
|
201
|
-
const M = f.read(I,
|
|
201
|
+
const M = f.read(I, O);
|
|
202
202
|
return m(
|
|
203
203
|
f,
|
|
204
204
|
M,
|
|
205
|
-
|
|
206
|
-
() =>
|
|
205
|
+
w,
|
|
206
|
+
() => T == null ? void 0 : T.abort()
|
|
207
207
|
);
|
|
208
208
|
} catch (M) {
|
|
209
|
-
return g(f, M,
|
|
209
|
+
return g(f, M, w);
|
|
210
210
|
} finally {
|
|
211
|
-
|
|
211
|
+
A = !1;
|
|
212
212
|
}
|
|
213
213
|
}, j = (f) => returnAtomValue(x(f)), E = (f) => {
|
|
214
214
|
let v = n.get(f);
|
|
215
|
-
return v || (v =
|
|
215
|
+
return v || (v = C(f)), v;
|
|
216
216
|
}, b = (f, v) => !v.l.size && (!v.t.size || v.t.size === 1 && v.t.has(f)), k = (f) => {
|
|
217
217
|
const v = n.get(f);
|
|
218
|
-
v && b(f, v) &&
|
|
219
|
-
},
|
|
220
|
-
const v = /* @__PURE__ */ new Map(),
|
|
221
|
-
const D = n.get(
|
|
222
|
-
D == null || D.t.forEach((
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
(v.get(
|
|
226
|
-
),
|
|
218
|
+
v && b(f, v) && B(f);
|
|
219
|
+
}, S = (f) => {
|
|
220
|
+
const v = /* @__PURE__ */ new Map(), w = /* @__PURE__ */ new WeakMap(), A = (T) => {
|
|
221
|
+
const D = n.get(T);
|
|
222
|
+
D == null || D.t.forEach((O) => {
|
|
223
|
+
O !== T && (v.set(
|
|
224
|
+
O,
|
|
225
|
+
(v.get(O) || /* @__PURE__ */ new Set()).add(T)
|
|
226
|
+
), w.set(O, (w.get(O) || 0) + 1), A(O));
|
|
227
227
|
});
|
|
228
228
|
};
|
|
229
|
-
|
|
230
|
-
const I = (
|
|
231
|
-
const D = n.get(
|
|
232
|
-
D == null || D.t.forEach((
|
|
229
|
+
A(f);
|
|
230
|
+
const I = (T) => {
|
|
231
|
+
const D = n.get(T);
|
|
232
|
+
D == null || D.t.forEach((O) => {
|
|
233
233
|
var M;
|
|
234
|
-
if (
|
|
235
|
-
let
|
|
236
|
-
if (
|
|
237
|
-
let $ = !!((M = v.get(
|
|
234
|
+
if (O !== T) {
|
|
235
|
+
let V = w.get(O);
|
|
236
|
+
if (V && w.set(O, --V), !V) {
|
|
237
|
+
let $ = !!((M = v.get(O)) != null && M.size);
|
|
238
238
|
if ($) {
|
|
239
|
-
const H = c(
|
|
240
|
-
$ = !H || !isEqualAtomValue(H,
|
|
239
|
+
const H = c(O), U = x(O);
|
|
240
|
+
$ = !H || !isEqualAtomValue(H, U);
|
|
241
241
|
}
|
|
242
|
-
$ || v.forEach((H) => H.delete(
|
|
242
|
+
$ || v.forEach((H) => H.delete(O));
|
|
243
243
|
}
|
|
244
|
-
I(
|
|
244
|
+
I(O);
|
|
245
245
|
}
|
|
246
246
|
});
|
|
247
247
|
};
|
|
248
248
|
I(f);
|
|
249
|
-
},
|
|
250
|
-
let
|
|
251
|
-
const
|
|
249
|
+
}, R = (f, ...v) => {
|
|
250
|
+
let w = !0;
|
|
251
|
+
const A = (D) => returnAtomValue(x(D)), I = (D, ...O) => {
|
|
252
252
|
let M;
|
|
253
253
|
if (D === f) {
|
|
254
254
|
if (!hasInitialValue(D))
|
|
255
255
|
throw new Error("atom not writable");
|
|
256
|
-
const
|
|
257
|
-
(!
|
|
256
|
+
const V = c(D), $ = m(D, O[0]);
|
|
257
|
+
(!V || !isEqualAtomValue(V, $)) && S(D);
|
|
258
258
|
} else
|
|
259
|
-
M =
|
|
260
|
-
if (!
|
|
261
|
-
const
|
|
259
|
+
M = R(D, ...O);
|
|
260
|
+
if (!w) {
|
|
261
|
+
const V = L();
|
|
262
262
|
(define_import_meta_env_default$2 ? "production" : void 0) !== "production" && l.forEach(
|
|
263
|
-
($) => $({ type: "async-write", flushed:
|
|
263
|
+
($) => $({ type: "async-write", flushed: V })
|
|
264
264
|
);
|
|
265
265
|
}
|
|
266
266
|
return M;
|
|
267
|
-
},
|
|
268
|
-
return
|
|
269
|
-
},
|
|
270
|
-
const
|
|
267
|
+
}, T = f.write(A, I, ...v);
|
|
268
|
+
return w = !1, T;
|
|
269
|
+
}, _ = (f, ...v) => {
|
|
270
|
+
const w = R(f, ...v), A = L();
|
|
271
271
|
return (define_import_meta_env_default$2 ? "production" : void 0) !== "production" && l.forEach(
|
|
272
|
-
(I) => I({ type: "write", flushed:
|
|
273
|
-
),
|
|
274
|
-
},
|
|
275
|
-
const
|
|
272
|
+
(I) => I({ type: "write", flushed: A })
|
|
273
|
+
), w;
|
|
274
|
+
}, C = (f, v) => {
|
|
275
|
+
const w = {
|
|
276
276
|
t: new Set(v && [v]),
|
|
277
277
|
l: /* @__PURE__ */ new Set()
|
|
278
278
|
};
|
|
279
|
-
if (n.set(f,
|
|
280
|
-
const
|
|
281
|
-
|
|
279
|
+
if (n.set(f, w), (define_import_meta_env_default$2 ? "production" : void 0) !== "production" && i.add(f), x(f).d.forEach((A, I) => {
|
|
280
|
+
const T = n.get(I);
|
|
281
|
+
T ? T.t.add(f) : I !== f && C(I, f);
|
|
282
282
|
}), x(f), isActuallyWritableAtom(f) && f.onMount) {
|
|
283
|
-
const
|
|
284
|
-
|
|
283
|
+
const A = f.onMount((...I) => _(f, ...I));
|
|
284
|
+
A && (w.u = A);
|
|
285
285
|
}
|
|
286
|
-
return
|
|
287
|
-
},
|
|
286
|
+
return w;
|
|
287
|
+
}, B = (f) => {
|
|
288
288
|
var v;
|
|
289
|
-
const
|
|
290
|
-
|
|
291
|
-
const
|
|
292
|
-
|
|
293
|
-
if (
|
|
294
|
-
const D = n.get(
|
|
295
|
-
D && (D.t.delete(f), b(
|
|
289
|
+
const w = (v = n.get(f)) == null ? void 0 : v.u;
|
|
290
|
+
w && w(), n.delete(f), (define_import_meta_env_default$2 ? "production" : void 0) !== "production" && i.delete(f);
|
|
291
|
+
const A = c(f);
|
|
292
|
+
A ? (hasPromiseAtomValue(A) && cancelPromise(A.v), A.d.forEach((I, T) => {
|
|
293
|
+
if (T !== f) {
|
|
294
|
+
const D = n.get(T);
|
|
295
|
+
D && (D.t.delete(f), b(T, D) && B(T));
|
|
296
296
|
}
|
|
297
297
|
})) : (define_import_meta_env_default$2 ? "production" : void 0) !== "production" && console.warn("[Bug] could not find atom state to unmount", f);
|
|
298
|
-
},
|
|
299
|
-
const
|
|
300
|
-
|
|
301
|
-
if (
|
|
302
|
-
|
|
298
|
+
}, N = (f, v, w) => {
|
|
299
|
+
const A = new Set(v.d.keys());
|
|
300
|
+
w == null || w.forEach((I, T) => {
|
|
301
|
+
if (A.has(T)) {
|
|
302
|
+
A.delete(T);
|
|
303
303
|
return;
|
|
304
304
|
}
|
|
305
|
-
const D = n.get(
|
|
306
|
-
D && (D.t.delete(f), b(
|
|
307
|
-
}),
|
|
308
|
-
const
|
|
309
|
-
|
|
305
|
+
const D = n.get(T);
|
|
306
|
+
D && (D.t.delete(f), b(T, D) && B(T));
|
|
307
|
+
}), A.forEach((I) => {
|
|
308
|
+
const T = n.get(I);
|
|
309
|
+
T ? T.t.add(f) : n.has(f) && C(I, f);
|
|
310
310
|
});
|
|
311
311
|
}, L = () => {
|
|
312
312
|
let f;
|
|
313
313
|
for ((define_import_meta_env_default$2 ? "production" : void 0) !== "production" && (f = /* @__PURE__ */ new Set()); r.size; ) {
|
|
314
314
|
const v = Array.from(r);
|
|
315
|
-
r.clear(), v.forEach(([
|
|
316
|
-
const I = c(
|
|
315
|
+
r.clear(), v.forEach(([w, A]) => {
|
|
316
|
+
const I = c(w);
|
|
317
317
|
if (I) {
|
|
318
|
-
I.d !== (
|
|
319
|
-
const
|
|
320
|
-
|
|
318
|
+
I.d !== (A == null ? void 0 : A.d) && N(w, I, A == null ? void 0 : A.d);
|
|
319
|
+
const T = n.get(w);
|
|
320
|
+
T && !// TODO This seems pretty hacky. Hope to fix it.
|
|
321
321
|
// Maybe we could `mountDependencies` in `setAtomState`?
|
|
322
|
-
(
|
|
322
|
+
(A && !hasPromiseAtomValue(A) && (isEqualAtomValue(A, I) || isEqualAtomError(A, I))) && (T.l.forEach((D) => D()), (define_import_meta_env_default$2 ? "production" : void 0) !== "production" && f.add(w));
|
|
323
323
|
} else
|
|
324
324
|
(define_import_meta_env_default$2 ? "production" : void 0) !== "production" && console.warn("[Bug] no atom state to flush");
|
|
325
325
|
});
|
|
@@ -327,16 +327,16 @@ const hasInitialValue = (o) => "init" in o, isActuallyWritableAtom = (o) => !!o.
|
|
|
327
327
|
if ((define_import_meta_env_default$2 ? "production" : void 0) !== "production")
|
|
328
328
|
return a.forEach((v) => v("state")), f;
|
|
329
329
|
}, P = (f, v) => {
|
|
330
|
-
const
|
|
331
|
-
return I.add(v), (define_import_meta_env_default$2 ? "production" : void 0) !== "production" && (a.forEach((
|
|
332
|
-
(
|
|
330
|
+
const w = E(f), A = L(), I = w.l;
|
|
331
|
+
return I.add(v), (define_import_meta_env_default$2 ? "production" : void 0) !== "production" && (a.forEach((T) => T("sub")), l.forEach(
|
|
332
|
+
(T) => T({ type: "sub", flushed: A })
|
|
333
333
|
)), () => {
|
|
334
|
-
I.delete(v), k(f), (define_import_meta_env_default$2 ? "production" : void 0) !== "production" && (a.forEach((
|
|
334
|
+
I.delete(v), k(f), (define_import_meta_env_default$2 ? "production" : void 0) !== "production" && (a.forEach((T) => T("unsub")), l.forEach((T) => T({ type: "unsub" })));
|
|
335
335
|
};
|
|
336
336
|
};
|
|
337
337
|
return (define_import_meta_env_default$2 ? "production" : void 0) !== "production" ? {
|
|
338
338
|
get: j,
|
|
339
|
-
set:
|
|
339
|
+
set: _,
|
|
340
340
|
sub: P,
|
|
341
341
|
// store dev methods (these are tentative and subject to change without notice)
|
|
342
342
|
dev_subscribe_store: (f, v) => v !== 2 ? (console.warn(
|
|
@@ -350,16 +350,16 @@ const hasInitialValue = (o) => "init" in o, isActuallyWritableAtom = (o) => !!o.
|
|
|
350
350
|
dev_get_atom_state: (f) => o.get(f),
|
|
351
351
|
dev_get_mounted: (f) => n.get(f),
|
|
352
352
|
dev_restore_atoms: (f) => {
|
|
353
|
-
for (const [
|
|
354
|
-
hasInitialValue(
|
|
353
|
+
for (const [w, A] of f)
|
|
354
|
+
hasInitialValue(w) && (m(w, A), S(w));
|
|
355
355
|
const v = L();
|
|
356
356
|
l.forEach(
|
|
357
|
-
(
|
|
357
|
+
(w) => w({ type: "restore", flushed: v })
|
|
358
358
|
);
|
|
359
359
|
}
|
|
360
360
|
} : {
|
|
361
361
|
get: j,
|
|
362
|
-
set:
|
|
362
|
+
set: _,
|
|
363
363
|
sub: P
|
|
364
364
|
};
|
|
365
365
|
};
|
|
@@ -386,27 +386,27 @@ function splitAtom(o, n) {
|
|
|
386
386
|
m[j] = b;
|
|
387
387
|
return;
|
|
388
388
|
}
|
|
389
|
-
const k = (
|
|
390
|
-
const
|
|
391
|
-
if (
|
|
389
|
+
const k = (R) => {
|
|
390
|
+
const _ = R(l), C = R(o), N = a(C, _ == null ? void 0 : _.arr).keyList.indexOf(E);
|
|
391
|
+
if (N < 0 || N >= C.length) {
|
|
392
392
|
const L = c[a(c).keyList.indexOf(E)];
|
|
393
393
|
if (L)
|
|
394
394
|
return L;
|
|
395
395
|
throw new Error("splitAtom: index out of bounds for read");
|
|
396
396
|
}
|
|
397
|
-
return
|
|
398
|
-
},
|
|
399
|
-
const
|
|
400
|
-
if (P < 0 || P >=
|
|
397
|
+
return C[N];
|
|
398
|
+
}, S = (R, _, C) => {
|
|
399
|
+
const B = R(l), N = R(o), P = a(N, B == null ? void 0 : B.arr).keyList.indexOf(E);
|
|
400
|
+
if (P < 0 || P >= N.length)
|
|
401
401
|
throw new Error("splitAtom: index out of bounds for write");
|
|
402
|
-
const f = isFunction(
|
|
403
|
-
|
|
404
|
-
...
|
|
402
|
+
const f = isFunction(C) ? C(N[P]) : C;
|
|
403
|
+
_(o, [
|
|
404
|
+
...N.slice(0, P),
|
|
405
405
|
f,
|
|
406
|
-
...
|
|
406
|
+
...N.slice(P + 1)
|
|
407
407
|
]);
|
|
408
408
|
};
|
|
409
|
-
m[j] = isWritable(o) ? atom(k,
|
|
409
|
+
m[j] = isWritable(o) ? atom(k, S) : atom(k);
|
|
410
410
|
}), p && p.keyList.length === g.length && p.keyList.every((x, j) => x === g[j]) ? u = p : u = { arr: c, atomList: m, keyList: g }, r.set(c, u), u;
|
|
411
411
|
}, l = atom((c) => {
|
|
412
412
|
const d = c(l), u = c(o);
|
|
@@ -1196,13 +1196,13 @@ const useBlocksStoreManager = () => {
|
|
|
1196
1196
|
} = useBlocksStoreManager();
|
|
1197
1197
|
return {
|
|
1198
1198
|
moveBlocks: (E, b, k) => {
|
|
1199
|
-
const
|
|
1200
|
-
const
|
|
1201
|
-
return { _id:
|
|
1202
|
-
}),
|
|
1203
|
-
|
|
1204
|
-
undo: () => each(
|
|
1205
|
-
i([
|
|
1199
|
+
const S = map(E, (_) => {
|
|
1200
|
+
const B = n.find((P) => P._id === _)._parent || null, L = n.filter((P) => B ? P._parent === B : !P._parent).map((P) => P._id).indexOf(_);
|
|
1201
|
+
return { _id: _, oldParent: B, oldPosition: L };
|
|
1202
|
+
}), R = S.find(({ _id: _ }) => _ === E[0]);
|
|
1203
|
+
R && R.oldParent === b && R.oldPosition === k || (i(E, b, k), o({
|
|
1204
|
+
undo: () => each(S, ({ _id: _, oldParent: C, oldPosition: B }) => {
|
|
1205
|
+
i([_], C, B);
|
|
1206
1206
|
}),
|
|
1207
1207
|
redo: () => i(E, b, k)
|
|
1208
1208
|
}));
|
|
@@ -1214,27 +1214,27 @@ const useBlocksStoreManager = () => {
|
|
|
1214
1214
|
});
|
|
1215
1215
|
},
|
|
1216
1216
|
removeBlocks: (E) => {
|
|
1217
|
-
var
|
|
1218
|
-
const b = (
|
|
1217
|
+
var R;
|
|
1218
|
+
const b = (R = first(E)) == null ? void 0 : R._parent, S = n.filter((_) => b ? _._parent === b : !_._parent).indexOf(first(E));
|
|
1219
1219
|
l(map(E, "_id")), o({
|
|
1220
|
-
undo: () => a(E, b,
|
|
1220
|
+
undo: () => a(E, b, S),
|
|
1221
1221
|
redo: () => l(map(E, "_id"))
|
|
1222
1222
|
});
|
|
1223
1223
|
},
|
|
1224
1224
|
updateBlocks: (E, b, k) => {
|
|
1225
|
-
let
|
|
1225
|
+
let S = [];
|
|
1226
1226
|
if (k)
|
|
1227
|
-
|
|
1227
|
+
S = map(E, (R) => ({ _id: R, ...k }));
|
|
1228
1228
|
else {
|
|
1229
|
-
const
|
|
1230
|
-
|
|
1231
|
-
const
|
|
1232
|
-
return each(
|
|
1229
|
+
const R = keys(b);
|
|
1230
|
+
S = map(E, (_) => {
|
|
1231
|
+
const C = n.find((N) => N._id === _), B = { _id: _ };
|
|
1232
|
+
return each(R, (N) => B[N] = C[N]), B;
|
|
1233
1233
|
});
|
|
1234
1234
|
}
|
|
1235
|
-
c(map(E, (
|
|
1236
|
-
undo: () => c(
|
|
1237
|
-
redo: () => c(map(E, (
|
|
1235
|
+
c(map(E, (R) => ({ _id: R, ...b }))), o({
|
|
1236
|
+
undo: () => c(S),
|
|
1237
|
+
redo: () => c(map(E, (R) => ({ _id: R, ...b })))
|
|
1238
1238
|
});
|
|
1239
1239
|
},
|
|
1240
1240
|
updateBlocksRuntime: (E, b) => {
|
|
@@ -1249,8 +1249,8 @@ const useBlocksStoreManager = () => {
|
|
|
1249
1249
|
updateMultipleBlocksProps: (E) => {
|
|
1250
1250
|
let b = [];
|
|
1251
1251
|
b = map(E, (k) => {
|
|
1252
|
-
const
|
|
1253
|
-
return each(
|
|
1252
|
+
const S = keys(k), R = n.find((C) => C._id === k._id), _ = {};
|
|
1253
|
+
return each(S, (C) => _[C] = R[C]), _;
|
|
1254
1254
|
}), c(E), o({
|
|
1255
1255
|
undo: () => c(b),
|
|
1256
1256
|
redo: () => c(E)
|
|
@@ -1281,16 +1281,16 @@ const useBlocksStoreManager = () => {
|
|
|
1281
1281
|
return a(k, c, d);
|
|
1282
1282
|
}
|
|
1283
1283
|
const u = generateUUID(), p = getBlockDefaultProps(i.props), m = [];
|
|
1284
|
-
forIn(p, (k,
|
|
1284
|
+
forIn(p, (k, S) => {
|
|
1285
1285
|
if (startsWith(k, SLOT_KEY)) {
|
|
1286
|
-
const
|
|
1286
|
+
const R = k.replace(SLOT_KEY, "");
|
|
1287
1287
|
m.push({
|
|
1288
|
-
_id:
|
|
1288
|
+
_id: R,
|
|
1289
1289
|
_type: "Slot",
|
|
1290
1290
|
_parent: u,
|
|
1291
|
-
_name: i.props[
|
|
1292
|
-
_styles: i.props[
|
|
1293
|
-
_emptyStyles: i.props[
|
|
1291
|
+
_name: i.props[S].name,
|
|
1292
|
+
_styles: i.props[S].styles,
|
|
1293
|
+
_emptyStyles: i.props[S].emptyStyles
|
|
1294
1294
|
});
|
|
1295
1295
|
}
|
|
1296
1296
|
});
|
|
@@ -2918,7 +2918,7 @@ class Content extends Component {
|
|
|
2918
2918
|
return Children.only(this.props.children);
|
|
2919
2919
|
}
|
|
2920
2920
|
}
|
|
2921
|
-
|
|
2921
|
+
F(Content, "propTypes", {
|
|
2922
2922
|
children: PropTypes.element.isRequired,
|
|
2923
2923
|
contentDidMount: PropTypes.func.isRequired,
|
|
2924
2924
|
contentDidUpdate: PropTypes.func.isRequired
|
|
@@ -2926,17 +2926,17 @@ U(Content, "propTypes", {
|
|
|
2926
2926
|
class Frame extends Component {
|
|
2927
2927
|
constructor(r, a) {
|
|
2928
2928
|
super(r, a);
|
|
2929
|
-
|
|
2929
|
+
F(this, "setRef", (r) => {
|
|
2930
2930
|
this.nodeRef.current = r;
|
|
2931
2931
|
const { forwardedRef: a } = this.props;
|
|
2932
2932
|
typeof a == "function" ? a(r) : a && (a.current = r);
|
|
2933
2933
|
});
|
|
2934
|
-
|
|
2934
|
+
F(this, "handleLoad", () => {
|
|
2935
2935
|
clearInterval(this.loadCheck), this.state.iframeLoaded || this.setState({ iframeLoaded: !0 });
|
|
2936
2936
|
});
|
|
2937
2937
|
// In certain situations on a cold cache DOMContentLoaded never gets called
|
|
2938
2938
|
// fallback to an interval to check if that's the case
|
|
2939
|
-
|
|
2939
|
+
F(this, "loadCheck", () => setInterval(() => {
|
|
2940
2940
|
this.handleLoad();
|
|
2941
2941
|
}, 500));
|
|
2942
2942
|
this._isMounted = !1, this.nodeRef = React__default.createRef(), this.state = { iframeLoaded: !1 };
|
|
@@ -2977,7 +2977,7 @@ class Frame extends Component {
|
|
|
2977
2977
|
// also inject into the body and can mess up React. For this reason
|
|
2978
2978
|
// initialContent is expected to have a div inside of the body
|
|
2979
2979
|
// element that we render react into.
|
|
2980
|
-
|
|
2980
|
+
F(Frame, "propTypes", {
|
|
2981
2981
|
style: PropTypes.object,
|
|
2982
2982
|
// eslint-disable-line
|
|
2983
2983
|
head: PropTypes.node,
|
|
@@ -2987,7 +2987,7 @@ U(Frame, "propTypes", {
|
|
|
2987
2987
|
contentDidMount: PropTypes.func,
|
|
2988
2988
|
contentDidUpdate: PropTypes.func,
|
|
2989
2989
|
children: PropTypes.oneOfType([PropTypes.element, PropTypes.arrayOf(PropTypes.element)])
|
|
2990
|
-
}),
|
|
2990
|
+
}), F(Frame, "defaultProps", {
|
|
2991
2991
|
style: {},
|
|
2992
2992
|
head: null,
|
|
2993
2993
|
children: void 0,
|
|
@@ -3074,20 +3074,20 @@ const useDnd = () => {
|
|
|
3074
3074
|
x.preventDefault(), x.stopPropagation(), throttledDragOver(x);
|
|
3075
3075
|
},
|
|
3076
3076
|
onDrop: (x) => {
|
|
3077
|
-
var
|
|
3078
|
-
const j = dropTarget, b = getOrientation(j) === "vertical" ? x.clientY + ((
|
|
3077
|
+
var C;
|
|
3078
|
+
const j = dropTarget, b = getOrientation(j) === "vertical" ? x.clientY + ((C = iframeDocument == null ? void 0 : iframeDocument.defaultView) == null ? void 0 : C.scrollY) : x.clientX;
|
|
3079
3079
|
dropIndex = calculateDropIndex(b, possiblePositions);
|
|
3080
|
-
const k = d,
|
|
3081
|
-
if ((k == null ? void 0 : k._id) ===
|
|
3080
|
+
const k = d, S = j.getAttribute("data-block-id"), R = dropTarget.getAttribute("data-dnd-dragged") !== "yes";
|
|
3081
|
+
if ((k == null ? void 0 : k._id) === S || !R) {
|
|
3082
3082
|
g();
|
|
3083
3083
|
return;
|
|
3084
3084
|
}
|
|
3085
3085
|
if (!has(k, "_id")) {
|
|
3086
|
-
a(k,
|
|
3086
|
+
a(k, S === "canvas" ? null : S, dropIndex), setTimeout(g, 300);
|
|
3087
3087
|
return;
|
|
3088
3088
|
}
|
|
3089
|
-
let
|
|
3090
|
-
|
|
3089
|
+
let _ = j.getAttribute("data-block-id");
|
|
3090
|
+
_ === null && (_ = x.target.parentElement.getAttribute("data-block-id")), c([k._id], _ === "canvas" ? null : _, dropIndex), g(), setTimeout(removePlaceholder, 300);
|
|
3091
3091
|
},
|
|
3092
3092
|
onDragEnter: (x) => {
|
|
3093
3093
|
const j = x, E = j.target;
|
|
@@ -3314,17 +3314,17 @@ const useHandleCanvasDblClick = () => {
|
|
|
3314
3314
|
}, [r, c]);
|
|
3315
3315
|
const x = get(o, "headingFont", "DM Sans"), j = get(o, "bodyFont", "DM Sans");
|
|
3316
3316
|
return useEffect(() => {
|
|
3317
|
-
const E = get(o, "primaryColor", "#000"), b = get(o, "secondaryColor", "#FFF"), k = get(o, "bodyBgLightColor", "#fff"),
|
|
3317
|
+
const E = get(o, "primaryColor", "#000"), b = get(o, "secondaryColor", "#FFF"), k = get(o, "bodyBgLightColor", "#fff"), S = get(o, "bodyBgDarkColor", "#000"), R = get(o, "bodyTextDarkColor", "#000"), _ = get(o, "bodyTextLightColor", "#fff"), C = s({
|
|
3318
3318
|
colors: [E, b],
|
|
3319
3319
|
names: ["primary", "secondary"]
|
|
3320
3320
|
});
|
|
3321
|
-
set(
|
|
3322
|
-
const
|
|
3321
|
+
set(C, "primary.DEFAULT", E), set(C, "secondary.DEFAULT", b);
|
|
3322
|
+
const B = {
|
|
3323
3323
|
"bg-light": k,
|
|
3324
|
-
"bg-dark":
|
|
3325
|
-
"text-dark":
|
|
3326
|
-
"text-light":
|
|
3327
|
-
},
|
|
3324
|
+
"bg-dark": S,
|
|
3325
|
+
"text-dark": R,
|
|
3326
|
+
"text-light": _
|
|
3327
|
+
}, N = get(o, "roundedCorners", "0");
|
|
3328
3328
|
!d || !d.tailwind || (d.tailwind.config = {
|
|
3329
3329
|
darkMode: "class",
|
|
3330
3330
|
theme: {
|
|
@@ -3341,13 +3341,13 @@ const useHandleCanvasDblClick = () => {
|
|
|
3341
3341
|
body: [j]
|
|
3342
3342
|
},
|
|
3343
3343
|
borderRadius: {
|
|
3344
|
-
DEFAULT: `${
|
|
3344
|
+
DEFAULT: `${N || "0"}px`
|
|
3345
3345
|
},
|
|
3346
|
-
colors: { ...
|
|
3346
|
+
colors: { ...B, ...C }
|
|
3347
3347
|
}
|
|
3348
3348
|
},
|
|
3349
3349
|
plugins: [
|
|
3350
|
-
typography
|
|
3350
|
+
typography,
|
|
3351
3351
|
forms,
|
|
3352
3352
|
aspectRatio,
|
|
3353
3353
|
plugin(function({ addBase: L, theme: P }) {
|
|
@@ -3505,9 +3505,9 @@ function applyLanguage(o, n, r) {
|
|
|
3505
3505
|
}
|
|
3506
3506
|
function BlocksRendererStatic({ blocks: o, allBlocks: n }) {
|
|
3507
3507
|
const { selectedLang: r } = useLanguages(), [a] = useAtom$1(xShowBlocksAtom), [l] = useCutBlockIds(), [i] = useAtom$1(draggedBlockAtom), [c] = useAtom$1(dropTargetBlockIdAtom), [, d] = useCanvasWidth(), [u] = useCanvasSettings(), [p] = useHiddenBlockIds(), { getGlobalBlocks: m } = useGlobalBlocksStore(), g = useCallback((b) => getStyleAttrs(b, d), [d]), [x] = useChaiExternalData(), [j] = useAtom$1(inlineEditingActiveAtom), E = useCallback(
|
|
3508
|
-
(b) => b.reduce((k,
|
|
3509
|
-
const
|
|
3510
|
-
return { ...k, ...
|
|
3508
|
+
(b) => b.reduce((k, S) => {
|
|
3509
|
+
const R = get(u, S, {});
|
|
3510
|
+
return { ...k, ...R };
|
|
3511
3511
|
}, {}),
|
|
3512
3512
|
[u]
|
|
3513
3513
|
);
|
|
@@ -3515,15 +3515,15 @@ function BlocksRendererStatic({ blocks: o, allBlocks: n }) {
|
|
|
3515
3515
|
o.map((b, k) => {
|
|
3516
3516
|
if (j === b._id || p.includes(b._id))
|
|
3517
3517
|
return null;
|
|
3518
|
-
const
|
|
3519
|
-
if (
|
|
3520
|
-
const
|
|
3521
|
-
|
|
3518
|
+
const S = {}, R = filter(n, { _parent: b._id });
|
|
3519
|
+
if (S.children = R.length > 0 ? /* @__PURE__ */ jsxRuntimeExports.jsx(BlocksRendererStatic, { allBlocks: n, blocks: R }) : null, b._type === "GlobalBlock") {
|
|
3520
|
+
const w = m(b);
|
|
3521
|
+
S.children = /* @__PURE__ */ jsxRuntimeExports.jsx(RenderGlobalBlock, { blocks: filter(w, (A) => !A._parent), allBlocks: w });
|
|
3522
3522
|
}
|
|
3523
|
-
const
|
|
3524
|
-
if (isNull(
|
|
3523
|
+
const _ = getBlockComponent(b._type), C = get(_, "server", !1), B = C ? RSCBlock : get(_, "builderComponent", get(_, "component", null));
|
|
3524
|
+
if (isNull(B))
|
|
3525
3525
|
return /* @__PURE__ */ jsxRuntimeExports.jsx("noscript", { children: `<!-- ${b == null ? void 0 : b._type} not registered -->` });
|
|
3526
|
-
const
|
|
3526
|
+
const N = has(_, "getBlockStateFrom") ? _ == null ? void 0 : _.getBlockStateFrom(b, n) : [], L = E(N), P = g(b);
|
|
3527
3527
|
if (get(P, "__isHidden", !1) && !includes(a, b._id))
|
|
3528
3528
|
return null;
|
|
3529
3529
|
const f = i && isDescendant(i._id, b._id, n), v = {
|
|
@@ -3540,12 +3540,12 @@ function BlocksRendererStatic({ blocks: o, allBlocks: n }) {
|
|
|
3540
3540
|
...c === b._id && !f ? { "data-drop": "yes" } : {},
|
|
3541
3541
|
...includes(l, b._id) ? { "data-cut-block": "yes" } : {}
|
|
3542
3542
|
};
|
|
3543
|
-
return
|
|
3543
|
+
return C ? /* @__PURE__ */ jsxRuntimeExports.jsx(RSCBlock, { block: b, blockProps: v }) : /* @__PURE__ */ jsxRuntimeExports.jsx(Suspense, { children: React__default.createElement(B, {
|
|
3544
3544
|
blockProps: v,
|
|
3545
3545
|
index: k,
|
|
3546
|
-
...applyBindings(applyLanguage(b, r,
|
|
3546
|
+
...applyBindings(applyLanguage(b, r, _), x),
|
|
3547
3547
|
...omit(P, ["__isHidden"]),
|
|
3548
|
-
...
|
|
3548
|
+
...S,
|
|
3549
3549
|
inBuilder: !0,
|
|
3550
3550
|
blockState: L
|
|
3551
3551
|
}) });
|
|
@@ -3579,61 +3579,65 @@ const useAllDataProviders = () => useMemo(() => getChaiDataProviders(), []), Blo
|
|
|
3579
3579
|
className: "mt-1 block w-full rounded-md bg-gray-100 p-2 text-black hover:bg-gray-200 dark:bg-gray-700 dark:text-white dark:hover:bg-gray-700",
|
|
3580
3580
|
children: [
|
|
3581
3581
|
"+ ",
|
|
3582
|
-
o("
|
|
3582
|
+
o("Add block")
|
|
3583
3583
|
]
|
|
3584
3584
|
}
|
|
3585
3585
|
);
|
|
3586
3586
|
}, ResizableCanvasWrapper = ({ children: o, onMount: n, onResize: r }) => {
|
|
3587
|
-
const a = useRef(null),
|
|
3587
|
+
const [, a] = useSelectedBlockIds(), [, l] = useSelectedStylingBlocks(), i = useRef(null), c = useDebouncedCallback(
|
|
3588
3588
|
() => {
|
|
3589
|
-
const { clientWidth:
|
|
3590
|
-
r(
|
|
3589
|
+
const { clientWidth: u } = i.current;
|
|
3590
|
+
r(u);
|
|
3591
3591
|
},
|
|
3592
|
-
[
|
|
3592
|
+
[i.current],
|
|
3593
3593
|
100
|
|
3594
3594
|
);
|
|
3595
|
-
|
|
3596
|
-
const { clientWidth:
|
|
3597
|
-
n(
|
|
3598
|
-
}, [])
|
|
3595
|
+
useResizeObserver(i.current, c, i.current !== null), useEffect(() => {
|
|
3596
|
+
const { clientWidth: u } = i.current;
|
|
3597
|
+
n(u);
|
|
3598
|
+
}, []);
|
|
3599
|
+
const d = () => {
|
|
3600
|
+
a([]), l([]);
|
|
3601
|
+
};
|
|
3602
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { id: "main-content", onClick: d, className: "h-full w-full p-8 pb-0", ref: i, children: o });
|
|
3599
3603
|
}, getElementByStyleId = (o, n) => o.querySelector(`[data-style-id="${n}"]`), StaticCanvas = () => {
|
|
3600
|
-
const [o] = useAtom$1(networkModeAtom), [n] = useCanvasWidth(), [, r] = useSelectedBlockIds(), a = useSelectedBlock(), [, l] = useHighlightBlockId(), i = useRef(null), c = useRef(null), [d, u] = useState({ width: 0, height: 0 }), p = useCanvasScale(d), [m, g] = useState([]), [, x] = useState([]), [, j] = useAtom$1(canvasIframeAtom), [E, b] = useSelectedStylingBlocks(), k = useBuilderProp("loading", !1),
|
|
3601
|
-
u((
|
|
3604
|
+
const [o] = useAtom$1(networkModeAtom), [n] = useCanvasWidth(), [, r] = useSelectedBlockIds(), a = useSelectedBlock(), [, l] = useHighlightBlockId(), i = useRef(null), c = useRef(null), [d, u] = useState({ width: 0, height: 0 }), p = useCanvasScale(d), [m, g] = useState([]), [, x] = useState([]), [, j] = useAtom$1(canvasIframeAtom), [E, b] = useSelectedStylingBlocks(), k = useBuilderProp("loading", !1), S = useBuilderProp("htmlDir", "ltr"), R = (B) => {
|
|
3605
|
+
u((N) => ({ ...N, width: B }));
|
|
3602
3606
|
};
|
|
3603
3607
|
useEffect(() => {
|
|
3604
3608
|
if (!c.current)
|
|
3605
3609
|
return;
|
|
3606
|
-
const { clientWidth:
|
|
3607
|
-
u({ width:
|
|
3610
|
+
const { clientWidth: B, clientHeight: N } = c.current;
|
|
3611
|
+
u({ width: B, height: N });
|
|
3608
3612
|
}, [c, n]);
|
|
3609
|
-
const
|
|
3610
|
-
const { top: L } =
|
|
3611
|
-
return L +
|
|
3613
|
+
const _ = (B, N = 0) => {
|
|
3614
|
+
const { top: L } = B.getBoundingClientRect();
|
|
3615
|
+
return L + N >= 0 && L - N <= window.innerHeight;
|
|
3612
3616
|
};
|
|
3613
3617
|
useEffect(() => {
|
|
3614
|
-
var
|
|
3618
|
+
var B, N;
|
|
3615
3619
|
if (a && a.type !== "Multiple" && i.current) {
|
|
3616
3620
|
const L = getElementByDataBlockId(i.current.contentDocument, a._id);
|
|
3617
|
-
L && (
|
|
3621
|
+
L && (_(L) || (N = (B = i.current) == null ? void 0 : B.contentWindow) == null || N.scrollTo({ top: L.offsetTop, behavior: "smooth" }), g([L]));
|
|
3618
3622
|
}
|
|
3619
3623
|
}, [a]), useEffect(() => {
|
|
3620
3624
|
if (!isEmpty(E) && i.current) {
|
|
3621
|
-
const
|
|
3625
|
+
const B = getElementByStyleId(
|
|
3622
3626
|
i.current.contentDocument,
|
|
3623
3627
|
first(E).id
|
|
3624
3628
|
);
|
|
3625
|
-
x(
|
|
3629
|
+
x(B ? [B] : [null]);
|
|
3626
3630
|
} else
|
|
3627
3631
|
x([null]);
|
|
3628
3632
|
}, [E]);
|
|
3629
|
-
const
|
|
3630
|
-
let
|
|
3631
|
-
return
|
|
3633
|
+
const C = useMemo(() => {
|
|
3634
|
+
let B = IframeInitialContent;
|
|
3635
|
+
return B = B.replace("__HTML_DIR__", S), o === "offline" && (B = B.replace(
|
|
3632
3636
|
"https://old.chaibuilder.com/offline/tailwind.cdn.js",
|
|
3633
3637
|
"/offline/tailwind.cdn.js"
|
|
3634
|
-
),
|
|
3635
|
-
}, [o,
|
|
3636
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx(ResizableCanvasWrapper, { onMount:
|
|
3638
|
+
), B = B.replace("https://unpkg.com/aos@next/dist/aos.css", "/offline/aos.css"), B = B.replace("https://unpkg.com/aos@next/dist/aos.js", "/offline/aos.js")), B;
|
|
3639
|
+
}, [o, S]);
|
|
3640
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(ResizableCanvasWrapper, { onMount: R, onResize: R, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
3637
3641
|
"div",
|
|
3638
3642
|
{
|
|
3639
3643
|
onClick: () => {
|
|
@@ -3650,7 +3654,7 @@ const useAllDataProviders = () => useMemo(() => getChaiDataProviders(), []), Blo
|
|
|
3650
3654
|
id: "canvas-iframe",
|
|
3651
3655
|
style: { ...p, ...isEmpty(p) ? { width: `${n}px` } : {} },
|
|
3652
3656
|
className: "relative mx-auto box-content h-full w-full max-w-full shadow-lg transition-all duration-300 ease-linear",
|
|
3653
|
-
initialContent:
|
|
3657
|
+
initialContent: C,
|
|
3654
3658
|
children: [
|
|
3655
3659
|
/* @__PURE__ */ jsxRuntimeExports.jsx(KeyboardHandler, {}),
|
|
3656
3660
|
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
@@ -3773,7 +3777,7 @@ const useAllDataProviders = () => useMemo(() => getChaiDataProviders(), []), Blo
|
|
|
3773
3777
|
l !== o.length - 1 && /* @__PURE__ */ jsxRuntimeExports.jsx(ChevronRight, { className: "rtl:rotate-180", size: 16 })
|
|
3774
3778
|
] }, l))
|
|
3775
3779
|
] }) });
|
|
3776
|
-
}, CodeEditor$1 = React__default.lazy(() => import("./CodeEditor-
|
|
3780
|
+
}, CodeEditor$1 = React__default.lazy(() => import("./CodeEditor-jyFoM1d1.js")), CanvasArea = () => {
|
|
3777
3781
|
const [o] = useCodeEditor(), n = useBuilderProp("onError", noop);
|
|
3778
3782
|
return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex h-full max-h-full w-full flex-1 flex-col", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "relative flex h-full max-h-full flex-col overflow-hidden bg-gray-100/40 px-2", children: [
|
|
3779
3783
|
/* @__PURE__ */ jsxRuntimeExports.jsx(Suspense, { fallback: /* @__PURE__ */ jsxRuntimeExports.jsx(Skeleton, { className: "h-full" }), children: /* @__PURE__ */ jsxRuntimeExports.jsx(ErrorBoundary, { fallback: /* @__PURE__ */ jsxRuntimeExports.jsx(FallbackError, {}), onError: n, children: /* @__PURE__ */ jsxRuntimeExports.jsx(StaticCanvas$1, {}) }) }),
|
|
@@ -3848,8 +3852,8 @@ const useAllDataProviders = () => useMemo(() => getChaiDataProviders(), []), Blo
|
|
|
3848
3852
|
showHeading: o = !0,
|
|
3849
3853
|
className: n = ""
|
|
3850
3854
|
}) => {
|
|
3851
|
-
const [r, a] = useBrandingOptions(), [l] = useBlocksContainer(), i = React.useRef(r), { t: c } = useTranslation(), d = ({ formData:
|
|
3852
|
-
|
|
3855
|
+
const [r, a] = useBrandingOptions(), [l] = useBlocksContainer(), i = React.useRef(r), { t: c } = useTranslation(), d = ({ formData: C }, B) => {
|
|
3856
|
+
B && (a(C), i.current = C);
|
|
3853
3857
|
}, {
|
|
3854
3858
|
bodyFont: u,
|
|
3855
3859
|
headingFont: p,
|
|
@@ -3861,54 +3865,54 @@ const useAllDataProviders = () => useMemo(() => getChaiDataProviders(), []), Blo
|
|
|
3861
3865
|
bodyBgLightColor: b,
|
|
3862
3866
|
roundedCorners: k
|
|
3863
3867
|
} = r;
|
|
3864
|
-
let
|
|
3868
|
+
let S = {
|
|
3865
3869
|
headingFont: y({
|
|
3866
|
-
title: c("
|
|
3870
|
+
title: c("Theme Config.Heading Font"),
|
|
3867
3871
|
default: p,
|
|
3868
3872
|
options: FONTS
|
|
3869
3873
|
}),
|
|
3870
3874
|
bodyFont: y({
|
|
3871
|
-
title: c("
|
|
3875
|
+
title: c("Theme Config.Body Font"),
|
|
3872
3876
|
default: u,
|
|
3873
3877
|
options: FONTS
|
|
3874
3878
|
}),
|
|
3875
3879
|
roundedCorners: s$1({
|
|
3876
|
-
title: c("
|
|
3880
|
+
title: c("Theme Config.Rounded Corner"),
|
|
3877
3881
|
default: parseInt(k || 5, 10)
|
|
3878
3882
|
}),
|
|
3879
|
-
primaryColor: h({ title: c("
|
|
3880
|
-
secondaryColor: h({ title: c("
|
|
3883
|
+
primaryColor: h({ title: c("Theme Config.Primary"), default: m }),
|
|
3884
|
+
secondaryColor: h({ title: c("Theme Config.Secondary"), default: E })
|
|
3881
3885
|
};
|
|
3882
|
-
l || (
|
|
3883
|
-
...
|
|
3886
|
+
l || (S = {
|
|
3887
|
+
...S,
|
|
3884
3888
|
bodyBgLightColor: h({
|
|
3885
|
-
title: c("
|
|
3889
|
+
title: c("Theme Config.Background"),
|
|
3886
3890
|
default: b
|
|
3887
3891
|
}),
|
|
3888
3892
|
bodyTextLightColor: h({
|
|
3889
|
-
title: c("
|
|
3893
|
+
title: c("Theme Config.Text Color"),
|
|
3890
3894
|
default: g
|
|
3891
3895
|
}),
|
|
3892
3896
|
bodyBgDarkColor: h({
|
|
3893
|
-
title: c("
|
|
3897
|
+
title: c("Theme Config.Background Dark Mode"),
|
|
3894
3898
|
default: j
|
|
3895
3899
|
}),
|
|
3896
3900
|
bodyTextDarkColor: h({
|
|
3897
|
-
title: c("
|
|
3901
|
+
title: c("Theme Config.Text Color Dark Mode"),
|
|
3898
3902
|
default: x
|
|
3899
3903
|
})
|
|
3900
3904
|
});
|
|
3901
|
-
const
|
|
3905
|
+
const R = {
|
|
3902
3906
|
type: "object",
|
|
3903
3907
|
properties: {}
|
|
3904
|
-
},
|
|
3905
|
-
return Object.keys(
|
|
3906
|
-
const
|
|
3907
|
-
return
|
|
3908
|
+
}, _ = {};
|
|
3909
|
+
return Object.keys(S).forEach((C) => {
|
|
3910
|
+
const B = S[C];
|
|
3911
|
+
return R.properties || (R.properties = {}), R.properties[C] = B.schema, _[C] = B.uiSchema, !0;
|
|
3908
3912
|
}), /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: cn("flex h-full w-full select-none flex-col", n), children: [
|
|
3909
3913
|
o ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "rounded-md bg-background/30 p-1", children: /* @__PURE__ */ jsxRuntimeExports.jsx("h1", { className: "px-1 font-semibold", children: c("Theme Configuration") }) }) : null,
|
|
3910
3914
|
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
3911
|
-
Form,
|
|
3915
|
+
Form$1,
|
|
3912
3916
|
{
|
|
3913
3917
|
widgets: { color: ColorField },
|
|
3914
3918
|
idSeparator: ".",
|
|
@@ -3916,8 +3920,8 @@ const useAllDataProviders = () => useMemo(() => getChaiDataProviders(), []), Blo
|
|
|
3916
3920
|
omitExtraData: !0,
|
|
3917
3921
|
liveOmit: !0,
|
|
3918
3922
|
liveValidate: !0,
|
|
3919
|
-
uiSchema:
|
|
3920
|
-
schema:
|
|
3923
|
+
uiSchema: _,
|
|
3924
|
+
schema: R,
|
|
3921
3925
|
formData: r,
|
|
3922
3926
|
validator,
|
|
3923
3927
|
onChange: d
|
|
@@ -4100,14 +4104,14 @@ function BiExpandVertical(o) {
|
|
|
4100
4104
|
const Node = memo(({ node: o, style: n, dragHandle: r }) => {
|
|
4101
4105
|
const a = useBuilderProp("outlineMenuItems", []), { t: l } = useTranslation(), [i, , c] = useHiddenBlockIds(), [d] = useAtom$1(canvasIframeAtom);
|
|
4102
4106
|
let u = null;
|
|
4103
|
-
const p = o.children.length > 0, { highlightBlock: m, clearHighlight: g } = useBlockHighlight(), { id: x, data: j, isSelected: E, willReceiveDrop: b, isDragging: k, isEditing:
|
|
4107
|
+
const p = o.children.length > 0, { highlightBlock: m, clearHighlight: g } = useBlockHighlight(), { id: x, data: j, isSelected: E, willReceiveDrop: b, isDragging: k, isEditing: S, handleClick: R } = o, _ = (f) => {
|
|
4104
4108
|
f.stopPropagation(), !i.includes(x) && o.toggle();
|
|
4105
|
-
},
|
|
4109
|
+
}, C = (f) => {
|
|
4106
4110
|
f.isInternal && (u = f.isOpen, f.isOpen && f.close());
|
|
4107
|
-
},
|
|
4111
|
+
}, B = (f) => {
|
|
4108
4112
|
f.isInternal && u !== null && (u ? f.open() : f.close(), u = null);
|
|
4109
|
-
},
|
|
4110
|
-
f.stopPropagation(), !o.isOpen && !i.includes(x) && o.toggle(),
|
|
4113
|
+
}, N = (f) => {
|
|
4114
|
+
f.stopPropagation(), !o.isOpen && !i.includes(x) && o.toggle(), R(f);
|
|
4111
4115
|
};
|
|
4112
4116
|
useEffect(() => {
|
|
4113
4117
|
const f = setTimeout(() => {
|
|
@@ -4117,17 +4121,17 @@ const Node = memo(({ node: o, style: n, dragHandle: r }) => {
|
|
|
4117
4121
|
}, [b, o, k]);
|
|
4118
4122
|
const L = useMemo(() => {
|
|
4119
4123
|
const f = Object.keys(j), v = [];
|
|
4120
|
-
for (let
|
|
4121
|
-
if (f[
|
|
4122
|
-
const
|
|
4124
|
+
for (let w = 0; w < f.length; w++)
|
|
4125
|
+
if (f[w].endsWith("_attrs")) {
|
|
4126
|
+
const A = j[f[w]], I = Object.keys(A).join("|");
|
|
4123
4127
|
I.match(/x-data/) && v.push("data"), I.match(/x-on/) && v.push("event"), I.match(/x-show|x-if/) && v.push("show");
|
|
4124
4128
|
}
|
|
4125
4129
|
return v;
|
|
4126
4130
|
}, [j]), P = (f, v) => {
|
|
4127
|
-
const
|
|
4128
|
-
|
|
4129
|
-
const I =
|
|
4130
|
-
I.top >=
|
|
4131
|
+
const w = d.contentDocument || d.contentWindow.document, A = w.querySelector(`[data-block-id=${f}]`);
|
|
4132
|
+
A && A.setAttribute("data-drop", v);
|
|
4133
|
+
const I = A.getBoundingClientRect(), T = d.getBoundingClientRect();
|
|
4134
|
+
I.top >= T.top && I.left >= T.left && I.bottom <= T.bottom && I.right <= T.right || (w.documentElement.scrollTop = A.offsetTop - T.top);
|
|
4131
4135
|
};
|
|
4132
4136
|
return x === ROOT_TEMP_KEY ? /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
4133
4137
|
"button",
|
|
@@ -4136,7 +4140,7 @@ const Node = memo(({ node: o, style: n, dragHandle: r }) => {
|
|
|
4136
4140
|
className: "mb-10 mt-5 w-full rounded bg-gray-100 p-1 hover:bg-gray-200 dark:bg-gray-800",
|
|
4137
4141
|
children: [
|
|
4138
4142
|
"+ ",
|
|
4139
|
-
l("
|
|
4143
|
+
l("Add block")
|
|
4140
4144
|
]
|
|
4141
4145
|
}
|
|
4142
4146
|
) : /* @__PURE__ */ jsxRuntimeExports.jsx(BlockContextMenu, { id: x, children: /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
@@ -4144,12 +4148,12 @@ const Node = memo(({ node: o, style: n, dragHandle: r }) => {
|
|
|
4144
4148
|
{
|
|
4145
4149
|
onMouseEnter: () => m(x),
|
|
4146
4150
|
onMouseLeave: () => g(),
|
|
4147
|
-
onClick:
|
|
4151
|
+
onClick: N,
|
|
4148
4152
|
style: n,
|
|
4149
4153
|
"data-node-id": x,
|
|
4150
4154
|
ref: i.includes(x) ? null : r,
|
|
4151
|
-
onDragStart: () =>
|
|
4152
|
-
onDragEnd: () =>
|
|
4155
|
+
onDragStart: () => C(o),
|
|
4156
|
+
onDragEnd: () => B(o),
|
|
4153
4157
|
onDragOver: (f) => {
|
|
4154
4158
|
f.preventDefault(), P(x, "yes");
|
|
4155
4159
|
},
|
|
@@ -4172,12 +4176,12 @@ const Node = memo(({ node: o, style: n, dragHandle: r }) => {
|
|
|
4172
4176
|
"div",
|
|
4173
4177
|
{
|
|
4174
4178
|
className: `flex h-4 w-4 rotate-0 transform cursor-pointer items-center justify-center text-xs transition-transform duration-100 ${o.isOpen ? "rotate-90" : ""}`,
|
|
4175
|
-
children: p && /* @__PURE__ */ jsxRuntimeExports.jsx("button", { onClick:
|
|
4179
|
+
children: p && /* @__PURE__ */ jsxRuntimeExports.jsx("button", { onClick: _, type: "button", children: /* @__PURE__ */ jsxRuntimeExports.jsx(TriangleRightIcon, {}) })
|
|
4176
4180
|
}
|
|
4177
4181
|
),
|
|
4178
4182
|
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center", children: [
|
|
4179
4183
|
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "-mt-0.5 h-3 w-3", children: /* @__PURE__ */ jsxRuntimeExports.jsx(TypeIcon, { type: j == null ? void 0 : j._type }) }),
|
|
4180
|
-
|
|
4184
|
+
S ? /* @__PURE__ */ jsxRuntimeExports.jsx(Input, { node: o }) : /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
4181
4185
|
"div",
|
|
4182
4186
|
{
|
|
4183
4187
|
className: "ml-2 flex items-center gap-x-1 truncate text-[11px]",
|
|
@@ -4418,7 +4422,7 @@ const Node = memo(({ node: o, style: n, dragHandle: r }) => {
|
|
|
4418
4422
|
return o;
|
|
4419
4423
|
const n = /<video[^>]+src=['"]([^'">]+)['"]/, r = /<iframe[^>]+src=['"]([^'">]+)['"]/, a = o.match(n), l = o.match(r), i = a ? a[1] : l ? l[1] : null, c = /(?:https?:\/\/)?(?:www\.)?(?:youtube\.com\/(?:[^\/\n\s]+\/\S+\/|(?:v|e(?:mbed)?)\/|\S*?[?&]v=)|youtu\.be\/)([a-zA-Z0-9_-]{11})/, d = /(?:https?:\/\/)?(?:www\.)?player.vimeo\.com/;
|
|
4420
4424
|
return i && (c.test(i) || d.test(i)) ? i : o;
|
|
4421
|
-
},
|
|
4425
|
+
}, NAME_ATTRIBUTES = ["chai-name", "data-chai-name"], ATTRIBUTE_MAP = {
|
|
4422
4426
|
img: { alt: "alt", width: "width", height: "height", src: "image" },
|
|
4423
4427
|
video: {
|
|
4424
4428
|
src: "url",
|
|
@@ -4459,7 +4463,7 @@ const Node = memo(({ node: o, style: n, dragHandle: r }) => {
|
|
|
4459
4463
|
return {};
|
|
4460
4464
|
const n = {}, r = ATTRIBUTE_MAP[o.tagName] || {}, a = o.attributes;
|
|
4461
4465
|
return forEach(a, ({ key: l, value: i }) => {
|
|
4462
|
-
if (l
|
|
4466
|
+
if (!includes(NAME_ATTRIBUTES, l))
|
|
4463
4467
|
if (r[l]) {
|
|
4464
4468
|
if (o.tagName === "img" && l === "src" && !i.startsWith("http")) {
|
|
4465
4469
|
const c = find(o.attributes, { key: "width" }), d = find(o.attributes, { key: "height" });
|
|
@@ -4582,7 +4586,7 @@ const Node = memo(({ node: o, style: n, dragHandle: r }) => {
|
|
|
4582
4586
|
...getAttrs(r),
|
|
4583
4587
|
...getStyles(r)
|
|
4584
4588
|
}, r.attributes) {
|
|
4585
|
-
const k = r.attributes.find((
|
|
4589
|
+
const k = r.attributes.find((S) => includes(NAME_ATTRIBUTES, S.key));
|
|
4586
4590
|
k && (a._name = k.value);
|
|
4587
4591
|
}
|
|
4588
4592
|
if (i)
|
|
@@ -4600,14 +4604,14 @@ const Node = memo(({ node: o, style: n, dragHandle: r }) => {
|
|
|
4600
4604
|
];
|
|
4601
4605
|
a = {
|
|
4602
4606
|
...a,
|
|
4603
|
-
href: ((u = l.find((
|
|
4604
|
-
hrefType: ((p = l.find((
|
|
4605
|
-
autoplay: ((m = l.find((
|
|
4606
|
-
maxWidth: ((x = (g = l.find((
|
|
4607
|
-
backdropColor: ((j = l.find((
|
|
4608
|
-
galleryName: ((E = l.find((
|
|
4609
|
-
}, forEach(k, (
|
|
4610
|
-
has(a, `styles_attrs.${
|
|
4607
|
+
href: ((u = l.find((S) => S.key === "href")) == null ? void 0 : u.value) || "",
|
|
4608
|
+
hrefType: ((p = l.find((S) => S.key === "data-vbtype")) == null ? void 0 : p.value) || "video",
|
|
4609
|
+
autoplay: ((m = l.find((S) => S.key === "data-autoplay")) == null ? void 0 : m.value) === "true",
|
|
4610
|
+
maxWidth: ((x = (g = l.find((S) => S.key === "data-maxwidth")) == null ? void 0 : g.value) == null ? void 0 : x.replace("px", "")) || "",
|
|
4611
|
+
backdropColor: ((j = l.find((S) => S.key === "data-overlay")) == null ? void 0 : j.value) || "",
|
|
4612
|
+
galleryName: ((E = l.find((S) => S.key === "data-gall")) == null ? void 0 : E.value) || ""
|
|
4613
|
+
}, forEach(k, (S) => {
|
|
4614
|
+
has(a, `styles_attrs.${S}`) && delete a.styles_attrs[S];
|
|
4611
4615
|
});
|
|
4612
4616
|
}
|
|
4613
4617
|
if (a._type === "Input") {
|
|
@@ -4617,8 +4621,8 @@ const Node = memo(({ node: o, style: n, dragHandle: r }) => {
|
|
|
4617
4621
|
const k = stringify([r]);
|
|
4618
4622
|
return hasVideoEmbed(k) && (set(a, "_type", "Video"), set(a, "url", getVideoURLFromHTML(k)), set(a, "styles", `${STYLES_KEY},absolute top-0 left-0 w-full h-full`), set(a, "controls", { autoPlay: !1, muted: !0, loop: !1, controls: !1 })), a.content = k, [a];
|
|
4619
4623
|
} else if (r.tagName === "svg") {
|
|
4620
|
-
const k = find(r.attributes, { key: "height" }),
|
|
4621
|
-
return a.styles = `${STYLES_KEY}, ${cn(`w-${
|
|
4624
|
+
const k = find(r.attributes, { key: "height" }), S = find(r.attributes, { key: "width" }), R = get(k, "value") ? `[${get(k, "value")}px]` : "24px", _ = get(S, "value") ? `[${get(S, "value")}px]` : "24px", C = get(find(r.attributes, { key: "class" }), "value", "w-full h-full");
|
|
4625
|
+
return a.styles = `${STYLES_KEY}, ${cn(`w-${_} h-${R}`, C)}`.trim(), r.attributes = filter(r.attributes, (B) => !includes(["style", "width", "height", "class"], B.key)), a.icon = stringify([r]), [a];
|
|
4622
4626
|
} else if (r.tagName == "option" && n && ((b = n.block) == null ? void 0 : b._type) === "Select")
|
|
4623
4627
|
return n.block.options.push({
|
|
4624
4628
|
label: getTextContent(r.children),
|
|
@@ -4638,9 +4642,9 @@ const Node = memo(({ node: o, style: n, dragHandle: r }) => {
|
|
|
4638
4642
|
l([...c], o), a(""), emitChaiBuilderMsg({ name: CHAI_BUILDER_EVENTS.CLOSE_ADD_BLOCK });
|
|
4639
4643
|
};
|
|
4640
4644
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs(Card, { className: "border-border/0 p-0 shadow-none", children: [
|
|
4641
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(CardHeader, { className: "p-3", children: /* @__PURE__ */ jsxRuntimeExports.jsx(CardDescription, { children: n("
|
|
4645
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(CardHeader, { className: "p-3", children: /* @__PURE__ */ jsxRuntimeExports.jsx(CardDescription, { children: n("Use HTML snippets from Tailwind CSS component libraries") }) }),
|
|
4642
4646
|
/* @__PURE__ */ jsxRuntimeExports.jsx(CardContent, { className: "space-y-2 px-3 py-0", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "space-y-1", children: [
|
|
4643
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(Label, { htmlFor: "current", className: "text-sm", children: n("
|
|
4647
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Label, { htmlFor: "current", className: "text-sm", children: n("Tailwind HTML snippet") }),
|
|
4644
4648
|
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
4645
4649
|
Textarea,
|
|
4646
4650
|
{
|
|
@@ -4650,7 +4654,7 @@ const Node = memo(({ node: o, style: n, dragHandle: r }) => {
|
|
|
4650
4654
|
onChange: (c) => a(c.target.value),
|
|
4651
4655
|
rows: 12,
|
|
4652
4656
|
value: r,
|
|
4653
|
-
placeholder: n("
|
|
4657
|
+
placeholder: n("Enter your code snippet here"),
|
|
4654
4658
|
className: "resize-none overflow-x-auto whitespace-pre bg-background font-mono text-xs font-normal"
|
|
4655
4659
|
}
|
|
4656
4660
|
)
|
|
@@ -4685,8 +4689,8 @@ function ExpandableObject(o) {
|
|
|
4685
4689
|
useEffect(() => {
|
|
4686
4690
|
g.current ? E(p(d, r, n)) : g.current = !0;
|
|
4687
4691
|
}, [p]);
|
|
4688
|
-
const b = x ? u.collapseIcon : u.expandIcon, k = x ? "collapse JSON" : "expand JSON",
|
|
4689
|
-
|
|
4692
|
+
const b = x ? u.collapseIcon : u.expandIcon, k = x ? "collapse JSON" : "expand JSON", S = useComponentId(), R = d + 1, _ = a.length - 1, C = (B) => {
|
|
4693
|
+
B.key === " " && (B.preventDefault(), j());
|
|
4690
4694
|
};
|
|
4691
4695
|
return /* @__PURE__ */ createElement("div", {
|
|
4692
4696
|
className: u.basicChildStyle,
|
|
@@ -4694,16 +4698,16 @@ function ExpandableObject(o) {
|
|
|
4694
4698
|
}, /* @__PURE__ */ createElement("span", {
|
|
4695
4699
|
className: b,
|
|
4696
4700
|
onClick: j,
|
|
4697
|
-
onKeyDown:
|
|
4701
|
+
onKeyDown: C,
|
|
4698
4702
|
role: "button",
|
|
4699
4703
|
tabIndex: 0,
|
|
4700
4704
|
"aria-label": k,
|
|
4701
4705
|
"aria-expanded": x,
|
|
4702
|
-
"aria-controls": x ?
|
|
4706
|
+
"aria-controls": x ? S : void 0
|
|
4703
4707
|
}), n && (m ? /* @__PURE__ */ createElement("span", {
|
|
4704
4708
|
className: u.clickableLabel,
|
|
4705
4709
|
onClick: j,
|
|
4706
|
-
onKeyDown:
|
|
4710
|
+
onKeyDown: C,
|
|
4707
4711
|
role: "button",
|
|
4708
4712
|
tabIndex: -1
|
|
4709
4713
|
}, n, ":") : /* @__PURE__ */ createElement("span", {
|
|
@@ -4711,20 +4715,20 @@ function ExpandableObject(o) {
|
|
|
4711
4715
|
}, n, ":")), /* @__PURE__ */ createElement("span", {
|
|
4712
4716
|
className: u.punctuation
|
|
4713
4717
|
}, i), x ? /* @__PURE__ */ createElement("div", {
|
|
4714
|
-
id:
|
|
4715
|
-
}, a.map((
|
|
4716
|
-
key:
|
|
4717
|
-
field:
|
|
4718
|
-
value:
|
|
4718
|
+
id: S
|
|
4719
|
+
}, a.map((B, N) => /* @__PURE__ */ createElement(DataRender, {
|
|
4720
|
+
key: B[0] || N,
|
|
4721
|
+
field: B[0],
|
|
4722
|
+
value: B[1],
|
|
4719
4723
|
style: u,
|
|
4720
|
-
lastElement:
|
|
4721
|
-
level:
|
|
4724
|
+
lastElement: N === _,
|
|
4725
|
+
level: R,
|
|
4722
4726
|
shouldExpandNode: p,
|
|
4723
4727
|
clickToExpandNode: m
|
|
4724
4728
|
}))) : /* @__PURE__ */ createElement("span", {
|
|
4725
4729
|
className: u.collapsedContent,
|
|
4726
4730
|
onClick: j,
|
|
4727
|
-
onKeyDown:
|
|
4731
|
+
onKeyDown: C,
|
|
4728
4732
|
role: "button",
|
|
4729
4733
|
tabIndex: -1,
|
|
4730
4734
|
"aria-hidden": !0,
|
|
@@ -5134,7 +5138,7 @@ const ViewData = ({ data: o, fullView: n }) => {
|
|
|
5134
5138
|
try {
|
|
5135
5139
|
const n = document.getElementById("icon-picker-field"), r = document.createElement("div");
|
|
5136
5140
|
ReactDOM.render(/* @__PURE__ */ jsxRuntimeExports.jsx(IconPickerItem, { value: o }), r), n.appendChild(r), r.hidden = !0;
|
|
5137
|
-
|
|
5141
|
+
const a = r.innerHTML;
|
|
5138
5142
|
setTimeout(() => n.removeChild(r), 100);
|
|
5139
5143
|
const i = new DOMParser().parseFromString(a, "image/svg+xml"), c = i.querySelector("svg");
|
|
5140
5144
|
return c && (c.removeAttribute("width"), c.removeAttribute("height")), new XMLSerializer().serializeToString(i);
|
|
@@ -5193,12 +5197,12 @@ const ViewData = ({ data: o, fullView: n }) => {
|
|
|
5193
5197
|
spellCheck: "false",
|
|
5194
5198
|
value: o,
|
|
5195
5199
|
onChange: (l) => n(l.target.value),
|
|
5196
|
-
placeholder: r("
|
|
5200
|
+
placeholder: r("Choose Icon or SVG"),
|
|
5197
5201
|
className: "no-scrollbar disabled:opacity-50; mt-1 flex w-full rounded-md border border-border bg-background px-3 py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed"
|
|
5198
5202
|
}
|
|
5199
5203
|
)
|
|
5200
5204
|
] });
|
|
5201
|
-
}, UnsplashImages = React__default.lazy(() => import("./UnsplashImages-
|
|
5205
|
+
}, UnsplashImages = React__default.lazy(() => import("./UnsplashImages-Oq4_5Ihm.js")), UploadImages = React__default.lazy(() => import("./UploadImages-zxbjgQf7.js")), ImagesPanel = ({
|
|
5202
5206
|
isModalView: o = !1,
|
|
5203
5207
|
onSelect: n = () => {
|
|
5204
5208
|
}
|
|
@@ -5243,7 +5247,7 @@ const ImagePickerModal$1 = ImagePickerModal, ImagePickerField = ({ value: o, onC
|
|
|
5243
5247
|
spellCheck: "false",
|
|
5244
5248
|
type: "url",
|
|
5245
5249
|
className: "text-xs",
|
|
5246
|
-
placeholder: c("
|
|
5250
|
+
placeholder: c("Enter image URL"),
|
|
5247
5251
|
value: o,
|
|
5248
5252
|
onBlur: ({ target: { value: u } }) => a(r, u),
|
|
5249
5253
|
onChange: (u) => n(u.target.value)
|
|
@@ -5376,7 +5380,7 @@ const ImagePickerModal$1 = ImagePickerModal, ImagePickerField = ({ value: o, onC
|
|
|
5376
5380
|
// save only every 5 seconds
|
|
5377
5381
|
);
|
|
5378
5382
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
5379
|
-
Form,
|
|
5383
|
+
Form$1,
|
|
5380
5384
|
{
|
|
5381
5385
|
widgets: {
|
|
5382
5386
|
binding: BindingWidget,
|
|
@@ -5409,7 +5413,7 @@ const ImagePickerModal$1 = ImagePickerModal, ImagePickerField = ({ value: o, onC
|
|
|
5409
5413
|
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center gap-x-2 border-b border-border bg-background py-2 font-normal text-muted-foreground", children: [
|
|
5410
5414
|
r._name || r._type,
|
|
5411
5415
|
" ",
|
|
5412
|
-
l("
|
|
5416
|
+
l("Visibility settings")
|
|
5413
5417
|
] }),
|
|
5414
5418
|
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center space-x-2 pt-2", children: [
|
|
5415
5419
|
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
@@ -5465,28 +5469,28 @@ const ImagePickerModal$1 = ImagePickerModal, ImagePickerField = ({ value: o, onC
|
|
|
5465
5469
|
}), a;
|
|
5466
5470
|
};
|
|
5467
5471
|
function BlockSettings() {
|
|
5468
|
-
const { selectedLang: o } = useLanguages(), n = useSelectedBlock(), r = useUpdateBlocksPropsRealtime(), a = useUpdateBlocksProps(), l = getBlockComponent(n == null ? void 0 : n._type), i = formDataWithSelectedLang(n, o, l), [c, d] = useState(i), u = useBuilderProp("dataBindingSupport", !1), p = ({ formData: b }, k,
|
|
5472
|
+
const { selectedLang: o } = useLanguages(), n = useSelectedBlock(), r = useUpdateBlocksPropsRealtime(), a = useUpdateBlocksProps(), l = getBlockComponent(n == null ? void 0 : n._type), i = formDataWithSelectedLang(n, o, l), [c, d] = useState(i), u = useBuilderProp("dataBindingSupport", !1), p = ({ formData: b }, k, S) => {
|
|
5469
5473
|
if (k && (c == null ? void 0 : c._id) === n._id) {
|
|
5470
|
-
const
|
|
5471
|
-
a([n._id], { [
|
|
5474
|
+
const R = k.replace("root.", "");
|
|
5475
|
+
a([n._id], { [R]: get(b, R) }, S);
|
|
5472
5476
|
}
|
|
5473
5477
|
}, m = useCallback(
|
|
5474
|
-
debounce(({ formData: b }, k,
|
|
5475
|
-
p({ formData: b }, k,
|
|
5478
|
+
debounce(({ formData: b }, k, S) => {
|
|
5479
|
+
p({ formData: b }, k, S), d(b);
|
|
5476
5480
|
}, 1500),
|
|
5477
5481
|
[n == null ? void 0 : n._id, o]
|
|
5478
5482
|
), g = ({ formData: b }, k) => {
|
|
5479
5483
|
if (k) {
|
|
5480
|
-
const
|
|
5484
|
+
const S = k.replace("root.", "");
|
|
5481
5485
|
r(
|
|
5482
5486
|
[n._id],
|
|
5483
|
-
convertDotNotationToObject(
|
|
5484
|
-
), m({ formData: b }, k, { [
|
|
5487
|
+
convertDotNotationToObject(S, get(b, S.split(".")))
|
|
5488
|
+
), m({ formData: b }, k, { [S]: get(c, S) });
|
|
5485
5489
|
}
|
|
5486
5490
|
}, x = keys(get(i, "_bindings", {})), j = useMemo(() => {
|
|
5487
5491
|
const b = cloneDeep(get(l, "props", {}));
|
|
5488
|
-
return each(b, (k,
|
|
5489
|
-
get(k, "hidden", !1) && delete b[
|
|
5492
|
+
return each(b, (k, S) => {
|
|
5493
|
+
get(k, "hidden", !1) && delete b[S];
|
|
5490
5494
|
}), u && each(x, (k) => delete b[k]), b;
|
|
5491
5495
|
}, [l, x, u]), E = get(l, "server", !1);
|
|
5492
5496
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "overflow-x-hidden px-px", children: [
|
|
@@ -5576,14 +5580,14 @@ const askAiProcessingAtom = atom$1(!1), useAskAi = () => {
|
|
|
5576
5580
|
if (l) {
|
|
5577
5581
|
n(!0), a(null);
|
|
5578
5582
|
try {
|
|
5579
|
-
const b = g === "content" ? cloneDeep(getBlockWithChildren(x, d)) : [cloneDeep(d.find((
|
|
5583
|
+
const b = g === "content" ? cloneDeep(getBlockWithChildren(x, d)) : [cloneDeep(d.find((C) => C._id === x))];
|
|
5580
5584
|
set(b, "0._parent", null);
|
|
5581
|
-
const k = u === p ? "" : u,
|
|
5582
|
-
if (
|
|
5583
|
-
a(
|
|
5585
|
+
const k = u === p ? "" : u, S = await l(g, promptWithLanguage(j, m, g), b, k), { blocks: R, error: _ } = S;
|
|
5586
|
+
if (_) {
|
|
5587
|
+
a(_);
|
|
5584
5588
|
return;
|
|
5585
5589
|
}
|
|
5586
|
-
g === "styles" ? c(
|
|
5590
|
+
g === "styles" ? c(R) : i(R), E && E(S);
|
|
5587
5591
|
} catch (b) {
|
|
5588
5592
|
a(b);
|
|
5589
5593
|
} finally {
|
|
@@ -5681,14 +5685,14 @@ const AskAIStyles = ({ blockId: o }) => {
|
|
|
5681
5685
|
!l && j && m(j), u.current = setTimeout(() => m(void 0), 1e4), l || c("");
|
|
5682
5686
|
};
|
|
5683
5687
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "", children: [
|
|
5684
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("h2", { className: "mb-1 text-sm font-semibold leading-none tracking-tight", children: n("
|
|
5688
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("h2", { className: "mb-1 text-sm font-semibold leading-none tracking-tight", children: n("Ask AI") }),
|
|
5685
5689
|
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
5686
5690
|
Textarea,
|
|
5687
5691
|
{
|
|
5688
5692
|
ref: d,
|
|
5689
5693
|
value: i,
|
|
5690
5694
|
onChange: (x) => c(x.target.value),
|
|
5691
|
-
placeholder: n("
|
|
5695
|
+
placeholder: n("Ask AI to edit styles"),
|
|
5692
5696
|
className: "w-full border border-border focus:border-0",
|
|
5693
5697
|
rows: 3,
|
|
5694
5698
|
onKeyDown: (x) => {
|
|
@@ -5709,16 +5713,16 @@ const AskAIStyles = ({ blockId: o }) => {
|
|
|
5709
5713
|
size: "sm",
|
|
5710
5714
|
children: a ? /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
|
|
5711
5715
|
/* @__PURE__ */ jsxRuntimeExports.jsx(Loader, { className: "h-5 w-5 animate-spin" }),
|
|
5712
|
-
n("
|
|
5713
|
-
] }) : n("
|
|
5716
|
+
n("Generating... Please wait...")
|
|
5717
|
+
] }) : n("Edit with AI")
|
|
5714
5718
|
}
|
|
5715
5719
|
),
|
|
5716
5720
|
a ? /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex flex-col gap-2", children: [
|
|
5717
5721
|
/* @__PURE__ */ jsxRuntimeExports.jsxs(Skeleton, { className: "flex w-full items-center space-x-1 px-4 py-1 pl-2", children: [
|
|
5718
5722
|
/* @__PURE__ */ jsxRuntimeExports.jsx(FaSpinner, { className: "h-4 w-4 animate-spin text-gray-500" }),
|
|
5719
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-xs", children: n("
|
|
5723
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-xs", children: n("Generating... Please wait...") })
|
|
5720
5724
|
] }),
|
|
5721
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(Button, { variant: "destructive", onClick: () => stop(), className: "hidden w-fit", size: "sm", children: n("
|
|
5725
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Button, { variant: "destructive", onClick: () => stop(), className: "hidden w-fit", size: "sm", children: n("Stop") })
|
|
5722
5726
|
] }) : null
|
|
5723
5727
|
] }),
|
|
5724
5728
|
p ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "max-w-full", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("p", { className: "mb-1 flex justify-between break-words rounded border border-blue-500 bg-blue-100 p-1 text-xs text-blue-500", children: [
|
|
@@ -5738,16 +5742,16 @@ const AskAIStyles = ({ blockId: o }) => {
|
|
|
5738
5742
|
keys: ["name"]
|
|
5739
5743
|
});
|
|
5740
5744
|
function ManualClasses() {
|
|
5741
|
-
var
|
|
5742
|
-
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 = (
|
|
5743
|
-
const
|
|
5744
|
-
a(i,
|
|
5745
|
-
}, [j, E] = useState([]), b = ({ value:
|
|
5746
|
-
const L =
|
|
5745
|
+
var B;
|
|
5746
|
+
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 = (B = first(n)) == null ? void 0 : B.prop, g = reject((get(r, m, "").replace(STYLES_KEY, "").split(",").pop() || "").split(" "), isEmpty), x = () => {
|
|
5747
|
+
const N = d.trim().toLowerCase().replace(/ +(?= )/g, "").split(" ");
|
|
5748
|
+
a(i, N, !0), u("");
|
|
5749
|
+
}, [j, E] = useState([]), b = ({ value: N }) => {
|
|
5750
|
+
const L = N.trim().toLowerCase(), P = L.match(/.+:/g);
|
|
5747
5751
|
let f = [];
|
|
5748
5752
|
if (P && P.length > 0) {
|
|
5749
|
-
const [v] = P,
|
|
5750
|
-
f = fuse.search(
|
|
5753
|
+
const [v] = P, w = L.replace(v, "");
|
|
5754
|
+
f = fuse.search(w).map((I) => ({
|
|
5751
5755
|
...I,
|
|
5752
5756
|
item: { ...I.item, name: v + I.item.name }
|
|
5753
5757
|
}));
|
|
@@ -5756,30 +5760,30 @@ function ManualClasses() {
|
|
|
5756
5760
|
return E(map(f, "item"));
|
|
5757
5761
|
}, k = () => {
|
|
5758
5762
|
E([]);
|
|
5759
|
-
},
|
|
5763
|
+
}, S = (N) => N.name, R = (N) => /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "rounded-md p-1", children: N.name }), _ = {
|
|
5760
5764
|
autoComplete: "off",
|
|
5761
5765
|
autoCorrect: "off",
|
|
5762
5766
|
autoCapitalize: "off",
|
|
5763
5767
|
spellCheck: !1,
|
|
5764
|
-
placeholder: o("
|
|
5768
|
+
placeholder: o("Enter classes separated by space"),
|
|
5765
5769
|
value: d,
|
|
5766
|
-
onKeyDown: (
|
|
5767
|
-
|
|
5770
|
+
onKeyDown: (N) => {
|
|
5771
|
+
N.key === "Enter" && d.trim() !== "" && x();
|
|
5768
5772
|
},
|
|
5769
|
-
onChange: (
|
|
5773
|
+
onChange: (N, { newValue: L }) => u(L),
|
|
5770
5774
|
className: "w-full rounded-md text-xs px-2 hover:outline-0 bg-background border-border py-1"
|
|
5771
|
-
},
|
|
5775
|
+
}, C = () => {
|
|
5772
5776
|
if (navigator.clipboard === void 0) {
|
|
5773
5777
|
p({
|
|
5774
|
-
title: o("
|
|
5775
|
-
description: o("
|
|
5778
|
+
title: o("Clipboard not supported"),
|
|
5779
|
+
description: o("Please use Chrome, Firefox or Safari"),
|
|
5776
5780
|
variant: "destructive"
|
|
5777
5781
|
});
|
|
5778
5782
|
return;
|
|
5779
5783
|
}
|
|
5780
5784
|
navigator.clipboard.writeText(g.join(" ")), p({
|
|
5781
|
-
title: o("
|
|
5782
|
-
description: o("
|
|
5785
|
+
title: o("Copied"),
|
|
5786
|
+
description: o("Classes copied to clipboard")
|
|
5783
5787
|
});
|
|
5784
5788
|
};
|
|
5785
5789
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
@@ -5791,8 +5795,8 @@ function ManualClasses() {
|
|
|
5791
5795
|
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center gap-x-2 text-muted-foreground", children: [
|
|
5792
5796
|
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: o("classes") }),
|
|
5793
5797
|
/* @__PURE__ */ jsxRuntimeExports.jsxs(Tooltip, { children: [
|
|
5794
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(TooltipTrigger, { asChild: !0, children: /* @__PURE__ */ jsxRuntimeExports.jsx(CopyIcon, { onClick:
|
|
5795
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(TooltipContent, { children: /* @__PURE__ */ jsxRuntimeExports.jsx("p", { children: o("
|
|
5798
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(TooltipTrigger, { asChild: !0, children: /* @__PURE__ */ jsxRuntimeExports.jsx(CopyIcon, { onClick: C, className: "cursor-pointer" }) }),
|
|
5799
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(TooltipContent, { children: /* @__PURE__ */ jsxRuntimeExports.jsx("p", { children: o("Copy classes to clipboard") }) })
|
|
5796
5800
|
] })
|
|
5797
5801
|
] }),
|
|
5798
5802
|
c ? /* @__PURE__ */ jsxRuntimeExports.jsxs(Popover, { children: [
|
|
@@ -5810,9 +5814,9 @@ function ManualClasses() {
|
|
|
5810
5814
|
suggestions: j,
|
|
5811
5815
|
onSuggestionsFetchRequested: b,
|
|
5812
5816
|
onSuggestionsClearRequested: k,
|
|
5813
|
-
getSuggestionValue:
|
|
5814
|
-
renderSuggestion:
|
|
5815
|
-
inputProps:
|
|
5817
|
+
getSuggestionValue: S,
|
|
5818
|
+
renderSuggestion: R,
|
|
5819
|
+
inputProps: _,
|
|
5816
5820
|
containerProps: {
|
|
5817
5821
|
className: "relative h-8 w-full gap-y-1 py-1 border-border"
|
|
5818
5822
|
},
|
|
@@ -5836,22 +5840,22 @@ function ManualClasses() {
|
|
|
5836
5840
|
)
|
|
5837
5841
|
] }),
|
|
5838
5842
|
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex w-full flex-wrap gap-2 overflow-x-hidden", children: React.Children.toArray(
|
|
5839
|
-
g.map((
|
|
5843
|
+
g.map((N) => /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
5840
5844
|
"div",
|
|
5841
5845
|
{
|
|
5842
5846
|
className: "group relative flex max-w-[260px] cursor-default items-center gap-x-1 truncate rounded border border-border bg-gray-200 p-px px-1.5 text-[11px] text-gray-600 hover:border-gray-300 dark:border-gray-700 dark:bg-gray-800 dark:text-gray-300",
|
|
5843
5847
|
children: [
|
|
5844
|
-
|
|
5848
|
+
N,
|
|
5845
5849
|
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
5846
5850
|
Cross2Icon,
|
|
5847
5851
|
{
|
|
5848
|
-
onClick: () => l(i, [
|
|
5852
|
+
onClick: () => l(i, [N]),
|
|
5849
5853
|
className: "invisible absolute right-1 rounded-full bg-red-400 hover:text-white group-hover:visible group-hover:cursor-pointer"
|
|
5850
5854
|
}
|
|
5851
5855
|
)
|
|
5852
5856
|
]
|
|
5853
5857
|
},
|
|
5854
|
-
|
|
5858
|
+
N
|
|
5855
5859
|
))
|
|
5856
5860
|
) })
|
|
5857
5861
|
]
|
|
@@ -6501,7 +6505,7 @@ const RangeChoices = ({ property: o, onChange: n }) => {
|
|
|
6501
6505
|
},
|
|
6502
6506
|
a
|
|
6503
6507
|
)) }), THROTTLE_TIME = 50, AdvanceChoices = (o) => {
|
|
6504
|
-
const [n, r] = useState(!1), [a, l] = useState(""), { currentClass: i, onChange: c, classPrefix: d, cssProperty: u, units: p, negative: m } = o, [g, x] = useState(u != null && u.toLowerCase().includes("width") ? "%" : p[0]), [j, E] = useState(!1), [b, k] = useState(""), [
|
|
6508
|
+
const [n, r] = useState(!1), [a, l] = useState(""), { currentClass: i, onChange: c, classPrefix: d, cssProperty: u, units: p, negative: m } = o, [g, x] = useState(u != null && u.toLowerCase().includes("width") ? "%" : p[0]), [j, E] = useState(!1), [b, k] = useState(""), [S, R] = useState(!1), [_, C] = useState(!1);
|
|
6505
6509
|
useEffect(() => {
|
|
6506
6510
|
const { value: f, unit: v } = getClassValueAndUnit(i);
|
|
6507
6511
|
if (v === "") {
|
|
@@ -6510,24 +6514,24 @@ const RangeChoices = ({ property: o, onChange: n }) => {
|
|
|
6510
6514
|
}
|
|
6511
6515
|
x(v), l(v === "class" || isEmpty(f) ? "" : f);
|
|
6512
6516
|
}, [i, u, p]);
|
|
6513
|
-
const
|
|
6517
|
+
const B = useThrottledCallback((f) => c(f), [c], THROTTLE_TIME), N = useThrottledCallback((f) => c(f, !1), [c], THROTTLE_TIME), L = useCallback(
|
|
6514
6518
|
(f = !1) => {
|
|
6515
6519
|
const v = getUserInputValues(`${a}`, p);
|
|
6516
6520
|
if (get(v, "error", !1)) {
|
|
6517
6521
|
E(!0);
|
|
6518
6522
|
return;
|
|
6519
6523
|
}
|
|
6520
|
-
const
|
|
6521
|
-
if (
|
|
6522
|
-
|
|
6524
|
+
const w = get(v, "unit") !== "" ? get(v, "unit") : g;
|
|
6525
|
+
if (w === "auto" || w === "none") {
|
|
6526
|
+
B(`${d}${w}`);
|
|
6523
6527
|
return;
|
|
6524
6528
|
}
|
|
6525
6529
|
if (get(v, "value") === "")
|
|
6526
6530
|
return;
|
|
6527
|
-
const I = `${get(v, "value", "").startsWith("-") ? "-" : ""}${d}[${get(v, "value", "").replace("-", "")}${
|
|
6528
|
-
f ?
|
|
6531
|
+
const I = `${get(v, "value", "").startsWith("-") ? "-" : ""}${d}[${get(v, "value", "").replace("-", "")}${w === "-" ? "" : w}]`;
|
|
6532
|
+
f ? N(I) : B(I);
|
|
6529
6533
|
},
|
|
6530
|
-
[
|
|
6534
|
+
[B, N, a, g, d, p]
|
|
6531
6535
|
), P = useCallback(
|
|
6532
6536
|
(f) => {
|
|
6533
6537
|
const v = getUserInputValues(`${a}`, p);
|
|
@@ -6536,15 +6540,15 @@ const RangeChoices = ({ property: o, onChange: n }) => {
|
|
|
6536
6540
|
return;
|
|
6537
6541
|
}
|
|
6538
6542
|
if (f === "auto" || f === "none") {
|
|
6539
|
-
|
|
6543
|
+
B(`${d}${f}`);
|
|
6540
6544
|
return;
|
|
6541
6545
|
}
|
|
6542
6546
|
if (get(v, "value") === "")
|
|
6543
6547
|
return;
|
|
6544
|
-
const
|
|
6545
|
-
|
|
6548
|
+
const w = get(v, "unit") !== "" ? get(v, "unit") : f, I = `${get(v, "value", "").startsWith("-") ? "-" : ""}${d}[${get(v, "value", "").replace("-", "")}${w === "-" ? "" : w}]`;
|
|
6549
|
+
B(I);
|
|
6546
6550
|
},
|
|
6547
|
-
[
|
|
6551
|
+
[B, a, d, p]
|
|
6548
6552
|
);
|
|
6549
6553
|
return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex w-full flex-col", children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex items-center justify-start", children: g === "class" ? /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
|
|
6550
6554
|
/* @__PURE__ */ jsxRuntimeExports.jsx("input", { className: "w-20 rounded py-1", readOnly: !0, value: i }),
|
|
@@ -6552,7 +6556,7 @@ const RangeChoices = ({ property: o, onChange: n }) => {
|
|
|
6552
6556
|
/* @__PURE__ */ jsxRuntimeExports.jsx(TooltipTrigger, { asChild: !0, children: /* @__PURE__ */ jsxRuntimeExports.jsx("button", { type: "button", className: "invisible ml-3 mt-1 text-blue-600 group-hover:visible", children: /* @__PURE__ */ jsxRuntimeExports.jsx(InfoCircledIcon, {}) }) }),
|
|
6553
6557
|
/* @__PURE__ */ jsxRuntimeExports.jsx(TooltipContent, { children: "Current value is using a Tailwind preset class." })
|
|
6554
6558
|
] })
|
|
6555
|
-
] }) : /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: `group relative flex items-center ${
|
|
6559
|
+
] }) : /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: `group relative flex items-center ${S ? "z-auto" : ""}`, children: [
|
|
6556
6560
|
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center rounded-md border border-border", children: [
|
|
6557
6561
|
["none", "auto"].indexOf(g) !== -1 ? null : /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
6558
6562
|
"input",
|
|
@@ -6564,15 +6568,15 @@ const RangeChoices = ({ property: o, onChange: n }) => {
|
|
|
6564
6568
|
onKeyDown: (f) => {
|
|
6565
6569
|
if (f.keyCode !== 38 && f.keyCode !== 40)
|
|
6566
6570
|
return;
|
|
6567
|
-
f.preventDefault(),
|
|
6571
|
+
f.preventDefault(), C(!0);
|
|
6568
6572
|
const v = parseInt$1(f.target.value);
|
|
6569
|
-
let
|
|
6570
|
-
f.keyCode === 38 && (
|
|
6571
|
-
const
|
|
6572
|
-
T
|
|
6573
|
+
let w = isNaN$1(v) ? 0 : v;
|
|
6574
|
+
f.keyCode === 38 && (w += 1), f.keyCode === 40 && (w -= 1);
|
|
6575
|
+
const A = `${w}`, T = `${A.startsWith("-") ? "-" : ""}${d}[${A.replace("-", "")}${g === "-" ? "" : g}]`;
|
|
6576
|
+
N(T);
|
|
6573
6577
|
},
|
|
6574
6578
|
onKeyUp: (f) => {
|
|
6575
|
-
|
|
6579
|
+
_ && (f.preventDefault(), C(!1));
|
|
6576
6580
|
},
|
|
6577
6581
|
onBlur: () => L(),
|
|
6578
6582
|
onChange: (f) => {
|
|
@@ -6582,7 +6586,7 @@ const RangeChoices = ({ property: o, onChange: n }) => {
|
|
|
6582
6586
|
var v;
|
|
6583
6587
|
(v = f == null ? void 0 : f.target) == null || v.select(), r(!1);
|
|
6584
6588
|
},
|
|
6585
|
-
value:
|
|
6589
|
+
value: S ? b : a,
|
|
6586
6590
|
className: "h-6 w-14 rounded rounded-r-none border border-transparent bg-background pl-2 text-sm focus-visible:outline-0".concat(
|
|
6587
6591
|
" ",
|
|
6588
6592
|
j ? "border-red-500 text-red-500" : "border-foreground/20"
|
|
@@ -6614,22 +6618,22 @@ const RangeChoices = ({ property: o, onChange: n }) => {
|
|
|
6614
6618
|
) }) })
|
|
6615
6619
|
] })
|
|
6616
6620
|
] }),
|
|
6617
|
-
["none", "auto"].indexOf(g) !== -1 ||
|
|
6621
|
+
["none", "auto"].indexOf(g) !== -1 || S ? null : /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
6618
6622
|
DragStyleButton,
|
|
6619
6623
|
{
|
|
6620
|
-
onDragStart: () =>
|
|
6624
|
+
onDragStart: () => R(!0),
|
|
6621
6625
|
onDragEnd: (f) => {
|
|
6622
|
-
if (k(() => ""),
|
|
6626
|
+
if (k(() => ""), R(!1), isEmpty(f))
|
|
6623
6627
|
return;
|
|
6624
|
-
const v = `${f}`,
|
|
6625
|
-
A
|
|
6628
|
+
const v = `${f}`, A = `${v.startsWith("-") ? "-" : ""}${d}[${v.replace("-", "")}${g === "-" ? "" : g}]`;
|
|
6629
|
+
B(A);
|
|
6626
6630
|
},
|
|
6627
6631
|
onDrag: (f) => {
|
|
6628
6632
|
if (isEmpty(f))
|
|
6629
6633
|
return;
|
|
6630
6634
|
k(f);
|
|
6631
|
-
const v = `${f}`,
|
|
6632
|
-
|
|
6635
|
+
const v = `${f}`, A = `${v.startsWith("-") ? "-" : ""}${d}[${v.replace("-", "")}${g === "-" ? "" : g}]`;
|
|
6636
|
+
N(A);
|
|
6633
6637
|
},
|
|
6634
6638
|
currentValue: a,
|
|
6635
6639
|
unit: g,
|
|
@@ -6727,34 +6731,34 @@ const RangeChoices = ({ property: o, onChange: n }) => {
|
|
|
6727
6731
|
}, getBreakpoint = (o) => `${o.toUpperCase()} ${BREAKPOINTS[o] ? `(${BREAKPOINTS[o]} & up)` : ""}`, BlockStyle = (o) => {
|
|
6728
6732
|
const { t: n } = useTranslation(), { type: r = "icons", label: a, property: l, onEmitChange: i = () => {
|
|
6729
6733
|
}, units: c, negative: d = !1 } = o, [u] = useDarkMode(), [p] = useStylingState(), [, m] = useCanvasWidth(), g = useCurrentClassByProperty(l), x = useAddClassesToBlocks(), j = useRemoveClassesFromBlocks(), [E] = useSelectedBlockIds(), b = useMemo(() => get(g, "fullCls", ""), [g]), k = useCallback(
|
|
6730
|
-
(
|
|
6731
|
-
const P = { dark: u, mq: m, mod: p, cls:
|
|
6734
|
+
(N, L = !0) => {
|
|
6735
|
+
const P = { dark: u, mq: m, mod: p, cls: N, property: l, fullCls: "" };
|
|
6732
6736
|
(u || p !== "") && (P.mq = "xs");
|
|
6733
6737
|
const f = generateFullClsName(P);
|
|
6734
6738
|
x(E, [f], L);
|
|
6735
6739
|
},
|
|
6736
6740
|
[E, u, m, p, l, x]
|
|
6737
|
-
),
|
|
6741
|
+
), S = useCallback(() => {
|
|
6738
6742
|
j(E, [b]);
|
|
6739
|
-
}, [E, b, j]),
|
|
6743
|
+
}, [E, b, j]), R = useMemo(() => canChangeClass(g, m), [g, m]);
|
|
6740
6744
|
useEffect(() => {
|
|
6741
|
-
i(
|
|
6742
|
-
}, [
|
|
6743
|
-
const [, ,
|
|
6744
|
-
(
|
|
6745
|
-
|
|
6745
|
+
i(R, g);
|
|
6746
|
+
}, [R, i, g]);
|
|
6747
|
+
const [, , _] = useCanvasWidth(), C = useCallback(
|
|
6748
|
+
(N) => {
|
|
6749
|
+
_({
|
|
6746
6750
|
xs: 400,
|
|
6747
6751
|
sm: 640,
|
|
6748
6752
|
md: 800,
|
|
6749
6753
|
lg: 1024,
|
|
6750
6754
|
xl: 1420,
|
|
6751
6755
|
"2xl": 1920
|
|
6752
|
-
}[
|
|
6756
|
+
}[N]);
|
|
6753
6757
|
},
|
|
6754
|
-
[
|
|
6755
|
-
),
|
|
6756
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx(BlockStyleProvider, { canChange:
|
|
6757
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "relative w-[70px] truncate text-xs text-foreground", children: /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: `text-[11px] ${g && !
|
|
6758
|
+
[_]
|
|
6759
|
+
), B = get(g, "dark", null) === u && get(g, "mod", null) === p && get(g, "mq", null) === m;
|
|
6760
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(BlockStyleProvider, { canChange: R, canReset: g && B, children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "group flex flex-row items-center py-2 first:pt-0 last:pb-0", children: [
|
|
6761
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "relative w-[70px] truncate text-xs text-foreground", children: /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: `text-[11px] ${g && !B ? "text-foreground" : ""}`, children: n(a) }) }),
|
|
6758
6762
|
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex flex-row items-center", children: [
|
|
6759
6763
|
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "w-[150px]", children: [
|
|
6760
6764
|
r === "arbitrary" ? /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
@@ -6773,7 +6777,7 @@ const RangeChoices = ({ property: o, onChange: n }) => {
|
|
|
6773
6777
|
r === "color" && /* @__PURE__ */ jsxRuntimeExports.jsx(ColorChoice, { property: l, onChange: k }),
|
|
6774
6778
|
r === "dropdown" && /* @__PURE__ */ jsxRuntimeExports.jsx(DropDownChoices, { label: a, property: l, onChange: k })
|
|
6775
6779
|
] }),
|
|
6776
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `w-[30px] cursor-pointer ${b ? "visible" : "invisible"}`, children:
|
|
6780
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `w-[30px] cursor-pointer ${b ? "visible" : "invisible"}`, children: B ? /* @__PURE__ */ jsxRuntimeExports.jsx("button", { type: "button", onClick: () => S(), title: "Reset", className: "flex px-1.5 text-xs", children: /* @__PURE__ */ jsxRuntimeExports.jsx(CrossCircledIcon, { className: "h-5 w-5 text-blue-500 hover:opacity-80" }) }) : R && g ? /* @__PURE__ */ jsxRuntimeExports.jsxs(Tooltip, { delayDuration: 100, children: [
|
|
6777
6781
|
/* @__PURE__ */ jsxRuntimeExports.jsx(TooltipTrigger, { asChild: !0, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
6778
6782
|
"button",
|
|
6779
6783
|
{
|
|
@@ -6793,7 +6797,7 @@ const RangeChoices = ({ property: o, onChange: n }) => {
|
|
|
6793
6797
|
"button",
|
|
6794
6798
|
{
|
|
6795
6799
|
type: "button",
|
|
6796
|
-
onClick: () =>
|
|
6800
|
+
onClick: () => C(get(g, "mq")),
|
|
6797
6801
|
className: "block w-full cursor-default text-right font-semibold text-blue-500",
|
|
6798
6802
|
children: [
|
|
6799
6803
|
"Switch to ",
|
|
@@ -6866,7 +6870,7 @@ const RangeChoices = ({ property: o, onChange: n }) => {
|
|
|
6866
6870
|
}, [a, n]);
|
|
6867
6871
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs("details", { children: [
|
|
6868
6872
|
/* @__PURE__ */ jsxRuntimeExports.jsx("summary", { className: "my-px cursor-default rounded-md bg-gray-50 p-px px-2 text-[11px] text-foreground dark:bg-gray-800", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "inline", children: [
|
|
6869
|
-
r(o.toLowerCase()),
|
|
6873
|
+
startCase(r(o.toLowerCase())),
|
|
6870
6874
|
l ? /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
6871
6875
|
"span",
|
|
6872
6876
|
{
|
|
@@ -6893,7 +6897,7 @@ const RangeChoices = ({ property: o, onChange: n }) => {
|
|
|
6893
6897
|
[r]
|
|
6894
6898
|
), l = useMemo(() => ({}), []);
|
|
6895
6899
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(SectionContext.Provider, { value: l, children: /* @__PURE__ */ jsxRuntimeExports.jsxs(AccordionItem, { value: o.heading, className: "border-none", children: [
|
|
6896
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(AccordionTrigger, { className: "border-b border-border py-2 text-xs", children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex items-center", children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex items-center gap-x-2 text-sm font-bold", children: n(o.heading) }) }) }),
|
|
6900
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(AccordionTrigger, { className: "border-b border-border py-2 text-xs", children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex items-center", children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex items-center gap-x-2 text-sm font-bold", children: startCase(n(o.heading)) }) }) }),
|
|
6897
6901
|
/* @__PURE__ */ jsxRuntimeExports.jsx(AccordionContent, { className: "py-2", children: React__default.Children.toArray(
|
|
6898
6902
|
o.items.map((i) => has(i, "component") ? React__default.createElement(i.component, { key: i.label }) : has(i, "styleType") ? i.styleType === "multiple" ? /* @__PURE__ */ jsxRuntimeExports.jsx(MultipleChoices, { ...i }, i.label) : i.styleType === "accordion" && a(i == null ? void 0 : i.conditions) ? /* @__PURE__ */ jsxRuntimeExports.jsx(NestedOptions, { ...i }, i.label) : null : /* @__PURE__ */ jsxRuntimeExports.jsx(BlockStyle, { ...i }, i.label))
|
|
6899
6903
|
) })
|
|
@@ -7030,7 +7034,7 @@ function UILibrariesSelect({
|
|
|
7030
7034
|
}) {
|
|
7031
7035
|
const { t: a } = useTranslation();
|
|
7032
7036
|
return n ? /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "h-12", children: [
|
|
7033
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-xs font-bold text-gray-500", children: a("
|
|
7037
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-xs font-bold text-gray-500", children: a("Choose library") }),
|
|
7034
7038
|
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
7035
7039
|
ChaiSelect$1,
|
|
7036
7040
|
{
|
|
@@ -7051,8 +7055,8 @@ const BlockCard = ({
|
|
|
7051
7055
|
parentId: r = void 0
|
|
7052
7056
|
}) => {
|
|
7053
7057
|
const [a, l] = useState(!1), i = useBuilderProp("getUILibraryBlock", noop), { addCoreBlock: c, addPredefinedBlock: d } = useAddBlock(), [, u] = useSelectedBlockIds(), { clearHighlight: p } = useBlockHighlight(), m = get(o, "name", get(o, "label")), g = useFeature("dnd"), [, x] = useAtom$1(draggedBlockAtom), j = (k) => {
|
|
7054
|
-
const
|
|
7055
|
-
return k._type === "Box" &&
|
|
7058
|
+
const S = has(k, "styles_attrs.data-page-section");
|
|
7059
|
+
return k._type === "Box" && S;
|
|
7056
7060
|
}, E = useCallback(
|
|
7057
7061
|
async (k) => {
|
|
7058
7062
|
if (k.stopPropagation(), has(o, "component")) {
|
|
@@ -7060,23 +7064,23 @@ const BlockCard = ({
|
|
|
7060
7064
|
return;
|
|
7061
7065
|
}
|
|
7062
7066
|
l(!0);
|
|
7063
|
-
const
|
|
7064
|
-
isEmpty(
|
|
7067
|
+
const S = await i(n, o);
|
|
7068
|
+
isEmpty(S) || d(syncBlocksWithDefaults(S), r), emitChaiBuilderMsg({ name: CHAI_BUILDER_EVENTS.CLOSE_ADD_BLOCK });
|
|
7065
7069
|
},
|
|
7066
7070
|
[o]
|
|
7067
7071
|
), b = async (k) => {
|
|
7068
|
-
const
|
|
7069
|
-
let
|
|
7070
|
-
if (j(first(
|
|
7071
|
-
const
|
|
7072
|
-
if (k.dataTransfer.setData("text/plain", JSON.stringify(
|
|
7073
|
-
const
|
|
7074
|
-
|
|
7075
|
-
k.dataTransfer.setDragImage(
|
|
7072
|
+
const S = await i(n, o);
|
|
7073
|
+
let R = r;
|
|
7074
|
+
if (j(first(S)) && (R = null), !isEmpty(S)) {
|
|
7075
|
+
const _ = { blocks: S, uiLibrary: !0, parent: R };
|
|
7076
|
+
if (k.dataTransfer.setData("text/plain", JSON.stringify(_)), o.preview) {
|
|
7077
|
+
const C = new Image();
|
|
7078
|
+
C.src = o.preview, C.onload = () => {
|
|
7079
|
+
k.dataTransfer.setDragImage(C, 0, 0);
|
|
7076
7080
|
};
|
|
7077
7081
|
} else
|
|
7078
7082
|
k.dataTransfer.setDragImage(new Image(), 0, 0);
|
|
7079
|
-
x(
|
|
7083
|
+
x(_), setTimeout(() => {
|
|
7080
7084
|
u([]), p(), emitChaiBuilderMsg({ name: CHAI_BUILDER_EVENTS.CLOSE_ADD_BLOCK });
|
|
7081
7085
|
}, 200);
|
|
7082
7086
|
}
|
|
@@ -7117,9 +7121,9 @@ const BlockCard = ({
|
|
|
7117
7121
|
})();
|
|
7118
7122
|
}, [o, l, i, c]), { data: l || [], isLoading: i === "loading" };
|
|
7119
7123
|
}, UILibrarySection = ({ parentId: o }) => {
|
|
7120
|
-
const [n, r] = useAtom$1(selectedLibraryAtom), a = useBuilderProp("uiLibraries", []), l = useChaiBlocks(), i = values(l).filter((
|
|
7124
|
+
const [n, r] = useAtom$1(selectedLibraryAtom), a = useBuilderProp("uiLibraries", []), l = useChaiBlocks(), i = values(l).filter((R) => R.category === "custom"), c = a.find((R) => R.uuid === n) || first(a), { data: d, isLoading: u } = useLibraryBlocks(c), p = groupBy([...d, ...i], "group"), [m, g] = useState("Hero"), x = get(p, m, []), j = useRef(null), { t: E } = useTranslation(), b = (R) => {
|
|
7121
7125
|
j.current && (clearTimeout(j.current), j.current = null), j.current = setTimeout(() => {
|
|
7122
|
-
j.current && g(
|
|
7126
|
+
j.current && g(R);
|
|
7123
7127
|
}, 300);
|
|
7124
7128
|
};
|
|
7125
7129
|
if (u)
|
|
@@ -7127,30 +7131,30 @@ const BlockCard = ({
|
|
|
7127
7131
|
/* @__PURE__ */ jsxRuntimeExports.jsx(Skeleton, { className: "col-span-3 h-full" }),
|
|
7128
7132
|
/* @__PURE__ */ jsxRuntimeExports.jsx(Skeleton, { className: "col-span-9 h-full" })
|
|
7129
7133
|
] });
|
|
7130
|
-
const k = filter(x, (
|
|
7134
|
+
const k = filter(x, (R, _) => _ % 2 === 0), S = filter(x, (R, _) => _ % 2 === 1);
|
|
7131
7135
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "relative mt-2 flex h-full max-h-full overflow-hidden bg-background", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex h-full pt-2", children: [
|
|
7132
7136
|
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex h-full max-h-full w-60 flex-col gap-1 px-1 pr-2", children: [
|
|
7133
7137
|
/* @__PURE__ */ jsxRuntimeExports.jsx(UILibrariesSelect, { library: c == null ? void 0 : c.uuid, setLibrary: r, uiLibraries: a }),
|
|
7134
7138
|
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "mt-2 flex h-full max-h-full w-full flex-1 flex-col", children: [
|
|
7135
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-xs font-bold text-gray-500", children: E("
|
|
7139
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-xs font-bold text-gray-500", children: E("Groups") }),
|
|
7136
7140
|
/* @__PURE__ */ jsxRuntimeExports.jsx("hr", { className: "mt-1 border-border" }),
|
|
7137
7141
|
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "no-scrollbar mt-2 h-full max-h-full flex-1 overflow-y-auto pb-20", children: React__default.Children.toArray(
|
|
7138
|
-
map(p, (
|
|
7142
|
+
map(p, (R, _) => /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
7139
7143
|
"div",
|
|
7140
7144
|
{
|
|
7141
|
-
onMouseEnter: () => b(
|
|
7145
|
+
onMouseEnter: () => b(_),
|
|
7142
7146
|
onMouseLeave: () => clearTimeout(j.current),
|
|
7143
|
-
onClick: () => g(
|
|
7147
|
+
onClick: () => g(_),
|
|
7144
7148
|
className: cn(
|
|
7145
7149
|
"flex w-full cursor-pointer items-center justify-between rounded-md p-2 text-sm text-foreground transition-all ease-in-out hover:bg-gray-200 dark:hover:bg-gray-800",
|
|
7146
|
-
|
|
7150
|
+
_ === m ? "bg-blue-500 text-white hover:bg-blue-600" : ""
|
|
7147
7151
|
),
|
|
7148
7152
|
children: [
|
|
7149
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: capitalize(E(
|
|
7153
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: capitalize(E(_.toLowerCase())) }),
|
|
7150
7154
|
/* @__PURE__ */ jsxRuntimeExports.jsx(CaretRightIcon, { className: "ml-2 h-5 w-5" })
|
|
7151
7155
|
]
|
|
7152
7156
|
},
|
|
7153
|
-
|
|
7157
|
+
_
|
|
7154
7158
|
))
|
|
7155
7159
|
) })
|
|
7156
7160
|
] })
|
|
@@ -7163,10 +7167,10 @@ const BlockCard = ({
|
|
|
7163
7167
|
children: [
|
|
7164
7168
|
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "grid grid-cols-2 gap-2 px-2", children: [
|
|
7165
7169
|
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex flex-col gap-1", children: React__default.Children.toArray(
|
|
7166
|
-
k.map((
|
|
7170
|
+
k.map((R) => /* @__PURE__ */ jsxRuntimeExports.jsx(BlockCard, { parentId: o, block: R, library: c }))
|
|
7167
7171
|
) }),
|
|
7168
7172
|
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex flex-col gap-1", children: React__default.Children.toArray(
|
|
7169
|
-
|
|
7173
|
+
S.map((R) => /* @__PURE__ */ jsxRuntimeExports.jsx(BlockCard, { parentId: o, block: R, library: c }))
|
|
7170
7174
|
) })
|
|
7171
7175
|
] }),
|
|
7172
7176
|
/* @__PURE__ */ jsxRuntimeExports.jsx("br", {}),
|
|
@@ -7176,7 +7180,7 @@ const BlockCard = ({
|
|
|
7176
7180
|
}
|
|
7177
7181
|
)
|
|
7178
7182
|
] }) }) });
|
|
7179
|
-
}, UILibrariesPanel = ({ parentId: o }) => /* @__PURE__ */ jsxRuntimeExports.jsx(UILibrarySection, { parentId: o }), UILibraries = UILibrariesPanel,
|
|
7183
|
+
}, UILibrariesPanel = ({ parentId: o }) => /* @__PURE__ */ jsxRuntimeExports.jsx(UILibrarySection, { parentId: o }), UILibraries = UILibrariesPanel, Core = "Core", Import = "Import", Breakpoints$1 = "Breakpoints", Clear = "Clear", Cancel = "Cancel", Yes = "Yes", Preview = "Preview", Settings = "Settings", Styling = "Styling", Remove = "Remove", Choose = "Choose", Cut = "Cut", Copy = "Copy", Paste = "Paste", Delete = "Delete", classes = "classes", Theme = "Theme", Outline = "Outline", Copied = "Copied", Stop = "Stop", Edit = "Edit", Tag = "Tag", Value = "Value", Images = "Images", Library = "Library", Blocks = "Blocks", Basic = "Basic", Media = "Media", Advanced = "Advanced", Form = "Form", Groups = "Groups", Accordions = "Accordions", Buttons = "Buttons", Layouts = "Layouts", FAQ = "FAQ", Hero = "Hero", Features = "Features", Footer = "Footer", Navbar = "Navbar", Icons = "Icons", Testimonials = "Testimonials", Blog = "Blog", Saved = "Saved", Unsaved = "Unsaved", Randomize = "Randomize", theme_config = {
|
|
7180
7184
|
heading_font: "Heading Font",
|
|
7181
7185
|
body_font: "Body Font",
|
|
7182
7186
|
rounded_corner: "Rounded Corners",
|
|
@@ -7278,85 +7282,152 @@ const BlockCard = ({
|
|
|
7278
7282
|
multiple_choice: "Multiple Choice",
|
|
7279
7283
|
textarea: "Textarea",
|
|
7280
7284
|
rows: "Rows"
|
|
7281
|
-
},
|
|
7282
|
-
|
|
7283
|
-
|
|
7284
|
-
|
|
7285
|
-
|
|
7286
|
-
|
|
7287
|
-
|
|
7288
|
-
|
|
7289
|
-
|
|
7290
|
-
|
|
7291
|
-
|
|
7292
|
-
|
|
7293
|
-
|
|
7294
|
-
|
|
7295
|
-
|
|
7296
|
-
|
|
7297
|
-
|
|
7298
|
-
|
|
7299
|
-
|
|
7300
|
-
|
|
7301
|
-
|
|
7302
|
-
|
|
7303
|
-
|
|
7304
|
-
|
|
7305
|
-
|
|
7306
|
-
|
|
7307
|
-
|
|
7308
|
-
|
|
7309
|
-
|
|
7310
|
-
|
|
7311
|
-
|
|
7312
|
-
|
|
7313
|
-
|
|
7314
|
-
|
|
7315
|
-
mobile_xs_title,
|
|
7316
|
-
mobile_xs_content,
|
|
7317
|
-
mobile_sm_title,
|
|
7318
|
-
mobile_sm_content,
|
|
7319
|
-
tablet_md_title,
|
|
7320
|
-
tablet_md_content,
|
|
7321
|
-
tablet_lg_title,
|
|
7322
|
-
tablet_lg_content,
|
|
7323
|
-
desktop_xl_title,
|
|
7324
|
-
desktop_xl_content,
|
|
7325
|
-
large_desktop_2xl_title,
|
|
7326
|
-
large_desktop_2xl_content,
|
|
7285
|
+
}, Undo = "Undo", Redo = "Redo", Duplicate = "Duplicate", Close = "Close", Selected = "Selected", Select = "Select", Attributes = "Attributes", apply = "apply", presets = "presets", Orientation = "Orientation", Color = "Color", Upload = "Upload", lngEn = {
|
|
7286
|
+
"Add block": "Add Block",
|
|
7287
|
+
"Add blocks": "Add blocks",
|
|
7288
|
+
"Enter or paste TailwindCSS HTML snippet": "Enter or paste TailwindCSS HTML snippet",
|
|
7289
|
+
"Click to add block to page": "Click to add block to page",
|
|
7290
|
+
Core,
|
|
7291
|
+
"Custom Blocks": "Custom Blocks",
|
|
7292
|
+
"UI Library": "UI Library",
|
|
7293
|
+
Import,
|
|
7294
|
+
"Use HTML snippets from Tailwind CSS component libraries": "Use HTML snippets from Tailwind CSS component libraries",
|
|
7295
|
+
"Tailwind HTML snippet": "Tailwind HTML snippet",
|
|
7296
|
+
"Enter your code snippet here": "Enter your code snippet here",
|
|
7297
|
+
"Import HTML": "Import HTML",
|
|
7298
|
+
"Imported HTML Note": "NOTE: Imported html will be added to the currently selected block. If no block is selected, the html will be added to the page.",
|
|
7299
|
+
"Dark Mode": "Dark Mode",
|
|
7300
|
+
"This page has no blocks. Add a block by clicking the + button": "This page has no blocks. Add a block by clicking the + button",
|
|
7301
|
+
"This page is empty": "This page is empty",
|
|
7302
|
+
"Please select a block to edit settings or styles": "Please select a block to edit settings or styles",
|
|
7303
|
+
"Please select a block to Ask AI": "Please select a block to ask AI",
|
|
7304
|
+
"Please select a styling block": "Please select a styling block",
|
|
7305
|
+
"Drop your block here": "Drop your block here",
|
|
7306
|
+
"Use setting": "Use setting",
|
|
7307
|
+
"Mobile (XS)": "Mobile (XS)",
|
|
7308
|
+
"Styles set here are applied to all screen unless edited at higher breakpoint": "Styles set here are applied to all screen unless edited at higher breakpoint",
|
|
7309
|
+
"Mobile landscape (SM)": "Mobile landscape (SM)",
|
|
7310
|
+
"Styles set here are applied at 640px and up unless edited at higher breakpoint": "Styles set here are applied at 640px and up unless edited at higher breakpoint",
|
|
7311
|
+
"Tablet (MD)": "Tablet (MD)",
|
|
7312
|
+
"Styles set here are applied at 768px and up": "Styles set here are applied at 768px and up",
|
|
7313
|
+
"Tablet Landscape (LG)": "Tablet Landscape (LG)",
|
|
7314
|
+
"Styles set here are applied at 1024px and up unless edited at higher breakpoint": "Styles set here are applied at 1024px and up unless edited at higher breakpoint",
|
|
7315
|
+
"Desktop (XL)": "Desktop (XL)",
|
|
7316
|
+
"Styles set here are applied at 1280px and up unless edited at higher breakpoint": "Styles set here are applied at 1280px and up unless edited at higher breakpoint",
|
|
7317
|
+
"Large Desktop (2XL)": "Large Desktop (2XL)",
|
|
7318
|
+
"Styles set here are applied at 1536px and up": "Styles set here are applied at 1536px and up",
|
|
7327
7319
|
Breakpoints: Breakpoints$1,
|
|
7328
|
-
|
|
7329
|
-
|
|
7330
|
-
|
|
7331
|
-
|
|
7332
|
-
|
|
7333
|
-
|
|
7334
|
-
|
|
7335
|
-
|
|
7336
|
-
|
|
7337
|
-
|
|
7338
|
-
|
|
7339
|
-
|
|
7340
|
-
|
|
7341
|
-
|
|
7342
|
-
|
|
7343
|
-
|
|
7344
|
-
|
|
7345
|
-
|
|
7346
|
-
|
|
7347
|
-
|
|
7348
|
-
|
|
7349
|
-
|
|
7350
|
-
|
|
7351
|
-
|
|
7352
|
-
|
|
7353
|
-
|
|
7354
|
-
|
|
7355
|
-
|
|
7356
|
-
|
|
7357
|
-
|
|
7358
|
-
|
|
7359
|
-
|
|
7320
|
+
Clear,
|
|
7321
|
+
"Clear whole canvas?": "Clear whole canvas?",
|
|
7322
|
+
"Are you sure you want to clear the whole canvas?": "Are you sure you want to clear the whole canvas?",
|
|
7323
|
+
Cancel,
|
|
7324
|
+
Yes,
|
|
7325
|
+
Preview,
|
|
7326
|
+
Settings,
|
|
7327
|
+
Styling,
|
|
7328
|
+
"Data Provider": "Data Provider",
|
|
7329
|
+
"Remove Provider Confirmation": "Are you sure you want to remove <span class='text-blue-500'>{name}</span> provider?",
|
|
7330
|
+
"Your data provider will be removed from this page and all added data binding will be not visible on blocks.": "Your data provider will be removed from this page and all added data binding will be not visible on blocks.",
|
|
7331
|
+
Remove,
|
|
7332
|
+
"You have no data providers registered. Please add a data provider to your project.": "You have no data providers registered. Please add a data provider to your project.",
|
|
7333
|
+
"Learn more": "Learn more",
|
|
7334
|
+
"Add data providers:": "Add data providers:",
|
|
7335
|
+
"Select a provider": "Select a provider",
|
|
7336
|
+
Choose,
|
|
7337
|
+
"Page data providers:": "Page data providers:",
|
|
7338
|
+
"View Data": "View Data",
|
|
7339
|
+
"Mark as Global": "Mark as Global",
|
|
7340
|
+
"Note: Global blocks are single instances. Editing global blocks will be reflected on all pages using these blocks.": "Note: Global blocks are single instances. Editing global blocks will be reflected on all pages using these blocks.",
|
|
7341
|
+
"Global blocks are indicated with": "Global blocks are indicated with",
|
|
7342
|
+
"Global blocks are available under 'Global' category": "Global blocks are available under 'Global' category",
|
|
7343
|
+
"Enter global block name": "Enter global block name",
|
|
7344
|
+
"Eg: Header, Footer": "Eg: Header, Footer",
|
|
7345
|
+
"{length} blocks selected.": "{length} blocks selected.",
|
|
7346
|
+
Cut,
|
|
7347
|
+
Copy,
|
|
7348
|
+
Paste,
|
|
7349
|
+
Delete,
|
|
7350
|
+
"Clear Selection": "Clear Selection",
|
|
7351
|
+
"This is dev mode. Visit": "This is dev mode. Visit",
|
|
7352
|
+
"to see page preview": "to see page preview",
|
|
7353
|
+
classes,
|
|
7354
|
+
Theme,
|
|
7355
|
+
Outline,
|
|
7356
|
+
"Not supported": "Not supported",
|
|
7357
|
+
"Please use Chrome, Firefox or Safari": "Please use Chrome, Firefox or Safari",
|
|
7358
|
+
"Download Complete": "Download complete",
|
|
7359
|
+
Copied,
|
|
7360
|
+
"Enter Classes": "Enter classes separated by space",
|
|
7361
|
+
"Ask AI": "Ask AI",
|
|
7362
|
+
"Edit with AI": "Edit with AI",
|
|
7363
|
+
"Generating... Please wait...": "Generating... Please wait...",
|
|
7364
|
+
"Saving... Please wait...": "Saving... Please wait...",
|
|
7365
|
+
"Deleting... Please wait...": "Deleting... Please wait...",
|
|
7366
|
+
Stop,
|
|
7367
|
+
"E.g.: This page is about an AI assistant app called Chai Studio. It allows users to create beautiful webpages and edit content with AI": "E.g.: This page is about an AI assistant app called Chai Studio. It allows users to create beautiful webpages and edit content with AI.",
|
|
7368
|
+
"Ask AI to edit styles": "Ask AI to edit styles",
|
|
7369
|
+
"Ask AI to edit content": "Ask AI to edit content",
|
|
7370
|
+
"AI Context": "AI Context",
|
|
7371
|
+
"Select Block for AI": "Select a block to edit with AI",
|
|
7372
|
+
"Select Block to Edit": "Please select a block to edit",
|
|
7373
|
+
Edit,
|
|
7374
|
+
"Describe this page. E.g.: This page is about...": "Describe this page. E.g.: This page is about...",
|
|
7375
|
+
Tag,
|
|
7376
|
+
Value,
|
|
7377
|
+
"Background Image": "Background Image",
|
|
7378
|
+
"Enter image URL": "Enter image URL",
|
|
7379
|
+
"Replace image": "Replace image",
|
|
7380
|
+
"Choose image": "Choose image",
|
|
7381
|
+
Images,
|
|
7382
|
+
Library,
|
|
7383
|
+
Blocks,
|
|
7384
|
+
Basic,
|
|
7385
|
+
Media,
|
|
7386
|
+
Advanced,
|
|
7387
|
+
Form,
|
|
7388
|
+
"Choose Icon or SVG": "Choose an icon or enter SVG",
|
|
7389
|
+
Groups,
|
|
7390
|
+
"UI Libraries": "UI Libraries",
|
|
7391
|
+
Accordions,
|
|
7392
|
+
Buttons,
|
|
7393
|
+
Layouts,
|
|
7394
|
+
"Choose Library": "Choose library",
|
|
7395
|
+
"No Library Found": "No library found.",
|
|
7396
|
+
FAQ,
|
|
7397
|
+
Hero,
|
|
7398
|
+
Features,
|
|
7399
|
+
Footer,
|
|
7400
|
+
Navbar,
|
|
7401
|
+
Icons,
|
|
7402
|
+
Testimonials,
|
|
7403
|
+
Blog,
|
|
7404
|
+
"Remove context": "Remove context",
|
|
7405
|
+
"Yes, Delete": "Yes, Delete",
|
|
7406
|
+
"AI Context Updated": "AI Context Updated",
|
|
7407
|
+
"You can now ask AI to edit your content.": "You can now ask AI to edit your content.",
|
|
7408
|
+
Saved,
|
|
7409
|
+
Unsaved,
|
|
7410
|
+
"Saving...": "Saving...",
|
|
7411
|
+
"Improve writing": "Improve writing",
|
|
7412
|
+
"Replace placeholder content": "Replace placeholder content",
|
|
7413
|
+
"Fix grammar": "Fix grammar",
|
|
7414
|
+
"Make longer": "Make longer",
|
|
7415
|
+
"Make shorter": "Make shorter",
|
|
7416
|
+
"Add emojis": "Add emojis",
|
|
7417
|
+
Randomize,
|
|
7418
|
+
"Edit Block": "Edit Block",
|
|
7419
|
+
"AI Assistant": "AI Assistant",
|
|
7420
|
+
"Theme Config": {
|
|
7421
|
+
"Heading Font": "Heading Font",
|
|
7422
|
+
"Body Font": "Body Font",
|
|
7423
|
+
"Rounded Corner": "Rounded Corners",
|
|
7424
|
+
Primary: "Primary",
|
|
7425
|
+
Secondary: "Secondary",
|
|
7426
|
+
Background: "Background",
|
|
7427
|
+
"Text Color": "Text Color",
|
|
7428
|
+
"Background Dark Mode": "Background (Dark Mode)",
|
|
7429
|
+
"Text Color Dark Mode": "Text Color (Dark Mode)"
|
|
7430
|
+
},
|
|
7360
7431
|
"flex.heading": "Flex Child",
|
|
7361
7432
|
"flex.basis": "Basis",
|
|
7362
7433
|
"flex.order": "Order",
|
|
@@ -7527,71 +7598,60 @@ const BlockCard = ({
|
|
|
7527
7598
|
"classes.heading": "Classes",
|
|
7528
7599
|
theme_config,
|
|
7529
7600
|
web_blocks,
|
|
7530
|
-
|
|
7531
|
-
|
|
7532
|
-
|
|
7533
|
-
|
|
7534
|
-
|
|
7535
|
-
|
|
7536
|
-
|
|
7537
|
-
|
|
7538
|
-
|
|
7539
|
-
|
|
7540
|
-
|
|
7541
|
-
|
|
7542
|
-
|
|
7543
|
-
|
|
7544
|
-
|
|
7545
|
-
|
|
7546
|
-
|
|
7547
|
-
|
|
7548
|
-
|
|
7549
|
-
|
|
7550
|
-
|
|
7551
|
-
|
|
7552
|
-
|
|
7553
|
-
|
|
7554
|
-
|
|
7555
|
-
|
|
7556
|
-
|
|
7557
|
-
|
|
7558
|
-
|
|
7559
|
-
|
|
7560
|
-
|
|
7561
|
-
|
|
7562
|
-
|
|
7563
|
-
|
|
7564
|
-
|
|
7565
|
-
|
|
7566
|
-
|
|
7567
|
-
|
|
7568
|
-
|
|
7569
|
-
|
|
7570
|
-
|
|
7571
|
-
|
|
7572
|
-
|
|
7573
|
-
|
|
7574
|
-
|
|
7575
|
-
|
|
7576
|
-
|
|
7577
|
-
|
|
7578
|
-
|
|
7579
|
-
|
|
7580
|
-
|
|
7581
|
-
|
|
7582
|
-
|
|
7583
|
-
|
|
7584
|
-
footer,
|
|
7585
|
-
navbar,
|
|
7586
|
-
icons,
|
|
7587
|
-
testimonials,
|
|
7588
|
-
blog,
|
|
7589
|
-
ai_quick_prompts,
|
|
7590
|
-
sidebar,
|
|
7591
|
-
remove_context,
|
|
7592
|
-
yes_delete,
|
|
7593
|
-
ai_context_updated,
|
|
7594
|
-
you_can_now_ask_ai_to_edit_your_content
|
|
7601
|
+
"Copy classes to clipboard": "Copy classes to clipboard",
|
|
7602
|
+
"Classes copied to clipboard": "Classes copied to clipboard",
|
|
7603
|
+
"Show hidden blocks": "Show hidden blocks",
|
|
7604
|
+
"Expand all": "Expand all",
|
|
7605
|
+
"Collapse all": "Collapse all",
|
|
7606
|
+
"Choose library": "Choose library",
|
|
7607
|
+
"Close Preview": "Close Preview",
|
|
7608
|
+
Error: "Error",
|
|
7609
|
+
"Failed to copy template": "Failed to copy template",
|
|
7610
|
+
"Total tokens used": "Total tokens used",
|
|
7611
|
+
"Updated AI Context": "Updated AI Context",
|
|
7612
|
+
"You can now Ask AI to edit your content": "You can now Ask AI to edit your content",
|
|
7613
|
+
"Tell about this page eg this page is about": "Tell about this page eg this page is about..",
|
|
7614
|
+
"Delete Context": "Delete Context",
|
|
7615
|
+
"Keyboard shortcuts": "Keyboard shortcuts",
|
|
7616
|
+
Undo,
|
|
7617
|
+
Redo,
|
|
7618
|
+
Duplicate,
|
|
7619
|
+
"Deselect blocks": "Deselect blocks",
|
|
7620
|
+
"Delete block": "Delete block",
|
|
7621
|
+
"Save page": "Save page",
|
|
7622
|
+
"Scripts will be only executed in preview and live mode.": "Scripts will be only executed in preview and live mode.",
|
|
7623
|
+
"HTML Code Editor |": "HTML Code Editor |",
|
|
7624
|
+
Close,
|
|
7625
|
+
"Coming soon": "Coming soon",
|
|
7626
|
+
Selected,
|
|
7627
|
+
Select,
|
|
7628
|
+
"Choose Builder Layout": "Choose Builder Layout",
|
|
7629
|
+
"Single side panel": "Single side panel",
|
|
7630
|
+
"Suitable for smaller screens. Bigger canvas size.": "Suitable for smaller screens. Bigger canvas size.",
|
|
7631
|
+
"Dual side panel": "Dual side panel",
|
|
7632
|
+
"Suitable for larger screens. Smaller canvas size.": "Suitable for larger screens. Smaller canvas size.",
|
|
7633
|
+
"Dual side panel advanced": "Dual side panel advanced",
|
|
7634
|
+
"Suitable for heavy styling & block editing. Setting are always visible.": "Suitable for heavy styling & block editing. Setting are always visible.",
|
|
7635
|
+
"Block Settings": "Block Settings",
|
|
7636
|
+
"Visibility settings": "Visibility settings",
|
|
7637
|
+
"Show on canvas": "Show on canvas",
|
|
7638
|
+
Attributes,
|
|
7639
|
+
"Apply Presets": "Apply Presets",
|
|
7640
|
+
apply,
|
|
7641
|
+
presets,
|
|
7642
|
+
"Global presets": "Global presets",
|
|
7643
|
+
Orientation,
|
|
7644
|
+
Color,
|
|
7645
|
+
"Please select an image": "Please select an image",
|
|
7646
|
+
"click to upload": "click to upload",
|
|
7647
|
+
"SVG, PNG, JPG or GIF (Max. 2mb)": "SVG, PNG, JPG or GIF (Max. 2mb)",
|
|
7648
|
+
"Uploading...": "Uploading...",
|
|
7649
|
+
Upload,
|
|
7650
|
+
"Something went wrong": "Something went wrong",
|
|
7651
|
+
"Fetching...": "Fetching...",
|
|
7652
|
+
"No images found": "No images found",
|
|
7653
|
+
"It looks like you haven't uploaded any images yet. Start by clicking the upload button above.": "It looks like you haven't uploaded any images yet. Start by clicking the upload button above.",
|
|
7654
|
+
"Open Code Editor": "Open Code Editor"
|
|
7595
7655
|
};
|
|
7596
7656
|
i18n.use(initReactI18next).init({
|
|
7597
7657
|
// the translations
|
|
@@ -7674,7 +7734,7 @@ const CoreBlock = ({ block: o, disabled: n, parentId: r }) => {
|
|
|
7674
7734
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: cn("flex h-full w-full flex-col overflow-hidden", o), children: [
|
|
7675
7735
|
n ? /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "mb-2 flex flex-col justify-between rounded-md bg-background/30 p-1", children: [
|
|
7676
7736
|
/* @__PURE__ */ jsxRuntimeExports.jsx("h1", { className: "flex flex-col items-baseline px-1 text-xl font-semibold xl:flex-col", children: a("Add block") }),
|
|
7677
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "p-0 text-xs font-light leading-3 opacity-80 xl:pl-1", children: a(l === "html" ? "
|
|
7737
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "p-0 text-xs font-light leading-3 opacity-80 xl:pl-1", children: a(l === "html" ? "Enter or paste TailwindCSS HTML snippet" : "Click to add block to page") })
|
|
7678
7738
|
] }) : null,
|
|
7679
7739
|
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
7680
7740
|
Tabs,
|
|
@@ -8042,8 +8102,8 @@ const AIUserPrompt = ({ blockId: o }) => {
|
|
|
8042
8102
|
size: "sm",
|
|
8043
8103
|
children: a ? /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
|
|
8044
8104
|
/* @__PURE__ */ jsxRuntimeExports.jsx(Loader, { className: "h-5 w-5 animate-spin" }),
|
|
8045
|
-
n("
|
|
8046
|
-
] }) : n("
|
|
8105
|
+
n("Generating... Please wait...")
|
|
8106
|
+
] }) : n("Edit with AI")
|
|
8047
8107
|
}
|
|
8048
8108
|
),
|
|
8049
8109
|
a ? /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex flex-col gap-2", children: [
|
|
@@ -8134,14 +8194,14 @@ const AIUserPrompt = ({ blockId: o }) => {
|
|
|
8134
8194
|
size: "sm",
|
|
8135
8195
|
children: c ? /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
|
|
8136
8196
|
/* @__PURE__ */ jsxRuntimeExports.jsx(Loader, { className: "h-5 w-5 animate-spin" }),
|
|
8137
|
-
o("
|
|
8197
|
+
o("Saving... Please wait...")
|
|
8138
8198
|
] }) : o("Save")
|
|
8139
8199
|
}
|
|
8140
8200
|
),
|
|
8141
8201
|
n.trim().length > 0 ? /* @__PURE__ */ jsxRuntimeExports.jsxs(AlertDialog, { children: [
|
|
8142
8202
|
/* @__PURE__ */ jsxRuntimeExports.jsx(AlertDialogTrigger, { asChild: !0, children: /* @__PURE__ */ jsxRuntimeExports.jsx(Button, { disabled: n.trim().length === 0, variant: "ghost", className: "w-fit", size: "sm", children: c ? /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
|
|
8143
8203
|
/* @__PURE__ */ jsxRuntimeExports.jsx(Loader, { className: "h-5 w-5 animate-spin" }),
|
|
8144
|
-
o("
|
|
8204
|
+
o("Deleting... Please wait...")
|
|
8145
8205
|
] }) : o("Delete") }) }),
|
|
8146
8206
|
/* @__PURE__ */ jsxRuntimeExports.jsxs(AlertDialogContent, { children: [
|
|
8147
8207
|
/* @__PURE__ */ jsxRuntimeExports.jsxs(AlertDialogHeader, { children: [
|
|
@@ -8188,32 +8248,32 @@ const AIUserPrompt = ({ blockId: o }) => {
|
|
|
8188
8248
|
return;
|
|
8189
8249
|
}
|
|
8190
8250
|
if (i) {
|
|
8191
|
-
const
|
|
8192
|
-
r(
|
|
8251
|
+
const C = [...a, { key: i, value: d }];
|
|
8252
|
+
r(C), l(a), c(""), u(""), x("");
|
|
8193
8253
|
}
|
|
8194
|
-
}, k = (
|
|
8195
|
-
const
|
|
8196
|
-
r(
|
|
8197
|
-
},
|
|
8198
|
-
m(
|
|
8199
|
-
},
|
|
8254
|
+
}, k = (C) => {
|
|
8255
|
+
const B = a.filter((N, L) => L !== C);
|
|
8256
|
+
r(B), l(B);
|
|
8257
|
+
}, S = (C) => {
|
|
8258
|
+
m(C), c(a[C].key), u(a[C].value);
|
|
8259
|
+
}, R = () => {
|
|
8200
8260
|
if (i.startsWith("@")) {
|
|
8201
8261
|
x("Attribute keys cannot start with '@'");
|
|
8202
8262
|
return;
|
|
8203
8263
|
}
|
|
8204
8264
|
if (p !== null && i) {
|
|
8205
|
-
const
|
|
8206
|
-
|
|
8265
|
+
const C = [...a];
|
|
8266
|
+
C[p] = { key: i, value: d }, r(C), l(C), m(null), c(""), u(""), x("");
|
|
8207
8267
|
}
|
|
8208
|
-
},
|
|
8209
|
-
|
|
8268
|
+
}, _ = (C) => {
|
|
8269
|
+
C.key === "Enter" && !C.shiftKey && (C.preventDefault(), p !== null ? R() : b());
|
|
8210
8270
|
};
|
|
8211
8271
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "max-w-full", children: [
|
|
8212
8272
|
/* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
8213
8273
|
"form",
|
|
8214
8274
|
{
|
|
8215
|
-
onSubmit: (
|
|
8216
|
-
|
|
8275
|
+
onSubmit: (C) => {
|
|
8276
|
+
C.preventDefault(), p !== null ? R() : b();
|
|
8217
8277
|
},
|
|
8218
8278
|
className: "space-y-3",
|
|
8219
8279
|
children: [
|
|
@@ -8229,7 +8289,7 @@ const AIUserPrompt = ({ blockId: o }) => {
|
|
|
8229
8289
|
id: "attrKey",
|
|
8230
8290
|
ref: j,
|
|
8231
8291
|
value: i,
|
|
8232
|
-
onChange: (
|
|
8292
|
+
onChange: (C) => c(C.target.value),
|
|
8233
8293
|
placeholder: "Key",
|
|
8234
8294
|
className: "h-8 text-sm"
|
|
8235
8295
|
}
|
|
@@ -8247,8 +8307,8 @@ const AIUserPrompt = ({ blockId: o }) => {
|
|
|
8247
8307
|
rows: 2,
|
|
8248
8308
|
ref: E,
|
|
8249
8309
|
value: d,
|
|
8250
|
-
onChange: (
|
|
8251
|
-
onKeyDown:
|
|
8310
|
+
onChange: (C) => u(C.target.value),
|
|
8311
|
+
onKeyDown: _,
|
|
8252
8312
|
placeholder: "Value",
|
|
8253
8313
|
className: "bg-background text-sm"
|
|
8254
8314
|
}
|
|
@@ -8260,22 +8320,22 @@ const AIUserPrompt = ({ blockId: o }) => {
|
|
|
8260
8320
|
]
|
|
8261
8321
|
}
|
|
8262
8322
|
),
|
|
8263
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "mt-4 space-y-1 overflow-y-auto", children: a.map((
|
|
8323
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "mt-4 space-y-1 overflow-y-auto", children: a.map((C, B) => /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center justify-between rounded bg-muted p-1.5 text-sm", children: [
|
|
8264
8324
|
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "mr-2 flex flex-col", children: [
|
|
8265
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "truncate font-semibold", children:
|
|
8266
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-wrap max-w-[200px] text-muted-foreground", children:
|
|
8325
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "truncate font-semibold", children: C.key }),
|
|
8326
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-wrap max-w-[200px] text-muted-foreground", children: C.value.toString() })
|
|
8267
8327
|
] }),
|
|
8268
8328
|
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex-shrink-0", children: [
|
|
8269
|
-
/* @__PURE__ */ jsxRuntimeExports.jsxs(Button, { variant: "ghost", size: "icon", className: "h-6 w-6", onClick: () =>
|
|
8329
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs(Button, { variant: "ghost", size: "icon", className: "h-6 w-6", onClick: () => S(B), children: [
|
|
8270
8330
|
/* @__PURE__ */ jsxRuntimeExports.jsx(Edit2, { className: "h-3 w-3" }),
|
|
8271
8331
|
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "sr-only", children: "Edit attribute" })
|
|
8272
8332
|
] }),
|
|
8273
|
-
/* @__PURE__ */ jsxRuntimeExports.jsxs(Button, { variant: "ghost", size: "icon", className: "h-6 w-6", onClick: () => k(
|
|
8333
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs(Button, { variant: "ghost", size: "icon", className: "h-6 w-6", onClick: () => k(B), children: [
|
|
8274
8334
|
/* @__PURE__ */ jsxRuntimeExports.jsx(X, { className: "h-3 w-3" }),
|
|
8275
8335
|
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "sr-only", children: "Remove attribute" })
|
|
8276
8336
|
] })
|
|
8277
8337
|
] })
|
|
8278
|
-
] },
|
|
8338
|
+
] }, B)) })
|
|
8279
8339
|
] });
|
|
8280
8340
|
}), BlockAttributesEditor = React.memo(() => {
|
|
8281
8341
|
const o = useSelectedBlock(), [n, r] = useState([]), [a] = useSelectedStylingBlocks(), l = useUpdateBlocksProps(), i = `${get(a, "0.prop")}_attrs`;
|
|
@@ -8346,43 +8406,43 @@ const TabletIcon = ({ landscape: o = !1 }) => /* @__PURE__ */ jsxRuntimeExports.
|
|
|
8346
8406
|
}
|
|
8347
8407
|
), WEB_BREAKPOINTS = [
|
|
8348
8408
|
{
|
|
8349
|
-
title: "
|
|
8350
|
-
content: "
|
|
8409
|
+
title: "Mobile (XS)",
|
|
8410
|
+
content: "Styles set here are applied to all screen unless edited at higher breakpoint",
|
|
8351
8411
|
breakpoint: "xs",
|
|
8352
8412
|
icon: /* @__PURE__ */ jsxRuntimeExports.jsx(MobileIcon, {}),
|
|
8353
8413
|
width: 400
|
|
8354
8414
|
},
|
|
8355
8415
|
{
|
|
8356
|
-
title: "
|
|
8357
|
-
content: "
|
|
8416
|
+
title: "Mobile landscape (SM)",
|
|
8417
|
+
content: "Styles set here are applied at 640px and up unless edited at higher breakpoint",
|
|
8358
8418
|
breakpoint: "sm",
|
|
8359
8419
|
icon: /* @__PURE__ */ jsxRuntimeExports.jsx(MobileIcon, { className: "rotate-90" }),
|
|
8360
8420
|
width: 640
|
|
8361
8421
|
},
|
|
8362
8422
|
{
|
|
8363
|
-
title: "
|
|
8364
|
-
content: "
|
|
8423
|
+
title: "Tablet (MD)",
|
|
8424
|
+
content: "Styles set here are applied at 768px and up",
|
|
8365
8425
|
breakpoint: "md",
|
|
8366
8426
|
icon: /* @__PURE__ */ jsxRuntimeExports.jsx(TabletIcon, {}),
|
|
8367
8427
|
width: 800
|
|
8368
8428
|
},
|
|
8369
8429
|
{
|
|
8370
|
-
title: "
|
|
8371
|
-
content: "
|
|
8430
|
+
title: "Tablet Landscape (LG)",
|
|
8431
|
+
content: "Styles set here are applied at 1024px and up unless edited at higher breakpoint",
|
|
8372
8432
|
breakpoint: "lg",
|
|
8373
8433
|
icon: /* @__PURE__ */ jsxRuntimeExports.jsx(TabletIcon, { landscape: !0 }),
|
|
8374
8434
|
width: 1024
|
|
8375
8435
|
},
|
|
8376
8436
|
{
|
|
8377
|
-
title: "
|
|
8378
|
-
content: "
|
|
8437
|
+
title: "Desktop (XL)",
|
|
8438
|
+
content: "Styles set here are applied at 1280px and up unless edited at higher breakpoint",
|
|
8379
8439
|
breakpoint: "xl",
|
|
8380
8440
|
icon: /* @__PURE__ */ jsxRuntimeExports.jsx(LaptopIcon, {}),
|
|
8381
8441
|
width: 1420
|
|
8382
8442
|
},
|
|
8383
8443
|
{
|
|
8384
|
-
title: "
|
|
8385
|
-
content: "
|
|
8444
|
+
title: "Large Desktop (2XL)",
|
|
8445
|
+
content: "Styles set here are applied at 1536px and up",
|
|
8386
8446
|
breakpoint: "2xl",
|
|
8387
8447
|
icon: /* @__PURE__ */ jsxRuntimeExports.jsx(DesktopIcon, {}),
|
|
8388
8448
|
width: 1920
|
|
@@ -8451,7 +8511,7 @@ const TabletIcon = ({ landscape: o = !1 }) => /* @__PURE__ */ jsxRuntimeExports.
|
|
|
8451
8511
|
] }) }),
|
|
8452
8512
|
/* @__PURE__ */ jsxRuntimeExports.jsxs(AlertDialogContent, { className: "border-border", children: [
|
|
8453
8513
|
/* @__PURE__ */ jsxRuntimeExports.jsxs(AlertDialogHeader, { children: [
|
|
8454
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(AlertDialogTitle, { className: "text-foreground", children: o("Clear
|
|
8514
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(AlertDialogTitle, { className: "text-foreground", children: o("Clear whole canvas? ") }),
|
|
8455
8515
|
/* @__PURE__ */ jsxRuntimeExports.jsx(AlertDialogDescription, { children: o("Are you sure you want to clear the page?") })
|
|
8456
8516
|
] }),
|
|
8457
8517
|
/* @__PURE__ */ jsxRuntimeExports.jsxs(AlertDialogFooter, { children: [
|
|
@@ -8460,43 +8520,6 @@ const TabletIcon = ({ landscape: o = !1 }) => /* @__PURE__ */ jsxRuntimeExports.
|
|
|
8460
8520
|
] })
|
|
8461
8521
|
] })
|
|
8462
8522
|
] }) });
|
|
8463
|
-
}, LanguageSelector = () => {
|
|
8464
|
-
const { fallbackLang: o, languages: n, selectedLang: r, setSelectedLang: a } = useLanguages(), l = (r == null ? void 0 : r.length) > 0 ? r : o, i = useMemo(() => {
|
|
8465
|
-
const c = [];
|
|
8466
|
-
return forEach(uniq([o, ...n]), (d) => {
|
|
8467
|
-
const u = get(LANGUAGES, d);
|
|
8468
|
-
u && c.push({ key: d, value: u, default: d === o });
|
|
8469
|
-
}), c;
|
|
8470
|
-
}, [o, n]);
|
|
8471
|
-
return isEmpty(n) && l === "en" ? null : isEmpty(n) && l !== "en" ? /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center gap-x-1 text-sm text-blue-500 hover:text-blue-600", children: [
|
|
8472
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(FaLanguage, { className: "h-4 w-4" }),
|
|
8473
|
-
get(LANGUAGES, l)
|
|
8474
|
-
] }) : /* @__PURE__ */ jsxRuntimeExports.jsxs(DropdownMenu, { children: [
|
|
8475
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(DropdownMenuTrigger, { asChild: !0, children: /* @__PURE__ */ jsxRuntimeExports.jsxs(Button, { size: "sm", variant: "ghost", className: "flex items-center gap-x-1 text-blue-500 hover:text-blue-600", children: [
|
|
8476
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(FaLanguage, { className: "h-4 w-4" }),
|
|
8477
|
-
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center space-x-2", children: [
|
|
8478
|
-
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
|
|
8479
|
-
" ",
|
|
8480
|
-
get(LANGUAGES, l)
|
|
8481
|
-
] }),
|
|
8482
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(ChevronDownIcon, { className: "h-4 w-4" })
|
|
8483
|
-
] })
|
|
8484
|
-
] }) }),
|
|
8485
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(DropdownMenuContent, { className: "border-border", children: map(i, (c) => /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
8486
|
-
DropdownMenuItem,
|
|
8487
|
-
{
|
|
8488
|
-
className: cn(
|
|
8489
|
-
"flex cursor-pointer items-center text-sm",
|
|
8490
|
-
c.key === l && "!bg-blue-500 text-white hover:!text-white"
|
|
8491
|
-
),
|
|
8492
|
-
onClick: () => a(c.key),
|
|
8493
|
-
children: [
|
|
8494
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: c.value }),
|
|
8495
|
-
c.key === o ? /* @__PURE__ */ jsxRuntimeExports.jsx(FaStar, { className: "ml-2 h-4 w-4 text-yellow-400" }) : null
|
|
8496
|
-
]
|
|
8497
|
-
}
|
|
8498
|
-
)) })
|
|
8499
|
-
] });
|
|
8500
8523
|
}, CanvasTopBar = () => {
|
|
8501
8524
|
const o = useBuilderProp("darkMode", !0), [n] = useCanvasZoom();
|
|
8502
8525
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex h-10 items-center justify-between border-b border-border bg-background/70 px-2", children: [
|
|
@@ -8518,10 +8541,7 @@ const TabletIcon = ({ landscape: o = !1 }) => /* @__PURE__ */ jsxRuntimeExports.
|
|
|
8518
8541
|
/* @__PURE__ */ jsxRuntimeExports.jsx(Separator, { orientation: "vertical" }),
|
|
8519
8542
|
/* @__PURE__ */ jsxRuntimeExports.jsx(UndoRedo, {})
|
|
8520
8543
|
] }),
|
|
8521
|
-
/* @__PURE__ */ jsxRuntimeExports.
|
|
8522
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(LanguageSelector, {}),
|
|
8523
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(ClearCanvas, {})
|
|
8524
|
-
] })
|
|
8544
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex h-full items-center space-x-2", children: /* @__PURE__ */ jsxRuntimeExports.jsx(ClearCanvas, {}) })
|
|
8525
8545
|
] });
|
|
8526
8546
|
};
|
|
8527
8547
|
function BlockAttributesToggle() {
|
|
@@ -8545,7 +8565,7 @@ const SettingsPanel = () => {
|
|
|
8545
8565
|
const o = useSelectedBlock(), { t: n } = useTranslation(), r = useBuilderProp("onError", noop);
|
|
8546
8566
|
return isNull(o) ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "p-4 text-center", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "space-y-4 rounded-xl p-4 text-muted-foreground", children: [
|
|
8547
8567
|
/* @__PURE__ */ jsxRuntimeExports.jsx(MixerHorizontalIcon, { className: "mx-auto text-3xl" }),
|
|
8548
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("h1", { children: n("
|
|
8568
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("h1", { children: n("Please select a block to edit settings or styles") })
|
|
8549
8569
|
] }) }) : /* @__PURE__ */ jsxRuntimeExports.jsx(ErrorBoundary, { fallback: /* @__PURE__ */ jsxRuntimeExports.jsx(FallbackError, {}), onError: r, children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "relative flex max-h-full w-full flex-col", children: [
|
|
8550
8570
|
/* @__PURE__ */ jsxRuntimeExports.jsx(BlockSettings, {}),
|
|
8551
8571
|
/* @__PURE__ */ jsxRuntimeExports.jsx("br", {}),
|
|
@@ -8684,7 +8704,7 @@ const ChooseLayout = ({ open: o, close: n }) => {
|
|
|
8684
8704
|
}, [o]), o ? /* @__PURE__ */ jsxRuntimeExports.jsx(Dialog, { onOpenChange: (c) => c ? "" : n(), defaultOpen: !0, children: /* @__PURE__ */ jsxRuntimeExports.jsxs(DialogContent, { className: "border-border", children: [
|
|
8685
8705
|
/* @__PURE__ */ jsxRuntimeExports.jsxs(DialogHeader, { children: [
|
|
8686
8706
|
/* @__PURE__ */ jsxRuntimeExports.jsxs(DialogTitle, { className: "text-foreground", children: [
|
|
8687
|
-
r("
|
|
8707
|
+
r("Data Provider"),
|
|
8688
8708
|
": ",
|
|
8689
8709
|
o.name
|
|
8690
8710
|
] }),
|
|
@@ -8718,14 +8738,14 @@ function RemoveProviderConfirmation({
|
|
|
8718
8738
|
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
8719
8739
|
AlertDialogTitle,
|
|
8720
8740
|
{
|
|
8721
|
-
dangerouslySetInnerHTML: { __html: a("
|
|
8741
|
+
dangerouslySetInnerHTML: { __html: a("Remove Provider Confirmation").replace("{name}", n) }
|
|
8722
8742
|
}
|
|
8723
8743
|
),
|
|
8724
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(AlertDialogDescription, { children: a("
|
|
8744
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(AlertDialogDescription, { children: a("Your data provider will be removed from this page and all added data binding will be not visible on blocks.") })
|
|
8725
8745
|
] }),
|
|
8726
8746
|
/* @__PURE__ */ jsxRuntimeExports.jsxs(AlertDialogFooter, { children: [
|
|
8727
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(AlertDialogCancel, { children: a("
|
|
8728
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(AlertDialogAction, { onClick: r, className: "bg-red-600 hover:bg-red-700", children: a("
|
|
8747
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(AlertDialogCancel, { children: a("Cancel") }),
|
|
8748
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(AlertDialogAction, { onClick: r, className: "bg-red-600 hover:bg-red-700", children: a("Remove") })
|
|
8729
8749
|
] })
|
|
8730
8750
|
] })
|
|
8731
8751
|
] });
|
|
@@ -8738,28 +8758,28 @@ const PageDataProviders = () => {
|
|
|
8738
8758
|
(b) => !isNull(b)
|
|
8739
8759
|
), x = (b) => {
|
|
8740
8760
|
const k = find(n, { providerKey: b });
|
|
8741
|
-
c((
|
|
8761
|
+
c((S) => [...S, k]), a((S) => [...S, { providerKey: k.providerKey, args: {} }]), u(""), l("UNSAVED");
|
|
8742
8762
|
}, j = (b) => {
|
|
8743
|
-
c((k) => filter(k, (
|
|
8763
|
+
c((k) => filter(k, (S) => S.providerKey !== b.providerKey)), a((k) => filter(k, (S) => S.providerKey !== b.providerKey)), l("UNSAVED");
|
|
8744
8764
|
}, E = (b) => m(b);
|
|
8745
8765
|
return isEmpty(n) ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: /* @__PURE__ */ jsxRuntimeExports.jsxs("p", { className: "mb-1.5 p-4 text-xs text-gray-500", children: [
|
|
8746
|
-
o("
|
|
8766
|
+
o("You have no data providers registered. Please add a data provider to your project."),
|
|
8747
8767
|
/* @__PURE__ */ jsxRuntimeExports.jsx("br", {}),
|
|
8748
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("a", { className: "text-blue-500", href: "https://chaibuilder.com/docs/registering-data-providers", target: "_blank", children: o("
|
|
8768
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("a", { className: "text-blue-500", href: "https://chaibuilder.com/docs/registering-data-providers", target: "_blank", children: o("Learn more") })
|
|
8749
8769
|
] }) }) : /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "px-1", children: [
|
|
8750
8770
|
/* @__PURE__ */ jsxRuntimeExports.jsx("br", {}),
|
|
8751
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("label", { children: /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "mb-1.5 text-xs text-gray-500", children: o("
|
|
8752
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex items-center space-x-1", children: /* @__PURE__ */ jsxRuntimeExports.jsxs(Select, { value: d, onValueChange: (b) => x(b), children: [
|
|
8753
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(SelectTrigger, { className: "w-full", children: /* @__PURE__ */ jsxRuntimeExports.jsx(SelectValue, { placeholder: o("
|
|
8771
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("label", { children: /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "mb-1.5 text-xs text-gray-500", children: o("Add data providers:") }) }),
|
|
8772
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex items-center space-x-1", children: /* @__PURE__ */ jsxRuntimeExports.jsxs(Select$1, { value: d, onValueChange: (b) => x(b), children: [
|
|
8773
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(SelectTrigger, { className: "w-full", children: /* @__PURE__ */ jsxRuntimeExports.jsx(SelectValue, { placeholder: o("Select a provider") }) }),
|
|
8754
8774
|
/* @__PURE__ */ jsxRuntimeExports.jsxs(SelectContent, { children: [
|
|
8755
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(SelectItem, { value: "", children: o("
|
|
8775
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(SelectItem, { value: "", children: o("Choose") }),
|
|
8756
8776
|
g.map((b) => /* @__PURE__ */ jsxRuntimeExports.jsx(SelectItem, { value: b.value, children: b.label }, b.value))
|
|
8757
8777
|
] })
|
|
8758
8778
|
] }) }),
|
|
8759
8779
|
/* @__PURE__ */ jsxRuntimeExports.jsx("br", {}),
|
|
8760
8780
|
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: `border-t border-border ${i.length ? "block" : "hidden"}`, children: [
|
|
8761
8781
|
/* @__PURE__ */ jsxRuntimeExports.jsxs("p", { className: "flex-1 pb-1.5 pt-4 text-xs font-medium text-gray-500", children: [
|
|
8762
|
-
o("
|
|
8782
|
+
o("Page Data Providers"),
|
|
8763
8783
|
":"
|
|
8764
8784
|
] }),
|
|
8765
8785
|
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "space-y-2", children: i.map((b) => /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
@@ -8798,7 +8818,7 @@ const PageDataProviders = () => {
|
|
|
8798
8818
|
]
|
|
8799
8819
|
}
|
|
8800
8820
|
),
|
|
8801
|
-
o("
|
|
8821
|
+
o("View Data")
|
|
8802
8822
|
]
|
|
8803
8823
|
}
|
|
8804
8824
|
),
|
|
@@ -8823,7 +8843,7 @@ const PageDataProviders = () => {
|
|
|
8823
8843
|
]
|
|
8824
8844
|
}
|
|
8825
8845
|
),
|
|
8826
|
-
o("
|
|
8846
|
+
o("Remove")
|
|
8827
8847
|
] }) })
|
|
8828
8848
|
] })
|
|
8829
8849
|
]
|
|
@@ -8837,22 +8857,22 @@ const PageDataProviders = () => {
|
|
|
8837
8857
|
function AiFillDatabase(o) {
|
|
8838
8858
|
return GenIcon({ tag: "svg", attr: { viewBox: "0 0 1024 1024" }, child: [{ tag: "path", attr: { d: "M832 64H192c-17.7 0-32 14.3-32 32v224h704V96c0-17.7-14.3-32-32-32zM288 232c-22.1 0-40-17.9-40-40s17.9-40 40-40 40 17.9 40 40-17.9 40-40 40zM160 928c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V704H160v224zm128-136c22.1 0 40 17.9 40 40s-17.9 40-40 40-40-17.9-40-40 17.9-40 40-40zM160 640h704V384H160v256zm128-168c22.1 0 40 17.9 40 40s-17.9 40-40 40-40-17.9-40-40 17.9-40 40-40z" }, child: [] }] })(o);
|
|
8839
8859
|
}
|
|
8840
|
-
const TopBar = lazy(() => import("./Topbar-
|
|
8860
|
+
const TopBar = lazy(() => import("./Topbar-ehvnRhOq.js"));
|
|
8841
8861
|
function useSidebarMenuItems(o) {
|
|
8842
8862
|
const n = o === "SINGLE_SIDE_PANEL", { t: r } = useTranslation(), a = useBuilderProp("dataBindingSupport", !1), l = useBuilderProp("askAiCallBack", null);
|
|
8843
8863
|
return useMemo(() => {
|
|
8844
8864
|
const i = [
|
|
8845
8865
|
{
|
|
8846
8866
|
icon: /* @__PURE__ */ jsxRuntimeExports.jsx(Layers, { size: 20 }),
|
|
8847
|
-
label: "
|
|
8867
|
+
label: "Outline",
|
|
8848
8868
|
component: () => /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "-mt-8", children: /* @__PURE__ */ jsxRuntimeExports.jsx(Outline$1, {}) })
|
|
8849
8869
|
},
|
|
8850
|
-
n ? { icon: /* @__PURE__ */ jsxRuntimeExports.jsx(GearIcon, { className: "size-5" }), label: "
|
|
8870
|
+
n ? { icon: /* @__PURE__ */ jsxRuntimeExports.jsx(GearIcon, { className: "size-5" }), label: "Edit Block", component: SettingsPanel$1 } : null,
|
|
8851
8871
|
a ? { icon: /* @__PURE__ */ jsxRuntimeExports.jsx(AiFillDatabase, { className: "size-3" }), label: r("Data Providers"), component: PageDataProviders } : null,
|
|
8852
|
-
l ? { icon: /* @__PURE__ */ jsxRuntimeExports.jsx(LightningBoltIcon, { className: "size-5" }), label: "
|
|
8872
|
+
l ? { icon: /* @__PURE__ */ jsxRuntimeExports.jsx(LightningBoltIcon, { className: "size-5" }), label: "AI Assistant", component: AskAI } : null,
|
|
8853
8873
|
{
|
|
8854
8874
|
icon: /* @__PURE__ */ jsxRuntimeExports.jsx(PaintBucketIcon, { size: 20 }),
|
|
8855
|
-
label: "
|
|
8875
|
+
label: "Theme",
|
|
8856
8876
|
component: () => /* @__PURE__ */ jsxRuntimeExports.jsx(ThemeOptions, { showHeading: !1 })
|
|
8857
8877
|
}
|
|
8858
8878
|
];
|
|
@@ -8964,7 +8984,7 @@ const RootLayout = () => {
|
|
|
8964
8984
|
return o ? /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: cn("fixed inset-0 z-[999] bg-background", o ? "block" : "hidden"), children: [
|
|
8965
8985
|
/* @__PURE__ */ jsxRuntimeExports.jsxs(Button, { size: "sm", className: "absolute right-0 top-0 m-4 space-x-2", onClick: () => n(!1), children: [
|
|
8966
8986
|
/* @__PURE__ */ jsxRuntimeExports.jsx(EyeClosedIcon, {}),
|
|
8967
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: r("
|
|
8987
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: r("Close Preview") })
|
|
8968
8988
|
] }),
|
|
8969
8989
|
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: a ? /* @__PURE__ */ jsxRuntimeExports.jsx(Suspense, { fallback: /* @__PURE__ */ jsxRuntimeExports.jsx(Skeleton, { className: "h-96 w-full" }), children: React__default.createElement(a) }) : null })
|
|
8970
8990
|
] }) : null;
|
|
@@ -9021,69 +9041,72 @@ const RootLayout = () => {
|
|
|
9021
9041
|
] }) }) });
|
|
9022
9042
|
};
|
|
9023
9043
|
export {
|
|
9024
|
-
|
|
9044
|
+
usePasteBlocks as $,
|
|
9025
9045
|
AddBlocksPanel$1 as A,
|
|
9026
9046
|
BlockSettings as B,
|
|
9027
9047
|
ChaiSelect$1 as C,
|
|
9028
9048
|
DefaultChaiBlocks as D,
|
|
9029
|
-
|
|
9049
|
+
useGlobalBlocksStore as E,
|
|
9030
9050
|
FaCheck as F,
|
|
9031
|
-
|
|
9032
|
-
|
|
9051
|
+
useBlocksStore as G,
|
|
9052
|
+
useUndoManager as H,
|
|
9033
9053
|
ImportHTML$1 as I,
|
|
9034
|
-
|
|
9035
|
-
|
|
9036
|
-
|
|
9037
|
-
|
|
9038
|
-
|
|
9054
|
+
useBuilderReset as J,
|
|
9055
|
+
useAddBlock as K,
|
|
9056
|
+
LANGUAGES as L,
|
|
9057
|
+
useAddClassesToBlocks as M,
|
|
9058
|
+
useCanvasWidth as N,
|
|
9039
9059
|
Outline$1 as O,
|
|
9040
|
-
|
|
9041
|
-
|
|
9042
|
-
|
|
9043
|
-
|
|
9060
|
+
useCanvasZoom as P,
|
|
9061
|
+
useCopyBlockIds as Q,
|
|
9062
|
+
useCopyToClipboard as R,
|
|
9063
|
+
useCurrentPage as S,
|
|
9044
9064
|
ThemeOptions as T,
|
|
9045
9065
|
UILibraries as U,
|
|
9046
|
-
|
|
9047
|
-
|
|
9048
|
-
|
|
9049
|
-
|
|
9050
|
-
|
|
9051
|
-
|
|
9066
|
+
useCutBlockIds as V,
|
|
9067
|
+
useDarkMode as W,
|
|
9068
|
+
useDuplicateBlocks as X,
|
|
9069
|
+
useHiddenBlockIds as Y,
|
|
9070
|
+
useHighlightBlockId as Z,
|
|
9071
|
+
useBlockHighlight as _,
|
|
9052
9072
|
useSelectedBlockIds as a,
|
|
9053
|
-
|
|
9054
|
-
|
|
9055
|
-
|
|
9056
|
-
|
|
9057
|
-
|
|
9058
|
-
|
|
9059
|
-
|
|
9060
|
-
|
|
9061
|
-
|
|
9062
|
-
|
|
9063
|
-
|
|
9073
|
+
useBrandingOptions as a0,
|
|
9074
|
+
useRemoveBlocks as a1,
|
|
9075
|
+
useRemoveClassesFromBlocks as a2,
|
|
9076
|
+
useSelectedBlockCurrentClasses as a3,
|
|
9077
|
+
useSelectedBlockAllClasses as a4,
|
|
9078
|
+
useSelectedBlock as a5,
|
|
9079
|
+
useStylingBreakpoint as a6,
|
|
9080
|
+
useUILibraryBlocks as a7,
|
|
9081
|
+
useStylingState as a8,
|
|
9082
|
+
useSelectedBlocksDisplayChild as a9,
|
|
9083
|
+
useSelectedBreakpoints as aa,
|
|
9084
|
+
useSelectedStylingBlocks as ab,
|
|
9085
|
+
useLayoutVariant as ac,
|
|
9086
|
+
useBlocksStoreUndoableActions as ad,
|
|
9064
9087
|
useUpdateBlocksProps as b,
|
|
9065
9088
|
useUpdateBlocksPropsRealtime as c,
|
|
9066
9089
|
useBuilderProp as d,
|
|
9067
9090
|
useSavePage as e,
|
|
9068
9091
|
usePreviewMode as f,
|
|
9069
|
-
|
|
9070
|
-
|
|
9071
|
-
|
|
9072
|
-
|
|
9073
|
-
|
|
9074
|
-
|
|
9075
|
-
|
|
9076
|
-
|
|
9077
|
-
|
|
9078
|
-
|
|
9079
|
-
|
|
9080
|
-
|
|
9081
|
-
|
|
9082
|
-
|
|
9092
|
+
useLanguages as g,
|
|
9093
|
+
FaLanguage as h,
|
|
9094
|
+
FaStar as i,
|
|
9095
|
+
CanvasArea$1 as j,
|
|
9096
|
+
BlockStyling as k,
|
|
9097
|
+
AddBlocksDialog as l,
|
|
9098
|
+
emitChaiBuilderMsg as m,
|
|
9099
|
+
useChaiBuilderMsgListener as n,
|
|
9100
|
+
CHAI_BUILDER_EVENTS as o,
|
|
9101
|
+
AISetContext as p,
|
|
9102
|
+
AIUserPrompt as q,
|
|
9103
|
+
BlockAttributesEditor as r,
|
|
9104
|
+
ChaiBuilderEditor as s,
|
|
9105
|
+
DarkMode as t,
|
|
9083
9106
|
useCodeEditor as u,
|
|
9084
|
-
|
|
9085
|
-
|
|
9086
|
-
|
|
9087
|
-
|
|
9088
|
-
|
|
9107
|
+
Breakpoints as v,
|
|
9108
|
+
UndoRedo as w,
|
|
9109
|
+
getClassValueAndUnit as x,
|
|
9110
|
+
getBlocksFromHTML as y,
|
|
9111
|
+
useGlobalBlocksList as z
|
|
9089
9112
|
};
|