@chaibuilder/sdk 1.2.43 → 1.2.45

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 (98) hide show
  1. package/dist/AddBlocks-UjnfO1xM.cjs +1 -0
  2. package/dist/{AddBlocks-9UM7zj57.js → AddBlocks-vkMNQu2M.js} +48 -46
  3. package/dist/CanvasArea-DLg9e6l5.js +1216 -0
  4. package/dist/CanvasArea-tyXurhEm.cjs +57 -0
  5. package/dist/{ChaiBuilderEditor-yf2LRjL1.js → ChaiBuilderEditor-1K-wcF5D.js} +3910 -3933
  6. package/dist/{ChaiBuilderEditor--NV-B5az.cjs → ChaiBuilderEditor-iXQwbYNr.cjs} +44 -44
  7. package/dist/CurrentPage-6t2cmyoQ.cjs +1 -0
  8. package/dist/{CurrentPage-hKtVFDxU.js → CurrentPage-JjZQQ8fp.js} +11 -10
  9. package/dist/{ListTree-ulr_sjdn.js → ListTree-KsggM2ac.js} +4 -3
  10. package/dist/ListTree-OTrtj3iM.cjs +1 -0
  11. package/dist/{PagesPanel-EHLY-cfj.js → PagesPanel-bElLBHNI.js} +6 -5
  12. package/dist/PagesPanel-zm1EC6Iw.cjs +1 -0
  13. package/dist/ProjectPanel-4zPiPARX.cjs +1 -0
  14. package/dist/{ProjectPanel-qiqyRbwH.js → ProjectPanel-o1BnitsI.js} +7 -6
  15. package/dist/Settings-7LXieIrg.cjs +1 -0
  16. package/dist/{Settings-a7j3ihRx.js → Settings-Bj2wI1at.js} +966 -892
  17. package/dist/SidePanels-9DSI8ysE.cjs +1 -0
  18. package/dist/{SidePanels-9XdRZ7rz.js → SidePanels-Q23Yldya.js} +7 -6
  19. package/dist/{ThemeConfiguration-MaGPPza1.js → ThemeConfiguration-GY85_LR8.js} +6 -5
  20. package/dist/ThemeConfiguration-mgyKWvYY.cjs +1 -0
  21. package/dist/Topbar-_7BQ50Y4.cjs +1 -0
  22. package/dist/{Topbar-OpgHjdWn.js → Topbar-_T58hnmh.js} +5 -4
  23. package/dist/UILibrariesPanel-28G5q5uW.cjs +1 -0
  24. package/dist/{UILibrariesPanel-HVpapacm.js → UILibrariesPanel-e9sgXFmR.js} +6 -5
  25. package/dist/{UnsplashImages-Gx7dy6mp.js → UnsplashImages-2Iew1REO.js} +12 -11
  26. package/dist/UnsplashImages-wiV_0gCf.cjs +1 -0
  27. package/dist/{UploadImages-aClrfKqQ.js → UploadImages--batsol9.js} +10 -9
  28. package/dist/UploadImages-XNNW2MnE.cjs +1 -0
  29. package/dist/{add-page-modal-kP7x8GYO.js → add-page-modal-1hTp3XOU.js} +18 -17
  30. package/dist/add-page-modal-AvOI8Zy3.cjs +1 -0
  31. package/dist/atoms-ZOWyNoiC.js +6 -0
  32. package/dist/atoms-a0H_593V.cjs +1 -0
  33. package/dist/confirm-alert-8gHBC9xl.cjs +1 -0
  34. package/dist/{confirm-alert-gemzBTIt.js → confirm-alert-pMcaye-H.js} +5 -4
  35. package/dist/core.cjs +1 -1
  36. package/dist/core.d.ts +1 -1
  37. package/dist/core.js +46 -45
  38. package/dist/delete-page-modal--GqB4-ya.cjs +1 -0
  39. package/dist/{delete-page-modal-ER-TAzRL.js → delete-page-modal-pPp6AAO1.js} +6 -5
  40. package/dist/email-blocks.cjs +1 -1
  41. package/dist/email-blocks.js +30 -30
  42. package/dist/email.cjs +1 -1
  43. package/dist/email.d.ts +1 -1
  44. package/dist/email.js +5 -4
  45. package/dist/empty-slot-Lsxjts7Q.js +6 -0
  46. package/dist/empty-slot-Sy930lX6.cjs +1 -0
  47. package/dist/{form-UruaB3s_.js → form-BbIs9ZUH.js} +5 -5
  48. package/dist/{form-l4PB76nt.cjs → form-svmj4OQd.cjs} +1 -1
  49. package/dist/{index-rKrjj7Vz.js → index-GRkx-GlC.js} +2 -2
  50. package/dist/{index-PXyps6Qc.cjs → index-ssLLO7-s.cjs} +1 -1
  51. package/dist/lib.cjs +1 -1
  52. package/dist/lib.js +3 -3
  53. package/dist/page-viewer-0QMFEzfk.cjs +1 -0
  54. package/dist/{page-viewer-bCH5PPSH.js → page-viewer-3ne7tW8e.js} +7 -6
  55. package/dist/{project-general-setting-rdCQBkQZ.js → project-general-setting-cIjIy8PW.js} +11 -10
  56. package/dist/project-general-setting-oNYVjfNV.cjs +1 -0
  57. package/dist/project-seo-setting-5699qkWN.cjs +1 -0
  58. package/dist/{project-seo-setting-_SGBKl0c.js → project-seo-setting-HLwPjaL2.js} +6 -5
  59. package/dist/{single-page-detail-H3Rb5gkJ.js → single-page-detail-MLxPXKfu.js} +8 -7
  60. package/dist/single-page-detail-amfiKMF_.cjs +1 -0
  61. package/dist/studio.cjs +1 -1
  62. package/dist/studio.d.ts +1 -1
  63. package/dist/studio.js +5 -4
  64. package/dist/style.css +1 -1
  65. package/dist/ui.cjs +1 -1
  66. package/dist/ui.d.ts +3 -3
  67. package/dist/ui.js +130 -129
  68. package/dist/{useCanvasSettings-IalZcnSd.cjs → useCanvasSettings-KDwtap3V.cjs} +1 -1
  69. package/dist/{useCanvasSettings-tkzd9Qrw.js → useCanvasSettings-qs-7bwyA.js} +1 -1
  70. package/dist/utils-K3Zk762G.cjs +1 -0
  71. package/dist/{Class-6Hz2KzYb.js → utils-iMv3T4WT.js} +16 -15
  72. package/dist/web-blocks.cjs +4 -4
  73. package/dist/web-blocks.js +237 -238
  74. package/package.json +3 -2
  75. package/dist/AddBlocks-_6X3bnJZ.cjs +0 -1
  76. package/dist/CanvasArea-HmbcRpgP.cjs +0 -55
  77. package/dist/CanvasArea-a3WMBMi3.js +0 -1199
  78. package/dist/Class-Zc8hpE7f.cjs +0 -1
  79. package/dist/CurrentPage-rgu6shCq.cjs +0 -1
  80. package/dist/ListTree-fwN6Y_EA.cjs +0 -1
  81. package/dist/PagesPanel-v6Nl5KWy.cjs +0 -1
  82. package/dist/ProjectPanel-ck-mOBEg.cjs +0 -1
  83. package/dist/Settings-Rtk4HDKy.cjs +0 -1
  84. package/dist/SidePanels-biCoYtzR.cjs +0 -1
  85. package/dist/ThemeConfiguration-f6AxqpmO.cjs +0 -1
  86. package/dist/Topbar-cDxKWgN6.cjs +0 -1
  87. package/dist/UILibrariesPanel-d08F5Ri0.cjs +0 -1
  88. package/dist/UnsplashImages-uyokFuF-.cjs +0 -1
  89. package/dist/UploadImages-kLPXfW7W.cjs +0 -1
  90. package/dist/add-page-modal-H5MTzKBT.cjs +0 -1
  91. package/dist/confirm-alert-zZAmXzx0.cjs +0 -1
  92. package/dist/delete-page-modal-E8MFNVWF.cjs +0 -1
  93. package/dist/empty-slot-ZBlsQi6m.js +0 -15
  94. package/dist/empty-slot-nzYOgZuS.cjs +0 -1
  95. package/dist/page-viewer-wQq2qD96.cjs +0 -1
  96. package/dist/project-general-setting-A5OelyCo.cjs +0 -1
  97. package/dist/project-seo-setting-Y_q0WJSy.cjs +0 -1
  98. package/dist/single-page-detail-xAO7x8a1.cjs +0 -1
@@ -1,22 +1,21 @@
1
1
  import { j as e } from "./jsx-runtime-WbnYoNE9.js";
2
- import * as de from "react";
3
- import I, { useState as w, useMemo as S, useEffect as z, useCallback as H, memo as ft, createContext as Ke, useContext as ae } from "react";
4
- import { useThrottledCallback as ue } from "@react-hookz/web";
5
- import { forEach as Re, isArray as xe, omit as vt, truncate as jt, includes as F, get as g, first as oe, split as wt, startCase as Y, toLower as le, isEmpty as b, map as C, find as Ge, last as Ct, filter as ve, set as qe, debounce as kt, keys as je, cloneDeep as Nt, each as _t, capitalize as we, reject as St, nth as $e, startsWith as W, isNumber as Tt, parseInt as Rt, isNaN as Je, findLast as Vt, flatten as J, intersection as Qe, has as ce, kebabCase as Ht, isNull as Dt } from "lodash-es";
6
- import { useTranslation as X } from "react-i18next";
7
- import { CopyIcon as Bt, PlusIcon as Ve, Cross2Icon as et, EyeOpenIcon as Pt, EyeClosedIcon as Ae, BorderAllIcon as O, WidthIcon as T, HeightIcon as R, ArrowUpIcon as ee, ArrowRightIcon as te, ArrowDownIcon as re, ArrowLeftIcon as se, ArrowTopLeftIcon as It, ArrowTopRightIcon as $t, ArrowBottomRightIcon as At, ArrowBottomLeftIcon as Mt, AlignLeftIcon as Lt, AlignCenterHorizontallyIcon as Et, AlignRightIcon as Ot, StretchHorizontallyIcon as Ft, FontItalicIcon as Yt, UnderlineIcon as zt, OverlineIcon as Xt, LetterCaseUppercaseIcon as Zt, Cross1Icon as Wt, InfoCircledIcon as He, MinusIcon as Ut, BoxIcon as tt, RowSpacingIcon as Kt, TriangleDownIcon as Gt, CrossCircledIcon as qt, CaretDownIcon as Jt, MixerHorizontalIcon as rt } from "@radix-ui/react-icons";
8
- import { a2 as st, aO as Qt, aP as er, B as G, aQ as tr, aR as rr, aS as sr, aT as lr, aU as ar, aV as or, aW as nr, M as q, aK as lt, $ as ir, a0 as dr, a1 as cr, aX as pr, Z as ur, ab as xr, _ as gr, ac as $, ad as A, ae as M, aY as hr, aZ as yr, a_ as mr, a$ as br, b0 as fr, b1 as vr, b2 as jr, R as at, Q as ot, h as wr, b3 as Cr, b4 as nt, b5 as Ce, b6 as ke, b7 as Ne, Y as ge, n as De, I as it, L as dt, b8 as ct, aq as pt, b9 as _e, j as kr, ba as Nr, J as he, v as _r, P as ut, o as Me, av as Sr, aw as Tr, ax as Rr, bb as Be, ay as Le, az as Ee, bc as Oe, bd as Fe, be as Ye, S as Vr, bf as Hr, a6 as Dr, a7 as Br, a8 as Pr, a9 as Ir, aa as V, ai as $r, aj as Ar, ak as me, al as be } from "./ChaiBuilderEditor-yf2LRjL1.js";
9
- import { l as Mr } from "./controls-VTdJhdSz.js";
10
- import { Check as Lr, EditIcon as Er, TrashIcon as Or, BrushIcon as Fr, DeleteIcon as Yr } from "lucide-react";
11
- import { getBlockComponent as Pe, getChaiDataProviders as zr, useGlobalStylingPresets as Xr } from "@chaibuilder/runtime";
12
- import { J as Zr, a as Wr, d as Ur } from "./index-e0c8PmRQ.js";
13
- import Kr from "@rjsf/core";
14
- import Gr from "@rjsf/validator-ajv8";
15
- import { u as qr } from "./useCanvasSettings-tkzd9Qrw.js";
16
- import Jr from "react-autosuggest";
17
- import Qr from "fuse.js";
18
- import { A as es, C as ye, g as ts } from "./Class-6Hz2KzYb.js";
19
- import { a as rs } from "./STRINGS--j49GZJP.js";
2
+ import * as ne from "react";
3
+ import I, { useState as j, useMemo as T, useEffect as P, useCallback as H, memo as mt, useRef as ft, createContext as Fe, useContext as se } from "react";
4
+ import { useThrottledCallback as de } from "@react-hookz/web";
5
+ import { forEach as Ne, isArray as ce, omit as vt, truncate as jt, includes as X, get as y, first as ae, split as wt, startCase as F, toLower as re, isEmpty as m, map as _, find as Ze, last as Ct, filter as ye, set as We, debounce as kt, keys as he, cloneDeep as Nt, each as _t, capitalize as be, reject as St, kebabCase as Tt, startsWith as W, nth as He, isNumber as Rt, parseInt as Vt, isNaN as Ue, findLast as Ht, flatten as De, intersection as Dt, has as ie, isNull as Bt } from "lodash-es";
6
+ import { useTranslation as B } from "react-i18next";
7
+ import { CopyIcon as It, PlusIcon as _e, Cross2Icon as Ge, EyeOpenIcon as Pt, 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 At, ArrowTopRightIcon as $t, ArrowBottomRightIcon as Mt, ArrowBottomLeftIcon as Et, AlignLeftIcon as Lt, AlignCenterHorizontallyIcon as Ot, AlignRightIcon as zt, StretchHorizontallyIcon as Yt, FontItalicIcon as Xt, UnderlineIcon as Ft, OverlineIcon as Zt, LetterCaseUppercaseIcon as Wt, Cross1Icon as Ut, InfoCircledIcon as Se, MinusIcon as Gt, BoxIcon as Ke, RowSpacingIcon as Kt, TriangleDownIcon as qt, CrossCircledIcon as Jt, CaretDownIcon as Qt, MixerHorizontalIcon as qe } from "@radix-ui/react-icons";
8
+ import { a2 as Je, aP as Qe, aQ as et, B as A, aR as tt, aS as er, aT as tr, aU as rr, aV as sr, aW as ar, aX as lr, M as G, aK as rt, $ as or, a0 as nr, a1 as ir, aY as dr, Z as cr, ab as pr, _ as ur, ac as $, ad as M, ae as E, aZ as gr, a_ as xr, a$ as yr, b0 as hr, b1 as br, b2 as mr, b3 as fr, R as st, Q as at, h as lt, b4 as vr, b5 as ot, b6 as me, b7 as fe, b8 as ve, b9 as jr, ba as wr, ah as Cr, bb as kr, Y as pe, n as Te, I as nt, L as it, bc as dt, bd as je, j as Nr, be as _r, J as ue, v as Sr, P as Tr, o as Ie, av as Rr, aw as Vr, ax as Hr, bf as ct, ay as Pe, az as Ae, bg as $e, bh as Me, bi as Ee, S as Dr } from "./ChaiBuilderEditor-1K-wcF5D.js";
9
+ import { Check as Br, EditIcon as Ir, TrashIcon as Pr, Loader as Ar, SparklesIcon as $r, DeleteIcon as Mr } from "lucide-react";
10
+ import { getBlockComponent as Re, getChaiDataProviders as Er, useGlobalStylingPresets as Lr } from "@chaibuilder/runtime";
11
+ import { J as Or, a as zr, d as Yr } from "./index-e0c8PmRQ.js";
12
+ import Xr from "@rjsf/core";
13
+ import Fr from "@rjsf/validator-ajv8";
14
+ import { u as Zr } from "./useCanvasSettings-qs-7bwyA.js";
15
+ import Wr from "react-autosuggest";
16
+ import Ur from "fuse.js";
17
+ import { A as Gr, C as ge, g as Kr } from "./utils-iMv3T4WT.js";
18
+ import { a as qr } from "./STRINGS--j49GZJP.js";
20
19
  import "./_commonjsHelpers-UyOWmZb0.js";
21
20
  import "clsx";
22
21
  import "react-dom";
@@ -28,6 +27,7 @@ import "flagged";
28
27
  import "./Functions-7jnEwJyw.js";
29
28
  import "tailwind-merge";
30
29
  import "./MODIFIERS-cBT31iqE.js";
30
+ import "tree-model";
31
31
  import "@radix-ui/react-toggle";
32
32
  import "class-variance-authority";
33
33
  import "@radix-ui/react-switch";
@@ -50,29 +50,29 @@ import "@radix-ui/react-context-menu";
50
50
  import "react-icons-picker";
51
51
  import "react-quill";
52
52
  import "react-hotkeys-hook";
