@chaibuilder/sdk 1.2.27 → 1.2.28

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