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