@chaibuilder/sdk 0.1.23 → 0.1.25
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-2e763e41.cjs +3 -0
- package/dist/{AddBlocks-189ba69a.js → AddBlocks-340542cc.js} +13 -14
- package/dist/{BrandingOptions-e659a7bf.cjs → BrandingOptions-93298418.cjs} +1 -1
- package/dist/{BrandingOptions-c01e08fc.js → BrandingOptions-da602397.js} +1 -1
- package/dist/{CanvasArea-9106ecb5.js → CanvasArea-0ba49a92.js} +2 -2
- package/dist/{CanvasArea-933848fb.cjs → CanvasArea-20982a8b.cjs} +2 -2
- package/dist/{CurrentPage-37d2f495.js → CurrentPage-41e66713.js} +1 -1
- package/dist/{CurrentPage-92d8bfe0.cjs → CurrentPage-7c0e986b.cjs} +1 -1
- package/dist/{Layers-c08aa961.js → Layers-15b9cf48.js} +2 -2
- package/dist/{Layers-94aeb9f0.cjs → Layers-cc22fb98.cjs} +1 -1
- package/dist/{MarkAsGlobalBlock-10422d13.js → MarkAsGlobalBlock-143a204d.js} +1 -1
- package/dist/{MarkAsGlobalBlock-07cb6760.cjs → MarkAsGlobalBlock-4f9dad50.cjs} +1 -1
- package/dist/{PagesPanel-be499af0.js → PagesPanel-29e8ff05.js} +2 -2
- package/dist/{PagesPanel-e4807890.cjs → PagesPanel-6dbcc705.cjs} +1 -1
- package/dist/{ProjectPanel-fd948934.js → ProjectPanel-0cf59dff.js} +2 -2
- package/dist/{ProjectPanel-0478c85b.cjs → ProjectPanel-e3ecad42.cjs} +1 -1
- package/dist/{Settings-94b79852.js → Settings-5df6bc31.js} +450 -449
- package/dist/Settings-ae8b67c5.cjs +1 -0
- package/dist/SidePanels-7c31e973.js +329 -0
- package/dist/SidePanels-fbf3d99d.cjs +1 -0
- package/dist/{Topbar-d6382110.cjs → Topbar-506281be.cjs} +1 -1
- package/dist/{Topbar-0542b5f4.js → Topbar-f6d0676d.js} +1 -1
- package/dist/{add-page-modal-6132fdff.cjs → add-page-modal-87e921d2.cjs} +1 -1
- package/dist/{add-page-modal-36a6b406.js → add-page-modal-f7b31884.js} +1 -1
- package/dist/core.cjs +1 -1
- package/dist/core.js +1 -1
- package/dist/{delete-page-modal-87c48560.cjs → delete-page-modal-8cfafe5d.cjs} +1 -1
- package/dist/{delete-page-modal-68a4d71e.js → delete-page-modal-afc5ac26.js} +1 -1
- package/dist/{index-6f5cce76.cjs → index-cbeea3bc.cjs} +18 -18
- package/dist/{index-c49887fe.js → index-d1a25967.js} +6 -6
- package/dist/{page-viewer-47098c44.cjs → page-viewer-9b33c8bb.cjs} +1 -1
- package/dist/{page-viewer-d87e5621.js → page-viewer-f651f579.js} +2 -2
- package/dist/{project-general-setting-869887d5.cjs → project-general-setting-0ceca7f5.cjs} +1 -1
- package/dist/{project-general-setting-91df16a9.js → project-general-setting-15cad783.js} +1 -1
- package/dist/render.cjs +1 -1
- package/dist/render.d.ts +2 -4
- package/dist/render.js +59 -67
- package/dist/server.cjs +1 -1
- package/dist/server.d.ts +1 -1
- package/dist/server.js +36 -36
- package/dist/{single-page-detail-4a424725.js → single-page-detail-8d4fb1c8.js} +2 -2
- package/dist/{single-page-detail-1b276c4f.cjs → single-page-detail-ae2a5b54.cjs} +1 -1
- package/dist/textarea-0750bcd2.js +73 -0
- package/dist/textarea-a338ede6.cjs +1 -0
- package/dist/ui.cjs +1 -1
- package/dist/ui.js +72 -73
- package/package.json +4 -4
- package/dist/AddBlocks-36adcc50.cjs +0 -3
- package/dist/Settings-6cb217af.cjs +0 -1
- package/dist/SidePanels-4434d31b.cjs +0 -1
- package/dist/SidePanels-78d8de19.js +0 -246
- package/dist/card-14e1d020.cjs +0 -1
- package/dist/card-f8f4f985.js +0 -33
- package/dist/textarea-20b2f6b2.cjs +0 -1
- package/dist/textarea-9dfb6a32.js +0 -45
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { j as e } from "./jsx-runtime-944c88e2.js";
|
|
2
2
|
import * as se from "react";
|
|
3
|
-
import
|
|
3
|
+
import P, { useState as k, useEffect as M, useMemo as R, useCallback as L, createContext as Pe, useContext as ee } from "react";
|
|
4
4
|
import { useThrottledCallback as xe } from "@react-hookz/web";
|
|
5
|
-
import { map as
|
|
5
|
+
import { map as N, isEmpty as b, last as he, forEach as be, set as Le, 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 bt, EyeClosedIcon as Te, BorderAllIcon as
|
|
8
|
-
import { T as It, a as
|
|
9
|
-
import
|
|
7
|
+
import { PlusIcon as ve, Cross2Icon as Fe, EyeOpenIcon as bt, EyeClosedIcon as Te, BorderAllIcon as E, WidthIcon as H, HeightIcon as V, 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 Ht, LetterCaseUppercaseIcon as Vt, 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
|
+
import { T as It, a as Pt, b as Re, c as He } from "./tabs-85caa1e8.js";
|
|
9
|
+
import Lt 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
|
|
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 Ve, N as ce, c as Yt, O as Xt, P as Wt } from "./index-d1a25967.js";
|
|
12
12
|
import { getChaiDataProviders as Zt, getBlockComponent as Je, SingleLineText as zt } from "@chaibuilder/blocks";
|
|
13
13
|
import { TrashIcon as Ut, ChevronRight as Gt } from "lucide-react";
|
|
14
14
|
import Qe from "react-autosuggest";
|
|
@@ -53,89 +53,90 @@ import "himalaya";
|
|
|
53
53
|
import "@radix-ui/react-label";
|
|
54
54
|
import "@radix-ui/react-select";
|
|
55
55
|
function gr(r) {
|
|
56
|
-
const
|
|
57
|
-
function a(
|
|
58
|
-
be(
|
|
59
|
-
const
|
|
60
|
-
|
|
56
|
+
const o = [], t = {};
|
|
57
|
+
function a(l, s) {
|
|
58
|
+
be(s, (d, i) => {
|
|
59
|
+
const n = l ? `${l}.${i}` : i, p = me(d) ? "list" : typeof d;
|
|
60
|
+
o.push(n), t[n] = p === "string" ? "text" : p === "object" ? "model" : p, p === "object" && !me(d) && a(n, d);
|
|
61
61
|
});
|
|
62
62
|
}
|
|
63
|
-
return a("", at(r, ["styles", "_type", "_id", "_name", "_bindings"])), { paths:
|
|
63
|
+
return a("", at(r, ["styles", "_type", "_id", "_name", "_bindings"])), { paths: o, pathsType: t };
|
|
64
64
|
}
|
|
65
65
|
const xr = ({ data: r }) => {
|
|
66
66
|
if (!r)
|
|
67
67
|
return null;
|
|
68
|
-
const
|
|
69
|
-
return /* @__PURE__ */ e.jsx("div", { className: "text-[10px] text-gray-800/50 leading-3 whitespace-nowrap overflow-hidden w-full", children: it(
|
|
68
|
+
const o = typeof r;
|
|
69
|
+
return /* @__PURE__ */ e.jsx("div", { className: "text-[10px] text-gray-800/50 leading-3 whitespace-nowrap overflow-hidden w-full", children: it(o === "object" ? JSON.stringify(r) : r, { length: 40 }) });
|
|
70
70
|
}, Be = ({
|
|
71
71
|
type: r,
|
|
72
|
-
isDisabled:
|
|
72
|
+
isDisabled: o = !1,
|
|
73
73
|
placeholder: t,
|
|
74
74
|
defaultValue: a = "",
|
|
75
|
-
data:
|
|
76
|
-
onChange:
|
|
75
|
+
data: l,
|
|
76
|
+
onChange: s,
|
|
77
77
|
dataType: d,
|
|
78
78
|
appliedBindings: i
|
|
79
79
|
}) => {
|
|
80
|
-
const [
|
|
80
|
+
const [n, p] = k(!1), [c, h] = k(a), { paths: g, pathsType: y } = gr(l), x = r === "PROP" ? Je(l == null ? void 0 : l._type) : {};
|
|
81
81
|
M(() => {
|
|
82
|
-
|
|
83
|
-
}, [
|
|
84
|
-
const
|
|
85
|
-
const
|
|
86
|
-
return r === "PATH" ?
|
|
87
|
-
}), [
|
|
88
|
-
M(() =>
|
|
89
|
-
const
|
|
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
90
|
autoComplete: "off",
|
|
91
91
|
autoCorrect: "on",
|
|
92
92
|
autoCapitalize: "off",
|
|
93
93
|
spellCheck: !1,
|
|
94
|
-
placeholder: t,
|
|
95
|
-
value:
|
|
96
|
-
disabled:
|
|
94
|
+
placeholder: j ? "No available options" : t,
|
|
95
|
+
value: c,
|
|
96
|
+
disabled: o,
|
|
97
|
+
onFocus: () => p(r === "PATH"),
|
|
97
98
|
onBlur: () => {
|
|
98
|
-
p.includes(
|
|
99
|
+
p(!1), g.includes(c) ? s(c) : (h(""), s(""));
|
|
99
100
|
},
|
|
100
|
-
onChange: (
|
|
101
|
-
className: `chai-input w-full ${
|
|
102
|
-
},
|
|
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(
|
|
103
104
|
"div",
|
|
104
105
|
{
|
|
105
106
|
className: "rounded-md px-1 py-1.5 flex items-center justify-between space-x-2 font-light relative",
|
|
106
|
-
"data-suggest":
|
|
107
|
+
"data-suggest": v,
|
|
107
108
|
children: [
|
|
108
|
-
/* @__PURE__ */ e.jsx("div", { className: "-mt-1 w-full h-full absolute opacity-0 z-20", children:
|
|
109
|
+
/* @__PURE__ */ e.jsx("div", { className: "-mt-1 w-full h-full absolute opacity-0 z-20", children: v }),
|
|
109
110
|
/* @__PURE__ */ e.jsxs("div", { className: "w-full", children: [
|
|
110
|
-
/* @__PURE__ */ e.jsx("div", { className: "leading-4 text-xs flex items-center text-gray-800", children:
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
Q(
|
|
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)
|
|
114
115
|
] }))
|
|
115
116
|
) }),
|
|
116
|
-
r === "PATH" && /* @__PURE__ */ e.jsx(xr, { data: u(
|
|
117
|
+
r === "PATH" && /* @__PURE__ */ e.jsx(xr, { data: u(l, v) })
|
|
117
118
|
] }),
|
|
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(
|
|
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, "")) })
|
|
119
120
|
]
|
|
120
121
|
}
|
|
121
122
|
);
|
|
122
123
|
return /* @__PURE__ */ e.jsx(
|
|
123
124
|
Qe,
|
|
124
125
|
{
|
|
125
|
-
suggestions:
|
|
126
|
-
onSuggestionsFetchRequested: () =>
|
|
127
|
-
onSuggestionsClearRequested: () =>
|
|
128
|
-
onSuggestionSelected: (
|
|
129
|
-
if (
|
|
130
|
-
const
|
|
131
|
-
|
|
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);
|
|
132
133
|
} else
|
|
133
|
-
|
|
134
|
+
s(v.target.value);
|
|
134
135
|
},
|
|
135
|
-
getSuggestionValue: (
|
|
136
|
-
renderSuggestion:
|
|
136
|
+
getSuggestionValue: (v) => v,
|
|
137
|
+
renderSuggestion: B,
|
|
137
138
|
shouldRenderSuggestions: () => !0,
|
|
138
|
-
inputProps:
|
|
139
|
+
inputProps: I,
|
|
139
140
|
containerProps: { className: "w-full" },
|
|
140
141
|
theme: {
|
|
141
142
|
suggestion: "text-gray-500 border-b overflow-hidden text-ellipsis",
|
|
@@ -146,25 +147,25 @@ const xr = ({ data: r }) => {
|
|
|
146
147
|
);
|
|
147
148
|
}, hr = ({
|
|
148
149
|
item: r,
|
|
149
|
-
onChange:
|
|
150
|
+
onChange: o,
|
|
150
151
|
onRemove: t,
|
|
151
152
|
selectedBlock: a,
|
|
152
|
-
dataProvider:
|
|
153
|
-
appliedBindings:
|
|
153
|
+
dataProvider: l,
|
|
154
|
+
appliedBindings: s
|
|
154
155
|
}) => {
|
|
155
|
-
const [d, i] = k("string"),
|
|
156
|
-
if (
|
|
156
|
+
const [d, i] = k("string"), n = (p, c) => {
|
|
157
|
+
if (b(p))
|
|
157
158
|
return "";
|
|
158
159
|
{
|
|
159
|
-
const h = u(
|
|
160
|
+
const h = u(c === "PROP" ? a : l, p, "");
|
|
160
161
|
if (me(h))
|
|
161
162
|
return "list";
|
|
162
163
|
const g = typeof h;
|
|
163
164
|
return g === "string" ? "text" : g === "object" ? "model" : g;
|
|
164
165
|
}
|
|
165
166
|
};
|
|
166
|
-
return M(() => i(() =>
|
|
167
|
-
!
|
|
167
|
+
return M(() => i(() => n(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: [
|
|
168
|
+
!b(d) && !b(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
169
|
/* @__PURE__ */ e.jsx(
|
|
169
170
|
Be,
|
|
170
171
|
{
|
|
@@ -172,13 +173,13 @@ const xr = ({ data: r }) => {
|
|
|
172
173
|
isDisabled: !1,
|
|
173
174
|
placeholder: "Enter prop key",
|
|
174
175
|
defaultValue: r.key,
|
|
175
|
-
onChange: (
|
|
176
|
-
const
|
|
177
|
-
|
|
176
|
+
onChange: (p) => {
|
|
177
|
+
const c = n(p, "PROP");
|
|
178
|
+
o({ target: { name: "key", value: p } }), d !== c && o({ target: { name: "value", value: "" } }), i(c);
|
|
178
179
|
},
|
|
179
180
|
data: a,
|
|
180
181
|
dataType: d,
|
|
181
|
-
appliedBindings:
|
|
182
|
+
appliedBindings: s
|
|
182
183
|
}
|
|
183
184
|
),
|
|
184
185
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-start justify-between gap-x-1.5 w-full relative", children: [
|
|
@@ -186,16 +187,16 @@ const xr = ({ data: r }) => {
|
|
|
186
187
|
Be,
|
|
187
188
|
{
|
|
188
189
|
type: "PATH",
|
|
189
|
-
isDisabled:
|
|
190
|
+
isDisabled: b(r.key),
|
|
190
191
|
placeholder: "Enter data path",
|
|
191
192
|
defaultValue: r.value,
|
|
192
|
-
onChange: (
|
|
193
|
-
const
|
|
194
|
-
|
|
193
|
+
onChange: (p) => {
|
|
194
|
+
const c = n(p, "PATH");
|
|
195
|
+
o(d !== c ? { target: { name: "value", value: "" } } : { target: { name: "value", value: p } });
|
|
195
196
|
},
|
|
196
|
-
data:
|
|
197
|
+
data: l,
|
|
197
198
|
dataType: d,
|
|
198
|
-
appliedBindings:
|
|
199
|
+
appliedBindings: s
|
|
199
200
|
}
|
|
200
201
|
),
|
|
201
202
|
/* @__PURE__ */ e.jsx(
|
|
@@ -207,51 +208,51 @@ const xr = ({ data: r }) => {
|
|
|
207
208
|
)
|
|
208
209
|
] })
|
|
209
210
|
] });
|
|
210
|
-
}, mr = ({ bindingData: r, onChange:
|
|
211
|
-
const t = te(), [a] = Kt(),
|
|
211
|
+
}, mr = ({ bindingData: r, onChange: o }) => {
|
|
212
|
+
const t = te(), [a] = Kt(), l = Zt(), [s, d] = k(N(r, (g, y) => ({ key: y, value: g })));
|
|
212
213
|
M(() => {
|
|
213
|
-
d(
|
|
214
|
+
d(N(r, (g, y) => ({ key: y, value: g })));
|
|
214
215
|
}, [t == null ? void 0 : t._id]);
|
|
215
|
-
const i =
|
|
216
|
-
if (
|
|
216
|
+
const i = R(() => {
|
|
217
|
+
if (b(s))
|
|
217
218
|
return !1;
|
|
218
|
-
const g = he(
|
|
219
|
-
return
|
|
220
|
-
}, [
|
|
221
|
-
d([...
|
|
222
|
-
},
|
|
223
|
-
const y = Oe(
|
|
219
|
+
const g = he(s);
|
|
220
|
+
return b(g == null ? void 0 : g.key) || b(g == null ? void 0 : g.value);
|
|
221
|
+
}, [s]), n = () => {
|
|
222
|
+
d([...s, { key: "", value: "" }]);
|
|
223
|
+
}, p = (g) => {
|
|
224
|
+
const y = Oe(s, (x, f) => g !== f);
|
|
224
225
|
h([...y]);
|
|
225
|
-
},
|
|
226
|
-
const x = [...
|
|
226
|
+
}, c = (g, y) => {
|
|
227
|
+
const x = [...s];
|
|
227
228
|
x[y][g.target.name] = g.target.value, h(x);
|
|
228
|
-
}, h =
|
|
229
|
+
}, h = L(
|
|
229
230
|
(g = []) => {
|
|
230
|
-
if (d(g),
|
|
231
|
-
|
|
231
|
+
if (d(g), b(g)) {
|
|
232
|
+
o({});
|
|
232
233
|
return;
|
|
233
234
|
}
|
|
234
235
|
const y = {};
|
|
235
236
|
be(g, (x) => {
|
|
236
|
-
!
|
|
237
|
-
}),
|
|
237
|
+
!b(x == null ? void 0 : x.key) && !b(x == null ? void 0 : x.value) && Le(y, x.key, x.value);
|
|
238
|
+
}), o(y);
|
|
238
239
|
},
|
|
239
240
|
[t]
|
|
240
241
|
);
|
|
241
|
-
return
|
|
242
|
+
return b(l) ? /* @__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
243
|
"You have no data providers registered. Please add a data provider to your project. ",
|
|
243
244
|
/* @__PURE__ */ e.jsx("br", {}),
|
|
244
245
|
/* @__PURE__ */ e.jsx("a", { className: "text-blue-500", href: "https://chaibuilder.com/docs/registering-data-providers", target: "_blank", children: "Learn more" })
|
|
245
246
|
] }) }) : /* @__PURE__ */ e.jsxs("div", { className: "space-y-2", children: [
|
|
246
|
-
|
|
247
|
+
N(s, (g, y) => /* @__PURE__ */ e.jsx(
|
|
247
248
|
hr,
|
|
248
249
|
{
|
|
249
250
|
item: g,
|
|
250
|
-
onChange: (x) =>
|
|
251
|
-
onRemove: () =>
|
|
251
|
+
onChange: (x) => c(x, y),
|
|
252
|
+
onRemove: () => p(y),
|
|
252
253
|
selectedBlock: t,
|
|
253
254
|
dataProvider: a,
|
|
254
|
-
appliedBindings:
|
|
255
|
+
appliedBindings: N(s, "key")
|
|
255
256
|
},
|
|
256
257
|
g.key
|
|
257
258
|
)),
|
|
@@ -259,30 +260,30 @@ const xr = ({ data: r }) => {
|
|
|
259
260
|
/* @__PURE__ */ e.jsx(X, { className: "w-full", children: /* @__PURE__ */ e.jsx(
|
|
260
261
|
"button",
|
|
261
262
|
{
|
|
262
|
-
onClick:
|
|
263
|
+
onClick: n,
|
|
263
264
|
disabled: i,
|
|
264
|
-
className: `w-full px-5 py-1.5 text-xs rounded-md font-medium duration-200 ${
|
|
265
|
+
className: `w-full px-5 py-1.5 text-xs rounded-md font-medium duration-200 ${b(s) ? "bg-blue-700/20 text-blue-800 hover:bg-blue-700/30 " : ""} ${i ? "cursor-not-allowed bg-gray-200 text-gray-400" : b(s) ? "" : "bg-gray-700/20 text-gray-800 hover:bg-blue-700/30"}`,
|
|
265
266
|
children: "+ Add Data Binding"
|
|
266
267
|
}
|
|
267
268
|
) }),
|
|
268
|
-
i && /* @__PURE__ */ e.jsx(W, { sideOffset:
|
|
269
|
+
i && /* @__PURE__ */ e.jsx(W, { sideOffset: -55, className: "text-[11px]", children: "Complete last added data binding to add more" })
|
|
269
270
|
] })
|
|
270
271
|
] });
|
|
271
272
|
}, 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 = ({
|
|
272
273
|
createHistorySnapshot: r,
|
|
273
|
-
properties:
|
|
274
|
+
properties: o,
|
|
274
275
|
formData: t,
|
|
275
276
|
onChange: a
|
|
276
277
|
}) => {
|
|
277
|
-
const [
|
|
278
|
-
return Object.keys(
|
|
279
|
-
const
|
|
280
|
-
if (O(["slot", "styles"],
|
|
278
|
+
const [l] = Mt(), s = { type: "object", properties: {} }, d = {};
|
|
279
|
+
return Object.keys(o).forEach((i) => {
|
|
280
|
+
const n = o[i];
|
|
281
|
+
if (O(["slot", "styles"], n.type))
|
|
281
282
|
return;
|
|
282
|
-
const
|
|
283
|
-
|
|
283
|
+
const p = u(n, "i18n", !1) ? `${i}-${l}` : i;
|
|
284
|
+
s.properties[p] = _t(n, l), d[p] = Et(n, l);
|
|
284
285
|
}), /* @__PURE__ */ e.jsx(
|
|
285
|
-
|
|
286
|
+
Lt,
|
|
286
287
|
{
|
|
287
288
|
widgets: {
|
|
288
289
|
binding: br,
|
|
@@ -301,36 +302,36 @@ const xr = ({ data: r }) => {
|
|
|
301
302
|
validator: Ot,
|
|
302
303
|
uiSchema: d,
|
|
303
304
|
onBlur: r,
|
|
304
|
-
schema:
|
|
305
|
+
schema: s,
|
|
305
306
|
formData: t,
|
|
306
307
|
onChange: a
|
|
307
308
|
}
|
|
308
309
|
);
|
|
309
310
|
};
|
|
310
311
|
function fr() {
|
|
311
|
-
const r = te(), { createSnapshot:
|
|
312
|
+
const r = te(), { createSnapshot: o } = Ze(), t = ze(), a = Je(r._type), l = { ...r }, s = () => o(), d = ({ formData: c }, h) => {
|
|
312
313
|
if (h) {
|
|
313
314
|
const g = h.replace("root.", "");
|
|
314
|
-
t([r._id], { [g]: u(
|
|
315
|
+
t([r._id], { [g]: u(c, g) });
|
|
315
316
|
}
|
|
316
317
|
}, i = {
|
|
317
318
|
_name: zt({
|
|
318
319
|
title: "Name",
|
|
319
320
|
default: u(r, "_name", r._type)
|
|
320
321
|
})
|
|
321
|
-
},
|
|
322
|
-
const
|
|
323
|
-
return pt(
|
|
324
|
-
delete
|
|
325
|
-
}),
|
|
326
|
-
}, [a,
|
|
322
|
+
}, n = dt(u(l, "_bindings", {})), p = R(() => {
|
|
323
|
+
const c = ct(u(a, "props", {}));
|
|
324
|
+
return pt(n, (h) => {
|
|
325
|
+
delete c[h];
|
|
326
|
+
}), c;
|
|
327
|
+
}, [a, n]);
|
|
327
328
|
return /* @__PURE__ */ e.jsxs("div", { className: "overflow-x-hidden", children: [
|
|
328
329
|
/* @__PURE__ */ e.jsx(
|
|
329
330
|
Ae,
|
|
330
331
|
{
|
|
331
332
|
onChange: d,
|
|
332
|
-
createHistorySnapshot:
|
|
333
|
-
formData:
|
|
333
|
+
createHistorySnapshot: s,
|
|
334
|
+
formData: l,
|
|
334
335
|
properties: i
|
|
335
336
|
}
|
|
336
337
|
),
|
|
@@ -341,7 +342,7 @@ function fr() {
|
|
|
341
342
|
/* @__PURE__ */ e.jsx(
|
|
342
343
|
"div",
|
|
343
344
|
{
|
|
344
|
-
className: `h-[8px] w-[8px] rounded-full ${
|
|
345
|
+
className: `h-[8px] w-[8px] rounded-full ${b(u(r, "_bindings", {})) ? "bg-gray-300" : "bg-blue-500"}`
|
|
345
346
|
}
|
|
346
347
|
),
|
|
347
348
|
"Data Binding"
|
|
@@ -349,9 +350,9 @@ function fr() {
|
|
|
349
350
|
/* @__PURE__ */ e.jsx(de, { className: "pt-4 px-4", children: /* @__PURE__ */ e.jsx(
|
|
350
351
|
yr,
|
|
351
352
|
{
|
|
352
|
-
bindingData: u(
|
|
353
|
-
onChange: (
|
|
354
|
-
d({ formData: { ...
|
|
353
|
+
bindingData: u(l, "_bindings", {}),
|
|
354
|
+
onChange: (c) => {
|
|
355
|
+
d({ formData: { ...l, _bindings: c } }, "root._bindings");
|
|
355
356
|
}
|
|
356
357
|
}
|
|
357
358
|
) })
|
|
@@ -362,20 +363,20 @@ function fr() {
|
|
|
362
363
|
"Static Content"
|
|
363
364
|
] }) }),
|
|
364
365
|
/* @__PURE__ */ e.jsxs(de, { className: "pt-4", children: [
|
|
365
|
-
|
|
366
|
+
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: [
|
|
366
367
|
"Data binding is set for ",
|
|
367
|
-
/* @__PURE__ */ e.jsx("b", { children:
|
|
368
|
+
/* @__PURE__ */ e.jsx("b", { children: N(n, ut).join(", ") }),
|
|
368
369
|
" ",
|
|
369
|
-
|
|
370
|
+
n.length === 1 ? "property" : "properties",
|
|
370
371
|
". Remove data binding to edit static content."
|
|
371
372
|
] }),
|
|
372
373
|
/* @__PURE__ */ e.jsx(
|
|
373
374
|
Ae,
|
|
374
375
|
{
|
|
375
376
|
onChange: d,
|
|
376
|
-
createHistorySnapshot:
|
|
377
|
-
formData:
|
|
378
|
-
properties:
|
|
377
|
+
createHistorySnapshot: s,
|
|
378
|
+
formData: l,
|
|
379
|
+
properties: p
|
|
379
380
|
}
|
|
380
381
|
)
|
|
381
382
|
] })
|
|
@@ -391,53 +392,53 @@ const De = new lr(or, {
|
|
|
391
392
|
keys: ["name"]
|
|
392
393
|
});
|
|
393
394
|
function vr() {
|
|
394
|
-
var
|
|
395
|
-
const [r] = je(),
|
|
396
|
-
const
|
|
397
|
-
t(
|
|
398
|
-
}, [
|
|
399
|
-
const
|
|
400
|
-
let
|
|
395
|
+
var S;
|
|
396
|
+
const [r] = je(), o = te(), t = Ue(), a = Ge(), [l] = Ke(), [s, d] = k(""), i = (S = fe(r)) == null ? void 0 : S.prop, n = gt((u(o, i, "").replace(nr, "").split(",").pop() || "").split(" "), b), p = () => {
|
|
397
|
+
const j = s.trim().toLowerCase().replace(/ +(?= )/g, "").split(" ");
|
|
398
|
+
t(l, j, !0), d("");
|
|
399
|
+
}, [c, h] = k([]), g = ({ value: j }) => {
|
|
400
|
+
const I = j.trim().toLowerCase(), B = I.match(/.+:/g);
|
|
401
|
+
let v = [];
|
|
401
402
|
if (B && B.length > 0) {
|
|
402
|
-
const [
|
|
403
|
-
|
|
403
|
+
const [C] = B, _ = I.replace(C, "");
|
|
404
|
+
v = De.search(_).map((m) => ({
|
|
404
405
|
...m,
|
|
405
|
-
item: { ...m.item, name:
|
|
406
|
+
item: { ...m.item, name: C + m.item.name }
|
|
406
407
|
}));
|
|
407
408
|
} else
|
|
408
|
-
|
|
409
|
-
h(
|
|
409
|
+
v = De.search(I);
|
|
410
|
+
h(N(v, "item"));
|
|
410
411
|
}, y = () => {
|
|
411
412
|
h([]);
|
|
412
|
-
}, x = (
|
|
413
|
+
}, x = (j) => j.name, f = (j) => /* @__PURE__ */ e.jsx("div", { className: "rounded-md p-1", children: j.name }), $ = {
|
|
413
414
|
autoComplete: "off",
|
|
414
415
|
autoCorrect: "off",
|
|
415
416
|
autoCapitalize: "off",
|
|
416
417
|
spellCheck: !1,
|
|
417
418
|
placeholder: "Enter class name",
|
|
418
|
-
value:
|
|
419
|
-
onKeyDown: (
|
|
420
|
-
|
|
419
|
+
value: s,
|
|
420
|
+
onKeyDown: (j) => {
|
|
421
|
+
j.key === "Enter" && s.trim() !== "" && p();
|
|
421
422
|
},
|
|
422
|
-
onChange: (
|
|
423
|
+
onChange: (j, { newValue: I }) => d(I),
|
|
423
424
|
className: "w-full rounded-md text-xs px-2 hover:outline-0 bg-background border-border py-1"
|
|
424
425
|
};
|
|
425
426
|
return /* @__PURE__ */ e.jsxs(
|
|
426
427
|
"div",
|
|
427
428
|
{
|
|
428
|
-
className: `no-scrollbar flex ${
|
|
429
|
+
className: `no-scrollbar flex ${c.length > 0 ? "min-h-[300px]" : "min-h-max"} w-full flex-col gap-y-5 overflow-y-auto bg-gray-100 px-px`,
|
|
429
430
|
children: [
|
|
430
431
|
/* @__PURE__ */ e.jsx(Ce, { className: "mt-2", children: "Add Tailwind classes" }),
|
|
431
432
|
/* @__PURE__ */ e.jsxs("div", { className: "relative -mt-4 flex items-center gap-x-3", children: [
|
|
432
433
|
/* @__PURE__ */ e.jsx("div", { className: "relative flex w-full items-center gap-x-3", children: /* @__PURE__ */ e.jsx(
|
|
433
434
|
Qe,
|
|
434
435
|
{
|
|
435
|
-
suggestions:
|
|
436
|
+
suggestions: c,
|
|
436
437
|
onSuggestionsFetchRequested: g,
|
|
437
438
|
onSuggestionsClearRequested: y,
|
|
438
439
|
getSuggestionValue: x,
|
|
439
|
-
renderSuggestion:
|
|
440
|
-
inputProps:
|
|
440
|
+
renderSuggestion: f,
|
|
441
|
+
inputProps: $,
|
|
441
442
|
containerProps: {
|
|
442
443
|
className: "relative h-8 w-full gap-y-1 py-1 border-gray-600"
|
|
443
444
|
},
|
|
@@ -453,32 +454,32 @@ function vr() {
|
|
|
453
454
|
{
|
|
454
455
|
variant: "outline",
|
|
455
456
|
className: "h-6 border-gray-700",
|
|
456
|
-
onClick:
|
|
457
|
-
disabled:
|
|
457
|
+
onClick: p,
|
|
458
|
+
disabled: s.trim() === "",
|
|
458
459
|
size: "sm",
|
|
459
460
|
children: /* @__PURE__ */ e.jsx(ve, {})
|
|
460
461
|
}
|
|
461
462
|
)
|
|
462
463
|
] }),
|
|
463
464
|
/* @__PURE__ */ e.jsxs("div", { className: "flex w-full flex-wrap gap-2", children: [
|
|
464
|
-
|
|
465
|
+
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" }),
|
|
465
466
|
se.Children.toArray(
|
|
466
|
-
|
|
467
|
+
n.map((j) => /* @__PURE__ */ e.jsxs(
|
|
467
468
|
"div",
|
|
468
469
|
{
|
|
469
470
|
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",
|
|
470
471
|
children: [
|
|
471
|
-
|
|
472
|
+
j,
|
|
472
473
|
/* @__PURE__ */ e.jsx(
|
|
473
474
|
Fe,
|
|
474
475
|
{
|
|
475
|
-
onClick: () => a(
|
|
476
|
+
onClick: () => a(l, [j]),
|
|
476
477
|
className: "invisible absolute right-1 hover:text-white group-hover:visible group-hover:cursor-pointer"
|
|
477
478
|
}
|
|
478
479
|
)
|
|
479
480
|
]
|
|
480
481
|
},
|
|
481
|
-
|
|
482
|
+
j
|
|
482
483
|
))
|
|
483
484
|
)
|
|
484
485
|
] })
|
|
@@ -917,34 +918,34 @@ const D = ["px", "%", "em", "rem", "ch", "vh", "vw"], wr = {
|
|
|
917
918
|
invisible: Te,
|
|
918
919
|
// display
|
|
919
920
|
hidden: Te,
|
|
920
|
-
gap:
|
|
921
|
-
gapX:
|
|
922
|
-
gapY:
|
|
923
|
-
spaceX:
|
|
924
|
-
spaceY:
|
|
925
|
-
overscroll:
|
|
926
|
-
overscrollX:
|
|
927
|
-
overscrollY:
|
|
928
|
-
overflow:
|
|
929
|
-
overflowX:
|
|
930
|
-
overflowY:
|
|
921
|
+
gap: E,
|
|
922
|
+
gapX: H,
|
|
923
|
+
gapY: V,
|
|
924
|
+
spaceX: H,
|
|
925
|
+
spaceY: V,
|
|
926
|
+
overscroll: E,
|
|
927
|
+
overscrollX: H,
|
|
928
|
+
overscrollY: V,
|
|
929
|
+
overflow: E,
|
|
930
|
+
overflowX: H,
|
|
931
|
+
overflowY: V,
|
|
931
932
|
top: G,
|
|
932
933
|
right: K,
|
|
933
934
|
bottom: q,
|
|
934
935
|
left: J,
|
|
935
|
-
inset:
|
|
936
|
-
insetX:
|
|
937
|
-
insetY:
|
|
938
|
-
border:
|
|
939
|
-
borderX:
|
|
940
|
-
borderY:
|
|
936
|
+
inset: E,
|
|
937
|
+
insetX: H,
|
|
938
|
+
insetY: V,
|
|
939
|
+
border: E,
|
|
940
|
+
borderX: H,
|
|
941
|
+
borderY: V,
|
|
941
942
|
borderTop: G,
|
|
942
943
|
borderRight: K,
|
|
943
944
|
borderBottom: q,
|
|
944
945
|
borderLeft: J,
|
|
945
|
-
borderRadius:
|
|
946
|
-
borderRadiusX:
|
|
947
|
-
borderRadiusY:
|
|
946
|
+
borderRadius: E,
|
|
947
|
+
borderRadiusX: H,
|
|
948
|
+
borderRadiusY: V,
|
|
948
949
|
borderRadiusTop: G,
|
|
949
950
|
borderRadiusRight: K,
|
|
950
951
|
borderRadiusBottom: q,
|
|
@@ -953,27 +954,27 @@ const D = ["px", "%", "em", "rem", "ch", "vh", "vw"], wr = {
|
|
|
953
954
|
borderRadiusTopRight: vt,
|
|
954
955
|
borderRadiusBottomRight: wt,
|
|
955
956
|
borderRadiusBottomLeft: jt,
|
|
956
|
-
divideXWidth:
|
|
957
|
-
divideYWidth:
|
|
958
|
-
scale:
|
|
959
|
-
scaleX:
|
|
960
|
-
scaleY:
|
|
961
|
-
skewX:
|
|
962
|
-
skewY:
|
|
963
|
-
translateX:
|
|
964
|
-
translateY:
|
|
957
|
+
divideXWidth: H,
|
|
958
|
+
divideYWidth: V,
|
|
959
|
+
scale: E,
|
|
960
|
+
scaleX: H,
|
|
961
|
+
scaleY: V,
|
|
962
|
+
skewX: H,
|
|
963
|
+
skewY: V,
|
|
964
|
+
translateX: H,
|
|
965
|
+
translateY: V,
|
|
965
966
|
// padding
|
|
966
|
-
padding:
|
|
967
|
-
paddingX:
|
|
968
|
-
paddingY:
|
|
967
|
+
padding: E,
|
|
968
|
+
paddingX: H,
|
|
969
|
+
paddingY: V,
|
|
969
970
|
paddingTop: G,
|
|
970
971
|
paddingRight: K,
|
|
971
972
|
paddingBottom: q,
|
|
972
973
|
paddingLeft: J,
|
|
973
974
|
// margin
|
|
974
|
-
margin:
|
|
975
|
-
marginX:
|
|
976
|
-
marginY:
|
|
975
|
+
margin: E,
|
|
976
|
+
marginX: H,
|
|
977
|
+
marginY: V,
|
|
977
978
|
marginTop: G,
|
|
978
979
|
marginRight: K,
|
|
979
980
|
marginBottom: q,
|
|
@@ -988,9 +989,9 @@ const D = ["px", "%", "em", "rem", "ch", "vh", "vw"], wr = {
|
|
|
988
989
|
// "not-italic": "",
|
|
989
990
|
// decoration
|
|
990
991
|
underline: Rt,
|
|
991
|
-
overline:
|
|
992
|
+
overline: Ht,
|
|
992
993
|
// transform
|
|
993
|
-
uppercase:
|
|
994
|
+
uppercase: Vt,
|
|
994
995
|
block: () => /* @__PURE__ */ e.jsxs("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [
|
|
995
996
|
/* @__PURE__ */ e.jsx(
|
|
996
997
|
"path",
|
|
@@ -1104,13 +1105,13 @@ const D = ["px", "%", "em", "rem", "ch", "vh", "vw"], wr = {
|
|
|
1104
1105
|
)
|
|
1105
1106
|
] }),
|
|
1106
1107
|
static: Bt
|
|
1107
|
-
}, re =
|
|
1108
|
+
}, re = Pe({ canReset: !1, canChange: !0 }), kr = ({ children: r, canReset: o = !1, canChange: t = !0 }) => (
|
|
1108
1109
|
// eslint-disable-next-line react/jsx-no-constructed-context-values
|
|
1109
|
-
/* @__PURE__ */ e.jsx(re.Provider, { value: { canReset:
|
|
1110
|
-
), lt = ({ label: r, property:
|
|
1111
|
-
const a =
|
|
1110
|
+
/* @__PURE__ */ e.jsx(re.Provider, { value: { canReset: o, canChange: t }, children: r })
|
|
1111
|
+
), lt = ({ label: r, property: o, onChange: t }) => {
|
|
1112
|
+
const a = R(() => u(pe, `${o}.classes`, [""]), [o]), l = le(o), s = R(() => u(l, "cls", ""), [l]), { canChange: d } = ee(re), i = /\[.*\]/g.test(s);
|
|
1112
1113
|
return /* @__PURE__ */ e.jsx("div", { className: r ? "w-full rounded " : "grow", children: i ? /* @__PURE__ */ e.jsxs("div", { className: "flex items-center", children: [
|
|
1113
|
-
/* @__PURE__ */ e.jsx(ar, { className: "w-[70%] rounded py-1", readOnly: !0, value:
|
|
1114
|
+
/* @__PURE__ */ e.jsx(ar, { className: "w-[70%] rounded py-1", readOnly: !0, value: s }),
|
|
1114
1115
|
/* @__PURE__ */ e.jsxs(Y, { delayDuration: 100, children: [
|
|
1115
1116
|
/* @__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, {}) }) }),
|
|
1116
1117
|
/* @__PURE__ */ e.jsx(W, { children: "Current value is using a Tailwind arbitrary value." })
|
|
@@ -1119,55 +1120,55 @@ const D = ["px", "%", "em", "rem", "ch", "vh", "vw"], wr = {
|
|
|
1119
1120
|
ye,
|
|
1120
1121
|
{
|
|
1121
1122
|
rounded: r,
|
|
1122
|
-
onChange: (
|
|
1123
|
-
selected:
|
|
1123
|
+
onChange: (n) => t(n, o),
|
|
1124
|
+
selected: s,
|
|
1124
1125
|
options: a,
|
|
1125
1126
|
disabled: !d
|
|
1126
1127
|
}
|
|
1127
1128
|
) });
|
|
1128
1129
|
};
|
|
1129
|
-
function ye({ selected: r, onChange:
|
|
1130
|
-
const
|
|
1130
|
+
function ye({ selected: r, onChange: o, rounded: t = !1, options: a, disabled: l = !1 }) {
|
|
1131
|
+
const s = r.replace(/.*:/g, "").trim(), { undo: d, redo: i } = Ze();
|
|
1131
1132
|
return /* @__PURE__ */ e.jsxs(
|
|
1132
1133
|
"select",
|
|
1133
1134
|
{
|
|
1134
|
-
disabled: !a.length ||
|
|
1135
|
+
disabled: !a.length || l,
|
|
1135
1136
|
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`,
|
|
1136
|
-
onChange: (
|
|
1137
|
-
onKeyDown: (
|
|
1138
|
-
|
|
1137
|
+
onChange: (n) => o(n.target.value),
|
|
1138
|
+
onKeyDown: (n) => {
|
|
1139
|
+
n.ctrlKey && (n.key === "z" && d(), n.key === "y" && i());
|
|
1139
1140
|
},
|
|
1140
|
-
value:
|
|
1141
|
+
value: s,
|
|
1141
1142
|
children: [
|
|
1142
1143
|
/* @__PURE__ */ e.jsx("option", { className: "bg-transparent", value: "" }),
|
|
1143
|
-
|
|
1144
|
-
a.map((
|
|
1144
|
+
P.Children.toArray(
|
|
1145
|
+
a.map((n) => /* @__PURE__ */ e.jsx("option", { className: "bg-transparent", value: n, children: n }))
|
|
1145
1146
|
)
|
|
1146
1147
|
]
|
|
1147
1148
|
}
|
|
1148
1149
|
);
|
|
1149
1150
|
}
|
|
1150
|
-
const Nr = ({ property: r, onChange:
|
|
1151
|
-
const { canReset: t, canChange: a } = ee(re),
|
|
1152
|
-
return /* @__PURE__ */ e.jsx("div", { className: "flex flex-row divide-x divide-solid divide-border rounded border border-border text-xs", children:
|
|
1151
|
+
const Nr = ({ property: r, onChange: o }) => {
|
|
1152
|
+
const { canReset: t, canChange: a } = ee(re), l = le(r), s = R(() => u(l, "cls", ""), [l]), d = R(() => u(pe, `${r}.classes`, [""]), [r]), i = d.indexOf(s) > -1 ? d.indexOf(s) : 0, n = /\[.*\]/g.test(s);
|
|
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: s }) : /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
1153
1154
|
/* @__PURE__ */ e.jsx(
|
|
1154
1155
|
"button",
|
|
1155
1156
|
{
|
|
1156
1157
|
type: "button",
|
|
1157
1158
|
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",
|
|
1158
1159
|
disabled: !a && (!t || i - 1 < 0),
|
|
1159
|
-
onClick: () =>
|
|
1160
|
+
onClick: () => o(Se(d, i - 1), r),
|
|
1160
1161
|
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" }) })
|
|
1161
1162
|
}
|
|
1162
1163
|
),
|
|
1163
|
-
/* @__PURE__ */ e.jsx("div", { className: "w-8/12 text-center", children: /* @__PURE__ */ e.jsx(lt, { label: !1, property: r, onChange:
|
|
1164
|
+
/* @__PURE__ */ e.jsx("div", { className: "w-8/12 text-center", children: /* @__PURE__ */ e.jsx(lt, { label: !1, property: r, onChange: o }) }),
|
|
1164
1165
|
/* @__PURE__ */ e.jsx(
|
|
1165
1166
|
"button",
|
|
1166
1167
|
{
|
|
1167
1168
|
type: "button",
|
|
1168
1169
|
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",
|
|
1169
1170
|
disabled: !a && (!t || i + 1 >= d.length),
|
|
1170
|
-
onClick: () =>
|
|
1171
|
+
onClick: () => o(Se(d, i + 1), r),
|
|
1171
1172
|
children: /* @__PURE__ */ e.jsx("span", { className: "flex items-center justify-center", children: /* @__PURE__ */ e.jsx(
|
|
1172
1173
|
ve,
|
|
1173
1174
|
{
|
|
@@ -1177,17 +1178,17 @@ const Nr = ({ property: r, onChange: s }) => {
|
|
|
1177
1178
|
}
|
|
1178
1179
|
)
|
|
1179
1180
|
] }) });
|
|
1180
|
-
}, Sr = ({ property: r, onChange:
|
|
1181
|
-
const t =
|
|
1182
|
-
return /* @__PURE__ */ e.jsx("div", { className: "flex grow flex-wrap gap-1", children:
|
|
1181
|
+
}, Sr = ({ property: r, onChange: o }) => {
|
|
1182
|
+
const t = R(() => u(pe, `${r}.classes`, [""]), [r]), { canChange: a } = ee(re), l = le(r), s = R(() => u(l, "cls", ""), [l]);
|
|
1183
|
+
return /* @__PURE__ */ e.jsx("div", { className: "flex grow flex-wrap gap-1", children: N(t, (d) => /* @__PURE__ */ e.jsxs(Y, { children: [
|
|
1183
1184
|
/* @__PURE__ */ e.jsx(X, { asChild: !0, children: /* @__PURE__ */ e.jsx(
|
|
1184
1185
|
"button",
|
|
1185
1186
|
{
|
|
1186
1187
|
type: "button",
|
|
1187
1188
|
disabled: !a,
|
|
1188
|
-
onClick: () =>
|
|
1189
|
-
className: `cursor-pointer rounded border border-gray-600 p-1 disabled:cursor-not-allowed ${
|
|
1190
|
-
children:
|
|
1189
|
+
onClick: () => o(d, r),
|
|
1190
|
+
className: `cursor-pointer rounded border border-gray-600 p-1 disabled:cursor-not-allowed ${s === d ? " bg-blue-500 text-white" : "disabled:bg-gray-600 disabled:text-gray-400"}`,
|
|
1191
|
+
children: P.createElement(u(rt, d, Ye))
|
|
1191
1192
|
}
|
|
1192
1193
|
) }),
|
|
1193
1194
|
/* @__PURE__ */ e.jsx(W, { children: Q(ne(d)) })
|
|
@@ -1204,38 +1205,38 @@ const Nr = ({ property: r, onChange: s }) => {
|
|
|
1204
1205
|
toColor: "to",
|
|
1205
1206
|
ringColor: "ring",
|
|
1206
1207
|
ringOffsetColor: "ring-offset"
|
|
1207
|
-
}, Rr = ({ property: r, onChange:
|
|
1208
|
-
const t = le(r), a =
|
|
1208
|
+
}, Rr = ({ property: r, onChange: o }) => {
|
|
1209
|
+
const t = le(r), a = R(() => u(t, "cls", ""), [t]), { canChange: l } = ee(re), [s, d] = k([]), [i, n] = k({ color: "", shade: "" }), p = a.split("-"), c = u(p, "1", ""), h = u(p, "2", ""), g = L(
|
|
1209
1210
|
// eslint-disable-next-line no-shadow
|
|
1210
1211
|
(x) => {
|
|
1211
|
-
["current", "inherit", "transparent", "black", "white"].includes(x) ? (d([]),
|
|
1212
|
+
["current", "inherit", "transparent", "black", "white"].includes(x) ? (d([]), n({ color: x })) : (d(["50", "100", "200", "300", "400", "500", "600", "700", "800", "900"]), n((f) => ({ ...f, color: x, shade: f.shade ? f.shade : "500" })));
|
|
1212
1213
|
},
|
|
1213
|
-
[d,
|
|
1214
|
+
[d, n]
|
|
1214
1215
|
);
|
|
1215
1216
|
M(() => {
|
|
1216
|
-
if (["current", "inherit", "transparent", "black", "white"].includes(
|
|
1217
|
+
if (["current", "inherit", "transparent", "black", "white"].includes(c))
|
|
1217
1218
|
return d([]);
|
|
1218
1219
|
d(["50", "100", "200", "300", "400", "500", "600", "700", "800", "900"]);
|
|
1219
|
-
}, [
|
|
1220
|
-
const y =
|
|
1220
|
+
}, [c]);
|
|
1221
|
+
const y = L(
|
|
1221
1222
|
// eslint-disable-next-line no-shadow
|
|
1222
1223
|
(x) => {
|
|
1223
|
-
|
|
1224
|
+
n({ color: c, shade: x });
|
|
1224
1225
|
},
|
|
1225
|
-
[
|
|
1226
|
+
[c]
|
|
1226
1227
|
);
|
|
1227
1228
|
return M(() => {
|
|
1228
|
-
|
|
1229
|
+
n({ color: "", shade: "" });
|
|
1229
1230
|
}, [t]), M(() => {
|
|
1230
|
-
const
|
|
1231
|
-
|
|
1232
|
-
}, [i,
|
|
1231
|
+
const f = `${u(Tr, r, "")}-${i.color}${i.shade ? `-${i.shade}` : ""}`;
|
|
1232
|
+
f.match(new RegExp(u(pe, `${r}.regExp`, ""))) && o(f, r);
|
|
1233
|
+
}, [i, o, r]), /* @__PURE__ */ e.jsxs("div", { className: "flex flex-row divide-x divide-solid divide-border rounded-lg border border-border text-xs", children: [
|
|
1233
1234
|
/* @__PURE__ */ e.jsx("div", { className: "grow text-center", children: /* @__PURE__ */ e.jsx(
|
|
1234
1235
|
ye,
|
|
1235
1236
|
{
|
|
1236
|
-
disabled: !
|
|
1237
|
+
disabled: !l,
|
|
1237
1238
|
rounded: !0,
|
|
1238
|
-
selected:
|
|
1239
|
+
selected: c,
|
|
1239
1240
|
onChange: g,
|
|
1240
1241
|
options: [
|
|
1241
1242
|
"current",
|
|
@@ -1269,19 +1270,19 @@ const Nr = ({ property: r, onChange: s }) => {
|
|
|
1269
1270
|
]
|
|
1270
1271
|
}
|
|
1271
1272
|
) }),
|
|
1272
|
-
/* @__PURE__ */ e.jsx("button", { type: "button", className: "grow text-center", children: /* @__PURE__ */ e.jsx(ye, { rounded: !0, selected: h, disabled: !
|
|
1273
|
+
/* @__PURE__ */ e.jsx("button", { type: "button", className: "grow text-center", children: /* @__PURE__ */ e.jsx(ye, { rounded: !0, selected: h, disabled: !c || !l, onChange: y, options: s }) })
|
|
1273
1274
|
] });
|
|
1274
|
-
}, $e = (r,
|
|
1275
|
+
}, $e = (r, o) => {
|
|
1275
1276
|
r = r.toLowerCase();
|
|
1276
1277
|
let t = r.trim().replace(/ |\+/g, "");
|
|
1277
|
-
if ((t === "auto" || t === "none") &&
|
|
1278
|
+
if ((t === "auto" || t === "none") && o.includes(t))
|
|
1278
1279
|
return { value: "", unit: t };
|
|
1279
|
-
const a =
|
|
1280
|
+
const a = o.length ? new RegExp(o.join("|"), "g") : /XXXXXX/g;
|
|
1280
1281
|
t = t.replace(a, "");
|
|
1281
|
-
const
|
|
1282
|
-
return
|
|
1283
|
-
},
|
|
1284
|
-
const
|
|
1282
|
+
const l = r.match(a), s = l && l.length > 1, d = !b(t) && Number.isNaN(Number(t));
|
|
1283
|
+
return s || d ? { error: "Invalid value" } : l && (l[0] === "auto" || l[0] === "none") ? { value: l[0], unit: "" } : { value: t, unit: l ? l[0] : "" };
|
|
1284
|
+
}, Hr = (r) => {
|
|
1285
|
+
const o = r.startsWith("-") ? "-" : "", t = r.split("-").pop();
|
|
1285
1286
|
if (["auto", "none"].includes(t))
|
|
1286
1287
|
return { value: "", unit: t };
|
|
1287
1288
|
if (t === "px")
|
|
@@ -1291,17 +1292,17 @@ const Nr = ({ property: r, onChange: s }) => {
|
|
|
1291
1292
|
if (t === "full")
|
|
1292
1293
|
return { value: "100", unit: "%" };
|
|
1293
1294
|
if (O(r, "skew-"))
|
|
1294
|
-
return { value: `${
|
|
1295
|
+
return { value: `${o}${t}`, unit: "deg" };
|
|
1295
1296
|
if (O(r, "rotate-"))
|
|
1296
|
-
return { value: `${
|
|
1297
|
+
return { value: `${o}${t}`, unit: "deg" };
|
|
1297
1298
|
if (O(r, "opacity-"))
|
|
1298
1299
|
return { value: `${t / 100}`, unit: "-" };
|
|
1299
1300
|
if (O(r, "duration-") || O(r, "delay-"))
|
|
1300
1301
|
return { value: `${t}`, unit: "ms" };
|
|
1301
1302
|
if (O(r, "translate-") && !t.includes("/"))
|
|
1302
|
-
return { value: `${
|
|
1303
|
+
return { value: `${o}${`${t / 4}`}`, unit: "rem" };
|
|
1303
1304
|
if (O(r, "scale-"))
|
|
1304
|
-
return { value: `${
|
|
1305
|
+
return { value: `${o}${`${t / 100}`}`, unit: "-" };
|
|
1305
1306
|
if (Z(r, "border")) {
|
|
1306
1307
|
const a = r.match(/border-?(x|y|t|r|b|l)?\d+/g);
|
|
1307
1308
|
if (a)
|
|
@@ -1404,28 +1405,28 @@ const Nr = ({ property: r, onChange: s }) => {
|
|
|
1404
1405
|
if (["max", "min", "fit"].includes(t))
|
|
1405
1406
|
return { value: r, unit: "class" };
|
|
1406
1407
|
if (t.includes("/")) {
|
|
1407
|
-
const [a,
|
|
1408
|
-
return { value:
|
|
1408
|
+
const [a, l] = N(t.split("/"), (s) => parseInt(s, 10));
|
|
1409
|
+
return { value: o + (a / l * 100).toFixed(2).replace(".00", ""), unit: "%" };
|
|
1409
1410
|
}
|
|
1410
|
-
return xt(parseFloat(t)) ? { value: `${
|
|
1411
|
-
},
|
|
1412
|
-
if (
|
|
1411
|
+
return xt(parseFloat(t)) ? { value: `${o + parseFloat(t) * 4}`, unit: "px" } : { value: t, unit: "class" };
|
|
1412
|
+
}, Vr = (r) => {
|
|
1413
|
+
if (b(r))
|
|
1413
1414
|
return { value: "", unit: "" };
|
|
1414
|
-
const
|
|
1415
|
-
if (
|
|
1415
|
+
const o = r.match(/\[.*\]/g);
|
|
1416
|
+
if (o === null)
|
|
1416
1417
|
return Br(r);
|
|
1417
|
-
const t = u(
|
|
1418
|
-
return { value: `${a}${
|
|
1419
|
-
}, Br = (r) =>
|
|
1418
|
+
const t = u(o, "0", "").replace(/\[|\]/g, ""), a = r.startsWith("-") ? "-" : "", l = fe(t.match(/\d+.\d+|\d+/g));
|
|
1419
|
+
return { value: `${a}${l}`, unit: t.replace(l, "") };
|
|
1420
|
+
}, Br = (r) => b(r) ? { value: "", unit: "" } : Hr(r), ot = P.createContext({
|
|
1420
1421
|
setDragData: () => {
|
|
1421
1422
|
}
|
|
1422
1423
|
}), Ar = ({
|
|
1423
1424
|
unit: r,
|
|
1424
|
-
currentValue:
|
|
1425
|
+
currentValue: o,
|
|
1425
1426
|
onDrag: t,
|
|
1426
1427
|
onDragEnd: a,
|
|
1427
|
-
onDragStart:
|
|
1428
|
-
negative:
|
|
1428
|
+
onDragStart: l,
|
|
1429
|
+
negative: s,
|
|
1429
1430
|
cssProperty: d
|
|
1430
1431
|
}) => {
|
|
1431
1432
|
const { setDragData: i } = ee(ot);
|
|
@@ -1433,154 +1434,154 @@ const Nr = ({ property: r, onChange: s }) => {
|
|
|
1433
1434
|
"button",
|
|
1434
1435
|
{
|
|
1435
1436
|
type: "button",
|
|
1436
|
-
onMouseDown: (
|
|
1437
|
-
const
|
|
1437
|
+
onMouseDown: (n) => {
|
|
1438
|
+
const p = {
|
|
1438
1439
|
onDrag: t,
|
|
1439
1440
|
onDragEnd: a,
|
|
1440
1441
|
dragging: !0,
|
|
1441
|
-
dragStartY:
|
|
1442
|
-
dragStartValue: `${
|
|
1442
|
+
dragStartY: n.pageY,
|
|
1443
|
+
dragStartValue: `${o}`,
|
|
1443
1444
|
dragUnit: r,
|
|
1444
|
-
negative:
|
|
1445
|
+
negative: s,
|
|
1445
1446
|
cssProperty: d
|
|
1446
1447
|
};
|
|
1447
|
-
|
|
1448
|
+
l(p), i(p);
|
|
1448
1449
|
},
|
|
1449
1450
|
color: void 0,
|
|
1450
1451
|
className: "relative z-50 ml-1 hidden h-6 cursor-row-resize rounded bg-background/70 px-2 group-hover:inline",
|
|
1451
1452
|
children: /* @__PURE__ */ e.jsx($t, {})
|
|
1452
1453
|
}
|
|
1453
1454
|
);
|
|
1454
|
-
}, Dr = ({ onSelect: r, current:
|
|
1455
|
+
}, Dr = ({ onSelect: r, current: o, 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(
|
|
1455
1456
|
et,
|
|
1456
1457
|
{
|
|
1457
1458
|
className: "h-max rounded-none px-1 py-1 text-right text-[11px] hover:bg-blue-400",
|
|
1458
|
-
color:
|
|
1459
|
+
color: o === a ? "primary" : void 0,
|
|
1459
1460
|
size: "sm",
|
|
1460
|
-
onClick: (
|
|
1461
|
-
|
|
1461
|
+
onClick: (l) => {
|
|
1462
|
+
l.stopPropagation(), r(a);
|
|
1462
1463
|
},
|
|
1463
1464
|
children: a
|
|
1464
1465
|
},
|
|
1465
1466
|
a
|
|
1466
1467
|
)) }), $r = (r) => {
|
|
1467
|
-
const [
|
|
1468
|
+
const [o, t] = k(!1), [a, l] = k(""), { currentClass: s, onChange: d, classPrefix: i, cssProperty: n, units: p, negative: c } = r, [h, g] = k(n != null && n.toLowerCase().includes("width") ? "%" : p[0]), [y, x] = k(!1), [f, $] = k(""), [S, j] = k(!1), [I, B] = k(!1);
|
|
1468
1469
|
M(() => {
|
|
1469
|
-
const { value: m, unit: w } =
|
|
1470
|
+
const { value: m, unit: w } = Vr(s);
|
|
1470
1471
|
if (w === "") {
|
|
1471
|
-
|
|
1472
|
+
l(m), g(n != null && n.toLowerCase().includes("width") ? "%" : p[0]);
|
|
1472
1473
|
return;
|
|
1473
1474
|
}
|
|
1474
|
-
g(w),
|
|
1475
|
-
}, [
|
|
1476
|
-
const
|
|
1475
|
+
g(w), l(w === "class" || b(m) ? "" : m);
|
|
1476
|
+
}, [s, n, p]);
|
|
1477
|
+
const v = xe(
|
|
1477
1478
|
(m) => {
|
|
1478
1479
|
d(m);
|
|
1479
1480
|
},
|
|
1480
1481
|
[d],
|
|
1481
1482
|
200
|
|
1482
|
-
),
|
|
1483
|
+
), C = xe(
|
|
1483
1484
|
(m) => {
|
|
1484
1485
|
d(m, !1);
|
|
1485
1486
|
},
|
|
1486
1487
|
[d],
|
|
1487
1488
|
200
|
|
1488
|
-
),
|
|
1489
|
+
), _ = L(
|
|
1489
1490
|
(m = !1) => {
|
|
1490
|
-
const w = $e(`${a}`,
|
|
1491
|
+
const w = $e(`${a}`, p);
|
|
1491
1492
|
if (u(w, "error", !1)) {
|
|
1492
1493
|
x(!0);
|
|
1493
1494
|
return;
|
|
1494
1495
|
}
|
|
1495
|
-
const
|
|
1496
|
-
if (
|
|
1497
|
-
|
|
1496
|
+
const T = u(w, "unit") !== "" ? u(w, "unit") : h;
|
|
1497
|
+
if (T === "auto" || T === "none") {
|
|
1498
|
+
v(`${i}${T}`);
|
|
1498
1499
|
return;
|
|
1499
1500
|
}
|
|
1500
1501
|
if (u(w, "value") === "")
|
|
1501
1502
|
return;
|
|
1502
|
-
const U = `${u(w, "value", "").startsWith("-") ? "-" : ""}${i}[${u(w, "value", "").replace("-", "")}${
|
|
1503
|
-
m ?
|
|
1503
|
+
const U = `${u(w, "value", "").startsWith("-") ? "-" : ""}${i}[${u(w, "value", "").replace("-", "")}${T === "-" ? "" : T}]`;
|
|
1504
|
+
m ? C(U) : v(U);
|
|
1504
1505
|
},
|
|
1505
|
-
[
|
|
1506
|
-
), oe =
|
|
1506
|
+
[v, C, a, h, i, p]
|
|
1507
|
+
), oe = L(
|
|
1507
1508
|
(m) => {
|
|
1508
|
-
const w = $e(`${a}`,
|
|
1509
|
+
const w = $e(`${a}`, p);
|
|
1509
1510
|
if (u(w, "error", !1)) {
|
|
1510
1511
|
x(!0);
|
|
1511
1512
|
return;
|
|
1512
1513
|
}
|
|
1513
1514
|
if (m === "auto" || m === "none") {
|
|
1514
|
-
|
|
1515
|
+
v(`${i}${m}`);
|
|
1515
1516
|
return;
|
|
1516
1517
|
}
|
|
1517
1518
|
if (u(w, "value") === "")
|
|
1518
1519
|
return;
|
|
1519
|
-
const
|
|
1520
|
-
|
|
1520
|
+
const T = u(w, "unit") !== "" ? u(w, "unit") : m, U = `${u(w, "value", "").startsWith("-") ? "-" : ""}${i}[${u(w, "value", "").replace("-", "")}${T === "-" ? "" : T}]`;
|
|
1521
|
+
v(U);
|
|
1521
1522
|
},
|
|
1522
|
-
[
|
|
1523
|
+
[v, a, i, p]
|
|
1523
1524
|
);
|
|
1524
1525
|
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:
|
|
1526
|
+
/* @__PURE__ */ e.jsx("input", { className: "w-20 rounded py-1", readOnly: !0, value: s }),
|
|
1526
1527
|
/* @__PURE__ */ e.jsxs(Y, { children: [
|
|
1527
1528
|
/* @__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, {}) }) }),
|
|
1528
1529
|
/* @__PURE__ */ e.jsx(W, { children: "Current value is using a Tailwind preset class." })
|
|
1529
1530
|
] })
|
|
1530
|
-
] }) : /* @__PURE__ */ e.jsxs("div", { className: `group relative flex items-center ${
|
|
1531
|
+
] }) : /* @__PURE__ */ e.jsxs("div", { className: `group relative flex items-center ${S ? "z-auto" : ""}`, children: [
|
|
1531
1532
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center rounded-md border border-border", children: [
|
|
1532
1533
|
["none", "auto"].indexOf(h) !== -1 ? null : /* @__PURE__ */ e.jsx(
|
|
1533
1534
|
"input",
|
|
1534
1535
|
{
|
|
1535
1536
|
readOnly: h === "class",
|
|
1536
1537
|
onKeyPress: (m) => {
|
|
1537
|
-
m.key === "Enter" &&
|
|
1538
|
+
m.key === "Enter" && _();
|
|
1538
1539
|
},
|
|
1539
1540
|
onKeyDown: (m) => {
|
|
1540
1541
|
if (m.keyCode !== 38 && m.keyCode !== 40)
|
|
1541
1542
|
return;
|
|
1542
1543
|
m.preventDefault(), B(!0);
|
|
1543
1544
|
const w = ht(m.target.value);
|
|
1544
|
-
let
|
|
1545
|
-
m.keyCode === 38 && (
|
|
1546
|
-
const
|
|
1547
|
-
|
|
1545
|
+
let T = Me(w) ? 0 : w;
|
|
1546
|
+
m.keyCode === 38 && (T += 1), m.keyCode === 40 && (T -= 1);
|
|
1547
|
+
const F = `${T}`, nt = `${F.startsWith("-") ? "-" : ""}${i}[${F.replace("-", "")}${h === "-" ? "" : h}]`;
|
|
1548
|
+
C(nt);
|
|
1548
1549
|
},
|
|
1549
1550
|
onKeyUp: (m) => {
|
|
1550
|
-
|
|
1551
|
+
I && (m.preventDefault(), B(!1));
|
|
1551
1552
|
},
|
|
1552
|
-
onBlur: () =>
|
|
1553
|
+
onBlur: () => _(),
|
|
1553
1554
|
onChange: (m) => {
|
|
1554
|
-
x(!1),
|
|
1555
|
+
x(!1), l(m.target.value);
|
|
1555
1556
|
},
|
|
1556
1557
|
onClick: (m) => {
|
|
1557
1558
|
var w;
|
|
1558
1559
|
(w = m == null ? void 0 : m.target) == null || w.select(), t(!1);
|
|
1559
1560
|
},
|
|
1560
|
-
value:
|
|
1561
|
+
value: S ? f : a,
|
|
1561
1562
|
className: "h-6 w-14 rounded rounded-r-none bg-background pl-2 text-sm focus-visible:outline-0 ".concat(
|
|
1562
1563
|
" ",
|
|
1563
1564
|
y ? "border-red-500 text-red-500" : "border-foreground/20"
|
|
1564
1565
|
)
|
|
1565
1566
|
}
|
|
1566
1567
|
),
|
|
1567
|
-
/* @__PURE__ */ e.jsxs(Y, { open:
|
|
1568
|
+
/* @__PURE__ */ e.jsxs(Y, { open: o, delayDuration: 100, children: [
|
|
1568
1569
|
/* @__PURE__ */ e.jsx(X, { asChild: !0, children: /* @__PURE__ */ e.jsxs(
|
|
1569
1570
|
"button",
|
|
1570
1571
|
{
|
|
1571
1572
|
type: "button",
|
|
1572
|
-
onClick: () => t(!
|
|
1573
|
+
onClick: () => t(!o),
|
|
1573
1574
|
className: "flex h-6 cursor-pointer items-center gap-x-1 rounded rounded-l-none bg-background p-px px-1 text-[11px] uppercase",
|
|
1574
1575
|
children: [
|
|
1575
|
-
/* @__PURE__ */ e.jsx("span", { className: `inline-block ${
|
|
1576
|
-
|
|
1576
|
+
/* @__PURE__ */ e.jsx("span", { className: `inline-block ${p.length === 1 ? "px-2 font-semibold" : ""}`, children: h }),
|
|
1577
|
+
p.length > 1 ? /* @__PURE__ */ e.jsx(Dt, {}) : null
|
|
1577
1578
|
]
|
|
1578
1579
|
}
|
|
1579
1580
|
) }),
|
|
1580
1581
|
/* @__PURE__ */ e.jsx(qt, { children: /* @__PURE__ */ e.jsx(W, { className: "bg-background", children: /* @__PURE__ */ e.jsx(
|
|
1581
1582
|
Dr,
|
|
1582
1583
|
{
|
|
1583
|
-
units:
|
|
1584
|
+
units: p,
|
|
1584
1585
|
current: h,
|
|
1585
1586
|
onSelect: (m) => {
|
|
1586
1587
|
t(!1), g(m), oe(m);
|
|
@@ -1589,34 +1590,34 @@ const Nr = ({ property: r, onChange: s }) => {
|
|
|
1589
1590
|
) }) })
|
|
1590
1591
|
] })
|
|
1591
1592
|
] }),
|
|
1592
|
-
["none", "auto"].indexOf(h) !== -1 ||
|
|
1593
|
+
["none", "auto"].indexOf(h) !== -1 || S ? null : /* @__PURE__ */ e.jsx(
|
|
1593
1594
|
Ar,
|
|
1594
1595
|
{
|
|
1595
|
-
onDragStart: () =>
|
|
1596
|
+
onDragStart: () => j(!0),
|
|
1596
1597
|
onDragEnd: (m) => {
|
|
1597
|
-
if (
|
|
1598
|
+
if ($(() => ""), j(!1), b(m))
|
|
1598
1599
|
return;
|
|
1599
|
-
const w = `${m}`,
|
|
1600
|
-
|
|
1600
|
+
const w = `${m}`, F = `${w.startsWith("-") ? "-" : ""}${i}[${w.replace("-", "")}${h === "-" ? "" : h}]`;
|
|
1601
|
+
v(F);
|
|
1601
1602
|
},
|
|
1602
1603
|
onDrag: (m) => {
|
|
1603
|
-
if (
|
|
1604
|
+
if (b(m))
|
|
1604
1605
|
return;
|
|
1605
|
-
|
|
1606
|
-
const w = `${m}`,
|
|
1607
|
-
|
|
1606
|
+
$(m);
|
|
1607
|
+
const w = `${m}`, F = `${w.startsWith("-") ? "-" : ""}${i}[${w.replace("-", "")}${h === "-" ? "" : h}]`;
|
|
1608
|
+
C(F);
|
|
1608
1609
|
},
|
|
1609
1610
|
currentValue: a,
|
|
1610
1611
|
unit: h,
|
|
1611
|
-
negative:
|
|
1612
|
-
cssProperty:
|
|
1612
|
+
negative: c,
|
|
1613
|
+
cssProperty: n
|
|
1613
1614
|
}
|
|
1614
1615
|
)
|
|
1615
1616
|
] }) }) });
|
|
1616
1617
|
}, le = (r) => {
|
|
1617
|
-
const
|
|
1618
|
-
return mt(
|
|
1619
|
-
}, Ir = (r,
|
|
1618
|
+
const o = ce();
|
|
1619
|
+
return mt(o, { property: r });
|
|
1620
|
+
}, Ir = (r, o) => {
|
|
1620
1621
|
const t = {
|
|
1621
1622
|
xs: 0,
|
|
1622
1623
|
sm: 1,
|
|
@@ -1625,8 +1626,8 @@ const Nr = ({ property: r, onChange: s }) => {
|
|
|
1625
1626
|
xl: 4,
|
|
1626
1627
|
"2xl": 5
|
|
1627
1628
|
};
|
|
1628
|
-
return t[u(r, "mq", "xs")] <= t[
|
|
1629
|
-
},
|
|
1629
|
+
return t[u(r, "mq", "xs")] <= t[o];
|
|
1630
|
+
}, Pr = {
|
|
1630
1631
|
width: "w-",
|
|
1631
1632
|
height: "h-",
|
|
1632
1633
|
minWidth: "min-w-",
|
|
@@ -1699,56 +1700,56 @@ const Nr = ({ property: r, onChange: s }) => {
|
|
|
1699
1700
|
lg: "1024px",
|
|
1700
1701
|
xl: "1280px",
|
|
1701
1702
|
"2xl": "1536px"
|
|
1702
|
-
},
|
|
1703
|
-
const { type:
|
|
1704
|
-
}, units:
|
|
1705
|
-
(
|
|
1706
|
-
const
|
|
1707
|
-
(i ||
|
|
1708
|
-
const oe = sr(
|
|
1709
|
-
h(y, [oe],
|
|
1703
|
+
}, Lr = (r) => `${r.toUpperCase()} ${Ie[r] ? `(${Ie[r]} & up)` : ""}`, ke = (r) => {
|
|
1704
|
+
const { type: o = "icons", label: t, property: a, onEmitChange: l = () => {
|
|
1705
|
+
}, units: s, negative: d = !1 } = r, [i] = Ft(), [n] = qe(), [, p] = Ve(), c = le(a), h = Ue(), g = Ge(), [y] = Ke(), x = R(() => u(c, "fullCls", ""), [c]), f = L(
|
|
1706
|
+
(v, C = !0) => {
|
|
1707
|
+
const _ = { dark: i, mq: p, mod: n, cls: v, property: a, fullCls: "" };
|
|
1708
|
+
(i || n !== "") && (_.mq = "xs");
|
|
1709
|
+
const oe = sr(_);
|
|
1710
|
+
h(y, [oe], C);
|
|
1710
1711
|
},
|
|
1711
|
-
[y, i,
|
|
1712
|
-
),
|
|
1712
|
+
[y, i, p, n, a, h]
|
|
1713
|
+
), $ = L(() => {
|
|
1713
1714
|
g(y, [x]);
|
|
1714
|
-
}, [y, x, g]),
|
|
1715
|
+
}, [y, x, g]), S = R(() => Ir(c, p), [c, p]);
|
|
1715
1716
|
M(() => {
|
|
1716
|
-
|
|
1717
|
-
}, [
|
|
1718
|
-
const [, ,
|
|
1719
|
-
(
|
|
1720
|
-
|
|
1717
|
+
l(S, c);
|
|
1718
|
+
}, [S, l, c]);
|
|
1719
|
+
const [, , j] = Ve(), I = L(
|
|
1720
|
+
(v) => {
|
|
1721
|
+
j({
|
|
1721
1722
|
xs: 400,
|
|
1722
1723
|
sm: 640,
|
|
1723
1724
|
md: 800,
|
|
1724
1725
|
lg: 1024,
|
|
1725
1726
|
xl: 1420,
|
|
1726
1727
|
"2xl": 1920
|
|
1727
|
-
}[
|
|
1728
|
+
}[v]);
|
|
1728
1729
|
},
|
|
1729
|
-
[
|
|
1730
|
-
), B = u(
|
|
1731
|
-
return /* @__PURE__ */ e.jsx(kr, { canChange:
|
|
1732
|
-
/* @__PURE__ */ e.jsx("div", { className: "relative w-[70px] truncate text-xs text-foreground", children: /* @__PURE__ */ e.jsx("span", { className: `text-[11px] ${
|
|
1730
|
+
[j]
|
|
1731
|
+
), B = u(c, "dark", null) === i && u(c, "mod", null) === n && u(c, "mq", null) === p;
|
|
1732
|
+
return /* @__PURE__ */ e.jsx(kr, { canChange: S, canReset: c && B, children: /* @__PURE__ */ e.jsxs("div", { className: "group flex flex-row items-center py-2 first:pt-0 last:pb-0", children: [
|
|
1733
|
+
/* @__PURE__ */ e.jsx("div", { className: "relative w-[70px] truncate text-xs text-foreground", children: /* @__PURE__ */ e.jsx("span", { className: `text-[11px] ${c && !B ? "text-foreground" : ""}`, children: t }) }),
|
|
1733
1734
|
/* @__PURE__ */ e.jsxs("div", { className: "flex flex-row items-center", children: [
|
|
1734
1735
|
/* @__PURE__ */ e.jsxs("div", { className: "w-[150px]", children: [
|
|
1735
|
-
|
|
1736
|
+
o === "arbitrary" ? /* @__PURE__ */ e.jsx(
|
|
1736
1737
|
$r,
|
|
1737
1738
|
{
|
|
1738
|
-
currentClass: u(
|
|
1739
|
-
classPrefix: u(
|
|
1740
|
-
units:
|
|
1741
|
-
onChange:
|
|
1739
|
+
currentClass: u(c, "cls", ""),
|
|
1740
|
+
classPrefix: u(Pr, a, ""),
|
|
1741
|
+
units: s || [],
|
|
1742
|
+
onChange: f,
|
|
1742
1743
|
negative: d,
|
|
1743
1744
|
cssProperty: a
|
|
1744
1745
|
}
|
|
1745
1746
|
) : null,
|
|
1746
|
-
|
|
1747
|
-
|
|
1748
|
-
|
|
1749
|
-
|
|
1747
|
+
o === "icons" && /* @__PURE__ */ e.jsx(Sr, { property: a, onChange: f }),
|
|
1748
|
+
o === "range" && /* @__PURE__ */ e.jsx(Nr, { property: a, onChange: f }),
|
|
1749
|
+
o === "color" && /* @__PURE__ */ e.jsx(Rr, { property: a, onChange: f }),
|
|
1750
|
+
o === "dropdown" && /* @__PURE__ */ e.jsx(lt, { label: t, property: a, onChange: f })
|
|
1750
1751
|
] }),
|
|
1751
|
-
/* @__PURE__ */ e.jsx("div", { className: `w-[30px] cursor-pointer ${x ? "visible" : "invisible"}`, children: B ? /* @__PURE__ */ e.jsx("button", { type: "button", onClick: () =>
|
|
1752
|
+
/* @__PURE__ */ e.jsx("div", { className: `w-[30px] cursor-pointer ${x ? "visible" : "invisible"}`, children: B ? /* @__PURE__ */ e.jsx("button", { type: "button", onClick: () => $(), 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" }) }) : S && c ? /* @__PURE__ */ e.jsxs(Y, { delayDuration: 100, children: [
|
|
1752
1753
|
/* @__PURE__ */ e.jsx(X, { asChild: !0, children: /* @__PURE__ */ e.jsx(
|
|
1753
1754
|
"button",
|
|
1754
1755
|
{
|
|
@@ -1760,19 +1761,19 @@ const Nr = ({ property: r, onChange: s }) => {
|
|
|
1760
1761
|
/* @__PURE__ */ e.jsx(W, { children: /* @__PURE__ */ e.jsx("div", { className: "text-right", children: /* @__PURE__ */ e.jsxs("div", { children: [
|
|
1761
1762
|
"Current style is set at ",
|
|
1762
1763
|
/* @__PURE__ */ e.jsxs("span", { className: "font-bold ", children: [
|
|
1763
|
-
|
|
1764
|
-
i && !
|
|
1764
|
+
Lr(u(c, "mq")),
|
|
1765
|
+
i && !c.dark ? "(Light mode)" : ""
|
|
1765
1766
|
] }),
|
|
1766
1767
|
/* @__PURE__ */ e.jsx("br", {}),
|
|
1767
1768
|
/* @__PURE__ */ e.jsxs(
|
|
1768
1769
|
"button",
|
|
1769
1770
|
{
|
|
1770
1771
|
type: "button",
|
|
1771
|
-
onClick: () =>
|
|
1772
|
+
onClick: () => I(u(c, "mq")),
|
|
1772
1773
|
className: "block w-full cursor-default text-right font-semibold text-blue-500",
|
|
1773
1774
|
children: [
|
|
1774
1775
|
"Switch to ",
|
|
1775
|
-
u(
|
|
1776
|
+
u(c, "mq").toUpperCase()
|
|
1776
1777
|
]
|
|
1777
1778
|
}
|
|
1778
1779
|
)
|
|
@@ -1782,14 +1783,14 @@ const Nr = ({ property: r, onChange: s }) => {
|
|
|
1782
1783
|
] }) });
|
|
1783
1784
|
}, Or = ["px", "%", "em", "rem", "ch", "vh", "vw"], st = ({
|
|
1784
1785
|
label: r,
|
|
1785
|
-
options:
|
|
1786
|
+
options: o,
|
|
1786
1787
|
borderB: t = !1,
|
|
1787
1788
|
borderT: a = !1,
|
|
1788
|
-
type:
|
|
1789
|
-
units:
|
|
1789
|
+
type: l = "arbitrary",
|
|
1790
|
+
units: s = Or,
|
|
1790
1791
|
negative: d = !1
|
|
1791
1792
|
}) => {
|
|
1792
|
-
const [i,
|
|
1793
|
+
const [i, n] = k(o[0].key), p = ce(), c = L((h) => N(p, "property").includes(h), [p]);
|
|
1793
1794
|
return /* @__PURE__ */ e.jsxs(
|
|
1794
1795
|
"div",
|
|
1795
1796
|
{
|
|
@@ -1797,19 +1798,19 @@ const Nr = ({ property: r, onChange: s }) => {
|
|
|
1797
1798
|
children: [
|
|
1798
1799
|
/* @__PURE__ */ e.jsxs("div", { className: "flex flex-row text-xs", children: [
|
|
1799
1800
|
r && /* @__PURE__ */ e.jsx("span", { className: "relative w-[70px] flex-none text-xs text-foreground", children: r }),
|
|
1800
|
-
/* @__PURE__ */ e.jsx("div", { className: "mb-3 flex grow flex-row flex-wrap gap-x-px", children:
|
|
1801
|
-
|
|
1801
|
+
/* @__PURE__ */ e.jsx("div", { className: "mb-3 flex grow flex-row flex-wrap gap-x-px", children: P.Children.toArray(
|
|
1802
|
+
o.map(({ label: h, key: g }) => /* @__PURE__ */ e.jsx("div", { className: "first:rounded-l last:rounded-r", children: /* @__PURE__ */ e.jsxs(Y, { children: [
|
|
1802
1803
|
/* @__PURE__ */ e.jsx(X, { asChild: !0, children: /* @__PURE__ */ e.jsxs(
|
|
1803
1804
|
"button",
|
|
1804
1805
|
{
|
|
1805
1806
|
type: "button",
|
|
1806
|
-
onClick: () =>
|
|
1807
|
+
onClick: () => n(g),
|
|
1807
1808
|
className: `relative cursor-pointer rounded-full p-1 text-[8px] ${g === i ? " bg-[#3E57F0] text-white" : "text-gray-600 dark:text-gray-300"}`,
|
|
1808
1809
|
children: [
|
|
1809
|
-
|
|
1810
|
-
className:
|
|
1810
|
+
P.createElement("div", {
|
|
1811
|
+
className: c(g) ? "-bottom-1.5 absolute bg-[#3E57F0] h-[2px] left-0 w-full" : ""
|
|
1811
1812
|
}),
|
|
1812
|
-
|
|
1813
|
+
P.createElement(u(rt, g, Ye), { className: "text-inherit w-3 h-3" })
|
|
1813
1814
|
]
|
|
1814
1815
|
}
|
|
1815
1816
|
) }),
|
|
@@ -1820,8 +1821,8 @@ const Nr = ({ property: r, onChange: s }) => {
|
|
|
1820
1821
|
/* @__PURE__ */ e.jsx("div", { className: "mt-0 flex items-center", children: /* @__PURE__ */ e.jsx(
|
|
1821
1822
|
ke,
|
|
1822
1823
|
{
|
|
1823
|
-
type:
|
|
1824
|
-
units: [...
|
|
1824
|
+
type: l,
|
|
1825
|
+
units: [...s],
|
|
1825
1826
|
label: "",
|
|
1826
1827
|
property: i,
|
|
1827
1828
|
negative: d
|
|
@@ -1830,15 +1831,15 @@ const Nr = ({ property: r, onChange: s }) => {
|
|
|
1830
1831
|
]
|
|
1831
1832
|
}
|
|
1832
1833
|
);
|
|
1833
|
-
}, Mr = ({ heading: r, items:
|
|
1834
|
-
const t = ce(), a =
|
|
1835
|
-
const
|
|
1836
|
-
i.map((
|
|
1837
|
-
),
|
|
1838
|
-
|
|
1839
|
-
), d =
|
|
1840
|
-
return _e(
|
|
1841
|
-
}, [t,
|
|
1834
|
+
}, Mr = ({ heading: r, items: o }) => {
|
|
1835
|
+
const t = ce(), a = R(() => {
|
|
1836
|
+
const l = (i) => z(
|
|
1837
|
+
i.map((n) => n.styleType === "multiple" ? N(n.options, "key") : n.property)
|
|
1838
|
+
), s = z(
|
|
1839
|
+
o.map((i) => i.styleType === "accordion" ? l(i.items) : i.styleType === "multiple" ? N(i.options, "key") : i.property)
|
|
1840
|
+
), d = N(t, "property");
|
|
1841
|
+
return _e(s, d).length > 0;
|
|
1842
|
+
}, [t, o]);
|
|
1842
1843
|
return /* @__PURE__ */ e.jsxs("details", { children: [
|
|
1843
1844
|
/* @__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: [
|
|
1844
1845
|
r,
|
|
@@ -1849,54 +1850,54 @@ const Nr = ({ property: r, onChange: s }) => {
|
|
|
1849
1850
|
}
|
|
1850
1851
|
) : null
|
|
1851
1852
|
] }) }),
|
|
1852
|
-
/* @__PURE__ */ e.jsx("div", { className: "p-2", children:
|
|
1853
|
+
/* @__PURE__ */ e.jsx("div", { className: "p-2", children: o.map((l) => l.styleType === "multiple" ? /* @__PURE__ */ e.jsx(st, { ...l }, l.label) : /* @__PURE__ */ e.jsx(ke, { ...l }, l.label)) })
|
|
1853
1854
|
] });
|
|
1854
|
-
}, _r =
|
|
1855
|
-
const
|
|
1856
|
-
(
|
|
1855
|
+
}, _r = Pe({}), ge = ({ section: r }) => {
|
|
1856
|
+
const o = ce(), t = L(
|
|
1857
|
+
(s = []) => {
|
|
1857
1858
|
const d = {};
|
|
1858
|
-
for (let
|
|
1859
|
-
d[
|
|
1859
|
+
for (let n = 0; n < o.length; n++)
|
|
1860
|
+
d[o[n].property] = o[n].cls;
|
|
1860
1861
|
let i = !0;
|
|
1861
|
-
for (const
|
|
1862
|
-
if (!ue(d,
|
|
1862
|
+
for (const n in s)
|
|
1863
|
+
if (!ue(d, n) || d[n] !== s[n]) {
|
|
1863
1864
|
i = !1;
|
|
1864
1865
|
break;
|
|
1865
1866
|
}
|
|
1866
1867
|
return i;
|
|
1867
1868
|
},
|
|
1868
|
-
[
|
|
1869
|
-
), a =
|
|
1870
|
-
if (
|
|
1869
|
+
[o]
|
|
1870
|
+
), a = R(() => {
|
|
1871
|
+
if (o.length > 0 && r.heading === "Classes")
|
|
1871
1872
|
return !0;
|
|
1872
|
-
const
|
|
1873
|
-
|
|
1873
|
+
const s = (n) => z(
|
|
1874
|
+
n.map((p) => p.styleType === "multiple" ? z(N(p.options, "key")) : p.property)
|
|
1874
1875
|
), d = z(
|
|
1875
|
-
r.items.map((
|
|
1876
|
-
), i =
|
|
1876
|
+
r.items.map((n) => n.styleType === "accordion" ? s(n.items) : n.styleType === "multiple" ? z(N(n.options, "key")) : n.property)
|
|
1877
|
+
), i = N(o, "property");
|
|
1877
1878
|
return _e(d, i).length > 0;
|
|
1878
|
-
}, [
|
|
1879
|
-
return /* @__PURE__ */ e.jsx(_r.Provider, { value:
|
|
1879
|
+
}, [o, r.heading, r.items]), l = R(() => ({}), []);
|
|
1880
|
+
return /* @__PURE__ */ e.jsx(_r.Provider, { value: l, children: /* @__PURE__ */ e.jsxs(ae, { value: r.heading, children: [
|
|
1880
1881
|
/* @__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: [
|
|
1881
1882
|
/* @__PURE__ */ e.jsx("div", { className: `h-[8px] w-[8px] rounded-full ${a ? "bg-blue-500" : "bg-gray-300"}` }),
|
|
1882
1883
|
r.heading
|
|
1883
1884
|
] }) }),
|
|
1884
|
-
/* @__PURE__ */ e.jsx(de, { className: "bg-gray-100 px-3.5 py-2", children:
|
|
1885
|
-
r.items.map((
|
|
1885
|
+
/* @__PURE__ */ e.jsx(de, { className: "bg-gray-100 px-3.5 py-2", children: P.Children.toArray(
|
|
1886
|
+
r.items.map((s) => ue(s, "component") ? P.createElement(s.component, { key: s.label }) : ue(s, "styleType") ? s.styleType === "multiple" ? /* @__PURE__ */ e.jsx(st, { ...s }, s.label) : s.styleType === "accordion" && t(s == null ? void 0 : s.conditions) ? /* @__PURE__ */ e.jsx(Mr, { ...s }, s.label) : null : /* @__PURE__ */ e.jsx(ke, { ...s }, s.label))
|
|
1886
1887
|
) })
|
|
1887
1888
|
] }) });
|
|
1888
1889
|
}, Er = ({
|
|
1889
1890
|
item: r,
|
|
1890
|
-
index:
|
|
1891
|
+
index: o,
|
|
1891
1892
|
canDelete: t,
|
|
1892
1893
|
onChange: a,
|
|
1893
|
-
onRemove:
|
|
1894
|
+
onRemove: l
|
|
1894
1895
|
}) => /* @__PURE__ */ e.jsxs("div", { className: `flex flex-col gap-1 border-gray-400 py-2 ${t ? "border-b" : ""}`, children: [
|
|
1895
1896
|
/* @__PURE__ */ e.jsx(
|
|
1896
1897
|
"input",
|
|
1897
1898
|
{
|
|
1898
1899
|
name: "key",
|
|
1899
|
-
onChange: (
|
|
1900
|
+
onChange: (s) => a(s, o),
|
|
1900
1901
|
value: r.key,
|
|
1901
1902
|
placeholder: "Key",
|
|
1902
1903
|
className: "w-full rounded border-gray-300 bg-background p-0.5 pl-2 text-sm focus-visible:outline-0",
|
|
@@ -1909,7 +1910,7 @@ const Nr = ({ property: r, onChange: s }) => {
|
|
|
1909
1910
|
"input",
|
|
1910
1911
|
{
|
|
1911
1912
|
name: "value",
|
|
1912
|
-
onChange: (
|
|
1913
|
+
onChange: (s) => b(r.key) ? {} : a(s, o),
|
|
1913
1914
|
value: r.value,
|
|
1914
1915
|
placeholder: "Value",
|
|
1915
1916
|
className: "w-full rounded border-gray-300 bg-background p-0.5 pl-2 text-sm focus-visible:outline-0",
|
|
@@ -1920,39 +1921,39 @@ const Nr = ({ property: r, onChange: s }) => {
|
|
|
1920
1921
|
/* @__PURE__ */ e.jsx(
|
|
1921
1922
|
Xe,
|
|
1922
1923
|
{
|
|
1923
|
-
onClick:
|
|
1924
|
+
onClick: l,
|
|
1924
1925
|
className: "h-6 w-6 cursor-pointer rounded border border-red-400 p-1 text-red-400 hover:opacity-80"
|
|
1925
1926
|
}
|
|
1926
1927
|
)
|
|
1927
1928
|
] })
|
|
1928
1929
|
] }), Fr = ({ section: r }) => {
|
|
1929
1930
|
var g;
|
|
1930
|
-
const { setSyncState:
|
|
1931
|
+
const { setSyncState: o } = Yt(), t = te(), [a, l] = k([]), [s] = je(), d = ze(), i = `${u(s, "0.prop")}_attrs`;
|
|
1931
1932
|
se.useEffect(() => {
|
|
1932
|
-
const y =
|
|
1933
|
-
|
|
1933
|
+
const y = N(u(t, i), (x, f) => ({ key: f, value: x }));
|
|
1934
|
+
b(y) ? l([]) : l(y);
|
|
1934
1935
|
}, [u(t, i)]);
|
|
1935
|
-
const
|
|
1936
|
-
const x = Oe(a, (
|
|
1936
|
+
const n = () => l([...a, { key: "", value: "" }]), p = (y) => {
|
|
1937
|
+
const x = Oe(a, (f, $) => y !== $);
|
|
1937
1938
|
h(x);
|
|
1938
|
-
},
|
|
1939
|
-
const
|
|
1940
|
-
|
|
1939
|
+
}, c = (y, x) => {
|
|
1940
|
+
const f = [...a];
|
|
1941
|
+
f[x][y.target.name] = y.target.value, h(f);
|
|
1941
1942
|
}, h = se.useCallback(
|
|
1942
1943
|
(y = []) => {
|
|
1943
1944
|
const x = {};
|
|
1944
|
-
be(y, (
|
|
1945
|
-
f
|
|
1946
|
-
}), d([u(t, "_id")], { [i]: x }),
|
|
1945
|
+
be(y, (f) => {
|
|
1946
|
+
b(f.key) || Le(x, f.key, f.value);
|
|
1947
|
+
}), d([u(t, "_id")], { [i]: x }), o("UNSAVED");
|
|
1947
1948
|
},
|
|
1948
|
-
[t,
|
|
1949
|
+
[t, o, d, i]
|
|
1949
1950
|
);
|
|
1950
1951
|
return /* @__PURE__ */ e.jsxs(ae, { value: r.heading, children: [
|
|
1951
1952
|
/* @__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: [
|
|
1952
1953
|
/* @__PURE__ */ e.jsx(
|
|
1953
1954
|
"div",
|
|
1954
1955
|
{
|
|
1955
|
-
className: `h-[8px] w-[8px] rounded-full ${
|
|
1956
|
+
className: `h-[8px] w-[8px] rounded-full ${b(u(t, i)) ? "bg-gray-300" : "bg-blue-500"}`
|
|
1956
1957
|
}
|
|
1957
1958
|
),
|
|
1958
1959
|
"Attributes"
|
|
@@ -1963,10 +1964,10 @@ const Nr = ({ property: r, onChange: s }) => {
|
|
|
1963
1964
|
/* @__PURE__ */ e.jsxs(
|
|
1964
1965
|
"div",
|
|
1965
1966
|
{
|
|
1966
|
-
className: `flex h-6 w-max items-center justify-center gap-x-0.5 rounded-full border p-1 px-2 text-xs ${!
|
|
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(a) && b((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"}`,
|
|
1967
1968
|
onClick: () => {
|
|
1968
1969
|
var y;
|
|
1969
|
-
!
|
|
1970
|
+
!b(a) && b((y = he(a)) == null ? void 0 : y.key) || n();
|
|
1970
1971
|
},
|
|
1971
1972
|
children: [
|
|
1972
1973
|
/* @__PURE__ */ e.jsx(ve, { width: 12, height: 12 }),
|
|
@@ -1976,18 +1977,18 @@ const Nr = ({ property: r, onChange: s }) => {
|
|
|
1976
1977
|
)
|
|
1977
1978
|
] }),
|
|
1978
1979
|
/* @__PURE__ */ e.jsxs("div", { className: "flex flex-col", children: [
|
|
1979
|
-
|
|
1980
|
+
b(a) && /* @__PURE__ */ e.jsx("div", { className: "flex h-12 items-center justify-center text-sm text-gray-400", children: "Click + Add to add attributes" }),
|
|
1980
1981
|
se.Children.toArray(
|
|
1981
|
-
|
|
1982
|
-
const
|
|
1982
|
+
N(a, (y, x) => {
|
|
1983
|
+
const f = a.length > 0 && x < a.length - 1;
|
|
1983
1984
|
return /* @__PURE__ */ e.jsx(
|
|
1984
1985
|
Er,
|
|
1985
1986
|
{
|
|
1986
1987
|
item: y,
|
|
1987
1988
|
index: x,
|
|
1988
|
-
canDelete:
|
|
1989
|
-
onChange:
|
|
1990
|
-
onRemove: () =>
|
|
1989
|
+
canDelete: f,
|
|
1990
|
+
onChange: c,
|
|
1991
|
+
onRemove: () => p(x)
|
|
1991
1992
|
}
|
|
1992
1993
|
);
|
|
1993
1994
|
})
|
|
@@ -1997,10 +1998,10 @@ const Nr = ({ property: r, onChange: s }) => {
|
|
|
1997
1998
|
] });
|
|
1998
1999
|
};
|
|
1999
2000
|
function Yr() {
|
|
2000
|
-
const [r,
|
|
2001
|
-
return
|
|
2001
|
+
const [r, o] = qe(), { flexChild: t, gridChild: a } = Xt(), [, l] = rr(Wt), { t: s } = Ee(), [d] = je();
|
|
2002
|
+
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: [
|
|
2002
2003
|
/* @__PURE__ */ e.jsx(We, { className: "mx-auto text-3xl" }),
|
|
2003
|
-
/* @__PURE__ */ e.jsx("h1", { children:
|
|
2004
|
+
/* @__PURE__ */ e.jsx("h1", { children: s("no_styling_block_selected") }),
|
|
2004
2005
|
/* @__PURE__ */ e.jsxs("p", { className: "text-xs ", children: [
|
|
2005
2006
|
"Hint: Styling allowed blocks are highlighted with",
|
|
2006
2007
|
" ",
|
|
@@ -2009,10 +2010,10 @@ function Yr() {
|
|
|
2009
2010
|
] })
|
|
2010
2011
|
] }) }) : (
|
|
2011
2012
|
// eslint-disable-next-line jsx-a11y/click-events-have-key-events,jsx-a11y/no-static-element-interactions
|
|
2012
|
-
/* @__PURE__ */ e.jsxs("div", { onClick: () =>
|
|
2013
|
+
/* @__PURE__ */ e.jsxs("div", { onClick: () => l(!1), className: "flex h-full flex-col", children: [
|
|
2013
2014
|
/* @__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: [
|
|
2014
2015
|
/* @__PURE__ */ e.jsx(Ce, { htmlFor: "", className: "flex gap-x-1.5 text-xs italic", children: "State" }),
|
|
2015
|
-
/* @__PURE__ */ e.jsxs(dr, { defaultValue: r, onValueChange: (i) =>
|
|
2016
|
+
/* @__PURE__ */ e.jsxs(dr, { defaultValue: r, onValueChange: (i) => o(i), children: [
|
|
2016
2017
|
/* @__PURE__ */ e.jsx(cr, { className: "h-auto w-fit p-1 px-3", children: /* @__PURE__ */ e.jsx(pr, { placeholder: "State" }) }),
|
|
2017
2018
|
/* @__PURE__ */ e.jsxs(ur, { children: [
|
|
2018
2019
|
/* @__PURE__ */ e.jsx(A, { value: "", children: "Normal" }),
|
|
@@ -2054,9 +2055,9 @@ const Xr = {
|
|
|
2054
2055
|
deg: 1,
|
|
2055
2056
|
ms: 0.1
|
|
2056
2057
|
}, Xl = () => {
|
|
2057
|
-
const r = te(), { t:
|
|
2058
|
-
onDrag: (
|
|
2059
|
-
onDragEnd: (
|
|
2058
|
+
const r = te(), { t: o } = Ee(), [t, a] = P.useState(""), [l, s] = P.useState({
|
|
2059
|
+
onDrag: (n) => n,
|
|
2060
|
+
onDragEnd: (n) => n,
|
|
2060
2061
|
dragStartY: 0,
|
|
2061
2062
|
dragging: !1,
|
|
2062
2063
|
dragStartValue: 0,
|
|
@@ -2064,21 +2065,21 @@ const Xr = {
|
|
|
2064
2065
|
negative: !1,
|
|
2065
2066
|
cssProperty: ""
|
|
2066
2067
|
}), d = xe(
|
|
2067
|
-
(
|
|
2068
|
-
const
|
|
2069
|
-
let h = parseFloat(
|
|
2068
|
+
(n) => {
|
|
2069
|
+
const p = !u(l, "negative", !1), c = u(l, "cssProperty", "");
|
|
2070
|
+
let h = parseFloat(l.dragStartValue);
|
|
2070
2071
|
h = Me(h) ? 0 : h;
|
|
2071
|
-
let g = Xr[
|
|
2072
|
-
(Z(
|
|
2073
|
-
let x = (
|
|
2074
|
-
|
|
2072
|
+
let g = Xr[l.dragUnit];
|
|
2073
|
+
(Z(c, "scale") || c === "opacity") && (g = 10);
|
|
2074
|
+
let x = (l.dragStartY - n.pageY) / g + h;
|
|
2075
|
+
p && x < 0 && (x = 0), c === "opacity" && x > 1 && (x = 1), l.onDrag(`${x}`), a(`${x}`);
|
|
2075
2076
|
},
|
|
2076
|
-
[
|
|
2077
|
+
[l],
|
|
2077
2078
|
50
|
|
2078
|
-
), i =
|
|
2079
|
-
setTimeout(() =>
|
|
2080
|
-
onDrag: (
|
|
2081
|
-
onDragEnd: (
|
|
2079
|
+
), i = L(() => {
|
|
2080
|
+
setTimeout(() => l.onDragEnd(`${t}`), 100), s({
|
|
2081
|
+
onDrag: (n) => n,
|
|
2082
|
+
onDragEnd: (n) => n,
|
|
2082
2083
|
dragStartY: 0,
|
|
2083
2084
|
dragging: !1,
|
|
2084
2085
|
dragStartValue: 0,
|
|
@@ -2086,12 +2087,12 @@ const Xr = {
|
|
|
2086
2087
|
negative: !1,
|
|
2087
2088
|
cssProperty: ""
|
|
2088
2089
|
});
|
|
2089
|
-
}, [
|
|
2090
|
+
}, [l, t, s]);
|
|
2090
2091
|
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: [
|
|
2091
2092
|
/* @__PURE__ */ e.jsx(We, { className: "mx-auto text-3xl" }),
|
|
2092
|
-
/* @__PURE__ */ e.jsx("h1", { children:
|
|
2093
|
-
] }) }) : /* @__PURE__ */ e.jsxs(ot.Provider, { value: { setDragData:
|
|
2094
|
-
|
|
2093
|
+
/* @__PURE__ */ e.jsx("h1", { children: o("no_block_selected_for_styling") })
|
|
2094
|
+
] }) }) : /* @__PURE__ */ e.jsxs(ot.Provider, { value: { setDragData: s }, children: [
|
|
2095
|
+
l.dragging ? /* @__PURE__ */ e.jsx(
|
|
2095
2096
|
"div",
|
|
2096
2097
|
{
|
|
2097
2098
|
onMouseMove: d,
|
|
@@ -2100,19 +2101,19 @@ const Xr = {
|
|
|
2100
2101
|
}
|
|
2101
2102
|
) : null,
|
|
2102
2103
|
/* @__PURE__ */ e.jsxs(It, { defaultValue: "settings", className: "flex h-full w-full flex-col py-1", children: [
|
|
2103
|
-
/* @__PURE__ */ e.jsxs(
|
|
2104
|
+
/* @__PURE__ */ e.jsxs(Pt, { className: "mx-1 grid grid-cols-2", children: [
|
|
2104
2105
|
/* @__PURE__ */ e.jsx(Re, { value: "settings", children: "Settings" }),
|
|
2105
2106
|
/* @__PURE__ */ e.jsx(Re, { value: "styling", children: "Styling" })
|
|
2106
2107
|
] }),
|
|
2107
2108
|
/* @__PURE__ */ e.jsx(
|
|
2108
|
-
|
|
2109
|
+
He,
|
|
2109
2110
|
{
|
|
2110
2111
|
value: "settings",
|
|
2111
2112
|
className: "no-scrollbar -mx-1 -mr-2 h-full flex-1 overflow-y-auto overflow-x-hidden",
|
|
2112
2113
|
children: /* @__PURE__ */ e.jsx(fr, {})
|
|
2113
2114
|
}
|
|
2114
2115
|
),
|
|
2115
|
-
/* @__PURE__ */ e.jsx(
|
|
2116
|
+
/* @__PURE__ */ e.jsx(He, { value: "styling", className: "flex-1 overflow-y-auto overflow-x-hidden", children: /* @__PURE__ */ e.jsx(Yr, {}) })
|
|
2116
2117
|
] })
|
|
2117
2118
|
] });
|
|
2118
2119
|
};
|