@chaibuilder/sdk 0.1.21 → 0.1.23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{AddBlocks-b2d43d6c.js → AddBlocks-189ba69a.js} +1 -1
- package/dist/{AddBlocks-b510ac3a.cjs → AddBlocks-36adcc50.cjs} +1 -1
- package/dist/{BrandingOptions-7f66e02c.js → BrandingOptions-c01e08fc.js} +1 -1
- package/dist/{BrandingOptions-6fbe4b26.cjs → BrandingOptions-e659a7bf.cjs} +1 -1
- package/dist/{CanvasArea-68841a13.js → CanvasArea-9106ecb5.js} +2 -2
- package/dist/{CanvasArea-a8d28eb3.cjs → CanvasArea-933848fb.cjs} +2 -2
- package/dist/{CurrentPage-6655ce50.js → CurrentPage-37d2f495.js} +1 -1
- package/dist/{CurrentPage-c10e6c89.cjs → CurrentPage-92d8bfe0.cjs} +1 -1
- package/dist/{Layers-595cc98e.cjs → Layers-94aeb9f0.cjs} +1 -1
- package/dist/{Layers-99bdc689.js → Layers-c08aa961.js} +2 -2
- package/dist/{MarkAsGlobalBlock-ea769ea4.cjs → MarkAsGlobalBlock-07cb6760.cjs} +1 -1
- package/dist/{MarkAsGlobalBlock-522e170a.js → MarkAsGlobalBlock-10422d13.js} +1 -1
- package/dist/{PagesPanel-b0debeed.js → PagesPanel-be499af0.js} +2 -2
- package/dist/{PagesPanel-e176d7e8.cjs → PagesPanel-e4807890.cjs} +1 -1
- package/dist/{ProjectPanel-d0f33df2.cjs → ProjectPanel-0478c85b.cjs} +1 -1
- package/dist/{ProjectPanel-9cec967c.js → ProjectPanel-fd948934.js} +2 -2
- package/dist/Settings-6cb217af.cjs +1 -0
- package/dist/{Settings-fd1e3b5d.js → Settings-94b79852.js} +490 -486
- package/dist/SidePanels-4434d31b.cjs +1 -0
- package/dist/{SidePanels-ca294b35.js → SidePanels-78d8de19.js} +68 -64
- package/dist/{Topbar-1edef1b2.js → Topbar-0542b5f4.js} +1 -1
- package/dist/{Topbar-75c99c88.cjs → Topbar-d6382110.cjs} +1 -1
- package/dist/{add-page-modal-9985b5ce.js → add-page-modal-36a6b406.js} +1 -1
- package/dist/{add-page-modal-18f134c0.cjs → add-page-modal-6132fdff.cjs} +1 -1
- package/dist/core.cjs +1 -1
- package/dist/core.d.ts +4 -1
- package/dist/core.js +1 -1
- package/dist/{delete-page-modal-98272bf5.js → delete-page-modal-68a4d71e.js} +1 -1
- package/dist/{delete-page-modal-393697d7.cjs → delete-page-modal-87c48560.cjs} +1 -1
- package/dist/{index-c3a98a78.cjs → index-6f5cce76.cjs} +2 -2
- package/dist/{index-436bba3e.js → index-c49887fe.js} +4 -4
- package/dist/{page-viewer-32261f49.cjs → page-viewer-47098c44.cjs} +1 -1
- package/dist/{page-viewer-a3ac057a.js → page-viewer-d87e5621.js} +2 -2
- package/dist/{project-general-setting-75a8e94b.cjs → project-general-setting-869887d5.cjs} +1 -1
- package/dist/{project-general-setting-21e324a9.js → project-general-setting-91df16a9.js} +1 -1
- package/dist/{single-page-detail-649b1379.cjs → single-page-detail-1b276c4f.cjs} +1 -1
- package/dist/{single-page-detail-0e881b82.js → single-page-detail-4a424725.js} +2 -2
- package/package.json +1 -1
- package/dist/Settings-208ab051.cjs +0 -1
- package/dist/SidePanels-40966390.cjs +0 -1
|
@@ -2,28 +2,28 @@ import { j as e } from "./jsx-runtime-944c88e2.js";
|
|
|
2
2
|
import * as se from "react";
|
|
3
3
|
import $, { useState as k, useEffect as M, useMemo as T, useCallback as I, createContext as Le, useContext as ee } from "react";
|
|
4
4
|
import { useThrottledCallback as xe } from "@react-hookz/web";
|
|
5
|
-
import { map as C, isEmpty as
|
|
5
|
+
import { map as C, isEmpty as f, last as he, forEach as be, set as Pe, startCase as Q, filter as Oe, get as u, isArray as me, omit as at, includes as O, toLower as ne, first as fe, split as Ne, truncate as it, keys as dt, cloneDeep as ct, each as pt, capitalize as ut, reject as gt, nth as Se, startsWith as Z, isNumber as xt, parseInt as ht, isNaN as Me, findLast as mt, has as ue, flatten as z, intersection as _e, isNull as yt } from "lodash";
|
|
6
6
|
import { useTranslation as Ee } from "react-i18next";
|
|
7
|
-
import { PlusIcon as ve, Cross2Icon as Fe, EyeOpenIcon as
|
|
7
|
+
import { PlusIcon as ve, Cross2Icon as Fe, EyeOpenIcon as bt, EyeClosedIcon as Te, BorderAllIcon as _, WidthIcon as V, HeightIcon as H, ArrowUpIcon as G, ArrowRightIcon as K, ArrowDownIcon as q, ArrowLeftIcon as J, ArrowTopLeftIcon as ft, ArrowTopRightIcon as vt, ArrowBottomRightIcon as wt, ArrowBottomLeftIcon as jt, AlignLeftIcon as Ct, AlignCenterHorizontallyIcon as kt, AlignRightIcon as Nt, StretchHorizontallyIcon as St, FontItalicIcon as Tt, UnderlineIcon as Rt, OverlineIcon as Vt, LetterCaseUppercaseIcon as Ht, Cross1Icon as Bt, InfoCircledIcon as we, MinusIcon as At, BoxIcon as Ye, TriangleDownIcon as Dt, RowSpacingIcon as $t, TrashIcon as Xe, MixerHorizontalIcon as We } from "@radix-ui/react-icons";
|
|
8
8
|
import { T as It, a as Lt, b as Re, c as Ve } from "./tabs-85caa1e8.js";
|
|
9
9
|
import Pt from "@rjsf/core";
|
|
10
10
|
import Ot from "@rjsf/validator-ajv8";
|
|
11
|
-
import { D as te, d as Ze, G as ze, H as Mt, I as _t, J as Et, j as je, K as Ue, L as Ge, i as Ke, e as Ft, M as qe, f as He, N as ce, c as
|
|
12
|
-
import { getBlockComponent as Je, SingleLineText as
|
|
13
|
-
import { TrashIcon as
|
|
11
|
+
import { D as te, d as Ze, G as ze, H as Mt, I as _t, J as Et, j as je, K as Ue, L as Ge, i as Ke, e as Ft, M as qe, f as He, N as ce, c as Yt, O as Xt, P as Wt } from "./index-c49887fe.js";
|
|
12
|
+
import { getChaiDataProviders as Zt, getBlockComponent as Je, SingleLineText as zt } from "@chaibuilder/blocks";
|
|
13
|
+
import { TrashIcon as Ut, ChevronRight as Gt } from "lucide-react";
|
|
14
14
|
import Qe from "react-autosuggest";
|
|
15
|
-
import { u as
|
|
16
|
-
import { d as
|
|
15
|
+
import { u as Kt } from "./useChaiExternalData-192c7896.js";
|
|
16
|
+
import { d as Y, e as X, f as W, B as et, g as qt } from "./useBuilderProp-81a14920.js";
|
|
17
17
|
import { A as tt, a as ae, b as ie, c as de } from "./accordion-c0176dc5.js";
|
|
18
|
-
import { R as
|
|
19
|
-
import { useAtom as
|
|
20
|
-
import
|
|
21
|
-
import { A as
|
|
18
|
+
import { R as Jt, I as Qt, a as er, L as tr } from "./link-2af5de8b.js";
|
|
19
|
+
import { useAtom as rr } from "jotai";
|
|
20
|
+
import lr from "fuse.js";
|
|
21
|
+
import { A as or, C as pe, d as sr } from "./html-to-json-45e0e3b5.js";
|
|
22
22
|
import { L as Ce } from "./label-e770a087.js";
|
|
23
|
-
import { S as
|
|
24
|
-
import { I as
|
|
25
|
-
import { S as
|
|
26
|
-
import { S as
|
|
23
|
+
import { S as nr } from "./MODIFIERS-2f19c314.js";
|
|
24
|
+
import { I as ar } from "./input-a0ea2bc7.js";
|
|
25
|
+
import { S as ir } from "./scroll-area-83bd9e8f.js";
|
|
26
|
+
import { S as dr, c as cr, b as pr, d as ur, f as A } from "./select-7fddd7c3.js";
|
|
27
27
|
import "@radix-ui/react-tabs";
|
|
28
28
|
import "./utils-ac68b2c8.js";
|
|
29
29
|
import "clsx";
|
|
@@ -52,17 +52,17 @@ import "react-quill";
|
|
|
52
52
|
import "himalaya";
|
|
53
53
|
import "@radix-ui/react-label";
|
|
54
54
|
import "@radix-ui/react-select";
|
|
55
|
-
function
|
|
55
|
+
function gr(r) {
|
|
56
56
|
const s = [], t = {};
|
|
57
|
-
function
|
|
58
|
-
|
|
59
|
-
const
|
|
60
|
-
s.push(
|
|
57
|
+
function a(o, n) {
|
|
58
|
+
be(n, (d, i) => {
|
|
59
|
+
const l = o ? `${o}.${i}` : i, c = me(d) ? "list" : typeof d;
|
|
60
|
+
s.push(l), t[l] = c === "string" ? "text" : c === "object" ? "model" : c, c === "object" && !me(d) && a(l, d);
|
|
61
61
|
});
|
|
62
62
|
}
|
|
63
|
-
return
|
|
63
|
+
return a("", at(r, ["styles", "_type", "_id", "_name", "_bindings"])), { paths: s, pathsType: t };
|
|
64
64
|
}
|
|
65
|
-
const
|
|
65
|
+
const xr = ({ data: r }) => {
|
|
66
66
|
if (!r)
|
|
67
67
|
return null;
|
|
68
68
|
const s = typeof r;
|
|
@@ -71,68 +71,68 @@ const gr = ({ data: r }) => {
|
|
|
71
71
|
type: r,
|
|
72
72
|
isDisabled: s = !1,
|
|
73
73
|
placeholder: t,
|
|
74
|
-
defaultValue:
|
|
75
|
-
data:
|
|
76
|
-
onChange:
|
|
74
|
+
defaultValue: a = "",
|
|
75
|
+
data: o,
|
|
76
|
+
onChange: n,
|
|
77
77
|
dataType: d,
|
|
78
78
|
appliedBindings: i
|
|
79
79
|
}) => {
|
|
80
|
-
const [
|
|
80
|
+
const [l, c] = k(a), { paths: p, pathsType: h } = gr(o), g = r === "PROP" ? Je(o == null ? void 0 : o._type) : {};
|
|
81
81
|
M(() => {
|
|
82
|
-
|
|
83
|
-
}, [
|
|
84
|
-
const
|
|
85
|
-
const j =
|
|
86
|
-
return r === "PATH" ? j && d ===
|
|
87
|
-
}), [
|
|
88
|
-
M(() => v(() =>
|
|
82
|
+
f(l) && n("");
|
|
83
|
+
}, [l]), M(() => c(a), [a]);
|
|
84
|
+
const y = () => p.filter((b) => {
|
|
85
|
+
const j = f(l) || O(ne(b), ne(l));
|
|
86
|
+
return r === "PATH" ? j && d === u(h, b, "") : j && !O(i, b) && u(g, `props.${fe(Ne(b, "."))}.binding`);
|
|
87
|
+
}), [x, v] = k(() => y());
|
|
88
|
+
M(() => v(() => y()), [d]);
|
|
89
89
|
const L = {
|
|
90
90
|
autoComplete: "off",
|
|
91
91
|
autoCorrect: "on",
|
|
92
92
|
autoCapitalize: "off",
|
|
93
93
|
spellCheck: !1,
|
|
94
94
|
placeholder: t,
|
|
95
|
-
value:
|
|
95
|
+
value: l,
|
|
96
96
|
disabled: s,
|
|
97
97
|
onBlur: () => {
|
|
98
|
-
|
|
98
|
+
p.includes(l) ? n(l) : (c(""), n(""));
|
|
99
99
|
},
|
|
100
|
-
onChange: (
|
|
100
|
+
onChange: (b, { newValue: j }) => c(j),
|
|
101
101
|
className: `chai-input w-full ${s ? "cursor-not-allowed" : ""}`
|
|
102
|
-
}, R = (
|
|
102
|
+
}, R = (b) => /* @__PURE__ */ e.jsxs(
|
|
103
103
|
"div",
|
|
104
104
|
{
|
|
105
105
|
className: "rounded-md px-1 py-1.5 flex items-center justify-between space-x-2 font-light relative",
|
|
106
|
-
"data-suggest":
|
|
106
|
+
"data-suggest": b,
|
|
107
107
|
children: [
|
|
108
|
-
/* @__PURE__ */ e.jsx("div", { className: "-mt-1 w-full h-full absolute opacity-0 z-20", children:
|
|
108
|
+
/* @__PURE__ */ e.jsx("div", { className: "-mt-1 w-full h-full absolute opacity-0 z-20", children: b }),
|
|
109
109
|
/* @__PURE__ */ e.jsxs("div", { className: "w-full", children: [
|
|
110
110
|
/* @__PURE__ */ e.jsx("div", { className: "leading-4 text-xs flex items-center text-gray-800", children: $.Children.toArray(
|
|
111
|
-
C(Ne(
|
|
112
|
-
B > 0 && /* @__PURE__ */ e.jsx(
|
|
111
|
+
C(Ne(b, "."), (j, B) => /* @__PURE__ */ e.jsxs("span", { className: "flex items-end", children: [
|
|
112
|
+
B > 0 && /* @__PURE__ */ e.jsx(Gt, { size: 14, className: "h-full text-gray-400" }),
|
|
113
113
|
Q(j)
|
|
114
114
|
] }))
|
|
115
115
|
) }),
|
|
116
|
-
r === "PATH" && /* @__PURE__ */ e.jsx(
|
|
116
|
+
r === "PATH" && /* @__PURE__ */ e.jsx(xr, { data: u(o, b) })
|
|
117
117
|
] }),
|
|
118
|
-
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(
|
|
118
|
+
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(h, b, "")) })
|
|
119
119
|
]
|
|
120
120
|
}
|
|
121
121
|
);
|
|
122
122
|
return /* @__PURE__ */ e.jsx(
|
|
123
123
|
Qe,
|
|
124
124
|
{
|
|
125
|
-
suggestions:
|
|
126
|
-
onSuggestionsFetchRequested: () => v(() =>
|
|
125
|
+
suggestions: x,
|
|
126
|
+
onSuggestionsFetchRequested: () => v(() => y()),
|
|
127
127
|
onSuggestionsClearRequested: () => v([]),
|
|
128
|
-
onSuggestionSelected: (
|
|
129
|
-
if (
|
|
130
|
-
const j =
|
|
131
|
-
|
|
128
|
+
onSuggestionSelected: (b) => {
|
|
129
|
+
if (b.type === "click") {
|
|
130
|
+
const j = u(b.target, "childNodes[0].data", "");
|
|
131
|
+
p.includes(j) && n(j);
|
|
132
132
|
} else
|
|
133
|
-
|
|
133
|
+
n(b.target.value);
|
|
134
134
|
},
|
|
135
|
-
getSuggestionValue: (
|
|
135
|
+
getSuggestionValue: (b) => b,
|
|
136
136
|
renderSuggestion: R,
|
|
137
137
|
shouldRenderSuggestions: () => !0,
|
|
138
138
|
inputProps: L,
|
|
@@ -144,27 +144,27 @@ const gr = ({ data: r }) => {
|
|
|
144
144
|
}
|
|
145
145
|
}
|
|
146
146
|
);
|
|
147
|
-
},
|
|
147
|
+
}, hr = ({
|
|
148
148
|
item: r,
|
|
149
149
|
onChange: s,
|
|
150
150
|
onRemove: t,
|
|
151
|
-
selectedBlock:
|
|
152
|
-
dataProvider:
|
|
153
|
-
appliedBindings:
|
|
151
|
+
selectedBlock: a,
|
|
152
|
+
dataProvider: o,
|
|
153
|
+
appliedBindings: n
|
|
154
154
|
}) => {
|
|
155
|
-
const [d, i] = k("string"),
|
|
156
|
-
if (
|
|
155
|
+
const [d, i] = k("string"), l = (c, p) => {
|
|
156
|
+
if (f(c))
|
|
157
157
|
return "";
|
|
158
158
|
{
|
|
159
|
-
const
|
|
160
|
-
if (
|
|
159
|
+
const h = u(p === "PROP" ? a : o, c, "");
|
|
160
|
+
if (me(h))
|
|
161
161
|
return "list";
|
|
162
|
-
const
|
|
163
|
-
return
|
|
162
|
+
const g = typeof h;
|
|
163
|
+
return g === "string" ? "text" : g === "object" ? "model" : g;
|
|
164
164
|
}
|
|
165
165
|
};
|
|
166
|
-
return M(() => i(() =>
|
|
167
|
-
!
|
|
166
|
+
return M(() => i(() => l(r.key, "PROP")), [r.key]), /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col gap-1 border border-gray-200 relative rounded-md p-2", children: [
|
|
167
|
+
!f(d) && !f(r.key) && /* @__PURE__ */ e.jsx("div", { className: "mt-px absolute right-2 top-4 text-purple-600 text-[10px] flex items-center font-medium h-4 px-2 rounded-full", children: Q(d) }),
|
|
168
168
|
/* @__PURE__ */ e.jsx(
|
|
169
169
|
Be,
|
|
170
170
|
{
|
|
@@ -172,13 +172,13 @@ const gr = ({ data: r }) => {
|
|
|
172
172
|
isDisabled: !1,
|
|
173
173
|
placeholder: "Enter prop key",
|
|
174
174
|
defaultValue: r.key,
|
|
175
|
-
onChange: (
|
|
176
|
-
const
|
|
177
|
-
s({ target: { name: "key", value:
|
|
175
|
+
onChange: (c) => {
|
|
176
|
+
const p = l(c, "PROP");
|
|
177
|
+
s({ target: { name: "key", value: c } }), d !== p && s({ target: { name: "value", value: "" } }), i(p);
|
|
178
178
|
},
|
|
179
|
-
data:
|
|
179
|
+
data: a,
|
|
180
180
|
dataType: d,
|
|
181
|
-
appliedBindings:
|
|
181
|
+
appliedBindings: n
|
|
182
182
|
}
|
|
183
183
|
),
|
|
184
184
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-start justify-between gap-x-1.5 w-full relative", children: [
|
|
@@ -186,20 +186,20 @@ const gr = ({ data: r }) => {
|
|
|
186
186
|
Be,
|
|
187
187
|
{
|
|
188
188
|
type: "PATH",
|
|
189
|
-
isDisabled:
|
|
189
|
+
isDisabled: f(r.key),
|
|
190
190
|
placeholder: "Enter data path",
|
|
191
191
|
defaultValue: r.value,
|
|
192
|
-
onChange: (
|
|
193
|
-
const
|
|
194
|
-
s(d !==
|
|
192
|
+
onChange: (c) => {
|
|
193
|
+
const p = l(c, "PATH");
|
|
194
|
+
s(d !== p ? { target: { name: "value", value: "" } } : { target: { name: "value", value: c } });
|
|
195
195
|
},
|
|
196
|
-
data:
|
|
196
|
+
data: o,
|
|
197
197
|
dataType: d,
|
|
198
|
-
appliedBindings:
|
|
198
|
+
appliedBindings: n
|
|
199
199
|
}
|
|
200
200
|
),
|
|
201
201
|
/* @__PURE__ */ e.jsx(
|
|
202
|
-
|
|
202
|
+
Ut,
|
|
203
203
|
{
|
|
204
204
|
onClick: t,
|
|
205
205
|
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,87 +207,91 @@ const gr = ({ data: r }) => {
|
|
|
207
207
|
)
|
|
208
208
|
] })
|
|
209
209
|
] });
|
|
210
|
-
},
|
|
211
|
-
const t = te(), [
|
|
210
|
+
}, mr = ({ bindingData: r, onChange: s }) => {
|
|
211
|
+
const t = te(), [a] = Kt(), o = Zt(), [n, d] = k(C(r, (g, y) => ({ key: y, value: g })));
|
|
212
212
|
M(() => {
|
|
213
|
-
|
|
213
|
+
d(C(r, (g, y) => ({ key: y, value: g })));
|
|
214
214
|
}, [t == null ? void 0 : t._id]);
|
|
215
|
-
const
|
|
216
|
-
if (
|
|
215
|
+
const i = T(() => {
|
|
216
|
+
if (f(n))
|
|
217
217
|
return !1;
|
|
218
|
-
const
|
|
219
|
-
return
|
|
220
|
-
}, [
|
|
221
|
-
|
|
222
|
-
},
|
|
223
|
-
const y = Oe(
|
|
224
|
-
|
|
225
|
-
}, p = (
|
|
226
|
-
const x = [...
|
|
227
|
-
x[y][
|
|
228
|
-
},
|
|
229
|
-
(
|
|
230
|
-
if (
|
|
218
|
+
const g = he(n);
|
|
219
|
+
return f(g == null ? void 0 : g.key) || f(g == null ? void 0 : g.value);
|
|
220
|
+
}, [n]), l = () => {
|
|
221
|
+
d([...n, { key: "", value: "" }]);
|
|
222
|
+
}, c = (g) => {
|
|
223
|
+
const y = Oe(n, (x, v) => g !== v);
|
|
224
|
+
h([...y]);
|
|
225
|
+
}, p = (g, y) => {
|
|
226
|
+
const x = [...n];
|
|
227
|
+
x[y][g.target.name] = g.target.value, h(x);
|
|
228
|
+
}, h = I(
|
|
229
|
+
(g = []) => {
|
|
230
|
+
if (d(g), f(g)) {
|
|
231
231
|
s({});
|
|
232
232
|
return;
|
|
233
233
|
}
|
|
234
234
|
const y = {};
|
|
235
|
-
|
|
236
|
-
!
|
|
235
|
+
be(g, (x) => {
|
|
236
|
+
!f(x == null ? void 0 : x.key) && !f(x == null ? void 0 : x.value) && Pe(y, x.key, x.value);
|
|
237
237
|
}), s(y);
|
|
238
238
|
},
|
|
239
239
|
[t]
|
|
240
240
|
);
|
|
241
|
-
return
|
|
242
|
-
|
|
243
|
-
|
|
241
|
+
return f(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: [
|
|
242
|
+
"You have no data providers registered. Please add a data provider to your project. ",
|
|
243
|
+
/* @__PURE__ */ e.jsx("br", {}),
|
|
244
|
+
/* @__PURE__ */ e.jsx("a", { className: "text-blue-500", href: "https://chaibuilder.com/docs/registering-data-providers", target: "_blank", children: "Learn more" })
|
|
245
|
+
] }) }) : /* @__PURE__ */ e.jsxs("div", { className: "space-y-2", children: [
|
|
246
|
+
C(n, (g, y) => /* @__PURE__ */ e.jsx(
|
|
247
|
+
hr,
|
|
244
248
|
{
|
|
245
|
-
item:
|
|
249
|
+
item: g,
|
|
246
250
|
onChange: (x) => p(x, y),
|
|
247
|
-
onRemove: () =>
|
|
251
|
+
onRemove: () => c(y),
|
|
248
252
|
selectedBlock: t,
|
|
249
|
-
dataProvider:
|
|
250
|
-
appliedBindings: C(
|
|
253
|
+
dataProvider: a,
|
|
254
|
+
appliedBindings: C(n, "key")
|
|
251
255
|
},
|
|
252
|
-
|
|
256
|
+
g.key
|
|
253
257
|
)),
|
|
254
|
-
/* @__PURE__ */ e.jsxs(
|
|
255
|
-
/* @__PURE__ */ e.jsx(
|
|
258
|
+
/* @__PURE__ */ e.jsxs(Y, { delayDuration: 200, children: [
|
|
259
|
+
/* @__PURE__ */ e.jsx(X, { className: "w-full", children: /* @__PURE__ */ e.jsx(
|
|
256
260
|
"button",
|
|
257
261
|
{
|
|
258
|
-
onClick:
|
|
259
|
-
disabled:
|
|
260
|
-
className: `w-full px-5 py-1.5 text-xs rounded-md font-medium duration-200 ${
|
|
262
|
+
onClick: l,
|
|
263
|
+
disabled: i,
|
|
264
|
+
className: `w-full px-5 py-1.5 text-xs rounded-md font-medium duration-200 ${f(n) ? "bg-blue-700/20 text-blue-800 hover:bg-blue-700/30 " : ""} ${i ? "cursor-not-allowed bg-gray-200 text-gray-400" : f(n) ? "" : "bg-gray-700/20 text-gray-800 hover:bg-blue-700/30"}`,
|
|
261
265
|
children: "+ Add Data Binding"
|
|
262
266
|
}
|
|
263
267
|
) }),
|
|
264
|
-
|
|
268
|
+
i && /* @__PURE__ */ e.jsx(W, { sideOffset: 10, className: "text-[11px]", children: "Complete last added data binding to add more" })
|
|
265
269
|
] })
|
|
266
270
|
] });
|
|
267
|
-
}, yr =
|
|
271
|
+
}, yr = mr, br = () => /* @__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" }), Ae = ({
|
|
268
272
|
createHistorySnapshot: r,
|
|
269
273
|
properties: s,
|
|
270
274
|
formData: t,
|
|
271
|
-
onChange:
|
|
275
|
+
onChange: a
|
|
272
276
|
}) => {
|
|
273
|
-
const [
|
|
277
|
+
const [o] = Mt(), n = { type: "object", properties: {} }, d = {};
|
|
274
278
|
return Object.keys(s).forEach((i) => {
|
|
275
|
-
const
|
|
276
|
-
if (O(["slot", "styles"],
|
|
279
|
+
const l = s[i];
|
|
280
|
+
if (O(["slot", "styles"], l.type))
|
|
277
281
|
return;
|
|
278
|
-
const
|
|
279
|
-
|
|
282
|
+
const c = u(l, "i18n", !1) ? `${i}-${o}` : i;
|
|
283
|
+
n.properties[c] = _t(l, o), d[c] = Et(l, o);
|
|
280
284
|
}), /* @__PURE__ */ e.jsx(
|
|
281
285
|
Pt,
|
|
282
286
|
{
|
|
283
287
|
widgets: {
|
|
284
|
-
binding:
|
|
285
|
-
richtext:
|
|
286
|
-
icon:
|
|
287
|
-
image:
|
|
288
|
+
binding: br,
|
|
289
|
+
richtext: Jt,
|
|
290
|
+
icon: Qt,
|
|
291
|
+
image: er
|
|
288
292
|
},
|
|
289
293
|
fields: {
|
|
290
|
-
link:
|
|
294
|
+
link: tr
|
|
291
295
|
},
|
|
292
296
|
idSeparator: ".",
|
|
293
297
|
autoComplete: "off",
|
|
@@ -297,36 +301,36 @@ const gr = ({ data: r }) => {
|
|
|
297
301
|
validator: Ot,
|
|
298
302
|
uiSchema: d,
|
|
299
303
|
onBlur: r,
|
|
300
|
-
schema:
|
|
304
|
+
schema: n,
|
|
301
305
|
formData: t,
|
|
302
|
-
onChange:
|
|
306
|
+
onChange: a
|
|
303
307
|
}
|
|
304
308
|
);
|
|
305
309
|
};
|
|
306
310
|
function fr() {
|
|
307
|
-
const r = te(), { createSnapshot: s } = Ze(), t = ze(),
|
|
308
|
-
if (
|
|
309
|
-
const
|
|
310
|
-
t([r._id], { [
|
|
311
|
+
const r = te(), { createSnapshot: s } = Ze(), t = ze(), a = Je(r._type), o = { ...r }, n = () => s(), d = ({ formData: p }, h) => {
|
|
312
|
+
if (h) {
|
|
313
|
+
const g = h.replace("root.", "");
|
|
314
|
+
t([r._id], { [g]: u(p, g) });
|
|
311
315
|
}
|
|
312
316
|
}, i = {
|
|
313
|
-
_name:
|
|
317
|
+
_name: zt({
|
|
314
318
|
title: "Name",
|
|
315
|
-
default:
|
|
319
|
+
default: u(r, "_name", r._type)
|
|
316
320
|
})
|
|
317
|
-
},
|
|
318
|
-
const
|
|
319
|
-
return pt(
|
|
320
|
-
delete
|
|
321
|
-
}),
|
|
322
|
-
}, [
|
|
321
|
+
}, l = dt(u(o, "_bindings", {})), c = T(() => {
|
|
322
|
+
const p = ct(u(a, "props", {}));
|
|
323
|
+
return pt(l, (h) => {
|
|
324
|
+
delete p[h];
|
|
325
|
+
}), p;
|
|
326
|
+
}, [a, l]);
|
|
323
327
|
return /* @__PURE__ */ e.jsxs("div", { className: "overflow-x-hidden", children: [
|
|
324
328
|
/* @__PURE__ */ e.jsx(
|
|
325
329
|
Ae,
|
|
326
330
|
{
|
|
327
331
|
onChange: d,
|
|
328
|
-
createHistorySnapshot:
|
|
329
|
-
formData:
|
|
332
|
+
createHistorySnapshot: n,
|
|
333
|
+
formData: o,
|
|
330
334
|
properties: i
|
|
331
335
|
}
|
|
332
336
|
),
|
|
@@ -337,7 +341,7 @@ function fr() {
|
|
|
337
341
|
/* @__PURE__ */ e.jsx(
|
|
338
342
|
"div",
|
|
339
343
|
{
|
|
340
|
-
className: `h-[8px] w-[8px] rounded-full ${
|
|
344
|
+
className: `h-[8px] w-[8px] rounded-full ${f(u(r, "_bindings", {})) ? "bg-gray-300" : "bg-blue-500"}`
|
|
341
345
|
}
|
|
342
346
|
),
|
|
343
347
|
"Data Binding"
|
|
@@ -345,9 +349,9 @@ function fr() {
|
|
|
345
349
|
/* @__PURE__ */ e.jsx(de, { className: "pt-4 px-4", children: /* @__PURE__ */ e.jsx(
|
|
346
350
|
yr,
|
|
347
351
|
{
|
|
348
|
-
bindingData:
|
|
349
|
-
onChange: (
|
|
350
|
-
d({ formData: { ...
|
|
352
|
+
bindingData: u(o, "_bindings", {}),
|
|
353
|
+
onChange: (p) => {
|
|
354
|
+
d({ formData: { ...o, _bindings: p } }, "root._bindings");
|
|
351
355
|
}
|
|
352
356
|
}
|
|
353
357
|
) })
|
|
@@ -358,20 +362,20 @@ function fr() {
|
|
|
358
362
|
"Static Content"
|
|
359
363
|
] }) }),
|
|
360
364
|
/* @__PURE__ */ e.jsxs(de, { className: "pt-4", children: [
|
|
361
|
-
|
|
365
|
+
f(l) ? "" : /* @__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: [
|
|
362
366
|
"Data binding is set for ",
|
|
363
|
-
/* @__PURE__ */ e.jsx("b", { children: C(
|
|
367
|
+
/* @__PURE__ */ e.jsx("b", { children: C(l, ut).join(", ") }),
|
|
364
368
|
" ",
|
|
365
|
-
|
|
369
|
+
l.length === 1 ? "property" : "properties",
|
|
366
370
|
". Remove data binding to edit static content."
|
|
367
371
|
] }),
|
|
368
372
|
/* @__PURE__ */ e.jsx(
|
|
369
373
|
Ae,
|
|
370
374
|
{
|
|
371
375
|
onChange: d,
|
|
372
|
-
createHistorySnapshot:
|
|
373
|
-
formData:
|
|
374
|
-
properties:
|
|
376
|
+
createHistorySnapshot: n,
|
|
377
|
+
formData: o,
|
|
378
|
+
properties: c
|
|
375
379
|
}
|
|
376
380
|
)
|
|
377
381
|
] })
|
|
@@ -380,58 +384,58 @@ function fr() {
|
|
|
380
384
|
/* @__PURE__ */ e.jsx("div", { className: "pb-60" })
|
|
381
385
|
] });
|
|
382
386
|
}
|
|
383
|
-
const De = new
|
|
387
|
+
const De = new lr(or, {
|
|
384
388
|
isCaseSensitive: !1,
|
|
385
389
|
threshold: 0.2,
|
|
386
390
|
minMatchCharLength: 2,
|
|
387
391
|
keys: ["name"]
|
|
388
392
|
});
|
|
389
|
-
function
|
|
393
|
+
function vr() {
|
|
390
394
|
var R;
|
|
391
|
-
const [r] = je(), s = te(), t = Ue(),
|
|
392
|
-
const
|
|
393
|
-
t(
|
|
394
|
-
}, [
|
|
395
|
-
const j =
|
|
395
|
+
const [r] = je(), s = te(), t = Ue(), a = Ge(), [o] = Ke(), [n, d] = k(""), i = (R = fe(r)) == null ? void 0 : R.prop, l = gt((u(s, i, "").replace(nr, "").split(",").pop() || "").split(" "), f), c = () => {
|
|
396
|
+
const b = n.trim().toLowerCase().replace(/ +(?= )/g, "").split(" ");
|
|
397
|
+
t(o, b, !0), d("");
|
|
398
|
+
}, [p, h] = k([]), g = ({ value: b }) => {
|
|
399
|
+
const j = b.trim().toLowerCase(), B = j.match(/.+:/g);
|
|
396
400
|
let N = [];
|
|
397
401
|
if (B && B.length > 0) {
|
|
398
402
|
const [P] = B, F = j.replace(P, "");
|
|
399
|
-
N = De.search(F).map((
|
|
400
|
-
...
|
|
401
|
-
item: { ...
|
|
403
|
+
N = De.search(F).map((m) => ({
|
|
404
|
+
...m,
|
|
405
|
+
item: { ...m.item, name: P + m.item.name }
|
|
402
406
|
}));
|
|
403
407
|
} else
|
|
404
408
|
N = De.search(j);
|
|
405
|
-
|
|
406
|
-
},
|
|
407
|
-
|
|
408
|
-
},
|
|
409
|
+
h(C(N, "item"));
|
|
410
|
+
}, y = () => {
|
|
411
|
+
h([]);
|
|
412
|
+
}, x = (b) => b.name, v = (b) => /* @__PURE__ */ e.jsx("div", { className: "rounded-md p-1", children: b.name }), L = {
|
|
409
413
|
autoComplete: "off",
|
|
410
414
|
autoCorrect: "off",
|
|
411
415
|
autoCapitalize: "off",
|
|
412
416
|
spellCheck: !1,
|
|
413
417
|
placeholder: "Enter class name",
|
|
414
|
-
value:
|
|
415
|
-
onKeyDown: (
|
|
416
|
-
|
|
418
|
+
value: n,
|
|
419
|
+
onKeyDown: (b) => {
|
|
420
|
+
b.key === "Enter" && n.trim() !== "" && c();
|
|
417
421
|
},
|
|
418
|
-
onChange: (
|
|
422
|
+
onChange: (b, { newValue: j }) => d(j),
|
|
419
423
|
className: "w-full rounded-md text-xs px-2 hover:outline-0 bg-background border-border py-1"
|
|
420
424
|
};
|
|
421
425
|
return /* @__PURE__ */ e.jsxs(
|
|
422
426
|
"div",
|
|
423
427
|
{
|
|
424
|
-
className: `no-scrollbar flex ${
|
|
428
|
+
className: `no-scrollbar flex ${p.length > 0 ? "min-h-[300px]" : "min-h-max"} w-full flex-col gap-y-5 overflow-y-auto bg-gray-100 px-px`,
|
|
425
429
|
children: [
|
|
426
430
|
/* @__PURE__ */ e.jsx(Ce, { className: "mt-2", children: "Add Tailwind classes" }),
|
|
427
431
|
/* @__PURE__ */ e.jsxs("div", { className: "relative -mt-4 flex items-center gap-x-3", children: [
|
|
428
432
|
/* @__PURE__ */ e.jsx("div", { className: "relative flex w-full items-center gap-x-3", children: /* @__PURE__ */ e.jsx(
|
|
429
433
|
Qe,
|
|
430
434
|
{
|
|
431
|
-
suggestions:
|
|
432
|
-
onSuggestionsFetchRequested:
|
|
433
|
-
onSuggestionsClearRequested:
|
|
434
|
-
getSuggestionValue:
|
|
435
|
+
suggestions: p,
|
|
436
|
+
onSuggestionsFetchRequested: g,
|
|
437
|
+
onSuggestionsClearRequested: y,
|
|
438
|
+
getSuggestionValue: x,
|
|
435
439
|
renderSuggestion: v,
|
|
436
440
|
inputProps: L,
|
|
437
441
|
containerProps: {
|
|
@@ -449,32 +453,32 @@ function br() {
|
|
|
449
453
|
{
|
|
450
454
|
variant: "outline",
|
|
451
455
|
className: "h-6 border-gray-700",
|
|
452
|
-
onClick:
|
|
453
|
-
disabled:
|
|
456
|
+
onClick: c,
|
|
457
|
+
disabled: n.trim() === "",
|
|
454
458
|
size: "sm",
|
|
455
459
|
children: /* @__PURE__ */ e.jsx(ve, {})
|
|
456
460
|
}
|
|
457
461
|
)
|
|
458
462
|
] }),
|
|
459
463
|
/* @__PURE__ */ e.jsxs("div", { className: "flex w-full flex-wrap gap-2", children: [
|
|
460
|
-
|
|
464
|
+
f(l) && /* @__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" }),
|
|
461
465
|
se.Children.toArray(
|
|
462
|
-
|
|
466
|
+
l.map((b) => /* @__PURE__ */ e.jsxs(
|
|
463
467
|
"div",
|
|
464
468
|
{
|
|
465
469
|
className: "group relative flex cursor-default items-center gap-x-1 rounded-full border border-blue-600 bg-blue-500 p-px px-1.5 text-[11px] text-white hover:border-blue-900",
|
|
466
470
|
children: [
|
|
467
|
-
|
|
471
|
+
b,
|
|
468
472
|
/* @__PURE__ */ e.jsx(
|
|
469
473
|
Fe,
|
|
470
474
|
{
|
|
471
|
-
onClick: () =>
|
|
475
|
+
onClick: () => a(o, [b]),
|
|
472
476
|
className: "invisible absolute right-1 hover:text-white group-hover:visible group-hover:cursor-pointer"
|
|
473
477
|
}
|
|
474
478
|
)
|
|
475
479
|
]
|
|
476
480
|
},
|
|
477
|
-
|
|
481
|
+
b
|
|
478
482
|
))
|
|
479
483
|
)
|
|
480
484
|
] })
|
|
@@ -482,7 +486,7 @@ function br() {
|
|
|
482
486
|
}
|
|
483
487
|
);
|
|
484
488
|
}
|
|
485
|
-
const D = ["px", "%", "em", "rem", "ch", "vh", "vw"],
|
|
489
|
+
const D = ["px", "%", "em", "rem", "ch", "vh", "vw"], wr = {
|
|
486
490
|
heading: "Flex Child",
|
|
487
491
|
items: [
|
|
488
492
|
{ type: "arbitrary", label: "Basis", units: D, property: "flexBasis" },
|
|
@@ -491,7 +495,7 @@ const D = ["px", "%", "em", "rem", "ch", "vh", "vw"], vr = {
|
|
|
491
495
|
{ type: "dropdown", label: "Grow", property: "flexGrow" },
|
|
492
496
|
{ type: "dropdown", label: "Shrink", property: "flexShrink" }
|
|
493
497
|
]
|
|
494
|
-
},
|
|
498
|
+
}, jr = {
|
|
495
499
|
heading: "Grid Child",
|
|
496
500
|
items: [
|
|
497
501
|
{ type: "range", label: "Col Span", property: "gridColSpan" },
|
|
@@ -502,7 +506,7 @@ const D = ["px", "%", "em", "rem", "ch", "vh", "vw"], vr = {
|
|
|
502
506
|
{ type: "range", label: "Row End", property: "gridRowEnd" },
|
|
503
507
|
{ type: "range", label: "Order", property: "order" }
|
|
504
508
|
]
|
|
505
|
-
},
|
|
509
|
+
}, Cr = [
|
|
506
510
|
{
|
|
507
511
|
heading: "Display",
|
|
508
512
|
items: [
|
|
@@ -904,12 +908,12 @@ const D = ["px", "%", "em", "rem", "ch", "vh", "vw"], vr = {
|
|
|
904
908
|
},
|
|
905
909
|
{
|
|
906
910
|
heading: "Classes",
|
|
907
|
-
items: [{ component:
|
|
911
|
+
items: [{ component: vr }]
|
|
908
912
|
}
|
|
909
913
|
], rt = {
|
|
910
914
|
"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" }) }),
|
|
911
915
|
// visibility
|
|
912
|
-
visible:
|
|
916
|
+
visible: bt,
|
|
913
917
|
invisible: Te,
|
|
914
918
|
// display
|
|
915
919
|
hidden: Te,
|
|
@@ -945,7 +949,7 @@ const D = ["px", "%", "em", "rem", "ch", "vh", "vw"], vr = {
|
|
|
945
949
|
borderRadiusRight: K,
|
|
946
950
|
borderRadiusBottom: q,
|
|
947
951
|
borderRadiusLeft: J,
|
|
948
|
-
borderRadiusTopLeft:
|
|
952
|
+
borderRadiusTopLeft: ft,
|
|
949
953
|
borderRadiusTopRight: vt,
|
|
950
954
|
borderRadiusBottomRight: wt,
|
|
951
955
|
borderRadiusBottomLeft: jt,
|
|
@@ -1100,60 +1104,60 @@ const D = ["px", "%", "em", "rem", "ch", "vh", "vw"], vr = {
|
|
|
1100
1104
|
)
|
|
1101
1105
|
] }),
|
|
1102
1106
|
static: Bt
|
|
1103
|
-
}, re = Le({ canReset: !1, canChange: !0 }),
|
|
1107
|
+
}, re = Le({ canReset: !1, canChange: !0 }), kr = ({ children: r, canReset: s = !1, canChange: t = !0 }) => (
|
|
1104
1108
|
// eslint-disable-next-line react/jsx-no-constructed-context-values
|
|
1105
1109
|
/* @__PURE__ */ e.jsx(re.Provider, { value: { canReset: s, canChange: t }, children: r })
|
|
1106
1110
|
), lt = ({ label: r, property: s, onChange: t }) => {
|
|
1107
|
-
const
|
|
1111
|
+
const a = T(() => u(pe, `${s}.classes`, [""]), [s]), o = le(s), n = T(() => u(o, "cls", ""), [o]), { canChange: d } = ee(re), i = /\[.*\]/g.test(n);
|
|
1108
1112
|
return /* @__PURE__ */ e.jsx("div", { className: r ? "w-full rounded " : "grow", children: i ? /* @__PURE__ */ e.jsxs("div", { className: "flex items-center", children: [
|
|
1109
|
-
/* @__PURE__ */ e.jsx(
|
|
1110
|
-
/* @__PURE__ */ e.jsxs(
|
|
1111
|
-
/* @__PURE__ */ e.jsx(
|
|
1113
|
+
/* @__PURE__ */ e.jsx(ar, { className: "w-[70%] rounded py-1", readOnly: !0, value: n }),
|
|
1114
|
+
/* @__PURE__ */ e.jsxs(Y, { delayDuration: 100, children: [
|
|
1115
|
+
/* @__PURE__ */ e.jsx(X, { 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(we, {}) }) }),
|
|
1112
1116
|
/* @__PURE__ */ e.jsx(W, { children: "Current value is using a Tailwind arbitrary value." })
|
|
1113
1117
|
] })
|
|
1114
1118
|
] }) : /* @__PURE__ */ e.jsx(
|
|
1115
|
-
|
|
1119
|
+
ye,
|
|
1116
1120
|
{
|
|
1117
1121
|
rounded: r,
|
|
1118
|
-
onChange: (
|
|
1119
|
-
selected:
|
|
1120
|
-
options:
|
|
1122
|
+
onChange: (l) => t(l, s),
|
|
1123
|
+
selected: n,
|
|
1124
|
+
options: a,
|
|
1121
1125
|
disabled: !d
|
|
1122
1126
|
}
|
|
1123
1127
|
) });
|
|
1124
1128
|
};
|
|
1125
|
-
function
|
|
1126
|
-
const
|
|
1129
|
+
function ye({ selected: r, onChange: s, rounded: t = !1, options: a, disabled: o = !1 }) {
|
|
1130
|
+
const n = r.replace(/.*:/g, "").trim(), { undo: d, redo: i } = Ze();
|
|
1127
1131
|
return /* @__PURE__ */ e.jsxs(
|
|
1128
1132
|
"select",
|
|
1129
1133
|
{
|
|
1130
|
-
disabled: !
|
|
1134
|
+
disabled: !a.length || o,
|
|
1131
1135
|
className: `${t ? "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`,
|
|
1132
|
-
onChange: (
|
|
1133
|
-
onKeyDown: (
|
|
1134
|
-
|
|
1136
|
+
onChange: (l) => s(l.target.value),
|
|
1137
|
+
onKeyDown: (l) => {
|
|
1138
|
+
l.ctrlKey && (l.key === "z" && d(), l.key === "y" && i());
|
|
1135
1139
|
},
|
|
1136
|
-
value:
|
|
1140
|
+
value: n,
|
|
1137
1141
|
children: [
|
|
1138
1142
|
/* @__PURE__ */ e.jsx("option", { className: "bg-transparent", value: "" }),
|
|
1139
1143
|
$.Children.toArray(
|
|
1140
|
-
|
|
1144
|
+
a.map((l) => /* @__PURE__ */ e.jsx("option", { className: "bg-transparent", value: l, children: l }))
|
|
1141
1145
|
)
|
|
1142
1146
|
]
|
|
1143
1147
|
}
|
|
1144
1148
|
);
|
|
1145
1149
|
}
|
|
1146
|
-
const
|
|
1147
|
-
const { canReset: t, canChange:
|
|
1148
|
-
return /* @__PURE__ */ e.jsx("div", { className: "flex flex-row divide-x divide-solid divide-border rounded border border-border text-xs", children:
|
|
1150
|
+
const Nr = ({ property: r, onChange: s }) => {
|
|
1151
|
+
const { canReset: t, canChange: a } = ee(re), o = le(r), n = T(() => u(o, "cls", ""), [o]), d = T(() => u(pe, `${r}.classes`, [""]), [r]), i = d.indexOf(n) > -1 ? d.indexOf(n) : 0, l = /\[.*\]/g.test(n);
|
|
1152
|
+
return /* @__PURE__ */ e.jsx("div", { className: "flex flex-row divide-x divide-solid divide-border rounded border border-border text-xs", children: l ? /* @__PURE__ */ e.jsx("div", { className: "py-[5px] px-2", children: n }) : /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
1149
1153
|
/* @__PURE__ */ e.jsx(
|
|
1150
1154
|
"button",
|
|
1151
1155
|
{
|
|
1152
1156
|
type: "button",
|
|
1153
1157
|
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",
|
|
1154
|
-
disabled: !
|
|
1158
|
+
disabled: !a && (!t || i - 1 < 0),
|
|
1155
1159
|
onClick: () => s(Se(d, i - 1), r),
|
|
1156
|
-
children: /* @__PURE__ */ e.jsx("span", { className: "flex items-center justify-center", children: /* @__PURE__ */ e.jsx(At, { className: !
|
|
1160
|
+
children: /* @__PURE__ */ e.jsx("span", { className: "flex items-center justify-center", children: /* @__PURE__ */ e.jsx(At, { className: !a && (!t || i - 1 < 0) ? "text-gray-500" : "text-white/60" }) })
|
|
1157
1161
|
}
|
|
1158
1162
|
),
|
|
1159
1163
|
/* @__PURE__ */ e.jsx("div", { className: "w-8/12 text-center", children: /* @__PURE__ */ e.jsx(lt, { label: !1, property: r, onChange: s }) }),
|
|
@@ -1162,33 +1166,33 @@ const kr = ({ property: r, onChange: s }) => {
|
|
|
1162
1166
|
{
|
|
1163
1167
|
type: "button",
|
|
1164
1168
|
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",
|
|
1165
|
-
disabled: !
|
|
1169
|
+
disabled: !a && (!t || i + 1 >= d.length),
|
|
1166
1170
|
onClick: () => s(Se(d, i + 1), r),
|
|
1167
1171
|
children: /* @__PURE__ */ e.jsx("span", { className: "flex items-center justify-center", children: /* @__PURE__ */ e.jsx(
|
|
1168
1172
|
ve,
|
|
1169
1173
|
{
|
|
1170
|
-
className: !
|
|
1174
|
+
className: !a && (!t || i + 1 >= d.length) ? "text-gray-500" : "text-white/60"
|
|
1171
1175
|
}
|
|
1172
1176
|
) })
|
|
1173
1177
|
}
|
|
1174
1178
|
)
|
|
1175
1179
|
] }) });
|
|
1176
|
-
},
|
|
1177
|
-
const t = T(() =>
|
|
1178
|
-
return /* @__PURE__ */ e.jsx("div", { className: "flex grow flex-wrap gap-1", children: C(t, (d) => /* @__PURE__ */ e.jsxs(
|
|
1179
|
-
/* @__PURE__ */ e.jsx(
|
|
1180
|
+
}, Sr = ({ property: r, onChange: s }) => {
|
|
1181
|
+
const t = T(() => u(pe, `${r}.classes`, [""]), [r]), { canChange: a } = ee(re), o = le(r), n = T(() => u(o, "cls", ""), [o]);
|
|
1182
|
+
return /* @__PURE__ */ e.jsx("div", { className: "flex grow flex-wrap gap-1", children: C(t, (d) => /* @__PURE__ */ e.jsxs(Y, { children: [
|
|
1183
|
+
/* @__PURE__ */ e.jsx(X, { asChild: !0, children: /* @__PURE__ */ e.jsx(
|
|
1180
1184
|
"button",
|
|
1181
1185
|
{
|
|
1182
1186
|
type: "button",
|
|
1183
|
-
disabled: !
|
|
1187
|
+
disabled: !a,
|
|
1184
1188
|
onClick: () => s(d, r),
|
|
1185
|
-
className: `cursor-pointer rounded border border-gray-600 p-1 disabled:cursor-not-allowed ${
|
|
1186
|
-
children: $.createElement(
|
|
1189
|
+
className: `cursor-pointer rounded border border-gray-600 p-1 disabled:cursor-not-allowed ${n === d ? " bg-blue-500 text-white" : "disabled:bg-gray-600 disabled:text-gray-400"}`,
|
|
1190
|
+
children: $.createElement(u(rt, d, Ye))
|
|
1187
1191
|
}
|
|
1188
1192
|
) }),
|
|
1189
1193
|
/* @__PURE__ */ e.jsx(W, { children: Q(ne(d)) })
|
|
1190
1194
|
] })) });
|
|
1191
|
-
},
|
|
1195
|
+
}, Tr = {
|
|
1192
1196
|
backgroundColor: "bg",
|
|
1193
1197
|
textColor: "text",
|
|
1194
1198
|
borderColor: "border",
|
|
@@ -1200,39 +1204,39 @@ const kr = ({ property: r, onChange: s }) => {
|
|
|
1200
1204
|
toColor: "to",
|
|
1201
1205
|
ringColor: "ring",
|
|
1202
1206
|
ringOffsetColor: "ring-offset"
|
|
1203
|
-
},
|
|
1204
|
-
const t = le(r),
|
|
1207
|
+
}, Rr = ({ property: r, onChange: s }) => {
|
|
1208
|
+
const t = le(r), a = T(() => u(t, "cls", ""), [t]), { canChange: o } = ee(re), [n, d] = k([]), [i, l] = k({ color: "", shade: "" }), c = a.split("-"), p = u(c, "1", ""), h = u(c, "2", ""), g = I(
|
|
1205
1209
|
// eslint-disable-next-line no-shadow
|
|
1206
|
-
(
|
|
1207
|
-
["current", "inherit", "transparent", "black", "white"].includes(
|
|
1210
|
+
(x) => {
|
|
1211
|
+
["current", "inherit", "transparent", "black", "white"].includes(x) ? (d([]), l({ color: x })) : (d(["50", "100", "200", "300", "400", "500", "600", "700", "800", "900"]), l((v) => ({ ...v, color: x, shade: v.shade ? v.shade : "500" })));
|
|
1208
1212
|
},
|
|
1209
|
-
[d,
|
|
1213
|
+
[d, l]
|
|
1210
1214
|
);
|
|
1211
1215
|
M(() => {
|
|
1212
|
-
if (["current", "inherit", "transparent", "black", "white"].includes(
|
|
1216
|
+
if (["current", "inherit", "transparent", "black", "white"].includes(p))
|
|
1213
1217
|
return d([]);
|
|
1214
1218
|
d(["50", "100", "200", "300", "400", "500", "600", "700", "800", "900"]);
|
|
1215
|
-
}, [
|
|
1216
|
-
const
|
|
1219
|
+
}, [p]);
|
|
1220
|
+
const y = I(
|
|
1217
1221
|
// eslint-disable-next-line no-shadow
|
|
1218
|
-
(
|
|
1219
|
-
|
|
1222
|
+
(x) => {
|
|
1223
|
+
l({ color: p, shade: x });
|
|
1220
1224
|
},
|
|
1221
|
-
[
|
|
1225
|
+
[p]
|
|
1222
1226
|
);
|
|
1223
1227
|
return M(() => {
|
|
1224
|
-
|
|
1228
|
+
l({ color: "", shade: "" });
|
|
1225
1229
|
}, [t]), M(() => {
|
|
1226
|
-
const v = `${
|
|
1227
|
-
v.match(new RegExp(
|
|
1230
|
+
const v = `${u(Tr, r, "")}-${i.color}${i.shade ? `-${i.shade}` : ""}`;
|
|
1231
|
+
v.match(new RegExp(u(pe, `${r}.regExp`, ""))) && s(v, r);
|
|
1228
1232
|
}, [i, s, r]), /* @__PURE__ */ e.jsxs("div", { className: "flex flex-row divide-x divide-solid divide-border rounded-lg border border-border text-xs", children: [
|
|
1229
1233
|
/* @__PURE__ */ e.jsx("div", { className: "grow text-center", children: /* @__PURE__ */ e.jsx(
|
|
1230
|
-
|
|
1234
|
+
ye,
|
|
1231
1235
|
{
|
|
1232
|
-
disabled: !
|
|
1236
|
+
disabled: !o,
|
|
1233
1237
|
rounded: !0,
|
|
1234
|
-
selected:
|
|
1235
|
-
onChange:
|
|
1238
|
+
selected: p,
|
|
1239
|
+
onChange: g,
|
|
1236
1240
|
options: [
|
|
1237
1241
|
"current",
|
|
1238
1242
|
"transparent",
|
|
@@ -1265,18 +1269,18 @@ const kr = ({ property: r, onChange: s }) => {
|
|
|
1265
1269
|
]
|
|
1266
1270
|
}
|
|
1267
1271
|
) }),
|
|
1268
|
-
/* @__PURE__ */ e.jsx("button", { type: "button", className: "grow text-center", children: /* @__PURE__ */ e.jsx(
|
|
1272
|
+
/* @__PURE__ */ e.jsx("button", { type: "button", className: "grow text-center", children: /* @__PURE__ */ e.jsx(ye, { rounded: !0, selected: h, disabled: !p || !o, onChange: y, options: n }) })
|
|
1269
1273
|
] });
|
|
1270
1274
|
}, $e = (r, s) => {
|
|
1271
1275
|
r = r.toLowerCase();
|
|
1272
1276
|
let t = r.trim().replace(/ |\+/g, "");
|
|
1273
1277
|
if ((t === "auto" || t === "none") && s.includes(t))
|
|
1274
1278
|
return { value: "", unit: t };
|
|
1275
|
-
const
|
|
1276
|
-
t = t.replace(
|
|
1277
|
-
const
|
|
1278
|
-
return
|
|
1279
|
-
},
|
|
1279
|
+
const a = s.length ? new RegExp(s.join("|"), "g") : /XXXXXX/g;
|
|
1280
|
+
t = t.replace(a, "");
|
|
1281
|
+
const o = r.match(a), n = o && o.length > 1, d = !f(t) && Number.isNaN(Number(t));
|
|
1282
|
+
return n || d ? { error: "Invalid value" } : o && (o[0] === "auto" || o[0] === "none") ? { value: o[0], unit: "" } : { value: t, unit: o ? o[0] : "" };
|
|
1283
|
+
}, Vr = (r) => {
|
|
1280
1284
|
const s = r.startsWith("-") ? "-" : "", t = r.split("-").pop();
|
|
1281
1285
|
if (["auto", "none"].includes(t))
|
|
1282
1286
|
return { value: "", unit: t };
|
|
@@ -1299,9 +1303,9 @@ const kr = ({ property: r, onChange: s }) => {
|
|
|
1299
1303
|
if (O(r, "scale-"))
|
|
1300
1304
|
return { value: `${s}${`${t / 100}`}`, unit: "-" };
|
|
1301
1305
|
if (Z(r, "border")) {
|
|
1302
|
-
const
|
|
1303
|
-
if (
|
|
1304
|
-
return { value:
|
|
1306
|
+
const a = r.match(/border-?(x|y|t|r|b|l)?\d+/g);
|
|
1307
|
+
if (a)
|
|
1308
|
+
return { value: a[0].split("-").pop(), unit: "px" };
|
|
1305
1309
|
if (r.match(/border-?(x|y|t|r|b|l)?/g))
|
|
1306
1310
|
return { value: "1", unit: "px" };
|
|
1307
1311
|
}
|
|
@@ -1400,28 +1404,28 @@ const kr = ({ property: r, onChange: s }) => {
|
|
|
1400
1404
|
if (["max", "min", "fit"].includes(t))
|
|
1401
1405
|
return { value: r, unit: "class" };
|
|
1402
1406
|
if (t.includes("/")) {
|
|
1403
|
-
const [
|
|
1404
|
-
return { value: s + (
|
|
1407
|
+
const [a, o] = C(t.split("/"), (n) => parseInt(n, 10));
|
|
1408
|
+
return { value: s + (a / o * 100).toFixed(2).replace(".00", ""), unit: "%" };
|
|
1405
1409
|
}
|
|
1406
1410
|
return xt(parseFloat(t)) ? { value: `${s + parseFloat(t) * 4}`, unit: "px" } : { value: t, unit: "class" };
|
|
1407
|
-
},
|
|
1408
|
-
if (
|
|
1411
|
+
}, Hr = (r) => {
|
|
1412
|
+
if (f(r))
|
|
1409
1413
|
return { value: "", unit: "" };
|
|
1410
1414
|
const s = r.match(/\[.*\]/g);
|
|
1411
1415
|
if (s === null)
|
|
1412
|
-
return
|
|
1413
|
-
const t =
|
|
1414
|
-
return { value: `${
|
|
1415
|
-
},
|
|
1416
|
+
return Br(r);
|
|
1417
|
+
const t = u(s, "0", "").replace(/\[|\]/g, ""), a = r.startsWith("-") ? "-" : "", o = fe(t.match(/\d+.\d+|\d+/g));
|
|
1418
|
+
return { value: `${a}${o}`, unit: t.replace(o, "") };
|
|
1419
|
+
}, Br = (r) => f(r) ? { value: "", unit: "" } : Vr(r), ot = $.createContext({
|
|
1416
1420
|
setDragData: () => {
|
|
1417
1421
|
}
|
|
1418
|
-
}),
|
|
1422
|
+
}), Ar = ({
|
|
1419
1423
|
unit: r,
|
|
1420
1424
|
currentValue: s,
|
|
1421
1425
|
onDrag: t,
|
|
1422
|
-
onDragEnd:
|
|
1423
|
-
onDragStart:
|
|
1424
|
-
negative:
|
|
1426
|
+
onDragEnd: a,
|
|
1427
|
+
onDragStart: o,
|
|
1428
|
+
negative: n,
|
|
1425
1429
|
cssProperty: d
|
|
1426
1430
|
}) => {
|
|
1427
1431
|
const { setDragData: i } = ee(ot);
|
|
@@ -1429,190 +1433,190 @@ const kr = ({ property: r, onChange: s }) => {
|
|
|
1429
1433
|
"button",
|
|
1430
1434
|
{
|
|
1431
1435
|
type: "button",
|
|
1432
|
-
onMouseDown: (
|
|
1433
|
-
const
|
|
1436
|
+
onMouseDown: (l) => {
|
|
1437
|
+
const c = {
|
|
1434
1438
|
onDrag: t,
|
|
1435
|
-
onDragEnd:
|
|
1439
|
+
onDragEnd: a,
|
|
1436
1440
|
dragging: !0,
|
|
1437
|
-
dragStartY:
|
|
1441
|
+
dragStartY: l.pageY,
|
|
1438
1442
|
dragStartValue: `${s}`,
|
|
1439
1443
|
dragUnit: r,
|
|
1440
|
-
negative:
|
|
1444
|
+
negative: n,
|
|
1441
1445
|
cssProperty: d
|
|
1442
1446
|
};
|
|
1443
|
-
|
|
1447
|
+
o(c), i(c);
|
|
1444
1448
|
},
|
|
1445
1449
|
color: void 0,
|
|
1446
1450
|
className: "relative z-50 ml-1 hidden h-6 cursor-row-resize rounded bg-background/70 px-2 group-hover:inline",
|
|
1447
1451
|
children: /* @__PURE__ */ e.jsx($t, {})
|
|
1448
1452
|
}
|
|
1449
1453
|
);
|
|
1450
|
-
},
|
|
1454
|
+
}, Dr = ({ onSelect: r, current: s, units: t }) => /* @__PURE__ */ e.jsx("div", { "data-theme": "light", className: "-m-[7px] -mx-[13px] flex w-9 flex-col", children: t.map((a) => /* @__PURE__ */ e.jsx(
|
|
1451
1455
|
et,
|
|
1452
1456
|
{
|
|
1453
1457
|
className: "h-max rounded-none px-1 py-1 text-right text-[11px] hover:bg-blue-400",
|
|
1454
|
-
color: s ===
|
|
1458
|
+
color: s === a ? "primary" : void 0,
|
|
1455
1459
|
size: "sm",
|
|
1456
|
-
onClick: (
|
|
1457
|
-
|
|
1460
|
+
onClick: (o) => {
|
|
1461
|
+
o.stopPropagation(), r(a);
|
|
1458
1462
|
},
|
|
1459
|
-
children:
|
|
1463
|
+
children: a
|
|
1460
1464
|
},
|
|
1461
|
-
|
|
1462
|
-
)) }),
|
|
1463
|
-
const [s, t] = k(!1), [
|
|
1465
|
+
a
|
|
1466
|
+
)) }), $r = (r) => {
|
|
1467
|
+
const [s, t] = k(!1), [a, o] = k(""), { currentClass: n, onChange: d, classPrefix: i, cssProperty: l, units: c, negative: p } = r, [h, g] = k(l != null && l.toLowerCase().includes("width") ? "%" : c[0]), [y, x] = k(!1), [v, L] = k(""), [R, b] = k(!1), [j, B] = k(!1);
|
|
1464
1468
|
M(() => {
|
|
1465
|
-
const { value:
|
|
1469
|
+
const { value: m, unit: w } = Hr(n);
|
|
1466
1470
|
if (w === "") {
|
|
1467
|
-
|
|
1471
|
+
o(m), g(l != null && l.toLowerCase().includes("width") ? "%" : c[0]);
|
|
1468
1472
|
return;
|
|
1469
1473
|
}
|
|
1470
|
-
|
|
1471
|
-
}, [
|
|
1474
|
+
g(w), o(w === "class" || f(m) ? "" : m);
|
|
1475
|
+
}, [n, l, c]);
|
|
1472
1476
|
const N = xe(
|
|
1473
|
-
(
|
|
1474
|
-
d(
|
|
1477
|
+
(m) => {
|
|
1478
|
+
d(m);
|
|
1475
1479
|
},
|
|
1476
1480
|
[d],
|
|
1477
1481
|
200
|
|
1478
1482
|
), P = xe(
|
|
1479
|
-
(
|
|
1480
|
-
d(
|
|
1483
|
+
(m) => {
|
|
1484
|
+
d(m, !1);
|
|
1481
1485
|
},
|
|
1482
1486
|
[d],
|
|
1483
1487
|
200
|
|
1484
1488
|
), F = I(
|
|
1485
|
-
(
|
|
1486
|
-
const w = $e(`${
|
|
1487
|
-
if (
|
|
1488
|
-
|
|
1489
|
+
(m = !1) => {
|
|
1490
|
+
const w = $e(`${a}`, c);
|
|
1491
|
+
if (u(w, "error", !1)) {
|
|
1492
|
+
x(!0);
|
|
1489
1493
|
return;
|
|
1490
1494
|
}
|
|
1491
|
-
const S =
|
|
1495
|
+
const S = u(w, "unit") !== "" ? u(w, "unit") : h;
|
|
1492
1496
|
if (S === "auto" || S === "none") {
|
|
1493
1497
|
N(`${i}${S}`);
|
|
1494
1498
|
return;
|
|
1495
1499
|
}
|
|
1496
|
-
if (
|
|
1500
|
+
if (u(w, "value") === "")
|
|
1497
1501
|
return;
|
|
1498
|
-
const U = `${
|
|
1499
|
-
|
|
1502
|
+
const U = `${u(w, "value", "").startsWith("-") ? "-" : ""}${i}[${u(w, "value", "").replace("-", "")}${S === "-" ? "" : S}]`;
|
|
1503
|
+
m ? P(U) : N(U);
|
|
1500
1504
|
},
|
|
1501
|
-
[N, P,
|
|
1505
|
+
[N, P, a, h, i, c]
|
|
1502
1506
|
), oe = I(
|
|
1503
|
-
(
|
|
1504
|
-
const w = $e(`${
|
|
1505
|
-
if (
|
|
1506
|
-
|
|
1507
|
+
(m) => {
|
|
1508
|
+
const w = $e(`${a}`, c);
|
|
1509
|
+
if (u(w, "error", !1)) {
|
|
1510
|
+
x(!0);
|
|
1507
1511
|
return;
|
|
1508
1512
|
}
|
|
1509
|
-
if (
|
|
1510
|
-
N(`${i}${
|
|
1513
|
+
if (m === "auto" || m === "none") {
|
|
1514
|
+
N(`${i}${m}`);
|
|
1511
1515
|
return;
|
|
1512
1516
|
}
|
|
1513
|
-
if (
|
|
1517
|
+
if (u(w, "value") === "")
|
|
1514
1518
|
return;
|
|
1515
|
-
const S =
|
|
1519
|
+
const S = u(w, "unit") !== "" ? u(w, "unit") : m, U = `${u(w, "value", "").startsWith("-") ? "-" : ""}${i}[${u(w, "value", "").replace("-", "")}${S === "-" ? "" : S}]`;
|
|
1516
1520
|
N(U);
|
|
1517
1521
|
},
|
|
1518
|
-
[N,
|
|
1522
|
+
[N, a, i, c]
|
|
1519
1523
|
);
|
|
1520
|
-
return /* @__PURE__ */ e.jsx("div", { className: "flex w-full flex-col", children: /* @__PURE__ */ e.jsx("div", { className: "flex items-center justify-start", children:
|
|
1521
|
-
/* @__PURE__ */ e.jsx("input", { className: "w-20 rounded py-1", readOnly: !0, value:
|
|
1522
|
-
/* @__PURE__ */ e.jsxs(
|
|
1523
|
-
/* @__PURE__ */ e.jsx(
|
|
1524
|
+
return /* @__PURE__ */ e.jsx("div", { className: "flex w-full flex-col", children: /* @__PURE__ */ e.jsx("div", { className: "flex items-center justify-start", children: h === "class" ? /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
1525
|
+
/* @__PURE__ */ e.jsx("input", { className: "w-20 rounded py-1", readOnly: !0, value: n }),
|
|
1526
|
+
/* @__PURE__ */ e.jsxs(Y, { children: [
|
|
1527
|
+
/* @__PURE__ */ e.jsx(X, { 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(we, {}) }) }),
|
|
1524
1528
|
/* @__PURE__ */ e.jsx(W, { children: "Current value is using a Tailwind preset class." })
|
|
1525
1529
|
] })
|
|
1526
1530
|
] }) : /* @__PURE__ */ e.jsxs("div", { className: `group relative flex items-center ${R ? "z-auto" : ""}`, children: [
|
|
1527
1531
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center rounded-md border border-border", children: [
|
|
1528
|
-
["none", "auto"].indexOf(
|
|
1532
|
+
["none", "auto"].indexOf(h) !== -1 ? null : /* @__PURE__ */ e.jsx(
|
|
1529
1533
|
"input",
|
|
1530
1534
|
{
|
|
1531
|
-
readOnly:
|
|
1532
|
-
onKeyPress: (
|
|
1533
|
-
|
|
1535
|
+
readOnly: h === "class",
|
|
1536
|
+
onKeyPress: (m) => {
|
|
1537
|
+
m.key === "Enter" && F();
|
|
1534
1538
|
},
|
|
1535
|
-
onKeyDown: (
|
|
1536
|
-
if (
|
|
1539
|
+
onKeyDown: (m) => {
|
|
1540
|
+
if (m.keyCode !== 38 && m.keyCode !== 40)
|
|
1537
1541
|
return;
|
|
1538
|
-
|
|
1539
|
-
const w = ht(
|
|
1542
|
+
m.preventDefault(), B(!0);
|
|
1543
|
+
const w = ht(m.target.value);
|
|
1540
1544
|
let S = Me(w) ? 0 : w;
|
|
1541
|
-
|
|
1542
|
-
const E = `${S}`, nt = `${E.startsWith("-") ? "-" : ""}${i}[${E.replace("-", "")}${
|
|
1545
|
+
m.keyCode === 38 && (S += 1), m.keyCode === 40 && (S -= 1);
|
|
1546
|
+
const E = `${S}`, nt = `${E.startsWith("-") ? "-" : ""}${i}[${E.replace("-", "")}${h === "-" ? "" : h}]`;
|
|
1543
1547
|
P(nt);
|
|
1544
1548
|
},
|
|
1545
|
-
onKeyUp: (
|
|
1546
|
-
j && (
|
|
1549
|
+
onKeyUp: (m) => {
|
|
1550
|
+
j && (m.preventDefault(), B(!1));
|
|
1547
1551
|
},
|
|
1548
1552
|
onBlur: () => F(),
|
|
1549
|
-
onChange: (
|
|
1550
|
-
|
|
1553
|
+
onChange: (m) => {
|
|
1554
|
+
x(!1), o(m.target.value);
|
|
1551
1555
|
},
|
|
1552
|
-
onClick: (
|
|
1556
|
+
onClick: (m) => {
|
|
1553
1557
|
var w;
|
|
1554
|
-
(w =
|
|
1558
|
+
(w = m == null ? void 0 : m.target) == null || w.select(), t(!1);
|
|
1555
1559
|
},
|
|
1556
|
-
value: R ? v :
|
|
1560
|
+
value: R ? v : a,
|
|
1557
1561
|
className: "h-6 w-14 rounded rounded-r-none bg-background pl-2 text-sm focus-visible:outline-0 ".concat(
|
|
1558
1562
|
" ",
|
|
1559
|
-
|
|
1563
|
+
y ? "border-red-500 text-red-500" : "border-foreground/20"
|
|
1560
1564
|
)
|
|
1561
1565
|
}
|
|
1562
1566
|
),
|
|
1563
|
-
/* @__PURE__ */ e.jsxs(
|
|
1564
|
-
/* @__PURE__ */ e.jsx(
|
|
1567
|
+
/* @__PURE__ */ e.jsxs(Y, { open: s, delayDuration: 100, children: [
|
|
1568
|
+
/* @__PURE__ */ e.jsx(X, { asChild: !0, children: /* @__PURE__ */ e.jsxs(
|
|
1565
1569
|
"button",
|
|
1566
1570
|
{
|
|
1567
1571
|
type: "button",
|
|
1568
1572
|
onClick: () => t(!s),
|
|
1569
1573
|
className: "flex h-6 cursor-pointer items-center gap-x-1 rounded rounded-l-none bg-background p-px px-1 text-[11px] uppercase",
|
|
1570
1574
|
children: [
|
|
1571
|
-
/* @__PURE__ */ e.jsx("span", { className: `inline-block ${
|
|
1572
|
-
|
|
1575
|
+
/* @__PURE__ */ e.jsx("span", { className: `inline-block ${c.length === 1 ? "px-2 font-semibold" : ""}`, children: h }),
|
|
1576
|
+
c.length > 1 ? /* @__PURE__ */ e.jsx(Dt, {}) : null
|
|
1573
1577
|
]
|
|
1574
1578
|
}
|
|
1575
1579
|
) }),
|
|
1576
|
-
/* @__PURE__ */ e.jsx(
|
|
1577
|
-
|
|
1580
|
+
/* @__PURE__ */ e.jsx(qt, { children: /* @__PURE__ */ e.jsx(W, { className: "bg-background", children: /* @__PURE__ */ e.jsx(
|
|
1581
|
+
Dr,
|
|
1578
1582
|
{
|
|
1579
|
-
units:
|
|
1580
|
-
current:
|
|
1581
|
-
onSelect: (
|
|
1582
|
-
t(!1),
|
|
1583
|
+
units: c,
|
|
1584
|
+
current: h,
|
|
1585
|
+
onSelect: (m) => {
|
|
1586
|
+
t(!1), g(m), oe(m);
|
|
1583
1587
|
}
|
|
1584
1588
|
}
|
|
1585
1589
|
) }) })
|
|
1586
1590
|
] })
|
|
1587
1591
|
] }),
|
|
1588
|
-
["none", "auto"].indexOf(
|
|
1589
|
-
|
|
1592
|
+
["none", "auto"].indexOf(h) !== -1 || R ? null : /* @__PURE__ */ e.jsx(
|
|
1593
|
+
Ar,
|
|
1590
1594
|
{
|
|
1591
|
-
onDragStart: () =>
|
|
1592
|
-
onDragEnd: (
|
|
1593
|
-
if (L(() => ""),
|
|
1595
|
+
onDragStart: () => b(!0),
|
|
1596
|
+
onDragEnd: (m) => {
|
|
1597
|
+
if (L(() => ""), b(!1), f(m))
|
|
1594
1598
|
return;
|
|
1595
|
-
const w = `${
|
|
1599
|
+
const w = `${m}`, E = `${w.startsWith("-") ? "-" : ""}${i}[${w.replace("-", "")}${h === "-" ? "" : h}]`;
|
|
1596
1600
|
N(E);
|
|
1597
1601
|
},
|
|
1598
|
-
onDrag: (
|
|
1599
|
-
if (
|
|
1602
|
+
onDrag: (m) => {
|
|
1603
|
+
if (f(m))
|
|
1600
1604
|
return;
|
|
1601
|
-
L(
|
|
1602
|
-
const w = `${
|
|
1605
|
+
L(m);
|
|
1606
|
+
const w = `${m}`, E = `${w.startsWith("-") ? "-" : ""}${i}[${w.replace("-", "")}${h === "-" ? "" : h}]`;
|
|
1603
1607
|
P(E);
|
|
1604
1608
|
},
|
|
1605
|
-
currentValue:
|
|
1606
|
-
unit:
|
|
1607
|
-
negative:
|
|
1608
|
-
cssProperty:
|
|
1609
|
+
currentValue: a,
|
|
1610
|
+
unit: h,
|
|
1611
|
+
negative: p,
|
|
1612
|
+
cssProperty: l
|
|
1609
1613
|
}
|
|
1610
1614
|
)
|
|
1611
1615
|
] }) }) });
|
|
1612
1616
|
}, le = (r) => {
|
|
1613
1617
|
const s = ce();
|
|
1614
|
-
return
|
|
1615
|
-
},
|
|
1618
|
+
return mt(s, { property: r });
|
|
1619
|
+
}, Ir = (r, s) => {
|
|
1616
1620
|
const t = {
|
|
1617
1621
|
xs: 0,
|
|
1618
1622
|
sm: 1,
|
|
@@ -1621,8 +1625,8 @@ const kr = ({ property: r, onChange: s }) => {
|
|
|
1621
1625
|
xl: 4,
|
|
1622
1626
|
"2xl": 5
|
|
1623
1627
|
};
|
|
1624
|
-
return t[
|
|
1625
|
-
},
|
|
1628
|
+
return t[u(r, "mq", "xs")] <= t[s];
|
|
1629
|
+
}, Lr = {
|
|
1626
1630
|
width: "w-",
|
|
1627
1631
|
height: "h-",
|
|
1628
1632
|
minWidth: "min-w-",
|
|
@@ -1695,25 +1699,25 @@ const kr = ({ property: r, onChange: s }) => {
|
|
|
1695
1699
|
lg: "1024px",
|
|
1696
1700
|
xl: "1280px",
|
|
1697
1701
|
"2xl": "1536px"
|
|
1698
|
-
},
|
|
1699
|
-
const { type: s = "icons", label: t, property:
|
|
1700
|
-
}, units:
|
|
1702
|
+
}, Pr = (r) => `${r.toUpperCase()} ${Ie[r] ? `(${Ie[r]} & up)` : ""}`, ke = (r) => {
|
|
1703
|
+
const { type: s = "icons", label: t, property: a, onEmitChange: o = () => {
|
|
1704
|
+
}, units: n, negative: d = !1 } = r, [i] = Ft(), [l] = qe(), [, c] = He(), p = le(a), h = Ue(), g = Ge(), [y] = Ke(), x = T(() => u(p, "fullCls", ""), [p]), v = I(
|
|
1701
1705
|
(N, P = !0) => {
|
|
1702
|
-
const F = { dark: i, mq:
|
|
1703
|
-
(i ||
|
|
1704
|
-
const oe =
|
|
1705
|
-
|
|
1706
|
+
const F = { dark: i, mq: c, mod: l, cls: N, property: a, fullCls: "" };
|
|
1707
|
+
(i || l !== "") && (F.mq = "xs");
|
|
1708
|
+
const oe = sr(F);
|
|
1709
|
+
h(y, [oe], P);
|
|
1706
1710
|
},
|
|
1707
|
-
[
|
|
1711
|
+
[y, i, c, l, a, h]
|
|
1708
1712
|
), L = I(() => {
|
|
1709
|
-
y
|
|
1710
|
-
}, [
|
|
1713
|
+
g(y, [x]);
|
|
1714
|
+
}, [y, x, g]), R = T(() => Ir(p, c), [p, c]);
|
|
1711
1715
|
M(() => {
|
|
1712
|
-
|
|
1713
|
-
}, [R,
|
|
1714
|
-
const [, ,
|
|
1716
|
+
o(R, p);
|
|
1717
|
+
}, [R, o, p]);
|
|
1718
|
+
const [, , b] = He(), j = I(
|
|
1715
1719
|
(N) => {
|
|
1716
|
-
|
|
1720
|
+
b({
|
|
1717
1721
|
xs: 400,
|
|
1718
1722
|
sm: 640,
|
|
1719
1723
|
md: 800,
|
|
@@ -1722,30 +1726,30 @@ const kr = ({ property: r, onChange: s }) => {
|
|
|
1722
1726
|
"2xl": 1920
|
|
1723
1727
|
}[N]);
|
|
1724
1728
|
},
|
|
1725
|
-
[
|
|
1726
|
-
), B =
|
|
1727
|
-
return /* @__PURE__ */ e.jsx(
|
|
1728
|
-
/* @__PURE__ */ e.jsx("div", { className: "relative w-[70px] truncate text-xs text-foreground", children: /* @__PURE__ */ e.jsx("span", { className: `text-[11px] ${
|
|
1729
|
+
[b]
|
|
1730
|
+
), B = u(p, "dark", null) === i && u(p, "mod", null) === l && u(p, "mq", null) === c;
|
|
1731
|
+
return /* @__PURE__ */ e.jsx(kr, { canChange: R, canReset: p && B, children: /* @__PURE__ */ e.jsxs("div", { className: "group flex flex-row items-center py-2 first:pt-0 last:pb-0", children: [
|
|
1732
|
+
/* @__PURE__ */ e.jsx("div", { className: "relative w-[70px] truncate text-xs text-foreground", children: /* @__PURE__ */ e.jsx("span", { className: `text-[11px] ${p && !B ? "text-foreground" : ""}`, children: t }) }),
|
|
1729
1733
|
/* @__PURE__ */ e.jsxs("div", { className: "flex flex-row items-center", children: [
|
|
1730
1734
|
/* @__PURE__ */ e.jsxs("div", { className: "w-[150px]", children: [
|
|
1731
1735
|
s === "arbitrary" ? /* @__PURE__ */ e.jsx(
|
|
1732
|
-
|
|
1736
|
+
$r,
|
|
1733
1737
|
{
|
|
1734
|
-
currentClass:
|
|
1735
|
-
classPrefix:
|
|
1736
|
-
units:
|
|
1738
|
+
currentClass: u(p, "cls", ""),
|
|
1739
|
+
classPrefix: u(Lr, a, ""),
|
|
1740
|
+
units: n || [],
|
|
1737
1741
|
onChange: v,
|
|
1738
1742
|
negative: d,
|
|
1739
|
-
cssProperty:
|
|
1743
|
+
cssProperty: a
|
|
1740
1744
|
}
|
|
1741
1745
|
) : null,
|
|
1742
|
-
s === "icons" && /* @__PURE__ */ e.jsx(
|
|
1743
|
-
s === "range" && /* @__PURE__ */ e.jsx(
|
|
1744
|
-
s === "color" && /* @__PURE__ */ e.jsx(
|
|
1745
|
-
s === "dropdown" && /* @__PURE__ */ e.jsx(lt, { label: t, property:
|
|
1746
|
+
s === "icons" && /* @__PURE__ */ e.jsx(Sr, { property: a, onChange: v }),
|
|
1747
|
+
s === "range" && /* @__PURE__ */ e.jsx(Nr, { property: a, onChange: v }),
|
|
1748
|
+
s === "color" && /* @__PURE__ */ e.jsx(Rr, { property: a, onChange: v }),
|
|
1749
|
+
s === "dropdown" && /* @__PURE__ */ e.jsx(lt, { label: t, property: a, onChange: v })
|
|
1746
1750
|
] }),
|
|
1747
|
-
/* @__PURE__ */ e.jsx("div", { className: `w-[30px] cursor-pointer ${
|
|
1748
|
-
/* @__PURE__ */ e.jsx(
|
|
1751
|
+
/* @__PURE__ */ e.jsx("div", { className: `w-[30px] cursor-pointer ${x ? "visible" : "invisible"}`, children: B ? /* @__PURE__ */ e.jsx("button", { type: "button", onClick: () => L(), title: "Reset", className: "flex px-1.5 text-xs", children: /* @__PURE__ */ e.jsx(Xe, { className: "h-5 w-5 text-blue-500 hover:opacity-80" }) }) : R && p ? /* @__PURE__ */ e.jsxs(Y, { delayDuration: 100, children: [
|
|
1752
|
+
/* @__PURE__ */ e.jsx(X, { asChild: !0, children: /* @__PURE__ */ e.jsx(
|
|
1749
1753
|
"button",
|
|
1750
1754
|
{
|
|
1751
1755
|
type: "button",
|
|
@@ -1756,19 +1760,19 @@ const kr = ({ property: r, onChange: s }) => {
|
|
|
1756
1760
|
/* @__PURE__ */ e.jsx(W, { children: /* @__PURE__ */ e.jsx("div", { className: "text-right", children: /* @__PURE__ */ e.jsxs("div", { children: [
|
|
1757
1761
|
"Current style is set at ",
|
|
1758
1762
|
/* @__PURE__ */ e.jsxs("span", { className: "font-bold ", children: [
|
|
1759
|
-
|
|
1760
|
-
i && !
|
|
1763
|
+
Pr(u(p, "mq")),
|
|
1764
|
+
i && !p.dark ? "(Light mode)" : ""
|
|
1761
1765
|
] }),
|
|
1762
1766
|
/* @__PURE__ */ e.jsx("br", {}),
|
|
1763
1767
|
/* @__PURE__ */ e.jsxs(
|
|
1764
1768
|
"button",
|
|
1765
1769
|
{
|
|
1766
1770
|
type: "button",
|
|
1767
|
-
onClick: () => j(
|
|
1771
|
+
onClick: () => j(u(p, "mq")),
|
|
1768
1772
|
className: "block w-full cursor-default text-right font-semibold text-blue-500",
|
|
1769
1773
|
children: [
|
|
1770
1774
|
"Switch to ",
|
|
1771
|
-
|
|
1775
|
+
u(p, "mq").toUpperCase()
|
|
1772
1776
|
]
|
|
1773
1777
|
}
|
|
1774
1778
|
)
|
|
@@ -1776,48 +1780,48 @@ const kr = ({ property: r, onChange: s }) => {
|
|
|
1776
1780
|
] }) : null })
|
|
1777
1781
|
] })
|
|
1778
1782
|
] }) });
|
|
1779
|
-
},
|
|
1783
|
+
}, Or = ["px", "%", "em", "rem", "ch", "vh", "vw"], st = ({
|
|
1780
1784
|
label: r,
|
|
1781
1785
|
options: s,
|
|
1782
1786
|
borderB: t = !1,
|
|
1783
|
-
borderT:
|
|
1784
|
-
type:
|
|
1785
|
-
units:
|
|
1787
|
+
borderT: a = !1,
|
|
1788
|
+
type: o = "arbitrary",
|
|
1789
|
+
units: n = Or,
|
|
1786
1790
|
negative: d = !1
|
|
1787
1791
|
}) => {
|
|
1788
|
-
const [i,
|
|
1792
|
+
const [i, l] = k(s[0].key), c = ce(), p = I((h) => C(c, "property").includes(h), [c]);
|
|
1789
1793
|
return /* @__PURE__ */ e.jsxs(
|
|
1790
1794
|
"div",
|
|
1791
1795
|
{
|
|
1792
|
-
className: `mb-2 border-gray-800 py-2 first:pt-0 last:pb-0 ${t ? "border-b" : ""} ${
|
|
1796
|
+
className: `mb-2 border-gray-800 py-2 first:pt-0 last:pb-0 ${t ? "border-b" : ""} ${a ? "border-t" : ""}`,
|
|
1793
1797
|
children: [
|
|
1794
1798
|
/* @__PURE__ */ e.jsxs("div", { className: "flex flex-row text-xs", children: [
|
|
1795
1799
|
r && /* @__PURE__ */ e.jsx("span", { className: "relative w-[70px] flex-none text-xs text-foreground", children: r }),
|
|
1796
1800
|
/* @__PURE__ */ e.jsx("div", { className: "mb-3 flex grow flex-row flex-wrap gap-x-px", children: $.Children.toArray(
|
|
1797
|
-
s.map(({ label:
|
|
1798
|
-
/* @__PURE__ */ e.jsx(
|
|
1801
|
+
s.map(({ label: h, key: g }) => /* @__PURE__ */ e.jsx("div", { className: "first:rounded-l last:rounded-r", children: /* @__PURE__ */ e.jsxs(Y, { children: [
|
|
1802
|
+
/* @__PURE__ */ e.jsx(X, { asChild: !0, children: /* @__PURE__ */ e.jsxs(
|
|
1799
1803
|
"button",
|
|
1800
1804
|
{
|
|
1801
1805
|
type: "button",
|
|
1802
|
-
onClick: () =>
|
|
1803
|
-
className: `relative cursor-pointer rounded-full p-1 text-[8px] ${
|
|
1806
|
+
onClick: () => l(g),
|
|
1807
|
+
className: `relative cursor-pointer rounded-full p-1 text-[8px] ${g === i ? " bg-[#3E57F0] text-white" : "text-gray-600 dark:text-gray-300"}`,
|
|
1804
1808
|
children: [
|
|
1805
1809
|
$.createElement("div", {
|
|
1806
|
-
className:
|
|
1810
|
+
className: p(g) ? "-bottom-1.5 absolute bg-[#3E57F0] h-[2px] left-0 w-full" : ""
|
|
1807
1811
|
}),
|
|
1808
|
-
$.createElement(
|
|
1812
|
+
$.createElement(u(rt, g, Ye), { className: "text-inherit w-3 h-3" })
|
|
1809
1813
|
]
|
|
1810
1814
|
}
|
|
1811
1815
|
) }),
|
|
1812
|
-
/* @__PURE__ */ e.jsx(W, { children: Q(ne(
|
|
1816
|
+
/* @__PURE__ */ e.jsx(W, { children: Q(ne(h)) })
|
|
1813
1817
|
] }) }))
|
|
1814
1818
|
) })
|
|
1815
1819
|
] }),
|
|
1816
1820
|
/* @__PURE__ */ e.jsx("div", { className: "mt-0 flex items-center", children: /* @__PURE__ */ e.jsx(
|
|
1817
1821
|
ke,
|
|
1818
1822
|
{
|
|
1819
|
-
type:
|
|
1820
|
-
units: [...
|
|
1823
|
+
type: o,
|
|
1824
|
+
units: [...n],
|
|
1821
1825
|
label: "",
|
|
1822
1826
|
property: i,
|
|
1823
1827
|
negative: d
|
|
@@ -1826,73 +1830,73 @@ const kr = ({ property: r, onChange: s }) => {
|
|
|
1826
1830
|
]
|
|
1827
1831
|
}
|
|
1828
1832
|
);
|
|
1829
|
-
},
|
|
1830
|
-
const t = ce(),
|
|
1831
|
-
const
|
|
1832
|
-
i.map((
|
|
1833
|
-
),
|
|
1834
|
-
s.map((i) => i.styleType === "accordion" ?
|
|
1833
|
+
}, Mr = ({ heading: r, items: s }) => {
|
|
1834
|
+
const t = ce(), a = T(() => {
|
|
1835
|
+
const o = (i) => z(
|
|
1836
|
+
i.map((l) => l.styleType === "multiple" ? C(l.options, "key") : l.property)
|
|
1837
|
+
), n = z(
|
|
1838
|
+
s.map((i) => i.styleType === "accordion" ? o(i.items) : i.styleType === "multiple" ? C(i.options, "key") : i.property)
|
|
1835
1839
|
), d = C(t, "property");
|
|
1836
|
-
return _e(
|
|
1840
|
+
return _e(n, d).length > 0;
|
|
1837
1841
|
}, [t, s]);
|
|
1838
1842
|
return /* @__PURE__ */ e.jsxs("details", { children: [
|
|
1839
1843
|
/* @__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: [
|
|
1840
1844
|
r,
|
|
1841
|
-
|
|
1845
|
+
a ? /* @__PURE__ */ e.jsx(
|
|
1842
1846
|
"span",
|
|
1843
1847
|
{
|
|
1844
|
-
className: `ml-1 mr-2 inline-block h-[8px] w-[8px] rounded-full ${
|
|
1848
|
+
className: `ml-1 mr-2 inline-block h-[8px] w-[8px] rounded-full ${a ? "bg-blue-500" : "bg-gray-300"}`
|
|
1845
1849
|
}
|
|
1846
1850
|
) : null
|
|
1847
1851
|
] }) }),
|
|
1848
|
-
/* @__PURE__ */ e.jsx("div", { className: "p-2", children: s.map((
|
|
1852
|
+
/* @__PURE__ */ e.jsx("div", { className: "p-2", children: s.map((o) => o.styleType === "multiple" ? /* @__PURE__ */ e.jsx(st, { ...o }, o.label) : /* @__PURE__ */ e.jsx(ke, { ...o }, o.label)) })
|
|
1849
1853
|
] });
|
|
1850
|
-
},
|
|
1854
|
+
}, _r = Le({}), ge = ({ section: r }) => {
|
|
1851
1855
|
const s = ce(), t = I(
|
|
1852
|
-
(
|
|
1856
|
+
(n = []) => {
|
|
1853
1857
|
const d = {};
|
|
1854
|
-
for (let
|
|
1855
|
-
d[s[
|
|
1858
|
+
for (let l = 0; l < s.length; l++)
|
|
1859
|
+
d[s[l].property] = s[l].cls;
|
|
1856
1860
|
let i = !0;
|
|
1857
|
-
for (const
|
|
1858
|
-
if (!ue(d,
|
|
1861
|
+
for (const l in n)
|
|
1862
|
+
if (!ue(d, l) || d[l] !== n[l]) {
|
|
1859
1863
|
i = !1;
|
|
1860
1864
|
break;
|
|
1861
1865
|
}
|
|
1862
1866
|
return i;
|
|
1863
1867
|
},
|
|
1864
1868
|
[s]
|
|
1865
|
-
),
|
|
1869
|
+
), a = T(() => {
|
|
1866
1870
|
if (s.length > 0 && r.heading === "Classes")
|
|
1867
1871
|
return !0;
|
|
1868
|
-
const
|
|
1869
|
-
|
|
1872
|
+
const n = (l) => z(
|
|
1873
|
+
l.map((c) => c.styleType === "multiple" ? z(C(c.options, "key")) : c.property)
|
|
1870
1874
|
), d = z(
|
|
1871
|
-
r.items.map((
|
|
1875
|
+
r.items.map((l) => l.styleType === "accordion" ? n(l.items) : l.styleType === "multiple" ? z(C(l.options, "key")) : l.property)
|
|
1872
1876
|
), i = C(s, "property");
|
|
1873
1877
|
return _e(d, i).length > 0;
|
|
1874
|
-
}, [s, r.heading, r.items]),
|
|
1875
|
-
return /* @__PURE__ */ e.jsx(
|
|
1878
|
+
}, [s, r.heading, r.items]), o = T(() => ({}), []);
|
|
1879
|
+
return /* @__PURE__ */ e.jsx(_r.Provider, { value: o, children: /* @__PURE__ */ e.jsxs(ae, { value: r.heading, children: [
|
|
1876
1880
|
/* @__PURE__ */ e.jsx(ie, { className: "px-3 py-2 text-xs hover:no-underline", children: /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-x-2", children: [
|
|
1877
|
-
/* @__PURE__ */ e.jsx("div", { className: `h-[8px] w-[8px] rounded-full ${
|
|
1881
|
+
/* @__PURE__ */ e.jsx("div", { className: `h-[8px] w-[8px] rounded-full ${a ? "bg-blue-500" : "bg-gray-300"}` }),
|
|
1878
1882
|
r.heading
|
|
1879
1883
|
] }) }),
|
|
1880
1884
|
/* @__PURE__ */ e.jsx(de, { className: "bg-gray-100 px-3.5 py-2", children: $.Children.toArray(
|
|
1881
|
-
r.items.map((
|
|
1885
|
+
r.items.map((n) => ue(n, "component") ? $.createElement(n.component, { key: n.label }) : ue(n, "styleType") ? n.styleType === "multiple" ? /* @__PURE__ */ e.jsx(st, { ...n }, n.label) : n.styleType === "accordion" && t(n == null ? void 0 : n.conditions) ? /* @__PURE__ */ e.jsx(Mr, { ...n }, n.label) : null : /* @__PURE__ */ e.jsx(ke, { ...n }, n.label))
|
|
1882
1886
|
) })
|
|
1883
1887
|
] }) });
|
|
1884
|
-
},
|
|
1888
|
+
}, Er = ({
|
|
1885
1889
|
item: r,
|
|
1886
1890
|
index: s,
|
|
1887
1891
|
canDelete: t,
|
|
1888
|
-
onChange:
|
|
1889
|
-
onRemove:
|
|
1892
|
+
onChange: a,
|
|
1893
|
+
onRemove: o
|
|
1890
1894
|
}) => /* @__PURE__ */ e.jsxs("div", { className: `flex flex-col gap-1 border-gray-400 py-2 ${t ? "border-b" : ""}`, children: [
|
|
1891
1895
|
/* @__PURE__ */ e.jsx(
|
|
1892
1896
|
"input",
|
|
1893
1897
|
{
|
|
1894
1898
|
name: "key",
|
|
1895
|
-
onChange: (
|
|
1899
|
+
onChange: (n) => a(n, s),
|
|
1896
1900
|
value: r.key,
|
|
1897
1901
|
placeholder: "Key",
|
|
1898
1902
|
className: "w-full rounded border-gray-300 bg-background p-0.5 pl-2 text-sm focus-visible:outline-0",
|
|
@@ -1905,7 +1909,7 @@ const kr = ({ property: r, onChange: s }) => {
|
|
|
1905
1909
|
"input",
|
|
1906
1910
|
{
|
|
1907
1911
|
name: "value",
|
|
1908
|
-
onChange: (
|
|
1912
|
+
onChange: (n) => f(r.key) ? {} : a(n, s),
|
|
1909
1913
|
value: r.value,
|
|
1910
1914
|
placeholder: "Value",
|
|
1911
1915
|
className: "w-full rounded border-gray-300 bg-background p-0.5 pl-2 text-sm focus-visible:outline-0",
|
|
@@ -1914,32 +1918,32 @@ const kr = ({ property: r, onChange: s }) => {
|
|
|
1914
1918
|
}
|
|
1915
1919
|
),
|
|
1916
1920
|
/* @__PURE__ */ e.jsx(
|
|
1917
|
-
|
|
1921
|
+
Xe,
|
|
1918
1922
|
{
|
|
1919
|
-
onClick:
|
|
1923
|
+
onClick: o,
|
|
1920
1924
|
className: "h-6 w-6 cursor-pointer rounded border border-red-400 p-1 text-red-400 hover:opacity-80"
|
|
1921
1925
|
}
|
|
1922
1926
|
)
|
|
1923
1927
|
] })
|
|
1924
|
-
] }),
|
|
1925
|
-
var
|
|
1926
|
-
const { setSyncState: s } =
|
|
1928
|
+
] }), Fr = ({ section: r }) => {
|
|
1929
|
+
var g;
|
|
1930
|
+
const { setSyncState: s } = Yt(), t = te(), [a, o] = k([]), [n] = je(), d = ze(), i = `${u(n, "0.prop")}_attrs`;
|
|
1927
1931
|
se.useEffect(() => {
|
|
1928
|
-
const
|
|
1929
|
-
|
|
1930
|
-
}, [
|
|
1931
|
-
const
|
|
1932
|
-
const
|
|
1933
|
-
|
|
1934
|
-
},
|
|
1935
|
-
const v = [...
|
|
1936
|
-
v[
|
|
1937
|
-
},
|
|
1938
|
-
(
|
|
1939
|
-
const
|
|
1940
|
-
|
|
1941
|
-
|
|
1942
|
-
}), d([
|
|
1932
|
+
const y = C(u(t, i), (x, v) => ({ key: v, value: x }));
|
|
1933
|
+
f(y) ? o([]) : o(y);
|
|
1934
|
+
}, [u(t, i)]);
|
|
1935
|
+
const l = () => o([...a, { key: "", value: "" }]), c = (y) => {
|
|
1936
|
+
const x = Oe(a, (v, L) => y !== L);
|
|
1937
|
+
h(x);
|
|
1938
|
+
}, p = (y, x) => {
|
|
1939
|
+
const v = [...a];
|
|
1940
|
+
v[x][y.target.name] = y.target.value, h(v);
|
|
1941
|
+
}, h = se.useCallback(
|
|
1942
|
+
(y = []) => {
|
|
1943
|
+
const x = {};
|
|
1944
|
+
be(y, (v) => {
|
|
1945
|
+
f(v.key) || Pe(x, v.key, v.value);
|
|
1946
|
+
}), d([u(t, "_id")], { [i]: x }), s("UNSAVED");
|
|
1943
1947
|
},
|
|
1944
1948
|
[t, s, d, i]
|
|
1945
1949
|
);
|
|
@@ -1948,7 +1952,7 @@ const kr = ({ property: r, onChange: s }) => {
|
|
|
1948
1952
|
/* @__PURE__ */ e.jsx(
|
|
1949
1953
|
"div",
|
|
1950
1954
|
{
|
|
1951
|
-
className: `h-[8px] w-[8px] rounded-full ${
|
|
1955
|
+
className: `h-[8px] w-[8px] rounded-full ${f(u(t, i)) ? "bg-gray-300" : "bg-blue-500"}`
|
|
1952
1956
|
}
|
|
1953
1957
|
),
|
|
1954
1958
|
"Attributes"
|
|
@@ -1959,10 +1963,10 @@ const kr = ({ property: r, onChange: s }) => {
|
|
|
1959
1963
|
/* @__PURE__ */ e.jsxs(
|
|
1960
1964
|
"div",
|
|
1961
1965
|
{
|
|
1962
|
-
className: `flex h-6 w-max items-center justify-center gap-x-0.5 rounded-full border p-1 px-2 text-xs ${!
|
|
1966
|
+
className: `flex h-6 w-max items-center justify-center gap-x-0.5 rounded-full border p-1 px-2 text-xs ${!f(a) && f((g = he(a)) == null ? void 0 : g.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"}`,
|
|
1963
1967
|
onClick: () => {
|
|
1964
|
-
var
|
|
1965
|
-
!
|
|
1968
|
+
var y;
|
|
1969
|
+
!f(a) && f((y = he(a)) == null ? void 0 : y.key) || l();
|
|
1966
1970
|
},
|
|
1967
1971
|
children: [
|
|
1968
1972
|
/* @__PURE__ */ e.jsx(ve, { width: 12, height: 12 }),
|
|
@@ -1972,18 +1976,18 @@ const kr = ({ property: r, onChange: s }) => {
|
|
|
1972
1976
|
)
|
|
1973
1977
|
] }),
|
|
1974
1978
|
/* @__PURE__ */ e.jsxs("div", { className: "flex flex-col", children: [
|
|
1975
|
-
|
|
1979
|
+
f(a) && /* @__PURE__ */ e.jsx("div", { className: "flex h-12 items-center justify-center text-sm text-gray-400", children: "Click + Add to add attributes" }),
|
|
1976
1980
|
se.Children.toArray(
|
|
1977
|
-
C(
|
|
1978
|
-
const v =
|
|
1981
|
+
C(a, (y, x) => {
|
|
1982
|
+
const v = a.length > 0 && x < a.length - 1;
|
|
1979
1983
|
return /* @__PURE__ */ e.jsx(
|
|
1980
|
-
|
|
1984
|
+
Er,
|
|
1981
1985
|
{
|
|
1982
|
-
item:
|
|
1983
|
-
index:
|
|
1986
|
+
item: y,
|
|
1987
|
+
index: x,
|
|
1984
1988
|
canDelete: v,
|
|
1985
|
-
onChange:
|
|
1986
|
-
onRemove: () =>
|
|
1989
|
+
onChange: p,
|
|
1990
|
+
onRemove: () => c(x)
|
|
1987
1991
|
}
|
|
1988
1992
|
);
|
|
1989
1993
|
})
|
|
@@ -1992,11 +1996,11 @@ const kr = ({ property: r, onChange: s }) => {
|
|
|
1992
1996
|
] }) })
|
|
1993
1997
|
] });
|
|
1994
1998
|
};
|
|
1995
|
-
function
|
|
1996
|
-
const [r, s] = qe(), { flexChild: t, gridChild:
|
|
1997
|
-
return
|
|
1999
|
+
function Yr() {
|
|
2000
|
+
const [r, s] = qe(), { flexChild: t, gridChild: a } = Xt(), [, o] = rr(Wt), { t: n } = Ee(), [d] = je();
|
|
2001
|
+
return f(d) ? /* @__PURE__ */ e.jsx("div", { className: "p-4 text-center", children: /* @__PURE__ */ e.jsxs("div", { className: "space-y-4 rounded-xl p-4", children: [
|
|
1998
2002
|
/* @__PURE__ */ e.jsx(We, { className: "mx-auto text-3xl" }),
|
|
1999
|
-
/* @__PURE__ */ e.jsx("h1", { children:
|
|
2003
|
+
/* @__PURE__ */ e.jsx("h1", { children: n("no_styling_block_selected") }),
|
|
2000
2004
|
/* @__PURE__ */ e.jsxs("p", { className: "text-xs ", children: [
|
|
2001
2005
|
"Hint: Styling allowed blocks are highlighted with",
|
|
2002
2006
|
" ",
|
|
@@ -2005,12 +2009,12 @@ function Fr() {
|
|
|
2005
2009
|
] })
|
|
2006
2010
|
] }) }) : (
|
|
2007
2011
|
// eslint-disable-next-line jsx-a11y/click-events-have-key-events,jsx-a11y/no-static-element-interactions
|
|
2008
|
-
/* @__PURE__ */ e.jsxs("div", { onClick: () =>
|
|
2012
|
+
/* @__PURE__ */ e.jsxs("div", { onClick: () => o(!1), className: "flex h-full flex-col", children: [
|
|
2009
2013
|
/* @__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: [
|
|
2010
2014
|
/* @__PURE__ */ e.jsx(Ce, { htmlFor: "", className: "flex gap-x-1.5 text-xs italic", children: "State" }),
|
|
2011
|
-
/* @__PURE__ */ e.jsxs(
|
|
2012
|
-
/* @__PURE__ */ e.jsx(
|
|
2013
|
-
/* @__PURE__ */ e.jsxs(
|
|
2015
|
+
/* @__PURE__ */ e.jsxs(dr, { defaultValue: r, onValueChange: (i) => s(i), children: [
|
|
2016
|
+
/* @__PURE__ */ e.jsx(cr, { className: "h-auto w-fit p-1 px-3", children: /* @__PURE__ */ e.jsx(pr, { placeholder: "State" }) }),
|
|
2017
|
+
/* @__PURE__ */ e.jsxs(ur, { children: [
|
|
2014
2018
|
/* @__PURE__ */ e.jsx(A, { value: "", children: "Normal" }),
|
|
2015
2019
|
/* @__PURE__ */ e.jsx(A, { value: "hover", children: "Hover" }),
|
|
2016
2020
|
/* @__PURE__ */ e.jsx(A, { value: "active", children: "Active" }),
|
|
@@ -2026,12 +2030,12 @@ function Fr() {
|
|
|
2026
2030
|
] })
|
|
2027
2031
|
] })
|
|
2028
2032
|
] }) }),
|
|
2029
|
-
/* @__PURE__ */ e.jsxs(
|
|
2033
|
+
/* @__PURE__ */ e.jsxs(ir, { className: "no-scrollbar -mx-1 h-full overflow-x-hidden", children: [
|
|
2030
2034
|
/* @__PURE__ */ e.jsxs(tt, { type: "multiple", className: "h-full w-full", children: [
|
|
2031
|
-
t && /* @__PURE__ */ e.jsx(ge, { section:
|
|
2032
|
-
|
|
2033
|
-
|
|
2034
|
-
/* @__PURE__ */ e.jsx(
|
|
2035
|
+
t && /* @__PURE__ */ e.jsx(ge, { section: wr }),
|
|
2036
|
+
a ? /* @__PURE__ */ e.jsx(ge, { section: jr }) : null,
|
|
2037
|
+
Cr.map((i) => /* @__PURE__ */ e.jsx(ge, { section: i }, i.heading)),
|
|
2038
|
+
/* @__PURE__ */ e.jsx(Fr, { section: { heading: "Attributes" } })
|
|
2035
2039
|
] }),
|
|
2036
2040
|
/* @__PURE__ */ e.jsx("div", { className: "h-60" })
|
|
2037
2041
|
] })
|
|
@@ -2050,9 +2054,9 @@ const Xr = {
|
|
|
2050
2054
|
deg: 1,
|
|
2051
2055
|
ms: 0.1
|
|
2052
2056
|
}, Xl = () => {
|
|
2053
|
-
const r = te(), { t: s } = Ee(), [t,
|
|
2054
|
-
onDrag: (
|
|
2055
|
-
onDragEnd: (
|
|
2057
|
+
const r = te(), { t: s } = Ee(), [t, a] = $.useState(""), [o, n] = $.useState({
|
|
2058
|
+
onDrag: (l) => l,
|
|
2059
|
+
onDragEnd: (l) => l,
|
|
2056
2060
|
dragStartY: 0,
|
|
2057
2061
|
dragging: !1,
|
|
2058
2062
|
dragStartValue: 0,
|
|
@@ -2060,21 +2064,21 @@ const Xr = {
|
|
|
2060
2064
|
negative: !1,
|
|
2061
2065
|
cssProperty: ""
|
|
2062
2066
|
}), d = xe(
|
|
2063
|
-
(
|
|
2064
|
-
const
|
|
2065
|
-
let
|
|
2066
|
-
|
|
2067
|
-
let
|
|
2068
|
-
(Z(
|
|
2069
|
-
let
|
|
2070
|
-
|
|
2067
|
+
(l) => {
|
|
2068
|
+
const c = !u(o, "negative", !1), p = u(o, "cssProperty", "");
|
|
2069
|
+
let h = parseFloat(o.dragStartValue);
|
|
2070
|
+
h = Me(h) ? 0 : h;
|
|
2071
|
+
let g = Xr[o.dragUnit];
|
|
2072
|
+
(Z(p, "scale") || p === "opacity") && (g = 10);
|
|
2073
|
+
let x = (o.dragStartY - l.pageY) / g + h;
|
|
2074
|
+
c && x < 0 && (x = 0), p === "opacity" && x > 1 && (x = 1), o.onDrag(`${x}`), a(`${x}`);
|
|
2071
2075
|
},
|
|
2072
|
-
[
|
|
2076
|
+
[o],
|
|
2073
2077
|
50
|
|
2074
2078
|
), i = I(() => {
|
|
2075
|
-
setTimeout(() =>
|
|
2076
|
-
onDrag: (
|
|
2077
|
-
onDragEnd: (
|
|
2079
|
+
setTimeout(() => o.onDragEnd(`${t}`), 100), n({
|
|
2080
|
+
onDrag: (l) => l,
|
|
2081
|
+
onDragEnd: (l) => l,
|
|
2078
2082
|
dragStartY: 0,
|
|
2079
2083
|
dragging: !1,
|
|
2080
2084
|
dragStartValue: 0,
|
|
@@ -2082,12 +2086,12 @@ const Xr = {
|
|
|
2082
2086
|
negative: !1,
|
|
2083
2087
|
cssProperty: ""
|
|
2084
2088
|
});
|
|
2085
|
-
}, [
|
|
2086
|
-
return
|
|
2089
|
+
}, [o, t, n]);
|
|
2090
|
+
return yt(r) ? /* @__PURE__ */ e.jsx("div", { className: "p-4 text-center", children: /* @__PURE__ */ e.jsxs("div", { className: "space-y-4 rounded-xl p-4", children: [
|
|
2087
2091
|
/* @__PURE__ */ e.jsx(We, { className: "mx-auto text-3xl" }),
|
|
2088
2092
|
/* @__PURE__ */ e.jsx("h1", { children: s("no_block_selected_for_styling") })
|
|
2089
|
-
] }) }) : /* @__PURE__ */ e.jsxs(ot.Provider, { value: { setDragData:
|
|
2090
|
-
|
|
2093
|
+
] }) }) : /* @__PURE__ */ e.jsxs(ot.Provider, { value: { setDragData: n }, children: [
|
|
2094
|
+
o.dragging ? /* @__PURE__ */ e.jsx(
|
|
2091
2095
|
"div",
|
|
2092
2096
|
{
|
|
2093
2097
|
onMouseMove: d,
|
|
@@ -2108,7 +2112,7 @@ const Xr = {
|
|
|
2108
2112
|
children: /* @__PURE__ */ e.jsx(fr, {})
|
|
2109
2113
|
}
|
|
2110
2114
|
),
|
|
2111
|
-
/* @__PURE__ */ e.jsx(Ve, { value: "styling", className: "flex-1 overflow-y-auto overflow-x-hidden", children: /* @__PURE__ */ e.jsx(
|
|
2115
|
+
/* @__PURE__ */ e.jsx(Ve, { value: "styling", className: "flex-1 overflow-y-auto overflow-x-hidden", children: /* @__PURE__ */ e.jsx(Yr, {}) })
|
|
2112
2116
|
] })
|
|
2113
2117
|
] });
|
|
2114
2118
|
};
|