@chaibuilder/sdk 1.2.23 → 1.2.25

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 (186) hide show
  1. package/README.md +6 -5
  2. package/dist/AddBlocks-Ol3iIVKa.js +207 -0
  3. package/dist/AddBlocks-a1c-7Ewz.cjs +1 -0
  4. package/dist/BrandingOptions-6rnt0UaA.cjs +1 -0
  5. package/dist/{BrandingOptions-eUSoIgjj.js → BrandingOptions-iTyWpwTs.js} +40 -54
  6. package/dist/CanvasArea-R4ogF9AT.cjs +55 -0
  7. package/dist/{CanvasArea-ulUy_rmB.js → CanvasArea-dZjng782.js} +340 -324
  8. package/dist/ChaiBuilderEditor-m30yoOgJ.cjs +163 -0
  9. package/dist/ChaiBuilderEditor-vP4at00I.js +27974 -0
  10. package/dist/{Class-lGzsNBOK.js → Class-ahc3NIbq.js} +26 -29
  11. package/dist/Class-eieto7e-.cjs +1 -0
  12. package/dist/Controls-3Cc1XYXg.js +105 -0
  13. package/dist/Controls-ky25Ebo3.cjs +1 -0
  14. package/dist/CurrentPage-3gQTH0Zt.cjs +1 -0
  15. package/dist/{CurrentPage-SFhXzQMy.js → CurrentPage-Kmfp-kFk.js} +41 -55
  16. package/dist/Functions-Hvon6AMZ.cjs +1 -0
  17. package/dist/Functions-NzT2Six_.js +15 -0
  18. package/dist/ImagesPanel-J1RlG7xG.cjs +1 -0
  19. package/dist/ImagesPanel-Wb0GF_NA.js +29 -0
  20. package/dist/ListTree-CZ-mtjZ9.cjs +1 -0
  21. package/dist/{ListTree-ZeVWczTF.js → ListTree-N3jeD790.js} +92 -102
  22. package/dist/{MODIFIERS-dytZ-osO.js → MODIFIERS-CNqNUapY.js} +10 -4
  23. package/dist/MODIFIERS-o1p3VnpS.cjs +1 -0
  24. package/dist/PagesPanel-Gi0z6gaf.cjs +1 -0
  25. package/dist/PagesPanel-u1IB-nRr.js +48 -0
  26. package/dist/ProjectPanel-EydGZmMW.js +71 -0
  27. package/dist/ProjectPanel-kiiljG4H.cjs +1 -0
  28. package/dist/{STRINGS--j49GZJP.js → STRINGS-b432aBJJ.js} +2 -2
  29. package/dist/Settings-8ilCSH8b.cjs +1 -0
  30. package/dist/{Settings-FZWm8Fc3.js → Settings-jCcd-VE6.js} +407 -401
  31. package/dist/SidePanels-T36C6Lhc.cjs +1 -0
  32. package/dist/{SidePanels-wrkkpcGE.js → SidePanels-pHMYprpW.js} +107 -117
  33. package/dist/Topbar-CvWQuspR.cjs +1 -0
  34. package/dist/Topbar-pbIDUE_B.js +122 -0
  35. package/dist/UnsplashImages-KBZPd9dv.cjs +1 -0
  36. package/dist/{UnsplashImages-eZedbK2J.js → UnsplashImages-L7x_3RQf.js} +50 -63
  37. package/dist/UploadImages-GkkJVAgG.cjs +1 -0
  38. package/dist/{UploadImages-71QziLbr.js → UploadImages-zdEJRLD8.js} +37 -60
  39. package/dist/accordion-oPUeqPCZ.js +42 -0
  40. package/dist/accordion-ynvFtV_p.cjs +1 -0
  41. package/dist/add-page-modal-9SGv2hgc.cjs +1 -0
  42. package/dist/add-page-modal-JCDXZIPW.js +95 -0
  43. package/dist/alert-dialog-P9xMMB6C.cjs +1 -0
  44. package/dist/alert-dialog-rypfO5ly.js +64 -0
  45. package/dist/badge-E-S7CqUt.cjs +1 -0
  46. package/dist/badge-tEwO7C51.js +23 -0
  47. package/dist/block-helpers-OKHmRRol.cjs +1 -0
  48. package/dist/block-helpers-oSFpSsGz.js +23 -0
  49. package/dist/command-BxR6jaCI.cjs +1 -0
  50. package/dist/command-Pn3HKDuV.js +97 -0
  51. package/dist/confirm-alert-uNm0lZ0y.cjs +1 -0
  52. package/dist/confirm-alert-wR5_VJ1l.js +36 -0
  53. package/dist/context-menu-8dC9uGXj.js +122 -0
  54. package/dist/context-menu-IgLbIuth.cjs +1 -0
  55. package/dist/{controls-OfJWSEqC.js → controls-IS5qnRce.js} +20 -85
  56. package/dist/controls-L7DPvB0m.cjs +1 -0
  57. package/dist/core.cjs +1 -1
  58. package/dist/core.d.ts +7 -4
  59. package/dist/core.js +150 -75
  60. package/dist/{defaultTheme-D8B4-wHO.js → defaultTheme-4kA60XdB.js} +6 -8
  61. package/dist/defaultTheme-mrkeGFGI.cjs +1 -0
  62. package/dist/delete-page-modal-7KmP1elv.js +67 -0
  63. package/dist/delete-page-modal-SgfwvfNu.cjs +1 -0
  64. package/dist/dropdown-menu-El86_9Uo.js +124 -0
  65. package/dist/dropdown-menu-SiHzqWwZ.cjs +1 -0
  66. package/dist/email-blocks.cjs +1 -1
  67. package/dist/email-blocks.js +3 -292
  68. package/dist/email.cjs +1 -1
  69. package/dist/email.d.ts +5 -2
  70. package/dist/email.js +18 -37
  71. package/dist/{form-zKUMQFuB.js → form-0_RLz2TB.js} +12 -12
  72. package/dist/form-W58AVUdf.cjs +1 -0
  73. package/dist/hover-card-KUwpDkW8.cjs +1 -0
  74. package/dist/hover-card-q138xxXR.js +45 -0
  75. package/dist/{html-to-json-ngX9ef2u.js → html-to-json-2xtb7520.js} +41 -41
  76. package/dist/{html-to-json-efmv1pCj.cjs → html-to-json-uSnxl72F.cjs} +1 -1
  77. package/dist/iconBase-gbUAAO2L.cjs +1 -0
  78. package/dist/iconBase-h4DuR_XT.js +63 -0
  79. package/dist/index-9MmykVSc.cjs +1 -0
  80. package/dist/index-hElOGcFr.js +2200 -0
  81. package/dist/index-lDTsQp7h.js +188 -0
  82. package/dist/index-rq5Y9ZDy.cjs +1 -0
  83. package/dist/jsx-runtime-JYMCiFoE.cjs +27 -0
  84. package/dist/{jsx-runtime-WbnYoNE9.js → jsx-runtime-Sp0orL4X.js} +106 -109
  85. package/dist/label-KaP7MRrs.js +10 -0
  86. package/dist/label-tFm8HZdb.cjs +1 -0
  87. package/dist/lib.cjs +2 -2
  88. package/dist/lib.js +62 -66
  89. package/dist/link-WbcKdQ9k.cjs +1 -0
  90. package/dist/link-xuhP-4dN.js +196 -0
  91. package/dist/page-viewer-Hx5hxHKm.cjs +1 -0
  92. package/dist/{page-viewer-7AwzWRtB.js → page-viewer-NnOwmAmu.js} +44 -58
  93. package/dist/popover-a84pbVhQ.js +23 -0
  94. package/dist/popover-fKjgcRUx.cjs +1 -0
  95. package/dist/{project-general-setting-pYPoqvqd.js → project-general-setting-9ju3TDju.js} +35 -43
  96. package/dist/project-general-setting-FxkwjvJz.cjs +1 -0
  97. package/dist/{project-seo-setting-zXKOcjep.js → project-seo-setting-36CdUszM.js} +23 -40
  98. package/dist/project-seo-setting-RU7qiXxb.cjs +1 -0
  99. package/dist/render.cjs +1 -1
  100. package/dist/render.js +13 -14
  101. package/dist/scroll-area-FiHvy-TZ.cjs +1 -0
  102. package/dist/scroll-area-ewXbxc3n.js +30 -0
  103. package/dist/select-7bjg-rr9.cjs +1 -0
  104. package/dist/select-POGdEDHT.js +75 -0
  105. package/dist/separator-3Civ-6hb.cjs +1 -0
  106. package/dist/separator-SctTn0Qi.js +18 -0
  107. package/dist/single-page-detail-beY0MT1b.cjs +1 -0
  108. package/dist/{single-page-detail-q2TDxN-P.js → single-page-detail-hD1jKZ8k.js} +65 -73
  109. package/dist/skeleton-STeL9VrJ.cjs +1 -0
  110. package/dist/skeleton-lu8e7q2y.js +239 -0
  111. package/dist/studio.cjs +1 -1
  112. package/dist/studio.d.ts +5 -2
  113. package/dist/studio.js +24 -40
  114. package/dist/tabs-_4WbA1cc.cjs +1 -0
  115. package/dist/tabs-yQ3oGziM.js +106 -0
  116. package/dist/textarea-1kZEh7ki.cjs +1 -0
  117. package/dist/textarea-b2QvVhrK.js +73 -0
  118. package/dist/ui.cjs +1 -1
  119. package/dist/ui.js +364 -159
  120. package/dist/useAddBlock-8pxOEYIl.cjs +1 -0
  121. package/dist/useAddBlock-FEKFJNwQ.js +69 -0
  122. package/dist/useChaiExternalData-fkFgoS80.js +6 -0
  123. package/dist/useChaiExternalData-rwoAZ6uU.cjs +1 -0
  124. package/dist/useDarkMode-7i57segK.cjs +1 -0
  125. package/dist/useDarkMode-8VHJlYyE.js +23 -0
  126. package/dist/useSelectedBreakpoints-6NK5qd7T.js +10 -0
  127. package/dist/useSelectedBreakpoints-7ONXb-vN.cjs +1 -0
  128. package/dist/useStylingState-Iuj84yvc.js +186 -0
  129. package/dist/useStylingState-OIvJMV6p.cjs +1 -0
  130. package/dist/useUiLibraries-nCdauJ4N.cjs +1 -0
  131. package/dist/useUiLibraries-psyWFbNc.js +12 -0
  132. package/dist/useUpdateBlocksProps-Unn8lUyj.cjs +1 -0
  133. package/dist/useUpdateBlocksProps-vWcDp-P9.js +23 -0
  134. package/dist/utils-dze1SGvB.js +6 -0
  135. package/dist/utils-qK_SjzzV.cjs +1 -0
  136. package/dist/web-blocks.cjs +1 -6
  137. package/dist/web-blocks.js +3 -1153
  138. package/package.json +1 -1
  139. package/dist/AddBlocks-b0Vk6eqO.js +0 -206
  140. package/dist/AddBlocks-bgu08YJC.cjs +0 -1
  141. package/dist/BrandingOptions-AljW1cXz.cjs +0 -1
  142. package/dist/CanvasArea-dp1tzDkK.cjs +0 -55
  143. package/dist/Class-PoYusiA5.cjs +0 -1
  144. package/dist/CurrentPage-rWHgPomd.cjs +0 -1
  145. package/dist/Functions-7jnEwJyw.js +0 -15
  146. package/dist/Functions-N3yhPYKY.cjs +0 -1
  147. package/dist/ListTree-5n8U4-IF.cjs +0 -1
  148. package/dist/MODIFIERS-0g14w5RS.cjs +0 -1
  149. package/dist/PagesPanel-IkZjy0Gn.js +0 -64
  150. package/dist/PagesPanel-sBN51kKZ.cjs +0 -1
  151. package/dist/ProjectPanel-e98TJLfI.js +0 -85
  152. package/dist/ProjectPanel-lbQH31jc.cjs +0 -1
  153. package/dist/Settings-qytQoyTv.cjs +0 -1
  154. package/dist/SidePanels-YRIM1IPq.cjs +0 -1
  155. package/dist/Topbar-LUyDFBkK.js +0 -129
  156. package/dist/Topbar-NOSnWo7V.cjs +0 -1
  157. package/dist/UnsplashImages-f-ObKOC-.cjs +0 -1
  158. package/dist/UploadImages-oOnccvT9.cjs +0 -1
  159. package/dist/_commonjsHelpers-UyOWmZb0.js +0 -8
  160. package/dist/_commonjsHelpers-wDK0ZLPo.cjs +0 -1
  161. package/dist/add-page-modal-g3fd00P5.cjs +0 -1
  162. package/dist/add-page-modal-yQ6qL6Ui.js +0 -104
  163. package/dist/confirm-alert-3flAvzWH.js +0 -60
  164. package/dist/confirm-alert-LQsGNYz8.cjs +0 -1
  165. package/dist/controls-KK2oLIa8.cjs +0 -1
  166. package/dist/defaultTheme-7VqqhOcp.cjs +0 -1
  167. package/dist/delete-page-modal-iMmkPec0.js +0 -83
  168. package/dist/delete-page-modal-tzZmqGzE.cjs +0 -1
  169. package/dist/empty-slot-ZBlsQi6m.js +0 -15
  170. package/dist/empty-slot-nzYOgZuS.cjs +0 -1
  171. package/dist/form-LBHtTduy.cjs +0 -1
  172. package/dist/index--dUsFH1I.cjs +0 -1
  173. package/dist/index-HD1UKc4P.js +0 -3079
  174. package/dist/index-YpnaudSM.js +0 -63
  175. package/dist/index-bOWwCMRF.cjs +0 -206
  176. package/dist/index-e0c8PmRQ.js +0 -205
  177. package/dist/index-ecnGWzh9.cjs +0 -1
  178. package/dist/index-fvMaxES9.cjs +0 -1
  179. package/dist/index-gi1LIOCw.cjs +0 -1
  180. package/dist/index-m4WGov7e.js +0 -2202
  181. package/dist/index-uLtBNl55.js +0 -39503
  182. package/dist/jsx-runtime-Z_BpKhVy.cjs +0 -27
  183. package/dist/page-viewer-5gTszT-n.cjs +0 -1
  184. package/dist/project-general-setting-52CTYL_w.cjs +0 -1
  185. package/dist/project-seo-setting-jTweI1DX.cjs +0 -1
  186. package/dist/single-page-detail-jy2SPcp1.cjs +0 -1
