@chaibuilder/sdk 1.2.52 → 1.2.55

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