@chaibuilder/sdk 1.2.16 → 1.2.17
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/README.md +6 -4
- package/dist/{AddBlocks-TBFBvBvo.js → AddBlocks--SllKzEG.js} +81 -81
- package/dist/AddBlocks-7TF41ISQ.cjs +1 -0
- package/dist/{BrandingOptions-t_MjeHSM.js → BrandingOptions-IqtZrxqX.js} +14 -15
- package/dist/BrandingOptions-uKE1vuWd.cjs +1 -0
- package/dist/{CanvasArea-ZYC8QbQB.js → CanvasArea-T1XNnB7d.js} +89 -95
- package/dist/{CanvasArea-oTylYgH9.cjs → CanvasArea-iLUw-tom.cjs} +3 -3
- package/dist/{Class-17XFhL48.js → Class-3k8xjeiM.js} +1 -1
- package/dist/{Class-5ARpH_Tu.cjs → Class-MmCxz2Ay.cjs} +1 -1
- package/dist/CurrentPage-N5hSL1xB.cjs +1 -0
- package/dist/{CurrentPage-4vC6olJo.js → CurrentPage-TCduhO-X.js} +16 -16
- package/dist/MODIFIERS-9EwxLM8V.cjs +1 -0
- package/dist/{MODIFIERS-RiXS5Mn1.js → MODIFIERS-WQdaNvb8.js} +5 -4
- package/dist/{Layers-m61dThGR.js → Outline-3IPrK7F-.js} +153 -145
- package/dist/Outline-g4TXJ-hK.cjs +1 -0
- package/dist/{PagesPanel-v3KV_vfG.js → PagesPanel-7goyNL8t.js} +10 -10
- package/dist/PagesPanel-qI3sijis.cjs +1 -0
- package/dist/{ProjectPanel-xsUuVX64.js → ProjectPanel-CdPFwsXg.js} +8 -8
- package/dist/ProjectPanel-bMllQ4_a.cjs +1 -0
- package/dist/Settings-8f4ivm4-.cjs +1 -0
- package/dist/{Settings-ZNxfF14G.js → Settings-pva9XRUC.js} +293 -293
- package/dist/SidePanels-7HqZM4-j.cjs +1 -0
- package/dist/SidePanels-u5QXQrWL.js +389 -0
- package/dist/Topbar-S3zgo3N8.js +129 -0
- package/dist/Topbar-poeqjjZb.cjs +1 -0
- package/dist/{UnsplashImages-ppQXZ28F.js → UnsplashImages-132gZ842.js} +13 -13
- package/dist/{UnsplashImages-SrxA-yNu.cjs → UnsplashImages-BOypn-e5.cjs} +1 -1
- package/dist/UploadImages-giiNNHKq.cjs +1 -0
- package/dist/{UploadImages-IKR4oX2k.js → UploadImages-tr54Ik1I.js} +35 -31
- package/dist/{add-page-modal-pc5-Yw4C.js → add-page-modal-AsP5g0Fp.js} +13 -12
- package/dist/add-page-modal-ajpd-Gmw.cjs +1 -0
- package/dist/{confirm-alert-uV_PtYc3.cjs → confirm-alert-bw0VBgoG.cjs} +1 -1
- package/dist/{confirm-alert-QKtbNbWz.js → confirm-alert-dYoU1ln_.js} +5 -5
- package/dist/controls-Dy1qa8Dc.cjs +1 -0
- package/dist/{empty-slot-5FRrRq1E.js → controls-XPXGHKht.js} +50 -61
- package/dist/core.cjs +1 -1
- package/dist/core.d.ts +16 -1
- package/dist/core.js +47 -53
- package/dist/{defaultTheme-IH19g4fv.cjs → defaultTheme-1XwPZT2b.cjs} +1 -1
- package/dist/{defaultTheme-YY8mlQS3.js → defaultTheme-s0cpA5Oy.js} +1 -1
- package/dist/delete-page-modal-H4JOWYZe.cjs +1 -0
- package/dist/{delete-page-modal-Zf3-4wLg.js → delete-page-modal-_Hy6ls6b.js} +12 -12
- package/dist/email-blocks.cjs +1 -1
- package/dist/email-blocks.js +11 -10
- package/dist/email.cjs +1 -1
- package/dist/email.d.ts +13 -0
- package/dist/email.js +7 -12
- package/dist/empty-slot-ZBlsQi6m.js +15 -0
- package/dist/empty-slot-nzYOgZuS.cjs +1 -0
- package/dist/{form-faX0Yn4Q.js → form-f13cs-An.js} +1 -1
- package/dist/{form-KkP1F7h1.cjs → form-jzX2YXUO.cjs} +1 -1
- package/dist/{html-to-json-57841sEK.js → html-to-json-C5sExaSD.js} +1 -1
- package/dist/{html-to-json-2PeOCVey.cjs → html-to-json-FGufPv9R.cjs} +1 -1
- package/dist/index-0JU8vPT_.cjs +206 -0
- package/dist/index-4xyhDki2.cjs +1 -0
- package/dist/index-MQH3blB-.cjs +1 -0
- package/dist/{index-QGA4ayU7.js → index-MaXiXghQ.js} +246 -246
- package/dist/index-YpnaudSM.js +63 -0
- package/dist/index-ecnGWzh9.cjs +1 -0
- package/dist/{index-rktN6W1Y.js → index-eyVVbA05.js} +22845 -25123
- package/dist/index-ugsWasKp.js +2202 -0
- package/dist/lib.cjs +1 -1
- package/dist/lib.js +5 -5
- package/dist/{page-viewer-Cv_WZY-t.js → page-viewer-P5Im9RfR.js} +11 -11
- package/dist/page-viewer-Xj9v8mji.cjs +1 -0
- package/dist/project-general-setting--5DT1RoW.cjs +1 -0
- package/dist/{project-general-setting-x6qqF0T8.js → project-general-setting-R3pVVXmY.js} +11 -10
- package/dist/project-seo-setting-3DzzF83_.cjs +1 -0
- package/dist/{project-seo-setting-Sl6AE-Q7.js → project-seo-setting-pGpm3-6U.js} +7 -7
- package/dist/render.cjs +1 -1
- package/dist/render.js +2 -2
- package/dist/{single-page-detail-sGbwXXs1.js → single-page-detail-m-THVQnz.js} +43 -42
- package/dist/single-page-detail-nJzGUDym.cjs +1 -0
- package/dist/studio.cjs +1 -1
- package/dist/studio.d.ts +13 -0
- package/dist/studio.js +7 -7
- package/dist/ui.cjs +1 -1
- package/dist/ui.d.ts +4 -4
- package/dist/ui.js +50 -50
- package/dist/useAddBlockByDrop-6qaL4Ufz.cjs +1 -0
- package/dist/useAddBlockByDrop-vGme3brY.js +20 -0
- package/dist/web-blocks.cjs +1 -1
- package/dist/web-blocks.js +4 -3
- package/package.json +1 -1
- package/dist/AddBlocks-FUKuRbn6.cjs +0 -1
- package/dist/BrandingOptions-tBWzqas5.cjs +0 -1
- package/dist/CurrentPage-g8aT56B2.cjs +0 -1
- package/dist/Layers-fEb6biiU.cjs +0 -1
- package/dist/MODIFIERS-2FeVfZQ9.cjs +0 -1
- package/dist/PagesPanel-ewHplHej.cjs +0 -1
- package/dist/ProjectPanel-pgpe3fyR.cjs +0 -1
- package/dist/Settings-zk2jUrHc.cjs +0 -1
- package/dist/SidePanels-MbJufIbe.js +0 -352
- package/dist/SidePanels-zXHw8T3P.cjs +0 -1
- package/dist/Topbar-iH2L4pe0.cjs +0 -1
- package/dist/Topbar-ryFhl-PC.js +0 -114
- package/dist/UploadImages-VBiO6lqp.cjs +0 -1
- package/dist/add-page-modal-myA0a2nW.cjs +0 -1
- package/dist/delete-page-modal-q4G_-zBl.cjs +0 -1
- package/dist/empty-slot-2LSrWJaY.cjs +0 -1
- package/dist/index-DT71IahS.cjs +0 -206
- package/dist/index-ERorPL9q.cjs +0 -1
- package/dist/page-viewer-z9Kn4i1K.cjs +0 -1
- package/dist/project-general-setting-ZiLidijs.cjs +0 -1
- package/dist/project-seo-setting-8oJUrOqk.cjs +0 -1
- package/dist/single-page-detail-cnwttu4D.cjs +0 -1
- package/dist/useAddBlockByDrop-LBgi6GL7.cjs +0 -1
- package/dist/useAddBlockByDrop-Y-g4O8UC.js +0 -20
|
@@ -2,22 +2,22 @@ import { j as e } from "./jsx-runtime-WbnYoNE9.js";
|
|
|
2
2
|
import * as ne from "react";
|
|
3
3
|
import P, { useState as C, useMemo as _, useEffect as O, useCallback as V, memo as dt, createContext as Me, useContext as se } from "react";
|
|
4
4
|
import { useThrottledCallback as fe } from "@react-hookz/web";
|
|
5
|
-
import { forEach as ke, isArray as ie, omit as ct, truncate as pt, includes as E, get as x, first as ue, split as ut, startCase as Y, toLower as le, isEmpty as f, map as k, find as xt, last as ve, filter as we, set as Oe, debounce as gt, keys as ht, cloneDeep as yt, each as
|
|
5
|
+
import { forEach as ke, isArray as ie, omit as ct, truncate as pt, includes as E, get as x, first as ue, split as ut, startCase as Y, toLower as le, isEmpty as f, map as k, find as xt, last as ve, filter as we, set as Oe, debounce as gt, keys as ht, cloneDeep as yt, each as bt, capitalize as mt, reject as ft, nth as Ve, startsWith as W, isNumber as vt, parseInt as wt, isNaN as Fe, findLast as jt, flatten as U, intersection as Ye, has as ye, isNull as Ct } from "lodash-es";
|
|
6
6
|
import { useTranslation as K } from "react-i18next";
|
|
7
|
-
import { PlusIcon as Ne, Cross2Icon as Xe, EyeOpenIcon as kt, EyeClosedIcon as He, BorderAllIcon as A, WidthIcon as
|
|
8
|
-
import {
|
|
9
|
-
import { u as _r } from "./
|
|
10
|
-
import { Check as
|
|
11
|
-
import { getBlockComponent as et, getChaiDataProviders as
|
|
12
|
-
import { E as tt, u as rt } from "./index-
|
|
13
|
-
import { J as
|
|
14
|
-
import
|
|
15
|
-
import
|
|
16
|
-
import { useAtom as
|
|
17
|
-
import
|
|
18
|
-
import
|
|
19
|
-
import { A as
|
|
20
|
-
import { a as
|
|
7
|
+
import { PlusIcon as Ne, Cross2Icon as Xe, EyeOpenIcon as kt, EyeClosedIcon as He, BorderAllIcon as A, WidthIcon as T, HeightIcon as R, ArrowUpIcon as Q, ArrowRightIcon as ee, ArrowDownIcon as te, ArrowLeftIcon as re, ArrowTopLeftIcon as Nt, ArrowTopRightIcon as _t, ArrowBottomRightIcon as St, ArrowBottomLeftIcon as Tt, AlignLeftIcon as Rt, AlignCenterHorizontallyIcon as Vt, AlignRightIcon as Ht, StretchHorizontallyIcon as Bt, FontItalicIcon as Dt, UnderlineIcon as $t, OverlineIcon as It, LetterCaseUppercaseIcon as Pt, Cross1Icon as At, InfoCircledIcon as _e, MinusIcon as Et, BoxIcon as ze, RowSpacingIcon as Lt, TriangleDownIcon as Mt, CrossCircledIcon as Ot, TrashIcon as Ft, MixerHorizontalIcon as Ze } from "@radix-ui/react-icons";
|
|
8
|
+
import { aV as Yt, aW as Xt, B as xe, aX as zt, aY as Zt, aZ as Wt, a_ as Ut, a$ as Kt, b0 as qt, b1 as Gt, a1 as q, af as Jt, ag as Qt, ah as er, b2 as tr, ad as rr, ao as lr, ae as sr, ap as X, aq as z, ar as Z, b3 as or, b4 as ar, b5 as nr, b6 as ir, b7 as dr, b8 as cr, a6 as We, a5 as pr, h as ur, b9 as Ue, ba as de, bb as ce, bc as pe, ac as Se, M as Ke, _ as qe, r as Ge, aB as Te, bd as xr, v as gr, be as hr, $ as ge, V as yr, a4 as Je, N as Be, z as br, a7 as mr, bf as fr, aj as vr, ak as wr, al as jr, am as Cr, an as H, bg as Qe, au as kr, av as Nr, aw as De, ax as $e } from "./index-MaXiXghQ.js";
|
|
9
|
+
import { u as _r } from "./controls-XPXGHKht.js";
|
|
10
|
+
import { Check as Sr, EditIcon as Tr, TrashIcon as Rr, BrushIcon as Vr } from "lucide-react";
|
|
11
|
+
import { getBlockComponent as et, getChaiDataProviders as Hr } from "@chaibuilder/runtime";
|
|
12
|
+
import { E as tt, u as rt } from "./index-eyVVbA05.js";
|
|
13
|
+
import { J as Br, a as Dr, d as $r } from "./index-e0c8PmRQ.js";
|
|
14
|
+
import Ir from "@rjsf/core";
|
|
15
|
+
import Pr from "@rjsf/validator-ajv8";
|
|
16
|
+
import { useAtom as Ar } from "jotai";
|
|
17
|
+
import Er from "react-autosuggest";
|
|
18
|
+
import Lr from "fuse.js";
|
|
19
|
+
import { A as Mr, C as he, g as Or } from "./Class-3k8xjeiM.js";
|
|
20
|
+
import { a as Fr } from "./MODIFIERS-WQdaNvb8.js";
|
|
21
21
|
import "./_commonjsHelpers-UyOWmZb0.js";
|
|
22
22
|
import "./Functions-7jnEwJyw.js";
|
|
23
23
|
import "clsx";
|
|
@@ -53,14 +53,10 @@ import "flagged";
|
|
|
53
53
|
import "react-dnd";
|
|
54
54
|
import "@minoru/react-dnd-treeview";
|
|
55
55
|
import "react-hotkeys-hook";
|
|
56
|
-
|
|
57
|
-
import "./html-to-json-57841sEK.js";
|
|
58
|
-
import "himalaya";
|
|
59
|
-
import "./web-blocks.js";
|
|
60
|
-
function Fr(r) {
|
|
56
|
+
function Yr(r) {
|
|
61
57
|
const o = [], t = {};
|
|
62
|
-
function s(l,
|
|
63
|
-
ke(
|
|
58
|
+
function s(l, i) {
|
|
59
|
+
ke(i, (a, c) => {
|
|
64
60
|
const n = l ? `${l}.${c}` : c, u = ie(a) ? "list" : typeof a;
|
|
65
61
|
o.push(n), t[n] = u === "string" ? "text" : u === "object" ? "model" : u, u === "object" && !ie(a) && s(n, a);
|
|
66
62
|
});
|
|
@@ -74,12 +70,12 @@ const je = ({ data: r, fullView: o }) => {
|
|
|
74
70
|
return o ? typeof r == "object" ? /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
75
71
|
/* @__PURE__ */ e.jsx("div", { className: "h-3" }),
|
|
76
72
|
/* @__PURE__ */ e.jsx(tt, { children: /* @__PURE__ */ e.jsx(
|
|
77
|
-
|
|
73
|
+
Br,
|
|
78
74
|
{
|
|
79
75
|
data: r,
|
|
80
|
-
shouldExpandNode:
|
|
76
|
+
shouldExpandNode: Dr,
|
|
81
77
|
style: {
|
|
82
|
-
|
|
78
|
+
...$r,
|
|
83
79
|
container: "max-h-[40vh] overflow-y-auto text-[12px] leading-[1.5] tracking-wide font-mono",
|
|
84
80
|
stringValue: "text-orange-600",
|
|
85
81
|
label: "text-green-900 font-semibold pr-1 tracking-wider"
|
|
@@ -96,18 +92,18 @@ const je = ({ data: r, fullView: o }) => {
|
|
|
96
92
|
setValue: t,
|
|
97
93
|
data: s,
|
|
98
94
|
onChange: l,
|
|
99
|
-
dataType:
|
|
95
|
+
dataType: i,
|
|
100
96
|
appliedBindings: a
|
|
101
97
|
}) => {
|
|
102
|
-
const { paths: c, pathsType: n } =
|
|
98
|
+
const { paths: c, pathsType: n } = Yr(s), u = r === "PROP" ? et(s == null ? void 0 : s._type) : {}, y = r === "PROP", [d, h] = C(!1), g = _(() => r === "PROP" ? c.filter(
|
|
103
99
|
(p) => !E(a, p) && x(u, `props.${ue(ut(p, "."))}.binding`)
|
|
104
|
-
) : c.filter((p) =>
|
|
100
|
+
) : c.filter((p) => i === x(n, p, "")), [r, c, a, i, u]);
|
|
105
101
|
return O(() => {
|
|
106
102
|
o && l(o);
|
|
107
103
|
}, [o, r]), /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
108
104
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-4", children: [
|
|
109
105
|
/* @__PURE__ */ e.jsx("p", { className: "text-sm text-muted-foreground", children: Y(le(r)) }),
|
|
110
|
-
/* @__PURE__ */ e.jsxs(Yt, { open:
|
|
106
|
+
/* @__PURE__ */ e.jsxs(Yt, { open: d, onOpenChange: h, children: [
|
|
111
107
|
/* @__PURE__ */ e.jsx(Xt, { asChild: !0, children: /* @__PURE__ */ e.jsx(
|
|
112
108
|
xe,
|
|
113
109
|
{
|
|
@@ -116,7 +112,7 @@ const je = ({ data: r, fullView: o }) => {
|
|
|
116
112
|
className: ` ${f(o) ? "w-44 justify-center bg-blue-500 text-gray-100 hover:bg-blue-400 hover:text-white" : "min-w-[350px] items-center justify-between"}`,
|
|
117
113
|
children: o ? /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
118
114
|
/* @__PURE__ */ e.jsxs("span", { className: "pr-8 text-sm", children: [
|
|
119
|
-
y && /* @__PURE__ */ e.jsx("span", { className: "mr-2 rounded-full bg-purple-100 px-2 py-0.5 text-[10px] text-purple-500", children: Y(
|
|
115
|
+
y && /* @__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) }),
|
|
120
116
|
o
|
|
121
117
|
] }),
|
|
122
118
|
/* @__PURE__ */ e.jsx("span", { className: "cursor-pointer text-[9px] text-blue-400 underline hover:text-blue-700", children: "Change" })
|
|
@@ -135,12 +131,12 @@ const je = ({ data: r, fullView: o }) => {
|
|
|
135
131
|
{
|
|
136
132
|
value: p,
|
|
137
133
|
className: `cursor-pointer ${y ? "flex items-center justify-between" : "flex flex-col items-start justify-start"}`,
|
|
138
|
-
onSelect: (
|
|
139
|
-
t(xt(g, (w) => w ===
|
|
134
|
+
onSelect: (m) => {
|
|
135
|
+
t(xt(g, (w) => w === m) || null), h(!1);
|
|
140
136
|
},
|
|
141
137
|
children: [
|
|
142
138
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-x-2", children: [
|
|
143
|
-
/* @__PURE__ */ e.jsx(
|
|
139
|
+
/* @__PURE__ */ e.jsx(Sr, { className: `h-4 w-4 text-green-500 ${o === p ? "" : "opacity-0"}` }),
|
|
144
140
|
p
|
|
145
141
|
] }),
|
|
146
142
|
y ? /* @__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(x(n, p, "")) }) }) : /* @__PURE__ */ e.jsx("div", { className: "pl-6", children: /* @__PURE__ */ e.jsx(je, { data: x(s, p) }) })
|
|
@@ -154,26 +150,26 @@ const je = ({ data: r, fullView: o }) => {
|
|
|
154
150
|
] }),
|
|
155
151
|
!y && !f(o) && /* @__PURE__ */ e.jsx("div", { className: "pt-2", children: /* @__PURE__ */ e.jsx(je, { data: x(s, o, ""), fullView: !0 }) })
|
|
156
152
|
] });
|
|
157
|
-
},
|
|
153
|
+
}, Xr = ({
|
|
158
154
|
appliedBindings: r = [],
|
|
159
155
|
onAddBinding: o,
|
|
160
156
|
editMode: t,
|
|
161
157
|
item: s
|
|
162
158
|
}) => {
|
|
163
|
-
const [l,
|
|
159
|
+
const [l, i] = C(t ? s.key : ""), [a, c] = C(t ? s.value : ""), n = q(), [u] = rt(), y = V(
|
|
164
160
|
(g, p) => {
|
|
165
161
|
if (f(g))
|
|
166
162
|
return "";
|
|
167
163
|
{
|
|
168
|
-
const
|
|
169
|
-
if (ie(
|
|
164
|
+
const m = x(p === "PROP" ? n : u, g, "");
|
|
165
|
+
if (ie(m))
|
|
170
166
|
return "list";
|
|
171
|
-
const w = typeof
|
|
167
|
+
const w = typeof m;
|
|
172
168
|
return w === "string" ? "text" : w === "object" ? "model" : w;
|
|
173
169
|
}
|
|
174
170
|
},
|
|
175
171
|
[n, u]
|
|
176
|
-
), [
|
|
172
|
+
), [d, h] = C(t ? y(s.key, "PROP") : "");
|
|
177
173
|
return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
178
174
|
/* @__PURE__ */ e.jsxs(Jt, { children: [
|
|
179
175
|
/* @__PURE__ */ e.jsx(Qt, { children: "Add Data Binding" }),
|
|
@@ -187,13 +183,13 @@ const je = ({ data: r, fullView: o }) => {
|
|
|
187
183
|
isDisabled: !1,
|
|
188
184
|
placeholder: "Enter prop key",
|
|
189
185
|
value: l,
|
|
190
|
-
setValue:
|
|
186
|
+
setValue: i,
|
|
191
187
|
onChange: (g) => {
|
|
192
188
|
const p = y(g, "PROP");
|
|
193
|
-
|
|
189
|
+
i(g), d !== p && c(""), h(p);
|
|
194
190
|
},
|
|
195
191
|
data: n,
|
|
196
|
-
dataType:
|
|
192
|
+
dataType: d,
|
|
197
193
|
appliedBindings: r
|
|
198
194
|
}
|
|
199
195
|
),
|
|
@@ -208,10 +204,10 @@ const je = ({ data: r, fullView: o }) => {
|
|
|
208
204
|
setValue: c,
|
|
209
205
|
onChange: (g) => {
|
|
210
206
|
const p = y(g, "PATH");
|
|
211
|
-
c(
|
|
207
|
+
c(d === p ? g : "");
|
|
212
208
|
},
|
|
213
209
|
data: u,
|
|
214
|
-
dataType:
|
|
210
|
+
dataType: d,
|
|
215
211
|
appliedBindings: r
|
|
216
212
|
}
|
|
217
213
|
)
|
|
@@ -227,14 +223,14 @@ const je = ({ data: r, fullView: o }) => {
|
|
|
227
223
|
}
|
|
228
224
|
) })
|
|
229
225
|
] });
|
|
230
|
-
}, lt = ({ disabled: r, children: o, onAddBinding: t, appliedBindings: s, editMode: l = !0, item:
|
|
226
|
+
}, lt = ({ disabled: r, children: o, onAddBinding: t, appliedBindings: s, editMode: l = !0, item: i = {} }) => {
|
|
231
227
|
const [a, c] = C(!1);
|
|
232
228
|
return /* @__PURE__ */ e.jsxs(rr, { children: [
|
|
233
229
|
/* @__PURE__ */ e.jsx(lr, { disabled: r, asChild: !0, onClick: () => c(!0), children: o }),
|
|
234
230
|
a && /* @__PURE__ */ e.jsx(sr, { children: /* @__PURE__ */ e.jsx(
|
|
235
|
-
|
|
231
|
+
Xr,
|
|
236
232
|
{
|
|
237
|
-
item:
|
|
233
|
+
item: i,
|
|
238
234
|
editMode: l,
|
|
239
235
|
appliedBindings: s,
|
|
240
236
|
onAddBinding: (n) => {
|
|
@@ -243,22 +239,22 @@ const je = ({ data: r, fullView: o }) => {
|
|
|
243
239
|
}
|
|
244
240
|
) })
|
|
245
241
|
] });
|
|
246
|
-
},
|
|
242
|
+
}, zr = ({
|
|
247
243
|
item: r,
|
|
248
244
|
onAddBinding: o,
|
|
249
245
|
onRemove: t,
|
|
250
246
|
selectedBlock: s,
|
|
251
247
|
dataProvider: l,
|
|
252
|
-
appliedBindings:
|
|
248
|
+
appliedBindings: i
|
|
253
249
|
}) => {
|
|
254
250
|
const [a, c] = C("string"), n = (u, y) => {
|
|
255
251
|
if (f(u))
|
|
256
252
|
return "";
|
|
257
253
|
{
|
|
258
|
-
const
|
|
259
|
-
if (ie(
|
|
254
|
+
const d = x(y === "PROP" ? s : l, u, "");
|
|
255
|
+
if (ie(d))
|
|
260
256
|
return "list";
|
|
261
|
-
const h = typeof
|
|
257
|
+
const h = typeof d;
|
|
262
258
|
return h === "string" ? "text" : h === "object" ? "model" : h;
|
|
263
259
|
}
|
|
264
260
|
};
|
|
@@ -267,7 +263,7 @@ const je = ({ data: r, fullView: o }) => {
|
|
|
267
263
|
/* @__PURE__ */ e.jsx("div", { className: "font-medium leading-5", children: r.value }),
|
|
268
264
|
/* @__PURE__ */ e.jsx(je, { data: x(l, r.value, "") }),
|
|
269
265
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center justify-end gap-x-2", children: [
|
|
270
|
-
/* @__PURE__ */ e.jsx(lt, { editMode: !0, onAddBinding: o, appliedBindings:
|
|
266
|
+
/* @__PURE__ */ e.jsx(lt, { editMode: !0, onAddBinding: o, appliedBindings: i, item: r, children: /* @__PURE__ */ e.jsx(Tr, { 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" }) }),
|
|
271
267
|
/* @__PURE__ */ e.jsx(
|
|
272
268
|
Rr,
|
|
273
269
|
{
|
|
@@ -278,34 +274,34 @@ const je = ({ data: r, fullView: o }) => {
|
|
|
278
274
|
] }),
|
|
279
275
|
!f(a) && !f(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) })
|
|
280
276
|
] });
|
|
281
|
-
},
|
|
282
|
-
const t = q(), [s] = rt(), l =
|
|
283
|
-
k(r, (
|
|
277
|
+
}, Zr = ({ bindingData: r, onChange: o }) => {
|
|
278
|
+
const t = q(), [s] = rt(), l = Hr(), [i, a] = C(
|
|
279
|
+
k(r, (d, h) => ({ key: h, value: d }))
|
|
284
280
|
);
|
|
285
281
|
O(() => {
|
|
286
|
-
a(k(r, (
|
|
282
|
+
a(k(r, (d, h) => ({ key: h, value: d })));
|
|
287
283
|
}, [t == null ? void 0 : t._id, r]);
|
|
288
284
|
const c = _(() => {
|
|
289
285
|
if (f(s))
|
|
290
286
|
return !0;
|
|
291
|
-
if (f(
|
|
287
|
+
if (f(i))
|
|
292
288
|
return !1;
|
|
293
|
-
const
|
|
294
|
-
return f(
|
|
295
|
-
}, [s,
|
|
296
|
-
const h = we(
|
|
297
|
-
a([...h,
|
|
298
|
-
}, u = (
|
|
299
|
-
const h = we(
|
|
289
|
+
const d = ve(i);
|
|
290
|
+
return f(d == null ? void 0 : d.key) || f(d == null ? void 0 : d.value);
|
|
291
|
+
}, [s, i]), n = (d) => {
|
|
292
|
+
const h = we(i, (g) => g.key !== d.key);
|
|
293
|
+
a([...h, d]), y([...h, d]);
|
|
294
|
+
}, u = (d) => {
|
|
295
|
+
const h = we(i, (g, p) => d !== p);
|
|
300
296
|
y([...h]);
|
|
301
297
|
}, y = V(
|
|
302
|
-
(
|
|
303
|
-
if (a(
|
|
298
|
+
(d = []) => {
|
|
299
|
+
if (a(d), f(d)) {
|
|
304
300
|
o({});
|
|
305
301
|
return;
|
|
306
302
|
}
|
|
307
303
|
const h = {};
|
|
308
|
-
ke(
|
|
304
|
+
ke(d, (g) => {
|
|
309
305
|
!f(g == null ? void 0 : g.key) && !f(g == null ? void 0 : g.value) && Oe(h, g.key, g.value);
|
|
310
306
|
}), o(h);
|
|
311
307
|
},
|
|
@@ -316,24 +312,24 @@ const je = ({ data: r, fullView: o }) => {
|
|
|
316
312
|
/* @__PURE__ */ e.jsx("br", {}),
|
|
317
313
|
/* @__PURE__ */ e.jsx("a", { className: "text-blue-500", href: "https://chaibuilder.com/docs/registering-data-providers", target: "_blank", children: "Learn more" })
|
|
318
314
|
] }) }) : /* @__PURE__ */ e.jsxs("div", { className: "space-y-2", children: [
|
|
319
|
-
k(
|
|
320
|
-
|
|
315
|
+
k(i, (d, h) => /* @__PURE__ */ e.jsx(
|
|
316
|
+
zr,
|
|
321
317
|
{
|
|
322
|
-
item:
|
|
318
|
+
item: d,
|
|
323
319
|
onAddBinding: n,
|
|
324
320
|
onRemove: () => u(h),
|
|
325
321
|
selectedBlock: t,
|
|
326
322
|
dataProvider: s,
|
|
327
|
-
appliedBindings: k(
|
|
323
|
+
appliedBindings: k(i, "key")
|
|
328
324
|
},
|
|
329
|
-
|
|
325
|
+
d.key
|
|
330
326
|
)),
|
|
331
327
|
/* @__PURE__ */ e.jsxs(X, { delayDuration: 200, children: [
|
|
332
328
|
/* @__PURE__ */ e.jsx(z, { disabled: f(s), className: "w-full", children: /* @__PURE__ */ e.jsx(
|
|
333
329
|
lt,
|
|
334
330
|
{
|
|
335
331
|
disabled: c,
|
|
336
|
-
appliedBindings: k(
|
|
332
|
+
appliedBindings: k(i, "key"),
|
|
337
333
|
onAddBinding: n,
|
|
338
334
|
children: /* @__PURE__ */ e.jsx(
|
|
339
335
|
"span",
|
|
@@ -347,19 +343,19 @@ const je = ({ data: r, fullView: o }) => {
|
|
|
347
343
|
c && /* @__PURE__ */ e.jsx(Z, { sideOffset: -55, className: "text-[11px]", children: f(s) ? "No data provider has been set up for this page." : "Complete last added data binding to add more" })
|
|
348
344
|
] })
|
|
349
345
|
] });
|
|
350
|
-
},
|
|
346
|
+
}, Wr = () => /* @__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" }), be = dt(({ properties: r, formData: o, onChange: t }) => {
|
|
351
347
|
const s = { type: "object", properties: {} }, l = {};
|
|
352
|
-
return Object.keys(r).forEach((
|
|
353
|
-
const a = r[
|
|
348
|
+
return Object.keys(r).forEach((i) => {
|
|
349
|
+
const a = r[i];
|
|
354
350
|
if (E(["slot", "styles"], a.type))
|
|
355
351
|
return;
|
|
356
|
-
const c =
|
|
352
|
+
const c = i;
|
|
357
353
|
s.properties[c] = or(a), l[c] = ar(a);
|
|
358
354
|
}), /* @__PURE__ */ e.jsx(
|
|
359
|
-
|
|
355
|
+
Ir,
|
|
360
356
|
{
|
|
361
357
|
widgets: {
|
|
362
|
-
binding:
|
|
358
|
+
binding: Wr,
|
|
363
359
|
richtext: nr,
|
|
364
360
|
icon: ir,
|
|
365
361
|
image: dr
|
|
@@ -370,7 +366,7 @@ const je = ({ data: r, fullView: o }) => {
|
|
|
370
366
|
omitExtraData: !1,
|
|
371
367
|
liveOmit: !1,
|
|
372
368
|
liveValidate: !1,
|
|
373
|
-
validator:
|
|
369
|
+
validator: Pr,
|
|
374
370
|
uiSchema: l,
|
|
375
371
|
schema: s,
|
|
376
372
|
formData: o,
|
|
@@ -378,33 +374,33 @@ const je = ({ data: r, fullView: o }) => {
|
|
|
378
374
|
}
|
|
379
375
|
);
|
|
380
376
|
});
|
|
381
|
-
function
|
|
382
|
-
const r = q(), o = We(), t = pr(), s = et(r._type), l = { ...r }, [
|
|
383
|
-
if (
|
|
384
|
-
const D =
|
|
377
|
+
function Ur() {
|
|
378
|
+
const r = q(), o = We(), t = pr(), s = et(r._type), l = { ...r }, [i, a] = C(l), c = ur("dataBindingSupport", !1), n = ({ formData: p }, m, w) => {
|
|
379
|
+
if (m) {
|
|
380
|
+
const D = m.replace("root.", "");
|
|
385
381
|
t([r._id], { [D]: x(p, D) }, w);
|
|
386
382
|
}
|
|
387
383
|
}, u = V(
|
|
388
|
-
gt(({ formData: p },
|
|
389
|
-
n({ formData: p },
|
|
384
|
+
gt(({ formData: p }, m, w) => {
|
|
385
|
+
n({ formData: p }, m, w), a(p);
|
|
390
386
|
}, 1500),
|
|
391
387
|
[]
|
|
392
|
-
), y = ({ formData: p },
|
|
393
|
-
if (
|
|
394
|
-
const w =
|
|
395
|
-
o([r._id], { [w]: x(p, w) }), u({ formData: p },
|
|
388
|
+
), y = ({ formData: p }, m) => {
|
|
389
|
+
if (m) {
|
|
390
|
+
const w = m.replace("root.", "");
|
|
391
|
+
o([r._id], { [w]: x(p, w) }), u({ formData: p }, m, { [w]: x(i, w) });
|
|
396
392
|
}
|
|
397
|
-
},
|
|
393
|
+
}, d = {
|
|
398
394
|
_name: _r({
|
|
399
395
|
title: "Name",
|
|
400
396
|
default: x(r, "_name", r._type)
|
|
401
397
|
})
|
|
402
398
|
}, h = ht(x(l, "_bindings", {})), g = _(() => {
|
|
403
399
|
const p = yt(x(s, "props", {}));
|
|
404
|
-
return c &&
|
|
400
|
+
return c && bt(h, (m) => delete p[m]), p;
|
|
405
401
|
}, [s, h, c]);
|
|
406
402
|
return /* @__PURE__ */ e.jsxs("div", { className: "overflow-x-hidden", children: [
|
|
407
|
-
/* @__PURE__ */ e.jsx(
|
|
403
|
+
/* @__PURE__ */ e.jsx(be, { onChange: y, formData: l, properties: d }),
|
|
408
404
|
/* @__PURE__ */ e.jsx("hr", { className: "mt-4" }),
|
|
409
405
|
c ? /* @__PURE__ */ e.jsxs(Ue, { type: "multiple", defaultValue: ["STATIC", "BINDING"], className: "h-full w-full", children: [
|
|
410
406
|
/* @__PURE__ */ e.jsxs(de, { value: "BINDING", children: [
|
|
@@ -418,7 +414,7 @@ function Wr() {
|
|
|
418
414
|
"Data Binding"
|
|
419
415
|
] }) }),
|
|
420
416
|
/* @__PURE__ */ e.jsx(pe, { className: "px-4 pt-4", children: /* @__PURE__ */ e.jsx(
|
|
421
|
-
|
|
417
|
+
Zr,
|
|
422
418
|
{
|
|
423
419
|
bindingData: x(r, "_bindings", {}),
|
|
424
420
|
onChange: (p) => {
|
|
@@ -435,52 +431,52 @@ function Wr() {
|
|
|
435
431
|
/* @__PURE__ */ e.jsxs(pe, { className: "pt-4", children: [
|
|
436
432
|
f(h) ? 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: [
|
|
437
433
|
"Data binding is set for ",
|
|
438
|
-
/* @__PURE__ */ e.jsx("b", { children: k(h,
|
|
434
|
+
/* @__PURE__ */ e.jsx("b", { children: k(h, mt).join(", ") }),
|
|
439
435
|
" ",
|
|
440
436
|
h.length === 1 ? "property" : "properties",
|
|
441
437
|
". Remove data binding to edit static content."
|
|
442
438
|
] }),
|
|
443
|
-
/* @__PURE__ */ e.jsx(
|
|
439
|
+
/* @__PURE__ */ e.jsx(be, { onChange: y, formData: l, properties: g })
|
|
444
440
|
] })
|
|
445
441
|
] })
|
|
446
|
-
] }) : /* @__PURE__ */ e.jsx(
|
|
442
|
+
] }) : /* @__PURE__ */ e.jsx(be, { onChange: y, formData: l, properties: g }),
|
|
447
443
|
/* @__PURE__ */ e.jsx("div", { className: "pb-60" })
|
|
448
444
|
] });
|
|
449
445
|
}
|
|
450
|
-
const Pe = new
|
|
446
|
+
const Pe = new Lr(Mr, {
|
|
451
447
|
isCaseSensitive: !1,
|
|
452
448
|
threshold: 0.2,
|
|
453
449
|
minMatchCharLength: 2,
|
|
454
450
|
keys: ["name"]
|
|
455
451
|
});
|
|
456
|
-
function
|
|
452
|
+
function Kr() {
|
|
457
453
|
var D;
|
|
458
|
-
const [r] =
|
|
459
|
-
const j =
|
|
454
|
+
const [r] = Se(), o = q(), t = Ke(), s = qe(), [l] = Ge(), [i, a] = C(""), c = (D = ue(r)) == null ? void 0 : D.prop, n = ft((x(o, c, "").replace(Fr, "").split(",").pop() || "").split(" "), f), u = () => {
|
|
455
|
+
const j = i.trim().toLowerCase().replace(/ +(?= )/g, "").split(" ");
|
|
460
456
|
t(l, j, !0), a("");
|
|
461
|
-
}, [y,
|
|
457
|
+
}, [y, d] = C([]), h = ({ value: j }) => {
|
|
462
458
|
const I = j.trim().toLowerCase(), L = I.match(/.+:/g);
|
|
463
459
|
let N = [];
|
|
464
460
|
if (L && L.length > 0) {
|
|
465
461
|
const [$] = L, F = I.replace($, "");
|
|
466
|
-
N = Pe.search(F).map((
|
|
467
|
-
...
|
|
468
|
-
item: { ...
|
|
462
|
+
N = Pe.search(F).map((b) => ({
|
|
463
|
+
...b,
|
|
464
|
+
item: { ...b.item, name: $ + b.item.name }
|
|
469
465
|
}));
|
|
470
466
|
} else
|
|
471
467
|
N = Pe.search(I);
|
|
472
|
-
|
|
468
|
+
d(k(N, "item"));
|
|
473
469
|
}, g = () => {
|
|
474
|
-
|
|
475
|
-
}, p = (j) => j.name,
|
|
470
|
+
d([]);
|
|
471
|
+
}, p = (j) => j.name, m = (j) => /* @__PURE__ */ e.jsx("div", { className: "rounded-md p-1", children: j.name }), w = {
|
|
476
472
|
autoComplete: "off",
|
|
477
473
|
autoCorrect: "off",
|
|
478
474
|
autoCapitalize: "off",
|
|
479
475
|
spellCheck: !1,
|
|
480
476
|
placeholder: "Enter class name",
|
|
481
|
-
value:
|
|
477
|
+
value: i,
|
|
482
478
|
onKeyDown: (j) => {
|
|
483
|
-
j.key === "Enter" &&
|
|
479
|
+
j.key === "Enter" && i.trim() !== "" && u();
|
|
484
480
|
},
|
|
485
481
|
onChange: (j, { newValue: I }) => a(I),
|
|
486
482
|
className: "w-full rounded-md text-xs px-2 hover:outline-0 bg-background border-border py-1"
|
|
@@ -490,16 +486,16 @@ function Ur() {
|
|
|
490
486
|
{
|
|
491
487
|
className: `no-scrollbar flex ${y.length > 0 ? "min-h-[300px]" : "min-h-max"} w-full flex-col gap-y-5 overflow-y-auto bg-gray-100 px-px`,
|
|
492
488
|
children: [
|
|
493
|
-
/* @__PURE__ */ e.jsx(
|
|
489
|
+
/* @__PURE__ */ e.jsx(Te, { className: "mt-2", children: "Add Tailwind classes" }),
|
|
494
490
|
/* @__PURE__ */ e.jsxs("div", { className: "relative -mt-4 flex items-center gap-x-3", children: [
|
|
495
491
|
/* @__PURE__ */ e.jsx("div", { className: "relative flex w-full items-center gap-x-3", children: /* @__PURE__ */ e.jsx(
|
|
496
|
-
|
|
492
|
+
Er,
|
|
497
493
|
{
|
|
498
494
|
suggestions: y,
|
|
499
495
|
onSuggestionsFetchRequested: h,
|
|
500
496
|
onSuggestionsClearRequested: g,
|
|
501
497
|
getSuggestionValue: p,
|
|
502
|
-
renderSuggestion:
|
|
498
|
+
renderSuggestion: m,
|
|
503
499
|
inputProps: w,
|
|
504
500
|
containerProps: {
|
|
505
501
|
className: "relative h-8 w-full gap-y-1 py-1 border-gray-600"
|
|
@@ -517,7 +513,7 @@ function Ur() {
|
|
|
517
513
|
variant: "outline",
|
|
518
514
|
className: "h-6 border-gray-700",
|
|
519
515
|
onClick: u,
|
|
520
|
-
disabled:
|
|
516
|
+
disabled: i.trim() === "",
|
|
521
517
|
size: "sm",
|
|
522
518
|
children: /* @__PURE__ */ e.jsx(Ne, {})
|
|
523
519
|
}
|
|
@@ -549,7 +545,7 @@ function Ur() {
|
|
|
549
545
|
}
|
|
550
546
|
);
|
|
551
547
|
}
|
|
552
|
-
const B = ["px", "%", "em", "rem", "ch", "vh", "vw"],
|
|
548
|
+
const B = ["px", "%", "em", "rem", "ch", "vh", "vw"], qr = {
|
|
553
549
|
heading: "flex.heading",
|
|
554
550
|
items: [
|
|
555
551
|
{ type: "arbitrary", label: "flex.basis", units: B, property: "flexBasis" },
|
|
@@ -558,7 +554,7 @@ const B = ["px", "%", "em", "rem", "ch", "vh", "vw"], Kr = {
|
|
|
558
554
|
{ type: "dropdown", label: "flex.grow", property: "flexGrow" },
|
|
559
555
|
{ type: "dropdown", label: "flex.shrink", property: "flexShrink" }
|
|
560
556
|
]
|
|
561
|
-
},
|
|
557
|
+
}, Gr = {
|
|
562
558
|
heading: "grid.heading",
|
|
563
559
|
items: [
|
|
564
560
|
{ type: "range", label: "grid.col_span", property: "gridColSpan" },
|
|
@@ -569,7 +565,7 @@ const B = ["px", "%", "em", "rem", "ch", "vh", "vw"], Kr = {
|
|
|
569
565
|
{ type: "range", label: "grid.row_end", property: "gridRowEnd" },
|
|
570
566
|
{ type: "range", label: "grid.order", property: "order" }
|
|
571
567
|
]
|
|
572
|
-
},
|
|
568
|
+
}, Jr = [
|
|
573
569
|
{
|
|
574
570
|
heading: "layout.heading",
|
|
575
571
|
items: [
|
|
@@ -971,7 +967,7 @@ const B = ["px", "%", "em", "rem", "ch", "vh", "vw"], Kr = {
|
|
|
971
967
|
},
|
|
972
968
|
{
|
|
973
969
|
heading: "classes.heading",
|
|
974
|
-
items: [{ component:
|
|
970
|
+
items: [{ component: Kr }]
|
|
975
971
|
}
|
|
976
972
|
], st = {
|
|
977
973
|
"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" }) }),
|
|
@@ -981,32 +977,32 @@ const B = ["px", "%", "em", "rem", "ch", "vh", "vw"], Kr = {
|
|
|
981
977
|
// display
|
|
982
978
|
hidden: He,
|
|
983
979
|
gap: A,
|
|
984
|
-
gapX:
|
|
980
|
+
gapX: T,
|
|
985
981
|
gapY: R,
|
|
986
|
-
spaceX:
|
|
982
|
+
spaceX: T,
|
|
987
983
|
spaceY: R,
|
|
988
984
|
overscroll: A,
|
|
989
|
-
overscrollX:
|
|
985
|
+
overscrollX: T,
|
|
990
986
|
overscrollY: R,
|
|
991
987
|
overflow: A,
|
|
992
|
-
overflowX:
|
|
988
|
+
overflowX: T,
|
|
993
989
|
overflowY: R,
|
|
994
990
|
top: Q,
|
|
995
991
|
right: ee,
|
|
996
992
|
bottom: te,
|
|
997
993
|
left: re,
|
|
998
994
|
inset: A,
|
|
999
|
-
insetX:
|
|
995
|
+
insetX: T,
|
|
1000
996
|
insetY: R,
|
|
1001
997
|
border: A,
|
|
1002
|
-
borderX:
|
|
998
|
+
borderX: T,
|
|
1003
999
|
borderY: R,
|
|
1004
1000
|
borderTop: Q,
|
|
1005
1001
|
borderRight: ee,
|
|
1006
1002
|
borderBottom: te,
|
|
1007
1003
|
borderLeft: re,
|
|
1008
1004
|
borderRadius: A,
|
|
1009
|
-
borderRadiusX:
|
|
1005
|
+
borderRadiusX: T,
|
|
1010
1006
|
borderRadiusY: R,
|
|
1011
1007
|
borderRadiusTop: Q,
|
|
1012
1008
|
borderRadiusRight: ee,
|
|
@@ -1014,20 +1010,20 @@ const B = ["px", "%", "em", "rem", "ch", "vh", "vw"], Kr = {
|
|
|
1014
1010
|
borderRadiusLeft: re,
|
|
1015
1011
|
borderRadiusTopLeft: Nt,
|
|
1016
1012
|
borderRadiusTopRight: _t,
|
|
1017
|
-
borderRadiusBottomRight:
|
|
1018
|
-
borderRadiusBottomLeft:
|
|
1019
|
-
divideXWidth:
|
|
1013
|
+
borderRadiusBottomRight: St,
|
|
1014
|
+
borderRadiusBottomLeft: Tt,
|
|
1015
|
+
divideXWidth: T,
|
|
1020
1016
|
divideYWidth: R,
|
|
1021
1017
|
scale: A,
|
|
1022
|
-
scaleX:
|
|
1018
|
+
scaleX: T,
|
|
1023
1019
|
scaleY: R,
|
|
1024
|
-
skewX:
|
|
1020
|
+
skewX: T,
|
|
1025
1021
|
skewY: R,
|
|
1026
|
-
translateX:
|
|
1022
|
+
translateX: T,
|
|
1027
1023
|
translateY: R,
|
|
1028
1024
|
// padding
|
|
1029
1025
|
padding: A,
|
|
1030
|
-
paddingX:
|
|
1026
|
+
paddingX: T,
|
|
1031
1027
|
paddingY: R,
|
|
1032
1028
|
paddingTop: Q,
|
|
1033
1029
|
paddingRight: ee,
|
|
@@ -1035,7 +1031,7 @@ const B = ["px", "%", "em", "rem", "ch", "vh", "vw"], Kr = {
|
|
|
1035
1031
|
paddingLeft: re,
|
|
1036
1032
|
// margin
|
|
1037
1033
|
margin: A,
|
|
1038
|
-
marginX:
|
|
1034
|
+
marginX: T,
|
|
1039
1035
|
marginY: R,
|
|
1040
1036
|
marginTop: Q,
|
|
1041
1037
|
marginRight: ee,
|
|
@@ -1167,13 +1163,13 @@ const B = ["px", "%", "em", "rem", "ch", "vh", "vw"], Kr = {
|
|
|
1167
1163
|
)
|
|
1168
1164
|
] }),
|
|
1169
1165
|
static: At
|
|
1170
|
-
}, oe = Me({ canReset: !1, canChange: !0 }),
|
|
1166
|
+
}, oe = Me({ canReset: !1, canChange: !0 }), Qr = ({ children: r, canReset: o = !1, canChange: t = !0 }) => (
|
|
1171
1167
|
// eslint-disable-next-line react/jsx-no-constructed-context-values
|
|
1172
1168
|
/* @__PURE__ */ e.jsx(oe.Provider, { value: { canReset: o, canChange: t }, children: r })
|
|
1173
1169
|
), ot = ({ label: r, property: o, onChange: t }) => {
|
|
1174
|
-
const s = _(() => x(he, `${o}.classes`, [""]), [o]), l = ae(o),
|
|
1170
|
+
const s = _(() => x(he, `${o}.classes`, [""]), [o]), l = ae(o), i = _(() => x(l, "cls", ""), [l]), { canChange: a } = se(oe), c = /\[.*\]/g.test(i);
|
|
1175
1171
|
return /* @__PURE__ */ e.jsx("div", { className: r ? "w-full rounded" : "grow", children: c ? /* @__PURE__ */ e.jsxs("div", { className: "flex items-center", children: [
|
|
1176
|
-
/* @__PURE__ */ e.jsx(xr, { className: "w-[70%] rounded py-1", readOnly: !0, value:
|
|
1172
|
+
/* @__PURE__ */ e.jsx(xr, { className: "w-[70%] rounded py-1", readOnly: !0, value: i }),
|
|
1177
1173
|
/* @__PURE__ */ e.jsxs(X, { delayDuration: 100, children: [
|
|
1178
1174
|
/* @__PURE__ */ e.jsx(z, { 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(_e, {}) }) }),
|
|
1179
1175
|
/* @__PURE__ */ e.jsx(Z, { children: "Current value is using a Tailwind arbitrary value." })
|
|
@@ -1183,14 +1179,14 @@ const B = ["px", "%", "em", "rem", "ch", "vh", "vw"], Kr = {
|
|
|
1183
1179
|
{
|
|
1184
1180
|
rounded: r,
|
|
1185
1181
|
onChange: (n) => t(n, o),
|
|
1186
|
-
selected:
|
|
1182
|
+
selected: i,
|
|
1187
1183
|
options: s,
|
|
1188
1184
|
disabled: !a
|
|
1189
1185
|
}
|
|
1190
1186
|
) });
|
|
1191
1187
|
};
|
|
1192
1188
|
function Ce({ selected: r, onChange: o, rounded: t = !1, options: s, disabled: l = !1 }) {
|
|
1193
|
-
const
|
|
1189
|
+
const i = r.replace(/.*:/g, "").trim(), { undo: a, redo: c } = gr();
|
|
1194
1190
|
return /* @__PURE__ */ e.jsxs(
|
|
1195
1191
|
"select",
|
|
1196
1192
|
{
|
|
@@ -1200,7 +1196,7 @@ function Ce({ selected: r, onChange: o, rounded: t = !1, options: s, disabled: l
|
|
|
1200
1196
|
onKeyDown: (n) => {
|
|
1201
1197
|
n.ctrlKey && (n.key === "z" && a(), n.key === "y" && c());
|
|
1202
1198
|
},
|
|
1203
|
-
value:
|
|
1199
|
+
value: i,
|
|
1204
1200
|
children: [
|
|
1205
1201
|
/* @__PURE__ */ e.jsx("option", { className: "bg-transparent", value: "" }),
|
|
1206
1202
|
P.Children.toArray(
|
|
@@ -1210,9 +1206,9 @@ function Ce({ selected: r, onChange: o, rounded: t = !1, options: s, disabled: l
|
|
|
1210
1206
|
}
|
|
1211
1207
|
);
|
|
1212
1208
|
}
|
|
1213
|
-
const
|
|
1214
|
-
const { canReset: t, canChange: s } = se(oe), l = ae(r),
|
|
1215
|
-
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:
|
|
1209
|
+
const el = ({ property: r, onChange: o }) => {
|
|
1210
|
+
const { canReset: t, canChange: s } = se(oe), l = ae(r), i = _(() => x(l, "cls", ""), [l]), a = _(() => x(he, `${r}.classes`, [""]), [r]), c = a.indexOf(i) > -1 ? a.indexOf(i) : 0, n = /\[.*\]/g.test(i);
|
|
1211
|
+
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: i }) : /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
1216
1212
|
/* @__PURE__ */ e.jsx(
|
|
1217
1213
|
"button",
|
|
1218
1214
|
{
|
|
@@ -1245,8 +1241,8 @@ const Qr = ({ property: r, onChange: o }) => {
|
|
|
1245
1241
|
}
|
|
1246
1242
|
)
|
|
1247
1243
|
] }) });
|
|
1248
|
-
},
|
|
1249
|
-
const t = _(() => x(he, `${r}.classes`, [""]), [r]), { canChange: s } = se(oe), l = ae(r),
|
|
1244
|
+
}, tl = ({ property: r, onChange: o }) => {
|
|
1245
|
+
const t = _(() => x(he, `${r}.classes`, [""]), [r]), { canChange: s } = se(oe), l = ae(r), i = _(() => x(l, "cls", ""), [l]);
|
|
1250
1246
|
return /* @__PURE__ */ e.jsx("div", { className: "flex grow flex-wrap gap-1", children: k(t, (a) => /* @__PURE__ */ e.jsxs(X, { children: [
|
|
1251
1247
|
/* @__PURE__ */ e.jsx(z, { asChild: !0, children: /* @__PURE__ */ e.jsx(
|
|
1252
1248
|
"button",
|
|
@@ -1254,13 +1250,13 @@ const Qr = ({ property: r, onChange: o }) => {
|
|
|
1254
1250
|
type: "button",
|
|
1255
1251
|
disabled: !s,
|
|
1256
1252
|
onClick: () => o(a, r),
|
|
1257
|
-
className: `cursor-pointer rounded border border-gray-600 p-1 disabled:cursor-not-allowed ${
|
|
1253
|
+
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"}`,
|
|
1258
1254
|
children: P.createElement(x(st, a, ze))
|
|
1259
1255
|
}
|
|
1260
1256
|
) }),
|
|
1261
1257
|
/* @__PURE__ */ e.jsx(Z, { children: Y(le(a)) })
|
|
1262
1258
|
] })) });
|
|
1263
|
-
},
|
|
1259
|
+
}, rl = {
|
|
1264
1260
|
backgroundColor: "bg",
|
|
1265
1261
|
textColor: "text",
|
|
1266
1262
|
borderColor: "border",
|
|
@@ -1272,11 +1268,11 @@ const Qr = ({ property: r, onChange: o }) => {
|
|
|
1272
1268
|
toColor: "to",
|
|
1273
1269
|
ringColor: "ring",
|
|
1274
1270
|
ringOffsetColor: "ring-offset"
|
|
1275
|
-
},
|
|
1276
|
-
const t = ae(r), s = _(() => x(t, "cls", ""), [t]), { canChange: l } = se(oe), [
|
|
1271
|
+
}, ll = ({ property: r, onChange: o }) => {
|
|
1272
|
+
const t = ae(r), s = _(() => x(t, "cls", ""), [t]), { canChange: l } = se(oe), [i, a] = C([]), [c, n] = C({ color: "", shade: "" }), u = s.split("-"), y = x(u, "1", ""), d = x(u, "2", ""), h = V(
|
|
1277
1273
|
// eslint-disable-next-line no-shadow
|
|
1278
1274
|
(p) => {
|
|
1279
|
-
["current", "inherit", "transparent", "black", "white"].includes(p) ? (a([]), n({ color: p })) : (a(["50", "100", "200", "300", "400", "500", "600", "700", "800", "900"]), n((
|
|
1275
|
+
["current", "inherit", "transparent", "black", "white"].includes(p) ? (a([]), n({ color: p })) : (a(["50", "100", "200", "300", "400", "500", "600", "700", "800", "900"]), n((m) => ({ ...m, color: p, shade: m.shade ? m.shade : "500" })));
|
|
1280
1276
|
},
|
|
1281
1277
|
[a, n]
|
|
1282
1278
|
);
|
|
@@ -1295,8 +1291,8 @@ const Qr = ({ property: r, onChange: o }) => {
|
|
|
1295
1291
|
return O(() => {
|
|
1296
1292
|
n({ color: "", shade: "" });
|
|
1297
1293
|
}, [t]), O(() => {
|
|
1298
|
-
const
|
|
1299
|
-
|
|
1294
|
+
const m = `${x(rl, r, "")}-${c.color}${c.shade ? `-${c.shade}` : ""}`;
|
|
1295
|
+
m.match(new RegExp(x(he, `${r}.regExp`, ""))) && o(m, r);
|
|
1300
1296
|
}, [c, o, r]), /* @__PURE__ */ e.jsxs("div", { className: "flex flex-row divide-x divide-solid divide-border rounded-lg border border-border text-xs", children: [
|
|
1301
1297
|
/* @__PURE__ */ e.jsx("div", { className: "grow text-center", children: /* @__PURE__ */ e.jsx(
|
|
1302
1298
|
Ce,
|
|
@@ -1337,7 +1333,7 @@ const Qr = ({ property: r, onChange: o }) => {
|
|
|
1337
1333
|
]
|
|
1338
1334
|
}
|
|
1339
1335
|
) }),
|
|
1340
|
-
/* @__PURE__ */ e.jsx("button", { type: "button", className: "grow text-center", children: /* @__PURE__ */ e.jsx(Ce, { rounded: !0, selected:
|
|
1336
|
+
/* @__PURE__ */ e.jsx("button", { type: "button", className: "grow text-center", children: /* @__PURE__ */ e.jsx(Ce, { rounded: !0, selected: d, disabled: !y || !l, onChange: g, options: i }) })
|
|
1341
1337
|
] });
|
|
1342
1338
|
}, Ae = (r, o) => {
|
|
1343
1339
|
r = r.toLowerCase();
|
|
@@ -1346,10 +1342,10 @@ const Qr = ({ property: r, onChange: o }) => {
|
|
|
1346
1342
|
return { value: "", unit: t };
|
|
1347
1343
|
const s = o.length ? new RegExp(o.join("|"), "g") : /XXXXXX/g;
|
|
1348
1344
|
t = t.replace(s, "");
|
|
1349
|
-
const l = r.match(s),
|
|
1350
|
-
return
|
|
1345
|
+
const l = r.match(s), i = l && l.length > 1, a = !f(t) && Number.isNaN(Number(t));
|
|
1346
|
+
return i || a ? { error: "Invalid value" } : l && (l[0] === "auto" || l[0] === "none") ? { value: l[0], unit: "" } : { value: t, unit: l ? l[0] : "" };
|
|
1351
1347
|
};
|
|
1352
|
-
const
|
|
1348
|
+
const sl = (r) => {
|
|
1353
1349
|
const o = r.startsWith("-") ? "-" : "", t = r.split("-").pop();
|
|
1354
1350
|
if (["auto", "none"].includes(t))
|
|
1355
1351
|
return { value: "", unit: t };
|
|
@@ -1473,29 +1469,29 @@ const ll = (r) => {
|
|
|
1473
1469
|
if (["max", "min", "fit"].includes(t))
|
|
1474
1470
|
return { value: r, unit: "class" };
|
|
1475
1471
|
if (t.includes("/")) {
|
|
1476
|
-
const [s, l] = k(t.split("/"), (
|
|
1472
|
+
const [s, l] = k(t.split("/"), (i) => parseInt(i, 10));
|
|
1477
1473
|
return { value: o + (s / l * 100).toFixed(2).replace(".00", ""), unit: "%" };
|
|
1478
1474
|
}
|
|
1479
1475
|
return vt(parseFloat(t)) ? { value: `${o + parseFloat(t) * 4}`, unit: "px" } : { value: t, unit: "class" };
|
|
1480
1476
|
};
|
|
1481
|
-
const
|
|
1477
|
+
const ol = (r) => {
|
|
1482
1478
|
if (f(r))
|
|
1483
1479
|
return { value: "", unit: "" };
|
|
1484
1480
|
const o = r.match(/\[.*\]/g);
|
|
1485
1481
|
if (o === null)
|
|
1486
|
-
return
|
|
1482
|
+
return al(r);
|
|
1487
1483
|
const t = x(o, "0", "").replace(/\[|\]/g, ""), s = r.startsWith("-") ? "-" : "", l = ue(t.match(/\d+.\d+|\d+/g));
|
|
1488
1484
|
return { value: `${s}${l}`, unit: t.replace(l, "") };
|
|
1489
|
-
},
|
|
1485
|
+
}, al = (r) => f(r) ? { value: "", unit: "" } : sl(r), at = P.createContext({
|
|
1490
1486
|
setDragData: () => {
|
|
1491
1487
|
}
|
|
1492
|
-
}),
|
|
1488
|
+
}), nl = ({
|
|
1493
1489
|
unit: r,
|
|
1494
1490
|
currentValue: o,
|
|
1495
1491
|
onDrag: t,
|
|
1496
1492
|
onDragEnd: s,
|
|
1497
1493
|
onDragStart: l,
|
|
1498
|
-
negative:
|
|
1494
|
+
negative: i,
|
|
1499
1495
|
cssProperty: a
|
|
1500
1496
|
}) => {
|
|
1501
1497
|
const { setDragData: c } = se(at);
|
|
@@ -1511,7 +1507,7 @@ const sl = (r) => {
|
|
|
1511
1507
|
dragStartY: n.pageY,
|
|
1512
1508
|
dragStartValue: `${o}`,
|
|
1513
1509
|
dragUnit: r,
|
|
1514
|
-
negative:
|
|
1510
|
+
negative: i,
|
|
1515
1511
|
cssProperty: a
|
|
1516
1512
|
};
|
|
1517
1513
|
l(u), c(u);
|
|
@@ -1521,7 +1517,7 @@ const sl = (r) => {
|
|
|
1521
1517
|
children: /* @__PURE__ */ e.jsx(Lt, {})
|
|
1522
1518
|
}
|
|
1523
1519
|
);
|
|
1524
|
-
},
|
|
1520
|
+
}, il = ({ onSelect: r, current: o, units: t }) => /* @__PURE__ */ e.jsx("div", { "data-theme": "light", className: "-m-[7px] -mx-[13px] flex w-9 flex-col", children: t.map((s) => /* @__PURE__ */ e.jsx(
|
|
1525
1521
|
xe,
|
|
1526
1522
|
{
|
|
1527
1523
|
className: "h-max rounded-none px-1 py-1 text-right text-[11px] hover:bg-blue-400",
|
|
@@ -1533,89 +1529,89 @@ const sl = (r) => {
|
|
|
1533
1529
|
children: s
|
|
1534
1530
|
},
|
|
1535
1531
|
s
|
|
1536
|
-
)) }), Ee = 50,
|
|
1537
|
-
const [o, t] = C(!1), [s, l] = C(""), { currentClass:
|
|
1532
|
+
)) }), Ee = 50, dl = (r) => {
|
|
1533
|
+
const [o, t] = C(!1), [s, l] = C(""), { currentClass: i, onChange: a, classPrefix: c, cssProperty: n, units: u, negative: y } = r, [d, h] = C(n != null && n.toLowerCase().includes("width") ? "%" : u[0]), [g, p] = C(!1), [m, w] = C(""), [D, j] = C(!1), [I, L] = C(!1);
|
|
1538
1534
|
O(() => {
|
|
1539
|
-
const { value:
|
|
1535
|
+
const { value: b, unit: v } = ol(i);
|
|
1540
1536
|
if (v === "") {
|
|
1541
|
-
l(
|
|
1537
|
+
l(b), h(n != null && n.toLowerCase().includes("width") ? "%" : ue(u));
|
|
1542
1538
|
return;
|
|
1543
1539
|
}
|
|
1544
|
-
h(v), l(v === "class" || f(
|
|
1545
|
-
}, [
|
|
1546
|
-
const N = fe((
|
|
1547
|
-
(
|
|
1540
|
+
h(v), l(v === "class" || f(b) ? "" : b);
|
|
1541
|
+
}, [i, n, u]);
|
|
1542
|
+
const N = fe((b) => a(b), [a], Ee), $ = fe((b) => a(b, !1), [a], Ee), F = V(
|
|
1543
|
+
(b = !1) => {
|
|
1548
1544
|
const v = Ae(`${s}`, u);
|
|
1549
1545
|
if (x(v, "error", !1)) {
|
|
1550
1546
|
p(!0);
|
|
1551
1547
|
return;
|
|
1552
1548
|
}
|
|
1553
|
-
const
|
|
1554
|
-
if (
|
|
1555
|
-
N(`${c}${
|
|
1549
|
+
const S = x(v, "unit") !== "" ? x(v, "unit") : d;
|
|
1550
|
+
if (S === "auto" || S === "none") {
|
|
1551
|
+
N(`${c}${S}`);
|
|
1556
1552
|
return;
|
|
1557
1553
|
}
|
|
1558
1554
|
if (x(v, "value") === "")
|
|
1559
1555
|
return;
|
|
1560
|
-
const J = `${x(v, "value", "").startsWith("-") ? "-" : ""}${c}[${x(v, "value", "").replace("-", "")}${
|
|
1561
|
-
|
|
1556
|
+
const J = `${x(v, "value", "").startsWith("-") ? "-" : ""}${c}[${x(v, "value", "").replace("-", "")}${S === "-" ? "" : S}]`;
|
|
1557
|
+
b ? $(J) : N(J);
|
|
1562
1558
|
},
|
|
1563
|
-
[N, $, s,
|
|
1559
|
+
[N, $, s, d, c, u]
|
|
1564
1560
|
), G = V(
|
|
1565
|
-
(
|
|
1561
|
+
(b) => {
|
|
1566
1562
|
const v = Ae(`${s}`, u);
|
|
1567
1563
|
if (x(v, "error", !1)) {
|
|
1568
1564
|
p(!0);
|
|
1569
1565
|
return;
|
|
1570
1566
|
}
|
|
1571
|
-
if (
|
|
1572
|
-
N(`${c}${
|
|
1567
|
+
if (b === "auto" || b === "none") {
|
|
1568
|
+
N(`${c}${b}`);
|
|
1573
1569
|
return;
|
|
1574
1570
|
}
|
|
1575
1571
|
if (x(v, "value") === "")
|
|
1576
1572
|
return;
|
|
1577
|
-
const
|
|
1573
|
+
const S = x(v, "unit") !== "" ? x(v, "unit") : b, J = `${x(v, "value", "").startsWith("-") ? "-" : ""}${c}[${x(v, "value", "").replace("-", "")}${S === "-" ? "" : S}]`;
|
|
1578
1574
|
N(J);
|
|
1579
1575
|
},
|
|
1580
1576
|
[N, s, c, u]
|
|
1581
1577
|
);
|
|
1582
|
-
return /* @__PURE__ */ e.jsx("div", { className: "flex w-full flex-col", children: /* @__PURE__ */ e.jsx("div", { className: "flex items-center justify-start", children:
|
|
1583
|
-
/* @__PURE__ */ e.jsx("input", { className: "w-20 rounded py-1", readOnly: !0, value:
|
|
1578
|
+
return /* @__PURE__ */ e.jsx("div", { className: "flex w-full flex-col", children: /* @__PURE__ */ e.jsx("div", { className: "flex items-center justify-start", children: d === "class" ? /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
1579
|
+
/* @__PURE__ */ e.jsx("input", { className: "w-20 rounded py-1", readOnly: !0, value: i }),
|
|
1584
1580
|
/* @__PURE__ */ e.jsxs(X, { children: [
|
|
1585
1581
|
/* @__PURE__ */ e.jsx(z, { 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(_e, {}) }) }),
|
|
1586
1582
|
/* @__PURE__ */ e.jsx(Z, { children: "Current value is using a Tailwind preset class." })
|
|
1587
1583
|
] })
|
|
1588
1584
|
] }) : /* @__PURE__ */ e.jsxs("div", { className: `group relative flex items-center ${D ? "z-auto" : ""}`, children: [
|
|
1589
1585
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center rounded-md border border-border", children: [
|
|
1590
|
-
["none", "auto"].indexOf(
|
|
1586
|
+
["none", "auto"].indexOf(d) !== -1 ? null : /* @__PURE__ */ e.jsx(
|
|
1591
1587
|
"input",
|
|
1592
1588
|
{
|
|
1593
|
-
readOnly:
|
|
1594
|
-
onKeyPress: (
|
|
1595
|
-
|
|
1589
|
+
readOnly: d === "class",
|
|
1590
|
+
onKeyPress: (b) => {
|
|
1591
|
+
b.key === "Enter" && F();
|
|
1596
1592
|
},
|
|
1597
|
-
onKeyDown: (
|
|
1598
|
-
if (
|
|
1593
|
+
onKeyDown: (b) => {
|
|
1594
|
+
if (b.keyCode !== 38 && b.keyCode !== 40)
|
|
1599
1595
|
return;
|
|
1600
|
-
|
|
1601
|
-
const v = wt(
|
|
1602
|
-
let
|
|
1603
|
-
|
|
1604
|
-
const M = `${
|
|
1596
|
+
b.preventDefault(), L(!0);
|
|
1597
|
+
const v = wt(b.target.value);
|
|
1598
|
+
let S = Fe(v) ? 0 : v;
|
|
1599
|
+
b.keyCode === 38 && (S += 1), b.keyCode === 40 && (S -= 1);
|
|
1600
|
+
const M = `${S}`, it = `${M.startsWith("-") ? "-" : ""}${c}[${M.replace("-", "")}${d === "-" ? "" : d}]`;
|
|
1605
1601
|
$(it);
|
|
1606
1602
|
},
|
|
1607
|
-
onKeyUp: (
|
|
1608
|
-
I && (
|
|
1603
|
+
onKeyUp: (b) => {
|
|
1604
|
+
I && (b.preventDefault(), L(!1));
|
|
1609
1605
|
},
|
|
1610
1606
|
onBlur: () => F(),
|
|
1611
|
-
onChange: (
|
|
1612
|
-
p(!1), l(
|
|
1607
|
+
onChange: (b) => {
|
|
1608
|
+
p(!1), l(b.target.value);
|
|
1613
1609
|
},
|
|
1614
|
-
onClick: (
|
|
1610
|
+
onClick: (b) => {
|
|
1615
1611
|
var v;
|
|
1616
|
-
(v =
|
|
1612
|
+
(v = b == null ? void 0 : b.target) == null || v.select(), t(!1);
|
|
1617
1613
|
},
|
|
1618
|
-
value: D ?
|
|
1614
|
+
value: D ? m : s,
|
|
1619
1615
|
className: "h-6 w-14 rounded rounded-r-none bg-background pl-2 text-sm focus-visible:outline-0 ".concat(
|
|
1620
1616
|
" ",
|
|
1621
1617
|
g ? "border-red-500 text-red-500" : "border-foreground/20"
|
|
@@ -1630,42 +1626,42 @@ const sl = (r) => {
|
|
|
1630
1626
|
onClick: () => t(!o),
|
|
1631
1627
|
className: "flex h-6 cursor-pointer items-center gap-x-1 rounded rounded-l-none bg-background p-px px-1 text-[11px] uppercase",
|
|
1632
1628
|
children: [
|
|
1633
|
-
/* @__PURE__ */ e.jsx("span", { className: `inline-block ${u.length === 1 ? "px-2 font-semibold" : ""}`, children:
|
|
1629
|
+
/* @__PURE__ */ e.jsx("span", { className: `inline-block ${u.length === 1 ? "px-2 font-semibold" : ""}`, children: d }),
|
|
1634
1630
|
u.length > 1 ? /* @__PURE__ */ e.jsx(Mt, {}) : null
|
|
1635
1631
|
]
|
|
1636
1632
|
}
|
|
1637
1633
|
) }),
|
|
1638
1634
|
/* @__PURE__ */ e.jsx(hr, { children: /* @__PURE__ */ e.jsx(Z, { className: "bg-background", children: /* @__PURE__ */ e.jsx(
|
|
1639
|
-
|
|
1635
|
+
il,
|
|
1640
1636
|
{
|
|
1641
1637
|
units: u,
|
|
1642
|
-
current:
|
|
1643
|
-
onSelect: (
|
|
1644
|
-
t(!1), h(
|
|
1638
|
+
current: d,
|
|
1639
|
+
onSelect: (b) => {
|
|
1640
|
+
t(!1), h(b), G(b);
|
|
1645
1641
|
}
|
|
1646
1642
|
}
|
|
1647
1643
|
) }) })
|
|
1648
1644
|
] })
|
|
1649
1645
|
] }),
|
|
1650
|
-
["none", "auto"].indexOf(
|
|
1651
|
-
|
|
1646
|
+
["none", "auto"].indexOf(d) !== -1 || D ? null : /* @__PURE__ */ e.jsx(
|
|
1647
|
+
nl,
|
|
1652
1648
|
{
|
|
1653
1649
|
onDragStart: () => j(!0),
|
|
1654
|
-
onDragEnd: (
|
|
1655
|
-
if (w(() => ""), j(!1), f(
|
|
1650
|
+
onDragEnd: (b) => {
|
|
1651
|
+
if (w(() => ""), j(!1), f(b))
|
|
1656
1652
|
return;
|
|
1657
|
-
const v = `${
|
|
1653
|
+
const v = `${b}`, M = `${v.startsWith("-") ? "-" : ""}${c}[${v.replace("-", "")}${d === "-" ? "" : d}]`;
|
|
1658
1654
|
N(M);
|
|
1659
1655
|
},
|
|
1660
|
-
onDrag: (
|
|
1661
|
-
if (f(
|
|
1656
|
+
onDrag: (b) => {
|
|
1657
|
+
if (f(b))
|
|
1662
1658
|
return;
|
|
1663
|
-
w(
|
|
1664
|
-
const v = `${
|
|
1659
|
+
w(b);
|
|
1660
|
+
const v = `${b}`, M = `${v.startsWith("-") ? "-" : ""}${c}[${v.replace("-", "")}${d === "-" ? "" : d}]`;
|
|
1665
1661
|
$(M);
|
|
1666
1662
|
},
|
|
1667
1663
|
currentValue: s,
|
|
1668
|
-
unit:
|
|
1664
|
+
unit: d,
|
|
1669
1665
|
negative: y,
|
|
1670
1666
|
cssProperty: n
|
|
1671
1667
|
}
|
|
@@ -1674,7 +1670,7 @@ const sl = (r) => {
|
|
|
1674
1670
|
}, ae = (r) => {
|
|
1675
1671
|
const o = ge();
|
|
1676
1672
|
return jt(o, { property: r });
|
|
1677
|
-
},
|
|
1673
|
+
}, cl = (r, o) => {
|
|
1678
1674
|
const t = {
|
|
1679
1675
|
xs: 0,
|
|
1680
1676
|
sm: 1,
|
|
@@ -1684,7 +1680,7 @@ const sl = (r) => {
|
|
|
1684
1680
|
"2xl": 5
|
|
1685
1681
|
};
|
|
1686
1682
|
return t[x(r, "mq", "xs")] <= t[o];
|
|
1687
|
-
},
|
|
1683
|
+
}, pl = {
|
|
1688
1684
|
width: "w-",
|
|
1689
1685
|
height: "h-",
|
|
1690
1686
|
minWidth: "min-w-",
|
|
@@ -1757,22 +1753,22 @@ const sl = (r) => {
|
|
|
1757
1753
|
lg: "1024px",
|
|
1758
1754
|
xl: "1280px",
|
|
1759
1755
|
"2xl": "1536px"
|
|
1760
|
-
},
|
|
1761
|
-
const { t: o } = K(), { type: t = "icons", label: s, property: l, onEmitChange:
|
|
1762
|
-
}, units: a, negative: c = !1 } = r, [n] = yr(), [u] = Je(), [, y] = Be(),
|
|
1756
|
+
}, ul = (r) => `${r.toUpperCase()} ${Le[r] ? `(${Le[r]} & up)` : ""}`, Re = (r) => {
|
|
1757
|
+
const { t: o } = K(), { type: t = "icons", label: s, property: l, onEmitChange: i = () => {
|
|
1758
|
+
}, units: a, negative: c = !1 } = r, [n] = yr(), [u] = Je(), [, y] = Be(), d = ae(l), h = Ke(), g = qe(), [p] = Ge(), m = _(() => x(d, "fullCls", ""), [d]), w = V(
|
|
1763
1759
|
($, F = !0) => {
|
|
1764
1760
|
const G = { dark: n, mq: y, mod: u, cls: $, property: l, fullCls: "" };
|
|
1765
1761
|
(n || u !== "") && (G.mq = "xs");
|
|
1766
|
-
const
|
|
1767
|
-
h(p, [
|
|
1762
|
+
const b = Or(G);
|
|
1763
|
+
h(p, [b], F);
|
|
1768
1764
|
},
|
|
1769
1765
|
[p, n, y, u, l, h]
|
|
1770
1766
|
), D = V(() => {
|
|
1771
|
-
g(p, [
|
|
1772
|
-
}, [p,
|
|
1767
|
+
g(p, [m]);
|
|
1768
|
+
}, [p, m, g]), j = _(() => cl(d, y), [d, y]);
|
|
1773
1769
|
O(() => {
|
|
1774
|
-
|
|
1775
|
-
}, [j,
|
|
1770
|
+
i(j, d);
|
|
1771
|
+
}, [j, i, d]);
|
|
1776
1772
|
const [, , I] = Be(), L = V(
|
|
1777
1773
|
($) => {
|
|
1778
1774
|
I({
|
|
@@ -1785,28 +1781,28 @@ const sl = (r) => {
|
|
|
1785
1781
|
}[$]);
|
|
1786
1782
|
},
|
|
1787
1783
|
[I]
|
|
1788
|
-
), N = x(
|
|
1789
|
-
return /* @__PURE__ */ e.jsx(
|
|
1790
|
-
/* @__PURE__ */ e.jsx("div", { className: "relative w-[70px] truncate text-xs text-foreground", children: /* @__PURE__ */ e.jsx("span", { className: `text-[11px] ${
|
|
1784
|
+
), N = x(d, "dark", null) === n && x(d, "mod", null) === u && x(d, "mq", null) === y;
|
|
1785
|
+
return /* @__PURE__ */ e.jsx(Qr, { canChange: j, canReset: d && N, children: /* @__PURE__ */ e.jsxs("div", { className: "group flex flex-row items-center py-2 first:pt-0 last:pb-0", children: [
|
|
1786
|
+
/* @__PURE__ */ e.jsx("div", { className: "relative w-[70px] truncate text-xs text-foreground", children: /* @__PURE__ */ e.jsx("span", { className: `text-[11px] ${d && !N ? "text-foreground" : ""}`, children: o(s) }) }),
|
|
1791
1787
|
/* @__PURE__ */ e.jsxs("div", { className: "flex flex-row items-center", children: [
|
|
1792
1788
|
/* @__PURE__ */ e.jsxs("div", { className: "w-[150px]", children: [
|
|
1793
1789
|
t === "arbitrary" ? /* @__PURE__ */ e.jsx(
|
|
1794
|
-
|
|
1790
|
+
dl,
|
|
1795
1791
|
{
|
|
1796
|
-
currentClass: x(
|
|
1797
|
-
classPrefix: x(
|
|
1792
|
+
currentClass: x(d, "cls", ""),
|
|
1793
|
+
classPrefix: x(pl, l, ""),
|
|
1798
1794
|
units: a || [],
|
|
1799
1795
|
onChange: w,
|
|
1800
1796
|
negative: c,
|
|
1801
1797
|
cssProperty: l
|
|
1802
1798
|
}
|
|
1803
1799
|
) : null,
|
|
1804
|
-
t === "icons" && /* @__PURE__ */ e.jsx(
|
|
1805
|
-
t === "range" && /* @__PURE__ */ e.jsx(
|
|
1806
|
-
t === "color" && /* @__PURE__ */ e.jsx(
|
|
1800
|
+
t === "icons" && /* @__PURE__ */ e.jsx(tl, { property: l, onChange: w }),
|
|
1801
|
+
t === "range" && /* @__PURE__ */ e.jsx(el, { property: l, onChange: w }),
|
|
1802
|
+
t === "color" && /* @__PURE__ */ e.jsx(ll, { property: l, onChange: w }),
|
|
1807
1803
|
t === "dropdown" && /* @__PURE__ */ e.jsx(ot, { label: s, property: l, onChange: w })
|
|
1808
1804
|
] }),
|
|
1809
|
-
/* @__PURE__ */ e.jsx("div", { className: `w-[30px] cursor-pointer ${
|
|
1805
|
+
/* @__PURE__ */ e.jsx("div", { className: `w-[30px] cursor-pointer ${m ? "visible" : "invisible"}`, children: N ? /* @__PURE__ */ e.jsx("button", { type: "button", onClick: () => D(), title: "Reset", className: "flex px-1.5 text-xs", children: /* @__PURE__ */ e.jsx(Ot, { className: "h-5 w-5 text-blue-500 hover:opacity-80" }) }) : j && d ? /* @__PURE__ */ e.jsxs(X, { delayDuration: 100, children: [
|
|
1810
1806
|
/* @__PURE__ */ e.jsx(z, { asChild: !0, children: /* @__PURE__ */ e.jsx(
|
|
1811
1807
|
"button",
|
|
1812
1808
|
{
|
|
@@ -1818,19 +1814,19 @@ const sl = (r) => {
|
|
|
1818
1814
|
/* @__PURE__ */ e.jsx(Z, { children: /* @__PURE__ */ e.jsx("div", { className: "text-right", children: /* @__PURE__ */ e.jsxs("div", { children: [
|
|
1819
1815
|
"Current style is set at ",
|
|
1820
1816
|
/* @__PURE__ */ e.jsxs("span", { className: "font-bold", children: [
|
|
1821
|
-
|
|
1822
|
-
n && !
|
|
1817
|
+
ul(x(d, "mq")),
|
|
1818
|
+
n && !d.dark ? "(Light mode)" : ""
|
|
1823
1819
|
] }),
|
|
1824
1820
|
/* @__PURE__ */ e.jsx("br", {}),
|
|
1825
1821
|
/* @__PURE__ */ e.jsxs(
|
|
1826
1822
|
"button",
|
|
1827
1823
|
{
|
|
1828
1824
|
type: "button",
|
|
1829
|
-
onClick: () => L(x(
|
|
1825
|
+
onClick: () => L(x(d, "mq")),
|
|
1830
1826
|
className: "block w-full cursor-default text-right font-semibold text-blue-500",
|
|
1831
1827
|
children: [
|
|
1832
1828
|
"Switch to ",
|
|
1833
|
-
x(
|
|
1829
|
+
x(d, "mq").toUpperCase()
|
|
1834
1830
|
]
|
|
1835
1831
|
}
|
|
1836
1832
|
)
|
|
@@ -1838,16 +1834,16 @@ const sl = (r) => {
|
|
|
1838
1834
|
] }) : null })
|
|
1839
1835
|
] })
|
|
1840
1836
|
] }) });
|
|
1841
|
-
},
|
|
1837
|
+
}, xl = ["px", "%", "em", "rem", "ch", "vh", "vw"], nt = ({
|
|
1842
1838
|
label: r,
|
|
1843
1839
|
options: o,
|
|
1844
1840
|
borderB: t = !1,
|
|
1845
1841
|
borderT: s = !1,
|
|
1846
1842
|
type: l = "arbitrary",
|
|
1847
|
-
units:
|
|
1843
|
+
units: i = xl,
|
|
1848
1844
|
negative: a = !1
|
|
1849
1845
|
}) => {
|
|
1850
|
-
const { t: c } = K(), [n, u] = C(o[0].key), y = ge(),
|
|
1846
|
+
const { t: c } = K(), [n, u] = C(o[0].key), y = ge(), d = V((h) => k(y, "property").includes(h), [y]);
|
|
1851
1847
|
return /* @__PURE__ */ e.jsxs(
|
|
1852
1848
|
"div",
|
|
1853
1849
|
{
|
|
@@ -1865,7 +1861,7 @@ const sl = (r) => {
|
|
|
1865
1861
|
className: `relative cursor-pointer rounded-full p-1 text-[8px] ${g === n ? " bg-[#3E57F0] text-white" : "text-gray-600 dark:text-gray-300"}`,
|
|
1866
1862
|
children: [
|
|
1867
1863
|
P.createElement("div", {
|
|
1868
|
-
className:
|
|
1864
|
+
className: d(g) ? "-bottom-1.5 absolute bg-[#3E57F0] h-[2px] left-0 w-full" : ""
|
|
1869
1865
|
}),
|
|
1870
1866
|
P.createElement(x(st, g, ze), { className: "text-inherit w-3 h-3" })
|
|
1871
1867
|
]
|
|
@@ -1879,7 +1875,7 @@ const sl = (r) => {
|
|
|
1879
1875
|
Re,
|
|
1880
1876
|
{
|
|
1881
1877
|
type: l,
|
|
1882
|
-
units: [...
|
|
1878
|
+
units: [...i],
|
|
1883
1879
|
label: "",
|
|
1884
1880
|
property: n,
|
|
1885
1881
|
negative: a
|
|
@@ -1888,12 +1884,12 @@ const sl = (r) => {
|
|
|
1888
1884
|
]
|
|
1889
1885
|
}
|
|
1890
1886
|
);
|
|
1891
|
-
},
|
|
1887
|
+
}, gl = ({ heading: r, items: o }) => {
|
|
1892
1888
|
const { t } = K(), s = ge(), l = _(() => {
|
|
1893
|
-
const
|
|
1889
|
+
const i = (n) => U(
|
|
1894
1890
|
n.map((u) => u.styleType === "multiple" ? k(u.options, "key") : u.property)
|
|
1895
1891
|
), a = U(
|
|
1896
|
-
o.map((n) => n.styleType === "accordion" ?
|
|
1892
|
+
o.map((n) => n.styleType === "accordion" ? i(n.items) : n.styleType === "multiple" ? k(n.options, "key") : n.property)
|
|
1897
1893
|
), c = k(s, "property");
|
|
1898
1894
|
return Ye(a, c).length > 0;
|
|
1899
1895
|
}, [s, o]);
|
|
@@ -1907,9 +1903,9 @@ const sl = (r) => {
|
|
|
1907
1903
|
}
|
|
1908
1904
|
) : null
|
|
1909
1905
|
] }) }),
|
|
1910
|
-
/* @__PURE__ */ e.jsx("div", { className: "p-2", children: o.map((
|
|
1906
|
+
/* @__PURE__ */ e.jsx("div", { className: "p-2", children: o.map((i) => i.styleType === "multiple" ? /* @__PURE__ */ e.jsx(nt, { ...i }, i.label) : /* @__PURE__ */ e.jsx(Re, { ...i }, i.label)) })
|
|
1911
1907
|
] });
|
|
1912
|
-
},
|
|
1908
|
+
}, hl = Me({}), me = ({ section: r }) => {
|
|
1913
1909
|
const { t: o } = K(), t = ge(), s = V(
|
|
1914
1910
|
(a = []) => {
|
|
1915
1911
|
const c = {};
|
|
@@ -1933,17 +1929,17 @@ const sl = (r) => {
|
|
|
1933
1929
|
r.items.map((u) => u.styleType === "accordion" ? a(u.items) : u.styleType === "multiple" ? U(k(u.options, "key")) : u.property)
|
|
1934
1930
|
), n = k(t, "property");
|
|
1935
1931
|
return Ye(c, n).length > 0;
|
|
1936
|
-
}, [t, r.heading, r.items]),
|
|
1937
|
-
return /* @__PURE__ */ e.jsx(
|
|
1932
|
+
}, [t, r.heading, r.items]), i = _(() => ({}), []);
|
|
1933
|
+
return /* @__PURE__ */ e.jsx(hl.Provider, { value: i, children: /* @__PURE__ */ e.jsxs(de, { value: r.heading, children: [
|
|
1938
1934
|
/* @__PURE__ */ e.jsx(ce, { className: "px-3 py-2 text-xs hover:no-underline", children: /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-x-2", children: [
|
|
1939
1935
|
/* @__PURE__ */ e.jsx("div", { className: `h-[8px] w-[8px] rounded-full ${l ? "bg-blue-500" : "bg-gray-300"}` }),
|
|
1940
1936
|
o(r.heading)
|
|
1941
1937
|
] }) }),
|
|
1942
1938
|
/* @__PURE__ */ e.jsx(pe, { className: "bg-gray-100 px-3.5 py-2", children: P.Children.toArray(
|
|
1943
|
-
r.items.map((a) => ye(a, "component") ? P.createElement(a.component, { key: a.label }) : ye(a, "styleType") ? a.styleType === "multiple" ? /* @__PURE__ */ e.jsx(nt, { ...a }, a.label) : a.styleType === "accordion" && s(a == null ? void 0 : a.conditions) ? /* @__PURE__ */ e.jsx(
|
|
1939
|
+
r.items.map((a) => ye(a, "component") ? P.createElement(a.component, { key: a.label }) : ye(a, "styleType") ? a.styleType === "multiple" ? /* @__PURE__ */ e.jsx(nt, { ...a }, a.label) : a.styleType === "accordion" && s(a == null ? void 0 : a.conditions) ? /* @__PURE__ */ e.jsx(gl, { ...a }, a.label) : null : /* @__PURE__ */ e.jsx(Re, { ...a }, a.label))
|
|
1944
1940
|
) })
|
|
1945
1941
|
] }) });
|
|
1946
|
-
},
|
|
1942
|
+
}, yl = ({
|
|
1947
1943
|
item: r,
|
|
1948
1944
|
index: o,
|
|
1949
1945
|
canDelete: t,
|
|
@@ -1954,7 +1950,7 @@ const sl = (r) => {
|
|
|
1954
1950
|
"input",
|
|
1955
1951
|
{
|
|
1956
1952
|
name: "key",
|
|
1957
|
-
onChange: (
|
|
1953
|
+
onChange: (i) => s(i, o),
|
|
1958
1954
|
value: r.key,
|
|
1959
1955
|
placeholder: "Key",
|
|
1960
1956
|
className: "w-full rounded border-gray-300 bg-background p-0.5 pl-2 text-sm focus-visible:outline-0",
|
|
@@ -1967,7 +1963,7 @@ const sl = (r) => {
|
|
|
1967
1963
|
"input",
|
|
1968
1964
|
{
|
|
1969
1965
|
name: "value",
|
|
1970
|
-
onChange: (
|
|
1966
|
+
onChange: (i) => f(r.key) ? {} : s(i, o),
|
|
1971
1967
|
value: r.value,
|
|
1972
1968
|
placeholder: "Value",
|
|
1973
1969
|
className: "w-full rounded border-gray-300 bg-background p-0.5 pl-2 text-sm focus-visible:outline-0",
|
|
@@ -1983,24 +1979,24 @@ const sl = (r) => {
|
|
|
1983
1979
|
}
|
|
1984
1980
|
)
|
|
1985
1981
|
] })
|
|
1986
|
-
] }),
|
|
1982
|
+
] }), bl = ({ section: r }) => {
|
|
1987
1983
|
var h;
|
|
1988
|
-
const { setSyncState: o } =
|
|
1984
|
+
const { setSyncState: o } = br(), t = q(), [s, l] = C([]), [i] = Se(), a = We(), c = `${x(i, "0.prop")}_attrs`;
|
|
1989
1985
|
ne.useEffect(() => {
|
|
1990
|
-
const g = k(x(t, c), (p,
|
|
1986
|
+
const g = k(x(t, c), (p, m) => ({ key: m, value: p }));
|
|
1991
1987
|
f(g) ? l([]) : l(g);
|
|
1992
1988
|
}, [x(t, c)]);
|
|
1993
1989
|
const n = () => l([...s, { key: "", value: "" }]), u = (g) => {
|
|
1994
|
-
const p = we(s, (
|
|
1995
|
-
|
|
1990
|
+
const p = we(s, (m, w) => g !== w);
|
|
1991
|
+
d(p);
|
|
1996
1992
|
}, y = (g, p) => {
|
|
1997
|
-
const
|
|
1998
|
-
|
|
1999
|
-
},
|
|
1993
|
+
const m = [...s];
|
|
1994
|
+
m[p][g.target.name] = g.target.value, d(m);
|
|
1995
|
+
}, d = ne.useCallback(
|
|
2000
1996
|
(g = []) => {
|
|
2001
1997
|
const p = {};
|
|
2002
|
-
ke(g, (
|
|
2003
|
-
f(
|
|
1998
|
+
ke(g, (m) => {
|
|
1999
|
+
f(m.key) || Oe(p, m.key, m.value);
|
|
2004
2000
|
}), a([x(t, "_id")], { [c]: p }), o("UNSAVED");
|
|
2005
2001
|
},
|
|
2006
2002
|
[t, o, a, c]
|
|
@@ -2016,7 +2012,7 @@ const sl = (r) => {
|
|
|
2016
2012
|
"Attributes"
|
|
2017
2013
|
] }) }),
|
|
2018
2014
|
/* @__PURE__ */ e.jsx(pe, { 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: [
|
|
2019
|
-
/* @__PURE__ */ e.jsxs(
|
|
2015
|
+
/* @__PURE__ */ e.jsxs(Te, { className: "mt-2 flex w-full items-center justify-between", children: [
|
|
2020
2016
|
"Add Custom attributes",
|
|
2021
2017
|
/* @__PURE__ */ e.jsxs(
|
|
2022
2018
|
"div",
|
|
@@ -2037,13 +2033,13 @@ const sl = (r) => {
|
|
|
2037
2033
|
f(s) && /* @__PURE__ */ e.jsx("div", { className: "flex h-12 items-center justify-center text-sm text-gray-400", children: "Click + Add to add attributes" }),
|
|
2038
2034
|
ne.Children.toArray(
|
|
2039
2035
|
k(s, (g, p) => {
|
|
2040
|
-
const
|
|
2036
|
+
const m = s.length > 0 && p < s.length - 1;
|
|
2041
2037
|
return /* @__PURE__ */ e.jsx(
|
|
2042
|
-
|
|
2038
|
+
yl,
|
|
2043
2039
|
{
|
|
2044
2040
|
item: g,
|
|
2045
2041
|
index: p,
|
|
2046
|
-
canDelete:
|
|
2042
|
+
canDelete: m,
|
|
2047
2043
|
onChange: y,
|
|
2048
2044
|
onRemove: () => u(p)
|
|
2049
2045
|
}
|
|
@@ -2055,15 +2051,15 @@ const sl = (r) => {
|
|
|
2055
2051
|
] });
|
|
2056
2052
|
};
|
|
2057
2053
|
function ml() {
|
|
2058
|
-
const [r, o] = Je(), { flexChild: t, gridChild: s } =
|
|
2054
|
+
const [r, o] = Je(), { flexChild: t, gridChild: s } = mr(), [, l] = Ar(fr), { t: i } = K(), [a] = Se();
|
|
2059
2055
|
return f(a) ? /* @__PURE__ */ e.jsx("div", { className: "p-4 text-center", children: /* @__PURE__ */ e.jsxs("div", { className: "space-y-4 rounded-xl p-4", children: [
|
|
2060
2056
|
/* @__PURE__ */ e.jsx(Ze, { className: "mx-auto text-3xl" }),
|
|
2061
|
-
/* @__PURE__ */ e.jsx("h1", { children:
|
|
2057
|
+
/* @__PURE__ */ e.jsx("h1", { children: i("no_styling_block_selected") })
|
|
2062
2058
|
] }) }) : (
|
|
2063
2059
|
// eslint-disable-next-line jsx-a11y/click-events-have-key-events,jsx-a11y/no-static-element-interactions
|
|
2064
2060
|
/* @__PURE__ */ e.jsxs("div", { onClick: () => l(!1), className: "flex h-full flex-col", children: [
|
|
2065
|
-
/* @__PURE__ */ e.jsx("div", { className: "flex h-12 flex-col space-x-4
|
|
2066
|
-
/* @__PURE__ */ e.jsx(
|
|
2061
|
+
/* @__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: [
|
|
2062
|
+
/* @__PURE__ */ e.jsx(Te, { htmlFor: "", className: "flex gap-x-1.5 text-xs italic", children: "State" }),
|
|
2067
2063
|
/* @__PURE__ */ e.jsxs(vr, { defaultValue: r, onValueChange: (c) => o(c), children: [
|
|
2068
2064
|
/* @__PURE__ */ e.jsx(wr, { className: "h-auto w-fit p-1 px-3", children: /* @__PURE__ */ e.jsx(jr, { placeholder: "State" }) }),
|
|
2069
2065
|
/* @__PURE__ */ e.jsxs(Cr, { children: [
|
|
@@ -2082,16 +2078,20 @@ function ml() {
|
|
|
2082
2078
|
] })
|
|
2083
2079
|
] })
|
|
2084
2080
|
] }) }),
|
|
2085
|
-
/* @__PURE__ */ e.
|
|
2086
|
-
|
|
2087
|
-
|
|
2088
|
-
|
|
2089
|
-
|
|
2081
|
+
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: [
|
|
2082
|
+
/* @__PURE__ */ e.jsx(Vr, { className: "w-3" }),
|
|
2083
|
+
/* @__PURE__ */ e.jsx("span", { children: i(`Styles will be applied for (:${r}) state`) })
|
|
2084
|
+
] }) : null,
|
|
2085
|
+
/* @__PURE__ */ e.jsx(Qe, { className: "no-scrollbar -mx-1 max-h-full flex-1 overflow-x-hidden overflow-y-hidden border-t border-border", children: /* @__PURE__ */ e.jsxs(Ue, { defaultValue: ["Layout"], type: "multiple", className: "w-full", children: [
|
|
2086
|
+
t && /* @__PURE__ */ e.jsx(me, { section: qr }),
|
|
2087
|
+
s ? /* @__PURE__ */ e.jsx(me, { section: Gr }) : null,
|
|
2088
|
+
Jr.map((c) => /* @__PURE__ */ e.jsx(me, { section: c }, c.heading)),
|
|
2089
|
+
/* @__PURE__ */ e.jsx(bl, { section: { heading: "Attributes" } })
|
|
2090
2090
|
] }) })
|
|
2091
2091
|
] })
|
|
2092
2092
|
);
|
|
2093
2093
|
}
|
|
2094
|
-
const
|
|
2094
|
+
const fl = {
|
|
2095
2095
|
px: 1,
|
|
2096
2096
|
"%": 1,
|
|
2097
2097
|
em: 100,
|
|
@@ -2102,8 +2102,8 @@ const bl = {
|
|
|
2102
2102
|
"-": 1,
|
|
2103
2103
|
deg: 1,
|
|
2104
2104
|
ms: 0.1
|
|
2105
|
-
},
|
|
2106
|
-
const r = q(), { t: o } = K(), [t, s] = P.useState(""), [l,
|
|
2105
|
+
}, vs = () => {
|
|
2106
|
+
const r = q(), { t: o } = K(), [t, s] = P.useState(""), [l, i] = P.useState({
|
|
2107
2107
|
onDrag: (n) => n,
|
|
2108
2108
|
onDragEnd: (n) => n,
|
|
2109
2109
|
dragStartY: 0,
|
|
@@ -2115,17 +2115,17 @@ const bl = {
|
|
|
2115
2115
|
}), a = fe(
|
|
2116
2116
|
(n) => {
|
|
2117
2117
|
const u = !x(l, "negative", !1), y = x(l, "cssProperty", "");
|
|
2118
|
-
let
|
|
2119
|
-
|
|
2120
|
-
let h =
|
|
2118
|
+
let d = parseFloat(l.dragStartValue);
|
|
2119
|
+
d = Fe(d) ? 0 : d;
|
|
2120
|
+
let h = fl[l.dragUnit];
|
|
2121
2121
|
(W(y, "scale") || y === "opacity") && (h = 10);
|
|
2122
|
-
let p = (l.dragStartY - n.pageY) / h +
|
|
2122
|
+
let p = (l.dragStartY - n.pageY) / h + d;
|
|
2123
2123
|
u && p < 0 && (p = 0), y === "opacity" && p > 1 && (p = 1), l.onDrag(`${p}`), s(`${p}`);
|
|
2124
2124
|
},
|
|
2125
2125
|
[l],
|
|
2126
2126
|
50
|
|
2127
2127
|
), c = V(() => {
|
|
2128
|
-
setTimeout(() => l.onDragEnd(`${t}`), 100),
|
|
2128
|
+
setTimeout(() => l.onDragEnd(`${t}`), 100), i({
|
|
2129
2129
|
onDrag: (n) => n,
|
|
2130
2130
|
onDragEnd: (n) => n,
|
|
2131
2131
|
dragStartY: 0,
|
|
@@ -2135,11 +2135,11 @@ const bl = {
|
|
|
2135
2135
|
negative: !1,
|
|
2136
2136
|
cssProperty: ""
|
|
2137
2137
|
});
|
|
2138
|
-
}, [l, t,
|
|
2138
|
+
}, [l, t, i]);
|
|
2139
2139
|
return Ct(r) ? /* @__PURE__ */ e.jsx("div", { className: "p-4 text-center", children: /* @__PURE__ */ e.jsxs("div", { className: "space-y-4 rounded-xl p-4", children: [
|
|
2140
2140
|
/* @__PURE__ */ e.jsx(Ze, { className: "mx-auto text-3xl" }),
|
|
2141
2141
|
/* @__PURE__ */ e.jsx("h1", { children: o("no_block_selected_for_styling") })
|
|
2142
|
-
] }) }) : /* @__PURE__ */ e.jsx(tt, { children: /* @__PURE__ */ e.jsxs(at.Provider, { value: { setDragData:
|
|
2142
|
+
] }) }) : /* @__PURE__ */ e.jsx(tt, { children: /* @__PURE__ */ e.jsxs(at.Provider, { value: { setDragData: i }, children: [
|
|
2143
2143
|
l.dragging ? /* @__PURE__ */ e.jsx(
|
|
2144
2144
|
"div",
|
|
2145
2145
|
{
|
|
@@ -2153,11 +2153,11 @@ const bl = {
|
|
|
2153
2153
|
/* @__PURE__ */ e.jsx(De, { value: "settings", children: o("settings") }),
|
|
2154
2154
|
/* @__PURE__ */ e.jsx(De, { value: "styling", children: o("styling") })
|
|
2155
2155
|
] }),
|
|
2156
|
-
/* @__PURE__ */ e.jsx($e, { value: "settings", className: "no-scrollbar h-full flex-1 overflow-y-auto overflow-x-hidden", children: /* @__PURE__ */ e.jsx(Qe, { className: "no-scrollbar max-h-full flex-1 overflow-x-hidden overflow-y-hidden pb-5", children: /* @__PURE__ */ e.jsx(
|
|
2156
|
+
/* @__PURE__ */ e.jsx($e, { value: "settings", className: "no-scrollbar h-full flex-1 overflow-y-auto overflow-x-hidden", children: /* @__PURE__ */ e.jsx(Qe, { className: "no-scrollbar max-h-full flex-1 overflow-x-hidden overflow-y-hidden pb-5", children: /* @__PURE__ */ e.jsx(Ur, {}) }) }),
|
|
2157
2157
|
/* @__PURE__ */ e.jsx($e, { value: "styling", className: "h-full flex-1 overflow-y-auto overflow-x-hidden", children: /* @__PURE__ */ e.jsx(ml, {}) })
|
|
2158
2158
|
] })
|
|
2159
2159
|
] }) });
|
|
2160
2160
|
};
|
|
2161
2161
|
export {
|
|
2162
|
-
|
|
2162
|
+
vs as default
|
|
2163
2163
|
};
|