@chaibuilder/sdk 1.2.44 → 1.2.46
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/AddBlocks-Jse1nYBd.cjs +1 -0
- package/dist/{AddBlocks-QCb-vIta.js → AddBlocks-wY7YpsXy.js} +4 -3
- package/dist/{CanvasArea-Hqy_21xf.js → CanvasArea-2widR9Ry.js} +6 -5
- package/dist/{CanvasArea-xvT325mp.cjs → CanvasArea-pQP-jR11.cjs} +1 -1
- package/dist/{ChaiBuilderEditor-AIXWnz29.cjs → ChaiBuilderEditor-74s7jELl.cjs} +42 -42
- package/dist/{ChaiBuilderEditor-NnMEdW3k.js → ChaiBuilderEditor-wriVkIG1.js} +5109 -5124
- package/dist/{CurrentPage-rkdt2mNr.js → CurrentPage--JhcSlGs.js} +10 -9
- package/dist/CurrentPage-UozVUoj8.cjs +1 -0
- package/dist/ListTree-aFX8fD7v.cjs +1 -0
- package/dist/{ListTree-PuZP9LQu.js → ListTree-qTfVR-jh.js} +2 -1
- package/dist/PagesPanel-1ZzPulaC.cjs +1 -0
- package/dist/{PagesPanel-TYArrNU6.js → PagesPanel-qatBt4Nf.js} +5 -4
- package/dist/ProjectPanel-QUIcKWwM.cjs +1 -0
- package/dist/{ProjectPanel-qY_Bnqjm.js → ProjectPanel-Vp-EZS_Y.js} +6 -5
- package/dist/{Settings-k9Ll55Wc.js → Settings-E_xif3_e.js} +105 -103
- package/dist/Settings-jKpJi5Wy.cjs +1 -0
- package/dist/{SidePanels-eOnxPSSw.js → SidePanels-UEa90HOL.js} +5 -4
- package/dist/SidePanels-s_Yl7HhG.cjs +1 -0
- package/dist/{ThemeConfiguration-TINcg8VX.js → ThemeConfiguration-IUuxGaDf.js} +4 -3
- package/dist/ThemeConfiguration-YkPc6RGq.cjs +1 -0
- package/dist/{Topbar--KrJ6nJg.js → Topbar-C7Qfcatg.js} +4 -3
- package/dist/Topbar-YzdQKElx.cjs +1 -0
- package/dist/{UILibrariesPanel-sleogb55.js → UILibrariesPanel-didKK7tC.js} +4 -3
- package/dist/UILibrariesPanel-qv8AiOn1.cjs +1 -0
- package/dist/UnsplashImages-QeZ65lKC.cjs +1 -0
- package/dist/{UnsplashImages-P7_2yEo-.js → UnsplashImages-VkZ_KszK.js} +4 -3
- package/dist/{UploadImages-ovzzQW6b.js → UploadImages-6drauLA-.js} +4 -3
- package/dist/UploadImages-igQroUtu.cjs +1 -0
- package/dist/add-page-modal-esHlLYay.cjs +1 -0
- package/dist/{add-page-modal-SmBfx0LH.js → add-page-modal-rJ7OwdoX.js} +17 -16
- package/dist/confirm-alert-08q_BmL6.cjs +1 -0
- package/dist/{confirm-alert-yipdBkkj.js → confirm-alert-HfChUtfw.js} +4 -3
- package/dist/core.cjs +1 -1
- package/dist/core.js +45 -44
- package/dist/{delete-page-modal-HIul7JBc.js → delete-page-modal-E3tO5Q1p.js} +5 -4
- package/dist/delete-page-modal-SOCB_9UB.cjs +1 -0
- package/dist/email.cjs +1 -1
- package/dist/email.js +4 -3
- package/dist/{form-yq_mbR58.cjs → form-gRWwpKzq.cjs} +1 -1
- package/dist/{form-cZPoXqTP.js → form-hi_RCepy.js} +1 -1
- package/dist/{index-q_bEEzdK.cjs → index-3j3SZ9Pb.cjs} +1 -1
- package/dist/{index-Vu40oRWp.js → index-OnzJQ25d.js} +2 -2
- package/dist/{page-viewer-ZOVAaE9q.js → page-viewer-K_8dfU3A.js} +6 -5
- package/dist/page-viewer-S3xZLu53.cjs +1 -0
- package/dist/project-general-setting-IRQ9TNAd.cjs +1 -0
- package/dist/{project-general-setting-2iNlm_kN.js → project-general-setting-vSkiqVk-.js} +6 -5
- package/dist/project-seo-setting-XHFqgtW9.cjs +1 -0
- package/dist/{project-seo-setting-FX0cbkrO.js → project-seo-setting-b9jZC0dr.js} +5 -4
- package/dist/single-page-detail-RG82dk4d.cjs +1 -0
- package/dist/{single-page-detail-4v8ojQss.js → single-page-detail-zHbO3vOI.js} +7 -6
- package/dist/studio.cjs +1 -1
- package/dist/studio.js +4 -3
- package/dist/ui.cjs +1 -1
- package/dist/ui.js +139 -138
- package/dist/{useCanvasSettings-A7Qj0z4L.cjs → useCanvasSettings-2Wzyf2PK.cjs} +1 -1
- package/dist/{useCanvasSettings-QH5zCmxD.js → useCanvasSettings-L2pW5boY.js} +1 -1
- package/package.json +2 -1
- package/dist/AddBlocks-Bb-K6Y0Z.cjs +0 -1
- package/dist/CurrentPage-n_oOiHx5.cjs +0 -1
- package/dist/ListTree-z0FeSAsc.cjs +0 -1
- package/dist/PagesPanel-4ftrFiS0.cjs +0 -1
- package/dist/ProjectPanel-2scMInUn.cjs +0 -1
- package/dist/Settings-kbUR5-xt.cjs +0 -1
- package/dist/SidePanels-ZHxoiJ7y.cjs +0 -1
- package/dist/ThemeConfiguration-fRsktVs4.cjs +0 -1
- package/dist/Topbar-tgFkKz7R.cjs +0 -1
- package/dist/UILibrariesPanel-2HyAEVLE.cjs +0 -1
- package/dist/UnsplashImages-azP_HIqG.cjs +0 -1
- package/dist/UploadImages-nnszHoZa.cjs +0 -1
- package/dist/add-page-modal-nDBqhemF.cjs +0 -1
- package/dist/confirm-alert-75rfTsgE.cjs +0 -1
- package/dist/delete-page-modal-lO-dULGW.cjs +0 -1
- package/dist/page-viewer-3ZqrDjrz.cjs +0 -1
- package/dist/project-general-setting-IIxWGrU2.cjs +0 -1
- package/dist/project-seo-setting-46PdN9FR.cjs +0 -1
- package/dist/single-page-detail-MsBTVx9h.cjs +0 -1
|
@@ -5,17 +5,17 @@ import { useThrottledCallback as de } from "@react-hookz/web";
|
|
|
5
5
|
import { forEach as Ne, isArray as ce, omit as vt, truncate as jt, includes as X, get as y, first as ae, split as wt, startCase as F, toLower as re, isEmpty as m, map as _, find as Ze, last as Ct, filter as ye, set as We, debounce as kt, keys as he, cloneDeep as Nt, each as _t, capitalize as be, reject as St, kebabCase as Tt, startsWith as W, nth as He, isNumber as Rt, parseInt as Vt, isNaN as Ue, findLast as Ht, flatten as De, intersection as Dt, has as ie, isNull as Bt } from "lodash-es";
|
|
6
6
|
import { useTranslation as B } from "react-i18next";
|
|
7
7
|
import { CopyIcon as It, PlusIcon as _e, Cross2Icon as Ge, EyeOpenIcon as Pt, EyeClosedIcon as Be, BorderAllIcon as Y, WidthIcon as R, HeightIcon as V, ArrowUpIcon as J, ArrowRightIcon as Q, ArrowDownIcon as ee, ArrowLeftIcon as te, ArrowTopLeftIcon as At, ArrowTopRightIcon as $t, ArrowBottomRightIcon as Mt, ArrowBottomLeftIcon as Et, AlignLeftIcon as Lt, AlignCenterHorizontallyIcon as Ot, AlignRightIcon as zt, StretchHorizontallyIcon as Yt, FontItalicIcon as Xt, UnderlineIcon as Ft, OverlineIcon as Zt, LetterCaseUppercaseIcon as Wt, Cross1Icon as Ut, InfoCircledIcon as Se, MinusIcon as Gt, BoxIcon as Ke, RowSpacingIcon as Kt, TriangleDownIcon as qt, CrossCircledIcon as Jt, CaretDownIcon as Qt, MixerHorizontalIcon as qe } from "@radix-ui/react-icons";
|
|
8
|
-
import { a2 as Je, aP as Qe, aQ as et, B as A, aR as tt, aS as er, aT as tr, aU as rr, aV as sr, aW as ar, aX as lr, M as G, aK as rt, $ as or, a0 as nr, a1 as ir, aY as dr, Z as cr, ab as pr, _ as ur, ac as $, ad as M, ae as E, aZ as gr, a_ as xr, a$ as yr, b0 as hr, b1 as br, b2 as mr, b3 as fr, R as st, Q as at, h as lt, b4 as vr, b5 as ot, b6 as me, b7 as fe, b8 as ve, b9 as jr, ba as wr, ah as Cr, bb as kr, Y as pe, n as Te, I as nt, L as it, bc as dt,
|
|
9
|
-
import { Check as
|
|
10
|
-
import { getBlockComponent as Re, getChaiDataProviders as
|
|
11
|
-
import { J as
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import { u as
|
|
15
|
-
import
|
|
16
|
-
import
|
|
17
|
-
import { A as
|
|
18
|
-
import { a as
|
|
8
|
+
import { a2 as Je, aP as Qe, aQ as et, B as A, aR as tt, aS as er, aT as tr, aU as rr, aV as sr, aW as ar, aX as lr, M as G, aK as rt, $ as or, a0 as nr, a1 as ir, aY as dr, Z as cr, ab as pr, _ as ur, ac as $, ad as M, ae as E, aZ as gr, a_ as xr, a$ as yr, b0 as hr, b1 as br, b2 as mr, b3 as fr, R as st, Q as at, h as lt, b4 as vr, b5 as ot, b6 as me, b7 as fe, b8 as ve, b9 as jr, ba as wr, ah as Cr, bb as kr, Y as pe, n as Te, I as nt, L as it, bc as dt, bd as je, j as Nr, be as _r, J as ue, v as Sr, P as Tr, o as Ie, av as Rr, aw as Vr, ax as Hr, bf as ct, ay as Pe, az as Ae, bg as $e, bh as Me, bi as Ee, S as Dr } from "./ChaiBuilderEditor-wriVkIG1.js";
|
|
9
|
+
import { Check as Br, EditIcon as Ir, TrashIcon as Pr, Loader as Ar, SparklesIcon as $r, DeleteIcon as Mr } from "lucide-react";
|
|
10
|
+
import { getBlockComponent as Re, getChaiDataProviders as Er, useGlobalStylingPresets as Lr } from "@chaibuilder/runtime";
|
|
11
|
+
import { J as Or, a as zr, d as Yr } from "./index-e0c8PmRQ.js";
|
|
12
|
+
import Xr from "@rjsf/core";
|
|
13
|
+
import Fr from "@rjsf/validator-ajv8";
|
|
14
|
+
import { u as Zr } from "./useCanvasSettings-L2pW5boY.js";
|
|
15
|
+
import Wr from "react-autosuggest";
|
|
16
|
+
import Ur from "fuse.js";
|
|
17
|
+
import { A as Gr, C as ge, g as Kr } from "./utils-iMv3T4WT.js";
|
|
18
|
+
import { a as qr } from "./STRINGS--j49GZJP.js";
|
|
19
19
|
import "./_commonjsHelpers-UyOWmZb0.js";
|
|
20
20
|
import "clsx";
|
|
21
21
|
import "react-dom";
|
|
@@ -27,6 +27,7 @@ import "flagged";
|
|
|
27
27
|
import "./Functions-7jnEwJyw.js";
|
|
28
28
|
import "tailwind-merge";
|
|
29
29
|
import "./MODIFIERS-cBT31iqE.js";
|
|
30
|
+
import "tree-model";
|
|
30
31
|
import "@radix-ui/react-toggle";
|
|
31
32
|
import "class-variance-authority";
|
|
32
33
|
import "@radix-ui/react-switch";
|
|
@@ -49,7 +50,7 @@ import "@radix-ui/react-context-menu";
|
|
|
49
50
|
import "react-icons-picker";
|
|
50
51
|
import "react-quill";
|
|
51
52
|
import "react-hotkeys-hook";
|
|
52
|
-
function
|
|
53
|
+
function Jr(r) {
|
|
53
54
|
const a = [], t = {};
|
|
54
55
|
function n(l, s) {
|
|
55
56
|
Ne(s, (d, c) => {
|
|
@@ -66,12 +67,12 @@ const we = ({ data: r, fullView: a }) => {
|
|
|
66
67
|
return a ? typeof r == "object" ? /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
67
68
|
/* @__PURE__ */ e.jsx("div", { className: "h-3" }),
|
|
68
69
|
/* @__PURE__ */ e.jsx(Je, { children: /* @__PURE__ */ e.jsx(
|
|
69
|
-
|
|
70
|
+
Or,
|
|
70
71
|
{
|
|
71
72
|
data: r,
|
|
72
|
-
shouldExpandNode:
|
|
73
|
+
shouldExpandNode: zr,
|
|
73
74
|
style: {
|
|
74
|
-
...
|
|
75
|
+
...Yr,
|
|
75
76
|
container: "max-h-[40vh] overflow-y-auto text-[12px] leading-[1.5] tracking-wide font-mono",
|
|
76
77
|
stringValue: "text-orange-600",
|
|
77
78
|
label: "text-green-900 font-semibold pr-1 tracking-wider"
|
|
@@ -91,7 +92,7 @@ const we = ({ data: r, fullView: a }) => {
|
|
|
91
92
|
dataType: s,
|
|
92
93
|
appliedBindings: d
|
|
93
94
|
}) => {
|
|
94
|
-
const { paths: c, pathsType: o } =
|
|
95
|
+
const { paths: c, pathsType: o } = Jr(n), p = r === "PROP" ? Re(n == null ? void 0 : n._type) : {}, h = r === "PROP", [i, g] = j(!1), x = T(() => r === "PROP" ? c.filter(
|
|
95
96
|
(u) => !X(d, u) && y(p, `props.${ae(wt(u, "."))}.binding`)
|
|
96
97
|
) : c.filter((u) => s === y(o, u, "")), [r, c, d, s, p]);
|
|
97
98
|
return P(() => {
|
|
@@ -132,7 +133,7 @@ const we = ({ data: r, fullView: a }) => {
|
|
|
132
133
|
},
|
|
133
134
|
children: [
|
|
134
135
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-x-2", children: [
|
|
135
|
-
/* @__PURE__ */ e.jsx(
|
|
136
|
+
/* @__PURE__ */ e.jsx(Br, { className: `h-4 w-4 text-green-500 ${a === u ? "" : "opacity-0"}` }),
|
|
136
137
|
u
|
|
137
138
|
] }),
|
|
138
139
|
h ? /* @__PURE__ */ e.jsx("div", { children: /* @__PURE__ */ e.jsx("span", { className: "rounded-full bg-purple-100 px-2 py-0.5 text-[10px] text-purple-500", children: F(y(o, u, "")) }) }) : /* @__PURE__ */ e.jsx("div", { className: "pl-6", children: /* @__PURE__ */ e.jsx(we, { data: y(n, u) }) })
|
|
@@ -146,7 +147,7 @@ const we = ({ data: r, fullView: a }) => {
|
|
|
146
147
|
] }),
|
|
147
148
|
!h && !m(a) && /* @__PURE__ */ e.jsx("div", { className: "pt-2", children: /* @__PURE__ */ e.jsx(we, { data: y(n, a, ""), fullView: !0 }) })
|
|
148
149
|
] });
|
|
149
|
-
},
|
|
150
|
+
}, Qr = ({
|
|
150
151
|
appliedBindings: r = [],
|
|
151
152
|
onAddBinding: a,
|
|
152
153
|
editMode: t,
|
|
@@ -224,7 +225,7 @@ const we = ({ data: r, fullView: a }) => {
|
|
|
224
225
|
return /* @__PURE__ */ e.jsxs(cr, { children: [
|
|
225
226
|
/* @__PURE__ */ e.jsx(pr, { disabled: r, asChild: !0, onClick: () => c(!0), children: a }),
|
|
226
227
|
d && /* @__PURE__ */ e.jsx(ur, { children: /* @__PURE__ */ e.jsx(
|
|
227
|
-
|
|
228
|
+
Qr,
|
|
228
229
|
{
|
|
229
230
|
item: s,
|
|
230
231
|
editMode: l,
|
|
@@ -235,7 +236,7 @@ const we = ({ data: r, fullView: a }) => {
|
|
|
235
236
|
}
|
|
236
237
|
) })
|
|
237
238
|
] });
|
|
238
|
-
},
|
|
239
|
+
}, es = ({
|
|
239
240
|
item: r,
|
|
240
241
|
onAddBinding: a,
|
|
241
242
|
onRemove: t,
|
|
@@ -259,9 +260,9 @@ const we = ({ data: r, fullView: a }) => {
|
|
|
259
260
|
/* @__PURE__ */ e.jsx("div", { className: "font-medium leading-5", children: r.value }),
|
|
260
261
|
/* @__PURE__ */ e.jsx(we, { data: y(l, r.value, "") }),
|
|
261
262
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center justify-end gap-x-2", children: [
|
|
262
|
-
/* @__PURE__ */ e.jsx(pt, { editMode: !0, onAddBinding: a, appliedBindings: s, item: r, children: /* @__PURE__ */ e.jsx(
|
|
263
|
+
/* @__PURE__ */ e.jsx(pt, { editMode: !0, onAddBinding: a, appliedBindings: s, item: r, children: /* @__PURE__ */ e.jsx(Ir, { className: "mt-1 h-6 w-6 cursor-pointer rounded border border-blue-400 p-1 text-blue-400 duration-200 hover:scale-105 hover:bg-blue-400 hover:text-white" }) }),
|
|
263
264
|
/* @__PURE__ */ e.jsx(
|
|
264
|
-
|
|
265
|
+
Pr,
|
|
265
266
|
{
|
|
266
267
|
onClick: () => t(),
|
|
267
268
|
className: "mt-1 h-6 w-6 cursor-pointer rounded border border-red-400 p-1 text-red-400 duration-200 hover:scale-105 hover:bg-red-400 hover:text-white"
|
|
@@ -270,8 +271,8 @@ const we = ({ data: r, fullView: a }) => {
|
|
|
270
271
|
] }),
|
|
271
272
|
!m(d) && !m(r.key) && /* @__PURE__ */ e.jsx("div", { className: "absolute right-0 top-1 mt-px flex h-4 items-center rounded-full px-2 text-[10px] font-medium text-purple-600", children: F(d) })
|
|
272
273
|
] });
|
|
273
|
-
},
|
|
274
|
-
const t = G(), [n] = rt(), l =
|
|
274
|
+
}, ts = ({ bindingData: r, onChange: a }) => {
|
|
275
|
+
const t = G(), [n] = rt(), l = Er(), [s, d] = j(
|
|
275
276
|
_(r, (i, g) => ({ key: g, value: i }))
|
|
276
277
|
);
|
|
277
278
|
P(() => {
|
|
@@ -309,7 +310,7 @@ const we = ({ data: r, fullView: a }) => {
|
|
|
309
310
|
/* @__PURE__ */ e.jsx("a", { className: "text-blue-500", href: "https://chaibuilder.com/docs/registering-data-providers", target: "_blank", children: "Learn more" })
|
|
310
311
|
] }) }) : /* @__PURE__ */ e.jsxs("div", { className: "space-y-2", children: [
|
|
311
312
|
_(s, (i, g) => /* @__PURE__ */ e.jsx(
|
|
312
|
-
|
|
313
|
+
es,
|
|
313
314
|
{
|
|
314
315
|
item: i,
|
|
315
316
|
onAddBinding: o,
|
|
@@ -339,7 +340,7 @@ const we = ({ data: r, fullView: a }) => {
|
|
|
339
340
|
c && /* @__PURE__ */ e.jsx(E, { sideOffset: -55, className: "text-[11px]", children: m(n) ? "No data provider has been set up for this page." : "Complete last added data binding to add more" })
|
|
340
341
|
] })
|
|
341
342
|
] });
|
|
342
|
-
},
|
|
343
|
+
}, rs = () => /* @__PURE__ */ e.jsx("div", { className: "text-xs border rounded-sm p-1 mt-1 border-orange-500 text-orange-500 bg-orange-100", children: "Data binding is set for this field" }), Ce = mt(({ id: r, properties: a, formData: t, onChange: n }) => {
|
|
343
344
|
const [l, s] = j(t), d = { type: "object", properties: {} }, c = {};
|
|
344
345
|
Object.keys(a).forEach((p) => {
|
|
345
346
|
const h = a[p];
|
|
@@ -359,10 +360,10 @@ const we = ({ data: r, fullView: a }) => {
|
|
|
359
360
|
// save only every 5 seconds
|
|
360
361
|
);
|
|
361
362
|
return /* @__PURE__ */ e.jsx(
|
|
362
|
-
|
|
363
|
+
Xr,
|
|
363
364
|
{
|
|
364
365
|
widgets: {
|
|
365
|
-
binding:
|
|
366
|
+
binding: rs,
|
|
366
367
|
richtext: yr,
|
|
367
368
|
icon: hr,
|
|
368
369
|
image: br
|
|
@@ -373,7 +374,7 @@ const we = ({ data: r, fullView: a }) => {
|
|
|
373
374
|
omitExtraData: !1,
|
|
374
375
|
liveOmit: !1,
|
|
375
376
|
liveValidate: !1,
|
|
376
|
-
validator:
|
|
377
|
+
validator: Fr,
|
|
377
378
|
uiSchema: c,
|
|
378
379
|
schema: d,
|
|
379
380
|
formData: l,
|
|
@@ -382,8 +383,8 @@ const we = ({ data: r, fullView: a }) => {
|
|
|
382
383
|
}
|
|
383
384
|
}
|
|
384
385
|
);
|
|
385
|
-
}),
|
|
386
|
-
const [r, a] =
|
|
386
|
+
}), ss = () => {
|
|
387
|
+
const [r, a] = Zr(), t = fr(), n = (d, c) => {
|
|
387
388
|
a((o) => ({ ...o, [d]: c }));
|
|
388
389
|
};
|
|
389
390
|
if (m(t))
|
|
@@ -405,7 +406,7 @@ const we = ({ data: r, fullView: a }) => {
|
|
|
405
406
|
) })
|
|
406
407
|
] });
|
|
407
408
|
};
|
|
408
|
-
function
|
|
409
|
+
function as() {
|
|
409
410
|
const r = G(), a = st(), t = at(), n = Re(r._type), l = { ...r }, [s, d] = j(l), c = lt("dataBindingSupport", !1), o = ({ formData: x }, u, v) => {
|
|
410
411
|
if (u && (s == null ? void 0 : s._id) === r._id) {
|
|
411
412
|
const C = u.replace("root.", "");
|
|
@@ -429,7 +430,7 @@ function ls() {
|
|
|
429
430
|
return c && _t(i, (u) => delete x[u]), x;
|
|
430
431
|
}, [n, i, c]);
|
|
431
432
|
return /* @__PURE__ */ e.jsxs("div", { className: "overflow-x-hidden", children: [
|
|
432
|
-
/* @__PURE__ */ e.jsx(
|
|
433
|
+
/* @__PURE__ */ e.jsx(ss, {}),
|
|
433
434
|
c ? /* @__PURE__ */ e.jsxs(ot, { type: "multiple", defaultValue: ["STATIC", "BINDING"], className: "h-full w-full", children: [
|
|
434
435
|
/* @__PURE__ */ e.jsxs(me, { value: "BINDING", children: [
|
|
435
436
|
/* @__PURE__ */ e.jsx(fe, { className: "bg-gray-100 px-3 py-2 text-xs hover:no-underline", children: /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-x-2", children: [
|
|
@@ -442,7 +443,7 @@ function ls() {
|
|
|
442
443
|
"Data Binding"
|
|
443
444
|
] }) }),
|
|
444
445
|
/* @__PURE__ */ e.jsx(ve, { className: "px-4 pt-4", children: /* @__PURE__ */ e.jsx(
|
|
445
|
-
|
|
446
|
+
ts,
|
|
446
447
|
{
|
|
447
448
|
bindingData: y(r, "_bindings", {}),
|
|
448
449
|
onChange: (x) => {
|
|
@@ -486,7 +487,7 @@ function ls() {
|
|
|
486
487
|
)
|
|
487
488
|
] });
|
|
488
489
|
}
|
|
489
|
-
const
|
|
490
|
+
const ls = ({ blockId: r }) => {
|
|
490
491
|
const { t: a } = B(), { askAi: t, loading: n, error: l } = jr(), [s, d] = j(""), c = ft(null);
|
|
491
492
|
P(() => {
|
|
492
493
|
var p;
|
|
@@ -521,7 +522,7 @@ const os = ({ blockId: r }) => {
|
|
|
521
522
|
className: "w-fit",
|
|
522
523
|
size: "sm",
|
|
523
524
|
children: n ? /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
524
|
-
/* @__PURE__ */ e.jsx(
|
|
525
|
+
/* @__PURE__ */ e.jsx(Ar, { className: "h-5 w-5 animate-spin" }),
|
|
525
526
|
a("Generating... Please wait")
|
|
526
527
|
] }) : a("Edit with AI")
|
|
527
528
|
}
|
|
@@ -533,9 +534,10 @@ const os = ({ blockId: r }) => {
|
|
|
533
534
|
] }),
|
|
534
535
|
/* @__PURE__ */ e.jsx(A, { variant: "destructive", onClick: () => stop(), className: "hidden w-fit", size: "sm", children: a("Stop") })
|
|
535
536
|
] }) : null
|
|
536
|
-
] })
|
|
537
|
+
] }),
|
|
538
|
+
/* @__PURE__ */ e.jsx("div", { className: "max-w-full", children: l && /* @__PURE__ */ e.jsx("p", { className: "break-words rounded border border-red-500 bg-red-100 p-1 text-xs text-red-500", children: l.message }) })
|
|
537
539
|
] });
|
|
538
|
-
}, Oe = new Gr
|
|
540
|
+
}, Oe = new Ur(Gr, {
|
|
539
541
|
isCaseSensitive: !1,
|
|
540
542
|
threshold: 0.2,
|
|
541
543
|
minMatchCharLength: 2,
|
|
@@ -543,7 +545,7 @@ const os = ({ blockId: r }) => {
|
|
|
543
545
|
});
|
|
544
546
|
function ut() {
|
|
545
547
|
var S;
|
|
546
|
-
const { t: r } = B(), [a] = pe(), t = G(), n = Te(), l = nt(), [s] = it(), d = lt("askAiCallBack", null), [c, o] = j(""), { toast: p } = dt(), h = (S = ae(a)) == null ? void 0 : S.prop, i = St((y(t, h, "").replace(
|
|
548
|
+
const { t: r } = B(), [a] = pe(), t = G(), n = Te(), l = nt(), [s] = it(), d = lt("askAiCallBack", null), [c, o] = j(""), { toast: p } = dt(), h = (S = ae(a)) == null ? void 0 : S.prop, i = St((y(t, h, "").replace(qr, "").split(",").pop() || "").split(" "), m), g = () => {
|
|
547
549
|
const w = c.trim().toLowerCase().replace(/ +(?= )/g, "").split(" ");
|
|
548
550
|
n(s, w, !0), o("");
|
|
549
551
|
}, [x, u] = j([]), v = ({ value: w }) => {
|
|
@@ -591,7 +593,7 @@ function ut() {
|
|
|
591
593
|
{
|
|
592
594
|
className: `flex ${x.length > 0 ? "min-h-[300px]" : "min-h-max"} w-full flex-col gap-y-1.5 overflow-y-auto border-b-2 bg-gray-100 pb-4`,
|
|
593
595
|
children: [
|
|
594
|
-
/* @__PURE__ */ e.jsxs(
|
|
596
|
+
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center justify-between gap-x-2", children: [
|
|
595
597
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-x-2", children: [
|
|
596
598
|
/* @__PURE__ */ e.jsx("span", { children: r("Classes") }),
|
|
597
599
|
/* @__PURE__ */ e.jsxs($, { children: [
|
|
@@ -601,15 +603,15 @@ function ut() {
|
|
|
601
603
|
] }),
|
|
602
604
|
d ? /* @__PURE__ */ e.jsxs(Qe, { children: [
|
|
603
605
|
/* @__PURE__ */ e.jsx(et, { children: /* @__PURE__ */ e.jsxs(A, { variant: "default", className: "h-6 w-fit", size: "sm", children: [
|
|
604
|
-
/* @__PURE__ */ e.jsx(
|
|
606
|
+
/* @__PURE__ */ e.jsx($r, { className: "h-4 w-4" }),
|
|
605
607
|
/* @__PURE__ */ e.jsx("span", { className: "ml-2", children: r("Ask AI") })
|
|
606
608
|
] }) }),
|
|
607
|
-
/* @__PURE__ */ e.jsx(tt, { side: "left", className: "p-2", children: /* @__PURE__ */ e.jsx(
|
|
609
|
+
/* @__PURE__ */ e.jsx(tt, { side: "left", className: "p-2", children: /* @__PURE__ */ e.jsx(ls, { blockId: t == null ? void 0 : t._id }) })
|
|
608
610
|
] }) : null
|
|
609
611
|
] }),
|
|
610
612
|
/* @__PURE__ */ e.jsxs("div", { className: "relative flex items-center gap-x-3", children: [
|
|
611
613
|
/* @__PURE__ */ e.jsx("div", { className: "relative flex w-full items-center gap-x-3", children: /* @__PURE__ */ e.jsx(
|
|
612
|
-
|
|
614
|
+
Wr,
|
|
613
615
|
{
|
|
614
616
|
suggestions: x,
|
|
615
617
|
onSuggestionsFetchRequested: v,
|
|
@@ -662,7 +664,7 @@ function ut() {
|
|
|
662
664
|
}
|
|
663
665
|
);
|
|
664
666
|
}
|
|
665
|
-
const
|
|
667
|
+
const os = ({ onAdd: r }) => {
|
|
666
668
|
const { t: a } = B(), [t, n] = j({ key: "", value: "" }), l = () => {
|
|
667
669
|
m(t.key) || (r({ ...t, key: Tt(t.key) }), n({ key: "", value: "" }));
|
|
668
670
|
};
|
|
@@ -708,7 +710,7 @@ const ns = ({ onAdd: r }) => {
|
|
|
708
710
|
m(t.key) ? null : /* @__PURE__ */ e.jsx(A, { variant: "ghost", onClick: () => n({ key: "", value: "" }), children: a("Cancel") })
|
|
709
711
|
] })
|
|
710
712
|
] });
|
|
711
|
-
},
|
|
713
|
+
}, ns = () => {
|
|
712
714
|
const r = G(), [a, t] = j([]), [n] = pe(), l = st(), s = at(), { t: d } = B(), { toast: c } = dt(), o = `${y(n, "0.prop")}_attrs`;
|
|
713
715
|
ne.useEffect(() => {
|
|
714
716
|
const g = _(y(r, o), (x, u) => ({ key: u, value: x }));
|
|
@@ -771,7 +773,7 @@ const ns = ({ onAdd: r }) => {
|
|
|
771
773
|
disabled: W(g.value, "dnd-"),
|
|
772
774
|
className: "invisible group-hover:visible",
|
|
773
775
|
onClick: () => p(a.indexOf(g)),
|
|
774
|
-
children: /* @__PURE__ */ e.jsx(
|
|
776
|
+
children: /* @__PURE__ */ e.jsx(Mr, { className: "w-4 text-gray-500" })
|
|
775
777
|
}
|
|
776
778
|
) }),
|
|
777
779
|
/* @__PURE__ */ e.jsx(E, { className: "max-w-[200px]", children: W(g.value, "dnd-") ? d("Predefined attribute. Cannot be deleted") : d("Remove attribute") })
|
|
@@ -780,9 +782,9 @@ const ns = ({ onAdd: r }) => {
|
|
|
780
782
|
)
|
|
781
783
|
] }) }),
|
|
782
784
|
/* @__PURE__ */ e.jsx("div", { className: "py-2" }),
|
|
783
|
-
/* @__PURE__ */ e.jsx(
|
|
785
|
+
/* @__PURE__ */ e.jsx(os, { onAdd: (g) => h(g) })
|
|
784
786
|
] }) });
|
|
785
|
-
}, k = ["px", "%", "em", "rem", "ch", "vh", "vw"],
|
|
787
|
+
}, k = ["px", "%", "em", "rem", "ch", "vh", "vw"], is = {
|
|
786
788
|
heading: "flex.heading",
|
|
787
789
|
items: [
|
|
788
790
|
{ type: "arbitrary", label: "flex.basis", units: k, property: "flexBasis" },
|
|
@@ -791,7 +793,7 @@ const ns = ({ onAdd: r }) => {
|
|
|
791
793
|
{ type: "dropdown", label: "flex.grow", property: "flexGrow" },
|
|
792
794
|
{ type: "dropdown", label: "flex.shrink", property: "flexShrink" }
|
|
793
795
|
]
|
|
794
|
-
},
|
|
796
|
+
}, ds = {
|
|
795
797
|
heading: "grid.heading",
|
|
796
798
|
items: [
|
|
797
799
|
{ type: "range", label: "grid.col_span", property: "gridColSpan" },
|
|
@@ -802,7 +804,7 @@ const ns = ({ onAdd: r }) => {
|
|
|
802
804
|
{ type: "range", label: "grid.row_end", property: "gridRowEnd" },
|
|
803
805
|
{ type: "range", label: "grid.order", property: "order" }
|
|
804
806
|
]
|
|
805
|
-
},
|
|
807
|
+
}, cs = [
|
|
806
808
|
{
|
|
807
809
|
heading: "Styles",
|
|
808
810
|
items: [
|
|
@@ -866,7 +868,7 @@ const ns = ({ onAdd: r }) => {
|
|
|
866
868
|
},
|
|
867
869
|
{
|
|
868
870
|
heading: "Attributes",
|
|
869
|
-
items: [{ component:
|
|
871
|
+
items: [{ component: ns }]
|
|
870
872
|
}
|
|
871
873
|
], Ta = [
|
|
872
874
|
{
|
|
@@ -1466,7 +1468,7 @@ const ns = ({ onAdd: r }) => {
|
|
|
1466
1468
|
)
|
|
1467
1469
|
] }),
|
|
1468
1470
|
static: Ut
|
|
1469
|
-
}, le = Fe({ canReset: !1, canChange: !0 }),
|
|
1471
|
+
}, le = Fe({ canReset: !1, canChange: !0 }), ps = ({ children: r, canReset: a = !1, canChange: t = !0 }) => (
|
|
1470
1472
|
// eslint-disable-next-line react/jsx-no-constructed-context-values
|
|
1471
1473
|
/* @__PURE__ */ e.jsx(le.Provider, { value: { canReset: a, canChange: t }, children: r })
|
|
1472
1474
|
), xt = ({ label: r, property: a, onChange: t }) => {
|
|
@@ -1489,7 +1491,7 @@ const ns = ({ onAdd: r }) => {
|
|
|
1489
1491
|
) });
|
|
1490
1492
|
};
|
|
1491
1493
|
function ke({ selected: r, onChange: a, rounded: t = !1, options: n, disabled: l = !1 }) {
|
|
1492
|
-
const s = r.replace(/.*:/g, "").trim(), { undo: d, redo: c } =
|
|
1494
|
+
const s = r.replace(/.*:/g, "").trim(), { undo: d, redo: c } = Nr();
|
|
1493
1495
|
return /* @__PURE__ */ e.jsxs(
|
|
1494
1496
|
"select",
|
|
1495
1497
|
{
|
|
@@ -1509,7 +1511,7 @@ function ke({ selected: r, onChange: a, rounded: t = !1, options: n, disabled: l
|
|
|
1509
1511
|
}
|
|
1510
1512
|
);
|
|
1511
1513
|
}
|
|
1512
|
-
const
|
|
1514
|
+
const us = ({ property: r, onChange: a }) => {
|
|
1513
1515
|
const { canReset: t, canChange: n } = se(le), l = oe(r), s = T(() => y(l, "cls", ""), [l]), d = T(() => y(ge, `${r}.classes`, [""]), [r]), c = d.indexOf(s) > -1 ? d.indexOf(s) : 0, o = /\[.*\]/g.test(s);
|
|
1514
1516
|
return /* @__PURE__ */ e.jsx("div", { className: "flex flex-row divide-x divide-solid divide-border rounded border border-border text-xs", children: o ? /* @__PURE__ */ e.jsx("div", { className: "py-[5px] px-2", children: s }) : /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
1515
1517
|
/* @__PURE__ */ e.jsx(
|
|
@@ -1544,7 +1546,7 @@ const gs = ({ property: r, onChange: a }) => {
|
|
|
1544
1546
|
}
|
|
1545
1547
|
)
|
|
1546
1548
|
] }) });
|
|
1547
|
-
},
|
|
1549
|
+
}, gs = ({ property: r, onChange: a }) => {
|
|
1548
1550
|
const t = T(() => y(ge, `${r}.classes`, [""]), [r]), { canChange: n } = se(le), l = oe(r), s = T(() => y(l, "cls", ""), [l]);
|
|
1549
1551
|
return /* @__PURE__ */ e.jsx("div", { className: "flex grow flex-wrap gap-1", children: _(t, (d) => /* @__PURE__ */ e.jsxs($, { children: [
|
|
1550
1552
|
/* @__PURE__ */ e.jsx(M, { asChild: !0, children: /* @__PURE__ */ e.jsx(
|
|
@@ -1559,7 +1561,7 @@ const gs = ({ property: r, onChange: a }) => {
|
|
|
1559
1561
|
) }),
|
|
1560
1562
|
/* @__PURE__ */ e.jsx(E, { children: F(re(d)) })
|
|
1561
1563
|
] })) });
|
|
1562
|
-
},
|
|
1564
|
+
}, xs = {
|
|
1563
1565
|
backgroundColor: "bg",
|
|
1564
1566
|
textColor: "text",
|
|
1565
1567
|
borderColor: "border",
|
|
@@ -1571,7 +1573,7 @@ const gs = ({ property: r, onChange: a }) => {
|
|
|
1571
1573
|
toColor: "to",
|
|
1572
1574
|
ringColor: "ring",
|
|
1573
1575
|
ringOffsetColor: "ring-offset"
|
|
1574
|
-
},
|
|
1576
|
+
}, ys = ({ property: r, onChange: a }) => {
|
|
1575
1577
|
const t = oe(r), n = T(() => y(t, "cls", ""), [t]), { canChange: l } = se(le), [s, d] = j([]), [c, o] = j({ color: "", shade: "" }), p = n.split("-"), h = y(p, "1", ""), i = y(p, "2", ""), g = H(
|
|
1576
1578
|
// eslint-disable-next-line no-shadow
|
|
1577
1579
|
(u) => {
|
|
@@ -1594,7 +1596,7 @@ const gs = ({ property: r, onChange: a }) => {
|
|
|
1594
1596
|
return P(() => {
|
|
1595
1597
|
o({ color: "", shade: "" });
|
|
1596
1598
|
}, [t]), P(() => {
|
|
1597
|
-
const v = `${y(
|
|
1599
|
+
const v = `${y(xs, r, "")}-${c.color}${c.shade ? `-${c.shade}` : ""}`;
|
|
1598
1600
|
v.match(new RegExp(y(ge, `${r}.regExp`, ""))) && a(v, r);
|
|
1599
1601
|
}, [c, a, r]), /* @__PURE__ */ e.jsxs("div", { className: "flex flex-row divide-x divide-solid divide-border rounded-lg border border-border text-xs", children: [
|
|
1600
1602
|
/* @__PURE__ */ e.jsx("div", { className: "grow text-center", children: /* @__PURE__ */ e.jsx(
|
|
@@ -1648,7 +1650,7 @@ const gs = ({ property: r, onChange: a }) => {
|
|
|
1648
1650
|
const l = r.match(n), s = l && l.length > 1, d = !m(t) && Number.isNaN(Number(t));
|
|
1649
1651
|
return s || d ? { error: "Invalid value" } : l && (l[0] === "auto" || l[0] === "none") ? { value: l[0], unit: "" } : { value: t, unit: l ? l[0] : "" };
|
|
1650
1652
|
};
|
|
1651
|
-
const
|
|
1653
|
+
const hs = (r) => {
|
|
1652
1654
|
const a = r.startsWith("-") ? "-" : "", t = r.split("-").pop();
|
|
1653
1655
|
if (["auto", "none"].includes(t))
|
|
1654
1656
|
return { value: "", unit: t };
|
|
@@ -1777,18 +1779,18 @@ const bs = (r) => {
|
|
|
1777
1779
|
}
|
|
1778
1780
|
return Rt(parseFloat(t)) ? { value: `${a + parseFloat(t) * 4}`, unit: "px" } : { value: t, unit: "class" };
|
|
1779
1781
|
};
|
|
1780
|
-
const
|
|
1782
|
+
const bs = (r) => {
|
|
1781
1783
|
if (m(r))
|
|
1782
1784
|
return { value: "", unit: "" };
|
|
1783
1785
|
const a = r.match(/\[.*\]/g);
|
|
1784
1786
|
if (a === null)
|
|
1785
|
-
return
|
|
1787
|
+
return ms(r);
|
|
1786
1788
|
const t = y(a, "0", "").replace(/\[|\]/g, ""), n = r.startsWith("-") ? "-" : "", l = ae(t.match(/\d+.\d+|\d+/g));
|
|
1787
1789
|
return { value: `${n}${l}`, unit: t.replace(l, "") };
|
|
1788
|
-
},
|
|
1790
|
+
}, ms = (r) => m(r) ? { value: "", unit: "" } : hs(r), yt = I.createContext({
|
|
1789
1791
|
setDragData: () => {
|
|
1790
1792
|
}
|
|
1791
|
-
}),
|
|
1793
|
+
}), fs = ({
|
|
1792
1794
|
unit: r,
|
|
1793
1795
|
currentValue: a,
|
|
1794
1796
|
onDrag: t,
|
|
@@ -1820,7 +1822,7 @@ const ms = (r) => {
|
|
|
1820
1822
|
children: /* @__PURE__ */ e.jsx(Kt, {})
|
|
1821
1823
|
}
|
|
1822
1824
|
);
|
|
1823
|
-
},
|
|
1825
|
+
}, vs = ({ onSelect: r, current: a, units: t }) => /* @__PURE__ */ e.jsx("div", { "data-theme": "light", className: "-m-[7px] -mx-[13px] flex w-9 flex-col", children: t.map((n) => /* @__PURE__ */ e.jsx(
|
|
1824
1826
|
A,
|
|
1825
1827
|
{
|
|
1826
1828
|
className: "h-max rounded-none px-1 py-1 text-right text-[11px] hover:bg-blue-400",
|
|
@@ -1832,10 +1834,10 @@ const ms = (r) => {
|
|
|
1832
1834
|
children: n
|
|
1833
1835
|
},
|
|
1834
1836
|
n
|
|
1835
|
-
)) }), Ye = 50,
|
|
1837
|
+
)) }), Ye = 50, js = (r) => {
|
|
1836
1838
|
const [a, t] = j(!1), [n, l] = j(""), { currentClass: s, onChange: d, classPrefix: c, cssProperty: o, units: p, negative: h } = r, [i, g] = j(o != null && o.toLowerCase().includes("width") ? "%" : p[0]), [x, u] = j(!1), [v, C] = j(""), [U, L] = j(!1), [K, q] = j(!1);
|
|
1837
1839
|
P(() => {
|
|
1838
|
-
const { value: b, unit: f } =
|
|
1840
|
+
const { value: b, unit: f } = bs(s);
|
|
1839
1841
|
if (f === "") {
|
|
1840
1842
|
l(b), g(o != null && o.toLowerCase().includes("width") ? "%" : ae(p));
|
|
1841
1843
|
return;
|
|
@@ -1934,8 +1936,8 @@ const ms = (r) => {
|
|
|
1934
1936
|
]
|
|
1935
1937
|
}
|
|
1936
1938
|
) }),
|
|
1937
|
-
/* @__PURE__ */ e.jsx(
|
|
1938
|
-
|
|
1939
|
+
/* @__PURE__ */ e.jsx(_r, { children: /* @__PURE__ */ e.jsx(E, { className: "bg-background", children: /* @__PURE__ */ e.jsx(
|
|
1940
|
+
vs,
|
|
1939
1941
|
{
|
|
1940
1942
|
units: p,
|
|
1941
1943
|
current: i,
|
|
@@ -1947,7 +1949,7 @@ const ms = (r) => {
|
|
|
1947
1949
|
] })
|
|
1948
1950
|
] }),
|
|
1949
1951
|
["none", "auto"].indexOf(i) !== -1 || U ? null : /* @__PURE__ */ e.jsx(
|
|
1950
|
-
|
|
1952
|
+
fs,
|
|
1951
1953
|
{
|
|
1952
1954
|
onDragStart: () => L(!0),
|
|
1953
1955
|
onDragEnd: (b) => {
|
|
@@ -1973,7 +1975,7 @@ const ms = (r) => {
|
|
|
1973
1975
|
}, oe = (r) => {
|
|
1974
1976
|
const a = ue();
|
|
1975
1977
|
return Ht(a, { property: r });
|
|
1976
|
-
},
|
|
1978
|
+
}, ws = (r, a) => {
|
|
1977
1979
|
const t = {
|
|
1978
1980
|
xs: 0,
|
|
1979
1981
|
sm: 1,
|
|
@@ -1983,7 +1985,7 @@ const ms = (r) => {
|
|
|
1983
1985
|
"2xl": 5
|
|
1984
1986
|
};
|
|
1985
1987
|
return t[y(r, "mq", "xs")] <= t[a];
|
|
1986
|
-
},
|
|
1988
|
+
}, Cs = {
|
|
1987
1989
|
width: "w-",
|
|
1988
1990
|
height: "h-",
|
|
1989
1991
|
minWidth: "min-w-",
|
|
@@ -2056,19 +2058,19 @@ const ms = (r) => {
|
|
|
2056
2058
|
lg: "1024px",
|
|
2057
2059
|
xl: "1280px",
|
|
2058
2060
|
"2xl": "1536px"
|
|
2059
|
-
},
|
|
2061
|
+
}, ks = (r) => `${r.toUpperCase()} ${Xe[r] ? `(${Xe[r]} & up)` : ""}`, Ve = (r) => {
|
|
2060
2062
|
const { t: a } = B(), { type: t = "icons", label: n, property: l, onEmitChange: s = () => {
|
|
2061
|
-
}, units: d, negative: c = !1 } = r, [o] =
|
|
2063
|
+
}, units: d, negative: c = !1 } = r, [o] = Sr(), [p] = Tr(), [, h] = Ie(), i = oe(l), g = Te(), x = nt(), [u] = it(), v = T(() => y(i, "fullCls", ""), [i]), C = H(
|
|
2062
2064
|
(w, D = !0) => {
|
|
2063
2065
|
const Z = { dark: o, mq: h, mod: p, cls: w, property: l, fullCls: "" };
|
|
2064
2066
|
(o || p !== "") && (Z.mq = "xs");
|
|
2065
|
-
const b =
|
|
2067
|
+
const b = Kr(Z);
|
|
2066
2068
|
g(u, [b], D);
|
|
2067
2069
|
},
|
|
2068
2070
|
[u, o, h, p, l, g]
|
|
2069
2071
|
), U = H(() => {
|
|
2070
2072
|
x(u, [v]);
|
|
2071
|
-
}, [u, v, x]), L = T(() =>
|
|
2073
|
+
}, [u, v, x]), L = T(() => ws(i, h), [i, h]);
|
|
2072
2074
|
P(() => {
|
|
2073
2075
|
s(L, i);
|
|
2074
2076
|
}, [L, s, i]);
|
|
@@ -2085,24 +2087,24 @@ const ms = (r) => {
|
|
|
2085
2087
|
},
|
|
2086
2088
|
[K]
|
|
2087
2089
|
), S = y(i, "dark", null) === o && y(i, "mod", null) === p && y(i, "mq", null) === h;
|
|
2088
|
-
return /* @__PURE__ */ e.jsx(
|
|
2090
|
+
return /* @__PURE__ */ e.jsx(ps, { canChange: L, canReset: i && S, children: /* @__PURE__ */ e.jsxs("div", { className: "group flex flex-row items-center py-2 first:pt-0 last:pb-0", children: [
|
|
2089
2091
|
/* @__PURE__ */ e.jsx("div", { className: "relative w-[70px] truncate text-xs text-foreground", children: /* @__PURE__ */ e.jsx("span", { className: `text-[11px] ${i && !S ? "text-foreground" : ""}`, children: a(n) }) }),
|
|
2090
2092
|
/* @__PURE__ */ e.jsxs("div", { className: "flex flex-row items-center", children: [
|
|
2091
2093
|
/* @__PURE__ */ e.jsxs("div", { className: "w-[150px]", children: [
|
|
2092
2094
|
t === "arbitrary" ? /* @__PURE__ */ e.jsx(
|
|
2093
|
-
|
|
2095
|
+
js,
|
|
2094
2096
|
{
|
|
2095
2097
|
currentClass: y(i, "cls", ""),
|
|
2096
|
-
classPrefix: y(
|
|
2098
|
+
classPrefix: y(Cs, l, ""),
|
|
2097
2099
|
units: d || [],
|
|
2098
2100
|
onChange: C,
|
|
2099
2101
|
negative: c,
|
|
2100
2102
|
cssProperty: l
|
|
2101
2103
|
}
|
|
2102
2104
|
) : null,
|
|
2103
|
-
t === "icons" && /* @__PURE__ */ e.jsx(
|
|
2104
|
-
t === "range" && /* @__PURE__ */ e.jsx(
|
|
2105
|
-
t === "color" && /* @__PURE__ */ e.jsx(
|
|
2105
|
+
t === "icons" && /* @__PURE__ */ e.jsx(gs, { property: l, onChange: C }),
|
|
2106
|
+
t === "range" && /* @__PURE__ */ e.jsx(us, { property: l, onChange: C }),
|
|
2107
|
+
t === "color" && /* @__PURE__ */ e.jsx(ys, { property: l, onChange: C }),
|
|
2106
2108
|
t === "dropdown" && /* @__PURE__ */ e.jsx(xt, { label: n, property: l, onChange: C })
|
|
2107
2109
|
] }),
|
|
2108
2110
|
/* @__PURE__ */ e.jsx("div", { className: `w-[30px] cursor-pointer ${v ? "visible" : "invisible"}`, children: S ? /* @__PURE__ */ e.jsx("button", { type: "button", onClick: () => U(), title: "Reset", className: "flex px-1.5 text-xs", children: /* @__PURE__ */ e.jsx(Jt, { className: "h-5 w-5 text-blue-500 hover:opacity-80" }) }) : L && i ? /* @__PURE__ */ e.jsxs($, { delayDuration: 100, children: [
|
|
@@ -2117,7 +2119,7 @@ const ms = (r) => {
|
|
|
2117
2119
|
/* @__PURE__ */ e.jsx(E, { children: /* @__PURE__ */ e.jsx("div", { className: "text-right", children: /* @__PURE__ */ e.jsxs("div", { children: [
|
|
2118
2120
|
"Current style is set at ",
|
|
2119
2121
|
/* @__PURE__ */ e.jsxs("span", { className: "font-bold", children: [
|
|
2120
|
-
|
|
2122
|
+
ks(y(i, "mq")),
|
|
2121
2123
|
o && !i.dark ? "(Light mode)" : ""
|
|
2122
2124
|
] }),
|
|
2123
2125
|
/* @__PURE__ */ e.jsx("br", {}),
|
|
@@ -2137,13 +2139,13 @@ const ms = (r) => {
|
|
|
2137
2139
|
] }) : null })
|
|
2138
2140
|
] })
|
|
2139
2141
|
] }) });
|
|
2140
|
-
},
|
|
2142
|
+
}, Ns = ["px", "%", "em", "rem", "ch", "vh", "vw"], ht = ({
|
|
2141
2143
|
label: r,
|
|
2142
2144
|
options: a,
|
|
2143
2145
|
borderB: t = !1,
|
|
2144
2146
|
borderT: n = !1,
|
|
2145
2147
|
type: l = "arbitrary",
|
|
2146
|
-
units: s =
|
|
2148
|
+
units: s = Ns,
|
|
2147
2149
|
negative: d = !1
|
|
2148
2150
|
}) => {
|
|
2149
2151
|
const { t: c } = B(), [o, p] = j(a[0].key), h = ue(), i = H((g) => _(h, "property").includes(g), [h]);
|
|
@@ -2187,7 +2189,7 @@ const ms = (r) => {
|
|
|
2187
2189
|
]
|
|
2188
2190
|
}
|
|
2189
2191
|
);
|
|
2190
|
-
},
|
|
2192
|
+
}, _s = ({ heading: r, items: a }) => {
|
|
2191
2193
|
const { t } = B(), n = ue(), l = T(() => {
|
|
2192
2194
|
const s = (o) => De(
|
|
2193
2195
|
o.map((p) => p.styleType === "multiple" ? _(p.options, "key") : p.property)
|
|
@@ -2208,7 +2210,7 @@ const ms = (r) => {
|
|
|
2208
2210
|
] }) }),
|
|
2209
2211
|
/* @__PURE__ */ e.jsx("div", { className: "p-2", children: a.map((s) => s.styleType === "multiple" ? /* @__PURE__ */ e.jsx(ht, { ...s }, s.label) : /* @__PURE__ */ e.jsx(Ve, { ...s }, s.label)) })
|
|
2210
2212
|
] });
|
|
2211
|
-
},
|
|
2213
|
+
}, Ss = Fe({}), xe = ({ section: r }) => {
|
|
2212
2214
|
const { t: a } = B(), t = ue(), n = H(
|
|
2213
2215
|
(s = []) => {
|
|
2214
2216
|
const d = {};
|
|
@@ -2224,26 +2226,26 @@ const ms = (r) => {
|
|
|
2224
2226
|
},
|
|
2225
2227
|
[t]
|
|
2226
2228
|
), l = T(() => ({}), []);
|
|
2227
|
-
return /* @__PURE__ */ e.jsx(
|
|
2229
|
+
return /* @__PURE__ */ e.jsx(Ss.Provider, { value: l, children: /* @__PURE__ */ e.jsxs(me, { value: r.heading, children: [
|
|
2228
2230
|
/* @__PURE__ */ e.jsx(fe, { className: "bg-gray-200 px-3 py-2 text-xs hover:no-underline", children: /* @__PURE__ */ e.jsx("div", { className: "flex items-center gap-x-2", children: a(r.heading) }) }),
|
|
2229
2231
|
/* @__PURE__ */ e.jsx(ve, { className: "bg-gray-100 px-3.5 py-2", children: I.Children.toArray(
|
|
2230
|
-
r.items.map((s) => ie(s, "component") ? I.createElement(s.component, { key: s.label }) : ie(s, "styleType") ? s.styleType === "multiple" ? /* @__PURE__ */ e.jsx(ht, { ...s }, s.label) : s.styleType === "accordion" && n(s == null ? void 0 : s.conditions) ? /* @__PURE__ */ e.jsx(
|
|
2232
|
+
r.items.map((s) => ie(s, "component") ? I.createElement(s.component, { key: s.label }) : ie(s, "styleType") ? s.styleType === "multiple" ? /* @__PURE__ */ e.jsx(ht, { ...s }, s.label) : s.styleType === "accordion" && n(s == null ? void 0 : s.conditions) ? /* @__PURE__ */ e.jsx(_s, { ...s }, s.label) : null : /* @__PURE__ */ e.jsx(Ve, { ...s }, s.label))
|
|
2231
2233
|
) })
|
|
2232
2234
|
] }) });
|
|
2233
|
-
},
|
|
2234
|
-
const r = G(), [a] = pe(), { t } = B(), n =
|
|
2235
|
+
}, Ts = () => {
|
|
2236
|
+
const r = G(), [a] = pe(), { t } = B(), n = Lr(), l = Te(), s = Re(r._type), d = y(ae(a), "prop"), c = y(s.props, `${d}.presets`, {});
|
|
2235
2237
|
if (m(n) && (!ie(s, "props") || m(c)))
|
|
2236
2238
|
return null;
|
|
2237
2239
|
const o = (p) => {
|
|
2238
2240
|
const h = p.trim().toLowerCase().replace(/ +(?= )/g, "").split(" ");
|
|
2239
2241
|
l([r._id], h, !0);
|
|
2240
2242
|
};
|
|
2241
|
-
return /* @__PURE__ */ e.jsx("div", { className: "h-10", children: /* @__PURE__ */ e.jsxs(
|
|
2242
|
-
/* @__PURE__ */ e.jsx(
|
|
2243
|
+
return /* @__PURE__ */ e.jsx("div", { className: "h-10", children: /* @__PURE__ */ e.jsxs(Rr, { children: [
|
|
2244
|
+
/* @__PURE__ */ e.jsx(Vr, { asChild: !0, children: /* @__PURE__ */ e.jsx("div", { className: "px-4", children: /* @__PURE__ */ e.jsxs(A, { variant: "default", className: "w-full", size: "sm", children: [
|
|
2243
2245
|
t("Apply Presets"),
|
|
2244
2246
|
/* @__PURE__ */ e.jsx(Qt, {})
|
|
2245
2247
|
] }) }) }),
|
|
2246
|
-
/* @__PURE__ */ e.jsx(
|
|
2248
|
+
/* @__PURE__ */ e.jsx(Hr, { className: "max-h-80 w-56", children: /* @__PURE__ */ e.jsxs(ct, { className: "no-scrollbar h-full", children: [
|
|
2247
2249
|
m(c) ? null : /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
2248
2250
|
/* @__PURE__ */ e.jsxs(Pe, { children: [
|
|
2249
2251
|
s.type,
|
|
@@ -2267,21 +2269,21 @@ const ms = (r) => {
|
|
|
2267
2269
|
] }) })
|
|
2268
2270
|
] }) });
|
|
2269
2271
|
};
|
|
2270
|
-
function
|
|
2271
|
-
const { flexChild: r, gridChild: a } =
|
|
2272
|
+
function Rs() {
|
|
2273
|
+
const { flexChild: r, gridChild: a } = Dr(), { t } = B(), [n] = pe();
|
|
2272
2274
|
return m(n) ? /* @__PURE__ */ e.jsx("div", { className: "p-4 text-center", children: /* @__PURE__ */ e.jsxs("div", { className: "space-y-4 rounded-xl p-4", children: [
|
|
2273
2275
|
/* @__PURE__ */ e.jsx(qe, { className: "mx-auto text-3xl" }),
|
|
2274
2276
|
/* @__PURE__ */ e.jsx("h1", { children: t("no_styling_block_selected") })
|
|
2275
2277
|
] }) }) : /* @__PURE__ */ e.jsxs("div", { className: "flex h-full flex-col", children: [
|
|
2276
|
-
/* @__PURE__ */ e.jsx(
|
|
2278
|
+
/* @__PURE__ */ e.jsx(Ts, {}),
|
|
2277
2279
|
/* @__PURE__ */ e.jsxs(ot, { defaultValue: ["Styles"], type: "multiple", className: "w-full", children: [
|
|
2278
|
-
r && /* @__PURE__ */ e.jsx(xe, { section:
|
|
2279
|
-
a ? /* @__PURE__ */ e.jsx(xe, { section:
|
|
2280
|
-
|
|
2280
|
+
r && /* @__PURE__ */ e.jsx(xe, { section: is }),
|
|
2281
|
+
a ? /* @__PURE__ */ e.jsx(xe, { section: ds }) : null,
|
|
2282
|
+
cs.map((l) => /* @__PURE__ */ e.jsx(xe, { section: l }, l.heading))
|
|
2281
2283
|
] })
|
|
2282
2284
|
] });
|
|
2283
2285
|
}
|
|
2284
|
-
const
|
|
2286
|
+
const Vs = {
|
|
2285
2287
|
px: 1,
|
|
2286
2288
|
"%": 1,
|
|
2287
2289
|
em: 100,
|
|
@@ -2307,7 +2309,7 @@ const Hs = {
|
|
|
2307
2309
|
const p = !y(l, "negative", !1), h = y(l, "cssProperty", "");
|
|
2308
2310
|
let i = parseFloat(l.dragStartValue);
|
|
2309
2311
|
i = Ue(i) ? 0 : i;
|
|
2310
|
-
let g =
|
|
2312
|
+
let g = Vs[l.dragUnit];
|
|
2311
2313
|
(W(h, "scale") || h === "opacity") && (g = 10);
|
|
2312
2314
|
let u = (l.dragStartY - o.pageY) / g + i;
|
|
2313
2315
|
p && u < 0 && (u = 0), h === "opacity" && u > 1 && (u = 1), l.onDrag(`${u}`), n(`${u}`);
|
|
@@ -2339,8 +2341,8 @@ const Hs = {
|
|
|
2339
2341
|
}
|
|
2340
2342
|
) : null,
|
|
2341
2343
|
/* @__PURE__ */ e.jsxs(ct, { className: "no-scrollbar max-h-full flex-1 overflow-x-hidden overflow-y-hidden bg-gray-100 pb-5", children: [
|
|
2342
|
-
/* @__PURE__ */ e.jsx(
|
|
2343
|
-
/* @__PURE__ */ e.jsx(
|
|
2344
|
+
/* @__PURE__ */ e.jsx(as, {}),
|
|
2345
|
+
/* @__PURE__ */ e.jsx(Rs, {})
|
|
2344
2346
|
] })
|
|
2345
2347
|
] }) });
|
|
2346
2348
|
};
|