@chaibuilder/sdk 1.1.13 → 1.1.15
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-AG_J7s2Z.cjs +1 -0
- package/dist/{AddBlocks-A7WofxHV.js → AddBlocks-FsdsASNp.js} +51 -51
- package/dist/BrandingOptions-TRVyCvVq.cjs +1 -0
- package/dist/{BrandingOptions-wkFrLFI_.js → BrandingOptions-zFJ28xmJ.js} +23 -23
- package/dist/{CanvasArea-chEYQhH8.js → CanvasArea-IiD0f6Eq.js} +7 -7
- package/dist/{CanvasArea-kF46NWZK.cjs → CanvasArea-Kbw-TjPH.cjs} +7 -7
- package/dist/CurrentPage-lOQd17GA.cjs +1 -0
- package/dist/{CurrentPage-Wd7F9Egg.js → CurrentPage-n2RQMBpJ.js} +10 -10
- package/dist/{Layers-qMOMP2Mi.js → Layers-38kbAjTI.js} +81 -81
- package/dist/Layers-D2WY0CpR.cjs +1 -0
- package/dist/MarkAsGlobalBlock-LXDkmFUr.cjs +1 -0
- package/dist/{MarkAsGlobalBlock-Czq45Amf.js → MarkAsGlobalBlock-xOHhiMDl.js} +3 -3
- package/dist/PagesPanel-RWnIpNqP.cjs +1 -0
- package/dist/{PagesPanel-ay4uk4mg.js → PagesPanel-bNqfHuCk.js} +6 -6
- package/dist/{ProjectPanel-eLlbfAtj.js → ProjectPanel-1Kgm2-R5.js} +10 -10
- package/dist/ProjectPanel-cXKiyEXm.cjs +1 -0
- package/dist/Settings-5AI0CInt.cjs +1 -0
- package/dist/{Settings-lpoxaMDu.js → Settings-ou3Owu0B.js} +454 -454
- package/dist/SidePanels-NV3UX8kK.cjs +1 -0
- package/dist/{SidePanels-iRXV69vh.js → SidePanels-muLqfBql.js} +36 -36
- package/dist/{Topbar-dQYhW4iv.js → Topbar-_-1HX-EE.js} +3 -3
- package/dist/Topbar-gQxbcPtG.cjs +1 -0
- package/dist/UnsplashImages-PNp5fYCc.cjs +1 -0
- package/dist/{UnsplashImages-AL1ASAoD.js → UnsplashImages-mqK09h8E.js} +6 -6
- package/dist/UploadImages-BoSSsLtD.cjs +1 -0
- package/dist/{UploadImages-09wuhk2O.js → UploadImages-IDkkRuhx.js} +3 -3
- package/dist/{add-page-modal-TXREEFPZ.js → add-page-modal-AJorVipD.js} +16 -16
- package/dist/add-page-modal-zOdAgfvh.cjs +1 -0
- package/dist/confirm-alert-dHRDZrA1.cjs +1 -0
- package/dist/{confirm-alert-GkfW9chS.js → confirm-alert-ea5xpncD.js} +3 -3
- package/dist/controls-QnyBNkXG.cjs +36 -0
- package/dist/controls-kEuiMMDf.js +4600 -0
- package/dist/core.cjs +1 -1
- package/dist/core.d.ts +5 -15
- package/dist/core.js +5 -5
- package/dist/{delete-page-modal-LNME2FwD.js → delete-page-modal-0VAs4Heb.js} +5 -5
- package/dist/delete-page-modal-KRBGE4Fo.cjs +1 -0
- package/dist/form-6qGAOYI3.cjs +1 -0
- package/dist/{form-Fk4CaX1A.js → form-irY39wvJ.js} +29 -29
- package/dist/functions-86L6n983.js +23 -0
- package/dist/functions-Jr7gX_RX.cjs +1 -0
- package/dist/{html-to-json-kGgp07Hv.js → html-to-json-Y5M0N8PH.js} +33 -33
- package/dist/html-to-json-aAZkA0f5.cjs +1 -0
- package/dist/{index-89A3jPHh.js → index-0OqmBgqo.js} +3 -3
- package/dist/{index-Q5q5Y_8a.js → index-4fMl4eN2.js} +6 -6
- package/dist/index-d55M5MRz.cjs +1 -0
- package/dist/{index-61c5wSJn.cjs → index-veRjBw4J.cjs} +2 -2
- package/dist/lib.cjs +1 -1
- package/dist/lib.js +27 -27
- package/dist/lodash-2us0VT8I.cjs +36 -0
- package/dist/lodash-3gkdNK5u.js +4538 -0
- package/dist/page-viewer-LvBMrQas.cjs +1 -0
- package/dist/{page-viewer-LPx-OTCC.js → page-viewer-QuVbTBKO.js} +6 -6
- package/dist/{project-general-setting-sSpFUD_Y.js → project-general-setting-6Nsq4-2Z.js} +9 -9
- package/dist/project-general-setting-pSrUGR7K.cjs +1 -0
- package/dist/{project-seo-setting-CGVegBtM.js → project-seo-setting-EhqUcTKy.js} +9 -9
- package/dist/project-seo-setting-N0OnBCvh.cjs +1 -0
- package/dist/render.cjs +1 -1
- package/dist/render.js +46 -46
- package/dist/server.cjs +1 -1
- package/dist/server.js +11 -11
- package/dist/single-page-detail-JWCEEBaZ.cjs +1 -0
- package/dist/{single-page-detail-32H1_IG4.js → single-page-detail-SAqjZ5E1.js} +53 -53
- package/dist/studio.cjs +1 -1
- package/dist/studio.js +5 -5
- package/dist/ui.cjs +1 -1
- package/dist/ui.js +3 -3
- package/dist/useAddBlockByDrop-5QW86HjG.js +20 -0
- package/dist/useAddBlockByDrop-Ckzuvu-s.cjs +1 -0
- package/dist/utils-37UXq2O5.cjs +1 -0
- package/dist/{utils-zWMk4dB2.js → utils-XsPKXMVo.js} +5 -5
- package/package.json +3 -3
- package/dist/AddBlocks-Yuc4t0Z_.cjs +0 -1
- package/dist/BrandingOptions-KkPF1OGn.cjs +0 -1
- package/dist/CurrentPage-p9MaXTOB.cjs +0 -1
- package/dist/Layers-wQ0Fv9Xc.cjs +0 -1
- package/dist/MarkAsGlobalBlock-sb3hMXLq.cjs +0 -1
- package/dist/PagesPanel--maZxwX5.cjs +0 -1
- package/dist/ProjectPanel-KhIpO7m3.cjs +0 -1
- package/dist/Settings-n2DpS5Ta.cjs +0 -1
- package/dist/SidePanels-Dud5Xh9L.cjs +0 -1
- package/dist/Topbar-vqzjB75a.cjs +0 -1
- package/dist/UnsplashImages-3Sh4UZ-7.cjs +0 -1
- package/dist/UploadImages-mPzLhMiH.cjs +0 -1
- package/dist/add-page-modal-FPnIWwqA.cjs +0 -1
- package/dist/confirm-alert-YNyc3WEo.cjs +0 -1
- package/dist/controls-G0puEH71.js +0 -120
- package/dist/controls-aHZq-q4b.cjs +0 -1
- package/dist/delete-page-modal-sTbqZPvk.cjs +0 -1
- package/dist/form-OhgCJlVA.cjs +0 -1
- package/dist/functions-ZWGlwlQY.cjs +0 -1
- package/dist/functions-slns6ONz.js +0 -23
- package/dist/html-to-json-po8on2ju.cjs +0 -1
- package/dist/index-GNmGzavZ.cjs +0 -1
- package/dist/page-viewer-wQO9oV9h.cjs +0 -1
- package/dist/project-general-setting-8EwuN5lN.cjs +0 -1
- package/dist/project-seo-setting-R77SKM1I.cjs +0 -1
- package/dist/single-page-detail-nyBEHLtT.cjs +0 -1
- package/dist/useAddBlockByDrop-4VH-SMj7.cjs +0 -1
- package/dist/useAddBlockByDrop-_kyR0iI4.js +0 -20
- package/dist/utils-tx6hqsHY.cjs +0 -1
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
import { j as e } from "./jsx-runtime-NV737rRe.js";
|
|
2
|
-
import * as
|
|
3
|
-
import
|
|
4
|
-
import { useThrottledCallback as
|
|
5
|
-
import {
|
|
6
|
-
import { useTranslation as
|
|
7
|
-
import { PlusIcon as ke, Cross2Icon as
|
|
8
|
-
import { b0 as
|
|
9
|
-
import {
|
|
10
|
-
import { Check as
|
|
2
|
+
import * as ae from "react";
|
|
3
|
+
import P, { useState as w, useMemo as N, useEffect as _, useCallback as A, memo as ct, createContext as Me, useContext as re } from "react";
|
|
4
|
+
import { useThrottledCallback as fe } from "@react-hookz/web";
|
|
5
|
+
import { f as pe, L as ne, o as pt, M as ut, c as M, g as u, h as ue, N as xt, O as W, P as te, a as b, d as C, j as gt, l as ve, b as je, s as Ee, k as ht, Q as mt, u as yt, R as bt, S as Ve, e as z, T as ft, p as vt, U as _e, V as jt, n as U, W as Fe, t as me, A as wt } from "./lodash-3gkdNK5u.js";
|
|
6
|
+
import { useTranslation as We } from "react-i18next";
|
|
7
|
+
import { PlusIcon as ke, Cross2Icon as Ye, EyeOpenIcon as Ct, EyeClosedIcon as He, BorderAllIcon as O, WidthIcon as S, HeightIcon as V, ArrowUpIcon as q, ArrowRightIcon as J, ArrowDownIcon as Q, ArrowLeftIcon as ee, ArrowTopLeftIcon as kt, ArrowTopRightIcon as Nt, ArrowBottomRightIcon as Tt, ArrowBottomLeftIcon as Rt, AlignLeftIcon as St, AlignCenterHorizontallyIcon as Vt, AlignRightIcon as Ht, StretchHorizontallyIcon as Bt, FontItalicIcon as At, UnderlineIcon as Dt, OverlineIcon as Pt, LetterCaseUppercaseIcon as It, Cross1Icon as $t, InfoCircledIcon as Ne, MinusIcon as Lt, BoxIcon as Xe, RowSpacingIcon as Ot, TriangleDownIcon as Mt, CrossCircledIcon as Et, TrashIcon as _t, MixerHorizontalIcon as Ze } from "@radix-ui/react-icons";
|
|
8
|
+
import { b0 as Ft, b1 as Wt, B as xe, b2 as Yt, b3 as Xt, b4 as Zt, b5 as zt, b6 as Ut, b7 as Gt, b8 as Kt, a6 as G, am as qt, an as Jt, ao as Qt, b9 as er, ak as tr, ba as rr, al as sr, aD as Y, aE as X, aG as Z, bb as lr, bc as or, bd as ar, be as nr, bf as ir, bg as dr, p as ze, ac as Ue, i as cr, bh as Ge, bi as ie, bj as de, bk as ce, aj as Te, P as Ke, a3 as qe, j as Je, aI as Re, bl as pr, bm as ur, a4 as ge, W as xr, a9 as Qe, R as Be, ag as gr, ad as hr, bn as mr, aq as yr, ar as br, as as fr, at as vr, au as H, bo as et, ax as jr, ay as wr, az as Ae, aA as De } from "./index-0OqmBgqo.js";
|
|
9
|
+
import { R as Cr } from "./controls-kEuiMMDf.js";
|
|
10
|
+
import { Check as kr, EditIcon as Nr, TrashIcon as Tr } from "lucide-react";
|
|
11
11
|
import { getBlockComponent as tt, getChaiDataProviders as Rr } from "@chaibuilder/runtime";
|
|
12
|
-
import { E as rt, u as
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
import { useAtom as
|
|
16
|
-
import
|
|
17
|
-
import
|
|
18
|
-
import { A as
|
|
19
|
-
import { a as
|
|
12
|
+
import { E as rt, u as st } from "./index-4fMl4eN2.js";
|
|
13
|
+
import Sr from "@rjsf/core";
|
|
14
|
+
import Vr from "@rjsf/validator-ajv8";
|
|
15
|
+
import { useAtom as Hr } from "jotai";
|
|
16
|
+
import Br from "react-autosuggest";
|
|
17
|
+
import Ar from "fuse.js";
|
|
18
|
+
import { A as Dr, C as he, e as Pr } from "./utils-XsPKXMVo.js";
|
|
19
|
+
import { a as Ir } from "./MODIFIERS-MLfpKQY1.js";
|
|
20
20
|
import "@radix-ui/react-toggle";
|
|
21
21
|
import "class-variance-authority";
|
|
22
22
|
import "@radix-ui/react-switch";
|
|
@@ -51,28 +51,28 @@ import "react-dnd";
|
|
|
51
51
|
import "@minoru/react-dnd-treeview";
|
|
52
52
|
import "react-hotkeys-hook";
|
|
53
53
|
import "sonner";
|
|
54
|
-
import "./html-to-json-
|
|
54
|
+
import "./html-to-json-Y5M0N8PH.js";
|
|
55
55
|
import "himalaya";
|
|
56
56
|
import "tailwind-merge";
|
|
57
|
-
const
|
|
58
|
-
function
|
|
59
|
-
const
|
|
60
|
-
function
|
|
61
|
-
|
|
62
|
-
const
|
|
63
|
-
|
|
57
|
+
const $r = P.lazy(() => import("react-json-view"));
|
|
58
|
+
function Lr(t) {
|
|
59
|
+
const s = [], r = {};
|
|
60
|
+
function l(o, a) {
|
|
61
|
+
pe(a, (d, i) => {
|
|
62
|
+
const n = o ? `${o}.${i}` : i, p = ne(d) ? "list" : typeof d;
|
|
63
|
+
s.push(n), r[n] = p === "string" ? "text" : p === "object" ? "model" : p, p === "object" && !ne(d) && l(n, d);
|
|
64
64
|
});
|
|
65
65
|
}
|
|
66
|
-
return
|
|
66
|
+
return l("", pt(t, ["styles", "_type", "_id", "_name", "_bindings"])), { paths: s, pathsType: r };
|
|
67
67
|
}
|
|
68
|
-
const
|
|
68
|
+
const we = ({ data: t, fullView: s }) => {
|
|
69
69
|
if (!t)
|
|
70
70
|
return null;
|
|
71
71
|
const r = typeof t;
|
|
72
|
-
return
|
|
72
|
+
return s ? typeof t == "object" ? /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
73
73
|
/* @__PURE__ */ e.jsx("div", { className: "h-3" }),
|
|
74
74
|
/* @__PURE__ */ e.jsx(rt, { children: /* @__PURE__ */ e.jsx(
|
|
75
|
-
|
|
75
|
+
$r,
|
|
76
76
|
{
|
|
77
77
|
style: { maxHeight: "40vh", overflowY: "auto" },
|
|
78
78
|
name: "Content",
|
|
@@ -87,48 +87,48 @@ const je = ({ data: t, fullView: l }) => {
|
|
|
87
87
|
/* @__PURE__ */ e.jsx("span", { className: "font-medium text-gray-800/80", children: "Content: " }),
|
|
88
88
|
t
|
|
89
89
|
] }) : /* @__PURE__ */ e.jsx("div", { className: "text-[10px] text-gray-800/50 leading-3 whitespace-nowrap overflow-hidden w-full", children: ut(r === "object" ? JSON.stringify(t) : t, { length: 40 }) });
|
|
90
|
-
},
|
|
90
|
+
}, Pe = ({
|
|
91
91
|
type: t,
|
|
92
|
-
value:
|
|
92
|
+
value: s = "",
|
|
93
93
|
setValue: r,
|
|
94
|
-
data:
|
|
94
|
+
data: l,
|
|
95
95
|
onChange: o,
|
|
96
|
-
dataType:
|
|
96
|
+
dataType: a,
|
|
97
97
|
appliedBindings: d
|
|
98
98
|
}) => {
|
|
99
|
-
const { paths: i, pathsType:
|
|
100
|
-
(x) => !
|
|
101
|
-
) : i.filter((x) =>
|
|
99
|
+
const { paths: i, pathsType: n } = Lr(l), p = t === "PROP" ? tt(l == null ? void 0 : l._type) : {}, g = t === "PROP", [c, m] = w(!1), h = N(() => t === "PROP" ? i.filter(
|
|
100
|
+
(x) => !M(d, x) && u(p, `props.${ue(xt(x, "."))}.binding`)
|
|
101
|
+
) : i.filter((x) => a === u(n, x, "")), [t, i, d, a, p]);
|
|
102
102
|
return _(() => {
|
|
103
|
-
|
|
104
|
-
}, [
|
|
103
|
+
s && o(s);
|
|
104
|
+
}, [s, t]), /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
105
105
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-4", children: [
|
|
106
|
-
/* @__PURE__ */ e.jsx("p", { className: "text-sm text-muted-foreground", children:
|
|
107
|
-
/* @__PURE__ */ e.jsxs(
|
|
106
|
+
/* @__PURE__ */ e.jsx("p", { className: "text-sm text-muted-foreground", children: W(te(t)) }),
|
|
107
|
+
/* @__PURE__ */ e.jsxs(Ft, { open: c, onOpenChange: m, children: [
|
|
108
108
|
/* @__PURE__ */ e.jsx(Wt, { asChild: !0, children: /* @__PURE__ */ e.jsx(
|
|
109
|
-
|
|
109
|
+
xe,
|
|
110
110
|
{
|
|
111
111
|
variant: "outline",
|
|
112
112
|
size: "sm",
|
|
113
|
-
className: ` ${b(
|
|
114
|
-
children:
|
|
113
|
+
className: ` ${b(s) ? "bg-blue-500 text-gray-100 hover:bg-blue-400 hover:text-white w-44 justify-center" : "min-w-[350px] justify-between items-center"}`,
|
|
114
|
+
children: s ? /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
115
115
|
/* @__PURE__ */ e.jsxs("span", { className: "text-sm pr-8", children: [
|
|
116
|
-
g && /* @__PURE__ */ e.jsx("span", { className: "text-[10px] text-purple-500 bg-purple-100 px-2 py-0.5 mr-2 rounded-full", children:
|
|
117
|
-
|
|
116
|
+
g && /* @__PURE__ */ e.jsx("span", { className: "text-[10px] text-purple-500 bg-purple-100 px-2 py-0.5 mr-2 rounded-full", children: W(a) }),
|
|
117
|
+
s
|
|
118
118
|
] }),
|
|
119
119
|
/* @__PURE__ */ e.jsx("span", { className: "text-[9px] text-blue-400 underline cursor-pointer hover:text-blue-700", children: "Change" })
|
|
120
120
|
] }) : /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
121
121
|
"+ Set ",
|
|
122
|
-
|
|
122
|
+
W(te(t))
|
|
123
123
|
] })
|
|
124
124
|
}
|
|
125
125
|
) }),
|
|
126
|
-
/* @__PURE__ */ e.jsx(
|
|
127
|
-
/* @__PURE__ */ e.jsx(
|
|
128
|
-
/* @__PURE__ */ e.jsxs(
|
|
129
|
-
/* @__PURE__ */ e.jsx(
|
|
130
|
-
/* @__PURE__ */ e.jsx(
|
|
131
|
-
|
|
126
|
+
/* @__PURE__ */ e.jsx(Yt, { className: "p-0 z-[999] min-w-[300px]", side: "right", align: "start", children: /* @__PURE__ */ e.jsxs(Xt, { children: [
|
|
127
|
+
/* @__PURE__ */ e.jsx(Zt, { placeholder: `Choose ${te(t)}...` }),
|
|
128
|
+
/* @__PURE__ */ e.jsxs(zt, { children: [
|
|
129
|
+
/* @__PURE__ */ e.jsx(Ut, { children: "No results found." }),
|
|
130
|
+
/* @__PURE__ */ e.jsx(Gt, { children: C(h, (x) => /* @__PURE__ */ e.jsxs(
|
|
131
|
+
Kt,
|
|
132
132
|
{
|
|
133
133
|
value: x,
|
|
134
134
|
className: `cursor-pointer ${g ? "flex justify-between items-center" : "flex flex-col items-start justify-start"}`,
|
|
@@ -137,10 +137,10 @@ const je = ({ data: t, fullView: l }) => {
|
|
|
137
137
|
},
|
|
138
138
|
children: [
|
|
139
139
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-x-2", children: [
|
|
140
|
-
/* @__PURE__ */ e.jsx(
|
|
140
|
+
/* @__PURE__ */ e.jsx(kr, { className: `w-4 h-4 text-green-500 ${s === x ? "" : "opacity-0"}` }),
|
|
141
141
|
x
|
|
142
142
|
] }),
|
|
143
|
-
g ? /* @__PURE__ */ e.jsx("div", { children: /* @__PURE__ */ e.jsx("span", { className: "text-[10px] text-purple-500 bg-purple-100 px-2 py-0.5 rounded-full", children:
|
|
143
|
+
g ? /* @__PURE__ */ e.jsx("div", { children: /* @__PURE__ */ e.jsx("span", { className: "text-[10px] text-purple-500 bg-purple-100 px-2 py-0.5 rounded-full", children: W(u(n, x, "")) }) }) : /* @__PURE__ */ e.jsx("div", { className: "pl-6", children: /* @__PURE__ */ e.jsx(we, { data: u(l, x) }) })
|
|
144
144
|
]
|
|
145
145
|
},
|
|
146
146
|
x
|
|
@@ -149,54 +149,54 @@ const je = ({ data: t, fullView: l }) => {
|
|
|
149
149
|
] }) })
|
|
150
150
|
] })
|
|
151
151
|
] }),
|
|
152
|
-
!g && !b(
|
|
152
|
+
!g && !b(s) && /* @__PURE__ */ e.jsx("div", { className: "pt-2", children: /* @__PURE__ */ e.jsx(we, { data: u(l, s, ""), fullView: !0 }) })
|
|
153
153
|
] });
|
|
154
|
-
},
|
|
154
|
+
}, Or = ({
|
|
155
155
|
appliedBindings: t = [],
|
|
156
|
-
onAddBinding:
|
|
156
|
+
onAddBinding: s,
|
|
157
157
|
editMode: r,
|
|
158
|
-
item:
|
|
158
|
+
item: l
|
|
159
159
|
}) => {
|
|
160
|
-
const [o,
|
|
160
|
+
const [o, a] = w(r ? l.key : ""), [d, i] = w(r ? l.value : ""), n = G(), [p] = st(), g = A(
|
|
161
161
|
(h, x) => {
|
|
162
162
|
if (b(h))
|
|
163
163
|
return "";
|
|
164
164
|
{
|
|
165
|
-
const f = u(x === "PROP" ?
|
|
166
|
-
if (
|
|
165
|
+
const f = u(x === "PROP" ? n : p, h, "");
|
|
166
|
+
if (ne(f))
|
|
167
167
|
return "list";
|
|
168
168
|
const T = typeof f;
|
|
169
169
|
return T === "string" ? "text" : T === "object" ? "model" : T;
|
|
170
170
|
}
|
|
171
171
|
},
|
|
172
|
-
[
|
|
173
|
-
), [c, m] = w(r ? g(
|
|
172
|
+
[n, p]
|
|
173
|
+
), [c, m] = w(r ? g(l.key, "PROP") : "");
|
|
174
174
|
return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
175
|
-
/* @__PURE__ */ e.jsxs(
|
|
176
|
-
/* @__PURE__ */ e.jsx(
|
|
177
|
-
/* @__PURE__ */ e.jsx(
|
|
175
|
+
/* @__PURE__ */ e.jsxs(qt, { children: [
|
|
176
|
+
/* @__PURE__ */ e.jsx(Jt, { children: "Add Data Binding" }),
|
|
177
|
+
/* @__PURE__ */ e.jsx(Qt, { className: "text-xs", children: "Add prop and path of binding. Click save when you're done." })
|
|
178
178
|
] }),
|
|
179
179
|
/* @__PURE__ */ e.jsxs("div", { className: "flex flex-col gap-1 relative", children: [
|
|
180
180
|
/* @__PURE__ */ e.jsx(
|
|
181
|
-
|
|
181
|
+
Pe,
|
|
182
182
|
{
|
|
183
183
|
type: "PROP",
|
|
184
184
|
isDisabled: !1,
|
|
185
185
|
placeholder: "Enter prop key",
|
|
186
186
|
value: o,
|
|
187
|
-
setValue:
|
|
187
|
+
setValue: a,
|
|
188
188
|
onChange: (h) => {
|
|
189
189
|
const x = g(h, "PROP");
|
|
190
|
-
|
|
190
|
+
a(h), c !== x && i(""), m(x);
|
|
191
191
|
},
|
|
192
|
-
data:
|
|
192
|
+
data: n,
|
|
193
193
|
dataType: c,
|
|
194
194
|
appliedBindings: t
|
|
195
195
|
}
|
|
196
196
|
),
|
|
197
197
|
/* @__PURE__ */ e.jsx("div", { className: "h-2" }),
|
|
198
198
|
/* @__PURE__ */ e.jsx(
|
|
199
|
-
|
|
199
|
+
Pe,
|
|
200
200
|
{
|
|
201
201
|
type: "PATH",
|
|
202
202
|
isDisabled: b(o),
|
|
@@ -213,196 +213,196 @@ const je = ({ data: t, fullView: l }) => {
|
|
|
213
213
|
}
|
|
214
214
|
)
|
|
215
215
|
] }),
|
|
216
|
-
/* @__PURE__ */ e.jsx(
|
|
217
|
-
|
|
216
|
+
/* @__PURE__ */ e.jsx(er, { children: /* @__PURE__ */ e.jsx(
|
|
217
|
+
xe,
|
|
218
218
|
{
|
|
219
219
|
type: "submit",
|
|
220
220
|
className: "mt-4",
|
|
221
221
|
disabled: b(o) && b(d),
|
|
222
|
-
onClick: () =>
|
|
222
|
+
onClick: () => s({ key: o, value: d }),
|
|
223
223
|
children: "Save"
|
|
224
224
|
}
|
|
225
225
|
) })
|
|
226
226
|
] });
|
|
227
|
-
},
|
|
227
|
+
}, lt = ({ disabled: t, children: s, onAddBinding: r, appliedBindings: l, editMode: o = !0, item: a = {} }) => {
|
|
228
228
|
const [d, i] = w(!1);
|
|
229
|
-
return /* @__PURE__ */ e.jsxs(
|
|
230
|
-
/* @__PURE__ */ e.jsx(
|
|
229
|
+
return /* @__PURE__ */ e.jsxs(tr, { children: [
|
|
230
|
+
/* @__PURE__ */ e.jsx(rr, { disabled: t, asChild: !0, onClick: () => i(!0), children: s }),
|
|
231
231
|
d && /* @__PURE__ */ e.jsx(sr, { children: /* @__PURE__ */ e.jsx(
|
|
232
|
-
|
|
232
|
+
Or,
|
|
233
233
|
{
|
|
234
|
-
item:
|
|
234
|
+
item: a,
|
|
235
235
|
editMode: o,
|
|
236
|
-
appliedBindings:
|
|
237
|
-
onAddBinding: (
|
|
238
|
-
r(
|
|
236
|
+
appliedBindings: l,
|
|
237
|
+
onAddBinding: (n) => {
|
|
238
|
+
r(n), i(!1);
|
|
239
239
|
}
|
|
240
240
|
}
|
|
241
241
|
) })
|
|
242
242
|
] });
|
|
243
243
|
}, Mr = ({
|
|
244
244
|
item: t,
|
|
245
|
-
onAddBinding:
|
|
245
|
+
onAddBinding: s,
|
|
246
246
|
onRemove: r,
|
|
247
|
-
selectedBlock:
|
|
247
|
+
selectedBlock: l,
|
|
248
248
|
dataProvider: o,
|
|
249
|
-
appliedBindings:
|
|
249
|
+
appliedBindings: a
|
|
250
250
|
}) => {
|
|
251
|
-
const [d, i] = w("string"),
|
|
251
|
+
const [d, i] = w("string"), n = (p, g) => {
|
|
252
252
|
if (b(p))
|
|
253
253
|
return "";
|
|
254
254
|
{
|
|
255
|
-
const c = u(g === "PROP" ?
|
|
256
|
-
if (
|
|
255
|
+
const c = u(g === "PROP" ? l : o, p, "");
|
|
256
|
+
if (ne(c))
|
|
257
257
|
return "list";
|
|
258
258
|
const m = typeof c;
|
|
259
259
|
return m === "string" ? "text" : m === "object" ? "model" : m;
|
|
260
260
|
}
|
|
261
261
|
};
|
|
262
|
-
return _(() => i(() =>
|
|
262
|
+
return _(() => i(() => n(t.key, "PROP")), [t.key]), /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col border border-gray-200 relative rounded-md p-2", children: [
|
|
263
263
|
/* @__PURE__ */ e.jsx("div", { className: "text-gray-500 font-normal text-sm", children: t.key }),
|
|
264
264
|
/* @__PURE__ */ e.jsx("div", { className: "font-medium leading-5", children: t.value }),
|
|
265
|
-
/* @__PURE__ */ e.jsx(
|
|
265
|
+
/* @__PURE__ */ e.jsx(we, { data: u(o, t.value, "") }),
|
|
266
266
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center justify-end gap-x-2", children: [
|
|
267
|
-
/* @__PURE__ */ e.jsx(
|
|
267
|
+
/* @__PURE__ */ e.jsx(lt, { editMode: !0, onAddBinding: s, appliedBindings: a, item: t, children: /* @__PURE__ */ e.jsx(Nr, { className: "h-6 w-6 mt-1 cursor-pointer rounded border hover:bg-blue-400 hover:text-white border-blue-400 p-1 text-blue-400 hover:scale-105 duration-200" }) }),
|
|
268
268
|
/* @__PURE__ */ e.jsx(
|
|
269
|
-
|
|
269
|
+
Tr,
|
|
270
270
|
{
|
|
271
271
|
onClick: () => r(),
|
|
272
272
|
className: "h-6 w-6 mt-1 cursor-pointer rounded border hover:bg-red-400 hover:text-white border-red-400 p-1 text-red-400 hover:scale-105 duration-200"
|
|
273
273
|
}
|
|
274
274
|
)
|
|
275
275
|
] }),
|
|
276
|
-
!b(d) && !b(t.key) && /* @__PURE__ */ e.jsx("div", { className: "mt-px absolute right-0 top-1 text-purple-600 text-[10px] flex items-center font-medium h-4 px-2 rounded-full", children:
|
|
276
|
+
!b(d) && !b(t.key) && /* @__PURE__ */ e.jsx("div", { className: "mt-px absolute right-0 top-1 text-purple-600 text-[10px] flex items-center font-medium h-4 px-2 rounded-full", children: W(d) })
|
|
277
277
|
] });
|
|
278
|
-
},
|
|
279
|
-
const r = G(), [
|
|
278
|
+
}, Er = ({ bindingData: t, onChange: s }) => {
|
|
279
|
+
const r = G(), [l] = st(), o = Rr(), [a, d] = w(
|
|
280
280
|
C(t, (c, m) => ({ key: m, value: c }))
|
|
281
281
|
);
|
|
282
282
|
_(() => {
|
|
283
283
|
d(C(t, (c, m) => ({ key: m, value: c })));
|
|
284
284
|
}, [r == null ? void 0 : r._id]);
|
|
285
285
|
const i = N(() => {
|
|
286
|
-
if (b(
|
|
286
|
+
if (b(l))
|
|
287
287
|
return !0;
|
|
288
|
-
if (b(
|
|
288
|
+
if (b(a))
|
|
289
289
|
return !1;
|
|
290
|
-
const c =
|
|
290
|
+
const c = ve(a);
|
|
291
291
|
return b(c == null ? void 0 : c.key) || b(c == null ? void 0 : c.value);
|
|
292
|
-
}, [
|
|
293
|
-
const m =
|
|
292
|
+
}, [l, a]), n = (c) => {
|
|
293
|
+
const m = je(a, (h) => h.key !== c.key);
|
|
294
294
|
d([...m, c]), g([...m, c]);
|
|
295
295
|
}, p = (c) => {
|
|
296
|
-
const m =
|
|
296
|
+
const m = je(a, (h, x) => c !== x);
|
|
297
297
|
g([...m]);
|
|
298
298
|
}, g = A(
|
|
299
299
|
(c = []) => {
|
|
300
300
|
if (d(c), b(c)) {
|
|
301
|
-
|
|
301
|
+
s({});
|
|
302
302
|
return;
|
|
303
303
|
}
|
|
304
304
|
const m = {};
|
|
305
|
-
|
|
306
|
-
!b(h == null ? void 0 : h.key) && !b(h == null ? void 0 : h.value) &&
|
|
307
|
-
}),
|
|
305
|
+
pe(c, (h) => {
|
|
306
|
+
!b(h == null ? void 0 : h.key) && !b(h == null ? void 0 : h.value) && Ee(m, h.key, h.value);
|
|
307
|
+
}), s(m);
|
|
308
308
|
},
|
|
309
|
-
[
|
|
309
|
+
[s]
|
|
310
310
|
);
|
|
311
311
|
return b(o) ? /* @__PURE__ */ e.jsx("div", { className: "w-full flex items-center justify-center", children: /* @__PURE__ */ e.jsxs("p", { className: "text-gray-500 mb-1.5 text-xs", children: [
|
|
312
312
|
"You have no data providers registered. Please add a data provider to your project. ",
|
|
313
313
|
/* @__PURE__ */ e.jsx("br", {}),
|
|
314
314
|
/* @__PURE__ */ e.jsx("a", { className: "text-blue-500", href: "https://chaibuilder.com/docs/registering-data-providers", target: "_blank", children: "Learn more" })
|
|
315
315
|
] }) }) : /* @__PURE__ */ e.jsxs("div", { className: "space-y-2", children: [
|
|
316
|
-
C(
|
|
316
|
+
C(a, (c, m) => /* @__PURE__ */ e.jsx(
|
|
317
317
|
Mr,
|
|
318
318
|
{
|
|
319
319
|
item: c,
|
|
320
|
-
onAddBinding:
|
|
320
|
+
onAddBinding: n,
|
|
321
321
|
onRemove: () => p(m),
|
|
322
322
|
selectedBlock: r,
|
|
323
|
-
dataProvider:
|
|
324
|
-
appliedBindings: C(
|
|
323
|
+
dataProvider: l,
|
|
324
|
+
appliedBindings: C(a, "key")
|
|
325
325
|
},
|
|
326
326
|
c.key
|
|
327
327
|
)),
|
|
328
|
-
/* @__PURE__ */ e.jsxs(
|
|
328
|
+
/* @__PURE__ */ e.jsxs(Y, { delayDuration: 200, children: [
|
|
329
329
|
/* @__PURE__ */ e.jsx(X, { className: "w-full", children: /* @__PURE__ */ e.jsx(
|
|
330
|
-
|
|
330
|
+
lt,
|
|
331
331
|
{
|
|
332
332
|
disabled: i,
|
|
333
|
-
appliedBindings: C(
|
|
334
|
-
onAddBinding:
|
|
333
|
+
appliedBindings: C(a, "key"),
|
|
334
|
+
onAddBinding: n,
|
|
335
335
|
children: /* @__PURE__ */ e.jsx(
|
|
336
336
|
"span",
|
|
337
337
|
{
|
|
338
338
|
className: `w-full px-5 py-1.5 text-xs rounded-md font-medium duration-200 ${i ? "cursor-not-allowed bg-gray-200 text-gray-400" : "bg-blue-700/20 text-blue-800 hover:bg-blue-700/30"}`,
|
|
339
|
-
children: b(
|
|
339
|
+
children: b(l) ? /* @__PURE__ */ e.jsx("small", { className: "text-gray-500 text-[9.5px]", children: "No data provider has been set up for this page" }) : "+ Add Data Binding"
|
|
340
340
|
}
|
|
341
341
|
)
|
|
342
342
|
}
|
|
343
343
|
) }),
|
|
344
|
-
i && /* @__PURE__ */ e.jsx(Z, { sideOffset: -55, className: "text-[11px]", children: b(
|
|
344
|
+
i && /* @__PURE__ */ e.jsx(Z, { sideOffset: -55, className: "text-[11px]", children: b(l) ? "No data provider has been set up for this page." : "Complete last added data binding to add more" })
|
|
345
345
|
] })
|
|
346
346
|
] });
|
|
347
|
-
},
|
|
348
|
-
const o = { type: "object", properties: {} },
|
|
349
|
-
return Object.keys(
|
|
350
|
-
const i =
|
|
351
|
-
if (
|
|
347
|
+
}, _r = () => /* @__PURE__ */ e.jsx("div", { className: "text-xs border rounded-sm p-1 mt-1 border-orange-500 text-orange-500 bg-orange-100", children: "Data binding is set for this field" }), ye = ct(({ createHistorySnapshot: t, properties: s, formData: r, onChange: l }) => {
|
|
348
|
+
const o = { type: "object", properties: {} }, a = {};
|
|
349
|
+
return Object.keys(s).forEach((d) => {
|
|
350
|
+
const i = s[d];
|
|
351
|
+
if (M(["slot", "styles"], i.type))
|
|
352
352
|
return;
|
|
353
|
-
const
|
|
354
|
-
o.properties[
|
|
353
|
+
const n = d;
|
|
354
|
+
o.properties[n] = lr(i), a[n] = or(i);
|
|
355
355
|
}), /* @__PURE__ */ e.jsx(
|
|
356
|
-
|
|
356
|
+
Sr,
|
|
357
357
|
{
|
|
358
358
|
widgets: {
|
|
359
|
-
binding:
|
|
359
|
+
binding: _r,
|
|
360
360
|
richtext: ar,
|
|
361
|
-
icon:
|
|
362
|
-
image:
|
|
361
|
+
icon: nr,
|
|
362
|
+
image: ir
|
|
363
363
|
},
|
|
364
|
-
fields: { link:
|
|
364
|
+
fields: { link: dr },
|
|
365
365
|
idSeparator: ".",
|
|
366
366
|
autoComplete: "off",
|
|
367
367
|
omitExtraData: !1,
|
|
368
368
|
liveOmit: !1,
|
|
369
369
|
liveValidate: !0,
|
|
370
|
-
validator:
|
|
371
|
-
uiSchema:
|
|
370
|
+
validator: Vr,
|
|
371
|
+
uiSchema: a,
|
|
372
372
|
onBlur: t,
|
|
373
373
|
schema: o,
|
|
374
374
|
formData: r,
|
|
375
|
-
onChange:
|
|
375
|
+
onChange: l
|
|
376
376
|
}
|
|
377
377
|
);
|
|
378
378
|
});
|
|
379
|
-
function
|
|
380
|
-
const t = G(), { createSnapshot:
|
|
379
|
+
function Fr() {
|
|
380
|
+
const t = G(), { createSnapshot: s } = ze(), r = Ue(), l = tt(t._type), o = { ...t }, a = cr("dataBindingSupport", !1), d = () => s(), i = ({ formData: c }, m) => {
|
|
381
381
|
if (m) {
|
|
382
382
|
const h = m.replace("root.", "");
|
|
383
383
|
r([t._id], { [h]: u(c, h) });
|
|
384
384
|
}
|
|
385
|
-
},
|
|
386
|
-
_name:
|
|
385
|
+
}, n = {
|
|
386
|
+
_name: Cr({
|
|
387
387
|
title: "Name",
|
|
388
388
|
default: u(t, "_name", t._type)
|
|
389
389
|
})
|
|
390
390
|
}, p = ht(u(o, "_bindings", {})), g = N(() => {
|
|
391
|
-
const c = mt(u(
|
|
392
|
-
return
|
|
393
|
-
}, [
|
|
391
|
+
const c = mt(u(l, "props", {}));
|
|
392
|
+
return a && pe(p, (m) => delete c[m]), c;
|
|
393
|
+
}, [l, p, a]);
|
|
394
394
|
return /* @__PURE__ */ e.jsxs("div", { className: "overflow-x-hidden", children: [
|
|
395
395
|
/* @__PURE__ */ e.jsx(
|
|
396
|
-
|
|
396
|
+
ye,
|
|
397
397
|
{
|
|
398
398
|
onChange: i,
|
|
399
399
|
createHistorySnapshot: d,
|
|
400
400
|
formData: o,
|
|
401
|
-
properties:
|
|
401
|
+
properties: n
|
|
402
402
|
}
|
|
403
403
|
),
|
|
404
404
|
/* @__PURE__ */ e.jsx("hr", { className: "mt-4" }),
|
|
405
|
-
|
|
405
|
+
a ? /* @__PURE__ */ e.jsxs(Ge, { type: "multiple", defaultValue: ["STATIC", "BINDING"], className: "h-full w-full", children: [
|
|
406
406
|
/* @__PURE__ */ e.jsxs(ie, { value: "BINDING", children: [
|
|
407
407
|
/* @__PURE__ */ e.jsx(de, { className: "px-3 py-2 text-xs hover:no-underline bg-gray-100 ml-1", children: /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-x-2", children: [
|
|
408
408
|
/* @__PURE__ */ e.jsx(
|
|
@@ -414,7 +414,7 @@ function Yr() {
|
|
|
414
414
|
"Data Binding"
|
|
415
415
|
] }) }),
|
|
416
416
|
/* @__PURE__ */ e.jsx(ce, { className: "pt-4 px-4", children: /* @__PURE__ */ e.jsx(
|
|
417
|
-
|
|
417
|
+
Er,
|
|
418
418
|
{
|
|
419
419
|
bindingData: u(o, "_bindings", {}),
|
|
420
420
|
onChange: (c) => {
|
|
@@ -431,13 +431,13 @@ function Yr() {
|
|
|
431
431
|
/* @__PURE__ */ e.jsxs(ce, { className: "pt-4", children: [
|
|
432
432
|
b(p) ? "" : /* @__PURE__ */ e.jsxs("div", { className: "text-xs mx-4 border rounded-sm p-1 mb-1 mt-0 border-orange-500 text-orange-500 bg-orange-100", children: [
|
|
433
433
|
"Data binding is set for ",
|
|
434
|
-
/* @__PURE__ */ e.jsx("b", { children: C(p,
|
|
434
|
+
/* @__PURE__ */ e.jsx("b", { children: C(p, yt).join(", ") }),
|
|
435
435
|
" ",
|
|
436
436
|
p.length === 1 ? "property" : "properties",
|
|
437
437
|
". Remove data binding to edit static content."
|
|
438
438
|
] }),
|
|
439
439
|
/* @__PURE__ */ e.jsx(
|
|
440
|
-
|
|
440
|
+
ye,
|
|
441
441
|
{
|
|
442
442
|
onChange: i,
|
|
443
443
|
createHistorySnapshot: d,
|
|
@@ -448,7 +448,7 @@ function Yr() {
|
|
|
448
448
|
] })
|
|
449
449
|
] })
|
|
450
450
|
] }) : /* @__PURE__ */ e.jsx(
|
|
451
|
-
|
|
451
|
+
ye,
|
|
452
452
|
{
|
|
453
453
|
onChange: i,
|
|
454
454
|
createHistorySnapshot: d,
|
|
@@ -459,7 +459,7 @@ function Yr() {
|
|
|
459
459
|
/* @__PURE__ */ e.jsx("div", { className: "pb-60" })
|
|
460
460
|
] });
|
|
461
461
|
}
|
|
462
|
-
const
|
|
462
|
+
const Ie = new Ar(Dr, {
|
|
463
463
|
isCaseSensitive: !1,
|
|
464
464
|
threshold: 0.2,
|
|
465
465
|
minMatchCharLength: 2,
|
|
@@ -467,20 +467,20 @@ const Pe = new Dr(Ir, {
|
|
|
467
467
|
});
|
|
468
468
|
function Wr() {
|
|
469
469
|
var D;
|
|
470
|
-
const [t] = Te(),
|
|
471
|
-
const j =
|
|
470
|
+
const [t] = Te(), s = G(), r = Ke(), l = qe(), [o] = Je(), [a, d] = w(""), i = (D = ue(t)) == null ? void 0 : D.prop, n = bt((u(s, i, "").replace(Ir, "").split(",").pop() || "").split(" "), b), p = () => {
|
|
471
|
+
const j = a.trim().toLowerCase().replace(/ +(?= )/g, "").split(" ");
|
|
472
472
|
r(o, j, !0), d("");
|
|
473
473
|
}, [g, c] = w([]), m = ({ value: j }) => {
|
|
474
|
-
const L = j.trim().toLowerCase(),
|
|
474
|
+
const L = j.trim().toLowerCase(), I = L.match(/.+:/g);
|
|
475
475
|
let k = [];
|
|
476
|
-
if (
|
|
477
|
-
const [$] =
|
|
478
|
-
k =
|
|
476
|
+
if (I && I.length > 0) {
|
|
477
|
+
const [$] = I, F = L.replace($, "");
|
|
478
|
+
k = Ie.search(F).map((y) => ({
|
|
479
479
|
...y,
|
|
480
480
|
item: { ...y.item, name: $ + y.item.name }
|
|
481
481
|
}));
|
|
482
482
|
} else
|
|
483
|
-
k =
|
|
483
|
+
k = Ie.search(L);
|
|
484
484
|
c(C(k, "item"));
|
|
485
485
|
}, h = () => {
|
|
486
486
|
c([]);
|
|
@@ -490,9 +490,9 @@ function Wr() {
|
|
|
490
490
|
autoCapitalize: "off",
|
|
491
491
|
spellCheck: !1,
|
|
492
492
|
placeholder: "Enter class name",
|
|
493
|
-
value:
|
|
493
|
+
value: a,
|
|
494
494
|
onKeyDown: (j) => {
|
|
495
|
-
j.key === "Enter" &&
|
|
495
|
+
j.key === "Enter" && a.trim() !== "" && p();
|
|
496
496
|
},
|
|
497
497
|
onChange: (j, { newValue: L }) => d(L),
|
|
498
498
|
className: "w-full rounded-md text-xs px-2 hover:outline-0 bg-background border-border py-1"
|
|
@@ -502,10 +502,10 @@ function Wr() {
|
|
|
502
502
|
{
|
|
503
503
|
className: `no-scrollbar flex ${g.length > 0 ? "min-h-[300px]" : "min-h-max"} w-full flex-col gap-y-5 overflow-y-auto bg-gray-100 px-px`,
|
|
504
504
|
children: [
|
|
505
|
-
/* @__PURE__ */ e.jsx(
|
|
505
|
+
/* @__PURE__ */ e.jsx(Re, { className: "mt-2", children: "Add Tailwind classes" }),
|
|
506
506
|
/* @__PURE__ */ e.jsxs("div", { className: "relative -mt-4 flex items-center gap-x-3", children: [
|
|
507
507
|
/* @__PURE__ */ e.jsx("div", { className: "relative flex w-full items-center gap-x-3", children: /* @__PURE__ */ e.jsx(
|
|
508
|
-
|
|
508
|
+
Br,
|
|
509
509
|
{
|
|
510
510
|
suggestions: g,
|
|
511
511
|
onSuggestionsFetchRequested: m,
|
|
@@ -524,30 +524,30 @@ function Wr() {
|
|
|
524
524
|
}
|
|
525
525
|
) }),
|
|
526
526
|
/* @__PURE__ */ e.jsx(
|
|
527
|
-
|
|
527
|
+
xe,
|
|
528
528
|
{
|
|
529
529
|
variant: "outline",
|
|
530
530
|
className: "h-6 border-gray-700",
|
|
531
531
|
onClick: p,
|
|
532
|
-
disabled:
|
|
532
|
+
disabled: a.trim() === "",
|
|
533
533
|
size: "sm",
|
|
534
534
|
children: /* @__PURE__ */ e.jsx(ke, {})
|
|
535
535
|
}
|
|
536
536
|
)
|
|
537
537
|
] }),
|
|
538
538
|
/* @__PURE__ */ e.jsxs("div", { className: "flex w-full flex-wrap gap-2", children: [
|
|
539
|
-
b(
|
|
540
|
-
|
|
541
|
-
|
|
539
|
+
b(n) && /* @__PURE__ */ e.jsx("div", { className: "flex h-10 w-full items-center justify-center text-center text-sm text-gray-400", children: "No class added" }),
|
|
540
|
+
ae.Children.toArray(
|
|
541
|
+
n.map((j) => /* @__PURE__ */ e.jsxs(
|
|
542
542
|
"div",
|
|
543
543
|
{
|
|
544
544
|
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",
|
|
545
545
|
children: [
|
|
546
546
|
j,
|
|
547
547
|
/* @__PURE__ */ e.jsx(
|
|
548
|
-
|
|
548
|
+
Ye,
|
|
549
549
|
{
|
|
550
|
-
onClick: () =>
|
|
550
|
+
onClick: () => l(o, [j]),
|
|
551
551
|
className: "invisible absolute right-1 hover:text-white group-hover:visible group-hover:cursor-pointer"
|
|
552
552
|
}
|
|
553
553
|
)
|
|
@@ -561,7 +561,7 @@ function Wr() {
|
|
|
561
561
|
}
|
|
562
562
|
);
|
|
563
563
|
}
|
|
564
|
-
const B = ["px", "%", "em", "rem", "ch", "vh", "vw"],
|
|
564
|
+
const B = ["px", "%", "em", "rem", "ch", "vh", "vw"], Yr = {
|
|
565
565
|
heading: "Flex Child",
|
|
566
566
|
items: [
|
|
567
567
|
{ type: "arbitrary", label: "Basis", units: B, property: "flexBasis" },
|
|
@@ -570,7 +570,7 @@ const B = ["px", "%", "em", "rem", "ch", "vh", "vw"], Xr = {
|
|
|
570
570
|
{ type: "dropdown", label: "Grow", property: "flexGrow" },
|
|
571
571
|
{ type: "dropdown", label: "Shrink", property: "flexShrink" }
|
|
572
572
|
]
|
|
573
|
-
},
|
|
573
|
+
}, Xr = {
|
|
574
574
|
heading: "Grid Child",
|
|
575
575
|
items: [
|
|
576
576
|
{ type: "range", label: "Col Span", property: "gridColSpan" },
|
|
@@ -581,7 +581,7 @@ const B = ["px", "%", "em", "rem", "ch", "vh", "vw"], Xr = {
|
|
|
581
581
|
{ type: "range", label: "Row End", property: "gridRowEnd" },
|
|
582
582
|
{ type: "range", label: "Order", property: "order" }
|
|
583
583
|
]
|
|
584
|
-
},
|
|
584
|
+
}, Zr = [
|
|
585
585
|
{
|
|
586
586
|
heading: "Layout",
|
|
587
587
|
items: [
|
|
@@ -988,58 +988,58 @@ const B = ["px", "%", "em", "rem", "ch", "vh", "vw"], Xr = {
|
|
|
988
988
|
], ot = {
|
|
989
989
|
"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" }) }),
|
|
990
990
|
// visibility
|
|
991
|
-
visible:
|
|
991
|
+
visible: Ct,
|
|
992
992
|
invisible: He,
|
|
993
993
|
// display
|
|
994
994
|
hidden: He,
|
|
995
995
|
gap: O,
|
|
996
|
-
gapX:
|
|
996
|
+
gapX: S,
|
|
997
997
|
gapY: V,
|
|
998
|
-
spaceX:
|
|
998
|
+
spaceX: S,
|
|
999
999
|
spaceY: V,
|
|
1000
1000
|
overscroll: O,
|
|
1001
|
-
overscrollX:
|
|
1001
|
+
overscrollX: S,
|
|
1002
1002
|
overscrollY: V,
|
|
1003
1003
|
overflow: O,
|
|
1004
|
-
overflowX:
|
|
1004
|
+
overflowX: S,
|
|
1005
1005
|
overflowY: V,
|
|
1006
1006
|
top: q,
|
|
1007
1007
|
right: J,
|
|
1008
1008
|
bottom: Q,
|
|
1009
1009
|
left: ee,
|
|
1010
1010
|
inset: O,
|
|
1011
|
-
insetX:
|
|
1011
|
+
insetX: S,
|
|
1012
1012
|
insetY: V,
|
|
1013
1013
|
border: O,
|
|
1014
|
-
borderX:
|
|
1014
|
+
borderX: S,
|
|
1015
1015
|
borderY: V,
|
|
1016
1016
|
borderTop: q,
|
|
1017
1017
|
borderRight: J,
|
|
1018
1018
|
borderBottom: Q,
|
|
1019
1019
|
borderLeft: ee,
|
|
1020
1020
|
borderRadius: O,
|
|
1021
|
-
borderRadiusX:
|
|
1021
|
+
borderRadiusX: S,
|
|
1022
1022
|
borderRadiusY: V,
|
|
1023
1023
|
borderRadiusTop: q,
|
|
1024
1024
|
borderRadiusRight: J,
|
|
1025
1025
|
borderRadiusBottom: Q,
|
|
1026
1026
|
borderRadiusLeft: ee,
|
|
1027
|
-
borderRadiusTopLeft:
|
|
1028
|
-
borderRadiusTopRight:
|
|
1029
|
-
borderRadiusBottomRight:
|
|
1027
|
+
borderRadiusTopLeft: kt,
|
|
1028
|
+
borderRadiusTopRight: Nt,
|
|
1029
|
+
borderRadiusBottomRight: Tt,
|
|
1030
1030
|
borderRadiusBottomLeft: Rt,
|
|
1031
|
-
divideXWidth:
|
|
1031
|
+
divideXWidth: S,
|
|
1032
1032
|
divideYWidth: V,
|
|
1033
1033
|
scale: O,
|
|
1034
|
-
scaleX:
|
|
1034
|
+
scaleX: S,
|
|
1035
1035
|
scaleY: V,
|
|
1036
|
-
skewX:
|
|
1036
|
+
skewX: S,
|
|
1037
1037
|
skewY: V,
|
|
1038
|
-
translateX:
|
|
1038
|
+
translateX: S,
|
|
1039
1039
|
translateY: V,
|
|
1040
1040
|
// padding
|
|
1041
1041
|
padding: O,
|
|
1042
|
-
paddingX:
|
|
1042
|
+
paddingX: S,
|
|
1043
1043
|
paddingY: V,
|
|
1044
1044
|
paddingTop: q,
|
|
1045
1045
|
paddingRight: J,
|
|
@@ -1047,25 +1047,25 @@ const B = ["px", "%", "em", "rem", "ch", "vh", "vw"], Xr = {
|
|
|
1047
1047
|
paddingLeft: ee,
|
|
1048
1048
|
// margin
|
|
1049
1049
|
margin: O,
|
|
1050
|
-
marginX:
|
|
1050
|
+
marginX: S,
|
|
1051
1051
|
marginY: V,
|
|
1052
1052
|
marginTop: q,
|
|
1053
1053
|
marginRight: J,
|
|
1054
1054
|
marginBottom: Q,
|
|
1055
1055
|
marginLeft: ee,
|
|
1056
1056
|
// text-align
|
|
1057
|
-
textLeft:
|
|
1058
|
-
textCenter:
|
|
1059
|
-
textRight:
|
|
1060
|
-
textJustify:
|
|
1057
|
+
textLeft: St,
|
|
1058
|
+
textCenter: Vt,
|
|
1059
|
+
textRight: Ht,
|
|
1060
|
+
textJustify: Bt,
|
|
1061
1061
|
// font style
|
|
1062
|
-
italic:
|
|
1062
|
+
italic: At,
|
|
1063
1063
|
// "not-italic": "",
|
|
1064
1064
|
// decoration
|
|
1065
|
-
underline:
|
|
1065
|
+
underline: Dt,
|
|
1066
1066
|
overline: Pt,
|
|
1067
1067
|
// transform
|
|
1068
|
-
uppercase:
|
|
1068
|
+
uppercase: It,
|
|
1069
1069
|
block: () => /* @__PURE__ */ e.jsxs("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [
|
|
1070
1070
|
/* @__PURE__ */ e.jsx(
|
|
1071
1071
|
"path",
|
|
@@ -1106,7 +1106,7 @@ const B = ["px", "%", "em", "rem", "ch", "vh", "vw"], Xr = {
|
|
|
1106
1106
|
}
|
|
1107
1107
|
)
|
|
1108
1108
|
] }),
|
|
1109
|
-
"float-none":
|
|
1109
|
+
"float-none": Ye,
|
|
1110
1110
|
// position
|
|
1111
1111
|
fixed: () => /* @__PURE__ */ e.jsxs("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [
|
|
1112
1112
|
/* @__PURE__ */ e.jsx(
|
|
@@ -1178,101 +1178,101 @@ const B = ["px", "%", "em", "rem", "ch", "vh", "vw"], Xr = {
|
|
|
1178
1178
|
}
|
|
1179
1179
|
)
|
|
1180
1180
|
] }),
|
|
1181
|
-
static:
|
|
1182
|
-
},
|
|
1181
|
+
static: $t
|
|
1182
|
+
}, se = Me({ canReset: !1, canChange: !0 }), zr = ({ children: t, canReset: s = !1, canChange: r = !0 }) => (
|
|
1183
1183
|
// eslint-disable-next-line react/jsx-no-constructed-context-values
|
|
1184
|
-
/* @__PURE__ */ e.jsx(
|
|
1185
|
-
),
|
|
1186
|
-
const
|
|
1184
|
+
/* @__PURE__ */ e.jsx(se.Provider, { value: { canReset: s, canChange: r }, children: t })
|
|
1185
|
+
), at = ({ label: t, property: s, onChange: r }) => {
|
|
1186
|
+
const l = N(() => u(he, `${s}.classes`, [""]), [s]), o = le(s), a = N(() => u(o, "cls", ""), [o]), { canChange: d } = re(se), i = /\[.*\]/g.test(a);
|
|
1187
1187
|
return /* @__PURE__ */ e.jsx("div", { className: t ? "w-full rounded " : "grow", children: i ? /* @__PURE__ */ e.jsxs("div", { className: "flex items-center", children: [
|
|
1188
|
-
/* @__PURE__ */ e.jsx(
|
|
1189
|
-
/* @__PURE__ */ e.jsxs(
|
|
1188
|
+
/* @__PURE__ */ e.jsx(pr, { className: "w-[70%] rounded py-1", readOnly: !0, value: a }),
|
|
1189
|
+
/* @__PURE__ */ e.jsxs(Y, { delayDuration: 100, children: [
|
|
1190
1190
|
/* @__PURE__ */ e.jsx(X, { asChild: !0, children: /* @__PURE__ */ e.jsx("button", { type: "button", className: "invisible ml-3 mt-1 text-blue-600 group-hover:visible", children: /* @__PURE__ */ e.jsx(Ne, {}) }) }),
|
|
1191
1191
|
/* @__PURE__ */ e.jsx(Z, { children: "Current value is using a Tailwind arbitrary value." })
|
|
1192
1192
|
] })
|
|
1193
1193
|
] }) : /* @__PURE__ */ e.jsx(
|
|
1194
|
-
|
|
1194
|
+
Ce,
|
|
1195
1195
|
{
|
|
1196
1196
|
rounded: t,
|
|
1197
|
-
onChange: (
|
|
1198
|
-
selected:
|
|
1199
|
-
options:
|
|
1197
|
+
onChange: (n) => r(n, s),
|
|
1198
|
+
selected: a,
|
|
1199
|
+
options: l,
|
|
1200
1200
|
disabled: !d
|
|
1201
1201
|
}
|
|
1202
1202
|
) });
|
|
1203
1203
|
};
|
|
1204
|
-
function
|
|
1205
|
-
const
|
|
1204
|
+
function Ce({ selected: t, onChange: s, rounded: r = !1, options: l, disabled: o = !1 }) {
|
|
1205
|
+
const a = t.replace(/.*:/g, "").trim(), { undo: d, redo: i } = ze();
|
|
1206
1206
|
return /* @__PURE__ */ e.jsxs(
|
|
1207
1207
|
"select",
|
|
1208
1208
|
{
|
|
1209
|
-
disabled: !
|
|
1209
|
+
disabled: !l.length || o,
|
|
1210
1210
|
className: `${r ? "rounded-md border border-border" : "border-0"} w-full disable:bg-gray-500 h-full truncate rounded bg-background px-2 py-1 text-xs outline-none disabled:cursor-not-allowed`,
|
|
1211
|
-
onChange: (
|
|
1212
|
-
onKeyDown: (
|
|
1213
|
-
|
|
1211
|
+
onChange: (n) => s(n.target.value),
|
|
1212
|
+
onKeyDown: (n) => {
|
|
1213
|
+
n.ctrlKey && (n.key === "z" && d(), n.key === "y" && i());
|
|
1214
1214
|
},
|
|
1215
|
-
value:
|
|
1215
|
+
value: a,
|
|
1216
1216
|
children: [
|
|
1217
1217
|
/* @__PURE__ */ e.jsx("option", { className: "bg-transparent", value: "" }),
|
|
1218
|
-
|
|
1219
|
-
|
|
1218
|
+
P.Children.toArray(
|
|
1219
|
+
l.map((n) => /* @__PURE__ */ e.jsx("option", { className: "bg-transparent", value: n, children: n }))
|
|
1220
1220
|
)
|
|
1221
1221
|
]
|
|
1222
1222
|
}
|
|
1223
1223
|
);
|
|
1224
1224
|
}
|
|
1225
|
-
const
|
|
1226
|
-
const { canReset: r, canChange:
|
|
1227
|
-
return /* @__PURE__ */ e.jsx("div", { className: "flex flex-row divide-x divide-solid divide-border rounded border border-border text-xs", children:
|
|
1225
|
+
const Ur = ({ property: t, onChange: s }) => {
|
|
1226
|
+
const { canReset: r, canChange: l } = re(se), o = le(t), a = N(() => u(o, "cls", ""), [o]), d = N(() => u(he, `${t}.classes`, [""]), [t]), i = d.indexOf(a) > -1 ? d.indexOf(a) : 0, n = /\[.*\]/g.test(a);
|
|
1227
|
+
return /* @__PURE__ */ e.jsx("div", { className: "flex flex-row divide-x divide-solid divide-border rounded border border-border text-xs", children: n ? /* @__PURE__ */ e.jsx("div", { className: "py-[5px] px-2", children: a }) : /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
1228
1228
|
/* @__PURE__ */ e.jsx(
|
|
1229
1229
|
"button",
|
|
1230
1230
|
{
|
|
1231
1231
|
type: "button",
|
|
1232
1232
|
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",
|
|
1233
|
-
disabled: !
|
|
1234
|
-
onClick: () =>
|
|
1233
|
+
disabled: !l && (!r || i - 1 < 0),
|
|
1234
|
+
onClick: () => s(Ve(d, i - 1), t),
|
|
1235
1235
|
children: /* @__PURE__ */ e.jsx("span", { className: "flex items-center justify-center", children: /* @__PURE__ */ e.jsx(
|
|
1236
|
-
|
|
1236
|
+
Lt,
|
|
1237
1237
|
{
|
|
1238
|
-
className: !
|
|
1238
|
+
className: !l && (!r || i - 1 < 0) ? "text-gray-500" : "text-black/60 dark:text-white/60"
|
|
1239
1239
|
}
|
|
1240
1240
|
) })
|
|
1241
1241
|
}
|
|
1242
1242
|
),
|
|
1243
|
-
/* @__PURE__ */ e.jsx("div", { className: "w-8/12 text-center", children: /* @__PURE__ */ e.jsx(
|
|
1243
|
+
/* @__PURE__ */ e.jsx("div", { className: "w-8/12 text-center", children: /* @__PURE__ */ e.jsx(at, { label: !1, property: t, onChange: s }) }),
|
|
1244
1244
|
/* @__PURE__ */ e.jsx(
|
|
1245
1245
|
"button",
|
|
1246
1246
|
{
|
|
1247
1247
|
type: "button",
|
|
1248
1248
|
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",
|
|
1249
|
-
disabled: !
|
|
1250
|
-
onClick: () =>
|
|
1249
|
+
disabled: !l && (!r || i + 1 >= d.length),
|
|
1250
|
+
onClick: () => s(Ve(d, i + 1), t),
|
|
1251
1251
|
children: /* @__PURE__ */ e.jsx("span", { className: "flex items-center justify-center", children: /* @__PURE__ */ e.jsx(
|
|
1252
1252
|
ke,
|
|
1253
1253
|
{
|
|
1254
|
-
className: !
|
|
1254
|
+
className: !l && (!r || i + 1 >= d.length) ? "text-gray-500" : "text-black/60 dark:text-white/60"
|
|
1255
1255
|
}
|
|
1256
1256
|
) })
|
|
1257
1257
|
}
|
|
1258
1258
|
)
|
|
1259
1259
|
] }) });
|
|
1260
|
-
},
|
|
1261
|
-
const r = N(() => u(
|
|
1262
|
-
return /* @__PURE__ */ e.jsx("div", { className: "flex grow flex-wrap gap-1", children: C(r, (d) => /* @__PURE__ */ e.jsxs(
|
|
1260
|
+
}, Gr = ({ property: t, onChange: s }) => {
|
|
1261
|
+
const r = N(() => u(he, `${t}.classes`, [""]), [t]), { canChange: l } = re(se), o = le(t), a = N(() => u(o, "cls", ""), [o]);
|
|
1262
|
+
return /* @__PURE__ */ e.jsx("div", { className: "flex grow flex-wrap gap-1", children: C(r, (d) => /* @__PURE__ */ e.jsxs(Y, { children: [
|
|
1263
1263
|
/* @__PURE__ */ e.jsx(X, { asChild: !0, children: /* @__PURE__ */ e.jsx(
|
|
1264
1264
|
"button",
|
|
1265
1265
|
{
|
|
1266
1266
|
type: "button",
|
|
1267
|
-
disabled: !
|
|
1268
|
-
onClick: () =>
|
|
1269
|
-
className: `cursor-pointer rounded border border-gray-600 p-1 disabled:cursor-not-allowed ${
|
|
1270
|
-
children:
|
|
1267
|
+
disabled: !l,
|
|
1268
|
+
onClick: () => s(d, t),
|
|
1269
|
+
className: `cursor-pointer rounded border border-gray-600 p-1 disabled:cursor-not-allowed ${a === d ? " bg-blue-500 text-white" : "disabled:bg-gray-600 disabled:text-gray-400"}`,
|
|
1270
|
+
children: P.createElement(u(ot, d, Xe))
|
|
1271
1271
|
}
|
|
1272
1272
|
) }),
|
|
1273
|
-
/* @__PURE__ */ e.jsx(Z, { children:
|
|
1273
|
+
/* @__PURE__ */ e.jsx(Z, { children: W(te(d)) })
|
|
1274
1274
|
] })) });
|
|
1275
|
-
},
|
|
1275
|
+
}, Kr = {
|
|
1276
1276
|
backgroundColor: "bg",
|
|
1277
1277
|
textColor: "text",
|
|
1278
1278
|
borderColor: "border",
|
|
@@ -1284,13 +1284,13 @@ const Gr = ({ property: t, onChange: l }) => {
|
|
|
1284
1284
|
toColor: "to",
|
|
1285
1285
|
ringColor: "ring",
|
|
1286
1286
|
ringOffsetColor: "ring-offset"
|
|
1287
|
-
},
|
|
1288
|
-
const r =
|
|
1287
|
+
}, qr = ({ property: t, onChange: s }) => {
|
|
1288
|
+
const r = le(t), l = N(() => u(r, "cls", ""), [r]), { canChange: o } = re(se), [a, d] = w([]), [i, n] = w({ color: "", shade: "" }), p = l.split("-"), g = u(p, "1", ""), c = u(p, "2", ""), m = A(
|
|
1289
1289
|
// eslint-disable-next-line no-shadow
|
|
1290
1290
|
(x) => {
|
|
1291
|
-
["current", "inherit", "transparent", "black", "white"].includes(x) ? (d([]),
|
|
1291
|
+
["current", "inherit", "transparent", "black", "white"].includes(x) ? (d([]), n({ color: x })) : (d(["50", "100", "200", "300", "400", "500", "600", "700", "800", "900"]), n((f) => ({ ...f, color: x, shade: f.shade ? f.shade : "500" })));
|
|
1292
1292
|
},
|
|
1293
|
-
[d,
|
|
1293
|
+
[d, n]
|
|
1294
1294
|
);
|
|
1295
1295
|
_(() => {
|
|
1296
1296
|
if (["current", "inherit", "transparent", "black", "white"].includes(g))
|
|
@@ -1300,18 +1300,18 @@ const Gr = ({ property: t, onChange: l }) => {
|
|
|
1300
1300
|
const h = A(
|
|
1301
1301
|
// eslint-disable-next-line no-shadow
|
|
1302
1302
|
(x) => {
|
|
1303
|
-
|
|
1303
|
+
n({ color: g, shade: x });
|
|
1304
1304
|
},
|
|
1305
1305
|
[g]
|
|
1306
1306
|
);
|
|
1307
1307
|
return _(() => {
|
|
1308
|
-
|
|
1308
|
+
n({ color: "", shade: "" });
|
|
1309
1309
|
}, [r]), _(() => {
|
|
1310
|
-
const f = `${u(
|
|
1311
|
-
f.match(new RegExp(u(
|
|
1312
|
-
}, [i,
|
|
1310
|
+
const f = `${u(Kr, t, "")}-${i.color}${i.shade ? `-${i.shade}` : ""}`;
|
|
1311
|
+
f.match(new RegExp(u(he, `${t}.regExp`, ""))) && s(f, t);
|
|
1312
|
+
}, [i, s, t]), /* @__PURE__ */ e.jsxs("div", { className: "flex flex-row divide-x divide-solid divide-border rounded-lg border border-border text-xs", children: [
|
|
1313
1313
|
/* @__PURE__ */ e.jsx("div", { className: "grow text-center", children: /* @__PURE__ */ e.jsx(
|
|
1314
|
-
|
|
1314
|
+
Ce,
|
|
1315
1315
|
{
|
|
1316
1316
|
disabled: !o,
|
|
1317
1317
|
rounded: !0,
|
|
@@ -1349,20 +1349,20 @@ const Gr = ({ property: t, onChange: l }) => {
|
|
|
1349
1349
|
]
|
|
1350
1350
|
}
|
|
1351
1351
|
) }),
|
|
1352
|
-
/* @__PURE__ */ e.jsx("button", { type: "button", className: "grow text-center", children: /* @__PURE__ */ e.jsx(
|
|
1352
|
+
/* @__PURE__ */ e.jsx("button", { type: "button", className: "grow text-center", children: /* @__PURE__ */ e.jsx(Ce, { rounded: !0, selected: c, disabled: !g || !o, onChange: h, options: a }) })
|
|
1353
1353
|
] });
|
|
1354
|
-
}, $e = (t,
|
|
1354
|
+
}, $e = (t, s) => {
|
|
1355
1355
|
t = t.toLowerCase();
|
|
1356
1356
|
let r = t.trim().replace(/ |\+/g, "");
|
|
1357
|
-
if ((r === "auto" || r === "none") &&
|
|
1357
|
+
if ((r === "auto" || r === "none") && s.includes(r))
|
|
1358
1358
|
return { value: "", unit: r };
|
|
1359
|
-
const
|
|
1360
|
-
r = r.replace(
|
|
1361
|
-
const o = t.match(
|
|
1362
|
-
return
|
|
1359
|
+
const l = s.length ? new RegExp(s.join("|"), "g") : /XXXXXX/g;
|
|
1360
|
+
r = r.replace(l, "");
|
|
1361
|
+
const o = t.match(l), a = o && o.length > 1, d = !b(r) && Number.isNaN(Number(r));
|
|
1362
|
+
return a || d ? { error: "Invalid value" } : o && (o[0] === "auto" || o[0] === "none") ? { value: o[0], unit: "" } : { value: r, unit: o ? o[0] : "" };
|
|
1363
1363
|
};
|
|
1364
|
-
const
|
|
1365
|
-
const
|
|
1364
|
+
const Jr = (t) => {
|
|
1365
|
+
const s = t.startsWith("-") ? "-" : "", r = t.split("-").pop();
|
|
1366
1366
|
if (["auto", "none"].includes(r))
|
|
1367
1367
|
return { value: "", unit: r };
|
|
1368
1368
|
if (r === "px")
|
|
@@ -1371,22 +1371,22 @@ const Qr = (t) => {
|
|
|
1371
1371
|
return { value: "100", unit: t.indexOf("w-") !== -1 ? "vw" : "vh" };
|
|
1372
1372
|
if (r === "full")
|
|
1373
1373
|
return { value: "100", unit: "%" };
|
|
1374
|
-
if (
|
|
1375
|
-
return { value: `${
|
|
1376
|
-
if (
|
|
1377
|
-
return { value: `${
|
|
1378
|
-
if (
|
|
1374
|
+
if (M(t, "skew-"))
|
|
1375
|
+
return { value: `${s}${r}`, unit: "deg" };
|
|
1376
|
+
if (M(t, "rotate-"))
|
|
1377
|
+
return { value: `${s}${r}`, unit: "deg" };
|
|
1378
|
+
if (M(t, "opacity-"))
|
|
1379
1379
|
return { value: `${r / 100}`, unit: "-" };
|
|
1380
|
-
if (
|
|
1380
|
+
if (M(t, "duration-") || M(t, "delay-"))
|
|
1381
1381
|
return { value: `${r}`, unit: "ms" };
|
|
1382
|
-
if (
|
|
1383
|
-
return { value: `${
|
|
1384
|
-
if (
|
|
1385
|
-
return { value: `${
|
|
1382
|
+
if (M(t, "translate-") && !r.includes("/"))
|
|
1383
|
+
return { value: `${s}${`${r / 4}`}`, unit: "rem" };
|
|
1384
|
+
if (M(t, "scale-"))
|
|
1385
|
+
return { value: `${s}${`${r / 100}`}`, unit: "-" };
|
|
1386
1386
|
if (z(t, "border")) {
|
|
1387
|
-
const
|
|
1388
|
-
if (
|
|
1389
|
-
return { value:
|
|
1387
|
+
const l = t.match(/border-?(x|y|t|r|b|l)?\d+/g);
|
|
1388
|
+
if (l)
|
|
1389
|
+
return { value: l[0].split("-").pop(), unit: "px" };
|
|
1390
1390
|
if (t.match(/border-?(x|y|t|r|b|l)?/g))
|
|
1391
1391
|
return { value: "1", unit: "px" };
|
|
1392
1392
|
}
|
|
@@ -1485,97 +1485,97 @@ const Qr = (t) => {
|
|
|
1485
1485
|
if (["max", "min", "fit"].includes(r))
|
|
1486
1486
|
return { value: t, unit: "class" };
|
|
1487
1487
|
if (r.includes("/")) {
|
|
1488
|
-
const [
|
|
1489
|
-
return { value:
|
|
1488
|
+
const [l, o] = C(r.split("/"), (a) => parseInt(a, 10));
|
|
1489
|
+
return { value: s + (l / o * 100).toFixed(2).replace(".00", ""), unit: "%" };
|
|
1490
1490
|
}
|
|
1491
|
-
return
|
|
1491
|
+
return ft(parseFloat(r)) ? { value: `${s + parseFloat(r) * 4}`, unit: "px" } : { value: r, unit: "class" };
|
|
1492
1492
|
};
|
|
1493
|
-
const
|
|
1493
|
+
const Qr = (t) => {
|
|
1494
1494
|
if (b(t))
|
|
1495
1495
|
return { value: "", unit: "" };
|
|
1496
|
-
const
|
|
1497
|
-
if (
|
|
1498
|
-
return
|
|
1499
|
-
const r = u(
|
|
1500
|
-
return { value: `${
|
|
1501
|
-
},
|
|
1496
|
+
const s = t.match(/\[.*\]/g);
|
|
1497
|
+
if (s === null)
|
|
1498
|
+
return es(t);
|
|
1499
|
+
const r = u(s, "0", "").replace(/\[|\]/g, ""), l = t.startsWith("-") ? "-" : "", o = ue(r.match(/\d+.\d+|\d+/g));
|
|
1500
|
+
return { value: `${l}${o}`, unit: r.replace(o, "") };
|
|
1501
|
+
}, es = (t) => b(t) ? { value: "", unit: "" } : Jr(t), nt = P.createContext({
|
|
1502
1502
|
setDragData: () => {
|
|
1503
1503
|
}
|
|
1504
|
-
}),
|
|
1504
|
+
}), ts = ({
|
|
1505
1505
|
unit: t,
|
|
1506
|
-
currentValue:
|
|
1506
|
+
currentValue: s,
|
|
1507
1507
|
onDrag: r,
|
|
1508
|
-
onDragEnd:
|
|
1508
|
+
onDragEnd: l,
|
|
1509
1509
|
onDragStart: o,
|
|
1510
|
-
negative:
|
|
1510
|
+
negative: a,
|
|
1511
1511
|
cssProperty: d
|
|
1512
1512
|
}) => {
|
|
1513
|
-
const { setDragData: i } = re(
|
|
1513
|
+
const { setDragData: i } = re(nt);
|
|
1514
1514
|
return /* @__PURE__ */ e.jsx(
|
|
1515
1515
|
"button",
|
|
1516
1516
|
{
|
|
1517
1517
|
type: "button",
|
|
1518
|
-
onMouseDown: (
|
|
1518
|
+
onMouseDown: (n) => {
|
|
1519
1519
|
const p = {
|
|
1520
1520
|
onDrag: r,
|
|
1521
|
-
onDragEnd:
|
|
1521
|
+
onDragEnd: l,
|
|
1522
1522
|
dragging: !0,
|
|
1523
|
-
dragStartY:
|
|
1524
|
-
dragStartValue: `${
|
|
1523
|
+
dragStartY: n.pageY,
|
|
1524
|
+
dragStartValue: `${s}`,
|
|
1525
1525
|
dragUnit: t,
|
|
1526
|
-
negative:
|
|
1526
|
+
negative: a,
|
|
1527
1527
|
cssProperty: d
|
|
1528
1528
|
};
|
|
1529
1529
|
o(p), i(p);
|
|
1530
1530
|
},
|
|
1531
1531
|
color: void 0,
|
|
1532
1532
|
className: "relative z-50 ml-1 hidden h-6 cursor-row-resize rounded bg-background/70 px-2 group-hover:inline",
|
|
1533
|
-
children: /* @__PURE__ */ e.jsx(
|
|
1533
|
+
children: /* @__PURE__ */ e.jsx(Ot, {})
|
|
1534
1534
|
}
|
|
1535
1535
|
);
|
|
1536
|
-
},
|
|
1537
|
-
|
|
1536
|
+
}, rs = ({ onSelect: t, current: s, units: r }) => /* @__PURE__ */ e.jsx("div", { "data-theme": "light", className: "-m-[7px] -mx-[13px] flex w-9 flex-col", children: r.map((l) => /* @__PURE__ */ e.jsx(
|
|
1537
|
+
xe,
|
|
1538
1538
|
{
|
|
1539
1539
|
className: "h-max rounded-none px-1 py-1 text-right text-[11px] hover:bg-blue-400",
|
|
1540
|
-
color:
|
|
1540
|
+
color: s === l ? "primary" : void 0,
|
|
1541
1541
|
size: "sm",
|
|
1542
1542
|
onClick: (o) => {
|
|
1543
|
-
o.stopPropagation(), t(
|
|
1543
|
+
o.stopPropagation(), t(l);
|
|
1544
1544
|
},
|
|
1545
|
-
children:
|
|
1545
|
+
children: l
|
|
1546
1546
|
},
|
|
1547
|
-
|
|
1548
|
-
)) }), Le = 50,
|
|
1549
|
-
const [
|
|
1547
|
+
l
|
|
1548
|
+
)) }), Le = 50, ss = (t) => {
|
|
1549
|
+
const [s, r] = w(!1), [l, o] = w(""), { currentClass: a, onChange: d, classPrefix: i, cssProperty: n, units: p, negative: g } = t, [c, m] = w(n != null && n.toLowerCase().includes("width") ? "%" : p[0]), [h, x] = w(!1), [f, T] = w(""), [D, j] = w(!1), [L, I] = w(!1);
|
|
1550
1550
|
_(() => {
|
|
1551
|
-
const { value: y, unit: v } =
|
|
1551
|
+
const { value: y, unit: v } = Qr(a);
|
|
1552
1552
|
if (v === "") {
|
|
1553
|
-
o(y), m(
|
|
1553
|
+
o(y), m(n != null && n.toLowerCase().includes("width") ? "%" : ue(p));
|
|
1554
1554
|
return;
|
|
1555
1555
|
}
|
|
1556
1556
|
m(v), o(v === "class" || b(y) ? "" : y);
|
|
1557
|
-
}, [
|
|
1558
|
-
const k =
|
|
1557
|
+
}, [a, n, p]);
|
|
1558
|
+
const k = fe((y) => d(y), [d], Le), $ = fe((y) => d(y, !1), [d], Le), F = A(
|
|
1559
1559
|
(y = !1) => {
|
|
1560
|
-
const v = $e(`${
|
|
1560
|
+
const v = $e(`${l}`, p);
|
|
1561
1561
|
if (u(v, "error", !1)) {
|
|
1562
1562
|
x(!0);
|
|
1563
1563
|
return;
|
|
1564
1564
|
}
|
|
1565
|
-
const
|
|
1566
|
-
if (
|
|
1567
|
-
k(`${i}${
|
|
1565
|
+
const R = u(v, "unit") !== "" ? u(v, "unit") : c;
|
|
1566
|
+
if (R === "auto" || R === "none") {
|
|
1567
|
+
k(`${i}${R}`);
|
|
1568
1568
|
return;
|
|
1569
1569
|
}
|
|
1570
1570
|
if (u(v, "value") === "")
|
|
1571
1571
|
return;
|
|
1572
|
-
const K = `${u(v, "value", "").startsWith("-") ? "-" : ""}${i}[${u(v, "value", "").replace("-", "")}${
|
|
1572
|
+
const K = `${u(v, "value", "").startsWith("-") ? "-" : ""}${i}[${u(v, "value", "").replace("-", "")}${R === "-" ? "" : R}]`;
|
|
1573
1573
|
y ? $(K) : k(K);
|
|
1574
1574
|
},
|
|
1575
|
-
[k, $,
|
|
1575
|
+
[k, $, l, c, i, p]
|
|
1576
1576
|
), oe = A(
|
|
1577
1577
|
(y) => {
|
|
1578
|
-
const v = $e(`${
|
|
1578
|
+
const v = $e(`${l}`, p);
|
|
1579
1579
|
if (u(v, "error", !1)) {
|
|
1580
1580
|
x(!0);
|
|
1581
1581
|
return;
|
|
@@ -1586,14 +1586,14 @@ const el = (t) => {
|
|
|
1586
1586
|
}
|
|
1587
1587
|
if (u(v, "value") === "")
|
|
1588
1588
|
return;
|
|
1589
|
-
const
|
|
1589
|
+
const R = u(v, "unit") !== "" ? u(v, "unit") : y, K = `${u(v, "value", "").startsWith("-") ? "-" : ""}${i}[${u(v, "value", "").replace("-", "")}${R === "-" ? "" : R}]`;
|
|
1590
1590
|
k(K);
|
|
1591
1591
|
},
|
|
1592
|
-
[k,
|
|
1592
|
+
[k, l, i, p]
|
|
1593
1593
|
);
|
|
1594
1594
|
return /* @__PURE__ */ e.jsx("div", { className: "flex w-full flex-col", children: /* @__PURE__ */ e.jsx("div", { className: "flex items-center justify-start", children: c === "class" ? /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
1595
|
-
/* @__PURE__ */ e.jsx("input", { className: "w-20 rounded py-1", readOnly: !0, value:
|
|
1596
|
-
/* @__PURE__ */ e.jsxs(
|
|
1595
|
+
/* @__PURE__ */ e.jsx("input", { className: "w-20 rounded py-1", readOnly: !0, value: a }),
|
|
1596
|
+
/* @__PURE__ */ e.jsxs(Y, { children: [
|
|
1597
1597
|
/* @__PURE__ */ e.jsx(X, { asChild: !0, children: /* @__PURE__ */ e.jsx("button", { type: "button", className: "invisible ml-3 mt-1 text-blue-600 group-hover:visible", children: /* @__PURE__ */ e.jsx(Ne, {}) }) }),
|
|
1598
1598
|
/* @__PURE__ */ e.jsx(Z, { children: "Current value is using a Tailwind preset class." })
|
|
1599
1599
|
] })
|
|
@@ -1609,15 +1609,15 @@ const el = (t) => {
|
|
|
1609
1609
|
onKeyDown: (y) => {
|
|
1610
1610
|
if (y.keyCode !== 38 && y.keyCode !== 40)
|
|
1611
1611
|
return;
|
|
1612
|
-
y.preventDefault(),
|
|
1613
|
-
const v =
|
|
1614
|
-
let
|
|
1615
|
-
y.keyCode === 38 && (
|
|
1616
|
-
const
|
|
1612
|
+
y.preventDefault(), I(!0);
|
|
1613
|
+
const v = vt(y.target.value);
|
|
1614
|
+
let R = _e(v) ? 0 : v;
|
|
1615
|
+
y.keyCode === 38 && (R += 1), y.keyCode === 40 && (R -= 1);
|
|
1616
|
+
const E = `${R}`, dt = `${E.startsWith("-") ? "-" : ""}${i}[${E.replace("-", "")}${c === "-" ? "" : c}]`;
|
|
1617
1617
|
$(dt);
|
|
1618
1618
|
},
|
|
1619
1619
|
onKeyUp: (y) => {
|
|
1620
|
-
L && (y.preventDefault(),
|
|
1620
|
+
L && (y.preventDefault(), I(!1));
|
|
1621
1621
|
},
|
|
1622
1622
|
onBlur: () => F(),
|
|
1623
1623
|
onChange: (y) => {
|
|
@@ -1627,19 +1627,19 @@ const el = (t) => {
|
|
|
1627
1627
|
var v;
|
|
1628
1628
|
(v = y == null ? void 0 : y.target) == null || v.select(), r(!1);
|
|
1629
1629
|
},
|
|
1630
|
-
value: D ? f :
|
|
1630
|
+
value: D ? f : l,
|
|
1631
1631
|
className: "h-6 w-14 rounded rounded-r-none bg-background pl-2 text-sm focus-visible:outline-0 ".concat(
|
|
1632
1632
|
" ",
|
|
1633
1633
|
h ? "border-red-500 text-red-500" : "border-foreground/20"
|
|
1634
1634
|
)
|
|
1635
1635
|
}
|
|
1636
1636
|
),
|
|
1637
|
-
/* @__PURE__ */ e.jsxs(
|
|
1637
|
+
/* @__PURE__ */ e.jsxs(Y, { open: s, delayDuration: 100, children: [
|
|
1638
1638
|
/* @__PURE__ */ e.jsx(X, { asChild: !0, children: /* @__PURE__ */ e.jsxs(
|
|
1639
1639
|
"button",
|
|
1640
1640
|
{
|
|
1641
1641
|
type: "button",
|
|
1642
|
-
onClick: () => r(!
|
|
1642
|
+
onClick: () => r(!s),
|
|
1643
1643
|
className: "flex h-6 cursor-pointer items-center gap-x-1 rounded rounded-l-none bg-background p-px px-1 text-[11px] uppercase",
|
|
1644
1644
|
children: [
|
|
1645
1645
|
/* @__PURE__ */ e.jsx("span", { className: `inline-block ${p.length === 1 ? "px-2 font-semibold" : ""}`, children: c }),
|
|
@@ -1647,8 +1647,8 @@ const el = (t) => {
|
|
|
1647
1647
|
]
|
|
1648
1648
|
}
|
|
1649
1649
|
) }),
|
|
1650
|
-
/* @__PURE__ */ e.jsx(
|
|
1651
|
-
|
|
1650
|
+
/* @__PURE__ */ e.jsx(ur, { children: /* @__PURE__ */ e.jsx(Z, { className: "bg-background", children: /* @__PURE__ */ e.jsx(
|
|
1651
|
+
rs,
|
|
1652
1652
|
{
|
|
1653
1653
|
units: p,
|
|
1654
1654
|
current: c,
|
|
@@ -1660,33 +1660,33 @@ const el = (t) => {
|
|
|
1660
1660
|
] })
|
|
1661
1661
|
] }),
|
|
1662
1662
|
["none", "auto"].indexOf(c) !== -1 || D ? null : /* @__PURE__ */ e.jsx(
|
|
1663
|
-
|
|
1663
|
+
ts,
|
|
1664
1664
|
{
|
|
1665
1665
|
onDragStart: () => j(!0),
|
|
1666
1666
|
onDragEnd: (y) => {
|
|
1667
1667
|
if (T(() => ""), j(!1), b(y))
|
|
1668
1668
|
return;
|
|
1669
|
-
const v = `${y}`,
|
|
1670
|
-
k(
|
|
1669
|
+
const v = `${y}`, E = `${v.startsWith("-") ? "-" : ""}${i}[${v.replace("-", "")}${c === "-" ? "" : c}]`;
|
|
1670
|
+
k(E);
|
|
1671
1671
|
},
|
|
1672
1672
|
onDrag: (y) => {
|
|
1673
1673
|
if (b(y))
|
|
1674
1674
|
return;
|
|
1675
1675
|
T(y);
|
|
1676
|
-
const v = `${y}`,
|
|
1677
|
-
$(
|
|
1676
|
+
const v = `${y}`, E = `${v.startsWith("-") ? "-" : ""}${i}[${v.replace("-", "")}${c === "-" ? "" : c}]`;
|
|
1677
|
+
$(E);
|
|
1678
1678
|
},
|
|
1679
|
-
currentValue:
|
|
1679
|
+
currentValue: l,
|
|
1680
1680
|
unit: c,
|
|
1681
1681
|
negative: g,
|
|
1682
|
-
cssProperty:
|
|
1682
|
+
cssProperty: n
|
|
1683
1683
|
}
|
|
1684
1684
|
)
|
|
1685
1685
|
] }) }) });
|
|
1686
|
-
},
|
|
1687
|
-
const
|
|
1688
|
-
return
|
|
1689
|
-
},
|
|
1686
|
+
}, le = (t) => {
|
|
1687
|
+
const s = ge();
|
|
1688
|
+
return jt(s, { property: t });
|
|
1689
|
+
}, ls = (t, s) => {
|
|
1690
1690
|
const r = {
|
|
1691
1691
|
xs: 0,
|
|
1692
1692
|
sm: 1,
|
|
@@ -1695,8 +1695,8 @@ const el = (t) => {
|
|
|
1695
1695
|
xl: 4,
|
|
1696
1696
|
"2xl": 5
|
|
1697
1697
|
};
|
|
1698
|
-
return r[u(t, "mq", "xs")] <= r[
|
|
1699
|
-
},
|
|
1698
|
+
return r[u(t, "mq", "xs")] <= r[s];
|
|
1699
|
+
}, os = {
|
|
1700
1700
|
width: "w-",
|
|
1701
1701
|
height: "h-",
|
|
1702
1702
|
minWidth: "min-w-",
|
|
@@ -1769,19 +1769,19 @@ const el = (t) => {
|
|
|
1769
1769
|
lg: "1024px",
|
|
1770
1770
|
xl: "1280px",
|
|
1771
1771
|
"2xl": "1536px"
|
|
1772
|
-
},
|
|
1773
|
-
const { type:
|
|
1774
|
-
}, units:
|
|
1772
|
+
}, as = (t) => `${t.toUpperCase()} ${Oe[t] ? `(${Oe[t]} & up)` : ""}`, Se = (t) => {
|
|
1773
|
+
const { type: s = "icons", label: r, property: l, onEmitChange: o = () => {
|
|
1774
|
+
}, units: a, negative: d = !1 } = t, [i] = xr(), [n] = Qe(), [, p] = Be(), g = le(l), c = Ke(), m = qe(), [h] = Je(), x = N(() => u(g, "fullCls", ""), [g]), f = A(
|
|
1775
1775
|
(k, $ = !0) => {
|
|
1776
|
-
const F = { dark: i, mq: p, mod:
|
|
1777
|
-
(i ||
|
|
1776
|
+
const F = { dark: i, mq: p, mod: n, cls: k, property: l, fullCls: "" };
|
|
1777
|
+
(i || n !== "") && (F.mq = "xs");
|
|
1778
1778
|
const oe = Pr(F);
|
|
1779
1779
|
c(h, [oe], $);
|
|
1780
1780
|
},
|
|
1781
|
-
[h, i, p,
|
|
1781
|
+
[h, i, p, n, l, c]
|
|
1782
1782
|
), T = A(() => {
|
|
1783
1783
|
m(h, [x]);
|
|
1784
|
-
}, [h, x, m]), D = N(() =>
|
|
1784
|
+
}, [h, x, m]), D = N(() => ls(g, p), [g, p]);
|
|
1785
1785
|
_(() => {
|
|
1786
1786
|
o(D, g);
|
|
1787
1787
|
}, [D, o, g]);
|
|
@@ -1797,28 +1797,28 @@ const el = (t) => {
|
|
|
1797
1797
|
}[k]);
|
|
1798
1798
|
},
|
|
1799
1799
|
[j]
|
|
1800
|
-
),
|
|
1801
|
-
return /* @__PURE__ */ e.jsx(
|
|
1802
|
-
/* @__PURE__ */ e.jsx("div", { className: "relative w-[70px] truncate text-xs text-foreground", children: /* @__PURE__ */ e.jsx("span", { className: `text-[11px] ${g && !
|
|
1800
|
+
), I = u(g, "dark", null) === i && u(g, "mod", null) === n && u(g, "mq", null) === p;
|
|
1801
|
+
return /* @__PURE__ */ e.jsx(zr, { canChange: D, canReset: g && I, children: /* @__PURE__ */ e.jsxs("div", { className: "group flex flex-row items-center py-2 first:pt-0 last:pb-0", children: [
|
|
1802
|
+
/* @__PURE__ */ e.jsx("div", { className: "relative w-[70px] truncate text-xs text-foreground", children: /* @__PURE__ */ e.jsx("span", { className: `text-[11px] ${g && !I ? "text-foreground" : ""}`, children: r }) }),
|
|
1803
1803
|
/* @__PURE__ */ e.jsxs("div", { className: "flex flex-row items-center", children: [
|
|
1804
1804
|
/* @__PURE__ */ e.jsxs("div", { className: "w-[150px]", children: [
|
|
1805
|
-
|
|
1806
|
-
|
|
1805
|
+
s === "arbitrary" ? /* @__PURE__ */ e.jsx(
|
|
1806
|
+
ss,
|
|
1807
1807
|
{
|
|
1808
1808
|
currentClass: u(g, "cls", ""),
|
|
1809
|
-
classPrefix: u(
|
|
1810
|
-
units:
|
|
1809
|
+
classPrefix: u(os, l, ""),
|
|
1810
|
+
units: a || [],
|
|
1811
1811
|
onChange: f,
|
|
1812
1812
|
negative: d,
|
|
1813
|
-
cssProperty:
|
|
1813
|
+
cssProperty: l
|
|
1814
1814
|
}
|
|
1815
1815
|
) : null,
|
|
1816
|
-
|
|
1817
|
-
|
|
1818
|
-
|
|
1819
|
-
|
|
1816
|
+
s === "icons" && /* @__PURE__ */ e.jsx(Gr, { property: l, onChange: f }),
|
|
1817
|
+
s === "range" && /* @__PURE__ */ e.jsx(Ur, { property: l, onChange: f }),
|
|
1818
|
+
s === "color" && /* @__PURE__ */ e.jsx(qr, { property: l, onChange: f }),
|
|
1819
|
+
s === "dropdown" && /* @__PURE__ */ e.jsx(at, { label: r, property: l, onChange: f })
|
|
1820
1820
|
] }),
|
|
1821
|
-
/* @__PURE__ */ e.jsx("div", { className: `w-[30px] cursor-pointer ${x ? "visible" : "invisible"}`, children:
|
|
1821
|
+
/* @__PURE__ */ e.jsx("div", { className: `w-[30px] cursor-pointer ${x ? "visible" : "invisible"}`, children: I ? /* @__PURE__ */ e.jsx("button", { type: "button", onClick: () => T(), title: "Reset", className: "flex px-1.5 text-xs", children: /* @__PURE__ */ e.jsx(Et, { className: "h-5 w-5 text-blue-500 hover:opacity-80" }) }) : D && g ? /* @__PURE__ */ e.jsxs(Y, { delayDuration: 100, children: [
|
|
1822
1822
|
/* @__PURE__ */ e.jsx(X, { asChild: !0, children: /* @__PURE__ */ e.jsx(
|
|
1823
1823
|
"button",
|
|
1824
1824
|
{
|
|
@@ -1830,7 +1830,7 @@ const el = (t) => {
|
|
|
1830
1830
|
/* @__PURE__ */ e.jsx(Z, { children: /* @__PURE__ */ e.jsx("div", { className: "text-right", children: /* @__PURE__ */ e.jsxs("div", { children: [
|
|
1831
1831
|
"Current style is set at ",
|
|
1832
1832
|
/* @__PURE__ */ e.jsxs("span", { className: "font-bold ", children: [
|
|
1833
|
-
|
|
1833
|
+
as(u(g, "mq")),
|
|
1834
1834
|
i && !g.dark ? "(Light mode)" : ""
|
|
1835
1835
|
] }),
|
|
1836
1836
|
/* @__PURE__ */ e.jsx("br", {}),
|
|
@@ -1850,48 +1850,48 @@ const el = (t) => {
|
|
|
1850
1850
|
] }) : null })
|
|
1851
1851
|
] })
|
|
1852
1852
|
] }) });
|
|
1853
|
-
},
|
|
1853
|
+
}, ns = ["px", "%", "em", "rem", "ch", "vh", "vw"], it = ({
|
|
1854
1854
|
label: t,
|
|
1855
|
-
options:
|
|
1855
|
+
options: s,
|
|
1856
1856
|
borderB: r = !1,
|
|
1857
|
-
borderT:
|
|
1857
|
+
borderT: l = !1,
|
|
1858
1858
|
type: o = "arbitrary",
|
|
1859
|
-
units:
|
|
1859
|
+
units: a = ns,
|
|
1860
1860
|
negative: d = !1
|
|
1861
1861
|
}) => {
|
|
1862
|
-
const [i,
|
|
1862
|
+
const [i, n] = w(s[0].key), p = ge(), g = A((c) => C(p, "property").includes(c), [p]);
|
|
1863
1863
|
return /* @__PURE__ */ e.jsxs(
|
|
1864
1864
|
"div",
|
|
1865
1865
|
{
|
|
1866
|
-
className: `mb-2 border-gray-800 py-2 first:pt-0 last:pb-0 ${r ? "border-b" : ""} ${
|
|
1866
|
+
className: `mb-2 border-gray-800 py-2 first:pt-0 last:pb-0 ${r ? "border-b" : ""} ${l ? "border-t" : ""}`,
|
|
1867
1867
|
children: [
|
|
1868
1868
|
/* @__PURE__ */ e.jsxs("div", { className: "flex flex-row text-xs", children: [
|
|
1869
1869
|
t && /* @__PURE__ */ e.jsx("span", { className: "relative w-[70px] flex-none text-xs text-foreground", children: t }),
|
|
1870
|
-
/* @__PURE__ */ e.jsx("div", { className: "mb-3 flex grow flex-row flex-wrap gap-x-px", children:
|
|
1871
|
-
|
|
1870
|
+
/* @__PURE__ */ e.jsx("div", { className: "mb-3 flex grow flex-row flex-wrap gap-x-px", children: P.Children.toArray(
|
|
1871
|
+
s.map(({ label: c, key: m }) => /* @__PURE__ */ e.jsx("div", { className: "first:rounded-l last:rounded-r", children: /* @__PURE__ */ e.jsxs(Y, { children: [
|
|
1872
1872
|
/* @__PURE__ */ e.jsx(X, { asChild: !0, children: /* @__PURE__ */ e.jsxs(
|
|
1873
1873
|
"button",
|
|
1874
1874
|
{
|
|
1875
1875
|
type: "button",
|
|
1876
|
-
onClick: () =>
|
|
1876
|
+
onClick: () => n(m),
|
|
1877
1877
|
className: `relative cursor-pointer rounded-full p-1 text-[8px] ${m === i ? " bg-[#3E57F0] text-white" : "text-gray-600 dark:text-gray-300"}`,
|
|
1878
1878
|
children: [
|
|
1879
|
-
|
|
1879
|
+
P.createElement("div", {
|
|
1880
1880
|
className: g(m) ? "-bottom-1.5 absolute bg-[#3E57F0] h-[2px] left-0 w-full" : ""
|
|
1881
1881
|
}),
|
|
1882
|
-
|
|
1882
|
+
P.createElement(u(ot, m, Xe), { className: "text-inherit w-3 h-3" })
|
|
1883
1883
|
]
|
|
1884
1884
|
}
|
|
1885
1885
|
) }),
|
|
1886
|
-
/* @__PURE__ */ e.jsx(Z, { children:
|
|
1886
|
+
/* @__PURE__ */ e.jsx(Z, { children: W(te(c)) })
|
|
1887
1887
|
] }) }))
|
|
1888
1888
|
) })
|
|
1889
1889
|
] }),
|
|
1890
1890
|
/* @__PURE__ */ e.jsx("div", { className: "mt-0 flex items-center", children: /* @__PURE__ */ e.jsx(
|
|
1891
|
-
|
|
1891
|
+
Se,
|
|
1892
1892
|
{
|
|
1893
1893
|
type: o,
|
|
1894
|
-
units: [...
|
|
1894
|
+
units: [...a],
|
|
1895
1895
|
label: "",
|
|
1896
1896
|
property: i,
|
|
1897
1897
|
negative: d
|
|
@@ -1900,73 +1900,73 @@ const el = (t) => {
|
|
|
1900
1900
|
]
|
|
1901
1901
|
}
|
|
1902
1902
|
);
|
|
1903
|
-
},
|
|
1904
|
-
const r =
|
|
1903
|
+
}, is = ({ heading: t, items: s }) => {
|
|
1904
|
+
const r = ge(), l = N(() => {
|
|
1905
1905
|
const o = (i) => U(
|
|
1906
|
-
i.map((
|
|
1907
|
-
),
|
|
1908
|
-
|
|
1906
|
+
i.map((n) => n.styleType === "multiple" ? C(n.options, "key") : n.property)
|
|
1907
|
+
), a = U(
|
|
1908
|
+
s.map((i) => i.styleType === "accordion" ? o(i.items) : i.styleType === "multiple" ? C(i.options, "key") : i.property)
|
|
1909
1909
|
), d = C(r, "property");
|
|
1910
|
-
return Fe(
|
|
1911
|
-
}, [r,
|
|
1910
|
+
return Fe(a, d).length > 0;
|
|
1911
|
+
}, [r, s]);
|
|
1912
1912
|
return /* @__PURE__ */ e.jsxs("details", { children: [
|
|
1913
1913
|
/* @__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: [
|
|
1914
1914
|
t,
|
|
1915
|
-
|
|
1915
|
+
l ? /* @__PURE__ */ e.jsx(
|
|
1916
1916
|
"span",
|
|
1917
1917
|
{
|
|
1918
|
-
className: `ml-1 mr-2 inline-block h-[8px] w-[8px] rounded-full ${
|
|
1918
|
+
className: `ml-1 mr-2 inline-block h-[8px] w-[8px] rounded-full ${l ? "bg-blue-500" : "bg-gray-300"}`
|
|
1919
1919
|
}
|
|
1920
1920
|
) : null
|
|
1921
1921
|
] }) }),
|
|
1922
|
-
/* @__PURE__ */ e.jsx("div", { className: "p-2", children:
|
|
1922
|
+
/* @__PURE__ */ e.jsx("div", { className: "p-2", children: s.map((o) => o.styleType === "multiple" ? /* @__PURE__ */ e.jsx(it, { ...o }, o.label) : /* @__PURE__ */ e.jsx(Se, { ...o }, o.label)) })
|
|
1923
1923
|
] });
|
|
1924
|
-
},
|
|
1925
|
-
const
|
|
1926
|
-
(
|
|
1924
|
+
}, ds = Me({}), be = ({ section: t }) => {
|
|
1925
|
+
const s = ge(), r = A(
|
|
1926
|
+
(a = []) => {
|
|
1927
1927
|
const d = {};
|
|
1928
|
-
for (let
|
|
1929
|
-
d[
|
|
1928
|
+
for (let n = 0; n < s.length; n++)
|
|
1929
|
+
d[s[n].property] = s[n].cls;
|
|
1930
1930
|
let i = !0;
|
|
1931
|
-
for (const
|
|
1932
|
-
if (!
|
|
1931
|
+
for (const n in a)
|
|
1932
|
+
if (!me(d, n) || d[n] !== a[n]) {
|
|
1933
1933
|
i = !1;
|
|
1934
1934
|
break;
|
|
1935
1935
|
}
|
|
1936
1936
|
return i;
|
|
1937
1937
|
},
|
|
1938
|
-
[
|
|
1939
|
-
),
|
|
1940
|
-
if (
|
|
1938
|
+
[s]
|
|
1939
|
+
), l = N(() => {
|
|
1940
|
+
if (s.length > 0 && t.heading === "Classes")
|
|
1941
1941
|
return !0;
|
|
1942
|
-
const
|
|
1943
|
-
|
|
1942
|
+
const a = (n) => U(
|
|
1943
|
+
n.map((p) => p.styleType === "multiple" ? U(C(p.options, "key")) : p.property)
|
|
1944
1944
|
), d = U(
|
|
1945
|
-
t.items.map((
|
|
1946
|
-
), i = C(
|
|
1945
|
+
t.items.map((n) => n.styleType === "accordion" ? a(n.items) : n.styleType === "multiple" ? U(C(n.options, "key")) : n.property)
|
|
1946
|
+
), i = C(s, "property");
|
|
1947
1947
|
return Fe(d, i).length > 0;
|
|
1948
|
-
}, [
|
|
1949
|
-
return /* @__PURE__ */ e.jsx(
|
|
1948
|
+
}, [s, t.heading, t.items]), o = N(() => ({}), []);
|
|
1949
|
+
return /* @__PURE__ */ e.jsx(ds.Provider, { value: o, children: /* @__PURE__ */ e.jsxs(ie, { value: t.heading, children: [
|
|
1950
1950
|
/* @__PURE__ */ e.jsx(de, { className: "px-3 py-2 text-xs hover:no-underline", children: /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-x-2", children: [
|
|
1951
|
-
/* @__PURE__ */ e.jsx("div", { className: `h-[8px] w-[8px] rounded-full ${
|
|
1951
|
+
/* @__PURE__ */ e.jsx("div", { className: `h-[8px] w-[8px] rounded-full ${l ? "bg-blue-500" : "bg-gray-300"}` }),
|
|
1952
1952
|
t.heading
|
|
1953
1953
|
] }) }),
|
|
1954
|
-
/* @__PURE__ */ e.jsx(ce, { className: "bg-gray-100 px-3.5 py-2", children:
|
|
1955
|
-
t.items.map((
|
|
1954
|
+
/* @__PURE__ */ e.jsx(ce, { className: "bg-gray-100 px-3.5 py-2", children: P.Children.toArray(
|
|
1955
|
+
t.items.map((a) => me(a, "component") ? P.createElement(a.component, { key: a.label }) : me(a, "styleType") ? a.styleType === "multiple" ? /* @__PURE__ */ e.jsx(it, { ...a }, a.label) : a.styleType === "accordion" && r(a == null ? void 0 : a.conditions) ? /* @__PURE__ */ e.jsx(is, { ...a }, a.label) : null : /* @__PURE__ */ e.jsx(Se, { ...a }, a.label))
|
|
1956
1956
|
) })
|
|
1957
1957
|
] }) });
|
|
1958
|
-
},
|
|
1958
|
+
}, cs = ({
|
|
1959
1959
|
item: t,
|
|
1960
|
-
index:
|
|
1960
|
+
index: s,
|
|
1961
1961
|
canDelete: r,
|
|
1962
|
-
onChange:
|
|
1962
|
+
onChange: l,
|
|
1963
1963
|
onRemove: o
|
|
1964
1964
|
}) => /* @__PURE__ */ e.jsxs("div", { className: `flex flex-col gap-1 border-gray-400 py-2 ${r ? "border-b" : ""}`, children: [
|
|
1965
1965
|
/* @__PURE__ */ e.jsx(
|
|
1966
1966
|
"input",
|
|
1967
1967
|
{
|
|
1968
1968
|
name: "key",
|
|
1969
|
-
onChange: (
|
|
1969
|
+
onChange: (a) => l(a, s),
|
|
1970
1970
|
value: t.key,
|
|
1971
1971
|
placeholder: "Key",
|
|
1972
1972
|
className: "w-full rounded border-gray-300 bg-background p-0.5 pl-2 text-sm focus-visible:outline-0",
|
|
@@ -1979,7 +1979,7 @@ const el = (t) => {
|
|
|
1979
1979
|
"input",
|
|
1980
1980
|
{
|
|
1981
1981
|
name: "value",
|
|
1982
|
-
onChange: (
|
|
1982
|
+
onChange: (a) => b(t.key) ? {} : l(a, s),
|
|
1983
1983
|
value: t.value,
|
|
1984
1984
|
placeholder: "Value",
|
|
1985
1985
|
className: "w-full rounded border-gray-300 bg-background p-0.5 pl-2 text-sm focus-visible:outline-0",
|
|
@@ -1988,34 +1988,34 @@ const el = (t) => {
|
|
|
1988
1988
|
}
|
|
1989
1989
|
),
|
|
1990
1990
|
/* @__PURE__ */ e.jsx(
|
|
1991
|
-
|
|
1991
|
+
_t,
|
|
1992
1992
|
{
|
|
1993
1993
|
onClick: o,
|
|
1994
1994
|
className: "h-6 w-6 cursor-pointer rounded border border-red-400 p-1 text-red-400 hover:opacity-80"
|
|
1995
1995
|
}
|
|
1996
1996
|
)
|
|
1997
1997
|
] })
|
|
1998
|
-
] }),
|
|
1998
|
+
] }), ps = ({ section: t }) => {
|
|
1999
1999
|
var m;
|
|
2000
|
-
const { setSyncState:
|
|
2001
|
-
|
|
2000
|
+
const { setSyncState: s } = gr(), r = G(), [l, o] = w([]), [a] = Te(), d = Ue(), i = `${u(a, "0.prop")}_attrs`;
|
|
2001
|
+
ae.useEffect(() => {
|
|
2002
2002
|
const h = C(u(r, i), (x, f) => ({ key: f, value: x }));
|
|
2003
2003
|
b(h) ? o([]) : o(h);
|
|
2004
2004
|
}, [u(r, i)]);
|
|
2005
|
-
const
|
|
2006
|
-
const x =
|
|
2005
|
+
const n = () => o([...l, { key: "", value: "" }]), p = (h) => {
|
|
2006
|
+
const x = je(l, (f, T) => h !== T);
|
|
2007
2007
|
c(x);
|
|
2008
2008
|
}, g = (h, x) => {
|
|
2009
|
-
const f = [...
|
|
2009
|
+
const f = [...l];
|
|
2010
2010
|
f[x][h.target.name] = h.target.value, c(f);
|
|
2011
|
-
}, c =
|
|
2011
|
+
}, c = ae.useCallback(
|
|
2012
2012
|
(h = []) => {
|
|
2013
2013
|
const x = {};
|
|
2014
|
-
|
|
2015
|
-
b(f.key) ||
|
|
2016
|
-
}), d([u(r, "_id")], { [i]: x }),
|
|
2014
|
+
pe(h, (f) => {
|
|
2015
|
+
b(f.key) || Ee(x, f.key, f.value);
|
|
2016
|
+
}), d([u(r, "_id")], { [i]: x }), s("UNSAVED");
|
|
2017
2017
|
},
|
|
2018
|
-
[r,
|
|
2018
|
+
[r, s, d, i]
|
|
2019
2019
|
);
|
|
2020
2020
|
return /* @__PURE__ */ e.jsxs(ie, { value: t.heading, children: [
|
|
2021
2021
|
/* @__PURE__ */ e.jsx(de, { className: "px-3 py-2 text-xs hover:no-underline", children: /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-x-2", children: [
|
|
@@ -2028,15 +2028,15 @@ const el = (t) => {
|
|
|
2028
2028
|
"Attributes"
|
|
2029
2029
|
] }) }),
|
|
2030
2030
|
/* @__PURE__ */ e.jsx(ce, { className: "bg-gray-100 px-3.5 py-2", children: /* @__PURE__ */ e.jsxs("div", { className: "no-scrollbar flex min-h-max flex-col gap-y-2 overflow-y-auto bg-gray-100 p-px", children: [
|
|
2031
|
-
/* @__PURE__ */ e.jsxs(
|
|
2031
|
+
/* @__PURE__ */ e.jsxs(Re, { className: "mt-2 flex w-full items-center justify-between", children: [
|
|
2032
2032
|
"Add Custom attributes",
|
|
2033
2033
|
/* @__PURE__ */ e.jsxs(
|
|
2034
2034
|
"div",
|
|
2035
2035
|
{
|
|
2036
|
-
className: `flex h-6 w-max items-center justify-center gap-x-0.5 rounded-full border p-1 px-2 text-xs ${!b(
|
|
2036
|
+
className: `flex h-6 w-max items-center justify-center gap-x-0.5 rounded-full border p-1 px-2 text-xs ${!b(l) && b((m = ve(l)) == null ? void 0 : m.key) ? "cursor-not-allowed border-gray-400 text-gray-400" : "cursor-pointer border-blue-400 text-blue-400 hover:bg-blue-400 hover:text-white"}`,
|
|
2037
2037
|
onClick: () => {
|
|
2038
2038
|
var h;
|
|
2039
|
-
!b(
|
|
2039
|
+
!b(l) && b((h = ve(l)) == null ? void 0 : h.key) || n();
|
|
2040
2040
|
},
|
|
2041
2041
|
children: [
|
|
2042
2042
|
/* @__PURE__ */ e.jsx(ke, { width: 12, height: 12 }),
|
|
@@ -2046,12 +2046,12 @@ const el = (t) => {
|
|
|
2046
2046
|
)
|
|
2047
2047
|
] }),
|
|
2048
2048
|
/* @__PURE__ */ e.jsxs("div", { className: "flex flex-col", children: [
|
|
2049
|
-
b(
|
|
2050
|
-
|
|
2051
|
-
C(
|
|
2052
|
-
const f =
|
|
2049
|
+
b(l) && /* @__PURE__ */ e.jsx("div", { className: "flex h-12 items-center justify-center text-sm text-gray-400", children: "Click + Add to add attributes" }),
|
|
2050
|
+
ae.Children.toArray(
|
|
2051
|
+
C(l, (h, x) => {
|
|
2052
|
+
const f = l.length > 0 && x < l.length - 1;
|
|
2053
2053
|
return /* @__PURE__ */ e.jsx(
|
|
2054
|
-
|
|
2054
|
+
cs,
|
|
2055
2055
|
{
|
|
2056
2056
|
item: h,
|
|
2057
2057
|
index: x,
|
|
@@ -2066,11 +2066,11 @@ const el = (t) => {
|
|
|
2066
2066
|
] }) })
|
|
2067
2067
|
] });
|
|
2068
2068
|
};
|
|
2069
|
-
function
|
|
2070
|
-
const [t,
|
|
2069
|
+
function us() {
|
|
2070
|
+
const [t, s] = Qe(), { flexChild: r, gridChild: l } = hr(), [, o] = Hr(mr), { t: a } = We(), [d] = Te();
|
|
2071
2071
|
return b(d) ? /* @__PURE__ */ e.jsx("div", { className: "p-4 text-center", children: /* @__PURE__ */ e.jsxs("div", { className: "space-y-4 rounded-xl p-4", children: [
|
|
2072
2072
|
/* @__PURE__ */ e.jsx(Ze, { className: "mx-auto text-3xl" }),
|
|
2073
|
-
/* @__PURE__ */ e.jsx("h1", { children:
|
|
2073
|
+
/* @__PURE__ */ e.jsx("h1", { children: a("no_styling_block_selected") }),
|
|
2074
2074
|
/* @__PURE__ */ e.jsxs("p", { className: "text-xs ", children: [
|
|
2075
2075
|
"Hint: Styling allowed blocks are highlighted with",
|
|
2076
2076
|
" ",
|
|
@@ -2081,10 +2081,10 @@ function xl() {
|
|
|
2081
2081
|
// eslint-disable-next-line jsx-a11y/click-events-have-key-events,jsx-a11y/no-static-element-interactions
|
|
2082
2082
|
/* @__PURE__ */ e.jsxs("div", { onClick: () => o(!1), className: "flex h-full flex-col", children: [
|
|
2083
2083
|
/* @__PURE__ */ e.jsx("div", { className: "flex flex-col space-x-4 space-y-3 border-b h-12 border-border px-4 py-1", children: /* @__PURE__ */ e.jsxs("div", { className: "flex items-center justify-end gap-x-1.5", children: [
|
|
2084
|
-
/* @__PURE__ */ e.jsx(
|
|
2085
|
-
/* @__PURE__ */ e.jsxs(
|
|
2086
|
-
/* @__PURE__ */ e.jsx(
|
|
2087
|
-
/* @__PURE__ */ e.jsxs(
|
|
2084
|
+
/* @__PURE__ */ e.jsx(Re, { htmlFor: "", className: "flex gap-x-1.5 text-xs italic", children: "State" }),
|
|
2085
|
+
/* @__PURE__ */ e.jsxs(yr, { defaultValue: t, onValueChange: (i) => s(i), children: [
|
|
2086
|
+
/* @__PURE__ */ e.jsx(br, { className: "h-auto w-fit p-1 px-3", children: /* @__PURE__ */ e.jsx(fr, { placeholder: "State" }) }),
|
|
2087
|
+
/* @__PURE__ */ e.jsxs(vr, { children: [
|
|
2088
2088
|
/* @__PURE__ */ e.jsx(H, { value: "", children: "Normal" }),
|
|
2089
2089
|
/* @__PURE__ */ e.jsx(H, { value: "hover", children: "Hover" }),
|
|
2090
2090
|
/* @__PURE__ */ e.jsx(H, { value: "active", children: "Active" }),
|
|
@@ -2101,15 +2101,15 @@ function xl() {
|
|
|
2101
2101
|
] })
|
|
2102
2102
|
] }) }),
|
|
2103
2103
|
/* @__PURE__ */ e.jsx(et, { className: "no-scrollbar -mx-1 flex-1 max-h-full overflow-y-hidden overflow-x-hidden", children: /* @__PURE__ */ e.jsxs(Ge, { defaultValue: ["Layout"], type: "multiple", className: "w-full", children: [
|
|
2104
|
-
r && /* @__PURE__ */ e.jsx(
|
|
2105
|
-
|
|
2106
|
-
|
|
2107
|
-
/* @__PURE__ */ e.jsx(
|
|
2104
|
+
r && /* @__PURE__ */ e.jsx(be, { section: Yr }),
|
|
2105
|
+
l ? /* @__PURE__ */ e.jsx(be, { section: Xr }) : null,
|
|
2106
|
+
Zr.map((i) => /* @__PURE__ */ e.jsx(be, { section: i }, i.heading)),
|
|
2107
|
+
/* @__PURE__ */ e.jsx(ps, { section: { heading: "Attributes" } })
|
|
2108
2108
|
] }) })
|
|
2109
2109
|
] })
|
|
2110
2110
|
);
|
|
2111
2111
|
}
|
|
2112
|
-
const
|
|
2112
|
+
const xs = {
|
|
2113
2113
|
px: 1,
|
|
2114
2114
|
"%": 1,
|
|
2115
2115
|
em: 100,
|
|
@@ -2120,32 +2120,32 @@ const gl = {
|
|
|
2120
2120
|
"-": 1,
|
|
2121
2121
|
deg: 1,
|
|
2122
2122
|
ms: 0.1
|
|
2123
|
-
},
|
|
2124
|
-
const t = G(), { t:
|
|
2125
|
-
onDrag: (
|
|
2126
|
-
onDragEnd: (
|
|
2123
|
+
}, hl = () => {
|
|
2124
|
+
const t = G(), { t: s } = We(), [r, l] = P.useState(""), [o, a] = P.useState({
|
|
2125
|
+
onDrag: (n) => n,
|
|
2126
|
+
onDragEnd: (n) => n,
|
|
2127
2127
|
dragStartY: 0,
|
|
2128
2128
|
dragging: !1,
|
|
2129
2129
|
dragStartValue: 0,
|
|
2130
2130
|
dragUnit: "",
|
|
2131
2131
|
negative: !1,
|
|
2132
2132
|
cssProperty: ""
|
|
2133
|
-
}), d =
|
|
2134
|
-
(
|
|
2133
|
+
}), d = fe(
|
|
2134
|
+
(n) => {
|
|
2135
2135
|
const p = !u(o, "negative", !1), g = u(o, "cssProperty", "");
|
|
2136
2136
|
let c = parseFloat(o.dragStartValue);
|
|
2137
2137
|
c = _e(c) ? 0 : c;
|
|
2138
|
-
let m =
|
|
2138
|
+
let m = xs[o.dragUnit];
|
|
2139
2139
|
(z(g, "scale") || g === "opacity") && (m = 10);
|
|
2140
|
-
let x = (o.dragStartY -
|
|
2141
|
-
p && x < 0 && (x = 0), g === "opacity" && x > 1 && (x = 1), o.onDrag(`${x}`),
|
|
2140
|
+
let x = (o.dragStartY - n.pageY) / m + c;
|
|
2141
|
+
p && x < 0 && (x = 0), g === "opacity" && x > 1 && (x = 1), o.onDrag(`${x}`), l(`${x}`);
|
|
2142
2142
|
},
|
|
2143
2143
|
[o],
|
|
2144
2144
|
50
|
|
2145
2145
|
), i = A(() => {
|
|
2146
|
-
setTimeout(() => o.onDragEnd(`${r}`), 100),
|
|
2147
|
-
onDrag: (
|
|
2148
|
-
onDragEnd: (
|
|
2146
|
+
setTimeout(() => o.onDragEnd(`${r}`), 100), a({
|
|
2147
|
+
onDrag: (n) => n,
|
|
2148
|
+
onDragEnd: (n) => n,
|
|
2149
2149
|
dragStartY: 0,
|
|
2150
2150
|
dragging: !1,
|
|
2151
2151
|
dragStartValue: 0,
|
|
@@ -2153,11 +2153,11 @@ const gl = {
|
|
|
2153
2153
|
negative: !1,
|
|
2154
2154
|
cssProperty: ""
|
|
2155
2155
|
});
|
|
2156
|
-
}, [o, r,
|
|
2157
|
-
return
|
|
2156
|
+
}, [o, r, a]);
|
|
2157
|
+
return wt(t) ? /* @__PURE__ */ e.jsx("div", { className: "p-4 text-center", children: /* @__PURE__ */ e.jsxs("div", { className: "space-y-4 rounded-xl p-4", children: [
|
|
2158
2158
|
/* @__PURE__ */ e.jsx(Ze, { className: "mx-auto text-3xl" }),
|
|
2159
|
-
/* @__PURE__ */ e.jsx("h1", { children:
|
|
2160
|
-
] }) }) : /* @__PURE__ */ e.jsx(rt, { children: /* @__PURE__ */ e.jsxs(
|
|
2159
|
+
/* @__PURE__ */ e.jsx("h1", { children: s("no_block_selected_for_styling") })
|
|
2160
|
+
] }) }) : /* @__PURE__ */ e.jsx(rt, { children: /* @__PURE__ */ e.jsxs(nt.Provider, { value: { setDragData: a }, children: [
|
|
2161
2161
|
o.dragging ? /* @__PURE__ */ e.jsx(
|
|
2162
2162
|
"div",
|
|
2163
2163
|
{
|
|
@@ -2166,8 +2166,8 @@ const gl = {
|
|
|
2166
2166
|
className: "absolute inset-0 z-30 cursor-row-resize bg-gray-300/10 "
|
|
2167
2167
|
}
|
|
2168
2168
|
) : null,
|
|
2169
|
-
/* @__PURE__ */ e.jsxs(
|
|
2170
|
-
/* @__PURE__ */ e.jsxs(
|
|
2169
|
+
/* @__PURE__ */ e.jsxs(jr, { defaultValue: "settings", className: "flex h-full w-full flex-col py-1", children: [
|
|
2170
|
+
/* @__PURE__ */ e.jsxs(wr, { className: "mx-1 grid grid-cols-2", children: [
|
|
2171
2171
|
/* @__PURE__ */ e.jsx(Ae, { value: "settings", children: "Settings" }),
|
|
2172
2172
|
/* @__PURE__ */ e.jsx(Ae, { value: "styling", children: "Styling" })
|
|
2173
2173
|
] }),
|
|
@@ -2176,13 +2176,13 @@ const gl = {
|
|
|
2176
2176
|
{
|
|
2177
2177
|
value: "settings",
|
|
2178
2178
|
className: "no-scrollbar -mx-1 -mr-2 h-full flex-1 overflow-y-auto overflow-x-hidden",
|
|
2179
|
-
children: /* @__PURE__ */ e.jsx(et, { className: "no-scrollbar -mx-1 pb-5 flex-1 max-h-full overflow-y-hidden overflow-x-hidden", children: /* @__PURE__ */ e.jsx(
|
|
2179
|
+
children: /* @__PURE__ */ e.jsx(et, { className: "no-scrollbar -mx-1 pb-5 flex-1 max-h-full overflow-y-hidden overflow-x-hidden", children: /* @__PURE__ */ e.jsx(Fr, {}) })
|
|
2180
2180
|
}
|
|
2181
2181
|
),
|
|
2182
|
-
/* @__PURE__ */ e.jsx(De, { value: "styling", className: "flex-1 h-full overflow-y-auto overflow-x-hidden", children: /* @__PURE__ */ e.jsx(
|
|
2182
|
+
/* @__PURE__ */ e.jsx(De, { value: "styling", className: "flex-1 h-full overflow-y-auto overflow-x-hidden", children: /* @__PURE__ */ e.jsx(us, {}) })
|
|
2183
2183
|
] })
|
|
2184
2184
|
] }) });
|
|
2185
2185
|
};
|
|
2186
2186
|
export {
|
|
2187
|
-
|
|
2187
|
+
hl as default
|
|
2188
2188
|
};
|