@chaibuilder/sdk 1.2.52 → 1.2.55
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-GxEmM16E.js → AddBlocks-HeYXoex4.js} +2 -2
- package/dist/{AddBlocks-fozauzIV.cjs → AddBlocks-VHoZezjj.cjs} +1 -1
- package/dist/{CanvasArea-NRtblq5d.cjs → CanvasArea-137WY3Wx.cjs} +2 -2
- package/dist/{CanvasArea-rdY6SFYn.js → CanvasArea-CqILE5PR.js} +3 -3
- package/dist/{ChaiBuilderEditor-Pga_zJgw.cjs → ChaiBuilderEditor-aY8flOgX.cjs} +1 -1
- package/dist/{ChaiBuilderEditor-bNZZWYMh.js → ChaiBuilderEditor-tkzS851D.js} +2 -2
- package/dist/{CodeEditor-ye3IXW3i.cjs → CodeEditor-R2jKe97T.cjs} +1 -1
- package/dist/{CodeEditor-tqtgia3I.js → CodeEditor-kxV5RCpd.js} +1 -1
- package/dist/{CurrentPage-7NM90y76.js → CurrentPage-IrFGAb7n.js} +3 -3
- package/dist/{CurrentPage-sx7KVTmt.cjs → CurrentPage-PjrVzHXR.cjs} +1 -1
- package/dist/{ListTree-oRbeDNod.js → ListTree-0n_G8NJx.js} +1 -1
- package/dist/{ListTree-7Pz6H6eE.cjs → ListTree-C6oCXZDV.cjs} +1 -1
- package/dist/{PagesPanel-XiTUaiq_.js → PagesPanel-RYBf0Yct.js} +4 -4
- package/dist/{PagesPanel-Nr-908vy.cjs → PagesPanel-lIC3kYmS.cjs} +1 -1
- package/dist/{ProjectPanel-SuFYN60H.cjs → ProjectPanel-0Siyi5YS.cjs} +1 -1
- package/dist/{ProjectPanel-XfknsGkz.js → ProjectPanel-Zagx6l3Q.js} +4 -4
- package/dist/Settings-6QRVcl16.cjs +1 -0
- package/dist/{Settings-dJ72rwnH.js → Settings-RLDTFFf8.js} +797 -807
- package/dist/{SidePanels-t9oUA51J.js → SidePanels-ao969pMV.js} +2 -2
- package/dist/{SidePanels-5dnRAsJh.cjs → SidePanels-j1EFsBlK.cjs} +1 -1
- package/dist/{ThemeConfiguration-pcHbYiIP.js → ThemeConfiguration-S7yArRMp.js} +1 -1
- package/dist/{ThemeConfiguration-2Sbh29qi.cjs → ThemeConfiguration-q1471P7b.cjs} +1 -1
- package/dist/{Topbar-0DmS6VpB.js → Topbar-B8u0whpc.js} +1 -1
- package/dist/{Topbar-ID6Ipphd.cjs → Topbar-ogFKKDbx.cjs} +1 -1
- package/dist/{UILibrariesPanel-sXY6hozJ.cjs → UILibrariesPanel-cm9CFWxc.cjs} +1 -1
- package/dist/{UILibrariesPanel-G9J4KUsZ.js → UILibrariesPanel-tcfz2ELp.js} +1 -1
- package/dist/{UnsplashImages-HK4_1VVL.cjs → UnsplashImages-E2L3YDJI.cjs} +1 -1
- package/dist/{UnsplashImages-MeS5Cu7a.js → UnsplashImages-wWRifkCp.js} +1 -1
- package/dist/{UploadImages-AIKATqfP.js → UploadImages-lUvZhW_j.js} +1 -1
- package/dist/{UploadImages-LSnxByGV.cjs → UploadImages-s-eeaGiS.cjs} +1 -1
- package/dist/{add-page-modal-JkD45moJ.js → add-page-modal-04b4l2zu.js} +4 -4
- package/dist/{add-page-modal-krxKdX7-.cjs → add-page-modal-eroF20lO.cjs} +1 -1
- package/dist/{confirm-alert-NHxthdRK.js → confirm-alert-FX5030eR.js} +1 -1
- package/dist/{confirm-alert--QTC21Z2.cjs → confirm-alert-XuxEzG-V.cjs} +1 -1
- package/dist/core.cjs +1 -1
- package/dist/core.js +1 -1
- package/dist/{delete-page-modal-8rjPEchH.js → delete-page-modal-1u9CyAIP.js} +3 -3
- package/dist/{delete-page-modal-BIe0kYNH.cjs → delete-page-modal-pgh7sdfg.cjs} +1 -1
- package/dist/email.cjs +1 -1
- package/dist/email.js +1 -1
- package/dist/{form-PQYPrD_Q.js → form-HRdEJjVq.js} +1 -1
- package/dist/{form-6OLp5uEG.cjs → form-Z4IRWj0o.cjs} +1 -1
- package/dist/{html-to-json-ofq1N3tB.js → html-to-json-OnIZDDXw.js} +63 -58
- package/dist/html-to-json-rauxDBi6.cjs +1 -0
- package/dist/{index-seU0_UZX.cjs → index-bt7EhwLh.cjs} +1 -1
- package/dist/{index-9_b2eou7.js → index-vfmO3y2d.js} +3 -3
- package/dist/lib.cjs +1 -1
- package/dist/lib.js +1 -1
- package/dist/{page-viewer-WwwMC1Kq.cjs → page-viewer-O960kM2x.cjs} +1 -1
- package/dist/{page-viewer-sKluQ_e1.js → page-viewer-dcb3u4OV.js} +4 -4
- package/dist/{project-general-setting-Lc2ByvTt.js → project-general-setting--sS34seu.js} +4 -4
- package/dist/{project-general-setting-pRO1ikDV.cjs → project-general-setting-lIvNs-Vq.cjs} +1 -1
- package/dist/{project-seo-setting-530_6o9S.js → project-seo-setting-8tc3I-0M.js} +2 -2
- package/dist/{project-seo-setting-BzSrXFVv.cjs → project-seo-setting-MIlAuqcc.cjs} +1 -1
- package/dist/{single-page-detail-_VP4zaCI.cjs → single-page-detail-0Z_hvd_j.cjs} +1 -1
- package/dist/{single-page-detail-qDxxtedN.js → single-page-detail-tP2pfgBp.js} +5 -5
- package/dist/studio.cjs +1 -1
- package/dist/studio.js +3 -3
- package/dist/ui.cjs +1 -1
- package/dist/ui.js +1 -1
- package/dist/{useCanvasSettings-pURFQG4q.cjs → useCanvasSettings-R0h03UfD.cjs} +1 -1
- package/dist/{useCanvasSettings-5y2fSCpN.js → useCanvasSettings-rEZHbw3s.js} +1 -1
- package/dist/web-blocks.cjs +1 -1
- package/dist/web-blocks.js +241 -195
- package/package.json +1 -1
- package/dist/Settings-22Hy7jUT.cjs +0 -1
- package/dist/html-to-json-9uiQ2Dp2.cjs +0 -1
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
import { j as e } from "./jsx-runtime-WbnYoNE9.js";
|
|
2
2
|
import * as ie from "react";
|
|
3
|
-
import
|
|
3
|
+
import $, { useState as j, useMemo as R, useEffect as A, useCallback as B, memo as ft, useRef as ye, createContext as Ze, useContext as se } from "react";
|
|
4
4
|
import { useThrottledCallback as ce } from "@react-hookz/web";
|
|
5
|
-
import { forEach as
|
|
6
|
-
import { useTranslation as
|
|
7
|
-
import { CopyIcon as
|
|
8
|
-
import { a2 as Je, aQ as Qe, aR as et, B, aS as tt, aT as
|
|
9
|
-
import { Check as
|
|
10
|
-
import { getBlockComponent 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
|
|
19
|
-
import { get as Le, isEmpty as
|
|
5
|
+
import { forEach as ke, isArray as pe, omit as vt, truncate as wt, includes as z, get as g, first as oe, split as jt, startCase as Y, toLower as re, isEmpty as b, map as T, find as Ct, last as kt, filter as Re, set as We, debounce as Nt, keys as he, cloneDeep as _t, each as St, capitalize as me, reject as Tt, nth as Ve, startsWith as q, isNumber as Rt, parseInt as Vt, isNaN as Ue, findLast as Ht, flatten as He, intersection as Dt, has as de, isNull as Bt } from "lodash-es";
|
|
6
|
+
import { useTranslation as F } from "react-i18next";
|
|
7
|
+
import { CopyIcon as It, PlusIcon as Ke, Cross2Icon as Ge, EyeOpenIcon as At, EyeClosedIcon as De, BorderAllIcon as O, WidthIcon as H, HeightIcon as D, ArrowUpIcon as J, ArrowRightIcon as Q, ArrowDownIcon as ee, ArrowLeftIcon as te, ArrowTopLeftIcon as Pt, ArrowTopRightIcon as $t, ArrowBottomRightIcon as Et, ArrowBottomLeftIcon as Mt, AlignLeftIcon as Lt, AlignCenterHorizontallyIcon as Ot, AlignRightIcon as zt, StretchHorizontallyIcon as Yt, FontItalicIcon as Ft, UnderlineIcon as Xt, OverlineIcon as Zt, LetterCaseUppercaseIcon as Wt, Cross1Icon as Ut, InfoCircledIcon as Ne, MinusIcon as Kt, BoxIcon as qe, RowSpacingIcon as Gt, TriangleDownIcon as qt, CrossCircledIcon as Jt, CaretDownIcon as Qt, MixerHorizontalIcon as er } from "@radix-ui/react-icons";
|
|
8
|
+
import { a2 as Je, aQ as Qe, aR as et, B as P, aS as tt, aT as tr, aU as rr, aV as sr, aW as or, aX as lr, aY as ar, M as X, aL as rt, $ as nr, a0 as ir, a1 as dr, aZ as cr, Z as pr, ab as ur, _ as gr, ac as U, ad as K, ae as G, i as xr, a_ as yr, a$ as hr, b0 as mr, b1 as br, b2 as fr, b3 as vr, b4 as wr, R as st, Q as ot, h as lt, b5 as jr, b6 as at, b7 as be, b8 as fe, b9 as ve, ba as Cr, bb as nt, ah as kr, bc as Nr, Y as le, o as _e, I as it, L as dt, bd as _r, aD as Be, be as ct, k as Sr, bf as Tr, J as ue, w as Rr, P as Vr, p as Ie, av as Hr, aw as Dr, ax as Br, bg as pt, ay as Ae, az as Pe, bh as $e, bi as Ee, bj as Me, S as Ir } from "./ChaiBuilderEditor-tkzS851D.js";
|
|
9
|
+
import { Check as Ar, EditIcon as Pr, TrashIcon as $r, Loader as Er, SparklesIcon as Mr, Edit2 as Lr, X as Or } from "lucide-react";
|
|
10
|
+
import { getBlockComponent as Se, getChaiDataProviders as zr, useGlobalStylingPresets as Yr } from "@chaibuilder/runtime";
|
|
11
|
+
import { J as Fr, a as Xr, d as Zr } from "./index-e0c8PmRQ.js";
|
|
12
|
+
import Wr from "@rjsf/core";
|
|
13
|
+
import Ur from "@rjsf/validator-ajv8";
|
|
14
|
+
import { u as Kr } from "./useCanvasSettings-rEZHbw3s.js";
|
|
15
|
+
import Gr from "react-autosuggest";
|
|
16
|
+
import qr from "fuse.js";
|
|
17
|
+
import { A as Jr, C as ge, g as Qr } from "./utils-VpVqnC9m.js";
|
|
18
|
+
import { a as es } from "./MODIFIERS-fd5XOmum.js";
|
|
19
|
+
import { get as Le, isEmpty as ts } from "lodash";
|
|
20
20
|
import "./_commonjsHelpers-UyOWmZb0.js";
|
|
21
21
|
import "clsx";
|
|
22
22
|
import "react-dom";
|
|
@@ -51,29 +51,29 @@ import "react-icons-picker";
|
|
|
51
51
|
import "react-quill";
|
|
52
52
|
import "react-hotkeys-hook";
|
|
53
53
|
import "./index-VBXQixVm.js";
|
|
54
|
-
function
|
|
55
|
-
const
|
|
56
|
-
function
|
|
57
|
-
|
|
58
|
-
const s =
|
|
59
|
-
|
|
54
|
+
function rs(r) {
|
|
55
|
+
const a = [], t = {};
|
|
56
|
+
function l(o, n) {
|
|
57
|
+
ke(n, (d, p) => {
|
|
58
|
+
const s = o ? `${o}.${p}` : p, c = pe(d) ? "list" : typeof d;
|
|
59
|
+
a.push(s), t[s] = c === "string" ? "text" : c === "object" ? "model" : c, c === "object" && !pe(d) && l(s, d);
|
|
60
60
|
});
|
|
61
61
|
}
|
|
62
|
-
return
|
|
62
|
+
return l("", vt(r, ["styles", "_type", "_id", "_name", "_bindings"])), { paths: a, pathsType: t };
|
|
63
63
|
}
|
|
64
|
-
const
|
|
64
|
+
const we = ({ data: r, fullView: a }) => {
|
|
65
65
|
if (!r)
|
|
66
66
|
return null;
|
|
67
67
|
const t = typeof r;
|
|
68
|
-
return
|
|
68
|
+
return a ? typeof r == "object" ? /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
69
69
|
/* @__PURE__ */ e.jsx("div", { className: "h-3" }),
|
|
70
70
|
/* @__PURE__ */ e.jsx(Je, { children: /* @__PURE__ */ e.jsx(
|
|
71
|
-
|
|
71
|
+
Fr,
|
|
72
72
|
{
|
|
73
73
|
data: r,
|
|
74
|
-
shouldExpandNode:
|
|
74
|
+
shouldExpandNode: Xr,
|
|
75
75
|
style: {
|
|
76
|
-
...
|
|
76
|
+
...Zr,
|
|
77
77
|
container: "max-h-[40vh] overflow-y-auto text-[12px] leading-[1.5] tracking-wide font-mono",
|
|
78
78
|
stringValue: "text-orange-600",
|
|
79
79
|
label: "text-green-900 font-semibold pr-1 tracking-wider"
|
|
@@ -86,92 +86,92 @@ const je = ({ data: r, fullView: o }) => {
|
|
|
86
86
|
] }) : /* @__PURE__ */ e.jsx("div", { className: "w-full overflow-hidden whitespace-nowrap text-[10px] leading-3 text-gray-800/50", children: wt(t === "object" ? JSON.stringify(r) : r, { length: 40 }) });
|
|
87
87
|
}, Oe = ({
|
|
88
88
|
type: r,
|
|
89
|
-
value:
|
|
89
|
+
value: a = "",
|
|
90
90
|
setValue: t,
|
|
91
|
-
data:
|
|
92
|
-
onChange:
|
|
91
|
+
data: l,
|
|
92
|
+
onChange: o,
|
|
93
93
|
dataType: n,
|
|
94
94
|
appliedBindings: d
|
|
95
95
|
}) => {
|
|
96
|
-
const { paths:
|
|
97
|
-
(
|
|
98
|
-
) :
|
|
96
|
+
const { paths: p, pathsType: s } = rs(l), c = r === "PROP" ? Se(l == null ? void 0 : l._type) : {}, u = r === "PROP", [i, h] = j(!1), y = R(() => r === "PROP" ? p.filter(
|
|
97
|
+
(x) => !z(d, x) && g(c, `props.${oe(jt(x, "."))}.binding`)
|
|
98
|
+
) : p.filter((x) => n === g(s, x, "")), [r, p, d, n, c]);
|
|
99
99
|
return A(() => {
|
|
100
|
-
|
|
101
|
-
}, [
|
|
100
|
+
a && o(a);
|
|
101
|
+
}, [a, r]), /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
102
102
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-4", children: [
|
|
103
|
-
/* @__PURE__ */ e.jsx("p", { className: "text-sm text-muted-foreground", children:
|
|
104
|
-
/* @__PURE__ */ e.jsxs(Qe, { open: i, onOpenChange:
|
|
103
|
+
/* @__PURE__ */ e.jsx("p", { className: "text-sm text-muted-foreground", children: Y(re(r)) }),
|
|
104
|
+
/* @__PURE__ */ e.jsxs(Qe, { open: i, onOpenChange: h, children: [
|
|
105
105
|
/* @__PURE__ */ e.jsx(et, { asChild: !0, children: /* @__PURE__ */ e.jsx(
|
|
106
|
-
|
|
106
|
+
P,
|
|
107
107
|
{
|
|
108
108
|
variant: "outline",
|
|
109
109
|
size: "sm",
|
|
110
|
-
className: ` ${
|
|
111
|
-
children:
|
|
110
|
+
className: ` ${b(a) ? "w-44 justify-center bg-blue-500 text-gray-100 hover:bg-blue-400 hover:text-white" : "min-w-[350px] items-center justify-between"}`,
|
|
111
|
+
children: a ? /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
112
112
|
/* @__PURE__ */ e.jsxs("span", { className: "pr-8 text-sm", children: [
|
|
113
|
-
|
|
114
|
-
|
|
113
|
+
u && /* @__PURE__ */ e.jsx("span", { className: "mr-2 rounded-full bg-purple-100 px-2 py-0.5 text-[10px] text-purple-500", children: Y(n) }),
|
|
114
|
+
a
|
|
115
115
|
] }),
|
|
116
116
|
/* @__PURE__ */ e.jsx("span", { className: "cursor-pointer text-[9px] text-blue-400 underline hover:text-blue-700", children: "Change" })
|
|
117
117
|
] }) : /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
118
118
|
"+ Set ",
|
|
119
|
-
|
|
119
|
+
Y(re(r))
|
|
120
120
|
] })
|
|
121
121
|
}
|
|
122
122
|
) }),
|
|
123
|
-
/* @__PURE__ */ e.jsx(tt, { className: "z-[999] min-w-[300px] p-0", side: "right", align: "start", children: /* @__PURE__ */ e.jsxs(
|
|
124
|
-
/* @__PURE__ */ e.jsx(
|
|
125
|
-
/* @__PURE__ */ e.jsxs(
|
|
126
|
-
/* @__PURE__ */ e.jsx(
|
|
127
|
-
/* @__PURE__ */ e.jsx(
|
|
128
|
-
|
|
123
|
+
/* @__PURE__ */ e.jsx(tt, { className: "z-[999] min-w-[300px] p-0", side: "right", align: "start", children: /* @__PURE__ */ e.jsxs(tr, { children: [
|
|
124
|
+
/* @__PURE__ */ e.jsx(rr, { placeholder: `Choose ${re(r)}...` }),
|
|
125
|
+
/* @__PURE__ */ e.jsxs(sr, { children: [
|
|
126
|
+
/* @__PURE__ */ e.jsx(or, { children: "No results found." }),
|
|
127
|
+
/* @__PURE__ */ e.jsx(lr, { children: T(y, (x) => /* @__PURE__ */ e.jsxs(
|
|
128
|
+
ar,
|
|
129
129
|
{
|
|
130
|
-
value:
|
|
131
|
-
className: `cursor-pointer ${
|
|
130
|
+
value: x,
|
|
131
|
+
className: `cursor-pointer ${u ? "flex items-center justify-between" : "flex flex-col items-start justify-start"}`,
|
|
132
132
|
onSelect: (v) => {
|
|
133
|
-
t(
|
|
133
|
+
t(Ct(y, (k) => k === v) || null), h(!1);
|
|
134
134
|
},
|
|
135
135
|
children: [
|
|
136
136
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-x-2", children: [
|
|
137
|
-
/* @__PURE__ */ e.jsx(
|
|
138
|
-
|
|
137
|
+
/* @__PURE__ */ e.jsx(Ar, { className: `h-4 w-4 text-green-500 ${a === x ? "" : "opacity-0"}` }),
|
|
138
|
+
x
|
|
139
139
|
] }),
|
|
140
|
-
|
|
140
|
+
u ? /* @__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(g(s, x, "")) }) }) : /* @__PURE__ */ e.jsx("div", { className: "pl-6", children: /* @__PURE__ */ e.jsx(we, { data: g(l, x) }) })
|
|
141
141
|
]
|
|
142
142
|
},
|
|
143
|
-
|
|
143
|
+
x
|
|
144
144
|
)) })
|
|
145
145
|
] })
|
|
146
146
|
] }) })
|
|
147
147
|
] })
|
|
148
148
|
] }),
|
|
149
|
-
!
|
|
149
|
+
!u && !b(a) && /* @__PURE__ */ e.jsx("div", { className: "pt-2", children: /* @__PURE__ */ e.jsx(we, { data: g(l, a, ""), fullView: !0 }) })
|
|
150
150
|
] });
|
|
151
|
-
},
|
|
151
|
+
}, ss = ({
|
|
152
152
|
appliedBindings: r = [],
|
|
153
|
-
onAddBinding:
|
|
153
|
+
onAddBinding: a,
|
|
154
154
|
editMode: t,
|
|
155
|
-
item:
|
|
155
|
+
item: l
|
|
156
156
|
}) => {
|
|
157
|
-
const [
|
|
158
|
-
(
|
|
159
|
-
if (
|
|
157
|
+
const [o, n] = j(t ? l.key : ""), [d, p] = j(t ? l.value : ""), s = X(), [c] = rt(), u = B(
|
|
158
|
+
(y, x) => {
|
|
159
|
+
if (b(y))
|
|
160
160
|
return "";
|
|
161
161
|
{
|
|
162
|
-
const v =
|
|
162
|
+
const v = g(x === "PROP" ? s : c, y, "");
|
|
163
163
|
if (pe(v))
|
|
164
164
|
return "list";
|
|
165
|
-
const
|
|
166
|
-
return
|
|
165
|
+
const k = typeof v;
|
|
166
|
+
return k === "string" ? "text" : k === "object" ? "model" : k;
|
|
167
167
|
}
|
|
168
168
|
},
|
|
169
|
-
[s,
|
|
170
|
-
), [i,
|
|
169
|
+
[s, c]
|
|
170
|
+
), [i, h] = j(t ? u(l.key, "PROP") : "");
|
|
171
171
|
return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
172
|
-
/* @__PURE__ */ e.jsxs(
|
|
173
|
-
/* @__PURE__ */ e.jsx(
|
|
174
|
-
/* @__PURE__ */ e.jsx(
|
|
172
|
+
/* @__PURE__ */ e.jsxs(nr, { children: [
|
|
173
|
+
/* @__PURE__ */ e.jsx(ir, { children: "Add Data Binding" }),
|
|
174
|
+
/* @__PURE__ */ e.jsx(dr, { className: "text-xs", children: "Add prop and path of binding. Click save when you're done." })
|
|
175
175
|
] }),
|
|
176
176
|
/* @__PURE__ */ e.jsxs("div", { className: "relative flex flex-col gap-1", children: [
|
|
177
177
|
/* @__PURE__ */ e.jsx(
|
|
@@ -180,11 +180,11 @@ const je = ({ data: r, fullView: o }) => {
|
|
|
180
180
|
type: "PROP",
|
|
181
181
|
isDisabled: !1,
|
|
182
182
|
placeholder: "Enter prop key",
|
|
183
|
-
value:
|
|
183
|
+
value: o,
|
|
184
184
|
setValue: n,
|
|
185
|
-
onChange: (
|
|
186
|
-
const
|
|
187
|
-
n(
|
|
185
|
+
onChange: (y) => {
|
|
186
|
+
const x = u(y, "PROP");
|
|
187
|
+
n(y), i !== x && p(""), h(x);
|
|
188
188
|
},
|
|
189
189
|
data: s,
|
|
190
190
|
dataType: i,
|
|
@@ -196,415 +196,415 @@ const je = ({ data: r, fullView: o }) => {
|
|
|
196
196
|
Oe,
|
|
197
197
|
{
|
|
198
198
|
type: "PATH",
|
|
199
|
-
isDisabled:
|
|
199
|
+
isDisabled: b(o),
|
|
200
200
|
placeholder: "Enter data path",
|
|
201
201
|
value: d,
|
|
202
|
-
setValue:
|
|
203
|
-
onChange: (
|
|
204
|
-
const
|
|
205
|
-
|
|
202
|
+
setValue: p,
|
|
203
|
+
onChange: (y) => {
|
|
204
|
+
const x = u(y, "PATH");
|
|
205
|
+
p(i === x ? y : "");
|
|
206
206
|
},
|
|
207
|
-
data:
|
|
207
|
+
data: c,
|
|
208
208
|
dataType: i,
|
|
209
209
|
appliedBindings: r
|
|
210
210
|
}
|
|
211
211
|
)
|
|
212
212
|
] }),
|
|
213
|
-
/* @__PURE__ */ e.jsx(
|
|
214
|
-
|
|
213
|
+
/* @__PURE__ */ e.jsx(cr, { children: /* @__PURE__ */ e.jsx(
|
|
214
|
+
P,
|
|
215
215
|
{
|
|
216
216
|
type: "submit",
|
|
217
217
|
className: "mt-4",
|
|
218
|
-
disabled:
|
|
219
|
-
onClick: () =>
|
|
218
|
+
disabled: b(o) && b(d),
|
|
219
|
+
onClick: () => a({ key: o, value: d }),
|
|
220
220
|
children: "Save"
|
|
221
221
|
}
|
|
222
222
|
) })
|
|
223
223
|
] });
|
|
224
|
-
},
|
|
225
|
-
const [d,
|
|
226
|
-
return /* @__PURE__ */ e.jsxs(
|
|
227
|
-
/* @__PURE__ */ e.jsx(
|
|
228
|
-
d && /* @__PURE__ */ e.jsx(
|
|
229
|
-
|
|
224
|
+
}, ut = ({ disabled: r, children: a, onAddBinding: t, appliedBindings: l, editMode: o = !0, item: n = {} }) => {
|
|
225
|
+
const [d, p] = j(!1);
|
|
226
|
+
return /* @__PURE__ */ e.jsxs(pr, { children: [
|
|
227
|
+
/* @__PURE__ */ e.jsx(ur, { disabled: r, asChild: !0, onClick: () => p(!0), children: a }),
|
|
228
|
+
d && /* @__PURE__ */ e.jsx(gr, { children: /* @__PURE__ */ e.jsx(
|
|
229
|
+
ss,
|
|
230
230
|
{
|
|
231
231
|
item: n,
|
|
232
|
-
editMode:
|
|
233
|
-
appliedBindings:
|
|
232
|
+
editMode: o,
|
|
233
|
+
appliedBindings: l,
|
|
234
234
|
onAddBinding: (s) => {
|
|
235
|
-
t(s),
|
|
235
|
+
t(s), p(!1);
|
|
236
236
|
}
|
|
237
237
|
}
|
|
238
238
|
) })
|
|
239
239
|
] });
|
|
240
|
-
},
|
|
240
|
+
}, os = ({
|
|
241
241
|
item: r,
|
|
242
|
-
onAddBinding:
|
|
242
|
+
onAddBinding: a,
|
|
243
243
|
onRemove: t,
|
|
244
|
-
selectedBlock:
|
|
245
|
-
dataProvider:
|
|
244
|
+
selectedBlock: l,
|
|
245
|
+
dataProvider: o,
|
|
246
246
|
appliedBindings: n
|
|
247
247
|
}) => {
|
|
248
|
-
const [d,
|
|
249
|
-
if (
|
|
248
|
+
const [d, p] = j("string"), s = (c, u) => {
|
|
249
|
+
if (b(c))
|
|
250
250
|
return "";
|
|
251
251
|
{
|
|
252
|
-
const i =
|
|
252
|
+
const i = g(u === "PROP" ? l : o, c, "");
|
|
253
253
|
if (pe(i))
|
|
254
254
|
return "list";
|
|
255
|
-
const
|
|
256
|
-
return
|
|
255
|
+
const h = typeof i;
|
|
256
|
+
return h === "string" ? "text" : h === "object" ? "model" : h;
|
|
257
257
|
}
|
|
258
258
|
};
|
|
259
|
-
return A(() =>
|
|
259
|
+
return A(() => p(() => s(r.key, "PROP")), [r.key]), /* @__PURE__ */ e.jsxs("div", { className: "relative flex flex-col rounded-md border border-gray-200 p-2", children: [
|
|
260
260
|
/* @__PURE__ */ e.jsx("div", { className: "text-sm font-normal text-gray-500", children: r.key }),
|
|
261
261
|
/* @__PURE__ */ e.jsx("div", { className: "font-medium leading-5", children: r.value }),
|
|
262
|
-
/* @__PURE__ */ e.jsx(
|
|
262
|
+
/* @__PURE__ */ e.jsx(we, { data: g(o, r.value, "") }),
|
|
263
263
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center justify-end gap-x-2", children: [
|
|
264
|
-
/* @__PURE__ */ e.jsx(
|
|
264
|
+
/* @__PURE__ */ e.jsx(ut, { editMode: !0, onAddBinding: a, appliedBindings: n, item: r, children: /* @__PURE__ */ e.jsx(Pr, { 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" }) }),
|
|
265
265
|
/* @__PURE__ */ e.jsx(
|
|
266
|
-
|
|
266
|
+
$r,
|
|
267
267
|
{
|
|
268
268
|
onClick: () => t(),
|
|
269
269
|
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
270
|
}
|
|
271
271
|
)
|
|
272
272
|
] }),
|
|
273
|
-
!
|
|
273
|
+
!b(d) && !b(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: Y(d) })
|
|
274
274
|
] });
|
|
275
|
-
},
|
|
276
|
-
const t =
|
|
277
|
-
|
|
275
|
+
}, ls = ({ bindingData: r, onChange: a }) => {
|
|
276
|
+
const t = X(), [l] = rt(), o = zr(), [n, d] = j(
|
|
277
|
+
T(r, (i, h) => ({ key: h, value: i }))
|
|
278
278
|
);
|
|
279
279
|
A(() => {
|
|
280
|
-
d(
|
|
280
|
+
d(T(r, (i, h) => ({ key: h, value: i })));
|
|
281
281
|
}, [t == null ? void 0 : t._id, r]);
|
|
282
|
-
const
|
|
283
|
-
if (
|
|
282
|
+
const p = R(() => {
|
|
283
|
+
if (b(l))
|
|
284
284
|
return !0;
|
|
285
|
-
if (
|
|
285
|
+
if (b(n))
|
|
286
286
|
return !1;
|
|
287
|
-
const i =
|
|
288
|
-
return
|
|
289
|
-
}, [
|
|
290
|
-
const
|
|
291
|
-
d([...
|
|
292
|
-
},
|
|
293
|
-
const
|
|
294
|
-
|
|
295
|
-
},
|
|
287
|
+
const i = kt(n);
|
|
288
|
+
return b(i == null ? void 0 : i.key) || b(i == null ? void 0 : i.value);
|
|
289
|
+
}, [l, n]), s = (i) => {
|
|
290
|
+
const h = Re(n, (y) => y.key !== i.key);
|
|
291
|
+
d([...h, i]), u([...h, i]);
|
|
292
|
+
}, c = (i) => {
|
|
293
|
+
const h = Re(n, (y, x) => i !== x);
|
|
294
|
+
u([...h]);
|
|
295
|
+
}, u = B(
|
|
296
296
|
(i = []) => {
|
|
297
|
-
if (d(i),
|
|
298
|
-
|
|
297
|
+
if (d(i), b(i)) {
|
|
298
|
+
a({});
|
|
299
299
|
return;
|
|
300
300
|
}
|
|
301
|
-
const
|
|
302
|
-
|
|
303
|
-
!
|
|
304
|
-
}),
|
|
301
|
+
const h = {};
|
|
302
|
+
ke(i, (y) => {
|
|
303
|
+
!b(y == null ? void 0 : y.key) && !b(y == null ? void 0 : y.value) && We(h, y.key, y.value);
|
|
304
|
+
}), a(h);
|
|
305
305
|
},
|
|
306
|
-
[
|
|
306
|
+
[a]
|
|
307
307
|
);
|
|
308
|
-
return
|
|
308
|
+
return b(o) ? /* @__PURE__ */ e.jsx("div", { className: "flex w-full items-center justify-center", children: /* @__PURE__ */ e.jsxs("p", { className: "mb-1.5 text-xs text-gray-500", children: [
|
|
309
309
|
"You have no data providers registered. Please add a data provider to your project. ",
|
|
310
310
|
/* @__PURE__ */ e.jsx("br", {}),
|
|
311
311
|
/* @__PURE__ */ e.jsx("a", { className: "text-blue-500", href: "https://chaibuilder.com/docs/registering-data-providers", target: "_blank", children: "Learn more" })
|
|
312
312
|
] }) }) : /* @__PURE__ */ e.jsxs("div", { className: "space-y-2", children: [
|
|
313
|
-
|
|
314
|
-
|
|
313
|
+
T(n, (i, h) => /* @__PURE__ */ e.jsx(
|
|
314
|
+
os,
|
|
315
315
|
{
|
|
316
316
|
item: i,
|
|
317
317
|
onAddBinding: s,
|
|
318
|
-
onRemove: () =>
|
|
318
|
+
onRemove: () => c(h),
|
|
319
319
|
selectedBlock: t,
|
|
320
|
-
dataProvider:
|
|
321
|
-
appliedBindings:
|
|
320
|
+
dataProvider: l,
|
|
321
|
+
appliedBindings: T(n, "key")
|
|
322
322
|
},
|
|
323
323
|
i.key
|
|
324
324
|
)),
|
|
325
|
-
/* @__PURE__ */ e.jsxs(
|
|
326
|
-
/* @__PURE__ */ e.jsx(
|
|
327
|
-
|
|
325
|
+
/* @__PURE__ */ e.jsxs(U, { delayDuration: 200, children: [
|
|
326
|
+
/* @__PURE__ */ e.jsx(K, { disabled: b(l), className: "w-full", children: /* @__PURE__ */ e.jsx(
|
|
327
|
+
ut,
|
|
328
328
|
{
|
|
329
|
-
disabled:
|
|
330
|
-
appliedBindings:
|
|
329
|
+
disabled: p,
|
|
330
|
+
appliedBindings: T(n, "key"),
|
|
331
331
|
onAddBinding: s,
|
|
332
332
|
children: /* @__PURE__ */ e.jsx(
|
|
333
333
|
"span",
|
|
334
334
|
{
|
|
335
|
-
className: `w-full rounded-md px-5 py-1.5 text-xs font-medium duration-200 ${
|
|
336
|
-
children:
|
|
335
|
+
className: `w-full rounded-md px-5 py-1.5 text-xs font-medium duration-200 ${p ? "cursor-not-allowed bg-gray-200 text-gray-400" : "bg-blue-700/20 text-blue-800 hover:bg-blue-700/30"}`,
|
|
336
|
+
children: b(l) ? /* @__PURE__ */ e.jsx("small", { className: "text-[9.5px] text-gray-500", children: "No data provider has been set up for this page" }) : "+ Add Data Binding"
|
|
337
337
|
}
|
|
338
338
|
)
|
|
339
339
|
}
|
|
340
340
|
) }),
|
|
341
|
-
|
|
341
|
+
p && /* @__PURE__ */ e.jsx(G, { sideOffset: -55, className: "text-[11px]", children: b(l) ? "No data provider has been set up for this page." : "Complete last added data binding to add more" })
|
|
342
342
|
] })
|
|
343
343
|
] });
|
|
344
|
-
},
|
|
345
|
-
const { t
|
|
344
|
+
}, as = () => /* @__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" }), ns = ({ id: r, placeholder: a }) => {
|
|
345
|
+
const { t } = F(), [, l] = xr(), o = X();
|
|
346
346
|
if (typeof window > "u")
|
|
347
347
|
return null;
|
|
348
|
-
const d = () => {
|
|
349
|
-
const
|
|
350
|
-
l({ blockId:
|
|
348
|
+
const n = r.replace("root.", ""), d = g(o, n, ""), p = () => {
|
|
349
|
+
const s = o == null ? void 0 : o._id;
|
|
350
|
+
l({ blockId: s, blockProp: n, placeholder: a, initialCode: g(o, n, d) });
|
|
351
351
|
};
|
|
352
352
|
return /* @__PURE__ */ e.jsxs("div", { className: "mt-2 flex flex-col gap-y-1", children: [
|
|
353
353
|
/* @__PURE__ */ e.jsx(
|
|
354
354
|
"button",
|
|
355
355
|
{
|
|
356
|
-
onClick:
|
|
356
|
+
onClick: p,
|
|
357
357
|
className: "text-pretty w-[90%] max-w-full cursor-default truncate rounded border bg-white p-2 text-left text-[10px]",
|
|
358
|
-
children:
|
|
358
|
+
children: d.trim().length > 0 ? d.substring(0, 46) : a || "Eg: <script>console.log('Hello, world!');<\/script>"
|
|
359
359
|
}
|
|
360
360
|
),
|
|
361
|
-
/* @__PURE__ */ e.jsx(
|
|
361
|
+
/* @__PURE__ */ e.jsx(P, { onClick: p, size: "sm", variant: "outline", className: "w-fit", children: t("Open code editor") })
|
|
362
362
|
] });
|
|
363
|
-
},
|
|
364
|
-
const [
|
|
365
|
-
Object.keys(
|
|
366
|
-
const
|
|
367
|
-
if (
|
|
363
|
+
}, je = ft(({ id: r, properties: a, formData: t, onChange: l }) => {
|
|
364
|
+
const [o, n] = j(t), d = { type: "object", properties: {} }, p = {};
|
|
365
|
+
Object.keys(a).forEach((c) => {
|
|
366
|
+
const u = a[c];
|
|
367
|
+
if (z(["slot", "styles"], u.type))
|
|
368
368
|
return;
|
|
369
|
-
const i =
|
|
370
|
-
d.properties[i] =
|
|
369
|
+
const i = c;
|
|
370
|
+
d.properties[i] = yr(u), p[i] = hr(u);
|
|
371
371
|
}), A(() => {
|
|
372
372
|
n(t);
|
|
373
373
|
}, [r]);
|
|
374
374
|
const s = ce(
|
|
375
|
-
async ({ formData:
|
|
376
|
-
|
|
375
|
+
async ({ formData: c }, u) => {
|
|
376
|
+
l({ formData: c }, u);
|
|
377
377
|
},
|
|
378
|
-
[
|
|
378
|
+
[l],
|
|
379
379
|
1e3
|
|
380
380
|
// save only every 5 seconds
|
|
381
381
|
);
|
|
382
382
|
return /* @__PURE__ */ e.jsx(
|
|
383
|
-
|
|
383
|
+
Wr,
|
|
384
384
|
{
|
|
385
385
|
widgets: {
|
|
386
|
-
binding:
|
|
387
|
-
richtext:
|
|
386
|
+
binding: as,
|
|
387
|
+
richtext: mr,
|
|
388
388
|
icon: br,
|
|
389
|
-
image:
|
|
390
|
-
code:
|
|
389
|
+
image: fr,
|
|
390
|
+
code: ns
|
|
391
391
|
},
|
|
392
|
-
fields: { link:
|
|
392
|
+
fields: { link: vr },
|
|
393
393
|
idSeparator: ".",
|
|
394
394
|
autoComplete: "off",
|
|
395
395
|
omitExtraData: !1,
|
|
396
396
|
liveOmit: !1,
|
|
397
397
|
liveValidate: !1,
|
|
398
|
-
validator:
|
|
399
|
-
uiSchema:
|
|
398
|
+
validator: Ur,
|
|
399
|
+
uiSchema: p,
|
|
400
400
|
schema: d,
|
|
401
|
-
formData:
|
|
402
|
-
onChange: ({ formData:
|
|
403
|
-
|
|
401
|
+
formData: o,
|
|
402
|
+
onChange: ({ formData: c }, u) => {
|
|
403
|
+
u && (n(c), s({ formData: c }, u));
|
|
404
404
|
}
|
|
405
405
|
}
|
|
406
406
|
);
|
|
407
|
-
}),
|
|
408
|
-
const [r,
|
|
409
|
-
|
|
407
|
+
}), is = () => {
|
|
408
|
+
const [r, a] = Kr(), t = wr(), l = (d, p) => {
|
|
409
|
+
a((s) => ({ ...s, [d]: p }));
|
|
410
410
|
};
|
|
411
|
-
if (
|
|
411
|
+
if (b(t))
|
|
412
412
|
return null;
|
|
413
|
-
const { block:
|
|
413
|
+
const { block: o, settings: n } = t;
|
|
414
414
|
return /* @__PURE__ */ e.jsxs("div", { className: "text-xs hover:no-underline", children: [
|
|
415
415
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-x-2 bg-gray-100 px-4 py-2", children: [
|
|
416
416
|
t.block._type,
|
|
417
417
|
" settings"
|
|
418
418
|
] }),
|
|
419
419
|
/* @__PURE__ */ e.jsx("div", { className: "bg-white pb-2", children: /* @__PURE__ */ e.jsx(
|
|
420
|
-
|
|
420
|
+
je,
|
|
421
421
|
{
|
|
422
|
-
id:
|
|
423
|
-
onChange: ({ formData: d }) =>
|
|
424
|
-
formData:
|
|
422
|
+
id: o == null ? void 0 : o._id,
|
|
423
|
+
onChange: ({ formData: d }) => l(o._id, d),
|
|
424
|
+
formData: g(r, o._id, {}),
|
|
425
425
|
properties: n
|
|
426
426
|
}
|
|
427
427
|
) })
|
|
428
428
|
] });
|
|
429
429
|
};
|
|
430
|
-
function
|
|
431
|
-
const r =
|
|
432
|
-
if (
|
|
433
|
-
const
|
|
434
|
-
t([r._id], { [
|
|
430
|
+
function ds() {
|
|
431
|
+
const r = X(), a = st(), t = ot(), l = Se(r._type), o = { ...r }, [n, d] = j(o), p = lt("dataBindingSupport", !1), s = ({ formData: y }, x, v) => {
|
|
432
|
+
if (x && (n == null ? void 0 : n._id) === r._id) {
|
|
433
|
+
const k = x.replace("root.", "");
|
|
434
|
+
t([r._id], { [k]: g(y, k) }, v);
|
|
435
435
|
}
|
|
436
|
-
},
|
|
437
|
-
|
|
438
|
-
s({ formData:
|
|
436
|
+
}, c = B(
|
|
437
|
+
Nt(({ formData: y }, x, v) => {
|
|
438
|
+
s({ formData: y }, x, v), d(y);
|
|
439
439
|
}, 1500),
|
|
440
440
|
[r == null ? void 0 : r._id]
|
|
441
|
-
),
|
|
442
|
-
if (
|
|
443
|
-
const v =
|
|
444
|
-
|
|
441
|
+
), u = ({ formData: y }, x) => {
|
|
442
|
+
if (x) {
|
|
443
|
+
const v = x.replace("root.", "");
|
|
444
|
+
a(
|
|
445
445
|
[r._id],
|
|
446
|
-
|
|
447
|
-
),
|
|
446
|
+
jr(v, g(y, v.split(".")))
|
|
447
|
+
), c({ formData: y }, x, { [v]: g(n, v) });
|
|
448
448
|
}
|
|
449
|
-
}, i = he(
|
|
450
|
-
const
|
|
451
|
-
return
|
|
452
|
-
}, [
|
|
449
|
+
}, i = he(g(o, "_bindings", {})), h = R(() => {
|
|
450
|
+
const y = _t(g(l, "props", {}));
|
|
451
|
+
return p && St(i, (x) => delete y[x]), y;
|
|
452
|
+
}, [l, i, p]);
|
|
453
453
|
return /* @__PURE__ */ e.jsxs("div", { className: "overflow-x-hidden", children: [
|
|
454
|
-
/* @__PURE__ */ e.jsx(
|
|
455
|
-
|
|
456
|
-
/* @__PURE__ */ e.jsxs(
|
|
454
|
+
/* @__PURE__ */ e.jsx(is, {}),
|
|
455
|
+
p ? /* @__PURE__ */ e.jsxs(at, { type: "multiple", defaultValue: ["STATIC", "BINDING"], className: "h-full w-full", children: [
|
|
456
|
+
/* @__PURE__ */ e.jsxs(be, { value: "BINDING", children: [
|
|
457
457
|
/* @__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: [
|
|
458
458
|
/* @__PURE__ */ e.jsx(
|
|
459
459
|
"div",
|
|
460
460
|
{
|
|
461
|
-
className: `h-[8px] w-[8px] rounded-full ${
|
|
461
|
+
className: `h-[8px] w-[8px] rounded-full ${b(g(r, "_bindings", {})) ? "bg-gray-300" : "bg-blue-500"}`
|
|
462
462
|
}
|
|
463
463
|
),
|
|
464
464
|
"Data Binding"
|
|
465
465
|
] }) }),
|
|
466
466
|
/* @__PURE__ */ e.jsx(ve, { className: "px-4 pt-4", children: /* @__PURE__ */ e.jsx(
|
|
467
|
-
|
|
467
|
+
ls,
|
|
468
468
|
{
|
|
469
|
-
bindingData:
|
|
470
|
-
onChange: (
|
|
471
|
-
s({ formData: { _bindings:
|
|
469
|
+
bindingData: g(r, "_bindings", {}),
|
|
470
|
+
onChange: (y) => {
|
|
471
|
+
s({ formData: { _bindings: y } }, "root._bindings");
|
|
472
472
|
}
|
|
473
473
|
}
|
|
474
474
|
) })
|
|
475
475
|
] }),
|
|
476
|
-
/* @__PURE__ */ e.jsxs(
|
|
476
|
+
/* @__PURE__ */ e.jsxs(be, { value: "STATIC", children: [
|
|
477
477
|
/* @__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: [
|
|
478
478
|
/* @__PURE__ */ e.jsx("div", { className: "h-[8px] w-[8px] rounded-full bg-blue-500" }),
|
|
479
479
|
"Static Content"
|
|
480
480
|
] }) }),
|
|
481
481
|
/* @__PURE__ */ e.jsxs(ve, { className: "pt-4", children: [
|
|
482
|
-
|
|
482
|
+
b(i) ? 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: [
|
|
483
483
|
"Data binding is set for ",
|
|
484
|
-
/* @__PURE__ */ e.jsx("b", { children:
|
|
484
|
+
/* @__PURE__ */ e.jsx("b", { children: T(i, me).join(", ") }),
|
|
485
485
|
" ",
|
|
486
486
|
i.length === 1 ? "property" : "properties",
|
|
487
487
|
". Remove data binding to edit static content."
|
|
488
488
|
] }),
|
|
489
489
|
/* @__PURE__ */ e.jsx(
|
|
490
|
-
|
|
490
|
+
je,
|
|
491
491
|
{
|
|
492
492
|
id: r == null ? void 0 : r._id,
|
|
493
|
-
onChange:
|
|
494
|
-
formData:
|
|
495
|
-
properties:
|
|
493
|
+
onChange: u,
|
|
494
|
+
formData: o,
|
|
495
|
+
properties: h
|
|
496
496
|
}
|
|
497
497
|
)
|
|
498
498
|
] })
|
|
499
499
|
] })
|
|
500
500
|
] }) : /* @__PURE__ */ e.jsx(
|
|
501
|
-
|
|
501
|
+
je,
|
|
502
502
|
{
|
|
503
503
|
id: r == null ? void 0 : r._id,
|
|
504
|
-
onChange:
|
|
505
|
-
formData:
|
|
506
|
-
properties:
|
|
504
|
+
onChange: u,
|
|
505
|
+
formData: o,
|
|
506
|
+
properties: h
|
|
507
507
|
}
|
|
508
508
|
)
|
|
509
509
|
] });
|
|
510
510
|
}
|
|
511
|
-
const
|
|
512
|
-
const { t:
|
|
511
|
+
const cs = ({ blockId: r }) => {
|
|
512
|
+
const { t: a } = F(), { askAi: t, loading: l, error: o } = Cr(), [n, d] = j(""), p = ye(null);
|
|
513
513
|
A(() => {
|
|
514
|
-
var
|
|
515
|
-
(
|
|
514
|
+
var c;
|
|
515
|
+
(c = p.current) == null || c.focus();
|
|
516
516
|
}, []);
|
|
517
517
|
const s = () => {
|
|
518
|
-
|
|
518
|
+
o || d("");
|
|
519
519
|
};
|
|
520
520
|
return /* @__PURE__ */ e.jsxs("div", { className: "", children: [
|
|
521
|
-
/* @__PURE__ */ e.jsx("h2", { className: "mb-1 text-sm font-semibold leading-none tracking-tight", children:
|
|
521
|
+
/* @__PURE__ */ e.jsx("h2", { className: "mb-1 text-sm font-semibold leading-none tracking-tight", children: a("Ask AI") }),
|
|
522
522
|
/* @__PURE__ */ e.jsx(
|
|
523
|
-
|
|
523
|
+
nt,
|
|
524
524
|
{
|
|
525
|
-
ref:
|
|
525
|
+
ref: p,
|
|
526
526
|
value: n,
|
|
527
|
-
onChange: (
|
|
528
|
-
placeholder:
|
|
527
|
+
onChange: (c) => d(c.target.value),
|
|
528
|
+
placeholder: a("Ask AI to edit styles"),
|
|
529
529
|
className: "w-full border border-gray-400 focus:border-0",
|
|
530
530
|
rows: 3,
|
|
531
|
-
onKeyDown: (
|
|
532
|
-
|
|
531
|
+
onKeyDown: (c) => {
|
|
532
|
+
c.key === "Enter" && (c.preventDefault(), t("styles", r, n, s));
|
|
533
533
|
}
|
|
534
534
|
}
|
|
535
535
|
),
|
|
536
536
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2 my-2", children: [
|
|
537
|
-
|
|
538
|
-
|
|
537
|
+
l ? null : /* @__PURE__ */ e.jsx(
|
|
538
|
+
P,
|
|
539
539
|
{
|
|
540
|
-
disabled: n.trim().length < 5 ||
|
|
540
|
+
disabled: n.trim().length < 5 || l,
|
|
541
541
|
onClick: () => t("styles", r, n, s),
|
|
542
542
|
variant: "default",
|
|
543
543
|
className: "w-fit",
|
|
544
544
|
size: "sm",
|
|
545
|
-
children:
|
|
546
|
-
/* @__PURE__ */ e.jsx(
|
|
547
|
-
|
|
548
|
-
] }) :
|
|
545
|
+
children: l ? /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
546
|
+
/* @__PURE__ */ e.jsx(Er, { className: "w-5 h-5 animate-spin" }),
|
|
547
|
+
a("Generating... Please wait")
|
|
548
|
+
] }) : a("Edit with AI")
|
|
549
549
|
}
|
|
550
550
|
),
|
|
551
|
-
|
|
551
|
+
l ? /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col gap-2", children: [
|
|
552
552
|
/* @__PURE__ */ e.jsxs(kr, { className: "flex items-center w-full px-4 py-1 pl-2 space-x-1", children: [
|
|
553
553
|
/* @__PURE__ */ e.jsx(Nr, { className: "w-4 h-4 text-gray-500 animate-spin" }),
|
|
554
|
-
/* @__PURE__ */ e.jsx("p", { className: "text-xs", children:
|
|
554
|
+
/* @__PURE__ */ e.jsx("p", { className: "text-xs", children: a("Generating... Please wait") })
|
|
555
555
|
] }),
|
|
556
|
-
/* @__PURE__ */ e.jsx(
|
|
556
|
+
/* @__PURE__ */ e.jsx(P, { variant: "destructive", onClick: () => stop(), className: "hidden w-fit", size: "sm", children: a("Stop") })
|
|
557
557
|
] }) : null
|
|
558
558
|
] }),
|
|
559
|
-
/* @__PURE__ */ e.jsx("div", { className: "max-w-full", children:
|
|
559
|
+
/* @__PURE__ */ e.jsx("div", { className: "max-w-full", children: o && /* @__PURE__ */ e.jsx("p", { className: "p-1 text-xs text-red-500 break-words bg-red-100 border border-red-500 rounded", children: o.message }) })
|
|
560
560
|
] });
|
|
561
|
-
}, ze = new
|
|
561
|
+
}, ze = new qr(Jr, {
|
|
562
562
|
isCaseSensitive: !1,
|
|
563
563
|
threshold: 0.2,
|
|
564
564
|
minMatchCharLength: 2,
|
|
565
565
|
keys: ["name"]
|
|
566
566
|
});
|
|
567
|
-
function
|
|
568
|
-
var
|
|
569
|
-
const { t: r } =
|
|
570
|
-
const
|
|
571
|
-
|
|
572
|
-
}, [
|
|
573
|
-
const
|
|
574
|
-
let
|
|
567
|
+
function gt() {
|
|
568
|
+
var N;
|
|
569
|
+
const { t: r } = F(), [a] = le(), t = X(), l = _e(), o = it(), [n] = dt(), d = lt("askAiCallBack", null), [p, s] = j(""), { toast: c } = _r(), u = (N = oe(a)) == null ? void 0 : N.prop, i = Tt((g(t, u, "").replace(es, "").split(",").pop() || "").split(" "), b), h = () => {
|
|
570
|
+
const C = p.trim().toLowerCase().replace(/ +(?= )/g, "").split(" ");
|
|
571
|
+
l(n, C, !0), s("");
|
|
572
|
+
}, [y, x] = j([]), v = ({ value: C }) => {
|
|
573
|
+
const V = C.trim().toLowerCase(), W = V.match(/.+:/g);
|
|
574
|
+
let m = [];
|
|
575
575
|
if (W && W.length > 0) {
|
|
576
|
-
const [f] = W,
|
|
577
|
-
|
|
578
|
-
...
|
|
579
|
-
item: { ...
|
|
576
|
+
const [f] = W, S = V.replace(f, "");
|
|
577
|
+
m = ze.search(S).map((L) => ({
|
|
578
|
+
...L,
|
|
579
|
+
item: { ...L.item, name: f + L.item.name }
|
|
580
580
|
}));
|
|
581
581
|
} else
|
|
582
|
-
|
|
583
|
-
return
|
|
584
|
-
},
|
|
585
|
-
|
|
586
|
-
},
|
|
582
|
+
m = ze.search(V);
|
|
583
|
+
return x(T(m, "item"));
|
|
584
|
+
}, k = () => {
|
|
585
|
+
x([]);
|
|
586
|
+
}, E = (C) => C.name, I = (C) => /* @__PURE__ */ e.jsx("div", { className: "rounded-md p-1", children: C.name }), Z = {
|
|
587
587
|
autoComplete: "off",
|
|
588
588
|
autoCorrect: "off",
|
|
589
589
|
autoCapitalize: "off",
|
|
590
590
|
spellCheck: !1,
|
|
591
591
|
placeholder: r("Enter classes separated by space"),
|
|
592
|
-
value:
|
|
593
|
-
onKeyDown: (
|
|
594
|
-
|
|
592
|
+
value: p,
|
|
593
|
+
onKeyDown: (C) => {
|
|
594
|
+
C.key === "Enter" && p.trim() !== "" && h();
|
|
595
595
|
},
|
|
596
|
-
onChange: (
|
|
596
|
+
onChange: (C, { newValue: V }) => s(V),
|
|
597
597
|
className: "w-full rounded-md text-xs px-2 hover:outline-0 bg-background border-border py-1"
|
|
598
|
-
},
|
|
598
|
+
}, w = () => {
|
|
599
599
|
if (navigator.clipboard === void 0) {
|
|
600
|
-
|
|
600
|
+
c({
|
|
601
601
|
title: "Clipboard not supported",
|
|
602
602
|
description: "Please use Chrome, Firefox or Safari",
|
|
603
603
|
variant: "destructive"
|
|
604
604
|
});
|
|
605
605
|
return;
|
|
606
606
|
}
|
|
607
|
-
navigator.clipboard.writeText(i.join(" ")),
|
|
607
|
+
navigator.clipboard.writeText(i.join(" ")), c({
|
|
608
608
|
title: "Copied",
|
|
609
609
|
description: "Classes copied to clipboard"
|
|
610
610
|
});
|
|
@@ -612,34 +612,34 @@ function ut() {
|
|
|
612
612
|
return /* @__PURE__ */ e.jsxs(
|
|
613
613
|
"div",
|
|
614
614
|
{
|
|
615
|
-
className: `flex ${
|
|
615
|
+
className: `flex ${y.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`,
|
|
616
616
|
children: [
|
|
617
617
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center justify-between gap-x-2", children: [
|
|
618
618
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-x-2", children: [
|
|
619
619
|
/* @__PURE__ */ e.jsx("span", { children: r("Classes") }),
|
|
620
|
-
/* @__PURE__ */ e.jsxs(
|
|
621
|
-
/* @__PURE__ */ e.jsx(
|
|
622
|
-
/* @__PURE__ */ e.jsx(
|
|
620
|
+
/* @__PURE__ */ e.jsxs(U, { children: [
|
|
621
|
+
/* @__PURE__ */ e.jsx(K, { asChild: !0, children: /* @__PURE__ */ e.jsx(It, { onClick: w, className: "cursor-pointer" }) }),
|
|
622
|
+
/* @__PURE__ */ e.jsx(G, { children: /* @__PURE__ */ e.jsx("p", { children: r("Copy classes to clipboard") }) })
|
|
623
623
|
] })
|
|
624
624
|
] }),
|
|
625
625
|
d ? /* @__PURE__ */ e.jsxs(Qe, { children: [
|
|
626
|
-
/* @__PURE__ */ e.jsx(et, { children: /* @__PURE__ */ e.jsxs(
|
|
627
|
-
/* @__PURE__ */ e.jsx(
|
|
626
|
+
/* @__PURE__ */ e.jsx(et, { children: /* @__PURE__ */ e.jsxs(P, { variant: "default", className: "h-6 w-fit", size: "sm", children: [
|
|
627
|
+
/* @__PURE__ */ e.jsx(Mr, { className: "h-4 w-4" }),
|
|
628
628
|
/* @__PURE__ */ e.jsx("span", { className: "ml-2", children: r("Ask AI") })
|
|
629
629
|
] }) }),
|
|
630
|
-
/* @__PURE__ */ e.jsx(tt, { side: "left", className: "p-2", children: /* @__PURE__ */ e.jsx(
|
|
630
|
+
/* @__PURE__ */ e.jsx(tt, { side: "left", className: "p-2", children: /* @__PURE__ */ e.jsx(cs, { blockId: t == null ? void 0 : t._id }) })
|
|
631
631
|
] }) : null
|
|
632
632
|
] }),
|
|
633
633
|
/* @__PURE__ */ e.jsxs("div", { className: "relative flex items-center gap-x-3", children: [
|
|
634
634
|
/* @__PURE__ */ e.jsx("div", { className: "relative flex w-full items-center gap-x-3", children: /* @__PURE__ */ e.jsx(
|
|
635
|
-
|
|
635
|
+
Gr,
|
|
636
636
|
{
|
|
637
|
-
suggestions:
|
|
637
|
+
suggestions: y,
|
|
638
638
|
onSuggestionsFetchRequested: v,
|
|
639
|
-
onSuggestionsClearRequested:
|
|
640
|
-
getSuggestionValue:
|
|
641
|
-
renderSuggestion:
|
|
642
|
-
inputProps:
|
|
639
|
+
onSuggestionsClearRequested: k,
|
|
640
|
+
getSuggestionValue: E,
|
|
641
|
+
renderSuggestion: I,
|
|
642
|
+
inputProps: Z,
|
|
643
643
|
containerProps: {
|
|
644
644
|
className: "relative h-8 w-full gap-y-1 py-1 border-gray-600"
|
|
645
645
|
},
|
|
@@ -651,172 +651,162 @@ function ut() {
|
|
|
651
651
|
}
|
|
652
652
|
) }),
|
|
653
653
|
/* @__PURE__ */ e.jsx(
|
|
654
|
-
|
|
654
|
+
P,
|
|
655
655
|
{
|
|
656
656
|
variant: "outline",
|
|
657
657
|
className: "h-6 border-gray-700",
|
|
658
|
-
onClick:
|
|
659
|
-
disabled:
|
|
658
|
+
onClick: h,
|
|
659
|
+
disabled: p.trim() === "",
|
|
660
660
|
size: "sm",
|
|
661
|
-
children: /* @__PURE__ */ e.jsx(
|
|
661
|
+
children: /* @__PURE__ */ e.jsx(Ke, {})
|
|
662
662
|
}
|
|
663
663
|
)
|
|
664
664
|
] }),
|
|
665
665
|
/* @__PURE__ */ e.jsx("div", { className: "flex w-full flex-wrap gap-2 overflow-x-hidden", children: ie.Children.toArray(
|
|
666
|
-
i.map((
|
|
666
|
+
i.map((C) => /* @__PURE__ */ e.jsxs(
|
|
667
667
|
"div",
|
|
668
668
|
{
|
|
669
669
|
className: "group relative flex max-w-[260px] cursor-default items-center gap-x-1 truncate rounded border border-gray-300 bg-gray-200 p-px px-1.5 text-[11px] text-gray-600 hover:border-gray-300",
|
|
670
670
|
children: [
|
|
671
|
-
|
|
671
|
+
C,
|
|
672
672
|
/* @__PURE__ */ e.jsx(
|
|
673
|
-
|
|
673
|
+
Ge,
|
|
674
674
|
{
|
|
675
|
-
onClick: () =>
|
|
675
|
+
onClick: () => o(n, [C]),
|
|
676
676
|
className: "invisible absolute right-1 rounded-full bg-red-400 hover:text-white group-hover:visible group-hover:cursor-pointer"
|
|
677
677
|
}
|
|
678
678
|
)
|
|
679
679
|
]
|
|
680
680
|
},
|
|
681
|
-
|
|
681
|
+
C
|
|
682
682
|
))
|
|
683
683
|
) })
|
|
684
684
|
]
|
|
685
685
|
}
|
|
686
686
|
);
|
|
687
687
|
}
|
|
688
|
-
const
|
|
689
|
-
const
|
|
690
|
-
|
|
688
|
+
const ps = $.memo(function({ preloadedAttributes: a = [], onAttributesChange: t }) {
|
|
689
|
+
const [l, o] = j([]), [n, d] = j(""), [p, s] = j(""), [c, u] = j(null), [i, h] = j(""), y = ye(null), x = ye(null);
|
|
690
|
+
A(() => {
|
|
691
|
+
y.current && y.current.focus();
|
|
692
|
+
}, [l]), A(() => {
|
|
693
|
+
o(a);
|
|
694
|
+
}, [a]);
|
|
695
|
+
const v = () => {
|
|
696
|
+
if (n.startsWith("@")) {
|
|
697
|
+
h("Attribute keys cannot start with '@'");
|
|
698
|
+
return;
|
|
699
|
+
}
|
|
700
|
+
if (n) {
|
|
701
|
+
const w = [...l, { key: n, value: p }];
|
|
702
|
+
t(w), o(l), d(""), s(""), h("");
|
|
703
|
+
}
|
|
704
|
+
}, k = (w) => {
|
|
705
|
+
const N = l.filter((C, V) => V !== w);
|
|
706
|
+
t(N), o(N);
|
|
707
|
+
}, E = (w) => {
|
|
708
|
+
u(w), d(l[w].key), s(l[w].value);
|
|
709
|
+
}, I = () => {
|
|
710
|
+
if (n.startsWith("@")) {
|
|
711
|
+
h("Attribute keys cannot start with '@'");
|
|
712
|
+
return;
|
|
713
|
+
}
|
|
714
|
+
if (c !== null && n) {
|
|
715
|
+
const w = [...l];
|
|
716
|
+
w[c] = { key: n, value: p }, t(w), o(w), u(null), d(""), s(""), h("");
|
|
717
|
+
}
|
|
718
|
+
}, Z = (w) => {
|
|
719
|
+
w.key === "Enter" && !w.shiftKey && (w.preventDefault(), c !== null ? I() : v());
|
|
691
720
|
};
|
|
692
|
-
return /* @__PURE__ */ e.jsxs("div", { className: "
|
|
693
|
-
/* @__PURE__ */ e.
|
|
694
|
-
|
|
721
|
+
return /* @__PURE__ */ e.jsxs("div", { className: "px-1", children: [
|
|
722
|
+
/* @__PURE__ */ e.jsxs(
|
|
723
|
+
"form",
|
|
695
724
|
{
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
725
|
+
onSubmit: (w) => {
|
|
726
|
+
w.preventDefault(), c !== null ? I() : v();
|
|
727
|
+
},
|
|
728
|
+
className: "space-y-3",
|
|
729
|
+
children: [
|
|
730
|
+
/* @__PURE__ */ e.jsxs("div", { className: "flex flex-col", children: [
|
|
731
|
+
/* @__PURE__ */ e.jsxs("div", { className: "w-full", children: [
|
|
732
|
+
/* @__PURE__ */ e.jsx(Be, { htmlFor: "attrKey", className: "text-xs", children: "Key" }),
|
|
733
|
+
/* @__PURE__ */ e.jsx(
|
|
734
|
+
ct,
|
|
735
|
+
{
|
|
736
|
+
id: "attrKey",
|
|
737
|
+
ref: y,
|
|
738
|
+
value: n,
|
|
739
|
+
onChange: (w) => d(w.target.value),
|
|
740
|
+
placeholder: "Key",
|
|
741
|
+
className: "h-8 text-sm"
|
|
742
|
+
}
|
|
743
|
+
)
|
|
744
|
+
] }),
|
|
745
|
+
/* @__PURE__ */ e.jsxs("div", { className: "w-full", children: [
|
|
746
|
+
/* @__PURE__ */ e.jsx(Be, { htmlFor: "attrValue", className: "text-xs", children: "Value" }),
|
|
747
|
+
/* @__PURE__ */ e.jsx(
|
|
748
|
+
nt,
|
|
749
|
+
{
|
|
750
|
+
id: "attrValue",
|
|
751
|
+
rows: 2,
|
|
752
|
+
ref: x,
|
|
753
|
+
value: p,
|
|
754
|
+
onChange: (w) => s(w.target.value),
|
|
755
|
+
onKeyDown: Z,
|
|
756
|
+
placeholder: "Value",
|
|
757
|
+
className: "bg-background text-sm"
|
|
758
|
+
}
|
|
759
|
+
)
|
|
760
|
+
] })
|
|
761
|
+
] }),
|
|
762
|
+
/* @__PURE__ */ e.jsx(P, { type: "submit", className: "h-8 w-full text-sm", children: c !== null ? "Save" : "Add" }),
|
|
763
|
+
i && /* @__PURE__ */ e.jsx("p", { className: "text-xs text-red-500", children: i })
|
|
764
|
+
]
|
|
706
765
|
}
|
|
707
766
|
),
|
|
708
|
-
/* @__PURE__ */ e.jsx("div", { className: "
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
className: "
|
|
712
|
-
name: "value",
|
|
713
|
-
onChange: (n) => a({ ...t, value: n.target.value }),
|
|
714
|
-
value: t.value,
|
|
715
|
-
placeholder: o("Value"),
|
|
716
|
-
autoComplete: "off",
|
|
717
|
-
autoCapitalize: "off",
|
|
718
|
-
onKeyDown: (n) => {
|
|
719
|
-
n.key === "Enter" && (n.preventDefault(), m(t.key) || l());
|
|
720
|
-
}
|
|
721
|
-
}
|
|
722
|
-
) }),
|
|
723
|
-
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-x-2", children: [
|
|
724
|
-
/* @__PURE__ */ e.jsxs(B, { disabled: m(t.key), onClick: l, size: "sm", className: "flex items-center", children: [
|
|
725
|
-
/* @__PURE__ */ e.jsxs("span", { children: [
|
|
726
|
-
o("Add"),
|
|
727
|
-
" "
|
|
728
|
-
] }),
|
|
729
|
-
/* @__PURE__ */ e.jsx(_e, {})
|
|
767
|
+
/* @__PURE__ */ e.jsx("div", { className: "mt-4 space-y-1 overflow-y-auto", children: l.map((w, N) => /* @__PURE__ */ e.jsxs("div", { className: "flex items-center justify-between rounded bg-muted p-1.5 text-sm", children: [
|
|
768
|
+
/* @__PURE__ */ e.jsxs("div", { className: "mr-2 flex flex-col", children: [
|
|
769
|
+
/* @__PURE__ */ e.jsx("span", { className: "truncate font-semibold", children: w.key }),
|
|
770
|
+
/* @__PURE__ */ e.jsx("span", { className: "text-wrap max-w-[200px] text-muted-foreground", children: w.value })
|
|
730
771
|
] }),
|
|
731
|
-
|
|
732
|
-
|
|
772
|
+
/* @__PURE__ */ e.jsxs("div", { className: "flex-shrink-0", children: [
|
|
773
|
+
/* @__PURE__ */ e.jsxs(P, { variant: "ghost", size: "icon", className: "h-6 w-6", onClick: () => E(N), children: [
|
|
774
|
+
/* @__PURE__ */ e.jsx(Lr, { className: "h-3 w-3" }),
|
|
775
|
+
/* @__PURE__ */ e.jsx("span", { className: "sr-only", children: "Edit attribute" })
|
|
776
|
+
] }),
|
|
777
|
+
/* @__PURE__ */ e.jsxs(P, { variant: "ghost", size: "icon", className: "h-6 w-6", onClick: () => k(N), children: [
|
|
778
|
+
/* @__PURE__ */ e.jsx(Or, { className: "h-3 w-3" }),
|
|
779
|
+
/* @__PURE__ */ e.jsx("span", { className: "sr-only", children: "Remove attribute" })
|
|
780
|
+
] })
|
|
781
|
+
] })
|
|
782
|
+
] }, N)) })
|
|
733
783
|
] });
|
|
734
|
-
},
|
|
735
|
-
const r =
|
|
784
|
+
}), us = ie.memo(() => {
|
|
785
|
+
const r = X(), [a, t] = j([]), [l] = le(), o = st(), n = ot(), d = `${g(l, "0.prop")}_attrs`;
|
|
736
786
|
ie.useEffect(() => {
|
|
737
|
-
const
|
|
738
|
-
|
|
739
|
-
}, [
|
|
740
|
-
const p = (
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
c({
|
|
747
|
-
title: d("Cannot add predefined attribute"),
|
|
748
|
-
variant: "destructive",
|
|
749
|
-
description: d(`"(${u.key})" cannot be added as it is a predefined attribute for this block`)
|
|
750
|
-
});
|
|
751
|
-
return;
|
|
752
|
-
}
|
|
753
|
-
const g = [...o, u];
|
|
754
|
-
i(g);
|
|
755
|
-
}, i = ie.useCallback(
|
|
756
|
-
(u = []) => {
|
|
757
|
-
const x = {};
|
|
758
|
-
Ne(u, (g) => {
|
|
759
|
-
m(g.key) || Ue(x, g.key, g.value);
|
|
760
|
-
}), n([y(r, "_id")], { [s]: x });
|
|
787
|
+
const s = T(g(r, d), (c, u) => ({ key: u, value: c }));
|
|
788
|
+
b(s) ? t([]) : t(s);
|
|
789
|
+
}, [g(r, d)]);
|
|
790
|
+
const p = ie.useCallback(
|
|
791
|
+
(s = []) => {
|
|
792
|
+
const c = {};
|
|
793
|
+
ke(s, (u) => {
|
|
794
|
+
b(u.key) || We(c, u.key, u.value);
|
|
795
|
+
}), n([g(r, "_id")], { [d]: c });
|
|
761
796
|
},
|
|
762
|
-
[r,
|
|
797
|
+
[r, o, d]
|
|
763
798
|
);
|
|
764
|
-
return /* @__PURE__ */ e.jsx("div", { className: "mb-20 flex min-h-max flex-col gap-y-2 overflow-y-auto", children: /* @__PURE__ */ e.
|
|
765
|
-
|
|
766
|
-
m(o) ? /* @__PURE__ */ e.jsx("li", { className: "flex h-4 items-center justify-center", children: /* @__PURE__ */ e.jsx("p", { children: d("No attributes added") }) }) : null,
|
|
767
|
-
ie.Children.toArray(
|
|
768
|
-
_(o, (u) => /* @__PURE__ */ e.jsxs("li", { className: "group flex w-full max-w-full items-center justify-between", children: [
|
|
769
|
-
/* @__PURE__ */ e.jsxs($, { delayDuration: 1e3, children: [
|
|
770
|
-
/* @__PURE__ */ e.jsx(E, { asChild: !0, children: /* @__PURE__ */ e.jsxs("div", { className: "max-w-[230px] cursor-default truncate px-1 hover:bg-gray-200", children: [
|
|
771
|
-
u.key,
|
|
772
|
-
u.value.toString().trim() ? /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
773
|
-
" ",
|
|
774
|
-
/* @__PURE__ */ e.jsx("span", { className: "font-bold text-orange-500", children: "=" }),
|
|
775
|
-
" ",
|
|
776
|
-
u.value.toString().trim()
|
|
777
|
-
] }) : null
|
|
778
|
-
] }) }),
|
|
779
|
-
/* @__PURE__ */ e.jsxs(M, { className: "max-w-[200px]", children: [
|
|
780
|
-
/* @__PURE__ */ e.jsxs("div", { children: [
|
|
781
|
-
d("Name"),
|
|
782
|
-
": ",
|
|
783
|
-
u.key
|
|
784
|
-
] }),
|
|
785
|
-
/* @__PURE__ */ e.jsxs("div", { children: [
|
|
786
|
-
d("Value"),
|
|
787
|
-
": ",
|
|
788
|
-
u.value.toString()
|
|
789
|
-
] })
|
|
790
|
-
] })
|
|
791
|
-
] }),
|
|
792
|
-
/* @__PURE__ */ e.jsxs($, { children: [
|
|
793
|
-
/* @__PURE__ */ e.jsx(E, { asChild: !0, children: /* @__PURE__ */ e.jsx(
|
|
794
|
-
"button",
|
|
795
|
-
{
|
|
796
|
-
disabled: U(u.value, "dnd-"),
|
|
797
|
-
className: "invisible group-hover:visible",
|
|
798
|
-
onClick: () => p(o.indexOf(u)),
|
|
799
|
-
children: /* @__PURE__ */ e.jsx(Mr, { className: "w-4 text-gray-500" })
|
|
800
|
-
}
|
|
801
|
-
) }),
|
|
802
|
-
/* @__PURE__ */ e.jsx(M, { className: "max-w-[200px]", children: U(u.value.toString(), "dnd-") ? d("Predefined attribute. Cannot be deleted") : d("Remove attribute") })
|
|
803
|
-
] })
|
|
804
|
-
] }))
|
|
805
|
-
)
|
|
806
|
-
] }) }),
|
|
807
|
-
/* @__PURE__ */ e.jsx("div", { className: "py-2" }),
|
|
808
|
-
/* @__PURE__ */ e.jsx(ds, { onAdd: (u) => h(u) })
|
|
809
|
-
] }) });
|
|
810
|
-
}, k = ["px", "%", "em", "rem", "ch", "vh", "vw"], ps = {
|
|
799
|
+
return /* @__PURE__ */ e.jsx("div", { className: "mb-20 flex min-h-max flex-col gap-y-2 overflow-y-auto", children: /* @__PURE__ */ e.jsx("div", { className: "flex flex-col", children: /* @__PURE__ */ e.jsx("div", { children: /* @__PURE__ */ e.jsx(ps, { preloadedAttributes: a, onAttributesChange: p }) }) }) });
|
|
800
|
+
}), _ = ["px", "%", "em", "rem", "ch", "vh", "vw"], gs = {
|
|
811
801
|
heading: "flex.heading",
|
|
812
802
|
items: [
|
|
813
|
-
{ type: "arbitrary", label: "flex.basis", units:
|
|
803
|
+
{ type: "arbitrary", label: "flex.basis", units: _, property: "flexBasis" },
|
|
814
804
|
{ type: "range", label: "flex.order", property: "order" },
|
|
815
805
|
{ type: "dropdown", label: "flex.flex", property: "flexGrowShrink" },
|
|
816
806
|
{ type: "dropdown", label: "flex.grow", property: "flexGrow" },
|
|
817
807
|
{ type: "dropdown", label: "flex.shrink", property: "flexShrink" }
|
|
818
808
|
]
|
|
819
|
-
},
|
|
809
|
+
}, xs = {
|
|
820
810
|
heading: "grid.heading",
|
|
821
811
|
items: [
|
|
822
812
|
{ type: "range", label: "grid.col_span", property: "gridColSpan" },
|
|
@@ -827,18 +817,18 @@ const ds = ({ onAdd: r }) => {
|
|
|
827
817
|
{ type: "range", label: "grid.row_end", property: "gridRowEnd" },
|
|
828
818
|
{ type: "range", label: "grid.order", property: "order" }
|
|
829
819
|
]
|
|
830
|
-
},
|
|
820
|
+
}, ys = [
|
|
831
821
|
{
|
|
832
822
|
heading: "Styles",
|
|
833
823
|
items: [
|
|
834
|
-
{ component:
|
|
835
|
-
{ type: "arbitrary", label: "layout.width", units:
|
|
836
|
-
{ type: "arbitrary", label: "layout.height", units:
|
|
824
|
+
{ component: gt },
|
|
825
|
+
{ type: "arbitrary", label: "layout.width", units: _.concat("auto"), property: "width" },
|
|
826
|
+
{ type: "arbitrary", label: "layout.height", units: _.concat("auto"), property: "height" },
|
|
837
827
|
{
|
|
838
828
|
styleType: "multiple",
|
|
839
829
|
label: "layout.margin",
|
|
840
830
|
negative: !0,
|
|
841
|
-
units: [...
|
|
831
|
+
units: [..._, "auto"],
|
|
842
832
|
options: [
|
|
843
833
|
{ key: "margin", label: "layout.margin_all" },
|
|
844
834
|
{ key: "marginX", label: "layout.margin_lr" },
|
|
@@ -868,8 +858,8 @@ const ds = ({ onAdd: r }) => {
|
|
|
868
858
|
items: [
|
|
869
859
|
{ type: "dropdown", property: "textAlign", label: "typography.align" },
|
|
870
860
|
{ type: "dropdown", property: "fontFamily", label: "typography.font" },
|
|
871
|
-
{ type: "arbitrary", property: "fontSize", label: "typography.size", units:
|
|
872
|
-
{ type: "arbitrary", property: "lineHeight", label: "typography.height", units:
|
|
861
|
+
{ type: "arbitrary", property: "fontSize", label: "typography.size", units: _ },
|
|
862
|
+
{ type: "arbitrary", property: "lineHeight", label: "typography.height", units: _.concat("-") },
|
|
873
863
|
{ type: "range", property: "fontWeight", label: "typography.weight" },
|
|
874
864
|
{ type: "color", property: "textColor", label: "typography.color" }
|
|
875
865
|
]
|
|
@@ -891,19 +881,19 @@ const ds = ({ onAdd: r }) => {
|
|
|
891
881
|
},
|
|
892
882
|
{
|
|
893
883
|
heading: "Attributes",
|
|
894
|
-
items: [{ component:
|
|
884
|
+
items: [{ component: us }]
|
|
895
885
|
}
|
|
896
|
-
],
|
|
886
|
+
], Ao = [
|
|
897
887
|
{
|
|
898
888
|
heading: "layout.heading",
|
|
899
889
|
items: [
|
|
900
|
-
{ type: "arbitrary", label: "layout.width", units:
|
|
901
|
-
{ type: "arbitrary", label: "layout.height", units:
|
|
890
|
+
{ type: "arbitrary", label: "layout.width", units: _.concat("auto"), property: "width" },
|
|
891
|
+
{ type: "arbitrary", label: "layout.height", units: _.concat("auto"), property: "height" },
|
|
902
892
|
{
|
|
903
893
|
styleType: "multiple",
|
|
904
894
|
label: "layout.margin",
|
|
905
895
|
negative: !0,
|
|
906
|
-
units: [...
|
|
896
|
+
units: [..._, "auto"],
|
|
907
897
|
options: [
|
|
908
898
|
{ key: "margin", label: "layout.margin_all" },
|
|
909
899
|
{ key: "marginX", label: "layout.margin_lr" },
|
|
@@ -944,16 +934,16 @@ const ds = ({ onAdd: r }) => {
|
|
|
944
934
|
styleType: "accordion",
|
|
945
935
|
heading: "size.min_width_height",
|
|
946
936
|
items: [
|
|
947
|
-
{ type: "arbitrary", label: "size.min_width", units:
|
|
948
|
-
{ type: "arbitrary", label: "size.min_height", units:
|
|
937
|
+
{ type: "arbitrary", label: "size.min_width", units: _.concat("auto"), property: "minWidth" },
|
|
938
|
+
{ type: "arbitrary", label: "size.min_height", units: _.concat("auto"), property: "minHeight" }
|
|
949
939
|
]
|
|
950
940
|
},
|
|
951
941
|
{
|
|
952
942
|
styleType: "accordion",
|
|
953
943
|
heading: "size.max_width_height",
|
|
954
944
|
items: [
|
|
955
|
-
{ type: "arbitrary", label: "size.max_width", units:
|
|
956
|
-
{ type: "arbitrary", label: "size.max_height", units:
|
|
945
|
+
{ type: "arbitrary", label: "size.max_width", units: _.concat("auto"), property: "maxWidth" },
|
|
946
|
+
{ type: "arbitrary", label: "size.max_height", units: _.concat("auto"), property: "maxHeight" }
|
|
957
947
|
]
|
|
958
948
|
},
|
|
959
949
|
{
|
|
@@ -970,7 +960,7 @@ const ds = ({ onAdd: r }) => {
|
|
|
970
960
|
{
|
|
971
961
|
heading: "display.heading",
|
|
972
962
|
items: [
|
|
973
|
-
{ type: "dropdown", label: "display.display", property: "display", units:
|
|
963
|
+
{ type: "dropdown", label: "display.display", property: "display", units: _ },
|
|
974
964
|
{
|
|
975
965
|
styleType: "accordion",
|
|
976
966
|
heading: "display.flex_options",
|
|
@@ -1021,7 +1011,7 @@ const ds = ({ onAdd: r }) => {
|
|
|
1021
1011
|
styleType: "accordion",
|
|
1022
1012
|
heading: "display.visibility_opacity",
|
|
1023
1013
|
items: [
|
|
1024
|
-
{ type: "dropdown", label: "display.visibility", property: "visibility", units:
|
|
1014
|
+
{ type: "dropdown", label: "display.visibility", property: "visibility", units: _ },
|
|
1025
1015
|
{ type: "arbitrary", label: "display.opacity", property: "opacity", units: ["-"] }
|
|
1026
1016
|
]
|
|
1027
1017
|
}
|
|
@@ -1097,8 +1087,8 @@ const ds = ({ onAdd: r }) => {
|
|
|
1097
1087
|
heading: "typography.heading",
|
|
1098
1088
|
items: [
|
|
1099
1089
|
{ type: "dropdown", property: "fontFamily", label: "typography.font" },
|
|
1100
|
-
{ type: "arbitrary", property: "fontSize", label: "typography.size", units:
|
|
1101
|
-
{ type: "arbitrary", property: "lineHeight", label: "typography.height", units:
|
|
1090
|
+
{ type: "arbitrary", property: "fontSize", label: "typography.size", units: _ },
|
|
1091
|
+
{ type: "arbitrary", property: "lineHeight", label: "typography.height", units: _.concat("-") },
|
|
1102
1092
|
{ type: "range", property: "fontWeight", label: "typography.weight" },
|
|
1103
1093
|
{ type: "color", property: "textColor", label: "typography.color" },
|
|
1104
1094
|
{
|
|
@@ -1295,89 +1285,89 @@ const ds = ({ onAdd: r }) => {
|
|
|
1295
1285
|
},
|
|
1296
1286
|
{
|
|
1297
1287
|
heading: "classes.heading",
|
|
1298
|
-
items: [{ component:
|
|
1288
|
+
items: [{ component: gt }]
|
|
1299
1289
|
}
|
|
1300
|
-
],
|
|
1290
|
+
], xt = {
|
|
1301
1291
|
"not-italic": () => /* @__PURE__ */ e.jsx("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ e.jsx("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M9 3H11V5H9V11H11V13H5V11H7V5H5V3H9Z", fill: "white" }) }),
|
|
1302
1292
|
// visibility
|
|
1303
|
-
visible:
|
|
1304
|
-
invisible:
|
|
1293
|
+
visible: At,
|
|
1294
|
+
invisible: De,
|
|
1305
1295
|
// display
|
|
1306
|
-
hidden:
|
|
1307
|
-
gap:
|
|
1308
|
-
gapX:
|
|
1309
|
-
gapY:
|
|
1310
|
-
spaceX:
|
|
1311
|
-
spaceY:
|
|
1312
|
-
overscroll:
|
|
1313
|
-
overscrollX:
|
|
1314
|
-
overscrollY:
|
|
1315
|
-
overflow:
|
|
1316
|
-
overflowX:
|
|
1317
|
-
overflowY:
|
|
1296
|
+
hidden: De,
|
|
1297
|
+
gap: O,
|
|
1298
|
+
gapX: H,
|
|
1299
|
+
gapY: D,
|
|
1300
|
+
spaceX: H,
|
|
1301
|
+
spaceY: D,
|
|
1302
|
+
overscroll: O,
|
|
1303
|
+
overscrollX: H,
|
|
1304
|
+
overscrollY: D,
|
|
1305
|
+
overflow: O,
|
|
1306
|
+
overflowX: H,
|
|
1307
|
+
overflowY: D,
|
|
1318
1308
|
top: J,
|
|
1319
1309
|
right: Q,
|
|
1320
1310
|
bottom: ee,
|
|
1321
1311
|
left: te,
|
|
1322
|
-
inset:
|
|
1323
|
-
insetX:
|
|
1324
|
-
insetY:
|
|
1325
|
-
border:
|
|
1326
|
-
borderX:
|
|
1327
|
-
borderY:
|
|
1312
|
+
inset: O,
|
|
1313
|
+
insetX: H,
|
|
1314
|
+
insetY: D,
|
|
1315
|
+
border: O,
|
|
1316
|
+
borderX: H,
|
|
1317
|
+
borderY: D,
|
|
1328
1318
|
borderTop: J,
|
|
1329
1319
|
borderRight: Q,
|
|
1330
1320
|
borderBottom: ee,
|
|
1331
1321
|
borderLeft: te,
|
|
1332
|
-
borderRadius:
|
|
1333
|
-
borderRadiusX:
|
|
1334
|
-
borderRadiusY:
|
|
1322
|
+
borderRadius: O,
|
|
1323
|
+
borderRadiusX: H,
|
|
1324
|
+
borderRadiusY: D,
|
|
1335
1325
|
borderRadiusTop: J,
|
|
1336
1326
|
borderRadiusRight: Q,
|
|
1337
1327
|
borderRadiusBottom: ee,
|
|
1338
1328
|
borderRadiusLeft: te,
|
|
1339
1329
|
borderRadiusTopLeft: Pt,
|
|
1340
|
-
borderRadiusTopRight:
|
|
1341
|
-
borderRadiusBottomRight:
|
|
1342
|
-
borderRadiusBottomLeft:
|
|
1343
|
-
divideXWidth:
|
|
1344
|
-
divideYWidth:
|
|
1345
|
-
scale:
|
|
1346
|
-
scaleX:
|
|
1347
|
-
scaleY:
|
|
1348
|
-
skewX:
|
|
1349
|
-
skewY:
|
|
1350
|
-
translateX:
|
|
1351
|
-
translateY:
|
|
1330
|
+
borderRadiusTopRight: $t,
|
|
1331
|
+
borderRadiusBottomRight: Et,
|
|
1332
|
+
borderRadiusBottomLeft: Mt,
|
|
1333
|
+
divideXWidth: H,
|
|
1334
|
+
divideYWidth: D,
|
|
1335
|
+
scale: O,
|
|
1336
|
+
scaleX: H,
|
|
1337
|
+
scaleY: D,
|
|
1338
|
+
skewX: H,
|
|
1339
|
+
skewY: D,
|
|
1340
|
+
translateX: H,
|
|
1341
|
+
translateY: D,
|
|
1352
1342
|
// padding
|
|
1353
|
-
padding:
|
|
1354
|
-
paddingX:
|
|
1355
|
-
paddingY:
|
|
1343
|
+
padding: O,
|
|
1344
|
+
paddingX: H,
|
|
1345
|
+
paddingY: D,
|
|
1356
1346
|
paddingTop: J,
|
|
1357
1347
|
paddingRight: Q,
|
|
1358
1348
|
paddingBottom: ee,
|
|
1359
1349
|
paddingLeft: te,
|
|
1360
1350
|
// margin
|
|
1361
|
-
margin:
|
|
1362
|
-
marginX:
|
|
1363
|
-
marginY:
|
|
1351
|
+
margin: O,
|
|
1352
|
+
marginX: H,
|
|
1353
|
+
marginY: D,
|
|
1364
1354
|
marginTop: J,
|
|
1365
1355
|
marginRight: Q,
|
|
1366
1356
|
marginBottom: ee,
|
|
1367
1357
|
marginLeft: te,
|
|
1368
1358
|
// text-align
|
|
1369
|
-
textLeft:
|
|
1370
|
-
textCenter:
|
|
1371
|
-
textRight:
|
|
1372
|
-
textJustify:
|
|
1359
|
+
textLeft: Lt,
|
|
1360
|
+
textCenter: Ot,
|
|
1361
|
+
textRight: zt,
|
|
1362
|
+
textJustify: Yt,
|
|
1373
1363
|
// font style
|
|
1374
|
-
italic:
|
|
1364
|
+
italic: Ft,
|
|
1375
1365
|
// "not-italic": "",
|
|
1376
1366
|
// decoration
|
|
1377
|
-
underline:
|
|
1378
|
-
overline:
|
|
1367
|
+
underline: Xt,
|
|
1368
|
+
overline: Zt,
|
|
1379
1369
|
// transform
|
|
1380
|
-
uppercase:
|
|
1370
|
+
uppercase: Wt,
|
|
1381
1371
|
block: () => /* @__PURE__ */ e.jsxs("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [
|
|
1382
1372
|
/* @__PURE__ */ e.jsx(
|
|
1383
1373
|
"path",
|
|
@@ -1418,7 +1408,7 @@ const ds = ({ onAdd: r }) => {
|
|
|
1418
1408
|
}
|
|
1419
1409
|
)
|
|
1420
1410
|
] }),
|
|
1421
|
-
"float-none":
|
|
1411
|
+
"float-none": Ge,
|
|
1422
1412
|
// position
|
|
1423
1413
|
fixed: () => /* @__PURE__ */ e.jsxs("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [
|
|
1424
1414
|
/* @__PURE__ */ e.jsx(
|
|
@@ -1490,101 +1480,101 @@ const ds = ({ onAdd: r }) => {
|
|
|
1490
1480
|
}
|
|
1491
1481
|
)
|
|
1492
1482
|
] }),
|
|
1493
|
-
static:
|
|
1494
|
-
}, ae = Ze({ canReset: !1, canChange: !0 }),
|
|
1483
|
+
static: Ut
|
|
1484
|
+
}, ae = Ze({ canReset: !1, canChange: !0 }), hs = ({ children: r, canReset: a = !1, canChange: t = !0 }) => (
|
|
1495
1485
|
// eslint-disable-next-line react/jsx-no-constructed-context-values
|
|
1496
|
-
/* @__PURE__ */ e.jsx(ae.Provider, { value: { canReset:
|
|
1497
|
-
),
|
|
1498
|
-
const
|
|
1499
|
-
return /* @__PURE__ */ e.jsx("div", { className: r ? "w-full rounded" : "grow", children:
|
|
1500
|
-
/* @__PURE__ */ e.jsx(
|
|
1501
|
-
/* @__PURE__ */ e.jsxs(
|
|
1502
|
-
/* @__PURE__ */ e.jsx(
|
|
1503
|
-
/* @__PURE__ */ e.jsx(
|
|
1486
|
+
/* @__PURE__ */ e.jsx(ae.Provider, { value: { canReset: a, canChange: t }, children: r })
|
|
1487
|
+
), yt = ({ label: r, property: a, onChange: t }) => {
|
|
1488
|
+
const l = R(() => g(ge, `${a}.classes`, [""]), [a]), o = ne(a), n = R(() => g(o, "cls", ""), [o]), { canChange: d } = se(ae), p = /\[.*\]/g.test(n);
|
|
1489
|
+
return /* @__PURE__ */ e.jsx("div", { className: r ? "w-full rounded" : "grow", children: p ? /* @__PURE__ */ e.jsxs("div", { className: "flex items-center", children: [
|
|
1490
|
+
/* @__PURE__ */ e.jsx(ct, { className: "w-[70%] rounded py-1", readOnly: !0, value: n }),
|
|
1491
|
+
/* @__PURE__ */ e.jsxs(U, { delayDuration: 100, children: [
|
|
1492
|
+
/* @__PURE__ */ e.jsx(K, { asChild: !0, children: /* @__PURE__ */ e.jsx("button", { type: "button", className: "invisible ml-3 mt-1 text-blue-600 group-hover:visible", children: /* @__PURE__ */ e.jsx(Ne, {}) }) }),
|
|
1493
|
+
/* @__PURE__ */ e.jsx(G, { children: "Current value is using a Tailwind arbitrary value." })
|
|
1504
1494
|
] })
|
|
1505
1495
|
] }) : /* @__PURE__ */ e.jsx(
|
|
1506
|
-
|
|
1496
|
+
Ce,
|
|
1507
1497
|
{
|
|
1508
1498
|
rounded: r,
|
|
1509
|
-
onChange: (s) => t(s,
|
|
1499
|
+
onChange: (s) => t(s, a),
|
|
1510
1500
|
selected: n,
|
|
1511
|
-
options:
|
|
1501
|
+
options: l,
|
|
1512
1502
|
disabled: !d
|
|
1513
1503
|
}
|
|
1514
1504
|
) });
|
|
1515
1505
|
};
|
|
1516
|
-
function
|
|
1517
|
-
const n = r.replace(/.*:/g, "").trim(), { undo: d, redo:
|
|
1506
|
+
function Ce({ selected: r, onChange: a, rounded: t = !1, options: l, disabled: o = !1 }) {
|
|
1507
|
+
const n = r.replace(/.*:/g, "").trim(), { undo: d, redo: p } = Sr();
|
|
1518
1508
|
return /* @__PURE__ */ e.jsxs(
|
|
1519
1509
|
"select",
|
|
1520
1510
|
{
|
|
1521
|
-
disabled: !
|
|
1511
|
+
disabled: !l.length || o,
|
|
1522
1512
|
className: `${t ? "rounded-md border border-border" : "border-0"} disable:bg-gray-500 h-full w-full truncate rounded bg-background px-2 py-1 text-xs outline-none disabled:cursor-not-allowed`,
|
|
1523
|
-
onChange: (s) =>
|
|
1513
|
+
onChange: (s) => a(s.target.value),
|
|
1524
1514
|
onKeyDown: (s) => {
|
|
1525
|
-
s.ctrlKey && (s.key === "z" && d(), s.key === "y" &&
|
|
1515
|
+
s.ctrlKey && (s.key === "z" && d(), s.key === "y" && p());
|
|
1526
1516
|
},
|
|
1527
1517
|
value: n,
|
|
1528
1518
|
children: [
|
|
1529
1519
|
/* @__PURE__ */ e.jsx("option", { className: "bg-transparent", value: "" }),
|
|
1530
|
-
|
|
1531
|
-
|
|
1520
|
+
$.Children.toArray(
|
|
1521
|
+
l.map((s) => /* @__PURE__ */ e.jsx("option", { className: "bg-transparent", value: s, children: s }))
|
|
1532
1522
|
)
|
|
1533
1523
|
]
|
|
1534
1524
|
}
|
|
1535
1525
|
);
|
|
1536
1526
|
}
|
|
1537
|
-
const
|
|
1538
|
-
const { canReset: t, canChange:
|
|
1527
|
+
const ms = ({ property: r, onChange: a }) => {
|
|
1528
|
+
const { canReset: t, canChange: l } = se(ae), o = ne(r), n = R(() => g(o, "cls", ""), [o]), d = R(() => g(ge, `${r}.classes`, [""]), [r]), p = d.indexOf(n) > -1 ? d.indexOf(n) : 0, s = /\[.*\]/g.test(n);
|
|
1539
1529
|
return /* @__PURE__ */ e.jsx("div", { className: "flex flex-row divide-x divide-solid divide-border rounded border border-border text-xs", children: s ? /* @__PURE__ */ e.jsx("div", { className: "py-[5px] px-2", children: n }) : /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
1540
1530
|
/* @__PURE__ */ e.jsx(
|
|
1541
1531
|
"button",
|
|
1542
1532
|
{
|
|
1543
1533
|
type: "button",
|
|
1544
1534
|
className: "box-border w-2/12 rounded-tl rounded-bl bg-background px-1 text-center hover:bg-bg-gray-700 disabled:cursor-not-allowed disabled:bg-gray-600",
|
|
1545
|
-
disabled: !
|
|
1546
|
-
onClick: () =>
|
|
1535
|
+
disabled: !l && (!t || p - 1 < 0),
|
|
1536
|
+
onClick: () => a(Ve(d, p - 1), r),
|
|
1547
1537
|
children: /* @__PURE__ */ e.jsx("span", { className: "flex items-center justify-center", children: /* @__PURE__ */ e.jsx(
|
|
1548
|
-
|
|
1538
|
+
Kt,
|
|
1549
1539
|
{
|
|
1550
|
-
className: !
|
|
1540
|
+
className: !l && (!t || p - 1 < 0) ? "text-gray-500" : "text-black/60 dark:text-white/60"
|
|
1551
1541
|
}
|
|
1552
1542
|
) })
|
|
1553
1543
|
}
|
|
1554
1544
|
),
|
|
1555
|
-
/* @__PURE__ */ e.jsx("div", { className: "w-8/12 text-center", children: /* @__PURE__ */ e.jsx(
|
|
1545
|
+
/* @__PURE__ */ e.jsx("div", { className: "w-8/12 text-center", children: /* @__PURE__ */ e.jsx(yt, { label: !1, property: r, onChange: a }) }),
|
|
1556
1546
|
/* @__PURE__ */ e.jsx(
|
|
1557
1547
|
"button",
|
|
1558
1548
|
{
|
|
1559
1549
|
type: "button",
|
|
1560
1550
|
className: "w-2/12 rounded-tr rounded-br bg-background px-1 text-center hover:bg-bg-gray-700 disabled:cursor-not-allowed disabled:bg-gray-600",
|
|
1561
|
-
disabled: !
|
|
1562
|
-
onClick: () =>
|
|
1551
|
+
disabled: !l && (!t || p + 1 >= d.length),
|
|
1552
|
+
onClick: () => a(Ve(d, p + 1), r),
|
|
1563
1553
|
children: /* @__PURE__ */ e.jsx("span", { className: "flex items-center justify-center", children: /* @__PURE__ */ e.jsx(
|
|
1564
|
-
|
|
1554
|
+
Ke,
|
|
1565
1555
|
{
|
|
1566
|
-
className: !
|
|
1556
|
+
className: !l && (!t || p + 1 >= d.length) ? "text-gray-500" : "text-black/60 dark:text-white/60"
|
|
1567
1557
|
}
|
|
1568
1558
|
) })
|
|
1569
1559
|
}
|
|
1570
1560
|
)
|
|
1571
1561
|
] }) });
|
|
1572
|
-
},
|
|
1573
|
-
const t =
|
|
1574
|
-
return /* @__PURE__ */ e.jsx("div", { className: "flex grow flex-wrap gap-1", children:
|
|
1575
|
-
/* @__PURE__ */ e.jsx(
|
|
1562
|
+
}, bs = ({ property: r, onChange: a }) => {
|
|
1563
|
+
const t = R(() => g(ge, `${r}.classes`, [""]), [r]), { canChange: l } = se(ae), o = ne(r), n = R(() => g(o, "cls", ""), [o]);
|
|
1564
|
+
return /* @__PURE__ */ e.jsx("div", { className: "flex grow flex-wrap gap-1", children: T(t, (d) => /* @__PURE__ */ e.jsxs(U, { children: [
|
|
1565
|
+
/* @__PURE__ */ e.jsx(K, { asChild: !0, children: /* @__PURE__ */ e.jsx(
|
|
1576
1566
|
"button",
|
|
1577
1567
|
{
|
|
1578
1568
|
type: "button",
|
|
1579
|
-
disabled: !
|
|
1580
|
-
onClick: () =>
|
|
1569
|
+
disabled: !l,
|
|
1570
|
+
onClick: () => a(d, r),
|
|
1581
1571
|
className: `cursor-pointer rounded border border-gray-600 p-1 disabled:cursor-not-allowed ${n === d ? " bg-blue-500 text-white" : "disabled:bg-gray-600 disabled:text-gray-400"}`,
|
|
1582
|
-
children:
|
|
1572
|
+
children: $.createElement(g(xt, d, qe))
|
|
1583
1573
|
}
|
|
1584
1574
|
) }),
|
|
1585
|
-
/* @__PURE__ */ e.jsx(
|
|
1575
|
+
/* @__PURE__ */ e.jsx(G, { children: Y(re(d)) })
|
|
1586
1576
|
] })) });
|
|
1587
|
-
},
|
|
1577
|
+
}, fs = {
|
|
1588
1578
|
backgroundColor: "bg",
|
|
1589
1579
|
textColor: "text",
|
|
1590
1580
|
borderColor: "border",
|
|
@@ -1596,39 +1586,39 @@ const ys = ({ property: r, onChange: o }) => {
|
|
|
1596
1586
|
toColor: "to",
|
|
1597
1587
|
ringColor: "ring",
|
|
1598
1588
|
ringOffsetColor: "ring-offset"
|
|
1599
|
-
},
|
|
1600
|
-
const t = ne(r),
|
|
1589
|
+
}, vs = ({ property: r, onChange: a }) => {
|
|
1590
|
+
const t = ne(r), l = R(() => g(t, "cls", ""), [t]), { canChange: o } = se(ae), [n, d] = j([]), [p, s] = j({ color: "", shade: "" }), c = l.split("-"), u = g(c, "1", ""), i = g(c, "2", ""), h = B(
|
|
1601
1591
|
// eslint-disable-next-line no-shadow
|
|
1602
|
-
(
|
|
1603
|
-
["current", "inherit", "transparent", "black", "white"].includes(
|
|
1592
|
+
(x) => {
|
|
1593
|
+
["current", "inherit", "transparent", "black", "white"].includes(x) ? (d([]), s({ color: x })) : (d(["50", "100", "200", "300", "400", "500", "600", "700", "800", "900"]), s((v) => ({ ...v, color: x, shade: v.shade ? v.shade : "500" })));
|
|
1604
1594
|
},
|
|
1605
1595
|
[d, s]
|
|
1606
1596
|
);
|
|
1607
1597
|
A(() => {
|
|
1608
|
-
if (["current", "inherit", "transparent", "black", "white"].includes(
|
|
1598
|
+
if (["current", "inherit", "transparent", "black", "white"].includes(u))
|
|
1609
1599
|
return d([]);
|
|
1610
1600
|
d(["50", "100", "200", "300", "400", "500", "600", "700", "800", "900"]);
|
|
1611
|
-
}, [
|
|
1612
|
-
const
|
|
1601
|
+
}, [u]);
|
|
1602
|
+
const y = B(
|
|
1613
1603
|
// eslint-disable-next-line no-shadow
|
|
1614
|
-
(
|
|
1615
|
-
s({ color:
|
|
1604
|
+
(x) => {
|
|
1605
|
+
s({ color: u, shade: x });
|
|
1616
1606
|
},
|
|
1617
|
-
[
|
|
1607
|
+
[u]
|
|
1618
1608
|
);
|
|
1619
1609
|
return A(() => {
|
|
1620
1610
|
s({ color: "", shade: "" });
|
|
1621
1611
|
}, [t]), A(() => {
|
|
1622
|
-
const v = `${
|
|
1623
|
-
v.match(new RegExp(
|
|
1624
|
-
}, [
|
|
1612
|
+
const v = `${g(fs, r, "")}-${p.color}${p.shade ? `-${p.shade}` : ""}`;
|
|
1613
|
+
v.match(new RegExp(g(ge, `${r}.regExp`, ""))) && a(v, r);
|
|
1614
|
+
}, [p, a, r]), /* @__PURE__ */ e.jsxs("div", { className: "flex flex-row divide-x divide-solid divide-border rounded-lg border border-border text-xs", children: [
|
|
1625
1615
|
/* @__PURE__ */ e.jsx("div", { className: "grow text-center", children: /* @__PURE__ */ e.jsx(
|
|
1626
|
-
|
|
1616
|
+
Ce,
|
|
1627
1617
|
{
|
|
1628
|
-
disabled: !
|
|
1618
|
+
disabled: !o,
|
|
1629
1619
|
rounded: !0,
|
|
1630
|
-
selected:
|
|
1631
|
-
onChange:
|
|
1620
|
+
selected: u,
|
|
1621
|
+
onChange: h,
|
|
1632
1622
|
options: [
|
|
1633
1623
|
"current",
|
|
1634
1624
|
"transparent",
|
|
@@ -1661,20 +1651,20 @@ const ys = ({ property: r, onChange: o }) => {
|
|
|
1661
1651
|
]
|
|
1662
1652
|
}
|
|
1663
1653
|
) }),
|
|
1664
|
-
/* @__PURE__ */ e.jsx("button", { type: "button", className: "grow text-center", children: /* @__PURE__ */ e.jsx(
|
|
1654
|
+
/* @__PURE__ */ e.jsx("button", { type: "button", className: "grow text-center", children: /* @__PURE__ */ e.jsx(Ce, { rounded: !0, selected: i, disabled: !u || !o, onChange: y, options: n }) })
|
|
1665
1655
|
] });
|
|
1666
|
-
}, Ye = (r,
|
|
1656
|
+
}, Ye = (r, a) => {
|
|
1667
1657
|
r = r.toLowerCase();
|
|
1668
1658
|
let t = r.trim().replace(/ |\+/g, "");
|
|
1669
|
-
if ((t === "auto" || t === "none") &&
|
|
1659
|
+
if ((t === "auto" || t === "none") && a.includes(t))
|
|
1670
1660
|
return { value: "", unit: t };
|
|
1671
|
-
const
|
|
1672
|
-
t = t.replace(
|
|
1673
|
-
const
|
|
1674
|
-
return n || d ? { error: "Invalid value" } :
|
|
1661
|
+
const l = a.length ? new RegExp(a.join("|"), "g") : /XXXXXX/g;
|
|
1662
|
+
t = t.replace(l, "");
|
|
1663
|
+
const o = r.match(l), n = o && o.length > 1, d = !b(t) && Number.isNaN(Number(t));
|
|
1664
|
+
return n || d ? { error: "Invalid value" } : o && (o[0] === "auto" || o[0] === "none") ? { value: o[0], unit: "" } : { value: t, unit: o ? o[0] : "" };
|
|
1675
1665
|
};
|
|
1676
|
-
const
|
|
1677
|
-
const
|
|
1666
|
+
const ws = (r) => {
|
|
1667
|
+
const a = r.startsWith("-") ? "-" : "", t = r.split("-").pop();
|
|
1678
1668
|
if (["auto", "none"].includes(t))
|
|
1679
1669
|
return { value: "", unit: t };
|
|
1680
1670
|
if (t === "px")
|
|
@@ -1683,26 +1673,26 @@ const fs = (r) => {
|
|
|
1683
1673
|
return { value: "100", unit: r.indexOf("w-") !== -1 ? "vw" : "vh" };
|
|
1684
1674
|
if (t === "full")
|
|
1685
1675
|
return { value: "100", unit: "%" };
|
|
1686
|
-
if (
|
|
1687
|
-
return { value: `${
|
|
1688
|
-
if (
|
|
1689
|
-
return { value: `${
|
|
1690
|
-
if (
|
|
1676
|
+
if (z(r, "skew-"))
|
|
1677
|
+
return { value: `${a}${t}`, unit: "deg" };
|
|
1678
|
+
if (z(r, "rotate-"))
|
|
1679
|
+
return { value: `${a}${t}`, unit: "deg" };
|
|
1680
|
+
if (z(r, "opacity-"))
|
|
1691
1681
|
return { value: `${t / 100}`, unit: "-" };
|
|
1692
|
-
if (
|
|
1682
|
+
if (z(r, "duration-") || z(r, "delay-"))
|
|
1693
1683
|
return { value: `${t}`, unit: "ms" };
|
|
1694
|
-
if (
|
|
1695
|
-
return { value: `${
|
|
1696
|
-
if (
|
|
1697
|
-
return { value: `${
|
|
1698
|
-
if (
|
|
1699
|
-
const
|
|
1700
|
-
if (
|
|
1701
|
-
return { value:
|
|
1684
|
+
if (z(r, "translate-") && !t.includes("/"))
|
|
1685
|
+
return { value: `${a}${`${t / 4}`}`, unit: "rem" };
|
|
1686
|
+
if (z(r, "scale-"))
|
|
1687
|
+
return { value: `${a}${`${t / 100}`}`, unit: "-" };
|
|
1688
|
+
if (q(r, "border")) {
|
|
1689
|
+
const l = r.match(/border-?(x|y|t|r|b|l)?\d+/g);
|
|
1690
|
+
if (l)
|
|
1691
|
+
return { value: l[0].split("-").pop(), unit: "px" };
|
|
1702
1692
|
if (r.match(/border-?(x|y|t|r|b|l)?/g))
|
|
1703
1693
|
return { value: "1", unit: "px" };
|
|
1704
1694
|
}
|
|
1705
|
-
if (
|
|
1695
|
+
if (q(r, "max-w-")) {
|
|
1706
1696
|
if (r === "max-w-screen-sm")
|
|
1707
1697
|
return { value: "640", unit: "px" };
|
|
1708
1698
|
if (r === "max-w-screen-md")
|
|
@@ -1738,7 +1728,7 @@ const fs = (r) => {
|
|
|
1738
1728
|
if (t === "prose")
|
|
1739
1729
|
return { value: "65", unit: "ch" };
|
|
1740
1730
|
}
|
|
1741
|
-
if (
|
|
1731
|
+
if (q(r, "text-")) {
|
|
1742
1732
|
if (t === "xs")
|
|
1743
1733
|
return { value: "12", unit: "px" };
|
|
1744
1734
|
if (t === "sm")
|
|
@@ -1766,7 +1756,7 @@ const fs = (r) => {
|
|
|
1766
1756
|
if (t === "9xl")
|
|
1767
1757
|
return { value: "128", unit: "px" };
|
|
1768
1758
|
}
|
|
1769
|
-
if (
|
|
1759
|
+
if (q(r, "leading-")) {
|
|
1770
1760
|
if (t === "none")
|
|
1771
1761
|
return { value: "1", unit: "-" };
|
|
1772
1762
|
if (t === "tight")
|
|
@@ -1780,7 +1770,7 @@ const fs = (r) => {
|
|
|
1780
1770
|
if (t === "loose")
|
|
1781
1771
|
return { value: "2", unit: "-" };
|
|
1782
1772
|
}
|
|
1783
|
-
if (
|
|
1773
|
+
if (q(r, "tracking-")) {
|
|
1784
1774
|
if (t === "tighter")
|
|
1785
1775
|
return { value: "-0.05", unit: "em" };
|
|
1786
1776
|
if (t === "tight")
|
|
@@ -1797,208 +1787,208 @@ const fs = (r) => {
|
|
|
1797
1787
|
if (["max", "min", "fit"].includes(t))
|
|
1798
1788
|
return { value: r, unit: "class" };
|
|
1799
1789
|
if (t.includes("/")) {
|
|
1800
|
-
const [
|
|
1801
|
-
return { value:
|
|
1790
|
+
const [l, o] = T(t.split("/"), (n) => parseInt(n, 10));
|
|
1791
|
+
return { value: a + (l / o * 100).toFixed(2).replace(".00", ""), unit: "%" };
|
|
1802
1792
|
}
|
|
1803
|
-
return
|
|
1793
|
+
return Rt(parseFloat(t)) ? { value: `${a + parseFloat(t) * 4}`, unit: "px" } : { value: t, unit: "class" };
|
|
1804
1794
|
};
|
|
1805
|
-
const
|
|
1806
|
-
if (
|
|
1795
|
+
const js = (r) => {
|
|
1796
|
+
if (b(r))
|
|
1807
1797
|
return { value: "", unit: "" };
|
|
1808
|
-
const
|
|
1809
|
-
if (
|
|
1810
|
-
return
|
|
1811
|
-
const t =
|
|
1812
|
-
return { value: `${
|
|
1813
|
-
},
|
|
1798
|
+
const a = r.match(/\[.*\]/g);
|
|
1799
|
+
if (a === null)
|
|
1800
|
+
return Cs(r);
|
|
1801
|
+
const t = g(a, "0", "").replace(/\[|\]/g, ""), l = r.startsWith("-") ? "-" : "", o = oe(t.match(/\d+.\d+|\d+/g));
|
|
1802
|
+
return { value: `${l}${o}`, unit: t.replace(o, "") };
|
|
1803
|
+
}, Cs = (r) => b(r) ? { value: "", unit: "" } : ws(r), ht = $.createContext({
|
|
1814
1804
|
setDragData: () => {
|
|
1815
1805
|
}
|
|
1816
|
-
}),
|
|
1806
|
+
}), ks = ({
|
|
1817
1807
|
unit: r,
|
|
1818
|
-
currentValue:
|
|
1808
|
+
currentValue: a,
|
|
1819
1809
|
onDrag: t,
|
|
1820
|
-
onDragEnd:
|
|
1821
|
-
onDragStart:
|
|
1810
|
+
onDragEnd: l,
|
|
1811
|
+
onDragStart: o,
|
|
1822
1812
|
negative: n,
|
|
1823
1813
|
cssProperty: d
|
|
1824
1814
|
}) => {
|
|
1825
|
-
const { setDragData:
|
|
1815
|
+
const { setDragData: p } = se(ht);
|
|
1826
1816
|
return /* @__PURE__ */ e.jsx(
|
|
1827
1817
|
"button",
|
|
1828
1818
|
{
|
|
1829
1819
|
type: "button",
|
|
1830
1820
|
onMouseDown: (s) => {
|
|
1831
|
-
const
|
|
1821
|
+
const c = {
|
|
1832
1822
|
onDrag: t,
|
|
1833
|
-
onDragEnd:
|
|
1823
|
+
onDragEnd: l,
|
|
1834
1824
|
dragging: !0,
|
|
1835
1825
|
dragStartY: s.pageY,
|
|
1836
|
-
dragStartValue: `${
|
|
1826
|
+
dragStartValue: `${a}`,
|
|
1837
1827
|
dragUnit: r,
|
|
1838
1828
|
negative: n,
|
|
1839
1829
|
cssProperty: d
|
|
1840
1830
|
};
|
|
1841
|
-
|
|
1831
|
+
o(c), p(c);
|
|
1842
1832
|
},
|
|
1843
1833
|
color: void 0,
|
|
1844
1834
|
className: "relative z-50 ml-1 hidden h-6 cursor-row-resize rounded bg-background/70 px-2 group-hover:inline",
|
|
1845
1835
|
children: /* @__PURE__ */ e.jsx(Gt, {})
|
|
1846
1836
|
}
|
|
1847
1837
|
);
|
|
1848
|
-
},
|
|
1849
|
-
|
|
1838
|
+
}, Ns = ({ 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((l) => /* @__PURE__ */ e.jsx(
|
|
1839
|
+
P,
|
|
1850
1840
|
{
|
|
1851
1841
|
className: "h-max rounded-none px-1 py-1 text-right text-[11px] hover:bg-blue-400",
|
|
1852
|
-
color:
|
|
1842
|
+
color: a === l ? "primary" : void 0,
|
|
1853
1843
|
size: "sm",
|
|
1854
|
-
onClick: (
|
|
1855
|
-
|
|
1844
|
+
onClick: (o) => {
|
|
1845
|
+
o.stopPropagation(), r(l);
|
|
1856
1846
|
},
|
|
1857
|
-
children:
|
|
1847
|
+
children: l
|
|
1858
1848
|
},
|
|
1859
|
-
|
|
1860
|
-
)) }), Fe = 50,
|
|
1861
|
-
const [
|
|
1849
|
+
l
|
|
1850
|
+
)) }), Fe = 50, _s = (r) => {
|
|
1851
|
+
const [a, t] = j(!1), [l, o] = j(""), { currentClass: n, onChange: d, classPrefix: p, cssProperty: s, units: c, negative: u } = r, [i, h] = j(s != null && s.toLowerCase().includes("width") ? "%" : c[0]), [y, x] = j(!1), [v, k] = j(""), [E, I] = j(!1), [Z, w] = j(!1);
|
|
1862
1852
|
A(() => {
|
|
1863
|
-
const { value:
|
|
1853
|
+
const { value: m, unit: f } = js(n);
|
|
1864
1854
|
if (f === "") {
|
|
1865
|
-
|
|
1855
|
+
o(m), h(s != null && s.toLowerCase().includes("width") ? "%" : oe(c));
|
|
1866
1856
|
return;
|
|
1867
1857
|
}
|
|
1868
|
-
|
|
1869
|
-
}, [n, s,
|
|
1870
|
-
const
|
|
1871
|
-
(
|
|
1872
|
-
const f = Ye(`${
|
|
1873
|
-
if (
|
|
1874
|
-
|
|
1858
|
+
h(f), o(f === "class" || b(m) ? "" : m);
|
|
1859
|
+
}, [n, s, c]);
|
|
1860
|
+
const N = ce((m) => d(m), [d], Fe), C = ce((m) => d(m, !1), [d], Fe), V = B(
|
|
1861
|
+
(m = !1) => {
|
|
1862
|
+
const f = Ye(`${l}`, c);
|
|
1863
|
+
if (g(f, "error", !1)) {
|
|
1864
|
+
x(!0);
|
|
1875
1865
|
return;
|
|
1876
1866
|
}
|
|
1877
|
-
const
|
|
1878
|
-
if (
|
|
1879
|
-
|
|
1867
|
+
const S = g(f, "unit") !== "" ? g(f, "unit") : i;
|
|
1868
|
+
if (S === "auto" || S === "none") {
|
|
1869
|
+
N(`${p}${S}`);
|
|
1880
1870
|
return;
|
|
1881
1871
|
}
|
|
1882
|
-
if (
|
|
1872
|
+
if (g(f, "value") === "")
|
|
1883
1873
|
return;
|
|
1884
|
-
const
|
|
1885
|
-
|
|
1874
|
+
const L = `${g(f, "value", "").startsWith("-") ? "-" : ""}${p}[${g(f, "value", "").replace("-", "")}${S === "-" ? "" : S}]`;
|
|
1875
|
+
m ? C(L) : N(L);
|
|
1886
1876
|
},
|
|
1887
|
-
[
|
|
1888
|
-
), W =
|
|
1889
|
-
(
|
|
1890
|
-
const f = Ye(`${
|
|
1891
|
-
if (
|
|
1892
|
-
|
|
1877
|
+
[N, C, l, i, p, c]
|
|
1878
|
+
), W = B(
|
|
1879
|
+
(m) => {
|
|
1880
|
+
const f = Ye(`${l}`, c);
|
|
1881
|
+
if (g(f, "error", !1)) {
|
|
1882
|
+
x(!0);
|
|
1893
1883
|
return;
|
|
1894
1884
|
}
|
|
1895
|
-
if (
|
|
1896
|
-
|
|
1885
|
+
if (m === "auto" || m === "none") {
|
|
1886
|
+
N(`${p}${m}`);
|
|
1897
1887
|
return;
|
|
1898
1888
|
}
|
|
1899
|
-
if (
|
|
1889
|
+
if (g(f, "value") === "")
|
|
1900
1890
|
return;
|
|
1901
|
-
const
|
|
1902
|
-
|
|
1891
|
+
const S = g(f, "unit") !== "" ? g(f, "unit") : m, L = `${g(f, "value", "").startsWith("-") ? "-" : ""}${p}[${g(f, "value", "").replace("-", "")}${S === "-" ? "" : S}]`;
|
|
1892
|
+
N(L);
|
|
1903
1893
|
},
|
|
1904
|
-
[
|
|
1894
|
+
[N, l, p, c]
|
|
1905
1895
|
);
|
|
1906
1896
|
return /* @__PURE__ */ e.jsx("div", { className: "flex w-full flex-col", children: /* @__PURE__ */ e.jsx("div", { className: "flex items-center justify-start", children: i === "class" ? /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
1907
1897
|
/* @__PURE__ */ e.jsx("input", { className: "w-20 rounded py-1", readOnly: !0, value: n }),
|
|
1908
|
-
/* @__PURE__ */ e.jsxs(
|
|
1909
|
-
/* @__PURE__ */ e.jsx(
|
|
1910
|
-
/* @__PURE__ */ e.jsx(
|
|
1898
|
+
/* @__PURE__ */ e.jsxs(U, { children: [
|
|
1899
|
+
/* @__PURE__ */ e.jsx(K, { asChild: !0, children: /* @__PURE__ */ e.jsx("button", { type: "button", className: "invisible ml-3 mt-1 text-blue-600 group-hover:visible", children: /* @__PURE__ */ e.jsx(Ne, {}) }) }),
|
|
1900
|
+
/* @__PURE__ */ e.jsx(G, { children: "Current value is using a Tailwind preset class." })
|
|
1911
1901
|
] })
|
|
1912
|
-
] }) : /* @__PURE__ */ e.jsxs("div", { className: `group relative flex items-center ${
|
|
1902
|
+
] }) : /* @__PURE__ */ e.jsxs("div", { className: `group relative flex items-center ${E ? "z-auto" : ""}`, children: [
|
|
1913
1903
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center rounded-md border border-border", children: [
|
|
1914
1904
|
["none", "auto"].indexOf(i) !== -1 ? null : /* @__PURE__ */ e.jsx(
|
|
1915
1905
|
"input",
|
|
1916
1906
|
{
|
|
1917
1907
|
readOnly: i === "class",
|
|
1918
|
-
onKeyPress: (
|
|
1919
|
-
|
|
1908
|
+
onKeyPress: (m) => {
|
|
1909
|
+
m.key === "Enter" && V();
|
|
1920
1910
|
},
|
|
1921
|
-
onKeyDown: (
|
|
1922
|
-
if (
|
|
1911
|
+
onKeyDown: (m) => {
|
|
1912
|
+
if (m.keyCode !== 38 && m.keyCode !== 40)
|
|
1923
1913
|
return;
|
|
1924
|
-
|
|
1925
|
-
const f =
|
|
1926
|
-
let
|
|
1927
|
-
|
|
1928
|
-
const
|
|
1929
|
-
|
|
1914
|
+
m.preventDefault(), w(!0);
|
|
1915
|
+
const f = Vt(m.target.value);
|
|
1916
|
+
let S = Ue(f) ? 0 : f;
|
|
1917
|
+
m.keyCode === 38 && (S += 1), m.keyCode === 40 && (S -= 1);
|
|
1918
|
+
const M = `${S}`, bt = `${M.startsWith("-") ? "-" : ""}${p}[${M.replace("-", "")}${i === "-" ? "" : i}]`;
|
|
1919
|
+
C(bt);
|
|
1930
1920
|
},
|
|
1931
|
-
onKeyUp: (
|
|
1932
|
-
|
|
1921
|
+
onKeyUp: (m) => {
|
|
1922
|
+
Z && (m.preventDefault(), w(!1));
|
|
1933
1923
|
},
|
|
1934
|
-
onBlur: () =>
|
|
1935
|
-
onChange: (
|
|
1936
|
-
|
|
1924
|
+
onBlur: () => V(),
|
|
1925
|
+
onChange: (m) => {
|
|
1926
|
+
x(!1), o(m.target.value);
|
|
1937
1927
|
},
|
|
1938
|
-
onClick: (
|
|
1928
|
+
onClick: (m) => {
|
|
1939
1929
|
var f;
|
|
1940
|
-
(f =
|
|
1930
|
+
(f = m == null ? void 0 : m.target) == null || f.select(), t(!1);
|
|
1941
1931
|
},
|
|
1942
|
-
value:
|
|
1932
|
+
value: E ? v : l,
|
|
1943
1933
|
className: "h-6 w-14 rounded rounded-r-none bg-background pl-2 text-sm focus-visible:outline-0 ".concat(
|
|
1944
1934
|
" ",
|
|
1945
|
-
|
|
1935
|
+
y ? "border-red-500 text-red-500" : "border-foreground/20"
|
|
1946
1936
|
)
|
|
1947
1937
|
}
|
|
1948
1938
|
),
|
|
1949
|
-
/* @__PURE__ */ e.jsxs(
|
|
1950
|
-
/* @__PURE__ */ e.jsx(
|
|
1939
|
+
/* @__PURE__ */ e.jsxs(U, { open: a, delayDuration: 100, children: [
|
|
1940
|
+
/* @__PURE__ */ e.jsx(K, { asChild: !0, children: /* @__PURE__ */ e.jsxs(
|
|
1951
1941
|
"button",
|
|
1952
1942
|
{
|
|
1953
1943
|
type: "button",
|
|
1954
|
-
onClick: () => t(!
|
|
1944
|
+
onClick: () => t(!a),
|
|
1955
1945
|
className: "flex h-6 cursor-pointer items-center gap-x-1 rounded rounded-l-none bg-background p-px px-1 text-[11px] uppercase",
|
|
1956
1946
|
children: [
|
|
1957
|
-
/* @__PURE__ */ e.jsx("span", { className: `inline-block ${
|
|
1958
|
-
|
|
1947
|
+
/* @__PURE__ */ e.jsx("span", { className: `inline-block ${c.length === 1 ? "px-2 font-semibold" : ""}`, children: i }),
|
|
1948
|
+
c.length > 1 ? /* @__PURE__ */ e.jsx(qt, {}) : null
|
|
1959
1949
|
]
|
|
1960
1950
|
}
|
|
1961
1951
|
) }),
|
|
1962
|
-
/* @__PURE__ */ e.jsx(
|
|
1963
|
-
|
|
1952
|
+
/* @__PURE__ */ e.jsx(Tr, { children: /* @__PURE__ */ e.jsx(G, { className: "bg-background", children: /* @__PURE__ */ e.jsx(
|
|
1953
|
+
Ns,
|
|
1964
1954
|
{
|
|
1965
|
-
units:
|
|
1955
|
+
units: c,
|
|
1966
1956
|
current: i,
|
|
1967
|
-
onSelect: (
|
|
1968
|
-
t(!1),
|
|
1957
|
+
onSelect: (m) => {
|
|
1958
|
+
t(!1), h(m), W(m);
|
|
1969
1959
|
}
|
|
1970
1960
|
}
|
|
1971
1961
|
) }) })
|
|
1972
1962
|
] })
|
|
1973
1963
|
] }),
|
|
1974
|
-
["none", "auto"].indexOf(i) !== -1 ||
|
|
1975
|
-
|
|
1964
|
+
["none", "auto"].indexOf(i) !== -1 || E ? null : /* @__PURE__ */ e.jsx(
|
|
1965
|
+
ks,
|
|
1976
1966
|
{
|
|
1977
|
-
onDragStart: () =>
|
|
1978
|
-
onDragEnd: (
|
|
1979
|
-
if (
|
|
1967
|
+
onDragStart: () => I(!0),
|
|
1968
|
+
onDragEnd: (m) => {
|
|
1969
|
+
if (k(() => ""), I(!1), b(m))
|
|
1980
1970
|
return;
|
|
1981
|
-
const f = `${
|
|
1982
|
-
|
|
1971
|
+
const f = `${m}`, M = `${f.startsWith("-") ? "-" : ""}${p}[${f.replace("-", "")}${i === "-" ? "" : i}]`;
|
|
1972
|
+
N(M);
|
|
1983
1973
|
},
|
|
1984
|
-
onDrag: (
|
|
1985
|
-
if (m
|
|
1974
|
+
onDrag: (m) => {
|
|
1975
|
+
if (b(m))
|
|
1986
1976
|
return;
|
|
1987
|
-
|
|
1988
|
-
const f = `${
|
|
1989
|
-
|
|
1977
|
+
k(m);
|
|
1978
|
+
const f = `${m}`, M = `${f.startsWith("-") ? "-" : ""}${p}[${f.replace("-", "")}${i === "-" ? "" : i}]`;
|
|
1979
|
+
C(M);
|
|
1990
1980
|
},
|
|
1991
|
-
currentValue:
|
|
1981
|
+
currentValue: l,
|
|
1992
1982
|
unit: i,
|
|
1993
|
-
negative:
|
|
1983
|
+
negative: u,
|
|
1994
1984
|
cssProperty: s
|
|
1995
1985
|
}
|
|
1996
1986
|
)
|
|
1997
1987
|
] }) }) });
|
|
1998
1988
|
}, ne = (r) => {
|
|
1999
|
-
const
|
|
2000
|
-
return
|
|
2001
|
-
},
|
|
1989
|
+
const a = ue();
|
|
1990
|
+
return Ht(a, { property: r });
|
|
1991
|
+
}, Ss = (r, a) => {
|
|
2002
1992
|
const t = {
|
|
2003
1993
|
xs: 0,
|
|
2004
1994
|
sm: 1,
|
|
@@ -2007,8 +1997,8 @@ const vs = (r) => {
|
|
|
2007
1997
|
xl: 4,
|
|
2008
1998
|
"2xl": 5
|
|
2009
1999
|
};
|
|
2010
|
-
return t[
|
|
2011
|
-
},
|
|
2000
|
+
return t[g(r, "mq", "xs")] <= t[a];
|
|
2001
|
+
}, Ts = {
|
|
2012
2002
|
width: "w-",
|
|
2013
2003
|
height: "h-",
|
|
2014
2004
|
minWidth: "min-w-",
|
|
@@ -2081,68 +2071,68 @@ const vs = (r) => {
|
|
|
2081
2071
|
lg: "1024px",
|
|
2082
2072
|
xl: "1280px",
|
|
2083
2073
|
"2xl": "1536px"
|
|
2084
|
-
},
|
|
2085
|
-
const { t:
|
|
2086
|
-
}, units: d, negative:
|
|
2087
|
-
(
|
|
2088
|
-
const W = { dark: s, mq:
|
|
2089
|
-
(s ||
|
|
2090
|
-
const
|
|
2091
|
-
|
|
2074
|
+
}, Rs = (r) => `${r.toUpperCase()} ${Xe[r] ? `(${Xe[r]} & up)` : ""}`, Te = (r) => {
|
|
2075
|
+
const { t: a } = F(), { type: t = "icons", label: l, property: o, onEmitChange: n = () => {
|
|
2076
|
+
}, units: d, negative: p = !1 } = r, [s] = Rr(), [c] = Vr(), [, u] = Ie(), i = ne(o), h = _e(), y = it(), [x] = dt(), v = R(() => g(i, "fullCls", ""), [i]), k = B(
|
|
2077
|
+
(C, V = !0) => {
|
|
2078
|
+
const W = { dark: s, mq: u, mod: c, cls: C, property: o, fullCls: "" };
|
|
2079
|
+
(s || c !== "") && (W.mq = "xs");
|
|
2080
|
+
const m = Qr(W);
|
|
2081
|
+
h(x, [m], V);
|
|
2092
2082
|
},
|
|
2093
|
-
[
|
|
2094
|
-
),
|
|
2095
|
-
x
|
|
2096
|
-
}, [
|
|
2083
|
+
[x, s, u, c, o, h]
|
|
2084
|
+
), E = B(() => {
|
|
2085
|
+
y(x, [v]);
|
|
2086
|
+
}, [x, v, y]), I = R(() => Ss(i, u), [i, u]);
|
|
2097
2087
|
A(() => {
|
|
2098
|
-
n(
|
|
2099
|
-
}, [
|
|
2100
|
-
const [, ,
|
|
2101
|
-
(
|
|
2102
|
-
|
|
2088
|
+
n(I, i);
|
|
2089
|
+
}, [I, n, i]);
|
|
2090
|
+
const [, , Z] = Ie(), w = B(
|
|
2091
|
+
(C) => {
|
|
2092
|
+
Z({
|
|
2103
2093
|
xs: 400,
|
|
2104
2094
|
sm: 640,
|
|
2105
2095
|
md: 800,
|
|
2106
2096
|
lg: 1024,
|
|
2107
2097
|
xl: 1420,
|
|
2108
2098
|
"2xl": 1920
|
|
2109
|
-
}[
|
|
2099
|
+
}[C]);
|
|
2110
2100
|
},
|
|
2111
|
-
[
|
|
2112
|
-
),
|
|
2113
|
-
return /* @__PURE__ */ e.jsx(
|
|
2114
|
-
/* @__PURE__ */ e.jsx("div", { className: "relative w-[70px] truncate text-xs text-foreground", children: /* @__PURE__ */ e.jsx("span", { className: `text-[11px] ${i && !
|
|
2101
|
+
[Z]
|
|
2102
|
+
), N = g(i, "dark", null) === s && g(i, "mod", null) === c && g(i, "mq", null) === u;
|
|
2103
|
+
return /* @__PURE__ */ e.jsx(hs, { canChange: I, canReset: i && N, children: /* @__PURE__ */ e.jsxs("div", { className: "group flex flex-row items-center py-2 first:pt-0 last:pb-0", children: [
|
|
2104
|
+
/* @__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: a(l) }) }),
|
|
2115
2105
|
/* @__PURE__ */ e.jsxs("div", { className: "flex flex-row items-center", children: [
|
|
2116
2106
|
/* @__PURE__ */ e.jsxs("div", { className: "w-[150px]", children: [
|
|
2117
2107
|
t === "arbitrary" ? /* @__PURE__ */ e.jsx(
|
|
2118
|
-
|
|
2108
|
+
_s,
|
|
2119
2109
|
{
|
|
2120
|
-
currentClass:
|
|
2121
|
-
classPrefix:
|
|
2110
|
+
currentClass: g(i, "cls", ""),
|
|
2111
|
+
classPrefix: g(Ts, o, ""),
|
|
2122
2112
|
units: d || [],
|
|
2123
|
-
onChange:
|
|
2124
|
-
negative:
|
|
2125
|
-
cssProperty:
|
|
2113
|
+
onChange: k,
|
|
2114
|
+
negative: p,
|
|
2115
|
+
cssProperty: o
|
|
2126
2116
|
}
|
|
2127
2117
|
) : null,
|
|
2128
|
-
t === "icons" && /* @__PURE__ */ e.jsx(
|
|
2129
|
-
t === "range" && /* @__PURE__ */ e.jsx(
|
|
2130
|
-
t === "color" && /* @__PURE__ */ e.jsx(
|
|
2131
|
-
t === "dropdown" && /* @__PURE__ */ e.jsx(
|
|
2118
|
+
t === "icons" && /* @__PURE__ */ e.jsx(bs, { property: o, onChange: k }),
|
|
2119
|
+
t === "range" && /* @__PURE__ */ e.jsx(ms, { property: o, onChange: k }),
|
|
2120
|
+
t === "color" && /* @__PURE__ */ e.jsx(vs, { property: o, onChange: k }),
|
|
2121
|
+
t === "dropdown" && /* @__PURE__ */ e.jsx(yt, { label: l, property: o, onChange: k })
|
|
2132
2122
|
] }),
|
|
2133
|
-
/* @__PURE__ */ e.jsx("div", { className: `w-[30px] cursor-pointer ${v ? "visible" : "invisible"}`, children:
|
|
2134
|
-
/* @__PURE__ */ e.jsx(
|
|
2123
|
+
/* @__PURE__ */ e.jsx("div", { className: `w-[30px] cursor-pointer ${v ? "visible" : "invisible"}`, children: N ? /* @__PURE__ */ e.jsx("button", { type: "button", onClick: () => E(), 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" }) }) : I && i ? /* @__PURE__ */ e.jsxs(U, { delayDuration: 100, children: [
|
|
2124
|
+
/* @__PURE__ */ e.jsx(K, { asChild: !0, children: /* @__PURE__ */ e.jsx(
|
|
2135
2125
|
"button",
|
|
2136
2126
|
{
|
|
2137
2127
|
type: "button",
|
|
2138
2128
|
className: "invisible ml-3 mt-1 rounded-full bg-blue-500 text-white group-hover:visible",
|
|
2139
|
-
children: /* @__PURE__ */ e.jsx(
|
|
2129
|
+
children: /* @__PURE__ */ e.jsx(Ne, {})
|
|
2140
2130
|
}
|
|
2141
2131
|
) }),
|
|
2142
|
-
/* @__PURE__ */ e.jsx(
|
|
2132
|
+
/* @__PURE__ */ e.jsx(G, { children: /* @__PURE__ */ e.jsx("div", { className: "text-right", children: /* @__PURE__ */ e.jsxs("div", { children: [
|
|
2143
2133
|
"Current style is set at ",
|
|
2144
2134
|
/* @__PURE__ */ e.jsxs("span", { className: "font-bold", children: [
|
|
2145
|
-
|
|
2135
|
+
Rs(g(i, "mq")),
|
|
2146
2136
|
s && !i.dark ? "(Light mode)" : ""
|
|
2147
2137
|
] }),
|
|
2148
2138
|
/* @__PURE__ */ e.jsx("br", {}),
|
|
@@ -2150,11 +2140,11 @@ const vs = (r) => {
|
|
|
2150
2140
|
"button",
|
|
2151
2141
|
{
|
|
2152
2142
|
type: "button",
|
|
2153
|
-
onClick: () =>
|
|
2143
|
+
onClick: () => w(g(i, "mq")),
|
|
2154
2144
|
className: "block w-full cursor-default text-right font-semibold text-blue-500",
|
|
2155
2145
|
children: [
|
|
2156
2146
|
"Switch to ",
|
|
2157
|
-
|
|
2147
|
+
g(i, "mq").toUpperCase()
|
|
2158
2148
|
]
|
|
2159
2149
|
}
|
|
2160
2150
|
)
|
|
@@ -2162,47 +2152,47 @@ const vs = (r) => {
|
|
|
2162
2152
|
] }) : null })
|
|
2163
2153
|
] })
|
|
2164
2154
|
] }) });
|
|
2165
|
-
},
|
|
2155
|
+
}, Vs = ["px", "%", "em", "rem", "ch", "vh", "vw"], mt = ({
|
|
2166
2156
|
label: r,
|
|
2167
|
-
options:
|
|
2157
|
+
options: a,
|
|
2168
2158
|
borderB: t = !1,
|
|
2169
|
-
borderT:
|
|
2170
|
-
type:
|
|
2171
|
-
units: n =
|
|
2159
|
+
borderT: l = !1,
|
|
2160
|
+
type: o = "arbitrary",
|
|
2161
|
+
units: n = Vs,
|
|
2172
2162
|
negative: d = !1
|
|
2173
2163
|
}) => {
|
|
2174
|
-
const { t:
|
|
2164
|
+
const { t: p } = F(), [s, c] = j(a[0].key), u = ue(), i = B((h) => T(u, "property").includes(h), [u]);
|
|
2175
2165
|
return /* @__PURE__ */ e.jsxs(
|
|
2176
2166
|
"div",
|
|
2177
2167
|
{
|
|
2178
|
-
className: `mb-2 border-gray-800 py-2 first:pt-0 last:pb-0 ${t ? "border-b" : ""} ${
|
|
2168
|
+
className: `mb-2 border-gray-800 py-2 first:pt-0 last:pb-0 ${t ? "border-b" : ""} ${l ? "border-t" : ""}`,
|
|
2179
2169
|
children: [
|
|
2180
2170
|
/* @__PURE__ */ e.jsxs("div", { className: "flex flex-row text-xs", children: [
|
|
2181
|
-
r && /* @__PURE__ */ e.jsx("span", { className: "relative w-[70px] flex-none text-xs text-foreground", children:
|
|
2182
|
-
/* @__PURE__ */ e.jsx("div", { className: "mb-3 flex grow flex-row flex-wrap gap-x-px", children:
|
|
2183
|
-
|
|
2184
|
-
/* @__PURE__ */ e.jsx(
|
|
2171
|
+
r && /* @__PURE__ */ e.jsx("span", { className: "relative w-[70px] flex-none text-xs text-foreground", children: p(r) }),
|
|
2172
|
+
/* @__PURE__ */ e.jsx("div", { className: "mb-3 flex grow flex-row flex-wrap gap-x-px", children: $.Children.toArray(
|
|
2173
|
+
a.map(({ label: h, key: y }) => /* @__PURE__ */ e.jsx("div", { className: "first:rounded-l last:rounded-r", children: /* @__PURE__ */ e.jsxs(U, { children: [
|
|
2174
|
+
/* @__PURE__ */ e.jsx(K, { asChild: !0, children: /* @__PURE__ */ e.jsxs(
|
|
2185
2175
|
"button",
|
|
2186
2176
|
{
|
|
2187
2177
|
type: "button",
|
|
2188
|
-
onClick: () =>
|
|
2189
|
-
className: `relative cursor-pointer rounded-full p-1 text-[8px] ${
|
|
2178
|
+
onClick: () => c(y),
|
|
2179
|
+
className: `relative cursor-pointer rounded-full p-1 text-[8px] ${y === s ? " bg-[#3E57F0] text-white" : "text-gray-600 dark:text-gray-300"}`,
|
|
2190
2180
|
children: [
|
|
2191
|
-
|
|
2192
|
-
className: i(
|
|
2181
|
+
$.createElement("div", {
|
|
2182
|
+
className: i(y) ? "-bottom-1.5 absolute bg-[#3E57F0] h-[2px] left-0 w-full" : ""
|
|
2193
2183
|
}),
|
|
2194
|
-
|
|
2184
|
+
$.createElement(g(xt, y, qe), { className: "text-inherit w-3 h-3" })
|
|
2195
2185
|
]
|
|
2196
2186
|
}
|
|
2197
2187
|
) }),
|
|
2198
|
-
/* @__PURE__ */ e.jsx(
|
|
2188
|
+
/* @__PURE__ */ e.jsx(G, { children: Y(re(h)) })
|
|
2199
2189
|
] }) }))
|
|
2200
2190
|
) })
|
|
2201
2191
|
] }),
|
|
2202
2192
|
/* @__PURE__ */ e.jsx("div", { className: "mt-0 flex items-center", children: /* @__PURE__ */ e.jsx(
|
|
2203
|
-
|
|
2193
|
+
Te,
|
|
2204
2194
|
{
|
|
2205
|
-
type:
|
|
2195
|
+
type: o,
|
|
2206
2196
|
units: [...n],
|
|
2207
2197
|
label: "",
|
|
2208
2198
|
property: s,
|
|
@@ -2212,104 +2202,104 @@ const vs = (r) => {
|
|
|
2212
2202
|
]
|
|
2213
2203
|
}
|
|
2214
2204
|
);
|
|
2215
|
-
},
|
|
2216
|
-
const { t } =
|
|
2217
|
-
const n = (s) =>
|
|
2218
|
-
s.map((
|
|
2219
|
-
), d =
|
|
2220
|
-
|
|
2221
|
-
),
|
|
2222
|
-
return
|
|
2223
|
-
}, [
|
|
2205
|
+
}, Hs = ({ heading: r, items: a }) => {
|
|
2206
|
+
const { t } = F(), l = ue(), o = R(() => {
|
|
2207
|
+
const n = (s) => He(
|
|
2208
|
+
s.map((c) => c.styleType === "multiple" ? T(c.options, "key") : c.property)
|
|
2209
|
+
), d = He(
|
|
2210
|
+
a.map((s) => s.styleType === "accordion" ? n(s.items) : s.styleType === "multiple" ? T(s.options, "key") : s.property)
|
|
2211
|
+
), p = T(l, "property");
|
|
2212
|
+
return Dt(d, p).length > 0;
|
|
2213
|
+
}, [l, a]);
|
|
2224
2214
|
return /* @__PURE__ */ e.jsxs("details", { children: [
|
|
2225
2215
|
/* @__PURE__ */ e.jsx("summary", { className: "my-px cursor-default rounded-md bg-background p-px px-2 text-[11px] text-foreground", children: /* @__PURE__ */ e.jsxs("div", { className: "inline", children: [
|
|
2226
2216
|
t(r),
|
|
2227
|
-
|
|
2217
|
+
o ? /* @__PURE__ */ e.jsx(
|
|
2228
2218
|
"span",
|
|
2229
2219
|
{
|
|
2230
|
-
className: `ml-1 mr-2 inline-block h-[8px] w-[8px] rounded-full ${
|
|
2220
|
+
className: `ml-1 mr-2 inline-block h-[8px] w-[8px] rounded-full ${o ? "bg-blue-500" : "bg-gray-300"}`
|
|
2231
2221
|
}
|
|
2232
2222
|
) : null
|
|
2233
2223
|
] }) }),
|
|
2234
|
-
/* @__PURE__ */ e.jsx("div", { className: "p-2", children:
|
|
2224
|
+
/* @__PURE__ */ e.jsx("div", { className: "p-2", children: a.map((n) => n.styleType === "multiple" ? /* @__PURE__ */ e.jsx(mt, { ...n }, n.label) : /* @__PURE__ */ e.jsx(Te, { ...n }, n.label)) })
|
|
2235
2225
|
] });
|
|
2236
|
-
},
|
|
2237
|
-
const { t:
|
|
2226
|
+
}, Ds = Ze({}), xe = ({ section: r }) => {
|
|
2227
|
+
const { t: a } = F(), t = ue(), l = X(), o = B(
|
|
2238
2228
|
(s = []) => {
|
|
2239
|
-
const
|
|
2229
|
+
const c = {};
|
|
2240
2230
|
for (let i = 0; i < t.length; i++)
|
|
2241
|
-
|
|
2242
|
-
let
|
|
2231
|
+
c[t[i].property] = t[i].cls;
|
|
2232
|
+
let u = !0;
|
|
2243
2233
|
for (const i in s)
|
|
2244
|
-
if (!de(
|
|
2245
|
-
|
|
2234
|
+
if (!de(c, i) || c[i] !== s[i]) {
|
|
2235
|
+
u = !1;
|
|
2246
2236
|
break;
|
|
2247
2237
|
}
|
|
2248
|
-
return
|
|
2238
|
+
return u;
|
|
2249
2239
|
},
|
|
2250
2240
|
[t]
|
|
2251
|
-
), n =
|
|
2241
|
+
), n = R(() => ({}), []), [d] = le(), p = R(() => {
|
|
2252
2242
|
const s = `${Le(d, "0.prop")}_attrs`;
|
|
2253
|
-
return !
|
|
2243
|
+
return !ts(Le(l, s, {}));
|
|
2254
2244
|
}, [d]);
|
|
2255
|
-
return /* @__PURE__ */ e.jsx(
|
|
2245
|
+
return /* @__PURE__ */ e.jsx(Ds.Provider, { value: n, children: /* @__PURE__ */ e.jsxs(be, { value: r.heading, children: [
|
|
2256
2246
|
/* @__PURE__ */ e.jsx(fe, { className: "border-b border-gray-300 bg-gray-200 px-3 py-2 text-xs hover:no-underline", children: /* @__PURE__ */ e.jsxs("div", { className: "flex items-center", children: [
|
|
2257
|
-
r.heading === "Attributes" &&
|
|
2258
|
-
/* @__PURE__ */ e.jsx("div", { className: "flex items-center gap-x-2", children:
|
|
2247
|
+
r.heading === "Attributes" && p ? /* @__PURE__ */ e.jsx("span", { className: "mr-2 inline-block h-[8px] w-[8px] rounded-full bg-blue-600" }) : null,
|
|
2248
|
+
/* @__PURE__ */ e.jsx("div", { className: "flex items-center gap-x-2", children: a(r.heading) })
|
|
2259
2249
|
] }) }),
|
|
2260
|
-
/* @__PURE__ */ e.jsx(ve, { className: "bg-gray-100 px-3.5 py-2", children:
|
|
2261
|
-
r.items.map((s) => de(s, "component") ?
|
|
2250
|
+
/* @__PURE__ */ e.jsx(ve, { className: "bg-gray-100 px-3.5 py-2", children: $.Children.toArray(
|
|
2251
|
+
r.items.map((s) => de(s, "component") ? $.createElement(s.component, { key: s.label }) : de(s, "styleType") ? s.styleType === "multiple" ? /* @__PURE__ */ e.jsx(mt, { ...s }, s.label) : s.styleType === "accordion" && o(s == null ? void 0 : s.conditions) ? /* @__PURE__ */ e.jsx(Hs, { ...s }, s.label) : null : /* @__PURE__ */ e.jsx(Te, { ...s }, s.label))
|
|
2262
2252
|
) })
|
|
2263
2253
|
] }) });
|
|
2264
|
-
},
|
|
2265
|
-
const r =
|
|
2266
|
-
if (
|
|
2254
|
+
}, Bs = () => {
|
|
2255
|
+
const r = X(), [a] = le(), { t } = F(), l = Yr(), o = _e(), n = Se(r._type), d = g(oe(a), "prop"), p = g(n.props, `${d}.presets`, {});
|
|
2256
|
+
if (b(l) && (!de(n, "props") || b(p)))
|
|
2267
2257
|
return null;
|
|
2268
|
-
const s = (
|
|
2269
|
-
const
|
|
2270
|
-
|
|
2258
|
+
const s = (c) => {
|
|
2259
|
+
const u = c.trim().toLowerCase().replace(/ +(?= )/g, "").split(" ");
|
|
2260
|
+
o([r._id], u, !0);
|
|
2271
2261
|
};
|
|
2272
|
-
return /* @__PURE__ */ e.jsx("div", { className: "h-10", children: /* @__PURE__ */ e.jsxs(
|
|
2273
|
-
/* @__PURE__ */ e.jsx(
|
|
2262
|
+
return /* @__PURE__ */ e.jsx("div", { className: "h-10", children: /* @__PURE__ */ e.jsxs(Hr, { children: [
|
|
2263
|
+
/* @__PURE__ */ e.jsx(Dr, { asChild: !0, children: /* @__PURE__ */ e.jsx("div", { className: "px-4", children: /* @__PURE__ */ e.jsxs(P, { variant: "default", className: "w-full", size: "sm", children: [
|
|
2274
2264
|
t("Apply Presets"),
|
|
2275
|
-
/* @__PURE__ */ e.jsx(
|
|
2265
|
+
/* @__PURE__ */ e.jsx(Qt, {})
|
|
2276
2266
|
] }) }) }),
|
|
2277
|
-
/* @__PURE__ */ e.jsx(
|
|
2278
|
-
|
|
2279
|
-
/* @__PURE__ */ e.jsxs(
|
|
2267
|
+
/* @__PURE__ */ e.jsx(Br, { className: "max-h-80 w-56", children: /* @__PURE__ */ e.jsxs(pt, { className: "no-scrollbar h-full", children: [
|
|
2268
|
+
b(p) ? null : /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
2269
|
+
/* @__PURE__ */ e.jsxs(Ae, { children: [
|
|
2280
2270
|
n.type,
|
|
2281
2271
|
" ",
|
|
2282
2272
|
t("presets")
|
|
2283
2273
|
] }),
|
|
2284
|
-
/* @__PURE__ */ e.jsx(
|
|
2285
|
-
/* @__PURE__ */ e.jsx($e, { children: he(
|
|
2286
|
-
|
|
2274
|
+
/* @__PURE__ */ e.jsx(Pe, {}),
|
|
2275
|
+
/* @__PURE__ */ e.jsx($e, { children: he(p).map((c) => /* @__PURE__ */ e.jsxs(Ee, { className: "group text-xs", onClick: () => s(p[c]), children: [
|
|
2276
|
+
me(Y(t(c))),
|
|
2287
2277
|
/* @__PURE__ */ e.jsx(Me, { className: "invisible hover:font-bold hover:text-blue-600 group-hover:visible", children: t("apply") })
|
|
2288
2278
|
] })) })
|
|
2289
2279
|
] }),
|
|
2290
|
-
|
|
2291
|
-
/* @__PURE__ */ e.jsx(
|
|
2292
|
-
/* @__PURE__ */ e.jsx(
|
|
2293
|
-
/* @__PURE__ */ e.jsx($e, { children: he(
|
|
2294
|
-
|
|
2280
|
+
b(l) ? null : /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
2281
|
+
/* @__PURE__ */ e.jsx(Ae, { children: t("Global presets") }),
|
|
2282
|
+
/* @__PURE__ */ e.jsx(Pe, {}),
|
|
2283
|
+
/* @__PURE__ */ e.jsx($e, { children: he(l).map((c) => /* @__PURE__ */ e.jsxs(Ee, { className: "group text-xs", onClick: () => s(l[c]), children: [
|
|
2284
|
+
me(Y(t(c))),
|
|
2295
2285
|
/* @__PURE__ */ e.jsx(Me, { className: "invisible hover:font-bold hover:text-blue-600 group-hover:visible", children: t("apply") })
|
|
2296
2286
|
] })) })
|
|
2297
2287
|
] })
|
|
2298
2288
|
] }) })
|
|
2299
2289
|
] }) });
|
|
2300
2290
|
};
|
|
2301
|
-
function
|
|
2302
|
-
const { flexChild: r, gridChild:
|
|
2303
|
-
return
|
|
2304
|
-
/* @__PURE__ */ e.jsx(
|
|
2291
|
+
function Is() {
|
|
2292
|
+
const { flexChild: r, gridChild: a } = Ir(), [t] = le();
|
|
2293
|
+
return b(t) ? null : /* @__PURE__ */ e.jsxs("div", { className: "flex h-full flex-col", children: [
|
|
2294
|
+
/* @__PURE__ */ e.jsx(Bs, {}),
|
|
2305
2295
|
/* @__PURE__ */ e.jsxs(at, { defaultValue: ["Styles"], type: "multiple", className: "w-full", children: [
|
|
2306
|
-
r && /* @__PURE__ */ e.jsx(xe, { section:
|
|
2307
|
-
|
|
2308
|
-
|
|
2296
|
+
r && /* @__PURE__ */ e.jsx(xe, { section: gs }),
|
|
2297
|
+
a ? /* @__PURE__ */ e.jsx(xe, { section: xs }) : null,
|
|
2298
|
+
ys.map((l) => /* @__PURE__ */ e.jsx(xe, { section: l }, l.heading))
|
|
2309
2299
|
] })
|
|
2310
2300
|
] });
|
|
2311
2301
|
}
|
|
2312
|
-
const
|
|
2302
|
+
const As = {
|
|
2313
2303
|
px: 1,
|
|
2314
2304
|
"%": 1,
|
|
2315
2305
|
em: 100,
|
|
@@ -2320,8 +2310,8 @@ const Bs = {
|
|
|
2320
2310
|
"-": 1,
|
|
2321
2311
|
deg: 1,
|
|
2322
2312
|
ms: 0.1
|
|
2323
|
-
},
|
|
2324
|
-
const r =
|
|
2313
|
+
}, Po = () => {
|
|
2314
|
+
const r = X(), { t: a } = F(), [t, l] = $.useState(""), [o, n] = $.useState({
|
|
2325
2315
|
onDrag: (s) => s,
|
|
2326
2316
|
onDragEnd: (s) => s,
|
|
2327
2317
|
dragStartY: 0,
|
|
@@ -2332,18 +2322,18 @@ const Bs = {
|
|
|
2332
2322
|
cssProperty: ""
|
|
2333
2323
|
}), d = ce(
|
|
2334
2324
|
(s) => {
|
|
2335
|
-
const
|
|
2336
|
-
let i = parseFloat(
|
|
2337
|
-
i =
|
|
2338
|
-
let
|
|
2339
|
-
(
|
|
2340
|
-
let
|
|
2341
|
-
|
|
2325
|
+
const c = !g(o, "negative", !1), u = g(o, "cssProperty", "");
|
|
2326
|
+
let i = parseFloat(o.dragStartValue);
|
|
2327
|
+
i = Ue(i) ? 0 : i;
|
|
2328
|
+
let h = As[o.dragUnit];
|
|
2329
|
+
(q(u, "scale") || u === "opacity") && (h = 10);
|
|
2330
|
+
let x = (o.dragStartY - s.pageY) / h + i;
|
|
2331
|
+
c && x < 0 && (x = 0), u === "opacity" && x > 1 && (x = 1), o.onDrag(`${x}`), l(`${x}`);
|
|
2342
2332
|
},
|
|
2343
|
-
[
|
|
2333
|
+
[o],
|
|
2344
2334
|
50
|
|
2345
|
-
),
|
|
2346
|
-
setTimeout(() =>
|
|
2335
|
+
), p = B(() => {
|
|
2336
|
+
setTimeout(() => o.onDragEnd(`${t}`), 100), n({
|
|
2347
2337
|
onDrag: (s) => s,
|
|
2348
2338
|
onDragEnd: (s) => s,
|
|
2349
2339
|
dragStartY: 0,
|
|
@@ -2353,22 +2343,22 @@ const Bs = {
|
|
|
2353
2343
|
negative: !1,
|
|
2354
2344
|
cssProperty: ""
|
|
2355
2345
|
});
|
|
2356
|
-
}, [
|
|
2357
|
-
return
|
|
2358
|
-
/* @__PURE__ */ e.jsx(
|
|
2359
|
-
/* @__PURE__ */ e.jsx("h1", { children:
|
|
2360
|
-
] }) }) : /* @__PURE__ */ e.jsx(Je, { children: /* @__PURE__ */ e.jsxs(
|
|
2361
|
-
|
|
2346
|
+
}, [o, t, n]);
|
|
2347
|
+
return Bt(r) ? /* @__PURE__ */ e.jsx("div", { className: "p-4 text-center", children: /* @__PURE__ */ e.jsxs("div", { className: "space-y-4 rounded-xl p-4", children: [
|
|
2348
|
+
/* @__PURE__ */ e.jsx(er, { className: "mx-auto text-3xl" }),
|
|
2349
|
+
/* @__PURE__ */ e.jsx("h1", { children: a("no_block_selected_for_styling") })
|
|
2350
|
+
] }) }) : /* @__PURE__ */ e.jsx(Je, { children: /* @__PURE__ */ e.jsxs(ht.Provider, { value: { setDragData: n }, children: [
|
|
2351
|
+
o.dragging ? /* @__PURE__ */ e.jsx(
|
|
2362
2352
|
"div",
|
|
2363
2353
|
{
|
|
2364
2354
|
onMouseMove: d,
|
|
2365
|
-
onMouseUp: () =>
|
|
2355
|
+
onMouseUp: () => p(),
|
|
2366
2356
|
className: "absolute inset-0 z-30 cursor-row-resize bg-gray-300/10"
|
|
2367
2357
|
}
|
|
2368
2358
|
) : null,
|
|
2369
|
-
/* @__PURE__ */ e.jsxs(
|
|
2370
|
-
/* @__PURE__ */ e.jsx(
|
|
2371
|
-
/* @__PURE__ */ e.jsx(
|
|
2359
|
+
/* @__PURE__ */ e.jsxs(pt, { className: "no-scrollbar max-h-full flex-1 overflow-x-hidden overflow-y-hidden bg-gray-100 pb-5", children: [
|
|
2360
|
+
/* @__PURE__ */ e.jsx(ds, {}),
|
|
2361
|
+
/* @__PURE__ */ e.jsx(Is, {}),
|
|
2372
2362
|
/* @__PURE__ */ e.jsx("br", {}),
|
|
2373
2363
|
/* @__PURE__ */ e.jsx("br", {}),
|
|
2374
2364
|
/* @__PURE__ */ e.jsx("br", {})
|
|
@@ -2376,5 +2366,5 @@ const Bs = {
|
|
|
2376
2366
|
] }) });
|
|
2377
2367
|
};
|
|
2378
2368
|
export {
|
|
2379
|
-
|
|
2369
|
+
Po as default
|
|
2380
2370
|
};
|