@chaibuilder/sdk 1.2.22 → 1.2.24
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-l1JENNvq.js +206 -0
- package/dist/AddBlocks-zPPKkeKs.cjs +1 -0
- package/dist/BrandingOptions-DkpqGARR.cjs +1 -0
- package/dist/{BrandingOptions-4961TxX2.js → BrandingOptions-udtH5yJs.js} +11 -10
- package/dist/CanvasArea-IqeMbtOf.js +951 -0
- package/dist/CanvasArea-plZTWifU.cjs +55 -0
- package/dist/{Class-MmCxz2Ay.cjs → Class-PoYusiA5.cjs} +1 -1
- package/dist/{Class-3k8xjeiM.js → Class-lGzsNBOK.js} +1 -1
- package/dist/CurrentPage-7_s9LtEJ.cjs +1 -0
- package/dist/{CurrentPage-oPZN6Gwj.js → CurrentPage-AA0XHYMU.js} +23 -24
- package/dist/ListTree-LAN7QmHQ.cjs +1 -0
- package/dist/ListTree-ZNEtds1d.js +309 -0
- package/dist/MODIFIERS-0g14w5RS.cjs +1 -0
- package/dist/{MODIFIERS-WQdaNvb8.js → MODIFIERS-dytZ-osO.js} +4 -8
- package/dist/PagesPanel-5qMZBatP.cjs +1 -0
- package/dist/{PagesPanel-pRKHw-AZ.js → PagesPanel-883P3_su.js} +9 -10
- package/dist/{ProjectPanel-iU6DY-Yp.js → ProjectPanel-Y8Qcmsn0.js} +11 -12
- package/dist/ProjectPanel-otQb9ceP.cjs +1 -0
- package/dist/STRINGS--j49GZJP.js +7 -0
- package/dist/STRINGS-gPz7CUOk.cjs +1 -0
- package/dist/Settings-Rt342VJ3.cjs +1 -0
- package/dist/{Settings-BhSrj-cE.js → Settings-pIePR1Id.js} +862 -865
- package/dist/{SidePanels-OLOUpKn4.js → SidePanels-NznSn5RN.js} +121 -125
- package/dist/SidePanels-PaQkgjLa.cjs +1 -0
- package/dist/Topbar-CqW7G360.cjs +1 -0
- package/dist/{Topbar-Ny9T-7Zb.js → Topbar-pWzBEOed.js} +39 -35
- package/dist/UnsplashImages-NGskB93R.cjs +1 -0
- package/dist/{UnsplashImages-Y8RGFVSh.js → UnsplashImages-qvwFbV-E.js} +17 -16
- package/dist/{UploadImages-dd8LfyFr.js → UploadImages-9NapgXBq.js} +12 -11
- package/dist/UploadImages-Oh7Glr9A.cjs +1 -0
- package/dist/{add-page-modal-Jni6CY1x.js → add-page-modal-4PiRJgX5.js} +11 -12
- package/dist/add-page-modal-4o2L_7T7.cjs +1 -0
- package/dist/confirm-alert-C4M9eF-o.cjs +1 -0
- package/dist/{confirm-alert-sc8RaWvD.js → confirm-alert-GUhZ_G8w.js} +7 -6
- package/dist/core.cjs +1 -1
- package/dist/core.d.ts +5 -3
- package/dist/core.js +48 -49
- package/dist/defaultTheme-7VqqhOcp.cjs +1 -0
- package/dist/{defaultTheme-gunU_Fe5.js → defaultTheme-D8B4-wHO.js} +1 -1
- package/dist/{delete-page-modal-0WiMZFxr.js → delete-page-modal-4l5-RhQB.js} +10 -11
- package/dist/delete-page-modal-Bek5bCf-.cjs +1 -0
- package/dist/email.cjs +1 -1
- package/dist/email.d.ts +3 -1
- package/dist/email.js +16 -16
- package/dist/{form-Nj6Kdn3g.js → form-STUz-6nE.js} +1 -1
- package/dist/{form-n1Q6u16z.cjs → form-lBQ_76Uw.cjs} +1 -1
- package/dist/html-to-json-efmv1pCj.cjs +1 -0
- package/dist/{html-to-json-C5sExaSD.js → html-to-json-ngX9ef2u.js} +31 -29
- package/dist/{index-IPJAbzzO.js → index-Gk6sASBd.js} +1242 -1213
- package/dist/{index-0bwkNnA0.cjs → index-dgm-fd8U.cjs} +42 -42
- package/dist/{index-UP_4awU9.js → index-gS-3liKK.js} +4479 -4484
- package/dist/index-h-hd6EvN.cjs +1 -0
- package/dist/index-oCYKBYyT.cjs +1 -0
- package/dist/{index-_VPpjzJu.js → index-xZWaF8AW.js} +118 -119
- package/dist/lib.cjs +3 -3
- package/dist/lib.js +17 -16
- package/dist/page-viewer-JlKEwACu.cjs +1 -0
- package/dist/{page-viewer-L1Dmgj-c.js → page-viewer-rCXavxpd.js} +15 -16
- package/dist/project-general-setting-2FGoUZ-z.cjs +1 -0
- package/dist/{project-general-setting-sUP7JqWK.js → project-general-setting-rmAVpDu9.js} +11 -12
- package/dist/project-seo-setting-mlxL_e2_.cjs +1 -0
- package/dist/{project-seo-setting-NNvAGt4T.js → project-seo-setting-pX34Qsym.js} +8 -7
- package/dist/render.cjs +1 -1
- package/dist/render.js +14 -13
- package/dist/single-page-detail-c6-wRWyN.cjs +1 -0
- package/dist/{single-page-detail-FXg_NebW.js → single-page-detail-rSQomrY5.js} +12 -13
- package/dist/studio.cjs +1 -1
- package/dist/studio.d.ts +3 -1
- package/dist/studio.js +8 -9
- package/dist/ui.cjs +1 -1
- package/dist/ui.js +139 -138
- package/dist/web-blocks.cjs +6 -1
- package/dist/web-blocks.js +462 -354
- package/package.json +3 -5
- package/dist/AddBlocks-157fSrJX.cjs +0 -1
- package/dist/AddBlocks-WgpssWmQ.js +0 -223
- package/dist/BrandingOptions-nwXR9TMl.cjs +0 -1
- package/dist/CanvasArea-MajWGr9z.js +0 -908
- package/dist/CanvasArea-MmTlc5Vb.cjs +0 -55
- package/dist/CurrentPage-LpLr0lDI.cjs +0 -1
- package/dist/ListTree-dvxHTXs4.js +0 -167
- package/dist/ListTree-gTmusfso.cjs +0 -1
- package/dist/MODIFIERS-9EwxLM8V.cjs +0 -1
- package/dist/Outline-2OxsXs1-.js +0 -294
- package/dist/Outline-7CCnnzmK.cjs +0 -1
- package/dist/PagesPanel-8536oBWB.cjs +0 -1
- package/dist/ProjectPanel-oILsUWOH.cjs +0 -1
- package/dist/Settings-jHiYmt0y.cjs +0 -1
- package/dist/SidePanels-bcJJocSq.cjs +0 -1
- package/dist/Topbar-NMvzqQHW.cjs +0 -1
- package/dist/TypeIcon-ElNNPazl.cjs +0 -1
- package/dist/TypeIcon-qO96rNbV.js +0 -69
- package/dist/UnsplashImages-6tZv1q2_.cjs +0 -1
- package/dist/UploadImages-VLlVg9Ur.cjs +0 -1
- package/dist/add-page-modal-IsqDdK7X.cjs +0 -1
- package/dist/confirm-alert-f26zJ7Js.cjs +0 -1
- package/dist/defaultTheme-7Lk2zq60.cjs +0 -1
- package/dist/delete-page-modal-c3b-GCap.cjs +0 -1
- package/dist/html-to-json-FGufPv9R.cjs +0 -1
- package/dist/index-9PHdn80L.cjs +0 -1
- package/dist/index-nwAgi0aD.cjs +0 -1
- package/dist/page-viewer-TnxHhq7S.cjs +0 -1
- package/dist/project-general-setting-1Ot1RU43.cjs +0 -1
- package/dist/project-seo-setting-3-vBkx2v.cjs +0 -1
- package/dist/single-page-detail-btEKYXjE.cjs +0 -1
- package/dist/useAddBlockByDrop-V8xo-PNQ.js +0 -20
- package/dist/useAddBlockByDrop-qRHgy8_0.cjs +0 -1
|
@@ -1,28 +1,28 @@
|
|
|
1
1
|
import { j as e } from "./jsx-runtime-WbnYoNE9.js";
|
|
2
2
|
import * as de from "react";
|
|
3
|
-
import
|
|
4
|
-
import { useThrottledCallback as
|
|
5
|
-
import { forEach as
|
|
6
|
-
import { useTranslation as
|
|
7
|
-
import { PlusIcon as
|
|
8
|
-
import { aV as
|
|
9
|
-
import { u as
|
|
10
|
-
import { Check as
|
|
11
|
-
import { getBlockComponent as
|
|
12
|
-
import { E as
|
|
13
|
-
import { J as
|
|
14
|
-
import
|
|
15
|
-
import
|
|
16
|
-
import
|
|
17
|
-
import
|
|
18
|
-
import { A as
|
|
19
|
-
import { a as
|
|
20
|
-
import { get as Ye, first as rs, isEmpty as ie, has as ss, keys as Xe, capitalize as Ze, startCase as We } from "lodash";
|
|
3
|
+
import $, { useState as w, useMemo as _, useEffect as L, useCallback as V, memo as mt, createContext as Ke, useContext as oe } from "react";
|
|
4
|
+
import { useThrottledCallback as fe } from "@react-hookz/web";
|
|
5
|
+
import { forEach as Re, isArray as pe, omit as bt, truncate as ft, includes as M, get as x, first as ae, split as vt, startCase as E, toLower as le, isEmpty as b, map as k, find as jt, last as wt, filter as ve, set as Ge, debounce as Ct, keys as je, cloneDeep as kt, each as Nt, capitalize as we, reject as _t, nth as $e, startsWith as G, isNumber as Tt, parseInt as St, isNaN as qe, findLast as Rt, flatten as q, intersection as Je, has as ce, kebabCase as Vt, isNull as Ht } from "lodash-es";
|
|
6
|
+
import { useTranslation as z } from "react-i18next";
|
|
7
|
+
import { PlusIcon as Ve, Cross2Icon as Qe, EyeOpenIcon as Dt, EyeClosedIcon as Ae, BorderAllIcon as A, WidthIcon as S, HeightIcon as R, ArrowUpIcon as ee, ArrowRightIcon as te, ArrowDownIcon as re, ArrowLeftIcon as se, ArrowTopLeftIcon as Bt, ArrowTopRightIcon as Pt, ArrowBottomRightIcon as It, ArrowBottomLeftIcon as $t, AlignLeftIcon as At, AlignCenterHorizontallyIcon as Mt, AlignRightIcon as Et, StretchHorizontallyIcon as Lt, FontItalicIcon as Ot, UnderlineIcon as Ft, OverlineIcon as Yt, LetterCaseUppercaseIcon as zt, Cross1Icon as Xt, InfoCircledIcon as He, MinusIcon as Zt, BoxIcon as et, RowSpacingIcon as Wt, TriangleDownIcon as Ut, CrossCircledIcon as Kt, CaretDownIcon as Gt, MixerHorizontalIcon as tt } from "@radix-ui/react-icons";
|
|
8
|
+
import { aV as qt, aW as Jt, B as U, aX as Qt, aY as er, aZ as tr, a_ as rr, a$ as sr, b0 as lr, b1 as or, a1 as K, af as ar, ag as nr, ah as ir, b2 as dr, ad as cr, ao as pr, ae as ur, ap as O, aq as F, ar as Y, b3 as xr, b4 as gr, b5 as hr, b6 as yr, b7 as mr, b8 as br, a6 as rt, a5 as st, h as fr, b9 as lt, ba as Ce, bb as ke, bc as Ne, ac as ue, M as De, _ as ot, r as at, aB as nt, bd as _e, v as vr, be as jr, $ as xe, V as wr, a4 as it, N as Me, aG as Cr, aH as kr, aI as Nr, bf as Be, aJ as Ee, aK as Le, bg as Oe, bh as Fe, bi as Ye, a7 as _r, aj as Tr, ak as Sr, al as Rr, am as Vr, an as H, au as Hr, av as Dr, aw as he, ax as ye } from "./index-Gk6sASBd.js";
|
|
9
|
+
import { u as Br } from "./controls-OfJWSEqC.js";
|
|
10
|
+
import { Check as Pr, EditIcon as Ir, TrashIcon as $r, BrushIcon as Ar, DeleteIcon as Mr } from "lucide-react";
|
|
11
|
+
import { getBlockComponent as Pe, getChaiDataProviders as Er, useGlobalStylingPresets as Lr } from "@chaibuilder/runtime";
|
|
12
|
+
import { E as dt, u as ct } from "./index-gS-3liKK.js";
|
|
13
|
+
import { J as Or, a as Fr, d as Yr } from "./index-e0c8PmRQ.js";
|
|
14
|
+
import zr from "@rjsf/core";
|
|
15
|
+
import Xr from "@rjsf/validator-ajv8";
|
|
16
|
+
import Zr from "react-autosuggest";
|
|
17
|
+
import Wr from "fuse.js";
|
|
18
|
+
import { A as Ur, C as ge, g as Kr } from "./Class-lGzsNBOK.js";
|
|
19
|
+
import { a as Gr } from "./STRINGS--j49GZJP.js";
|
|
21
20
|
import "./_commonjsHelpers-UyOWmZb0.js";
|
|
22
21
|
import "./Functions-7jnEwJyw.js";
|
|
23
22
|
import "clsx";
|
|
24
23
|
import "tailwind-merge";
|
|
25
24
|
import "jotai";
|
|
25
|
+
import "./MODIFIERS-dytZ-osO.js";
|
|
26
26
|
import "@radix-ui/react-toggle";
|
|
27
27
|
import "class-variance-authority";
|
|
28
28
|
import "@radix-ui/react-switch";
|
|
@@ -49,32 +49,30 @@ import "react-quill";
|
|
|
49
49
|
import "i18next";
|
|
50
50
|
import "@floating-ui/react-dom";
|
|
51
51
|
import "flagged";
|
|
52
|
-
import "react-dnd";
|
|
53
|
-
import "@minoru/react-dnd-treeview";
|
|
54
52
|
import "react-hotkeys-hook";
|
|
55
|
-
function
|
|
56
|
-
const
|
|
57
|
-
function
|
|
58
|
-
|
|
59
|
-
const
|
|
60
|
-
|
|
53
|
+
function qr(r) {
|
|
54
|
+
const s = [], t = {};
|
|
55
|
+
function d(l, n) {
|
|
56
|
+
Re(n, (o, p) => {
|
|
57
|
+
const i = l ? `${l}.${p}` : p, c = pe(o) ? "list" : typeof o;
|
|
58
|
+
s.push(i), t[i] = c === "string" ? "text" : c === "object" ? "model" : c, c === "object" && !pe(o) && d(i, o);
|
|
61
59
|
});
|
|
62
60
|
}
|
|
63
|
-
return
|
|
61
|
+
return d("", bt(r, ["styles", "_type", "_id", "_name", "_bindings"])), { paths: s, pathsType: t };
|
|
64
62
|
}
|
|
65
|
-
const
|
|
66
|
-
if (!
|
|
63
|
+
const Te = ({ data: r, fullView: s }) => {
|
|
64
|
+
if (!r)
|
|
67
65
|
return null;
|
|
68
|
-
const
|
|
69
|
-
return
|
|
66
|
+
const t = typeof r;
|
|
67
|
+
return s ? typeof r == "object" ? /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
70
68
|
/* @__PURE__ */ e.jsx("div", { className: "h-3" }),
|
|
71
|
-
/* @__PURE__ */ e.jsx(
|
|
72
|
-
|
|
69
|
+
/* @__PURE__ */ e.jsx(dt, { children: /* @__PURE__ */ e.jsx(
|
|
70
|
+
Or,
|
|
73
71
|
{
|
|
74
|
-
data:
|
|
75
|
-
shouldExpandNode:
|
|
72
|
+
data: r,
|
|
73
|
+
shouldExpandNode: Fr,
|
|
76
74
|
style: {
|
|
77
|
-
...
|
|
75
|
+
...Yr,
|
|
78
76
|
container: "max-h-[40vh] overflow-y-auto text-[12px] leading-[1.5] tracking-wide font-mono",
|
|
79
77
|
stringValue: "text-orange-600",
|
|
80
78
|
label: "text-green-900 font-semibold pr-1 tracking-wider"
|
|
@@ -83,62 +81,62 @@ const ke = ({ data: t, fullView: o }) => {
|
|
|
83
81
|
) })
|
|
84
82
|
] }) : /* @__PURE__ */ e.jsxs("div", { className: "max-h-36 w-full overflow-y-auto overflow-x-hidden text-[12px] leading-4 text-gray-800/50", children: [
|
|
85
83
|
/* @__PURE__ */ e.jsx("span", { className: "font-medium text-gray-800/80", children: "Content: " }),
|
|
86
|
-
|
|
87
|
-
] }) : /* @__PURE__ */ e.jsx("div", { className: "w-full overflow-hidden whitespace-nowrap text-[10px] leading-3 text-gray-800/50", children:
|
|
88
|
-
},
|
|
89
|
-
type:
|
|
90
|
-
value:
|
|
91
|
-
setValue:
|
|
92
|
-
data:
|
|
84
|
+
r
|
|
85
|
+
] }) : /* @__PURE__ */ e.jsx("div", { className: "w-full overflow-hidden whitespace-nowrap text-[10px] leading-3 text-gray-800/50", children: ft(t === "object" ? JSON.stringify(r) : r, { length: 40 }) });
|
|
86
|
+
}, ze = ({
|
|
87
|
+
type: r,
|
|
88
|
+
value: s = "",
|
|
89
|
+
setValue: t,
|
|
90
|
+
data: d,
|
|
93
91
|
onChange: l,
|
|
94
|
-
dataType:
|
|
95
|
-
appliedBindings:
|
|
92
|
+
dataType: n,
|
|
93
|
+
appliedBindings: o
|
|
96
94
|
}) => {
|
|
97
|
-
const { paths: p, pathsType:
|
|
98
|
-
(u) => !M(
|
|
99
|
-
) : p.filter((u) =>
|
|
100
|
-
return
|
|
101
|
-
|
|
102
|
-
}, [
|
|
95
|
+
const { paths: p, pathsType: i } = qr(d), c = r === "PROP" ? Pe(d == null ? void 0 : d._type) : {}, h = r === "PROP", [a, g] = w(!1), y = _(() => r === "PROP" ? p.filter(
|
|
96
|
+
(u) => !M(o, u) && x(c, `props.${ae(vt(u, "."))}.binding`)
|
|
97
|
+
) : p.filter((u) => n === x(i, u, "")), [r, p, o, n, c]);
|
|
98
|
+
return L(() => {
|
|
99
|
+
s && l(s);
|
|
100
|
+
}, [s, r]), /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
103
101
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-4", children: [
|
|
104
|
-
/* @__PURE__ */ e.jsx("p", { className: "text-sm text-muted-foreground", children:
|
|
105
|
-
/* @__PURE__ */ e.jsxs(
|
|
106
|
-
/* @__PURE__ */ e.jsx(
|
|
107
|
-
|
|
102
|
+
/* @__PURE__ */ e.jsx("p", { className: "text-sm text-muted-foreground", children: E(le(r)) }),
|
|
103
|
+
/* @__PURE__ */ e.jsxs(qt, { open: a, onOpenChange: g, children: [
|
|
104
|
+
/* @__PURE__ */ e.jsx(Jt, { asChild: !0, children: /* @__PURE__ */ e.jsx(
|
|
105
|
+
U,
|
|
108
106
|
{
|
|
109
107
|
variant: "outline",
|
|
110
108
|
size: "sm",
|
|
111
|
-
className: ` ${
|
|
112
|
-
children:
|
|
109
|
+
className: ` ${b(s) ? "w-44 justify-center bg-blue-500 text-gray-100 hover:bg-blue-400 hover:text-white" : "min-w-[350px] items-center justify-between"}`,
|
|
110
|
+
children: s ? /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
113
111
|
/* @__PURE__ */ e.jsxs("span", { className: "pr-8 text-sm", children: [
|
|
114
|
-
h && /* @__PURE__ */ e.jsx("span", { className: "mr-2 rounded-full bg-purple-100 px-2 py-0.5 text-[10px] text-purple-500", children:
|
|
115
|
-
|
|
112
|
+
h && /* @__PURE__ */ e.jsx("span", { className: "mr-2 rounded-full bg-purple-100 px-2 py-0.5 text-[10px] text-purple-500", children: E(n) }),
|
|
113
|
+
s
|
|
116
114
|
] }),
|
|
117
115
|
/* @__PURE__ */ e.jsx("span", { className: "cursor-pointer text-[9px] text-blue-400 underline hover:text-blue-700", children: "Change" })
|
|
118
116
|
] }) : /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
119
117
|
"+ Set ",
|
|
120
|
-
|
|
118
|
+
E(le(r))
|
|
121
119
|
] })
|
|
122
120
|
}
|
|
123
121
|
) }),
|
|
124
|
-
/* @__PURE__ */ e.jsx(
|
|
125
|
-
/* @__PURE__ */ e.jsx(
|
|
126
|
-
/* @__PURE__ */ e.jsxs(
|
|
127
|
-
/* @__PURE__ */ e.jsx(
|
|
128
|
-
/* @__PURE__ */ e.jsx(
|
|
129
|
-
|
|
122
|
+
/* @__PURE__ */ e.jsx(Qt, { className: "z-[999] min-w-[300px] p-0", side: "right", align: "start", children: /* @__PURE__ */ e.jsxs(er, { children: [
|
|
123
|
+
/* @__PURE__ */ e.jsx(tr, { placeholder: `Choose ${le(r)}...` }),
|
|
124
|
+
/* @__PURE__ */ e.jsxs(rr, { children: [
|
|
125
|
+
/* @__PURE__ */ e.jsx(sr, { children: "No results found." }),
|
|
126
|
+
/* @__PURE__ */ e.jsx(lr, { children: k(y, (u) => /* @__PURE__ */ e.jsxs(
|
|
127
|
+
or,
|
|
130
128
|
{
|
|
131
129
|
value: u,
|
|
132
130
|
className: `cursor-pointer ${h ? "flex items-center justify-between" : "flex flex-col items-start justify-start"}`,
|
|
133
|
-
onSelect: (
|
|
134
|
-
|
|
131
|
+
onSelect: (f) => {
|
|
132
|
+
t(jt(y, (j) => j === f) || null), g(!1);
|
|
135
133
|
},
|
|
136
134
|
children: [
|
|
137
135
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-x-2", children: [
|
|
138
|
-
/* @__PURE__ */ e.jsx(
|
|
136
|
+
/* @__PURE__ */ e.jsx(Pr, { className: `h-4 w-4 text-green-500 ${s === u ? "" : "opacity-0"}` }),
|
|
139
137
|
u
|
|
140
138
|
] }),
|
|
141
|
-
h ? /* @__PURE__ */ e.jsx("div", { children: /* @__PURE__ */ e.jsx("span", { className: "rounded-full bg-purple-100 px-2 py-0.5 text-[10px] text-purple-500", children:
|
|
139
|
+
h ? /* @__PURE__ */ e.jsx("div", { children: /* @__PURE__ */ e.jsx("span", { className: "rounded-full bg-purple-100 px-2 py-0.5 text-[10px] text-purple-500", children: E(x(i, u, "")) }) }) : /* @__PURE__ */ e.jsx("div", { className: "pl-6", children: /* @__PURE__ */ e.jsx(Te, { data: x(d, u) }) })
|
|
142
140
|
]
|
|
143
141
|
},
|
|
144
142
|
u
|
|
@@ -147,357 +145,357 @@ const ke = ({ data: t, fullView: o }) => {
|
|
|
147
145
|
] }) })
|
|
148
146
|
] })
|
|
149
147
|
] }),
|
|
150
|
-
!h && !
|
|
148
|
+
!h && !b(s) && /* @__PURE__ */ e.jsx("div", { className: "pt-2", children: /* @__PURE__ */ e.jsx(Te, { data: x(d, s, ""), fullView: !0 }) })
|
|
151
149
|
] });
|
|
152
|
-
},
|
|
153
|
-
appliedBindings:
|
|
154
|
-
onAddBinding:
|
|
155
|
-
editMode:
|
|
156
|
-
item:
|
|
150
|
+
}, Jr = ({
|
|
151
|
+
appliedBindings: r = [],
|
|
152
|
+
onAddBinding: s,
|
|
153
|
+
editMode: t,
|
|
154
|
+
item: d
|
|
157
155
|
}) => {
|
|
158
|
-
const [l,
|
|
159
|
-
(
|
|
160
|
-
if (
|
|
156
|
+
const [l, n] = w(t ? d.key : ""), [o, p] = w(t ? d.value : ""), i = K(), [c] = ct(), h = V(
|
|
157
|
+
(y, u) => {
|
|
158
|
+
if (b(y))
|
|
161
159
|
return "";
|
|
162
160
|
{
|
|
163
|
-
const
|
|
164
|
-
if (
|
|
161
|
+
const f = x(u === "PROP" ? i : c, y, "");
|
|
162
|
+
if (pe(f))
|
|
165
163
|
return "list";
|
|
166
|
-
const j = typeof
|
|
164
|
+
const j = typeof f;
|
|
167
165
|
return j === "string" ? "text" : j === "object" ? "model" : j;
|
|
168
166
|
}
|
|
169
167
|
},
|
|
170
|
-
[
|
|
171
|
-
), [
|
|
168
|
+
[i, c]
|
|
169
|
+
), [a, g] = w(t ? h(d.key, "PROP") : "");
|
|
172
170
|
return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
173
|
-
/* @__PURE__ */ e.jsxs(
|
|
174
|
-
/* @__PURE__ */ e.jsx(
|
|
175
|
-
/* @__PURE__ */ e.jsx(
|
|
171
|
+
/* @__PURE__ */ e.jsxs(ar, { children: [
|
|
172
|
+
/* @__PURE__ */ e.jsx(nr, { children: "Add Data Binding" }),
|
|
173
|
+
/* @__PURE__ */ e.jsx(ir, { className: "text-xs", children: "Add prop and path of binding. Click save when you're done." })
|
|
176
174
|
] }),
|
|
177
175
|
/* @__PURE__ */ e.jsxs("div", { className: "relative flex flex-col gap-1", children: [
|
|
178
176
|
/* @__PURE__ */ e.jsx(
|
|
179
|
-
|
|
177
|
+
ze,
|
|
180
178
|
{
|
|
181
179
|
type: "PROP",
|
|
182
180
|
isDisabled: !1,
|
|
183
181
|
placeholder: "Enter prop key",
|
|
184
182
|
value: l,
|
|
185
|
-
setValue:
|
|
186
|
-
onChange: (
|
|
187
|
-
const u = h(
|
|
188
|
-
|
|
183
|
+
setValue: n,
|
|
184
|
+
onChange: (y) => {
|
|
185
|
+
const u = h(y, "PROP");
|
|
186
|
+
n(y), a !== u && p(""), g(u);
|
|
189
187
|
},
|
|
190
|
-
data:
|
|
191
|
-
dataType:
|
|
192
|
-
appliedBindings:
|
|
188
|
+
data: i,
|
|
189
|
+
dataType: a,
|
|
190
|
+
appliedBindings: r
|
|
193
191
|
}
|
|
194
192
|
),
|
|
195
193
|
/* @__PURE__ */ e.jsx("div", { className: "h-2" }),
|
|
196
194
|
/* @__PURE__ */ e.jsx(
|
|
197
|
-
|
|
195
|
+
ze,
|
|
198
196
|
{
|
|
199
197
|
type: "PATH",
|
|
200
|
-
isDisabled:
|
|
198
|
+
isDisabled: b(l),
|
|
201
199
|
placeholder: "Enter data path",
|
|
202
|
-
value:
|
|
200
|
+
value: o,
|
|
203
201
|
setValue: p,
|
|
204
|
-
onChange: (
|
|
205
|
-
const u = h(
|
|
206
|
-
p(
|
|
202
|
+
onChange: (y) => {
|
|
203
|
+
const u = h(y, "PATH");
|
|
204
|
+
p(a === u ? y : "");
|
|
207
205
|
},
|
|
208
|
-
data:
|
|
209
|
-
dataType:
|
|
210
|
-
appliedBindings:
|
|
206
|
+
data: c,
|
|
207
|
+
dataType: a,
|
|
208
|
+
appliedBindings: r
|
|
211
209
|
}
|
|
212
210
|
)
|
|
213
211
|
] }),
|
|
214
|
-
/* @__PURE__ */ e.jsx(
|
|
215
|
-
|
|
212
|
+
/* @__PURE__ */ e.jsx(dr, { children: /* @__PURE__ */ e.jsx(
|
|
213
|
+
U,
|
|
216
214
|
{
|
|
217
215
|
type: "submit",
|
|
218
216
|
className: "mt-4",
|
|
219
|
-
disabled:
|
|
220
|
-
onClick: () =>
|
|
217
|
+
disabled: b(l) && b(o),
|
|
218
|
+
onClick: () => s({ key: l, value: o }),
|
|
221
219
|
children: "Save"
|
|
222
220
|
}
|
|
223
221
|
) })
|
|
224
222
|
] });
|
|
225
|
-
},
|
|
226
|
-
const [
|
|
227
|
-
return /* @__PURE__ */ e.jsxs(
|
|
228
|
-
/* @__PURE__ */ e.jsx(
|
|
229
|
-
|
|
230
|
-
|
|
223
|
+
}, pt = ({ disabled: r, children: s, onAddBinding: t, appliedBindings: d, editMode: l = !0, item: n = {} }) => {
|
|
224
|
+
const [o, p] = w(!1);
|
|
225
|
+
return /* @__PURE__ */ e.jsxs(cr, { children: [
|
|
226
|
+
/* @__PURE__ */ e.jsx(pr, { disabled: r, asChild: !0, onClick: () => p(!0), children: s }),
|
|
227
|
+
o && /* @__PURE__ */ e.jsx(ur, { children: /* @__PURE__ */ e.jsx(
|
|
228
|
+
Jr,
|
|
231
229
|
{
|
|
232
|
-
item:
|
|
230
|
+
item: n,
|
|
233
231
|
editMode: l,
|
|
234
|
-
appliedBindings:
|
|
235
|
-
onAddBinding: (
|
|
236
|
-
|
|
232
|
+
appliedBindings: d,
|
|
233
|
+
onAddBinding: (i) => {
|
|
234
|
+
t(i), p(!1);
|
|
237
235
|
}
|
|
238
236
|
}
|
|
239
237
|
) })
|
|
240
238
|
] });
|
|
241
|
-
},
|
|
242
|
-
item:
|
|
243
|
-
onAddBinding:
|
|
244
|
-
onRemove:
|
|
245
|
-
selectedBlock:
|
|
239
|
+
}, Qr = ({
|
|
240
|
+
item: r,
|
|
241
|
+
onAddBinding: s,
|
|
242
|
+
onRemove: t,
|
|
243
|
+
selectedBlock: d,
|
|
246
244
|
dataProvider: l,
|
|
247
|
-
appliedBindings:
|
|
245
|
+
appliedBindings: n
|
|
248
246
|
}) => {
|
|
249
|
-
const [
|
|
250
|
-
if (
|
|
247
|
+
const [o, p] = w("string"), i = (c, h) => {
|
|
248
|
+
if (b(c))
|
|
251
249
|
return "";
|
|
252
250
|
{
|
|
253
|
-
const
|
|
254
|
-
if (
|
|
251
|
+
const a = x(h === "PROP" ? d : l, c, "");
|
|
252
|
+
if (pe(a))
|
|
255
253
|
return "list";
|
|
256
|
-
const
|
|
257
|
-
return
|
|
254
|
+
const g = typeof a;
|
|
255
|
+
return g === "string" ? "text" : g === "object" ? "model" : g;
|
|
258
256
|
}
|
|
259
257
|
};
|
|
260
|
-
return
|
|
261
|
-
/* @__PURE__ */ e.jsx("div", { className: "text-sm font-normal text-gray-500", children:
|
|
262
|
-
/* @__PURE__ */ e.jsx("div", { className: "font-medium leading-5", children:
|
|
263
|
-
/* @__PURE__ */ e.jsx(
|
|
258
|
+
return L(() => p(() => i(r.key, "PROP")), [r.key]), /* @__PURE__ */ e.jsxs("div", { className: "relative flex flex-col rounded-md border border-gray-200 p-2", children: [
|
|
259
|
+
/* @__PURE__ */ e.jsx("div", { className: "text-sm font-normal text-gray-500", children: r.key }),
|
|
260
|
+
/* @__PURE__ */ e.jsx("div", { className: "font-medium leading-5", children: r.value }),
|
|
261
|
+
/* @__PURE__ */ e.jsx(Te, { data: x(l, r.value, "") }),
|
|
264
262
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center justify-end gap-x-2", children: [
|
|
265
|
-
/* @__PURE__ */ e.jsx(
|
|
263
|
+
/* @__PURE__ */ e.jsx(pt, { editMode: !0, onAddBinding: s, appliedBindings: n, item: r, children: /* @__PURE__ */ e.jsx(Ir, { 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" }) }),
|
|
266
264
|
/* @__PURE__ */ e.jsx(
|
|
267
|
-
|
|
265
|
+
$r,
|
|
268
266
|
{
|
|
269
|
-
onClick: () =>
|
|
267
|
+
onClick: () => t(),
|
|
270
268
|
className: "mt-1 h-6 w-6 cursor-pointer rounded border border-red-400 p-1 text-red-400 duration-200 hover:scale-105 hover:bg-red-400 hover:text-white"
|
|
271
269
|
}
|
|
272
270
|
)
|
|
273
271
|
] }),
|
|
274
|
-
!
|
|
272
|
+
!b(o) && !b(r.key) && /* @__PURE__ */ e.jsx("div", { className: "absolute right-0 top-1 mt-px flex h-4 items-center rounded-full px-2 text-[10px] font-medium text-purple-600", children: E(o) })
|
|
275
273
|
] });
|
|
276
|
-
},
|
|
277
|
-
const
|
|
278
|
-
k(
|
|
274
|
+
}, es = ({ bindingData: r, onChange: s }) => {
|
|
275
|
+
const t = K(), [d] = ct(), l = Er(), [n, o] = w(
|
|
276
|
+
k(r, (a, g) => ({ key: g, value: a }))
|
|
279
277
|
);
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
}, [
|
|
278
|
+
L(() => {
|
|
279
|
+
o(k(r, (a, g) => ({ key: g, value: a })));
|
|
280
|
+
}, [t == null ? void 0 : t._id, r]);
|
|
283
281
|
const p = _(() => {
|
|
284
|
-
if (
|
|
282
|
+
if (b(d))
|
|
285
283
|
return !0;
|
|
286
|
-
if (
|
|
284
|
+
if (b(n))
|
|
287
285
|
return !1;
|
|
288
|
-
const
|
|
289
|
-
return
|
|
290
|
-
}, [
|
|
291
|
-
const
|
|
292
|
-
|
|
293
|
-
},
|
|
294
|
-
const
|
|
295
|
-
h([...
|
|
286
|
+
const a = wt(n);
|
|
287
|
+
return b(a == null ? void 0 : a.key) || b(a == null ? void 0 : a.value);
|
|
288
|
+
}, [d, n]), i = (a) => {
|
|
289
|
+
const g = ve(n, (y) => y.key !== a.key);
|
|
290
|
+
o([...g, a]), h([...g, a]);
|
|
291
|
+
}, c = (a) => {
|
|
292
|
+
const g = ve(n, (y, u) => a !== u);
|
|
293
|
+
h([...g]);
|
|
296
294
|
}, h = V(
|
|
297
|
-
(
|
|
298
|
-
if (a
|
|
299
|
-
|
|
295
|
+
(a = []) => {
|
|
296
|
+
if (o(a), b(a)) {
|
|
297
|
+
s({});
|
|
300
298
|
return;
|
|
301
299
|
}
|
|
302
|
-
const
|
|
303
|
-
|
|
304
|
-
!
|
|
305
|
-
}),
|
|
300
|
+
const g = {};
|
|
301
|
+
Re(a, (y) => {
|
|
302
|
+
!b(y == null ? void 0 : y.key) && !b(y == null ? void 0 : y.value) && Ge(g, y.key, y.value);
|
|
303
|
+
}), s(g);
|
|
306
304
|
},
|
|
307
|
-
[
|
|
305
|
+
[s]
|
|
308
306
|
);
|
|
309
|
-
return
|
|
307
|
+
return b(l) ? /* @__PURE__ */ e.jsx("div", { className: "flex w-full items-center justify-center", children: /* @__PURE__ */ e.jsxs("p", { className: "mb-1.5 text-xs text-gray-500", children: [
|
|
310
308
|
"You have no data providers registered. Please add a data provider to your project. ",
|
|
311
309
|
/* @__PURE__ */ e.jsx("br", {}),
|
|
312
310
|
/* @__PURE__ */ e.jsx("a", { className: "text-blue-500", href: "https://chaibuilder.com/docs/registering-data-providers", target: "_blank", children: "Learn more" })
|
|
313
311
|
] }) }) : /* @__PURE__ */ e.jsxs("div", { className: "space-y-2", children: [
|
|
314
|
-
k(
|
|
315
|
-
|
|
312
|
+
k(n, (a, g) => /* @__PURE__ */ e.jsx(
|
|
313
|
+
Qr,
|
|
316
314
|
{
|
|
317
|
-
item:
|
|
318
|
-
onAddBinding:
|
|
319
|
-
onRemove: () =>
|
|
320
|
-
selectedBlock:
|
|
321
|
-
dataProvider:
|
|
322
|
-
appliedBindings: k(
|
|
315
|
+
item: a,
|
|
316
|
+
onAddBinding: i,
|
|
317
|
+
onRemove: () => c(g),
|
|
318
|
+
selectedBlock: t,
|
|
319
|
+
dataProvider: d,
|
|
320
|
+
appliedBindings: k(n, "key")
|
|
323
321
|
},
|
|
324
|
-
|
|
322
|
+
a.key
|
|
325
323
|
)),
|
|
326
|
-
/* @__PURE__ */ e.jsxs(
|
|
327
|
-
/* @__PURE__ */ e.jsx(
|
|
328
|
-
|
|
324
|
+
/* @__PURE__ */ e.jsxs(O, { delayDuration: 200, children: [
|
|
325
|
+
/* @__PURE__ */ e.jsx(F, { disabled: b(d), className: "w-full", children: /* @__PURE__ */ e.jsx(
|
|
326
|
+
pt,
|
|
329
327
|
{
|
|
330
328
|
disabled: p,
|
|
331
|
-
appliedBindings: k(
|
|
332
|
-
onAddBinding:
|
|
329
|
+
appliedBindings: k(n, "key"),
|
|
330
|
+
onAddBinding: i,
|
|
333
331
|
children: /* @__PURE__ */ e.jsx(
|
|
334
332
|
"span",
|
|
335
333
|
{
|
|
336
334
|
className: `w-full rounded-md px-5 py-1.5 text-xs font-medium duration-200 ${p ? "cursor-not-allowed bg-gray-200 text-gray-400" : "bg-blue-700/20 text-blue-800 hover:bg-blue-700/30"}`,
|
|
337
|
-
children:
|
|
335
|
+
children: b(d) ? /* @__PURE__ */ e.jsx("small", { className: "text-[9.5px] text-gray-500", children: "No data provider has been set up for this page" }) : "+ Add Data Binding"
|
|
338
336
|
}
|
|
339
337
|
)
|
|
340
338
|
}
|
|
341
339
|
) }),
|
|
342
|
-
p && /* @__PURE__ */ e.jsx(
|
|
340
|
+
p && /* @__PURE__ */ e.jsx(Y, { sideOffset: -55, className: "text-[11px]", children: b(d) ? "No data provider has been set up for this page." : "Complete last added data binding to add more" })
|
|
343
341
|
] })
|
|
344
342
|
] });
|
|
345
|
-
},
|
|
346
|
-
const [l,
|
|
347
|
-
return Object.keys(
|
|
348
|
-
const
|
|
349
|
-
if (M(["slot", "styles"],
|
|
343
|
+
}, ts = () => /* @__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" }), me = mt(({ id: r, properties: s, formData: t, onChange: d }) => {
|
|
344
|
+
const [l, n] = w(t), o = { type: "object", properties: {} }, p = {};
|
|
345
|
+
return Object.keys(s).forEach((i) => {
|
|
346
|
+
const c = s[i];
|
|
347
|
+
if (M(["slot", "styles"], c.type))
|
|
350
348
|
return;
|
|
351
|
-
const h =
|
|
352
|
-
|
|
353
|
-
}),
|
|
354
|
-
|
|
355
|
-
}, [
|
|
356
|
-
|
|
349
|
+
const h = i;
|
|
350
|
+
o.properties[h] = xr(c), p[h] = gr(c);
|
|
351
|
+
}), L(() => {
|
|
352
|
+
n(t);
|
|
353
|
+
}, [r]), /* @__PURE__ */ e.jsx(
|
|
354
|
+
zr,
|
|
357
355
|
{
|
|
358
356
|
widgets: {
|
|
359
|
-
binding:
|
|
360
|
-
richtext:
|
|
361
|
-
icon:
|
|
362
|
-
image:
|
|
357
|
+
binding: ts,
|
|
358
|
+
richtext: hr,
|
|
359
|
+
icon: yr,
|
|
360
|
+
image: mr
|
|
363
361
|
},
|
|
364
|
-
fields: { link:
|
|
362
|
+
fields: { link: br },
|
|
365
363
|
idSeparator: ".",
|
|
366
364
|
autoComplete: "off",
|
|
367
365
|
omitExtraData: !1,
|
|
368
366
|
liveOmit: !1,
|
|
369
367
|
liveValidate: !1,
|
|
370
|
-
validator:
|
|
368
|
+
validator: Xr,
|
|
371
369
|
uiSchema: p,
|
|
372
|
-
schema:
|
|
370
|
+
schema: o,
|
|
373
371
|
formData: l,
|
|
374
|
-
onChange: ({ formData:
|
|
375
|
-
|
|
372
|
+
onChange: ({ formData: i }, c) => {
|
|
373
|
+
c && (n(i), d({ formData: i }, c));
|
|
376
374
|
}
|
|
377
375
|
}
|
|
378
376
|
);
|
|
379
377
|
});
|
|
380
|
-
function
|
|
381
|
-
const
|
|
382
|
-
if (
|
|
383
|
-
const
|
|
384
|
-
|
|
378
|
+
function rs() {
|
|
379
|
+
const r = K(), s = rt(), t = st(), d = Pe(r._type), l = { ...r }, [n, o] = w(l), p = fr("dataBindingSupport", !1), i = ({ formData: u }, f, j) => {
|
|
380
|
+
if (f && (n == null ? void 0 : n._id) === r._id) {
|
|
381
|
+
const B = f.replace("root.", "");
|
|
382
|
+
t([r._id], { [B]: x(u, B) }, j);
|
|
385
383
|
}
|
|
386
|
-
},
|
|
387
|
-
|
|
388
|
-
|
|
384
|
+
}, c = V(
|
|
385
|
+
Ct(({ formData: u }, f, j) => {
|
|
386
|
+
i({ formData: u }, f, j), o(u);
|
|
389
387
|
}, 1500),
|
|
390
|
-
[
|
|
391
|
-
), h = ({ formData: u },
|
|
392
|
-
if (
|
|
393
|
-
const j =
|
|
394
|
-
|
|
388
|
+
[r == null ? void 0 : r._id]
|
|
389
|
+
), h = ({ formData: u }, f) => {
|
|
390
|
+
if (f) {
|
|
391
|
+
const j = f.replace("root.", "");
|
|
392
|
+
s([r._id], { [j]: x(u, j) }), c({ formData: u }, f, { [j]: x(n, j) });
|
|
395
393
|
}
|
|
396
|
-
},
|
|
397
|
-
_name:
|
|
394
|
+
}, a = {
|
|
395
|
+
_name: Br({
|
|
398
396
|
title: "Name",
|
|
399
|
-
default: x(
|
|
397
|
+
default: x(r, "_name", r._type)
|
|
400
398
|
})
|
|
401
|
-
},
|
|
402
|
-
const u =
|
|
403
|
-
return p &&
|
|
404
|
-
}, [
|
|
399
|
+
}, g = je(x(l, "_bindings", {})), y = _(() => {
|
|
400
|
+
const u = kt(x(d, "props", {}));
|
|
401
|
+
return p && Nt(g, (f) => delete u[f]), u;
|
|
402
|
+
}, [d, g, p]);
|
|
405
403
|
return /* @__PURE__ */ e.jsxs("div", { className: "overflow-x-hidden", children: [
|
|
406
|
-
/* @__PURE__ */ e.jsx(
|
|
404
|
+
/* @__PURE__ */ e.jsx(me, { id: r == null ? void 0 : r._id, onChange: h, formData: l, properties: a }),
|
|
407
405
|
/* @__PURE__ */ e.jsx("hr", { className: "mt-4" }),
|
|
408
|
-
p ? /* @__PURE__ */ e.jsxs(
|
|
409
|
-
/* @__PURE__ */ e.jsxs(
|
|
410
|
-
/* @__PURE__ */ e.jsx(
|
|
406
|
+
p ? /* @__PURE__ */ e.jsxs(lt, { type: "multiple", defaultValue: ["STATIC", "BINDING"], className: "h-full w-full", children: [
|
|
407
|
+
/* @__PURE__ */ e.jsxs(Ce, { value: "BINDING", children: [
|
|
408
|
+
/* @__PURE__ */ e.jsx(ke, { className: "bg-gray-100 px-3 py-2 text-xs hover:no-underline", children: /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-x-2", children: [
|
|
411
409
|
/* @__PURE__ */ e.jsx(
|
|
412
410
|
"div",
|
|
413
411
|
{
|
|
414
|
-
className: `h-[8px] w-[8px] rounded-full ${
|
|
412
|
+
className: `h-[8px] w-[8px] rounded-full ${b(x(r, "_bindings", {})) ? "bg-gray-300" : "bg-blue-500"}`
|
|
415
413
|
}
|
|
416
414
|
),
|
|
417
415
|
"Data Binding"
|
|
418
416
|
] }) }),
|
|
419
|
-
/* @__PURE__ */ e.jsx(
|
|
420
|
-
|
|
417
|
+
/* @__PURE__ */ e.jsx(Ne, { className: "px-4 pt-4", children: /* @__PURE__ */ e.jsx(
|
|
418
|
+
es,
|
|
421
419
|
{
|
|
422
|
-
bindingData: x(
|
|
420
|
+
bindingData: x(r, "_bindings", {}),
|
|
423
421
|
onChange: (u) => {
|
|
424
|
-
|
|
422
|
+
i({ formData: { _bindings: u } }, "root._bindings");
|
|
425
423
|
}
|
|
426
424
|
}
|
|
427
425
|
) })
|
|
428
426
|
] }),
|
|
429
|
-
/* @__PURE__ */ e.jsxs(
|
|
430
|
-
/* @__PURE__ */ e.jsx(
|
|
427
|
+
/* @__PURE__ */ e.jsxs(Ce, { value: "STATIC", children: [
|
|
428
|
+
/* @__PURE__ */ e.jsx(ke, { className: "bg-gray-100 px-3 py-2 text-xs hover:no-underline", children: /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-x-2", children: [
|
|
431
429
|
/* @__PURE__ */ e.jsx("div", { className: "h-[8px] w-[8px] rounded-full bg-blue-500" }),
|
|
432
430
|
"Static Content"
|
|
433
431
|
] }) }),
|
|
434
|
-
/* @__PURE__ */ e.jsxs(
|
|
435
|
-
|
|
432
|
+
/* @__PURE__ */ e.jsxs(Ne, { className: "pt-4", children: [
|
|
433
|
+
b(g) ? 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: [
|
|
436
434
|
"Data binding is set for ",
|
|
437
|
-
/* @__PURE__ */ e.jsx("b", { children: k(
|
|
435
|
+
/* @__PURE__ */ e.jsx("b", { children: k(g, we).join(", ") }),
|
|
438
436
|
" ",
|
|
439
|
-
|
|
437
|
+
g.length === 1 ? "property" : "properties",
|
|
440
438
|
". Remove data binding to edit static content."
|
|
441
439
|
] }),
|
|
442
440
|
/* @__PURE__ */ e.jsx(
|
|
443
|
-
|
|
441
|
+
me,
|
|
444
442
|
{
|
|
445
|
-
id:
|
|
443
|
+
id: r == null ? void 0 : r._id,
|
|
446
444
|
onChange: h,
|
|
447
445
|
formData: l,
|
|
448
|
-
properties:
|
|
446
|
+
properties: y
|
|
449
447
|
}
|
|
450
448
|
)
|
|
451
449
|
] })
|
|
452
450
|
] })
|
|
453
451
|
] }) : /* @__PURE__ */ e.jsx(
|
|
454
|
-
|
|
452
|
+
me,
|
|
455
453
|
{
|
|
456
|
-
id:
|
|
454
|
+
id: r == null ? void 0 : r._id,
|
|
457
455
|
onChange: h,
|
|
458
456
|
formData: l,
|
|
459
|
-
properties:
|
|
457
|
+
properties: y
|
|
460
458
|
}
|
|
461
459
|
),
|
|
462
460
|
/* @__PURE__ */ e.jsx("div", { className: "pb-60" })
|
|
463
461
|
] });
|
|
464
462
|
}
|
|
465
|
-
const
|
|
463
|
+
const Xe = new Wr(Ur, {
|
|
466
464
|
isCaseSensitive: !1,
|
|
467
465
|
threshold: 0.2,
|
|
468
466
|
minMatchCharLength: 2,
|
|
469
467
|
keys: ["name"]
|
|
470
468
|
});
|
|
471
|
-
function
|
|
472
|
-
var
|
|
473
|
-
const [
|
|
474
|
-
const
|
|
475
|
-
|
|
476
|
-
}, [h,
|
|
477
|
-
const
|
|
469
|
+
function ss() {
|
|
470
|
+
var B;
|
|
471
|
+
const [r] = ue(), s = K(), t = De(), d = ot(), [l] = at(), [n, o] = w(""), p = (B = ae(r)) == null ? void 0 : B.prop, i = _t((x(s, p, "").replace(Gr, "").split(",").pop() || "").split(" "), b), c = () => {
|
|
472
|
+
const C = n.trim().toLowerCase().replace(/ +(?= )/g, "").split(" ");
|
|
473
|
+
t(l, C, !0), o("");
|
|
474
|
+
}, [h, a] = w([]), g = ({ value: C }) => {
|
|
475
|
+
const I = C.trim().toLowerCase(), X = I.match(/.+:/g);
|
|
478
476
|
let N = [];
|
|
479
|
-
if (
|
|
480
|
-
const [
|
|
481
|
-
N =
|
|
477
|
+
if (X && X.length > 0) {
|
|
478
|
+
const [P] = X, W = I.replace(P, "");
|
|
479
|
+
N = Xe.search(W).map((m) => ({
|
|
482
480
|
...m,
|
|
483
|
-
item: { ...m.item, name:
|
|
481
|
+
item: { ...m.item, name: P + m.item.name }
|
|
484
482
|
}));
|
|
485
483
|
} else
|
|
486
|
-
N =
|
|
487
|
-
|
|
488
|
-
},
|
|
489
|
-
|
|
490
|
-
}, u = (
|
|
484
|
+
N = Xe.search(I);
|
|
485
|
+
a(k(N, "item"));
|
|
486
|
+
}, y = () => {
|
|
487
|
+
a([]);
|
|
488
|
+
}, u = (C) => C.name, f = (C) => /* @__PURE__ */ e.jsx("div", { className: "rounded-md p-1", children: C.name }), j = {
|
|
491
489
|
autoComplete: "off",
|
|
492
490
|
autoCorrect: "off",
|
|
493
491
|
autoCapitalize: "off",
|
|
494
492
|
spellCheck: !1,
|
|
495
493
|
placeholder: "Enter class name",
|
|
496
|
-
value:
|
|
497
|
-
onKeyDown: (
|
|
498
|
-
|
|
494
|
+
value: n,
|
|
495
|
+
onKeyDown: (C) => {
|
|
496
|
+
C.key === "Enter" && n.trim() !== "" && c();
|
|
499
497
|
},
|
|
500
|
-
onChange: (
|
|
498
|
+
onChange: (C, { newValue: I }) => o(I),
|
|
501
499
|
className: "w-full rounded-md text-xs px-2 hover:outline-0 bg-background border-border py-1"
|
|
502
500
|
};
|
|
503
501
|
return /* @__PURE__ */ e.jsxs(
|
|
@@ -505,16 +503,16 @@ function cs() {
|
|
|
505
503
|
{
|
|
506
504
|
className: `no-scrollbar flex ${h.length > 0 ? "min-h-[300px]" : "min-h-max"} w-full flex-col gap-y-5 overflow-y-auto bg-gray-100 px-px`,
|
|
507
505
|
children: [
|
|
508
|
-
/* @__PURE__ */ e.jsx(
|
|
506
|
+
/* @__PURE__ */ e.jsx(nt, { className: "mt-2", children: "Add Tailwind classes" }),
|
|
509
507
|
/* @__PURE__ */ e.jsxs("div", { className: "relative -mt-4 flex items-center gap-x-3", children: [
|
|
510
508
|
/* @__PURE__ */ e.jsx("div", { className: "relative flex w-full items-center gap-x-3", children: /* @__PURE__ */ e.jsx(
|
|
511
|
-
|
|
509
|
+
Zr,
|
|
512
510
|
{
|
|
513
511
|
suggestions: h,
|
|
514
|
-
onSuggestionsFetchRequested:
|
|
515
|
-
onSuggestionsClearRequested:
|
|
512
|
+
onSuggestionsFetchRequested: g,
|
|
513
|
+
onSuggestionsClearRequested: y,
|
|
516
514
|
getSuggestionValue: u,
|
|
517
|
-
renderSuggestion:
|
|
515
|
+
renderSuggestion: f,
|
|
518
516
|
inputProps: j,
|
|
519
517
|
containerProps: {
|
|
520
518
|
className: "relative h-8 w-full gap-y-1 py-1 border-gray-600"
|
|
@@ -527,36 +525,36 @@ function cs() {
|
|
|
527
525
|
}
|
|
528
526
|
) }),
|
|
529
527
|
/* @__PURE__ */ e.jsx(
|
|
530
|
-
|
|
528
|
+
U,
|
|
531
529
|
{
|
|
532
530
|
variant: "outline",
|
|
533
531
|
className: "h-6 border-gray-700",
|
|
534
|
-
onClick:
|
|
535
|
-
disabled:
|
|
532
|
+
onClick: c,
|
|
533
|
+
disabled: n.trim() === "",
|
|
536
534
|
size: "sm",
|
|
537
|
-
children: /* @__PURE__ */ e.jsx(
|
|
535
|
+
children: /* @__PURE__ */ e.jsx(Ve, {})
|
|
538
536
|
}
|
|
539
537
|
)
|
|
540
538
|
] }),
|
|
541
539
|
/* @__PURE__ */ e.jsxs("div", { className: "flex w-full flex-wrap gap-2", children: [
|
|
542
|
-
|
|
540
|
+
b(i) && /* @__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" }),
|
|
543
541
|
de.Children.toArray(
|
|
544
|
-
|
|
542
|
+
i.map((C) => /* @__PURE__ */ e.jsxs(
|
|
545
543
|
"div",
|
|
546
544
|
{
|
|
547
545
|
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",
|
|
548
546
|
children: [
|
|
549
|
-
|
|
547
|
+
C,
|
|
550
548
|
/* @__PURE__ */ e.jsx(
|
|
551
|
-
|
|
549
|
+
Qe,
|
|
552
550
|
{
|
|
553
|
-
onClick: () =>
|
|
551
|
+
onClick: () => d(l, [C]),
|
|
554
552
|
className: "invisible absolute right-1 hover:text-white group-hover:visible group-hover:cursor-pointer"
|
|
555
553
|
}
|
|
556
554
|
)
|
|
557
555
|
]
|
|
558
556
|
},
|
|
559
|
-
|
|
557
|
+
C
|
|
560
558
|
))
|
|
561
559
|
)
|
|
562
560
|
] })
|
|
@@ -564,7 +562,7 @@ function cs() {
|
|
|
564
562
|
}
|
|
565
563
|
);
|
|
566
564
|
}
|
|
567
|
-
const D = ["px", "%", "em", "rem", "ch", "vh", "vw"],
|
|
565
|
+
const D = ["px", "%", "em", "rem", "ch", "vh", "vw"], ls = {
|
|
568
566
|
heading: "flex.heading",
|
|
569
567
|
items: [
|
|
570
568
|
{ type: "arbitrary", label: "flex.basis", units: D, property: "flexBasis" },
|
|
@@ -573,7 +571,7 @@ const D = ["px", "%", "em", "rem", "ch", "vh", "vw"], ps = {
|
|
|
573
571
|
{ type: "dropdown", label: "flex.grow", property: "flexGrow" },
|
|
574
572
|
{ type: "dropdown", label: "flex.shrink", property: "flexShrink" }
|
|
575
573
|
]
|
|
576
|
-
},
|
|
574
|
+
}, os = {
|
|
577
575
|
heading: "grid.heading",
|
|
578
576
|
items: [
|
|
579
577
|
{ type: "range", label: "grid.col_span", property: "gridColSpan" },
|
|
@@ -584,7 +582,7 @@ const D = ["px", "%", "em", "rem", "ch", "vh", "vw"], ps = {
|
|
|
584
582
|
{ type: "range", label: "grid.row_end", property: "gridRowEnd" },
|
|
585
583
|
{ type: "range", label: "grid.order", property: "order" }
|
|
586
584
|
]
|
|
587
|
-
},
|
|
585
|
+
}, as = [
|
|
588
586
|
{
|
|
589
587
|
heading: "layout.heading",
|
|
590
588
|
items: [
|
|
@@ -986,89 +984,89 @@ const D = ["px", "%", "em", "rem", "ch", "vh", "vw"], ps = {
|
|
|
986
984
|
},
|
|
987
985
|
{
|
|
988
986
|
heading: "classes.heading",
|
|
989
|
-
items: [{ component:
|
|
987
|
+
items: [{ component: ss }]
|
|
990
988
|
}
|
|
991
|
-
],
|
|
989
|
+
], ut = {
|
|
992
990
|
"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" }) }),
|
|
993
991
|
// visibility
|
|
994
|
-
visible:
|
|
995
|
-
invisible:
|
|
992
|
+
visible: Dt,
|
|
993
|
+
invisible: Ae,
|
|
996
994
|
// display
|
|
997
|
-
hidden:
|
|
995
|
+
hidden: Ae,
|
|
998
996
|
gap: A,
|
|
999
|
-
gapX:
|
|
997
|
+
gapX: S,
|
|
1000
998
|
gapY: R,
|
|
1001
|
-
spaceX:
|
|
999
|
+
spaceX: S,
|
|
1002
1000
|
spaceY: R,
|
|
1003
1001
|
overscroll: A,
|
|
1004
|
-
overscrollX:
|
|
1002
|
+
overscrollX: S,
|
|
1005
1003
|
overscrollY: R,
|
|
1006
1004
|
overflow: A,
|
|
1007
|
-
overflowX:
|
|
1005
|
+
overflowX: S,
|
|
1008
1006
|
overflowY: R,
|
|
1009
|
-
top:
|
|
1010
|
-
right:
|
|
1011
|
-
bottom:
|
|
1012
|
-
left:
|
|
1007
|
+
top: ee,
|
|
1008
|
+
right: te,
|
|
1009
|
+
bottom: re,
|
|
1010
|
+
left: se,
|
|
1013
1011
|
inset: A,
|
|
1014
|
-
insetX:
|
|
1012
|
+
insetX: S,
|
|
1015
1013
|
insetY: R,
|
|
1016
1014
|
border: A,
|
|
1017
|
-
borderX:
|
|
1015
|
+
borderX: S,
|
|
1018
1016
|
borderY: R,
|
|
1019
|
-
borderTop:
|
|
1020
|
-
borderRight:
|
|
1021
|
-
borderBottom:
|
|
1022
|
-
borderLeft:
|
|
1017
|
+
borderTop: ee,
|
|
1018
|
+
borderRight: te,
|
|
1019
|
+
borderBottom: re,
|
|
1020
|
+
borderLeft: se,
|
|
1023
1021
|
borderRadius: A,
|
|
1024
|
-
borderRadiusX:
|
|
1022
|
+
borderRadiusX: S,
|
|
1025
1023
|
borderRadiusY: R,
|
|
1026
|
-
borderRadiusTop:
|
|
1027
|
-
borderRadiusRight:
|
|
1028
|
-
borderRadiusBottom:
|
|
1029
|
-
borderRadiusLeft:
|
|
1030
|
-
borderRadiusTopLeft:
|
|
1031
|
-
borderRadiusTopRight:
|
|
1032
|
-
borderRadiusBottomRight:
|
|
1033
|
-
borderRadiusBottomLeft:
|
|
1034
|
-
divideXWidth:
|
|
1024
|
+
borderRadiusTop: ee,
|
|
1025
|
+
borderRadiusRight: te,
|
|
1026
|
+
borderRadiusBottom: re,
|
|
1027
|
+
borderRadiusLeft: se,
|
|
1028
|
+
borderRadiusTopLeft: Bt,
|
|
1029
|
+
borderRadiusTopRight: Pt,
|
|
1030
|
+
borderRadiusBottomRight: It,
|
|
1031
|
+
borderRadiusBottomLeft: $t,
|
|
1032
|
+
divideXWidth: S,
|
|
1035
1033
|
divideYWidth: R,
|
|
1036
1034
|
scale: A,
|
|
1037
|
-
scaleX:
|
|
1035
|
+
scaleX: S,
|
|
1038
1036
|
scaleY: R,
|
|
1039
|
-
skewX:
|
|
1037
|
+
skewX: S,
|
|
1040
1038
|
skewY: R,
|
|
1041
|
-
translateX:
|
|
1039
|
+
translateX: S,
|
|
1042
1040
|
translateY: R,
|
|
1043
1041
|
// padding
|
|
1044
1042
|
padding: A,
|
|
1045
|
-
paddingX:
|
|
1043
|
+
paddingX: S,
|
|
1046
1044
|
paddingY: R,
|
|
1047
|
-
paddingTop:
|
|
1048
|
-
paddingRight:
|
|
1049
|
-
paddingBottom:
|
|
1050
|
-
paddingLeft:
|
|
1045
|
+
paddingTop: ee,
|
|
1046
|
+
paddingRight: te,
|
|
1047
|
+
paddingBottom: re,
|
|
1048
|
+
paddingLeft: se,
|
|
1051
1049
|
// margin
|
|
1052
1050
|
margin: A,
|
|
1053
|
-
marginX:
|
|
1051
|
+
marginX: S,
|
|
1054
1052
|
marginY: R,
|
|
1055
|
-
marginTop:
|
|
1056
|
-
marginRight:
|
|
1057
|
-
marginBottom:
|
|
1058
|
-
marginLeft:
|
|
1053
|
+
marginTop: ee,
|
|
1054
|
+
marginRight: te,
|
|
1055
|
+
marginBottom: re,
|
|
1056
|
+
marginLeft: se,
|
|
1059
1057
|
// text-align
|
|
1060
|
-
textLeft:
|
|
1061
|
-
textCenter:
|
|
1062
|
-
textRight:
|
|
1063
|
-
textJustify:
|
|
1058
|
+
textLeft: At,
|
|
1059
|
+
textCenter: Mt,
|
|
1060
|
+
textRight: Et,
|
|
1061
|
+
textJustify: Lt,
|
|
1064
1062
|
// font style
|
|
1065
|
-
italic:
|
|
1063
|
+
italic: Ot,
|
|
1066
1064
|
// "not-italic": "",
|
|
1067
1065
|
// decoration
|
|
1068
|
-
underline:
|
|
1069
|
-
overline:
|
|
1066
|
+
underline: Ft,
|
|
1067
|
+
overline: Yt,
|
|
1070
1068
|
// transform
|
|
1071
|
-
uppercase:
|
|
1069
|
+
uppercase: zt,
|
|
1072
1070
|
block: () => /* @__PURE__ */ e.jsxs("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [
|
|
1073
1071
|
/* @__PURE__ */ e.jsx(
|
|
1074
1072
|
"path",
|
|
@@ -1109,7 +1107,7 @@ const D = ["px", "%", "em", "rem", "ch", "vh", "vw"], ps = {
|
|
|
1109
1107
|
}
|
|
1110
1108
|
)
|
|
1111
1109
|
] }),
|
|
1112
|
-
"float-none":
|
|
1110
|
+
"float-none": Qe,
|
|
1113
1111
|
// position
|
|
1114
1112
|
fixed: () => /* @__PURE__ */ e.jsxs("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [
|
|
1115
1113
|
/* @__PURE__ */ e.jsx(
|
|
@@ -1181,101 +1179,101 @@ const D = ["px", "%", "em", "rem", "ch", "vh", "vw"], ps = {
|
|
|
1181
1179
|
}
|
|
1182
1180
|
)
|
|
1183
1181
|
] }),
|
|
1184
|
-
static:
|
|
1185
|
-
},
|
|
1182
|
+
static: Xt
|
|
1183
|
+
}, ne = Ke({ canReset: !1, canChange: !0 }), ns = ({ children: r, canReset: s = !1, canChange: t = !0 }) => (
|
|
1186
1184
|
// eslint-disable-next-line react/jsx-no-constructed-context-values
|
|
1187
|
-
/* @__PURE__ */ e.jsx(
|
|
1188
|
-
),
|
|
1189
|
-
const
|
|
1190
|
-
return /* @__PURE__ */ e.jsx("div", { className:
|
|
1191
|
-
/* @__PURE__ */ e.jsx(
|
|
1192
|
-
/* @__PURE__ */ e.jsxs(
|
|
1193
|
-
/* @__PURE__ */ e.jsx(
|
|
1194
|
-
/* @__PURE__ */ e.jsx(
|
|
1185
|
+
/* @__PURE__ */ e.jsx(ne.Provider, { value: { canReset: s, canChange: t }, children: r })
|
|
1186
|
+
), xt = ({ label: r, property: s, onChange: t }) => {
|
|
1187
|
+
const d = _(() => x(ge, `${s}.classes`, [""]), [s]), l = ie(s), n = _(() => x(l, "cls", ""), [l]), { canChange: o } = oe(ne), p = /\[.*\]/g.test(n);
|
|
1188
|
+
return /* @__PURE__ */ e.jsx("div", { className: r ? "w-full rounded" : "grow", children: p ? /* @__PURE__ */ e.jsxs("div", { className: "flex items-center", children: [
|
|
1189
|
+
/* @__PURE__ */ e.jsx(_e, { className: "w-[70%] rounded py-1", readOnly: !0, value: n }),
|
|
1190
|
+
/* @__PURE__ */ e.jsxs(O, { delayDuration: 100, children: [
|
|
1191
|
+
/* @__PURE__ */ e.jsx(F, { asChild: !0, children: /* @__PURE__ */ e.jsx("button", { type: "button", className: "invisible ml-3 mt-1 text-blue-600 group-hover:visible", children: /* @__PURE__ */ e.jsx(He, {}) }) }),
|
|
1192
|
+
/* @__PURE__ */ e.jsx(Y, { children: "Current value is using a Tailwind arbitrary value." })
|
|
1195
1193
|
] })
|
|
1196
1194
|
] }) : /* @__PURE__ */ e.jsx(
|
|
1197
|
-
|
|
1195
|
+
Se,
|
|
1198
1196
|
{
|
|
1199
|
-
rounded:
|
|
1200
|
-
onChange: (
|
|
1201
|
-
selected:
|
|
1202
|
-
options:
|
|
1203
|
-
disabled: !
|
|
1197
|
+
rounded: r,
|
|
1198
|
+
onChange: (i) => t(i, s),
|
|
1199
|
+
selected: n,
|
|
1200
|
+
options: d,
|
|
1201
|
+
disabled: !o
|
|
1204
1202
|
}
|
|
1205
1203
|
) });
|
|
1206
1204
|
};
|
|
1207
|
-
function
|
|
1208
|
-
const
|
|
1205
|
+
function Se({ selected: r, onChange: s, rounded: t = !1, options: d, disabled: l = !1 }) {
|
|
1206
|
+
const n = r.replace(/.*:/g, "").trim(), { undo: o, redo: p } = vr();
|
|
1209
1207
|
return /* @__PURE__ */ e.jsxs(
|
|
1210
1208
|
"select",
|
|
1211
1209
|
{
|
|
1212
|
-
disabled: !
|
|
1213
|
-
className: `${
|
|
1214
|
-
onChange: (
|
|
1215
|
-
onKeyDown: (
|
|
1216
|
-
|
|
1210
|
+
disabled: !d.length || l,
|
|
1211
|
+
className: `${t ? "rounded-md border border-border" : "border-0"} disable:bg-gray-500 h-full w-full truncate rounded bg-background px-2 py-1 text-xs outline-none disabled:cursor-not-allowed`,
|
|
1212
|
+
onChange: (i) => s(i.target.value),
|
|
1213
|
+
onKeyDown: (i) => {
|
|
1214
|
+
i.ctrlKey && (i.key === "z" && o(), i.key === "y" && p());
|
|
1217
1215
|
},
|
|
1218
|
-
value:
|
|
1216
|
+
value: n,
|
|
1219
1217
|
children: [
|
|
1220
1218
|
/* @__PURE__ */ e.jsx("option", { className: "bg-transparent", value: "" }),
|
|
1221
|
-
|
|
1222
|
-
|
|
1219
|
+
$.Children.toArray(
|
|
1220
|
+
d.map((i) => /* @__PURE__ */ e.jsx("option", { className: "bg-transparent", value: i, children: i }))
|
|
1223
1221
|
)
|
|
1224
1222
|
]
|
|
1225
1223
|
}
|
|
1226
1224
|
);
|
|
1227
1225
|
}
|
|
1228
|
-
const
|
|
1229
|
-
const { canReset:
|
|
1230
|
-
return /* @__PURE__ */ e.jsx("div", { className: "flex flex-row divide-x divide-solid divide-border rounded border border-border text-xs", children:
|
|
1226
|
+
const is = ({ property: r, onChange: s }) => {
|
|
1227
|
+
const { canReset: t, canChange: d } = oe(ne), l = ie(r), n = _(() => x(l, "cls", ""), [l]), o = _(() => x(ge, `${r}.classes`, [""]), [r]), p = o.indexOf(n) > -1 ? o.indexOf(n) : 0, i = /\[.*\]/g.test(n);
|
|
1228
|
+
return /* @__PURE__ */ e.jsx("div", { className: "flex flex-row divide-x divide-solid divide-border rounded border border-border text-xs", children: i ? /* @__PURE__ */ e.jsx("div", { className: "py-[5px] px-2", children: n }) : /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
1231
1229
|
/* @__PURE__ */ e.jsx(
|
|
1232
1230
|
"button",
|
|
1233
1231
|
{
|
|
1234
1232
|
type: "button",
|
|
1235
1233
|
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",
|
|
1236
|
-
disabled: !
|
|
1237
|
-
onClick: () =>
|
|
1234
|
+
disabled: !d && (!t || p - 1 < 0),
|
|
1235
|
+
onClick: () => s($e(o, p - 1), r),
|
|
1238
1236
|
children: /* @__PURE__ */ e.jsx("span", { className: "flex items-center justify-center", children: /* @__PURE__ */ e.jsx(
|
|
1239
|
-
|
|
1237
|
+
Zt,
|
|
1240
1238
|
{
|
|
1241
|
-
className: !
|
|
1239
|
+
className: !d && (!t || p - 1 < 0) ? "text-gray-500" : "text-black/60 dark:text-white/60"
|
|
1242
1240
|
}
|
|
1243
1241
|
) })
|
|
1244
1242
|
}
|
|
1245
1243
|
),
|
|
1246
|
-
/* @__PURE__ */ e.jsx("div", { className: "w-8/12 text-center", children: /* @__PURE__ */ e.jsx(
|
|
1244
|
+
/* @__PURE__ */ e.jsx("div", { className: "w-8/12 text-center", children: /* @__PURE__ */ e.jsx(xt, { label: !1, property: r, onChange: s }) }),
|
|
1247
1245
|
/* @__PURE__ */ e.jsx(
|
|
1248
1246
|
"button",
|
|
1249
1247
|
{
|
|
1250
1248
|
type: "button",
|
|
1251
1249
|
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",
|
|
1252
|
-
disabled: !
|
|
1253
|
-
onClick: () =>
|
|
1250
|
+
disabled: !d && (!t || p + 1 >= o.length),
|
|
1251
|
+
onClick: () => s($e(o, p + 1), r),
|
|
1254
1252
|
children: /* @__PURE__ */ e.jsx("span", { className: "flex items-center justify-center", children: /* @__PURE__ */ e.jsx(
|
|
1255
|
-
|
|
1253
|
+
Ve,
|
|
1256
1254
|
{
|
|
1257
|
-
className: !
|
|
1255
|
+
className: !d && (!t || p + 1 >= o.length) ? "text-gray-500" : "text-black/60 dark:text-white/60"
|
|
1258
1256
|
}
|
|
1259
1257
|
) })
|
|
1260
1258
|
}
|
|
1261
1259
|
)
|
|
1262
1260
|
] }) });
|
|
1263
|
-
},
|
|
1264
|
-
const
|
|
1265
|
-
return /* @__PURE__ */ e.jsx("div", { className: "flex grow flex-wrap gap-1", children: k(
|
|
1266
|
-
/* @__PURE__ */ e.jsx(
|
|
1261
|
+
}, ds = ({ property: r, onChange: s }) => {
|
|
1262
|
+
const t = _(() => x(ge, `${r}.classes`, [""]), [r]), { canChange: d } = oe(ne), l = ie(r), n = _(() => x(l, "cls", ""), [l]);
|
|
1263
|
+
return /* @__PURE__ */ e.jsx("div", { className: "flex grow flex-wrap gap-1", children: k(t, (o) => /* @__PURE__ */ e.jsxs(O, { children: [
|
|
1264
|
+
/* @__PURE__ */ e.jsx(F, { asChild: !0, children: /* @__PURE__ */ e.jsx(
|
|
1267
1265
|
"button",
|
|
1268
1266
|
{
|
|
1269
1267
|
type: "button",
|
|
1270
|
-
disabled: !
|
|
1271
|
-
onClick: () => o
|
|
1272
|
-
className: `cursor-pointer rounded border border-gray-600 p-1 disabled:cursor-not-allowed ${
|
|
1273
|
-
children:
|
|
1268
|
+
disabled: !d,
|
|
1269
|
+
onClick: () => s(o, r),
|
|
1270
|
+
className: `cursor-pointer rounded border border-gray-600 p-1 disabled:cursor-not-allowed ${n === o ? " bg-blue-500 text-white" : "disabled:bg-gray-600 disabled:text-gray-400"}`,
|
|
1271
|
+
children: $.createElement(x(ut, o, et))
|
|
1274
1272
|
}
|
|
1275
1273
|
) }),
|
|
1276
|
-
/* @__PURE__ */ e.jsx(
|
|
1274
|
+
/* @__PURE__ */ e.jsx(Y, { children: E(le(o)) })
|
|
1277
1275
|
] })) });
|
|
1278
|
-
},
|
|
1276
|
+
}, cs = {
|
|
1279
1277
|
backgroundColor: "bg",
|
|
1280
1278
|
textColor: "text",
|
|
1281
1279
|
borderColor: "border",
|
|
@@ -1287,39 +1285,39 @@ const hs = ({ property: t, onChange: o }) => {
|
|
|
1287
1285
|
toColor: "to",
|
|
1288
1286
|
ringColor: "ring",
|
|
1289
1287
|
ringOffsetColor: "ring-offset"
|
|
1290
|
-
},
|
|
1291
|
-
const
|
|
1288
|
+
}, ps = ({ property: r, onChange: s }) => {
|
|
1289
|
+
const t = ie(r), d = _(() => x(t, "cls", ""), [t]), { canChange: l } = oe(ne), [n, o] = w([]), [p, i] = w({ color: "", shade: "" }), c = d.split("-"), h = x(c, "1", ""), a = x(c, "2", ""), g = V(
|
|
1292
1290
|
// eslint-disable-next-line no-shadow
|
|
1293
1291
|
(u) => {
|
|
1294
|
-
["current", "inherit", "transparent", "black", "white"].includes(u) ? (
|
|
1292
|
+
["current", "inherit", "transparent", "black", "white"].includes(u) ? (o([]), i({ color: u })) : (o(["50", "100", "200", "300", "400", "500", "600", "700", "800", "900"]), i((f) => ({ ...f, color: u, shade: f.shade ? f.shade : "500" })));
|
|
1295
1293
|
},
|
|
1296
|
-
[
|
|
1294
|
+
[o, i]
|
|
1297
1295
|
);
|
|
1298
|
-
|
|
1296
|
+
L(() => {
|
|
1299
1297
|
if (["current", "inherit", "transparent", "black", "white"].includes(h))
|
|
1300
|
-
return
|
|
1301
|
-
|
|
1298
|
+
return o([]);
|
|
1299
|
+
o(["50", "100", "200", "300", "400", "500", "600", "700", "800", "900"]);
|
|
1302
1300
|
}, [h]);
|
|
1303
|
-
const
|
|
1301
|
+
const y = V(
|
|
1304
1302
|
// eslint-disable-next-line no-shadow
|
|
1305
1303
|
(u) => {
|
|
1306
|
-
|
|
1304
|
+
i({ color: h, shade: u });
|
|
1307
1305
|
},
|
|
1308
1306
|
[h]
|
|
1309
1307
|
);
|
|
1310
|
-
return
|
|
1311
|
-
|
|
1312
|
-
}, [
|
|
1313
|
-
const
|
|
1314
|
-
|
|
1315
|
-
}, [p,
|
|
1308
|
+
return L(() => {
|
|
1309
|
+
i({ color: "", shade: "" });
|
|
1310
|
+
}, [t]), L(() => {
|
|
1311
|
+
const f = `${x(cs, r, "")}-${p.color}${p.shade ? `-${p.shade}` : ""}`;
|
|
1312
|
+
f.match(new RegExp(x(ge, `${r}.regExp`, ""))) && s(f, r);
|
|
1313
|
+
}, [p, s, r]), /* @__PURE__ */ e.jsxs("div", { className: "flex flex-row divide-x divide-solid divide-border rounded-lg border border-border text-xs", children: [
|
|
1316
1314
|
/* @__PURE__ */ e.jsx("div", { className: "grow text-center", children: /* @__PURE__ */ e.jsx(
|
|
1317
|
-
|
|
1315
|
+
Se,
|
|
1318
1316
|
{
|
|
1319
1317
|
disabled: !l,
|
|
1320
1318
|
rounded: !0,
|
|
1321
1319
|
selected: h,
|
|
1322
|
-
onChange:
|
|
1320
|
+
onChange: g,
|
|
1323
1321
|
options: [
|
|
1324
1322
|
"current",
|
|
1325
1323
|
"transparent",
|
|
@@ -1352,233 +1350,233 @@ const hs = ({ property: t, onChange: o }) => {
|
|
|
1352
1350
|
]
|
|
1353
1351
|
}
|
|
1354
1352
|
) }),
|
|
1355
|
-
/* @__PURE__ */ e.jsx("button", { type: "button", className: "grow text-center", children: /* @__PURE__ */ e.jsx(
|
|
1353
|
+
/* @__PURE__ */ e.jsx("button", { type: "button", className: "grow text-center", children: /* @__PURE__ */ e.jsx(Se, { rounded: !0, selected: a, disabled: !h || !l, onChange: y, options: n }) })
|
|
1356
1354
|
] });
|
|
1357
|
-
},
|
|
1358
|
-
|
|
1359
|
-
let
|
|
1360
|
-
if ((
|
|
1361
|
-
return { value: "", unit:
|
|
1362
|
-
const
|
|
1363
|
-
|
|
1364
|
-
const l =
|
|
1365
|
-
return
|
|
1355
|
+
}, Ze = (r, s) => {
|
|
1356
|
+
r = r.toLowerCase();
|
|
1357
|
+
let t = r.trim().replace(/ |\+/g, "");
|
|
1358
|
+
if ((t === "auto" || t === "none") && s.includes(t))
|
|
1359
|
+
return { value: "", unit: t };
|
|
1360
|
+
const d = s.length ? new RegExp(s.join("|"), "g") : /XXXXXX/g;
|
|
1361
|
+
t = t.replace(d, "");
|
|
1362
|
+
const l = r.match(d), n = l && l.length > 1, o = !b(t) && Number.isNaN(Number(t));
|
|
1363
|
+
return n || o ? { error: "Invalid value" } : l && (l[0] === "auto" || l[0] === "none") ? { value: l[0], unit: "" } : { value: t, unit: l ? l[0] : "" };
|
|
1366
1364
|
};
|
|
1367
|
-
const
|
|
1368
|
-
const
|
|
1369
|
-
if (["auto", "none"].includes(
|
|
1370
|
-
return { value: "", unit:
|
|
1371
|
-
if (
|
|
1365
|
+
const us = (r) => {
|
|
1366
|
+
const s = r.startsWith("-") ? "-" : "", t = r.split("-").pop();
|
|
1367
|
+
if (["auto", "none"].includes(t))
|
|
1368
|
+
return { value: "", unit: t };
|
|
1369
|
+
if (t === "px")
|
|
1372
1370
|
return { value: "1", unit: "px" };
|
|
1373
|
-
if (
|
|
1374
|
-
return { value: "100", unit:
|
|
1375
|
-
if (
|
|
1371
|
+
if (t === "screen")
|
|
1372
|
+
return { value: "100", unit: r.indexOf("w-") !== -1 ? "vw" : "vh" };
|
|
1373
|
+
if (t === "full")
|
|
1376
1374
|
return { value: "100", unit: "%" };
|
|
1377
|
-
if (M(
|
|
1378
|
-
return { value: `${
|
|
1379
|
-
if (M(
|
|
1380
|
-
return { value: `${
|
|
1381
|
-
if (M(
|
|
1382
|
-
return { value: `${
|
|
1383
|
-
if (M(
|
|
1384
|
-
return { value: `${
|
|
1385
|
-
if (M(
|
|
1386
|
-
return { value: `${
|
|
1387
|
-
if (M(
|
|
1388
|
-
return { value: `${
|
|
1389
|
-
if (G(
|
|
1390
|
-
const
|
|
1391
|
-
if (
|
|
1392
|
-
return { value:
|
|
1393
|
-
if (
|
|
1375
|
+
if (M(r, "skew-"))
|
|
1376
|
+
return { value: `${s}${t}`, unit: "deg" };
|
|
1377
|
+
if (M(r, "rotate-"))
|
|
1378
|
+
return { value: `${s}${t}`, unit: "deg" };
|
|
1379
|
+
if (M(r, "opacity-"))
|
|
1380
|
+
return { value: `${t / 100}`, unit: "-" };
|
|
1381
|
+
if (M(r, "duration-") || M(r, "delay-"))
|
|
1382
|
+
return { value: `${t}`, unit: "ms" };
|
|
1383
|
+
if (M(r, "translate-") && !t.includes("/"))
|
|
1384
|
+
return { value: `${s}${`${t / 4}`}`, unit: "rem" };
|
|
1385
|
+
if (M(r, "scale-"))
|
|
1386
|
+
return { value: `${s}${`${t / 100}`}`, unit: "-" };
|
|
1387
|
+
if (G(r, "border")) {
|
|
1388
|
+
const d = r.match(/border-?(x|y|t|r|b|l)?\d+/g);
|
|
1389
|
+
if (d)
|
|
1390
|
+
return { value: d[0].split("-").pop(), unit: "px" };
|
|
1391
|
+
if (r.match(/border-?(x|y|t|r|b|l)?/g))
|
|
1394
1392
|
return { value: "1", unit: "px" };
|
|
1395
1393
|
}
|
|
1396
|
-
if (G(
|
|
1397
|
-
if (
|
|
1394
|
+
if (G(r, "max-w-")) {
|
|
1395
|
+
if (r === "max-w-screen-sm")
|
|
1398
1396
|
return { value: "640", unit: "px" };
|
|
1399
|
-
if (
|
|
1397
|
+
if (r === "max-w-screen-md")
|
|
1400
1398
|
return { value: "768", unit: "px" };
|
|
1401
|
-
if (
|
|
1399
|
+
if (r === "max-w-screen-lg")
|
|
1402
1400
|
return { value: "1024", unit: "px" };
|
|
1403
|
-
if (
|
|
1401
|
+
if (r === "max-w-screen-xl")
|
|
1404
1402
|
return { value: "1280", unit: "px" };
|
|
1405
|
-
if (
|
|
1403
|
+
if (r === "max-w-screen-2xl")
|
|
1406
1404
|
return { value: "1536", unit: "px" };
|
|
1407
|
-
if (
|
|
1405
|
+
if (t === "xs")
|
|
1408
1406
|
return { value: "320", unit: "px" };
|
|
1409
|
-
if (
|
|
1407
|
+
if (t === "sm")
|
|
1410
1408
|
return { value: "384", unit: "px" };
|
|
1411
|
-
if (
|
|
1409
|
+
if (t === "md")
|
|
1412
1410
|
return { value: "448", unit: "px" };
|
|
1413
|
-
if (
|
|
1411
|
+
if (t === "lg")
|
|
1414
1412
|
return { value: "512", unit: "px" };
|
|
1415
|
-
if (
|
|
1413
|
+
if (t === "xl")
|
|
1416
1414
|
return { value: "576", unit: "px" };
|
|
1417
|
-
if (
|
|
1415
|
+
if (t === "2xl")
|
|
1418
1416
|
return { value: "672", unit: "px" };
|
|
1419
|
-
if (
|
|
1417
|
+
if (t === "3xl")
|
|
1420
1418
|
return { value: "768", unit: "px" };
|
|
1421
|
-
if (
|
|
1419
|
+
if (t === "4xl")
|
|
1422
1420
|
return { value: "896", unit: "px" };
|
|
1423
|
-
if (
|
|
1421
|
+
if (t === "5xl")
|
|
1424
1422
|
return { value: "1024", unit: "px" };
|
|
1425
|
-
if (
|
|
1423
|
+
if (t === "6xl")
|
|
1426
1424
|
return { value: "1152", unit: "px" };
|
|
1427
|
-
if (
|
|
1425
|
+
if (t === "7xl")
|
|
1428
1426
|
return { value: "1280", unit: "px" };
|
|
1429
|
-
if (
|
|
1427
|
+
if (t === "prose")
|
|
1430
1428
|
return { value: "65", unit: "ch" };
|
|
1431
1429
|
}
|
|
1432
|
-
if (G(
|
|
1433
|
-
if (
|
|
1430
|
+
if (G(r, "text-")) {
|
|
1431
|
+
if (t === "xs")
|
|
1434
1432
|
return { value: "12", unit: "px" };
|
|
1435
|
-
if (
|
|
1433
|
+
if (t === "sm")
|
|
1436
1434
|
return { value: "14", unit: "px" };
|
|
1437
|
-
if (
|
|
1435
|
+
if (t === "base")
|
|
1438
1436
|
return { value: "16", unit: "px" };
|
|
1439
|
-
if (
|
|
1437
|
+
if (t === "lg")
|
|
1440
1438
|
return { value: "18", unit: "px" };
|
|
1441
|
-
if (
|
|
1439
|
+
if (t === "xl")
|
|
1442
1440
|
return { value: "20", unit: "px" };
|
|
1443
|
-
if (
|
|
1441
|
+
if (t === "2xl")
|
|
1444
1442
|
return { value: "24", unit: "px" };
|
|
1445
|
-
if (
|
|
1443
|
+
if (t === "3xl")
|
|
1446
1444
|
return { value: "30", unit: "px" };
|
|
1447
|
-
if (
|
|
1445
|
+
if (t === "4xl")
|
|
1448
1446
|
return { value: "36", unit: "px" };
|
|
1449
|
-
if (
|
|
1447
|
+
if (t === "5xl")
|
|
1450
1448
|
return { value: "48", unit: "px" };
|
|
1451
|
-
if (
|
|
1449
|
+
if (t === "6xl")
|
|
1452
1450
|
return { value: "60", unit: "px" };
|
|
1453
|
-
if (
|
|
1451
|
+
if (t === "7xl")
|
|
1454
1452
|
return { value: "72", unit: "px" };
|
|
1455
|
-
if (
|
|
1453
|
+
if (t === "8xl")
|
|
1456
1454
|
return { value: "96", unit: "px" };
|
|
1457
|
-
if (
|
|
1455
|
+
if (t === "9xl")
|
|
1458
1456
|
return { value: "128", unit: "px" };
|
|
1459
1457
|
}
|
|
1460
|
-
if (G(
|
|
1461
|
-
if (
|
|
1458
|
+
if (G(r, "leading-")) {
|
|
1459
|
+
if (t === "none")
|
|
1462
1460
|
return { value: "1", unit: "-" };
|
|
1463
|
-
if (
|
|
1461
|
+
if (t === "tight")
|
|
1464
1462
|
return { value: "1.25", unit: "-" };
|
|
1465
|
-
if (
|
|
1463
|
+
if (t === "snug")
|
|
1466
1464
|
return { value: "1.375", unit: "-" };
|
|
1467
|
-
if (
|
|
1465
|
+
if (t === "normal")
|
|
1468
1466
|
return { value: "1.5", unit: "-" };
|
|
1469
|
-
if (
|
|
1467
|
+
if (t === "relaxed")
|
|
1470
1468
|
return { value: "1.625", unit: "-" };
|
|
1471
|
-
if (
|
|
1469
|
+
if (t === "loose")
|
|
1472
1470
|
return { value: "2", unit: "-" };
|
|
1473
1471
|
}
|
|
1474
|
-
if (G(
|
|
1475
|
-
if (
|
|
1472
|
+
if (G(r, "tracking-")) {
|
|
1473
|
+
if (t === "tighter")
|
|
1476
1474
|
return { value: "-0.05", unit: "em" };
|
|
1477
|
-
if (
|
|
1475
|
+
if (t === "tight")
|
|
1478
1476
|
return { value: "-0.025", unit: "em" };
|
|
1479
|
-
if (
|
|
1477
|
+
if (t === "normal")
|
|
1480
1478
|
return { value: "0", unit: "em" };
|
|
1481
|
-
if (
|
|
1479
|
+
if (t === "wide")
|
|
1482
1480
|
return { value: "0.025", unit: "em" };
|
|
1483
|
-
if (
|
|
1481
|
+
if (t === "wider")
|
|
1484
1482
|
return { value: "0.05", unit: "em" };
|
|
1485
|
-
if (
|
|
1483
|
+
if (t === "widest")
|
|
1486
1484
|
return { value: "0.1", unit: "em" };
|
|
1487
1485
|
}
|
|
1488
|
-
if (["max", "min", "fit"].includes(
|
|
1489
|
-
return { value:
|
|
1490
|
-
if (
|
|
1491
|
-
const [
|
|
1492
|
-
return { value:
|
|
1486
|
+
if (["max", "min", "fit"].includes(t))
|
|
1487
|
+
return { value: r, unit: "class" };
|
|
1488
|
+
if (t.includes("/")) {
|
|
1489
|
+
const [d, l] = k(t.split("/"), (n) => parseInt(n, 10));
|
|
1490
|
+
return { value: s + (d / l * 100).toFixed(2).replace(".00", ""), unit: "%" };
|
|
1493
1491
|
}
|
|
1494
|
-
return
|
|
1492
|
+
return Tt(parseFloat(t)) ? { value: `${s + parseFloat(t) * 4}`, unit: "px" } : { value: t, unit: "class" };
|
|
1495
1493
|
};
|
|
1496
|
-
const
|
|
1497
|
-
if (
|
|
1494
|
+
const xs = (r) => {
|
|
1495
|
+
if (b(r))
|
|
1498
1496
|
return { value: "", unit: "" };
|
|
1499
|
-
const
|
|
1500
|
-
if (
|
|
1501
|
-
return
|
|
1502
|
-
const
|
|
1503
|
-
return { value: `${
|
|
1504
|
-
},
|
|
1497
|
+
const s = r.match(/\[.*\]/g);
|
|
1498
|
+
if (s === null)
|
|
1499
|
+
return gs(r);
|
|
1500
|
+
const t = x(s, "0", "").replace(/\[|\]/g, ""), d = r.startsWith("-") ? "-" : "", l = ae(t.match(/\d+.\d+|\d+/g));
|
|
1501
|
+
return { value: `${d}${l}`, unit: t.replace(l, "") };
|
|
1502
|
+
}, gs = (r) => b(r) ? { value: "", unit: "" } : us(r), gt = $.createContext({
|
|
1505
1503
|
setDragData: () => {
|
|
1506
1504
|
}
|
|
1507
|
-
}),
|
|
1508
|
-
unit:
|
|
1509
|
-
currentValue:
|
|
1510
|
-
onDrag:
|
|
1511
|
-
onDragEnd:
|
|
1505
|
+
}), hs = ({
|
|
1506
|
+
unit: r,
|
|
1507
|
+
currentValue: s,
|
|
1508
|
+
onDrag: t,
|
|
1509
|
+
onDragEnd: d,
|
|
1512
1510
|
onDragStart: l,
|
|
1513
|
-
negative:
|
|
1514
|
-
cssProperty:
|
|
1511
|
+
negative: n,
|
|
1512
|
+
cssProperty: o
|
|
1515
1513
|
}) => {
|
|
1516
|
-
const { setDragData: p } =
|
|
1514
|
+
const { setDragData: p } = oe(gt);
|
|
1517
1515
|
return /* @__PURE__ */ e.jsx(
|
|
1518
1516
|
"button",
|
|
1519
1517
|
{
|
|
1520
1518
|
type: "button",
|
|
1521
|
-
onMouseDown: (
|
|
1522
|
-
const
|
|
1523
|
-
onDrag:
|
|
1524
|
-
onDragEnd:
|
|
1519
|
+
onMouseDown: (i) => {
|
|
1520
|
+
const c = {
|
|
1521
|
+
onDrag: t,
|
|
1522
|
+
onDragEnd: d,
|
|
1525
1523
|
dragging: !0,
|
|
1526
|
-
dragStartY:
|
|
1527
|
-
dragStartValue: `${
|
|
1528
|
-
dragUnit:
|
|
1529
|
-
negative:
|
|
1530
|
-
cssProperty:
|
|
1524
|
+
dragStartY: i.pageY,
|
|
1525
|
+
dragStartValue: `${s}`,
|
|
1526
|
+
dragUnit: r,
|
|
1527
|
+
negative: n,
|
|
1528
|
+
cssProperty: o
|
|
1531
1529
|
};
|
|
1532
|
-
l(
|
|
1530
|
+
l(c), p(c);
|
|
1533
1531
|
},
|
|
1534
1532
|
color: void 0,
|
|
1535
1533
|
className: "relative z-50 ml-1 hidden h-6 cursor-row-resize rounded bg-background/70 px-2 group-hover:inline",
|
|
1536
|
-
children: /* @__PURE__ */ e.jsx(
|
|
1534
|
+
children: /* @__PURE__ */ e.jsx(Wt, {})
|
|
1537
1535
|
}
|
|
1538
1536
|
);
|
|
1539
|
-
},
|
|
1540
|
-
|
|
1537
|
+
}, ys = ({ onSelect: r, current: s, units: t }) => /* @__PURE__ */ e.jsx("div", { "data-theme": "light", className: "-m-[7px] -mx-[13px] flex w-9 flex-col", children: t.map((d) => /* @__PURE__ */ e.jsx(
|
|
1538
|
+
U,
|
|
1541
1539
|
{
|
|
1542
1540
|
className: "h-max rounded-none px-1 py-1 text-right text-[11px] hover:bg-blue-400",
|
|
1543
|
-
color:
|
|
1541
|
+
color: s === d ? "primary" : void 0,
|
|
1544
1542
|
size: "sm",
|
|
1545
1543
|
onClick: (l) => {
|
|
1546
|
-
l.stopPropagation(),
|
|
1544
|
+
l.stopPropagation(), r(d);
|
|
1547
1545
|
},
|
|
1548
|
-
children:
|
|
1546
|
+
children: d
|
|
1549
1547
|
},
|
|
1550
|
-
|
|
1551
|
-
)) }),
|
|
1552
|
-
const [
|
|
1553
|
-
|
|
1554
|
-
const { value: m, unit: v } =
|
|
1548
|
+
d
|
|
1549
|
+
)) }), We = 50, ms = (r) => {
|
|
1550
|
+
const [s, t] = w(!1), [d, l] = w(""), { currentClass: n, onChange: o, classPrefix: p, cssProperty: i, units: c, negative: h } = r, [a, g] = w(i != null && i.toLowerCase().includes("width") ? "%" : c[0]), [y, u] = w(!1), [f, j] = w(""), [B, C] = w(!1), [I, X] = w(!1);
|
|
1551
|
+
L(() => {
|
|
1552
|
+
const { value: m, unit: v } = xs(n);
|
|
1555
1553
|
if (v === "") {
|
|
1556
|
-
l(m),
|
|
1554
|
+
l(m), g(i != null && i.toLowerCase().includes("width") ? "%" : ae(c));
|
|
1557
1555
|
return;
|
|
1558
1556
|
}
|
|
1559
|
-
|
|
1560
|
-
}, [
|
|
1561
|
-
const N =
|
|
1557
|
+
g(v), l(v === "class" || b(m) ? "" : m);
|
|
1558
|
+
}, [n, i, c]);
|
|
1559
|
+
const N = fe((m) => o(m), [o], We), P = fe((m) => o(m, !1), [o], We), W = V(
|
|
1562
1560
|
(m = !1) => {
|
|
1563
|
-
const v =
|
|
1561
|
+
const v = Ze(`${d}`, c);
|
|
1564
1562
|
if (x(v, "error", !1)) {
|
|
1565
1563
|
u(!0);
|
|
1566
1564
|
return;
|
|
1567
1565
|
}
|
|
1568
|
-
const
|
|
1569
|
-
if (
|
|
1570
|
-
N(`${p}${
|
|
1566
|
+
const T = x(v, "unit") !== "" ? x(v, "unit") : a;
|
|
1567
|
+
if (T === "auto" || T === "none") {
|
|
1568
|
+
N(`${p}${T}`);
|
|
1571
1569
|
return;
|
|
1572
1570
|
}
|
|
1573
1571
|
if (x(v, "value") === "")
|
|
1574
1572
|
return;
|
|
1575
|
-
const
|
|
1576
|
-
m ?
|
|
1573
|
+
const Q = `${x(v, "value", "").startsWith("-") ? "-" : ""}${p}[${x(v, "value", "").replace("-", "")}${T === "-" ? "" : T}]`;
|
|
1574
|
+
m ? P(Q) : N(Q);
|
|
1577
1575
|
},
|
|
1578
|
-
[N,
|
|
1579
|
-
),
|
|
1576
|
+
[N, P, d, a, p, c]
|
|
1577
|
+
), J = V(
|
|
1580
1578
|
(m) => {
|
|
1581
|
-
const v =
|
|
1579
|
+
const v = Ze(`${d}`, c);
|
|
1582
1580
|
if (x(v, "error", !1)) {
|
|
1583
1581
|
u(!0);
|
|
1584
1582
|
return;
|
|
@@ -1589,108 +1587,108 @@ const vs = (t) => {
|
|
|
1589
1587
|
}
|
|
1590
1588
|
if (x(v, "value") === "")
|
|
1591
1589
|
return;
|
|
1592
|
-
const
|
|
1593
|
-
N(
|
|
1590
|
+
const T = x(v, "unit") !== "" ? x(v, "unit") : m, Q = `${x(v, "value", "").startsWith("-") ? "-" : ""}${p}[${x(v, "value", "").replace("-", "")}${T === "-" ? "" : T}]`;
|
|
1591
|
+
N(Q);
|
|
1594
1592
|
},
|
|
1595
|
-
[N,
|
|
1593
|
+
[N, d, p, c]
|
|
1596
1594
|
);
|
|
1597
|
-
return /* @__PURE__ */ e.jsx("div", { className: "flex w-full flex-col", children: /* @__PURE__ */ e.jsx("div", { className: "flex items-center justify-start", children:
|
|
1598
|
-
/* @__PURE__ */ e.jsx("input", { className: "w-20 rounded py-1", readOnly: !0, value:
|
|
1599
|
-
/* @__PURE__ */ e.jsxs(
|
|
1600
|
-
/* @__PURE__ */ e.jsx(
|
|
1601
|
-
/* @__PURE__ */ e.jsx(
|
|
1595
|
+
return /* @__PURE__ */ e.jsx("div", { className: "flex w-full flex-col", children: /* @__PURE__ */ e.jsx("div", { className: "flex items-center justify-start", children: a === "class" ? /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
1596
|
+
/* @__PURE__ */ e.jsx("input", { className: "w-20 rounded py-1", readOnly: !0, value: n }),
|
|
1597
|
+
/* @__PURE__ */ e.jsxs(O, { children: [
|
|
1598
|
+
/* @__PURE__ */ e.jsx(F, { asChild: !0, children: /* @__PURE__ */ e.jsx("button", { type: "button", className: "invisible ml-3 mt-1 text-blue-600 group-hover:visible", children: /* @__PURE__ */ e.jsx(He, {}) }) }),
|
|
1599
|
+
/* @__PURE__ */ e.jsx(Y, { children: "Current value is using a Tailwind preset class." })
|
|
1602
1600
|
] })
|
|
1603
|
-
] }) : /* @__PURE__ */ e.jsxs("div", { className: `group relative flex items-center ${
|
|
1601
|
+
] }) : /* @__PURE__ */ e.jsxs("div", { className: `group relative flex items-center ${B ? "z-auto" : ""}`, children: [
|
|
1604
1602
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center rounded-md border border-border", children: [
|
|
1605
|
-
["none", "auto"].indexOf(
|
|
1603
|
+
["none", "auto"].indexOf(a) !== -1 ? null : /* @__PURE__ */ e.jsx(
|
|
1606
1604
|
"input",
|
|
1607
1605
|
{
|
|
1608
|
-
readOnly:
|
|
1606
|
+
readOnly: a === "class",
|
|
1609
1607
|
onKeyPress: (m) => {
|
|
1610
|
-
m.key === "Enter" &&
|
|
1608
|
+
m.key === "Enter" && W();
|
|
1611
1609
|
},
|
|
1612
1610
|
onKeyDown: (m) => {
|
|
1613
1611
|
if (m.keyCode !== 38 && m.keyCode !== 40)
|
|
1614
1612
|
return;
|
|
1615
|
-
m.preventDefault(),
|
|
1616
|
-
const v =
|
|
1617
|
-
let
|
|
1618
|
-
m.keyCode === 38 && (
|
|
1619
|
-
const
|
|
1620
|
-
|
|
1613
|
+
m.preventDefault(), X(!0);
|
|
1614
|
+
const v = St(m.target.value);
|
|
1615
|
+
let T = qe(v) ? 0 : v;
|
|
1616
|
+
m.keyCode === 38 && (T += 1), m.keyCode === 40 && (T -= 1);
|
|
1617
|
+
const Z = `${T}`, yt = `${Z.startsWith("-") ? "-" : ""}${p}[${Z.replace("-", "")}${a === "-" ? "" : a}]`;
|
|
1618
|
+
P(yt);
|
|
1621
1619
|
},
|
|
1622
1620
|
onKeyUp: (m) => {
|
|
1623
|
-
|
|
1621
|
+
I && (m.preventDefault(), X(!1));
|
|
1624
1622
|
},
|
|
1625
|
-
onBlur: () =>
|
|
1623
|
+
onBlur: () => W(),
|
|
1626
1624
|
onChange: (m) => {
|
|
1627
1625
|
u(!1), l(m.target.value);
|
|
1628
1626
|
},
|
|
1629
1627
|
onClick: (m) => {
|
|
1630
1628
|
var v;
|
|
1631
|
-
(v = m == null ? void 0 : m.target) == null || v.select(),
|
|
1629
|
+
(v = m == null ? void 0 : m.target) == null || v.select(), t(!1);
|
|
1632
1630
|
},
|
|
1633
|
-
value:
|
|
1631
|
+
value: B ? f : d,
|
|
1634
1632
|
className: "h-6 w-14 rounded rounded-r-none bg-background pl-2 text-sm focus-visible:outline-0 ".concat(
|
|
1635
1633
|
" ",
|
|
1636
|
-
|
|
1634
|
+
y ? "border-red-500 text-red-500" : "border-foreground/20"
|
|
1637
1635
|
)
|
|
1638
1636
|
}
|
|
1639
1637
|
),
|
|
1640
|
-
/* @__PURE__ */ e.jsxs(
|
|
1641
|
-
/* @__PURE__ */ e.jsx(
|
|
1638
|
+
/* @__PURE__ */ e.jsxs(O, { open: s, delayDuration: 100, children: [
|
|
1639
|
+
/* @__PURE__ */ e.jsx(F, { asChild: !0, children: /* @__PURE__ */ e.jsxs(
|
|
1642
1640
|
"button",
|
|
1643
1641
|
{
|
|
1644
1642
|
type: "button",
|
|
1645
|
-
onClick: () =>
|
|
1643
|
+
onClick: () => t(!s),
|
|
1646
1644
|
className: "flex h-6 cursor-pointer items-center gap-x-1 rounded rounded-l-none bg-background p-px px-1 text-[11px] uppercase",
|
|
1647
1645
|
children: [
|
|
1648
|
-
/* @__PURE__ */ e.jsx("span", { className: `inline-block ${
|
|
1649
|
-
|
|
1646
|
+
/* @__PURE__ */ e.jsx("span", { className: `inline-block ${c.length === 1 ? "px-2 font-semibold" : ""}`, children: a }),
|
|
1647
|
+
c.length > 1 ? /* @__PURE__ */ e.jsx(Ut, {}) : null
|
|
1650
1648
|
]
|
|
1651
1649
|
}
|
|
1652
1650
|
) }),
|
|
1653
|
-
/* @__PURE__ */ e.jsx(
|
|
1654
|
-
|
|
1651
|
+
/* @__PURE__ */ e.jsx(jr, { children: /* @__PURE__ */ e.jsx(Y, { className: "bg-background", children: /* @__PURE__ */ e.jsx(
|
|
1652
|
+
ys,
|
|
1655
1653
|
{
|
|
1656
|
-
units:
|
|
1657
|
-
current:
|
|
1654
|
+
units: c,
|
|
1655
|
+
current: a,
|
|
1658
1656
|
onSelect: (m) => {
|
|
1659
|
-
|
|
1657
|
+
t(!1), g(m), J(m);
|
|
1660
1658
|
}
|
|
1661
1659
|
}
|
|
1662
1660
|
) }) })
|
|
1663
1661
|
] })
|
|
1664
1662
|
] }),
|
|
1665
|
-
["none", "auto"].indexOf(
|
|
1666
|
-
|
|
1663
|
+
["none", "auto"].indexOf(a) !== -1 || B ? null : /* @__PURE__ */ e.jsx(
|
|
1664
|
+
hs,
|
|
1667
1665
|
{
|
|
1668
|
-
onDragStart: () =>
|
|
1666
|
+
onDragStart: () => C(!0),
|
|
1669
1667
|
onDragEnd: (m) => {
|
|
1670
|
-
if (j(() => ""),
|
|
1668
|
+
if (j(() => ""), C(!1), b(m))
|
|
1671
1669
|
return;
|
|
1672
|
-
const v = `${m}`,
|
|
1673
|
-
N(
|
|
1670
|
+
const v = `${m}`, Z = `${v.startsWith("-") ? "-" : ""}${p}[${v.replace("-", "")}${a === "-" ? "" : a}]`;
|
|
1671
|
+
N(Z);
|
|
1674
1672
|
},
|
|
1675
1673
|
onDrag: (m) => {
|
|
1676
|
-
if (
|
|
1674
|
+
if (b(m))
|
|
1677
1675
|
return;
|
|
1678
1676
|
j(m);
|
|
1679
|
-
const v = `${m}`,
|
|
1680
|
-
|
|
1677
|
+
const v = `${m}`, Z = `${v.startsWith("-") ? "-" : ""}${p}[${v.replace("-", "")}${a === "-" ? "" : a}]`;
|
|
1678
|
+
P(Z);
|
|
1681
1679
|
},
|
|
1682
|
-
currentValue:
|
|
1683
|
-
unit:
|
|
1680
|
+
currentValue: d,
|
|
1681
|
+
unit: a,
|
|
1684
1682
|
negative: h,
|
|
1685
|
-
cssProperty:
|
|
1683
|
+
cssProperty: i
|
|
1686
1684
|
}
|
|
1687
1685
|
)
|
|
1688
1686
|
] }) }) });
|
|
1689
|
-
},
|
|
1690
|
-
const
|
|
1691
|
-
return
|
|
1692
|
-
},
|
|
1693
|
-
const
|
|
1687
|
+
}, ie = (r) => {
|
|
1688
|
+
const s = xe();
|
|
1689
|
+
return Rt(s, { property: r });
|
|
1690
|
+
}, bs = (r, s) => {
|
|
1691
|
+
const t = {
|
|
1694
1692
|
xs: 0,
|
|
1695
1693
|
sm: 1,
|
|
1696
1694
|
md: 2,
|
|
@@ -1698,8 +1696,8 @@ const vs = (t) => {
|
|
|
1698
1696
|
xl: 4,
|
|
1699
1697
|
"2xl": 5
|
|
1700
1698
|
};
|
|
1701
|
-
return
|
|
1702
|
-
},
|
|
1699
|
+
return t[x(r, "mq", "xs")] <= t[s];
|
|
1700
|
+
}, fs = {
|
|
1703
1701
|
width: "w-",
|
|
1704
1702
|
height: "h-",
|
|
1705
1703
|
minWidth: "min-w-",
|
|
@@ -1765,87 +1763,87 @@ const vs = (t) => {
|
|
|
1765
1763
|
insetY: "inset-y-",
|
|
1766
1764
|
opacity: "opacity-",
|
|
1767
1765
|
flexBasis: "basis-"
|
|
1768
|
-
},
|
|
1766
|
+
}, Ue = {
|
|
1769
1767
|
xs: "",
|
|
1770
1768
|
sm: "640px",
|
|
1771
1769
|
md: "768px",
|
|
1772
1770
|
lg: "1024px",
|
|
1773
1771
|
xl: "1280px",
|
|
1774
1772
|
"2xl": "1536px"
|
|
1775
|
-
},
|
|
1776
|
-
const { t:
|
|
1777
|
-
}, units:
|
|
1778
|
-
(
|
|
1779
|
-
const
|
|
1780
|
-
(
|
|
1781
|
-
const m =
|
|
1782
|
-
|
|
1773
|
+
}, vs = (r) => `${r.toUpperCase()} ${Ue[r] ? `(${Ue[r]} & up)` : ""}`, Ie = (r) => {
|
|
1774
|
+
const { t: s } = z(), { type: t = "icons", label: d, property: l, onEmitChange: n = () => {
|
|
1775
|
+
}, units: o, negative: p = !1 } = r, [i] = wr(), [c] = it(), [, h] = Me(), a = ie(l), g = De(), y = ot(), [u] = at(), f = _(() => x(a, "fullCls", ""), [a]), j = V(
|
|
1776
|
+
(P, W = !0) => {
|
|
1777
|
+
const J = { dark: i, mq: h, mod: c, cls: P, property: l, fullCls: "" };
|
|
1778
|
+
(i || c !== "") && (J.mq = "xs");
|
|
1779
|
+
const m = Kr(J);
|
|
1780
|
+
g(u, [m], W);
|
|
1783
1781
|
},
|
|
1784
|
-
[u,
|
|
1785
|
-
),
|
|
1786
|
-
|
|
1787
|
-
}, [u,
|
|
1788
|
-
|
|
1789
|
-
|
|
1790
|
-
}, [
|
|
1791
|
-
const [, ,
|
|
1792
|
-
(
|
|
1793
|
-
|
|
1782
|
+
[u, i, h, c, l, g]
|
|
1783
|
+
), B = V(() => {
|
|
1784
|
+
y(u, [f]);
|
|
1785
|
+
}, [u, f, y]), C = _(() => bs(a, h), [a, h]);
|
|
1786
|
+
L(() => {
|
|
1787
|
+
n(C, a);
|
|
1788
|
+
}, [C, n, a]);
|
|
1789
|
+
const [, , I] = Me(), X = V(
|
|
1790
|
+
(P) => {
|
|
1791
|
+
I({
|
|
1794
1792
|
xs: 400,
|
|
1795
1793
|
sm: 640,
|
|
1796
1794
|
md: 800,
|
|
1797
1795
|
lg: 1024,
|
|
1798
1796
|
xl: 1420,
|
|
1799
1797
|
"2xl": 1920
|
|
1800
|
-
}[
|
|
1798
|
+
}[P]);
|
|
1801
1799
|
},
|
|
1802
|
-
[
|
|
1803
|
-
), N = x(
|
|
1804
|
-
return /* @__PURE__ */ e.jsx(
|
|
1805
|
-
/* @__PURE__ */ e.jsx("div", { className: "relative w-[70px] truncate text-xs text-foreground", children: /* @__PURE__ */ e.jsx("span", { className: `text-[11px] ${
|
|
1800
|
+
[I]
|
|
1801
|
+
), N = x(a, "dark", null) === i && x(a, "mod", null) === c && x(a, "mq", null) === h;
|
|
1802
|
+
return /* @__PURE__ */ e.jsx(ns, { canChange: C, canReset: a && N, children: /* @__PURE__ */ e.jsxs("div", { className: "group flex flex-row items-center py-2 first:pt-0 last:pb-0", children: [
|
|
1803
|
+
/* @__PURE__ */ e.jsx("div", { className: "relative w-[70px] truncate text-xs text-foreground", children: /* @__PURE__ */ e.jsx("span", { className: `text-[11px] ${a && !N ? "text-foreground" : ""}`, children: s(d) }) }),
|
|
1806
1804
|
/* @__PURE__ */ e.jsxs("div", { className: "flex flex-row items-center", children: [
|
|
1807
1805
|
/* @__PURE__ */ e.jsxs("div", { className: "w-[150px]", children: [
|
|
1808
|
-
|
|
1809
|
-
|
|
1806
|
+
t === "arbitrary" ? /* @__PURE__ */ e.jsx(
|
|
1807
|
+
ms,
|
|
1810
1808
|
{
|
|
1811
|
-
currentClass: x(
|
|
1812
|
-
classPrefix: x(
|
|
1813
|
-
units:
|
|
1809
|
+
currentClass: x(a, "cls", ""),
|
|
1810
|
+
classPrefix: x(fs, l, ""),
|
|
1811
|
+
units: o || [],
|
|
1814
1812
|
onChange: j,
|
|
1815
1813
|
negative: p,
|
|
1816
1814
|
cssProperty: l
|
|
1817
1815
|
}
|
|
1818
1816
|
) : null,
|
|
1819
|
-
|
|
1820
|
-
|
|
1821
|
-
|
|
1822
|
-
|
|
1817
|
+
t === "icons" && /* @__PURE__ */ e.jsx(ds, { property: l, onChange: j }),
|
|
1818
|
+
t === "range" && /* @__PURE__ */ e.jsx(is, { property: l, onChange: j }),
|
|
1819
|
+
t === "color" && /* @__PURE__ */ e.jsx(ps, { property: l, onChange: j }),
|
|
1820
|
+
t === "dropdown" && /* @__PURE__ */ e.jsx(xt, { label: d, property: l, onChange: j })
|
|
1823
1821
|
] }),
|
|
1824
|
-
/* @__PURE__ */ e.jsx("div", { className: `w-[30px] cursor-pointer ${
|
|
1825
|
-
/* @__PURE__ */ e.jsx(
|
|
1822
|
+
/* @__PURE__ */ e.jsx("div", { className: `w-[30px] cursor-pointer ${f ? "visible" : "invisible"}`, children: N ? /* @__PURE__ */ e.jsx("button", { type: "button", onClick: () => B(), title: "Reset", className: "flex px-1.5 text-xs", children: /* @__PURE__ */ e.jsx(Kt, { className: "h-5 w-5 text-blue-500 hover:opacity-80" }) }) : C && a ? /* @__PURE__ */ e.jsxs(O, { delayDuration: 100, children: [
|
|
1823
|
+
/* @__PURE__ */ e.jsx(F, { asChild: !0, children: /* @__PURE__ */ e.jsx(
|
|
1826
1824
|
"button",
|
|
1827
1825
|
{
|
|
1828
1826
|
type: "button",
|
|
1829
1827
|
className: "invisible ml-3 mt-1 rounded-full bg-blue-500 text-white group-hover:visible",
|
|
1830
|
-
children: /* @__PURE__ */ e.jsx(
|
|
1828
|
+
children: /* @__PURE__ */ e.jsx(He, {})
|
|
1831
1829
|
}
|
|
1832
1830
|
) }),
|
|
1833
|
-
/* @__PURE__ */ e.jsx(
|
|
1831
|
+
/* @__PURE__ */ e.jsx(Y, { children: /* @__PURE__ */ e.jsx("div", { className: "text-right", children: /* @__PURE__ */ e.jsxs("div", { children: [
|
|
1834
1832
|
"Current style is set at ",
|
|
1835
1833
|
/* @__PURE__ */ e.jsxs("span", { className: "font-bold", children: [
|
|
1836
|
-
|
|
1837
|
-
|
|
1834
|
+
vs(x(a, "mq")),
|
|
1835
|
+
i && !a.dark ? "(Light mode)" : ""
|
|
1838
1836
|
] }),
|
|
1839
1837
|
/* @__PURE__ */ e.jsx("br", {}),
|
|
1840
1838
|
/* @__PURE__ */ e.jsxs(
|
|
1841
1839
|
"button",
|
|
1842
1840
|
{
|
|
1843
1841
|
type: "button",
|
|
1844
|
-
onClick: () =>
|
|
1842
|
+
onClick: () => X(x(a, "mq")),
|
|
1845
1843
|
className: "block w-full cursor-default text-right font-semibold text-blue-500",
|
|
1846
1844
|
children: [
|
|
1847
1845
|
"Switch to ",
|
|
1848
|
-
x(
|
|
1846
|
+
x(a, "mq").toUpperCase()
|
|
1849
1847
|
]
|
|
1850
1848
|
}
|
|
1851
1849
|
)
|
|
@@ -1853,68 +1851,68 @@ const vs = (t) => {
|
|
|
1853
1851
|
] }) : null })
|
|
1854
1852
|
] })
|
|
1855
1853
|
] }) });
|
|
1856
|
-
},
|
|
1857
|
-
label:
|
|
1858
|
-
options:
|
|
1859
|
-
borderB:
|
|
1860
|
-
borderT:
|
|
1854
|
+
}, js = ["px", "%", "em", "rem", "ch", "vh", "vw"], ht = ({
|
|
1855
|
+
label: r,
|
|
1856
|
+
options: s,
|
|
1857
|
+
borderB: t = !1,
|
|
1858
|
+
borderT: d = !1,
|
|
1861
1859
|
type: l = "arbitrary",
|
|
1862
|
-
units:
|
|
1863
|
-
negative:
|
|
1860
|
+
units: n = js,
|
|
1861
|
+
negative: o = !1
|
|
1864
1862
|
}) => {
|
|
1865
|
-
const { t: p } =
|
|
1863
|
+
const { t: p } = z(), [i, c] = w(s[0].key), h = xe(), a = V((g) => k(h, "property").includes(g), [h]);
|
|
1866
1864
|
return /* @__PURE__ */ e.jsxs(
|
|
1867
1865
|
"div",
|
|
1868
1866
|
{
|
|
1869
|
-
className: `mb-2 border-gray-800 py-2 first:pt-0 last:pb-0 ${
|
|
1867
|
+
className: `mb-2 border-gray-800 py-2 first:pt-0 last:pb-0 ${t ? "border-b" : ""} ${d ? "border-t" : ""}`,
|
|
1870
1868
|
children: [
|
|
1871
1869
|
/* @__PURE__ */ e.jsxs("div", { className: "flex flex-row text-xs", children: [
|
|
1872
|
-
|
|
1873
|
-
/* @__PURE__ */ e.jsx("div", { className: "mb-3 flex grow flex-row flex-wrap gap-x-px", children:
|
|
1874
|
-
|
|
1875
|
-
/* @__PURE__ */ e.jsx(
|
|
1870
|
+
r && /* @__PURE__ */ e.jsx("span", { className: "relative w-[70px] flex-none text-xs text-foreground", children: p(r) }),
|
|
1871
|
+
/* @__PURE__ */ e.jsx("div", { className: "mb-3 flex grow flex-row flex-wrap gap-x-px", children: $.Children.toArray(
|
|
1872
|
+
s.map(({ label: g, key: y }) => /* @__PURE__ */ e.jsx("div", { className: "first:rounded-l last:rounded-r", children: /* @__PURE__ */ e.jsxs(O, { children: [
|
|
1873
|
+
/* @__PURE__ */ e.jsx(F, { asChild: !0, children: /* @__PURE__ */ e.jsxs(
|
|
1876
1874
|
"button",
|
|
1877
1875
|
{
|
|
1878
1876
|
type: "button",
|
|
1879
|
-
onClick: () =>
|
|
1880
|
-
className: `relative cursor-pointer rounded-full p-1 text-[8px] ${
|
|
1877
|
+
onClick: () => c(y),
|
|
1878
|
+
className: `relative cursor-pointer rounded-full p-1 text-[8px] ${y === i ? " bg-[#3E57F0] text-white" : "text-gray-600 dark:text-gray-300"}`,
|
|
1881
1879
|
children: [
|
|
1882
|
-
|
|
1883
|
-
className:
|
|
1880
|
+
$.createElement("div", {
|
|
1881
|
+
className: a(y) ? "-bottom-1.5 absolute bg-[#3E57F0] h-[2px] left-0 w-full" : ""
|
|
1884
1882
|
}),
|
|
1885
|
-
|
|
1883
|
+
$.createElement(x(ut, y, et), { className: "text-inherit w-3 h-3" })
|
|
1886
1884
|
]
|
|
1887
1885
|
}
|
|
1888
1886
|
) }),
|
|
1889
|
-
/* @__PURE__ */ e.jsx(
|
|
1887
|
+
/* @__PURE__ */ e.jsx(Y, { children: E(le(g)) })
|
|
1890
1888
|
] }) }))
|
|
1891
1889
|
) })
|
|
1892
1890
|
] }),
|
|
1893
1891
|
/* @__PURE__ */ e.jsx("div", { className: "mt-0 flex items-center", children: /* @__PURE__ */ e.jsx(
|
|
1894
|
-
|
|
1892
|
+
Ie,
|
|
1895
1893
|
{
|
|
1896
1894
|
type: l,
|
|
1897
|
-
units: [...
|
|
1895
|
+
units: [...n],
|
|
1898
1896
|
label: "",
|
|
1899
|
-
property:
|
|
1900
|
-
negative:
|
|
1897
|
+
property: i,
|
|
1898
|
+
negative: o
|
|
1901
1899
|
}
|
|
1902
1900
|
) })
|
|
1903
1901
|
]
|
|
1904
1902
|
}
|
|
1905
1903
|
);
|
|
1906
|
-
},
|
|
1907
|
-
const { t
|
|
1908
|
-
const
|
|
1909
|
-
|
|
1910
|
-
),
|
|
1911
|
-
|
|
1912
|
-
), p = k(
|
|
1913
|
-
return
|
|
1914
|
-
}, [
|
|
1904
|
+
}, ws = ({ heading: r, items: s }) => {
|
|
1905
|
+
const { t } = z(), d = xe(), l = _(() => {
|
|
1906
|
+
const n = (i) => q(
|
|
1907
|
+
i.map((c) => c.styleType === "multiple" ? k(c.options, "key") : c.property)
|
|
1908
|
+
), o = q(
|
|
1909
|
+
s.map((i) => i.styleType === "accordion" ? n(i.items) : i.styleType === "multiple" ? k(i.options, "key") : i.property)
|
|
1910
|
+
), p = k(d, "property");
|
|
1911
|
+
return Je(o, p).length > 0;
|
|
1912
|
+
}, [d, s]);
|
|
1915
1913
|
return /* @__PURE__ */ e.jsxs("details", { children: [
|
|
1916
1914
|
/* @__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: [
|
|
1917
|
-
r
|
|
1915
|
+
t(r),
|
|
1918
1916
|
l ? /* @__PURE__ */ e.jsx(
|
|
1919
1917
|
"span",
|
|
1920
1918
|
{
|
|
@@ -1922,201 +1920,91 @@ const vs = (t) => {
|
|
|
1922
1920
|
}
|
|
1923
1921
|
) : null
|
|
1924
1922
|
] }) }),
|
|
1925
|
-
/* @__PURE__ */ e.jsx("div", { className: "p-2", children:
|
|
1923
|
+
/* @__PURE__ */ e.jsx("div", { className: "p-2", children: s.map((n) => n.styleType === "multiple" ? /* @__PURE__ */ e.jsx(ht, { ...n }, n.label) : /* @__PURE__ */ e.jsx(Ie, { ...n }, n.label)) })
|
|
1926
1924
|
] });
|
|
1927
|
-
},
|
|
1928
|
-
const { t:
|
|
1929
|
-
(
|
|
1925
|
+
}, Cs = Ke({}), be = ({ section: r }) => {
|
|
1926
|
+
const { t: s } = z(), t = xe(), d = V(
|
|
1927
|
+
(o = []) => {
|
|
1930
1928
|
const p = {};
|
|
1931
|
-
for (let
|
|
1932
|
-
p[
|
|
1933
|
-
let
|
|
1934
|
-
for (const
|
|
1935
|
-
if (!
|
|
1936
|
-
|
|
1929
|
+
for (let c = 0; c < t.length; c++)
|
|
1930
|
+
p[t[c].property] = t[c].cls;
|
|
1931
|
+
let i = !0;
|
|
1932
|
+
for (const c in o)
|
|
1933
|
+
if (!ce(p, c) || p[c] !== o[c]) {
|
|
1934
|
+
i = !1;
|
|
1937
1935
|
break;
|
|
1938
1936
|
}
|
|
1939
|
-
return
|
|
1937
|
+
return i;
|
|
1940
1938
|
},
|
|
1941
|
-
[
|
|
1939
|
+
[t]
|
|
1942
1940
|
), l = _(() => {
|
|
1943
|
-
if (
|
|
1941
|
+
if (t.length > 0 && r.heading === "classes.heading")
|
|
1944
1942
|
return !0;
|
|
1945
|
-
const
|
|
1946
|
-
|
|
1947
|
-
), p =
|
|
1948
|
-
|
|
1949
|
-
),
|
|
1950
|
-
return
|
|
1951
|
-
}, [
|
|
1952
|
-
return /* @__PURE__ */ e.jsx(
|
|
1953
|
-
/* @__PURE__ */ e.jsx(
|
|
1943
|
+
const o = (c) => q(
|
|
1944
|
+
c.map((h) => h.styleType === "multiple" ? q(k(h.options, "key")) : h.property)
|
|
1945
|
+
), p = q(
|
|
1946
|
+
r.items.map((c) => c.styleType === "accordion" ? o(c.items) : c.styleType === "multiple" ? q(k(c.options, "key")) : c.property)
|
|
1947
|
+
), i = k(t, "property");
|
|
1948
|
+
return Je(p, i).length > 0;
|
|
1949
|
+
}, [t, r.heading, r.items]), n = _(() => ({}), []);
|
|
1950
|
+
return /* @__PURE__ */ e.jsx(Cs.Provider, { value: n, children: /* @__PURE__ */ e.jsxs(Ce, { value: r.heading, children: [
|
|
1951
|
+
/* @__PURE__ */ e.jsx(ke, { className: "px-3 py-2 text-xs hover:no-underline", children: /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-x-2", children: [
|
|
1954
1952
|
/* @__PURE__ */ e.jsx("div", { className: `h-[8px] w-[8px] rounded-full ${l ? "bg-blue-500" : "bg-gray-300"}` }),
|
|
1955
|
-
|
|
1953
|
+
s(r.heading)
|
|
1956
1954
|
] }) }),
|
|
1957
|
-
/* @__PURE__ */ e.jsx(
|
|
1958
|
-
|
|
1955
|
+
/* @__PURE__ */ e.jsx(Ne, { className: "bg-gray-100 px-3.5 py-2", children: $.Children.toArray(
|
|
1956
|
+
r.items.map((o) => ce(o, "component") ? $.createElement(o.component, { key: o.label }) : ce(o, "styleType") ? o.styleType === "multiple" ? /* @__PURE__ */ e.jsx(ht, { ...o }, o.label) : o.styleType === "accordion" && d(o == null ? void 0 : o.conditions) ? /* @__PURE__ */ e.jsx(ws, { ...o }, o.label) : null : /* @__PURE__ */ e.jsx(Ie, { ...o }, o.label))
|
|
1959
1957
|
) })
|
|
1960
1958
|
] }) });
|
|
1961
|
-
},
|
|
1962
|
-
|
|
1963
|
-
|
|
1964
|
-
canDelete: r,
|
|
1965
|
-
onChange: s,
|
|
1966
|
-
onRemove: l
|
|
1967
|
-
}) => /* @__PURE__ */ e.jsxs("div", { className: `flex flex-col gap-1 border-gray-400 py-2 ${r ? "border-b" : ""}`, children: [
|
|
1968
|
-
/* @__PURE__ */ e.jsx(
|
|
1969
|
-
"input",
|
|
1970
|
-
{
|
|
1971
|
-
name: "key",
|
|
1972
|
-
onChange: (i) => s(i, o),
|
|
1973
|
-
value: t.key,
|
|
1974
|
-
placeholder: "Key",
|
|
1975
|
-
className: "w-full rounded border-gray-300 bg-background p-0.5 pl-2 text-sm focus-visible:outline-0",
|
|
1976
|
-
autoComplete: "off",
|
|
1977
|
-
autoCapitalize: "off"
|
|
1978
|
-
}
|
|
1979
|
-
),
|
|
1980
|
-
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-x-1.5", children: [
|
|
1981
|
-
/* @__PURE__ */ e.jsx(
|
|
1982
|
-
"input",
|
|
1983
|
-
{
|
|
1984
|
-
name: "value",
|
|
1985
|
-
onChange: (i) => f(t.key) ? {} : s(i, o),
|
|
1986
|
-
value: t.value,
|
|
1987
|
-
placeholder: "Value",
|
|
1988
|
-
className: "w-full rounded border-gray-300 bg-background p-0.5 pl-2 text-sm focus-visible:outline-0",
|
|
1989
|
-
autoComplete: "off",
|
|
1990
|
-
autoCapitalize: "off"
|
|
1991
|
-
}
|
|
1992
|
-
),
|
|
1993
|
-
/* @__PURE__ */ e.jsx(
|
|
1994
|
-
Jt,
|
|
1995
|
-
{
|
|
1996
|
-
onClick: l,
|
|
1997
|
-
className: "h-6 w-6 cursor-pointer rounded border border-red-400 p-1 text-red-400 hover:opacity-80"
|
|
1998
|
-
}
|
|
1999
|
-
)
|
|
2000
|
-
] })
|
|
2001
|
-
] }), Ds = ({ section: t }) => {
|
|
2002
|
-
var y;
|
|
2003
|
-
const { setSyncState: o } = Tr(), r = U(), [s, l] = C([]), [i] = he(), a = at(), p = `${x(i, "0.prop")}_attrs`;
|
|
2004
|
-
de.useEffect(() => {
|
|
2005
|
-
const g = k(x(r, p), (u, b) => ({ key: b, value: u }));
|
|
2006
|
-
f(g) ? l([]) : l(g);
|
|
2007
|
-
}, [x(r, p)]);
|
|
2008
|
-
const n = () => l([...s, { key: "", value: "" }]), d = (g) => {
|
|
2009
|
-
const u = Ce(s, (b, j) => g !== j);
|
|
2010
|
-
c(u);
|
|
2011
|
-
}, h = (g, u) => {
|
|
2012
|
-
const b = [...s];
|
|
2013
|
-
b[u][g.target.name] = g.target.value, c(b);
|
|
2014
|
-
}, c = de.useCallback(
|
|
2015
|
-
(g = []) => {
|
|
2016
|
-
const u = {};
|
|
2017
|
-
_e(g, (b) => {
|
|
2018
|
-
f(b.key) || et(u, b.key, b.value);
|
|
2019
|
-
}), a([x(r, "_id")], { [p]: u }), o("UNSAVED");
|
|
2020
|
-
},
|
|
2021
|
-
[r, o, a, p]
|
|
2022
|
-
);
|
|
2023
|
-
return /* @__PURE__ */ e.jsxs(pe, { value: t.heading, children: [
|
|
2024
|
-
/* @__PURE__ */ e.jsx(ue, { className: "px-3 py-2 text-xs hover:no-underline", children: /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-x-2", children: [
|
|
2025
|
-
/* @__PURE__ */ e.jsx(
|
|
2026
|
-
"div",
|
|
2027
|
-
{
|
|
2028
|
-
className: `h-[8px] w-[8px] rounded-full ${f(x(r, p)) ? "bg-gray-300" : "bg-blue-500"}`
|
|
2029
|
-
}
|
|
2030
|
-
),
|
|
2031
|
-
"Attributes"
|
|
2032
|
-
] }) }),
|
|
2033
|
-
/* @__PURE__ */ e.jsx(xe, { 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: [
|
|
2034
|
-
/* @__PURE__ */ e.jsxs(Ve, { className: "mt-2 flex w-full items-center justify-between", children: [
|
|
2035
|
-
"Add Custom attributes",
|
|
2036
|
-
/* @__PURE__ */ e.jsxs(
|
|
2037
|
-
"div",
|
|
2038
|
-
{
|
|
2039
|
-
className: `flex h-6 w-max items-center justify-center gap-x-0.5 rounded-full border p-1 px-2 text-xs ${!f(s) && f((y = we(s)) == null ? void 0 : y.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"}`,
|
|
2040
|
-
onClick: () => {
|
|
2041
|
-
var g;
|
|
2042
|
-
!f(s) && f((g = we(s)) == null ? void 0 : g.key) || n();
|
|
2043
|
-
},
|
|
2044
|
-
children: [
|
|
2045
|
-
/* @__PURE__ */ e.jsx(Se, { width: 12, height: 12 }),
|
|
2046
|
-
" Add"
|
|
2047
|
-
]
|
|
2048
|
-
}
|
|
2049
|
-
)
|
|
2050
|
-
] }),
|
|
2051
|
-
/* @__PURE__ */ e.jsxs("div", { className: "flex flex-col", children: [
|
|
2052
|
-
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" }),
|
|
2053
|
-
de.Children.toArray(
|
|
2054
|
-
k(s, (g, u) => {
|
|
2055
|
-
const b = s.length > 0 && u < s.length - 1;
|
|
2056
|
-
return /* @__PURE__ */ e.jsx(
|
|
2057
|
-
Hs,
|
|
2058
|
-
{
|
|
2059
|
-
item: g,
|
|
2060
|
-
index: u,
|
|
2061
|
-
canDelete: b,
|
|
2062
|
-
onChange: h,
|
|
2063
|
-
onRemove: () => d(u)
|
|
2064
|
-
}
|
|
2065
|
-
);
|
|
2066
|
-
})
|
|
2067
|
-
)
|
|
2068
|
-
] })
|
|
2069
|
-
] }) })
|
|
2070
|
-
] });
|
|
2071
|
-
}, $s = () => {
|
|
2072
|
-
const t = U(), [o] = he(), { t: r } = W(), s = Xr(), l = Re(), i = De(t._type), a = Ye(rs(o), "prop"), p = Ye(i.props, `${a}.presets`, {});
|
|
2073
|
-
if (ie(s) && (!ss(i, "props") || ie(p)))
|
|
1959
|
+
}, ks = () => {
|
|
1960
|
+
const r = K(), [s] = ue(), { t } = z(), d = Lr(), l = De(), n = Pe(r._type), o = x(ae(s), "prop"), p = x(n.props, `${o}.presets`, {});
|
|
1961
|
+
if (b(d) && (!ce(n, "props") || b(p)))
|
|
2074
1962
|
return null;
|
|
2075
|
-
const
|
|
2076
|
-
const h =
|
|
2077
|
-
l([
|
|
1963
|
+
const i = (c) => {
|
|
1964
|
+
const h = c.trim().toLowerCase().replace(/ +(?= )/g, "").split(" ");
|
|
1965
|
+
l([r._id], h, !0);
|
|
2078
1966
|
};
|
|
2079
|
-
return /* @__PURE__ */ e.jsx("div", { className: "h-10", children: /* @__PURE__ */ e.jsxs(
|
|
2080
|
-
/* @__PURE__ */ e.jsx(
|
|
2081
|
-
|
|
2082
|
-
/* @__PURE__ */ e.jsx(
|
|
1967
|
+
return /* @__PURE__ */ e.jsx("div", { className: "h-10", children: /* @__PURE__ */ e.jsxs(Cr, { children: [
|
|
1968
|
+
/* @__PURE__ */ e.jsx(kr, { asChild: !0, children: /* @__PURE__ */ e.jsx("div", { className: "px-4", children: /* @__PURE__ */ e.jsxs(U, { variant: "default", className: "w-full", size: "sm", children: [
|
|
1969
|
+
t("Apply Presets"),
|
|
1970
|
+
/* @__PURE__ */ e.jsx(Gt, {})
|
|
2083
1971
|
] }) }) }),
|
|
2084
|
-
/* @__PURE__ */ e.jsx(
|
|
2085
|
-
|
|
2086
|
-
/* @__PURE__ */ e.jsxs(
|
|
2087
|
-
|
|
1972
|
+
/* @__PURE__ */ e.jsx(Nr, { className: "max-h-80 w-56", children: /* @__PURE__ */ e.jsxs(Be, { className: "no-scrollbar h-full", children: [
|
|
1973
|
+
b(p) ? null : /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
1974
|
+
/* @__PURE__ */ e.jsxs(Ee, { children: [
|
|
1975
|
+
n.type,
|
|
2088
1976
|
" ",
|
|
2089
|
-
|
|
1977
|
+
t("presets")
|
|
2090
1978
|
] }),
|
|
2091
|
-
/* @__PURE__ */ e.jsx(
|
|
2092
|
-
/* @__PURE__ */ e.jsx(
|
|
2093
|
-
|
|
2094
|
-
/* @__PURE__ */ e.jsx(
|
|
1979
|
+
/* @__PURE__ */ e.jsx(Le, {}),
|
|
1980
|
+
/* @__PURE__ */ e.jsx(Oe, { children: je(p).map((c) => /* @__PURE__ */ e.jsxs(Fe, { className: "group text-xs", onClick: () => i(p[c]), children: [
|
|
1981
|
+
we(E(t(c))),
|
|
1982
|
+
/* @__PURE__ */ e.jsx(Ye, { className: "invisible hover:font-bold hover:text-blue-600 group-hover:visible", children: t("apply") })
|
|
2095
1983
|
] })) })
|
|
2096
1984
|
] }),
|
|
2097
|
-
|
|
2098
|
-
/* @__PURE__ */ e.jsx(
|
|
2099
|
-
/* @__PURE__ */ e.jsx(
|
|
2100
|
-
/* @__PURE__ */ e.jsx(
|
|
2101
|
-
|
|
2102
|
-
/* @__PURE__ */ e.jsx(
|
|
1985
|
+
b(d) ? null : /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
1986
|
+
/* @__PURE__ */ e.jsx(Ee, { children: t("Global presets") }),
|
|
1987
|
+
/* @__PURE__ */ e.jsx(Le, {}),
|
|
1988
|
+
/* @__PURE__ */ e.jsx(Oe, { children: je(d).map((c) => /* @__PURE__ */ e.jsxs(Fe, { className: "group text-xs", onClick: () => i(d[c]), children: [
|
|
1989
|
+
we(E(t(c))),
|
|
1990
|
+
/* @__PURE__ */ e.jsx(Ye, { className: "invisible hover:font-bold hover:text-blue-600 group-hover:visible", children: t("apply") })
|
|
2103
1991
|
] })) })
|
|
2104
1992
|
] })
|
|
2105
1993
|
] }) })
|
|
2106
1994
|
] }) });
|
|
2107
1995
|
};
|
|
2108
|
-
function
|
|
2109
|
-
const [
|
|
2110
|
-
return
|
|
2111
|
-
/* @__PURE__ */ e.jsx(
|
|
1996
|
+
function Ns() {
|
|
1997
|
+
const [r, s] = it(), { flexChild: t, gridChild: d } = _r(), { t: l } = z(), [n] = ue();
|
|
1998
|
+
return b(n) ? /* @__PURE__ */ e.jsx("div", { className: "p-4 text-center", children: /* @__PURE__ */ e.jsxs("div", { className: "space-y-4 rounded-xl p-4", children: [
|
|
1999
|
+
/* @__PURE__ */ e.jsx(tt, { className: "mx-auto text-3xl" }),
|
|
2112
2000
|
/* @__PURE__ */ e.jsx("h1", { children: l("no_styling_block_selected") })
|
|
2113
2001
|
] }) }) : /* @__PURE__ */ e.jsxs("div", { className: "flex h-full flex-col", children: [
|
|
2114
|
-
/* @__PURE__ */ e.jsx(
|
|
2002
|
+
/* @__PURE__ */ e.jsx(ks, {}),
|
|
2115
2003
|
/* @__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: [
|
|
2116
|
-
/* @__PURE__ */ e.jsx(
|
|
2117
|
-
/* @__PURE__ */ e.jsxs(
|
|
2118
|
-
/* @__PURE__ */ e.jsx(
|
|
2119
|
-
/* @__PURE__ */ e.jsxs(
|
|
2004
|
+
/* @__PURE__ */ e.jsx(nt, { htmlFor: "", className: "flex gap-x-1.5 text-xs italic", children: "State" }),
|
|
2005
|
+
/* @__PURE__ */ e.jsxs(Tr, { defaultValue: r, onValueChange: (o) => s(o), children: [
|
|
2006
|
+
/* @__PURE__ */ e.jsx(Sr, { className: "h-auto w-fit p-1 px-3", children: /* @__PURE__ */ e.jsx(Rr, { placeholder: "State" }) }),
|
|
2007
|
+
/* @__PURE__ */ e.jsxs(Vr, { children: [
|
|
2120
2008
|
/* @__PURE__ */ e.jsx(H, { value: "", children: "Normal" }),
|
|
2121
2009
|
/* @__PURE__ */ e.jsx(H, { value: "hover", children: "Hover" }),
|
|
2122
2010
|
/* @__PURE__ */ e.jsx(H, { value: "active", children: "Active" }),
|
|
@@ -2132,19 +2020,126 @@ function Bs() {
|
|
|
2132
2020
|
] })
|
|
2133
2021
|
] })
|
|
2134
2022
|
] }) }),
|
|
2135
|
-
|
|
2136
|
-
/* @__PURE__ */ e.jsx(
|
|
2137
|
-
/* @__PURE__ */ e.jsx("span", { children: l(`Styles will be applied for (:${
|
|
2023
|
+
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: [
|
|
2024
|
+
/* @__PURE__ */ e.jsx(Ar, { className: "w-3" }),
|
|
2025
|
+
/* @__PURE__ */ e.jsx("span", { children: l(`Styles will be applied for (:${r}) state`) })
|
|
2138
2026
|
] }) : null,
|
|
2139
|
-
/* @__PURE__ */ e.jsx(
|
|
2140
|
-
|
|
2141
|
-
|
|
2142
|
-
|
|
2143
|
-
/* @__PURE__ */ e.jsx(Ds, { section: { heading: "Attributes" } })
|
|
2027
|
+
/* @__PURE__ */ e.jsx(Be, { className: "no-scrollbar -mx-1 max-h-full flex-1 overflow-x-hidden overflow-y-hidden border-t border-border", children: /* @__PURE__ */ e.jsxs(lt, { defaultValue: ["Layout"], type: "multiple", className: "w-full", children: [
|
|
2028
|
+
t && /* @__PURE__ */ e.jsx(be, { section: ls }),
|
|
2029
|
+
d ? /* @__PURE__ */ e.jsx(be, { section: os }) : null,
|
|
2030
|
+
as.map((o) => /* @__PURE__ */ e.jsx(be, { section: o }, o.heading))
|
|
2144
2031
|
] }) })
|
|
2145
2032
|
] });
|
|
2146
2033
|
}
|
|
2147
|
-
const
|
|
2034
|
+
const _s = ({ onAdd: r }) => {
|
|
2035
|
+
const { t: s } = z(), [t, d] = w({ key: "", value: "" }), l = () => {
|
|
2036
|
+
b(t.key) || (r({ ...t, key: Vt(t.key) }), d({ key: "", value: "" }));
|
|
2037
|
+
};
|
|
2038
|
+
return /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col gap-1 border-gray-200 px-1", children: [
|
|
2039
|
+
/* @__PURE__ */ e.jsx(
|
|
2040
|
+
_e,
|
|
2041
|
+
{
|
|
2042
|
+
name: "key",
|
|
2043
|
+
onChange: (n) => d({ ...t, key: n.target.value }),
|
|
2044
|
+
value: t.key,
|
|
2045
|
+
placeholder: s("Name"),
|
|
2046
|
+
autoComplete: "off",
|
|
2047
|
+
autoCapitalize: "off",
|
|
2048
|
+
onKeyDown: (n) => {
|
|
2049
|
+
n.key === "Enter" && (n.preventDefault(), b(t.key) || l());
|
|
2050
|
+
}
|
|
2051
|
+
}
|
|
2052
|
+
),
|
|
2053
|
+
/* @__PURE__ */ e.jsx("div", { className: "flex items-center gap-x-1.5", children: /* @__PURE__ */ e.jsx(
|
|
2054
|
+
_e,
|
|
2055
|
+
{
|
|
2056
|
+
name: "value",
|
|
2057
|
+
onChange: (n) => d({ ...t, value: n.target.value }),
|
|
2058
|
+
value: t.value,
|
|
2059
|
+
placeholder: s("Value"),
|
|
2060
|
+
autoComplete: "off",
|
|
2061
|
+
autoCapitalize: "off",
|
|
2062
|
+
onKeyDown: (n) => {
|
|
2063
|
+
n.key === "Enter" && (n.preventDefault(), b(t.key) || l());
|
|
2064
|
+
}
|
|
2065
|
+
}
|
|
2066
|
+
) }),
|
|
2067
|
+
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-x-2", children: [
|
|
2068
|
+
/* @__PURE__ */ e.jsxs(U, { disabled: b(t.key), onClick: l, size: "sm", className: "flex items-center", children: [
|
|
2069
|
+
/* @__PURE__ */ e.jsxs("span", { children: [
|
|
2070
|
+
s("Add"),
|
|
2071
|
+
" "
|
|
2072
|
+
] }),
|
|
2073
|
+
/* @__PURE__ */ e.jsx(Ve, {})
|
|
2074
|
+
] }),
|
|
2075
|
+
b(t.key) ? null : /* @__PURE__ */ e.jsx(U, { variant: "ghost", onClick: () => d({ key: "", value: "" }), children: s("Cancel") })
|
|
2076
|
+
] })
|
|
2077
|
+
] });
|
|
2078
|
+
}, Ts = () => {
|
|
2079
|
+
const r = K(), [s, t] = w([]), [d] = ue(), l = rt(), n = st(), { t: o } = z(), p = `${x(d, "0.prop")}_attrs`;
|
|
2080
|
+
de.useEffect(() => {
|
|
2081
|
+
const a = k(x(r, p), (g, y) => ({ key: y, value: g }));
|
|
2082
|
+
b(a) ? t([]) : t(a);
|
|
2083
|
+
}, [x(r, p)]);
|
|
2084
|
+
const i = (a) => {
|
|
2085
|
+
const g = ve(s, (y, u) => a !== u);
|
|
2086
|
+
h(g);
|
|
2087
|
+
}, c = (a) => {
|
|
2088
|
+
const g = [...s, a];
|
|
2089
|
+
h(g);
|
|
2090
|
+
}, h = de.useCallback(
|
|
2091
|
+
(a = []) => {
|
|
2092
|
+
const g = {};
|
|
2093
|
+
Re(a, (y) => {
|
|
2094
|
+
b(y.key) || Ge(g, y.key, y.value);
|
|
2095
|
+
}), n([x(r, "_id")], { [p]: g });
|
|
2096
|
+
},
|
|
2097
|
+
[r, l, p]
|
|
2098
|
+
);
|
|
2099
|
+
return /* @__PURE__ */ e.jsx("div", { className: "px-2", children: /* @__PURE__ */ e.jsx("div", { className: "no-scrollbar flex min-h-max flex-col gap-y-2 overflow-y-auto", children: /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col", children: [
|
|
2100
|
+
/* @__PURE__ */ e.jsx("div", { children: /* @__PURE__ */ e.jsxs("ul", { className: "overflow-hidden rounded-md bg-gray-100 p-2 text-xs text-gray-700", children: [
|
|
2101
|
+
b(s) ? /* @__PURE__ */ e.jsx("li", { className: "flex h-16 items-center justify-center", children: /* @__PURE__ */ e.jsx("p", { children: o("No custom attributes added yet") }) }) : /* @__PURE__ */ e.jsx("li", { children: /* @__PURE__ */ e.jsx("span", { className: "font-bold", children: o("Custom attributes") }) }),
|
|
2102
|
+
de.Children.toArray(
|
|
2103
|
+
k(s, (a) => /* @__PURE__ */ e.jsxs("li", { className: "group flex max-w-full items-center justify-between", children: [
|
|
2104
|
+
/* @__PURE__ */ e.jsxs(O, { delayDuration: 1e3, children: [
|
|
2105
|
+
/* @__PURE__ */ e.jsx(F, { asChild: !0, children: /* @__PURE__ */ e.jsxs("div", { className: "w-[90%] cursor-default truncate px-1 hover:bg-gray-200", children: [
|
|
2106
|
+
a.key,
|
|
2107
|
+
" ",
|
|
2108
|
+
/* @__PURE__ */ e.jsx("span", { className: "font-bold text-orange-500", children: "=" }),
|
|
2109
|
+
" ",
|
|
2110
|
+
a.value
|
|
2111
|
+
] }) }),
|
|
2112
|
+
/* @__PURE__ */ e.jsxs(Y, { className: "max-w-[200px]", children: [
|
|
2113
|
+
/* @__PURE__ */ e.jsxs("div", { children: [
|
|
2114
|
+
o("Name"),
|
|
2115
|
+
": ",
|
|
2116
|
+
a.key
|
|
2117
|
+
] }),
|
|
2118
|
+
/* @__PURE__ */ e.jsxs("div", { children: [
|
|
2119
|
+
o("Value"),
|
|
2120
|
+
": ",
|
|
2121
|
+
a.value
|
|
2122
|
+
] })
|
|
2123
|
+
] })
|
|
2124
|
+
] }),
|
|
2125
|
+
/* @__PURE__ */ e.jsxs(O, { children: [
|
|
2126
|
+
/* @__PURE__ */ e.jsx(F, { asChild: !0, children: /* @__PURE__ */ e.jsx(
|
|
2127
|
+
"button",
|
|
2128
|
+
{
|
|
2129
|
+
className: "invisible group-hover:visible",
|
|
2130
|
+
onClick: () => i(s.indexOf(a)),
|
|
2131
|
+
children: /* @__PURE__ */ e.jsx(Mr, { className: "w-4 text-gray-500" })
|
|
2132
|
+
}
|
|
2133
|
+
) }),
|
|
2134
|
+
/* @__PURE__ */ e.jsx(Y, { className: "max-w-[200px]", children: o("Remove attribute") })
|
|
2135
|
+
] })
|
|
2136
|
+
] }))
|
|
2137
|
+
)
|
|
2138
|
+
] }) }),
|
|
2139
|
+
/* @__PURE__ */ e.jsx("div", { className: "py-2" }),
|
|
2140
|
+
/* @__PURE__ */ e.jsx(_s, { onAdd: (a) => c(a) })
|
|
2141
|
+
] }) }) });
|
|
2142
|
+
}, Ss = {
|
|
2148
2143
|
px: 1,
|
|
2149
2144
|
"%": 1,
|
|
2150
2145
|
em: 100,
|
|
@@ -2155,32 +2150,32 @@ const Ps = {
|
|
|
2155
2150
|
"-": 1,
|
|
2156
2151
|
deg: 1,
|
|
2157
2152
|
ms: 0.1
|
|
2158
|
-
},
|
|
2159
|
-
const
|
|
2160
|
-
onDrag: (
|
|
2161
|
-
onDragEnd: (
|
|
2153
|
+
}, _l = () => {
|
|
2154
|
+
const r = K(), { t: s } = z(), [t, d] = $.useState(""), [l, n] = $.useState({
|
|
2155
|
+
onDrag: (i) => i,
|
|
2156
|
+
onDragEnd: (i) => i,
|
|
2162
2157
|
dragStartY: 0,
|
|
2163
2158
|
dragging: !1,
|
|
2164
2159
|
dragStartValue: 0,
|
|
2165
2160
|
dragUnit: "",
|
|
2166
2161
|
negative: !1,
|
|
2167
2162
|
cssProperty: ""
|
|
2168
|
-
}),
|
|
2169
|
-
(
|
|
2170
|
-
const
|
|
2171
|
-
let
|
|
2172
|
-
|
|
2173
|
-
let
|
|
2174
|
-
(G(h, "scale") || h === "opacity") && (
|
|
2175
|
-
let u = (l.dragStartY -
|
|
2176
|
-
|
|
2163
|
+
}), o = fe(
|
|
2164
|
+
(i) => {
|
|
2165
|
+
const c = !x(l, "negative", !1), h = x(l, "cssProperty", "");
|
|
2166
|
+
let a = parseFloat(l.dragStartValue);
|
|
2167
|
+
a = qe(a) ? 0 : a;
|
|
2168
|
+
let g = Ss[l.dragUnit];
|
|
2169
|
+
(G(h, "scale") || h === "opacity") && (g = 10);
|
|
2170
|
+
let u = (l.dragStartY - i.pageY) / g + a;
|
|
2171
|
+
c && u < 0 && (u = 0), h === "opacity" && u > 1 && (u = 1), l.onDrag(`${u}`), d(`${u}`);
|
|
2177
2172
|
},
|
|
2178
2173
|
[l],
|
|
2179
2174
|
50
|
|
2180
2175
|
), p = V(() => {
|
|
2181
|
-
setTimeout(() => l.onDragEnd(`${
|
|
2182
|
-
onDrag: (
|
|
2183
|
-
onDragEnd: (
|
|
2176
|
+
setTimeout(() => l.onDragEnd(`${t}`), 100), n({
|
|
2177
|
+
onDrag: (i) => i,
|
|
2178
|
+
onDragEnd: (i) => i,
|
|
2184
2179
|
dragStartY: 0,
|
|
2185
2180
|
dragging: !1,
|
|
2186
2181
|
dragStartValue: 0,
|
|
@@ -2188,29 +2183,31 @@ const Ps = {
|
|
|
2188
2183
|
negative: !1,
|
|
2189
2184
|
cssProperty: ""
|
|
2190
2185
|
});
|
|
2191
|
-
}, [l,
|
|
2192
|
-
return
|
|
2193
|
-
/* @__PURE__ */ e.jsx(
|
|
2194
|
-
/* @__PURE__ */ e.jsx("h1", { children:
|
|
2195
|
-
] }) }) : /* @__PURE__ */ e.jsx(
|
|
2186
|
+
}, [l, t, n]);
|
|
2187
|
+
return Ht(r) ? /* @__PURE__ */ e.jsx("div", { className: "p-4 text-center", children: /* @__PURE__ */ e.jsxs("div", { className: "space-y-4 rounded-xl p-4", children: [
|
|
2188
|
+
/* @__PURE__ */ e.jsx(tt, { className: "mx-auto text-3xl" }),
|
|
2189
|
+
/* @__PURE__ */ e.jsx("h1", { children: s("no_block_selected_for_styling") })
|
|
2190
|
+
] }) }) : /* @__PURE__ */ e.jsx(dt, { children: /* @__PURE__ */ e.jsxs(gt.Provider, { value: { setDragData: n }, children: [
|
|
2196
2191
|
l.dragging ? /* @__PURE__ */ e.jsx(
|
|
2197
2192
|
"div",
|
|
2198
2193
|
{
|
|
2199
|
-
onMouseMove:
|
|
2194
|
+
onMouseMove: o,
|
|
2200
2195
|
onMouseUp: () => p(),
|
|
2201
2196
|
className: "absolute inset-0 z-30 cursor-row-resize bg-gray-300/10"
|
|
2202
2197
|
}
|
|
2203
2198
|
) : null,
|
|
2204
|
-
/* @__PURE__ */ e.jsxs(
|
|
2205
|
-
/* @__PURE__ */ e.jsxs(
|
|
2206
|
-
/* @__PURE__ */ e.jsx(
|
|
2207
|
-
/* @__PURE__ */ e.jsx(
|
|
2199
|
+
/* @__PURE__ */ e.jsxs(Hr, { defaultValue: "settings", className: "flex h-full w-full flex-col py-1 text-xs", children: [
|
|
2200
|
+
/* @__PURE__ */ e.jsxs(Dr, { className: "mx-1 grid grid-cols-3", children: [
|
|
2201
|
+
/* @__PURE__ */ e.jsx(he, { value: "settings", children: s("settings") }),
|
|
2202
|
+
/* @__PURE__ */ e.jsx(he, { value: "styling", children: s("styling") }),
|
|
2203
|
+
/* @__PURE__ */ e.jsx(he, { value: "attrs", children: s("Attributes") })
|
|
2208
2204
|
] }),
|
|
2209
|
-
/* @__PURE__ */ e.jsx(
|
|
2210
|
-
/* @__PURE__ */ e.jsx(
|
|
2205
|
+
/* @__PURE__ */ e.jsx(ye, { value: "settings", className: "no-scrollbar h-full flex-1 overflow-y-auto overflow-x-hidden", children: /* @__PURE__ */ e.jsx(Be, { className: "no-scrollbar max-h-full flex-1 overflow-x-hidden overflow-y-hidden pb-5", children: /* @__PURE__ */ e.jsx(rs, {}) }) }),
|
|
2206
|
+
/* @__PURE__ */ e.jsx(ye, { value: "styling", className: "h-full flex-1 overflow-y-auto overflow-x-hidden", children: /* @__PURE__ */ e.jsx(Ns, {}) }),
|
|
2207
|
+
/* @__PURE__ */ e.jsx(ye, { value: "attrs", className: "h-full flex-1 overflow-y-auto overflow-x-hidden", children: /* @__PURE__ */ e.jsx(Ts, {}) })
|
|
2211
2208
|
] })
|
|
2212
2209
|
] }) });
|
|
2213
2210
|
};
|
|
2214
2211
|
export {
|
|
2215
|
-
|
|
2212
|
+
_l as default
|
|
2216
2213
|
};
|