@chaibuilder/sdk 1.2.55 → 1.2.57
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-HeYXoex4.js → AddBlocks-05ZH2Suu.js} +46 -50
- package/dist/AddBlocks-MH_fqSRf.cjs +1 -0
- package/dist/{CanvasArea-CqILE5PR.js → CanvasArea-8f_Ki3B7.js} +361 -361
- package/dist/CanvasArea-UisRL54b.cjs +56 -0
- package/dist/CodeEditor-vECReGwz.cjs +1 -0
- package/dist/{CodeEditor-kxV5RCpd.js → CodeEditor-zYBqhBv3.js} +33 -39
- package/dist/CurrentPage-7aEIhzQ0.cjs +1 -0
- package/dist/{CurrentPage-IrFGAb7n.js → CurrentPage-nzo4lszx.js} +26 -25
- package/dist/ListTree-A-097CZ-.cjs +1 -0
- package/dist/{ListTree-0n_G8NJx.js → ListTree-KUGhFsb_.js} +9 -13
- package/dist/PagesPanel-L1mI3y_6.cjs +1 -0
- package/dist/{PagesPanel-RYBf0Yct.js → PagesPanel-hleqqZBo.js} +20 -19
- package/dist/ProjectPanel-HTxa1kHv.cjs +1 -0
- package/dist/{ProjectPanel-Zagx6l3Q.js → ProjectPanel-RXEhYr0a.js} +25 -24
- package/dist/Settings-7EMwx6zL.cjs +1 -0
- package/dist/{Settings-RLDTFFf8.js → Settings-b1ZuIn4y.js} +404 -395
- package/dist/{SidePanels-ao969pMV.js → SidePanels-6hZeCR5Z.js} +89 -88
- package/dist/SidePanels-_6WlMWq_.cjs +1 -0
- package/dist/ThemeConfiguration-PvMN3j6h.cjs +1 -0
- package/dist/{ThemeConfiguration-S7yArRMp.js → ThemeConfiguration-ab7lbA2y.js} +18 -24
- package/dist/Topbar-WdGZIIZp.cjs +1 -0
- package/dist/{Topbar-B8u0whpc.js → Topbar-YfsC1DZ2.js} +39 -38
- package/dist/{UILibrariesPanel-tcfz2ELp.js → UILibrariesPanel-5QxxXYg2.js} +56 -61
- package/dist/UILibrariesPanel-r8nQzXQ-.cjs +1 -0
- package/dist/{UnsplashImages-wWRifkCp.js → UnsplashImages-alt_doTy.js} +42 -47
- package/dist/UnsplashImages-cah1BRL_.cjs +1 -0
- package/dist/UploadImages-5dRETWCo.cjs +1 -0
- package/dist/{UploadImages-lUvZhW_j.js → UploadImages-JqVL_aQd.js} +32 -38
- package/dist/{add-page-modal-04b4l2zu.js → add-page-modal-CtMwNEsW.js} +29 -28
- package/dist/add-page-modal-DA5P4pVu.cjs +1 -0
- package/dist/{confirm-alert-FX5030eR.js → confirm-alert-m85JJlQi.js} +15 -21
- package/dist/confirm-alert-rYsxlfR4.cjs +1 -0
- package/dist/core.cjs +1 -1
- package/dist/core.js +44 -43
- package/dist/delete-page-modal-AvUZI9Tk.cjs +1 -0
- package/dist/{delete-page-modal-1u9CyAIP.js → delete-page-modal-TMpN1Dvm.js} +22 -21
- package/dist/email.cjs +1 -1
- package/dist/email.js +19 -19
- package/dist/form-G3PqS2Gc.cjs +1 -0
- package/dist/{form-HRdEJjVq.js → form-MSL4CDff.js} +3 -3
- package/dist/{html-to-json-OnIZDDXw.js → html-to-json-_01DXd-a.js} +37 -36
- package/dist/html-to-json-ndxaXRT8.cjs +1 -0
- package/dist/{index-vfmO3y2d.js → index--hN9ZQsP.js} +19 -19
- package/dist/index-0FIxW0gR.cjs +1 -0
- package/dist/{ChaiBuilderEditor-tkzS851D.js → index-IgLSTkN6.js} +14660 -17763
- package/dist/index-sspgZwTk.cjs +206 -0
- package/dist/index-uLn8W3eR.js +3145 -0
- package/dist/index-zaKhyTQ6.cjs +1 -0
- package/dist/lib.cjs +2 -2
- package/dist/lib.js +17 -16
- package/dist/page-viewer-2BMSxxfd.cjs +1 -0
- package/dist/{page-viewer-dcb3u4OV.js → page-viewer-D8nsi13f.js} +27 -26
- package/dist/project-general-setting--0hX9Otn.cjs +1 -0
- package/dist/{project-general-setting--sS34seu.js → project-general-setting-HGjTNFRx.js} +23 -22
- package/dist/{project-seo-setting-8tc3I-0M.js → project-seo-setting-3kFJ77jY.js} +20 -26
- package/dist/project-seo-setting-C3ilIIeM.cjs +1 -0
- package/dist/render.cjs +1 -1
- package/dist/render.js +104 -102
- package/dist/single-page-detail-7BpYAyMO.cjs +1 -0
- package/dist/{single-page-detail-tP2pfgBp.js → single-page-detail-eMnjt_Ih.js} +26 -25
- package/dist/studio.cjs +1 -1
- package/dist/studio.js +19 -18
- package/dist/ui.cjs +1 -1
- package/dist/ui.js +144 -150
- package/dist/web-blocks.cjs +1 -1
- package/dist/web-blocks.js +168 -111
- package/package.json +1 -1
- package/dist/AddBlocks-VHoZezjj.cjs +0 -1
- package/dist/CanvasArea-137WY3Wx.cjs +0 -56
- package/dist/ChaiBuilderEditor-aY8flOgX.cjs +0 -206
- package/dist/CodeEditor-R2jKe97T.cjs +0 -1
- package/dist/CurrentPage-PjrVzHXR.cjs +0 -1
- package/dist/ListTree-C6oCXZDV.cjs +0 -1
- package/dist/PagesPanel-lIC3kYmS.cjs +0 -1
- package/dist/ProjectPanel-0Siyi5YS.cjs +0 -1
- package/dist/Settings-6QRVcl16.cjs +0 -1
- package/dist/SidePanels-j1EFsBlK.cjs +0 -1
- package/dist/ThemeConfiguration-q1471P7b.cjs +0 -1
- package/dist/Topbar-ogFKKDbx.cjs +0 -1
- package/dist/UILibrariesPanel-cm9CFWxc.cjs +0 -1
- package/dist/UnsplashImages-E2L3YDJI.cjs +0 -1
- package/dist/UploadImages-s-eeaGiS.cjs +0 -1
- package/dist/add-page-modal-eroF20lO.cjs +0 -1
- package/dist/confirm-alert-XuxEzG-V.cjs +0 -1
- package/dist/delete-page-modal-pgh7sdfg.cjs +0 -1
- package/dist/form-Z4IRWj0o.cjs +0 -1
- package/dist/html-to-json-rauxDBi6.cjs +0 -1
- package/dist/index-bt7EhwLh.cjs +0 -1
- package/dist/page-viewer-O960kM2x.cjs +0 -1
- package/dist/project-general-setting-lIvNs-Vq.cjs +0 -1
- package/dist/project-seo-setting-MIlAuqcc.cjs +0 -1
- package/dist/single-page-detail-0Z_hvd_j.cjs +0 -1
- package/dist/useCanvasSettings-R0h03UfD.cjs +0 -1
- package/dist/useCanvasSettings-rEZHbw3s.js +0 -6
|
@@ -1,33 +1,24 @@
|
|
|
1
1
|
import { j as e } from "./jsx-runtime-WbnYoNE9.js";
|
|
2
2
|
import * as ie from "react";
|
|
3
|
-
import $, { useState as j, useMemo as
|
|
3
|
+
import $, { useState as j, useMemo as T, useEffect as I, useCallback as B, memo as ft, useRef as ye, createContext as We, useContext as se } from "react";
|
|
4
4
|
import { useThrottledCallback as ce } from "@react-hookz/web";
|
|
5
|
-
import { forEach as ke, isArray as pe, omit as vt, truncate as wt, includes as
|
|
6
|
-
import { useTranslation as
|
|
7
|
-
import { CopyIcon as
|
|
8
|
-
import {
|
|
9
|
-
import { Check as Ar, EditIcon as
|
|
10
|
-
import { getBlockComponent as
|
|
11
|
-
import {
|
|
12
|
-
import Wr from "
|
|
13
|
-
import Ur from "@rjsf/
|
|
14
|
-
import
|
|
15
|
-
import Gr from "
|
|
16
|
-
import qr from "
|
|
17
|
-
import
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
5
|
+
import { forEach as ke, isArray as pe, omit as vt, truncate as wt, includes as X, get as g, first as oe, split as jt, startCase as Y, toLower as re, isEmpty as b, map as R, find as Ct, last as kt, filter as Ve, set as Ue, debounce as Nt, keys as he, cloneDeep as _t, each as St, capitalize as me, reject as Tt, nth as He, startsWith as q, isNumber as Rt, parseInt as Vt, isNaN as Ke, findLast as Ht, flatten as De, intersection as Dt, has as de, isNull as Bt } from "lodash-es";
|
|
6
|
+
import { useTranslation as E } from "react-i18next";
|
|
7
|
+
import { CopyIcon as At, PlusIcon as Ge, Cross2Icon as qe, EyeOpenIcon as It, EyeClosedIcon as Be, BorderAllIcon as F, 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 Ft, FontItalicIcon as Xt, UnderlineIcon as Yt, OverlineIcon as Zt, LetterCaseUppercaseIcon as Wt, Cross1Icon as Ut, InfoCircledIcon as Ne, MinusIcon as Kt, BoxIcon as Je, RowSpacingIcon as Gt, TriangleDownIcon as qt, CrossCircledIcon as Jt, CaretDownIcon as Qt, MixerHorizontalIcon as er } from "@radix-ui/react-icons";
|
|
8
|
+
import { b8 as Qe, b9 as et, B as P, ba as tt, bb as tr, bc as rr, bd as sr, be as or, bf as lr, bg as ar, ai as M, aw as nr, ax as ir, ay as dr, bh as cr, au as pr, aE as ur, av as gr, aF as U, aG as K, aH as G, $ as xr, bi as yr, bj as hr, bk as mr, bl as br, bm as fr, bn as vr, b4 as wr, r as _e, aR as jr, aX as be, an as rt, am as st, h as ot, bo as Cr, L as lt, M as fe, N as ve, O as we, T as at, S as kr, at as le, a3 as Se, af as nt, K as Nr, bp as it, v as _r, bq as Sr, ag as ue, aa as Tr, al as Rr, a4 as Ae, E as Vr, F as Hr, G as Dr, br as dt, H as Ie, I as Pe, bs as $e, J as Ee, bt as Me, ao as Br } from "./index-uLn8W3eR.js";
|
|
9
|
+
import { Check as Ar, EditIcon as Ir, TrashIcon as Pr, Loader as $r, SparklesIcon as Er, Edit2 as Mr, X as Lr } from "lucide-react";
|
|
10
|
+
import { getBlockComponent as Te, getChaiDataProviders as Or, useGlobalStylingPresets as zr } from "@chaibuilder/runtime";
|
|
11
|
+
import { E as ct, u as pt, b as Fr, c as Xr } from "./index-IgLSTkN6.js";
|
|
12
|
+
import { J as Yr, a as Zr, d as Wr } from "./index-e0c8PmRQ.js";
|
|
13
|
+
import Ur from "@rjsf/core";
|
|
14
|
+
import Kr from "@rjsf/validator-ajv8";
|
|
15
|
+
import { useAtom as Gr } from "jotai";
|
|
16
|
+
import qr from "react-autosuggest";
|
|
17
|
+
import Jr from "fuse.js";
|
|
18
|
+
import { A as Qr, C as ge, g as es } from "./utils-VpVqnC9m.js";
|
|
19
|
+
import { a as ts } from "./MODIFIERS-fd5XOmum.js";
|
|
20
|
+
import { get as Le, isEmpty as rs } from "lodash";
|
|
20
21
|
import "./_commonjsHelpers-UyOWmZb0.js";
|
|
21
|
-
import "clsx";
|
|
22
|
-
import "react-dom";
|
|
23
|
-
import "@radix-ui/react-scroll-area";
|
|
24
|
-
import "@floating-ui/react-dom";
|
|
25
|
-
import "jotai";
|
|
26
|
-
import "i18next";
|
|
27
|
-
import "flagged";
|
|
28
|
-
import "./Functions-7jnEwJyw.js";
|
|
29
|
-
import "tailwind-merge";
|
|
30
|
-
import "tree-model";
|
|
31
22
|
import "@radix-ui/react-toggle";
|
|
32
23
|
import "class-variance-authority";
|
|
33
24
|
import "@radix-ui/react-switch";
|
|
@@ -36,6 +27,7 @@ import "@radix-ui/react-accordion";
|
|
|
36
27
|
import "@radix-ui/react-alert-dialog";
|
|
37
28
|
import "@radix-ui/react-dialog";
|
|
38
29
|
import "@radix-ui/react-label";
|
|
30
|
+
import "@radix-ui/react-scroll-area";
|
|
39
31
|
import "@radix-ui/react-tabs";
|
|
40
32
|
import "@radix-ui/react-tooltip";
|
|
41
33
|
import "@radix-ui/react-popover";
|
|
@@ -48,32 +40,40 @@ import "@radix-ui/react-toast";
|
|
|
48
40
|
import "cmdk";
|
|
49
41
|
import "@radix-ui/react-context-menu";
|
|
50
42
|
import "react-icons-picker";
|
|
43
|
+
import "react-dom";
|
|
51
44
|
import "react-quill";
|
|
45
|
+
import "./Functions-7jnEwJyw.js";
|
|
46
|
+
import "clsx";
|
|
47
|
+
import "tailwind-merge";
|
|
48
|
+
import "tree-model";
|
|
49
|
+
import "i18next";
|
|
50
|
+
import "@floating-ui/react-dom";
|
|
51
|
+
import "flagged";
|
|
52
52
|
import "react-hotkeys-hook";
|
|
53
53
|
import "./index-VBXQixVm.js";
|
|
54
|
-
function
|
|
54
|
+
function ss(r) {
|
|
55
55
|
const a = [], t = {};
|
|
56
56
|
function l(o, n) {
|
|
57
|
-
ke(n, (
|
|
58
|
-
const s = o ? `${o}.${p}` : p,
|
|
59
|
-
a.push(s), t[s] =
|
|
57
|
+
ke(n, (c, p) => {
|
|
58
|
+
const s = o ? `${o}.${p}` : p, d = pe(c) ? "list" : typeof c;
|
|
59
|
+
a.push(s), t[s] = d === "string" ? "text" : d === "object" ? "model" : d, d === "object" && !pe(c) && l(s, c);
|
|
60
60
|
});
|
|
61
61
|
}
|
|
62
62
|
return l("", vt(r, ["styles", "_type", "_id", "_name", "_bindings"])), { paths: a, pathsType: t };
|
|
63
63
|
}
|
|
64
|
-
const
|
|
64
|
+
const je = ({ data: r, fullView: a }) => {
|
|
65
65
|
if (!r)
|
|
66
66
|
return null;
|
|
67
67
|
const t = typeof r;
|
|
68
68
|
return a ? typeof r == "object" ? /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
69
69
|
/* @__PURE__ */ e.jsx("div", { className: "h-3" }),
|
|
70
|
-
/* @__PURE__ */ e.jsx(
|
|
71
|
-
|
|
70
|
+
/* @__PURE__ */ e.jsx(ct, { children: /* @__PURE__ */ e.jsx(
|
|
71
|
+
Yr,
|
|
72
72
|
{
|
|
73
73
|
data: r,
|
|
74
|
-
shouldExpandNode:
|
|
74
|
+
shouldExpandNode: Zr,
|
|
75
75
|
style: {
|
|
76
|
-
...
|
|
76
|
+
...Wr,
|
|
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"
|
|
@@ -91,12 +91,12 @@ const we = ({ data: r, fullView: a }) => {
|
|
|
91
91
|
data: l,
|
|
92
92
|
onChange: o,
|
|
93
93
|
dataType: n,
|
|
94
|
-
appliedBindings:
|
|
94
|
+
appliedBindings: c
|
|
95
95
|
}) => {
|
|
96
|
-
const { paths: p, pathsType: s } =
|
|
97
|
-
(x) => !
|
|
98
|
-
) : p.filter((x) => n === g(s, x, "")), [r, p,
|
|
99
|
-
return
|
|
96
|
+
const { paths: p, pathsType: s } = ss(l), d = r === "PROP" ? Te(l == null ? void 0 : l._type) : {}, u = r === "PROP", [i, h] = j(!1), y = T(() => r === "PROP" ? p.filter(
|
|
97
|
+
(x) => !X(c, x) && g(d, `props.${oe(jt(x, "."))}.binding`)
|
|
98
|
+
) : p.filter((x) => n === g(s, x, "")), [r, p, c, n, d]);
|
|
99
|
+
return I(() => {
|
|
100
100
|
a && o(a);
|
|
101
101
|
}, [a, r]), /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
102
102
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-4", children: [
|
|
@@ -124,7 +124,7 @@ const we = ({ data: r, fullView: a }) => {
|
|
|
124
124
|
/* @__PURE__ */ e.jsx(rr, { placeholder: `Choose ${re(r)}...` }),
|
|
125
125
|
/* @__PURE__ */ e.jsxs(sr, { children: [
|
|
126
126
|
/* @__PURE__ */ e.jsx(or, { children: "No results found." }),
|
|
127
|
-
/* @__PURE__ */ e.jsx(lr, { children:
|
|
127
|
+
/* @__PURE__ */ e.jsx(lr, { children: R(y, (x) => /* @__PURE__ */ e.jsxs(
|
|
128
128
|
ar,
|
|
129
129
|
{
|
|
130
130
|
value: x,
|
|
@@ -137,7 +137,7 @@ const we = ({ data: r, fullView: a }) => {
|
|
|
137
137
|
/* @__PURE__ */ e.jsx(Ar, { className: `h-4 w-4 text-green-500 ${a === x ? "" : "opacity-0"}` }),
|
|
138
138
|
x
|
|
139
139
|
] }),
|
|
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(
|
|
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(je, { data: g(l, x) }) })
|
|
141
141
|
]
|
|
142
142
|
},
|
|
143
143
|
x
|
|
@@ -146,27 +146,27 @@ const we = ({ data: r, fullView: a }) => {
|
|
|
146
146
|
] }) })
|
|
147
147
|
] })
|
|
148
148
|
] }),
|
|
149
|
-
!u && !b(a) && /* @__PURE__ */ e.jsx("div", { className: "pt-2", children: /* @__PURE__ */ e.jsx(
|
|
149
|
+
!u && !b(a) && /* @__PURE__ */ e.jsx("div", { className: "pt-2", children: /* @__PURE__ */ e.jsx(je, { data: g(l, a, ""), fullView: !0 }) })
|
|
150
150
|
] });
|
|
151
|
-
},
|
|
151
|
+
}, os = ({
|
|
152
152
|
appliedBindings: r = [],
|
|
153
153
|
onAddBinding: a,
|
|
154
154
|
editMode: t,
|
|
155
155
|
item: l
|
|
156
156
|
}) => {
|
|
157
|
-
const [o, n] = j(t ? l.key : ""), [
|
|
157
|
+
const [o, n] = j(t ? l.key : ""), [c, p] = j(t ? l.value : ""), s = M(), [d] = pt(), u = B(
|
|
158
158
|
(y, x) => {
|
|
159
159
|
if (b(y))
|
|
160
160
|
return "";
|
|
161
161
|
{
|
|
162
|
-
const v = g(x === "PROP" ? s :
|
|
162
|
+
const v = g(x === "PROP" ? s : d, y, "");
|
|
163
163
|
if (pe(v))
|
|
164
164
|
return "list";
|
|
165
165
|
const k = typeof v;
|
|
166
166
|
return k === "string" ? "text" : k === "object" ? "model" : k;
|
|
167
167
|
}
|
|
168
168
|
},
|
|
169
|
-
[s,
|
|
169
|
+
[s, d]
|
|
170
170
|
), [i, h] = j(t ? u(l.key, "PROP") : "");
|
|
171
171
|
return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
172
172
|
/* @__PURE__ */ e.jsxs(nr, { children: [
|
|
@@ -198,13 +198,13 @@ const we = ({ data: r, fullView: a }) => {
|
|
|
198
198
|
type: "PATH",
|
|
199
199
|
isDisabled: b(o),
|
|
200
200
|
placeholder: "Enter data path",
|
|
201
|
-
value:
|
|
201
|
+
value: c,
|
|
202
202
|
setValue: p,
|
|
203
203
|
onChange: (y) => {
|
|
204
204
|
const x = u(y, "PATH");
|
|
205
205
|
p(i === x ? y : "");
|
|
206
206
|
},
|
|
207
|
-
data:
|
|
207
|
+
data: d,
|
|
208
208
|
dataType: i,
|
|
209
209
|
appliedBindings: r
|
|
210
210
|
}
|
|
@@ -215,18 +215,18 @@ const we = ({ data: r, fullView: a }) => {
|
|
|
215
215
|
{
|
|
216
216
|
type: "submit",
|
|
217
217
|
className: "mt-4",
|
|
218
|
-
disabled: b(o) && b(
|
|
219
|
-
onClick: () => a({ key: o, value:
|
|
218
|
+
disabled: b(o) && b(c),
|
|
219
|
+
onClick: () => a({ key: o, value: c }),
|
|
220
220
|
children: "Save"
|
|
221
221
|
}
|
|
222
222
|
) })
|
|
223
223
|
] });
|
|
224
224
|
}, ut = ({ disabled: r, children: a, onAddBinding: t, appliedBindings: l, editMode: o = !0, item: n = {} }) => {
|
|
225
|
-
const [
|
|
225
|
+
const [c, p] = j(!1);
|
|
226
226
|
return /* @__PURE__ */ e.jsxs(pr, { children: [
|
|
227
227
|
/* @__PURE__ */ e.jsx(ur, { disabled: r, asChild: !0, onClick: () => p(!0), children: a }),
|
|
228
|
-
|
|
229
|
-
|
|
228
|
+
c && /* @__PURE__ */ e.jsx(gr, { children: /* @__PURE__ */ e.jsx(
|
|
229
|
+
os,
|
|
230
230
|
{
|
|
231
231
|
item: n,
|
|
232
232
|
editMode: o,
|
|
@@ -237,7 +237,7 @@ const we = ({ data: r, fullView: a }) => {
|
|
|
237
237
|
}
|
|
238
238
|
) })
|
|
239
239
|
] });
|
|
240
|
-
},
|
|
240
|
+
}, ls = ({
|
|
241
241
|
item: r,
|
|
242
242
|
onAddBinding: a,
|
|
243
243
|
onRemove: t,
|
|
@@ -245,41 +245,41 @@ const we = ({ data: r, fullView: a }) => {
|
|
|
245
245
|
dataProvider: o,
|
|
246
246
|
appliedBindings: n
|
|
247
247
|
}) => {
|
|
248
|
-
const [
|
|
249
|
-
if (b(
|
|
248
|
+
const [c, p] = j("string"), s = (d, u) => {
|
|
249
|
+
if (b(d))
|
|
250
250
|
return "";
|
|
251
251
|
{
|
|
252
|
-
const i = g(u === "PROP" ? l : o,
|
|
252
|
+
const i = g(u === "PROP" ? l : o, d, "");
|
|
253
253
|
if (pe(i))
|
|
254
254
|
return "list";
|
|
255
255
|
const h = typeof i;
|
|
256
256
|
return h === "string" ? "text" : h === "object" ? "model" : h;
|
|
257
257
|
}
|
|
258
258
|
};
|
|
259
|
-
return
|
|
259
|
+
return I(() => 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(je, { 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(ut, { editMode: !0, onAddBinding: a, appliedBindings: n, item: r, children: /* @__PURE__ */ e.jsx(
|
|
264
|
+
/* @__PURE__ */ e.jsx(ut, { editMode: !0, onAddBinding: a, appliedBindings: n, item: r, children: /* @__PURE__ */ e.jsx(Ir, { className: "mt-1 h-6 w-6 cursor-pointer rounded border border-blue-400 p-1 text-blue-400 duration-200 hover:scale-105 hover:bg-blue-400 hover:text-white" }) }),
|
|
265
265
|
/* @__PURE__ */ e.jsx(
|
|
266
|
-
|
|
266
|
+
Pr,
|
|
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
|
-
!b(
|
|
273
|
+
!b(c) && !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(c) })
|
|
274
274
|
] });
|
|
275
|
-
},
|
|
276
|
-
const t =
|
|
277
|
-
|
|
275
|
+
}, as = ({ bindingData: r, onChange: a }) => {
|
|
276
|
+
const t = M(), [l] = pt(), o = Or(), [n, c] = j(
|
|
277
|
+
R(r, (i, h) => ({ key: h, value: i }))
|
|
278
278
|
);
|
|
279
|
-
|
|
280
|
-
|
|
279
|
+
I(() => {
|
|
280
|
+
c(R(r, (i, h) => ({ key: h, value: i })));
|
|
281
281
|
}, [t == null ? void 0 : t._id, r]);
|
|
282
|
-
const p =
|
|
282
|
+
const p = T(() => {
|
|
283
283
|
if (b(l))
|
|
284
284
|
return !0;
|
|
285
285
|
if (b(n))
|
|
@@ -287,20 +287,20 @@ const we = ({ data: r, fullView: a }) => {
|
|
|
287
287
|
const i = kt(n);
|
|
288
288
|
return b(i == null ? void 0 : i.key) || b(i == null ? void 0 : i.value);
|
|
289
289
|
}, [l, n]), s = (i) => {
|
|
290
|
-
const h =
|
|
291
|
-
|
|
292
|
-
},
|
|
293
|
-
const h =
|
|
290
|
+
const h = Ve(n, (y) => y.key !== i.key);
|
|
291
|
+
c([...h, i]), u([...h, i]);
|
|
292
|
+
}, d = (i) => {
|
|
293
|
+
const h = Ve(n, (y, x) => i !== x);
|
|
294
294
|
u([...h]);
|
|
295
295
|
}, u = B(
|
|
296
296
|
(i = []) => {
|
|
297
|
-
if (
|
|
297
|
+
if (c(i), b(i)) {
|
|
298
298
|
a({});
|
|
299
299
|
return;
|
|
300
300
|
}
|
|
301
301
|
const h = {};
|
|
302
302
|
ke(i, (y) => {
|
|
303
|
-
!b(y == null ? void 0 : y.key) && !b(y == null ? void 0 : y.value) &&
|
|
303
|
+
!b(y == null ? void 0 : y.key) && !b(y == null ? void 0 : y.value) && Ue(h, y.key, y.value);
|
|
304
304
|
}), a(h);
|
|
305
305
|
},
|
|
306
306
|
[a]
|
|
@@ -310,15 +310,15 @@ const we = ({ data: r, fullView: a }) => {
|
|
|
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
|
+
R(n, (i, h) => /* @__PURE__ */ e.jsx(
|
|
314
|
+
ls,
|
|
315
315
|
{
|
|
316
316
|
item: i,
|
|
317
317
|
onAddBinding: s,
|
|
318
|
-
onRemove: () =>
|
|
318
|
+
onRemove: () => d(h),
|
|
319
319
|
selectedBlock: t,
|
|
320
320
|
dataProvider: l,
|
|
321
|
-
appliedBindings:
|
|
321
|
+
appliedBindings: R(n, "key")
|
|
322
322
|
},
|
|
323
323
|
i.key
|
|
324
324
|
)),
|
|
@@ -327,7 +327,7 @@ const we = ({ data: r, fullView: a }) => {
|
|
|
327
327
|
ut,
|
|
328
328
|
{
|
|
329
329
|
disabled: p,
|
|
330
|
-
appliedBindings:
|
|
330
|
+
appliedBindings: R(n, "key"),
|
|
331
331
|
onAddBinding: s,
|
|
332
332
|
children: /* @__PURE__ */ e.jsx(
|
|
333
333
|
"span",
|
|
@@ -341,13 +341,13 @@ const we = ({ data: r, fullView: a }) => {
|
|
|
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
|
+
}, ns = () => /* @__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" }), is = ({ id: r, placeholder: a }) => {
|
|
345
|
+
const { t } = E(), [, l] = xr(), o = M();
|
|
346
346
|
if (typeof window > "u")
|
|
347
347
|
return null;
|
|
348
|
-
const n = r.replace("root.", ""),
|
|
348
|
+
const n = r.replace("root.", ""), c = g(o, n, ""), p = () => {
|
|
349
349
|
const s = o == null ? void 0 : o._id;
|
|
350
|
-
l({ blockId: s, blockProp: n, placeholder: a, initialCode: g(o, n,
|
|
350
|
+
l({ blockId: s, blockProp: n, placeholder: a, initialCode: g(o, n, c) });
|
|
351
351
|
};
|
|
352
352
|
return /* @__PURE__ */ e.jsxs("div", { className: "mt-2 flex flex-col gap-y-1", children: [
|
|
353
353
|
/* @__PURE__ */ e.jsx(
|
|
@@ -355,39 +355,39 @@ const we = ({ data: r, fullView: a }) => {
|
|
|
355
355
|
{
|
|
356
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: c.trim().length > 0 ? c.substring(0, 46) : a || "Eg: <script>console.log('Hello, world!');<\/script>"
|
|
359
359
|
}
|
|
360
360
|
),
|
|
361
361
|
/* @__PURE__ */ e.jsx(P, { onClick: p, size: "sm", variant: "outline", className: "w-fit", children: t("Open code editor") })
|
|
362
362
|
] });
|
|
363
|
-
},
|
|
364
|
-
const [o, n] = j(t),
|
|
365
|
-
Object.keys(a).forEach((
|
|
366
|
-
const u = a[
|
|
367
|
-
if (
|
|
363
|
+
}, ze = ft(({ id: r, properties: a, formData: t, onChange: l }) => {
|
|
364
|
+
const [o, n] = j(t), c = { type: "object", properties: {} }, p = {};
|
|
365
|
+
Object.keys(a).forEach((d) => {
|
|
366
|
+
const u = a[d];
|
|
367
|
+
if (X(["slot", "styles"], u.type))
|
|
368
368
|
return;
|
|
369
|
-
const i =
|
|
370
|
-
|
|
371
|
-
}),
|
|
369
|
+
const i = d;
|
|
370
|
+
c.properties[i] = yr(u), p[i] = hr(u);
|
|
371
|
+
}), I(() => {
|
|
372
372
|
n(t);
|
|
373
373
|
}, [r]);
|
|
374
374
|
const s = ce(
|
|
375
|
-
async ({ formData:
|
|
376
|
-
l({ formData:
|
|
375
|
+
async ({ formData: d }, u) => {
|
|
376
|
+
l({ formData: d }, 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
|
+
Ur,
|
|
384
384
|
{
|
|
385
385
|
widgets: {
|
|
386
|
-
binding:
|
|
386
|
+
binding: ns,
|
|
387
387
|
richtext: mr,
|
|
388
388
|
icon: br,
|
|
389
389
|
image: fr,
|
|
390
|
-
code:
|
|
390
|
+
code: is
|
|
391
391
|
},
|
|
392
392
|
fields: { link: vr },
|
|
393
393
|
idSeparator: ".",
|
|
@@ -395,47 +395,50 @@ const we = ({ data: r, fullView: a }) => {
|
|
|
395
395
|
omitExtraData: !1,
|
|
396
396
|
liveOmit: !1,
|
|
397
397
|
liveValidate: !1,
|
|
398
|
-
validator:
|
|
398
|
+
validator: Kr,
|
|
399
399
|
uiSchema: p,
|
|
400
|
-
schema:
|
|
400
|
+
schema: c,
|
|
401
401
|
formData: o,
|
|
402
|
-
onChange: ({ formData:
|
|
403
|
-
u && (n(
|
|
402
|
+
onChange: ({ formData: d }, u) => {
|
|
403
|
+
u && (n(d), s({ formData: d }, u));
|
|
404
404
|
}
|
|
405
405
|
}
|
|
406
406
|
);
|
|
407
|
-
}),
|
|
408
|
-
const [r, a] =
|
|
409
|
-
|
|
410
|
-
};
|
|
411
|
-
if (b(t))
|
|
407
|
+
}), ds = () => {
|
|
408
|
+
const [r, a] = Gr(wr), t = M(), [, l] = _e(), { t: o } = E(), n = T(() => (t ? JSON.stringify(t) : "").includes('"x-show"'), [t]);
|
|
409
|
+
if (!t || !n)
|
|
412
410
|
return null;
|
|
413
|
-
const
|
|
414
|
-
return /* @__PURE__ */ e.jsxs("div", { className: "text-xs hover:no-underline", children: [
|
|
415
|
-
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-x-2 bg-gray-
|
|
416
|
-
t.
|
|
417
|
-
"
|
|
411
|
+
const c = r.includes(t._id);
|
|
412
|
+
return /* @__PURE__ */ e.jsxs("div", { className: "py-2 text-xs hover:no-underline", children: [
|
|
413
|
+
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-x-2 border-b border-border bg-gray-200 px-4 py-2 font-normal", children: [
|
|
414
|
+
t._name || t._type,
|
|
415
|
+
" ",
|
|
416
|
+
o("visibility settings")
|
|
418
417
|
] }),
|
|
419
|
-
/* @__PURE__ */ e.
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
418
|
+
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-2 px-2 pt-2", children: [
|
|
419
|
+
/* @__PURE__ */ e.jsx(
|
|
420
|
+
jr,
|
|
421
|
+
{
|
|
422
|
+
id: "show-on-canvas",
|
|
423
|
+
checked: c,
|
|
424
|
+
onCheckedChange: (p) => {
|
|
425
|
+
p ? (a((s) => [...s, t._id]), l([t._id])) : a((s) => s.filter((d) => d !== t._id));
|
|
426
|
+
}
|
|
427
|
+
}
|
|
428
|
+
),
|
|
429
|
+
/* @__PURE__ */ e.jsx(be, { htmlFor: "show-on-canvas", children: o("Show on canvas") })
|
|
430
|
+
] })
|
|
428
431
|
] });
|
|
429
432
|
};
|
|
430
|
-
function
|
|
431
|
-
const r =
|
|
433
|
+
function cs() {
|
|
434
|
+
const r = M(), a = rt(), t = st(), l = Te(r._type), o = { ...r }, [n, c] = j(o), p = ot("dataBindingSupport", !1), s = ({ formData: y }, x, v) => {
|
|
432
435
|
if (x && (n == null ? void 0 : n._id) === r._id) {
|
|
433
436
|
const k = x.replace("root.", "");
|
|
434
437
|
t([r._id], { [k]: g(y, k) }, v);
|
|
435
438
|
}
|
|
436
|
-
},
|
|
439
|
+
}, d = B(
|
|
437
440
|
Nt(({ formData: y }, x, v) => {
|
|
438
|
-
s({ formData: y }, x, v),
|
|
441
|
+
s({ formData: y }, x, v), c(y);
|
|
439
442
|
}, 1500),
|
|
440
443
|
[r == null ? void 0 : r._id]
|
|
441
444
|
), u = ({ formData: y }, x) => {
|
|
@@ -443,18 +446,17 @@ function ds() {
|
|
|
443
446
|
const v = x.replace("root.", "");
|
|
444
447
|
a(
|
|
445
448
|
[r._id],
|
|
446
|
-
|
|
447
|
-
),
|
|
449
|
+
Cr(v, g(y, v.split(".")))
|
|
450
|
+
), d({ formData: y }, x, { [v]: g(n, v) });
|
|
448
451
|
}
|
|
449
|
-
}, i = he(g(o, "_bindings", {})), h =
|
|
452
|
+
}, i = he(g(o, "_bindings", {})), h = T(() => {
|
|
450
453
|
const y = _t(g(l, "props", {}));
|
|
451
454
|
return p && St(i, (x) => delete y[x]), y;
|
|
452
455
|
}, [l, i, p]);
|
|
453
456
|
return /* @__PURE__ */ e.jsxs("div", { className: "overflow-x-hidden", children: [
|
|
454
|
-
/* @__PURE__ */ e.
|
|
455
|
-
|
|
456
|
-
|
|
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: [
|
|
457
|
+
p ? /* @__PURE__ */ e.jsxs(lt, { type: "multiple", defaultValue: ["STATIC", "BINDING"], className: "h-full w-full", children: [
|
|
458
|
+
/* @__PURE__ */ e.jsxs(fe, { value: "BINDING", children: [
|
|
459
|
+
/* @__PURE__ */ e.jsx(ve, { 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
460
|
/* @__PURE__ */ e.jsx(
|
|
459
461
|
"div",
|
|
460
462
|
{
|
|
@@ -463,8 +465,8 @@ function ds() {
|
|
|
463
465
|
),
|
|
464
466
|
"Data Binding"
|
|
465
467
|
] }) }),
|
|
466
|
-
/* @__PURE__ */ e.jsx(
|
|
467
|
-
|
|
468
|
+
/* @__PURE__ */ e.jsx(we, { className: "px-4 pt-4", children: /* @__PURE__ */ e.jsx(
|
|
469
|
+
as,
|
|
468
470
|
{
|
|
469
471
|
bindingData: g(r, "_bindings", {}),
|
|
470
472
|
onChange: (y) => {
|
|
@@ -473,21 +475,21 @@ function ds() {
|
|
|
473
475
|
}
|
|
474
476
|
) })
|
|
475
477
|
] }),
|
|
476
|
-
/* @__PURE__ */ e.jsxs(
|
|
477
|
-
/* @__PURE__ */ e.jsx(
|
|
478
|
+
/* @__PURE__ */ e.jsxs(fe, { value: "STATIC", children: [
|
|
479
|
+
/* @__PURE__ */ e.jsx(ve, { 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
480
|
/* @__PURE__ */ e.jsx("div", { className: "h-[8px] w-[8px] rounded-full bg-blue-500" }),
|
|
479
481
|
"Static Content"
|
|
480
482
|
] }) }),
|
|
481
|
-
/* @__PURE__ */ e.jsxs(
|
|
483
|
+
/* @__PURE__ */ e.jsxs(we, { className: "pt-4", children: [
|
|
482
484
|
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
485
|
"Data binding is set for ",
|
|
484
|
-
/* @__PURE__ */ e.jsx("b", { children:
|
|
486
|
+
/* @__PURE__ */ e.jsx("b", { children: R(i, me).join(", ") }),
|
|
485
487
|
" ",
|
|
486
488
|
i.length === 1 ? "property" : "properties",
|
|
487
489
|
". Remove data binding to edit static content."
|
|
488
490
|
] }),
|
|
489
491
|
/* @__PURE__ */ e.jsx(
|
|
490
|
-
|
|
492
|
+
ze,
|
|
491
493
|
{
|
|
492
494
|
id: r == null ? void 0 : r._id,
|
|
493
495
|
onChange: u,
|
|
@@ -498,38 +500,39 @@ function ds() {
|
|
|
498
500
|
] })
|
|
499
501
|
] })
|
|
500
502
|
] }) : /* @__PURE__ */ e.jsx(
|
|
501
|
-
|
|
503
|
+
ze,
|
|
502
504
|
{
|
|
503
505
|
id: r == null ? void 0 : r._id,
|
|
504
506
|
onChange: u,
|
|
505
507
|
formData: o,
|
|
506
508
|
properties: h
|
|
507
509
|
}
|
|
508
|
-
)
|
|
510
|
+
),
|
|
511
|
+
/* @__PURE__ */ e.jsx(ds, {})
|
|
509
512
|
] });
|
|
510
513
|
}
|
|
511
|
-
const
|
|
512
|
-
const { t: a } =
|
|
513
|
-
|
|
514
|
-
var
|
|
515
|
-
(
|
|
514
|
+
const ps = ({ blockId: r }) => {
|
|
515
|
+
const { t: a } = E(), { askAi: t, loading: l, error: o } = Fr(), [n, c] = j(""), p = ye(null);
|
|
516
|
+
I(() => {
|
|
517
|
+
var d;
|
|
518
|
+
(d = p.current) == null || d.focus();
|
|
516
519
|
}, []);
|
|
517
520
|
const s = () => {
|
|
518
|
-
o ||
|
|
521
|
+
o || c("");
|
|
519
522
|
};
|
|
520
523
|
return /* @__PURE__ */ e.jsxs("div", { className: "", children: [
|
|
521
524
|
/* @__PURE__ */ e.jsx("h2", { className: "mb-1 text-sm font-semibold leading-none tracking-tight", children: a("Ask AI") }),
|
|
522
525
|
/* @__PURE__ */ e.jsx(
|
|
523
|
-
|
|
526
|
+
at,
|
|
524
527
|
{
|
|
525
528
|
ref: p,
|
|
526
529
|
value: n,
|
|
527
|
-
onChange: (
|
|
530
|
+
onChange: (d) => c(d.target.value),
|
|
528
531
|
placeholder: a("Ask AI to edit styles"),
|
|
529
532
|
className: "w-full border border-gray-400 focus:border-0",
|
|
530
533
|
rows: 3,
|
|
531
|
-
onKeyDown: (
|
|
532
|
-
|
|
534
|
+
onKeyDown: (d) => {
|
|
535
|
+
d.key === "Enter" && (d.preventDefault(), t("styles", r, n, s));
|
|
533
536
|
}
|
|
534
537
|
}
|
|
535
538
|
),
|
|
@@ -543,14 +546,14 @@ const cs = ({ blockId: r }) => {
|
|
|
543
546
|
className: "w-fit",
|
|
544
547
|
size: "sm",
|
|
545
548
|
children: l ? /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
546
|
-
/* @__PURE__ */ e.jsx(
|
|
549
|
+
/* @__PURE__ */ e.jsx($r, { className: "w-5 h-5 animate-spin" }),
|
|
547
550
|
a("Generating... Please wait")
|
|
548
551
|
] }) : a("Edit with AI")
|
|
549
552
|
}
|
|
550
553
|
),
|
|
551
554
|
l ? /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col gap-2", children: [
|
|
552
555
|
/* @__PURE__ */ e.jsxs(kr, { className: "flex items-center w-full px-4 py-1 pl-2 space-x-1", children: [
|
|
553
|
-
/* @__PURE__ */ e.jsx(
|
|
556
|
+
/* @__PURE__ */ e.jsx(Xr, { className: "w-4 h-4 text-gray-500 animate-spin" }),
|
|
554
557
|
/* @__PURE__ */ e.jsx("p", { className: "text-xs", children: a("Generating... Please wait") })
|
|
555
558
|
] }),
|
|
556
559
|
/* @__PURE__ */ e.jsx(P, { variant: "destructive", onClick: () => stop(), className: "hidden w-fit", size: "sm", children: a("Stop") })
|
|
@@ -558,7 +561,7 @@ const cs = ({ blockId: r }) => {
|
|
|
558
561
|
] }),
|
|
559
562
|
/* @__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
563
|
] });
|
|
561
|
-
},
|
|
564
|
+
}, Fe = new Jr(Qr, {
|
|
562
565
|
isCaseSensitive: !1,
|
|
563
566
|
threshold: 0.2,
|
|
564
567
|
minMatchCharLength: 2,
|
|
@@ -566,7 +569,7 @@ const cs = ({ blockId: r }) => {
|
|
|
566
569
|
});
|
|
567
570
|
function gt() {
|
|
568
571
|
var N;
|
|
569
|
-
const { t: r } =
|
|
572
|
+
const { t: r } = E(), [a] = le(), t = M(), l = Se(), o = nt(), [n] = _e(), c = ot("askAiCallBack", null), [p, s] = j(""), { toast: d } = Nr(), u = (N = oe(a)) == null ? void 0 : N.prop, i = Tt((g(t, u, "").replace(ts, "").split(",").pop() || "").split(" "), b), h = () => {
|
|
570
573
|
const C = p.trim().toLowerCase().replace(/ +(?= )/g, "").split(" ");
|
|
571
574
|
l(n, C, !0), s("");
|
|
572
575
|
}, [y, x] = j([]), v = ({ value: C }) => {
|
|
@@ -574,16 +577,16 @@ function gt() {
|
|
|
574
577
|
let m = [];
|
|
575
578
|
if (W && W.length > 0) {
|
|
576
579
|
const [f] = W, S = V.replace(f, "");
|
|
577
|
-
m =
|
|
578
|
-
...
|
|
579
|
-
item: { ...
|
|
580
|
+
m = Fe.search(S).map((z) => ({
|
|
581
|
+
...z,
|
|
582
|
+
item: { ...z.item, name: f + z.item.name }
|
|
580
583
|
}));
|
|
581
584
|
} else
|
|
582
|
-
m =
|
|
583
|
-
return x(
|
|
585
|
+
m = Fe.search(V);
|
|
586
|
+
return x(R(m, "item"));
|
|
584
587
|
}, k = () => {
|
|
585
588
|
x([]);
|
|
586
|
-
},
|
|
589
|
+
}, L = (C) => C.name, A = (C) => /* @__PURE__ */ e.jsx("div", { className: "rounded-md p-1", children: C.name }), Z = {
|
|
587
590
|
autoComplete: "off",
|
|
588
591
|
autoCorrect: "off",
|
|
589
592
|
autoCapitalize: "off",
|
|
@@ -597,14 +600,14 @@ function gt() {
|
|
|
597
600
|
className: "w-full rounded-md text-xs px-2 hover:outline-0 bg-background border-border py-1"
|
|
598
601
|
}, w = () => {
|
|
599
602
|
if (navigator.clipboard === void 0) {
|
|
600
|
-
|
|
603
|
+
d({
|
|
601
604
|
title: "Clipboard not supported",
|
|
602
605
|
description: "Please use Chrome, Firefox or Safari",
|
|
603
606
|
variant: "destructive"
|
|
604
607
|
});
|
|
605
608
|
return;
|
|
606
609
|
}
|
|
607
|
-
navigator.clipboard.writeText(i.join(" ")),
|
|
610
|
+
navigator.clipboard.writeText(i.join(" ")), d({
|
|
608
611
|
title: "Copied",
|
|
609
612
|
description: "Classes copied to clipboard"
|
|
610
613
|
});
|
|
@@ -618,27 +621,27 @@ function gt() {
|
|
|
618
621
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-x-2", children: [
|
|
619
622
|
/* @__PURE__ */ e.jsx("span", { children: r("Classes") }),
|
|
620
623
|
/* @__PURE__ */ e.jsxs(U, { children: [
|
|
621
|
-
/* @__PURE__ */ e.jsx(K, { asChild: !0, children: /* @__PURE__ */ e.jsx(
|
|
624
|
+
/* @__PURE__ */ e.jsx(K, { asChild: !0, children: /* @__PURE__ */ e.jsx(At, { onClick: w, className: "cursor-pointer" }) }),
|
|
622
625
|
/* @__PURE__ */ e.jsx(G, { children: /* @__PURE__ */ e.jsx("p", { children: r("Copy classes to clipboard") }) })
|
|
623
626
|
] })
|
|
624
627
|
] }),
|
|
625
|
-
|
|
628
|
+
c ? /* @__PURE__ */ e.jsxs(Qe, { children: [
|
|
626
629
|
/* @__PURE__ */ e.jsx(et, { children: /* @__PURE__ */ e.jsxs(P, { variant: "default", className: "h-6 w-fit", size: "sm", children: [
|
|
627
|
-
/* @__PURE__ */ e.jsx(
|
|
630
|
+
/* @__PURE__ */ e.jsx(Er, { className: "h-4 w-4" }),
|
|
628
631
|
/* @__PURE__ */ e.jsx("span", { className: "ml-2", children: r("Ask AI") })
|
|
629
632
|
] }) }),
|
|
630
|
-
/* @__PURE__ */ e.jsx(tt, { side: "left", className: "p-2", children: /* @__PURE__ */ e.jsx(
|
|
633
|
+
/* @__PURE__ */ e.jsx(tt, { side: "left", className: "p-2", children: /* @__PURE__ */ e.jsx(ps, { blockId: t == null ? void 0 : t._id }) })
|
|
631
634
|
] }) : null
|
|
632
635
|
] }),
|
|
633
636
|
/* @__PURE__ */ e.jsxs("div", { className: "relative flex items-center gap-x-3", children: [
|
|
634
637
|
/* @__PURE__ */ e.jsx("div", { className: "relative flex w-full items-center gap-x-3", children: /* @__PURE__ */ e.jsx(
|
|
635
|
-
|
|
638
|
+
qr,
|
|
636
639
|
{
|
|
637
640
|
suggestions: y,
|
|
638
641
|
onSuggestionsFetchRequested: v,
|
|
639
642
|
onSuggestionsClearRequested: k,
|
|
640
|
-
getSuggestionValue:
|
|
641
|
-
renderSuggestion:
|
|
643
|
+
getSuggestionValue: L,
|
|
644
|
+
renderSuggestion: A,
|
|
642
645
|
inputProps: Z,
|
|
643
646
|
containerProps: {
|
|
644
647
|
className: "relative h-8 w-full gap-y-1 py-1 border-gray-600"
|
|
@@ -658,7 +661,7 @@ function gt() {
|
|
|
658
661
|
onClick: h,
|
|
659
662
|
disabled: p.trim() === "",
|
|
660
663
|
size: "sm",
|
|
661
|
-
children: /* @__PURE__ */ e.jsx(
|
|
664
|
+
children: /* @__PURE__ */ e.jsx(Ge, {})
|
|
662
665
|
}
|
|
663
666
|
)
|
|
664
667
|
] }),
|
|
@@ -670,7 +673,7 @@ function gt() {
|
|
|
670
673
|
children: [
|
|
671
674
|
C,
|
|
672
675
|
/* @__PURE__ */ e.jsx(
|
|
673
|
-
|
|
676
|
+
qe,
|
|
674
677
|
{
|
|
675
678
|
onClick: () => o(n, [C]),
|
|
676
679
|
className: "invisible absolute right-1 rounded-full bg-red-400 hover:text-white group-hover:visible group-hover:cursor-pointer"
|
|
@@ -685,11 +688,11 @@ function gt() {
|
|
|
685
688
|
}
|
|
686
689
|
);
|
|
687
690
|
}
|
|
688
|
-
const
|
|
689
|
-
const [l, o] = j([]), [n,
|
|
690
|
-
|
|
691
|
+
const us = $.memo(function({ preloadedAttributes: a = [], onAttributesChange: t }) {
|
|
692
|
+
const [l, o] = j([]), [n, c] = j(""), [p, s] = j(""), [d, u] = j(null), [i, h] = j(""), y = ye(null), x = ye(null);
|
|
693
|
+
I(() => {
|
|
691
694
|
y.current && y.current.focus();
|
|
692
|
-
}, [l]),
|
|
695
|
+
}, [l]), I(() => {
|
|
693
696
|
o(a);
|
|
694
697
|
}, [a]);
|
|
695
698
|
const v = () => {
|
|
@@ -699,54 +702,60 @@ const ps = $.memo(function({ preloadedAttributes: a = [], onAttributesChange: t
|
|
|
699
702
|
}
|
|
700
703
|
if (n) {
|
|
701
704
|
const w = [...l, { key: n, value: p }];
|
|
702
|
-
t(w), o(l),
|
|
705
|
+
t(w), o(l), c(""), s(""), h("");
|
|
703
706
|
}
|
|
704
707
|
}, k = (w) => {
|
|
705
708
|
const N = l.filter((C, V) => V !== w);
|
|
706
709
|
t(N), o(N);
|
|
707
|
-
},
|
|
708
|
-
u(w),
|
|
709
|
-
},
|
|
710
|
+
}, L = (w) => {
|
|
711
|
+
u(w), c(l[w].key), s(l[w].value);
|
|
712
|
+
}, A = () => {
|
|
710
713
|
if (n.startsWith("@")) {
|
|
711
714
|
h("Attribute keys cannot start with '@'");
|
|
712
715
|
return;
|
|
713
716
|
}
|
|
714
|
-
if (
|
|
717
|
+
if (d !== null && n) {
|
|
715
718
|
const w = [...l];
|
|
716
|
-
w[
|
|
719
|
+
w[d] = { key: n, value: p }, t(w), o(w), u(null), c(""), s(""), h("");
|
|
717
720
|
}
|
|
718
721
|
}, Z = (w) => {
|
|
719
|
-
w.key === "Enter" && !w.shiftKey && (w.preventDefault(),
|
|
722
|
+
w.key === "Enter" && !w.shiftKey && (w.preventDefault(), d !== null ? A() : v());
|
|
720
723
|
};
|
|
721
724
|
return /* @__PURE__ */ e.jsxs("div", { className: "px-1", children: [
|
|
722
725
|
/* @__PURE__ */ e.jsxs(
|
|
723
726
|
"form",
|
|
724
727
|
{
|
|
725
728
|
onSubmit: (w) => {
|
|
726
|
-
w.preventDefault(),
|
|
729
|
+
w.preventDefault(), d !== null ? A() : v();
|
|
727
730
|
},
|
|
728
731
|
className: "space-y-3",
|
|
729
732
|
children: [
|
|
730
733
|
/* @__PURE__ */ e.jsxs("div", { className: "flex flex-col", children: [
|
|
731
734
|
/* @__PURE__ */ e.jsxs("div", { className: "w-full", children: [
|
|
732
|
-
/* @__PURE__ */ e.jsx(
|
|
735
|
+
/* @__PURE__ */ e.jsx(be, { htmlFor: "attrKey", className: "text-xs", children: "Key" }),
|
|
733
736
|
/* @__PURE__ */ e.jsx(
|
|
734
|
-
|
|
737
|
+
it,
|
|
735
738
|
{
|
|
739
|
+
autoCapitalize: "off",
|
|
740
|
+
autoCorrect: "off",
|
|
741
|
+
spellCheck: "false",
|
|
736
742
|
id: "attrKey",
|
|
737
743
|
ref: y,
|
|
738
744
|
value: n,
|
|
739
|
-
onChange: (w) =>
|
|
745
|
+
onChange: (w) => c(w.target.value),
|
|
740
746
|
placeholder: "Key",
|
|
741
747
|
className: "h-8 text-sm"
|
|
742
748
|
}
|
|
743
749
|
)
|
|
744
750
|
] }),
|
|
745
751
|
/* @__PURE__ */ e.jsxs("div", { className: "w-full", children: [
|
|
746
|
-
/* @__PURE__ */ e.jsx(
|
|
752
|
+
/* @__PURE__ */ e.jsx(be, { htmlFor: "attrValue", className: "text-xs", children: "Value" }),
|
|
747
753
|
/* @__PURE__ */ e.jsx(
|
|
748
|
-
|
|
754
|
+
at,
|
|
749
755
|
{
|
|
756
|
+
autoCapitalize: "off",
|
|
757
|
+
autoCorrect: "off",
|
|
758
|
+
spellCheck: "false",
|
|
750
759
|
id: "attrValue",
|
|
751
760
|
rows: 2,
|
|
752
761
|
ref: x,
|
|
@@ -759,7 +768,7 @@ const ps = $.memo(function({ preloadedAttributes: a = [], onAttributesChange: t
|
|
|
759
768
|
)
|
|
760
769
|
] })
|
|
761
770
|
] }),
|
|
762
|
-
/* @__PURE__ */ e.jsx(P, { type: "submit", className: "h-8 w-full text-sm", children:
|
|
771
|
+
/* @__PURE__ */ e.jsx(P, { type: "submit", className: "h-8 w-full text-sm", children: d !== null ? "Save" : "Add" }),
|
|
763
772
|
i && /* @__PURE__ */ e.jsx("p", { className: "text-xs text-red-500", children: i })
|
|
764
773
|
]
|
|
765
774
|
}
|
|
@@ -767,37 +776,37 @@ const ps = $.memo(function({ preloadedAttributes: a = [], onAttributesChange: t
|
|
|
767
776
|
/* @__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
777
|
/* @__PURE__ */ e.jsxs("div", { className: "mr-2 flex flex-col", children: [
|
|
769
778
|
/* @__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 })
|
|
779
|
+
/* @__PURE__ */ e.jsx("span", { className: "text-wrap max-w-[200px] text-muted-foreground", children: w.value.toString() })
|
|
771
780
|
] }),
|
|
772
781
|
/* @__PURE__ */ e.jsxs("div", { className: "flex-shrink-0", children: [
|
|
773
|
-
/* @__PURE__ */ e.jsxs(P, { variant: "ghost", size: "icon", className: "h-6 w-6", onClick: () =>
|
|
774
|
-
/* @__PURE__ */ e.jsx(
|
|
782
|
+
/* @__PURE__ */ e.jsxs(P, { variant: "ghost", size: "icon", className: "h-6 w-6", onClick: () => L(N), children: [
|
|
783
|
+
/* @__PURE__ */ e.jsx(Mr, { className: "h-3 w-3" }),
|
|
775
784
|
/* @__PURE__ */ e.jsx("span", { className: "sr-only", children: "Edit attribute" })
|
|
776
785
|
] }),
|
|
777
786
|
/* @__PURE__ */ e.jsxs(P, { variant: "ghost", size: "icon", className: "h-6 w-6", onClick: () => k(N), children: [
|
|
778
|
-
/* @__PURE__ */ e.jsx(
|
|
787
|
+
/* @__PURE__ */ e.jsx(Lr, { className: "h-3 w-3" }),
|
|
779
788
|
/* @__PURE__ */ e.jsx("span", { className: "sr-only", children: "Remove attribute" })
|
|
780
789
|
] })
|
|
781
790
|
] })
|
|
782
791
|
] }, N)) })
|
|
783
792
|
] });
|
|
784
|
-
}),
|
|
785
|
-
const r =
|
|
793
|
+
}), gs = ie.memo(() => {
|
|
794
|
+
const r = M(), [a, t] = j([]), [l] = le(), o = rt(), n = st(), c = `${g(l, "0.prop")}_attrs`;
|
|
786
795
|
ie.useEffect(() => {
|
|
787
|
-
const s =
|
|
796
|
+
const s = R(g(r, c), (d, u) => ({ key: u, value: d }));
|
|
788
797
|
b(s) ? t([]) : t(s);
|
|
789
|
-
}, [g(r,
|
|
798
|
+
}, [g(r, c)]);
|
|
790
799
|
const p = ie.useCallback(
|
|
791
800
|
(s = []) => {
|
|
792
|
-
const
|
|
801
|
+
const d = {};
|
|
793
802
|
ke(s, (u) => {
|
|
794
|
-
b(u.key) ||
|
|
795
|
-
}), n([g(r, "_id")], { [
|
|
803
|
+
b(u.key) || Ue(d, u.key, u.value);
|
|
804
|
+
}), n([g(r, "_id")], { [c]: d });
|
|
796
805
|
},
|
|
797
|
-
[r, o,
|
|
806
|
+
[r, o, c]
|
|
798
807
|
);
|
|
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(
|
|
800
|
-
}), _ = ["px", "%", "em", "rem", "ch", "vh", "vw"],
|
|
808
|
+
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(us, { preloadedAttributes: a, onAttributesChange: p }) }) }) });
|
|
809
|
+
}), _ = ["px", "%", "em", "rem", "ch", "vh", "vw"], xs = {
|
|
801
810
|
heading: "flex.heading",
|
|
802
811
|
items: [
|
|
803
812
|
{ type: "arbitrary", label: "flex.basis", units: _, property: "flexBasis" },
|
|
@@ -806,7 +815,7 @@ const ps = $.memo(function({ preloadedAttributes: a = [], onAttributesChange: t
|
|
|
806
815
|
{ type: "dropdown", label: "flex.grow", property: "flexGrow" },
|
|
807
816
|
{ type: "dropdown", label: "flex.shrink", property: "flexShrink" }
|
|
808
817
|
]
|
|
809
|
-
},
|
|
818
|
+
}, ys = {
|
|
810
819
|
heading: "grid.heading",
|
|
811
820
|
items: [
|
|
812
821
|
{ type: "range", label: "grid.col_span", property: "gridColSpan" },
|
|
@@ -817,7 +826,7 @@ const ps = $.memo(function({ preloadedAttributes: a = [], onAttributesChange: t
|
|
|
817
826
|
{ type: "range", label: "grid.row_end", property: "gridRowEnd" },
|
|
818
827
|
{ type: "range", label: "grid.order", property: "order" }
|
|
819
828
|
]
|
|
820
|
-
},
|
|
829
|
+
}, hs = [
|
|
821
830
|
{
|
|
822
831
|
heading: "Styles",
|
|
823
832
|
items: [
|
|
@@ -881,9 +890,9 @@ const ps = $.memo(function({ preloadedAttributes: a = [], onAttributesChange: t
|
|
|
881
890
|
},
|
|
882
891
|
{
|
|
883
892
|
heading: "Attributes",
|
|
884
|
-
items: [{ component:
|
|
893
|
+
items: [{ component: gs }]
|
|
885
894
|
}
|
|
886
|
-
],
|
|
895
|
+
], Po = [
|
|
887
896
|
{
|
|
888
897
|
heading: "layout.heading",
|
|
889
898
|
items: [
|
|
@@ -1290,36 +1299,36 @@ const ps = $.memo(function({ preloadedAttributes: a = [], onAttributesChange: t
|
|
|
1290
1299
|
], xt = {
|
|
1291
1300
|
"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" }) }),
|
|
1292
1301
|
// visibility
|
|
1293
|
-
visible:
|
|
1294
|
-
invisible:
|
|
1302
|
+
visible: It,
|
|
1303
|
+
invisible: Be,
|
|
1295
1304
|
// display
|
|
1296
|
-
hidden:
|
|
1297
|
-
gap:
|
|
1305
|
+
hidden: Be,
|
|
1306
|
+
gap: F,
|
|
1298
1307
|
gapX: H,
|
|
1299
1308
|
gapY: D,
|
|
1300
1309
|
spaceX: H,
|
|
1301
1310
|
spaceY: D,
|
|
1302
|
-
overscroll:
|
|
1311
|
+
overscroll: F,
|
|
1303
1312
|
overscrollX: H,
|
|
1304
1313
|
overscrollY: D,
|
|
1305
|
-
overflow:
|
|
1314
|
+
overflow: F,
|
|
1306
1315
|
overflowX: H,
|
|
1307
1316
|
overflowY: D,
|
|
1308
1317
|
top: J,
|
|
1309
1318
|
right: Q,
|
|
1310
1319
|
bottom: ee,
|
|
1311
1320
|
left: te,
|
|
1312
|
-
inset:
|
|
1321
|
+
inset: F,
|
|
1313
1322
|
insetX: H,
|
|
1314
1323
|
insetY: D,
|
|
1315
|
-
border:
|
|
1324
|
+
border: F,
|
|
1316
1325
|
borderX: H,
|
|
1317
1326
|
borderY: D,
|
|
1318
1327
|
borderTop: J,
|
|
1319
1328
|
borderRight: Q,
|
|
1320
1329
|
borderBottom: ee,
|
|
1321
1330
|
borderLeft: te,
|
|
1322
|
-
borderRadius:
|
|
1331
|
+
borderRadius: F,
|
|
1323
1332
|
borderRadiusX: H,
|
|
1324
1333
|
borderRadiusY: D,
|
|
1325
1334
|
borderRadiusTop: J,
|
|
@@ -1332,7 +1341,7 @@ const ps = $.memo(function({ preloadedAttributes: a = [], onAttributesChange: t
|
|
|
1332
1341
|
borderRadiusBottomLeft: Mt,
|
|
1333
1342
|
divideXWidth: H,
|
|
1334
1343
|
divideYWidth: D,
|
|
1335
|
-
scale:
|
|
1344
|
+
scale: F,
|
|
1336
1345
|
scaleX: H,
|
|
1337
1346
|
scaleY: D,
|
|
1338
1347
|
skewX: H,
|
|
@@ -1340,7 +1349,7 @@ const ps = $.memo(function({ preloadedAttributes: a = [], onAttributesChange: t
|
|
|
1340
1349
|
translateX: H,
|
|
1341
1350
|
translateY: D,
|
|
1342
1351
|
// padding
|
|
1343
|
-
padding:
|
|
1352
|
+
padding: F,
|
|
1344
1353
|
paddingX: H,
|
|
1345
1354
|
paddingY: D,
|
|
1346
1355
|
paddingTop: J,
|
|
@@ -1348,7 +1357,7 @@ const ps = $.memo(function({ preloadedAttributes: a = [], onAttributesChange: t
|
|
|
1348
1357
|
paddingBottom: ee,
|
|
1349
1358
|
paddingLeft: te,
|
|
1350
1359
|
// margin
|
|
1351
|
-
margin:
|
|
1360
|
+
margin: F,
|
|
1352
1361
|
marginX: H,
|
|
1353
1362
|
marginY: D,
|
|
1354
1363
|
marginTop: J,
|
|
@@ -1359,12 +1368,12 @@ const ps = $.memo(function({ preloadedAttributes: a = [], onAttributesChange: t
|
|
|
1359
1368
|
textLeft: Lt,
|
|
1360
1369
|
textCenter: Ot,
|
|
1361
1370
|
textRight: zt,
|
|
1362
|
-
textJustify:
|
|
1371
|
+
textJustify: Ft,
|
|
1363
1372
|
// font style
|
|
1364
|
-
italic:
|
|
1373
|
+
italic: Xt,
|
|
1365
1374
|
// "not-italic": "",
|
|
1366
1375
|
// decoration
|
|
1367
|
-
underline:
|
|
1376
|
+
underline: Yt,
|
|
1368
1377
|
overline: Zt,
|
|
1369
1378
|
// transform
|
|
1370
1379
|
uppercase: Wt,
|
|
@@ -1408,7 +1417,7 @@ const ps = $.memo(function({ preloadedAttributes: a = [], onAttributesChange: t
|
|
|
1408
1417
|
}
|
|
1409
1418
|
)
|
|
1410
1419
|
] }),
|
|
1411
|
-
"float-none":
|
|
1420
|
+
"float-none": qe,
|
|
1412
1421
|
// position
|
|
1413
1422
|
fixed: () => /* @__PURE__ */ e.jsxs("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [
|
|
1414
1423
|
/* @__PURE__ */ e.jsx(
|
|
@@ -1481,13 +1490,13 @@ const ps = $.memo(function({ preloadedAttributes: a = [], onAttributesChange: t
|
|
|
1481
1490
|
)
|
|
1482
1491
|
] }),
|
|
1483
1492
|
static: Ut
|
|
1484
|
-
}, ae =
|
|
1493
|
+
}, ae = We({ canReset: !1, canChange: !0 }), ms = ({ children: r, canReset: a = !1, canChange: t = !0 }) => (
|
|
1485
1494
|
// eslint-disable-next-line react/jsx-no-constructed-context-values
|
|
1486
1495
|
/* @__PURE__ */ e.jsx(ae.Provider, { value: { canReset: a, canChange: t }, children: r })
|
|
1487
1496
|
), yt = ({ label: r, property: a, onChange: t }) => {
|
|
1488
|
-
const l =
|
|
1497
|
+
const l = T(() => g(ge, `${a}.classes`, [""]), [a]), o = ne(a), n = T(() => g(o, "cls", ""), [o]), { canChange: c } = se(ae), p = /\[.*\]/g.test(n);
|
|
1489
1498
|
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(
|
|
1499
|
+
/* @__PURE__ */ e.jsx(it, { className: "w-[70%] rounded py-1", readOnly: !0, value: n }),
|
|
1491
1500
|
/* @__PURE__ */ e.jsxs(U, { delayDuration: 100, children: [
|
|
1492
1501
|
/* @__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
1502
|
/* @__PURE__ */ e.jsx(G, { children: "Current value is using a Tailwind arbitrary value." })
|
|
@@ -1499,12 +1508,12 @@ const ps = $.memo(function({ preloadedAttributes: a = [], onAttributesChange: t
|
|
|
1499
1508
|
onChange: (s) => t(s, a),
|
|
1500
1509
|
selected: n,
|
|
1501
1510
|
options: l,
|
|
1502
|
-
disabled: !
|
|
1511
|
+
disabled: !c
|
|
1503
1512
|
}
|
|
1504
1513
|
) });
|
|
1505
1514
|
};
|
|
1506
1515
|
function Ce({ selected: r, onChange: a, rounded: t = !1, options: l, disabled: o = !1 }) {
|
|
1507
|
-
const n = r.replace(/.*:/g, "").trim(), { undo:
|
|
1516
|
+
const n = r.replace(/.*:/g, "").trim(), { undo: c, redo: p } = _r();
|
|
1508
1517
|
return /* @__PURE__ */ e.jsxs(
|
|
1509
1518
|
"select",
|
|
1510
1519
|
{
|
|
@@ -1512,7 +1521,7 @@ function Ce({ selected: r, onChange: a, rounded: t = !1, options: l, disabled: o
|
|
|
1512
1521
|
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`,
|
|
1513
1522
|
onChange: (s) => a(s.target.value),
|
|
1514
1523
|
onKeyDown: (s) => {
|
|
1515
|
-
s.ctrlKey && (s.key === "z" &&
|
|
1524
|
+
s.ctrlKey && (s.key === "z" && c(), s.key === "y" && p());
|
|
1516
1525
|
},
|
|
1517
1526
|
value: n,
|
|
1518
1527
|
children: [
|
|
@@ -1524,8 +1533,8 @@ function Ce({ selected: r, onChange: a, rounded: t = !1, options: l, disabled: o
|
|
|
1524
1533
|
}
|
|
1525
1534
|
);
|
|
1526
1535
|
}
|
|
1527
|
-
const
|
|
1528
|
-
const { canReset: t, canChange: l } = se(ae), o = ne(r), n =
|
|
1536
|
+
const bs = ({ property: r, onChange: a }) => {
|
|
1537
|
+
const { canReset: t, canChange: l } = se(ae), o = ne(r), n = T(() => g(o, "cls", ""), [o]), c = T(() => g(ge, `${r}.classes`, [""]), [r]), p = c.indexOf(n) > -1 ? c.indexOf(n) : 0, s = /\[.*\]/g.test(n);
|
|
1529
1538
|
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: [
|
|
1530
1539
|
/* @__PURE__ */ e.jsx(
|
|
1531
1540
|
"button",
|
|
@@ -1533,7 +1542,7 @@ const ms = ({ property: r, onChange: a }) => {
|
|
|
1533
1542
|
type: "button",
|
|
1534
1543
|
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",
|
|
1535
1544
|
disabled: !l && (!t || p - 1 < 0),
|
|
1536
|
-
onClick: () => a(
|
|
1545
|
+
onClick: () => a(He(c, p - 1), r),
|
|
1537
1546
|
children: /* @__PURE__ */ e.jsx("span", { className: "flex items-center justify-center", children: /* @__PURE__ */ e.jsx(
|
|
1538
1547
|
Kt,
|
|
1539
1548
|
{
|
|
@@ -1548,33 +1557,33 @@ const ms = ({ property: r, onChange: a }) => {
|
|
|
1548
1557
|
{
|
|
1549
1558
|
type: "button",
|
|
1550
1559
|
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",
|
|
1551
|
-
disabled: !l && (!t || p + 1 >=
|
|
1552
|
-
onClick: () => a(
|
|
1560
|
+
disabled: !l && (!t || p + 1 >= c.length),
|
|
1561
|
+
onClick: () => a(He(c, p + 1), r),
|
|
1553
1562
|
children: /* @__PURE__ */ e.jsx("span", { className: "flex items-center justify-center", children: /* @__PURE__ */ e.jsx(
|
|
1554
|
-
|
|
1563
|
+
Ge,
|
|
1555
1564
|
{
|
|
1556
|
-
className: !l && (!t || p + 1 >=
|
|
1565
|
+
className: !l && (!t || p + 1 >= c.length) ? "text-gray-500" : "text-black/60 dark:text-white/60"
|
|
1557
1566
|
}
|
|
1558
1567
|
) })
|
|
1559
1568
|
}
|
|
1560
1569
|
)
|
|
1561
1570
|
] }) });
|
|
1562
|
-
},
|
|
1563
|
-
const t =
|
|
1564
|
-
return /* @__PURE__ */ e.jsx("div", { className: "flex grow flex-wrap gap-1", children:
|
|
1571
|
+
}, fs = ({ property: r, onChange: a }) => {
|
|
1572
|
+
const t = T(() => g(ge, `${r}.classes`, [""]), [r]), { canChange: l } = se(ae), o = ne(r), n = T(() => g(o, "cls", ""), [o]);
|
|
1573
|
+
return /* @__PURE__ */ e.jsx("div", { className: "flex grow flex-wrap gap-1", children: R(t, (c) => /* @__PURE__ */ e.jsxs(U, { children: [
|
|
1565
1574
|
/* @__PURE__ */ e.jsx(K, { asChild: !0, children: /* @__PURE__ */ e.jsx(
|
|
1566
1575
|
"button",
|
|
1567
1576
|
{
|
|
1568
1577
|
type: "button",
|
|
1569
1578
|
disabled: !l,
|
|
1570
|
-
onClick: () => a(
|
|
1571
|
-
className: `cursor-pointer rounded border border-gray-600 p-1 disabled:cursor-not-allowed ${n ===
|
|
1572
|
-
children: $.createElement(g(xt,
|
|
1579
|
+
onClick: () => a(c, r),
|
|
1580
|
+
className: `cursor-pointer rounded border border-gray-600 p-1 disabled:cursor-not-allowed ${n === c ? " bg-blue-500 text-white" : "disabled:bg-gray-600 disabled:text-gray-400"}`,
|
|
1581
|
+
children: $.createElement(g(xt, c, Je))
|
|
1573
1582
|
}
|
|
1574
1583
|
) }),
|
|
1575
|
-
/* @__PURE__ */ e.jsx(G, { children: Y(re(
|
|
1584
|
+
/* @__PURE__ */ e.jsx(G, { children: Y(re(c)) })
|
|
1576
1585
|
] })) });
|
|
1577
|
-
},
|
|
1586
|
+
}, vs = {
|
|
1578
1587
|
backgroundColor: "bg",
|
|
1579
1588
|
textColor: "text",
|
|
1580
1589
|
borderColor: "border",
|
|
@@ -1586,18 +1595,18 @@ const ms = ({ property: r, onChange: a }) => {
|
|
|
1586
1595
|
toColor: "to",
|
|
1587
1596
|
ringColor: "ring",
|
|
1588
1597
|
ringOffsetColor: "ring-offset"
|
|
1589
|
-
},
|
|
1590
|
-
const t = ne(r), l =
|
|
1598
|
+
}, ws = ({ property: r, onChange: a }) => {
|
|
1599
|
+
const t = ne(r), l = T(() => g(t, "cls", ""), [t]), { canChange: o } = se(ae), [n, c] = j([]), [p, s] = j({ color: "", shade: "" }), d = l.split("-"), u = g(d, "1", ""), i = g(d, "2", ""), h = B(
|
|
1591
1600
|
// eslint-disable-next-line no-shadow
|
|
1592
1601
|
(x) => {
|
|
1593
|
-
["current", "inherit", "transparent", "black", "white"].includes(x) ? (
|
|
1602
|
+
["current", "inherit", "transparent", "black", "white"].includes(x) ? (c([]), s({ color: x })) : (c(["50", "100", "200", "300", "400", "500", "600", "700", "800", "900"]), s((v) => ({ ...v, color: x, shade: v.shade ? v.shade : "500" })));
|
|
1594
1603
|
},
|
|
1595
|
-
[
|
|
1604
|
+
[c, s]
|
|
1596
1605
|
);
|
|
1597
|
-
|
|
1606
|
+
I(() => {
|
|
1598
1607
|
if (["current", "inherit", "transparent", "black", "white"].includes(u))
|
|
1599
|
-
return
|
|
1600
|
-
|
|
1608
|
+
return c([]);
|
|
1609
|
+
c(["50", "100", "200", "300", "400", "500", "600", "700", "800", "900"]);
|
|
1601
1610
|
}, [u]);
|
|
1602
1611
|
const y = B(
|
|
1603
1612
|
// eslint-disable-next-line no-shadow
|
|
@@ -1606,10 +1615,10 @@ const ms = ({ property: r, onChange: a }) => {
|
|
|
1606
1615
|
},
|
|
1607
1616
|
[u]
|
|
1608
1617
|
);
|
|
1609
|
-
return
|
|
1618
|
+
return I(() => {
|
|
1610
1619
|
s({ color: "", shade: "" });
|
|
1611
|
-
}, [t]),
|
|
1612
|
-
const v = `${g(
|
|
1620
|
+
}, [t]), I(() => {
|
|
1621
|
+
const v = `${g(vs, r, "")}-${p.color}${p.shade ? `-${p.shade}` : ""}`;
|
|
1613
1622
|
v.match(new RegExp(g(ge, `${r}.regExp`, ""))) && a(v, r);
|
|
1614
1623
|
}, [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: [
|
|
1615
1624
|
/* @__PURE__ */ e.jsx("div", { className: "grow text-center", children: /* @__PURE__ */ e.jsx(
|
|
@@ -1653,17 +1662,17 @@ const ms = ({ property: r, onChange: a }) => {
|
|
|
1653
1662
|
) }),
|
|
1654
1663
|
/* @__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 }) })
|
|
1655
1664
|
] });
|
|
1656
|
-
},
|
|
1665
|
+
}, Xe = (r, a) => {
|
|
1657
1666
|
r = r.toLowerCase();
|
|
1658
1667
|
let t = r.trim().replace(/ |\+/g, "");
|
|
1659
1668
|
if ((t === "auto" || t === "none") && a.includes(t))
|
|
1660
1669
|
return { value: "", unit: t };
|
|
1661
1670
|
const l = a.length ? new RegExp(a.join("|"), "g") : /XXXXXX/g;
|
|
1662
1671
|
t = t.replace(l, "");
|
|
1663
|
-
const o = r.match(l), n = o && o.length > 1,
|
|
1664
|
-
return n ||
|
|
1672
|
+
const o = r.match(l), n = o && o.length > 1, c = !b(t) && Number.isNaN(Number(t));
|
|
1673
|
+
return n || c ? { error: "Invalid value" } : o && (o[0] === "auto" || o[0] === "none") ? { value: o[0], unit: "" } : { value: t, unit: o ? o[0] : "" };
|
|
1665
1674
|
};
|
|
1666
|
-
const
|
|
1675
|
+
const js = (r) => {
|
|
1667
1676
|
const a = r.startsWith("-") ? "-" : "", t = r.split("-").pop();
|
|
1668
1677
|
if (["auto", "none"].includes(t))
|
|
1669
1678
|
return { value: "", unit: t };
|
|
@@ -1673,17 +1682,17 @@ const ws = (r) => {
|
|
|
1673
1682
|
return { value: "100", unit: r.indexOf("w-") !== -1 ? "vw" : "vh" };
|
|
1674
1683
|
if (t === "full")
|
|
1675
1684
|
return { value: "100", unit: "%" };
|
|
1676
|
-
if (
|
|
1685
|
+
if (X(r, "skew-"))
|
|
1677
1686
|
return { value: `${a}${t}`, unit: "deg" };
|
|
1678
|
-
if (
|
|
1687
|
+
if (X(r, "rotate-"))
|
|
1679
1688
|
return { value: `${a}${t}`, unit: "deg" };
|
|
1680
|
-
if (
|
|
1689
|
+
if (X(r, "opacity-"))
|
|
1681
1690
|
return { value: `${t / 100}`, unit: "-" };
|
|
1682
|
-
if (
|
|
1691
|
+
if (X(r, "duration-") || X(r, "delay-"))
|
|
1683
1692
|
return { value: `${t}`, unit: "ms" };
|
|
1684
|
-
if (
|
|
1693
|
+
if (X(r, "translate-") && !t.includes("/"))
|
|
1685
1694
|
return { value: `${a}${`${t / 4}`}`, unit: "rem" };
|
|
1686
|
-
if (
|
|
1695
|
+
if (X(r, "scale-"))
|
|
1687
1696
|
return { value: `${a}${`${t / 100}`}`, unit: "-" };
|
|
1688
1697
|
if (q(r, "border")) {
|
|
1689
1698
|
const l = r.match(/border-?(x|y|t|r|b|l)?\d+/g);
|
|
@@ -1787,30 +1796,30 @@ const ws = (r) => {
|
|
|
1787
1796
|
if (["max", "min", "fit"].includes(t))
|
|
1788
1797
|
return { value: r, unit: "class" };
|
|
1789
1798
|
if (t.includes("/")) {
|
|
1790
|
-
const [l, o] =
|
|
1799
|
+
const [l, o] = R(t.split("/"), (n) => parseInt(n, 10));
|
|
1791
1800
|
return { value: a + (l / o * 100).toFixed(2).replace(".00", ""), unit: "%" };
|
|
1792
1801
|
}
|
|
1793
1802
|
return Rt(parseFloat(t)) ? { value: `${a + parseFloat(t) * 4}`, unit: "px" } : { value: t, unit: "class" };
|
|
1794
1803
|
};
|
|
1795
|
-
const
|
|
1804
|
+
const Cs = (r) => {
|
|
1796
1805
|
if (b(r))
|
|
1797
1806
|
return { value: "", unit: "" };
|
|
1798
1807
|
const a = r.match(/\[.*\]/g);
|
|
1799
1808
|
if (a === null)
|
|
1800
|
-
return
|
|
1809
|
+
return ks(r);
|
|
1801
1810
|
const t = g(a, "0", "").replace(/\[|\]/g, ""), l = r.startsWith("-") ? "-" : "", o = oe(t.match(/\d+.\d+|\d+/g));
|
|
1802
1811
|
return { value: `${l}${o}`, unit: t.replace(o, "") };
|
|
1803
|
-
},
|
|
1812
|
+
}, ks = (r) => b(r) ? { value: "", unit: "" } : js(r), ht = $.createContext({
|
|
1804
1813
|
setDragData: () => {
|
|
1805
1814
|
}
|
|
1806
|
-
}),
|
|
1815
|
+
}), Ns = ({
|
|
1807
1816
|
unit: r,
|
|
1808
1817
|
currentValue: a,
|
|
1809
1818
|
onDrag: t,
|
|
1810
1819
|
onDragEnd: l,
|
|
1811
1820
|
onDragStart: o,
|
|
1812
1821
|
negative: n,
|
|
1813
|
-
cssProperty:
|
|
1822
|
+
cssProperty: c
|
|
1814
1823
|
}) => {
|
|
1815
1824
|
const { setDragData: p } = se(ht);
|
|
1816
1825
|
return /* @__PURE__ */ e.jsx(
|
|
@@ -1818,7 +1827,7 @@ const js = (r) => {
|
|
|
1818
1827
|
{
|
|
1819
1828
|
type: "button",
|
|
1820
1829
|
onMouseDown: (s) => {
|
|
1821
|
-
const
|
|
1830
|
+
const d = {
|
|
1822
1831
|
onDrag: t,
|
|
1823
1832
|
onDragEnd: l,
|
|
1824
1833
|
dragging: !0,
|
|
@@ -1826,16 +1835,16 @@ const js = (r) => {
|
|
|
1826
1835
|
dragStartValue: `${a}`,
|
|
1827
1836
|
dragUnit: r,
|
|
1828
1837
|
negative: n,
|
|
1829
|
-
cssProperty:
|
|
1838
|
+
cssProperty: c
|
|
1830
1839
|
};
|
|
1831
|
-
o(
|
|
1840
|
+
o(d), p(d);
|
|
1832
1841
|
},
|
|
1833
1842
|
color: void 0,
|
|
1834
1843
|
className: "relative z-50 ml-1 hidden h-6 cursor-row-resize rounded bg-background/70 px-2 group-hover:inline",
|
|
1835
1844
|
children: /* @__PURE__ */ e.jsx(Gt, {})
|
|
1836
1845
|
}
|
|
1837
1846
|
);
|
|
1838
|
-
},
|
|
1847
|
+
}, _s = ({ 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
1848
|
P,
|
|
1840
1849
|
{
|
|
1841
1850
|
className: "h-max rounded-none px-1 py-1 text-right text-[11px] hover:bg-blue-400",
|
|
@@ -1847,19 +1856,19 @@ const js = (r) => {
|
|
|
1847
1856
|
children: l
|
|
1848
1857
|
},
|
|
1849
1858
|
l
|
|
1850
|
-
)) }),
|
|
1851
|
-
const [a, t] = j(!1), [l, o] = j(""), { currentClass: n, onChange:
|
|
1852
|
-
|
|
1853
|
-
const { value: m, unit: f } =
|
|
1859
|
+
)) }), Ye = 50, Ss = (r) => {
|
|
1860
|
+
const [a, t] = j(!1), [l, o] = j(""), { currentClass: n, onChange: c, classPrefix: p, cssProperty: s, units: d, negative: u } = r, [i, h] = j(s != null && s.toLowerCase().includes("width") ? "%" : d[0]), [y, x] = j(!1), [v, k] = j(""), [L, A] = j(!1), [Z, w] = j(!1);
|
|
1861
|
+
I(() => {
|
|
1862
|
+
const { value: m, unit: f } = Cs(n);
|
|
1854
1863
|
if (f === "") {
|
|
1855
|
-
o(m), h(s != null && s.toLowerCase().includes("width") ? "%" : oe(
|
|
1864
|
+
o(m), h(s != null && s.toLowerCase().includes("width") ? "%" : oe(d));
|
|
1856
1865
|
return;
|
|
1857
1866
|
}
|
|
1858
1867
|
h(f), o(f === "class" || b(m) ? "" : m);
|
|
1859
|
-
}, [n, s,
|
|
1860
|
-
const N = ce((m) =>
|
|
1868
|
+
}, [n, s, d]);
|
|
1869
|
+
const N = ce((m) => c(m), [c], Ye), C = ce((m) => c(m, !1), [c], Ye), V = B(
|
|
1861
1870
|
(m = !1) => {
|
|
1862
|
-
const f =
|
|
1871
|
+
const f = Xe(`${l}`, d);
|
|
1863
1872
|
if (g(f, "error", !1)) {
|
|
1864
1873
|
x(!0);
|
|
1865
1874
|
return;
|
|
@@ -1871,13 +1880,13 @@ const js = (r) => {
|
|
|
1871
1880
|
}
|
|
1872
1881
|
if (g(f, "value") === "")
|
|
1873
1882
|
return;
|
|
1874
|
-
const
|
|
1875
|
-
m ? C(
|
|
1883
|
+
const z = `${g(f, "value", "").startsWith("-") ? "-" : ""}${p}[${g(f, "value", "").replace("-", "")}${S === "-" ? "" : S}]`;
|
|
1884
|
+
m ? C(z) : N(z);
|
|
1876
1885
|
},
|
|
1877
|
-
[N, C, l, i, p,
|
|
1886
|
+
[N, C, l, i, p, d]
|
|
1878
1887
|
), W = B(
|
|
1879
1888
|
(m) => {
|
|
1880
|
-
const f =
|
|
1889
|
+
const f = Xe(`${l}`, d);
|
|
1881
1890
|
if (g(f, "error", !1)) {
|
|
1882
1891
|
x(!0);
|
|
1883
1892
|
return;
|
|
@@ -1888,10 +1897,10 @@ const js = (r) => {
|
|
|
1888
1897
|
}
|
|
1889
1898
|
if (g(f, "value") === "")
|
|
1890
1899
|
return;
|
|
1891
|
-
const S = g(f, "unit") !== "" ? g(f, "unit") : m,
|
|
1892
|
-
N(
|
|
1900
|
+
const S = g(f, "unit") !== "" ? g(f, "unit") : m, z = `${g(f, "value", "").startsWith("-") ? "-" : ""}${p}[${g(f, "value", "").replace("-", "")}${S === "-" ? "" : S}]`;
|
|
1901
|
+
N(z);
|
|
1893
1902
|
},
|
|
1894
|
-
[N, l, p,
|
|
1903
|
+
[N, l, p, d]
|
|
1895
1904
|
);
|
|
1896
1905
|
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: [
|
|
1897
1906
|
/* @__PURE__ */ e.jsx("input", { className: "w-20 rounded py-1", readOnly: !0, value: n }),
|
|
@@ -1899,7 +1908,7 @@ const js = (r) => {
|
|
|
1899
1908
|
/* @__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
1909
|
/* @__PURE__ */ e.jsx(G, { children: "Current value is using a Tailwind preset class." })
|
|
1901
1910
|
] })
|
|
1902
|
-
] }) : /* @__PURE__ */ e.jsxs("div", { className: `group relative flex items-center ${
|
|
1911
|
+
] }) : /* @__PURE__ */ e.jsxs("div", { className: `group relative flex items-center ${L ? "z-auto" : ""}`, children: [
|
|
1903
1912
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center rounded-md border border-border", children: [
|
|
1904
1913
|
["none", "auto"].indexOf(i) !== -1 ? null : /* @__PURE__ */ e.jsx(
|
|
1905
1914
|
"input",
|
|
@@ -1913,9 +1922,9 @@ const js = (r) => {
|
|
|
1913
1922
|
return;
|
|
1914
1923
|
m.preventDefault(), w(!0);
|
|
1915
1924
|
const f = Vt(m.target.value);
|
|
1916
|
-
let S =
|
|
1925
|
+
let S = Ke(f) ? 0 : f;
|
|
1917
1926
|
m.keyCode === 38 && (S += 1), m.keyCode === 40 && (S -= 1);
|
|
1918
|
-
const
|
|
1927
|
+
const O = `${S}`, bt = `${O.startsWith("-") ? "-" : ""}${p}[${O.replace("-", "")}${i === "-" ? "" : i}]`;
|
|
1919
1928
|
C(bt);
|
|
1920
1929
|
},
|
|
1921
1930
|
onKeyUp: (m) => {
|
|
@@ -1929,7 +1938,7 @@ const js = (r) => {
|
|
|
1929
1938
|
var f;
|
|
1930
1939
|
(f = m == null ? void 0 : m.target) == null || f.select(), t(!1);
|
|
1931
1940
|
},
|
|
1932
|
-
value:
|
|
1941
|
+
value: L ? v : l,
|
|
1933
1942
|
className: "h-6 w-14 rounded rounded-r-none bg-background pl-2 text-sm focus-visible:outline-0 ".concat(
|
|
1934
1943
|
" ",
|
|
1935
1944
|
y ? "border-red-500 text-red-500" : "border-foreground/20"
|
|
@@ -1944,15 +1953,15 @@ const js = (r) => {
|
|
|
1944
1953
|
onClick: () => t(!a),
|
|
1945
1954
|
className: "flex h-6 cursor-pointer items-center gap-x-1 rounded rounded-l-none bg-background p-px px-1 text-[11px] uppercase",
|
|
1946
1955
|
children: [
|
|
1947
|
-
/* @__PURE__ */ e.jsx("span", { className: `inline-block ${
|
|
1948
|
-
|
|
1956
|
+
/* @__PURE__ */ e.jsx("span", { className: `inline-block ${d.length === 1 ? "px-2 font-semibold" : ""}`, children: i }),
|
|
1957
|
+
d.length > 1 ? /* @__PURE__ */ e.jsx(qt, {}) : null
|
|
1949
1958
|
]
|
|
1950
1959
|
}
|
|
1951
1960
|
) }),
|
|
1952
|
-
/* @__PURE__ */ e.jsx(
|
|
1953
|
-
|
|
1961
|
+
/* @__PURE__ */ e.jsx(Sr, { children: /* @__PURE__ */ e.jsx(G, { className: "bg-background", children: /* @__PURE__ */ e.jsx(
|
|
1962
|
+
_s,
|
|
1954
1963
|
{
|
|
1955
|
-
units:
|
|
1964
|
+
units: d,
|
|
1956
1965
|
current: i,
|
|
1957
1966
|
onSelect: (m) => {
|
|
1958
1967
|
t(!1), h(m), W(m);
|
|
@@ -1961,22 +1970,22 @@ const js = (r) => {
|
|
|
1961
1970
|
) }) })
|
|
1962
1971
|
] })
|
|
1963
1972
|
] }),
|
|
1964
|
-
["none", "auto"].indexOf(i) !== -1 ||
|
|
1965
|
-
|
|
1973
|
+
["none", "auto"].indexOf(i) !== -1 || L ? null : /* @__PURE__ */ e.jsx(
|
|
1974
|
+
Ns,
|
|
1966
1975
|
{
|
|
1967
|
-
onDragStart: () =>
|
|
1976
|
+
onDragStart: () => A(!0),
|
|
1968
1977
|
onDragEnd: (m) => {
|
|
1969
|
-
if (k(() => ""),
|
|
1978
|
+
if (k(() => ""), A(!1), b(m))
|
|
1970
1979
|
return;
|
|
1971
|
-
const f = `${m}`,
|
|
1972
|
-
N(
|
|
1980
|
+
const f = `${m}`, O = `${f.startsWith("-") ? "-" : ""}${p}[${f.replace("-", "")}${i === "-" ? "" : i}]`;
|
|
1981
|
+
N(O);
|
|
1973
1982
|
},
|
|
1974
1983
|
onDrag: (m) => {
|
|
1975
1984
|
if (b(m))
|
|
1976
1985
|
return;
|
|
1977
1986
|
k(m);
|
|
1978
|
-
const f = `${m}`,
|
|
1979
|
-
C(
|
|
1987
|
+
const f = `${m}`, O = `${f.startsWith("-") ? "-" : ""}${p}[${f.replace("-", "")}${i === "-" ? "" : i}]`;
|
|
1988
|
+
C(O);
|
|
1980
1989
|
},
|
|
1981
1990
|
currentValue: l,
|
|
1982
1991
|
unit: i,
|
|
@@ -1988,7 +1997,7 @@ const js = (r) => {
|
|
|
1988
1997
|
}, ne = (r) => {
|
|
1989
1998
|
const a = ue();
|
|
1990
1999
|
return Ht(a, { property: r });
|
|
1991
|
-
},
|
|
2000
|
+
}, Ts = (r, a) => {
|
|
1992
2001
|
const t = {
|
|
1993
2002
|
xs: 0,
|
|
1994
2003
|
sm: 1,
|
|
@@ -1998,7 +2007,7 @@ const js = (r) => {
|
|
|
1998
2007
|
"2xl": 5
|
|
1999
2008
|
};
|
|
2000
2009
|
return t[g(r, "mq", "xs")] <= t[a];
|
|
2001
|
-
},
|
|
2010
|
+
}, Rs = {
|
|
2002
2011
|
width: "w-",
|
|
2003
2012
|
height: "h-",
|
|
2004
2013
|
minWidth: "min-w-",
|
|
@@ -2064,30 +2073,30 @@ const js = (r) => {
|
|
|
2064
2073
|
insetY: "inset-y-",
|
|
2065
2074
|
opacity: "opacity-",
|
|
2066
2075
|
flexBasis: "basis-"
|
|
2067
|
-
},
|
|
2076
|
+
}, Ze = {
|
|
2068
2077
|
xs: "",
|
|
2069
2078
|
sm: "640px",
|
|
2070
2079
|
md: "768px",
|
|
2071
2080
|
lg: "1024px",
|
|
2072
2081
|
xl: "1280px",
|
|
2073
2082
|
"2xl": "1536px"
|
|
2074
|
-
},
|
|
2075
|
-
const { t: a } =
|
|
2076
|
-
}, units:
|
|
2083
|
+
}, Vs = (r) => `${r.toUpperCase()} ${Ze[r] ? `(${Ze[r]} & up)` : ""}`, Re = (r) => {
|
|
2084
|
+
const { t: a } = E(), { type: t = "icons", label: l, property: o, onEmitChange: n = () => {
|
|
2085
|
+
}, units: c, negative: p = !1 } = r, [s] = Tr(), [d] = Rr(), [, u] = Ae(), i = ne(o), h = Se(), y = nt(), [x] = _e(), v = T(() => g(i, "fullCls", ""), [i]), k = B(
|
|
2077
2086
|
(C, V = !0) => {
|
|
2078
|
-
const W = { dark: s, mq: u, mod:
|
|
2079
|
-
(s ||
|
|
2080
|
-
const m =
|
|
2087
|
+
const W = { dark: s, mq: u, mod: d, cls: C, property: o, fullCls: "" };
|
|
2088
|
+
(s || d !== "") && (W.mq = "xs");
|
|
2089
|
+
const m = es(W);
|
|
2081
2090
|
h(x, [m], V);
|
|
2082
2091
|
},
|
|
2083
|
-
[x, s, u,
|
|
2084
|
-
),
|
|
2092
|
+
[x, s, u, d, o, h]
|
|
2093
|
+
), L = B(() => {
|
|
2085
2094
|
y(x, [v]);
|
|
2086
|
-
}, [x, v, y]),
|
|
2087
|
-
|
|
2088
|
-
n(
|
|
2089
|
-
}, [
|
|
2090
|
-
const [, , Z] =
|
|
2095
|
+
}, [x, v, y]), A = T(() => Ts(i, u), [i, u]);
|
|
2096
|
+
I(() => {
|
|
2097
|
+
n(A, i);
|
|
2098
|
+
}, [A, n, i]);
|
|
2099
|
+
const [, , Z] = Ae(), w = B(
|
|
2091
2100
|
(C) => {
|
|
2092
2101
|
Z({
|
|
2093
2102
|
xs: 400,
|
|
@@ -2099,28 +2108,28 @@ const js = (r) => {
|
|
|
2099
2108
|
}[C]);
|
|
2100
2109
|
},
|
|
2101
2110
|
[Z]
|
|
2102
|
-
), N = g(i, "dark", null) === s && g(i, "mod", null) ===
|
|
2103
|
-
return /* @__PURE__ */ e.jsx(
|
|
2111
|
+
), N = g(i, "dark", null) === s && g(i, "mod", null) === d && g(i, "mq", null) === u;
|
|
2112
|
+
return /* @__PURE__ */ e.jsx(ms, { canChange: A, 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
2113
|
/* @__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) }) }),
|
|
2105
2114
|
/* @__PURE__ */ e.jsxs("div", { className: "flex flex-row items-center", children: [
|
|
2106
2115
|
/* @__PURE__ */ e.jsxs("div", { className: "w-[150px]", children: [
|
|
2107
2116
|
t === "arbitrary" ? /* @__PURE__ */ e.jsx(
|
|
2108
|
-
|
|
2117
|
+
Ss,
|
|
2109
2118
|
{
|
|
2110
2119
|
currentClass: g(i, "cls", ""),
|
|
2111
|
-
classPrefix: g(
|
|
2112
|
-
units:
|
|
2120
|
+
classPrefix: g(Rs, o, ""),
|
|
2121
|
+
units: c || [],
|
|
2113
2122
|
onChange: k,
|
|
2114
2123
|
negative: p,
|
|
2115
2124
|
cssProperty: o
|
|
2116
2125
|
}
|
|
2117
2126
|
) : null,
|
|
2118
|
-
t === "icons" && /* @__PURE__ */ e.jsx(
|
|
2119
|
-
t === "range" && /* @__PURE__ */ e.jsx(
|
|
2120
|
-
t === "color" && /* @__PURE__ */ e.jsx(
|
|
2127
|
+
t === "icons" && /* @__PURE__ */ e.jsx(fs, { property: o, onChange: k }),
|
|
2128
|
+
t === "range" && /* @__PURE__ */ e.jsx(bs, { property: o, onChange: k }),
|
|
2129
|
+
t === "color" && /* @__PURE__ */ e.jsx(ws, { property: o, onChange: k }),
|
|
2121
2130
|
t === "dropdown" && /* @__PURE__ */ e.jsx(yt, { label: l, property: o, onChange: k })
|
|
2122
2131
|
] }),
|
|
2123
|
-
/* @__PURE__ */ e.jsx("div", { className: `w-[30px] cursor-pointer ${v ? "visible" : "invisible"}`, children: N ? /* @__PURE__ */ e.jsx("button", { type: "button", onClick: () =>
|
|
2132
|
+
/* @__PURE__ */ e.jsx("div", { className: `w-[30px] cursor-pointer ${v ? "visible" : "invisible"}`, children: N ? /* @__PURE__ */ e.jsx("button", { type: "button", onClick: () => L(), 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" }) }) : A && i ? /* @__PURE__ */ e.jsxs(U, { delayDuration: 100, children: [
|
|
2124
2133
|
/* @__PURE__ */ e.jsx(K, { asChild: !0, children: /* @__PURE__ */ e.jsx(
|
|
2125
2134
|
"button",
|
|
2126
2135
|
{
|
|
@@ -2132,7 +2141,7 @@ const js = (r) => {
|
|
|
2132
2141
|
/* @__PURE__ */ e.jsx(G, { children: /* @__PURE__ */ e.jsx("div", { className: "text-right", children: /* @__PURE__ */ e.jsxs("div", { children: [
|
|
2133
2142
|
"Current style is set at ",
|
|
2134
2143
|
/* @__PURE__ */ e.jsxs("span", { className: "font-bold", children: [
|
|
2135
|
-
|
|
2144
|
+
Vs(g(i, "mq")),
|
|
2136
2145
|
s && !i.dark ? "(Light mode)" : ""
|
|
2137
2146
|
] }),
|
|
2138
2147
|
/* @__PURE__ */ e.jsx("br", {}),
|
|
@@ -2152,16 +2161,16 @@ const js = (r) => {
|
|
|
2152
2161
|
] }) : null })
|
|
2153
2162
|
] })
|
|
2154
2163
|
] }) });
|
|
2155
|
-
},
|
|
2164
|
+
}, Hs = ["px", "%", "em", "rem", "ch", "vh", "vw"], mt = ({
|
|
2156
2165
|
label: r,
|
|
2157
2166
|
options: a,
|
|
2158
2167
|
borderB: t = !1,
|
|
2159
2168
|
borderT: l = !1,
|
|
2160
2169
|
type: o = "arbitrary",
|
|
2161
|
-
units: n =
|
|
2162
|
-
negative:
|
|
2170
|
+
units: n = Hs,
|
|
2171
|
+
negative: c = !1
|
|
2163
2172
|
}) => {
|
|
2164
|
-
const { t: p } =
|
|
2173
|
+
const { t: p } = E(), [s, d] = j(a[0].key), u = ue(), i = B((h) => R(u, "property").includes(h), [u]);
|
|
2165
2174
|
return /* @__PURE__ */ e.jsxs(
|
|
2166
2175
|
"div",
|
|
2167
2176
|
{
|
|
@@ -2175,13 +2184,13 @@ const js = (r) => {
|
|
|
2175
2184
|
"button",
|
|
2176
2185
|
{
|
|
2177
2186
|
type: "button",
|
|
2178
|
-
onClick: () =>
|
|
2187
|
+
onClick: () => d(y),
|
|
2179
2188
|
className: `relative cursor-pointer rounded-full p-1 text-[8px] ${y === s ? " bg-[#3E57F0] text-white" : "text-gray-600 dark:text-gray-300"}`,
|
|
2180
2189
|
children: [
|
|
2181
2190
|
$.createElement("div", {
|
|
2182
2191
|
className: i(y) ? "-bottom-1.5 absolute bg-[#3E57F0] h-[2px] left-0 w-full" : ""
|
|
2183
2192
|
}),
|
|
2184
|
-
$.createElement(g(xt, y,
|
|
2193
|
+
$.createElement(g(xt, y, Je), { className: "text-inherit w-3 h-3" })
|
|
2185
2194
|
]
|
|
2186
2195
|
}
|
|
2187
2196
|
) }),
|
|
@@ -2190,26 +2199,26 @@ const js = (r) => {
|
|
|
2190
2199
|
) })
|
|
2191
2200
|
] }),
|
|
2192
2201
|
/* @__PURE__ */ e.jsx("div", { className: "mt-0 flex items-center", children: /* @__PURE__ */ e.jsx(
|
|
2193
|
-
|
|
2202
|
+
Re,
|
|
2194
2203
|
{
|
|
2195
2204
|
type: o,
|
|
2196
2205
|
units: [...n],
|
|
2197
2206
|
label: "",
|
|
2198
2207
|
property: s,
|
|
2199
|
-
negative:
|
|
2208
|
+
negative: c
|
|
2200
2209
|
}
|
|
2201
2210
|
) })
|
|
2202
2211
|
]
|
|
2203
2212
|
}
|
|
2204
2213
|
);
|
|
2205
|
-
},
|
|
2206
|
-
const { t } =
|
|
2207
|
-
const n = (s) =>
|
|
2208
|
-
s.map((
|
|
2209
|
-
),
|
|
2210
|
-
a.map((s) => s.styleType === "accordion" ? n(s.items) : s.styleType === "multiple" ?
|
|
2211
|
-
), p =
|
|
2212
|
-
return Dt(
|
|
2214
|
+
}, Ds = ({ heading: r, items: a }) => {
|
|
2215
|
+
const { t } = E(), l = ue(), o = T(() => {
|
|
2216
|
+
const n = (s) => De(
|
|
2217
|
+
s.map((d) => d.styleType === "multiple" ? R(d.options, "key") : d.property)
|
|
2218
|
+
), c = De(
|
|
2219
|
+
a.map((s) => s.styleType === "accordion" ? n(s.items) : s.styleType === "multiple" ? R(s.options, "key") : s.property)
|
|
2220
|
+
), p = R(l, "property");
|
|
2221
|
+
return Dt(c, p).length > 0;
|
|
2213
2222
|
}, [l, a]);
|
|
2214
2223
|
return /* @__PURE__ */ e.jsxs("details", { children: [
|
|
2215
2224
|
/* @__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: [
|
|
@@ -2221,67 +2230,67 @@ const js = (r) => {
|
|
|
2221
2230
|
}
|
|
2222
2231
|
) : null
|
|
2223
2232
|
] }) }),
|
|
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(
|
|
2233
|
+
/* @__PURE__ */ e.jsx("div", { className: "p-2", children: a.map((n) => n.styleType === "multiple" ? /* @__PURE__ */ e.jsx(mt, { ...n }, n.label) : /* @__PURE__ */ e.jsx(Re, { ...n }, n.label)) })
|
|
2225
2234
|
] });
|
|
2226
|
-
},
|
|
2227
|
-
const { t: a } =
|
|
2235
|
+
}, Bs = We({}), xe = ({ section: r }) => {
|
|
2236
|
+
const { t: a } = E(), t = ue(), l = M(), o = B(
|
|
2228
2237
|
(s = []) => {
|
|
2229
|
-
const
|
|
2238
|
+
const d = {};
|
|
2230
2239
|
for (let i = 0; i < t.length; i++)
|
|
2231
|
-
|
|
2240
|
+
d[t[i].property] = t[i].cls;
|
|
2232
2241
|
let u = !0;
|
|
2233
2242
|
for (const i in s)
|
|
2234
|
-
if (!de(
|
|
2243
|
+
if (!de(d, i) || d[i] !== s[i]) {
|
|
2235
2244
|
u = !1;
|
|
2236
2245
|
break;
|
|
2237
2246
|
}
|
|
2238
2247
|
return u;
|
|
2239
2248
|
},
|
|
2240
2249
|
[t]
|
|
2241
|
-
), n =
|
|
2242
|
-
const s = `${Le(
|
|
2243
|
-
return !
|
|
2244
|
-
}, [
|
|
2245
|
-
return /* @__PURE__ */ e.jsx(
|
|
2246
|
-
/* @__PURE__ */ e.jsx(
|
|
2250
|
+
), n = T(() => ({}), []), [c] = le(), p = T(() => {
|
|
2251
|
+
const s = `${Le(c, "0.prop")}_attrs`;
|
|
2252
|
+
return !rs(Le(l, s, {}));
|
|
2253
|
+
}, [c]);
|
|
2254
|
+
return /* @__PURE__ */ e.jsx(Bs.Provider, { value: n, children: /* @__PURE__ */ e.jsxs(fe, { value: r.heading, children: [
|
|
2255
|
+
/* @__PURE__ */ e.jsx(ve, { 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: [
|
|
2247
2256
|
r.heading === "Attributes" && p ? /* @__PURE__ */ e.jsx("span", { className: "mr-2 inline-block h-[8px] w-[8px] rounded-full bg-blue-600" }) : null,
|
|
2248
2257
|
/* @__PURE__ */ e.jsx("div", { className: "flex items-center gap-x-2", children: a(r.heading) })
|
|
2249
2258
|
] }) }),
|
|
2250
|
-
/* @__PURE__ */ e.jsx(
|
|
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(
|
|
2259
|
+
/* @__PURE__ */ e.jsx(we, { className: "bg-gray-100 px-3.5 py-2", children: $.Children.toArray(
|
|
2260
|
+
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(Ds, { ...s }, s.label) : null : /* @__PURE__ */ e.jsx(Re, { ...s }, s.label))
|
|
2252
2261
|
) })
|
|
2253
2262
|
] }) });
|
|
2254
|
-
},
|
|
2255
|
-
const r =
|
|
2263
|
+
}, As = () => {
|
|
2264
|
+
const r = M(), [a] = le(), { t } = E(), l = zr(), o = Se(), n = Te(r._type), c = g(oe(a), "prop"), p = g(n.props, `${c}.presets`, {});
|
|
2256
2265
|
if (b(l) && (!de(n, "props") || b(p)))
|
|
2257
2266
|
return null;
|
|
2258
|
-
const s = (
|
|
2259
|
-
const u =
|
|
2267
|
+
const s = (d) => {
|
|
2268
|
+
const u = d.trim().toLowerCase().replace(/ +(?= )/g, "").split(" ");
|
|
2260
2269
|
o([r._id], u, !0);
|
|
2261
2270
|
};
|
|
2262
|
-
return /* @__PURE__ */ e.jsx("div", { className: "h-10", children: /* @__PURE__ */ e.jsxs(
|
|
2263
|
-
/* @__PURE__ */ e.jsx(
|
|
2271
|
+
return /* @__PURE__ */ e.jsx("div", { className: "h-10", children: /* @__PURE__ */ e.jsxs(Vr, { children: [
|
|
2272
|
+
/* @__PURE__ */ e.jsx(Hr, { asChild: !0, children: /* @__PURE__ */ e.jsx("div", { className: "px-4", children: /* @__PURE__ */ e.jsxs(P, { variant: "default", className: "w-full", size: "sm", children: [
|
|
2264
2273
|
t("Apply Presets"),
|
|
2265
2274
|
/* @__PURE__ */ e.jsx(Qt, {})
|
|
2266
2275
|
] }) }) }),
|
|
2267
|
-
/* @__PURE__ */ e.jsx(
|
|
2276
|
+
/* @__PURE__ */ e.jsx(Dr, { className: "max-h-80 w-56", children: /* @__PURE__ */ e.jsxs(dt, { className: "no-scrollbar h-full", children: [
|
|
2268
2277
|
b(p) ? null : /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
2269
|
-
/* @__PURE__ */ e.jsxs(
|
|
2278
|
+
/* @__PURE__ */ e.jsxs(Ie, { children: [
|
|
2270
2279
|
n.type,
|
|
2271
2280
|
" ",
|
|
2272
2281
|
t("presets")
|
|
2273
2282
|
] }),
|
|
2274
2283
|
/* @__PURE__ */ e.jsx(Pe, {}),
|
|
2275
|
-
/* @__PURE__ */ e.jsx($e, { children: he(p).map((
|
|
2276
|
-
me(Y(t(
|
|
2284
|
+
/* @__PURE__ */ e.jsx($e, { children: he(p).map((d) => /* @__PURE__ */ e.jsxs(Ee, { className: "group text-xs", onClick: () => s(p[d]), children: [
|
|
2285
|
+
me(Y(t(d))),
|
|
2277
2286
|
/* @__PURE__ */ e.jsx(Me, { className: "invisible hover:font-bold hover:text-blue-600 group-hover:visible", children: t("apply") })
|
|
2278
2287
|
] })) })
|
|
2279
2288
|
] }),
|
|
2280
2289
|
b(l) ? null : /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
2281
|
-
/* @__PURE__ */ e.jsx(
|
|
2290
|
+
/* @__PURE__ */ e.jsx(Ie, { children: t("Global presets") }),
|
|
2282
2291
|
/* @__PURE__ */ e.jsx(Pe, {}),
|
|
2283
|
-
/* @__PURE__ */ e.jsx($e, { children: he(l).map((
|
|
2284
|
-
me(Y(t(
|
|
2292
|
+
/* @__PURE__ */ e.jsx($e, { children: he(l).map((d) => /* @__PURE__ */ e.jsxs(Ee, { className: "group text-xs", onClick: () => s(l[d]), children: [
|
|
2293
|
+
me(Y(t(d))),
|
|
2285
2294
|
/* @__PURE__ */ e.jsx(Me, { className: "invisible hover:font-bold hover:text-blue-600 group-hover:visible", children: t("apply") })
|
|
2286
2295
|
] })) })
|
|
2287
2296
|
] })
|
|
@@ -2289,17 +2298,17 @@ const js = (r) => {
|
|
|
2289
2298
|
] }) });
|
|
2290
2299
|
};
|
|
2291
2300
|
function Is() {
|
|
2292
|
-
const { flexChild: r, gridChild: a } =
|
|
2301
|
+
const { flexChild: r, gridChild: a } = Br(), [t] = le();
|
|
2293
2302
|
return b(t) ? null : /* @__PURE__ */ e.jsxs("div", { className: "flex h-full flex-col", children: [
|
|
2294
|
-
/* @__PURE__ */ e.jsx(
|
|
2295
|
-
/* @__PURE__ */ e.jsxs(
|
|
2296
|
-
r && /* @__PURE__ */ e.jsx(xe, { section:
|
|
2297
|
-
a ? /* @__PURE__ */ e.jsx(xe, { section:
|
|
2298
|
-
|
|
2303
|
+
/* @__PURE__ */ e.jsx(As, {}),
|
|
2304
|
+
/* @__PURE__ */ e.jsxs(lt, { defaultValue: ["Styles"], type: "multiple", className: "w-full", children: [
|
|
2305
|
+
r && /* @__PURE__ */ e.jsx(xe, { section: xs }),
|
|
2306
|
+
a ? /* @__PURE__ */ e.jsx(xe, { section: ys }) : null,
|
|
2307
|
+
hs.map((l) => /* @__PURE__ */ e.jsx(xe, { section: l }, l.heading))
|
|
2299
2308
|
] })
|
|
2300
2309
|
] });
|
|
2301
2310
|
}
|
|
2302
|
-
const
|
|
2311
|
+
const Ps = {
|
|
2303
2312
|
px: 1,
|
|
2304
2313
|
"%": 1,
|
|
2305
2314
|
em: 100,
|
|
@@ -2310,8 +2319,8 @@ const As = {
|
|
|
2310
2319
|
"-": 1,
|
|
2311
2320
|
deg: 1,
|
|
2312
2321
|
ms: 0.1
|
|
2313
|
-
},
|
|
2314
|
-
const r =
|
|
2322
|
+
}, $o = () => {
|
|
2323
|
+
const r = M(), { t: a } = E(), [t, l] = $.useState(""), [o, n] = $.useState({
|
|
2315
2324
|
onDrag: (s) => s,
|
|
2316
2325
|
onDragEnd: (s) => s,
|
|
2317
2326
|
dragStartY: 0,
|
|
@@ -2320,15 +2329,15 @@ const As = {
|
|
|
2320
2329
|
dragUnit: "",
|
|
2321
2330
|
negative: !1,
|
|
2322
2331
|
cssProperty: ""
|
|
2323
|
-
}),
|
|
2332
|
+
}), c = ce(
|
|
2324
2333
|
(s) => {
|
|
2325
|
-
const
|
|
2334
|
+
const d = !g(o, "negative", !1), u = g(o, "cssProperty", "");
|
|
2326
2335
|
let i = parseFloat(o.dragStartValue);
|
|
2327
|
-
i =
|
|
2328
|
-
let h =
|
|
2336
|
+
i = Ke(i) ? 0 : i;
|
|
2337
|
+
let h = Ps[o.dragUnit];
|
|
2329
2338
|
(q(u, "scale") || u === "opacity") && (h = 10);
|
|
2330
2339
|
let x = (o.dragStartY - s.pageY) / h + i;
|
|
2331
|
-
|
|
2340
|
+
d && x < 0 && (x = 0), u === "opacity" && x > 1 && (x = 1), o.onDrag(`${x}`), l(`${x}`);
|
|
2332
2341
|
},
|
|
2333
2342
|
[o],
|
|
2334
2343
|
50
|
|
@@ -2347,17 +2356,17 @@ const As = {
|
|
|
2347
2356
|
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
2357
|
/* @__PURE__ */ e.jsx(er, { className: "mx-auto text-3xl" }),
|
|
2349
2358
|
/* @__PURE__ */ e.jsx("h1", { children: a("no_block_selected_for_styling") })
|
|
2350
|
-
] }) }) : /* @__PURE__ */ e.jsx(
|
|
2359
|
+
] }) }) : /* @__PURE__ */ e.jsx(ct, { children: /* @__PURE__ */ e.jsxs(ht.Provider, { value: { setDragData: n }, children: [
|
|
2351
2360
|
o.dragging ? /* @__PURE__ */ e.jsx(
|
|
2352
2361
|
"div",
|
|
2353
2362
|
{
|
|
2354
|
-
onMouseMove:
|
|
2363
|
+
onMouseMove: c,
|
|
2355
2364
|
onMouseUp: () => p(),
|
|
2356
2365
|
className: "absolute inset-0 z-30 cursor-row-resize bg-gray-300/10"
|
|
2357
2366
|
}
|
|
2358
2367
|
) : null,
|
|
2359
|
-
/* @__PURE__ */ e.jsxs(
|
|
2360
|
-
/* @__PURE__ */ e.jsx(
|
|
2368
|
+
/* @__PURE__ */ e.jsxs(dt, { className: "no-scrollbar max-h-full flex-1 overflow-x-hidden overflow-y-hidden bg-gray-100 pb-5", children: [
|
|
2369
|
+
/* @__PURE__ */ e.jsx(cs, {}),
|
|
2361
2370
|
/* @__PURE__ */ e.jsx(Is, {}),
|
|
2362
2371
|
/* @__PURE__ */ e.jsx("br", {}),
|
|
2363
2372
|
/* @__PURE__ */ e.jsx("br", {}),
|
|
@@ -2366,5 +2375,5 @@ const As = {
|
|
|
2366
2375
|
] }) });
|
|
2367
2376
|
};
|
|
2368
2377
|
export {
|
|
2369
|
-
|
|
2378
|
+
$o as default
|
|
2370
2379
|
};
|