@chaibuilder/sdk 1.2.9 → 1.2.11
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/README.md +10 -12
- package/dist/AddBlocks-TSt8uJY4.js +218 -0
- package/dist/AddBlocks-k2p8Hy1n.cjs +1 -0
- package/dist/BrandingOptions-WyVWfFVz.cjs +1 -0
- package/dist/{BrandingOptions-QJJ1y5ez.js → BrandingOptions-uFTyYJZj.js} +18 -22
- package/dist/CanvasArea-5erOZYLy.cjs +60 -0
- package/dist/{CanvasArea-mlNKmCOh.js → CanvasArea-iRQqpOak.js} +465 -481
- package/dist/{utils-AvyFzbPC.js → Class-17XFhL48.js} +15 -16
- package/dist/Class-5ARpH_Tu.cjs +1 -0
- package/dist/CurrentPage-NzmJloN7.cjs +1 -0
- package/dist/{CurrentPage-lBy25sZn.js → CurrentPage-RCxTz9Mc.js} +24 -26
- package/dist/{Layers-3Xs4A5i8.js → Layers-tXB5Pwid.js} +124 -158
- package/dist/Layers-xDG7oltg.cjs +1 -0
- package/dist/PagesPanel-72nzYB1k.cjs +1 -0
- package/dist/{PagesPanel--BZhafnt.js → PagesPanel-Jaz9jvye.js} +14 -16
- package/dist/{ProjectPanel-YcLkM-DW.js → ProjectPanel--S014Xx3.js} +22 -24
- package/dist/ProjectPanel-RU0QvH6e.cjs +1 -0
- package/dist/Settings-5EuwaVb3.cjs +1 -0
- package/dist/{Settings-TAgX4hov.js → Settings-gjvl5V1k.js} +556 -579
- package/dist/{SidePanels-btVQQkVK.js → SidePanels-Fq3kRwR0.js} +54 -51
- package/dist/SidePanels-uNCxnGte.cjs +1 -0
- package/dist/Topbar-JqW89xI5.cjs +1 -0
- package/dist/{Topbar-j4t4AgCq.js → Topbar-m5dbbI1f.js} +15 -17
- package/dist/{UnsplashImages-41Y3q5_Q.js → UnsplashImages-GhBD6owT.js} +24 -26
- package/dist/UnsplashImages-vACw5hbK.cjs +1 -0
- package/dist/UploadImages-PzHdEKHT.cjs +1 -0
- package/dist/{UploadImages-xBg-kbKv.js → UploadImages-S1HgxeGb.js} +23 -25
- package/dist/{add-page-modal-cm8damU2.js → add-page-modal-2P5hGXOQ.js} +15 -17
- package/dist/add-page-modal-GAizM2Jw.cjs +1 -0
- package/dist/{confirm-alert-i4pM3mOt.js → confirm-alert-57Xq5foA.js} +12 -14
- package/dist/confirm-alert-Uf84DpdR.cjs +1 -0
- package/dist/core.cjs +1 -1
- package/dist/core.d.ts +13 -58
- package/dist/core.js +47 -58
- package/dist/defaultTheme-IH19g4fv.cjs +1 -0
- package/dist/defaultTheme-YY8mlQS3.js +1055 -0
- package/dist/delete-page-modal-MG42FdnU.cjs +1 -0
- package/dist/{delete-page-modal-YrIBvfFA.js → delete-page-modal-ix5IjaFW.js} +27 -29
- package/dist/email-blocks.cjs +1 -1
- package/dist/email-blocks.js +100 -81
- package/dist/email.cjs +1 -0
- package/dist/email.d.ts +116 -0
- package/dist/email.js +79 -0
- package/dist/{controls-XPXGHKht.js → empty-slot-MWycClTb.js} +61 -50
- package/dist/empty-slot-TF2kd-0X.cjs +1 -0
- package/dist/{form-VbouZlAW.cjs → form-KBb3kA8g.cjs} +1 -1
- package/dist/{form-OVmsLOrc.js → form-SYcFyACJ.js} +18 -18
- package/dist/{index-pZhGT8uT.js → index-Fj3ead-J.js} +4886 -4884
- package/dist/index-aiHDvS5v.cjs +1 -0
- package/dist/{index-N50dZnlC.cjs → index-cM3eKmlx.cjs} +25 -25
- package/dist/index-pNYv0oAF.js +2994 -0
- package/dist/lib.cjs +3 -3
- package/dist/lib.js +95 -1125
- package/dist/page-viewer-Sh99FGYk.cjs +1 -0
- package/dist/{page-viewer-feqJr1QI.js → page-viewer-VxqOevr4.js} +15 -17
- package/dist/project-general-setting-VTLHa-Ik.cjs +1 -0
- package/dist/{project-general-setting-SgagORzW.js → project-general-setting-nWOjPiin.js} +15 -17
- package/dist/{project-seo-setting-wxAGEkd_.js → project-seo-setting-70bWTwsB.js} +17 -19
- package/dist/project-seo-setting-ENAKc2Dl.cjs +1 -0
- package/dist/render.cjs +1 -1
- package/dist/render.d.ts +2 -0
- package/dist/render.js +111 -70
- package/dist/{single-page-detail-dnWMyg6P.js → single-page-detail-3z7TF-Yy.js} +44 -46
- package/dist/single-page-detail-6L38HJC4.cjs +1 -0
- package/dist/studio.cjs +1 -1
- package/dist/studio.js +13 -15
- package/dist/ui.cjs +1 -1
- package/dist/ui.d.ts +4 -4
- package/dist/ui.js +149 -151
- package/dist/{useAddBlockByDrop-inkD7Lck.cjs → useAddBlockByDrop-7mUMwNSG.cjs} +1 -1
- package/dist/{useAddBlockByDrop-_nwI4W3q.js → useAddBlockByDrop-tjQ5DgiO.js} +1 -1
- package/dist/web-blocks.cjs +1 -9
- package/dist/web-blocks.js +431 -442
- package/package.json +8 -2
- package/dist/AddBlocks-tMxKPoen.js +0 -225
- package/dist/AddBlocks-x2LkOHSj.cjs +0 -1
- package/dist/BrandingOptions-EzT9UYd6.cjs +0 -1
- package/dist/CanvasArea-xs4wM64L.cjs +0 -60
- package/dist/CurrentPage-aaU4F7wi.cjs +0 -1
- package/dist/Layers-eaHy5PK9.cjs +0 -1
- package/dist/MarkAsGlobalBlock-BjP-Rqlf.js +0 -88
- package/dist/MarkAsGlobalBlock-X5dNmZcb.cjs +0 -1
- package/dist/PagesPanel-gGKCV394.cjs +0 -1
- package/dist/ProjectPanel-yFJRy0_E.cjs +0 -1
- package/dist/Settings-7wlLcvoh.cjs +0 -1
- package/dist/SidePanels-5H4j0mIs.cjs +0 -1
- package/dist/Topbar-V8xCetWF.cjs +0 -1
- package/dist/UnsplashImages-DbHky6cj.cjs +0 -1
- package/dist/UploadImages-DnQ95_NW.cjs +0 -1
- package/dist/add-page-modal-MwS7iXn_.cjs +0 -1
- package/dist/confirm-alert-U7-NcG7G.cjs +0 -1
- package/dist/controls-Dy1qa8Dc.cjs +0 -1
- package/dist/delete-page-modal-5o4jXu-z.cjs +0 -1
- package/dist/functions-Ox_svtKm.cjs +0 -1
- package/dist/functions-xIebp8Aw.js +0 -23
- package/dist/index-H6vIwGfD.cjs +0 -1
- package/dist/index-niHREMmR.js +0 -2938
- package/dist/page-viewer-SLt8XgYv.cjs +0 -1
- package/dist/project-general-setting-ym0yCdOq.cjs +0 -1
- package/dist/project-seo-setting-Snn2nZgS.cjs +0 -1
- package/dist/single-page-detail-IPod1o5P.cjs +0 -1
- package/dist/utils-PTxFk6qT.cjs +0 -1
|
@@ -1,24 +1,28 @@
|
|
|
1
1
|
import { j as e } from "./jsx-runtime-WbnYoNE9.js";
|
|
2
2
|
import * as ne from "react";
|
|
3
|
-
import
|
|
3
|
+
import P, { useState as C, useMemo as _, useEffect as O, useCallback as V, memo as dt, createContext as Me, useContext as se } from "react";
|
|
4
4
|
import { useThrottledCallback as fe } from "@react-hookz/web";
|
|
5
|
-
import { forEach as ke, isArray as ie, omit as
|
|
5
|
+
import { forEach as ke, isArray as ie, omit as ct, truncate as pt, includes as E, get as x, first as ue, split as ut, startCase as F, toLower as le, isEmpty as f, map as k, find as xt, last as ve, filter as we, set as Oe, debounce as gt, keys as ht, cloneDeep as yt, each as mt, capitalize as bt, reject as ft, nth as Ve, startsWith as W, isNumber as vt, parseInt as wt, isNaN as Ye, findLast as jt, flatten as U, intersection as Fe, has as ye, isNull as Ct } from "lodash-es";
|
|
6
6
|
import { useTranslation as K } from "react-i18next";
|
|
7
|
-
import { PlusIcon as Ne, Cross2Icon as
|
|
8
|
-
import {
|
|
9
|
-
import { u as
|
|
10
|
-
import { Check as
|
|
11
|
-
import { getBlockComponent as
|
|
12
|
-
import { E as
|
|
13
|
-
import { J as
|
|
14
|
-
import
|
|
15
|
-
import
|
|
16
|
-
import { useAtom as
|
|
17
|
-
import
|
|
18
|
-
import
|
|
19
|
-
import { A as
|
|
20
|
-
import { a as
|
|
7
|
+
import { PlusIcon as Ne, Cross2Icon as Xe, EyeOpenIcon as kt, EyeClosedIcon as He, BorderAllIcon as A, WidthIcon as T, HeightIcon as R, ArrowUpIcon as Q, ArrowRightIcon as ee, ArrowDownIcon as te, ArrowLeftIcon as re, ArrowTopLeftIcon as Nt, ArrowTopRightIcon as _t, ArrowBottomRightIcon as St, ArrowBottomLeftIcon as Tt, AlignLeftIcon as Rt, AlignCenterHorizontallyIcon as Vt, AlignRightIcon as Ht, StretchHorizontallyIcon as Bt, FontItalicIcon as Dt, UnderlineIcon as $t, OverlineIcon as It, LetterCaseUppercaseIcon as Pt, Cross1Icon as At, InfoCircledIcon as _e, MinusIcon as Et, BoxIcon as ze, RowSpacingIcon as Lt, TriangleDownIcon as Mt, CrossCircledIcon as Ot, TrashIcon as Yt, MixerHorizontalIcon as Ze } from "@radix-ui/react-icons";
|
|
8
|
+
import { aS as Ft, aT as Xt, B as xe, aU as zt, aV as Zt, aW as Wt, aX as Ut, aY as Kt, aZ as qt, a_ as Gt, $ as q, ae as Jt, af as Qt, ag as er, a$ as tr, ac as rr, b0 as lr, ad as sr, au as X, av as z, aw as Z, b1 as or, b2 as ar, b3 as nr, b4 as ir, b5 as dr, b6 as cr, a4 as We, a3 as pr, i as ur, b7 as Ue, b8 as de, b9 as ce, ba as pe, ab as Se, L as Ke, Y as qe, j as Ge, ay as Te, bb as xr, m as gr, bc as hr, Z as ge, R as yr, a2 as Je, M as Be, a8 as mr, a5 as br, bd as fr, ai as vr, aj as wr, ak as jr, al as Cr, am as H, be as Qe, ao as kr, ap as Nr, aq as De, ar as $e } from "./index-pNYv0oAF.js";
|
|
9
|
+
import { u as _r } from "./empty-slot-MWycClTb.js";
|
|
10
|
+
import { Check as Sr, EditIcon as Tr, TrashIcon as Rr } from "lucide-react";
|
|
11
|
+
import { getBlockComponent as et, getChaiDataProviders as Vr } from "@chaibuilder/runtime";
|
|
12
|
+
import { E as tt, u as rt } from "./index-Fj3ead-J.js";
|
|
13
|
+
import { J as Hr, a as Br, d as Dr } from "./index-e0c8PmRQ.js";
|
|
14
|
+
import $r from "@rjsf/core";
|
|
15
|
+
import Ir from "@rjsf/validator-ajv8";
|
|
16
|
+
import { useAtom as Pr } from "jotai";
|
|
17
|
+
import Ar from "react-autosuggest";
|
|
18
|
+
import Er from "fuse.js";
|
|
19
|
+
import { A as Lr, C as he, g as Mr } from "./Class-17XFhL48.js";
|
|
20
|
+
import { a as Or } from "./MODIFIERS-RiXS5Mn1.js";
|
|
21
21
|
import "./_commonjsHelpers-UyOWmZb0.js";
|
|
22
|
+
import "./Functions-7jnEwJyw.js";
|
|
23
|
+
import "clsx";
|
|
24
|
+
import "tailwind-merge";
|
|
25
|
+
import "flat-to-nested";
|
|
22
26
|
import "@radix-ui/react-toggle";
|
|
23
27
|
import "class-variance-authority";
|
|
24
28
|
import "@radix-ui/react-switch";
|
|
@@ -42,12 +46,6 @@ import "@radix-ui/react-context-menu";
|
|
|
42
46
|
import "react-icons-picker";
|
|
43
47
|
import "react-dom";
|
|
44
48
|
import "react-quill";
|
|
45
|
-
import "flat-to-nested";
|
|
46
|
-
import "./Functions-7jnEwJyw.js";
|
|
47
|
-
import "clsx";
|
|
48
|
-
import "tailwind-merge";
|
|
49
|
-
import "redux-undo";
|
|
50
|
-
import "lodash";
|
|
51
49
|
import "i18next";
|
|
52
50
|
import "@floating-ui/react-dom";
|
|
53
51
|
import "react-textarea-autosize";
|
|
@@ -59,29 +57,29 @@ import "sonner";
|
|
|
59
57
|
import "./html-to-json-57841sEK.js";
|
|
60
58
|
import "himalaya";
|
|
61
59
|
import "./web-blocks.js";
|
|
62
|
-
function
|
|
63
|
-
const
|
|
64
|
-
function
|
|
60
|
+
function Yr(r) {
|
|
61
|
+
const o = [], t = {};
|
|
62
|
+
function s(l, d) {
|
|
65
63
|
ke(d, (a, c) => {
|
|
66
|
-
const
|
|
67
|
-
|
|
64
|
+
const n = l ? `${l}.${c}` : c, u = ie(a) ? "list" : typeof a;
|
|
65
|
+
o.push(n), t[n] = u === "string" ? "text" : u === "object" ? "model" : u, u === "object" && !ie(a) && s(n, a);
|
|
68
66
|
});
|
|
69
67
|
}
|
|
70
|
-
return
|
|
68
|
+
return s("", ct(r, ["styles", "_type", "_id", "_name", "_bindings"])), { paths: o, pathsType: t };
|
|
71
69
|
}
|
|
72
|
-
const je = ({ data: r, fullView:
|
|
70
|
+
const je = ({ data: r, fullView: o }) => {
|
|
73
71
|
if (!r)
|
|
74
72
|
return null;
|
|
75
73
|
const t = typeof r;
|
|
76
|
-
return
|
|
74
|
+
return o ? typeof r == "object" ? /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
77
75
|
/* @__PURE__ */ e.jsx("div", { className: "h-3" }),
|
|
78
|
-
/* @__PURE__ */ e.jsx(
|
|
79
|
-
|
|
76
|
+
/* @__PURE__ */ e.jsx(tt, { children: /* @__PURE__ */ e.jsx(
|
|
77
|
+
Hr,
|
|
80
78
|
{
|
|
81
79
|
data: r,
|
|
82
|
-
shouldExpandNode:
|
|
80
|
+
shouldExpandNode: Br,
|
|
83
81
|
style: {
|
|
84
|
-
...
|
|
82
|
+
...Dr,
|
|
85
83
|
container: "max-h-[40vh] overflow-y-auto text-[12px] leading-[1.5] tracking-wide font-mono",
|
|
86
84
|
stringValue: "text-orange-600",
|
|
87
85
|
label: "text-green-900 font-semibold pr-1 tracking-wider"
|
|
@@ -91,40 +89,40 @@ const je = ({ data: r, fullView: s }) => {
|
|
|
91
89
|
] }) : /* @__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: [
|
|
92
90
|
/* @__PURE__ */ e.jsx("span", { className: "font-medium text-gray-800/80", children: "Content: " }),
|
|
93
91
|
r
|
|
94
|
-
] }) : /* @__PURE__ */ e.jsx("div", { className: "w-full overflow-hidden whitespace-nowrap text-[10px] leading-3 text-gray-800/50", children:
|
|
92
|
+
] }) : /* @__PURE__ */ e.jsx("div", { className: "w-full overflow-hidden whitespace-nowrap text-[10px] leading-3 text-gray-800/50", children: pt(t === "object" ? JSON.stringify(r) : r, { length: 40 }) });
|
|
95
93
|
}, Ie = ({
|
|
96
94
|
type: r,
|
|
97
|
-
value:
|
|
95
|
+
value: o = "",
|
|
98
96
|
setValue: t,
|
|
99
|
-
data:
|
|
97
|
+
data: s,
|
|
100
98
|
onChange: l,
|
|
101
99
|
dataType: d,
|
|
102
100
|
appliedBindings: a
|
|
103
101
|
}) => {
|
|
104
|
-
const { paths: c, pathsType:
|
|
105
|
-
(
|
|
106
|
-
) : c.filter((
|
|
102
|
+
const { paths: c, pathsType: n } = Yr(s), u = r === "PROP" ? et(s == null ? void 0 : s._type) : {}, y = r === "PROP", [i, h] = C(!1), g = _(() => r === "PROP" ? c.filter(
|
|
103
|
+
(p) => !E(a, p) && x(u, `props.${ue(ut(p, "."))}.binding`)
|
|
104
|
+
) : c.filter((p) => d === x(n, p, "")), [r, c, a, d, u]);
|
|
107
105
|
return O(() => {
|
|
108
|
-
|
|
109
|
-
}, [
|
|
106
|
+
o && l(o);
|
|
107
|
+
}, [o, r]), /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
110
108
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-4", children: [
|
|
111
|
-
/* @__PURE__ */ e.jsx("p", { className: "text-sm text-muted-foreground", children:
|
|
112
|
-
/* @__PURE__ */ e.jsxs(
|
|
113
|
-
/* @__PURE__ */ e.jsx(
|
|
109
|
+
/* @__PURE__ */ e.jsx("p", { className: "text-sm text-muted-foreground", children: F(le(r)) }),
|
|
110
|
+
/* @__PURE__ */ e.jsxs(Ft, { open: i, onOpenChange: h, children: [
|
|
111
|
+
/* @__PURE__ */ e.jsx(Xt, { asChild: !0, children: /* @__PURE__ */ e.jsx(
|
|
114
112
|
xe,
|
|
115
113
|
{
|
|
116
114
|
variant: "outline",
|
|
117
115
|
size: "sm",
|
|
118
|
-
className: ` ${
|
|
119
|
-
children:
|
|
116
|
+
className: ` ${f(o) ? "w-44 justify-center bg-blue-500 text-gray-100 hover:bg-blue-400 hover:text-white" : "min-w-[350px] items-center justify-between"}`,
|
|
117
|
+
children: o ? /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
120
118
|
/* @__PURE__ */ e.jsxs("span", { className: "pr-8 text-sm", children: [
|
|
121
|
-
y && /* @__PURE__ */ e.jsx("span", { className: "mr-2 rounded-full bg-purple-100 px-2 py-0.5 text-[10px] text-purple-500", children:
|
|
122
|
-
|
|
119
|
+
y && /* @__PURE__ */ e.jsx("span", { className: "mr-2 rounded-full bg-purple-100 px-2 py-0.5 text-[10px] text-purple-500", children: F(d) }),
|
|
120
|
+
o
|
|
123
121
|
] }),
|
|
124
122
|
/* @__PURE__ */ e.jsx("span", { className: "cursor-pointer text-[9px] text-blue-400 underline hover:text-blue-700", children: "Change" })
|
|
125
123
|
] }) : /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
126
124
|
"+ Set ",
|
|
127
|
-
|
|
125
|
+
F(le(r))
|
|
128
126
|
] })
|
|
129
127
|
}
|
|
130
128
|
) }),
|
|
@@ -132,50 +130,50 @@ const je = ({ data: r, fullView: s }) => {
|
|
|
132
130
|
/* @__PURE__ */ e.jsx(Wt, { placeholder: `Choose ${le(r)}...` }),
|
|
133
131
|
/* @__PURE__ */ e.jsxs(Ut, { children: [
|
|
134
132
|
/* @__PURE__ */ e.jsx(Kt, { children: "No results found." }),
|
|
135
|
-
/* @__PURE__ */ e.jsx(qt, { children:
|
|
133
|
+
/* @__PURE__ */ e.jsx(qt, { children: k(g, (p) => /* @__PURE__ */ e.jsxs(
|
|
136
134
|
Gt,
|
|
137
135
|
{
|
|
138
|
-
value:
|
|
136
|
+
value: p,
|
|
139
137
|
className: `cursor-pointer ${y ? "flex items-center justify-between" : "flex flex-col items-start justify-start"}`,
|
|
140
|
-
onSelect: (
|
|
141
|
-
t(
|
|
138
|
+
onSelect: (b) => {
|
|
139
|
+
t(xt(g, (w) => w === b) || null), h(!1);
|
|
142
140
|
},
|
|
143
141
|
children: [
|
|
144
142
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-x-2", children: [
|
|
145
|
-
/* @__PURE__ */ e.jsx(
|
|
146
|
-
|
|
143
|
+
/* @__PURE__ */ e.jsx(Sr, { className: `h-4 w-4 text-green-500 ${o === p ? "" : "opacity-0"}` }),
|
|
144
|
+
p
|
|
147
145
|
] }),
|
|
148
|
-
y ? /* @__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:
|
|
146
|
+
y ? /* @__PURE__ */ e.jsx("div", { children: /* @__PURE__ */ e.jsx("span", { className: "rounded-full bg-purple-100 px-2 py-0.5 text-[10px] text-purple-500", children: F(x(n, p, "")) }) }) : /* @__PURE__ */ e.jsx("div", { className: "pl-6", children: /* @__PURE__ */ e.jsx(je, { data: x(s, p) }) })
|
|
149
147
|
]
|
|
150
148
|
},
|
|
151
|
-
|
|
149
|
+
p
|
|
152
150
|
)) })
|
|
153
151
|
] })
|
|
154
152
|
] }) })
|
|
155
153
|
] })
|
|
156
154
|
] }),
|
|
157
|
-
!y && !
|
|
155
|
+
!y && !f(o) && /* @__PURE__ */ e.jsx("div", { className: "pt-2", children: /* @__PURE__ */ e.jsx(je, { data: x(s, o, ""), fullView: !0 }) })
|
|
158
156
|
] });
|
|
159
|
-
},
|
|
157
|
+
}, Fr = ({
|
|
160
158
|
appliedBindings: r = [],
|
|
161
|
-
onAddBinding:
|
|
159
|
+
onAddBinding: o,
|
|
162
160
|
editMode: t,
|
|
163
|
-
item:
|
|
161
|
+
item: s
|
|
164
162
|
}) => {
|
|
165
|
-
const [l, d] =
|
|
166
|
-
(g,
|
|
167
|
-
if (
|
|
163
|
+
const [l, d] = C(t ? s.key : ""), [a, c] = C(t ? s.value : ""), n = q(), [u] = rt(), y = V(
|
|
164
|
+
(g, p) => {
|
|
165
|
+
if (f(g))
|
|
168
166
|
return "";
|
|
169
167
|
{
|
|
170
|
-
const
|
|
171
|
-
if (ie(
|
|
168
|
+
const b = x(p === "PROP" ? n : u, g, "");
|
|
169
|
+
if (ie(b))
|
|
172
170
|
return "list";
|
|
173
|
-
const
|
|
174
|
-
return
|
|
171
|
+
const w = typeof b;
|
|
172
|
+
return w === "string" ? "text" : w === "object" ? "model" : w;
|
|
175
173
|
}
|
|
176
174
|
},
|
|
177
|
-
[
|
|
178
|
-
), [
|
|
175
|
+
[n, u]
|
|
176
|
+
), [i, h] = C(t ? y(s.key, "PROP") : "");
|
|
179
177
|
return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
180
178
|
/* @__PURE__ */ e.jsxs(Jt, { children: [
|
|
181
179
|
/* @__PURE__ */ e.jsx(Qt, { children: "Add Data Binding" }),
|
|
@@ -191,11 +189,11 @@ const je = ({ data: r, fullView: s }) => {
|
|
|
191
189
|
value: l,
|
|
192
190
|
setValue: d,
|
|
193
191
|
onChange: (g) => {
|
|
194
|
-
const
|
|
195
|
-
d(g),
|
|
192
|
+
const p = y(g, "PROP");
|
|
193
|
+
d(g), i !== p && c(""), h(p);
|
|
196
194
|
},
|
|
197
|
-
data:
|
|
198
|
-
dataType:
|
|
195
|
+
data: n,
|
|
196
|
+
dataType: i,
|
|
199
197
|
appliedBindings: r
|
|
200
198
|
}
|
|
201
199
|
),
|
|
@@ -204,16 +202,16 @@ const je = ({ data: r, fullView: s }) => {
|
|
|
204
202
|
Ie,
|
|
205
203
|
{
|
|
206
204
|
type: "PATH",
|
|
207
|
-
isDisabled:
|
|
205
|
+
isDisabled: f(l),
|
|
208
206
|
placeholder: "Enter data path",
|
|
209
207
|
value: a,
|
|
210
208
|
setValue: c,
|
|
211
209
|
onChange: (g) => {
|
|
212
|
-
const
|
|
213
|
-
c(
|
|
210
|
+
const p = y(g, "PATH");
|
|
211
|
+
c(i === p ? g : "");
|
|
214
212
|
},
|
|
215
|
-
data:
|
|
216
|
-
dataType:
|
|
213
|
+
data: u,
|
|
214
|
+
dataType: i,
|
|
217
215
|
appliedBindings: r
|
|
218
216
|
}
|
|
219
217
|
)
|
|
@@ -223,145 +221,145 @@ const je = ({ data: r, fullView: s }) => {
|
|
|
223
221
|
{
|
|
224
222
|
type: "submit",
|
|
225
223
|
className: "mt-4",
|
|
226
|
-
disabled:
|
|
227
|
-
onClick: () =>
|
|
224
|
+
disabled: f(l) && f(a),
|
|
225
|
+
onClick: () => o({ key: l, value: a }),
|
|
228
226
|
children: "Save"
|
|
229
227
|
}
|
|
230
228
|
) })
|
|
231
229
|
] });
|
|
232
|
-
},
|
|
233
|
-
const [a, c] =
|
|
230
|
+
}, lt = ({ disabled: r, children: o, onAddBinding: t, appliedBindings: s, editMode: l = !0, item: d = {} }) => {
|
|
231
|
+
const [a, c] = C(!1);
|
|
234
232
|
return /* @__PURE__ */ e.jsxs(rr, { children: [
|
|
235
|
-
/* @__PURE__ */ e.jsx(lr, { disabled: r, asChild: !0, onClick: () => c(!0), children:
|
|
233
|
+
/* @__PURE__ */ e.jsx(lr, { disabled: r, asChild: !0, onClick: () => c(!0), children: o }),
|
|
236
234
|
a && /* @__PURE__ */ e.jsx(sr, { children: /* @__PURE__ */ e.jsx(
|
|
237
|
-
|
|
235
|
+
Fr,
|
|
238
236
|
{
|
|
239
237
|
item: d,
|
|
240
238
|
editMode: l,
|
|
241
|
-
appliedBindings:
|
|
242
|
-
onAddBinding: (
|
|
243
|
-
t(
|
|
239
|
+
appliedBindings: s,
|
|
240
|
+
onAddBinding: (n) => {
|
|
241
|
+
t(n), c(!1);
|
|
244
242
|
}
|
|
245
243
|
}
|
|
246
244
|
) })
|
|
247
245
|
] });
|
|
248
246
|
}, Xr = ({
|
|
249
247
|
item: r,
|
|
250
|
-
onAddBinding:
|
|
248
|
+
onAddBinding: o,
|
|
251
249
|
onRemove: t,
|
|
252
|
-
selectedBlock:
|
|
250
|
+
selectedBlock: s,
|
|
253
251
|
dataProvider: l,
|
|
254
252
|
appliedBindings: d
|
|
255
253
|
}) => {
|
|
256
|
-
const [a, c] =
|
|
257
|
-
if (
|
|
254
|
+
const [a, c] = C("string"), n = (u, y) => {
|
|
255
|
+
if (f(u))
|
|
258
256
|
return "";
|
|
259
257
|
{
|
|
260
|
-
const
|
|
261
|
-
if (ie(
|
|
258
|
+
const i = x(y === "PROP" ? s : l, u, "");
|
|
259
|
+
if (ie(i))
|
|
262
260
|
return "list";
|
|
263
|
-
const h = typeof
|
|
261
|
+
const h = typeof i;
|
|
264
262
|
return h === "string" ? "text" : h === "object" ? "model" : h;
|
|
265
263
|
}
|
|
266
264
|
};
|
|
267
|
-
return O(() => c(() =>
|
|
265
|
+
return O(() => c(() => n(r.key, "PROP")), [r.key]), /* @__PURE__ */ e.jsxs("div", { className: "relative flex flex-col rounded-md border border-gray-200 p-2", children: [
|
|
268
266
|
/* @__PURE__ */ e.jsx("div", { className: "text-sm font-normal text-gray-500", children: r.key }),
|
|
269
267
|
/* @__PURE__ */ e.jsx("div", { className: "font-medium leading-5", children: r.value }),
|
|
270
268
|
/* @__PURE__ */ e.jsx(je, { data: x(l, r.value, "") }),
|
|
271
269
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center justify-end gap-x-2", children: [
|
|
272
|
-
/* @__PURE__ */ e.jsx(
|
|
270
|
+
/* @__PURE__ */ e.jsx(lt, { editMode: !0, onAddBinding: o, appliedBindings: d, item: r, children: /* @__PURE__ */ e.jsx(Tr, { 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" }) }),
|
|
273
271
|
/* @__PURE__ */ e.jsx(
|
|
274
|
-
|
|
272
|
+
Rr,
|
|
275
273
|
{
|
|
276
274
|
onClick: () => t(),
|
|
277
275
|
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"
|
|
278
276
|
}
|
|
279
277
|
)
|
|
280
278
|
] }),
|
|
281
|
-
!
|
|
279
|
+
!f(a) && !f(r.key) && /* @__PURE__ */ e.jsx("div", { className: "absolute right-0 top-1 mt-px flex h-4 items-center rounded-full px-2 text-[10px] font-medium text-purple-600", children: F(a) })
|
|
282
280
|
] });
|
|
283
|
-
},
|
|
284
|
-
const t = q(), [
|
|
285
|
-
|
|
281
|
+
}, zr = ({ bindingData: r, onChange: o }) => {
|
|
282
|
+
const t = q(), [s] = rt(), l = Vr(), [d, a] = C(
|
|
283
|
+
k(r, (i, h) => ({ key: h, value: i }))
|
|
286
284
|
);
|
|
287
285
|
O(() => {
|
|
288
|
-
a(
|
|
289
|
-
}, [t == null ? void 0 : t._id]);
|
|
286
|
+
a(k(r, (i, h) => ({ key: h, value: i })));
|
|
287
|
+
}, [t == null ? void 0 : t._id, r]);
|
|
290
288
|
const c = _(() => {
|
|
291
|
-
if (
|
|
289
|
+
if (f(s))
|
|
292
290
|
return !0;
|
|
293
|
-
if (
|
|
291
|
+
if (f(d))
|
|
294
292
|
return !1;
|
|
295
|
-
const
|
|
296
|
-
return
|
|
297
|
-
}, [
|
|
298
|
-
const h = we(d, (g) => g.key !==
|
|
299
|
-
a([...h,
|
|
300
|
-
},
|
|
301
|
-
const h = we(d, (g,
|
|
293
|
+
const i = ve(d);
|
|
294
|
+
return f(i == null ? void 0 : i.key) || f(i == null ? void 0 : i.value);
|
|
295
|
+
}, [s, d]), n = (i) => {
|
|
296
|
+
const h = we(d, (g) => g.key !== i.key);
|
|
297
|
+
a([...h, i]), y([...h, i]);
|
|
298
|
+
}, u = (i) => {
|
|
299
|
+
const h = we(d, (g, p) => i !== p);
|
|
302
300
|
y([...h]);
|
|
303
|
-
}, y =
|
|
304
|
-
(
|
|
305
|
-
if (a(
|
|
306
|
-
|
|
301
|
+
}, y = V(
|
|
302
|
+
(i = []) => {
|
|
303
|
+
if (a(i), f(i)) {
|
|
304
|
+
o({});
|
|
307
305
|
return;
|
|
308
306
|
}
|
|
309
307
|
const h = {};
|
|
310
|
-
ke(
|
|
311
|
-
!
|
|
312
|
-
}),
|
|
308
|
+
ke(i, (g) => {
|
|
309
|
+
!f(g == null ? void 0 : g.key) && !f(g == null ? void 0 : g.value) && Oe(h, g.key, g.value);
|
|
310
|
+
}), o(h);
|
|
313
311
|
},
|
|
314
|
-
[
|
|
312
|
+
[o]
|
|
315
313
|
);
|
|
316
|
-
return
|
|
314
|
+
return f(l) ? /* @__PURE__ */ e.jsx("div", { className: "flex w-full items-center justify-center", children: /* @__PURE__ */ e.jsxs("p", { className: "mb-1.5 text-xs text-gray-500", children: [
|
|
317
315
|
"You have no data providers registered. Please add a data provider to your project. ",
|
|
318
316
|
/* @__PURE__ */ e.jsx("br", {}),
|
|
319
317
|
/* @__PURE__ */ e.jsx("a", { className: "text-blue-500", href: "https://chaibuilder.com/docs/registering-data-providers", target: "_blank", children: "Learn more" })
|
|
320
318
|
] }) }) : /* @__PURE__ */ e.jsxs("div", { className: "space-y-2", children: [
|
|
321
|
-
|
|
319
|
+
k(d, (i, h) => /* @__PURE__ */ e.jsx(
|
|
322
320
|
Xr,
|
|
323
321
|
{
|
|
324
|
-
item:
|
|
325
|
-
onAddBinding:
|
|
326
|
-
onRemove: () =>
|
|
322
|
+
item: i,
|
|
323
|
+
onAddBinding: n,
|
|
324
|
+
onRemove: () => u(h),
|
|
327
325
|
selectedBlock: t,
|
|
328
|
-
dataProvider:
|
|
329
|
-
appliedBindings:
|
|
326
|
+
dataProvider: s,
|
|
327
|
+
appliedBindings: k(d, "key")
|
|
330
328
|
},
|
|
331
|
-
|
|
329
|
+
i.key
|
|
332
330
|
)),
|
|
333
|
-
/* @__PURE__ */ e.jsxs(
|
|
334
|
-
/* @__PURE__ */ e.jsx(z, { className: "w-full", children: /* @__PURE__ */ e.jsx(
|
|
335
|
-
|
|
331
|
+
/* @__PURE__ */ e.jsxs(X, { delayDuration: 200, children: [
|
|
332
|
+
/* @__PURE__ */ e.jsx(z, { disabled: f(s), className: "w-full", children: /* @__PURE__ */ e.jsx(
|
|
333
|
+
lt,
|
|
336
334
|
{
|
|
337
335
|
disabled: c,
|
|
338
|
-
appliedBindings:
|
|
339
|
-
onAddBinding:
|
|
336
|
+
appliedBindings: k(d, "key"),
|
|
337
|
+
onAddBinding: n,
|
|
340
338
|
children: /* @__PURE__ */ e.jsx(
|
|
341
339
|
"span",
|
|
342
340
|
{
|
|
343
341
|
className: `w-full rounded-md px-5 py-1.5 text-xs font-medium duration-200 ${c ? "cursor-not-allowed bg-gray-200 text-gray-400" : "bg-blue-700/20 text-blue-800 hover:bg-blue-700/30"}`,
|
|
344
|
-
children:
|
|
342
|
+
children: f(s) ? /* @__PURE__ */ e.jsx("small", { className: "text-[9.5px] text-gray-500", children: "No data provider has been set up for this page" }) : "+ Add Data Binding"
|
|
345
343
|
}
|
|
346
344
|
)
|
|
347
345
|
}
|
|
348
346
|
) }),
|
|
349
|
-
c && /* @__PURE__ */ e.jsx(Z, { sideOffset: -55, className: "text-[11px]", children:
|
|
347
|
+
c && /* @__PURE__ */ e.jsx(Z, { sideOffset: -55, className: "text-[11px]", children: f(s) ? "No data provider has been set up for this page." : "Complete last added data binding to add more" })
|
|
350
348
|
] })
|
|
351
349
|
] });
|
|
352
|
-
},
|
|
353
|
-
const
|
|
354
|
-
return Object.keys(
|
|
355
|
-
const
|
|
356
|
-
if (
|
|
350
|
+
}, Zr = () => /* @__PURE__ */ e.jsx("div", { className: "text-xs border rounded-sm p-1 mt-1 border-orange-500 text-orange-500 bg-orange-100", children: "Data binding is set for this field" }), me = dt(({ properties: r, formData: o, onChange: t }) => {
|
|
351
|
+
const s = { type: "object", properties: {} }, l = {};
|
|
352
|
+
return Object.keys(r).forEach((d) => {
|
|
353
|
+
const a = r[d];
|
|
354
|
+
if (E(["slot", "styles"], a.type))
|
|
357
355
|
return;
|
|
358
|
-
const
|
|
359
|
-
|
|
356
|
+
const c = d;
|
|
357
|
+
s.properties[c] = or(a), l[c] = ar(a);
|
|
360
358
|
}), /* @__PURE__ */ e.jsx(
|
|
361
|
-
|
|
359
|
+
$r,
|
|
362
360
|
{
|
|
363
361
|
widgets: {
|
|
364
|
-
binding:
|
|
362
|
+
binding: Zr,
|
|
365
363
|
richtext: nr,
|
|
366
364
|
icon: ir,
|
|
367
365
|
image: dr
|
|
@@ -372,58 +370,59 @@ const je = ({ data: r, fullView: s }) => {
|
|
|
372
370
|
omitExtraData: !1,
|
|
373
371
|
liveOmit: !1,
|
|
374
372
|
liveValidate: !1,
|
|
375
|
-
validator:
|
|
376
|
-
uiSchema:
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
onChange: o
|
|
373
|
+
validator: Ir,
|
|
374
|
+
uiSchema: l,
|
|
375
|
+
schema: s,
|
|
376
|
+
formData: o,
|
|
377
|
+
onChange: t
|
|
381
378
|
}
|
|
382
379
|
);
|
|
383
380
|
});
|
|
384
|
-
function
|
|
385
|
-
const r = q(),
|
|
386
|
-
if (
|
|
387
|
-
const
|
|
388
|
-
t([r._id], { [
|
|
381
|
+
function Wr() {
|
|
382
|
+
const r = q(), o = We(), t = pr(), s = et(r._type), l = { ...r }, [d, a] = C(l), c = ur("dataBindingSupport", !1), n = ({ formData: p }, b, w) => {
|
|
383
|
+
if (b) {
|
|
384
|
+
const D = b.replace("root.", "");
|
|
385
|
+
t([r._id], { [D]: x(p, D) }, w);
|
|
386
|
+
}
|
|
387
|
+
}, u = V(
|
|
388
|
+
gt(({ formData: p }, b, w) => {
|
|
389
|
+
n({ formData: p }, b, w), a(p);
|
|
390
|
+
}, 1500),
|
|
391
|
+
[]
|
|
392
|
+
), y = ({ formData: p }, b) => {
|
|
393
|
+
if (b) {
|
|
394
|
+
const w = b.replace("root.", "");
|
|
395
|
+
o([r._id], { [w]: x(p, w) }), u({ formData: p }, b, { [w]: x(d, w) });
|
|
389
396
|
}
|
|
390
397
|
}, i = {
|
|
391
|
-
_name:
|
|
398
|
+
_name: _r({
|
|
392
399
|
title: "Name",
|
|
393
400
|
default: x(r, "_name", r._type)
|
|
394
401
|
})
|
|
395
|
-
},
|
|
396
|
-
const
|
|
397
|
-
return
|
|
398
|
-
}, [
|
|
402
|
+
}, h = ht(x(l, "_bindings", {})), g = _(() => {
|
|
403
|
+
const p = yt(x(s, "props", {}));
|
|
404
|
+
return c && mt(h, (b) => delete p[b]), p;
|
|
405
|
+
}, [s, h, c]);
|
|
399
406
|
return /* @__PURE__ */ e.jsxs("div", { className: "overflow-x-hidden", children: [
|
|
400
|
-
/* @__PURE__ */ e.jsx(
|
|
401
|
-
be,
|
|
402
|
-
{
|
|
403
|
-
onChange: c,
|
|
404
|
-
createHistorySnapshot: a,
|
|
405
|
-
formData: l,
|
|
406
|
-
properties: i
|
|
407
|
-
}
|
|
408
|
-
),
|
|
407
|
+
/* @__PURE__ */ e.jsx(me, { onChange: y, formData: l, properties: i }),
|
|
409
408
|
/* @__PURE__ */ e.jsx("hr", { className: "mt-4" }),
|
|
410
|
-
|
|
409
|
+
c ? /* @__PURE__ */ e.jsxs(Ue, { type: "multiple", defaultValue: ["STATIC", "BINDING"], className: "h-full w-full", children: [
|
|
411
410
|
/* @__PURE__ */ e.jsxs(de, { value: "BINDING", children: [
|
|
412
411
|
/* @__PURE__ */ e.jsx(ce, { 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: [
|
|
413
412
|
/* @__PURE__ */ e.jsx(
|
|
414
413
|
"div",
|
|
415
414
|
{
|
|
416
|
-
className: `h-[8px] w-[8px] rounded-full ${
|
|
415
|
+
className: `h-[8px] w-[8px] rounded-full ${f(x(r, "_bindings", {})) ? "bg-gray-300" : "bg-blue-500"}`
|
|
417
416
|
}
|
|
418
417
|
),
|
|
419
418
|
"Data Binding"
|
|
420
419
|
] }) }),
|
|
421
420
|
/* @__PURE__ */ e.jsx(pe, { className: "px-4 pt-4", children: /* @__PURE__ */ e.jsx(
|
|
422
|
-
|
|
421
|
+
zr,
|
|
423
422
|
{
|
|
424
|
-
bindingData: x(
|
|
425
|
-
onChange: (
|
|
426
|
-
|
|
423
|
+
bindingData: x(r, "_bindings", {}),
|
|
424
|
+
onChange: (p) => {
|
|
425
|
+
n({ formData: { _bindings: p } }, "root._bindings");
|
|
427
426
|
}
|
|
428
427
|
}
|
|
429
428
|
) })
|
|
@@ -434,72 +433,56 @@ function zr() {
|
|
|
434
433
|
"Static Content"
|
|
435
434
|
] }) }),
|
|
436
435
|
/* @__PURE__ */ e.jsxs(pe, { className: "pt-4", children: [
|
|
437
|
-
|
|
436
|
+
f(h) ? 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: [
|
|
438
437
|
"Data binding is set for ",
|
|
439
|
-
/* @__PURE__ */ e.jsx("b", { children:
|
|
438
|
+
/* @__PURE__ */ e.jsx("b", { children: k(h, bt).join(", ") }),
|
|
440
439
|
" ",
|
|
441
|
-
|
|
440
|
+
h.length === 1 ? "property" : "properties",
|
|
442
441
|
". Remove data binding to edit static content."
|
|
443
442
|
] }),
|
|
444
|
-
/* @__PURE__ */ e.jsx(
|
|
445
|
-
be,
|
|
446
|
-
{
|
|
447
|
-
onChange: c,
|
|
448
|
-
createHistorySnapshot: a,
|
|
449
|
-
formData: l,
|
|
450
|
-
properties: y
|
|
451
|
-
}
|
|
452
|
-
)
|
|
443
|
+
/* @__PURE__ */ e.jsx(me, { onChange: y, formData: l, properties: g })
|
|
453
444
|
] })
|
|
454
445
|
] })
|
|
455
|
-
] }) : /* @__PURE__ */ e.jsx(
|
|
456
|
-
be,
|
|
457
|
-
{
|
|
458
|
-
onChange: c,
|
|
459
|
-
createHistorySnapshot: a,
|
|
460
|
-
formData: l,
|
|
461
|
-
properties: y
|
|
462
|
-
}
|
|
463
|
-
),
|
|
446
|
+
] }) : /* @__PURE__ */ e.jsx(me, { onChange: y, formData: l, properties: g }),
|
|
464
447
|
/* @__PURE__ */ e.jsx("div", { className: "pb-60" })
|
|
465
448
|
] });
|
|
466
449
|
}
|
|
467
|
-
const
|
|
450
|
+
const Pe = new Er(Lr, {
|
|
468
451
|
isCaseSensitive: !1,
|
|
469
452
|
threshold: 0.2,
|
|
470
453
|
minMatchCharLength: 2,
|
|
471
454
|
keys: ["name"]
|
|
472
455
|
});
|
|
473
|
-
function
|
|
474
|
-
var
|
|
475
|
-
const [r] = Se(),
|
|
476
|
-
const
|
|
477
|
-
t(l,
|
|
478
|
-
}, [y,
|
|
479
|
-
const
|
|
456
|
+
function Ur() {
|
|
457
|
+
var D;
|
|
458
|
+
const [r] = Se(), o = q(), t = Ke(), s = qe(), [l] = Ge(), [d, a] = C(""), c = (D = ue(r)) == null ? void 0 : D.prop, n = ft((x(o, c, "").replace(Or, "").split(",").pop() || "").split(" "), f), u = () => {
|
|
459
|
+
const j = d.trim().toLowerCase().replace(/ +(?= )/g, "").split(" ");
|
|
460
|
+
t(l, j, !0), a("");
|
|
461
|
+
}, [y, i] = C([]), h = ({ value: j }) => {
|
|
462
|
+
const I = j.trim().toLowerCase(), L = I.match(/.+:/g);
|
|
480
463
|
let N = [];
|
|
481
464
|
if (L && L.length > 0) {
|
|
482
|
-
const [
|
|
483
|
-
N =
|
|
484
|
-
...
|
|
485
|
-
item: { ...
|
|
465
|
+
const [$] = L, Y = I.replace($, "");
|
|
466
|
+
N = Pe.search(Y).map((m) => ({
|
|
467
|
+
...m,
|
|
468
|
+
item: { ...m.item, name: $ + m.item.name }
|
|
486
469
|
}));
|
|
487
470
|
} else
|
|
488
|
-
N =
|
|
489
|
-
|
|
471
|
+
N = Pe.search(I);
|
|
472
|
+
i(k(N, "item"));
|
|
490
473
|
}, g = () => {
|
|
491
|
-
|
|
492
|
-
},
|
|
474
|
+
i([]);
|
|
475
|
+
}, p = (j) => j.name, b = (j) => /* @__PURE__ */ e.jsx("div", { className: "rounded-md p-1", children: j.name }), w = {
|
|
493
476
|
autoComplete: "off",
|
|
494
477
|
autoCorrect: "off",
|
|
495
478
|
autoCapitalize: "off",
|
|
496
479
|
spellCheck: !1,
|
|
497
480
|
placeholder: "Enter class name",
|
|
498
481
|
value: d,
|
|
499
|
-
onKeyDown: (
|
|
500
|
-
|
|
482
|
+
onKeyDown: (j) => {
|
|
483
|
+
j.key === "Enter" && d.trim() !== "" && u();
|
|
501
484
|
},
|
|
502
|
-
onChange: (
|
|
485
|
+
onChange: (j, { newValue: I }) => a(I),
|
|
503
486
|
className: "w-full rounded-md text-xs px-2 hover:outline-0 bg-background border-border py-1"
|
|
504
487
|
};
|
|
505
488
|
return /* @__PURE__ */ e.jsxs(
|
|
@@ -510,14 +493,14 @@ function Zr() {
|
|
|
510
493
|
/* @__PURE__ */ e.jsx(Te, { className: "mt-2", children: "Add Tailwind classes" }),
|
|
511
494
|
/* @__PURE__ */ e.jsxs("div", { className: "relative -mt-4 flex items-center gap-x-3", children: [
|
|
512
495
|
/* @__PURE__ */ e.jsx("div", { className: "relative flex w-full items-center gap-x-3", children: /* @__PURE__ */ e.jsx(
|
|
513
|
-
|
|
496
|
+
Ar,
|
|
514
497
|
{
|
|
515
498
|
suggestions: y,
|
|
516
499
|
onSuggestionsFetchRequested: h,
|
|
517
500
|
onSuggestionsClearRequested: g,
|
|
518
|
-
getSuggestionValue:
|
|
519
|
-
renderSuggestion:
|
|
520
|
-
inputProps:
|
|
501
|
+
getSuggestionValue: p,
|
|
502
|
+
renderSuggestion: b,
|
|
503
|
+
inputProps: w,
|
|
521
504
|
containerProps: {
|
|
522
505
|
className: "relative h-8 w-full gap-y-1 py-1 border-gray-600"
|
|
523
506
|
},
|
|
@@ -533,7 +516,7 @@ function Zr() {
|
|
|
533
516
|
{
|
|
534
517
|
variant: "outline",
|
|
535
518
|
className: "h-6 border-gray-700",
|
|
536
|
-
onClick:
|
|
519
|
+
onClick: u,
|
|
537
520
|
disabled: d.trim() === "",
|
|
538
521
|
size: "sm",
|
|
539
522
|
children: /* @__PURE__ */ e.jsx(Ne, {})
|
|
@@ -541,24 +524,24 @@ function Zr() {
|
|
|
541
524
|
)
|
|
542
525
|
] }),
|
|
543
526
|
/* @__PURE__ */ e.jsxs("div", { className: "flex w-full flex-wrap gap-2", children: [
|
|
544
|
-
|
|
527
|
+
f(n) && /* @__PURE__ */ e.jsx("div", { className: "flex h-10 w-full items-center justify-center text-center text-sm text-gray-400", children: "No class added" }),
|
|
545
528
|
ne.Children.toArray(
|
|
546
|
-
|
|
529
|
+
n.map((j) => /* @__PURE__ */ e.jsxs(
|
|
547
530
|
"div",
|
|
548
531
|
{
|
|
549
532
|
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",
|
|
550
533
|
children: [
|
|
551
|
-
|
|
534
|
+
j,
|
|
552
535
|
/* @__PURE__ */ e.jsx(
|
|
553
|
-
|
|
536
|
+
Xe,
|
|
554
537
|
{
|
|
555
|
-
onClick: () =>
|
|
538
|
+
onClick: () => s(l, [j]),
|
|
556
539
|
className: "invisible absolute right-1 hover:text-white group-hover:visible group-hover:cursor-pointer"
|
|
557
540
|
}
|
|
558
541
|
)
|
|
559
542
|
]
|
|
560
543
|
},
|
|
561
|
-
|
|
544
|
+
j
|
|
562
545
|
))
|
|
563
546
|
)
|
|
564
547
|
] })
|
|
@@ -566,16 +549,16 @@ function Zr() {
|
|
|
566
549
|
}
|
|
567
550
|
);
|
|
568
551
|
}
|
|
569
|
-
const
|
|
552
|
+
const B = ["px", "%", "em", "rem", "ch", "vh", "vw"], Kr = {
|
|
570
553
|
heading: "flex.heading",
|
|
571
554
|
items: [
|
|
572
|
-
{ type: "arbitrary", label: "flex.basis", units:
|
|
555
|
+
{ type: "arbitrary", label: "flex.basis", units: B, property: "flexBasis" },
|
|
573
556
|
{ type: "range", label: "flex.order", property: "order" },
|
|
574
557
|
{ type: "dropdown", label: "flex.flex", property: "flexGrowShrink" },
|
|
575
558
|
{ type: "dropdown", label: "flex.grow", property: "flexGrow" },
|
|
576
559
|
{ type: "dropdown", label: "flex.shrink", property: "flexShrink" }
|
|
577
560
|
]
|
|
578
|
-
},
|
|
561
|
+
}, qr = {
|
|
579
562
|
heading: "grid.heading",
|
|
580
563
|
items: [
|
|
581
564
|
{ type: "range", label: "grid.col_span", property: "gridColSpan" },
|
|
@@ -586,17 +569,17 @@ const H = ["px", "%", "em", "rem", "ch", "vh", "vw"], Wr = {
|
|
|
586
569
|
{ type: "range", label: "grid.row_end", property: "gridRowEnd" },
|
|
587
570
|
{ type: "range", label: "grid.order", property: "order" }
|
|
588
571
|
]
|
|
589
|
-
},
|
|
572
|
+
}, Gr = [
|
|
590
573
|
{
|
|
591
574
|
heading: "layout.heading",
|
|
592
575
|
items: [
|
|
593
|
-
{ type: "arbitrary", label: "layout.width", units:
|
|
594
|
-
{ type: "arbitrary", label: "layout.height", units:
|
|
576
|
+
{ type: "arbitrary", label: "layout.width", units: B.concat("auto"), property: "width" },
|
|
577
|
+
{ type: "arbitrary", label: "layout.height", units: B.concat("auto"), property: "height" },
|
|
595
578
|
{
|
|
596
579
|
styleType: "multiple",
|
|
597
580
|
label: "layout.margin",
|
|
598
581
|
negative: !0,
|
|
599
|
-
units: [...
|
|
582
|
+
units: [...B, "auto"],
|
|
600
583
|
options: [
|
|
601
584
|
{ key: "margin", label: "layout.margin_all" },
|
|
602
585
|
{ key: "marginX", label: "layout.margin_lr" },
|
|
@@ -637,16 +620,16 @@ const H = ["px", "%", "em", "rem", "ch", "vh", "vw"], Wr = {
|
|
|
637
620
|
styleType: "accordion",
|
|
638
621
|
heading: "size.min_width_height",
|
|
639
622
|
items: [
|
|
640
|
-
{ type: "arbitrary", label: "size.min_width", units:
|
|
641
|
-
{ type: "arbitrary", label: "size.min_height", units:
|
|
623
|
+
{ type: "arbitrary", label: "size.min_width", units: B.concat("auto"), property: "minWidth" },
|
|
624
|
+
{ type: "arbitrary", label: "size.min_height", units: B.concat("auto"), property: "minHeight" }
|
|
642
625
|
]
|
|
643
626
|
},
|
|
644
627
|
{
|
|
645
628
|
styleType: "accordion",
|
|
646
629
|
heading: "size.max_width_height",
|
|
647
630
|
items: [
|
|
648
|
-
{ type: "arbitrary", label: "size.max_width", units:
|
|
649
|
-
{ type: "arbitrary", label: "size.max_height", units:
|
|
631
|
+
{ type: "arbitrary", label: "size.max_width", units: B.concat("auto"), property: "maxWidth" },
|
|
632
|
+
{ type: "arbitrary", label: "size.max_height", units: B.concat("auto"), property: "maxHeight" }
|
|
650
633
|
]
|
|
651
634
|
},
|
|
652
635
|
{
|
|
@@ -663,7 +646,7 @@ const H = ["px", "%", "em", "rem", "ch", "vh", "vw"], Wr = {
|
|
|
663
646
|
{
|
|
664
647
|
heading: "display.heading",
|
|
665
648
|
items: [
|
|
666
|
-
{ type: "dropdown", label: "display.display", property: "display", units:
|
|
649
|
+
{ type: "dropdown", label: "display.display", property: "display", units: B },
|
|
667
650
|
{
|
|
668
651
|
styleType: "accordion",
|
|
669
652
|
heading: "display.flex_options",
|
|
@@ -714,7 +697,7 @@ const H = ["px", "%", "em", "rem", "ch", "vh", "vw"], Wr = {
|
|
|
714
697
|
styleType: "accordion",
|
|
715
698
|
heading: "display.visibility_opacity",
|
|
716
699
|
items: [
|
|
717
|
-
{ type: "dropdown", label: "display.visibility", property: "visibility", units:
|
|
700
|
+
{ type: "dropdown", label: "display.visibility", property: "visibility", units: B },
|
|
718
701
|
{ type: "arbitrary", label: "display.opacity", property: "opacity", units: ["-"] }
|
|
719
702
|
]
|
|
720
703
|
}
|
|
@@ -790,8 +773,8 @@ const H = ["px", "%", "em", "rem", "ch", "vh", "vw"], Wr = {
|
|
|
790
773
|
heading: "typography.heading",
|
|
791
774
|
items: [
|
|
792
775
|
{ type: "dropdown", property: "fontFamily", label: "typography.font" },
|
|
793
|
-
{ type: "arbitrary", property: "fontSize", label: "typography.size", units:
|
|
794
|
-
{ type: "arbitrary", property: "lineHeight", label: "typography.height", units:
|
|
776
|
+
{ type: "arbitrary", property: "fontSize", label: "typography.size", units: B },
|
|
777
|
+
{ type: "arbitrary", property: "lineHeight", label: "typography.height", units: B.concat("-") },
|
|
795
778
|
{ type: "range", property: "fontWeight", label: "typography.weight" },
|
|
796
779
|
{ type: "color", property: "textColor", label: "typography.color" },
|
|
797
780
|
{
|
|
@@ -988,9 +971,9 @@ const H = ["px", "%", "em", "rem", "ch", "vh", "vw"], Wr = {
|
|
|
988
971
|
},
|
|
989
972
|
{
|
|
990
973
|
heading: "classes.heading",
|
|
991
|
-
items: [{ component:
|
|
974
|
+
items: [{ component: Ur }]
|
|
992
975
|
}
|
|
993
|
-
],
|
|
976
|
+
], st = {
|
|
994
977
|
"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" }) }),
|
|
995
978
|
// visibility
|
|
996
979
|
visible: kt,
|
|
@@ -1070,7 +1053,7 @@ const H = ["px", "%", "em", "rem", "ch", "vh", "vw"], Wr = {
|
|
|
1070
1053
|
underline: $t,
|
|
1071
1054
|
overline: It,
|
|
1072
1055
|
// transform
|
|
1073
|
-
uppercase:
|
|
1056
|
+
uppercase: Pt,
|
|
1074
1057
|
block: () => /* @__PURE__ */ e.jsxs("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [
|
|
1075
1058
|
/* @__PURE__ */ e.jsx(
|
|
1076
1059
|
"path",
|
|
@@ -1111,7 +1094,7 @@ const H = ["px", "%", "em", "rem", "ch", "vh", "vw"], Wr = {
|
|
|
1111
1094
|
}
|
|
1112
1095
|
)
|
|
1113
1096
|
] }),
|
|
1114
|
-
"float-none":
|
|
1097
|
+
"float-none": Xe,
|
|
1115
1098
|
// position
|
|
1116
1099
|
fixed: () => /* @__PURE__ */ e.jsxs("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [
|
|
1117
1100
|
/* @__PURE__ */ e.jsx(
|
|
@@ -1183,15 +1166,15 @@ const H = ["px", "%", "em", "rem", "ch", "vh", "vw"], Wr = {
|
|
|
1183
1166
|
}
|
|
1184
1167
|
)
|
|
1185
1168
|
] }),
|
|
1186
|
-
static:
|
|
1187
|
-
}, oe = Me({ canReset: !1, canChange: !0 }),
|
|
1169
|
+
static: At
|
|
1170
|
+
}, oe = Me({ canReset: !1, canChange: !0 }), Jr = ({ children: r, canReset: o = !1, canChange: t = !0 }) => (
|
|
1188
1171
|
// eslint-disable-next-line react/jsx-no-constructed-context-values
|
|
1189
|
-
/* @__PURE__ */ e.jsx(oe.Provider, { value: { canReset:
|
|
1190
|
-
),
|
|
1191
|
-
const
|
|
1192
|
-
return /* @__PURE__ */ e.jsx("div", { className: r ? "w-full rounded
|
|
1193
|
-
/* @__PURE__ */ e.jsx(
|
|
1194
|
-
/* @__PURE__ */ e.jsxs(
|
|
1172
|
+
/* @__PURE__ */ e.jsx(oe.Provider, { value: { canReset: o, canChange: t }, children: r })
|
|
1173
|
+
), ot = ({ label: r, property: o, onChange: t }) => {
|
|
1174
|
+
const s = _(() => x(he, `${o}.classes`, [""]), [o]), l = ae(o), d = _(() => x(l, "cls", ""), [l]), { canChange: a } = se(oe), c = /\[.*\]/g.test(d);
|
|
1175
|
+
return /* @__PURE__ */ e.jsx("div", { className: r ? "w-full rounded" : "grow", children: c ? /* @__PURE__ */ e.jsxs("div", { className: "flex items-center", children: [
|
|
1176
|
+
/* @__PURE__ */ e.jsx(xr, { className: "w-[70%] rounded py-1", readOnly: !0, value: d }),
|
|
1177
|
+
/* @__PURE__ */ e.jsxs(X, { delayDuration: 100, children: [
|
|
1195
1178
|
/* @__PURE__ */ e.jsx(z, { 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(_e, {}) }) }),
|
|
1196
1179
|
/* @__PURE__ */ e.jsx(Z, { children: "Current value is using a Tailwind arbitrary value." })
|
|
1197
1180
|
] })
|
|
@@ -1199,85 +1182,85 @@ const H = ["px", "%", "em", "rem", "ch", "vh", "vw"], Wr = {
|
|
|
1199
1182
|
Ce,
|
|
1200
1183
|
{
|
|
1201
1184
|
rounded: r,
|
|
1202
|
-
onChange: (
|
|
1185
|
+
onChange: (n) => t(n, o),
|
|
1203
1186
|
selected: d,
|
|
1204
|
-
options:
|
|
1187
|
+
options: s,
|
|
1205
1188
|
disabled: !a
|
|
1206
1189
|
}
|
|
1207
1190
|
) });
|
|
1208
1191
|
};
|
|
1209
|
-
function Ce({ selected: r, onChange:
|
|
1210
|
-
const d = r.replace(/.*:/g, "").trim(), { undo: a, redo: c } =
|
|
1192
|
+
function Ce({ selected: r, onChange: o, rounded: t = !1, options: s, disabled: l = !1 }) {
|
|
1193
|
+
const d = r.replace(/.*:/g, "").trim(), { undo: a, redo: c } = gr();
|
|
1211
1194
|
return /* @__PURE__ */ e.jsxs(
|
|
1212
1195
|
"select",
|
|
1213
1196
|
{
|
|
1214
|
-
disabled: !
|
|
1215
|
-
className: `${t ? "rounded-md border border-border" : "border-0"}
|
|
1216
|
-
onChange: (
|
|
1217
|
-
onKeyDown: (
|
|
1218
|
-
|
|
1197
|
+
disabled: !s.length || l,
|
|
1198
|
+
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`,
|
|
1199
|
+
onChange: (n) => o(n.target.value),
|
|
1200
|
+
onKeyDown: (n) => {
|
|
1201
|
+
n.ctrlKey && (n.key === "z" && a(), n.key === "y" && c());
|
|
1219
1202
|
},
|
|
1220
1203
|
value: d,
|
|
1221
1204
|
children: [
|
|
1222
1205
|
/* @__PURE__ */ e.jsx("option", { className: "bg-transparent", value: "" }),
|
|
1223
|
-
|
|
1224
|
-
|
|
1206
|
+
P.Children.toArray(
|
|
1207
|
+
s.map((n) => /* @__PURE__ */ e.jsx("option", { className: "bg-transparent", value: n, children: n }))
|
|
1225
1208
|
)
|
|
1226
1209
|
]
|
|
1227
1210
|
}
|
|
1228
1211
|
);
|
|
1229
1212
|
}
|
|
1230
|
-
const
|
|
1231
|
-
const { canReset: t, canChange:
|
|
1232
|
-
return /* @__PURE__ */ e.jsx("div", { className: "flex flex-row divide-x divide-solid divide-border rounded border border-border text-xs", children:
|
|
1213
|
+
const Qr = ({ property: r, onChange: o }) => {
|
|
1214
|
+
const { canReset: t, canChange: s } = se(oe), l = ae(r), d = _(() => x(l, "cls", ""), [l]), a = _(() => x(he, `${r}.classes`, [""]), [r]), c = a.indexOf(d) > -1 ? a.indexOf(d) : 0, n = /\[.*\]/g.test(d);
|
|
1215
|
+
return /* @__PURE__ */ e.jsx("div", { className: "flex flex-row divide-x divide-solid divide-border rounded border border-border text-xs", children: n ? /* @__PURE__ */ e.jsx("div", { className: "py-[5px] px-2", children: d }) : /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
1233
1216
|
/* @__PURE__ */ e.jsx(
|
|
1234
1217
|
"button",
|
|
1235
1218
|
{
|
|
1236
1219
|
type: "button",
|
|
1237
1220
|
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",
|
|
1238
|
-
disabled: !
|
|
1239
|
-
onClick: () =>
|
|
1221
|
+
disabled: !s && (!t || c - 1 < 0),
|
|
1222
|
+
onClick: () => o(Ve(a, c - 1), r),
|
|
1240
1223
|
children: /* @__PURE__ */ e.jsx("span", { className: "flex items-center justify-center", children: /* @__PURE__ */ e.jsx(
|
|
1241
1224
|
Et,
|
|
1242
1225
|
{
|
|
1243
|
-
className: !
|
|
1226
|
+
className: !s && (!t || c - 1 < 0) ? "text-gray-500" : "text-black/60 dark:text-white/60"
|
|
1244
1227
|
}
|
|
1245
1228
|
) })
|
|
1246
1229
|
}
|
|
1247
1230
|
),
|
|
1248
|
-
/* @__PURE__ */ e.jsx("div", { className: "w-8/12 text-center", children: /* @__PURE__ */ e.jsx(
|
|
1231
|
+
/* @__PURE__ */ e.jsx("div", { className: "w-8/12 text-center", children: /* @__PURE__ */ e.jsx(ot, { label: !1, property: r, onChange: o }) }),
|
|
1249
1232
|
/* @__PURE__ */ e.jsx(
|
|
1250
1233
|
"button",
|
|
1251
1234
|
{
|
|
1252
1235
|
type: "button",
|
|
1253
1236
|
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",
|
|
1254
|
-
disabled: !
|
|
1255
|
-
onClick: () =>
|
|
1237
|
+
disabled: !s && (!t || c + 1 >= a.length),
|
|
1238
|
+
onClick: () => o(Ve(a, c + 1), r),
|
|
1256
1239
|
children: /* @__PURE__ */ e.jsx("span", { className: "flex items-center justify-center", children: /* @__PURE__ */ e.jsx(
|
|
1257
1240
|
Ne,
|
|
1258
1241
|
{
|
|
1259
|
-
className: !
|
|
1242
|
+
className: !s && (!t || c + 1 >= a.length) ? "text-gray-500" : "text-black/60 dark:text-white/60"
|
|
1260
1243
|
}
|
|
1261
1244
|
) })
|
|
1262
1245
|
}
|
|
1263
1246
|
)
|
|
1264
1247
|
] }) });
|
|
1265
|
-
},
|
|
1266
|
-
const t = _(() => x(he, `${r}.classes`, [""]), [r]), { canChange:
|
|
1267
|
-
return /* @__PURE__ */ e.jsx("div", { className: "flex grow flex-wrap gap-1", children:
|
|
1248
|
+
}, el = ({ property: r, onChange: o }) => {
|
|
1249
|
+
const t = _(() => x(he, `${r}.classes`, [""]), [r]), { canChange: s } = se(oe), l = ae(r), d = _(() => x(l, "cls", ""), [l]);
|
|
1250
|
+
return /* @__PURE__ */ e.jsx("div", { className: "flex grow flex-wrap gap-1", children: k(t, (a) => /* @__PURE__ */ e.jsxs(X, { children: [
|
|
1268
1251
|
/* @__PURE__ */ e.jsx(z, { asChild: !0, children: /* @__PURE__ */ e.jsx(
|
|
1269
1252
|
"button",
|
|
1270
1253
|
{
|
|
1271
1254
|
type: "button",
|
|
1272
|
-
disabled: !
|
|
1273
|
-
onClick: () =>
|
|
1255
|
+
disabled: !s,
|
|
1256
|
+
onClick: () => o(a, r),
|
|
1274
1257
|
className: `cursor-pointer rounded border border-gray-600 p-1 disabled:cursor-not-allowed ${d === a ? " bg-blue-500 text-white" : "disabled:bg-gray-600 disabled:text-gray-400"}`,
|
|
1275
|
-
children:
|
|
1258
|
+
children: P.createElement(x(st, a, ze))
|
|
1276
1259
|
}
|
|
1277
1260
|
) }),
|
|
1278
|
-
/* @__PURE__ */ e.jsx(Z, { children:
|
|
1261
|
+
/* @__PURE__ */ e.jsx(Z, { children: F(le(a)) })
|
|
1279
1262
|
] })) });
|
|
1280
|
-
},
|
|
1263
|
+
}, tl = {
|
|
1281
1264
|
backgroundColor: "bg",
|
|
1282
1265
|
textColor: "text",
|
|
1283
1266
|
borderColor: "border",
|
|
@@ -1289,32 +1272,32 @@ const Gr = ({ property: r, onChange: s }) => {
|
|
|
1289
1272
|
toColor: "to",
|
|
1290
1273
|
ringColor: "ring",
|
|
1291
1274
|
ringOffsetColor: "ring-offset"
|
|
1292
|
-
},
|
|
1293
|
-
const t = ae(r),
|
|
1275
|
+
}, rl = ({ property: r, onChange: o }) => {
|
|
1276
|
+
const t = ae(r), s = _(() => x(t, "cls", ""), [t]), { canChange: l } = se(oe), [d, a] = C([]), [c, n] = C({ color: "", shade: "" }), u = s.split("-"), y = x(u, "1", ""), i = x(u, "2", ""), h = V(
|
|
1294
1277
|
// eslint-disable-next-line no-shadow
|
|
1295
|
-
(
|
|
1296
|
-
["current", "inherit", "transparent", "black", "white"].includes(
|
|
1278
|
+
(p) => {
|
|
1279
|
+
["current", "inherit", "transparent", "black", "white"].includes(p) ? (a([]), n({ color: p })) : (a(["50", "100", "200", "300", "400", "500", "600", "700", "800", "900"]), n((b) => ({ ...b, color: p, shade: b.shade ? b.shade : "500" })));
|
|
1297
1280
|
},
|
|
1298
|
-
[a,
|
|
1281
|
+
[a, n]
|
|
1299
1282
|
);
|
|
1300
1283
|
O(() => {
|
|
1301
1284
|
if (["current", "inherit", "transparent", "black", "white"].includes(y))
|
|
1302
1285
|
return a([]);
|
|
1303
1286
|
a(["50", "100", "200", "300", "400", "500", "600", "700", "800", "900"]);
|
|
1304
1287
|
}, [y]);
|
|
1305
|
-
const g =
|
|
1288
|
+
const g = V(
|
|
1306
1289
|
// eslint-disable-next-line no-shadow
|
|
1307
|
-
(
|
|
1308
|
-
|
|
1290
|
+
(p) => {
|
|
1291
|
+
n({ color: y, shade: p });
|
|
1309
1292
|
},
|
|
1310
1293
|
[y]
|
|
1311
1294
|
);
|
|
1312
1295
|
return O(() => {
|
|
1313
|
-
|
|
1296
|
+
n({ color: "", shade: "" });
|
|
1314
1297
|
}, [t]), O(() => {
|
|
1315
|
-
const
|
|
1316
|
-
|
|
1317
|
-
}, [c,
|
|
1298
|
+
const b = `${x(tl, r, "")}-${c.color}${c.shade ? `-${c.shade}` : ""}`;
|
|
1299
|
+
b.match(new RegExp(x(he, `${r}.regExp`, ""))) && o(b, r);
|
|
1300
|
+
}, [c, o, r]), /* @__PURE__ */ e.jsxs("div", { className: "flex flex-row divide-x divide-solid divide-border rounded-lg border border-border text-xs", children: [
|
|
1318
1301
|
/* @__PURE__ */ e.jsx("div", { className: "grow text-center", children: /* @__PURE__ */ e.jsx(
|
|
1319
1302
|
Ce,
|
|
1320
1303
|
{
|
|
@@ -1354,20 +1337,20 @@ const Gr = ({ property: r, onChange: s }) => {
|
|
|
1354
1337
|
]
|
|
1355
1338
|
}
|
|
1356
1339
|
) }),
|
|
1357
|
-
/* @__PURE__ */ e.jsx("button", { type: "button", className: "grow text-center", children: /* @__PURE__ */ e.jsx(Ce, { rounded: !0, selected:
|
|
1340
|
+
/* @__PURE__ */ e.jsx("button", { type: "button", className: "grow text-center", children: /* @__PURE__ */ e.jsx(Ce, { rounded: !0, selected: i, disabled: !y || !l, onChange: g, options: d }) })
|
|
1358
1341
|
] });
|
|
1359
|
-
},
|
|
1342
|
+
}, Ae = (r, o) => {
|
|
1360
1343
|
r = r.toLowerCase();
|
|
1361
1344
|
let t = r.trim().replace(/ |\+/g, "");
|
|
1362
|
-
if ((t === "auto" || t === "none") &&
|
|
1345
|
+
if ((t === "auto" || t === "none") && o.includes(t))
|
|
1363
1346
|
return { value: "", unit: t };
|
|
1364
|
-
const
|
|
1365
|
-
t = t.replace(
|
|
1366
|
-
const l = r.match(
|
|
1347
|
+
const s = o.length ? new RegExp(o.join("|"), "g") : /XXXXXX/g;
|
|
1348
|
+
t = t.replace(s, "");
|
|
1349
|
+
const l = r.match(s), d = l && l.length > 1, a = !f(t) && Number.isNaN(Number(t));
|
|
1367
1350
|
return d || a ? { error: "Invalid value" } : l && (l[0] === "auto" || l[0] === "none") ? { value: l[0], unit: "" } : { value: t, unit: l ? l[0] : "" };
|
|
1368
1351
|
};
|
|
1369
|
-
const
|
|
1370
|
-
const
|
|
1352
|
+
const ll = (r) => {
|
|
1353
|
+
const o = r.startsWith("-") ? "-" : "", t = r.split("-").pop();
|
|
1371
1354
|
if (["auto", "none"].includes(t))
|
|
1372
1355
|
return { value: "", unit: t };
|
|
1373
1356
|
if (t === "px")
|
|
@@ -1376,22 +1359,22 @@ const tl = (r) => {
|
|
|
1376
1359
|
return { value: "100", unit: r.indexOf("w-") !== -1 ? "vw" : "vh" };
|
|
1377
1360
|
if (t === "full")
|
|
1378
1361
|
return { value: "100", unit: "%" };
|
|
1379
|
-
if (
|
|
1380
|
-
return { value: `${
|
|
1381
|
-
if (
|
|
1382
|
-
return { value: `${
|
|
1383
|
-
if (
|
|
1362
|
+
if (E(r, "skew-"))
|
|
1363
|
+
return { value: `${o}${t}`, unit: "deg" };
|
|
1364
|
+
if (E(r, "rotate-"))
|
|
1365
|
+
return { value: `${o}${t}`, unit: "deg" };
|
|
1366
|
+
if (E(r, "opacity-"))
|
|
1384
1367
|
return { value: `${t / 100}`, unit: "-" };
|
|
1385
|
-
if (
|
|
1368
|
+
if (E(r, "duration-") || E(r, "delay-"))
|
|
1386
1369
|
return { value: `${t}`, unit: "ms" };
|
|
1387
|
-
if (
|
|
1388
|
-
return { value: `${
|
|
1389
|
-
if (
|
|
1390
|
-
return { value: `${
|
|
1370
|
+
if (E(r, "translate-") && !t.includes("/"))
|
|
1371
|
+
return { value: `${o}${`${t / 4}`}`, unit: "rem" };
|
|
1372
|
+
if (E(r, "scale-"))
|
|
1373
|
+
return { value: `${o}${`${t / 100}`}`, unit: "-" };
|
|
1391
1374
|
if (W(r, "border")) {
|
|
1392
|
-
const
|
|
1393
|
-
if (
|
|
1394
|
-
return { value:
|
|
1375
|
+
const s = r.match(/border-?(x|y|t|r|b|l)?\d+/g);
|
|
1376
|
+
if (s)
|
|
1377
|
+
return { value: s[0].split("-").pop(), unit: "px" };
|
|
1395
1378
|
if (r.match(/border-?(x|y|t|r|b|l)?/g))
|
|
1396
1379
|
return { value: "1", unit: "px" };
|
|
1397
1380
|
}
|
|
@@ -1490,84 +1473,84 @@ const tl = (r) => {
|
|
|
1490
1473
|
if (["max", "min", "fit"].includes(t))
|
|
1491
1474
|
return { value: r, unit: "class" };
|
|
1492
1475
|
if (t.includes("/")) {
|
|
1493
|
-
const [
|
|
1494
|
-
return { value:
|
|
1476
|
+
const [s, l] = k(t.split("/"), (d) => parseInt(d, 10));
|
|
1477
|
+
return { value: o + (s / l * 100).toFixed(2).replace(".00", ""), unit: "%" };
|
|
1495
1478
|
}
|
|
1496
|
-
return vt(parseFloat(t)) ? { value: `${
|
|
1479
|
+
return vt(parseFloat(t)) ? { value: `${o + parseFloat(t) * 4}`, unit: "px" } : { value: t, unit: "class" };
|
|
1497
1480
|
};
|
|
1498
|
-
const
|
|
1499
|
-
if (
|
|
1481
|
+
const sl = (r) => {
|
|
1482
|
+
if (f(r))
|
|
1500
1483
|
return { value: "", unit: "" };
|
|
1501
|
-
const
|
|
1502
|
-
if (
|
|
1503
|
-
return
|
|
1504
|
-
const t = x(
|
|
1505
|
-
return { value: `${
|
|
1506
|
-
},
|
|
1484
|
+
const o = r.match(/\[.*\]/g);
|
|
1485
|
+
if (o === null)
|
|
1486
|
+
return ol(r);
|
|
1487
|
+
const t = x(o, "0", "").replace(/\[|\]/g, ""), s = r.startsWith("-") ? "-" : "", l = ue(t.match(/\d+.\d+|\d+/g));
|
|
1488
|
+
return { value: `${s}${l}`, unit: t.replace(l, "") };
|
|
1489
|
+
}, ol = (r) => f(r) ? { value: "", unit: "" } : ll(r), at = P.createContext({
|
|
1507
1490
|
setDragData: () => {
|
|
1508
1491
|
}
|
|
1509
|
-
}),
|
|
1492
|
+
}), al = ({
|
|
1510
1493
|
unit: r,
|
|
1511
|
-
currentValue:
|
|
1494
|
+
currentValue: o,
|
|
1512
1495
|
onDrag: t,
|
|
1513
|
-
onDragEnd:
|
|
1496
|
+
onDragEnd: s,
|
|
1514
1497
|
onDragStart: l,
|
|
1515
1498
|
negative: d,
|
|
1516
1499
|
cssProperty: a
|
|
1517
1500
|
}) => {
|
|
1518
|
-
const { setDragData: c } = se(
|
|
1501
|
+
const { setDragData: c } = se(at);
|
|
1519
1502
|
return /* @__PURE__ */ e.jsx(
|
|
1520
1503
|
"button",
|
|
1521
1504
|
{
|
|
1522
1505
|
type: "button",
|
|
1523
|
-
onMouseDown: (
|
|
1524
|
-
const
|
|
1506
|
+
onMouseDown: (n) => {
|
|
1507
|
+
const u = {
|
|
1525
1508
|
onDrag: t,
|
|
1526
|
-
onDragEnd:
|
|
1509
|
+
onDragEnd: s,
|
|
1527
1510
|
dragging: !0,
|
|
1528
|
-
dragStartY:
|
|
1529
|
-
dragStartValue: `${
|
|
1511
|
+
dragStartY: n.pageY,
|
|
1512
|
+
dragStartValue: `${o}`,
|
|
1530
1513
|
dragUnit: r,
|
|
1531
1514
|
negative: d,
|
|
1532
1515
|
cssProperty: a
|
|
1533
1516
|
};
|
|
1534
|
-
l(
|
|
1517
|
+
l(u), c(u);
|
|
1535
1518
|
},
|
|
1536
1519
|
color: void 0,
|
|
1537
1520
|
className: "relative z-50 ml-1 hidden h-6 cursor-row-resize rounded bg-background/70 px-2 group-hover:inline",
|
|
1538
1521
|
children: /* @__PURE__ */ e.jsx(Lt, {})
|
|
1539
1522
|
}
|
|
1540
1523
|
);
|
|
1541
|
-
},
|
|
1524
|
+
}, nl = ({ onSelect: r, current: o, units: t }) => /* @__PURE__ */ e.jsx("div", { "data-theme": "light", className: "-m-[7px] -mx-[13px] flex w-9 flex-col", children: t.map((s) => /* @__PURE__ */ e.jsx(
|
|
1542
1525
|
xe,
|
|
1543
1526
|
{
|
|
1544
1527
|
className: "h-max rounded-none px-1 py-1 text-right text-[11px] hover:bg-blue-400",
|
|
1545
|
-
color:
|
|
1528
|
+
color: o === s ? "primary" : void 0,
|
|
1546
1529
|
size: "sm",
|
|
1547
1530
|
onClick: (l) => {
|
|
1548
|
-
l.stopPropagation(), r(
|
|
1531
|
+
l.stopPropagation(), r(s);
|
|
1549
1532
|
},
|
|
1550
|
-
children:
|
|
1533
|
+
children: s
|
|
1551
1534
|
},
|
|
1552
|
-
|
|
1553
|
-
)) }), Ee = 50,
|
|
1554
|
-
const [
|
|
1535
|
+
s
|
|
1536
|
+
)) }), Ee = 50, il = (r) => {
|
|
1537
|
+
const [o, t] = C(!1), [s, l] = C(""), { currentClass: d, onChange: a, classPrefix: c, cssProperty: n, units: u, negative: y } = r, [i, h] = C(n != null && n.toLowerCase().includes("width") ? "%" : u[0]), [g, p] = C(!1), [b, w] = C(""), [D, j] = C(!1), [I, L] = C(!1);
|
|
1555
1538
|
O(() => {
|
|
1556
|
-
const { value:
|
|
1539
|
+
const { value: m, unit: v } = sl(d);
|
|
1557
1540
|
if (v === "") {
|
|
1558
|
-
l(
|
|
1541
|
+
l(m), h(n != null && n.toLowerCase().includes("width") ? "%" : ue(u));
|
|
1559
1542
|
return;
|
|
1560
1543
|
}
|
|
1561
|
-
h(v), l(v === "class" || m
|
|
1562
|
-
}, [d,
|
|
1563
|
-
const N = fe((
|
|
1564
|
-
(
|
|
1565
|
-
const v =
|
|
1544
|
+
h(v), l(v === "class" || f(m) ? "" : m);
|
|
1545
|
+
}, [d, n, u]);
|
|
1546
|
+
const N = fe((m) => a(m), [a], Ee), $ = fe((m) => a(m, !1), [a], Ee), Y = V(
|
|
1547
|
+
(m = !1) => {
|
|
1548
|
+
const v = Ae(`${s}`, u);
|
|
1566
1549
|
if (x(v, "error", !1)) {
|
|
1567
|
-
|
|
1550
|
+
p(!0);
|
|
1568
1551
|
return;
|
|
1569
1552
|
}
|
|
1570
|
-
const S = x(v, "unit") !== "" ? x(v, "unit") :
|
|
1553
|
+
const S = x(v, "unit") !== "" ? x(v, "unit") : i;
|
|
1571
1554
|
if (S === "auto" || S === "none") {
|
|
1572
1555
|
N(`${c}${S}`);
|
|
1573
1556
|
return;
|
|
@@ -1575,123 +1558,123 @@ const rl = (r) => {
|
|
|
1575
1558
|
if (x(v, "value") === "")
|
|
1576
1559
|
return;
|
|
1577
1560
|
const J = `${x(v, "value", "").startsWith("-") ? "-" : ""}${c}[${x(v, "value", "").replace("-", "")}${S === "-" ? "" : S}]`;
|
|
1578
|
-
|
|
1561
|
+
m ? $(J) : N(J);
|
|
1579
1562
|
},
|
|
1580
|
-
[N,
|
|
1581
|
-
), G =
|
|
1582
|
-
(
|
|
1583
|
-
const v =
|
|
1563
|
+
[N, $, s, i, c, u]
|
|
1564
|
+
), G = V(
|
|
1565
|
+
(m) => {
|
|
1566
|
+
const v = Ae(`${s}`, u);
|
|
1584
1567
|
if (x(v, "error", !1)) {
|
|
1585
|
-
|
|
1568
|
+
p(!0);
|
|
1586
1569
|
return;
|
|
1587
1570
|
}
|
|
1588
|
-
if (
|
|
1589
|
-
N(`${c}${
|
|
1571
|
+
if (m === "auto" || m === "none") {
|
|
1572
|
+
N(`${c}${m}`);
|
|
1590
1573
|
return;
|
|
1591
1574
|
}
|
|
1592
1575
|
if (x(v, "value") === "")
|
|
1593
1576
|
return;
|
|
1594
|
-
const S = x(v, "unit") !== "" ? x(v, "unit") :
|
|
1577
|
+
const S = x(v, "unit") !== "" ? x(v, "unit") : m, J = `${x(v, "value", "").startsWith("-") ? "-" : ""}${c}[${x(v, "value", "").replace("-", "")}${S === "-" ? "" : S}]`;
|
|
1595
1578
|
N(J);
|
|
1596
1579
|
},
|
|
1597
|
-
[N,
|
|
1580
|
+
[N, s, c, u]
|
|
1598
1581
|
);
|
|
1599
|
-
return /* @__PURE__ */ e.jsx("div", { className: "flex w-full flex-col", children: /* @__PURE__ */ e.jsx("div", { className: "flex items-center justify-start", children:
|
|
1582
|
+
return /* @__PURE__ */ e.jsx("div", { className: "flex w-full flex-col", children: /* @__PURE__ */ e.jsx("div", { className: "flex items-center justify-start", children: i === "class" ? /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
1600
1583
|
/* @__PURE__ */ e.jsx("input", { className: "w-20 rounded py-1", readOnly: !0, value: d }),
|
|
1601
|
-
/* @__PURE__ */ e.jsxs(
|
|
1584
|
+
/* @__PURE__ */ e.jsxs(X, { children: [
|
|
1602
1585
|
/* @__PURE__ */ e.jsx(z, { 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(_e, {}) }) }),
|
|
1603
1586
|
/* @__PURE__ */ e.jsx(Z, { children: "Current value is using a Tailwind preset class." })
|
|
1604
1587
|
] })
|
|
1605
|
-
] }) : /* @__PURE__ */ e.jsxs("div", { className: `group relative flex items-center ${
|
|
1588
|
+
] }) : /* @__PURE__ */ e.jsxs("div", { className: `group relative flex items-center ${D ? "z-auto" : ""}`, children: [
|
|
1606
1589
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center rounded-md border border-border", children: [
|
|
1607
|
-
["none", "auto"].indexOf(
|
|
1590
|
+
["none", "auto"].indexOf(i) !== -1 ? null : /* @__PURE__ */ e.jsx(
|
|
1608
1591
|
"input",
|
|
1609
1592
|
{
|
|
1610
|
-
readOnly:
|
|
1611
|
-
onKeyPress: (
|
|
1612
|
-
|
|
1593
|
+
readOnly: i === "class",
|
|
1594
|
+
onKeyPress: (m) => {
|
|
1595
|
+
m.key === "Enter" && Y();
|
|
1613
1596
|
},
|
|
1614
|
-
onKeyDown: (
|
|
1615
|
-
if (
|
|
1597
|
+
onKeyDown: (m) => {
|
|
1598
|
+
if (m.keyCode !== 38 && m.keyCode !== 40)
|
|
1616
1599
|
return;
|
|
1617
|
-
|
|
1618
|
-
const v = wt(
|
|
1619
|
-
let S =
|
|
1620
|
-
|
|
1621
|
-
const M = `${S}`,
|
|
1622
|
-
|
|
1600
|
+
m.preventDefault(), L(!0);
|
|
1601
|
+
const v = wt(m.target.value);
|
|
1602
|
+
let S = Ye(v) ? 0 : v;
|
|
1603
|
+
m.keyCode === 38 && (S += 1), m.keyCode === 40 && (S -= 1);
|
|
1604
|
+
const M = `${S}`, it = `${M.startsWith("-") ? "-" : ""}${c}[${M.replace("-", "")}${i === "-" ? "" : i}]`;
|
|
1605
|
+
$(it);
|
|
1623
1606
|
},
|
|
1624
|
-
onKeyUp: (
|
|
1625
|
-
|
|
1607
|
+
onKeyUp: (m) => {
|
|
1608
|
+
I && (m.preventDefault(), L(!1));
|
|
1626
1609
|
},
|
|
1627
|
-
onBlur: () =>
|
|
1628
|
-
onChange: (
|
|
1629
|
-
|
|
1610
|
+
onBlur: () => Y(),
|
|
1611
|
+
onChange: (m) => {
|
|
1612
|
+
p(!1), l(m.target.value);
|
|
1630
1613
|
},
|
|
1631
|
-
onClick: (
|
|
1614
|
+
onClick: (m) => {
|
|
1632
1615
|
var v;
|
|
1633
|
-
(v =
|
|
1616
|
+
(v = m == null ? void 0 : m.target) == null || v.select(), t(!1);
|
|
1634
1617
|
},
|
|
1635
|
-
value:
|
|
1618
|
+
value: D ? b : s,
|
|
1636
1619
|
className: "h-6 w-14 rounded rounded-r-none bg-background pl-2 text-sm focus-visible:outline-0 ".concat(
|
|
1637
1620
|
" ",
|
|
1638
1621
|
g ? "border-red-500 text-red-500" : "border-foreground/20"
|
|
1639
1622
|
)
|
|
1640
1623
|
}
|
|
1641
1624
|
),
|
|
1642
|
-
/* @__PURE__ */ e.jsxs(
|
|
1625
|
+
/* @__PURE__ */ e.jsxs(X, { open: o, delayDuration: 100, children: [
|
|
1643
1626
|
/* @__PURE__ */ e.jsx(z, { asChild: !0, children: /* @__PURE__ */ e.jsxs(
|
|
1644
1627
|
"button",
|
|
1645
1628
|
{
|
|
1646
1629
|
type: "button",
|
|
1647
|
-
onClick: () => t(!
|
|
1630
|
+
onClick: () => t(!o),
|
|
1648
1631
|
className: "flex h-6 cursor-pointer items-center gap-x-1 rounded rounded-l-none bg-background p-px px-1 text-[11px] uppercase",
|
|
1649
1632
|
children: [
|
|
1650
|
-
/* @__PURE__ */ e.jsx("span", { className: `inline-block ${
|
|
1651
|
-
|
|
1633
|
+
/* @__PURE__ */ e.jsx("span", { className: `inline-block ${u.length === 1 ? "px-2 font-semibold" : ""}`, children: i }),
|
|
1634
|
+
u.length > 1 ? /* @__PURE__ */ e.jsx(Mt, {}) : null
|
|
1652
1635
|
]
|
|
1653
1636
|
}
|
|
1654
1637
|
) }),
|
|
1655
|
-
/* @__PURE__ */ e.jsx(
|
|
1656
|
-
|
|
1638
|
+
/* @__PURE__ */ e.jsx(hr, { children: /* @__PURE__ */ e.jsx(Z, { className: "bg-background", children: /* @__PURE__ */ e.jsx(
|
|
1639
|
+
nl,
|
|
1657
1640
|
{
|
|
1658
|
-
units:
|
|
1659
|
-
current:
|
|
1660
|
-
onSelect: (
|
|
1661
|
-
t(!1), h(
|
|
1641
|
+
units: u,
|
|
1642
|
+
current: i,
|
|
1643
|
+
onSelect: (m) => {
|
|
1644
|
+
t(!1), h(m), G(m);
|
|
1662
1645
|
}
|
|
1663
1646
|
}
|
|
1664
1647
|
) }) })
|
|
1665
1648
|
] })
|
|
1666
1649
|
] }),
|
|
1667
|
-
["none", "auto"].indexOf(
|
|
1668
|
-
|
|
1650
|
+
["none", "auto"].indexOf(i) !== -1 || D ? null : /* @__PURE__ */ e.jsx(
|
|
1651
|
+
al,
|
|
1669
1652
|
{
|
|
1670
|
-
onDragStart: () =>
|
|
1671
|
-
onDragEnd: (
|
|
1672
|
-
if (
|
|
1653
|
+
onDragStart: () => j(!0),
|
|
1654
|
+
onDragEnd: (m) => {
|
|
1655
|
+
if (w(() => ""), j(!1), f(m))
|
|
1673
1656
|
return;
|
|
1674
|
-
const v = `${
|
|
1657
|
+
const v = `${m}`, M = `${v.startsWith("-") ? "-" : ""}${c}[${v.replace("-", "")}${i === "-" ? "" : i}]`;
|
|
1675
1658
|
N(M);
|
|
1676
1659
|
},
|
|
1677
|
-
onDrag: (
|
|
1678
|
-
if (m
|
|
1660
|
+
onDrag: (m) => {
|
|
1661
|
+
if (f(m))
|
|
1679
1662
|
return;
|
|
1680
|
-
|
|
1681
|
-
const v = `${
|
|
1682
|
-
|
|
1663
|
+
w(m);
|
|
1664
|
+
const v = `${m}`, M = `${v.startsWith("-") ? "-" : ""}${c}[${v.replace("-", "")}${i === "-" ? "" : i}]`;
|
|
1665
|
+
$(M);
|
|
1683
1666
|
},
|
|
1684
|
-
currentValue:
|
|
1685
|
-
unit:
|
|
1667
|
+
currentValue: s,
|
|
1668
|
+
unit: i,
|
|
1686
1669
|
negative: y,
|
|
1687
|
-
cssProperty:
|
|
1670
|
+
cssProperty: n
|
|
1688
1671
|
}
|
|
1689
1672
|
)
|
|
1690
1673
|
] }) }) });
|
|
1691
1674
|
}, ae = (r) => {
|
|
1692
|
-
const
|
|
1693
|
-
return jt(
|
|
1694
|
-
},
|
|
1675
|
+
const o = ge();
|
|
1676
|
+
return jt(o, { property: r });
|
|
1677
|
+
}, dl = (r, o) => {
|
|
1695
1678
|
const t = {
|
|
1696
1679
|
xs: 0,
|
|
1697
1680
|
sm: 1,
|
|
@@ -1700,8 +1683,8 @@ const rl = (r) => {
|
|
|
1700
1683
|
xl: 4,
|
|
1701
1684
|
"2xl": 5
|
|
1702
1685
|
};
|
|
1703
|
-
return t[x(r, "mq", "xs")] <= t[
|
|
1704
|
-
},
|
|
1686
|
+
return t[x(r, "mq", "xs")] <= t[o];
|
|
1687
|
+
}, cl = {
|
|
1705
1688
|
width: "w-",
|
|
1706
1689
|
height: "h-",
|
|
1707
1690
|
minWidth: "min-w-",
|
|
@@ -1774,56 +1757,56 @@ const rl = (r) => {
|
|
|
1774
1757
|
lg: "1024px",
|
|
1775
1758
|
xl: "1280px",
|
|
1776
1759
|
"2xl": "1536px"
|
|
1777
|
-
},
|
|
1778
|
-
const { t:
|
|
1779
|
-
}, units: a, negative: c = !1 } = r, [
|
|
1780
|
-
(
|
|
1781
|
-
const G = { dark:
|
|
1782
|
-
(
|
|
1783
|
-
const
|
|
1784
|
-
h(
|
|
1760
|
+
}, pl = (r) => `${r.toUpperCase()} ${Le[r] ? `(${Le[r]} & up)` : ""}`, Re = (r) => {
|
|
1761
|
+
const { t: o } = K(), { type: t = "icons", label: s, property: l, onEmitChange: d = () => {
|
|
1762
|
+
}, units: a, negative: c = !1 } = r, [n] = yr(), [u] = Je(), [, y] = Be(), i = ae(l), h = Ke(), g = qe(), [p] = Ge(), b = _(() => x(i, "fullCls", ""), [i]), w = V(
|
|
1763
|
+
($, Y = !0) => {
|
|
1764
|
+
const G = { dark: n, mq: y, mod: u, cls: $, property: l, fullCls: "" };
|
|
1765
|
+
(n || u !== "") && (G.mq = "xs");
|
|
1766
|
+
const m = Mr(G);
|
|
1767
|
+
h(p, [m], Y);
|
|
1785
1768
|
},
|
|
1786
|
-
[
|
|
1787
|
-
),
|
|
1788
|
-
g(
|
|
1789
|
-
}, [
|
|
1769
|
+
[p, n, y, u, l, h]
|
|
1770
|
+
), D = V(() => {
|
|
1771
|
+
g(p, [b]);
|
|
1772
|
+
}, [p, b, g]), j = _(() => dl(i, y), [i, y]);
|
|
1790
1773
|
O(() => {
|
|
1791
|
-
d(
|
|
1792
|
-
}, [
|
|
1793
|
-
const [, ,
|
|
1794
|
-
(
|
|
1795
|
-
|
|
1774
|
+
d(j, i);
|
|
1775
|
+
}, [j, d, i]);
|
|
1776
|
+
const [, , I] = Be(), L = V(
|
|
1777
|
+
($) => {
|
|
1778
|
+
I({
|
|
1796
1779
|
xs: 400,
|
|
1797
1780
|
sm: 640,
|
|
1798
1781
|
md: 800,
|
|
1799
1782
|
lg: 1024,
|
|
1800
1783
|
xl: 1420,
|
|
1801
1784
|
"2xl": 1920
|
|
1802
|
-
}[
|
|
1785
|
+
}[$]);
|
|
1803
1786
|
},
|
|
1804
|
-
[
|
|
1805
|
-
), N = x(
|
|
1806
|
-
return /* @__PURE__ */ e.jsx(
|
|
1807
|
-
/* @__PURE__ */ e.jsx("div", { className: "relative w-[70px] truncate text-xs text-foreground", children: /* @__PURE__ */ e.jsx("span", { className: `text-[11px] ${
|
|
1787
|
+
[I]
|
|
1788
|
+
), N = x(i, "dark", null) === n && x(i, "mod", null) === u && x(i, "mq", null) === y;
|
|
1789
|
+
return /* @__PURE__ */ e.jsx(Jr, { canChange: j, canReset: i && N, children: /* @__PURE__ */ e.jsxs("div", { className: "group flex flex-row items-center py-2 first:pt-0 last:pb-0", children: [
|
|
1790
|
+
/* @__PURE__ */ e.jsx("div", { className: "relative w-[70px] truncate text-xs text-foreground", children: /* @__PURE__ */ e.jsx("span", { className: `text-[11px] ${i && !N ? "text-foreground" : ""}`, children: o(s) }) }),
|
|
1808
1791
|
/* @__PURE__ */ e.jsxs("div", { className: "flex flex-row items-center", children: [
|
|
1809
1792
|
/* @__PURE__ */ e.jsxs("div", { className: "w-[150px]", children: [
|
|
1810
1793
|
t === "arbitrary" ? /* @__PURE__ */ e.jsx(
|
|
1811
|
-
|
|
1794
|
+
il,
|
|
1812
1795
|
{
|
|
1813
|
-
currentClass: x(
|
|
1814
|
-
classPrefix: x(
|
|
1796
|
+
currentClass: x(i, "cls", ""),
|
|
1797
|
+
classPrefix: x(cl, l, ""),
|
|
1815
1798
|
units: a || [],
|
|
1816
|
-
onChange:
|
|
1799
|
+
onChange: w,
|
|
1817
1800
|
negative: c,
|
|
1818
1801
|
cssProperty: l
|
|
1819
1802
|
}
|
|
1820
1803
|
) : null,
|
|
1821
|
-
t === "icons" && /* @__PURE__ */ e.jsx(
|
|
1822
|
-
t === "range" && /* @__PURE__ */ e.jsx(
|
|
1823
|
-
t === "color" && /* @__PURE__ */ e.jsx(
|
|
1824
|
-
t === "dropdown" && /* @__PURE__ */ e.jsx(
|
|
1804
|
+
t === "icons" && /* @__PURE__ */ e.jsx(el, { property: l, onChange: w }),
|
|
1805
|
+
t === "range" && /* @__PURE__ */ e.jsx(Qr, { property: l, onChange: w }),
|
|
1806
|
+
t === "color" && /* @__PURE__ */ e.jsx(rl, { property: l, onChange: w }),
|
|
1807
|
+
t === "dropdown" && /* @__PURE__ */ e.jsx(ot, { label: s, property: l, onChange: w })
|
|
1825
1808
|
] }),
|
|
1826
|
-
/* @__PURE__ */ e.jsx("div", { className: `w-[30px] cursor-pointer ${
|
|
1809
|
+
/* @__PURE__ */ e.jsx("div", { className: `w-[30px] cursor-pointer ${b ? "visible" : "invisible"}`, children: N ? /* @__PURE__ */ e.jsx("button", { type: "button", onClick: () => D(), title: "Reset", className: "flex px-1.5 text-xs", children: /* @__PURE__ */ e.jsx(Ot, { className: "h-5 w-5 text-blue-500 hover:opacity-80" }) }) : j && i ? /* @__PURE__ */ e.jsxs(X, { delayDuration: 100, children: [
|
|
1827
1810
|
/* @__PURE__ */ e.jsx(z, { asChild: !0, children: /* @__PURE__ */ e.jsx(
|
|
1828
1811
|
"button",
|
|
1829
1812
|
{
|
|
@@ -1834,20 +1817,20 @@ const rl = (r) => {
|
|
|
1834
1817
|
) }),
|
|
1835
1818
|
/* @__PURE__ */ e.jsx(Z, { children: /* @__PURE__ */ e.jsx("div", { className: "text-right", children: /* @__PURE__ */ e.jsxs("div", { children: [
|
|
1836
1819
|
"Current style is set at ",
|
|
1837
|
-
/* @__PURE__ */ e.jsxs("span", { className: "font-bold
|
|
1838
|
-
|
|
1839
|
-
|
|
1820
|
+
/* @__PURE__ */ e.jsxs("span", { className: "font-bold", children: [
|
|
1821
|
+
pl(x(i, "mq")),
|
|
1822
|
+
n && !i.dark ? "(Light mode)" : ""
|
|
1840
1823
|
] }),
|
|
1841
1824
|
/* @__PURE__ */ e.jsx("br", {}),
|
|
1842
1825
|
/* @__PURE__ */ e.jsxs(
|
|
1843
1826
|
"button",
|
|
1844
1827
|
{
|
|
1845
1828
|
type: "button",
|
|
1846
|
-
onClick: () => L(x(
|
|
1829
|
+
onClick: () => L(x(i, "mq")),
|
|
1847
1830
|
className: "block w-full cursor-default text-right font-semibold text-blue-500",
|
|
1848
1831
|
children: [
|
|
1849
1832
|
"Switch to ",
|
|
1850
|
-
x(
|
|
1833
|
+
x(i, "mq").toUpperCase()
|
|
1851
1834
|
]
|
|
1852
1835
|
}
|
|
1853
1836
|
)
|
|
@@ -1855,40 +1838,40 @@ const rl = (r) => {
|
|
|
1855
1838
|
] }) : null })
|
|
1856
1839
|
] })
|
|
1857
1840
|
] }) });
|
|
1858
|
-
},
|
|
1841
|
+
}, ul = ["px", "%", "em", "rem", "ch", "vh", "vw"], nt = ({
|
|
1859
1842
|
label: r,
|
|
1860
|
-
options:
|
|
1843
|
+
options: o,
|
|
1861
1844
|
borderB: t = !1,
|
|
1862
|
-
borderT:
|
|
1845
|
+
borderT: s = !1,
|
|
1863
1846
|
type: l = "arbitrary",
|
|
1864
|
-
units: d =
|
|
1847
|
+
units: d = ul,
|
|
1865
1848
|
negative: a = !1
|
|
1866
1849
|
}) => {
|
|
1867
|
-
const { t: c } = K(), [
|
|
1850
|
+
const { t: c } = K(), [n, u] = C(o[0].key), y = ge(), i = V((h) => k(y, "property").includes(h), [y]);
|
|
1868
1851
|
return /* @__PURE__ */ e.jsxs(
|
|
1869
1852
|
"div",
|
|
1870
1853
|
{
|
|
1871
|
-
className: `mb-2 border-gray-800 py-2 first:pt-0 last:pb-0 ${t ? "border-b" : ""} ${
|
|
1854
|
+
className: `mb-2 border-gray-800 py-2 first:pt-0 last:pb-0 ${t ? "border-b" : ""} ${s ? "border-t" : ""}`,
|
|
1872
1855
|
children: [
|
|
1873
1856
|
/* @__PURE__ */ e.jsxs("div", { className: "flex flex-row text-xs", children: [
|
|
1874
1857
|
r && /* @__PURE__ */ e.jsx("span", { className: "relative w-[70px] flex-none text-xs text-foreground", children: c(r) }),
|
|
1875
|
-
/* @__PURE__ */ e.jsx("div", { className: "mb-3 flex grow flex-row flex-wrap gap-x-px", children:
|
|
1876
|
-
|
|
1858
|
+
/* @__PURE__ */ e.jsx("div", { className: "mb-3 flex grow flex-row flex-wrap gap-x-px", children: P.Children.toArray(
|
|
1859
|
+
o.map(({ label: h, key: g }) => /* @__PURE__ */ e.jsx("div", { className: "first:rounded-l last:rounded-r", children: /* @__PURE__ */ e.jsxs(X, { children: [
|
|
1877
1860
|
/* @__PURE__ */ e.jsx(z, { asChild: !0, children: /* @__PURE__ */ e.jsxs(
|
|
1878
1861
|
"button",
|
|
1879
1862
|
{
|
|
1880
1863
|
type: "button",
|
|
1881
|
-
onClick: () =>
|
|
1882
|
-
className: `relative cursor-pointer rounded-full p-1 text-[8px] ${g ===
|
|
1864
|
+
onClick: () => u(g),
|
|
1865
|
+
className: `relative cursor-pointer rounded-full p-1 text-[8px] ${g === n ? " bg-[#3E57F0] text-white" : "text-gray-600 dark:text-gray-300"}`,
|
|
1883
1866
|
children: [
|
|
1884
|
-
|
|
1885
|
-
className:
|
|
1867
|
+
P.createElement("div", {
|
|
1868
|
+
className: i(g) ? "-bottom-1.5 absolute bg-[#3E57F0] h-[2px] left-0 w-full" : ""
|
|
1886
1869
|
}),
|
|
1887
|
-
|
|
1870
|
+
P.createElement(x(st, g, ze), { className: "text-inherit w-3 h-3" })
|
|
1888
1871
|
]
|
|
1889
1872
|
}
|
|
1890
1873
|
) }),
|
|
1891
|
-
/* @__PURE__ */ e.jsx(Z, { children:
|
|
1874
|
+
/* @__PURE__ */ e.jsx(Z, { children: F(le(h)) })
|
|
1892
1875
|
] }) }))
|
|
1893
1876
|
) })
|
|
1894
1877
|
] }),
|
|
@@ -1898,22 +1881,22 @@ const rl = (r) => {
|
|
|
1898
1881
|
type: l,
|
|
1899
1882
|
units: [...d],
|
|
1900
1883
|
label: "",
|
|
1901
|
-
property:
|
|
1884
|
+
property: n,
|
|
1902
1885
|
negative: a
|
|
1903
1886
|
}
|
|
1904
1887
|
) })
|
|
1905
1888
|
]
|
|
1906
1889
|
}
|
|
1907
1890
|
);
|
|
1908
|
-
},
|
|
1909
|
-
const { t } = K(),
|
|
1910
|
-
const d = (
|
|
1911
|
-
|
|
1891
|
+
}, xl = ({ heading: r, items: o }) => {
|
|
1892
|
+
const { t } = K(), s = ge(), l = _(() => {
|
|
1893
|
+
const d = (n) => U(
|
|
1894
|
+
n.map((u) => u.styleType === "multiple" ? k(u.options, "key") : u.property)
|
|
1912
1895
|
), a = U(
|
|
1913
|
-
|
|
1914
|
-
), c =
|
|
1915
|
-
return
|
|
1916
|
-
}, [
|
|
1896
|
+
o.map((n) => n.styleType === "accordion" ? d(n.items) : n.styleType === "multiple" ? k(n.options, "key") : n.property)
|
|
1897
|
+
), c = k(s, "property");
|
|
1898
|
+
return Fe(a, c).length > 0;
|
|
1899
|
+
}, [s, o]);
|
|
1917
1900
|
return /* @__PURE__ */ e.jsxs("details", { children: [
|
|
1918
1901
|
/* @__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: [
|
|
1919
1902
|
t(r),
|
|
@@ -1924,54 +1907,54 @@ const rl = (r) => {
|
|
|
1924
1907
|
}
|
|
1925
1908
|
) : null
|
|
1926
1909
|
] }) }),
|
|
1927
|
-
/* @__PURE__ */ e.jsx("div", { className: "p-2", children:
|
|
1910
|
+
/* @__PURE__ */ e.jsx("div", { className: "p-2", children: o.map((d) => d.styleType === "multiple" ? /* @__PURE__ */ e.jsx(nt, { ...d }, d.label) : /* @__PURE__ */ e.jsx(Re, { ...d }, d.label)) })
|
|
1928
1911
|
] });
|
|
1929
|
-
},
|
|
1930
|
-
const { t:
|
|
1912
|
+
}, gl = Me({}), be = ({ section: r }) => {
|
|
1913
|
+
const { t: o } = K(), t = ge(), s = V(
|
|
1931
1914
|
(a = []) => {
|
|
1932
1915
|
const c = {};
|
|
1933
|
-
for (let
|
|
1934
|
-
c[t[
|
|
1935
|
-
let
|
|
1936
|
-
for (const
|
|
1937
|
-
if (!ye(c,
|
|
1938
|
-
|
|
1916
|
+
for (let u = 0; u < t.length; u++)
|
|
1917
|
+
c[t[u].property] = t[u].cls;
|
|
1918
|
+
let n = !0;
|
|
1919
|
+
for (const u in a)
|
|
1920
|
+
if (!ye(c, u) || c[u] !== a[u]) {
|
|
1921
|
+
n = !1;
|
|
1939
1922
|
break;
|
|
1940
1923
|
}
|
|
1941
|
-
return
|
|
1924
|
+
return n;
|
|
1942
1925
|
},
|
|
1943
1926
|
[t]
|
|
1944
1927
|
), l = _(() => {
|
|
1945
1928
|
if (t.length > 0 && r.heading === "classes.heading")
|
|
1946
1929
|
return !0;
|
|
1947
|
-
const a = (
|
|
1948
|
-
|
|
1930
|
+
const a = (u) => U(
|
|
1931
|
+
u.map((y) => y.styleType === "multiple" ? U(k(y.options, "key")) : y.property)
|
|
1949
1932
|
), c = U(
|
|
1950
|
-
r.items.map((
|
|
1951
|
-
),
|
|
1952
|
-
return
|
|
1933
|
+
r.items.map((u) => u.styleType === "accordion" ? a(u.items) : u.styleType === "multiple" ? U(k(u.options, "key")) : u.property)
|
|
1934
|
+
), n = k(t, "property");
|
|
1935
|
+
return Fe(c, n).length > 0;
|
|
1953
1936
|
}, [t, r.heading, r.items]), d = _(() => ({}), []);
|
|
1954
|
-
return /* @__PURE__ */ e.jsx(
|
|
1937
|
+
return /* @__PURE__ */ e.jsx(gl.Provider, { value: d, children: /* @__PURE__ */ e.jsxs(de, { value: r.heading, children: [
|
|
1955
1938
|
/* @__PURE__ */ e.jsx(ce, { className: "px-3 py-2 text-xs hover:no-underline", children: /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-x-2", children: [
|
|
1956
1939
|
/* @__PURE__ */ e.jsx("div", { className: `h-[8px] w-[8px] rounded-full ${l ? "bg-blue-500" : "bg-gray-300"}` }),
|
|
1957
|
-
|
|
1940
|
+
o(r.heading)
|
|
1958
1941
|
] }) }),
|
|
1959
|
-
/* @__PURE__ */ e.jsx(pe, { className: "bg-gray-100 px-3.5 py-2", children:
|
|
1960
|
-
r.items.map((a) => ye(a, "component") ?
|
|
1942
|
+
/* @__PURE__ */ e.jsx(pe, { className: "bg-gray-100 px-3.5 py-2", children: P.Children.toArray(
|
|
1943
|
+
r.items.map((a) => ye(a, "component") ? P.createElement(a.component, { key: a.label }) : ye(a, "styleType") ? a.styleType === "multiple" ? /* @__PURE__ */ e.jsx(nt, { ...a }, a.label) : a.styleType === "accordion" && s(a == null ? void 0 : a.conditions) ? /* @__PURE__ */ e.jsx(xl, { ...a }, a.label) : null : /* @__PURE__ */ e.jsx(Re, { ...a }, a.label))
|
|
1961
1944
|
) })
|
|
1962
1945
|
] }) });
|
|
1963
|
-
},
|
|
1946
|
+
}, hl = ({
|
|
1964
1947
|
item: r,
|
|
1965
|
-
index:
|
|
1948
|
+
index: o,
|
|
1966
1949
|
canDelete: t,
|
|
1967
|
-
onChange:
|
|
1950
|
+
onChange: s,
|
|
1968
1951
|
onRemove: l
|
|
1969
1952
|
}) => /* @__PURE__ */ e.jsxs("div", { className: `flex flex-col gap-1 border-gray-400 py-2 ${t ? "border-b" : ""}`, children: [
|
|
1970
1953
|
/* @__PURE__ */ e.jsx(
|
|
1971
1954
|
"input",
|
|
1972
1955
|
{
|
|
1973
1956
|
name: "key",
|
|
1974
|
-
onChange: (d) =>
|
|
1957
|
+
onChange: (d) => s(d, o),
|
|
1975
1958
|
value: r.key,
|
|
1976
1959
|
placeholder: "Key",
|
|
1977
1960
|
className: "w-full rounded border-gray-300 bg-background p-0.5 pl-2 text-sm focus-visible:outline-0",
|
|
@@ -1984,7 +1967,7 @@ const rl = (r) => {
|
|
|
1984
1967
|
"input",
|
|
1985
1968
|
{
|
|
1986
1969
|
name: "value",
|
|
1987
|
-
onChange: (d) =>
|
|
1970
|
+
onChange: (d) => f(r.key) ? {} : s(d, o),
|
|
1988
1971
|
value: r.value,
|
|
1989
1972
|
placeholder: "Value",
|
|
1990
1973
|
className: "w-full rounded border-gray-300 bg-background p-0.5 pl-2 text-sm focus-visible:outline-0",
|
|
@@ -1993,41 +1976,41 @@ const rl = (r) => {
|
|
|
1993
1976
|
}
|
|
1994
1977
|
),
|
|
1995
1978
|
/* @__PURE__ */ e.jsx(
|
|
1996
|
-
|
|
1979
|
+
Yt,
|
|
1997
1980
|
{
|
|
1998
1981
|
onClick: l,
|
|
1999
1982
|
className: "h-6 w-6 cursor-pointer rounded border border-red-400 p-1 text-red-400 hover:opacity-80"
|
|
2000
1983
|
}
|
|
2001
1984
|
)
|
|
2002
1985
|
] })
|
|
2003
|
-
] }),
|
|
1986
|
+
] }), yl = ({ section: r }) => {
|
|
2004
1987
|
var h;
|
|
2005
|
-
const { setSyncState:
|
|
1988
|
+
const { setSyncState: o } = mr(), t = q(), [s, l] = C([]), [d] = Se(), a = We(), c = `${x(d, "0.prop")}_attrs`;
|
|
2006
1989
|
ne.useEffect(() => {
|
|
2007
|
-
const g =
|
|
2008
|
-
|
|
1990
|
+
const g = k(x(t, c), (p, b) => ({ key: b, value: p }));
|
|
1991
|
+
f(g) ? l([]) : l(g);
|
|
2009
1992
|
}, [x(t, c)]);
|
|
2010
|
-
const
|
|
2011
|
-
const
|
|
2012
|
-
|
|
2013
|
-
}, y = (g,
|
|
2014
|
-
const
|
|
2015
|
-
|
|
2016
|
-
},
|
|
1993
|
+
const n = () => l([...s, { key: "", value: "" }]), u = (g) => {
|
|
1994
|
+
const p = we(s, (b, w) => g !== w);
|
|
1995
|
+
i(p);
|
|
1996
|
+
}, y = (g, p) => {
|
|
1997
|
+
const b = [...s];
|
|
1998
|
+
b[p][g.target.name] = g.target.value, i(b);
|
|
1999
|
+
}, i = ne.useCallback(
|
|
2017
2000
|
(g = []) => {
|
|
2018
|
-
const
|
|
2019
|
-
ke(g, (
|
|
2020
|
-
|
|
2021
|
-
}), a([x(t, "_id")], { [c]:
|
|
2001
|
+
const p = {};
|
|
2002
|
+
ke(g, (b) => {
|
|
2003
|
+
f(b.key) || Oe(p, b.key, b.value);
|
|
2004
|
+
}), a([x(t, "_id")], { [c]: p }), o("UNSAVED");
|
|
2022
2005
|
},
|
|
2023
|
-
[t,
|
|
2006
|
+
[t, o, a, c]
|
|
2024
2007
|
);
|
|
2025
2008
|
return /* @__PURE__ */ e.jsxs(de, { value: r.heading, children: [
|
|
2026
2009
|
/* @__PURE__ */ e.jsx(ce, { className: "px-3 py-2 text-xs hover:no-underline", children: /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-x-2", children: [
|
|
2027
2010
|
/* @__PURE__ */ e.jsx(
|
|
2028
2011
|
"div",
|
|
2029
2012
|
{
|
|
2030
|
-
className: `h-[8px] w-[8px] rounded-full ${
|
|
2013
|
+
className: `h-[8px] w-[8px] rounded-full ${f(x(t, c)) ? "bg-gray-300" : "bg-blue-500"}`
|
|
2031
2014
|
}
|
|
2032
2015
|
),
|
|
2033
2016
|
"Attributes"
|
|
@@ -2038,10 +2021,10 @@ const rl = (r) => {
|
|
|
2038
2021
|
/* @__PURE__ */ e.jsxs(
|
|
2039
2022
|
"div",
|
|
2040
2023
|
{
|
|
2041
|
-
className: `flex h-6 w-max items-center justify-center gap-x-0.5 rounded-full border p-1 px-2 text-xs ${!
|
|
2024
|
+
className: `flex h-6 w-max items-center justify-center gap-x-0.5 rounded-full border p-1 px-2 text-xs ${!f(s) && f((h = ve(s)) == null ? void 0 : h.key) ? "cursor-not-allowed border-gray-400 text-gray-400" : "cursor-pointer border-blue-400 text-blue-400 hover:bg-blue-400 hover:text-white"}`,
|
|
2042
2025
|
onClick: () => {
|
|
2043
2026
|
var g;
|
|
2044
|
-
!
|
|
2027
|
+
!f(s) && f((g = ve(s)) == null ? void 0 : g.key) || n();
|
|
2045
2028
|
},
|
|
2046
2029
|
children: [
|
|
2047
2030
|
/* @__PURE__ */ e.jsx(Ne, { width: 12, height: 12 }),
|
|
@@ -2051,18 +2034,18 @@ const rl = (r) => {
|
|
|
2051
2034
|
)
|
|
2052
2035
|
] }),
|
|
2053
2036
|
/* @__PURE__ */ e.jsxs("div", { className: "flex flex-col", children: [
|
|
2054
|
-
|
|
2037
|
+
f(s) && /* @__PURE__ */ e.jsx("div", { className: "flex h-12 items-center justify-center text-sm text-gray-400", children: "Click + Add to add attributes" }),
|
|
2055
2038
|
ne.Children.toArray(
|
|
2056
|
-
|
|
2057
|
-
const
|
|
2039
|
+
k(s, (g, p) => {
|
|
2040
|
+
const b = s.length > 0 && p < s.length - 1;
|
|
2058
2041
|
return /* @__PURE__ */ e.jsx(
|
|
2059
|
-
|
|
2042
|
+
hl,
|
|
2060
2043
|
{
|
|
2061
2044
|
item: g,
|
|
2062
|
-
index:
|
|
2063
|
-
canDelete:
|
|
2045
|
+
index: p,
|
|
2046
|
+
canDelete: b,
|
|
2064
2047
|
onChange: y,
|
|
2065
|
-
onRemove: () => p
|
|
2048
|
+
onRemove: () => u(p)
|
|
2066
2049
|
}
|
|
2067
2050
|
);
|
|
2068
2051
|
})
|
|
@@ -2071,50 +2054,44 @@ const rl = (r) => {
|
|
|
2071
2054
|
] }) })
|
|
2072
2055
|
] });
|
|
2073
2056
|
};
|
|
2074
|
-
function
|
|
2075
|
-
const [r,
|
|
2076
|
-
return
|
|
2057
|
+
function ml() {
|
|
2058
|
+
const [r, o] = Je(), { flexChild: t, gridChild: s } = br(), [, l] = Pr(fr), { t: d } = K(), [a] = Se();
|
|
2059
|
+
return f(a) ? /* @__PURE__ */ e.jsx("div", { className: "p-4 text-center", children: /* @__PURE__ */ e.jsxs("div", { className: "space-y-4 rounded-xl p-4", children: [
|
|
2077
2060
|
/* @__PURE__ */ e.jsx(Ze, { className: "mx-auto text-3xl" }),
|
|
2078
|
-
/* @__PURE__ */ e.jsx("h1", { children: d("no_styling_block_selected") })
|
|
2079
|
-
/* @__PURE__ */ e.jsxs("p", { className: "text-xs ", children: [
|
|
2080
|
-
"Hint: Styling allowed blocks are highlighted with",
|
|
2081
|
-
" ",
|
|
2082
|
-
/* @__PURE__ */ e.jsx("span", { className: "border border-orange-500 p-px", children: "orange" }),
|
|
2083
|
-
" border"
|
|
2084
|
-
] })
|
|
2061
|
+
/* @__PURE__ */ e.jsx("h1", { children: d("no_styling_block_selected") })
|
|
2085
2062
|
] }) }) : (
|
|
2086
2063
|
// eslint-disable-next-line jsx-a11y/click-events-have-key-events,jsx-a11y/no-static-element-interactions
|
|
2087
2064
|
/* @__PURE__ */ e.jsxs("div", { onClick: () => l(!1), className: "flex h-full flex-col", children: [
|
|
2088
|
-
/* @__PURE__ */ e.jsx("div", { className: "flex flex-col space-x-4 space-y-3 border-b
|
|
2065
|
+
/* @__PURE__ */ e.jsx("div", { className: "flex h-12 flex-col space-x-4 space-y-3 border-b border-border px-4 py-1", children: /* @__PURE__ */ e.jsxs("div", { className: "flex items-center justify-end gap-x-1.5", children: [
|
|
2089
2066
|
/* @__PURE__ */ e.jsx(Te, { htmlFor: "", className: "flex gap-x-1.5 text-xs italic", children: "State" }),
|
|
2090
|
-
/* @__PURE__ */ e.jsxs(
|
|
2091
|
-
/* @__PURE__ */ e.jsx(
|
|
2092
|
-
/* @__PURE__ */ e.jsxs(
|
|
2093
|
-
/* @__PURE__ */ e.jsx(
|
|
2094
|
-
/* @__PURE__ */ e.jsx(
|
|
2095
|
-
/* @__PURE__ */ e.jsx(
|
|
2096
|
-
/* @__PURE__ */ e.jsx(
|
|
2097
|
-
/* @__PURE__ */ e.jsx(
|
|
2098
|
-
/* @__PURE__ */ e.jsx(
|
|
2099
|
-
/* @__PURE__ */ e.jsx(
|
|
2100
|
-
/* @__PURE__ */ e.jsx(
|
|
2101
|
-
/* @__PURE__ */ e.jsx(
|
|
2102
|
-
/* @__PURE__ */ e.jsx(
|
|
2103
|
-
/* @__PURE__ */ e.jsx(
|
|
2104
|
-
/* @__PURE__ */ e.jsx(
|
|
2067
|
+
/* @__PURE__ */ e.jsxs(vr, { defaultValue: r, onValueChange: (c) => o(c), children: [
|
|
2068
|
+
/* @__PURE__ */ e.jsx(wr, { className: "h-auto w-fit p-1 px-3", children: /* @__PURE__ */ e.jsx(jr, { placeholder: "State" }) }),
|
|
2069
|
+
/* @__PURE__ */ e.jsxs(Cr, { children: [
|
|
2070
|
+
/* @__PURE__ */ e.jsx(H, { value: "", children: "Normal" }),
|
|
2071
|
+
/* @__PURE__ */ e.jsx(H, { value: "hover", children: "Hover" }),
|
|
2072
|
+
/* @__PURE__ */ e.jsx(H, { value: "active", children: "Active" }),
|
|
2073
|
+
/* @__PURE__ */ e.jsx(H, { value: "focus", children: "Focus" }),
|
|
2074
|
+
/* @__PURE__ */ e.jsx(H, { value: "before", children: "Before" }),
|
|
2075
|
+
/* @__PURE__ */ e.jsx(H, { value: "after", children: "After" }),
|
|
2076
|
+
/* @__PURE__ */ e.jsx(H, { value: "only", children: "Only" }),
|
|
2077
|
+
/* @__PURE__ */ e.jsx(H, { value: "first", children: "First" }),
|
|
2078
|
+
/* @__PURE__ */ e.jsx(H, { value: "last", children: "Last" }),
|
|
2079
|
+
/* @__PURE__ */ e.jsx(H, { value: "first-letter", children: "First Letter" }),
|
|
2080
|
+
/* @__PURE__ */ e.jsx(H, { value: "first-line", children: "First Line" }),
|
|
2081
|
+
/* @__PURE__ */ e.jsx(H, { value: "disabled", children: "Disabled" })
|
|
2105
2082
|
] })
|
|
2106
2083
|
] })
|
|
2107
2084
|
] }) }),
|
|
2108
|
-
/* @__PURE__ */ e.jsx(
|
|
2109
|
-
t && /* @__PURE__ */ e.jsx(
|
|
2110
|
-
|
|
2111
|
-
|
|
2112
|
-
/* @__PURE__ */ e.jsx(
|
|
2085
|
+
/* @__PURE__ */ e.jsx(Qe, { className: "no-scrollbar -mx-1 max-h-full flex-1 overflow-x-hidden overflow-y-hidden", children: /* @__PURE__ */ e.jsxs(Ue, { defaultValue: ["Layout"], type: "multiple", className: "w-full", children: [
|
|
2086
|
+
t && /* @__PURE__ */ e.jsx(be, { section: Kr }),
|
|
2087
|
+
s ? /* @__PURE__ */ e.jsx(be, { section: qr }) : null,
|
|
2088
|
+
Gr.map((c) => /* @__PURE__ */ e.jsx(be, { section: c }, c.heading)),
|
|
2089
|
+
/* @__PURE__ */ e.jsx(yl, { section: { heading: "Attributes" } })
|
|
2113
2090
|
] }) })
|
|
2114
2091
|
] })
|
|
2115
2092
|
);
|
|
2116
2093
|
}
|
|
2117
|
-
const
|
|
2094
|
+
const bl = {
|
|
2118
2095
|
px: 1,
|
|
2119
2096
|
"%": 1,
|
|
2120
2097
|
em: 100,
|
|
@@ -2126,9 +2103,9 @@ const yl = {
|
|
|
2126
2103
|
deg: 1,
|
|
2127
2104
|
ms: 0.1
|
|
2128
2105
|
}, Cs = () => {
|
|
2129
|
-
const r = q(), { t:
|
|
2130
|
-
onDrag: (
|
|
2131
|
-
onDragEnd: (
|
|
2106
|
+
const r = q(), { t: o } = K(), [t, s] = P.useState(""), [l, d] = P.useState({
|
|
2107
|
+
onDrag: (n) => n,
|
|
2108
|
+
onDragEnd: (n) => n,
|
|
2132
2109
|
dragStartY: 0,
|
|
2133
2110
|
dragging: !1,
|
|
2134
2111
|
dragStartValue: 0,
|
|
@@ -2136,21 +2113,21 @@ const yl = {
|
|
|
2136
2113
|
negative: !1,
|
|
2137
2114
|
cssProperty: ""
|
|
2138
2115
|
}), a = fe(
|
|
2139
|
-
(
|
|
2140
|
-
const
|
|
2141
|
-
let
|
|
2142
|
-
|
|
2143
|
-
let h =
|
|
2116
|
+
(n) => {
|
|
2117
|
+
const u = !x(l, "negative", !1), y = x(l, "cssProperty", "");
|
|
2118
|
+
let i = parseFloat(l.dragStartValue);
|
|
2119
|
+
i = Ye(i) ? 0 : i;
|
|
2120
|
+
let h = bl[l.dragUnit];
|
|
2144
2121
|
(W(y, "scale") || y === "opacity") && (h = 10);
|
|
2145
|
-
let
|
|
2146
|
-
|
|
2122
|
+
let p = (l.dragStartY - n.pageY) / h + i;
|
|
2123
|
+
u && p < 0 && (p = 0), y === "opacity" && p > 1 && (p = 1), l.onDrag(`${p}`), s(`${p}`);
|
|
2147
2124
|
},
|
|
2148
2125
|
[l],
|
|
2149
2126
|
50
|
|
2150
|
-
), c =
|
|
2127
|
+
), c = V(() => {
|
|
2151
2128
|
setTimeout(() => l.onDragEnd(`${t}`), 100), d({
|
|
2152
|
-
onDrag: (
|
|
2153
|
-
onDragEnd: (
|
|
2129
|
+
onDrag: (n) => n,
|
|
2130
|
+
onDragEnd: (n) => n,
|
|
2154
2131
|
dragStartY: 0,
|
|
2155
2132
|
dragging: !1,
|
|
2156
2133
|
dragStartValue: 0,
|
|
@@ -2161,8 +2138,8 @@ const yl = {
|
|
|
2161
2138
|
}, [l, t, d]);
|
|
2162
2139
|
return Ct(r) ? /* @__PURE__ */ e.jsx("div", { className: "p-4 text-center", children: /* @__PURE__ */ e.jsxs("div", { className: "space-y-4 rounded-xl p-4", children: [
|
|
2163
2140
|
/* @__PURE__ */ e.jsx(Ze, { className: "mx-auto text-3xl" }),
|
|
2164
|
-
/* @__PURE__ */ e.jsx("h1", { children:
|
|
2165
|
-
] }) }) : /* @__PURE__ */ e.jsx(
|
|
2141
|
+
/* @__PURE__ */ e.jsx("h1", { children: o("no_block_selected_for_styling") })
|
|
2142
|
+
] }) }) : /* @__PURE__ */ e.jsx(tt, { children: /* @__PURE__ */ e.jsxs(at.Provider, { value: { setDragData: d }, children: [
|
|
2166
2143
|
l.dragging ? /* @__PURE__ */ e.jsx(
|
|
2167
2144
|
"div",
|
|
2168
2145
|
{
|
|
@@ -2171,13 +2148,13 @@ const yl = {
|
|
|
2171
2148
|
className: "absolute inset-0 z-30 cursor-row-resize bg-gray-300/10"
|
|
2172
2149
|
}
|
|
2173
2150
|
) : null,
|
|
2174
|
-
/* @__PURE__ */ e.jsxs(
|
|
2175
|
-
/* @__PURE__ */ e.jsxs(
|
|
2176
|
-
/* @__PURE__ */ e.jsx(De, { value: "settings", children:
|
|
2177
|
-
/* @__PURE__ */ e.jsx(De, { value: "styling", children:
|
|
2151
|
+
/* @__PURE__ */ e.jsxs(kr, { defaultValue: "settings", className: "flex h-full w-full flex-col py-1", children: [
|
|
2152
|
+
/* @__PURE__ */ e.jsxs(Nr, { className: "mx-1 grid grid-cols-2", children: [
|
|
2153
|
+
/* @__PURE__ */ e.jsx(De, { value: "settings", children: o("settings") }),
|
|
2154
|
+
/* @__PURE__ */ e.jsx(De, { value: "styling", children: o("styling") })
|
|
2178
2155
|
] }),
|
|
2179
|
-
/* @__PURE__ */ e.jsx($e, { value: "settings", className: "no-scrollbar h-full flex-1 overflow-y-auto overflow-x-hidden", children: /* @__PURE__ */ e.jsx(
|
|
2180
|
-
/* @__PURE__ */ e.jsx($e, { value: "styling", className: "h-full flex-1 overflow-y-auto overflow-x-hidden", children: /* @__PURE__ */ e.jsx(
|
|
2156
|
+
/* @__PURE__ */ e.jsx($e, { value: "settings", className: "no-scrollbar h-full flex-1 overflow-y-auto overflow-x-hidden", children: /* @__PURE__ */ e.jsx(Qe, { className: "no-scrollbar max-h-full flex-1 overflow-x-hidden overflow-y-hidden pb-5", children: /* @__PURE__ */ e.jsx(Wr, {}) }) }),
|
|
2157
|
+
/* @__PURE__ */ e.jsx($e, { value: "styling", className: "h-full flex-1 overflow-y-auto overflow-x-hidden", children: /* @__PURE__ */ e.jsx(ml, {}) })
|
|
2181
2158
|
] })
|
|
2182
2159
|
] }) });
|
|
2183
2160
|
};
|