53
- function ss(r) {
54
- const l = [], t = {};
55
- function n(s, i) {
56
- Re(i, (a, d) => {
57
- const o = s ? `${s}.${d}` : d, c = xe(a) ? "list" : typeof a;
58
- l.push(o), t[o] = c === "string" ? "text" : c === "object" ? "model" : c, c === "object" && !xe(a) && n(o, a);
53
+ function Jr(r) {
54
+ const a = [], t = {};
55
+ function n(l, s) {
56
+ Ne(s, (d, c) => {
57
+ const o = l ? `${l}.${c}` : c, p = ce(d) ? "list" : typeof d;
58
+ a.push(o), t[o] = p === "string" ? "text" : p === "object" ? "model" : p, p === "object" && !ce(d) && n(o, d);
59
59
  });
60
60
  }
61
- return n("", vt(r, ["styles", "_type", "_id", "_name", "_bindings"])), { paths: l, pathsType: t };
61
+ return n("", vt(r, ["styles", "_type", "_id", "_name", "_bindings"])), { paths: a, pathsType: t };
62
62
  }
63
- const Se = ({ data: r, fullView: l }) => {
63
+ const we = ({ data: r, fullView: a }) => {
64
64
  if (!r)
65
65
  return null;
66
66
  const t = typeof r;
67
- return l ? typeof r == "object" ? /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
67
+ return a ? typeof r == "object" ? /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
68
68
  /* @__PURE__ */ e.jsx("div", { className: "h-3" }),
69
- /* @__PURE__ */ e.jsx(st, { children: /* @__PURE__ */ e.jsx(
70
- Zr,
69
+ /* @__PURE__ */ e.jsx(Je, { children: /* @__PURE__ */ e.jsx(
70
+ Or,
71
71
  {
72
72
  data: r,
73
- shouldExpandNode: Wr,
73
+ shouldExpandNode: zr,
74
74
  style: {
75
- ...Ur,
75
+ ...Yr,
76
76
  container: "max-h-[40vh] overflow-y-auto text-[12px] leading-[1.5] tracking-wide font-mono",
77
77
  stringValue: "text-orange-600",
78
78
  label: "text-green-900 font-semibold pr-1 tracking-wider"
@@ -83,462 +83,506 @@ const Se = ({ data: r, fullView: l }) => {
83
83
  /* @__PURE__ */ e.jsx("span", { className: "font-medium text-gray-800/80", children: "Content: " }),
84
84
  r
85
85
  ] }) : /* @__PURE__ */ e.jsx("div", { className: "w-full overflow-hidden whitespace-nowrap text-[10px] leading-3 text-gray-800/50", children: jt(t === "object" ? JSON.stringify(r) : r, { length: 40 }) });
86
- }, ze = ({
86
+ }, Le = ({
87
87
  type: r,
88
- value: l = "",
88
+ value: a = "",
89
89
  setValue: t,
90
90
  data: n,
91
- onChange: s,
92
- dataType: i,
93
- appliedBindings: a
91
+ onChange: l,
92
+ dataType: s,
93
+ appliedBindings: d
94
94
  }) => {
95
- const { paths: d, pathsType: o } = ss(n), c = r === "PROP" ? Pe(n == null ? void 0 : n._type) : {}, h = r === "PROP", [p, u] = w(!1), y = S(() => r === "PROP" ? d.filter(
96
- (x) => !F(a, x) && g(c, `props.${oe(wt(x, "."))}.binding`)
97
- ) : d.filter((x) => i === g(o, x, "")), [r, d, a, i, c]);
98
- return z(() => {
99
- l && s(l);
100
- }, [l, r]), /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
95
+ const { paths: c, pathsType: o } = Jr(n), p = r === "PROP" ? Re(n == null ? void 0 : n._type) : {}, h = r === "PROP", [i, g] = j(!1), x = T(() => r === "PROP" ? c.filter(
96
+ (u) => !X(d, u) && y(p, `props.${ae(wt(u, "."))}.binding`)
97
+ ) : c.filter((u) => s === y(o, u, "")), [r, c, d, s, p]);
98
+ return P(() => {
99
+ a && l(a);
100
+ }, [a, r]), /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
101
101
  /* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-4", children: [
102
- /* @__PURE__ */ e.jsx("p", { className: "text-sm text-muted-foreground", children: Y(le(r)) }),
103
- /* @__PURE__ */ e.jsxs(Qt, { open: p, onOpenChange: u, children: [
104
- /* @__PURE__ */ e.jsx(er, { asChild: !0, children: /* @__PURE__ */ e.jsx(
105
- G,
102
+ /* @__PURE__ */ e.jsx("p", { className: "text-sm text-muted-foreground", children: F(re(r)) }),
103
+ /* @__PURE__ */ e.jsxs(Qe, { open: i, onOpenChange: g, children: [
104
+ /* @__PURE__ */ e.jsx(et, { asChild: !0, children: /* @__PURE__ */ e.jsx(
105
+ A,
106
106
  {
107
107
  variant: "outline",
108
108
  size: "sm",
109
- className: ` ${b(l) ? "w-44 justify-center bg-blue-500 text-gray-100 hover:bg-blue-400 hover:text-white" : "min-w-[350px] items-center justify-between"}`,
110
- children: l ? /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
109
+ className: ` ${m(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"}`,
110
+ children: a ? /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
111
111
  /* @__PURE__ */ e.jsxs("span", { className: "pr-8 text-sm", children: [
112
- h && /* @__PURE__ */ e.jsx("span", { className: "mr-2 rounded-full bg-purple-100 px-2 py-0.5 text-[10px] text-purple-500", children: Y(i) }),
113
- l
112
+ h && /* @__PURE__ */ e.jsx("span", { className: "mr-2 rounded-full bg-purple-100 px-2 py-0.5 text-[10px] text-purple-500", children: F(s) }),
113
+ a
114
114
  ] }),
115
115
  /* @__PURE__ */ e.jsx("span", { className: "cursor-pointer text-[9px] text-blue-400 underline hover:text-blue-700", children: "Change" })
116
116
  ] }) : /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
117
117
  "+ Set ",
118
- Y(le(r))
118
+ F(re(r))
119
119
  ] })
120
120
  }
121
121
  ) }),
122
- /* @__PURE__ */ e.jsx(tr, { className: "z-[999] min-w-[300px] p-0", side: "right", align: "start", children: /* @__PURE__ */ e.jsxs(rr, { children: [
123
- /* @__PURE__ */ e.jsx(sr, { placeholder: `Choose ${le(r)}...` }),
124
- /* @__PURE__ */ e.jsxs(lr, { children: [
125
- /* @__PURE__ */ e.jsx(ar, { children: "No results found." }),
126
- /* @__PURE__ */ e.jsx(or, { children: C(y, (x) => /* @__PURE__ */ e.jsxs(
127
- nr,
122
+ /* @__PURE__ */ e.jsx(tt, { className: "z-[999] min-w-[300px] p-0", side: "right", align: "start", children: /* @__PURE__ */ e.jsxs(er, { children: [
123
+ /* @__PURE__ */ e.jsx(tr, { placeholder: `Choose ${re(r)}...` }),
124
+ /* @__PURE__ */ e.jsxs(rr, { children: [
125
+ /* @__PURE__ */ e.jsx(sr, { children: "No results found." }),
126
+ /* @__PURE__ */ e.jsx(ar, { children: _(x, (u) => /* @__PURE__ */ e.jsxs(
127
+ lr,
128
128
  {
129
- value: x,
129
+ value: u,
130
130
  className: `cursor-pointer ${h ? "flex items-center justify-between" : "flex flex-col items-start justify-start"}`,
131
- onSelect: (f) => {
132
- t(Ge(y, (j) => j === f) || null), u(!1);
131
+ onSelect: (v) => {
132
+ t(Ze(x, (C) => C === v) || null), g(!1);
133
133
  },
134
134
  children: [
135
135
  /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-x-2", children: [
136
- /* @__PURE__ */ e.jsx(Lr, { className: `h-4 w-4 text-green-500 ${l === x ? "" : "opacity-0"}` }),
137
- x
136
+ /* @__PURE__ */ e.jsx(Br, { className: `h-4 w-4 text-green-500 ${a === u ? "" : "opacity-0"}` }),
137
+ u
138
138
  ] }),
139
- h ? /* @__PURE__ */ e.jsx("div", { children: /* @__PURE__ */ e.jsx("span", { className: "rounded-full bg-purple-100 px-2 py-0.5 text-[10px] text-purple-500", children: Y(g(o, x, "")) }) }) : /* @__PURE__ */ e.jsx("div", { className: "pl-6", children: /* @__PURE__ */ e.jsx(Se, { data: g(n, x) }) })
139
+ h ? /* @__PURE__ */ e.jsx("div", { children: /* @__PURE__ */ e.jsx("span", { className: "rounded-full bg-purple-100 px-2 py-0.5 text-[10px] text-purple-500", children: F(y(o, u, "")) }) }) : /* @__PURE__ */ e.jsx("div", { className: "pl-6", children: /* @__PURE__ */ e.jsx(we, { data: y(n, u) }) })
140
140
  ]
141
141
  },
142
- x
142
+ u
143
143
  )) })
144
144
  ] })
145
145
  ] }) })
146
146
  ] })
147
147
  ] }),
148
- !h && !b(l) && /* @__PURE__ */ e.jsx("div", { className: "pt-2", children: /* @__PURE__ */ e.jsx(Se, { data: g(n, l, ""), fullView: !0 }) })
148
+ !h && !m(a) && /* @__PURE__ */ e.jsx("div", { className: "pt-2", children: /* @__PURE__ */ e.jsx(we, { data: y(n, a, ""), fullView: !0 }) })
149
149
  ] });
150
- }, ls = ({
150
+ }, Qr = ({
151
151
  appliedBindings: r = [],
152
- onAddBinding: l,
152
+ onAddBinding: a,
153
153
  editMode: t,
154
154
  item: n
155
155
  }) => {
156
- const [s, i] = w(t ? n.key : ""), [a, d] = w(t ? n.value : ""), o = q(), [c] = lt(), h = H(
157
- (y, x) => {
158
- if (b(y))
156
+ const [l, s] = j(t ? n.key : ""), [d, c] = j(t ? n.value : ""), o = G(), [p] = rt(), h = H(
157
+ (x, u) => {
158
+ if (m(x))
159
159
  return "";
160
160
  {
161
- const f = g(x === "PROP" ? o : c, y, "");
162
- if (xe(f))
161
+ const v = y(u === "PROP" ? o : p, x, "");
162
+ if (ce(v))
163
163
  return "list";
164
- const j = typeof f;
165
- return j === "string" ? "text" : j === "object" ? "model" : j;
164
+ const C = typeof v;
165
+ return C === "string" ? "text" : C === "object" ? "model" : C;
166
166
  }
167
167
  },
168
- [o, c]
169
- ), [p, u] = w(t ? h(n.key, "PROP") : "");
168
+ [o, p]
169
+ ), [i, g] = j(t ? h(n.key, "PROP") : "");
170
170
  return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
171
- /* @__PURE__ */ e.jsxs(ir, { children: [
172
- /* @__PURE__ */ e.jsx(dr, { children: "Add Data Binding" }),
173
- /* @__PURE__ */ e.jsx(cr, { className: "text-xs", children: "Add prop and path of binding. Click save when you're done." })
171
+ /* @__PURE__ */ e.jsxs(or, { children: [
172
+ /* @__PURE__ */ e.jsx(nr, { children: "Add Data Binding" }),
173
+ /* @__PURE__ */ e.jsx(ir, { className: "text-xs", children: "Add prop and path of binding. Click save when you're done." })
174
174
  ] }),
175
175
  /* @__PURE__ */ e.jsxs("div", { className: "relative flex flex-col gap-1", children: [
176
176
  /* @__PURE__ */ e.jsx(
177
- ze,
177
+ Le,
178
178
  {
179
179
  type: "PROP",
180
180
  isDisabled: !1,
181
181
  placeholder: "Enter prop key",
182
- value: s,
183
- setValue: i,
184
- onChange: (y) => {
185
- const x = h(y, "PROP");
186
- i(y), p !== x && d(""), u(x);
182
+ value: l,
183
+ setValue: s,
184
+ onChange: (x) => {
185
+ const u = h(x, "PROP");
186
+ s(x), i !== u && c(""), g(u);
187
187
  },
188
188
  data: o,
189
- dataType: p,
189
+ dataType: i,
190
190
  appliedBindings: r
191
191
  }
192
192
  ),
193
193
  /* @__PURE__ */ e.jsx("div", { className: "h-2" }),
194
194
  /* @__PURE__ */ e.jsx(
195
- ze,
195
+ Le,
196
196
  {
197
197
  type: "PATH",
198
- isDisabled: b(s),
198
+ isDisabled: m(l),
199
199
  placeholder: "Enter data path",
200
- value: a,
201
- setValue: d,
202
- onChange: (y) => {
203
- const x = h(y, "PATH");
204
- d(p === x ? y : "");
200
+ value: d,
201
+ setValue: c,
202
+ onChange: (x) => {
203
+ const u = h(x, "PATH");
204
+ c(i === u ? x : "");
205
205
  },
206
- data: c,
207
- dataType: p,
206
+ data: p,
207
+ dataType: i,
208
208
  appliedBindings: r
209
209
  }
210
210
  )
211
211
  ] }),
212
- /* @__PURE__ */ e.jsx(pr, { children: /* @__PURE__ */ e.jsx(
213
- G,
212
+ /* @__PURE__ */ e.jsx(dr, { children: /* @__PURE__ */ e.jsx(
213
+ A,
214
214
  {
215
215
  type: "submit",
216
216
  className: "mt-4",
217
- disabled: b(s) && b(a),
218
- onClick: () => l({ key: s, value: a }),
217
+ disabled: m(l) && m(d),
218
+ onClick: () => a({ key: l, value: d }),
219
219
  children: "Save"
220
220
  }
221
221
  ) })
222
222
  ] });
223
- }, xt = ({ disabled: r, children: l, onAddBinding: t, appliedBindings: n, editMode: s = !0, item: i = {} }) => {
224
- const [a, d] = w(!1);
225
- return /* @__PURE__ */ e.jsxs(ur, { children: [
226
- /* @__PURE__ */ e.jsx(xr, { disabled: r, asChild: !0, onClick: () => d(!0), children: l }),
227
- a && /* @__PURE__ */ e.jsx(gr, { children: /* @__PURE__ */ e.jsx(
228
- ls,
223
+ }, pt = ({ disabled: r, children: a, onAddBinding: t, appliedBindings: n, editMode: l = !0, item: s = {} }) => {
224
+ const [d, c] = j(!1);
225
+ return /* @__PURE__ */ e.jsxs(cr, { children: [
226
+ /* @__PURE__ */ e.jsx(pr, { disabled: r, asChild: !0, onClick: () => c(!0), children: a }),
227
+ d && /* @__PURE__ */ e.jsx(ur, { children: /* @__PURE__ */ e.jsx(
228
+ Qr,
229
229
  {
230
- item: i,
231
- editMode: s,
230
+ item: s,
231
+ editMode: l,
232
232
  appliedBindings: n,
233
233
  onAddBinding: (o) => {
234
- t(o), d(!1);
234
+ t(o), c(!1);
235
235
  }
236
236
  }
237
237
  ) })
238
238
  ] });
239
- }, as = ({
239
+ }, es = ({
240
240
  item: r,
241
- onAddBinding: l,
241
+ onAddBinding: a,
242
242
  onRemove: t,
243
243
  selectedBlock: n,
244
- dataProvider: s,
245
- appliedBindings: i
244
+ dataProvider: l,
245
+ appliedBindings: s
246
246
  }) => {
247
- const [a, d] = w("string"), o = (c, h) => {
248
- if (b(c))
247
+ const [d, c] = j("string"), o = (p, h) => {
248
+ if (m(p))
249
249
  return "";
250
250
  {
251
- const p = g(h === "PROP" ? n : s, c, "");
252
- if (xe(p))
251
+ const i = y(h === "PROP" ? n : l, p, "");
252
+ if (ce(i))
253
253
  return "list";
254
- const u = typeof p;
255
- return u === "string" ? "text" : u === "object" ? "model" : u;
254
+ const g = typeof i;
255
+ return g === "string" ? "text" : g === "object" ? "model" : g;
256
256
  }
257
257
  };
258
- return z(() => d(() => o(r.key, "PROP")), [r.key]), /* @__PURE__ */ e.jsxs("div", { className: "relative flex flex-col rounded-md border border-gray-200 p-2", children: [
258
+ return P(() => c(() => o(r.key, "PROP")), [r.key]), /* @__PURE__ */ e.jsxs("div", { className: "relative flex flex-col rounded-md border border-gray-200 p-2", children: [
259
259
  /* @__PURE__ */ e.jsx("div", { className: "text-sm font-normal text-gray-500", children: r.key }),
260
260
  /* @__PURE__ */ e.jsx("div", { className: "font-medium leading-5", children: r.value }),
261
- /* @__PURE__ */ e.jsx(Se, { data: g(s, r.value, "") }),
261
+ /* @__PURE__ */ e.jsx(we, { data: y(l, r.value, "") }),
262
262
  /* @__PURE__ */ e.jsxs("div", { className: "flex items-center justify-end gap-x-2", children: [
263
- /* @__PURE__ */ e.jsx(xt, { editMode: !0, onAddBinding: l, appliedBindings: i, item: r, children: /* @__PURE__ */ e.jsx(Er, { 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" }) }),
263
+ /* @__PURE__ */ e.jsx(pt, { editMode: !0, onAddBinding: a, appliedBindings: s, item: r, children: /* @__PURE__ */ e.jsx(Ir, { 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
264
  /* @__PURE__ */ e.jsx(
265
- Or,
265
+ Pr,
266
266
  {
267
267
  onClick: () => t(),
268
268
  className: "mt-1 h-6 w-6 cursor-pointer rounded border border-red-400 p-1 text-red-400 duration-200 hover:scale-105 hover:bg-red-400 hover:text-white"
269
269
  }
270
270
  )
271
271
  ] }),
272
- !b(a) && !b(r.key) && /* @__PURE__ */ e.jsx("div", { className: "absolute right-0 top-1 mt-px flex h-4 items-center rounded-full px-2 text-[10px] font-medium text-purple-600", children: Y(a) })
272
+ !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: F(d) })
273
273
  ] });
274
- }, os = ({ bindingData: r, onChange: l }) => {
275
- const t = q(), [n] = lt(), s = zr(), [i, a] = w(
276
- C(r, (p, u) => ({ key: u, value: p }))
274
+ }, ts = ({ bindingData: r, onChange: a }) => {
275
+ const t = G(), [n] = rt(), l = Er(), [s, d] = j(
276
+ _(r, (i, g) => ({ key: g, value: i }))
277
277
  );
278
- z(() => {
279
- a(C(r, (p, u) => ({ key: u, value: p })));
278
+ P(() => {
279
+ d(_(r, (i, g) => ({ key: g, value: i })));
280
280
  }, [t == null ? void 0 : t._id, r]);
281
- const d = S(() => {
282
- if (b(n))
281
+ const c = T(() => {
282
+ if (m(n))
283
283
  return !0;
284
- if (b(i))
284
+ if (m(s))
285
285
  return !1;
286
- const p = Ct(i);
287
- return b(p == null ? void 0 : p.key) || b(p == null ? void 0 : p.value);
288
- }, [n, i]), o = (p) => {
289
- const u = ve(i, (y) => y.key !== p.key);
290
- a([...u, p]), h([...u, p]);
291
- }, c = (p) => {
292
- const u = ve(i, (y, x) => p !== x);
293
- h([...u]);
286
+ const i = Ct(s);
287
+ return m(i == null ? void 0 : i.key) || m(i == null ? void 0 : i.value);
288
+ }, [n, s]), o = (i) => {
289
+ const g = ye(s, (x) => x.key !== i.key);
290
+ d([...g, i]), h([...g, i]);
291
+ }, p = (i) => {
292
+ const g = ye(s, (x, u) => i !== u);
293
+ h([...g]);
294
294
  }, h = H(
295
- (p = []) => {
296
- if (a(p), b(p)) {
297
- l({});
295
+ (i = []) => {
296
+ if (d(i), m(i)) {
297
+ a({});
298
298
  return;
299
299
  }
300
- const u = {};
301
- Re(p, (y) => {
302
- !b(y == null ? void 0 : y.key) && !b(y == null ? void 0 : y.value) && qe(u, y.key, y.value);
303
- }), l(u);
300
+ const g = {};
301
+ Ne(i, (x) => {
302
+ !m(x == null ? void 0 : x.key) && !m(x == null ? void 0 : x.value) && We(g, x.key, x.value);
303
+ }), a(g);
304
304
  },
305
- [l]
305
+ [a]
306
306
  );
307
- return b(s) ? /* @__PURE__ */ e.jsx("div", { className: "flex w-full items-center justify-center", children: /* @__PURE__ */ e.jsxs("p", { className: "mb-1.5 text-xs text-gray-500", children: [
307
+ 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
308
  "You have no data providers registered. Please add a data provider to your project. ",
309
309
  /* @__PURE__ */ e.jsx("br", {}),
310
310
  /* @__PURE__ */ e.jsx("a", { className: "text-blue-500", href: "https://chaibuilder.com/docs/registering-data-providers", target: "_blank", children: "Learn more" })
311
311
  ] }) }) : /* @__PURE__ */ e.jsxs("div", { className: "space-y-2", children: [
312
- C(i, (p, u) => /* @__PURE__ */ e.jsx(
313
- as,
312
+ _(s, (i, g) => /* @__PURE__ */ e.jsx(
313
+ es,
314
314
  {
315
- item: p,
315
+ item: i,
316
316
  onAddBinding: o,
317
- onRemove: () => c(u),
317
+ onRemove: () => p(g),
318
318
  selectedBlock: t,
319
319
  dataProvider: n,
320
- appliedBindings: C(i, "key")
320
+ appliedBindings: _(s, "key")
321
321
  },
322
- p.key
322
+ i.key
323
323
  )),
324
324
  /* @__PURE__ */ e.jsxs($, { delayDuration: 200, children: [
325
- /* @__PURE__ */ e.jsx(A, { disabled: b(n), className: "w-full", children: /* @__PURE__ */ e.jsx(
326
- xt,
325
+ /* @__PURE__ */ e.jsx(M, { disabled: m(n), className: "w-full", children: /* @__PURE__ */ e.jsx(
326
+ pt,
327
327
  {
328
- disabled: d,
329
- appliedBindings: C(i, "key"),
328
+ disabled: c,
329
+ appliedBindings: _(s, "key"),
330
330
  onAddBinding: o,
331
331
  children: /* @__PURE__ */ e.jsx(
332
332
  "span",
333
333
  {
334
- className: `w-full rounded-md px-5 py-1.5 text-xs font-medium duration-200 ${d ? "cursor-not-allowed bg-gray-200 text-gray-400" : "bg-blue-700/20 text-blue-800 hover:bg-blue-700/30"}`,
335
- children: b(n) ? /* @__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"
334
+ 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"}`,
335
+ children: m(n) ? /* @__PURE__ */ e.jsx("small", { className: "text-[9.5px] text-gray-500", children: "No data provider has been set up for this page" }) : "+ Add Data Binding"
336
336
  }
337
337
  )
338
338
  }
339
339
  ) }),
340
- d && /* @__PURE__ */ e.jsx(M, { sideOffset: -55, className: "text-[11px]", children: b(n) ? "No data provider has been set up for this page." : "Complete last added data binding to add more" })
340
+ c && /* @__PURE__ */ e.jsx(E, { sideOffset: -55, className: "text-[11px]", children: m(n) ? "No data provider has been set up for this page." : "Complete last added data binding to add more" })
341
341
  ] })
342
342
  ] });
343
- }, ns = () => /* @__PURE__ */ e.jsx("div", { className: "text-xs border rounded-sm p-1 mt-1 border-orange-500 text-orange-500 bg-orange-100", children: "Data binding is set for this field" }), pe = ft(({ id: r, properties: l, formData: t, onChange: n }) => {
344
- const [s, i] = w(t), a = { type: "object", properties: {} }, d = {};
345
- Object.keys(l).forEach((c) => {
346
- const h = l[c];
347
- if (F(["slot", "styles"], h.type))
343
+ }, rs = () => /* @__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" }), Ce = mt(({ id: r, properties: a, formData: t, onChange: n }) => {
344
+ const [l, s] = j(t), d = { type: "object", properties: {} }, c = {};
345
+ Object.keys(a).forEach((p) => {
346
+ const h = a[p];
347
+ if (X(["slot", "styles"], h.type))
348
348
  return;
349
- const p = c;
350
- a.properties[p] = hr(h), d[p] = yr(h);
351
- }), z(() => {
352
- i(t);
349
+ const i = p;
350
+ d.properties[i] = gr(h), c[i] = xr(h);
351
+ }), P(() => {
352
+ s(t);
353
353
  }, [r]);
354
- const o = ue(
355
- async ({ formData: c }, h) => {
356
- n({ formData: c }, h);
354
+ const o = de(
355
+ async ({ formData: p }, h) => {
356
+ n({ formData: p }, h);
357
357
  },
358
358
  [n],
359
359
  1e3
360
360
  // save only every 5 seconds
361
361
  );
362
362
  return /* @__PURE__ */ e.jsx(
363
- Kr,
363
+ Xr,
364
364
  {
365
365
  widgets: {
366
- binding: ns,
367
- richtext: mr,
368
- icon: br,
369
- image: fr
366
+ binding: rs,
367
+ richtext: yr,
368
+ icon: hr,
369
+ image: br
370
370
  },
371
- fields: { link: vr },
371
+ fields: { link: mr },
372
372
  idSeparator: ".",
373
373
  autoComplete: "off",
374
374
  omitExtraData: !1,
375
375
  liveOmit: !1,
376
376
  liveValidate: !1,
377
- validator: Gr,
378
- uiSchema: d,
379
- schema: a,
380
- formData: s,
381
- onChange: ({ formData: c }, h) => {
382
- h && (i(c), o({ formData: c }, h));
377
+ validator: Fr,
378
+ uiSchema: c,
379
+ schema: d,
380
+ formData: l,
381
+ onChange: ({ formData: p }, h) => {
382
+ h && (s(p), o({ formData: p }, h));
383
383
  }
384
384
  }
385
385
  );
386
- }), is = () => {
387
- const [r, l] = qr(), t = jr(), n = (a, d) => {
388
- l((o) => ({ ...o, [a]: d }));
386
+ }), ss = () => {
387
+ const [r, a] = Zr(), t = fr(), n = (d, c) => {
388
+ a((o) => ({ ...o, [d]: c }));
389
389
  };
390
- if (b(t))
390
+ if (m(t))
391
391
  return null;
392
- const { block: s, settings: i } = t;
392
+ const { block: l, settings: s } = t;
393
393
  return /* @__PURE__ */ e.jsxs("div", { className: "text-xs hover:no-underline", children: [
394
394
  /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-x-2 bg-gray-100 px-4 py-2", children: [
395
395
  t.block._type,
396
396
  " settings"
397
397
  ] }),
398
398
  /* @__PURE__ */ e.jsx("div", { className: "bg-white pb-2", children: /* @__PURE__ */ e.jsx(
399
- pe,
399
+ Ce,
400
400
  {
401
- id: s == null ? void 0 : s._id,
402
- onChange: ({ formData: a }) => n(s._id, a),
403
- formData: g(r, s._id, {}),
404
- properties: i
401
+ id: l == null ? void 0 : l._id,
402
+ onChange: ({ formData: d }) => n(l._id, d),
403
+ formData: y(r, l._id, {}),
404
+ properties: s
405
405
  }
406
406
  ) })
407
407
  ] });
408
408
  };
409
- function ds() {
410
- const r = q(), l = at(), t = ot(), n = Pe(r._type), s = { ...r }, [i, a] = w(s), d = wr("dataBindingSupport", !1), o = ({ formData: x }, f, j) => {
411
- if (f && (i == null ? void 0 : i._id) === r._id) {
412
- const P = f.replace("root.", "");
413
- t([r._id], { [P]: g(x, P) }, j);
409
+ function as() {
410
+ const r = G(), a = st(), t = at(), n = Re(r._type), l = { ...r }, [s, d] = j(l), c = lt("dataBindingSupport", !1), o = ({ formData: x }, u, v) => {
411
+ if (u && (s == null ? void 0 : s._id) === r._id) {
412
+ const C = u.replace("root.", "");
413
+ t([r._id], { [C]: y(x, C) }, v);
414
414
  }
415
- }, c = H(
416
- kt(({ formData: x }, f, j) => {
417
- o({ formData: x }, f, j), a(x);
415
+ }, p = H(
416
+ kt(({ formData: x }, u, v) => {
417
+ o({ formData: x }, u, v), d(x);
418
418
  }, 1500),
419
419
  [r == null ? void 0 : r._id]
420
- ), h = ({ formData: x }, f) => {
421
- if (f) {
422
- const j = f.replace("root.", "");
423
- l([r._id], Cr(j, g(x, j.split(".")))), c({ formData: x }, f, { [j]: g(i, j) });
420
+ ), h = ({ formData: x }, u) => {
421
+ if (u) {
422
+ const v = u.replace("root.", "");
423
+ a(
424
+ [r._id],
425
+ vr(v, y(x, v.split(".")))
426
+ ), p({ formData: x }, u, { [v]: y(s, v) });
424
427
  }
425
- }, p = {
426
- _name: Mr({
427
- title: "Name",
428
- default: g(r, "_name", r._type)
429
- })
430
- }, u = je(g(s, "_bindings", {})), y = S(() => {
431
- const x = Nt(g(n, "props", {}));
432
- return d && _t(u, (f) => delete x[f]), x;
433
- }, [n, u, d]);
428
+ }, i = he(y(l, "_bindings", {})), g = T(() => {
429
+ const x = Nt(y(n, "props", {}));
430
+ return c && _t(i, (u) => delete x[u]), x;
431
+ }, [n, i, c]);
434
432
  return /* @__PURE__ */ e.jsxs("div", { className: "overflow-x-hidden", children: [
435
- /* @__PURE__ */ e.jsx(pe, { id: r == null ? void 0 : r._id, onChange: h, formData: s, properties: p }),
436
- /* @__PURE__ */ e.jsx("hr", { className: "mt-4" }),
437
- /* @__PURE__ */ e.jsx(is, {}),
438
- d ? /* @__PURE__ */ e.jsxs(nt, { type: "multiple", defaultValue: ["STATIC", "BINDING"], className: "h-full w-full", children: [
439
- /* @__PURE__ */ e.jsxs(Ce, { value: "BINDING", children: [
440
- /* @__PURE__ */ e.jsx(ke, { className: "bg-gray-100 px-3 py-2 text-xs hover:no-underline", children: /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-x-2", children: [
433
+ /* @__PURE__ */ e.jsx(ss, {}),
434
+ c ? /* @__PURE__ */ e.jsxs(ot, { type: "multiple", defaultValue: ["STATIC", "BINDING"], className: "h-full w-full", children: [
435
+ /* @__PURE__ */ e.jsxs(me, { value: "BINDING", children: [
436
+ /* @__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: [
441
437
  /* @__PURE__ */ e.jsx(
442
438
  "div",
443
439
  {
444
- className: `h-[8px] w-[8px] rounded-full ${b(g(r, "_bindings", {})) ? "bg-gray-300" : "bg-blue-500"}`
440
+ className: `h-[8px] w-[8px] rounded-full ${m(y(r, "_bindings", {})) ? "bg-gray-300" : "bg-blue-500"}`
445
441
  }
446
442
  ),
447
443
  "Data Binding"
448
444
  ] }) }),
449
- /* @__PURE__ */ e.jsx(Ne, { className: "px-4 pt-4", children: /* @__PURE__ */ e.jsx(
450
- os,
445
+ /* @__PURE__ */ e.jsx(ve, { className: "px-4 pt-4", children: /* @__PURE__ */ e.jsx(
446
+ ts,
451
447
  {
452
- bindingData: g(r, "_bindings", {}),
448
+ bindingData: y(r, "_bindings", {}),
453
449
  onChange: (x) => {
454
450
  o({ formData: { _bindings: x } }, "root._bindings");
455
451
  }
456
452
  }
457
453
  ) })
458
454
  ] }),
459
- /* @__PURE__ */ e.jsxs(Ce, { value: "STATIC", children: [
460
- /* @__PURE__ */ e.jsx(ke, { className: "bg-gray-100 px-3 py-2 text-xs hover:no-underline", children: /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-x-2", children: [
455
+ /* @__PURE__ */ e.jsxs(me, { value: "STATIC", children: [
456
+ /* @__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: [
461
457
  /* @__PURE__ */ e.jsx("div", { className: "h-[8px] w-[8px] rounded-full bg-blue-500" }),
462
458
  "Static Content"
463
459
  ] }) }),
464
- /* @__PURE__ */ e.jsxs(Ne, { className: "pt-4", children: [
465
- b(u) ? 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: [
460
+ /* @__PURE__ */ e.jsxs(ve, { className: "pt-4", children: [
461
+ 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: [
466
462
  "Data binding is set for ",
467
- /* @__PURE__ */ e.jsx("b", { children: C(u, we).join(", ") }),
463
+ /* @__PURE__ */ e.jsx("b", { children: _(i, be).join(", ") }),
468
464
  " ",
469
- u.length === 1 ? "property" : "properties",
465
+ i.length === 1 ? "property" : "properties",
470
466
  ". Remove data binding to edit static content."
471
467
  ] }),
472
468
  /* @__PURE__ */ e.jsx(
473
- pe,
469
+ Ce,
474
470
  {
475
471
  id: r == null ? void 0 : r._id,
476
472
  onChange: h,
477
- formData: s,
478
- properties: y
473
+ formData: l,
474
+ properties: g
479
475
  }
480
476
  )
481
477
  ] })
482
478
  ] })
483
479
  ] }) : /* @__PURE__ */ e.jsx(
484
- pe,
480
+ Ce,
485
481
  {
486
482
  id: r == null ? void 0 : r._id,
487
483
  onChange: h,
488
- formData: s,
489
- properties: y
484
+ formData: l,
485
+ properties: g
490
486
  }
491
- ),
492
- /* @__PURE__ */ e.jsx("div", { className: "pb-60" })
487
+ )
493
488
  ] });
494
489
  }
495
- const Xe = new Qr(es, {
490
+ const ls = ({ blockId: r }) => {
491
+ const { t: a } = B(), { askAi: t, loading: n, error: l } = jr(), [s, d] = j(""), c = ft(null);
492
+ P(() => {
493
+ var p;
494
+ (p = c.current) == null || p.focus();
495
+ }, []);
496
+ const o = () => {
497
+ l || d("");
498
+ };
499
+ return /* @__PURE__ */ e.jsxs("div", { className: "", children: [
500
+ /* @__PURE__ */ e.jsx("h2", { className: "mb-1 text-sm font-semibold leading-none tracking-tight", children: a("Ask AI") }),
501
+ /* @__PURE__ */ e.jsx(
502
+ wr,
503
+ {
504
+ ref: c,
505
+ value: s,
506
+ onChange: (p) => d(p.target.value),
507
+ placeholder: a("Ask AI to edit styles"),
508
+ className: "w-full border border-gray-400 focus:border-0",
509
+ rows: 3,
510
+ onKeyDown: (p) => {
511
+ p.key === "Enter" && (p.preventDefault(), t("styles", r, s, o));
512
+ }
513
+ }
514
+ ),
515
+ /* @__PURE__ */ e.jsxs("div", { className: "my-2 flex items-center gap-2", children: [
516
+ n ? null : /* @__PURE__ */ e.jsx(
517
+ A,
518
+ {
519
+ disabled: s.trim().length < 5 || n,
520
+ onClick: () => t("styles", r, s, o),
521
+ variant: "default",
522
+ className: "w-fit",
523
+ size: "sm",
524
+ children: n ? /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
525
+ /* @__PURE__ */ e.jsx(Ar, { className: "h-5 w-5 animate-spin" }),
526
+ a("Generating... Please wait")
527
+ ] }) : a("Edit with AI")
528
+ }
529
+ ),
530
+ n ? /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col gap-2", children: [
531
+ /* @__PURE__ */ e.jsxs(Cr, { className: "flex w-full items-center space-x-1 px-4 py-1 pl-2", children: [
532
+ /* @__PURE__ */ e.jsx(kr, { className: "h-4 w-4 animate-spin text-gray-500" }),
533
+ /* @__PURE__ */ e.jsx("p", { className: "text-xs", children: a("Generating... Please wait") })
534
+ ] }),
535
+ /* @__PURE__ */ e.jsx(A, { variant: "destructive", onClick: () => stop(), className: "hidden w-fit", size: "sm", children: a("Stop") })
536
+ ] }) : null
537
+ ] })
538
+ ] });
539
+ }, Oe = new Ur(Gr, {
496
540
  isCaseSensitive: !1,
497
541
  threshold: 0.2,
498
542
  minMatchCharLength: 2,
499
543
  keys: ["name"]
500
544
  });
501
- function cs() {
502
- var U;
503
- const [r] = ge(), l = q(), t = De(), n = it(), [s] = dt(), [i, a] = w(""), { toast: d } = ct(), o = (U = oe(r)) == null ? void 0 : U.prop, c = St((g(l, o, "").replace(rs, "").split(",").pop() || "").split(" "), b), h = () => {
504
- const k = i.trim().toLowerCase().replace(/ +(?= )/g, "").split(" ");
505
- t(s, k, !0), a("");
506
- }, [p, u] = w([]), y = ({ value: k }) => {
507
- const _ = k.trim().toLowerCase(), D = _.match(/.+:/g);
508
- let E = [];
509
- if (D && D.length > 0) {
510
- const [K] = D, m = _.replace(K, "");
511
- E = Xe.search(m).map((N) => ({
512
- ...N,
513
- item: { ...N.item, name: K + N.item.name }
545
+ function ut() {
546
+ var S;
547
+ const { t: r } = B(), [a] = pe(), t = G(), n = Te(), l = nt(), [s] = it(), d = lt("askAiCallBack", null), [c, o] = j(""), { toast: p } = dt(), h = (S = ae(a)) == null ? void 0 : S.prop, i = St((y(t, h, "").replace(qr, "").split(",").pop() || "").split(" "), m), g = () => {
548
+ const w = c.trim().toLowerCase().replace(/ +(?= )/g, "").split(" ");
549
+ n(s, w, !0), o("");
550
+ }, [x, u] = j([]), v = ({ value: w }) => {
551
+ const D = w.trim().toLowerCase(), Z = D.match(/.+:/g);
552
+ let b = [];
553
+ if (Z && Z.length > 0) {
554
+ const [f] = Z, N = D.replace(f, "");
555
+ b = Oe.search(N).map((z) => ({
556
+ ...z,
557
+ item: { ...z.item, name: f + z.item.name }
514
558
  }));
515
559
  } else
516
- E = Xe.search(_);
517
- u(C(E, "item"));
518
- }, x = () => {
560
+ b = Oe.search(D);
561
+ return u(_(b, "item"));
562
+ }, C = () => {
519
563
  u([]);
520
- }, f = (k) => k.name, j = (k) => /* @__PURE__ */ e.jsx("div", { className: "rounded-md p-1", children: k.name }), P = {
564
+ }, U = (w) => w.name, L = (w) => /* @__PURE__ */ e.jsx("div", { className: "rounded-md p-1", children: w.name }), K = {
521
565
  autoComplete: "off",
522
566
  autoCorrect: "off",
523
567
  autoCapitalize: "off",
524
568
  spellCheck: !1,
525
- placeholder: "Enter class name",
526
- value: i,
527
- onKeyDown: (k) => {
528
- k.key === "Enter" && i.trim() !== "" && h();
569
+ placeholder: r("Enter classes separated by space"),
570
+ value: c,
571
+ onKeyDown: (w) => {
572
+ w.key === "Enter" && c.trim() !== "" && g();
529
573
  },
530
- onChange: (k, { newValue: _ }) => a(_),
574
+ onChange: (w, { newValue: D }) => o(D),
531
575
  className: "w-full rounded-md text-xs px-2 hover:outline-0 bg-background border-border py-1"
532
- }, L = () => {
576
+ }, q = () => {
533
577
  if (navigator.clipboard === void 0) {
534
- d({
578
+ p({
535
579
  title: "Clipboard not supported",
536
580
  description: "Please use Chrome, Firefox or Safari",
537
581
  variant: "destructive"
538
582
  });
539
583
  return;
540
584
  }
541
- navigator.clipboard.writeText(c.join(" ")), d({
585
+ navigator.clipboard.writeText(i.join(" ")), p({
542
586
  title: "Copied",
543
587
  description: "Classes copied to clipboard"
544
588
  });
@@ -546,83 +590,209 @@ function cs() {
546
590
  return /* @__PURE__ */ e.jsxs(
547
591
  "div",
548
592
  {
549
- className: `no-scrollbar flex ${p.length > 0 ? "min-h-[300px]" : "min-h-max"} w-full flex-col gap-y-5 overflow-y-auto bg-gray-100 px-px`,
593
+ 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`,
550
594
  children: [
551
- /* @__PURE__ */ e.jsxs(pt, { className: "mt-2 flex items-center gap-x-2", children: [
552
- /* @__PURE__ */ e.jsx("span", { children: "Add Tailwind classes" }),
553
- /* @__PURE__ */ e.jsxs($, { children: [
554
- /* @__PURE__ */ e.jsx(A, { asChild: !0, children: /* @__PURE__ */ e.jsx(Bt, { onClick: L, className: "cursor-pointer" }) }),
555
- /* @__PURE__ */ e.jsx(M, { children: /* @__PURE__ */ e.jsx("p", { children: "Copy classes to clipboard" }) })
556
- ] })
595
+ /* @__PURE__ */ e.jsxs("div", { className: "flex items-center justify-between gap-x-2", children: [
596
+ /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-x-2", children: [
597
+ /* @__PURE__ */ e.jsx("span", { children: r("Classes") }),
598
+ /* @__PURE__ */ e.jsxs($, { children: [
599
+ /* @__PURE__ */ e.jsx(M, { asChild: !0, children: /* @__PURE__ */ e.jsx(It, { onClick: q, className: "cursor-pointer" }) }),
600
+ /* @__PURE__ */ e.jsx(E, { children: /* @__PURE__ */ e.jsx("p", { children: r("Copy classes to clipboard") }) })
601
+ ] })
602
+ ] }),
603
+ d ? /* @__PURE__ */ e.jsxs(Qe, { children: [
604
+ /* @__PURE__ */ e.jsx(et, { children: /* @__PURE__ */ e.jsxs(A, { variant: "default", className: "h-6 w-fit", size: "sm", children: [
605
+ /* @__PURE__ */ e.jsx($r, { className: "h-4 w-4" }),
606
+ /* @__PURE__ */ e.jsx("span", { className: "ml-2", children: r("Ask AI") })
607
+ ] }) }),
608
+ /* @__PURE__ */ e.jsx(tt, { side: "left", className: "p-2", children: /* @__PURE__ */ e.jsx(ls, { blockId: t == null ? void 0 : t._id }) })
609
+ ] }) : null
557
610
  ] }),
558
- /* @__PURE__ */ e.jsxs("div", { className: "relative -mt-4 flex items-center gap-x-3", children: [
611
+ /* @__PURE__ */ e.jsxs("div", { className: "relative flex items-center gap-x-3", children: [
559
612
  /* @__PURE__ */ e.jsx("div", { className: "relative flex w-full items-center gap-x-3", children: /* @__PURE__ */ e.jsx(
560
- Jr,
613
+ Wr,
561
614
  {
562
- suggestions: p,
563
- onSuggestionsFetchRequested: y,
564
- onSuggestionsClearRequested: x,
565
- getSuggestionValue: f,
566
- renderSuggestion: j,
567
- inputProps: P,
615
+ suggestions: x,
616
+ onSuggestionsFetchRequested: v,
617
+ onSuggestionsClearRequested: C,
618
+ getSuggestionValue: U,
619
+ renderSuggestion: L,
620
+ inputProps: K,
568
621
  containerProps: {
569
622
  className: "relative h-8 w-full gap-y-1 py-1 border-gray-600"
570
623
  },
571
624
  theme: {
572
625
  suggestion: "bg-transparent",
573
- suggestionHighlighted: "bg-gray-700 ",
626
+ suggestionHighlighted: "!bg-gray-300 ",
574
627
  suggestionsContainerOpen: "absolute bg-gray-100 z-50 max-h-[230px] overflow-y-auto w-full border border-gray-600 rounded-md"
575
628
  }
576
629
  }
577
630
  ) }),
578
631
  /* @__PURE__ */ e.jsx(
579
- G,
632
+ A,
580
633
  {
581
634
  variant: "outline",
582
635
  className: "h-6 border-gray-700",
583
- onClick: h,
584
- disabled: i.trim() === "",
636
+ onClick: g,
637
+ disabled: c.trim() === "",
585
638
  size: "sm",
586
- children: /* @__PURE__ */ e.jsx(Ve, {})
639
+ children: /* @__PURE__ */ e.jsx(_e, {})
587
640
  }
588
641
  )
589
642
  ] }),
590
- /* @__PURE__ */ e.jsxs("div", { className: "flex w-full flex-wrap gap-2", children: [
591
- b(c) && /* @__PURE__ */ e.jsx("div", { className: "flex h-10 w-full items-center justify-center text-center text-sm text-gray-400", children: "No class added" }),
592
- de.Children.toArray(
593
- c.map((k) => /* @__PURE__ */ e.jsxs(
594
- "div",
595
- {
596
- className: "group relative truncate max-w-[260px] flex cursor-default items-center gap-x-1 rounded-full border border-blue-600 bg-blue-500 p-px px-1.5 text-[11px] text-white hover:border-blue-900",
597
- children: [
598
- k,
599
- /* @__PURE__ */ e.jsx(
600
- et,
601
- {
602
- onClick: () => n(s, [k]),
603
- className: "invisible absolute right-1 hover:text-white group-hover:visible group-hover:cursor-pointer "
604
- }
605
- )
606
- ]
607
- },
608
- k
609
- ))
610
- )
611
- ] })
643
+ /* @__PURE__ */ e.jsx("div", { className: "flex w-full flex-wrap gap-2 overflow-x-hidden", children: ne.Children.toArray(
644
+ i.map((w) => /* @__PURE__ */ e.jsxs(
645
+ "div",
646
+ {
647
+ 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",
648
+ children: [
649
+ w,
650
+ /* @__PURE__ */ e.jsx(
651
+ Ge,
652
+ {
653
+ onClick: () => l(s, [w]),
654
+ className: "invisible absolute right-1 rounded-full bg-red-400 hover:text-white group-hover:visible group-hover:cursor-pointer"
655
+ }
656
+ )
657
+ ]
658
+ },
659
+ w
660
+ ))
661
+ ) })
612
662
  ]
613
663
  }
614
664
  );
615
665
  }
616
- const B = ["px", "%", "em", "rem", "ch", "vh", "vw"], ps = {
666
+ const os = ({ onAdd: r }) => {
667
+ const { t: a } = B(), [t, n] = j({ key: "", value: "" }), l = () => {
668
+ m(t.key) || (r({ ...t, key: Tt(t.key) }), n({ key: "", value: "" }));
669
+ };
670
+ return /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col gap-1 border-gray-200", children: [
671
+ /* @__PURE__ */ e.jsx(
672
+ je,
673
+ {
674
+ name: "key",
675
+ className: "h-6",
676
+ onChange: (s) => n({ ...t, key: s.target.value }),
677
+ value: t.key,
678
+ placeholder: a("Name"),
679
+ autoComplete: "off",
680
+ autoCapitalize: "off",
681
+ onKeyDown: (s) => {
682
+ s.key === "Enter" && (s.preventDefault(), m(t.key) || l());
683
+ }
684
+ }
685
+ ),
686
+ /* @__PURE__ */ e.jsx("div", { className: "flex items-center gap-x-1.5", children: /* @__PURE__ */ e.jsx(
687
+ je,
688
+ {
689
+ className: "h-6",
690
+ name: "value",
691
+ onChange: (s) => n({ ...t, value: s.target.value }),
692
+ value: t.value,
693
+ placeholder: a("Value"),
694
+ autoComplete: "off",
695
+ autoCapitalize: "off",
696
+ onKeyDown: (s) => {
697
+ s.key === "Enter" && (s.preventDefault(), m(t.key) || l());
698
+ }
699
+ }
700
+ ) }),
701
+ /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-x-2", children: [
702
+ /* @__PURE__ */ e.jsxs(A, { disabled: m(t.key), onClick: l, size: "sm", className: "flex items-center", children: [
703
+ /* @__PURE__ */ e.jsxs("span", { children: [
704
+ a("Add"),
705
+ " "
706
+ ] }),
707
+ /* @__PURE__ */ e.jsx(_e, {})
708
+ ] }),
709
+ m(t.key) ? null : /* @__PURE__ */ e.jsx(A, { variant: "ghost", onClick: () => n({ key: "", value: "" }), children: a("Cancel") })
710
+ ] })
711
+ ] });
712
+ }, ns = () => {
713
+ const r = G(), [a, t] = j([]), [n] = pe(), l = st(), s = at(), { t: d } = B(), { toast: c } = dt(), o = `${y(n, "0.prop")}_attrs`;
714
+ ne.useEffect(() => {
715
+ const g = _(y(r, o), (x, u) => ({ key: u, value: x }));
716
+ m(g) ? t([]) : t(g);
717
+ }, [y(r, o)]);
718
+ const p = (g) => {
719
+ const x = ye(a, (u, v) => g !== v);
720
+ i(x);
721
+ }, h = (g) => {
722
+ const x = Ze(a, { key: g.key });
723
+ if (x && (x.value.startsWith("dnd-") || x.value.startsWith("#dnd-"))) {
724
+ c({
725
+ title: d("Cannot add predefined attribute"),
726
+ variant: "destructive",
727
+ description: d(`"(${g.key})" cannot be added as it is a predefined attribute for this block`)
728
+ });
729
+ return;
730
+ }
731
+ const u = [...a, g];
732
+ i(u);
733
+ }, i = ne.useCallback(
734
+ (g = []) => {
735
+ const x = {};
736
+ Ne(g, (u) => {
737
+ m(u.key) || We(x, u.key, u.value);
738
+ }), s([y(r, "_id")], { [o]: x });
739
+ },
740
+ [r, l, o]
741
+ );
742
+ return /* @__PURE__ */ e.jsx("div", { className: "flex min-h-max flex-col gap-y-2 overflow-y-auto", children: /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col", children: [
743
+ /* @__PURE__ */ e.jsx("div", { children: /* @__PURE__ */ e.jsxs("ul", { className: "overflow-hidden rounded-md bg-gray-100 p-2 text-xs text-gray-700", children: [
744
+ m(a) ? /* @__PURE__ */ e.jsx("li", { className: "flex h-4 items-center justify-center", children: /* @__PURE__ */ e.jsx("p", { children: d("No custom attributes added yet") }) }) : /* @__PURE__ */ e.jsx("li", { children: /* @__PURE__ */ e.jsx("span", { className: "font-bold", children: d("Attributes") }) }),
745
+ ne.Children.toArray(
746
+ _(a, (g) => /* @__PURE__ */ e.jsxs("li", { className: "group flex max-w-full items-center justify-between", children: [
747
+ /* @__PURE__ */ e.jsxs($, { delayDuration: 1e3, children: [
748
+ /* @__PURE__ */ e.jsx(M, { asChild: !0, children: /* @__PURE__ */ e.jsxs("div", { className: "w-[90%] cursor-default truncate px-1 hover:bg-gray-200", children: [
749
+ g.key,
750
+ " ",
751
+ /* @__PURE__ */ e.jsx("span", { className: "font-bold text-orange-500", children: "=" }),
752
+ " ",
753
+ g.value
754
+ ] }) }),
755
+ /* @__PURE__ */ e.jsxs(E, { className: "max-w-[200px]", children: [
756
+ /* @__PURE__ */ e.jsxs("div", { children: [
757
+ d("Name"),
758
+ ": ",
759
+ g.key
760
+ ] }),
761
+ /* @__PURE__ */ e.jsxs("div", { children: [
762
+ d("Value"),
763
+ ": ",
764
+ g.value
765
+ ] })
766
+ ] })
767
+ ] }),
768
+ /* @__PURE__ */ e.jsxs($, { children: [
769
+ /* @__PURE__ */ e.jsx(M, { asChild: !0, children: /* @__PURE__ */ e.jsx(
770
+ "button",
771
+ {
772
+ disabled: W(g.value, "dnd-"),
773
+ className: "invisible group-hover:visible",
774
+ onClick: () => p(a.indexOf(g)),
775
+ children: /* @__PURE__ */ e.jsx(Mr, { className: "w-4 text-gray-500" })
776
+ }
777
+ ) }),
778
+ /* @__PURE__ */ e.jsx(E, { className: "max-w-[200px]", children: W(g.value, "dnd-") ? d("Predefined attribute. Cannot be deleted") : d("Remove attribute") })
779
+ ] })
780
+ ] }))
781
+ )
782
+ ] }) }),
783
+ /* @__PURE__ */ e.jsx("div", { className: "py-2" }),
784
+ /* @__PURE__ */ e.jsx(os, { onAdd: (g) => h(g) })
785
+ ] }) });
786
+ }, k = ["px", "%", "em", "rem", "ch", "vh", "vw"], is = {
617
787
  heading: "flex.heading",
618
788
  items: [
619
- { type: "arbitrary", label: "flex.basis", units: B, property: "flexBasis" },
789
+ { type: "arbitrary", label: "flex.basis", units: k, property: "flexBasis" },
620
790
  { type: "range", label: "flex.order", property: "order" },
621
791
  { type: "dropdown", label: "flex.flex", property: "flexGrowShrink" },
622
792
  { type: "dropdown", label: "flex.grow", property: "flexGrow" },
623
793
  { type: "dropdown", label: "flex.shrink", property: "flexShrink" }
624
794
  ]
625
- }, us = {
795
+ }, ds = {
626
796
  heading: "grid.heading",
627
797
  items: [
628
798
  { type: "range", label: "grid.col_span", property: "gridColSpan" },
@@ -633,17 +803,83 @@ const B = ["px", "%", "em", "rem", "ch", "vh", "vw"], ps = {
633
803
  { type: "range", label: "grid.row_end", property: "gridRowEnd" },
634
804
  { type: "range", label: "grid.order", property: "order" }
635
805
  ]
636
- }, xs = [
806
+ }, cs = [
807
+ {
808
+ heading: "Styles",
809
+ items: [
810
+ { component: ut },
811
+ { type: "arbitrary", label: "layout.width", units: k.concat("auto"), property: "width" },
812
+ { type: "arbitrary", label: "layout.height", units: k.concat("auto"), property: "height" },
813
+ {
814
+ styleType: "multiple",
815
+ label: "layout.margin",
816
+ negative: !0,
817
+ units: [...k, "auto"],
818
+ options: [
819
+ { key: "margin", label: "layout.margin_all" },
820
+ { key: "marginX", label: "layout.margin_lr" },
821
+ { key: "marginY", label: "layout.margin_tb" },
822
+ { key: "marginTop", label: "layout.margin_top" },
823
+ { key: "marginRight", label: "layout.margin_right" },
824
+ { key: "marginBottom", label: "layout.margin_bottom" },
825
+ { key: "marginLeft", label: "layout.margin_left" }
826
+ ]
827
+ },
828
+ {
829
+ styleType: "multiple",
830
+ label: "layout.padding",
831
+ options: [
832
+ { key: "padding", label: "layout.padding_all" },
833
+ { key: "paddingX", label: "layout.padding_lr" },
834
+ { key: "paddingY", label: "layout.padding_tb" },
835
+ { key: "paddingTop", label: "layout.padding_top" },
836
+ { key: "paddingRight", label: "layout.padding_right" },
837
+ { key: "paddingBottom", label: "layout.padding_bottom" },
838
+ { key: "paddingLeft", label: "layout.padding_left" }
839
+ ]
840
+ },
841
+ {
842
+ styleType: "accordion",
843
+ heading: "Typography",
844
+ items: [
845
+ { type: "dropdown", property: "textAlign", label: "typography.align" },
846
+ { type: "dropdown", property: "fontFamily", label: "typography.font" },
847
+ { type: "arbitrary", property: "fontSize", label: "typography.size", units: k },
848
+ { type: "arbitrary", property: "lineHeight", label: "typography.height", units: k.concat("-") },
849
+ { type: "range", property: "fontWeight", label: "typography.weight" },
850
+ { type: "color", property: "textColor", label: "typography.color" }
851
+ ]
852
+ },
853
+ {
854
+ styleType: "accordion",
855
+ heading: "Background",
856
+ items: [
857
+ { type: "color", label: "background.bgcolor", property: "backgroundColor" },
858
+ { type: "dropdown", label: "background.attachment", property: "backgroundAttachment" },
859
+ { type: "dropdown", label: "background.clipping", property: "backgroundClip" },
860
+ { type: "dropdown", label: "background.origin", property: "backgroundOrigin" },
861
+ { type: "dropdown", label: "background.position", property: "backgroundPosition" },
862
+ { type: "dropdown", label: "background.repeat", property: "backgroundRepeat" },
863
+ { type: "dropdown", label: "background.size", property: "backgroundSize" }
864
+ ]
865
+ }
866
+ ]
867
+ },
868
+ {
869
+ heading: "Attributes",
870
+ items: [{ component: ns }]
871
+ }
872
+ ], Ta = [
637
873
  {
638
874
  heading: "layout.heading",
639
875
  items: [
640
- { type: "arbitrary", label: "layout.width", units: B.concat("auto"), property: "width" },
641
- { type: "arbitrary", label: "layout.height", units: B.concat("auto"), property: "height" },
876
+ { type: "arbitrary", label: "layout.width", units: k.concat("auto"), property: "width" },
877
+ { type: "arbitrary", label: "layout.height", units: k.concat("auto"), property: "height" },
642
878
  {
643
879
  styleType: "multiple",
644
880
  label: "layout.margin",
645
881
  negative: !0,
646
- units: [...B, "auto"],
882
+ units: [...k, "auto"],
647
883
  options: [
648
884
  { key: "margin", label: "layout.margin_all" },
649
885
  { key: "marginX", label: "layout.margin_lr" },
@@ -684,16 +920,16 @@ const B = ["px", "%", "em", "rem", "ch", "vh", "vw"], ps = {
684
920
  styleType: "accordion",
685
921
  heading: "size.min_width_height",
686
922
  items: [
687
- { type: "arbitrary", label: "size.min_width", units: B.concat("auto"), property: "minWidth" },
688
- { type: "arbitrary", label: "size.min_height", units: B.concat("auto"), property: "minHeight" }
923
+ { type: "arbitrary", label: "size.min_width", units: k.concat("auto"), property: "minWidth" },
924
+ { type: "arbitrary", label: "size.min_height", units: k.concat("auto"), property: "minHeight" }
689
925
  ]
690
926
  },
691
927
  {
692
928
  styleType: "accordion",
693
929
  heading: "size.max_width_height",
694
930
  items: [
695
- { type: "arbitrary", label: "size.max_width", units: B.concat("auto"), property: "maxWidth" },
696
- { type: "arbitrary", label: "size.max_height", units: B.concat("auto"), property: "maxHeight" }
931
+ { type: "arbitrary", label: "size.max_width", units: k.concat("auto"), property: "maxWidth" },
932
+ { type: "arbitrary", label: "size.max_height", units: k.concat("auto"), property: "maxHeight" }
697
933
  ]
698
934
  },
699
935
  {
@@ -710,7 +946,7 @@ const B = ["px", "%", "em", "rem", "ch", "vh", "vw"], ps = {
710
946
  {
711
947
  heading: "display.heading",
712
948
  items: [
713
- { type: "dropdown", label: "display.display", property: "display", units: B },
949
+ { type: "dropdown", label: "display.display", property: "display", units: k },
714
950
  {
715
951
  styleType: "accordion",
716
952
  heading: "display.flex_options",
@@ -761,7 +997,7 @@ const B = ["px", "%", "em", "rem", "ch", "vh", "vw"], ps = {
761
997
  styleType: "accordion",
762
998
  heading: "display.visibility_opacity",
763
999
  items: [
764
- { type: "dropdown", label: "display.visibility", property: "visibility", units: B },
1000
+ { type: "dropdown", label: "display.visibility", property: "visibility", units: k },
765
1001
  { type: "arbitrary", label: "display.opacity", property: "opacity", units: ["-"] }
766
1002
  ]
767
1003
  }
@@ -837,8 +1073,8 @@ const B = ["px", "%", "em", "rem", "ch", "vh", "vw"], ps = {
837
1073
  heading: "typography.heading",
838
1074
  items: [
839
1075
  { type: "dropdown", property: "fontFamily", label: "typography.font" },
840
- { type: "arbitrary", property: "fontSize", label: "typography.size", units: B },
841
- { type: "arbitrary", property: "lineHeight", label: "typography.height", units: B.concat("-") },
1076
+ { type: "arbitrary", property: "fontSize", label: "typography.size", units: k },
1077
+ { type: "arbitrary", property: "lineHeight", label: "typography.height", units: k.concat("-") },
842
1078
  { type: "range", property: "fontWeight", label: "typography.weight" },
843
1079
  { type: "color", property: "textColor", label: "typography.color" },
844
1080
  {
@@ -1035,89 +1271,89 @@ const B = ["px", "%", "em", "rem", "ch", "vh", "vw"], ps = {
1035
1271
  },
1036
1272
  {
1037
1273
  heading: "classes.heading",
1038
- items: [{ component: cs }]
1274
+ items: [{ component: ut }]
1039
1275
  }
1040
1276
  ], gt = {
1041
1277
  "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" }) }),
1042
1278
  // visibility
1043
1279
  visible: Pt,
1044
- invisible: Ae,
1280
+ invisible: Be,
1045
1281
  // display
1046
- hidden: Ae,
1047
- gap: O,
1048
- gapX: T,
1049
- gapY: R,
1050
- spaceX: T,
1051
- spaceY: R,
1052
- overscroll: O,
1053
- overscrollX: T,
1054
- overscrollY: R,
1055
- overflow: O,
1056
- overflowX: T,
1057
- overflowY: R,
1058
- top: ee,
1059
- right: te,
1060
- bottom: re,
1061
- left: se,
1062
- inset: O,
1063
- insetX: T,
1064
- insetY: R,
1065
- border: O,
1066
- borderX: T,
1067
- borderY: R,
1068
- borderTop: ee,
1069
- borderRight: te,
1070
- borderBottom: re,
1071
- borderLeft: se,
1072
- borderRadius: O,
1073
- borderRadiusX: T,
1074
- borderRadiusY: R,
1075
- borderRadiusTop: ee,
1076
- borderRadiusRight: te,
1077
- borderRadiusBottom: re,
1078
- borderRadiusLeft: se,
1079
- borderRadiusTopLeft: It,
1282
+ hidden: Be,
1283
+ gap: Y,
1284
+ gapX: R,
1285
+ gapY: V,
1286
+ spaceX: R,
1287
+ spaceY: V,
1288
+ overscroll: Y,
1289
+ overscrollX: R,
1290
+ overscrollY: V,
1291
+ overflow: Y,
1292
+ overflowX: R,
1293
+ overflowY: V,
1294
+ top: J,
1295
+ right: Q,
1296
+ bottom: ee,
1297
+ left: te,
1298
+ inset: Y,
1299
+ insetX: R,
1300
+ insetY: V,
1301
+ border: Y,
1302
+ borderX: R,
1303
+ borderY: V,
1304
+ borderTop: J,
1305
+ borderRight: Q,
1306
+ borderBottom: ee,
1307
+ borderLeft: te,
1308
+ borderRadius: Y,
1309
+ borderRadiusX: R,
1310
+ borderRadiusY: V,
1311
+ borderRadiusTop: J,
1312
+ borderRadiusRight: Q,
1313
+ borderRadiusBottom: ee,
1314
+ borderRadiusLeft: te,
1315
+ borderRadiusTopLeft: At,
1080
1316
  borderRadiusTopRight: $t,
1081
- borderRadiusBottomRight: At,
1082
- borderRadiusBottomLeft: Mt,
1083
- divideXWidth: T,
1084
- divideYWidth: R,
1085
- scale: O,
1086
- scaleX: T,
1087
- scaleY: R,
1088
- skewX: T,
1089
- skewY: R,
1090
- translateX: T,
1091
- translateY: R,
1317
+ borderRadiusBottomRight: Mt,
1318
+ borderRadiusBottomLeft: Et,
1319
+ divideXWidth: R,
1320
+ divideYWidth: V,
1321
+ scale: Y,
1322
+ scaleX: R,
1323
+ scaleY: V,
1324
+ skewX: R,
1325
+ skewY: V,
1326
+ translateX: R,
1327
+ translateY: V,
1092
1328
  // padding
1093
- padding: O,
1094
- paddingX: T,
1095
- paddingY: R,
1096
- paddingTop: ee,
1097
- paddingRight: te,
1098
- paddingBottom: re,
1099
- paddingLeft: se,
1329
+ padding: Y,
1330
+ paddingX: R,
1331
+ paddingY: V,
1332
+ paddingTop: J,
1333
+ paddingRight: Q,
1334
+ paddingBottom: ee,
1335
+ paddingLeft: te,
1100
1336
  // margin
1101
- margin: O,
1102
- marginX: T,
1103
- marginY: R,
1104
- marginTop: ee,
1105
- marginRight: te,
1106
- marginBottom: re,
1107
- marginLeft: se,
1337
+ margin: Y,
1338
+ marginX: R,
1339
+ marginY: V,
1340
+ marginTop: J,
1341
+ marginRight: Q,
1342
+ marginBottom: ee,
1343
+ marginLeft: te,
1108
1344
  // text-align
1109
1345
  textLeft: Lt,
1110
- textCenter: Et,
1111
- textRight: Ot,
1112
- textJustify: Ft,
1346
+ textCenter: Ot,
1347
+ textRight: zt,
1348
+ textJustify: Yt,
1113
1349
  // font style
1114
- italic: Yt,
1350
+ italic: Xt,
1115
1351
  // "not-italic": "",
1116
1352
  // decoration
1117
- underline: zt,
1118
- overline: Xt,
1353
+ underline: Ft,
1354
+ overline: Zt,
1119
1355
  // transform
1120
- uppercase: Zt,
1356
+ uppercase: Wt,
1121
1357
  block: () => /* @__PURE__ */ e.jsxs("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [
1122
1358
  /* @__PURE__ */ e.jsx(
1123
1359
  "path",
@@ -1158,7 +1394,7 @@ const B = ["px", "%", "em", "rem", "ch", "vh", "vw"], ps = {
1158
1394
  }
1159
1395
  )
1160
1396
  ] }),
1161
- "float-none": et,
1397
+ "float-none": Ge,
1162
1398
  // position
1163
1399
  fixed: () => /* @__PURE__ */ e.jsxs("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [
1164
1400
  /* @__PURE__ */ e.jsx(
@@ -1230,41 +1466,41 @@ const B = ["px", "%", "em", "rem", "ch", "vh", "vw"], ps = {
1230
1466
  }
1231
1467
  )
1232
1468
  ] }),
1233
- static: Wt
1234
- }, ne = Ke({ canReset: !1, canChange: !0 }), gs = ({ children: r, canReset: l = !1, canChange: t = !0 }) => (
1469
+ static: Ut
1470
+ }, le = Fe({ canReset: !1, canChange: !0 }), ps = ({ children: r, canReset: a = !1, canChange: t = !0 }) => (
1235
1471
  // eslint-disable-next-line react/jsx-no-constructed-context-values
1236
- /* @__PURE__ */ e.jsx(ne.Provider, { value: { canReset: l, canChange: t }, children: r })
1237
- ), ht = ({ label: r, property: l, onChange: t }) => {
1238
- const n = S(() => g(ye, `${l}.classes`, [""]), [l]), s = ie(l), i = S(() => g(s, "cls", ""), [s]), { canChange: a } = ae(ne), d = /\[.*\]/g.test(i);
1239
- return /* @__PURE__ */ e.jsx("div", { className: r ? "w-full rounded" : "grow", children: d ? /* @__PURE__ */ e.jsxs("div", { className: "flex items-center", children: [
1240
- /* @__PURE__ */ e.jsx(_e, { className: "w-[70%] rounded py-1", readOnly: !0, value: i }),
1472
+ /* @__PURE__ */ e.jsx(le.Provider, { value: { canReset: a, canChange: t }, children: r })
1473
+ ), xt = ({ label: r, property: a, onChange: t }) => {
1474
+ const n = T(() => y(ge, `${a}.classes`, [""]), [a]), l = oe(a), s = T(() => y(l, "cls", ""), [l]), { canChange: d } = se(le), c = /\[.*\]/g.test(s);
1475
+ return /* @__PURE__ */ e.jsx("div", { className: r ? "w-full rounded" : "grow", children: c ? /* @__PURE__ */ e.jsxs("div", { className: "flex items-center", children: [
1476
+ /* @__PURE__ */ e.jsx(je, { className: "w-[70%] rounded py-1", readOnly: !0, value: s }),
1241
1477
  /* @__PURE__ */ e.jsxs($, { delayDuration: 100, children: [
1242
- /* @__PURE__ */ e.jsx(A, { asChild: !0, children: /* @__PURE__ */ e.jsx("button", { type: "button", className: "invisible ml-3 mt-1 text-blue-600 group-hover:visible", children: /* @__PURE__ */ e.jsx(He, {}) }) }),
1243
- /* @__PURE__ */ e.jsx(M, { children: "Current value is using a Tailwind arbitrary value." })
1478
+ /* @__PURE__ */ e.jsx(M, { 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, {}) }) }),
1479
+ /* @__PURE__ */ e.jsx(E, { children: "Current value is using a Tailwind arbitrary value." })
1244
1480
  ] })
1245
1481
  ] }) : /* @__PURE__ */ e.jsx(
1246
- Te,
1482
+ ke,
1247
1483
  {
1248
1484
  rounded: r,
1249
- onChange: (o) => t(o, l),
1250
- selected: i,
1485
+ onChange: (o) => t(o, a),
1486
+ selected: s,
1251
1487
  options: n,
1252
- disabled: !a
1488
+ disabled: !d
1253
1489
  }
1254
1490
  ) });
1255
1491
  };
1256
- function Te({ selected: r, onChange: l, rounded: t = !1, options: n, disabled: s = !1 }) {
1257
- const i = r.replace(/.*:/g, "").trim(), { undo: a, redo: d } = kr();
1492
+ function ke({ selected: r, onChange: a, rounded: t = !1, options: n, disabled: l = !1 }) {
1493
+ const s = r.replace(/.*:/g, "").trim(), { undo: d, redo: c } = Nr();
1258
1494
  return /* @__PURE__ */ e.jsxs(
1259
1495
  "select",
1260
1496
  {
1261
- disabled: !n.length || s,
1497
+ disabled: !n.length || l,
1262
1498
  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`,
1263
- onChange: (o) => l(o.target.value),
1499
+ onChange: (o) => a(o.target.value),
1264
1500
  onKeyDown: (o) => {
1265
- o.ctrlKey && (o.key === "z" && a(), o.key === "y" && d());
1501
+ o.ctrlKey && (o.key === "z" && d(), o.key === "y" && c());
1266
1502
  },
1267
- value: i,
1503
+ value: s,
1268
1504
  children: [
1269
1505
  /* @__PURE__ */ e.jsx("option", { className: "bg-transparent", value: "" }),
1270
1506
  I.Children.toArray(
@@ -1274,57 +1510,57 @@ function Te({ selected: r, onChange: l, rounded: t = !1, options: n, disabled: s
1274
1510
  }
1275
1511
  );
1276
1512
  }
1277
- const hs = ({ property: r, onChange: l }) => {
1278
- const { canReset: t, canChange: n } = ae(ne), s = ie(r), i = S(() => g(s, "cls", ""), [s]), a = S(() => g(ye, `${r}.classes`, [""]), [r]), d = a.indexOf(i) > -1 ? a.indexOf(i) : 0, o = /\[.*\]/g.test(i);
1279
- return /* @__PURE__ */ e.jsx("div", { className: "flex flex-row divide-x divide-solid divide-border rounded border border-border text-xs", children: o ? /* @__PURE__ */ e.jsx("div", { className: "py-[5px] px-2", children: i }) : /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
1513
+ const us = ({ property: r, onChange: a }) => {
1514
+ const { canReset: t, canChange: n } = se(le), l = oe(r), s = T(() => y(l, "cls", ""), [l]), d = T(() => y(ge, `${r}.classes`, [""]), [r]), c = d.indexOf(s) > -1 ? d.indexOf(s) : 0, o = /\[.*\]/g.test(s);
1515
+ return /* @__PURE__ */ e.jsx("div", { className: "flex flex-row divide-x divide-solid divide-border rounded border border-border text-xs", children: o ? /* @__PURE__ */ e.jsx("div", { className: "py-[5px] px-2", children: s }) : /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
1280
1516
  /* @__PURE__ */ e.jsx(
1281
1517
  "button",
1282
1518
  {
1283
1519
  type: "button",
1284
1520
  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",
1285
- disabled: !n && (!t || d - 1 < 0),
1286
- onClick: () => l($e(a, d - 1), r),
1521
+ disabled: !n && (!t || c - 1 < 0),
1522
+ onClick: () => a(He(d, c - 1), r),
1287
1523
  children: /* @__PURE__ */ e.jsx("span", { className: "flex items-center justify-center", children: /* @__PURE__ */ e.jsx(
1288
- Ut,
1524
+ Gt,
1289
1525
  {
1290
- className: !n && (!t || d - 1 < 0) ? "text-gray-500" : "text-black/60 dark:text-white/60"
1526
+ className: !n && (!t || c - 1 < 0) ? "text-gray-500" : "text-black/60 dark:text-white/60"
1291
1527
  }
1292
1528
  ) })
1293
1529
  }
1294
1530
  ),
1295
- /* @__PURE__ */ e.jsx("div", { className: "w-8/12 text-center", children: /* @__PURE__ */ e.jsx(ht, { label: !1, property: r, onChange: l }) }),
1531
+ /* @__PURE__ */ e.jsx("div", { className: "w-8/12 text-center", children: /* @__PURE__ */ e.jsx(xt, { label: !1, property: r, onChange: a }) }),
1296
1532
  /* @__PURE__ */ e.jsx(
1297
1533
  "button",
1298
1534
  {
1299
1535
  type: "button",
1300
1536
  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",
1301
- disabled: !n && (!t || d + 1 >= a.length),
1302
- onClick: () => l($e(a, d + 1), r),
1537
+ disabled: !n && (!t || c + 1 >= d.length),
1538
+ onClick: () => a(He(d, c + 1), r),
1303
1539
  children: /* @__PURE__ */ e.jsx("span", { className: "flex items-center justify-center", children: /* @__PURE__ */ e.jsx(
1304
- Ve,
1540
+ _e,
1305
1541
  {
1306
- className: !n && (!t || d + 1 >= a.length) ? "text-gray-500" : "text-black/60 dark:text-white/60"
1542
+ className: !n && (!t || c + 1 >= d.length) ? "text-gray-500" : "text-black/60 dark:text-white/60"
1307
1543
  }
1308
1544
  ) })
1309
1545
  }
1310
1546
  )
1311
1547
  ] }) });
1312
- }, ys = ({ property: r, onChange: l }) => {
1313
- const t = S(() => g(ye, `${r}.classes`, [""]), [r]), { canChange: n } = ae(ne), s = ie(r), i = S(() => g(s, "cls", ""), [s]);
1314
- return /* @__PURE__ */ e.jsx("div", { className: "flex grow flex-wrap gap-1", children: C(t, (a) => /* @__PURE__ */ e.jsxs($, { children: [
1315
- /* @__PURE__ */ e.jsx(A, { asChild: !0, children: /* @__PURE__ */ e.jsx(
1548
+ }, gs = ({ property: r, onChange: a }) => {
1549
+ const t = T(() => y(ge, `${r}.classes`, [""]), [r]), { canChange: n } = se(le), l = oe(r), s = T(() => y(l, "cls", ""), [l]);
1550
+ return /* @__PURE__ */ e.jsx("div", { className: "flex grow flex-wrap gap-1", children: _(t, (d) => /* @__PURE__ */ e.jsxs($, { children: [
1551
+ /* @__PURE__ */ e.jsx(M, { asChild: !0, children: /* @__PURE__ */ e.jsx(
1316
1552
  "button",
1317
1553
  {
1318
1554
  type: "button",
1319
1555
  disabled: !n,
1320
- onClick: () => l(a, r),
1321
- className: `cursor-pointer rounded border border-gray-600 p-1 disabled:cursor-not-allowed ${i === a ? " bg-blue-500 text-white" : "disabled:bg-gray-600 disabled:text-gray-400"}`,
1322
- children: I.createElement(g(gt, a, tt))
1556
+ onClick: () => a(d, r),
1557
+ className: `cursor-pointer rounded border border-gray-600 p-1 disabled:cursor-not-allowed ${s === d ? " bg-blue-500 text-white" : "disabled:bg-gray-600 disabled:text-gray-400"}`,
1558
+ children: I.createElement(y(gt, d, Ke))
1323
1559
  }
1324
1560
  ) }),
1325
- /* @__PURE__ */ e.jsx(M, { children: Y(le(a)) })
1561
+ /* @__PURE__ */ e.jsx(E, { children: F(re(d)) })
1326
1562
  ] })) });
1327
- }, ms = {
1563
+ }, xs = {
1328
1564
  backgroundColor: "bg",
1329
1565
  textColor: "text",
1330
1566
  borderColor: "border",
@@ -1336,39 +1572,39 @@ const hs = ({ property: r, onChange: l }) => {
1336
1572
  toColor: "to",
1337
1573
  ringColor: "ring",
1338
1574
  ringOffsetColor: "ring-offset"
1339
- }, bs = ({ property: r, onChange: l }) => {
1340
- const t = ie(r), n = S(() => g(t, "cls", ""), [t]), { canChange: s } = ae(ne), [i, a] = w([]), [d, o] = w({ color: "", shade: "" }), c = n.split("-"), h = g(c, "1", ""), p = g(c, "2", ""), u = H(
1575
+ }, ys = ({ property: r, onChange: a }) => {
1576
+ const t = oe(r), n = T(() => y(t, "cls", ""), [t]), { canChange: l } = se(le), [s, d] = j([]), [c, o] = j({ color: "", shade: "" }), p = n.split("-"), h = y(p, "1", ""), i = y(p, "2", ""), g = H(
1341
1577
  // eslint-disable-next-line no-shadow
1342
- (x) => {
1343
- ["current", "inherit", "transparent", "black", "white"].includes(x) ? (a([]), o({ color: x })) : (a(["50", "100", "200", "300", "400", "500", "600", "700", "800", "900"]), o((f) => ({ ...f, color: x, shade: f.shade ? f.shade : "500" })));
1578
+ (u) => {
1579
+ ["current", "inherit", "transparent", "black", "white"].includes(u) ? (d([]), o({ color: u })) : (d(["50", "100", "200", "300", "400", "500", "600", "700", "800", "900"]), o((v) => ({ ...v, color: u, shade: v.shade ? v.shade : "500" })));
1344
1580
  },
1345
- [a, o]
1581
+ [d, o]
1346
1582
  );
1347
- z(() => {
1583
+ P(() => {
1348
1584
  if (["current", "inherit", "transparent", "black", "white"].includes(h))
1349
- return a([]);
1350
- a(["50", "100", "200", "300", "400", "500", "600", "700", "800", "900"]);
1585
+ return d([]);
1586
+ d(["50", "100", "200", "300", "400", "500", "600", "700", "800", "900"]);
1351
1587
  }, [h]);
1352
- const y = H(
1588
+ const x = H(
1353
1589
  // eslint-disable-next-line no-shadow
1354
- (x) => {
1355
- o({ color: h, shade: x });
1590
+ (u) => {
1591
+ o({ color: h, shade: u });
1356
1592
  },
1357
1593
  [h]
1358
1594
  );
1359
- return z(() => {
1595
+ return P(() => {
1360
1596
  o({ color: "", shade: "" });
1361
- }, [t]), z(() => {
1362
- const f = `${g(ms, r, "")}-${d.color}${d.shade ? `-${d.shade}` : ""}`;
1363
- f.match(new RegExp(g(ye, `${r}.regExp`, ""))) && l(f, r);
1364
- }, [d, l, r]), /* @__PURE__ */ e.jsxs("div", { className: "flex flex-row divide-x divide-solid divide-border rounded-lg border border-border text-xs", children: [
1597
+ }, [t]), P(() => {
1598
+ const v = `${y(xs, r, "")}-${c.color}${c.shade ? `-${c.shade}` : ""}`;
1599
+ v.match(new RegExp(y(ge, `${r}.regExp`, ""))) && a(v, r);
1600
+ }, [c, a, r]), /* @__PURE__ */ e.jsxs("div", { className: "flex flex-row divide-x divide-solid divide-border rounded-lg border border-border text-xs", children: [
1365
1601
  /* @__PURE__ */ e.jsx("div", { className: "grow text-center", children: /* @__PURE__ */ e.jsx(
1366
- Te,
1602
+ ke,
1367
1603
  {
1368
- disabled: !s,
1604
+ disabled: !l,
1369
1605
  rounded: !0,
1370
1606
  selected: h,
1371
- onChange: u,
1607
+ onChange: g,
1372
1608
  options: [
1373
1609
  "current",
1374
1610
  "transparent",
@@ -1401,20 +1637,20 @@ const hs = ({ property: r, onChange: l }) => {
1401
1637
  ]
1402
1638
  }
1403
1639
  ) }),
1404
- /* @__PURE__ */ e.jsx("button", { type: "button", className: "grow text-center", children: /* @__PURE__ */ e.jsx(Te, { rounded: !0, selected: p, disabled: !h || !s, onChange: y, options: i }) })
1640
+ /* @__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: s }) })
1405
1641
  ] });
1406
- }, Ze = (r, l) => {
1642
+ }, ze = (r, a) => {
1407
1643
  r = r.toLowerCase();
1408
1644
  let t = r.trim().replace(/ |\+/g, "");
1409
- if ((t === "auto" || t === "none") && l.includes(t))
1645
+ if ((t === "auto" || t === "none") && a.includes(t))
1410
1646
  return { value: "", unit: t };
1411
- const n = l.length ? new RegExp(l.join("|"), "g") : /XXXXXX/g;
1647
+ const n = a.length ? new RegExp(a.join("|"), "g") : /XXXXXX/g;
1412
1648
  t = t.replace(n, "");
1413
- const s = r.match(n), i = s && s.length > 1, a = !b(t) && Number.isNaN(Number(t));
1414
- return i || a ? { error: "Invalid value" } : s && (s[0] === "auto" || s[0] === "none") ? { value: s[0], unit: "" } : { value: t, unit: s ? s[0] : "" };
1649
+ const l = r.match(n), s = l && l.length > 1, d = !m(t) && Number.isNaN(Number(t));
1650
+ return s || d ? { error: "Invalid value" } : l && (l[0] === "auto" || l[0] === "none") ? { value: l[0], unit: "" } : { value: t, unit: l ? l[0] : "" };
1415
1651
  };
1416
- const fs = (r) => {
1417
- const l = r.startsWith("-") ? "-" : "", t = r.split("-").pop();
1652
+ const hs = (r) => {
1653
+ const a = r.startsWith("-") ? "-" : "", t = r.split("-").pop();
1418
1654
  if (["auto", "none"].includes(t))
1419
1655
  return { value: "", unit: t };
1420
1656
  if (t === "px")
@@ -1423,18 +1659,18 @@ const fs = (r) => {
1423
1659
  return { value: "100", unit: r.indexOf("w-") !== -1 ? "vw" : "vh" };
1424
1660
  if (t === "full")
1425
1661
  return { value: "100", unit: "%" };
1426
- if (F(r, "skew-"))
1427
- return { value: `${l}${t}`, unit: "deg" };
1428
- if (F(r, "rotate-"))
1429
- return { value: `${l}${t}`, unit: "deg" };
1430
- if (F(r, "opacity-"))
1662
+ if (X(r, "skew-"))
1663
+ return { value: `${a}${t}`, unit: "deg" };
1664
+ if (X(r, "rotate-"))
1665
+ return { value: `${a}${t}`, unit: "deg" };
1666
+ if (X(r, "opacity-"))
1431
1667
  return { value: `${t / 100}`, unit: "-" };
1432
- if (F(r, "duration-") || F(r, "delay-"))
1668
+ if (X(r, "duration-") || X(r, "delay-"))
1433
1669
  return { value: `${t}`, unit: "ms" };
1434
- if (F(r, "translate-") && !t.includes("/"))
1435
- return { value: `${l}${`${t / 4}`}`, unit: "rem" };
1436
- if (F(r, "scale-"))
1437
- return { value: `${l}${`${t / 100}`}`, unit: "-" };
1670
+ if (X(r, "translate-") && !t.includes("/"))
1671
+ return { value: `${a}${`${t / 4}`}`, unit: "rem" };
1672
+ if (X(r, "scale-"))
1673
+ return { value: `${a}${`${t / 100}`}`, unit: "-" };
1438
1674
  if (W(r, "border")) {
1439
1675
  const n = r.match(/border-?(x|y|t|r|b|l)?\d+/g);
1440
1676
  if (n)
@@ -1537,208 +1773,208 @@ const fs = (r) => {
1537
1773
  if (["max", "min", "fit"].includes(t))
1538
1774
  return { value: r, unit: "class" };
1539
1775
  if (t.includes("/")) {
1540
- const [n, s] = C(t.split("/"), (i) => parseInt(i, 10));
1541
- return { value: l + (n / s * 100).toFixed(2).replace(".00", ""), unit: "%" };
1776
+ const [n, l] = _(t.split("/"), (s) => parseInt(s, 10));
1777
+ return { value: a + (n / l * 100).toFixed(2).replace(".00", ""), unit: "%" };
1542
1778
  }
1543
- return Tt(parseFloat(t)) ? { value: `${l + parseFloat(t) * 4}`, unit: "px" } : { value: t, unit: "class" };
1779
+ return Rt(parseFloat(t)) ? { value: `${a + parseFloat(t) * 4}`, unit: "px" } : { value: t, unit: "class" };
1544
1780
  };
1545
- const vs = (r) => {
1546
- if (b(r))
1781
+ const bs = (r) => {
1782
+ if (m(r))
1547
1783
  return { value: "", unit: "" };
1548
- const l = r.match(/\[.*\]/g);
1549
- if (l === null)
1550
- return js(r);
1551
- const t = g(l, "0", "").replace(/\[|\]/g, ""), n = r.startsWith("-") ? "-" : "", s = oe(t.match(/\d+.\d+|\d+/g));
1552
- return { value: `${n}${s}`, unit: t.replace(s, "") };
1553
- }, js = (r) => b(r) ? { value: "", unit: "" } : fs(r), yt = I.createContext({
1784
+ const a = r.match(/\[.*\]/g);
1785
+ if (a === null)
1786
+ return ms(r);
1787
+ const t = y(a, "0", "").replace(/\[|\]/g, ""), n = r.startsWith("-") ? "-" : "", l = ae(t.match(/\d+.\d+|\d+/g));
1788
+ return { value: `${n}${l}`, unit: t.replace(l, "") };
1789
+ }, ms = (r) => m(r) ? { value: "", unit: "" } : hs(r), yt = I.createContext({
1554
1790
  setDragData: () => {
1555
1791
  }
1556
- }), ws = ({
1792
+ }), fs = ({
1557
1793
  unit: r,
1558
- currentValue: l,
1794
+ currentValue: a,
1559
1795
  onDrag: t,
1560
1796
  onDragEnd: n,
1561
- onDragStart: s,
1562
- negative: i,
1563
- cssProperty: a
1797
+ onDragStart: l,
1798
+ negative: s,
1799
+ cssProperty: d
1564
1800
  }) => {
1565
- const { setDragData: d } = ae(yt);
1801
+ const { setDragData: c } = se(yt);
1566
1802
  return /* @__PURE__ */ e.jsx(
1567
1803
  "button",
1568
1804
  {
1569
1805
  type: "button",
1570
1806
  onMouseDown: (o) => {
1571
- const c = {
1807
+ const p = {
1572
1808
  onDrag: t,
1573
1809
  onDragEnd: n,
1574
1810
  dragging: !0,
1575
1811
  dragStartY: o.pageY,
1576
- dragStartValue: `${l}`,
1812
+ dragStartValue: `${a}`,
1577
1813
  dragUnit: r,
1578
- negative: i,
1579
- cssProperty: a
1814
+ negative: s,
1815
+ cssProperty: d
1580
1816
  };
1581
- s(c), d(c);
1817
+ l(p), c(p);
1582
1818
  },
1583
1819
  color: void 0,
1584
1820
  className: "relative z-50 ml-1 hidden h-6 cursor-row-resize rounded bg-background/70 px-2 group-hover:inline",
1585
1821
  children: /* @__PURE__ */ e.jsx(Kt, {})
1586
1822
  }
1587
1823
  );
1588
- }, Cs = ({ onSelect: r, current: l, units: t }) => /* @__PURE__ */ e.jsx("div", { "data-theme": "light", className: "-m-[7px] -mx-[13px] flex w-9 flex-col", children: t.map((n) => /* @__PURE__ */ e.jsx(
1589
- G,
1824
+ }, vs = ({ 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((n) => /* @__PURE__ */ e.jsx(
1825
+ A,
1590
1826
  {
1591
1827
  className: "h-max rounded-none px-1 py-1 text-right text-[11px] hover:bg-blue-400",
1592
- color: l === n ? "primary" : void 0,
1828
+ color: a === n ? "primary" : void 0,
1593
1829
  size: "sm",
1594
- onClick: (s) => {
1595
- s.stopPropagation(), r(n);
1830
+ onClick: (l) => {
1831
+ l.stopPropagation(), r(n);
1596
1832
  },
1597
1833
  children: n
1598
1834
  },
1599
1835
  n
1600
- )) }), We = 50, ks = (r) => {
1601
- const [l, t] = w(!1), [n, s] = w(""), { currentClass: i, onChange: a, classPrefix: d, cssProperty: o, units: c, negative: h } = r, [p, u] = w(o != null && o.toLowerCase().includes("width") ? "%" : c[0]), [y, x] = w(!1), [f, j] = w(""), [P, L] = w(!1), [U, k] = w(!1);
1602
- z(() => {
1603
- const { value: m, unit: v } = vs(i);
1604
- if (v === "") {
1605
- s(m), u(o != null && o.toLowerCase().includes("width") ? "%" : oe(c));
1836
+ )) }), Ye = 50, js = (r) => {
1837
+ const [a, t] = j(!1), [n, l] = j(""), { currentClass: s, onChange: d, classPrefix: c, cssProperty: o, units: p, negative: h } = r, [i, g] = j(o != null && o.toLowerCase().includes("width") ? "%" : p[0]), [x, u] = j(!1), [v, C] = j(""), [U, L] = j(!1), [K, q] = j(!1);
1838
+ P(() => {
1839
+ const { value: b, unit: f } = bs(s);
1840
+ if (f === "") {
1841
+ l(b), g(o != null && o.toLowerCase().includes("width") ? "%" : ae(p));
1606
1842
  return;
1607
1843
  }
1608
- u(v), s(v === "class" || b(m) ? "" : m);
1609
- }, [i, o, c]);
1610
- const _ = ue((m) => a(m), [a], We), D = ue((m) => a(m, !1), [a], We), E = H(
1611
- (m = !1) => {
1612
- const v = Ze(`${n}`, c);
1613
- if (g(v, "error", !1)) {
1614
- x(!0);
1844
+ g(f), l(f === "class" || m(b) ? "" : b);
1845
+ }, [s, o, p]);
1846
+ const S = de((b) => d(b), [d], Ye), w = de((b) => d(b, !1), [d], Ye), D = H(
1847
+ (b = !1) => {
1848
+ const f = ze(`${n}`, p);
1849
+ if (y(f, "error", !1)) {
1850
+ u(!0);
1615
1851
  return;
1616
1852
  }
1617
- const N = g(v, "unit") !== "" ? g(v, "unit") : p;
1853
+ const N = y(f, "unit") !== "" ? y(f, "unit") : i;
1618
1854
  if (N === "auto" || N === "none") {
1619
- _(`${d}${N}`);
1855
+ S(`${c}${N}`);
1620
1856
  return;
1621
1857
  }
1622
- if (g(v, "value") === "")
1858
+ if (y(f, "value") === "")
1623
1859
  return;
1624
- const Q = `${g(v, "value", "").startsWith("-") ? "-" : ""}${d}[${g(v, "value", "").replace("-", "")}${N === "-" ? "" : N}]`;
1625
- m ? D(Q) : _(Q);
1860
+ const z = `${y(f, "value", "").startsWith("-") ? "-" : ""}${c}[${y(f, "value", "").replace("-", "")}${N === "-" ? "" : N}]`;
1861
+ b ? w(z) : S(z);
1626
1862
  },
1627
- [_, D, n, p, d, c]
1628
- ), K = H(
1629
- (m) => {
1630
- const v = Ze(`${n}`, c);
1631
- if (g(v, "error", !1)) {
1632
- x(!0);
1863
+ [S, w, n, i, c, p]
1864
+ ), Z = H(
1865
+ (b) => {
1866
+ const f = ze(`${n}`, p);
1867
+ if (y(f, "error", !1)) {
1868
+ u(!0);
1633
1869
  return;
1634
1870
  }
1635
- if (m === "auto" || m === "none") {
1636
- _(`${d}${m}`);
1871
+ if (b === "auto" || b === "none") {
1872
+ S(`${c}${b}`);
1637
1873
  return;
1638
1874
  }
1639
- if (g(v, "value") === "")
1875
+ if (y(f, "value") === "")
1640
1876
  return;
1641
- const N = g(v, "unit") !== "" ? g(v, "unit") : m, Q = `${g(v, "value", "").startsWith("-") ? "-" : ""}${d}[${g(v, "value", "").replace("-", "")}${N === "-" ? "" : N}]`;
1642
- _(Q);
1877
+ const N = y(f, "unit") !== "" ? y(f, "unit") : b, z = `${y(f, "value", "").startsWith("-") ? "-" : ""}${c}[${y(f, "value", "").replace("-", "")}${N === "-" ? "" : N}]`;
1878
+ S(z);
1643
1879
  },
1644
- [_, n, d, c]
1880
+ [S, n, c, p]
1645
1881
  );
1646
- return /* @__PURE__ */ e.jsx("div", { className: "flex w-full flex-col", children: /* @__PURE__ */ e.jsx("div", { className: "flex items-center justify-start", children: p === "class" ? /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
1647
- /* @__PURE__ */ e.jsx("input", { className: "w-20 rounded py-1", readOnly: !0, value: i }),
1882
+ 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: [
1883
+ /* @__PURE__ */ e.jsx("input", { className: "w-20 rounded py-1", readOnly: !0, value: s }),
1648
1884
  /* @__PURE__ */ e.jsxs($, { children: [
1649
- /* @__PURE__ */ e.jsx(A, { asChild: !0, children: /* @__PURE__ */ e.jsx("button", { type: "button", className: "invisible ml-3 mt-1 text-blue-600 group-hover:visible", children: /* @__PURE__ */ e.jsx(He, {}) }) }),
1650
- /* @__PURE__ */ e.jsx(M, { children: "Current value is using a Tailwind preset class." })
1885
+ /* @__PURE__ */ e.jsx(M, { 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, {}) }) }),
1886
+ /* @__PURE__ */ e.jsx(E, { children: "Current value is using a Tailwind preset class." })
1651
1887
  ] })
1652
- ] }) : /* @__PURE__ */ e.jsxs("div", { className: `group relative flex items-center ${P ? "z-auto" : ""}`, children: [
1888
+ ] }) : /* @__PURE__ */ e.jsxs("div", { className: `group relative flex items-center ${U ? "z-auto" : ""}`, children: [
1653
1889
  /* @__PURE__ */ e.jsxs("div", { className: "flex items-center rounded-md border border-border", children: [
1654
- ["none", "auto"].indexOf(p) !== -1 ? null : /* @__PURE__ */ e.jsx(
1890
+ ["none", "auto"].indexOf(i) !== -1 ? null : /* @__PURE__ */ e.jsx(
1655
1891
  "input",
1656
1892
  {
1657
- readOnly: p === "class",
1658
- onKeyPress: (m) => {
1659
- m.key === "Enter" && E();
1893
+ readOnly: i === "class",
1894
+ onKeyPress: (b) => {
1895
+ b.key === "Enter" && D();
1660
1896
  },
1661
- onKeyDown: (m) => {
1662
- if (m.keyCode !== 38 && m.keyCode !== 40)
1897
+ onKeyDown: (b) => {
1898
+ if (b.keyCode !== 38 && b.keyCode !== 40)
1663
1899
  return;
1664
- m.preventDefault(), k(!0);
1665
- const v = Rt(m.target.value);
1666
- let N = Je(v) ? 0 : v;
1667
- m.keyCode === 38 && (N += 1), m.keyCode === 40 && (N -= 1);
1668
- const Z = `${N}`, bt = `${Z.startsWith("-") ? "-" : ""}${d}[${Z.replace("-", "")}${p === "-" ? "" : p}]`;
1669
- D(bt);
1900
+ b.preventDefault(), q(!0);
1901
+ const f = Vt(b.target.value);
1902
+ let N = Ue(f) ? 0 : f;
1903
+ b.keyCode === 38 && (N += 1), b.keyCode === 40 && (N -= 1);
1904
+ const O = `${N}`, bt = `${O.startsWith("-") ? "-" : ""}${c}[${O.replace("-", "")}${i === "-" ? "" : i}]`;
1905
+ w(bt);
1670
1906
  },
1671
- onKeyUp: (m) => {
1672
- U && (m.preventDefault(), k(!1));
1907
+ onKeyUp: (b) => {
1908
+ K && (b.preventDefault(), q(!1));
1673
1909
  },
1674
- onBlur: () => E(),
1675
- onChange: (m) => {
1676
- x(!1), s(m.target.value);
1910
+ onBlur: () => D(),
1911
+ onChange: (b) => {
1912
+ u(!1), l(b.target.value);
1677
1913
  },
1678
- onClick: (m) => {
1679
- var v;
1680
- (v = m == null ? void 0 : m.target) == null || v.select(), t(!1);
1914
+ onClick: (b) => {
1915
+ var f;
1916
+ (f = b == null ? void 0 : b.target) == null || f.select(), t(!1);
1681
1917
  },
1682
- value: P ? f : n,
1918
+ value: U ? v : n,
1683
1919
  className: "h-6 w-14 rounded rounded-r-none bg-background pl-2 text-sm focus-visible:outline-0 ".concat(
1684
1920
  " ",
1685
- y ? "border-red-500 text-red-500" : "border-foreground/20"
1921
+ x ? "border-red-500 text-red-500" : "border-foreground/20"
1686
1922
  )
1687
1923
  }
1688
1924
  ),
1689
- /* @__PURE__ */ e.jsxs($, { open: l, delayDuration: 100, children: [
1690
- /* @__PURE__ */ e.jsx(A, { asChild: !0, children: /* @__PURE__ */ e.jsxs(
1925
+ /* @__PURE__ */ e.jsxs($, { open: a, delayDuration: 100, children: [
1926
+ /* @__PURE__ */ e.jsx(M, { asChild: !0, children: /* @__PURE__ */ e.jsxs(
1691
1927
  "button",
1692
1928
  {
1693
1929
  type: "button",
1694
- onClick: () => t(!l),
1930
+ onClick: () => t(!a),
1695
1931
  className: "flex h-6 cursor-pointer items-center gap-x-1 rounded rounded-l-none bg-background p-px px-1 text-[11px] uppercase",
1696
1932
  children: [
1697
- /* @__PURE__ */ e.jsx("span", { className: `inline-block ${c.length === 1 ? "px-2 font-semibold" : ""}`, children: p }),
1698
- c.length > 1 ? /* @__PURE__ */ e.jsx(Gt, {}) : null
1933
+ /* @__PURE__ */ e.jsx("span", { className: `inline-block ${p.length === 1 ? "px-2 font-semibold" : ""}`, children: i }),
1934
+ p.length > 1 ? /* @__PURE__ */ e.jsx(qt, {}) : null
1699
1935
  ]
1700
1936
  }
1701
1937
  ) }),
1702
- /* @__PURE__ */ e.jsx(Nr, { children: /* @__PURE__ */ e.jsx(M, { className: "bg-background", children: /* @__PURE__ */ e.jsx(
1703
- Cs,
1938
+ /* @__PURE__ */ e.jsx(_r, { children: /* @__PURE__ */ e.jsx(E, { className: "bg-background", children: /* @__PURE__ */ e.jsx(
1939
+ vs,
1704
1940
  {
1705
- units: c,
1706
- current: p,
1707
- onSelect: (m) => {
1708
- t(!1), u(m), K(m);
1941
+ units: p,
1942
+ current: i,
1943
+ onSelect: (b) => {
1944
+ t(!1), g(b), Z(b);
1709
1945
  }
1710
1946
  }
1711
1947
  ) }) })
1712
1948
  ] })
1713
1949
  ] }),
1714
- ["none", "auto"].indexOf(p) !== -1 || P ? null : /* @__PURE__ */ e.jsx(
1715
- ws,
1950
+ ["none", "auto"].indexOf(i) !== -1 || U ? null : /* @__PURE__ */ e.jsx(
1951
+ fs,
1716
1952
  {
1717
1953
  onDragStart: () => L(!0),
1718
- onDragEnd: (m) => {
1719
- if (j(() => ""), L(!1), b(m))
1954
+ onDragEnd: (b) => {
1955
+ if (C(() => ""), L(!1), m(b))
1720
1956
  return;
1721
- const v = `${m}`, Z = `${v.startsWith("-") ? "-" : ""}${d}[${v.replace("-", "")}${p === "-" ? "" : p}]`;
1722
- _(Z);
1957
+ const f = `${b}`, O = `${f.startsWith("-") ? "-" : ""}${c}[${f.replace("-", "")}${i === "-" ? "" : i}]`;
1958
+ S(O);
1723
1959
  },
1724
- onDrag: (m) => {
1725
- if (b(m))
1960
+ onDrag: (b) => {
1961
+ if (m(b))
1726
1962
  return;
1727
- j(m);
1728
- const v = `${m}`, Z = `${v.startsWith("-") ? "-" : ""}${d}[${v.replace("-", "")}${p === "-" ? "" : p}]`;
1729
- D(Z);
1963
+ C(b);
1964
+ const f = `${b}`, O = `${f.startsWith("-") ? "-" : ""}${c}[${f.replace("-", "")}${i === "-" ? "" : i}]`;
1965
+ w(O);
1730
1966
  },
1731
1967
  currentValue: n,
1732
- unit: p,
1968
+ unit: i,
1733
1969
  negative: h,
1734
1970
  cssProperty: o
1735
1971
  }
1736
1972
  )
1737
1973
  ] }) }) });
1738
- }, ie = (r) => {
1739
- const l = he();
1740
- return Vt(l, { property: r });
1741
- }, Ns = (r, l) => {
1974
+ }, oe = (r) => {
1975
+ const a = ue();
1976
+ return Ht(a, { property: r });
1977
+ }, ws = (r, a) => {
1742
1978
  const t = {
1743
1979
  xs: 0,
1744
1980
  sm: 1,
@@ -1747,8 +1983,8 @@ const vs = (r) => {
1747
1983
  xl: 4,
1748
1984
  "2xl": 5
1749
1985
  };
1750
- return t[g(r, "mq", "xs")] <= t[l];
1751
- }, _s = {
1986
+ return t[y(r, "mq", "xs")] <= t[a];
1987
+ }, Cs = {
1752
1988
  width: "w-",
1753
1989
  height: "h-",
1754
1990
  minWidth: "min-w-",
@@ -1814,87 +2050,87 @@ const vs = (r) => {
1814
2050
  insetY: "inset-y-",
1815
2051
  opacity: "opacity-",
1816
2052
  flexBasis: "basis-"
1817
- }, Ue = {
2053
+ }, Xe = {
1818
2054
  xs: "",
1819
2055
  sm: "640px",
1820
2056
  md: "768px",
1821
2057
  lg: "1024px",
1822
2058
  xl: "1280px",
1823
2059
  "2xl": "1536px"
1824
- }, Ss = (r) => `${r.toUpperCase()} ${Ue[r] ? `(${Ue[r]} & up)` : ""}`, Ie = (r) => {
1825
- const { t: l } = X(), { type: t = "icons", label: n, property: s, onEmitChange: i = () => {
1826
- }, units: a, negative: d = !1 } = r, [o] = _r(), [c] = ut(), [, h] = Me(), p = ie(s), u = De(), y = it(), [x] = dt(), f = S(() => g(p, "fullCls", ""), [p]), j = H(
1827
- (D, E = !0) => {
1828
- const K = { dark: o, mq: h, mod: c, cls: D, property: s, fullCls: "" };
1829
- (o || c !== "") && (K.mq = "xs");
1830
- const m = ts(K);
1831
- u(x, [m], E);
2060
+ }, ks = (r) => `${r.toUpperCase()} ${Xe[r] ? `(${Xe[r]} & up)` : ""}`, Ve = (r) => {
2061
+ const { t: a } = B(), { type: t = "icons", label: n, property: l, onEmitChange: s = () => {
2062
+ }, units: d, negative: c = !1 } = r, [o] = Sr(), [p] = Tr(), [, h] = Ie(), i = oe(l), g = Te(), x = nt(), [u] = it(), v = T(() => y(i, "fullCls", ""), [i]), C = H(
2063
+ (w, D = !0) => {
2064
+ const Z = { dark: o, mq: h, mod: p, cls: w, property: l, fullCls: "" };
2065
+ (o || p !== "") && (Z.mq = "xs");
2066
+ const b = Kr(Z);
2067
+ g(u, [b], D);
1832
2068
  },
1833
- [x, o, h, c, s, u]
1834
- ), P = H(() => {
1835
- y(x, [f]);
1836
- }, [x, f, y]), L = S(() => Ns(p, h), [p, h]);
1837
- z(() => {
1838
- i(L, p);
1839
- }, [L, i, p]);
1840
- const [, , U] = Me(), k = H(
1841
- (D) => {
1842
- U({
2069
+ [u, o, h, p, l, g]
2070
+ ), U = H(() => {
2071
+ x(u, [v]);
2072
+ }, [u, v, x]), L = T(() => ws(i, h), [i, h]);
2073
+ P(() => {
2074
+ s(L, i);
2075
+ }, [L, s, i]);
2076
+ const [, , K] = Ie(), q = H(
2077
+ (w) => {
2078
+ K({
1843
2079
  xs: 400,
1844
2080
  sm: 640,
1845
2081
  md: 800,
1846
2082
  lg: 1024,
1847
2083
  xl: 1420,
1848
2084
  "2xl": 1920
1849
- }[D]);
2085
+ }[w]);
1850
2086
  },
1851
- [U]
1852
- ), _ = g(p, "dark", null) === o && g(p, "mod", null) === c && g(p, "mq", null) === h;
1853
- return /* @__PURE__ */ e.jsx(gs, { canChange: L, canReset: p && _, children: /* @__PURE__ */ e.jsxs("div", { className: "group flex flex-row items-center py-2 first:pt-0 last:pb-0", children: [
1854
- /* @__PURE__ */ e.jsx("div", { className: "relative w-[70px] truncate text-xs text-foreground", children: /* @__PURE__ */ e.jsx("span", { className: `text-[11px] ${p && !_ ? "text-foreground" : ""}`, children: l(n) }) }),
2087
+ [K]
2088
+ ), S = y(i, "dark", null) === o && y(i, "mod", null) === p && y(i, "mq", null) === h;
2089
+ return /* @__PURE__ */ e.jsx(ps, { canChange: L, canReset: i && S, children: /* @__PURE__ */ e.jsxs("div", { className: "group flex flex-row items-center py-2 first:pt-0 last:pb-0", children: [
2090
+ /* @__PURE__ */ e.jsx("div", { className: "relative w-[70px] truncate text-xs text-foreground", children: /* @__PURE__ */ e.jsx("span", { className: `text-[11px] ${i && !S ? "text-foreground" : ""}`, children: a(n) }) }),
1855
2091
  /* @__PURE__ */ e.jsxs("div", { className: "flex flex-row items-center", children: [
1856
2092
  /* @__PURE__ */ e.jsxs("div", { className: "w-[150px]", children: [
1857
2093
  t === "arbitrary" ? /* @__PURE__ */ e.jsx(
1858
- ks,
2094
+ js,
1859
2095
  {
1860
- currentClass: g(p, "cls", ""),
1861
- classPrefix: g(_s, s, ""),
1862
- units: a || [],
1863
- onChange: j,
1864
- negative: d,
1865
- cssProperty: s
2096
+ currentClass: y(i, "cls", ""),
2097
+ classPrefix: y(Cs, l, ""),
2098
+ units: d || [],
2099
+ onChange: C,
2100
+ negative: c,
2101
+ cssProperty: l
1866
2102
  }
1867
2103
  ) : null,
1868
- t === "icons" && /* @__PURE__ */ e.jsx(ys, { property: s, onChange: j }),
1869
- t === "range" && /* @__PURE__ */ e.jsx(hs, { property: s, onChange: j }),
1870
- t === "color" && /* @__PURE__ */ e.jsx(bs, { property: s, onChange: j }),
1871
- t === "dropdown" && /* @__PURE__ */ e.jsx(ht, { label: n, property: s, onChange: j })
2104
+ t === "icons" && /* @__PURE__ */ e.jsx(gs, { property: l, onChange: C }),
2105
+ t === "range" && /* @__PURE__ */ e.jsx(us, { property: l, onChange: C }),
2106
+ t === "color" && /* @__PURE__ */ e.jsx(ys, { property: l, onChange: C }),
2107
+ t === "dropdown" && /* @__PURE__ */ e.jsx(xt, { label: n, property: l, onChange: C })
1872
2108
  ] }),
1873
- /* @__PURE__ */ e.jsx("div", { className: `w-[30px] cursor-pointer ${f ? "visible" : "invisible"}`, children: _ ? /* @__PURE__ */ e.jsx("button", { type: "button", onClick: () => P(), 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 && p ? /* @__PURE__ */ e.jsxs($, { delayDuration: 100, children: [
1874
- /* @__PURE__ */ e.jsx(A, { asChild: !0, children: /* @__PURE__ */ e.jsx(
2109
+ /* @__PURE__ */ e.jsx("div", { className: `w-[30px] cursor-pointer ${v ? "visible" : "invisible"}`, children: S ? /* @__PURE__ */ e.jsx("button", { type: "button", onClick: () => U(), 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" }) }) : L && i ? /* @__PURE__ */ e.jsxs($, { delayDuration: 100, children: [
2110
+ /* @__PURE__ */ e.jsx(M, { asChild: !0, children: /* @__PURE__ */ e.jsx(
1875
2111
  "button",
1876
2112
  {
1877
2113
  type: "button",
1878
2114
  className: "invisible ml-3 mt-1 rounded-full bg-blue-500 text-white group-hover:visible",
1879
- children: /* @__PURE__ */ e.jsx(He, {})
2115
+ children: /* @__PURE__ */ e.jsx(Se, {})
1880
2116
  }
1881
2117
  ) }),
1882
- /* @__PURE__ */ e.jsx(M, { children: /* @__PURE__ */ e.jsx("div", { className: "text-right", children: /* @__PURE__ */ e.jsxs("div", { children: [
2118
+ /* @__PURE__ */ e.jsx(E, { children: /* @__PURE__ */ e.jsx("div", { className: "text-right", children: /* @__PURE__ */ e.jsxs("div", { children: [
1883
2119
  "Current style is set at  ",
1884
2120
  /* @__PURE__ */ e.jsxs("span", { className: "font-bold", children: [
1885
- Ss(g(p, "mq")),
1886
- o && !p.dark ? "(Light mode)" : ""
2121
+ ks(y(i, "mq")),
2122
+ o && !i.dark ? "(Light mode)" : ""
1887
2123
  ] }),
1888
2124
  /* @__PURE__ */ e.jsx("br", {}),
1889
2125
  /* @__PURE__ */ e.jsxs(
1890
2126
  "button",
1891
2127
  {
1892
2128
  type: "button",
1893
- onClick: () => k(g(p, "mq")),
2129
+ onClick: () => q(y(i, "mq")),
1894
2130
  className: "block w-full cursor-default text-right font-semibold text-blue-500",
1895
2131
  children: [
1896
2132
  "Switch to ",
1897
- g(p, "mq").toUpperCase()
2133
+ y(i, "mq").toUpperCase()
1898
2134
  ]
1899
2135
  }
1900
2136
  )
@@ -1902,307 +2138,151 @@ const vs = (r) => {
1902
2138
  ] }) : null })
1903
2139
  ] })
1904
2140
  ] }) });
1905
- }, Ts = ["px", "%", "em", "rem", "ch", "vh", "vw"], mt = ({
2141
+ }, Ns = ["px", "%", "em", "rem", "ch", "vh", "vw"], ht = ({
1906
2142
  label: r,
1907
- options: l,
2143
+ options: a,
1908
2144
  borderB: t = !1,
1909
2145
  borderT: n = !1,
1910
- type: s = "arbitrary",
1911
- units: i = Ts,
1912
- negative: a = !1
2146
+ type: l = "arbitrary",
2147
+ units: s = Ns,
2148
+ negative: d = !1
1913
2149
  }) => {
1914
- const { t: d } = X(), [o, c] = w(l[0].key), h = he(), p = H((u) => C(h, "property").includes(u), [h]);
2150
+ const { t: c } = B(), [o, p] = j(a[0].key), h = ue(), i = H((g) => _(h, "property").includes(g), [h]);
1915
2151
  return /* @__PURE__ */ e.jsxs(
1916
2152
  "div",
1917
2153
  {
1918
2154
  className: `mb-2 border-gray-800 py-2 first:pt-0 last:pb-0 ${t ? "border-b" : ""} ${n ? "border-t" : ""}`,
1919
2155
  children: [
1920
2156
  /* @__PURE__ */ e.jsxs("div", { className: "flex flex-row text-xs", children: [
1921
- r && /* @__PURE__ */ e.jsx("span", { className: "relative w-[70px] flex-none text-xs text-foreground", children: d(r) }),
2157
+ r && /* @__PURE__ */ e.jsx("span", { className: "relative w-[70px] flex-none text-xs text-foreground", children: c(r) }),
1922
2158
  /* @__PURE__ */ e.jsx("div", { className: "mb-3 flex grow flex-row flex-wrap gap-x-px", children: I.Children.toArray(
1923
- l.map(({ label: u, key: y }) => /* @__PURE__ */ e.jsx("div", { className: "first:rounded-l last:rounded-r", children: /* @__PURE__ */ e.jsxs($, { children: [
1924
- /* @__PURE__ */ e.jsx(A, { asChild: !0, children: /* @__PURE__ */ e.jsxs(
2159
+ a.map(({ label: g, key: x }) => /* @__PURE__ */ e.jsx("div", { className: "first:rounded-l last:rounded-r", children: /* @__PURE__ */ e.jsxs($, { children: [
2160
+ /* @__PURE__ */ e.jsx(M, { asChild: !0, children: /* @__PURE__ */ e.jsxs(
1925
2161
  "button",
1926
2162
  {
1927
2163
  type: "button",
1928
- onClick: () => c(y),
1929
- className: `relative cursor-pointer rounded-full p-1 text-[8px] ${y === o ? " bg-[#3E57F0] text-white" : "text-gray-600 dark:text-gray-300"}`,
2164
+ onClick: () => p(x),
2165
+ className: `relative cursor-pointer rounded-full p-1 text-[8px] ${x === o ? " bg-[#3E57F0] text-white" : "text-gray-600 dark:text-gray-300"}`,
1930
2166
  children: [
1931
2167
  I.createElement("div", {
1932
- className: p(y) ? "-bottom-1.5 absolute bg-[#3E57F0] h-[2px] left-0 w-full" : ""
2168
+ className: i(x) ? "-bottom-1.5 absolute bg-[#3E57F0] h-[2px] left-0 w-full" : ""
1933
2169
  }),
1934
- I.createElement(g(gt, y, tt), { className: "text-inherit w-3 h-3" })
2170
+ I.createElement(y(gt, x, Ke), { className: "text-inherit w-3 h-3" })
1935
2171
  ]
1936
2172
  }
1937
2173
  ) }),
1938
- /* @__PURE__ */ e.jsx(M, { children: Y(le(u)) })
2174
+ /* @__PURE__ */ e.jsx(E, { children: F(re(g)) })
1939
2175
  ] }) }))
1940
2176
  ) })
1941
2177
  ] }),
1942
2178
  /* @__PURE__ */ e.jsx("div", { className: "mt-0 flex items-center", children: /* @__PURE__ */ e.jsx(
1943
- Ie,
2179
+ Ve,
1944
2180
  {
1945
- type: s,
1946
- units: [...i],
2181
+ type: l,
2182
+ units: [...s],
1947
2183
  label: "",
1948
2184
  property: o,
1949
- negative: a
2185
+ negative: d
1950
2186
  }
1951
2187
  ) })
1952
2188
  ]
1953
2189
  }
1954
2190
  );
1955
- }, Rs = ({ heading: r, items: l }) => {
1956
- const { t } = X(), n = he(), s = S(() => {
1957
- const i = (o) => J(
1958
- o.map((c) => c.styleType === "multiple" ? C(c.options, "key") : c.property)
1959
- ), a = J(
1960
- l.map((o) => o.styleType === "accordion" ? i(o.items) : o.styleType === "multiple" ? C(o.options, "key") : o.property)
1961
- ), d = C(n, "property");
1962
- return Qe(a, d).length > 0;
1963
- }, [n, l]);
2191
+ }, _s = ({ heading: r, items: a }) => {
2192
+ const { t } = B(), n = ue(), l = T(() => {
2193
+ const s = (o) => De(
2194
+ o.map((p) => p.styleType === "multiple" ? _(p.options, "key") : p.property)
2195
+ ), d = De(
2196
+ a.map((o) => o.styleType === "accordion" ? s(o.items) : o.styleType === "multiple" ? _(o.options, "key") : o.property)
2197
+ ), c = _(n, "property");
2198
+ return Dt(d, c).length > 0;
2199
+ }, [n, a]);
1964
2200
  return /* @__PURE__ */ e.jsxs("details", { children: [
1965
2201
  /* @__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: [
1966
2202
  t(r),
1967
- s ? /* @__PURE__ */ e.jsx(
2203
+ l ? /* @__PURE__ */ e.jsx(
1968
2204
  "span",
1969
2205
  {
1970
- className: `ml-1 mr-2 inline-block h-[8px] w-[8px] rounded-full ${s ? "bg-blue-500" : "bg-gray-300"}`
2206
+ className: `ml-1 mr-2 inline-block h-[8px] w-[8px] rounded-full ${l ? "bg-blue-500" : "bg-gray-300"}`
1971
2207
  }
1972
2208
  ) : null
1973
2209
  ] }) }),
1974
- /* @__PURE__ */ e.jsx("div", { className: "p-2", children: l.map((i) => i.styleType === "multiple" ? /* @__PURE__ */ e.jsx(mt, { ...i }, i.label) : /* @__PURE__ */ e.jsx(Ie, { ...i }, i.label)) })
2210
+ /* @__PURE__ */ e.jsx("div", { className: "p-2", children: a.map((s) => s.styleType === "multiple" ? /* @__PURE__ */ e.jsx(ht, { ...s }, s.label) : /* @__PURE__ */ e.jsx(Ve, { ...s }, s.label)) })
1975
2211
  ] });
1976
- }, Vs = Ke({}), fe = ({ section: r }) => {
1977
- const { t: l } = X(), t = he(), n = H(
1978
- (a = []) => {
2212
+ }, Ss = Fe({}), xe = ({ section: r }) => {
2213
+ const { t: a } = B(), t = ue(), n = H(
2214
+ (s = []) => {
1979
2215
  const d = {};
1980
- for (let c = 0; c < t.length; c++)
1981
- d[t[c].property] = t[c].cls;
1982
- let o = !0;
1983
- for (const c in a)
1984
- if (!ce(d, c) || d[c] !== a[c]) {
1985
- o = !1;
2216
+ for (let o = 0; o < t.length; o++)
2217
+ d[t[o].property] = t[o].cls;
2218
+ let c = !0;
2219
+ for (const o in s)
2220
+ if (!ie(d, o) || d[o] !== s[o]) {
2221
+ c = !1;
1986
2222
  break;
1987
2223
  }
1988
- return o;
2224
+ return c;
1989
2225
  },
1990
2226
  [t]
1991
- ), s = S(() => {
1992
- if (t.length > 0 && r.heading === "classes.heading")
1993
- return !0;
1994
- const a = (c) => J(
1995
- c.map((h) => h.styleType === "multiple" ? J(C(h.options, "key")) : h.property)
1996
- ), d = J(
1997
- r.items.map((c) => c.styleType === "accordion" ? a(c.items) : c.styleType === "multiple" ? J(C(c.options, "key")) : c.property)
1998
- ), o = C(t, "property");
1999
- return Qe(d, o).length > 0;
2000
- }, [t, r.heading, r.items]), i = S(() => ({}), []);
2001
- return /* @__PURE__ */ e.jsx(Vs.Provider, { value: i, children: /* @__PURE__ */ e.jsxs(Ce, { value: r.heading, children: [
2002
- /* @__PURE__ */ e.jsx(ke, { className: "px-3 py-2 text-xs hover:no-underline", children: /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-x-2", children: [
2003
- /* @__PURE__ */ e.jsx("div", { className: `h-[8px] w-[8px] rounded-full ${s ? "bg-blue-500" : "bg-gray-300"}` }),
2004
- l(r.heading)
2005
- ] }) }),
2006
- /* @__PURE__ */ e.jsx(Ne, { className: "bg-gray-100 px-3.5 py-2", children: I.Children.toArray(
2007
- r.items.map((a) => ce(a, "component") ? I.createElement(a.component, { key: a.label }) : ce(a, "styleType") ? a.styleType === "multiple" ? /* @__PURE__ */ e.jsx(mt, { ...a }, a.label) : a.styleType === "accordion" && n(a == null ? void 0 : a.conditions) ? /* @__PURE__ */ e.jsx(Rs, { ...a }, a.label) : null : /* @__PURE__ */ e.jsx(Ie, { ...a }, a.label))
2227
+ ), l = T(() => ({}), []);
2228
+ return /* @__PURE__ */ e.jsx(Ss.Provider, { value: l, children: /* @__PURE__ */ e.jsxs(me, { value: r.heading, children: [
2229
+ /* @__PURE__ */ e.jsx(fe, { className: "bg-gray-200 px-3 py-2 text-xs hover:no-underline", children: /* @__PURE__ */ e.jsx("div", { className: "flex items-center gap-x-2", children: a(r.heading) }) }),
2230
+ /* @__PURE__ */ e.jsx(ve, { className: "bg-gray-100 px-3.5 py-2", children: I.Children.toArray(
2231
+ r.items.map((s) => ie(s, "component") ? I.createElement(s.component, { key: s.label }) : ie(s, "styleType") ? s.styleType === "multiple" ? /* @__PURE__ */ e.jsx(ht, { ...s }, s.label) : s.styleType === "accordion" && n(s == null ? void 0 : s.conditions) ? /* @__PURE__ */ e.jsx(_s, { ...s }, s.label) : null : /* @__PURE__ */ e.jsx(Ve, { ...s }, s.label))
2008
2232
  ) })
2009
2233
  ] }) });
2010
- }, Hs = () => {
2011
- const r = q(), [l] = ge(), { t } = X(), n = Xr(), s = De(), i = Pe(r._type), a = g(oe(l), "prop"), d = g(i.props, `${a}.presets`, {});
2012
- if (b(n) && (!ce(i, "props") || b(d)))
2234
+ }, Ts = () => {
2235
+ const r = G(), [a] = pe(), { t } = B(), n = Lr(), l = Te(), s = Re(r._type), d = y(ae(a), "prop"), c = y(s.props, `${d}.presets`, {});
2236
+ if (m(n) && (!ie(s, "props") || m(c)))
2013
2237
  return null;
2014
- const o = (c) => {
2015
- const h = c.trim().toLowerCase().replace(/ +(?= )/g, "").split(" ");
2016
- s([r._id], h, !0);
2238
+ const o = (p) => {
2239
+ const h = p.trim().toLowerCase().replace(/ +(?= )/g, "").split(" ");
2240
+ l([r._id], h, !0);
2017
2241
  };
2018
- return /* @__PURE__ */ e.jsx("div", { className: "h-10", children: /* @__PURE__ */ e.jsxs(Sr, { children: [
2019
- /* @__PURE__ */ e.jsx(Tr, { asChild: !0, children: /* @__PURE__ */ e.jsx("div", { className: "px-4", children: /* @__PURE__ */ e.jsxs(G, { variant: "default", className: "w-full", size: "sm", children: [
2242
+ return /* @__PURE__ */ e.jsx("div", { className: "h-10", children: /* @__PURE__ */ e.jsxs(Rr, { children: [
2243
+ /* @__PURE__ */ e.jsx(Vr, { asChild: !0, children: /* @__PURE__ */ e.jsx("div", { className: "px-4", children: /* @__PURE__ */ e.jsxs(A, { variant: "default", className: "w-full", size: "sm", children: [
2020
2244
  t("Apply Presets"),
2021
- /* @__PURE__ */ e.jsx(Jt, {})
2245
+ /* @__PURE__ */ e.jsx(Qt, {})
2022
2246
  ] }) }) }),
2023
- /* @__PURE__ */ e.jsx(Rr, { className: "max-h-80 w-56", children: /* @__PURE__ */ e.jsxs(Be, { className: "no-scrollbar h-full", children: [
2024
- b(d) ? null : /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
2025
- /* @__PURE__ */ e.jsxs(Le, { children: [
2026
- i.type,
2247
+ /* @__PURE__ */ e.jsx(Hr, { className: "max-h-80 w-56", children: /* @__PURE__ */ e.jsxs(ct, { className: "no-scrollbar h-full", children: [
2248
+ m(c) ? null : /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
2249
+ /* @__PURE__ */ e.jsxs(Pe, { children: [
2250
+ s.type,
2027
2251
  " ",
2028
2252
  t("presets")
2029
2253
  ] }),
2030
- /* @__PURE__ */ e.jsx(Ee, {}),
2031
- /* @__PURE__ */ e.jsx(Oe, { children: je(d).map((c) => /* @__PURE__ */ e.jsxs(Fe, { className: "group text-xs", onClick: () => o(d[c]), children: [
2032
- we(Y(t(c))),
2033
- /* @__PURE__ */ e.jsx(Ye, { className: "invisible hover:font-bold hover:text-blue-600 group-hover:visible", children: t("apply") })
2254
+ /* @__PURE__ */ e.jsx(Ae, {}),
2255
+ /* @__PURE__ */ e.jsx($e, { children: he(c).map((p) => /* @__PURE__ */ e.jsxs(Me, { className: "group text-xs", onClick: () => o(c[p]), children: [
2256
+ be(F(t(p))),
2257
+ /* @__PURE__ */ e.jsx(Ee, { className: "invisible hover:font-bold hover:text-blue-600 group-hover:visible", children: t("apply") })
2034
2258
  ] })) })
2035
2259
  ] }),
2036
- b(n) ? null : /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
2037
- /* @__PURE__ */ e.jsx(Le, { children: t("Global presets") }),
2038
- /* @__PURE__ */ e.jsx(Ee, {}),
2039
- /* @__PURE__ */ e.jsx(Oe, { children: je(n).map((c) => /* @__PURE__ */ e.jsxs(Fe, { className: "group text-xs", onClick: () => o(n[c]), children: [
2040
- we(Y(t(c))),
2041
- /* @__PURE__ */ e.jsx(Ye, { className: "invisible hover:font-bold hover:text-blue-600 group-hover:visible", children: t("apply") })
2260
+ m(n) ? null : /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
2261
+ /* @__PURE__ */ e.jsx(Pe, { children: t("Global presets") }),
2262
+ /* @__PURE__ */ e.jsx(Ae, {}),
2263
+ /* @__PURE__ */ e.jsx($e, { children: he(n).map((p) => /* @__PURE__ */ e.jsxs(Me, { className: "group text-xs", onClick: () => o(n[p]), children: [
2264
+ be(F(t(p))),
2265
+ /* @__PURE__ */ e.jsx(Ee, { className: "invisible hover:font-bold hover:text-blue-600 group-hover:visible", children: t("apply") })
2042
2266
  ] })) })
2043
2267
  ] })
2044
2268
  ] }) })
2045
2269
  ] }) });
2046
2270
  };
2047
- function Ds() {
2048
- const [r, l] = ut(), { flexChild: t, gridChild: n } = Vr(), { t: s } = X(), i = Hr(), [a] = ge();
2049
- return b(a) ? /* @__PURE__ */ e.jsx("div", { className: "p-4 text-center", children: /* @__PURE__ */ e.jsxs("div", { className: "space-y-4 rounded-xl p-4", children: [
2050
- /* @__PURE__ */ e.jsx(rt, { className: "mx-auto text-3xl" }),
2051
- /* @__PURE__ */ e.jsx("h1", { children: s("no_styling_block_selected") })
2271
+ function Rs() {
2272
+ const { flexChild: r, gridChild: a } = Dr(), { t } = B(), [n] = pe();
2273
+ return m(n) ? /* @__PURE__ */ e.jsx("div", { className: "p-4 text-center", children: /* @__PURE__ */ e.jsxs("div", { className: "space-y-4 rounded-xl p-4", children: [
2274
+ /* @__PURE__ */ e.jsx(qe, { className: "mx-auto text-3xl" }),
2275
+ /* @__PURE__ */ e.jsx("h1", { children: t("no_styling_block_selected") })
2052
2276
  ] }) }) : /* @__PURE__ */ e.jsxs("div", { className: "flex h-full flex-col", children: [
2053
- /* @__PURE__ */ e.jsx(Hs, {}),
2054
- /* @__PURE__ */ e.jsx("div", { className: "flex h-12 flex-col space-x-4 px-4 py-1", children: /* @__PURE__ */ e.jsxs("div", { className: "flex items-center justify-end gap-x-1.5", children: [
2055
- /* @__PURE__ */ e.jsx(pt, { htmlFor: "", className: "flex gap-x-1.5 text-xs italic", children: "State" }),
2056
- /* @__PURE__ */ e.jsxs(Dr, { defaultValue: r, onValueChange: (d) => l(d), children: [
2057
- /* @__PURE__ */ e.jsx(Br, { className: "h-auto w-fit p-1 px-3", children: /* @__PURE__ */ e.jsx(Pr, { placeholder: s("State") }) }),
2058
- /* @__PURE__ */ e.jsxs(Ir, { children: [
2059
- C(i, (d, o) => /* @__PURE__ */ e.jsx(V, { value: o, children: s(d) }, o)),
2060
- /* @__PURE__ */ e.jsx("hr", {}),
2061
- /* @__PURE__ */ e.jsx(V, { value: "", children: s("Normal") }),
2062
- /* @__PURE__ */ e.jsx(V, { value: "hover", children: s("Hover") }),
2063
- /* @__PURE__ */ e.jsx(V, { value: "active", children: s("Active") }),
2064
- /* @__PURE__ */ e.jsx(V, { value: "focus", children: s("Focus") }),
2065
- /* @__PURE__ */ e.jsx(V, { value: "before", children: s("Before") }),
2066
- /* @__PURE__ */ e.jsx(V, { value: "after", children: s("After") }),
2067
- /* @__PURE__ */ e.jsx(V, { value: "only", children: s("Only") }),
2068
- /* @__PURE__ */ e.jsx(V, { value: "first", children: s("First") }),
2069
- /* @__PURE__ */ e.jsx(V, { value: "last", children: s("Last") }),
2070
- /* @__PURE__ */ e.jsx(V, { value: "first-letter", children: s("First Letter") }),
2071
- /* @__PURE__ */ e.jsx(V, { value: "first-line", children: s("First Line") }),
2072
- /* @__PURE__ */ e.jsx(V, { value: "disabled", children: s("Disabled") })
2073
- ] })
2074
- ] })
2075
- ] }) }),
2076
- r !== "" ? /* @__PURE__ */ e.jsxs("div", { className: "m-1 flex items-center space-x-1 rounded border border-orange-500 bg-orange-200 p-px px-2 text-xs text-orange-900", children: [
2077
- /* @__PURE__ */ e.jsx(Fr, { className: "w-3" }),
2078
- /* @__PURE__ */ e.jsx("span", { children: s(`Styles will be applied for (:${r}) state`) })
2079
- ] }) : null,
2080
- /* @__PURE__ */ e.jsx(Be, { className: "no-scrollbar -mx-1 max-h-full flex-1 overflow-x-hidden overflow-y-hidden border-t border-border", children: /* @__PURE__ */ e.jsxs(nt, { defaultValue: ["Layout"], type: "multiple", className: "w-full", children: [
2081
- t && /* @__PURE__ */ e.jsx(fe, { section: ps }),
2082
- n ? /* @__PURE__ */ e.jsx(fe, { section: us }) : null,
2083
- xs.map((d) => /* @__PURE__ */ e.jsx(fe, { section: d }, d.heading))
2084
- ] }) })
2085
- ] });
2086
- }
2087
- const Bs = ({ onAdd: r }) => {
2088
- const { t: l } = X(), [t, n] = w({ key: "", value: "" }), s = () => {
2089
- b(t.key) || (r({ ...t, key: Ht(t.key) }), n({ key: "", value: "" }));
2090
- };
2091
- return /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col gap-1 border-gray-200 px-1", children: [
2092
- /* @__PURE__ */ e.jsx(
2093
- _e,
2094
- {
2095
- name: "key",
2096
- onChange: (i) => n({ ...t, key: i.target.value }),
2097
- value: t.key,
2098
- placeholder: l("Name"),
2099
- autoComplete: "off",
2100
- autoCapitalize: "off",
2101
- onKeyDown: (i) => {
2102
- i.key === "Enter" && (i.preventDefault(), b(t.key) || s());
2103
- }
2104
- }
2105
- ),
2106
- /* @__PURE__ */ e.jsx("div", { className: "flex items-center gap-x-1.5", children: /* @__PURE__ */ e.jsx(
2107
- _e,
2108
- {
2109
- name: "value",
2110
- onChange: (i) => n({ ...t, value: i.target.value }),
2111
- value: t.value,
2112
- placeholder: l("Value"),
2113
- autoComplete: "off",
2114
- autoCapitalize: "off",
2115
- onKeyDown: (i) => {
2116
- i.key === "Enter" && (i.preventDefault(), b(t.key) || s());
2117
- }
2118
- }
2119
- ) }),
2120
- /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-x-2", children: [
2121
- /* @__PURE__ */ e.jsxs(G, { disabled: b(t.key), onClick: s, size: "sm", className: "flex items-center", children: [
2122
- /* @__PURE__ */ e.jsxs("span", { children: [
2123
- l("Add"),
2124
- " "
2125
- ] }),
2126
- /* @__PURE__ */ e.jsx(Ve, {})
2127
- ] }),
2128
- b(t.key) ? null : /* @__PURE__ */ e.jsx(G, { variant: "ghost", onClick: () => n({ key: "", value: "" }), children: l("Cancel") })
2277
+ /* @__PURE__ */ e.jsx(Ts, {}),
2278
+ /* @__PURE__ */ e.jsxs(ot, { defaultValue: ["Styles"], type: "multiple", className: "w-full", children: [
2279
+ r && /* @__PURE__ */ e.jsx(xe, { section: is }),
2280
+ a ? /* @__PURE__ */ e.jsx(xe, { section: ds }) : null,
2281
+ cs.map((l) => /* @__PURE__ */ e.jsx(xe, { section: l }, l.heading))
2129
2282
  ] })
2130
2283
  ] });
2131
- }, Ps = () => {
2132
- const r = q(), [l, t] = w([]), [n] = ge(), s = at(), i = ot(), { t: a } = X(), { toast: d } = ct(), o = `${g(n, "0.prop")}_attrs`;
2133
- de.useEffect(() => {
2134
- const u = C(g(r, o), (y, x) => ({ key: x, value: y }));
2135
- b(u) ? t([]) : t(u);
2136
- }, [g(r, o)]);
2137
- const c = (u) => {
2138
- const y = ve(l, (x, f) => u !== f);
2139
- p(y);
2140
- }, h = (u) => {
2141
- const y = Ge(l, { key: u.key });
2142
- if (y && (y.value.startsWith("dnd-") || y.value.startsWith("#dnd-"))) {
2143
- d({
2144
- title: a("Cannot add predefined attribute"),
2145
- variant: "destructive",
2146
- description: a(`"(${u.key})" cannot be added as it is a predefined attribute for this block`)
2147
- });
2148
- return;
2149
- }
2150
- const x = [...l, u];
2151
- p(x);
2152
- }, p = de.useCallback(
2153
- (u = []) => {
2154
- const y = {};
2155
- Re(u, (x) => {
2156
- b(x.key) || qe(y, x.key, x.value);
2157
- }), i([g(r, "_id")], { [o]: y });
2158
- },
2159
- [r, s, o]
2160
- );
2161
- return /* @__PURE__ */ e.jsx("div", { className: "px-2", children: /* @__PURE__ */ e.jsx("div", { className: "no-scrollbar flex min-h-max flex-col gap-y-2 overflow-y-auto", children: /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col", children: [
2162
- /* @__PURE__ */ e.jsx("div", { children: /* @__PURE__ */ e.jsxs("ul", { className: "overflow-hidden rounded-md bg-gray-100 p-2 text-xs text-gray-700", children: [
2163
- b(l) ? /* @__PURE__ */ e.jsx("li", { className: "flex h-16 items-center justify-center", children: /* @__PURE__ */ e.jsx("p", { children: a("No custom attributes added yet") }) }) : /* @__PURE__ */ e.jsx("li", { children: /* @__PURE__ */ e.jsx("span", { className: "font-bold", children: a("Attributes") }) }),
2164
- de.Children.toArray(
2165
- C(l, (u) => /* @__PURE__ */ e.jsxs("li", { className: "group flex max-w-full items-center justify-between", children: [
2166
- /* @__PURE__ */ e.jsxs($, { delayDuration: 1e3, children: [
2167
- /* @__PURE__ */ e.jsx(A, { asChild: !0, children: /* @__PURE__ */ e.jsxs("div", { className: "w-[90%] cursor-default truncate px-1 hover:bg-gray-200", children: [
2168
- u.key,
2169
- " ",
2170
- /* @__PURE__ */ e.jsx("span", { className: "font-bold text-orange-500", children: "=" }),
2171
- " ",
2172
- u.value
2173
- ] }) }),
2174
- /* @__PURE__ */ e.jsxs(M, { className: "max-w-[200px]", children: [
2175
- /* @__PURE__ */ e.jsxs("div", { children: [
2176
- a("Name"),
2177
- ": ",
2178
- u.key
2179
- ] }),
2180
- /* @__PURE__ */ e.jsxs("div", { children: [
2181
- a("Value"),
2182
- ": ",
2183
- u.value
2184
- ] })
2185
- ] })
2186
- ] }),
2187
- /* @__PURE__ */ e.jsxs($, { children: [
2188
- /* @__PURE__ */ e.jsx(A, { asChild: !0, children: /* @__PURE__ */ e.jsx(
2189
- "button",
2190
- {
2191
- disabled: W(u.value, "dnd-"),
2192
- className: "invisible group-hover:visible",
2193
- onClick: () => c(l.indexOf(u)),
2194
- children: /* @__PURE__ */ e.jsx(Yr, { className: "w-4 text-gray-500" })
2195
- }
2196
- ) }),
2197
- /* @__PURE__ */ e.jsx(M, { className: "max-w-[200px]", children: W(u.value, "dnd-") ? a("Predefined attribute. Cannot be deleted") : a("Remove attribute") })
2198
- ] })
2199
- ] }))
2200
- )
2201
- ] }) }),
2202
- /* @__PURE__ */ e.jsx("div", { className: "py-2" }),
2203
- /* @__PURE__ */ e.jsx(Bs, { onAdd: (u) => h(u) })
2204
- ] }) }) });
2205
- }, Is = {
2284
+ }
2285
+ const Vs = {
2206
2286
  px: 1,
2207
2287
  "%": 1,
2208
2288
  em: 100,
@@ -2213,8 +2293,8 @@ const Bs = ({ onAdd: r }) => {
2213
2293
  "-": 1,
2214
2294
  deg: 1,
2215
2295
  ms: 0.1
2216
- }, Bl = () => {
2217
- const r = q(), { t: l } = X(), [t, n] = I.useState(""), [s, i] = I.useState({
2296
+ }, Ra = () => {
2297
+ const r = G(), { t: a } = B(), [t, n] = I.useState(""), [l, s] = I.useState({
2218
2298
  onDrag: (o) => o,
2219
2299
  onDragEnd: (o) => o,
2220
2300
  dragStartY: 0,
@@ -2223,20 +2303,20 @@ const Bs = ({ onAdd: r }) => {
2223
2303
  dragUnit: "",
2224
2304
  negative: !1,
2225
2305
  cssProperty: ""
2226
- }), a = ue(
2306
+ }), d = de(
2227
2307
  (o) => {
2228
- const c = !g(s, "negative", !1), h = g(s, "cssProperty", "");
2229
- let p = parseFloat(s.dragStartValue);
2230
- p = Je(p) ? 0 : p;
2231
- let u = Is[s.dragUnit];
2232
- (W(h, "scale") || h === "opacity") && (u = 10);
2233
- let x = (s.dragStartY - o.pageY) / u + p;
2234
- c && x < 0 && (x = 0), h === "opacity" && x > 1 && (x = 1), s.onDrag(`${x}`), n(`${x}`);
2308
+ const p = !y(l, "negative", !1), h = y(l, "cssProperty", "");
2309
+ let i = parseFloat(l.dragStartValue);
2310
+ i = Ue(i) ? 0 : i;
2311
+ let g = Vs[l.dragUnit];
2312
+ (W(h, "scale") || h === "opacity") && (g = 10);
2313
+ let u = (l.dragStartY - o.pageY) / g + i;
2314
+ p && u < 0 && (u = 0), h === "opacity" && u > 1 && (u = 1), l.onDrag(`${u}`), n(`${u}`);
2235
2315
  },
2236
- [s],
2316
+ [l],
2237
2317
  50
2238
- ), d = H(() => {
2239
- setTimeout(() => s.onDragEnd(`${t}`), 100), i({
2318
+ ), c = H(() => {
2319
+ setTimeout(() => l.onDragEnd(`${t}`), 100), s({
2240
2320
  onDrag: (o) => o,
2241
2321
  onDragEnd: (o) => o,
2242
2322
  dragStartY: 0,
@@ -2246,31 +2326,25 @@ const Bs = ({ onAdd: r }) => {
2246
2326
  negative: !1,
2247
2327
  cssProperty: ""
2248
2328
  });
2249
- }, [s, t, i]);
2250
- 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: [
2251
- /* @__PURE__ */ e.jsx(rt, { className: "mx-auto text-3xl" }),
2252
- /* @__PURE__ */ e.jsx("h1", { children: l("no_block_selected_for_styling") })
2253
- ] }) }) : /* @__PURE__ */ e.jsx(st, { children: /* @__PURE__ */ e.jsxs(yt.Provider, { value: { setDragData: i }, children: [
2254
- s.dragging ? /* @__PURE__ */ e.jsx(
2329
+ }, [l, t, s]);
2330
+ 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: [
2331
+ /* @__PURE__ */ e.jsx(qe, { className: "mx-auto text-3xl" }),
2332
+ /* @__PURE__ */ e.jsx("h1", { children: a("no_block_selected_for_styling") })
2333
+ ] }) }) : /* @__PURE__ */ e.jsx(Je, { children: /* @__PURE__ */ e.jsxs(yt.Provider, { value: { setDragData: s }, children: [
2334
+ l.dragging ? /* @__PURE__ */ e.jsx(
2255
2335
  "div",
2256
2336
  {
2257
- onMouseMove: a,
2258
- onMouseUp: () => d(),
2337
+ onMouseMove: d,
2338
+ onMouseUp: () => c(),
2259
2339
  className: "absolute inset-0 z-30 cursor-row-resize bg-gray-300/10"
2260
2340
  }
2261
2341
  ) : null,
2262
- /* @__PURE__ */ e.jsxs($r, { defaultValue: "settings", className: "flex h-full w-full flex-col py-1 text-xs", children: [
2263
- /* @__PURE__ */ e.jsxs(Ar, { className: "mx-1 grid grid-cols-3", children: [
2264
- /* @__PURE__ */ e.jsx(me, { value: "settings", children: l("settings") }),
2265
- /* @__PURE__ */ e.jsx(me, { value: "styling", children: l("styling") }),
2266
- /* @__PURE__ */ e.jsx(me, { value: "attrs", children: l("Attributes") })
2267
- ] }),
2268
- /* @__PURE__ */ e.jsx(be, { value: "settings", className: "no-scrollbar h-full flex-1 overflow-y-auto overflow-x-hidden", children: /* @__PURE__ */ e.jsx(Be, { className: "no-scrollbar max-h-full flex-1 overflow-x-hidden overflow-y-hidden pb-5", children: /* @__PURE__ */ e.jsx(ds, {}) }) }),
2269
- /* @__PURE__ */ e.jsx(be, { value: "styling", className: "h-full flex-1 overflow-y-auto overflow-x-hidden", children: /* @__PURE__ */ e.jsx(Ds, {}) }),
2270
- /* @__PURE__ */ e.jsx(be, { value: "attrs", className: "h-full flex-1 overflow-y-auto overflow-x-hidden", children: /* @__PURE__ */ e.jsx(Ps, {}) })
2342
+ /* @__PURE__ */ e.jsxs(ct, { className: "no-scrollbar max-h-full flex-1 overflow-x-hidden overflow-y-hidden bg-gray-100 pb-5", children: [
2343
+ /* @__PURE__ */ e.jsx(as, {}),
2344
+ /* @__PURE__ */ e.jsx(Rs, {})
2271
2345
  ] })
2272
2346
  ] }) });
2273
2347
  };
2274
2348
  export {
2275
- Bl as default
2349
+ Ra as default
2276
2350
  };