@chaibuilder/sdk 0.1.30 → 0.1.32

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.
Files changed (57) hide show
  1. package/README.md +2 -2
  2. package/dist/{AddBlocks-4f2c5dc4.js → AddBlocks-4b96d545.js} +1 -1
  3. package/dist/{AddBlocks-5ca17264.cjs → AddBlocks-e4f51b58.cjs} +1 -1
  4. package/dist/{BrandingOptions-0773c5fd.cjs → BrandingOptions-52f9691c.cjs} +1 -1
  5. package/dist/{BrandingOptions-2044d3cb.js → BrandingOptions-c91e9d44.js} +1 -1
  6. package/dist/{CanvasArea-575f601e.js → CanvasArea-957f5f74.js} +2 -2
  7. package/dist/{CanvasArea-71355900.cjs → CanvasArea-b8c26858.cjs} +2 -2
  8. package/dist/{CurrentPage-09c74e35.cjs → CurrentPage-715fe809.cjs} +1 -1
  9. package/dist/{CurrentPage-e6f23078.js → CurrentPage-fb4c55bc.js} +1 -1
  10. package/dist/{ImagesPanel-38c44785.js → ImagesPanel-3fb8087f.js} +1 -1
  11. package/dist/{ImagesPanel-0db5c72f.cjs → ImagesPanel-56ca0618.cjs} +1 -1
  12. package/dist/{Layers-a7dc3c09.js → Layers-6866cb0c.js} +3 -3
  13. package/dist/{Layers-975fed10.cjs → Layers-a955d0bb.cjs} +1 -1
  14. package/dist/{MarkAsGlobalBlock-b988f89e.cjs → MarkAsGlobalBlock-cbcb3003.cjs} +1 -1
  15. package/dist/{MarkAsGlobalBlock-39df9332.js → MarkAsGlobalBlock-f28148d9.js} +1 -1
  16. package/dist/{PagesPanel-9de2d25b.js → PagesPanel-003201ca.js} +2 -2
  17. package/dist/{PagesPanel-ba746cd1.cjs → PagesPanel-7b8f54e1.cjs} +1 -1
  18. package/dist/{ProjectPanel-eef9f5d4.cjs → ProjectPanel-6c5f2470.cjs} +1 -1
  19. package/dist/{ProjectPanel-862243ef.js → ProjectPanel-83321040.js} +2 -2
  20. package/dist/Settings-8f07a4b7.cjs +1 -0
  21. package/dist/{Settings-8b2a5a12.js → Settings-ad55d8cb.js} +919 -852
  22. package/dist/{SidePanels-41116ddd.cjs → SidePanels-446b93e7.cjs} +1 -1
  23. package/dist/{SidePanels-c1abd140.js → SidePanels-96bf29c6.js} +3 -3
  24. package/dist/{Topbar-3f8ee9ec.js → Topbar-1c4964e5.js} +1 -1
  25. package/dist/{Topbar-f622beef.cjs → Topbar-5eeea40a.cjs} +1 -1
  26. package/dist/UnsplashImages-ef3b6388.cjs +1 -0
  27. package/dist/{UnsplashImages-10c95b63.js → UnsplashImages-fe480747.js} +6 -3
  28. package/dist/{add-page-modal-3be04ab6.js → add-page-modal-2ef8a63c.js} +5 -5
  29. package/dist/{add-page-modal-7c2eea7f.cjs → add-page-modal-56dc3c56.cjs} +1 -1
  30. package/dist/command-6f260f61.js +97 -0
  31. package/dist/command-b1103666.cjs +1 -0
  32. package/dist/core.cjs +1 -1
  33. package/dist/core.js +1 -1
  34. package/dist/{delete-page-modal-13bf57f1.cjs → delete-page-modal-88aeacfd.cjs} +1 -1
  35. package/dist/{delete-page-modal-e6d85612.js → delete-page-modal-961dcc5f.js} +1 -1
  36. package/dist/{dialog-3d4e82ed.js → dialog-18207bef.js} +2 -2
  37. package/dist/{form-725e3191.js → form-046bcdbc.js} +1 -1
  38. package/dist/{form-99b51245.cjs → form-2dc05f35.cjs} +1 -1
  39. package/dist/{index-91c0470a.js → index-370ce00c.js} +3 -3
  40. package/dist/{index-a954d733.cjs → index-86352d44.cjs} +2 -2
  41. package/dist/{link-2af5de8b.js → link-e3a788f7.js} +2 -2
  42. package/dist/{link-86ac8848.cjs → link-e71b94f1.cjs} +1 -1
  43. package/dist/{page-viewer-18a13862.js → page-viewer-0c45ce74.js} +2 -2
  44. package/dist/{page-viewer-e0508ce9.cjs → page-viewer-e0d9895d.cjs} +1 -1
  45. package/dist/{project-general-setting-4c7172c1.js → project-general-setting-c5d96f79.js} +5 -5
  46. package/dist/{project-general-setting-66ba78e9.cjs → project-general-setting-d4d96611.cjs} +1 -1
  47. package/dist/{project-seo-setting-a9403f1d.cjs → project-seo-setting-6356c72f.cjs} +1 -1
  48. package/dist/{project-seo-setting-c1980ec3.js → project-seo-setting-639e4f33.js} +4 -4
  49. package/dist/{single-page-detail-6ece84b9.js → single-page-detail-22e7bc3b.js} +6 -6
  50. package/dist/{single-page-detail-6872bd4d.cjs → single-page-detail-36430438.cjs} +1 -1
  51. package/dist/ui.cjs +1 -1
  52. package/dist/ui.js +214 -281
  53. package/package.json +1 -1
  54. package/dist/Settings-8796249e.cjs +0 -1
  55. package/dist/UnsplashImages-0d091e33.cjs +0 -1
  56. package/dist/input-42acea7e.cjs +0 -1
  57. package/dist/input-a0ea2bc7.js +0 -19
@@ -1,29 +1,31 @@
1
1
  import { j as e } from "./jsx-runtime-944c88e2.js";
2
- import * as se from "react";
3
- import P, { useState as k, useEffect as M, useMemo as R, useCallback as L, createContext as Pe, useContext as ee } from "react";
4
- import { useThrottledCallback as xe } from "@react-hookz/web";
5
- import { map as N, isEmpty as b, last as he, forEach as be, set as Le, startCase as Q, filter as Oe, get as u, isArray as me, omit as at, includes as O, toLower as ne, first as fe, split as Ne, truncate as it, keys as dt, cloneDeep as ct, each as pt, capitalize as ut, reject as gt, nth as Se, startsWith as Z, isNumber as xt, parseInt as ht, isNaN as Me, findLast as mt, has as ue, flatten as z, intersection as _e, isNull as yt } from "lodash";
6
- import { useTranslation as Ee } from "react-i18next";
7
- import { PlusIcon as ve, Cross2Icon as Fe, EyeOpenIcon as bt, EyeClosedIcon as Te, BorderAllIcon as E, WidthIcon as H, HeightIcon as V, ArrowUpIcon as G, ArrowRightIcon as K, ArrowDownIcon as q, ArrowLeftIcon as J, ArrowTopLeftIcon as ft, ArrowTopRightIcon as vt, ArrowBottomRightIcon as wt, ArrowBottomLeftIcon as jt, AlignLeftIcon as Ct, AlignCenterHorizontallyIcon as kt, AlignRightIcon as Nt, StretchHorizontallyIcon as St, FontItalicIcon as Tt, UnderlineIcon as Rt, OverlineIcon as Ht, LetterCaseUppercaseIcon as Vt, Cross1Icon as Bt, InfoCircledIcon as we, MinusIcon as At, BoxIcon as Ye, TriangleDownIcon as Dt, RowSpacingIcon as $t, TrashIcon as Xe, MixerHorizontalIcon as We } from "@radix-ui/react-icons";
8
- import { T as It, a as Pt, b as Re, c as He } from "./tabs-85caa1e8.js";
9
- import Lt from "@rjsf/core";
10
- import Ot from "@rjsf/validator-ajv8";
11
- import { D as te, d as Ze, G as ze, H as Mt, I as _t, J as Et, j as je, K as Ue, L as Ge, i as Ke, e as Ft, M as qe, f as Ve, N as ce, c as Yt, O as Xt, P as Wt } from "./index-91c0470a.js";
12
- import { getChaiDataProviders as Zt, getBlockComponent as Je, SingleLineText as zt } from "@chaibuilder/blocks";
13
- import { TrashIcon as Ut, ChevronRight as Gt } from "lucide-react";
14
- import Qe from "react-autosuggest";
15
- import { u as Kt } from "./useChaiExternalData-192c7896.js";
16
- import { d as Y, e as X, f as W, B as et, g as qt } from "./useBuilderProp-81a14920.js";
17
- import { A as tt, a as ae, b as ie, c as de } from "./accordion-c0176dc5.js";
18
- import { R as Jt, I as Qt, a as er, L as tr } from "./link-2af5de8b.js";
19
- import { useAtom as rr } from "jotai";
20
- import lr from "fuse.js";
21
- import { A as or, C as pe, d as sr } from "./html-to-json-45e0e3b5.js";
22
- import { L as Ce } from "./label-e770a087.js";
23
- import { S as nr } from "./MODIFIERS-2f19c314.js";
24
- import { I as ar } from "./input-a0ea2bc7.js";
25
- import { S as ir } from "./scroll-area-83bd9e8f.js";
26
- import { S as dr, c as cr, b as pr, d as ur, f as A } from "./select-7fddd7c3.js";
2
+ import * as ne from "react";
3
+ import $, { useState as w, useEffect as E, useMemo as N, useCallback as A, createContext as Oe, useContext as re } from "react";
4
+ import { useThrottledCallback as me } from "@react-hookz/web";
5
+ import { map as C, isEmpty as b, last as ye, forEach as je, set as Me, get as p, startCase as Y, filter as be, truncate as it, isArray as ae, includes as M, first as we, split as dt, toLower as te, find as ct, omit as pt, keys as ut, cloneDeep as xt, each as gt, capitalize as ht, reject as mt, nth as Re, startsWith as z, isNumber as yt, parseInt as bt, isNaN as _e, findLast as ft, has as ge, flatten as U, intersection as Ee, isNull as vt } from "lodash";
6
+ import { useTranslation as Fe } from "react-i18next";
7
+ import { PlusIcon as Ce, Cross2Icon as Ye, EyeOpenIcon as jt, EyeClosedIcon as Ve, BorderAllIcon as O, WidthIcon as R, HeightIcon as V, ArrowUpIcon as q, ArrowRightIcon as J, ArrowDownIcon as Q, ArrowLeftIcon as ee, ArrowTopLeftIcon as wt, ArrowTopRightIcon as Ct, ArrowBottomRightIcon as kt, ArrowBottomLeftIcon as Nt, AlignLeftIcon as St, AlignCenterHorizontallyIcon as Tt, AlignRightIcon as Rt, StretchHorizontallyIcon as Vt, FontItalicIcon as Ht, UnderlineIcon as Bt, OverlineIcon as At, LetterCaseUppercaseIcon as Dt, Cross1Icon as $t, InfoCircledIcon as ke, MinusIcon as Pt, BoxIcon as Xe, TriangleDownIcon as It, RowSpacingIcon as Lt, TrashIcon as We, MixerHorizontalIcon as Ze } from "@radix-ui/react-icons";
8
+ import { T as Ot, a as Mt, b as He, c as Be } from "./tabs-85caa1e8.js";
9
+ import _t from "@rjsf/core";
10
+ import Et from "@rjsf/validator-ajv8";
11
+ import { D as G, E as Ft, d as ze, G as Ue, H as Yt, I as Xt, J as Wt, j as Ne, K as Ge, L as Ke, i as qe, e as Zt, M as Je, f as Ae, N as pe, c as zt, O as Ut, P as Gt } from "./index-370ce00c.js";
12
+ import { getChaiDataProviders as Kt, getBlockComponent as Qe, SingleLineText as qt } from "@chaibuilder/blocks";
13
+ import { EditIcon as Jt, TrashIcon as Qt, Check as er } from "lucide-react";
14
+ import { u as et } from "./useChaiExternalData-192c7896.js";
15
+ import { d as X, e as W, f as Z, B as ue, g as tr } from "./useBuilderProp-81a14920.js";
16
+ import { D as rr, a as sr, b as lr, c as or, e as nr, f as ar, d as ir } from "./dialog-18207bef.js";
17
+ import { P as dr, a as cr, b as pr } from "./popover-f7addcf4.js";
18
+ import { C as ur, b as xr, c as gr, d as hr, e as mr, f as yr, I as br } from "./command-6f260f61.js";
19
+ import { A as tt, a as ie, b as de, c as ce } from "./accordion-c0176dc5.js";
20
+ import { R as fr, I as vr, a as jr, L as wr } from "./link-e3a788f7.js";
21
+ import { useAtom as Cr } from "jotai";
22
+ import kr from "react-autosuggest";
23
+ import Nr from "fuse.js";
24
+ import { A as Sr, C as xe, d as Tr } from "./html-to-json-45e0e3b5.js";
25
+ import { L as Se } from "./label-e770a087.js";
26
+ import { S as Rr } from "./MODIFIERS-2f19c314.js";
27
+ import { S as Vr } from "./scroll-area-83bd9e8f.js";
28
+ import { S as Hr, c as Br, b as Ar, d as Dr, f as H } from "./select-7fddd7c3.js";
27
29
  import "@radix-ui/react-tabs";
28
30
  import "./utils-ac68b2c8.js";
29
31
  import "clsx";
@@ -43,340 +45,405 @@ import "@radix-ui/react-slot";
43
45
  import "class-variance-authority";
44
46
  import "@radix-ui/react-tooltip";
45
47
  import "@radix-ui/react-toast";
48
+ import "@radix-ui/react-dialog";
49
+ import "@radix-ui/react-popover";
50
+ import "cmdk";
46
51
  import "@radix-ui/react-accordion";
47
52
  import "react-icons-picker";
48
- import "./dialog-3d4e82ed.js";
49
- import "@radix-ui/react-dialog";
50
- import "./ImagesPanel-38c44785.js";
53
+ import "./ImagesPanel-3fb8087f.js";
51
54
  import "react-quill";
52
55
  import "himalaya";
53
56
  import "@radix-ui/react-label";
54
57
  import "@radix-ui/react-select";
