@chaibuilder/sdk 3.0.4 → 3.0.6
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/{code-editor-BL_76o6w.cjs → code-editor-DFvtVxXd.cjs} +1 -1
- package/dist/{code-editor-tDa4T69w.js → code-editor-GydqqBXp.js} +1 -1
- package/dist/core.cjs +4 -4
- package/dist/core.d.ts +0 -2
- package/dist/core.js +287 -296
- package/dist/{css-import-modal-CgSqJi_w.js → css-import-modal-BvRHCuHm.js} +1 -1
- package/dist/{css-import-modal-BRFVZ9j3.cjs → css-import-modal-DkVfKE_h.cjs} +1 -1
- package/dist/render.cjs +2 -2
- package/dist/render.js +63 -63
- package/dist/{toggle-C5f1IJ1G.cjs → toggle-BaUXILMJ.cjs} +1 -1
- package/dist/{toggle-C6VUu_7m.js → toggle-DrRMNSqS.js} +27 -19
- package/dist/ui.cjs +1 -1
- package/dist/ui.d.ts +3 -1
- package/dist/ui.js +1 -1
- package/dist/web-blocks.cjs +1 -1
- package/dist/web-blocks.js +31 -31
- package/package.json +1 -1
package/dist/core.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
var V = Object.defineProperty;
|
|
2
2
|
var U = (o, n, r) => n in o ? V(o, n, { enumerable: !0, configurable: !0, writable: !0, value: r }) : o[n] = r;
|
|
3
|
-
var
|
|
3
|
+
var $ = (o, n, r) => U(o, typeof n != "symbol" ? n + "" : n, r);
|
|
4
4
|
import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
5
5
|
import { useRegisteredChaiBlocks, getRegisteredChaiBlock, getDefaultBlockProps, useRegisteredFonts, getBlockFormSchemas, syncBlocksWithDefaults } from "@chaibuilder/runtime";
|
|
6
6
|
import { get, find, filter, flatten, has, map, includes, without, compact, reverse, findIndex, isEmpty, isString, each, omit, values, pick, startsWith, isFunction, isObject as isObject$1, memoize, noop, first, keys, range, flattenDeep, set, forEach, unset, chunk, cloneDeep, isNull, isArray, split, reject, take, debounce, startCase, isNumber, parseInt as parseInt$1, isNaN as isNaN$1, toLower, nth, findLast, intersection, toUpper, capitalize, groupBy, uniq, sortBy, round } from "lodash-es";
|
|
7
|
-
import { SquareIcon, ChevronRightIcon, PinTopIcon, PinBottomIcon, PinLeftIcon, PinRightIcon, ArrowUpIcon, PlusIcon, CopyIcon, TrashIcon, DragHandleDots2Icon, FontBoldIcon, FontItalicIcon, UnderlineIcon, StrikethroughIcon, CodeIcon, Link1Icon, ListBulletIcon, HeadingIcon, QuoteIcon, TextAlignLeftIcon, TextAlignCenterIcon, TextAlignRightIcon, ExclamationTriangleIcon, Cross1Icon, Pencil2Icon, ChevronLeftIcon, LoopIcon, IdCardIcon, LetterCaseCapitalizeIcon, ValueIcon, LinkBreak1Icon, EnterFullScreenIcon, PlusCircledIcon, ChevronDownIcon, InfoCircledIcon, FileIcon, DotsVerticalIcon, TriangleDownIcon, RowSpacingIcon, EyeOpenIcon, EyeClosedIcon, BorderAllIcon, WidthIcon, HeightIcon, ArrowRightIcon, ArrowDownIcon, ArrowLeftIcon, ArrowTopLeftIcon, ArrowTopRightIcon, ArrowBottomRightIcon, ArrowBottomLeftIcon, AlignLeftIcon, AlignCenterHorizontallyIcon, AlignRightIcon, StretchHorizontallyIcon, OverlineIcon, LetterCaseUppercaseIcon, Cross2Icon, BoxIcon, MinusIcon, CrossCircledIcon, MobileIcon, LaptopIcon, DesktopIcon, ReloadIcon, MagicWandIcon, MagnifyingGlassIcon, CaretRightIcon,
|
|
7
|
+
import { SquareIcon, ChevronRightIcon, PinTopIcon, PinBottomIcon, PinLeftIcon, PinRightIcon, ArrowUpIcon, PlusIcon, CopyIcon, TrashIcon, DragHandleDots2Icon, FontBoldIcon, FontItalicIcon, UnderlineIcon, StrikethroughIcon, CodeIcon, Link1Icon, ListBulletIcon, HeadingIcon, QuoteIcon, TextAlignLeftIcon, TextAlignCenterIcon, TextAlignRightIcon, ExclamationTriangleIcon, Cross1Icon, Pencil2Icon, ChevronLeftIcon, LoopIcon, IdCardIcon, LetterCaseCapitalizeIcon, ValueIcon, LinkBreak1Icon, EnterFullScreenIcon, PlusCircledIcon, ChevronDownIcon, InfoCircledIcon, FileIcon, DotsVerticalIcon, TriangleDownIcon, RowSpacingIcon, EyeOpenIcon, EyeClosedIcon, BorderAllIcon, WidthIcon, HeightIcon, ArrowRightIcon, ArrowDownIcon, ArrowLeftIcon, ArrowTopLeftIcon, ArrowTopRightIcon, ArrowBottomRightIcon, ArrowBottomLeftIcon, AlignLeftIcon, AlignCenterHorizontallyIcon, AlignRightIcon, StretchHorizontallyIcon, OverlineIcon, LetterCaseUppercaseIcon, Cross2Icon, BoxIcon, MinusIcon, CrossCircledIcon, MobileIcon, LaptopIcon, DesktopIcon, ReloadIcon, MagicWandIcon, MagnifyingGlassIcon, CaretRightIcon, FrameIcon, CheckIcon, LinkBreak2Icon, CardStackPlusIcon, CardStackIcon, ScissorsIcon, DoubleArrowDownIcon, DoubleArrowUpIcon, ResetIcon, UploadIcon, TextIcon, CornerTopRightIcon, MixerHorizontalIcon, SunIcon, MoonIcon, ChatBubbleIcon, FaceIcon, ShuffleIcon, ImageIcon, PaperPlaneIcon, EraserIcon, LightningBoltIcon, ZoomInIcon, StackIcon } from "@radix-ui/react-icons";
|
|
8
8
|
import * as React from "react";
|
|
9
9
|
import React__default, { useMemo, useCallback, useEffect, useState, useRef, Component, Children, memo, createElement, createContext, useContext, Suspense, lazy, useReducer, useDebugValue } from "react";
|
|
10
10
|
import { atom, useAtom as useAtom$1, useAtomValue as useAtomValue$1, getDefaultStore as getDefaultStore$1, useSetAtom as useSetAtom$1, Provider } from "jotai";
|
|
11
11
|
import { atomWithStorage, splitAtom, useAtomCallback } from "jotai/utils";
|
|
12
12
|
import { g as generateUUID, a as getBreakpointValue, c as cn$2 } from "./common-functions-BGzDsf1z.js";
|
|
13
|
-
import { v as Button, ab as DropdownMenu, ap as DropdownMenuTrigger, ad as DropdownMenuContent, af as DropdownMenuItem, b8 as cn$1, aW as Skeleton, d as Alert, e as AlertDescription, at as Input$1, a1 as Dialog, aa as DialogTrigger, a3 as DialogContent, a9 as DialogTitle, av as Popover, b4 as Tooltip, b7 as TooltipTrigger, ay as PopoverTrigger, b5 as TooltipContent, ax as PopoverContent, F as Command, H as CommandInput, I as CommandList, J as CommandEmpty, K as CommandGroup, L as CommandItem, a6 as DialogHeader, B as Badge, b6 as TooltipProvider, a as AccordionItem, b as AccordionTrigger, c as AccordionContent, ag as DropdownMenuLabel, ak as DropdownMenuSeparator, ac as DropdownMenuCheckboxItem, aq as HoverCard, as as HoverCardTrigger, ar as HoverCardContent, b1 as Textarea, A as Accordion, C as Card, D as CardHeader, y as CardDescription, x as CardContent, au as Label, z as CardFooter, az as ScrollArea, aZ as Tabs, a$ as TabsList, b0 as TabsTrigger, a_ as TabsContent, aX as Slider, aB as Select$1, aJ as SelectTrigger, aK as SelectValue, aC as SelectContent, aE as SelectItem, aL as Separator, aY as Switch, r as Avatar, g as AlertDialog, q as AlertDialogTrigger, j as AlertDialogContent, m as AlertDialogHeader, p as AlertDialogTitle, k as AlertDialogDescription, l as AlertDialogFooter, i as AlertDialogCancel, h as AlertDialogAction, aM as Sheet, aO as SheetContent, aR as SheetHeader, aU as SheetTitle } from "./toggle-
|
|
13
|
+
import { v as Button, ab as DropdownMenu, ap as DropdownMenuTrigger, ad as DropdownMenuContent, af as DropdownMenuItem, b8 as cn$1, aW as Skeleton, d as Alert, e as AlertDescription, at as Input$1, a1 as Dialog, aa as DialogTrigger, a3 as DialogContent, a9 as DialogTitle, av as Popover, b4 as Tooltip, b7 as TooltipTrigger, ay as PopoverTrigger, b5 as TooltipContent, ax as PopoverContent, F as Command, H as CommandInput, I as CommandList, J as CommandEmpty, K as CommandGroup, L as CommandItem, a6 as DialogHeader, B as Badge, b6 as TooltipProvider, a as AccordionItem, b as AccordionTrigger, c as AccordionContent, ag as DropdownMenuLabel, ak as DropdownMenuSeparator, ac as DropdownMenuCheckboxItem, aq as HoverCard, as as HoverCardTrigger, ar as HoverCardContent, b1 as Textarea, A as Accordion, C as Card, D as CardHeader, y as CardDescription, x as CardContent, au as Label, z as CardFooter, az as ScrollArea, aZ as Tabs, a$ as TabsList, b0 as TabsTrigger, a_ as TabsContent, aX as Slider, aB as Select$1, aJ as SelectTrigger, aK as SelectValue, aC as SelectContent, aE as SelectItem, aL as Separator, aY as Switch, r as Avatar, g as AlertDialog, q as AlertDialogTrigger, j as AlertDialogContent, m as AlertDialogHeader, p as AlertDialogTitle, k as AlertDialogDescription, l as AlertDialogFooter, i as AlertDialogCancel, h as AlertDialogAction, aM as Sheet, aO as SheetContent, aR as SheetHeader, aU as SheetTitle } from "./toggle-DrRMNSqS.js";
|
|
14
14
|
import clsx$1, { clsx } from "clsx";
|
|
15
15
|
import { twMerge } from "tailwind-merge";
|
|
16
16
|
import TreeModel from "tree-model";
|
|
@@ -20,7 +20,7 @@ import { isObject } from "@rjsf/utils";
|
|
|
20
20
|
import { useDebouncedCallback, useThrottledCallback, useResizeObserver, useIntervalEffect } from "@react-hookz/web";
|
|
21
21
|
import { toast, Toaster } from "sonner";
|
|
22
22
|
import { useTranslation, initReactI18next } from "react-i18next";
|
|
23
|
-
import { useTranslation as
|
|
23
|
+
import { useTranslation as $e } from "react-i18next";
|
|
24
24
|
import Fuse from "fuse.js";
|
|
25
25
|
import UndoManager from "undo-manager";
|
|
26
26
|
import Link from "@tiptap/extension-link";
|
|
@@ -280,7 +280,7 @@ import.meta.vitest && describe("canDropBlock Function", () => {
|
|
|
280
280
|
});
|
|
281
281
|
class PubSub {
|
|
282
282
|
constructor() {
|
|
283
|
-
|
|
283
|
+
$(this, "subscribers", /* @__PURE__ */ new Map());
|
|
284
284
|
}
|
|
285
285
|
subscribe(n, r) {
|
|
286
286
|
return this.subscribers.has(n) || this.subscribers.set(n, /* @__PURE__ */ new Set()), this.subscribers.get(n).add(r), () => {
|
|
@@ -839,12 +839,12 @@ const undoRedoStateAtom = atom({
|
|
|
839
839
|
return {
|
|
840
840
|
moveBlocks: (x, y, b) => {
|
|
841
841
|
const C = map(x, (j) => {
|
|
842
|
-
const
|
|
843
|
-
return { _id: j, oldParent:
|
|
842
|
+
const A = n.find((E) => E._id === j)._parent || null, w = n.filter((E) => A ? E._parent === A : !E._parent).map((E) => E._id).indexOf(j);
|
|
843
|
+
return { _id: j, oldParent: A, oldPosition: w };
|
|
844
844
|
}), B = C.find(({ _id: j }) => j === x[0]);
|
|
845
845
|
B && B.oldParent === y && B.oldPosition === b || (i(x, y, b), o({
|
|
846
|
-
undo: () => each(C, ({ _id: j, oldParent: _, oldPosition:
|
|
847
|
-
i([j], _,
|
|
846
|
+
undo: () => each(C, ({ _id: j, oldParent: _, oldPosition: A }) => {
|
|
847
|
+
i([j], _, A);
|
|
848
848
|
}),
|
|
849
849
|
redo: () => i(x, y, b)
|
|
850
850
|
}));
|
|
@@ -870,8 +870,8 @@ const undoRedoStateAtom = atom({
|
|
|
870
870
|
else {
|
|
871
871
|
const B = keys(y);
|
|
872
872
|
C = map(x, (j) => {
|
|
873
|
-
const _ = n.find((k) => k._id === j),
|
|
874
|
-
return each(B, (k) =>
|
|
873
|
+
const _ = n.find((k) => k._id === j), A = { _id: j };
|
|
874
|
+
return each(B, (k) => A[k] = _[k]), A;
|
|
875
875
|
});
|
|
876
876
|
}
|
|
877
877
|
c(map(x, (B) => ({ _id: B, ...y }))), o({
|
|
@@ -2381,16 +2381,16 @@ const getBlockWithChildren = (o, n) => {
|
|
|
2381
2381
|
try {
|
|
2382
2382
|
const b = p === u ? "" : p;
|
|
2383
2383
|
console.log("prompt", x);
|
|
2384
|
-
const C = x.toLowerCase().includes("translate the content"), B = h === "content" ? pickOnlyAIProps(cloneDeep(getBlockWithChildren(f, d)), p, C) : [m(f, d)], j = await l(h, addLangToPrompt(x, g, h), B, b), { blocks: _, error:
|
|
2385
|
-
if (
|
|
2386
|
-
a(
|
|
2384
|
+
const C = x.toLowerCase().includes("translate the content"), B = h === "content" ? pickOnlyAIProps(cloneDeep(getBlockWithChildren(f, d)), p, C) : [m(f, d)], j = await l(h, addLangToPrompt(x, g, h), B, b), { blocks: _, error: A } = j;
|
|
2385
|
+
if (A) {
|
|
2386
|
+
a(A);
|
|
2387
2387
|
return;
|
|
2388
2388
|
}
|
|
2389
2389
|
if (h === "styles") {
|
|
2390
|
-
const k = _.map((
|
|
2391
|
-
for (const E in
|
|
2392
|
-
E !== "_id" && (
|
|
2393
|
-
return
|
|
2390
|
+
const k = _.map((w) => {
|
|
2391
|
+
for (const E in w)
|
|
2392
|
+
E !== "_id" && (w[E] = `${STYLES_KEY},${w[E]}`);
|
|
2393
|
+
return w;
|
|
2394
2394
|
});
|
|
2395
2395
|
c(k);
|
|
2396
2396
|
} else
|
|
@@ -2548,14 +2548,6 @@ const getBlockWithChildren = (o, n) => {
|
|
|
2548
2548
|
},
|
|
2549
2549
|
[o, n]
|
|
2550
2550
|
);
|
|
2551
|
-
}, hiddenBlockIdsAtom = atom([]), useHiddenBlockIds = () => {
|
|
2552
|
-
const [o, n] = useAtom$1(hiddenBlockIdsAtom), r = useCallback(
|
|
2553
|
-
(a) => {
|
|
2554
|
-
n((l) => includes(l, a) ? without(l, a) : [...l, a]);
|
|
2555
|
-
},
|
|
2556
|
-
[n]
|
|
2557
|
-
);
|
|
2558
|
-
return [o, n, r];
|
|
2559
2551
|
}, highlightBlockIdAtom = atom(""), useHighlightBlockId = () => useAtom$1(highlightBlockIdAtom), libraryBlocksAtom = atom(
|
|
2560
2552
|
{}
|
|
2561
2553
|
), useLibraryBlocks = (o) => {
|
|
@@ -3131,17 +3123,17 @@ class Content extends Component {
|
|
|
3131
3123
|
class Frame extends Component {
|
|
3132
3124
|
constructor(r, a) {
|
|
3133
3125
|
super(r, a);
|
|
3134
|
-
|
|
3126
|
+
$(this, "setRef", (r) => {
|
|
3135
3127
|
this.nodeRef.current = r;
|
|
3136
3128
|
const { forwardedRef: a } = this.props;
|
|
3137
3129
|
typeof a == "function" ? a(r) : a && (a.current = r);
|
|
3138
3130
|
});
|
|
3139
|
-
|
|
3131
|
+
$(this, "handleLoad", () => {
|
|
3140
3132
|
clearInterval(this.loadCheck), this.state.iframeLoaded || this.setState({ iframeLoaded: !0 });
|
|
3141
3133
|
});
|
|
3142
3134
|
// In certain situations on a cold cache DOMContentLoaded never gets called
|
|
3143
3135
|
// fallback to an interval to check if that's the case
|
|
3144
|
-
|
|
3136
|
+
$(this, "loadCheck", () => setInterval(() => {
|
|
3145
3137
|
this.handleLoad();
|
|
3146
3138
|
}, 500));
|
|
3147
3139
|
this._isMounted = !1, this.nodeRef = React__default.createRef(), this.state = { iframeLoaded: !1 };
|
|
@@ -3178,7 +3170,7 @@ class Frame extends Component {
|
|
|
3178
3170
|
return delete r.head, delete r.initialContent, delete r.mountTarget, delete r.contentDidMount, delete r.contentDidUpdate, delete r.forwardedRef, /* @__PURE__ */ jsx("iframe", { ...r, ref: this.setRef, onLoad: this.handleLoad, children: this.state.iframeLoaded && this.renderFrameContents() });
|
|
3179
3171
|
}
|
|
3180
3172
|
}
|
|
3181
|
-
|
|
3173
|
+
$(Frame, "defaultProps", {
|
|
3182
3174
|
style: {},
|
|
3183
3175
|
head: null,
|
|
3184
3176
|
children: void 0,
|
|
@@ -3610,26 +3602,26 @@ const ChaiFrame = React__default.forwardRef((o, n) => /* @__PURE__ */ jsx(Frame,
|
|
|
3610
3602
|
({ block: o, children: n }) => {
|
|
3611
3603
|
const r = "content", { document: a } = useFrame(), { editingBlockId: l, editingItemIndex: i, setEditingBlockId: c, setEditingItemIndex: d } = useInlineEditing(), [p, u] = useState(null), g = useRef(null), { clearHighlight: m } = useBlockHighlight(), h = useUpdateBlocksProps(), { selectedLang: f } = useLanguages(), [, x] = useSelectedBlockIds(), y = useRef(null), b = l, { blockContent: C, blockType: B } = useMemo(() => {
|
|
3612
3604
|
var I;
|
|
3613
|
-
const
|
|
3605
|
+
const w = o._type;
|
|
3614
3606
|
let E = o[r];
|
|
3615
3607
|
const S = getRegisteredChaiBlock(o._type);
|
|
3616
|
-
return f && ((I = S == null ? void 0 : S.i18nProps) == null ? void 0 : I.includes(r)) && has(o, `${r}-${f}`) && (E = get(o, `${r}-${f}`)), { blockContent: E, blockType:
|
|
3608
|
+
return f && ((I = S == null ? void 0 : S.i18nProps) == null ? void 0 : I.includes(r)) && has(o, `${r}-${f}`) && (E = get(o, `${r}-${f}`)), { blockContent: E, blockType: w };
|
|
3617
3609
|
}, [o, f]), j = useCallback(
|
|
3618
|
-
(
|
|
3610
|
+
(w) => {
|
|
3619
3611
|
var S;
|
|
3620
|
-
const E =
|
|
3612
|
+
const E = w || ((S = g.current) == null ? void 0 : S.innerText);
|
|
3621
3613
|
h([b], { [r]: E }), u(null), c(null), d(-1), x(b ? [b] : []);
|
|
3622
3614
|
},
|
|
3623
3615
|
[b, h, c, x, f]
|
|
3624
3616
|
), _ = useDebouncedCallback(
|
|
3625
|
-
(
|
|
3626
|
-
h([b], { [r]:
|
|
3617
|
+
(w) => {
|
|
3618
|
+
h([b], { [r]: w });
|
|
3627
3619
|
},
|
|
3628
3620
|
[b, o, h, f],
|
|
3629
3621
|
1e3
|
|
3630
|
-
),
|
|
3631
|
-
(
|
|
3632
|
-
|
|
3622
|
+
), A = useCallback(
|
|
3623
|
+
(w) => {
|
|
3624
|
+
w.preventDefault(), b && (y.current = b), j(), setTimeout(() => {
|
|
3633
3625
|
const E = y.current;
|
|
3634
3626
|
y.current = null, x([E]);
|
|
3635
3627
|
}, 100);
|
|
@@ -3639,7 +3631,7 @@ const ChaiFrame = React__default.forwardRef((o, n) => /* @__PURE__ */ jsx(Frame,
|
|
|
3639
3631
|
useEffect(() => {
|
|
3640
3632
|
var v;
|
|
3641
3633
|
if (!b) return;
|
|
3642
|
-
const
|
|
3634
|
+
const w = `[data-block-id="${b}"]`, E = i >= 0 ? `[data-block-index="${i}"]` : "", S = a.querySelector(`${w}${E}`);
|
|
3643
3635
|
S && ((v = S == null ? void 0 : S.classList) == null || v.add("sr-only"), u(S));
|
|
3644
3636
|
}, [b, B, a, i]);
|
|
3645
3637
|
const k = useMemo(() => p ? (m(), B === "RichText" ? /* @__PURE__ */ jsx(
|
|
@@ -3649,7 +3641,7 @@ const ChaiFrame = React__default.forwardRef((o, n) => /* @__PURE__ */ jsx(Frame,
|
|
|
3649
3641
|
editingElement: p,
|
|
3650
3642
|
onChange: _,
|
|
3651
3643
|
onClose: j,
|
|
3652
|
-
onEscape:
|
|
3644
|
+
onEscape: A
|
|
3653
3645
|
}
|
|
3654
3646
|
) : /* @__PURE__ */ jsx(
|
|
3655
3647
|
MemoizedEditor,
|
|
@@ -3659,7 +3651,7 @@ const ChaiFrame = React__default.forwardRef((o, n) => /* @__PURE__ */ jsx(Frame,
|
|
|
3659
3651
|
editingElement: p,
|
|
3660
3652
|
onClose: j,
|
|
3661
3653
|
onChange: _,
|
|
3662
|
-
onEscape:
|
|
3654
|
+
onEscape: A
|
|
3663
3655
|
}
|
|
3664
3656
|
)) : null, [p, b, B, C, j, f]);
|
|
3665
3657
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
@@ -3696,23 +3688,23 @@ const ChaiFrame = React__default.forwardRef((o, n) => /* @__PURE__ */ jsx(Frame,
|
|
|
3696
3688
|
blockAtom: n,
|
|
3697
3689
|
children: r
|
|
3698
3690
|
}) => {
|
|
3699
|
-
const { editingBlockId: a, editingItemIndex: l } = useInlineEditing(), [i] = useAtom$1(n), c = useMemo(() => getRegisteredChaiBlock(i._type), [i._type]), { selectedLang: d, fallbackLang: p } = useLanguages(), u = useBlockRuntimeProps(), g = usePageExternalData(), [m] =
|
|
3700
|
-
() =>
|
|
3701
|
-
index:
|
|
3702
|
-
key:
|
|
3691
|
+
const { editingBlockId: a, editingItemIndex: l } = useInlineEditing(), [i] = useAtom$1(n), c = useMemo(() => getRegisteredChaiBlock(i._type), [i._type]), { selectedLang: d, fallbackLang: p } = useLanguages(), u = useBlockRuntimeProps(), g = usePageExternalData(), [m] = useAtom$1(dataBindingActiveAtom), h = get(c, "component", null), { index: f, key: x } = useContext(RepeaterContext), y = useMemo(
|
|
3692
|
+
() => m ? applyBindingToBlockProps(applyLanguage(i, d, c), g, {
|
|
3693
|
+
index: f,
|
|
3694
|
+
key: x
|
|
3703
3695
|
}) : applyLanguage(i, d, c),
|
|
3704
|
-
[i, d, c, g,
|
|
3705
|
-
),
|
|
3696
|
+
[i, d, c, g, m, f, x]
|
|
3697
|
+
), b = useMemo(() => getBlockTagAttributes(i), [i, getBlockTagAttributes]), C = useMemo(
|
|
3706
3698
|
() => u(i._id, getBlockRuntimeProps(i._type)),
|
|
3707
3699
|
[i._id, i._type, u, getBlockRuntimeProps]
|
|
3708
|
-
),
|
|
3700
|
+
), B = useMemo(
|
|
3709
3701
|
() => ({
|
|
3710
|
-
blockProps: { "data-block-id": i._id, "data-block-type": i._type, "data-block-index":
|
|
3702
|
+
blockProps: { "data-block-id": i._id, "data-block-type": i._type, "data-block-index": f },
|
|
3711
3703
|
inBuilder: !0,
|
|
3712
3704
|
lang: d || p,
|
|
3705
|
+
...y,
|
|
3713
3706
|
...b,
|
|
3714
3707
|
...C,
|
|
3715
|
-
...B,
|
|
3716
3708
|
...o
|
|
3717
3709
|
}),
|
|
3718
3710
|
[
|
|
@@ -3720,29 +3712,29 @@ const ChaiFrame = React__default.forwardRef((o, n) => /* @__PURE__ */ jsx(Frame,
|
|
|
3720
3712
|
i._type,
|
|
3721
3713
|
d,
|
|
3722
3714
|
p,
|
|
3715
|
+
y,
|
|
3723
3716
|
b,
|
|
3724
3717
|
C,
|
|
3725
|
-
B,
|
|
3726
3718
|
o
|
|
3727
3719
|
]
|
|
3728
|
-
),
|
|
3729
|
-
if (isNull(
|
|
3730
|
-
let
|
|
3731
|
-
...
|
|
3720
|
+
), j = useMemo(() => !CORE_BLOCKS.includes(i._type), [i._type]), _ = useMemo(() => get(i, "_show", !0), [i]);
|
|
3721
|
+
if (isNull(h) || !_) return null;
|
|
3722
|
+
let A = /* @__PURE__ */ jsx(Suspense, { children: createElement(h, {
|
|
3723
|
+
...B,
|
|
3732
3724
|
children: r({
|
|
3733
3725
|
_id: i._id,
|
|
3734
3726
|
_type: i._type,
|
|
3735
|
-
...isArray(
|
|
3736
|
-
repeaterItems: applyLimit(
|
|
3737
|
-
$repeaterItemsKey:
|
|
3727
|
+
...isArray(y.repeaterItems) ? {
|
|
3728
|
+
repeaterItems: applyLimit(y.repeaterItems, i),
|
|
3729
|
+
$repeaterItemsKey: y.$repeaterItemsKey
|
|
3738
3730
|
} : {},
|
|
3739
3731
|
...i.partialBlockId ? { partialBlockId: i.partialBlockId } : "",
|
|
3740
3732
|
...i.globalBlock ? { partialBlockId: i.globalBlock } : ""
|
|
3741
3733
|
})
|
|
3742
3734
|
}) });
|
|
3743
|
-
const k = a === i._id && (l ===
|
|
3744
|
-
return
|
|
3745
|
-
}, PartialWrapper = ({ children: o, partialBlockId: n }) => {
|
|
3735
|
+
const k = a === i._id && (l === f || f < 0) ? /* @__PURE__ */ jsx(WithBlockTextEditor, { block: i, children: A }) : A;
|
|
3736
|
+
return j ? /* @__PURE__ */ jsx(ErrorBoundary, { fallbackRender: ErrorFallback, children: k }) : k;
|
|
3737
|
+
}, PartialWrapper$1 = ({ children: o, partialBlockId: n }) => {
|
|
3746
3738
|
const r = useBuilderProp("gotoPage", noop), { saveState: a } = useSavePage(), { selectedLang: l, fallbackLang: i } = useLanguages(), c = useCallback(
|
|
3747
3739
|
(d) => {
|
|
3748
3740
|
if (d.stopPropagation(), a !== "SAVED") {
|
|
@@ -3766,7 +3758,7 @@ const ChaiFrame = React__default.forwardRef((o, n) => /* @__PURE__ */ jsx(Frame,
|
|
|
3766
3758
|
] });
|
|
3767
3759
|
}, PartialBlocksRenderer = ({ partialBlockId: o }) => {
|
|
3768
3760
|
const { getPartailBlocks: n } = usePartialBlocksStore(), r = useMemo(() => n(o), [n, o]), a = useMemo(() => splitAtom(atom(r)), [r]);
|
|
3769
|
-
return isEmpty(r) ? null : /* @__PURE__ */ jsx(PartialWrapper, { partialBlockId: o, children: /* @__PURE__ */ jsx(BlocksRenderer, { splitAtoms: a, blocks: r }) });
|
|
3761
|
+
return isEmpty(r) ? null : /* @__PURE__ */ jsx(PartialWrapper$1, { partialBlockId: o, children: /* @__PURE__ */ jsx(BlocksRenderer, { splitAtoms: a, blocks: r }) });
|
|
3770
3762
|
}, BlocksRenderer = ({
|
|
3771
3763
|
blocks: o,
|
|
3772
3764
|
parent: n = null,
|
|
@@ -3906,7 +3898,7 @@ const CanvasEventsWatcher = () => {
|
|
|
3906
3898
|
}, FallbackError = () => /* @__PURE__ */ jsx("div", { className: "h-full w-full rounded-md bg-red-200 p-4 text-red-500", children: /* @__PURE__ */ jsxs("div", { className: "flex h-full w-full flex-col items-center justify-center", children: [
|
|
3907
3899
|
/* @__PURE__ */ jsx("p", { className: "font-semibold", children: "Oops! Something went wrong." }),
|
|
3908
3900
|
/* @__PURE__ */ jsx("p", { children: "Please try again." })
|
|
3909
|
-
] }) }), CodeEditor$1 = React__default.lazy(() => import("./code-editor-
|
|
3901
|
+
] }) }), CodeEditor$1 = React__default.lazy(() => import("./code-editor-GydqqBXp.js")), CanvasArea = () => {
|
|
3910
3902
|
const [o] = useCodeEditor(), n = useBuilderProp("onError", noop);
|
|
3911
3903
|
return /* @__PURE__ */ jsx("div", { className: "flex h-full max-h-full w-full flex-1 flex-col", children: /* @__PURE__ */ jsxs("div", { className: "relative flex h-full max-h-full flex-col overflow-hidden bg-gray-100/40", children: [
|
|
3912
3904
|
/* @__PURE__ */ jsx(Suspense, { fallback: /* @__PURE__ */ jsx(Skeleton, { className: "h-full" }), children: /* @__PURE__ */ jsx(ErrorBoundary, { fallback: /* @__PURE__ */ jsx(FallbackError, {}), onError: n, children: /* @__PURE__ */ jsx(StaticCanvas, {}) }) }),
|
|
@@ -4217,8 +4209,8 @@ const DataBindingSelector = ({
|
|
|
4217
4209
|
}
|
|
4218
4210
|
const h = (b) => /[.,!?;:]/.test(b), f = (b, C, B) => {
|
|
4219
4211
|
let j = "", _ = "";
|
|
4220
|
-
const
|
|
4221
|
-
return C > 0 && (
|
|
4212
|
+
const A = C > 0 ? b[C - 1] : "", k = C < b.length ? b[C] : "";
|
|
4213
|
+
return C > 0 && (A === "." || !h(A) && A !== " ") && (j = " "), C < b.length && !h(k) && k !== " " && (_ = " "), {
|
|
4222
4214
|
text: j + B + _,
|
|
4223
4215
|
prefixLength: j.length,
|
|
4224
4216
|
suffixLength: _.length
|
|
@@ -4235,9 +4227,9 @@ const DataBindingSelector = ({
|
|
|
4235
4227
|
if (B !== j)
|
|
4236
4228
|
b.chain().deleteSelection().insertContent(C).run();
|
|
4237
4229
|
else {
|
|
4238
|
-
const { state:
|
|
4230
|
+
const { state: A } = b, k = A.selection.from, w = A.doc.textBetween(Math.max(0, k - 1), k), E = A.doc.textBetween(k, Math.min(k + 1, A.doc.content.size));
|
|
4239
4231
|
let S = "";
|
|
4240
|
-
k > 0 &&
|
|
4232
|
+
k > 0 && w !== " " && !h(w) && (S = " ");
|
|
4241
4233
|
let v = "";
|
|
4242
4234
|
E && E !== " " && !h(E) && (v = " "), b.chain().insertContent(S + C + v).run();
|
|
4243
4235
|
}
|
|
@@ -4251,8 +4243,8 @@ const DataBindingSelector = ({
|
|
|
4251
4243
|
n(v, {}, r);
|
|
4252
4244
|
return;
|
|
4253
4245
|
}
|
|
4254
|
-
const
|
|
4255
|
-
n(
|
|
4246
|
+
const A = `{{${g}}}`, { text: k } = f(B, C, A), w = B.slice(0, C) + k + B.slice(C);
|
|
4247
|
+
n(w, {}, r);
|
|
4256
4248
|
}
|
|
4257
4249
|
},
|
|
4258
4250
|
[r, n, a, c == null ? void 0 : c._id, d]
|
|
@@ -4298,7 +4290,7 @@ const DataBindingSelector = ({
|
|
|
4298
4290
|
), _ = (S) => {
|
|
4299
4291
|
const v = ["pageType", u, S.id];
|
|
4300
4292
|
v[1] && (r(v.join(":")), h(S.name), p(!1), x([]), b(-1));
|
|
4301
|
-
},
|
|
4293
|
+
}, A = (S) => {
|
|
4302
4294
|
switch (S.key) {
|
|
4303
4295
|
case "ArrowDown":
|
|
4304
4296
|
S.preventDefault(), b((v) => v < f.length - 1 ? v + 1 : v);
|
|
@@ -4323,7 +4315,7 @@ const DataBindingSelector = ({
|
|
|
4323
4315
|
}, [y]);
|
|
4324
4316
|
const k = () => {
|
|
4325
4317
|
h(""), x([]), b(-1), p(!1), r("");
|
|
4326
|
-
},
|
|
4318
|
+
}, w = (S) => {
|
|
4327
4319
|
h(S), p(!isEmpty(S)), c(!0), j(S);
|
|
4328
4320
|
};
|
|
4329
4321
|
return /* @__PURE__ */ jsxs("div", { children: [
|
|
@@ -4334,8 +4326,8 @@ const DataBindingSelector = ({
|
|
|
4334
4326
|
{
|
|
4335
4327
|
type: "text",
|
|
4336
4328
|
value: m,
|
|
4337
|
-
onChange: (S) =>
|
|
4338
|
-
onKeyDown:
|
|
4329
|
+
onChange: (S) => w(S.target.value),
|
|
4330
|
+
onKeyDown: A,
|
|
4339
4331
|
placeholder: a(`Search ${B ?? ""}`),
|
|
4340
4332
|
className: "w-full rounded-md border border-gray-300 p-2 pr-16"
|
|
4341
4333
|
}
|
|
@@ -4672,8 +4664,8 @@ const MenuBar = ({ editor: o, onExpand: n }) => {
|
|
|
4672
4664
|
const { state: b } = u, C = b.selection.from, B = b.doc.textBetween(Math.max(0, C - 1), C), j = b.doc.textBetween(C, Math.min(C + 1, b.doc.content.size));
|
|
4673
4665
|
let _ = "";
|
|
4674
4666
|
C > 0 && B !== " " && !/[.,!?;:]/.test(B) && (_ = " ");
|
|
4675
|
-
let
|
|
4676
|
-
j && j !== " " && !/[.,!?;:]/.test(j) && (
|
|
4667
|
+
let A = "";
|
|
4668
|
+
j && j !== " " && !/[.,!?;:]/.test(j) && (A = " "), u.chain().insertContent(_ + h + A).run();
|
|
4677
4669
|
}
|
|
4678
4670
|
};
|
|
4679
4671
|
return /* @__PURE__ */ jsx(Dialog, { open: o, onOpenChange: (m) => !m && n(), children: /* @__PURE__ */ jsxs(DialogContent, { className: "max-h-[90vh] overflow-y-auto sm:max-w-[800px]", children: [
|
|
@@ -4976,11 +4968,11 @@ const MenuBar = ({ editor: o, onExpand: n }) => {
|
|
|
4976
4968
|
), y = useMemo(() => get(LANGUAGES, x, x), [x]), b = usePageExternalData(), C = useSelectedBlock(), B = useRegisteredChaiBlocks(), j = useMemo(
|
|
4977
4969
|
() => get(B, [C == null ? void 0 : C._type, "i18nProps"], []),
|
|
4978
4970
|
[B, C == null ? void 0 : C._type]
|
|
4979
|
-
), [_,
|
|
4971
|
+
), [_, A] = useState(null);
|
|
4980
4972
|
if (c)
|
|
4981
4973
|
return null;
|
|
4982
4974
|
if (p.type === "boolean") return /* @__PURE__ */ jsx("div", { className: n, children: a });
|
|
4983
|
-
const
|
|
4975
|
+
const w = j == null ? void 0 : j.includes(o.replace("root.", ""));
|
|
4984
4976
|
if (p.type === "array") {
|
|
4985
4977
|
const E = _ === o;
|
|
4986
4978
|
return /* @__PURE__ */ jsxs("div", { className: `${n} relative`, children: [
|
|
@@ -4988,7 +4980,7 @@ const MenuBar = ({ editor: o, onExpand: n }) => {
|
|
|
4988
4980
|
"label",
|
|
4989
4981
|
{
|
|
4990
4982
|
htmlFor: o,
|
|
4991
|
-
onClick: () =>
|
|
4983
|
+
onClick: () => A(E ? null : o),
|
|
4992
4984
|
className: "flex cursor-pointer items-center gap-x-1 py-1 leading-tight duration-200 hover:bg-slate-100",
|
|
4993
4985
|
children: [
|
|
4994
4986
|
E ? /* @__PURE__ */ jsx(ChevronDownIcon, { className: "h-3 w-3" }) : /* @__PURE__ */ jsx(ChevronRightIcon, { className: "h-3 w-3" }),
|
|
@@ -5023,7 +5015,7 @@ const MenuBar = ({ editor: o, onExpand: n }) => {
|
|
|
5023
5015
|
/* @__PURE__ */ jsxs("label", { htmlFor: o, className: p.type === "object" ? "pb-2" : "", children: [
|
|
5024
5016
|
r,
|
|
5025
5017
|
" ",
|
|
5026
|
-
|
|
5018
|
+
w && /* @__PURE__ */ jsxs("small", { className: "text-[9px] text-zinc-400", children: [
|
|
5027
5019
|
" ",
|
|
5028
5020
|
y
|
|
5029
5021
|
] }),
|
|
@@ -5145,43 +5137,43 @@ const MenuBar = ({ editor: o, onExpand: n }) => {
|
|
|
5145
5137
|
}), a;
|
|
5146
5138
|
};
|
|
5147
5139
|
function BlockSettings() {
|
|
5148
|
-
const { selectedLang: o } = useLanguages(), n = useSelectedBlock(), r = useUpdateBlocksPropsRealtime(), a = useUpdateBlocksProps(), l = getRegisteredChaiBlock(n == null ? void 0 : n._type), i = formDataWithSelectedLang(n, o, l), [c, d] = useState(i), [p, u] = useState(!1), g = useWrapperBlock(), m = getRegisteredChaiBlock(g == null ? void 0 : g._type), h = formDataWithSelectedLang(g, o, m), f = ({ formData:
|
|
5149
|
-
k && (c == null ? void 0 : c._id) === n._id && a([n._id], { [k]: get(
|
|
5140
|
+
const { selectedLang: o } = useLanguages(), n = useSelectedBlock(), r = useUpdateBlocksPropsRealtime(), a = useUpdateBlocksProps(), l = getRegisteredChaiBlock(n == null ? void 0 : n._type), i = formDataWithSelectedLang(n, o, l), [c, d] = useState(i), [p, u] = useState(!1), g = useWrapperBlock(), m = getRegisteredChaiBlock(g == null ? void 0 : g._type), h = formDataWithSelectedLang(g, o, m), f = ({ formData: A }, k, w) => {
|
|
5141
|
+
k && (c == null ? void 0 : c._id) === n._id && a([n._id], { [k]: get(A, k) }, w);
|
|
5150
5142
|
}, x = useCallback(
|
|
5151
|
-
debounce(({ formData:
|
|
5152
|
-
f({ formData:
|
|
5143
|
+
debounce(({ formData: A }, k, w) => {
|
|
5144
|
+
f({ formData: A }, k, w), d(A);
|
|
5153
5145
|
}, 1500),
|
|
5154
5146
|
[n == null ? void 0 : n._id, o]
|
|
5155
|
-
), y = ({ formData:
|
|
5156
|
-
k && (r([n._id], { [k]: get(
|
|
5157
|
-
}, b = ({ formData:
|
|
5158
|
-
k && (r([g._id], { [k]: get(
|
|
5147
|
+
), y = ({ formData: A }, k) => {
|
|
5148
|
+
k && (r([n._id], { [k]: get(A, k) }), x({ formData: A }, k, { [k]: get(c, k) }));
|
|
5149
|
+
}, b = ({ formData: A }, k) => {
|
|
5150
|
+
k && (r([g._id], { [k]: get(A, k) }), x({ formData: A }, k, { [k]: get(c, k) }));
|
|
5159
5151
|
}, { schema: C, uiSchema: B } = useMemo(() => {
|
|
5160
|
-
const
|
|
5161
|
-
if (!
|
|
5152
|
+
const A = n == null ? void 0 : n._type;
|
|
5153
|
+
if (!A)
|
|
5162
5154
|
return { schema: {}, uiSchema: {} };
|
|
5163
5155
|
try {
|
|
5164
|
-
const { schema: k, uiSchema:
|
|
5165
|
-
if (
|
|
5156
|
+
const { schema: k, uiSchema: w } = getBlockFormSchemas(A);
|
|
5157
|
+
if (A === "Repeater") {
|
|
5166
5158
|
const E = get(n, "repeaterItems", "");
|
|
5167
|
-
startsWith(E, `{{${COLLECTION_PREFIX}`) ? (set(
|
|
5159
|
+
startsWith(E, `{{${COLLECTION_PREFIX}`) ? (set(w, "filter", { "ui:widget": "collectionSelect" }), set(w, "sort", { "ui:widget": "collectionSelect" })) : (set(w, "filter", { "ui:widget": "hidden" }), set(w, "sort", { "ui:widget": "hidden" }));
|
|
5168
5160
|
}
|
|
5169
|
-
return { schema: k, uiSchema:
|
|
5161
|
+
return { schema: k, uiSchema: w };
|
|
5170
5162
|
} catch {
|
|
5171
5163
|
return { schema: {}, uiSchema: {} };
|
|
5172
5164
|
}
|
|
5173
5165
|
}, [n]), { wrapperSchema: j, wrapperUiSchema: _ } = useMemo(() => {
|
|
5174
5166
|
if (!g || !(g != null && g._type))
|
|
5175
5167
|
return { wrapperSchema: {}, wrapperUiSchema: {} };
|
|
5176
|
-
const
|
|
5177
|
-
return { wrapperSchema: k, wrapperUiSchema:
|
|
5168
|
+
const A = g == null ? void 0 : g._type, { schema: k = {}, uiSchema: w = {} } = getBlockFormSchemas(A);
|
|
5169
|
+
return { wrapperSchema: k, wrapperUiSchema: w };
|
|
5178
5170
|
}, [g]);
|
|
5179
5171
|
return /* @__PURE__ */ jsxs("div", { className: "no-scrollbar overflow-x-hidden px-px", children: [
|
|
5180
5172
|
!isEmpty(g) && /* @__PURE__ */ jsxs("div", { className: "mb-4 rounded border bg-zinc-100 px-1", children: [
|
|
5181
5173
|
/* @__PURE__ */ jsxs(
|
|
5182
5174
|
"div",
|
|
5183
5175
|
{
|
|
5184
|
-
onClick: () => u((
|
|
5176
|
+
onClick: () => u((A) => !A),
|
|
5185
5177
|
className: "flex cursor-pointer items-center gap-x-1 py-2 text-xs font-medium leading-tight hover:bg-slate-100",
|
|
5186
5178
|
children: [
|
|
5187
5179
|
p ? /* @__PURE__ */ jsx(ChevronDownIcon, { className: "h-4 w-4 text-slate-400" }) : /* @__PURE__ */ jsx(ChevronRightIcon, { className: "h-4 w-4 text-slate-400" }),
|
|
@@ -5434,7 +5426,7 @@ const BlockStylingProps = () => {
|
|
|
5434
5426
|
}
|
|
5435
5427
|
h(v), l(v === "class" || isEmpty(S) ? "" : S);
|
|
5436
5428
|
}, [i, p, u]);
|
|
5437
|
-
const
|
|
5429
|
+
const A = useThrottledCallback((S) => c(S), [c], THROTTLE_TIME), k = useThrottledCallback((S) => c(S, !1), [c], THROTTLE_TIME), w = useCallback(
|
|
5438
5430
|
(S = !1) => {
|
|
5439
5431
|
const v = getUserInputValues(`${a}`, u);
|
|
5440
5432
|
if (get(v, "error", !1)) {
|
|
@@ -5443,15 +5435,15 @@ const BlockStylingProps = () => {
|
|
|
5443
5435
|
}
|
|
5444
5436
|
const I = get(v, "unit") !== "" ? get(v, "unit") : m;
|
|
5445
5437
|
if (I === "auto" || I === "none") {
|
|
5446
|
-
|
|
5438
|
+
A(`${d}${I}`);
|
|
5447
5439
|
return;
|
|
5448
5440
|
}
|
|
5449
5441
|
if (get(v, "value") === "")
|
|
5450
5442
|
return;
|
|
5451
5443
|
const T = `${get(v, "value", "").startsWith("-") ? "-" : ""}${d}[${get(v, "value", "").replace("-", "")}${I === "-" ? "" : I}]`;
|
|
5452
|
-
S ? k(T) :
|
|
5444
|
+
S ? k(T) : A(T);
|
|
5453
5445
|
},
|
|
5454
|
-
[
|
|
5446
|
+
[A, k, a, m, d, u]
|
|
5455
5447
|
), E = useCallback(
|
|
5456
5448
|
(S) => {
|
|
5457
5449
|
const v = getUserInputValues(`${a}`, u);
|
|
@@ -5460,15 +5452,15 @@ const BlockStylingProps = () => {
|
|
|
5460
5452
|
return;
|
|
5461
5453
|
}
|
|
5462
5454
|
if (S === "auto" || S === "none") {
|
|
5463
|
-
|
|
5455
|
+
A(`${d}${S}`);
|
|
5464
5456
|
return;
|
|
5465
5457
|
}
|
|
5466
5458
|
if (get(v, "value") === "")
|
|
5467
5459
|
return;
|
|
5468
5460
|
const I = get(v, "unit") !== "" ? get(v, "unit") : S, T = `${get(v, "value", "").startsWith("-") ? "-" : ""}${d}[${get(v, "value", "").replace("-", "")}${I === "-" ? "" : I}]`;
|
|
5469
|
-
|
|
5461
|
+
A(T);
|
|
5470
5462
|
},
|
|
5471
|
-
[
|
|
5463
|
+
[A, a, d, u]
|
|
5472
5464
|
);
|
|
5473
5465
|
return /* @__PURE__ */ jsx("div", { className: "flex w-full flex-col", children: /* @__PURE__ */ jsx("div", { className: "flex items-center justify-start", children: m === "class" ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
5474
5466
|
/* @__PURE__ */ jsx(
|
|
@@ -5490,7 +5482,7 @@ const BlockStylingProps = () => {
|
|
|
5490
5482
|
{
|
|
5491
5483
|
readOnly: m === "class",
|
|
5492
5484
|
onKeyPress: (S) => {
|
|
5493
|
-
S.key === "Enter" &&
|
|
5485
|
+
S.key === "Enter" && w();
|
|
5494
5486
|
},
|
|
5495
5487
|
onKeyDown: (S) => {
|
|
5496
5488
|
if (S.keyCode !== 38 && S.keyCode !== 40)
|
|
@@ -5505,7 +5497,7 @@ const BlockStylingProps = () => {
|
|
|
5505
5497
|
onKeyUp: (S) => {
|
|
5506
5498
|
j && (S.preventDefault(), _(!1));
|
|
5507
5499
|
},
|
|
5508
|
-
onBlur: () =>
|
|
5500
|
+
onBlur: () => w(),
|
|
5509
5501
|
onChange: (S) => {
|
|
5510
5502
|
x(!1), l(S.target.value);
|
|
5511
5503
|
},
|
|
@@ -5553,7 +5545,7 @@ const BlockStylingProps = () => {
|
|
|
5553
5545
|
if (b(() => ""), B(!1), isEmpty(S))
|
|
5554
5546
|
return;
|
|
5555
5547
|
const v = `${S}`, L = `${v.startsWith("-") ? "-" : ""}${d}[${v.replace("-", "")}${m === "-" ? "" : m}]`;
|
|
5556
|
-
|
|
5548
|
+
A(L);
|
|
5557
5549
|
},
|
|
5558
5550
|
onDrag: (S) => {
|
|
5559
5551
|
if (isEmpty(S))
|
|
@@ -6024,11 +6016,11 @@ const COLOR_PROP = {
|
|
|
6024
6016
|
}, getBreakpoint = (o) => `${o.toUpperCase()} ${BREAKPOINTS[o] ? `(${BREAKPOINTS[o]} & up)` : ""}`, BlockStyle = (o) => {
|
|
6025
6017
|
const { t: n } = useTranslation(), { type: r = "icons", label: a, property: l, onEmitChange: i = () => {
|
|
6026
6018
|
}, units: c, negative: d = !1 } = o, [p] = useDarkMode(), [u] = useStylingState(), [, g] = useScreenSizeWidth(), m = useCurrentClassByProperty(l), h = useAddClassesToBlocks(), f = useRemoveClassesFromBlocks(), [x] = useSelectedBlockIds(), y = useMemo(() => get(m, "fullCls", ""), [m]), b = useCallback(
|
|
6027
|
-
(k,
|
|
6019
|
+
(k, w = !0) => {
|
|
6028
6020
|
const E = { dark: p, mq: g, mod: u, cls: k, property: l, fullCls: "" };
|
|
6029
6021
|
(p || u !== "") && (E.mq = "xs");
|
|
6030
6022
|
const S = generateFullClsName(E);
|
|
6031
|
-
h(x, [S],
|
|
6023
|
+
h(x, [S], w);
|
|
6032
6024
|
},
|
|
6033
6025
|
[x, p, g, u, l, h]
|
|
6034
6026
|
), C = useCallback(() => {
|
|
@@ -6049,9 +6041,9 @@ const COLOR_PROP = {
|
|
|
6049
6041
|
}[k]);
|
|
6050
6042
|
},
|
|
6051
6043
|
[j]
|
|
6052
|
-
),
|
|
6053
|
-
return /* @__PURE__ */ jsx(BlockStyleProvider, { canChange: B, canReset: m &&
|
|
6054
|
-
/* @__PURE__ */ jsx("div", { className: "relative w-[70px] truncate text-xs text-foreground", children: /* @__PURE__ */ jsx("span", { className: `text-[11px] ${m && !
|
|
6044
|
+
), A = get(m, "dark", null) === p && get(m, "mod", null) === u && get(m, "mq", null) === g;
|
|
6045
|
+
return /* @__PURE__ */ jsx(BlockStyleProvider, { canChange: B, canReset: m && A, children: /* @__PURE__ */ jsxs("div", { className: "group flex flex-row items-center py-2 first:pt-0 last:pb-0", children: [
|
|
6046
|
+
/* @__PURE__ */ jsx("div", { className: "relative w-[70px] truncate text-xs text-foreground", children: /* @__PURE__ */ jsx("span", { className: `text-[11px] ${m && !A ? "text-foreground" : ""}`, children: n(a) }) }),
|
|
6055
6047
|
/* @__PURE__ */ jsxs("div", { className: "flex flex-row items-center", children: [
|
|
6056
6048
|
/* @__PURE__ */ jsxs("div", { className: "w-[150px]", children: [
|
|
6057
6049
|
r === "arbitrary" ? /* @__PURE__ */ jsx(
|
|
@@ -6070,7 +6062,7 @@ const COLOR_PROP = {
|
|
|
6070
6062
|
r === "color" && /* @__PURE__ */ jsx(ColorChoice, { property: l, onChange: b }),
|
|
6071
6063
|
r === "dropdown" && /* @__PURE__ */ jsx(DropDownChoices, { label: a, property: l, onChange: b })
|
|
6072
6064
|
] }),
|
|
6073
|
-
/* @__PURE__ */ jsx("div", { className: `w-[30px] cursor-pointer ${y ? "visible" : "invisible"}`, children:
|
|
6065
|
+
/* @__PURE__ */ jsx("div", { className: `w-[30px] cursor-pointer ${y ? "visible" : "invisible"}`, children: A ? /* @__PURE__ */ jsx("button", { type: "button", onClick: () => C(), title: "Reset", className: "flex px-1.5 text-xs", children: /* @__PURE__ */ jsx(CrossCircledIcon, { className: "h-5 w-5 text-blue-500 hover:opacity-80" }) }) : B && m ? /* @__PURE__ */ jsxs(Tooltip, { delayDuration: 100, children: [
|
|
6074
6066
|
/* @__PURE__ */ jsx(TooltipTrigger, { asChild: !0, children: /* @__PURE__ */ jsx(
|
|
6075
6067
|
"button",
|
|
6076
6068
|
{
|
|
@@ -6474,12 +6466,12 @@ function ManualClasses() {
|
|
|
6474
6466
|
const o = useRef(null), [n, r] = useState(""), [a, l] = useState(-1), i = useFuseSearch(), { t: c } = useTranslation(), [d] = useSelectedStylingBlocks(), p = useSelectedBlock(), u = useAddClassesToBlocks(), g = useRemoveClassesFromBlocks(), [m] = useSelectedBlockIds(), h = useBuilderProp("askAiCallBack", null), [f, x] = useState(""), y = (L = first(d)) == null ? void 0 : L.prop, { classes: b } = getSplitChaiClasses(get(p, y, "")), C = b.split(" ").filter((T) => !isEmpty(T)), B = () => {
|
|
6475
6467
|
const T = f.trim().toLowerCase().replace(/ +(?= )/g, "").split(" ");
|
|
6476
6468
|
u(m, T, !0), x("");
|
|
6477
|
-
}, [j, _] = useState([]),
|
|
6469
|
+
}, [j, _] = useState([]), A = ({ value: T }) => {
|
|
6478
6470
|
const P = T.trim().toLowerCase(), R = P.match(/.+:/g);
|
|
6479
6471
|
let N = [];
|
|
6480
6472
|
if (R && R.length > 0) {
|
|
6481
|
-
const [D] = R,
|
|
6482
|
-
N = i.search(
|
|
6473
|
+
const [D] = R, F = P.replace(D, "");
|
|
6474
|
+
N = i.search(F).map((M) => ({
|
|
6483
6475
|
...M,
|
|
6484
6476
|
item: { ...M.item, name: D + M.item.name }
|
|
6485
6477
|
}));
|
|
@@ -6488,7 +6480,7 @@ function ManualClasses() {
|
|
|
6488
6480
|
return _(map(N, "item"));
|
|
6489
6481
|
}, k = () => {
|
|
6490
6482
|
_([]);
|
|
6491
|
-
},
|
|
6483
|
+
}, w = (T) => T.name, E = (T) => /* @__PURE__ */ jsx("div", { className: "rounded-md p-1", children: T.name }), S = useMemo(
|
|
6492
6484
|
() => ({
|
|
6493
6485
|
ref: o,
|
|
6494
6486
|
autoComplete: "off",
|
|
@@ -6542,9 +6534,9 @@ function ManualClasses() {
|
|
|
6542
6534
|
Autosuggest,
|
|
6543
6535
|
{
|
|
6544
6536
|
suggestions: j,
|
|
6545
|
-
onSuggestionsFetchRequested:
|
|
6537
|
+
onSuggestionsFetchRequested: A,
|
|
6546
6538
|
onSuggestionsClearRequested: k,
|
|
6547
|
-
getSuggestionValue:
|
|
6539
|
+
getSuggestionValue: w,
|
|
6548
6540
|
renderSuggestion: E,
|
|
6549
6541
|
inputProps: S,
|
|
6550
6542
|
containerProps: {
|
|
@@ -6950,15 +6942,15 @@ const registerChaiLibrary = (o, n) => {
|
|
|
6950
6942
|
const j = await c({ library: n, block: o });
|
|
6951
6943
|
let _ = r;
|
|
6952
6944
|
if (y(first(j)) && (_ = null), !isEmpty(j)) {
|
|
6953
|
-
const
|
|
6954
|
-
if (B.dataTransfer.setData("text/plain", JSON.stringify(
|
|
6945
|
+
const A = { blocks: j, uiLibrary: !0, parent: _ };
|
|
6946
|
+
if (B.dataTransfer.setData("text/plain", JSON.stringify(A)), o.preview) {
|
|
6955
6947
|
const k = new Image();
|
|
6956
6948
|
k.src = o.preview, k.onload = () => {
|
|
6957
6949
|
B.dataTransfer.setDragImage(k, 0, 0);
|
|
6958
6950
|
};
|
|
6959
6951
|
} else
|
|
6960
6952
|
B.dataTransfer.setDragImage(new Image(), 0, 0);
|
|
6961
|
-
x(
|
|
6953
|
+
x(A), setTimeout(() => {
|
|
6962
6954
|
u([]), g(), pubsub.publish(CHAI_BUILDER_EVENTS.CLOSE_ADD_BLOCK);
|
|
6963
6955
|
}, 200);
|
|
6964
6956
|
}
|
|
@@ -7010,13 +7002,13 @@ const registerChaiLibrary = (o, n) => {
|
|
|
7010
7002
|
return;
|
|
7011
7003
|
}
|
|
7012
7004
|
}, [y, b]);
|
|
7013
|
-
const B = get(y, b, []), j = useRef(null), { t: _ } = useTranslation(),
|
|
7005
|
+
const B = get(y, b, []), j = useRef(null), { t: _ } = useTranslation(), A = (v) => {
|
|
7014
7006
|
j.current && (clearTimeout(j.current), j.current = null), j.current = setTimeout(() => {
|
|
7015
7007
|
j.current && C(v);
|
|
7016
7008
|
}, 400);
|
|
7017
7009
|
}, k = () => {
|
|
7018
7010
|
i != null && i.id && p(i.id);
|
|
7019
|
-
},
|
|
7011
|
+
}, w = () => {
|
|
7020
7012
|
g("");
|
|
7021
7013
|
};
|
|
7022
7014
|
if (d)
|
|
@@ -7040,7 +7032,7 @@ const registerChaiLibrary = (o, n) => {
|
|
|
7040
7032
|
u && /* @__PURE__ */ jsx(
|
|
7041
7033
|
"button",
|
|
7042
7034
|
{
|
|
7043
|
-
onClick:
|
|
7035
|
+
onClick: w,
|
|
7044
7036
|
className: "absolute right-2 top-2.5 text-muted-foreground hover:text-foreground",
|
|
7045
7037
|
children: /* @__PURE__ */ jsx(Cross1Icon, { className: "h-4 w-4" })
|
|
7046
7038
|
}
|
|
@@ -7061,7 +7053,7 @@ const registerChaiLibrary = (o, n) => {
|
|
|
7061
7053
|
] }) }) : map(y, (v, I) => /* @__PURE__ */ jsxs(
|
|
7062
7054
|
"div",
|
|
7063
7055
|
{
|
|
7064
|
-
onMouseEnter: () =>
|
|
7056
|
+
onMouseEnter: () => A(I),
|
|
7065
7057
|
onMouseLeave: () => clearTimeout(j.current),
|
|
7066
7058
|
role: "button",
|
|
7067
7059
|
onClick: () => C(I),
|
|
@@ -7146,7 +7138,7 @@ const registerChaiLibrary = (o, n) => {
|
|
|
7146
7138
|
// Set the type to PartialBlock
|
|
7147
7139
|
label: formatReadableName(b.name || x),
|
|
7148
7140
|
description: b.description || "",
|
|
7149
|
-
icon:
|
|
7141
|
+
icon: FrameIcon,
|
|
7150
7142
|
group: B,
|
|
7151
7143
|
// Use formatted type as group
|
|
7152
7144
|
category: "partial",
|
|
@@ -7231,15 +7223,15 @@ const registerChaiLibrary = (o, n) => {
|
|
|
7231
7223
|
}
|
|
7232
7224
|
) : n,
|
|
7233
7225
|
[n, d]
|
|
7234
|
-
),
|
|
7226
|
+
), A = useMemo(
|
|
7235
7227
|
() => d ? o.filter(
|
|
7236
7228
|
(v) => reject(filter(values(_), { group: v }), { hidden: !0 }).length > 0
|
|
7237
7229
|
) : o.filter((v) => reject(filter(values(n), { group: v }), { hidden: !0 }).length > 0),
|
|
7238
7230
|
[n, _, o, d]
|
|
7239
7231
|
), k = useMemo(
|
|
7240
|
-
() => sortBy(
|
|
7241
|
-
[
|
|
7242
|
-
),
|
|
7232
|
+
() => sortBy(A, (v) => CORE_GROUPS.indexOf(v) === -1 ? 99 : CORE_GROUPS.indexOf(v)),
|
|
7233
|
+
[A]
|
|
7234
|
+
), w = useMemo(() => h === "all" ? _ : filter(values(_), { group: h }), [_, h]), E = useMemo(() => h === "all" ? k : [h], [k, h]);
|
|
7243
7235
|
return /* @__PURE__ */ jsxs("div", { className: "mx-auto flex h-full w-full max-w-3xl flex-col", children: [
|
|
7244
7236
|
/* @__PURE__ */ jsx("div", { className: "sticky top-0 z-10 bg-background/80 px-4 py-2 backdrop-blur-sm", children: /* @__PURE__ */ jsx(
|
|
7245
7237
|
Input$1,
|
|
@@ -7277,7 +7269,7 @@ const registerChaiLibrary = (o, n) => {
|
|
|
7277
7269
|
`sidebar-${v}`
|
|
7278
7270
|
))
|
|
7279
7271
|
] }) }) }),
|
|
7280
|
-
/* @__PURE__ */ jsx("div", { className: "h-full w-3/4 flex-1 overflow-hidden", children: /* @__PURE__ */ jsx(ScrollArea, { id: "add-blocks-scroll-area", className: "no-scrollbar mr-4 h-full", children:
|
|
7272
|
+
/* @__PURE__ */ jsx("div", { className: "h-full w-3/4 flex-1 overflow-hidden", children: /* @__PURE__ */ jsx(ScrollArea, { id: "add-blocks-scroll-area", className: "no-scrollbar mr-4 h-full", children: A.length === 0 && d ? /* @__PURE__ */ jsx("div", { className: "flex flex-col items-center justify-center p-8 text-center text-muted-foreground", children: /* @__PURE__ */ jsxs("p", { children: [
|
|
7281
7273
|
i("No blocks found matching"),
|
|
7282
7274
|
' "',
|
|
7283
7275
|
d,
|
|
@@ -7285,7 +7277,7 @@ const registerChaiLibrary = (o, n) => {
|
|
|
7285
7277
|
] }) }) : /* @__PURE__ */ jsx("div", { className: "space-y-6 p-4", children: E.map((v) => /* @__PURE__ */ jsxs("div", { className: "space-y-3", children: [
|
|
7286
7278
|
/* @__PURE__ */ jsx("h3", { className: "px-1 text-sm font-medium", children: capitalize(i(v.toLowerCase())) }),
|
|
7287
7279
|
/* @__PURE__ */ jsx("div", { className: "grid gap-2 " + l, children: reject(
|
|
7288
|
-
h === "all" ? filter(values(
|
|
7280
|
+
h === "all" ? filter(values(w), { group: v }) : values(w),
|
|
7289
7281
|
{ hidden: !0 }
|
|
7290
7282
|
).map((I) => /* @__PURE__ */ jsx(
|
|
7291
7283
|
CoreBlock,
|
|
@@ -7646,44 +7638,44 @@ const Input = ({ node: o }) => {
|
|
|
7646
7638
|
}, currentAddSelection = atom(null), getBlockDisplayName = (o) => {
|
|
7647
7639
|
var n;
|
|
7648
7640
|
return o != null && o._name ? o._name : (o == null ? void 0 : o._type) === "Box" && (o != null && o.tag) && (o == null ? void 0 : o.tag) !== "div" ? startCase(o.tag) : ((n = o == null ? void 0 : o._type) == null ? void 0 : n.split("/").pop()) || "";
|
|
7649
|
-
}, Node = memo(({ node: o, style: n, dragHandle: r }) => {
|
|
7641
|
+
}, truncateText = (o, n) => o.length > n ? o.substring(0, n) + "..." : o, Node = memo(({ node: o, style: n, dragHandle: r }) => {
|
|
7650
7642
|
var R;
|
|
7651
|
-
const { t: a } = useTranslation(),
|
|
7652
|
-
let
|
|
7653
|
-
const
|
|
7654
|
-
N.stopPropagation(),
|
|
7643
|
+
const { t: a } = useTranslation(), l = useUpdateBlocksProps(), [i] = useAtom$1(canvasIframeAtom), { hasPermission: c } = usePermissions();
|
|
7644
|
+
let d = null;
|
|
7645
|
+
const p = o.children.length > 0, { highlightBlock: u, clearHighlight: g } = useBlockHighlight(), { id: m, data: h, isSelected: f, willReceiveDrop: x, isDragging: y, isEditing: b, handleClick: C } = o, B = get(h, "_show", !0), j = (N) => {
|
|
7646
|
+
N.stopPropagation(), B && o.toggle();
|
|
7655
7647
|
}, _ = (N) => {
|
|
7656
|
-
N.isInternal && (
|
|
7657
|
-
},
|
|
7658
|
-
N.isInternal &&
|
|
7659
|
-
}, [k,
|
|
7648
|
+
N.isInternal && (d = N.isOpen, N.isOpen && N.close());
|
|
7649
|
+
}, A = (N) => {
|
|
7650
|
+
N.isInternal && d !== null && (d ? N.open() : N.close(), d = null);
|
|
7651
|
+
}, [k, w] = useAtom$1(currentAddSelection), E = () => {
|
|
7660
7652
|
var N;
|
|
7661
|
-
S(), o.parent.isSelected ||
|
|
7653
|
+
S(), o.parent.isSelected || w((N = o == null ? void 0 : o.parent) == null ? void 0 : N.id);
|
|
7662
7654
|
}, S = () => {
|
|
7663
|
-
|
|
7655
|
+
w(null);
|
|
7664
7656
|
}, v = (N) => {
|
|
7665
|
-
S(), N.stopPropagation(), !o.isOpen &&
|
|
7657
|
+
S(), N.stopPropagation(), !o.isOpen && B && o.toggle(), C(N);
|
|
7666
7658
|
};
|
|
7667
7659
|
useEffect(() => {
|
|
7668
7660
|
const N = setTimeout(() => {
|
|
7669
|
-
|
|
7661
|
+
x && !o.isOpen && !y && B && o.toggle();
|
|
7670
7662
|
}, 500);
|
|
7671
7663
|
return () => clearTimeout(N);
|
|
7672
|
-
}, [
|
|
7664
|
+
}, [x, o, y]);
|
|
7673
7665
|
const I = (N, D) => {
|
|
7674
|
-
const
|
|
7666
|
+
const F = i.contentDocument || i.contentWindow.document, O = F.querySelector(`[data-block-id=${N}]`);
|
|
7675
7667
|
O && O.setAttribute("data-drop", D);
|
|
7676
|
-
const M = O.getBoundingClientRect(), H =
|
|
7677
|
-
M.top >= H.top && M.left >= H.left && M.bottom <= H.bottom && M.right <= H.right || (
|
|
7668
|
+
const M = O.getBoundingClientRect(), H = i.getBoundingClientRect();
|
|
7669
|
+
M.top >= H.top && M.left >= H.left && M.bottom <= H.bottom && M.right <= H.right || (F.documentElement.scrollTop = O.offsetTop - H.top);
|
|
7678
7670
|
}, L = (N) => {
|
|
7679
7671
|
S();
|
|
7680
7672
|
const D = get(o, "parent.id");
|
|
7681
7673
|
D !== "__REACT_ARBORIST_INTERNAL_ROOT__" ? pubsub.publish(CHAI_BUILDER_EVENTS.OPEN_ADD_BLOCK, { _id: D, position: N }) : pubsub.publish(CHAI_BUILDER_EVENTS.OPEN_ADD_BLOCK, { position: N });
|
|
7682
7674
|
};
|
|
7683
|
-
if (
|
|
7675
|
+
if (m === ROOT_TEMP_KEY)
|
|
7684
7676
|
return /* @__PURE__ */ jsxs("div", { className: "group relative w-full cursor-pointer", children: [
|
|
7685
7677
|
/* @__PURE__ */ jsx("br", {}),
|
|
7686
|
-
|
|
7678
|
+
c(PERMISSIONS.ADD_BLOCK) && /* @__PURE__ */ jsx(
|
|
7687
7679
|
"div",
|
|
7688
7680
|
{
|
|
7689
7681
|
role: "button",
|
|
@@ -7698,29 +7690,29 @@ const Input = ({ node: o }) => {
|
|
|
7698
7690
|
),
|
|
7699
7691
|
/* @__PURE__ */ jsx("br", {})
|
|
7700
7692
|
] });
|
|
7701
|
-
const T = useMemo(() => has(
|
|
7693
|
+
const T = useMemo(() => has(h, "_libBlockId") && !isEmpty(h._libBlockId) && (c(PERMISSIONS.CREATE_LIBRARY_BLOCK) || c(PERMISSIONS.EDIT_LIBRARY_BLOCK)), [h, c]), P = useMemo(() => (h == null ? void 0 : h._type) === "PartialBlock" || (h == null ? void 0 : h._type) === "GlobalBlock", [h]);
|
|
7702
7694
|
return /* @__PURE__ */ jsx("div", { className: "w-full", children: /* @__PURE__ */ jsxs(
|
|
7703
7695
|
"div",
|
|
7704
7696
|
{
|
|
7705
|
-
onMouseEnter: () =>
|
|
7706
|
-
onMouseLeave: () =>
|
|
7697
|
+
onMouseEnter: () => u(m),
|
|
7698
|
+
onMouseLeave: () => g(),
|
|
7707
7699
|
onClick: v,
|
|
7708
7700
|
style: n,
|
|
7709
|
-
"data-node-id":
|
|
7710
|
-
ref:
|
|
7701
|
+
"data-node-id": m,
|
|
7702
|
+
ref: r,
|
|
7711
7703
|
onDragStart: () => _(o),
|
|
7712
|
-
onDragEnd: () =>
|
|
7704
|
+
onDragEnd: () => A(o),
|
|
7713
7705
|
onDragOver: (N) => {
|
|
7714
|
-
N.preventDefault(), I(
|
|
7706
|
+
N.preventDefault(), I(m, "yes");
|
|
7715
7707
|
},
|
|
7716
7708
|
onDragLeave: (N) => {
|
|
7717
|
-
N.preventDefault(), I(
|
|
7709
|
+
N.preventDefault(), I(m, "no");
|
|
7718
7710
|
},
|
|
7719
7711
|
onDrop: (N) => {
|
|
7720
|
-
N.preventDefault(), I(
|
|
7712
|
+
N.preventDefault(), I(m, "no");
|
|
7721
7713
|
},
|
|
7722
7714
|
children: [
|
|
7723
|
-
|
|
7715
|
+
c(PERMISSIONS.ADD_BLOCK) && (o == null ? void 0 : o.rowIndex) > 0 && (o.parent.isOpen && canAddChildBlock(get(o, "parent.data._type")) || ((R = o == null ? void 0 : o.parent) == null ? void 0 : R.id) === "__REACT_ARBORIST_INTERNAL_ROOT__") && /* @__PURE__ */ jsx("div", { className: "group relative ml-5 h-full w-full cursor-pointer", children: /* @__PURE__ */ jsx(
|
|
7724
7716
|
"div",
|
|
7725
7717
|
{
|
|
7726
7718
|
onClick: (N) => {
|
|
@@ -7728,21 +7720,21 @@ const Input = ({ node: o }) => {
|
|
|
7728
7720
|
},
|
|
7729
7721
|
onMouseEnter: E,
|
|
7730
7722
|
onMouseLeave: S,
|
|
7731
|
-
className: "absolute -top-0.5 h-
|
|
7732
|
-
children: /* @__PURE__ */ jsx("div", { className: "absolute left-1/2 top-1/2 flex h-4 w-4 -translate-x-1/2 -translate-y-1/2 transform items-center justify-center rounded-full bg-primary p-1 outline outline-2 outline-white hover:bg-primary", children: /* @__PURE__ */ jsx(PlusIcon, { className: "h-
|
|
7723
|
+
className: "absolute -top-0.5 h-0.5 w-[90%] rounded bg-primary/80 opacity-0 delay-200 duration-200 group-hover:opacity-100",
|
|
7724
|
+
children: /* @__PURE__ */ jsx("div", { className: "absolute left-1/2 top-1/2 flex h-4 w-4 -translate-x-1/2 -translate-y-1/2 transform items-center justify-center rounded-full bg-primary/80 p-1 outline outline-2 outline-white hover:bg-primary/80", children: /* @__PURE__ */ jsx(PlusIcon, { className: "h-2 w-2 stroke-[2] text-white" }) })
|
|
7733
7725
|
}
|
|
7734
7726
|
) }),
|
|
7735
7727
|
/* @__PURE__ */ jsxs(
|
|
7736
7728
|
"div",
|
|
7737
7729
|
{
|
|
7738
7730
|
className: cn(
|
|
7739
|
-
"group flex w-full cursor-pointer items-center justify-between space-x-px !rounded p-1 outline-none",
|
|
7740
|
-
|
|
7741
|
-
|
|
7731
|
+
"group flex w-full cursor-pointer items-center justify-between space-x-px !rounded p-1 py-0 outline-none",
|
|
7732
|
+
f ? "bg-primary/20" : "hover:bg-primary/10",
|
|
7733
|
+
x && canAcceptChildBlock(h._type, "Icon") ? "bg-green-200" : "",
|
|
7742
7734
|
(o == null ? void 0 : o.id) === k ? "bg-primary/10" : "",
|
|
7743
|
-
|
|
7744
|
-
|
|
7745
|
-
T &&
|
|
7735
|
+
y && "opacity-20",
|
|
7736
|
+
B ? "" : "line-through opacity-50",
|
|
7737
|
+
T && f && "bg-primary/20 text-primary"
|
|
7746
7738
|
),
|
|
7747
7739
|
children: [
|
|
7748
7740
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center", children: [
|
|
@@ -7750,7 +7742,7 @@ const Input = ({ node: o }) => {
|
|
|
7750
7742
|
"div",
|
|
7751
7743
|
{
|
|
7752
7744
|
className: `flex h-4 w-4 rotate-0 transform cursor-pointer items-center justify-center transition-transform duration-100 ${o.isOpen ? "rotate-90" : ""}`,
|
|
7753
|
-
children:
|
|
7745
|
+
children: p && /* @__PURE__ */ jsx("button", { onClick: j, type: "button", children: /* @__PURE__ */ jsx(ChevronRightIcon, { className: "h-3 w-3" }) })
|
|
7754
7746
|
}
|
|
7755
7747
|
),
|
|
7756
7748
|
/* @__PURE__ */ jsxs(
|
|
@@ -7759,20 +7751,20 @@ const Input = ({ node: o }) => {
|
|
|
7759
7751
|
className: cn(
|
|
7760
7752
|
"leading-1 flex items-center",
|
|
7761
7753
|
T && "text-orange-600/90",
|
|
7762
|
-
T &&
|
|
7754
|
+
T && f && "text-orange-800",
|
|
7763
7755
|
P && "text-purple-600/90",
|
|
7764
|
-
P &&
|
|
7756
|
+
P && f && "text-purple-800"
|
|
7765
7757
|
),
|
|
7766
7758
|
children: [
|
|
7767
|
-
/* @__PURE__ */ jsx(TypeIcon, { type:
|
|
7768
|
-
|
|
7759
|
+
/* @__PURE__ */ jsx(TypeIcon, { type: h == null ? void 0 : h._type }),
|
|
7760
|
+
b ? /* @__PURE__ */ jsx(Input, { node: o }) : /* @__PURE__ */ jsx(
|
|
7769
7761
|
"div",
|
|
7770
7762
|
{
|
|
7771
7763
|
className: "ml-1.5 flex items-center gap-x-1 truncate text-[13px]",
|
|
7772
7764
|
onDoubleClick: (N) => {
|
|
7773
7765
|
N.stopPropagation(), o.edit(), o.deselect();
|
|
7774
7766
|
},
|
|
7775
|
-
children: /* @__PURE__ */ jsx("span", { children: getBlockDisplayName(
|
|
7767
|
+
children: /* @__PURE__ */ jsx("span", { title: getBlockDisplayName(h).length > 17 ? getBlockDisplayName(h) : "", children: truncateText(getBlockDisplayName(h), 17) })
|
|
7776
7768
|
}
|
|
7777
7769
|
)
|
|
7778
7770
|
]
|
|
@@ -7780,11 +7772,11 @@ const Input = ({ node: o }) => {
|
|
|
7780
7772
|
)
|
|
7781
7773
|
] }),
|
|
7782
7774
|
/* @__PURE__ */ jsxs("div", { className: "invisible flex items-center space-x-1.5 pr-px group-hover:visible", children: [
|
|
7783
|
-
canAddChildBlock(
|
|
7775
|
+
canAddChildBlock(h == null ? void 0 : h._type) && B && c(PERMISSIONS.ADD_BLOCK) ? /* @__PURE__ */ jsxs(Tooltip, { children: [
|
|
7784
7776
|
/* @__PURE__ */ jsx(
|
|
7785
7777
|
TooltipTrigger,
|
|
7786
7778
|
{
|
|
7787
|
-
onClick: () => pubsub.publish(CHAI_BUILDER_EVENTS.OPEN_ADD_BLOCK, { _id:
|
|
7779
|
+
onClick: () => pubsub.publish(CHAI_BUILDER_EVENTS.OPEN_ADD_BLOCK, { _id: m }),
|
|
7788
7780
|
className: "cursor-pointer rounded bg-transparent p-px hover:bg-primary/10",
|
|
7789
7781
|
asChild: !0,
|
|
7790
7782
|
children: /* @__PURE__ */ jsx(PlusIcon, { className: "h-4 w-4" })
|
|
@@ -7797,16 +7789,16 @@ const Input = ({ node: o }) => {
|
|
|
7797
7789
|
TooltipTrigger,
|
|
7798
7790
|
{
|
|
7799
7791
|
onClick: (N) => {
|
|
7800
|
-
N.stopPropagation(),
|
|
7792
|
+
N.stopPropagation(), l([m], { _show: !B }), o.isOpen && o.toggle();
|
|
7801
7793
|
},
|
|
7802
7794
|
className: "cursor-pointer rounded bg-transparent p-0.5 hover:bg-primary/10",
|
|
7803
7795
|
asChild: !0,
|
|
7804
|
-
children: /* @__PURE__ */ jsx(
|
|
7796
|
+
children: B ? /* @__PURE__ */ jsx(EyeClosedIcon, { className: "h-4 w-4" }) : /* @__PURE__ */ jsx(EyeOpenIcon, { className: "h-4 w-4" })
|
|
7805
7797
|
}
|
|
7806
7798
|
),
|
|
7807
|
-
/* @__PURE__ */ jsx(TooltipContent, { className: "isolate z-[9999]", side: "bottom", children: a("Hide block") })
|
|
7799
|
+
/* @__PURE__ */ jsx(TooltipContent, { className: "isolate z-[9999] text-xs", side: "bottom", children: a(B ? "Hide the block from page" : "Show the block on page") })
|
|
7808
7800
|
] }),
|
|
7809
|
-
/* @__PURE__ */ jsx(BlockMoreOptions, { node: o, id:
|
|
7801
|
+
/* @__PURE__ */ jsx(BlockMoreOptions, { node: o, id: m, children: /* @__PURE__ */ jsx("div", { className: "cursor-pointer rounded bg-transparent p-px hover:bg-primary/10", children: /* @__PURE__ */ jsx(DotsVerticalIcon, { className: "h-3 w-3" }) }) })
|
|
7810
7802
|
] })
|
|
7811
7803
|
]
|
|
7812
7804
|
}
|
|
@@ -7853,7 +7845,7 @@ const Input = ({ node: o }) => {
|
|
|
7853
7845
|
return canAcceptChildBlock(a, l);
|
|
7854
7846
|
};
|
|
7855
7847
|
}, ListTree = () => {
|
|
7856
|
-
const [treeData] = useAtom$1(treeDSBlocks), [ids, setIds] = useSelectedBlockIds(), [cutBlocksIds] = useCutBlockIds(),
|
|
7848
|
+
const [treeData] = useAtom$1(treeDSBlocks), [ids, setIds] = useSelectedBlockIds(), [cutBlocksIds] = useCutBlockIds(), updateBlockProps = useUpdateBlocksProps(), [, setStyleBlocks] = useSelectedStylingBlocks(), { moveBlocks } = useBlocksStoreUndoableActions(), canMove = useCanMove(), treeRef = useRef(null), [, setTreeRef] = useAtom$1(treeRefAtom), { t } = useTranslation(), [parentContext, setParentContext] = useState(null), clearSelection = () => {
|
|
7857
7849
|
setIds([]), setStyleBlocks([]);
|
|
7858
7850
|
}, filteredTreeData = useMemo(() => {
|
|
7859
7851
|
const o = (r, a) => r.filter((l) => !a.includes(l._id)).map((l) => ({
|
|
@@ -7931,6 +7923,7 @@ const Input = ({ node: o }) => {
|
|
|
7931
7923
|
disabled: !hasPermission(PERMISSIONS.ADD_BLOCK),
|
|
7932
7924
|
onClick: () => pubsub.publish(CHAI_BUILDER_EVENTS.OPEN_ADD_BLOCK),
|
|
7933
7925
|
variant: "default",
|
|
7926
|
+
className: "bg-primary/80",
|
|
7934
7927
|
size: "sm",
|
|
7935
7928
|
children: [
|
|
7936
7929
|
"+ ",
|
|
@@ -7949,19 +7942,6 @@ const Input = ({ node: o }) => {
|
|
|
7949
7942
|
},
|
|
7950
7943
|
children: [
|
|
7951
7944
|
/* @__PURE__ */ jsxs("div", { className: "mb-2 flex items-center justify-end gap-x-1 pb-2 text-sm text-muted-foreground", children: [
|
|
7952
|
-
/* @__PURE__ */ jsxs(Tooltip, { children: [
|
|
7953
|
-
/* @__PURE__ */ jsx(TooltipTrigger, { asChild: !0, children: /* @__PURE__ */ jsx(
|
|
7954
|
-
Button,
|
|
7955
|
-
{
|
|
7956
|
-
onClick: () => setHiddenBlocks([]),
|
|
7957
|
-
variant: "ghost",
|
|
7958
|
-
className: "h-fit p-1 disabled:cursor-not-allowed disabled:opacity-50",
|
|
7959
|
-
size: "sm",
|
|
7960
|
-
children: /* @__PURE__ */ jsx(EyeOpenIcon, { className: "h-2 w-2" })
|
|
7961
|
-
}
|
|
7962
|
-
) }),
|
|
7963
|
-
/* @__PURE__ */ jsx(TooltipContent, { className: "isolate z-[9999]", children: t("Show hidden blocks") })
|
|
7964
|
-
] }),
|
|
7965
7945
|
/* @__PURE__ */ jsxs(Tooltip, { children: [
|
|
7966
7946
|
/* @__PURE__ */ jsx(TooltipTrigger, { asChild: !0, children: /* @__PURE__ */ jsx(Button, { className: "h-fit p-1", onClick: () => {
|
|
7967
7947
|
var o;
|
|
@@ -8001,7 +7981,7 @@ const Input = ({ node: o }) => {
|
|
|
8001
7981
|
onSelect,
|
|
8002
7982
|
childrenAccessor: (o) => o.children,
|
|
8003
7983
|
width: "100%",
|
|
8004
|
-
rowHeight:
|
|
7984
|
+
rowHeight: 25,
|
|
8005
7985
|
renderDragPreview: DefaultDragPreview,
|
|
8006
7986
|
indent: 10,
|
|
8007
7987
|
onContextMenu,
|
|
@@ -8212,7 +8192,7 @@ const Input = ({ node: o }) => {
|
|
|
8212
8192
|
"popover-foreground": ["#3d3436", "#f2e9e4"]
|
|
8213
8193
|
}
|
|
8214
8194
|
}, LazyCssImportModal = lazy(
|
|
8215
|
-
() => import("./css-import-modal-
|
|
8195
|
+
() => import("./css-import-modal-BvRHCuHm.js").then((o) => ({ default: o.CssImportModal }))
|
|
8216
8196
|
), PREV_THEME_KEY = "chai-builder-previous-theme", DEFAULT_THEME_PRESET = [
|
|
8217
8197
|
{ shadcn_default: defaultShadcnPreset },
|
|
8218
8198
|
{ twitter_theme: twitter },
|
|
@@ -8236,16 +8216,16 @@ const Input = ({ node: o }) => {
|
|
|
8236
8216
|
}, ThemeConfigPanel = React.memo(({ className: o = "" }) => {
|
|
8237
8217
|
const [n, r] = useDarkMode(), [a, l] = React.useState(""), [i, c] = React.useState(!1), d = useBuilderProp("themePresets", []), p = useBuilderProp("themePanelComponent", null), { hasPermission: u } = usePermissions();
|
|
8238
8218
|
if (d) {
|
|
8239
|
-
const
|
|
8219
|
+
const A = d.map((k) => Object.keys(k)[0]);
|
|
8240
8220
|
DEFAULT_THEME_PRESET.forEach((k) => {
|
|
8241
|
-
const
|
|
8242
|
-
|
|
8221
|
+
const w = Object.keys(k)[0];
|
|
8222
|
+
A.includes(w) || d.push(k);
|
|
8243
8223
|
});
|
|
8244
8224
|
}
|
|
8245
8225
|
const [g, m] = useTheme(), h = useThemeOptions(), { t: f } = useTranslation(), x = React.useCallback(
|
|
8246
|
-
(
|
|
8226
|
+
(A) => {
|
|
8247
8227
|
const k = { ...g };
|
|
8248
|
-
setPreviousTheme(k), m(
|
|
8228
|
+
setPreviousTheme(k), m(A), toast.success("Theme updated", {
|
|
8249
8229
|
action: {
|
|
8250
8230
|
label: /* @__PURE__ */ jsxs("span", { className: "flex items-center gap-2", children: [
|
|
8251
8231
|
/* @__PURE__ */ jsx(ResetIcon, { className: "h-4 w-4" }),
|
|
@@ -8261,56 +8241,56 @@ const Input = ({ node: o }) => {
|
|
|
8261
8241
|
},
|
|
8262
8242
|
[g, m]
|
|
8263
8243
|
), y = () => {
|
|
8264
|
-
const
|
|
8265
|
-
if (
|
|
8266
|
-
const k = Object.values(
|
|
8244
|
+
const A = d.find((k) => Object.keys(k)[0] === a);
|
|
8245
|
+
if (A) {
|
|
8246
|
+
const k = Object.values(A)[0];
|
|
8267
8247
|
k && typeof k == "object" && "fontFamily" in k && "borderRadius" in k && "colors" in k ? (x(k), l("")) : console.error("Invalid preset structure:", k);
|
|
8268
8248
|
} else
|
|
8269
8249
|
console.error("Preset not found:", a);
|
|
8270
|
-
}, b = (
|
|
8271
|
-
x(
|
|
8250
|
+
}, b = (A) => {
|
|
8251
|
+
x(A), l("");
|
|
8272
8252
|
}, C = useDebouncedCallback(
|
|
8273
|
-
(
|
|
8253
|
+
(A, k) => {
|
|
8274
8254
|
m(() => ({
|
|
8275
8255
|
...g,
|
|
8276
8256
|
fontFamily: {
|
|
8277
8257
|
...g.fontFamily,
|
|
8278
|
-
[
|
|
8258
|
+
[A.replace(/font-/g, "")]: k
|
|
8279
8259
|
}
|
|
8280
8260
|
}));
|
|
8281
8261
|
},
|
|
8282
8262
|
[g],
|
|
8283
8263
|
200
|
|
8284
8264
|
), B = React.useCallback(
|
|
8285
|
-
(
|
|
8265
|
+
(A) => {
|
|
8286
8266
|
m(() => ({
|
|
8287
8267
|
...g,
|
|
8288
|
-
borderRadius: `${
|
|
8268
|
+
borderRadius: `${A}px`
|
|
8289
8269
|
}));
|
|
8290
8270
|
},
|
|
8291
8271
|
[g]
|
|
8292
8272
|
), j = useDebouncedCallback(
|
|
8293
|
-
(
|
|
8273
|
+
(A, k) => {
|
|
8294
8274
|
m(() => {
|
|
8295
|
-
const
|
|
8296
|
-
return n ? set(
|
|
8275
|
+
const w = get(g, `colors.${A}`);
|
|
8276
|
+
return n ? set(w, 1, k) : set(w, 0, k), {
|
|
8297
8277
|
...g,
|
|
8298
8278
|
colors: {
|
|
8299
8279
|
...g.colors,
|
|
8300
|
-
[
|
|
8280
|
+
[A]: w
|
|
8301
8281
|
}
|
|
8302
8282
|
};
|
|
8303
8283
|
});
|
|
8304
8284
|
},
|
|
8305
8285
|
[g],
|
|
8306
8286
|
200
|
|
8307
|
-
), _ = (
|
|
8308
|
-
const
|
|
8309
|
-
return
|
|
8287
|
+
), _ = (A) => /* @__PURE__ */ jsx("div", { className: "grid grid-cols-1", children: Object.entries(A.items).map(([k]) => {
|
|
8288
|
+
const w = get(g, `colors.${k}.${n ? 1 : 0}`);
|
|
8289
|
+
return w ? /* @__PURE__ */ jsxs("div", { className: "mt-1 flex items-center gap-x-2", children: [
|
|
8310
8290
|
/* @__PURE__ */ jsx(
|
|
8311
8291
|
ColorPickerInput,
|
|
8312
8292
|
{
|
|
8313
|
-
value:
|
|
8293
|
+
value: w,
|
|
8314
8294
|
onChange: (E) => j(k, E)
|
|
8315
8295
|
}
|
|
8316
8296
|
),
|
|
@@ -8330,9 +8310,9 @@ const Input = ({ node: o }) => {
|
|
|
8330
8310
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 px-0", children: [
|
|
8331
8311
|
/* @__PURE__ */ jsx("div", { className: "w-[70%]", children: /* @__PURE__ */ jsxs(Select$1, { value: a, onValueChange: l, children: [
|
|
8332
8312
|
/* @__PURE__ */ jsx(SelectTrigger, { className: "h-9 w-full text-sm", children: /* @__PURE__ */ jsx(SelectValue, { placeholder: "Select preset" }) }),
|
|
8333
|
-
/* @__PURE__ */ jsx(SelectContent, { children: Array.isArray(d) && d.map((
|
|
8334
|
-
const k = Object.keys(
|
|
8335
|
-
return /* @__PURE__ */ jsx(SelectItem, { value: k, children: capitalize(
|
|
8313
|
+
/* @__PURE__ */ jsx(SelectContent, { children: Array.isArray(d) && d.map((A) => {
|
|
8314
|
+
const k = Object.keys(A)[0], w = k.replaceAll("_", " ");
|
|
8315
|
+
return /* @__PURE__ */ jsx(SelectItem, { value: k, children: capitalize(w) }, k);
|
|
8336
8316
|
}) })
|
|
8337
8317
|
] }) }),
|
|
8338
8318
|
/* @__PURE__ */ jsx("div", { className: "w-[25%]", children: /* @__PURE__ */ jsx(Button, { className: "w-full text-sm", disabled: !a, onClick: y, children: f("Apply") }) })
|
|
@@ -8344,14 +8324,14 @@ const Input = ({ node: o }) => {
|
|
|
8344
8324
|
/* @__PURE__ */ jsx(TextIcon, { className: "h-3 w-3 text-gray-600" }),
|
|
8345
8325
|
/* @__PURE__ */ jsx("span", { className: "text-xs font-medium text-gray-700", children: "Typography" })
|
|
8346
8326
|
] }),
|
|
8347
|
-
(h == null ? void 0 : h.fontFamily) && /* @__PURE__ */ jsx("div", { className: "space-y-2", children: Object.entries(h.fontFamily).map(([
|
|
8327
|
+
(h == null ? void 0 : h.fontFamily) && /* @__PURE__ */ jsx("div", { className: "space-y-2", children: Object.entries(h.fontFamily).map(([A, k]) => /* @__PURE__ */ jsx(
|
|
8348
8328
|
FontSelector,
|
|
8349
8329
|
{
|
|
8350
|
-
label:
|
|
8351
|
-
value: g.fontFamily[
|
|
8352
|
-
onChange: (
|
|
8330
|
+
label: A,
|
|
8331
|
+
value: g.fontFamily[A.replace(/font-/g, "")] || k[Object.keys(k)[0]],
|
|
8332
|
+
onChange: (w) => C(A, w)
|
|
8353
8333
|
},
|
|
8354
|
-
|
|
8334
|
+
A
|
|
8355
8335
|
)) }),
|
|
8356
8336
|
/* @__PURE__ */ jsx(Separator, {}),
|
|
8357
8337
|
(h == null ? void 0 : h.borderRadius) && /* @__PURE__ */ jsxs("div", { className: "space-y-0.5", children: [
|
|
@@ -8377,7 +8357,7 @@ const Input = ({ node: o }) => {
|
|
|
8377
8357
|
Switch,
|
|
8378
8358
|
{
|
|
8379
8359
|
checked: n,
|
|
8380
|
-
onCheckedChange: (
|
|
8360
|
+
onCheckedChange: (A) => r(A),
|
|
8381
8361
|
"aria-label": "Toggle dark mode",
|
|
8382
8362
|
className: "mx-1"
|
|
8383
8363
|
}
|
|
@@ -8385,7 +8365,7 @@ const Input = ({ node: o }) => {
|
|
|
8385
8365
|
/* @__PURE__ */ jsx(MoonIcon, { className: "h-4 w-4" })
|
|
8386
8366
|
] }) })
|
|
8387
8367
|
] }),
|
|
8388
|
-
/* @__PURE__ */ jsx("div", { className: "space-y-2", children: h.colors.map((
|
|
8368
|
+
/* @__PURE__ */ jsx("div", { className: "space-y-2", children: h.colors.map((A) => _(A)) })
|
|
8389
8369
|
] }),
|
|
8390
8370
|
/* @__PURE__ */ jsx(Suspense, { fallback: /* @__PURE__ */ jsx("div", { children: "Loading..." }), children: i && /* @__PURE__ */ jsx(
|
|
8391
8371
|
LazyCssImportModal,
|
|
@@ -9025,8 +9005,8 @@ function AIChatPanel() {
|
|
|
9025
9005
|
if (C) {
|
|
9026
9006
|
const j = new FileReader();
|
|
9027
9007
|
j.onload = (_) => {
|
|
9028
|
-
var
|
|
9029
|
-
d((
|
|
9008
|
+
var A;
|
|
9009
|
+
d((A = _.target) == null ? void 0 : A.result);
|
|
9030
9010
|
}, j.readAsDataURL(C);
|
|
9031
9011
|
}
|
|
9032
9012
|
}, x = () => {
|
|
@@ -9235,8 +9215,8 @@ const AiAssistant = () => {
|
|
|
9235
9215
|
r(k), l(a), c(""), p(""), h("");
|
|
9236
9216
|
}
|
|
9237
9217
|
}, C = (k) => {
|
|
9238
|
-
const
|
|
9239
|
-
r(
|
|
9218
|
+
const w = a.filter((E, S) => S !== k);
|
|
9219
|
+
r(w), l(w);
|
|
9240
9220
|
}, B = (k) => {
|
|
9241
9221
|
g(k), c(a[k].key), p(a[k].value);
|
|
9242
9222
|
}, j = () => {
|
|
@@ -9250,11 +9230,11 @@ const AiAssistant = () => {
|
|
|
9250
9230
|
}
|
|
9251
9231
|
}, _ = (k) => {
|
|
9252
9232
|
k.key === "Enter" && !k.shiftKey && (k.preventDefault(), u !== null ? j() : b());
|
|
9253
|
-
},
|
|
9254
|
-
const
|
|
9233
|
+
}, A = useCallback((k) => {
|
|
9234
|
+
const w = (v) => /[.,!?;:]/.test(v), E = (v, I, L) => {
|
|
9255
9235
|
let T = "", P = "";
|
|
9256
9236
|
const R = I > 0 ? v[I - 1] : "", N = I < v.length ? v[I] : "";
|
|
9257
|
-
return I > 0 && (R === "." || !
|
|
9237
|
+
return I > 0 && (R === "." || !w(R) && R !== " ") && (T = " "), I < v.length && !w(N) && N !== " " && (P = " "), {
|
|
9258
9238
|
text: T + L + P,
|
|
9259
9239
|
prefixLength: T.length,
|
|
9260
9240
|
suffixLength: P.length
|
|
@@ -9263,7 +9243,7 @@ const AiAssistant = () => {
|
|
|
9263
9243
|
if (S) {
|
|
9264
9244
|
const v = S.selectionStart || 0, I = S.value || "", L = S.selectionEnd || v;
|
|
9265
9245
|
if (L > v) {
|
|
9266
|
-
const D = `{{${k}}}`, { text:
|
|
9246
|
+
const D = `{{${k}}}`, { text: F } = E(I, v, D), O = I.slice(0, v) + F + I.slice(L);
|
|
9267
9247
|
p(O);
|
|
9268
9248
|
return;
|
|
9269
9249
|
}
|
|
@@ -9301,7 +9281,7 @@ const AiAssistant = () => {
|
|
|
9301
9281
|
/* @__PURE__ */ jsxs("div", { className: "w-full", children: [
|
|
9302
9282
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between", children: [
|
|
9303
9283
|
/* @__PURE__ */ jsx(Label, { htmlFor: "attrValue", className: "text-[11px] font-normal text-slate-600", children: "Value" }),
|
|
9304
|
-
!isEmpty(y) && /* @__PURE__ */ jsx(NestedPathSelector, { data: y, onSelect:
|
|
9284
|
+
!isEmpty(y) && /* @__PURE__ */ jsx(NestedPathSelector, { data: y, onSelect: A })
|
|
9305
9285
|
] }),
|
|
9306
9286
|
/* @__PURE__ */ jsx(
|
|
9307
9287
|
Textarea,
|
|
@@ -9326,16 +9306,16 @@ const AiAssistant = () => {
|
|
|
9326
9306
|
]
|
|
9327
9307
|
}
|
|
9328
9308
|
),
|
|
9329
|
-
/* @__PURE__ */ jsx("div", { className: "space-y-1 py-4", children: a.map((k,
|
|
9309
|
+
/* @__PURE__ */ jsx("div", { className: "space-y-1 py-4", children: a.map((k, w) => /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between rounded border p-2 text-sm", children: [
|
|
9330
9310
|
/* @__PURE__ */ jsxs("div", { className: "flex flex-col text-xs leading-tight", children: [
|
|
9331
9311
|
/* @__PURE__ */ jsx("span", { className: "truncate text-[12px] font-light text-muted-foreground", children: k.key }),
|
|
9332
9312
|
/* @__PURE__ */ jsx("span", { className: "max-w-[200px] text-wrap font-normal", children: k.value.toString() })
|
|
9333
9313
|
] }),
|
|
9334
9314
|
/* @__PURE__ */ jsxs("div", { className: "flex-shrink-0 text-slate-400", children: [
|
|
9335
|
-
/* @__PURE__ */ jsx(Button, { variant: "ghost", size: "icon", className: "h-6 w-6", onClick: () => B(
|
|
9336
|
-
/* @__PURE__ */ jsx(Button, { variant: "ghost", size: "icon", className: "h-6 w-6", onClick: () => C(
|
|
9315
|
+
/* @__PURE__ */ jsx(Button, { variant: "ghost", size: "icon", className: "h-6 w-6", onClick: () => B(w), children: /* @__PURE__ */ jsx(Pencil2Icon, { className: "h-3 w-3" }) }),
|
|
9316
|
+
/* @__PURE__ */ jsx(Button, { variant: "ghost", size: "icon", className: "h-6 w-6", onClick: () => C(w), children: /* @__PURE__ */ jsx(Cross1Icon, { className: "h-3 w-3" }) })
|
|
9337
9317
|
] })
|
|
9338
|
-
] },
|
|
9318
|
+
] }, w)) })
|
|
9339
9319
|
] });
|
|
9340
9320
|
}), BlockAttributesEditor = React.memo(() => {
|
|
9341
9321
|
const o = useSelectedBlock(), [n, r] = useState([]), [a] = useSelectedStylingBlocks(), l = useUpdateBlocksProps(), i = `${get(a, "0.prop")}_attrs`;
|
|
@@ -9404,11 +9384,23 @@ function BlockAttributesToggle() {
|
|
|
9404
9384
|
n && /* @__PURE__ */ jsx(BlockAttributesEditor, {})
|
|
9405
9385
|
] });
|
|
9406
9386
|
}
|
|
9407
|
-
const
|
|
9387
|
+
const PartialWrapper = ({ partialBlockId: o }) => {
|
|
9388
|
+
const n = useBuilderProp("gotoPage", noop), { saveState: r } = useSavePage(), { selectedLang: a, fallbackLang: l } = useLanguages(), i = useCallback(
|
|
9389
|
+
(c) => {
|
|
9390
|
+
if (c.stopPropagation(), r !== "SAVED") {
|
|
9391
|
+
toast.error("You have unsaved changes. Please save the page first.");
|
|
9392
|
+
return;
|
|
9393
|
+
}
|
|
9394
|
+
n({ pageId: o, lang: a || l });
|
|
9395
|
+
},
|
|
9396
|
+
[r, n, o, a, l]
|
|
9397
|
+
);
|
|
9398
|
+
return /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx("div", { className: "hidden", children: /* @__PURE__ */ jsx("div", { onDoubleClick: i, className: "h-full w-full items-center justify-center", children: /* @__PURE__ */ jsx("p", { className: "rounded-md bg-white px-2 py-1 text-xs", children: "Partial block. Double click to edit." }) }) }) });
|
|
9399
|
+
}, SettingsPanel = () => {
|
|
9408
9400
|
const o = useSelectedBlock(), { t: n } = useTranslation(), r = useBuilderProp("onError", noop), { hasPermission: a } = usePermissions();
|
|
9409
9401
|
let l = !a(PERMISSIONS.EDIT_BLOCK);
|
|
9410
9402
|
const i = !a(PERMISSIONS.EDIT_STYLES);
|
|
9411
|
-
return isNull(o) ? /* @__PURE__ */ jsx("div", { className: "p-4 text-center", children: /* @__PURE__ */ jsxs("div", { className: "space-y-4 rounded-xl p-4 text-muted-foreground", children: [
|
|
9403
|
+
return o && o._type === "PartialBlock" ? /* @__PURE__ */ jsx(PartialWrapper, { partialBlockId: o.partialBlockId }) : isNull(o) ? /* @__PURE__ */ jsx("div", { className: "p-4 text-center", children: /* @__PURE__ */ jsxs("div", { className: "space-y-4 rounded-xl p-4 text-muted-foreground", children: [
|
|
9412
9404
|
/* @__PURE__ */ jsx(MixerHorizontalIcon, { className: "mx-auto text-3xl" }),
|
|
9413
9405
|
/* @__PURE__ */ jsx("h1", { children: n("Please select a block to edit settings or styles") })
|
|
9414
9406
|
] }) }) : l && i ? /* @__PURE__ */ jsx("div", { className: "p-4 text-center", children: /* @__PURE__ */ jsxs("div", { className: "space-y-4 rounded-xl p-4 text-muted-foreground", children: [
|
|
@@ -9493,11 +9485,11 @@ function useSidebarDefaultPanels() {
|
|
|
9493
9485
|
}, [o, n, r]);
|
|
9494
9486
|
}
|
|
9495
9487
|
const RootLayout = () => {
|
|
9496
|
-
const o = useTopBarComponent(), [n, r] = useSidebarActivePanel(), a = useRef("outline"), [l, i] = useState(DEFAULT_PANEL_WIDTH), [c, d] = useRightPanel(), p = useSidebarDefaultPanels(), u = useChaiSidebarPanels("top"), g = useChaiSidebarPanels("bottom"), m = reverse([...g ?? []]), h = useCallback((
|
|
9497
|
-
|
|
9488
|
+
const o = useTopBarComponent(), [n, r] = useSidebarActivePanel(), a = useRef("outline"), [l, i] = useState(DEFAULT_PANEL_WIDTH), [c, d] = useRightPanel(), p = useSidebarDefaultPanels(), u = useChaiSidebarPanels("top"), g = useChaiSidebarPanels("bottom"), m = reverse([...g ?? []]), h = useCallback((w) => {
|
|
9489
|
+
w.preventDefault();
|
|
9498
9490
|
}, []), f = useCallback(
|
|
9499
|
-
(
|
|
9500
|
-
console.log("handleMenuItemClick",
|
|
9491
|
+
(w) => {
|
|
9492
|
+
console.log("handleMenuItemClick", w, n), r(n === w ? null : w);
|
|
9501
9493
|
},
|
|
9502
9494
|
[n, r]
|
|
9503
9495
|
), { t: x } = useTranslation(), y = useMemo(
|
|
@@ -9506,25 +9498,25 @@ const RootLayout = () => {
|
|
|
9506
9498
|
), b = useBuilderProp("htmlDir", "ltr"), C = find(y, { id: n }) ?? first(y), B = get(C, "width", DEFAULT_PANEL_WIDTH);
|
|
9507
9499
|
useEffect(() => {
|
|
9508
9500
|
if (n !== null) {
|
|
9509
|
-
const
|
|
9510
|
-
|
|
9501
|
+
const w = find(y, { id: n });
|
|
9502
|
+
w && get(w, "view", "standard") === "standard" && (a.current = n, i(get(w, "width", DEFAULT_PANEL_WIDTH)));
|
|
9511
9503
|
}
|
|
9512
9504
|
}, [n, y]);
|
|
9513
9505
|
const j = useMemo(() => {
|
|
9514
9506
|
if (n === null) return 0;
|
|
9515
|
-
const
|
|
9516
|
-
return get(
|
|
9507
|
+
const w = find(y, { id: n });
|
|
9508
|
+
return get(w, "view", "standard") === "standard" ? B : l;
|
|
9517
9509
|
}, [n, B, l, y]), _ = useCallback(() => {
|
|
9518
9510
|
r(a.current);
|
|
9519
|
-
}, [r, n]),
|
|
9511
|
+
}, [r, n]), A = useCallback(() => {
|
|
9520
9512
|
r("outline");
|
|
9521
9513
|
}, [r]);
|
|
9522
9514
|
useEffect(() => {
|
|
9523
9515
|
n !== null && !find(y, { id: n }) && r("outline");
|
|
9524
9516
|
}, [n, y]);
|
|
9525
9517
|
const k = useCallback(
|
|
9526
|
-
(
|
|
9527
|
-
f(
|
|
9518
|
+
(w) => {
|
|
9519
|
+
f(w);
|
|
9528
9520
|
},
|
|
9529
9521
|
[f]
|
|
9530
9522
|
);
|
|
@@ -9538,24 +9530,24 @@ const RootLayout = () => {
|
|
|
9538
9530
|
/* @__PURE__ */ jsx("div", { className: "flex h-[50px] w-screen items-center border-b border-border", children: /* @__PURE__ */ jsx(Suspense, { children: /* @__PURE__ */ jsx(o, {}) }) }),
|
|
9539
9531
|
/* @__PURE__ */ jsxs("main", { className: "relative flex h-[calc(100vh-56px)] max-w-full flex-1 flex-row", children: [
|
|
9540
9532
|
/* @__PURE__ */ jsxs("div", { id: "sidebar", className: "flex w-12 flex-col items-center justify-between border-r border-border py-2", children: [
|
|
9541
|
-
/* @__PURE__ */ jsx("div", { className: "flex flex-col gap-y-1", children: [p, u].flat().map((
|
|
9542
|
-
/* @__PURE__ */ jsx(TooltipTrigger, { asChild: !0, children: createElement(get(
|
|
9533
|
+
/* @__PURE__ */ jsx("div", { className: "flex flex-col gap-y-1", children: [p, u].flat().map((w, E) => /* @__PURE__ */ jsxs(Tooltip, { children: [
|
|
9534
|
+
/* @__PURE__ */ jsx(TooltipTrigger, { asChild: !0, children: createElement(get(w, "button", NoopComponent), {
|
|
9543
9535
|
position: "top",
|
|
9544
|
-
panelId:
|
|
9545
|
-
isActive: n ===
|
|
9546
|
-
show: () => k(
|
|
9536
|
+
panelId: w.id,
|
|
9537
|
+
isActive: n === w.id,
|
|
9538
|
+
show: () => k(w.id)
|
|
9547
9539
|
}) }),
|
|
9548
|
-
/* @__PURE__ */ jsx(TooltipContent, { side: "right", children: /* @__PURE__ */ jsx("p", { children: x(
|
|
9540
|
+
/* @__PURE__ */ jsx(TooltipContent, { side: "right", children: /* @__PURE__ */ jsx("p", { children: x(w.label) }) })
|
|
9549
9541
|
] }, "button-top-" + E)) }),
|
|
9550
9542
|
/* @__PURE__ */ jsx("div", { className: "flex flex-col space-y-1" }),
|
|
9551
|
-
/* @__PURE__ */ jsx("div", { className: "flex flex-col", children: m == null ? void 0 : m.map((
|
|
9552
|
-
/* @__PURE__ */ jsx(TooltipTrigger, { asChild: !0, children: createElement(get(
|
|
9543
|
+
/* @__PURE__ */ jsx("div", { className: "flex flex-col", children: m == null ? void 0 : m.map((w, E) => /* @__PURE__ */ jsxs(Tooltip, { children: [
|
|
9544
|
+
/* @__PURE__ */ jsx(TooltipTrigger, { asChild: !0, children: createElement(get(w, "button", NoopComponent), {
|
|
9553
9545
|
position: "bottom",
|
|
9554
|
-
panelId:
|
|
9555
|
-
isActive: n ===
|
|
9556
|
-
show: () => k(
|
|
9546
|
+
panelId: w.id,
|
|
9547
|
+
isActive: n === w.id,
|
|
9548
|
+
show: () => k(w.id)
|
|
9557
9549
|
}) }),
|
|
9558
|
-
/* @__PURE__ */ jsx(TooltipContent, { side: "right", children: /* @__PURE__ */ jsx("p", { children: x(
|
|
9550
|
+
/* @__PURE__ */ jsx(TooltipContent, { side: "right", children: /* @__PURE__ */ jsx("p", { children: x(w.label) }) })
|
|
9559
9551
|
] }, "button-bottom-" + E)) })
|
|
9560
9552
|
] }),
|
|
9561
9553
|
/* @__PURE__ */ jsx(
|
|
@@ -9632,7 +9624,7 @@ const RootLayout = () => {
|
|
|
9632
9624
|
/* @__PURE__ */ jsx("span", { children: x(get(C, "label", "")) })
|
|
9633
9625
|
] }) }),
|
|
9634
9626
|
/* @__PURE__ */ jsx("div", { className: "h-full max-h-full overflow-y-auto p-4", children: /* @__PURE__ */ jsx(Suspense, { fallback: /* @__PURE__ */ jsx("div", { children: "Loading..." }), children: React__default.createElement(get(C, "panel", NoopComponent), {
|
|
9635
|
-
close:
|
|
9627
|
+
close: A
|
|
9636
9628
|
}) }) })
|
|
9637
9629
|
]
|
|
9638
9630
|
}
|
|
@@ -9644,7 +9636,7 @@ const RootLayout = () => {
|
|
|
9644
9636
|
/* @__PURE__ */ jsx("span", { children: x(get(C, "label", "")) })
|
|
9645
9637
|
] }) }),
|
|
9646
9638
|
/* @__PURE__ */ jsx("div", { className: "max-h-[70vh] overflow-y-auto p-4", children: /* @__PURE__ */ jsx(Suspense, { fallback: /* @__PURE__ */ jsx("div", { children: "Loading..." }), children: React__default.createElement(get(C, "panel", NoopComponent), {
|
|
9647
|
-
close:
|
|
9639
|
+
close: A
|
|
9648
9640
|
}) }) })
|
|
9649
9641
|
] }) }),
|
|
9650
9642
|
n !== null && get(C, "view") === "overlay" && /* @__PURE__ */ jsx(
|
|
@@ -9672,7 +9664,7 @@ const RootLayout = () => {
|
|
|
9672
9664
|
/* @__PURE__ */ jsx(Button, { onClick: () => _(), variant: "ghost", size: "icon", className: "", children: /* @__PURE__ */ jsx(Cross1Icon, { className: "h-5 w-5" }) })
|
|
9673
9665
|
] }),
|
|
9674
9666
|
/* @__PURE__ */ jsx("div", { className: "flex-1 overflow-y-auto p-4", children: /* @__PURE__ */ jsx(Suspense, { fallback: /* @__PURE__ */ jsx("div", { children: "Loading..." }), children: React__default.createElement(get(C, "panel", NoopComponent), {
|
|
9675
|
-
close:
|
|
9667
|
+
close: A
|
|
9676
9668
|
}) }) })
|
|
9677
9669
|
]
|
|
9678
9670
|
}
|
|
@@ -9725,8 +9717,8 @@ const RootLayout = () => {
|
|
|
9725
9717
|
});
|
|
9726
9718
|
}, h = (x) => {
|
|
9727
9719
|
if (!c) return;
|
|
9728
|
-
const y = x.clientX - p.x, b = x.clientY - p.y, C = x.currentTarget, B = C.offsetWidth, j = C.offsetHeight, _ = window.innerWidth - B,
|
|
9729
|
-
r(k,
|
|
9720
|
+
const y = x.clientX - p.x, b = x.clientY - p.y, C = x.currentTarget, B = C.offsetWidth, j = C.offsetHeight, _ = window.innerWidth - B, A = window.innerHeight - j, k = Math.max(0, Math.min(y, _)), w = Math.max(0, Math.min(b, A));
|
|
9721
|
+
r(k, w);
|
|
9730
9722
|
}, f = () => {
|
|
9731
9723
|
d(!1);
|
|
9732
9724
|
};
|
|
@@ -9968,10 +9960,10 @@ const atomRead = (o, n, ...r) => n.read(...r), atomWrite = (o, n, ...r) => n.wri
|
|
|
9968
9960
|
var r;
|
|
9969
9961
|
const a = getBuildingBlocks(o), l = a[1], i = a[2], c = a[3], d = a[6], p = a[7], u = a[11], g = a[12], m = a[13], h = a[14], f = a[16], x = a[17], y = u(o, n);
|
|
9970
9962
|
if (isAtomStateInitialized(y) && (l.has(n) && i.get(n) !== y.n || Array.from(y.d).every(
|
|
9971
|
-
([
|
|
9963
|
+
([w, E]) => (
|
|
9972
9964
|
// Recursively, read the atom state of the dependency, and
|
|
9973
9965
|
// check if the atom epoch number is unchanged
|
|
9974
|
-
h(o,
|
|
9966
|
+
h(o, w).n === E
|
|
9975
9967
|
)
|
|
9976
9968
|
)))
|
|
9977
9969
|
return y;
|
|
@@ -9980,34 +9972,34 @@ const atomRead = (o, n, ...r) => n.read(...r), atomWrite = (o, n, ...r) => n.wri
|
|
|
9980
9972
|
function C() {
|
|
9981
9973
|
l.has(n) && (x(o, n), m(o), g(o));
|
|
9982
9974
|
}
|
|
9983
|
-
function B(
|
|
9975
|
+
function B(w) {
|
|
9984
9976
|
var E;
|
|
9985
|
-
if (isSelfAtom(n,
|
|
9986
|
-
const v = u(o,
|
|
9977
|
+
if (isSelfAtom(n, w)) {
|
|
9978
|
+
const v = u(o, w);
|
|
9987
9979
|
if (!isAtomStateInitialized(v))
|
|
9988
|
-
if (hasInitialValue(
|
|
9989
|
-
setAtomStateValueOrPromise(o,
|
|
9980
|
+
if (hasInitialValue(w))
|
|
9981
|
+
setAtomStateValueOrPromise(o, w, w.init);
|
|
9990
9982
|
else
|
|
9991
9983
|
throw new Error("no atom init");
|
|
9992
9984
|
return returnAtomValue(v);
|
|
9993
9985
|
}
|
|
9994
|
-
const S = h(o,
|
|
9986
|
+
const S = h(o, w);
|
|
9995
9987
|
try {
|
|
9996
9988
|
return returnAtomValue(S);
|
|
9997
9989
|
} finally {
|
|
9998
|
-
y.d.set(
|
|
9990
|
+
y.d.set(w, S.n), isPendingPromise(y.v) && addPendingPromiseToDependency(n, y.v, S), (E = l.get(w)) == null || E.t.add(n), b || C();
|
|
9999
9991
|
}
|
|
10000
9992
|
}
|
|
10001
9993
|
let j, _;
|
|
10002
|
-
const
|
|
9994
|
+
const A = {
|
|
10003
9995
|
get signal() {
|
|
10004
9996
|
return j || (j = new AbortController()), j.signal;
|
|
10005
9997
|
},
|
|
10006
9998
|
get setSelf() {
|
|
10007
|
-
return !_ && isActuallyWritableAtom(n) && (_ = (...
|
|
9999
|
+
return !_ && isActuallyWritableAtom(n) && (_ = (...w) => {
|
|
10008
10000
|
if (!b)
|
|
10009
10001
|
try {
|
|
10010
|
-
return f(o, n, ...
|
|
10002
|
+
return f(o, n, ...w);
|
|
10011
10003
|
} finally {
|
|
10012
10004
|
m(o), g(o);
|
|
10013
10005
|
}
|
|
@@ -10015,10 +10007,10 @@ const atomRead = (o, n, ...r) => n.read(...r), atomWrite = (o, n, ...r) => n.wri
|
|
|
10015
10007
|
}
|
|
10016
10008
|
}, k = y.n;
|
|
10017
10009
|
try {
|
|
10018
|
-
const
|
|
10019
|
-
return setAtomStateValueOrPromise(o, n,
|
|
10020
|
-
} catch (
|
|
10021
|
-
return delete y.v, y.e =
|
|
10010
|
+
const w = p(o, n, B, A);
|
|
10011
|
+
return setAtomStateValueOrPromise(o, n, w), isPromiseLike$1(w) && (registerAbortHandler(w, () => j == null ? void 0 : j.abort()), w.then(C, C)), y;
|
|
10012
|
+
} catch (w) {
|
|
10013
|
+
return delete y.v, y.e = w, ++y.n, y;
|
|
10022
10014
|
} finally {
|
|
10023
10015
|
b = !1, k !== y.n && i.get(n) === k && (i.set(n, y.n), c.add(n), (r = d.c) == null || r.call(d, n));
|
|
10024
10016
|
}
|
|
@@ -10041,8 +10033,8 @@ const atomRead = (o, n, ...r) => n.read(...r), atomWrite = (o, n, ...r) => n.wri
|
|
|
10041
10033
|
if (isSelfAtom(n, b)) {
|
|
10042
10034
|
if (!hasInitialValue(b))
|
|
10043
10035
|
throw new Error("atom not writable");
|
|
10044
|
-
const _ = j.n,
|
|
10045
|
-
setAtomStateValueOrPromise(o, b,
|
|
10036
|
+
const _ = j.n, A = C[0];
|
|
10037
|
+
setAtomStateValueOrPromise(o, b, A), h(o, b), _ !== j.n && (l.add(b), (B = i.c) == null || B.call(i, b), m(o, b));
|
|
10046
10038
|
return;
|
|
10047
10039
|
} else
|
|
10048
10040
|
return writeAtomState(o, b, ...C);
|
|
@@ -10304,12 +10296,12 @@ function useAtom(o, n) {
|
|
|
10304
10296
|
];
|
|
10305
10297
|
}
|
|
10306
10298
|
const useAutoSave = () => {
|
|
10307
|
-
const { savePage: o } = useSavePage(),
|
|
10299
|
+
const { savePage: o, saveState: n } = useSavePage(), r = useBuilderProp("autoSave", !0), a = useBuilderProp("autoSaveInterval", 60);
|
|
10308
10300
|
useIntervalEffect(
|
|
10309
10301
|
() => {
|
|
10310
|
-
|
|
10302
|
+
r && (n === "SAVED" || n === "SAVING" || o(!0));
|
|
10311
10303
|
},
|
|
10312
|
-
|
|
10304
|
+
r ? a * 1e3 : void 0
|
|
10313
10305
|
);
|
|
10314
10306
|
}, ChaiWatchers = (o) => {
|
|
10315
10307
|
const [, n] = useBlocksStore(), r = useBuilderReset(), [a] = useAtom(builderSaveStateAtom);
|
|
@@ -10414,7 +10406,6 @@ export {
|
|
|
10414
10406
|
useCutBlockIds,
|
|
10415
10407
|
useDarkMode,
|
|
10416
10408
|
useDuplicateBlocks,
|
|
10417
|
-
useHiddenBlockIds,
|
|
10418
10409
|
useHighlightBlockId,
|
|
10419
10410
|
useInlineEditing,
|
|
10420
10411
|
useIsPageLoaded,
|
|
@@ -10447,7 +10438,7 @@ export {
|
|
|
10447
10438
|
useTheme,
|
|
10448
10439
|
useThemeOptions,
|
|
10449
10440
|
useToggleChaiFeatureFlag,
|
|
10450
|
-
|
|
10441
|
+
$e as useTranslation,
|
|
10451
10442
|
useUndoManager,
|
|
10452
10443
|
useUpdateBlocksProps,
|
|
10453
10444
|
useUpdateBlocksPropsRealtime,
|