@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,57 +1,67 @@
|
|
|
1
|
-
import { j as e } from "./jsx-runtime-
|
|
2
|
-
import { KeyboardIcon as U, PlusIcon as J, Half2Icon as
|
|
3
|
-
import j, {
|
|
1
|
+
import { j as e } from "./jsx-runtime-WbnYoNE9.js";
|
|
2
|
+
import { KeyboardIcon as U, PlusIcon as J, Half2Icon as q } from "@radix-ui/react-icons";
|
|
3
|
+
import j, { useState as p, useEffect as W, useMemo as Y, lazy as w, Suspense as N } from "react";
|
|
4
4
|
import { useAtom as O } from "jotai";
|
|
5
|
-
import { filter as y, map as K, isNull as
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
5
|
+
import { filter as y, map as K, isNull as Z, find as $, isEmpty as G, each as Q, get as X } from "lodash-es";
|
|
6
|
+
import { ad as M, ae as H, af as F, ag as R, ah as ee, A as se, a as re, b as ae, c as le, d as ie, e as te, f as oe, g as ne, ai as ce, y as de, C as me, aj as xe, ak as pe, al as he, am as ue, an as E, ao as fe, ap as je, aq as ve, B as v, ar as ge, as as B, h as T, at as be, S as z, au as V, av as I, aw as A, ax as S } from "./index-Gk6sASBd.js";
|
|
7
|
+
import { ListTreeIcon as _, DatabaseIcon as Ne } from "lucide-react";
|
|
8
|
+
import { getChaiDataProviders as ye } from "@chaibuilder/runtime";
|
|
9
9
|
import { useTranslation as g } from "react-i18next";
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import
|
|
15
|
-
import
|
|
16
|
-
import
|
|
17
|
-
import
|
|
18
|
-
import "@radix-ui/react-slot";
|
|
19
|
-
import "class-variance-authority";
|
|
20
|
-
import "./utils-dze1SGvB.js";
|
|
10
|
+
import { J as we, a as ke, d as Ce } from "./index-e0c8PmRQ.js";
|
|
11
|
+
import { E as De } from "./index-SkyM3d6Q.js";
|
|
12
|
+
import { O as i } from "./STRINGS--j49GZJP.js";
|
|
13
|
+
import { c as Te } from "./Functions-7jnEwJyw.js";
|
|
14
|
+
import "./_commonjsHelpers-UyOWmZb0.js";
|
|
15
|
+
import "@react-hookz/web";
|
|
16
|
+
import "./MODIFIERS-dytZ-osO.js";
|
|
17
|
+
import "./Class-lGzsNBOK.js";
|
|
21
18
|
import "clsx";
|
|
22
19
|
import "tailwind-merge";
|
|
23
|
-
import "@radix-ui/react-
|
|
24
|
-
import "
|
|
20
|
+
import "@radix-ui/react-toggle";
|
|
21
|
+
import "class-variance-authority";
|
|
22
|
+
import "@radix-ui/react-switch";
|
|
23
|
+
import "@radix-ui/react-slot";
|
|
24
|
+
import "@radix-ui/react-accordion";
|
|
25
|
+
import "@radix-ui/react-alert-dialog";
|
|
25
26
|
import "@radix-ui/react-dialog";
|
|
26
|
-
import "@radix-ui/react-
|
|
27
|
-
import "./MODIFIERS-CNqNUapY.js";
|
|
27
|
+
import "@radix-ui/react-label";
|
|
28
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";
|
|
29
41
|
import "react-dom";
|
|
30
|
-
import "
|
|
42
|
+
import "react-quill";
|
|
31
43
|
import "i18next";
|
|
44
|
+
import "@floating-ui/react-dom";
|
|
32
45
|
import "flagged";
|
|
33
46
|
import "react-hotkeys-hook";
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
const { t: a } = g(), [l, u] = h(null);
|
|
39
|
-
return Z(() => {
|
|
40
|
-
s && (s.mockFn ? s.mockFn : s.dataFn)().then((n) => u(n));
|
|
47
|
+
const Ae = ({ provider: s, onClose: o }) => {
|
|
48
|
+
const { t: l } = g(), [a, h] = p(null);
|
|
49
|
+
return W(() => {
|
|
50
|
+
s && (s.mockFn ? s.mockFn : s.dataFn)().then((n) => h(n));
|
|
41
51
|
}, [s]), s ? /* @__PURE__ */ e.jsx(M, { onOpenChange: (d) => d ? "" : o(), defaultOpen: !0, children: /* @__PURE__ */ e.jsxs(H, { children: [
|
|
42
52
|
/* @__PURE__ */ e.jsxs(F, { children: [
|
|
43
53
|
/* @__PURE__ */ e.jsxs(R, { children: [
|
|
44
|
-
|
|
54
|
+
l("data_provider"),
|
|
45
55
|
": ",
|
|
46
56
|
s.name
|
|
47
57
|
] }),
|
|
48
|
-
/* @__PURE__ */ e.jsx(
|
|
58
|
+
/* @__PURE__ */ e.jsx(ee, { children: s.description })
|
|
49
59
|
] }),
|
|
50
|
-
/* @__PURE__ */ e.jsx(
|
|
51
|
-
|
|
60
|
+
/* @__PURE__ */ e.jsx(De, { children: /* @__PURE__ */ e.jsx(
|
|
61
|
+
we,
|
|
52
62
|
{
|
|
53
|
-
data:
|
|
54
|
-
shouldExpandNode:
|
|
63
|
+
data: a,
|
|
64
|
+
shouldExpandNode: ke,
|
|
55
65
|
style: {
|
|
56
66
|
...Ce,
|
|
57
67
|
container: "max-h-[80vh] overflow-y-auto text-[12px] leading-[1.5] tracking-wide font-mono",
|
|
@@ -62,55 +72,55 @@ const Se = ({ provider: s, onClose: o }) => {
|
|
|
62
72
|
) })
|
|
63
73
|
] }) }) : null;
|
|
64
74
|
};
|
|
65
|
-
function
|
|
75
|
+
function Se({
|
|
66
76
|
children: s,
|
|
67
77
|
name: o,
|
|
68
|
-
onRemove:
|
|
78
|
+
onRemove: l
|
|
69
79
|
}) {
|
|
70
|
-
const { t:
|
|
71
|
-
return /* @__PURE__ */ e.jsxs(
|
|
72
|
-
/* @__PURE__ */ e.jsx(
|
|
73
|
-
/* @__PURE__ */ e.jsxs(
|
|
74
|
-
/* @__PURE__ */ e.jsxs(
|
|
80
|
+
const { t: a } = g();
|
|
81
|
+
return /* @__PURE__ */ e.jsxs(se, { children: [
|
|
82
|
+
/* @__PURE__ */ e.jsx(re, { asChild: !0, children: s }),
|
|
83
|
+
/* @__PURE__ */ e.jsxs(ae, { children: [
|
|
84
|
+
/* @__PURE__ */ e.jsxs(le, { children: [
|
|
75
85
|
/* @__PURE__ */ e.jsx(
|
|
76
|
-
|
|
86
|
+
ie,
|
|
77
87
|
{
|
|
78
|
-
dangerouslySetInnerHTML: { __html:
|
|
88
|
+
dangerouslySetInnerHTML: { __html: a("remove_provider_confirmation").replace("{name}", o) }
|
|
79
89
|
}
|
|
80
90
|
),
|
|
81
|
-
/* @__PURE__ */ e.jsx(
|
|
91
|
+
/* @__PURE__ */ e.jsx(te, { children: a("remove_provider_warning") })
|
|
82
92
|
] }),
|
|
83
|
-
/* @__PURE__ */ e.jsxs(
|
|
84
|
-
/* @__PURE__ */ e.jsx(
|
|
85
|
-
/* @__PURE__ */ e.jsx(
|
|
93
|
+
/* @__PURE__ */ e.jsxs(oe, { children: [
|
|
94
|
+
/* @__PURE__ */ e.jsx(ne, { children: a("cancel") }),
|
|
95
|
+
/* @__PURE__ */ e.jsx(ce, { onClick: l, className: "bg-red-600 hover:bg-red-700", children: a("remove") })
|
|
86
96
|
] })
|
|
87
97
|
] })
|
|
88
98
|
] });
|
|
89
99
|
}
|
|
90
100
|
const _e = () => {
|
|
91
|
-
const { t: s } = g(), o = Y(() =>
|
|
92
|
-
y(o, (r) => K(
|
|
93
|
-
), [k,
|
|
101
|
+
const { t: s } = g(), o = Y(() => ye(), []), [l, a] = de(), [, h] = O(me), [d, n] = p(
|
|
102
|
+
y(o, (r) => K(l, "providerKey").includes(r.providerKey))
|
|
103
|
+
), [k, u] = p(""), [b, c] = p(null), C = y(
|
|
94
104
|
o.map((r) => K(d, "providerKey").includes(r.providerKey) ? null : { value: r.providerKey, label: r.name }),
|
|
95
|
-
(r) => !
|
|
96
|
-
),
|
|
97
|
-
const x =
|
|
98
|
-
n((m) => [...m, x]),
|
|
105
|
+
(r) => !Z(r)
|
|
106
|
+
), D = (r) => {
|
|
107
|
+
const x = $(o, { providerKey: r });
|
|
108
|
+
n((m) => [...m, x]), a((m) => [...m, { providerKey: x.providerKey, args: {} }]), u(""), h("UNSAVED");
|
|
99
109
|
}, t = (r) => {
|
|
100
|
-
n((x) => y(x, (m) => m.providerKey !== r.providerKey)),
|
|
110
|
+
n((x) => y(x, (m) => m.providerKey !== r.providerKey)), a((x) => y(x, (m) => m.providerKey !== r.providerKey)), h("UNSAVED");
|
|
101
111
|
}, f = (r) => c(r);
|
|
102
|
-
return
|
|
112
|
+
return G(o) ? /* @__PURE__ */ e.jsx("div", { children: /* @__PURE__ */ e.jsxs("p", { className: "mb-1.5 p-4 text-xs text-gray-500", children: [
|
|
103
113
|
s("no_data_providers"),
|
|
104
114
|
/* @__PURE__ */ e.jsx("br", {}),
|
|
105
115
|
/* @__PURE__ */ e.jsx("a", { className: "text-blue-500", href: "https://chaibuilder.com/docs/registering-data-providers", target: "_blank", children: s("learn_more") })
|
|
106
116
|
] }) }) : /* @__PURE__ */ e.jsxs("div", { className: "px-1", children: [
|
|
107
117
|
/* @__PURE__ */ e.jsx("br", {}),
|
|
108
118
|
/* @__PURE__ */ e.jsx("label", { children: /* @__PURE__ */ e.jsx("p", { className: "mb-1.5 text-xs text-gray-500", children: s("add_data_providers") }) }),
|
|
109
|
-
/* @__PURE__ */ e.jsx("div", { className: "flex items-center space-x-1", children: /* @__PURE__ */ e.jsxs(
|
|
110
|
-
/* @__PURE__ */ e.jsx(
|
|
111
|
-
/* @__PURE__ */ e.jsxs(
|
|
112
|
-
/* @__PURE__ */ e.jsx(
|
|
113
|
-
|
|
119
|
+
/* @__PURE__ */ e.jsx("div", { className: "flex items-center space-x-1", children: /* @__PURE__ */ e.jsxs(xe, { value: k, onValueChange: (r) => D(r), children: [
|
|
120
|
+
/* @__PURE__ */ e.jsx(pe, { className: "w-full", children: /* @__PURE__ */ e.jsx(he, { placeholder: s("select_provider") }) }),
|
|
121
|
+
/* @__PURE__ */ e.jsxs(ue, { children: [
|
|
122
|
+
/* @__PURE__ */ e.jsx(E, { value: "", children: s("choose") }),
|
|
123
|
+
C.map((r) => /* @__PURE__ */ e.jsx(E, { value: r.value, children: r.label }, r.value))
|
|
114
124
|
] })
|
|
115
125
|
] }) }),
|
|
116
126
|
/* @__PURE__ */ e.jsx("br", {}),
|
|
@@ -159,7 +169,7 @@ const _e = () => {
|
|
|
159
169
|
]
|
|
160
170
|
}
|
|
161
171
|
),
|
|
162
|
-
/* @__PURE__ */ e.jsx(
|
|
172
|
+
/* @__PURE__ */ e.jsx(Se, { onRemove: () => t(r), name: r.name, children: /* @__PURE__ */ e.jsxs("button", { className: "inline-flex h-9 items-center justify-center rounded-md px-3 text-xs font-medium text-red-500 underline-offset-4 ring-offset-background transition-colors hover:underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50", children: [
|
|
163
173
|
/* @__PURE__ */ e.jsxs(
|
|
164
174
|
"svg",
|
|
165
175
|
{
|
|
@@ -187,7 +197,7 @@ const _e = () => {
|
|
|
187
197
|
},
|
|
188
198
|
r.providerKey
|
|
189
199
|
)) }),
|
|
190
|
-
/* @__PURE__ */ e.jsx(
|
|
200
|
+
/* @__PURE__ */ e.jsx(Ae, { onClose: () => c(null), provider: b })
|
|
191
201
|
] })
|
|
192
202
|
] });
|
|
193
203
|
}, Pe = () => {
|
|
@@ -195,35 +205,35 @@ const _e = () => {
|
|
|
195
205
|
"ctrl + Z": "Undo",
|
|
196
206
|
"ctrl + Y": "Redo",
|
|
197
207
|
"ctrl + D": "Duplicate"
|
|
198
|
-
},
|
|
208
|
+
}, l = {
|
|
199
209
|
// "ctrl + /": "Rename block",
|
|
200
210
|
"ctrl + S": "Save page",
|
|
201
211
|
esc: "Deselect blocks",
|
|
202
212
|
del: "Delete block"
|
|
203
213
|
};
|
|
204
214
|
return /* @__PURE__ */ e.jsxs(M, { children: [
|
|
205
|
-
/* @__PURE__ */ e.jsx(
|
|
206
|
-
/* @__PURE__ */ e.jsx(
|
|
207
|
-
/* @__PURE__ */ e.jsx(
|
|
215
|
+
/* @__PURE__ */ e.jsx(fe, { children: /* @__PURE__ */ e.jsxs(je, { children: [
|
|
216
|
+
/* @__PURE__ */ e.jsx(ve, { children: /* @__PURE__ */ e.jsx(v, { size: "sm", className: "w-10", variant: "outline", children: /* @__PURE__ */ e.jsx(U, {}) }) }),
|
|
217
|
+
/* @__PURE__ */ e.jsx(ge, { children: /* @__PURE__ */ e.jsx("p", { children: s("Keyboard shortcuts") }) })
|
|
208
218
|
] }) }),
|
|
209
219
|
/* @__PURE__ */ e.jsxs(H, { className: "sm:max-w-[525px]", children: [
|
|
210
220
|
/* @__PURE__ */ e.jsx(F, { children: /* @__PURE__ */ e.jsx(R, { children: s("Keyboard shortcuts") }) }),
|
|
211
221
|
/* @__PURE__ */ e.jsx("div", { children: /* @__PURE__ */ e.jsxs("div", { className: "grid grid-cols-2", children: [
|
|
212
|
-
/* @__PURE__ */ e.jsx("div", { className: "mr-8 flex flex-col space-y-2 border-r border-gray-200", children: Object.keys(o).map((
|
|
213
|
-
/* @__PURE__ */ e.jsx(
|
|
214
|
-
/* @__PURE__ */ e.jsx("div", { children: s(o[
|
|
215
|
-
] },
|
|
216
|
-
/* @__PURE__ */ e.jsx("div", { className: "flex flex-col space-y-2", children: Object.keys(
|
|
217
|
-
/* @__PURE__ */ e.jsx(
|
|
218
|
-
/* @__PURE__ */ e.jsx("div", { children: s(a
|
|
219
|
-
] },
|
|
222
|
+
/* @__PURE__ */ e.jsx("div", { className: "mr-8 flex flex-col space-y-2 border-r border-gray-200", children: Object.keys(o).map((a) => /* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-4", children: [
|
|
223
|
+
/* @__PURE__ */ e.jsx(B, { variant: "outline", className: "border border-gray-600 p-1 px-2", children: s(a) }),
|
|
224
|
+
/* @__PURE__ */ e.jsx("div", { children: s(o[a]) })
|
|
225
|
+
] }, a)) }),
|
|
226
|
+
/* @__PURE__ */ e.jsx("div", { className: "flex flex-col space-y-2", children: Object.keys(l).map((a) => /* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-4", children: [
|
|
227
|
+
/* @__PURE__ */ e.jsx(B, { variant: "outline", className: "border border-gray-600 p-1 px-2", children: s(a) }),
|
|
228
|
+
/* @__PURE__ */ e.jsx("div", { children: s(l[a]) })
|
|
229
|
+
] }, a)) })
|
|
220
230
|
] }) })
|
|
221
231
|
] })
|
|
222
232
|
] });
|
|
223
|
-
}, Ke = w(() => import("./AddBlocks-
|
|
233
|
+
}, Ke = w(() => import("./AddBlocks-l1JENNvq.js")), P = w(() => import("./ListTree-cZ-Ihlt3.js")), Ee = w(() => import("./BrandingOptions-udtH5yJs.js")), Be = w(() => import("./index-Gk6sASBd.js").then((s) => s.cq));
|
|
224
234
|
let L = null;
|
|
225
|
-
const
|
|
226
|
-
const s = T("sideBarComponents.top", []), o = T("sideBarComponents.bottom", []), [
|
|
235
|
+
const Ts = () => {
|
|
236
|
+
const s = T("sideBarComponents.top", []), o = T("sideBarComponents.bottom", []), [l, a] = O(be), [h, d] = p(l), [n, k] = p(null), { t: u } = g(), b = {
|
|
227
237
|
"add-blocks": Ke,
|
|
228
238
|
[i]: P,
|
|
229
239
|
"branding-options": Ee,
|
|
@@ -233,19 +243,19 @@ const js = () => {
|
|
|
233
243
|
b[t] = f;
|
|
234
244
|
});
|
|
235
245
|
const c = (t) => {
|
|
236
|
-
clearTimeout(L),
|
|
237
|
-
},
|
|
238
|
-
function
|
|
246
|
+
clearTimeout(L), l !== i && t === i ? L = setTimeout(() => a(i), 500) : d(t), a(t);
|
|
247
|
+
}, C = T("dataBindingSupport", !1);
|
|
248
|
+
function D() {
|
|
239
249
|
const t = setTimeout(() => {
|
|
240
250
|
n && (c(i), clearTimeout(n));
|
|
241
251
|
}, 500);
|
|
242
252
|
k(t);
|
|
243
253
|
}
|
|
244
254
|
return /* @__PURE__ */ e.jsxs("div", { className: "relative flex", children: [
|
|
245
|
-
|
|
255
|
+
l !== i ? /* @__PURE__ */ e.jsx(
|
|
246
256
|
"div",
|
|
247
257
|
{
|
|
248
|
-
onMouseEnter:
|
|
258
|
+
onMouseEnter: D,
|
|
249
259
|
onClick: () => c(i),
|
|
250
260
|
className: "fixed inset-0 z-[50] bg-black/20"
|
|
251
261
|
}
|
|
@@ -259,7 +269,7 @@ const js = () => {
|
|
|
259
269
|
c("add-blocks");
|
|
260
270
|
},
|
|
261
271
|
size: "sm",
|
|
262
|
-
variant:
|
|
272
|
+
variant: l === "add-blocks" ? "default" : "outline",
|
|
263
273
|
children: /* @__PURE__ */ e.jsx(J, { className: "text-xl" })
|
|
264
274
|
}
|
|
265
275
|
),
|
|
@@ -268,7 +278,7 @@ const js = () => {
|
|
|
268
278
|
{
|
|
269
279
|
onClick: () => c(i),
|
|
270
280
|
size: "sm",
|
|
271
|
-
variant:
|
|
281
|
+
variant: l === i ? "default" : "outline",
|
|
272
282
|
children: /* @__PURE__ */ e.jsx(_, { className: "w-4" })
|
|
273
283
|
}
|
|
274
284
|
),
|
|
@@ -277,18 +287,18 @@ const js = () => {
|
|
|
277
287
|
{
|
|
278
288
|
onClick: () => c("branding-options"),
|
|
279
289
|
size: "sm",
|
|
280
|
-
variant:
|
|
281
|
-
children: /* @__PURE__ */ e.jsx(
|
|
290
|
+
variant: l === "branding-options" ? "default" : "outline",
|
|
291
|
+
children: /* @__PURE__ */ e.jsx(q, { className: "w-4 max-w-[40px] text-xs" })
|
|
282
292
|
}
|
|
283
293
|
),
|
|
284
294
|
j.Children.toArray(
|
|
285
|
-
s.map(({ name: t, icon: f }) => /* @__PURE__ */ e.jsx(N, { fallback: /* @__PURE__ */ e.jsx(
|
|
295
|
+
s.map(({ name: t, icon: f }) => /* @__PURE__ */ e.jsx(N, { fallback: /* @__PURE__ */ e.jsx(z, { className: "h-10" }), children: /* @__PURE__ */ e.jsx(
|
|
286
296
|
v,
|
|
287
297
|
{
|
|
288
298
|
onClick: () => c(t),
|
|
289
299
|
size: "sm",
|
|
290
300
|
className: "w-10",
|
|
291
|
-
variant:
|
|
301
|
+
variant: l === t ? "default" : "outline",
|
|
292
302
|
children: /* @__PURE__ */ e.jsx(f, {})
|
|
293
303
|
}
|
|
294
304
|
) }))
|
|
@@ -297,11 +307,11 @@ const js = () => {
|
|
|
297
307
|
/* @__PURE__ */ e.jsxs("div", { className: "relative z-[100] flex w-14 flex-col items-center space-y-2 pb-2", children: [
|
|
298
308
|
/* @__PURE__ */ e.jsx(Pe, {}),
|
|
299
309
|
j.Children.toArray(
|
|
300
|
-
o.map((t) => /* @__PURE__ */ e.jsx(N, { fallback: /* @__PURE__ */ e.jsx(
|
|
310
|
+
o.map((t) => /* @__PURE__ */ e.jsx(N, { fallback: /* @__PURE__ */ e.jsx(z, { className: "h-10" }), children: /* @__PURE__ */ e.jsx(t, {}) }))
|
|
301
311
|
)
|
|
302
312
|
] })
|
|
303
313
|
] }),
|
|
304
|
-
|
|
314
|
+
l !== i ? /* @__PURE__ */ e.jsx(
|
|
305
315
|
"div",
|
|
306
316
|
{
|
|
307
317
|
className: "absolute left-14 z-[50] h-full w-fit translate-x-0 border-r bg-background transition-all duration-500 ease-in-out",
|
|
@@ -320,7 +330,7 @@ const js = () => {
|
|
|
320
330
|
onMouseEnter: () => {
|
|
321
331
|
n && clearTimeout(n);
|
|
322
332
|
},
|
|
323
|
-
children: j.createElement(X(b,
|
|
333
|
+
children: j.createElement(X(b, l, () => /* @__PURE__ */ e.jsx("div", {})))
|
|
324
334
|
}
|
|
325
335
|
)
|
|
326
336
|
}
|
|
@@ -335,28 +345,28 @@ const js = () => {
|
|
|
335
345
|
/* @__PURE__ */ e.jsx("div", { className: "h-16 w-full bg-gray-200" }),
|
|
336
346
|
/* @__PURE__ */ e.jsx("div", { className: "h-16 w-full bg-gray-200" })
|
|
337
347
|
] }),
|
|
338
|
-
children:
|
|
339
|
-
/* @__PURE__ */ e.jsxs(
|
|
340
|
-
/* @__PURE__ */ e.jsxs(
|
|
348
|
+
children: C ? /* @__PURE__ */ e.jsxs(V, { defaultValue: i, className: "flex h-full w-full flex-col py-1", children: [
|
|
349
|
+
/* @__PURE__ */ e.jsxs(I, { className: "mx-1 grid h-10 grid-cols-2", children: [
|
|
350
|
+
/* @__PURE__ */ e.jsxs(A, { value: i, children: [
|
|
341
351
|
/* @__PURE__ */ e.jsx(_, { className: "mr-2 h-3" }),
|
|
342
352
|
" ",
|
|
343
|
-
|
|
353
|
+
u("Outline")
|
|
344
354
|
] }),
|
|
345
|
-
/* @__PURE__ */ e.jsxs(
|
|
346
|
-
/* @__PURE__ */ e.jsx(
|
|
347
|
-
|
|
355
|
+
/* @__PURE__ */ e.jsxs(A, { value: "data-provider", children: [
|
|
356
|
+
/* @__PURE__ */ e.jsx(Ne, { className: "mr-2 w-3" }),
|
|
357
|
+
u("Data")
|
|
348
358
|
] })
|
|
349
359
|
] }),
|
|
350
|
-
/* @__PURE__ */ e.jsx(
|
|
351
|
-
/* @__PURE__ */ e.jsx(
|
|
352
|
-
] }) : /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsxs(
|
|
353
|
-
/* @__PURE__ */ e.jsx(
|
|
360
|
+
/* @__PURE__ */ e.jsx(S, { value: i, className: "no-scrollbar h-full flex-1 overflow-y-auto overflow-x-hidden", children: j.createElement(P) }),
|
|
361
|
+
/* @__PURE__ */ e.jsx(S, { value: "data-provider", className: "flex-1 overflow-y-auto overflow-x-hidden", children: /* @__PURE__ */ e.jsx(_e, {}) })
|
|
362
|
+
] }) : /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsxs(V, { defaultValue: i, className: "flex h-full w-full flex-col py-1", children: [
|
|
363
|
+
/* @__PURE__ */ e.jsx(I, { className: "mx-1 grid h-10 grid-cols-1", children: /* @__PURE__ */ e.jsxs(A, { value: i, children: [
|
|
354
364
|
/* @__PURE__ */ e.jsx(_, { className: "mr-2 h-3" }),
|
|
355
365
|
" ",
|
|
356
|
-
|
|
366
|
+
u("Outline")
|
|
357
367
|
] }) }),
|
|
358
368
|
/* @__PURE__ */ e.jsx(
|
|
359
|
-
|
|
369
|
+
S,
|
|
360
370
|
{
|
|
361
371
|
value: i,
|
|
362
372
|
className: "no-scrollbar h-full flex-1 overflow-y-auto overflow-x-hidden",
|
|
@@ -369,5 +379,5 @@ const js = () => {
|
|
|
369
379
|
] });
|
|
370
380
|
};
|
|
371
381
|
export {
|
|
372
|
-
|
|
382
|
+
Ts as default
|
|
373
383
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("./jsx-runtime-Z_BpKhVy.cjs"),r=require("react"),h=require("@radix-ui/react-icons"),t=require("./index-h-hd6EvN.cjs"),v=require("./index-ecnGWzh9.cjs"),i=require("react-i18next");require("./_commonjsHelpers-wDK0ZLPo.cjs");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("@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 g=()=>t.useBuilderProp("languages",["en"]),H=()=>g().length===1?null:c.jsxRuntimeExports.jsx("div",{className:"flex items-center",children:c.jsxRuntimeExports.jsxs(t.Select,{children:[c.jsxRuntimeExports.jsx(t.SelectTrigger,{className:"w-[150px] border-0",children:c.jsxRuntimeExports.jsx(t.SelectValue,{placeholder:c.jsxRuntimeExports.jsxs("span",{className:"flex items-center",children:[c.jsxRuntimeExports.jsx(h.FontFamilyIcon,{className:"h-4 w-4"})," English(US)"]})})}),c.jsxRuntimeExports.jsx(t.SelectContent,{children:c.jsxRuntimeExports.jsxs(t.SelectGroup,{children:[c.jsxRuntimeExports.jsx(t.SelectLabel,{children:"Fruits"}),c.jsxRuntimeExports.jsx(t.SelectItem,{value:"apple",children:"Apple"}),c.jsxRuntimeExports.jsx(t.SelectItem,{value:"banana",children:"Banana"}),c.jsxRuntimeExports.jsx(t.SelectItem,{value:"blueberry",children:"Blueberry"}),c.jsxRuntimeExports.jsx(t.SelectItem,{value:"grapes",children:"Grapes"}),c.jsxRuntimeExports.jsx(t.SelectItem,{value:"pineapple",children:"Pineapple"})]})})]})});function V(l){return v.GenIcon({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM369 209L241 337c-9.4 9.4-24.6 9.4-33.9 0l-64-64c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0l47 47L335 175c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9z"}}]})(l)}const M=()=>{const{savePage:l,saveState:a}=t.useSavePage(),{t:s}=i.useTranslation(),e=t.useBuilderProp("hideSaveButton",!1),n=r.useMemo(()=>{switch(a){case"SAVING":return"animate-pulse bg-gray-300 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"}},[a]);if(e)return null;const o=c.jsxRuntimeExports.jsxs(t.Button,{disabled:a==="SAVING",onClick:z=>{z.preventDefault(),l()},className:`flex h-auto w-fit items-center gap-x-2 rounded-full p-1.5 px-3 ${n}`,size:"sm",variant:"outline",children:[c.jsxRuntimeExports.jsx(V,{className:"text-lg"}),c.jsxRuntimeExports.jsx("span",{className:"text-sm",children:a==="SAVING"?"Saving...":s(a==="SAVED"?"Saved":"Unsaved")})]});return c.jsxRuntimeExports.jsx("div",{className:"flex items-center",children:o})},u=function(){const a=t.useBuilderProp("previewComponent"),[,s]=t.usePreviewMode(),{t:e}=i.useTranslation();return a?c.jsxRuntimeExports.jsxs(t.Button,{onClick:n=>{n.preventDefault(),s(!0)},className:"flex h-auto w-fit items-center gap-x-2 rounded-full bg-gray-200 px-3 py-1",size:"sm",variant:"outline",children:[c.jsxRuntimeExports.jsx(h.EyeOpenIcon,{className:"text-xs"}),c.jsxRuntimeExports.jsx("span",{className:"text-sm",children:e("Preview")})]}):null},d=()=>{const l=t.useBuilderProp("topBarComponents.left",[]),a=t.useBuilderProp("topBarComponents.center",[]),s=t.useBuilderProp("topBarComponents.right",[]),e=t.useBuilderProp("editable",!0);return c.jsxRuntimeExports.jsxs("div",{className:"flex h-14 items-center justify-between px-2",children:[c.jsxRuntimeExports.jsx("div",{className:"flex items-center space-x-2",children:c.jsxRuntimeExports.jsx("div",{className:"flex items-center space-x-2 font-bold",children:r.Children.toArray(l.map(n=>c.jsxRuntimeExports.jsx(r.Suspense,{fallback:c.jsxRuntimeExports.jsx(t.Skeleton,{className:"h-10"}),children:c.jsxRuntimeExports.jsx(n,{})})))})}),c.jsxRuntimeExports.jsx("div",{className:"flex items-center space-x-2",children:r.Children.toArray(a.map(n=>c.jsxRuntimeExports.jsx(r.Suspense,{fallback:c.jsxRuntimeExports.jsx(t.Skeleton,{className:"h-10"}),children:c.jsxRuntimeExports.jsx(n,{})})))}),c.jsxRuntimeExports.jsxs("div",{className:"flex items-center space-x-2",children:[c.jsxRuntimeExports.jsx(H,{}),c.jsxRuntimeExports.jsx(u,{}),c.jsxRuntimeExports.jsx(t.Separator,{orientation:"vertical"}),e?c.jsxRuntimeExports.jsx(M,{}):null,r.Children.toArray(s.map(n=>c.jsxRuntimeExports.jsx(r.Suspense,{fallback:c.jsxRuntimeExports.jsx(t.Skeleton,{className:"h-10"}),children:c.jsxRuntimeExports.jsx(n,{})})))]})]})};exports.default=d;
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
import { j as c } from "./jsx-runtime-WbnYoNE9.js";
|
|
2
|
+
import z, { useMemo as o, Suspense as n } from "react";
|
|
3
|
+
import { FontFamilyIcon as M, EyeOpenIcon as u } from "@radix-ui/react-icons";
|
|
4
|
+
import { h as r, aj as d, ak as C, al as L, am as m, ay as p, az as F, an as i, z as w, B as g, q as B, S as v, aA as f } from "./index-Gk6sASBd.js";
|
|
5
|
+
import { G as x } from "./index-YpnaudSM.js";
|
|
6
|
+
import { useTranslation as e } from "react-i18next";
|
|
7
|
+
import "./_commonjsHelpers-UyOWmZb0.js";
|
|
8
|
+
import "lodash-es";
|
|
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 "@radix-ui/react-toggle";
|
|
19
|
+
import "class-variance-authority";
|
|
20
|
+
import "@radix-ui/react-switch";
|
|
21
|
+
import "@radix-ui/react-slot";
|
|
22
|
+
import "@radix-ui/react-accordion";
|
|
23
|
+
import "@radix-ui/react-alert-dialog";
|
|
24
|
+
import "@radix-ui/react-dialog";
|
|
25
|
+
import "@radix-ui/react-label";
|
|
26
|
+
import "@radix-ui/react-scroll-area";
|
|
27
|
+
import "@radix-ui/react-tabs";
|
|
28
|
+
import "@radix-ui/react-tooltip";
|
|
29
|
+
import "@radix-ui/react-popover";
|
|
30
|
+
import "@radix-ui/react-menubar";
|
|
31
|
+
import "@radix-ui/react-hover-card";
|
|
32
|
+
import "@radix-ui/react-select";
|
|
33
|
+
import "@radix-ui/react-dropdown-menu";
|
|
34
|
+
import "@radix-ui/react-separator";
|
|
35
|
+
import "@radix-ui/react-toast";
|
|
36
|
+
import "cmdk";
|
|
37
|
+
import "@radix-ui/react-context-menu";
|
|
38
|
+
import "react-icons-picker";
|
|
39
|
+
import "react-dom";
|
|
40
|
+
import "react-quill";
|
|
41
|
+
const S = () => r("languages", ["en"]), A = () => S().length === 1 ? null : /* @__PURE__ */ c.jsx("div", { className: "flex items-center", children: /* @__PURE__ */ c.jsxs(d, { children: [
|
|
42
|
+
/* @__PURE__ */ c.jsx(C, { className: "w-[150px] border-0", children: /* @__PURE__ */ c.jsx(
|
|
43
|
+
L,
|
|
44
|
+
{
|
|
45
|
+
placeholder: /* @__PURE__ */ c.jsxs("span", { className: "flex items-center", children: [
|
|
46
|
+
/* @__PURE__ */ c.jsx(M, { className: "h-4 w-4" }),
|
|
47
|
+
" English(US)"
|
|
48
|
+
] })
|
|
49
|
+
}
|
|
50
|
+
) }),
|
|
51
|
+
/* @__PURE__ */ c.jsx(m, { children: /* @__PURE__ */ c.jsxs(p, { children: [
|
|
52
|
+
/* @__PURE__ */ c.jsx(F, { children: "Fruits" }),
|
|
53
|
+
/* @__PURE__ */ c.jsx(i, { value: "apple", children: "Apple" }),
|
|
54
|
+
/* @__PURE__ */ c.jsx(i, { value: "banana", children: "Banana" }),
|
|
55
|
+
/* @__PURE__ */ c.jsx(i, { value: "blueberry", children: "Blueberry" }),
|
|
56
|
+
/* @__PURE__ */ c.jsx(i, { value: "grapes", children: "Grapes" }),
|
|
57
|
+
/* @__PURE__ */ c.jsx(i, { value: "pineapple", children: "Pineapple" })
|
|
58
|
+
] }) })
|
|
59
|
+
] }) });
|
|
60
|
+
function R(l) {
|
|
61
|
+
return x({ tag: "svg", attr: { viewBox: "0 0 512 512" }, child: [{ tag: "path", attr: { d: "M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM369 209L241 337c-9.4 9.4-24.6 9.4-33.9 0l-64-64c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0l47 47L335 175c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9z" } }] })(l);
|
|
62
|
+
}
|
|
63
|
+
const k = () => {
|
|
64
|
+
const { savePage: l, saveState: t } = w(), { t: s } = e(), h = r("hideSaveButton", !1), a = o(() => {
|
|
65
|
+
switch (t) {
|
|
66
|
+
case "SAVING":
|
|
67
|
+
return "animate-pulse bg-gray-300 text-gray-900";
|
|
68
|
+
case "SAVED":
|
|
69
|
+
return "bg-green-500 text-white hover:bg-green-600 hover:text-white";
|
|
70
|
+
default:
|
|
71
|
+
return "bg-gray-200 text-gray-500 hover:bg-gray-100";
|
|
72
|
+
}
|
|
73
|
+
}, [t]);
|
|
74
|
+
if (h)
|
|
75
|
+
return null;
|
|
76
|
+
const H = /* @__PURE__ */ c.jsxs(
|
|
77
|
+
g,
|
|
78
|
+
{
|
|
79
|
+
disabled: t === "SAVING",
|
|
80
|
+
onClick: (V) => {
|
|
81
|
+
V.preventDefault(), l();
|
|
82
|
+
},
|
|
83
|
+
className: `flex h-auto w-fit items-center gap-x-2 rounded-full p-1.5 px-3 ${a}`,
|
|
84
|
+
size: "sm",
|
|
85
|
+
variant: "outline",
|
|
86
|
+
children: [
|
|
87
|
+
/* @__PURE__ */ c.jsx(R, { className: "text-lg" }),
|
|
88
|
+
/* @__PURE__ */ c.jsx("span", { className: "text-sm", children: t === "SAVING" ? "Saving..." : s(t === "SAVED" ? "Saved" : "Unsaved") })
|
|
89
|
+
]
|
|
90
|
+
}
|
|
91
|
+
);
|
|
92
|
+
return /* @__PURE__ */ c.jsx("div", { className: "flex items-center", children: H });
|
|
93
|
+
}, P = function() {
|
|
94
|
+
const t = r("previewComponent"), [, s] = B(), { t: h } = e();
|
|
95
|
+
return t ? /* @__PURE__ */ c.jsxs(
|
|
96
|
+
g,
|
|
97
|
+
{
|
|
98
|
+
onClick: (a) => {
|
|
99
|
+
a.preventDefault(), s(!0);
|
|
100
|
+
},
|
|
101
|
+
className: "flex h-auto w-fit items-center gap-x-2 rounded-full bg-gray-200 px-3 py-1",
|
|
102
|
+
size: "sm",
|
|
103
|
+
variant: "outline",
|
|
104
|
+
children: [
|
|
105
|
+
/* @__PURE__ */ c.jsx(u, { className: "text-xs" }),
|
|
106
|
+
/* @__PURE__ */ c.jsx("span", { className: "text-sm", children: h("Preview") })
|
|
107
|
+
]
|
|
108
|
+
}
|
|
109
|
+
) : null;
|
|
110
|
+
}, C1 = () => {
|
|
111
|
+
const l = r("topBarComponents.left", []), t = r("topBarComponents.center", []), s = r("topBarComponents.right", []), h = r("editable", !0);
|
|
112
|
+
return /* @__PURE__ */ c.jsxs("div", { className: "flex h-14 items-center justify-between px-2", children: [
|
|
113
|
+
/* @__PURE__ */ c.jsx("div", { className: "flex items-center space-x-2", children: /* @__PURE__ */ c.jsx("div", { className: "flex items-center space-x-2 font-bold", children: z.Children.toArray(
|
|
114
|
+
l.map((a) => /* @__PURE__ */ c.jsx(n, { fallback: /* @__PURE__ */ c.jsx(v, { className: "h-10" }), children: /* @__PURE__ */ c.jsx(a, {}) }))
|
|
115
|
+
) }) }),
|
|
116
|
+
/* @__PURE__ */ c.jsx("div", { className: "flex items-center space-x-2", children: z.Children.toArray(
|
|
117
|
+
t.map((a) => /* @__PURE__ */ c.jsx(n, { fallback: /* @__PURE__ */ c.jsx(v, { className: "h-10" }), children: /* @__PURE__ */ c.jsx(a, {}) }))
|
|
118
|
+
) }),
|
|
119
|
+
/* @__PURE__ */ c.jsxs("div", { className: "flex items-center space-x-2", children: [
|
|
120
|
+
/* @__PURE__ */ c.jsx(A, {}),
|
|
121
|
+
/* @__PURE__ */ c.jsx(P, {}),
|
|
122
|
+
/* @__PURE__ */ c.jsx(f, { orientation: "vertical" }),
|
|
123
|
+
h ? /* @__PURE__ */ c.jsx(k, {}) : null,
|
|
124
|
+
z.Children.toArray(
|
|
125
|
+
s.map((a) => /* @__PURE__ */ c.jsx(n, { fallback: /* @__PURE__ */ c.jsx(v, { className: "h-10" }), children: /* @__PURE__ */ c.jsx(a, {}) }))
|
|
126
|
+
)
|
|
127
|
+
] })
|
|
128
|
+
] });
|
|
129
|
+
};
|
|
130
|
+
export {
|
|
131
|
+
C1 as default
|
|
132
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-Z_BpKhVy.cjs"),o=require("react"),l=require("lodash-es"),C=require("@radix-ui/react-icons"),k=require("unsplash-js"),t=require("./index-h-hd6EvN.cjs"),A=require("@react-hookz/web"),T=require("lucide-react");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("./Functions-N3yhPYKY.cjs");require("clsx");require("tailwind-merge");require("@chaibuilder/runtime");require("jotai");require("./STRINGS-gPz7CUOk.cjs");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 g=async(d,E)=>new Promise((a,n)=>{k.createApi({accessKey:E}).search.getPhotos(d).then(c=>{a(c)}).catch(c=>n(c))}),z=({isModalView:d,onSelect:E})=>{const a=t.useBuilderProp("unsplashAccessKey",""),[n,f]=o.useState([]),[c,q]=o.useState(0),[u,S]=o.useState(),[x,b]=o.useState(),[I,R]=o.useState(0),[j,w]=A.useDebouncedState("",1e3),[h,m]=o.useState(!1),P=async s=>{if(l.isEmpty(j))return;let i=c+1;s&&(s.preventDefault(),i=1),m(!0),q(i);const p={query:j,page:i};u&&(p.orientation=u),x&&(p.color=x),g(p,a).then(r=>{var y,v,N;f(i===1?((y=r==null?void 0:r.response)==null?void 0:y.results)||[]:[...n,...((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 o.useEffect(()=>{if(!l.isEmpty(j)&&a){m(!0);const s={query:j,page:1};u&&(s.orientation=u),x&&(s.color=x),q(1),g(s,a).then(i=>{var p,r;f(((p=i==null?void 0:i.response)==null?void 0:p.results)||[]),R((r=i==null?void 0:i.response)==null?void 0:r.total_pages),m(!1)}).catch(()=>{m(!1)})}},[u,x,j,a]),l.isEmpty(a)?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:l.startCase(s)},s))]})]})]})})]})]}),e.jsxRuntimeExports.jsxs(t.ScrollArea,{className:`h-full ${d&&!l.isEmpty(n)?"-mx-2 flex flex-wrap px-2":"-mx-2 flex flex-col pb-8 pt-2"}`,children:[l.isEmpty(n)&&!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:n.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))}):n.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..."]}),!l.isEmpty(n)&&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;
|