@@ -1,56 +1,43 @@
1
- import { j as e } from "./jsx-runtime-WbnYoNE9.js";
2
- import { useState as p, useEffect as D } from "react";
3
- import { isEmpty as d, startCase as E } from "lodash-es";
1
+ import { j as e } from "./jsx-runtime-Sp0orL4X.js";
2
+ import { useState as d, useEffect as D } from "react";
3
+ import { isEmpty as p, startCase as E } from "lodash-es";
4
4
  import { MixerHorizontalIcon as L } from "@radix-ui/react-icons";
5
- import { createApi as V } from "unsplash-js";
6
- import { h as B, bd as F, aV as K, aW as U, aX as O, aj as P, ak as C, al as S, am as k, an as h, bf as Q, B as H } from "./index-HD1UKc4P.js";
5
+ import { createApi as B } from "unsplash-js";
6
+ import { u as F, B as K } from "./skeleton-lu8e7q2y.js";
7
+ import { I as U } from "./command-Pn3HKDuV.js";
8
+ import { S as V } from "./scroll-area-ewXbxc3n.js";
9
+ import { P as O, a as Q, b as H } from "./popover-a84pbVhQ.js";
10
+ import { S as P, c as S, b as C, d as I, f as h } from "./select-POGdEDHT.js";
11
+ import "react-i18next";
7
12
  import { useDebouncedState as R } from "@react-hookz/web";
8
- import { Loader as W } from "lucide-react";
9
- import "./_commonjsHelpers-UyOWmZb0.js";
10
- import "./Functions-7jnEwJyw.js";
11
- import "clsx";
12
- import "tailwind-merge";
13
- import "@chaibuilder/runtime";
13
+ import { Loader as $ } from "lucide-react";
14
14
  import "jotai";