55
- function gr(r) {
56
- const o = [], t = {};
57
- function a(l, s) {
58
- be(s, (d, i) => {
59
- const n = l ? `${l}.${i}` : i, p = me(d) ? "list" : typeof d;
60
- o.push(n), t[n] = p === "string" ? "text" : p === "object" ? "model" : p, p === "object" && !me(d) && a(n, d);
58
+ const $r = $.lazy(() => import("react-json-view"));
59
+ function Pr(t) {
60
+ const s = [], r = {};
61
+ function l(o, a) {
62
+ je(a, (d, i) => {
63
+ const n = o ? `${o}.${i}` : i, u = ae(d) ? "list" : typeof d;
64
+ s.push(n), r[n] = u === "string" ? "text" : u === "object" ? "model" : u, u === "object" && !ae(d) && l(n, d);
61
65
  });
62
66
  }
63
- return a("", at(r, ["styles", "_type", "_id", "_name", "_bindings"])), { paths: o, pathsType: t };
67
+ return l("", pt(t, ["styles", "_type", "_id", "_name", "_bindings"])), { paths: s, pathsType: r };
64
68
  }
65
- const xr = ({ data: r }) => {
66
- if (!r)
69
+ const fe = ({ data: t, fullView: s }) => {
70
+ if (!t)
67
71
  return null;
68
- const o = typeof r;
69
- return /* @__PURE__ */ e.jsx("div", { className: "text-[10px] text-gray-800/50 leading-3 whitespace-nowrap overflow-hidden w-full", children: it(o === "object" ? JSON.stringify(r) : r, { length: 40 }) });
70
- }, Be = ({
71
- type: r,
72
- isDisabled: o = !1,
73
- placeholder: t,
74
- defaultValue: a = "",
75
- data: l,
76
- onChange: s,
77
- dataType: d,
78
- appliedBindings: i
79
- }) => {
80
- const [n, p] = k(!1), [c, h] = k(a), { paths: g, pathsType: y } = gr(l), x = r === "PROP" ? Je(l == null ? void 0 : l._type) : {};
81
- M(() => {
82
- b(c) && s("");
83
- }, [c]), M(() => h(a), [a]);
84
- const f = () => g.filter((v) => {
85
- const C = b(c) || O(ne(v), ne(c));
86
- return r === "PATH" ? C && d === u(y, v, "") : C && !O(i, v) && u(x, `props.${fe(Ne(v, "."))}.binding`);
87
- }), [$, S] = k(() => f());
88
- M(() => S(() => f()), [d]);
89
- const j = r === "PATH" && b($) && n && !b(d), I = {
90
- autoComplete: "off",
91
- autoCorrect: "on",
92
- autoCapitalize: "off",
93
- spellCheck: !1,
94
- placeholder: j ? "No available options" : t,
95
- value: c,
96
- disabled: o,
97
- onFocus: () => p(r === "PATH"),
98
- onBlur: () => {
99
- p(!1), g.includes(c) ? s(c) : (h(""), s(""));
100
- },
101
- onChange: (v, { newValue: C }) => h(j ? "" : C),
102
- className: `chai-input w-full ${o ? "cursor-not-allowed" : ""} ${j ? "placeholder-red-400" : ""}`
103
- }, B = (v) => /* @__PURE__ */ e.jsxs(
104
- "div",
105
- {
106
- className: "rounded-md px-1 py-1.5 flex items-center justify-between space-x-2 font-light relative",
107
- "data-suggest": v,
108
- children: [
109
- /* @__PURE__ */ e.jsx("div", { className: "-mt-1 w-full h-full absolute opacity-0 z-20", children: v }),
110
- /* @__PURE__ */ e.jsxs("div", { className: "w-full", children: [
111
- /* @__PURE__ */ e.jsx("div", { className: "leading-4 text-xs flex items-center text-gray-800", children: P.Children.toArray(
112
- N(Ne(v, "."), (C, _) => /* @__PURE__ */ e.jsxs("span", { className: "flex items-end", children: [
113
- _ > 0 && /* @__PURE__ */ e.jsx(Gt, { size: 14, className: "h-full text-gray-400" }),
114
- Q(C)
115
- ] }))
116
- ) }),
117
- r === "PATH" && /* @__PURE__ */ e.jsx(xr, { data: u(l, v) })
118
- ] }),
119
- r === "PROP" && /* @__PURE__ */ e.jsx("div", { className: "bg-purple-100 text-purple-400 text-[9px] flex items-center font-medium h-4 px-2 rounded-full", children: Q(u(y, v, "")) })
120
- ]
121
- }
122
- );
123
- return /* @__PURE__ */ e.jsx(
124
- Qe,
125
- {
126
- suggestions: $,
127
- onSuggestionsFetchRequested: () => S(() => f()),
128
- onSuggestionsClearRequested: () => S([]),
129
- onSuggestionSelected: (v) => {
130
- if (v.type === "click") {
131
- const C = u(v.target, "childNodes[0].data", "");
132
- g.includes(C) && s(C);
133
- } else
134
- s(v.target.value);
135
- },
136
- getSuggestionValue: (v) => v,
137
- renderSuggestion: B,
138
- shouldRenderSuggestions: () => !0,
139
- inputProps: I,
140
- containerProps: { className: "w-full" },
141
- theme: {
142
- suggestion: "text-gray-500 border-b overflow-hidden text-ellipsis",
143
- suggestionHighlighted: "bg-blue-100 text-blue-800 font-normal cursor-pointer",
144
- suggestionsContainerOpen: "bg-white border border-gray-300 z-50 max-h-52 left-2 overflow-y-auto w-full rounded-md shadow-2xl text-sm font-light w-full"
72
+ const r = typeof t;
73
+ return s ? typeof t == "object" ? /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
74
+ /* @__PURE__ */ e.jsx("div", { className: "h-3" }),
75
+ /* @__PURE__ */ e.jsx(Ft, { children: /* @__PURE__ */ e.jsx(
76
+ $r,
77
+ {
78
+ style: { maxHeight: "40vh", overflowY: "auto" },
79
+ name: "Content",
80
+ enableClipboard: !1,
81
+ displayObjectSize: !1,
82
+ displayDataTypes: !1,
83
+ src: t,
84
+ collapsed: !0
145
85
  }
146
- }
147
- );
148
- }, hr = ({
149
- item: r,
86
+ ) })
87
+ ] }) : /* @__PURE__ */ e.jsxs("div", { className: "text-gray-800/50 text-[12px] leading-4 w-full max-h-36 overflow-x-hidden overflow-y-auto", children: [
88
+ /* @__PURE__ */ e.jsx("span", { className: "font-medium text-gray-800/80", children: "Content: " }),
89
+ t
90
+ ] }) : /* @__PURE__ */ e.jsx("div", { className: "text-[10px] text-gray-800/50 leading-3 whitespace-nowrap overflow-hidden w-full", children: it(r === "object" ? JSON.stringify(t) : t, { length: 40 }) });
91
+ }, De = ({
92
+ type: t,
93
+ value: s = "",
94
+ setValue: r,
95
+ data: l,
150
96
  onChange: o,
151
- onRemove: t,
152
- selectedBlock: a,
153
- dataProvider: l,
154
- appliedBindings: s
97
+ dataType: a,
98
+ appliedBindings: d
155
99
  }) => {
156
- const [d, i] = k("string"), n = (p, c) => {
157
- if (b(p))
158
- return "";
159
- {
160
- const h = u(c === "PROP" ? a : l, p, "");
161
- if (me(h))
162
- return "list";
163
- const g = typeof h;
164
- return g === "string" ? "text" : g === "object" ? "model" : g;
165
- }
166
- };
167
- return M(() => i(() => n(r.key, "PROP")), [r.key]), /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col gap-1 border border-gray-200 relative rounded-md p-2", children: [
168
- !b(d) && !b(r.key) && /* @__PURE__ */ e.jsx("div", { className: "mt-px absolute right-2 top-4 text-purple-600 text-[10px] flex items-center font-medium h-4 px-2 rounded-full", children: Q(d) }),
169
- /* @__PURE__ */ e.jsx(
170
- Be,
100
+ const { paths: i, pathsType: n } = Pr(l), u = t === "PROP" ? Qe(l == null ? void 0 : l._type) : {}, x = t === "PROP", [c, m] = w(!1), h = N(() => t === "PROP" ? i.filter(
101
+ (g) => !M(d, g) && p(u, `props.${we(dt(g, "."))}.binding`)
102
+ ) : i.filter((g) => a === p(n, g, "")), [t, i, d, a, u]);
103
+ return E(() => {
104
+ s && o(s);
105
+ }, [s, t]), /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
106
+ /* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-4", children: [
107
+ /* @__PURE__ */ e.jsx("p", { className: "text-sm text-muted-foreground", children: Y(te(t)) }),
108
+ /* @__PURE__ */ e.jsxs(dr, { open: c, onOpenChange: m, children: [
109
+ /* @__PURE__ */ e.jsx(cr, { asChild: !0, children: /* @__PURE__ */ e.jsx(
110
+ ue,
111
+ {
112
+ variant: "outline",
113
+ size: "sm",
114
+ className: ` ${b(s) ? "bg-blue-500 text-gray-100 hover:bg-blue-400 hover:text-white w-44 justify-center" : "min-w-[350px] justify-between items-center"}`,
115
+ children: s ? /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
116
+ /* @__PURE__ */ e.jsxs("span", { className: "text-sm pr-8", children: [
117
+ x && /* @__PURE__ */ e.jsx("span", { className: "text-[10px] text-purple-500 bg-purple-100 px-2 py-0.5 mr-2 rounded-full", children: Y(a) }),
118
+ s
119
+ ] }),
120
+ /* @__PURE__ */ e.jsx("span", { className: "text-[9px] text-blue-400 underline cursor-pointer hover:text-blue-700", children: "Change" })
121
+ ] }) : /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
122
+ "+ Set ",
123
+ Y(te(t))
124
+ ] })
125
+ }
126
+ ) }),
127
+ /* @__PURE__ */ e.jsx(pr, { className: "p-0 z-[999] min-w-[300px]", side: "right", align: "start", children: /* @__PURE__ */ e.jsxs(ur, { children: [
128
+ /* @__PURE__ */ e.jsx(xr, { placeholder: `Choose ${te(t)}...` }),
129
+ /* @__PURE__ */ e.jsxs(gr, { children: [
130
+ /* @__PURE__ */ e.jsx(hr, { children: "No results found." }),
131
+ /* @__PURE__ */ e.jsx(mr, { children: C(h, (g) => /* @__PURE__ */ e.jsxs(
132
+ yr,
133
+ {
134
+ value: g,
135
+ className: `cursor-pointer ${x ? "flex justify-between items-center" : "flex flex-col items-start justify-start"}`,
136
+ onSelect: (f) => {
137
+ r(ct(h, (S) => S === f) || null), m(!1);
138
+ },
139
+ children: [
140
+ /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-x-2", children: [
141
+ /* @__PURE__ */ e.jsx(er, { className: `w-4 h-4 text-green-500 ${s === g ? "" : "opacity-0"}` }),
142
+ g
143
+ ] }),
144
+ x ? /* @__PURE__ */ e.jsx("div", { children: /* @__PURE__ */ e.jsx("span", { className: "text-[10px] text-purple-500 bg-purple-100 px-2 py-0.5 rounded-full", children: Y(p(n, g, "")) }) }) : /* @__PURE__ */ e.jsx("div", { className: "pl-6", children: /* @__PURE__ */ e.jsx(fe, { data: p(l, g) }) })
145
+ ]
146
+ },
147
+ g
148
+ )) })
149
+ ] })
150
+ ] }) })
151
+ ] })
152
+ ] }),
153
+ !x && !b(s) && /* @__PURE__ */ e.jsx("div", { className: "pt-2", children: /* @__PURE__ */ e.jsx(fe, { data: p(l, s, ""), fullView: !0 }) })
154
+ ] });
155
+ }, Ir = ({
156
+ appliedBindings: t = [],
157
+ onAddBinding: s,
158
+ editMode: r,
159
+ item: l
160
+ }) => {
161
+ const [o, a] = w(r ? l.key : ""), [d, i] = w(r ? l.value : ""), n = G(), [u] = et(), x = A(
162
+ (h, g) => {
163
+ if (b(h))
164
+ return "";
171
165
  {
172
- type: "PROP",
173
- isDisabled: !1,
174
- placeholder: "Enter prop key",
175
- defaultValue: r.key,
176
- onChange: (p) => {
177
- const c = n(p, "PROP");
178
- o({ target: { name: "key", value: p } }), d !== c && o({ target: { name: "value", value: "" } }), i(c);
179
- },
180
- data: a,
181
- dataType: d,
182
- appliedBindings: s
166
+ const f = p(g === "PROP" ? n : u, h, "");
167
+ if (ae(f))
168
+ return "list";
169
+ const S = typeof f;
170
+ return S === "string" ? "text" : S === "object" ? "model" : S;
183
171
  }
184
- ),
185
- /* @__PURE__ */ e.jsxs("div", { className: "flex items-start justify-between gap-x-1.5 w-full relative", children: [
172
+ },
173
+ [n, u]
174
+ ), [c, m] = w(r ? x(l.key, "PROP") : "");
175
+ return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
176
+ /* @__PURE__ */ e.jsxs(or, { children: [
177
+ /* @__PURE__ */ e.jsx(nr, { children: "Add Data Binding" }),
178
+ /* @__PURE__ */ e.jsx(ar, { className: "text-xs", children: "Add prop and path of binding. Click save when you're done." })
179
+ ] }),
180
+ /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col gap-1 relative", children: [
186
181
  /* @__PURE__ */ e.jsx(
187
- Be,
182
+ De,
183
+ {
184
+ type: "PROP",
185
+ isDisabled: !1,
186
+ placeholder: "Enter prop key",
187
+ value: o,
188
+ setValue: a,
189
+ onChange: (h) => {
190
+ const g = x(h, "PROP");
191
+ a(h), c !== g && i(""), m(g);
192
+ },
193
+ data: n,
194
+ dataType: c,
195
+ appliedBindings: t
196
+ }
197
+ ),
198
+ /* @__PURE__ */ e.jsx("div", { className: "h-2" }),
199
+ /* @__PURE__ */ e.jsx(
200
+ De,
188
201
  {
189
202
  type: "PATH",
190
- isDisabled: b(r.key),
203
+ isDisabled: b(o),
191
204
  placeholder: "Enter data path",
192
- defaultValue: r.value,
193
- onChange: (p) => {
194
- const c = n(p, "PATH");
195
- o(d !== c ? { target: { name: "value", value: "" } } : { target: { name: "value", value: p } });
205
+ value: d,
206
+ setValue: i,
207
+ onChange: (h) => {
208
+ const g = x(h, "PATH");
209
+ i(c === g ? h : "");
196
210
  },
197
- data: l,
198
- dataType: d,
199
- appliedBindings: s
211
+ data: u,
212
+ dataType: c,
213
+ appliedBindings: t
200
214
  }
201
- ),
215
+ )
216
+ ] }),
217
+ /* @__PURE__ */ e.jsx(ir, { children: /* @__PURE__ */ e.jsx(
218
+ ue,
219
+ {
220
+ type: "submit",
221
+ className: "mt-4",
222
+ disabled: b(o) && b(d),
223
+ onClick: () => s({ key: o, value: d }),
224
+ children: "Save"
225
+ }
226
+ ) })
227
+ ] });
228
+ }, rt = ({ children: t, onAddBinding: s, appliedBindings: r, editMode: l = !0, item: o = {} }) => {
229
+ const [a, d] = w(!1);
230
+ return /* @__PURE__ */ e.jsxs(rr, { children: [
231
+ /* @__PURE__ */ e.jsx(sr, { asChild: !0, onClick: () => d(!0), children: t }),
232
+ a && /* @__PURE__ */ e.jsx(lr, { children: /* @__PURE__ */ e.jsx(
233
+ Ir,
234
+ {
235
+ item: o,
236
+ editMode: l,
237
+ appliedBindings: r,
238
+ onAddBinding: (i) => {
239
+ s(i), d(!1);
240
+ }
241
+ }
242
+ ) })
243
+ ] });
244
+ }, Lr = ({
245
+ item: t,
246
+ onAddBinding: s,
247
+ onRemove: r,
248
+ selectedBlock: l,
249
+ dataProvider: o,
250
+ appliedBindings: a
251
+ }) => {
252
+ const [d, i] = w("string"), n = (u, x) => {
253
+ if (b(u))
254
+ return "";
255
+ {
256
+ const c = p(x === "PROP" ? l : o, u, "");
257
+ if (ae(c))
258
+ return "list";
259
+ const m = typeof c;
260
+ return m === "string" ? "text" : m === "object" ? "model" : m;
261
+ }
262
+ };
263
+ return E(() => i(() => n(t.key, "PROP")), [t.key]), /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col border border-gray-200 relative rounded-md p-2", children: [
264
+ /* @__PURE__ */ e.jsx("div", { className: "text-gray-500 font-normal text-sm", children: t.key }),
265
+ /* @__PURE__ */ e.jsx("div", { className: "font-medium leading-5", children: t.value }),
266
+ /* @__PURE__ */ e.jsx(fe, { data: p(o, t.value, "") }),
267
+ /* @__PURE__ */ e.jsxs("div", { className: "flex items-center justify-end gap-x-2", children: [
268
+ /* @__PURE__ */ e.jsx(rt, { editMode: !0, onAddBinding: s, appliedBindings: a, item: t, children: /* @__PURE__ */ e.jsx(Jt, { className: "h-6 w-6 mt-1 cursor-pointer rounded border hover:bg-blue-400 hover:text-white border-blue-400 p-1 text-blue-400 hover:scale-105 duration-200" }) }),
202
269
  /* @__PURE__ */ e.jsx(
203
- Ut,
270
+ Qt,
204
271
  {
205
- onClick: t,
272
+ onClick: () => r(),
206
273
  className: "h-6 w-6 mt-1 cursor-pointer rounded border hover:bg-red-400 hover:text-white border-red-400 p-1 text-red-400 hover:scale-105 duration-200"
207
274
  }
208
275
  )
209
- ] })
276
+ ] }),
277
+ !b(d) && !b(t.key) && /* @__PURE__ */ e.jsx("div", { className: "mt-px absolute right-0 top-1 text-purple-600 text-[10px] flex items-center font-medium h-4 px-2 rounded-full", children: Y(d) })
210
278
  ] });
