@chaibuilder/sdk 1.2.28 → 1.2.30
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-YJPdSqcY.cjs → AddBlocks-UxJOFB9M.cjs} +1 -1
- package/dist/{AddBlocks-0sW6gkCO.js → AddBlocks-u1FkSHNj.js} +19 -19
- package/dist/{BrandingOptions--vgnQvD1.js → BrandingOptions-A3_c_sd7.js} +1 -1
- package/dist/{CanvasArea-aii0PyU-.js → CanvasArea-3D9rpjpk.js} +3 -3
- package/dist/{CanvasArea-41QoxuLf.cjs → CanvasArea-e829y1ts.cjs} +1 -1
- package/dist/{CurrentPage-2W1pdAOG.cjs → CurrentPage-5xKDQqvg.cjs} +1 -1
- package/dist/{CurrentPage-06Iacwyp.js → CurrentPage-VbdmddMv.js} +4 -4
- package/dist/{ListTree-DnA8gj-7.js → ListTree-c9Z0kWbN.js} +1 -1
- package/dist/{PagesPanel-_1CDTUdE.js → PagesPanel-_VzJ1__k.js} +5 -5
- package/dist/{PagesPanel-PBFzPSNY.cjs → PagesPanel-wex1zGzm.cjs} +1 -1
- package/dist/{ProjectPanel-755bbzEQ.cjs → ProjectPanel-N6iWd_4Z.cjs} +1 -1
- package/dist/{ProjectPanel-pUMeIiUW.js → ProjectPanel-rPNO2QsE.js} +5 -5
- package/dist/{Settings-dnO-s6x0.js → Settings-jTl7IOPc.js} +560 -532
- package/dist/Settings-mlh0i_1M.cjs +1 -0
- package/dist/{SidePanels-VxSXXkt_.js → SidePanels-jYJEFpxC.js} +3 -3
- package/dist/{SidePanels-Gq2LdVuY.cjs → SidePanels-mx5TyZBn.cjs} +1 -1
- package/dist/{Topbar-5zbOSGF6.js → Topbar-VCFW9uNI.js} +1 -1
- package/dist/{UnsplashImages-4WAWgA4s.js → UnsplashImages-N9h0avWO.js} +1 -1
- package/dist/{UploadImages-PONIHtn6.js → UploadImages-e70AeNGX.js} +1 -1
- package/dist/{add-page-modal-4VrFvgEm.js → add-page-modal-o1euqbsp.js} +5 -5
- package/dist/{add-page-modal-jWcp0w-S.cjs → add-page-modal-v5smARyL.cjs} +1 -1
- package/dist/{confirm-alert-j7b88hsW.js → confirm-alert-EDOFRmH8.js} +1 -1
- package/dist/core.cjs +1 -1
- package/dist/core.js +2 -2
- package/dist/{delete-page-modal-p6b0upz4.cjs → delete-page-modal-DNjqQuop.cjs} +1 -1
- package/dist/{delete-page-modal--xHHdRAq.js → delete-page-modal-QzRkBAct.js} +4 -4
- package/dist/email.cjs +1 -1
- package/dist/email.js +2 -2
- package/dist/{form-_GJb9YcB.js → form-yw3Uuk6v.js} +1 -1
- package/dist/html-to-json-Xhu27KFD.cjs +1 -0
- package/dist/{html-to-json-LJyJsnmZ.js → html-to-json-ZV4QjSww.js} +53 -52
- package/dist/{index-KArv7pNz.cjs → index-5c_rU-9B.cjs} +1 -1
- package/dist/{index-mlMvwv2b.cjs → index-DHwvjZ5z.cjs} +1 -1
- package/dist/{index-Eb5zyh2F.js → index-DtBYhldP.js} +4 -4
- package/dist/{index-UHaqEdws.js → index-HiiWSXkE.js} +9 -9
- package/dist/{index-0QJwevON.js → index-SEJRE2ab.js} +2 -2
- package/dist/lib.cjs +1 -1
- package/dist/lib.js +1 -1
- package/dist/{page-viewer-00Xx4u8e.js → page-viewer-1vswRGpL.js} +5 -5
- package/dist/{page-viewer-SZNm7b1n.cjs → page-viewer-87wtE0pN.cjs} +1 -1
- package/dist/{project-general-setting-C_pHNuZE.cjs → project-general-setting-RSG7ZQSx.cjs} +1 -1
- package/dist/{project-general-setting-asDxlmhZ.js → project-general-setting-SE9QJ6mF.js} +5 -5
- package/dist/{project-seo-setting-DuAaDfDR.js → project-seo-setting-x3peNgla.js} +2 -2
- package/dist/{single-page-detail-oqj6zsLU.cjs → single-page-detail-8Arndzmw.cjs} +1 -1
- package/dist/{single-page-detail-UNxXvhl4.js → single-page-detail-bels-Cjo.js} +12 -12
- package/dist/studio.cjs +1 -1
- package/dist/studio.js +4 -4
- package/dist/ui.js +7 -7
- package/dist/{useCanvasSettings-R6br4J9i.js → useCanvasSettings-unTQUdlP.js} +1 -1
- package/dist/web-blocks.cjs +4 -4
- package/dist/web-blocks.js +232 -219
- package/package.json +1 -1
- package/dist/Settings-G9Xtqr7n.cjs +0 -1
- package/dist/html-to-json-vP1ESB_e.cjs +0 -1
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
import { j as e } from "./jsx-runtime-WbnYoNE9.js";
|
|
2
2
|
import * as de from "react";
|
|
3
|
-
import
|
|
4
|
-
import { useThrottledCallback as
|
|
5
|
-
import { forEach as Re, isArray as
|
|
6
|
-
import { useTranslation as
|
|
7
|
-
import { PlusIcon as Ve, Cross2Icon as et, EyeOpenIcon as
|
|
8
|
-
import { aW as
|
|
9
|
-
import { u as
|
|
10
|
-
import { Check as
|
|
11
|
-
import { getBlockComponent as Pe, getChaiDataProviders as
|
|
12
|
-
import { E as
|
|
13
|
-
import { J as
|
|
14
|
-
import
|
|
15
|
-
import
|
|
16
|
-
import { u as
|
|
17
|
-
import
|
|
18
|
-
import
|
|
19
|
-
import { A as
|
|
20
|
-
import { a as
|
|
3
|
+
import I, { useState as w, useMemo as S, useEffect as z, useCallback as H, memo as ft, createContext as Ke, useContext as ae } from "react";
|
|
4
|
+
import { useThrottledCallback as ue } from "@react-hookz/web";
|
|
5
|
+
import { forEach as Re, isArray as xe, omit as vt, truncate as jt, includes as F, get as g, first as oe, split as wt, startCase as Y, toLower as le, isEmpty as b, map as C, find as Ge, last as Ct, filter as ve, set as qe, debounce as kt, keys as je, cloneDeep as Nt, each as _t, capitalize as we, reject as St, nth as $e, startsWith as W, isNumber as Tt, parseInt as Rt, isNaN as Je, findLast as Vt, flatten as J, intersection as Qe, has as ce, kebabCase as Ht, isNull as Dt } from "lodash-es";
|
|
6
|
+
import { useTranslation as X } from "react-i18next";
|
|
7
|
+
import { CopyIcon as Bt, PlusIcon as Ve, Cross2Icon as et, EyeOpenIcon as Pt, EyeClosedIcon as Ae, BorderAllIcon as O, WidthIcon as T, HeightIcon as R, ArrowUpIcon as ee, ArrowRightIcon as te, ArrowDownIcon as re, ArrowLeftIcon as se, ArrowTopLeftIcon as It, ArrowTopRightIcon as $t, ArrowBottomRightIcon as At, ArrowBottomLeftIcon as Mt, AlignLeftIcon as Et, AlignCenterHorizontallyIcon as Lt, AlignRightIcon as Ot, StretchHorizontallyIcon as Ft, FontItalicIcon as Yt, UnderlineIcon as zt, OverlineIcon as Xt, LetterCaseUppercaseIcon as Zt, Cross1Icon as Wt, InfoCircledIcon as He, MinusIcon as Ut, BoxIcon as tt, RowSpacingIcon as Kt, TriangleDownIcon as Gt, CrossCircledIcon as qt, CaretDownIcon as Jt, MixerHorizontalIcon as rt } from "@radix-ui/react-icons";
|
|
8
|
+
import { aW as Qt, aX as er, B as G, aY as tr, aZ as rr, a_ as sr, a$ as lr, b0 as ar, b1 as or, b2 as nr, a1 as q, af as ir, ag as dr, ah as cr, b3 as pr, ad as ur, ao as xr, ae as gr, ap as $, aq as A, ar as M, b4 as hr, b5 as yr, b6 as mr, b7 as br, b8 as fr, b9 as vr, ba as jr, a6 as st, a5 as lt, h as wr, bb as at, bc as Ce, bd as ke, be as Ne, ac as ge, M as De, _ as ot, r as nt, bf as it, aB as dt, bg as _e, v as Cr, bh as kr, $ as he, V as Nr, a4 as ct, N as Me, aG as _r, aH as Sr, aI as Tr, bi as Be, aJ as Ee, aK as Le, bj as Oe, bk as Fe, bl as Ye, a7 as Rr, bm as Vr, aj as Hr, ak as Dr, al as Br, am as Pr, an as V, au as Ir, av as $r, aw as me, ax as be } from "./index-HiiWSXkE.js";
|
|
9
|
+
import { u as Ar } from "./controls-OfJWSEqC.js";
|
|
10
|
+
import { Check as Mr, EditIcon as Er, TrashIcon as Lr, BrushIcon as Or, DeleteIcon as Fr } from "lucide-react";
|
|
11
|
+
import { getBlockComponent as Pe, getChaiDataProviders as Yr, useGlobalStylingPresets as zr } from "@chaibuilder/runtime";
|
|
12
|
+
import { E as pt, u as ut } from "./index-SEJRE2ab.js";
|
|
13
|
+
import { J as Xr, a as Zr, d as Wr } from "./index-e0c8PmRQ.js";
|
|
14
|
+
import Ur from "@rjsf/core";
|
|
15
|
+
import Kr from "@rjsf/validator-ajv8";
|
|
16
|
+
import { u as Gr } from "./useCanvasSettings-unTQUdlP.js";
|
|
17
|
+
import qr from "react-autosuggest";
|
|
18
|
+
import Jr from "fuse.js";
|
|
19
|
+
import { A as Qr, C as ye, g as es } from "./Class-6Hz2KzYb.js";
|
|
20
|
+
import { a as ts } from "./STRINGS--j49GZJP.js";
|
|
21
21
|
import "./_commonjsHelpers-UyOWmZb0.js";
|
|
22
22
|
import "./Functions-7jnEwJyw.js";
|
|
23
23
|
import "clsx";
|
|
@@ -51,15 +51,15 @@ import "i18next";
|
|
|
51
51
|
import "@floating-ui/react-dom";
|
|
52
52
|
import "flagged";
|
|
53
53
|
import "react-hotkeys-hook";
|
|
54
|
-
function
|
|
54
|
+
function rs(r) {
|
|
55
55
|
const l = [], t = {};
|
|
56
|
-
function
|
|
57
|
-
Re(
|
|
58
|
-
const o = s ? `${s}.${d}` : d, c =
|
|
59
|
-
l.push(o), t[o] = c === "string" ? "text" : c === "object" ? "model" : c, c === "object" && !
|
|
56
|
+
function n(s, i) {
|
|
57
|
+
Re(i, (a, d) => {
|
|
58
|
+
const o = s ? `${s}.${d}` : d, c = xe(a) ? "list" : typeof a;
|
|
59
|
+
l.push(o), t[o] = c === "string" ? "text" : c === "object" ? "model" : c, c === "object" && !xe(a) && n(o, a);
|
|
60
60
|
});
|
|
61
61
|
}
|
|
62
|
-
return
|
|
62
|
+
return n("", vt(r, ["styles", "_type", "_id", "_name", "_bindings"])), { paths: l, pathsType: t };
|
|
63
63
|
}
|
|
64
64
|
const Se = ({ data: r, fullView: l }) => {
|
|
65
65
|
if (!r)
|
|
@@ -67,13 +67,13 @@ const Se = ({ data: r, fullView: l }) => {
|
|
|
67
67
|
const t = typeof r;
|
|
68
68
|
return l ? typeof r == "object" ? /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
69
69
|
/* @__PURE__ */ e.jsx("div", { className: "h-3" }),
|
|
70
|
-
/* @__PURE__ */ e.jsx(
|
|
71
|
-
|
|
70
|
+
/* @__PURE__ */ e.jsx(pt, { children: /* @__PURE__ */ e.jsx(
|
|
71
|
+
Xr,
|
|
72
72
|
{
|
|
73
73
|
data: r,
|
|
74
|
-
shouldExpandNode:
|
|
74
|
+
shouldExpandNode: Zr,
|
|
75
75
|
style: {
|
|
76
|
-
...
|
|
76
|
+
...Wr,
|
|
77
77
|
container: "max-h-[40vh] overflow-y-auto text-[12px] leading-[1.5] tracking-wide font-mono",
|
|
78
78
|
stringValue: "text-orange-600",
|
|
79
79
|
label: "text-green-900 font-semibold pr-1 tracking-wider"
|
|
@@ -83,95 +83,95 @@ const Se = ({ data: r, fullView: l }) => {
|
|
|
83
83
|
] }) : /* @__PURE__ */ e.jsxs("div", { className: "max-h-36 w-full overflow-y-auto overflow-x-hidden text-[12px] leading-4 text-gray-800/50", children: [
|
|
84
84
|
/* @__PURE__ */ e.jsx("span", { className: "font-medium text-gray-800/80", children: "Content: " }),
|
|
85
85
|
r
|
|
86
|
-
] }) : /* @__PURE__ */ e.jsx("div", { className: "w-full overflow-hidden whitespace-nowrap text-[10px] leading-3 text-gray-800/50", children:
|
|
86
|
+
] }) : /* @__PURE__ */ e.jsx("div", { className: "w-full overflow-hidden whitespace-nowrap text-[10px] leading-3 text-gray-800/50", children: jt(t === "object" ? JSON.stringify(r) : r, { length: 40 }) });
|
|
87
87
|
}, ze = ({
|
|
88
88
|
type: r,
|
|
89
89
|
value: l = "",
|
|
90
90
|
setValue: t,
|
|
91
|
-
data:
|
|
91
|
+
data: n,
|
|
92
92
|
onChange: s,
|
|
93
|
-
dataType:
|
|
93
|
+
dataType: i,
|
|
94
94
|
appliedBindings: a
|
|
95
95
|
}) => {
|
|
96
|
-
const { paths: d, pathsType: o } =
|
|
97
|
-
(
|
|
98
|
-
) : d.filter((
|
|
99
|
-
return
|
|
96
|
+
const { paths: d, pathsType: o } = rs(n), c = r === "PROP" ? Pe(n == null ? void 0 : n._type) : {}, h = r === "PROP", [p, u] = w(!1), y = S(() => r === "PROP" ? d.filter(
|
|
97
|
+
(x) => !F(a, x) && g(c, `props.${oe(wt(x, "."))}.binding`)
|
|
98
|
+
) : d.filter((x) => i === g(o, x, "")), [r, d, a, i, c]);
|
|
99
|
+
return z(() => {
|
|
100
100
|
l && s(l);
|
|
101
101
|
}, [l, r]), /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
102
102
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-4", children: [
|
|
103
|
-
/* @__PURE__ */ e.jsx("p", { className: "text-sm text-muted-foreground", children:
|
|
104
|
-
/* @__PURE__ */ e.jsxs(
|
|
105
|
-
/* @__PURE__ */ e.jsx(
|
|
106
|
-
|
|
103
|
+
/* @__PURE__ */ e.jsx("p", { className: "text-sm text-muted-foreground", children: Y(le(r)) }),
|
|
104
|
+
/* @__PURE__ */ e.jsxs(Qt, { open: p, onOpenChange: u, children: [
|
|
105
|
+
/* @__PURE__ */ e.jsx(er, { asChild: !0, children: /* @__PURE__ */ e.jsx(
|
|
106
|
+
G,
|
|
107
107
|
{
|
|
108
108
|
variant: "outline",
|
|
109
109
|
size: "sm",
|
|
110
110
|
className: ` ${b(l) ? "w-44 justify-center bg-blue-500 text-gray-100 hover:bg-blue-400 hover:text-white" : "min-w-[350px] items-center justify-between"}`,
|
|
111
111
|
children: l ? /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
112
112
|
/* @__PURE__ */ e.jsxs("span", { className: "pr-8 text-sm", children: [
|
|
113
|
-
h && /* @__PURE__ */ e.jsx("span", { className: "mr-2 rounded-full bg-purple-100 px-2 py-0.5 text-[10px] text-purple-500", children:
|
|
113
|
+
h && /* @__PURE__ */ e.jsx("span", { className: "mr-2 rounded-full bg-purple-100 px-2 py-0.5 text-[10px] text-purple-500", children: Y(i) }),
|
|
114
114
|
l
|
|
115
115
|
] }),
|
|
116
116
|
/* @__PURE__ */ e.jsx("span", { className: "cursor-pointer text-[9px] text-blue-400 underline hover:text-blue-700", children: "Change" })
|
|
117
117
|
] }) : /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
118
118
|
"+ Set ",
|
|
119
|
-
|
|
119
|
+
Y(le(r))
|
|
120
120
|
] })
|
|
121
121
|
}
|
|
122
122
|
) }),
|
|
123
|
-
/* @__PURE__ */ e.jsx(
|
|
124
|
-
/* @__PURE__ */ e.jsx(
|
|
125
|
-
/* @__PURE__ */ e.jsxs(
|
|
126
|
-
/* @__PURE__ */ e.jsx(
|
|
127
|
-
/* @__PURE__ */ e.jsx(
|
|
128
|
-
|
|
123
|
+
/* @__PURE__ */ e.jsx(tr, { className: "z-[999] min-w-[300px] p-0", side: "right", align: "start", children: /* @__PURE__ */ e.jsxs(rr, { children: [
|
|
124
|
+
/* @__PURE__ */ e.jsx(sr, { placeholder: `Choose ${le(r)}...` }),
|
|
125
|
+
/* @__PURE__ */ e.jsxs(lr, { children: [
|
|
126
|
+
/* @__PURE__ */ e.jsx(ar, { children: "No results found." }),
|
|
127
|
+
/* @__PURE__ */ e.jsx(or, { children: C(y, (x) => /* @__PURE__ */ e.jsxs(
|
|
128
|
+
nr,
|
|
129
129
|
{
|
|
130
|
-
value:
|
|
130
|
+
value: x,
|
|
131
131
|
className: `cursor-pointer ${h ? "flex items-center justify-between" : "flex flex-col items-start justify-start"}`,
|
|
132
132
|
onSelect: (f) => {
|
|
133
|
-
t(Ge(y, (j) => j === f) || null),
|
|
133
|
+
t(Ge(y, (j) => j === f) || null), u(!1);
|
|
134
134
|
},
|
|
135
135
|
children: [
|
|
136
136
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-x-2", children: [
|
|
137
|
-
/* @__PURE__ */ e.jsx(
|
|
138
|
-
|
|
137
|
+
/* @__PURE__ */ e.jsx(Mr, { className: `h-4 w-4 text-green-500 ${l === x ? "" : "opacity-0"}` }),
|
|
138
|
+
x
|
|
139
139
|
] }),
|
|
140
|
-
h ? /* @__PURE__ */ e.jsx("div", { children: /* @__PURE__ */ e.jsx("span", { className: "rounded-full bg-purple-100 px-2 py-0.5 text-[10px] text-purple-500", children:
|
|
140
|
+
h ? /* @__PURE__ */ e.jsx("div", { children: /* @__PURE__ */ e.jsx("span", { className: "rounded-full bg-purple-100 px-2 py-0.5 text-[10px] text-purple-500", children: Y(g(o, x, "")) }) }) : /* @__PURE__ */ e.jsx("div", { className: "pl-6", children: /* @__PURE__ */ e.jsx(Se, { data: g(n, x) }) })
|
|
141
141
|
]
|
|
142
142
|
},
|
|
143
|
-
|
|
143
|
+
x
|
|
144
144
|
)) })
|
|
145
145
|
] })
|
|
146
146
|
] }) })
|
|
147
147
|
] })
|
|
148
148
|
] }),
|
|
149
|
-
!h && !b(l) && /* @__PURE__ */ e.jsx("div", { className: "pt-2", children: /* @__PURE__ */ e.jsx(Se, { data: g(
|
|
149
|
+
!h && !b(l) && /* @__PURE__ */ e.jsx("div", { className: "pt-2", children: /* @__PURE__ */ e.jsx(Se, { data: g(n, l, ""), fullView: !0 }) })
|
|
150
150
|
] });
|
|
151
|
-
},
|
|
151
|
+
}, ss = ({
|
|
152
152
|
appliedBindings: r = [],
|
|
153
153
|
onAddBinding: l,
|
|
154
154
|
editMode: t,
|
|
155
|
-
item:
|
|
155
|
+
item: n
|
|
156
156
|
}) => {
|
|
157
|
-
const [s,
|
|
158
|
-
(y,
|
|
157
|
+
const [s, i] = w(t ? n.key : ""), [a, d] = w(t ? n.value : ""), o = q(), [c] = ut(), h = H(
|
|
158
|
+
(y, x) => {
|
|
159
159
|
if (b(y))
|
|
160
160
|
return "";
|
|
161
161
|
{
|
|
162
|
-
const f = g(
|
|
163
|
-
if (
|
|
162
|
+
const f = g(x === "PROP" ? o : c, y, "");
|
|
163
|
+
if (xe(f))
|
|
164
164
|
return "list";
|
|
165
165
|
const j = typeof f;
|
|
166
166
|
return j === "string" ? "text" : j === "object" ? "model" : j;
|
|
167
167
|
}
|
|
168
168
|
},
|
|
169
169
|
[o, c]
|
|
170
|
-
), [p,
|
|
170
|
+
), [p, u] = w(t ? h(n.key, "PROP") : "");
|
|
171
171
|
return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
172
|
-
/* @__PURE__ */ e.jsxs(
|
|
173
|
-
/* @__PURE__ */ e.jsx(
|
|
174
|
-
/* @__PURE__ */ e.jsx(
|
|
172
|
+
/* @__PURE__ */ e.jsxs(ir, { children: [
|
|
173
|
+
/* @__PURE__ */ e.jsx(dr, { children: "Add Data Binding" }),
|
|
174
|
+
/* @__PURE__ */ e.jsx(cr, { className: "text-xs", children: "Add prop and path of binding. Click save when you're done." })
|
|
175
175
|
] }),
|
|
176
176
|
/* @__PURE__ */ e.jsxs("div", { className: "relative flex flex-col gap-1", children: [
|
|
177
177
|
/* @__PURE__ */ e.jsx(
|
|
@@ -181,10 +181,10 @@ const Se = ({ data: r, fullView: l }) => {
|
|
|
181
181
|
isDisabled: !1,
|
|
182
182
|
placeholder: "Enter prop key",
|
|
183
183
|
value: s,
|
|
184
|
-
setValue:
|
|
184
|
+
setValue: i,
|
|
185
185
|
onChange: (y) => {
|
|
186
|
-
const
|
|
187
|
-
|
|
186
|
+
const x = h(y, "PROP");
|
|
187
|
+
i(y), p !== x && d(""), u(x);
|
|
188
188
|
},
|
|
189
189
|
data: o,
|
|
190
190
|
dataType: p,
|
|
@@ -201,8 +201,8 @@ const Se = ({ data: r, fullView: l }) => {
|
|
|
201
201
|
value: a,
|
|
202
202
|
setValue: d,
|
|
203
203
|
onChange: (y) => {
|
|
204
|
-
const
|
|
205
|
-
d(p ===
|
|
204
|
+
const x = h(y, "PATH");
|
|
205
|
+
d(p === x ? y : "");
|
|
206
206
|
},
|
|
207
207
|
data: c,
|
|
208
208
|
dataType: p,
|
|
@@ -210,8 +210,8 @@ const Se = ({ data: r, fullView: l }) => {
|
|
|
210
210
|
}
|
|
211
211
|
)
|
|
212
212
|
] }),
|
|
213
|
-
/* @__PURE__ */ e.jsx(
|
|
214
|
-
|
|
213
|
+
/* @__PURE__ */ e.jsx(pr, { children: /* @__PURE__ */ e.jsx(
|
|
214
|
+
G,
|
|
215
215
|
{
|
|
216
216
|
type: "submit",
|
|
217
217
|
className: "mt-4",
|
|
@@ -221,87 +221,87 @@ const Se = ({ data: r, fullView: l }) => {
|
|
|
221
221
|
}
|
|
222
222
|
) })
|
|
223
223
|
] });
|
|
224
|
-
},
|
|
224
|
+
}, xt = ({ disabled: r, children: l, onAddBinding: t, appliedBindings: n, editMode: s = !0, item: i = {} }) => {
|
|
225
225
|
const [a, d] = w(!1);
|
|
226
|
-
return /* @__PURE__ */ e.jsxs(
|
|
227
|
-
/* @__PURE__ */ e.jsx(
|
|
228
|
-
a && /* @__PURE__ */ e.jsx(
|
|
229
|
-
|
|
226
|
+
return /* @__PURE__ */ e.jsxs(ur, { children: [
|
|
227
|
+
/* @__PURE__ */ e.jsx(xr, { disabled: r, asChild: !0, onClick: () => d(!0), children: l }),
|
|
228
|
+
a && /* @__PURE__ */ e.jsx(gr, { children: /* @__PURE__ */ e.jsx(
|
|
229
|
+
ss,
|
|
230
230
|
{
|
|
231
|
-
item:
|
|
231
|
+
item: i,
|
|
232
232
|
editMode: s,
|
|
233
|
-
appliedBindings:
|
|
233
|
+
appliedBindings: n,
|
|
234
234
|
onAddBinding: (o) => {
|
|
235
235
|
t(o), d(!1);
|
|
236
236
|
}
|
|
237
237
|
}
|
|
238
238
|
) })
|
|
239
239
|
] });
|
|
240
|
-
},
|
|
240
|
+
}, ls = ({
|
|
241
241
|
item: r,
|
|
242
242
|
onAddBinding: l,
|
|
243
243
|
onRemove: t,
|
|
244
|
-
selectedBlock:
|
|
244
|
+
selectedBlock: n,
|
|
245
245
|
dataProvider: s,
|
|
246
|
-
appliedBindings:
|
|
246
|
+
appliedBindings: i
|
|
247
247
|
}) => {
|
|
248
248
|
const [a, d] = w("string"), o = (c, h) => {
|
|
249
249
|
if (b(c))
|
|
250
250
|
return "";
|
|
251
251
|
{
|
|
252
|
-
const p = g(h === "PROP" ?
|
|
253
|
-
if (
|
|
252
|
+
const p = g(h === "PROP" ? n : s, c, "");
|
|
253
|
+
if (xe(p))
|
|
254
254
|
return "list";
|
|
255
|
-
const
|
|
256
|
-
return
|
|
255
|
+
const u = typeof p;
|
|
256
|
+
return u === "string" ? "text" : u === "object" ? "model" : u;
|
|
257
257
|
}
|
|
258
258
|
};
|
|
259
|
-
return
|
|
259
|
+
return z(() => d(() => o(r.key, "PROP")), [r.key]), /* @__PURE__ */ e.jsxs("div", { className: "relative flex flex-col rounded-md border border-gray-200 p-2", children: [
|
|
260
260
|
/* @__PURE__ */ e.jsx("div", { className: "text-sm font-normal text-gray-500", children: r.key }),
|
|
261
261
|
/* @__PURE__ */ e.jsx("div", { className: "font-medium leading-5", children: r.value }),
|
|
262
262
|
/* @__PURE__ */ e.jsx(Se, { data: g(s, r.value, "") }),
|
|
263
263
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center justify-end gap-x-2", children: [
|
|
264
|
-
/* @__PURE__ */ e.jsx(
|
|
264
|
+
/* @__PURE__ */ e.jsx(xt, { editMode: !0, onAddBinding: l, appliedBindings: i, item: r, children: /* @__PURE__ */ e.jsx(Er, { className: "mt-1 h-6 w-6 cursor-pointer rounded border border-blue-400 p-1 text-blue-400 duration-200 hover:scale-105 hover:bg-blue-400 hover:text-white" }) }),
|
|
265
265
|
/* @__PURE__ */ e.jsx(
|
|
266
|
-
|
|
266
|
+
Lr,
|
|
267
267
|
{
|
|
268
268
|
onClick: () => t(),
|
|
269
269
|
className: "mt-1 h-6 w-6 cursor-pointer rounded border border-red-400 p-1 text-red-400 duration-200 hover:scale-105 hover:bg-red-400 hover:text-white"
|
|
270
270
|
}
|
|
271
271
|
)
|
|
272
272
|
] }),
|
|
273
|
-
!b(a) && !b(r.key) && /* @__PURE__ */ e.jsx("div", { className: "absolute right-0 top-1 mt-px flex h-4 items-center rounded-full px-2 text-[10px] font-medium text-purple-600", children:
|
|
273
|
+
!b(a) && !b(r.key) && /* @__PURE__ */ e.jsx("div", { className: "absolute right-0 top-1 mt-px flex h-4 items-center rounded-full px-2 text-[10px] font-medium text-purple-600", children: Y(a) })
|
|
274
274
|
] });
|
|
275
|
-
},
|
|
276
|
-
const t =
|
|
277
|
-
|
|
275
|
+
}, as = ({ bindingData: r, onChange: l }) => {
|
|
276
|
+
const t = q(), [n] = ut(), s = Yr(), [i, a] = w(
|
|
277
|
+
C(r, (p, u) => ({ key: u, value: p }))
|
|
278
278
|
);
|
|
279
|
-
|
|
280
|
-
a(
|
|
279
|
+
z(() => {
|
|
280
|
+
a(C(r, (p, u) => ({ key: u, value: p })));
|
|
281
281
|
}, [t == null ? void 0 : t._id, r]);
|
|
282
|
-
const d =
|
|
283
|
-
if (b(i))
|
|
284
|
-
return !0;
|
|
282
|
+
const d = S(() => {
|
|
285
283
|
if (b(n))
|
|
284
|
+
return !0;
|
|
285
|
+
if (b(i))
|
|
286
286
|
return !1;
|
|
287
|
-
const p =
|
|
287
|
+
const p = Ct(i);
|
|
288
288
|
return b(p == null ? void 0 : p.key) || b(p == null ? void 0 : p.value);
|
|
289
|
-
}, [
|
|
290
|
-
const
|
|
291
|
-
a([...
|
|
289
|
+
}, [n, i]), o = (p) => {
|
|
290
|
+
const u = ve(i, (y) => y.key !== p.key);
|
|
291
|
+
a([...u, p]), h([...u, p]);
|
|
292
292
|
}, c = (p) => {
|
|
293
|
-
const
|
|
294
|
-
h([...
|
|
293
|
+
const u = ve(i, (y, x) => p !== x);
|
|
294
|
+
h([...u]);
|
|
295
295
|
}, h = H(
|
|
296
296
|
(p = []) => {
|
|
297
297
|
if (a(p), b(p)) {
|
|
298
298
|
l({});
|
|
299
299
|
return;
|
|
300
300
|
}
|
|
301
|
-
const
|
|
301
|
+
const u = {};
|
|
302
302
|
Re(p, (y) => {
|
|
303
|
-
!b(y == null ? void 0 : y.key) && !b(y == null ? void 0 : y.value) && qe(
|
|
304
|
-
}), l(
|
|
303
|
+
!b(y == null ? void 0 : y.key) && !b(y == null ? void 0 : y.value) && qe(u, y.key, y.value);
|
|
304
|
+
}), l(u);
|
|
305
305
|
},
|
|
306
306
|
[l]
|
|
307
307
|
);
|
|
@@ -310,78 +310,87 @@ const Se = ({ data: r, fullView: l }) => {
|
|
|
310
310
|
/* @__PURE__ */ e.jsx("br", {}),
|
|
311
311
|
/* @__PURE__ */ e.jsx("a", { className: "text-blue-500", href: "https://chaibuilder.com/docs/registering-data-providers", target: "_blank", children: "Learn more" })
|
|
312
312
|
] }) }) : /* @__PURE__ */ e.jsxs("div", { className: "space-y-2", children: [
|
|
313
|
-
|
|
314
|
-
|
|
313
|
+
C(i, (p, u) => /* @__PURE__ */ e.jsx(
|
|
314
|
+
ls,
|
|
315
315
|
{
|
|
316
316
|
item: p,
|
|
317
317
|
onAddBinding: o,
|
|
318
|
-
onRemove: () => c(
|
|
318
|
+
onRemove: () => c(u),
|
|
319
319
|
selectedBlock: t,
|
|
320
|
-
dataProvider:
|
|
321
|
-
appliedBindings:
|
|
320
|
+
dataProvider: n,
|
|
321
|
+
appliedBindings: C(i, "key")
|
|
322
322
|
},
|
|
323
323
|
p.key
|
|
324
324
|
)),
|
|
325
|
-
/* @__PURE__ */ e.jsxs(
|
|
326
|
-
/* @__PURE__ */ e.jsx(
|
|
327
|
-
|
|
325
|
+
/* @__PURE__ */ e.jsxs($, { delayDuration: 200, children: [
|
|
326
|
+
/* @__PURE__ */ e.jsx(A, { disabled: b(n), className: "w-full", children: /* @__PURE__ */ e.jsx(
|
|
327
|
+
xt,
|
|
328
328
|
{
|
|
329
329
|
disabled: d,
|
|
330
|
-
appliedBindings:
|
|
330
|
+
appliedBindings: C(i, "key"),
|
|
331
331
|
onAddBinding: o,
|
|
332
332
|
children: /* @__PURE__ */ e.jsx(
|
|
333
333
|
"span",
|
|
334
334
|
{
|
|
335
335
|
className: `w-full rounded-md px-5 py-1.5 text-xs font-medium duration-200 ${d ? "cursor-not-allowed bg-gray-200 text-gray-400" : "bg-blue-700/20 text-blue-800 hover:bg-blue-700/30"}`,
|
|
336
|
-
children: b(
|
|
336
|
+
children: b(n) ? /* @__PURE__ */ e.jsx("small", { className: "text-[9.5px] text-gray-500", children: "No data provider has been set up for this page" }) : "+ Add Data Binding"
|
|
337
337
|
}
|
|
338
338
|
)
|
|
339
339
|
}
|
|
340
340
|
) }),
|
|
341
|
-
d && /* @__PURE__ */ e.jsx(
|
|
341
|
+
d && /* @__PURE__ */ e.jsx(M, { sideOffset: -55, className: "text-[11px]", children: b(n) ? "No data provider has been set up for this page." : "Complete last added data binding to add more" })
|
|
342
342
|
] })
|
|
343
343
|
] });
|
|
344
|
-
},
|
|
345
|
-
const [s,
|
|
346
|
-
|
|
347
|
-
const
|
|
348
|
-
if (
|
|
344
|
+
}, os = () => /* @__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" }), pe = ft(({ id: r, properties: l, formData: t, onChange: n }) => {
|
|
345
|
+
const [s, i] = w(t), a = { type: "object", properties: {} }, d = {};
|
|
346
|
+
Object.keys(l).forEach((c) => {
|
|
347
|
+
const h = l[c];
|
|
348
|
+
if (F(["slot", "styles"], h.type))
|
|
349
349
|
return;
|
|
350
|
-
const
|
|
351
|
-
a.properties[
|
|
352
|
-
}),
|
|
353
|
-
|
|
354
|
-
}, [r])
|
|
355
|
-
|
|
350
|
+
const p = c;
|
|
351
|
+
a.properties[p] = hr(h), d[p] = yr(h);
|
|
352
|
+
}), z(() => {
|
|
353
|
+
i(t);
|
|
354
|
+
}, [r]);
|
|
355
|
+
const o = ue(
|
|
356
|
+
async ({ formData: c }, h) => {
|
|
357
|
+
n({ formData: c }, h);
|
|
358
|
+
},
|
|
359
|
+
[n],
|
|
360
|
+
1e3
|
|
361
|
+
// save only every 5 seconds
|
|
362
|
+
);
|
|
363
|
+
return /* @__PURE__ */ e.jsx(
|
|
364
|
+
Ur,
|
|
356
365
|
{
|
|
357
366
|
widgets: {
|
|
358
|
-
binding:
|
|
359
|
-
richtext:
|
|
360
|
-
icon:
|
|
361
|
-
image:
|
|
367
|
+
binding: os,
|
|
368
|
+
richtext: mr,
|
|
369
|
+
icon: br,
|
|
370
|
+
image: fr
|
|
362
371
|
},
|
|
363
|
-
fields: { link:
|
|
372
|
+
fields: { link: vr },
|
|
364
373
|
idSeparator: ".",
|
|
365
374
|
autoComplete: "off",
|
|
366
375
|
omitExtraData: !1,
|
|
367
376
|
liveOmit: !1,
|
|
368
377
|
liveValidate: !1,
|
|
369
|
-
validator:
|
|
378
|
+
validator: Kr,
|
|
370
379
|
uiSchema: d,
|
|
371
380
|
schema: a,
|
|
372
381
|
formData: s,
|
|
373
|
-
onChange: ({ formData:
|
|
374
|
-
|
|
382
|
+
onChange: ({ formData: c }, h) => {
|
|
383
|
+
h && (i(c), o({ formData: c }, h));
|
|
375
384
|
}
|
|
376
385
|
}
|
|
377
386
|
);
|
|
378
|
-
}),
|
|
379
|
-
const [r, l] =
|
|
387
|
+
}), ns = () => {
|
|
388
|
+
const [r, l] = Gr(), t = jr(), n = (a, d) => {
|
|
380
389
|
l((o) => ({ ...o, [a]: d }));
|
|
381
390
|
};
|
|
382
391
|
if (b(t))
|
|
383
392
|
return null;
|
|
384
|
-
const { block: s, settings:
|
|
393
|
+
const { block: s, settings: i } = t;
|
|
385
394
|
return /* @__PURE__ */ e.jsxs("div", { className: "text-xs hover:no-underline", children: [
|
|
386
395
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-x-2 bg-gray-100 px-4 py-2", children: [
|
|
387
396
|
t.block._type,
|
|
@@ -391,42 +400,42 @@ const Se = ({ data: r, fullView: l }) => {
|
|
|
391
400
|
pe,
|
|
392
401
|
{
|
|
393
402
|
id: s == null ? void 0 : s._id,
|
|
394
|
-
onChange: ({ formData: a }) =>
|
|
403
|
+
onChange: ({ formData: a }) => n(s._id, a),
|
|
395
404
|
formData: g(r, s._id, {}),
|
|
396
|
-
properties:
|
|
405
|
+
properties: i
|
|
397
406
|
}
|
|
398
407
|
) })
|
|
399
408
|
] });
|
|
400
409
|
};
|
|
401
|
-
function
|
|
402
|
-
const r =
|
|
403
|
-
if (f && (
|
|
404
|
-
const
|
|
405
|
-
t([r._id], { [
|
|
410
|
+
function is() {
|
|
411
|
+
const r = q(), l = st(), t = lt(), n = Pe(r._type), s = { ...r }, [i, a] = w(s), d = wr("dataBindingSupport", !1), o = ({ formData: x }, f, j) => {
|
|
412
|
+
if (f && (i == null ? void 0 : i._id) === r._id) {
|
|
413
|
+
const P = f.replace("root.", "");
|
|
414
|
+
t([r._id], { [P]: g(x, P) }, j);
|
|
406
415
|
}
|
|
407
416
|
}, c = H(
|
|
408
|
-
|
|
409
|
-
o({ formData:
|
|
417
|
+
kt(({ formData: x }, f, j) => {
|
|
418
|
+
o({ formData: x }, f, j), a(x);
|
|
410
419
|
}, 1500),
|
|
411
420
|
[r == null ? void 0 : r._id]
|
|
412
|
-
), h = ({ formData:
|
|
421
|
+
), h = ({ formData: x }, f) => {
|
|
413
422
|
if (f) {
|
|
414
423
|
const j = f.replace("root.", "");
|
|
415
|
-
l([r._id], { [j]: g(
|
|
424
|
+
l([r._id], { [j]: g(x, j) }), c({ formData: x }, f, { [j]: g(i, j) });
|
|
416
425
|
}
|
|
417
426
|
}, p = {
|
|
418
|
-
_name:
|
|
427
|
+
_name: Ar({
|
|
419
428
|
title: "Name",
|
|
420
429
|
default: g(r, "_name", r._type)
|
|
421
430
|
})
|
|
422
|
-
},
|
|
423
|
-
const
|
|
424
|
-
return d &&
|
|
425
|
-
}, [
|
|
431
|
+
}, u = je(g(s, "_bindings", {})), y = S(() => {
|
|
432
|
+
const x = Nt(g(n, "props", {}));
|
|
433
|
+
return d && _t(u, (f) => delete x[f]), x;
|
|
434
|
+
}, [n, u, d]);
|
|
426
435
|
return /* @__PURE__ */ e.jsxs("div", { className: "overflow-x-hidden", children: [
|
|
427
436
|
/* @__PURE__ */ e.jsx(pe, { id: r == null ? void 0 : r._id, onChange: h, formData: s, properties: p }),
|
|
428
437
|
/* @__PURE__ */ e.jsx("hr", { className: "mt-4" }),
|
|
429
|
-
/* @__PURE__ */ e.jsx(
|
|
438
|
+
/* @__PURE__ */ e.jsx(ns, {}),
|
|
430
439
|
d ? /* @__PURE__ */ e.jsxs(at, { type: "multiple", defaultValue: ["STATIC", "BINDING"], className: "h-full w-full", children: [
|
|
431
440
|
/* @__PURE__ */ e.jsxs(Ce, { value: "BINDING", children: [
|
|
432
441
|
/* @__PURE__ */ e.jsx(ke, { className: "bg-gray-100 px-3 py-2 text-xs hover:no-underline", children: /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-x-2", children: [
|
|
@@ -439,11 +448,11 @@ function ns() {
|
|
|
439
448
|
"Data Binding"
|
|
440
449
|
] }) }),
|
|
441
450
|
/* @__PURE__ */ e.jsx(Ne, { className: "px-4 pt-4", children: /* @__PURE__ */ e.jsx(
|
|
442
|
-
|
|
451
|
+
as,
|
|
443
452
|
{
|
|
444
453
|
bindingData: g(r, "_bindings", {}),
|
|
445
|
-
onChange: (
|
|
446
|
-
o({ formData: { _bindings:
|
|
454
|
+
onChange: (x) => {
|
|
455
|
+
o({ formData: { _bindings: x } }, "root._bindings");
|
|
447
456
|
}
|
|
448
457
|
}
|
|
449
458
|
) })
|
|
@@ -454,11 +463,11 @@ function ns() {
|
|
|
454
463
|
"Static Content"
|
|
455
464
|
] }) }),
|
|
456
465
|
/* @__PURE__ */ e.jsxs(Ne, { className: "pt-4", children: [
|
|
457
|
-
b(
|
|
466
|
+
b(u) ? null : /* @__PURE__ */ e.jsxs("div", { className: "mx-4 mb-1 mt-0 rounded-sm border border-orange-500 bg-orange-100 p-1 text-xs text-orange-500", children: [
|
|
458
467
|
"Data binding is set for ",
|
|
459
|
-
/* @__PURE__ */ e.jsx("b", { children:
|
|
468
|
+
/* @__PURE__ */ e.jsx("b", { children: C(u, we).join(", ") }),
|
|
460
469
|
" ",
|
|
461
|
-
|
|
470
|
+
u.length === 1 ? "property" : "properties",
|
|
462
471
|
". Remove data binding to edit static content."
|
|
463
472
|
] }),
|
|
464
473
|
/* @__PURE__ */ e.jsx(
|
|
@@ -484,60 +493,79 @@ function ns() {
|
|
|
484
493
|
/* @__PURE__ */ e.jsx("div", { className: "pb-60" })
|
|
485
494
|
] });
|
|
486
495
|
}
|
|
487
|
-
const Xe = new
|
|
496
|
+
const Xe = new Jr(Qr, {
|
|
488
497
|
isCaseSensitive: !1,
|
|
489
498
|
threshold: 0.2,
|
|
490
499
|
minMatchCharLength: 2,
|
|
491
500
|
keys: ["name"]
|
|
492
501
|
});
|
|
493
|
-
function
|
|
494
|
-
var
|
|
495
|
-
const [r] =
|
|
496
|
-
const
|
|
497
|
-
t(s,
|
|
498
|
-
}, [
|
|
499
|
-
const
|
|
500
|
-
let
|
|
501
|
-
if (
|
|
502
|
-
const [
|
|
503
|
-
|
|
504
|
-
...
|
|
505
|
-
item: { ...
|
|
502
|
+
function ds() {
|
|
503
|
+
var U;
|
|
504
|
+
const [r] = ge(), l = q(), t = De(), n = ot(), [s] = nt(), [i, a] = w(""), { toast: d } = it(), o = (U = oe(r)) == null ? void 0 : U.prop, c = St((g(l, o, "").replace(ts, "").split(",").pop() || "").split(" "), b), h = () => {
|
|
505
|
+
const k = i.trim().toLowerCase().replace(/ +(?= )/g, "").split(" ");
|
|
506
|
+
t(s, k, !0), a("");
|
|
507
|
+
}, [p, u] = w([]), y = ({ value: k }) => {
|
|
508
|
+
const _ = k.trim().toLowerCase(), D = _.match(/.+:/g);
|
|
509
|
+
let L = [];
|
|
510
|
+
if (D && D.length > 0) {
|
|
511
|
+
const [K] = D, m = _.replace(K, "");
|
|
512
|
+
L = Xe.search(m).map((N) => ({
|
|
513
|
+
...N,
|
|
514
|
+
item: { ...N.item, name: K + N.item.name }
|
|
506
515
|
}));
|
|
507
516
|
} else
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
},
|
|
511
|
-
|
|
512
|
-
},
|
|
517
|
+
L = Xe.search(_);
|
|
518
|
+
u(C(L, "item"));
|
|
519
|
+
}, x = () => {
|
|
520
|
+
u([]);
|
|
521
|
+
}, f = (k) => k.name, j = (k) => /* @__PURE__ */ e.jsx("div", { className: "rounded-md p-1", children: k.name }), P = {
|
|
513
522
|
autoComplete: "off",
|
|
514
523
|
autoCorrect: "off",
|
|
515
524
|
autoCapitalize: "off",
|
|
516
525
|
spellCheck: !1,
|
|
517
526
|
placeholder: "Enter class name",
|
|
518
|
-
value:
|
|
519
|
-
onKeyDown: (
|
|
520
|
-
|
|
527
|
+
value: i,
|
|
528
|
+
onKeyDown: (k) => {
|
|
529
|
+
k.key === "Enter" && i.trim() !== "" && h();
|
|
521
530
|
},
|
|
522
|
-
onChange: (
|
|
531
|
+
onChange: (k, { newValue: _ }) => a(_),
|
|
523
532
|
className: "w-full rounded-md text-xs px-2 hover:outline-0 bg-background border-border py-1"
|
|
533
|
+
}, E = () => {
|
|
534
|
+
if (navigator.clipboard === void 0) {
|
|
535
|
+
d({
|
|
536
|
+
title: "Clipboard not supported",
|
|
537
|
+
description: "Please use Chrome, Firefox or Safari",
|
|
538
|
+
variant: "destructive"
|
|
539
|
+
});
|
|
540
|
+
return;
|
|
541
|
+
}
|
|
542
|
+
navigator.clipboard.writeText(c.join(" ")), d({
|
|
543
|
+
title: "Copied",
|
|
544
|
+
description: "Classes copied to clipboard"
|
|
545
|
+
});
|
|
524
546
|
};
|
|
525
547
|
return /* @__PURE__ */ e.jsxs(
|
|
526
548
|
"div",
|
|
527
549
|
{
|
|
528
|
-
className: `no-scrollbar flex ${
|
|
550
|
+
className: `no-scrollbar flex ${p.length > 0 ? "min-h-[300px]" : "min-h-max"} w-full flex-col gap-y-5 overflow-y-auto bg-gray-100 px-px`,
|
|
529
551
|
children: [
|
|
530
|
-
/* @__PURE__ */ e.
|
|
552
|
+
/* @__PURE__ */ e.jsxs(dt, { className: "mt-2 flex items-center gap-x-2", children: [
|
|
553
|
+
/* @__PURE__ */ e.jsx("span", { children: "Add Tailwind classes" }),
|
|
554
|
+
/* @__PURE__ */ e.jsxs($, { children: [
|
|
555
|
+
/* @__PURE__ */ e.jsx(A, { asChild: !0, children: /* @__PURE__ */ e.jsx(Bt, { onClick: E, className: "cursor-pointer" }) }),
|
|
556
|
+
/* @__PURE__ */ e.jsx(M, { children: /* @__PURE__ */ e.jsx("p", { children: "Copy classes to clipboard" }) })
|
|
557
|
+
] })
|
|
558
|
+
] }),
|
|
531
559
|
/* @__PURE__ */ e.jsxs("div", { className: "relative -mt-4 flex items-center gap-x-3", children: [
|
|
532
560
|
/* @__PURE__ */ e.jsx("div", { className: "relative flex w-full items-center gap-x-3", children: /* @__PURE__ */ e.jsx(
|
|
533
|
-
|
|
561
|
+
qr,
|
|
534
562
|
{
|
|
535
|
-
suggestions:
|
|
536
|
-
onSuggestionsFetchRequested:
|
|
537
|
-
onSuggestionsClearRequested:
|
|
538
|
-
getSuggestionValue:
|
|
539
|
-
renderSuggestion:
|
|
540
|
-
inputProps:
|
|
563
|
+
suggestions: p,
|
|
564
|
+
onSuggestionsFetchRequested: y,
|
|
565
|
+
onSuggestionsClearRequested: x,
|
|
566
|
+
getSuggestionValue: f,
|
|
567
|
+
renderSuggestion: j,
|
|
568
|
+
inputProps: P,
|
|
541
569
|
containerProps: {
|
|
542
570
|
className: "relative h-8 w-full gap-y-1 py-1 border-gray-600"
|
|
543
571
|
},
|
|
@@ -549,36 +577,36 @@ function is() {
|
|
|
549
577
|
}
|
|
550
578
|
) }),
|
|
551
579
|
/* @__PURE__ */ e.jsx(
|
|
552
|
-
|
|
580
|
+
G,
|
|
553
581
|
{
|
|
554
582
|
variant: "outline",
|
|
555
583
|
className: "h-6 border-gray-700",
|
|
556
|
-
onClick:
|
|
557
|
-
disabled:
|
|
584
|
+
onClick: h,
|
|
585
|
+
disabled: i.trim() === "",
|
|
558
586
|
size: "sm",
|
|
559
587
|
children: /* @__PURE__ */ e.jsx(Ve, {})
|
|
560
588
|
}
|
|
561
589
|
)
|
|
562
590
|
] }),
|
|
563
591
|
/* @__PURE__ */ e.jsxs("div", { className: "flex w-full flex-wrap gap-2", children: [
|
|
564
|
-
b(
|
|
592
|
+
b(c) && /* @__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" }),
|
|
565
593
|
de.Children.toArray(
|
|
566
|
-
|
|
594
|
+
c.map((k) => /* @__PURE__ */ e.jsxs(
|
|
567
595
|
"div",
|
|
568
596
|
{
|
|
569
597
|
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",
|
|
570
598
|
children: [
|
|
571
|
-
|
|
599
|
+
k,
|
|
572
600
|
/* @__PURE__ */ e.jsx(
|
|
573
601
|
et,
|
|
574
602
|
{
|
|
575
|
-
onClick: () =>
|
|
603
|
+
onClick: () => n(s, [k]),
|
|
576
604
|
className: "invisible absolute right-1 hover:text-white group-hover:visible group-hover:cursor-pointer"
|
|
577
605
|
}
|
|
578
606
|
)
|
|
579
607
|
]
|
|
580
608
|
},
|
|
581
|
-
|
|
609
|
+
k
|
|
582
610
|
))
|
|
583
611
|
)
|
|
584
612
|
] })
|
|
@@ -586,16 +614,16 @@ function is() {
|
|
|
586
614
|
}
|
|
587
615
|
);
|
|
588
616
|
}
|
|
589
|
-
const
|
|
617
|
+
const B = ["px", "%", "em", "rem", "ch", "vh", "vw"], cs = {
|
|
590
618
|
heading: "flex.heading",
|
|
591
619
|
items: [
|
|
592
|
-
{ type: "arbitrary", label: "flex.basis", units:
|
|
620
|
+
{ type: "arbitrary", label: "flex.basis", units: B, property: "flexBasis" },
|
|
593
621
|
{ type: "range", label: "flex.order", property: "order" },
|
|
594
622
|
{ type: "dropdown", label: "flex.flex", property: "flexGrowShrink" },
|
|
595
623
|
{ type: "dropdown", label: "flex.grow", property: "flexGrow" },
|
|
596
624
|
{ type: "dropdown", label: "flex.shrink", property: "flexShrink" }
|
|
597
625
|
]
|
|
598
|
-
},
|
|
626
|
+
}, ps = {
|
|
599
627
|
heading: "grid.heading",
|
|
600
628
|
items: [
|
|
601
629
|
{ type: "range", label: "grid.col_span", property: "gridColSpan" },
|
|
@@ -606,17 +634,17 @@ const D = ["px", "%", "em", "rem", "ch", "vh", "vw"], ds = {
|
|
|
606
634
|
{ type: "range", label: "grid.row_end", property: "gridRowEnd" },
|
|
607
635
|
{ type: "range", label: "grid.order", property: "order" }
|
|
608
636
|
]
|
|
609
|
-
},
|
|
637
|
+
}, us = [
|
|
610
638
|
{
|
|
611
639
|
heading: "layout.heading",
|
|
612
640
|
items: [
|
|
613
|
-
{ type: "arbitrary", label: "layout.width", units:
|
|
614
|
-
{ type: "arbitrary", label: "layout.height", units:
|
|
641
|
+
{ type: "arbitrary", label: "layout.width", units: B.concat("auto"), property: "width" },
|
|
642
|
+
{ type: "arbitrary", label: "layout.height", units: B.concat("auto"), property: "height" },
|
|
615
643
|
{
|
|
616
644
|
styleType: "multiple",
|
|
617
645
|
label: "layout.margin",
|
|
618
646
|
negative: !0,
|
|
619
|
-
units: [...
|
|
647
|
+
units: [...B, "auto"],
|
|
620
648
|
options: [
|
|
621
649
|
{ key: "margin", label: "layout.margin_all" },
|
|
622
650
|
{ key: "marginX", label: "layout.margin_lr" },
|
|
@@ -657,16 +685,16 @@ const D = ["px", "%", "em", "rem", "ch", "vh", "vw"], ds = {
|
|
|
657
685
|
styleType: "accordion",
|
|
658
686
|
heading: "size.min_width_height",
|
|
659
687
|
items: [
|
|
660
|
-
{ type: "arbitrary", label: "size.min_width", units:
|
|
661
|
-
{ type: "arbitrary", label: "size.min_height", units:
|
|
688
|
+
{ type: "arbitrary", label: "size.min_width", units: B.concat("auto"), property: "minWidth" },
|
|
689
|
+
{ type: "arbitrary", label: "size.min_height", units: B.concat("auto"), property: "minHeight" }
|
|
662
690
|
]
|
|
663
691
|
},
|
|
664
692
|
{
|
|
665
693
|
styleType: "accordion",
|
|
666
694
|
heading: "size.max_width_height",
|
|
667
695
|
items: [
|
|
668
|
-
{ type: "arbitrary", label: "size.max_width", units:
|
|
669
|
-
{ type: "arbitrary", label: "size.max_height", units:
|
|
696
|
+
{ type: "arbitrary", label: "size.max_width", units: B.concat("auto"), property: "maxWidth" },
|
|
697
|
+
{ type: "arbitrary", label: "size.max_height", units: B.concat("auto"), property: "maxHeight" }
|
|
670
698
|
]
|
|
671
699
|
},
|
|
672
700
|
{
|
|
@@ -683,7 +711,7 @@ const D = ["px", "%", "em", "rem", "ch", "vh", "vw"], ds = {
|
|
|
683
711
|
{
|
|
684
712
|
heading: "display.heading",
|
|
685
713
|
items: [
|
|
686
|
-
{ type: "dropdown", label: "display.display", property: "display", units:
|
|
714
|
+
{ type: "dropdown", label: "display.display", property: "display", units: B },
|
|
687
715
|
{
|
|
688
716
|
styleType: "accordion",
|
|
689
717
|
heading: "display.flex_options",
|
|
@@ -734,7 +762,7 @@ const D = ["px", "%", "em", "rem", "ch", "vh", "vw"], ds = {
|
|
|
734
762
|
styleType: "accordion",
|
|
735
763
|
heading: "display.visibility_opacity",
|
|
736
764
|
items: [
|
|
737
|
-
{ type: "dropdown", label: "display.visibility", property: "visibility", units:
|
|
765
|
+
{ type: "dropdown", label: "display.visibility", property: "visibility", units: B },
|
|
738
766
|
{ type: "arbitrary", label: "display.opacity", property: "opacity", units: ["-"] }
|
|
739
767
|
]
|
|
740
768
|
}
|
|
@@ -810,8 +838,8 @@ const D = ["px", "%", "em", "rem", "ch", "vh", "vw"], ds = {
|
|
|
810
838
|
heading: "typography.heading",
|
|
811
839
|
items: [
|
|
812
840
|
{ type: "dropdown", property: "fontFamily", label: "typography.font" },
|
|
813
|
-
{ type: "arbitrary", property: "fontSize", label: "typography.size", units:
|
|
814
|
-
{ type: "arbitrary", property: "lineHeight", label: "typography.height", units:
|
|
841
|
+
{ type: "arbitrary", property: "fontSize", label: "typography.size", units: B },
|
|
842
|
+
{ type: "arbitrary", property: "lineHeight", label: "typography.height", units: B.concat("-") },
|
|
815
843
|
{ type: "range", property: "fontWeight", label: "typography.weight" },
|
|
816
844
|
{ type: "color", property: "textColor", label: "typography.color" },
|
|
817
845
|
{
|
|
@@ -1008,54 +1036,54 @@ const D = ["px", "%", "em", "rem", "ch", "vh", "vw"], ds = {
|
|
|
1008
1036
|
},
|
|
1009
1037
|
{
|
|
1010
1038
|
heading: "classes.heading",
|
|
1011
|
-
items: [{ component:
|
|
1039
|
+
items: [{ component: ds }]
|
|
1012
1040
|
}
|
|
1013
|
-
],
|
|
1041
|
+
], gt = {
|
|
1014
1042
|
"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" }) }),
|
|
1015
1043
|
// visibility
|
|
1016
|
-
visible:
|
|
1044
|
+
visible: Pt,
|
|
1017
1045
|
invisible: Ae,
|
|
1018
1046
|
// display
|
|
1019
1047
|
hidden: Ae,
|
|
1020
|
-
gap:
|
|
1048
|
+
gap: O,
|
|
1021
1049
|
gapX: T,
|
|
1022
1050
|
gapY: R,
|
|
1023
1051
|
spaceX: T,
|
|
1024
1052
|
spaceY: R,
|
|
1025
|
-
overscroll:
|
|
1053
|
+
overscroll: O,
|
|
1026
1054
|
overscrollX: T,
|
|
1027
1055
|
overscrollY: R,
|
|
1028
|
-
overflow:
|
|
1056
|
+
overflow: O,
|
|
1029
1057
|
overflowX: T,
|
|
1030
1058
|
overflowY: R,
|
|
1031
1059
|
top: ee,
|
|
1032
1060
|
right: te,
|
|
1033
1061
|
bottom: re,
|
|
1034
1062
|
left: se,
|
|
1035
|
-
inset:
|
|
1063
|
+
inset: O,
|
|
1036
1064
|
insetX: T,
|
|
1037
1065
|
insetY: R,
|
|
1038
|
-
border:
|
|
1066
|
+
border: O,
|
|
1039
1067
|
borderX: T,
|
|
1040
1068
|
borderY: R,
|
|
1041
1069
|
borderTop: ee,
|
|
1042
1070
|
borderRight: te,
|
|
1043
1071
|
borderBottom: re,
|
|
1044
1072
|
borderLeft: se,
|
|
1045
|
-
borderRadius:
|
|
1073
|
+
borderRadius: O,
|
|
1046
1074
|
borderRadiusX: T,
|
|
1047
1075
|
borderRadiusY: R,
|
|
1048
1076
|
borderRadiusTop: ee,
|
|
1049
1077
|
borderRadiusRight: te,
|
|
1050
1078
|
borderRadiusBottom: re,
|
|
1051
1079
|
borderRadiusLeft: se,
|
|
1052
|
-
borderRadiusTopLeft:
|
|
1053
|
-
borderRadiusTopRight:
|
|
1054
|
-
borderRadiusBottomRight:
|
|
1055
|
-
borderRadiusBottomLeft:
|
|
1080
|
+
borderRadiusTopLeft: It,
|
|
1081
|
+
borderRadiusTopRight: $t,
|
|
1082
|
+
borderRadiusBottomRight: At,
|
|
1083
|
+
borderRadiusBottomLeft: Mt,
|
|
1056
1084
|
divideXWidth: T,
|
|
1057
1085
|
divideYWidth: R,
|
|
1058
|
-
scale:
|
|
1086
|
+
scale: O,
|
|
1059
1087
|
scaleX: T,
|
|
1060
1088
|
scaleY: R,
|
|
1061
1089
|
skewX: T,
|
|
@@ -1063,7 +1091,7 @@ const D = ["px", "%", "em", "rem", "ch", "vh", "vw"], ds = {
|
|
|
1063
1091
|
translateX: T,
|
|
1064
1092
|
translateY: R,
|
|
1065
1093
|
// padding
|
|
1066
|
-
padding:
|
|
1094
|
+
padding: O,
|
|
1067
1095
|
paddingX: T,
|
|
1068
1096
|
paddingY: R,
|
|
1069
1097
|
paddingTop: ee,
|
|
@@ -1071,7 +1099,7 @@ const D = ["px", "%", "em", "rem", "ch", "vh", "vw"], ds = {
|
|
|
1071
1099
|
paddingBottom: re,
|
|
1072
1100
|
paddingLeft: se,
|
|
1073
1101
|
// margin
|
|
1074
|
-
margin:
|
|
1102
|
+
margin: O,
|
|
1075
1103
|
marginX: T,
|
|
1076
1104
|
marginY: R,
|
|
1077
1105
|
marginTop: ee,
|
|
@@ -1079,18 +1107,18 @@ const D = ["px", "%", "em", "rem", "ch", "vh", "vw"], ds = {
|
|
|
1079
1107
|
marginBottom: re,
|
|
1080
1108
|
marginLeft: se,
|
|
1081
1109
|
// text-align
|
|
1082
|
-
textLeft:
|
|
1083
|
-
textCenter:
|
|
1084
|
-
textRight:
|
|
1085
|
-
textJustify:
|
|
1110
|
+
textLeft: Et,
|
|
1111
|
+
textCenter: Lt,
|
|
1112
|
+
textRight: Ot,
|
|
1113
|
+
textJustify: Ft,
|
|
1086
1114
|
// font style
|
|
1087
|
-
italic:
|
|
1115
|
+
italic: Yt,
|
|
1088
1116
|
// "not-italic": "",
|
|
1089
1117
|
// decoration
|
|
1090
|
-
underline:
|
|
1091
|
-
overline:
|
|
1118
|
+
underline: zt,
|
|
1119
|
+
overline: Xt,
|
|
1092
1120
|
// transform
|
|
1093
|
-
uppercase:
|
|
1121
|
+
uppercase: Zt,
|
|
1094
1122
|
block: () => /* @__PURE__ */ e.jsxs("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [
|
|
1095
1123
|
/* @__PURE__ */ e.jsx(
|
|
1096
1124
|
"path",
|
|
@@ -1203,101 +1231,101 @@ const D = ["px", "%", "em", "rem", "ch", "vh", "vw"], ds = {
|
|
|
1203
1231
|
}
|
|
1204
1232
|
)
|
|
1205
1233
|
] }),
|
|
1206
|
-
static:
|
|
1207
|
-
}, ne = Ke({ canReset: !1, canChange: !0 }),
|
|
1234
|
+
static: Wt
|
|
1235
|
+
}, ne = Ke({ canReset: !1, canChange: !0 }), xs = ({ children: r, canReset: l = !1, canChange: t = !0 }) => (
|
|
1208
1236
|
// eslint-disable-next-line react/jsx-no-constructed-context-values
|
|
1209
1237
|
/* @__PURE__ */ e.jsx(ne.Provider, { value: { canReset: l, canChange: t }, children: r })
|
|
1210
|
-
),
|
|
1211
|
-
const
|
|
1238
|
+
), ht = ({ label: r, property: l, onChange: t }) => {
|
|
1239
|
+
const n = S(() => g(ye, `${l}.classes`, [""]), [l]), s = ie(l), i = S(() => g(s, "cls", ""), [s]), { canChange: a } = ae(ne), d = /\[.*\]/g.test(i);
|
|
1212
1240
|
return /* @__PURE__ */ e.jsx("div", { className: r ? "w-full rounded" : "grow", children: d ? /* @__PURE__ */ e.jsxs("div", { className: "flex items-center", children: [
|
|
1213
|
-
/* @__PURE__ */ e.jsx(_e, { className: "w-[70%] rounded py-1", readOnly: !0, value:
|
|
1214
|
-
/* @__PURE__ */ e.jsxs(
|
|
1215
|
-
/* @__PURE__ */ e.jsx(
|
|
1216
|
-
/* @__PURE__ */ e.jsx(
|
|
1241
|
+
/* @__PURE__ */ e.jsx(_e, { className: "w-[70%] rounded py-1", readOnly: !0, value: i }),
|
|
1242
|
+
/* @__PURE__ */ e.jsxs($, { delayDuration: 100, children: [
|
|
1243
|
+
/* @__PURE__ */ e.jsx(A, { 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(He, {}) }) }),
|
|
1244
|
+
/* @__PURE__ */ e.jsx(M, { children: "Current value is using a Tailwind arbitrary value." })
|
|
1217
1245
|
] })
|
|
1218
1246
|
] }) : /* @__PURE__ */ e.jsx(
|
|
1219
1247
|
Te,
|
|
1220
1248
|
{
|
|
1221
1249
|
rounded: r,
|
|
1222
1250
|
onChange: (o) => t(o, l),
|
|
1223
|
-
selected:
|
|
1224
|
-
options:
|
|
1251
|
+
selected: i,
|
|
1252
|
+
options: n,
|
|
1225
1253
|
disabled: !a
|
|
1226
1254
|
}
|
|
1227
1255
|
) });
|
|
1228
1256
|
};
|
|
1229
|
-
function Te({ selected: r, onChange: l, rounded: t = !1, options:
|
|
1230
|
-
const
|
|
1257
|
+
function Te({ selected: r, onChange: l, rounded: t = !1, options: n, disabled: s = !1 }) {
|
|
1258
|
+
const i = r.replace(/.*:/g, "").trim(), { undo: a, redo: d } = Cr();
|
|
1231
1259
|
return /* @__PURE__ */ e.jsxs(
|
|
1232
1260
|
"select",
|
|
1233
1261
|
{
|
|
1234
|
-
disabled: !
|
|
1262
|
+
disabled: !n.length || s,
|
|
1235
1263
|
className: `${t ? "rounded-md border border-border" : "border-0"} disable:bg-gray-500 h-full w-full truncate rounded bg-background px-2 py-1 text-xs outline-none disabled:cursor-not-allowed`,
|
|
1236
1264
|
onChange: (o) => l(o.target.value),
|
|
1237
1265
|
onKeyDown: (o) => {
|
|
1238
1266
|
o.ctrlKey && (o.key === "z" && a(), o.key === "y" && d());
|
|
1239
1267
|
},
|
|
1240
|
-
value:
|
|
1268
|
+
value: i,
|
|
1241
1269
|
children: [
|
|
1242
1270
|
/* @__PURE__ */ e.jsx("option", { className: "bg-transparent", value: "" }),
|
|
1243
|
-
|
|
1244
|
-
|
|
1271
|
+
I.Children.toArray(
|
|
1272
|
+
n.map((o) => /* @__PURE__ */ e.jsx("option", { className: "bg-transparent", value: o, children: o }))
|
|
1245
1273
|
)
|
|
1246
1274
|
]
|
|
1247
1275
|
}
|
|
1248
1276
|
);
|
|
1249
1277
|
}
|
|
1250
|
-
const
|
|
1251
|
-
const { canReset: t, canChange:
|
|
1252
|
-
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:
|
|
1278
|
+
const gs = ({ property: r, onChange: l }) => {
|
|
1279
|
+
const { canReset: t, canChange: n } = ae(ne), s = ie(r), i = S(() => g(s, "cls", ""), [s]), a = S(() => g(ye, `${r}.classes`, [""]), [r]), d = a.indexOf(i) > -1 ? a.indexOf(i) : 0, o = /\[.*\]/g.test(i);
|
|
1280
|
+
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: i }) : /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
1253
1281
|
/* @__PURE__ */ e.jsx(
|
|
1254
1282
|
"button",
|
|
1255
1283
|
{
|
|
1256
1284
|
type: "button",
|
|
1257
1285
|
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",
|
|
1258
|
-
disabled: !
|
|
1286
|
+
disabled: !n && (!t || d - 1 < 0),
|
|
1259
1287
|
onClick: () => l($e(a, d - 1), r),
|
|
1260
1288
|
children: /* @__PURE__ */ e.jsx("span", { className: "flex items-center justify-center", children: /* @__PURE__ */ e.jsx(
|
|
1261
|
-
|
|
1289
|
+
Ut,
|
|
1262
1290
|
{
|
|
1263
|
-
className: !
|
|
1291
|
+
className: !n && (!t || d - 1 < 0) ? "text-gray-500" : "text-black/60 dark:text-white/60"
|
|
1264
1292
|
}
|
|
1265
1293
|
) })
|
|
1266
1294
|
}
|
|
1267
1295
|
),
|
|
1268
|
-
/* @__PURE__ */ e.jsx("div", { className: "w-8/12 text-center", children: /* @__PURE__ */ e.jsx(
|
|
1296
|
+
/* @__PURE__ */ e.jsx("div", { className: "w-8/12 text-center", children: /* @__PURE__ */ e.jsx(ht, { label: !1, property: r, onChange: l }) }),
|
|
1269
1297
|
/* @__PURE__ */ e.jsx(
|
|
1270
1298
|
"button",
|
|
1271
1299
|
{
|
|
1272
1300
|
type: "button",
|
|
1273
1301
|
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",
|
|
1274
|
-
disabled: !
|
|
1302
|
+
disabled: !n && (!t || d + 1 >= a.length),
|
|
1275
1303
|
onClick: () => l($e(a, d + 1), r),
|
|
1276
1304
|
children: /* @__PURE__ */ e.jsx("span", { className: "flex items-center justify-center", children: /* @__PURE__ */ e.jsx(
|
|
1277
1305
|
Ve,
|
|
1278
1306
|
{
|
|
1279
|
-
className: !
|
|
1307
|
+
className: !n && (!t || d + 1 >= a.length) ? "text-gray-500" : "text-black/60 dark:text-white/60"
|
|
1280
1308
|
}
|
|
1281
1309
|
) })
|
|
1282
1310
|
}
|
|
1283
1311
|
)
|
|
1284
1312
|
] }) });
|
|
1285
|
-
},
|
|
1286
|
-
const t =
|
|
1287
|
-
return /* @__PURE__ */ e.jsx("div", { className: "flex grow flex-wrap gap-1", children:
|
|
1288
|
-
/* @__PURE__ */ e.jsx(
|
|
1313
|
+
}, hs = ({ property: r, onChange: l }) => {
|
|
1314
|
+
const t = S(() => g(ye, `${r}.classes`, [""]), [r]), { canChange: n } = ae(ne), s = ie(r), i = S(() => g(s, "cls", ""), [s]);
|
|
1315
|
+
return /* @__PURE__ */ e.jsx("div", { className: "flex grow flex-wrap gap-1", children: C(t, (a) => /* @__PURE__ */ e.jsxs($, { children: [
|
|
1316
|
+
/* @__PURE__ */ e.jsx(A, { asChild: !0, children: /* @__PURE__ */ e.jsx(
|
|
1289
1317
|
"button",
|
|
1290
1318
|
{
|
|
1291
1319
|
type: "button",
|
|
1292
|
-
disabled: !
|
|
1320
|
+
disabled: !n,
|
|
1293
1321
|
onClick: () => l(a, r),
|
|
1294
|
-
className: `cursor-pointer rounded border border-gray-600 p-1 disabled:cursor-not-allowed ${
|
|
1295
|
-
children:
|
|
1322
|
+
className: `cursor-pointer rounded border border-gray-600 p-1 disabled:cursor-not-allowed ${i === a ? " bg-blue-500 text-white" : "disabled:bg-gray-600 disabled:text-gray-400"}`,
|
|
1323
|
+
children: I.createElement(g(gt, a, tt))
|
|
1296
1324
|
}
|
|
1297
1325
|
) }),
|
|
1298
|
-
/* @__PURE__ */ e.jsx(
|
|
1326
|
+
/* @__PURE__ */ e.jsx(M, { children: Y(le(a)) })
|
|
1299
1327
|
] })) });
|
|
1300
|
-
},
|
|
1328
|
+
}, ys = {
|
|
1301
1329
|
backgroundColor: "bg",
|
|
1302
1330
|
textColor: "text",
|
|
1303
1331
|
borderColor: "border",
|
|
@@ -1309,31 +1337,31 @@ const xs = ({ property: r, onChange: l }) => {
|
|
|
1309
1337
|
toColor: "to",
|
|
1310
1338
|
ringColor: "ring",
|
|
1311
1339
|
ringOffsetColor: "ring-offset"
|
|
1312
|
-
},
|
|
1313
|
-
const t = ie(r),
|
|
1340
|
+
}, ms = ({ property: r, onChange: l }) => {
|
|
1341
|
+
const t = ie(r), n = S(() => g(t, "cls", ""), [t]), { canChange: s } = ae(ne), [i, a] = w([]), [d, o] = w({ color: "", shade: "" }), c = n.split("-"), h = g(c, "1", ""), p = g(c, "2", ""), u = H(
|
|
1314
1342
|
// eslint-disable-next-line no-shadow
|
|
1315
|
-
(
|
|
1316
|
-
["current", "inherit", "transparent", "black", "white"].includes(
|
|
1343
|
+
(x) => {
|
|
1344
|
+
["current", "inherit", "transparent", "black", "white"].includes(x) ? (a([]), o({ color: x })) : (a(["50", "100", "200", "300", "400", "500", "600", "700", "800", "900"]), o((f) => ({ ...f, color: x, shade: f.shade ? f.shade : "500" })));
|
|
1317
1345
|
},
|
|
1318
1346
|
[a, o]
|
|
1319
1347
|
);
|
|
1320
|
-
|
|
1348
|
+
z(() => {
|
|
1321
1349
|
if (["current", "inherit", "transparent", "black", "white"].includes(h))
|
|
1322
1350
|
return a([]);
|
|
1323
1351
|
a(["50", "100", "200", "300", "400", "500", "600", "700", "800", "900"]);
|
|
1324
1352
|
}, [h]);
|
|
1325
1353
|
const y = H(
|
|
1326
1354
|
// eslint-disable-next-line no-shadow
|
|
1327
|
-
(
|
|
1328
|
-
o({ color: h, shade:
|
|
1355
|
+
(x) => {
|
|
1356
|
+
o({ color: h, shade: x });
|
|
1329
1357
|
},
|
|
1330
1358
|
[h]
|
|
1331
1359
|
);
|
|
1332
|
-
return
|
|
1360
|
+
return z(() => {
|
|
1333
1361
|
o({ color: "", shade: "" });
|
|
1334
|
-
}, [t]),
|
|
1335
|
-
const f = `${g(
|
|
1336
|
-
f.match(new RegExp(g(
|
|
1362
|
+
}, [t]), z(() => {
|
|
1363
|
+
const f = `${g(ys, r, "")}-${d.color}${d.shade ? `-${d.shade}` : ""}`;
|
|
1364
|
+
f.match(new RegExp(g(ye, `${r}.regExp`, ""))) && l(f, r);
|
|
1337
1365
|
}, [d, l, r]), /* @__PURE__ */ e.jsxs("div", { className: "flex flex-row divide-x divide-solid divide-border rounded-lg border border-border text-xs", children: [
|
|
1338
1366
|
/* @__PURE__ */ e.jsx("div", { className: "grow text-center", children: /* @__PURE__ */ e.jsx(
|
|
1339
1367
|
Te,
|
|
@@ -1341,7 +1369,7 @@ const xs = ({ property: r, onChange: l }) => {
|
|
|
1341
1369
|
disabled: !s,
|
|
1342
1370
|
rounded: !0,
|
|
1343
1371
|
selected: h,
|
|
1344
|
-
onChange:
|
|
1372
|
+
onChange: u,
|
|
1345
1373
|
options: [
|
|
1346
1374
|
"current",
|
|
1347
1375
|
"transparent",
|
|
@@ -1374,19 +1402,19 @@ const xs = ({ property: r, onChange: l }) => {
|
|
|
1374
1402
|
]
|
|
1375
1403
|
}
|
|
1376
1404
|
) }),
|
|
1377
|
-
/* @__PURE__ */ e.jsx("button", { type: "button", className: "grow text-center", children: /* @__PURE__ */ e.jsx(Te, { rounded: !0, selected: p, disabled: !h || !s, onChange: y, options:
|
|
1405
|
+
/* @__PURE__ */ e.jsx("button", { type: "button", className: "grow text-center", children: /* @__PURE__ */ e.jsx(Te, { rounded: !0, selected: p, disabled: !h || !s, onChange: y, options: i }) })
|
|
1378
1406
|
] });
|
|
1379
1407
|
}, Ze = (r, l) => {
|
|
1380
1408
|
r = r.toLowerCase();
|
|
1381
1409
|
let t = r.trim().replace(/ |\+/g, "");
|
|
1382
1410
|
if ((t === "auto" || t === "none") && l.includes(t))
|
|
1383
1411
|
return { value: "", unit: t };
|
|
1384
|
-
const
|
|
1385
|
-
t = t.replace(
|
|
1386
|
-
const s = r.match(
|
|
1387
|
-
return
|
|
1412
|
+
const n = l.length ? new RegExp(l.join("|"), "g") : /XXXXXX/g;
|
|
1413
|
+
t = t.replace(n, "");
|
|
1414
|
+
const s = r.match(n), i = s && s.length > 1, a = !b(t) && Number.isNaN(Number(t));
|
|
1415
|
+
return i || a ? { error: "Invalid value" } : s && (s[0] === "auto" || s[0] === "none") ? { value: s[0], unit: "" } : { value: t, unit: s ? s[0] : "" };
|
|
1388
1416
|
};
|
|
1389
|
-
const
|
|
1417
|
+
const bs = (r) => {
|
|
1390
1418
|
const l = r.startsWith("-") ? "-" : "", t = r.split("-").pop();
|
|
1391
1419
|
if (["auto", "none"].includes(t))
|
|
1392
1420
|
return { value: "", unit: t };
|
|
@@ -1396,22 +1424,22 @@ const ms = (r) => {
|
|
|
1396
1424
|
return { value: "100", unit: r.indexOf("w-") !== -1 ? "vw" : "vh" };
|
|
1397
1425
|
if (t === "full")
|
|
1398
1426
|
return { value: "100", unit: "%" };
|
|
1399
|
-
if (
|
|
1427
|
+
if (F(r, "skew-"))
|
|
1400
1428
|
return { value: `${l}${t}`, unit: "deg" };
|
|
1401
|
-
if (
|
|
1429
|
+
if (F(r, "rotate-"))
|
|
1402
1430
|
return { value: `${l}${t}`, unit: "deg" };
|
|
1403
|
-
if (
|
|
1431
|
+
if (F(r, "opacity-"))
|
|
1404
1432
|
return { value: `${t / 100}`, unit: "-" };
|
|
1405
|
-
if (
|
|
1433
|
+
if (F(r, "duration-") || F(r, "delay-"))
|
|
1406
1434
|
return { value: `${t}`, unit: "ms" };
|
|
1407
|
-
if (
|
|
1435
|
+
if (F(r, "translate-") && !t.includes("/"))
|
|
1408
1436
|
return { value: `${l}${`${t / 4}`}`, unit: "rem" };
|
|
1409
|
-
if (
|
|
1437
|
+
if (F(r, "scale-"))
|
|
1410
1438
|
return { value: `${l}${`${t / 100}`}`, unit: "-" };
|
|
1411
1439
|
if (W(r, "border")) {
|
|
1412
|
-
const
|
|
1413
|
-
if (
|
|
1414
|
-
return { value:
|
|
1440
|
+
const n = r.match(/border-?(x|y|t|r|b|l)?\d+/g);
|
|
1441
|
+
if (n)
|
|
1442
|
+
return { value: n[0].split("-").pop(), unit: "px" };
|
|
1415
1443
|
if (r.match(/border-?(x|y|t|r|b|l)?/g))
|
|
1416
1444
|
return { value: "1", unit: "px" };
|
|
1417
1445
|
}
|
|
@@ -1510,32 +1538,32 @@ const ms = (r) => {
|
|
|
1510
1538
|
if (["max", "min", "fit"].includes(t))
|
|
1511
1539
|
return { value: r, unit: "class" };
|
|
1512
1540
|
if (t.includes("/")) {
|
|
1513
|
-
const [
|
|
1514
|
-
return { value: l + (
|
|
1541
|
+
const [n, s] = C(t.split("/"), (i) => parseInt(i, 10));
|
|
1542
|
+
return { value: l + (n / s * 100).toFixed(2).replace(".00", ""), unit: "%" };
|
|
1515
1543
|
}
|
|
1516
|
-
return
|
|
1544
|
+
return Tt(parseFloat(t)) ? { value: `${l + parseFloat(t) * 4}`, unit: "px" } : { value: t, unit: "class" };
|
|
1517
1545
|
};
|
|
1518
|
-
const
|
|
1546
|
+
const fs = (r) => {
|
|
1519
1547
|
if (b(r))
|
|
1520
1548
|
return { value: "", unit: "" };
|
|
1521
1549
|
const l = r.match(/\[.*\]/g);
|
|
1522
1550
|
if (l === null)
|
|
1523
|
-
return
|
|
1524
|
-
const t = g(l, "0", "").replace(/\[|\]/g, ""),
|
|
1525
|
-
return { value: `${
|
|
1526
|
-
},
|
|
1551
|
+
return vs(r);
|
|
1552
|
+
const t = g(l, "0", "").replace(/\[|\]/g, ""), n = r.startsWith("-") ? "-" : "", s = oe(t.match(/\d+.\d+|\d+/g));
|
|
1553
|
+
return { value: `${n}${s}`, unit: t.replace(s, "") };
|
|
1554
|
+
}, vs = (r) => b(r) ? { value: "", unit: "" } : bs(r), yt = I.createContext({
|
|
1527
1555
|
setDragData: () => {
|
|
1528
1556
|
}
|
|
1529
|
-
}),
|
|
1557
|
+
}), js = ({
|
|
1530
1558
|
unit: r,
|
|
1531
1559
|
currentValue: l,
|
|
1532
1560
|
onDrag: t,
|
|
1533
|
-
onDragEnd:
|
|
1561
|
+
onDragEnd: n,
|
|
1534
1562
|
onDragStart: s,
|
|
1535
|
-
negative:
|
|
1563
|
+
negative: i,
|
|
1536
1564
|
cssProperty: a
|
|
1537
1565
|
}) => {
|
|
1538
|
-
const { setDragData: d } = ae(
|
|
1566
|
+
const { setDragData: d } = ae(yt);
|
|
1539
1567
|
return /* @__PURE__ */ e.jsx(
|
|
1540
1568
|
"button",
|
|
1541
1569
|
{
|
|
@@ -1543,124 +1571,124 @@ const bs = (r) => {
|
|
|
1543
1571
|
onMouseDown: (o) => {
|
|
1544
1572
|
const c = {
|
|
1545
1573
|
onDrag: t,
|
|
1546
|
-
onDragEnd:
|
|
1574
|
+
onDragEnd: n,
|
|
1547
1575
|
dragging: !0,
|
|
1548
1576
|
dragStartY: o.pageY,
|
|
1549
1577
|
dragStartValue: `${l}`,
|
|
1550
1578
|
dragUnit: r,
|
|
1551
|
-
negative:
|
|
1579
|
+
negative: i,
|
|
1552
1580
|
cssProperty: a
|
|
1553
1581
|
};
|
|
1554
1582
|
s(c), d(c);
|
|
1555
1583
|
},
|
|
1556
1584
|
color: void 0,
|
|
1557
1585
|
className: "relative z-50 ml-1 hidden h-6 cursor-row-resize rounded bg-background/70 px-2 group-hover:inline",
|
|
1558
|
-
children: /* @__PURE__ */ e.jsx(
|
|
1586
|
+
children: /* @__PURE__ */ e.jsx(Kt, {})
|
|
1559
1587
|
}
|
|
1560
1588
|
);
|
|
1561
|
-
},
|
|
1562
|
-
|
|
1589
|
+
}, ws = ({ onSelect: r, current: l, 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(
|
|
1590
|
+
G,
|
|
1563
1591
|
{
|
|
1564
1592
|
className: "h-max rounded-none px-1 py-1 text-right text-[11px] hover:bg-blue-400",
|
|
1565
|
-
color: l ===
|
|
1593
|
+
color: l === n ? "primary" : void 0,
|
|
1566
1594
|
size: "sm",
|
|
1567
1595
|
onClick: (s) => {
|
|
1568
|
-
s.stopPropagation(), r(
|
|
1596
|
+
s.stopPropagation(), r(n);
|
|
1569
1597
|
},
|
|
1570
|
-
children:
|
|
1598
|
+
children: n
|
|
1571
1599
|
},
|
|
1572
|
-
|
|
1573
|
-
)) }), We = 50,
|
|
1574
|
-
const [l, t] = w(!1), [
|
|
1575
|
-
|
|
1576
|
-
const { value: m, unit: v } =
|
|
1600
|
+
n
|
|
1601
|
+
)) }), We = 50, Cs = (r) => {
|
|
1602
|
+
const [l, t] = w(!1), [n, s] = w(""), { currentClass: i, onChange: a, classPrefix: d, cssProperty: o, units: c, negative: h } = r, [p, u] = w(o != null && o.toLowerCase().includes("width") ? "%" : c[0]), [y, x] = w(!1), [f, j] = w(""), [P, E] = w(!1), [U, k] = w(!1);
|
|
1603
|
+
z(() => {
|
|
1604
|
+
const { value: m, unit: v } = fs(i);
|
|
1577
1605
|
if (v === "") {
|
|
1578
|
-
s(m),
|
|
1606
|
+
s(m), u(o != null && o.toLowerCase().includes("width") ? "%" : oe(c));
|
|
1579
1607
|
return;
|
|
1580
1608
|
}
|
|
1581
|
-
|
|
1582
|
-
}, [
|
|
1583
|
-
const
|
|
1609
|
+
u(v), s(v === "class" || b(m) ? "" : m);
|
|
1610
|
+
}, [i, o, c]);
|
|
1611
|
+
const _ = ue((m) => a(m), [a], We), D = ue((m) => a(m, !1), [a], We), L = H(
|
|
1584
1612
|
(m = !1) => {
|
|
1585
|
-
const v = Ze(`${
|
|
1613
|
+
const v = Ze(`${n}`, c);
|
|
1586
1614
|
if (g(v, "error", !1)) {
|
|
1587
|
-
|
|
1615
|
+
x(!0);
|
|
1588
1616
|
return;
|
|
1589
1617
|
}
|
|
1590
|
-
const
|
|
1591
|
-
if (
|
|
1592
|
-
|
|
1618
|
+
const N = g(v, "unit") !== "" ? g(v, "unit") : p;
|
|
1619
|
+
if (N === "auto" || N === "none") {
|
|
1620
|
+
_(`${d}${N}`);
|
|
1593
1621
|
return;
|
|
1594
1622
|
}
|
|
1595
1623
|
if (g(v, "value") === "")
|
|
1596
1624
|
return;
|
|
1597
|
-
const Q = `${g(v, "value", "").startsWith("-") ? "-" : ""}${d}[${g(v, "value", "").replace("-", "")}${
|
|
1598
|
-
m ?
|
|
1625
|
+
const Q = `${g(v, "value", "").startsWith("-") ? "-" : ""}${d}[${g(v, "value", "").replace("-", "")}${N === "-" ? "" : N}]`;
|
|
1626
|
+
m ? D(Q) : _(Q);
|
|
1599
1627
|
},
|
|
1600
|
-
[
|
|
1601
|
-
),
|
|
1628
|
+
[_, D, n, p, d, c]
|
|
1629
|
+
), K = H(
|
|
1602
1630
|
(m) => {
|
|
1603
|
-
const v = Ze(`${
|
|
1631
|
+
const v = Ze(`${n}`, c);
|
|
1604
1632
|
if (g(v, "error", !1)) {
|
|
1605
|
-
|
|
1633
|
+
x(!0);
|
|
1606
1634
|
return;
|
|
1607
1635
|
}
|
|
1608
1636
|
if (m === "auto" || m === "none") {
|
|
1609
|
-
|
|
1637
|
+
_(`${d}${m}`);
|
|
1610
1638
|
return;
|
|
1611
1639
|
}
|
|
1612
1640
|
if (g(v, "value") === "")
|
|
1613
1641
|
return;
|
|
1614
|
-
const
|
|
1615
|
-
|
|
1642
|
+
const N = g(v, "unit") !== "" ? g(v, "unit") : m, Q = `${g(v, "value", "").startsWith("-") ? "-" : ""}${d}[${g(v, "value", "").replace("-", "")}${N === "-" ? "" : N}]`;
|
|
1643
|
+
_(Q);
|
|
1616
1644
|
},
|
|
1617
|
-
[
|
|
1645
|
+
[_, n, d, c]
|
|
1618
1646
|
);
|
|
1619
1647
|
return /* @__PURE__ */ e.jsx("div", { className: "flex w-full flex-col", children: /* @__PURE__ */ e.jsx("div", { className: "flex items-center justify-start", children: p === "class" ? /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
1620
|
-
/* @__PURE__ */ e.jsx("input", { className: "w-20 rounded py-1", readOnly: !0, value:
|
|
1621
|
-
/* @__PURE__ */ e.jsxs(
|
|
1622
|
-
/* @__PURE__ */ e.jsx(
|
|
1623
|
-
/* @__PURE__ */ e.jsx(
|
|
1648
|
+
/* @__PURE__ */ e.jsx("input", { className: "w-20 rounded py-1", readOnly: !0, value: i }),
|
|
1649
|
+
/* @__PURE__ */ e.jsxs($, { children: [
|
|
1650
|
+
/* @__PURE__ */ e.jsx(A, { 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(He, {}) }) }),
|
|
1651
|
+
/* @__PURE__ */ e.jsx(M, { children: "Current value is using a Tailwind preset class." })
|
|
1624
1652
|
] })
|
|
1625
|
-
] }) : /* @__PURE__ */ e.jsxs("div", { className: `group relative flex items-center ${
|
|
1653
|
+
] }) : /* @__PURE__ */ e.jsxs("div", { className: `group relative flex items-center ${P ? "z-auto" : ""}`, children: [
|
|
1626
1654
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center rounded-md border border-border", children: [
|
|
1627
1655
|
["none", "auto"].indexOf(p) !== -1 ? null : /* @__PURE__ */ e.jsx(
|
|
1628
1656
|
"input",
|
|
1629
1657
|
{
|
|
1630
1658
|
readOnly: p === "class",
|
|
1631
1659
|
onKeyPress: (m) => {
|
|
1632
|
-
m.key === "Enter" &&
|
|
1660
|
+
m.key === "Enter" && L();
|
|
1633
1661
|
},
|
|
1634
1662
|
onKeyDown: (m) => {
|
|
1635
1663
|
if (m.keyCode !== 38 && m.keyCode !== 40)
|
|
1636
1664
|
return;
|
|
1637
|
-
m.preventDefault(),
|
|
1638
|
-
const v =
|
|
1639
|
-
let
|
|
1640
|
-
m.keyCode === 38 && (
|
|
1641
|
-
const Z = `${
|
|
1642
|
-
|
|
1665
|
+
m.preventDefault(), k(!0);
|
|
1666
|
+
const v = Rt(m.target.value);
|
|
1667
|
+
let N = Je(v) ? 0 : v;
|
|
1668
|
+
m.keyCode === 38 && (N += 1), m.keyCode === 40 && (N -= 1);
|
|
1669
|
+
const Z = `${N}`, bt = `${Z.startsWith("-") ? "-" : ""}${d}[${Z.replace("-", "")}${p === "-" ? "" : p}]`;
|
|
1670
|
+
D(bt);
|
|
1643
1671
|
},
|
|
1644
1672
|
onKeyUp: (m) => {
|
|
1645
|
-
|
|
1673
|
+
U && (m.preventDefault(), k(!1));
|
|
1646
1674
|
},
|
|
1647
|
-
onBlur: () =>
|
|
1675
|
+
onBlur: () => L(),
|
|
1648
1676
|
onChange: (m) => {
|
|
1649
|
-
|
|
1677
|
+
x(!1), s(m.target.value);
|
|
1650
1678
|
},
|
|
1651
1679
|
onClick: (m) => {
|
|
1652
1680
|
var v;
|
|
1653
1681
|
(v = m == null ? void 0 : m.target) == null || v.select(), t(!1);
|
|
1654
1682
|
},
|
|
1655
|
-
value:
|
|
1683
|
+
value: P ? f : n,
|
|
1656
1684
|
className: "h-6 w-14 rounded rounded-r-none bg-background pl-2 text-sm focus-visible:outline-0 ".concat(
|
|
1657
1685
|
" ",
|
|
1658
1686
|
y ? "border-red-500 text-red-500" : "border-foreground/20"
|
|
1659
1687
|
)
|
|
1660
1688
|
}
|
|
1661
1689
|
),
|
|
1662
|
-
/* @__PURE__ */ e.jsxs(
|
|
1663
|
-
/* @__PURE__ */ e.jsx(
|
|
1690
|
+
/* @__PURE__ */ e.jsxs($, { open: l, delayDuration: 100, children: [
|
|
1691
|
+
/* @__PURE__ */ e.jsx(A, { asChild: !0, children: /* @__PURE__ */ e.jsxs(
|
|
1664
1692
|
"button",
|
|
1665
1693
|
{
|
|
1666
1694
|
type: "button",
|
|
@@ -1668,40 +1696,40 @@ const bs = (r) => {
|
|
|
1668
1696
|
className: "flex h-6 cursor-pointer items-center gap-x-1 rounded rounded-l-none bg-background p-px px-1 text-[11px] uppercase",
|
|
1669
1697
|
children: [
|
|
1670
1698
|
/* @__PURE__ */ e.jsx("span", { className: `inline-block ${c.length === 1 ? "px-2 font-semibold" : ""}`, children: p }),
|
|
1671
|
-
c.length > 1 ? /* @__PURE__ */ e.jsx(
|
|
1699
|
+
c.length > 1 ? /* @__PURE__ */ e.jsx(Gt, {}) : null
|
|
1672
1700
|
]
|
|
1673
1701
|
}
|
|
1674
1702
|
) }),
|
|
1675
|
-
/* @__PURE__ */ e.jsx(
|
|
1676
|
-
|
|
1703
|
+
/* @__PURE__ */ e.jsx(kr, { children: /* @__PURE__ */ e.jsx(M, { className: "bg-background", children: /* @__PURE__ */ e.jsx(
|
|
1704
|
+
ws,
|
|
1677
1705
|
{
|
|
1678
1706
|
units: c,
|
|
1679
1707
|
current: p,
|
|
1680
1708
|
onSelect: (m) => {
|
|
1681
|
-
t(!1),
|
|
1709
|
+
t(!1), u(m), K(m);
|
|
1682
1710
|
}
|
|
1683
1711
|
}
|
|
1684
1712
|
) }) })
|
|
1685
1713
|
] })
|
|
1686
1714
|
] }),
|
|
1687
|
-
["none", "auto"].indexOf(p) !== -1 ||
|
|
1688
|
-
|
|
1715
|
+
["none", "auto"].indexOf(p) !== -1 || P ? null : /* @__PURE__ */ e.jsx(
|
|
1716
|
+
js,
|
|
1689
1717
|
{
|
|
1690
|
-
onDragStart: () =>
|
|
1718
|
+
onDragStart: () => E(!0),
|
|
1691
1719
|
onDragEnd: (m) => {
|
|
1692
|
-
if (j(() => ""),
|
|
1720
|
+
if (j(() => ""), E(!1), b(m))
|
|
1693
1721
|
return;
|
|
1694
1722
|
const v = `${m}`, Z = `${v.startsWith("-") ? "-" : ""}${d}[${v.replace("-", "")}${p === "-" ? "" : p}]`;
|
|
1695
|
-
|
|
1723
|
+
_(Z);
|
|
1696
1724
|
},
|
|
1697
1725
|
onDrag: (m) => {
|
|
1698
1726
|
if (b(m))
|
|
1699
1727
|
return;
|
|
1700
1728
|
j(m);
|
|
1701
1729
|
const v = `${m}`, Z = `${v.startsWith("-") ? "-" : ""}${d}[${v.replace("-", "")}${p === "-" ? "" : p}]`;
|
|
1702
|
-
|
|
1730
|
+
D(Z);
|
|
1703
1731
|
},
|
|
1704
|
-
currentValue:
|
|
1732
|
+
currentValue: n,
|
|
1705
1733
|
unit: p,
|
|
1706
1734
|
negative: h,
|
|
1707
1735
|
cssProperty: o
|
|
@@ -1709,9 +1737,9 @@ const bs = (r) => {
|
|
|
1709
1737
|
)
|
|
1710
1738
|
] }) }) });
|
|
1711
1739
|
}, ie = (r) => {
|
|
1712
|
-
const l =
|
|
1713
|
-
return
|
|
1714
|
-
},
|
|
1740
|
+
const l = he();
|
|
1741
|
+
return Vt(l, { property: r });
|
|
1742
|
+
}, ks = (r, l) => {
|
|
1715
1743
|
const t = {
|
|
1716
1744
|
xs: 0,
|
|
1717
1745
|
sm: 1,
|
|
@@ -1721,7 +1749,7 @@ const bs = (r) => {
|
|
|
1721
1749
|
"2xl": 5
|
|
1722
1750
|
};
|
|
1723
1751
|
return t[g(r, "mq", "xs")] <= t[l];
|
|
1724
|
-
},
|
|
1752
|
+
}, Ns = {
|
|
1725
1753
|
width: "w-",
|
|
1726
1754
|
height: "h-",
|
|
1727
1755
|
minWidth: "min-w-",
|
|
@@ -1794,57 +1822,57 @@ const bs = (r) => {
|
|
|
1794
1822
|
lg: "1024px",
|
|
1795
1823
|
xl: "1280px",
|
|
1796
1824
|
"2xl": "1536px"
|
|
1797
|
-
},
|
|
1798
|
-
const { t: l } =
|
|
1799
|
-
}, units: a, negative: d = !1 } = r, [o] =
|
|
1800
|
-
(
|
|
1801
|
-
const
|
|
1802
|
-
(o || c !== "") && (
|
|
1803
|
-
const m =
|
|
1804
|
-
x
|
|
1825
|
+
}, _s = (r) => `${r.toUpperCase()} ${Ue[r] ? `(${Ue[r]} & up)` : ""}`, Ie = (r) => {
|
|
1826
|
+
const { t: l } = X(), { type: t = "icons", label: n, property: s, onEmitChange: i = () => {
|
|
1827
|
+
}, units: a, negative: d = !1 } = r, [o] = Nr(), [c] = ct(), [, h] = Me(), p = ie(s), u = De(), y = ot(), [x] = nt(), f = S(() => g(p, "fullCls", ""), [p]), j = H(
|
|
1828
|
+
(D, L = !0) => {
|
|
1829
|
+
const K = { dark: o, mq: h, mod: c, cls: D, property: s, fullCls: "" };
|
|
1830
|
+
(o || c !== "") && (K.mq = "xs");
|
|
1831
|
+
const m = es(K);
|
|
1832
|
+
u(x, [m], L);
|
|
1805
1833
|
},
|
|
1806
|
-
[
|
|
1807
|
-
),
|
|
1808
|
-
y(
|
|
1809
|
-
}, [
|
|
1810
|
-
|
|
1811
|
-
|
|
1812
|
-
}, [
|
|
1813
|
-
const [, ,
|
|
1814
|
-
(
|
|
1815
|
-
|
|
1834
|
+
[x, o, h, c, s, u]
|
|
1835
|
+
), P = H(() => {
|
|
1836
|
+
y(x, [f]);
|
|
1837
|
+
}, [x, f, y]), E = S(() => ks(p, h), [p, h]);
|
|
1838
|
+
z(() => {
|
|
1839
|
+
i(E, p);
|
|
1840
|
+
}, [E, i, p]);
|
|
1841
|
+
const [, , U] = Me(), k = H(
|
|
1842
|
+
(D) => {
|
|
1843
|
+
U({
|
|
1816
1844
|
xs: 400,
|
|
1817
1845
|
sm: 640,
|
|
1818
1846
|
md: 800,
|
|
1819
1847
|
lg: 1024,
|
|
1820
1848
|
xl: 1420,
|
|
1821
1849
|
"2xl": 1920
|
|
1822
|
-
}[
|
|
1850
|
+
}[D]);
|
|
1823
1851
|
},
|
|
1824
|
-
[
|
|
1825
|
-
),
|
|
1826
|
-
return /* @__PURE__ */ e.jsx(
|
|
1827
|
-
/* @__PURE__ */ e.jsx("div", { className: "relative w-[70px] truncate text-xs text-foreground", children: /* @__PURE__ */ e.jsx("span", { className: `text-[11px] ${p && !
|
|
1852
|
+
[U]
|
|
1853
|
+
), _ = g(p, "dark", null) === o && g(p, "mod", null) === c && g(p, "mq", null) === h;
|
|
1854
|
+
return /* @__PURE__ */ e.jsx(xs, { canChange: E, canReset: p && _, children: /* @__PURE__ */ e.jsxs("div", { className: "group flex flex-row items-center py-2 first:pt-0 last:pb-0", children: [
|
|
1855
|
+
/* @__PURE__ */ e.jsx("div", { className: "relative w-[70px] truncate text-xs text-foreground", children: /* @__PURE__ */ e.jsx("span", { className: `text-[11px] ${p && !_ ? "text-foreground" : ""}`, children: l(n) }) }),
|
|
1828
1856
|
/* @__PURE__ */ e.jsxs("div", { className: "flex flex-row items-center", children: [
|
|
1829
1857
|
/* @__PURE__ */ e.jsxs("div", { className: "w-[150px]", children: [
|
|
1830
1858
|
t === "arbitrary" ? /* @__PURE__ */ e.jsx(
|
|
1831
|
-
|
|
1859
|
+
Cs,
|
|
1832
1860
|
{
|
|
1833
1861
|
currentClass: g(p, "cls", ""),
|
|
1834
|
-
classPrefix: g(
|
|
1862
|
+
classPrefix: g(Ns, s, ""),
|
|
1835
1863
|
units: a || [],
|
|
1836
1864
|
onChange: j,
|
|
1837
1865
|
negative: d,
|
|
1838
1866
|
cssProperty: s
|
|
1839
1867
|
}
|
|
1840
1868
|
) : null,
|
|
1841
|
-
t === "icons" && /* @__PURE__ */ e.jsx(
|
|
1842
|
-
t === "range" && /* @__PURE__ */ e.jsx(
|
|
1843
|
-
t === "color" && /* @__PURE__ */ e.jsx(
|
|
1844
|
-
t === "dropdown" && /* @__PURE__ */ e.jsx(
|
|
1869
|
+
t === "icons" && /* @__PURE__ */ e.jsx(hs, { property: s, onChange: j }),
|
|
1870
|
+
t === "range" && /* @__PURE__ */ e.jsx(gs, { property: s, onChange: j }),
|
|
1871
|
+
t === "color" && /* @__PURE__ */ e.jsx(ms, { property: s, onChange: j }),
|
|
1872
|
+
t === "dropdown" && /* @__PURE__ */ e.jsx(ht, { label: n, property: s, onChange: j })
|
|
1845
1873
|
] }),
|
|
1846
|
-
/* @__PURE__ */ e.jsx("div", { className: `w-[30px] cursor-pointer ${f ? "visible" : "invisible"}`, children:
|
|
1847
|
-
/* @__PURE__ */ e.jsx(
|
|
1874
|
+
/* @__PURE__ */ e.jsx("div", { className: `w-[30px] cursor-pointer ${f ? "visible" : "invisible"}`, children: _ ? /* @__PURE__ */ e.jsx("button", { type: "button", onClick: () => P(), title: "Reset", className: "flex px-1.5 text-xs", children: /* @__PURE__ */ e.jsx(qt, { className: "h-5 w-5 text-blue-500 hover:opacity-80" }) }) : E && p ? /* @__PURE__ */ e.jsxs($, { delayDuration: 100, children: [
|
|
1875
|
+
/* @__PURE__ */ e.jsx(A, { asChild: !0, children: /* @__PURE__ */ e.jsx(
|
|
1848
1876
|
"button",
|
|
1849
1877
|
{
|
|
1850
1878
|
type: "button",
|
|
@@ -1852,10 +1880,10 @@ const bs = (r) => {
|
|
|
1852
1880
|
children: /* @__PURE__ */ e.jsx(He, {})
|
|
1853
1881
|
}
|
|
1854
1882
|
) }),
|
|
1855
|
-
/* @__PURE__ */ e.jsx(
|
|
1883
|
+
/* @__PURE__ */ e.jsx(M, { children: /* @__PURE__ */ e.jsx("div", { className: "text-right", children: /* @__PURE__ */ e.jsxs("div", { children: [
|
|
1856
1884
|
"Current style is set at ",
|
|
1857
1885
|
/* @__PURE__ */ e.jsxs("span", { className: "font-bold", children: [
|
|
1858
|
-
|
|
1886
|
+
_s(g(p, "mq")),
|
|
1859
1887
|
o && !p.dark ? "(Light mode)" : ""
|
|
1860
1888
|
] }),
|
|
1861
1889
|
/* @__PURE__ */ e.jsx("br", {}),
|
|
@@ -1863,7 +1891,7 @@ const bs = (r) => {
|
|
|
1863
1891
|
"button",
|
|
1864
1892
|
{
|
|
1865
1893
|
type: "button",
|
|
1866
|
-
onClick: () =>
|
|
1894
|
+
onClick: () => k(g(p, "mq")),
|
|
1867
1895
|
className: "block w-full cursor-default text-right font-semibold text-blue-500",
|
|
1868
1896
|
children: [
|
|
1869
1897
|
"Switch to ",
|
|
@@ -1875,40 +1903,40 @@ const bs = (r) => {
|
|
|
1875
1903
|
] }) : null })
|
|
1876
1904
|
] })
|
|
1877
1905
|
] }) });
|
|
1878
|
-
},
|
|
1906
|
+
}, Ss = ["px", "%", "em", "rem", "ch", "vh", "vw"], mt = ({
|
|
1879
1907
|
label: r,
|
|
1880
1908
|
options: l,
|
|
1881
1909
|
borderB: t = !1,
|
|
1882
|
-
borderT:
|
|
1910
|
+
borderT: n = !1,
|
|
1883
1911
|
type: s = "arbitrary",
|
|
1884
|
-
units:
|
|
1912
|
+
units: i = Ss,
|
|
1885
1913
|
negative: a = !1
|
|
1886
1914
|
}) => {
|
|
1887
|
-
const { t: d } =
|
|
1915
|
+
const { t: d } = X(), [o, c] = w(l[0].key), h = he(), p = H((u) => C(h, "property").includes(u), [h]);
|
|
1888
1916
|
return /* @__PURE__ */ e.jsxs(
|
|
1889
1917
|
"div",
|
|
1890
1918
|
{
|
|
1891
|
-
className: `mb-2 border-gray-800 py-2 first:pt-0 last:pb-0 ${t ? "border-b" : ""} ${
|
|
1919
|
+
className: `mb-2 border-gray-800 py-2 first:pt-0 last:pb-0 ${t ? "border-b" : ""} ${n ? "border-t" : ""}`,
|
|
1892
1920
|
children: [
|
|
1893
1921
|
/* @__PURE__ */ e.jsxs("div", { className: "flex flex-row text-xs", children: [
|
|
1894
1922
|
r && /* @__PURE__ */ e.jsx("span", { className: "relative w-[70px] flex-none text-xs text-foreground", children: d(r) }),
|
|
1895
|
-
/* @__PURE__ */ e.jsx("div", { className: "mb-3 flex grow flex-row flex-wrap gap-x-px", children:
|
|
1896
|
-
l.map(({ label:
|
|
1897
|
-
/* @__PURE__ */ e.jsx(
|
|
1923
|
+
/* @__PURE__ */ e.jsx("div", { className: "mb-3 flex grow flex-row flex-wrap gap-x-px", children: I.Children.toArray(
|
|
1924
|
+
l.map(({ label: u, key: y }) => /* @__PURE__ */ e.jsx("div", { className: "first:rounded-l last:rounded-r", children: /* @__PURE__ */ e.jsxs($, { children: [
|
|
1925
|
+
/* @__PURE__ */ e.jsx(A, { asChild: !0, children: /* @__PURE__ */ e.jsxs(
|
|
1898
1926
|
"button",
|
|
1899
1927
|
{
|
|
1900
1928
|
type: "button",
|
|
1901
1929
|
onClick: () => c(y),
|
|
1902
1930
|
className: `relative cursor-pointer rounded-full p-1 text-[8px] ${y === o ? " bg-[#3E57F0] text-white" : "text-gray-600 dark:text-gray-300"}`,
|
|
1903
1931
|
children: [
|
|
1904
|
-
|
|
1932
|
+
I.createElement("div", {
|
|
1905
1933
|
className: p(y) ? "-bottom-1.5 absolute bg-[#3E57F0] h-[2px] left-0 w-full" : ""
|
|
1906
1934
|
}),
|
|
1907
|
-
|
|
1935
|
+
I.createElement(g(gt, y, tt), { className: "text-inherit w-3 h-3" })
|
|
1908
1936
|
]
|
|
1909
1937
|
}
|
|
1910
1938
|
) }),
|
|
1911
|
-
/* @__PURE__ */ e.jsx(
|
|
1939
|
+
/* @__PURE__ */ e.jsx(M, { children: Y(le(u)) })
|
|
1912
1940
|
] }) }))
|
|
1913
1941
|
) })
|
|
1914
1942
|
] }),
|
|
@@ -1916,7 +1944,7 @@ const bs = (r) => {
|
|
|
1916
1944
|
Ie,
|
|
1917
1945
|
{
|
|
1918
1946
|
type: s,
|
|
1919
|
-
units: [...
|
|
1947
|
+
units: [...i],
|
|
1920
1948
|
label: "",
|
|
1921
1949
|
property: o,
|
|
1922
1950
|
negative: a
|
|
@@ -1925,15 +1953,15 @@ const bs = (r) => {
|
|
|
1925
1953
|
]
|
|
1926
1954
|
}
|
|
1927
1955
|
);
|
|
1928
|
-
},
|
|
1929
|
-
const { t } =
|
|
1930
|
-
const
|
|
1931
|
-
o.map((c) => c.styleType === "multiple" ?
|
|
1932
|
-
), a =
|
|
1933
|
-
l.map((o) => o.styleType === "accordion" ?
|
|
1934
|
-
), d =
|
|
1956
|
+
}, Ts = ({ heading: r, items: l }) => {
|
|
1957
|
+
const { t } = X(), n = he(), s = S(() => {
|
|
1958
|
+
const i = (o) => J(
|
|
1959
|
+
o.map((c) => c.styleType === "multiple" ? C(c.options, "key") : c.property)
|
|
1960
|
+
), a = J(
|
|
1961
|
+
l.map((o) => o.styleType === "accordion" ? i(o.items) : o.styleType === "multiple" ? C(o.options, "key") : o.property)
|
|
1962
|
+
), d = C(n, "property");
|
|
1935
1963
|
return Qe(a, d).length > 0;
|
|
1936
|
-
}, [
|
|
1964
|
+
}, [n, l]);
|
|
1937
1965
|
return /* @__PURE__ */ e.jsxs("details", { children: [
|
|
1938
1966
|
/* @__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: [
|
|
1939
1967
|
t(r),
|
|
@@ -1944,10 +1972,10 @@ const bs = (r) => {
|
|
|
1944
1972
|
}
|
|
1945
1973
|
) : null
|
|
1946
1974
|
] }) }),
|
|
1947
|
-
/* @__PURE__ */ e.jsx("div", { className: "p-2", children: l.map((
|
|
1975
|
+
/* @__PURE__ */ e.jsx("div", { className: "p-2", children: l.map((i) => i.styleType === "multiple" ? /* @__PURE__ */ e.jsx(mt, { ...i }, i.label) : /* @__PURE__ */ e.jsx(Ie, { ...i }, i.label)) })
|
|
1948
1976
|
] });
|
|
1949
|
-
},
|
|
1950
|
-
const { t: l } =
|
|
1977
|
+
}, Rs = Ke({}), fe = ({ section: r }) => {
|
|
1978
|
+
const { t: l } = X(), t = he(), n = H(
|
|
1951
1979
|
(a = []) => {
|
|
1952
1980
|
const d = {};
|
|
1953
1981
|
for (let c = 0; c < t.length; c++)
|
|
@@ -1961,75 +1989,75 @@ const bs = (r) => {
|
|
|
1961
1989
|
return o;
|
|
1962
1990
|
},
|
|
1963
1991
|
[t]
|
|
1964
|
-
), s =
|
|
1992
|
+
), s = S(() => {
|
|
1965
1993
|
if (t.length > 0 && r.heading === "classes.heading")
|
|
1966
1994
|
return !0;
|
|
1967
|
-
const a = (c) =>
|
|
1968
|
-
c.map((h) => h.styleType === "multiple" ?
|
|
1969
|
-
), d =
|
|
1970
|
-
r.items.map((c) => c.styleType === "accordion" ? a(c.items) : c.styleType === "multiple" ?
|
|
1971
|
-
), o =
|
|
1995
|
+
const a = (c) => J(
|
|
1996
|
+
c.map((h) => h.styleType === "multiple" ? J(C(h.options, "key")) : h.property)
|
|
1997
|
+
), d = J(
|
|
1998
|
+
r.items.map((c) => c.styleType === "accordion" ? a(c.items) : c.styleType === "multiple" ? J(C(c.options, "key")) : c.property)
|
|
1999
|
+
), o = C(t, "property");
|
|
1972
2000
|
return Qe(d, o).length > 0;
|
|
1973
|
-
}, [t, r.heading, r.items]),
|
|
1974
|
-
return /* @__PURE__ */ e.jsx(
|
|
2001
|
+
}, [t, r.heading, r.items]), i = S(() => ({}), []);
|
|
2002
|
+
return /* @__PURE__ */ e.jsx(Rs.Provider, { value: i, children: /* @__PURE__ */ e.jsxs(Ce, { value: r.heading, children: [
|
|
1975
2003
|
/* @__PURE__ */ e.jsx(ke, { className: "px-3 py-2 text-xs hover:no-underline", children: /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-x-2", children: [
|
|
1976
2004
|
/* @__PURE__ */ e.jsx("div", { className: `h-[8px] w-[8px] rounded-full ${s ? "bg-blue-500" : "bg-gray-300"}` }),
|
|
1977
2005
|
l(r.heading)
|
|
1978
2006
|
] }) }),
|
|
1979
|
-
/* @__PURE__ */ e.jsx(Ne, { className: "bg-gray-100 px-3.5 py-2", children:
|
|
1980
|
-
r.items.map((a) => ce(a, "component") ?
|
|
2007
|
+
/* @__PURE__ */ e.jsx(Ne, { className: "bg-gray-100 px-3.5 py-2", children: I.Children.toArray(
|
|
2008
|
+
r.items.map((a) => ce(a, "component") ? I.createElement(a.component, { key: a.label }) : ce(a, "styleType") ? a.styleType === "multiple" ? /* @__PURE__ */ e.jsx(mt, { ...a }, a.label) : a.styleType === "accordion" && n(a == null ? void 0 : a.conditions) ? /* @__PURE__ */ e.jsx(Ts, { ...a }, a.label) : null : /* @__PURE__ */ e.jsx(Ie, { ...a }, a.label))
|
|
1981
2009
|
) })
|
|
1982
2010
|
] }) });
|
|
1983
|
-
},
|
|
1984
|
-
const r =
|
|
1985
|
-
if (b(
|
|
2011
|
+
}, Vs = () => {
|
|
2012
|
+
const r = q(), [l] = ge(), { t } = X(), n = zr(), s = De(), i = Pe(r._type), a = g(oe(l), "prop"), d = g(i.props, `${a}.presets`, {});
|
|
2013
|
+
if (b(n) && (!ce(i, "props") || b(d)))
|
|
1986
2014
|
return null;
|
|
1987
2015
|
const o = (c) => {
|
|
1988
2016
|
const h = c.trim().toLowerCase().replace(/ +(?= )/g, "").split(" ");
|
|
1989
2017
|
s([r._id], h, !0);
|
|
1990
2018
|
};
|
|
1991
|
-
return /* @__PURE__ */ e.jsx("div", { className: "h-10", children: /* @__PURE__ */ e.jsxs(
|
|
1992
|
-
/* @__PURE__ */ e.jsx(
|
|
2019
|
+
return /* @__PURE__ */ e.jsx("div", { className: "h-10", children: /* @__PURE__ */ e.jsxs(_r, { children: [
|
|
2020
|
+
/* @__PURE__ */ e.jsx(Sr, { asChild: !0, children: /* @__PURE__ */ e.jsx("div", { className: "px-4", children: /* @__PURE__ */ e.jsxs(G, { variant: "default", className: "w-full", size: "sm", children: [
|
|
1993
2021
|
t("Apply Presets"),
|
|
1994
|
-
/* @__PURE__ */ e.jsx(
|
|
2022
|
+
/* @__PURE__ */ e.jsx(Jt, {})
|
|
1995
2023
|
] }) }) }),
|
|
1996
|
-
/* @__PURE__ */ e.jsx(
|
|
2024
|
+
/* @__PURE__ */ e.jsx(Tr, { className: "max-h-80 w-56", children: /* @__PURE__ */ e.jsxs(Be, { className: "no-scrollbar h-full", children: [
|
|
1997
2025
|
b(d) ? null : /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
1998
2026
|
/* @__PURE__ */ e.jsxs(Ee, { children: [
|
|
1999
|
-
|
|
2027
|
+
i.type,
|
|
2000
2028
|
" ",
|
|
2001
2029
|
t("presets")
|
|
2002
2030
|
] }),
|
|
2003
2031
|
/* @__PURE__ */ e.jsx(Le, {}),
|
|
2004
2032
|
/* @__PURE__ */ e.jsx(Oe, { children: je(d).map((c) => /* @__PURE__ */ e.jsxs(Fe, { className: "group text-xs", onClick: () => o(d[c]), children: [
|
|
2005
|
-
we(
|
|
2033
|
+
we(Y(t(c))),
|
|
2006
2034
|
/* @__PURE__ */ e.jsx(Ye, { className: "invisible hover:font-bold hover:text-blue-600 group-hover:visible", children: t("apply") })
|
|
2007
2035
|
] })) })
|
|
2008
2036
|
] }),
|
|
2009
|
-
b(
|
|
2037
|
+
b(n) ? null : /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
2010
2038
|
/* @__PURE__ */ e.jsx(Ee, { children: t("Global presets") }),
|
|
2011
2039
|
/* @__PURE__ */ e.jsx(Le, {}),
|
|
2012
|
-
/* @__PURE__ */ e.jsx(Oe, { children: je(
|
|
2013
|
-
we(
|
|
2040
|
+
/* @__PURE__ */ e.jsx(Oe, { children: je(n).map((c) => /* @__PURE__ */ e.jsxs(Fe, { className: "group text-xs", onClick: () => o(n[c]), children: [
|
|
2041
|
+
we(Y(t(c))),
|
|
2014
2042
|
/* @__PURE__ */ e.jsx(Ye, { className: "invisible hover:font-bold hover:text-blue-600 group-hover:visible", children: t("apply") })
|
|
2015
2043
|
] })) })
|
|
2016
2044
|
] })
|
|
2017
2045
|
] }) })
|
|
2018
2046
|
] }) });
|
|
2019
2047
|
};
|
|
2020
|
-
function
|
|
2021
|
-
const [r, l] =
|
|
2048
|
+
function Hs() {
|
|
2049
|
+
const [r, l] = ct(), { flexChild: t, gridChild: n } = Rr(), { t: s } = X(), i = Vr(), [a] = ge();
|
|
2022
2050
|
return b(a) ? /* @__PURE__ */ e.jsx("div", { className: "p-4 text-center", children: /* @__PURE__ */ e.jsxs("div", { className: "space-y-4 rounded-xl p-4", children: [
|
|
2023
2051
|
/* @__PURE__ */ e.jsx(rt, { className: "mx-auto text-3xl" }),
|
|
2024
2052
|
/* @__PURE__ */ e.jsx("h1", { children: s("no_styling_block_selected") })
|
|
2025
2053
|
] }) }) : /* @__PURE__ */ e.jsxs("div", { className: "flex h-full flex-col", children: [
|
|
2026
|
-
/* @__PURE__ */ e.jsx(
|
|
2054
|
+
/* @__PURE__ */ e.jsx(Vs, {}),
|
|
2027
2055
|
/* @__PURE__ */ e.jsx("div", { className: "flex h-12 flex-col space-x-4 px-4 py-1", children: /* @__PURE__ */ e.jsxs("div", { className: "flex items-center justify-end gap-x-1.5", children: [
|
|
2028
|
-
/* @__PURE__ */ e.jsx(
|
|
2029
|
-
/* @__PURE__ */ e.jsxs(
|
|
2030
|
-
/* @__PURE__ */ e.jsx(
|
|
2031
|
-
/* @__PURE__ */ e.jsxs(
|
|
2032
|
-
|
|
2056
|
+
/* @__PURE__ */ e.jsx(dt, { htmlFor: "", className: "flex gap-x-1.5 text-xs italic", children: "State" }),
|
|
2057
|
+
/* @__PURE__ */ e.jsxs(Hr, { defaultValue: r, onValueChange: (d) => l(d), children: [
|
|
2058
|
+
/* @__PURE__ */ e.jsx(Dr, { className: "h-auto w-fit p-1 px-3", children: /* @__PURE__ */ e.jsx(Br, { placeholder: s("State") }) }),
|
|
2059
|
+
/* @__PURE__ */ e.jsxs(Pr, { children: [
|
|
2060
|
+
C(i, (d, o) => /* @__PURE__ */ e.jsx(V, { value: o, children: s(d) }, o)),
|
|
2033
2061
|
/* @__PURE__ */ e.jsx("hr", {}),
|
|
2034
2062
|
/* @__PURE__ */ e.jsx(V, { value: "", children: s("Normal") }),
|
|
2035
2063
|
/* @__PURE__ */ e.jsx(V, { value: "hover", children: s("Hover") }),
|
|
@@ -2047,32 +2075,32 @@ function Vs() {
|
|
|
2047
2075
|
] })
|
|
2048
2076
|
] }) }),
|
|
2049
2077
|
r !== "" ? /* @__PURE__ */ e.jsxs("div", { className: "m-1 flex items-center space-x-1 rounded border border-orange-500 bg-orange-200 p-px px-2 text-xs text-orange-900", children: [
|
|
2050
|
-
/* @__PURE__ */ e.jsx(
|
|
2078
|
+
/* @__PURE__ */ e.jsx(Or, { className: "w-3" }),
|
|
2051
2079
|
/* @__PURE__ */ e.jsx("span", { children: s(`Styles will be applied for (:${r}) state`) })
|
|
2052
2080
|
] }) : null,
|
|
2053
2081
|
/* @__PURE__ */ e.jsx(Be, { className: "no-scrollbar -mx-1 max-h-full flex-1 overflow-x-hidden overflow-y-hidden border-t border-border", children: /* @__PURE__ */ e.jsxs(at, { defaultValue: ["Layout"], type: "multiple", className: "w-full", children: [
|
|
2054
|
-
t && /* @__PURE__ */ e.jsx(
|
|
2055
|
-
|
|
2056
|
-
|
|
2082
|
+
t && /* @__PURE__ */ e.jsx(fe, { section: cs }),
|
|
2083
|
+
n ? /* @__PURE__ */ e.jsx(fe, { section: ps }) : null,
|
|
2084
|
+
us.map((d) => /* @__PURE__ */ e.jsx(fe, { section: d }, d.heading))
|
|
2057
2085
|
] }) })
|
|
2058
2086
|
] });
|
|
2059
2087
|
}
|
|
2060
|
-
const
|
|
2061
|
-
const { t: l } =
|
|
2062
|
-
b(t.key) || (r({ ...t, key:
|
|
2088
|
+
const Ds = ({ onAdd: r }) => {
|
|
2089
|
+
const { t: l } = X(), [t, n] = w({ key: "", value: "" }), s = () => {
|
|
2090
|
+
b(t.key) || (r({ ...t, key: Ht(t.key) }), n({ key: "", value: "" }));
|
|
2063
2091
|
};
|
|
2064
2092
|
return /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col gap-1 border-gray-200 px-1", children: [
|
|
2065
2093
|
/* @__PURE__ */ e.jsx(
|
|
2066
2094
|
_e,
|
|
2067
2095
|
{
|
|
2068
2096
|
name: "key",
|
|
2069
|
-
onChange: (
|
|
2097
|
+
onChange: (i) => n({ ...t, key: i.target.value }),
|
|
2070
2098
|
value: t.key,
|
|
2071
2099
|
placeholder: l("Name"),
|
|
2072
2100
|
autoComplete: "off",
|
|
2073
2101
|
autoCapitalize: "off",
|
|
2074
|
-
onKeyDown: (
|
|
2075
|
-
|
|
2102
|
+
onKeyDown: (i) => {
|
|
2103
|
+
i.key === "Enter" && (i.preventDefault(), b(t.key) || s());
|
|
2076
2104
|
}
|
|
2077
2105
|
}
|
|
2078
2106
|
),
|
|
@@ -2080,54 +2108,54 @@ const Hs = ({ onAdd: r }) => {
|
|
|
2080
2108
|
_e,
|
|
2081
2109
|
{
|
|
2082
2110
|
name: "value",
|
|
2083
|
-
onChange: (
|
|
2111
|
+
onChange: (i) => n({ ...t, value: i.target.value }),
|
|
2084
2112
|
value: t.value,
|
|
2085
2113
|
placeholder: l("Value"),
|
|
2086
2114
|
autoComplete: "off",
|
|
2087
2115
|
autoCapitalize: "off",
|
|
2088
|
-
onKeyDown: (
|
|
2089
|
-
|
|
2116
|
+
onKeyDown: (i) => {
|
|
2117
|
+
i.key === "Enter" && (i.preventDefault(), b(t.key) || s());
|
|
2090
2118
|
}
|
|
2091
2119
|
}
|
|
2092
2120
|
) }),
|
|
2093
2121
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-x-2", children: [
|
|
2094
|
-
/* @__PURE__ */ e.jsxs(
|
|
2122
|
+
/* @__PURE__ */ e.jsxs(G, { disabled: b(t.key), onClick: s, size: "sm", className: "flex items-center", children: [
|
|
2095
2123
|
/* @__PURE__ */ e.jsxs("span", { children: [
|
|
2096
2124
|
l("Add"),
|
|
2097
2125
|
" "
|
|
2098
2126
|
] }),
|
|
2099
2127
|
/* @__PURE__ */ e.jsx(Ve, {})
|
|
2100
2128
|
] }),
|
|
2101
|
-
b(t.key) ? null : /* @__PURE__ */ e.jsx(
|
|
2129
|
+
b(t.key) ? null : /* @__PURE__ */ e.jsx(G, { variant: "ghost", onClick: () => n({ key: "", value: "" }), children: l("Cancel") })
|
|
2102
2130
|
] })
|
|
2103
2131
|
] });
|
|
2104
|
-
},
|
|
2105
|
-
const r =
|
|
2132
|
+
}, Bs = () => {
|
|
2133
|
+
const r = q(), [l, t] = w([]), [n] = ge(), s = st(), i = lt(), { t: a } = X(), { toast: d } = it(), o = `${g(n, "0.prop")}_attrs`;
|
|
2106
2134
|
de.useEffect(() => {
|
|
2107
|
-
const
|
|
2108
|
-
b(
|
|
2135
|
+
const u = C(g(r, o), (y, x) => ({ key: x, value: y }));
|
|
2136
|
+
b(u) ? t([]) : t(u);
|
|
2109
2137
|
}, [g(r, o)]);
|
|
2110
|
-
const c = (
|
|
2111
|
-
const y = ve(l, (
|
|
2138
|
+
const c = (u) => {
|
|
2139
|
+
const y = ve(l, (x, f) => u !== f);
|
|
2112
2140
|
p(y);
|
|
2113
|
-
}, h = (
|
|
2114
|
-
const y = Ge(l, { key:
|
|
2141
|
+
}, h = (u) => {
|
|
2142
|
+
const y = Ge(l, { key: u.key });
|
|
2115
2143
|
if (y && (y.value.startsWith("dnd-") || y.value.startsWith("#dnd-"))) {
|
|
2116
2144
|
d({
|
|
2117
2145
|
title: a("Cannot add predefined attribute"),
|
|
2118
2146
|
variant: "destructive",
|
|
2119
|
-
description: a(`"(${
|
|
2147
|
+
description: a(`"(${u.key})" cannot be added as it is a predefined attribute for this block`)
|
|
2120
2148
|
});
|
|
2121
2149
|
return;
|
|
2122
2150
|
}
|
|
2123
|
-
const
|
|
2124
|
-
p(
|
|
2151
|
+
const x = [...l, u];
|
|
2152
|
+
p(x);
|
|
2125
2153
|
}, p = de.useCallback(
|
|
2126
|
-
(
|
|
2154
|
+
(u = []) => {
|
|
2127
2155
|
const y = {};
|
|
2128
|
-
Re(
|
|
2129
|
-
b(
|
|
2130
|
-
}),
|
|
2156
|
+
Re(u, (x) => {
|
|
2157
|
+
b(x.key) || qe(y, x.key, x.value);
|
|
2158
|
+
}), i([g(r, "_id")], { [o]: y });
|
|
2131
2159
|
},
|
|
2132
2160
|
[r, s, o]
|
|
2133
2161
|
);
|
|
@@ -2135,47 +2163,47 @@ const Hs = ({ onAdd: r }) => {
|
|
|
2135
2163
|
/* @__PURE__ */ e.jsx("div", { children: /* @__PURE__ */ e.jsxs("ul", { className: "overflow-hidden rounded-md bg-gray-100 p-2 text-xs text-gray-700", children: [
|
|
2136
2164
|
b(l) ? /* @__PURE__ */ e.jsx("li", { className: "flex h-16 items-center justify-center", children: /* @__PURE__ */ e.jsx("p", { children: a("No custom attributes added yet") }) }) : /* @__PURE__ */ e.jsx("li", { children: /* @__PURE__ */ e.jsx("span", { className: "font-bold", children: a("Attributes") }) }),
|
|
2137
2165
|
de.Children.toArray(
|
|
2138
|
-
|
|
2139
|
-
/* @__PURE__ */ e.jsxs(
|
|
2140
|
-
/* @__PURE__ */ e.jsx(
|
|
2141
|
-
|
|
2166
|
+
C(l, (u) => /* @__PURE__ */ e.jsxs("li", { className: "group flex max-w-full items-center justify-between", children: [
|
|
2167
|
+
/* @__PURE__ */ e.jsxs($, { delayDuration: 1e3, children: [
|
|
2168
|
+
/* @__PURE__ */ e.jsx(A, { asChild: !0, children: /* @__PURE__ */ e.jsxs("div", { className: "w-[90%] cursor-default truncate px-1 hover:bg-gray-200", children: [
|
|
2169
|
+
u.key,
|
|
2142
2170
|
" ",
|
|
2143
2171
|
/* @__PURE__ */ e.jsx("span", { className: "font-bold text-orange-500", children: "=" }),
|
|
2144
2172
|
" ",
|
|
2145
|
-
|
|
2173
|
+
u.value
|
|
2146
2174
|
] }) }),
|
|
2147
|
-
/* @__PURE__ */ e.jsxs(
|
|
2175
|
+
/* @__PURE__ */ e.jsxs(M, { className: "max-w-[200px]", children: [
|
|
2148
2176
|
/* @__PURE__ */ e.jsxs("div", { children: [
|
|
2149
2177
|
a("Name"),
|
|
2150
2178
|
": ",
|
|
2151
|
-
|
|
2179
|
+
u.key
|
|
2152
2180
|
] }),
|
|
2153
2181
|
/* @__PURE__ */ e.jsxs("div", { children: [
|
|
2154
2182
|
a("Value"),
|
|
2155
2183
|
": ",
|
|
2156
|
-
|
|
2184
|
+
u.value
|
|
2157
2185
|
] })
|
|
2158
2186
|
] })
|
|
2159
2187
|
] }),
|
|
2160
|
-
/* @__PURE__ */ e.jsxs(
|
|
2161
|
-
/* @__PURE__ */ e.jsx(
|
|
2188
|
+
/* @__PURE__ */ e.jsxs($, { children: [
|
|
2189
|
+
/* @__PURE__ */ e.jsx(A, { asChild: !0, children: /* @__PURE__ */ e.jsx(
|
|
2162
2190
|
"button",
|
|
2163
2191
|
{
|
|
2164
|
-
disabled: W(
|
|
2192
|
+
disabled: W(u.value, "dnd-"),
|
|
2165
2193
|
className: "invisible group-hover:visible",
|
|
2166
|
-
onClick: () => c(l.indexOf(
|
|
2167
|
-
children: /* @__PURE__ */ e.jsx(
|
|
2194
|
+
onClick: () => c(l.indexOf(u)),
|
|
2195
|
+
children: /* @__PURE__ */ e.jsx(Fr, { className: "w-4 text-gray-500" })
|
|
2168
2196
|
}
|
|
2169
2197
|
) }),
|
|
2170
|
-
/* @__PURE__ */ e.jsx(
|
|
2198
|
+
/* @__PURE__ */ e.jsx(M, { className: "max-w-[200px]", children: W(u.value, "dnd-") ? a("Predefined attribute. Cannot be deleted") : a("Remove attribute") })
|
|
2171
2199
|
] })
|
|
2172
2200
|
] }))
|
|
2173
2201
|
)
|
|
2174
2202
|
] }) }),
|
|
2175
2203
|
/* @__PURE__ */ e.jsx("div", { className: "py-2" }),
|
|
2176
|
-
/* @__PURE__ */ e.jsx(
|
|
2204
|
+
/* @__PURE__ */ e.jsx(Ds, { onAdd: (u) => h(u) })
|
|
2177
2205
|
] }) }) });
|
|
2178
|
-
},
|
|
2206
|
+
}, Ps = {
|
|
2179
2207
|
px: 1,
|
|
2180
2208
|
"%": 1,
|
|
2181
2209
|
em: 100,
|
|
@@ -2186,8 +2214,8 @@ const Hs = ({ onAdd: r }) => {
|
|
|
2186
2214
|
"-": 1,
|
|
2187
2215
|
deg: 1,
|
|
2188
2216
|
ms: 0.1
|
|
2189
|
-
},
|
|
2190
|
-
const r =
|
|
2217
|
+
}, Bl = () => {
|
|
2218
|
+
const r = q(), { t: l } = X(), [t, n] = I.useState(""), [s, i] = I.useState({
|
|
2191
2219
|
onDrag: (o) => o,
|
|
2192
2220
|
onDragEnd: (o) => o,
|
|
2193
2221
|
dragStartY: 0,
|
|
@@ -2196,20 +2224,20 @@ const Hs = ({ onAdd: r }) => {
|
|
|
2196
2224
|
dragUnit: "",
|
|
2197
2225
|
negative: !1,
|
|
2198
2226
|
cssProperty: ""
|
|
2199
|
-
}), a =
|
|
2227
|
+
}), a = ue(
|
|
2200
2228
|
(o) => {
|
|
2201
2229
|
const c = !g(s, "negative", !1), h = g(s, "cssProperty", "");
|
|
2202
2230
|
let p = parseFloat(s.dragStartValue);
|
|
2203
2231
|
p = Je(p) ? 0 : p;
|
|
2204
|
-
let
|
|
2205
|
-
(W(h, "scale") || h === "opacity") && (
|
|
2206
|
-
let
|
|
2207
|
-
c &&
|
|
2232
|
+
let u = Ps[s.dragUnit];
|
|
2233
|
+
(W(h, "scale") || h === "opacity") && (u = 10);
|
|
2234
|
+
let x = (s.dragStartY - o.pageY) / u + p;
|
|
2235
|
+
c && x < 0 && (x = 0), h === "opacity" && x > 1 && (x = 1), s.onDrag(`${x}`), n(`${x}`);
|
|
2208
2236
|
},
|
|
2209
2237
|
[s],
|
|
2210
2238
|
50
|
|
2211
2239
|
), d = H(() => {
|
|
2212
|
-
setTimeout(() => s.onDragEnd(`${t}`), 100),
|
|
2240
|
+
setTimeout(() => s.onDragEnd(`${t}`), 100), i({
|
|
2213
2241
|
onDrag: (o) => o,
|
|
2214
2242
|
onDragEnd: (o) => o,
|
|
2215
2243
|
dragStartY: 0,
|
|
@@ -2219,11 +2247,11 @@ const Hs = ({ onAdd: r }) => {
|
|
|
2219
2247
|
negative: !1,
|
|
2220
2248
|
cssProperty: ""
|
|
2221
2249
|
});
|
|
2222
|
-
}, [s, t,
|
|
2223
|
-
return
|
|
2250
|
+
}, [s, t, i]);
|
|
2251
|
+
return Dt(r) ? /* @__PURE__ */ e.jsx("div", { className: "p-4 text-center", children: /* @__PURE__ */ e.jsxs("div", { className: "space-y-4 rounded-xl p-4", children: [
|
|
2224
2252
|
/* @__PURE__ */ e.jsx(rt, { className: "mx-auto text-3xl" }),
|
|
2225
2253
|
/* @__PURE__ */ e.jsx("h1", { children: l("no_block_selected_for_styling") })
|
|
2226
|
-
] }) }) : /* @__PURE__ */ e.jsx(
|
|
2254
|
+
] }) }) : /* @__PURE__ */ e.jsx(pt, { children: /* @__PURE__ */ e.jsxs(yt.Provider, { value: { setDragData: i }, children: [
|
|
2227
2255
|
s.dragging ? /* @__PURE__ */ e.jsx(
|
|
2228
2256
|
"div",
|
|
2229
2257
|
{
|
|
@@ -2232,18 +2260,18 @@ const Hs = ({ onAdd: r }) => {
|
|
|
2232
2260
|
className: "absolute inset-0 z-30 cursor-row-resize bg-gray-300/10"
|
|
2233
2261
|
}
|
|
2234
2262
|
) : null,
|
|
2235
|
-
/* @__PURE__ */ e.jsxs(
|
|
2236
|
-
/* @__PURE__ */ e.jsxs(
|
|
2237
|
-
/* @__PURE__ */ e.jsx(
|
|
2238
|
-
/* @__PURE__ */ e.jsx(
|
|
2239
|
-
/* @__PURE__ */ e.jsx(
|
|
2263
|
+
/* @__PURE__ */ e.jsxs(Ir, { defaultValue: "settings", className: "flex h-full w-full flex-col py-1 text-xs", children: [
|
|
2264
|
+
/* @__PURE__ */ e.jsxs($r, { className: "mx-1 grid grid-cols-3", children: [
|
|
2265
|
+
/* @__PURE__ */ e.jsx(me, { value: "settings", children: l("settings") }),
|
|
2266
|
+
/* @__PURE__ */ e.jsx(me, { value: "styling", children: l("styling") }),
|
|
2267
|
+
/* @__PURE__ */ e.jsx(me, { value: "attrs", children: l("Attributes") })
|
|
2240
2268
|
] }),
|
|
2241
|
-
/* @__PURE__ */ e.jsx(
|
|
2242
|
-
/* @__PURE__ */ e.jsx(
|
|
2243
|
-
/* @__PURE__ */ e.jsx(
|
|
2269
|
+
/* @__PURE__ */ e.jsx(be, { value: "settings", className: "no-scrollbar h-full flex-1 overflow-y-auto overflow-x-hidden", children: /* @__PURE__ */ e.jsx(Be, { className: "no-scrollbar max-h-full flex-1 overflow-x-hidden overflow-y-hidden pb-5", children: /* @__PURE__ */ e.jsx(is, {}) }) }),
|
|
2270
|
+
/* @__PURE__ */ e.jsx(be, { value: "styling", className: "h-full flex-1 overflow-y-auto overflow-x-hidden", children: /* @__PURE__ */ e.jsx(Hs, {}) }),
|
|
2271
|
+
/* @__PURE__ */ e.jsx(be, { value: "attrs", className: "h-full flex-1 overflow-y-auto overflow-x-hidden", children: /* @__PURE__ */ e.jsx(Bs, {}) })
|
|
2244
2272
|
] })
|
|
2245
2273
|
] }) });
|
|
2246
2274
|
};
|
|
2247
2275
|
export {
|
|
2248
|
-
|
|
2276
|
+
Bl as default
|
|
2249
2277
|
};
|