@chaibuilder/sdk 3.2.1 → 3.2.3
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/{apply-binding-CSWwWMjY.js → apply-binding-B11pPFEE.js} +15 -17
- package/dist/apply-binding-DOJpwjiG.cjs +1 -0
- package/dist/{code-editor-DKqeEOn5.cjs → code-editor-CUimilR9.cjs} +1 -1
- package/dist/{code-editor-BNuPxnsb.js → code-editor-aEl9qnMt.js} +1 -1
- package/dist/core.cjs +1 -1
- package/dist/core.d.ts +4 -0
- package/dist/core.js +2 -2
- package/dist/{index-CXFBOH6M.js → index-Cb4I9wM_.js} +97 -94
- package/dist/index-ClDik0i4.cjs +154 -0
- package/dist/render.cjs +1 -1
- package/dist/render.js +2 -2
- package/dist/{rte-widget-modal-DuUAGYPy.js → rte-widget-modal-BC3QU74X.js} +1 -1
- package/dist/{rte-widget-modal-BTpBxi3g.cjs → rte-widget-modal-Cr2Sx0uo.cjs} +1 -1
- package/dist/web-blocks.cjs +1 -1
- package/dist/web-blocks.js +1 -1
- package/package.json +1 -1
- package/dist/apply-binding-DLHh7HoS.cjs +0 -1
- package/dist/index-CjZEAWCM.cjs +0 -154
|
@@ -13,7 +13,7 @@ import { twMerge } from "tailwind-merge";
|
|
|
13
13
|
import TreeModel from "tree-model";
|
|
14
14
|
import * as React from "react";
|
|
15
15
|
import React__default, { useEffect, useCallback, useState, useMemo, useRef, Component, Children, memo, createElement, createContext, useContext, Suspense, lazy, useReducer, useDebugValue } from "react";
|
|
16
|
-
import { C as COLLECTION_PREFIX, S as STYLES_KEY, j as getSplitChaiClasses, h as getBlocksFromHTML, m as mergeBlocksWithExisting, e as adjustSpacingInContentBlocks, a as applyBindingToBlockProps, b as applyLanguage, g as getBlockTagAttributes, c as getBlockRuntimeProps, d as applyLimit, R as REPEATER_PREFIX, D as DESIGN_TOKEN_PREFIX, k as ROOT_TEMP_KEY } from "./apply-binding-
|
|
16
|
+
import { C as COLLECTION_PREFIX, S as STYLES_KEY, j as getSplitChaiClasses, h as getBlocksFromHTML, m as mergeBlocksWithExisting, e as adjustSpacingInContentBlocks, a as applyBindingToBlockProps, b as applyLanguage, g as getBlockTagAttributes, c as getBlockRuntimeProps, d as applyLimit, R as REPEATER_PREFIX, D as DESIGN_TOKEN_PREFIX, k as ROOT_TEMP_KEY } from "./apply-binding-B11pPFEE.js";
|
|
17
17
|
import { d as defaultThemeOptions, f as defaultThemeValues, a as getChaiThemeCssVariables, g as getChaiThemeOptions, p as plugin, h as getThemeFontsUrls, i as getThemeCustomFontFace } from "./plugin-BOcGV_IY.js";
|
|
18
18
|
import { isObject } from "@rjsf/utils";
|
|
19
19
|
import { toast, Toaster } from "sonner";
|
|
@@ -3538,14 +3538,14 @@ function detectDropZone(o, n, r, a, i) {
|
|
|
3538
3538
|
if (l === "canvas" && hasChildBlocks(o)) {
|
|
3539
3539
|
const w = getChildBlocks(o), j = w[w.length - 1];
|
|
3540
3540
|
if (j) {
|
|
3541
|
-
const v = j.getBoundingClientRect(), _ = o.getBoundingClientRect(), N = window.getComputedStyle(o), I = parseFloat(N.paddingLeft) || 0,
|
|
3541
|
+
const v = j.getBoundingClientRect(), _ = o.getBoundingClientRect(), N = window.getComputedStyle(o), I = parseFloat(N.paddingLeft) || 0, P = parseFloat(N.paddingRight) || 0, D = _.width - I - P, R = _.left + x + I;
|
|
3542
3542
|
return {
|
|
3543
3543
|
position: "after",
|
|
3544
3544
|
placeholderOrientation: "horizontal",
|
|
3545
3545
|
rect: {
|
|
3546
3546
|
top: v.bottom + h,
|
|
3547
3547
|
left: R,
|
|
3548
|
-
width:
|
|
3548
|
+
width: D,
|
|
3549
3549
|
height: 4
|
|
3550
3550
|
},
|
|
3551
3551
|
targetElement: j,
|
|
@@ -3559,13 +3559,13 @@ function detectDropZone(o, n, r, a, i) {
|
|
|
3559
3559
|
if (f && !m && hasChildBlocks(o)) {
|
|
3560
3560
|
const w = detectGapZone(o, n, r, g);
|
|
3561
3561
|
if (w) {
|
|
3562
|
-
const j = w.before.getBoundingClientRect(), v = w.after.getBoundingClientRect(), _ = o.getBoundingClientRect(), N = window.getComputedStyle(o), I = parseFloat(N.paddingLeft) || 0,
|
|
3562
|
+
const j = w.before.getBoundingClientRect(), v = w.after.getBoundingClientRect(), _ = o.getBoundingClientRect(), N = window.getComputedStyle(o), I = parseFloat(N.paddingLeft) || 0, P = parseFloat(N.paddingRight) || 0, D = getChildBlocks(o), R = getSiblingsInSameRow(D, w.before, g);
|
|
3563
3563
|
let $ = 0;
|
|
3564
3564
|
if (R.forEach((F) => {
|
|
3565
3565
|
const O = F.getBoundingClientRect();
|
|
3566
3566
|
O.height > $ && ($ = O.height);
|
|
3567
3567
|
}), g === "vertical") {
|
|
3568
|
-
const F = _.width - I -
|
|
3568
|
+
const F = _.width - I - P, O = _.left + x + I;
|
|
3569
3569
|
return {
|
|
3570
3570
|
position: "after",
|
|
3571
3571
|
placeholderOrientation: "horizontal",
|
|
@@ -3605,7 +3605,7 @@ function detectDropZone(o, n, r, a, i) {
|
|
|
3605
3605
|
if (d && p) {
|
|
3606
3606
|
const w = detectParentEdgeProximity(d, n, r, u);
|
|
3607
3607
|
if (w) {
|
|
3608
|
-
const j = d.getBoundingClientRect(), v = window.getComputedStyle(d), _ = parseFloat(v.paddingLeft) || 0, N = parseFloat(v.paddingRight) || 0, I = parseFloat(v.paddingTop) || 0,
|
|
3608
|
+
const j = d.getBoundingClientRect(), v = window.getComputedStyle(d), _ = parseFloat(v.paddingLeft) || 0, N = parseFloat(v.paddingRight) || 0, I = parseFloat(v.paddingTop) || 0, P = parseFloat(v.paddingBottom) || 0, D = ((B = i.defaultView) == null ? void 0 : B.scrollY) || 0, R = ((E = i.defaultView) == null ? void 0 : E.scrollX) || 0, $ = u === "vertical" ? "horizontal" : "vertical", F = getMaxSiblingDimensions(d);
|
|
3609
3609
|
if (w === "start") {
|
|
3610
3610
|
const O = getChildBlocks(d)[0];
|
|
3611
3611
|
if (O) {
|
|
@@ -3616,7 +3616,7 @@ function detectDropZone(o, n, r, a, i) {
|
|
|
3616
3616
|
position: "before",
|
|
3617
3617
|
placeholderOrientation: $,
|
|
3618
3618
|
rect: {
|
|
3619
|
-
top: L.top +
|
|
3619
|
+
top: L.top + D - 2,
|
|
3620
3620
|
left: M,
|
|
3621
3621
|
width: T,
|
|
3622
3622
|
height: 4
|
|
@@ -3627,7 +3627,7 @@ function detectDropZone(o, n, r, a, i) {
|
|
|
3627
3627
|
confidence: 0.9
|
|
3628
3628
|
};
|
|
3629
3629
|
} else {
|
|
3630
|
-
const T = j.top +
|
|
3630
|
+
const T = j.top + D + I, M = F.maxHeight > 0 ? F.maxHeight : j.height - I - P;
|
|
3631
3631
|
return {
|
|
3632
3632
|
position: "before",
|
|
3633
3633
|
placeholderOrientation: $,
|
|
@@ -3654,7 +3654,7 @@ function detectDropZone(o, n, r, a, i) {
|
|
|
3654
3654
|
position: "after",
|
|
3655
3655
|
placeholderOrientation: $,
|
|
3656
3656
|
rect: {
|
|
3657
|
-
top: T.bottom +
|
|
3657
|
+
top: T.bottom + D - 2,
|
|
3658
3658
|
left: H,
|
|
3659
3659
|
width: M,
|
|
3660
3660
|
height: 4
|
|
@@ -3665,7 +3665,7 @@ function detectDropZone(o, n, r, a, i) {
|
|
|
3665
3665
|
confidence: 0.9
|
|
3666
3666
|
};
|
|
3667
3667
|
} else {
|
|
3668
|
-
const M = j.top +
|
|
3668
|
+
const M = j.top + D + I, H = F.maxHeight > 0 ? F.maxHeight : j.height - I - P;
|
|
3669
3669
|
return {
|
|
3670
3670
|
position: "after",
|
|
3671
3671
|
placeholderOrientation: $,
|
|
@@ -3759,25 +3759,25 @@ function getSiblingsInSameRow(o, n, r) {
|
|
|
3759
3759
|
});
|
|
3760
3760
|
}
|
|
3761
3761
|
function calculatePlaceholderRect(o, n, r, a, i) {
|
|
3762
|
-
var I,
|
|
3763
|
-
const l = o.getBoundingClientRect(), c = window.getComputedStyle(o), d = ((I = i.defaultView) == null ? void 0 : I.scrollY) || 0, p = ((
|
|
3762
|
+
var I, P;
|
|
3763
|
+
const l = o.getBoundingClientRect(), c = window.getComputedStyle(o), d = ((I = i.defaultView) == null ? void 0 : I.scrollY) || 0, p = ((P = i.defaultView) == null ? void 0 : P.scrollX) || 0, u = parseFloat(c.marginTop) || 0, g = parseFloat(c.marginBottom) || 0, m = parseFloat(c.marginLeft) || 0, f = parseFloat(c.marginRight) || 0, h = parseFloat(c.paddingTop) || 0, x = parseFloat(c.paddingBottom) || 0, b = parseFloat(c.paddingLeft) || 0, y = parseFloat(c.paddingRight) || 0, C = n == null ? void 0 : n.getBoundingClientRect(), k = n && parseFloat(window.getComputedStyle(n).paddingLeft) || 0, S = n && parseFloat(window.getComputedStyle(n).paddingRight) || 0, A = n && parseFloat(window.getComputedStyle(n).paddingTop) || 0, B = n && parseFloat(window.getComputedStyle(n).paddingBottom) || 0, E = n ? getMaxSiblingDimensions(n) : { maxWidth: 0, maxHeight: 0 }, w = n ? getOrientation(n) : "vertical", j = n ? getChildBlocks(n) : [], v = getSiblingsInSameRow(j, o, w);
|
|
3764
3764
|
let _ = 0, N = 0;
|
|
3765
|
-
if (v.forEach((
|
|
3766
|
-
const R =
|
|
3765
|
+
if (v.forEach((D) => {
|
|
3766
|
+
const R = D.getBoundingClientRect();
|
|
3767
3767
|
R.height > _ && (_ = R.height), R.width > N && (N = R.width);
|
|
3768
3768
|
}), r === "before")
|
|
3769
3769
|
if (a === "horizontal") {
|
|
3770
|
-
const
|
|
3770
|
+
const D = C ? C.width - k - S : l.width, R = C ? C.left + p + k : l.left + p;
|
|
3771
3771
|
return {
|
|
3772
3772
|
top: l.top + d - u - 2,
|
|
3773
3773
|
left: R,
|
|
3774
|
-
width:
|
|
3774
|
+
width: D,
|
|
3775
3775
|
height: 4
|
|
3776
3776
|
};
|
|
3777
3777
|
} else {
|
|
3778
|
-
const
|
|
3778
|
+
const D = l.top + d, R = w === "horizontal" && _ > 0 ? _ : E.maxHeight > 0 ? E.maxHeight : C ? C.height - A - B : l.height;
|
|
3779
3779
|
return {
|
|
3780
|
-
top:
|
|
3780
|
+
top: D,
|
|
3781
3781
|
left: l.left + p - m - 2,
|
|
3782
3782
|
width: 4,
|
|
3783
3783
|
height: R
|
|
@@ -3785,17 +3785,17 @@ function calculatePlaceholderRect(o, n, r, a, i) {
|
|
|
3785
3785
|
}
|
|
3786
3786
|
else if (r === "after")
|
|
3787
3787
|
if (a === "horizontal") {
|
|
3788
|
-
const
|
|
3788
|
+
const D = C ? C.width - k - S : l.width, R = C ? C.left + p + k : l.left + p;
|
|
3789
3789
|
return {
|
|
3790
3790
|
top: l.bottom + d + g - 2,
|
|
3791
3791
|
left: R,
|
|
3792
|
-
width:
|
|
3792
|
+
width: D,
|
|
3793
3793
|
height: 4
|
|
3794
3794
|
};
|
|
3795
3795
|
} else {
|
|
3796
|
-
const
|
|
3796
|
+
const D = l.top + d, R = w === "horizontal" && _ > 0 ? _ : E.maxHeight > 0 ? E.maxHeight : C ? C.height - A - B : l.height;
|
|
3797
3797
|
return {
|
|
3798
|
-
top:
|
|
3798
|
+
top: D,
|
|
3799
3799
|
left: l.right + p + f - 2,
|
|
3800
3800
|
width: 4,
|
|
3801
3801
|
height: R
|
|
@@ -3886,8 +3886,8 @@ const LEAF_BLOCK_TYPES = [
|
|
|
3886
3886
|
}
|
|
3887
3887
|
const j = S === "up" ? -E : E;
|
|
3888
3888
|
f.scrollBy(0, j);
|
|
3889
|
-
const v = f.scrollY, _ = v > 0, N = v + h < b, I = p.current,
|
|
3890
|
-
S === "up" && _ && I < AUTO_SCROLL_CONFIG.EDGE_ZONE || S === "down" && N &&
|
|
3889
|
+
const v = f.scrollY, _ = v > 0, N = v + h < b, I = p.current, P = h - p.current;
|
|
3890
|
+
S === "up" && _ && I < AUTO_SCROLL_CONFIG.EDGE_ZONE || S === "down" && N && P < AUTO_SCROLL_CONFIG.EDGE_ZONE ? d.current = requestAnimationFrame(w) : d.current = null;
|
|
3891
3891
|
};
|
|
3892
3892
|
d.current === null && (d.current = requestAnimationFrame(w));
|
|
3893
3893
|
}
|
|
@@ -5628,19 +5628,19 @@ const RichTextEditor = memo(
|
|
|
5628
5628
|
() => u(l._id, getBlockRuntimeProps(l._type)),
|
|
5629
5629
|
[l._id, l._type, u, getBlockRuntimeProps]
|
|
5630
5630
|
), w = useMemo(() => {
|
|
5631
|
-
const
|
|
5631
|
+
const P = {
|
|
5632
5632
|
"data-block-id": l._id,
|
|
5633
5633
|
"data-block-type": l._type,
|
|
5634
5634
|
"data-block-index": h
|
|
5635
5635
|
};
|
|
5636
5636
|
return k && C ? {
|
|
5637
|
-
...
|
|
5638
|
-
draggable: !
|
|
5637
|
+
...P,
|
|
5638
|
+
draggable: !a,
|
|
5639
5639
|
onMouseDown: S.onMouseDown,
|
|
5640
5640
|
onDragStart: S.onDragStart,
|
|
5641
5641
|
onDragEnd: S.onDragEnd
|
|
5642
|
-
} :
|
|
5643
|
-
}, [l._id, l._type, h, k, C, S]), j = useMemo(
|
|
5642
|
+
} : P;
|
|
5643
|
+
}, [l._id, l._type, h, k, C, S, a]), j = useMemo(
|
|
5644
5644
|
() => ({
|
|
5645
5645
|
blockProps: w,
|
|
5646
5646
|
inBuilder: b === "edit",
|
|
@@ -5837,7 +5837,7 @@ const RichTextEditor = memo(
|
|
|
5837
5837
|
/* @__PURE__ */ jsx("p", { className: "font-semibold", children: o("Oops! Something went wrong.") }),
|
|
5838
5838
|
/* @__PURE__ */ jsx("p", { children: o("Please try again.") })
|
|
5839
5839
|
] }) });
|
|
5840
|
-
}, CodeEditor$1 = React__default.lazy(() => import("./code-editor-
|
|
5840
|
+
}, CodeEditor$1 = React__default.lazy(() => import("./code-editor-aEl9qnMt.js")), CanvasArea = () => {
|
|
5841
5841
|
const [o] = useCodeEditor(), n = useBuilderProp("onError", noop);
|
|
5842
5842
|
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: [
|
|
5843
5843
|
/* @__PURE__ */ jsx(Suspense, { fallback: /* @__PURE__ */ jsx(Skeleton, { className: "h-full" }), children: /* @__PURE__ */ jsx(ErrorBoundary, { fallback: /* @__PURE__ */ jsx(FallbackError, {}), onError: n, children: /* @__PURE__ */ jsx(StaticCanvas, {}) }) }),
|
|
@@ -6406,7 +6406,7 @@ const DataBindingSelector = ({
|
|
|
6406
6406
|
]
|
|
6407
6407
|
}
|
|
6408
6408
|
) });
|
|
6409
|
-
}, RTEModal = React__default.lazy(() => import("./rte-widget-modal-
|
|
6409
|
+
}, RTEModal = React__default.lazy(() => import("./rte-widget-modal-BC3QU74X.js")), RichTextEditorFieldComp = ({ blockId: o, id: n, placeholder: r, value: a, onChange: i, onBlur: l }) => {
|
|
6410
6410
|
const c = useRef(null), [d, p] = useState(!1), u = useRTEditor({
|
|
6411
6411
|
blockId: o,
|
|
6412
6412
|
value: a,
|
|
@@ -7160,8 +7160,8 @@ const BlockStylingProps = () => {
|
|
|
7160
7160
|
}
|
|
7161
7161
|
if (get(_, "value") === "")
|
|
7162
7162
|
return;
|
|
7163
|
-
const
|
|
7164
|
-
v ? E(
|
|
7163
|
+
const P = `${get(_, "value", "").startsWith("-") ? "-" : ""}${d}[${get(_, "value", "").replace("-", "")}${N === "-" ? "" : N}]`;
|
|
7164
|
+
v ? E(P) : B(P);
|
|
7165
7165
|
},
|
|
7166
7166
|
[B, E, a, m, d, u]
|
|
7167
7167
|
), j = useCallback(
|
|
@@ -7177,8 +7177,8 @@ const BlockStylingProps = () => {
|
|
|
7177
7177
|
}
|
|
7178
7178
|
if (get(_, "value") === "")
|
|
7179
7179
|
return;
|
|
7180
|
-
const N = get(_, "unit") !== "" ? get(_, "unit") : v,
|
|
7181
|
-
B(
|
|
7180
|
+
const N = get(_, "unit") !== "" ? get(_, "unit") : v, P = `${get(_, "value", "").startsWith("-") ? "-" : ""}${d}[${get(_, "value", "").replace("-", "")}${N === "-" ? "" : N}]`;
|
|
7181
|
+
B(P);
|
|
7182
7182
|
},
|
|
7183
7183
|
[B, a, d, u]
|
|
7184
7184
|
);
|
|
@@ -7211,8 +7211,8 @@ const BlockStylingProps = () => {
|
|
|
7211
7211
|
const _ = parseInt$1(v.target.value);
|
|
7212
7212
|
let N = isNaN$1(_) ? 0 : _;
|
|
7213
7213
|
v.keyCode === 38 && (N += 1), v.keyCode === 40 && (N -= 1);
|
|
7214
|
-
const I = `${N}`,
|
|
7215
|
-
E(
|
|
7214
|
+
const I = `${N}`, D = `${I.startsWith("-") ? "-" : ""}${d}[${I.replace("-", "")}${m === "-" ? "" : m}]`;
|
|
7215
|
+
E(D);
|
|
7216
7216
|
},
|
|
7217
7217
|
onKeyUp: (v) => {
|
|
7218
7218
|
S && (v.preventDefault(), A(!1));
|
|
@@ -8117,7 +8117,7 @@ function ManualClasses() {
|
|
|
8117
8117
|
return v(z);
|
|
8118
8118
|
}, I = () => {
|
|
8119
8119
|
v([]);
|
|
8120
|
-
},
|
|
8120
|
+
}, P = (L) => L.name, D = (L) => /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 rounded-md p-1", children: [
|
|
8121
8121
|
L.isDesignToken && /* @__PURE__ */ jsx(DesignTokensIcon, { className: "h-4 w-4 text-gray-600" }),
|
|
8122
8122
|
/* @__PURE__ */ jsx("span", { children: L.name })
|
|
8123
8123
|
] }), R = useMemo(
|
|
@@ -8169,8 +8169,8 @@ function ManualClasses() {
|
|
|
8169
8169
|
suggestions: j,
|
|
8170
8170
|
onSuggestionsFetchRequested: N,
|
|
8171
8171
|
onSuggestionsClearRequested: I,
|
|
8172
|
-
getSuggestionValue:
|
|
8173
|
-
renderSuggestion:
|
|
8172
|
+
getSuggestionValue: P,
|
|
8173
|
+
renderSuggestion: D,
|
|
8174
8174
|
inputProps: R,
|
|
8175
8175
|
highlightFirstSuggestion: !0,
|
|
8176
8176
|
onSuggestionSelected: (L, { suggestionValue: T }) => {
|
|
@@ -8587,7 +8587,7 @@ const registerChaiLibrary = (o, n) => {
|
|
|
8587
8587
|
blocks: [
|
|
8588
8588
|
{
|
|
8589
8589
|
_type: "Image",
|
|
8590
|
-
styles: "#styles:,w-full",
|
|
8590
|
+
styles: "#styles:,w-full h-full object-cover",
|
|
8591
8591
|
image: o == null ? void 0 : o.image,
|
|
8592
8592
|
alt: (o == null ? void 0 : o.alt) || "",
|
|
8593
8593
|
_name: (o == null ? void 0 : o.name) || "Image"
|
|
@@ -8942,8 +8942,8 @@ const BlockCard = ({
|
|
|
8942
8942
|
const { t: c } = useTranslation(), [d] = useBlocksStore(), [p, u] = useState(""), g = useRef(null), [m] = useAtom$1(addBlockTabAtom), f = (N = find(d, (I) => I._id === r)) == null ? void 0 : N._type, [h, x] = useState("all"), [b, y] = useState(null), C = useRef(null), k = useBuilderProp("flags.dragAndDrop", !1);
|
|
8943
8943
|
useEffect(() => {
|
|
8944
8944
|
const I = setTimeout(() => {
|
|
8945
|
-
var
|
|
8946
|
-
(
|
|
8945
|
+
var P;
|
|
8946
|
+
(P = g.current) == null || P.focus();
|
|
8947
8947
|
}, 0);
|
|
8948
8948
|
return () => clearTimeout(I);
|
|
8949
8949
|
}, [m]), useEffect(() => {
|
|
@@ -8962,8 +8962,8 @@ const BlockCard = ({
|
|
|
8962
8962
|
}, []), E = useMemo(
|
|
8963
8963
|
() => p ? values(n).filter(
|
|
8964
8964
|
(I) => {
|
|
8965
|
-
var
|
|
8966
|
-
return (((
|
|
8965
|
+
var P, D;
|
|
8966
|
+
return (((P = I.label) == null ? void 0 : P.toLowerCase()) + " " + ((D = I.type) == null ? void 0 : D.toLowerCase())).includes(p.toLowerCase());
|
|
8967
8967
|
}
|
|
8968
8968
|
) : n,
|
|
8969
8969
|
[n, p]
|
|
@@ -9012,12 +9012,12 @@ const BlockCard = ({
|
|
|
9012
9012
|
' "',
|
|
9013
9013
|
p,
|
|
9014
9014
|
'"'
|
|
9015
|
-
] }) }) : /* @__PURE__ */ jsx("div", { className: `${l ? "p-0" : "p-4"} space-y-6`, children: _.map((I) => /* @__PURE__ */ jsxs("div", { className: "space-y-3", children: [
|
|
9015
|
+
] }) }) : /* @__PURE__ */ jsx("div", { className: `${l ? "p-0" : "p-4"} space-y-6`, children: _.map((I, P) => /* @__PURE__ */ jsxs("div", { className: "space-y-3", children: [
|
|
9016
9016
|
/* @__PURE__ */ jsx("h3", { className: "px-1 text-sm font-medium", children: capitalize(c(I.toLowerCase())) }),
|
|
9017
9017
|
/* @__PURE__ */ jsx("div", { className: "grid gap-2 " + i, children: reject(
|
|
9018
9018
|
h === "all" ? filter(values(v), { group: I }) : values(v),
|
|
9019
9019
|
{ hidden: !0 }
|
|
9020
|
-
).map((D) => /* @__PURE__ */ jsx(
|
|
9020
|
+
).map((D, R) => /* @__PURE__ */ jsx(
|
|
9021
9021
|
CoreBlock,
|
|
9022
9022
|
{
|
|
9023
9023
|
parentId: r,
|
|
@@ -9025,7 +9025,7 @@ const BlockCard = ({
|
|
|
9025
9025
|
block: D,
|
|
9026
9026
|
disabled: !k && (!canAcceptChildBlock(f, D.type) || !canBeNestedInside(f, D.type))
|
|
9027
9027
|
},
|
|
9028
|
-
D.type
|
|
9028
|
+
D.type + "-" + P + "-" + R
|
|
9029
9029
|
)) })
|
|
9030
9030
|
] }, I)) }) })
|
|
9031
9031
|
}
|
|
@@ -9513,7 +9513,7 @@ const useStructureValidation = () => {
|
|
|
9513
9513
|
I(), o.parent.isSelected || _((T = o == null ? void 0 : o.parent) == null ? void 0 : T.id);
|
|
9514
9514
|
}, I = () => {
|
|
9515
9515
|
_(null);
|
|
9516
|
-
},
|
|
9516
|
+
}, P = (T) => {
|
|
9517
9517
|
I(), T.stopPropagation(), !o.isOpen && B && o.toggle(), k(T);
|
|
9518
9518
|
};
|
|
9519
9519
|
useEffect(() => {
|
|
@@ -9522,7 +9522,7 @@ const useStructureValidation = () => {
|
|
|
9522
9522
|
}, 500);
|
|
9523
9523
|
return () => clearTimeout(T);
|
|
9524
9524
|
}, [b, o, y]);
|
|
9525
|
-
const
|
|
9525
|
+
const D = (T, M) => {
|
|
9526
9526
|
const H = l.contentDocument || l.contentWindow.document, W = H.querySelector(`[data-block-id=${T}]`);
|
|
9527
9527
|
W && W.setAttribute("data-drop", M);
|
|
9528
9528
|
const z = W.getBoundingClientRect(), V = l.getBoundingClientRect();
|
|
@@ -9556,20 +9556,20 @@ const useStructureValidation = () => {
|
|
|
9556
9556
|
{
|
|
9557
9557
|
onMouseEnter: () => u(f),
|
|
9558
9558
|
onMouseLeave: () => g(),
|
|
9559
|
-
onClick:
|
|
9559
|
+
onClick: P,
|
|
9560
9560
|
style: n,
|
|
9561
9561
|
"data-node-id": f,
|
|
9562
9562
|
ref: r,
|
|
9563
9563
|
onDragStart: () => w(o),
|
|
9564
9564
|
onDragEnd: () => j(o),
|
|
9565
9565
|
onDragOver: (T) => {
|
|
9566
|
-
T.preventDefault(),
|
|
9566
|
+
T.preventDefault(), D(f, "yes");
|
|
9567
9567
|
},
|
|
9568
9568
|
onDragLeave: (T) => {
|
|
9569
|
-
T.preventDefault(),
|
|
9569
|
+
T.preventDefault(), D(f, "no");
|
|
9570
9570
|
},
|
|
9571
9571
|
onDrop: (T) => {
|
|
9572
|
-
T.preventDefault(),
|
|
9572
|
+
T.preventDefault(), D(f, "no");
|
|
9573
9573
|
},
|
|
9574
9574
|
children: [
|
|
9575
9575
|
c(PERMISSIONS.ADD_BLOCK) && !m && (o == null ? void 0 : o.rowIndex) > 0 && (o.parent.isOpen && canAddChildBlock(get(o, "parent.data._type")) || ((L = o == null ? void 0 : o.parent) == null ? void 0 : L.id) === "__REACT_ARBORIST_INTERNAL_ROOT__") && /* @__PURE__ */ jsx("div", { className: "group relative ml-5 h-full w-full cursor-pointer", children: /* @__PURE__ */ jsx(
|
|
@@ -11024,19 +11024,19 @@ const UndoRedo = () => {
|
|
|
11024
11024
|
}, B = (w) => {
|
|
11025
11025
|
w.key === "Enter" && !w.shiftKey && (w.preventDefault(), u !== null ? A() : C());
|
|
11026
11026
|
}, E = useCallback((w) => {
|
|
11027
|
-
const j = (N) => /[.,!?;:]/.test(N), v = (N, I,
|
|
11028
|
-
let
|
|
11027
|
+
const j = (N) => /[.,!?;:]/.test(N), v = (N, I, P) => {
|
|
11028
|
+
let D = "", R = "";
|
|
11029
11029
|
const $ = I > 0 ? N[I - 1] : "", F = I < N.length ? N[I] : "";
|
|
11030
|
-
return I > 0 && ($ === "." || !j($) && $ !== " ") && (
|
|
11031
|
-
text:
|
|
11032
|
-
prefixLength:
|
|
11030
|
+
return I > 0 && ($ === "." || !j($) && $ !== " ") && (D = " "), I < N.length && !j(F) && F !== " " && (R = " "), {
|
|
11031
|
+
text: D + P + R,
|
|
11032
|
+
prefixLength: D.length,
|
|
11033
11033
|
suffixLength: R.length
|
|
11034
11034
|
};
|
|
11035
11035
|
}, _ = x.current;
|
|
11036
11036
|
if (_) {
|
|
11037
|
-
const N = _.selectionStart || 0, I = _.value || "",
|
|
11038
|
-
if (
|
|
11039
|
-
const O = `{{${w}}}`, { text: L } = v(I, N, O), T = I.slice(0, N) + L + I.slice(
|
|
11037
|
+
const N = _.selectionStart || 0, I = _.value || "", P = _.selectionEnd || N;
|
|
11038
|
+
if (P > N) {
|
|
11039
|
+
const O = `{{${w}}}`, { text: L } = v(I, N, O), T = I.slice(0, N) + L + I.slice(P);
|
|
11040
11040
|
p(T);
|
|
11041
11041
|
return;
|
|
11042
11042
|
}
|
|
@@ -11408,10 +11408,10 @@ const PartialWrapper = ({ partialBlockId: o }) => {
|
|
|
11408
11408
|
}, I = (L) => {
|
|
11409
11409
|
const T = { ...n };
|
|
11410
11410
|
delete T[L], r(T), w(), toast.success(o("Token deleted successfully"));
|
|
11411
|
-
},
|
|
11411
|
+
}, P = (L) => {
|
|
11412
11412
|
const T = n[L];
|
|
11413
11413
|
T && (c(L), y(T.name), k(T.value), i(!1), g(!0));
|
|
11414
|
-
},
|
|
11414
|
+
}, D = () => {
|
|
11415
11415
|
i(!0), c(null), f(""), x(""), A(""), p(!0);
|
|
11416
11416
|
}, R = () => {
|
|
11417
11417
|
c(null), y(""), k(""), E(""), g(!1);
|
|
@@ -11429,7 +11429,7 @@ const PartialWrapper = ({ partialBlockId: o }) => {
|
|
|
11429
11429
|
Button,
|
|
11430
11430
|
{
|
|
11431
11431
|
variant: "outline",
|
|
11432
|
-
onClick:
|
|
11432
|
+
onClick: D,
|
|
11433
11433
|
disabled: a || l !== null,
|
|
11434
11434
|
size: "sm",
|
|
11435
11435
|
className: "h-7 text-xs",
|
|
@@ -11455,7 +11455,7 @@ const PartialWrapper = ({ partialBlockId: o }) => {
|
|
|
11455
11455
|
{
|
|
11456
11456
|
variant: "ghost",
|
|
11457
11457
|
size: "sm",
|
|
11458
|
-
onClick: () =>
|
|
11458
|
+
onClick: () => P(L),
|
|
11459
11459
|
disabled: a || l !== null,
|
|
11460
11460
|
className: "h-6 w-6 p-0",
|
|
11461
11461
|
children: /* @__PURE__ */ jsx(Pencil1Icon, { className: "h-3 w-3" })
|
|
@@ -11963,36 +11963,39 @@ const RootLayout = () => {
|
|
|
11963
11963
|
const i = first(o);
|
|
11964
11964
|
isString(i) && (a = [i, ...getParentNodeIds(n, i)]), r(a);
|
|
11965
11965
|
}, [o, n, r]);
|
|
11966
|
-
}, ScreenTooSmall = () =>
|
|
11967
|
-
|
|
11968
|
-
|
|
11969
|
-
|
|
11970
|
-
|
|
11971
|
-
alt: "Chai Builder",
|
|
11972
|
-
className: "mx-auto h-20 w-20 rounded-full shadow-lg transition-transform duration-300 hover:scale-105"
|
|
11973
|
-
}
|
|
11974
|
-
),
|
|
11975
|
-
/* @__PURE__ */ jsxs("div", { className: "space-y-4", children: [
|
|
11976
|
-
/* @__PURE__ */ jsx("h2", { className: "text-5xl font-bold tracking-tight text-gray-900", children: "Screen too small" }),
|
|
11977
|
-
/* @__PURE__ */ jsxs("p", { className: "mx-auto max-w-sm text-sm leading-7 text-gray-600", children: [
|
|
11978
|
-
"Please view this page on greater than ",
|
|
11979
|
-
/* @__PURE__ */ jsx("strong", { className: "font-medium", children: "1280px" }),
|
|
11980
|
-
" screen width for the best experience."
|
|
11981
|
-
] })
|
|
11982
|
-
] }),
|
|
11983
|
-
/* @__PURE__ */ jsx("div", { className: "pt-4", children: /* @__PURE__ */ jsxs("div", { className: "inline-flex items-center rounded-full bg-gray-100 px-4 py-2 text-sm text-gray-700", children: [
|
|
11984
|
-
/* @__PURE__ */ jsx("svg", { className: "mr-2 h-5 w-5", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx(
|
|
11985
|
-
"path",
|
|
11966
|
+
}, ScreenTooSmall = () => {
|
|
11967
|
+
const o = useBuilderProp("smallScreenComponent", null);
|
|
11968
|
+
return /* @__PURE__ */ jsx("section", { className: "fixed inset-0 z-[99999] flex h-screen w-screen items-center justify-center bg-white xl:hidden", children: o ? React__default.createElement(o) : /* @__PURE__ */ jsx("div", { className: "flex h-full w-full items-center justify-center bg-[linear-gradient(to_right,#f3f4f6_1px,transparent_1px),linear-gradient(to_bottom,#f3f4f6_1px,transparent_1px)] bg-[size:10px_10px] py-12 sm:py-16 lg:py-20", children: /* @__PURE__ */ jsx("div", { className: "mx-auto max-w-7xl px-4 sm:px-6 lg:px-8", children: /* @__PURE__ */ jsxs("div", { className: "mx-auto max-w-md space-y-6 text-center", children: [
|
|
11969
|
+
/* @__PURE__ */ jsx(
|
|
11970
|
+
"img",
|
|
11986
11971
|
{
|
|
11987
|
-
|
|
11988
|
-
|
|
11989
|
-
|
|
11990
|
-
d: "M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"
|
|
11972
|
+
src: "https://ucarecdn.com/fbfc3b05-cb73-4e99-92a2-3a367b7c36cd/",
|
|
11973
|
+
alt: "Chai Builder",
|
|
11974
|
+
className: "mx-auto h-20 w-20 rounded-full shadow-lg transition-transform duration-300 hover:scale-105"
|
|
11991
11975
|
}
|
|
11992
|
-
)
|
|
11993
|
-
"
|
|
11994
|
-
|
|
11995
|
-
|
|
11976
|
+
),
|
|
11977
|
+
/* @__PURE__ */ jsxs("div", { className: "space-y-4", children: [
|
|
11978
|
+
/* @__PURE__ */ jsx("h2", { className: "text-5xl font-bold tracking-tight text-gray-900", children: "Screen too small" }),
|
|
11979
|
+
/* @__PURE__ */ jsxs("p", { className: "mx-auto max-w-sm text-sm leading-7 text-gray-600", children: [
|
|
11980
|
+
"Please view this page on greater than ",
|
|
11981
|
+
/* @__PURE__ */ jsx("strong", { className: "font-medium", children: "1280px" }),
|
|
11982
|
+
" screen width for the best experience."
|
|
11983
|
+
] })
|
|
11984
|
+
] }),
|
|
11985
|
+
/* @__PURE__ */ jsx("div", { className: "pt-4", children: /* @__PURE__ */ jsxs("div", { className: "inline-flex items-center rounded-full bg-gray-100 px-4 py-2 text-sm text-gray-700", children: [
|
|
11986
|
+
/* @__PURE__ */ jsx("svg", { className: "mr-2 h-5 w-5", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx(
|
|
11987
|
+
"path",
|
|
11988
|
+
{
|
|
11989
|
+
strokeLinecap: "round",
|
|
11990
|
+
strokeLinejoin: "round",
|
|
11991
|
+
strokeWidth: "2",
|
|
11992
|
+
d: "M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"
|
|
11993
|
+
}
|
|
11994
|
+
) }),
|
|
11995
|
+
"Minimum width: 1280px"
|
|
11996
|
+
] }) })
|
|
11997
|
+
] }) }) }) });
|
|
11998
|
+
};
|
|
11996
11999
|
function isSelfAtom(o, n) {
|
|
11997
12000
|
return o.unstable_is ? o.unstable_is(n) : n === o;
|
|
11998
12001
|
}
|