@chaibuilder/sdk 1.2.49 → 1.2.51
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-JCSA6hLF.js → AddBlocks-LyEjf6h0.js} +18 -18
- package/dist/AddBlocks-hOFqmmXZ.cjs +1 -0
- package/dist/CanvasArea-luy5nUGR.cjs +56 -0
- package/dist/{CanvasArea-c3xbVSoY.js → CanvasArea-mhINqS0c.js} +279 -263
- package/dist/{ChaiBuilderEditor-lqHQcnh3.cjs → ChaiBuilderEditor-H173PF4T.cjs} +50 -50
- package/dist/{ChaiBuilderEditor-F2yUJQdt.js → ChaiBuilderEditor-KEwDa8Bl.js} +8553 -8619
- package/dist/CodeEditor-XaHQMfpT.js +97 -0
- package/dist/CodeEditor-jh9xwRXT.cjs +1 -0
- package/dist/CurrentPage-RUx7wvBt.cjs +1 -0
- package/dist/{CurrentPage--lDu6fB9.js → CurrentPage-UzajS1xZ.js} +10 -10
- package/dist/{ListTree-7DWSal1i.js → ListTree-BWBPjCzR.js} +6 -6
- package/dist/ListTree-S6pMJlmj.cjs +1 -0
- package/dist/{MODIFIERS-cBT31iqE.js → MODIFIERS-fd5XOmum.js} +8 -4
- package/dist/MODIFIERS-mVmfEGgo.cjs +1 -0
- package/dist/PagesPanel-LBW-4mVM.cjs +1 -0
- package/dist/{PagesPanel-D1TOGyVE.js → PagesPanel-p-h6o26u.js} +7 -7
- package/dist/ProjectPanel-PQv2uVj2.cjs +1 -0
- package/dist/{ProjectPanel-PdvQsrbk.js → ProjectPanel-o0OWWnYQ.js} +7 -7
- package/dist/Settings-DclX-cDC.cjs +1 -0
- package/dist/{Settings-aEcWAB0x.js → Settings-zm-cF9rZ.js} +466 -449
- package/dist/SidePanels-0w036NaZ.cjs +1 -0
- package/dist/{SidePanels-uym8wfA0.js → SidePanels-TOHaLWC6.js} +40 -40
- package/dist/ThemeConfiguration-MBuJmbDn.cjs +1 -0
- package/dist/{ThemeConfiguration-7J_Qt53c.js → ThemeConfiguration-wJA_aBly.js} +9 -9
- package/dist/{Topbar-DkbE0ccQ.js → Topbar-Rh7dWuJD.js} +8 -8
- package/dist/Topbar-u5HAh7Mg.cjs +1 -0
- package/dist/{UILibrariesPanel-3cSqwsMi.js → UILibrariesPanel-3-cWabRt.js} +8 -8
- package/dist/UILibrariesPanel-xOys8g8A.cjs +1 -0
- package/dist/UnsplashImages-Kymq8i6b.cjs +1 -0
- package/dist/{UnsplashImages-owPv8UfV.js → UnsplashImages-dhU2-pHY.js} +6 -6
- package/dist/UploadImages-WpaiIEbj.cjs +1 -0
- package/dist/{UploadImages-zGp0fN1z.js → UploadImages-dr_gpAea.js} +4 -4
- package/dist/add-page-modal-vmUMNu7F.cjs +1 -0
- package/dist/{add-page-modal-pOnhQNMH.js → add-page-modal-zwq1hL_o.js} +12 -12
- package/dist/{confirm-alert-lbkop3bB.js → confirm-alert-73tjkqtD.js} +4 -4
- package/dist/confirm-alert-fK62IiTF.cjs +1 -0
- package/dist/controls-rRZhz0vu.cjs +1 -0
- package/dist/{controls-VTdJhdSz.js → controls-yjgoZzB6.js} +31 -18
- package/dist/core.cjs +1 -1
- package/dist/core.js +6 -6
- package/dist/{delete-page-modal-3OWHRhV4.js → delete-page-modal-DPNxHWfi.js} +6 -6
- package/dist/delete-page-modal-G_aMq7K4.cjs +1 -0
- package/dist/email-blocks.cjs +1 -1
- package/dist/email-blocks.js +1 -1
- package/dist/email.cjs +1 -1
- package/dist/email.js +4 -4
- package/dist/{form-Rqiu0P7V.cjs → form-YMuxx9Ju.cjs} +1 -1
- package/dist/{form-CetbKOxf.js → form-_tKI6ugY.js} +5 -5
- package/dist/{functions-WB3m-mfN.js → functions-JO0EW8GX.js} +1 -1
- package/dist/functions-ZZVUnIjD.cjs +1 -0
- package/dist/html-to-json-9uiQ2Dp2.cjs +1 -0
- package/dist/html-to-json-ofq1N3tB.js +186 -0
- package/dist/index-9gfJqJ6E.cjs +1 -0
- package/dist/index-YpnaudSM.js +63 -0
- package/dist/index-ecnGWzh9.cjs +1 -0
- package/dist/{index-Mzvi8sMV.js → index-vpfLlP7N.js} +15 -14
- package/dist/lib.cjs +2 -2
- package/dist/lib.js +19 -20
- package/dist/{page-viewer-7iyxGntn.js → page-viewer-UZMtWQDj.js} +12 -12
- package/dist/page-viewer-WQgFhgp5.cjs +1 -0
- package/dist/project-general-setting-Yh4fQsQH.cjs +1 -0
- package/dist/{project-general-setting-tHdsXTwH.js → project-general-setting-Zz7qcIW7.js} +12 -12
- package/dist/project-seo-setting-_gNPOTsp.cjs +1 -0
- package/dist/{project-seo-setting-zEBZ91Xk.js → project-seo-setting-wFOVAoC2.js} +6 -6
- package/dist/render.cjs +1 -1
- package/dist/render.js +44 -45
- package/dist/{single-page-detail-RBfdbTs3.js → single-page-detail-1Vveonuh.js} +21 -21
- package/dist/single-page-detail-EMxzuAe1.cjs +1 -0
- package/dist/studio.cjs +1 -1
- package/dist/studio.js +6 -6
- package/dist/ui.cjs +1 -1
- package/dist/ui.js +100 -100
- package/dist/useCodeEditor-2KOfsFsx.js +7 -0
- package/dist/useCodeEditor-gE1NWoNH.cjs +1 -0
- package/dist/{utils-K3Zk762G.cjs → utils-D_vtk3zK.cjs} +1 -1
- package/dist/{utils-iMv3T4WT.js → utils-VpVqnC9m.js} +1 -1
- package/dist/web-blocks.cjs +1 -33
- package/dist/web-blocks.js +471 -619
- package/package.json +4 -2
- package/dist/AddBlocks-JiIeMTE-.cjs +0 -1
- package/dist/CanvasArea-K_d6ORTZ.cjs +0 -55
- package/dist/CurrentPage-DnQKF1wT.cjs +0 -1
- package/dist/ListTree-HVFqaM0-.cjs +0 -1
- package/dist/MODIFIERS-YPHRtwrM.cjs +0 -1
- package/dist/PagesPanel-pIFhxLGC.cjs +0 -1
- package/dist/ProjectPanel-t7s3-URx.cjs +0 -1
- package/dist/STRINGS--j49GZJP.js +0 -7
- package/dist/STRINGS-gPz7CUOk.cjs +0 -1
- package/dist/Settings-WevLeOpk.cjs +0 -1
- package/dist/SidePanels-mavyE3q_.cjs +0 -1
- package/dist/ThemeConfiguration-F-_ieF8J.cjs +0 -1
- package/dist/Topbar-FjX_5927.cjs +0 -1
- package/dist/UILibrariesPanel-qsjCsv10.cjs +0 -1
- package/dist/UnsplashImages-5skIflMr.cjs +0 -1
- package/dist/UploadImages-olCKp-66.cjs +0 -1
- package/dist/add-page-modal-JE2NTOKQ.cjs +0 -1
- package/dist/confirm-alert-GTawvuT8.cjs +0 -1
- package/dist/controls-jWJDao88.cjs +0 -1
- package/dist/delete-page-modal-S42VXCGh.cjs +0 -1
- package/dist/functions-fujiWLsg.cjs +0 -1
- package/dist/html-to-json-VPWiWWGH.cjs +0 -1
- package/dist/html-to-json-Z6R2o_fA.js +0 -221
- package/dist/index-SZn6KcOd.cjs +0 -1
- package/dist/page-viewer-fFmRhZs3.cjs +0 -1
- package/dist/project-general-setting-0HJ_qyW3.cjs +0 -1
- package/dist/project-seo-setting-Ln9aX7b5.cjs +0 -1
- package/dist/single-page-detail-H0heOB33.cjs +0 -1
- package/dist/useCanvasSettings-2YhM5XKu.js +0 -6
- package/dist/useCanvasSettings-tDzAqXUt.cjs +0 -1
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
import { j as e } from "./jsx-runtime-WbnYoNE9.js";
|
|
2
2
|
import * as ne from "react";
|
|
3
|
-
import
|
|
3
|
+
import P, { useState as w, useMemo as T, useEffect as A, useCallback as H, memo as bt, useRef as mt, createContext as Fe, useContext as se } from "react";
|
|
4
4
|
import { useThrottledCallback as de } from "@react-hookz/web";
|
|
5
|
-
import { forEach as Ne, isArray as ce, omit as
|
|
6
|
-
import { useTranslation as
|
|
7
|
-
import { CopyIcon as
|
|
8
|
-
import {
|
|
5
|
+
import { forEach as Ne, isArray as ce, omit as ft, truncate as vt, includes as X, get as y, first as oe, split as wt, startCase as F, toLower as re, isEmpty as m, map as _, find as Ze, last as jt, filter as ye, set as We, debounce as Ct, keys as he, cloneDeep as kt, each as Nt, capitalize as be, reject as _t, startsWith as W, nth as He, isNumber as St, parseInt as Tt, isNaN as Ue, findLast as Rt, flatten as De, intersection as Vt, has as ie, isNull as Ht } from "lodash-es";
|
|
6
|
+
import { useTranslation as I } from "react-i18next";
|
|
7
|
+
import { CopyIcon as Dt, PlusIcon as _e, Cross2Icon as Ke, EyeOpenIcon as Bt, EyeClosedIcon as Be, BorderAllIcon as Y, WidthIcon as R, HeightIcon as V, ArrowUpIcon as J, ArrowRightIcon as Q, ArrowDownIcon as ee, ArrowLeftIcon as te, ArrowTopLeftIcon as It, ArrowTopRightIcon as Pt, ArrowBottomRightIcon as At, ArrowBottomLeftIcon as $t, AlignLeftIcon as Et, AlignCenterHorizontallyIcon as Mt, AlignRightIcon as Lt, StretchHorizontallyIcon as Ot, FontItalicIcon as zt, UnderlineIcon as Yt, OverlineIcon as Xt, LetterCaseUppercaseIcon as Ft, Cross1Icon as Zt, InfoCircledIcon as Se, MinusIcon as Wt, BoxIcon as Ge, RowSpacingIcon as Ut, TriangleDownIcon as Kt, CrossCircledIcon as Gt, CaretDownIcon as qt, MixerHorizontalIcon as Jt } from "@radix-ui/react-icons";
|
|
8
|
+
import { a1 as qe, aP as Je, aQ as Qe, B, aR as et, aS as Qt, aT as er, aU as tr, aV as rr, aW as sr, aX as or, L as U, aK as tt, _ as lr, $ as ar, a0 as nr, aY as ir, Y as dr, aa as cr, Z as pr, ab as $, ac as E, ad as M, aZ as ur, a_ as gr, a$ as xr, b0 as yr, b1 as hr, b2 as br, b3 as mr, Q as rt, P as st, h as ot, b4 as fr, b5 as lt, b6 as me, b7 as fe, b8 as ve, b9 as vr, ba as wr, ag as jr, bb as Cr, X as pe, n as Te, H as at, K as nt, bc as it, bd as we, j as kr, be as Nr, I as ue, v as _r, O as Sr, o as Ie, au as Tr, av as Rr, aw as Vr, bf as dt, ax as Pe, ay as Ae, bg as $e, bh as Ee, bi as Me, R as Hr } from "./ChaiBuilderEditor-KEwDa8Bl.js";
|
|
9
9
|
import { Check as Dr, EditIcon as Br, TrashIcon as Ir, Loader as Pr, SparklesIcon as Ar, DeleteIcon as $r } from "lucide-react";
|
|
10
|
-
import { getBlockComponent as Re, getChaiDataProviders as
|
|
10
|
+
import { getBlockComponent as Re, getChaiDataProviders as Er, useGlobalStylingPresets as Mr } from "@chaibuilder/runtime";
|
|
11
11
|
import { J as Lr, a as Or, d as zr } from "./index-e0c8PmRQ.js";
|
|
12
12
|
import Yr from "@rjsf/core";
|
|
13
|
-
import
|
|
14
|
-
import { u as
|
|
15
|
-
import
|
|
16
|
-
import
|
|
17
|
-
import { A as
|
|
18
|
-
import { a as
|
|
13
|
+
import Xr from "@rjsf/validator-ajv8";
|
|
14
|
+
import { a as Fr, u as Zr } from "./useCodeEditor-2KOfsFsx.js";
|
|
15
|
+
import Wr from "react-autosuggest";
|
|
16
|
+
import Ur from "fuse.js";
|
|
17
|
+
import { A as Kr, C as ge, g as Gr } from "./utils-VpVqnC9m.js";
|
|
18
|
+
import { a as qr } from "./MODIFIERS-fd5XOmum.js";
|
|
19
19
|
import "./_commonjsHelpers-UyOWmZb0.js";
|
|
20
20
|
import "clsx";
|
|
21
21
|
import "react-dom";
|
|
@@ -26,7 +26,6 @@ import "i18next";
|
|
|
26
26
|
import "flagged";
|
|
27
27
|
import "./Functions-7jnEwJyw.js";
|
|
28
28
|
import "tailwind-merge";
|
|
29
|
-
import "./MODIFIERS-cBT31iqE.js";
|
|
30
29
|
import "tree-model";
|
|
31
30
|
import "@radix-ui/react-toggle";
|
|
32
31
|
import "class-variance-authority";
|
|
@@ -50,23 +49,24 @@ import "@radix-ui/react-context-menu";
|
|
|
50
49
|
import "react-icons-picker";
|
|
51
50
|
import "react-quill";
|
|
52
51
|
import "react-hotkeys-hook";
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
52
|
+
import "./index-YpnaudSM.js";
|
|
53
|
+
function Jr(r) {
|
|
54
|
+
const o = [], t = {};
|
|
55
|
+
function a(l, s) {
|
|
56
56
|
Ne(s, (d, c) => {
|
|
57
|
-
const
|
|
58
|
-
|
|
57
|
+
const n = l ? `${l}.${c}` : c, p = ce(d) ? "list" : typeof d;
|
|
58
|
+
o.push(n), t[n] = p === "string" ? "text" : p === "object" ? "model" : p, p === "object" && !ce(d) && a(n, d);
|
|
59
59
|
});
|
|
60
60
|
}
|
|
61
|
-
return
|
|
61
|
+
return a("", ft(r, ["styles", "_type", "_id", "_name", "_bindings"])), { paths: o, pathsType: t };
|
|
62
62
|
}
|
|
63
|
-
const
|
|
63
|
+
const je = ({ data: r, fullView: o }) => {
|
|
64
64
|
if (!r)
|
|
65
65
|
return null;
|
|
66
66
|
const t = typeof r;
|
|
67
|
-
return
|
|
67
|
+
return o ? typeof r == "object" ? /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
68
68
|
/* @__PURE__ */ e.jsx("div", { className: "h-3" }),
|
|
69
|
-
/* @__PURE__ */ e.jsx(
|
|
69
|
+
/* @__PURE__ */ e.jsx(qe, { children: /* @__PURE__ */ e.jsx(
|
|
70
70
|
Lr,
|
|
71
71
|
{
|
|
72
72
|
data: r,
|
|
@@ -82,49 +82,49 @@ const we = ({ data: r, fullView: a }) => {
|
|
|
82
82
|
] }) : /* @__PURE__ */ e.jsxs("div", { className: "max-h-36 w-full overflow-y-auto overflow-x-hidden text-[12px] leading-4 text-gray-800/50", children: [
|
|
83
83
|
/* @__PURE__ */ e.jsx("span", { className: "font-medium text-gray-800/80", children: "Content: " }),
|
|
84
84
|
r
|
|
85
|
-
] }) : /* @__PURE__ */ e.jsx("div", { className: "w-full overflow-hidden whitespace-nowrap text-[10px] leading-3 text-gray-800/50", children:
|
|
85
|
+
] }) : /* @__PURE__ */ e.jsx("div", { className: "w-full overflow-hidden whitespace-nowrap text-[10px] leading-3 text-gray-800/50", children: vt(t === "object" ? JSON.stringify(r) : r, { length: 40 }) });
|
|
86
86
|
}, Le = ({
|
|
87
87
|
type: r,
|
|
88
|
-
value:
|
|
88
|
+
value: o = "",
|
|
89
89
|
setValue: t,
|
|
90
|
-
data:
|
|
90
|
+
data: a,
|
|
91
91
|
onChange: l,
|
|
92
92
|
dataType: s,
|
|
93
93
|
appliedBindings: d
|
|
94
94
|
}) => {
|
|
95
|
-
const { paths: c, pathsType:
|
|
96
|
-
(g) => !
|
|
97
|
-
) : c.filter((g) => s === y(
|
|
98
|
-
return
|
|
99
|
-
|
|
100
|
-
}, [
|
|
95
|
+
const { paths: c, pathsType: n } = Jr(a), p = r === "PROP" ? Re(a == null ? void 0 : a._type) : {}, h = r === "PROP", [i, u] = w(!1), x = T(() => r === "PROP" ? c.filter(
|
|
96
|
+
(g) => !X(d, g) && y(p, `props.${oe(wt(g, "."))}.binding`)
|
|
97
|
+
) : c.filter((g) => s === y(n, g, "")), [r, c, d, s, p]);
|
|
98
|
+
return A(() => {
|
|
99
|
+
o && l(o);
|
|
100
|
+
}, [o, r]), /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
101
101
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-4", children: [
|
|
102
|
-
/* @__PURE__ */ e.jsx("p", { className: "text-sm text-muted-foreground", children:
|
|
103
|
-
/* @__PURE__ */ e.jsxs(
|
|
104
|
-
/* @__PURE__ */ e.jsx(
|
|
105
|
-
|
|
102
|
+
/* @__PURE__ */ e.jsx("p", { className: "text-sm text-muted-foreground", children: F(re(r)) }),
|
|
103
|
+
/* @__PURE__ */ e.jsxs(Je, { open: i, onOpenChange: u, children: [
|
|
104
|
+
/* @__PURE__ */ e.jsx(Qe, { asChild: !0, children: /* @__PURE__ */ e.jsx(
|
|
105
|
+
B,
|
|
106
106
|
{
|
|
107
107
|
variant: "outline",
|
|
108
108
|
size: "sm",
|
|
109
|
-
className: ` ${m(
|
|
110
|
-
children:
|
|
109
|
+
className: ` ${m(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"}`,
|
|
110
|
+
children: o ? /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
111
111
|
/* @__PURE__ */ e.jsxs("span", { className: "pr-8 text-sm", children: [
|
|
112
|
-
h && /* @__PURE__ */ e.jsx("span", { className: "mr-2 rounded-full bg-purple-100 px-2 py-0.5 text-[10px] text-purple-500", children:
|
|
113
|
-
|
|
112
|
+
h && /* @__PURE__ */ e.jsx("span", { className: "mr-2 rounded-full bg-purple-100 px-2 py-0.5 text-[10px] text-purple-500", children: F(s) }),
|
|
113
|
+
o
|
|
114
114
|
] }),
|
|
115
115
|
/* @__PURE__ */ e.jsx("span", { className: "cursor-pointer text-[9px] text-blue-400 underline hover:text-blue-700", children: "Change" })
|
|
116
116
|
] }) : /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
117
117
|
"+ Set ",
|
|
118
|
-
|
|
118
|
+
F(re(r))
|
|
119
119
|
] })
|
|
120
120
|
}
|
|
121
121
|
) }),
|
|
122
|
-
/* @__PURE__ */ e.jsx(
|
|
122
|
+
/* @__PURE__ */ e.jsx(et, { className: "z-[999] min-w-[300px] p-0", side: "right", align: "start", children: /* @__PURE__ */ e.jsxs(Qt, { children: [
|
|
123
123
|
/* @__PURE__ */ e.jsx(er, { placeholder: `Choose ${re(r)}...` }),
|
|
124
124
|
/* @__PURE__ */ e.jsxs(tr, { children: [
|
|
125
125
|
/* @__PURE__ */ e.jsx(rr, { children: "No results found." }),
|
|
126
126
|
/* @__PURE__ */ e.jsx(sr, { children: _(x, (g) => /* @__PURE__ */ e.jsxs(
|
|
127
|
-
|
|
127
|
+
or,
|
|
128
128
|
{
|
|
129
129
|
value: g,
|
|
130
130
|
className: `cursor-pointer ${h ? "flex items-center justify-between" : "flex flex-col items-start justify-start"}`,
|
|
@@ -133,10 +133,10 @@ const we = ({ data: r, fullView: a }) => {
|
|
|
133
133
|
},
|
|
134
134
|
children: [
|
|
135
135
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-x-2", children: [
|
|
136
|
-
/* @__PURE__ */ e.jsx(Dr, { className: `h-4 w-4 text-green-500 ${
|
|
136
|
+
/* @__PURE__ */ e.jsx(Dr, { className: `h-4 w-4 text-green-500 ${o === g ? "" : "opacity-0"}` }),
|
|
137
137
|
g
|
|
138
138
|
] }),
|
|
139
|
-
h ? /* @__PURE__ */ e.jsx("div", { children: /* @__PURE__ */ e.jsx("span", { className: "rounded-full bg-purple-100 px-2 py-0.5 text-[10px] text-purple-500", children:
|
|
139
|
+
h ? /* @__PURE__ */ e.jsx("div", { children: /* @__PURE__ */ e.jsx("span", { className: "rounded-full bg-purple-100 px-2 py-0.5 text-[10px] text-purple-500", children: F(y(n, g, "")) }) }) : /* @__PURE__ */ e.jsx("div", { className: "pl-6", children: /* @__PURE__ */ e.jsx(je, { data: y(a, g) }) })
|
|
140
140
|
]
|
|
141
141
|
},
|
|
142
142
|
g
|
|
@@ -145,31 +145,31 @@ const we = ({ data: r, fullView: a }) => {
|
|
|
145
145
|
] }) })
|
|
146
146
|
] })
|
|
147
147
|
] }),
|
|
148
|
-
!h && !m(
|
|
148
|
+
!h && !m(o) && /* @__PURE__ */ e.jsx("div", { className: "pt-2", children: /* @__PURE__ */ e.jsx(je, { data: y(a, o, ""), fullView: !0 }) })
|
|
149
149
|
] });
|
|
150
|
-
},
|
|
150
|
+
}, Qr = ({
|
|
151
151
|
appliedBindings: r = [],
|
|
152
|
-
onAddBinding:
|
|
152
|
+
onAddBinding: o,
|
|
153
153
|
editMode: t,
|
|
154
|
-
item:
|
|
154
|
+
item: a
|
|
155
155
|
}) => {
|
|
156
|
-
const [l, s] =
|
|
156
|
+
const [l, s] = w(t ? a.key : ""), [d, c] = w(t ? a.value : ""), n = U(), [p] = tt(), h = H(
|
|
157
157
|
(x, g) => {
|
|
158
158
|
if (m(x))
|
|
159
159
|
return "";
|
|
160
160
|
{
|
|
161
|
-
const v = y(g === "PROP" ?
|
|
161
|
+
const v = y(g === "PROP" ? n : p, x, "");
|
|
162
162
|
if (ce(v))
|
|
163
163
|
return "list";
|
|
164
164
|
const C = typeof v;
|
|
165
165
|
return C === "string" ? "text" : C === "object" ? "model" : C;
|
|
166
166
|
}
|
|
167
167
|
},
|
|
168
|
-
[
|
|
169
|
-
), [i, u] =
|
|
168
|
+
[n, p]
|
|
169
|
+
), [i, u] = w(t ? h(a.key, "PROP") : "");
|
|
170
170
|
return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
171
171
|
/* @__PURE__ */ e.jsxs(lr, { children: [
|
|
172
|
-
/* @__PURE__ */ e.jsx(
|
|
172
|
+
/* @__PURE__ */ e.jsx(ar, { children: "Add Data Binding" }),
|
|
173
173
|
/* @__PURE__ */ e.jsx(nr, { className: "text-xs", children: "Add prop and path of binding. Click save when you're done." })
|
|
174
174
|
] }),
|
|
175
175
|
/* @__PURE__ */ e.jsxs("div", { className: "relative flex flex-col gap-1", children: [
|
|
@@ -185,7 +185,7 @@ const we = ({ data: r, fullView: a }) => {
|
|
|
185
185
|
const g = h(x, "PROP");
|
|
186
186
|
s(x), i !== g && c(""), u(g);
|
|
187
187
|
},
|
|
188
|
-
data:
|
|
188
|
+
data: n,
|
|
189
189
|
dataType: i,
|
|
190
190
|
appliedBindings: r
|
|
191
191
|
}
|
|
@@ -210,57 +210,57 @@ const we = ({ data: r, fullView: a }) => {
|
|
|
210
210
|
)
|
|
211
211
|
] }),
|
|
212
212
|
/* @__PURE__ */ e.jsx(ir, { children: /* @__PURE__ */ e.jsx(
|
|
213
|
-
|
|
213
|
+
B,
|
|
214
214
|
{
|
|
215
215
|
type: "submit",
|
|
216
216
|
className: "mt-4",
|
|
217
217
|
disabled: m(l) && m(d),
|
|
218
|
-
onClick: () =>
|
|
218
|
+
onClick: () => o({ key: l, value: d }),
|
|
219
219
|
children: "Save"
|
|
220
220
|
}
|
|
221
221
|
) })
|
|
222
222
|
] });
|
|
223
|
-
},
|
|
224
|
-
const [d, c] =
|
|
223
|
+
}, ct = ({ disabled: r, children: o, onAddBinding: t, appliedBindings: a, editMode: l = !0, item: s = {} }) => {
|
|
224
|
+
const [d, c] = w(!1);
|
|
225
225
|
return /* @__PURE__ */ e.jsxs(dr, { children: [
|
|
226
|
-
/* @__PURE__ */ e.jsx(cr, { disabled: r, asChild: !0, onClick: () => c(!0), children:
|
|
226
|
+
/* @__PURE__ */ e.jsx(cr, { disabled: r, asChild: !0, onClick: () => c(!0), children: o }),
|
|
227
227
|
d && /* @__PURE__ */ e.jsx(pr, { children: /* @__PURE__ */ e.jsx(
|
|
228
|
-
|
|
228
|
+
Qr,
|
|
229
229
|
{
|
|
230
230
|
item: s,
|
|
231
231
|
editMode: l,
|
|
232
|
-
appliedBindings:
|
|
233
|
-
onAddBinding: (
|
|
234
|
-
t(
|
|
232
|
+
appliedBindings: a,
|
|
233
|
+
onAddBinding: (n) => {
|
|
234
|
+
t(n), c(!1);
|
|
235
235
|
}
|
|
236
236
|
}
|
|
237
237
|
) })
|
|
238
238
|
] });
|
|
239
|
-
},
|
|
239
|
+
}, es = ({
|
|
240
240
|
item: r,
|
|
241
|
-
onAddBinding:
|
|
241
|
+
onAddBinding: o,
|
|
242
242
|
onRemove: t,
|
|
243
|
-
selectedBlock:
|
|
243
|
+
selectedBlock: a,
|
|
244
244
|
dataProvider: l,
|
|
245
245
|
appliedBindings: s
|
|
246
246
|
}) => {
|
|
247
|
-
const [d, c] =
|
|
247
|
+
const [d, c] = w("string"), n = (p, h) => {
|
|
248
248
|
if (m(p))
|
|
249
249
|
return "";
|
|
250
250
|
{
|
|
251
|
-
const i = y(h === "PROP" ?
|
|
251
|
+
const i = y(h === "PROP" ? a : l, p, "");
|
|
252
252
|
if (ce(i))
|
|
253
253
|
return "list";
|
|
254
254
|
const u = typeof i;
|
|
255
255
|
return u === "string" ? "text" : u === "object" ? "model" : u;
|
|
256
256
|
}
|
|
257
257
|
};
|
|
258
|
-
return
|
|
258
|
+
return A(() => c(() => n(r.key, "PROP")), [r.key]), /* @__PURE__ */ e.jsxs("div", { className: "relative flex flex-col rounded-md border border-gray-200 p-2", children: [
|
|
259
259
|
/* @__PURE__ */ e.jsx("div", { className: "text-sm font-normal text-gray-500", children: r.key }),
|
|
260
260
|
/* @__PURE__ */ e.jsx("div", { className: "font-medium leading-5", children: r.value }),
|
|
261
|
-
/* @__PURE__ */ e.jsx(
|
|
261
|
+
/* @__PURE__ */ e.jsx(je, { data: y(l, r.value, "") }),
|
|
262
262
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center justify-end gap-x-2", children: [
|
|
263
|
-
/* @__PURE__ */ e.jsx(
|
|
263
|
+
/* @__PURE__ */ e.jsx(ct, { editMode: !0, onAddBinding: o, appliedBindings: s, item: r, children: /* @__PURE__ */ e.jsx(Br, { 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" }) }),
|
|
264
264
|
/* @__PURE__ */ e.jsx(
|
|
265
265
|
Ir,
|
|
266
266
|
{
|
|
@@ -269,23 +269,23 @@ const we = ({ data: r, fullView: a }) => {
|
|
|
269
269
|
}
|
|
270
270
|
)
|
|
271
271
|
] }),
|
|
272
|
-
!m(d) && !m(r.key) && /* @__PURE__ */ e.jsx("div", { className: "absolute right-0 top-1 mt-px flex h-4 items-center rounded-full px-2 text-[10px] font-medium text-purple-600", children:
|
|
272
|
+
!m(d) && !m(r.key) && /* @__PURE__ */ e.jsx("div", { className: "absolute right-0 top-1 mt-px flex h-4 items-center rounded-full px-2 text-[10px] font-medium text-purple-600", children: F(d) })
|
|
273
273
|
] });
|
|
274
|
-
},
|
|
275
|
-
const t =
|
|
274
|
+
}, ts = ({ bindingData: r, onChange: o }) => {
|
|
275
|
+
const t = U(), [a] = tt(), l = Er(), [s, d] = w(
|
|
276
276
|
_(r, (i, u) => ({ key: u, value: i }))
|
|
277
277
|
);
|
|
278
|
-
|
|
278
|
+
A(() => {
|
|
279
279
|
d(_(r, (i, u) => ({ key: u, value: i })));
|
|
280
280
|
}, [t == null ? void 0 : t._id, r]);
|
|
281
281
|
const c = T(() => {
|
|
282
|
-
if (m(
|
|
282
|
+
if (m(a))
|
|
283
283
|
return !0;
|
|
284
284
|
if (m(s))
|
|
285
285
|
return !1;
|
|
286
|
-
const i =
|
|
286
|
+
const i = jt(s);
|
|
287
287
|
return m(i == null ? void 0 : i.key) || m(i == null ? void 0 : i.value);
|
|
288
|
-
}, [
|
|
288
|
+
}, [a, s]), n = (i) => {
|
|
289
289
|
const u = ye(s, (x) => x.key !== i.key);
|
|
290
290
|
d([...u, i]), h([...u, i]);
|
|
291
291
|
}, p = (i) => {
|
|
@@ -294,15 +294,15 @@ const we = ({ data: r, fullView: a }) => {
|
|
|
294
294
|
}, h = H(
|
|
295
295
|
(i = []) => {
|
|
296
296
|
if (d(i), m(i)) {
|
|
297
|
-
|
|
297
|
+
o({});
|
|
298
298
|
return;
|
|
299
299
|
}
|
|
300
300
|
const u = {};
|
|
301
301
|
Ne(i, (x) => {
|
|
302
302
|
!m(x == null ? void 0 : x.key) && !m(x == null ? void 0 : x.value) && We(u, x.key, x.value);
|
|
303
|
-
}),
|
|
303
|
+
}), o(u);
|
|
304
304
|
},
|
|
305
|
-
[
|
|
305
|
+
[o]
|
|
306
306
|
);
|
|
307
307
|
return m(l) ? /* @__PURE__ */ e.jsx("div", { className: "flex w-full items-center justify-center", children: /* @__PURE__ */ e.jsxs("p", { className: "mb-1.5 text-xs text-gray-500", children: [
|
|
308
308
|
"You have no data providers registered. Please add a data provider to your project. ",
|
|
@@ -310,52 +310,71 @@ const we = ({ data: r, fullView: a }) => {
|
|
|
310
310
|
/* @__PURE__ */ e.jsx("a", { className: "text-blue-500", href: "https://chaibuilder.com/docs/registering-data-providers", target: "_blank", children: "Learn more" })
|
|
311
311
|
] }) }) : /* @__PURE__ */ e.jsxs("div", { className: "space-y-2", children: [
|
|
312
312
|
_(s, (i, u) => /* @__PURE__ */ e.jsx(
|
|
313
|
-
|
|
313
|
+
es,
|
|
314
314
|
{
|
|
315
315
|
item: i,
|
|
316
|
-
onAddBinding:
|
|
316
|
+
onAddBinding: n,
|
|
317
317
|
onRemove: () => p(u),
|
|
318
318
|
selectedBlock: t,
|
|
319
|
-
dataProvider:
|
|
319
|
+
dataProvider: a,
|
|
320
320
|
appliedBindings: _(s, "key")
|
|
321
321
|
},
|
|
322
322
|
i.key
|
|
323
323
|
)),
|
|
324
324
|
/* @__PURE__ */ e.jsxs($, { delayDuration: 200, children: [
|
|
325
|
-
/* @__PURE__ */ e.jsx(
|
|
326
|
-
|
|
325
|
+
/* @__PURE__ */ e.jsx(E, { disabled: m(a), className: "w-full", children: /* @__PURE__ */ e.jsx(
|
|
326
|
+
ct,
|
|
327
327
|
{
|
|
328
328
|
disabled: c,
|
|
329
329
|
appliedBindings: _(s, "key"),
|
|
330
|
-
onAddBinding:
|
|
330
|
+
onAddBinding: n,
|
|
331
331
|
children: /* @__PURE__ */ e.jsx(
|
|
332
332
|
"span",
|
|
333
333
|
{
|
|
334
334
|
className: `w-full rounded-md px-5 py-1.5 text-xs font-medium duration-200 ${c ? "cursor-not-allowed bg-gray-200 text-gray-400" : "bg-blue-700/20 text-blue-800 hover:bg-blue-700/30"}`,
|
|
335
|
-
children: m(
|
|
335
|
+
children: m(a) ? /* @__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"
|
|
336
336
|
}
|
|
337
337
|
)
|
|
338
338
|
}
|
|
339
339
|
) }),
|
|
340
|
-
c && /* @__PURE__ */ e.jsx(
|
|
340
|
+
c && /* @__PURE__ */ e.jsx(M, { sideOffset: -55, className: "text-[11px]", children: m(a) ? "No data provider has been set up for this page." : "Complete last added data binding to add more" })
|
|
341
341
|
] })
|
|
342
342
|
] });
|
|
343
|
-
},
|
|
344
|
-
const
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
343
|
+
}, rs = () => /* @__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" }), ss = ({ id: r, placeholder: o, value: t }) => {
|
|
344
|
+
const { t: a } = I(), [, l] = Fr(), s = U();
|
|
345
|
+
if (typeof window > "u")
|
|
346
|
+
return null;
|
|
347
|
+
const d = () => {
|
|
348
|
+
const c = s == null ? void 0 : s._id, n = r.replace("root.", "");
|
|
349
|
+
l({ blockId: c, blockProp: n, placeholder: o, initialCode: t });
|
|
350
|
+
};
|
|
351
|
+
return /* @__PURE__ */ e.jsxs("div", { className: "mt-2 flex flex-col gap-y-1", children: [
|
|
352
|
+
/* @__PURE__ */ e.jsx(
|
|
353
|
+
"button",
|
|
354
|
+
{
|
|
355
|
+
onClick: d,
|
|
356
|
+
className: "text-pretty w-[90%] max-w-full cursor-default truncate rounded border bg-white p-2 text-left text-[10px]",
|
|
357
|
+
children: t.trim().length > 0 ? t.substring(0, 46) : o || "Eg: <script>console.log('Hello, world!');<\/script>"
|
|
358
|
+
}
|
|
359
|
+
),
|
|
360
|
+
/* @__PURE__ */ e.jsx(B, { onClick: d, size: "sm", variant: "outline", className: "w-fit", children: a("Open code editor") })
|
|
361
|
+
] });
|
|
362
|
+
}, Ce = bt(({ id: r, properties: o, formData: t, onChange: a }) => {
|
|
363
|
+
const [l, s] = w(t), d = { type: "object", properties: {} }, c = {};
|
|
364
|
+
Object.keys(o).forEach((p) => {
|
|
365
|
+
const h = o[p];
|
|
366
|
+
if (X(["slot", "styles"], h.type))
|
|
348
367
|
return;
|
|
349
368
|
const i = p;
|
|
350
369
|
d.properties[i] = ur(h), c[i] = gr(h);
|
|
351
|
-
}),
|
|
370
|
+
}), A(() => {
|
|
352
371
|
s(t);
|
|
353
372
|
}, [r]);
|
|
354
|
-
const
|
|
373
|
+
const n = de(
|
|
355
374
|
async ({ formData: p }, h) => {
|
|
356
|
-
|
|
375
|
+
a({ formData: p }, h);
|
|
357
376
|
},
|
|
358
|
-
[
|
|
377
|
+
[a],
|
|
359
378
|
1e3
|
|
360
379
|
// save only every 5 seconds
|
|
361
380
|
);
|
|
@@ -363,10 +382,11 @@ const we = ({ data: r, fullView: a }) => {
|
|
|
363
382
|
Yr,
|
|
364
383
|
{
|
|
365
384
|
widgets: {
|
|
366
|
-
binding:
|
|
385
|
+
binding: rs,
|
|
367
386
|
richtext: xr,
|
|
368
387
|
icon: yr,
|
|
369
|
-
image: hr
|
|
388
|
+
image: hr,
|
|
389
|
+
code: ss
|
|
370
390
|
},
|
|
371
391
|
fields: { link: br },
|
|
372
392
|
idSeparator: ".",
|
|
@@ -374,18 +394,18 @@ const we = ({ data: r, fullView: a }) => {
|
|
|
374
394
|
omitExtraData: !1,
|
|
375
395
|
liveOmit: !1,
|
|
376
396
|
liveValidate: !1,
|
|
377
|
-
validator:
|
|
397
|
+
validator: Xr,
|
|
378
398
|
uiSchema: c,
|
|
379
399
|
schema: d,
|
|
380
400
|
formData: l,
|
|
381
401
|
onChange: ({ formData: p }, h) => {
|
|
382
|
-
h && (s(p),
|
|
402
|
+
h && (s(p), n({ formData: p }, h));
|
|
383
403
|
}
|
|
384
404
|
}
|
|
385
405
|
);
|
|
386
|
-
}),
|
|
387
|
-
const [r,
|
|
388
|
-
|
|
406
|
+
}), os = () => {
|
|
407
|
+
const [r, o] = Zr(), t = mr(), a = (d, c) => {
|
|
408
|
+
o((n) => ({ ...n, [d]: c }));
|
|
389
409
|
};
|
|
390
410
|
if (m(t))
|
|
391
411
|
return null;
|
|
@@ -399,39 +419,39 @@ const we = ({ data: r, fullView: a }) => {
|
|
|
399
419
|
Ce,
|
|
400
420
|
{
|
|
401
421
|
id: l == null ? void 0 : l._id,
|
|
402
|
-
onChange: ({ formData: d }) =>
|
|
422
|
+
onChange: ({ formData: d }) => a(l._id, d),
|
|
403
423
|
formData: y(r, l._id, {}),
|
|
404
424
|
properties: s
|
|
405
425
|
}
|
|
406
426
|
) })
|
|
407
427
|
] });
|
|
408
428
|
};
|
|
409
|
-
function
|
|
410
|
-
const r =
|
|
429
|
+
function ls() {
|
|
430
|
+
const r = U(), o = rt(), t = st(), a = Re(r._type), l = { ...r }, [s, d] = w(l), c = ot("dataBindingSupport", !1), n = ({ formData: x }, g, v) => {
|
|
411
431
|
if (g && (s == null ? void 0 : s._id) === r._id) {
|
|
412
432
|
const C = g.replace("root.", "");
|
|
413
433
|
t([r._id], { [C]: y(x, C) }, v);
|
|
414
434
|
}
|
|
415
435
|
}, p = H(
|
|
416
|
-
|
|
417
|
-
|
|
436
|
+
Ct(({ formData: x }, g, v) => {
|
|
437
|
+
n({ formData: x }, g, v), d(x);
|
|
418
438
|
}, 1500),
|
|
419
439
|
[r == null ? void 0 : r._id]
|
|
420
440
|
), h = ({ formData: x }, g) => {
|
|
421
441
|
if (g) {
|
|
422
442
|
const v = g.replace("root.", "");
|
|
423
|
-
|
|
443
|
+
o(
|
|
424
444
|
[r._id],
|
|
425
445
|
fr(v, y(x, v.split(".")))
|
|
426
446
|
), p({ formData: x }, g, { [v]: y(s, v) });
|
|
427
447
|
}
|
|
428
448
|
}, i = he(y(l, "_bindings", {})), u = T(() => {
|
|
429
|
-
const x =
|
|
430
|
-
return c &&
|
|
431
|
-
}, [
|
|
449
|
+
const x = kt(y(a, "props", {}));
|
|
450
|
+
return c && Nt(i, (g) => delete x[g]), x;
|
|
451
|
+
}, [a, i, c]);
|
|
432
452
|
return /* @__PURE__ */ e.jsxs("div", { className: "overflow-x-hidden", children: [
|
|
433
|
-
/* @__PURE__ */ e.jsx(
|
|
434
|
-
c ? /* @__PURE__ */ e.jsxs(
|
|
453
|
+
/* @__PURE__ */ e.jsx(os, {}),
|
|
454
|
+
c ? /* @__PURE__ */ e.jsxs(lt, { type: "multiple", defaultValue: ["STATIC", "BINDING"], className: "h-full w-full", children: [
|
|
435
455
|
/* @__PURE__ */ e.jsxs(me, { value: "BINDING", children: [
|
|
436
456
|
/* @__PURE__ */ e.jsx(fe, { 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: [
|
|
437
457
|
/* @__PURE__ */ e.jsx(
|
|
@@ -443,11 +463,11 @@ function ss() {
|
|
|
443
463
|
"Data Binding"
|
|
444
464
|
] }) }),
|
|
445
465
|
/* @__PURE__ */ e.jsx(ve, { className: "px-4 pt-4", children: /* @__PURE__ */ e.jsx(
|
|
446
|
-
|
|
466
|
+
ts,
|
|
447
467
|
{
|
|
448
468
|
bindingData: y(r, "_bindings", {}),
|
|
449
469
|
onChange: (x) => {
|
|
450
|
-
|
|
470
|
+
n({ formData: { _bindings: x } }, "root._bindings");
|
|
451
471
|
}
|
|
452
472
|
}
|
|
453
473
|
) })
|
|
@@ -488,68 +508,68 @@ function ss() {
|
|
|
488
508
|
] });
|
|
489
509
|
}
|
|
490
510
|
const as = ({ blockId: r }) => {
|
|
491
|
-
const { t:
|
|
492
|
-
|
|
511
|
+
const { t: o } = I(), { askAi: t, loading: a, error: l } = vr(), [s, d] = w(""), c = mt(null);
|
|
512
|
+
A(() => {
|
|
493
513
|
var p;
|
|
494
514
|
(p = c.current) == null || p.focus();
|
|
495
515
|
}, []);
|
|
496
|
-
const
|
|
516
|
+
const n = () => {
|
|
497
517
|
l || d("");
|
|
498
518
|
};
|
|
499
519
|
return /* @__PURE__ */ e.jsxs("div", { className: "", children: [
|
|
500
|
-
/* @__PURE__ */ e.jsx("h2", { className: "mb-1 text-sm font-semibold leading-none tracking-tight", children:
|
|
520
|
+
/* @__PURE__ */ e.jsx("h2", { className: "mb-1 text-sm font-semibold leading-none tracking-tight", children: o("Ask AI") }),
|
|
501
521
|
/* @__PURE__ */ e.jsx(
|
|
502
|
-
|
|
522
|
+
wr,
|
|
503
523
|
{
|
|
504
524
|
ref: c,
|
|
505
525
|
value: s,
|
|
506
526
|
onChange: (p) => d(p.target.value),
|
|
507
|
-
placeholder:
|
|
527
|
+
placeholder: o("Ask AI to edit styles"),
|
|
508
528
|
className: "w-full border border-gray-400 focus:border-0",
|
|
509
529
|
rows: 3,
|
|
510
530
|
onKeyDown: (p) => {
|
|
511
|
-
p.key === "Enter" && (p.preventDefault(), t("styles", r, s,
|
|
531
|
+
p.key === "Enter" && (p.preventDefault(), t("styles", r, s, n));
|
|
512
532
|
}
|
|
513
533
|
}
|
|
514
534
|
),
|
|
515
535
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2 my-2", children: [
|
|
516
|
-
|
|
517
|
-
|
|
536
|
+
a ? null : /* @__PURE__ */ e.jsx(
|
|
537
|
+
B,
|
|
518
538
|
{
|
|
519
|
-
disabled: s.trim().length < 5 ||
|
|
520
|
-
onClick: () => t("styles", r, s,
|
|
539
|
+
disabled: s.trim().length < 5 || a,
|
|
540
|
+
onClick: () => t("styles", r, s, n),
|
|
521
541
|
variant: "default",
|
|
522
542
|
className: "w-fit",
|
|
523
543
|
size: "sm",
|
|
524
|
-
children:
|
|
544
|
+
children: a ? /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
525
545
|
/* @__PURE__ */ e.jsx(Pr, { className: "w-5 h-5 animate-spin" }),
|
|
526
|
-
|
|
527
|
-
] }) :
|
|
546
|
+
o("Generating... Please wait")
|
|
547
|
+
] }) : o("Edit with AI")
|
|
528
548
|
}
|
|
529
549
|
),
|
|
530
|
-
|
|
531
|
-
/* @__PURE__ */ e.jsxs(
|
|
550
|
+
a ? /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col gap-2", children: [
|
|
551
|
+
/* @__PURE__ */ e.jsxs(jr, { className: "flex items-center w-full px-4 py-1 pl-2 space-x-1", children: [
|
|
532
552
|
/* @__PURE__ */ e.jsx(Cr, { className: "w-4 h-4 text-gray-500 animate-spin" }),
|
|
533
|
-
/* @__PURE__ */ e.jsx("p", { className: "text-xs", children:
|
|
553
|
+
/* @__PURE__ */ e.jsx("p", { className: "text-xs", children: o("Generating... Please wait") })
|
|
534
554
|
] }),
|
|
535
|
-
/* @__PURE__ */ e.jsx(
|
|
555
|
+
/* @__PURE__ */ e.jsx(B, { variant: "destructive", onClick: () => stop(), className: "hidden w-fit", size: "sm", children: o("Stop") })
|
|
536
556
|
] }) : null
|
|
537
557
|
] }),
|
|
538
558
|
/* @__PURE__ */ e.jsx("div", { className: "max-w-full", children: l && /* @__PURE__ */ e.jsx("p", { className: "p-1 text-xs text-red-500 break-words bg-red-100 border border-red-500 rounded", children: l.message }) })
|
|
539
559
|
] });
|
|
540
|
-
}, Oe = new
|
|
560
|
+
}, Oe = new Ur(Kr, {
|
|
541
561
|
isCaseSensitive: !1,
|
|
542
562
|
threshold: 0.2,
|
|
543
563
|
minMatchCharLength: 2,
|
|
544
564
|
keys: ["name"]
|
|
545
565
|
});
|
|
546
|
-
function
|
|
566
|
+
function pt() {
|
|
547
567
|
var S;
|
|
548
|
-
const { t: r } =
|
|
549
|
-
const
|
|
550
|
-
|
|
551
|
-
}, [x, g] =
|
|
552
|
-
const D =
|
|
568
|
+
const { t: r } = I(), [o] = pe(), t = U(), a = Te(), l = at(), [s] = nt(), d = ot("askAiCallBack", null), [c, n] = w(""), { toast: p } = it(), h = (S = oe(o)) == null ? void 0 : S.prop, i = _t((y(t, h, "").replace(qr, "").split(",").pop() || "").split(" "), m), u = () => {
|
|
569
|
+
const j = c.trim().toLowerCase().replace(/ +(?= )/g, "").split(" ");
|
|
570
|
+
a(s, j, !0), n("");
|
|
571
|
+
}, [x, g] = w([]), v = ({ value: j }) => {
|
|
572
|
+
const D = j.trim().toLowerCase(), Z = D.match(/.+:/g);
|
|
553
573
|
let b = [];
|
|
554
574
|
if (Z && Z.length > 0) {
|
|
555
575
|
const [f] = Z, N = D.replace(f, "");
|
|
@@ -562,17 +582,17 @@ function ut() {
|
|
|
562
582
|
return g(_(b, "item"));
|
|
563
583
|
}, C = () => {
|
|
564
584
|
g([]);
|
|
565
|
-
},
|
|
585
|
+
}, K = (j) => j.name, L = (j) => /* @__PURE__ */ e.jsx("div", { className: "rounded-md p-1", children: j.name }), G = {
|
|
566
586
|
autoComplete: "off",
|
|
567
587
|
autoCorrect: "off",
|
|
568
588
|
autoCapitalize: "off",
|
|
569
589
|
spellCheck: !1,
|
|
570
590
|
placeholder: r("Enter classes separated by space"),
|
|
571
591
|
value: c,
|
|
572
|
-
onKeyDown: (
|
|
573
|
-
|
|
592
|
+
onKeyDown: (j) => {
|
|
593
|
+
j.key === "Enter" && c.trim() !== "" && u();
|
|
574
594
|
},
|
|
575
|
-
onChange: (
|
|
595
|
+
onChange: (j, { newValue: D }) => n(D),
|
|
576
596
|
className: "w-full rounded-md text-xs px-2 hover:outline-0 bg-background border-border py-1"
|
|
577
597
|
}, q = () => {
|
|
578
598
|
if (navigator.clipboard === void 0) {
|
|
@@ -597,28 +617,28 @@ function ut() {
|
|
|
597
617
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-x-2", children: [
|
|
598
618
|
/* @__PURE__ */ e.jsx("span", { children: r("Classes") }),
|
|
599
619
|
/* @__PURE__ */ e.jsxs($, { children: [
|
|
600
|
-
/* @__PURE__ */ e.jsx(
|
|
601
|
-
/* @__PURE__ */ e.jsx(
|
|
620
|
+
/* @__PURE__ */ e.jsx(E, { asChild: !0, children: /* @__PURE__ */ e.jsx(Dt, { onClick: q, className: "cursor-pointer" }) }),
|
|
621
|
+
/* @__PURE__ */ e.jsx(M, { children: /* @__PURE__ */ e.jsx("p", { children: r("Copy classes to clipboard") }) })
|
|
602
622
|
] })
|
|
603
623
|
] }),
|
|
604
|
-
d ? /* @__PURE__ */ e.jsxs(
|
|
605
|
-
/* @__PURE__ */ e.jsx(
|
|
624
|
+
d ? /* @__PURE__ */ e.jsxs(Je, { children: [
|
|
625
|
+
/* @__PURE__ */ e.jsx(Qe, { children: /* @__PURE__ */ e.jsxs(B, { variant: "default", className: "h-6 w-fit", size: "sm", children: [
|
|
606
626
|
/* @__PURE__ */ e.jsx(Ar, { className: "h-4 w-4" }),
|
|
607
627
|
/* @__PURE__ */ e.jsx("span", { className: "ml-2", children: r("Ask AI") })
|
|
608
628
|
] }) }),
|
|
609
|
-
/* @__PURE__ */ e.jsx(
|
|
629
|
+
/* @__PURE__ */ e.jsx(et, { side: "left", className: "p-2", children: /* @__PURE__ */ e.jsx(as, { blockId: t == null ? void 0 : t._id }) })
|
|
610
630
|
] }) : null
|
|
611
631
|
] }),
|
|
612
632
|
/* @__PURE__ */ e.jsxs("div", { className: "relative flex items-center gap-x-3", children: [
|
|
613
633
|
/* @__PURE__ */ e.jsx("div", { className: "relative flex w-full items-center gap-x-3", children: /* @__PURE__ */ e.jsx(
|
|
614
|
-
|
|
634
|
+
Wr,
|
|
615
635
|
{
|
|
616
636
|
suggestions: x,
|
|
617
637
|
onSuggestionsFetchRequested: v,
|
|
618
638
|
onSuggestionsClearRequested: C,
|
|
619
|
-
getSuggestionValue:
|
|
639
|
+
getSuggestionValue: K,
|
|
620
640
|
renderSuggestion: L,
|
|
621
|
-
inputProps:
|
|
641
|
+
inputProps: G,
|
|
622
642
|
containerProps: {
|
|
623
643
|
className: "relative h-8 w-full gap-y-1 py-1 border-gray-600"
|
|
624
644
|
},
|
|
@@ -630,7 +650,7 @@ function ut() {
|
|
|
630
650
|
}
|
|
631
651
|
) }),
|
|
632
652
|
/* @__PURE__ */ e.jsx(
|
|
633
|
-
|
|
653
|
+
B,
|
|
634
654
|
{
|
|
635
655
|
variant: "outline",
|
|
636
656
|
className: "h-6 border-gray-700",
|
|
@@ -642,41 +662,41 @@ function ut() {
|
|
|
642
662
|
)
|
|
643
663
|
] }),
|
|
644
664
|
/* @__PURE__ */ e.jsx("div", { className: "flex w-full flex-wrap gap-2 overflow-x-hidden", children: ne.Children.toArray(
|
|
645
|
-
i.map((
|
|
665
|
+
i.map((j) => /* @__PURE__ */ e.jsxs(
|
|
646
666
|
"div",
|
|
647
667
|
{
|
|
648
668
|
className: "group relative flex max-w-[260px] cursor-default items-center gap-x-1 truncate rounded border border-gray-300 bg-gray-200 p-px px-1.5 text-[11px] text-gray-600 hover:border-gray-300",
|
|
649
669
|
children: [
|
|
650
|
-
|
|
670
|
+
j,
|
|
651
671
|
/* @__PURE__ */ e.jsx(
|
|
652
|
-
|
|
672
|
+
Ke,
|
|
653
673
|
{
|
|
654
|
-
onClick: () => l(s, [
|
|
674
|
+
onClick: () => l(s, [j]),
|
|
655
675
|
className: "invisible absolute right-1 rounded-full bg-red-400 hover:text-white group-hover:visible group-hover:cursor-pointer"
|
|
656
676
|
}
|
|
657
677
|
)
|
|
658
678
|
]
|
|
659
679
|
},
|
|
660
|
-
|
|
680
|
+
j
|
|
661
681
|
))
|
|
662
682
|
) })
|
|
663
683
|
]
|
|
664
684
|
}
|
|
665
685
|
);
|
|
666
686
|
}
|
|
667
|
-
const
|
|
668
|
-
const { t:
|
|
669
|
-
m(t.key) || (r({ ...t, key: t.key }),
|
|
687
|
+
const ns = ({ onAdd: r }) => {
|
|
688
|
+
const { t: o } = I(), [t, a] = w({ key: "", value: "" }), l = () => {
|
|
689
|
+
m(t.key) || (r({ ...t, key: t.key }), a({ key: "", value: "" }));
|
|
670
690
|
};
|
|
671
691
|
return /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col gap-1 border-gray-200", children: [
|
|
672
692
|
/* @__PURE__ */ e.jsx(
|
|
673
|
-
|
|
693
|
+
we,
|
|
674
694
|
{
|
|
675
695
|
name: "key",
|
|
676
696
|
className: "h-6",
|
|
677
|
-
onChange: (s) =>
|
|
697
|
+
onChange: (s) => a({ ...t, key: s.target.value }),
|
|
678
698
|
value: t.key,
|
|
679
|
-
placeholder:
|
|
699
|
+
placeholder: o("Name"),
|
|
680
700
|
autoComplete: "off",
|
|
681
701
|
autoCapitalize: "off",
|
|
682
702
|
onKeyDown: (s) => {
|
|
@@ -685,13 +705,13 @@ const ls = ({ onAdd: r }) => {
|
|
|
685
705
|
}
|
|
686
706
|
),
|
|
687
707
|
/* @__PURE__ */ e.jsx("div", { className: "flex items-center gap-x-1.5", children: /* @__PURE__ */ e.jsx(
|
|
688
|
-
|
|
708
|
+
we,
|
|
689
709
|
{
|
|
690
710
|
className: "h-6",
|
|
691
711
|
name: "value",
|
|
692
|
-
onChange: (s) =>
|
|
712
|
+
onChange: (s) => a({ ...t, value: s.target.value }),
|
|
693
713
|
value: t.value,
|
|
694
|
-
placeholder:
|
|
714
|
+
placeholder: o("Value"),
|
|
695
715
|
autoComplete: "off",
|
|
696
716
|
autoCapitalize: "off",
|
|
697
717
|
onKeyDown: (s) => {
|
|
@@ -700,27 +720,27 @@ const ls = ({ onAdd: r }) => {
|
|
|
700
720
|
}
|
|
701
721
|
) }),
|
|
702
722
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-x-2", children: [
|
|
703
|
-
/* @__PURE__ */ e.jsxs(
|
|
723
|
+
/* @__PURE__ */ e.jsxs(B, { disabled: m(t.key), onClick: l, size: "sm", className: "flex items-center", children: [
|
|
704
724
|
/* @__PURE__ */ e.jsxs("span", { children: [
|
|
705
|
-
|
|
725
|
+
o("Add"),
|
|
706
726
|
" "
|
|
707
727
|
] }),
|
|
708
728
|
/* @__PURE__ */ e.jsx(_e, {})
|
|
709
729
|
] }),
|
|
710
|
-
m(t.key) ? null : /* @__PURE__ */ e.jsx(
|
|
730
|
+
m(t.key) ? null : /* @__PURE__ */ e.jsx(B, { variant: "ghost", onClick: () => a({ key: "", value: "" }), children: o("Cancel") })
|
|
711
731
|
] })
|
|
712
732
|
] });
|
|
713
|
-
},
|
|
714
|
-
const r =
|
|
733
|
+
}, is = () => {
|
|
734
|
+
const r = U(), [o, t] = w([]), [a] = pe(), l = rt(), s = st(), { t: d } = I(), { toast: c } = it(), n = `${y(a, "0.prop")}_attrs`;
|
|
715
735
|
ne.useEffect(() => {
|
|
716
|
-
const u = _(y(r,
|
|
736
|
+
const u = _(y(r, n), (x, g) => ({ key: g, value: x }));
|
|
717
737
|
m(u) ? t([]) : t(u);
|
|
718
|
-
}, [y(r,
|
|
738
|
+
}, [y(r, n)]);
|
|
719
739
|
const p = (u) => {
|
|
720
|
-
const x = ye(
|
|
740
|
+
const x = ye(o, (g, v) => u !== v);
|
|
721
741
|
i(x);
|
|
722
742
|
}, h = (u) => {
|
|
723
|
-
const x = Ze(
|
|
743
|
+
const x = Ze(o, { key: u.key });
|
|
724
744
|
if (x && (x.value.startsWith("dnd-") || x.value.startsWith("#dnd-"))) {
|
|
725
745
|
c({
|
|
726
746
|
title: d("Cannot add predefined attribute"),
|
|
@@ -729,33 +749,33 @@ const ls = ({ onAdd: r }) => {
|
|
|
729
749
|
});
|
|
730
750
|
return;
|
|
731
751
|
}
|
|
732
|
-
const g = [...
|
|
752
|
+
const g = [...o, u];
|
|
733
753
|
i(g);
|
|
734
754
|
}, i = ne.useCallback(
|
|
735
755
|
(u = []) => {
|
|
736
756
|
const x = {};
|
|
737
757
|
Ne(u, (g) => {
|
|
738
758
|
m(g.key) || We(x, g.key, g.value);
|
|
739
|
-
}), s([y(r, "_id")], { [
|
|
759
|
+
}), s([y(r, "_id")], { [n]: x });
|
|
740
760
|
},
|
|
741
|
-
[r, l,
|
|
761
|
+
[r, l, n]
|
|
742
762
|
);
|
|
743
763
|
return /* @__PURE__ */ e.jsx("div", { className: "mb-20 flex min-h-max flex-col gap-y-2 overflow-y-auto", children: /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col", children: [
|
|
744
764
|
/* @__PURE__ */ e.jsx("div", { children: /* @__PURE__ */ e.jsxs("ul", { className: "overflow-hidden rounded-md bg-gray-100 text-xs text-gray-700", children: [
|
|
745
|
-
m(
|
|
765
|
+
m(o) ? /* @__PURE__ */ e.jsx("li", { className: "flex h-4 items-center justify-center", children: /* @__PURE__ */ e.jsx("p", { children: d("No attributes added") }) }) : null,
|
|
746
766
|
ne.Children.toArray(
|
|
747
|
-
_(
|
|
767
|
+
_(o, (u) => /* @__PURE__ */ e.jsxs("li", { className: "group flex w-full max-w-full items-center justify-between", children: [
|
|
748
768
|
/* @__PURE__ */ e.jsxs($, { delayDuration: 1e3, children: [
|
|
749
|
-
/* @__PURE__ */ e.jsx(
|
|
769
|
+
/* @__PURE__ */ e.jsx(E, { asChild: !0, children: /* @__PURE__ */ e.jsxs("div", { className: "max-w-[230px] cursor-default truncate px-1 hover:bg-gray-200", children: [
|
|
750
770
|
u.key,
|
|
751
|
-
u.value.trim() ? /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
771
|
+
u.value.toString().trim() ? /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
752
772
|
" ",
|
|
753
773
|
/* @__PURE__ */ e.jsx("span", { className: "font-bold text-orange-500", children: "=" }),
|
|
754
774
|
" ",
|
|
755
|
-
u.value.trim()
|
|
775
|
+
u.value.toString().trim()
|
|
756
776
|
] }) : null
|
|
757
777
|
] }) }),
|
|
758
|
-
/* @__PURE__ */ e.jsxs(
|
|
778
|
+
/* @__PURE__ */ e.jsxs(M, { className: "max-w-[200px]", children: [
|
|
759
779
|
/* @__PURE__ */ e.jsxs("div", { children: [
|
|
760
780
|
d("Name"),
|
|
761
781
|
": ",
|
|
@@ -764,29 +784,29 @@ const ls = ({ onAdd: r }) => {
|
|
|
764
784
|
/* @__PURE__ */ e.jsxs("div", { children: [
|
|
765
785
|
d("Value"),
|
|
766
786
|
": ",
|
|
767
|
-
u.value
|
|
787
|
+
u.value.toString()
|
|
768
788
|
] })
|
|
769
789
|
] })
|
|
770
790
|
] }),
|
|
771
791
|
/* @__PURE__ */ e.jsxs($, { children: [
|
|
772
|
-
/* @__PURE__ */ e.jsx(
|
|
792
|
+
/* @__PURE__ */ e.jsx(E, { asChild: !0, children: /* @__PURE__ */ e.jsx(
|
|
773
793
|
"button",
|
|
774
794
|
{
|
|
775
795
|
disabled: W(u.value, "dnd-"),
|
|
776
796
|
className: "invisible group-hover:visible",
|
|
777
|
-
onClick: () => p(
|
|
797
|
+
onClick: () => p(o.indexOf(u)),
|
|
778
798
|
children: /* @__PURE__ */ e.jsx($r, { className: "w-4 text-gray-500" })
|
|
779
799
|
}
|
|
780
800
|
) }),
|
|
781
|
-
/* @__PURE__ */ e.jsx(
|
|
801
|
+
/* @__PURE__ */ e.jsx(M, { className: "max-w-[200px]", children: W(u.value.toString(), "dnd-") ? d("Predefined attribute. Cannot be deleted") : d("Remove attribute") })
|
|
782
802
|
] })
|
|
783
803
|
] }))
|
|
784
804
|
)
|
|
785
805
|
] }) }),
|
|
786
806
|
/* @__PURE__ */ e.jsx("div", { className: "py-2" }),
|
|
787
|
-
/* @__PURE__ */ e.jsx(
|
|
807
|
+
/* @__PURE__ */ e.jsx(ns, { onAdd: (u) => h(u) })
|
|
788
808
|
] }) });
|
|
789
|
-
}, k = ["px", "%", "em", "rem", "ch", "vh", "vw"],
|
|
809
|
+
}, k = ["px", "%", "em", "rem", "ch", "vh", "vw"], ds = {
|
|
790
810
|
heading: "flex.heading",
|
|
791
811
|
items: [
|
|
792
812
|
{ type: "arbitrary", label: "flex.basis", units: k, property: "flexBasis" },
|
|
@@ -795,7 +815,7 @@ const ls = ({ onAdd: r }) => {
|
|
|
795
815
|
{ type: "dropdown", label: "flex.grow", property: "flexGrow" },
|
|
796
816
|
{ type: "dropdown", label: "flex.shrink", property: "flexShrink" }
|
|
797
817
|
]
|
|
798
|
-
},
|
|
818
|
+
}, cs = {
|
|
799
819
|
heading: "grid.heading",
|
|
800
820
|
items: [
|
|
801
821
|
{ type: "range", label: "grid.col_span", property: "gridColSpan" },
|
|
@@ -806,11 +826,11 @@ const ls = ({ onAdd: r }) => {
|
|
|
806
826
|
{ type: "range", label: "grid.row_end", property: "gridRowEnd" },
|
|
807
827
|
{ type: "range", label: "grid.order", property: "order" }
|
|
808
828
|
]
|
|
809
|
-
},
|
|
829
|
+
}, ps = [
|
|
810
830
|
{
|
|
811
831
|
heading: "Styles",
|
|
812
832
|
items: [
|
|
813
|
-
{ component:
|
|
833
|
+
{ component: pt },
|
|
814
834
|
{ type: "arbitrary", label: "layout.width", units: k.concat("auto"), property: "width" },
|
|
815
835
|
{ type: "arbitrary", label: "layout.height", units: k.concat("auto"), property: "height" },
|
|
816
836
|
{
|
|
@@ -870,9 +890,9 @@ const ls = ({ onAdd: r }) => {
|
|
|
870
890
|
},
|
|
871
891
|
{
|
|
872
892
|
heading: "Attributes",
|
|
873
|
-
items: [{ component:
|
|
893
|
+
items: [{ component: is }]
|
|
874
894
|
}
|
|
875
|
-
],
|
|
895
|
+
], Vo = [
|
|
876
896
|
{
|
|
877
897
|
heading: "layout.heading",
|
|
878
898
|
items: [
|
|
@@ -1274,12 +1294,12 @@ const ls = ({ onAdd: r }) => {
|
|
|
1274
1294
|
},
|
|
1275
1295
|
{
|
|
1276
1296
|
heading: "classes.heading",
|
|
1277
|
-
items: [{ component:
|
|
1297
|
+
items: [{ component: pt }]
|
|
1278
1298
|
}
|
|
1279
|
-
],
|
|
1299
|
+
], ut = {
|
|
1280
1300
|
"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" }) }),
|
|
1281
1301
|
// visibility
|
|
1282
|
-
visible:
|
|
1302
|
+
visible: Bt,
|
|
1283
1303
|
invisible: Be,
|
|
1284
1304
|
// display
|
|
1285
1305
|
hidden: Be,
|
|
@@ -1315,10 +1335,10 @@ const ls = ({ onAdd: r }) => {
|
|
|
1315
1335
|
borderRadiusRight: Q,
|
|
1316
1336
|
borderRadiusBottom: ee,
|
|
1317
1337
|
borderRadiusLeft: te,
|
|
1318
|
-
borderRadiusTopLeft:
|
|
1319
|
-
borderRadiusTopRight:
|
|
1320
|
-
borderRadiusBottomRight:
|
|
1321
|
-
borderRadiusBottomLeft:
|
|
1338
|
+
borderRadiusTopLeft: It,
|
|
1339
|
+
borderRadiusTopRight: Pt,
|
|
1340
|
+
borderRadiusBottomRight: At,
|
|
1341
|
+
borderRadiusBottomLeft: $t,
|
|
1322
1342
|
divideXWidth: R,
|
|
1323
1343
|
divideYWidth: V,
|
|
1324
1344
|
scale: Y,
|
|
@@ -1346,17 +1366,17 @@ const ls = ({ onAdd: r }) => {
|
|
|
1346
1366
|
marginLeft: te,
|
|
1347
1367
|
// text-align
|
|
1348
1368
|
textLeft: Et,
|
|
1349
|
-
textCenter:
|
|
1350
|
-
textRight:
|
|
1351
|
-
textJustify:
|
|
1369
|
+
textCenter: Mt,
|
|
1370
|
+
textRight: Lt,
|
|
1371
|
+
textJustify: Ot,
|
|
1352
1372
|
// font style
|
|
1353
|
-
italic:
|
|
1373
|
+
italic: zt,
|
|
1354
1374
|
// "not-italic": "",
|
|
1355
1375
|
// decoration
|
|
1356
|
-
underline:
|
|
1376
|
+
underline: Yt,
|
|
1357
1377
|
overline: Xt,
|
|
1358
1378
|
// transform
|
|
1359
|
-
uppercase:
|
|
1379
|
+
uppercase: Ft,
|
|
1360
1380
|
block: () => /* @__PURE__ */ e.jsxs("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [
|
|
1361
1381
|
/* @__PURE__ */ e.jsx(
|
|
1362
1382
|
"path",
|
|
@@ -1397,7 +1417,7 @@ const ls = ({ onAdd: r }) => {
|
|
|
1397
1417
|
}
|
|
1398
1418
|
)
|
|
1399
1419
|
] }),
|
|
1400
|
-
"float-none":
|
|
1420
|
+
"float-none": Ke,
|
|
1401
1421
|
// position
|
|
1402
1422
|
fixed: () => /* @__PURE__ */ e.jsxs("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [
|
|
1403
1423
|
/* @__PURE__ */ e.jsx(
|
|
@@ -1469,101 +1489,101 @@ const ls = ({ onAdd: r }) => {
|
|
|
1469
1489
|
}
|
|
1470
1490
|
)
|
|
1471
1491
|
] }),
|
|
1472
|
-
static:
|
|
1473
|
-
}, le =
|
|
1492
|
+
static: Zt
|
|
1493
|
+
}, le = Fe({ canReset: !1, canChange: !0 }), us = ({ children: r, canReset: o = !1, canChange: t = !0 }) => (
|
|
1474
1494
|
// eslint-disable-next-line react/jsx-no-constructed-context-values
|
|
1475
|
-
/* @__PURE__ */ e.jsx(le.Provider, { value: { canReset:
|
|
1476
|
-
),
|
|
1477
|
-
const
|
|
1495
|
+
/* @__PURE__ */ e.jsx(le.Provider, { value: { canReset: o, canChange: t }, children: r })
|
|
1496
|
+
), gt = ({ label: r, property: o, onChange: t }) => {
|
|
1497
|
+
const a = T(() => y(ge, `${o}.classes`, [""]), [o]), l = ae(o), s = T(() => y(l, "cls", ""), [l]), { canChange: d } = se(le), c = /\[.*\]/g.test(s);
|
|
1478
1498
|
return /* @__PURE__ */ e.jsx("div", { className: r ? "w-full rounded" : "grow", children: c ? /* @__PURE__ */ e.jsxs("div", { className: "flex items-center", children: [
|
|
1479
|
-
/* @__PURE__ */ e.jsx(
|
|
1499
|
+
/* @__PURE__ */ e.jsx(we, { className: "w-[70%] rounded py-1", readOnly: !0, value: s }),
|
|
1480
1500
|
/* @__PURE__ */ e.jsxs($, { delayDuration: 100, children: [
|
|
1481
|
-
/* @__PURE__ */ e.jsx(
|
|
1482
|
-
/* @__PURE__ */ e.jsx(
|
|
1501
|
+
/* @__PURE__ */ e.jsx(E, { 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(Se, {}) }) }),
|
|
1502
|
+
/* @__PURE__ */ e.jsx(M, { children: "Current value is using a Tailwind arbitrary value." })
|
|
1483
1503
|
] })
|
|
1484
1504
|
] }) : /* @__PURE__ */ e.jsx(
|
|
1485
1505
|
ke,
|
|
1486
1506
|
{
|
|
1487
1507
|
rounded: r,
|
|
1488
|
-
onChange: (
|
|
1508
|
+
onChange: (n) => t(n, o),
|
|
1489
1509
|
selected: s,
|
|
1490
|
-
options:
|
|
1510
|
+
options: a,
|
|
1491
1511
|
disabled: !d
|
|
1492
1512
|
}
|
|
1493
1513
|
) });
|
|
1494
1514
|
};
|
|
1495
|
-
function ke({ selected: r, onChange:
|
|
1515
|
+
function ke({ selected: r, onChange: o, rounded: t = !1, options: a, disabled: l = !1 }) {
|
|
1496
1516
|
const s = r.replace(/.*:/g, "").trim(), { undo: d, redo: c } = kr();
|
|
1497
1517
|
return /* @__PURE__ */ e.jsxs(
|
|
1498
1518
|
"select",
|
|
1499
1519
|
{
|
|
1500
|
-
disabled: !
|
|
1520
|
+
disabled: !a.length || l,
|
|
1501
1521
|
className: `${t ? "rounded-md border border-border" : "border-0"} disable:bg-gray-500 h-full w-full truncate rounded bg-background px-2 py-1 text-xs outline-none disabled:cursor-not-allowed`,
|
|
1502
|
-
onChange: (
|
|
1503
|
-
onKeyDown: (
|
|
1504
|
-
|
|
1522
|
+
onChange: (n) => o(n.target.value),
|
|
1523
|
+
onKeyDown: (n) => {
|
|
1524
|
+
n.ctrlKey && (n.key === "z" && d(), n.key === "y" && c());
|
|
1505
1525
|
},
|
|
1506
1526
|
value: s,
|
|
1507
1527
|
children: [
|
|
1508
1528
|
/* @__PURE__ */ e.jsx("option", { className: "bg-transparent", value: "" }),
|
|
1509
|
-
|
|
1510
|
-
|
|
1529
|
+
P.Children.toArray(
|
|
1530
|
+
a.map((n) => /* @__PURE__ */ e.jsx("option", { className: "bg-transparent", value: n, children: n }))
|
|
1511
1531
|
)
|
|
1512
1532
|
]
|
|
1513
1533
|
}
|
|
1514
1534
|
);
|
|
1515
1535
|
}
|
|
1516
|
-
const
|
|
1517
|
-
const { canReset: t, canChange:
|
|
1518
|
-
return /* @__PURE__ */ e.jsx("div", { className: "flex flex-row divide-x divide-solid divide-border rounded border border-border text-xs", children:
|
|
1536
|
+
const gs = ({ property: r, onChange: o }) => {
|
|
1537
|
+
const { canReset: t, canChange: a } = se(le), l = ae(r), s = T(() => y(l, "cls", ""), [l]), d = T(() => y(ge, `${r}.classes`, [""]), [r]), c = d.indexOf(s) > -1 ? d.indexOf(s) : 0, n = /\[.*\]/g.test(s);
|
|
1538
|
+
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: s }) : /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
1519
1539
|
/* @__PURE__ */ e.jsx(
|
|
1520
1540
|
"button",
|
|
1521
1541
|
{
|
|
1522
1542
|
type: "button",
|
|
1523
1543
|
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",
|
|
1524
|
-
disabled: !
|
|
1525
|
-
onClick: () =>
|
|
1544
|
+
disabled: !a && (!t || c - 1 < 0),
|
|
1545
|
+
onClick: () => o(He(d, c - 1), r),
|
|
1526
1546
|
children: /* @__PURE__ */ e.jsx("span", { className: "flex items-center justify-center", children: /* @__PURE__ */ e.jsx(
|
|
1527
|
-
|
|
1547
|
+
Wt,
|
|
1528
1548
|
{
|
|
1529
|
-
className: !
|
|
1549
|
+
className: !a && (!t || c - 1 < 0) ? "text-gray-500" : "text-black/60 dark:text-white/60"
|
|
1530
1550
|
}
|
|
1531
1551
|
) })
|
|
1532
1552
|
}
|
|
1533
1553
|
),
|
|
1534
|
-
/* @__PURE__ */ e.jsx("div", { className: "w-8/12 text-center", children: /* @__PURE__ */ e.jsx(
|
|
1554
|
+
/* @__PURE__ */ e.jsx("div", { className: "w-8/12 text-center", children: /* @__PURE__ */ e.jsx(gt, { label: !1, property: r, onChange: o }) }),
|
|
1535
1555
|
/* @__PURE__ */ e.jsx(
|
|
1536
1556
|
"button",
|
|
1537
1557
|
{
|
|
1538
1558
|
type: "button",
|
|
1539
1559
|
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",
|
|
1540
|
-
disabled: !
|
|
1541
|
-
onClick: () =>
|
|
1560
|
+
disabled: !a && (!t || c + 1 >= d.length),
|
|
1561
|
+
onClick: () => o(He(d, c + 1), r),
|
|
1542
1562
|
children: /* @__PURE__ */ e.jsx("span", { className: "flex items-center justify-center", children: /* @__PURE__ */ e.jsx(
|
|
1543
1563
|
_e,
|
|
1544
1564
|
{
|
|
1545
|
-
className: !
|
|
1565
|
+
className: !a && (!t || c + 1 >= d.length) ? "text-gray-500" : "text-black/60 dark:text-white/60"
|
|
1546
1566
|
}
|
|
1547
1567
|
) })
|
|
1548
1568
|
}
|
|
1549
1569
|
)
|
|
1550
1570
|
] }) });
|
|
1551
|
-
},
|
|
1552
|
-
const t = T(() => y(ge, `${r}.classes`, [""]), [r]), { canChange:
|
|
1571
|
+
}, xs = ({ property: r, onChange: o }) => {
|
|
1572
|
+
const t = T(() => y(ge, `${r}.classes`, [""]), [r]), { canChange: a } = se(le), l = ae(r), s = T(() => y(l, "cls", ""), [l]);
|
|
1553
1573
|
return /* @__PURE__ */ e.jsx("div", { className: "flex grow flex-wrap gap-1", children: _(t, (d) => /* @__PURE__ */ e.jsxs($, { children: [
|
|
1554
|
-
/* @__PURE__ */ e.jsx(
|
|
1574
|
+
/* @__PURE__ */ e.jsx(E, { asChild: !0, children: /* @__PURE__ */ e.jsx(
|
|
1555
1575
|
"button",
|
|
1556
1576
|
{
|
|
1557
1577
|
type: "button",
|
|
1558
|
-
disabled: !
|
|
1559
|
-
onClick: () =>
|
|
1578
|
+
disabled: !a,
|
|
1579
|
+
onClick: () => o(d, r),
|
|
1560
1580
|
className: `cursor-pointer rounded border border-gray-600 p-1 disabled:cursor-not-allowed ${s === d ? " bg-blue-500 text-white" : "disabled:bg-gray-600 disabled:text-gray-400"}`,
|
|
1561
|
-
children:
|
|
1581
|
+
children: P.createElement(y(ut, d, Ge))
|
|
1562
1582
|
}
|
|
1563
1583
|
) }),
|
|
1564
|
-
/* @__PURE__ */ e.jsx(
|
|
1584
|
+
/* @__PURE__ */ e.jsx(M, { children: F(re(d)) })
|
|
1565
1585
|
] })) });
|
|
1566
|
-
},
|
|
1586
|
+
}, ys = {
|
|
1567
1587
|
backgroundColor: "bg",
|
|
1568
1588
|
textColor: "text",
|
|
1569
1589
|
borderColor: "border",
|
|
@@ -1575,15 +1595,15 @@ const ps = ({ property: r, onChange: a }) => {
|
|
|
1575
1595
|
toColor: "to",
|
|
1576
1596
|
ringColor: "ring",
|
|
1577
1597
|
ringOffsetColor: "ring-offset"
|
|
1578
|
-
},
|
|
1579
|
-
const t =
|
|
1598
|
+
}, hs = ({ property: r, onChange: o }) => {
|
|
1599
|
+
const t = ae(r), a = T(() => y(t, "cls", ""), [t]), { canChange: l } = se(le), [s, d] = w([]), [c, n] = w({ color: "", shade: "" }), p = a.split("-"), h = y(p, "1", ""), i = y(p, "2", ""), u = H(
|
|
1580
1600
|
// eslint-disable-next-line no-shadow
|
|
1581
1601
|
(g) => {
|
|
1582
|
-
["current", "inherit", "transparent", "black", "white"].includes(g) ? (d([]),
|
|
1602
|
+
["current", "inherit", "transparent", "black", "white"].includes(g) ? (d([]), n({ color: g })) : (d(["50", "100", "200", "300", "400", "500", "600", "700", "800", "900"]), n((v) => ({ ...v, color: g, shade: v.shade ? v.shade : "500" })));
|
|
1583
1603
|
},
|
|
1584
|
-
[d,
|
|
1604
|
+
[d, n]
|
|
1585
1605
|
);
|
|
1586
|
-
|
|
1606
|
+
A(() => {
|
|
1587
1607
|
if (["current", "inherit", "transparent", "black", "white"].includes(h))
|
|
1588
1608
|
return d([]);
|
|
1589
1609
|
d(["50", "100", "200", "300", "400", "500", "600", "700", "800", "900"]);
|
|
@@ -1591,16 +1611,16 @@ const ps = ({ property: r, onChange: a }) => {
|
|
|
1591
1611
|
const x = H(
|
|
1592
1612
|
// eslint-disable-next-line no-shadow
|
|
1593
1613
|
(g) => {
|
|
1594
|
-
|
|
1614
|
+
n({ color: h, shade: g });
|
|
1595
1615
|
},
|
|
1596
1616
|
[h]
|
|
1597
1617
|
);
|
|
1598
|
-
return
|
|
1599
|
-
|
|
1600
|
-
}, [t]),
|
|
1601
|
-
const v = `${y(
|
|
1602
|
-
v.match(new RegExp(y(ge, `${r}.regExp`, ""))) &&
|
|
1603
|
-
}, [c,
|
|
1618
|
+
return A(() => {
|
|
1619
|
+
n({ color: "", shade: "" });
|
|
1620
|
+
}, [t]), A(() => {
|
|
1621
|
+
const v = `${y(ys, r, "")}-${c.color}${c.shade ? `-${c.shade}` : ""}`;
|
|
1622
|
+
v.match(new RegExp(y(ge, `${r}.regExp`, ""))) && o(v, r);
|
|
1623
|
+
}, [c, o, r]), /* @__PURE__ */ e.jsxs("div", { className: "flex flex-row divide-x divide-solid divide-border rounded-lg border border-border text-xs", children: [
|
|
1604
1624
|
/* @__PURE__ */ e.jsx("div", { className: "grow text-center", children: /* @__PURE__ */ e.jsx(
|
|
1605
1625
|
ke,
|
|
1606
1626
|
{
|
|
@@ -1642,18 +1662,18 @@ const ps = ({ property: r, onChange: a }) => {
|
|
|
1642
1662
|
) }),
|
|
1643
1663
|
/* @__PURE__ */ e.jsx("button", { type: "button", className: "grow text-center", children: /* @__PURE__ */ e.jsx(ke, { rounded: !0, selected: i, disabled: !h || !l, onChange: x, options: s }) })
|
|
1644
1664
|
] });
|
|
1645
|
-
}, ze = (r,
|
|
1665
|
+
}, ze = (r, o) => {
|
|
1646
1666
|
r = r.toLowerCase();
|
|
1647
1667
|
let t = r.trim().replace(/ |\+/g, "");
|
|
1648
|
-
if ((t === "auto" || t === "none") &&
|
|
1668
|
+
if ((t === "auto" || t === "none") && o.includes(t))
|
|
1649
1669
|
return { value: "", unit: t };
|
|
1650
|
-
const
|
|
1651
|
-
t = t.replace(
|
|
1652
|
-
const l = r.match(
|
|
1670
|
+
const a = o.length ? new RegExp(o.join("|"), "g") : /XXXXXX/g;
|
|
1671
|
+
t = t.replace(a, "");
|
|
1672
|
+
const l = r.match(a), s = l && l.length > 1, d = !m(t) && Number.isNaN(Number(t));
|
|
1653
1673
|
return s || d ? { error: "Invalid value" } : l && (l[0] === "auto" || l[0] === "none") ? { value: l[0], unit: "" } : { value: t, unit: l ? l[0] : "" };
|
|
1654
1674
|
};
|
|
1655
|
-
const
|
|
1656
|
-
const
|
|
1675
|
+
const bs = (r) => {
|
|
1676
|
+
const o = r.startsWith("-") ? "-" : "", t = r.split("-").pop();
|
|
1657
1677
|
if (["auto", "none"].includes(t))
|
|
1658
1678
|
return { value: "", unit: t };
|
|
1659
1679
|
if (t === "px")
|
|
@@ -1662,22 +1682,22 @@ const ys = (r) => {
|
|
|
1662
1682
|
return { value: "100", unit: r.indexOf("w-") !== -1 ? "vw" : "vh" };
|
|
1663
1683
|
if (t === "full")
|
|
1664
1684
|
return { value: "100", unit: "%" };
|
|
1665
|
-
if (
|
|
1666
|
-
return { value: `${
|
|
1667
|
-
if (
|
|
1668
|
-
return { value: `${
|
|
1669
|
-
if (
|
|
1685
|
+
if (X(r, "skew-"))
|
|
1686
|
+
return { value: `${o}${t}`, unit: "deg" };
|
|
1687
|
+
if (X(r, "rotate-"))
|
|
1688
|
+
return { value: `${o}${t}`, unit: "deg" };
|
|
1689
|
+
if (X(r, "opacity-"))
|
|
1670
1690
|
return { value: `${t / 100}`, unit: "-" };
|
|
1671
|
-
if (
|
|
1691
|
+
if (X(r, "duration-") || X(r, "delay-"))
|
|
1672
1692
|
return { value: `${t}`, unit: "ms" };
|
|
1673
|
-
if (
|
|
1674
|
-
return { value: `${
|
|
1675
|
-
if (
|
|
1676
|
-
return { value: `${
|
|
1693
|
+
if (X(r, "translate-") && !t.includes("/"))
|
|
1694
|
+
return { value: `${o}${`${t / 4}`}`, unit: "rem" };
|
|
1695
|
+
if (X(r, "scale-"))
|
|
1696
|
+
return { value: `${o}${`${t / 100}`}`, unit: "-" };
|
|
1677
1697
|
if (W(r, "border")) {
|
|
1678
|
-
const
|
|
1679
|
-
if (
|
|
1680
|
-
return { value:
|
|
1698
|
+
const a = r.match(/border-?(x|y|t|r|b|l)?\d+/g);
|
|
1699
|
+
if (a)
|
|
1700
|
+
return { value: a[0].split("-").pop(), unit: "px" };
|
|
1681
1701
|
if (r.match(/border-?(x|y|t|r|b|l)?/g))
|
|
1682
1702
|
return { value: "1", unit: "px" };
|
|
1683
1703
|
}
|
|
@@ -1776,43 +1796,43 @@ const ys = (r) => {
|
|
|
1776
1796
|
if (["max", "min", "fit"].includes(t))
|
|
1777
1797
|
return { value: r, unit: "class" };
|
|
1778
1798
|
if (t.includes("/")) {
|
|
1779
|
-
const [
|
|
1780
|
-
return { value:
|
|
1799
|
+
const [a, l] = _(t.split("/"), (s) => parseInt(s, 10));
|
|
1800
|
+
return { value: o + (a / l * 100).toFixed(2).replace(".00", ""), unit: "%" };
|
|
1781
1801
|
}
|
|
1782
|
-
return
|
|
1802
|
+
return St(parseFloat(t)) ? { value: `${o + parseFloat(t) * 4}`, unit: "px" } : { value: t, unit: "class" };
|
|
1783
1803
|
};
|
|
1784
|
-
const
|
|
1804
|
+
const ms = (r) => {
|
|
1785
1805
|
if (m(r))
|
|
1786
1806
|
return { value: "", unit: "" };
|
|
1787
|
-
const
|
|
1788
|
-
if (
|
|
1789
|
-
return
|
|
1790
|
-
const t = y(
|
|
1791
|
-
return { value: `${
|
|
1792
|
-
},
|
|
1807
|
+
const o = r.match(/\[.*\]/g);
|
|
1808
|
+
if (o === null)
|
|
1809
|
+
return fs(r);
|
|
1810
|
+
const t = y(o, "0", "").replace(/\[|\]/g, ""), a = r.startsWith("-") ? "-" : "", l = oe(t.match(/\d+.\d+|\d+/g));
|
|
1811
|
+
return { value: `${a}${l}`, unit: t.replace(l, "") };
|
|
1812
|
+
}, fs = (r) => m(r) ? { value: "", unit: "" } : bs(r), xt = P.createContext({
|
|
1793
1813
|
setDragData: () => {
|
|
1794
1814
|
}
|
|
1795
|
-
}),
|
|
1815
|
+
}), vs = ({
|
|
1796
1816
|
unit: r,
|
|
1797
|
-
currentValue:
|
|
1817
|
+
currentValue: o,
|
|
1798
1818
|
onDrag: t,
|
|
1799
|
-
onDragEnd:
|
|
1819
|
+
onDragEnd: a,
|
|
1800
1820
|
onDragStart: l,
|
|
1801
1821
|
negative: s,
|
|
1802
1822
|
cssProperty: d
|
|
1803
1823
|
}) => {
|
|
1804
|
-
const { setDragData: c } = se(
|
|
1824
|
+
const { setDragData: c } = se(xt);
|
|
1805
1825
|
return /* @__PURE__ */ e.jsx(
|
|
1806
1826
|
"button",
|
|
1807
1827
|
{
|
|
1808
1828
|
type: "button",
|
|
1809
|
-
onMouseDown: (
|
|
1829
|
+
onMouseDown: (n) => {
|
|
1810
1830
|
const p = {
|
|
1811
1831
|
onDrag: t,
|
|
1812
|
-
onDragEnd:
|
|
1832
|
+
onDragEnd: a,
|
|
1813
1833
|
dragging: !0,
|
|
1814
|
-
dragStartY:
|
|
1815
|
-
dragStartValue: `${
|
|
1834
|
+
dragStartY: n.pageY,
|
|
1835
|
+
dragStartValue: `${o}`,
|
|
1816
1836
|
dragUnit: r,
|
|
1817
1837
|
negative: s,
|
|
1818
1838
|
cssProperty: d
|
|
@@ -1821,34 +1841,34 @@ const hs = (r) => {
|
|
|
1821
1841
|
},
|
|
1822
1842
|
color: void 0,
|
|
1823
1843
|
className: "relative z-50 ml-1 hidden h-6 cursor-row-resize rounded bg-background/70 px-2 group-hover:inline",
|
|
1824
|
-
children: /* @__PURE__ */ e.jsx(
|
|
1844
|
+
children: /* @__PURE__ */ e.jsx(Ut, {})
|
|
1825
1845
|
}
|
|
1826
1846
|
);
|
|
1827
|
-
},
|
|
1828
|
-
|
|
1847
|
+
}, ws = ({ onSelect: r, current: o, units: t }) => /* @__PURE__ */ e.jsx("div", { "data-theme": "light", className: "-m-[7px] -mx-[13px] flex w-9 flex-col", children: t.map((a) => /* @__PURE__ */ e.jsx(
|
|
1848
|
+
B,
|
|
1829
1849
|
{
|
|
1830
1850
|
className: "h-max rounded-none px-1 py-1 text-right text-[11px] hover:bg-blue-400",
|
|
1831
|
-
color:
|
|
1851
|
+
color: o === a ? "primary" : void 0,
|
|
1832
1852
|
size: "sm",
|
|
1833
1853
|
onClick: (l) => {
|
|
1834
|
-
l.stopPropagation(), r(
|
|
1854
|
+
l.stopPropagation(), r(a);
|
|
1835
1855
|
},
|
|
1836
|
-
children:
|
|
1856
|
+
children: a
|
|
1837
1857
|
},
|
|
1838
|
-
|
|
1839
|
-
)) }), Ye = 50,
|
|
1840
|
-
const [
|
|
1841
|
-
|
|
1842
|
-
const { value: b, unit: f } =
|
|
1858
|
+
a
|
|
1859
|
+
)) }), Ye = 50, js = (r) => {
|
|
1860
|
+
const [o, t] = w(!1), [a, l] = w(""), { currentClass: s, onChange: d, classPrefix: c, cssProperty: n, units: p, negative: h } = r, [i, u] = w(n != null && n.toLowerCase().includes("width") ? "%" : p[0]), [x, g] = w(!1), [v, C] = w(""), [K, L] = w(!1), [G, q] = w(!1);
|
|
1861
|
+
A(() => {
|
|
1862
|
+
const { value: b, unit: f } = ms(s);
|
|
1843
1863
|
if (f === "") {
|
|
1844
|
-
l(b), u(
|
|
1864
|
+
l(b), u(n != null && n.toLowerCase().includes("width") ? "%" : oe(p));
|
|
1845
1865
|
return;
|
|
1846
1866
|
}
|
|
1847
1867
|
u(f), l(f === "class" || m(b) ? "" : b);
|
|
1848
|
-
}, [s,
|
|
1849
|
-
const S = de((b) => d(b), [d], Ye),
|
|
1868
|
+
}, [s, n, p]);
|
|
1869
|
+
const S = de((b) => d(b), [d], Ye), j = de((b) => d(b, !1), [d], Ye), D = H(
|
|
1850
1870
|
(b = !1) => {
|
|
1851
|
-
const f = ze(`${
|
|
1871
|
+
const f = ze(`${a}`, p);
|
|
1852
1872
|
if (y(f, "error", !1)) {
|
|
1853
1873
|
g(!0);
|
|
1854
1874
|
return;
|
|
@@ -1861,12 +1881,12 @@ const hs = (r) => {
|
|
|
1861
1881
|
if (y(f, "value") === "")
|
|
1862
1882
|
return;
|
|
1863
1883
|
const z = `${y(f, "value", "").startsWith("-") ? "-" : ""}${c}[${y(f, "value", "").replace("-", "")}${N === "-" ? "" : N}]`;
|
|
1864
|
-
b ?
|
|
1884
|
+
b ? j(z) : S(z);
|
|
1865
1885
|
},
|
|
1866
|
-
[S,
|
|
1886
|
+
[S, j, a, i, c, p]
|
|
1867
1887
|
), Z = H(
|
|
1868
1888
|
(b) => {
|
|
1869
|
-
const f = ze(`${
|
|
1889
|
+
const f = ze(`${a}`, p);
|
|
1870
1890
|
if (y(f, "error", !1)) {
|
|
1871
1891
|
g(!0);
|
|
1872
1892
|
return;
|
|
@@ -1880,15 +1900,15 @@ const hs = (r) => {
|
|
|
1880
1900
|
const N = y(f, "unit") !== "" ? y(f, "unit") : b, z = `${y(f, "value", "").startsWith("-") ? "-" : ""}${c}[${y(f, "value", "").replace("-", "")}${N === "-" ? "" : N}]`;
|
|
1881
1901
|
S(z);
|
|
1882
1902
|
},
|
|
1883
|
-
[S,
|
|
1903
|
+
[S, a, c, p]
|
|
1884
1904
|
);
|
|
1885
1905
|
return /* @__PURE__ */ e.jsx("div", { className: "flex w-full flex-col", children: /* @__PURE__ */ e.jsx("div", { className: "flex items-center justify-start", children: i === "class" ? /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
1886
1906
|
/* @__PURE__ */ e.jsx("input", { className: "w-20 rounded py-1", readOnly: !0, value: s }),
|
|
1887
1907
|
/* @__PURE__ */ e.jsxs($, { children: [
|
|
1888
|
-
/* @__PURE__ */ e.jsx(
|
|
1889
|
-
/* @__PURE__ */ e.jsx(
|
|
1908
|
+
/* @__PURE__ */ e.jsx(E, { 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(Se, {}) }) }),
|
|
1909
|
+
/* @__PURE__ */ e.jsx(M, { children: "Current value is using a Tailwind preset class." })
|
|
1890
1910
|
] })
|
|
1891
|
-
] }) : /* @__PURE__ */ e.jsxs("div", { className: `group relative flex items-center ${
|
|
1911
|
+
] }) : /* @__PURE__ */ e.jsxs("div", { className: `group relative flex items-center ${K ? "z-auto" : ""}`, children: [
|
|
1892
1912
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center rounded-md border border-border", children: [
|
|
1893
1913
|
["none", "auto"].indexOf(i) !== -1 ? null : /* @__PURE__ */ e.jsx(
|
|
1894
1914
|
"input",
|
|
@@ -1901,14 +1921,14 @@ const hs = (r) => {
|
|
|
1901
1921
|
if (b.keyCode !== 38 && b.keyCode !== 40)
|
|
1902
1922
|
return;
|
|
1903
1923
|
b.preventDefault(), q(!0);
|
|
1904
|
-
const f =
|
|
1924
|
+
const f = Tt(b.target.value);
|
|
1905
1925
|
let N = Ue(f) ? 0 : f;
|
|
1906
1926
|
b.keyCode === 38 && (N += 1), b.keyCode === 40 && (N -= 1);
|
|
1907
|
-
const O = `${N}`,
|
|
1908
|
-
|
|
1927
|
+
const O = `${N}`, ht = `${O.startsWith("-") ? "-" : ""}${c}[${O.replace("-", "")}${i === "-" ? "" : i}]`;
|
|
1928
|
+
j(ht);
|
|
1909
1929
|
},
|
|
1910
1930
|
onKeyUp: (b) => {
|
|
1911
|
-
|
|
1931
|
+
G && (b.preventDefault(), q(!1));
|
|
1912
1932
|
},
|
|
1913
1933
|
onBlur: () => D(),
|
|
1914
1934
|
onChange: (b) => {
|
|
@@ -1918,19 +1938,19 @@ const hs = (r) => {
|
|
|
1918
1938
|
var f;
|
|
1919
1939
|
(f = b == null ? void 0 : b.target) == null || f.select(), t(!1);
|
|
1920
1940
|
},
|
|
1921
|
-
value:
|
|
1941
|
+
value: K ? v : a,
|
|
1922
1942
|
className: "h-6 w-14 rounded rounded-r-none bg-background pl-2 text-sm focus-visible:outline-0 ".concat(
|
|
1923
1943
|
" ",
|
|
1924
1944
|
x ? "border-red-500 text-red-500" : "border-foreground/20"
|
|
1925
1945
|
)
|
|
1926
1946
|
}
|
|
1927
1947
|
),
|
|
1928
|
-
/* @__PURE__ */ e.jsxs($, { open:
|
|
1929
|
-
/* @__PURE__ */ e.jsx(
|
|
1948
|
+
/* @__PURE__ */ e.jsxs($, { open: o, delayDuration: 100, children: [
|
|
1949
|
+
/* @__PURE__ */ e.jsx(E, { asChild: !0, children: /* @__PURE__ */ e.jsxs(
|
|
1930
1950
|
"button",
|
|
1931
1951
|
{
|
|
1932
1952
|
type: "button",
|
|
1933
|
-
onClick: () => t(!
|
|
1953
|
+
onClick: () => t(!o),
|
|
1934
1954
|
className: "flex h-6 cursor-pointer items-center gap-x-1 rounded rounded-l-none bg-background p-px px-1 text-[11px] uppercase",
|
|
1935
1955
|
children: [
|
|
1936
1956
|
/* @__PURE__ */ e.jsx("span", { className: `inline-block ${p.length === 1 ? "px-2 font-semibold" : ""}`, children: i }),
|
|
@@ -1938,8 +1958,8 @@ const hs = (r) => {
|
|
|
1938
1958
|
]
|
|
1939
1959
|
}
|
|
1940
1960
|
) }),
|
|
1941
|
-
/* @__PURE__ */ e.jsx(Nr, { children: /* @__PURE__ */ e.jsx(
|
|
1942
|
-
|
|
1961
|
+
/* @__PURE__ */ e.jsx(Nr, { children: /* @__PURE__ */ e.jsx(M, { className: "bg-background", children: /* @__PURE__ */ e.jsx(
|
|
1962
|
+
ws,
|
|
1943
1963
|
{
|
|
1944
1964
|
units: p,
|
|
1945
1965
|
current: i,
|
|
@@ -1950,8 +1970,8 @@ const hs = (r) => {
|
|
|
1950
1970
|
) }) })
|
|
1951
1971
|
] })
|
|
1952
1972
|
] }),
|
|
1953
|
-
["none", "auto"].indexOf(i) !== -1 ||
|
|
1954
|
-
|
|
1973
|
+
["none", "auto"].indexOf(i) !== -1 || K ? null : /* @__PURE__ */ e.jsx(
|
|
1974
|
+
vs,
|
|
1955
1975
|
{
|
|
1956
1976
|
onDragStart: () => L(!0),
|
|
1957
1977
|
onDragEnd: (b) => {
|
|
@@ -1965,19 +1985,19 @@ const hs = (r) => {
|
|
|
1965
1985
|
return;
|
|
1966
1986
|
C(b);
|
|
1967
1987
|
const f = `${b}`, O = `${f.startsWith("-") ? "-" : ""}${c}[${f.replace("-", "")}${i === "-" ? "" : i}]`;
|
|
1968
|
-
|
|
1988
|
+
j(O);
|
|
1969
1989
|
},
|
|
1970
|
-
currentValue:
|
|
1990
|
+
currentValue: a,
|
|
1971
1991
|
unit: i,
|
|
1972
1992
|
negative: h,
|
|
1973
|
-
cssProperty:
|
|
1993
|
+
cssProperty: n
|
|
1974
1994
|
}
|
|
1975
1995
|
)
|
|
1976
1996
|
] }) }) });
|
|
1977
|
-
},
|
|
1978
|
-
const
|
|
1979
|
-
return
|
|
1980
|
-
},
|
|
1997
|
+
}, ae = (r) => {
|
|
1998
|
+
const o = ue();
|
|
1999
|
+
return Rt(o, { property: r });
|
|
2000
|
+
}, Cs = (r, o) => {
|
|
1981
2001
|
const t = {
|
|
1982
2002
|
xs: 0,
|
|
1983
2003
|
sm: 1,
|
|
@@ -1986,8 +2006,8 @@ const hs = (r) => {
|
|
|
1986
2006
|
xl: 4,
|
|
1987
2007
|
"2xl": 5
|
|
1988
2008
|
};
|
|
1989
|
-
return t[y(r, "mq", "xs")] <= t[
|
|
1990
|
-
},
|
|
2009
|
+
return t[y(r, "mq", "xs")] <= t[o];
|
|
2010
|
+
}, ks = {
|
|
1991
2011
|
width: "w-",
|
|
1992
2012
|
height: "h-",
|
|
1993
2013
|
minWidth: "min-w-",
|
|
@@ -2053,64 +2073,64 @@ const hs = (r) => {
|
|
|
2053
2073
|
insetY: "inset-y-",
|
|
2054
2074
|
opacity: "opacity-",
|
|
2055
2075
|
flexBasis: "basis-"
|
|
2056
|
-
},
|
|
2076
|
+
}, Xe = {
|
|
2057
2077
|
xs: "",
|
|
2058
2078
|
sm: "640px",
|
|
2059
2079
|
md: "768px",
|
|
2060
2080
|
lg: "1024px",
|
|
2061
2081
|
xl: "1280px",
|
|
2062
2082
|
"2xl": "1536px"
|
|
2063
|
-
},
|
|
2064
|
-
const { t:
|
|
2065
|
-
}, units: d, negative: c = !1 } = r, [
|
|
2066
|
-
(
|
|
2067
|
-
const Z = { dark:
|
|
2068
|
-
(
|
|
2083
|
+
}, Ns = (r) => `${r.toUpperCase()} ${Xe[r] ? `(${Xe[r]} & up)` : ""}`, Ve = (r) => {
|
|
2084
|
+
const { t: o } = I(), { type: t = "icons", label: a, property: l, onEmitChange: s = () => {
|
|
2085
|
+
}, units: d, negative: c = !1 } = r, [n] = _r(), [p] = Sr(), [, h] = Ie(), i = ae(l), u = Te(), x = at(), [g] = nt(), v = T(() => y(i, "fullCls", ""), [i]), C = H(
|
|
2086
|
+
(j, D = !0) => {
|
|
2087
|
+
const Z = { dark: n, mq: h, mod: p, cls: j, property: l, fullCls: "" };
|
|
2088
|
+
(n || p !== "") && (Z.mq = "xs");
|
|
2069
2089
|
const b = Gr(Z);
|
|
2070
2090
|
u(g, [b], D);
|
|
2071
2091
|
},
|
|
2072
|
-
[g,
|
|
2073
|
-
),
|
|
2092
|
+
[g, n, h, p, l, u]
|
|
2093
|
+
), K = H(() => {
|
|
2074
2094
|
x(g, [v]);
|
|
2075
|
-
}, [g, v, x]), L = T(() =>
|
|
2076
|
-
|
|
2095
|
+
}, [g, v, x]), L = T(() => Cs(i, h), [i, h]);
|
|
2096
|
+
A(() => {
|
|
2077
2097
|
s(L, i);
|
|
2078
2098
|
}, [L, s, i]);
|
|
2079
|
-
const [, ,
|
|
2080
|
-
(
|
|
2081
|
-
|
|
2099
|
+
const [, , G] = Ie(), q = H(
|
|
2100
|
+
(j) => {
|
|
2101
|
+
G({
|
|
2082
2102
|
xs: 400,
|
|
2083
2103
|
sm: 640,
|
|
2084
2104
|
md: 800,
|
|
2085
2105
|
lg: 1024,
|
|
2086
2106
|
xl: 1420,
|
|
2087
2107
|
"2xl": 1920
|
|
2088
|
-
}[
|
|
2108
|
+
}[j]);
|
|
2089
2109
|
},
|
|
2090
|
-
[
|
|
2091
|
-
), S = y(i, "dark", null) ===
|
|
2092
|
-
return /* @__PURE__ */ e.jsx(
|
|
2093
|
-
/* @__PURE__ */ e.jsx("div", { className: "relative w-[70px] truncate text-xs text-foreground", children: /* @__PURE__ */ e.jsx("span", { className: `text-[11px] ${i && !S ? "text-foreground" : ""}`, children: a
|
|
2110
|
+
[G]
|
|
2111
|
+
), S = y(i, "dark", null) === n && y(i, "mod", null) === p && y(i, "mq", null) === h;
|
|
2112
|
+
return /* @__PURE__ */ e.jsx(us, { canChange: L, canReset: i && S, children: /* @__PURE__ */ e.jsxs("div", { className: "group flex flex-row items-center py-2 first:pt-0 last:pb-0", children: [
|
|
2113
|
+
/* @__PURE__ */ e.jsx("div", { className: "relative w-[70px] truncate text-xs text-foreground", children: /* @__PURE__ */ e.jsx("span", { className: `text-[11px] ${i && !S ? "text-foreground" : ""}`, children: o(a) }) }),
|
|
2094
2114
|
/* @__PURE__ */ e.jsxs("div", { className: "flex flex-row items-center", children: [
|
|
2095
2115
|
/* @__PURE__ */ e.jsxs("div", { className: "w-[150px]", children: [
|
|
2096
2116
|
t === "arbitrary" ? /* @__PURE__ */ e.jsx(
|
|
2097
|
-
|
|
2117
|
+
js,
|
|
2098
2118
|
{
|
|
2099
2119
|
currentClass: y(i, "cls", ""),
|
|
2100
|
-
classPrefix: y(
|
|
2120
|
+
classPrefix: y(ks, l, ""),
|
|
2101
2121
|
units: d || [],
|
|
2102
2122
|
onChange: C,
|
|
2103
2123
|
negative: c,
|
|
2104
2124
|
cssProperty: l
|
|
2105
2125
|
}
|
|
2106
2126
|
) : null,
|
|
2107
|
-
t === "icons" && /* @__PURE__ */ e.jsx(
|
|
2108
|
-
t === "range" && /* @__PURE__ */ e.jsx(
|
|
2109
|
-
t === "color" && /* @__PURE__ */ e.jsx(
|
|
2110
|
-
t === "dropdown" && /* @__PURE__ */ e.jsx(
|
|
2127
|
+
t === "icons" && /* @__PURE__ */ e.jsx(xs, { property: l, onChange: C }),
|
|
2128
|
+
t === "range" && /* @__PURE__ */ e.jsx(gs, { property: l, onChange: C }),
|
|
2129
|
+
t === "color" && /* @__PURE__ */ e.jsx(hs, { property: l, onChange: C }),
|
|
2130
|
+
t === "dropdown" && /* @__PURE__ */ e.jsx(gt, { label: a, property: l, onChange: C })
|
|
2111
2131
|
] }),
|
|
2112
|
-
/* @__PURE__ */ e.jsx("div", { className: `w-[30px] cursor-pointer ${v ? "visible" : "invisible"}`, children: S ? /* @__PURE__ */ e.jsx("button", { type: "button", onClick: () =>
|
|
2113
|
-
/* @__PURE__ */ e.jsx(
|
|
2132
|
+
/* @__PURE__ */ e.jsx("div", { className: `w-[30px] cursor-pointer ${v ? "visible" : "invisible"}`, children: S ? /* @__PURE__ */ e.jsx("button", { type: "button", onClick: () => K(), title: "Reset", className: "flex px-1.5 text-xs", children: /* @__PURE__ */ e.jsx(Gt, { className: "h-5 w-5 text-blue-500 hover:opacity-80" }) }) : L && i ? /* @__PURE__ */ e.jsxs($, { delayDuration: 100, children: [
|
|
2133
|
+
/* @__PURE__ */ e.jsx(E, { asChild: !0, children: /* @__PURE__ */ e.jsx(
|
|
2114
2134
|
"button",
|
|
2115
2135
|
{
|
|
2116
2136
|
type: "button",
|
|
@@ -2118,11 +2138,11 @@ const hs = (r) => {
|
|
|
2118
2138
|
children: /* @__PURE__ */ e.jsx(Se, {})
|
|
2119
2139
|
}
|
|
2120
2140
|
) }),
|
|
2121
|
-
/* @__PURE__ */ e.jsx(
|
|
2141
|
+
/* @__PURE__ */ e.jsx(M, { children: /* @__PURE__ */ e.jsx("div", { className: "text-right", children: /* @__PURE__ */ e.jsxs("div", { children: [
|
|
2122
2142
|
"Current style is set at ",
|
|
2123
2143
|
/* @__PURE__ */ e.jsxs("span", { className: "font-bold", children: [
|
|
2124
|
-
|
|
2125
|
-
|
|
2144
|
+
Ns(y(i, "mq")),
|
|
2145
|
+
n && !i.dark ? "(Light mode)" : ""
|
|
2126
2146
|
] }),
|
|
2127
2147
|
/* @__PURE__ */ e.jsx("br", {}),
|
|
2128
2148
|
/* @__PURE__ */ e.jsxs(
|
|
@@ -2141,40 +2161,40 @@ const hs = (r) => {
|
|
|
2141
2161
|
] }) : null })
|
|
2142
2162
|
] })
|
|
2143
2163
|
] }) });
|
|
2144
|
-
},
|
|
2164
|
+
}, _s = ["px", "%", "em", "rem", "ch", "vh", "vw"], yt = ({
|
|
2145
2165
|
label: r,
|
|
2146
|
-
options:
|
|
2166
|
+
options: o,
|
|
2147
2167
|
borderB: t = !1,
|
|
2148
|
-
borderT:
|
|
2168
|
+
borderT: a = !1,
|
|
2149
2169
|
type: l = "arbitrary",
|
|
2150
|
-
units: s =
|
|
2170
|
+
units: s = _s,
|
|
2151
2171
|
negative: d = !1
|
|
2152
2172
|
}) => {
|
|
2153
|
-
const { t: c } =
|
|
2173
|
+
const { t: c } = I(), [n, p] = w(o[0].key), h = ue(), i = H((u) => _(h, "property").includes(u), [h]);
|
|
2154
2174
|
return /* @__PURE__ */ e.jsxs(
|
|
2155
2175
|
"div",
|
|
2156
2176
|
{
|
|
2157
|
-
className: `mb-2 border-gray-800 py-2 first:pt-0 last:pb-0 ${t ? "border-b" : ""} ${
|
|
2177
|
+
className: `mb-2 border-gray-800 py-2 first:pt-0 last:pb-0 ${t ? "border-b" : ""} ${a ? "border-t" : ""}`,
|
|
2158
2178
|
children: [
|
|
2159
2179
|
/* @__PURE__ */ e.jsxs("div", { className: "flex flex-row text-xs", children: [
|
|
2160
2180
|
r && /* @__PURE__ */ e.jsx("span", { className: "relative w-[70px] flex-none text-xs text-foreground", children: c(r) }),
|
|
2161
|
-
/* @__PURE__ */ e.jsx("div", { className: "mb-3 flex grow flex-row flex-wrap gap-x-px", children:
|
|
2162
|
-
|
|
2163
|
-
/* @__PURE__ */ e.jsx(
|
|
2181
|
+
/* @__PURE__ */ e.jsx("div", { className: "mb-3 flex grow flex-row flex-wrap gap-x-px", children: P.Children.toArray(
|
|
2182
|
+
o.map(({ label: u, key: x }) => /* @__PURE__ */ e.jsx("div", { className: "first:rounded-l last:rounded-r", children: /* @__PURE__ */ e.jsxs($, { children: [
|
|
2183
|
+
/* @__PURE__ */ e.jsx(E, { asChild: !0, children: /* @__PURE__ */ e.jsxs(
|
|
2164
2184
|
"button",
|
|
2165
2185
|
{
|
|
2166
2186
|
type: "button",
|
|
2167
2187
|
onClick: () => p(x),
|
|
2168
|
-
className: `relative cursor-pointer rounded-full p-1 text-[8px] ${x ===
|
|
2188
|
+
className: `relative cursor-pointer rounded-full p-1 text-[8px] ${x === n ? " bg-[#3E57F0] text-white" : "text-gray-600 dark:text-gray-300"}`,
|
|
2169
2189
|
children: [
|
|
2170
|
-
|
|
2190
|
+
P.createElement("div", {
|
|
2171
2191
|
className: i(x) ? "-bottom-1.5 absolute bg-[#3E57F0] h-[2px] left-0 w-full" : ""
|
|
2172
2192
|
}),
|
|
2173
|
-
|
|
2193
|
+
P.createElement(y(ut, x, Ge), { className: "text-inherit w-3 h-3" })
|
|
2174
2194
|
]
|
|
2175
2195
|
}
|
|
2176
2196
|
) }),
|
|
2177
|
-
/* @__PURE__ */ e.jsx(
|
|
2197
|
+
/* @__PURE__ */ e.jsx(M, { children: F(re(u)) })
|
|
2178
2198
|
] }) }))
|
|
2179
2199
|
) })
|
|
2180
2200
|
] }),
|
|
@@ -2184,22 +2204,22 @@ const hs = (r) => {
|
|
|
2184
2204
|
type: l,
|
|
2185
2205
|
units: [...s],
|
|
2186
2206
|
label: "",
|
|
2187
|
-
property:
|
|
2207
|
+
property: n,
|
|
2188
2208
|
negative: d
|
|
2189
2209
|
}
|
|
2190
2210
|
) })
|
|
2191
2211
|
]
|
|
2192
2212
|
}
|
|
2193
2213
|
);
|
|
2194
|
-
},
|
|
2195
|
-
const { t } =
|
|
2196
|
-
const s = (
|
|
2197
|
-
|
|
2214
|
+
}, Ss = ({ heading: r, items: o }) => {
|
|
2215
|
+
const { t } = I(), a = ue(), l = T(() => {
|
|
2216
|
+
const s = (n) => De(
|
|
2217
|
+
n.map((p) => p.styleType === "multiple" ? _(p.options, "key") : p.property)
|
|
2198
2218
|
), d = De(
|
|
2199
|
-
|
|
2200
|
-
), c = _(
|
|
2201
|
-
return
|
|
2202
|
-
}, [
|
|
2219
|
+
o.map((n) => n.styleType === "accordion" ? s(n.items) : n.styleType === "multiple" ? _(n.options, "key") : n.property)
|
|
2220
|
+
), c = _(a, "property");
|
|
2221
|
+
return Vt(d, c).length > 0;
|
|
2222
|
+
}, [a, o]);
|
|
2203
2223
|
return /* @__PURE__ */ e.jsxs("details", { children: [
|
|
2204
2224
|
/* @__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: [
|
|
2205
2225
|
t(r),
|
|
@@ -2210,17 +2230,17 @@ const hs = (r) => {
|
|
|
2210
2230
|
}
|
|
2211
2231
|
) : null
|
|
2212
2232
|
] }) }),
|
|
2213
|
-
/* @__PURE__ */ e.jsx("div", { className: "p-2", children:
|
|
2233
|
+
/* @__PURE__ */ e.jsx("div", { className: "p-2", children: o.map((s) => s.styleType === "multiple" ? /* @__PURE__ */ e.jsx(yt, { ...s }, s.label) : /* @__PURE__ */ e.jsx(Ve, { ...s }, s.label)) })
|
|
2214
2234
|
] });
|
|
2215
|
-
},
|
|
2216
|
-
const { t:
|
|
2235
|
+
}, Ts = Fe({}), xe = ({ section: r }) => {
|
|
2236
|
+
const { t: o } = I(), t = ue(), a = H(
|
|
2217
2237
|
(s = []) => {
|
|
2218
2238
|
const d = {};
|
|
2219
|
-
for (let
|
|
2220
|
-
d[t[
|
|
2239
|
+
for (let n = 0; n < t.length; n++)
|
|
2240
|
+
d[t[n].property] = t[n].cls;
|
|
2221
2241
|
let c = !0;
|
|
2222
|
-
for (const
|
|
2223
|
-
if (!ie(d,
|
|
2242
|
+
for (const n in s)
|
|
2243
|
+
if (!ie(d, n) || d[n] !== s[n]) {
|
|
2224
2244
|
c = !1;
|
|
2225
2245
|
break;
|
|
2226
2246
|
}
|
|
@@ -2228,26 +2248,26 @@ const hs = (r) => {
|
|
|
2228
2248
|
},
|
|
2229
2249
|
[t]
|
|
2230
2250
|
), l = T(() => ({}), []);
|
|
2231
|
-
return /* @__PURE__ */ e.jsx(
|
|
2232
|
-
/* @__PURE__ */ e.jsx(fe, { className: "bg-gray-200 px-3 py-2 text-xs hover:no-underline", children: /* @__PURE__ */ e.jsx("div", { className: "flex items-center gap-x-2", children:
|
|
2233
|
-
/* @__PURE__ */ e.jsx(ve, { className: "bg-gray-100 px-3.5 py-2", children:
|
|
2234
|
-
r.items.map((s) => ie(s, "component") ?
|
|
2251
|
+
return /* @__PURE__ */ e.jsx(Ts.Provider, { value: l, children: /* @__PURE__ */ e.jsxs(me, { value: r.heading, children: [
|
|
2252
|
+
/* @__PURE__ */ e.jsx(fe, { className: "bg-gray-200 px-3 py-2 text-xs hover:no-underline", children: /* @__PURE__ */ e.jsx("div", { className: "flex items-center gap-x-2", children: o(r.heading) }) }),
|
|
2253
|
+
/* @__PURE__ */ e.jsx(ve, { className: "bg-gray-100 px-3.5 py-2", children: P.Children.toArray(
|
|
2254
|
+
r.items.map((s) => ie(s, "component") ? P.createElement(s.component, { key: s.label }) : ie(s, "styleType") ? s.styleType === "multiple" ? /* @__PURE__ */ e.jsx(yt, { ...s }, s.label) : s.styleType === "accordion" && a(s == null ? void 0 : s.conditions) ? /* @__PURE__ */ e.jsx(Ss, { ...s }, s.label) : null : /* @__PURE__ */ e.jsx(Ve, { ...s }, s.label))
|
|
2235
2255
|
) })
|
|
2236
2256
|
] }) });
|
|
2237
|
-
},
|
|
2238
|
-
const r =
|
|
2239
|
-
if (m(
|
|
2257
|
+
}, Rs = () => {
|
|
2258
|
+
const r = U(), [o] = pe(), { t } = I(), a = Mr(), l = Te(), s = Re(r._type), d = y(oe(o), "prop"), c = y(s.props, `${d}.presets`, {});
|
|
2259
|
+
if (m(a) && (!ie(s, "props") || m(c)))
|
|
2240
2260
|
return null;
|
|
2241
|
-
const
|
|
2261
|
+
const n = (p) => {
|
|
2242
2262
|
const h = p.trim().toLowerCase().replace(/ +(?= )/g, "").split(" ");
|
|
2243
2263
|
l([r._id], h, !0);
|
|
2244
2264
|
};
|
|
2245
2265
|
return /* @__PURE__ */ e.jsx("div", { className: "h-10", children: /* @__PURE__ */ e.jsxs(Tr, { children: [
|
|
2246
|
-
/* @__PURE__ */ e.jsx(Rr, { asChild: !0, children: /* @__PURE__ */ e.jsx("div", { className: "px-4", children: /* @__PURE__ */ e.jsxs(
|
|
2266
|
+
/* @__PURE__ */ e.jsx(Rr, { asChild: !0, children: /* @__PURE__ */ e.jsx("div", { className: "px-4", children: /* @__PURE__ */ e.jsxs(B, { variant: "default", className: "w-full", size: "sm", children: [
|
|
2247
2267
|
t("Apply Presets"),
|
|
2248
|
-
/* @__PURE__ */ e.jsx(
|
|
2268
|
+
/* @__PURE__ */ e.jsx(qt, {})
|
|
2249
2269
|
] }) }) }),
|
|
2250
|
-
/* @__PURE__ */ e.jsx(Vr, { className: "max-h-80 w-56", children: /* @__PURE__ */ e.jsxs(
|
|
2270
|
+
/* @__PURE__ */ e.jsx(Vr, { className: "max-h-80 w-56", children: /* @__PURE__ */ e.jsxs(dt, { className: "no-scrollbar h-full", children: [
|
|
2251
2271
|
m(c) ? null : /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
2252
2272
|
/* @__PURE__ */ e.jsxs(Pe, { children: [
|
|
2253
2273
|
s.type,
|
|
@@ -2255,37 +2275,34 @@ const hs = (r) => {
|
|
|
2255
2275
|
t("presets")
|
|
2256
2276
|
] }),
|
|
2257
2277
|
/* @__PURE__ */ e.jsx(Ae, {}),
|
|
2258
|
-
/* @__PURE__ */ e.jsx($e, { children: he(c).map((p) => /* @__PURE__ */ e.jsxs(
|
|
2259
|
-
be(
|
|
2260
|
-
/* @__PURE__ */ e.jsx(
|
|
2278
|
+
/* @__PURE__ */ e.jsx($e, { children: he(c).map((p) => /* @__PURE__ */ e.jsxs(Ee, { className: "group text-xs", onClick: () => n(c[p]), children: [
|
|
2279
|
+
be(F(t(p))),
|
|
2280
|
+
/* @__PURE__ */ e.jsx(Me, { className: "invisible hover:font-bold hover:text-blue-600 group-hover:visible", children: t("apply") })
|
|
2261
2281
|
] })) })
|
|
2262
2282
|
] }),
|
|
2263
|
-
m(
|
|
2283
|
+
m(a) ? null : /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
2264
2284
|
/* @__PURE__ */ e.jsx(Pe, { children: t("Global presets") }),
|
|
2265
2285
|
/* @__PURE__ */ e.jsx(Ae, {}),
|
|
2266
|
-
/* @__PURE__ */ e.jsx($e, { children: he(
|
|
2267
|
-
be(
|
|
2268
|
-
/* @__PURE__ */ e.jsx(
|
|
2286
|
+
/* @__PURE__ */ e.jsx($e, { children: he(a).map((p) => /* @__PURE__ */ e.jsxs(Ee, { className: "group text-xs", onClick: () => n(a[p]), children: [
|
|
2287
|
+
be(F(t(p))),
|
|
2288
|
+
/* @__PURE__ */ e.jsx(Me, { className: "invisible hover:font-bold hover:text-blue-600 group-hover:visible", children: t("apply") })
|
|
2269
2289
|
] })) })
|
|
2270
2290
|
] })
|
|
2271
2291
|
] }) })
|
|
2272
2292
|
] }) });
|
|
2273
2293
|
};
|
|
2274
|
-
function
|
|
2275
|
-
const { flexChild: r, gridChild:
|
|
2276
|
-
return m(
|
|
2277
|
-
/* @__PURE__ */ e.jsx(
|
|
2278
|
-
/* @__PURE__ */ e.
|
|
2279
|
-
|
|
2280
|
-
|
|
2281
|
-
|
|
2282
|
-
r && /* @__PURE__ */ e.jsx(xe, { section: ns }),
|
|
2283
|
-
a ? /* @__PURE__ */ e.jsx(xe, { section: is }) : null,
|
|
2284
|
-
ds.map((l) => /* @__PURE__ */ e.jsx(xe, { section: l }, l.heading))
|
|
2294
|
+
function Vs() {
|
|
2295
|
+
const { flexChild: r, gridChild: o } = Hr(), [t] = pe();
|
|
2296
|
+
return m(t) ? null : /* @__PURE__ */ e.jsxs("div", { className: "flex h-full flex-col", children: [
|
|
2297
|
+
/* @__PURE__ */ e.jsx(Rs, {}),
|
|
2298
|
+
/* @__PURE__ */ e.jsxs(lt, { defaultValue: ["Styles"], type: "multiple", className: "w-full", children: [
|
|
2299
|
+
r && /* @__PURE__ */ e.jsx(xe, { section: ds }),
|
|
2300
|
+
o ? /* @__PURE__ */ e.jsx(xe, { section: cs }) : null,
|
|
2301
|
+
ps.map((a) => /* @__PURE__ */ e.jsx(xe, { section: a }, a.heading))
|
|
2285
2302
|
] })
|
|
2286
2303
|
] });
|
|
2287
2304
|
}
|
|
2288
|
-
const
|
|
2305
|
+
const Hs = {
|
|
2289
2306
|
px: 1,
|
|
2290
2307
|
"%": 1,
|
|
2291
2308
|
em: 100,
|
|
@@ -2296,10 +2313,10 @@ const Rs = {
|
|
|
2296
2313
|
"-": 1,
|
|
2297
2314
|
deg: 1,
|
|
2298
2315
|
ms: 0.1
|
|
2299
|
-
},
|
|
2300
|
-
const r =
|
|
2301
|
-
onDrag: (
|
|
2302
|
-
onDragEnd: (
|
|
2316
|
+
}, Ho = () => {
|
|
2317
|
+
const r = U(), { t: o } = I(), [t, a] = P.useState(""), [l, s] = P.useState({
|
|
2318
|
+
onDrag: (n) => n,
|
|
2319
|
+
onDragEnd: (n) => n,
|
|
2303
2320
|
dragStartY: 0,
|
|
2304
2321
|
dragging: !1,
|
|
2305
2322
|
dragStartValue: 0,
|
|
@@ -2307,21 +2324,21 @@ const Rs = {
|
|
|
2307
2324
|
negative: !1,
|
|
2308
2325
|
cssProperty: ""
|
|
2309
2326
|
}), d = de(
|
|
2310
|
-
(
|
|
2327
|
+
(n) => {
|
|
2311
2328
|
const p = !y(l, "negative", !1), h = y(l, "cssProperty", "");
|
|
2312
2329
|
let i = parseFloat(l.dragStartValue);
|
|
2313
2330
|
i = Ue(i) ? 0 : i;
|
|
2314
|
-
let u =
|
|
2331
|
+
let u = Hs[l.dragUnit];
|
|
2315
2332
|
(W(h, "scale") || h === "opacity") && (u = 10);
|
|
2316
|
-
let g = (l.dragStartY -
|
|
2317
|
-
p && g < 0 && (g = 0), h === "opacity" && g > 1 && (g = 1), l.onDrag(`${g}`),
|
|
2333
|
+
let g = (l.dragStartY - n.pageY) / u + i;
|
|
2334
|
+
p && g < 0 && (g = 0), h === "opacity" && g > 1 && (g = 1), l.onDrag(`${g}`), a(`${g}`);
|
|
2318
2335
|
},
|
|
2319
2336
|
[l],
|
|
2320
2337
|
50
|
|
2321
2338
|
), c = H(() => {
|
|
2322
2339
|
setTimeout(() => l.onDragEnd(`${t}`), 100), s({
|
|
2323
|
-
onDrag: (
|
|
2324
|
-
onDragEnd: (
|
|
2340
|
+
onDrag: (n) => n,
|
|
2341
|
+
onDragEnd: (n) => n,
|
|
2325
2342
|
dragStartY: 0,
|
|
2326
2343
|
dragging: !1,
|
|
2327
2344
|
dragStartValue: 0,
|
|
@@ -2330,10 +2347,10 @@ const Rs = {
|
|
|
2330
2347
|
cssProperty: ""
|
|
2331
2348
|
});
|
|
2332
2349
|
}, [l, t, s]);
|
|
2333
|
-
return
|
|
2334
|
-
/* @__PURE__ */ e.jsx(
|
|
2335
|
-
/* @__PURE__ */ e.jsx("h1", { children:
|
|
2336
|
-
] }) }) : /* @__PURE__ */ e.jsx(
|
|
2350
|
+
return Ht(r) ? /* @__PURE__ */ e.jsx("div", { className: "p-4 text-center", children: /* @__PURE__ */ e.jsxs("div", { className: "space-y-4 rounded-xl p-4", children: [
|
|
2351
|
+
/* @__PURE__ */ e.jsx(Jt, { className: "mx-auto text-3xl" }),
|
|
2352
|
+
/* @__PURE__ */ e.jsx("h1", { children: o("no_block_selected_for_styling") })
|
|
2353
|
+
] }) }) : /* @__PURE__ */ e.jsx(qe, { children: /* @__PURE__ */ e.jsxs(xt.Provider, { value: { setDragData: s }, children: [
|
|
2337
2354
|
l.dragging ? /* @__PURE__ */ e.jsx(
|
|
2338
2355
|
"div",
|
|
2339
2356
|
{
|
|
@@ -2342,9 +2359,9 @@ const Rs = {
|
|
|
2342
2359
|
className: "absolute inset-0 z-30 cursor-row-resize bg-gray-300/10"
|
|
2343
2360
|
}
|
|
2344
2361
|
) : null,
|
|
2345
|
-
/* @__PURE__ */ e.jsxs(
|
|
2346
|
-
/* @__PURE__ */ e.jsx(
|
|
2347
|
-
/* @__PURE__ */ e.jsx(
|
|
2362
|
+
/* @__PURE__ */ e.jsxs(dt, { className: "no-scrollbar max-h-full flex-1 overflow-x-hidden overflow-y-hidden bg-gray-100 pb-5", children: [
|
|
2363
|
+
/* @__PURE__ */ e.jsx(ls, {}),
|
|
2364
|
+
/* @__PURE__ */ e.jsx(Vs, {}),
|
|
2348
2365
|
/* @__PURE__ */ e.jsx("br", {}),
|
|
2349
2366
|
/* @__PURE__ */ e.jsx("br", {}),
|
|
2350
2367
|
/* @__PURE__ */ e.jsx("br", {})
|
|
@@ -2352,5 +2369,5 @@ const Rs = {
|
|
|
2352
2369
|
] }) });
|
|
2353
2370
|
};
|
|
2354
2371
|
export {
|
|
2355
|
-
|
|
2372
|
+
Ho as default
|
|
2356
2373
|
};
|