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