211
- }, mr = ({ bindingData: r, onChange: o }) => {
212
- const t = te(), [a] = Kt(), l = Zt(), [s, d] = k(N(r, (g, y) => ({ key: y, value: g })));
213
- M(() => {
214
- d(N(r, (g, y) => ({ key: y, value: g })));
215
- }, [t == null ? void 0 : t._id]);
216
- const i = R(() => {
217
- if (b(s))
279
+ }, Or = ({ bindingData: t, onChange: s }) => {
280
+ const r = G(), [l] = et(), o = Kt(), [a, d] = w(
281
+ C(t, (c, m) => ({ key: m, value: c }))
282
+ );
283
+ E(() => {
284
+ d(C(t, (c, m) => ({ key: m, value: c })));
285
+ }, [r == null ? void 0 : r._id]);
286
+ const i = N(() => {
287
+ if (b(a))
218
288
  return !1;
219
- const g = he(s);
220
- return b(g == null ? void 0 : g.key) || b(g == null ? void 0 : g.value);
221
- }, [s]), n = () => {
222
- d([...s, { key: "", value: "" }]);
223
- }, p = (g) => {
224
- const y = Oe(s, (x, f) => g !== f);
225
- h([...y]);
226
- }, c = (g, y) => {
227
- const x = [...s];
228
- x[y][g.target.name] = g.target.value, h(x);
229
- }, h = L(
230
- (g = []) => {
231
- if (d(g), b(g)) {
232
- o({});
289
+ const c = ye(a);
290
+ return b(c == null ? void 0 : c.key) || b(c == null ? void 0 : c.value);
291
+ }, [a]), n = (c) => {
292
+ const m = be(a, (h) => h.key !== c.key);
293
+ d([...m, c]), x([...m, c]);
294
+ }, u = (c) => {
295
+ const m = be(a, (h, g) => c !== g);
296
+ x([...m]);
297
+ }, x = A(
298
+ (c = []) => {
299
+ if (d(c), b(c)) {
300
+ s({});
233
301
  return;
234
302
  }
235
- const y = {};
236
- be(g, (x) => {
237
- !b(x == null ? void 0 : x.key) && !b(x == null ? void 0 : x.value) && Le(y, x.key, x.value);
238
- }), o(y);
303
+ const m = {};
304
+ je(c, (h) => {
305
+ !b(h == null ? void 0 : h.key) && !b(h == null ? void 0 : h.value) && Me(m, h.key, h.value);
306
+ }), s(m);
239
307
  },
240
- [t]
308
+ [r]
241
309
  );
242
- return b(l) ? /* @__PURE__ */ e.jsx("div", { className: "w-full flex items-center justify-center", children: /* @__PURE__ */ e.jsxs("p", { className: "text-gray-500 mb-1.5 text-xs", children: [
310
+ return b(o) ? /* @__PURE__ */ e.jsx("div", { className: "w-full flex items-center justify-center", children: /* @__PURE__ */ e.jsxs("p", { className: "text-gray-500 mb-1.5 text-xs", children: [
243
311
  "You have no data providers registered. Please add a data provider to your project. ",
244
312
  /* @__PURE__ */ e.jsx("br", {}),
245
313
  /* @__PURE__ */ e.jsx("a", { className: "text-blue-500", href: "https://chaibuilder.com/docs/registering-data-providers", target: "_blank", children: "Learn more" })
246
314
  ] }) }) : /* @__PURE__ */ e.jsxs("div", { className: "space-y-2", children: [
247
- N(s, (g, y) => /* @__PURE__ */ e.jsx(
248
- hr,
315
+ C(a, (c, m) => /* @__PURE__ */ e.jsx(
316
+ Lr,
249
317
  {
250
- item: g,
251
- onChange: (x) => c(x, y),
252
- onRemove: () => p(y),
253
- selectedBlock: t,
254
- dataProvider: a,
255
- appliedBindings: N(s, "key")
318
+ item: c,
319
+ onAddBinding: n,
320
+ onRemove: () => u(m),
321
+ selectedBlock: r,
322
+ dataProvider: l,
323
+ appliedBindings: C(a, "key")
256
324
  },
257
- g.key
325
+ c.key
258
326
  )),
259
- /* @__PURE__ */ e.jsxs(Y, { delayDuration: 200, children: [
260
- /* @__PURE__ */ e.jsx(X, { className: "w-full", children: /* @__PURE__ */ e.jsx(
327
+ /* @__PURE__ */ e.jsxs(X, { delayDuration: 200, children: [
328
+ /* @__PURE__ */ e.jsx(W, { className: "w-full", children: /* @__PURE__ */ e.jsx(rt, { appliedBindings: C(a, "key"), onAddBinding: n, children: /* @__PURE__ */ e.jsx(
261
329
  "button",
262
330
  {
263
- onClick: n,
264
331
  disabled: i,
265
- className: `w-full px-5 py-1.5 text-xs rounded-md font-medium duration-200 ${b(s) ? "bg-blue-700/20 text-blue-800 hover:bg-blue-700/30 " : ""} ${i ? "cursor-not-allowed bg-gray-200 text-gray-400" : b(s) ? "" : "bg-gray-700/20 text-gray-800 hover:bg-blue-700/30"}`,
332
+ className: `w-full px-5 py-1.5 text-xs rounded-md font-medium duration-200 ${b(a) ? "bg-blue-700/20 text-blue-800 hover:bg-blue-700/30" : ""} ${i ? "cursor-not-allowed bg-gray-200 text-gray-400" : b(a) ? "" : "bg-blue-700/20 text-blue-800 hover:bg-blue-700/30"}`,
266
333
  children: "+ Add Data Binding"
267
334
  }
268
- ) }),
269
- i && /* @__PURE__ */ e.jsx(W, { sideOffset: -55, className: "text-[11px]", children: "Complete last added data binding to add more" })
335
+ ) }) }),
336
+ i && /* @__PURE__ */ e.jsx(Z, { sideOffset: -55, className: "text-[11px]", children: "Complete last added data binding to add more" })
270
337
  ] })
271
338
  ] });
272
- }, yr = mr, br = () => /* @__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" }), Ae = ({
273
- createHistorySnapshot: r,
274
- properties: o,
275
- formData: t,
276
- onChange: a
339
+ }, Mr = Or, _r = () => /* @__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" }), $e = ({
340
+ createHistorySnapshot: t,
341
+ properties: s,
342
+ formData: r,
343
+ onChange: l
277
344
  }) => {
278
- const [l] = Mt(), s = { type: "object", properties: {} }, d = {};
279
- return Object.keys(o).forEach((i) => {
280
- const n = o[i];
281
- if (O(["slot", "styles"], n.type))
345
+ const [o] = Yt(), a = { type: "object", properties: {} }, d = {};
346
+ return Object.keys(s).forEach((i) => {
347
+ const n = s[i];
348
+ if (M(["slot", "styles"], n.type))
282
349
  return;
283
- const p = u(n, "i18n", !1) ? `${i}-${l}` : i;
284
- s.properties[p] = _t(n, l), d[p] = Et(n, l);
350
+ const u = p(n, "i18n", !1) ? `${i}-${o}` : i;
351
+ a.properties[u] = Xt(n, o), d[u] = Wt(n, o);
285
352
  }), /* @__PURE__ */ e.jsx(
286
- Lt,
353
+ _t,
287
354
  {
288
355
  widgets: {
289
- binding: br,
290
- richtext: Jt,
291
- icon: Qt,
292
- image: er
356
+ binding: _r,
357
+ richtext: fr,
358
+ icon: vr,
359
+ image: jr
293
360
  },
294
361
  fields: {
295
- link: tr
362
+ link: wr
296
363
  },
297
364
  idSeparator: ".",
298
365
  autoComplete: "off",
299
366
  omitExtraData: !1,
300
367
  liveOmit: !1,
301
368
  liveValidate: !0,
302
- validator: Ot,
369
+ validator: Et,
303
370
  uiSchema: d,
304
- onBlur: r,
305
- schema: s,
306
- formData: t,
307
- onChange: a
371
+ onBlur: t,
372
+ schema: a,
373
+ formData: r,
374
+ onChange: l
308
375
  }
309
376
  );
310
377
  };
311
- function fr() {
312
- const r = te(), { createSnapshot: o } = Ze(), t = ze(), a = Je(r._type), l = { ...r }, s = () => o(), d = ({ formData: c }, h) => {
313
- if (h) {
314
- const g = h.replace("root.", "");
315
- t([r._id], { [g]: u(c, g) });
378
+ function Er() {
379
+ const t = G(), { createSnapshot: s } = ze(), r = Ue(), l = Qe(t._type), o = { ...t }, a = () => s(), d = ({ formData: x }, c) => {
380
+ if (c) {
381
+ const m = c.replace("root.", "");
382
+ r([t._id], { [m]: p(x, m) });
316
383
  }
317
384
  }, i = {
318
- _name: zt({
385
+ _name: qt({
319
386
  title: "Name",
320
- default: u(r, "_name", r._type)
387
+ default: p(t, "_name", t._type)
321
388
  })
322
- }, n = dt(u(l, "_bindings", {})), p = R(() => {
323
- const c = ct(u(a, "props", {}));
324
- return pt(n, (h) => {
325
- delete c[h];
326
- }), c;
327
- }, [a, n]);
389
+ }, n = ut(p(o, "_bindings", {})), u = N(() => {
390
+ const x = xt(p(l, "props", {}));
391
+ return gt(n, (c) => {
392
+ delete x[c];
393
+ }), x;
394
+ }, [l, n]);
328
395
  return /* @__PURE__ */ e.jsxs("div", { className: "overflow-x-hidden", children: [
329
396
  /* @__PURE__ */ e.jsx(
330
- Ae,
397
+ $e,
331
398
  {
332
399
  onChange: d,
333
- createHistorySnapshot: s,
334
- formData: l,
400
+ createHistorySnapshot: a,
401
+ formData: o,
335
402
  properties: i
336
403
  }
337
404
  ),
338
405
  /* @__PURE__ */ e.jsx("hr", { className: "mt-4" }),
339
406
  /* @__PURE__ */ e.jsxs(tt, { type: "multiple", defaultValue: ["STATIC", "BINDING"], className: "h-full w-full", children: [
340
- /* @__PURE__ */ e.jsxs(ae, { value: "BINDING", children: [
341
- /* @__PURE__ */ e.jsx(ie, { className: "px-3 py-2 text-xs hover:no-underline bg-gray-100 ml-1", children: /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-x-2", children: [
407
+ /* @__PURE__ */ e.jsxs(ie, { value: "BINDING", children: [
408
+ /* @__PURE__ */ e.jsx(de, { className: "px-3 py-2 text-xs hover:no-underline bg-gray-100 ml-1", children: /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-x-2", children: [
342
409
  /* @__PURE__ */ e.jsx(
343
410
  "div",
344
411
  {
345
- className: `h-[8px] w-[8px] rounded-full ${b(u(r, "_bindings", {})) ? "bg-gray-300" : "bg-blue-500"}`
412
+ className: `h-[8px] w-[8px] rounded-full ${b(p(t, "_bindings", {})) ? "bg-gray-300" : "bg-blue-500"}`
346
413
  }
347
414
  ),
348
415
  "Data Binding"
349
416
  ] }) }),
350
- /* @__PURE__ */ e.jsx(de, { className: "pt-4 px-4", children: /* @__PURE__ */ e.jsx(
351
- yr,
417
+ /* @__PURE__ */ e.jsx(ce, { className: "pt-4 px-4", children: /* @__PURE__ */ e.jsx(
418
+ Mr,
352
419
  {
353
- bindingData: u(l, "_bindings", {}),
354
- onChange: (c) => {
355
- d({ formData: { ...l, _bindings: c } }, "root._bindings");
420
+ bindingData: p(o, "_bindings", {}),
421
+ onChange: (x) => {
422
+ d({ formData: { ...o, _bindings: x } }, "root._bindings");
356
423
  }
357
424
  }
358
425
  ) })
359
426
  ] }),
360
- /* @__PURE__ */ e.jsxs(ae, { value: "STATIC", children: [
361
- /* @__PURE__ */ e.jsx(ie, { className: "px-3 py-2 text-xs hover:no-underline bg-gray-100 ml-1", children: /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-x-2", children: [
427
+ /* @__PURE__ */ e.jsxs(ie, { value: "STATIC", children: [
428
+ /* @__PURE__ */ e.jsx(de, { className: "px-3 py-2 text-xs hover:no-underline bg-gray-100 ml-1", children: /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-x-2", children: [
362
429
  /* @__PURE__ */ e.jsx("div", { className: "h-[8px] w-[8px] rounded-full bg-blue-500" }),
363
430
  "Static Content"
364
431
  ] }) }),
365
- /* @__PURE__ */ e.jsxs(de, { className: "pt-4", children: [
432
+ /* @__PURE__ */ e.jsxs(ce, { className: "pt-4", children: [
366
433
  b(n) ? "" : /* @__PURE__ */ e.jsxs("div", { className: "text-xs mx-4 border rounded-sm p-1 mb-1 mt-0 border-orange-500 text-orange-500 bg-orange-100", children: [
367
434
  "Data binding is set for ",
368
- /* @__PURE__ */ e.jsx("b", { children: N(n, ut).join(", ") }),
435
+ /* @__PURE__ */ e.jsx("b", { children: C(n, ht).join(", ") }),
369
436
  " ",
370
437
  n.length === 1 ? "property" : "properties",
371
438
  ". Remove data binding to edit static content."
372
439
  ] }),
373
440
  /* @__PURE__ */ e.jsx(
374
- Ae,
441
+ $e,
375
442
  {
376
443
  onChange: d,
377
- createHistorySnapshot: s,
378
- formData: l,
379
- properties: p
444
+ createHistorySnapshot: a,
445
+ formData: o,
446
+ properties: u
380
447
  }
381
448
  )
382
449
  ] })
@@ -385,60 +452,60 @@ function fr() {
385
452
  /* @__PURE__ */ e.jsx("div", { className: "pb-60" })
386
453
  ] });
387
454
  }
388
- const De = new lr(or, {
455
+ const Pe = new Nr(Sr, {
389
456
  isCaseSensitive: !1,
390
457
  threshold: 0.2,
391
458
  minMatchCharLength: 2,
392
459
  keys: ["name"]
393
460
  });
394
- function vr() {
395
- var S;
396
- const [r] = je(), o = te(), t = Ue(), a = Ge(), [l] = Ke(), [s, d] = k(""), i = (S = fe(r)) == null ? void 0 : S.prop, n = gt((u(o, i, "").replace(nr, "").split(",").pop() || "").split(" "), b), p = () => {
397
- const j = s.trim().toLowerCase().replace(/ +(?= )/g, "").split(" ");
398
- t(l, j, !0), d("");
399
- }, [c, h] = k([]), g = ({ value: j }) => {
400
- const I = j.trim().toLowerCase(), B = I.match(/.+:/g);
401
- let v = [];
402
- if (B && B.length > 0) {
403
- const [C] = B, _ = I.replace(C, "");
404
- v = De.search(_).map((m) => ({
405
- ...m,
406
- item: { ...m.item, name: C + m.item.name }
461
+ function Fr() {
462
+ var D;
463
+ const [t] = Ne(), s = G(), r = Ge(), l = Ke(), [o] = qe(), [a, d] = w(""), i = (D = we(t)) == null ? void 0 : D.prop, n = mt((p(s, i, "").replace(Rr, "").split(",").pop() || "").split(" "), b), u = () => {
464
+ const j = a.trim().toLowerCase().replace(/ +(?= )/g, "").split(" ");
465
+ r(o, j, !0), d("");
466
+ }, [x, c] = w([]), m = ({ value: j }) => {
467
+ const L = j.trim().toLowerCase(), P = L.match(/.+:/g);
468
+ let k = [];
469
+ if (P && P.length > 0) {
470
+ const [I] = P, F = L.replace(I, "");
471
+ k = Pe.search(F).map((y) => ({
472
+ ...y,
473
+ item: { ...y.item, name: I + y.item.name }
407
474
  }));
408
475
  } else
409
- v = De.search(I);
410
- h(N(v, "item"));
411
- }, y = () => {
412
- h([]);
413
- }, x = (j) => j.name, f = (j) => /* @__PURE__ */ e.jsx("div", { className: "rounded-md p-1", children: j.name }), $ = {
476
+ k = Pe.search(L);
477
+ c(C(k, "item"));
478
+ }, h = () => {
479
+ c([]);
480
+ }, g = (j) => j.name, f = (j) => /* @__PURE__ */ e.jsx("div", { className: "rounded-md p-1", children: j.name }), S = {
414
481
  autoComplete: "off",
415
482
  autoCorrect: "off",
416
483
  autoCapitalize: "off",
417
484
  spellCheck: !1,
418
485
  placeholder: "Enter class name",
419
- value: s,
486
+ value: a,
420
487
  onKeyDown: (j) => {
421
- j.key === "Enter" && s.trim() !== "" && p();
488
+ j.key === "Enter" && a.trim() !== "" && u();
422
489
  },
423
- onChange: (j, { newValue: I }) => d(I),
490
+ onChange: (j, { newValue: L }) => d(L),
424
491
  className: "w-full rounded-md text-xs px-2 hover:outline-0 bg-background border-border py-1"
425
492
  };
426
493
  return /* @__PURE__ */ e.jsxs(
427
494
  "div",
428
495
  {
429
- className: `no-scrollbar flex ${c.length > 0 ? "min-h-[300px]" : "min-h-max"} w-full flex-col gap-y-5 overflow-y-auto bg-gray-100 px-px`,
496
+ className: `no-scrollbar flex ${x.length > 0 ? "min-h-[300px]" : "min-h-max"} w-full flex-col gap-y-5 overflow-y-auto bg-gray-100 px-px`,
430
497
  children: [
431
- /* @__PURE__ */ e.jsx(Ce, { className: "mt-2", children: "Add Tailwind classes" }),
498
+ /* @__PURE__ */ e.jsx(Se, { className: "mt-2", children: "Add Tailwind classes" }),
432
499
  /* @__PURE__ */ e.jsxs("div", { className: "relative -mt-4 flex items-center gap-x-3", children: [
433
500
  /* @__PURE__ */ e.jsx("div", { className: "relative flex w-full items-center gap-x-3", children: /* @__PURE__ */ e.jsx(
434
- Qe,
501
+ kr,
435
502
  {
436
- suggestions: c,
437
- onSuggestionsFetchRequested: g,
438
- onSuggestionsClearRequested: y,
439
- getSuggestionValue: x,
503
+ suggestions: x,
504
+ onSuggestionsFetchRequested: m,
505
+ onSuggestionsClearRequested: h,
506
+ getSuggestionValue: g,
440
507
  renderSuggestion: f,
441
- inputProps: $,
508
+ inputProps: S,
442
509
  containerProps: {
443
510
  className: "relative h-8 w-full gap-y-1 py-1 border-gray-600"
444
511
  },
@@ -450,20 +517,20 @@ function vr() {
450
517
  }
451
518
  ) }),
452
519
  /* @__PURE__ */ e.jsx(
453
- et,
520
+ ue,
454
521
  {
455
522
  variant: "outline",
456
523
  className: "h-6 border-gray-700",
457
- onClick: p,
458
- disabled: s.trim() === "",
524
+ onClick: u,
525
+ disabled: a.trim() === "",
459
526
  size: "sm",
460
- children: /* @__PURE__ */ e.jsx(ve, {})
527
+ children: /* @__PURE__ */ e.jsx(Ce, {})
461
528
  }
462
529
  )
463
530
  ] }),
464
531
  /* @__PURE__ */ e.jsxs("div", { className: "flex w-full flex-wrap gap-2", children: [
465
532
  b(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" }),
466
- se.Children.toArray(
533
+ ne.Children.toArray(
467
534
  n.map((j) => /* @__PURE__ */ e.jsxs(
468
535
  "div",
469
536
  {
@@ -471,9 +538,9 @@ function vr() {
471
538
  children: [
472
539
  j,
473
540
  /* @__PURE__ */ e.jsx(
474
- Fe,
541
+ Ye,
475
542
  {
476
- onClick: () => a(l, [j]),
543
+ onClick: () => l(o, [j]),
477
544
  className: "invisible absolute right-1 hover:text-white group-hover:visible group-hover:cursor-pointer"
478
545
  }
479
546
  )
@@ -487,16 +554,16 @@ function vr() {
487
554
  }
488
555
  );
489
556
  }
490
- const D = ["px", "%", "em", "rem", "ch", "vh", "vw"], wr = {
557
+ const B = ["px", "%", "em", "rem", "ch", "vh", "vw"], Yr = {
491
558
  heading: "Flex Child",
492
559
  items: [
493
- { type: "arbitrary", label: "Basis", units: D, property: "flexBasis" },
560
+ { type: "arbitrary", label: "Basis", units: B, property: "flexBasis" },
494
561
  { type: "range", label: "Order", property: "order" },
495
562
  { type: "dropdown", label: "Flex", property: "flexGrowShrink" },
496
563
  { type: "dropdown", label: "Grow", property: "flexGrow" },
497
564
  { type: "dropdown", label: "Shrink", property: "flexShrink" }
498
565
  ]
499
- }, jr = {
566
+ }, Xr = {
500
567
  heading: "Grid Child",
501
568
  items: [
502
569
  { type: "range", label: "Col Span", property: "gridColSpan" },
@@ -507,11 +574,11 @@ const D = ["px", "%", "em", "rem", "ch", "vh", "vw"], wr = {
507
574
  { type: "range", label: "Row End", property: "gridRowEnd" },
508
575
  { type: "range", label: "Order", property: "order" }
509
576
  ]
510
- }, Cr = [
577
+ }, Wr = [
511
578
  {
512
579
  heading: "Display",
513
580
  items: [
514
- { type: "dropdown", label: "Display", property: "display", units: D },
581
+ { type: "dropdown", label: "Display", property: "display", units: B },
515
582
  {
516
583
  styleType: "accordion",
517
584
  heading: "Flex options",
@@ -562,7 +629,7 @@ const D = ["px", "%", "em", "rem", "ch", "vh", "vw"], wr = {
562
629
  styleType: "accordion",
563
630
  heading: "Visibility & Opacity",
564
631
  items: [
565
- { type: "dropdown", label: "Visibility", property: "visibility", units: D },
632
+ { type: "dropdown", label: "Visibility", property: "visibility", units: B },
566
633
  { type: "arbitrary", label: "Opacity", property: "opacity", units: ["-"] }
567
634
  ]
568
635
  }
@@ -575,7 +642,7 @@ const D = ["px", "%", "em", "rem", "ch", "vh", "vw"], wr = {
575
642
  styleType: "multiple",
576
643
  label: "Margin",
577
644
  negative: !0,
578
- units: [...D, "auto"],
645
+ units: [...B, "auto"],
579
646
  options: [
580
647
  { key: "margin", label: "All" },
581
648
  { key: "marginX", label: "Left-Right" },
@@ -612,22 +679,22 @@ const D = ["px", "%", "em", "rem", "ch", "vh", "vw"], wr = {
612
679
  {
613
680
  heading: "Size",
614
681
  items: [
615
- { type: "arbitrary", label: "Width", units: D.concat("auto"), property: "width" },
616
- { type: "arbitrary", label: "Height", units: D.concat("auto"), property: "height" },
682
+ { type: "arbitrary", label: "Width", units: B.concat("auto"), property: "width" },
683
+ { type: "arbitrary", label: "Height", units: B.concat("auto"), property: "height" },
617
684
  {
618
685
  styleType: "accordion",
619
686
  heading: "Min width & height",
620
687
  items: [
621
- { type: "arbitrary", label: "Min Width", units: D.concat("auto"), property: "minWidth" },
622
- { type: "arbitrary", label: "Min Height", units: D.concat("auto"), property: "minHeight" }
688
+ { type: "arbitrary", label: "Min Width", units: B.concat("auto"), property: "minWidth" },
689
+ { type: "arbitrary", label: "Min Height", units: B.concat("auto"), property: "minHeight" }
623
690
  ]
624
691
  },
625
692
  {
626
693
  styleType: "accordion",
627
694
  heading: "Max width & height",
628
695
  items: [
629
- { type: "arbitrary", label: "Max Width", units: D.concat("auto"), property: "maxWidth" },
630
- { type: "arbitrary", label: "Max Height", units: D.concat("auto"), property: "maxHeight" }
696
+ { type: "arbitrary", label: "Max Width", units: B.concat("auto"), property: "maxWidth" },
697
+ { type: "arbitrary", label: "Max Height", units: B.concat("auto"), property: "maxHeight" }
631
698
  ]
632
699
  },
633
700
  {
@@ -711,8 +778,8 @@ const D = ["px", "%", "em", "rem", "ch", "vh", "vw"], wr = {
711
778
  heading: "Typography",
712
779
  items: [
713
780
  { type: "dropdown", property: "fontFamily", label: "Font" },
714
- { type: "arbitrary", property: "fontSize", label: "Size", units: D },
715
- { type: "arbitrary", property: "lineHeight", label: "Height", units: D.concat("-") },
781
+ { type: "arbitrary", property: "fontSize", label: "Size", units: B },
782
+ { type: "arbitrary", property: "lineHeight", label: "Height", units: B.concat("-") },
716
783
  { type: "range", property: "fontWeight", label: "Weight" },
717
784
  { type: "color", property: "textColor", label: "Color" },
718
785
  {
@@ -909,89 +976,89 @@ const D = ["px", "%", "em", "rem", "ch", "vh", "vw"], wr = {
909
976
  },
910
977
  {
911
978
  heading: "Classes",
912
- items: [{ component: vr }]
979
+ items: [{ component: Fr }]
913
980
  }
914
- ], rt = {
981
+ ], st = {
915
982
  "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" }) }),
916
983
  // visibility
917
- visible: bt,
918
- invisible: Te,
984
+ visible: jt,
985
+ invisible: Ve,
919
986
  // display
920
- hidden: Te,
921
- gap: E,
922
- gapX: H,
987
+ hidden: Ve,
988
+ gap: O,
989
+ gapX: R,
923
990
  gapY: V,
924
- spaceX: H,
991
+ spaceX: R,
925
992
  spaceY: V,
926
- overscroll: E,
927
- overscrollX: H,
993
+ overscroll: O,
994
+ overscrollX: R,
928
995
  overscrollY: V,
929
- overflow: E,
930
- overflowX: H,
996
+ overflow: O,
997
+ overflowX: R,
931
998
  overflowY: V,
932
- top: G,
933
- right: K,
934
- bottom: q,
935
- left: J,
936
- inset: E,
937
- insetX: H,
999
+ top: q,
1000
+ right: J,
1001
+ bottom: Q,
1002
+ left: ee,
1003
+ inset: O,
1004
+ insetX: R,
938
1005
  insetY: V,
939
- border: E,
940
- borderX: H,
1006
+ border: O,
1007
+ borderX: R,
941
1008
  borderY: V,
942
- borderTop: G,
943
- borderRight: K,
944
- borderBottom: q,
945
- borderLeft: J,
946
- borderRadius: E,
947
- borderRadiusX: H,
1009
+ borderTop: q,
1010
+ borderRight: J,
1011
+ borderBottom: Q,
1012
+ borderLeft: ee,
1013
+ borderRadius: O,
1014
+ borderRadiusX: R,
948
1015
  borderRadiusY: V,
949
- borderRadiusTop: G,
950
- borderRadiusRight: K,
951
- borderRadiusBottom: q,
952
- borderRadiusLeft: J,
953
- borderRadiusTopLeft: ft,
954
- borderRadiusTopRight: vt,
955
- borderRadiusBottomRight: wt,
956
- borderRadiusBottomLeft: jt,
957
- divideXWidth: H,
1016
+ borderRadiusTop: q,
1017
+ borderRadiusRight: J,
1018
+ borderRadiusBottom: Q,
1019
+ borderRadiusLeft: ee,
1020
+ borderRadiusTopLeft: wt,
1021
+ borderRadiusTopRight: Ct,
1022
+ borderRadiusBottomRight: kt,
1023
+ borderRadiusBottomLeft: Nt,
1024
+ divideXWidth: R,
958
1025
  divideYWidth: V,
959
- scale: E,
960
- scaleX: H,
1026
+ scale: O,
1027
+ scaleX: R,
961
1028
  scaleY: V,
962
- skewX: H,
1029
+ skewX: R,
963
1030
  skewY: V,
964
- translateX: H,
1031
+ translateX: R,
965
1032
  translateY: V,
966
1033
  // padding
967
- padding: E,
968
- paddingX: H,
1034
+ padding: O,
1035
+ paddingX: R,
969
1036
  paddingY: V,
970
- paddingTop: G,
971
- paddingRight: K,
972
- paddingBottom: q,
973
- paddingLeft: J,
1037
+ paddingTop: q,
1038
+ paddingRight: J,
1039
+ paddingBottom: Q,
1040
+ paddingLeft: ee,
974
1041
  // margin
975
- margin: E,
976
- marginX: H,
1042
+ margin: O,
1043
+ marginX: R,
977
1044
  marginY: V,
978
- marginTop: G,
979
- marginRight: K,
980
- marginBottom: q,
981
- marginLeft: J,
1045
+ marginTop: q,
1046
+ marginRight: J,
1047
+ marginBottom: Q,
1048
+ marginLeft: ee,
982
1049
  // text-align
983
- textLeft: Ct,
984
- textCenter: kt,
985
- textRight: Nt,
986
- textJustify: St,
1050
+ textLeft: St,
1051
+ textCenter: Tt,
1052
+ textRight: Rt,
1053
+ textJustify: Vt,
987
1054
  // font style
988
- italic: Tt,
1055
+ italic: Ht,
989
1056
  // "not-italic": "",
990
1057
  // decoration
991
- underline: Rt,
992
- overline: Ht,
1058
+ underline: Bt,
1059
+ overline: At,
993
1060
  // transform
994
- uppercase: Vt,
1061
+ uppercase: Dt,
995
1062
  block: () => /* @__PURE__ */ e.jsxs("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [
996
1063
  /* @__PURE__ */ e.jsx(
997
1064
  "path",
@@ -1032,7 +1099,7 @@ const D = ["px", "%", "em", "rem", "ch", "vh", "vw"], wr = {
1032
1099
  }
1033
1100
  )
1034
1101
  ] }),
1035
- "float-none": Fe,
1102
+ "float-none": Ye,
1036
1103
  // position
1037
1104
  fixed: () => /* @__PURE__ */ e.jsxs("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [
1038
1105
  /* @__PURE__ */ e.jsx(
@@ -1104,96 +1171,96 @@ const D = ["px", "%", "em", "rem", "ch", "vh", "vw"], wr = {
1104
1171
  }
1105
1172
  )
1106
1173
  ] }),
1107
- static: Bt
1108
- }, re = Pe({ canReset: !1, canChange: !0 }), kr = ({ children: r, canReset: o = !1, canChange: t = !0 }) => (
1174
+ static: $t
1175
+ }, se = Oe({ canReset: !1, canChange: !0 }), Zr = ({ children: t, canReset: s = !1, canChange: r = !0 }) => (
1109
1176
  // eslint-disable-next-line react/jsx-no-constructed-context-values
1110
- /* @__PURE__ */ e.jsx(re.Provider, { value: { canReset: o, canChange: t }, children: r })
1111
- ), lt = ({ label: r, property: o, onChange: t }) => {
1112
- const a = R(() => u(pe, `${o}.classes`, [""]), [o]), l = le(o), s = R(() => u(l, "cls", ""), [l]), { canChange: d } = ee(re), i = /\[.*\]/g.test(s);
1113
- return /* @__PURE__ */ e.jsx("div", { className: r ? "w-full rounded " : "grow", children: i ? /* @__PURE__ */ e.jsxs("div", { className: "flex items-center", children: [
1114
- /* @__PURE__ */ e.jsx(ar, { className: "w-[70%] rounded py-1", readOnly: !0, value: s }),
1115
- /* @__PURE__ */ e.jsxs(Y, { delayDuration: 100, children: [
1116
- /* @__PURE__ */ e.jsx(X, { asChild: !0, children: /* @__PURE__ */ e.jsx("button", { type: "button", className: "invisible ml-3 mt-1 text-blue-600 group-hover:visible", children: /* @__PURE__ */ e.jsx(we, {}) }) }),
1117
- /* @__PURE__ */ e.jsx(W, { children: "Current value is using a Tailwind arbitrary value." })
1177
+ /* @__PURE__ */ e.jsx(se.Provider, { value: { canReset: s, canChange: r }, children: t })
1178
+ ), lt = ({ label: t, property: s, onChange: r }) => {
1179
+ const l = N(() => p(xe, `${s}.classes`, [""]), [s]), o = le(s), a = N(() => p(o, "cls", ""), [o]), { canChange: d } = re(se), i = /\[.*\]/g.test(a);
1180
+ return /* @__PURE__ */ e.jsx("div", { className: t ? "w-full rounded " : "grow", children: i ? /* @__PURE__ */ e.jsxs("div", { className: "flex items-center", children: [
1181
+ /* @__PURE__ */ e.jsx(br, { className: "w-[70%] rounded py-1", readOnly: !0, value: a }),
1182
+ /* @__PURE__ */ e.jsxs(X, { delayDuration: 100, children: [
1183
+ /* @__PURE__ */ e.jsx(W, { 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(ke, {}) }) }),
1184
+ /* @__PURE__ */ e.jsx(Z, { children: "Current value is using a Tailwind arbitrary value." })
1118
1185
  ] })
1119
1186
  ] }) : /* @__PURE__ */ e.jsx(
1120
- ye,
1187
+ ve,
1121
1188
  {
1122
- rounded: r,
1123
- onChange: (n) => t(n, o),
1124
- selected: s,
1125
- options: a,
1189
+ rounded: t,
1190
+ onChange: (n) => r(n, s),
1191
+ selected: a,
1192
+ options: l,
1126
1193
  disabled: !d
1127
1194
  }
1128
1195
  ) });
1129
1196
  };
1130
- function ye({ selected: r, onChange: o, rounded: t = !1, options: a, disabled: l = !1 }) {
1131
- const s = r.replace(/.*:/g, "").trim(), { undo: d, redo: i } = Ze();
1197
+ function ve({ selected: t, onChange: s, rounded: r = !1, options: l, disabled: o = !1 }) {
1198
+ const a = t.replace(/.*:/g, "").trim(), { undo: d, redo: i } = ze();
1132
1199
  return /* @__PURE__ */ e.jsxs(
1133
1200
  "select",
1134
1201
  {
1135
- disabled: !a.length || l,
1136
- className: `${t ? "rounded-md border border-border" : "border-0"} w-full disable:bg-gray-500 h-full truncate rounded bg-background px-2 py-1 text-xs outline-none disabled:cursor-not-allowed`,
1137
- onChange: (n) => o(n.target.value),
1202
+ disabled: !l.length || o,
1203
+ className: `${r ? "rounded-md border border-border" : "border-0"} w-full disable:bg-gray-500 h-full truncate rounded bg-background px-2 py-1 text-xs outline-none disabled:cursor-not-allowed`,
1204
+ onChange: (n) => s(n.target.value),
1138
1205
  onKeyDown: (n) => {
1139
1206
  n.ctrlKey && (n.key === "z" && d(), n.key === "y" && i());
1140
1207
  },
1141
- value: s,
1208
+ value: a,
1142
1209
  children: [
1143
1210
  /* @__PURE__ */ e.jsx("option", { className: "bg-transparent", value: "" }),
1144
- P.Children.toArray(
1145
- a.map((n) => /* @__PURE__ */ e.jsx("option", { className: "bg-transparent", value: n, children: n }))
1211
+ $.Children.toArray(
1212
+ l.map((n) => /* @__PURE__ */ e.jsx("option", { className: "bg-transparent", value: n, children: n }))
1146
1213
  )
1147
1214
  ]
1148
1215
  }
1149
1216
  );
1150
1217
  }
1151
- const Nr = ({ property: r, onChange: o }) => {
1152
- const { canReset: t, canChange: a } = ee(re), l = le(r), s = R(() => u(l, "cls", ""), [l]), d = R(() => u(pe, `${r}.classes`, [""]), [r]), i = d.indexOf(s) > -1 ? d.indexOf(s) : 0, n = /\[.*\]/g.test(s);
1153
- return /* @__PURE__ */ e.jsx("div", { className: "flex flex-row divide-x divide-solid divide-border rounded border border-border text-xs", children: n ? /* @__PURE__ */ e.jsx("div", { className: "py-[5px] px-2", children: s }) : /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
1218
+ const zr = ({ property: t, onChange: s }) => {
1219
+ const { canReset: r, canChange: l } = re(se), o = le(t), a = N(() => p(o, "cls", ""), [o]), d = N(() => p(xe, `${t}.classes`, [""]), [t]), i = d.indexOf(a) > -1 ? d.indexOf(a) : 0, n = /\[.*\]/g.test(a);
1220
+ 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: a }) : /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
1154
1221
  /* @__PURE__ */ e.jsx(
1155
1222
  "button",
1156
1223
  {
1157
1224
  type: "button",
1158
1225
  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",
1159
- disabled: !a && (!t || i - 1 < 0),
1160
- onClick: () => o(Se(d, i - 1), r),
1161
- children: /* @__PURE__ */ e.jsx("span", { className: "flex items-center justify-center", children: /* @__PURE__ */ e.jsx(At, { className: !a && (!t || i - 1 < 0) ? "text-gray-500" : "text-white/60" }) })
1226
+ disabled: !l && (!r || i - 1 < 0),
1227
+ onClick: () => s(Re(d, i - 1), t),
1228
+ children: /* @__PURE__ */ e.jsx("span", { className: "flex items-center justify-center", children: /* @__PURE__ */ e.jsx(Pt, { className: !l && (!r || i - 1 < 0) ? "text-gray-500" : "text-white/60" }) })
1162
1229
  }
1163
1230
  ),
1164
- /* @__PURE__ */ e.jsx("div", { className: "w-8/12 text-center", children: /* @__PURE__ */ e.jsx(lt, { label: !1, property: r, onChange: o }) }),
1231
+ /* @__PURE__ */ e.jsx("div", { className: "w-8/12 text-center", children: /* @__PURE__ */ e.jsx(lt, { label: !1, property: t, onChange: s }) }),
1165
1232
  /* @__PURE__ */ e.jsx(
1166
1233
  "button",
1167
1234
  {
1168
1235
  type: "button",
1169
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",
1170
- disabled: !a && (!t || i + 1 >= d.length),
1171
- onClick: () => o(Se(d, i + 1), r),
1237
+ disabled: !l && (!r || i + 1 >= d.length),
1238
+ onClick: () => s(Re(d, i + 1), t),
1172
1239
  children: /* @__PURE__ */ e.jsx("span", { className: "flex items-center justify-center", children: /* @__PURE__ */ e.jsx(
1173
- ve,
1240
+ Ce,
1174
1241
  {
1175
- className: !a && (!t || i + 1 >= d.length) ? "text-gray-500" : "text-white/60"
1242
+ className: !l && (!r || i + 1 >= d.length) ? "text-gray-500" : "text-white/60"
1176
1243
  }
1177
1244
  ) })
1178
1245
  }
1179
1246
  )
1180
1247
  ] }) });
1181
- }, Sr = ({ property: r, onChange: o }) => {
1182
- const t = R(() => u(pe, `${r}.classes`, [""]), [r]), { canChange: a } = ee(re), l = le(r), s = R(() => u(l, "cls", ""), [l]);
1183
- return /* @__PURE__ */ e.jsx("div", { className: "flex grow flex-wrap gap-1", children: N(t, (d) => /* @__PURE__ */ e.jsxs(Y, { children: [
1184
- /* @__PURE__ */ e.jsx(X, { asChild: !0, children: /* @__PURE__ */ e.jsx(
1248
+ }, Ur = ({ property: t, onChange: s }) => {
1249
+ const r = N(() => p(xe, `${t}.classes`, [""]), [t]), { canChange: l } = re(se), o = le(t), a = N(() => p(o, "cls", ""), [o]);
1250
+ return /* @__PURE__ */ e.jsx("div", { className: "flex grow flex-wrap gap-1", children: C(r, (d) => /* @__PURE__ */ e.jsxs(X, { children: [
1251
+ /* @__PURE__ */ e.jsx(W, { asChild: !0, children: /* @__PURE__ */ e.jsx(
1185
1252
  "button",
1186
1253
  {
1187
1254
  type: "button",
1188
- disabled: !a,
1189
- onClick: () => o(d, r),
1190
- className: `cursor-pointer rounded border border-gray-600 p-1 disabled:cursor-not-allowed ${s === d ? " bg-blue-500 text-white" : "disabled:bg-gray-600 disabled:text-gray-400"}`,
1191
- children: P.createElement(u(rt, d, Ye))
1255
+ disabled: !l,
1256
+ onClick: () => s(d, t),
1257
+ className: `cursor-pointer rounded border border-gray-600 p-1 disabled:cursor-not-allowed ${a === d ? " bg-blue-500 text-white" : "disabled:bg-gray-600 disabled:text-gray-400"}`,
1258
+ children: $.createElement(p(st, d, Xe))
1192
1259
  }
1193
1260
  ) }),
1194
- /* @__PURE__ */ e.jsx(W, { children: Q(ne(d)) })
1261
+ /* @__PURE__ */ e.jsx(Z, { children: Y(te(d)) })
1195
1262
  ] })) });
1196
- }, Tr = {
1263
+ }, Gr = {
1197
1264
  backgroundColor: "bg",
1198
1265
  textColor: "text",
1199
1266
  borderColor: "border",
@@ -1205,39 +1272,39 @@ const Nr = ({ property: r, onChange: o }) => {
1205
1272
  toColor: "to",
1206
1273
  ringColor: "ring",
1207
1274
  ringOffsetColor: "ring-offset"
1208
- }, Rr = ({ property: r, onChange: o }) => {
1209
- const t = le(r), a = R(() => u(t, "cls", ""), [t]), { canChange: l } = ee(re), [s, d] = k([]), [i, n] = k({ color: "", shade: "" }), p = a.split("-"), c = u(p, "1", ""), h = u(p, "2", ""), g = L(
1275
+ }, Kr = ({ property: t, onChange: s }) => {
1276
+ const r = le(t), l = N(() => p(r, "cls", ""), [r]), { canChange: o } = re(se), [a, d] = w([]), [i, n] = w({ color: "", shade: "" }), u = l.split("-"), x = p(u, "1", ""), c = p(u, "2", ""), m = A(
1210
1277
  // eslint-disable-next-line no-shadow
1211
- (x) => {
1212
- ["current", "inherit", "transparent", "black", "white"].includes(x) ? (d([]), n({ color: x })) : (d(["50", "100", "200", "300", "400", "500", "600", "700", "800", "900"]), n((f) => ({ ...f, color: x, shade: f.shade ? f.shade : "500" })));
1278
+ (g) => {
1279
+ ["current", "inherit", "transparent", "black", "white"].includes(g) ? (d([]), n({ color: g })) : (d(["50", "100", "200", "300", "400", "500", "600", "700", "800", "900"]), n((f) => ({ ...f, color: g, shade: f.shade ? f.shade : "500" })));
1213
1280
  },
1214
1281
  [d, n]
1215
1282
  );
1216
- M(() => {
1217
- if (["current", "inherit", "transparent", "black", "white"].includes(c))
1283
+ E(() => {
1284
+ if (["current", "inherit", "transparent", "black", "white"].includes(x))
1218
1285
  return d([]);
1219
1286
  d(["50", "100", "200", "300", "400", "500", "600", "700", "800", "900"]);
1220
- }, [c]);
1221
- const y = L(
1287
+ }, [x]);
1288
+ const h = A(
1222
1289
  // eslint-disable-next-line no-shadow
1223
- (x) => {
1224
- n({ color: c, shade: x });
1290
+ (g) => {
1291
+ n({ color: x, shade: g });
1225
1292
  },
1226
- [c]
1293
+ [x]
1227
1294
  );
1228
- return M(() => {
1295
+ return E(() => {
1229
1296
  n({ color: "", shade: "" });
1230
- }, [t]), M(() => {
1231
- const f = `${u(Tr, r, "")}-${i.color}${i.shade ? `-${i.shade}` : ""}`;
1232
- f.match(new RegExp(u(pe, `${r}.regExp`, ""))) && o(f, r);
1233
- }, [i, o, r]), /* @__PURE__ */ e.jsxs("div", { className: "flex flex-row divide-x divide-solid divide-border rounded-lg border border-border text-xs", children: [
1297
+ }, [r]), E(() => {
1298
+ const f = `${p(Gr, t, "")}-${i.color}${i.shade ? `-${i.shade}` : ""}`;
1299
+ f.match(new RegExp(p(xe, `${t}.regExp`, ""))) && s(f, t);
1300
+ }, [i, s, t]), /* @__PURE__ */ e.jsxs("div", { className: "flex flex-row divide-x divide-solid divide-border rounded-lg border border-border text-xs", children: [
1234
1301
  /* @__PURE__ */ e.jsx("div", { className: "grow text-center", children: /* @__PURE__ */ e.jsx(
1235
- ye,
1302
+ ve,
1236
1303
  {
1237
- disabled: !l,
1304
+ disabled: !o,
1238
1305
  rounded: !0,
1239
- selected: c,
1240
- onChange: g,
1306
+ selected: x,
1307
+ onChange: m,
1241
1308
  options: [
1242
1309
  "current",
1243
1310
  "transparent",
@@ -1270,355 +1337,355 @@ const Nr = ({ property: r, onChange: o }) => {
1270
1337
  ]
1271
1338
  }
1272
1339
  ) }),
1273
- /* @__PURE__ */ e.jsx("button", { type: "button", className: "grow text-center", children: /* @__PURE__ */ e.jsx(ye, { rounded: !0, selected: h, disabled: !c || !l, onChange: y, options: s }) })
1340
+ /* @__PURE__ */ e.jsx("button", { type: "button", className: "grow text-center", children: /* @__PURE__ */ e.jsx(ve, { rounded: !0, selected: c, disabled: !x || !o, onChange: h, options: a }) })
1274
1341
  ] });
1275
- }, $e = (r, o) => {
1276
- r = r.toLowerCase();
1277
- let t = r.trim().replace(/ |\+/g, "");
1278
- if ((t === "auto" || t === "none") && o.includes(t))
1279
- return { value: "", unit: t };
1280
- const a = o.length ? new RegExp(o.join("|"), "g") : /XXXXXX/g;
1281
- t = t.replace(a, "");
1282
- const l = r.match(a), s = l && l.length > 1, d = !b(t) && Number.isNaN(Number(t));
1283
- return s || d ? { error: "Invalid value" } : l && (l[0] === "auto" || l[0] === "none") ? { value: l[0], unit: "" } : { value: t, unit: l ? l[0] : "" };
1284
- }, Hr = (r) => {
1285
- const o = r.startsWith("-") ? "-" : "", t = r.split("-").pop();
1286
- if (["auto", "none"].includes(t))
1287
- return { value: "", unit: t };
1288
- if (t === "px")
1342
+ }, Ie = (t, s) => {
1343
+ t = t.toLowerCase();
1344
+ let r = t.trim().replace(/ |\+/g, "");
1345
+ if ((r === "auto" || r === "none") && s.includes(r))
1346
+ return { value: "", unit: r };
1347
+ const l = s.length ? new RegExp(s.join("|"), "g") : /XXXXXX/g;
1348
+ r = r.replace(l, "");
1349
+ const o = t.match(l), a = o && o.length > 1, d = !b(r) && Number.isNaN(Number(r));
1350
+ return a || d ? { error: "Invalid value" } : o && (o[0] === "auto" || o[0] === "none") ? { value: o[0], unit: "" } : { value: r, unit: o ? o[0] : "" };
1351
+ }, qr = (t) => {
1352
+ const s = t.startsWith("-") ? "-" : "", r = t.split("-").pop();
1353
+ if (["auto", "none"].includes(r))
1354
+ return { value: "", unit: r };
1355
+ if (r === "px")
1289
1356
  return { value: "1", unit: "px" };
1290
- if (t === "screen")
1291
- return { value: "100", unit: r.indexOf("w-") !== -1 ? "vw" : "vh" };
1292
- if (t === "full")
1357
+ if (r === "screen")
1358
+ return { value: "100", unit: t.indexOf("w-") !== -1 ? "vw" : "vh" };
1359
+ if (r === "full")
1293
1360
  return { value: "100", unit: "%" };
1294
- if (O(r, "skew-"))
1295
- return { value: `${o}${t}`, unit: "deg" };
1296
- if (O(r, "rotate-"))
1297
- return { value: `${o}${t}`, unit: "deg" };
1298
- if (O(r, "opacity-"))
1299
- return { value: `${t / 100}`, unit: "-" };
1300
- if (O(r, "duration-") || O(r, "delay-"))
1301
- return { value: `${t}`, unit: "ms" };
1302
- if (O(r, "translate-") && !t.includes("/"))
1303
- return { value: `${o}${`${t / 4}`}`, unit: "rem" };
1304
- if (O(r, "scale-"))
1305
- return { value: `${o}${`${t / 100}`}`, unit: "-" };
1306
- if (Z(r, "border")) {
1307
- const a = r.match(/border-?(x|y|t|r|b|l)?\d+/g);
1308
- if (a)
1309
- return { value: a[0].split("-").pop(), unit: "px" };
1310
- if (r.match(/border-?(x|y|t|r|b|l)?/g))
1361
+ if (M(t, "skew-"))
1362
+ return { value: `${s}${r}`, unit: "deg" };
1363
+ if (M(t, "rotate-"))
1364
+ return { value: `${s}${r}`, unit: "deg" };
1365
+ if (M(t, "opacity-"))
1366
+ return { value: `${r / 100}`, unit: "-" };
1367
+ if (M(t, "duration-") || M(t, "delay-"))
1368
+ return { value: `${r}`, unit: "ms" };
1369
+ if (M(t, "translate-") && !r.includes("/"))
1370
+ return { value: `${s}${`${r / 4}`}`, unit: "rem" };
1371
+ if (M(t, "scale-"))
1372
+ return { value: `${s}${`${r / 100}`}`, unit: "-" };
1373
+ if (z(t, "border")) {
1374
+ const l = t.match(/border-?(x|y|t|r|b|l)?\d+/g);
1375
+ if (l)
1376
+ return { value: l[0].split("-").pop(), unit: "px" };
1377
+ if (t.match(/border-?(x|y|t|r|b|l)?/g))
1311
1378
  return { value: "1", unit: "px" };
1312
1379
  }
1313
- if (Z(r, "max-w-")) {
1314
- if (r === "max-w-screen-sm")
1380
+ if (z(t, "max-w-")) {
1381
+ if (t === "max-w-screen-sm")
1315
1382
  return { value: "640", unit: "px" };
1316
- if (r === "max-w-screen-md")
1383
+ if (t === "max-w-screen-md")
1317
1384
  return { value: "768", unit: "px" };
1318
- if (r === "max-w-screen-lg")
1385
+ if (t === "max-w-screen-lg")
1319
1386
  return { value: "1024", unit: "px" };
1320
- if (r === "max-w-screen-xl")
1387
+ if (t === "max-w-screen-xl")
1321
1388
  return { value: "1280", unit: "px" };
1322
- if (r === "max-w-screen-2xl")
1389
+ if (t === "max-w-screen-2xl")
1323
1390
  return { value: "1536", unit: "px" };
1324
- if (t === "xs")
1391
+ if (r === "xs")
1325
1392
  return { value: "320", unit: "px" };
1326
- if (t === "sm")
1393
+ if (r === "sm")
1327
1394
  return { value: "384", unit: "px" };
1328
- if (t === "md")
1395
+ if (r === "md")
1329
1396
  return { value: "448", unit: "px" };
1330
- if (t === "lg")
1397
+ if (r === "lg")
1331
1398
  return { value: "512", unit: "px" };
1332
- if (t === "xl")
1399
+ if (r === "xl")
1333
1400
  return { value: "576", unit: "px" };
1334
- if (t === "2xl")
1401
+ if (r === "2xl")
1335
1402
  return { value: "672", unit: "px" };
1336
- if (t === "3xl")
1403
+ if (r === "3xl")
1337
1404
  return { value: "768", unit: "px" };
1338
- if (t === "4xl")
1405
+ if (r === "4xl")
1339
1406
  return { value: "896", unit: "px" };
1340
- if (t === "5xl")
1407
+ if (r === "5xl")
1341
1408
  return { value: "1024", unit: "px" };
1342
- if (t === "6xl")
1409
+ if (r === "6xl")
1343
1410
  return { value: "1152", unit: "px" };
1344
- if (t === "7xl")
1411
+ if (r === "7xl")
1345
1412
  return { value: "1280", unit: "px" };
1346
- if (t === "prose")
1413
+ if (r === "prose")
1347
1414
  return { value: "65", unit: "ch" };
1348
1415
  }
1349
- if (Z(r, "text-")) {
1350
- if (t === "xs")
1416
+ if (z(t, "text-")) {
1417
+ if (r === "xs")
1351
1418
  return { value: "12", unit: "px" };
1352
- if (t === "sm")
1419
+ if (r === "sm")
1353
1420
  return { value: "14", unit: "px" };
1354
- if (t === "base")
1421
+ if (r === "base")
1355
1422
  return { value: "16", unit: "px" };
1356
- if (t === "lg")
1423
+ if (r === "lg")
1357
1424
  return { value: "18", unit: "px" };
1358
- if (t === "xl")
1425
+ if (r === "xl")
1359
1426
  return { value: "20", unit: "px" };
1360
- if (t === "2xl")
1427
+ if (r === "2xl")
1361
1428
  return { value: "24", unit: "px" };
1362
- if (t === "3xl")
1429
+ if (r === "3xl")
1363
1430
  return { value: "30", unit: "px" };
1364
- if (t === "4xl")
1431
+ if (r === "4xl")
1365
1432
  return { value: "36", unit: "px" };
1366
- if (t === "5xl")
1433
+ if (r === "5xl")
1367
1434
  return { value: "48", unit: "px" };
1368
- if (t === "6xl")
1435
+ if (r === "6xl")
1369
1436
  return { value: "60", unit: "px" };
1370
- if (t === "7xl")
1437
+ if (r === "7xl")
1371
1438
  return { value: "72", unit: "px" };
1372
- if (t === "8xl")
1439
+ if (r === "8xl")
1373
1440
  return { value: "96", unit: "px" };
1374
- if (t === "9xl")
1441
+ if (r === "9xl")
1375
1442
  return { value: "128", unit: "px" };
1376
1443
  }
1377
- if (Z(r, "leading-")) {
1378
- if (t === "none")
1444
+ if (z(t, "leading-")) {
1445
+ if (r === "none")
1379
1446
  return { value: "1", unit: "-" };
1380
- if (t === "tight")
1447
+ if (r === "tight")
1381
1448
  return { value: "1.25", unit: "-" };
1382
- if (t === "snug")
1449
+ if (r === "snug")
1383
1450
  return { value: "1.375", unit: "-" };
1384
- if (t === "normal")
1451
+ if (r === "normal")
1385
1452
  return { value: "1.5", unit: "-" };
1386
- if (t === "relaxed")
1453
+ if (r === "relaxed")
1387
1454
  return { value: "1.625", unit: "-" };
1388
- if (t === "loose")
1455
+ if (r === "loose")
1389
1456
  return { value: "2", unit: "-" };
1390
1457
  }
1391
- if (Z(r, "tracking-")) {
1392
- if (t === "tighter")
1458
+ if (z(t, "tracking-")) {
1459
+ if (r === "tighter")
1393
1460
  return { value: "-0.05", unit: "em" };
1394
- if (t === "tight")
1461
+ if (r === "tight")
1395
1462
  return { value: "-0.025", unit: "em" };
1396
- if (t === "normal")
1463
+ if (r === "normal")
1397
1464
  return { value: "0", unit: "em" };
1398
- if (t === "wide")
1465
+ if (r === "wide")
1399
1466
  return { value: "0.025", unit: "em" };
1400
- if (t === "wider")
1467
+ if (r === "wider")
1401
1468
  return { value: "0.05", unit: "em" };
1402
- if (t === "widest")
1469
+ if (r === "widest")
1403
1470
  return { value: "0.1", unit: "em" };
1404
1471
  }
1405
- if (["max", "min", "fit"].includes(t))
1406
- return { value: r, unit: "class" };
1407
- if (t.includes("/")) {
1408
- const [a, l] = N(t.split("/"), (s) => parseInt(s, 10));
1409
- return { value: o + (a / l * 100).toFixed(2).replace(".00", ""), unit: "%" };
1472
+ if (["max", "min", "fit"].includes(r))
1473
+ return { value: t, unit: "class" };
1474
+ if (r.includes("/")) {
1475
+ const [l, o] = C(r.split("/"), (a) => parseInt(a, 10));
1476
+ return { value: s + (l / o * 100).toFixed(2).replace(".00", ""), unit: "%" };
1410
1477
  }
1411
- return xt(parseFloat(t)) ? { value: `${o + parseFloat(t) * 4}`, unit: "px" } : { value: t, unit: "class" };
1412
- }, Vr = (r) => {
1413
- if (b(r))
1478
+ return yt(parseFloat(r)) ? { value: `${s + parseFloat(r) * 4}`, unit: "px" } : { value: r, unit: "class" };
1479
+ }, Jr = (t) => {
1480
+ if (b(t))
1414
1481
  return { value: "", unit: "" };
1415
- const o = r.match(/\[.*\]/g);
1416
- if (o === null)
1417
- return Br(r);
1418
- const t = u(o, "0", "").replace(/\[|\]/g, ""), a = r.startsWith("-") ? "-" : "", l = fe(t.match(/\d+.\d+|\d+/g));
1419
- return { value: `${a}${l}`, unit: t.replace(l, "") };
1420
- }, Br = (r) => b(r) ? { value: "", unit: "" } : Hr(r), ot = P.createContext({
1482
+ const s = t.match(/\[.*\]/g);
1483
+ if (s === null)
1484
+ return Qr(t);
1485
+ const r = p(s, "0", "").replace(/\[|\]/g, ""), l = t.startsWith("-") ? "-" : "", o = we(r.match(/\d+.\d+|\d+/g));
1486
+ return { value: `${l}${o}`, unit: r.replace(o, "") };
1487
+ }, Qr = (t) => b(t) ? { value: "", unit: "" } : qr(t), ot = $.createContext({
1421
1488
  setDragData: () => {
1422
1489
  }
1423
- }), Ar = ({
1424
- unit: r,
1425
- currentValue: o,
1426
- onDrag: t,
1427
- onDragEnd: a,
1428
- onDragStart: l,
1429
- negative: s,
1490
+ }), es = ({
1491
+ unit: t,
1492
+ currentValue: s,
1493
+ onDrag: r,
1494
+ onDragEnd: l,
1495
+ onDragStart: o,
1496
+ negative: a,
1430
1497
  cssProperty: d
1431
1498
  }) => {
1432
- const { setDragData: i } = ee(ot);
1499
+ const { setDragData: i } = re(ot);
1433
1500
  return /* @__PURE__ */ e.jsx(
1434
1501
  "button",
1435
1502
  {
1436
1503
  type: "button",
1437
1504
  onMouseDown: (n) => {
1438
- const p = {
1439
- onDrag: t,
1440
- onDragEnd: a,
1505
+ const u = {
1506
+ onDrag: r,
1507
+ onDragEnd: l,
1441
1508
  dragging: !0,
1442
1509
  dragStartY: n.pageY,
1443
- dragStartValue: `${o}`,
1444
- dragUnit: r,
1445
- negative: s,
1510
+ dragStartValue: `${s}`,
1511
+ dragUnit: t,
1512
+ negative: a,
1446
1513
  cssProperty: d
1447
1514
  };
1448
- l(p), i(p);
1515
+ o(u), i(u);
1449
1516
  },
1450
1517
  color: void 0,
1451
1518
  className: "relative z-50 ml-1 hidden h-6 cursor-row-resize rounded bg-background/70 px-2 group-hover:inline",
1452
- children: /* @__PURE__ */ e.jsx($t, {})
1519
+ children: /* @__PURE__ */ e.jsx(Lt, {})
1453
1520
  }
1454
1521
  );
1455
- }, Dr = ({ onSelect: r, current: o, units: t }) => /* @__PURE__ */ e.jsx("div", { "data-theme": "light", className: "-m-[7px] -mx-[13px] flex w-9 flex-col", children: t.map((a) => /* @__PURE__ */ e.jsx(
1456
- et,
1522
+ }, ts = ({ onSelect: t, current: s, units: r }) => /* @__PURE__ */ e.jsx("div", { "data-theme": "light", className: "-m-[7px] -mx-[13px] flex w-9 flex-col", children: r.map((l) => /* @__PURE__ */ e.jsx(
1523
+ ue,
1457
1524
  {
1458
1525
  className: "h-max rounded-none px-1 py-1 text-right text-[11px] hover:bg-blue-400",
1459
- color: o === a ? "primary" : void 0,
1526
+ color: s === l ? "primary" : void 0,
1460
1527
  size: "sm",
1461
- onClick: (l) => {
1462
- l.stopPropagation(), r(a);
1528
+ onClick: (o) => {
1529
+ o.stopPropagation(), t(l);
1463
1530
  },
1464
- children: a
1531
+ children: l
1465
1532
  },
1466
- a
1467
- )) }), $r = (r) => {
1468
- const [o, t] = k(!1), [a, l] = k(""), { currentClass: s, onChange: d, classPrefix: i, cssProperty: n, units: p, negative: c } = r, [h, g] = k(n != null && n.toLowerCase().includes("width") ? "%" : p[0]), [y, x] = k(!1), [f, $] = k(""), [S, j] = k(!1), [I, B] = k(!1);
1469
- M(() => {
1470
- const { value: m, unit: w } = Vr(s);
1471
- if (w === "") {
1472
- l(m), g(n != null && n.toLowerCase().includes("width") ? "%" : p[0]);
1533
+ l
1534
+ )) }), rs = (t) => {
1535
+ const [s, r] = w(!1), [l, o] = w(""), { currentClass: a, onChange: d, classPrefix: i, cssProperty: n, units: u, negative: x } = t, [c, m] = w(n != null && n.toLowerCase().includes("width") ? "%" : u[0]), [h, g] = w(!1), [f, S] = w(""), [D, j] = w(!1), [L, P] = w(!1);
1536
+ E(() => {
1537
+ const { value: y, unit: v } = Jr(a);
1538
+ if (v === "") {
1539
+ o(y), m(n != null && n.toLowerCase().includes("width") ? "%" : u[0]);
1473
1540
  return;
1474
1541
  }
1475
- g(w), l(w === "class" || b(m) ? "" : m);
1476
- }, [s, n, p]);
1477
- const v = xe(
1478
- (m) => {
1479
- d(m);
1542
+ m(v), o(v === "class" || b(y) ? "" : y);
1543
+ }, [a, n, u]);
1544
+ const k = me(
1545
+ (y) => {
1546
+ d(y);
1480
1547
  },
1481
1548
  [d],
1482
1549
  200
1483
- ), C = xe(
1484
- (m) => {
1485
- d(m, !1);
1550
+ ), I = me(
1551
+ (y) => {
1552
+ d(y, !1);
1486
1553
  },
1487
1554
  [d],
1488
1555
  200
1489
- ), _ = L(
1490
- (m = !1) => {
1491
- const w = $e(`${a}`, p);
1492
- if (u(w, "error", !1)) {
1493
- x(!0);
1556
+ ), F = A(
1557
+ (y = !1) => {
1558
+ const v = Ie(`${l}`, u);
1559
+ if (p(v, "error", !1)) {
1560
+ g(!0);
1494
1561
  return;
1495
1562
  }
1496
- const T = u(w, "unit") !== "" ? u(w, "unit") : h;
1563
+ const T = p(v, "unit") !== "" ? p(v, "unit") : c;
1497
1564
  if (T === "auto" || T === "none") {
1498
- v(`${i}${T}`);
1565
+ k(`${i}${T}`);
1499
1566
  return;
1500
1567
  }
1501
- if (u(w, "value") === "")
1568
+ if (p(v, "value") === "")
1502
1569
  return;
1503
- const U = `${u(w, "value", "").startsWith("-") ? "-" : ""}${i}[${u(w, "value", "").replace("-", "")}${T === "-" ? "" : T}]`;
1504
- m ? C(U) : v(U);
1570
+ const K = `${p(v, "value", "").startsWith("-") ? "-" : ""}${i}[${p(v, "value", "").replace("-", "")}${T === "-" ? "" : T}]`;
1571
+ y ? I(K) : k(K);
1505
1572
  },
1506
- [v, C, a, h, i, p]
1507
- ), oe = L(
1508
- (m) => {
1509
- const w = $e(`${a}`, p);
1510
- if (u(w, "error", !1)) {
1511
- x(!0);
1573
+ [k, I, l, c, i, u]
1574
+ ), oe = A(
1575
+ (y) => {
1576
+ const v = Ie(`${l}`, u);
1577
+ if (p(v, "error", !1)) {
1578
+ g(!0);
1512
1579
  return;
1513
1580
  }
1514
- if (m === "auto" || m === "none") {
1515
- v(`${i}${m}`);
1581
+ if (y === "auto" || y === "none") {
1582
+ k(`${i}${y}`);
1516
1583
  return;
1517
1584
  }
1518
- if (u(w, "value") === "")
1585
+ if (p(v, "value") === "")
1519
1586
  return;
1520
- const T = u(w, "unit") !== "" ? u(w, "unit") : m, U = `${u(w, "value", "").startsWith("-") ? "-" : ""}${i}[${u(w, "value", "").replace("-", "")}${T === "-" ? "" : T}]`;
1521
- v(U);
1587
+ const T = p(v, "unit") !== "" ? p(v, "unit") : y, K = `${p(v, "value", "").startsWith("-") ? "-" : ""}${i}[${p(v, "value", "").replace("-", "")}${T === "-" ? "" : T}]`;
1588
+ k(K);
1522
1589
  },
1523
- [v, a, i, p]
1590
+ [k, l, i, u]
1524
1591
  );
1525
- return /* @__PURE__ */ e.jsx("div", { className: "flex w-full flex-col", children: /* @__PURE__ */ e.jsx("div", { className: "flex items-center justify-start", children: h === "class" ? /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
1526
- /* @__PURE__ */ e.jsx("input", { className: "w-20 rounded py-1", readOnly: !0, value: s }),
1527
- /* @__PURE__ */ e.jsxs(Y, { children: [
1528
- /* @__PURE__ */ e.jsx(X, { asChild: !0, children: /* @__PURE__ */ e.jsx("button", { type: "button", className: "invisible ml-3 mt-1 text-blue-600 group-hover:visible", children: /* @__PURE__ */ e.jsx(we, {}) }) }),
1529
- /* @__PURE__ */ e.jsx(W, { children: "Current value is using a Tailwind preset class." })
1592
+ return /* @__PURE__ */ e.jsx("div", { className: "flex w-full flex-col", children: /* @__PURE__ */ e.jsx("div", { className: "flex items-center justify-start", children: c === "class" ? /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
1593
+ /* @__PURE__ */ e.jsx("input", { className: "w-20 rounded py-1", readOnly: !0, value: a }),
1594
+ /* @__PURE__ */ e.jsxs(X, { children: [
1595
+ /* @__PURE__ */ e.jsx(W, { 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(ke, {}) }) }),
1596
+ /* @__PURE__ */ e.jsx(Z, { children: "Current value is using a Tailwind preset class." })
1530
1597
  ] })
1531
- ] }) : /* @__PURE__ */ e.jsxs("div", { className: `group relative flex items-center ${S ? "z-auto" : ""}`, children: [
1598
+ ] }) : /* @__PURE__ */ e.jsxs("div", { className: `group relative flex items-center ${D ? "z-auto" : ""}`, children: [
1532
1599
  /* @__PURE__ */ e.jsxs("div", { className: "flex items-center rounded-md border border-border", children: [
1533
- ["none", "auto"].indexOf(h) !== -1 ? null : /* @__PURE__ */ e.jsx(
1600
+ ["none", "auto"].indexOf(c) !== -1 ? null : /* @__PURE__ */ e.jsx(
1534
1601
  "input",
1535
1602
  {
1536
- readOnly: h === "class",
1537
- onKeyPress: (m) => {
1538
- m.key === "Enter" && _();
1603
+ readOnly: c === "class",
1604
+ onKeyPress: (y) => {
1605
+ y.key === "Enter" && F();
1539
1606
  },
1540
- onKeyDown: (m) => {
1541
- if (m.keyCode !== 38 && m.keyCode !== 40)
1607
+ onKeyDown: (y) => {
1608
+ if (y.keyCode !== 38 && y.keyCode !== 40)
1542
1609
  return;
1543
- m.preventDefault(), B(!0);
1544
- const w = ht(m.target.value);
1545
- let T = Me(w) ? 0 : w;
1546
- m.keyCode === 38 && (T += 1), m.keyCode === 40 && (T -= 1);
1547
- const F = `${T}`, nt = `${F.startsWith("-") ? "-" : ""}${i}[${F.replace("-", "")}${h === "-" ? "" : h}]`;
1548
- C(nt);
1610
+ y.preventDefault(), P(!0);
1611
+ const v = bt(y.target.value);
1612
+ let T = _e(v) ? 0 : v;
1613
+ y.keyCode === 38 && (T += 1), y.keyCode === 40 && (T -= 1);
1614
+ const _ = `${T}`, at = `${_.startsWith("-") ? "-" : ""}${i}[${_.replace("-", "")}${c === "-" ? "" : c}]`;
1615
+ I(at);
1549
1616
  },
1550
- onKeyUp: (m) => {
1551
- I && (m.preventDefault(), B(!1));
1617
+ onKeyUp: (y) => {
1618
+ L && (y.preventDefault(), P(!1));
1552
1619
  },
1553
- onBlur: () => _(),
1554
- onChange: (m) => {
1555
- x(!1), l(m.target.value);
1620
+ onBlur: () => F(),
1621
+ onChange: (y) => {
1622
+ g(!1), o(y.target.value);
1556
1623
  },
1557
- onClick: (m) => {
1558
- var w;
1559
- (w = m == null ? void 0 : m.target) == null || w.select(), t(!1);
1624
+ onClick: (y) => {
1625
+ var v;
1626
+ (v = y == null ? void 0 : y.target) == null || v.select(), r(!1);
1560
1627
  },
1561
- value: S ? f : a,
1628
+ value: D ? f : l,
1562
1629
  className: "h-6 w-14 rounded rounded-r-none bg-background pl-2 text-sm focus-visible:outline-0 ".concat(
1563
1630
  " ",
1564
- y ? "border-red-500 text-red-500" : "border-foreground/20"
1631
+ h ? "border-red-500 text-red-500" : "border-foreground/20"
1565
1632
  )
1566
1633
  }
1567
1634
  ),
1568
- /* @__PURE__ */ e.jsxs(Y, { open: o, delayDuration: 100, children: [
1569
- /* @__PURE__ */ e.jsx(X, { asChild: !0, children: /* @__PURE__ */ e.jsxs(
1635
+ /* @__PURE__ */ e.jsxs(X, { open: s, delayDuration: 100, children: [
1636
+ /* @__PURE__ */ e.jsx(W, { asChild: !0, children: /* @__PURE__ */ e.jsxs(
1570
1637
  "button",
1571
1638
  {
1572
1639
  type: "button",
1573
- onClick: () => t(!o),
1640
+ onClick: () => r(!s),
1574
1641
  className: "flex h-6 cursor-pointer items-center gap-x-1 rounded rounded-l-none bg-background p-px px-1 text-[11px] uppercase",
1575
1642
  children: [
1576
- /* @__PURE__ */ e.jsx("span", { className: `inline-block ${p.length === 1 ? "px-2 font-semibold" : ""}`, children: h }),
1577
- p.length > 1 ? /* @__PURE__ */ e.jsx(Dt, {}) : null
1643
+ /* @__PURE__ */ e.jsx("span", { className: `inline-block ${u.length === 1 ? "px-2 font-semibold" : ""}`, children: c }),
1644
+ u.length > 1 ? /* @__PURE__ */ e.jsx(It, {}) : null
1578
1645
  ]
1579
1646
  }
1580
1647
  ) }),
1581
- /* @__PURE__ */ e.jsx(qt, { children: /* @__PURE__ */ e.jsx(W, { className: "bg-background", children: /* @__PURE__ */ e.jsx(
1582
- Dr,
1648
+ /* @__PURE__ */ e.jsx(tr, { children: /* @__PURE__ */ e.jsx(Z, { className: "bg-background", children: /* @__PURE__ */ e.jsx(
1649
+ ts,
1583
1650
  {
1584
- units: p,
1585
- current: h,
1586
- onSelect: (m) => {
1587
- t(!1), g(m), oe(m);
1651
+ units: u,
1652
+ current: c,
1653
+ onSelect: (y) => {
1654
+ r(!1), m(y), oe(y);
1588
1655
  }
1589
1656
  }
1590
1657
  ) }) })
1591
1658
  ] })
1592
1659
  ] }),
1593
- ["none", "auto"].indexOf(h) !== -1 || S ? null : /* @__PURE__ */ e.jsx(
1594
- Ar,
1660
+ ["none", "auto"].indexOf(c) !== -1 || D ? null : /* @__PURE__ */ e.jsx(
1661
+ es,
1595
1662
  {
1596
1663
  onDragStart: () => j(!0),
1597
- onDragEnd: (m) => {
1598
- if ($(() => ""), j(!1), b(m))
1664
+ onDragEnd: (y) => {
1665
+ if (S(() => ""), j(!1), b(y))
1599
1666
  return;
1600
- const w = `${m}`, F = `${w.startsWith("-") ? "-" : ""}${i}[${w.replace("-", "")}${h === "-" ? "" : h}]`;
1601
- v(F);
1667
+ const v = `${y}`, _ = `${v.startsWith("-") ? "-" : ""}${i}[${v.replace("-", "")}${c === "-" ? "" : c}]`;
1668
+ k(_);
1602
1669
  },
1603
- onDrag: (m) => {
1604
- if (b(m))
1670
+ onDrag: (y) => {
1671
+ if (b(y))
1605
1672
  return;
1606
- $(m);
1607
- const w = `${m}`, F = `${w.startsWith("-") ? "-" : ""}${i}[${w.replace("-", "")}${h === "-" ? "" : h}]`;
1608
- C(F);
1673
+ S(y);
1674
+ const v = `${y}`, _ = `${v.startsWith("-") ? "-" : ""}${i}[${v.replace("-", "")}${c === "-" ? "" : c}]`;
1675
+ I(_);
1609
1676
  },
1610
- currentValue: a,
1611
- unit: h,
1612
- negative: c,
1677
+ currentValue: l,
1678
+ unit: c,
1679
+ negative: x,
1613
1680
  cssProperty: n
1614
1681
  }
1615
1682
  )
1616
1683
  ] }) }) });
1617
- }, le = (r) => {
1618
- const o = ce();
1619
- return mt(o, { property: r });
1620
- }, Ir = (r, o) => {
1621
- const t = {
1684
+ }, le = (t) => {
1685
+ const s = pe();
1686
+ return ft(s, { property: t });
1687
+ }, ss = (t, s) => {
1688
+ const r = {
1622
1689
  xs: 0,
1623
1690
  sm: 1,
1624
1691
  md: 2,
@@ -1626,8 +1693,8 @@ const Nr = ({ property: r, onChange: o }) => {
1626
1693
  xl: 4,
1627
1694
  "2xl": 5
1628
1695
  };
1629
- return t[u(r, "mq", "xs")] <= t[o];
1630
- }, Pr = {
1696
+ return r[p(t, "mq", "xs")] <= r[s];
1697
+ }, ls = {
1631
1698
  width: "w-",
1632
1699
  height: "h-",
1633
1700
  minWidth: "min-w-",
@@ -1693,31 +1760,31 @@ const Nr = ({ property: r, onChange: o }) => {
1693
1760
  insetY: "inset-y-",
1694
1761
  opacity: "opacity-",
1695
1762
  flexBasis: "basis-"
1696
- }, Ie = {
1763
+ }, Le = {
1697
1764
  xs: "",
1698
1765
  sm: "640px",
1699
1766
  md: "768px",
1700
1767
  lg: "1024px",
1701
1768
  xl: "1280px",
1702
1769
  "2xl": "1536px"
1703
- }, Lr = (r) => `${r.toUpperCase()} ${Ie[r] ? `(${Ie[r]} & up)` : ""}`, ke = (r) => {
1704
- const { type: o = "icons", label: t, property: a, onEmitChange: l = () => {
1705
- }, units: s, negative: d = !1 } = r, [i] = Ft(), [n] = qe(), [, p] = Ve(), c = le(a), h = Ue(), g = Ge(), [y] = Ke(), x = R(() => u(c, "fullCls", ""), [c]), f = L(
1706
- (v, C = !0) => {
1707
- const _ = { dark: i, mq: p, mod: n, cls: v, property: a, fullCls: "" };
1708
- (i || n !== "") && (_.mq = "xs");
1709
- const oe = sr(_);
1710
- h(y, [oe], C);
1770
+ }, os = (t) => `${t.toUpperCase()} ${Le[t] ? `(${Le[t]} & up)` : ""}`, Te = (t) => {
1771
+ const { type: s = "icons", label: r, property: l, onEmitChange: o = () => {
1772
+ }, units: a, negative: d = !1 } = t, [i] = Zt(), [n] = Je(), [, u] = Ae(), x = le(l), c = Ge(), m = Ke(), [h] = qe(), g = N(() => p(x, "fullCls", ""), [x]), f = A(
1773
+ (k, I = !0) => {
1774
+ const F = { dark: i, mq: u, mod: n, cls: k, property: l, fullCls: "" };
1775
+ (i || n !== "") && (F.mq = "xs");
1776
+ const oe = Tr(F);
1777
+ c(h, [oe], I);
1711
1778
  },
1712
- [y, i, p, n, a, h]
1713
- ), $ = L(() => {
1714
- g(y, [x]);
1715
- }, [y, x, g]), S = R(() => Ir(c, p), [c, p]);
1716
- M(() => {
1717
- l(S, c);
1718
- }, [S, l, c]);
1719
- const [, , j] = Ve(), I = L(
1720
- (v) => {
1779
+ [h, i, u, n, l, c]
1780
+ ), S = A(() => {
1781
+ m(h, [g]);
1782
+ }, [h, g, m]), D = N(() => ss(x, u), [x, u]);
1783
+ E(() => {
1784
+ o(D, x);
1785
+ }, [D, o, x]);
1786
+ const [, , j] = Ae(), L = A(
1787
+ (k) => {
1721
1788
  j({
1722
1789
  xs: 400,
1723
1790
  sm: 640,
@@ -1725,55 +1792,55 @@ const Nr = ({ property: r, onChange: o }) => {
1725
1792
  lg: 1024,
1726
1793
  xl: 1420,
1727
1794
  "2xl": 1920
1728
- }[v]);
1795
+ }[k]);
1729
1796
  },
1730
1797
  [j]
1731
- ), B = u(c, "dark", null) === i && u(c, "mod", null) === n && u(c, "mq", null) === p;
1732
- return /* @__PURE__ */ e.jsx(kr, { canChange: S, canReset: c && B, children: /* @__PURE__ */ e.jsxs("div", { className: "group flex flex-row items-center py-2 first:pt-0 last:pb-0", children: [
1733
- /* @__PURE__ */ e.jsx("div", { className: "relative w-[70px] truncate text-xs text-foreground", children: /* @__PURE__ */ e.jsx("span", { className: `text-[11px] ${c && !B ? "text-foreground" : ""}`, children: t }) }),
1798
+ ), P = p(x, "dark", null) === i && p(x, "mod", null) === n && p(x, "mq", null) === u;
1799
+ return /* @__PURE__ */ e.jsx(Zr, { canChange: D, canReset: x && P, children: /* @__PURE__ */ e.jsxs("div", { className: "group flex flex-row items-center py-2 first:pt-0 last:pb-0", children: [
1800
+ /* @__PURE__ */ e.jsx("div", { className: "relative w-[70px] truncate text-xs text-foreground", children: /* @__PURE__ */ e.jsx("span", { className: `text-[11px] ${x && !P ? "text-foreground" : ""}`, children: r }) }),
1734
1801
  /* @__PURE__ */ e.jsxs("div", { className: "flex flex-row items-center", children: [
1735
1802
  /* @__PURE__ */ e.jsxs("div", { className: "w-[150px]", children: [
1736
- o === "arbitrary" ? /* @__PURE__ */ e.jsx(
1737
- $r,
1803
+ s === "arbitrary" ? /* @__PURE__ */ e.jsx(
1804
+ rs,
1738
1805
  {
1739
- currentClass: u(c, "cls", ""),
1740
- classPrefix: u(Pr, a, ""),
1741
- units: s || [],
1806
+ currentClass: p(x, "cls", ""),
1807
+ classPrefix: p(ls, l, ""),
1808
+ units: a || [],
1742
1809
  onChange: f,
1743
1810
  negative: d,
1744
- cssProperty: a
1811
+ cssProperty: l
1745
1812
  }
1746
1813
  ) : null,
1747
- o === "icons" && /* @__PURE__ */ e.jsx(Sr, { property: a, onChange: f }),
1748
- o === "range" && /* @__PURE__ */ e.jsx(Nr, { property: a, onChange: f }),
1749
- o === "color" && /* @__PURE__ */ e.jsx(Rr, { property: a, onChange: f }),
1750
- o === "dropdown" && /* @__PURE__ */ e.jsx(lt, { label: t, property: a, onChange: f })
1814
+ s === "icons" && /* @__PURE__ */ e.jsx(Ur, { property: l, onChange: f }),
1815
+ s === "range" && /* @__PURE__ */ e.jsx(zr, { property: l, onChange: f }),
1816
+ s === "color" && /* @__PURE__ */ e.jsx(Kr, { property: l, onChange: f }),
1817
+ s === "dropdown" && /* @__PURE__ */ e.jsx(lt, { label: r, property: l, onChange: f })
1751
1818
  ] }),
1752
- /* @__PURE__ */ e.jsx("div", { className: `w-[30px] cursor-pointer ${x ? "visible" : "invisible"}`, children: B ? /* @__PURE__ */ e.jsx("button", { type: "button", onClick: () => $(), title: "Reset", className: "flex px-1.5 text-xs", children: /* @__PURE__ */ e.jsx(Xe, { className: "h-5 w-5 text-blue-500 hover:opacity-80" }) }) : S && c ? /* @__PURE__ */ e.jsxs(Y, { delayDuration: 100, children: [
1753
- /* @__PURE__ */ e.jsx(X, { asChild: !0, children: /* @__PURE__ */ e.jsx(
1819
+ /* @__PURE__ */ e.jsx("div", { className: `w-[30px] cursor-pointer ${g ? "visible" : "invisible"}`, children: P ? /* @__PURE__ */ e.jsx("button", { type: "button", onClick: () => S(), title: "Reset", className: "flex px-1.5 text-xs", children: /* @__PURE__ */ e.jsx(We, { className: "h-5 w-5 text-blue-500 hover:opacity-80" }) }) : D && x ? /* @__PURE__ */ e.jsxs(X, { delayDuration: 100, children: [
1820
+ /* @__PURE__ */ e.jsx(W, { asChild: !0, children: /* @__PURE__ */ e.jsx(
1754
1821
  "button",
1755
1822
  {
1756
1823
  type: "button",
1757
1824
  className: "invisible ml-3 mt-1 rounded-full bg-blue-500 text-white group-hover:visible",
1758
- children: /* @__PURE__ */ e.jsx(we, {})
1825
+ children: /* @__PURE__ */ e.jsx(ke, {})
1759
1826
  }
1760
1827
  ) }),
1761
- /* @__PURE__ */ e.jsx(W, { children: /* @__PURE__ */ e.jsx("div", { className: "text-right", children: /* @__PURE__ */ e.jsxs("div", { children: [
1828
+ /* @__PURE__ */ e.jsx(Z, { children: /* @__PURE__ */ e.jsx("div", { className: "text-right", children: /* @__PURE__ */ e.jsxs("div", { children: [
1762
1829
  "Current style is set at  ",
1763
1830
  /* @__PURE__ */ e.jsxs("span", { className: "font-bold ", children: [
1764
- Lr(u(c, "mq")),
1765
- i && !c.dark ? "(Light mode)" : ""
1831
+ os(p(x, "mq")),
1832
+ i && !x.dark ? "(Light mode)" : ""
1766
1833
  ] }),
1767
1834
  /* @__PURE__ */ e.jsx("br", {}),
1768
1835
  /* @__PURE__ */ e.jsxs(
1769
1836
  "button",
1770
1837
  {
1771
1838
  type: "button",
1772
- onClick: () => I(u(c, "mq")),
1839
+ onClick: () => L(p(x, "mq")),
1773
1840
  className: "block w-full cursor-default text-right font-semibold text-blue-500",
1774
1841
  children: [
1775
1842
  "Switch to ",
1776
- u(c, "mq").toUpperCase()
1843
+ p(x, "mq").toUpperCase()
1777
1844
  ]
1778
1845
  }
1779
1846
  )
@@ -1781,48 +1848,48 @@ const Nr = ({ property: r, onChange: o }) => {
1781
1848
  ] }) : null })
1782
1849
  ] })
1783
1850
  ] }) });
1784
- }, Or = ["px", "%", "em", "rem", "ch", "vh", "vw"], st = ({
1785
- label: r,
1786
- options: o,
1787
- borderB: t = !1,
1788
- borderT: a = !1,
1789
- type: l = "arbitrary",
1790
- units: s = Or,
1851
+ }, ns = ["px", "%", "em", "rem", "ch", "vh", "vw"], nt = ({
1852
+ label: t,
1853
+ options: s,
1854
+ borderB: r = !1,
1855
+ borderT: l = !1,
1856
+ type: o = "arbitrary",
1857
+ units: a = ns,
1791
1858
  negative: d = !1
1792
1859
  }) => {
1793
- const [i, n] = k(o[0].key), p = ce(), c = L((h) => N(p, "property").includes(h), [p]);
1860
+ const [i, n] = w(s[0].key), u = pe(), x = A((c) => C(u, "property").includes(c), [u]);
1794
1861
  return /* @__PURE__ */ e.jsxs(
1795
1862
  "div",
1796
1863
  {
1797
- className: `mb-2 border-gray-800 py-2 first:pt-0 last:pb-0 ${t ? "border-b" : ""} ${a ? "border-t" : ""}`,
1864
+ className: `mb-2 border-gray-800 py-2 first:pt-0 last:pb-0 ${r ? "border-b" : ""} ${l ? "border-t" : ""}`,
1798
1865
  children: [
1799
1866
  /* @__PURE__ */ e.jsxs("div", { className: "flex flex-row text-xs", children: [
1800
- r && /* @__PURE__ */ e.jsx("span", { className: "relative w-[70px] flex-none text-xs text-foreground", children: r }),
1801
- /* @__PURE__ */ e.jsx("div", { className: "mb-3 flex grow flex-row flex-wrap gap-x-px", children: P.Children.toArray(
1802
- o.map(({ label: h, key: g }) => /* @__PURE__ */ e.jsx("div", { className: "first:rounded-l last:rounded-r", children: /* @__PURE__ */ e.jsxs(Y, { children: [
1803
- /* @__PURE__ */ e.jsx(X, { asChild: !0, children: /* @__PURE__ */ e.jsxs(
1867
+ t && /* @__PURE__ */ e.jsx("span", { className: "relative w-[70px] flex-none text-xs text-foreground", children: t }),
1868
+ /* @__PURE__ */ e.jsx("div", { className: "mb-3 flex grow flex-row flex-wrap gap-x-px", children: $.Children.toArray(
1869
+ s.map(({ label: c, key: m }) => /* @__PURE__ */ e.jsx("div", { className: "first:rounded-l last:rounded-r", children: /* @__PURE__ */ e.jsxs(X, { children: [
1870
+ /* @__PURE__ */ e.jsx(W, { asChild: !0, children: /* @__PURE__ */ e.jsxs(
1804
1871
  "button",
1805
1872
  {
1806
1873
  type: "button",
1807
- onClick: () => n(g),
1808
- className: `relative cursor-pointer rounded-full p-1 text-[8px] ${g === i ? " bg-[#3E57F0] text-white" : "text-gray-600 dark:text-gray-300"}`,
1874
+ onClick: () => n(m),
1875
+ className: `relative cursor-pointer rounded-full p-1 text-[8px] ${m === i ? " bg-[#3E57F0] text-white" : "text-gray-600 dark:text-gray-300"}`,
1809
1876
  children: [
1810
- P.createElement("div", {
1811
- className: c(g) ? "-bottom-1.5 absolute bg-[#3E57F0] h-[2px] left-0 w-full" : ""
1877
+ $.createElement("div", {
1878
+ className: x(m) ? "-bottom-1.5 absolute bg-[#3E57F0] h-[2px] left-0 w-full" : ""
1812
1879
  }),
1813
- P.createElement(u(rt, g, Ye), { className: "text-inherit w-3 h-3" })
1880
+ $.createElement(p(st, m, Xe), { className: "text-inherit w-3 h-3" })
1814
1881
  ]
1815
1882
  }
1816
1883
  ) }),
1817
- /* @__PURE__ */ e.jsx(W, { children: Q(ne(h)) })
1884
+ /* @__PURE__ */ e.jsx(Z, { children: Y(te(c)) })
1818
1885
  ] }) }))
1819
1886
  ) })
1820
1887
  ] }),
1821
1888
  /* @__PURE__ */ e.jsx("div", { className: "mt-0 flex items-center", children: /* @__PURE__ */ e.jsx(
1822
- ke,
1889
+ Te,
1823
1890
  {
1824
- type: l,
1825
- units: [...s],
1891
+ type: o,
1892
+ units: [...a],
1826
1893
  label: "",
1827
1894
  property: i,
1828
1895
  negative: d
@@ -1831,74 +1898,74 @@ const Nr = ({ property: r, onChange: o }) => {
1831
1898
  ]
1832
1899
  }
1833
1900
  );
1834
- }, Mr = ({ heading: r, items: o }) => {
1835
- const t = ce(), a = R(() => {
1836
- const l = (i) => z(
1837
- i.map((n) => n.styleType === "multiple" ? N(n.options, "key") : n.property)
1838
- ), s = z(
1839
- o.map((i) => i.styleType === "accordion" ? l(i.items) : i.styleType === "multiple" ? N(i.options, "key") : i.property)
1840
- ), d = N(t, "property");
1841
- return _e(s, d).length > 0;
1842
- }, [t, o]);
1901
+ }, as = ({ heading: t, items: s }) => {
1902
+ const r = pe(), l = N(() => {
1903
+ const o = (i) => U(
1904
+ i.map((n) => n.styleType === "multiple" ? C(n.options, "key") : n.property)
1905
+ ), a = U(
1906
+ s.map((i) => i.styleType === "accordion" ? o(i.items) : i.styleType === "multiple" ? C(i.options, "key") : i.property)
1907
+ ), d = C(r, "property");
1908
+ return Ee(a, d).length > 0;
1909
+ }, [r, s]);
1843
1910
  return /* @__PURE__ */ e.jsxs("details", { children: [
1844
1911
  /* @__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: [
1845
- r,
1846
- a ? /* @__PURE__ */ e.jsx(
1912
+ t,
1913
+ l ? /* @__PURE__ */ e.jsx(
1847
1914
  "span",
1848
1915
  {
1849
- className: `ml-1 mr-2 inline-block h-[8px] w-[8px] rounded-full ${a ? "bg-blue-500" : "bg-gray-300"}`
1916
+ className: `ml-1 mr-2 inline-block h-[8px] w-[8px] rounded-full ${l ? "bg-blue-500" : "bg-gray-300"}`
1850
1917
  }
1851
1918
  ) : null
1852
1919
  ] }) }),
1853
- /* @__PURE__ */ e.jsx("div", { className: "p-2", children: o.map((l) => l.styleType === "multiple" ? /* @__PURE__ */ e.jsx(st, { ...l }, l.label) : /* @__PURE__ */ e.jsx(ke, { ...l }, l.label)) })
1920
+ /* @__PURE__ */ e.jsx("div", { className: "p-2", children: s.map((o) => o.styleType === "multiple" ? /* @__PURE__ */ e.jsx(nt, { ...o }, o.label) : /* @__PURE__ */ e.jsx(Te, { ...o }, o.label)) })
1854
1921
  ] });
1855
- }, _r = Pe({}), ge = ({ section: r }) => {
1856
- const o = ce(), t = L(
1857
- (s = []) => {
1922
+ }, is = Oe({}), he = ({ section: t }) => {
1923
+ const s = pe(), r = A(
1924
+ (a = []) => {
1858
1925
  const d = {};
1859
- for (let n = 0; n < o.length; n++)
1860
- d[o[n].property] = o[n].cls;
1926
+ for (let n = 0; n < s.length; n++)
1927
+ d[s[n].property] = s[n].cls;
1861
1928
  let i = !0;
1862
- for (const n in s)
1863
- if (!ue(d, n) || d[n] !== s[n]) {
1929
+ for (const n in a)
1930
+ if (!ge(d, n) || d[n] !== a[n]) {
1864
1931
  i = !1;
1865
1932
  break;
1866
1933
  }
1867
1934
  return i;
1868
1935
  },
1869
- [o]
1870
- ), a = R(() => {
1871
- if (o.length > 0 && r.heading === "Classes")
1936
+ [s]
1937
+ ), l = N(() => {
1938
+ if (s.length > 0 && t.heading === "Classes")
1872
1939
  return !0;
1873
- const s = (n) => z(
1874
- n.map((p) => p.styleType === "multiple" ? z(N(p.options, "key")) : p.property)
1875
- ), d = z(
1876
- r.items.map((n) => n.styleType === "accordion" ? s(n.items) : n.styleType === "multiple" ? z(N(n.options, "key")) : n.property)
1877
- ), i = N(o, "property");
1878
- return _e(d, i).length > 0;
1879
- }, [o, r.heading, r.items]), l = R(() => ({}), []);
1880
- return /* @__PURE__ */ e.jsx(_r.Provider, { value: l, children: /* @__PURE__ */ e.jsxs(ae, { value: r.heading, children: [
1881
- /* @__PURE__ */ e.jsx(ie, { className: "px-3 py-2 text-xs hover:no-underline", children: /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-x-2", children: [
1882
- /* @__PURE__ */ e.jsx("div", { className: `h-[8px] w-[8px] rounded-full ${a ? "bg-blue-500" : "bg-gray-300"}` }),
1883
- r.heading
1940
+ const a = (n) => U(
1941
+ n.map((u) => u.styleType === "multiple" ? U(C(u.options, "key")) : u.property)
1942
+ ), d = U(
1943
+ t.items.map((n) => n.styleType === "accordion" ? a(n.items) : n.styleType === "multiple" ? U(C(n.options, "key")) : n.property)
1944
+ ), i = C(s, "property");
1945
+ return Ee(d, i).length > 0;
1946
+ }, [s, t.heading, t.items]), o = N(() => ({}), []);
1947
+ return /* @__PURE__ */ e.jsx(is.Provider, { value: o, children: /* @__PURE__ */ e.jsxs(ie, { value: t.heading, children: [
1948
+ /* @__PURE__ */ e.jsx(de, { className: "px-3 py-2 text-xs hover:no-underline", children: /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-x-2", children: [
1949
+ /* @__PURE__ */ e.jsx("div", { className: `h-[8px] w-[8px] rounded-full ${l ? "bg-blue-500" : "bg-gray-300"}` }),
1950
+ t.heading
1884
1951
  ] }) }),
1885
- /* @__PURE__ */ e.jsx(de, { className: "bg-gray-100 px-3.5 py-2", children: P.Children.toArray(
1886
- r.items.map((s) => ue(s, "component") ? P.createElement(s.component, { key: s.label }) : ue(s, "styleType") ? s.styleType === "multiple" ? /* @__PURE__ */ e.jsx(st, { ...s }, s.label) : s.styleType === "accordion" && t(s == null ? void 0 : s.conditions) ? /* @__PURE__ */ e.jsx(Mr, { ...s }, s.label) : null : /* @__PURE__ */ e.jsx(ke, { ...s }, s.label))
1952
+ /* @__PURE__ */ e.jsx(ce, { className: "bg-gray-100 px-3.5 py-2", children: $.Children.toArray(
1953
+ t.items.map((a) => ge(a, "component") ? $.createElement(a.component, { key: a.label }) : ge(a, "styleType") ? a.styleType === "multiple" ? /* @__PURE__ */ e.jsx(nt, { ...a }, a.label) : a.styleType === "accordion" && r(a == null ? void 0 : a.conditions) ? /* @__PURE__ */ e.jsx(as, { ...a }, a.label) : null : /* @__PURE__ */ e.jsx(Te, { ...a }, a.label))
1887
1954
  ) })
1888
1955
  ] }) });
1889
- }, Er = ({
1890
- item: r,
1891
- index: o,
1892
- canDelete: t,
1893
- onChange: a,
1894
- onRemove: l
1895
- }) => /* @__PURE__ */ e.jsxs("div", { className: `flex flex-col gap-1 border-gray-400 py-2 ${t ? "border-b" : ""}`, children: [
1956
+ }, ds = ({
1957
+ item: t,
1958
+ index: s,
1959
+ canDelete: r,
1960
+ onChange: l,
1961
+ onRemove: o
1962
+ }) => /* @__PURE__ */ e.jsxs("div", { className: `flex flex-col gap-1 border-gray-400 py-2 ${r ? "border-b" : ""}`, children: [
1896
1963
  /* @__PURE__ */ e.jsx(
1897
1964
  "input",
1898
1965
  {
1899
1966
  name: "key",
1900
- onChange: (s) => a(s, o),
1901
- value: r.key,
1967
+ onChange: (a) => l(a, s),
1968
+ value: t.key,
1902
1969
  placeholder: "Key",
1903
1970
  className: "w-full rounded border-gray-300 bg-background p-0.5 pl-2 text-sm focus-visible:outline-0",
1904
1971
  autoComplete: "off",
@@ -1910,8 +1977,8 @@ const Nr = ({ property: r, onChange: o }) => {
1910
1977
  "input",
1911
1978
  {
1912
1979
  name: "value",
1913
- onChange: (s) => b(r.key) ? {} : a(s, o),
1914
- value: r.value,
1980
+ onChange: (a) => b(t.key) ? {} : l(a, s),
1981
+ value: t.value,
1915
1982
  placeholder: "Value",
1916
1983
  className: "w-full rounded border-gray-300 bg-background p-0.5 pl-2 text-sm focus-visible:outline-0",
1917
1984
  autoComplete: "off",
@@ -1919,76 +1986,76 @@ const Nr = ({ property: r, onChange: o }) => {
1919
1986
  }
1920
1987
  ),
1921
1988
  /* @__PURE__ */ e.jsx(
1922
- Xe,
1989
+ We,
1923
1990
  {
1924
- onClick: l,
1991
+ onClick: o,
1925
1992
  className: "h-6 w-6 cursor-pointer rounded border border-red-400 p-1 text-red-400 hover:opacity-80"
1926
1993
  }
1927
1994
  )
1928
1995
  ] })
1929
- ] }), Fr = ({ section: r }) => {
1930
- var g;
1931
- const { setSyncState: o } = Yt(), t = te(), [a, l] = k([]), [s] = je(), d = ze(), i = `${u(s, "0.prop")}_attrs`;
1932
- se.useEffect(() => {
1933
- const y = N(u(t, i), (x, f) => ({ key: f, value: x }));
1934
- b(y) ? l([]) : l(y);
1935
- }, [u(t, i)]);
1936
- const n = () => l([...a, { key: "", value: "" }]), p = (y) => {
1937
- const x = Oe(a, (f, $) => y !== $);
1938
- h(x);
1939
- }, c = (y, x) => {
1940
- const f = [...a];
1941
- f[x][y.target.name] = y.target.value, h(f);
1942
- }, h = se.useCallback(
1943
- (y = []) => {
1944
- const x = {};
1945
- be(y, (f) => {
1946
- b(f.key) || Le(x, f.key, f.value);
1947
- }), d([u(t, "_id")], { [i]: x }), o("UNSAVED");
1996
+ ] }), cs = ({ section: t }) => {
1997
+ var m;
1998
+ const { setSyncState: s } = zt(), r = G(), [l, o] = w([]), [a] = Ne(), d = Ue(), i = `${p(a, "0.prop")}_attrs`;
1999
+ ne.useEffect(() => {
2000
+ const h = C(p(r, i), (g, f) => ({ key: f, value: g }));
2001
+ b(h) ? o([]) : o(h);
2002
+ }, [p(r, i)]);
2003
+ const n = () => o([...l, { key: "", value: "" }]), u = (h) => {
2004
+ const g = be(l, (f, S) => h !== S);
2005
+ c(g);
2006
+ }, x = (h, g) => {
2007
+ const f = [...l];
2008
+ f[g][h.target.name] = h.target.value, c(f);
2009
+ }, c = ne.useCallback(
2010
+ (h = []) => {
2011
+ const g = {};
2012
+ je(h, (f) => {
2013
+ b(f.key) || Me(g, f.key, f.value);
2014
+ }), d([p(r, "_id")], { [i]: g }), s("UNSAVED");
1948
2015
  },
1949
- [t, o, d, i]
2016
+ [r, s, d, i]
1950
2017
  );
1951
- return /* @__PURE__ */ e.jsxs(ae, { value: r.heading, children: [
1952
- /* @__PURE__ */ e.jsx(ie, { className: "px-3 py-2 text-xs hover:no-underline", children: /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-x-2", children: [
2018
+ return /* @__PURE__ */ e.jsxs(ie, { value: t.heading, children: [
2019
+ /* @__PURE__ */ e.jsx(de, { className: "px-3 py-2 text-xs hover:no-underline", children: /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-x-2", children: [
1953
2020
  /* @__PURE__ */ e.jsx(
1954
2021
  "div",
1955
2022
  {
1956
- className: `h-[8px] w-[8px] rounded-full ${b(u(t, i)) ? "bg-gray-300" : "bg-blue-500"}`
2023
+ className: `h-[8px] w-[8px] rounded-full ${b(p(r, i)) ? "bg-gray-300" : "bg-blue-500"}`
1957
2024
  }
1958
2025
  ),
1959
2026
  "Attributes"
1960
2027
  ] }) }),
1961
- /* @__PURE__ */ e.jsx(de, { className: "bg-gray-100 px-3.5 py-2", children: /* @__PURE__ */ e.jsxs("div", { className: "no-scrollbar flex min-h-max flex-col gap-y-2 overflow-y-auto bg-gray-100 p-px", children: [
1962
- /* @__PURE__ */ e.jsxs(Ce, { className: "mt-2 flex w-full items-center justify-between", children: [
2028
+ /* @__PURE__ */ e.jsx(ce, { className: "bg-gray-100 px-3.5 py-2", children: /* @__PURE__ */ e.jsxs("div", { className: "no-scrollbar flex min-h-max flex-col gap-y-2 overflow-y-auto bg-gray-100 p-px", children: [
2029
+ /* @__PURE__ */ e.jsxs(Se, { className: "mt-2 flex w-full items-center justify-between", children: [
1963
2030
  "Add Custom attributes",
1964
2031
  /* @__PURE__ */ e.jsxs(
1965
2032
  "div",
1966
2033
  {
1967
- className: `flex h-6 w-max items-center justify-center gap-x-0.5 rounded-full border p-1 px-2 text-xs ${!b(a) && b((g = he(a)) == null ? void 0 : g.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"}`,
2034
+ className: `flex h-6 w-max items-center justify-center gap-x-0.5 rounded-full border p-1 px-2 text-xs ${!b(l) && b((m = ye(l)) == null ? void 0 : m.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"}`,
1968
2035
  onClick: () => {
1969
- var y;
1970
- !b(a) && b((y = he(a)) == null ? void 0 : y.key) || n();
2036
+ var h;
2037
+ !b(l) && b((h = ye(l)) == null ? void 0 : h.key) || n();
1971
2038
  },
1972
2039
  children: [
1973
- /* @__PURE__ */ e.jsx(ve, { width: 12, height: 12 }),
2040
+ /* @__PURE__ */ e.jsx(Ce, { width: 12, height: 12 }),
1974
2041
  " Add"
1975
2042
  ]
1976
2043
  }
1977
2044
  )
1978
2045
  ] }),
1979
2046
  /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col", children: [
1980
- b(a) && /* @__PURE__ */ e.jsx("div", { className: "flex h-12 items-center justify-center text-sm text-gray-400", children: "Click + Add to add attributes" }),
1981
- se.Children.toArray(
1982
- N(a, (y, x) => {
1983
- const f = a.length > 0 && x < a.length - 1;
2047
+ b(l) && /* @__PURE__ */ e.jsx("div", { className: "flex h-12 items-center justify-center text-sm text-gray-400", children: "Click + Add to add attributes" }),
2048
+ ne.Children.toArray(
2049
+ C(l, (h, g) => {
2050
+ const f = l.length > 0 && g < l.length - 1;
1984
2051
  return /* @__PURE__ */ e.jsx(
1985
- Er,
2052
+ ds,
1986
2053
  {
1987
- item: y,
1988
- index: x,
2054
+ item: h,
2055
+ index: g,
1989
2056
  canDelete: f,
1990
- onChange: c,
1991
- onRemove: () => p(x)
2057
+ onChange: x,
2058
+ onRemove: () => u(g)
1992
2059
  }
1993
2060
  );
1994
2061
  })
@@ -1997,11 +2064,11 @@ const Nr = ({ property: r, onChange: o }) => {
1997
2064
  ] }) })
1998
2065
  ] });
1999
2066
  };
2000
- function Yr() {
2001
- const [r, o] = qe(), { flexChild: t, gridChild: a } = Xt(), [, l] = rr(Wt), { t: s } = Ee(), [d] = je();
2067
+ function ps() {
2068
+ const [t, s] = Je(), { flexChild: r, gridChild: l } = Ut(), [, o] = Cr(Gt), { t: a } = Fe(), [d] = Ne();
2002
2069
  return b(d) ? /* @__PURE__ */ e.jsx("div", { className: "p-4 text-center", children: /* @__PURE__ */ e.jsxs("div", { className: "space-y-4 rounded-xl p-4", children: [
2003
- /* @__PURE__ */ e.jsx(We, { className: "mx-auto text-3xl" }),
2004
- /* @__PURE__ */ e.jsx("h1", { children: s("no_styling_block_selected") }),
2070
+ /* @__PURE__ */ e.jsx(Ze, { className: "mx-auto text-3xl" }),
2071
+ /* @__PURE__ */ e.jsx("h1", { children: a("no_styling_block_selected") }),
2005
2072
  /* @__PURE__ */ e.jsxs("p", { className: "text-xs ", children: [
2006
2073
  "Hint: Styling allowed blocks are highlighted with",
2007
2074
  " ",
@@ -2010,40 +2077,40 @@ function Yr() {
2010
2077
  ] })
2011
2078
  ] }) }) : (
2012
2079
  // eslint-disable-next-line jsx-a11y/click-events-have-key-events,jsx-a11y/no-static-element-interactions
2013
- /* @__PURE__ */ e.jsxs("div", { onClick: () => l(!1), className: "flex h-full flex-col", children: [
2080
+ /* @__PURE__ */ e.jsxs("div", { onClick: () => o(!1), className: "flex h-full flex-col", children: [
2014
2081
  /* @__PURE__ */ e.jsx("div", { className: "flex flex-col space-x-4 space-y-3 border-b border-border px-4 py-2", children: /* @__PURE__ */ e.jsxs("div", { className: "flex items-center justify-end gap-x-1.5", children: [
2015
- /* @__PURE__ */ e.jsx(Ce, { htmlFor: "", className: "flex gap-x-1.5 text-xs italic", children: "State" }),
2016
- /* @__PURE__ */ e.jsxs(dr, { defaultValue: r, onValueChange: (i) => o(i), children: [
2017
- /* @__PURE__ */ e.jsx(cr, { className: "h-auto w-fit p-1 px-3", children: /* @__PURE__ */ e.jsx(pr, { placeholder: "State" }) }),
2018
- /* @__PURE__ */ e.jsxs(ur, { children: [
2019
- /* @__PURE__ */ e.jsx(A, { value: "", children: "Normal" }),
2020
- /* @__PURE__ */ e.jsx(A, { value: "hover", children: "Hover" }),
2021
- /* @__PURE__ */ e.jsx(A, { value: "active", children: "Active" }),
2022
- /* @__PURE__ */ e.jsx(A, { value: "focus", children: "Focus" }),
2023
- /* @__PURE__ */ e.jsx(A, { value: "before", children: "Before" }),
2024
- /* @__PURE__ */ e.jsx(A, { value: "after", children: "After" }),
2025
- /* @__PURE__ */ e.jsx(A, { value: "only", children: "Only" }),
2026
- /* @__PURE__ */ e.jsx(A, { value: "first", children: "First" }),
2027
- /* @__PURE__ */ e.jsx(A, { value: "last", children: "Last" }),
2028
- /* @__PURE__ */ e.jsx(A, { value: "first-letter", children: "First Letter" }),
2029
- /* @__PURE__ */ e.jsx(A, { value: "first-line", children: "First Line" }),
2030
- /* @__PURE__ */ e.jsx(A, { value: "disabled", children: "Disabled" })
2082
+ /* @__PURE__ */ e.jsx(Se, { htmlFor: "", className: "flex gap-x-1.5 text-xs italic", children: "State" }),
2083
+ /* @__PURE__ */ e.jsxs(Hr, { defaultValue: t, onValueChange: (i) => s(i), children: [
2084
+ /* @__PURE__ */ e.jsx(Br, { className: "h-auto w-fit p-1 px-3", children: /* @__PURE__ */ e.jsx(Ar, { placeholder: "State" }) }),
2085
+ /* @__PURE__ */ e.jsxs(Dr, { children: [
2086
+ /* @__PURE__ */ e.jsx(H, { value: "", children: "Normal" }),
2087
+ /* @__PURE__ */ e.jsx(H, { value: "hover", children: "Hover" }),
2088
+ /* @__PURE__ */ e.jsx(H, { value: "active", children: "Active" }),
2089
+ /* @__PURE__ */ e.jsx(H, { value: "focus", children: "Focus" }),
2090
+ /* @__PURE__ */ e.jsx(H, { value: "before", children: "Before" }),
2091
+ /* @__PURE__ */ e.jsx(H, { value: "after", children: "After" }),
2092
+ /* @__PURE__ */ e.jsx(H, { value: "only", children: "Only" }),
2093
+ /* @__PURE__ */ e.jsx(H, { value: "first", children: "First" }),
2094
+ /* @__PURE__ */ e.jsx(H, { value: "last", children: "Last" }),
2095
+ /* @__PURE__ */ e.jsx(H, { value: "first-letter", children: "First Letter" }),
2096
+ /* @__PURE__ */ e.jsx(H, { value: "first-line", children: "First Line" }),
2097
+ /* @__PURE__ */ e.jsx(H, { value: "disabled", children: "Disabled" })
2031
2098
  ] })
2032
2099
  ] })
2033
2100
  ] }) }),
2034
- /* @__PURE__ */ e.jsxs(ir, { className: "no-scrollbar -mx-1 h-full overflow-x-hidden", children: [
2101
+ /* @__PURE__ */ e.jsxs(Vr, { className: "no-scrollbar -mx-1 h-full overflow-x-hidden", children: [
2035
2102
  /* @__PURE__ */ e.jsxs(tt, { type: "multiple", className: "h-full w-full", children: [
2036
- t && /* @__PURE__ */ e.jsx(ge, { section: wr }),
2037
- a ? /* @__PURE__ */ e.jsx(ge, { section: jr }) : null,
2038
- Cr.map((i) => /* @__PURE__ */ e.jsx(ge, { section: i }, i.heading)),
2039
- /* @__PURE__ */ e.jsx(Fr, { section: { heading: "Attributes" } })
2103
+ r && /* @__PURE__ */ e.jsx(he, { section: Yr }),
2104
+ l ? /* @__PURE__ */ e.jsx(he, { section: Xr }) : null,
2105
+ Wr.map((i) => /* @__PURE__ */ e.jsx(he, { section: i }, i.heading)),
2106
+ /* @__PURE__ */ e.jsx(cs, { section: { heading: "Attributes" } })
2040
2107
  ] }),
2041
2108
  /* @__PURE__ */ e.jsx("div", { className: "h-60" })
2042
2109
  ] })
2043
2110
  ] })
2044
2111
  );
2045
2112
  }
2046
- const Xr = {
2113
+ const us = {
2047
2114
  px: 1,
2048
2115
  "%": 1,
2049
2116
  em: 100,
@@ -2054,8 +2121,8 @@ const Xr = {
2054
2121
  "-": 1,
2055
2122
  deg: 1,
2056
2123
  ms: 0.1
2057
- }, Xl = () => {
2058
- const r = te(), { t: o } = Ee(), [t, a] = P.useState(""), [l, s] = P.useState({
2124
+ }, hl = () => {
2125
+ const t = G(), { t: s } = Fe(), [r, l] = $.useState(""), [o, a] = $.useState({
2059
2126
  onDrag: (n) => n,
2060
2127
  onDragEnd: (n) => n,
2061
2128
  dragStartY: 0,
@@ -2064,20 +2131,20 @@ const Xr = {
2064
2131
  dragUnit: "",
2065
2132
  negative: !1,
2066
2133
  cssProperty: ""
2067
- }), d = xe(
2134
+ }), d = me(
2068
2135
  (n) => {
2069
- const p = !u(l, "negative", !1), c = u(l, "cssProperty", "");
2070
- let h = parseFloat(l.dragStartValue);
2071
- h = Me(h) ? 0 : h;
2072
- let g = Xr[l.dragUnit];
2073
- (Z(c, "scale") || c === "opacity") && (g = 10);
2074
- let x = (l.dragStartY - n.pageY) / g + h;
2075
- p && x < 0 && (x = 0), c === "opacity" && x > 1 && (x = 1), l.onDrag(`${x}`), a(`${x}`);
2136
+ const u = !p(o, "negative", !1), x = p(o, "cssProperty", "");
2137
+ let c = parseFloat(o.dragStartValue);
2138
+ c = _e(c) ? 0 : c;
2139
+ let m = us[o.dragUnit];
2140
+ (z(x, "scale") || x === "opacity") && (m = 10);
2141
+ let g = (o.dragStartY - n.pageY) / m + c;
2142
+ u && g < 0 && (g = 0), x === "opacity" && g > 1 && (g = 1), o.onDrag(`${g}`), l(`${g}`);
2076
2143
  },
2077
- [l],
2144
+ [o],
2078
2145
  50
2079
- ), i = L(() => {
2080
- setTimeout(() => l.onDragEnd(`${t}`), 100), s({
2146
+ ), i = A(() => {
2147
+ setTimeout(() => o.onDragEnd(`${r}`), 100), a({
2081
2148
  onDrag: (n) => n,
2082
2149
  onDragEnd: (n) => n,
2083
2150
  dragStartY: 0,
@@ -2087,12 +2154,12 @@ const Xr = {
2087
2154
  negative: !1,
2088
2155
  cssProperty: ""
2089
2156
  });
2090
- }, [l, t, s]);
2091
- return yt(r) ? /* @__PURE__ */ e.jsx("div", { className: "p-4 text-center", children: /* @__PURE__ */ e.jsxs("div", { className: "space-y-4 rounded-xl p-4", children: [
2092
- /* @__PURE__ */ e.jsx(We, { className: "mx-auto text-3xl" }),
2093
- /* @__PURE__ */ e.jsx("h1", { children: o("no_block_selected_for_styling") })
2094
- ] }) }) : /* @__PURE__ */ e.jsxs(ot.Provider, { value: { setDragData: s }, children: [
2095
- l.dragging ? /* @__PURE__ */ e.jsx(
2157
+ }, [o, r, a]);
2158
+ return vt(t) ? /* @__PURE__ */ e.jsx("div", { className: "p-4 text-center", children: /* @__PURE__ */ e.jsxs("div", { className: "space-y-4 rounded-xl p-4", children: [
2159
+ /* @__PURE__ */ e.jsx(Ze, { className: "mx-auto text-3xl" }),
2160
+ /* @__PURE__ */ e.jsx("h1", { children: s("no_block_selected_for_styling") })
2161
+ ] }) }) : /* @__PURE__ */ e.jsxs(ot.Provider, { value: { setDragData: a }, children: [
2162
+ o.dragging ? /* @__PURE__ */ e.jsx(
2096
2163
  "div",
2097
2164
  {
2098
2165
  onMouseMove: d,
@@ -2100,23 +2167,23 @@ const Xr = {
2100
2167
  className: "absolute inset-0 z-30 cursor-row-resize bg-gray-300/10 "
2101
2168
  }
2102
2169
  ) : null,
2103
- /* @__PURE__ */ e.jsxs(It, { defaultValue: "settings", className: "flex h-full w-full flex-col py-1", children: [
2104
- /* @__PURE__ */ e.jsxs(Pt, { className: "mx-1 grid grid-cols-2", children: [
2105
- /* @__PURE__ */ e.jsx(Re, { value: "settings", children: "Settings" }),
2106
- /* @__PURE__ */ e.jsx(Re, { value: "styling", children: "Styling" })
2170
+ /* @__PURE__ */ e.jsxs(Ot, { defaultValue: "settings", className: "flex h-full w-full flex-col py-1", children: [
2171
+ /* @__PURE__ */ e.jsxs(Mt, { className: "mx-1 grid grid-cols-2", children: [
2172
+ /* @__PURE__ */ e.jsx(He, { value: "settings", children: "Settings" }),
2173
+ /* @__PURE__ */ e.jsx(He, { value: "styling", children: "Styling" })
2107
2174
  ] }),
2108
2175
  /* @__PURE__ */ e.jsx(
2109
- He,
2176
+ Be,
2110
2177
  {
2111
2178
  value: "settings",
2112
2179
  className: "no-scrollbar -mx-1 -mr-2 h-full flex-1 overflow-y-auto overflow-x-hidden",
2113
- children: /* @__PURE__ */ e.jsx(fr, {})
2180
+ children: /* @__PURE__ */ e.jsx(Er, {})
2114
2181
  }
2115
2182
  ),
2116
- /* @__PURE__ */ e.jsx(He, { value: "styling", className: "flex-1 overflow-y-auto overflow-x-hidden", children: /* @__PURE__ */ e.jsx(Yr, {}) })
2183
+ /* @__PURE__ */ e.jsx(Be, { value: "styling", className: "flex-1 overflow-y-auto overflow-x-hidden", children: /* @__PURE__ */ e.jsx(ps, {}) })
2117
2184
  ] })
2118
2185
  ] });
2119
2186
  };
2120
2187
  export {
2121
- Xl as default
2188
+ hl as default
2122
2189
  };