@chaibuilder/sdk 1.2.25 → 1.2.26
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.
- package/dist/AddBlocks-l1JENNvq.js +206 -0
- package/dist/AddBlocks-zPPKkeKs.cjs +1 -0
- package/dist/BrandingOptions-DkpqGARR.cjs +1 -0
- package/dist/{BrandingOptions-iTyWpwTs.js → BrandingOptions-udtH5yJs.js} +54 -40
- package/dist/{CanvasArea-dZjng782.js → CanvasArea-h0W-Tyha.js} +324 -340
- package/dist/CanvasArea-zme1r3Zi.cjs +55 -0
- package/dist/Class-PoYusiA5.cjs +1 -0
- package/dist/{Class-ahc3NIbq.js → Class-lGzsNBOK.js} +29 -26
- package/dist/CurrentPage-Hl52iub_.cjs +1 -0
- package/dist/{CurrentPage-Kmfp-kFk.js → CurrentPage-tJUjXWdb.js} +54 -40
- package/dist/Functions-7jnEwJyw.js +15 -0
- package/dist/Functions-N3yhPYKY.cjs +1 -0
- package/dist/ListTree-WvTjY5rr.cjs +1 -0
- package/dist/{ListTree-N3jeD790.js → ListTree-cZ-Ihlt3.js} +96 -86
- package/dist/MODIFIERS-0g14w5RS.cjs +1 -0
- package/dist/{MODIFIERS-CNqNUapY.js → MODIFIERS-dytZ-osO.js} +4 -10
- package/dist/PagesPanel-6rrLXEO-.js +64 -0
- package/dist/PagesPanel-WzCocl6u.cjs +1 -0
- package/dist/ProjectPanel-o7gdcwPn.cjs +1 -0
- package/dist/ProjectPanel-tz3bjdXy.js +85 -0
- package/dist/{STRINGS-b432aBJJ.js → STRINGS--j49GZJP.js} +2 -2
- package/dist/{Settings-jCcd-VE6.js → Settings-4s2LUVmC.js} +401 -407
- package/dist/Settings-AqoKwR92.cjs +1 -0
- package/dist/SidePanels-3o6Okmvu.cjs +1 -0
- package/dist/{SidePanels-pHMYprpW.js → SidePanels-bugFfInz.js} +118 -108
- package/dist/Topbar-CqW7G360.cjs +1 -0
- package/dist/Topbar-pWzBEOed.js +132 -0
- package/dist/UnsplashImages-NGskB93R.cjs +1 -0
- package/dist/{UnsplashImages-L7x_3RQf.js → UnsplashImages-qvwFbV-E.js} +63 -50
- package/dist/{UploadImages-zdEJRLD8.js → UploadImages-9NapgXBq.js} +60 -37
- package/dist/UploadImages-Oh7Glr9A.cjs +1 -0
- package/dist/_commonjsHelpers-UyOWmZb0.js +8 -0
- package/dist/_commonjsHelpers-wDK0ZLPo.cjs +1 -0
- package/dist/add-page-modal--6TTBRYa.cjs +1 -0
- package/dist/add-page-modal-k2Kb92HS.js +104 -0
- package/dist/confirm-alert-C4M9eF-o.cjs +1 -0
- package/dist/confirm-alert-GUhZ_G8w.js +60 -0
- package/dist/controls-KK2oLIa8.cjs +1 -0
- package/dist/{controls-IS5qnRce.js → controls-OfJWSEqC.js} +85 -20
- package/dist/core.cjs +1 -1
- package/dist/core.js +75 -150
- package/dist/defaultTheme-7VqqhOcp.cjs +1 -0
- package/dist/{defaultTheme-4kA60XdB.js → defaultTheme-D8B4-wHO.js} +8 -6
- package/dist/delete-page-modal-cFoL-wdo.cjs +1 -0
- package/dist/delete-page-modal-zONvdebd.js +83 -0
- package/dist/email-blocks.cjs +1 -1
- package/dist/email-blocks.js +292 -3
- package/dist/email.cjs +1 -1
- package/dist/email.js +37 -18
- package/dist/empty-slot-ZBlsQi6m.js +15 -0
- package/dist/empty-slot-nzYOgZuS.cjs +1 -0
- package/dist/{form-0_RLz2TB.js → form-STUz-6nE.js} +12 -12
- package/dist/form-lBQ_76Uw.cjs +1 -0
- package/dist/{html-to-json-uSnxl72F.cjs → html-to-json-efmv1pCj.cjs} +1 -1
- package/dist/{html-to-json-2xtb7520.js → html-to-json-ngX9ef2u.js} +41 -41
- package/dist/index-Gk6sASBd.js +3080 -0
- package/dist/index-OB199Izc.cjs +206 -0
- package/dist/index-SkyM3d6Q.js +39503 -0
- package/dist/index-YpnaudSM.js +63 -0
- package/dist/index-e0c8PmRQ.js +205 -0
- package/dist/index-ecnGWzh9.cjs +1 -0
- package/dist/index-gi1LIOCw.cjs +1 -0
- package/dist/index-h-hd6EvN.cjs +1 -0
- package/dist/index-llTXLDGE.js +2201 -0
- package/dist/index-mbyqq81O.cjs +1 -0
- package/dist/{jsx-runtime-Sp0orL4X.js → jsx-runtime-WbnYoNE9.js} +109 -106
- package/dist/jsx-runtime-Z_BpKhVy.cjs +27 -0
- package/dist/lib.cjs +2 -2
- package/dist/lib.js +66 -62
- package/dist/page-viewer-2kwnKM6v.cjs +1 -0
- package/dist/{page-viewer-NnOwmAmu.js → page-viewer-Pdg9F5Hv.js} +57 -43
- package/dist/project-general-setting-CnNL98NM.cjs +1 -0
- package/dist/{project-general-setting-9ju3TDju.js → project-general-setting-f8Ebsn6K.js} +43 -35
- package/dist/project-seo-setting-mlxL_e2_.cjs +1 -0
- package/dist/{project-seo-setting-36CdUszM.js → project-seo-setting-pX34Qsym.js} +40 -23
- package/dist/render.cjs +1 -1
- package/dist/render.js +14 -13
- package/dist/single-page-detail-XfzrGlzA.cjs +1 -0
- package/dist/{single-page-detail-hD1jKZ8k.js → single-page-detail-dpe5LT0M.js} +74 -66
- package/dist/studio.cjs +1 -1
- package/dist/studio.js +40 -24
- package/dist/ui.cjs +1 -1
- package/dist/ui.js +160 -365
- package/dist/web-blocks.cjs +6 -1
- package/dist/web-blocks.js +1153 -3
- package/package.json +1 -1
- package/dist/AddBlocks-Ol3iIVKa.js +0 -207
- package/dist/AddBlocks-a1c-7Ewz.cjs +0 -1
- package/dist/BrandingOptions-6rnt0UaA.cjs +0 -1
- package/dist/CanvasArea-R4ogF9AT.cjs +0 -55
- package/dist/ChaiBuilderEditor-m30yoOgJ.cjs +0 -163
- package/dist/ChaiBuilderEditor-vP4at00I.js +0 -27974
- package/dist/Class-eieto7e-.cjs +0 -1
- package/dist/Controls-3Cc1XYXg.js +0 -105
- package/dist/Controls-ky25Ebo3.cjs +0 -1
- package/dist/CurrentPage-3gQTH0Zt.cjs +0 -1
- package/dist/Functions-Hvon6AMZ.cjs +0 -1
- package/dist/Functions-NzT2Six_.js +0 -15
- package/dist/ImagesPanel-J1RlG7xG.cjs +0 -1
- package/dist/ImagesPanel-Wb0GF_NA.js +0 -29
- package/dist/ListTree-CZ-mtjZ9.cjs +0 -1
- package/dist/MODIFIERS-o1p3VnpS.cjs +0 -1
- package/dist/PagesPanel-Gi0z6gaf.cjs +0 -1
- package/dist/PagesPanel-u1IB-nRr.js +0 -48
- package/dist/ProjectPanel-EydGZmMW.js +0 -71
- package/dist/ProjectPanel-kiiljG4H.cjs +0 -1
- package/dist/Settings-8ilCSH8b.cjs +0 -1
- package/dist/SidePanels-T36C6Lhc.cjs +0 -1
- package/dist/Topbar-CvWQuspR.cjs +0 -1
- package/dist/Topbar-pbIDUE_B.js +0 -122
- package/dist/UnsplashImages-KBZPd9dv.cjs +0 -1
- package/dist/UploadImages-GkkJVAgG.cjs +0 -1
- package/dist/accordion-oPUeqPCZ.js +0 -42
- package/dist/accordion-ynvFtV_p.cjs +0 -1
- package/dist/add-page-modal-9SGv2hgc.cjs +0 -1
- package/dist/add-page-modal-JCDXZIPW.js +0 -95
- package/dist/alert-dialog-P9xMMB6C.cjs +0 -1
- package/dist/alert-dialog-rypfO5ly.js +0 -64
- package/dist/badge-E-S7CqUt.cjs +0 -1
- package/dist/badge-tEwO7C51.js +0 -23
- package/dist/block-helpers-OKHmRRol.cjs +0 -1
- package/dist/block-helpers-oSFpSsGz.js +0 -23
- package/dist/command-BxR6jaCI.cjs +0 -1
- package/dist/command-Pn3HKDuV.js +0 -97
- package/dist/confirm-alert-uNm0lZ0y.cjs +0 -1
- package/dist/confirm-alert-wR5_VJ1l.js +0 -36
- package/dist/context-menu-8dC9uGXj.js +0 -122
- package/dist/context-menu-IgLbIuth.cjs +0 -1
- package/dist/controls-L7DPvB0m.cjs +0 -1
- package/dist/defaultTheme-mrkeGFGI.cjs +0 -1
- package/dist/delete-page-modal-7KmP1elv.js +0 -67
- package/dist/delete-page-modal-SgfwvfNu.cjs +0 -1
- package/dist/dropdown-menu-El86_9Uo.js +0 -124
- package/dist/dropdown-menu-SiHzqWwZ.cjs +0 -1
- package/dist/form-W58AVUdf.cjs +0 -1
- package/dist/hover-card-KUwpDkW8.cjs +0 -1
- package/dist/hover-card-q138xxXR.js +0 -45
- package/dist/iconBase-gbUAAO2L.cjs +0 -1
- package/dist/iconBase-h4DuR_XT.js +0 -63
- package/dist/index-9MmykVSc.cjs +0 -1
- package/dist/index-hElOGcFr.js +0 -2200
- package/dist/index-lDTsQp7h.js +0 -188
- package/dist/index-rq5Y9ZDy.cjs +0 -1
- package/dist/jsx-runtime-JYMCiFoE.cjs +0 -27
- package/dist/label-KaP7MRrs.js +0 -10
- package/dist/label-tFm8HZdb.cjs +0 -1
- package/dist/link-WbcKdQ9k.cjs +0 -1
- package/dist/link-xuhP-4dN.js +0 -196
- package/dist/page-viewer-Hx5hxHKm.cjs +0 -1
- package/dist/popover-a84pbVhQ.js +0 -23
- package/dist/popover-fKjgcRUx.cjs +0 -1
- package/dist/project-general-setting-FxkwjvJz.cjs +0 -1
- package/dist/project-seo-setting-RU7qiXxb.cjs +0 -1
- package/dist/scroll-area-FiHvy-TZ.cjs +0 -1
- package/dist/scroll-area-ewXbxc3n.js +0 -30
- package/dist/select-7bjg-rr9.cjs +0 -1
- package/dist/select-POGdEDHT.js +0 -75
- package/dist/separator-3Civ-6hb.cjs +0 -1
- package/dist/separator-SctTn0Qi.js +0 -18
- package/dist/single-page-detail-beY0MT1b.cjs +0 -1
- package/dist/skeleton-STeL9VrJ.cjs +0 -1
- package/dist/skeleton-lu8e7q2y.js +0 -239
- package/dist/tabs-_4WbA1cc.cjs +0 -1
- package/dist/tabs-yQ3oGziM.js +0 -106
- package/dist/textarea-1kZEh7ki.cjs +0 -1
- package/dist/textarea-b2QvVhrK.js +0 -73
- package/dist/useAddBlock-8pxOEYIl.cjs +0 -1
- package/dist/useAddBlock-FEKFJNwQ.js +0 -69
- package/dist/useChaiExternalData-fkFgoS80.js +0 -6
- package/dist/useChaiExternalData-rwoAZ6uU.cjs +0 -1
- package/dist/useDarkMode-7i57segK.cjs +0 -1
- package/dist/useDarkMode-8VHJlYyE.js +0 -23
- package/dist/useSelectedBreakpoints-6NK5qd7T.js +0 -10
- package/dist/useSelectedBreakpoints-7ONXb-vN.cjs +0 -1
- package/dist/useStylingState-Iuj84yvc.js +0 -186
- package/dist/useStylingState-OIvJMV6p.cjs +0 -1
- package/dist/useUiLibraries-nCdauJ4N.cjs +0 -1
- package/dist/useUiLibraries-psyWFbNc.js +0 -12
- package/dist/useUpdateBlocksProps-Unn8lUyj.cjs +0 -1
- package/dist/useUpdateBlocksProps-vWcDp-P9.js +0 -23
- package/dist/utils-dze1SGvB.js +0 -6
- package/dist/utils-qK_SjzzV.cjs +0 -1
|
@@ -1,43 +1,56 @@
|
|
|
1
|
-
import { j as e } from "./jsx-runtime-
|
|
2
|
-
import { useState as
|
|
3
|
-
import { isEmpty as
|
|
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";
|
|
4
4
|
import { MixerHorizontalIcon as L } from "@radix-ui/react-icons";
|
|
5
|
-
import { createApi as
|
|
6
|
-
import {
|
|
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";
|
|
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-Gk6sASBd.js";
|
|
12
7
|
import { useDebouncedState as R } from "@react-hookz/web";
|
|
13
|
-
import { Loader as
|
|
14
|
-
import "
|
|
15
|
-
import "
|
|
16
|
-
import "class-variance-authority";
|
|
17
|
-
import "./utils-dze1SGvB.js";
|
|
8
|
+
import { Loader as W } from "lucide-react";
|
|
9
|
+
import "./_commonjsHelpers-UyOWmZb0.js";
|
|
10
|
+
import "./Functions-7jnEwJyw.js";
|
|
18
11
|
import "clsx";
|
|
19
12
|
import "tailwind-merge";
|
|
20
|
-
import "@
|
|
21
|
-
import "
|
|
22
|
-
import "
|
|
23
|
-
import "./
|
|
13
|
+
import "@chaibuilder/runtime";
|
|
14
|
+
import "jotai";
|
|
15
|
+
import "./STRINGS--j49GZJP.js";
|
|
16
|
+
import "./MODIFIERS-dytZ-osO.js";
|
|
17
|
+
import "./Class-lGzsNBOK.js";
|
|
18
|
+
import "react-i18next";
|
|
19
|
+
import "@radix-ui/react-toggle";
|
|
20
|
+
import "class-variance-authority";
|
|
21
|
+
import "@radix-ui/react-switch";
|
|
22
|
+
import "@radix-ui/react-slot";
|
|
23
|
+
import "@radix-ui/react-accordion";
|
|
24
|
+
import "@radix-ui/react-alert-dialog";
|
|
24
25
|
import "@radix-ui/react-dialog";
|
|
25
|
-
import "@radix-ui/react-
|
|
26
|
+
import "@radix-ui/react-label";
|
|
26
27
|
import "@radix-ui/react-scroll-area";
|
|
28
|
+
import "@radix-ui/react-tabs";
|
|
29
|
+
import "@radix-ui/react-tooltip";
|
|
27
30
|
import "@radix-ui/react-popover";
|
|
31
|
+
import "@radix-ui/react-menubar";
|
|
32
|
+
import "@radix-ui/react-hover-card";
|
|
28
33
|
import "@radix-ui/react-select";
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
34
|
+
import "@radix-ui/react-dropdown-menu";
|
|
35
|
+
import "@radix-ui/react-separator";
|
|
36
|
+
import "@radix-ui/react-toast";
|
|
37
|
+
import "cmdk";
|
|
38
|
+
import "@radix-ui/react-context-menu";
|
|
39
|
+
import "react-icons-picker";
|
|
40
|
+
import "react-dom";
|
|
41
|
+
import "react-quill";
|
|
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))
|
|
36
49
|
return;
|
|
37
|
-
let t =
|
|
50
|
+
let t = i + 1;
|
|
38
51
|
s && (s.preventDefault(), t = 1), c(!0), v(t);
|
|
39
52
|
const m = { query: u, page: t };
|
|
40
|
-
|
|
53
|
+
l && (m.orientation = l), n && (m.color = n), I(m, o).then((a) => {
|
|
41
54
|
var N, b, w;
|
|
42
55
|
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);
|
|
43
56
|
}).catch(() => {
|
|
@@ -45,17 +58,17 @@ const k = async (x, g) => new Promise((o, r) => {
|
|
|
45
58
|
});
|
|
46
59
|
};
|
|
47
60
|
return D(() => {
|
|
48
|
-
if (!
|
|
61
|
+
if (!d(u) && o) {
|
|
49
62
|
c(!0);
|
|
50
63
|
const s = { query: u, page: 1 };
|
|
51
|
-
|
|
64
|
+
l && (s.orientation = l), n && (s.color = n), v(1), I(s, o).then((t) => {
|
|
52
65
|
var m, a;
|
|
53
66
|
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);
|
|
54
67
|
}).catch(() => {
|
|
55
68
|
c(!1);
|
|
56
69
|
});
|
|
57
70
|
}
|
|
58
|
-
}, [
|
|
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: [
|
|
59
72
|
"To enable Unsplash, kindly provide your",
|
|
60
73
|
/* @__PURE__ */ e.jsx(
|
|
61
74
|
"a",
|
|
@@ -70,7 +83,7 @@ const k = async (x, g) => new Promise((o, r) => {
|
|
|
70
83
|
] }) }) : /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
71
84
|
/* @__PURE__ */ e.jsxs("form", { className: "flex items-center rounded-md border bg-gray-100 p-px", children: [
|
|
72
85
|
/* @__PURE__ */ e.jsx(
|
|
73
|
-
|
|
86
|
+
F,
|
|
74
87
|
{
|
|
75
88
|
type: "text",
|
|
76
89
|
name: "query",
|
|
@@ -79,18 +92,18 @@ const k = async (x, g) => new Promise((o, r) => {
|
|
|
79
92
|
onChange: (s) => T(s.target.value)
|
|
80
93
|
}
|
|
81
94
|
),
|
|
82
|
-
/* @__PURE__ */ e.jsxs(
|
|
83
|
-
/* @__PURE__ */ e.jsx(
|
|
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, {}) }),
|
|
84
97
|
/* @__PURE__ */ e.jsx(
|
|
85
|
-
|
|
98
|
+
O,
|
|
86
99
|
{
|
|
87
100
|
side: x ? "bottom" : "right",
|
|
88
101
|
className: "z-[9999] flex w-max items-center justify-center",
|
|
89
102
|
children: /* @__PURE__ */ e.jsxs("div", { children: [
|
|
90
103
|
/* @__PURE__ */ e.jsx("div", { className: "py-1 text-sm font-medium", children: "Orientation" }),
|
|
91
|
-
/* @__PURE__ */ e.jsxs(P, { defaultValue:
|
|
92
|
-
/* @__PURE__ */ e.jsx(
|
|
93
|
-
/* @__PURE__ */ e.jsxs(
|
|
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: [
|
|
94
107
|
/* @__PURE__ */ e.jsx(h, { value: "", children: "All" }),
|
|
95
108
|
/* @__PURE__ */ e.jsx(h, { value: "landscape", children: "Landscape" }),
|
|
96
109
|
/* @__PURE__ */ e.jsx(h, { value: "portrait", children: "Portrait" }),
|
|
@@ -98,9 +111,9 @@ const k = async (x, g) => new Promise((o, r) => {
|
|
|
98
111
|
] })
|
|
99
112
|
] }),
|
|
100
113
|
/* @__PURE__ */ e.jsx("div", { className: "pb-1 pt-2 text-sm font-medium", children: "Color" }),
|
|
101
|
-
/* @__PURE__ */ e.jsxs(P, { defaultValue:
|
|
102
|
-
/* @__PURE__ */ e.jsx(
|
|
103
|
-
/* @__PURE__ */ e.jsxs(
|
|
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: [
|
|
104
117
|
/* @__PURE__ */ e.jsx(h, { value: "", children: "All" }),
|
|
105
118
|
[
|
|
106
119
|
"black_and_white",
|
|
@@ -123,11 +136,11 @@ const k = async (x, g) => new Promise((o, r) => {
|
|
|
123
136
|
] })
|
|
124
137
|
] }),
|
|
125
138
|
/* @__PURE__ */ e.jsxs(
|
|
126
|
-
|
|
139
|
+
Q,
|
|
127
140
|
{
|
|
128
|
-
className: `h-full ${x && !
|
|
141
|
+
className: `h-full ${x && !d(r) ? "-mx-2 flex flex-wrap px-2" : "-mx-2 flex flex-col pb-8 pt-2"}`,
|
|
129
142
|
children: [
|
|
130
|
-
|
|
143
|
+
d(r) && !f && /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col items-center justify-center py-6", children: [
|
|
131
144
|
/* @__PURE__ */ e.jsx("div", { className: "font-medium", children: "No Data" }),
|
|
132
145
|
/* @__PURE__ */ e.jsx("div", { className: "text-sm text-gray-500", children: "Enter query and press enter" })
|
|
133
146
|
] }),
|
|
@@ -160,11 +173,11 @@ const k = async (x, g) => new Promise((o, r) => {
|
|
|
160
173
|
) }) }, s.id)
|
|
161
174
|
)),
|
|
162
175
|
f && /* @__PURE__ */ e.jsxs("div", { className: "flex items-center justify-center py-8", children: [
|
|
163
|
-
/* @__PURE__ */ e.jsx(
|
|
176
|
+
/* @__PURE__ */ e.jsx(W, { className: "animate-spin w-6 h-6" }),
|
|
164
177
|
" Loading..."
|
|
165
178
|
] }),
|
|
166
|
-
!
|
|
167
|
-
|
|
179
|
+
!d(r) && i < z && !f && /* @__PURE__ */ e.jsx(
|
|
180
|
+
H,
|
|
168
181
|
{
|
|
169
182
|
size: "sm",
|
|
170
183
|
variant: "link",
|
|
@@ -180,6 +193,6 @@ const k = async (x, g) => new Promise((o, r) => {
|
|
|
180
193
|
] });
|
|
181
194
|
};
|
|
182
195
|
export {
|
|
183
|
-
|
|
184
|
-
|
|
196
|
+
De as default,
|
|
197
|
+
I as fetchImage
|
|
185
198
|
};
|
|
@@ -1,53 +1,76 @@
|
|
|
1
|
-
import { j as e } from "./jsx-runtime-
|
|
2
|
-
import { useState as
|
|
1
|
+
import { j as e } from "./jsx-runtime-WbnYoNE9.js";
|
|
2
|
+
import { useState as i, 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 {
|
|
7
|
-
import "
|
|
8
|
-
import
|
|
9
|
-
import "@radix-ui/react-scroll-area";
|
|
10
|
-
import "./utils-dze1SGvB.js";
|
|
6
|
+
import { h as v, bf as A } from "./index-Gk6sASBd.js";
|
|
7
|
+
import "./_commonjsHelpers-UyOWmZb0.js";
|
|
8
|
+
import "./Functions-7jnEwJyw.js";
|
|
11
9
|
import "clsx";
|
|
12
10
|
import "tailwind-merge";
|
|
13
|
-
import "@
|
|
11
|
+
import "@chaibuilder/runtime";
|
|
12
|
+
import "./STRINGS--j49GZJP.js";
|
|
13
|
+
import "@react-hookz/web";
|
|
14
|
+
import "./MODIFIERS-dytZ-osO.js";
|
|
15
|
+
import "./Class-lGzsNBOK.js";
|
|
16
|
+
import "react-i18next";
|
|
17
|
+
import "@radix-ui/react-toggle";
|
|
14
18
|
import "class-variance-authority";
|
|
19
|
+
import "@radix-ui/react-switch";
|
|
20
|
+
import "@radix-ui/react-slot";
|
|
21
|
+
import "@radix-ui/react-accordion";
|
|
22
|
+
import "@radix-ui/react-alert-dialog";
|
|
23
|
+
import "@radix-ui/react-dialog";
|
|
24
|
+
import "@radix-ui/react-label";
|
|
25
|
+
import "@radix-ui/react-scroll-area";
|
|
26
|
+
import "@radix-ui/react-tabs";
|
|
15
27
|
import "@radix-ui/react-tooltip";
|
|
28
|
+
import "@radix-ui/react-popover";
|
|
29
|
+
import "@radix-ui/react-menubar";
|
|
30
|
+
import "@radix-ui/react-hover-card";
|
|
31
|
+
import "@radix-ui/react-select";
|
|
32
|
+
import "@radix-ui/react-dropdown-menu";
|
|
33
|
+
import "@radix-ui/react-separator";
|
|
16
34
|
import "@radix-ui/react-toast";
|
|
17
|
-
|
|
18
|
-
|
|
35
|
+
import "cmdk";
|
|
36
|
+
import "@radix-ui/react-context-menu";
|
|
37
|
+
import "react-icons-picker";
|
|
38
|
+
import "react-dom";
|
|
39
|
+
import "react-quill";
|
|
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("");
|
|
19
42
|
w(() => {
|
|
20
43
|
(async () => {
|
|
21
44
|
if (!n)
|
|
22
45
|
return;
|
|
23
46
|
f(!0);
|
|
24
47
|
const t = await n();
|
|
25
|
-
|
|
48
|
+
m(t || []), f(!1);
|
|
26
49
|
})();
|
|
27
50
|
}, []);
|
|
28
51
|
const N = (t) => {
|
|
29
|
-
var
|
|
30
|
-
t && ((g = (
|
|
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]);
|
|
31
54
|
}, I = async () => {
|
|
32
|
-
if (
|
|
33
|
-
|
|
55
|
+
if (p) {
|
|
56
|
+
u(!0);
|
|
34
57
|
try {
|
|
35
|
-
const { url: t } = await
|
|
36
|
-
|
|
37
|
-
const
|
|
38
|
-
|
|
58
|
+
const { url: t } = await p(d);
|
|
59
|
+
a(t), c(void 0);
|
|
60
|
+
const l = await n();
|
|
61
|
+
m(l);
|
|
39
62
|
} catch (t) {
|
|
40
|
-
|
|
63
|
+
m([]), y((t == null ? void 0 : t.message) || "Something went wrong.");
|
|
41
64
|
}
|
|
42
|
-
|
|
65
|
+
u(!1);
|
|
43
66
|
}
|
|
44
67
|
};
|
|
45
68
|
return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
46
|
-
|
|
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: [
|
|
47
70
|
/* @__PURE__ */ e.jsx(
|
|
48
71
|
"img",
|
|
49
72
|
{
|
|
50
|
-
src: URL.createObjectURL(
|
|
73
|
+
src: URL.createObjectURL(d),
|
|
51
74
|
alt: "",
|
|
52
75
|
className: "h-auto max-h-96 w-full max-w-sm rounded-md object-contain"
|
|
53
76
|
}
|
|
@@ -59,21 +82,21 @@ const R = F([]), W = ({ isModalView: s, onSelect: i }) => {
|
|
|
59
82
|
{
|
|
60
83
|
type: "button",
|
|
61
84
|
onClick: I,
|
|
62
|
-
disabled:
|
|
85
|
+
disabled: o,
|
|
63
86
|
className: "flex items-center rounded-full bg-blue-500 px-3 py-1 text-sm text-white hover:bg-blue-600 hover:text-white",
|
|
64
87
|
children: [
|
|
65
|
-
|
|
88
|
+
o ? /* @__PURE__ */ e.jsx(C, { className: "animate-spin" }) : /* @__PURE__ */ e.jsx(U, { className: "animate-bounce" }),
|
|
66
89
|
" ",
|
|
67
|
-
|
|
90
|
+
o ? "Uploading..." : "Upload"
|
|
68
91
|
]
|
|
69
92
|
}
|
|
70
93
|
),
|
|
71
|
-
!
|
|
94
|
+
!o && /* @__PURE__ */ e.jsxs(
|
|
72
95
|
"button",
|
|
73
96
|
{
|
|
74
97
|
type: "button",
|
|
75
98
|
className: "flex items-center rounded-full border border-gray-300 px-3 py-1 text-sm hover:bg-gray-200",
|
|
76
|
-
onClick: () =>
|
|
99
|
+
onClick: () => c(void 0),
|
|
77
100
|
children: [
|
|
78
101
|
/* @__PURE__ */ e.jsx(k, {}),
|
|
79
102
|
" Cancel"
|
|
@@ -81,26 +104,26 @@ const R = F([]), W = ({ isModalView: s, onSelect: i }) => {
|
|
|
81
104
|
}
|
|
82
105
|
)
|
|
83
106
|
] })
|
|
84
|
-
] }) : /* @__PURE__ */ e.jsxs("label", { htmlFor:
|
|
107
|
+
] }) : /* @__PURE__ */ e.jsxs("label", { htmlFor: r ? "upload-in-modal" : "upload-in-panel", children: [
|
|
85
108
|
/* @__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: [
|
|
86
109
|
/* @__PURE__ */ e.jsx("div", { className: "text-3xl", children: "+" }),
|
|
87
110
|
/* @__PURE__ */ e.jsx("div", { children: "Click to choose file" })
|
|
88
111
|
] }),
|
|
89
|
-
/* @__PURE__ */ e.jsx("input", { type: "file", id:
|
|
112
|
+
/* @__PURE__ */ e.jsx("input", { type: "file", id: r ? "upload-in-modal" : "upload-in-panel", hidden: !0, onChange: N })
|
|
90
113
|
] }),
|
|
91
|
-
/* @__PURE__ */ e.jsxs(A, { className: `-mx-2 flex h-full flex-col pb-8 pt-2 ${
|
|
92
|
-
b(
|
|
93
|
-
b(
|
|
94
|
-
|
|
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(
|
|
95
118
|
"img",
|
|
96
119
|
{
|
|
97
120
|
className: "h-auto flex-1 cursor-pointer rounded-md transition duration-300 ease-in-out hover:scale-105",
|
|
98
121
|
alt: t.name,
|
|
99
122
|
src: t.thumbUrl
|
|
100
123
|
}
|
|
101
|
-
) }) }, t.id)) }) : j(
|
|
124
|
+
) }) }, t.id)) }) : j(s, (t) => (
|
|
102
125
|
// TODO: Drag and Drop Image to Canvas from Here use `pic.url` for image quality
|
|
103
|
-
/* @__PURE__ */ e.jsx("div", { role: "button", tabIndex: 0, className: "px-2 py-1", onClick: () =>
|
|
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(
|
|
104
127
|
"img",
|
|
105
128
|
{
|
|
106
129
|
className: "h-auto w-full cursor-pointer transition duration-300 ease-in-out hover:scale-105",
|
|
@@ -113,5 +136,5 @@ const R = F([]), W = ({ isModalView: s, onSelect: i }) => {
|
|
|
113
136
|
] });
|
|
114
137
|
};
|
|
115
138
|
export {
|
|
116
|
-
|
|
139
|
+
ge as default
|
|
117
140
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-Z_BpKhVy.cjs"),s=require("react"),l=require("lodash-es"),m=require("@radix-ui/react-icons"),E=require("jotai"),p=require("./index-h-hd6EvN.cjs");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("./Functions-N3yhPYKY.cjs");require("clsx");require("tailwind-merge");require("@chaibuilder/runtime");require("./STRINGS-gPz7CUOk.cjs");require("@react-hookz/web");require("./MODIFIERS-0g14w5RS.cjs");require("./Class-PoYusiA5.cjs");require("react-i18next");require("@radix-ui/react-toggle");require("class-variance-authority");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");const N=E.atom([]),I=({isModalView:t,onSelect:a})=>{const j=p.useBuilderProp("uploadMediaCallback"),u=p.useBuilderProp("fetchMediaCallback"),[i,x]=E.useAtom(N),[n,f]=s.useState(!1),[h,g]=s.useState(!1),[c,d]=s.useState(),[b,R]=s.useState("");s.useEffect(()=>{(async()=>{if(!u)return;g(!0);const r=await u();x(r||[]),g(!1)})()},[]);const v=r=>{var o,q;r&&((q=(o=r==null?void 0:r.target)==null?void 0:o.files)==null?void 0:q.length)>0&&d(r.target.files[0])},y=async()=>{if(j){f(!0);try{const{url:r}=await j(c);a(r),d(void 0);const o=await u();x(o)}catch(r){x([]),R((r==null?void 0:r.message)||"Something went wrong.")}f(!1)}};return e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[c?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(c),alt:"",className:"h-auto max-h-96 w-full max-w-sm rounded-md object-contain"}),b&&e.jsxRuntimeExports.jsx("div",{className:"w-full pt-2 text-center text-sm text-red-500",children:b}),e.jsxRuntimeExports.jsxs("div",{className:"flex w-full items-center justify-center gap-2 pt-2",children:[e.jsxRuntimeExports.jsxs("button",{type:"button",onClick:y,disabled:n,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:[n?e.jsxRuntimeExports.jsx(m.GearIcon,{className:"animate-spin"}):e.jsxRuntimeExports.jsx(m.UploadIcon,{className:"animate-bounce"})," ",n?"Uploading...":"Upload"]}),!n&&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:t?"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:t?"upload-in-modal":"upload-in-panel",hidden:!0,onChange:v})]}),e.jsxRuntimeExports.jsxs(p.ScrollArea,{className:`-mx-2 flex h-full flex-col pb-8 pt-2 ${t?"px-2":""} pt-2`,children:[l.isEmpty(i)&&h&&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..."})}),l.isEmpty(i)&&!h&&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"})}),t?e.jsxRuntimeExports.jsx("div",{className:"h-full columns-5 py-2",children:l.map(i,r=>e.jsxRuntimeExports.jsx("div",{role:"button",tabIndex:0,className:"my-1 flex",onClick:()=>a(r.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:r.name,src:r.thumbUrl})})},r.id))}):l.map(i,r=>e.jsxRuntimeExports.jsx("div",{role:"button",tabIndex:0,className:"px-2 py-1",onClick:()=>a(r.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:r.name,src:r.url})})},r.id))]})]})};exports.default=I;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
var t = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
|
|
2
|
+
function r(e) {
|
|
3
|
+
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
|
|
4
|
+
}
|
|
5
|
+
export {
|
|
6
|
+
t as c,
|
|
7
|
+
r as g
|
|
8
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var t=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function o(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}exports.commonjsGlobal=t;exports.getDefaultExportFromCjs=o;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-Z_BpKhVy.cjs"),x=require("react"),P=require("lodash-es"),t=require("./index-h-hd6EvN.cjs"),g=require("./controls-KK2oLIa8.cjs"),R=require("./form-lBQ_76Uw.cjs"),f=require("./index-mbyqq81O.cjs");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("./Functions-N3yhPYKY.cjs");require("clsx");require("tailwind-merge");require("@chaibuilder/runtime");require("jotai");require("./STRINGS-gPz7CUOk.cjs");require("@react-hookz/web");require("./MODIFIERS-0g14w5RS.cjs");require("./Class-PoYusiA5.cjs");require("react-i18next");require("@radix-ui/react-toggle");require("class-variance-authority");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("@rjsf/core");require("@rjsf/validator-ajv8");require("./index-OB199Izc.cjs");require("i18next");require("@floating-ui/react-dom");require("flagged");require("react-hotkeys-hook");require("sonner");require("./html-to-json-efmv1pCj.cjs");require("himalaya");require("lucide-react");require("./index-ecnGWzh9.cjs");const b=({closeModal:i})=>{var l,o;const u=f.useAddPage(),[r,m]=x.useState({name:"",slug:"",blocks:[],type:"STATIC",seoData:{},template:""}),p=()=>{u.mutate(r,{onSuccess:()=>i()})},j=({formData:n},s)=>{m(q=>{var d,c;const a={[s]:n[s]};return s==="name"?a.slug=P.kebabCase((d=n[s])==null?void 0:d.replace(/\d/g,"")):s==="slug"&&(a.slug=(c=n[s])==null?void 0:c.replace(/\d/g,"").replace(/\s+/g,"").replace("--","-").replace("__","_")),{...q,...a}})},h={name:g.u({title:"Page Name",default:r.name}),slug:g.u({title:"Page Slug",default:r.slug})};return e.jsxRuntimeExports.jsxs(t.DialogContent,{children:[e.jsxRuntimeExports.jsx("div",{className:"px-1 font-bold",children:"Add Page"}),e.jsxRuntimeExports.jsx(R.Form,{formData:r,properties:h,onChange:j,disabled:u.isPending}),e.jsxRuntimeExports.jsx("div",{className:"flex items-center justify-end",children:e.jsxRuntimeExports.jsx(t.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||u.isPending,onClick:p,children:"Add Page"})})]})},E=()=>{const[i,u]=x.useState(!1);return e.jsxRuntimeExports.jsxs(t.Dialog,{open:i,onOpenChange:()=>u(!i),children:[e.jsxRuntimeExports.jsx(t.DialogTrigger,{asChild:!0,children:e.jsxRuntimeExports.jsx(t.Button,{size:"sm",variant:"link",className:"text-blue-500",onClick:()=>u(!i),children:"+ New Page"})}),i&&e.jsxRuntimeExports.jsx(b,{closeModal:()=>u(!i)})]})};exports.default=E;
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import { j as t } from "./jsx-runtime-WbnYoNE9.js";
|
|
2
|
+
import { useState as c } from "react";
|
|
3
|
+
import { kebabCase as j } from "lodash-es";
|
|
4
|
+
import { ae as C, B as u, ad as b, ao as A } from "./index-Gk6sASBd.js";
|
|
5
|
+
import { u as g } from "./controls-OfJWSEqC.js";
|
|
6
|
+
import { F as D } from "./form-STUz-6nE.js";
|
|
7
|
+
import { e as N } from "./index-llTXLDGE.js";
|
|
8
|
+
import "./_commonjsHelpers-UyOWmZb0.js";
|
|
9
|
+
import "./Functions-7jnEwJyw.js";
|
|
10
|
+
import "clsx";
|
|
11
|
+
import "tailwind-merge";
|
|
12
|
+
import "@chaibuilder/runtime";
|
|
13
|
+
import "jotai";
|
|
14
|
+
import "./STRINGS--j49GZJP.js";
|
|
15
|
+
import "@react-hookz/web";
|
|
16
|
+
import "./MODIFIERS-dytZ-osO.js";
|
|
17
|
+
import "./Class-lGzsNBOK.js";
|
|
18
|
+
import "react-i18next";
|
|
19
|
+
import "@radix-ui/react-toggle";
|
|
20
|
+
import "class-variance-authority";
|
|
21
|
+
import "@radix-ui/react-switch";
|
|
22
|
+
import "@radix-ui/react-slot";
|
|
23
|
+
import "@radix-ui/react-accordion";
|
|
24
|
+
import "@radix-ui/react-icons";
|
|
25
|
+
import "@radix-ui/react-alert-dialog";
|
|
26
|
+
import "@radix-ui/react-dialog";
|
|
27
|
+
import "@radix-ui/react-label";
|
|
28
|
+
import "@radix-ui/react-scroll-area";
|
|
29
|
+
import "@radix-ui/react-tabs";
|
|
30
|
+
import "@radix-ui/react-tooltip";
|
|
31
|
+
import "@radix-ui/react-popover";
|
|
32
|
+
import "@radix-ui/react-menubar";
|
|
33
|
+
import "@radix-ui/react-hover-card";
|
|
34
|
+
import "@radix-ui/react-select";
|
|
35
|
+
import "@radix-ui/react-dropdown-menu";
|
|
36
|
+
import "@radix-ui/react-separator";
|
|
37
|
+
import "@radix-ui/react-toast";
|
|
38
|
+
import "cmdk";
|
|
39
|
+
import "@radix-ui/react-context-menu";
|
|
40
|
+
import "react-icons-picker";
|
|
41
|
+
import "react-dom";
|
|
42
|
+
import "react-quill";
|
|
43
|
+
import "@rjsf/core";
|
|
44
|
+
import "@rjsf/validator-ajv8";
|
|
45
|
+
import "./index-SkyM3d6Q.js";
|
|
46
|
+
import "i18next";
|
|
47
|
+
import "@floating-ui/react-dom";
|
|
48
|
+
import "flagged";
|
|
49
|
+
import "react-hotkeys-hook";
|
|
50
|
+
import "sonner";
|
|
51
|
+
import "./html-to-json-ngX9ef2u.js";
|
|
52
|
+
import "himalaya";
|
|
53
|
+
import "lucide-react";
|
|
54
|
+
import "./index-YpnaudSM.js";
|
|
55
|
+
const S = ({ closeModal: e }) => {
|
|
56
|
+
var a, s;
|
|
57
|
+
const i = N(), [o, f] = c({
|
|
58
|
+
name: "",
|
|
59
|
+
slug: "",
|
|
60
|
+
blocks: [],
|
|
61
|
+
type: "STATIC",
|
|
62
|
+
seoData: {},
|
|
63
|
+
template: ""
|
|
64
|
+
}), x = () => {
|
|
65
|
+
i.mutate(o, { onSuccess: () => e() });
|
|
66
|
+
}, h = ({ formData: m }, r) => {
|
|
67
|
+
f((l) => {
|
|
68
|
+
var n, d;
|
|
69
|
+
const p = { [r]: m[r] };
|
|
70
|
+
return r === "name" ? p.slug = j((n = m[r]) == null ? void 0 : n.replace(/\d/g, "")) : r === "slug" && (p.slug = (d = m[r]) == null ? void 0 : d.replace(/\d/g, "").replace(/\s+/g, "").replace("--", "-").replace("__", "_")), {
|
|
71
|
+
...l,
|
|
72
|
+
...p
|
|
73
|
+
};
|
|
74
|
+
});
|
|
75
|
+
}, P = {
|
|
76
|
+
name: g({
|
|
77
|
+
title: "Page Name",
|
|
78
|
+
default: o.name
|
|
79
|
+
}),
|
|
80
|
+
slug: g({ title: "Page Slug", default: o.slug })
|
|
81
|
+
};
|
|
82
|
+
return /* @__PURE__ */ t.jsxs(C, { children: [
|
|
83
|
+
/* @__PURE__ */ t.jsx("div", { className: "px-1 font-bold", children: "Add Page" }),
|
|
84
|
+
/* @__PURE__ */ t.jsx(D, { formData: o, properties: P, onChange: h, disabled: i.isPending }),
|
|
85
|
+
/* @__PURE__ */ t.jsx("div", { className: "flex items-center justify-end", children: /* @__PURE__ */ t.jsx(
|
|
86
|
+
u,
|
|
87
|
+
{
|
|
88
|
+
type: "submit",
|
|
89
|
+
disabled: !o.name || !o.slug || ((a = o.name) == null ? void 0 : a.length) < 2 || ((s = o.slug) == null ? void 0 : s.length) < 2 || i.isPending,
|
|
90
|
+
onClick: x,
|
|
91
|
+
children: "Add Page"
|
|
92
|
+
}
|
|
93
|
+
) })
|
|
94
|
+
] });
|
|
95
|
+
}, vt = () => {
|
|
96
|
+
const [e, i] = c(!1);
|
|
97
|
+
return /* @__PURE__ */ t.jsxs(b, { open: e, onOpenChange: () => i(!e), children: [
|
|
98
|
+
/* @__PURE__ */ t.jsx(A, { asChild: !0, children: /* @__PURE__ */ t.jsx(u, { size: "sm", variant: "link", className: "text-blue-500", onClick: () => i(!e), children: "+ New Page" }) }),
|
|
99
|
+
e && /* @__PURE__ */ t.jsx(S, { closeModal: () => i(!e) })
|
|
100
|
+
] });
|
|
101
|
+
};
|
|
102
|
+
export {
|
|
103
|
+
vt as default
|
|
104
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-Z_BpKhVy.cjs"),r=require("./index-h-hd6EvN.cjs");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("react");require("lodash-es");require("./Functions-N3yhPYKY.cjs");require("clsx");require("tailwind-merge");require("@chaibuilder/runtime");require("jotai");require("./STRINGS-gPz7CUOk.cjs");require("@react-hookz/web");require("./MODIFIERS-0g14w5RS.cjs");require("./Class-PoYusiA5.cjs");require("react-i18next");require("@radix-ui/react-toggle");require("class-variance-authority");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");const x=({open:t,onCancel:q=()=>{},onConfirm:s,title:n,description:i,disabled:u,cancelText:l="Discard",confirmText:o="Save"})=>e.jsxRuntimeExports.jsx(r.AlertDialog,{open:t,children:e.jsxRuntimeExports.jsxs(r.AlertDialogContent,{children:[e.jsxRuntimeExports.jsx(r.AlertDialogTitle,{children:n}),i&&e.jsxRuntimeExports.jsx(r.AlertDialogDescription,{children:i}),e.jsxRuntimeExports.jsxs("div",{className:"flex items-center justify-end gap-x-3",children:[e.jsxRuntimeExports.jsx(r.AlertDialogCancel,{disabled:u,onClick:q,children:l}),e.jsxRuntimeExports.jsx(r.Button,{variant:"default",onClick:s,disabled:u,children:o})]})]})});exports.default=x;
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { j as i } from "./jsx-runtime-WbnYoNE9.js";
|
|
2
|
+
import { A as a, b as n, d as c, e as x, g as d, B as j } from "./index-Gk6sASBd.js";
|
|
3
|
+
import "./_commonjsHelpers-UyOWmZb0.js";
|
|
4
|
+
import "react";
|
|
5
|
+
import "lodash-es";
|
|
6
|
+
import "./Functions-7jnEwJyw.js";
|
|
7
|
+
import "clsx";
|
|
8
|
+
import "tailwind-merge";
|
|
9
|
+
import "@chaibuilder/runtime";
|
|
10
|
+
import "jotai";
|
|
11
|
+
import "./STRINGS--j49GZJP.js";
|
|
12
|
+
import "@react-hookz/web";
|
|
13
|
+
import "./MODIFIERS-dytZ-osO.js";
|
|
14
|
+
import "./Class-lGzsNBOK.js";
|
|
15
|
+
import "react-i18next";
|
|
16
|
+
import "@radix-ui/react-toggle";
|
|
17
|
+
import "class-variance-authority";
|
|
18
|
+
import "@radix-ui/react-switch";
|
|
19
|
+
import "@radix-ui/react-slot";
|
|
20
|
+
import "@radix-ui/react-accordion";
|
|
21
|
+
import "@radix-ui/react-icons";
|
|
22
|
+
import "@radix-ui/react-alert-dialog";
|
|
23
|
+
import "@radix-ui/react-dialog";
|
|
24
|
+
import "@radix-ui/react-label";
|
|
25
|
+
import "@radix-ui/react-scroll-area";
|
|
26
|
+
import "@radix-ui/react-tabs";
|
|
27
|
+
import "@radix-ui/react-tooltip";
|
|
28
|
+
import "@radix-ui/react-popover";
|
|
29
|
+
import "@radix-ui/react-menubar";
|
|
30
|
+
import "@radix-ui/react-hover-card";
|
|
31
|
+
import "@radix-ui/react-select";
|
|
32
|
+
import "@radix-ui/react-dropdown-menu";
|
|
33
|
+
import "@radix-ui/react-separator";
|
|
34
|
+
import "@radix-ui/react-toast";
|
|
35
|
+
import "cmdk";
|
|
36
|
+
import "@radix-ui/react-context-menu";
|
|
37
|
+
import "react-icons-picker";
|
|
38
|
+
import "react-dom";
|
|
39
|
+
import "react-quill";
|
|
40
|
+
const ii = ({
|
|
41
|
+
open: o,
|
|
42
|
+
onCancel: m = () => {
|
|
43
|
+
},
|
|
44
|
+
onConfirm: p,
|
|
45
|
+
title: e,
|
|
46
|
+
description: r,
|
|
47
|
+
disabled: t,
|
|
48
|
+
cancelText: l = "Discard",
|
|
49
|
+
confirmText: s = "Save"
|
|
50
|
+
}) => /* @__PURE__ */ i.jsx(a, { open: o, children: /* @__PURE__ */ i.jsxs(n, { children: [
|
|
51
|
+
/* @__PURE__ */ i.jsx(c, { children: e }),
|
|
52
|
+
r && /* @__PURE__ */ i.jsx(x, { children: r }),
|
|
53
|
+
/* @__PURE__ */ i.jsxs("div", { className: "flex items-center justify-end gap-x-3", children: [
|
|
54
|
+
/* @__PURE__ */ i.jsx(d, { disabled: t, onClick: m, children: l }),
|
|
55
|
+
/* @__PURE__ */ i.jsx(j, { variant: "default", onClick: p, disabled: t, children: s })
|
|
56
|
+
] })
|
|
57
|
+
] }) });
|
|
58
|
+
export {
|
|
59
|
+
ii as default
|
|
60
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const t=require("lodash-es"),n="#styles:";const a=i=>({type:"singular",default:i.default||"",binding:t.get(i,"binding",!0),i18n:i.i18n||!1,dataType:"string",required:i.required||!1,schema:{type:"string",...t.omit(i,["i18n","required"])},uiSchema:{"ui:placeholder":i.placeholder||"Enter here"}}),d=i=>({type:"singular",default:i.default||"",binding:t.get(i,"binding",!0),dataType:"string",i18n:i.i18n||!1,required:i.required||!1,schema:{type:"string",...t.omit(i,["i18n","required","rows"])},uiSchema:{"ui:widget":"textarea","ui:placeholder":i.placeholder||"Enter here","ui:options":{rows:i.rows||4}}}),r=i=>({type:"singular",i18n:i.i18n||!1,default:i.default||!1,dataType:"boolean",binding:t.get(i,"binding",!0),schema:{type:"boolean",...t.omit(i,["i18n","required"])},uiSchema:{"ui:title":i.title||"Select Item","ui:description":""}}),u=i=>({type:"singular",default:i.default||"",binding:t.get(i,"binding",!0),dataType:"number",i18n:i.i18n||!1,required:i.required||!1,schema:{type:"number",...t.omit(i,["i18n","required"])},uiSchema:{}}),g=i=>({type:"singular",default:i.default||"",binding:t.get(i,"binding",!0),i18n:i.i18n||!1,required:i.required||!1,dataType:"string",schema:{type:"string",...t.omit(i,["i18n","required","options","binding"]),oneOf:i.options.map(e=>({const:e.value,title:e.title}))},uiSchema:{"ui:widget":"select"}}),l=i=>({type:"singular",i18n:i.i18n||!1,default:i.default||"",binding:t.get(i,"binding",!0),dataType:"string",schema:{type:"string",...t.omit(i,["i18n","required"])},uiSchema:{"ui:widget":"color"}});const s=i=>({type:"singular",default:i.default||"",i18n:i.i18n||!1,binding:t.get(i,"binding",!0),dataType:"string",schema:{type:"string",...t.omit(i,["i18n","required"])},uiSchema:{"ui:widget":"richtext"}}),p=i=>({type:"model",title:i.title,dataType:"object",default:i.default||{},binding:t.get(i,"binding",!0),properties:i.properties}),y=i=>({type:"list",itemProperties:i.itemProperties,binding:t.get(i,"binding",!0),title:i.title,dataType:"array",default:i.default||[],itemTitle:i.getItemLabel?i.getItemLabel({}):()=>""}),o=i=>({type:"styles",binding:!1,default:`${n},${i.default||""}`,presets:i.presets||{}}),m=i=>({default:i.default||"",binding:t.get(i,"binding",!0),type:"singular",i18n:i.i18n||!1,dataType:"string",schema:{type:"string",title:"Icon",default:i.default||""},uiSchema:{"ui:widget":"icon"}}),c=i=>({default:i.default,type:"singular",binding:t.get(i,"binding",!0),dataType:"object",i18n:i.i18n||!1,schema:{type:"object",...i||{},properties:{type:{type:"string"},href:{type:"string"},target:{type:"string"}}},uiSchema:{"ui:field":"link"}}),b=i=>({type:"singular",default:i.default||"",binding:t.get(i,"binding",!0),dataType:"string",i18n:i.i18n||!1,schema:{type:"string",...t.omit(i,["i18n","required"])},uiSchema:{"ui:widget":"image"}});exports.S=o;exports.T=m;exports.b=p;exports.c=u;exports.f=l;exports.g=d;exports.h=y;exports.m=s;exports.o=b;exports.q=c;exports.r=r;exports.s=g;exports.u=a;
|