@chaibuilder/sdk 1.0.14 → 1.0.16
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-H7BZYHUC.js → AddBlocks-eoo1CzaK.js} +114 -111
- package/dist/AddBlocks-jU0NwP_s.cjs +3 -0
- package/dist/{BrandingOptions-PAgY-kvj.js → BrandingOptions-ZfGlHDQN.js} +57 -41
- package/dist/BrandingOptions-qLROZ5_E.cjs +1 -0
- package/dist/CanvasArea-970i3vfn.cjs +46 -0
- package/dist/{CanvasArea-zn2ox-5h.js → CanvasArea-tngPDKeT.js} +517 -519
- package/dist/Class-RZuPYbUS.cjs +1 -0
- package/dist/{Class-l7qYbuoN.js → Class-nQk08vqd.js} +204 -124
- package/dist/{CurrentPage-6Jp4xAWK.js → CurrentPage-CMfaRNdW.js} +58 -40
- package/dist/CurrentPage-ChffzjTI.cjs +1 -0
- package/dist/Layers-GkcHf9zi.cjs +1 -0
- package/dist/{Layers-WkZ48AUm.js → Layers-uB7ROW-2.js} +158 -141
- package/dist/MarkAsGlobalBlock-lYL8cO9x.cjs +1 -0
- package/dist/MarkAsGlobalBlock-ySc-D4SB.js +84 -0
- package/dist/PagesPanel-DVZ90k1Y.js +70 -0
- package/dist/PagesPanel-ZhyfEOgv.cjs +1 -0
- package/dist/ProjectPanel-8oW-gW5l.cjs +1 -0
- package/dist/ProjectPanel-WCQDwngA.js +91 -0
- package/dist/{Settings-fH8fZKpm.js → Settings-7Km8_Iba.js} +411 -408
- package/dist/Settings-CLiAR8FT.cjs +1 -0
- package/dist/SidePanels-D7Jota-n.cjs +1 -0
- package/dist/{SidePanels-w8ZHKJaR.js → SidePanels-_2og328o.js} +106 -88
- package/dist/{Topbar-hm1D_5sb.js → Topbar-lX9OMPwj.js} +47 -45
- package/dist/Topbar-qi5ab8rR.cjs +1 -0
- package/dist/UnsplashImages-a2r7b3kB.cjs +1 -0
- package/dist/{UnsplashImages-gPcBLjgB.js → UnsplashImages-u_QTABzi.js} +56 -44
- package/dist/{UploadImages-_ZyUU66E.js → UploadImages-gV5xDHIu.js} +55 -34
- package/dist/UploadImages-jLQgLujd.cjs +1 -0
- package/dist/add-page-modal-OBghcP4h.cjs +1 -0
- package/dist/add-page-modal-PsNV4j42.js +110 -0
- package/dist/confirm-alert-ZQ-sxX0X.js +58 -0
- package/dist/confirm-alert-z74-fGOT.cjs +1 -0
- package/dist/core.cjs +1 -1
- package/dist/core.js +99 -124
- package/dist/delete-page-modal-5QqRuat8.js +89 -0
- package/dist/delete-page-modal-niJTfDhl.cjs +1 -0
- package/dist/form-Osm1AmO5.cjs +1 -0
- package/dist/{form-dVpOAyRl.js → form-zZJyZuNH.js} +12 -12
- package/dist/index-2EHcmZqL.js +2947 -0
- package/dist/index-3_eUgIcu.cjs +206 -0
- package/dist/index-X20Fx8GF.js +40872 -0
- package/dist/index-aGgHTZqR.cjs +9 -0
- package/dist/index-c8zW_D2V.cjs +1 -0
- package/dist/index-fwo4wa7u.cjs +1 -0
- package/dist/index-gmZcUXyn.js +25 -0
- package/dist/index-yWvUd-lf.js +1189 -0
- package/dist/{jsx-runtime-JYMCiFoE.cjs → jsx-runtime-WKRPbKtm.cjs} +7 -7
- package/dist/{jsx-runtime-Sp0orL4X.js → jsx-runtime-qAwJ85SY.js} +109 -106
- package/dist/lib.cjs +2 -1
- package/dist/lib.js +1333 -71
- package/dist/{page-viewer-Y4YiaZ_m.js → page-viewer-_Sx79O1c.js} +62 -44
- package/dist/page-viewer-vgt_sF5B.cjs +1 -0
- package/dist/{project-general-setting-U4S_KlhU.js → project-general-setting-d4UJ9Xsf.js} +46 -36
- package/dist/project-general-setting-isR_XMTY.cjs +1 -0
- package/dist/project-seo-setting-FpCjw-1j.js +89 -0
- package/dist/project-seo-setting-tUM5Jqki.cjs +1 -0
- package/dist/render.cjs +1 -1
- package/dist/render.js +23 -19
- package/dist/server.cjs +1 -1
- package/dist/server.js +1 -1
- package/dist/{single-page-detail-pAxCy_Pe.js → single-page-detail-Ajzk6Hdb.js} +90 -80
- package/dist/single-page-detail-nAykBmpV.cjs +1 -0
- package/dist/studio.cjs +1 -1
- package/dist/studio.js +45 -25
- package/dist/ui.cjs +1 -1
- package/dist/ui.js +156 -357
- package/package.json +1 -1
- package/dist/AddBlocks-7ACJv8LW.cjs +0 -3
- package/dist/BrandingOptions-5j-XszLM.cjs +0 -1
- package/dist/CanvasArea-Dnm-yeus.cjs +0 -46
- package/dist/ChaiBuilderEditor-BoE-sArB.cjs +0 -163
- package/dist/ChaiBuilderEditor-hEuUONQ3.js +0 -27094
- package/dist/Class-_uCzl5v1.cjs +0 -1
- package/dist/CurrentPage-YMpqOqx7.cjs +0 -1
- package/dist/ImagesPanel-6us7hiLN.cjs +0 -1
- package/dist/ImagesPanel-oaHOD-Ex.js +0 -27
- package/dist/Layers-EzOZdWvd.cjs +0 -1
- package/dist/MODIFIERS-DsEzQ3aH.js +0 -73
- package/dist/MODIFIERS-Fx6WAZcw.cjs +0 -1
- package/dist/MarkAsGlobalBlock-0HubcRkY.js +0 -77
- package/dist/MarkAsGlobalBlock-HmeIyLCP.cjs +0 -1
- package/dist/PagesPanel-6JuwBLFQ.js +0 -50
- package/dist/PagesPanel-zJq8p1ja.cjs +0 -1
- package/dist/ProjectPanel-Zml2F8b9.cjs +0 -1
- package/dist/ProjectPanel-cu2QSDW9.js +0 -73
- package/dist/Settings-lc9PfnmG.cjs +0 -1
- package/dist/SidePanels-VH72zFE2.cjs +0 -1
- package/dist/Topbar-vQPo9xSY.cjs +0 -1
- package/dist/UnsplashImages-BoBBSi1a.cjs +0 -1
- package/dist/UploadImages-T6kW0s3G.cjs +0 -1
- package/dist/accordion-oPUeqPCZ.js +0 -42
- package/dist/accordion-ynvFtV_p.cjs +0 -1
- package/dist/add-page-modal--qZSwJuB.cjs +0 -1
- package/dist/add-page-modal-bj7qbZuK.js +0 -99
- package/dist/alert-dialog-GNfnpqFB.js +0 -64
- package/dist/alert-dialog-Mv0-wAvS.cjs +0 -1
- package/dist/command-ThdTuUxt.cjs +0 -1
- package/dist/command-VHca6CcN.js +0 -97
- package/dist/confirm-alert-8EHe0OOd.cjs +0 -1
- package/dist/confirm-alert-b0e_BLhF.js +0 -36
- package/dist/context-menu-8dC9uGXj.js +0 -122
- package/dist/context-menu-IgLbIuth.cjs +0 -1
- package/dist/controls-Ni5kEzLz.js +0 -103
- package/dist/controls-W97-POR_.cjs +0 -1
- package/dist/controls-enQY7NI8.js +0 -118
- package/dist/controls-xUKa23ic.cjs +0 -1
- package/dist/delete-page-modal-2LuDLEiP.cjs +0 -1
- package/dist/delete-page-modal-cnrR8tWH.js +0 -69
- package/dist/dialog-S_QbL1iq.cjs +0 -1
- package/dist/dialog-jrw9DF1f.js +0 -65
- package/dist/dropdown-menu-S03K_fNs.js +0 -164
- package/dist/dropdown-menu-sMXR59cB.cjs +0 -1
- package/dist/form-nRAvKPQj.cjs +0 -1
- package/dist/functions-nNTuSTsR.js +0 -1106
- package/dist/functions-pcUZhFJM.js +0 -12
- package/dist/functions-sCuB7nvZ.cjs +0 -2
- package/dist/functions-uw7QP2kT.cjs +0 -1
- package/dist/html-to-json-P6GpbcQX.cjs +0 -1
- package/dist/html-to-json-pdHQfRkN.js +0 -178
- package/dist/index-HAue58ea.cjs +0 -1
- package/dist/index-T4_wfKl5.js +0 -2256
- package/dist/index-X9ZgD09V.cjs +0 -1
- package/dist/index-ehKdBRUK.js +0 -18
- package/dist/label-KaP7MRrs.js +0 -10
- package/dist/label-tFm8HZdb.cjs +0 -1
- package/dist/link-6o6n2Tnd.js +0 -204
- package/dist/link-ece8dZGH.cjs +0 -1
- package/dist/page-viewer-IARz6OSp.cjs +0 -1
- package/dist/popover-a84pbVhQ.js +0 -23
- package/dist/popover-fKjgcRUx.cjs +0 -1
- package/dist/project-general-setting-eSl3t-VH.cjs +0 -1
- package/dist/project-seo-setting-Ga9v_ECU.js +0 -67
- package/dist/project-seo-setting-rankm1z3.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-yPgnu2AI.cjs +0 -1
- package/dist/skeleton-CU_FIbg3.js +0 -239
- package/dist/skeleton-JHP9zwL2.cjs +0 -1
- package/dist/tabs-Gb9v5dVb.js +0 -46
- package/dist/tabs-iWeaaVrg.cjs +0 -1
- package/dist/textarea-1kZEh7ki.cjs +0 -1
- package/dist/textarea-b2QvVhrK.js +0 -73
- package/dist/toggle-ASJRAaGP.js +0 -30
- package/dist/toggle-ehNIPmme.cjs +0 -1
- package/dist/useAddBlock-WJc3OgG8.js +0 -86
- package/dist/useAddBlock-dCKRFPRU.cjs +0 -1
- package/dist/useAllBlocks-6hvuNuyw.cjs +0 -1
- package/dist/useAllBlocks-PQKYvs-e.js +0 -20
- package/dist/useChaiExternalData-4K9WxANa.js +0 -6
- package/dist/useChaiExternalData-DkyBJ81C.cjs +0 -1
- package/dist/useDarkMode-ZKCO_gkt.js +0 -23
- package/dist/useDarkMode-dV6FM6l-.cjs +0 -1
- package/dist/useFeatureSupport-OLwNgEZb.js +0 -16
- package/dist/useFeatureSupport-c9IgPW2t.cjs +0 -1
- package/dist/useHiddenBlocks-3MsGOJ1s.js +0 -15
- package/dist/useHiddenBlocks-oJuQDmTy.cjs +0 -1
- package/dist/useLanguage-NKKKaxVM.cjs +0 -1
- package/dist/useLanguage-gVC5rxO5.js +0 -216
- package/dist/useMarkAsGlobalBlock-X73Vny8u.js +0 -25
- package/dist/useMarkAsGlobalBlock-ebBVGHg4.cjs +0 -1
- package/dist/useUiLibraries-4hPOi8DI.js +0 -12
- package/dist/useUiLibraries-9FhQCpKo.cjs +0 -1
- package/dist/utils-dze1SGvB.js +0 -6
- package/dist/utils-qK_SjzzV.cjs +0 -1
|
@@ -1,39 +1,41 @@
|
|
|
1
|
-
import { j as e } from "./jsx-runtime-
|
|
1
|
+
import { j as e } from "./jsx-runtime-qAwJ85SY.js";
|
|
2
2
|
import o, { useMemo as m, Suspense as c } from "react";
|
|
3
3
|
import { FontFamilyIcon as x } from "@radix-ui/react-icons";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import
|
|
7
|
-
import { T as C } from "./toggle-ASJRAaGP.js";
|
|
8
|
-
import { p as w } from "./ChaiBuilderEditor-hEuUONQ3.js";
|
|
9
|
-
import { useTranslation as y } from "react-i18next";
|
|
10
|
-
import "@radix-ui/react-select";
|
|
11
|
-
import "./utils-dze1SGvB.js";
|
|
4
|
+
import { i as r, au as d, av as h, aw as u, ax as g, aF as j, aG as v, ay as a, ag as f, aH as S, aI as b, aJ as N, aK as w, S as p, aL as y } from "./index-2EHcmZqL.js";
|
|
5
|
+
import { useTranslation as C } from "react-i18next";
|
|
6
|
+
import "./Class-nQk08vqd.js";
|
|
12
7
|
import "clsx";
|
|
13
8
|
import "tailwind-merge";
|
|
14
|
-
import "jotai";
|
|
15
9
|
import "lodash";
|
|
16
|
-
import "@radix-ui/react-
|
|
10
|
+
import "@radix-ui/react-toggle";
|
|
17
11
|
import "class-variance-authority";
|
|
12
|
+
import "@radix-ui/react-switch";
|
|
13
|
+
import "@radix-ui/react-slot";
|
|
14
|
+
import "@radix-ui/react-accordion";
|
|
15
|
+
import "@radix-ui/react-alert-dialog";
|
|
16
|
+
import "@radix-ui/react-dialog";
|
|
17
|
+
import "@radix-ui/react-label";
|
|
18
|
+
import "@radix-ui/react-scroll-area";
|
|
19
|
+
import "@radix-ui/react-tabs";
|
|
18
20
|
import "@radix-ui/react-tooltip";
|
|
19
|
-
import "@radix-ui/react-
|
|
21
|
+
import "@radix-ui/react-popover";
|
|
22
|
+
import "@radix-ui/react-menubar";
|
|
23
|
+
import "@radix-ui/react-hover-card";
|
|
24
|
+
import "@radix-ui/react-select";
|
|
25
|
+
import "@radix-ui/react-dropdown-menu";
|
|
20
26
|
import "@radix-ui/react-separator";
|
|
21
|
-
import "@radix-ui/react-
|
|
22
|
-
import "
|
|
23
|
-
import "@radix-ui/react-
|
|
27
|
+
import "@radix-ui/react-toast";
|
|
28
|
+
import "cmdk";
|
|
29
|
+
import "@radix-ui/react-context-menu";
|
|
30
|
+
import "react-icons-picker";
|
|
24
31
|
import "react-dom";
|
|
25
|
-
import "
|
|
26
|
-
import "
|
|
27
|
-
import "flagged";
|
|
28
|
-
import "react-dnd";
|
|
29
|
-
import "@minoru/react-dnd-treeview";
|
|
30
|
-
import "react-hotkeys-hook";
|
|
32
|
+
import "react-quill";
|
|
33
|
+
import "jotai";
|
|
31
34
|
import "flat-to-nested";
|
|
32
|
-
import "./functions-pcUZhFJM.js";
|
|
33
35
|
import "redux-undo";
|
|
36
|
+
import "./index-gmZcUXyn.js";
|
|
34
37
|
import "@react-hookz/web";
|
|
35
|
-
|
|
36
|
-
const A = () => a("languages", ["en"]), T = () => A().length === 1 ? null : /* @__PURE__ */ e.jsx("div", { className: "flex items-center", children: /* @__PURE__ */ e.jsxs(d, { children: [
|
|
38
|
+
const A = () => r("languages", ["en"]), B = () => A().length === 1 ? null : /* @__PURE__ */ e.jsx("div", { className: "flex items-center", children: /* @__PURE__ */ e.jsxs(d, { children: [
|
|
37
39
|
/* @__PURE__ */ e.jsx(h, { className: "w-[150px] border-0", children: /* @__PURE__ */ e.jsx(
|
|
38
40
|
u,
|
|
39
41
|
{
|
|
@@ -44,15 +46,15 @@ const A = () => a("languages", ["en"]), T = () => A().length === 1 ? null : /* @
|
|
|
44
46
|
}
|
|
45
47
|
) }),
|
|
46
48
|
/* @__PURE__ */ e.jsx(g, { children: /* @__PURE__ */ e.jsxs(j, { children: [
|
|
47
|
-
/* @__PURE__ */ e.jsx(
|
|
48
|
-
/* @__PURE__ */ e.jsx(
|
|
49
|
-
/* @__PURE__ */ e.jsx(
|
|
50
|
-
/* @__PURE__ */ e.jsx(
|
|
51
|
-
/* @__PURE__ */ e.jsx(
|
|
52
|
-
/* @__PURE__ */ e.jsx(
|
|
49
|
+
/* @__PURE__ */ e.jsx(v, { children: "Fruits" }),
|
|
50
|
+
/* @__PURE__ */ e.jsx(a, { value: "apple", children: "Apple" }),
|
|
51
|
+
/* @__PURE__ */ e.jsx(a, { value: "banana", children: "Banana" }),
|
|
52
|
+
/* @__PURE__ */ e.jsx(a, { value: "blueberry", children: "Blueberry" }),
|
|
53
|
+
/* @__PURE__ */ e.jsx(a, { value: "grapes", children: "Grapes" }),
|
|
54
|
+
/* @__PURE__ */ e.jsx(a, { value: "pineapple", children: "Pineapple" })
|
|
53
55
|
] }) })
|
|
54
|
-
] }) }),
|
|
55
|
-
const { savePage: l, syncState: s } =
|
|
56
|
+
] }) }), T = () => {
|
|
57
|
+
const { savePage: l, syncState: s } = f(), { t: i } = C(), n = m(() => {
|
|
56
58
|
switch (s) {
|
|
57
59
|
case "SAVING":
|
|
58
60
|
return "animate-pulse bg-gray-500 text-gray-900";
|
|
@@ -62,14 +64,14 @@ const A = () => a("languages", ["en"]), T = () => A().length === 1 ? null : /* @
|
|
|
62
64
|
return "bg-gray-200 text-gray-500 hover:bg-gray-100";
|
|
63
65
|
}
|
|
64
66
|
}, [s]);
|
|
65
|
-
return /* @__PURE__ */ e.jsx("div", { className: "flex items-center", children: /* @__PURE__ */ e.jsxs(
|
|
66
|
-
/* @__PURE__ */ e.jsx(
|
|
67
|
-
|
|
67
|
+
return /* @__PURE__ */ e.jsx("div", { className: "flex items-center", children: /* @__PURE__ */ e.jsxs(S, { children: [
|
|
68
|
+
/* @__PURE__ */ e.jsx(b, { asChild: !0, children: /* @__PURE__ */ e.jsxs(
|
|
69
|
+
N,
|
|
68
70
|
{
|
|
69
71
|
onClick: (t) => {
|
|
70
72
|
t.preventDefault(), l();
|
|
71
73
|
},
|
|
72
|
-
className: `flex h-auto w-20 items-center gap-x-1 rounded-full p-1 px-2 ${
|
|
74
|
+
className: `flex h-auto w-20 items-center gap-x-1 rounded-full p-1 px-2 ${n}`,
|
|
73
75
|
size: "sm",
|
|
74
76
|
variant: "outline",
|
|
75
77
|
children: [
|
|
@@ -80,14 +82,14 @@ const A = () => a("languages", ["en"]), T = () => A().length === 1 ? null : /* @
|
|
|
80
82
|
d: "M.274.086a.02.02 0 0 1 0 .028l-.12.12a.02.02 0 0 1-.028 0l-.06-.06A.02.02 0 0 1 .094.146L.14.192.246.086a.02.02 0 0 1 .028 0Z"
|
|
81
83
|
}
|
|
82
84
|
) }),
|
|
83
|
-
s === "SAVING" ? "Saving..." : s === "SAVED" ?
|
|
85
|
+
s === "SAVING" ? "Saving..." : s === "SAVED" ? i("Saved") : "Save"
|
|
84
86
|
]
|
|
85
87
|
}
|
|
86
88
|
) }),
|
|
87
|
-
/* @__PURE__ */ e.jsx(
|
|
89
|
+
/* @__PURE__ */ e.jsx(w, { children: /* @__PURE__ */ e.jsx("p", { children: s === "SAVING" ? "Saving..." : s === "SAVED" ? "Saved" : "Save changes" }) })
|
|
88
90
|
] }) });
|
|
89
|
-
},
|
|
90
|
-
const l =
|
|
91
|
+
}, xe = () => {
|
|
92
|
+
const l = r("topBarComponents.left", []), s = r("topBarComponents.center", []), i = r("topBarComponents.right", []), n = r("editable", !0);
|
|
91
93
|
return /* @__PURE__ */ e.jsxs("div", { className: "flex h-14 items-center justify-between px-2", children: [
|
|
92
94
|
/* @__PURE__ */ e.jsx("div", { className: "flex items-center space-x-2", children: /* @__PURE__ */ e.jsx("div", { className: "flex items-center space-x-2 font-bold", children: o.Children.toArray(
|
|
93
95
|
l.map((t) => /* @__PURE__ */ e.jsx(c, { fallback: /* @__PURE__ */ e.jsx(p, { className: "h-10" }), children: /* @__PURE__ */ e.jsx(t, {}) }))
|
|
@@ -96,15 +98,15 @@ const A = () => a("languages", ["en"]), T = () => A().length === 1 ? null : /* @
|
|
|
96
98
|
s.map((t) => /* @__PURE__ */ e.jsx(c, { fallback: /* @__PURE__ */ e.jsx(p, { className: "h-10" }), children: /* @__PURE__ */ e.jsx(t, {}) }))
|
|
97
99
|
) }),
|
|
98
100
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-2", children: [
|
|
99
|
-
/* @__PURE__ */ e.jsx(
|
|
100
|
-
/* @__PURE__ */ e.jsx(
|
|
101
|
-
|
|
101
|
+
/* @__PURE__ */ e.jsx(B, {}),
|
|
102
|
+
/* @__PURE__ */ e.jsx(y, { orientation: "vertical" }),
|
|
103
|
+
n ? /* @__PURE__ */ e.jsx(T, {}) : null,
|
|
102
104
|
o.Children.toArray(
|
|
103
|
-
|
|
105
|
+
i.map((t) => /* @__PURE__ */ e.jsx(c, { fallback: /* @__PURE__ */ e.jsx(p, { className: "h-10" }), children: /* @__PURE__ */ e.jsx(t, {}) }))
|
|
104
106
|
)
|
|
105
107
|
] })
|
|
106
108
|
] });
|
|
107
109
|
};
|
|
108
110
|
export {
|
|
109
|
-
|
|
111
|
+
xe as default
|
|
110
112
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-WKRPbKtm.cjs"),n=require("react"),l=require("@radix-ui/react-icons"),r=require("./index-c8zW_D2V.cjs"),a=require("react-i18next");require("./Class-RZuPYbUS.cjs");require("clsx");require("tailwind-merge");require("lodash");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");require("jotai");require("flat-to-nested");require("redux-undo");require("./index-fwo4wa7u.cjs");require("@react-hookz/web");const o=()=>r.useBuilderProp("languages",["en"]),c=()=>o().length===1?null:e.jsxRuntimeExports.jsx("div",{className:"flex items-center",children:e.jsxRuntimeExports.jsxs(r.Select,{children:[e.jsxRuntimeExports.jsx(r.SelectTrigger,{className:"w-[150px] border-0",children:e.jsxRuntimeExports.jsx(r.SelectValue,{placeholder:e.jsxRuntimeExports.jsxs("span",{className:"flex items-center",children:[e.jsxRuntimeExports.jsx(l.FontFamilyIcon,{className:"h-4 w-4"})," English(US)"]})})}),e.jsxRuntimeExports.jsx(r.SelectContent,{children:e.jsxRuntimeExports.jsxs(r.SelectGroup,{children:[e.jsxRuntimeExports.jsx(r.SelectLabel,{children:"Fruits"}),e.jsxRuntimeExports.jsx(r.SelectItem,{value:"apple",children:"Apple"}),e.jsxRuntimeExports.jsx(r.SelectItem,{value:"banana",children:"Banana"}),e.jsxRuntimeExports.jsx(r.SelectItem,{value:"blueberry",children:"Blueberry"}),e.jsxRuntimeExports.jsx(r.SelectItem,{value:"grapes",children:"Grapes"}),e.jsxRuntimeExports.jsx(r.SelectItem,{value:"pineapple",children:"Pineapple"})]})})]})}),p=()=>{const{savePage:i,syncState:s}=r.useSavePage(),{t:x}=a.useTranslation(),u=n.useMemo(()=>{switch(s){case"SAVING":return"animate-pulse bg-gray-500 text-gray-900";case"SAVED":return"bg-green-500 text-white hover:bg-green-600 hover:text-white";default:return"bg-gray-200 text-gray-500 hover:bg-gray-100"}},[s]);return e.jsxRuntimeExports.jsx("div",{className:"flex items-center",children:e.jsxRuntimeExports.jsxs(r.Tooltip,{children:[e.jsxRuntimeExports.jsx(r.TooltipTrigger,{asChild:!0,children:e.jsxRuntimeExports.jsxs(r.Toggle,{onClick:t=>{t.preventDefault(),i()},className:`flex h-auto w-20 items-center gap-x-1 rounded-full p-1 px-2 ${u}`,size:"sm",variant:"outline",children:[e.jsxRuntimeExports.jsx("svg",{fill:"currentColor",width:"16",height:"16",viewBox:"0 0 0.32 0.32",xmlns:"http://www.w3.org/2000/svg",children:e.jsxRuntimeExports.jsx("path",{fillRule:"evenodd",d:"M.274.086a.02.02 0 0 1 0 .028l-.12.12a.02.02 0 0 1-.028 0l-.06-.06A.02.02 0 0 1 .094.146L.14.192.246.086a.02.02 0 0 1 .028 0Z"})}),s==="SAVING"?"Saving...":s==="SAVED"?x("Saved"):"Save"]})}),e.jsxRuntimeExports.jsx(r.TooltipContent,{children:e.jsxRuntimeExports.jsx("p",{children:s==="SAVING"?"Saving...":s==="SAVED"?"Saved":"Save changes"})})]})})},m=()=>{const i=r.useBuilderProp("topBarComponents.left",[]),s=r.useBuilderProp("topBarComponents.center",[]),x=r.useBuilderProp("topBarComponents.right",[]),u=r.useBuilderProp("editable",!0);return e.jsxRuntimeExports.jsxs("div",{className:"flex h-14 items-center justify-between px-2",children:[e.jsxRuntimeExports.jsx("div",{className:"flex items-center space-x-2",children:e.jsxRuntimeExports.jsx("div",{className:"flex items-center space-x-2 font-bold",children:n.Children.toArray(i.map(t=>e.jsxRuntimeExports.jsx(n.Suspense,{fallback:e.jsxRuntimeExports.jsx(r.Skeleton,{className:"h-10"}),children:e.jsxRuntimeExports.jsx(t,{})})))})}),e.jsxRuntimeExports.jsx("div",{className:"flex items-center space-x-2",children:n.Children.toArray(s.map(t=>e.jsxRuntimeExports.jsx(n.Suspense,{fallback:e.jsxRuntimeExports.jsx(r.Skeleton,{className:"h-10"}),children:e.jsxRuntimeExports.jsx(t,{})})))}),e.jsxRuntimeExports.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsxRuntimeExports.jsx(c,{}),e.jsxRuntimeExports.jsx(r.Separator,{orientation:"vertical"}),u?e.jsxRuntimeExports.jsx(p,{}):null,n.Children.toArray(x.map(t=>e.jsxRuntimeExports.jsx(n.Suspense,{fallback:e.jsxRuntimeExports.jsx(r.Skeleton,{className:"h-10"}),children:e.jsxRuntimeExports.jsx(t,{})})))]})]})};exports.default=m;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-WKRPbKtm.cjs"),a=require("react"),o=require("lodash"),C=require("@radix-ui/react-icons"),k=require("unsplash-js"),t=require("./index-c8zW_D2V.cjs"),A=require("@react-hookz/web"),T=require("lucide-react");require("./Class-RZuPYbUS.cjs");require("clsx");require("tailwind-merge");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");require("jotai");require("flat-to-nested");require("redux-undo");require("./index-fwo4wa7u.cjs");require("react-i18next");const g=async(d,E)=>new Promise((l,i)=>{k.createApi({accessKey:E}).search.getPhotos(d).then(c=>{l(c)}).catch(c=>i(c))}),z=({isModalView:d,onSelect:E})=>{const l=t.useBuilderProp("unsplashAccessKey"),[i,f]=a.useState([]),[c,q]=a.useState(0),[u,S]=a.useState(),[x,b]=a.useState(),[I,R]=a.useState(0),[j,w]=A.useDebouncedState("",1e3),[h,m]=a.useState(!1),P=async s=>{if(o.isEmpty(j))return;let n=c+1;s&&(s.preventDefault(),n=1),m(!0),q(n);const p={query:j,page:n};u&&(p.orientation=u),x&&(p.color=x),g(p,l).then(r=>{var y,v,N;f(n===1?((y=r==null?void 0:r.response)==null?void 0:y.results)||[]:[...i,...((v=r==null?void 0:r.response)==null?void 0:v.results)||[]]),R((N=r==null?void 0:r.response)==null?void 0:N.total_pages),m(!1)}).catch(()=>{m(!1)})};return a.useEffect(()=>{if(!o.isEmpty(j)){m(!0);const s={query:j,page:1};u&&(s.orientation=u),x&&(s.color=x),q(1),g(s,l).then(n=>{var p,r;f(((p=n==null?void 0:n.response)==null?void 0:p.results)||[]),R((r=n==null?void 0:n.response)==null?void 0:r.total_pages),m(!1)}).catch(()=>{m(!1)})}},[u,x,j,l]),o.isEmpty(l)?e.jsxRuntimeExports.jsx("div",{className:"h-full flex flex-col items-center justify-center",children:e.jsxRuntimeExports.jsxs("p",{className:"max-w-3xl text-center text-gray-500",children:["To enable Unsplash, kindly provide your",e.jsxRuntimeExports.jsx("a",{href:"https://unsplash.com/documentation#public-authentication",className:"underline px-1 hover:text-blue-400",target:"_blank",rel:"noopener noreferrer",children:"Unsplash Access Key"})]})}):e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsxs("form",{className:"flex items-center rounded-md border bg-gray-100 p-px",children:[e.jsxRuntimeExports.jsx(t.Input,{type:"text",name:"query",className:"input",placeholder:'Try "dog" or "apple"',onChange:s=>w(s.target.value)}),e.jsxRuntimeExports.jsxs(t.Popover,{children:[e.jsxRuntimeExports.jsx(t.PopoverTrigger,{asChild:!0,className:"h-full w-10 cursor-pointer p-2.5 hover:bg-slate-200",children:e.jsxRuntimeExports.jsx(C.MixerHorizontalIcon,{})}),e.jsxRuntimeExports.jsx(t.PopoverContent,{side:d?"bottom":"right",className:"z-[9999] flex w-max items-center justify-center",children:e.jsxRuntimeExports.jsxs("div",{children:[e.jsxRuntimeExports.jsx("div",{className:"py-1 text-sm font-medium",children:"Orientation"}),e.jsxRuntimeExports.jsxs(t.Select,{defaultValue:u,onValueChange:s=>S(s),children:[e.jsxRuntimeExports.jsx(t.SelectTrigger,{className:"h-auto w-40 p-1 px-3",children:e.jsxRuntimeExports.jsx(t.SelectValue,{placeholder:"Select"})}),e.jsxRuntimeExports.jsxs(t.SelectContent,{className:"z-[9999]",children:[e.jsxRuntimeExports.jsx(t.SelectItem,{value:"",children:"All"}),e.jsxRuntimeExports.jsx(t.SelectItem,{value:"landscape",children:"Landscape"}),e.jsxRuntimeExports.jsx(t.SelectItem,{value:"portrait",children:"Portrait"}),e.jsxRuntimeExports.jsx(t.SelectItem,{value:"squarish",children:"Square"})]})]}),e.jsxRuntimeExports.jsx("div",{className:"pb-1 pt-2 text-sm font-medium",children:"Color"}),e.jsxRuntimeExports.jsxs(t.Select,{defaultValue:x,onValueChange:s=>b(s),children:[e.jsxRuntimeExports.jsx(t.SelectTrigger,{className:"h-auto w-40 p-1 px-3",children:e.jsxRuntimeExports.jsx(t.SelectValue,{placeholder:"Select"})}),e.jsxRuntimeExports.jsxs(t.SelectContent,{className:"z-[9999]",children:[e.jsxRuntimeExports.jsx(t.SelectItem,{value:"",children:"All"}),["black_and_white","black","white","yellow","orange","red","purple","magenta","green","teal","blue"].map(s=>e.jsxRuntimeExports.jsx(t.SelectItem,{value:s,children:o.startCase(s)},s))]})]})]})})]})]}),e.jsxRuntimeExports.jsxs(t.ScrollArea,{className:`h-full ${d&&!o.isEmpty(i)?"-mx-2 flex flex-wrap px-2":"-mx-2 flex flex-col pb-8 pt-2"}`,children:[o.isEmpty(i)&&!h&&e.jsxRuntimeExports.jsxs("div",{className:"flex flex-col items-center justify-center py-6",children:[e.jsxRuntimeExports.jsx("div",{className:"font-medium",children:"No Data"}),e.jsxRuntimeExports.jsx("div",{className:"text-sm text-gray-500",children:"Enter query and press enter"})]}),d?e.jsxRuntimeExports.jsx("div",{className:"h-full columns-5 py-2",children:i.map(s=>e.jsxRuntimeExports.jsx("div",{role:"button",tabIndex:0,className:"my-1 flex",onClick:()=>E(s.urls.regular),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.alt_description,src:s.urls.small})})},s.id))}):i.map(s=>e.jsxRuntimeExports.jsx("div",{className:"w-full px-2 py-1",children:e.jsxRuntimeExports.jsx("div",{className:"relative overflow-hidden rounded-md bg-cover bg-no-repeat",children:e.jsxRuntimeExports.jsx("img",{className:"h-auto cursor-pointer transition duration-300 ease-in-out hover:scale-105",alt:s.alt_description,src:s.urls.small})})},s.id)),h&&e.jsxRuntimeExports.jsxs("div",{className:"flex items-center justify-center py-8",children:[e.jsxRuntimeExports.jsx(T.Loader,{className:"animate-spin w-6 h-6"})," Loading..."]}),!o.isEmpty(i)&&c<I&&!h&&e.jsxRuntimeExports.jsx(t.Button,{size:"sm",variant:"link",className:"w-full",onClick:()=>P(void 0),disabled:h,children:h?"":"Load More"})]})]})};exports.default=z;exports.fetchImage=g;
|
|
@@ -1,60 +1,72 @@
|
|
|
1
|
-
import { j as e } from "./jsx-runtime-
|
|
2
|
-
import { useState as
|
|
3
|
-
import { isEmpty as
|
|
1
|
+
import { j as e } from "./jsx-runtime-qAwJ85SY.js";
|
|
2
|
+
import { useState as p, useEffect as D } from "react";
|
|
3
|
+
import { isEmpty as d, startCase as E } from "lodash";
|
|
4
4
|
import { MixerHorizontalIcon as L } from "@radix-ui/react-icons";
|
|
5
5
|
import { createApi as B } from "unsplash-js";
|
|
6
|
-
import {
|
|
7
|
-
import { I as U } from "./command-VHca6CcN.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";
|
|
6
|
+
import { i as F, bm as K, b1 as U, b2 as V, b3 as O, au as P, av as C, aw as S, ax as I, ay as h, bp as Q, B as H } from "./index-2EHcmZqL.js";
|
|
12
7
|
import { useDebouncedState as R } from "@react-hookz/web";
|
|
13
8
|
import { Loader as $ } from "lucide-react";
|
|
14
|
-
import "
|
|
15
|
-
import "@radix-ui/react-slot";
|
|
16
|
-
import "class-variance-authority";
|
|
17
|
-
import "./utils-dze1SGvB.js";
|
|
9
|
+
import "./Class-nQk08vqd.js";
|
|
18
10
|
import "clsx";
|
|
19
11
|
import "tailwind-merge";
|
|
20
|
-
import "@radix-ui/react-
|
|
21
|
-
import "
|
|
22
|
-
import "
|
|
23
|
-
import "
|
|
12
|
+
import "@radix-ui/react-toggle";
|
|
13
|
+
import "class-variance-authority";
|
|
14
|
+
import "@radix-ui/react-switch";
|
|
15
|
+
import "@radix-ui/react-slot";
|
|
16
|
+
import "@radix-ui/react-accordion";
|
|
17
|
+
import "@radix-ui/react-alert-dialog";
|
|
24
18
|
import "@radix-ui/react-dialog";
|
|
19
|
+
import "@radix-ui/react-label";
|
|
25
20
|
import "@radix-ui/react-scroll-area";
|
|
21
|
+
import "@radix-ui/react-tabs";
|
|
22
|
+
import "@radix-ui/react-tooltip";
|
|
26
23
|
import "@radix-ui/react-popover";
|
|
24
|
+
import "@radix-ui/react-menubar";
|
|
25
|
+
import "@radix-ui/react-hover-card";
|
|
27
26
|
import "@radix-ui/react-select";
|
|
27
|
+
import "@radix-ui/react-dropdown-menu";
|
|
28
|
+
import "@radix-ui/react-separator";
|
|
29
|
+
import "@radix-ui/react-toast";
|
|
30
|
+
import "cmdk";
|
|
31
|
+
import "@radix-ui/react-context-menu";
|
|
32
|
+
import "react-icons-picker";
|
|
33
|
+
import "react-dom";
|
|
34
|
+
import "react-quill";
|
|
35
|
+
import "jotai";
|
|
36
|
+
import "flat-to-nested";
|
|
37
|
+
import "redux-undo";
|
|
38
|
+
import "./index-gmZcUXyn.js";
|
|
39
|
+
import "react-i18next";
|
|
28
40
|
const k = async (x, g) => new Promise((o, r) => {
|
|
29
|
-
B({ accessKey: g }).search.getPhotos(x).then((
|
|
30
|
-
o(
|
|
31
|
-
}).catch((
|
|
32
|
-
}),
|
|
33
|
-
const o = F("unsplashAccessKey"), [r, j] =
|
|
34
|
-
if (
|
|
41
|
+
B({ accessKey: g }).search.getPhotos(x).then((i) => {
|
|
42
|
+
o(i);
|
|
43
|
+
}).catch((i) => r(i));
|
|
44
|
+
}), Te = ({ isModalView: x, onSelect: g }) => {
|
|
45
|
+
const o = F("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) => {
|
|
46
|
+
if (d(u))
|
|
35
47
|
return;
|
|
36
|
-
let t =
|
|
48
|
+
let t = i + 1;
|
|
37
49
|
s && (s.preventDefault(), t = 1), c(!0), v(t);
|
|
38
50
|
const m = { query: u, page: t };
|
|
39
|
-
|
|
40
|
-
var
|
|
41
|
-
j(t === 1 ? ((
|
|
51
|
+
l && (m.orientation = l), n && (m.color = n), k(m, o).then((a) => {
|
|
52
|
+
var b, N, w;
|
|
53
|
+
j(t === 1 ? ((b = a == null ? void 0 : a.response) == null ? void 0 : b.results) || [] : [...r, ...((N = a == null ? void 0 : a.response) == null ? void 0 : N.results) || []]), y((w = a == null ? void 0 : a.response) == null ? void 0 : w.total_pages), c(!1);
|
|
42
54
|
}).catch(() => {
|
|
43
55
|
c(!1);
|
|
44
56
|
});
|
|
45
57
|
};
|
|
46
58
|
return D(() => {
|
|
47
|
-
if (!
|
|
59
|
+
if (!d(u)) {
|
|
48
60
|
c(!0);
|
|
49
61
|
const s = { query: u, page: 1 };
|
|
50
|
-
|
|
62
|
+
l && (s.orientation = l), n && (s.color = n), v(1), k(s, o).then((t) => {
|
|
51
63
|
var m, a;
|
|
52
64
|
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);
|
|
53
65
|
}).catch(() => {
|
|
54
66
|
c(!1);
|
|
55
67
|
});
|
|
56
68
|
}
|
|
57
|
-
}, [
|
|
69
|
+
}, [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
70
|
"To enable Unsplash, kindly provide your",
|
|
59
71
|
/* @__PURE__ */ e.jsx(
|
|
60
72
|
"a",
|
|
@@ -69,7 +81,7 @@ const k = async (x, g) => new Promise((o, r) => {
|
|
|
69
81
|
] }) }) : /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
70
82
|
/* @__PURE__ */ e.jsxs("form", { className: "flex items-center rounded-md border bg-gray-100 p-px", children: [
|
|
71
83
|
/* @__PURE__ */ e.jsx(
|
|
72
|
-
|
|
84
|
+
K,
|
|
73
85
|
{
|
|
74
86
|
type: "text",
|
|
75
87
|
name: "query",
|
|
@@ -78,17 +90,17 @@ const k = async (x, g) => new Promise((o, r) => {
|
|
|
78
90
|
onChange: (s) => T(s.target.value)
|
|
79
91
|
}
|
|
80
92
|
),
|
|
81
|
-
/* @__PURE__ */ e.jsxs(
|
|
82
|
-
/* @__PURE__ */ e.jsx(
|
|
93
|
+
/* @__PURE__ */ e.jsxs(U, { children: [
|
|
94
|
+
/* @__PURE__ */ e.jsx(V, { asChild: !0, className: "h-full w-10 cursor-pointer p-2.5 hover:bg-slate-200", children: /* @__PURE__ */ e.jsx(L, {}) }),
|
|
83
95
|
/* @__PURE__ */ e.jsx(
|
|
84
|
-
|
|
96
|
+
O,
|
|
85
97
|
{
|
|
86
98
|
side: x ? "bottom" : "right",
|
|
87
99
|
className: "z-[9999] flex w-max items-center justify-center",
|
|
88
100
|
children: /* @__PURE__ */ e.jsxs("div", { children: [
|
|
89
101
|
/* @__PURE__ */ e.jsx("div", { className: "py-1 text-sm font-medium", children: "Orientation" }),
|
|
90
|
-
/* @__PURE__ */ e.jsxs(P, { defaultValue:
|
|
91
|
-
/* @__PURE__ */ e.jsx(
|
|
102
|
+
/* @__PURE__ */ e.jsxs(P, { defaultValue: l, onValueChange: (s) => A(s), children: [
|
|
103
|
+
/* @__PURE__ */ e.jsx(C, { className: "h-auto w-40 p-1 px-3", children: /* @__PURE__ */ e.jsx(S, { placeholder: "Select" }) }),
|
|
92
104
|
/* @__PURE__ */ e.jsxs(I, { className: "z-[9999]", children: [
|
|
93
105
|
/* @__PURE__ */ e.jsx(h, { value: "", children: "All" }),
|
|
94
106
|
/* @__PURE__ */ e.jsx(h, { value: "landscape", children: "Landscape" }),
|
|
@@ -97,8 +109,8 @@ const k = async (x, g) => new Promise((o, r) => {
|
|
|
97
109
|
] })
|
|
98
110
|
] }),
|
|
99
111
|
/* @__PURE__ */ e.jsx("div", { className: "pb-1 pt-2 text-sm font-medium", children: "Color" }),
|
|
100
|
-
/* @__PURE__ */ e.jsxs(P, { defaultValue:
|
|
101
|
-
/* @__PURE__ */ e.jsx(
|
|
112
|
+
/* @__PURE__ */ e.jsxs(P, { defaultValue: n, onValueChange: (s) => q(s), children: [
|
|
113
|
+
/* @__PURE__ */ e.jsx(C, { className: "h-auto w-40 p-1 px-3", children: /* @__PURE__ */ e.jsx(S, { placeholder: "Select" }) }),
|
|
102
114
|
/* @__PURE__ */ e.jsxs(I, { className: "z-[9999]", children: [
|
|
103
115
|
/* @__PURE__ */ e.jsx(h, { value: "", children: "All" }),
|
|
104
116
|
[
|
|
@@ -122,11 +134,11 @@ const k = async (x, g) => new Promise((o, r) => {
|
|
|
122
134
|
] })
|
|
123
135
|
] }),
|
|
124
136
|
/* @__PURE__ */ e.jsxs(
|
|
125
|
-
|
|
137
|
+
Q,
|
|
126
138
|
{
|
|
127
|
-
className: `h-full ${x && !
|
|
139
|
+
className: `h-full ${x && !d(r) ? "-mx-2 flex flex-wrap px-2" : "-mx-2 flex flex-col pb-8 pt-2"}`,
|
|
128
140
|
children: [
|
|
129
|
-
|
|
141
|
+
d(r) && !f && /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col items-center justify-center py-6", children: [
|
|
130
142
|
/* @__PURE__ */ e.jsx("div", { className: "font-medium", children: "No Data" }),
|
|
131
143
|
/* @__PURE__ */ e.jsx("div", { className: "text-sm text-gray-500", children: "Enter query and press enter" })
|
|
132
144
|
] }),
|
|
@@ -162,8 +174,8 @@ const k = async (x, g) => new Promise((o, r) => {
|
|
|
162
174
|
/* @__PURE__ */ e.jsx($, { className: "animate-spin w-6 h-6" }),
|
|
163
175
|
" Loading..."
|
|
164
176
|
] }),
|
|
165
|
-
!
|
|
166
|
-
|
|
177
|
+
!d(r) && i < z && !f && /* @__PURE__ */ e.jsx(
|
|
178
|
+
H,
|
|
167
179
|
{
|
|
168
180
|
size: "sm",
|
|
169
181
|
variant: "link",
|
|
@@ -179,6 +191,6 @@ const k = async (x, g) => new Promise((o, r) => {
|
|
|
179
191
|
] });
|
|
180
192
|
};
|
|
181
193
|
export {
|
|
182
|
-
|
|
194
|
+
Te as default,
|
|
183
195
|
k as fetchImage
|
|
184
196
|
};
|
|
@@ -1,49 +1,70 @@
|
|
|
1
|
-
import { j as e } from "./jsx-runtime-
|
|
1
|
+
import { j as e } from "./jsx-runtime-qAwJ85SY.js";
|
|
2
2
|
import { useState as i, useEffect as w } from "react";
|
|
3
3
|
import { isEmpty as g, map as b } from "lodash";
|
|
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 { u as j } from "./skeleton-CU_FIbg3.js";
|
|
9
|
-
import "@radix-ui/react-scroll-area";
|
|
10
|
-
import "./utils-dze1SGvB.js";
|
|
6
|
+
import { i as j, bp as A } from "./index-2EHcmZqL.js";
|
|
7
|
+
import "./Class-nQk08vqd.js";
|
|
11
8
|
import "clsx";
|
|
12
9
|
import "tailwind-merge";
|
|
13
|
-
import "@radix-ui/react-
|
|
10
|
+
import "@radix-ui/react-toggle";
|
|
14
11
|
import "class-variance-authority";
|
|
12
|
+
import "@radix-ui/react-switch";
|
|
13
|
+
import "@radix-ui/react-slot";
|
|
14
|
+
import "@radix-ui/react-accordion";
|
|
15
|
+
import "@radix-ui/react-alert-dialog";
|
|
16
|
+
import "@radix-ui/react-dialog";
|
|
17
|
+
import "@radix-ui/react-label";
|
|
18
|
+
import "@radix-ui/react-scroll-area";
|
|
19
|
+
import "@radix-ui/react-tabs";
|
|
15
20
|
import "@radix-ui/react-tooltip";
|
|
21
|
+
import "@radix-ui/react-popover";
|
|
22
|
+
import "@radix-ui/react-menubar";
|
|
23
|
+
import "@radix-ui/react-hover-card";
|
|
24
|
+
import "@radix-ui/react-select";
|
|
25
|
+
import "@radix-ui/react-dropdown-menu";
|
|
26
|
+
import "@radix-ui/react-separator";
|
|
16
27
|
import "@radix-ui/react-toast";
|
|
17
|
-
|
|
18
|
-
|
|
28
|
+
import "cmdk";
|
|
29
|
+
import "@radix-ui/react-context-menu";
|
|
30
|
+
import "react-icons-picker";
|
|
31
|
+
import "react-dom";
|
|
32
|
+
import "react-quill";
|
|
33
|
+
import "flat-to-nested";
|
|
34
|
+
import "redux-undo";
|
|
35
|
+
import "./index-gmZcUXyn.js";
|
|
36
|
+
import "@react-hookz/web";
|
|
37
|
+
import "react-i18next";
|
|
38
|
+
const R = F([]), fe = ({ isModalView: s, onSelect: n }) => {
|
|
39
|
+
const v = j("uploadMediaCallback", () => ""), m = j("fetchMediaCallback", () => []), [r, o] = E(R), [l, p] = i(!1), [u, x] = i(!1), [d, c] = i(), [f, y] = i("");
|
|
19
40
|
w(() => {
|
|
20
41
|
(async () => {
|
|
21
|
-
|
|
22
|
-
const t = await
|
|
23
|
-
|
|
42
|
+
x(!0);
|
|
43
|
+
const t = await m();
|
|
44
|
+
o(t || []), x(!1);
|
|
24
45
|
})();
|
|
25
|
-
}, [
|
|
46
|
+
}, [m, o]);
|
|
26
47
|
const N = (t) => {
|
|
27
|
-
var
|
|
28
|
-
t && ((h = (
|
|
48
|
+
var a, h;
|
|
49
|
+
t && ((h = (a = t == null ? void 0 : t.target) == null ? void 0 : a.files) == null ? void 0 : h.length) > 0 && c(t.target.files[0]);
|
|
29
50
|
}, I = async () => {
|
|
30
|
-
|
|
51
|
+
p(!0);
|
|
31
52
|
try {
|
|
32
|
-
const { url: t } = await v(
|
|
33
|
-
n(t),
|
|
34
|
-
const
|
|
35
|
-
a
|
|
53
|
+
const { url: t } = await v(d);
|
|
54
|
+
n(t), c(void 0);
|
|
55
|
+
const a = await m();
|
|
56
|
+
o(a);
|
|
36
57
|
} catch (t) {
|
|
37
|
-
|
|
58
|
+
o([]), y((t == null ? void 0 : t.message) || "Something went wrong.");
|
|
38
59
|
}
|
|
39
|
-
|
|
60
|
+
p(!1);
|
|
40
61
|
};
|
|
41
62
|
return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
42
|
-
|
|
63
|
+
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: [
|
|
43
64
|
/* @__PURE__ */ e.jsx(
|
|
44
65
|
"img",
|
|
45
66
|
{
|
|
46
|
-
src: URL.createObjectURL(
|
|
67
|
+
src: URL.createObjectURL(d),
|
|
47
68
|
alt: "",
|
|
48
69
|
className: "h-auto w-full max-w-sm rounded-md max-h-96 object-contain"
|
|
49
70
|
}
|
|
@@ -55,21 +76,21 @@ const R = F([]), W = ({ isModalView: s, onSelect: n }) => {
|
|
|
55
76
|
{
|
|
56
77
|
type: "button",
|
|
57
78
|
onClick: I,
|
|
58
|
-
disabled:
|
|
79
|
+
disabled: l,
|
|
59
80
|
className: "flex items-center rounded-full bg-blue-500 px-3 py-1 text-sm text-white hover:bg-blue-600 hover:text-white",
|
|
60
81
|
children: [
|
|
61
|
-
|
|
82
|
+
l ? /* @__PURE__ */ e.jsx(C, { className: "animate-spin" }) : /* @__PURE__ */ e.jsx(U, { className: "animate-bounce" }),
|
|
62
83
|
" ",
|
|
63
|
-
|
|
84
|
+
l ? "Uploading..." : "Upload"
|
|
64
85
|
]
|
|
65
86
|
}
|
|
66
87
|
),
|
|
67
|
-
!
|
|
88
|
+
!l && /* @__PURE__ */ e.jsxs(
|
|
68
89
|
"button",
|
|
69
90
|
{
|
|
70
91
|
type: "button",
|
|
71
92
|
className: "flex items-center rounded-full border border-gray-300 px-3 py-1 text-sm hover:bg-gray-200",
|
|
72
|
-
onClick: () =>
|
|
93
|
+
onClick: () => c(void 0),
|
|
73
94
|
children: [
|
|
74
95
|
/* @__PURE__ */ e.jsx(k, {}),
|
|
75
96
|
" Cancel"
|
|
@@ -85,16 +106,16 @@ const R = F([]), W = ({ isModalView: s, onSelect: n }) => {
|
|
|
85
106
|
/* @__PURE__ */ e.jsx("input", { type: "file", id: s ? "upload-in-modal" : "upload-in-panel", hidden: !0, onChange: N })
|
|
86
107
|
] }),
|
|
87
108
|
/* @__PURE__ */ e.jsxs(A, { className: `-mx-2 flex h-full flex-col pb-8 pt-2 ${s ? "px-2" : ""} pt-2`, children: [
|
|
88
|
-
g(
|
|
89
|
-
g(
|
|
90
|
-
s ? /* @__PURE__ */ e.jsx("div", { className: "h-full columns-5 py-2", children: b(
|
|
109
|
+
g(r) && u && /* @__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..." }) }),
|
|
110
|
+
g(r) && !u && /* @__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" }) }),
|
|
111
|
+
s ? /* @__PURE__ */ e.jsx("div", { className: "h-full columns-5 py-2", children: b(r, (t) => /* @__PURE__ */ e.jsx("div", { role: "button", tabIndex: 0, className: "my-1 flex", onClick: () => n(t.url), children: /* @__PURE__ */ e.jsx("div", { className: "relative overflow-hidden rounded-md bg-cover bg-no-repeat", children: /* @__PURE__ */ e.jsx(
|
|
91
112
|
"img",
|
|
92
113
|
{
|
|
93
114
|
className: "h-auto flex-1 cursor-pointer rounded-md transition duration-300 ease-in-out hover:scale-105",
|
|
94
115
|
alt: t.name,
|
|
95
116
|
src: t.thumbUrl
|
|
96
117
|
}
|
|
97
|
-
) }) }, t.id)) }) : b(
|
|
118
|
+
) }) }, t.id)) }) : b(r, (t) => (
|
|
98
119
|
// TODO: Drag and Drop Image to Canvas from Here use `pic.url` for image quality
|
|
99
120
|
/* @__PURE__ */ e.jsx("div", { role: "button", tabIndex: 0, className: "px-2 py-1", onClick: () => n(t.url), children: /* @__PURE__ */ e.jsx("div", { className: "relative overflow-hidden rounded-md bg-cover bg-no-repeat", children: /* @__PURE__ */ e.jsx(
|
|
100
121
|
"img",
|
|
@@ -109,5 +130,5 @@ const R = F([]), W = ({ isModalView: s, onSelect: n }) => {
|
|
|
109
130
|
] });
|
|
110
131
|
};
|
|
111
132
|
export {
|
|
112
|
-
|
|
133
|
+
fe as default
|
|
113
134
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-WKRPbKtm.cjs"),r=require("react"),a=require("lodash"),m=require("@radix-ui/react-icons"),q=require("jotai"),p=require("./index-c8zW_D2V.cjs");require("./Class-RZuPYbUS.cjs");require("clsx");require("tailwind-merge");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");require("flat-to-nested");require("redux-undo");require("./index-fwo4wa7u.cjs");require("@react-hookz/web");require("react-i18next");const N=q.atom([]),I=({isModalView:t,onSelect:u})=>{const E=p.useBuilderProp("uploadMediaCallback",()=>""),x=p.useBuilderProp("fetchMediaCallback",()=>[]),[i,n]=q.useAtom(N),[o,j]=r.useState(!1),[h,f]=r.useState(!1),[c,d]=r.useState(),[g,R]=r.useState("");r.useEffect(()=>{(async()=>{f(!0);const s=await x();n(s||[]),f(!1)})()},[x,n]);const v=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])},y=async()=>{j(!0);try{const{url:s}=await E(c);u(s),d(void 0);const l=await x();n(l)}catch(s){n([]),R((s==null?void 0:s.message)||"Something went wrong.")}j(!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 w-full max-w-sm rounded-md max-h-96 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:y,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: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:[a.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..."})}),a.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:a.map(i,s=>e.jsxRuntimeExports.jsx("div",{role:"button",tabIndex:0,className:"my-1 flex",onClick:()=>u(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))}):a.map(i,s=>e.jsxRuntimeExports.jsx("div",{role:"button",tabIndex:0,className:"px-2 py-1",onClick:()=>u(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=I;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-WKRPbKtm.cjs"),x=require("react"),h=require("lodash"),t=require("./index-c8zW_D2V.cjs"),g=require("./index-aGgHTZqR.cjs"),R=require("./form-Osm1AmO5.cjs"),f=require("./index-3_eUgIcu.cjs");require("./Class-RZuPYbUS.cjs");require("clsx");require("tailwind-merge");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("jotai");require("flat-to-nested");require("redux-undo");require("./index-fwo4wa7u.cjs");require("@react-hookz/web");require("react-i18next");require("./lib.cjs");require("himalaya");require("@mhsdesign/jit-browser-tailwindcss");require("@bobthered/tailwindcss-palette-generator");require("@tailwindcss/forms");require("@tailwindcss/typography");require("@tailwindcss/aspect-ratio");require("@tailwindcss/line-clamp");require("@rjsf/core");require("@rjsf/validator-ajv8");require("i18next");require("@floating-ui/react-dom");require("react-textarea-autosize");require("flagged");require("react-dnd");require("@minoru/react-dnd-treeview");require("react-hotkeys-hook");require("sonner");require("lucide-react");const b=({closeModal:i})=>{var q,l;const u=f.useAddPage(),[r,m]=x.useState({name:"",slug:"",blocks:[],type:"STATIC",seoData:{}}),p=()=>{u.mutate(r,{onSuccess:()=>i()})},j=({formData:n},s)=>{m(o=>{var d,c;const a={[s]:n[s]};return s==="name"?a.slug=h.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("__","_")),{...o,...a}})},P={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:P,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||((q=r.name)==null?void 0:q.length)<2||((l=r.slug)==null?void 0:l.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,{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;
|