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