@chaibuilder/sdk 1.2.10 → 1.2.12
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/README.md +10 -12
- package/dist/AddBlocks-ByeMUUzE.js +218 -0
- package/dist/AddBlocks-nMUkm4og.cjs +1 -0
- package/dist/{BrandingOptions-10jJO8mG.js → BrandingOptions--poS5shs.js} +18 -21
- package/dist/BrandingOptions-eeDfvB0R.cjs +1 -0
- package/dist/{CanvasArea-jgBDM5Qd.js → CanvasArea--TKubnIM.js} +184 -185
- package/dist/{CanvasArea-6O8dMPug.cjs → CanvasArea-h4lA4oqP.cjs} +4 -4
- package/dist/{utils-AvyFzbPC.js → Class-17XFhL48.js} +15 -16
- package/dist/Class-5ARpH_Tu.cjs +1 -0
- package/dist/CurrentPage-B3YumhrX.cjs +1 -0
- package/dist/{CurrentPage-lakeZviD.js → CurrentPage-Gw9LJ40j.js} +24 -25
- package/dist/Layers-4r_4F6ST.cjs +1 -0
- package/dist/{Layers-R7TfREUd.js → Layers-d-xge4On.js} +77 -78
- package/dist/{PagesPanel-4mqxCFHq.js → PagesPanel-E4wSgVcE.js} +14 -15
- package/dist/PagesPanel-iZLDBwXQ.cjs +1 -0
- package/dist/ProjectPanel-2TcqGnfN.cjs +1 -0
- package/dist/{ProjectPanel-Wy2nw-1w.js → ProjectPanel-q7upaf7h.js} +17 -18
- package/dist/Settings-NuDNH2dR.cjs +1 -0
- package/dist/{Settings-_K28Ontt.js → Settings-y3DHsT88.js} +163 -164
- package/dist/SidePanels-91l1CjYv.cjs +1 -0
- package/dist/{SidePanels-6slnxdSj.js → SidePanels-BK_QnEh9.js} +40 -41
- package/dist/{Topbar-bwt6HjlL.js → Topbar-b7jnOD57.js} +16 -17
- package/dist/Topbar-rEO5z57t.cjs +1 -0
- package/dist/{UnsplashImages-V29UE-57.js → UnsplashImages-Lb78FYx7.js} +27 -28
- package/dist/UnsplashImages-p-WdKs3b.cjs +1 -0
- package/dist/{UploadImages-E0mi_qn8.js → UploadImages-aWG_1r7N.js} +23 -24
- package/dist/UploadImages-zk-IYDx8.cjs +1 -0
- package/dist/{add-page-modal-FJEAqfD3.js → add-page-modal-7djj9GZj.js} +28 -29
- package/dist/add-page-modal-iUffBbAe.cjs +1 -0
- package/dist/{confirm-alert-5hfE116f.js → confirm-alert-QuqMrpWn.js} +12 -13
- package/dist/confirm-alert-i3FRAgP4.cjs +1 -0
- package/dist/core.cjs +1 -1
- package/dist/core.d.ts +9 -50
- package/dist/core.js +47 -56
- package/dist/defaultTheme-IH19g4fv.cjs +1 -0
- package/dist/defaultTheme-YY8mlQS3.js +1055 -0
- package/dist/{delete-page-modal-wH0yLiQI.js → delete-page-modal-DEBiprds.js} +14 -15
- package/dist/delete-page-modal-RllDrgxs.cjs +1 -0
- package/dist/email-blocks.cjs +1 -1
- package/dist/email-blocks.js +100 -81
- package/dist/email.cjs +1 -0
- package/dist/email.d.ts +116 -0
- package/dist/email.js +79 -0
- package/dist/{controls-XPXGHKht.js → empty-slot-MWycClTb.js} +61 -50
- package/dist/empty-slot-TF2kd-0X.cjs +1 -0
- package/dist/{form-UVHCD9N3.js → form-94xR0NG8.js} +1 -1
- package/dist/{form-1j01gADS.cjs → form-yz7h2msc.cjs} +1 -1
- package/dist/{index-B4sL0YTN.js → index-0m8Zuv5X.js} +1434 -1552
- package/dist/{index-c2VLKuhY.js → index-19nTm_cE.js} +2069 -2059
- package/dist/index-TEfD-2ti.cjs +1 -0
- package/dist/{index-xbQL0wpz.cjs → index-XVud0HL8.cjs} +33 -33
- package/dist/lib.cjs +3 -3
- package/dist/lib.js +95 -1125
- package/dist/page-viewer-_ktv1pgX.cjs +1 -0
- package/dist/{page-viewer-TcK0I240.js → page-viewer-xPLhXv6k.js} +16 -17
- package/dist/{project-general-setting-4ruKl033.js → project-general-setting-XlORLtqJ.js} +15 -16
- package/dist/project-general-setting-nULU3Tzw.cjs +1 -0
- package/dist/project-seo-setting-9QkARPhg.cjs +1 -0
- package/dist/{project-seo-setting-d1EZlacB.js → project-seo-setting-KQkeHwny.js} +14 -15
- package/dist/render.cjs +1 -1
- package/dist/render.d.ts +2 -0
- package/dist/render.js +111 -70
- package/dist/single-page-detail-Gb6O3Yyw.cjs +1 -0
- package/dist/{single-page-detail-PihQi-dP.js → single-page-detail-gtVN9hxR.js} +44 -45
- package/dist/studio.cjs +1 -1
- package/dist/studio.js +13 -14
- package/dist/ui.cjs +1 -1
- package/dist/ui.d.ts +3 -3
- package/dist/ui.js +138 -139
- package/dist/{useAddBlockByDrop-nLzs79He.cjs → useAddBlockByDrop-GU5QLPtz.cjs} +1 -1
- package/dist/{useAddBlockByDrop-rcDR-z9_.js → useAddBlockByDrop-b5KJh_7w.js} +1 -1
- package/dist/web-blocks.cjs +1 -1
- package/dist/web-blocks.js +313 -322
- package/package.json +8 -2
- package/dist/AddBlocks-GiMnBMeQ.js +0 -224
- package/dist/AddBlocks-SzURo9Bj.cjs +0 -1
- package/dist/BrandingOptions-yK-54R-c.cjs +0 -1
- package/dist/CurrentPage-1y62Ne77.cjs +0 -1
- package/dist/Layers-Z4nmm9xK.cjs +0 -1
- package/dist/PagesPanel-ouHdxyOH.cjs +0 -1
- package/dist/ProjectPanel-hHolYZjt.cjs +0 -1
- package/dist/Settings-EYOw02iE.cjs +0 -1
- package/dist/SidePanels-U-_O1QN8.cjs +0 -1
- package/dist/Topbar-dQEoY2P8.cjs +0 -1
- package/dist/UnsplashImages-pGgaUPQy.cjs +0 -1
- package/dist/UploadImages-7oLycdSh.cjs +0 -1
- package/dist/add-page-modal-In6XI-vZ.cjs +0 -1
- package/dist/confirm-alert-Vwd3OzL9.cjs +0 -1
- package/dist/controls-Dy1qa8Dc.cjs +0 -1
- package/dist/delete-page-modal-tl7FLK9J.cjs +0 -1
- package/dist/functions-Ox_svtKm.cjs +0 -1
- package/dist/functions-xIebp8Aw.js +0 -23
- package/dist/index-7ogwGh39.cjs +0 -1
- package/dist/page-viewer-SfQUe0SI.cjs +0 -1
- package/dist/project-general-setting-t7E2Y_w9.cjs +0 -1
- package/dist/project-seo-setting-4b_BJZDF.cjs +0 -1
- package/dist/single-page-detail-KuXd9Mur.cjs +0 -1
- package/dist/utils-PTxFk6qT.cjs +0 -1
|
@@ -1,24 +1,28 @@
|
|
|
1
1
|
import { j as e } from "./jsx-runtime-WbnYoNE9.js";
|
|
2
2
|
import * as ne from "react";
|
|
3
|
-
import
|
|
3
|
+
import P, { useState as C, useMemo as _, useEffect as O, useCallback as V, memo as dt, createContext as Me, useContext as se } from "react";
|
|
4
4
|
import { useThrottledCallback as fe } from "@react-hookz/web";
|
|
5
|
-
import { forEach as ke, isArray as ie, omit as ct, truncate as pt, includes as E, get as x, first as ue, split as ut, startCase as Y, toLower as le, isEmpty as f, map as k, find as xt, last as ve, filter as we, set as Oe, debounce as gt, keys as ht, cloneDeep as yt, each as
|
|
5
|
+
import { forEach as ke, isArray as ie, omit as ct, truncate as pt, includes as E, get as x, first as ue, split as ut, startCase as Y, toLower as le, isEmpty as f, map as k, find as xt, last as ve, filter as we, set as Oe, debounce as gt, keys as ht, cloneDeep as yt, each as mt, capitalize as bt, reject as ft, nth as Ve, startsWith as W, isNumber as vt, parseInt as wt, isNaN as Fe, findLast as jt, flatten as U, intersection as Ye, has as ye, isNull as Ct } from "lodash-es";
|
|
6
6
|
import { useTranslation as K } from "react-i18next";
|
|
7
|
-
import { PlusIcon as Ne, Cross2Icon as Xe, EyeOpenIcon as kt, EyeClosedIcon as He, BorderAllIcon as A, WidthIcon as
|
|
8
|
-
import {
|
|
9
|
-
import { u as _r } from "./
|
|
10
|
-
import { Check as
|
|
7
|
+
import { PlusIcon as Ne, Cross2Icon as Xe, EyeOpenIcon as kt, EyeClosedIcon as He, BorderAllIcon as A, WidthIcon as S, HeightIcon as R, ArrowUpIcon as Q, ArrowRightIcon as ee, ArrowDownIcon as te, ArrowLeftIcon as re, ArrowTopLeftIcon as Nt, ArrowTopRightIcon as _t, ArrowBottomRightIcon as Tt, ArrowBottomLeftIcon as St, AlignLeftIcon as Rt, AlignCenterHorizontallyIcon as Vt, AlignRightIcon as Ht, StretchHorizontallyIcon as Bt, FontItalicIcon as Dt, UnderlineIcon as $t, OverlineIcon as It, LetterCaseUppercaseIcon as Pt, Cross1Icon as At, InfoCircledIcon as _e, MinusIcon as Et, BoxIcon as ze, RowSpacingIcon as Lt, TriangleDownIcon as Mt, CrossCircledIcon as Ot, TrashIcon as Ft, MixerHorizontalIcon as Ze } from "@radix-ui/react-icons";
|
|
8
|
+
import { aT as Yt, aU as Xt, B as xe, aV as zt, aW as Zt, aX as Wt, aY as Ut, aZ as Kt, a_ as qt, a$ as Gt, a0 as q, af as Jt, ag as Qt, ah as er, b0 as tr, ad as rr, b1 as lr, ae as sr, av as X, aw as z, ax as Z, b2 as or, b3 as ar, b4 as nr, b5 as ir, b6 as dr, b7 as cr, a5 as We, a4 as pr, i as ur, b8 as Ue, b9 as de, ba as ce, bb as pe, ac as Te, L as Ke, Z as qe, j as Ge, az as Se, bc as xr, m as gr, bd as hr, _ as ge, U as yr, a3 as Je, M as Be, a9 as mr, a6 as br, be as fr, aj as vr, ak as wr, al as jr, am as Cr, an as H, bf as Qe, ap as kr, aq as Nr, ar as De, as as $e } from "./index-0m8Zuv5X.js";
|
|
9
|
+
import { u as _r } from "./empty-slot-MWycClTb.js";
|
|
10
|
+
import { Check as Tr, EditIcon as Sr, TrashIcon as Rr } from "lucide-react";
|
|
11
11
|
import { getBlockComponent as et, getChaiDataProviders as Vr } from "@chaibuilder/runtime";
|
|
12
|
-
import { E as tt, u as rt } from "./index-
|
|
12
|
+
import { E as tt, u as rt } from "./index-19nTm_cE.js";
|
|
13
13
|
import { J as Hr, a as Br, d as Dr } from "./index-e0c8PmRQ.js";
|
|
14
|
-
import
|
|
15
|
-
import
|
|
16
|
-
import { useAtom as
|
|
14
|
+
import $r from "@rjsf/core";
|
|
15
|
+
import Ir from "@rjsf/validator-ajv8";
|
|
16
|
+
import { useAtom as Pr } from "jotai";
|
|
17
17
|
import Ar from "react-autosuggest";
|
|
18
18
|
import Er from "fuse.js";
|
|
19
|
-
import { A as Lr, C as he, g as Mr } from "./
|
|
19
|
+
import { A as Lr, C as he, g as Mr } from "./Class-17XFhL48.js";
|
|
20
20
|
import { a as Or } from "./MODIFIERS-RiXS5Mn1.js";
|
|
21
21
|
import "./_commonjsHelpers-UyOWmZb0.js";
|
|
22
|
+
import "./Functions-7jnEwJyw.js";
|
|
23
|
+
import "clsx";
|
|
24
|
+
import "tailwind-merge";
|
|
25
|
+
import "flat-to-nested";
|
|
22
26
|
import "@radix-ui/react-toggle";
|
|
23
27
|
import "class-variance-authority";
|
|
24
28
|
import "@radix-ui/react-switch";
|
|
@@ -42,11 +46,6 @@ import "@radix-ui/react-context-menu";
|
|
|
42
46
|
import "react-icons-picker";
|
|
43
47
|
import "react-dom";
|
|
44
48
|
import "react-quill";
|
|
45
|
-
import "flat-to-nested";
|
|
46
|
-
import "./Functions-7jnEwJyw.js";
|
|
47
|
-
import "clsx";
|
|
48
|
-
import "tailwind-merge";
|
|
49
|
-
import "redux-undo";
|
|
50
49
|
import "i18next";
|
|
51
50
|
import "@floating-ui/react-dom";
|
|
52
51
|
import "react-textarea-autosize";
|
|
@@ -91,7 +90,7 @@ const je = ({ data: r, fullView: o }) => {
|
|
|
91
90
|
/* @__PURE__ */ e.jsx("span", { className: "font-medium text-gray-800/80", children: "Content: " }),
|
|
92
91
|
r
|
|
93
92
|
] }) : /* @__PURE__ */ e.jsx("div", { className: "w-full overflow-hidden whitespace-nowrap text-[10px] leading-3 text-gray-800/50", children: pt(t === "object" ? JSON.stringify(r) : r, { length: 40 }) });
|
|
94
|
-
},
|
|
93
|
+
}, Ie = ({
|
|
95
94
|
type: r,
|
|
96
95
|
value: o = "",
|
|
97
96
|
setValue: t,
|
|
@@ -136,12 +135,12 @@ const je = ({ data: r, fullView: o }) => {
|
|
|
136
135
|
{
|
|
137
136
|
value: p,
|
|
138
137
|
className: `cursor-pointer ${y ? "flex items-center justify-between" : "flex flex-col items-start justify-start"}`,
|
|
139
|
-
onSelect: (
|
|
140
|
-
t(xt(g, (w) => w ===
|
|
138
|
+
onSelect: (b) => {
|
|
139
|
+
t(xt(g, (w) => w === b) || null), h(!1);
|
|
141
140
|
},
|
|
142
141
|
children: [
|
|
143
142
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-x-2", children: [
|
|
144
|
-
/* @__PURE__ */ e.jsx(
|
|
143
|
+
/* @__PURE__ */ e.jsx(Tr, { className: `h-4 w-4 text-green-500 ${o === p ? "" : "opacity-0"}` }),
|
|
145
144
|
p
|
|
146
145
|
] }),
|
|
147
146
|
y ? /* @__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: Y(x(n, p, "")) }) }) : /* @__PURE__ */ e.jsx("div", { className: "pl-6", children: /* @__PURE__ */ e.jsx(je, { data: x(s, p) }) })
|
|
@@ -166,10 +165,10 @@ const je = ({ data: r, fullView: o }) => {
|
|
|
166
165
|
if (f(g))
|
|
167
166
|
return "";
|
|
168
167
|
{
|
|
169
|
-
const
|
|
170
|
-
if (ie(
|
|
168
|
+
const b = x(p === "PROP" ? n : u, g, "");
|
|
169
|
+
if (ie(b))
|
|
171
170
|
return "list";
|
|
172
|
-
const w = typeof
|
|
171
|
+
const w = typeof b;
|
|
173
172
|
return w === "string" ? "text" : w === "object" ? "model" : w;
|
|
174
173
|
}
|
|
175
174
|
},
|
|
@@ -182,7 +181,7 @@ const je = ({ data: r, fullView: o }) => {
|
|
|
182
181
|
] }),
|
|
183
182
|
/* @__PURE__ */ e.jsxs("div", { className: "relative flex flex-col gap-1", children: [
|
|
184
183
|
/* @__PURE__ */ e.jsx(
|
|
185
|
-
|
|
184
|
+
Ie,
|
|
186
185
|
{
|
|
187
186
|
type: "PROP",
|
|
188
187
|
isDisabled: !1,
|
|
@@ -200,7 +199,7 @@ const je = ({ data: r, fullView: o }) => {
|
|
|
200
199
|
),
|
|
201
200
|
/* @__PURE__ */ e.jsx("div", { className: "h-2" }),
|
|
202
201
|
/* @__PURE__ */ e.jsx(
|
|
203
|
-
|
|
202
|
+
Ie,
|
|
204
203
|
{
|
|
205
204
|
type: "PATH",
|
|
206
205
|
isDisabled: f(l),
|
|
@@ -268,7 +267,7 @@ const je = ({ data: r, fullView: o }) => {
|
|
|
268
267
|
/* @__PURE__ */ e.jsx("div", { className: "font-medium leading-5", children: r.value }),
|
|
269
268
|
/* @__PURE__ */ e.jsx(je, { data: x(l, r.value, "") }),
|
|
270
269
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center justify-end gap-x-2", children: [
|
|
271
|
-
/* @__PURE__ */ e.jsx(lt, { editMode: !0, onAddBinding: o, appliedBindings: d, item: r, children: /* @__PURE__ */ e.jsx(
|
|
270
|
+
/* @__PURE__ */ e.jsx(lt, { editMode: !0, onAddBinding: o, appliedBindings: d, item: r, children: /* @__PURE__ */ e.jsx(Sr, { 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" }) }),
|
|
272
271
|
/* @__PURE__ */ e.jsx(
|
|
273
272
|
Rr,
|
|
274
273
|
{
|
|
@@ -348,7 +347,7 @@ const je = ({ data: r, fullView: o }) => {
|
|
|
348
347
|
c && /* @__PURE__ */ e.jsx(Z, { sideOffset: -55, className: "text-[11px]", children: f(s) ? "No data provider has been set up for this page." : "Complete last added data binding to add more" })
|
|
349
348
|
] })
|
|
350
349
|
] });
|
|
351
|
-
}, Zr = () => /* @__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" }),
|
|
350
|
+
}, Zr = () => /* @__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" }), me = dt(({ properties: r, formData: o, onChange: t }) => {
|
|
352
351
|
const s = { type: "object", properties: {} }, l = {};
|
|
353
352
|
return Object.keys(r).forEach((d) => {
|
|
354
353
|
const a = r[d];
|
|
@@ -357,7 +356,7 @@ const je = ({ data: r, fullView: o }) => {
|
|
|
357
356
|
const c = d;
|
|
358
357
|
s.properties[c] = or(a), l[c] = ar(a);
|
|
359
358
|
}), /* @__PURE__ */ e.jsx(
|
|
360
|
-
|
|
359
|
+
$r,
|
|
361
360
|
{
|
|
362
361
|
widgets: {
|
|
363
362
|
binding: Zr,
|
|
@@ -371,7 +370,7 @@ const je = ({ data: r, fullView: o }) => {
|
|
|
371
370
|
omitExtraData: !1,
|
|
372
371
|
liveOmit: !1,
|
|
373
372
|
liveValidate: !1,
|
|
374
|
-
validator:
|
|
373
|
+
validator: Ir,
|
|
375
374
|
uiSchema: l,
|
|
376
375
|
schema: s,
|
|
377
376
|
formData: o,
|
|
@@ -380,20 +379,20 @@ const je = ({ data: r, fullView: o }) => {
|
|
|
380
379
|
);
|
|
381
380
|
});
|
|
382
381
|
function Wr() {
|
|
383
|
-
const r = q(), o = We(), t = pr(), s = et(r._type), l = { ...r }, [d, a] = C(l), c = ur("dataBindingSupport", !1), n = ({ formData: p },
|
|
384
|
-
if (
|
|
385
|
-
const D =
|
|
382
|
+
const r = q(), o = We(), t = pr(), s = et(r._type), l = { ...r }, [d, a] = C(l), c = ur("dataBindingSupport", !1), n = ({ formData: p }, b, w) => {
|
|
383
|
+
if (b) {
|
|
384
|
+
const D = b.replace("root.", "");
|
|
386
385
|
t([r._id], { [D]: x(p, D) }, w);
|
|
387
386
|
}
|
|
388
387
|
}, u = V(
|
|
389
|
-
gt(({ formData: p },
|
|
390
|
-
n({ formData: p },
|
|
388
|
+
gt(({ formData: p }, b, w) => {
|
|
389
|
+
n({ formData: p }, b, w), a(p);
|
|
391
390
|
}, 1500),
|
|
392
391
|
[]
|
|
393
|
-
), y = ({ formData: p },
|
|
394
|
-
if (
|
|
395
|
-
const w =
|
|
396
|
-
o([r._id], { [w]: x(p, w) }), u({ formData: p },
|
|
392
|
+
), y = ({ formData: p }, b) => {
|
|
393
|
+
if (b) {
|
|
394
|
+
const w = b.replace("root.", "");
|
|
395
|
+
o([r._id], { [w]: x(p, w) }), u({ formData: p }, b, { [w]: x(d, w) });
|
|
397
396
|
}
|
|
398
397
|
}, i = {
|
|
399
398
|
_name: _r({
|
|
@@ -402,10 +401,10 @@ function Wr() {
|
|
|
402
401
|
})
|
|
403
402
|
}, h = ht(x(l, "_bindings", {})), g = _(() => {
|
|
404
403
|
const p = yt(x(s, "props", {}));
|
|
405
|
-
return c &&
|
|
404
|
+
return c && mt(h, (b) => delete p[b]), p;
|
|
406
405
|
}, [s, h, c]);
|
|
407
406
|
return /* @__PURE__ */ e.jsxs("div", { className: "overflow-x-hidden", children: [
|
|
408
|
-
/* @__PURE__ */ e.jsx(
|
|
407
|
+
/* @__PURE__ */ e.jsx(me, { onChange: y, formData: l, properties: i }),
|
|
409
408
|
/* @__PURE__ */ e.jsx("hr", { className: "mt-4" }),
|
|
410
409
|
c ? /* @__PURE__ */ e.jsxs(Ue, { type: "multiple", defaultValue: ["STATIC", "BINDING"], className: "h-full w-full", children: [
|
|
411
410
|
/* @__PURE__ */ e.jsxs(de, { value: "BINDING", children: [
|
|
@@ -436,19 +435,19 @@ function Wr() {
|
|
|
436
435
|
/* @__PURE__ */ e.jsxs(pe, { className: "pt-4", children: [
|
|
437
436
|
f(h) ? null : /* @__PURE__ */ e.jsxs("div", { className: "mx-4 mb-1 mt-0 rounded-sm border border-orange-500 bg-orange-100 p-1 text-xs text-orange-500", children: [
|
|
438
437
|
"Data binding is set for ",
|
|
439
|
-
/* @__PURE__ */ e.jsx("b", { children: k(h,
|
|
438
|
+
/* @__PURE__ */ e.jsx("b", { children: k(h, bt).join(", ") }),
|
|
440
439
|
" ",
|
|
441
440
|
h.length === 1 ? "property" : "properties",
|
|
442
441
|
". Remove data binding to edit static content."
|
|
443
442
|
] }),
|
|
444
|
-
/* @__PURE__ */ e.jsx(
|
|
443
|
+
/* @__PURE__ */ e.jsx(me, { onChange: y, formData: l, properties: g })
|
|
445
444
|
] })
|
|
446
445
|
] })
|
|
447
|
-
] }) : /* @__PURE__ */ e.jsx(
|
|
446
|
+
] }) : /* @__PURE__ */ e.jsx(me, { onChange: y, formData: l, properties: g }),
|
|
448
447
|
/* @__PURE__ */ e.jsx("div", { className: "pb-60" })
|
|
449
448
|
] });
|
|
450
449
|
}
|
|
451
|
-
const
|
|
450
|
+
const Pe = new Er(Lr, {
|
|
452
451
|
isCaseSensitive: !1,
|
|
453
452
|
threshold: 0.2,
|
|
454
453
|
minMatchCharLength: 2,
|
|
@@ -456,24 +455,24 @@ const $e = new Er(Lr, {
|
|
|
456
455
|
});
|
|
457
456
|
function Ur() {
|
|
458
457
|
var D;
|
|
459
|
-
const [r] =
|
|
458
|
+
const [r] = Te(), o = q(), t = Ke(), s = qe(), [l] = Ge(), [d, a] = C(""), c = (D = ue(r)) == null ? void 0 : D.prop, n = ft((x(o, c, "").replace(Or, "").split(",").pop() || "").split(" "), f), u = () => {
|
|
460
459
|
const j = d.trim().toLowerCase().replace(/ +(?= )/g, "").split(" ");
|
|
461
460
|
t(l, j, !0), a("");
|
|
462
461
|
}, [y, i] = C([]), h = ({ value: j }) => {
|
|
463
|
-
const
|
|
462
|
+
const I = j.trim().toLowerCase(), L = I.match(/.+:/g);
|
|
464
463
|
let N = [];
|
|
465
464
|
if (L && L.length > 0) {
|
|
466
|
-
const [
|
|
467
|
-
N =
|
|
468
|
-
...
|
|
469
|
-
item: { ...
|
|
465
|
+
const [$] = L, F = I.replace($, "");
|
|
466
|
+
N = Pe.search(F).map((m) => ({
|
|
467
|
+
...m,
|
|
468
|
+
item: { ...m.item, name: $ + m.item.name }
|
|
470
469
|
}));
|
|
471
470
|
} else
|
|
472
|
-
N =
|
|
471
|
+
N = Pe.search(I);
|
|
473
472
|
i(k(N, "item"));
|
|
474
473
|
}, g = () => {
|
|
475
474
|
i([]);
|
|
476
|
-
}, p = (j) => j.name,
|
|
475
|
+
}, p = (j) => j.name, b = (j) => /* @__PURE__ */ e.jsx("div", { className: "rounded-md p-1", children: j.name }), w = {
|
|
477
476
|
autoComplete: "off",
|
|
478
477
|
autoCorrect: "off",
|
|
479
478
|
autoCapitalize: "off",
|
|
@@ -483,7 +482,7 @@ function Ur() {
|
|
|
483
482
|
onKeyDown: (j) => {
|
|
484
483
|
j.key === "Enter" && d.trim() !== "" && u();
|
|
485
484
|
},
|
|
486
|
-
onChange: (j, { newValue:
|
|
485
|
+
onChange: (j, { newValue: I }) => a(I),
|
|
487
486
|
className: "w-full rounded-md text-xs px-2 hover:outline-0 bg-background border-border py-1"
|
|
488
487
|
};
|
|
489
488
|
return /* @__PURE__ */ e.jsxs(
|
|
@@ -491,7 +490,7 @@ function Ur() {
|
|
|
491
490
|
{
|
|
492
491
|
className: `no-scrollbar flex ${y.length > 0 ? "min-h-[300px]" : "min-h-max"} w-full flex-col gap-y-5 overflow-y-auto bg-gray-100 px-px`,
|
|
493
492
|
children: [
|
|
494
|
-
/* @__PURE__ */ e.jsx(
|
|
493
|
+
/* @__PURE__ */ e.jsx(Se, { className: "mt-2", children: "Add Tailwind classes" }),
|
|
495
494
|
/* @__PURE__ */ e.jsxs("div", { className: "relative -mt-4 flex items-center gap-x-3", children: [
|
|
496
495
|
/* @__PURE__ */ e.jsx("div", { className: "relative flex w-full items-center gap-x-3", children: /* @__PURE__ */ e.jsx(
|
|
497
496
|
Ar,
|
|
@@ -500,7 +499,7 @@ function Ur() {
|
|
|
500
499
|
onSuggestionsFetchRequested: h,
|
|
501
500
|
onSuggestionsClearRequested: g,
|
|
502
501
|
getSuggestionValue: p,
|
|
503
|
-
renderSuggestion:
|
|
502
|
+
renderSuggestion: b,
|
|
504
503
|
inputProps: w,
|
|
505
504
|
containerProps: {
|
|
506
505
|
className: "relative h-8 w-full gap-y-1 py-1 border-gray-600"
|
|
@@ -982,32 +981,32 @@ const B = ["px", "%", "em", "rem", "ch", "vh", "vw"], Kr = {
|
|
|
982
981
|
// display
|
|
983
982
|
hidden: He,
|
|
984
983
|
gap: A,
|
|
985
|
-
gapX:
|
|
984
|
+
gapX: S,
|
|
986
985
|
gapY: R,
|
|
987
|
-
spaceX:
|
|
986
|
+
spaceX: S,
|
|
988
987
|
spaceY: R,
|
|
989
988
|
overscroll: A,
|
|
990
|
-
overscrollX:
|
|
989
|
+
overscrollX: S,
|
|
991
990
|
overscrollY: R,
|
|
992
991
|
overflow: A,
|
|
993
|
-
overflowX:
|
|
992
|
+
overflowX: S,
|
|
994
993
|
overflowY: R,
|
|
995
994
|
top: Q,
|
|
996
995
|
right: ee,
|
|
997
996
|
bottom: te,
|
|
998
997
|
left: re,
|
|
999
998
|
inset: A,
|
|
1000
|
-
insetX:
|
|
999
|
+
insetX: S,
|
|
1001
1000
|
insetY: R,
|
|
1002
1001
|
border: A,
|
|
1003
|
-
borderX:
|
|
1002
|
+
borderX: S,
|
|
1004
1003
|
borderY: R,
|
|
1005
1004
|
borderTop: Q,
|
|
1006
1005
|
borderRight: ee,
|
|
1007
1006
|
borderBottom: te,
|
|
1008
1007
|
borderLeft: re,
|
|
1009
1008
|
borderRadius: A,
|
|
1010
|
-
borderRadiusX:
|
|
1009
|
+
borderRadiusX: S,
|
|
1011
1010
|
borderRadiusY: R,
|
|
1012
1011
|
borderRadiusTop: Q,
|
|
1013
1012
|
borderRadiusRight: ee,
|
|
@@ -1015,20 +1014,20 @@ const B = ["px", "%", "em", "rem", "ch", "vh", "vw"], Kr = {
|
|
|
1015
1014
|
borderRadiusLeft: re,
|
|
1016
1015
|
borderRadiusTopLeft: Nt,
|
|
1017
1016
|
borderRadiusTopRight: _t,
|
|
1018
|
-
borderRadiusBottomRight:
|
|
1019
|
-
borderRadiusBottomLeft:
|
|
1020
|
-
divideXWidth:
|
|
1017
|
+
borderRadiusBottomRight: Tt,
|
|
1018
|
+
borderRadiusBottomLeft: St,
|
|
1019
|
+
divideXWidth: S,
|
|
1021
1020
|
divideYWidth: R,
|
|
1022
1021
|
scale: A,
|
|
1023
|
-
scaleX:
|
|
1022
|
+
scaleX: S,
|
|
1024
1023
|
scaleY: R,
|
|
1025
|
-
skewX:
|
|
1024
|
+
skewX: S,
|
|
1026
1025
|
skewY: R,
|
|
1027
|
-
translateX:
|
|
1026
|
+
translateX: S,
|
|
1028
1027
|
translateY: R,
|
|
1029
1028
|
// padding
|
|
1030
1029
|
padding: A,
|
|
1031
|
-
paddingX:
|
|
1030
|
+
paddingX: S,
|
|
1032
1031
|
paddingY: R,
|
|
1033
1032
|
paddingTop: Q,
|
|
1034
1033
|
paddingRight: ee,
|
|
@@ -1036,7 +1035,7 @@ const B = ["px", "%", "em", "rem", "ch", "vh", "vw"], Kr = {
|
|
|
1036
1035
|
paddingLeft: re,
|
|
1037
1036
|
// margin
|
|
1038
1037
|
margin: A,
|
|
1039
|
-
marginX:
|
|
1038
|
+
marginX: S,
|
|
1040
1039
|
marginY: R,
|
|
1041
1040
|
marginTop: Q,
|
|
1042
1041
|
marginRight: ee,
|
|
@@ -1051,10 +1050,10 @@ const B = ["px", "%", "em", "rem", "ch", "vh", "vw"], Kr = {
|
|
|
1051
1050
|
italic: Dt,
|
|
1052
1051
|
// "not-italic": "",
|
|
1053
1052
|
// decoration
|
|
1054
|
-
underline:
|
|
1055
|
-
overline:
|
|
1053
|
+
underline: $t,
|
|
1054
|
+
overline: It,
|
|
1056
1055
|
// transform
|
|
1057
|
-
uppercase:
|
|
1056
|
+
uppercase: Pt,
|
|
1058
1057
|
block: () => /* @__PURE__ */ e.jsxs("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [
|
|
1059
1058
|
/* @__PURE__ */ e.jsx(
|
|
1060
1059
|
"path",
|
|
@@ -1204,7 +1203,7 @@ function Ce({ selected: r, onChange: o, rounded: t = !1, options: s, disabled: l
|
|
|
1204
1203
|
value: d,
|
|
1205
1204
|
children: [
|
|
1206
1205
|
/* @__PURE__ */ e.jsx("option", { className: "bg-transparent", value: "" }),
|
|
1207
|
-
|
|
1206
|
+
P.Children.toArray(
|
|
1208
1207
|
s.map((n) => /* @__PURE__ */ e.jsx("option", { className: "bg-transparent", value: n, children: n }))
|
|
1209
1208
|
)
|
|
1210
1209
|
]
|
|
@@ -1256,7 +1255,7 @@ const Qr = ({ property: r, onChange: o }) => {
|
|
|
1256
1255
|
disabled: !s,
|
|
1257
1256
|
onClick: () => o(a, r),
|
|
1258
1257
|
className: `cursor-pointer rounded border border-gray-600 p-1 disabled:cursor-not-allowed ${d === a ? " bg-blue-500 text-white" : "disabled:bg-gray-600 disabled:text-gray-400"}`,
|
|
1259
|
-
children:
|
|
1258
|
+
children: P.createElement(x(st, a, ze))
|
|
1260
1259
|
}
|
|
1261
1260
|
) }),
|
|
1262
1261
|
/* @__PURE__ */ e.jsx(Z, { children: Y(le(a)) })
|
|
@@ -1277,7 +1276,7 @@ const Qr = ({ property: r, onChange: o }) => {
|
|
|
1277
1276
|
const t = ae(r), s = _(() => x(t, "cls", ""), [t]), { canChange: l } = se(oe), [d, a] = C([]), [c, n] = C({ color: "", shade: "" }), u = s.split("-"), y = x(u, "1", ""), i = x(u, "2", ""), h = V(
|
|
1278
1277
|
// eslint-disable-next-line no-shadow
|
|
1279
1278
|
(p) => {
|
|
1280
|
-
["current", "inherit", "transparent", "black", "white"].includes(p) ? (a([]), n({ color: p })) : (a(["50", "100", "200", "300", "400", "500", "600", "700", "800", "900"]), n((
|
|
1279
|
+
["current", "inherit", "transparent", "black", "white"].includes(p) ? (a([]), n({ color: p })) : (a(["50", "100", "200", "300", "400", "500", "600", "700", "800", "900"]), n((b) => ({ ...b, color: p, shade: b.shade ? b.shade : "500" })));
|
|
1281
1280
|
},
|
|
1282
1281
|
[a, n]
|
|
1283
1282
|
);
|
|
@@ -1296,8 +1295,8 @@ const Qr = ({ property: r, onChange: o }) => {
|
|
|
1296
1295
|
return O(() => {
|
|
1297
1296
|
n({ color: "", shade: "" });
|
|
1298
1297
|
}, [t]), O(() => {
|
|
1299
|
-
const
|
|
1300
|
-
|
|
1298
|
+
const b = `${x(tl, r, "")}-${c.color}${c.shade ? `-${c.shade}` : ""}`;
|
|
1299
|
+
b.match(new RegExp(x(he, `${r}.regExp`, ""))) && o(b, r);
|
|
1301
1300
|
}, [c, o, r]), /* @__PURE__ */ e.jsxs("div", { className: "flex flex-row divide-x divide-solid divide-border rounded-lg border border-border text-xs", children: [
|
|
1302
1301
|
/* @__PURE__ */ e.jsx("div", { className: "grow text-center", children: /* @__PURE__ */ e.jsx(
|
|
1303
1302
|
Ce,
|
|
@@ -1487,7 +1486,7 @@ const sl = (r) => {
|
|
|
1487
1486
|
return ol(r);
|
|
1488
1487
|
const t = x(o, "0", "").replace(/\[|\]/g, ""), s = r.startsWith("-") ? "-" : "", l = ue(t.match(/\d+.\d+|\d+/g));
|
|
1489
1488
|
return { value: `${s}${l}`, unit: t.replace(l, "") };
|
|
1490
|
-
}, ol = (r) => f(r) ? { value: "", unit: "" } : ll(r), at =
|
|
1489
|
+
}, ol = (r) => f(r) ? { value: "", unit: "" } : ll(r), at = P.createContext({
|
|
1491
1490
|
setDragData: () => {
|
|
1492
1491
|
}
|
|
1493
1492
|
}), al = ({
|
|
@@ -1535,47 +1534,47 @@ const sl = (r) => {
|
|
|
1535
1534
|
},
|
|
1536
1535
|
s
|
|
1537
1536
|
)) }), Ee = 50, il = (r) => {
|
|
1538
|
-
const [o, t] = C(!1), [s, l] = C(""), { currentClass: d, onChange: a, classPrefix: c, cssProperty: n, units: u, negative: y } = r, [i, h] = C(n != null && n.toLowerCase().includes("width") ? "%" : u[0]), [g, p] = C(!1), [
|
|
1537
|
+
const [o, t] = C(!1), [s, l] = C(""), { currentClass: d, onChange: a, classPrefix: c, cssProperty: n, units: u, negative: y } = r, [i, h] = C(n != null && n.toLowerCase().includes("width") ? "%" : u[0]), [g, p] = C(!1), [b, w] = C(""), [D, j] = C(!1), [I, L] = C(!1);
|
|
1539
1538
|
O(() => {
|
|
1540
|
-
const { value:
|
|
1539
|
+
const { value: m, unit: v } = sl(d);
|
|
1541
1540
|
if (v === "") {
|
|
1542
|
-
l(
|
|
1541
|
+
l(m), h(n != null && n.toLowerCase().includes("width") ? "%" : ue(u));
|
|
1543
1542
|
return;
|
|
1544
1543
|
}
|
|
1545
|
-
h(v), l(v === "class" || f(
|
|
1544
|
+
h(v), l(v === "class" || f(m) ? "" : m);
|
|
1546
1545
|
}, [d, n, u]);
|
|
1547
|
-
const N = fe((
|
|
1548
|
-
(
|
|
1546
|
+
const N = fe((m) => a(m), [a], Ee), $ = fe((m) => a(m, !1), [a], Ee), F = V(
|
|
1547
|
+
(m = !1) => {
|
|
1549
1548
|
const v = Ae(`${s}`, u);
|
|
1550
1549
|
if (x(v, "error", !1)) {
|
|
1551
1550
|
p(!0);
|
|
1552
1551
|
return;
|
|
1553
1552
|
}
|
|
1554
|
-
const
|
|
1555
|
-
if (
|
|
1556
|
-
N(`${c}${
|
|
1553
|
+
const T = x(v, "unit") !== "" ? x(v, "unit") : i;
|
|
1554
|
+
if (T === "auto" || T === "none") {
|
|
1555
|
+
N(`${c}${T}`);
|
|
1557
1556
|
return;
|
|
1558
1557
|
}
|
|
1559
1558
|
if (x(v, "value") === "")
|
|
1560
1559
|
return;
|
|
1561
|
-
const J = `${x(v, "value", "").startsWith("-") ? "-" : ""}${c}[${x(v, "value", "").replace("-", "")}${
|
|
1562
|
-
|
|
1560
|
+
const J = `${x(v, "value", "").startsWith("-") ? "-" : ""}${c}[${x(v, "value", "").replace("-", "")}${T === "-" ? "" : T}]`;
|
|
1561
|
+
m ? $(J) : N(J);
|
|
1563
1562
|
},
|
|
1564
|
-
[N,
|
|
1563
|
+
[N, $, s, i, c, u]
|
|
1565
1564
|
), G = V(
|
|
1566
|
-
(
|
|
1565
|
+
(m) => {
|
|
1567
1566
|
const v = Ae(`${s}`, u);
|
|
1568
1567
|
if (x(v, "error", !1)) {
|
|
1569
1568
|
p(!0);
|
|
1570
1569
|
return;
|
|
1571
1570
|
}
|
|
1572
|
-
if (
|
|
1573
|
-
N(`${c}${
|
|
1571
|
+
if (m === "auto" || m === "none") {
|
|
1572
|
+
N(`${c}${m}`);
|
|
1574
1573
|
return;
|
|
1575
1574
|
}
|
|
1576
1575
|
if (x(v, "value") === "")
|
|
1577
1576
|
return;
|
|
1578
|
-
const
|
|
1577
|
+
const T = x(v, "unit") !== "" ? x(v, "unit") : m, J = `${x(v, "value", "").startsWith("-") ? "-" : ""}${c}[${x(v, "value", "").replace("-", "")}${T === "-" ? "" : T}]`;
|
|
1579
1578
|
N(J);
|
|
1580
1579
|
},
|
|
1581
1580
|
[N, s, c, u]
|
|
@@ -1592,31 +1591,31 @@ const sl = (r) => {
|
|
|
1592
1591
|
"input",
|
|
1593
1592
|
{
|
|
1594
1593
|
readOnly: i === "class",
|
|
1595
|
-
onKeyPress: (
|
|
1596
|
-
|
|
1594
|
+
onKeyPress: (m) => {
|
|
1595
|
+
m.key === "Enter" && F();
|
|
1597
1596
|
},
|
|
1598
|
-
onKeyDown: (
|
|
1599
|
-
if (
|
|
1597
|
+
onKeyDown: (m) => {
|
|
1598
|
+
if (m.keyCode !== 38 && m.keyCode !== 40)
|
|
1600
1599
|
return;
|
|
1601
|
-
|
|
1602
|
-
const v = wt(
|
|
1603
|
-
let
|
|
1604
|
-
|
|
1605
|
-
const M = `${
|
|
1606
|
-
|
|
1600
|
+
m.preventDefault(), L(!0);
|
|
1601
|
+
const v = wt(m.target.value);
|
|
1602
|
+
let T = Fe(v) ? 0 : v;
|
|
1603
|
+
m.keyCode === 38 && (T += 1), m.keyCode === 40 && (T -= 1);
|
|
1604
|
+
const M = `${T}`, it = `${M.startsWith("-") ? "-" : ""}${c}[${M.replace("-", "")}${i === "-" ? "" : i}]`;
|
|
1605
|
+
$(it);
|
|
1607
1606
|
},
|
|
1608
|
-
onKeyUp: (
|
|
1609
|
-
|
|
1607
|
+
onKeyUp: (m) => {
|
|
1608
|
+
I && (m.preventDefault(), L(!1));
|
|
1610
1609
|
},
|
|
1611
1610
|
onBlur: () => F(),
|
|
1612
|
-
onChange: (
|
|
1613
|
-
p(!1), l(
|
|
1611
|
+
onChange: (m) => {
|
|
1612
|
+
p(!1), l(m.target.value);
|
|
1614
1613
|
},
|
|
1615
|
-
onClick: (
|
|
1614
|
+
onClick: (m) => {
|
|
1616
1615
|
var v;
|
|
1617
|
-
(v =
|
|
1616
|
+
(v = m == null ? void 0 : m.target) == null || v.select(), t(!1);
|
|
1618
1617
|
},
|
|
1619
|
-
value: D ?
|
|
1618
|
+
value: D ? b : s,
|
|
1620
1619
|
className: "h-6 w-14 rounded rounded-r-none bg-background pl-2 text-sm focus-visible:outline-0 ".concat(
|
|
1621
1620
|
" ",
|
|
1622
1621
|
g ? "border-red-500 text-red-500" : "border-foreground/20"
|
|
@@ -1641,8 +1640,8 @@ const sl = (r) => {
|
|
|
1641
1640
|
{
|
|
1642
1641
|
units: u,
|
|
1643
1642
|
current: i,
|
|
1644
|
-
onSelect: (
|
|
1645
|
-
t(!1), h(
|
|
1643
|
+
onSelect: (m) => {
|
|
1644
|
+
t(!1), h(m), G(m);
|
|
1646
1645
|
}
|
|
1647
1646
|
}
|
|
1648
1647
|
) }) })
|
|
@@ -1652,18 +1651,18 @@ const sl = (r) => {
|
|
|
1652
1651
|
al,
|
|
1653
1652
|
{
|
|
1654
1653
|
onDragStart: () => j(!0),
|
|
1655
|
-
onDragEnd: (
|
|
1656
|
-
if (w(() => ""), j(!1), f(
|
|
1654
|
+
onDragEnd: (m) => {
|
|
1655
|
+
if (w(() => ""), j(!1), f(m))
|
|
1657
1656
|
return;
|
|
1658
|
-
const v = `${
|
|
1657
|
+
const v = `${m}`, M = `${v.startsWith("-") ? "-" : ""}${c}[${v.replace("-", "")}${i === "-" ? "" : i}]`;
|
|
1659
1658
|
N(M);
|
|
1660
1659
|
},
|
|
1661
|
-
onDrag: (
|
|
1662
|
-
if (f(
|
|
1660
|
+
onDrag: (m) => {
|
|
1661
|
+
if (f(m))
|
|
1663
1662
|
return;
|
|
1664
|
-
w(
|
|
1665
|
-
const v = `${
|
|
1666
|
-
|
|
1663
|
+
w(m);
|
|
1664
|
+
const v = `${m}`, M = `${v.startsWith("-") ? "-" : ""}${c}[${v.replace("-", "")}${i === "-" ? "" : i}]`;
|
|
1665
|
+
$(M);
|
|
1667
1666
|
},
|
|
1668
1667
|
currentValue: s,
|
|
1669
1668
|
unit: i,
|
|
@@ -1760,32 +1759,32 @@ const sl = (r) => {
|
|
|
1760
1759
|
"2xl": "1536px"
|
|
1761
1760
|
}, pl = (r) => `${r.toUpperCase()} ${Le[r] ? `(${Le[r]} & up)` : ""}`, Re = (r) => {
|
|
1762
1761
|
const { t: o } = K(), { type: t = "icons", label: s, property: l, onEmitChange: d = () => {
|
|
1763
|
-
}, units: a, negative: c = !1 } = r, [n] = yr(), [u] = Je(), [, y] = Be(), i = ae(l), h = Ke(), g = qe(), [p] = Ge(),
|
|
1764
|
-
(
|
|
1765
|
-
const G = { dark: n, mq: y, mod: u, cls:
|
|
1762
|
+
}, units: a, negative: c = !1 } = r, [n] = yr(), [u] = Je(), [, y] = Be(), i = ae(l), h = Ke(), g = qe(), [p] = Ge(), b = _(() => x(i, "fullCls", ""), [i]), w = V(
|
|
1763
|
+
($, F = !0) => {
|
|
1764
|
+
const G = { dark: n, mq: y, mod: u, cls: $, property: l, fullCls: "" };
|
|
1766
1765
|
(n || u !== "") && (G.mq = "xs");
|
|
1767
|
-
const
|
|
1768
|
-
h(p, [
|
|
1766
|
+
const m = Mr(G);
|
|
1767
|
+
h(p, [m], F);
|
|
1769
1768
|
},
|
|
1770
1769
|
[p, n, y, u, l, h]
|
|
1771
1770
|
), D = V(() => {
|
|
1772
|
-
g(p, [
|
|
1773
|
-
}, [p,
|
|
1771
|
+
g(p, [b]);
|
|
1772
|
+
}, [p, b, g]), j = _(() => dl(i, y), [i, y]);
|
|
1774
1773
|
O(() => {
|
|
1775
1774
|
d(j, i);
|
|
1776
1775
|
}, [j, d, i]);
|
|
1777
|
-
const [, ,
|
|
1778
|
-
(
|
|
1779
|
-
|
|
1776
|
+
const [, , I] = Be(), L = V(
|
|
1777
|
+
($) => {
|
|
1778
|
+
I({
|
|
1780
1779
|
xs: 400,
|
|
1781
1780
|
sm: 640,
|
|
1782
1781
|
md: 800,
|
|
1783
1782
|
lg: 1024,
|
|
1784
1783
|
xl: 1420,
|
|
1785
1784
|
"2xl": 1920
|
|
1786
|
-
}[
|
|
1785
|
+
}[$]);
|
|
1787
1786
|
},
|
|
1788
|
-
[
|
|
1787
|
+
[I]
|
|
1789
1788
|
), N = x(i, "dark", null) === n && x(i, "mod", null) === u && x(i, "mq", null) === y;
|
|
1790
1789
|
return /* @__PURE__ */ e.jsx(Jr, { canChange: j, canReset: i && N, children: /* @__PURE__ */ e.jsxs("div", { className: "group flex flex-row items-center py-2 first:pt-0 last:pb-0", children: [
|
|
1791
1790
|
/* @__PURE__ */ e.jsx("div", { className: "relative w-[70px] truncate text-xs text-foreground", children: /* @__PURE__ */ e.jsx("span", { className: `text-[11px] ${i && !N ? "text-foreground" : ""}`, children: o(s) }) }),
|
|
@@ -1807,7 +1806,7 @@ const sl = (r) => {
|
|
|
1807
1806
|
t === "color" && /* @__PURE__ */ e.jsx(rl, { property: l, onChange: w }),
|
|
1808
1807
|
t === "dropdown" && /* @__PURE__ */ e.jsx(ot, { label: s, property: l, onChange: w })
|
|
1809
1808
|
] }),
|
|
1810
|
-
/* @__PURE__ */ e.jsx("div", { className: `w-[30px] cursor-pointer ${
|
|
1809
|
+
/* @__PURE__ */ e.jsx("div", { className: `w-[30px] cursor-pointer ${b ? "visible" : "invisible"}`, children: N ? /* @__PURE__ */ e.jsx("button", { type: "button", onClick: () => D(), title: "Reset", className: "flex px-1.5 text-xs", children: /* @__PURE__ */ e.jsx(Ot, { className: "h-5 w-5 text-blue-500 hover:opacity-80" }) }) : j && i ? /* @__PURE__ */ e.jsxs(X, { delayDuration: 100, children: [
|
|
1811
1810
|
/* @__PURE__ */ e.jsx(z, { asChild: !0, children: /* @__PURE__ */ e.jsx(
|
|
1812
1811
|
"button",
|
|
1813
1812
|
{
|
|
@@ -1856,7 +1855,7 @@ const sl = (r) => {
|
|
|
1856
1855
|
children: [
|
|
1857
1856
|
/* @__PURE__ */ e.jsxs("div", { className: "flex flex-row text-xs", children: [
|
|
1858
1857
|
r && /* @__PURE__ */ e.jsx("span", { className: "relative w-[70px] flex-none text-xs text-foreground", children: c(r) }),
|
|
1859
|
-
/* @__PURE__ */ e.jsx("div", { className: "mb-3 flex grow flex-row flex-wrap gap-x-px", children:
|
|
1858
|
+
/* @__PURE__ */ e.jsx("div", { className: "mb-3 flex grow flex-row flex-wrap gap-x-px", children: P.Children.toArray(
|
|
1860
1859
|
o.map(({ label: h, key: g }) => /* @__PURE__ */ e.jsx("div", { className: "first:rounded-l last:rounded-r", children: /* @__PURE__ */ e.jsxs(X, { children: [
|
|
1861
1860
|
/* @__PURE__ */ e.jsx(z, { asChild: !0, children: /* @__PURE__ */ e.jsxs(
|
|
1862
1861
|
"button",
|
|
@@ -1865,10 +1864,10 @@ const sl = (r) => {
|
|
|
1865
1864
|
onClick: () => u(g),
|
|
1866
1865
|
className: `relative cursor-pointer rounded-full p-1 text-[8px] ${g === n ? " bg-[#3E57F0] text-white" : "text-gray-600 dark:text-gray-300"}`,
|
|
1867
1866
|
children: [
|
|
1868
|
-
|
|
1867
|
+
P.createElement("div", {
|
|
1869
1868
|
className: i(g) ? "-bottom-1.5 absolute bg-[#3E57F0] h-[2px] left-0 w-full" : ""
|
|
1870
1869
|
}),
|
|
1871
|
-
|
|
1870
|
+
P.createElement(x(st, g, ze), { className: "text-inherit w-3 h-3" })
|
|
1872
1871
|
]
|
|
1873
1872
|
}
|
|
1874
1873
|
) }),
|
|
@@ -1910,7 +1909,7 @@ const sl = (r) => {
|
|
|
1910
1909
|
] }) }),
|
|
1911
1910
|
/* @__PURE__ */ e.jsx("div", { className: "p-2", children: o.map((d) => d.styleType === "multiple" ? /* @__PURE__ */ e.jsx(nt, { ...d }, d.label) : /* @__PURE__ */ e.jsx(Re, { ...d }, d.label)) })
|
|
1912
1911
|
] });
|
|
1913
|
-
}, gl = Me({}),
|
|
1912
|
+
}, gl = Me({}), be = ({ section: r }) => {
|
|
1914
1913
|
const { t: o } = K(), t = ge(), s = V(
|
|
1915
1914
|
(a = []) => {
|
|
1916
1915
|
const c = {};
|
|
@@ -1940,8 +1939,8 @@ const sl = (r) => {
|
|
|
1940
1939
|
/* @__PURE__ */ e.jsx("div", { className: `h-[8px] w-[8px] rounded-full ${l ? "bg-blue-500" : "bg-gray-300"}` }),
|
|
1941
1940
|
o(r.heading)
|
|
1942
1941
|
] }) }),
|
|
1943
|
-
/* @__PURE__ */ e.jsx(pe, { className: "bg-gray-100 px-3.5 py-2", children:
|
|
1944
|
-
r.items.map((a) => ye(a, "component") ?
|
|
1942
|
+
/* @__PURE__ */ e.jsx(pe, { className: "bg-gray-100 px-3.5 py-2", children: P.Children.toArray(
|
|
1943
|
+
r.items.map((a) => ye(a, "component") ? P.createElement(a.component, { key: a.label }) : ye(a, "styleType") ? a.styleType === "multiple" ? /* @__PURE__ */ e.jsx(nt, { ...a }, a.label) : a.styleType === "accordion" && s(a == null ? void 0 : a.conditions) ? /* @__PURE__ */ e.jsx(xl, { ...a }, a.label) : null : /* @__PURE__ */ e.jsx(Re, { ...a }, a.label))
|
|
1945
1944
|
) })
|
|
1946
1945
|
] }) });
|
|
1947
1946
|
}, hl = ({
|
|
@@ -1986,22 +1985,22 @@ const sl = (r) => {
|
|
|
1986
1985
|
] })
|
|
1987
1986
|
] }), yl = ({ section: r }) => {
|
|
1988
1987
|
var h;
|
|
1989
|
-
const { setSyncState: o } =
|
|
1988
|
+
const { setSyncState: o } = mr(), t = q(), [s, l] = C([]), [d] = Te(), a = We(), c = `${x(d, "0.prop")}_attrs`;
|
|
1990
1989
|
ne.useEffect(() => {
|
|
1991
|
-
const g = k(x(t, c), (p,
|
|
1990
|
+
const g = k(x(t, c), (p, b) => ({ key: b, value: p }));
|
|
1992
1991
|
f(g) ? l([]) : l(g);
|
|
1993
1992
|
}, [x(t, c)]);
|
|
1994
1993
|
const n = () => l([...s, { key: "", value: "" }]), u = (g) => {
|
|
1995
|
-
const p = we(s, (
|
|
1994
|
+
const p = we(s, (b, w) => g !== w);
|
|
1996
1995
|
i(p);
|
|
1997
1996
|
}, y = (g, p) => {
|
|
1998
|
-
const
|
|
1999
|
-
|
|
1997
|
+
const b = [...s];
|
|
1998
|
+
b[p][g.target.name] = g.target.value, i(b);
|
|
2000
1999
|
}, i = ne.useCallback(
|
|
2001
2000
|
(g = []) => {
|
|
2002
2001
|
const p = {};
|
|
2003
|
-
ke(g, (
|
|
2004
|
-
f(
|
|
2002
|
+
ke(g, (b) => {
|
|
2003
|
+
f(b.key) || Oe(p, b.key, b.value);
|
|
2005
2004
|
}), a([x(t, "_id")], { [c]: p }), o("UNSAVED");
|
|
2006
2005
|
},
|
|
2007
2006
|
[t, o, a, c]
|
|
@@ -2017,7 +2016,7 @@ const sl = (r) => {
|
|
|
2017
2016
|
"Attributes"
|
|
2018
2017
|
] }) }),
|
|
2019
2018
|
/* @__PURE__ */ e.jsx(pe, { className: "bg-gray-100 px-3.5 py-2", children: /* @__PURE__ */ e.jsxs("div", { className: "no-scrollbar flex min-h-max flex-col gap-y-2 overflow-y-auto bg-gray-100 p-px", children: [
|
|
2020
|
-
/* @__PURE__ */ e.jsxs(
|
|
2019
|
+
/* @__PURE__ */ e.jsxs(Se, { className: "mt-2 flex w-full items-center justify-between", children: [
|
|
2021
2020
|
"Add Custom attributes",
|
|
2022
2021
|
/* @__PURE__ */ e.jsxs(
|
|
2023
2022
|
"div",
|
|
@@ -2038,13 +2037,13 @@ const sl = (r) => {
|
|
|
2038
2037
|
f(s) && /* @__PURE__ */ e.jsx("div", { className: "flex h-12 items-center justify-center text-sm text-gray-400", children: "Click + Add to add attributes" }),
|
|
2039
2038
|
ne.Children.toArray(
|
|
2040
2039
|
k(s, (g, p) => {
|
|
2041
|
-
const
|
|
2040
|
+
const b = s.length > 0 && p < s.length - 1;
|
|
2042
2041
|
return /* @__PURE__ */ e.jsx(
|
|
2043
2042
|
hl,
|
|
2044
2043
|
{
|
|
2045
2044
|
item: g,
|
|
2046
2045
|
index: p,
|
|
2047
|
-
canDelete:
|
|
2046
|
+
canDelete: b,
|
|
2048
2047
|
onChange: y,
|
|
2049
2048
|
onRemove: () => u(p)
|
|
2050
2049
|
}
|
|
@@ -2055,8 +2054,8 @@ const sl = (r) => {
|
|
|
2055
2054
|
] }) })
|
|
2056
2055
|
] });
|
|
2057
2056
|
};
|
|
2058
|
-
function
|
|
2059
|
-
const [r, o] = Je(), { flexChild: t, gridChild: s } =
|
|
2057
|
+
function ml() {
|
|
2058
|
+
const [r, o] = Je(), { flexChild: t, gridChild: s } = br(), [, l] = Pr(fr), { t: d } = K(), [a] = Te();
|
|
2060
2059
|
return f(a) ? /* @__PURE__ */ e.jsx("div", { className: "p-4 text-center", children: /* @__PURE__ */ e.jsxs("div", { className: "space-y-4 rounded-xl p-4", children: [
|
|
2061
2060
|
/* @__PURE__ */ e.jsx(Ze, { className: "mx-auto text-3xl" }),
|
|
2062
2061
|
/* @__PURE__ */ e.jsx("h1", { children: d("no_styling_block_selected") })
|
|
@@ -2064,7 +2063,7 @@ function bl() {
|
|
|
2064
2063
|
// eslint-disable-next-line jsx-a11y/click-events-have-key-events,jsx-a11y/no-static-element-interactions
|
|
2065
2064
|
/* @__PURE__ */ e.jsxs("div", { onClick: () => l(!1), className: "flex h-full flex-col", children: [
|
|
2066
2065
|
/* @__PURE__ */ e.jsx("div", { className: "flex h-12 flex-col space-x-4 space-y-3 border-b border-border px-4 py-1", children: /* @__PURE__ */ e.jsxs("div", { className: "flex items-center justify-end gap-x-1.5", children: [
|
|
2067
|
-
/* @__PURE__ */ e.jsx(
|
|
2066
|
+
/* @__PURE__ */ e.jsx(Se, { htmlFor: "", className: "flex gap-x-1.5 text-xs italic", children: "State" }),
|
|
2068
2067
|
/* @__PURE__ */ e.jsxs(vr, { defaultValue: r, onValueChange: (c) => o(c), children: [
|
|
2069
2068
|
/* @__PURE__ */ e.jsx(wr, { className: "h-auto w-fit p-1 px-3", children: /* @__PURE__ */ e.jsx(jr, { placeholder: "State" }) }),
|
|
2070
2069
|
/* @__PURE__ */ e.jsxs(Cr, { children: [
|
|
@@ -2084,15 +2083,15 @@ function bl() {
|
|
|
2084
2083
|
] })
|
|
2085
2084
|
] }) }),
|
|
2086
2085
|
/* @__PURE__ */ e.jsx(Qe, { className: "no-scrollbar -mx-1 max-h-full flex-1 overflow-x-hidden overflow-y-hidden", children: /* @__PURE__ */ e.jsxs(Ue, { defaultValue: ["Layout"], type: "multiple", className: "w-full", children: [
|
|
2087
|
-
t && /* @__PURE__ */ e.jsx(
|
|
2088
|
-
s ? /* @__PURE__ */ e.jsx(
|
|
2089
|
-
Gr.map((c) => /* @__PURE__ */ e.jsx(
|
|
2086
|
+
t && /* @__PURE__ */ e.jsx(be, { section: Kr }),
|
|
2087
|
+
s ? /* @__PURE__ */ e.jsx(be, { section: qr }) : null,
|
|
2088
|
+
Gr.map((c) => /* @__PURE__ */ e.jsx(be, { section: c }, c.heading)),
|
|
2090
2089
|
/* @__PURE__ */ e.jsx(yl, { section: { heading: "Attributes" } })
|
|
2091
2090
|
] }) })
|
|
2092
2091
|
] })
|
|
2093
2092
|
);
|
|
2094
2093
|
}
|
|
2095
|
-
const
|
|
2094
|
+
const bl = {
|
|
2096
2095
|
px: 1,
|
|
2097
2096
|
"%": 1,
|
|
2098
2097
|
em: 100,
|
|
@@ -2103,8 +2102,8 @@ const ml = {
|
|
|
2103
2102
|
"-": 1,
|
|
2104
2103
|
deg: 1,
|
|
2105
2104
|
ms: 0.1
|
|
2106
|
-
},
|
|
2107
|
-
const r = q(), { t: o } = K(), [t, s] =
|
|
2105
|
+
}, Cs = () => {
|
|
2106
|
+
const r = q(), { t: o } = K(), [t, s] = P.useState(""), [l, d] = P.useState({
|
|
2108
2107
|
onDrag: (n) => n,
|
|
2109
2108
|
onDragEnd: (n) => n,
|
|
2110
2109
|
dragStartY: 0,
|
|
@@ -2118,7 +2117,7 @@ const ml = {
|
|
|
2118
2117
|
const u = !x(l, "negative", !1), y = x(l, "cssProperty", "");
|
|
2119
2118
|
let i = parseFloat(l.dragStartValue);
|
|
2120
2119
|
i = Fe(i) ? 0 : i;
|
|
2121
|
-
let h =
|
|
2120
|
+
let h = bl[l.dragUnit];
|
|
2122
2121
|
(W(y, "scale") || y === "opacity") && (h = 10);
|
|
2123
2122
|
let p = (l.dragStartY - n.pageY) / h + i;
|
|
2124
2123
|
u && p < 0 && (p = 0), y === "opacity" && p > 1 && (p = 1), l.onDrag(`${p}`), s(`${p}`);
|
|
@@ -2154,11 +2153,11 @@ const ml = {
|
|
|
2154
2153
|
/* @__PURE__ */ e.jsx(De, { value: "settings", children: o("settings") }),
|
|
2155
2154
|
/* @__PURE__ */ e.jsx(De, { value: "styling", children: o("styling") })
|
|
2156
2155
|
] }),
|
|
2157
|
-
/* @__PURE__ */ e.jsx(
|
|
2158
|
-
/* @__PURE__ */ e.jsx(
|
|
2156
|
+
/* @__PURE__ */ e.jsx($e, { value: "settings", className: "no-scrollbar h-full flex-1 overflow-y-auto overflow-x-hidden", children: /* @__PURE__ */ e.jsx(Qe, { className: "no-scrollbar max-h-full flex-1 overflow-x-hidden overflow-y-hidden pb-5", children: /* @__PURE__ */ e.jsx(Wr, {}) }) }),
|
|
2157
|
+
/* @__PURE__ */ e.jsx($e, { value: "styling", className: "h-full flex-1 overflow-y-auto overflow-x-hidden", children: /* @__PURE__ */ e.jsx(ml, {}) })
|
|
2159
2158
|
] })
|
|
2160
2159
|
] }) });
|
|
2161
2160
|
};
|
|
2162
2161
|
export {
|
|
2163
|
-
|
|
2162
|
+
Cs as default
|
|
2164
2163
|
};
|