@chaibuilder/sdk 1.2.22 → 1.2.23

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 (106) hide show
  1. package/dist/AddBlocks-b0Vk6eqO.js +206 -0
  2. package/dist/AddBlocks-bgu08YJC.cjs +1 -0
  3. package/dist/BrandingOptions-AljW1cXz.cjs +1 -0
  4. package/dist/{BrandingOptions-4961TxX2.js → BrandingOptions-eUSoIgjj.js} +10 -9
  5. package/dist/CanvasArea-dp1tzDkK.cjs +55 -0
  6. package/dist/CanvasArea-ulUy_rmB.js +951 -0
  7. package/dist/{Class-MmCxz2Ay.cjs → Class-PoYusiA5.cjs} +1 -1
  8. package/dist/{Class-3k8xjeiM.js → Class-lGzsNBOK.js} +1 -1
  9. package/dist/{CurrentPage-oPZN6Gwj.js → CurrentPage-SFhXzQMy.js} +9 -10
  10. package/dist/CurrentPage-rWHgPomd.cjs +1 -0
  11. package/dist/ListTree-5n8U4-IF.cjs +1 -0
  12. package/dist/ListTree-ZeVWczTF.js +309 -0
  13. package/dist/MODIFIERS-0g14w5RS.cjs +1 -0
  14. package/dist/{MODIFIERS-WQdaNvb8.js → MODIFIERS-dytZ-osO.js} +4 -8
  15. package/dist/{PagesPanel-pRKHw-AZ.js → PagesPanel-IkZjy0Gn.js} +9 -10
  16. package/dist/PagesPanel-sBN51kKZ.cjs +1 -0
  17. package/dist/{ProjectPanel-iU6DY-Yp.js → ProjectPanel-e98TJLfI.js} +10 -11
  18. package/dist/ProjectPanel-lbQH31jc.cjs +1 -0
  19. package/dist/STRINGS--j49GZJP.js +7 -0
  20. package/dist/STRINGS-gPz7CUOk.cjs +1 -0
  21. package/dist/{Settings-BhSrj-cE.js → Settings-FZWm8Fc3.js} +862 -865
  22. package/dist/Settings-qytQoyTv.cjs +1 -0
  23. package/dist/SidePanels-YRIM1IPq.cjs +1 -0
  24. package/dist/{SidePanels-OLOUpKn4.js → SidePanels-wrkkpcGE.js} +119 -123
  25. package/dist/{Topbar-Ny9T-7Zb.js → Topbar-LUyDFBkK.js} +6 -5
  26. package/dist/Topbar-NOSnWo7V.cjs +1 -0
  27. package/dist/{UnsplashImages-Y8RGFVSh.js → UnsplashImages-eZedbK2J.js} +16 -15
  28. package/dist/UnsplashImages-f-ObKOC-.cjs +1 -0
  29. package/dist/{UploadImages-dd8LfyFr.js → UploadImages-71QziLbr.js} +11 -10
  30. package/dist/UploadImages-oOnccvT9.cjs +1 -0
  31. package/dist/add-page-modal-g3fd00P5.cjs +1 -0
  32. package/dist/{add-page-modal-Jni6CY1x.js → add-page-modal-yQ6qL6Ui.js} +10 -11
  33. package/dist/{confirm-alert-sc8RaWvD.js → confirm-alert-3flAvzWH.js} +6 -5
  34. package/dist/confirm-alert-LQsGNYz8.cjs +1 -0
  35. package/dist/core.cjs +1 -1
  36. package/dist/core.d.ts +1 -0
  37. package/dist/core.js +48 -49
  38. package/dist/defaultTheme-7VqqhOcp.cjs +1 -0
  39. package/dist/{defaultTheme-gunU_Fe5.js → defaultTheme-D8B4-wHO.js} +1 -1
  40. package/dist/{delete-page-modal-0WiMZFxr.js → delete-page-modal-iMmkPec0.js} +9 -10
  41. package/dist/delete-page-modal-tzZmqGzE.cjs +1 -0
  42. package/dist/email.cjs +1 -1
  43. package/dist/email.d.ts +1 -0
  44. package/dist/email.js +16 -16
  45. package/dist/{form-n1Q6u16z.cjs → form-LBHtTduy.cjs} +1 -1
  46. package/dist/{form-Nj6Kdn3g.js → form-zKUMQFuB.js} +1 -1
  47. package/dist/html-to-json-efmv1pCj.cjs +1 -0
  48. package/dist/{html-to-json-C5sExaSD.js → html-to-json-ngX9ef2u.js} +31 -29
  49. package/dist/{index-nwAgi0aD.cjs → index--dUsFH1I.cjs} +1 -1
  50. package/dist/{index-IPJAbzzO.js → index-HD1UKc4P.js} +1091 -1063
  51. package/dist/{index-0bwkNnA0.cjs → index-bOWwCMRF.cjs} +42 -42
  52. package/dist/index-fvMaxES9.cjs +1 -0
  53. package/dist/{index-_VPpjzJu.js → index-m4WGov7e.js} +4 -4
  54. package/dist/{index-UP_4awU9.js → index-uLtBNl55.js} +4479 -4484
  55. package/dist/lib.cjs +3 -3
  56. package/dist/lib.js +17 -16
  57. package/dist/page-viewer-5gTszT-n.cjs +1 -0
  58. package/dist/{page-viewer-L1Dmgj-c.js → page-viewer-7AwzWRtB.js} +14 -15
  59. package/dist/project-general-setting-52CTYL_w.cjs +1 -0
  60. package/dist/{project-general-setting-sUP7JqWK.js → project-general-setting-pYPoqvqd.js} +10 -11
  61. package/dist/project-seo-setting-jTweI1DX.cjs +1 -0
  62. package/dist/{project-seo-setting-NNvAGt4T.js → project-seo-setting-zXKOcjep.js} +7 -6
  63. package/dist/render.cjs +1 -1
  64. package/dist/render.js +14 -13
  65. package/dist/single-page-detail-jy2SPcp1.cjs +1 -0
  66. package/dist/{single-page-detail-FXg_NebW.js → single-page-detail-q2TDxN-P.js} +11 -12
  67. package/dist/studio.cjs +1 -1
  68. package/dist/studio.d.ts +1 -0
  69. package/dist/studio.js +8 -9
  70. package/dist/ui.cjs +1 -1
  71. package/dist/ui.js +138 -137
  72. package/dist/web-blocks.cjs +6 -1
  73. package/dist/web-blocks.js +462 -354
  74. package/package.json +3 -5
  75. package/dist/AddBlocks-157fSrJX.cjs +0 -1
  76. package/dist/AddBlocks-WgpssWmQ.js +0 -223
  77. package/dist/BrandingOptions-nwXR9TMl.cjs +0 -1
  78. package/dist/CanvasArea-MajWGr9z.js +0 -908
  79. package/dist/CanvasArea-MmTlc5Vb.cjs +0 -55
  80. package/dist/CurrentPage-LpLr0lDI.cjs +0 -1
  81. package/dist/ListTree-dvxHTXs4.js +0 -167
  82. package/dist/ListTree-gTmusfso.cjs +0 -1
  83. package/dist/MODIFIERS-9EwxLM8V.cjs +0 -1
  84. package/dist/Outline-2OxsXs1-.js +0 -294
  85. package/dist/Outline-7CCnnzmK.cjs +0 -1
  86. package/dist/PagesPanel-8536oBWB.cjs +0 -1
  87. package/dist/ProjectPanel-oILsUWOH.cjs +0 -1
  88. package/dist/Settings-jHiYmt0y.cjs +0 -1
  89. package/dist/SidePanels-bcJJocSq.cjs +0 -1
  90. package/dist/Topbar-NMvzqQHW.cjs +0 -1
  91. package/dist/TypeIcon-ElNNPazl.cjs +0 -1
  92. package/dist/TypeIcon-qO96rNbV.js +0 -69
  93. package/dist/UnsplashImages-6tZv1q2_.cjs +0 -1
  94. package/dist/UploadImages-VLlVg9Ur.cjs +0 -1
  95. package/dist/add-page-modal-IsqDdK7X.cjs +0 -1
  96. package/dist/confirm-alert-f26zJ7Js.cjs +0 -1
  97. package/dist/defaultTheme-7Lk2zq60.cjs +0 -1
  98. package/dist/delete-page-modal-c3b-GCap.cjs +0 -1
  99. package/dist/html-to-json-FGufPv9R.cjs +0 -1
  100. package/dist/index-9PHdn80L.cjs +0 -1
  101. package/dist/page-viewer-TnxHhq7S.cjs +0 -1
  102. package/dist/project-general-setting-1Ot1RU43.cjs +0 -1
  103. package/dist/project-seo-setting-3-vBkx2v.cjs +0 -1
  104. package/dist/single-page-detail-btEKYXjE.cjs +0 -1
  105. package/dist/useAddBlockByDrop-V8xo-PNQ.js +0 -20
  106. package/dist/useAddBlockByDrop-qRHgy8_0.cjs +0 -1
@@ -1,28 +1,28 @@
1
1
  import { j as e } from "./jsx-runtime-WbnYoNE9.js";
2
2
  import * as de from "react";
3
- import I, { useState as C, useMemo as _, useEffect as E, useCallback as V, memo as ft, createContext as Qe, useContext as le } from "react";
4
- import { useThrottledCallback as je } from "@react-hookz/web";
5
- import { forEach as _e, isArray as ce, omit as vt, truncate as jt, includes as M, get as x, first as ge, split as wt, startCase as F, toLower as se, isEmpty as f, map as k, find as Ct, last as we, filter as Ce, set as et, debounce as kt, keys as Nt, cloneDeep as _t, each as St, capitalize as Tt, reject as Rt, nth as Be, startsWith as G, isNumber as Vt, parseInt as Ht, isNaN as tt, findLast as Dt, flatten as K, intersection as rt, has as be, isNull as $t } from "lodash-es";
6
- import { useTranslation as W } from "react-i18next";
7
- import { PlusIcon as Se, Cross2Icon as st, EyeOpenIcon as Bt, EyeClosedIcon as Pe, BorderAllIcon as A, WidthIcon as T, HeightIcon as R, ArrowUpIcon as Q, ArrowRightIcon as ee, ArrowDownIcon as te, ArrowLeftIcon as re, ArrowTopLeftIcon as Pt, ArrowTopRightIcon as It, ArrowBottomRightIcon as At, ArrowBottomLeftIcon as Mt, AlignLeftIcon as Et, AlignCenterHorizontallyIcon as Lt, AlignRightIcon as Ot, StretchHorizontallyIcon as zt, FontItalicIcon as Ft, UnderlineIcon as Yt, OverlineIcon as Xt, LetterCaseUppercaseIcon as Zt, Cross1Icon as Wt, InfoCircledIcon as Te, MinusIcon as Ut, BoxIcon as lt, RowSpacingIcon as Gt, TriangleDownIcon as Kt, CrossCircledIcon as qt, TrashIcon as Jt, CaretDownIcon as Qt, MixerHorizontalIcon as ot } from "@radix-ui/react-icons";
8
- import { aV as er, aW as tr, B as oe, aX as rr, aY as sr, aZ as lr, a_ as or, a$ as ar, b0 as nr, b1 as ir, a1 as U, af as dr, ag as cr, ah as pr, b2 as ur, ad as xr, ao as gr, ae as hr, ap as Y, aq as X, ar as Z, b3 as yr, b4 as mr, b5 as br, b6 as fr, b7 as vr, b8 as jr, a6 as at, a5 as wr, h as Cr, b9 as nt, ba as pe, bb as ue, bc as xe, ac as he, M as Re, _ as it, r as dt, aB as Ve, bd as kr, v as Nr, be as _r, $ as ye, V as Sr, a4 as ct, N as Ie, z as Tr, aG as Rr, aH as Vr, aI as Hr, bf as He, aJ as Ae, aK as Me, bg as Ee, bh as Le, bi as Oe, a7 as Dr, aj as $r, ak as Br, al as Pr, am as Ir, an as H, au as Ar, av as Mr, aw as ze, ax as Fe } from "./index-IPJAbzzO.js";
9
- import { u as Er } from "./controls-OfJWSEqC.js";
10
- import { Check as Lr, EditIcon as Or, TrashIcon as zr, BrushIcon as Fr } from "lucide-react";
11
- import { getBlockComponent as De, getChaiDataProviders as Yr, useGlobalStylingPresets as Xr } from "@chaibuilder/runtime";
12
- import { E as pt, u as ut } from "./index-UP_4awU9.js";
13
- import { J as Zr, a as Wr, d as Ur } from "./index-e0c8PmRQ.js";
14
- import Gr from "@rjsf/core";
15
- import Kr from "@rjsf/validator-ajv8";
16
- import qr from "react-autosuggest";
17
- import Jr from "fuse.js";
18
- import { A as Qr, C as me, g as es } from "./Class-3k8xjeiM.js";
19
- import { a as ts } from "./MODIFIERS-WQdaNvb8.js";
20
- import { get as Ye, first as rs, isEmpty as ie, has as ss, keys as Xe, capitalize as Ze, startCase as We } from "lodash";
3
+ import $, { useState as w, useMemo as _, useEffect as L, useCallback as V, memo as mt, createContext as Ke, useContext as oe } from "react";
4
+ import { useThrottledCallback as fe } from "@react-hookz/web";
5
+ import { forEach as Re, isArray as pe, omit as bt, truncate as ft, includes as M, get as x, first as ae, split as vt, startCase as E, toLower as le, isEmpty as b, map as k, find as jt, last as wt, filter as ve, set as Ge, debounce as Ct, keys as je, cloneDeep as kt, each as Nt, capitalize as we, reject as _t, nth as $e, startsWith as G, isNumber as Tt, parseInt as St, isNaN as qe, findLast as Rt, flatten as q, intersection as Je, has as ce, kebabCase as Vt, isNull as Ht } from "lodash-es";
6
+ import { useTranslation as z } from "react-i18next";
7
+ import { PlusIcon as Ve, Cross2Icon as Qe, EyeOpenIcon as Dt, EyeClosedIcon as Ae, BorderAllIcon as A, WidthIcon as S, HeightIcon as R, ArrowUpIcon as ee, ArrowRightIcon as te, ArrowDownIcon as re, ArrowLeftIcon as se, ArrowTopLeftIcon as Bt, ArrowTopRightIcon as Pt, ArrowBottomRightIcon as It, ArrowBottomLeftIcon as $t, AlignLeftIcon as At, AlignCenterHorizontallyIcon as Mt, AlignRightIcon as Et, StretchHorizontallyIcon as Lt, FontItalicIcon as Ot, UnderlineIcon as Ft, OverlineIcon as Yt, LetterCaseUppercaseIcon as zt, Cross1Icon as Xt, InfoCircledIcon as He, MinusIcon as Zt, BoxIcon as et, RowSpacingIcon as Wt, TriangleDownIcon as Ut, CrossCircledIcon as Kt, CaretDownIcon as Gt, MixerHorizontalIcon as tt } from "@radix-ui/react-icons";
8
+ import { aV as qt, aW as Jt, B as U, aX as Qt, aY as er, aZ as tr, a_ as rr, a$ as sr, b0 as lr, b1 as or, a1 as K, af as ar, ag as nr, ah as ir, b2 as dr, ad as cr, ao as pr, ae as ur, ap as O, aq as F, ar as Y, b3 as xr, b4 as gr, b5 as hr, b6 as yr, b7 as mr, b8 as br, a6 as rt, a5 as st, h as fr, b9 as lt, ba as Ce, bb as ke, bc as Ne, ac as ue, M as De, _ as ot, r as at, aB as nt, bd as _e, v as vr, be as jr, $ as xe, V as wr, a4 as it, N as Me, aG as Cr, aH as kr, aI as Nr, bf as Be, aJ as Ee, aK as Le, bg as Oe, bh as Fe, bi as Ye, a7 as _r, aj as Tr, ak as Sr, al as Rr, am as Vr, an as H, au as Hr, av as Dr, aw as he, ax as ye } from "./index-HD1UKc4P.js";
9
+ import { u as Br } from "./controls-OfJWSEqC.js";
10
+ import { Check as Pr, EditIcon as Ir, TrashIcon as $r, BrushIcon as Ar, DeleteIcon as Mr } from "lucide-react";
11
+ import { getBlockComponent as Pe, getChaiDataProviders as Er, useGlobalStylingPresets as Lr } from "@chaibuilder/runtime";
12
+ import { E as dt, u as ct } from "./index-uLtBNl55.js";
13
+ import { J as Or, a as Fr, d as Yr } from "./index-e0c8PmRQ.js";
14
+ import zr from "@rjsf/core";
15
+ import Xr from "@rjsf/validator-ajv8";
16
+ import Zr from "react-autosuggest";
17
+ import Wr from "fuse.js";
18
+ import { A as Ur, C as ge, g as Kr } from "./Class-lGzsNBOK.js";
19
+ import { a as Gr } from "./STRINGS--j49GZJP.js";
21
20
  import "./_commonjsHelpers-UyOWmZb0.js";
22
21
  import "./Functions-7jnEwJyw.js";
23
22
  import "clsx";
24
23
  import "tailwind-merge";
25
24
  import "jotai";
25
+ import "./MODIFIERS-dytZ-osO.js";
26
26
  import "@radix-ui/react-toggle";
27
27
  import "class-variance-authority";
28
28
  import "@radix-ui/react-switch";
@@ -49,32 +49,30 @@ import "react-quill";
49
49
  import "i18next";
50
50
  import "@floating-ui/react-dom";
51
51
  import "flagged";
52
- import "react-dnd";
53
- import "@minoru/react-dnd-treeview";
54
52
  import "react-hotkeys-hook";
