@chaibuilder/sdk 0.1.30 → 0.1.32
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/dist/{AddBlocks-4f2c5dc4.js → AddBlocks-4b96d545.js} +1 -1
- package/dist/{AddBlocks-5ca17264.cjs → AddBlocks-e4f51b58.cjs} +1 -1
- package/dist/{BrandingOptions-0773c5fd.cjs → BrandingOptions-52f9691c.cjs} +1 -1
- package/dist/{BrandingOptions-2044d3cb.js → BrandingOptions-c91e9d44.js} +1 -1
- package/dist/{CanvasArea-575f601e.js → CanvasArea-957f5f74.js} +2 -2
- package/dist/{CanvasArea-71355900.cjs → CanvasArea-b8c26858.cjs} +2 -2
- package/dist/{CurrentPage-09c74e35.cjs → CurrentPage-715fe809.cjs} +1 -1
- package/dist/{CurrentPage-e6f23078.js → CurrentPage-fb4c55bc.js} +1 -1
- package/dist/{ImagesPanel-38c44785.js → ImagesPanel-3fb8087f.js} +1 -1
- package/dist/{ImagesPanel-0db5c72f.cjs → ImagesPanel-56ca0618.cjs} +1 -1
- package/dist/{Layers-a7dc3c09.js → Layers-6866cb0c.js} +3 -3
- package/dist/{Layers-975fed10.cjs → Layers-a955d0bb.cjs} +1 -1
- package/dist/{MarkAsGlobalBlock-b988f89e.cjs → MarkAsGlobalBlock-cbcb3003.cjs} +1 -1
- package/dist/{MarkAsGlobalBlock-39df9332.js → MarkAsGlobalBlock-f28148d9.js} +1 -1
- package/dist/{PagesPanel-9de2d25b.js → PagesPanel-003201ca.js} +2 -2
- package/dist/{PagesPanel-ba746cd1.cjs → PagesPanel-7b8f54e1.cjs} +1 -1
- package/dist/{ProjectPanel-eef9f5d4.cjs → ProjectPanel-6c5f2470.cjs} +1 -1
- package/dist/{ProjectPanel-862243ef.js → ProjectPanel-83321040.js} +2 -2
- package/dist/Settings-8f07a4b7.cjs +1 -0
- package/dist/{Settings-8b2a5a12.js → Settings-ad55d8cb.js} +919 -852
- package/dist/{SidePanels-41116ddd.cjs → SidePanels-446b93e7.cjs} +1 -1
- package/dist/{SidePanels-c1abd140.js → SidePanels-96bf29c6.js} +3 -3
- package/dist/{Topbar-3f8ee9ec.js → Topbar-1c4964e5.js} +1 -1
- package/dist/{Topbar-f622beef.cjs → Topbar-5eeea40a.cjs} +1 -1
- package/dist/UnsplashImages-ef3b6388.cjs +1 -0
- package/dist/{UnsplashImages-10c95b63.js → UnsplashImages-fe480747.js} +6 -3
- package/dist/{add-page-modal-3be04ab6.js → add-page-modal-2ef8a63c.js} +5 -5
- package/dist/{add-page-modal-7c2eea7f.cjs → add-page-modal-56dc3c56.cjs} +1 -1
- package/dist/command-6f260f61.js +97 -0
- package/dist/command-b1103666.cjs +1 -0
- package/dist/core.cjs +1 -1
- package/dist/core.js +1 -1
- package/dist/{delete-page-modal-13bf57f1.cjs → delete-page-modal-88aeacfd.cjs} +1 -1
- package/dist/{delete-page-modal-e6d85612.js → delete-page-modal-961dcc5f.js} +1 -1
- package/dist/{dialog-3d4e82ed.js → dialog-18207bef.js} +2 -2
- package/dist/{form-725e3191.js → form-046bcdbc.js} +1 -1
- package/dist/{form-99b51245.cjs → form-2dc05f35.cjs} +1 -1
- package/dist/{index-91c0470a.js → index-370ce00c.js} +3 -3
- package/dist/{index-a954d733.cjs → index-86352d44.cjs} +2 -2
- package/dist/{link-2af5de8b.js → link-e3a788f7.js} +2 -2
- package/dist/{link-86ac8848.cjs → link-e71b94f1.cjs} +1 -1
- package/dist/{page-viewer-18a13862.js → page-viewer-0c45ce74.js} +2 -2
- package/dist/{page-viewer-e0508ce9.cjs → page-viewer-e0d9895d.cjs} +1 -1
- package/dist/{project-general-setting-4c7172c1.js → project-general-setting-c5d96f79.js} +5 -5
- package/dist/{project-general-setting-66ba78e9.cjs → project-general-setting-d4d96611.cjs} +1 -1
- package/dist/{project-seo-setting-a9403f1d.cjs → project-seo-setting-6356c72f.cjs} +1 -1
- package/dist/{project-seo-setting-c1980ec3.js → project-seo-setting-639e4f33.js} +4 -4
- package/dist/{single-page-detail-6ece84b9.js → single-page-detail-22e7bc3b.js} +6 -6
- package/dist/{single-page-detail-6872bd4d.cjs → single-page-detail-36430438.cjs} +1 -1
- package/dist/ui.cjs +1 -1
- package/dist/ui.js +214 -281
- package/package.json +1 -1
- package/dist/Settings-8796249e.cjs +0 -1
- package/dist/UnsplashImages-0d091e33.cjs +0 -1
- package/dist/input-42acea7e.cjs +0 -1
- package/dist/input-a0ea2bc7.js +0 -19
|
@@ -1,29 +1,31 @@
|
|
|
1
1
|
import { j as e } from "./jsx-runtime-944c88e2.js";
|
|
2
|
-
import * as
|
|
3
|
-
import
|
|
4
|
-
import { useThrottledCallback as
|
|
5
|
-
import { map as
|
|
6
|
-
import { useTranslation as
|
|
7
|
-
import { PlusIcon as
|
|
8
|
-
import { T as
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import { D as
|
|
12
|
-
import { getChaiDataProviders as
|
|
13
|
-
import { TrashIcon as
|
|
14
|
-
import
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import
|
|
21
|
-
import {
|
|
22
|
-
import
|
|
23
|
-
import
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
26
|
-
import { S as
|
|
2
|
+
import * as ne from "react";
|
|
3
|
+
import $, { useState as w, useEffect as E, useMemo as N, useCallback as A, createContext as Oe, useContext as re } from "react";
|
|
4
|
+
import { useThrottledCallback as me } from "@react-hookz/web";
|
|
5
|
+
import { map as C, isEmpty as b, last as ye, forEach as je, set as Me, get as p, startCase as Y, filter as be, truncate as it, isArray as ae, includes as M, first as we, split as dt, toLower as te, find as ct, omit as pt, keys as ut, cloneDeep as xt, each as gt, capitalize as ht, reject as mt, nth as Re, startsWith as z, isNumber as yt, parseInt as bt, isNaN as _e, findLast as ft, has as ge, flatten as U, intersection as Ee, isNull as vt } from "lodash";
|
|
6
|
+
import { useTranslation as Fe } from "react-i18next";
|
|
7
|
+
import { PlusIcon as Ce, Cross2Icon as Ye, EyeOpenIcon as jt, EyeClosedIcon as Ve, BorderAllIcon as O, WidthIcon as R, HeightIcon as V, ArrowUpIcon as q, ArrowRightIcon as J, ArrowDownIcon as Q, ArrowLeftIcon as ee, ArrowTopLeftIcon as wt, ArrowTopRightIcon as Ct, ArrowBottomRightIcon as kt, ArrowBottomLeftIcon as Nt, AlignLeftIcon as St, AlignCenterHorizontallyIcon as Tt, AlignRightIcon as Rt, StretchHorizontallyIcon as Vt, FontItalicIcon as Ht, UnderlineIcon as Bt, OverlineIcon as At, LetterCaseUppercaseIcon as Dt, Cross1Icon as $t, InfoCircledIcon as ke, MinusIcon as Pt, BoxIcon as Xe, TriangleDownIcon as It, RowSpacingIcon as Lt, TrashIcon as We, MixerHorizontalIcon as Ze } from "@radix-ui/react-icons";
|
|
8
|
+
import { T as Ot, a as Mt, b as He, c as Be } from "./tabs-85caa1e8.js";
|
|
9
|
+
import _t from "@rjsf/core";
|
|
10
|
+
import Et from "@rjsf/validator-ajv8";
|
|
11
|
+
import { D as G, E as Ft, d as ze, G as Ue, H as Yt, I as Xt, J as Wt, j as Ne, K as Ge, L as Ke, i as qe, e as Zt, M as Je, f as Ae, N as pe, c as zt, O as Ut, P as Gt } from "./index-370ce00c.js";
|
|
12
|
+
import { getChaiDataProviders as Kt, getBlockComponent as Qe, SingleLineText as qt } from "@chaibuilder/blocks";
|
|
13
|
+
import { EditIcon as Jt, TrashIcon as Qt, Check as er } from "lucide-react";
|
|
14
|
+
import { u as et } from "./useChaiExternalData-192c7896.js";
|
|
15
|
+
import { d as X, e as W, f as Z, B as ue, g as tr } from "./useBuilderProp-81a14920.js";
|
|
16
|
+
import { D as rr, a as sr, b as lr, c as or, e as nr, f as ar, d as ir } from "./dialog-18207bef.js";
|
|
17
|
+
import { P as dr, a as cr, b as pr } from "./popover-f7addcf4.js";
|
|
18
|
+
import { C as ur, b as xr, c as gr, d as hr, e as mr, f as yr, I as br } from "./command-6f260f61.js";
|
|
19
|
+
import { A as tt, a as ie, b as de, c as ce } from "./accordion-c0176dc5.js";
|
|
20
|
+
import { R as fr, I as vr, a as jr, L as wr } from "./link-e3a788f7.js";
|
|
21
|
+
import { useAtom as Cr } from "jotai";
|
|
22
|
+
import kr from "react-autosuggest";
|
|
23
|
+
import Nr from "fuse.js";
|
|
24
|
+
import { A as Sr, C as xe, d as Tr } from "./html-to-json-45e0e3b5.js";
|
|
25
|
+
import { L as Se } from "./label-e770a087.js";
|
|
26
|
+
import { S as Rr } from "./MODIFIERS-2f19c314.js";
|
|
27
|
+
import { S as Vr } from "./scroll-area-83bd9e8f.js";
|
|
28
|
+
import { S as Hr, c as Br, b as Ar, d as Dr, f as H } from "./select-7fddd7c3.js";
|
|
27
29
|
import "@radix-ui/react-tabs";
|
|
28
30
|
import "./utils-ac68b2c8.js";
|
|
29
31
|
import "clsx";
|
|
@@ -43,340 +45,405 @@ import "@radix-ui/react-slot";
|
|
|
43
45
|
import "class-variance-authority";
|
|
44
46
|
import "@radix-ui/react-tooltip";
|
|
45
47
|
import "@radix-ui/react-toast";
|
|
48
|
+
import "@radix-ui/react-dialog";
|
|
49
|
+
import "@radix-ui/react-popover";
|
|
50
|
+
import "cmdk";
|
|
46
51
|
import "@radix-ui/react-accordion";
|
|
47
52
|
import "react-icons-picker";
|
|
48
|
-
import "./
|
|
49
|
-
import "@radix-ui/react-dialog";
|
|
50
|
-
import "./ImagesPanel-38c44785.js";
|
|
53
|
+
import "./ImagesPanel-3fb8087f.js";
|
|
51
54
|
import "react-quill";
|
|
52
55
|
import "himalaya";
|
|
53
56
|
import "@radix-ui/react-label";
|
|
54
57
|
import "@radix-ui/react-select";
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
58
|
+
const $r = $.lazy(() => import("react-json-view"));
|
|
59
|
+
function Pr(t) {
|
|
60
|
+
const s = [], r = {};
|
|
61
|
+
function l(o, a) {
|
|
62
|
+
je(a, (d, i) => {
|
|
63
|
+
const n = o ? `${o}.${i}` : i, u = ae(d) ? "list" : typeof d;
|
|
64
|
+
s.push(n), r[n] = u === "string" ? "text" : u === "object" ? "model" : u, u === "object" && !ae(d) && l(n, d);
|
|
61
65
|
});
|
|
62
66
|
}
|
|
63
|
-
return
|
|
67
|
+
return l("", pt(t, ["styles", "_type", "_id", "_name", "_bindings"])), { paths: s, pathsType: r };
|
|
64
68
|
}
|
|
65
|
-
const
|
|
66
|
-
if (!
|
|
69
|
+
const fe = ({ data: t, fullView: s }) => {
|
|
70
|
+
if (!t)
|
|
67
71
|
return null;
|
|
68
|
-
const
|
|
69
|
-
return
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
M(() => {
|
|
82
|
-
b(c) && s("");
|
|
83
|
-
}, [c]), M(() => h(a), [a]);
|
|
84
|
-
const f = () => g.filter((v) => {
|
|
85
|
-
const C = b(c) || O(ne(v), ne(c));
|
|
86
|
-
return r === "PATH" ? C && d === u(y, v, "") : C && !O(i, v) && u(x, `props.${fe(Ne(v, "."))}.binding`);
|
|
87
|
-
}), [$, S] = k(() => f());
|
|
88
|
-
M(() => S(() => f()), [d]);
|
|
89
|
-
const j = r === "PATH" && b($) && n && !b(d), I = {
|
|
90
|
-
autoComplete: "off",
|
|
91
|
-
autoCorrect: "on",
|
|
92
|
-
autoCapitalize: "off",
|
|
93
|
-
spellCheck: !1,
|
|
94
|
-
placeholder: j ? "No available options" : t,
|
|
95
|
-
value: c,
|
|
96
|
-
disabled: o,
|
|
97
|
-
onFocus: () => p(r === "PATH"),
|
|
98
|
-
onBlur: () => {
|
|
99
|
-
p(!1), g.includes(c) ? s(c) : (h(""), s(""));
|
|
100
|
-
},
|
|
101
|
-
onChange: (v, { newValue: C }) => h(j ? "" : C),
|
|
102
|
-
className: `chai-input w-full ${o ? "cursor-not-allowed" : ""} ${j ? "placeholder-red-400" : ""}`
|
|
103
|
-
}, B = (v) => /* @__PURE__ */ e.jsxs(
|
|
104
|
-
"div",
|
|
105
|
-
{
|
|
106
|
-
className: "rounded-md px-1 py-1.5 flex items-center justify-between space-x-2 font-light relative",
|
|
107
|
-
"data-suggest": v,
|
|
108
|
-
children: [
|
|
109
|
-
/* @__PURE__ */ e.jsx("div", { className: "-mt-1 w-full h-full absolute opacity-0 z-20", children: v }),
|
|
110
|
-
/* @__PURE__ */ e.jsxs("div", { className: "w-full", children: [
|
|
111
|
-
/* @__PURE__ */ e.jsx("div", { className: "leading-4 text-xs flex items-center text-gray-800", children: P.Children.toArray(
|
|
112
|
-
N(Ne(v, "."), (C, _) => /* @__PURE__ */ e.jsxs("span", { className: "flex items-end", children: [
|
|
113
|
-
_ > 0 && /* @__PURE__ */ e.jsx(Gt, { size: 14, className: "h-full text-gray-400" }),
|
|
114
|
-
Q(C)
|
|
115
|
-
] }))
|
|
116
|
-
) }),
|
|
117
|
-
r === "PATH" && /* @__PURE__ */ e.jsx(xr, { data: u(l, v) })
|
|
118
|
-
] }),
|
|
119
|
-
r === "PROP" && /* @__PURE__ */ e.jsx("div", { className: "bg-purple-100 text-purple-400 text-[9px] flex items-center font-medium h-4 px-2 rounded-full", children: Q(u(y, v, "")) })
|
|
120
|
-
]
|
|
121
|
-
}
|
|
122
|
-
);
|
|
123
|
-
return /* @__PURE__ */ e.jsx(
|
|
124
|
-
Qe,
|
|
125
|
-
{
|
|
126
|
-
suggestions: $,
|
|
127
|
-
onSuggestionsFetchRequested: () => S(() => f()),
|
|
128
|
-
onSuggestionsClearRequested: () => S([]),
|
|
129
|
-
onSuggestionSelected: (v) => {
|
|
130
|
-
if (v.type === "click") {
|
|
131
|
-
const C = u(v.target, "childNodes[0].data", "");
|
|
132
|
-
g.includes(C) && s(C);
|
|
133
|
-
} else
|
|
134
|
-
s(v.target.value);
|
|
135
|
-
},
|
|
136
|
-
getSuggestionValue: (v) => v,
|
|
137
|
-
renderSuggestion: B,
|
|
138
|
-
shouldRenderSuggestions: () => !0,
|
|
139
|
-
inputProps: I,
|
|
140
|
-
containerProps: { className: "w-full" },
|
|
141
|
-
theme: {
|
|
142
|
-
suggestion: "text-gray-500 border-b overflow-hidden text-ellipsis",
|
|
143
|
-
suggestionHighlighted: "bg-blue-100 text-blue-800 font-normal cursor-pointer",
|
|
144
|
-
suggestionsContainerOpen: "bg-white border border-gray-300 z-50 max-h-52 left-2 overflow-y-auto w-full rounded-md shadow-2xl text-sm font-light w-full"
|
|
72
|
+
const r = typeof t;
|
|
73
|
+
return s ? typeof t == "object" ? /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
74
|
+
/* @__PURE__ */ e.jsx("div", { className: "h-3" }),
|
|
75
|
+
/* @__PURE__ */ e.jsx(Ft, { children: /* @__PURE__ */ e.jsx(
|
|
76
|
+
$r,
|
|
77
|
+
{
|
|
78
|
+
style: { maxHeight: "40vh", overflowY: "auto" },
|
|
79
|
+
name: "Content",
|
|
80
|
+
enableClipboard: !1,
|
|
81
|
+
displayObjectSize: !1,
|
|
82
|
+
displayDataTypes: !1,
|
|
83
|
+
src: t,
|
|
84
|
+
collapsed: !0
|
|
145
85
|
}
|
|
146
|
-
}
|
|
147
|
-
)
|
|
148
|
-
|
|
149
|
-
|
|
86
|
+
) })
|
|
87
|
+
] }) : /* @__PURE__ */ e.jsxs("div", { className: "text-gray-800/50 text-[12px] leading-4 w-full max-h-36 overflow-x-hidden overflow-y-auto", children: [
|
|
88
|
+
/* @__PURE__ */ e.jsx("span", { className: "font-medium text-gray-800/80", children: "Content: " }),
|
|
89
|
+
t
|
|
90
|
+
] }) : /* @__PURE__ */ e.jsx("div", { className: "text-[10px] text-gray-800/50 leading-3 whitespace-nowrap overflow-hidden w-full", children: it(r === "object" ? JSON.stringify(t) : t, { length: 40 }) });
|
|
91
|
+
}, De = ({
|
|
92
|
+
type: t,
|
|
93
|
+
value: s = "",
|
|
94
|
+
setValue: r,
|
|
95
|
+
data: l,
|
|
150
96
|
onChange: o,
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
dataProvider: l,
|
|
154
|
-
appliedBindings: s
|
|
97
|
+
dataType: a,
|
|
98
|
+
appliedBindings: d
|
|
155
99
|
}) => {
|
|
156
|
-
const
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
100
|
+
const { paths: i, pathsType: n } = Pr(l), u = t === "PROP" ? Qe(l == null ? void 0 : l._type) : {}, x = t === "PROP", [c, m] = w(!1), h = N(() => t === "PROP" ? i.filter(
|
|
101
|
+
(g) => !M(d, g) && p(u, `props.${we(dt(g, "."))}.binding`)
|
|
102
|
+
) : i.filter((g) => a === p(n, g, "")), [t, i, d, a, u]);
|
|
103
|
+
return E(() => {
|
|
104
|
+
s && o(s);
|
|
105
|
+
}, [s, t]), /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
106
|
+
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-4", children: [
|
|
107
|
+
/* @__PURE__ */ e.jsx("p", { className: "text-sm text-muted-foreground", children: Y(te(t)) }),
|
|
108
|
+
/* @__PURE__ */ e.jsxs(dr, { open: c, onOpenChange: m, children: [
|
|
109
|
+
/* @__PURE__ */ e.jsx(cr, { asChild: !0, children: /* @__PURE__ */ e.jsx(
|
|
110
|
+
ue,
|
|
111
|
+
{
|
|
112
|
+
variant: "outline",
|
|
113
|
+
size: "sm",
|
|
114
|
+
className: ` ${b(s) ? "bg-blue-500 text-gray-100 hover:bg-blue-400 hover:text-white w-44 justify-center" : "min-w-[350px] justify-between items-center"}`,
|
|
115
|
+
children: s ? /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
116
|
+
/* @__PURE__ */ e.jsxs("span", { className: "text-sm pr-8", children: [
|
|
117
|
+
x && /* @__PURE__ */ e.jsx("span", { className: "text-[10px] text-purple-500 bg-purple-100 px-2 py-0.5 mr-2 rounded-full", children: Y(a) }),
|
|
118
|
+
s
|
|
119
|
+
] }),
|
|
120
|
+
/* @__PURE__ */ e.jsx("span", { className: "text-[9px] text-blue-400 underline cursor-pointer hover:text-blue-700", children: "Change" })
|
|
121
|
+
] }) : /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
122
|
+
"+ Set ",
|
|
123
|
+
Y(te(t))
|
|
124
|
+
] })
|
|
125
|
+
}
|
|
126
|
+
) }),
|
|
127
|
+
/* @__PURE__ */ e.jsx(pr, { className: "p-0 z-[999] min-w-[300px]", side: "right", align: "start", children: /* @__PURE__ */ e.jsxs(ur, { children: [
|
|
128
|
+
/* @__PURE__ */ e.jsx(xr, { placeholder: `Choose ${te(t)}...` }),
|
|
129
|
+
/* @__PURE__ */ e.jsxs(gr, { children: [
|
|
130
|
+
/* @__PURE__ */ e.jsx(hr, { children: "No results found." }),
|
|
131
|
+
/* @__PURE__ */ e.jsx(mr, { children: C(h, (g) => /* @__PURE__ */ e.jsxs(
|
|
132
|
+
yr,
|
|
133
|
+
{
|
|
134
|
+
value: g,
|
|
135
|
+
className: `cursor-pointer ${x ? "flex justify-between items-center" : "flex flex-col items-start justify-start"}`,
|
|
136
|
+
onSelect: (f) => {
|
|
137
|
+
r(ct(h, (S) => S === f) || null), m(!1);
|
|
138
|
+
},
|
|
139
|
+
children: [
|
|
140
|
+
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-x-2", children: [
|
|
141
|
+
/* @__PURE__ */ e.jsx(er, { className: `w-4 h-4 text-green-500 ${s === g ? "" : "opacity-0"}` }),
|
|
142
|
+
g
|
|
143
|
+
] }),
|
|
144
|
+
x ? /* @__PURE__ */ e.jsx("div", { children: /* @__PURE__ */ e.jsx("span", { className: "text-[10px] text-purple-500 bg-purple-100 px-2 py-0.5 rounded-full", children: Y(p(n, g, "")) }) }) : /* @__PURE__ */ e.jsx("div", { className: "pl-6", children: /* @__PURE__ */ e.jsx(fe, { data: p(l, g) }) })
|
|
145
|
+
]
|
|
146
|
+
},
|
|
147
|
+
g
|
|
148
|
+
)) })
|
|
149
|
+
] })
|
|
150
|
+
] }) })
|
|
151
|
+
] })
|
|
152
|
+
] }),
|
|
153
|
+
!x && !b(s) && /* @__PURE__ */ e.jsx("div", { className: "pt-2", children: /* @__PURE__ */ e.jsx(fe, { data: p(l, s, ""), fullView: !0 }) })
|
|
154
|
+
] });
|
|
155
|
+
}, Ir = ({
|
|
156
|
+
appliedBindings: t = [],
|
|
157
|
+
onAddBinding: s,
|
|
158
|
+
editMode: r,
|
|
159
|
+
item: l
|
|
160
|
+
}) => {
|
|
161
|
+
const [o, a] = w(r ? l.key : ""), [d, i] = w(r ? l.value : ""), n = G(), [u] = et(), x = A(
|
|
162
|
+
(h, g) => {
|
|
163
|
+
if (b(h))
|
|
164
|
+
return "";
|
|
171
165
|
{
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
const c = n(p, "PROP");
|
|
178
|
-
o({ target: { name: "key", value: p } }), d !== c && o({ target: { name: "value", value: "" } }), i(c);
|
|
179
|
-
},
|
|
180
|
-
data: a,
|
|
181
|
-
dataType: d,
|
|
182
|
-
appliedBindings: s
|
|
166
|
+
const f = p(g === "PROP" ? n : u, h, "");
|
|
167
|
+
if (ae(f))
|
|
168
|
+
return "list";
|
|
169
|
+
const S = typeof f;
|
|
170
|
+
return S === "string" ? "text" : S === "object" ? "model" : S;
|
|
183
171
|
}
|
|
184
|
-
|
|
185
|
-
|
|
172
|
+
},
|
|
173
|
+
[n, u]
|
|
174
|
+
), [c, m] = w(r ? x(l.key, "PROP") : "");
|
|
175
|
+
return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
176
|
+
/* @__PURE__ */ e.jsxs(or, { children: [
|
|
177
|
+
/* @__PURE__ */ e.jsx(nr, { children: "Add Data Binding" }),
|
|
178
|
+
/* @__PURE__ */ e.jsx(ar, { className: "text-xs", children: "Add prop and path of binding. Click save when you're done." })
|
|
179
|
+
] }),
|
|
180
|
+
/* @__PURE__ */ e.jsxs("div", { className: "flex flex-col gap-1 relative", children: [
|
|
186
181
|
/* @__PURE__ */ e.jsx(
|
|
187
|
-
|
|
182
|
+
De,
|
|
183
|
+
{
|
|
184
|
+
type: "PROP",
|
|
185
|
+
isDisabled: !1,
|
|
186
|
+
placeholder: "Enter prop key",
|
|
187
|
+
value: o,
|
|
188
|
+
setValue: a,
|
|
189
|
+
onChange: (h) => {
|
|
190
|
+
const g = x(h, "PROP");
|
|
191
|
+
a(h), c !== g && i(""), m(g);
|
|
192
|
+
},
|
|
193
|
+
data: n,
|
|
194
|
+
dataType: c,
|
|
195
|
+
appliedBindings: t
|
|
196
|
+
}
|
|
197
|
+
),
|
|
198
|
+
/* @__PURE__ */ e.jsx("div", { className: "h-2" }),
|
|
199
|
+
/* @__PURE__ */ e.jsx(
|
|
200
|
+
De,
|
|
188
201
|
{
|
|
189
202
|
type: "PATH",
|
|
190
|
-
isDisabled: b(
|
|
203
|
+
isDisabled: b(o),
|
|
191
204
|
placeholder: "Enter data path",
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
205
|
+
value: d,
|
|
206
|
+
setValue: i,
|
|
207
|
+
onChange: (h) => {
|
|
208
|
+
const g = x(h, "PATH");
|
|
209
|
+
i(c === g ? h : "");
|
|
196
210
|
},
|
|
197
|
-
data:
|
|
198
|
-
dataType:
|
|
199
|
-
appliedBindings:
|
|
211
|
+
data: u,
|
|
212
|
+
dataType: c,
|
|
213
|
+
appliedBindings: t
|
|
200
214
|
}
|
|
201
|
-
)
|
|
215
|
+
)
|
|
216
|
+
] }),
|
|
217
|
+
/* @__PURE__ */ e.jsx(ir, { children: /* @__PURE__ */ e.jsx(
|
|
218
|
+
ue,
|
|
219
|
+
{
|
|
220
|
+
type: "submit",
|
|
221
|
+
className: "mt-4",
|
|
222
|
+
disabled: b(o) && b(d),
|
|
223
|
+
onClick: () => s({ key: o, value: d }),
|
|
224
|
+
children: "Save"
|
|
225
|
+
}
|
|
226
|
+
) })
|
|
227
|
+
] });
|
|
228
|
+
}, rt = ({ children: t, onAddBinding: s, appliedBindings: r, editMode: l = !0, item: o = {} }) => {
|
|
229
|
+
const [a, d] = w(!1);
|
|
230
|
+
return /* @__PURE__ */ e.jsxs(rr, { children: [
|
|
231
|
+
/* @__PURE__ */ e.jsx(sr, { asChild: !0, onClick: () => d(!0), children: t }),
|
|
232
|
+
a && /* @__PURE__ */ e.jsx(lr, { children: /* @__PURE__ */ e.jsx(
|
|
233
|
+
Ir,
|
|
234
|
+
{
|
|
235
|
+
item: o,
|
|
236
|
+
editMode: l,
|
|
237
|
+
appliedBindings: r,
|
|
238
|
+
onAddBinding: (i) => {
|
|
239
|
+
s(i), d(!1);
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
) })
|
|
243
|
+
] });
|
|
244
|
+
}, Lr = ({
|
|
245
|
+
item: t,
|
|
246
|
+
onAddBinding: s,
|
|
247
|
+
onRemove: r,
|
|
248
|
+
selectedBlock: l,
|
|
249
|
+
dataProvider: o,
|
|
250
|
+
appliedBindings: a
|
|
251
|
+
}) => {
|
|
252
|
+
const [d, i] = w("string"), n = (u, x) => {
|
|
253
|
+
if (b(u))
|
|
254
|
+
return "";
|
|
255
|
+
{
|
|
256
|
+
const c = p(x === "PROP" ? l : o, u, "");
|
|
257
|
+
if (ae(c))
|
|
258
|
+
return "list";
|
|
259
|
+
const m = typeof c;
|
|
260
|
+
return m === "string" ? "text" : m === "object" ? "model" : m;
|
|
261
|
+
}
|
|
262
|
+
};
|
|
263
|
+
return E(() => i(() => n(t.key, "PROP")), [t.key]), /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col border border-gray-200 relative rounded-md p-2", children: [
|
|
264
|
+
/* @__PURE__ */ e.jsx("div", { className: "text-gray-500 font-normal text-sm", children: t.key }),
|
|
265
|
+
/* @__PURE__ */ e.jsx("div", { className: "font-medium leading-5", children: t.value }),
|
|
266
|
+
/* @__PURE__ */ e.jsx(fe, { data: p(o, t.value, "") }),
|
|
267
|
+
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center justify-end gap-x-2", children: [
|
|
268
|
+
/* @__PURE__ */ e.jsx(rt, { editMode: !0, onAddBinding: s, appliedBindings: a, item: t, children: /* @__PURE__ */ e.jsx(Jt, { className: "h-6 w-6 mt-1 cursor-pointer rounded border hover:bg-blue-400 hover:text-white border-blue-400 p-1 text-blue-400 hover:scale-105 duration-200" }) }),
|
|
202
269
|
/* @__PURE__ */ e.jsx(
|
|
203
|
-
|
|
270
|
+
Qt,
|
|
204
271
|
{
|
|
205
|
-
onClick:
|
|
272
|
+
onClick: () => r(),
|
|
206
273
|
className: "h-6 w-6 mt-1 cursor-pointer rounded border hover:bg-red-400 hover:text-white border-red-400 p-1 text-red-400 hover:scale-105 duration-200"
|
|
207
274
|
}
|
|
208
275
|
)
|
|
209
|
-
] })
|
|
276
|
+
] }),
|
|
277
|
+
!b(d) && !b(t.key) && /* @__PURE__ */ e.jsx("div", { className: "mt-px absolute right-0 top-1 text-purple-600 text-[10px] flex items-center font-medium h-4 px-2 rounded-full", children: Y(d) })
|
|
210
278
|
] });
|
|
211
|
-
},
|
|
212
|
-
const
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
279
|
+
}, Or = ({ bindingData: t, onChange: s }) => {
|
|
280
|
+
const r = G(), [l] = et(), o = Kt(), [a, d] = w(
|
|
281
|
+
C(t, (c, m) => ({ key: m, value: c }))
|
|
282
|
+
);
|
|
283
|
+
E(() => {
|
|
284
|
+
d(C(t, (c, m) => ({ key: m, value: c })));
|
|
285
|
+
}, [r == null ? void 0 : r._id]);
|
|
286
|
+
const i = N(() => {
|
|
287
|
+
if (b(a))
|
|
218
288
|
return !1;
|
|
219
|
-
const
|
|
220
|
-
return b(
|
|
221
|
-
}, [
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
h
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
if (d(g), b(g)) {
|
|
232
|
-
o({});
|
|
289
|
+
const c = ye(a);
|
|
290
|
+
return b(c == null ? void 0 : c.key) || b(c == null ? void 0 : c.value);
|
|
291
|
+
}, [a]), n = (c) => {
|
|
292
|
+
const m = be(a, (h) => h.key !== c.key);
|
|
293
|
+
d([...m, c]), x([...m, c]);
|
|
294
|
+
}, u = (c) => {
|
|
295
|
+
const m = be(a, (h, g) => c !== g);
|
|
296
|
+
x([...m]);
|
|
297
|
+
}, x = A(
|
|
298
|
+
(c = []) => {
|
|
299
|
+
if (d(c), b(c)) {
|
|
300
|
+
s({});
|
|
233
301
|
return;
|
|
234
302
|
}
|
|
235
|
-
const
|
|
236
|
-
|
|
237
|
-
!b(
|
|
238
|
-
}),
|
|
303
|
+
const m = {};
|
|
304
|
+
je(c, (h) => {
|
|
305
|
+
!b(h == null ? void 0 : h.key) && !b(h == null ? void 0 : h.value) && Me(m, h.key, h.value);
|
|
306
|
+
}), s(m);
|
|
239
307
|
},
|
|
240
|
-
[
|
|
308
|
+
[r]
|
|
241
309
|
);
|
|
242
|
-
return b(
|
|
310
|
+
return b(o) ? /* @__PURE__ */ e.jsx("div", { className: "w-full flex items-center justify-center", children: /* @__PURE__ */ e.jsxs("p", { className: "text-gray-500 mb-1.5 text-xs", children: [
|
|
243
311
|
"You have no data providers registered. Please add a data provider to your project. ",
|
|
244
312
|
/* @__PURE__ */ e.jsx("br", {}),
|
|
245
313
|
/* @__PURE__ */ e.jsx("a", { className: "text-blue-500", href: "https://chaibuilder.com/docs/registering-data-providers", target: "_blank", children: "Learn more" })
|
|
246
314
|
] }) }) : /* @__PURE__ */ e.jsxs("div", { className: "space-y-2", children: [
|
|
247
|
-
|
|
248
|
-
|
|
315
|
+
C(a, (c, m) => /* @__PURE__ */ e.jsx(
|
|
316
|
+
Lr,
|
|
249
317
|
{
|
|
250
|
-
item:
|
|
251
|
-
|
|
252
|
-
onRemove: () =>
|
|
253
|
-
selectedBlock:
|
|
254
|
-
dataProvider:
|
|
255
|
-
appliedBindings:
|
|
318
|
+
item: c,
|
|
319
|
+
onAddBinding: n,
|
|
320
|
+
onRemove: () => u(m),
|
|
321
|
+
selectedBlock: r,
|
|
322
|
+
dataProvider: l,
|
|
323
|
+
appliedBindings: C(a, "key")
|
|
256
324
|
},
|
|
257
|
-
|
|
325
|
+
c.key
|
|
258
326
|
)),
|
|
259
|
-
/* @__PURE__ */ e.jsxs(
|
|
260
|
-
/* @__PURE__ */ e.jsx(
|
|
327
|
+
/* @__PURE__ */ e.jsxs(X, { delayDuration: 200, children: [
|
|
328
|
+
/* @__PURE__ */ e.jsx(W, { className: "w-full", children: /* @__PURE__ */ e.jsx(rt, { appliedBindings: C(a, "key"), onAddBinding: n, children: /* @__PURE__ */ e.jsx(
|
|
261
329
|
"button",
|
|
262
330
|
{
|
|
263
|
-
onClick: n,
|
|
264
331
|
disabled: i,
|
|
265
|
-
className: `w-full px-5 py-1.5 text-xs rounded-md font-medium duration-200 ${b(
|
|
332
|
+
className: `w-full px-5 py-1.5 text-xs rounded-md font-medium duration-200 ${b(a) ? "bg-blue-700/20 text-blue-800 hover:bg-blue-700/30" : ""} ${i ? "cursor-not-allowed bg-gray-200 text-gray-400" : b(a) ? "" : "bg-blue-700/20 text-blue-800 hover:bg-blue-700/30"}`,
|
|
266
333
|
children: "+ Add Data Binding"
|
|
267
334
|
}
|
|
268
|
-
) }),
|
|
269
|
-
i && /* @__PURE__ */ e.jsx(
|
|
335
|
+
) }) }),
|
|
336
|
+
i && /* @__PURE__ */ e.jsx(Z, { sideOffset: -55, className: "text-[11px]", children: "Complete last added data binding to add more" })
|
|
270
337
|
] })
|
|
271
338
|
] });
|
|
272
|
-
},
|
|
273
|
-
createHistorySnapshot:
|
|
274
|
-
properties:
|
|
275
|
-
formData:
|
|
276
|
-
onChange:
|
|
339
|
+
}, Mr = Or, _r = () => /* @__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" }), $e = ({
|
|
340
|
+
createHistorySnapshot: t,
|
|
341
|
+
properties: s,
|
|
342
|
+
formData: r,
|
|
343
|
+
onChange: l
|
|
277
344
|
}) => {
|
|
278
|
-
const [
|
|
279
|
-
return Object.keys(
|
|
280
|
-
const n =
|
|
281
|
-
if (
|
|
345
|
+
const [o] = Yt(), a = { type: "object", properties: {} }, d = {};
|
|
346
|
+
return Object.keys(s).forEach((i) => {
|
|
347
|
+
const n = s[i];
|
|
348
|
+
if (M(["slot", "styles"], n.type))
|
|
282
349
|
return;
|
|
283
|
-
const
|
|
284
|
-
|
|
350
|
+
const u = p(n, "i18n", !1) ? `${i}-${o}` : i;
|
|
351
|
+
a.properties[u] = Xt(n, o), d[u] = Wt(n, o);
|
|
285
352
|
}), /* @__PURE__ */ e.jsx(
|
|
286
|
-
|
|
353
|
+
_t,
|
|
287
354
|
{
|
|
288
355
|
widgets: {
|
|
289
|
-
binding:
|
|
290
|
-
richtext:
|
|
291
|
-
icon:
|
|
292
|
-
image:
|
|
356
|
+
binding: _r,
|
|
357
|
+
richtext: fr,
|
|
358
|
+
icon: vr,
|
|
359
|
+
image: jr
|
|
293
360
|
},
|
|
294
361
|
fields: {
|
|
295
|
-
link:
|
|
362
|
+
link: wr
|
|
296
363
|
},
|
|
297
364
|
idSeparator: ".",
|
|
298
365
|
autoComplete: "off",
|
|
299
366
|
omitExtraData: !1,
|
|
300
367
|
liveOmit: !1,
|
|
301
368
|
liveValidate: !0,
|
|
302
|
-
validator:
|
|
369
|
+
validator: Et,
|
|
303
370
|
uiSchema: d,
|
|
304
|
-
onBlur:
|
|
305
|
-
schema:
|
|
306
|
-
formData:
|
|
307
|
-
onChange:
|
|
371
|
+
onBlur: t,
|
|
372
|
+
schema: a,
|
|
373
|
+
formData: r,
|
|
374
|
+
onChange: l
|
|
308
375
|
}
|
|
309
376
|
);
|
|
310
377
|
};
|
|
311
|
-
function
|
|
312
|
-
const
|
|
313
|
-
if (
|
|
314
|
-
const
|
|
315
|
-
|
|
378
|
+
function Er() {
|
|
379
|
+
const t = G(), { createSnapshot: s } = ze(), r = Ue(), l = Qe(t._type), o = { ...t }, a = () => s(), d = ({ formData: x }, c) => {
|
|
380
|
+
if (c) {
|
|
381
|
+
const m = c.replace("root.", "");
|
|
382
|
+
r([t._id], { [m]: p(x, m) });
|
|
316
383
|
}
|
|
317
384
|
}, i = {
|
|
318
|
-
_name:
|
|
385
|
+
_name: qt({
|
|
319
386
|
title: "Name",
|
|
320
|
-
default:
|
|
387
|
+
default: p(t, "_name", t._type)
|
|
321
388
|
})
|
|
322
|
-
}, n =
|
|
323
|
-
const
|
|
324
|
-
return
|
|
325
|
-
delete c
|
|
326
|
-
}),
|
|
327
|
-
}, [
|
|
389
|
+
}, n = ut(p(o, "_bindings", {})), u = N(() => {
|
|
390
|
+
const x = xt(p(l, "props", {}));
|
|
391
|
+
return gt(n, (c) => {
|
|
392
|
+
delete x[c];
|
|
393
|
+
}), x;
|
|
394
|
+
}, [l, n]);
|
|
328
395
|
return /* @__PURE__ */ e.jsxs("div", { className: "overflow-x-hidden", children: [
|
|
329
396
|
/* @__PURE__ */ e.jsx(
|
|
330
|
-
|
|
397
|
+
$e,
|
|
331
398
|
{
|
|
332
399
|
onChange: d,
|
|
333
|
-
createHistorySnapshot:
|
|
334
|
-
formData:
|
|
400
|
+
createHistorySnapshot: a,
|
|
401
|
+
formData: o,
|
|
335
402
|
properties: i
|
|
336
403
|
}
|
|
337
404
|
),
|
|
338
405
|
/* @__PURE__ */ e.jsx("hr", { className: "mt-4" }),
|
|
339
406
|
/* @__PURE__ */ e.jsxs(tt, { type: "multiple", defaultValue: ["STATIC", "BINDING"], className: "h-full w-full", children: [
|
|
340
|
-
/* @__PURE__ */ e.jsxs(
|
|
341
|
-
/* @__PURE__ */ e.jsx(
|
|
407
|
+
/* @__PURE__ */ e.jsxs(ie, { value: "BINDING", children: [
|
|
408
|
+
/* @__PURE__ */ e.jsx(de, { className: "px-3 py-2 text-xs hover:no-underline bg-gray-100 ml-1", children: /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-x-2", children: [
|
|
342
409
|
/* @__PURE__ */ e.jsx(
|
|
343
410
|
"div",
|
|
344
411
|
{
|
|
345
|
-
className: `h-[8px] w-[8px] rounded-full ${b(
|
|
412
|
+
className: `h-[8px] w-[8px] rounded-full ${b(p(t, "_bindings", {})) ? "bg-gray-300" : "bg-blue-500"}`
|
|
346
413
|
}
|
|
347
414
|
),
|
|
348
415
|
"Data Binding"
|
|
349
416
|
] }) }),
|
|
350
|
-
/* @__PURE__ */ e.jsx(
|
|
351
|
-
|
|
417
|
+
/* @__PURE__ */ e.jsx(ce, { className: "pt-4 px-4", children: /* @__PURE__ */ e.jsx(
|
|
418
|
+
Mr,
|
|
352
419
|
{
|
|
353
|
-
bindingData:
|
|
354
|
-
onChange: (
|
|
355
|
-
d({ formData: { ...
|
|
420
|
+
bindingData: p(o, "_bindings", {}),
|
|
421
|
+
onChange: (x) => {
|
|
422
|
+
d({ formData: { ...o, _bindings: x } }, "root._bindings");
|
|
356
423
|
}
|
|
357
424
|
}
|
|
358
425
|
) })
|
|
359
426
|
] }),
|
|
360
|
-
/* @__PURE__ */ e.jsxs(
|
|
361
|
-
/* @__PURE__ */ e.jsx(
|
|
427
|
+
/* @__PURE__ */ e.jsxs(ie, { value: "STATIC", children: [
|
|
428
|
+
/* @__PURE__ */ e.jsx(de, { className: "px-3 py-2 text-xs hover:no-underline bg-gray-100 ml-1", children: /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-x-2", children: [
|
|
362
429
|
/* @__PURE__ */ e.jsx("div", { className: "h-[8px] w-[8px] rounded-full bg-blue-500" }),
|
|
363
430
|
"Static Content"
|
|
364
431
|
] }) }),
|
|
365
|
-
/* @__PURE__ */ e.jsxs(
|
|
432
|
+
/* @__PURE__ */ e.jsxs(ce, { className: "pt-4", children: [
|
|
366
433
|
b(n) ? "" : /* @__PURE__ */ e.jsxs("div", { className: "text-xs mx-4 border rounded-sm p-1 mb-1 mt-0 border-orange-500 text-orange-500 bg-orange-100", children: [
|
|
367
434
|
"Data binding is set for ",
|
|
368
|
-
/* @__PURE__ */ e.jsx("b", { children:
|
|
435
|
+
/* @__PURE__ */ e.jsx("b", { children: C(n, ht).join(", ") }),
|
|
369
436
|
" ",
|
|
370
437
|
n.length === 1 ? "property" : "properties",
|
|
371
438
|
". Remove data binding to edit static content."
|
|
372
439
|
] }),
|
|
373
440
|
/* @__PURE__ */ e.jsx(
|
|
374
|
-
|
|
441
|
+
$e,
|
|
375
442
|
{
|
|
376
443
|
onChange: d,
|
|
377
|
-
createHistorySnapshot:
|
|
378
|
-
formData:
|
|
379
|
-
properties:
|
|
444
|
+
createHistorySnapshot: a,
|
|
445
|
+
formData: o,
|
|
446
|
+
properties: u
|
|
380
447
|
}
|
|
381
448
|
)
|
|
382
449
|
] })
|
|
@@ -385,60 +452,60 @@ function fr() {
|
|
|
385
452
|
/* @__PURE__ */ e.jsx("div", { className: "pb-60" })
|
|
386
453
|
] });
|
|
387
454
|
}
|
|
388
|
-
const
|
|
455
|
+
const Pe = new Nr(Sr, {
|
|
389
456
|
isCaseSensitive: !1,
|
|
390
457
|
threshold: 0.2,
|
|
391
458
|
minMatchCharLength: 2,
|
|
392
459
|
keys: ["name"]
|
|
393
460
|
});
|
|
394
|
-
function
|
|
395
|
-
var
|
|
396
|
-
const [
|
|
397
|
-
const j =
|
|
398
|
-
|
|
399
|
-
}, [
|
|
400
|
-
const
|
|
401
|
-
let
|
|
402
|
-
if (
|
|
403
|
-
const [
|
|
404
|
-
|
|
405
|
-
...
|
|
406
|
-
item: { ...
|
|
461
|
+
function Fr() {
|
|
462
|
+
var D;
|
|
463
|
+
const [t] = Ne(), s = G(), r = Ge(), l = Ke(), [o] = qe(), [a, d] = w(""), i = (D = we(t)) == null ? void 0 : D.prop, n = mt((p(s, i, "").replace(Rr, "").split(",").pop() || "").split(" "), b), u = () => {
|
|
464
|
+
const j = a.trim().toLowerCase().replace(/ +(?= )/g, "").split(" ");
|
|
465
|
+
r(o, j, !0), d("");
|
|
466
|
+
}, [x, c] = w([]), m = ({ value: j }) => {
|
|
467
|
+
const L = j.trim().toLowerCase(), P = L.match(/.+:/g);
|
|
468
|
+
let k = [];
|
|
469
|
+
if (P && P.length > 0) {
|
|
470
|
+
const [I] = P, F = L.replace(I, "");
|
|
471
|
+
k = Pe.search(F).map((y) => ({
|
|
472
|
+
...y,
|
|
473
|
+
item: { ...y.item, name: I + y.item.name }
|
|
407
474
|
}));
|
|
408
475
|
} else
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
},
|
|
412
|
-
|
|
413
|
-
},
|
|
476
|
+
k = Pe.search(L);
|
|
477
|
+
c(C(k, "item"));
|
|
478
|
+
}, h = () => {
|
|
479
|
+
c([]);
|
|
480
|
+
}, g = (j) => j.name, f = (j) => /* @__PURE__ */ e.jsx("div", { className: "rounded-md p-1", children: j.name }), S = {
|
|
414
481
|
autoComplete: "off",
|
|
415
482
|
autoCorrect: "off",
|
|
416
483
|
autoCapitalize: "off",
|
|
417
484
|
spellCheck: !1,
|
|
418
485
|
placeholder: "Enter class name",
|
|
419
|
-
value:
|
|
486
|
+
value: a,
|
|
420
487
|
onKeyDown: (j) => {
|
|
421
|
-
j.key === "Enter" &&
|
|
488
|
+
j.key === "Enter" && a.trim() !== "" && u();
|
|
422
489
|
},
|
|
423
|
-
onChange: (j, { newValue:
|
|
490
|
+
onChange: (j, { newValue: L }) => d(L),
|
|
424
491
|
className: "w-full rounded-md text-xs px-2 hover:outline-0 bg-background border-border py-1"
|
|
425
492
|
};
|
|
426
493
|
return /* @__PURE__ */ e.jsxs(
|
|
427
494
|
"div",
|
|
428
495
|
{
|
|
429
|
-
className: `no-scrollbar flex ${
|
|
496
|
+
className: `no-scrollbar flex ${x.length > 0 ? "min-h-[300px]" : "min-h-max"} w-full flex-col gap-y-5 overflow-y-auto bg-gray-100 px-px`,
|
|
430
497
|
children: [
|
|
431
|
-
/* @__PURE__ */ e.jsx(
|
|
498
|
+
/* @__PURE__ */ e.jsx(Se, { className: "mt-2", children: "Add Tailwind classes" }),
|
|
432
499
|
/* @__PURE__ */ e.jsxs("div", { className: "relative -mt-4 flex items-center gap-x-3", children: [
|
|
433
500
|
/* @__PURE__ */ e.jsx("div", { className: "relative flex w-full items-center gap-x-3", children: /* @__PURE__ */ e.jsx(
|
|
434
|
-
|
|
501
|
+
kr,
|
|
435
502
|
{
|
|
436
|
-
suggestions:
|
|
437
|
-
onSuggestionsFetchRequested:
|
|
438
|
-
onSuggestionsClearRequested:
|
|
439
|
-
getSuggestionValue:
|
|
503
|
+
suggestions: x,
|
|
504
|
+
onSuggestionsFetchRequested: m,
|
|
505
|
+
onSuggestionsClearRequested: h,
|
|
506
|
+
getSuggestionValue: g,
|
|
440
507
|
renderSuggestion: f,
|
|
441
|
-
inputProps:
|
|
508
|
+
inputProps: S,
|
|
442
509
|
containerProps: {
|
|
443
510
|
className: "relative h-8 w-full gap-y-1 py-1 border-gray-600"
|
|
444
511
|
},
|
|
@@ -450,20 +517,20 @@ function vr() {
|
|
|
450
517
|
}
|
|
451
518
|
) }),
|
|
452
519
|
/* @__PURE__ */ e.jsx(
|
|
453
|
-
|
|
520
|
+
ue,
|
|
454
521
|
{
|
|
455
522
|
variant: "outline",
|
|
456
523
|
className: "h-6 border-gray-700",
|
|
457
|
-
onClick:
|
|
458
|
-
disabled:
|
|
524
|
+
onClick: u,
|
|
525
|
+
disabled: a.trim() === "",
|
|
459
526
|
size: "sm",
|
|
460
|
-
children: /* @__PURE__ */ e.jsx(
|
|
527
|
+
children: /* @__PURE__ */ e.jsx(Ce, {})
|
|
461
528
|
}
|
|
462
529
|
)
|
|
463
530
|
] }),
|
|
464
531
|
/* @__PURE__ */ e.jsxs("div", { className: "flex w-full flex-wrap gap-2", children: [
|
|
465
532
|
b(n) && /* @__PURE__ */ e.jsx("div", { className: "flex h-10 w-full items-center justify-center text-center text-sm text-gray-400", children: "No class added" }),
|
|
466
|
-
|
|
533
|
+
ne.Children.toArray(
|
|
467
534
|
n.map((j) => /* @__PURE__ */ e.jsxs(
|
|
468
535
|
"div",
|
|
469
536
|
{
|
|
@@ -471,9 +538,9 @@ function vr() {
|
|
|
471
538
|
children: [
|
|
472
539
|
j,
|
|
473
540
|
/* @__PURE__ */ e.jsx(
|
|
474
|
-
|
|
541
|
+
Ye,
|
|
475
542
|
{
|
|
476
|
-
onClick: () =>
|
|
543
|
+
onClick: () => l(o, [j]),
|
|
477
544
|
className: "invisible absolute right-1 hover:text-white group-hover:visible group-hover:cursor-pointer"
|
|
478
545
|
}
|
|
479
546
|
)
|
|
@@ -487,16 +554,16 @@ function vr() {
|
|
|
487
554
|
}
|
|
488
555
|
);
|
|
489
556
|
}
|
|
490
|
-
const
|
|
557
|
+
const B = ["px", "%", "em", "rem", "ch", "vh", "vw"], Yr = {
|
|
491
558
|
heading: "Flex Child",
|
|
492
559
|
items: [
|
|
493
|
-
{ type: "arbitrary", label: "Basis", units:
|
|
560
|
+
{ type: "arbitrary", label: "Basis", units: B, property: "flexBasis" },
|
|
494
561
|
{ type: "range", label: "Order", property: "order" },
|
|
495
562
|
{ type: "dropdown", label: "Flex", property: "flexGrowShrink" },
|
|
496
563
|
{ type: "dropdown", label: "Grow", property: "flexGrow" },
|
|
497
564
|
{ type: "dropdown", label: "Shrink", property: "flexShrink" }
|
|
498
565
|
]
|
|
499
|
-
},
|
|
566
|
+
}, Xr = {
|
|
500
567
|
heading: "Grid Child",
|
|
501
568
|
items: [
|
|
502
569
|
{ type: "range", label: "Col Span", property: "gridColSpan" },
|
|
@@ -507,11 +574,11 @@ const D = ["px", "%", "em", "rem", "ch", "vh", "vw"], wr = {
|
|
|
507
574
|
{ type: "range", label: "Row End", property: "gridRowEnd" },
|
|
508
575
|
{ type: "range", label: "Order", property: "order" }
|
|
509
576
|
]
|
|
510
|
-
},
|
|
577
|
+
}, Wr = [
|
|
511
578
|
{
|
|
512
579
|
heading: "Display",
|
|
513
580
|
items: [
|
|
514
|
-
{ type: "dropdown", label: "Display", property: "display", units:
|
|
581
|
+
{ type: "dropdown", label: "Display", property: "display", units: B },
|
|
515
582
|
{
|
|
516
583
|
styleType: "accordion",
|
|
517
584
|
heading: "Flex options",
|
|
@@ -562,7 +629,7 @@ const D = ["px", "%", "em", "rem", "ch", "vh", "vw"], wr = {
|
|
|
562
629
|
styleType: "accordion",
|
|
563
630
|
heading: "Visibility & Opacity",
|
|
564
631
|
items: [
|
|
565
|
-
{ type: "dropdown", label: "Visibility", property: "visibility", units:
|
|
632
|
+
{ type: "dropdown", label: "Visibility", property: "visibility", units: B },
|
|
566
633
|
{ type: "arbitrary", label: "Opacity", property: "opacity", units: ["-"] }
|
|
567
634
|
]
|
|
568
635
|
}
|
|
@@ -575,7 +642,7 @@ const D = ["px", "%", "em", "rem", "ch", "vh", "vw"], wr = {
|
|
|
575
642
|
styleType: "multiple",
|
|
576
643
|
label: "Margin",
|
|
577
644
|
negative: !0,
|
|
578
|
-
units: [...
|
|
645
|
+
units: [...B, "auto"],
|
|
579
646
|
options: [
|
|
580
647
|
{ key: "margin", label: "All" },
|
|
581
648
|
{ key: "marginX", label: "Left-Right" },
|
|
@@ -612,22 +679,22 @@ const D = ["px", "%", "em", "rem", "ch", "vh", "vw"], wr = {
|
|
|
612
679
|
{
|
|
613
680
|
heading: "Size",
|
|
614
681
|
items: [
|
|
615
|
-
{ type: "arbitrary", label: "Width", units:
|
|
616
|
-
{ type: "arbitrary", label: "Height", units:
|
|
682
|
+
{ type: "arbitrary", label: "Width", units: B.concat("auto"), property: "width" },
|
|
683
|
+
{ type: "arbitrary", label: "Height", units: B.concat("auto"), property: "height" },
|
|
617
684
|
{
|
|
618
685
|
styleType: "accordion",
|
|
619
686
|
heading: "Min width & height",
|
|
620
687
|
items: [
|
|
621
|
-
{ type: "arbitrary", label: "Min Width", units:
|
|
622
|
-
{ type: "arbitrary", label: "Min Height", units:
|
|
688
|
+
{ type: "arbitrary", label: "Min Width", units: B.concat("auto"), property: "minWidth" },
|
|
689
|
+
{ type: "arbitrary", label: "Min Height", units: B.concat("auto"), property: "minHeight" }
|
|
623
690
|
]
|
|
624
691
|
},
|
|
625
692
|
{
|
|
626
693
|
styleType: "accordion",
|
|
627
694
|
heading: "Max width & height",
|
|
628
695
|
items: [
|
|
629
|
-
{ type: "arbitrary", label: "Max Width", units:
|
|
630
|
-
{ type: "arbitrary", label: "Max Height", units:
|
|
696
|
+
{ type: "arbitrary", label: "Max Width", units: B.concat("auto"), property: "maxWidth" },
|
|
697
|
+
{ type: "arbitrary", label: "Max Height", units: B.concat("auto"), property: "maxHeight" }
|
|
631
698
|
]
|
|
632
699
|
},
|
|
633
700
|
{
|
|
@@ -711,8 +778,8 @@ const D = ["px", "%", "em", "rem", "ch", "vh", "vw"], wr = {
|
|
|
711
778
|
heading: "Typography",
|
|
712
779
|
items: [
|
|
713
780
|
{ type: "dropdown", property: "fontFamily", label: "Font" },
|
|
714
|
-
{ type: "arbitrary", property: "fontSize", label: "Size", units:
|
|
715
|
-
{ type: "arbitrary", property: "lineHeight", label: "Height", units:
|
|
781
|
+
{ type: "arbitrary", property: "fontSize", label: "Size", units: B },
|
|
782
|
+
{ type: "arbitrary", property: "lineHeight", label: "Height", units: B.concat("-") },
|
|
716
783
|
{ type: "range", property: "fontWeight", label: "Weight" },
|
|
717
784
|
{ type: "color", property: "textColor", label: "Color" },
|
|
718
785
|
{
|
|
@@ -909,89 +976,89 @@ const D = ["px", "%", "em", "rem", "ch", "vh", "vw"], wr = {
|
|
|
909
976
|
},
|
|
910
977
|
{
|
|
911
978
|
heading: "Classes",
|
|
912
|
-
items: [{ component:
|
|
979
|
+
items: [{ component: Fr }]
|
|
913
980
|
}
|
|
914
|
-
],
|
|
981
|
+
], st = {
|
|
915
982
|
"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" }) }),
|
|
916
983
|
// visibility
|
|
917
|
-
visible:
|
|
918
|
-
invisible:
|
|
984
|
+
visible: jt,
|
|
985
|
+
invisible: Ve,
|
|
919
986
|
// display
|
|
920
|
-
hidden:
|
|
921
|
-
gap:
|
|
922
|
-
gapX:
|
|
987
|
+
hidden: Ve,
|
|
988
|
+
gap: O,
|
|
989
|
+
gapX: R,
|
|
923
990
|
gapY: V,
|
|
924
|
-
spaceX:
|
|
991
|
+
spaceX: R,
|
|
925
992
|
spaceY: V,
|
|
926
|
-
overscroll:
|
|
927
|
-
overscrollX:
|
|
993
|
+
overscroll: O,
|
|
994
|
+
overscrollX: R,
|
|
928
995
|
overscrollY: V,
|
|
929
|
-
overflow:
|
|
930
|
-
overflowX:
|
|
996
|
+
overflow: O,
|
|
997
|
+
overflowX: R,
|
|
931
998
|
overflowY: V,
|
|
932
|
-
top:
|
|
933
|
-
right:
|
|
934
|
-
bottom:
|
|
935
|
-
left:
|
|
936
|
-
inset:
|
|
937
|
-
insetX:
|
|
999
|
+
top: q,
|
|
1000
|
+
right: J,
|
|
1001
|
+
bottom: Q,
|
|
1002
|
+
left: ee,
|
|
1003
|
+
inset: O,
|
|
1004
|
+
insetX: R,
|
|
938
1005
|
insetY: V,
|
|
939
|
-
border:
|
|
940
|
-
borderX:
|
|
1006
|
+
border: O,
|
|
1007
|
+
borderX: R,
|
|
941
1008
|
borderY: V,
|
|
942
|
-
borderTop:
|
|
943
|
-
borderRight:
|
|
944
|
-
borderBottom:
|
|
945
|
-
borderLeft:
|
|
946
|
-
borderRadius:
|
|
947
|
-
borderRadiusX:
|
|
1009
|
+
borderTop: q,
|
|
1010
|
+
borderRight: J,
|
|
1011
|
+
borderBottom: Q,
|
|
1012
|
+
borderLeft: ee,
|
|
1013
|
+
borderRadius: O,
|
|
1014
|
+
borderRadiusX: R,
|
|
948
1015
|
borderRadiusY: V,
|
|
949
|
-
borderRadiusTop:
|
|
950
|
-
borderRadiusRight:
|
|
951
|
-
borderRadiusBottom:
|
|
952
|
-
borderRadiusLeft:
|
|
953
|
-
borderRadiusTopLeft:
|
|
954
|
-
borderRadiusTopRight:
|
|
955
|
-
borderRadiusBottomRight:
|
|
956
|
-
borderRadiusBottomLeft:
|
|
957
|
-
divideXWidth:
|
|
1016
|
+
borderRadiusTop: q,
|
|
1017
|
+
borderRadiusRight: J,
|
|
1018
|
+
borderRadiusBottom: Q,
|
|
1019
|
+
borderRadiusLeft: ee,
|
|
1020
|
+
borderRadiusTopLeft: wt,
|
|
1021
|
+
borderRadiusTopRight: Ct,
|
|
1022
|
+
borderRadiusBottomRight: kt,
|
|
1023
|
+
borderRadiusBottomLeft: Nt,
|
|
1024
|
+
divideXWidth: R,
|
|
958
1025
|
divideYWidth: V,
|
|
959
|
-
scale:
|
|
960
|
-
scaleX:
|
|
1026
|
+
scale: O,
|
|
1027
|
+
scaleX: R,
|
|
961
1028
|
scaleY: V,
|
|
962
|
-
skewX:
|
|
1029
|
+
skewX: R,
|
|
963
1030
|
skewY: V,
|
|
964
|
-
translateX:
|
|
1031
|
+
translateX: R,
|
|
965
1032
|
translateY: V,
|
|
966
1033
|
// padding
|
|
967
|
-
padding:
|
|
968
|
-
paddingX:
|
|
1034
|
+
padding: O,
|
|
1035
|
+
paddingX: R,
|
|
969
1036
|
paddingY: V,
|
|
970
|
-
paddingTop:
|
|
971
|
-
paddingRight:
|
|
972
|
-
paddingBottom:
|
|
973
|
-
paddingLeft:
|
|
1037
|
+
paddingTop: q,
|
|
1038
|
+
paddingRight: J,
|
|
1039
|
+
paddingBottom: Q,
|
|
1040
|
+
paddingLeft: ee,
|
|
974
1041
|
// margin
|
|
975
|
-
margin:
|
|
976
|
-
marginX:
|
|
1042
|
+
margin: O,
|
|
1043
|
+
marginX: R,
|
|
977
1044
|
marginY: V,
|
|
978
|
-
marginTop:
|
|
979
|
-
marginRight:
|
|
980
|
-
marginBottom:
|
|
981
|
-
marginLeft:
|
|
1045
|
+
marginTop: q,
|
|
1046
|
+
marginRight: J,
|
|
1047
|
+
marginBottom: Q,
|
|
1048
|
+
marginLeft: ee,
|
|
982
1049
|
// text-align
|
|
983
|
-
textLeft:
|
|
984
|
-
textCenter:
|
|
985
|
-
textRight:
|
|
986
|
-
textJustify:
|
|
1050
|
+
textLeft: St,
|
|
1051
|
+
textCenter: Tt,
|
|
1052
|
+
textRight: Rt,
|
|
1053
|
+
textJustify: Vt,
|
|
987
1054
|
// font style
|
|
988
|
-
italic:
|
|
1055
|
+
italic: Ht,
|
|
989
1056
|
// "not-italic": "",
|
|
990
1057
|
// decoration
|
|
991
|
-
underline:
|
|
992
|
-
overline:
|
|
1058
|
+
underline: Bt,
|
|
1059
|
+
overline: At,
|
|
993
1060
|
// transform
|
|
994
|
-
uppercase:
|
|
1061
|
+
uppercase: Dt,
|
|
995
1062
|
block: () => /* @__PURE__ */ e.jsxs("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [
|
|
996
1063
|
/* @__PURE__ */ e.jsx(
|
|
997
1064
|
"path",
|
|
@@ -1032,7 +1099,7 @@ const D = ["px", "%", "em", "rem", "ch", "vh", "vw"], wr = {
|
|
|
1032
1099
|
}
|
|
1033
1100
|
)
|
|
1034
1101
|
] }),
|
|
1035
|
-
"float-none":
|
|
1102
|
+
"float-none": Ye,
|
|
1036
1103
|
// position
|
|
1037
1104
|
fixed: () => /* @__PURE__ */ e.jsxs("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [
|
|
1038
1105
|
/* @__PURE__ */ e.jsx(
|
|
@@ -1104,96 +1171,96 @@ const D = ["px", "%", "em", "rem", "ch", "vh", "vw"], wr = {
|
|
|
1104
1171
|
}
|
|
1105
1172
|
)
|
|
1106
1173
|
] }),
|
|
1107
|
-
static:
|
|
1108
|
-
},
|
|
1174
|
+
static: $t
|
|
1175
|
+
}, se = Oe({ canReset: !1, canChange: !0 }), Zr = ({ children: t, canReset: s = !1, canChange: r = !0 }) => (
|
|
1109
1176
|
// eslint-disable-next-line react/jsx-no-constructed-context-values
|
|
1110
|
-
/* @__PURE__ */ e.jsx(
|
|
1111
|
-
), lt = ({ label:
|
|
1112
|
-
const
|
|
1113
|
-
return /* @__PURE__ */ e.jsx("div", { className:
|
|
1114
|
-
/* @__PURE__ */ e.jsx(
|
|
1115
|
-
/* @__PURE__ */ e.jsxs(
|
|
1116
|
-
/* @__PURE__ */ e.jsx(
|
|
1117
|
-
/* @__PURE__ */ e.jsx(
|
|
1177
|
+
/* @__PURE__ */ e.jsx(se.Provider, { value: { canReset: s, canChange: r }, children: t })
|
|
1178
|
+
), lt = ({ label: t, property: s, onChange: r }) => {
|
|
1179
|
+
const l = N(() => p(xe, `${s}.classes`, [""]), [s]), o = le(s), a = N(() => p(o, "cls", ""), [o]), { canChange: d } = re(se), i = /\[.*\]/g.test(a);
|
|
1180
|
+
return /* @__PURE__ */ e.jsx("div", { className: t ? "w-full rounded " : "grow", children: i ? /* @__PURE__ */ e.jsxs("div", { className: "flex items-center", children: [
|
|
1181
|
+
/* @__PURE__ */ e.jsx(br, { className: "w-[70%] rounded py-1", readOnly: !0, value: a }),
|
|
1182
|
+
/* @__PURE__ */ e.jsxs(X, { delayDuration: 100, children: [
|
|
1183
|
+
/* @__PURE__ */ e.jsx(W, { 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(ke, {}) }) }),
|
|
1184
|
+
/* @__PURE__ */ e.jsx(Z, { children: "Current value is using a Tailwind arbitrary value." })
|
|
1118
1185
|
] })
|
|
1119
1186
|
] }) : /* @__PURE__ */ e.jsx(
|
|
1120
|
-
|
|
1187
|
+
ve,
|
|
1121
1188
|
{
|
|
1122
|
-
rounded:
|
|
1123
|
-
onChange: (n) =>
|
|
1124
|
-
selected:
|
|
1125
|
-
options:
|
|
1189
|
+
rounded: t,
|
|
1190
|
+
onChange: (n) => r(n, s),
|
|
1191
|
+
selected: a,
|
|
1192
|
+
options: l,
|
|
1126
1193
|
disabled: !d
|
|
1127
1194
|
}
|
|
1128
1195
|
) });
|
|
1129
1196
|
};
|
|
1130
|
-
function
|
|
1131
|
-
const
|
|
1197
|
+
function ve({ selected: t, onChange: s, rounded: r = !1, options: l, disabled: o = !1 }) {
|
|
1198
|
+
const a = t.replace(/.*:/g, "").trim(), { undo: d, redo: i } = ze();
|
|
1132
1199
|
return /* @__PURE__ */ e.jsxs(
|
|
1133
1200
|
"select",
|
|
1134
1201
|
{
|
|
1135
|
-
disabled: !
|
|
1136
|
-
className: `${
|
|
1137
|
-
onChange: (n) =>
|
|
1202
|
+
disabled: !l.length || o,
|
|
1203
|
+
className: `${r ? "rounded-md border border-border" : "border-0"} w-full disable:bg-gray-500 h-full truncate rounded bg-background px-2 py-1 text-xs outline-none disabled:cursor-not-allowed`,
|
|
1204
|
+
onChange: (n) => s(n.target.value),
|
|
1138
1205
|
onKeyDown: (n) => {
|
|
1139
1206
|
n.ctrlKey && (n.key === "z" && d(), n.key === "y" && i());
|
|
1140
1207
|
},
|
|
1141
|
-
value:
|
|
1208
|
+
value: a,
|
|
1142
1209
|
children: [
|
|
1143
1210
|
/* @__PURE__ */ e.jsx("option", { className: "bg-transparent", value: "" }),
|
|
1144
|
-
|
|
1145
|
-
|
|
1211
|
+
$.Children.toArray(
|
|
1212
|
+
l.map((n) => /* @__PURE__ */ e.jsx("option", { className: "bg-transparent", value: n, children: n }))
|
|
1146
1213
|
)
|
|
1147
1214
|
]
|
|
1148
1215
|
}
|
|
1149
1216
|
);
|
|
1150
1217
|
}
|
|
1151
|
-
const
|
|
1152
|
-
const { canReset:
|
|
1153
|
-
return /* @__PURE__ */ e.jsx("div", { className: "flex flex-row divide-x divide-solid divide-border rounded border border-border text-xs", children: n ? /* @__PURE__ */ e.jsx("div", { className: "py-[5px] px-2", children:
|
|
1218
|
+
const zr = ({ property: t, onChange: s }) => {
|
|
1219
|
+
const { canReset: r, canChange: l } = re(se), o = le(t), a = N(() => p(o, "cls", ""), [o]), d = N(() => p(xe, `${t}.classes`, [""]), [t]), i = d.indexOf(a) > -1 ? d.indexOf(a) : 0, n = /\[.*\]/g.test(a);
|
|
1220
|
+
return /* @__PURE__ */ e.jsx("div", { className: "flex flex-row divide-x divide-solid divide-border rounded border border-border text-xs", children: n ? /* @__PURE__ */ e.jsx("div", { className: "py-[5px] px-2", children: a }) : /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
1154
1221
|
/* @__PURE__ */ e.jsx(
|
|
1155
1222
|
"button",
|
|
1156
1223
|
{
|
|
1157
1224
|
type: "button",
|
|
1158
1225
|
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",
|
|
1159
|
-
disabled: !
|
|
1160
|
-
onClick: () =>
|
|
1161
|
-
children: /* @__PURE__ */ e.jsx("span", { className: "flex items-center justify-center", children: /* @__PURE__ */ e.jsx(
|
|
1226
|
+
disabled: !l && (!r || i - 1 < 0),
|
|
1227
|
+
onClick: () => s(Re(d, i - 1), t),
|
|
1228
|
+
children: /* @__PURE__ */ e.jsx("span", { className: "flex items-center justify-center", children: /* @__PURE__ */ e.jsx(Pt, { className: !l && (!r || i - 1 < 0) ? "text-gray-500" : "text-white/60" }) })
|
|
1162
1229
|
}
|
|
1163
1230
|
),
|
|
1164
|
-
/* @__PURE__ */ e.jsx("div", { className: "w-8/12 text-center", children: /* @__PURE__ */ e.jsx(lt, { label: !1, property:
|
|
1231
|
+
/* @__PURE__ */ e.jsx("div", { className: "w-8/12 text-center", children: /* @__PURE__ */ e.jsx(lt, { label: !1, property: t, onChange: s }) }),
|
|
1165
1232
|
/* @__PURE__ */ e.jsx(
|
|
1166
1233
|
"button",
|
|
1167
1234
|
{
|
|
1168
1235
|
type: "button",
|
|
1169
1236
|
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",
|
|
1170
|
-
disabled: !
|
|
1171
|
-
onClick: () =>
|
|
1237
|
+
disabled: !l && (!r || i + 1 >= d.length),
|
|
1238
|
+
onClick: () => s(Re(d, i + 1), t),
|
|
1172
1239
|
children: /* @__PURE__ */ e.jsx("span", { className: "flex items-center justify-center", children: /* @__PURE__ */ e.jsx(
|
|
1173
|
-
|
|
1240
|
+
Ce,
|
|
1174
1241
|
{
|
|
1175
|
-
className: !
|
|
1242
|
+
className: !l && (!r || i + 1 >= d.length) ? "text-gray-500" : "text-white/60"
|
|
1176
1243
|
}
|
|
1177
1244
|
) })
|
|
1178
1245
|
}
|
|
1179
1246
|
)
|
|
1180
1247
|
] }) });
|
|
1181
|
-
},
|
|
1182
|
-
const
|
|
1183
|
-
return /* @__PURE__ */ e.jsx("div", { className: "flex grow flex-wrap gap-1", children:
|
|
1184
|
-
/* @__PURE__ */ e.jsx(
|
|
1248
|
+
}, Ur = ({ property: t, onChange: s }) => {
|
|
1249
|
+
const r = N(() => p(xe, `${t}.classes`, [""]), [t]), { canChange: l } = re(se), o = le(t), a = N(() => p(o, "cls", ""), [o]);
|
|
1250
|
+
return /* @__PURE__ */ e.jsx("div", { className: "flex grow flex-wrap gap-1", children: C(r, (d) => /* @__PURE__ */ e.jsxs(X, { children: [
|
|
1251
|
+
/* @__PURE__ */ e.jsx(W, { asChild: !0, children: /* @__PURE__ */ e.jsx(
|
|
1185
1252
|
"button",
|
|
1186
1253
|
{
|
|
1187
1254
|
type: "button",
|
|
1188
|
-
disabled: !
|
|
1189
|
-
onClick: () =>
|
|
1190
|
-
className: `cursor-pointer rounded border border-gray-600 p-1 disabled:cursor-not-allowed ${
|
|
1191
|
-
children:
|
|
1255
|
+
disabled: !l,
|
|
1256
|
+
onClick: () => s(d, t),
|
|
1257
|
+
className: `cursor-pointer rounded border border-gray-600 p-1 disabled:cursor-not-allowed ${a === d ? " bg-blue-500 text-white" : "disabled:bg-gray-600 disabled:text-gray-400"}`,
|
|
1258
|
+
children: $.createElement(p(st, d, Xe))
|
|
1192
1259
|
}
|
|
1193
1260
|
) }),
|
|
1194
|
-
/* @__PURE__ */ e.jsx(
|
|
1261
|
+
/* @__PURE__ */ e.jsx(Z, { children: Y(te(d)) })
|
|
1195
1262
|
] })) });
|
|
1196
|
-
},
|
|
1263
|
+
}, Gr = {
|
|
1197
1264
|
backgroundColor: "bg",
|
|
1198
1265
|
textColor: "text",
|
|
1199
1266
|
borderColor: "border",
|
|
@@ -1205,39 +1272,39 @@ const Nr = ({ property: r, onChange: o }) => {
|
|
|
1205
1272
|
toColor: "to",
|
|
1206
1273
|
ringColor: "ring",
|
|
1207
1274
|
ringOffsetColor: "ring-offset"
|
|
1208
|
-
},
|
|
1209
|
-
const
|
|
1275
|
+
}, Kr = ({ property: t, onChange: s }) => {
|
|
1276
|
+
const r = le(t), l = N(() => p(r, "cls", ""), [r]), { canChange: o } = re(se), [a, d] = w([]), [i, n] = w({ color: "", shade: "" }), u = l.split("-"), x = p(u, "1", ""), c = p(u, "2", ""), m = A(
|
|
1210
1277
|
// eslint-disable-next-line no-shadow
|
|
1211
|
-
(
|
|
1212
|
-
["current", "inherit", "transparent", "black", "white"].includes(
|
|
1278
|
+
(g) => {
|
|
1279
|
+
["current", "inherit", "transparent", "black", "white"].includes(g) ? (d([]), n({ color: g })) : (d(["50", "100", "200", "300", "400", "500", "600", "700", "800", "900"]), n((f) => ({ ...f, color: g, shade: f.shade ? f.shade : "500" })));
|
|
1213
1280
|
},
|
|
1214
1281
|
[d, n]
|
|
1215
1282
|
);
|
|
1216
|
-
|
|
1217
|
-
if (["current", "inherit", "transparent", "black", "white"].includes(
|
|
1283
|
+
E(() => {
|
|
1284
|
+
if (["current", "inherit", "transparent", "black", "white"].includes(x))
|
|
1218
1285
|
return d([]);
|
|
1219
1286
|
d(["50", "100", "200", "300", "400", "500", "600", "700", "800", "900"]);
|
|
1220
|
-
}, [
|
|
1221
|
-
const
|
|
1287
|
+
}, [x]);
|
|
1288
|
+
const h = A(
|
|
1222
1289
|
// eslint-disable-next-line no-shadow
|
|
1223
|
-
(
|
|
1224
|
-
n({ color:
|
|
1290
|
+
(g) => {
|
|
1291
|
+
n({ color: x, shade: g });
|
|
1225
1292
|
},
|
|
1226
|
-
[
|
|
1293
|
+
[x]
|
|
1227
1294
|
);
|
|
1228
|
-
return
|
|
1295
|
+
return E(() => {
|
|
1229
1296
|
n({ color: "", shade: "" });
|
|
1230
|
-
}, [
|
|
1231
|
-
const f = `${
|
|
1232
|
-
f.match(new RegExp(
|
|
1233
|
-
}, [i,
|
|
1297
|
+
}, [r]), E(() => {
|
|
1298
|
+
const f = `${p(Gr, t, "")}-${i.color}${i.shade ? `-${i.shade}` : ""}`;
|
|
1299
|
+
f.match(new RegExp(p(xe, `${t}.regExp`, ""))) && s(f, t);
|
|
1300
|
+
}, [i, s, t]), /* @__PURE__ */ e.jsxs("div", { className: "flex flex-row divide-x divide-solid divide-border rounded-lg border border-border text-xs", children: [
|
|
1234
1301
|
/* @__PURE__ */ e.jsx("div", { className: "grow text-center", children: /* @__PURE__ */ e.jsx(
|
|
1235
|
-
|
|
1302
|
+
ve,
|
|
1236
1303
|
{
|
|
1237
|
-
disabled: !
|
|
1304
|
+
disabled: !o,
|
|
1238
1305
|
rounded: !0,
|
|
1239
|
-
selected:
|
|
1240
|
-
onChange:
|
|
1306
|
+
selected: x,
|
|
1307
|
+
onChange: m,
|
|
1241
1308
|
options: [
|
|
1242
1309
|
"current",
|
|
1243
1310
|
"transparent",
|
|
@@ -1270,355 +1337,355 @@ const Nr = ({ property: r, onChange: o }) => {
|
|
|
1270
1337
|
]
|
|
1271
1338
|
}
|
|
1272
1339
|
) }),
|
|
1273
|
-
/* @__PURE__ */ e.jsx("button", { type: "button", className: "grow text-center", children: /* @__PURE__ */ e.jsx(
|
|
1340
|
+
/* @__PURE__ */ e.jsx("button", { type: "button", className: "grow text-center", children: /* @__PURE__ */ e.jsx(ve, { rounded: !0, selected: c, disabled: !x || !o, onChange: h, options: a }) })
|
|
1274
1341
|
] });
|
|
1275
|
-
},
|
|
1276
|
-
|
|
1277
|
-
let
|
|
1278
|
-
if ((
|
|
1279
|
-
return { value: "", unit:
|
|
1280
|
-
const
|
|
1281
|
-
|
|
1282
|
-
const
|
|
1283
|
-
return
|
|
1284
|
-
},
|
|
1285
|
-
const
|
|
1286
|
-
if (["auto", "none"].includes(
|
|
1287
|
-
return { value: "", unit:
|
|
1288
|
-
if (
|
|
1342
|
+
}, Ie = (t, s) => {
|
|
1343
|
+
t = t.toLowerCase();
|
|
1344
|
+
let r = t.trim().replace(/ |\+/g, "");
|
|
1345
|
+
if ((r === "auto" || r === "none") && s.includes(r))
|
|
1346
|
+
return { value: "", unit: r };
|
|
1347
|
+
const l = s.length ? new RegExp(s.join("|"), "g") : /XXXXXX/g;
|
|
1348
|
+
r = r.replace(l, "");
|
|
1349
|
+
const o = t.match(l), a = o && o.length > 1, d = !b(r) && Number.isNaN(Number(r));
|
|
1350
|
+
return a || d ? { error: "Invalid value" } : o && (o[0] === "auto" || o[0] === "none") ? { value: o[0], unit: "" } : { value: r, unit: o ? o[0] : "" };
|
|
1351
|
+
}, qr = (t) => {
|
|
1352
|
+
const s = t.startsWith("-") ? "-" : "", r = t.split("-").pop();
|
|
1353
|
+
if (["auto", "none"].includes(r))
|
|
1354
|
+
return { value: "", unit: r };
|
|
1355
|
+
if (r === "px")
|
|
1289
1356
|
return { value: "1", unit: "px" };
|
|
1290
|
-
if (
|
|
1291
|
-
return { value: "100", unit:
|
|
1292
|
-
if (
|
|
1357
|
+
if (r === "screen")
|
|
1358
|
+
return { value: "100", unit: t.indexOf("w-") !== -1 ? "vw" : "vh" };
|
|
1359
|
+
if (r === "full")
|
|
1293
1360
|
return { value: "100", unit: "%" };
|
|
1294
|
-
if (
|
|
1295
|
-
return { value: `${
|
|
1296
|
-
if (
|
|
1297
|
-
return { value: `${
|
|
1298
|
-
if (
|
|
1299
|
-
return { value: `${
|
|
1300
|
-
if (
|
|
1301
|
-
return { value: `${
|
|
1302
|
-
if (
|
|
1303
|
-
return { value: `${
|
|
1304
|
-
if (
|
|
1305
|
-
return { value: `${
|
|
1306
|
-
if (
|
|
1307
|
-
const
|
|
1308
|
-
if (
|
|
1309
|
-
return { value:
|
|
1310
|
-
if (
|
|
1361
|
+
if (M(t, "skew-"))
|
|
1362
|
+
return { value: `${s}${r}`, unit: "deg" };
|
|
1363
|
+
if (M(t, "rotate-"))
|
|
1364
|
+
return { value: `${s}${r}`, unit: "deg" };
|
|
1365
|
+
if (M(t, "opacity-"))
|
|
1366
|
+
return { value: `${r / 100}`, unit: "-" };
|
|
1367
|
+
if (M(t, "duration-") || M(t, "delay-"))
|
|
1368
|
+
return { value: `${r}`, unit: "ms" };
|
|
1369
|
+
if (M(t, "translate-") && !r.includes("/"))
|
|
1370
|
+
return { value: `${s}${`${r / 4}`}`, unit: "rem" };
|
|
1371
|
+
if (M(t, "scale-"))
|
|
1372
|
+
return { value: `${s}${`${r / 100}`}`, unit: "-" };
|
|
1373
|
+
if (z(t, "border")) {
|
|
1374
|
+
const l = t.match(/border-?(x|y|t|r|b|l)?\d+/g);
|
|
1375
|
+
if (l)
|
|
1376
|
+
return { value: l[0].split("-").pop(), unit: "px" };
|
|
1377
|
+
if (t.match(/border-?(x|y|t|r|b|l)?/g))
|
|
1311
1378
|
return { value: "1", unit: "px" };
|
|
1312
1379
|
}
|
|
1313
|
-
if (
|
|
1314
|
-
if (
|
|
1380
|
+
if (z(t, "max-w-")) {
|
|
1381
|
+
if (t === "max-w-screen-sm")
|
|
1315
1382
|
return { value: "640", unit: "px" };
|
|
1316
|
-
if (
|
|
1383
|
+
if (t === "max-w-screen-md")
|
|
1317
1384
|
return { value: "768", unit: "px" };
|
|
1318
|
-
if (
|
|
1385
|
+
if (t === "max-w-screen-lg")
|
|
1319
1386
|
return { value: "1024", unit: "px" };
|
|
1320
|
-
if (
|
|
1387
|
+
if (t === "max-w-screen-xl")
|
|
1321
1388
|
return { value: "1280", unit: "px" };
|
|
1322
|
-
if (
|
|
1389
|
+
if (t === "max-w-screen-2xl")
|
|
1323
1390
|
return { value: "1536", unit: "px" };
|
|
1324
|
-
if (
|
|
1391
|
+
if (r === "xs")
|
|
1325
1392
|
return { value: "320", unit: "px" };
|
|
1326
|
-
if (
|
|
1393
|
+
if (r === "sm")
|
|
1327
1394
|
return { value: "384", unit: "px" };
|
|
1328
|
-
if (
|
|
1395
|
+
if (r === "md")
|
|
1329
1396
|
return { value: "448", unit: "px" };
|
|
1330
|
-
if (
|
|
1397
|
+
if (r === "lg")
|
|
1331
1398
|
return { value: "512", unit: "px" };
|
|
1332
|
-
if (
|
|
1399
|
+
if (r === "xl")
|
|
1333
1400
|
return { value: "576", unit: "px" };
|
|
1334
|
-
if (
|
|
1401
|
+
if (r === "2xl")
|
|
1335
1402
|
return { value: "672", unit: "px" };
|
|
1336
|
-
if (
|
|
1403
|
+
if (r === "3xl")
|
|
1337
1404
|
return { value: "768", unit: "px" };
|
|
1338
|
-
if (
|
|
1405
|
+
if (r === "4xl")
|
|
1339
1406
|
return { value: "896", unit: "px" };
|
|
1340
|
-
if (
|
|
1407
|
+
if (r === "5xl")
|
|
1341
1408
|
return { value: "1024", unit: "px" };
|
|
1342
|
-
if (
|
|
1409
|
+
if (r === "6xl")
|
|
1343
1410
|
return { value: "1152", unit: "px" };
|
|
1344
|
-
if (
|
|
1411
|
+
if (r === "7xl")
|
|
1345
1412
|
return { value: "1280", unit: "px" };
|
|
1346
|
-
if (
|
|
1413
|
+
if (r === "prose")
|
|
1347
1414
|
return { value: "65", unit: "ch" };
|
|
1348
1415
|
}
|
|
1349
|
-
if (
|
|
1350
|
-
if (
|
|
1416
|
+
if (z(t, "text-")) {
|
|
1417
|
+
if (r === "xs")
|
|
1351
1418
|
return { value: "12", unit: "px" };
|
|
1352
|
-
if (
|
|
1419
|
+
if (r === "sm")
|
|
1353
1420
|
return { value: "14", unit: "px" };
|
|
1354
|
-
if (
|
|
1421
|
+
if (r === "base")
|
|
1355
1422
|
return { value: "16", unit: "px" };
|
|
1356
|
-
if (
|
|
1423
|
+
if (r === "lg")
|
|
1357
1424
|
return { value: "18", unit: "px" };
|
|
1358
|
-
if (
|
|
1425
|
+
if (r === "xl")
|
|
1359
1426
|
return { value: "20", unit: "px" };
|
|
1360
|
-
if (
|
|
1427
|
+
if (r === "2xl")
|
|
1361
1428
|
return { value: "24", unit: "px" };
|
|
1362
|
-
if (
|
|
1429
|
+
if (r === "3xl")
|
|
1363
1430
|
return { value: "30", unit: "px" };
|
|
1364
|
-
if (
|
|
1431
|
+
if (r === "4xl")
|
|
1365
1432
|
return { value: "36", unit: "px" };
|
|
1366
|
-
if (
|
|
1433
|
+
if (r === "5xl")
|
|
1367
1434
|
return { value: "48", unit: "px" };
|
|
1368
|
-
if (
|
|
1435
|
+
if (r === "6xl")
|
|
1369
1436
|
return { value: "60", unit: "px" };
|
|
1370
|
-
if (
|
|
1437
|
+
if (r === "7xl")
|
|
1371
1438
|
return { value: "72", unit: "px" };
|
|
1372
|
-
if (
|
|
1439
|
+
if (r === "8xl")
|
|
1373
1440
|
return { value: "96", unit: "px" };
|
|
1374
|
-
if (
|
|
1441
|
+
if (r === "9xl")
|
|
1375
1442
|
return { value: "128", unit: "px" };
|
|
1376
1443
|
}
|
|
1377
|
-
if (
|
|
1378
|
-
if (
|
|
1444
|
+
if (z(t, "leading-")) {
|
|
1445
|
+
if (r === "none")
|
|
1379
1446
|
return { value: "1", unit: "-" };
|
|
1380
|
-
if (
|
|
1447
|
+
if (r === "tight")
|
|
1381
1448
|
return { value: "1.25", unit: "-" };
|
|
1382
|
-
if (
|
|
1449
|
+
if (r === "snug")
|
|
1383
1450
|
return { value: "1.375", unit: "-" };
|
|
1384
|
-
if (
|
|
1451
|
+
if (r === "normal")
|
|
1385
1452
|
return { value: "1.5", unit: "-" };
|
|
1386
|
-
if (
|
|
1453
|
+
if (r === "relaxed")
|
|
1387
1454
|
return { value: "1.625", unit: "-" };
|
|
1388
|
-
if (
|
|
1455
|
+
if (r === "loose")
|
|
1389
1456
|
return { value: "2", unit: "-" };
|
|
1390
1457
|
}
|
|
1391
|
-
if (
|
|
1392
|
-
if (
|
|
1458
|
+
if (z(t, "tracking-")) {
|
|
1459
|
+
if (r === "tighter")
|
|
1393
1460
|
return { value: "-0.05", unit: "em" };
|
|
1394
|
-
if (
|
|
1461
|
+
if (r === "tight")
|
|
1395
1462
|
return { value: "-0.025", unit: "em" };
|
|
1396
|
-
if (
|
|
1463
|
+
if (r === "normal")
|
|
1397
1464
|
return { value: "0", unit: "em" };
|
|
1398
|
-
if (
|
|
1465
|
+
if (r === "wide")
|
|
1399
1466
|
return { value: "0.025", unit: "em" };
|
|
1400
|
-
if (
|
|
1467
|
+
if (r === "wider")
|
|
1401
1468
|
return { value: "0.05", unit: "em" };
|
|
1402
|
-
if (
|
|
1469
|
+
if (r === "widest")
|
|
1403
1470
|
return { value: "0.1", unit: "em" };
|
|
1404
1471
|
}
|
|
1405
|
-
if (["max", "min", "fit"].includes(
|
|
1406
|
-
return { value:
|
|
1407
|
-
if (
|
|
1408
|
-
const [
|
|
1409
|
-
return { value:
|
|
1472
|
+
if (["max", "min", "fit"].includes(r))
|
|
1473
|
+
return { value: t, unit: "class" };
|
|
1474
|
+
if (r.includes("/")) {
|
|
1475
|
+
const [l, o] = C(r.split("/"), (a) => parseInt(a, 10));
|
|
1476
|
+
return { value: s + (l / o * 100).toFixed(2).replace(".00", ""), unit: "%" };
|
|
1410
1477
|
}
|
|
1411
|
-
return
|
|
1412
|
-
},
|
|
1413
|
-
if (b(
|
|
1478
|
+
return yt(parseFloat(r)) ? { value: `${s + parseFloat(r) * 4}`, unit: "px" } : { value: r, unit: "class" };
|
|
1479
|
+
}, Jr = (t) => {
|
|
1480
|
+
if (b(t))
|
|
1414
1481
|
return { value: "", unit: "" };
|
|
1415
|
-
const
|
|
1416
|
-
if (
|
|
1417
|
-
return
|
|
1418
|
-
const
|
|
1419
|
-
return { value: `${
|
|
1420
|
-
},
|
|
1482
|
+
const s = t.match(/\[.*\]/g);
|
|
1483
|
+
if (s === null)
|
|
1484
|
+
return Qr(t);
|
|
1485
|
+
const r = p(s, "0", "").replace(/\[|\]/g, ""), l = t.startsWith("-") ? "-" : "", o = we(r.match(/\d+.\d+|\d+/g));
|
|
1486
|
+
return { value: `${l}${o}`, unit: r.replace(o, "") };
|
|
1487
|
+
}, Qr = (t) => b(t) ? { value: "", unit: "" } : qr(t), ot = $.createContext({
|
|
1421
1488
|
setDragData: () => {
|
|
1422
1489
|
}
|
|
1423
|
-
}),
|
|
1424
|
-
unit:
|
|
1425
|
-
currentValue:
|
|
1426
|
-
onDrag:
|
|
1427
|
-
onDragEnd:
|
|
1428
|
-
onDragStart:
|
|
1429
|
-
negative:
|
|
1490
|
+
}), es = ({
|
|
1491
|
+
unit: t,
|
|
1492
|
+
currentValue: s,
|
|
1493
|
+
onDrag: r,
|
|
1494
|
+
onDragEnd: l,
|
|
1495
|
+
onDragStart: o,
|
|
1496
|
+
negative: a,
|
|
1430
1497
|
cssProperty: d
|
|
1431
1498
|
}) => {
|
|
1432
|
-
const { setDragData: i } =
|
|
1499
|
+
const { setDragData: i } = re(ot);
|
|
1433
1500
|
return /* @__PURE__ */ e.jsx(
|
|
1434
1501
|
"button",
|
|
1435
1502
|
{
|
|
1436
1503
|
type: "button",
|
|
1437
1504
|
onMouseDown: (n) => {
|
|
1438
|
-
const
|
|
1439
|
-
onDrag:
|
|
1440
|
-
onDragEnd:
|
|
1505
|
+
const u = {
|
|
1506
|
+
onDrag: r,
|
|
1507
|
+
onDragEnd: l,
|
|
1441
1508
|
dragging: !0,
|
|
1442
1509
|
dragStartY: n.pageY,
|
|
1443
|
-
dragStartValue: `${
|
|
1444
|
-
dragUnit:
|
|
1445
|
-
negative:
|
|
1510
|
+
dragStartValue: `${s}`,
|
|
1511
|
+
dragUnit: t,
|
|
1512
|
+
negative: a,
|
|
1446
1513
|
cssProperty: d
|
|
1447
1514
|
};
|
|
1448
|
-
|
|
1515
|
+
o(u), i(u);
|
|
1449
1516
|
},
|
|
1450
1517
|
color: void 0,
|
|
1451
1518
|
className: "relative z-50 ml-1 hidden h-6 cursor-row-resize rounded bg-background/70 px-2 group-hover:inline",
|
|
1452
|
-
children: /* @__PURE__ */ e.jsx(
|
|
1519
|
+
children: /* @__PURE__ */ e.jsx(Lt, {})
|
|
1453
1520
|
}
|
|
1454
1521
|
);
|
|
1455
|
-
},
|
|
1456
|
-
|
|
1522
|
+
}, ts = ({ onSelect: t, current: s, units: r }) => /* @__PURE__ */ e.jsx("div", { "data-theme": "light", className: "-m-[7px] -mx-[13px] flex w-9 flex-col", children: r.map((l) => /* @__PURE__ */ e.jsx(
|
|
1523
|
+
ue,
|
|
1457
1524
|
{
|
|
1458
1525
|
className: "h-max rounded-none px-1 py-1 text-right text-[11px] hover:bg-blue-400",
|
|
1459
|
-
color:
|
|
1526
|
+
color: s === l ? "primary" : void 0,
|
|
1460
1527
|
size: "sm",
|
|
1461
|
-
onClick: (
|
|
1462
|
-
|
|
1528
|
+
onClick: (o) => {
|
|
1529
|
+
o.stopPropagation(), t(l);
|
|
1463
1530
|
},
|
|
1464
|
-
children:
|
|
1531
|
+
children: l
|
|
1465
1532
|
},
|
|
1466
|
-
|
|
1467
|
-
)) }),
|
|
1468
|
-
const [
|
|
1469
|
-
|
|
1470
|
-
const { value:
|
|
1471
|
-
if (
|
|
1472
|
-
|
|
1533
|
+
l
|
|
1534
|
+
)) }), rs = (t) => {
|
|
1535
|
+
const [s, r] = w(!1), [l, o] = w(""), { currentClass: a, onChange: d, classPrefix: i, cssProperty: n, units: u, negative: x } = t, [c, m] = w(n != null && n.toLowerCase().includes("width") ? "%" : u[0]), [h, g] = w(!1), [f, S] = w(""), [D, j] = w(!1), [L, P] = w(!1);
|
|
1536
|
+
E(() => {
|
|
1537
|
+
const { value: y, unit: v } = Jr(a);
|
|
1538
|
+
if (v === "") {
|
|
1539
|
+
o(y), m(n != null && n.toLowerCase().includes("width") ? "%" : u[0]);
|
|
1473
1540
|
return;
|
|
1474
1541
|
}
|
|
1475
|
-
|
|
1476
|
-
}, [
|
|
1477
|
-
const
|
|
1478
|
-
(
|
|
1479
|
-
d(
|
|
1542
|
+
m(v), o(v === "class" || b(y) ? "" : y);
|
|
1543
|
+
}, [a, n, u]);
|
|
1544
|
+
const k = me(
|
|
1545
|
+
(y) => {
|
|
1546
|
+
d(y);
|
|
1480
1547
|
},
|
|
1481
1548
|
[d],
|
|
1482
1549
|
200
|
|
1483
|
-
),
|
|
1484
|
-
(
|
|
1485
|
-
d(
|
|
1550
|
+
), I = me(
|
|
1551
|
+
(y) => {
|
|
1552
|
+
d(y, !1);
|
|
1486
1553
|
},
|
|
1487
1554
|
[d],
|
|
1488
1555
|
200
|
|
1489
|
-
),
|
|
1490
|
-
(
|
|
1491
|
-
const
|
|
1492
|
-
if (
|
|
1493
|
-
|
|
1556
|
+
), F = A(
|
|
1557
|
+
(y = !1) => {
|
|
1558
|
+
const v = Ie(`${l}`, u);
|
|
1559
|
+
if (p(v, "error", !1)) {
|
|
1560
|
+
g(!0);
|
|
1494
1561
|
return;
|
|
1495
1562
|
}
|
|
1496
|
-
const T =
|
|
1563
|
+
const T = p(v, "unit") !== "" ? p(v, "unit") : c;
|
|
1497
1564
|
if (T === "auto" || T === "none") {
|
|
1498
|
-
|
|
1565
|
+
k(`${i}${T}`);
|
|
1499
1566
|
return;
|
|
1500
1567
|
}
|
|
1501
|
-
if (
|
|
1568
|
+
if (p(v, "value") === "")
|
|
1502
1569
|
return;
|
|
1503
|
-
const
|
|
1504
|
-
|
|
1570
|
+
const K = `${p(v, "value", "").startsWith("-") ? "-" : ""}${i}[${p(v, "value", "").replace("-", "")}${T === "-" ? "" : T}]`;
|
|
1571
|
+
y ? I(K) : k(K);
|
|
1505
1572
|
},
|
|
1506
|
-
[
|
|
1507
|
-
), oe =
|
|
1508
|
-
(
|
|
1509
|
-
const
|
|
1510
|
-
if (
|
|
1511
|
-
|
|
1573
|
+
[k, I, l, c, i, u]
|
|
1574
|
+
), oe = A(
|
|
1575
|
+
(y) => {
|
|
1576
|
+
const v = Ie(`${l}`, u);
|
|
1577
|
+
if (p(v, "error", !1)) {
|
|
1578
|
+
g(!0);
|
|
1512
1579
|
return;
|
|
1513
1580
|
}
|
|
1514
|
-
if (
|
|
1515
|
-
|
|
1581
|
+
if (y === "auto" || y === "none") {
|
|
1582
|
+
k(`${i}${y}`);
|
|
1516
1583
|
return;
|
|
1517
1584
|
}
|
|
1518
|
-
if (
|
|
1585
|
+
if (p(v, "value") === "")
|
|
1519
1586
|
return;
|
|
1520
|
-
const T =
|
|
1521
|
-
|
|
1587
|
+
const T = p(v, "unit") !== "" ? p(v, "unit") : y, K = `${p(v, "value", "").startsWith("-") ? "-" : ""}${i}[${p(v, "value", "").replace("-", "")}${T === "-" ? "" : T}]`;
|
|
1588
|
+
k(K);
|
|
1522
1589
|
},
|
|
1523
|
-
[
|
|
1590
|
+
[k, l, i, u]
|
|
1524
1591
|
);
|
|
1525
|
-
return /* @__PURE__ */ e.jsx("div", { className: "flex w-full flex-col", children: /* @__PURE__ */ e.jsx("div", { className: "flex items-center justify-start", children:
|
|
1526
|
-
/* @__PURE__ */ e.jsx("input", { className: "w-20 rounded py-1", readOnly: !0, value:
|
|
1527
|
-
/* @__PURE__ */ e.jsxs(
|
|
1528
|
-
/* @__PURE__ */ e.jsx(
|
|
1529
|
-
/* @__PURE__ */ e.jsx(
|
|
1592
|
+
return /* @__PURE__ */ e.jsx("div", { className: "flex w-full flex-col", children: /* @__PURE__ */ e.jsx("div", { className: "flex items-center justify-start", children: c === "class" ? /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
1593
|
+
/* @__PURE__ */ e.jsx("input", { className: "w-20 rounded py-1", readOnly: !0, value: a }),
|
|
1594
|
+
/* @__PURE__ */ e.jsxs(X, { children: [
|
|
1595
|
+
/* @__PURE__ */ e.jsx(W, { 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(ke, {}) }) }),
|
|
1596
|
+
/* @__PURE__ */ e.jsx(Z, { children: "Current value is using a Tailwind preset class." })
|
|
1530
1597
|
] })
|
|
1531
|
-
] }) : /* @__PURE__ */ e.jsxs("div", { className: `group relative flex items-center ${
|
|
1598
|
+
] }) : /* @__PURE__ */ e.jsxs("div", { className: `group relative flex items-center ${D ? "z-auto" : ""}`, children: [
|
|
1532
1599
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center rounded-md border border-border", children: [
|
|
1533
|
-
["none", "auto"].indexOf(
|
|
1600
|
+
["none", "auto"].indexOf(c) !== -1 ? null : /* @__PURE__ */ e.jsx(
|
|
1534
1601
|
"input",
|
|
1535
1602
|
{
|
|
1536
|
-
readOnly:
|
|
1537
|
-
onKeyPress: (
|
|
1538
|
-
|
|
1603
|
+
readOnly: c === "class",
|
|
1604
|
+
onKeyPress: (y) => {
|
|
1605
|
+
y.key === "Enter" && F();
|
|
1539
1606
|
},
|
|
1540
|
-
onKeyDown: (
|
|
1541
|
-
if (
|
|
1607
|
+
onKeyDown: (y) => {
|
|
1608
|
+
if (y.keyCode !== 38 && y.keyCode !== 40)
|
|
1542
1609
|
return;
|
|
1543
|
-
|
|
1544
|
-
const
|
|
1545
|
-
let T =
|
|
1546
|
-
|
|
1547
|
-
const
|
|
1548
|
-
|
|
1610
|
+
y.preventDefault(), P(!0);
|
|
1611
|
+
const v = bt(y.target.value);
|
|
1612
|
+
let T = _e(v) ? 0 : v;
|
|
1613
|
+
y.keyCode === 38 && (T += 1), y.keyCode === 40 && (T -= 1);
|
|
1614
|
+
const _ = `${T}`, at = `${_.startsWith("-") ? "-" : ""}${i}[${_.replace("-", "")}${c === "-" ? "" : c}]`;
|
|
1615
|
+
I(at);
|
|
1549
1616
|
},
|
|
1550
|
-
onKeyUp: (
|
|
1551
|
-
|
|
1617
|
+
onKeyUp: (y) => {
|
|
1618
|
+
L && (y.preventDefault(), P(!1));
|
|
1552
1619
|
},
|
|
1553
|
-
onBlur: () =>
|
|
1554
|
-
onChange: (
|
|
1555
|
-
|
|
1620
|
+
onBlur: () => F(),
|
|
1621
|
+
onChange: (y) => {
|
|
1622
|
+
g(!1), o(y.target.value);
|
|
1556
1623
|
},
|
|
1557
|
-
onClick: (
|
|
1558
|
-
var
|
|
1559
|
-
(
|
|
1624
|
+
onClick: (y) => {
|
|
1625
|
+
var v;
|
|
1626
|
+
(v = y == null ? void 0 : y.target) == null || v.select(), r(!1);
|
|
1560
1627
|
},
|
|
1561
|
-
value:
|
|
1628
|
+
value: D ? f : l,
|
|
1562
1629
|
className: "h-6 w-14 rounded rounded-r-none bg-background pl-2 text-sm focus-visible:outline-0 ".concat(
|
|
1563
1630
|
" ",
|
|
1564
|
-
|
|
1631
|
+
h ? "border-red-500 text-red-500" : "border-foreground/20"
|
|
1565
1632
|
)
|
|
1566
1633
|
}
|
|
1567
1634
|
),
|
|
1568
|
-
/* @__PURE__ */ e.jsxs(
|
|
1569
|
-
/* @__PURE__ */ e.jsx(
|
|
1635
|
+
/* @__PURE__ */ e.jsxs(X, { open: s, delayDuration: 100, children: [
|
|
1636
|
+
/* @__PURE__ */ e.jsx(W, { asChild: !0, children: /* @__PURE__ */ e.jsxs(
|
|
1570
1637
|
"button",
|
|
1571
1638
|
{
|
|
1572
1639
|
type: "button",
|
|
1573
|
-
onClick: () =>
|
|
1640
|
+
onClick: () => r(!s),
|
|
1574
1641
|
className: "flex h-6 cursor-pointer items-center gap-x-1 rounded rounded-l-none bg-background p-px px-1 text-[11px] uppercase",
|
|
1575
1642
|
children: [
|
|
1576
|
-
/* @__PURE__ */ e.jsx("span", { className: `inline-block ${
|
|
1577
|
-
|
|
1643
|
+
/* @__PURE__ */ e.jsx("span", { className: `inline-block ${u.length === 1 ? "px-2 font-semibold" : ""}`, children: c }),
|
|
1644
|
+
u.length > 1 ? /* @__PURE__ */ e.jsx(It, {}) : null
|
|
1578
1645
|
]
|
|
1579
1646
|
}
|
|
1580
1647
|
) }),
|
|
1581
|
-
/* @__PURE__ */ e.jsx(
|
|
1582
|
-
|
|
1648
|
+
/* @__PURE__ */ e.jsx(tr, { children: /* @__PURE__ */ e.jsx(Z, { className: "bg-background", children: /* @__PURE__ */ e.jsx(
|
|
1649
|
+
ts,
|
|
1583
1650
|
{
|
|
1584
|
-
units:
|
|
1585
|
-
current:
|
|
1586
|
-
onSelect: (
|
|
1587
|
-
|
|
1651
|
+
units: u,
|
|
1652
|
+
current: c,
|
|
1653
|
+
onSelect: (y) => {
|
|
1654
|
+
r(!1), m(y), oe(y);
|
|
1588
1655
|
}
|
|
1589
1656
|
}
|
|
1590
1657
|
) }) })
|
|
1591
1658
|
] })
|
|
1592
1659
|
] }),
|
|
1593
|
-
["none", "auto"].indexOf(
|
|
1594
|
-
|
|
1660
|
+
["none", "auto"].indexOf(c) !== -1 || D ? null : /* @__PURE__ */ e.jsx(
|
|
1661
|
+
es,
|
|
1595
1662
|
{
|
|
1596
1663
|
onDragStart: () => j(!0),
|
|
1597
|
-
onDragEnd: (
|
|
1598
|
-
if (
|
|
1664
|
+
onDragEnd: (y) => {
|
|
1665
|
+
if (S(() => ""), j(!1), b(y))
|
|
1599
1666
|
return;
|
|
1600
|
-
const
|
|
1601
|
-
|
|
1667
|
+
const v = `${y}`, _ = `${v.startsWith("-") ? "-" : ""}${i}[${v.replace("-", "")}${c === "-" ? "" : c}]`;
|
|
1668
|
+
k(_);
|
|
1602
1669
|
},
|
|
1603
|
-
onDrag: (
|
|
1604
|
-
if (b(
|
|
1670
|
+
onDrag: (y) => {
|
|
1671
|
+
if (b(y))
|
|
1605
1672
|
return;
|
|
1606
|
-
|
|
1607
|
-
const
|
|
1608
|
-
|
|
1673
|
+
S(y);
|
|
1674
|
+
const v = `${y}`, _ = `${v.startsWith("-") ? "-" : ""}${i}[${v.replace("-", "")}${c === "-" ? "" : c}]`;
|
|
1675
|
+
I(_);
|
|
1609
1676
|
},
|
|
1610
|
-
currentValue:
|
|
1611
|
-
unit:
|
|
1612
|
-
negative:
|
|
1677
|
+
currentValue: l,
|
|
1678
|
+
unit: c,
|
|
1679
|
+
negative: x,
|
|
1613
1680
|
cssProperty: n
|
|
1614
1681
|
}
|
|
1615
1682
|
)
|
|
1616
1683
|
] }) }) });
|
|
1617
|
-
}, le = (
|
|
1618
|
-
const
|
|
1619
|
-
return
|
|
1620
|
-
},
|
|
1621
|
-
const
|
|
1684
|
+
}, le = (t) => {
|
|
1685
|
+
const s = pe();
|
|
1686
|
+
return ft(s, { property: t });
|
|
1687
|
+
}, ss = (t, s) => {
|
|
1688
|
+
const r = {
|
|
1622
1689
|
xs: 0,
|
|
1623
1690
|
sm: 1,
|
|
1624
1691
|
md: 2,
|
|
@@ -1626,8 +1693,8 @@ const Nr = ({ property: r, onChange: o }) => {
|
|
|
1626
1693
|
xl: 4,
|
|
1627
1694
|
"2xl": 5
|
|
1628
1695
|
};
|
|
1629
|
-
return
|
|
1630
|
-
},
|
|
1696
|
+
return r[p(t, "mq", "xs")] <= r[s];
|
|
1697
|
+
}, ls = {
|
|
1631
1698
|
width: "w-",
|
|
1632
1699
|
height: "h-",
|
|
1633
1700
|
minWidth: "min-w-",
|
|
@@ -1693,31 +1760,31 @@ const Nr = ({ property: r, onChange: o }) => {
|
|
|
1693
1760
|
insetY: "inset-y-",
|
|
1694
1761
|
opacity: "opacity-",
|
|
1695
1762
|
flexBasis: "basis-"
|
|
1696
|
-
},
|
|
1763
|
+
}, Le = {
|
|
1697
1764
|
xs: "",
|
|
1698
1765
|
sm: "640px",
|
|
1699
1766
|
md: "768px",
|
|
1700
1767
|
lg: "1024px",
|
|
1701
1768
|
xl: "1280px",
|
|
1702
1769
|
"2xl": "1536px"
|
|
1703
|
-
},
|
|
1704
|
-
const { type:
|
|
1705
|
-
}, units:
|
|
1706
|
-
(
|
|
1707
|
-
const
|
|
1708
|
-
(i || n !== "") && (
|
|
1709
|
-
const oe =
|
|
1710
|
-
h
|
|
1770
|
+
}, os = (t) => `${t.toUpperCase()} ${Le[t] ? `(${Le[t]} & up)` : ""}`, Te = (t) => {
|
|
1771
|
+
const { type: s = "icons", label: r, property: l, onEmitChange: o = () => {
|
|
1772
|
+
}, units: a, negative: d = !1 } = t, [i] = Zt(), [n] = Je(), [, u] = Ae(), x = le(l), c = Ge(), m = Ke(), [h] = qe(), g = N(() => p(x, "fullCls", ""), [x]), f = A(
|
|
1773
|
+
(k, I = !0) => {
|
|
1774
|
+
const F = { dark: i, mq: u, mod: n, cls: k, property: l, fullCls: "" };
|
|
1775
|
+
(i || n !== "") && (F.mq = "xs");
|
|
1776
|
+
const oe = Tr(F);
|
|
1777
|
+
c(h, [oe], I);
|
|
1711
1778
|
},
|
|
1712
|
-
[
|
|
1713
|
-
),
|
|
1714
|
-
|
|
1715
|
-
}, [
|
|
1716
|
-
|
|
1717
|
-
|
|
1718
|
-
}, [
|
|
1719
|
-
const [, , j] =
|
|
1720
|
-
(
|
|
1779
|
+
[h, i, u, n, l, c]
|
|
1780
|
+
), S = A(() => {
|
|
1781
|
+
m(h, [g]);
|
|
1782
|
+
}, [h, g, m]), D = N(() => ss(x, u), [x, u]);
|
|
1783
|
+
E(() => {
|
|
1784
|
+
o(D, x);
|
|
1785
|
+
}, [D, o, x]);
|
|
1786
|
+
const [, , j] = Ae(), L = A(
|
|
1787
|
+
(k) => {
|
|
1721
1788
|
j({
|
|
1722
1789
|
xs: 400,
|
|
1723
1790
|
sm: 640,
|
|
@@ -1725,55 +1792,55 @@ const Nr = ({ property: r, onChange: o }) => {
|
|
|
1725
1792
|
lg: 1024,
|
|
1726
1793
|
xl: 1420,
|
|
1727
1794
|
"2xl": 1920
|
|
1728
|
-
}[
|
|
1795
|
+
}[k]);
|
|
1729
1796
|
},
|
|
1730
1797
|
[j]
|
|
1731
|
-
),
|
|
1732
|
-
return /* @__PURE__ */ e.jsx(
|
|
1733
|
-
/* @__PURE__ */ e.jsx("div", { className: "relative w-[70px] truncate text-xs text-foreground", children: /* @__PURE__ */ e.jsx("span", { className: `text-[11px] ${
|
|
1798
|
+
), P = p(x, "dark", null) === i && p(x, "mod", null) === n && p(x, "mq", null) === u;
|
|
1799
|
+
return /* @__PURE__ */ e.jsx(Zr, { canChange: D, canReset: x && P, children: /* @__PURE__ */ e.jsxs("div", { className: "group flex flex-row items-center py-2 first:pt-0 last:pb-0", children: [
|
|
1800
|
+
/* @__PURE__ */ e.jsx("div", { className: "relative w-[70px] truncate text-xs text-foreground", children: /* @__PURE__ */ e.jsx("span", { className: `text-[11px] ${x && !P ? "text-foreground" : ""}`, children: r }) }),
|
|
1734
1801
|
/* @__PURE__ */ e.jsxs("div", { className: "flex flex-row items-center", children: [
|
|
1735
1802
|
/* @__PURE__ */ e.jsxs("div", { className: "w-[150px]", children: [
|
|
1736
|
-
|
|
1737
|
-
|
|
1803
|
+
s === "arbitrary" ? /* @__PURE__ */ e.jsx(
|
|
1804
|
+
rs,
|
|
1738
1805
|
{
|
|
1739
|
-
currentClass:
|
|
1740
|
-
classPrefix:
|
|
1741
|
-
units:
|
|
1806
|
+
currentClass: p(x, "cls", ""),
|
|
1807
|
+
classPrefix: p(ls, l, ""),
|
|
1808
|
+
units: a || [],
|
|
1742
1809
|
onChange: f,
|
|
1743
1810
|
negative: d,
|
|
1744
|
-
cssProperty:
|
|
1811
|
+
cssProperty: l
|
|
1745
1812
|
}
|
|
1746
1813
|
) : null,
|
|
1747
|
-
|
|
1748
|
-
|
|
1749
|
-
|
|
1750
|
-
|
|
1814
|
+
s === "icons" && /* @__PURE__ */ e.jsx(Ur, { property: l, onChange: f }),
|
|
1815
|
+
s === "range" && /* @__PURE__ */ e.jsx(zr, { property: l, onChange: f }),
|
|
1816
|
+
s === "color" && /* @__PURE__ */ e.jsx(Kr, { property: l, onChange: f }),
|
|
1817
|
+
s === "dropdown" && /* @__PURE__ */ e.jsx(lt, { label: r, property: l, onChange: f })
|
|
1751
1818
|
] }),
|
|
1752
|
-
/* @__PURE__ */ e.jsx("div", { className: `w-[30px] cursor-pointer ${
|
|
1753
|
-
/* @__PURE__ */ e.jsx(
|
|
1819
|
+
/* @__PURE__ */ e.jsx("div", { className: `w-[30px] cursor-pointer ${g ? "visible" : "invisible"}`, children: P ? /* @__PURE__ */ e.jsx("button", { type: "button", onClick: () => S(), title: "Reset", className: "flex px-1.5 text-xs", children: /* @__PURE__ */ e.jsx(We, { className: "h-5 w-5 text-blue-500 hover:opacity-80" }) }) : D && x ? /* @__PURE__ */ e.jsxs(X, { delayDuration: 100, children: [
|
|
1820
|
+
/* @__PURE__ */ e.jsx(W, { asChild: !0, children: /* @__PURE__ */ e.jsx(
|
|
1754
1821
|
"button",
|
|
1755
1822
|
{
|
|
1756
1823
|
type: "button",
|
|
1757
1824
|
className: "invisible ml-3 mt-1 rounded-full bg-blue-500 text-white group-hover:visible",
|
|
1758
|
-
children: /* @__PURE__ */ e.jsx(
|
|
1825
|
+
children: /* @__PURE__ */ e.jsx(ke, {})
|
|
1759
1826
|
}
|
|
1760
1827
|
) }),
|
|
1761
|
-
/* @__PURE__ */ e.jsx(
|
|
1828
|
+
/* @__PURE__ */ e.jsx(Z, { children: /* @__PURE__ */ e.jsx("div", { className: "text-right", children: /* @__PURE__ */ e.jsxs("div", { children: [
|
|
1762
1829
|
"Current style is set at ",
|
|
1763
1830
|
/* @__PURE__ */ e.jsxs("span", { className: "font-bold ", children: [
|
|
1764
|
-
|
|
1765
|
-
i && !
|
|
1831
|
+
os(p(x, "mq")),
|
|
1832
|
+
i && !x.dark ? "(Light mode)" : ""
|
|
1766
1833
|
] }),
|
|
1767
1834
|
/* @__PURE__ */ e.jsx("br", {}),
|
|
1768
1835
|
/* @__PURE__ */ e.jsxs(
|
|
1769
1836
|
"button",
|
|
1770
1837
|
{
|
|
1771
1838
|
type: "button",
|
|
1772
|
-
onClick: () =>
|
|
1839
|
+
onClick: () => L(p(x, "mq")),
|
|
1773
1840
|
className: "block w-full cursor-default text-right font-semibold text-blue-500",
|
|
1774
1841
|
children: [
|
|
1775
1842
|
"Switch to ",
|
|
1776
|
-
|
|
1843
|
+
p(x, "mq").toUpperCase()
|
|
1777
1844
|
]
|
|
1778
1845
|
}
|
|
1779
1846
|
)
|
|
@@ -1781,48 +1848,48 @@ const Nr = ({ property: r, onChange: o }) => {
|
|
|
1781
1848
|
] }) : null })
|
|
1782
1849
|
] })
|
|
1783
1850
|
] }) });
|
|
1784
|
-
},
|
|
1785
|
-
label:
|
|
1786
|
-
options:
|
|
1787
|
-
borderB:
|
|
1788
|
-
borderT:
|
|
1789
|
-
type:
|
|
1790
|
-
units:
|
|
1851
|
+
}, ns = ["px", "%", "em", "rem", "ch", "vh", "vw"], nt = ({
|
|
1852
|
+
label: t,
|
|
1853
|
+
options: s,
|
|
1854
|
+
borderB: r = !1,
|
|
1855
|
+
borderT: l = !1,
|
|
1856
|
+
type: o = "arbitrary",
|
|
1857
|
+
units: a = ns,
|
|
1791
1858
|
negative: d = !1
|
|
1792
1859
|
}) => {
|
|
1793
|
-
const [i, n] =
|
|
1860
|
+
const [i, n] = w(s[0].key), u = pe(), x = A((c) => C(u, "property").includes(c), [u]);
|
|
1794
1861
|
return /* @__PURE__ */ e.jsxs(
|
|
1795
1862
|
"div",
|
|
1796
1863
|
{
|
|
1797
|
-
className: `mb-2 border-gray-800 py-2 first:pt-0 last:pb-0 ${
|
|
1864
|
+
className: `mb-2 border-gray-800 py-2 first:pt-0 last:pb-0 ${r ? "border-b" : ""} ${l ? "border-t" : ""}`,
|
|
1798
1865
|
children: [
|
|
1799
1866
|
/* @__PURE__ */ e.jsxs("div", { className: "flex flex-row text-xs", children: [
|
|
1800
|
-
|
|
1801
|
-
/* @__PURE__ */ e.jsx("div", { className: "mb-3 flex grow flex-row flex-wrap gap-x-px", children:
|
|
1802
|
-
|
|
1803
|
-
/* @__PURE__ */ e.jsx(
|
|
1867
|
+
t && /* @__PURE__ */ e.jsx("span", { className: "relative w-[70px] flex-none text-xs text-foreground", children: t }),
|
|
1868
|
+
/* @__PURE__ */ e.jsx("div", { className: "mb-3 flex grow flex-row flex-wrap gap-x-px", children: $.Children.toArray(
|
|
1869
|
+
s.map(({ label: c, key: m }) => /* @__PURE__ */ e.jsx("div", { className: "first:rounded-l last:rounded-r", children: /* @__PURE__ */ e.jsxs(X, { children: [
|
|
1870
|
+
/* @__PURE__ */ e.jsx(W, { asChild: !0, children: /* @__PURE__ */ e.jsxs(
|
|
1804
1871
|
"button",
|
|
1805
1872
|
{
|
|
1806
1873
|
type: "button",
|
|
1807
|
-
onClick: () => n(
|
|
1808
|
-
className: `relative cursor-pointer rounded-full p-1 text-[8px] ${
|
|
1874
|
+
onClick: () => n(m),
|
|
1875
|
+
className: `relative cursor-pointer rounded-full p-1 text-[8px] ${m === i ? " bg-[#3E57F0] text-white" : "text-gray-600 dark:text-gray-300"}`,
|
|
1809
1876
|
children: [
|
|
1810
|
-
|
|
1811
|
-
className:
|
|
1877
|
+
$.createElement("div", {
|
|
1878
|
+
className: x(m) ? "-bottom-1.5 absolute bg-[#3E57F0] h-[2px] left-0 w-full" : ""
|
|
1812
1879
|
}),
|
|
1813
|
-
|
|
1880
|
+
$.createElement(p(st, m, Xe), { className: "text-inherit w-3 h-3" })
|
|
1814
1881
|
]
|
|
1815
1882
|
}
|
|
1816
1883
|
) }),
|
|
1817
|
-
/* @__PURE__ */ e.jsx(
|
|
1884
|
+
/* @__PURE__ */ e.jsx(Z, { children: Y(te(c)) })
|
|
1818
1885
|
] }) }))
|
|
1819
1886
|
) })
|
|
1820
1887
|
] }),
|
|
1821
1888
|
/* @__PURE__ */ e.jsx("div", { className: "mt-0 flex items-center", children: /* @__PURE__ */ e.jsx(
|
|
1822
|
-
|
|
1889
|
+
Te,
|
|
1823
1890
|
{
|
|
1824
|
-
type:
|
|
1825
|
-
units: [...
|
|
1891
|
+
type: o,
|
|
1892
|
+
units: [...a],
|
|
1826
1893
|
label: "",
|
|
1827
1894
|
property: i,
|
|
1828
1895
|
negative: d
|
|
@@ -1831,74 +1898,74 @@ const Nr = ({ property: r, onChange: o }) => {
|
|
|
1831
1898
|
]
|
|
1832
1899
|
}
|
|
1833
1900
|
);
|
|
1834
|
-
},
|
|
1835
|
-
const
|
|
1836
|
-
const
|
|
1837
|
-
i.map((n) => n.styleType === "multiple" ?
|
|
1838
|
-
),
|
|
1839
|
-
|
|
1840
|
-
), d =
|
|
1841
|
-
return
|
|
1842
|
-
}, [
|
|
1901
|
+
}, as = ({ heading: t, items: s }) => {
|
|
1902
|
+
const r = pe(), l = N(() => {
|
|
1903
|
+
const o = (i) => U(
|
|
1904
|
+
i.map((n) => n.styleType === "multiple" ? C(n.options, "key") : n.property)
|
|
1905
|
+
), a = U(
|
|
1906
|
+
s.map((i) => i.styleType === "accordion" ? o(i.items) : i.styleType === "multiple" ? C(i.options, "key") : i.property)
|
|
1907
|
+
), d = C(r, "property");
|
|
1908
|
+
return Ee(a, d).length > 0;
|
|
1909
|
+
}, [r, s]);
|
|
1843
1910
|
return /* @__PURE__ */ e.jsxs("details", { children: [
|
|
1844
1911
|
/* @__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: [
|
|
1845
|
-
|
|
1846
|
-
|
|
1912
|
+
t,
|
|
1913
|
+
l ? /* @__PURE__ */ e.jsx(
|
|
1847
1914
|
"span",
|
|
1848
1915
|
{
|
|
1849
|
-
className: `ml-1 mr-2 inline-block h-[8px] w-[8px] rounded-full ${
|
|
1916
|
+
className: `ml-1 mr-2 inline-block h-[8px] w-[8px] rounded-full ${l ? "bg-blue-500" : "bg-gray-300"}`
|
|
1850
1917
|
}
|
|
1851
1918
|
) : null
|
|
1852
1919
|
] }) }),
|
|
1853
|
-
/* @__PURE__ */ e.jsx("div", { className: "p-2", children:
|
|
1920
|
+
/* @__PURE__ */ e.jsx("div", { className: "p-2", children: s.map((o) => o.styleType === "multiple" ? /* @__PURE__ */ e.jsx(nt, { ...o }, o.label) : /* @__PURE__ */ e.jsx(Te, { ...o }, o.label)) })
|
|
1854
1921
|
] });
|
|
1855
|
-
},
|
|
1856
|
-
const
|
|
1857
|
-
(
|
|
1922
|
+
}, is = Oe({}), he = ({ section: t }) => {
|
|
1923
|
+
const s = pe(), r = A(
|
|
1924
|
+
(a = []) => {
|
|
1858
1925
|
const d = {};
|
|
1859
|
-
for (let n = 0; n <
|
|
1860
|
-
d[
|
|
1926
|
+
for (let n = 0; n < s.length; n++)
|
|
1927
|
+
d[s[n].property] = s[n].cls;
|
|
1861
1928
|
let i = !0;
|
|
1862
|
-
for (const n in
|
|
1863
|
-
if (!
|
|
1929
|
+
for (const n in a)
|
|
1930
|
+
if (!ge(d, n) || d[n] !== a[n]) {
|
|
1864
1931
|
i = !1;
|
|
1865
1932
|
break;
|
|
1866
1933
|
}
|
|
1867
1934
|
return i;
|
|
1868
1935
|
},
|
|
1869
|
-
[
|
|
1870
|
-
),
|
|
1871
|
-
if (
|
|
1936
|
+
[s]
|
|
1937
|
+
), l = N(() => {
|
|
1938
|
+
if (s.length > 0 && t.heading === "Classes")
|
|
1872
1939
|
return !0;
|
|
1873
|
-
const
|
|
1874
|
-
n.map((
|
|
1875
|
-
), d =
|
|
1876
|
-
|
|
1877
|
-
), i =
|
|
1878
|
-
return
|
|
1879
|
-
}, [
|
|
1880
|
-
return /* @__PURE__ */ e.jsx(
|
|
1881
|
-
/* @__PURE__ */ e.jsx(
|
|
1882
|
-
/* @__PURE__ */ e.jsx("div", { className: `h-[8px] w-[8px] rounded-full ${
|
|
1883
|
-
|
|
1940
|
+
const a = (n) => U(
|
|
1941
|
+
n.map((u) => u.styleType === "multiple" ? U(C(u.options, "key")) : u.property)
|
|
1942
|
+
), d = U(
|
|
1943
|
+
t.items.map((n) => n.styleType === "accordion" ? a(n.items) : n.styleType === "multiple" ? U(C(n.options, "key")) : n.property)
|
|
1944
|
+
), i = C(s, "property");
|
|
1945
|
+
return Ee(d, i).length > 0;
|
|
1946
|
+
}, [s, t.heading, t.items]), o = N(() => ({}), []);
|
|
1947
|
+
return /* @__PURE__ */ e.jsx(is.Provider, { value: o, children: /* @__PURE__ */ e.jsxs(ie, { value: t.heading, children: [
|
|
1948
|
+
/* @__PURE__ */ e.jsx(de, { className: "px-3 py-2 text-xs hover:no-underline", children: /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-x-2", children: [
|
|
1949
|
+
/* @__PURE__ */ e.jsx("div", { className: `h-[8px] w-[8px] rounded-full ${l ? "bg-blue-500" : "bg-gray-300"}` }),
|
|
1950
|
+
t.heading
|
|
1884
1951
|
] }) }),
|
|
1885
|
-
/* @__PURE__ */ e.jsx(
|
|
1886
|
-
|
|
1952
|
+
/* @__PURE__ */ e.jsx(ce, { className: "bg-gray-100 px-3.5 py-2", children: $.Children.toArray(
|
|
1953
|
+
t.items.map((a) => ge(a, "component") ? $.createElement(a.component, { key: a.label }) : ge(a, "styleType") ? a.styleType === "multiple" ? /* @__PURE__ */ e.jsx(nt, { ...a }, a.label) : a.styleType === "accordion" && r(a == null ? void 0 : a.conditions) ? /* @__PURE__ */ e.jsx(as, { ...a }, a.label) : null : /* @__PURE__ */ e.jsx(Te, { ...a }, a.label))
|
|
1887
1954
|
) })
|
|
1888
1955
|
] }) });
|
|
1889
|
-
},
|
|
1890
|
-
item:
|
|
1891
|
-
index:
|
|
1892
|
-
canDelete:
|
|
1893
|
-
onChange:
|
|
1894
|
-
onRemove:
|
|
1895
|
-
}) => /* @__PURE__ */ e.jsxs("div", { className: `flex flex-col gap-1 border-gray-400 py-2 ${
|
|
1956
|
+
}, ds = ({
|
|
1957
|
+
item: t,
|
|
1958
|
+
index: s,
|
|
1959
|
+
canDelete: r,
|
|
1960
|
+
onChange: l,
|
|
1961
|
+
onRemove: o
|
|
1962
|
+
}) => /* @__PURE__ */ e.jsxs("div", { className: `flex flex-col gap-1 border-gray-400 py-2 ${r ? "border-b" : ""}`, children: [
|
|
1896
1963
|
/* @__PURE__ */ e.jsx(
|
|
1897
1964
|
"input",
|
|
1898
1965
|
{
|
|
1899
1966
|
name: "key",
|
|
1900
|
-
onChange: (
|
|
1901
|
-
value:
|
|
1967
|
+
onChange: (a) => l(a, s),
|
|
1968
|
+
value: t.key,
|
|
1902
1969
|
placeholder: "Key",
|
|
1903
1970
|
className: "w-full rounded border-gray-300 bg-background p-0.5 pl-2 text-sm focus-visible:outline-0",
|
|
1904
1971
|
autoComplete: "off",
|
|
@@ -1910,8 +1977,8 @@ const Nr = ({ property: r, onChange: o }) => {
|
|
|
1910
1977
|
"input",
|
|
1911
1978
|
{
|
|
1912
1979
|
name: "value",
|
|
1913
|
-
onChange: (
|
|
1914
|
-
value:
|
|
1980
|
+
onChange: (a) => b(t.key) ? {} : l(a, s),
|
|
1981
|
+
value: t.value,
|
|
1915
1982
|
placeholder: "Value",
|
|
1916
1983
|
className: "w-full rounded border-gray-300 bg-background p-0.5 pl-2 text-sm focus-visible:outline-0",
|
|
1917
1984
|
autoComplete: "off",
|
|
@@ -1919,76 +1986,76 @@ const Nr = ({ property: r, onChange: o }) => {
|
|
|
1919
1986
|
}
|
|
1920
1987
|
),
|
|
1921
1988
|
/* @__PURE__ */ e.jsx(
|
|
1922
|
-
|
|
1989
|
+
We,
|
|
1923
1990
|
{
|
|
1924
|
-
onClick:
|
|
1991
|
+
onClick: o,
|
|
1925
1992
|
className: "h-6 w-6 cursor-pointer rounded border border-red-400 p-1 text-red-400 hover:opacity-80"
|
|
1926
1993
|
}
|
|
1927
1994
|
)
|
|
1928
1995
|
] })
|
|
1929
|
-
] }),
|
|
1930
|
-
var
|
|
1931
|
-
const { setSyncState:
|
|
1932
|
-
|
|
1933
|
-
const
|
|
1934
|
-
b(
|
|
1935
|
-
}, [
|
|
1936
|
-
const n = () =>
|
|
1937
|
-
const
|
|
1938
|
-
|
|
1939
|
-
},
|
|
1940
|
-
const f = [...
|
|
1941
|
-
f[
|
|
1942
|
-
},
|
|
1943
|
-
(
|
|
1944
|
-
const
|
|
1945
|
-
|
|
1946
|
-
b(f.key) ||
|
|
1947
|
-
}), d([
|
|
1996
|
+
] }), cs = ({ section: t }) => {
|
|
1997
|
+
var m;
|
|
1998
|
+
const { setSyncState: s } = zt(), r = G(), [l, o] = w([]), [a] = Ne(), d = Ue(), i = `${p(a, "0.prop")}_attrs`;
|
|
1999
|
+
ne.useEffect(() => {
|
|
2000
|
+
const h = C(p(r, i), (g, f) => ({ key: f, value: g }));
|
|
2001
|
+
b(h) ? o([]) : o(h);
|
|
2002
|
+
}, [p(r, i)]);
|
|
2003
|
+
const n = () => o([...l, { key: "", value: "" }]), u = (h) => {
|
|
2004
|
+
const g = be(l, (f, S) => h !== S);
|
|
2005
|
+
c(g);
|
|
2006
|
+
}, x = (h, g) => {
|
|
2007
|
+
const f = [...l];
|
|
2008
|
+
f[g][h.target.name] = h.target.value, c(f);
|
|
2009
|
+
}, c = ne.useCallback(
|
|
2010
|
+
(h = []) => {
|
|
2011
|
+
const g = {};
|
|
2012
|
+
je(h, (f) => {
|
|
2013
|
+
b(f.key) || Me(g, f.key, f.value);
|
|
2014
|
+
}), d([p(r, "_id")], { [i]: g }), s("UNSAVED");
|
|
1948
2015
|
},
|
|
1949
|
-
[
|
|
2016
|
+
[r, s, d, i]
|
|
1950
2017
|
);
|
|
1951
|
-
return /* @__PURE__ */ e.jsxs(
|
|
1952
|
-
/* @__PURE__ */ e.jsx(
|
|
2018
|
+
return /* @__PURE__ */ e.jsxs(ie, { value: t.heading, children: [
|
|
2019
|
+
/* @__PURE__ */ e.jsx(de, { className: "px-3 py-2 text-xs hover:no-underline", children: /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-x-2", children: [
|
|
1953
2020
|
/* @__PURE__ */ e.jsx(
|
|
1954
2021
|
"div",
|
|
1955
2022
|
{
|
|
1956
|
-
className: `h-[8px] w-[8px] rounded-full ${b(
|
|
2023
|
+
className: `h-[8px] w-[8px] rounded-full ${b(p(r, i)) ? "bg-gray-300" : "bg-blue-500"}`
|
|
1957
2024
|
}
|
|
1958
2025
|
),
|
|
1959
2026
|
"Attributes"
|
|
1960
2027
|
] }) }),
|
|
1961
|
-
/* @__PURE__ */ e.jsx(
|
|
1962
|
-
/* @__PURE__ */ e.jsxs(
|
|
2028
|
+
/* @__PURE__ */ e.jsx(ce, { className: "bg-gray-100 px-3.5 py-2", children: /* @__PURE__ */ e.jsxs("div", { className: "no-scrollbar flex min-h-max flex-col gap-y-2 overflow-y-auto bg-gray-100 p-px", children: [
|
|
2029
|
+
/* @__PURE__ */ e.jsxs(Se, { className: "mt-2 flex w-full items-center justify-between", children: [
|
|
1963
2030
|
"Add Custom attributes",
|
|
1964
2031
|
/* @__PURE__ */ e.jsxs(
|
|
1965
2032
|
"div",
|
|
1966
2033
|
{
|
|
1967
|
-
className: `flex h-6 w-max items-center justify-center gap-x-0.5 rounded-full border p-1 px-2 text-xs ${!b(
|
|
2034
|
+
className: `flex h-6 w-max items-center justify-center gap-x-0.5 rounded-full border p-1 px-2 text-xs ${!b(l) && b((m = ye(l)) == null ? void 0 : m.key) ? "cursor-not-allowed border-gray-400 text-gray-400" : "cursor-pointer border-blue-400 text-blue-400 hover:bg-blue-400 hover:text-white"}`,
|
|
1968
2035
|
onClick: () => {
|
|
1969
|
-
var
|
|
1970
|
-
!b(
|
|
2036
|
+
var h;
|
|
2037
|
+
!b(l) && b((h = ye(l)) == null ? void 0 : h.key) || n();
|
|
1971
2038
|
},
|
|
1972
2039
|
children: [
|
|
1973
|
-
/* @__PURE__ */ e.jsx(
|
|
2040
|
+
/* @__PURE__ */ e.jsx(Ce, { width: 12, height: 12 }),
|
|
1974
2041
|
" Add"
|
|
1975
2042
|
]
|
|
1976
2043
|
}
|
|
1977
2044
|
)
|
|
1978
2045
|
] }),
|
|
1979
2046
|
/* @__PURE__ */ e.jsxs("div", { className: "flex flex-col", children: [
|
|
1980
|
-
b(
|
|
1981
|
-
|
|
1982
|
-
|
|
1983
|
-
const f =
|
|
2047
|
+
b(l) && /* @__PURE__ */ e.jsx("div", { className: "flex h-12 items-center justify-center text-sm text-gray-400", children: "Click + Add to add attributes" }),
|
|
2048
|
+
ne.Children.toArray(
|
|
2049
|
+
C(l, (h, g) => {
|
|
2050
|
+
const f = l.length > 0 && g < l.length - 1;
|
|
1984
2051
|
return /* @__PURE__ */ e.jsx(
|
|
1985
|
-
|
|
2052
|
+
ds,
|
|
1986
2053
|
{
|
|
1987
|
-
item:
|
|
1988
|
-
index:
|
|
2054
|
+
item: h,
|
|
2055
|
+
index: g,
|
|
1989
2056
|
canDelete: f,
|
|
1990
|
-
onChange:
|
|
1991
|
-
onRemove: () =>
|
|
2057
|
+
onChange: x,
|
|
2058
|
+
onRemove: () => u(g)
|
|
1992
2059
|
}
|
|
1993
2060
|
);
|
|
1994
2061
|
})
|
|
@@ -1997,11 +2064,11 @@ const Nr = ({ property: r, onChange: o }) => {
|
|
|
1997
2064
|
] }) })
|
|
1998
2065
|
] });
|
|
1999
2066
|
};
|
|
2000
|
-
function
|
|
2001
|
-
const [
|
|
2067
|
+
function ps() {
|
|
2068
|
+
const [t, s] = Je(), { flexChild: r, gridChild: l } = Ut(), [, o] = Cr(Gt), { t: a } = Fe(), [d] = Ne();
|
|
2002
2069
|
return b(d) ? /* @__PURE__ */ e.jsx("div", { className: "p-4 text-center", children: /* @__PURE__ */ e.jsxs("div", { className: "space-y-4 rounded-xl p-4", children: [
|
|
2003
|
-
/* @__PURE__ */ e.jsx(
|
|
2004
|
-
/* @__PURE__ */ e.jsx("h1", { children:
|
|
2070
|
+
/* @__PURE__ */ e.jsx(Ze, { className: "mx-auto text-3xl" }),
|
|
2071
|
+
/* @__PURE__ */ e.jsx("h1", { children: a("no_styling_block_selected") }),
|
|
2005
2072
|
/* @__PURE__ */ e.jsxs("p", { className: "text-xs ", children: [
|
|
2006
2073
|
"Hint: Styling allowed blocks are highlighted with",
|
|
2007
2074
|
" ",
|
|
@@ -2010,40 +2077,40 @@ function Yr() {
|
|
|
2010
2077
|
] })
|
|
2011
2078
|
] }) }) : (
|
|
2012
2079
|
// eslint-disable-next-line jsx-a11y/click-events-have-key-events,jsx-a11y/no-static-element-interactions
|
|
2013
|
-
/* @__PURE__ */ e.jsxs("div", { onClick: () =>
|
|
2080
|
+
/* @__PURE__ */ e.jsxs("div", { onClick: () => o(!1), className: "flex h-full flex-col", children: [
|
|
2014
2081
|
/* @__PURE__ */ e.jsx("div", { className: "flex flex-col space-x-4 space-y-3 border-b border-border px-4 py-2", children: /* @__PURE__ */ e.jsxs("div", { className: "flex items-center justify-end gap-x-1.5", children: [
|
|
2015
|
-
/* @__PURE__ */ e.jsx(
|
|
2016
|
-
/* @__PURE__ */ e.jsxs(
|
|
2017
|
-
/* @__PURE__ */ e.jsx(
|
|
2018
|
-
/* @__PURE__ */ e.jsxs(
|
|
2019
|
-
/* @__PURE__ */ e.jsx(
|
|
2020
|
-
/* @__PURE__ */ e.jsx(
|
|
2021
|
-
/* @__PURE__ */ e.jsx(
|
|
2022
|
-
/* @__PURE__ */ e.jsx(
|
|
2023
|
-
/* @__PURE__ */ e.jsx(
|
|
2024
|
-
/* @__PURE__ */ e.jsx(
|
|
2025
|
-
/* @__PURE__ */ e.jsx(
|
|
2026
|
-
/* @__PURE__ */ e.jsx(
|
|
2027
|
-
/* @__PURE__ */ e.jsx(
|
|
2028
|
-
/* @__PURE__ */ e.jsx(
|
|
2029
|
-
/* @__PURE__ */ e.jsx(
|
|
2030
|
-
/* @__PURE__ */ e.jsx(
|
|
2082
|
+
/* @__PURE__ */ e.jsx(Se, { htmlFor: "", className: "flex gap-x-1.5 text-xs italic", children: "State" }),
|
|
2083
|
+
/* @__PURE__ */ e.jsxs(Hr, { defaultValue: t, onValueChange: (i) => s(i), children: [
|
|
2084
|
+
/* @__PURE__ */ e.jsx(Br, { className: "h-auto w-fit p-1 px-3", children: /* @__PURE__ */ e.jsx(Ar, { placeholder: "State" }) }),
|
|
2085
|
+
/* @__PURE__ */ e.jsxs(Dr, { children: [
|
|
2086
|
+
/* @__PURE__ */ e.jsx(H, { value: "", children: "Normal" }),
|
|
2087
|
+
/* @__PURE__ */ e.jsx(H, { value: "hover", children: "Hover" }),
|
|
2088
|
+
/* @__PURE__ */ e.jsx(H, { value: "active", children: "Active" }),
|
|
2089
|
+
/* @__PURE__ */ e.jsx(H, { value: "focus", children: "Focus" }),
|
|
2090
|
+
/* @__PURE__ */ e.jsx(H, { value: "before", children: "Before" }),
|
|
2091
|
+
/* @__PURE__ */ e.jsx(H, { value: "after", children: "After" }),
|
|
2092
|
+
/* @__PURE__ */ e.jsx(H, { value: "only", children: "Only" }),
|
|
2093
|
+
/* @__PURE__ */ e.jsx(H, { value: "first", children: "First" }),
|
|
2094
|
+
/* @__PURE__ */ e.jsx(H, { value: "last", children: "Last" }),
|
|
2095
|
+
/* @__PURE__ */ e.jsx(H, { value: "first-letter", children: "First Letter" }),
|
|
2096
|
+
/* @__PURE__ */ e.jsx(H, { value: "first-line", children: "First Line" }),
|
|
2097
|
+
/* @__PURE__ */ e.jsx(H, { value: "disabled", children: "Disabled" })
|
|
2031
2098
|
] })
|
|
2032
2099
|
] })
|
|
2033
2100
|
] }) }),
|
|
2034
|
-
/* @__PURE__ */ e.jsxs(
|
|
2101
|
+
/* @__PURE__ */ e.jsxs(Vr, { className: "no-scrollbar -mx-1 h-full overflow-x-hidden", children: [
|
|
2035
2102
|
/* @__PURE__ */ e.jsxs(tt, { type: "multiple", className: "h-full w-full", children: [
|
|
2036
|
-
|
|
2037
|
-
|
|
2038
|
-
|
|
2039
|
-
/* @__PURE__ */ e.jsx(
|
|
2103
|
+
r && /* @__PURE__ */ e.jsx(he, { section: Yr }),
|
|
2104
|
+
l ? /* @__PURE__ */ e.jsx(he, { section: Xr }) : null,
|
|
2105
|
+
Wr.map((i) => /* @__PURE__ */ e.jsx(he, { section: i }, i.heading)),
|
|
2106
|
+
/* @__PURE__ */ e.jsx(cs, { section: { heading: "Attributes" } })
|
|
2040
2107
|
] }),
|
|
2041
2108
|
/* @__PURE__ */ e.jsx("div", { className: "h-60" })
|
|
2042
2109
|
] })
|
|
2043
2110
|
] })
|
|
2044
2111
|
);
|
|
2045
2112
|
}
|
|
2046
|
-
const
|
|
2113
|
+
const us = {
|
|
2047
2114
|
px: 1,
|
|
2048
2115
|
"%": 1,
|
|
2049
2116
|
em: 100,
|
|
@@ -2054,8 +2121,8 @@ const Xr = {
|
|
|
2054
2121
|
"-": 1,
|
|
2055
2122
|
deg: 1,
|
|
2056
2123
|
ms: 0.1
|
|
2057
|
-
},
|
|
2058
|
-
const
|
|
2124
|
+
}, hl = () => {
|
|
2125
|
+
const t = G(), { t: s } = Fe(), [r, l] = $.useState(""), [o, a] = $.useState({
|
|
2059
2126
|
onDrag: (n) => n,
|
|
2060
2127
|
onDragEnd: (n) => n,
|
|
2061
2128
|
dragStartY: 0,
|
|
@@ -2064,20 +2131,20 @@ const Xr = {
|
|
|
2064
2131
|
dragUnit: "",
|
|
2065
2132
|
negative: !1,
|
|
2066
2133
|
cssProperty: ""
|
|
2067
|
-
}), d =
|
|
2134
|
+
}), d = me(
|
|
2068
2135
|
(n) => {
|
|
2069
|
-
const
|
|
2070
|
-
let
|
|
2071
|
-
|
|
2072
|
-
let
|
|
2073
|
-
(
|
|
2074
|
-
let
|
|
2075
|
-
|
|
2136
|
+
const u = !p(o, "negative", !1), x = p(o, "cssProperty", "");
|
|
2137
|
+
let c = parseFloat(o.dragStartValue);
|
|
2138
|
+
c = _e(c) ? 0 : c;
|
|
2139
|
+
let m = us[o.dragUnit];
|
|
2140
|
+
(z(x, "scale") || x === "opacity") && (m = 10);
|
|
2141
|
+
let g = (o.dragStartY - n.pageY) / m + c;
|
|
2142
|
+
u && g < 0 && (g = 0), x === "opacity" && g > 1 && (g = 1), o.onDrag(`${g}`), l(`${g}`);
|
|
2076
2143
|
},
|
|
2077
|
-
[
|
|
2144
|
+
[o],
|
|
2078
2145
|
50
|
|
2079
|
-
), i =
|
|
2080
|
-
setTimeout(() =>
|
|
2146
|
+
), i = A(() => {
|
|
2147
|
+
setTimeout(() => o.onDragEnd(`${r}`), 100), a({
|
|
2081
2148
|
onDrag: (n) => n,
|
|
2082
2149
|
onDragEnd: (n) => n,
|
|
2083
2150
|
dragStartY: 0,
|
|
@@ -2087,12 +2154,12 @@ const Xr = {
|
|
|
2087
2154
|
negative: !1,
|
|
2088
2155
|
cssProperty: ""
|
|
2089
2156
|
});
|
|
2090
|
-
}, [
|
|
2091
|
-
return
|
|
2092
|
-
/* @__PURE__ */ e.jsx(
|
|
2093
|
-
/* @__PURE__ */ e.jsx("h1", { children:
|
|
2094
|
-
] }) }) : /* @__PURE__ */ e.jsxs(ot.Provider, { value: { setDragData:
|
|
2095
|
-
|
|
2157
|
+
}, [o, r, a]);
|
|
2158
|
+
return vt(t) ? /* @__PURE__ */ e.jsx("div", { className: "p-4 text-center", children: /* @__PURE__ */ e.jsxs("div", { className: "space-y-4 rounded-xl p-4", children: [
|
|
2159
|
+
/* @__PURE__ */ e.jsx(Ze, { className: "mx-auto text-3xl" }),
|
|
2160
|
+
/* @__PURE__ */ e.jsx("h1", { children: s("no_block_selected_for_styling") })
|
|
2161
|
+
] }) }) : /* @__PURE__ */ e.jsxs(ot.Provider, { value: { setDragData: a }, children: [
|
|
2162
|
+
o.dragging ? /* @__PURE__ */ e.jsx(
|
|
2096
2163
|
"div",
|
|
2097
2164
|
{
|
|
2098
2165
|
onMouseMove: d,
|
|
@@ -2100,23 +2167,23 @@ const Xr = {
|
|
|
2100
2167
|
className: "absolute inset-0 z-30 cursor-row-resize bg-gray-300/10 "
|
|
2101
2168
|
}
|
|
2102
2169
|
) : null,
|
|
2103
|
-
/* @__PURE__ */ e.jsxs(
|
|
2104
|
-
/* @__PURE__ */ e.jsxs(
|
|
2105
|
-
/* @__PURE__ */ e.jsx(
|
|
2106
|
-
/* @__PURE__ */ e.jsx(
|
|
2170
|
+
/* @__PURE__ */ e.jsxs(Ot, { defaultValue: "settings", className: "flex h-full w-full flex-col py-1", children: [
|
|
2171
|
+
/* @__PURE__ */ e.jsxs(Mt, { className: "mx-1 grid grid-cols-2", children: [
|
|
2172
|
+
/* @__PURE__ */ e.jsx(He, { value: "settings", children: "Settings" }),
|
|
2173
|
+
/* @__PURE__ */ e.jsx(He, { value: "styling", children: "Styling" })
|
|
2107
2174
|
] }),
|
|
2108
2175
|
/* @__PURE__ */ e.jsx(
|
|
2109
|
-
|
|
2176
|
+
Be,
|
|
2110
2177
|
{
|
|
2111
2178
|
value: "settings",
|
|
2112
2179
|
className: "no-scrollbar -mx-1 -mr-2 h-full flex-1 overflow-y-auto overflow-x-hidden",
|
|
2113
|
-
children: /* @__PURE__ */ e.jsx(
|
|
2180
|
+
children: /* @__PURE__ */ e.jsx(Er, {})
|
|
2114
2181
|
}
|
|
2115
2182
|
),
|
|
2116
|
-
/* @__PURE__ */ e.jsx(
|
|
2183
|
+
/* @__PURE__ */ e.jsx(Be, { value: "styling", className: "flex-1 overflow-y-auto overflow-x-hidden", children: /* @__PURE__ */ e.jsx(ps, {}) })
|
|
2117
2184
|
] })
|
|
2118
2185
|
] });
|
|
2119
2186
|
};
|
|
2120
2187
|
export {
|
|
2121
|
-
|
|
2188
|
+
hl as default
|
|
2122
2189
|
};
|