15
- import "./STRINGS--j49GZJP.js";
16
- import "./MODIFIERS-dytZ-osO.js";
17
- import "@radix-ui/react-toggle";
18
- import "class-variance-authority";
19
- import "./Class-lGzsNBOK.js";
20
- import "@radix-ui/react-switch";
21
15
  import "@radix-ui/react-slot";
22
- import "@radix-ui/react-accordion";
23
- import "@radix-ui/react-alert-dialog";
16
+ import "class-variance-authority";
17
+ import "./utils-dze1SGvB.js";
18
+ import "clsx";
19
+ import "tailwind-merge";
20
+ import "@radix-ui/react-tooltip";
21
+ import "@radix-ui/react-toast";
22
+ import "cmdk";
23
+ import "./tabs-yQ3oGziM.js";
24
24
  import "@radix-ui/react-dialog";
25
- import "@radix-ui/react-label";
26
- import "@radix-ui/react-scroll-area";
27
25
  import "@radix-ui/react-tabs";
28
- import "@radix-ui/react-tooltip";
26
+ import "@radix-ui/react-scroll-area";
29
27
  import "@radix-ui/react-popover";
30
- import "@radix-ui/react-menubar";
31
- import "@radix-ui/react-hover-card";
32
28
  import "@radix-ui/react-select";