55
- function ls(t) {
56
- const o = [], r = {};
57
- function s(l, i) {
58
- _e(i, (a, p) => {
59
- const n = l ? `${l}.${p}` : p, d = ce(a) ? "list" : typeof a;
60
- o.push(n), r[n] = d === "string" ? "text" : d === "object" ? "model" : d, d === "object" && !ce(a) && s(n, a);
53
+ function qr(r) {
54
+ const s = [], t = {};
55
+ function d(l, n) {
56
+ Re(n, (o, p) => {
57
+ const i = l ? `${l}.${p}` : p, c = pe(o) ? "list" : typeof o;
58
+ s.push(i), t[i] = c === "string" ? "text" : c === "object" ? "model" : c, c === "object" && !pe(o) && d(i, o);
61
59
  });
62
60
  }
63
- return s("", vt(t, ["styles", "_type", "_id", "_name", "_bindings"])), { paths: o, pathsType: r };
61
+ return d("", bt(r, ["styles", "_type", "_id", "_name", "_bindings"])), { paths: s, pathsType: t };
64
62
  }
65
- const ke = ({ data: t, fullView: o }) => {
66
- if (!t)
63
+ const Te = ({ data: r, fullView: s }) => {
64
+ if (!r)
67
65
  return null;
68
- const r = typeof t;
69
- return o ? typeof t == "object" ? /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
66
+ const t = typeof r;
67
+ return s ? typeof r == "object" ? /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
70
68
  /* @__PURE__ */ e.jsx("div", { className: "h-3" }),
71
- /* @__PURE__ */ e.jsx(pt, { children: /* @__PURE__ */ e.jsx(
72
- Zr,
69
+ /* @__PURE__ */ e.jsx(dt, { children: /* @__PURE__ */ e.jsx(
70
+ Or,
73
71
  {
74
- data: t,
75
- shouldExpandNode: Wr,
72
+ data: r,
73
+ shouldExpandNode: Fr,
76
74
  style: {
77
- ...Ur,
75
+ ...Yr,
78
76
  container: "max-h-[40vh] overflow-y-auto text-[12px] leading-[1.5] tracking-wide font-mono",
79
77
  stringValue: "text-orange-600",
80
78
  label: "text-green-900 font-semibold pr-1 tracking-wider"
@@ -83,62 +81,62 @@ const ke = ({ data: t, fullView: o }) => {
83
81
  ) })
84
82
  ] }) : /* @__PURE__ */ e.jsxs("div", { className: "max-h-36 w-full overflow-y-auto overflow-x-hidden text-[12px] leading-4 text-gray-800/50", children: [
85
83
  /* @__PURE__ */ e.jsx("span", { className: "font-medium text-gray-800/80", children: "Content: " }),
86
- t
87
- ] }) : /* @__PURE__ */ e.jsx("div", { className: "w-full overflow-hidden whitespace-nowrap text-[10px] leading-3 text-gray-800/50", children: jt(r === "object" ? JSON.stringify(t) : t, { length: 40 }) });
88
- }, Ue = ({
89
- type: t,
90
- value: o = "",
91
- setValue: r,
92
- data: s,
84
+ r
85
+ ] }) : /* @__PURE__ */ e.jsx("div", { className: "w-full overflow-hidden whitespace-nowrap text-[10px] leading-3 text-gray-800/50", children: ft(t === "object" ? JSON.stringify(r) : r, { length: 40 }) });
86
+ }, ze = ({
87
+ type: r,
88
+ value: s = "",
89
+ setValue: t,
90
+ data: d,
93
91
  onChange: l,
94
- dataType: i,
95
- appliedBindings: a
92
+ dataType: n,
93
+ appliedBindings: o
96
94
  }) => {
97
- const { paths: p, pathsType: n } = ls(s), d = t === "PROP" ? De(s == null ? void 0 : s._type) : {}, h = t === "PROP", [c, y] = C(!1), g = _(() => t === "PROP" ? p.filter(
98
- (u) => !M(a, u) && x(d, `props.${ge(wt(u, "."))}.binding`)
99
- ) : p.filter((u) => i === x(n, u, "")), [t, p, a, i, d]);
100
- return E(() => {
101
- o && l(o);
102
- }, [o, t]), /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
95
+ const { paths: p, pathsType: i } = qr(d), c = r === "PROP" ? Pe(d == null ? void 0 : d._type) : {}, h = r === "PROP", [a, g] = w(!1), y = _(() => r === "PROP" ? p.filter(
96
+ (u) => !M(o, u) && x(c, `props.${ae(vt(u, "."))}.binding`)
97
+ ) : p.filter((u) => n === x(i, u, "")), [r, p, o, n, c]);
98
+ return L(() => {
99
+ s && l(s);
100
+ }, [s, r]), /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
103
101
  /* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-4", children: [
104
- /* @__PURE__ */ e.jsx("p", { className: "text-sm text-muted-foreground", children: F(se(t)) }),
105
- /* @__PURE__ */ e.jsxs(er, { open: c, onOpenChange: y, children: [
106
- /* @__PURE__ */ e.jsx(tr, { asChild: !0, children: /* @__PURE__ */ e.jsx(
107
- oe,
102
+ /* @__PURE__ */ e.jsx("p", { className: "text-sm text-muted-foreground", children: E(le(r)) }),
103
+ /* @__PURE__ */ e.jsxs(qt, { open: a, onOpenChange: g, children: [
104
+ /* @__PURE__ */ e.jsx(Jt, { asChild: !0, children: /* @__PURE__ */ e.jsx(
105
+ U,
108
106
  {
109
107
  variant: "outline",
110
108
  size: "sm",
111
- className: ` ${f(o) ? "w-44 justify-center bg-blue-500 text-gray-100 hover:bg-blue-400 hover:text-white" : "min-w-[350px] items-center justify-between"}`,
112
- children: o ? /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
109
+ className: ` ${b(s) ? "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: s ? /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
113
111
  /* @__PURE__ */ e.jsxs("span", { className: "pr-8 text-sm", children: [
114
- 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(i) }),
115
- o
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: E(n) }),
113
+ s
116
114
  ] }),
117
115
  /* @__PURE__ */ e.jsx("span", { className: "cursor-pointer text-[9px] text-blue-400 underline hover:text-blue-700", children: "Change" })
118
116
  ] }) : /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
119
117
  "+ Set ",
120
- F(se(t))
118
+ E(le(r))
121
119
  ] })
122
120
  }
123
121
  ) }),
124
- /* @__PURE__ */ e.jsx(rr, { className: "z-[999] min-w-[300px] p-0", side: "right", align: "start", children: /* @__PURE__ */ e.jsxs(sr, { children: [
125
- /* @__PURE__ */ e.jsx(lr, { placeholder: `Choose ${se(t)}...` }),
126
- /* @__PURE__ */ e.jsxs(or, { children: [
127
- /* @__PURE__ */ e.jsx(ar, { children: "No results found." }),
128
- /* @__PURE__ */ e.jsx(nr, { children: k(g, (u) => /* @__PURE__ */ e.jsxs(
129
- ir,
122
+ /* @__PURE__ */ e.jsx(Qt, { className: "z-[999] min-w-[300px] p-0", side: "right", align: "start", children: /* @__PURE__ */ e.jsxs(er, { children: [
123
+ /* @__PURE__ */ e.jsx(tr, { placeholder: `Choose ${le(r)}...` }),
124
+ /* @__PURE__ */ e.jsxs(rr, { children: [
125
+ /* @__PURE__ */ e.jsx(sr, { children: "No results found." }),
126
+ /* @__PURE__ */ e.jsx(lr, { children: k(y, (u) => /* @__PURE__ */ e.jsxs(
127
+ or,
130
128
  {
131
129
  value: u,
132
130
  className: `cursor-pointer ${h ? "flex items-center justify-between" : "flex flex-col items-start justify-start"}`,
133
- onSelect: (b) => {
134
- r(Ct(g, (j) => j === b) || null), y(!1);
131
+ onSelect: (f) => {
132
+ t(jt(y, (j) => j === f) || null), g(!1);
135
133
  },
136
134
  children: [
137
135
  /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-x-2", children: [
138
- /* @__PURE__ */ e.jsx(Lr, { className: `h-4 w-4 text-green-500 ${o === u ? "" : "opacity-0"}` }),
136
+ /* @__PURE__ */ e.jsx(Pr, { className: `h-4 w-4 text-green-500 ${s === u ? "" : "opacity-0"}` }),
139
137
  u
140
138
  ] }),
141
- 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(x(n, u, "")) }) }) : /* @__PURE__ */ e.jsx("div", { className: "pl-6", children: /* @__PURE__ */ e.jsx(ke, { data: x(s, u) }) })
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: E(x(i, u, "")) }) }) : /* @__PURE__ */ e.jsx("div", { className: "pl-6", children: /* @__PURE__ */ e.jsx(Te, { data: x(d, u) }) })
142
140
  ]
143
141
  },
144
142
  u
@@ -147,357 +145,357 @@ const ke = ({ data: t, fullView: o }) => {
147
145
  ] }) })
148
146
  ] })
149
147
  ] }),
150
- !h && !f(o) && /* @__PURE__ */ e.jsx("div", { className: "pt-2", children: /* @__PURE__ */ e.jsx(ke, { data: x(s, o, ""), fullView: !0 }) })
148
+ !h && !b(s) && /* @__PURE__ */ e.jsx("div", { className: "pt-2", children: /* @__PURE__ */ e.jsx(Te, { data: x(d, s, ""), fullView: !0 }) })
151
149
  ] });
152
- }, os = ({
153
- appliedBindings: t = [],
154
- onAddBinding: o,
155
- editMode: r,
156
- item: s
150
+ }, Jr = ({
151
+ appliedBindings: r = [],
152
+ onAddBinding: s,
153
+ editMode: t,
154
+ item: d
157
155
  }) => {
158
- const [l, i] = C(r ? s.key : ""), [a, p] = C(r ? s.value : ""), n = U(), [d] = ut(), h = V(
159
- (g, u) => {
160
- if (f(g))
156
+ const [l, n] = w(t ? d.key : ""), [o, p] = w(t ? d.value : ""), i = K(), [c] = ct(), h = V(
157
+ (y, u) => {
158
+ if (b(y))
161
159
  return "";
162
160
  {
163
- const b = x(u === "PROP" ? n : d, g, "");
164
- if (ce(b))
161
+ const f = x(u === "PROP" ? i : c, y, "");
162
+ if (pe(f))
165
163
  return "list";
166
- const j = typeof b;
164
+ const j = typeof f;
167
165
  return j === "string" ? "text" : j === "object" ? "model" : j;
168
166
  }
169
167
  },
170
- [n, d]
171
- ), [c, y] = C(r ? h(s.key, "PROP") : "");
168
+ [i, c]
169
+ ), [a, g] = w(t ? h(d.key, "PROP") : "");
172
170
  return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
173
- /* @__PURE__ */ e.jsxs(dr, { children: [
174
- /* @__PURE__ */ e.jsx(cr, { children: "Add Data Binding" }),
175
- /* @__PURE__ */ e.jsx(pr, { className: "text-xs", children: "Add prop and path of binding. Click save when you're done." })
171
+ /* @__PURE__ */ e.jsxs(ar, { children: [
172
+ /* @__PURE__ */ e.jsx(nr, { children: "Add Data Binding" }),
173
+ /* @__PURE__ */ e.jsx(ir, { className: "text-xs", children: "Add prop and path of binding. Click save when you're done." })
176
174
  ] }),
177
175
  /* @__PURE__ */ e.jsxs("div", { className: "relative flex flex-col gap-1", children: [
178
176
  /* @__PURE__ */ e.jsx(
179
- Ue,
177
+ ze,
180
178
  {
181
179
  type: "PROP",
182
180
  isDisabled: !1,
183
181
  placeholder: "Enter prop key",
184
182
  value: l,
185
- setValue: i,
186
- onChange: (g) => {
187
- const u = h(g, "PROP");
188
- i(g), c !== u && p(""), y(u);
183
+ setValue: n,
184
+ onChange: (y) => {
185
+ const u = h(y, "PROP");
186
+ n(y), a !== u && p(""), g(u);
189
187
  },
190
- data: n,
191
- dataType: c,
192
- appliedBindings: t
188
+ data: i,
189
+ dataType: a,
190
+ appliedBindings: r
193
191
  }
194
192
  ),
195
193
  /* @__PURE__ */ e.jsx("div", { className: "h-2" }),
196
194
  /* @__PURE__ */ e.jsx(
197
- Ue,
195
+ ze,
198
196
  {
199
197
  type: "PATH",
200
- isDisabled: f(l),
198
+ isDisabled: b(l),
201
199
  placeholder: "Enter data path",
202
- value: a,
200
+ value: o,
203
201
  setValue: p,
204
- onChange: (g) => {
205
- const u = h(g, "PATH");
206
- p(c === u ? g : "");
202
+ onChange: (y) => {
203
+ const u = h(y, "PATH");
204
+ p(a === u ? y : "");
207
205
  },
208
- data: d,
209
- dataType: c,
210
- appliedBindings: t
206
+ data: c,
207
+ dataType: a,
208
+ appliedBindings: r
211
209
  }
212
210
  )
213
211
  ] }),
214
- /* @__PURE__ */ e.jsx(ur, { children: /* @__PURE__ */ e.jsx(
215
- oe,
212
+ /* @__PURE__ */ e.jsx(dr, { children: /* @__PURE__ */ e.jsx(
213
+ U,
216
214
  {
217
215
  type: "submit",
218
216
  className: "mt-4",
219
- disabled: f(l) && f(a),
220
- onClick: () => o({ key: l, value: a }),
217
+ disabled: b(l) && b(o),
218
+ onClick: () => s({ key: l, value: o }),
221
219
  children: "Save"
222
220
  }
223
221
  ) })
224
222
  ] });
225
- }, xt = ({ disabled: t, children: o, onAddBinding: r, appliedBindings: s, editMode: l = !0, item: i = {} }) => {
226
- const [a, p] = C(!1);
227
- return /* @__PURE__ */ e.jsxs(xr, { children: [
228
- /* @__PURE__ */ e.jsx(gr, { disabled: t, asChild: !0, onClick: () => p(!0), children: o }),
229
- a && /* @__PURE__ */ e.jsx(hr, { children: /* @__PURE__ */ e.jsx(
230
- os,
223
+ }, pt = ({ disabled: r, children: s, onAddBinding: t, appliedBindings: d, editMode: l = !0, item: n = {} }) => {
224
+ const [o, p] = w(!1);
225
+ return /* @__PURE__ */ e.jsxs(cr, { children: [
226
+ /* @__PURE__ */ e.jsx(pr, { disabled: r, asChild: !0, onClick: () => p(!0), children: s }),
227
+ o && /* @__PURE__ */ e.jsx(ur, { children: /* @__PURE__ */ e.jsx(
228
+ Jr,
231
229
  {
232
- item: i,
230
+ item: n,
233
231
  editMode: l,
234
- appliedBindings: s,
235
- onAddBinding: (n) => {
236
- r(n), p(!1);
232
+ appliedBindings: d,
233
+ onAddBinding: (i) => {
234
+ t(i), p(!1);
237
235
  }
238
236
  }
239
237
  ) })
240
238
  ] });
241
- }, as = ({
242
- item: t,
243
- onAddBinding: o,
244
- onRemove: r,
245
- selectedBlock: s,
239
+ }, Qr = ({
240
+ item: r,
241
+ onAddBinding: s,
242
+ onRemove: t,
243
+ selectedBlock: d,
246
244
  dataProvider: l,
247
- appliedBindings: i
245
+ appliedBindings: n
248
246
  }) => {
249
- const [a, p] = C("string"), n = (d, h) => {
250
- if (f(d))
247
+ const [o, p] = w("string"), i = (c, h) => {
248
+ if (b(c))
251
249
  return "";
252
250
  {
253
- const c = x(h === "PROP" ? s : l, d, "");
254
- if (ce(c))
251
+ const a = x(h === "PROP" ? d : l, c, "");
252
+ if (pe(a))
255
253
  return "list";
256
- const y = typeof c;
257
- return y === "string" ? "text" : y === "object" ? "model" : y;
254
+ const g = typeof a;
255
+ return g === "string" ? "text" : g === "object" ? "model" : g;
258
256
  }
259
257
  };
260
- return E(() => p(() => n(t.key, "PROP")), [t.key]), /* @__PURE__ */ e.jsxs("div", { className: "relative flex flex-col rounded-md border border-gray-200 p-2", children: [
261
- /* @__PURE__ */ e.jsx("div", { className: "text-sm font-normal text-gray-500", children: t.key }),
262
- /* @__PURE__ */ e.jsx("div", { className: "font-medium leading-5", children: t.value }),
263
- /* @__PURE__ */ e.jsx(ke, { data: x(l, t.value, "") }),
258
+ return L(() => p(() => i(r.key, "PROP")), [r.key]), /* @__PURE__ */ e.jsxs("div", { className: "relative flex flex-col rounded-md border border-gray-200 p-2", children: [
259
+ /* @__PURE__ */ e.jsx("div", { className: "text-sm font-normal text-gray-500", children: r.key }),
260
+ /* @__PURE__ */ e.jsx("div", { className: "font-medium leading-5", children: r.value }),
261
+ /* @__PURE__ */ e.jsx(Te, { data: x(l, r.value, "") }),
264
262
  /* @__PURE__ */ e.jsxs("div", { className: "flex items-center justify-end gap-x-2", children: [
265
- /* @__PURE__ */ e.jsx(xt, { editMode: !0, onAddBinding: o, appliedBindings: i, item: t, children: /* @__PURE__ */ e.jsx(Or, { className: "mt-1 h-6 w-6 cursor-pointer rounded border border-blue-400 p-1 text-blue-400 duration-200 hover:scale-105 hover:bg-blue-400 hover:text-white" }) }),
263
+ /* @__PURE__ */ e.jsx(pt, { editMode: !0, onAddBinding: s, appliedBindings: n, item: r, children: /* @__PURE__ */ e.jsx(Ir, { className: "mt-1 h-6 w-6 cursor-pointer rounded border border-blue-400 p-1 text-blue-400 duration-200 hover:scale-105 hover:bg-blue-400 hover:text-white" }) }),
266
264
  /* @__PURE__ */ e.jsx(
267
- zr,
265
+ $r,
268
266
  {
269
- onClick: () => r(),
267
+ onClick: () => t(),
270
268
  className: "mt-1 h-6 w-6 cursor-pointer rounded border border-red-400 p-1 text-red-400 duration-200 hover:scale-105 hover:bg-red-400 hover:text-white"
271
269
  }
272
270
  )
273
271
  ] }),
274
- !f(a) && !f(t.key) && /* @__PURE__ */ e.jsx("div", { className: "absolute right-0 top-1 mt-px flex h-4 items-center rounded-full px-2 text-[10px] font-medium text-purple-600", children: F(a) })
272
+ !b(o) && !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: E(o) })
275
273
  ] });
276
- }, ns = ({ bindingData: t, onChange: o }) => {
277
- const r = U(), [s] = ut(), l = Yr(), [i, a] = C(
278
- k(t, (c, y) => ({ key: y, value: c }))
274
+ }, es = ({ bindingData: r, onChange: s }) => {
275
+ const t = K(), [d] = ct(), l = Er(), [n, o] = w(
276
+ k(r, (a, g) => ({ key: g, value: a }))
279
277
  );
280
- E(() => {
281
- a(k(t, (c, y) => ({ key: y, value: c })));
282
- }, [r == null ? void 0 : r._id, t]);
278
+ L(() => {
279
+ o(k(r, (a, g) => ({ key: g, value: a })));
280
+ }, [t == null ? void 0 : t._id, r]);
283
281
  const p = _(() => {
284
- if (f(s))
282
+ if (b(d))
285
283
  return !0;
286
- if (f(i))
284
+ if (b(n))
287
285
  return !1;
288
- const c = we(i);
289
- return f(c == null ? void 0 : c.key) || f(c == null ? void 0 : c.value);
290
- }, [s, i]), n = (c) => {
291
- const y = Ce(i, (g) => g.key !== c.key);
292
- a([...y, c]), h([...y, c]);
293
- }, d = (c) => {
294
- const y = Ce(i, (g, u) => c !== u);
295
- h([...y]);
286
+ const a = wt(n);
287
+ return b(a == null ? void 0 : a.key) || b(a == null ? void 0 : a.value);
288
+ }, [d, n]), i = (a) => {
289
+ const g = ve(n, (y) => y.key !== a.key);
290
+ o([...g, a]), h([...g, a]);
291
+ }, c = (a) => {
292
+ const g = ve(n, (y, u) => a !== u);
293
+ h([...g]);
296
294
  }, h = V(
297
- (c = []) => {
298
- if (a(c), f(c)) {
299
- o({});
295
+ (a = []) => {
296
+ if (o(a), b(a)) {
297
+ s({});
300
298
  return;
301
299
  }
302
- const y = {};
303
- _e(c, (g) => {
304
- !f(g == null ? void 0 : g.key) && !f(g == null ? void 0 : g.value) && et(y, g.key, g.value);
305
- }), o(y);
300
+ const g = {};
301
+ Re(a, (y) => {
302
+ !b(y == null ? void 0 : y.key) && !b(y == null ? void 0 : y.value) && Ge(g, y.key, y.value);
303
+ }), s(g);
306
304
  },
307
- [o]
305
+ [s]
308
306
  );
309
- return f(l) ? /* @__PURE__ */ e.jsx("div", { className: "flex w-full items-center justify-center", children: /* @__PURE__ */ e.jsxs("p", { className: "mb-1.5 text-xs text-gray-500", children: [
307
+ return b(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: [
310
308
  "You have no data providers registered. Please add a data provider to your project. ",
311
309
  /* @__PURE__ */ e.jsx("br", {}),
312
310
  /* @__PURE__ */ e.jsx("a", { className: "text-blue-500", href: "https://chaibuilder.com/docs/registering-data-providers", target: "_blank", children: "Learn more" })
313
311
  ] }) }) : /* @__PURE__ */ e.jsxs("div", { className: "space-y-2", children: [
314
- k(i, (c, y) => /* @__PURE__ */ e.jsx(
315
- as,
312
+ k(n, (a, g) => /* @__PURE__ */ e.jsx(
313
+ Qr,
316
314
  {
317
- item: c,
318
- onAddBinding: n,
319
- onRemove: () => d(y),
320
- selectedBlock: r,
321
- dataProvider: s,
322
- appliedBindings: k(i, "key")
315
+ item: a,
316
+ onAddBinding: i,
317
+ onRemove: () => c(g),
318
+ selectedBlock: t,
319
+ dataProvider: d,
320
+ appliedBindings: k(n, "key")
323
321
  },
324
- c.key
322
+ a.key
325
323
  )),
326
- /* @__PURE__ */ e.jsxs(Y, { delayDuration: 200, children: [
327
- /* @__PURE__ */ e.jsx(X, { disabled: f(s), className: "w-full", children: /* @__PURE__ */ e.jsx(
328
- xt,
324
+ /* @__PURE__ */ e.jsxs(O, { delayDuration: 200, children: [
325
+ /* @__PURE__ */ e.jsx(F, { disabled: b(d), className: "w-full", children: /* @__PURE__ */ e.jsx(
326
+ pt,
329
327
  {
330
328
  disabled: p,
331
- appliedBindings: k(i, "key"),
332
- onAddBinding: n,
329
+ appliedBindings: k(n, "key"),
330
+ onAddBinding: i,
333
331
  children: /* @__PURE__ */ e.jsx(
334
332
  "span",
335
333
  {
336
334
  className: `w-full rounded-md px-5 py-1.5 text-xs font-medium duration-200 ${p ? "cursor-not-allowed bg-gray-200 text-gray-400" : "bg-blue-700/20 text-blue-800 hover:bg-blue-700/30"}`,
337
- children: f(s) ? /* @__PURE__ */ e.jsx("small", { className: "text-[9.5px] text-gray-500", children: "No data provider has been set up for this page" }) : "+ Add Data Binding"
335
+ children: b(d) ? /* @__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"
338
336
  }
339
337
  )
340
338
  }
341
339
  ) }),
342
- p && /* @__PURE__ */ e.jsx(Z, { sideOffset: -55, className: "text-[11px]", children: f(s) ? "No data provider has been set up for this page." : "Complete last added data binding to add more" })
340
+ p && /* @__PURE__ */ e.jsx(Y, { sideOffset: -55, className: "text-[11px]", children: b(d) ? "No data provider has been set up for this page." : "Complete last added data binding to add more" })
343
341
  ] })
344
342
  ] });
345
- }, is = () => /* @__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" }), fe = ft(({ id: t, properties: o, formData: r, onChange: s }) => {
346
- const [l, i] = C(r), a = { type: "object", properties: {} }, p = {};
347
- return Object.keys(o).forEach((n) => {
348
- const d = o[n];
349
- if (M(["slot", "styles"], d.type))
343
+ }, ts = () => /* @__PURE__ */ e.jsx("div", { className: "text-xs border rounded-sm p-1 mt-1 border-orange-500 text-orange-500 bg-orange-100", children: "Data binding is set for this field" }), me = mt(({ id: r, properties: s, formData: t, onChange: d }) => {
344
+ const [l, n] = w(t), o = { type: "object", properties: {} }, p = {};
345
+ return Object.keys(s).forEach((i) => {
346
+ const c = s[i];
347
+ if (M(["slot", "styles"], c.type))
350
348
  return;
351
- const h = n;
352
- a.properties[h] = yr(d), p[h] = mr(d);
353
- }), E(() => {
354
- i(r);
355
- }, [t]), /* @__PURE__ */ e.jsx(
356
- Gr,
349
+ const h = i;
350
+ o.properties[h] = xr(c), p[h] = gr(c);
351
+ }), L(() => {
352
+ n(t);
353
+ }, [r]), /* @__PURE__ */ e.jsx(
354
+ zr,
357
355
  {
358
356
  widgets: {
359
- binding: is,
360
- richtext: br,
361
- icon: fr,
362
- image: vr
357
+ binding: ts,
358
+ richtext: hr,
359
+ icon: yr,
360
+ image: mr
363
361
  },
364
- fields: { link: jr },
362
+ fields: { link: br },
365
363
  idSeparator: ".",
366
364
  autoComplete: "off",
367
365
  omitExtraData: !1,
368
366
  liveOmit: !1,
369
367
  liveValidate: !1,
370
- validator: Kr,
368
+ validator: Xr,
371
369
  uiSchema: p,
372
- schema: a,
370
+ schema: o,
373
371
  formData: l,
374
- onChange: ({ formData: n }, d) => {
375
- d && (i(n), s({ formData: n }, d));
372
+ onChange: ({ formData: i }, c) => {
373
+ c && (n(i), d({ formData: i }, c));
376
374
  }
377
375
  }
378
376
  );
379
377
  });
380
- function ds() {
381
- const t = U(), o = at(), r = wr(), s = De(t._type), l = { ...t }, [i, a] = C(l), p = Cr("dataBindingSupport", !1), n = ({ formData: u }, b, j) => {
382
- if (b && (i == null ? void 0 : i._id) === t._id) {
383
- const $ = b.replace("root.", "");
384
- r([t._id], { [$]: x(u, $) }, j);
378
+ function rs() {
379
+ const r = K(), s = rt(), t = st(), d = Pe(r._type), l = { ...r }, [n, o] = w(l), p = fr("dataBindingSupport", !1), i = ({ formData: u }, f, j) => {
380
+ if (f && (n == null ? void 0 : n._id) === r._id) {
381
+ const B = f.replace("root.", "");
382
+ t([r._id], { [B]: x(u, B) }, j);
385
383
  }
386
- }, d = V(
387
- kt(({ formData: u }, b, j) => {
388
- n({ formData: u }, b, j), a(u);
384
+ }, c = V(
385
+ Ct(({ formData: u }, f, j) => {
386
+ i({ formData: u }, f, j), o(u);
389
387
  }, 1500),
390
- [t == null ? void 0 : t._id]
391
- ), h = ({ formData: u }, b) => {
392
- if (b) {
393
- const j = b.replace("root.", "");
394
- o([t._id], { [j]: x(u, j) }), d({ formData: u }, b, { [j]: x(i, j) });
388
+ [r == null ? void 0 : r._id]
389
+ ), h = ({ formData: u }, f) => {
390
+ if (f) {
391
+ const j = f.replace("root.", "");
392
+ s([r._id], { [j]: x(u, j) }), c({ formData: u }, f, { [j]: x(n, j) });
395
393
  }
396
- }, c = {
397
- _name: Er({
394
+ }, a = {
395
+ _name: Br({
398
396
  title: "Name",
399
- default: x(t, "_name", t._type)
397
+ default: x(r, "_name", r._type)
400
398
  })
401
- }, y = Nt(x(l, "_bindings", {})), g = _(() => {
402
- const u = _t(x(s, "props", {}));
403
- return p && St(y, (b) => delete u[b]), u;
404
- }, [s, y, p]);
399
+ }, g = je(x(l, "_bindings", {})), y = _(() => {
400
+ const u = kt(x(d, "props", {}));
401
+ return p && Nt(g, (f) => delete u[f]), u;
402
+ }, [d, g, p]);
405
403
  return /* @__PURE__ */ e.jsxs("div", { className: "overflow-x-hidden", children: [
406
- /* @__PURE__ */ e.jsx(fe, { id: t == null ? void 0 : t._id, onChange: h, formData: l, properties: c }),
404
+ /* @__PURE__ */ e.jsx(me, { id: r == null ? void 0 : r._id, onChange: h, formData: l, properties: a }),
407
405
  /* @__PURE__ */ e.jsx("hr", { className: "mt-4" }),
408
- p ? /* @__PURE__ */ e.jsxs(nt, { type: "multiple", defaultValue: ["STATIC", "BINDING"], className: "h-full w-full", children: [
409
- /* @__PURE__ */ e.jsxs(pe, { value: "BINDING", children: [
410
- /* @__PURE__ */ e.jsx(ue, { 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: [
406
+ p ? /* @__PURE__ */ e.jsxs(lt, { type: "multiple", defaultValue: ["STATIC", "BINDING"], className: "h-full w-full", children: [
407
+ /* @__PURE__ */ e.jsxs(Ce, { value: "BINDING", children: [
408
+ /* @__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: [
411
409
  /* @__PURE__ */ e.jsx(
412
410
  "div",
413
411
  {
414
- className: `h-[8px] w-[8px] rounded-full ${f(x(t, "_bindings", {})) ? "bg-gray-300" : "bg-blue-500"}`
412
+ className: `h-[8px] w-[8px] rounded-full ${b(x(r, "_bindings", {})) ? "bg-gray-300" : "bg-blue-500"}`
415
413
  }
416
414
  ),
417
415
  "Data Binding"
418
416
  ] }) }),
419
- /* @__PURE__ */ e.jsx(xe, { className: "px-4 pt-4", children: /* @__PURE__ */ e.jsx(
420
- ns,
417
+ /* @__PURE__ */ e.jsx(Ne, { className: "px-4 pt-4", children: /* @__PURE__ */ e.jsx(
418
+ es,
421
419
  {
422
- bindingData: x(t, "_bindings", {}),
420
+ bindingData: x(r, "_bindings", {}),
423
421
  onChange: (u) => {
424
- n({ formData: { _bindings: u } }, "root._bindings");
422
+ i({ formData: { _bindings: u } }, "root._bindings");
425
423
  }
426
424
  }
427
425
  ) })
428
426
  ] }),
429
- /* @__PURE__ */ e.jsxs(pe, { value: "STATIC", children: [
430
- /* @__PURE__ */ e.jsx(ue, { 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: [
427
+ /* @__PURE__ */ e.jsxs(Ce, { value: "STATIC", children: [
428
+ /* @__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: [
431
429
  /* @__PURE__ */ e.jsx("div", { className: "h-[8px] w-[8px] rounded-full bg-blue-500" }),
432
430
  "Static Content"
433
431
  ] }) }),
434
- /* @__PURE__ */ e.jsxs(xe, { className: "pt-4", children: [
435
- f(y) ? 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: [
432
+ /* @__PURE__ */ e.jsxs(Ne, { className: "pt-4", children: [
433
+ b(g) ? 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: [
436
434
  "Data binding is set for ",
437
- /* @__PURE__ */ e.jsx("b", { children: k(y, Tt).join(", ") }),
435
+ /* @__PURE__ */ e.jsx("b", { children: k(g, we).join(", ") }),
438
436
  " ",
439
- y.length === 1 ? "property" : "properties",
437
+ g.length === 1 ? "property" : "properties",
440
438
  ". Remove data binding to edit static content."
441
439
  ] }),
442
440
  /* @__PURE__ */ e.jsx(
443
- fe,
441
+ me,
444
442
  {
445
- id: t == null ? void 0 : t._id,
443
+ id: r == null ? void 0 : r._id,
446
444
  onChange: h,
447
445
  formData: l,
448
- properties: g
446
+ properties: y
449
447
  }
450
448
  )
451
449
  ] })
452
450
  ] })
453
451
  ] }) : /* @__PURE__ */ e.jsx(
454
- fe,
452
+ me,
455
453
  {
456
- id: t == null ? void 0 : t._id,
454
+ id: r == null ? void 0 : r._id,
457
455
  onChange: h,
458
456
  formData: l,
459
- properties: g
457
+ properties: y
460
458
  }
461
459
  ),
462
460
  /* @__PURE__ */ e.jsx("div", { className: "pb-60" })
463
461
  ] });
464
462
  }
465
- const Ge = new Jr(Qr, {
463
+ const Xe = new Wr(Ur, {
466
464
  isCaseSensitive: !1,
467
465
  threshold: 0.2,
468
466
  minMatchCharLength: 2,
469
467
  keys: ["name"]
470
468
  });
471
- function cs() {
472
- var $;
473
- const [t] = he(), o = U(), r = Re(), s = it(), [l] = dt(), [i, a] = C(""), p = ($ = ge(t)) == null ? void 0 : $.prop, n = Rt((x(o, p, "").replace(ts, "").split(",").pop() || "").split(" "), f), d = () => {
474
- const w = i.trim().toLowerCase().replace(/ +(?= )/g, "").split(" ");
475
- r(l, w, !0), a("");
476
- }, [h, c] = C([]), y = ({ value: w }) => {
477
- const P = w.trim().toLowerCase(), L = P.match(/.+:/g);
469
+ function ss() {
470
+ var B;
471
+ const [r] = ue(), s = K(), t = De(), d = ot(), [l] = at(), [n, o] = w(""), p = (B = ae(r)) == null ? void 0 : B.prop, i = _t((x(s, p, "").replace(Gr, "").split(",").pop() || "").split(" "), b), c = () => {
472
+ const C = n.trim().toLowerCase().replace(/ +(?= )/g, "").split(" ");
473
+ t(l, C, !0), o("");
474
+ }, [h, a] = w([]), g = ({ value: C }) => {
475
+ const I = C.trim().toLowerCase(), X = I.match(/.+:/g);
478
476
  let N = [];
479
- if (L && L.length > 0) {
480
- const [B] = L, z = P.replace(B, "");
481
- N = Ge.search(z).map((m) => ({
477
+ if (X && X.length > 0) {
478
+ const [P] = X, W = I.replace(P, "");
479
+ N = Xe.search(W).map((m) => ({
482
480
  ...m,
483
- item: { ...m.item, name: B + m.item.name }
481
+ item: { ...m.item, name: P + m.item.name }
484
482
  }));
485
483
  } else
486
- N = Ge.search(P);
487
- c(k(N, "item"));
488
- }, g = () => {
489
- c([]);
490
- }, u = (w) => w.name, b = (w) => /* @__PURE__ */ e.jsx("div", { className: "rounded-md p-1", children: w.name }), j = {
484
+ N = Xe.search(I);
485
+ a(k(N, "item"));
486
+ }, y = () => {
487
+ a([]);
488
+ }, u = (C) => C.name, f = (C) => /* @__PURE__ */ e.jsx("div", { className: "rounded-md p-1", children: C.name }), j = {
491
489
  autoComplete: "off",
492
490
  autoCorrect: "off",
493
491
  autoCapitalize: "off",
494
492
  spellCheck: !1,
495
493
  placeholder: "Enter class name",
496
- value: i,
497
- onKeyDown: (w) => {
498
- w.key === "Enter" && i.trim() !== "" && d();
494
+ value: n,
495
+ onKeyDown: (C) => {
496
+ C.key === "Enter" && n.trim() !== "" && c();
499
497
  },
500
- onChange: (w, { newValue: P }) => a(P),
498
+ onChange: (C, { newValue: I }) => o(I),
501
499
  className: "w-full rounded-md text-xs px-2 hover:outline-0 bg-background border-border py-1"
502
500
  };
503
501
  return /* @__PURE__ */ e.jsxs(
@@ -505,16 +503,16 @@ function cs() {
505
503
  {
506
504
  className: `no-scrollbar flex ${h.length > 0 ? "min-h-[300px]" : "min-h-max"} w-full flex-col gap-y-5 overflow-y-auto bg-gray-100 px-px`,
507
505
  children: [
508
- /* @__PURE__ */ e.jsx(Ve, { className: "mt-2", children: "Add Tailwind classes" }),
506
+ /* @__PURE__ */ e.jsx(nt, { className: "mt-2", children: "Add Tailwind classes" }),
509
507
  /* @__PURE__ */ e.jsxs("div", { className: "relative -mt-4 flex items-center gap-x-3", children: [
510
508
  /* @__PURE__ */ e.jsx("div", { className: "relative flex w-full items-center gap-x-3", children: /* @__PURE__ */ e.jsx(
511
- qr,
509
+ Zr,
512
510
  {
513
511
  suggestions: h,
514
- onSuggestionsFetchRequested: y,
515
- onSuggestionsClearRequested: g,
512
+ onSuggestionsFetchRequested: g,
513
+ onSuggestionsClearRequested: y,
516
514
  getSuggestionValue: u,
517
- renderSuggestion: b,
515
+ renderSuggestion: f,
518
516
  inputProps: j,
519
517
  containerProps: {
520
518
  className: "relative h-8 w-full gap-y-1 py-1 border-gray-600"
@@ -527,36 +525,36 @@ function cs() {
527
525
  }
528
526
  ) }),
529
527
  /* @__PURE__ */ e.jsx(
530
- oe,
528
+ U,
531
529
  {
532
530
  variant: "outline",
533
531
  className: "h-6 border-gray-700",
534
- onClick: d,
535
- disabled: i.trim() === "",
532
+ onClick: c,
533
+ disabled: n.trim() === "",
536
534
  size: "sm",
537
- children: /* @__PURE__ */ e.jsx(Se, {})
535
+ children: /* @__PURE__ */ e.jsx(Ve, {})
538
536
  }
539
537
  )
540
538
  ] }),
541
539
  /* @__PURE__ */ e.jsxs("div", { className: "flex w-full flex-wrap gap-2", children: [
542
- f(n) && /* @__PURE__ */ e.jsx("div", { className: "flex h-10 w-full items-center justify-center text-center text-sm text-gray-400", children: "No class added" }),
540
+ b(i) && /* @__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" }),
543
541
  de.Children.toArray(
544
- n.map((w) => /* @__PURE__ */ e.jsxs(
542
+ i.map((C) => /* @__PURE__ */ e.jsxs(
545
543
  "div",
546
544
  {
547
545
  className: "group relative flex cursor-default items-center gap-x-1 rounded-full border border-blue-600 bg-blue-500 p-px px-1.5 text-[11px] text-white hover:border-blue-900",
548
546
  children: [
549
- w,
547
+ C,
550
548
  /* @__PURE__ */ e.jsx(
551
- st,
549
+ Qe,
552
550
  {
553
- onClick: () => s(l, [w]),
551
+ onClick: () => d(l, [C]),
554
552
  className: "invisible absolute right-1 hover:text-white group-hover:visible group-hover:cursor-pointer"
555
553
  }
556
554
  )
557
555
  ]
558
556
  },
559
- w
557
+ C
560
558
  ))
561
559
  )
562
560
  ] })
@@ -564,7 +562,7 @@ function cs() {
564
562
  }
565
563
  );
566
564
  }
567
- const D = ["px", "%", "em", "rem", "ch", "vh", "vw"], ps = {
565
+ const D = ["px", "%", "em", "rem", "ch", "vh", "vw"], ls = {
568
566
  heading: "flex.heading",
569
567
  items: [
570
568
  { type: "arbitrary", label: "flex.basis", units: D, property: "flexBasis" },
@@ -573,7 +571,7 @@ const D = ["px", "%", "em", "rem", "ch", "vh", "vw"], ps = {
573
571
  { type: "dropdown", label: "flex.grow", property: "flexGrow" },
574
572
  { type: "dropdown", label: "flex.shrink", property: "flexShrink" }
575
573
  ]
576
- }, us = {
574
+ }, os = {
577
575
  heading: "grid.heading",
578
576
  items: [
579
577
  { type: "range", label: "grid.col_span", property: "gridColSpan" },
@@ -584,7 +582,7 @@ const D = ["px", "%", "em", "rem", "ch", "vh", "vw"], ps = {
584
582
  { type: "range", label: "grid.row_end", property: "gridRowEnd" },
585
583
  { type: "range", label: "grid.order", property: "order" }
586
584
  ]
587
- }, xs = [
585
+ }, as = [
588
586
  {
589
587
  heading: "layout.heading",
590
588
  items: [
@@ -986,89 +984,89 @@ const D = ["px", "%", "em", "rem", "ch", "vh", "vw"], ps = {
986
984
  },
987
985
  {
988
986
  heading: "classes.heading",
989
- items: [{ component: cs }]
987
+ items: [{ component: ss }]
990
988
  }
991
- ], gt = {
989
+ ], ut = {
992
990
  "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" }) }),
993
991
  // visibility
994
- visible: Bt,
995
- invisible: Pe,
992
+ visible: Dt,
993
+ invisible: Ae,
996
994
  // display
997
- hidden: Pe,
995
+ hidden: Ae,
998
996
  gap: A,
999
- gapX: T,
997
+ gapX: S,
1000
998
  gapY: R,
1001
- spaceX: T,
999
+ spaceX: S,
1002
1000
  spaceY: R,
1003
1001
  overscroll: A,
1004
- overscrollX: T,
1002
+ overscrollX: S,
1005
1003
  overscrollY: R,
1006
1004
  overflow: A,
1007
- overflowX: T,
1005
+ overflowX: S,
1008
1006
  overflowY: R,
1009
- top: Q,
1010
- right: ee,
1011
- bottom: te,
1012
- left: re,
1007
+ top: ee,
1008
+ right: te,
1009
+ bottom: re,
1010
+ left: se,
1013
1011
  inset: A,
1014
- insetX: T,
1012
+ insetX: S,
1015
1013
  insetY: R,
1016
1014
  border: A,
1017
- borderX: T,
1015
+ borderX: S,
1018
1016
  borderY: R,
1019
- borderTop: Q,
1020
- borderRight: ee,
1021
- borderBottom: te,
1022
- borderLeft: re,
1017
+ borderTop: ee,
1018
+ borderRight: te,
1019
+ borderBottom: re,
1020
+ borderLeft: se,
1023
1021
  borderRadius: A,
1024
- borderRadiusX: T,
1022
+ borderRadiusX: S,
1025
1023
  borderRadiusY: R,
1026
- borderRadiusTop: Q,
1027
- borderRadiusRight: ee,
1028
- borderRadiusBottom: te,
1029
- borderRadiusLeft: re,
1030
- borderRadiusTopLeft: Pt,
1031
- borderRadiusTopRight: It,
1032
- borderRadiusBottomRight: At,
1033
- borderRadiusBottomLeft: Mt,
1034
- divideXWidth: T,
1024
+ borderRadiusTop: ee,
1025
+ borderRadiusRight: te,
1026
+ borderRadiusBottom: re,
1027
+ borderRadiusLeft: se,
1028
+ borderRadiusTopLeft: Bt,
1029
+ borderRadiusTopRight: Pt,
1030
+ borderRadiusBottomRight: It,
1031
+ borderRadiusBottomLeft: $t,
1032
+ divideXWidth: S,
1035
1033
  divideYWidth: R,
1036
1034
  scale: A,
1037
- scaleX: T,
1035
+ scaleX: S,
1038
1036
  scaleY: R,
1039
- skewX: T,
1037
+ skewX: S,
1040
1038
  skewY: R,
1041
- translateX: T,
1039
+ translateX: S,
1042
1040
  translateY: R,
1043
1041
  // padding
1044
1042
  padding: A,
1045
- paddingX: T,
1043
+ paddingX: S,
1046
1044
  paddingY: R,
1047
- paddingTop: Q,
1048
- paddingRight: ee,
1049
- paddingBottom: te,
1050
- paddingLeft: re,
1045
+ paddingTop: ee,
1046
+ paddingRight: te,
1047
+ paddingBottom: re,
1048
+ paddingLeft: se,
1051
1049
  // margin
1052
1050
  margin: A,
1053
- marginX: T,
1051
+ marginX: S,
1054
1052
  marginY: R,
1055
- marginTop: Q,
1056
- marginRight: ee,
1057
- marginBottom: te,
1058
- marginLeft: re,
1053
+ marginTop: ee,
1054
+ marginRight: te,
1055
+ marginBottom: re,
1056
+ marginLeft: se,
1059
1057
  // text-align
1060
- textLeft: Et,
1061
- textCenter: Lt,
1062
- textRight: Ot,
1063
- textJustify: zt,
1058
+ textLeft: At,
1059
+ textCenter: Mt,
1060
+ textRight: Et,
1061
+ textJustify: Lt,
1064
1062
  // font style
1065
- italic: Ft,
1063
+ italic: Ot,
1066
1064
  // "not-italic": "",
1067
1065
  // decoration
1068
- underline: Yt,
1069
- overline: Xt,
1066
+ underline: Ft,
1067
+ overline: Yt,
1070
1068
  // transform
1071
- uppercase: Zt,
1069
+ uppercase: zt,
1072
1070
  block: () => /* @__PURE__ */ e.jsxs("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [
1073
1071
  /* @__PURE__ */ e.jsx(
1074
1072
  "path",
@@ -1109,7 +1107,7 @@ const D = ["px", "%", "em", "rem", "ch", "vh", "vw"], ps = {
1109
1107
  }
1110
1108
  )
1111
1109
  ] }),
1112
- "float-none": st,
1110
+ "float-none": Qe,
1113
1111
  // position
1114
1112
  fixed: () => /* @__PURE__ */ e.jsxs("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [
1115
1113
  /* @__PURE__ */ e.jsx(
@@ -1181,101 +1179,101 @@ const D = ["px", "%", "em", "rem", "ch", "vh", "vw"], ps = {
1181
1179
  }
1182
1180
  )
1183
1181
  ] }),
1184
- static: Wt
1185
- }, ae = Qe({ canReset: !1, canChange: !0 }), gs = ({ children: t, canReset: o = !1, canChange: r = !0 }) => (
1182
+ static: Xt
1183
+ }, ne = Ke({ canReset: !1, canChange: !0 }), ns = ({ children: r, canReset: s = !1, canChange: t = !0 }) => (
1186
1184
  // eslint-disable-next-line react/jsx-no-constructed-context-values
1187
- /* @__PURE__ */ e.jsx(ae.Provider, { value: { canReset: o, canChange: r }, children: t })
1188
- ), ht = ({ label: t, property: o, onChange: r }) => {
1189
- const s = _(() => x(me, `${o}.classes`, [""]), [o]), l = ne(o), i = _(() => x(l, "cls", ""), [l]), { canChange: a } = le(ae), p = /\[.*\]/g.test(i);
1190
- return /* @__PURE__ */ e.jsx("div", { className: t ? "w-full rounded" : "grow", children: p ? /* @__PURE__ */ e.jsxs("div", { className: "flex items-center", children: [
1191
- /* @__PURE__ */ e.jsx(kr, { className: "w-[70%] rounded py-1", readOnly: !0, value: i }),
1192
- /* @__PURE__ */ e.jsxs(Y, { delayDuration: 100, children: [
1193
- /* @__PURE__ */ e.jsx(X, { asChild: !0, children: /* @__PURE__ */ e.jsx("button", { type: "button", className: "invisible ml-3 mt-1 text-blue-600 group-hover:visible", children: /* @__PURE__ */ e.jsx(Te, {}) }) }),
1194
- /* @__PURE__ */ e.jsx(Z, { children: "Current value is using a Tailwind arbitrary value." })
1185
+ /* @__PURE__ */ e.jsx(ne.Provider, { value: { canReset: s, canChange: t }, children: r })
1186
+ ), xt = ({ label: r, property: s, onChange: t }) => {
1187
+ const d = _(() => x(ge, `${s}.classes`, [""]), [s]), l = ie(s), n = _(() => x(l, "cls", ""), [l]), { canChange: o } = oe(ne), p = /\[.*\]/g.test(n);
1188
+ return /* @__PURE__ */ e.jsx("div", { className: r ? "w-full rounded" : "grow", children: p ? /* @__PURE__ */ e.jsxs("div", { className: "flex items-center", children: [
1189
+ /* @__PURE__ */ e.jsx(_e, { className: "w-[70%] rounded py-1", readOnly: !0, value: n }),
1190
+ /* @__PURE__ */ e.jsxs(O, { delayDuration: 100, children: [
1191
+ /* @__PURE__ */ e.jsx(F, { 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, {}) }) }),
1192
+ /* @__PURE__ */ e.jsx(Y, { children: "Current value is using a Tailwind arbitrary value." })
1195
1193
  ] })
1196
1194
  ] }) : /* @__PURE__ */ e.jsx(
1197
- Ne,
1195
+ Se,
1198
1196
  {
1199
- rounded: t,
1200
- onChange: (n) => r(n, o),
1201
- selected: i,
1202
- options: s,
1203
- disabled: !a
1197
+ rounded: r,
1198
+ onChange: (i) => t(i, s),
1199
+ selected: n,
1200
+ options: d,
1201
+ disabled: !o
1204
1202
  }
1205
1203
  ) });
1206
1204
  };
1207
- function Ne({ selected: t, onChange: o, rounded: r = !1, options: s, disabled: l = !1 }) {
1208
- const i = t.replace(/.*:/g, "").trim(), { undo: a, redo: p } = Nr();
1205
+ function Se({ selected: r, onChange: s, rounded: t = !1, options: d, disabled: l = !1 }) {
1206
+ const n = r.replace(/.*:/g, "").trim(), { undo: o, redo: p } = vr();
1209
1207
  return /* @__PURE__ */ e.jsxs(
1210
1208
  "select",
1211
1209
  {
1212
- disabled: !s.length || l,
1213
- className: `${r ? "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`,
1214
- onChange: (n) => o(n.target.value),
1215
- onKeyDown: (n) => {
1216
- n.ctrlKey && (n.key === "z" && a(), n.key === "y" && p());
1210
+ disabled: !d.length || l,
1211
+ 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`,
1212
+ onChange: (i) => s(i.target.value),
1213
+ onKeyDown: (i) => {
1214
+ i.ctrlKey && (i.key === "z" && o(), i.key === "y" && p());
1217
1215
  },
1218
- value: i,
1216
+ value: n,
1219
1217
  children: [
1220
1218
  /* @__PURE__ */ e.jsx("option", { className: "bg-transparent", value: "" }),
1221
- I.Children.toArray(
1222
- s.map((n) => /* @__PURE__ */ e.jsx("option", { className: "bg-transparent", value: n, children: n }))
1219
+ $.Children.toArray(
1220
+ d.map((i) => /* @__PURE__ */ e.jsx("option", { className: "bg-transparent", value: i, children: i }))
1223
1221
  )
1224
1222
  ]
1225
1223
  }
1226
1224
  );
1227
1225
  }
1228
- const hs = ({ property: t, onChange: o }) => {
1229
- const { canReset: r, canChange: s } = le(ae), l = ne(t), i = _(() => x(l, "cls", ""), [l]), a = _(() => x(me, `${t}.classes`, [""]), [t]), p = a.indexOf(i) > -1 ? a.indexOf(i) : 0, n = /\[.*\]/g.test(i);
1230
- return /* @__PURE__ */ e.jsx("div", { className: "flex flex-row divide-x divide-solid divide-border rounded border border-border text-xs", children: n ? /* @__PURE__ */ e.jsx("div", { className: "py-[5px] px-2", children: i }) : /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
1226
+ const is = ({ property: r, onChange: s }) => {
1227
+ const { canReset: t, canChange: d } = oe(ne), l = ie(r), n = _(() => x(l, "cls", ""), [l]), o = _(() => x(ge, `${r}.classes`, [""]), [r]), p = o.indexOf(n) > -1 ? o.indexOf(n) : 0, i = /\[.*\]/g.test(n);
1228
+ return /* @__PURE__ */ e.jsx("div", { className: "flex flex-row divide-x divide-solid divide-border rounded border border-border text-xs", children: i ? /* @__PURE__ */ e.jsx("div", { className: "py-[5px] px-2", children: n }) : /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
1231
1229
  /* @__PURE__ */ e.jsx(
1232
1230
  "button",
1233
1231
  {
1234
1232
  type: "button",
1235
1233
  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",
1236
- disabled: !s && (!r || p - 1 < 0),
1237
- onClick: () => o(Be(a, p - 1), t),
1234
+ disabled: !d && (!t || p - 1 < 0),
1235
+ onClick: () => s($e(o, p - 1), r),
1238
1236
  children: /* @__PURE__ */ e.jsx("span", { className: "flex items-center justify-center", children: /* @__PURE__ */ e.jsx(
1239
- Ut,
1237
+ Zt,
1240
1238
  {
1241
- className: !s && (!r || p - 1 < 0) ? "text-gray-500" : "text-black/60 dark:text-white/60"
1239
+ className: !d && (!t || p - 1 < 0) ? "text-gray-500" : "text-black/60 dark:text-white/60"
1242
1240
  }
1243
1241
  ) })
1244
1242
  }
1245
1243
  ),
1246
- /* @__PURE__ */ e.jsx("div", { className: "w-8/12 text-center", children: /* @__PURE__ */ e.jsx(ht, { label: !1, property: t, onChange: o }) }),
1244
+ /* @__PURE__ */ e.jsx("div", { className: "w-8/12 text-center", children: /* @__PURE__ */ e.jsx(xt, { label: !1, property: r, onChange: s }) }),
1247
1245
  /* @__PURE__ */ e.jsx(
1248
1246
  "button",
1249
1247
  {
1250
1248
  type: "button",
1251
1249
  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",
1252
- disabled: !s && (!r || p + 1 >= a.length),
1253
- onClick: () => o(Be(a, p + 1), t),
1250
+ disabled: !d && (!t || p + 1 >= o.length),
1251
+ onClick: () => s($e(o, p + 1), r),
1254
1252
  children: /* @__PURE__ */ e.jsx("span", { className: "flex items-center justify-center", children: /* @__PURE__ */ e.jsx(
1255
- Se,
1253
+ Ve,
1256
1254
  {
1257
- className: !s && (!r || p + 1 >= a.length) ? "text-gray-500" : "text-black/60 dark:text-white/60"
1255
+ className: !d && (!t || p + 1 >= o.length) ? "text-gray-500" : "text-black/60 dark:text-white/60"
1258
1256
  }
1259
1257
  ) })
1260
1258
  }
1261
1259
  )
1262
1260
  ] }) });
1263
- }, ys = ({ property: t, onChange: o }) => {
1264
- const r = _(() => x(me, `${t}.classes`, [""]), [t]), { canChange: s } = le(ae), l = ne(t), i = _(() => x(l, "cls", ""), [l]);
1265
- return /* @__PURE__ */ e.jsx("div", { className: "flex grow flex-wrap gap-1", children: k(r, (a) => /* @__PURE__ */ e.jsxs(Y, { children: [
1266
- /* @__PURE__ */ e.jsx(X, { asChild: !0, children: /* @__PURE__ */ e.jsx(
1261
+ }, ds = ({ property: r, onChange: s }) => {
1262
+ const t = _(() => x(ge, `${r}.classes`, [""]), [r]), { canChange: d } = oe(ne), l = ie(r), n = _(() => x(l, "cls", ""), [l]);
1263
+ return /* @__PURE__ */ e.jsx("div", { className: "flex grow flex-wrap gap-1", children: k(t, (o) => /* @__PURE__ */ e.jsxs(O, { children: [
1264
+ /* @__PURE__ */ e.jsx(F, { asChild: !0, children: /* @__PURE__ */ e.jsx(
1267
1265
  "button",
1268
1266
  {
1269
1267
  type: "button",
1270
- disabled: !s,
1271
- onClick: () => o(a, t),
1272
- 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"}`,
1273
- children: I.createElement(x(gt, a, lt))
1268
+ disabled: !d,
1269
+ onClick: () => s(o, r),
1270
+ className: `cursor-pointer rounded border border-gray-600 p-1 disabled:cursor-not-allowed ${n === o ? " bg-blue-500 text-white" : "disabled:bg-gray-600 disabled:text-gray-400"}`,
1271
+ children: $.createElement(x(ut, o, et))
1274
1272
  }
1275
1273
  ) }),
1276
- /* @__PURE__ */ e.jsx(Z, { children: F(se(a)) })
1274
+ /* @__PURE__ */ e.jsx(Y, { children: E(le(o)) })
1277
1275
  ] })) });
1278
- }, ms = {
1276
+ }, cs = {
1279
1277
  backgroundColor: "bg",
1280
1278
  textColor: "text",
1281
1279
  borderColor: "border",
@@ -1287,39 +1285,39 @@ const hs = ({ property: t, onChange: o }) => {
1287
1285
  toColor: "to",
1288
1286
  ringColor: "ring",
1289
1287
  ringOffsetColor: "ring-offset"
1290
- }, bs = ({ property: t, onChange: o }) => {
1291
- const r = ne(t), s = _(() => x(r, "cls", ""), [r]), { canChange: l } = le(ae), [i, a] = C([]), [p, n] = C({ color: "", shade: "" }), d = s.split("-"), h = x(d, "1", ""), c = x(d, "2", ""), y = V(
1288
+ }, ps = ({ property: r, onChange: s }) => {
1289
+ const t = ie(r), d = _(() => x(t, "cls", ""), [t]), { canChange: l } = oe(ne), [n, o] = w([]), [p, i] = w({ color: "", shade: "" }), c = d.split("-"), h = x(c, "1", ""), a = x(c, "2", ""), g = V(
1292
1290
  // eslint-disable-next-line no-shadow
1293
1291
  (u) => {
1294
- ["current", "inherit", "transparent", "black", "white"].includes(u) ? (a([]), n({ color: u })) : (a(["50", "100", "200", "300", "400", "500", "600", "700", "800", "900"]), n((b) => ({ ...b, color: u, shade: b.shade ? b.shade : "500" })));
1292
+ ["current", "inherit", "transparent", "black", "white"].includes(u) ? (o([]), i({ color: u })) : (o(["50", "100", "200", "300", "400", "500", "600", "700", "800", "900"]), i((f) => ({ ...f, color: u, shade: f.shade ? f.shade : "500" })));
1295
1293
  },
1296
- [a, n]
1294
+ [o, i]
1297
1295
  );
1298
- E(() => {
1296
+ L(() => {
1299
1297
  if (["current", "inherit", "transparent", "black", "white"].includes(h))
1300
- return a([]);
1301
- a(["50", "100", "200", "300", "400", "500", "600", "700", "800", "900"]);
1298
+ return o([]);
1299
+ o(["50", "100", "200", "300", "400", "500", "600", "700", "800", "900"]);
1302
1300
  }, [h]);
1303
- const g = V(
1301
+ const y = V(
1304
1302
  // eslint-disable-next-line no-shadow
1305
1303
  (u) => {
1306
- n({ color: h, shade: u });
1304
+ i({ color: h, shade: u });
1307
1305
  },
1308
1306
  [h]
1309
1307
  );
1310
- return E(() => {
1311
- n({ color: "", shade: "" });
1312
- }, [r]), E(() => {
1313
- const b = `${x(ms, t, "")}-${p.color}${p.shade ? `-${p.shade}` : ""}`;
1314
- b.match(new RegExp(x(me, `${t}.regExp`, ""))) && o(b, t);
1315
- }, [p, o, t]), /* @__PURE__ */ e.jsxs("div", { className: "flex flex-row divide-x divide-solid divide-border rounded-lg border border-border text-xs", children: [
1308
+ return L(() => {
1309
+ i({ color: "", shade: "" });
1310
+ }, [t]), L(() => {
1311
+ const f = `${x(cs, r, "")}-${p.color}${p.shade ? `-${p.shade}` : ""}`;
1312
+ f.match(new RegExp(x(ge, `${r}.regExp`, ""))) && s(f, r);
1313
+ }, [p, s, r]), /* @__PURE__ */ e.jsxs("div", { className: "flex flex-row divide-x divide-solid divide-border rounded-lg border border-border text-xs", children: [
1316
1314
  /* @__PURE__ */ e.jsx("div", { className: "grow text-center", children: /* @__PURE__ */ e.jsx(
1317
- Ne,
1315
+ Se,
1318
1316
  {
1319
1317
  disabled: !l,
1320
1318
  rounded: !0,
1321
1319
  selected: h,
1322
- onChange: y,
1320
+ onChange: g,
1323
1321
  options: [
1324
1322
  "current",
1325
1323
  "transparent",
@@ -1352,233 +1350,233 @@ const hs = ({ property: t, onChange: o }) => {
1352
1350
  ]
1353
1351
  }
1354
1352
  ) }),
1355
- /* @__PURE__ */ e.jsx("button", { type: "button", className: "grow text-center", children: /* @__PURE__ */ e.jsx(Ne, { rounded: !0, selected: c, disabled: !h || !l, onChange: g, options: i }) })
1353
+ /* @__PURE__ */ e.jsx("button", { type: "button", className: "grow text-center", children: /* @__PURE__ */ e.jsx(Se, { rounded: !0, selected: a, disabled: !h || !l, onChange: y, options: n }) })
1356
1354
  ] });
1357
- }, Ke = (t, o) => {
1358
- t = t.toLowerCase();
1359
- let r = t.trim().replace(/ |\+/g, "");
1360
- if ((r === "auto" || r === "none") && o.includes(r))
1361
- return { value: "", unit: r };
1362
- const s = o.length ? new RegExp(o.join("|"), "g") : /XXXXXX/g;
1363
- r = r.replace(s, "");
1364
- const l = t.match(s), i = l && l.length > 1, a = !f(r) && Number.isNaN(Number(r));
1365
- return i || a ? { error: "Invalid value" } : l && (l[0] === "auto" || l[0] === "none") ? { value: l[0], unit: "" } : { value: r, unit: l ? l[0] : "" };
1355
+ }, Ze = (r, s) => {
1356
+ r = r.toLowerCase();
1357
+ let t = r.trim().replace(/ |\+/g, "");
1358
+ if ((t === "auto" || t === "none") && s.includes(t))
1359
+ return { value: "", unit: t };
1360
+ const d = s.length ? new RegExp(s.join("|"), "g") : /XXXXXX/g;
1361
+ t = t.replace(d, "");
1362
+ const l = r.match(d), n = l && l.length > 1, o = !b(t) && Number.isNaN(Number(t));
1363
+ return n || o ? { error: "Invalid value" } : l && (l[0] === "auto" || l[0] === "none") ? { value: l[0], unit: "" } : { value: t, unit: l ? l[0] : "" };
1366
1364
  };
1367
- const fs = (t) => {
1368
- const o = t.startsWith("-") ? "-" : "", r = t.split("-").pop();
1369
- if (["auto", "none"].includes(r))
1370
- return { value: "", unit: r };
1371
- if (r === "px")
1365
+ const us = (r) => {
1366
+ const s = r.startsWith("-") ? "-" : "", t = r.split("-").pop();
1367
+ if (["auto", "none"].includes(t))
1368
+ return { value: "", unit: t };
1369
+ if (t === "px")
1372
1370
  return { value: "1", unit: "px" };
1373
- if (r === "screen")
1374
- return { value: "100", unit: t.indexOf("w-") !== -1 ? "vw" : "vh" };
1375
- if (r === "full")
1371
+ if (t === "screen")
1372
+ return { value: "100", unit: r.indexOf("w-") !== -1 ? "vw" : "vh" };
1373
+ if (t === "full")
1376
1374
  return { value: "100", unit: "%" };
1377
- if (M(t, "skew-"))
1378
- return { value: `${o}${r}`, unit: "deg" };
1379
- if (M(t, "rotate-"))
1380
- return { value: `${o}${r}`, unit: "deg" };
1381
- if (M(t, "opacity-"))
1382
- return { value: `${r / 100}`, unit: "-" };
1383
- if (M(t, "duration-") || M(t, "delay-"))
1384
- return { value: `${r}`, unit: "ms" };
1385
- if (M(t, "translate-") && !r.includes("/"))
1386
- return { value: `${o}${`${r / 4}`}`, unit: "rem" };
1387
- if (M(t, "scale-"))
1388
- return { value: `${o}${`${r / 100}`}`, unit: "-" };
1389
- if (G(t, "border")) {
1390
- const s = t.match(/border-?(x|y|t|r|b|l)?\d+/g);
1391
- if (s)
1392
- return { value: s[0].split("-").pop(), unit: "px" };
1393
- if (t.match(/border-?(x|y|t|r|b|l)?/g))
1375
+ if (M(r, "skew-"))
1376
+ return { value: `${s}${t}`, unit: "deg" };
1377
+ if (M(r, "rotate-"))
1378
+ return { value: `${s}${t}`, unit: "deg" };
1379
+ if (M(r, "opacity-"))
1380
+ return { value: `${t / 100}`, unit: "-" };
1381
+ if (M(r, "duration-") || M(r, "delay-"))
1382
+ return { value: `${t}`, unit: "ms" };
1383
+ if (M(r, "translate-") && !t.includes("/"))
1384
+ return { value: `${s}${`${t / 4}`}`, unit: "rem" };
1385
+ if (M(r, "scale-"))
1386
+ return { value: `${s}${`${t / 100}`}`, unit: "-" };
1387
+ if (G(r, "border")) {
1388
+ const d = r.match(/border-?(x|y|t|r|b|l)?\d+/g);
1389
+ if (d)
1390
+ return { value: d[0].split("-").pop(), unit: "px" };
1391
+ if (r.match(/border-?(x|y|t|r|b|l)?/g))
1394
1392
  return { value: "1", unit: "px" };
1395
1393
  }
1396
- if (G(t, "max-w-")) {
1397
- if (t === "max-w-screen-sm")
1394
+ if (G(r, "max-w-")) {
1395
+ if (r === "max-w-screen-sm")
1398
1396
  return { value: "640", unit: "px" };
1399
- if (t === "max-w-screen-md")
1397
+ if (r === "max-w-screen-md")
1400
1398
  return { value: "768", unit: "px" };
1401
- if (t === "max-w-screen-lg")
1399
+ if (r === "max-w-screen-lg")
1402
1400
  return { value: "1024", unit: "px" };
1403
- if (t === "max-w-screen-xl")
1401
+ if (r === "max-w-screen-xl")
1404
1402
  return { value: "1280", unit: "px" };
1405
- if (t === "max-w-screen-2xl")
1403
+ if (r === "max-w-screen-2xl")
1406
1404
  return { value: "1536", unit: "px" };
1407
- if (r === "xs")
1405
+ if (t === "xs")
1408
1406
  return { value: "320", unit: "px" };
1409
- if (r === "sm")
1407
+ if (t === "sm")
1410
1408
  return { value: "384", unit: "px" };
1411
- if (r === "md")
1409
+ if (t === "md")
1412
1410
  return { value: "448", unit: "px" };
1413
- if (r === "lg")
1411
+ if (t === "lg")
1414
1412
  return { value: "512", unit: "px" };
1415
- if (r === "xl")
1413
+ if (t === "xl")
1416
1414
  return { value: "576", unit: "px" };
1417
- if (r === "2xl")
1415
+ if (t === "2xl")
1418
1416
  return { value: "672", unit: "px" };
1419
- if (r === "3xl")
1417
+ if (t === "3xl")
1420
1418
  return { value: "768", unit: "px" };
1421
- if (r === "4xl")
1419
+ if (t === "4xl")
1422
1420
  return { value: "896", unit: "px" };
1423
- if (r === "5xl")
1421
+ if (t === "5xl")
1424
1422
  return { value: "1024", unit: "px" };
1425
- if (r === "6xl")
1423
+ if (t === "6xl")
1426
1424
  return { value: "1152", unit: "px" };
1427
- if (r === "7xl")
1425
+ if (t === "7xl")
1428
1426
  return { value: "1280", unit: "px" };
1429
- if (r === "prose")
1427
+ if (t === "prose")
1430
1428
  return { value: "65", unit: "ch" };
1431
1429
  }
1432
- if (G(t, "text-")) {
1433
- if (r === "xs")
1430
+ if (G(r, "text-")) {
1431
+ if (t === "xs")
1434
1432
  return { value: "12", unit: "px" };
1435
- if (r === "sm")
1433
+ if (t === "sm")
1436
1434
  return { value: "14", unit: "px" };
1437
- if (r === "base")
1435
+ if (t === "base")
1438
1436
  return { value: "16", unit: "px" };
1439
- if (r === "lg")
1437
+ if (t === "lg")
1440
1438
  return { value: "18", unit: "px" };
1441
- if (r === "xl")
1439
+ if (t === "xl")
1442
1440
  return { value: "20", unit: "px" };
1443
- if (r === "2xl")
1441
+ if (t === "2xl")
1444
1442
  return { value: "24", unit: "px" };
1445
- if (r === "3xl")
1443
+ if (t === "3xl")
1446
1444
  return { value: "30", unit: "px" };
1447
- if (r === "4xl")
1445
+ if (t === "4xl")
1448
1446
  return { value: "36", unit: "px" };
1449
- if (r === "5xl")
1447
+ if (t === "5xl")
1450
1448
  return { value: "48", unit: "px" };
1451
- if (r === "6xl")
1449
+ if (t === "6xl")
1452
1450
  return { value: "60", unit: "px" };
1453
- if (r === "7xl")
1451
+ if (t === "7xl")
1454
1452
  return { value: "72", unit: "px" };
1455
- if (r === "8xl")
1453
+ if (t === "8xl")
1456
1454
  return { value: "96", unit: "px" };
1457
- if (r === "9xl")
1455
+ if (t === "9xl")
1458
1456
  return { value: "128", unit: "px" };
1459
1457
  }
1460
- if (G(t, "leading-")) {
1461
- if (r === "none")
1458
+ if (G(r, "leading-")) {
1459
+ if (t === "none")
1462
1460
  return { value: "1", unit: "-" };
1463
- if (r === "tight")
1461
+ if (t === "tight")
1464
1462
  return { value: "1.25", unit: "-" };
1465
- if (r === "snug")
1463
+ if (t === "snug")
1466
1464
  return { value: "1.375", unit: "-" };
1467
- if (r === "normal")
1465
+ if (t === "normal")
1468
1466
  return { value: "1.5", unit: "-" };
1469
- if (r === "relaxed")
1467
+ if (t === "relaxed")
1470
1468
  return { value: "1.625", unit: "-" };
1471
- if (r === "loose")
1469
+ if (t === "loose")
1472
1470
  return { value: "2", unit: "-" };
1473
1471
  }
1474
- if (G(t, "tracking-")) {
1475
- if (r === "tighter")
1472
+ if (G(r, "tracking-")) {
1473
+ if (t === "tighter")
1476
1474
  return { value: "-0.05", unit: "em" };
1477
- if (r === "tight")
1475
+ if (t === "tight")
1478
1476
  return { value: "-0.025", unit: "em" };
1479
- if (r === "normal")
1477
+ if (t === "normal")
1480
1478
  return { value: "0", unit: "em" };
1481
- if (r === "wide")
1479
+ if (t === "wide")
1482
1480
  return { value: "0.025", unit: "em" };
1483
- if (r === "wider")
1481
+ if (t === "wider")
1484
1482
  return { value: "0.05", unit: "em" };
1485
- if (r === "widest")
1483
+ if (t === "widest")
1486
1484
  return { value: "0.1", unit: "em" };
1487
1485
  }
1488
- if (["max", "min", "fit"].includes(r))
1489
- return { value: t, unit: "class" };
1490
- if (r.includes("/")) {
1491
- const [s, l] = k(r.split("/"), (i) => parseInt(i, 10));
1492
- return { value: o + (s / l * 100).toFixed(2).replace(".00", ""), unit: "%" };
1486
+ if (["max", "min", "fit"].includes(t))
1487
+ return { value: r, unit: "class" };
1488
+ if (t.includes("/")) {
1489
+ const [d, l] = k(t.split("/"), (n) => parseInt(n, 10));
1490
+ return { value: s + (d / l * 100).toFixed(2).replace(".00", ""), unit: "%" };
1493
1491
  }
1494
- return Vt(parseFloat(r)) ? { value: `${o + parseFloat(r) * 4}`, unit: "px" } : { value: r, unit: "class" };
1492
+ return Tt(parseFloat(t)) ? { value: `${s + parseFloat(t) * 4}`, unit: "px" } : { value: t, unit: "class" };
1495
1493
  };
1496
- const vs = (t) => {
1497
- if (f(t))
1494
+ const xs = (r) => {
1495
+ if (b(r))
1498
1496
  return { value: "", unit: "" };
1499
- const o = t.match(/\[.*\]/g);
1500
- if (o === null)
1501
- return js(t);
1502
- const r = x(o, "0", "").replace(/\[|\]/g, ""), s = t.startsWith("-") ? "-" : "", l = ge(r.match(/\d+.\d+|\d+/g));
1503
- return { value: `${s}${l}`, unit: r.replace(l, "") };
1504
- }, js = (t) => f(t) ? { value: "", unit: "" } : fs(t), yt = I.createContext({
1497
+ const s = r.match(/\[.*\]/g);
1498
+ if (s === null)
1499
+ return gs(r);
1500
+ const t = x(s, "0", "").replace(/\[|\]/g, ""), d = r.startsWith("-") ? "-" : "", l = ae(t.match(/\d+.\d+|\d+/g));
1501
+ return { value: `${d}${l}`, unit: t.replace(l, "") };
1502
+ }, gs = (r) => b(r) ? { value: "", unit: "" } : us(r), gt = $.createContext({
1505
1503
  setDragData: () => {
1506
1504
  }
1507
- }), ws = ({
1508
- unit: t,
1509
- currentValue: o,
1510
- onDrag: r,
1511
- onDragEnd: s,
1505
+ }), hs = ({
1506
+ unit: r,
1507
+ currentValue: s,
1508
+ onDrag: t,
1509
+ onDragEnd: d,
1512
1510
  onDragStart: l,
1513
- negative: i,
1514
- cssProperty: a
1511
+ negative: n,
1512
+ cssProperty: o
1515
1513
  }) => {
1516
- const { setDragData: p } = le(yt);
1514
+ const { setDragData: p } = oe(gt);
1517
1515
  return /* @__PURE__ */ e.jsx(
1518
1516
  "button",
1519
1517
  {
1520
1518
  type: "button",
1521
- onMouseDown: (n) => {
1522
- const d = {
1523
- onDrag: r,
1524
- onDragEnd: s,
1519
+ onMouseDown: (i) => {
1520
+ const c = {
1521
+ onDrag: t,
1522
+ onDragEnd: d,
1525
1523
  dragging: !0,
1526
- dragStartY: n.pageY,
1527
- dragStartValue: `${o}`,
1528
- dragUnit: t,
1529
- negative: i,
1530
- cssProperty: a
1524
+ dragStartY: i.pageY,
1525
+ dragStartValue: `${s}`,
1526
+ dragUnit: r,
1527
+ negative: n,
1528
+ cssProperty: o
1531
1529
  };
1532
- l(d), p(d);
1530
+ l(c), p(c);
1533
1531
  },
1534
1532
  color: void 0,
1535
1533
  className: "relative z-50 ml-1 hidden h-6 cursor-row-resize rounded bg-background/70 px-2 group-hover:inline",
1536
- children: /* @__PURE__ */ e.jsx(Gt, {})
1534
+ children: /* @__PURE__ */ e.jsx(Wt, {})
1537
1535
  }
1538
1536
  );
1539
- }, Cs = ({ onSelect: t, current: o, units: r }) => /* @__PURE__ */ e.jsx("div", { "data-theme": "light", className: "-m-[7px] -mx-[13px] flex w-9 flex-col", children: r.map((s) => /* @__PURE__ */ e.jsx(
1540
- oe,
1537
+ }, ys = ({ onSelect: r, current: s, units: t }) => /* @__PURE__ */ e.jsx("div", { "data-theme": "light", className: "-m-[7px] -mx-[13px] flex w-9 flex-col", children: t.map((d) => /* @__PURE__ */ e.jsx(
1538
+ U,
1541
1539
  {
1542
1540
  className: "h-max rounded-none px-1 py-1 text-right text-[11px] hover:bg-blue-400",
1543
- color: o === s ? "primary" : void 0,
1541
+ color: s === d ? "primary" : void 0,
1544
1542
  size: "sm",
1545
1543
  onClick: (l) => {
1546
- l.stopPropagation(), t(s);
1544
+ l.stopPropagation(), r(d);
1547
1545
  },
1548
- children: s
1546
+ children: d
1549
1547
  },
1550
- s
1551
- )) }), qe = 50, ks = (t) => {
1552
- const [o, r] = C(!1), [s, l] = C(""), { currentClass: i, onChange: a, classPrefix: p, cssProperty: n, units: d, negative: h } = t, [c, y] = C(n != null && n.toLowerCase().includes("width") ? "%" : d[0]), [g, u] = C(!1), [b, j] = C(""), [$, w] = C(!1), [P, L] = C(!1);
1553
- E(() => {
1554
- const { value: m, unit: v } = vs(i);
1548
+ d
1549
+ )) }), We = 50, ms = (r) => {
1550
+ const [s, t] = w(!1), [d, l] = w(""), { currentClass: n, onChange: o, classPrefix: p, cssProperty: i, units: c, negative: h } = r, [a, g] = w(i != null && i.toLowerCase().includes("width") ? "%" : c[0]), [y, u] = w(!1), [f, j] = w(""), [B, C] = w(!1), [I, X] = w(!1);
1551
+ L(() => {
1552
+ const { value: m, unit: v } = xs(n);
1555
1553
  if (v === "") {
1556
- l(m), y(n != null && n.toLowerCase().includes("width") ? "%" : ge(d));
1554
+ l(m), g(i != null && i.toLowerCase().includes("width") ? "%" : ae(c));
1557
1555
  return;
1558
1556
  }
1559
- y(v), l(v === "class" || f(m) ? "" : m);
1560
- }, [i, n, d]);
1561
- const N = je((m) => a(m), [a], qe), B = je((m) => a(m, !1), [a], qe), z = V(
1557
+ g(v), l(v === "class" || b(m) ? "" : m);
1558
+ }, [n, i, c]);
1559
+ const N = fe((m) => o(m), [o], We), P = fe((m) => o(m, !1), [o], We), W = V(
1562
1560
  (m = !1) => {
1563
- const v = Ke(`${s}`, d);
1561
+ const v = Ze(`${d}`, c);
1564
1562
  if (x(v, "error", !1)) {
1565
1563
  u(!0);
1566
1564
  return;
1567
1565
  }
1568
- const S = x(v, "unit") !== "" ? x(v, "unit") : c;
1569
- if (S === "auto" || S === "none") {
1570
- N(`${p}${S}`);
1566
+ const T = x(v, "unit") !== "" ? x(v, "unit") : a;
1567
+ if (T === "auto" || T === "none") {
1568
+ N(`${p}${T}`);
1571
1569
  return;
1572
1570
  }
1573
1571
  if (x(v, "value") === "")
1574
1572
  return;
1575
- const J = `${x(v, "value", "").startsWith("-") ? "-" : ""}${p}[${x(v, "value", "").replace("-", "")}${S === "-" ? "" : S}]`;
1576
- m ? B(J) : N(J);
1573
+ const Q = `${x(v, "value", "").startsWith("-") ? "-" : ""}${p}[${x(v, "value", "").replace("-", "")}${T === "-" ? "" : T}]`;
1574
+ m ? P(Q) : N(Q);
1577
1575
  },
1578
- [N, B, s, c, p, d]
1579
- ), q = V(
1576
+ [N, P, d, a, p, c]
1577
+ ), J = V(
1580
1578
  (m) => {
1581
- const v = Ke(`${s}`, d);
1579
+ const v = Ze(`${d}`, c);
1582
1580
  if (x(v, "error", !1)) {
1583
1581
  u(!0);
1584
1582
  return;
@@ -1589,108 +1587,108 @@ const vs = (t) => {
1589
1587
  }
1590
1588
  if (x(v, "value") === "")
1591
1589
  return;
1592
- const S = x(v, "unit") !== "" ? x(v, "unit") : m, J = `${x(v, "value", "").startsWith("-") ? "-" : ""}${p}[${x(v, "value", "").replace("-", "")}${S === "-" ? "" : S}]`;
1593
- N(J);
1590
+ const T = x(v, "unit") !== "" ? x(v, "unit") : m, Q = `${x(v, "value", "").startsWith("-") ? "-" : ""}${p}[${x(v, "value", "").replace("-", "")}${T === "-" ? "" : T}]`;
1591
+ N(Q);
1594
1592
  },
1595
- [N, s, p, d]
1593
+ [N, d, p, c]
1596
1594
  );
1597
- return /* @__PURE__ */ e.jsx("div", { className: "flex w-full flex-col", children: /* @__PURE__ */ e.jsx("div", { className: "flex items-center justify-start", children: c === "class" ? /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
1598
- /* @__PURE__ */ e.jsx("input", { className: "w-20 rounded py-1", readOnly: !0, value: i }),
1599
- /* @__PURE__ */ e.jsxs(Y, { children: [
1600
- /* @__PURE__ */ e.jsx(X, { asChild: !0, children: /* @__PURE__ */ e.jsx("button", { type: "button", className: "invisible ml-3 mt-1 text-blue-600 group-hover:visible", children: /* @__PURE__ */ e.jsx(Te, {}) }) }),
1601
- /* @__PURE__ */ e.jsx(Z, { children: "Current value is using a Tailwind preset class." })
1595
+ return /* @__PURE__ */ e.jsx("div", { className: "flex w-full flex-col", children: /* @__PURE__ */ e.jsx("div", { className: "flex items-center justify-start", children: a === "class" ? /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
1596
+ /* @__PURE__ */ e.jsx("input", { className: "w-20 rounded py-1", readOnly: !0, value: n }),
1597
+ /* @__PURE__ */ e.jsxs(O, { children: [
1598
+ /* @__PURE__ */ e.jsx(F, { 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, {}) }) }),
1599
+ /* @__PURE__ */ e.jsx(Y, { children: "Current value is using a Tailwind preset class." })
1602
1600
  ] })
1603
- ] }) : /* @__PURE__ */ e.jsxs("div", { className: `group relative flex items-center ${$ ? "z-auto" : ""}`, children: [
1601
+ ] }) : /* @__PURE__ */ e.jsxs("div", { className: `group relative flex items-center ${B ? "z-auto" : ""}`, children: [
1604
1602
  /* @__PURE__ */ e.jsxs("div", { className: "flex items-center rounded-md border border-border", children: [
1605
- ["none", "auto"].indexOf(c) !== -1 ? null : /* @__PURE__ */ e.jsx(
1603
+ ["none", "auto"].indexOf(a) !== -1 ? null : /* @__PURE__ */ e.jsx(
1606
1604
  "input",
1607
1605
  {
1608
- readOnly: c === "class",
1606
+ readOnly: a === "class",
1609
1607
  onKeyPress: (m) => {
1610
- m.key === "Enter" && z();
1608
+ m.key === "Enter" && W();
1611
1609
  },
1612
1610
  onKeyDown: (m) => {
1613
1611
  if (m.keyCode !== 38 && m.keyCode !== 40)
1614
1612
  return;
1615
- m.preventDefault(), L(!0);
1616
- const v = Ht(m.target.value);
1617
- let S = tt(v) ? 0 : v;
1618
- m.keyCode === 38 && (S += 1), m.keyCode === 40 && (S -= 1);
1619
- const O = `${S}`, bt = `${O.startsWith("-") ? "-" : ""}${p}[${O.replace("-", "")}${c === "-" ? "" : c}]`;
1620
- B(bt);
1613
+ m.preventDefault(), X(!0);
1614
+ const v = St(m.target.value);
1615
+ let T = qe(v) ? 0 : v;
1616
+ m.keyCode === 38 && (T += 1), m.keyCode === 40 && (T -= 1);
1617
+ const Z = `${T}`, yt = `${Z.startsWith("-") ? "-" : ""}${p}[${Z.replace("-", "")}${a === "-" ? "" : a}]`;
1618
+ P(yt);
1621
1619
  },
1622
1620
  onKeyUp: (m) => {
1623
- P && (m.preventDefault(), L(!1));
1621
+ I && (m.preventDefault(), X(!1));
1624
1622
  },
1625
- onBlur: () => z(),
1623
+ onBlur: () => W(),
1626
1624
  onChange: (m) => {
1627
1625
  u(!1), l(m.target.value);
1628
1626
  },
1629
1627
  onClick: (m) => {
1630
1628
  var v;
1631
- (v = m == null ? void 0 : m.target) == null || v.select(), r(!1);
1629
+ (v = m == null ? void 0 : m.target) == null || v.select(), t(!1);
1632
1630
  },
1633
- value: $ ? b : s,
1631
+ value: B ? f : d,
1634
1632
  className: "h-6 w-14 rounded rounded-r-none bg-background pl-2 text-sm focus-visible:outline-0 ".concat(
1635
1633
  " ",
1636
- g ? "border-red-500 text-red-500" : "border-foreground/20"
1634
+ y ? "border-red-500 text-red-500" : "border-foreground/20"
1637
1635
  )
1638
1636
  }
1639
1637
  ),
1640
- /* @__PURE__ */ e.jsxs(Y, { open: o, delayDuration: 100, children: [
1641
- /* @__PURE__ */ e.jsx(X, { asChild: !0, children: /* @__PURE__ */ e.jsxs(
1638
+ /* @__PURE__ */ e.jsxs(O, { open: s, delayDuration: 100, children: [
1639
+ /* @__PURE__ */ e.jsx(F, { asChild: !0, children: /* @__PURE__ */ e.jsxs(
1642
1640
  "button",
1643
1641
  {
1644
1642
  type: "button",
1645
- onClick: () => r(!o),
1643
+ onClick: () => t(!s),
1646
1644
  className: "flex h-6 cursor-pointer items-center gap-x-1 rounded rounded-l-none bg-background p-px px-1 text-[11px] uppercase",
1647
1645
  children: [
1648
- /* @__PURE__ */ e.jsx("span", { className: `inline-block ${d.length === 1 ? "px-2 font-semibold" : ""}`, children: c }),
1649
- d.length > 1 ? /* @__PURE__ */ e.jsx(Kt, {}) : null
1646
+ /* @__PURE__ */ e.jsx("span", { className: `inline-block ${c.length === 1 ? "px-2 font-semibold" : ""}`, children: a }),
1647
+ c.length > 1 ? /* @__PURE__ */ e.jsx(Ut, {}) : null
1650
1648
  ]
1651
1649
  }
1652
1650
  ) }),
1653
- /* @__PURE__ */ e.jsx(_r, { children: /* @__PURE__ */ e.jsx(Z, { className: "bg-background", children: /* @__PURE__ */ e.jsx(
1654
- Cs,
1651
+ /* @__PURE__ */ e.jsx(jr, { children: /* @__PURE__ */ e.jsx(Y, { className: "bg-background", children: /* @__PURE__ */ e.jsx(
1652
+ ys,
1655
1653
  {
1656
- units: d,
1657
- current: c,
1654
+ units: c,
1655
+ current: a,
1658
1656
  onSelect: (m) => {
1659
- r(!1), y(m), q(m);
1657
+ t(!1), g(m), J(m);
1660
1658
  }
1661
1659
  }
1662
1660
  ) }) })
1663
1661
  ] })
1664
1662
  ] }),
1665
- ["none", "auto"].indexOf(c) !== -1 || $ ? null : /* @__PURE__ */ e.jsx(
1666
- ws,
1663
+ ["none", "auto"].indexOf(a) !== -1 || B ? null : /* @__PURE__ */ e.jsx(
1664
+ hs,
1667
1665
  {
1668
- onDragStart: () => w(!0),
1666
+ onDragStart: () => C(!0),
1669
1667
  onDragEnd: (m) => {
1670
- if (j(() => ""), w(!1), f(m))
1668
+ if (j(() => ""), C(!1), b(m))
1671
1669
  return;
1672
- const v = `${m}`, O = `${v.startsWith("-") ? "-" : ""}${p}[${v.replace("-", "")}${c === "-" ? "" : c}]`;
1673
- N(O);
1670
+ const v = `${m}`, Z = `${v.startsWith("-") ? "-" : ""}${p}[${v.replace("-", "")}${a === "-" ? "" : a}]`;
1671
+ N(Z);
1674
1672
  },
1675
1673
  onDrag: (m) => {
1676
- if (f(m))
1674
+ if (b(m))
1677
1675
  return;
1678
1676
  j(m);
1679
- const v = `${m}`, O = `${v.startsWith("-") ? "-" : ""}${p}[${v.replace("-", "")}${c === "-" ? "" : c}]`;
1680
- B(O);
1677
+ const v = `${m}`, Z = `${v.startsWith("-") ? "-" : ""}${p}[${v.replace("-", "")}${a === "-" ? "" : a}]`;
1678
+ P(Z);
1681
1679
  },
1682
- currentValue: s,
1683
- unit: c,
1680
+ currentValue: d,
1681
+ unit: a,
1684
1682
  negative: h,
1685
- cssProperty: n
1683
+ cssProperty: i
1686
1684
  }
1687
1685
  )
1688
1686
  ] }) }) });
1689
- }, ne = (t) => {
1690
- const o = ye();
1691
- return Dt(o, { property: t });
1692
- }, Ns = (t, o) => {
1693
- const r = {
1687
+ }, ie = (r) => {
1688
+ const s = xe();
1689
+ return Rt(s, { property: r });
1690
+ }, bs = (r, s) => {
1691
+ const t = {
1694
1692
  xs: 0,
1695
1693
  sm: 1,
1696
1694
  md: 2,
@@ -1698,8 +1696,8 @@ const vs = (t) => {
1698
1696
  xl: 4,
1699
1697
  "2xl": 5
1700
1698
  };
1701
- return r[x(t, "mq", "xs")] <= r[o];
1702
- }, _s = {
1699
+ return t[x(r, "mq", "xs")] <= t[s];
1700
+ }, fs = {
1703
1701
  width: "w-",
1704
1702
  height: "h-",
1705
1703
  minWidth: "min-w-",
@@ -1765,87 +1763,87 @@ const vs = (t) => {
1765
1763
  insetY: "inset-y-",
1766
1764
  opacity: "opacity-",
1767
1765
  flexBasis: "basis-"
1768
- }, Je = {
1766
+ }, Ue = {
1769
1767
  xs: "",
1770
1768
  sm: "640px",
1771
1769
  md: "768px",
1772
1770
  lg: "1024px",
1773
1771
  xl: "1280px",
1774
1772
  "2xl": "1536px"
1775
- }, Ss = (t) => `${t.toUpperCase()} ${Je[t] ? `(${Je[t]} & up)` : ""}`, $e = (t) => {
1776
- const { t: o } = W(), { type: r = "icons", label: s, property: l, onEmitChange: i = () => {
1777
- }, units: a, negative: p = !1 } = t, [n] = Sr(), [d] = ct(), [, h] = Ie(), c = ne(l), y = Re(), g = it(), [u] = dt(), b = _(() => x(c, "fullCls", ""), [c]), j = V(
1778
- (B, z = !0) => {
1779
- const q = { dark: n, mq: h, mod: d, cls: B, property: l, fullCls: "" };
1780
- (n || d !== "") && (q.mq = "xs");
1781
- const m = es(q);
1782
- y(u, [m], z);
1773
+ }, vs = (r) => `${r.toUpperCase()} ${Ue[r] ? `(${Ue[r]} & up)` : ""}`, Ie = (r) => {
1774
+ const { t: s } = z(), { type: t = "icons", label: d, property: l, onEmitChange: n = () => {
1775
+ }, units: o, negative: p = !1 } = r, [i] = wr(), [c] = it(), [, h] = Me(), a = ie(l), g = De(), y = ot(), [u] = at(), f = _(() => x(a, "fullCls", ""), [a]), j = V(
1776
+ (P, W = !0) => {
1777
+ const J = { dark: i, mq: h, mod: c, cls: P, property: l, fullCls: "" };
1778
+ (i || c !== "") && (J.mq = "xs");
1779
+ const m = Kr(J);
1780
+ g(u, [m], W);
1783
1781
  },
1784
- [u, n, h, d, l, y]
1785
- ), $ = V(() => {
1786
- g(u, [b]);
1787
- }, [u, b, g]), w = _(() => Ns(c, h), [c, h]);
1788
- E(() => {
1789
- i(w, c);
1790
- }, [w, i, c]);
1791
- const [, , P] = Ie(), L = V(
1792
- (B) => {
1793
- P({
1782
+ [u, i, h, c, l, g]
1783
+ ), B = V(() => {
1784
+ y(u, [f]);
1785
+ }, [u, f, y]), C = _(() => bs(a, h), [a, h]);
1786
+ L(() => {
1787
+ n(C, a);
1788
+ }, [C, n, a]);
1789
+ const [, , I] = Me(), X = V(
1790
+ (P) => {
1791
+ I({
1794
1792
  xs: 400,
1795
1793
  sm: 640,
1796
1794
  md: 800,
1797
1795
  lg: 1024,
1798
1796
  xl: 1420,
1799
1797
  "2xl": 1920
1800
- }[B]);
1798
+ }[P]);
1801
1799
  },
1802
- [P]
1803
- ), N = x(c, "dark", null) === n && x(c, "mod", null) === d && x(c, "mq", null) === h;
1804
- return /* @__PURE__ */ e.jsx(gs, { canChange: w, canReset: c && N, children: /* @__PURE__ */ e.jsxs("div", { className: "group flex flex-row items-center py-2 first:pt-0 last:pb-0", children: [
1805
- /* @__PURE__ */ e.jsx("div", { className: "relative w-[70px] truncate text-xs text-foreground", children: /* @__PURE__ */ e.jsx("span", { className: `text-[11px] ${c && !N ? "text-foreground" : ""}`, children: o(s) }) }),
1800
+ [I]
1801
+ ), N = x(a, "dark", null) === i && x(a, "mod", null) === c && x(a, "mq", null) === h;
1802
+ return /* @__PURE__ */ e.jsx(ns, { canChange: C, canReset: a && N, children: /* @__PURE__ */ e.jsxs("div", { className: "group flex flex-row items-center py-2 first:pt-0 last:pb-0", children: [
1803
+ /* @__PURE__ */ e.jsx("div", { className: "relative w-[70px] truncate text-xs text-foreground", children: /* @__PURE__ */ e.jsx("span", { className: `text-[11px] ${a && !N ? "text-foreground" : ""}`, children: s(d) }) }),
1806
1804
  /* @__PURE__ */ e.jsxs("div", { className: "flex flex-row items-center", children: [
1807
1805
  /* @__PURE__ */ e.jsxs("div", { className: "w-[150px]", children: [
1808
- r === "arbitrary" ? /* @__PURE__ */ e.jsx(
1809
- ks,
1806
+ t === "arbitrary" ? /* @__PURE__ */ e.jsx(
1807
+ ms,
1810
1808
  {
1811
- currentClass: x(c, "cls", ""),
1812
- classPrefix: x(_s, l, ""),
1813
- units: a || [],
1809
+ currentClass: x(a, "cls", ""),
1810
+ classPrefix: x(fs, l, ""),
1811
+ units: o || [],
1814
1812
  onChange: j,
1815
1813
  negative: p,
1816
1814
  cssProperty: l
1817
1815
  }
1818
1816
  ) : null,
1819
- r === "icons" && /* @__PURE__ */ e.jsx(ys, { property: l, onChange: j }),
1820
- r === "range" && /* @__PURE__ */ e.jsx(hs, { property: l, onChange: j }),
1821
- r === "color" && /* @__PURE__ */ e.jsx(bs, { property: l, onChange: j }),
1822
- r === "dropdown" && /* @__PURE__ */ e.jsx(ht, { label: s, property: l, onChange: j })
1817
+ t === "icons" && /* @__PURE__ */ e.jsx(ds, { property: l, onChange: j }),
1818
+ t === "range" && /* @__PURE__ */ e.jsx(is, { property: l, onChange: j }),
1819
+ t === "color" && /* @__PURE__ */ e.jsx(ps, { property: l, onChange: j }),
1820
+ t === "dropdown" && /* @__PURE__ */ e.jsx(xt, { label: d, property: l, onChange: j })
1823
1821
  ] }),
1824
- /* @__PURE__ */ e.jsx("div", { className: `w-[30px] cursor-pointer ${b ? "visible" : "invisible"}`, children: N ? /* @__PURE__ */ e.jsx("button", { type: "button", onClick: () => $(), 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" }) }) : w && c ? /* @__PURE__ */ e.jsxs(Y, { delayDuration: 100, children: [
1825
- /* @__PURE__ */ e.jsx(X, { asChild: !0, children: /* @__PURE__ */ e.jsx(
1822
+ /* @__PURE__ */ e.jsx("div", { className: `w-[30px] cursor-pointer ${f ? "visible" : "invisible"}`, children: N ? /* @__PURE__ */ e.jsx("button", { type: "button", onClick: () => B(), title: "Reset", className: "flex px-1.5 text-xs", children: /* @__PURE__ */ e.jsx(Kt, { className: "h-5 w-5 text-blue-500 hover:opacity-80" }) }) : C && a ? /* @__PURE__ */ e.jsxs(O, { delayDuration: 100, children: [
1823
+ /* @__PURE__ */ e.jsx(F, { asChild: !0, children: /* @__PURE__ */ e.jsx(
1826
1824
  "button",
1827
1825
  {
1828
1826
  type: "button",
1829
1827
  className: "invisible ml-3 mt-1 rounded-full bg-blue-500 text-white group-hover:visible",
1830
- children: /* @__PURE__ */ e.jsx(Te, {})
1828
+ children: /* @__PURE__ */ e.jsx(He, {})
1831
1829
  }
1832
1830
  ) }),
1833
- /* @__PURE__ */ e.jsx(Z, { children: /* @__PURE__ */ e.jsx("div", { className: "text-right", children: /* @__PURE__ */ e.jsxs("div", { children: [
1831
+ /* @__PURE__ */ e.jsx(Y, { children: /* @__PURE__ */ e.jsx("div", { className: "text-right", children: /* @__PURE__ */ e.jsxs("div", { children: [
1834
1832
  "Current style is set at  ",
1835
1833
  /* @__PURE__ */ e.jsxs("span", { className: "font-bold", children: [
1836
- Ss(x(c, "mq")),
1837
- n && !c.dark ? "(Light mode)" : ""
1834
+ vs(x(a, "mq")),
1835
+ i && !a.dark ? "(Light mode)" : ""
1838
1836
  ] }),
1839
1837
  /* @__PURE__ */ e.jsx("br", {}),
1840
1838
  /* @__PURE__ */ e.jsxs(
1841
1839
  "button",
1842
1840
  {
1843
1841
  type: "button",
1844
- onClick: () => L(x(c, "mq")),
1842
+ onClick: () => X(x(a, "mq")),
1845
1843
  className: "block w-full cursor-default text-right font-semibold text-blue-500",
1846
1844
  children: [
1847
1845
  "Switch to ",
1848
- x(c, "mq").toUpperCase()
1846
+ x(a, "mq").toUpperCase()
1849
1847
  ]
1850
1848
  }
1851
1849
  )
@@ -1853,68 +1851,68 @@ const vs = (t) => {
1853
1851
  ] }) : null })
1854
1852
  ] })
1855
1853
  ] }) });
1856
- }, Ts = ["px", "%", "em", "rem", "ch", "vh", "vw"], mt = ({
1857
- label: t,
1858
- options: o,
1859
- borderB: r = !1,
1860
- borderT: s = !1,
1854
+ }, js = ["px", "%", "em", "rem", "ch", "vh", "vw"], ht = ({
1855
+ label: r,
1856
+ options: s,
1857
+ borderB: t = !1,
1858
+ borderT: d = !1,
1861
1859
  type: l = "arbitrary",
1862
- units: i = Ts,
1863
- negative: a = !1
1860
+ units: n = js,
1861
+ negative: o = !1
1864
1862
  }) => {
1865
- const { t: p } = W(), [n, d] = C(o[0].key), h = ye(), c = V((y) => k(h, "property").includes(y), [h]);
1863
+ const { t: p } = z(), [i, c] = w(s[0].key), h = xe(), a = V((g) => k(h, "property").includes(g), [h]);
1866
1864
  return /* @__PURE__ */ e.jsxs(
1867
1865
  "div",
1868
1866
  {
1869
- className: `mb-2 border-gray-800 py-2 first:pt-0 last:pb-0 ${r ? "border-b" : ""} ${s ? "border-t" : ""}`,
1867
+ className: `mb-2 border-gray-800 py-2 first:pt-0 last:pb-0 ${t ? "border-b" : ""} ${d ? "border-t" : ""}`,
1870
1868
  children: [
1871
1869
  /* @__PURE__ */ e.jsxs("div", { className: "flex flex-row text-xs", children: [
1872
- t && /* @__PURE__ */ e.jsx("span", { className: "relative w-[70px] flex-none text-xs text-foreground", children: p(t) }),
1873
- /* @__PURE__ */ e.jsx("div", { className: "mb-3 flex grow flex-row flex-wrap gap-x-px", children: I.Children.toArray(
1874
- o.map(({ label: y, key: g }) => /* @__PURE__ */ e.jsx("div", { className: "first:rounded-l last:rounded-r", children: /* @__PURE__ */ e.jsxs(Y, { children: [
1875
- /* @__PURE__ */ e.jsx(X, { asChild: !0, children: /* @__PURE__ */ e.jsxs(
1870
+ r && /* @__PURE__ */ e.jsx("span", { className: "relative w-[70px] flex-none text-xs text-foreground", children: p(r) }),
1871
+ /* @__PURE__ */ e.jsx("div", { className: "mb-3 flex grow flex-row flex-wrap gap-x-px", children: $.Children.toArray(
1872
+ s.map(({ label: g, key: y }) => /* @__PURE__ */ e.jsx("div", { className: "first:rounded-l last:rounded-r", children: /* @__PURE__ */ e.jsxs(O, { children: [
1873
+ /* @__PURE__ */ e.jsx(F, { asChild: !0, children: /* @__PURE__ */ e.jsxs(
1876
1874
  "button",
1877
1875
  {
1878
1876
  type: "button",
1879
- onClick: () => d(g),
1880
- className: `relative cursor-pointer rounded-full p-1 text-[8px] ${g === n ? " bg-[#3E57F0] text-white" : "text-gray-600 dark:text-gray-300"}`,
1877
+ onClick: () => c(y),
1878
+ className: `relative cursor-pointer rounded-full p-1 text-[8px] ${y === i ? " bg-[#3E57F0] text-white" : "text-gray-600 dark:text-gray-300"}`,
1881
1879
  children: [
1882
- I.createElement("div", {
1883
- className: c(g) ? "-bottom-1.5 absolute bg-[#3E57F0] h-[2px] left-0 w-full" : ""
1880
+ $.createElement("div", {
1881
+ className: a(y) ? "-bottom-1.5 absolute bg-[#3E57F0] h-[2px] left-0 w-full" : ""
1884
1882
  }),
1885
- I.createElement(x(gt, g, lt), { className: "text-inherit w-3 h-3" })
1883
+ $.createElement(x(ut, y, et), { className: "text-inherit w-3 h-3" })
1886
1884
  ]
1887
1885
  }
1888
1886
  ) }),
1889
- /* @__PURE__ */ e.jsx(Z, { children: F(se(y)) })
1887
+ /* @__PURE__ */ e.jsx(Y, { children: E(le(g)) })
1890
1888
  ] }) }))
1891
1889
  ) })
1892
1890
  ] }),
1893
1891
  /* @__PURE__ */ e.jsx("div", { className: "mt-0 flex items-center", children: /* @__PURE__ */ e.jsx(
1894
- $e,
1892
+ Ie,
1895
1893
  {
1896
1894
  type: l,
1897
- units: [...i],
1895
+ units: [...n],
1898
1896
  label: "",
1899
- property: n,
1900
- negative: a
1897
+ property: i,
1898
+ negative: o
1901
1899
  }
1902
1900
  ) })
1903
1901
  ]
1904
1902
  }
1905
1903
  );
1906
- }, Rs = ({ heading: t, items: o }) => {
1907
- const { t: r } = W(), s = ye(), l = _(() => {
1908
- const i = (n) => K(
1909
- n.map((d) => d.styleType === "multiple" ? k(d.options, "key") : d.property)
1910
- ), a = K(
1911
- o.map((n) => n.styleType === "accordion" ? i(n.items) : n.styleType === "multiple" ? k(n.options, "key") : n.property)
1912
- ), p = k(s, "property");
1913
- return rt(a, p).length > 0;
1914
- }, [s, o]);
1904
+ }, ws = ({ heading: r, items: s }) => {
1905
+ const { t } = z(), d = xe(), l = _(() => {
1906
+ const n = (i) => q(
1907
+ i.map((c) => c.styleType === "multiple" ? k(c.options, "key") : c.property)
1908
+ ), o = q(
1909
+ s.map((i) => i.styleType === "accordion" ? n(i.items) : i.styleType === "multiple" ? k(i.options, "key") : i.property)
1910
+ ), p = k(d, "property");
1911
+ return Je(o, p).length > 0;
1912
+ }, [d, s]);
1915
1913
  return /* @__PURE__ */ e.jsxs("details", { children: [
1916
1914
  /* @__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: [
1917
- r(t),
1915
+ t(r),
1918
1916
  l ? /* @__PURE__ */ e.jsx(
1919
1917
  "span",
1920
1918
  {
@@ -1922,201 +1920,91 @@ const vs = (t) => {
1922
1920
  }
1923
1921
  ) : null
1924
1922
  ] }) }),
1925
- /* @__PURE__ */ e.jsx("div", { className: "p-2", children: o.map((i) => i.styleType === "multiple" ? /* @__PURE__ */ e.jsx(mt, { ...i }, i.label) : /* @__PURE__ */ e.jsx($e, { ...i }, i.label)) })
1923
+ /* @__PURE__ */ e.jsx("div", { className: "p-2", children: s.map((n) => n.styleType === "multiple" ? /* @__PURE__ */ e.jsx(ht, { ...n }, n.label) : /* @__PURE__ */ e.jsx(Ie, { ...n }, n.label)) })
1926
1924
  ] });
1927
- }, Vs = Qe({}), ve = ({ section: t }) => {
1928
- const { t: o } = W(), r = ye(), s = V(
1929
- (a = []) => {
1925
+ }, Cs = Ke({}), be = ({ section: r }) => {
1926
+ const { t: s } = z(), t = xe(), d = V(
1927
+ (o = []) => {
1930
1928
  const p = {};
1931
- for (let d = 0; d < r.length; d++)
1932
- p[r[d].property] = r[d].cls;
1933
- let n = !0;
1934
- for (const d in a)
1935
- if (!be(p, d) || p[d] !== a[d]) {
1936
- n = !1;
1929
+ for (let c = 0; c < t.length; c++)
1930
+ p[t[c].property] = t[c].cls;
1931
+ let i = !0;
1932
+ for (const c in o)
1933
+ if (!ce(p, c) || p[c] !== o[c]) {
1934
+ i = !1;
1937
1935
  break;
1938
1936
  }
1939
- return n;
1937
+ return i;
1940
1938
  },
1941
- [r]
1939
+ [t]
1942
1940
  ), l = _(() => {
1943
- if (r.length > 0 && t.heading === "classes.heading")
1941
+ if (t.length > 0 && r.heading === "classes.heading")
1944
1942
  return !0;
1945
- const a = (d) => K(
1946
- d.map((h) => h.styleType === "multiple" ? K(k(h.options, "key")) : h.property)
1947
- ), p = K(
1948
- t.items.map((d) => d.styleType === "accordion" ? a(d.items) : d.styleType === "multiple" ? K(k(d.options, "key")) : d.property)
1949
- ), n = k(r, "property");
1950
- return rt(p, n).length > 0;
1951
- }, [r, t.heading, t.items]), i = _(() => ({}), []);
1952
- return /* @__PURE__ */ e.jsx(Vs.Provider, { value: i, children: /* @__PURE__ */ e.jsxs(pe, { value: t.heading, children: [
1953
- /* @__PURE__ */ e.jsx(ue, { className: "px-3 py-2 text-xs hover:no-underline", children: /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-x-2", children: [
1943
+ const o = (c) => q(
1944
+ c.map((h) => h.styleType === "multiple" ? q(k(h.options, "key")) : h.property)
1945
+ ), p = q(
1946
+ r.items.map((c) => c.styleType === "accordion" ? o(c.items) : c.styleType === "multiple" ? q(k(c.options, "key")) : c.property)
1947
+ ), i = k(t, "property");
1948
+ return Je(p, i).length > 0;
1949
+ }, [t, r.heading, r.items]), n = _(() => ({}), []);
1950
+ return /* @__PURE__ */ e.jsx(Cs.Provider, { value: n, children: /* @__PURE__ */ e.jsxs(Ce, { value: r.heading, children: [
1951
+ /* @__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: [
1954
1952
  /* @__PURE__ */ e.jsx("div", { className: `h-[8px] w-[8px] rounded-full ${l ? "bg-blue-500" : "bg-gray-300"}` }),
1955
- o(t.heading)
1953
+ s(r.heading)
1956
1954
  ] }) }),
1957
- /* @__PURE__ */ e.jsx(xe, { className: "bg-gray-100 px-3.5 py-2", children: I.Children.toArray(
1958
- t.items.map((a) => be(a, "component") ? I.createElement(a.component, { key: a.label }) : be(a, "styleType") ? a.styleType === "multiple" ? /* @__PURE__ */ e.jsx(mt, { ...a }, a.label) : a.styleType === "accordion" && s(a == null ? void 0 : a.conditions) ? /* @__PURE__ */ e.jsx(Rs, { ...a }, a.label) : null : /* @__PURE__ */ e.jsx($e, { ...a }, a.label))
1955
+ /* @__PURE__ */ e.jsx(Ne, { className: "bg-gray-100 px-3.5 py-2", children: $.Children.toArray(
1956
+ r.items.map((o) => ce(o, "component") ? $.createElement(o.component, { key: o.label }) : ce(o, "styleType") ? o.styleType === "multiple" ? /* @__PURE__ */ e.jsx(ht, { ...o }, o.label) : o.styleType === "accordion" && d(o == null ? void 0 : o.conditions) ? /* @__PURE__ */ e.jsx(ws, { ...o }, o.label) : null : /* @__PURE__ */ e.jsx(Ie, { ...o }, o.label))
1959
1957
  ) })
1960
1958
  ] }) });
1961
- }, Hs = ({
1962
- item: t,
1963
- index: o,
1964
- canDelete: r,
1965
- onChange: s,
1966
- onRemove: l
1967
- }) => /* @__PURE__ */ e.jsxs("div", { className: `flex flex-col gap-1 border-gray-400 py-2 ${r ? "border-b" : ""}`, children: [
1968
- /* @__PURE__ */ e.jsx(
1969
- "input",
1970
- {
1971
- name: "key",
1972
- onChange: (i) => s(i, o),
1973
- value: t.key,
1974
- placeholder: "Key",
1975
- className: "w-full rounded border-gray-300 bg-background p-0.5 pl-2 text-sm focus-visible:outline-0",
1976
- autoComplete: "off",
1977
- autoCapitalize: "off"
1978
- }
1979
- ),
1980
- /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-x-1.5", children: [
1981
- /* @__PURE__ */ e.jsx(
1982
- "input",
1983
- {
1984
- name: "value",
1985
- onChange: (i) => f(t.key) ? {} : s(i, o),
1986
- value: t.value,
1987
- placeholder: "Value",
1988
- className: "w-full rounded border-gray-300 bg-background p-0.5 pl-2 text-sm focus-visible:outline-0",
1989
- autoComplete: "off",
1990
- autoCapitalize: "off"
1991
- }
1992
- ),
1993
- /* @__PURE__ */ e.jsx(
1994
- Jt,
1995
- {
1996
- onClick: l,
1997
- className: "h-6 w-6 cursor-pointer rounded border border-red-400 p-1 text-red-400 hover:opacity-80"
1998
- }
1999
- )
2000
- ] })
2001
- ] }), Ds = ({ section: t }) => {
2002
- var y;
2003
- const { setSyncState: o } = Tr(), r = U(), [s, l] = C([]), [i] = he(), a = at(), p = `${x(i, "0.prop")}_attrs`;
2004
- de.useEffect(() => {
2005
- const g = k(x(r, p), (u, b) => ({ key: b, value: u }));
2006
- f(g) ? l([]) : l(g);
2007
- }, [x(r, p)]);
2008
- const n = () => l([...s, { key: "", value: "" }]), d = (g) => {
2009
- const u = Ce(s, (b, j) => g !== j);
2010
- c(u);
2011
- }, h = (g, u) => {
2012
- const b = [...s];
2013
- b[u][g.target.name] = g.target.value, c(b);
2014
- }, c = de.useCallback(
2015
- (g = []) => {
2016
- const u = {};
2017
- _e(g, (b) => {
2018
- f(b.key) || et(u, b.key, b.value);
2019
- }), a([x(r, "_id")], { [p]: u }), o("UNSAVED");
2020
- },
2021
- [r, o, a, p]
2022
- );
2023
- return /* @__PURE__ */ e.jsxs(pe, { value: t.heading, children: [
2024
- /* @__PURE__ */ e.jsx(ue, { className: "px-3 py-2 text-xs hover:no-underline", children: /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-x-2", children: [
2025
- /* @__PURE__ */ e.jsx(
2026
- "div",
2027
- {
2028
- className: `h-[8px] w-[8px] rounded-full ${f(x(r, p)) ? "bg-gray-300" : "bg-blue-500"}`
2029
- }
2030
- ),
2031
- "Attributes"
2032
- ] }) }),
2033
- /* @__PURE__ */ e.jsx(xe, { className: "bg-gray-100 px-3.5 py-2", children: /* @__PURE__ */ e.jsxs("div", { className: "no-scrollbar flex min-h-max flex-col gap-y-2 overflow-y-auto bg-gray-100 p-px", children: [
2034
- /* @__PURE__ */ e.jsxs(Ve, { className: "mt-2 flex w-full items-center justify-between", children: [
2035
- "Add Custom attributes",
2036
- /* @__PURE__ */ e.jsxs(
2037
- "div",
2038
- {
2039
- className: `flex h-6 w-max items-center justify-center gap-x-0.5 rounded-full border p-1 px-2 text-xs ${!f(s) && f((y = we(s)) == null ? void 0 : y.key) ? "cursor-not-allowed border-gray-400 text-gray-400" : "cursor-pointer border-blue-400 text-blue-400 hover:bg-blue-400 hover:text-white"}`,
2040
- onClick: () => {
2041
- var g;
2042
- !f(s) && f((g = we(s)) == null ? void 0 : g.key) || n();
2043
- },
2044
- children: [
2045
- /* @__PURE__ */ e.jsx(Se, { width: 12, height: 12 }),
2046
- " Add"
2047
- ]
2048
- }
2049
- )
2050
- ] }),
2051
- /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col", children: [
2052
- f(s) && /* @__PURE__ */ e.jsx("div", { className: "flex h-12 items-center justify-center text-sm text-gray-400", children: "Click + Add to add attributes" }),
2053
- de.Children.toArray(
2054
- k(s, (g, u) => {
2055
- const b = s.length > 0 && u < s.length - 1;
2056
- return /* @__PURE__ */ e.jsx(
2057
- Hs,
2058
- {
2059
- item: g,
2060
- index: u,
2061
- canDelete: b,
2062
- onChange: h,
2063
- onRemove: () => d(u)
2064
- }
2065
- );
2066
- })
2067
- )
2068
- ] })
2069
- ] }) })
2070
- ] });
2071
- }, $s = () => {
2072
- const t = U(), [o] = he(), { t: r } = W(), s = Xr(), l = Re(), i = De(t._type), a = Ye(rs(o), "prop"), p = Ye(i.props, `${a}.presets`, {});
2073
- if (ie(s) && (!ss(i, "props") || ie(p)))
1959
+ }, ks = () => {
1960
+ const r = K(), [s] = ue(), { t } = z(), d = Lr(), l = De(), n = Pe(r._type), o = x(ae(s), "prop"), p = x(n.props, `${o}.presets`, {});
1961
+ if (b(d) && (!ce(n, "props") || b(p)))
2074
1962
  return null;
2075
- const n = (d) => {
2076
- const h = d.trim().toLowerCase().replace(/ +(?= )/g, "").split(" ");
2077
- l([t._id], h, !0);
1963
+ const i = (c) => {
1964
+ const h = c.trim().toLowerCase().replace(/ +(?= )/g, "").split(" ");
1965
+ l([r._id], h, !0);
2078
1966
  };
2079
- return /* @__PURE__ */ e.jsx("div", { className: "h-10", children: /* @__PURE__ */ e.jsxs(Rr, { children: [
2080
- /* @__PURE__ */ e.jsx(Vr, { asChild: !0, children: /* @__PURE__ */ e.jsx("div", { className: "px-4", children: /* @__PURE__ */ e.jsxs(oe, { variant: "default", className: "w-full", size: "sm", children: [
2081
- r("Apply Presets"),
2082
- /* @__PURE__ */ e.jsx(Qt, {})
1967
+ return /* @__PURE__ */ e.jsx("div", { className: "h-10", children: /* @__PURE__ */ e.jsxs(Cr, { children: [
1968
+ /* @__PURE__ */ e.jsx(kr, { asChild: !0, children: /* @__PURE__ */ e.jsx("div", { className: "px-4", children: /* @__PURE__ */ e.jsxs(U, { variant: "default", className: "w-full", size: "sm", children: [
1969
+ t("Apply Presets"),
1970
+ /* @__PURE__ */ e.jsx(Gt, {})
2083
1971
  ] }) }) }),
2084
- /* @__PURE__ */ e.jsx(Hr, { className: "max-h-80 w-56", children: /* @__PURE__ */ e.jsxs(He, { className: "no-scrollbar h-full", children: [
2085
- ie(p) ? null : /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
2086
- /* @__PURE__ */ e.jsxs(Ae, { children: [
2087
- i.type,
1972
+ /* @__PURE__ */ e.jsx(Nr, { className: "max-h-80 w-56", children: /* @__PURE__ */ e.jsxs(Be, { className: "no-scrollbar h-full", children: [
1973
+ b(p) ? null : /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
1974
+ /* @__PURE__ */ e.jsxs(Ee, { children: [
1975
+ n.type,
2088
1976
  " ",
2089
- r("presets")
1977
+ t("presets")
2090
1978
  ] }),
2091
- /* @__PURE__ */ e.jsx(Me, {}),
2092
- /* @__PURE__ */ e.jsx(Ee, { children: Xe(p).map((d) => /* @__PURE__ */ e.jsxs(Le, { className: "group text-xs", onClick: () => n(p[d]), children: [
2093
- Ze(We(r(d))),
2094
- /* @__PURE__ */ e.jsx(Oe, { className: "invisible hover:font-bold hover:text-blue-600 group-hover:visible", children: r("apply") })
1979
+ /* @__PURE__ */ e.jsx(Le, {}),
1980
+ /* @__PURE__ */ e.jsx(Oe, { children: je(p).map((c) => /* @__PURE__ */ e.jsxs(Fe, { className: "group text-xs", onClick: () => i(p[c]), children: [
1981
+ we(E(t(c))),
1982
+ /* @__PURE__ */ e.jsx(Ye, { className: "invisible hover:font-bold hover:text-blue-600 group-hover:visible", children: t("apply") })
2095
1983
  ] })) })
2096
1984
  ] }),
2097
- ie(s) ? null : /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
2098
- /* @__PURE__ */ e.jsx(Ae, { children: r("Global presets") }),
2099
- /* @__PURE__ */ e.jsx(Me, {}),
2100
- /* @__PURE__ */ e.jsx(Ee, { children: Xe(s).map((d) => /* @__PURE__ */ e.jsxs(Le, { className: "group text-xs", onClick: () => n(s[d]), children: [
2101
- Ze(We(r(d))),
2102
- /* @__PURE__ */ e.jsx(Oe, { className: "invisible hover:font-bold hover:text-blue-600 group-hover:visible", children: r("apply") })
1985
+ b(d) ? null : /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
1986
+ /* @__PURE__ */ e.jsx(Ee, { children: t("Global presets") }),
1987
+ /* @__PURE__ */ e.jsx(Le, {}),
1988
+ /* @__PURE__ */ e.jsx(Oe, { children: je(d).map((c) => /* @__PURE__ */ e.jsxs(Fe, { className: "group text-xs", onClick: () => i(d[c]), children: [
1989
+ we(E(t(c))),
1990
+ /* @__PURE__ */ e.jsx(Ye, { className: "invisible hover:font-bold hover:text-blue-600 group-hover:visible", children: t("apply") })
2103
1991
  ] })) })
2104
1992
  ] })
2105
1993
  ] }) })
2106
1994
  ] }) });
2107
1995
  };
2108
- function Bs() {
2109
- const [t, o] = ct(), { flexChild: r, gridChild: s } = Dr(), { t: l } = W(), [i] = he();
2110
- return f(i) ? /* @__PURE__ */ e.jsx("div", { className: "p-4 text-center", children: /* @__PURE__ */ e.jsxs("div", { className: "space-y-4 rounded-xl p-4", children: [
2111
- /* @__PURE__ */ e.jsx(ot, { className: "mx-auto text-3xl" }),
1996
+ function Ns() {
1997
+ const [r, s] = it(), { flexChild: t, gridChild: d } = _r(), { t: l } = z(), [n] = ue();
1998
+ return b(n) ? /* @__PURE__ */ e.jsx("div", { className: "p-4 text-center", children: /* @__PURE__ */ e.jsxs("div", { className: "space-y-4 rounded-xl p-4", children: [
1999
+ /* @__PURE__ */ e.jsx(tt, { className: "mx-auto text-3xl" }),
2112
2000
  /* @__PURE__ */ e.jsx("h1", { children: l("no_styling_block_selected") })
2113
2001
  ] }) }) : /* @__PURE__ */ e.jsxs("div", { className: "flex h-full flex-col", children: [
2114
- /* @__PURE__ */ e.jsx($s, {}),
2002
+ /* @__PURE__ */ e.jsx(ks, {}),
2115
2003
  /* @__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: [
2116
- /* @__PURE__ */ e.jsx(Ve, { htmlFor: "", className: "flex gap-x-1.5 text-xs italic", children: "State" }),
2117
- /* @__PURE__ */ e.jsxs($r, { defaultValue: t, onValueChange: (a) => o(a), children: [
2118
- /* @__PURE__ */ e.jsx(Br, { className: "h-auto w-fit p-1 px-3", children: /* @__PURE__ */ e.jsx(Pr, { placeholder: "State" }) }),
2119
- /* @__PURE__ */ e.jsxs(Ir, { children: [
2004
+ /* @__PURE__ */ e.jsx(nt, { htmlFor: "", className: "flex gap-x-1.5 text-xs italic", children: "State" }),
2005
+ /* @__PURE__ */ e.jsxs(Tr, { defaultValue: r, onValueChange: (o) => s(o), children: [
2006
+ /* @__PURE__ */ e.jsx(Sr, { className: "h-auto w-fit p-1 px-3", children: /* @__PURE__ */ e.jsx(Rr, { placeholder: "State" }) }),
2007
+ /* @__PURE__ */ e.jsxs(Vr, { children: [
2120
2008
  /* @__PURE__ */ e.jsx(H, { value: "", children: "Normal" }),
2121
2009
  /* @__PURE__ */ e.jsx(H, { value: "hover", children: "Hover" }),
2122
2010
  /* @__PURE__ */ e.jsx(H, { value: "active", children: "Active" }),
@@ -2132,19 +2020,126 @@ function Bs() {
2132
2020
  ] })
2133
2021
  ] })
2134
2022
  ] }) }),
2135
- t !== "" ? /* @__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: [
2136
- /* @__PURE__ */ e.jsx(Fr, { className: "w-3" }),
2137
- /* @__PURE__ */ e.jsx("span", { children: l(`Styles will be applied for (:${t}) state`) })
2023
+ 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: [
2024
+ /* @__PURE__ */ e.jsx(Ar, { className: "w-3" }),
2025
+ /* @__PURE__ */ e.jsx("span", { children: l(`Styles will be applied for (:${r}) state`) })
2138
2026
  ] }) : null,
2139
- /* @__PURE__ */ e.jsx(He, { 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: [
2140
- r && /* @__PURE__ */ e.jsx(ve, { section: ps }),
2141
- s ? /* @__PURE__ */ e.jsx(ve, { section: us }) : null,
2142
- xs.map((a) => /* @__PURE__ */ e.jsx(ve, { section: a }, a.heading)),
2143
- /* @__PURE__ */ e.jsx(Ds, { section: { heading: "Attributes" } })
2027
+ /* @__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(lt, { defaultValue: ["Layout"], type: "multiple", className: "w-full", children: [
2028
+ t && /* @__PURE__ */ e.jsx(be, { section: ls }),
2029
+ d ? /* @__PURE__ */ e.jsx(be, { section: os }) : null,
2030
+ as.map((o) => /* @__PURE__ */ e.jsx(be, { section: o }, o.heading))
2144
2031
  ] }) })
2145
2032
  ] });
2146
2033
  }
2147
- const Ps = {
2034
+ const _s = ({ onAdd: r }) => {
2035
+ const { t: s } = z(), [t, d] = w({ key: "", value: "" }), l = () => {
2036
+ b(t.key) || (r({ ...t, key: Vt(t.key) }), d({ key: "", value: "" }));
2037
+ };
2038
+ return /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col gap-1 border-gray-200 px-1", children: [
2039
+ /* @__PURE__ */ e.jsx(
2040
+ _e,
2041
+ {
2042
+ name: "key",
2043
+ onChange: (n) => d({ ...t, key: n.target.value }),
2044
+ value: t.key,
2045
+ placeholder: s("Name"),
2046
+ autoComplete: "off",
2047
+ autoCapitalize: "off",
2048
+ onKeyDown: (n) => {
2049
+ n.key === "Enter" && (n.preventDefault(), b(t.key) || l());
2050
+ }
2051
+ }
2052
+ ),
2053
+ /* @__PURE__ */ e.jsx("div", { className: "flex items-center gap-x-1.5", children: /* @__PURE__ */ e.jsx(
2054
+ _e,
2055
+ {
2056
+ name: "value",
2057
+ onChange: (n) => d({ ...t, value: n.target.value }),
2058
+ value: t.value,
2059
+ placeholder: s("Value"),
2060
+ autoComplete: "off",
2061
+ autoCapitalize: "off",
2062
+ onKeyDown: (n) => {
2063
+ n.key === "Enter" && (n.preventDefault(), b(t.key) || l());
2064
+ }
2065
+ }
2066
+ ) }),
2067
+ /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-x-2", children: [
2068
+ /* @__PURE__ */ e.jsxs(U, { disabled: b(t.key), onClick: l, size: "sm", className: "flex items-center", children: [
2069
+ /* @__PURE__ */ e.jsxs("span", { children: [
2070
+ s("Add"),
2071
+ " "
2072
+ ] }),
2073
+ /* @__PURE__ */ e.jsx(Ve, {})
2074
+ ] }),
2075
+ b(t.key) ? null : /* @__PURE__ */ e.jsx(U, { variant: "ghost", onClick: () => d({ key: "", value: "" }), children: s("Cancel") })
2076
+ ] })
2077
+ ] });
2078
+ }, Ts = () => {
2079
+ const r = K(), [s, t] = w([]), [d] = ue(), l = rt(), n = st(), { t: o } = z(), p = `${x(d, "0.prop")}_attrs`;
2080
+ de.useEffect(() => {
2081
+ const a = k(x(r, p), (g, y) => ({ key: y, value: g }));
2082
+ b(a) ? t([]) : t(a);
2083
+ }, [x(r, p)]);
2084
+ const i = (a) => {
2085
+ const g = ve(s, (y, u) => a !== u);
2086
+ h(g);
2087
+ }, c = (a) => {
2088
+ const g = [...s, a];
2089
+ h(g);
2090
+ }, h = de.useCallback(
2091
+ (a = []) => {
2092
+ const g = {};
2093
+ Re(a, (y) => {
2094
+ b(y.key) || Ge(g, y.key, y.value);
2095
+ }), n([x(r, "_id")], { [p]: g });
2096
+ },
2097
+ [r, l, p]
2098
+ );
2099
+ 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: [
2100
+ /* @__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: [
2101
+ b(s) ? /* @__PURE__ */ e.jsx("li", { className: "flex h-16 items-center justify-center", children: /* @__PURE__ */ e.jsx("p", { children: o("No custom attributes added yet") }) }) : /* @__PURE__ */ e.jsx("li", { children: /* @__PURE__ */ e.jsx("span", { className: "font-bold", children: o("Custom attributes") }) }),
2102
+ de.Children.toArray(
2103
+ k(s, (a) => /* @__PURE__ */ e.jsxs("li", { className: "group flex max-w-full items-center justify-between", children: [
2104
+ /* @__PURE__ */ e.jsxs(O, { delayDuration: 1e3, children: [
2105
+ /* @__PURE__ */ e.jsx(F, { asChild: !0, children: /* @__PURE__ */ e.jsxs("div", { className: "w-[90%] cursor-default truncate px-1 hover:bg-gray-200", children: [
2106
+ a.key,
2107
+ " ",
2108
+ /* @__PURE__ */ e.jsx("span", { className: "font-bold text-orange-500", children: "=" }),
2109
+ " ",
2110
+ a.value
2111
+ ] }) }),
2112
+ /* @__PURE__ */ e.jsxs(Y, { className: "max-w-[200px]", children: [
2113
+ /* @__PURE__ */ e.jsxs("div", { children: [
2114
+ o("Name"),
2115
+ ": ",
2116
+ a.key
2117
+ ] }),
2118
+ /* @__PURE__ */ e.jsxs("div", { children: [
2119
+ o("Value"),
2120
+ ": ",
2121
+ a.value
2122
+ ] })
2123
+ ] })
2124
+ ] }),
2125
+ /* @__PURE__ */ e.jsxs(O, { children: [
2126
+ /* @__PURE__ */ e.jsx(F, { asChild: !0, children: /* @__PURE__ */ e.jsx(
2127
+ "button",
2128
+ {
2129
+ className: "invisible group-hover:visible",
2130
+ onClick: () => i(s.indexOf(a)),
2131
+ children: /* @__PURE__ */ e.jsx(Mr, { className: "w-4 text-gray-500" })
2132
+ }
2133
+ ) }),
2134
+ /* @__PURE__ */ e.jsx(Y, { className: "max-w-[200px]", children: o("Remove attribute") })
2135
+ ] })
2136
+ ] }))
2137
+ )
2138
+ ] }) }),
2139
+ /* @__PURE__ */ e.jsx("div", { className: "py-2" }),
2140
+ /* @__PURE__ */ e.jsx(_s, { onAdd: (a) => c(a) })
2141
+ ] }) }) });
2142
+ }, Ss = {
2148
2143
  px: 1,
2149
2144
  "%": 1,
2150
2145
  em: 100,
@@ -2155,32 +2150,32 @@ const Ps = {
2155
2150
  "-": 1,
2156
2151
  deg: 1,
2157
2152
  ms: 0.1
2158
- }, Pl = () => {
2159
- const t = U(), { t: o } = W(), [r, s] = I.useState(""), [l, i] = I.useState({
2160
- onDrag: (n) => n,
2161
- onDragEnd: (n) => n,
2153
+ }, _l = () => {
2154
+ const r = K(), { t: s } = z(), [t, d] = $.useState(""), [l, n] = $.useState({
2155
+ onDrag: (i) => i,
2156
+ onDragEnd: (i) => i,
2162
2157
  dragStartY: 0,
2163
2158
  dragging: !1,
2164
2159
  dragStartValue: 0,
2165
2160
  dragUnit: "",
2166
2161
  negative: !1,
2167
2162
  cssProperty: ""
2168
- }), a = je(
2169
- (n) => {
2170
- const d = !x(l, "negative", !1), h = x(l, "cssProperty", "");
2171
- let c = parseFloat(l.dragStartValue);
2172
- c = tt(c) ? 0 : c;
2173
- let y = Ps[l.dragUnit];
2174
- (G(h, "scale") || h === "opacity") && (y = 10);
2175
- let u = (l.dragStartY - n.pageY) / y + c;
2176
- d && u < 0 && (u = 0), h === "opacity" && u > 1 && (u = 1), l.onDrag(`${u}`), s(`${u}`);
2163
+ }), o = fe(
2164
+ (i) => {
2165
+ const c = !x(l, "negative", !1), h = x(l, "cssProperty", "");
2166
+ let a = parseFloat(l.dragStartValue);
2167
+ a = qe(a) ? 0 : a;
2168
+ let g = Ss[l.dragUnit];
2169
+ (G(h, "scale") || h === "opacity") && (g = 10);
2170
+ let u = (l.dragStartY - i.pageY) / g + a;
2171
+ c && u < 0 && (u = 0), h === "opacity" && u > 1 && (u = 1), l.onDrag(`${u}`), d(`${u}`);
2177
2172
  },
2178
2173
  [l],
2179
2174
  50
2180
2175
  ), p = V(() => {
2181
- setTimeout(() => l.onDragEnd(`${r}`), 100), i({
2182
- onDrag: (n) => n,
2183
- onDragEnd: (n) => n,
2176
+ setTimeout(() => l.onDragEnd(`${t}`), 100), n({
2177
+ onDrag: (i) => i,
2178
+ onDragEnd: (i) => i,
2184
2179
  dragStartY: 0,
2185
2180
  dragging: !1,
2186
2181
  dragStartValue: 0,
@@ -2188,29 +2183,31 @@ const Ps = {
2188
2183
  negative: !1,
2189
2184
  cssProperty: ""
2190
2185
  });
2191
- }, [l, r, i]);
2192
- return $t(t) ? /* @__PURE__ */ e.jsx("div", { className: "p-4 text-center", children: /* @__PURE__ */ e.jsxs("div", { className: "space-y-4 rounded-xl p-4", children: [
2193
- /* @__PURE__ */ e.jsx(ot, { className: "mx-auto text-3xl" }),
2194
- /* @__PURE__ */ e.jsx("h1", { children: o("no_block_selected_for_styling") })
2195
- ] }) }) : /* @__PURE__ */ e.jsx(pt, { children: /* @__PURE__ */ e.jsxs(yt.Provider, { value: { setDragData: i }, children: [
2186
+ }, [l, t, n]);
2187
+ return Ht(r) ? /* @__PURE__ */ e.jsx("div", { className: "p-4 text-center", children: /* @__PURE__ */ e.jsxs("div", { className: "space-y-4 rounded-xl p-4", children: [
2188
+ /* @__PURE__ */ e.jsx(tt, { className: "mx-auto text-3xl" }),
2189
+ /* @__PURE__ */ e.jsx("h1", { children: s("no_block_selected_for_styling") })
2190
+ ] }) }) : /* @__PURE__ */ e.jsx(dt, { children: /* @__PURE__ */ e.jsxs(gt.Provider, { value: { setDragData: n }, children: [
2196
2191
  l.dragging ? /* @__PURE__ */ e.jsx(
2197
2192
  "div",
2198
2193
  {
2199
- onMouseMove: a,
2194
+ onMouseMove: o,
2200
2195
  onMouseUp: () => p(),
2201
2196
  className: "absolute inset-0 z-30 cursor-row-resize bg-gray-300/10"
2202
2197
  }
2203
2198
  ) : null,
2204
- /* @__PURE__ */ e.jsxs(Ar, { defaultValue: "settings", className: "flex h-full w-full flex-col py-1", children: [
2205
- /* @__PURE__ */ e.jsxs(Mr, { className: "mx-1 grid grid-cols-2", children: [
2206
- /* @__PURE__ */ e.jsx(ze, { value: "settings", children: o("settings") }),
2207
- /* @__PURE__ */ e.jsx(ze, { value: "styling", children: o("styling") })
2199
+ /* @__PURE__ */ e.jsxs(Hr, { defaultValue: "settings", className: "flex h-full w-full flex-col py-1 text-xs", children: [
2200
+ /* @__PURE__ */ e.jsxs(Dr, { className: "mx-1 grid grid-cols-3", children: [
2201
+ /* @__PURE__ */ e.jsx(he, { value: "settings", children: s("settings") }),
2202
+ /* @__PURE__ */ e.jsx(he, { value: "styling", children: s("styling") }),
2203
+ /* @__PURE__ */ e.jsx(he, { value: "attrs", children: s("Attributes") })
2208
2204
  ] }),
2209
- /* @__PURE__ */ e.jsx(Fe, { value: "settings", className: "no-scrollbar h-full flex-1 overflow-y-auto overflow-x-hidden", children: /* @__PURE__ */ e.jsx(He, { className: "no-scrollbar max-h-full flex-1 overflow-x-hidden overflow-y-hidden pb-5", children: /* @__PURE__ */ e.jsx(ds, {}) }) }),
2210
- /* @__PURE__ */ e.jsx(Fe, { value: "styling", className: "h-full flex-1 overflow-y-auto overflow-x-hidden", children: /* @__PURE__ */ e.jsx(Bs, {}) })
2205
+ /* @__PURE__ */ e.jsx(ye, { 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(rs, {}) }) }),
2206
+ /* @__PURE__ */ e.jsx(ye, { value: "styling", className: "h-full flex-1 overflow-y-auto overflow-x-hidden", children: /* @__PURE__ */ e.jsx(Ns, {}) }),
2207
+ /* @__PURE__ */ e.jsx(ye, { value: "attrs", className: "h-full flex-1 overflow-y-auto overflow-x-hidden", children: /* @__PURE__ */ e.jsx(Ts, {}) })
2211
2208
  ] })
2212
2209
  ] }) });
2213
2210
  };
2214
2211
  export {
2215
- Pl as default
2212
+ _l as default
2216
2213
  };