@chaibuilder/sdk 1.2.63 → 1.2.65
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/CanvasArea-fSdH_RiN.cjs +1 -0
- package/dist/{CanvasArea-DvfLxy0w.js → CanvasArea-ut5yknzX.js} +58 -54
- package/dist/{CodeEditor-QPwyZNgA.js → CodeEditor-Qff4q7sx.js} +1 -1
- package/dist/{CurrentPage-rOUX01kk.js → CurrentPage-jHSVy3hq.js} +38 -26
- package/dist/CurrentPage-p_AM4lrF.cjs +1 -0
- package/dist/{PagesPanel-6P4VkMP-.js → PagesPanel-U3InJ9Db.js} +20 -8
- package/dist/PagesPanel-wqDb4D-x.cjs +1 -0
- package/dist/{ProjectPanel-Cn3teDRW.js → ProjectPanel-XODJTO4J.js} +36 -24
- package/dist/ProjectPanel-fWESzHr6.cjs +1 -0
- package/dist/{SidePanels-_Im6sF4f.js → SidePanels-ijaUKSek.js} +84 -70
- package/dist/SidePanels-lrMQqc0h.cjs +1 -0
- package/dist/Topbar-RrCDxd0i.cjs +1 -0
- package/dist/{Topbar-SuY-S0im.js → Topbar-vHlnfxPs.js} +45 -30
- package/dist/UILibrariesPanel-7btHgBD0.cjs +1 -0
- package/dist/{UILibrariesPanel-RI9mo293.js → UILibrariesPanel-NVUMUPUj.js} +83 -63
- package/dist/{UnsplashImages-dasLGrBn.js → UnsplashImages-UkHihhA5.js} +16 -16
- package/dist/{UploadImages-Gh2AQpk1.js → UploadImages-HtuJZJlo.js} +7 -7
- package/dist/add-page-modal-RwIj1FxH.cjs +1 -0
- package/dist/{add-page-modal-zCiyvKEa.js → add-page-modal-TOfMfmPA.js} +32 -23
- package/dist/{confirm-alert-9XYi0a4k.js → confirm-alert-eIp2cAkc.js} +1 -1
- package/dist/core.cjs +1 -1
- package/dist/core.d.ts +10 -7
- package/dist/core.js +74 -59
- package/dist/{delete-page-modal-pzagU_6y.js → delete-page-modal-4bxjpVBD.js} +33 -21
- package/dist/delete-page-modal-qYDZmpgT.cjs +1 -0
- package/dist/email.cjs +1 -1
- package/dist/email.js +20 -5
- package/dist/{form-EjiQiiEY.js → form-NAzFjGs0.js} +9 -9
- package/dist/html-to-json-NqRjgFqp.cjs +1 -0
- package/dist/html-to-json-l_mw5y-e.js +243 -0
- package/dist/{index-DzAuS11k.cjs → index--k2M8kzI.cjs} +1 -1
- package/dist/{index-BbW1Uw_k.cjs → index-5XyNUAjc.cjs} +81 -22
- package/dist/{index-bscJUvUx.js → index-C7mB4XFm.js} +117 -117
- package/dist/{index-qSbpzIA4.js → index-YZhtVcj_.js} +4 -4
- package/dist/{index-EEcKvBh3.js → index-lFgDm1oa.js} +48587 -45055
- package/dist/lib.cjs +2 -2
- package/dist/lib.js +22 -22
- package/dist/page-viewer-4wrnWnK0.js +124 -0
- package/dist/page-viewer-ra0GLx1p.cjs +1 -0
- package/dist/{project-general-setting-5B7s5swF.js → project-general-setting-IwZUkYF3.js} +18 -9
- package/dist/project-general-setting-lFjTUhHD.cjs +1 -0
- package/dist/{project-seo-setting-aAGnwBrw.js → project-seo-setting-e1fTqVsd.js} +2 -2
- package/dist/{single-page-detail-Yr0EbBJJ.js → single-page-detail-ZNWFKqLW.js} +69 -60
- package/dist/single-page-detail-g55Anu7R.cjs +1 -0
- package/dist/studio.cjs +1 -1
- package/dist/studio.js +18 -6
- package/dist/style.css +2 -2
- package/dist/ui.js +67 -67
- package/package.json +1 -1
- package/dist/AddBlocks-4wpxOF2K.cjs +0 -1
- package/dist/AddBlocks-ChNxwRrx.js +0 -142
- package/dist/CanvasArea-hGLbDJlM.cjs +0 -1
- package/dist/CurrentPage-fMCaBGwl.cjs +0 -1
- package/dist/PagesPanel-ZCZjs7Bi.cjs +0 -1
- package/dist/ProjectPanel-XSVWRr6v.cjs +0 -1
- package/dist/Settings-Amh8Mtm7.cjs +0 -1
- package/dist/Settings-dbB2VPAj.js +0 -2378
- package/dist/SidePanels-5adH7U3T.cjs +0 -1
- package/dist/StaticCanvas-fDhBK35X.cjs +0 -60
- package/dist/StaticCanvas-goU42OMU.js +0 -749
- package/dist/ThemeConfigPanel-N6l317II.cjs +0 -1
- package/dist/ThemeConfigPanel-aEN4tTYi.js +0 -191
- package/dist/Topbar-ag6qdgbe.cjs +0 -1
- package/dist/UILibrariesPanel-03Y3F3A_.cjs +0 -1
- package/dist/add-page-modal-80cVOM7i.cjs +0 -1
- package/dist/atoms-KQpaDRnF.cjs +0 -1
- package/dist/atoms-Oomqut88.js +0 -6
- package/dist/delete-page-modal-foPRP--l.cjs +0 -1
- package/dist/html-to-json-_01DXd-a.js +0 -192
- package/dist/html-to-json-ndxaXRT8.cjs +0 -1
- package/dist/index-e0c8PmRQ.js +0 -205
- package/dist/index-gi1LIOCw.cjs +0 -1
- package/dist/page-viewer-XFTCHu_2.cjs +0 -1
- package/dist/page-viewer-Z1wXyzzc.js +0 -112
- package/dist/plugin-2hf9pCRy.cjs +0 -1
- package/dist/plugin-wDnsBVPp.js +0 -54
- package/dist/project-general-setting-HV3X_wHI.cjs +0 -1
- package/dist/single-page-detail-6C1WP3s5.cjs +0 -1
|
@@ -1,2378 +0,0 @@
|
|
|
1
|
-
import { j as e } from "./jsx-runtime-WbnYoNE9.js";
|
|
2
|
-
import * as ie from "react";
|
|
3
|
-
import $, { useState as j, useMemo as T, useEffect as I, useCallback as B, memo as bt, useRef as ye, createContext as We, useContext as se } from "react";
|
|
4
|
-
import { useThrottledCallback as ce } from "@react-hookz/web";
|
|
5
|
-
import { forEach as ke, isArray as pe, omit as ft, truncate as vt, includes as X, get as g, first as oe, split as wt, startCase as Y, toLower as re, isEmpty as b, map as R, find as jt, last as Ct, filter as Ve, set as Ue, debounce as kt, keys as he, cloneDeep as Nt, each as _t, capitalize as me, reject as St, nth as He, startsWith as q, isNumber as Tt, parseInt as Rt, isNaN as Ke, findLast as Vt, flatten as De, intersection as Ht, has as de, isNull as Dt } from "lodash-es";
|
|
6
|
-
import { useTranslation as E } from "react-i18next";
|
|
7
|
-
import { CopyIcon as Bt, PlusIcon as Ge, Cross2Icon as qe, EyeOpenIcon as At, 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 It, ArrowTopRightIcon as Pt, ArrowBottomRightIcon as $t, ArrowBottomLeftIcon as Et, AlignLeftIcon as Mt, AlignCenterHorizontallyIcon as Lt, AlignRightIcon as Ot, StretchHorizontallyIcon as zt, FontItalicIcon as Ft, UnderlineIcon as Xt, OverlineIcon as Yt, LetterCaseUppercaseIcon as Zt, Cross1Icon as Wt, InfoCircledIcon as Ne, MinusIcon as Ut, BoxIcon as Je, RowSpacingIcon as Kt, TriangleDownIcon as Gt, CrossCircledIcon as qt, CaretDownIcon as Jt, MixerHorizontalIcon as Qt } from "@radix-ui/react-icons";
|
|
8
|
-
import { aM as Qe, aN as et, B as P, aO as tt, aP as er, aQ as tr, aR as rr, aS as sr, aT as or, aU as lr, l as M, aV as ar, aW as nr, aX as ir, aY as dr, aZ as cr, a_ as pr, a$ as ur, T as U, v as K, w as G, am as gr, b0 as xr, b1 as yr, b2 as hr, b3 as mr, b4 as br, b5 as fr, b6 as vr, j as _e, b7 as wr, b8 as be, aH as rt, y as st, h as ot, b9 as jr, a8 as lt, a9 as fe, aa as ve, ab as we, a6 as at, $ as Cr, z as le, aq as Se, aB as nt, a7 as kr, ba as it, F as Nr, bb as _r, aC as ue, aw as Sr, aG as Tr, J as Ae, L as Rr, M as Vr, N as Hr, bc as Dr, O as Ie, P as Pe, bd as $e, a5 as Ee, be as Me, aI as Br } from "./index-bscJUvUx.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 dt, u as ct, a as Fr, F as Xr } from "./index-EEcKvBh3.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";
|
|
21
|
-
import "./_commonjsHelpers-UyOWmZb0.js";
|
|
22
|
-
import "@radix-ui/react-toggle";
|
|
23
|
-
import "class-variance-authority";
|
|
24
|
-
import "@radix-ui/react-switch";
|
|
25
|
-
import "@radix-ui/react-slot";
|
|
26
|
-
import "@radix-ui/react-accordion";
|
|
27
|
-
import "@radix-ui/react-alert-dialog";
|
|
28
|
-
import "@radix-ui/react-dialog";
|
|
29
|
-
import "@radix-ui/react-label";
|
|
30
|
-
import "@radix-ui/react-scroll-area";
|
|
31
|
-
import "@radix-ui/react-tabs";
|
|
32
|
-
import "@radix-ui/react-tooltip";
|
|
33
|
-
import "@radix-ui/react-popover";
|
|
34
|
-
import "@radix-ui/react-menubar";
|
|
35
|
-
import "@radix-ui/react-hover-card";
|
|
36
|
-
import "@radix-ui/react-select";
|
|
37
|
-
import "@radix-ui/react-dropdown-menu";
|
|
38
|
-
import "@radix-ui/react-separator";
|
|
39
|
-
import "@radix-ui/react-toast";
|
|
40
|
-
import "cmdk";
|
|
41
|
-
import "@radix-ui/react-context-menu";
|
|
42
|
-
import "react-icons-picker";
|
|
43
|
-
import "react-dom";
|
|
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 "react-arborist";
|
|
51
|
-
import "./index-VBXQixVm.js";
|
|
52
|
-
import "@floating-ui/react-dom";
|
|
53
|
-
import "flagged";
|
|
54
|
-
import "react-hotkeys-hook";
|
|
55
|
-
function ss(r) {
|
|
56
|
-
const a = [], t = {};
|
|
57
|
-
function l(o, n) {
|
|
58
|
-
ke(n, (c, p) => {
|
|
59
|
-
const s = o ? `${o}.${p}` : p, d = pe(c) ? "list" : typeof c;
|
|
60
|
-
a.push(s), t[s] = d === "string" ? "text" : d === "object" ? "model" : d, d === "object" && !pe(c) && l(s, c);
|
|
61
|
-
});
|
|
62
|
-
}
|
|
63
|
-
return l("", ft(r, ["styles", "_type", "_id", "_name", "_bindings"])), { paths: a, pathsType: t };
|
|
64
|
-
}
|
|
65
|
-
const je = ({ data: r, fullView: a }) => {
|
|
66
|
-
if (!r)
|
|
67
|
-
return null;
|
|
68
|
-
const t = typeof r;
|
|
69
|
-
return a ? typeof r == "object" ? /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
70
|
-
/* @__PURE__ */ e.jsx("div", { className: "h-3" }),
|
|
71
|
-
/* @__PURE__ */ e.jsx(dt, { children: /* @__PURE__ */ e.jsx(
|
|
72
|
-
Yr,
|
|
73
|
-
{
|
|
74
|
-
data: r,
|
|
75
|
-
shouldExpandNode: Zr,
|
|
76
|
-
style: {
|
|
77
|
-
...Wr,
|
|
78
|
-
container: "max-h-[40vh] overflow-y-auto text-[12px] leading-[1.5] tracking-wide font-mono",
|
|
79
|
-
stringValue: "text-orange-600",
|
|
80
|
-
label: "text-green-900 font-semibold pr-1 tracking-wider"
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
) })
|
|
84
|
-
] }) : /* @__PURE__ */ e.jsxs("div", { className: "max-h-36 w-full overflow-y-auto overflow-x-hidden text-[12px] leading-4 text-gray-800/50", children: [
|
|
85
|
-
/* @__PURE__ */ e.jsx("span", { className: "font-medium text-gray-800/80", children: "Content: " }),
|
|
86
|
-
r
|
|
87
|
-
] }) : /* @__PURE__ */ e.jsx("div", { className: "w-full overflow-hidden whitespace-nowrap text-[10px] leading-3 text-gray-800/50", children: vt(t === "object" ? JSON.stringify(r) : r, { length: 40 }) });
|
|
88
|
-
}, Oe = ({
|
|
89
|
-
type: r,
|
|
90
|
-
value: a = "",
|
|
91
|
-
setValue: t,
|
|
92
|
-
data: l,
|
|
93
|
-
onChange: o,
|
|
94
|
-
dataType: n,
|
|
95
|
-
appliedBindings: c
|
|
96
|
-
}) => {
|
|
97
|
-
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(
|
|
98
|
-
(x) => !X(c, x) && g(d, `props.${oe(wt(x, "."))}.binding`)
|
|
99
|
-
) : p.filter((x) => n === g(s, x, "")), [r, p, c, n, d]);
|
|
100
|
-
return I(() => {
|
|
101
|
-
a && o(a);
|
|
102
|
-
}, [a, r]), /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
103
|
-
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-4", children: [
|
|
104
|
-
/* @__PURE__ */ e.jsx("p", { className: "text-sm text-muted-foreground", children: Y(re(r)) }),
|
|
105
|
-
/* @__PURE__ */ e.jsxs(Qe, { open: i, onOpenChange: h, children: [
|
|
106
|
-
/* @__PURE__ */ e.jsx(et, { asChild: !0, children: /* @__PURE__ */ e.jsx(
|
|
107
|
-
P,
|
|
108
|
-
{
|
|
109
|
-
variant: "outline",
|
|
110
|
-
size: "sm",
|
|
111
|
-
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"}`,
|
|
112
|
-
children: a ? /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
113
|
-
/* @__PURE__ */ e.jsxs("span", { className: "pr-8 text-sm", children: [
|
|
114
|
-
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) }),
|
|
115
|
-
a
|
|
116
|
-
] }),
|
|
117
|
-
/* @__PURE__ */ e.jsx("span", { className: "cursor-pointer text-[9px] text-blue-400 underline hover:text-blue-700", children: "Change" })
|
|
118
|
-
] }) : /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
119
|
-
"+ Set ",
|
|
120
|
-
Y(re(r))
|
|
121
|
-
] })
|
|
122
|
-
}
|
|
123
|
-
) }),
|
|
124
|
-
/* @__PURE__ */ e.jsx(tt, { className: "z-[999] min-w-[300px] p-0", side: "right", align: "start", children: /* @__PURE__ */ e.jsxs(er, { children: [
|
|
125
|
-
/* @__PURE__ */ e.jsx(tr, { placeholder: `Choose ${re(r)}...` }),
|
|
126
|
-
/* @__PURE__ */ e.jsxs(rr, { children: [
|
|
127
|
-
/* @__PURE__ */ e.jsx(sr, { children: "No results found." }),
|
|
128
|
-
/* @__PURE__ */ e.jsx(or, { children: R(y, (x) => /* @__PURE__ */ e.jsxs(
|
|
129
|
-
lr,
|
|
130
|
-
{
|
|
131
|
-
value: x,
|
|
132
|
-
className: `cursor-pointer ${u ? "flex items-center justify-between" : "flex flex-col items-start justify-start"}`,
|
|
133
|
-
onSelect: (v) => {
|
|
134
|
-
t(jt(y, (k) => k === v) || null), h(!1);
|
|
135
|
-
},
|
|
136
|
-
children: [
|
|
137
|
-
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-x-2", children: [
|
|
138
|
-
/* @__PURE__ */ e.jsx(Ar, { className: `h-4 w-4 text-green-500 ${a === x ? "" : "opacity-0"}` }),
|
|
139
|
-
x
|
|
140
|
-
] }),
|
|
141
|
-
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) }) })
|
|
142
|
-
]
|
|
143
|
-
},
|
|
144
|
-
x
|
|
145
|
-
)) })
|
|
146
|
-
] })
|
|
147
|
-
] }) })
|
|
148
|
-
] })
|
|
149
|
-
] }),
|
|
150
|
-
!u && !b(a) && /* @__PURE__ */ e.jsx("div", { className: "pt-2", children: /* @__PURE__ */ e.jsx(je, { data: g(l, a, ""), fullView: !0 }) })
|
|
151
|
-
] });
|
|
152
|
-
}, os = ({
|
|
153
|
-
appliedBindings: r = [],
|
|
154
|
-
onAddBinding: a,
|
|
155
|
-
editMode: t,
|
|
156
|
-
item: l
|
|
157
|
-
}) => {
|
|
158
|
-
const [o, n] = j(t ? l.key : ""), [c, p] = j(t ? l.value : ""), s = M(), [d] = ct(), u = B(
|
|
159
|
-
(y, x) => {
|
|
160
|
-
if (b(y))
|
|
161
|
-
return "";
|
|
162
|
-
{
|
|
163
|
-
const v = g(x === "PROP" ? s : d, y, "");
|
|
164
|
-
if (pe(v))
|
|
165
|
-
return "list";
|
|
166
|
-
const k = typeof v;
|
|
167
|
-
return k === "string" ? "text" : k === "object" ? "model" : k;
|
|
168
|
-
}
|
|
169
|
-
},
|
|
170
|
-
[s, d]
|
|
171
|
-
), [i, h] = j(t ? u(l.key, "PROP") : "");
|
|
172
|
-
return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
173
|
-
/* @__PURE__ */ e.jsxs(ar, { children: [
|
|
174
|
-
/* @__PURE__ */ e.jsx(nr, { children: "Add Data Binding" }),
|
|
175
|
-
/* @__PURE__ */ e.jsx(ir, { className: "text-xs", children: "Add prop and path of binding. Click save when you're done." })
|
|
176
|
-
] }),
|
|
177
|
-
/* @__PURE__ */ e.jsxs("div", { className: "relative flex flex-col gap-1", children: [
|
|
178
|
-
/* @__PURE__ */ e.jsx(
|
|
179
|
-
Oe,
|
|
180
|
-
{
|
|
181
|
-
type: "PROP",
|
|
182
|
-
isDisabled: !1,
|
|
183
|
-
placeholder: "Enter prop key",
|
|
184
|
-
value: o,
|
|
185
|
-
setValue: n,
|
|
186
|
-
onChange: (y) => {
|
|
187
|
-
const x = u(y, "PROP");
|
|
188
|
-
n(y), i !== x && p(""), h(x);
|
|
189
|
-
},
|
|
190
|
-
data: s,
|
|
191
|
-
dataType: i,
|
|
192
|
-
appliedBindings: r
|
|
193
|
-
}
|
|
194
|
-
),
|
|
195
|
-
/* @__PURE__ */ e.jsx("div", { className: "h-2" }),
|
|
196
|
-
/* @__PURE__ */ e.jsx(
|
|
197
|
-
Oe,
|
|
198
|
-
{
|
|
199
|
-
type: "PATH",
|
|
200
|
-
isDisabled: b(o),
|
|
201
|
-
placeholder: "Enter data path",
|
|
202
|
-
value: c,
|
|
203
|
-
setValue: p,
|
|
204
|
-
onChange: (y) => {
|
|
205
|
-
const x = u(y, "PATH");
|
|
206
|
-
p(i === x ? y : "");
|
|
207
|
-
},
|
|
208
|
-
data: d,
|
|
209
|
-
dataType: i,
|
|
210
|
-
appliedBindings: r
|
|
211
|
-
}
|
|
212
|
-
)
|
|
213
|
-
] }),
|
|
214
|
-
/* @__PURE__ */ e.jsx(dr, { children: /* @__PURE__ */ e.jsx(
|
|
215
|
-
P,
|
|
216
|
-
{
|
|
217
|
-
type: "submit",
|
|
218
|
-
className: "mt-4",
|
|
219
|
-
disabled: b(o) && b(c),
|
|
220
|
-
onClick: () => a({ key: o, value: c }),
|
|
221
|
-
children: "Save"
|
|
222
|
-
}
|
|
223
|
-
) })
|
|
224
|
-
] });
|
|
225
|
-
}, pt = ({ disabled: r, children: a, onAddBinding: t, appliedBindings: l, editMode: o = !0, item: n = {} }) => {
|
|
226
|
-
const [c, p] = j(!1);
|
|
227
|
-
return /* @__PURE__ */ e.jsxs(cr, { children: [
|
|
228
|
-
/* @__PURE__ */ e.jsx(pr, { disabled: r, asChild: !0, onClick: () => p(!0), children: a }),
|
|
229
|
-
c && /* @__PURE__ */ e.jsx(ur, { children: /* @__PURE__ */ e.jsx(
|
|
230
|
-
os,
|
|
231
|
-
{
|
|
232
|
-
item: n,
|
|
233
|
-
editMode: o,
|
|
234
|
-
appliedBindings: l,
|
|
235
|
-
onAddBinding: (s) => {
|
|
236
|
-
t(s), p(!1);
|
|
237
|
-
}
|
|
238
|
-
}
|
|
239
|
-
) })
|
|
240
|
-
] });
|
|
241
|
-
}, ls = ({
|
|
242
|
-
item: r,
|
|
243
|
-
onAddBinding: a,
|
|
244
|
-
onRemove: t,
|
|
245
|
-
selectedBlock: l,
|
|
246
|
-
dataProvider: o,
|
|
247
|
-
appliedBindings: n
|
|
248
|
-
}) => {
|
|
249
|
-
const [c, p] = j("string"), s = (d, u) => {
|
|
250
|
-
if (b(d))
|
|
251
|
-
return "";
|
|
252
|
-
{
|
|
253
|
-
const i = g(u === "PROP" ? l : o, d, "");
|
|
254
|
-
if (pe(i))
|
|
255
|
-
return "list";
|
|
256
|
-
const h = typeof i;
|
|
257
|
-
return h === "string" ? "text" : h === "object" ? "model" : h;
|
|
258
|
-
}
|
|
259
|
-
};
|
|
260
|
-
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: [
|
|
261
|
-
/* @__PURE__ */ e.jsx("div", { className: "text-sm font-normal text-gray-500", children: r.key }),
|
|
262
|
-
/* @__PURE__ */ e.jsx("div", { className: "font-medium leading-5", children: r.value }),
|
|
263
|
-
/* @__PURE__ */ e.jsx(je, { data: g(o, r.value, "") }),
|
|
264
|
-
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center justify-end gap-x-2", children: [
|
|
265
|
-
/* @__PURE__ */ e.jsx(pt, { 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" }) }),
|
|
266
|
-
/* @__PURE__ */ e.jsx(
|
|
267
|
-
Pr,
|
|
268
|
-
{
|
|
269
|
-
onClick: () => t(),
|
|
270
|
-
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"
|
|
271
|
-
}
|
|
272
|
-
)
|
|
273
|
-
] }),
|
|
274
|
-
!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) })
|
|
275
|
-
] });
|
|
276
|
-
}, as = ({ bindingData: r, onChange: a }) => {
|
|
277
|
-
const t = M(), [l] = ct(), o = Or(), [n, c] = j(
|
|
278
|
-
R(r, (i, h) => ({ key: h, value: i }))
|
|
279
|
-
);
|
|
280
|
-
I(() => {
|
|
281
|
-
c(R(r, (i, h) => ({ key: h, value: i })));
|
|
282
|
-
}, [t == null ? void 0 : t._id, r]);
|
|
283
|
-
const p = T(() => {
|
|
284
|
-
if (b(l))
|
|
285
|
-
return !0;
|
|
286
|
-
if (b(n))
|
|
287
|
-
return !1;
|
|
288
|
-
const i = Ct(n);
|
|
289
|
-
return b(i == null ? void 0 : i.key) || b(i == null ? void 0 : i.value);
|
|
290
|
-
}, [l, n]), s = (i) => {
|
|
291
|
-
const h = Ve(n, (y) => y.key !== i.key);
|
|
292
|
-
c([...h, i]), u([...h, i]);
|
|
293
|
-
}, d = (i) => {
|
|
294
|
-
const h = Ve(n, (y, x) => i !== x);
|
|
295
|
-
u([...h]);
|
|
296
|
-
}, u = B(
|
|
297
|
-
(i = []) => {
|
|
298
|
-
if (c(i), b(i)) {
|
|
299
|
-
a({});
|
|
300
|
-
return;
|
|
301
|
-
}
|
|
302
|
-
const h = {};
|
|
303
|
-
ke(i, (y) => {
|
|
304
|
-
!b(y == null ? void 0 : y.key) && !b(y == null ? void 0 : y.value) && Ue(h, y.key, y.value);
|
|
305
|
-
}), a(h);
|
|
306
|
-
},
|
|
307
|
-
[a]
|
|
308
|
-
);
|
|
309
|
-
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: [
|
|
310
|
-
"You have no data providers registered. Please add a data provider to your project. ",
|
|
311
|
-
/* @__PURE__ */ e.jsx("br", {}),
|
|
312
|
-
/* @__PURE__ */ e.jsx("a", { className: "text-blue-500", href: "https://chaibuilder.com/docs/registering-data-providers", target: "_blank", children: "Learn more" })
|
|
313
|
-
] }) }) : /* @__PURE__ */ e.jsxs("div", { className: "space-y-2", children: [
|
|
314
|
-
R(n, (i, h) => /* @__PURE__ */ e.jsx(
|
|
315
|
-
ls,
|
|
316
|
-
{
|
|
317
|
-
item: i,
|
|
318
|
-
onAddBinding: s,
|
|
319
|
-
onRemove: () => d(h),
|
|
320
|
-
selectedBlock: t,
|
|
321
|
-
dataProvider: l,
|
|
322
|
-
appliedBindings: R(n, "key")
|
|
323
|
-
},
|
|
324
|
-
i.key
|
|
325
|
-
)),
|
|
326
|
-
/* @__PURE__ */ e.jsxs(U, { delayDuration: 200, children: [
|
|
327
|
-
/* @__PURE__ */ e.jsx(K, { disabled: b(l), className: "w-full", children: /* @__PURE__ */ e.jsx(
|
|
328
|
-
pt,
|
|
329
|
-
{
|
|
330
|
-
disabled: p,
|
|
331
|
-
appliedBindings: R(n, "key"),
|
|
332
|
-
onAddBinding: s,
|
|
333
|
-
children: /* @__PURE__ */ e.jsx(
|
|
334
|
-
"span",
|
|
335
|
-
{
|
|
336
|
-
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"}`,
|
|
337
|
-
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"
|
|
338
|
-
}
|
|
339
|
-
)
|
|
340
|
-
}
|
|
341
|
-
) }),
|
|
342
|
-
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" })
|
|
343
|
-
] })
|
|
344
|
-
] });
|
|
345
|
-
}, 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 }) => {
|
|
346
|
-
const { t } = E(), [, l] = gr(), o = M();
|
|
347
|
-
if (typeof window > "u")
|
|
348
|
-
return null;
|
|
349
|
-
const n = r.replace("root.", ""), c = g(o, n, ""), p = () => {
|
|
350
|
-
const s = o == null ? void 0 : o._id;
|
|
351
|
-
l({ blockId: s, blockProp: n, placeholder: a, initialCode: g(o, n, c) });
|
|
352
|
-
};
|
|
353
|
-
return /* @__PURE__ */ e.jsxs("div", { className: "mt-2 flex flex-col gap-y-1", children: [
|
|
354
|
-
/* @__PURE__ */ e.jsx(
|
|
355
|
-
"button",
|
|
356
|
-
{
|
|
357
|
-
onClick: p,
|
|
358
|
-
className: "text-pretty w-[90%] max-w-full cursor-default truncate rounded border bg-white p-2 text-left text-[10px]",
|
|
359
|
-
children: c.trim().length > 0 ? c.substring(0, 46) : a || "Eg: <script>console.log('Hello, world!');<\/script>"
|
|
360
|
-
}
|
|
361
|
-
),
|
|
362
|
-
/* @__PURE__ */ e.jsx(P, { onClick: p, size: "sm", variant: "outline", className: "w-fit", children: t("Open code editor") })
|
|
363
|
-
] });
|
|
364
|
-
}, ze = bt(({ id: r, properties: a, formData: t, onChange: l }) => {
|
|
365
|
-
const [o, n] = j(t), c = { type: "object", properties: {} }, p = {};
|
|
366
|
-
Object.keys(a).forEach((d) => {
|
|
367
|
-
const u = a[d];
|
|
368
|
-
if (X(["slot", "styles"], u.type))
|
|
369
|
-
return;
|
|
370
|
-
const i = d;
|
|
371
|
-
c.properties[i] = xr(u), p[i] = yr(u);
|
|
372
|
-
}), I(() => {
|
|
373
|
-
n(t);
|
|
374
|
-
}, [r]);
|
|
375
|
-
const s = ce(
|
|
376
|
-
async ({ formData: d }, u) => {
|
|
377
|
-
l({ formData: d }, u);
|
|
378
|
-
},
|
|
379
|
-
[l],
|
|
380
|
-
1e3
|
|
381
|
-
// save only every 5 seconds
|
|
382
|
-
);
|
|
383
|
-
return /* @__PURE__ */ e.jsx(
|
|
384
|
-
Ur,
|
|
385
|
-
{
|
|
386
|
-
widgets: {
|
|
387
|
-
binding: ns,
|
|
388
|
-
richtext: hr,
|
|
389
|
-
icon: mr,
|
|
390
|
-
image: br,
|
|
391
|
-
code: is
|
|
392
|
-
},
|
|
393
|
-
fields: { link: fr },
|
|
394
|
-
idSeparator: ".",
|
|
395
|
-
autoComplete: "off",
|
|
396
|
-
omitExtraData: !1,
|
|
397
|
-
liveOmit: !1,
|
|
398
|
-
liveValidate: !1,
|
|
399
|
-
validator: Kr,
|
|
400
|
-
uiSchema: p,
|
|
401
|
-
schema: c,
|
|
402
|
-
formData: o,
|
|
403
|
-
onChange: ({ formData: d }, u) => {
|
|
404
|
-
u && (n(d), s({ formData: d }, u));
|
|
405
|
-
}
|
|
406
|
-
}
|
|
407
|
-
);
|
|
408
|
-
}), ds = () => {
|
|
409
|
-
const [r, a] = Gr(vr), t = M(), [, l] = _e(), { t: o } = E(), n = T(() => (t ? JSON.stringify(t) : "").includes('"x-show"'), [t]);
|
|
410
|
-
if (!t || !n)
|
|
411
|
-
return null;
|
|
412
|
-
const c = r.includes(t._id);
|
|
413
|
-
return /* @__PURE__ */ e.jsxs("div", { className: "py-2 text-xs hover:no-underline", children: [
|
|
414
|
-
/* @__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: [
|
|
415
|
-
t._name || t._type,
|
|
416
|
-
" ",
|
|
417
|
-
o("visibility settings")
|
|
418
|
-
] }),
|
|
419
|
-
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-2 px-2 pt-2", children: [
|
|
420
|
-
/* @__PURE__ */ e.jsx(
|
|
421
|
-
wr,
|
|
422
|
-
{
|
|
423
|
-
id: "show-on-canvas",
|
|
424
|
-
checked: c,
|
|
425
|
-
onCheckedChange: (p) => {
|
|
426
|
-
p ? (a((s) => [...s, t._id]), l([t._id])) : a((s) => s.filter((d) => d !== t._id));
|
|
427
|
-
}
|
|
428
|
-
}
|
|
429
|
-
),
|
|
430
|
-
/* @__PURE__ */ e.jsx(be, { htmlFor: "show-on-canvas", children: o("Show on canvas") })
|
|
431
|
-
] })
|
|
432
|
-
] });
|
|
433
|
-
};
|
|
434
|
-
function cs() {
|
|
435
|
-
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) => {
|
|
436
|
-
if (x && (n == null ? void 0 : n._id) === r._id) {
|
|
437
|
-
const k = x.replace("root.", "");
|
|
438
|
-
t([r._id], { [k]: g(y, k) }, v);
|
|
439
|
-
}
|
|
440
|
-
}, d = B(
|
|
441
|
-
kt(({ formData: y }, x, v) => {
|
|
442
|
-
s({ formData: y }, x, v), c(y);
|
|
443
|
-
}, 1500),
|
|
444
|
-
[r == null ? void 0 : r._id]
|
|
445
|
-
), u = ({ formData: y }, x) => {
|
|
446
|
-
if (x) {
|
|
447
|
-
const v = x.replace("root.", "");
|
|
448
|
-
a(
|
|
449
|
-
[r._id],
|
|
450
|
-
jr(v, g(y, v.split(".")))
|
|
451
|
-
), d({ formData: y }, x, { [v]: g(n, v) });
|
|
452
|
-
}
|
|
453
|
-
}, i = he(g(o, "_bindings", {})), h = T(() => {
|
|
454
|
-
const y = Nt(g(l, "props", {}));
|
|
455
|
-
return p && _t(i, (x) => delete y[x]), y;
|
|
456
|
-
}, [l, i, p]);
|
|
457
|
-
return /* @__PURE__ */ e.jsxs("div", { className: "overflow-x-hidden", children: [
|
|
458
|
-
p ? /* @__PURE__ */ e.jsxs(lt, { type: "multiple", defaultValue: ["STATIC", "BINDING"], className: "h-full w-full", children: [
|
|
459
|
-
/* @__PURE__ */ e.jsxs(fe, { value: "BINDING", children: [
|
|
460
|
-
/* @__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: [
|
|
461
|
-
/* @__PURE__ */ e.jsx(
|
|
462
|
-
"div",
|
|
463
|
-
{
|
|
464
|
-
className: `h-[8px] w-[8px] rounded-full ${b(g(r, "_bindings", {})) ? "bg-gray-300" : "bg-blue-500"}`
|
|
465
|
-
}
|
|
466
|
-
),
|
|
467
|
-
"Data Binding"
|
|
468
|
-
] }) }),
|
|
469
|
-
/* @__PURE__ */ e.jsx(we, { className: "px-4 pt-4", children: /* @__PURE__ */ e.jsx(
|
|
470
|
-
as,
|
|
471
|
-
{
|
|
472
|
-
bindingData: g(r, "_bindings", {}),
|
|
473
|
-
onChange: (y) => {
|
|
474
|
-
s({ formData: { _bindings: y } }, "root._bindings");
|
|
475
|
-
}
|
|
476
|
-
}
|
|
477
|
-
) })
|
|
478
|
-
] }),
|
|
479
|
-
/* @__PURE__ */ e.jsxs(fe, { value: "STATIC", children: [
|
|
480
|
-
/* @__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: [
|
|
481
|
-
/* @__PURE__ */ e.jsx("div", { className: "h-[8px] w-[8px] rounded-full bg-blue-500" }),
|
|
482
|
-
"Static Content"
|
|
483
|
-
] }) }),
|
|
484
|
-
/* @__PURE__ */ e.jsxs(we, { className: "pt-4", children: [
|
|
485
|
-
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: [
|
|
486
|
-
"Data binding is set for ",
|
|
487
|
-
/* @__PURE__ */ e.jsx("b", { children: R(i, me).join(", ") }),
|
|
488
|
-
" ",
|
|
489
|
-
i.length === 1 ? "property" : "properties",
|
|
490
|
-
". Remove data binding to edit static content."
|
|
491
|
-
] }),
|
|
492
|
-
/* @__PURE__ */ e.jsx(
|
|
493
|
-
ze,
|
|
494
|
-
{
|
|
495
|
-
id: r == null ? void 0 : r._id,
|
|
496
|
-
onChange: u,
|
|
497
|
-
formData: o,
|
|
498
|
-
properties: h
|
|
499
|
-
}
|
|
500
|
-
)
|
|
501
|
-
] })
|
|
502
|
-
] })
|
|
503
|
-
] }) : /* @__PURE__ */ e.jsx(
|
|
504
|
-
ze,
|
|
505
|
-
{
|
|
506
|
-
id: r == null ? void 0 : r._id,
|
|
507
|
-
onChange: u,
|
|
508
|
-
formData: o,
|
|
509
|
-
properties: h
|
|
510
|
-
}
|
|
511
|
-
),
|
|
512
|
-
/* @__PURE__ */ e.jsx(ds, {})
|
|
513
|
-
] });
|
|
514
|
-
}
|
|
515
|
-
const ps = ({ blockId: r }) => {
|
|
516
|
-
const { t: a } = E(), { askAi: t, loading: l, error: o } = Fr(), [n, c] = j(""), p = ye(null);
|
|
517
|
-
I(() => {
|
|
518
|
-
var d;
|
|
519
|
-
(d = p.current) == null || d.focus();
|
|
520
|
-
}, []);
|
|
521
|
-
const s = () => {
|
|
522
|
-
o || c("");
|
|
523
|
-
};
|
|
524
|
-
return /* @__PURE__ */ e.jsxs("div", { className: "", children: [
|
|
525
|
-
/* @__PURE__ */ e.jsx("h2", { className: "mb-1 text-sm font-semibold leading-none tracking-tight", children: a("Ask AI") }),
|
|
526
|
-
/* @__PURE__ */ e.jsx(
|
|
527
|
-
at,
|
|
528
|
-
{
|
|
529
|
-
ref: p,
|
|
530
|
-
value: n,
|
|
531
|
-
onChange: (d) => c(d.target.value),
|
|
532
|
-
placeholder: a("Ask AI to edit styles"),
|
|
533
|
-
className: "w-full border border-gray-400 focus:border-0",
|
|
534
|
-
rows: 3,
|
|
535
|
-
onKeyDown: (d) => {
|
|
536
|
-
d.key === "Enter" && (d.preventDefault(), t("styles", r, n, s));
|
|
537
|
-
}
|
|
538
|
-
}
|
|
539
|
-
),
|
|
540
|
-
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2 my-2", children: [
|
|
541
|
-
l ? null : /* @__PURE__ */ e.jsx(
|
|
542
|
-
P,
|
|
543
|
-
{
|
|
544
|
-
disabled: n.trim().length < 5 || l,
|
|
545
|
-
onClick: () => t("styles", r, n, s),
|
|
546
|
-
variant: "default",
|
|
547
|
-
className: "w-fit",
|
|
548
|
-
size: "sm",
|
|
549
|
-
children: l ? /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
550
|
-
/* @__PURE__ */ e.jsx($r, { className: "w-5 h-5 animate-spin" }),
|
|
551
|
-
a("Generating... Please wait")
|
|
552
|
-
] }) : a("Edit with AI")
|
|
553
|
-
}
|
|
554
|
-
),
|
|
555
|
-
l ? /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col gap-2", children: [
|
|
556
|
-
/* @__PURE__ */ e.jsxs(Cr, { className: "flex items-center w-full px-4 py-1 pl-2 space-x-1", children: [
|
|
557
|
-
/* @__PURE__ */ e.jsx(Xr, { className: "w-4 h-4 text-gray-500 animate-spin" }),
|
|
558
|
-
/* @__PURE__ */ e.jsx("p", { className: "text-xs", children: a("Generating... Please wait") })
|
|
559
|
-
] }),
|
|
560
|
-
/* @__PURE__ */ e.jsx(P, { variant: "destructive", onClick: () => stop(), className: "hidden w-fit", size: "sm", children: a("Stop") })
|
|
561
|
-
] }) : null
|
|
562
|
-
] }),
|
|
563
|
-
/* @__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 }) })
|
|
564
|
-
] });
|
|
565
|
-
}, Fe = new Jr(Qr, {
|
|
566
|
-
isCaseSensitive: !1,
|
|
567
|
-
threshold: 0.2,
|
|
568
|
-
minMatchCharLength: 2,
|
|
569
|
-
keys: ["name"]
|
|
570
|
-
});
|
|
571
|
-
function ut() {
|
|
572
|
-
var N;
|
|
573
|
-
const { t: r } = E(), [a] = le(), t = M(), l = Se(), o = nt(), [n] = _e(), c = ot("askAiCallBack", null), [p, s] = j(""), { toast: d } = kr(), u = (N = oe(a)) == null ? void 0 : N.prop, i = St((g(t, u, "").replace(ts, "").split(",").pop() || "").split(" "), b), h = () => {
|
|
574
|
-
const C = p.trim().toLowerCase().replace(/ +(?= )/g, "").split(" ");
|
|
575
|
-
l(n, C, !0), s("");
|
|
576
|
-
}, [y, x] = j([]), v = ({ value: C }) => {
|
|
577
|
-
const V = C.trim().toLowerCase(), W = V.match(/.+:/g);
|
|
578
|
-
let m = [];
|
|
579
|
-
if (W && W.length > 0) {
|
|
580
|
-
const [f] = W, S = V.replace(f, "");
|
|
581
|
-
m = Fe.search(S).map((z) => ({
|
|
582
|
-
...z,
|
|
583
|
-
item: { ...z.item, name: f + z.item.name }
|
|
584
|
-
}));
|
|
585
|
-
} else
|
|
586
|
-
m = Fe.search(V);
|
|
587
|
-
return x(R(m, "item"));
|
|
588
|
-
}, k = () => {
|
|
589
|
-
x([]);
|
|
590
|
-
}, L = (C) => C.name, A = (C) => /* @__PURE__ */ e.jsx("div", { className: "rounded-md p-1", children: C.name }), Z = {
|
|
591
|
-
autoComplete: "off",
|
|
592
|
-
autoCorrect: "off",
|
|
593
|
-
autoCapitalize: "off",
|
|
594
|
-
spellCheck: !1,
|
|
595
|
-
placeholder: r("Enter classes separated by space"),
|
|
596
|
-
value: p,
|
|
597
|
-
onKeyDown: (C) => {
|
|
598
|
-
C.key === "Enter" && p.trim() !== "" && h();
|
|
599
|
-
},
|
|
600
|
-
onChange: (C, { newValue: V }) => s(V),
|
|
601
|
-
className: "w-full rounded-md text-xs px-2 hover:outline-0 bg-background border-border py-1"
|
|
602
|
-
}, w = () => {
|
|
603
|
-
if (navigator.clipboard === void 0) {
|
|
604
|
-
d({
|
|
605
|
-
title: "Clipboard not supported",
|
|
606
|
-
description: "Please use Chrome, Firefox or Safari",
|
|
607
|
-
variant: "destructive"
|
|
608
|
-
});
|
|
609
|
-
return;
|
|
610
|
-
}
|
|
611
|
-
navigator.clipboard.writeText(i.join(" ")), d({
|
|
612
|
-
title: "Copied",
|
|
613
|
-
description: "Classes copied to clipboard"
|
|
614
|
-
});
|
|
615
|
-
};
|
|
616
|
-
return /* @__PURE__ */ e.jsxs(
|
|
617
|
-
"div",
|
|
618
|
-
{
|
|
619
|
-
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`,
|
|
620
|
-
children: [
|
|
621
|
-
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center justify-between gap-x-2", children: [
|
|
622
|
-
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-x-2", children: [
|
|
623
|
-
/* @__PURE__ */ e.jsx("span", { children: r("Classes") }),
|
|
624
|
-
/* @__PURE__ */ e.jsxs(U, { children: [
|
|
625
|
-
/* @__PURE__ */ e.jsx(K, { asChild: !0, children: /* @__PURE__ */ e.jsx(Bt, { onClick: w, className: "cursor-pointer" }) }),
|
|
626
|
-
/* @__PURE__ */ e.jsx(G, { children: /* @__PURE__ */ e.jsx("p", { children: r("Copy classes to clipboard") }) })
|
|
627
|
-
] })
|
|
628
|
-
] }),
|
|
629
|
-
c ? /* @__PURE__ */ e.jsxs(Qe, { children: [
|
|
630
|
-
/* @__PURE__ */ e.jsx(et, { asChild: !0, children: /* @__PURE__ */ e.jsxs(P, { variant: "default", className: "h-6 w-fit", size: "sm", children: [
|
|
631
|
-
/* @__PURE__ */ e.jsx(Er, { className: "h-4 w-4" }),
|
|
632
|
-
/* @__PURE__ */ e.jsx("span", { className: "ml-2", children: r("Ask AI") })
|
|
633
|
-
] }) }),
|
|
634
|
-
/* @__PURE__ */ e.jsx(tt, { side: "left", className: "p-2", children: /* @__PURE__ */ e.jsx(ps, { blockId: t == null ? void 0 : t._id }) })
|
|
635
|
-
] }) : null
|
|
636
|
-
] }),
|
|
637
|
-
/* @__PURE__ */ e.jsxs("div", { className: "relative flex items-center gap-x-3", children: [
|
|
638
|
-
/* @__PURE__ */ e.jsx("div", { className: "relative flex w-full items-center gap-x-3", children: /* @__PURE__ */ e.jsx(
|
|
639
|
-
qr,
|
|
640
|
-
{
|
|
641
|
-
suggestions: y,
|
|
642
|
-
onSuggestionsFetchRequested: v,
|
|
643
|
-
onSuggestionsClearRequested: k,
|
|
644
|
-
getSuggestionValue: L,
|
|
645
|
-
renderSuggestion: A,
|
|
646
|
-
inputProps: Z,
|
|
647
|
-
containerProps: {
|
|
648
|
-
className: "relative h-8 w-full gap-y-1 py-1 border-gray-600"
|
|
649
|
-
},
|
|
650
|
-
theme: {
|
|
651
|
-
suggestion: "bg-transparent",
|
|
652
|
-
suggestionHighlighted: "!bg-gray-300 ",
|
|
653
|
-
suggestionsContainerOpen: "absolute bg-gray-100 z-50 max-h-[230px] overflow-y-auto w-full border border-gray-600 rounded-md"
|
|
654
|
-
}
|
|
655
|
-
}
|
|
656
|
-
) }),
|
|
657
|
-
/* @__PURE__ */ e.jsx(
|
|
658
|
-
P,
|
|
659
|
-
{
|
|
660
|
-
variant: "outline",
|
|
661
|
-
className: "h-6 border-gray-700",
|
|
662
|
-
onClick: h,
|
|
663
|
-
disabled: p.trim() === "",
|
|
664
|
-
size: "sm",
|
|
665
|
-
children: /* @__PURE__ */ e.jsx(Ge, {})
|
|
666
|
-
}
|
|
667
|
-
)
|
|
668
|
-
] }),
|
|
669
|
-
/* @__PURE__ */ e.jsx("div", { className: "flex w-full flex-wrap gap-2 overflow-x-hidden", children: ie.Children.toArray(
|
|
670
|
-
i.map((C) => /* @__PURE__ */ e.jsxs(
|
|
671
|
-
"div",
|
|
672
|
-
{
|
|
673
|
-
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",
|
|
674
|
-
children: [
|
|
675
|
-
C,
|
|
676
|
-
/* @__PURE__ */ e.jsx(
|
|
677
|
-
qe,
|
|
678
|
-
{
|
|
679
|
-
onClick: () => o(n, [C]),
|
|
680
|
-
className: "invisible absolute right-1 rounded-full bg-red-400 hover:text-white group-hover:visible group-hover:cursor-pointer"
|
|
681
|
-
}
|
|
682
|
-
)
|
|
683
|
-
]
|
|
684
|
-
},
|
|
685
|
-
C
|
|
686
|
-
))
|
|
687
|
-
) })
|
|
688
|
-
]
|
|
689
|
-
}
|
|
690
|
-
);
|
|
691
|
-
}
|
|
692
|
-
const us = $.memo(function({ preloadedAttributes: a = [], onAttributesChange: t }) {
|
|
693
|
-
const [l, o] = j([]), [n, c] = j(""), [p, s] = j(""), [d, u] = j(null), [i, h] = j(""), y = ye(null), x = ye(null);
|
|
694
|
-
I(() => {
|
|
695
|
-
y.current && y.current.focus();
|
|
696
|
-
}, [l]), I(() => {
|
|
697
|
-
o(a);
|
|
698
|
-
}, [a]);
|
|
699
|
-
const v = () => {
|
|
700
|
-
if (n.startsWith("@")) {
|
|
701
|
-
h("Attribute keys cannot start with '@'");
|
|
702
|
-
return;
|
|
703
|
-
}
|
|
704
|
-
if (n) {
|
|
705
|
-
const w = [...l, { key: n, value: p }];
|
|
706
|
-
t(w), o(l), c(""), s(""), h("");
|
|
707
|
-
}
|
|
708
|
-
}, k = (w) => {
|
|
709
|
-
const N = l.filter((C, V) => V !== w);
|
|
710
|
-
t(N), o(N);
|
|
711
|
-
}, L = (w) => {
|
|
712
|
-
u(w), c(l[w].key), s(l[w].value);
|
|
713
|
-
}, A = () => {
|
|
714
|
-
if (n.startsWith("@")) {
|
|
715
|
-
h("Attribute keys cannot start with '@'");
|
|
716
|
-
return;
|
|
717
|
-
}
|
|
718
|
-
if (d !== null && n) {
|
|
719
|
-
const w = [...l];
|
|
720
|
-
w[d] = { key: n, value: p }, t(w), o(w), u(null), c(""), s(""), h("");
|
|
721
|
-
}
|
|
722
|
-
}, Z = (w) => {
|
|
723
|
-
w.key === "Enter" && !w.shiftKey && (w.preventDefault(), d !== null ? A() : v());
|
|
724
|
-
};
|
|
725
|
-
return /* @__PURE__ */ e.jsxs("div", { className: "px-1", children: [
|
|
726
|
-
/* @__PURE__ */ e.jsxs(
|
|
727
|
-
"form",
|
|
728
|
-
{
|
|
729
|
-
onSubmit: (w) => {
|
|
730
|
-
w.preventDefault(), d !== null ? A() : v();
|
|
731
|
-
},
|
|
732
|
-
className: "space-y-3",
|
|
733
|
-
children: [
|
|
734
|
-
/* @__PURE__ */ e.jsxs("div", { className: "flex flex-col", children: [
|
|
735
|
-
/* @__PURE__ */ e.jsxs("div", { className: "w-full", children: [
|
|
736
|
-
/* @__PURE__ */ e.jsx(be, { htmlFor: "attrKey", className: "text-xs", children: "Key" }),
|
|
737
|
-
/* @__PURE__ */ e.jsx(
|
|
738
|
-
it,
|
|
739
|
-
{
|
|
740
|
-
autoCapitalize: "off",
|
|
741
|
-
autoCorrect: "off",
|
|
742
|
-
spellCheck: "false",
|
|
743
|
-
id: "attrKey",
|
|
744
|
-
ref: y,
|
|
745
|
-
value: n,
|
|
746
|
-
onChange: (w) => c(w.target.value),
|
|
747
|
-
placeholder: "Key",
|
|
748
|
-
className: "h-8 text-sm"
|
|
749
|
-
}
|
|
750
|
-
)
|
|
751
|
-
] }),
|
|
752
|
-
/* @__PURE__ */ e.jsxs("div", { className: "w-full", children: [
|
|
753
|
-
/* @__PURE__ */ e.jsx(be, { htmlFor: "attrValue", className: "text-xs", children: "Value" }),
|
|
754
|
-
/* @__PURE__ */ e.jsx(
|
|
755
|
-
at,
|
|
756
|
-
{
|
|
757
|
-
autoCapitalize: "off",
|
|
758
|
-
autoCorrect: "off",
|
|
759
|
-
spellCheck: "false",
|
|
760
|
-
id: "attrValue",
|
|
761
|
-
rows: 2,
|
|
762
|
-
ref: x,
|
|
763
|
-
value: p,
|
|
764
|
-
onChange: (w) => s(w.target.value),
|
|
765
|
-
onKeyDown: Z,
|
|
766
|
-
placeholder: "Value",
|
|
767
|
-
className: "bg-background text-sm"
|
|
768
|
-
}
|
|
769
|
-
)
|
|
770
|
-
] })
|
|
771
|
-
] }),
|
|
772
|
-
/* @__PURE__ */ e.jsx(P, { type: "submit", className: "h-8 w-full text-sm", children: d !== null ? "Save" : "Add" }),
|
|
773
|
-
i && /* @__PURE__ */ e.jsx("p", { className: "text-xs text-red-500", children: i })
|
|
774
|
-
]
|
|
775
|
-
}
|
|
776
|
-
),
|
|
777
|
-
/* @__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: [
|
|
778
|
-
/* @__PURE__ */ e.jsxs("div", { className: "mr-2 flex flex-col", children: [
|
|
779
|
-
/* @__PURE__ */ e.jsx("span", { className: "truncate font-semibold", children: w.key }),
|
|
780
|
-
/* @__PURE__ */ e.jsx("span", { className: "text-wrap max-w-[200px] text-muted-foreground", children: w.value.toString() })
|
|
781
|
-
] }),
|
|
782
|
-
/* @__PURE__ */ e.jsxs("div", { className: "flex-shrink-0", children: [
|
|
783
|
-
/* @__PURE__ */ e.jsxs(P, { variant: "ghost", size: "icon", className: "h-6 w-6", onClick: () => L(N), children: [
|
|
784
|
-
/* @__PURE__ */ e.jsx(Mr, { className: "h-3 w-3" }),
|
|
785
|
-
/* @__PURE__ */ e.jsx("span", { className: "sr-only", children: "Edit attribute" })
|
|
786
|
-
] }),
|
|
787
|
-
/* @__PURE__ */ e.jsxs(P, { variant: "ghost", size: "icon", className: "h-6 w-6", onClick: () => k(N), children: [
|
|
788
|
-
/* @__PURE__ */ e.jsx(Lr, { className: "h-3 w-3" }),
|
|
789
|
-
/* @__PURE__ */ e.jsx("span", { className: "sr-only", children: "Remove attribute" })
|
|
790
|
-
] })
|
|
791
|
-
] })
|
|
792
|
-
] }, N)) })
|
|
793
|
-
] });
|
|
794
|
-
}), gs = ie.memo(() => {
|
|
795
|
-
const r = M(), [a, t] = j([]), [l] = le(), o = rt(), n = st(), c = `${g(l, "0.prop")}_attrs`;
|
|
796
|
-
ie.useEffect(() => {
|
|
797
|
-
const s = R(g(r, c), (d, u) => ({ key: u, value: d }));
|
|
798
|
-
b(s) ? t([]) : t(s);
|
|
799
|
-
}, [g(r, c)]);
|
|
800
|
-
const p = ie.useCallback(
|
|
801
|
-
(s = []) => {
|
|
802
|
-
const d = {};
|
|
803
|
-
ke(s, (u) => {
|
|
804
|
-
b(u.key) || Ue(d, u.key, u.value);
|
|
805
|
-
}), n([g(r, "_id")], { [c]: d });
|
|
806
|
-
},
|
|
807
|
-
[r, o, c]
|
|
808
|
-
);
|
|
809
|
-
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 }) }) }) });
|
|
810
|
-
}), _ = ["px", "%", "em", "rem", "ch", "vh", "vw"], xs = {
|
|
811
|
-
heading: "flex.heading",
|
|
812
|
-
items: [
|
|
813
|
-
{ type: "arbitrary", label: "flex.basis", units: _, property: "flexBasis" },
|
|
814
|
-
{ type: "range", label: "flex.order", property: "order" },
|
|
815
|
-
{ type: "dropdown", label: "flex.flex", property: "flexGrowShrink" },
|
|
816
|
-
{ type: "dropdown", label: "flex.grow", property: "flexGrow" },
|
|
817
|
-
{ type: "dropdown", label: "flex.shrink", property: "flexShrink" }
|
|
818
|
-
]
|
|
819
|
-
}, ys = {
|
|
820
|
-
heading: "grid.heading",
|
|
821
|
-
items: [
|
|
822
|
-
{ type: "range", label: "grid.col_span", property: "gridColSpan" },
|
|
823
|
-
{ type: "range", label: "grid.col_start", property: "gridColStart" },
|
|
824
|
-
{ type: "range", label: "grid.col_end", property: "gridColEnd" },
|
|
825
|
-
{ type: "range", label: "grid.row_span", property: "gridRowSpan" },
|
|
826
|
-
{ type: "range", label: "grid.row_start", property: "gridRowStart" },
|
|
827
|
-
{ type: "range", label: "grid.row_end", property: "gridRowEnd" },
|
|
828
|
-
{ type: "range", label: "grid.order", property: "order" }
|
|
829
|
-
]
|
|
830
|
-
}, hs = [
|
|
831
|
-
{
|
|
832
|
-
heading: "Styles",
|
|
833
|
-
items: [
|
|
834
|
-
{ component: ut },
|
|
835
|
-
{ type: "arbitrary", label: "layout.width", units: _.concat("auto"), property: "width" },
|
|
836
|
-
{ type: "arbitrary", label: "layout.height", units: _.concat("auto"), property: "height" },
|
|
837
|
-
{
|
|
838
|
-
styleType: "multiple",
|
|
839
|
-
label: "layout.margin",
|
|
840
|
-
negative: !0,
|
|
841
|
-
units: [..._, "auto"],
|
|
842
|
-
options: [
|
|
843
|
-
{ key: "margin", label: "layout.margin_all" },
|
|
844
|
-
{ key: "marginX", label: "layout.margin_lr" },
|
|
845
|
-
{ key: "marginY", label: "layout.margin_tb" },
|
|
846
|
-
{ key: "marginTop", label: "layout.margin_top" },
|
|
847
|
-
{ key: "marginRight", label: "layout.margin_right" },
|
|
848
|
-
{ key: "marginBottom", label: "layout.margin_bottom" },
|
|
849
|
-
{ key: "marginLeft", label: "layout.margin_left" }
|
|
850
|
-
]
|
|
851
|
-
},
|
|
852
|
-
{
|
|
853
|
-
styleType: "multiple",
|
|
854
|
-
label: "layout.padding",
|
|
855
|
-
options: [
|
|
856
|
-
{ key: "padding", label: "layout.padding_all" },
|
|
857
|
-
{ key: "paddingX", label: "layout.padding_lr" },
|
|
858
|
-
{ key: "paddingY", label: "layout.padding_tb" },
|
|
859
|
-
{ key: "paddingTop", label: "layout.padding_top" },
|
|
860
|
-
{ key: "paddingRight", label: "layout.padding_right" },
|
|
861
|
-
{ key: "paddingBottom", label: "layout.padding_bottom" },
|
|
862
|
-
{ key: "paddingLeft", label: "layout.padding_left" }
|
|
863
|
-
]
|
|
864
|
-
},
|
|
865
|
-
{
|
|
866
|
-
styleType: "accordion",
|
|
867
|
-
heading: "Typography",
|
|
868
|
-
items: [
|
|
869
|
-
{ type: "dropdown", property: "textAlign", label: "typography.align" },
|
|
870
|
-
{ 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: _.concat("-") },
|
|
873
|
-
{ type: "range", property: "fontWeight", label: "typography.weight" },
|
|
874
|
-
{ type: "color", property: "textColor", label: "typography.color" }
|
|
875
|
-
]
|
|
876
|
-
},
|
|
877
|
-
{
|
|
878
|
-
styleType: "accordion",
|
|
879
|
-
heading: "Background",
|
|
880
|
-
items: [
|
|
881
|
-
{ type: "color", label: "background.bgcolor", property: "backgroundColor" },
|
|
882
|
-
{ type: "dropdown", label: "background.attachment", property: "backgroundAttachment" },
|
|
883
|
-
{ type: "dropdown", label: "background.clipping", property: "backgroundClip" },
|
|
884
|
-
{ type: "dropdown", label: "background.origin", property: "backgroundOrigin" },
|
|
885
|
-
{ type: "dropdown", label: "background.position", property: "backgroundPosition" },
|
|
886
|
-
{ type: "dropdown", label: "background.repeat", property: "backgroundRepeat" },
|
|
887
|
-
{ type: "dropdown", label: "background.size", property: "backgroundSize" }
|
|
888
|
-
]
|
|
889
|
-
}
|
|
890
|
-
]
|
|
891
|
-
},
|
|
892
|
-
{
|
|
893
|
-
heading: "Attributes",
|
|
894
|
-
items: [{ component: gs }]
|
|
895
|
-
}
|
|
896
|
-
], $o = [
|
|
897
|
-
{
|
|
898
|
-
heading: "layout.heading",
|
|
899
|
-
items: [
|
|
900
|
-
{ type: "arbitrary", label: "layout.width", units: _.concat("auto"), property: "width" },
|
|
901
|
-
{ type: "arbitrary", label: "layout.height", units: _.concat("auto"), property: "height" },
|
|
902
|
-
{
|
|
903
|
-
styleType: "multiple",
|
|
904
|
-
label: "layout.margin",
|
|
905
|
-
negative: !0,
|
|
906
|
-
units: [..._, "auto"],
|
|
907
|
-
options: [
|
|
908
|
-
{ key: "margin", label: "layout.margin_all" },
|
|
909
|
-
{ key: "marginX", label: "layout.margin_lr" },
|
|
910
|
-
{ key: "marginY", label: "layout.margin_tb" },
|
|
911
|
-
{ key: "marginTop", label: "layout.margin_top" },
|
|
912
|
-
{ key: "marginRight", label: "layout.margin_right" },
|
|
913
|
-
{ key: "marginBottom", label: "layout.margin_bottom" },
|
|
914
|
-
{ key: "marginLeft", label: "layout.margin_left" }
|
|
915
|
-
]
|
|
916
|
-
},
|
|
917
|
-
{
|
|
918
|
-
styleType: "multiple",
|
|
919
|
-
label: "layout.padding",
|
|
920
|
-
options: [
|
|
921
|
-
{ key: "padding", label: "layout.padding_all" },
|
|
922
|
-
{ key: "paddingX", label: "layout.padding_lr" },
|
|
923
|
-
{ key: "paddingY", label: "layout.padding_tb" },
|
|
924
|
-
{ key: "paddingTop", label: "layout.padding_top" },
|
|
925
|
-
{ key: "paddingRight", label: "layout.padding_right" },
|
|
926
|
-
{ key: "paddingBottom", label: "layout.padding_bottom" },
|
|
927
|
-
{ key: "paddingLeft", label: "layout.padding_left" }
|
|
928
|
-
]
|
|
929
|
-
},
|
|
930
|
-
{
|
|
931
|
-
styleType: "multiple",
|
|
932
|
-
label: "layout.space_bt",
|
|
933
|
-
options: [
|
|
934
|
-
{ key: "spaceX", label: "layout.space_lr" },
|
|
935
|
-
{ key: "spaceY", label: "layout.space_tb" }
|
|
936
|
-
]
|
|
937
|
-
}
|
|
938
|
-
]
|
|
939
|
-
},
|
|
940
|
-
{
|
|
941
|
-
heading: "size.heading",
|
|
942
|
-
items: [
|
|
943
|
-
{
|
|
944
|
-
styleType: "accordion",
|
|
945
|
-
heading: "size.min_width_height",
|
|
946
|
-
items: [
|
|
947
|
-
{ type: "arbitrary", label: "size.min_width", units: _.concat("auto"), property: "minWidth" },
|
|
948
|
-
{ type: "arbitrary", label: "size.min_height", units: _.concat("auto"), property: "minHeight" }
|
|
949
|
-
]
|
|
950
|
-
},
|
|
951
|
-
{
|
|
952
|
-
styleType: "accordion",
|
|
953
|
-
heading: "size.max_width_height",
|
|
954
|
-
items: [
|
|
955
|
-
{ type: "arbitrary", label: "size.max_width", units: _.concat("auto"), property: "maxWidth" },
|
|
956
|
-
{ type: "arbitrary", label: "size.max_height", units: _.concat("auto"), property: "maxHeight" }
|
|
957
|
-
]
|
|
958
|
-
},
|
|
959
|
-
{
|
|
960
|
-
styleType: "accordion",
|
|
961
|
-
heading: "size.object_options_aspect_ratio",
|
|
962
|
-
items: [
|
|
963
|
-
{ type: "dropdown", label: "size.aspect", property: "aspectRatio" },
|
|
964
|
-
{ type: "dropdown", label: "size.fit", property: "objectFit" },
|
|
965
|
-
{ type: "dropdown", label: "size.position", property: "objectPosition" }
|
|
966
|
-
]
|
|
967
|
-
}
|
|
968
|
-
]
|
|
969
|
-
},
|
|
970
|
-
{
|
|
971
|
-
heading: "display.heading",
|
|
972
|
-
items: [
|
|
973
|
-
{ type: "dropdown", label: "display.display", property: "display", units: _ },
|
|
974
|
-
{
|
|
975
|
-
styleType: "accordion",
|
|
976
|
-
heading: "display.flex_options",
|
|
977
|
-
items: [
|
|
978
|
-
{ type: "dropdown", label: "display.flex_direction", property: "flexDirection" },
|
|
979
|
-
{ type: "dropdown", label: "display.flex_wrap", property: "flexWrap" },
|
|
980
|
-
{ type: "dropdown", label: "display.justify_content", property: "justifyContent" },
|
|
981
|
-
{ type: "dropdown", label: "display.align_content", property: "alignContent" },
|
|
982
|
-
{ type: "dropdown", label: "display.align_items", property: "alignItems" },
|
|
983
|
-
{
|
|
984
|
-
styleType: "multiple",
|
|
985
|
-
label: "display.gap",
|
|
986
|
-
options: [
|
|
987
|
-
{ key: "gap", label: "display.gap_all" },
|
|
988
|
-
{ key: "gapX", label: "display.gap_lr" },
|
|
989
|
-
{ key: "gapY", label: "display.gap_tb" }
|
|
990
|
-
]
|
|
991
|
-
}
|
|
992
|
-
],
|
|
993
|
-
conditions: { display: "flex" }
|
|
994
|
-
},
|
|
995
|
-
{
|
|
996
|
-
styleType: "accordion",
|
|
997
|
-
heading: "display.grid_options",
|
|
998
|
-
items: [
|
|
999
|
-
{ type: "range", label: "display.grid_columns", property: "gridColumns" },
|
|
1000
|
-
{ type: "range", label: "display.grid_rows", property: "gridRows" },
|
|
1001
|
-
{ type: "dropdown", label: "display.grid_auto_flow", property: "gridAutoFlow" },
|
|
1002
|
-
{ type: "dropdown", label: "display.grid_auto_cols", property: "gridAutoColumns" },
|
|
1003
|
-
{ type: "dropdown", label: "display.grid_auto_rows", property: "gridAutoRows" },
|
|
1004
|
-
{ type: "dropdown", label: "display.justify_content", property: "justifyContent" },
|
|
1005
|
-
{ type: "dropdown", label: "display.align_content", property: "alignContent" },
|
|
1006
|
-
{ type: "dropdown", label: "display.align_items", property: "alignItems" },
|
|
1007
|
-
{
|
|
1008
|
-
styleType: "multiple",
|
|
1009
|
-
label: "display.gap",
|
|
1010
|
-
units: ["px", "rem"],
|
|
1011
|
-
options: [
|
|
1012
|
-
{ key: "gap", label: "display.gap_all" },
|
|
1013
|
-
{ key: "gapX", label: "display.gap_lr" },
|
|
1014
|
-
{ key: "gapY", label: "display.gap_tb" }
|
|
1015
|
-
]
|
|
1016
|
-
}
|
|
1017
|
-
],
|
|
1018
|
-
conditions: { display: "grid" }
|
|
1019
|
-
},
|
|
1020
|
-
{
|
|
1021
|
-
styleType: "accordion",
|
|
1022
|
-
heading: "display.visibility_opacity",
|
|
1023
|
-
items: [
|
|
1024
|
-
{ type: "dropdown", label: "display.visibility", property: "visibility", units: _ },
|
|
1025
|
-
{ type: "arbitrary", label: "display.opacity", property: "opacity", units: ["-"] }
|
|
1026
|
-
]
|
|
1027
|
-
}
|
|
1028
|
-
]
|
|
1029
|
-
},
|
|
1030
|
-
{
|
|
1031
|
-
heading: "position.heading",
|
|
1032
|
-
items: [
|
|
1033
|
-
{ type: "icons", label: "position.position", property: "position" },
|
|
1034
|
-
{
|
|
1035
|
-
styleType: "accordion",
|
|
1036
|
-
heading: "position.options",
|
|
1037
|
-
items: [
|
|
1038
|
-
{
|
|
1039
|
-
styleType: "multiple",
|
|
1040
|
-
label: "position.direction",
|
|
1041
|
-
options: [
|
|
1042
|
-
{ key: "top", label: "position.top" },
|
|
1043
|
-
{ key: "right", label: "position.right" },
|
|
1044
|
-
{ key: "bottom", label: "position.bottom" },
|
|
1045
|
-
{ key: "left", label: "position.left" }
|
|
1046
|
-
]
|
|
1047
|
-
},
|
|
1048
|
-
{
|
|
1049
|
-
styleType: "multiple",
|
|
1050
|
-
label: "position.inset",
|
|
1051
|
-
options: [
|
|
1052
|
-
{ key: "inset", label: "position.all" },
|
|
1053
|
-
{ key: "insetX", label: "position.lr" },
|
|
1054
|
-
{ key: "insetY", label: "position.tb" }
|
|
1055
|
-
]
|
|
1056
|
-
},
|
|
1057
|
-
{ type: "arbitrary", label: "position.z_index", units: ["-", "auto"], property: "zIndex" }
|
|
1058
|
-
]
|
|
1059
|
-
},
|
|
1060
|
-
{
|
|
1061
|
-
styleType: "accordion",
|
|
1062
|
-
heading: "position.float_clear",
|
|
1063
|
-
items: [
|
|
1064
|
-
{ type: "icons", label: "position.float", property: "float" },
|
|
1065
|
-
{ type: "dropdown", label: "position.clear", property: "clear" }
|
|
1066
|
-
]
|
|
1067
|
-
},
|
|
1068
|
-
{
|
|
1069
|
-
styleType: "accordion",
|
|
1070
|
-
heading: "position.overflow_overscroll",
|
|
1071
|
-
items: [
|
|
1072
|
-
{
|
|
1073
|
-
styleType: "multiple",
|
|
1074
|
-
type: "dropdown",
|
|
1075
|
-
label: "position.overflow",
|
|
1076
|
-
options: [
|
|
1077
|
-
{ key: "overflow", label: "position.all" },
|
|
1078
|
-
{ key: "overflowX", label: "position.lr" },
|
|
1079
|
-
{ key: "overflowY", label: "position.tb" }
|
|
1080
|
-
]
|
|
1081
|
-
},
|
|
1082
|
-
{
|
|
1083
|
-
styleType: "multiple",
|
|
1084
|
-
type: "dropdown",
|
|
1085
|
-
label: "position.overscroll",
|
|
1086
|
-
options: [
|
|
1087
|
-
{ key: "overscroll", label: "position.all" },
|
|
1088
|
-
{ key: "overscrollX", label: "position.lr" },
|
|
1089
|
-
{ key: "overscrollY", label: "position.tb" }
|
|
1090
|
-
]
|
|
1091
|
-
}
|
|
1092
|
-
]
|
|
1093
|
-
}
|
|
1094
|
-
]
|
|
1095
|
-
},
|
|
1096
|
-
{
|
|
1097
|
-
heading: "typography.heading",
|
|
1098
|
-
items: [
|
|
1099
|
-
{ 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: _.concat("-") },
|
|
1102
|
-
{ type: "range", property: "fontWeight", label: "typography.weight" },
|
|
1103
|
-
{ type: "color", property: "textColor", label: "typography.color" },
|
|
1104
|
-
{
|
|
1105
|
-
styleType: "accordion",
|
|
1106
|
-
heading: "typography.alignments",
|
|
1107
|
-
items: [
|
|
1108
|
-
{ type: "dropdown", property: "textAlign", label: "typography.align" },
|
|
1109
|
-
{ type: "dropdown", property: "verticalAlign", label: "typography.valign" }
|
|
1110
|
-
]
|
|
1111
|
-
},
|
|
1112
|
-
{
|
|
1113
|
-
styleType: "accordion",
|
|
1114
|
-
heading: "typography.spacing_decoration_more",
|
|
1115
|
-
items: [
|
|
1116
|
-
{ type: "dropdown", property: "letterSpacing", label: "typography.spacing" },
|
|
1117
|
-
{ type: "dropdown", property: "textDecoration", label: "typography.decoration" },
|
|
1118
|
-
{ type: "range", property: "textDecorationThickness", label: "typography.thickness" },
|
|
1119
|
-
{ type: "dropdown", property: "textTransform", label: "typography.transform" }
|
|
1120
|
-
]
|
|
1121
|
-
},
|
|
1122
|
-
{
|
|
1123
|
-
styleType: "accordion",
|
|
1124
|
-
heading: "typography.whitespace_breaks",
|
|
1125
|
-
items: [
|
|
1126
|
-
{ type: "dropdown", property: "whitespace", label: "typography.whitespace" },
|
|
1127
|
-
{ type: "dropdown", property: "wordbreak", label: "typography.wordbreak" }
|
|
1128
|
-
]
|
|
1129
|
-
}
|
|
1130
|
-
]
|
|
1131
|
-
},
|
|
1132
|
-
{
|
|
1133
|
-
heading: "background.heading",
|
|
1134
|
-
items: [
|
|
1135
|
-
{ type: "color", label: "background.bgcolor", property: "backgroundColor" },
|
|
1136
|
-
{
|
|
1137
|
-
styleType: "accordion",
|
|
1138
|
-
heading: "background.position_size_more",
|
|
1139
|
-
items: [
|
|
1140
|
-
{ type: "dropdown", label: "background.attachment", property: "backgroundAttachment" },
|
|
1141
|
-
{ type: "dropdown", label: "background.clipping", property: "backgroundClip" },
|
|
1142
|
-
{ type: "dropdown", label: "background.origin", property: "backgroundOrigin" },
|
|
1143
|
-
{ type: "dropdown", label: "background.position", property: "backgroundPosition" },
|
|
1144
|
-
{ type: "dropdown", label: "background.repeat", property: "backgroundRepeat" },
|
|
1145
|
-
{ type: "dropdown", label: "background.size", property: "backgroundSize" }
|
|
1146
|
-
]
|
|
1147
|
-
},
|
|
1148
|
-
{ type: "dropdown", label: "background.gradient", property: "backgroundGradient" },
|
|
1149
|
-
{
|
|
1150
|
-
styleType: "accordion",
|
|
1151
|
-
heading: "background.gradient_colors",
|
|
1152
|
-
items: [
|
|
1153
|
-
{ type: "color", label: "background.from_color", property: "fromColor" },
|
|
1154
|
-
{ type: "color", label: "background.via_color", property: "viaColor" },
|
|
1155
|
-
{ type: "color", label: "background.to_color", property: "toColor" }
|
|
1156
|
-
]
|
|
1157
|
-
}
|
|
1158
|
-
]
|
|
1159
|
-
},
|
|
1160
|
-
{
|
|
1161
|
-
heading: "border.heading",
|
|
1162
|
-
items: [
|
|
1163
|
-
{
|
|
1164
|
-
styleType: "multiple",
|
|
1165
|
-
type: "dropdown",
|
|
1166
|
-
label: "border.width",
|
|
1167
|
-
options: [
|
|
1168
|
-
{ key: "border", label: "border.all" },
|
|
1169
|
-
{ key: "borderX", label: "border.lr" },
|
|
1170
|
-
{ key: "borderY", label: "border.tb" },
|
|
1171
|
-
{ key: "borderTop", label: "border.top" },
|
|
1172
|
-
{ key: "borderRight", label: "border.right" },
|
|
1173
|
-
{ key: "borderBottom", label: "border.bottom" },
|
|
1174
|
-
{ key: "borderLeft", label: "border.left" }
|
|
1175
|
-
]
|
|
1176
|
-
},
|
|
1177
|
-
{
|
|
1178
|
-
styleType: "multiple",
|
|
1179
|
-
type: "dropdown",
|
|
1180
|
-
label: "border.corners",
|
|
1181
|
-
options: [
|
|
1182
|
-
{ key: "borderRadius", label: "border.all" },
|
|
1183
|
-
{ key: "borderRadiusTop", label: "border.top" },
|
|
1184
|
-
{ key: "borderRadiusRight", label: "border.right" },
|
|
1185
|
-
{ key: "borderRadiusBottom", label: "border.bottom" },
|
|
1186
|
-
{ key: "borderRadiusLeft", label: "border.left" },
|
|
1187
|
-
{ key: "borderRadiusTopLeft", label: "border.top_left" },
|
|
1188
|
-
{ key: "borderRadiusTopRight", label: "border.top_right" },
|
|
1189
|
-
{ key: "borderRadiusBottomRight", label: "border.bottom_right" },
|
|
1190
|
-
{ key: "borderRadiusBottomLeft", label: "border.bottom_left" }
|
|
1191
|
-
]
|
|
1192
|
-
},
|
|
1193
|
-
{ type: "color", label: "border.color", property: "borderColor" },
|
|
1194
|
-
{ type: "dropdown", label: "border.style", property: "borderStyle" },
|
|
1195
|
-
{
|
|
1196
|
-
styleType: "accordion",
|
|
1197
|
-
heading: "border.divide_options",
|
|
1198
|
-
items: [
|
|
1199
|
-
{
|
|
1200
|
-
styleType: "multiple",
|
|
1201
|
-
type: "range",
|
|
1202
|
-
label: "border.width",
|
|
1203
|
-
options: [
|
|
1204
|
-
{ key: "divideXWidth", label: "border.lr" },
|
|
1205
|
-
{ key: "divideYWidth", label: "border.tb" }
|
|
1206
|
-
]
|
|
1207
|
-
},
|
|
1208
|
-
{ type: "color", label: "border.divide_color", property: "divideColor" },
|
|
1209
|
-
{ type: "dropdown", label: "border.divide_style", property: "divideStyle" }
|
|
1210
|
-
]
|
|
1211
|
-
},
|
|
1212
|
-
{
|
|
1213
|
-
styleType: "accordion",
|
|
1214
|
-
heading: "border.outline_styling",
|
|
1215
|
-
items: [
|
|
1216
|
-
{ type: "range", label: "border.outline_width", property: "outlineWidth" },
|
|
1217
|
-
{ type: "range", label: "border.outline_offset", property: "outlineOffset" },
|
|
1218
|
-
{ type: "dropdown", label: "border.outline_style", property: "outlineStyle" }
|
|
1219
|
-
]
|
|
1220
|
-
},
|
|
1221
|
-
{
|
|
1222
|
-
styleType: "accordion",
|
|
1223
|
-
heading: "border.ring_options",
|
|
1224
|
-
items: [
|
|
1225
|
-
{ type: "range", label: "border.ring_width", property: "ringWidth" },
|
|
1226
|
-
{ type: "color", label: "border.ring_color", property: "ringColor" },
|
|
1227
|
-
{ type: "range", label: "border.ring_offset_width", property: "ringOffsetWidth" },
|
|
1228
|
-
{ type: "color", label: "border.ring_offset_color", property: "ringOffsetColor" }
|
|
1229
|
-
]
|
|
1230
|
-
}
|
|
1231
|
-
]
|
|
1232
|
-
},
|
|
1233
|
-
{
|
|
1234
|
-
heading: "effect.heading",
|
|
1235
|
-
items: [
|
|
1236
|
-
{ type: "range", label: "effect.shadow", property: "boxShadow" },
|
|
1237
|
-
{ type: "color", label: "effect.color", property: "boxShadowColor" },
|
|
1238
|
-
{ type: "dropdown", label: "effect.cursor", property: "cursor" },
|
|
1239
|
-
{
|
|
1240
|
-
styleType: "accordion",
|
|
1241
|
-
heading: "effect.blend_cursor",
|
|
1242
|
-
items: [
|
|
1243
|
-
{ type: "dropdown", label: "effect.mix_blend", property: "mixBlendMode" },
|
|
1244
|
-
{ type: "dropdown", label: "effect.bg_blend", property: "bgBlendMode" }
|
|
1245
|
-
]
|
|
1246
|
-
},
|
|
1247
|
-
{
|
|
1248
|
-
styleType: "accordion",
|
|
1249
|
-
heading: "effect.transform",
|
|
1250
|
-
items: [
|
|
1251
|
-
{ type: "dropdown", label: "effect.origin", property: "transformOrigin" },
|
|
1252
|
-
{
|
|
1253
|
-
styleType: "multiple",
|
|
1254
|
-
label: "effect.scale",
|
|
1255
|
-
units: ["-"],
|
|
1256
|
-
options: [
|
|
1257
|
-
{ key: "scale", label: "effect.all" },
|
|
1258
|
-
{ key: "scaleX", label: "effect.lr" },
|
|
1259
|
-
{ key: "scaleY", label: "effect.tb" }
|
|
1260
|
-
]
|
|
1261
|
-
},
|
|
1262
|
-
{
|
|
1263
|
-
styleType: "multiple",
|
|
1264
|
-
label: "effect.skew",
|
|
1265
|
-
units: ["deg"],
|
|
1266
|
-
options: [
|
|
1267
|
-
{ key: "skewX", label: "effect.lr" },
|
|
1268
|
-
{ key: "skewY", label: "effect.tb" }
|
|
1269
|
-
]
|
|
1270
|
-
},
|
|
1271
|
-
{
|
|
1272
|
-
styleType: "multiple",
|
|
1273
|
-
label: "effect.translate",
|
|
1274
|
-
negative: !0,
|
|
1275
|
-
options: [
|
|
1276
|
-
{ key: "translateX", label: "effect.lr" },
|
|
1277
|
-
{ key: "translateY", label: "effect.tb" }
|
|
1278
|
-
]
|
|
1279
|
-
},
|
|
1280
|
-
{ type: "arbitrary", units: ["deg"], negative: !0, label: "effect.rotate", property: "rotate" }
|
|
1281
|
-
]
|
|
1282
|
-
},
|
|
1283
|
-
{
|
|
1284
|
-
styleType: "accordion",
|
|
1285
|
-
heading: "effect.animation",
|
|
1286
|
-
items: [
|
|
1287
|
-
{ type: "dropdown", label: "effect.animation", property: "animation" },
|
|
1288
|
-
{ type: "dropdown", label: "effect.transition", property: "transition" },
|
|
1289
|
-
{ type: "dropdown", label: "effect.easing", property: "transitionEase" },
|
|
1290
|
-
{ type: "arbitrary", units: ["ms"], label: "effect.duration", property: "duration" },
|
|
1291
|
-
{ type: "arbitrary", units: ["ms"], label: "effect.delay", property: "delay" }
|
|
1292
|
-
]
|
|
1293
|
-
}
|
|
1294
|
-
]
|
|
1295
|
-
},
|
|
1296
|
-
{
|
|
1297
|
-
heading: "classes.heading",
|
|
1298
|
-
items: [{ component: ut }]
|
|
1299
|
-
}
|
|
1300
|
-
], gt = {
|
|
1301
|
-
"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
|
-
// visibility
|
|
1303
|
-
visible: At,
|
|
1304
|
-
invisible: Be,
|
|
1305
|
-
// display
|
|
1306
|
-
hidden: Be,
|
|
1307
|
-
gap: F,
|
|
1308
|
-
gapX: H,
|
|
1309
|
-
gapY: D,
|
|
1310
|
-
spaceX: H,
|
|
1311
|
-
spaceY: D,
|
|
1312
|
-
overscroll: F,
|
|
1313
|
-
overscrollX: H,
|
|
1314
|
-
overscrollY: D,
|
|
1315
|
-
overflow: F,
|
|
1316
|
-
overflowX: H,
|
|
1317
|
-
overflowY: D,
|
|
1318
|
-
top: J,
|
|
1319
|
-
right: Q,
|
|
1320
|
-
bottom: ee,
|
|
1321
|
-
left: te,
|
|
1322
|
-
inset: F,
|
|
1323
|
-
insetX: H,
|
|
1324
|
-
insetY: D,
|
|
1325
|
-
border: F,
|
|
1326
|
-
borderX: H,
|
|
1327
|
-
borderY: D,
|
|
1328
|
-
borderTop: J,
|
|
1329
|
-
borderRight: Q,
|
|
1330
|
-
borderBottom: ee,
|
|
1331
|
-
borderLeft: te,
|
|
1332
|
-
borderRadius: F,
|
|
1333
|
-
borderRadiusX: H,
|
|
1334
|
-
borderRadiusY: D,
|
|
1335
|
-
borderRadiusTop: J,
|
|
1336
|
-
borderRadiusRight: Q,
|
|
1337
|
-
borderRadiusBottom: ee,
|
|
1338
|
-
borderRadiusLeft: te,
|
|
1339
|
-
borderRadiusTopLeft: It,
|
|
1340
|
-
borderRadiusTopRight: Pt,
|
|
1341
|
-
borderRadiusBottomRight: $t,
|
|
1342
|
-
borderRadiusBottomLeft: Et,
|
|
1343
|
-
divideXWidth: H,
|
|
1344
|
-
divideYWidth: D,
|
|
1345
|
-
scale: F,
|
|
1346
|
-
scaleX: H,
|
|
1347
|
-
scaleY: D,
|
|
1348
|
-
skewX: H,
|
|
1349
|
-
skewY: D,
|
|
1350
|
-
translateX: H,
|
|
1351
|
-
translateY: D,
|
|
1352
|
-
// padding
|
|
1353
|
-
padding: F,
|
|
1354
|
-
paddingX: H,
|
|
1355
|
-
paddingY: D,
|
|
1356
|
-
paddingTop: J,
|
|
1357
|
-
paddingRight: Q,
|
|
1358
|
-
paddingBottom: ee,
|
|
1359
|
-
paddingLeft: te,
|
|
1360
|
-
// margin
|
|
1361
|
-
margin: F,
|
|
1362
|
-
marginX: H,
|
|
1363
|
-
marginY: D,
|
|
1364
|
-
marginTop: J,
|
|
1365
|
-
marginRight: Q,
|
|
1366
|
-
marginBottom: ee,
|
|
1367
|
-
marginLeft: te,
|
|
1368
|
-
// text-align
|
|
1369
|
-
textLeft: Mt,
|
|
1370
|
-
textCenter: Lt,
|
|
1371
|
-
textRight: Ot,
|
|
1372
|
-
textJustify: zt,
|
|
1373
|
-
// font style
|
|
1374
|
-
italic: Ft,
|
|
1375
|
-
// "not-italic": "",
|
|
1376
|
-
// decoration
|
|
1377
|
-
underline: Xt,
|
|
1378
|
-
overline: Yt,
|
|
1379
|
-
// transform
|
|
1380
|
-
uppercase: Zt,
|
|
1381
|
-
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
|
-
/* @__PURE__ */ e.jsx(
|
|
1383
|
-
"path",
|
|
1384
|
-
{
|
|
1385
|
-
opacity: "0.6",
|
|
1386
|
-
fillRule: "evenodd",
|
|
1387
|
-
clipRule: "evenodd",
|
|
1388
|
-
d: "M2 2H14V14H2V2ZM1 1H15V15H1V1Z",
|
|
1389
|
-
fill: "currentColor"
|
|
1390
|
-
}
|
|
1391
|
-
),
|
|
1392
|
-
/* @__PURE__ */ e.jsx("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M7 4H4V12H7V4ZM9 4H12V12H9V4Z", fill: "currentColor" })
|
|
1393
|
-
] }),
|
|
1394
|
-
// floats
|
|
1395
|
-
"float-right": () => /* @__PURE__ */ e.jsxs("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [
|
|
1396
|
-
/* @__PURE__ */ e.jsx("path", { d: "M8 4H16V12H8V4Z", fill: "currentColor" }),
|
|
1397
|
-
/* @__PURE__ */ e.jsx(
|
|
1398
|
-
"path",
|
|
1399
|
-
{
|
|
1400
|
-
opacity: "0.6",
|
|
1401
|
-
fillRule: "evenodd",
|
|
1402
|
-
clipRule: "evenodd",
|
|
1403
|
-
d: "M0 4H6V6H0V4ZM0 7H6V9H0V7ZM4 10H0V12H4V10Z",
|
|
1404
|
-
fill: "currentColor"
|
|
1405
|
-
}
|
|
1406
|
-
)
|
|
1407
|
-
] }),
|
|
1408
|
-
"float-left": () => /* @__PURE__ */ e.jsxs("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [
|
|
1409
|
-
/* @__PURE__ */ e.jsx("path", { d: "M0 4H8V12H0V4Z", fill: "currentColor" }),
|
|
1410
|
-
/* @__PURE__ */ e.jsx(
|
|
1411
|
-
"path",
|
|
1412
|
-
{
|
|
1413
|
-
opacity: "0.6",
|
|
1414
|
-
fillRule: "evenodd",
|
|
1415
|
-
clipRule: "evenodd",
|
|
1416
|
-
d: "M10 4H16V6H10V4ZM10 7H16V9H10V7ZM14 10H10V12H14V10Z",
|
|
1417
|
-
fill: "currentColor"
|
|
1418
|
-
}
|
|
1419
|
-
)
|
|
1420
|
-
] }),
|
|
1421
|
-
"float-none": qe,
|
|
1422
|
-
// position
|
|
1423
|
-
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
|
-
/* @__PURE__ */ e.jsx(
|
|
1425
|
-
"path",
|
|
1426
|
-
{
|
|
1427
|
-
opacity: "0.6",
|
|
1428
|
-
fillRule: "evenodd",
|
|
1429
|
-
clipRule: "evenodd",
|
|
1430
|
-
d: "M15 2H14V4H13V5H14V6H15V2ZM10 5V4H9V2H1V8H2V5H10ZM7 4V3H5V4H7ZM4 4V3H2V4H4ZM1 13H7V14H1V13Z",
|
|
1431
|
-
fill: "currentColor"
|
|
1432
|
-
}
|
|
1433
|
-
),
|
|
1434
|
-
/* @__PURE__ */ e.jsx(
|
|
1435
|
-
"path",
|
|
1436
|
-
{
|
|
1437
|
-
fillRule: "evenodd",
|
|
1438
|
-
clipRule: "evenodd",
|
|
1439
|
-
d: "M11 2H10V3H11V6H12V3H13V2H11ZM2 9H1V12H2V11H7V10H2V9ZM15 7H8V14H15V7Z",
|
|
1440
|
-
fill: "currentColor"
|
|
1441
|
-
}
|
|
1442
|
-
)
|
|
1443
|
-
] }),
|
|
1444
|
-
absolute: () => /* @__PURE__ */ e.jsxs("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [
|
|
1445
|
-
/* @__PURE__ */ e.jsx(
|
|
1446
|
-
"path",
|
|
1447
|
-
{
|
|
1448
|
-
opacity: "0.6",
|
|
1449
|
-
fillRule: "evenodd",
|
|
1450
|
-
clipRule: "evenodd",
|
|
1451
|
-
d: "M14 2H15V6H14V2ZM9 3V2H1V8H2V3H9ZM7 13H1V14H7V13Z",
|
|
1452
|
-
fill: "currentColor"
|
|
1453
|
-
}
|
|
1454
|
-
),
|
|
1455
|
-
/* @__PURE__ */ e.jsx(
|
|
1456
|
-
"path",
|
|
1457
|
-
{
|
|
1458
|
-
fillRule: "evenodd",
|
|
1459
|
-
clipRule: "evenodd",
|
|
1460
|
-
d: "M11 2H10V3H11V6H12V3H13V2H11ZM2 9H1V12H2V11H7V10H2V9ZM15 7H8V14H15V7Z",
|
|
1461
|
-
fill: "currentColor"
|
|
1462
|
-
}
|
|
1463
|
-
)
|
|
1464
|
-
] }),
|
|
1465
|
-
relative: () => /* @__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(
|
|
1466
|
-
"path",
|
|
1467
|
-
{
|
|
1468
|
-
fillRule: "evenodd",
|
|
1469
|
-
clipRule: "evenodd",
|
|
1470
|
-
d: "M11 2H9V3H11V6H12V3H14V2H11ZM2 8H1V13H2V11H7V10H2V8ZM15 7H8V14H15V7Z",
|
|
1471
|
-
fill: "currentColor"
|
|
1472
|
-
}
|
|
1473
|
-
) }),
|
|
1474
|
-
sticky: () => /* @__PURE__ */ e.jsxs("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [
|
|
1475
|
-
/* @__PURE__ */ e.jsx(
|
|
1476
|
-
"path",
|
|
1477
|
-
{
|
|
1478
|
-
d: "M12.9998 7C13.6558 7 14.2937 6.78498 14.8158 6.38787C15.338 5.99076 15.7156 5.43345 15.8908 4.80128C16.066 4.16912 16.0292 3.49694 15.7859 2.8877C15.5427 2.27846 15.1065 1.76573 14.5441 1.42804C13.9817 1.09034 13.3241 0.946293 12.672 1.01795C12.02 1.08961 11.4094 1.37303 10.9337 1.8248C10.4581 2.27658 10.1436 2.8718 10.0385 3.51932C9.93341 4.16685 10.0434 4.83097 10.3518 5.41L6.88176 8.88C6.80034 8.96122 6.73572 9.05769 6.69158 9.16388C6.64744 9.27008 6.62465 9.38393 6.62451 9.49894C6.62437 9.61395 6.64689 9.72785 6.69077 9.83416C6.73465 9.94046 6.79904 10.0371 6.88026 10.1185C6.96149 10.1999 7.05795 10.2645 7.16415 10.3087C7.27035 10.3528 7.3842 10.3756 7.4992 10.3758C7.61421 10.3759 7.72812 10.3534 7.83442 10.3095C7.94072 10.2656 8.03734 10.2012 8.11876 10.12L11.5888 6.648C12.0088 6.873 12.4888 7 12.9988 7H12.9998Z",
|
|
1479
|
-
fill: "currentColor"
|
|
1480
|
-
}
|
|
1481
|
-
),
|
|
1482
|
-
/* @__PURE__ */ e.jsx(
|
|
1483
|
-
"path",
|
|
1484
|
-
{
|
|
1485
|
-
opacity: "0.6",
|
|
1486
|
-
fillRule: "evenodd",
|
|
1487
|
-
clipRule: "evenodd",
|
|
1488
|
-
d: "M9.535 2H1V14H15V7.465C14.69 7.645 14.355 7.783 14 7.875V13H2V5H9.126C8.86504 3.98486 9.01223 2.90789 9.536 2H9.535ZM7 3V4H5V3H7ZM4 3V4H2V3H4Z",
|
|
1489
|
-
fill: "currentColor"
|
|
1490
|
-
}
|
|
1491
|
-
)
|
|
1492
|
-
] }),
|
|
1493
|
-
static: Wt
|
|
1494
|
-
}, ae = We({ canReset: !1, canChange: !0 }), ms = ({ children: r, canReset: a = !1, canChange: t = !0 }) => (
|
|
1495
|
-
// eslint-disable-next-line react/jsx-no-constructed-context-values
|
|
1496
|
-
/* @__PURE__ */ e.jsx(ae.Provider, { value: { canReset: a, canChange: t }, children: r })
|
|
1497
|
-
), xt = ({ label: r, property: a, onChange: t }) => {
|
|
1498
|
-
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);
|
|
1499
|
-
return /* @__PURE__ */ e.jsx("div", { className: r ? "w-full rounded" : "grow", children: p ? /* @__PURE__ */ e.jsxs("div", { className: "flex items-center", children: [
|
|
1500
|
-
/* @__PURE__ */ e.jsx(it, { className: "w-[70%] rounded py-1", readOnly: !0, value: n }),
|
|
1501
|
-
/* @__PURE__ */ e.jsxs(U, { delayDuration: 100, children: [
|
|
1502
|
-
/* @__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, {}) }) }),
|
|
1503
|
-
/* @__PURE__ */ e.jsx(G, { children: "Current value is using a Tailwind arbitrary value." })
|
|
1504
|
-
] })
|
|
1505
|
-
] }) : /* @__PURE__ */ e.jsx(
|
|
1506
|
-
Ce,
|
|
1507
|
-
{
|
|
1508
|
-
rounded: r,
|
|
1509
|
-
onChange: (s) => t(s, a),
|
|
1510
|
-
selected: n,
|
|
1511
|
-
options: l,
|
|
1512
|
-
disabled: !c
|
|
1513
|
-
}
|
|
1514
|
-
) });
|
|
1515
|
-
};
|
|
1516
|
-
function Ce({ selected: r, onChange: a, rounded: t = !1, options: l, disabled: o = !1 }) {
|
|
1517
|
-
const n = r.replace(/.*:/g, "").trim(), { undo: c, redo: p } = Nr();
|
|
1518
|
-
return /* @__PURE__ */ e.jsxs(
|
|
1519
|
-
"select",
|
|
1520
|
-
{
|
|
1521
|
-
disabled: !l.length || o,
|
|
1522
|
-
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) => a(s.target.value),
|
|
1524
|
-
onKeyDown: (s) => {
|
|
1525
|
-
s.ctrlKey && (s.key === "z" && c(), s.key === "y" && p());
|
|
1526
|
-
},
|
|
1527
|
-
value: n,
|
|
1528
|
-
children: [
|
|
1529
|
-
/* @__PURE__ */ e.jsx("option", { className: "bg-transparent", value: "" }),
|
|
1530
|
-
$.Children.toArray(
|
|
1531
|
-
l.map((s) => /* @__PURE__ */ e.jsx("option", { className: "bg-transparent", value: s, children: s }))
|
|
1532
|
-
)
|
|
1533
|
-
]
|
|
1534
|
-
}
|
|
1535
|
-
);
|
|
1536
|
-
}
|
|
1537
|
-
const bs = ({ property: r, onChange: a }) => {
|
|
1538
|
-
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);
|
|
1539
|
-
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
|
-
/* @__PURE__ */ e.jsx(
|
|
1541
|
-
"button",
|
|
1542
|
-
{
|
|
1543
|
-
type: "button",
|
|
1544
|
-
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: !l && (!t || p - 1 < 0),
|
|
1546
|
-
onClick: () => a(He(c, p - 1), r),
|
|
1547
|
-
children: /* @__PURE__ */ e.jsx("span", { className: "flex items-center justify-center", children: /* @__PURE__ */ e.jsx(
|
|
1548
|
-
Ut,
|
|
1549
|
-
{
|
|
1550
|
-
className: !l && (!t || p - 1 < 0) ? "text-gray-500" : "text-black/60 dark:text-white/60"
|
|
1551
|
-
}
|
|
1552
|
-
) })
|
|
1553
|
-
}
|
|
1554
|
-
),
|
|
1555
|
-
/* @__PURE__ */ e.jsx("div", { className: "w-8/12 text-center", children: /* @__PURE__ */ e.jsx(xt, { label: !1, property: r, onChange: a }) }),
|
|
1556
|
-
/* @__PURE__ */ e.jsx(
|
|
1557
|
-
"button",
|
|
1558
|
-
{
|
|
1559
|
-
type: "button",
|
|
1560
|
-
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: !l && (!t || p + 1 >= c.length),
|
|
1562
|
-
onClick: () => a(He(c, p + 1), r),
|
|
1563
|
-
children: /* @__PURE__ */ e.jsx("span", { className: "flex items-center justify-center", children: /* @__PURE__ */ e.jsx(
|
|
1564
|
-
Ge,
|
|
1565
|
-
{
|
|
1566
|
-
className: !l && (!t || p + 1 >= c.length) ? "text-gray-500" : "text-black/60 dark:text-white/60"
|
|
1567
|
-
}
|
|
1568
|
-
) })
|
|
1569
|
-
}
|
|
1570
|
-
)
|
|
1571
|
-
] }) });
|
|
1572
|
-
}, fs = ({ property: r, onChange: a }) => {
|
|
1573
|
-
const t = T(() => g(ge, `${r}.classes`, [""]), [r]), { canChange: l } = se(ae), o = ne(r), n = T(() => g(o, "cls", ""), [o]);
|
|
1574
|
-
return /* @__PURE__ */ e.jsx("div", { className: "flex grow flex-wrap gap-1", children: R(t, (c) => /* @__PURE__ */ e.jsxs(U, { children: [
|
|
1575
|
-
/* @__PURE__ */ e.jsx(K, { asChild: !0, children: /* @__PURE__ */ e.jsx(
|
|
1576
|
-
"button",
|
|
1577
|
-
{
|
|
1578
|
-
type: "button",
|
|
1579
|
-
disabled: !l,
|
|
1580
|
-
onClick: () => a(c, r),
|
|
1581
|
-
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"}`,
|
|
1582
|
-
children: $.createElement(g(gt, c, Je))
|
|
1583
|
-
}
|
|
1584
|
-
) }),
|
|
1585
|
-
/* @__PURE__ */ e.jsx(G, { children: Y(re(c)) })
|
|
1586
|
-
] })) });
|
|
1587
|
-
}, vs = {
|
|
1588
|
-
backgroundColor: "bg",
|
|
1589
|
-
textColor: "text",
|
|
1590
|
-
borderColor: "border",
|
|
1591
|
-
boxShadowColor: "shadow",
|
|
1592
|
-
outlineColor: "outline",
|
|
1593
|
-
divideColor: "divide",
|
|
1594
|
-
fromColor: "from",
|
|
1595
|
-
viaColor: "via",
|
|
1596
|
-
toColor: "to",
|
|
1597
|
-
ringColor: "ring",
|
|
1598
|
-
ringOffsetColor: "ring-offset"
|
|
1599
|
-
}, ws = ({ property: r, onChange: a }) => {
|
|
1600
|
-
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(
|
|
1601
|
-
// eslint-disable-next-line no-shadow
|
|
1602
|
-
(x) => {
|
|
1603
|
-
["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" })));
|
|
1604
|
-
},
|
|
1605
|
-
[c, s]
|
|
1606
|
-
);
|
|
1607
|
-
I(() => {
|
|
1608
|
-
if (["current", "inherit", "transparent", "black", "white"].includes(u))
|
|
1609
|
-
return c([]);
|
|
1610
|
-
c(["50", "100", "200", "300", "400", "500", "600", "700", "800", "900"]);
|
|
1611
|
-
}, [u]);
|
|
1612
|
-
const y = B(
|
|
1613
|
-
// eslint-disable-next-line no-shadow
|
|
1614
|
-
(x) => {
|
|
1615
|
-
s({ color: u, shade: x });
|
|
1616
|
-
},
|
|
1617
|
-
[u]
|
|
1618
|
-
);
|
|
1619
|
-
return I(() => {
|
|
1620
|
-
s({ color: "", shade: "" });
|
|
1621
|
-
}, [t]), I(() => {
|
|
1622
|
-
const v = `${g(vs, r, "")}-${p.color}${p.shade ? `-${p.shade}` : ""}`;
|
|
1623
|
-
v.match(new RegExp(g(ge, `${r}.regExp`, ""))) && a(v, r);
|
|
1624
|
-
}, [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
|
-
/* @__PURE__ */ e.jsx("div", { className: "grow text-center", children: /* @__PURE__ */ e.jsx(
|
|
1626
|
-
Ce,
|
|
1627
|
-
{
|
|
1628
|
-
disabled: !o,
|
|
1629
|
-
rounded: !0,
|
|
1630
|
-
selected: u,
|
|
1631
|
-
onChange: h,
|
|
1632
|
-
options: [
|
|
1633
|
-
"current",
|
|
1634
|
-
"transparent",
|
|
1635
|
-
"primary",
|
|
1636
|
-
"secondary",
|
|
1637
|
-
"black",
|
|
1638
|
-
"white",
|
|
1639
|
-
"slate",
|
|
1640
|
-
"gray",
|
|
1641
|
-
"zinc",
|
|
1642
|
-
"neutral",
|
|
1643
|
-
"stone",
|
|
1644
|
-
"red",
|
|
1645
|
-
"orange",
|
|
1646
|
-
"amber",
|
|
1647
|
-
"yellow",
|
|
1648
|
-
"lime",
|
|
1649
|
-
"green",
|
|
1650
|
-
"emerald",
|
|
1651
|
-
"teal",
|
|
1652
|
-
"cyan",
|
|
1653
|
-
"sky",
|
|
1654
|
-
"blue",
|
|
1655
|
-
"indigo",
|
|
1656
|
-
"violet",
|
|
1657
|
-
"purple",
|
|
1658
|
-
"fuchsia",
|
|
1659
|
-
"pink",
|
|
1660
|
-
"rose"
|
|
1661
|
-
]
|
|
1662
|
-
}
|
|
1663
|
-
) }),
|
|
1664
|
-
/* @__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
|
-
] });
|
|
1666
|
-
}, Xe = (r, a) => {
|
|
1667
|
-
r = r.toLowerCase();
|
|
1668
|
-
let t = r.trim().replace(/ |\+/g, "");
|
|
1669
|
-
if ((t === "auto" || t === "none") && a.includes(t))
|
|
1670
|
-
return { value: "", unit: t };
|
|
1671
|
-
const l = a.length ? new RegExp(a.join("|"), "g") : /XXXXXX/g;
|
|
1672
|
-
t = t.replace(l, "");
|
|
1673
|
-
const o = r.match(l), n = o && o.length > 1, c = !b(t) && Number.isNaN(Number(t));
|
|
1674
|
-
return n || c ? { error: "Invalid value" } : o && (o[0] === "auto" || o[0] === "none") ? { value: o[0], unit: "" } : { value: t, unit: o ? o[0] : "" };
|
|
1675
|
-
};
|
|
1676
|
-
const js = (r) => {
|
|
1677
|
-
const a = r.startsWith("-") ? "-" : "", t = r.split("-").pop();
|
|
1678
|
-
if (["auto", "none"].includes(t))
|
|
1679
|
-
return { value: "", unit: t };
|
|
1680
|
-
if (t === "px")
|
|
1681
|
-
return { value: "1", unit: "px" };
|
|
1682
|
-
if (t === "screen")
|
|
1683
|
-
return { value: "100", unit: r.indexOf("w-") !== -1 ? "vw" : "vh" };
|
|
1684
|
-
if (t === "full")
|
|
1685
|
-
return { value: "100", unit: "%" };
|
|
1686
|
-
if (X(r, "skew-"))
|
|
1687
|
-
return { value: `${a}${t}`, unit: "deg" };
|
|
1688
|
-
if (X(r, "rotate-"))
|
|
1689
|
-
return { value: `${a}${t}`, unit: "deg" };
|
|
1690
|
-
if (X(r, "opacity-"))
|
|
1691
|
-
return { value: `${t / 100}`, unit: "-" };
|
|
1692
|
-
if (X(r, "duration-") || X(r, "delay-"))
|
|
1693
|
-
return { value: `${t}`, unit: "ms" };
|
|
1694
|
-
if (X(r, "translate-") && !t.includes("/"))
|
|
1695
|
-
return { value: `${a}${`${t / 4}`}`, unit: "rem" };
|
|
1696
|
-
if (X(r, "scale-"))
|
|
1697
|
-
return { value: `${a}${`${t / 100}`}`, unit: "-" };
|
|
1698
|
-
if (q(r, "border")) {
|
|
1699
|
-
const l = r.match(/border-?(x|y|t|r|b|l)?\d+/g);
|
|
1700
|
-
if (l)
|
|
1701
|
-
return { value: l[0].split("-").pop(), unit: "px" };
|
|
1702
|
-
if (r.match(/border-?(x|y|t|r|b|l)?/g))
|
|
1703
|
-
return { value: "1", unit: "px" };
|
|
1704
|
-
}
|
|
1705
|
-
if (q(r, "max-w-")) {
|
|
1706
|
-
if (r === "max-w-screen-sm")
|
|
1707
|
-
return { value: "640", unit: "px" };
|
|
1708
|
-
if (r === "max-w-screen-md")
|
|
1709
|
-
return { value: "768", unit: "px" };
|
|
1710
|
-
if (r === "max-w-screen-lg")
|
|
1711
|
-
return { value: "1024", unit: "px" };
|
|
1712
|
-
if (r === "max-w-screen-xl")
|
|
1713
|
-
return { value: "1280", unit: "px" };
|
|
1714
|
-
if (r === "max-w-screen-2xl")
|
|
1715
|
-
return { value: "1536", unit: "px" };
|
|
1716
|
-
if (t === "xs")
|
|
1717
|
-
return { value: "320", unit: "px" };
|
|
1718
|
-
if (t === "sm")
|
|
1719
|
-
return { value: "384", unit: "px" };
|
|
1720
|
-
if (t === "md")
|
|
1721
|
-
return { value: "448", unit: "px" };
|
|
1722
|
-
if (t === "lg")
|
|
1723
|
-
return { value: "512", unit: "px" };
|
|
1724
|
-
if (t === "xl")
|
|
1725
|
-
return { value: "576", unit: "px" };
|
|
1726
|
-
if (t === "2xl")
|
|
1727
|
-
return { value: "672", unit: "px" };
|
|
1728
|
-
if (t === "3xl")
|
|
1729
|
-
return { value: "768", unit: "px" };
|
|
1730
|
-
if (t === "4xl")
|
|
1731
|
-
return { value: "896", unit: "px" };
|
|
1732
|
-
if (t === "5xl")
|
|
1733
|
-
return { value: "1024", unit: "px" };
|
|
1734
|
-
if (t === "6xl")
|
|
1735
|
-
return { value: "1152", unit: "px" };
|
|
1736
|
-
if (t === "7xl")
|
|
1737
|
-
return { value: "1280", unit: "px" };
|
|
1738
|
-
if (t === "prose")
|
|
1739
|
-
return { value: "65", unit: "ch" };
|
|
1740
|
-
}
|
|
1741
|
-
if (q(r, "text-")) {
|
|
1742
|
-
if (t === "xs")
|
|
1743
|
-
return { value: "12", unit: "px" };
|
|
1744
|
-
if (t === "sm")
|
|
1745
|
-
return { value: "14", unit: "px" };
|
|
1746
|
-
if (t === "base")
|
|
1747
|
-
return { value: "16", unit: "px" };
|
|
1748
|
-
if (t === "lg")
|
|
1749
|
-
return { value: "18", unit: "px" };
|
|
1750
|
-
if (t === "xl")
|
|
1751
|
-
return { value: "20", unit: "px" };
|
|
1752
|
-
if (t === "2xl")
|
|
1753
|
-
return { value: "24", unit: "px" };
|
|
1754
|
-
if (t === "3xl")
|
|
1755
|
-
return { value: "30", unit: "px" };
|
|
1756
|
-
if (t === "4xl")
|
|
1757
|
-
return { value: "36", unit: "px" };
|
|
1758
|
-
if (t === "5xl")
|
|
1759
|
-
return { value: "48", unit: "px" };
|
|
1760
|
-
if (t === "6xl")
|
|
1761
|
-
return { value: "60", unit: "px" };
|
|
1762
|
-
if (t === "7xl")
|
|
1763
|
-
return { value: "72", unit: "px" };
|
|
1764
|
-
if (t === "8xl")
|
|
1765
|
-
return { value: "96", unit: "px" };
|
|
1766
|
-
if (t === "9xl")
|
|
1767
|
-
return { value: "128", unit: "px" };
|
|
1768
|
-
}
|
|
1769
|
-
if (q(r, "leading-")) {
|
|
1770
|
-
if (t === "none")
|
|
1771
|
-
return { value: "1", unit: "-" };
|
|
1772
|
-
if (t === "tight")
|
|
1773
|
-
return { value: "1.25", unit: "-" };
|
|
1774
|
-
if (t === "snug")
|
|
1775
|
-
return { value: "1.375", unit: "-" };
|
|
1776
|
-
if (t === "normal")
|
|
1777
|
-
return { value: "1.5", unit: "-" };
|
|
1778
|
-
if (t === "relaxed")
|
|
1779
|
-
return { value: "1.625", unit: "-" };
|
|
1780
|
-
if (t === "loose")
|
|
1781
|
-
return { value: "2", unit: "-" };
|
|
1782
|
-
}
|
|
1783
|
-
if (q(r, "tracking-")) {
|
|
1784
|
-
if (t === "tighter")
|
|
1785
|
-
return { value: "-0.05", unit: "em" };
|
|
1786
|
-
if (t === "tight")
|
|
1787
|
-
return { value: "-0.025", unit: "em" };
|
|
1788
|
-
if (t === "normal")
|
|
1789
|
-
return { value: "0", unit: "em" };
|
|
1790
|
-
if (t === "wide")
|
|
1791
|
-
return { value: "0.025", unit: "em" };
|
|
1792
|
-
if (t === "wider")
|
|
1793
|
-
return { value: "0.05", unit: "em" };
|
|
1794
|
-
if (t === "widest")
|
|
1795
|
-
return { value: "0.1", unit: "em" };
|
|
1796
|
-
}
|
|
1797
|
-
if (["max", "min", "fit"].includes(t))
|
|
1798
|
-
return { value: r, unit: "class" };
|
|
1799
|
-
if (t.includes("/")) {
|
|
1800
|
-
const [l, o] = R(t.split("/"), (n) => parseInt(n, 10));
|
|
1801
|
-
return { value: a + (l / o * 100).toFixed(2).replace(".00", ""), unit: "%" };
|
|
1802
|
-
}
|
|
1803
|
-
return Tt(parseFloat(t)) ? { value: `${a + parseFloat(t) * 4}`, unit: "px" } : { value: t, unit: "class" };
|
|
1804
|
-
};
|
|
1805
|
-
const Cs = (r) => {
|
|
1806
|
-
if (b(r))
|
|
1807
|
-
return { value: "", unit: "" };
|
|
1808
|
-
const a = r.match(/\[.*\]/g);
|
|
1809
|
-
if (a === null)
|
|
1810
|
-
return ks(r);
|
|
1811
|
-
const t = g(a, "0", "").replace(/\[|\]/g, ""), l = r.startsWith("-") ? "-" : "", o = oe(t.match(/\d+.\d+|\d+/g));
|
|
1812
|
-
return { value: `${l}${o}`, unit: t.replace(o, "") };
|
|
1813
|
-
}, ks = (r) => b(r) ? { value: "", unit: "" } : js(r), yt = $.createContext({
|
|
1814
|
-
setDragData: () => {
|
|
1815
|
-
}
|
|
1816
|
-
}), Ns = ({
|
|
1817
|
-
unit: r,
|
|
1818
|
-
currentValue: a,
|
|
1819
|
-
onDrag: t,
|
|
1820
|
-
onDragEnd: l,
|
|
1821
|
-
onDragStart: o,
|
|
1822
|
-
negative: n,
|
|
1823
|
-
cssProperty: c
|
|
1824
|
-
}) => {
|
|
1825
|
-
const { setDragData: p } = se(yt);
|
|
1826
|
-
return /* @__PURE__ */ e.jsx(
|
|
1827
|
-
"button",
|
|
1828
|
-
{
|
|
1829
|
-
type: "button",
|
|
1830
|
-
onMouseDown: (s) => {
|
|
1831
|
-
const d = {
|
|
1832
|
-
onDrag: t,
|
|
1833
|
-
onDragEnd: l,
|
|
1834
|
-
dragging: !0,
|
|
1835
|
-
dragStartY: s.pageY,
|
|
1836
|
-
dragStartValue: `${a}`,
|
|
1837
|
-
dragUnit: r,
|
|
1838
|
-
negative: n,
|
|
1839
|
-
cssProperty: c
|
|
1840
|
-
};
|
|
1841
|
-
o(d), p(d);
|
|
1842
|
-
},
|
|
1843
|
-
color: void 0,
|
|
1844
|
-
className: "relative z-50 ml-1 hidden h-6 cursor-row-resize rounded bg-background/70 px-2 group-hover:inline",
|
|
1845
|
-
children: /* @__PURE__ */ e.jsx(Kt, {})
|
|
1846
|
-
}
|
|
1847
|
-
);
|
|
1848
|
-
}, _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(
|
|
1849
|
-
P,
|
|
1850
|
-
{
|
|
1851
|
-
className: "h-max rounded-none px-1 py-1 text-right text-[11px] hover:bg-blue-400",
|
|
1852
|
-
color: a === l ? "primary" : void 0,
|
|
1853
|
-
size: "sm",
|
|
1854
|
-
onClick: (o) => {
|
|
1855
|
-
o.stopPropagation(), r(l);
|
|
1856
|
-
},
|
|
1857
|
-
children: l
|
|
1858
|
-
},
|
|
1859
|
-
l
|
|
1860
|
-
)) }), Ye = 50, Ss = (r) => {
|
|
1861
|
-
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);
|
|
1862
|
-
I(() => {
|
|
1863
|
-
const { value: m, unit: f } = Cs(n);
|
|
1864
|
-
if (f === "") {
|
|
1865
|
-
o(m), h(s != null && s.toLowerCase().includes("width") ? "%" : oe(d));
|
|
1866
|
-
return;
|
|
1867
|
-
}
|
|
1868
|
-
h(f), o(f === "class" || b(m) ? "" : m);
|
|
1869
|
-
}, [n, s, d]);
|
|
1870
|
-
const N = ce((m) => c(m), [c], Ye), C = ce((m) => c(m, !1), [c], Ye), V = B(
|
|
1871
|
-
(m = !1) => {
|
|
1872
|
-
const f = Xe(`${l}`, d);
|
|
1873
|
-
if (g(f, "error", !1)) {
|
|
1874
|
-
x(!0);
|
|
1875
|
-
return;
|
|
1876
|
-
}
|
|
1877
|
-
const S = g(f, "unit") !== "" ? g(f, "unit") : i;
|
|
1878
|
-
if (S === "auto" || S === "none") {
|
|
1879
|
-
N(`${p}${S}`);
|
|
1880
|
-
return;
|
|
1881
|
-
}
|
|
1882
|
-
if (g(f, "value") === "")
|
|
1883
|
-
return;
|
|
1884
|
-
const z = `${g(f, "value", "").startsWith("-") ? "-" : ""}${p}[${g(f, "value", "").replace("-", "")}${S === "-" ? "" : S}]`;
|
|
1885
|
-
m ? C(z) : N(z);
|
|
1886
|
-
},
|
|
1887
|
-
[N, C, l, i, p, d]
|
|
1888
|
-
), W = B(
|
|
1889
|
-
(m) => {
|
|
1890
|
-
const f = Xe(`${l}`, d);
|
|
1891
|
-
if (g(f, "error", !1)) {
|
|
1892
|
-
x(!0);
|
|
1893
|
-
return;
|
|
1894
|
-
}
|
|
1895
|
-
if (m === "auto" || m === "none") {
|
|
1896
|
-
N(`${p}${m}`);
|
|
1897
|
-
return;
|
|
1898
|
-
}
|
|
1899
|
-
if (g(f, "value") === "")
|
|
1900
|
-
return;
|
|
1901
|
-
const S = g(f, "unit") !== "" ? g(f, "unit") : m, z = `${g(f, "value", "").startsWith("-") ? "-" : ""}${p}[${g(f, "value", "").replace("-", "")}${S === "-" ? "" : S}]`;
|
|
1902
|
-
N(z);
|
|
1903
|
-
},
|
|
1904
|
-
[N, l, p, d]
|
|
1905
|
-
);
|
|
1906
|
-
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
|
-
/* @__PURE__ */ e.jsx("input", { className: "w-20 rounded py-1", readOnly: !0, value: n }),
|
|
1908
|
-
/* @__PURE__ */ e.jsxs(U, { children: [
|
|
1909
|
-
/* @__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, {}) }) }),
|
|
1910
|
-
/* @__PURE__ */ e.jsx(G, { children: "Current value is using a Tailwind preset class." })
|
|
1911
|
-
] })
|
|
1912
|
-
] }) : /* @__PURE__ */ e.jsxs("div", { className: `group relative flex items-center ${L ? "z-auto" : ""}`, children: [
|
|
1913
|
-
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center rounded-md border border-border", children: [
|
|
1914
|
-
["none", "auto"].indexOf(i) !== -1 ? null : /* @__PURE__ */ e.jsx(
|
|
1915
|
-
"input",
|
|
1916
|
-
{
|
|
1917
|
-
readOnly: i === "class",
|
|
1918
|
-
onKeyPress: (m) => {
|
|
1919
|
-
m.key === "Enter" && V();
|
|
1920
|
-
},
|
|
1921
|
-
onKeyDown: (m) => {
|
|
1922
|
-
if (m.keyCode !== 38 && m.keyCode !== 40)
|
|
1923
|
-
return;
|
|
1924
|
-
m.preventDefault(), w(!0);
|
|
1925
|
-
const f = Rt(m.target.value);
|
|
1926
|
-
let S = Ke(f) ? 0 : f;
|
|
1927
|
-
m.keyCode === 38 && (S += 1), m.keyCode === 40 && (S -= 1);
|
|
1928
|
-
const O = `${S}`, mt = `${O.startsWith("-") ? "-" : ""}${p}[${O.replace("-", "")}${i === "-" ? "" : i}]`;
|
|
1929
|
-
C(mt);
|
|
1930
|
-
},
|
|
1931
|
-
onKeyUp: (m) => {
|
|
1932
|
-
Z && (m.preventDefault(), w(!1));
|
|
1933
|
-
},
|
|
1934
|
-
onBlur: () => V(),
|
|
1935
|
-
onChange: (m) => {
|
|
1936
|
-
x(!1), o(m.target.value);
|
|
1937
|
-
},
|
|
1938
|
-
onClick: (m) => {
|
|
1939
|
-
var f;
|
|
1940
|
-
(f = m == null ? void 0 : m.target) == null || f.select(), t(!1);
|
|
1941
|
-
},
|
|
1942
|
-
value: L ? v : l,
|
|
1943
|
-
className: "h-6 w-14 rounded rounded-r-none bg-background pl-2 text-sm focus-visible:outline-0 ".concat(
|
|
1944
|
-
" ",
|
|
1945
|
-
y ? "border-red-500 text-red-500" : "border-foreground/20"
|
|
1946
|
-
)
|
|
1947
|
-
}
|
|
1948
|
-
),
|
|
1949
|
-
/* @__PURE__ */ e.jsxs(U, { open: a, delayDuration: 100, children: [
|
|
1950
|
-
/* @__PURE__ */ e.jsx(K, { asChild: !0, children: /* @__PURE__ */ e.jsxs(
|
|
1951
|
-
"button",
|
|
1952
|
-
{
|
|
1953
|
-
type: "button",
|
|
1954
|
-
onClick: () => t(!a),
|
|
1955
|
-
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
|
-
children: [
|
|
1957
|
-
/* @__PURE__ */ e.jsx("span", { className: `inline-block ${d.length === 1 ? "px-2 font-semibold" : ""}`, children: i }),
|
|
1958
|
-
d.length > 1 ? /* @__PURE__ */ e.jsx(Gt, {}) : null
|
|
1959
|
-
]
|
|
1960
|
-
}
|
|
1961
|
-
) }),
|
|
1962
|
-
/* @__PURE__ */ e.jsx(_r, { children: /* @__PURE__ */ e.jsx(G, { className: "bg-background", children: /* @__PURE__ */ e.jsx(
|
|
1963
|
-
_s,
|
|
1964
|
-
{
|
|
1965
|
-
units: d,
|
|
1966
|
-
current: i,
|
|
1967
|
-
onSelect: (m) => {
|
|
1968
|
-
t(!1), h(m), W(m);
|
|
1969
|
-
}
|
|
1970
|
-
}
|
|
1971
|
-
) }) })
|
|
1972
|
-
] })
|
|
1973
|
-
] }),
|
|
1974
|
-
["none", "auto"].indexOf(i) !== -1 || L ? null : /* @__PURE__ */ e.jsx(
|
|
1975
|
-
Ns,
|
|
1976
|
-
{
|
|
1977
|
-
onDragStart: () => A(!0),
|
|
1978
|
-
onDragEnd: (m) => {
|
|
1979
|
-
if (k(() => ""), A(!1), b(m))
|
|
1980
|
-
return;
|
|
1981
|
-
const f = `${m}`, O = `${f.startsWith("-") ? "-" : ""}${p}[${f.replace("-", "")}${i === "-" ? "" : i}]`;
|
|
1982
|
-
N(O);
|
|
1983
|
-
},
|
|
1984
|
-
onDrag: (m) => {
|
|
1985
|
-
if (b(m))
|
|
1986
|
-
return;
|
|
1987
|
-
k(m);
|
|
1988
|
-
const f = `${m}`, O = `${f.startsWith("-") ? "-" : ""}${p}[${f.replace("-", "")}${i === "-" ? "" : i}]`;
|
|
1989
|
-
C(O);
|
|
1990
|
-
},
|
|
1991
|
-
currentValue: l,
|
|
1992
|
-
unit: i,
|
|
1993
|
-
negative: u,
|
|
1994
|
-
cssProperty: s
|
|
1995
|
-
}
|
|
1996
|
-
)
|
|
1997
|
-
] }) }) });
|
|
1998
|
-
}, ne = (r) => {
|
|
1999
|
-
const a = ue();
|
|
2000
|
-
return Vt(a, { property: r });
|
|
2001
|
-
}, Ts = (r, a) => {
|
|
2002
|
-
const t = {
|
|
2003
|
-
xs: 0,
|
|
2004
|
-
sm: 1,
|
|
2005
|
-
md: 2,
|
|
2006
|
-
lg: 3,
|
|
2007
|
-
xl: 4,
|
|
2008
|
-
"2xl": 5
|
|
2009
|
-
};
|
|
2010
|
-
return t[g(r, "mq", "xs")] <= t[a];
|
|
2011
|
-
}, Rs = {
|
|
2012
|
-
width: "w-",
|
|
2013
|
-
height: "h-",
|
|
2014
|
-
minWidth: "min-w-",
|
|
2015
|
-
minHeight: "min-h-",
|
|
2016
|
-
maxWidth: "max-w-",
|
|
2017
|
-
maxHeight: "max-h-",
|
|
2018
|
-
zIndex: "z-",
|
|
2019
|
-
gap: "gap-",
|
|
2020
|
-
gapX: "gap-x-",
|
|
2021
|
-
gapY: "gap-y-",
|
|
2022
|
-
margin: "m-",
|
|
2023
|
-
marginX: "mx-",
|
|
2024
|
-
marginY: "my-",
|
|
2025
|
-
marginTop: "mt-",
|
|
2026
|
-
marginBottom: "mb-",
|
|
2027
|
-
marginLeft: "ml-",
|
|
2028
|
-
marginRight: "mr-",
|
|
2029
|
-
padding: "p-",
|
|
2030
|
-
paddingX: "px-",
|
|
2031
|
-
paddingY: "py-",
|
|
2032
|
-
paddingTop: "pt-",
|
|
2033
|
-
paddingBottom: "pb-",
|
|
2034
|
-
paddingLeft: "pl-",
|
|
2035
|
-
paddingRight: "pr-",
|
|
2036
|
-
spaceX: "space-x-",
|
|
2037
|
-
spaceY: "space-y-",
|
|
2038
|
-
border: "border-",
|
|
2039
|
-
borderTop: "border-t-",
|
|
2040
|
-
borderBottom: "border-b-",
|
|
2041
|
-
borderLeft: "border-l-",
|
|
2042
|
-
borderRight: "border-r-",
|
|
2043
|
-
borderX: "border-x-",
|
|
2044
|
-
borderY: "border-y-",
|
|
2045
|
-
borderRadius: "rounded-",
|
|
2046
|
-
borderRadiusTop: "rounded-t-",
|
|
2047
|
-
borderRadiusRight: "rounded-r-",
|
|
2048
|
-
borderRadiusBottom: "rounded-b-",
|
|
2049
|
-
borderRadiusLeft: "rounded-l-",
|
|
2050
|
-
borderRadiusTopLeft: "rounded-tl-",
|
|
2051
|
-
borderRadiusTopRight: "rounded-tr-",
|
|
2052
|
-
borderRadiusBottomRight: "rounded-br-",
|
|
2053
|
-
borderRadiusBottomLeft: "rounded-bl-",
|
|
2054
|
-
fontSize: "text-",
|
|
2055
|
-
lineHeight: "leading-",
|
|
2056
|
-
letterSpacing: "tracking-",
|
|
2057
|
-
textIndent: "indent-",
|
|
2058
|
-
rotate: "rotate-",
|
|
2059
|
-
duration: "duration-",
|
|
2060
|
-
transitionDelay: "delay-",
|
|
2061
|
-
scale: "scale-",
|
|
2062
|
-
scaleX: "scale-x-",
|
|
2063
|
-
scaleY: "scale-y-",
|
|
2064
|
-
translateX: "translate-x-",
|
|
2065
|
-
translateY: "translate-y-",
|
|
2066
|
-
skewX: "skew-x-",
|
|
2067
|
-
skewY: "skew-y-",
|
|
2068
|
-
top: "top-",
|
|
2069
|
-
bottom: "bottom-",
|
|
2070
|
-
left: "left-",
|
|
2071
|
-
right: "right-",
|
|
2072
|
-
inset: "inset-",
|
|
2073
|
-
insetX: "inset-x-",
|
|
2074
|
-
insetY: "inset-y-",
|
|
2075
|
-
opacity: "opacity-",
|
|
2076
|
-
flexBasis: "basis-"
|
|
2077
|
-
}, Ze = {
|
|
2078
|
-
xs: "",
|
|
2079
|
-
sm: "640px",
|
|
2080
|
-
md: "768px",
|
|
2081
|
-
lg: "1024px",
|
|
2082
|
-
xl: "1280px",
|
|
2083
|
-
"2xl": "1536px"
|
|
2084
|
-
}, Vs = (r) => `${r.toUpperCase()} ${Ze[r] ? `(${Ze[r]} & up)` : ""}`, Re = (r) => {
|
|
2085
|
-
const { t: a } = E(), { type: t = "icons", label: l, property: o, onEmitChange: n = () => {
|
|
2086
|
-
}, units: c, negative: p = !1 } = r, [s] = Sr(), [d] = Tr(), [, u] = Ae(), i = ne(o), h = Se(), y = nt(), [x] = _e(), v = T(() => g(i, "fullCls", ""), [i]), k = B(
|
|
2087
|
-
(C, V = !0) => {
|
|
2088
|
-
const W = { dark: s, mq: u, mod: d, cls: C, property: o, fullCls: "" };
|
|
2089
|
-
(s || d !== "") && (W.mq = "xs");
|
|
2090
|
-
const m = es(W);
|
|
2091
|
-
h(x, [m], V);
|
|
2092
|
-
},
|
|
2093
|
-
[x, s, u, d, o, h]
|
|
2094
|
-
), L = B(() => {
|
|
2095
|
-
y(x, [v]);
|
|
2096
|
-
}, [x, v, y]), A = T(() => Ts(i, u), [i, u]);
|
|
2097
|
-
I(() => {
|
|
2098
|
-
n(A, i);
|
|
2099
|
-
}, [A, n, i]);
|
|
2100
|
-
const [, , Z] = Ae(), w = B(
|
|
2101
|
-
(C) => {
|
|
2102
|
-
Z({
|
|
2103
|
-
xs: 400,
|
|
2104
|
-
sm: 640,
|
|
2105
|
-
md: 800,
|
|
2106
|
-
lg: 1024,
|
|
2107
|
-
xl: 1420,
|
|
2108
|
-
"2xl": 1920
|
|
2109
|
-
}[C]);
|
|
2110
|
-
},
|
|
2111
|
-
[Z]
|
|
2112
|
-
), N = g(i, "dark", null) === s && g(i, "mod", null) === d && g(i, "mq", null) === u;
|
|
2113
|
-
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: [
|
|
2114
|
-
/* @__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
|
-
/* @__PURE__ */ e.jsxs("div", { className: "flex flex-row items-center", children: [
|
|
2116
|
-
/* @__PURE__ */ e.jsxs("div", { className: "w-[150px]", children: [
|
|
2117
|
-
t === "arbitrary" ? /* @__PURE__ */ e.jsx(
|
|
2118
|
-
Ss,
|
|
2119
|
-
{
|
|
2120
|
-
currentClass: g(i, "cls", ""),
|
|
2121
|
-
classPrefix: g(Rs, o, ""),
|
|
2122
|
-
units: c || [],
|
|
2123
|
-
onChange: k,
|
|
2124
|
-
negative: p,
|
|
2125
|
-
cssProperty: o
|
|
2126
|
-
}
|
|
2127
|
-
) : null,
|
|
2128
|
-
t === "icons" && /* @__PURE__ */ e.jsx(fs, { property: o, onChange: k }),
|
|
2129
|
-
t === "range" && /* @__PURE__ */ e.jsx(bs, { property: o, onChange: k }),
|
|
2130
|
-
t === "color" && /* @__PURE__ */ e.jsx(ws, { property: o, onChange: k }),
|
|
2131
|
-
t === "dropdown" && /* @__PURE__ */ e.jsx(xt, { label: l, property: o, onChange: k })
|
|
2132
|
-
] }),
|
|
2133
|
-
/* @__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(qt, { className: "h-5 w-5 text-blue-500 hover:opacity-80" }) }) : A && i ? /* @__PURE__ */ e.jsxs(U, { delayDuration: 100, children: [
|
|
2134
|
-
/* @__PURE__ */ e.jsx(K, { asChild: !0, children: /* @__PURE__ */ e.jsx(
|
|
2135
|
-
"button",
|
|
2136
|
-
{
|
|
2137
|
-
type: "button",
|
|
2138
|
-
className: "invisible ml-3 mt-1 rounded-full bg-blue-500 text-white group-hover:visible",
|
|
2139
|
-
children: /* @__PURE__ */ e.jsx(Ne, {})
|
|
2140
|
-
}
|
|
2141
|
-
) }),
|
|
2142
|
-
/* @__PURE__ */ e.jsx(G, { children: /* @__PURE__ */ e.jsx("div", { className: "text-right", children: /* @__PURE__ */ e.jsxs("div", { children: [
|
|
2143
|
-
"Current style is set at ",
|
|
2144
|
-
/* @__PURE__ */ e.jsxs("span", { className: "font-bold", children: [
|
|
2145
|
-
Vs(g(i, "mq")),
|
|
2146
|
-
s && !i.dark ? "(Light mode)" : ""
|
|
2147
|
-
] }),
|
|
2148
|
-
/* @__PURE__ */ e.jsx("br", {}),
|
|
2149
|
-
/* @__PURE__ */ e.jsxs(
|
|
2150
|
-
"button",
|
|
2151
|
-
{
|
|
2152
|
-
type: "button",
|
|
2153
|
-
onClick: () => w(g(i, "mq")),
|
|
2154
|
-
className: "block w-full cursor-default text-right font-semibold text-blue-500",
|
|
2155
|
-
children: [
|
|
2156
|
-
"Switch to ",
|
|
2157
|
-
g(i, "mq").toUpperCase()
|
|
2158
|
-
]
|
|
2159
|
-
}
|
|
2160
|
-
)
|
|
2161
|
-
] }) }) })
|
|
2162
|
-
] }) : null })
|
|
2163
|
-
] })
|
|
2164
|
-
] }) });
|
|
2165
|
-
}, Hs = ["px", "%", "em", "rem", "ch", "vh", "vw"], ht = ({
|
|
2166
|
-
label: r,
|
|
2167
|
-
options: a,
|
|
2168
|
-
borderB: t = !1,
|
|
2169
|
-
borderT: l = !1,
|
|
2170
|
-
type: o = "arbitrary",
|
|
2171
|
-
units: n = Hs,
|
|
2172
|
-
negative: c = !1
|
|
2173
|
-
}) => {
|
|
2174
|
-
const { t: p } = E(), [s, d] = j(a[0].key), u = ue(), i = B((h) => R(u, "property").includes(h), [u]);
|
|
2175
|
-
return /* @__PURE__ */ e.jsxs(
|
|
2176
|
-
"div",
|
|
2177
|
-
{
|
|
2178
|
-
className: `mb-2 border-gray-800 py-2 first:pt-0 last:pb-0 ${t ? "border-b" : ""} ${l ? "border-t" : ""}`,
|
|
2179
|
-
children: [
|
|
2180
|
-
/* @__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: p(r) }),
|
|
2182
|
-
/* @__PURE__ */ e.jsx("div", { className: "mb-3 flex grow flex-row flex-wrap gap-x-px", children: $.Children.toArray(
|
|
2183
|
-
a.map(({ label: h, key: y }) => /* @__PURE__ */ e.jsx("div", { className: "first:rounded-l last:rounded-r", children: /* @__PURE__ */ e.jsxs(U, { children: [
|
|
2184
|
-
/* @__PURE__ */ e.jsx(K, { asChild: !0, children: /* @__PURE__ */ e.jsxs(
|
|
2185
|
-
"button",
|
|
2186
|
-
{
|
|
2187
|
-
type: "button",
|
|
2188
|
-
onClick: () => d(y),
|
|
2189
|
-
className: `relative cursor-pointer rounded-full p-1 text-[8px] ${y === s ? " bg-[#3E57F0] text-white" : "text-gray-600 dark:text-gray-300"}`,
|
|
2190
|
-
children: [
|
|
2191
|
-
$.createElement("div", {
|
|
2192
|
-
className: i(y) ? "-bottom-1.5 absolute bg-[#3E57F0] h-[2px] left-0 w-full" : ""
|
|
2193
|
-
}),
|
|
2194
|
-
$.createElement(g(gt, y, Je), { className: "text-inherit w-3 h-3" })
|
|
2195
|
-
]
|
|
2196
|
-
}
|
|
2197
|
-
) }),
|
|
2198
|
-
/* @__PURE__ */ e.jsx(G, { children: Y(re(h)) })
|
|
2199
|
-
] }) }))
|
|
2200
|
-
) })
|
|
2201
|
-
] }),
|
|
2202
|
-
/* @__PURE__ */ e.jsx("div", { className: "mt-0 flex items-center", children: /* @__PURE__ */ e.jsx(
|
|
2203
|
-
Re,
|
|
2204
|
-
{
|
|
2205
|
-
type: o,
|
|
2206
|
-
units: [...n],
|
|
2207
|
-
label: "",
|
|
2208
|
-
property: s,
|
|
2209
|
-
negative: c
|
|
2210
|
-
}
|
|
2211
|
-
) })
|
|
2212
|
-
]
|
|
2213
|
-
}
|
|
2214
|
-
);
|
|
2215
|
-
}, Ds = ({ heading: r, items: a }) => {
|
|
2216
|
-
const { t } = E(), l = ue(), o = T(() => {
|
|
2217
|
-
const n = (s) => De(
|
|
2218
|
-
s.map((d) => d.styleType === "multiple" ? R(d.options, "key") : d.property)
|
|
2219
|
-
), c = De(
|
|
2220
|
-
a.map((s) => s.styleType === "accordion" ? n(s.items) : s.styleType === "multiple" ? R(s.options, "key") : s.property)
|
|
2221
|
-
), p = R(l, "property");
|
|
2222
|
-
return Ht(c, p).length > 0;
|
|
2223
|
-
}, [l, a]);
|
|
2224
|
-
return /* @__PURE__ */ e.jsxs("details", { children: [
|
|
2225
|
-
/* @__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
|
-
t(r),
|
|
2227
|
-
o ? /* @__PURE__ */ e.jsx(
|
|
2228
|
-
"span",
|
|
2229
|
-
{
|
|
2230
|
-
className: `ml-1 mr-2 inline-block h-[8px] w-[8px] rounded-full ${o ? "bg-blue-500" : "bg-gray-300"}`
|
|
2231
|
-
}
|
|
2232
|
-
) : null
|
|
2233
|
-
] }) }),
|
|
2234
|
-
/* @__PURE__ */ e.jsx("div", { className: "p-2", children: a.map((n) => n.styleType === "multiple" ? /* @__PURE__ */ e.jsx(ht, { ...n }, n.label) : /* @__PURE__ */ e.jsx(Re, { ...n }, n.label)) })
|
|
2235
|
-
] });
|
|
2236
|
-
}, Bs = We({}), xe = ({ section: r }) => {
|
|
2237
|
-
const { t: a } = E(), t = ue(), l = M(), o = B(
|
|
2238
|
-
(s = []) => {
|
|
2239
|
-
const d = {};
|
|
2240
|
-
for (let i = 0; i < t.length; i++)
|
|
2241
|
-
d[t[i].property] = t[i].cls;
|
|
2242
|
-
let u = !0;
|
|
2243
|
-
for (const i in s)
|
|
2244
|
-
if (!de(d, i) || d[i] !== s[i]) {
|
|
2245
|
-
u = !1;
|
|
2246
|
-
break;
|
|
2247
|
-
}
|
|
2248
|
-
return u;
|
|
2249
|
-
},
|
|
2250
|
-
[t]
|
|
2251
|
-
), n = T(() => ({}), []), [c] = le(), p = T(() => {
|
|
2252
|
-
const s = `${Le(c, "0.prop")}_attrs`;
|
|
2253
|
-
return !rs(Le(l, s, {}));
|
|
2254
|
-
}, [c]);
|
|
2255
|
-
return /* @__PURE__ */ e.jsx(Bs.Provider, { value: n, children: /* @__PURE__ */ e.jsxs(fe, { value: r.heading, children: [
|
|
2256
|
-
/* @__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: [
|
|
2257
|
-
r.heading === "Attributes" && p ? /* @__PURE__ */ e.jsx("span", { className: "mr-2 inline-block h-[8px] w-[8px] rounded-full bg-blue-600" }) : null,
|
|
2258
|
-
/* @__PURE__ */ e.jsx("div", { className: "flex items-center gap-x-2", children: a(r.heading) })
|
|
2259
|
-
] }) }),
|
|
2260
|
-
/* @__PURE__ */ e.jsx(we, { className: "bg-gray-100 px-3.5 py-2", children: $.Children.toArray(
|
|
2261
|
-
r.items.map((s) => de(s, "component") ? $.createElement(s.component, { key: s.label }) : de(s, "styleType") ? s.styleType === "multiple" ? /* @__PURE__ */ e.jsx(ht, { ...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))
|
|
2262
|
-
) })
|
|
2263
|
-
] }) });
|
|
2264
|
-
}, As = () => {
|
|
2265
|
-
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`, {});
|
|
2266
|
-
if (b(l) && (!de(n, "props") || b(p)))
|
|
2267
|
-
return null;
|
|
2268
|
-
const s = (d) => {
|
|
2269
|
-
const u = d.trim().toLowerCase().replace(/ +(?= )/g, "").split(" ");
|
|
2270
|
-
o([r._id], u, !0);
|
|
2271
|
-
};
|
|
2272
|
-
return /* @__PURE__ */ e.jsx("div", { className: "h-10", children: /* @__PURE__ */ e.jsxs(Rr, { children: [
|
|
2273
|
-
/* @__PURE__ */ e.jsx(Vr, { asChild: !0, children: /* @__PURE__ */ e.jsx("div", { className: "px-4", children: /* @__PURE__ */ e.jsxs(P, { variant: "default", className: "w-full", size: "sm", children: [
|
|
2274
|
-
t("Apply Presets"),
|
|
2275
|
-
/* @__PURE__ */ e.jsx(Jt, {})
|
|
2276
|
-
] }) }) }),
|
|
2277
|
-
/* @__PURE__ */ e.jsx(Hr, { className: "max-h-80 w-56", children: /* @__PURE__ */ e.jsxs(Dr, { className: "no-scrollbar h-full", children: [
|
|
2278
|
-
b(p) ? null : /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
2279
|
-
/* @__PURE__ */ e.jsxs(Ie, { children: [
|
|
2280
|
-
n.type,
|
|
2281
|
-
" ",
|
|
2282
|
-
t("presets")
|
|
2283
|
-
] }),
|
|
2284
|
-
/* @__PURE__ */ e.jsx(Pe, {}),
|
|
2285
|
-
/* @__PURE__ */ e.jsx($e, { children: he(p).map((d) => /* @__PURE__ */ e.jsxs(Ee, { className: "group text-xs", onClick: () => s(p[d]), children: [
|
|
2286
|
-
me(Y(t(d))),
|
|
2287
|
-
/* @__PURE__ */ e.jsx(Me, { className: "invisible hover:font-bold hover:text-blue-600 group-hover:visible", children: t("apply") })
|
|
2288
|
-
] })) })
|
|
2289
|
-
] }),
|
|
2290
|
-
b(l) ? null : /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
2291
|
-
/* @__PURE__ */ e.jsx(Ie, { children: t("Global presets") }),
|
|
2292
|
-
/* @__PURE__ */ e.jsx(Pe, {}),
|
|
2293
|
-
/* @__PURE__ */ e.jsx($e, { children: he(l).map((d) => /* @__PURE__ */ e.jsxs(Ee, { className: "group text-xs", onClick: () => s(l[d]), children: [
|
|
2294
|
-
me(Y(t(d))),
|
|
2295
|
-
/* @__PURE__ */ e.jsx(Me, { className: "invisible hover:font-bold hover:text-blue-600 group-hover:visible", children: t("apply") })
|
|
2296
|
-
] })) })
|
|
2297
|
-
] })
|
|
2298
|
-
] }) })
|
|
2299
|
-
] }) });
|
|
2300
|
-
};
|
|
2301
|
-
function Is() {
|
|
2302
|
-
const { flexChild: r, gridChild: a } = Br(), [t] = le();
|
|
2303
|
-
return b(t) ? null : /* @__PURE__ */ e.jsxs("div", { className: "flex h-full flex-col", children: [
|
|
2304
|
-
/* @__PURE__ */ e.jsx(As, {}),
|
|
2305
|
-
/* @__PURE__ */ e.jsxs(lt, { defaultValue: ["Styles"], type: "multiple", className: "w-full", children: [
|
|
2306
|
-
r && /* @__PURE__ */ e.jsx(xe, { section: xs }),
|
|
2307
|
-
a ? /* @__PURE__ */ e.jsx(xe, { section: ys }) : null,
|
|
2308
|
-
hs.map((l) => /* @__PURE__ */ e.jsx(xe, { section: l }, l.heading))
|
|
2309
|
-
] })
|
|
2310
|
-
] });
|
|
2311
|
-
}
|
|
2312
|
-
const Ps = {
|
|
2313
|
-
px: 1,
|
|
2314
|
-
"%": 1,
|
|
2315
|
-
em: 100,
|
|
2316
|
-
rem: 100,
|
|
2317
|
-
ch: 1,
|
|
2318
|
-
vw: 1,
|
|
2319
|
-
vh: 1,
|
|
2320
|
-
"-": 1,
|
|
2321
|
-
deg: 1,
|
|
2322
|
-
ms: 0.1
|
|
2323
|
-
}, Eo = () => {
|
|
2324
|
-
const r = M(), { t: a } = E(), [t, l] = $.useState(""), [o, n] = $.useState({
|
|
2325
|
-
onDrag: (s) => s,
|
|
2326
|
-
onDragEnd: (s) => s,
|
|
2327
|
-
dragStartY: 0,
|
|
2328
|
-
dragging: !1,
|
|
2329
|
-
dragStartValue: 0,
|
|
2330
|
-
dragUnit: "",
|
|
2331
|
-
negative: !1,
|
|
2332
|
-
cssProperty: ""
|
|
2333
|
-
}), c = ce(
|
|
2334
|
-
(s) => {
|
|
2335
|
-
const d = !g(o, "negative", !1), u = g(o, "cssProperty", "");
|
|
2336
|
-
let i = parseFloat(o.dragStartValue);
|
|
2337
|
-
i = Ke(i) ? 0 : i;
|
|
2338
|
-
let h = Ps[o.dragUnit];
|
|
2339
|
-
(q(u, "scale") || u === "opacity") && (h = 10);
|
|
2340
|
-
let x = (o.dragStartY - s.pageY) / h + i;
|
|
2341
|
-
d && x < 0 && (x = 0), u === "opacity" && x > 1 && (x = 1), o.onDrag(`${x}`), l(`${x}`);
|
|
2342
|
-
},
|
|
2343
|
-
[o],
|
|
2344
|
-
50
|
|
2345
|
-
), p = B(() => {
|
|
2346
|
-
setTimeout(() => o.onDragEnd(`${t}`), 100), n({
|
|
2347
|
-
onDrag: (s) => s,
|
|
2348
|
-
onDragEnd: (s) => s,
|
|
2349
|
-
dragStartY: 0,
|
|
2350
|
-
dragging: !1,
|
|
2351
|
-
dragStartValue: 0,
|
|
2352
|
-
dragUnit: "",
|
|
2353
|
-
negative: !1,
|
|
2354
|
-
cssProperty: ""
|
|
2355
|
-
});
|
|
2356
|
-
}, [o, t, n]);
|
|
2357
|
-
return Dt(r) ? /* @__PURE__ */ e.jsx("div", { className: "p-4 text-center", children: /* @__PURE__ */ e.jsxs("div", { className: "space-y-4 rounded-xl p-4", children: [
|
|
2358
|
-
/* @__PURE__ */ e.jsx(Qt, { className: "mx-auto text-3xl" }),
|
|
2359
|
-
/* @__PURE__ */ e.jsx("h1", { children: a("no_block_selected_for_styling") })
|
|
2360
|
-
] }) }) : /* @__PURE__ */ e.jsx(dt, { children: /* @__PURE__ */ e.jsxs(yt.Provider, { value: { setDragData: n }, children: [
|
|
2361
|
-
o.dragging ? /* @__PURE__ */ e.jsx(
|
|
2362
|
-
"div",
|
|
2363
|
-
{
|
|
2364
|
-
onMouseMove: c,
|
|
2365
|
-
onMouseUp: () => p(),
|
|
2366
|
-
className: "absolute inset-0 z-30 cursor-row-resize bg-gray-300/10"
|
|
2367
|
-
}
|
|
2368
|
-
) : null,
|
|
2369
|
-
/* @__PURE__ */ e.jsx(cs, {}),
|
|
2370
|
-
/* @__PURE__ */ e.jsx(Is, {}),
|
|
2371
|
-
/* @__PURE__ */ e.jsx("br", {}),
|
|
2372
|
-
/* @__PURE__ */ e.jsx("br", {}),
|
|
2373
|
-
/* @__PURE__ */ e.jsx("br", {})
|
|
2374
|
-
] }) });
|
|
2375
|
-
};
|
|
2376
|
-
export {
|
|
2377
|
-
Eo as default
|
|
2378
|
-
};
|