@chaibuilder/sdk 1.2.16 → 1.2.17

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 (108) hide show
  1. package/README.md +6 -4
  2. package/dist/{AddBlocks-TBFBvBvo.js → AddBlocks--SllKzEG.js} +81 -81
  3. package/dist/AddBlocks-7TF41ISQ.cjs +1 -0
  4. package/dist/{BrandingOptions-t_MjeHSM.js → BrandingOptions-IqtZrxqX.js} +14 -15
  5. package/dist/BrandingOptions-uKE1vuWd.cjs +1 -0
  6. package/dist/{CanvasArea-ZYC8QbQB.js → CanvasArea-T1XNnB7d.js} +89 -95
  7. package/dist/{CanvasArea-oTylYgH9.cjs → CanvasArea-iLUw-tom.cjs} +3 -3
  8. package/dist/{Class-17XFhL48.js → Class-3k8xjeiM.js} +1 -1
  9. package/dist/{Class-5ARpH_Tu.cjs → Class-MmCxz2Ay.cjs} +1 -1
  10. package/dist/CurrentPage-N5hSL1xB.cjs +1 -0
  11. package/dist/{CurrentPage-4vC6olJo.js → CurrentPage-TCduhO-X.js} +16 -16
  12. package/dist/MODIFIERS-9EwxLM8V.cjs +1 -0
  13. package/dist/{MODIFIERS-RiXS5Mn1.js → MODIFIERS-WQdaNvb8.js} +5 -4
  14. package/dist/{Layers-m61dThGR.js → Outline-3IPrK7F-.js} +153 -145
  15. package/dist/Outline-g4TXJ-hK.cjs +1 -0
  16. package/dist/{PagesPanel-v3KV_vfG.js → PagesPanel-7goyNL8t.js} +10 -10
  17. package/dist/PagesPanel-qI3sijis.cjs +1 -0
  18. package/dist/{ProjectPanel-xsUuVX64.js → ProjectPanel-CdPFwsXg.js} +8 -8
  19. package/dist/ProjectPanel-bMllQ4_a.cjs +1 -0
  20. package/dist/Settings-8f4ivm4-.cjs +1 -0
  21. package/dist/{Settings-ZNxfF14G.js → Settings-pva9XRUC.js} +293 -293
  22. package/dist/SidePanels-7HqZM4-j.cjs +1 -0
  23. package/dist/SidePanels-u5QXQrWL.js +389 -0
  24. package/dist/Topbar-S3zgo3N8.js +129 -0
  25. package/dist/Topbar-poeqjjZb.cjs +1 -0
  26. package/dist/{UnsplashImages-ppQXZ28F.js → UnsplashImages-132gZ842.js} +13 -13
  27. package/dist/{UnsplashImages-SrxA-yNu.cjs → UnsplashImages-BOypn-e5.cjs} +1 -1
  28. package/dist/UploadImages-giiNNHKq.cjs +1 -0
  29. package/dist/{UploadImages-IKR4oX2k.js → UploadImages-tr54Ik1I.js} +35 -31
  30. package/dist/{add-page-modal-pc5-Yw4C.js → add-page-modal-AsP5g0Fp.js} +13 -12
  31. package/dist/add-page-modal-ajpd-Gmw.cjs +1 -0
  32. package/dist/{confirm-alert-uV_PtYc3.cjs → confirm-alert-bw0VBgoG.cjs} +1 -1
  33. package/dist/{confirm-alert-QKtbNbWz.js → confirm-alert-dYoU1ln_.js} +5 -5
  34. package/dist/controls-Dy1qa8Dc.cjs +1 -0
  35. package/dist/{empty-slot-5FRrRq1E.js → controls-XPXGHKht.js} +50 -61
  36. package/dist/core.cjs +1 -1
  37. package/dist/core.d.ts +16 -1
  38. package/dist/core.js +47 -53
  39. package/dist/{defaultTheme-IH19g4fv.cjs → defaultTheme-1XwPZT2b.cjs} +1 -1
  40. package/dist/{defaultTheme-YY8mlQS3.js → defaultTheme-s0cpA5Oy.js} +1 -1
  41. package/dist/delete-page-modal-H4JOWYZe.cjs +1 -0
  42. package/dist/{delete-page-modal-Zf3-4wLg.js → delete-page-modal-_Hy6ls6b.js} +12 -12
  43. package/dist/email-blocks.cjs +1 -1
  44. package/dist/email-blocks.js +11 -10
  45. package/dist/email.cjs +1 -1
  46. package/dist/email.d.ts +13 -0
  47. package/dist/email.js +7 -12
  48. package/dist/empty-slot-ZBlsQi6m.js +15 -0
  49. package/dist/empty-slot-nzYOgZuS.cjs +1 -0
  50. package/dist/{form-faX0Yn4Q.js → form-f13cs-An.js} +1 -1
  51. package/dist/{form-KkP1F7h1.cjs → form-jzX2YXUO.cjs} +1 -1
  52. package/dist/{html-to-json-57841sEK.js → html-to-json-C5sExaSD.js} +1 -1
  53. package/dist/{html-to-json-2PeOCVey.cjs → html-to-json-FGufPv9R.cjs} +1 -1
  54. package/dist/index-0JU8vPT_.cjs +206 -0
  55. package/dist/index-4xyhDki2.cjs +1 -0
  56. package/dist/index-MQH3blB-.cjs +1 -0
  57. package/dist/{index-QGA4ayU7.js → index-MaXiXghQ.js} +246 -246
  58. package/dist/index-YpnaudSM.js +63 -0
  59. package/dist/index-ecnGWzh9.cjs +1 -0
  60. package/dist/{index-rktN6W1Y.js → index-eyVVbA05.js} +22845 -25123
  61. package/dist/index-ugsWasKp.js +2202 -0
  62. package/dist/lib.cjs +1 -1
  63. package/dist/lib.js +5 -5
  64. package/dist/{page-viewer-Cv_WZY-t.js → page-viewer-P5Im9RfR.js} +11 -11
  65. package/dist/page-viewer-Xj9v8mji.cjs +1 -0
  66. package/dist/project-general-setting--5DT1RoW.cjs +1 -0
  67. package/dist/{project-general-setting-x6qqF0T8.js → project-general-setting-R3pVVXmY.js} +11 -10
  68. package/dist/project-seo-setting-3DzzF83_.cjs +1 -0
  69. package/dist/{project-seo-setting-Sl6AE-Q7.js → project-seo-setting-pGpm3-6U.js} +7 -7
  70. package/dist/render.cjs +1 -1
  71. package/dist/render.js +2 -2
  72. package/dist/{single-page-detail-sGbwXXs1.js → single-page-detail-m-THVQnz.js} +43 -42
  73. package/dist/single-page-detail-nJzGUDym.cjs +1 -0
  74. package/dist/studio.cjs +1 -1
  75. package/dist/studio.d.ts +13 -0
  76. package/dist/studio.js +7 -7
  77. package/dist/ui.cjs +1 -1
  78. package/dist/ui.d.ts +4 -4
  79. package/dist/ui.js +50 -50
  80. package/dist/useAddBlockByDrop-6qaL4Ufz.cjs +1 -0
  81. package/dist/useAddBlockByDrop-vGme3brY.js +20 -0
  82. package/dist/web-blocks.cjs +1 -1
  83. package/dist/web-blocks.js +4 -3
  84. package/package.json +1 -1
  85. package/dist/AddBlocks-FUKuRbn6.cjs +0 -1
  86. package/dist/BrandingOptions-tBWzqas5.cjs +0 -1
  87. package/dist/CurrentPage-g8aT56B2.cjs +0 -1
  88. package/dist/Layers-fEb6biiU.cjs +0 -1
  89. package/dist/MODIFIERS-2FeVfZQ9.cjs +0 -1
  90. package/dist/PagesPanel-ewHplHej.cjs +0 -1
  91. package/dist/ProjectPanel-pgpe3fyR.cjs +0 -1
  92. package/dist/Settings-zk2jUrHc.cjs +0 -1
  93. package/dist/SidePanels-MbJufIbe.js +0 -352
  94. package/dist/SidePanels-zXHw8T3P.cjs +0 -1
  95. package/dist/Topbar-iH2L4pe0.cjs +0 -1
  96. package/dist/Topbar-ryFhl-PC.js +0 -114
  97. package/dist/UploadImages-VBiO6lqp.cjs +0 -1
  98. package/dist/add-page-modal-myA0a2nW.cjs +0 -1
  99. package/dist/delete-page-modal-q4G_-zBl.cjs +0 -1
  100. package/dist/empty-slot-2LSrWJaY.cjs +0 -1
  101. package/dist/index-DT71IahS.cjs +0 -206
  102. package/dist/index-ERorPL9q.cjs +0 -1
  103. package/dist/page-viewer-z9Kn4i1K.cjs +0 -1
  104. package/dist/project-general-setting-ZiLidijs.cjs +0 -1
  105. package/dist/project-seo-setting-8oJUrOqk.cjs +0 -1
  106. package/dist/single-page-detail-cnwttu4D.cjs +0 -1
  107. package/dist/useAddBlockByDrop-LBgi6GL7.cjs +0 -1
  108. package/dist/useAddBlockByDrop-Y-g4O8UC.js +0 -20
