@chaibuilder/sdk 0.1.16 → 0.1.18
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-5cb44efb.cjs +3 -0
- package/dist/{AddBlocks-6f4db22d.js → AddBlocks-c47af38f.js} +49 -45
- package/dist/BrandingOptions-4f3e3a8d.cjs +1 -0
- package/dist/{BrandingOptions-d6351932.js → BrandingOptions-52b2de6f.js} +11 -7
- package/dist/CanvasArea-90a395c1.js +1311 -0
- package/dist/CanvasArea-aef3fa5e.cjs +46 -0
- package/dist/{CurrentPage-e8f8ff05.js → CurrentPage-2721bc7b.js} +18 -14
- package/dist/CurrentPage-d1ec06db.cjs +1 -0
- package/dist/{ImagesPanel-68a11293.cjs → ImagesPanel-0db5c72f.cjs} +1 -1
- package/dist/{ImagesPanel-996761b1.js → ImagesPanel-38c44785.js} +1 -1
- package/dist/{Layers-6fc21e86.js → Layers-a9cf4d7c.js} +144 -142
- package/dist/Layers-d0edf1a8.cjs +1 -0
- package/dist/{MarkAsGlobalBlock-cf7e8b31.js → MarkAsGlobalBlock-0cf6e5a2.js} +15 -11
- package/dist/MarkAsGlobalBlock-c43c3b2c.cjs +1 -0
- package/dist/PagesPanel-22050a98.cjs +1 -0
- package/dist/{PagesPanel-7db807df.js → PagesPanel-589544c2.js} +12 -8
- package/dist/ProjectPanel-215ba7f1.cjs +1 -0
- package/dist/{ProjectPanel-a7c78e1f.js → ProjectPanel-dbea8af1.js} +12 -8
- package/dist/Settings-71c0312b.cjs +1 -0
- package/dist/{Settings-1e6e0534.js → Settings-c347533e.js} +909 -640
- package/dist/SidePanels-214fef72.js +2999 -0
- package/dist/SidePanels-3844d8b5.cjs +13 -0
- package/dist/{Topbar-4f1aca98.js → Topbar-1dd5c34e.js} +23 -19
- package/dist/Topbar-4fa3ab61.cjs +1 -0
- package/dist/{UnsplashImages-f761ad96.cjs → UnsplashImages-0d091e33.cjs} +1 -1
- package/dist/{UnsplashImages-47374e0c.js → UnsplashImages-10c95b63.js} +1 -1
- package/dist/{UploadImages-33c1507a.cjs → UploadImages-10439fde.cjs} +1 -1
- package/dist/{UploadImages-f0ba3215.js → UploadImages-b14bd152.js} +1 -1
- package/dist/_commonjsHelpers-10dfc225.js +8 -0
- package/dist/_commonjsHelpers-87b0abe8.cjs +1 -0
- package/dist/add-page-modal-05c947fb.cjs +1 -0
- package/dist/{add-page-modal-d4f5ba20.js → add-page-modal-5cc1393d.js} +14 -11
- package/dist/card-14e1d020.cjs +1 -0
- package/dist/card-f8f4f985.js +33 -0
- package/dist/core.cjs +1 -1
- package/dist/core.d.ts +6 -4
- package/dist/core.js +63 -59
- package/dist/delete-page-modal-859c3a09.cjs +1 -0
- package/dist/{delete-page-modal-00d5fbab.js → delete-page-modal-a79bfc45.js} +15 -11
- package/dist/{form-bf09d392.js → form-725e3191.js} +3 -3
- package/dist/{form-5d04c9b3.cjs → form-99b51245.cjs} +1 -1
- package/dist/index-dfeadcce.cjs +164 -0
- package/dist/index-f8a2f8ef.js +31068 -0
- package/dist/{link-6467eda6.js → link-2af5de8b.js} +1 -1
- package/dist/{link-4585b2d6.cjs → link-86ac8848.cjs} +1 -1
- package/dist/page-viewer-aac7b439.cjs +1 -0
- package/dist/{page-viewer-c494031b.js → page-viewer-c6421156.js} +22 -18
- package/dist/project-general-setting-ce814ecf.cjs +1 -0
- package/dist/{project-general-setting-fca12629.js → project-general-setting-f9fd21cc.js} +9 -7
- package/dist/{project-seo-setting-3f645a02.cjs → project-seo-setting-a9403f1d.cjs} +1 -1
- package/dist/{project-seo-setting-e9587467.js → project-seo-setting-c1980ec3.js} +3 -3
- package/dist/render.cjs +1 -1
- package/dist/render.js +1 -1
- package/dist/{scroll-area-9f64a082.js → scroll-area-83bd9e8f.js} +7 -7
- package/dist/{scroll-area-088530b9.cjs → scroll-area-bb343b86.cjs} +1 -1
- package/dist/{single-page-detail-ff7fceb1.js → single-page-detail-2ac00c2e.js} +32 -30
- package/dist/single-page-detail-dcbb3cab.cjs +1 -0
- package/dist/style.css +1 -1
- package/dist/textarea-20b2f6b2.cjs +1 -0
- package/dist/textarea-9dfb6a32.js +45 -0
- package/dist/ui.cjs +1 -1
- package/dist/ui.js +74 -73
- package/dist/useChaiExternalData-192c7896.js +5 -0
- package/dist/useChaiExternalData-a90e8aac.cjs +1 -0
- package/package.json +5 -3
- package/dist/AddBlocks-59a68fc9.cjs +0 -3
- package/dist/BrandingOptions-8e7a159f.cjs +0 -1
- package/dist/CanvasArea-08537c6e.cjs +0 -60
- package/dist/CanvasArea-a585620d.js +0 -1459
- package/dist/CurrentPage-cbbfdbf4.cjs +0 -1
- package/dist/Layers-636e0bc6.cjs +0 -1
- package/dist/MarkAsGlobalBlock-23dd24b9.cjs +0 -1
- package/dist/PagesPanel-bf13d0a5.cjs +0 -1
- package/dist/ProjectPanel-d98d3585.cjs +0 -1
- package/dist/Settings-1b76c006.cjs +0 -1
- package/dist/SidePanels-55124e18.cjs +0 -1
- package/dist/SidePanels-af4f2c45.js +0 -149
- package/dist/Topbar-5df341d7.cjs +0 -1
- package/dist/_commonjsHelpers-5a53b418.cjs +0 -1
- package/dist/_commonjsHelpers-d4512b9c.js +0 -6
- package/dist/add-page-modal-b685709e.cjs +0 -1
- package/dist/delete-page-modal-bbd3ffa2.cjs +0 -1
- package/dist/index-8a7a37ce.js +0 -5028
- package/dist/index-bf44bc93.cjs +0 -2
- package/dist/page-viewer-f0a54a92.cjs +0 -1
- package/dist/project-general-setting-a3e99d1e.cjs +0 -1
- package/dist/single-page-detail-84c67e67.cjs +0 -1
- package/dist/textarea-0750bcd2.js +0 -73
- package/dist/textarea-a338ede6.cjs +0 -1
|
@@ -1,31 +1,37 @@
|
|
|
1
1
|
import { j as e } from "./jsx-runtime-944c88e2.js";
|
|
2
|
-
import * as
|
|
3
|
-
import
|
|
4
|
-
import { useThrottledCallback as
|
|
5
|
-
import {
|
|
6
|
-
import { useTranslation as
|
|
7
|
-
import { PlusIcon as
|
|
8
|
-
import { T as
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import {
|
|
12
|
-
import { getBlockComponent as
|
|
13
|
-
import {
|
|
14
|
-
import
|
|
15
|
-
import
|
|
16
|
-
import
|
|
17
|
-
import { A as
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import { S as
|
|
24
|
-
import {
|
|
2
|
+
import * as se from "react";
|
|
3
|
+
import $, { useState as k, useEffect as M, useMemo as T, useCallback as I, createContext as Le, useContext as ee } from "react";
|
|
4
|
+
import { useThrottledCallback as xe } from "@react-hookz/web";
|
|
5
|
+
import { map as C, isEmpty as b, last as he, forEach as fe, set as Pe, startCase as Q, filter as Oe, get as g, isArray as me, omit as at, includes as O, toLower as ne, first as be, 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
|
+
import { useTranslation as Ee } from "react-i18next";
|
|
7
|
+
import { PlusIcon as ve, Cross2Icon as Fe, EyeOpenIcon as ft, 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 bt, 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 Xe, TriangleDownIcon as Dt, RowSpacingIcon as $t, TrashIcon as Ye, MixerHorizontalIcon as We } from "@radix-ui/react-icons";
|
|
8
|
+
import { T as It, a as Lt, b as Re, c as Ve } from "./tabs-85caa1e8.js";
|
|
9
|
+
import Pt from "@rjsf/core";
|
|
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 Xt, O as Yt, P as Wt } from "./index-f8a2f8ef.js";
|
|
12
|
+
import { getBlockComponent as Je, SingleLineText as Zt } from "@chaibuilder/blocks";
|
|
13
|
+
import { TrashIcon as zt, ChevronRight as Ut } from "lucide-react";
|
|
14
|
+
import Qe from "react-autosuggest";
|
|
15
|
+
import { u as Gt } from "./useChaiExternalData-192c7896.js";
|
|
16
|
+
import { d as X, e as Y, f as W, B as et, g as Kt } from "./useBuilderProp-81a14920.js";
|
|
17
|
+
import { A as tt, a as ae, b as ie, c as de } from "./accordion-c0176dc5.js";
|
|
18
|
+
import { R as qt, I as Jt, a as Qt, L as er } from "./link-2af5de8b.js";
|
|
19
|
+
import { useAtom as tr } from "jotai";
|
|
20
|
+
import rr from "fuse.js";
|
|
21
|
+
import { A as lr, C as pe, d as or } from "./html-to-json-8397fab5.js";
|
|
22
|
+
import { L as Ce } from "./label-e770a087.js";
|
|
23
|
+
import { S as sr } from "./MODIFIERS-c2e02614.js";
|
|
24
|
+
import { I as nr } from "./input-a0ea2bc7.js";
|
|
25
|
+
import { S as ar } from "./scroll-area-83bd9e8f.js";
|
|
26
|
+
import { S as ir, c as dr, b as cr, d as pr, f as A } from "./select-7fddd7c3.js";
|
|
25
27
|
import "@radix-ui/react-tabs";
|
|
26
28
|
import "./utils-ac68b2c8.js";
|
|
27
29
|
import "clsx";
|
|
28
30
|
import "tailwind-merge";
|
|
31
|
+
import "./_commonjsHelpers-10dfc225.js";
|
|
32
|
+
import "@radix-ui/react-scroll-area";
|
|
33
|
+
import "react-dom";
|
|
34
|
+
import "@floating-ui/react-dom";
|
|
29
35
|
import "i18next";
|
|
30
36
|
import "flagged";
|
|
31
37
|
import "react-dnd";
|
|
@@ -33,131 +39,402 @@ import "@minoru/react-dnd-treeview";
|
|
|
33
39
|
import "react-hotkeys-hook";
|
|
34
40
|
import "flat-to-nested";
|
|
35
41
|
import "redux-undo";
|
|
36
|
-
import "lucide-react";
|
|
37
42
|
import "sonner";
|
|
43
|
+
import "@radix-ui/react-slot";
|
|
44
|
+
import "class-variance-authority";
|
|
45
|
+
import "@radix-ui/react-tooltip";
|
|
46
|
+
import "@radix-ui/react-toast";
|
|
47
|
+
import "@radix-ui/react-accordion";
|
|
38
48
|
import "react-icons-picker";
|
|
39
|
-
import "react-dom";
|
|
40
49
|
import "./dialog-3d4e82ed.js";
|
|
41
50
|
import "@radix-ui/react-dialog";
|
|
42
|
-
import "./ImagesPanel-
|
|
51
|
+
import "./ImagesPanel-38c44785.js";
|
|
43
52
|
import "react-quill";
|
|
44
53
|
import "himalaya";
|
|
45
|
-
import "@radix-ui/react-slot";
|
|
46
|
-
import "class-variance-authority";
|
|
47
|
-
import "@radix-ui/react-tooltip";
|
|
48
|
-
import "@radix-ui/react-toast";
|
|
49
54
|
import "@radix-ui/react-label";
|
|
50
|
-
import "@radix-ui/react-accordion";
|
|
51
|
-
import "@radix-ui/react-scroll-area";
|
|
52
55
|
import "@radix-ui/react-select";
|
|
53
|
-
function
|
|
54
|
-
const
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
56
|
+
function ur(r) {
|
|
57
|
+
const s = [], t = {};
|
|
58
|
+
function n(l, a) {
|
|
59
|
+
fe(a, (d, i) => {
|
|
60
|
+
const o = l ? `${l}.${i}` : i, p = me(d) ? "list" : typeof d;
|
|
61
|
+
s.push(o), t[o] = p === "string" ? "text" : p === "object" ? "model" : p, p === "object" && !me(d) && n(o, d);
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
return n("", at(r, ["styles", "_type", "_id", "_name", "_bindings"])), { paths: s, pathsType: t };
|
|
65
|
+
}
|
|
66
|
+
const gr = ({ data: r }) => {
|
|
67
|
+
if (!r)
|
|
68
|
+
return null;
|
|
69
|
+
const s = typeof r;
|
|
70
|
+
return /* @__PURE__ */ e.jsx("div", { className: "text-[10px] text-gray-800/50 leading-3 whitespace-nowrap overflow-hidden w-full", children: it(s === "object" ? JSON.stringify(r) : r, { length: 40 }) });
|
|
71
|
+
}, Be = ({
|
|
72
|
+
type: r,
|
|
73
|
+
isDisabled: s = !1,
|
|
74
|
+
placeholder: t,
|
|
75
|
+
defaultValue: n = "",
|
|
76
|
+
data: l,
|
|
77
|
+
onChange: a,
|
|
78
|
+
dataType: d,
|
|
79
|
+
appliedBindings: i
|
|
80
|
+
}) => {
|
|
81
|
+
const [o, p] = k(n), { paths: u, pathsType: c } = ur(l), m = r === "PROP" ? Je(l == null ? void 0 : l._type) : {};
|
|
82
|
+
M(() => {
|
|
83
|
+
b(o) && a("");
|
|
84
|
+
}, [o]), M(() => p(n), [n]);
|
|
85
|
+
const x = () => u.filter((f) => {
|
|
86
|
+
const j = b(o) || O(ne(f), ne(o));
|
|
87
|
+
return r === "PATH" ? j && d === g(c, f, "") : j && !O(i, f) && g(m, `props.${be(Ne(f, "."))}.binding`);
|
|
88
|
+
}), [y, v] = k(() => x());
|
|
89
|
+
M(() => v(() => x()), [d]);
|
|
90
|
+
const L = {
|
|
91
|
+
autoComplete: "off",
|
|
92
|
+
autoCorrect: "on",
|
|
93
|
+
autoCapitalize: "off",
|
|
94
|
+
spellCheck: !1,
|
|
95
|
+
placeholder: t,
|
|
96
|
+
value: o,
|
|
97
|
+
disabled: s,
|
|
98
|
+
onBlur: () => {
|
|
99
|
+
u.includes(o) ? a(o) : (p(""), a(""));
|
|
100
|
+
},
|
|
101
|
+
onChange: (f, { newValue: j }) => p(j),
|
|
102
|
+
className: `chai-input w-full ${s ? "cursor-not-allowed" : ""}`
|
|
103
|
+
}, R = (f) => /* @__PURE__ */ e.jsxs(
|
|
104
|
+
"div",
|
|
105
|
+
{
|
|
106
|
+
className: "rounded-md px-1 py-1.5 flex items-center justify-between space-x-2 font-light relative",
|
|
107
|
+
"data-suggest": f,
|
|
108
|
+
children: [
|
|
109
|
+
/* @__PURE__ */ e.jsx("div", { className: "-mt-1 w-full h-full absolute opacity-0 z-20", children: f }),
|
|
110
|
+
/* @__PURE__ */ e.jsxs("div", { className: "w-full", children: [
|
|
111
|
+
/* @__PURE__ */ e.jsx("div", { className: "leading-4 text-xs flex items-center text-gray-800", children: $.Children.toArray(
|
|
112
|
+
C(Ne(f, "."), (j, B) => /* @__PURE__ */ e.jsxs("span", { className: "flex items-end", children: [
|
|
113
|
+
B > 0 && /* @__PURE__ */ e.jsx(Ut, { size: 14, className: "h-full text-gray-400" }),
|
|
114
|
+
Q(j)
|
|
115
|
+
] }))
|
|
116
|
+
) }),
|
|
117
|
+
r === "PATH" && /* @__PURE__ */ e.jsx(gr, { data: g(l, f) })
|
|
118
|
+
] }),
|
|
119
|
+
r === "PROP" && /* @__PURE__ */ e.jsx("div", { className: "bg-purple-100 text-purple-400 text-[9px] flex items-center font-medium h-4 px-2 rounded-full", children: Q(g(c, f, "")) })
|
|
120
|
+
]
|
|
121
|
+
}
|
|
122
|
+
);
|
|
123
|
+
return /* @__PURE__ */ e.jsx(
|
|
124
|
+
Qe,
|
|
125
|
+
{
|
|
126
|
+
suggestions: y,
|
|
127
|
+
onSuggestionsFetchRequested: () => v(() => x()),
|
|
128
|
+
onSuggestionsClearRequested: () => v([]),
|
|
129
|
+
onSuggestionSelected: (f) => {
|
|
130
|
+
if (f.type === "click") {
|
|
131
|
+
const j = g(f.target, "childNodes[0].data", "");
|
|
132
|
+
u.includes(j) && a(j);
|
|
133
|
+
} else
|
|
134
|
+
a(f.target.value);
|
|
135
|
+
},
|
|
136
|
+
getSuggestionValue: (f) => f,
|
|
137
|
+
renderSuggestion: R,
|
|
138
|
+
shouldRenderSuggestions: () => !0,
|
|
139
|
+
inputProps: L,
|
|
140
|
+
containerProps: { className: "w-full" },
|
|
141
|
+
theme: {
|
|
142
|
+
suggestion: "text-gray-500 border-b overflow-hidden text-ellipsis",
|
|
143
|
+
suggestionHighlighted: "bg-blue-100 text-blue-800 font-normal cursor-pointer",
|
|
144
|
+
suggestionsContainerOpen: "bg-white border border-gray-300 z-50 max-h-52 left-2 overflow-y-auto w-full rounded-md shadow-2xl text-sm font-light w-full"
|
|
61
145
|
}
|
|
62
146
|
}
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
147
|
+
);
|
|
148
|
+
}, xr = ({
|
|
149
|
+
item: r,
|
|
150
|
+
onChange: s,
|
|
151
|
+
onRemove: t,
|
|
152
|
+
selectedBlock: n,
|
|
153
|
+
dataProvider: l,
|
|
154
|
+
appliedBindings: a
|
|
155
|
+
}) => {
|
|
156
|
+
const [d, i] = k("string"), o = (p, u) => {
|
|
157
|
+
if (b(p))
|
|
158
|
+
return "";
|
|
159
|
+
{
|
|
160
|
+
const c = g(u === "PROP" ? n : l, p, "");
|
|
161
|
+
if (me(c))
|
|
162
|
+
return "list";
|
|
163
|
+
const m = typeof c;
|
|
164
|
+
return m === "string" ? "text" : m === "object" ? "model" : m;
|
|
75
165
|
}
|
|
76
|
-
}, g = () => {
|
|
77
|
-
o();
|
|
78
166
|
};
|
|
79
|
-
return /* @__PURE__ */ e.jsxs("div", { children: [
|
|
167
|
+
return M(() => i(() => o(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) }),
|
|
80
169
|
/* @__PURE__ */ e.jsx(
|
|
81
|
-
|
|
170
|
+
Be,
|
|
82
171
|
{
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
172
|
+
type: "PROP",
|
|
173
|
+
isDisabled: !1,
|
|
174
|
+
placeholder: "Enter prop key",
|
|
175
|
+
defaultValue: r.key,
|
|
176
|
+
onChange: (p) => {
|
|
177
|
+
const u = o(p, "PROP");
|
|
178
|
+
s({ target: { name: "key", value: p } }), d !== u && s({ target: { name: "value", value: "" } }), i(u);
|
|
90
179
|
},
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
180
|
+
data: n,
|
|
181
|
+
dataType: d,
|
|
182
|
+
appliedBindings: a
|
|
183
|
+
}
|
|
184
|
+
),
|
|
185
|
+
/* @__PURE__ */ e.jsxs("div", { className: "flex items-start justify-between gap-x-1.5 w-full relative", children: [
|
|
186
|
+
/* @__PURE__ */ e.jsx(
|
|
187
|
+
Be,
|
|
188
|
+
{
|
|
189
|
+
type: "PATH",
|
|
190
|
+
isDisabled: b(r.key),
|
|
191
|
+
placeholder: "Enter data path",
|
|
192
|
+
defaultValue: r.value,
|
|
193
|
+
onChange: (p) => {
|
|
194
|
+
const u = o(p, "PATH");
|
|
195
|
+
s(d !== u ? { target: { name: "value", value: "" } } : { target: { name: "value", value: p } });
|
|
196
|
+
},
|
|
197
|
+
data: l,
|
|
198
|
+
dataType: d,
|
|
199
|
+
appliedBindings: a
|
|
200
|
+
}
|
|
201
|
+
),
|
|
202
|
+
/* @__PURE__ */ e.jsx(
|
|
203
|
+
zt,
|
|
204
|
+
{
|
|
205
|
+
onClick: t,
|
|
206
|
+
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
|
+
}
|
|
208
|
+
)
|
|
209
|
+
] })
|
|
210
|
+
] });
|
|
211
|
+
}, hr = ({ bindingData: r, onChange: s }) => {
|
|
212
|
+
const t = te(), [n] = Gt(), [l, a] = k(C(r, (c, m) => ({ key: m, value: c })));
|
|
213
|
+
M(() => {
|
|
214
|
+
a(C(r, (c, m) => ({ key: m, value: c })));
|
|
215
|
+
}, [t == null ? void 0 : t._id]);
|
|
216
|
+
const d = T(() => {
|
|
217
|
+
if (b(l))
|
|
218
|
+
return !1;
|
|
219
|
+
const c = he(l);
|
|
220
|
+
return b(c == null ? void 0 : c.key) || b(c == null ? void 0 : c.value);
|
|
221
|
+
}, [l]), i = () => {
|
|
222
|
+
a([...l, { key: "", value: "" }]);
|
|
223
|
+
}, o = (c) => {
|
|
224
|
+
const m = Oe(l, (x, y) => c !== y);
|
|
225
|
+
u([...m]);
|
|
226
|
+
}, p = (c, m) => {
|
|
227
|
+
const x = [...l];
|
|
228
|
+
x[m][c.target.name] = c.target.value, u(x);
|
|
229
|
+
}, u = I(
|
|
230
|
+
(c = []) => {
|
|
231
|
+
if (a(c), b(c)) {
|
|
232
|
+
s({});
|
|
233
|
+
return;
|
|
234
|
+
}
|
|
235
|
+
const m = {};
|
|
236
|
+
fe(c, (x) => {
|
|
237
|
+
!b(x == null ? void 0 : x.key) && !b(x == null ? void 0 : x.value) && Pe(m, x.key, x.value);
|
|
238
|
+
}), s(m);
|
|
239
|
+
},
|
|
240
|
+
[t]
|
|
241
|
+
);
|
|
242
|
+
return b(n) ? /* @__PURE__ */ e.jsx("div", { className: "w-full flex items-center justify-center", children: /* @__PURE__ */ e.jsx("div", { className: "text-xs text-gray-400", children: "No data provider selected." }) }) : /* @__PURE__ */ e.jsxs("div", { className: "space-y-2", children: [
|
|
243
|
+
C(l, (c, m) => /* @__PURE__ */ e.jsx(
|
|
244
|
+
xr,
|
|
245
|
+
{
|
|
246
|
+
item: c,
|
|
247
|
+
onChange: (x) => p(x, m),
|
|
248
|
+
onRemove: () => o(m),
|
|
249
|
+
selectedBlock: t,
|
|
250
|
+
dataProvider: n,
|
|
251
|
+
appliedBindings: C(l, "key")
|
|
252
|
+
},
|
|
253
|
+
c.key
|
|
254
|
+
)),
|
|
255
|
+
/* @__PURE__ */ e.jsxs(X, { delayDuration: 200, children: [
|
|
256
|
+
/* @__PURE__ */ e.jsx(Y, { className: "w-full", children: /* @__PURE__ */ e.jsx(
|
|
257
|
+
"button",
|
|
258
|
+
{
|
|
259
|
+
onClick: i,
|
|
260
|
+
disabled: d,
|
|
261
|
+
className: `w-full px-5 py-1.5 text-xs rounded-md font-medium duration-200 ${b(l) ? "bg-blue-700/20 text-blue-800 hover:bg-blue-700/30 " : ""} ${d ? "cursor-not-allowed bg-gray-200 text-gray-400" : b(l) ? "" : "bg-gray-700/20 text-gray-800 hover:bg-blue-700/30"}`,
|
|
262
|
+
children: "+ Add Data Binding"
|
|
263
|
+
}
|
|
264
|
+
) }),
|
|
265
|
+
d && /* @__PURE__ */ e.jsx(W, { sideOffset: 10, className: "text-[11px]", children: "Complete last added data binding to add more" })
|
|
266
|
+
] })
|
|
267
|
+
] });
|
|
268
|
+
}, mr = hr, yr = () => /* @__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 = ({
|
|
269
|
+
createHistorySnapshot: r,
|
|
270
|
+
properties: s,
|
|
271
|
+
formData: t,
|
|
272
|
+
onChange: n
|
|
273
|
+
}) => {
|
|
274
|
+
const [l] = Mt(), a = { type: "object", properties: {} }, d = {};
|
|
275
|
+
return Object.keys(s).forEach((i) => {
|
|
276
|
+
const o = s[i];
|
|
277
|
+
if (O(["slot", "styles"], o.type))
|
|
278
|
+
return;
|
|
279
|
+
const p = g(o, "i18n", !1) ? `${i}-${l}` : i;
|
|
280
|
+
a.properties[p] = _t(o, l), d[p] = Et(o, l);
|
|
281
|
+
}), /* @__PURE__ */ e.jsx(
|
|
282
|
+
Pt,
|
|
283
|
+
{
|
|
284
|
+
widgets: {
|
|
285
|
+
binding: yr,
|
|
286
|
+
richtext: qt,
|
|
287
|
+
icon: Jt,
|
|
288
|
+
image: Qt
|
|
289
|
+
},
|
|
290
|
+
fields: {
|
|
291
|
+
link: er
|
|
292
|
+
},
|
|
293
|
+
idSeparator: ".",
|
|
294
|
+
autoComplete: "off",
|
|
295
|
+
omitExtraData: !1,
|
|
296
|
+
liveOmit: !1,
|
|
297
|
+
liveValidate: !0,
|
|
298
|
+
validator: Ot,
|
|
299
|
+
uiSchema: d,
|
|
300
|
+
onBlur: r,
|
|
301
|
+
schema: a,
|
|
302
|
+
formData: t,
|
|
303
|
+
onChange: n
|
|
304
|
+
}
|
|
305
|
+
);
|
|
306
|
+
};
|
|
307
|
+
function fr() {
|
|
308
|
+
const r = te(), { createSnapshot: s } = Ze(), t = ze(), n = Je(r._type), l = { ...r }, a = () => s(), d = ({ formData: u }, c) => {
|
|
309
|
+
if (c) {
|
|
310
|
+
const m = c.replace("root.", "");
|
|
311
|
+
t([r._id], { [m]: g(u, m) });
|
|
312
|
+
}
|
|
313
|
+
}, i = {
|
|
314
|
+
_name: Zt({
|
|
315
|
+
title: "Name",
|
|
316
|
+
default: g(r, "_name", r._type)
|
|
317
|
+
})
|
|
318
|
+
}, o = dt(g(l, "_bindings", {})), p = T(() => {
|
|
319
|
+
const u = ct(g(n, "props", {}));
|
|
320
|
+
return pt(o, (c) => {
|
|
321
|
+
delete u[c];
|
|
322
|
+
}), u;
|
|
323
|
+
}, [n, o]);
|
|
324
|
+
return /* @__PURE__ */ e.jsxs("div", { className: "overflow-x-hidden", children: [
|
|
325
|
+
/* @__PURE__ */ e.jsx(
|
|
326
|
+
Ae,
|
|
327
|
+
{
|
|
328
|
+
onChange: d,
|
|
329
|
+
createHistorySnapshot: a,
|
|
330
|
+
formData: l,
|
|
331
|
+
properties: i
|
|
102
332
|
}
|
|
103
333
|
),
|
|
334
|
+
/* @__PURE__ */ e.jsx("hr", { className: "mt-4" }),
|
|
335
|
+
/* @__PURE__ */ e.jsxs(tt, { type: "multiple", defaultValue: ["STATIC", "BINDING"], className: "h-full w-full", children: [
|
|
336
|
+
/* @__PURE__ */ e.jsxs(ae, { value: "BINDING", children: [
|
|
337
|
+
/* @__PURE__ */ e.jsx(ie, { className: "px-3 py-2 text-xs hover:no-underline bg-gray-100 ml-1", children: /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-x-2", children: [
|
|
338
|
+
/* @__PURE__ */ e.jsx(
|
|
339
|
+
"div",
|
|
340
|
+
{
|
|
341
|
+
className: `h-[8px] w-[8px] rounded-full ${b(g(r, "_bindings", {})) ? "bg-gray-300" : "bg-blue-500"}`
|
|
342
|
+
}
|
|
343
|
+
),
|
|
344
|
+
"Data Binding"
|
|
345
|
+
] }) }),
|
|
346
|
+
/* @__PURE__ */ e.jsx(de, { className: "pt-4 px-4", children: /* @__PURE__ */ e.jsx(
|
|
347
|
+
mr,
|
|
348
|
+
{
|
|
349
|
+
bindingData: g(l, "_bindings", {}),
|
|
350
|
+
onChange: (u) => {
|
|
351
|
+
d({ formData: { ...l, _bindings: u } }, "root._bindings");
|
|
352
|
+
}
|
|
353
|
+
}
|
|
354
|
+
) })
|
|
355
|
+
] }),
|
|
356
|
+
/* @__PURE__ */ e.jsxs(ae, { value: "STATIC", children: [
|
|
357
|
+
/* @__PURE__ */ e.jsx(ie, { className: "px-3 py-2 text-xs hover:no-underline bg-gray-100 ml-1", children: /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-x-2", children: [
|
|
358
|
+
/* @__PURE__ */ e.jsx("div", { className: "h-[8px] w-[8px] rounded-full bg-blue-500" }),
|
|
359
|
+
"Static Content"
|
|
360
|
+
] }) }),
|
|
361
|
+
/* @__PURE__ */ e.jsxs(de, { className: "pt-4", children: [
|
|
362
|
+
b(o) ? "" : /* @__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: [
|
|
363
|
+
"Data binding is set for ",
|
|
364
|
+
/* @__PURE__ */ e.jsx("b", { children: C(o, ut).join(", ") }),
|
|
365
|
+
" ",
|
|
366
|
+
o.length === 1 ? "property" : "properties",
|
|
367
|
+
". Remove data binding to edit static content."
|
|
368
|
+
] }),
|
|
369
|
+
/* @__PURE__ */ e.jsx(
|
|
370
|
+
Ae,
|
|
371
|
+
{
|
|
372
|
+
onChange: d,
|
|
373
|
+
createHistorySnapshot: a,
|
|
374
|
+
formData: l,
|
|
375
|
+
properties: p
|
|
376
|
+
}
|
|
377
|
+
)
|
|
378
|
+
] })
|
|
379
|
+
] })
|
|
380
|
+
] }),
|
|
104
381
|
/* @__PURE__ */ e.jsx("div", { className: "pb-60" })
|
|
105
382
|
] });
|
|
106
383
|
}
|
|
107
|
-
const
|
|
384
|
+
const De = new rr(lr, {
|
|
108
385
|
isCaseSensitive: !1,
|
|
109
386
|
threshold: 0.2,
|
|
110
387
|
minMatchCharLength: 2,
|
|
111
388
|
keys: ["name"]
|
|
112
389
|
});
|
|
113
|
-
function
|
|
114
|
-
var
|
|
115
|
-
const [r] =
|
|
116
|
-
const
|
|
117
|
-
t(
|
|
118
|
-
}, [
|
|
119
|
-
const
|
|
120
|
-
let
|
|
121
|
-
if (
|
|
122
|
-
const [
|
|
123
|
-
|
|
124
|
-
...
|
|
125
|
-
item: { ...
|
|
390
|
+
function br() {
|
|
391
|
+
var R;
|
|
392
|
+
const [r] = je(), s = te(), t = Ue(), n = Ge(), [l] = Ke(), [a, d] = k(""), i = (R = be(r)) == null ? void 0 : R.prop, o = gt((g(s, i, "").replace(sr, "").split(",").pop() || "").split(" "), b), p = () => {
|
|
393
|
+
const f = a.trim().toLowerCase().replace(/ +(?= )/g, "").split(" ");
|
|
394
|
+
t(l, f, !0), d("");
|
|
395
|
+
}, [u, c] = k([]), m = ({ value: f }) => {
|
|
396
|
+
const j = f.trim().toLowerCase(), B = j.match(/.+:/g);
|
|
397
|
+
let N = [];
|
|
398
|
+
if (B && B.length > 0) {
|
|
399
|
+
const [P] = B, F = j.replace(P, "");
|
|
400
|
+
N = De.search(F).map((h) => ({
|
|
401
|
+
...h,
|
|
402
|
+
item: { ...h.item, name: P + h.item.name }
|
|
126
403
|
}));
|
|
127
404
|
} else
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
},
|
|
131
|
-
|
|
132
|
-
}, y = (
|
|
405
|
+
N = De.search(j);
|
|
406
|
+
c(C(N, "item"));
|
|
407
|
+
}, x = () => {
|
|
408
|
+
c([]);
|
|
409
|
+
}, y = (f) => f.name, v = (f) => /* @__PURE__ */ e.jsx("div", { className: "rounded-md p-1", children: f.name }), L = {
|
|
133
410
|
autoComplete: "off",
|
|
134
411
|
autoCorrect: "off",
|
|
135
412
|
autoCapitalize: "off",
|
|
136
413
|
spellCheck: !1,
|
|
137
414
|
placeholder: "Enter class name",
|
|
138
|
-
value:
|
|
139
|
-
onKeyDown: (
|
|
140
|
-
|
|
415
|
+
value: a,
|
|
416
|
+
onKeyDown: (f) => {
|
|
417
|
+
f.key === "Enter" && a.trim() !== "" && p();
|
|
141
418
|
},
|
|
142
|
-
onChange: (
|
|
419
|
+
onChange: (f, { newValue: j }) => d(j),
|
|
143
420
|
className: "w-full rounded-md text-xs px-2 hover:outline-0 bg-background border-border py-1"
|
|
144
421
|
};
|
|
145
422
|
return /* @__PURE__ */ e.jsxs(
|
|
146
423
|
"div",
|
|
147
424
|
{
|
|
148
|
-
className: `no-scrollbar flex ${
|
|
425
|
+
className: `no-scrollbar flex ${u.length > 0 ? "min-h-[300px]" : "min-h-max"} w-full flex-col gap-y-5 overflow-y-auto bg-gray-100 px-px`,
|
|
149
426
|
children: [
|
|
150
|
-
/* @__PURE__ */ e.jsx(
|
|
427
|
+
/* @__PURE__ */ e.jsx(Ce, { className: "mt-2", children: "Add Tailwind classes" }),
|
|
151
428
|
/* @__PURE__ */ e.jsxs("div", { className: "relative -mt-4 flex items-center gap-x-3", children: [
|
|
152
429
|
/* @__PURE__ */ e.jsx("div", { className: "relative flex w-full items-center gap-x-3", children: /* @__PURE__ */ e.jsx(
|
|
153
|
-
|
|
430
|
+
Qe,
|
|
154
431
|
{
|
|
155
|
-
suggestions:
|
|
432
|
+
suggestions: u,
|
|
156
433
|
onSuggestionsFetchRequested: m,
|
|
157
|
-
onSuggestionsClearRequested:
|
|
434
|
+
onSuggestionsClearRequested: x,
|
|
158
435
|
getSuggestionValue: y,
|
|
159
|
-
renderSuggestion:
|
|
160
|
-
inputProps:
|
|
436
|
+
renderSuggestion: v,
|
|
437
|
+
inputProps: L,
|
|
161
438
|
containerProps: {
|
|
162
439
|
className: "relative h-8 w-full gap-y-1 py-1 border-gray-600"
|
|
163
440
|
},
|
|
@@ -169,36 +446,36 @@ function Qt() {
|
|
|
169
446
|
}
|
|
170
447
|
) }),
|
|
171
448
|
/* @__PURE__ */ e.jsx(
|
|
172
|
-
|
|
449
|
+
et,
|
|
173
450
|
{
|
|
174
451
|
variant: "outline",
|
|
175
452
|
className: "h-6 border-gray-700",
|
|
176
|
-
onClick:
|
|
177
|
-
disabled:
|
|
453
|
+
onClick: p,
|
|
454
|
+
disabled: a.trim() === "",
|
|
178
455
|
size: "sm",
|
|
179
|
-
children: /* @__PURE__ */ e.jsx(
|
|
456
|
+
children: /* @__PURE__ */ e.jsx(ve, {})
|
|
180
457
|
}
|
|
181
458
|
)
|
|
182
459
|
] }),
|
|
183
460
|
/* @__PURE__ */ e.jsxs("div", { className: "flex w-full flex-wrap gap-2", children: [
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
461
|
+
b(o) && /* @__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" }),
|
|
462
|
+
se.Children.toArray(
|
|
463
|
+
o.map((f) => /* @__PURE__ */ e.jsxs(
|
|
187
464
|
"div",
|
|
188
465
|
{
|
|
189
466
|
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",
|
|
190
467
|
children: [
|
|
191
|
-
|
|
468
|
+
f,
|
|
192
469
|
/* @__PURE__ */ e.jsx(
|
|
193
|
-
|
|
470
|
+
Fe,
|
|
194
471
|
{
|
|
195
|
-
onClick: () => l
|
|
472
|
+
onClick: () => n(l, [f]),
|
|
196
473
|
className: "invisible absolute right-1 hover:text-white group-hover:visible group-hover:cursor-pointer"
|
|
197
474
|
}
|
|
198
475
|
)
|
|
199
476
|
]
|
|
200
477
|
},
|
|
201
|
-
|
|
478
|
+
f
|
|
202
479
|
))
|
|
203
480
|
)
|
|
204
481
|
] })
|
|
@@ -206,16 +483,16 @@ function Qt() {
|
|
|
206
483
|
}
|
|
207
484
|
);
|
|
208
485
|
}
|
|
209
|
-
const
|
|
486
|
+
const D = ["px", "%", "em", "rem", "ch", "vh", "vw"], vr = {
|
|
210
487
|
heading: "Flex Child",
|
|
211
488
|
items: [
|
|
212
|
-
{ type: "arbitrary", label: "Basis", units:
|
|
489
|
+
{ type: "arbitrary", label: "Basis", units: D, property: "flexBasis" },
|
|
213
490
|
{ type: "range", label: "Order", property: "order" },
|
|
214
491
|
{ type: "dropdown", label: "Flex", property: "flexGrowShrink" },
|
|
215
492
|
{ type: "dropdown", label: "Grow", property: "flexGrow" },
|
|
216
493
|
{ type: "dropdown", label: "Shrink", property: "flexShrink" }
|
|
217
494
|
]
|
|
218
|
-
},
|
|
495
|
+
}, wr = {
|
|
219
496
|
heading: "Grid Child",
|
|
220
497
|
items: [
|
|
221
498
|
{ type: "range", label: "Col Span", property: "gridColSpan" },
|
|
@@ -226,11 +503,11 @@ const T = ["px", "%", "em", "rem", "ch", "vh", "vw"], er = {
|
|
|
226
503
|
{ type: "range", label: "Row End", property: "gridRowEnd" },
|
|
227
504
|
{ type: "range", label: "Order", property: "order" }
|
|
228
505
|
]
|
|
229
|
-
},
|
|
506
|
+
}, jr = [
|
|
230
507
|
{
|
|
231
508
|
heading: "Display",
|
|
232
509
|
items: [
|
|
233
|
-
{ type: "dropdown", label: "Display", property: "display", units:
|
|
510
|
+
{ type: "dropdown", label: "Display", property: "display", units: D },
|
|
234
511
|
{
|
|
235
512
|
styleType: "accordion",
|
|
236
513
|
heading: "Flex options",
|
|
@@ -281,7 +558,7 @@ const T = ["px", "%", "em", "rem", "ch", "vh", "vw"], er = {
|
|
|
281
558
|
styleType: "accordion",
|
|
282
559
|
heading: "Visibility & Opacity",
|
|
283
560
|
items: [
|
|
284
|
-
{ type: "dropdown", label: "Visibility", property: "visibility", units:
|
|
561
|
+
{ type: "dropdown", label: "Visibility", property: "visibility", units: D },
|
|
285
562
|
{ type: "arbitrary", label: "Opacity", property: "opacity", units: ["-"] }
|
|
286
563
|
]
|
|
287
564
|
}
|
|
@@ -294,7 +571,7 @@ const T = ["px", "%", "em", "rem", "ch", "vh", "vw"], er = {
|
|
|
294
571
|
styleType: "multiple",
|
|
295
572
|
label: "Margin",
|
|
296
573
|
negative: !0,
|
|
297
|
-
units: [...
|
|
574
|
+
units: [...D, "auto"],
|
|
298
575
|
options: [
|
|
299
576
|
{ key: "margin", label: "All" },
|
|
300
577
|
{ key: "marginX", label: "Left-Right" },
|
|
@@ -331,22 +608,22 @@ const T = ["px", "%", "em", "rem", "ch", "vh", "vw"], er = {
|
|
|
331
608
|
{
|
|
332
609
|
heading: "Size",
|
|
333
610
|
items: [
|
|
334
|
-
{ type: "arbitrary", label: "Width", units:
|
|
335
|
-
{ type: "arbitrary", label: "Height", units:
|
|
611
|
+
{ type: "arbitrary", label: "Width", units: D.concat("auto"), property: "width" },
|
|
612
|
+
{ type: "arbitrary", label: "Height", units: D.concat("auto"), property: "height" },
|
|
336
613
|
{
|
|
337
614
|
styleType: "accordion",
|
|
338
615
|
heading: "Min width & height",
|
|
339
616
|
items: [
|
|
340
|
-
{ type: "arbitrary", label: "Min Width", units:
|
|
341
|
-
{ type: "arbitrary", label: "Min Height", units:
|
|
617
|
+
{ type: "arbitrary", label: "Min Width", units: D.concat("auto"), property: "minWidth" },
|
|
618
|
+
{ type: "arbitrary", label: "Min Height", units: D.concat("auto"), property: "minHeight" }
|
|
342
619
|
]
|
|
343
620
|
},
|
|
344
621
|
{
|
|
345
622
|
styleType: "accordion",
|
|
346
623
|
heading: "Max width & height",
|
|
347
624
|
items: [
|
|
348
|
-
{ type: "arbitrary", label: "Max Width", units:
|
|
349
|
-
{ type: "arbitrary", label: "Max Height", units:
|
|
625
|
+
{ type: "arbitrary", label: "Max Width", units: D.concat("auto"), property: "maxWidth" },
|
|
626
|
+
{ type: "arbitrary", label: "Max Height", units: D.concat("auto"), property: "maxHeight" }
|
|
350
627
|
]
|
|
351
628
|
},
|
|
352
629
|
{
|
|
@@ -430,8 +707,8 @@ const T = ["px", "%", "em", "rem", "ch", "vh", "vw"], er = {
|
|
|
430
707
|
heading: "Typography",
|
|
431
708
|
items: [
|
|
432
709
|
{ type: "dropdown", property: "fontFamily", label: "Font" },
|
|
433
|
-
{ type: "arbitrary", property: "fontSize", label: "Size", units:
|
|
434
|
-
{ type: "arbitrary", property: "lineHeight", label: "Height", units:
|
|
710
|
+
{ type: "arbitrary", property: "fontSize", label: "Size", units: D },
|
|
711
|
+
{ type: "arbitrary", property: "lineHeight", label: "Height", units: D.concat("-") },
|
|
435
712
|
{ type: "range", property: "fontWeight", label: "Weight" },
|
|
436
713
|
{ type: "color", property: "textColor", label: "Color" },
|
|
437
714
|
{
|
|
@@ -628,89 +905,89 @@ const T = ["px", "%", "em", "rem", "ch", "vh", "vw"], er = {
|
|
|
628
905
|
},
|
|
629
906
|
{
|
|
630
907
|
heading: "Classes",
|
|
631
|
-
items: [{ component:
|
|
908
|
+
items: [{ component: br }]
|
|
632
909
|
}
|
|
633
|
-
],
|
|
910
|
+
], rt = {
|
|
634
911
|
"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" }) }),
|
|
635
912
|
// visibility
|
|
636
|
-
visible:
|
|
637
|
-
invisible:
|
|
913
|
+
visible: ft,
|
|
914
|
+
invisible: Te,
|
|
638
915
|
// display
|
|
639
|
-
hidden:
|
|
640
|
-
gap:
|
|
641
|
-
gapX:
|
|
642
|
-
gapY:
|
|
643
|
-
spaceX:
|
|
644
|
-
spaceY:
|
|
645
|
-
overscroll:
|
|
646
|
-
overscrollX:
|
|
647
|
-
overscrollY:
|
|
648
|
-
overflow:
|
|
649
|
-
overflowX:
|
|
650
|
-
overflowY:
|
|
651
|
-
top:
|
|
652
|
-
right:
|
|
653
|
-
bottom:
|
|
654
|
-
left:
|
|
655
|
-
inset:
|
|
656
|
-
insetX:
|
|
657
|
-
insetY:
|
|
658
|
-
border:
|
|
659
|
-
borderX:
|
|
660
|
-
borderY:
|
|
661
|
-
borderTop:
|
|
662
|
-
borderRight:
|
|
663
|
-
borderBottom:
|
|
664
|
-
borderLeft:
|
|
665
|
-
borderRadius:
|
|
666
|
-
borderRadiusX:
|
|
667
|
-
borderRadiusY:
|
|
668
|
-
borderRadiusTop:
|
|
669
|
-
borderRadiusRight:
|
|
670
|
-
borderRadiusBottom:
|
|
671
|
-
borderRadiusLeft:
|
|
672
|
-
borderRadiusTopLeft:
|
|
673
|
-
borderRadiusTopRight:
|
|
674
|
-
borderRadiusBottomRight:
|
|
675
|
-
borderRadiusBottomLeft:
|
|
676
|
-
divideXWidth:
|
|
677
|
-
divideYWidth:
|
|
678
|
-
scale:
|
|
679
|
-
scaleX:
|
|
680
|
-
scaleY:
|
|
681
|
-
skewX:
|
|
682
|
-
skewY:
|
|
683
|
-
translateX:
|
|
684
|
-
translateY:
|
|
916
|
+
hidden: Te,
|
|
917
|
+
gap: _,
|
|
918
|
+
gapX: V,
|
|
919
|
+
gapY: H,
|
|
920
|
+
spaceX: V,
|
|
921
|
+
spaceY: H,
|
|
922
|
+
overscroll: _,
|
|
923
|
+
overscrollX: V,
|
|
924
|
+
overscrollY: H,
|
|
925
|
+
overflow: _,
|
|
926
|
+
overflowX: V,
|
|
927
|
+
overflowY: H,
|
|
928
|
+
top: G,
|
|
929
|
+
right: K,
|
|
930
|
+
bottom: q,
|
|
931
|
+
left: J,
|
|
932
|
+
inset: _,
|
|
933
|
+
insetX: V,
|
|
934
|
+
insetY: H,
|
|
935
|
+
border: _,
|
|
936
|
+
borderX: V,
|
|
937
|
+
borderY: H,
|
|
938
|
+
borderTop: G,
|
|
939
|
+
borderRight: K,
|
|
940
|
+
borderBottom: q,
|
|
941
|
+
borderLeft: J,
|
|
942
|
+
borderRadius: _,
|
|
943
|
+
borderRadiusX: V,
|
|
944
|
+
borderRadiusY: H,
|
|
945
|
+
borderRadiusTop: G,
|
|
946
|
+
borderRadiusRight: K,
|
|
947
|
+
borderRadiusBottom: q,
|
|
948
|
+
borderRadiusLeft: J,
|
|
949
|
+
borderRadiusTopLeft: bt,
|
|
950
|
+
borderRadiusTopRight: vt,
|
|
951
|
+
borderRadiusBottomRight: wt,
|
|
952
|
+
borderRadiusBottomLeft: jt,
|
|
953
|
+
divideXWidth: V,
|
|
954
|
+
divideYWidth: H,
|
|
955
|
+
scale: _,
|
|
956
|
+
scaleX: V,
|
|
957
|
+
scaleY: H,
|
|
958
|
+
skewX: V,
|
|
959
|
+
skewY: H,
|
|
960
|
+
translateX: V,
|
|
961
|
+
translateY: H,
|
|
685
962
|
// padding
|
|
686
|
-
padding:
|
|
687
|
-
paddingX:
|
|
688
|
-
paddingY:
|
|
689
|
-
paddingTop:
|
|
690
|
-
paddingRight:
|
|
691
|
-
paddingBottom:
|
|
692
|
-
paddingLeft:
|
|
963
|
+
padding: _,
|
|
964
|
+
paddingX: V,
|
|
965
|
+
paddingY: H,
|
|
966
|
+
paddingTop: G,
|
|
967
|
+
paddingRight: K,
|
|
968
|
+
paddingBottom: q,
|
|
969
|
+
paddingLeft: J,
|
|
693
970
|
// margin
|
|
694
|
-
margin:
|
|
695
|
-
marginX:
|
|
696
|
-
marginY:
|
|
697
|
-
marginTop:
|
|
698
|
-
marginRight:
|
|
699
|
-
marginBottom:
|
|
700
|
-
marginLeft:
|
|
971
|
+
margin: _,
|
|
972
|
+
marginX: V,
|
|
973
|
+
marginY: H,
|
|
974
|
+
marginTop: G,
|
|
975
|
+
marginRight: K,
|
|
976
|
+
marginBottom: q,
|
|
977
|
+
marginLeft: J,
|
|
701
978
|
// text-align
|
|
702
|
-
textLeft:
|
|
703
|
-
textCenter:
|
|
704
|
-
textRight:
|
|
705
|
-
textJustify:
|
|
979
|
+
textLeft: Ct,
|
|
980
|
+
textCenter: kt,
|
|
981
|
+
textRight: Nt,
|
|
982
|
+
textJustify: St,
|
|
706
983
|
// font style
|
|
707
|
-
italic:
|
|
984
|
+
italic: Tt,
|
|
708
985
|
// "not-italic": "",
|
|
709
986
|
// decoration
|
|
710
|
-
underline:
|
|
711
|
-
overline:
|
|
987
|
+
underline: Rt,
|
|
988
|
+
overline: Vt,
|
|
712
989
|
// transform
|
|
713
|
-
uppercase:
|
|
990
|
+
uppercase: Ht,
|
|
714
991
|
block: () => /* @__PURE__ */ e.jsxs("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [
|
|
715
992
|
/* @__PURE__ */ e.jsx(
|
|
716
993
|
"path",
|
|
@@ -751,7 +1028,7 @@ const T = ["px", "%", "em", "rem", "ch", "vh", "vw"], er = {
|
|
|
751
1028
|
}
|
|
752
1029
|
)
|
|
753
1030
|
] }),
|
|
754
|
-
"float-none":
|
|
1031
|
+
"float-none": Fe,
|
|
755
1032
|
// position
|
|
756
1033
|
fixed: () => /* @__PURE__ */ e.jsxs("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [
|
|
757
1034
|
/* @__PURE__ */ e.jsx(
|
|
@@ -823,96 +1100,96 @@ const T = ["px", "%", "em", "rem", "ch", "vh", "vw"], er = {
|
|
|
823
1100
|
}
|
|
824
1101
|
)
|
|
825
1102
|
] }),
|
|
826
|
-
static:
|
|
827
|
-
},
|
|
1103
|
+
static: Bt
|
|
1104
|
+
}, re = Le({ canReset: !1, canChange: !0 }), Cr = ({ children: r, canReset: s = !1, canChange: t = !0 }) => (
|
|
828
1105
|
// eslint-disable-next-line react/jsx-no-constructed-context-values
|
|
829
|
-
/* @__PURE__ */ e.jsx(
|
|
830
|
-
),
|
|
831
|
-
const
|
|
1106
|
+
/* @__PURE__ */ e.jsx(re.Provider, { value: { canReset: s, canChange: t }, children: r })
|
|
1107
|
+
), lt = ({ label: r, property: s, onChange: t }) => {
|
|
1108
|
+
const n = T(() => g(pe, `${s}.classes`, [""]), [s]), l = le(s), a = T(() => g(l, "cls", ""), [l]), { canChange: d } = ee(re), i = /\[.*\]/g.test(a);
|
|
832
1109
|
return /* @__PURE__ */ e.jsx("div", { className: r ? "w-full rounded " : "grow", children: i ? /* @__PURE__ */ e.jsxs("div", { className: "flex items-center", children: [
|
|
833
|
-
/* @__PURE__ */ e.jsx(
|
|
834
|
-
/* @__PURE__ */ e.jsxs(
|
|
835
|
-
/* @__PURE__ */ e.jsx(
|
|
836
|
-
/* @__PURE__ */ e.jsx(
|
|
1110
|
+
/* @__PURE__ */ e.jsx(nr, { className: "w-[70%] rounded py-1", readOnly: !0, value: a }),
|
|
1111
|
+
/* @__PURE__ */ e.jsxs(X, { delayDuration: 100, children: [
|
|
1112
|
+
/* @__PURE__ */ e.jsx(Y, { 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, {}) }) }),
|
|
1113
|
+
/* @__PURE__ */ e.jsx(W, { children: "Current value is using a Tailwind arbitrary value." })
|
|
837
1114
|
] })
|
|
838
1115
|
] }) : /* @__PURE__ */ e.jsx(
|
|
839
|
-
|
|
1116
|
+
ye,
|
|
840
1117
|
{
|
|
841
1118
|
rounded: r,
|
|
842
|
-
onChange: (
|
|
843
|
-
selected:
|
|
844
|
-
options:
|
|
1119
|
+
onChange: (o) => t(o, s),
|
|
1120
|
+
selected: a,
|
|
1121
|
+
options: n,
|
|
845
1122
|
disabled: !d
|
|
846
1123
|
}
|
|
847
1124
|
) });
|
|
848
1125
|
};
|
|
849
|
-
function
|
|
850
|
-
const
|
|
1126
|
+
function ye({ selected: r, onChange: s, rounded: t = !1, options: n, disabled: l = !1 }) {
|
|
1127
|
+
const a = r.replace(/.*:/g, "").trim(), { undo: d, redo: i } = Ze();
|
|
851
1128
|
return /* @__PURE__ */ e.jsxs(
|
|
852
1129
|
"select",
|
|
853
1130
|
{
|
|
854
|
-
disabled: !
|
|
1131
|
+
disabled: !n.length || l,
|
|
855
1132
|
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`,
|
|
856
|
-
onChange: (
|
|
857
|
-
onKeyDown: (
|
|
858
|
-
|
|
1133
|
+
onChange: (o) => s(o.target.value),
|
|
1134
|
+
onKeyDown: (o) => {
|
|
1135
|
+
o.ctrlKey && (o.key === "z" && d(), o.key === "y" && i());
|
|
859
1136
|
},
|
|
860
|
-
value:
|
|
1137
|
+
value: a,
|
|
861
1138
|
children: [
|
|
862
1139
|
/* @__PURE__ */ e.jsx("option", { className: "bg-transparent", value: "" }),
|
|
863
|
-
|
|
864
|
-
|
|
1140
|
+
$.Children.toArray(
|
|
1141
|
+
n.map((o) => /* @__PURE__ */ e.jsx("option", { className: "bg-transparent", value: o, children: o }))
|
|
865
1142
|
)
|
|
866
1143
|
]
|
|
867
1144
|
}
|
|
868
1145
|
);
|
|
869
1146
|
}
|
|
870
|
-
const
|
|
871
|
-
const { canReset: t, canChange:
|
|
872
|
-
return /* @__PURE__ */ e.jsx("div", { className: "flex flex-row divide-x divide-solid divide-border rounded border border-border text-xs", children:
|
|
1147
|
+
const kr = ({ property: r, onChange: s }) => {
|
|
1148
|
+
const { canReset: t, canChange: n } = ee(re), l = le(r), a = T(() => g(l, "cls", ""), [l]), d = T(() => g(pe, `${r}.classes`, [""]), [r]), i = d.indexOf(a) > -1 ? d.indexOf(a) : 0, o = /\[.*\]/g.test(a);
|
|
1149
|
+
return /* @__PURE__ */ e.jsx("div", { className: "flex flex-row divide-x divide-solid divide-border rounded border border-border text-xs", children: o ? /* @__PURE__ */ e.jsx("div", { className: "py-[5px] px-2", children: a }) : /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
873
1150
|
/* @__PURE__ */ e.jsx(
|
|
874
1151
|
"button",
|
|
875
1152
|
{
|
|
876
1153
|
type: "button",
|
|
877
1154
|
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",
|
|
878
|
-
disabled: !
|
|
879
|
-
onClick: () =>
|
|
880
|
-
children: /* @__PURE__ */ e.jsx("span", { className: "flex items-center justify-center", children: /* @__PURE__ */ e.jsx(
|
|
1155
|
+
disabled: !n && (!t || i - 1 < 0),
|
|
1156
|
+
onClick: () => s(Se(d, i - 1), r),
|
|
1157
|
+
children: /* @__PURE__ */ e.jsx("span", { className: "flex items-center justify-center", children: /* @__PURE__ */ e.jsx(At, { className: !n && (!t || i - 1 < 0) ? "text-gray-500" : "text-white/60" }) })
|
|
881
1158
|
}
|
|
882
1159
|
),
|
|
883
|
-
/* @__PURE__ */ e.jsx("div", { className: "w-8/12 text-center", children: /* @__PURE__ */ e.jsx(
|
|
1160
|
+
/* @__PURE__ */ e.jsx("div", { className: "w-8/12 text-center", children: /* @__PURE__ */ e.jsx(lt, { label: !1, property: r, onChange: s }) }),
|
|
884
1161
|
/* @__PURE__ */ e.jsx(
|
|
885
1162
|
"button",
|
|
886
1163
|
{
|
|
887
1164
|
type: "button",
|
|
888
1165
|
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",
|
|
889
|
-
disabled: !
|
|
890
|
-
onClick: () =>
|
|
1166
|
+
disabled: !n && (!t || i + 1 >= d.length),
|
|
1167
|
+
onClick: () => s(Se(d, i + 1), r),
|
|
891
1168
|
children: /* @__PURE__ */ e.jsx("span", { className: "flex items-center justify-center", children: /* @__PURE__ */ e.jsx(
|
|
892
|
-
|
|
1169
|
+
ve,
|
|
893
1170
|
{
|
|
894
|
-
className: !
|
|
1171
|
+
className: !n && (!t || i + 1 >= d.length) ? "text-gray-500" : "text-white/60"
|
|
895
1172
|
}
|
|
896
1173
|
) })
|
|
897
1174
|
}
|
|
898
1175
|
)
|
|
899
1176
|
] }) });
|
|
900
|
-
},
|
|
901
|
-
const t =
|
|
902
|
-
return /* @__PURE__ */ e.jsx("div", { className: "flex grow flex-wrap gap-1", children:
|
|
903
|
-
/* @__PURE__ */ e.jsx(
|
|
1177
|
+
}, Nr = ({ property: r, onChange: s }) => {
|
|
1178
|
+
const t = T(() => g(pe, `${r}.classes`, [""]), [r]), { canChange: n } = ee(re), l = le(r), a = T(() => g(l, "cls", ""), [l]);
|
|
1179
|
+
return /* @__PURE__ */ e.jsx("div", { className: "flex grow flex-wrap gap-1", children: C(t, (d) => /* @__PURE__ */ e.jsxs(X, { children: [
|
|
1180
|
+
/* @__PURE__ */ e.jsx(Y, { asChild: !0, children: /* @__PURE__ */ e.jsx(
|
|
904
1181
|
"button",
|
|
905
1182
|
{
|
|
906
1183
|
type: "button",
|
|
907
|
-
disabled: !
|
|
908
|
-
onClick: () =>
|
|
909
|
-
className: `cursor-pointer rounded border border-gray-600 p-1 disabled:cursor-not-allowed ${
|
|
910
|
-
children:
|
|
1184
|
+
disabled: !n,
|
|
1185
|
+
onClick: () => s(d, r),
|
|
1186
|
+
className: `cursor-pointer rounded border border-gray-600 p-1 disabled:cursor-not-allowed ${a === d ? " bg-blue-500 text-white" : "disabled:bg-gray-600 disabled:text-gray-400"}`,
|
|
1187
|
+
children: $.createElement(g(rt, d, Xe))
|
|
911
1188
|
}
|
|
912
1189
|
) }),
|
|
913
|
-
/* @__PURE__ */ e.jsx(
|
|
1190
|
+
/* @__PURE__ */ e.jsx(W, { children: Q(ne(d)) })
|
|
914
1191
|
] })) });
|
|
915
|
-
},
|
|
1192
|
+
}, Sr = {
|
|
916
1193
|
backgroundColor: "bg",
|
|
917
1194
|
textColor: "text",
|
|
918
1195
|
borderColor: "border",
|
|
@@ -924,38 +1201,38 @@ const or = ({ property: r, onChange: o }) => {
|
|
|
924
1201
|
toColor: "to",
|
|
925
1202
|
ringColor: "ring",
|
|
926
1203
|
ringOffsetColor: "ring-offset"
|
|
927
|
-
},
|
|
928
|
-
const t =
|
|
1204
|
+
}, Tr = ({ property: r, onChange: s }) => {
|
|
1205
|
+
const t = le(r), n = T(() => g(t, "cls", ""), [t]), { canChange: l } = ee(re), [a, d] = k([]), [i, o] = k({ color: "", shade: "" }), p = n.split("-"), u = g(p, "1", ""), c = g(p, "2", ""), m = I(
|
|
929
1206
|
// eslint-disable-next-line no-shadow
|
|
930
1207
|
(y) => {
|
|
931
|
-
["current", "inherit", "transparent", "black", "white"].includes(y) ? (d([]),
|
|
1208
|
+
["current", "inherit", "transparent", "black", "white"].includes(y) ? (d([]), o({ color: y })) : (d(["50", "100", "200", "300", "400", "500", "600", "700", "800", "900"]), o((v) => ({ ...v, color: y, shade: v.shade ? v.shade : "500" })));
|
|
932
1209
|
},
|
|
933
|
-
[d,
|
|
1210
|
+
[d, o]
|
|
934
1211
|
);
|
|
935
|
-
|
|
936
|
-
if (["current", "inherit", "transparent", "black", "white"].includes(
|
|
1212
|
+
M(() => {
|
|
1213
|
+
if (["current", "inherit", "transparent", "black", "white"].includes(u))
|
|
937
1214
|
return d([]);
|
|
938
1215
|
d(["50", "100", "200", "300", "400", "500", "600", "700", "800", "900"]);
|
|
939
|
-
}, [
|
|
940
|
-
const
|
|
1216
|
+
}, [u]);
|
|
1217
|
+
const x = I(
|
|
941
1218
|
// eslint-disable-next-line no-shadow
|
|
942
1219
|
(y) => {
|
|
943
|
-
|
|
1220
|
+
o({ color: u, shade: y });
|
|
944
1221
|
},
|
|
945
|
-
[
|
|
1222
|
+
[u]
|
|
946
1223
|
);
|
|
947
|
-
return
|
|
948
|
-
|
|
949
|
-
}, [t]),
|
|
950
|
-
const
|
|
951
|
-
|
|
952
|
-
}, [i,
|
|
1224
|
+
return M(() => {
|
|
1225
|
+
o({ color: "", shade: "" });
|
|
1226
|
+
}, [t]), M(() => {
|
|
1227
|
+
const v = `${g(Sr, r, "")}-${i.color}${i.shade ? `-${i.shade}` : ""}`;
|
|
1228
|
+
v.match(new RegExp(g(pe, `${r}.regExp`, ""))) && s(v, r);
|
|
1229
|
+
}, [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: [
|
|
953
1230
|
/* @__PURE__ */ e.jsx("div", { className: "grow text-center", children: /* @__PURE__ */ e.jsx(
|
|
954
|
-
|
|
1231
|
+
ye,
|
|
955
1232
|
{
|
|
956
|
-
disabled: !
|
|
1233
|
+
disabled: !l,
|
|
957
1234
|
rounded: !0,
|
|
958
|
-
selected:
|
|
1235
|
+
selected: u,
|
|
959
1236
|
onChange: m,
|
|
960
1237
|
options: [
|
|
961
1238
|
"current",
|
|
@@ -989,19 +1266,19 @@ const or = ({ property: r, onChange: o }) => {
|
|
|
989
1266
|
]
|
|
990
1267
|
}
|
|
991
1268
|
) }),
|
|
992
|
-
/* @__PURE__ */ e.jsx("button", { type: "button", className: "grow text-center", children: /* @__PURE__ */ e.jsx(
|
|
1269
|
+
/* @__PURE__ */ e.jsx("button", { type: "button", className: "grow text-center", children: /* @__PURE__ */ e.jsx(ye, { rounded: !0, selected: c, disabled: !u || !l, onChange: x, options: a }) })
|
|
993
1270
|
] });
|
|
994
|
-
},
|
|
1271
|
+
}, $e = (r, s) => {
|
|
995
1272
|
r = r.toLowerCase();
|
|
996
1273
|
let t = r.trim().replace(/ |\+/g, "");
|
|
997
|
-
if ((t === "auto" || t === "none") &&
|
|
1274
|
+
if ((t === "auto" || t === "none") && s.includes(t))
|
|
998
1275
|
return { value: "", unit: t };
|
|
999
|
-
const
|
|
1000
|
-
t = t.replace(
|
|
1001
|
-
const
|
|
1002
|
-
return
|
|
1003
|
-
},
|
|
1004
|
-
const
|
|
1276
|
+
const n = s.length ? new RegExp(s.join("|"), "g") : /XXXXXX/g;
|
|
1277
|
+
t = t.replace(n, "");
|
|
1278
|
+
const l = r.match(n), a = l && l.length > 1, d = !b(t) && Number.isNaN(Number(t));
|
|
1279
|
+
return a || d ? { error: "Invalid value" } : l && (l[0] === "auto" || l[0] === "none") ? { value: l[0], unit: "" } : { value: t, unit: l ? l[0] : "" };
|
|
1280
|
+
}, Rr = (r) => {
|
|
1281
|
+
const s = r.startsWith("-") ? "-" : "", t = r.split("-").pop();
|
|
1005
1282
|
if (["auto", "none"].includes(t))
|
|
1006
1283
|
return { value: "", unit: t };
|
|
1007
1284
|
if (t === "px")
|
|
@@ -1010,26 +1287,26 @@ const or = ({ property: r, onChange: o }) => {
|
|
|
1010
1287
|
return { value: "100", unit: r.indexOf("w-") !== -1 ? "vw" : "vh" };
|
|
1011
1288
|
if (t === "full")
|
|
1012
1289
|
return { value: "100", unit: "%" };
|
|
1013
|
-
if (
|
|
1014
|
-
return { value: `${
|
|
1015
|
-
if (
|
|
1016
|
-
return { value: `${
|
|
1017
|
-
if (
|
|
1290
|
+
if (O(r, "skew-"))
|
|
1291
|
+
return { value: `${s}${t}`, unit: "deg" };
|
|
1292
|
+
if (O(r, "rotate-"))
|
|
1293
|
+
return { value: `${s}${t}`, unit: "deg" };
|
|
1294
|
+
if (O(r, "opacity-"))
|
|
1018
1295
|
return { value: `${t / 100}`, unit: "-" };
|
|
1019
|
-
if (
|
|
1296
|
+
if (O(r, "duration-") || O(r, "delay-"))
|
|
1020
1297
|
return { value: `${t}`, unit: "ms" };
|
|
1021
|
-
if (
|
|
1022
|
-
return { value: `${
|
|
1023
|
-
if (
|
|
1024
|
-
return { value: `${
|
|
1025
|
-
if (
|
|
1026
|
-
const
|
|
1027
|
-
if (
|
|
1028
|
-
return { value:
|
|
1298
|
+
if (O(r, "translate-") && !t.includes("/"))
|
|
1299
|
+
return { value: `${s}${`${t / 4}`}`, unit: "rem" };
|
|
1300
|
+
if (O(r, "scale-"))
|
|
1301
|
+
return { value: `${s}${`${t / 100}`}`, unit: "-" };
|
|
1302
|
+
if (Z(r, "border")) {
|
|
1303
|
+
const n = r.match(/border-?(x|y|t|r|b|l)?\d+/g);
|
|
1304
|
+
if (n)
|
|
1305
|
+
return { value: n[0].split("-").pop(), unit: "px" };
|
|
1029
1306
|
if (r.match(/border-?(x|y|t|r|b|l)?/g))
|
|
1030
1307
|
return { value: "1", unit: "px" };
|
|
1031
1308
|
}
|
|
1032
|
-
if (
|
|
1309
|
+
if (Z(r, "max-w-")) {
|
|
1033
1310
|
if (r === "max-w-screen-sm")
|
|
1034
1311
|
return { value: "640", unit: "px" };
|
|
1035
1312
|
if (r === "max-w-screen-md")
|
|
@@ -1065,7 +1342,7 @@ const or = ({ property: r, onChange: o }) => {
|
|
|
1065
1342
|
if (t === "prose")
|
|
1066
1343
|
return { value: "65", unit: "ch" };
|
|
1067
1344
|
}
|
|
1068
|
-
if (
|
|
1345
|
+
if (Z(r, "text-")) {
|
|
1069
1346
|
if (t === "xs")
|
|
1070
1347
|
return { value: "12", unit: "px" };
|
|
1071
1348
|
if (t === "sm")
|
|
@@ -1093,7 +1370,7 @@ const or = ({ property: r, onChange: o }) => {
|
|
|
1093
1370
|
if (t === "9xl")
|
|
1094
1371
|
return { value: "128", unit: "px" };
|
|
1095
1372
|
}
|
|
1096
|
-
if (
|
|
1373
|
+
if (Z(r, "leading-")) {
|
|
1097
1374
|
if (t === "none")
|
|
1098
1375
|
return { value: "1", unit: "-" };
|
|
1099
1376
|
if (t === "tight")
|
|
@@ -1107,7 +1384,7 @@ const or = ({ property: r, onChange: o }) => {
|
|
|
1107
1384
|
if (t === "loose")
|
|
1108
1385
|
return { value: "2", unit: "-" };
|
|
1109
1386
|
}
|
|
1110
|
-
if (
|
|
1387
|
+
if (Z(r, "tracking-")) {
|
|
1111
1388
|
if (t === "tighter")
|
|
1112
1389
|
return { value: "-0.05", unit: "em" };
|
|
1113
1390
|
if (t === "tight")
|
|
@@ -1124,219 +1401,219 @@ const or = ({ property: r, onChange: o }) => {
|
|
|
1124
1401
|
if (["max", "min", "fit"].includes(t))
|
|
1125
1402
|
return { value: r, unit: "class" };
|
|
1126
1403
|
if (t.includes("/")) {
|
|
1127
|
-
const [
|
|
1128
|
-
return { value:
|
|
1404
|
+
const [n, l] = C(t.split("/"), (a) => parseInt(a, 10));
|
|
1405
|
+
return { value: s + (n / l * 100).toFixed(2).replace(".00", ""), unit: "%" };
|
|
1129
1406
|
}
|
|
1130
|
-
return
|
|
1131
|
-
},
|
|
1132
|
-
if (
|
|
1407
|
+
return xt(parseFloat(t)) ? { value: `${s + parseFloat(t) * 4}`, unit: "px" } : { value: t, unit: "class" };
|
|
1408
|
+
}, Vr = (r) => {
|
|
1409
|
+
if (b(r))
|
|
1133
1410
|
return { value: "", unit: "" };
|
|
1134
|
-
const
|
|
1135
|
-
if (
|
|
1136
|
-
return
|
|
1137
|
-
const t =
|
|
1138
|
-
return { value: `${
|
|
1139
|
-
},
|
|
1411
|
+
const s = r.match(/\[.*\]/g);
|
|
1412
|
+
if (s === null)
|
|
1413
|
+
return Hr(r);
|
|
1414
|
+
const t = g(s, "0", "").replace(/\[|\]/g, ""), n = r.startsWith("-") ? "-" : "", l = be(t.match(/\d+.\d+|\d+/g));
|
|
1415
|
+
return { value: `${n}${l}`, unit: t.replace(l, "") };
|
|
1416
|
+
}, Hr = (r) => b(r) ? { value: "", unit: "" } : Rr(r), ot = $.createContext({
|
|
1140
1417
|
setDragData: () => {
|
|
1141
1418
|
}
|
|
1142
|
-
}),
|
|
1419
|
+
}), Br = ({
|
|
1143
1420
|
unit: r,
|
|
1144
|
-
currentValue:
|
|
1421
|
+
currentValue: s,
|
|
1145
1422
|
onDrag: t,
|
|
1146
|
-
onDragEnd:
|
|
1147
|
-
onDragStart:
|
|
1148
|
-
negative:
|
|
1423
|
+
onDragEnd: n,
|
|
1424
|
+
onDragStart: l,
|
|
1425
|
+
negative: a,
|
|
1149
1426
|
cssProperty: d
|
|
1150
1427
|
}) => {
|
|
1151
|
-
const { setDragData: i } =
|
|
1428
|
+
const { setDragData: i } = ee(ot);
|
|
1152
1429
|
return /* @__PURE__ */ e.jsx(
|
|
1153
1430
|
"button",
|
|
1154
1431
|
{
|
|
1155
1432
|
type: "button",
|
|
1156
|
-
onMouseDown: (
|
|
1157
|
-
const
|
|
1433
|
+
onMouseDown: (o) => {
|
|
1434
|
+
const p = {
|
|
1158
1435
|
onDrag: t,
|
|
1159
|
-
onDragEnd:
|
|
1436
|
+
onDragEnd: n,
|
|
1160
1437
|
dragging: !0,
|
|
1161
|
-
dragStartY:
|
|
1162
|
-
dragStartValue: `${
|
|
1438
|
+
dragStartY: o.pageY,
|
|
1439
|
+
dragStartValue: `${s}`,
|
|
1163
1440
|
dragUnit: r,
|
|
1164
|
-
negative:
|
|
1441
|
+
negative: a,
|
|
1165
1442
|
cssProperty: d
|
|
1166
1443
|
};
|
|
1167
|
-
|
|
1444
|
+
l(p), i(p);
|
|
1168
1445
|
},
|
|
1169
1446
|
color: void 0,
|
|
1170
1447
|
className: "relative z-50 ml-1 hidden h-6 cursor-row-resize rounded bg-background/70 px-2 group-hover:inline",
|
|
1171
|
-
children: /* @__PURE__ */ e.jsx(
|
|
1448
|
+
children: /* @__PURE__ */ e.jsx($t, {})
|
|
1172
1449
|
}
|
|
1173
1450
|
);
|
|
1174
|
-
},
|
|
1175
|
-
|
|
1451
|
+
}, Ar = ({ 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((n) => /* @__PURE__ */ e.jsx(
|
|
1452
|
+
et,
|
|
1176
1453
|
{
|
|
1177
1454
|
className: "h-max rounded-none px-1 py-1 text-right text-[11px] hover:bg-blue-400",
|
|
1178
|
-
color:
|
|
1455
|
+
color: s === n ? "primary" : void 0,
|
|
1179
1456
|
size: "sm",
|
|
1180
|
-
onClick: (
|
|
1181
|
-
|
|
1457
|
+
onClick: (l) => {
|
|
1458
|
+
l.stopPropagation(), r(n);
|
|
1182
1459
|
},
|
|
1183
|
-
children:
|
|
1460
|
+
children: n
|
|
1184
1461
|
},
|
|
1185
|
-
|
|
1186
|
-
)) }),
|
|
1187
|
-
const [
|
|
1188
|
-
|
|
1189
|
-
const { value:
|
|
1190
|
-
if (
|
|
1191
|
-
|
|
1462
|
+
n
|
|
1463
|
+
)) }), Dr = (r) => {
|
|
1464
|
+
const [s, t] = k(!1), [n, l] = k(""), { currentClass: a, onChange: d, classPrefix: i, cssProperty: o, units: p, negative: u } = r, [c, m] = k(o != null && o.toLowerCase().includes("width") ? "%" : p[0]), [x, y] = k(!1), [v, L] = k(""), [R, f] = k(!1), [j, B] = k(!1);
|
|
1465
|
+
M(() => {
|
|
1466
|
+
const { value: h, unit: w } = Vr(a);
|
|
1467
|
+
if (w === "") {
|
|
1468
|
+
l(h), m(o != null && o.toLowerCase().includes("width") ? "%" : p[0]);
|
|
1192
1469
|
return;
|
|
1193
1470
|
}
|
|
1194
|
-
m(
|
|
1195
|
-
}, [
|
|
1196
|
-
const
|
|
1197
|
-
(
|
|
1198
|
-
d(
|
|
1471
|
+
m(w), l(w === "class" || b(h) ? "" : h);
|
|
1472
|
+
}, [a, o, p]);
|
|
1473
|
+
const N = xe(
|
|
1474
|
+
(h) => {
|
|
1475
|
+
d(h);
|
|
1199
1476
|
},
|
|
1200
1477
|
[d],
|
|
1201
1478
|
200
|
|
1202
|
-
),
|
|
1203
|
-
(
|
|
1204
|
-
d(
|
|
1479
|
+
), P = xe(
|
|
1480
|
+
(h) => {
|
|
1481
|
+
d(h, !1);
|
|
1205
1482
|
},
|
|
1206
1483
|
[d],
|
|
1207
1484
|
200
|
|
1208
1485
|
), F = I(
|
|
1209
|
-
(
|
|
1210
|
-
const
|
|
1211
|
-
if (
|
|
1486
|
+
(h = !1) => {
|
|
1487
|
+
const w = $e(`${n}`, p);
|
|
1488
|
+
if (g(w, "error", !1)) {
|
|
1212
1489
|
y(!0);
|
|
1213
1490
|
return;
|
|
1214
1491
|
}
|
|
1215
|
-
const
|
|
1216
|
-
if (
|
|
1217
|
-
|
|
1492
|
+
const S = g(w, "unit") !== "" ? g(w, "unit") : c;
|
|
1493
|
+
if (S === "auto" || S === "none") {
|
|
1494
|
+
N(`${i}${S}`);
|
|
1218
1495
|
return;
|
|
1219
1496
|
}
|
|
1220
|
-
if (
|
|
1497
|
+
if (g(w, "value") === "")
|
|
1221
1498
|
return;
|
|
1222
|
-
const
|
|
1223
|
-
|
|
1499
|
+
const U = `${g(w, "value", "").startsWith("-") ? "-" : ""}${i}[${g(w, "value", "").replace("-", "")}${S === "-" ? "" : S}]`;
|
|
1500
|
+
h ? P(U) : N(U);
|
|
1224
1501
|
},
|
|
1225
|
-
[
|
|
1226
|
-
),
|
|
1227
|
-
(
|
|
1228
|
-
const
|
|
1229
|
-
if (
|
|
1502
|
+
[N, P, n, c, i, p]
|
|
1503
|
+
), oe = I(
|
|
1504
|
+
(h) => {
|
|
1505
|
+
const w = $e(`${n}`, p);
|
|
1506
|
+
if (g(w, "error", !1)) {
|
|
1230
1507
|
y(!0);
|
|
1231
1508
|
return;
|
|
1232
1509
|
}
|
|
1233
|
-
if (
|
|
1234
|
-
|
|
1510
|
+
if (h === "auto" || h === "none") {
|
|
1511
|
+
N(`${i}${h}`);
|
|
1235
1512
|
return;
|
|
1236
1513
|
}
|
|
1237
|
-
if (
|
|
1514
|
+
if (g(w, "value") === "")
|
|
1238
1515
|
return;
|
|
1239
|
-
const
|
|
1240
|
-
|
|
1516
|
+
const S = g(w, "unit") !== "" ? g(w, "unit") : h, U = `${g(w, "value", "").startsWith("-") ? "-" : ""}${i}[${g(w, "value", "").replace("-", "")}${S === "-" ? "" : S}]`;
|
|
1517
|
+
N(U);
|
|
1241
1518
|
},
|
|
1242
|
-
[
|
|
1519
|
+
[N, n, i, p]
|
|
1243
1520
|
);
|
|
1244
|
-
return /* @__PURE__ */ e.jsx("div", { className: "flex w-full flex-col", children: /* @__PURE__ */ e.jsx("div", { className: "flex items-center justify-start", children:
|
|
1245
|
-
/* @__PURE__ */ e.jsx("input", { className: "w-20 rounded py-1", readOnly: !0, value:
|
|
1246
|
-
/* @__PURE__ */ e.jsxs(
|
|
1247
|
-
/* @__PURE__ */ e.jsx(
|
|
1248
|
-
/* @__PURE__ */ e.jsx(
|
|
1521
|
+
return /* @__PURE__ */ e.jsx("div", { className: "flex w-full flex-col", children: /* @__PURE__ */ e.jsx("div", { className: "flex items-center justify-start", children: c === "class" ? /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
1522
|
+
/* @__PURE__ */ e.jsx("input", { className: "w-20 rounded py-1", readOnly: !0, value: a }),
|
|
1523
|
+
/* @__PURE__ */ e.jsxs(X, { children: [
|
|
1524
|
+
/* @__PURE__ */ e.jsx(Y, { 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, {}) }) }),
|
|
1525
|
+
/* @__PURE__ */ e.jsx(W, { children: "Current value is using a Tailwind preset class." })
|
|
1249
1526
|
] })
|
|
1250
|
-
] }) : /* @__PURE__ */ e.jsxs("div", { className: `group relative flex items-center ${
|
|
1527
|
+
] }) : /* @__PURE__ */ e.jsxs("div", { className: `group relative flex items-center ${R ? "z-auto" : ""}`, children: [
|
|
1251
1528
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center rounded-md border border-border", children: [
|
|
1252
|
-
["none", "auto"].indexOf(
|
|
1529
|
+
["none", "auto"].indexOf(c) !== -1 ? null : /* @__PURE__ */ e.jsx(
|
|
1253
1530
|
"input",
|
|
1254
1531
|
{
|
|
1255
|
-
readOnly:
|
|
1256
|
-
onKeyPress: (
|
|
1257
|
-
|
|
1532
|
+
readOnly: c === "class",
|
|
1533
|
+
onKeyPress: (h) => {
|
|
1534
|
+
h.key === "Enter" && F();
|
|
1258
1535
|
},
|
|
1259
|
-
onKeyDown: (
|
|
1260
|
-
if (
|
|
1536
|
+
onKeyDown: (h) => {
|
|
1537
|
+
if (h.keyCode !== 38 && h.keyCode !== 40)
|
|
1261
1538
|
return;
|
|
1262
|
-
|
|
1263
|
-
const
|
|
1264
|
-
let
|
|
1265
|
-
|
|
1266
|
-
const E = `${
|
|
1267
|
-
|
|
1539
|
+
h.preventDefault(), B(!0);
|
|
1540
|
+
const w = ht(h.target.value);
|
|
1541
|
+
let S = Me(w) ? 0 : w;
|
|
1542
|
+
h.keyCode === 38 && (S += 1), h.keyCode === 40 && (S -= 1);
|
|
1543
|
+
const E = `${S}`, nt = `${E.startsWith("-") ? "-" : ""}${i}[${E.replace("-", "")}${c === "-" ? "" : c}]`;
|
|
1544
|
+
P(nt);
|
|
1268
1545
|
},
|
|
1269
|
-
onKeyUp: (
|
|
1270
|
-
|
|
1546
|
+
onKeyUp: (h) => {
|
|
1547
|
+
j && (h.preventDefault(), B(!1));
|
|
1271
1548
|
},
|
|
1272
1549
|
onBlur: () => F(),
|
|
1273
|
-
onChange: (
|
|
1274
|
-
y(!1),
|
|
1550
|
+
onChange: (h) => {
|
|
1551
|
+
y(!1), l(h.target.value);
|
|
1275
1552
|
},
|
|
1276
|
-
onClick: (
|
|
1277
|
-
var
|
|
1278
|
-
(
|
|
1553
|
+
onClick: (h) => {
|
|
1554
|
+
var w;
|
|
1555
|
+
(w = h == null ? void 0 : h.target) == null || w.select(), t(!1);
|
|
1279
1556
|
},
|
|
1280
|
-
value:
|
|
1557
|
+
value: R ? v : n,
|
|
1281
1558
|
className: "h-6 w-14 rounded rounded-r-none bg-background pl-2 text-sm focus-visible:outline-0 ".concat(
|
|
1282
1559
|
" ",
|
|
1283
|
-
|
|
1560
|
+
x ? "border-red-500 text-red-500" : "border-foreground/20"
|
|
1284
1561
|
)
|
|
1285
1562
|
}
|
|
1286
1563
|
),
|
|
1287
|
-
/* @__PURE__ */ e.jsxs(
|
|
1288
|
-
/* @__PURE__ */ e.jsx(
|
|
1564
|
+
/* @__PURE__ */ e.jsxs(X, { open: s, delayDuration: 100, children: [
|
|
1565
|
+
/* @__PURE__ */ e.jsx(Y, { asChild: !0, children: /* @__PURE__ */ e.jsxs(
|
|
1289
1566
|
"button",
|
|
1290
1567
|
{
|
|
1291
1568
|
type: "button",
|
|
1292
|
-
onClick: () => t(!
|
|
1569
|
+
onClick: () => t(!s),
|
|
1293
1570
|
className: "flex h-6 cursor-pointer items-center gap-x-1 rounded rounded-l-none bg-background p-px px-1 text-[11px] uppercase",
|
|
1294
1571
|
children: [
|
|
1295
|
-
/* @__PURE__ */ e.jsx("span", { className: `inline-block ${
|
|
1296
|
-
|
|
1572
|
+
/* @__PURE__ */ e.jsx("span", { className: `inline-block ${p.length === 1 ? "px-2 font-semibold" : ""}`, children: c }),
|
|
1573
|
+
p.length > 1 ? /* @__PURE__ */ e.jsx(Dt, {}) : null
|
|
1297
1574
|
]
|
|
1298
1575
|
}
|
|
1299
1576
|
) }),
|
|
1300
|
-
/* @__PURE__ */ e.jsx(
|
|
1301
|
-
|
|
1577
|
+
/* @__PURE__ */ e.jsx(Kt, { children: /* @__PURE__ */ e.jsx(W, { className: "bg-background", children: /* @__PURE__ */ e.jsx(
|
|
1578
|
+
Ar,
|
|
1302
1579
|
{
|
|
1303
|
-
units:
|
|
1304
|
-
current:
|
|
1305
|
-
onSelect: (
|
|
1306
|
-
t(!1), m(
|
|
1580
|
+
units: p,
|
|
1581
|
+
current: c,
|
|
1582
|
+
onSelect: (h) => {
|
|
1583
|
+
t(!1), m(h), oe(h);
|
|
1307
1584
|
}
|
|
1308
1585
|
}
|
|
1309
1586
|
) }) })
|
|
1310
1587
|
] })
|
|
1311
1588
|
] }),
|
|
1312
|
-
["none", "auto"].indexOf(
|
|
1313
|
-
|
|
1589
|
+
["none", "auto"].indexOf(c) !== -1 || R ? null : /* @__PURE__ */ e.jsx(
|
|
1590
|
+
Br,
|
|
1314
1591
|
{
|
|
1315
|
-
onDragStart: () =>
|
|
1316
|
-
onDragEnd: (
|
|
1317
|
-
if (
|
|
1592
|
+
onDragStart: () => f(!0),
|
|
1593
|
+
onDragEnd: (h) => {
|
|
1594
|
+
if (L(() => ""), f(!1), b(h))
|
|
1318
1595
|
return;
|
|
1319
|
-
const
|
|
1320
|
-
|
|
1596
|
+
const w = `${h}`, E = `${w.startsWith("-") ? "-" : ""}${i}[${w.replace("-", "")}${c === "-" ? "" : c}]`;
|
|
1597
|
+
N(E);
|
|
1321
1598
|
},
|
|
1322
|
-
onDrag: (
|
|
1323
|
-
if (
|
|
1599
|
+
onDrag: (h) => {
|
|
1600
|
+
if (b(h))
|
|
1324
1601
|
return;
|
|
1325
|
-
|
|
1326
|
-
const
|
|
1327
|
-
|
|
1602
|
+
L(h);
|
|
1603
|
+
const w = `${h}`, E = `${w.startsWith("-") ? "-" : ""}${i}[${w.replace("-", "")}${c === "-" ? "" : c}]`;
|
|
1604
|
+
P(E);
|
|
1328
1605
|
},
|
|
1329
|
-
currentValue:
|
|
1330
|
-
unit:
|
|
1331
|
-
negative:
|
|
1332
|
-
cssProperty:
|
|
1606
|
+
currentValue: n,
|
|
1607
|
+
unit: c,
|
|
1608
|
+
negative: u,
|
|
1609
|
+
cssProperty: o
|
|
1333
1610
|
}
|
|
1334
1611
|
)
|
|
1335
1612
|
] }) }) });
|
|
1336
|
-
},
|
|
1337
|
-
const
|
|
1338
|
-
return
|
|
1339
|
-
},
|
|
1613
|
+
}, le = (r) => {
|
|
1614
|
+
const s = ce();
|
|
1615
|
+
return mt(s, { property: r });
|
|
1616
|
+
}, $r = (r, s) => {
|
|
1340
1617
|
const t = {
|
|
1341
1618
|
xs: 0,
|
|
1342
1619
|
sm: 1,
|
|
@@ -1345,8 +1622,8 @@ const or = ({ property: r, onChange: o }) => {
|
|
|
1345
1622
|
xl: 4,
|
|
1346
1623
|
"2xl": 5
|
|
1347
1624
|
};
|
|
1348
|
-
return t[
|
|
1349
|
-
},
|
|
1625
|
+
return t[g(r, "mq", "xs")] <= t[s];
|
|
1626
|
+
}, Ir = {
|
|
1350
1627
|
width: "w-",
|
|
1351
1628
|
height: "h-",
|
|
1352
1629
|
minWidth: "min-w-",
|
|
@@ -1412,87 +1689,87 @@ const or = ({ property: r, onChange: o }) => {
|
|
|
1412
1689
|
insetY: "inset-y-",
|
|
1413
1690
|
opacity: "opacity-",
|
|
1414
1691
|
flexBasis: "basis-"
|
|
1415
|
-
},
|
|
1692
|
+
}, Ie = {
|
|
1416
1693
|
xs: "",
|
|
1417
1694
|
sm: "640px",
|
|
1418
1695
|
md: "768px",
|
|
1419
1696
|
lg: "1024px",
|
|
1420
1697
|
xl: "1280px",
|
|
1421
1698
|
"2xl": "1536px"
|
|
1422
|
-
},
|
|
1423
|
-
const { type:
|
|
1424
|
-
}, units:
|
|
1425
|
-
(
|
|
1426
|
-
const F = { dark: i, mq:
|
|
1427
|
-
(i ||
|
|
1428
|
-
const
|
|
1429
|
-
|
|
1699
|
+
}, Lr = (r) => `${r.toUpperCase()} ${Ie[r] ? `(${Ie[r]} & up)` : ""}`, ke = (r) => {
|
|
1700
|
+
const { type: s = "icons", label: t, property: n, onEmitChange: l = () => {
|
|
1701
|
+
}, units: a, negative: d = !1 } = r, [i] = Ft(), [o] = qe(), [, p] = He(), u = le(n), c = Ue(), m = Ge(), [x] = Ke(), y = T(() => g(u, "fullCls", ""), [u]), v = I(
|
|
1702
|
+
(N, P = !0) => {
|
|
1703
|
+
const F = { dark: i, mq: p, mod: o, cls: N, property: n, fullCls: "" };
|
|
1704
|
+
(i || o !== "") && (F.mq = "xs");
|
|
1705
|
+
const oe = or(F);
|
|
1706
|
+
c(x, [oe], P);
|
|
1430
1707
|
},
|
|
1431
|
-
[
|
|
1432
|
-
),
|
|
1433
|
-
m(
|
|
1434
|
-
}, [
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
}, [
|
|
1438
|
-
const [, ,
|
|
1439
|
-
(
|
|
1440
|
-
|
|
1708
|
+
[x, i, p, o, n, c]
|
|
1709
|
+
), L = I(() => {
|
|
1710
|
+
m(x, [y]);
|
|
1711
|
+
}, [x, y, m]), R = T(() => $r(u, p), [u, p]);
|
|
1712
|
+
M(() => {
|
|
1713
|
+
l(R, u);
|
|
1714
|
+
}, [R, l, u]);
|
|
1715
|
+
const [, , f] = He(), j = I(
|
|
1716
|
+
(N) => {
|
|
1717
|
+
f({
|
|
1441
1718
|
xs: 400,
|
|
1442
1719
|
sm: 640,
|
|
1443
1720
|
md: 800,
|
|
1444
1721
|
lg: 1024,
|
|
1445
1722
|
xl: 1420,
|
|
1446
1723
|
"2xl": 1920
|
|
1447
|
-
}[
|
|
1724
|
+
}[N]);
|
|
1448
1725
|
},
|
|
1449
|
-
[
|
|
1450
|
-
),
|
|
1451
|
-
return /* @__PURE__ */ e.jsx(
|
|
1452
|
-
/* @__PURE__ */ e.jsx("div", { className: "relative w-[70px] truncate text-xs text-foreground", children: /* @__PURE__ */ e.jsx("span", { className: `text-[11px] ${
|
|
1726
|
+
[f]
|
|
1727
|
+
), B = g(u, "dark", null) === i && g(u, "mod", null) === o && g(u, "mq", null) === p;
|
|
1728
|
+
return /* @__PURE__ */ e.jsx(Cr, { canChange: R, canReset: u && B, children: /* @__PURE__ */ e.jsxs("div", { className: "group flex flex-row items-center py-2 first:pt-0 last:pb-0", children: [
|
|
1729
|
+
/* @__PURE__ */ e.jsx("div", { className: "relative w-[70px] truncate text-xs text-foreground", children: /* @__PURE__ */ e.jsx("span", { className: `text-[11px] ${u && !B ? "text-foreground" : ""}`, children: t }) }),
|
|
1453
1730
|
/* @__PURE__ */ e.jsxs("div", { className: "flex flex-row items-center", children: [
|
|
1454
1731
|
/* @__PURE__ */ e.jsxs("div", { className: "w-[150px]", children: [
|
|
1455
|
-
|
|
1456
|
-
|
|
1732
|
+
s === "arbitrary" ? /* @__PURE__ */ e.jsx(
|
|
1733
|
+
Dr,
|
|
1457
1734
|
{
|
|
1458
|
-
currentClass:
|
|
1459
|
-
classPrefix:
|
|
1460
|
-
units:
|
|
1461
|
-
onChange:
|
|
1735
|
+
currentClass: g(u, "cls", ""),
|
|
1736
|
+
classPrefix: g(Ir, n, ""),
|
|
1737
|
+
units: a || [],
|
|
1738
|
+
onChange: v,
|
|
1462
1739
|
negative: d,
|
|
1463
|
-
cssProperty:
|
|
1740
|
+
cssProperty: n
|
|
1464
1741
|
}
|
|
1465
1742
|
) : null,
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
|
|
1743
|
+
s === "icons" && /* @__PURE__ */ e.jsx(Nr, { property: n, onChange: v }),
|
|
1744
|
+
s === "range" && /* @__PURE__ */ e.jsx(kr, { property: n, onChange: v }),
|
|
1745
|
+
s === "color" && /* @__PURE__ */ e.jsx(Tr, { property: n, onChange: v }),
|
|
1746
|
+
s === "dropdown" && /* @__PURE__ */ e.jsx(lt, { label: t, property: n, onChange: v })
|
|
1470
1747
|
] }),
|
|
1471
|
-
/* @__PURE__ */ e.jsx("div", { className: `w-[30px] cursor-pointer ${y ? "visible" : "invisible"}`, children:
|
|
1472
|
-
/* @__PURE__ */ e.jsx(
|
|
1748
|
+
/* @__PURE__ */ e.jsx("div", { className: `w-[30px] cursor-pointer ${y ? "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(Ye, { className: "h-5 w-5 text-blue-500 hover:opacity-80" }) }) : R && u ? /* @__PURE__ */ e.jsxs(X, { delayDuration: 100, children: [
|
|
1749
|
+
/* @__PURE__ */ e.jsx(Y, { asChild: !0, children: /* @__PURE__ */ e.jsx(
|
|
1473
1750
|
"button",
|
|
1474
1751
|
{
|
|
1475
1752
|
type: "button",
|
|
1476
1753
|
className: "invisible ml-3 mt-1 rounded-full bg-blue-500 text-white group-hover:visible",
|
|
1477
|
-
children: /* @__PURE__ */ e.jsx(
|
|
1754
|
+
children: /* @__PURE__ */ e.jsx(we, {})
|
|
1478
1755
|
}
|
|
1479
1756
|
) }),
|
|
1480
|
-
/* @__PURE__ */ e.jsx(
|
|
1757
|
+
/* @__PURE__ */ e.jsx(W, { children: /* @__PURE__ */ e.jsx("div", { className: "text-right", children: /* @__PURE__ */ e.jsxs("div", { children: [
|
|
1481
1758
|
"Current style is set at ",
|
|
1482
1759
|
/* @__PURE__ */ e.jsxs("span", { className: "font-bold ", children: [
|
|
1483
|
-
|
|
1484
|
-
i && !
|
|
1760
|
+
Lr(g(u, "mq")),
|
|
1761
|
+
i && !u.dark ? "(Light mode)" : ""
|
|
1485
1762
|
] }),
|
|
1486
1763
|
/* @__PURE__ */ e.jsx("br", {}),
|
|
1487
1764
|
/* @__PURE__ */ e.jsxs(
|
|
1488
1765
|
"button",
|
|
1489
1766
|
{
|
|
1490
1767
|
type: "button",
|
|
1491
|
-
onClick: () =>
|
|
1768
|
+
onClick: () => j(g(u, "mq")),
|
|
1492
1769
|
className: "block w-full cursor-default text-right font-semibold text-blue-500",
|
|
1493
1770
|
children: [
|
|
1494
1771
|
"Switch to ",
|
|
1495
|
-
|
|
1772
|
+
g(u, "mq").toUpperCase()
|
|
1496
1773
|
]
|
|
1497
1774
|
}
|
|
1498
1775
|
)
|
|
@@ -1500,48 +1777,48 @@ const or = ({ property: r, onChange: o }) => {
|
|
|
1500
1777
|
] }) : null })
|
|
1501
1778
|
] })
|
|
1502
1779
|
] }) });
|
|
1503
|
-
},
|
|
1780
|
+
}, Pr = ["px", "%", "em", "rem", "ch", "vh", "vw"], st = ({
|
|
1504
1781
|
label: r,
|
|
1505
|
-
options:
|
|
1782
|
+
options: s,
|
|
1506
1783
|
borderB: t = !1,
|
|
1507
|
-
borderT:
|
|
1508
|
-
type:
|
|
1509
|
-
units:
|
|
1784
|
+
borderT: n = !1,
|
|
1785
|
+
type: l = "arbitrary",
|
|
1786
|
+
units: a = Pr,
|
|
1510
1787
|
negative: d = !1
|
|
1511
1788
|
}) => {
|
|
1512
|
-
const [i,
|
|
1789
|
+
const [i, o] = k(s[0].key), p = ce(), u = I((c) => C(p, "property").includes(c), [p]);
|
|
1513
1790
|
return /* @__PURE__ */ e.jsxs(
|
|
1514
1791
|
"div",
|
|
1515
1792
|
{
|
|
1516
|
-
className: `mb-2 border-gray-800 py-2 first:pt-0 last:pb-0 ${t ? "border-b" : ""} ${
|
|
1793
|
+
className: `mb-2 border-gray-800 py-2 first:pt-0 last:pb-0 ${t ? "border-b" : ""} ${n ? "border-t" : ""}`,
|
|
1517
1794
|
children: [
|
|
1518
1795
|
/* @__PURE__ */ e.jsxs("div", { className: "flex flex-row text-xs", children: [
|
|
1519
1796
|
r && /* @__PURE__ */ e.jsx("span", { className: "relative w-[70px] flex-none text-xs text-foreground", children: r }),
|
|
1520
|
-
/* @__PURE__ */ e.jsx("div", { className: "mb-3 flex grow flex-row flex-wrap gap-x-px", children:
|
|
1521
|
-
|
|
1522
|
-
/* @__PURE__ */ e.jsx(
|
|
1797
|
+
/* @__PURE__ */ e.jsx("div", { className: "mb-3 flex grow flex-row flex-wrap gap-x-px", children: $.Children.toArray(
|
|
1798
|
+
s.map(({ label: c, key: m }) => /* @__PURE__ */ e.jsx("div", { className: "first:rounded-l last:rounded-r", children: /* @__PURE__ */ e.jsxs(X, { children: [
|
|
1799
|
+
/* @__PURE__ */ e.jsx(Y, { asChild: !0, children: /* @__PURE__ */ e.jsxs(
|
|
1523
1800
|
"button",
|
|
1524
1801
|
{
|
|
1525
1802
|
type: "button",
|
|
1526
|
-
onClick: () =>
|
|
1803
|
+
onClick: () => o(m),
|
|
1527
1804
|
className: `relative cursor-pointer rounded-full p-1 text-[8px] ${m === i ? " bg-[#3E57F0] text-white" : "text-gray-600 dark:text-gray-300"}`,
|
|
1528
1805
|
children: [
|
|
1529
|
-
|
|
1530
|
-
className:
|
|
1806
|
+
$.createElement("div", {
|
|
1807
|
+
className: u(m) ? "-bottom-1.5 absolute bg-[#3E57F0] h-[2px] left-0 w-full" : ""
|
|
1531
1808
|
}),
|
|
1532
|
-
|
|
1809
|
+
$.createElement(g(rt, m, Xe), { className: "text-inherit w-3 h-3" })
|
|
1533
1810
|
]
|
|
1534
1811
|
}
|
|
1535
1812
|
) }),
|
|
1536
|
-
/* @__PURE__ */ e.jsx(
|
|
1813
|
+
/* @__PURE__ */ e.jsx(W, { children: Q(ne(c)) })
|
|
1537
1814
|
] }) }))
|
|
1538
1815
|
) })
|
|
1539
1816
|
] }),
|
|
1540
1817
|
/* @__PURE__ */ e.jsx("div", { className: "mt-0 flex items-center", children: /* @__PURE__ */ e.jsx(
|
|
1541
|
-
|
|
1818
|
+
ke,
|
|
1542
1819
|
{
|
|
1543
|
-
type:
|
|
1544
|
-
units: [...
|
|
1820
|
+
type: l,
|
|
1821
|
+
units: [...a],
|
|
1545
1822
|
label: "",
|
|
1546
1823
|
property: i,
|
|
1547
1824
|
negative: d
|
|
@@ -1550,73 +1827,73 @@ const or = ({ property: r, onChange: o }) => {
|
|
|
1550
1827
|
]
|
|
1551
1828
|
}
|
|
1552
1829
|
);
|
|
1553
|
-
},
|
|
1554
|
-
const t =
|
|
1555
|
-
const
|
|
1556
|
-
i.map((
|
|
1557
|
-
),
|
|
1558
|
-
|
|
1559
|
-
), d =
|
|
1560
|
-
return
|
|
1561
|
-
}, [t,
|
|
1830
|
+
}, Or = ({ heading: r, items: s }) => {
|
|
1831
|
+
const t = ce(), n = T(() => {
|
|
1832
|
+
const l = (i) => z(
|
|
1833
|
+
i.map((o) => o.styleType === "multiple" ? C(o.options, "key") : o.property)
|
|
1834
|
+
), a = z(
|
|
1835
|
+
s.map((i) => i.styleType === "accordion" ? l(i.items) : i.styleType === "multiple" ? C(i.options, "key") : i.property)
|
|
1836
|
+
), d = C(t, "property");
|
|
1837
|
+
return _e(a, d).length > 0;
|
|
1838
|
+
}, [t, s]);
|
|
1562
1839
|
return /* @__PURE__ */ e.jsxs("details", { children: [
|
|
1563
1840
|
/* @__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: [
|
|
1564
1841
|
r,
|
|
1565
|
-
|
|
1842
|
+
n ? /* @__PURE__ */ e.jsx(
|
|
1566
1843
|
"span",
|
|
1567
1844
|
{
|
|
1568
|
-
className: `ml-1 mr-2 inline-block h-[8px] w-[8px] rounded-full ${
|
|
1845
|
+
className: `ml-1 mr-2 inline-block h-[8px] w-[8px] rounded-full ${n ? "bg-blue-500" : "bg-gray-300"}`
|
|
1569
1846
|
}
|
|
1570
1847
|
) : null
|
|
1571
1848
|
] }) }),
|
|
1572
|
-
/* @__PURE__ */ e.jsx("div", { className: "p-2", children:
|
|
1849
|
+
/* @__PURE__ */ e.jsx("div", { className: "p-2", children: s.map((l) => l.styleType === "multiple" ? /* @__PURE__ */ e.jsx(st, { ...l }, l.label) : /* @__PURE__ */ e.jsx(ke, { ...l }, l.label)) })
|
|
1573
1850
|
] });
|
|
1574
|
-
},
|
|
1575
|
-
const
|
|
1576
|
-
(
|
|
1851
|
+
}, Mr = Le({}), ge = ({ section: r }) => {
|
|
1852
|
+
const s = ce(), t = I(
|
|
1853
|
+
(a = []) => {
|
|
1577
1854
|
const d = {};
|
|
1578
|
-
for (let
|
|
1579
|
-
d[o
|
|
1855
|
+
for (let o = 0; o < s.length; o++)
|
|
1856
|
+
d[s[o].property] = s[o].cls;
|
|
1580
1857
|
let i = !0;
|
|
1581
|
-
for (const
|
|
1582
|
-
if (!
|
|
1858
|
+
for (const o in a)
|
|
1859
|
+
if (!ue(d, o) || d[o] !== a[o]) {
|
|
1583
1860
|
i = !1;
|
|
1584
1861
|
break;
|
|
1585
1862
|
}
|
|
1586
1863
|
return i;
|
|
1587
1864
|
},
|
|
1588
|
-
[
|
|
1589
|
-
),
|
|
1590
|
-
if (
|
|
1865
|
+
[s]
|
|
1866
|
+
), n = T(() => {
|
|
1867
|
+
if (s.length > 0 && r.heading === "Classes")
|
|
1591
1868
|
return !0;
|
|
1592
|
-
const
|
|
1593
|
-
|
|
1594
|
-
), d =
|
|
1595
|
-
r.items.map((
|
|
1596
|
-
), i =
|
|
1597
|
-
return
|
|
1598
|
-
}, [
|
|
1599
|
-
return /* @__PURE__ */ e.jsx(
|
|
1600
|
-
/* @__PURE__ */ e.jsx(
|
|
1601
|
-
/* @__PURE__ */ e.jsx("div", { className: `h-[8px] w-[8px] rounded-full ${
|
|
1869
|
+
const a = (o) => z(
|
|
1870
|
+
o.map((p) => p.styleType === "multiple" ? z(C(p.options, "key")) : p.property)
|
|
1871
|
+
), d = z(
|
|
1872
|
+
r.items.map((o) => o.styleType === "accordion" ? a(o.items) : o.styleType === "multiple" ? z(C(o.options, "key")) : o.property)
|
|
1873
|
+
), i = C(s, "property");
|
|
1874
|
+
return _e(d, i).length > 0;
|
|
1875
|
+
}, [s, r.heading, r.items]), l = T(() => ({}), []);
|
|
1876
|
+
return /* @__PURE__ */ e.jsx(Mr.Provider, { value: l, children: /* @__PURE__ */ e.jsxs(ae, { value: r.heading, children: [
|
|
1877
|
+
/* @__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: [
|
|
1878
|
+
/* @__PURE__ */ e.jsx("div", { className: `h-[8px] w-[8px] rounded-full ${n ? "bg-blue-500" : "bg-gray-300"}` }),
|
|
1602
1879
|
r.heading
|
|
1603
1880
|
] }) }),
|
|
1604
|
-
/* @__PURE__ */ e.jsx(
|
|
1605
|
-
r.items.map((
|
|
1881
|
+
/* @__PURE__ */ e.jsx(de, { className: "bg-gray-100 px-3.5 py-2", children: $.Children.toArray(
|
|
1882
|
+
r.items.map((a) => ue(a, "component") ? $.createElement(a.component, { key: a.label }) : ue(a, "styleType") ? a.styleType === "multiple" ? /* @__PURE__ */ e.jsx(st, { ...a }, a.label) : a.styleType === "accordion" && t(a == null ? void 0 : a.conditions) ? /* @__PURE__ */ e.jsx(Or, { ...a }, a.label) : null : /* @__PURE__ */ e.jsx(ke, { ...a }, a.label))
|
|
1606
1883
|
) })
|
|
1607
1884
|
] }) });
|
|
1608
|
-
},
|
|
1885
|
+
}, _r = ({
|
|
1609
1886
|
item: r,
|
|
1610
|
-
index:
|
|
1887
|
+
index: s,
|
|
1611
1888
|
canDelete: t,
|
|
1612
|
-
onChange:
|
|
1613
|
-
onRemove:
|
|
1889
|
+
onChange: n,
|
|
1890
|
+
onRemove: l
|
|
1614
1891
|
}) => /* @__PURE__ */ e.jsxs("div", { className: `flex flex-col gap-1 border-gray-400 py-2 ${t ? "border-b" : ""}`, children: [
|
|
1615
1892
|
/* @__PURE__ */ e.jsx(
|
|
1616
1893
|
"input",
|
|
1617
1894
|
{
|
|
1618
1895
|
name: "key",
|
|
1619
|
-
onChange: (
|
|
1896
|
+
onChange: (a) => n(a, s),
|
|
1620
1897
|
value: r.key,
|
|
1621
1898
|
placeholder: "Key",
|
|
1622
1899
|
className: "w-full rounded border-gray-300 bg-background p-0.5 pl-2 text-sm focus-visible:outline-0",
|
|
@@ -1629,7 +1906,7 @@ const or = ({ property: r, onChange: o }) => {
|
|
|
1629
1906
|
"input",
|
|
1630
1907
|
{
|
|
1631
1908
|
name: "value",
|
|
1632
|
-
onChange: (
|
|
1909
|
+
onChange: (a) => b(r.key) ? {} : n(a, s),
|
|
1633
1910
|
value: r.value,
|
|
1634
1911
|
placeholder: "Value",
|
|
1635
1912
|
className: "w-full rounded border-gray-300 bg-background p-0.5 pl-2 text-sm focus-visible:outline-0",
|
|
@@ -1638,76 +1915,76 @@ const or = ({ property: r, onChange: o }) => {
|
|
|
1638
1915
|
}
|
|
1639
1916
|
),
|
|
1640
1917
|
/* @__PURE__ */ e.jsx(
|
|
1641
|
-
|
|
1918
|
+
Ye,
|
|
1642
1919
|
{
|
|
1643
|
-
onClick:
|
|
1920
|
+
onClick: l,
|
|
1644
1921
|
className: "h-6 w-6 cursor-pointer rounded border border-red-400 p-1 text-red-400 hover:opacity-80"
|
|
1645
1922
|
}
|
|
1646
1923
|
)
|
|
1647
1924
|
] })
|
|
1648
|
-
] }),
|
|
1925
|
+
] }), Er = ({ section: r }) => {
|
|
1649
1926
|
var m;
|
|
1650
|
-
const { setSyncState:
|
|
1651
|
-
|
|
1652
|
-
const
|
|
1653
|
-
|
|
1654
|
-
}, [
|
|
1655
|
-
const
|
|
1656
|
-
const y =
|
|
1657
|
-
|
|
1658
|
-
},
|
|
1659
|
-
const
|
|
1660
|
-
|
|
1661
|
-
},
|
|
1662
|
-
(
|
|
1927
|
+
const { setSyncState: s } = Xt(), t = te(), [n, l] = k([]), [a] = je(), d = ze(), i = `${g(a, "0.prop")}_attrs`;
|
|
1928
|
+
se.useEffect(() => {
|
|
1929
|
+
const x = C(g(t, i), (y, v) => ({ key: v, value: y }));
|
|
1930
|
+
b(x) ? l([]) : l(x);
|
|
1931
|
+
}, [g(t, i)]);
|
|
1932
|
+
const o = () => l([...n, { key: "", value: "" }]), p = (x) => {
|
|
1933
|
+
const y = Oe(n, (v, L) => x !== L);
|
|
1934
|
+
c(y);
|
|
1935
|
+
}, u = (x, y) => {
|
|
1936
|
+
const v = [...n];
|
|
1937
|
+
v[y][x.target.name] = x.target.value, c(v);
|
|
1938
|
+
}, c = se.useCallback(
|
|
1939
|
+
(x = []) => {
|
|
1663
1940
|
const y = {};
|
|
1664
|
-
|
|
1665
|
-
|
|
1666
|
-
}), d([
|
|
1941
|
+
fe(x, (v) => {
|
|
1942
|
+
b(v.key) || Pe(y, v.key, v.value);
|
|
1943
|
+
}), d([g(t, "_id")], { [i]: y }), s("UNSAVED");
|
|
1667
1944
|
},
|
|
1668
|
-
[t,
|
|
1945
|
+
[t, s, d, i]
|
|
1669
1946
|
);
|
|
1670
|
-
return /* @__PURE__ */ e.jsxs(
|
|
1671
|
-
/* @__PURE__ */ e.jsx(
|
|
1947
|
+
return /* @__PURE__ */ e.jsxs(ae, { value: r.heading, children: [
|
|
1948
|
+
/* @__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: [
|
|
1672
1949
|
/* @__PURE__ */ e.jsx(
|
|
1673
1950
|
"div",
|
|
1674
1951
|
{
|
|
1675
|
-
className: `h-[8px] w-[8px] rounded-full ${
|
|
1952
|
+
className: `h-[8px] w-[8px] rounded-full ${b(g(t, i)) ? "bg-gray-300" : "bg-blue-500"}`
|
|
1676
1953
|
}
|
|
1677
1954
|
),
|
|
1678
1955
|
"Attributes"
|
|
1679
1956
|
] }) }),
|
|
1680
|
-
/* @__PURE__ */ e.jsx(
|
|
1681
|
-
/* @__PURE__ */ e.jsxs(
|
|
1957
|
+
/* @__PURE__ */ e.jsx(de, { className: "bg-gray-100 px-3.5 py-2", children: /* @__PURE__ */ e.jsxs("div", { className: "no-scrollbar flex min-h-max flex-col gap-y-2 overflow-y-auto bg-gray-100 p-px", children: [
|
|
1958
|
+
/* @__PURE__ */ e.jsxs(Ce, { className: "mt-2 flex w-full items-center justify-between", children: [
|
|
1682
1959
|
"Add Custom attributes",
|
|
1683
1960
|
/* @__PURE__ */ e.jsxs(
|
|
1684
1961
|
"div",
|
|
1685
1962
|
{
|
|
1686
|
-
className: `flex h-6 w-max items-center justify-center gap-x-0.5 rounded-full border p-1 px-2 text-xs ${!
|
|
1963
|
+
className: `flex h-6 w-max items-center justify-center gap-x-0.5 rounded-full border p-1 px-2 text-xs ${!b(n) && b((m = he(n)) == null ? void 0 : m.key) ? "cursor-not-allowed border-gray-400 text-gray-400" : "cursor-pointer border-blue-400 text-blue-400 hover:bg-blue-400 hover:text-white"}`,
|
|
1687
1964
|
onClick: () => {
|
|
1688
|
-
var
|
|
1689
|
-
!
|
|
1965
|
+
var x;
|
|
1966
|
+
!b(n) && b((x = he(n)) == null ? void 0 : x.key) || o();
|
|
1690
1967
|
},
|
|
1691
1968
|
children: [
|
|
1692
|
-
/* @__PURE__ */ e.jsx(
|
|
1969
|
+
/* @__PURE__ */ e.jsx(ve, { width: 12, height: 12 }),
|
|
1693
1970
|
" Add"
|
|
1694
1971
|
]
|
|
1695
1972
|
}
|
|
1696
1973
|
)
|
|
1697
1974
|
] }),
|
|
1698
1975
|
/* @__PURE__ */ e.jsxs("div", { className: "flex flex-col", children: [
|
|
1699
|
-
|
|
1700
|
-
|
|
1701
|
-
|
|
1702
|
-
const
|
|
1976
|
+
b(n) && /* @__PURE__ */ e.jsx("div", { className: "flex h-12 items-center justify-center text-sm text-gray-400", children: "Click + Add to add attributes" }),
|
|
1977
|
+
se.Children.toArray(
|
|
1978
|
+
C(n, (x, y) => {
|
|
1979
|
+
const v = n.length > 0 && y < n.length - 1;
|
|
1703
1980
|
return /* @__PURE__ */ e.jsx(
|
|
1704
|
-
|
|
1981
|
+
_r,
|
|
1705
1982
|
{
|
|
1706
|
-
item:
|
|
1983
|
+
item: x,
|
|
1707
1984
|
index: y,
|
|
1708
|
-
canDelete:
|
|
1709
|
-
onChange:
|
|
1710
|
-
onRemove: () =>
|
|
1985
|
+
canDelete: v,
|
|
1986
|
+
onChange: u,
|
|
1987
|
+
onRemove: () => p(y)
|
|
1711
1988
|
}
|
|
1712
1989
|
);
|
|
1713
1990
|
})
|
|
@@ -1716,11 +1993,11 @@ const or = ({ property: r, onChange: o }) => {
|
|
|
1716
1993
|
] }) })
|
|
1717
1994
|
] });
|
|
1718
1995
|
};
|
|
1719
|
-
function
|
|
1720
|
-
const [r,
|
|
1721
|
-
return
|
|
1722
|
-
/* @__PURE__ */ e.jsx(
|
|
1723
|
-
/* @__PURE__ */ e.jsx("h1", { children:
|
|
1996
|
+
function Fr() {
|
|
1997
|
+
const [r, s] = qe(), { flexChild: t, gridChild: n } = Yt(), [, l] = tr(Wt), { t: a } = Ee(), [d] = je();
|
|
1998
|
+
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: [
|
|
1999
|
+
/* @__PURE__ */ e.jsx(We, { className: "mx-auto text-3xl" }),
|
|
2000
|
+
/* @__PURE__ */ e.jsx("h1", { children: a("no_styling_block_selected") }),
|
|
1724
2001
|
/* @__PURE__ */ e.jsxs("p", { className: "text-xs ", children: [
|
|
1725
2002
|
"Hint: Styling allowed blocks are highlighted with",
|
|
1726
2003
|
" ",
|
|
@@ -1729,40 +2006,40 @@ function Cr() {
|
|
|
1729
2006
|
] })
|
|
1730
2007
|
] }) }) : (
|
|
1731
2008
|
// eslint-disable-next-line jsx-a11y/click-events-have-key-events,jsx-a11y/no-static-element-interactions
|
|
1732
|
-
/* @__PURE__ */ e.jsxs("div", { onClick: () =>
|
|
2009
|
+
/* @__PURE__ */ e.jsxs("div", { onClick: () => l(!1), className: "flex h-full flex-col", children: [
|
|
1733
2010
|
/* @__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: [
|
|
1734
|
-
/* @__PURE__ */ e.jsx(
|
|
1735
|
-
/* @__PURE__ */ e.jsxs(
|
|
1736
|
-
/* @__PURE__ */ e.jsx(
|
|
1737
|
-
/* @__PURE__ */ e.jsxs(
|
|
1738
|
-
/* @__PURE__ */ e.jsx(
|
|
1739
|
-
/* @__PURE__ */ e.jsx(
|
|
1740
|
-
/* @__PURE__ */ e.jsx(
|
|
1741
|
-
/* @__PURE__ */ e.jsx(
|
|
1742
|
-
/* @__PURE__ */ e.jsx(
|
|
1743
|
-
/* @__PURE__ */ e.jsx(
|
|
1744
|
-
/* @__PURE__ */ e.jsx(
|
|
1745
|
-
/* @__PURE__ */ e.jsx(
|
|
1746
|
-
/* @__PURE__ */ e.jsx(
|
|
1747
|
-
/* @__PURE__ */ e.jsx(
|
|
1748
|
-
/* @__PURE__ */ e.jsx(
|
|
1749
|
-
/* @__PURE__ */ e.jsx(
|
|
2011
|
+
/* @__PURE__ */ e.jsx(Ce, { htmlFor: "", className: "flex gap-x-1.5 text-xs italic", children: "State" }),
|
|
2012
|
+
/* @__PURE__ */ e.jsxs(ir, { defaultValue: r, onValueChange: (i) => s(i), children: [
|
|
2013
|
+
/* @__PURE__ */ e.jsx(dr, { className: "h-auto w-fit p-1 px-3", children: /* @__PURE__ */ e.jsx(cr, { placeholder: "State" }) }),
|
|
2014
|
+
/* @__PURE__ */ e.jsxs(pr, { children: [
|
|
2015
|
+
/* @__PURE__ */ e.jsx(A, { value: "", children: "Normal" }),
|
|
2016
|
+
/* @__PURE__ */ e.jsx(A, { value: "hover", children: "Hover" }),
|
|
2017
|
+
/* @__PURE__ */ e.jsx(A, { value: "active", children: "Active" }),
|
|
2018
|
+
/* @__PURE__ */ e.jsx(A, { value: "focus", children: "Focus" }),
|
|
2019
|
+
/* @__PURE__ */ e.jsx(A, { value: "before", children: "Before" }),
|
|
2020
|
+
/* @__PURE__ */ e.jsx(A, { value: "after", children: "After" }),
|
|
2021
|
+
/* @__PURE__ */ e.jsx(A, { value: "only", children: "Only" }),
|
|
2022
|
+
/* @__PURE__ */ e.jsx(A, { value: "first", children: "First" }),
|
|
2023
|
+
/* @__PURE__ */ e.jsx(A, { value: "last", children: "Last" }),
|
|
2024
|
+
/* @__PURE__ */ e.jsx(A, { value: "first-letter", children: "First Letter" }),
|
|
2025
|
+
/* @__PURE__ */ e.jsx(A, { value: "first-line", children: "First Line" }),
|
|
2026
|
+
/* @__PURE__ */ e.jsx(A, { value: "disabled", children: "Disabled" })
|
|
1750
2027
|
] })
|
|
1751
2028
|
] })
|
|
1752
2029
|
] }) }),
|
|
1753
|
-
/* @__PURE__ */ e.jsxs(
|
|
1754
|
-
/* @__PURE__ */ e.jsxs(
|
|
1755
|
-
t && /* @__PURE__ */ e.jsx(
|
|
1756
|
-
|
|
1757
|
-
|
|
1758
|
-
/* @__PURE__ */ e.jsx(
|
|
2030
|
+
/* @__PURE__ */ e.jsxs(ar, { className: "no-scrollbar -mx-1 h-full overflow-x-hidden", children: [
|
|
2031
|
+
/* @__PURE__ */ e.jsxs(tt, { type: "multiple", className: "h-full w-full", children: [
|
|
2032
|
+
t && /* @__PURE__ */ e.jsx(ge, { section: vr }),
|
|
2033
|
+
n ? /* @__PURE__ */ e.jsx(ge, { section: wr }) : null,
|
|
2034
|
+
jr.map((i) => /* @__PURE__ */ e.jsx(ge, { section: i }, i.heading)),
|
|
2035
|
+
/* @__PURE__ */ e.jsx(Er, { section: { heading: "Attributes" } })
|
|
1759
2036
|
] }),
|
|
1760
2037
|
/* @__PURE__ */ e.jsx("div", { className: "h-60" })
|
|
1761
2038
|
] })
|
|
1762
2039
|
] })
|
|
1763
2040
|
);
|
|
1764
2041
|
}
|
|
1765
|
-
const
|
|
2042
|
+
const Xr = {
|
|
1766
2043
|
px: 1,
|
|
1767
2044
|
"%": 1,
|
|
1768
2045
|
em: 100,
|
|
@@ -1773,32 +2050,32 @@ const jr = {
|
|
|
1773
2050
|
"-": 1,
|
|
1774
2051
|
deg: 1,
|
|
1775
2052
|
ms: 0.1
|
|
1776
|
-
},
|
|
1777
|
-
const r =
|
|
1778
|
-
onDrag: (
|
|
1779
|
-
onDragEnd: (
|
|
2053
|
+
}, Yl = () => {
|
|
2054
|
+
const r = te(), { t: s } = Ee(), [t, n] = $.useState(""), [l, a] = $.useState({
|
|
2055
|
+
onDrag: (o) => o,
|
|
2056
|
+
onDragEnd: (o) => o,
|
|
1780
2057
|
dragStartY: 0,
|
|
1781
2058
|
dragging: !1,
|
|
1782
2059
|
dragStartValue: 0,
|
|
1783
2060
|
dragUnit: "",
|
|
1784
2061
|
negative: !1,
|
|
1785
2062
|
cssProperty: ""
|
|
1786
|
-
}), d =
|
|
1787
|
-
(
|
|
1788
|
-
const
|
|
1789
|
-
let
|
|
1790
|
-
|
|
1791
|
-
let m =
|
|
1792
|
-
(
|
|
1793
|
-
let y = (
|
|
1794
|
-
|
|
2063
|
+
}), d = xe(
|
|
2064
|
+
(o) => {
|
|
2065
|
+
const p = !g(l, "negative", !1), u = g(l, "cssProperty", "");
|
|
2066
|
+
let c = parseFloat(l.dragStartValue);
|
|
2067
|
+
c = Me(c) ? 0 : c;
|
|
2068
|
+
let m = Xr[l.dragUnit];
|
|
2069
|
+
(Z(u, "scale") || u === "opacity") && (m = 10);
|
|
2070
|
+
let y = (l.dragStartY - o.pageY) / m + c;
|
|
2071
|
+
p && y < 0 && (y = 0), u === "opacity" && y > 1 && (y = 1), l.onDrag(`${y}`), n(`${y}`);
|
|
1795
2072
|
},
|
|
1796
|
-
[
|
|
2073
|
+
[l],
|
|
1797
2074
|
50
|
|
1798
2075
|
), i = I(() => {
|
|
1799
|
-
setTimeout(() =>
|
|
1800
|
-
onDrag: (
|
|
1801
|
-
onDragEnd: (
|
|
2076
|
+
setTimeout(() => l.onDragEnd(`${t}`), 100), a({
|
|
2077
|
+
onDrag: (o) => o,
|
|
2078
|
+
onDragEnd: (o) => o,
|
|
1802
2079
|
dragStartY: 0,
|
|
1803
2080
|
dragging: !1,
|
|
1804
2081
|
dragStartValue: 0,
|
|
@@ -1806,44 +2083,36 @@ const jr = {
|
|
|
1806
2083
|
negative: !1,
|
|
1807
2084
|
cssProperty: ""
|
|
1808
2085
|
});
|
|
1809
|
-
}, [
|
|
1810
|
-
return
|
|
1811
|
-
/* @__PURE__ */ e.jsx(
|
|
1812
|
-
/* @__PURE__ */ e.jsx("h1", { children:
|
|
1813
|
-
] }) }) : (
|
|
1814
|
-
|
|
1815
|
-
|
|
1816
|
-
|
|
1817
|
-
|
|
1818
|
-
|
|
1819
|
-
|
|
1820
|
-
|
|
1821
|
-
|
|
1822
|
-
|
|
1823
|
-
|
|
1824
|
-
|
|
1825
|
-
|
|
1826
|
-
|
|
1827
|
-
|
|
1828
|
-
|
|
1829
|
-
|
|
1830
|
-
|
|
1831
|
-
|
|
1832
|
-
/* @__PURE__ */ e.jsx(
|
|
1833
|
-
|
|
1834
|
-
|
|
1835
|
-
|
|
1836
|
-
{
|
|
1837
|
-
value: "settings",
|
|
1838
|
-
className: "no-scrollbar -mx-1 -mr-2 h-full flex-1 overflow-y-auto overflow-x-hidden",
|
|
1839
|
-
children: /* @__PURE__ */ e.jsx(Jt, {})
|
|
1840
|
-
}
|
|
1841
|
-
),
|
|
1842
|
-
/* @__PURE__ */ e.jsx(ve, { value: "styling", className: "flex-1 overflow-y-auto overflow-x-hidden", children: /* @__PURE__ */ e.jsx(Cr, {}) })
|
|
1843
|
-
] })
|
|
2086
|
+
}, [l, t, a]);
|
|
2087
|
+
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: [
|
|
2088
|
+
/* @__PURE__ */ e.jsx(We, { className: "mx-auto text-3xl" }),
|
|
2089
|
+
/* @__PURE__ */ e.jsx("h1", { children: s("no_block_selected_for_styling") })
|
|
2090
|
+
] }) }) : /* @__PURE__ */ e.jsxs(ot.Provider, { value: { setDragData: a }, children: [
|
|
2091
|
+
l.dragging ? /* @__PURE__ */ e.jsx(
|
|
2092
|
+
"div",
|
|
2093
|
+
{
|
|
2094
|
+
onMouseMove: d,
|
|
2095
|
+
onMouseUp: () => i(),
|
|
2096
|
+
className: "absolute inset-0 z-30 cursor-row-resize bg-gray-300/10 "
|
|
2097
|
+
}
|
|
2098
|
+
) : null,
|
|
2099
|
+
/* @__PURE__ */ e.jsxs(It, { defaultValue: "settings", className: "flex h-full w-full flex-col py-1", children: [
|
|
2100
|
+
/* @__PURE__ */ e.jsxs(Lt, { className: "mx-1 grid grid-cols-2", children: [
|
|
2101
|
+
/* @__PURE__ */ e.jsx(Re, { value: "settings", children: "Settings" }),
|
|
2102
|
+
/* @__PURE__ */ e.jsx(Re, { value: "styling", children: "Styling" })
|
|
2103
|
+
] }),
|
|
2104
|
+
/* @__PURE__ */ e.jsx(
|
|
2105
|
+
Ve,
|
|
2106
|
+
{
|
|
2107
|
+
value: "settings",
|
|
2108
|
+
className: "no-scrollbar -mx-1 -mr-2 h-full flex-1 overflow-y-auto overflow-x-hidden",
|
|
2109
|
+
children: /* @__PURE__ */ e.jsx(fr, {})
|
|
2110
|
+
}
|
|
2111
|
+
),
|
|
2112
|
+
/* @__PURE__ */ e.jsx(Ve, { value: "styling", className: "flex-1 overflow-y-auto overflow-x-hidden", children: /* @__PURE__ */ e.jsx(Fr, {}) })
|
|
1844
2113
|
] })
|
|
1845
|
-
);
|
|
2114
|
+
] });
|
|
1846
2115
|
};
|
|
1847
2116
|
export {
|
|
1848
|
-
|
|
2117
|
+
Yl as default
|
|
1849
2118
|
};
|