33
- import "@radix-ui/react-dropdown-menu";
34
- import "@radix-ui/react-separator";
35
- import "@radix-ui/react-toast";
36
- import "cmdk";
37
- import "@radix-ui/react-context-menu";
38
- import "react-icons-picker";
39
- import "react-dom";
40
- import "react-quill";
41
- import "react-i18next";
42
- const I = async (x, g) => new Promise((o, r) => {
43
- V({ accessKey: g }).search.getPhotos(x).then((i) => {
44
- o(i);
45
- }).catch((i) => r(i));
46
- }), De = ({ isModalView: x, onSelect: g }) => {
47
- const o = B("unsplashAccessKey", ""), [r, j] = p([]), [i, v] = p(0), [l, A] = p(), [n, q] = p(), [z, y] = p(0), [u, T] = R("", 1e3), [f, c] = p(!1), _ = async (s) => {
48
- if (d(u))
29
+ const k = async (x, g) => new Promise((o, r) => {
30
+ B({ accessKey: g }).search.getPhotos(x).then((l) => {
31
+ o(l);
32
+ }).catch((l) => r(l));
33
+ }), Ne = ({ isModalView: x, onSelect: g }) => {
34
+ const o = F("unsplashAccessKey", ""), [r, j] = d([]), [l, v] = d(0), [n, A] = d(), [i, q] = d(), [z, y] = d(0), [u, T] = R("", 1e3), [f, c] = d(!1), _ = async (s) => {
35
+ if (p(u))
49
36
  return;
50
- let t = i + 1;
37
+ let t = l + 1;
51
38
  s && (s.preventDefault(), t = 1), c(!0), v(t);
52
39
  const m = { query: u, page: t };
53
- l && (m.orientation = l), n && (m.color = n), I(m, o).then((a) => {
40
+ n && (m.orientation = n), i && (m.color = i), k(m, o).then((a) => {
54
41
  var N, b, w;
55
42
  j(t === 1 ? ((N = a == null ? void 0 : a.response) == null ? void 0 : N.results) || [] : [...r, ...((b = a == null ? void 0 : a.response) == null ? void 0 : b.results) || []]), y((w = a == null ? void 0 : a.response) == null ? void 0 : w.total_pages), c(!1);
56
43
  }).catch(() => {
@@ -58,17 +45,17 @@ const I = async (x, g) => new Promise((o, r) => {
58
45
  });
59
46
  };
60
47
  return D(() => {
61
- if (!d(u) && o) {
48
+ if (!p(u) && o) {
62
49
  c(!0);
63
50
  const s = { query: u, page: 1 };
64
- l && (s.orientation = l), n && (s.color = n), v(1), I(s, o).then((t) => {
51
+ n && (s.orientation = n), i && (s.color = i), v(1), k(s, o).then((t) => {
65
52
  var m, a;
66
53
  j(((m = t == null ? void 0 : t.response) == null ? void 0 : m.results) || []), y((a = t == null ? void 0 : t.response) == null ? void 0 : a.total_pages), c(!1);
67
54
  }).catch(() => {
68
55
  c(!1);
69
56
  });
70
57
  }
71
- }, [l, n, u, o]), d(o) ? /* @__PURE__ */ e.jsx("div", { className: "h-full flex flex-col items-center justify-center", children: /* @__PURE__ */ e.jsxs("p", { className: "max-w-3xl text-center text-gray-500", children: [
58
+ }, [n, i, u, o]), p(o) ? /* @__PURE__ */ e.jsx("div", { className: "h-full flex flex-col items-center justify-center", children: /* @__PURE__ */ e.jsxs("p", { className: "max-w-3xl text-center text-gray-500", children: [
72
59
  "To enable Unsplash, kindly provide your",
73
60
  /* @__PURE__ */ e.jsx(
74
61
  "a",
@@ -83,7 +70,7 @@ const I = async (x, g) => new Promise((o, r) => {
83
70
  ] }) }) : /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
84
71
  /* @__PURE__ */ e.jsxs("form", { className: "flex items-center rounded-md border bg-gray-100 p-px", children: [
85
72
  /* @__PURE__ */ e.jsx(
86
- F,
73
+ U,
87
74
  {
88
75
  type: "text",
89
76
  name: "query",
@@ -92,18 +79,18 @@ const I = async (x, g) => new Promise((o, r) => {
92
79
  onChange: (s) => T(s.target.value)
93
80
  }
94
81
  ),
95
- /* @__PURE__ */ e.jsxs(K, { children: [
96
- /* @__PURE__ */ e.jsx(U, { asChild: !0, className: "h-full w-10 cursor-pointer p-2.5 hover:bg-slate-200", children: /* @__PURE__ */ e.jsx(L, {}) }),
82
+ /* @__PURE__ */ e.jsxs(O, { children: [
83
+ /* @__PURE__ */ e.jsx(Q, { asChild: !0, className: "h-full w-10 cursor-pointer p-2.5 hover:bg-slate-200", children: /* @__PURE__ */ e.jsx(L, {}) }),
97
84
  /* @__PURE__ */ e.jsx(
98
- O,
85
+ H,
99
86
  {
100
87
  side: x ? "bottom" : "right",
101
88
  className: "z-[9999] flex w-max items-center justify-center",
102
89
  children: /* @__PURE__ */ e.jsxs("div", { children: [
103
90
  /* @__PURE__ */ e.jsx("div", { className: "py-1 text-sm font-medium", children: "Orientation" }),
104
- /* @__PURE__ */ e.jsxs(P, { defaultValue: l, onValueChange: (s) => A(s), children: [
105
- /* @__PURE__ */ e.jsx(C, { className: "h-auto w-40 p-1 px-3", children: /* @__PURE__ */ e.jsx(S, { placeholder: "Select" }) }),
106
- /* @__PURE__ */ e.jsxs(k, { className: "z-[9999]", children: [
91
+ /* @__PURE__ */ e.jsxs(P, { defaultValue: n, onValueChange: (s) => A(s), children: [
92
+ /* @__PURE__ */ e.jsx(S, { className: "h-auto w-40 p-1 px-3", children: /* @__PURE__ */ e.jsx(C, { placeholder: "Select" }) }),
93
+ /* @__PURE__ */ e.jsxs(I, { className: "z-[9999]", children: [
107
94
  /* @__PURE__ */ e.jsx(h, { value: "", children: "All" }),
108
95
  /* @__PURE__ */ e.jsx(h, { value: "landscape", children: "Landscape" }),
109
96
  /* @__PURE__ */ e.jsx(h, { value: "portrait", children: "Portrait" }),
@@ -111,9 +98,9 @@ const I = async (x, g) => new Promise((o, r) => {
111
98
  ] })
112
99
  ] }),
113
100
  /* @__PURE__ */ e.jsx("div", { className: "pb-1 pt-2 text-sm font-medium", children: "Color" }),
114
- /* @__PURE__ */ e.jsxs(P, { defaultValue: n, onValueChange: (s) => q(s), children: [
115
- /* @__PURE__ */ e.jsx(C, { className: "h-auto w-40 p-1 px-3", children: /* @__PURE__ */ e.jsx(S, { placeholder: "Select" }) }),
116
- /* @__PURE__ */ e.jsxs(k, { className: "z-[9999]", children: [
101
+ /* @__PURE__ */ e.jsxs(P, { defaultValue: i, onValueChange: (s) => q(s), children: [
102
+ /* @__PURE__ */ e.jsx(S, { className: "h-auto w-40 p-1 px-3", children: /* @__PURE__ */ e.jsx(C, { placeholder: "Select" }) }),
103
+ /* @__PURE__ */ e.jsxs(I, { className: "z-[9999]", children: [
117
104
  /* @__PURE__ */ e.jsx(h, { value: "", children: "All" }),
118
105
  [
119
106
  "black_and_white",
@@ -136,11 +123,11 @@ const I = async (x, g) => new Promise((o, r) => {
136
123
  ] })
137
124
  ] }),
138
125
  /* @__PURE__ */ e.jsxs(
139
- Q,
126
+ V,
140
127
  {
141
- className: `h-full ${x && !d(r) ? "-mx-2 flex flex-wrap px-2" : "-mx-2 flex flex-col pb-8 pt-2"}`,
128
+ className: `h-full ${x && !p(r) ? "-mx-2 flex flex-wrap px-2" : "-mx-2 flex flex-col pb-8 pt-2"}`,
142
129
  children: [
143
- d(r) && !f && /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col items-center justify-center py-6", children: [
130
+ p(r) && !f && /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col items-center justify-center py-6", children: [
144
131
  /* @__PURE__ */ e.jsx("div", { className: "font-medium", children: "No Data" }),
145
132
  /* @__PURE__ */ e.jsx("div", { className: "text-sm text-gray-500", children: "Enter query and press enter" })
146
133
  ] }),
@@ -173,11 +160,11 @@ const I = async (x, g) => new Promise((o, r) => {
173
160
  ) }) }, s.id)
174
161
  )),
175
162
  f && /* @__PURE__ */ e.jsxs("div", { className: "flex items-center justify-center py-8", children: [
176
- /* @__PURE__ */ e.jsx(W, { className: "animate-spin w-6 h-6" }),
163
+ /* @__PURE__ */ e.jsx($, { className: "animate-spin w-6 h-6" }),
177
164
  "  Loading..."
178
165
  ] }),
179
- !d(r) && i < z && !f && /* @__PURE__ */ e.jsx(
180
- H,
166
+ !p(r) && l < z && !f && /* @__PURE__ */ e.jsx(
167
+ K,
181
168
  {
182
169
  size: "sm",
183
170
  variant: "link",
@@ -193,6 +180,6 @@ const I = async (x, g) => new Promise((o, r) => {
193
180
  ] });
194
181
  };
195
182
  export {
196
- De as default,
197
- I as fetchImage
183
+ Ne as default,
184
+ k as fetchImage
198
185
  };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-JYMCiFoE.cjs"),t=require("react"),i=require("lodash-es"),m=require("@radix-ui/react-icons"),R=require("jotai"),q=require("./scroll-area-FiHvy-TZ.cjs");require("react-i18next");const E=require("./skeleton-STeL9VrJ.cjs");require("@radix-ui/react-scroll-area");require("./utils-qK_SjzzV.cjs");require("clsx");require("tailwind-merge");require("@radix-ui/react-slot");require("class-variance-authority");require("@radix-ui/react-tooltip");require("@radix-ui/react-toast");const I=R.atom([]),w=({isModalView:r,onSelect:a})=>{const p=E.useBuilderProp("uploadMediaCallback"),u=E.useBuilderProp("fetchMediaCallback"),[n,c]=R.useAtom(I),[o,j]=t.useState(!1),[f,h]=t.useState(!1),[x,d]=t.useState(),[g,v]=t.useState("");t.useEffect(()=>{(async()=>{if(!u)return;h(!0);const s=await u();c(s||[]),h(!1)})()},[]);const y=s=>{var l,b;s&&((b=(l=s==null?void 0:s.target)==null?void 0:l.files)==null?void 0:b.length)>0&&d(s.target.files[0])},N=async()=>{if(p){j(!0);try{const{url:s}=await p(x);a(s),d(void 0);const l=await u();c(l)}catch(s){c([]),v((s==null?void 0:s.message)||"Something went wrong.")}j(!1)}};return e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[x?e.jsxRuntimeExports.jsxs("div",{className:"relative flex w-full flex-col items-center justify-center rounded-md border bg-slate-50 p-2 px-1",children:[e.jsxRuntimeExports.jsx("img",{src:URL.createObjectURL(x),alt:"",className:"h-auto max-h-96 w-full max-w-sm rounded-md object-contain"}),g&&e.jsxRuntimeExports.jsx("div",{className:"w-full pt-2 text-center text-sm text-red-500",children:g}),e.jsxRuntimeExports.jsxs("div",{className:"flex w-full items-center justify-center gap-2 pt-2",children:[e.jsxRuntimeExports.jsxs("button",{type:"button",onClick:N,disabled:o,className:"flex items-center rounded-full bg-blue-500 px-3 py-1 text-sm text-white hover:bg-blue-600 hover:text-white",children:[o?e.jsxRuntimeExports.jsx(m.GearIcon,{className:"animate-spin"}):e.jsxRuntimeExports.jsx(m.UploadIcon,{className:"animate-bounce"}),"  ",o?"Uploading...":"Upload"]}),!o&&e.jsxRuntimeExports.jsxs("button",{type:"button",className:"flex items-center rounded-full border border-gray-300 px-3 py-1 text-sm hover:bg-gray-200",onClick:()=>d(void 0),children:[e.jsxRuntimeExports.jsx(m.Cross1Icon,{}),"  Cancel"]})]})]}):e.jsxRuntimeExports.jsxs("label",{htmlFor:r?"upload-in-modal":"upload-in-panel",children:[e.jsxRuntimeExports.jsxs("div",{className:"flex w-full cursor-pointer flex-col items-center justify-center rounded-md border border-dashed border-blue-900 bg-gray-200 py-8 hover:bg-blue-50",children:[e.jsxRuntimeExports.jsx("div",{className:"text-3xl",children:"+"}),e.jsxRuntimeExports.jsx("div",{children:"Click to choose file"})]}),e.jsxRuntimeExports.jsx("input",{type:"file",id:r?"upload-in-modal":"upload-in-panel",hidden:!0,onChange:y})]}),e.jsxRuntimeExports.jsxs(q.ScrollArea,{className:`-mx-2 flex h-full flex-col pb-8 pt-2 ${r?"px-2":""} pt-2`,children:[i.isEmpty(n)&&f&&e.jsxRuntimeExports.jsx("div",{className:"flex flex-col items-center justify-center py-6",children:e.jsxRuntimeExports.jsx("div",{className:"animate-pulse font-medium",children:"Fetching..."})}),i.isEmpty(n)&&!f&&e.jsxRuntimeExports.jsx("div",{className:"flex flex-col items-center justify-center py-6",children:e.jsxRuntimeExports.jsx("div",{className:"font-medium",children:"No Images"})}),r?e.jsxRuntimeExports.jsx("div",{className:"h-full columns-5 py-2",children:i.map(n,s=>e.jsxRuntimeExports.jsx("div",{role:"button",tabIndex:0,className:"my-1 flex",onClick:()=>a(s.url),children:e.jsxRuntimeExports.jsx("div",{className:"relative overflow-hidden rounded-md bg-cover bg-no-repeat",children:e.jsxRuntimeExports.jsx("img",{className:"h-auto flex-1 cursor-pointer rounded-md transition duration-300 ease-in-out hover:scale-105",alt:s.name,src:s.thumbUrl})})},s.id))}):i.map(n,s=>e.jsxRuntimeExports.jsx("div",{role:"button",tabIndex:0,className:"px-2 py-1",onClick:()=>a(s.url),children:e.jsxRuntimeExports.jsx("div",{className:"relative overflow-hidden rounded-md bg-cover bg-no-repeat",children:e.jsxRuntimeExports.jsx("img",{className:"h-auto w-full cursor-pointer transition duration-300 ease-in-out hover:scale-105",alt:s.name,src:s.url})})},s.id))]})]})};exports.default=w;
@@ -1,76 +1,53 @@
1
- import { j as e } from "./jsx-runtime-WbnYoNE9.js";
2
- import { useState as i, useEffect as w } from "react";
1
+ import { j as e } from "./jsx-runtime-Sp0orL4X.js";
2
+ import { useState as o, useEffect as w } from "react";
3
3
  import { isEmpty as b, map as j } from "lodash-es";
4
4
  import { GearIcon as C, UploadIcon as U, Cross1Icon as k } from "@radix-ui/react-icons";
5
5
  import { atom as F, useAtom as E } from "jotai";
6
- import { h as v, bf as A } from "./index-HD1UKc4P.js";
7
- import "./_commonjsHelpers-UyOWmZb0.js";
8
- import "./Functions-7jnEwJyw.js";
6
+ import { S as A } from "./scroll-area-ewXbxc3n.js";
7
+ import "react-i18next";
8
+ import { u as v } from "./skeleton-lu8e7q2y.js";
9
+ import "@radix-ui/react-scroll-area";
10
+ import "./utils-dze1SGvB.js";
9
11
  import "clsx";
10
12
  import "tailwind-merge";
11
- import "@chaibuilder/runtime";
12
- import "./STRINGS--j49GZJP.js";
13
- import "@react-hookz/web";
14
- import "./MODIFIERS-dytZ-osO.js";
15
- import "@radix-ui/react-toggle";
16
- import "class-variance-authority";
17
- import "./Class-lGzsNBOK.js";
18
- import "@radix-ui/react-switch";
19
13
  import "@radix-ui/react-slot";
20
- import "@radix-ui/react-accordion";
21
- import "@radix-ui/react-alert-dialog";
22
- import "@radix-ui/react-dialog";
23
- import "@radix-ui/react-label";
24
- import "@radix-ui/react-scroll-area";
25
- import "@radix-ui/react-tabs";
14
+ import "class-variance-authority";
26
15
  import "@radix-ui/react-tooltip";
27
- import "@radix-ui/react-popover";
28
- import "@radix-ui/react-menubar";
29
- import "@radix-ui/react-hover-card";
30
- import "@radix-ui/react-select";
31
- import "@radix-ui/react-dropdown-menu";
32
- import "@radix-ui/react-separator";
33
16
  import "@radix-ui/react-toast";
34
- import "cmdk";
35
- import "@radix-ui/react-context-menu";
36
- import "react-icons-picker";
37
- import "react-dom";
38
- import "react-quill";
39
- import "react-i18next";
40
- const R = F([]), ge = ({ isModalView: r, onSelect: a }) => {
41
- const p = v("uploadMediaCallback"), n = v("fetchMediaCallback"), [s, m] = E(R), [o, u] = i(!1), [x, f] = i(!1), [d, c] = i(), [h, y] = i("");
17
+ const R = F([]), W = ({ isModalView: s, onSelect: i }) => {
18
+ const u = v("uploadMediaCallback"), n = v("fetchMediaCallback"), [l, d] = E(R), [a, x] = o(!1), [p, f] = o(!1), [c, m] = o(), [h, y] = o("");
42
19
  w(() => {
43
20
  (async () => {
44
21
  if (!n)
45
22
  return;
46
23
  f(!0);
47
24
  const t = await n();
48
- m(t || []), f(!1);
25
+ d(t || []), f(!1);
49
26
  })();
50
27
  }, []);
51
28
  const N = (t) => {
52
- var l, g;
53
- t && ((g = (l = t == null ? void 0 : t.target) == null ? void 0 : l.files) == null ? void 0 : g.length) > 0 && c(t.target.files[0]);
29
+ var r, g;
30
+ t && ((g = (r = t == null ? void 0 : t.target) == null ? void 0 : r.files) == null ? void 0 : g.length) > 0 && m(t.target.files[0]);
54
31
  }, I = async () => {
55
- if (p) {
56
- u(!0);
32
+ if (u) {
33
+ x(!0);
57
34
  try {
58
- const { url: t } = await p(d);
59
- a(t), c(void 0);
60
- const l = await n();
61
- m(l);
35
+ const { url: t } = await u(c);
36
+ i(t), m(void 0);
37
+ const r = await n();
38
+ d(r);
62
39
  } catch (t) {
63
- m([]), y((t == null ? void 0 : t.message) || "Something went wrong.");
40
+ d([]), y((t == null ? void 0 : t.message) || "Something went wrong.");
64
41
  }
65
- u(!1);
42
+ x(!1);
66
43
  }
67
44
  };
68
45
  return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
69
- d ? /* @__PURE__ */ e.jsxs("div", { className: "relative flex w-full flex-col items-center justify-center rounded-md border bg-slate-50 p-2 px-1", children: [
46
+ c ? /* @__PURE__ */ e.jsxs("div", { className: "relative flex w-full flex-col items-center justify-center rounded-md border bg-slate-50 p-2 px-1", children: [
70
47
  /* @__PURE__ */ e.jsx(
71
48
  "img",
72
49
  {
73
- src: URL.createObjectURL(d),
50
+ src: URL.createObjectURL(c),
74
51
  alt: "",
75
52
  className: "h-auto max-h-96 w-full max-w-sm rounded-md object-contain"
76
53
  }
@@ -82,21 +59,21 @@ const R = F([]), ge = ({ isModalView: r, onSelect: a }) => {
82
59
  {
83
60
  type: "button",
84
61
  onClick: I,
85
- disabled: o,
62
+ disabled: a,
86
63
  className: "flex items-center rounded-full bg-blue-500 px-3 py-1 text-sm text-white hover:bg-blue-600 hover:text-white",
87
64
  children: [
88
- o ? /* @__PURE__ */ e.jsx(C, { className: "animate-spin" }) : /* @__PURE__ */ e.jsx(U, { className: "animate-bounce" }),
65
+ a ? /* @__PURE__ */ e.jsx(C, { className: "animate-spin" }) : /* @__PURE__ */ e.jsx(U, { className: "animate-bounce" }),
89
66
  "  ",
90
- o ? "Uploading..." : "Upload"
67
+ a ? "Uploading..." : "Upload"
91
68
  ]
92
69
  }
93
70
  ),
94
- !o && /* @__PURE__ */ e.jsxs(
71
+ !a && /* @__PURE__ */ e.jsxs(
95
72
  "button",
96
73
  {
97
74
  type: "button",
98
75
  className: "flex items-center rounded-full border border-gray-300 px-3 py-1 text-sm hover:bg-gray-200",
99
- onClick: () => c(void 0),
76
+ onClick: () => m(void 0),
100
77
  children: [
101
78
  /* @__PURE__ */ e.jsx(k, {}),
102
79
  "  Cancel"
@@ -104,26 +81,26 @@ const R = F([]), ge = ({ isModalView: r, onSelect: a }) => {
104
81
  }
105
82
  )
106
83
  ] })
107
- ] }) : /* @__PURE__ */ e.jsxs("label", { htmlFor: r ? "upload-in-modal" : "upload-in-panel", children: [
84
+ ] }) : /* @__PURE__ */ e.jsxs("label", { htmlFor: s ? "upload-in-modal" : "upload-in-panel", children: [
108
85
  /* @__PURE__ */ e.jsxs("div", { className: "flex w-full cursor-pointer flex-col items-center justify-center rounded-md border border-dashed border-blue-900 bg-gray-200 py-8 hover:bg-blue-50", children: [
109
86
  /* @__PURE__ */ e.jsx("div", { className: "text-3xl", children: "+" }),
110
87
  /* @__PURE__ */ e.jsx("div", { children: "Click to choose file" })
111
88
  ] }),
112
- /* @__PURE__ */ e.jsx("input", { type: "file", id: r ? "upload-in-modal" : "upload-in-panel", hidden: !0, onChange: N })
89
+ /* @__PURE__ */ e.jsx("input", { type: "file", id: s ? "upload-in-modal" : "upload-in-panel", hidden: !0, onChange: N })
113
90
  ] }),
114
- /* @__PURE__ */ e.jsxs(A, { className: `-mx-2 flex h-full flex-col pb-8 pt-2 ${r ? "px-2" : ""} pt-2`, children: [
115
- b(s) && x && /* @__PURE__ */ e.jsx("div", { className: "flex flex-col items-center justify-center py-6", children: /* @__PURE__ */ e.jsx("div", { className: "animate-pulse font-medium", children: "Fetching..." }) }),
116
- b(s) && !x && /* @__PURE__ */ e.jsx("div", { className: "flex flex-col items-center justify-center py-6", children: /* @__PURE__ */ e.jsx("div", { className: "font-medium", children: "No Images" }) }),
117
- r ? /* @__PURE__ */ e.jsx("div", { className: "h-full columns-5 py-2", children: j(s, (t) => /* @__PURE__ */ e.jsx("div", { role: "button", tabIndex: 0, className: "my-1 flex", onClick: () => a(t.url), children: /* @__PURE__ */ e.jsx("div", { className: "relative overflow-hidden rounded-md bg-cover bg-no-repeat", children: /* @__PURE__ */ e.jsx(
91
+ /* @__PURE__ */ e.jsxs(A, { className: `-mx-2 flex h-full flex-col pb-8 pt-2 ${s ? "px-2" : ""} pt-2`, children: [
92
+ b(l) && p && /* @__PURE__ */ e.jsx("div", { className: "flex flex-col items-center justify-center py-6", children: /* @__PURE__ */ e.jsx("div", { className: "animate-pulse font-medium", children: "Fetching..." }) }),
93
+ b(l) && !p && /* @__PURE__ */ e.jsx("div", { className: "flex flex-col items-center justify-center py-6", children: /* @__PURE__ */ e.jsx("div", { className: "font-medium", children: "No Images" }) }),
94
+ s ? /* @__PURE__ */ e.jsx("div", { className: "h-full columns-5 py-2", children: j(l, (t) => /* @__PURE__ */ e.jsx("div", { role: "button", tabIndex: 0, className: "my-1 flex", onClick: () => i(t.url), children: /* @__PURE__ */ e.jsx("div", { className: "relative overflow-hidden rounded-md bg-cover bg-no-repeat", children: /* @__PURE__ */ e.jsx(
118
95
  "img",
119
96
  {
120
97
  className: "h-auto flex-1 cursor-pointer rounded-md transition duration-300 ease-in-out hover:scale-105",
121
98
  alt: t.name,
122
99
  src: t.thumbUrl
123
100
  }
124
- ) }) }, t.id)) }) : j(s, (t) => (
101
+ ) }) }, t.id)) }) : j(l, (t) => (
125
102
  // TODO: Drag and Drop Image to Canvas from Here use `pic.url` for image quality
126
- /* @__PURE__ */ e.jsx("div", { role: "button", tabIndex: 0, className: "px-2 py-1", onClick: () => a(t.url), children: /* @__PURE__ */ e.jsx("div", { className: "relative overflow-hidden rounded-md bg-cover bg-no-repeat", children: /* @__PURE__ */ e.jsx(
103
+ /* @__PURE__ */ e.jsx("div", { role: "button", tabIndex: 0, className: "px-2 py-1", onClick: () => i(t.url), children: /* @__PURE__ */ e.jsx("div", { className: "relative overflow-hidden rounded-md bg-cover bg-no-repeat", children: /* @__PURE__ */ e.jsx(
127
104
  "img",
128
105
  {
129
106
  className: "h-auto w-full cursor-pointer transition duration-300 ease-in-out hover:scale-105",
@@ -136,5 +113,5 @@ const R = F([]), ge = ({ isModalView: r, onSelect: a }) => {
136
113
  ] });
137
114
  };
138
115
  export {
139
- ge as default
116
+ W as default
140
117
  };
@@ -0,0 +1,42 @@
1
+ import { j as a } from "./jsx-runtime-Sp0orL4X.js";
2
+ import * as n from "react";
3
+ import * as e from "@radix-ui/react-accordion";
4
+ import { ChevronDownIcon as c } from "@radix-ui/react-icons";
5
+ import { c as i } from "./utils-dze1SGvB.js";
6
+ const N = e.Root, m = n.forwardRef(({ className: o, ...t }, r) => /* @__PURE__ */ a.jsx(e.Item, { ref: r, className: i("border-b", o), ...t }));
7
+ m.displayName = "AccordionItem";
8
+ const d = n.forwardRef(({ className: o, children: t, ...r }, s) => /* @__PURE__ */ a.jsx(e.Header, { className: "flex", children: /* @__PURE__ */ a.jsxs(
9
+ e.Trigger,
10
+ {
11
+ ref: s,
12
+ className: i(
13
+ "flex flex-1 items-center justify-between py-4 text-sm font-medium transition-all hover:underline [&[data-state=open]>svg]:rotate-180",
14
+ o
15
+ ),
16
+ ...r,
17
+ children: [
18
+ t,
19
+ /* @__PURE__ */ a.jsx(c, { className: "h-4 w-4 shrink-0 text-muted-foreground transition-transform duration-200" })
20
+ ]
21
+ }
22
+ ) }));
23
+ d.displayName = e.Trigger.displayName;
24
+ const l = n.forwardRef(({ className: o, children: t, ...r }, s) => /* @__PURE__ */ a.jsx(
25
+ e.Content,
26
+ {
27
+ ref: s,
28
+ className: i(
29
+ "text-sm data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down",
30
+ o
31
+ ),
32
+ ...r,
33
+ children: /* @__PURE__ */ a.jsx("div", { className: "pb-4 pt-0", children: t })
34
+ }
35
+ ));
36
+ l.displayName = e.Content.displayName;
37
+ export {
38
+ N as A,
39
+ m as a,
40
+ d as b,
41
+ l as c
42
+ };
@@ -0,0 +1 @@
1
+ "use strict";const s=require("./jsx-runtime-JYMCiFoE.cjs"),u=require("react"),x=require("@radix-ui/react-accordion"),p=require("@radix-ui/react-icons"),c=require("./utils-qK_SjzzV.cjs");function a(e){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const r=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(n,t,r.get?r:{enumerable:!0,get:()=>e[t]})}}return n.default=e,Object.freeze(n)}const i=a(u),o=a(x),f=o.Root,d=i.forwardRef(({className:e,...n},t)=>s.jsxRuntimeExports.jsx(o.Item,{ref:t,className:c.cn("border-b",e),...n}));d.displayName="AccordionItem";const m=i.forwardRef(({className:e,children:n,...t},r)=>s.jsxRuntimeExports.jsx(o.Header,{className:"flex",children:s.jsxRuntimeExports.jsxs(o.Trigger,{ref:r,className:c.cn("flex flex-1 items-center justify-between py-4 text-sm font-medium transition-all hover:underline [&[data-state=open]>svg]:rotate-180",e),...t,children:[n,s.jsxRuntimeExports.jsx(p.ChevronDownIcon,{className:"h-4 w-4 shrink-0 text-muted-foreground transition-transform duration-200"})]})}));m.displayName=o.Trigger.displayName;const l=i.forwardRef(({className:e,children:n,...t},r)=>s.jsxRuntimeExports.jsx(o.Content,{ref:r,className:c.cn("text-sm data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down",e),...t,children:s.jsxRuntimeExports.jsx("div",{className:"pb-4 pt-0",children:n})}));l.displayName=o.Content.displayName;exports.Accordion=f;exports.AccordionContent=l;exports.AccordionItem=d;exports.AccordionTrigger=m;
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-JYMCiFoE.cjs"),g=require("react"),R=require("lodash-es"),x=require("./skeleton-STeL9VrJ.cjs"),a=require("./tabs-_4WbA1cc.cjs"),c=require("./controls-L7DPvB0m.cjs"),b=require("./form-W58AVUdf.cjs"),f=require("./index-9MmykVSc.cjs");require("jotai");require("@radix-ui/react-slot");require("class-variance-authority");require("./utils-qK_SjzzV.cjs");require("clsx");require("tailwind-merge");require("@radix-ui/react-tooltip");require("@radix-ui/react-icons");require("@radix-ui/react-toast");require("@radix-ui/react-dialog");require("@radix-ui/react-tabs");require("@rjsf/core");require("@rjsf/validator-ajv8");require("./link-WbcKdQ9k.cjs");require("react-icons-picker");require("react-dom");require("./ImagesPanel-J1RlG7xG.cjs");require("react-quill");require("react-i18next");require("./ChaiBuilderEditor-m30yoOgJ.cjs");require("./MODIFIERS-o1p3VnpS.cjs");require("@radix-ui/react-scroll-area");require("@floating-ui/react-dom");require("i18next");require("flagged");require("./Functions-Hvon6AMZ.cjs");require("react-hotkeys-hook");require("@react-hookz/web");require("@chaibuilder/runtime");require("sonner");require("./html-to-json-uSnxl72F.cjs");require("himalaya");require("./STRINGS-gPz7CUOk.cjs");require("lucide-react");require("./iconBase-gbUAAO2L.cjs");require("./alert-dialog-P9xMMB6C.cjs");require("@radix-ui/react-alert-dialog");const E=({closeModal:s})=>{var l,o;const t=f.useAddPage(),[r,m]=g.useState({name:"",slug:"",blocks:[],type:"STATIC",seoData:{},template:""}),p=()=>{t.mutate(r,{onSuccess:()=>s()})},j=({formData:u},i)=>{m(P=>{var d,q;const n={[i]:u[i]};return i==="name"?n.slug=R.kebabCase((d=u[i])==null?void 0:d.replace(/\d/g,"")):i==="slug"&&(n.slug=(q=u[i])==null?void 0:q.replace(/\d/g,"").replace(/\s+/g,"").replace("--","-").replace("__","_")),{...P,...n}})},h={name:c.u({title:"Page Name",default:r.name}),slug:c.u({title:"Page Slug",default:r.slug})};return e.jsxRuntimeExports.jsxs(a.DialogContent,{children:[e.jsxRuntimeExports.jsx("div",{className:"px-1 font-bold",children:"Add Page"}),e.jsxRuntimeExports.jsx(b.Form,{formData:r,properties:h,onChange:j,disabled:t.isPending}),e.jsxRuntimeExports.jsx("div",{className:"flex items-center justify-end",children:e.jsxRuntimeExports.jsx(x.Button,{type:"submit",disabled:!r.name||!r.slug||((l=r.name)==null?void 0:l.length)<2||((o=r.slug)==null?void 0:o.length)<2||t.isPending,onClick:p,children:"Add Page"})})]})},C=()=>{const[s,t]=g.useState(!1);return e.jsxRuntimeExports.jsxs(a.Dialog,{open:s,onOpenChange:()=>t(!s),children:[e.jsxRuntimeExports.jsx(a.DialogTrigger,{asChild:!0,children:e.jsxRuntimeExports.jsx(x.Button,{size:"sm",variant:"link",className:"text-blue-500",onClick:()=>t(!s),children:"+ New Page"})}),s&&e.jsxRuntimeExports.jsx(E,{closeModal:()=>t(!s)})]})};exports.default=C;
@@ -0,0 +1,95 @@
1
+ import { j as t } from "./jsx-runtime-Sp0orL4X.js";
2
+ import { useState as g } from "react";
3
+ import { kebabCase as j } from "lodash-es";
4
+ import { B as c } from "./skeleton-lu8e7q2y.js";
5
+ import { D as b, a as C, b as A } from "./tabs-yQ3oGziM.js";
6
+ import { u as d } from "./controls-IS5qnRce.js";
7
+ import { F as D } from "./form-0_RLz2TB.js";
8
+ import { e as N } from "./index-hElOGcFr.js";
9
+ import "jotai";
10
+ import "@radix-ui/react-slot";
11
+ import "class-variance-authority";
12
+ import "./utils-dze1SGvB.js";
13
+ import "clsx";
14
+ import "tailwind-merge";
15
+ import "@radix-ui/react-tooltip";
16
+ import "@radix-ui/react-icons";
17
+ import "@radix-ui/react-toast";
18
+ import "@radix-ui/react-dialog";
19
+ import "@radix-ui/react-tabs";
20
+ import "@rjsf/core";
21
+ import "@rjsf/validator-ajv8";
22
+ import "./link-xuhP-4dN.js";
23
+ import "react-icons-picker";
24
+ import "react-dom";
25
+ import "./ImagesPanel-Wb0GF_NA.js";
26
+ import "react-quill";
27
+ import "react-i18next";
28
+ import "./ChaiBuilderEditor-vP4at00I.js";
29
+ import "./MODIFIERS-CNqNUapY.js";
30
+ import "@radix-ui/react-scroll-area";
31
+ import "@floating-ui/react-dom";
32
+ import "i18next";
33
+ import "flagged";
34
+ import "./Functions-NzT2Six_.js";
35
+ import "react-hotkeys-hook";
36
+ import "@react-hookz/web";
37
+ import "@chaibuilder/runtime";
38
+ import "sonner";
39
+ import "./html-to-json-2xtb7520.js";
40
+ import "himalaya";
41
+ import "./STRINGS-b432aBJJ.js";
42
+ import "lucide-react";
43
+ import "./iconBase-h4DuR_XT.js";
44
+ import "./alert-dialog-rypfO5ly.js";
45
+ import "@radix-ui/react-alert-dialog";
46
+ const S = ({ closeModal: o }) => {
47
+ var s, p;
48
+ const i = N(), [e, u] = g({
49
+ name: "",
50
+ slug: "",
51
+ blocks: [],
52
+ type: "STATIC",
53
+ seoData: {},
54
+ template: ""
55
+ }), f = () => {
56
+ i.mutate(e, { onSuccess: () => o() });
57
+ }, x = ({ formData: a }, r) => {
58
+ u((P) => {
59
+ var n, l;
60
+ const m = { [r]: a[r] };
61
+ return r === "name" ? m.slug = j((n = a[r]) == null ? void 0 : n.replace(/\d/g, "")) : r === "slug" && (m.slug = (l = a[r]) == null ? void 0 : l.replace(/\d/g, "").replace(/\s+/g, "").replace("--", "-").replace("__", "_")), {
62
+ ...P,
63
+ ...m
64
+ };
65
+ });
66
+ }, h = {
67
+ name: d({
68
+ title: "Page Name",
69
+ default: e.name
70
+ }),
71
+ slug: d({ title: "Page Slug", default: e.slug })
72
+ };
73
+ return /* @__PURE__ */ t.jsxs(A, { children: [
74
+ /* @__PURE__ */ t.jsx("div", { className: "px-1 font-bold", children: "Add Page" }),
75
+ /* @__PURE__ */ t.jsx(D, { formData: e, properties: h, onChange: x, disabled: i.isPending }),
76
+ /* @__PURE__ */ t.jsx("div", { className: "flex items-center justify-end", children: /* @__PURE__ */ t.jsx(
77
+ c,
78
+ {
79
+ type: "submit",
80
+ disabled: !e.name || !e.slug || ((s = e.name) == null ? void 0 : s.length) < 2 || ((p = e.slug) == null ? void 0 : p.length) < 2 || i.isPending,
81
+ onClick: f,
82
+ children: "Add Page"
83
+ }
84
+ ) })
85
+ ] });
86
+ }, ht = () => {
87
+ const [o, i] = g(!1);
88
+ return /* @__PURE__ */ t.jsxs(b, { open: o, onOpenChange: () => i(!o), children: [
89
+ /* @__PURE__ */ t.jsx(C, { asChild: !0, children: /* @__PURE__ */ t.jsx(c, { size: "sm", variant: "link", className: "text-blue-500", onClick: () => i(!o), children: "+ New Page" }) }),
90
+ o && /* @__PURE__ */ t.jsx(S, { closeModal: () => i(!o) })
91
+ ] });
92
+ };
93
+ export {
94
+ ht as default
95
+ };
@@ -0,0 +1 @@
1
+ "use strict";const o=require("./jsx-runtime-JYMCiFoE.cjs"),A=require("react"),N=require("@radix-ui/react-alert-dialog"),l=require("./utils-qK_SjzzV.cjs"),n=require("./skeleton-STeL9VrJ.cjs");function c(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const a in e)if(a!=="default"){const r=Object.getOwnPropertyDescriptor(e,a);Object.defineProperty(t,a,r.get?r:{enumerable:!0,get:()=>e[a]})}}return t.default=e,Object.freeze(t)}const i=c(A),s=c(N),y=s.Root,R=s.Trigger,d=({className:e,...t})=>o.jsxRuntimeExports.jsx(s.Portal,{className:l.cn(e),...t});d.displayName=s.Portal.displayName;const m=i.forwardRef(({className:e,...t},a)=>o.jsxRuntimeExports.jsx(s.Overlay,{className:l.cn("fixed inset-0 z-50 bg-background/80 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t,ref:a}));m.displayName=s.Overlay.displayName;const p=i.forwardRef(({className:e,...t},a)=>o.jsxRuntimeExports.jsxs(d,{children:[o.jsxRuntimeExports.jsx(m,{}),o.jsxRuntimeExports.jsx(s.Content,{ref:a,className:l.cn("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg md:w-full",e),...t})]}));p.displayName=s.Content.displayName;const u=({className:e,...t})=>o.jsxRuntimeExports.jsx("div",{className:l.cn("flex flex-col space-y-2 text-center sm:text-left",e),...t});u.displayName="AlertDialogHeader";const x=({className:e,...t})=>o.jsxRuntimeExports.jsx("div",{className:l.cn("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});x.displayName="AlertDialogFooter";const g=i.forwardRef(({className:e,...t},a)=>o.jsxRuntimeExports.jsx(s.Title,{ref:a,className:l.cn("text-lg font-semibold",e),...t}));g.displayName=s.Title.displayName;const f=i.forwardRef(({className:e,...t},a)=>o.jsxRuntimeExports.jsx(s.Description,{ref:a,className:l.cn("text-sm text-muted-foreground",e),...t}));f.displayName=s.Description.displayName;const D=i.forwardRef(({className:e,...t},a)=>o.jsxRuntimeExports.jsx(s.Action,{ref:a,className:l.cn(n.buttonVariants(),e),...t}));D.displayName=s.Action.displayName;const j=i.forwardRef(({className:e,...t},a)=>o.jsxRuntimeExports.jsx(s.Cancel,{ref:a,className:l.cn(n.buttonVariants({variant:"outline"}),"mt-2 sm:mt-0",e),...t}));j.displayName=s.Cancel.displayName;exports.AlertDialog=y;exports.AlertDialogAction=D;exports.AlertDialogCancel=j;exports.AlertDialogContent=p;exports.AlertDialogDescription=f;exports.AlertDialogFooter=x;exports.AlertDialogHeader=u;exports.AlertDialogTitle=g;exports.AlertDialogTrigger=R;
@@ -0,0 +1,64 @@
1
+ import { j as o } from "./jsx-runtime-Sp0orL4X.js";
2
+ import * as i from "react";
3
+ import * as t from "@radix-ui/react-alert-dialog";
4
+ import { c as l } from "./utils-dze1SGvB.js";
5
+ import { b as r } from "./skeleton-lu8e7q2y.js";
6
+ const D = t.Root, j = t.Trigger, d = ({ className: a, ...e }) => /* @__PURE__ */ o.jsx(t.Portal, { className: l(a), ...e });
7
+ d.displayName = t.Portal.displayName;
8
+ const n = i.forwardRef(({ className: a, ...e }, s) => /* @__PURE__ */ o.jsx(
9
+ t.Overlay,
10
+ {
11
+ className: l(
12
+ "fixed inset-0 z-50 bg-background/80 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
13
+ a
14
+ ),
15
+ ...e,
16
+ ref: s
17
+ }
18
+ ));
19
+ n.displayName = t.Overlay.displayName;
20
+ const m = i.forwardRef(({ className: a, ...e }, s) => /* @__PURE__ */ o.jsxs(d, { children: [
21
+ /* @__PURE__ */ o.jsx(n, {}),
22
+ /* @__PURE__ */ o.jsx(
23
+ t.Content,
24
+ {
25
+ ref: s,
26
+ className: l(
27
+ "fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg md:w-full",
28
+ a
29
+ ),
30
+ ...e
31
+ }
32
+ )
33
+ ] }));
34
+ m.displayName = t.Content.displayName;
35
+ const c = ({ className: a, ...e }) => /* @__PURE__ */ o.jsx("div", { className: l("flex flex-col space-y-2 text-center sm:text-left", a), ...e });
36
+ c.displayName = "AlertDialogHeader";
37
+ const p = ({ className: a, ...e }) => /* @__PURE__ */ o.jsx("div", { className: l("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2", a), ...e });
38
+ p.displayName = "AlertDialogFooter";
39
+ const f = i.forwardRef(({ className: a, ...e }, s) => /* @__PURE__ */ o.jsx(t.Title, { ref: s, className: l("text-lg font-semibold", a), ...e }));
40
+ f.displayName = t.Title.displayName;
41
+ const g = i.forwardRef(({ className: a, ...e }, s) => /* @__PURE__ */ o.jsx(t.Description, { ref: s, className: l("text-sm text-muted-foreground", a), ...e }));
42
+ g.displayName = t.Description.displayName;
43
+ const x = i.forwardRef(({ className: a, ...e }, s) => /* @__PURE__ */ o.jsx(t.Action, { ref: s, className: l(r(), a), ...e }));
44
+ x.displayName = t.Action.displayName;
45
+ const N = i.forwardRef(({ className: a, ...e }, s) => /* @__PURE__ */ o.jsx(
46
+ t.Cancel,
47
+ {
48
+ ref: s,
49
+ className: l(r({ variant: "outline" }), "mt-2 sm:mt-0", a),
50
+ ...e
51
+ }
52
+ ));
53
+ N.displayName = t.Cancel.displayName;
54
+ export {
55
+ D as A,
56
+ j as a,
57
+ m as b,
58
+ c,
59
+ p as d,
60
+ f as e,
61
+ g as f,
62
+ x as g,
63
+ N as h
64
+ };
@@ -0,0 +1 @@
1
+ "use strict";const s=require("./jsx-runtime-JYMCiFoE.cjs"),o=require("class-variance-authority"),a=require("./utils-qK_SjzzV.cjs"),r=o.cva("inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground shadow hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground shadow hover:bg-destructive/80",outline:"text-foreground"}},defaultVariants:{variant:"default"}}),i=({className:e,variant:t,...n})=>s.jsxRuntimeExports.jsx("div",{className:a.cn(r({variant:t}),e),...n});exports.Badge=i;exports.badgeVariants=r;
@@ -0,0 +1,23 @@
1
+ import { j as o } from "./jsx-runtime-Sp0orL4X.js";
2
+ import { cva as a } from "class-variance-authority";
3
+ import { c as n } from "./utils-dze1SGvB.js";
4
+ const s = a(
5
+ "inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",
6
+ {
7
+ variants: {
8
+ variant: {
9
+ default: "border-transparent bg-primary text-primary-foreground shadow hover:bg-primary/80",
10
+ secondary: "border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",
11
+ destructive: "border-transparent bg-destructive text-destructive-foreground shadow hover:bg-destructive/80",
12
+ outline: "text-foreground"
13
+ }
14
+ },
15
+ defaultVariants: {
16
+ variant: "default"
17
+ }
18
+ }
19
+ ), u = ({ className: r, variant: e, ...t }) => /* @__PURE__ */ o.jsx("div", { className: n(s({ variant: e }), r), ...t });
20
+ export {
21
+ u as B,
22
+ s as b
23
+ };
@@ -0,0 +1 @@
1
+ "use strict";const c=require("lodash-es"),o=require("@chaibuilder/runtime"),i=c.memoize((t,e)=>{if(!t)return!0;const n=o.getBlockComponent(t);return n&&c.has(n,"canAcceptBlock")?n.canAcceptBlock(e):!1}),r=c.memoize((t,e)=>{const n=o.getBlockComponent(e);return n&&c.has(n,"canBeNested")?n.canBeNested(t):!0}),l=c.memoize(t=>{const e=o.getBlockComponent(t);return e&&c.has(e,"canDuplicate")?e.canDuplicate():!0}),a=c.memoize(t=>{const e=o.getBlockComponent(t);return e&&c.has(e,"canDelete")?e.canDelete():!0});exports.canAcceptChildBlock=i;exports.canBeNestedInside=r;exports.canDeleteBlock=a;exports.canDuplicateBlock=l;