@chaibuilder/sdk 1.2.42 → 1.2.44

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