package/README.md CHANGED
@@ -36,20 +36,22 @@ Step 4: Add the builder to your page.
36
36
  ```tsx
37
37
  import "./chaibuilder.tailwind.css";
38
38
  import "@chaibuilder/sdk/styles";
39
- import {ChaiBuilderEditor} from "@chaibuilder/sdk";
39
+ import { ChaiBuilderEditor } from "@chaibuilder/sdk";
40
+ import { loadWebBlocks } from "@chaibuilder/sdk/web-blocks";
41
+ loadWebBlocks();
40
42
 
41
43
  const BuilderFullPage = () => {
42
44
  return (
43
45
  <ChaiBuilderEditor
44
46
  blocks={[]}
45
- onSavePage={async (blocks) => await saveBlocks(blocks)}
46
- onSaveBrandingOptions={async (branding) => await saveBranding(branding)}
47
+ onSavePage={async (blocks) => { console.log(blocks); return true }}
48
+ onSaveBrandingOptions={async (branding) => { console.log(blocks); return true }}
47
49
  />
48
50
  );
49
51
  }
50
52
  ```
51
53
 
52
- Step 5: Render the blocks on your page.
54
+ ### Render the blocks on your page.
53
55
 
54
56
  ```tsx
55
57
  export default () => {
@@ -1,25 +1,25 @@
1
1
  import { j as e } from "./jsx-runtime-WbnYoNE9.js";
2
- import y, { createElement as z, useState as f, useCallback as G, useMemo as M, useEffect as q, Suspense as V } from "react";
3
- import { has as S, first as h, omit as K, isEmpty as g, filter as j, values as b, groupBy as B, mergeWith as O, isArray as T, keys as R, get as U, map as N, uniq as W, includes as J, find as X, reject as _ } from "lodash-es";
4
- import { useAtom as v } from "jotai";
5
- import { useTranslation as L } from "react-i18next";
6
- import { K as w, j as C, X as Q, ao as A, av as Y, aw as Z, ax as $, i as I, a2 as F, aj as ee, ak as se, al as re, am as te, an as P, bg as oe, bh as le, bi as ae, bj as ie, az as ce, bk as ne, bl as de, B as me, bm as pe, bn as ue, bo as xe, ap as he, aq as fe, ar as k, bf as ge, b8 as je, b9 as be, ba as ye, bb as ve, S as ke } from "./index-QGA4ayU7.js";
7
- import { BoxIcon as Be } from "@radix-ui/react-icons";
8
- import { syncBlocksWithDefaults as H, useChaiBlocks as E } from "@chaibuilder/runtime";
9
- import { useFeature as Ne } from "flagged";
10
- import { Loader as we } from "lucide-react";
11
- import { useDrag as Ce, DragPreviewImage as Ae } from "react-dnd";
12
- import { g as Te } from "./html-to-json-57841sEK.js";
2
+ import v, { createElement as M, useState as f, useCallback as z, useMemo as O, useEffect as q, Suspense as U } from "react";
3
+ import { has as L, first as h, omit as V, noop as K, isEmpty as g, filter as j, values as b, groupBy as k, mergeWith as R, isArray as _, keys as W, get as Y, map as w, uniq as J, includes as Q, find as X, reject as P } from "lodash-es";
4
+ import { useAtom as B } from "jotai";
5
+ import { useTranslation as I } from "react-i18next";
6
+ import { L as C, r as A, Y as Z, at as T, ap as $, aq as ee, ar as se, h as F, a3 as E, aj as re, ak as te, al as oe, am as ae, an as S, bh as le, bi as ie, bj as ce, bk as ne, aB as de, bl as me, bm as pe, B as ue, bn as xe, bo as he, bp as fe, au as ge, av as je, aw as N, bg as be, b9 as ve, ba as ye, bb as Be, bc as Ne, S as ke } from "./index-MaXiXghQ.js";
7
+ import { BoxIcon as we } from "@radix-ui/react-icons";
8
+ import { syncBlocksWithDefaults as H, useChaiBlocks as D } from "@chaibuilder/runtime";
9
+ import { useFeature as Ce } from "flagged";
10
+ import { O as y } from "./MODIFIERS-WQdaNvb8.js";
11
+ import { Loader as Ae } from "lucide-react";
12
+ import { useDrag as Te, DragPreviewImage as _e } from "react-dnd";
13
+ import { g as Pe } from "./html-to-json-C5sExaSD.js";
13
14
  import "./_commonjsHelpers-UyOWmZb0.js";
14
15
  import "./Functions-7jnEwJyw.js";
15
16
  import "clsx";
16
17
  import "tailwind-merge";
17
18
  import "flat-to-nested";
18
- import "./MODIFIERS-RiXS5Mn1.js";
19
19
  import "@react-hookz/web";
20
20
  import "@radix-ui/react-toggle";
21
21
  import "class-variance-authority";
22
- import "./Class-17XFhL48.js";
22
+ import "./Class-3k8xjeiM.js";
23
23
  import "@radix-ui/react-switch";
24
24
  import "@radix-ui/react-slot";
25
25
  import "@radix-ui/react-accordion";
@@ -42,46 +42,46 @@ import "react-icons-picker";
42
42
  import "react-dom";
43
43
  import "react-quill";
44
44
  import "himalaya";
45
- const _e = ({ block: s }) => {
46
- const { type: o, icon: c, label: a } = s, { addCoreBlock: d, addPredefinedBlock: i } = w(), [n, r] = C(), [, x] = Q(), [, p] = v(A), l = () => {
47
- S(s, "blocks") ? i(H(s.blocks), h(n)) : d(s, h(n)), p("layers");
48
- }, t = Ne("dnd");
49
- return /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsxs(Y, { children: [
50
- /* @__PURE__ */ e.jsx(Z, { asChild: !0, children: /* @__PURE__ */ e.jsxs(
45
+ const Se = ({ block: s }) => {
46
+ const { type: o, icon: c, label: l } = s, { addCoreBlock: d, addPredefinedBlock: i } = C(), [n, r] = A(), [, x] = Z(), [, p] = B(T), a = () => {
47
+ L(s, "blocks") ? i(H(s.blocks), h(n)) : d(s, h(n)), p(y);
48
+ }, t = Ce("dnd");
49
+ return /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsxs($, { children: [
50
+ /* @__PURE__ */ e.jsx(ee, { asChild: !0, children: /* @__PURE__ */ e.jsxs(
51
51
  "button",
52
52
  {
53
- onClick: l,
53
+ onClick: a,
54
54
  type: "button",
55
55
  onDragStart: (u) => {
56
- u.dataTransfer.setData("text/plain", JSON.stringify(K(s, ["component", "icon"]))), setTimeout(() => {
57
- r([]), x(null), p("layers");
56
+ u.dataTransfer.setData("text/plain", JSON.stringify(V(s, ["component", "icon"]))), setTimeout(() => {
57
+ r([]), x(null), p(y);
58
58
  }, 200);
59
59
  },
60
60
  draggable: t ? "true" : "false",
61
61
  className: "space-y-2 rounded-lg border border-border p-3 text-center hover:bg-slate-300/50 " + (t ? "cursor-grab" : "cursor-pointer"),
62
62
  children: [
63
- z(c || Be, { className: "w-4 h-4 mx-auto" }),
64
- /* @__PURE__ */ e.jsx("p", { className: "truncate text-xs", children: a || o })
63
+ M(c || we, { className: "w-4 h-4 mx-auto" }),
64
+ /* @__PURE__ */ e.jsx("p", { className: "truncate text-xs", children: l || o })
65
65
  ]
66
66
  }
67
67
  ) }),
68
- /* @__PURE__ */ e.jsx($, { children: /* @__PURE__ */ e.jsx("p", { children: a || o }) })
68
+ /* @__PURE__ */ e.jsx(se, { children: /* @__PURE__ */ e.jsx("p", { children: l || o }) })
69
69
  ] }) });
70
- }, Pe = ({ block: s, closePopover: o }) => {
70
+ }, Le = ({ block: s, closePopover: o }) => {
71
71
  var t;
72
- const [c, a] = f(!1), d = I("getExternalPredefinedBlock"), { addCoreBlock: i, addPredefinedBlock: n } = w(), [r] = C(), [, x, p] = Ce(
72
+ const [c, l] = f(!1), d = F("getExternalPredefinedBlock", K()), { addCoreBlock: i, addPredefinedBlock: n } = C(), [r] = A(), [, x, p] = Te(
73
73
  () => ({
74
74
  type: "CHAI_BLOCK",
75
75
  item: s
76
76
  }),
77
77
  [s]
78
- ), l = G(
78
+ ), a = z(
79
79
  async (u) => {
80
- if (u.stopPropagation(), S(s, "component")) {
80
+ if (u.stopPropagation(), L(s, "component")) {
81
81
  i(s, h(r)), o();
82
82
  return;
83
83
  }
84
- a(!0);
84
+ l(!0);
85
85
  const m = await d(s);
86
86
  g(m) || n(H(m), h(r)), o();
87
87
  },
@@ -89,7 +89,7 @@ const _e = ({ block: s }) => {
89
89
  );
90
90
  return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
91
91
  /* @__PURE__ */ e.jsx(
92
- Ae,
92
+ _e,
93
93
  {
94
94
  connect: p,
95
95
  src: "https://placehold.co/100x30/000000/FFF?text=" + ((t = s.name || s.label) == null ? void 0 : t.replace(" ", "+"))
@@ -100,11 +100,11 @@ const _e = ({ block: s }) => {
100
100
  {
101
101
  ref: x,
102
102
  onClick: c ? () => {
103
- } : l,
103
+ } : a,
104
104
  className: "relative cursor-pointer overflow-hidden rounded-md border border-transparent duration-200 hover:scale-x-105 hover:border-foreground/20 hover:shadow-2xl",
105
105
  children: [
106
106
  c && /* @__PURE__ */ e.jsxs("div", { className: "absolute flex h-full w-full items-center justify-center bg-black bg-opacity-70", children: [
107
- /* @__PURE__ */ e.jsx(we, { className: "animate-spin", size: 15, color: "white" }),
107
+ /* @__PURE__ */ e.jsx(Ae, { className: "animate-spin", size: 15, color: "white" }),
108
108
  " ",
109
109
  /* @__PURE__ */ e.jsx("span", { className: "pl-2 text-sm text-white", children: "Adding..." })
110
110
  ] }),
@@ -120,36 +120,36 @@ const _e = ({ block: s }) => {
120
120
  }
121
121
  )
122
122
  ] });
123
- }, Se = () => {
124
- const { data: s } = F(), o = E(), c = j(b(o), { category: "custom" }), a = B(c, "group"), d = B(s, "group"), i = M(() => O(a, d, (l, t) => {
125
- if (T(l) && T(t))
126
- return [...l, ...t];
127
- }), [a, d]), [n, r] = f(h(R(i)) || ""), [, x] = v(A), p = U(i, n, []);
128
- return /* @__PURE__ */ e.jsxs("div", { className: "relative flex flex-col h-full max-h-full overflow-hidden py-2", children: [
129
- /* @__PURE__ */ e.jsx("div", { className: "p-3 sticky top-0 flex w-full items-center", children: /* @__PURE__ */ e.jsxs(ee, { value: n, onValueChange: (l) => r(l), children: [
130
- /* @__PURE__ */ e.jsx(se, { className: "w-full", children: /* @__PURE__ */ e.jsx(re, { placeholder: "Select a provider" }) }),
131
- /* @__PURE__ */ e.jsxs(te, { children: [
132
- /* @__PURE__ */ e.jsx(P, { value: "", children: "Choose" }),
133
- y.Children.toArray(
134
- N(i, (l, t) => /* @__PURE__ */ e.jsx(P, { value: t, children: t }, t))
123
+ }, Ie = () => {
124
+ const { data: s } = E(), o = D(), c = j(b(o), { category: "custom" }), l = k(c, "group"), d = k(s, "group"), i = O(() => R(l, d, (a, t) => {
125
+ if (_(a) && _(t))
126
+ return [...a, ...t];
127
+ }), [l, d]), [n, r] = f(h(W(i)) || ""), [, x] = B(T), p = Y(i, n, []);
128
+ return /* @__PURE__ */ e.jsxs("div", { className: "relative flex h-full max-h-full flex-col overflow-hidden py-2", children: [
129
+ /* @__PURE__ */ e.jsx("div", { className: "sticky top-0 flex w-full items-center p-3", children: /* @__PURE__ */ e.jsxs(re, { value: n, onValueChange: (a) => r(a), children: [
130
+ /* @__PURE__ */ e.jsx(te, { className: "w-full", children: /* @__PURE__ */ e.jsx(oe, { placeholder: "Select a provider" }) }),
131
+ /* @__PURE__ */ e.jsxs(ae, { children: [
132
+ /* @__PURE__ */ e.jsx(S, { value: "", children: "Choose" }),
133
+ v.Children.toArray(
134
+ w(i, (a, t) => /* @__PURE__ */ e.jsx(S, { value: t, children: t }, t))
135
135
  )
136
136
  ] })
137
137
  ] }) }),
138
- /* @__PURE__ */ e.jsx("div", { className: "h-full w-full space-y-2 overflow-y-auto px-2", children: y.Children.toArray(
139
- p.map((l) => /* @__PURE__ */ e.jsx(Pe, { block: l, closePopover: () => x("layers") }))
138
+ /* @__PURE__ */ e.jsx("div", { className: "h-full w-full space-y-2 overflow-y-auto px-2", children: v.Children.toArray(
139
+ p.map((a) => /* @__PURE__ */ e.jsx(Le, { block: a, closePopover: () => x(y) }))
140
140
  ) })
141
141
  ] });
142
- }, Le = () => {
143
- const { t: s } = L(), [o, c] = f(""), { addPredefinedBlock: a } = w(), [d] = C(), [, i] = v(A), n = () => {
144
- const r = Te(o);
145
- a([...r], h(d) || null), c(""), i("layers");
142
+ }, Fe = () => {
143
+ const { t: s } = I(), [o, c] = f(""), { addPredefinedBlock: l } = C(), [d] = A(), [, i] = B(T), n = () => {
144
+ const r = Pe(o);
145
+ l([...r], h(d) || null), c(""), i(y);
146
146
  };
147
- return /* @__PURE__ */ e.jsxs(oe, { className: "border-border/0 p-0 shadow-none", children: [
148
- /* @__PURE__ */ e.jsx(le, { className: "p-3", children: /* @__PURE__ */ e.jsx(ae, { children: s("html_snippet_description") }) }),
149
- /* @__PURE__ */ e.jsx(ie, { className: "space-y-2 px-3 py-0", children: /* @__PURE__ */ e.jsxs("div", { className: "space-y-1", children: [
150
- /* @__PURE__ */ e.jsx(ce, { htmlFor: "current", className: "text-sm", children: s("tailwind_html_snippet") }),
147
+ return /* @__PURE__ */ e.jsxs(le, { className: "border-border/0 p-0 shadow-none", children: [
148
+ /* @__PURE__ */ e.jsx(ie, { className: "p-3", children: /* @__PURE__ */ e.jsx(ce, { children: s("html_snippet_description") }) }),
149
+ /* @__PURE__ */ e.jsx(ne, { className: "space-y-2 px-3 py-0", children: /* @__PURE__ */ e.jsxs("div", { className: "space-y-1", children: [
150
+ /* @__PURE__ */ e.jsx(de, { htmlFor: "current", className: "text-sm", children: s("tailwind_html_snippet") }),
151
151
  /* @__PURE__ */ e.jsx(
152
- ne,
152
+ me,
153
153
  {
154
154
  autoFocus: !0,
155
155
  tabIndex: 1,
@@ -158,23 +158,23 @@ const _e = ({ block: s }) => {
158
158
  rows: 12,
159
159
  value: o,
160
160
  placeholder: s("enter_code_snippet"),
161
- className: "resize-none bg-gray-100 overflow-x-auto whitespace-pre text-xs font-mono font-normal"
161
+ className: "resize-none overflow-x-auto whitespace-pre bg-gray-100 font-mono text-xs font-normal"
162
162
  }
163
163
  )
164
164
  ] }) }),
165
- /* @__PURE__ */ e.jsxs(de, { className: "flex flex-col justify-end p-3", children: [
166
- /* @__PURE__ */ e.jsx(me, { disabled: o.trim() === "", onClick: () => n(), size: "sm", className: "w-full", children: s("import_html") }),
167
- /* @__PURE__ */ e.jsx(pe, { variant: "default", className: "mt-2 p-1 border-none text-gray-400", children: /* @__PURE__ */ e.jsx(ue, { className: "text-xs font-normal leading-4", children: s("note_imported_html") }) })
165
+ /* @__PURE__ */ e.jsxs(pe, { className: "flex flex-col justify-end p-3", children: [
166
+ /* @__PURE__ */ e.jsx(ue, { disabled: o.trim() === "", onClick: () => n(), size: "sm", className: "w-full", children: s("import_html") }),
167
+ /* @__PURE__ */ e.jsx(xe, { variant: "default", className: "mt-2 border-none p-1 text-gray-400", children: /* @__PURE__ */ e.jsx(he, { className: "text-xs font-normal leading-4", children: s("note_imported_html") }) })
168
168
  ] })
169
169
  ] });
170
- }, Ie = () => !0, Ns = () => {
171
- const { t: s } = L(), [o, c] = f("core"), [a, d] = f("basic"), i = E(), [, n] = v(xe), r = I("importHTMLSupport", !0), { data: x, isLoading: p } = F(), l = B(
172
- j(i, () => Ie()),
170
+ }, Ee = () => !0, Cs = () => {
171
+ const { t: s } = I(), [o, c] = f("core"), [l, d] = f("basic"), i = D(), [, n] = B(fe), r = F("importHTMLSupport", !0), { data: x, isLoading: p } = E(), a = k(
172
+ j(i, () => Ee()),
173
173
  "category"
174
- ), t = W(N(l.core, "group"));
174
+ ), t = J(w(a.core, "group"));
175
175
  q(() => {
176
- !J(t, a) && !g(t) && !g(a) && d(h(t));
177
- }, [t, a]);
176
+ !Q(t, l) && !g(t) && !g(l) && d(h(t));
177
+ }, [t, l]);
178
178
  const u = !p && !g(x) || X(b(i), { category: "custom" }) !== void 0;
179
179
  return /* @__PURE__ */ e.jsxs("div", { className: "flex h-full flex-col overflow-hidden", children: [
180
180
  /* @__PURE__ */ e.jsxs("div", { className: "mb-2 flex flex-col justify-between rounded-md bg-background/30 p-1", children: [
@@ -182,7 +182,7 @@ const _e = ({ block: s }) => {
182
182
  /* @__PURE__ */ e.jsx("span", { className: "p-0 text-xs font-light leading-3 opacity-80 xl:pl-1", children: s(o === "html" ? "enter_paste_tailwind_html" : "click_to_add_block") })
183
183
  ] }),
184
184
  /* @__PURE__ */ e.jsx(
185
- he,
185
+ ge,
186
186
  {
187
187
  onValueChange: (m) => {
188
188
  n(""), c(m);
@@ -190,35 +190,35 @@ const _e = ({ block: s }) => {
190
190
  value: o,
191
191
  className: "h-max",
192
192
  children: /* @__PURE__ */ e.jsxs(
193
- fe,
193
+ je,
194
194
  {
195
195
  className: "grid w-full " + (u && r ? "grid-cols-3" : u && !r || !u && r ? "grid-cols-2" : "grid-cols-1"),
196
196
  children: [
197
- /* @__PURE__ */ e.jsx(k, { value: "core", children: s("Blocks") }),
198
- u ? /* @__PURE__ */ e.jsx(k, { value: "ui-blocks", children: s("ui_library") }) : null,
199
- r ? /* @__PURE__ */ e.jsx(k, { value: "html", children: s("import") }) : null
197
+ /* @__PURE__ */ e.jsx(N, { value: "core", children: s("Blocks") }),
198
+ u ? /* @__PURE__ */ e.jsx(N, { value: "ui-blocks", children: s("ui_library") }) : null,
199
+ r ? /* @__PURE__ */ e.jsx(N, { value: "html", children: s("import") }) : null
200
200
  ]
201
201
  }
202
202
  )
203
203
  }
204
204
  ),
205
- o === "core" && /* @__PURE__ */ e.jsx(ge, { className: "-mx-1.5 h-full", children: /* @__PURE__ */ e.jsx("div", { className: "mt-2 w-full", children: y.Children.toArray(
206
- N(
205
+ o === "core" && /* @__PURE__ */ e.jsx(be, { className: "-mx-1.5 h-full", children: /* @__PURE__ */ e.jsx("div", { className: "mt-2 w-full", children: v.Children.toArray(
206
+ w(
207
207
  t,
208
- (m) => _(j(b(l.core), { group: m }), {
208
+ (m) => P(j(b(a.core), { group: m }), {
209
209
  hidden: !0
210
- }).length ? /* @__PURE__ */ e.jsx(je, { type: "single", value: m, collapsible: !0, className: "w-full", children: /* @__PURE__ */ e.jsxs(be, { value: m, children: [
211
- /* @__PURE__ */ e.jsx(ye, { className: "rounded-md bg-gray-100 px-4 py-2 capitalize", children: m }),
212
- /* @__PURE__ */ e.jsx(ve, { className: "p-3", children: /* @__PURE__ */ e.jsx("div", { className: "grid grid-cols-3 gap-2", children: y.Children.toArray(
213
- _(j(b(l.core), { group: m }), { hidden: !0 }).map((D) => /* @__PURE__ */ e.jsx(_e, { block: D }))
210
+ }).length ? /* @__PURE__ */ e.jsx(ve, { type: "single", value: m, collapsible: !0, className: "w-full", children: /* @__PURE__ */ e.jsxs(ye, { value: m, children: [
211
+ /* @__PURE__ */ e.jsx(Be, { className: "rounded-md bg-gray-100 px-4 py-2 capitalize", children: m }),
212
+ /* @__PURE__ */ e.jsx(Ne, { className: "p-3", children: /* @__PURE__ */ e.jsx("div", { className: "grid grid-cols-3 gap-2", children: v.Children.toArray(
213
+ P(j(b(a.core), { group: m }), { hidden: !0 }).map((G) => /* @__PURE__ */ e.jsx(Se, { block: G }))
214
214
  ) }) })
215
215
  ] }) }) : null
216
216
  )
217
217
  ) }) }),
218
- o === "ui-blocks" && /* @__PURE__ */ e.jsx(V, { fallback: /* @__PURE__ */ e.jsx(ke, { className: "h-32 w-full" }), children: /* @__PURE__ */ e.jsx(Se, {}) }),
219
- o === "html" && r ? /* @__PURE__ */ e.jsx(Le, {}) : null
218
+ o === "ui-blocks" && /* @__PURE__ */ e.jsx(U, { fallback: /* @__PURE__ */ e.jsx(ke, { className: "h-32 w-full" }), children: /* @__PURE__ */ e.jsx(Ie, {}) }),
219
+ o === "html" && r ? /* @__PURE__ */ e.jsx(Fe, {}) : null
220
220
  ] });
221
221
  };
222
222
  export {
223
- Ns as default
223
+ Cs as default
224
224
  };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-Z_BpKhVy.cjs"),c=require("react"),t=require("lodash-es"),E=require("jotai"),v=require("react-i18next"),s=require("./index-MQH3blB-.cjs"),B=require("@radix-ui/react-icons"),R=require("@chaibuilder/runtime"),q=require("flagged"),g=require("./MODIFIERS-9EwxLM8V.cjs"),k=require("lucide-react"),y=require("react-dnd"),N=require("./html-to-json-FGufPv9R.cjs");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("./Functions-N3yhPYKY.cjs");require("clsx");require("tailwind-merge");require("flat-to-nested");require("@react-hookz/web");require("@radix-ui/react-toggle");require("class-variance-authority");require("./Class-MmCxz2Ay.cjs");require("@radix-ui/react-switch");require("@radix-ui/react-slot");require("@radix-ui/react-accordion");require("@radix-ui/react-alert-dialog");require("@radix-ui/react-dialog");require("@radix-ui/react-label");require("@radix-ui/react-scroll-area");require("@radix-ui/react-tabs");require("@radix-ui/react-tooltip");require("@radix-ui/react-popover");require("@radix-ui/react-menubar");require("@radix-ui/react-hover-card");require("@radix-ui/react-select");require("@radix-ui/react-dropdown-menu");require("@radix-ui/react-separator");require("@radix-ui/react-toast");require("cmdk");require("@radix-ui/react-context-menu");require("react-icons-picker");require("react-dom");require("react-quill");require("himalaya");const A=({block:r})=>{const{type:n,icon:d,label:a}=r,{addCoreBlock:m,addPredefinedBlock:u}=s.useAddBlock(),[x,o]=s.useSelectedBlockIds(),[,f]=s.useHighlightBlockId(),[,j]=E.useAtom(s.activePanelAtom),l=()=>{t.has(r,"blocks")?u(R.syncBlocksWithDefaults(r.blocks),t.first(x)):m(r,t.first(x)),j(g.OUTLINE_KEY)},i=q.useFeature("dnd");return e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:e.jsxRuntimeExports.jsxs(s.Tooltip,{children:[e.jsxRuntimeExports.jsx(s.TooltipTrigger,{asChild:!0,children:e.jsxRuntimeExports.jsxs("button",{onClick:l,type:"button",onDragStart:h=>{h.dataTransfer.setData("text/plain",JSON.stringify(t.omit(r,["component","icon"]))),setTimeout(()=>{o([]),f(null),j(g.OUTLINE_KEY)},200)},draggable:i?"true":"false",className:"space-y-2 rounded-lg border border-border p-3 text-center hover:bg-slate-300/50 "+(i?"cursor-grab":"cursor-pointer"),children:[c.createElement(d||B.BoxIcon,{className:"w-4 h-4 mx-auto"}),e.jsxRuntimeExports.jsx("p",{className:"truncate text-xs",children:a||n})]})}),e.jsxRuntimeExports.jsx(s.TooltipContent,{children:e.jsxRuntimeExports.jsx("p",{children:a||n})})]})})},C=({block:r,closePopover:n})=>{var i;const[d,a]=c.useState(!1),m=s.useBuilderProp("getExternalPredefinedBlock",t.noop()),{addCoreBlock:u,addPredefinedBlock:x}=s.useAddBlock(),[o]=s.useSelectedBlockIds(),[,f,j]=y.useDrag(()=>({type:"CHAI_BLOCK",item:r}),[r]),l=c.useCallback(async h=>{if(h.stopPropagation(),t.has(r,"component")){u(r,t.first(o)),n();return}a(!0);const p=await m(r);t.isEmpty(p)||x(R.syncBlocksWithDefaults(p),t.first(o)),n()},[r]);return e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx(y.DragPreviewImage,{connect:j,src:"https://placehold.co/100x30/000000/FFF?text="+((i=r.name||r.label)==null?void 0:i.replace(" ","+"))}),e.jsxRuntimeExports.jsxs("div",{ref:f,onClick:d?()=>{}:l,className:"relative cursor-pointer overflow-hidden rounded-md border border-transparent duration-200 hover:scale-x-105 hover:border-foreground/20 hover:shadow-2xl",children:[d&&e.jsxRuntimeExports.jsxs("div",{className:"absolute flex h-full w-full items-center justify-center bg-black bg-opacity-70",children:[e.jsxRuntimeExports.jsx(k.Loader,{className:"animate-spin",size:15,color:"white"})," ",e.jsxRuntimeExports.jsx("span",{className:"pl-2 text-sm text-white",children:"Adding..."})]}),r.preview?e.jsxRuntimeExports.jsx("img",{src:r.preview,className:"min-h-[50px] w-full rounded-md border border-gray-300",alt:r.label}):e.jsxRuntimeExports.jsx("div",{className:"flex h-20 items-center justify-center rounded-md border border-border border-gray-300 bg-gray-200",children:e.jsxRuntimeExports.jsx("p",{className:"max-w-xs text-center text-sm text-gray-700",children:r.label})})]})]})},T=()=>{const{data:r}=s.useUILibraryBlocks(),n=R.useChaiBlocks(),d=t.filter(t.values(n),{category:"custom"}),a=t.groupBy(d,"group"),m=t.groupBy(r,"group"),u=c.useMemo(()=>t.mergeWith(a,m,(l,i)=>{if(t.isArray(l)&&t.isArray(i))return[...l,...i]}),[a,m]),[x,o]=c.useState(t.first(t.keys(u))||""),[,f]=E.useAtom(s.activePanelAtom),j=t.get(u,x,[]);return e.jsxRuntimeExports.jsxs("div",{className:"relative flex h-full max-h-full flex-col overflow-hidden py-2",children:[e.jsxRuntimeExports.jsx("div",{className:"sticky top-0 flex w-full items-center p-3",children:e.jsxRuntimeExports.jsxs(s.Select,{value:x,onValueChange:l=>o(l),children:[e.jsxRuntimeExports.jsx(s.SelectTrigger,{className:"w-full",children:e.jsxRuntimeExports.jsx(s.SelectValue,{placeholder:"Select a provider"})}),e.jsxRuntimeExports.jsxs(s.SelectContent,{children:[e.jsxRuntimeExports.jsx(s.SelectItem,{value:"",children:"Choose"}),c.Children.toArray(t.map(u,(l,i)=>e.jsxRuntimeExports.jsx(s.SelectItem,{value:i,children:i},i)))]})]})}),e.jsxRuntimeExports.jsx("div",{className:"h-full w-full space-y-2 overflow-y-auto px-2",children:c.Children.toArray(j.map(l=>e.jsxRuntimeExports.jsx(C,{block:l,closePopover:()=>f(g.OUTLINE_KEY)})))})]})},w=()=>{const{t:r}=v.useTranslation(),[n,d]=c.useState(""),{addPredefinedBlock:a}=s.useAddBlock(),[m]=s.useSelectedBlockIds(),[,u]=E.useAtom(s.activePanelAtom),x=()=>{const o=N.getBlocksFromHTML(n);a([...o],t.first(m)||null),d(""),u(g.OUTLINE_KEY)};return e.jsxRuntimeExports.jsxs(s.Card,{className:"border-border/0 p-0 shadow-none",children:[e.jsxRuntimeExports.jsx(s.CardHeader,{className:"p-3",children:e.jsxRuntimeExports.jsx(s.CardDescription,{children:r("html_snippet_description")})}),e.jsxRuntimeExports.jsx(s.CardContent,{className:"space-y-2 px-3 py-0",children:e.jsxRuntimeExports.jsxs("div",{className:"space-y-1",children:[e.jsxRuntimeExports.jsx(s.Label,{htmlFor:"current",className:"text-sm",children:r("tailwind_html_snippet")}),e.jsxRuntimeExports.jsx(s.Textarea,{autoFocus:!0,tabIndex:1,ref:o=>o&&o.focus(),onChange:o=>d(o.target.value),rows:12,value:n,placeholder:r("enter_code_snippet"),className:"resize-none overflow-x-auto whitespace-pre bg-gray-100 font-mono text-xs font-normal"})]})}),e.jsxRuntimeExports.jsxs(s.CardFooter,{className:"flex flex-col justify-end p-3",children:[e.jsxRuntimeExports.jsx(s.Button,{disabled:n.trim()==="",onClick:()=>x(),size:"sm",className:"w-full",children:r("import_html")}),e.jsxRuntimeExports.jsx(s.Alert,{variant:"default",className:"mt-2 border-none p-1 text-gray-400",children:e.jsxRuntimeExports.jsx(s.AlertTitle,{className:"text-xs font-normal leading-4",children:r("note_imported_html")})})]})]})},S=()=>!0,I=()=>{const{t:r}=v.useTranslation(),[n,d]=c.useState("core"),[a,m]=c.useState("basic"),u=R.useChaiBlocks(),[,x]=E.useAtom(s.showPredefinedBlockCategoryAtom),o=s.useBuilderProp("importHTMLSupport",!0),{data:f,isLoading:j}=s.useUILibraryBlocks(),l=t.groupBy(t.filter(u,()=>S()),"category"),i=t.uniq(t.map(l.core,"group"));c.useEffect(()=>{!t.includes(i,a)&&!t.isEmpty(i)&&!t.isEmpty(a)&&m(t.first(i))},[i,a]);const h=!j&&!t.isEmpty(f)||t.find(t.values(u),{category:"custom"})!==void 0;return e.jsxRuntimeExports.jsxs("div",{className:"flex h-full flex-col overflow-hidden",children:[e.jsxRuntimeExports.jsxs("div",{className:"mb-2 flex flex-col justify-between rounded-md bg-background/30 p-1",children:[e.jsxRuntimeExports.jsx("h1",{className:"flex flex-col items-baseline px-1 text-xl font-semibold xl:flex-col",children:r("add_block")}),e.jsxRuntimeExports.jsx("span",{className:"p-0 text-xs font-light leading-3 opacity-80 xl:pl-1",children:r(n==="html"?"enter_paste_tailwind_html":"click_to_add_block")})]}),e.jsxRuntimeExports.jsx(s.Tabs,{onValueChange:p=>{x(""),d(p)},value:n,className:"h-max",children:e.jsxRuntimeExports.jsxs(s.TabsList,{className:"grid w-full "+(h&&o?"grid-cols-3":h&&!o||!h&&o?"grid-cols-2":"grid-cols-1"),children:[e.jsxRuntimeExports.jsx(s.TabsTrigger,{value:"core",children:r("Blocks")}),h?e.jsxRuntimeExports.jsx(s.TabsTrigger,{value:"ui-blocks",children:r("ui_library")}):null,o?e.jsxRuntimeExports.jsx(s.TabsTrigger,{value:"html",children:r("import")}):null]})}),n==="core"&&e.jsxRuntimeExports.jsx(s.ScrollArea,{className:"-mx-1.5 h-full",children:e.jsxRuntimeExports.jsx("div",{className:"mt-2 w-full",children:c.Children.toArray(t.map(i,p=>t.reject(t.filter(t.values(l.core),{group:p}),{hidden:!0}).length?e.jsxRuntimeExports.jsx(s.Accordion,{type:"single",value:p,collapsible:!0,className:"w-full",children:e.jsxRuntimeExports.jsxs(s.AccordionItem,{value:p,children:[e.jsxRuntimeExports.jsx(s.AccordionTrigger,{className:"rounded-md bg-gray-100 px-4 py-2 capitalize",children:p}),e.jsxRuntimeExports.jsx(s.AccordionContent,{className:"p-3",children:e.jsxRuntimeExports.jsx("div",{className:"grid grid-cols-3 gap-2",children:c.Children.toArray(t.reject(t.filter(t.values(l.core),{group:p}),{hidden:!0}).map(b=>e.jsxRuntimeExports.jsx(A,{block:b})))})})]})}):null))})}),n==="ui-blocks"&&e.jsxRuntimeExports.jsx(c.Suspense,{fallback:e.jsxRuntimeExports.jsx(s.Skeleton,{className:"h-32 w-full"}),children:e.jsxRuntimeExports.jsx(T,{})}),n==="html"&&o?e.jsxRuntimeExports.jsx(w,{}):null]})};exports.default=I;
@@ -2,9 +2,9 @@ import { j as t } from "./jsx-runtime-WbnYoNE9.js";
2
2
  import * as c from "react";
3
3
  import N from "@rjsf/validator-ajv8";
4
4
  import j from "@rjsf/core";
5
- import { i as k, t as D, bt as P } from "./index-QGA4ayU7.js";
6
- import { f, c as R, y as a } from "./empty-slot-5FRrRq1E.js";
7
- import { debounce as w, isEqual as L } from "lodash-es";
5
+ import { h as k, F as D, bu as P } from "./index-MaXiXghQ.js";
6
+ import { f, c as R, y as a } from "./controls-XPXGHKht.js";
7
+ import { debounce as w, noop as F, isEqual as L } from "lodash-es";
8
8
  import "./_commonjsHelpers-UyOWmZb0.js";
9
9
  import "./Functions-7jnEwJyw.js";
10
10
  import "clsx";
@@ -12,11 +12,11 @@ import "tailwind-merge";
12
12
  import "@chaibuilder/runtime";
13
13
  import "jotai";
14
14
  import "flat-to-nested";
15
- import "./MODIFIERS-RiXS5Mn1.js";
15
+ import "./MODIFIERS-WQdaNvb8.js";
16
16
  import "@react-hookz/web";
17
17
  import "@radix-ui/react-toggle";
18
18
  import "class-variance-authority";
19
- import "./Class-17XFhL48.js";
19
+ import "./Class-3k8xjeiM.js";
20
20
  import "@radix-ui/react-switch";
21
21
  import "@radix-ui/react-slot";
22
22
  import "@radix-ui/react-accordion";
@@ -40,7 +40,7 @@ import "react-icons-picker";
40
40
  import "react-dom";
41
41
  import "react-quill";
42
42
  import "react-i18next";
43
- const F = ({ value: u, onChange: e, id: p, onBlur: d }) => {
43
+ const T = ({ value: u, onChange: e, id: p, onBlur: d }) => {
44
44
  const i = w(e, 200), m = (l) => i(l.target.value);
45
45
  return /* @__PURE__ */ t.jsx("div", { className: "mt-1.5 flex items-center gap-x-3", children: /* @__PURE__ */ t.jsx("div", { className: "flex w-3/5 flex-col", children: /* @__PURE__ */ t.jsx(
46
46
  "input",
@@ -102,9 +102,8 @@ const F = ({ value: u, onChange: e, id: p, onBlur: d }) => {
102
102
  { title: "Lustria", value: "Lustria" },
103
103
  { title: "Ovo", value: "Ovo" },
104
104
  { title: "Suranna", value: "Suranna" }
105
- ], Ct = () => {
106
- const u = k("onSaveBrandingOptions", async () => {
107
- }), [e, p] = D(), [d] = P(), i = c.useRef(e);
105
+ ], St = () => {
106
+ const u = k("onSaveBrandingOptions", F), [e, p] = D(), [d] = P(), i = c.useRef(e);
108
107
  c.useEffect(() => () => {
109
108
  L(e, i.current) || u(i.current);
110
109
  }, []);
@@ -113,8 +112,8 @@ const F = ({ value: u, onChange: e, id: p, onBlur: d }) => {
113
112
  }, {
114
113
  bodyFont: l,
115
114
  headingFont: h,
116
- primaryColor: y,
117
- bodyTextDarkColor: x,
115
+ primaryColor: x,
116
+ bodyTextDarkColor: y,
118
117
  bodyTextLightColor: b,
119
118
  bodyBgDarkColor: C,
120
119
  secondaryColor: S,
@@ -136,7 +135,7 @@ const F = ({ value: u, onChange: e, id: p, onBlur: d }) => {
136
135
  title: "Rounded Corner",
137
136
  default: parseInt(O || 5, 10)
138
137
  }),
139
- primaryColor: a({ title: "Primary", default: y }),
138
+ primaryColor: a({ title: "Primary", default: x }),
140
139
  secondaryColor: a({ title: "Secondary", default: S })
141
140
  };
142
141
  d || (r = {
@@ -147,7 +146,7 @@ const F = ({ value: u, onChange: e, id: p, onBlur: d }) => {
147
146
  }),
148
147
  bodyTextLightColor: a({
149
148
  title: "Body Text (Light)",
150
- default: x
149
+ default: y
151
150
  }),
152
151
  bodyBgDarkColor: a({
153
152
  title: "Body Background (Dark)",
@@ -170,7 +169,7 @@ const F = ({ value: u, onChange: e, id: p, onBlur: d }) => {
170
169
  /* @__PURE__ */ t.jsx("div", { className: "-mx-2", children: /* @__PURE__ */ t.jsx(
171
170
  j,
172
171
  {
173
- widgets: { color: F },
172
+ widgets: { color: T },
174
173
  idSeparator: ".",
175
174
  autoComplete: "off",
176
175
  omitExtraData: !0,
@@ -186,5 +185,5 @@ const F = ({ value: u, onChange: e, id: p, onBlur: d }) => {
186
185
  ] });
187
186
  };
188
187
  export {
189
- Ct as default
188
+ St as default
190
189
  };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./jsx-runtime-Z_BpKhVy.cjs"),B=require("react"),R=require("@rjsf/validator-ajv8"),E=require("@rjsf/core"),p=require("./index-MQH3blB-.cjs"),r=require("./controls-Dy1qa8Dc.cjs"),g=require("lodash-es");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("./Functions-N3yhPYKY.cjs");require("clsx");require("tailwind-merge");require("@chaibuilder/runtime");require("jotai");require("flat-to-nested");require("./MODIFIERS-9EwxLM8V.cjs");require("@react-hookz/web");require("@radix-ui/react-toggle");require("class-variance-authority");require("./Class-MmCxz2Ay.cjs");require("@radix-ui/react-switch");require("@radix-ui/react-slot");require("@radix-ui/react-accordion");require("@radix-ui/react-icons");require("@radix-ui/react-alert-dialog");require("@radix-ui/react-dialog");require("@radix-ui/react-label");require("@radix-ui/react-scroll-area");require("@radix-ui/react-tabs");require("@radix-ui/react-tooltip");require("@radix-ui/react-popover");require("@radix-ui/react-menubar");require("@radix-ui/react-hover-card");require("@radix-ui/react-select");require("@radix-ui/react-dropdown-menu");require("@radix-ui/react-separator");require("@radix-ui/react-toast");require("cmdk");require("@radix-ui/react-context-menu");require("react-icons-picker");require("react-dom");require("react-quill");require("react-i18next");function N(t){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const i in t)if(i!=="default"){const l=Object.getOwnPropertyDescriptor(t,i);Object.defineProperty(e,i,l.get?l:{enumerable:!0,get:()=>t[i]})}}return e.default=t,Object.freeze(e)}const f=N(B),k=({value:t,onChange:e,id:i,onBlur:l})=>{const n=g.debounce(e,200),v=u=>n(u.target.value);return a.jsxRuntimeExports.jsx("div",{className:"mt-1.5 flex items-center gap-x-3",children:a.jsxRuntimeExports.jsx("div",{className:"flex w-3/5 flex-col",children:a.jsxRuntimeExports.jsx("input",{type:"color",className:"text-xs p-0",value:t,onBlur:({target:{value:u}})=>l(i,u),onChange:v})})})},m=[{title:"Roboto",value:"Roboto"},{title:"Open Sans",value:"Open Sans"},{title:"Montserrat",value:"Montserrat"},{title:"Lato",value:"Lato"},{title:"Poppins",value:"Poppins"},{title:"Oswald",value:"Oswald"},{title:"Raleway",value:"Raleway"},{title:"Ubuntu",value:"Ubuntu"},{title:"Nunito",value:"Nunito"},{title:"Merriweather",value:"Merriweather"},{title:"Nunito Sans",value:"Nunito Sans"},{title:"Playfair Display",value:"Playfair Display"},{title:"Rubik",value:"Rubik"},{title:"Inter",value:"Inter"},{title:"Lora",value:"Lora"},{title:"Kanit",value:"Kanit"},{title:"Fira Sans",value:"Fira Sans"},{title:"Hind",value:"Hind"},{title:"Quicksand",value:"Quicksand"},{title:"Mulish",value:"Mulish"},{title:"Barlow",value:"Barlow"},{title:"Inconsolata",value:"Inconsolata"},{title:"Titillium Web",value:"Titillium Web"},{title:"Heebo",value:"Heebo"},{title:"IBM Plex Sans",value:"IBM Plex Sans"},{title:"DM Sans",value:"DM Sans"},{title:"Nanum Gothic",value:"Nanum Gothic"},{title:"Karla",value:"Karla"},{title:"Arimo",value:"Arimo"},{title:"Cabin",value:"Cabin"},{title:"Oxygen",value:"Oxygen"},{title:"Overpass",value:"Overpass"},{title:"Assistant",value:"Assistant"},{title:"Tajawal",value:"Tajawal"},{title:"Play",value:"Play"},{title:"Exo",value:"Exo"},{title:"Cinzel",value:"Cinzel"},{title:"Faustina",value:"Faustina"},{title:"Philosopher",value:"Philosopher"},{title:"Gelasio",value:"Gelasio"},{title:"Sofia Sans Condensed",value:"Sofia Sans Condensed"},{title:"Noto Sans Devanagari",value:"Noto Sans Devanagari"},{title:"Actor",value:"Actor"},{title:"Epilogue",value:"Epilogue"},{title:"Glegoo",value:"Glegoo"},{title:"Overlock",value:"Overlock"},{title:"Lustria",value:"Lustria"},{title:"Ovo",value:"Ovo"},{title:"Suranna",value:"Suranna"}],P=()=>{const t=p.useBuilderProp("onSaveBrandingOptions",g.noop),[e,i]=p.useBrandingOptions(),[l]=p.useBlocksContainer(),n=f.useRef(e);f.useEffect(()=>()=>{g.isEqual(e,n.current)||t(n.current)},[]);const v=({formData:o},c)=>{c&&(i(o),n.current=o)},{bodyFont:u,headingFont:y,primaryColor:q,bodyTextDarkColor:b,bodyTextLightColor:h,bodyBgDarkColor:S,secondaryColor:C,bodyBgLightColor:O,roundedCorners:j}=e;let s={headingFont:r.f({title:"Heading font",default:y,options:m}),bodyFont:r.f({title:"Body font",default:u,options:m}),roundedCorners:r.c({title:"Rounded Corner",default:parseInt(j||5,10)}),primaryColor:r.y({title:"Primary",default:q}),secondaryColor:r.y({title:"Secondary",default:C})};l||(s={...s,bodyBgLightColor:r.y({title:"Body Background (Light)",default:O}),bodyTextLightColor:r.y({title:"Body Text (Light)",default:b}),bodyBgDarkColor:r.y({title:"Body Background (Dark)",default:S}),bodyTextDarkColor:r.y({title:"Body Text (Dark)",default:h})});const d={type:"object",properties:{}},x={};return Object.keys(s).forEach(o=>{const c=s[o];return d.properties||(d.properties={}),d.properties[o]=c.schema,x[o]=c.uiSchema,!0}),a.jsxRuntimeExports.jsxs("div",{className:"flex h-full select-none flex-col",children:[a.jsxRuntimeExports.jsx("div",{className:"rounded-md bg-background/30 p-1",children:a.jsxRuntimeExports.jsx("h1",{className:"px-1 font-semibold",children:"Branding Options"})}),a.jsxRuntimeExports.jsx("div",{className:"-mx-2",children:a.jsxRuntimeExports.jsx(E,{widgets:{color:k},idSeparator:".",autoComplete:"off",omitExtraData:!0,liveOmit:!0,liveValidate:!0,uiSchema:x,schema:d,formData:e,validator:R,onChange:v})})]})};exports.default=P;