@chaibuilder/sdk 1.2.47 → 1.2.49
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-cX8vIt0V.js → AddBlocks-JCSA6hLF.js} +8 -8
- package/dist/{AddBlocks-_fhhS7Lm.cjs → AddBlocks-JiIeMTE-.cjs} +1 -1
- package/dist/{CanvasArea-N3rYeBJV.cjs → CanvasArea-K_d6ORTZ.cjs} +1 -1
- package/dist/{CanvasArea-HRipTJFS.js → CanvasArea-c3xbVSoY.js} +13 -13
- package/dist/{ChaiBuilderEditor-dKHRL-Es.js → ChaiBuilderEditor-F2yUJQdt.js} +1533 -1528
- package/dist/{ChaiBuilderEditor-EtQOC5uy.cjs → ChaiBuilderEditor-lqHQcnh3.cjs} +25 -25
- package/dist/{CurrentPage-U8ms8Hs7.js → CurrentPage--lDu6fB9.js} +2 -2
- package/dist/{CurrentPage-9FijxWbn.cjs → CurrentPage-DnQKF1wT.cjs} +1 -1
- package/dist/{ListTree-OgLdyfQs.js → ListTree-7DWSal1i.js} +120 -111
- package/dist/ListTree-HVFqaM0-.cjs +1 -0
- package/dist/{PagesPanel-MsUBq9Xx.js → PagesPanel-D1TOGyVE.js} +3 -3
- package/dist/{PagesPanel-8Cd6UYsh.cjs → PagesPanel-pIFhxLGC.cjs} +1 -1
- package/dist/{ProjectPanel-hsZG_Btj.js → ProjectPanel-PdvQsrbk.js} +3 -3
- package/dist/{ProjectPanel-KmnXPfxx.cjs → ProjectPanel-t7s3-URx.cjs} +1 -1
- package/dist/Settings-WevLeOpk.cjs +1 -0
- package/dist/{Settings-WcLqIeQy.js → Settings-aEcWAB0x.js} +268 -263
- package/dist/{SidePanels-6zRgfZpi.cjs → SidePanels-mavyE3q_.cjs} +1 -1
- package/dist/{SidePanels-PmCljlnf.js → SidePanels-uym8wfA0.js} +103 -110
- package/dist/{ThemeConfiguration-mkbFdePB.js → ThemeConfiguration-7J_Qt53c.js} +5 -5
- package/dist/{ThemeConfiguration-pt7TTAty.cjs → ThemeConfiguration-F-_ieF8J.cjs} +1 -1
- package/dist/{Topbar-FPywhpub.js → Topbar-DkbE0ccQ.js} +1 -1
- package/dist/{Topbar--m1E08Jl.cjs → Topbar-FjX_5927.cjs} +1 -1
- package/dist/UILibrariesPanel-3cSqwsMi.js +196 -0
- package/dist/UILibrariesPanel-qsjCsv10.cjs +1 -0
- package/dist/{UnsplashImages-Yu0msAD8.cjs → UnsplashImages-5skIflMr.cjs} +1 -1
- package/dist/{UnsplashImages-7uAXYHPH.js → UnsplashImages-owPv8UfV.js} +3 -3
- package/dist/{UploadImages-jS51ZcPG.cjs → UploadImages-olCKp-66.cjs} +1 -1
- package/dist/{UploadImages-5M0Q27R-.js → UploadImages-zGp0fN1z.js} +1 -1
- package/dist/{add-page-modal-KAbflupJ.cjs → add-page-modal-JE2NTOKQ.cjs} +1 -1
- package/dist/{add-page-modal-6o7MAbq-.js → add-page-modal-pOnhQNMH.js} +3 -3
- package/dist/{confirm-alert-dow0GlxC.cjs → confirm-alert-GTawvuT8.cjs} +1 -1
- package/dist/{confirm-alert-jL0z_gFv.js → confirm-alert-lbkop3bB.js} +1 -1
- package/dist/core.cjs +1 -1
- package/dist/core.js +1 -1
- package/dist/{delete-page-modal-U5_JYYp7.js → delete-page-modal-3OWHRhV4.js} +2 -2
- package/dist/{delete-page-modal-EDQZneVM.cjs → delete-page-modal-S42VXCGh.cjs} +1 -1
- package/dist/email.cjs +1 -1
- package/dist/email.js +1 -1
- package/dist/{form-Sgpl2fXL.js → form-CetbKOxf.js} +5 -5
- package/dist/{form-KBtrnNWh.cjs → form-Rqiu0P7V.cjs} +1 -1
- package/dist/{functions-7ybAMUuA.js → functions-WB3m-mfN.js} +6 -7
- package/dist/functions-fujiWLsg.cjs +1 -0
- package/dist/{index-po-naEa5.js → index-Mzvi8sMV.js} +2 -2
- package/dist/{index-HjN7LtDT.cjs → index-SZn6KcOd.cjs} +1 -1
- package/dist/lib.cjs +1 -1
- package/dist/lib.d.ts +1 -1
- package/dist/lib.js +17 -18
- package/dist/{page-viewer-nLRRk7DR.js → page-viewer-7iyxGntn.js} +8 -8
- package/dist/{page-viewer-PfZEbcDZ.cjs → page-viewer-fFmRhZs3.cjs} +1 -1
- package/dist/{project-general-setting-HO6zeum2.cjs → project-general-setting-0HJ_qyW3.cjs} +1 -1
- package/dist/{project-general-setting-D1UJdZ2D.js → project-general-setting-tHdsXTwH.js} +7 -7
- package/dist/{project-seo-setting-gT9N1tnB.cjs → project-seo-setting-Ln9aX7b5.cjs} +1 -1
- package/dist/{project-seo-setting-VIZWEMRk.js → project-seo-setting-zEBZ91Xk.js} +2 -2
- package/dist/render.cjs +1 -1
- package/dist/render.js +68 -68
- package/dist/{single-page-detail-To8TcpgJ.cjs → single-page-detail-H0heOB33.cjs} +1 -1
- package/dist/{single-page-detail-lQ8fujC5.js → single-page-detail-RBfdbTs3.js} +4 -4
- package/dist/studio.cjs +1 -1
- package/dist/studio.js +2 -2
- package/dist/ui.cjs +1 -1
- package/dist/ui.js +31 -31
- package/dist/{useCanvasSettings-UzjYHFG5.js → useCanvasSettings-2YhM5XKu.js} +1 -1
- package/dist/{useCanvasSettings-7BXlDuLG.cjs → useCanvasSettings-tDzAqXUt.cjs} +1 -1
- package/dist/web-blocks.cjs +1 -1
- package/dist/web-blocks.js +2 -2
- package/package.json +1 -1
- package/dist/ListTree-jOvHpo3_.cjs +0 -1
- package/dist/Settings-xVjTnVSf.cjs +0 -1
- package/dist/UILibrariesPanel-HhHGcexY.cjs +0 -1
- package/dist/UILibrariesPanel-VrA2X4LO.js +0 -145
- package/dist/functions-yvRwasT2.cjs +0 -1
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
import { j as e } from "./jsx-runtime-WbnYoNE9.js";
|
|
2
|
+
import { noop as N, has as w, first as j, isEmpty as I, get as b, values as A, groupBy as P, map as E, capitalize as T } from "lodash-es";
|
|
3
|
+
import * as U from "react";
|
|
4
|
+
import B, { useState as C, useCallback as R, useEffect as _, useRef as z } from "react";
|
|
5
|
+
import { aQ as G, aR as M, B as O, aS as W, aT as F, aU as Y, aV as $, aW as D, aX as H, aY as K, h as v, m as Q, L as V, bz as X, ag as q, ah as J, bg as Z } from "./ChaiBuilderEditor-F2yUJQdt.js";
|
|
6
|
+
import { syncBlocksWithDefaults as ee, useChaiBlocks as te } from "@chaibuilder/runtime";
|
|
7
|
+
import { Loader as se } from "lucide-react";
|
|
8
|
+
import { atom as oe, useAtom as k } from "jotai";
|
|
9
|
+
import { c as y } from "./Functions-7jnEwJyw.js";
|
|
10
|
+
import { CaretSortIcon as re, CheckIcon as ae, CaretRightIcon as ne } from "@radix-ui/react-icons";
|
|
11
|
+
import { O as ie } from "./STRINGS--j49GZJP.js";
|
|
12
|
+
import { useTranslation as L } from "react-i18next";
|
|
13
|
+
import "./_commonjsHelpers-UyOWmZb0.js";
|
|
14
|
+
import "clsx";
|
|
15
|
+
import "react-dom";
|
|
16
|
+
import "@radix-ui/react-scroll-area";
|
|
17
|
+
import "@floating-ui/react-dom";
|
|
18
|
+
import "i18next";
|
|
19
|
+
import "flagged";
|
|
20
|
+
import "@react-hookz/web";
|
|
21
|
+
import "./MODIFIERS-cBT31iqE.js";
|
|
22
|
+
import "tree-model";
|
|
23
|
+
import "./utils-iMv3T4WT.js";
|
|
24
|
+
import "tailwind-merge";
|
|
25
|
+
import "@radix-ui/react-toggle";
|
|
26
|
+
import "class-variance-authority";
|
|
27
|
+
import "@radix-ui/react-switch";
|
|
28
|
+
import "@radix-ui/react-slot";
|
|
29
|
+
import "@radix-ui/react-accordion";
|
|
30
|
+
import "@radix-ui/react-alert-dialog";
|
|
31
|
+
import "@radix-ui/react-dialog";
|
|
32
|
+
import "@radix-ui/react-label";
|
|
33
|
+
import "@radix-ui/react-tabs";
|
|
34
|
+
import "@radix-ui/react-tooltip";
|
|
35
|
+
import "@radix-ui/react-popover";
|
|
36
|
+
import "@radix-ui/react-menubar";
|
|
37
|
+
import "@radix-ui/react-hover-card";
|
|
38
|
+
import "@radix-ui/react-select";
|
|
39
|
+
import "@radix-ui/react-dropdown-menu";
|
|
40
|
+
import "@radix-ui/react-separator";
|
|
41
|
+
import "@radix-ui/react-toast";
|
|
42
|
+
import "cmdk";
|
|
43
|
+
import "@radix-ui/react-context-menu";
|
|
44
|
+
import "react-icons-picker";
|
|
45
|
+
import "react-quill";
|
|
46
|
+
import "react-hotkeys-hook";
|
|
47
|
+
function le({
|
|
48
|
+
uiLibraries: t,
|
|
49
|
+
library: r,
|
|
50
|
+
setLibrary: a
|
|
51
|
+
}) {
|
|
52
|
+
var l;
|
|
53
|
+
const [i, n] = U.useState(!1), { t: s } = L();
|
|
54
|
+
return r ? /* @__PURE__ */ e.jsxs(G, { open: i, onOpenChange: n, children: [
|
|
55
|
+
/* @__PURE__ */ e.jsx(M, { asChild: !0, children: /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-x-2", children: [
|
|
56
|
+
/* @__PURE__ */ e.jsx("span", { children: s("Choose Library") }),
|
|
57
|
+
/* @__PURE__ */ e.jsxs(
|
|
58
|
+
O,
|
|
59
|
+
{
|
|
60
|
+
variant: "outline",
|
|
61
|
+
size: "sm",
|
|
62
|
+
role: "combobox",
|
|
63
|
+
"aria-expanded": i,
|
|
64
|
+
className: "w-[200px] justify-between",
|
|
65
|
+
children: [
|
|
66
|
+
r ? (l = t.find((o) => o.uuid === r)) == null ? void 0 : l.name : s("Select library"),
|
|
67
|
+
/* @__PURE__ */ e.jsx(re, { className: "ml-2 h-4 w-4 shrink-0 opacity-50" })
|
|
68
|
+
]
|
|
69
|
+
}
|
|
70
|
+
)
|
|
71
|
+
] }) }),
|
|
72
|
+
/* @__PURE__ */ e.jsx(W, { className: "w-[200px] p-0", children: /* @__PURE__ */ e.jsxs(F, { children: [
|
|
73
|
+
/* @__PURE__ */ e.jsx(Y, { placeholder: "Search library...", className: "h-9" }),
|
|
74
|
+
/* @__PURE__ */ e.jsxs($, { children: [
|
|
75
|
+
/* @__PURE__ */ e.jsx(D, { children: "No library found." }),
|
|
76
|
+
/* @__PURE__ */ e.jsx(H, { children: t.map((o) => /* @__PURE__ */ e.jsxs(
|
|
77
|
+
K,
|
|
78
|
+
{
|
|
79
|
+
value: o.uuid,
|
|
80
|
+
onSelect: (d) => {
|
|
81
|
+
a(d), n(!1);
|
|
82
|
+
},
|
|
83
|
+
children: [
|
|
84
|
+
o.name,
|
|
85
|
+
/* @__PURE__ */ e.jsx(
|
|
86
|
+
ae,
|
|
87
|
+
{
|
|
88
|
+
className: y("ml-auto h-4 w-4", r === o.uuid ? "opacity-100" : "opacity-0")
|
|
89
|
+
}
|
|
90
|
+
)
|
|
91
|
+
]
|
|
92
|
+
},
|
|
93
|
+
o.uuid
|
|
94
|
+
)) })
|
|
95
|
+
] })
|
|
96
|
+
] }) })
|
|
97
|
+
] }) : null;
|
|
98
|
+
}
|
|
99
|
+
const ce = ({
|
|
100
|
+
block: t,
|
|
101
|
+
closePopover: r,
|
|
102
|
+
library: a
|
|
103
|
+
}) => {
|
|
104
|
+
const [i, n] = C(!1), s = v("getUILibraryBlock", N), { addCoreBlock: l, addPredefinedBlock: o } = Q(), [d] = V(), f = (p) => {
|
|
105
|
+
const u = w(p, "styles_attrs.data-page-section");
|
|
106
|
+
return p._type === "Box" && u;
|
|
107
|
+
}, h = R(
|
|
108
|
+
async (p) => {
|
|
109
|
+
if (p.stopPropagation(), w(t, "component")) {
|
|
110
|
+
l(t, j(d)), r();
|
|
111
|
+
return;
|
|
112
|
+
}
|
|
113
|
+
n(!0);
|
|
114
|
+
const u = await s(a, t);
|
|
115
|
+
let g = j(d);
|
|
116
|
+
f(j(u)) && (g = null), I(u) || o(ee(u), g), r();
|
|
117
|
+
},
|
|
118
|
+
[t]
|
|
119
|
+
);
|
|
120
|
+
return /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsxs(
|
|
121
|
+
"div",
|
|
122
|
+
{
|
|
123
|
+
onClick: i ? () => {
|
|
124
|
+
} : h,
|
|
125
|
+
className: "relative mt-2 cursor-pointer overflow-hidden rounded-md border border-gray-300 bg-white duration-200 hover:border-blue-500 hover:shadow-xl",
|
|
126
|
+
children: [
|
|
127
|
+
i && /* @__PURE__ */ e.jsxs("div", { className: "absolute flex h-full w-full items-center justify-center bg-black/70", children: [
|
|
128
|
+
/* @__PURE__ */ e.jsx(se, { className: "animate-spin", size: 15, color: "white" }),
|
|
129
|
+
" ",
|
|
130
|
+
/* @__PURE__ */ e.jsx("span", { className: "pl-2 text-sm text-white", children: "Adding..." })
|
|
131
|
+
] }),
|
|
132
|
+
t.preview ? /* @__PURE__ */ e.jsx("img", { src: t.preview, className: "min-h-[25px] w-full rounded-md", alt: t.name }) : /* @__PURE__ */ e.jsx("div", { className: "flex h-20 items-center justify-center rounded-md border border-border border-gray-300 bg-gray-200", children: /* @__PURE__ */ e.jsx("p", { className: "max-w-xs text-center text-sm text-gray-700", children: t.name }) })
|
|
133
|
+
]
|
|
134
|
+
}
|
|
135
|
+
) });
|
|
136
|
+
}, me = oe({}), de = (t) => {
|
|
137
|
+
const [r, a] = k(me), i = v("getUILibraryBlocks", N), n = b(r, `${t == null ? void 0 : t.uuid}.blocks`, []), s = b(r, `${t == null ? void 0 : t.uuid}.loading`, !1);
|
|
138
|
+
return _(() => {
|
|
139
|
+
(async () => {
|
|
140
|
+
if (s || n.length > 0)
|
|
141
|
+
return;
|
|
142
|
+
a((o) => ({ ...o, [t == null ? void 0 : t.uuid]: { loading: !0, blocks: [] } }));
|
|
143
|
+
const l = await i(t);
|
|
144
|
+
a((o) => ({ ...o, [t == null ? void 0 : t.uuid]: { loading: !1, blocks: l || [] } }));
|
|
145
|
+
})();
|
|
146
|
+
}, [t, n, s]), { data: n, isLoading: s };
|
|
147
|
+
}, ue = X("_selectedLibrary", null), pe = () => {
|
|
148
|
+
const [t, r] = k(ue), a = v("uiLibraries", []), i = te(), n = A(i).filter((m) => m.category === "custom"), s = a.find((m) => m.uuid === t) || j(a), { data: l, isLoading: o } = de(s), d = P([...l, ...n], "group"), [f, h] = C("Hero"), [, p] = k(q), u = b(d, f, []), { t: g } = L(), c = z(null), S = (m) => {
|
|
149
|
+
c.current && (clearTimeout(c.current), c.current = null), c.current = setTimeout(() => {
|
|
150
|
+
c.current && h(m);
|
|
151
|
+
}, 300);
|
|
152
|
+
};
|
|
153
|
+
return o ? /* @__PURE__ */ e.jsx(J, { className: "h-full w-full" }) : /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsxs("div", { className: "relative flex h-full max-h-full w-[460px] flex-col overflow-hidden bg-background", children: [
|
|
154
|
+
s != null && s.uuid ? /* @__PURE__ */ e.jsx("div", { className: "sticky top-0 flex h-fit flex-col", children: /* @__PURE__ */ e.jsx("div", { className: "mb-2 flex flex-col justify-between rounded-md bg-background/30 p-1", children: /* @__PURE__ */ e.jsx("h1", { className: "flex w-full flex-col items-baseline truncate px-1 text-sm font-semibold xl:flex-col", children: /* @__PURE__ */ e.jsx(le, { library: s == null ? void 0 : s.uuid, setLibrary: r, uiLibraries: a }) }) }) }) : null,
|
|
155
|
+
/* @__PURE__ */ e.jsxs("div", { className: "flex h-[95%] border-t border-gray-300 pt-2", children: [
|
|
156
|
+
/* @__PURE__ */ e.jsx("div", { className: "flex h-full w-40 flex-col gap-1 px-1", children: B.Children.toArray(
|
|
157
|
+
E(d, (m, x) => /* @__PURE__ */ e.jsxs(
|
|
158
|
+
"div",
|
|
159
|
+
{
|
|
160
|
+
onMouseEnter: () => S(x),
|
|
161
|
+
onMouseLeave: () => clearTimeout(c.current),
|
|
162
|
+
onClick: () => h(x),
|
|
163
|
+
className: y(
|
|
164
|
+
"flex w-full cursor-pointer items-center justify-between rounded-md p-1 text-sm transition-all ease-in-out hover:bg-gray-200",
|
|
165
|
+
x === f ? "bg-blue-500 text-white hover:bg-blue-600" : ""
|
|
166
|
+
),
|
|
167
|
+
children: [
|
|
168
|
+
/* @__PURE__ */ e.jsx("span", { children: T(x) }),
|
|
169
|
+
/* @__PURE__ */ e.jsx(ne, { className: "ml-2 h-5 w-5" })
|
|
170
|
+
]
|
|
171
|
+
},
|
|
172
|
+
x
|
|
173
|
+
))
|
|
174
|
+
) }),
|
|
175
|
+
/* @__PURE__ */ e.jsxs(
|
|
176
|
+
Z,
|
|
177
|
+
{
|
|
178
|
+
onMouseEnter: () => c.current ? clearTimeout(c.current) : null,
|
|
179
|
+
className: "z-10 -mt-2 flex h-full max-h-full w-[300px] flex-col gap-2 border-l border-gray-300 transition-all ease-linear",
|
|
180
|
+
children: [
|
|
181
|
+
/* @__PURE__ */ e.jsx("div", { className: "sticky top-0 z-30 border-b border-gray-300 bg-gray-200 p-2 text-[9px] font-light leading-3 text-gray-500", children: g("Click on a block to add it to the page") }),
|
|
182
|
+
/* @__PURE__ */ e.jsx("div", { className: "flex flex-col gap-2 px-2", children: B.Children.toArray(
|
|
183
|
+
u.map((m) => /* @__PURE__ */ e.jsx(ce, { block: m, library: s, closePopover: () => p(ie) }))
|
|
184
|
+
) }),
|
|
185
|
+
/* @__PURE__ */ e.jsx("br", {}),
|
|
186
|
+
/* @__PURE__ */ e.jsx("br", {}),
|
|
187
|
+
/* @__PURE__ */ e.jsx("br", {})
|
|
188
|
+
]
|
|
189
|
+
}
|
|
190
|
+
)
|
|
191
|
+
] })
|
|
192
|
+
] }) });
|
|
193
|
+
}, at = () => /* @__PURE__ */ e.jsx(pe, {});
|
|
194
|
+
export {
|
|
195
|
+
at as default
|
|
196
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-Z_BpKhVy.cjs"),o=require("lodash-es"),m=require("react"),t=require("./ChaiBuilderEditor-lqHQcnh3.cjs"),v=require("@chaibuilder/runtime"),B=require("lucide-react"),q=require("jotai"),k=require("./Functions-N3yhPYKY.cjs"),b=require("@radix-ui/react-icons"),y=require("./STRINGS-gPz7CUOk.cjs"),w=require("react-i18next");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("clsx");require("react-dom");require("@radix-ui/react-scroll-area");require("@floating-ui/react-dom");require("i18next");require("flagged");require("@react-hookz/web");require("./MODIFIERS-YPHRtwrM.cjs");require("tree-model");require("./utils-K3Zk762G.cjs");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-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-quill");require("react-hotkeys-hook");function C(s){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(s){for(const i in s)if(i!=="default"){const c=Object.getOwnPropertyDescriptor(s,i);Object.defineProperty(n,i,c.get?c:{enumerable:!0,get:()=>s[i]})}}return n.default=s,Object.freeze(n)}const S=C(m);function L({uiLibraries:s,library:n,setLibrary:i}){var a;const[c,l]=S.useState(!1),{t:r}=w.useTranslation();return n?e.jsxRuntimeExports.jsxs(t.Popover,{open:c,onOpenChange:l,children:[e.jsxRuntimeExports.jsx(t.PopoverTrigger,{asChild:!0,children:e.jsxRuntimeExports.jsxs("div",{className:"flex items-center gap-x-2",children:[e.jsxRuntimeExports.jsx("span",{children:r("Choose Library")}),e.jsxRuntimeExports.jsxs(t.Button,{variant:"outline",size:"sm",role:"combobox","aria-expanded":c,className:"w-[200px] justify-between",children:[n?(a=s.find(u=>u.uuid===n))==null?void 0:a.name:r("Select library"),e.jsxRuntimeExports.jsx(b.CaretSortIcon,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})]})}),e.jsxRuntimeExports.jsx(t.PopoverContent,{className:"w-[200px] p-0",children:e.jsxRuntimeExports.jsxs(t.Command,{children:[e.jsxRuntimeExports.jsx(t.CommandInput,{placeholder:"Search library...",className:"h-9"}),e.jsxRuntimeExports.jsxs(t.CommandList,{children:[e.jsxRuntimeExports.jsx(t.CommandEmpty,{children:"No library found."}),e.jsxRuntimeExports.jsx(t.CommandGroup,{children:s.map(u=>e.jsxRuntimeExports.jsxs(t.CommandItem,{value:u.uuid,onSelect:p=>{i(p),l(!1)},children:[u.name,e.jsxRuntimeExports.jsx(b.CheckIcon,{className:k.cn("ml-auto h-4 w-4",n===u.uuid?"opacity-100":"opacity-0")})]},u.uuid))})]})]})})]}):null}const I=({block:s,closePopover:n,library:i})=>{const[c,l]=m.useState(!1),r=t.useBuilderProp("getUILibraryBlock",o.noop),{addCoreBlock:a,addPredefinedBlock:u}=t.useAddBlock(),[p]=t.useSelectedBlockIds(),g=f=>{const j=o.has(f,"styles_attrs.data-page-section");return f._type==="Box"&&j},E=m.useCallback(async f=>{if(f.stopPropagation(),o.has(s,"component")){a(s,o.first(p)),n();return}l(!0);const j=await r(i,s);let R=o.first(p);g(o.first(j))&&(R=null),o.isEmpty(j)||u(v.syncBlocksWithDefaults(j),R),n()},[s]);return e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:e.jsxRuntimeExports.jsxs("div",{onClick:c?()=>{}:E,className:"relative mt-2 cursor-pointer overflow-hidden rounded-md border border-gray-300 bg-white duration-200 hover:border-blue-500 hover:shadow-xl",children:[c&&e.jsxRuntimeExports.jsxs("div",{className:"absolute flex h-full w-full items-center justify-center bg-black/70",children:[e.jsxRuntimeExports.jsx(B.Loader,{className:"animate-spin",size:15,color:"white"})," ",e.jsxRuntimeExports.jsx("span",{className:"pl-2 text-sm text-white",children:"Adding..."})]}),s.preview?e.jsxRuntimeExports.jsx("img",{src:s.preview,className:"min-h-[25px] w-full rounded-md",alt:s.name}):e.jsxRuntimeExports.jsx("div",{className:"flex h-20 items-center justify-center rounded-md border border-border border-gray-300 bg-gray-200",children:e.jsxRuntimeExports.jsx("p",{className:"max-w-xs text-center text-sm text-gray-700",children:s.name})})]})})},P=q.atom({}),A=s=>{const[n,i]=q.useAtom(P),c=t.useBuilderProp("getUILibraryBlocks",o.noop),l=o.get(n,`${s==null?void 0:s.uuid}.blocks`,[]),r=o.get(n,`${s==null?void 0:s.uuid}.loading`,!1);return m.useEffect(()=>{(async()=>{if(r||l.length>0)return;i(u=>({...u,[s==null?void 0:s.uuid]:{loading:!0,blocks:[]}}));const a=await c(s);i(u=>({...u,[s==null?void 0:s.uuid]:{loading:!1,blocks:a||[]}}))})()},[s,l,r]),{data:l,isLoading:r}},T=t.atomWithStorage("_selectedLibrary",null),O=()=>{const[s,n]=q.useAtom(T),i=t.useBuilderProp("uiLibraries",[]),c=v.useChaiBlocks(),l=o.values(c).filter(d=>d.category==="custom"),r=i.find(d=>d.uuid===s)||o.first(i),{data:a,isLoading:u}=A(r),p=o.groupBy([...a,...l],"group"),[g,E]=m.useState("Hero"),[,f]=q.useAtom(t.activePanelAtom),j=o.get(p,g,[]),{t:R}=w.useTranslation(),x=m.useRef(null),N=d=>{x.current&&(clearTimeout(x.current),x.current=null),x.current=setTimeout(()=>{x.current&&E(d)},300)};return u?e.jsxRuntimeExports.jsx(t.Skeleton,{className:"h-full w-full"}):e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:e.jsxRuntimeExports.jsxs("div",{className:"relative flex h-full max-h-full w-[460px] flex-col overflow-hidden bg-background",children:[r!=null&&r.uuid?e.jsxRuntimeExports.jsx("div",{className:"sticky top-0 flex h-fit flex-col",children:e.jsxRuntimeExports.jsx("div",{className:"mb-2 flex flex-col justify-between rounded-md bg-background/30 p-1",children:e.jsxRuntimeExports.jsx("h1",{className:"flex w-full flex-col items-baseline truncate px-1 text-sm font-semibold xl:flex-col",children:e.jsxRuntimeExports.jsx(L,{library:r==null?void 0:r.uuid,setLibrary:n,uiLibraries:i})})})}):null,e.jsxRuntimeExports.jsxs("div",{className:"flex h-[95%] border-t border-gray-300 pt-2",children:[e.jsxRuntimeExports.jsx("div",{className:"flex h-full w-40 flex-col gap-1 px-1",children:m.Children.toArray(o.map(p,(d,h)=>e.jsxRuntimeExports.jsxs("div",{onMouseEnter:()=>N(h),onMouseLeave:()=>clearTimeout(x.current),onClick:()=>E(h),className:k.cn("flex w-full cursor-pointer items-center justify-between rounded-md p-1 text-sm transition-all ease-in-out hover:bg-gray-200",h===g?"bg-blue-500 text-white hover:bg-blue-600":""),children:[e.jsxRuntimeExports.jsx("span",{children:o.capitalize(h)}),e.jsxRuntimeExports.jsx(b.CaretRightIcon,{className:"ml-2 h-5 w-5"})]},h)))}),e.jsxRuntimeExports.jsxs(t.ScrollArea,{onMouseEnter:()=>x.current?clearTimeout(x.current):null,className:"z-10 -mt-2 flex h-full max-h-full w-[300px] flex-col gap-2 border-l border-gray-300 transition-all ease-linear",children:[e.jsxRuntimeExports.jsx("div",{className:"sticky top-0 z-30 border-b border-gray-300 bg-gray-200 p-2 text-[9px] font-light leading-3 text-gray-500",children:R("Click on a block to add it to the page")}),e.jsxRuntimeExports.jsx("div",{className:"flex flex-col gap-2 px-2",children:m.Children.toArray(j.map(d=>e.jsxRuntimeExports.jsx(I,{block:d,library:r,closePopover:()=>f(y.OUTLINE_KEY)})))}),e.jsxRuntimeExports.jsx("br",{}),e.jsxRuntimeExports.jsx("br",{}),e.jsxRuntimeExports.jsx("br",{})]})]})]})})},_=()=>e.jsxRuntimeExports.jsx(O,{});exports.default=_;
|
|
@@ -1 +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("./ChaiBuilderEditor-
|
|
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("./ChaiBuilderEditor-lqHQcnh3.cjs"),A=require("@react-hookz/web"),T=require("lucide-react");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("clsx");require("react-dom");require("@radix-ui/react-scroll-area");require("@floating-ui/react-dom");require("jotai");require("i18next");require("react-i18next");require("flagged");require("./STRINGS-gPz7CUOk.cjs");require("./Functions-N3yhPYKY.cjs");require("tailwind-merge");require("@chaibuilder/runtime");require("./MODIFIERS-YPHRtwrM.cjs");require("tree-model");require("./utils-K3Zk762G.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-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-quill");require("react-hotkeys-hook");const E=async(d,q)=>new Promise((a,n)=>{k.createApi({accessKey:q}).search.getPhotos(d).then(u=>{a(u)}).catch(u=>n(u))}),z=({isModalView:d,onSelect:q})=>{const a=t.useBuilderProp("unsplashAccessKey",""),[n,f]=o.useState([]),[u,g]=o.useState(0),[c,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=u+1;s&&(s.preventDefault(),i=1),m(!0),g(i);const p={query:j,page:i};c&&(p.orientation=c),x&&(p.color=x),E(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};c&&(s.orientation=c),x&&(s.color=x),g(1),E(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)})}},[c,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:c,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:()=>q(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)&&u<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=E;
|
|
@@ -3,7 +3,7 @@ import { useState as p, useEffect as D } from "react";
|
|
|
3
3
|
import { isEmpty as d, startCase as E } from "lodash-es";
|
|
4
4
|
import { MixerHorizontalIcon as L } from "@radix-ui/react-icons";
|
|
5
5
|
import { createApi as B } from "unsplash-js";
|
|
6
|
-
import { h as F,
|
|
6
|
+
import { h as F, be as K, aQ as Q, aR as U, aS as V, a6 as P, a7 as S, a8 as C, a9 as I, aa as h, bg as O, B as R } from "./ChaiBuilderEditor-F2yUJQdt.js";
|
|
7
7
|
import { useDebouncedState as H } from "@react-hookz/web";
|
|
8
8
|
import { Loader as $ } from "lucide-react";
|
|
9
9
|
import "./_commonjsHelpers-UyOWmZb0.js";
|
|
@@ -107,7 +107,7 @@ const k = async (x, g) => new Promise((o, r) => {
|
|
|
107
107
|
children: /* @__PURE__ */ e.jsxs("div", { children: [
|
|
108
108
|
/* @__PURE__ */ e.jsx("div", { className: "py-1 text-sm font-medium", children: "Orientation" }),
|
|
109
109
|
/* @__PURE__ */ e.jsxs(P, { defaultValue: l, onValueChange: (s) => A(s), children: [
|
|
110
|
-
/* @__PURE__ */ e.jsx(
|
|
110
|
+
/* @__PURE__ */ e.jsx(S, { className: "h-auto w-40 p-1 px-3", children: /* @__PURE__ */ e.jsx(C, { placeholder: "Select" }) }),
|
|
111
111
|
/* @__PURE__ */ e.jsxs(I, { className: "z-[9999]", children: [
|
|
112
112
|
/* @__PURE__ */ e.jsx(h, { value: "", children: "All" }),
|
|
113
113
|
/* @__PURE__ */ e.jsx(h, { value: "landscape", children: "Landscape" }),
|
|
@@ -117,7 +117,7 @@ const k = async (x, g) => new Promise((o, r) => {
|
|
|
117
117
|
] }),
|
|
118
118
|
/* @__PURE__ */ e.jsx("div", { className: "pb-1 pt-2 text-sm font-medium", children: "Color" }),
|
|
119
119
|
/* @__PURE__ */ e.jsxs(P, { defaultValue: n, onValueChange: (s) => q(s), children: [
|
|
120
|
-
/* @__PURE__ */ e.jsx(
|
|
120
|
+
/* @__PURE__ */ e.jsx(S, { className: "h-auto w-40 p-1 px-3", children: /* @__PURE__ */ e.jsx(C, { placeholder: "Select" }) }),
|
|
121
121
|
/* @__PURE__ */ e.jsxs(I, { className: "z-[9999]", children: [
|
|
122
122
|
/* @__PURE__ */ e.jsx(h, { value: "", children: "All" }),
|
|
123
123
|
[
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-Z_BpKhVy.cjs"),s=require("react"),o=require("lodash-es"),m=require("@radix-ui/react-icons"),E=require("jotai"),p=require("./ChaiBuilderEditor-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-Z_BpKhVy.cjs"),s=require("react"),o=require("lodash-es"),m=require("@radix-ui/react-icons"),E=require("jotai"),p=require("./ChaiBuilderEditor-lqHQcnh3.cjs");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("clsx");require("react-dom");require("@radix-ui/react-scroll-area");require("@floating-ui/react-dom");require("i18next");require("react-i18next");require("flagged");require("./STRINGS-gPz7CUOk.cjs");require("./Functions-N3yhPYKY.cjs");require("tailwind-merge");require("@chaibuilder/runtime");require("@react-hookz/web");require("./MODIFIERS-YPHRtwrM.cjs");require("tree-model");require("./utils-K3Zk762G.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-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-quill");require("react-hotkeys-hook");require("lucide-react");const N=E.atom([]),I=({isModalView:t,onSelect:l})=>{const j=p.useBuilderProp("uploadMediaCallback"),a=p.useBuilderProp("fetchMediaCallback"),[i,x]=E.useAtom(N),[n,f]=s.useState(!1),[h,q]=s.useState(!1),[c,d]=s.useState(),[g,R]=s.useState("");s.useEffect(()=>{(async()=>{if(!a)return;q(!0);const r=await a();x(r||[]),q(!1)})()},[]);const v=r=>{var u,b;r&&((b=(u=r==null?void 0:r.target)==null?void 0:u.files)==null?void 0:b.length)>0&&d(r.target.files[0])},y=async()=>{if(j){f(!0);try{const{url:r}=await j(c);l(r),d(void 0);const u=await a();x(u)}catch(r){x([]),R((r==null?void 0:r.message)||"Something went wrong.")}f(!1)}};return e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[c?e.jsxRuntimeExports.jsxs("div",{className:"relative flex w-full flex-col items-center justify-center rounded-md border bg-slate-50 p-2 px-1",children:[e.jsxRuntimeExports.jsx("img",{src:URL.createObjectURL(c),alt:"",className:"h-auto max-h-96 w-full max-w-sm rounded-md object-contain"}),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:n,className:"flex items-center rounded-full bg-blue-500 px-3 py-1 text-sm text-white hover:bg-blue-600 hover:text-white",children:[n?e.jsxRuntimeExports.jsx(m.GearIcon,{className:"animate-spin"}):e.jsxRuntimeExports.jsx(m.UploadIcon,{className:"animate-bounce"})," ",n?"Uploading...":"Upload"]}),!n&&e.jsxRuntimeExports.jsxs("button",{type:"button",className:"flex items-center rounded-full border border-gray-300 px-3 py-1 text-sm hover:bg-gray-200",onClick:()=>d(void 0),children:[e.jsxRuntimeExports.jsx(m.Cross1Icon,{})," Cancel"]})]})]}):e.jsxRuntimeExports.jsxs("label",{htmlFor:t?"upload-in-modal":"upload-in-panel",children:[e.jsxRuntimeExports.jsxs("div",{className:"flex w-full cursor-pointer flex-col items-center justify-center rounded-md border border-dashed border-blue-900 bg-gray-200 py-8 hover:bg-blue-50",children:[e.jsxRuntimeExports.jsx("div",{className:"text-3xl",children:"+"}),e.jsxRuntimeExports.jsx("div",{children:"Click to choose file"})]}),e.jsxRuntimeExports.jsx("input",{type:"file",id:t?"upload-in-modal":"upload-in-panel",hidden:!0,onChange:v})]}),e.jsxRuntimeExports.jsxs(p.ScrollArea,{className:`-mx-2 flex h-full flex-col pb-8 pt-2 ${t?"px-2":""} pt-2`,children:[o.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..."})}),o.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:o.map(i,r=>e.jsxRuntimeExports.jsx("div",{role:"button",tabIndex:0,className:"my-1 flex",onClick:()=>l(r.url),children:e.jsxRuntimeExports.jsx("div",{className:"relative overflow-hidden rounded-md bg-cover bg-no-repeat",children:e.jsxRuntimeExports.jsx("img",{className:"h-auto flex-1 cursor-pointer rounded-md transition duration-300 ease-in-out hover:scale-105",alt:r.name,src:r.thumbUrl})})},r.id))}):o.map(i,r=>e.jsxRuntimeExports.jsx("div",{role:"button",tabIndex:0,className:"px-2 py-1",onClick:()=>l(r.url),children:e.jsxRuntimeExports.jsx("div",{className:"relative overflow-hidden rounded-md bg-cover bg-no-repeat",children:e.jsxRuntimeExports.jsx("img",{className:"h-auto w-full cursor-pointer transition duration-300 ease-in-out hover:scale-105",alt:r.name,src:r.url})})},r.id))]})]})};exports.default=I;
|
|
@@ -3,7 +3,7 @@ import { useState as l, useEffect as w } from "react";
|
|
|
3
3
|
import { isEmpty as b, map as j } from "lodash-es";
|
|
4
4
|
import { GearIcon as C, UploadIcon as U, Cross1Icon as k } from "@radix-ui/react-icons";
|
|
5
5
|
import { atom as F, useAtom as E } from "jotai";
|
|
6
|
-
import { h as v,
|
|
6
|
+
import { h as v, bg as A } from "./ChaiBuilderEditor-F2yUJQdt.js";
|
|
7
7
|
import "./_commonjsHelpers-UyOWmZb0.js";
|
|
8
8
|
import "clsx";
|
|
9
9
|
import "react-dom";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-Z_BpKhVy.cjs"),x=require("react"),P=require("lodash-es"),t=require("./ChaiBuilderEditor-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-Z_BpKhVy.cjs"),x=require("react"),P=require("lodash-es"),t=require("./ChaiBuilderEditor-lqHQcnh3.cjs"),g=require("./controls-jWJDao88.cjs"),R=require("./form-Rqiu0P7V.cjs"),f=require("./index-SZn6KcOd.cjs");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("clsx");require("react-dom");require("@radix-ui/react-scroll-area");require("@floating-ui/react-dom");require("jotai");require("i18next");require("react-i18next");require("flagged");require("./STRINGS-gPz7CUOk.cjs");require("./Functions-N3yhPYKY.cjs");require("tailwind-merge");require("@chaibuilder/runtime");require("@react-hookz/web");require("./MODIFIERS-YPHRtwrM.cjs");require("tree-model");require("./utils-K3Zk762G.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-icons");require("@radix-ui/react-alert-dialog");require("@radix-ui/react-dialog");require("@radix-ui/react-label");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-quill");require("react-hotkeys-hook");require("lucide-react");require("@rjsf/core");require("@rjsf/validator-ajv8");require("./core.cjs");require("sonner");require("./html-to-json-VPWiWWGH.cjs");require("himalaya");const b=({closeModal:i})=>{var l,o;const u=f.useAddPage(),[r,m]=x.useState({name:"",slug:"",blocks:[],type:"STATIC",seoData:{},template:""}),p=()=>{u.mutate(r,{onSuccess:()=>i()})},j=({formData:n},s)=>{m(q=>{var d,c;const a={[s]:n[s]};return s==="name"?a.slug=P.kebabCase((d=n[s])==null?void 0:d.replace(/\d/g,"")):s==="slug"&&(a.slug=(c=n[s])==null?void 0:c.replace(/\d/g,"").replace(/\s+/g,"").replace("--","-").replace("__","_")),{...q,...a}})},h={name:g.l({title:"Page Name",default:r.name}),slug:g.l({title:"Page Slug",default:r.slug})};return e.jsxRuntimeExports.jsxs(t.DialogContent,{children:[e.jsxRuntimeExports.jsx("div",{className:"px-1 font-bold",children:"Add Page"}),e.jsxRuntimeExports.jsx(R.Form,{formData:r,properties:h,onChange:j,disabled:u.isPending}),e.jsxRuntimeExports.jsx("div",{className:"flex items-center justify-end",children:e.jsxRuntimeExports.jsx(t.Button,{type:"submit",disabled:!r.name||!r.slug||((l=r.name)==null?void 0:l.length)<2||((o=r.slug)==null?void 0:o.length)<2||u.isPending,onClick:p,children:"Add Page"})})]})},E=()=>{const[i,u]=x.useState(!1);return e.jsxRuntimeExports.jsxs(t.Dialog,{open:i,onOpenChange:()=>u(!i),children:[e.jsxRuntimeExports.jsx(t.DialogTrigger,{asChild:!0,children:e.jsxRuntimeExports.jsx(t.Button,{size:"sm",variant:"link",className:"text-blue-500",onClick:()=>u(!i),children:"+ New Page"})}),i&&e.jsxRuntimeExports.jsx(b,{closeModal:()=>u(!i)})]})};exports.default=E;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { j as t } from "./jsx-runtime-WbnYoNE9.js";
|
|
2
2
|
import { useState as c } from "react";
|
|
3
3
|
import { kebabCase as j } from "lodash-es";
|
|
4
|
-
import { _ as b, B as u, Z as C, ab as A } from "./ChaiBuilderEditor-
|
|
4
|
+
import { _ as b, B as u, Z as C, ab as A } from "./ChaiBuilderEditor-F2yUJQdt.js";
|
|
5
5
|
import { l as g } from "./controls-VTdJhdSz.js";
|
|
6
|
-
import { F as D } from "./form-
|
|
7
|
-
import { e as N } from "./index-
|
|
6
|
+
import { F as D } from "./form-CetbKOxf.js";
|
|
7
|
+
import { e as N } from "./index-Mzvi8sMV.js";
|
|
8
8
|
import "./_commonjsHelpers-UyOWmZb0.js";
|
|
9
9
|
import "clsx";
|
|
10
10
|
import "react-dom";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-Z_BpKhVy.cjs"),r=require("./ChaiBuilderEditor-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-Z_BpKhVy.cjs"),r=require("./ChaiBuilderEditor-lqHQcnh3.cjs");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("react");require("clsx");require("react-dom");require("@radix-ui/react-scroll-area");require("@floating-ui/react-dom");require("jotai");require("i18next");require("react-i18next");require("flagged");require("lodash-es");require("./STRINGS-gPz7CUOk.cjs");require("./Functions-N3yhPYKY.cjs");require("tailwind-merge");require("@chaibuilder/runtime");require("@react-hookz/web");require("./MODIFIERS-YPHRtwrM.cjs");require("tree-model");require("./utils-K3Zk762G.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-icons");require("@radix-ui/react-alert-dialog");require("@radix-ui/react-dialog");require("@radix-ui/react-label");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-quill");require("react-hotkeys-hook");require("lucide-react");const x=({open:q,onCancel:t=()=>{},onConfirm:s,title:n,description:i,disabled:u,cancelText:l="Discard",confirmText:o="Save"})=>e.jsxRuntimeExports.jsx(r.AlertDialog,{open:q,children:e.jsxRuntimeExports.jsxs(r.AlertDialogContent,{children:[e.jsxRuntimeExports.jsx(r.AlertDialogTitle,{children:n}),i&&e.jsxRuntimeExports.jsx(r.AlertDialogDescription,{children:i}),e.jsxRuntimeExports.jsxs("div",{className:"flex items-center justify-end gap-x-3",children:[e.jsxRuntimeExports.jsx(r.AlertDialogCancel,{disabled:u,onClick:t,children:l}),e.jsxRuntimeExports.jsx(r.Button,{variant:"default",onClick:s,disabled:u,children:o})]})]})});exports.default=x;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { j as i } from "./jsx-runtime-WbnYoNE9.js";
|
|
2
|
-
import { A as a, b as n, d as c, e as x, g as d, B as j } from "./ChaiBuilderEditor-
|
|
2
|
+
import { A as a, b as n, d as c, e as x, g as d, B as j } from "./ChaiBuilderEditor-F2yUJQdt.js";
|
|
3
3
|
import "./_commonjsHelpers-UyOWmZb0.js";
|
|
4
4
|
import "react";
|
|
5
5
|
import "clsx";
|
package/dist/core.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./ChaiBuilderEditor-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./ChaiBuilderEditor-lqHQcnh3.cjs"),s=require("react-i18next");require("./jsx-runtime-Z_BpKhVy.cjs");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("react");require("clsx");require("react-dom");require("@radix-ui/react-scroll-area");require("@floating-ui/react-dom");require("jotai");require("i18next");require("flagged");require("lodash-es");require("./STRINGS-gPz7CUOk.cjs");require("./Functions-N3yhPYKY.cjs");require("tailwind-merge");require("@chaibuilder/runtime");require("@react-hookz/web");require("./MODIFIERS-YPHRtwrM.cjs");require("tree-model");require("./utils-K3Zk762G.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-icons");require("@radix-ui/react-alert-dialog");require("@radix-ui/react-dialog");require("@radix-ui/react-label");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-quill");require("react-hotkeys-hook");require("lucide-react");exports.ChaiBuilderEditor=e.ChaiBuilderEditor;exports.useActiveModal=e.useActiveModal;exports.useActivePanel=e.useActivePanel;exports.useAddBlock=e.useAddBlock;exports.useAddBlockParent=e.useAddBlockParent;exports.useAddClassesToBlocks=e.useAddClassesToBlocks;exports.useAllBlocks=e.useAllBlocks;exports.useBlocksStore=e.useBlocksStore;exports.useBrandingOptions=e.useBrandingOptions;exports.useBuilderProp=e.useBuilderProp;exports.useBuilderReset=e.useBuilderReset;exports.useCanvasWidth=e.useCanvasWidth;exports.useCanvasZoom=e.useCanvasZoom;exports.useCopyBlockIds=e.useCopyBlockIds;exports.useCopyToClipboard=e.useCopyToClipboard;exports.useCurrentPage=e.useCurrentPage;exports.useCutBlockIds=e.useCutBlockIds;exports.useDarkMode=e.useDarkMode;exports.useDuplicateBlocks=e.useDuplicateBlocks;exports.useGetPageData=e.useGetPageData;exports.useHiddenBlockIds=e.useHiddenBlockIds;exports.useHighlightBlockId=e.useHighlightBlockId;exports.usePasteBlocks=e.usePasteBlocks;exports.usePreviewMode=e.usePreviewMode;exports.useReadOnlyMode=e.useReadOnlyMode;exports.useRemoveBlocks=e.useRemoveBlocks;exports.useRemoveClassesFromBlocks=e.useRemoveClassesFromBlocks;exports.useSavePage=e.useSavePage;exports.useSelectedBlock=e.useSelectedBlock;exports.useSelectedBlockAllClasses=e.useSelectedBlockAllClasses;exports.useSelectedBlockCurrentClasses=e.useSelectedBlockCurrentClasses;exports.useSelectedBlockIds=e.useSelectedBlockIds;exports.useSelectedBlocksDisplayChild=e.useSelectedBlocksDisplayChild;exports.useSelectedBreakpoints=e.useSelectedBreakpoints;exports.useSelectedStylingBlocks=e.useSelectedStylingBlocks;exports.useStylingBreakpoint=e.useStylingBreakpoint;exports.useStylingState=e.useStylingState;exports.useUILibraryBlocks=e.useUILibraryBlocks;exports.useUndoManager=e.useUndoManager;exports.useUpdateBlocksProps=e.useUpdateBlocksProps;exports.useUpdateBlocksPropsRealtime=e.useUpdateBlocksPropsRealtime;Object.defineProperty(exports,"useTranslation",{enumerable:!0,get:()=>s.useTranslation});
|
package/dist/core.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { C as K, l as N, U as Q, m as V, W as X, n as Y, T as Z, i as _, F as $, h as ss, u as es, o as os, p as ts, q as as, r as rs, s as is, t as ps, v as ls, w as ms, x as us, y as ds, z as cs, D as Bs, E as ks, k as ns, H as Cs, I as Ss, V as Ps, M as gs, K as vs, J as ys, L as As, S as Is, X as hs, Y as Ms, N as Rs, P as Ds, O as Us, j as Ts, Q as xs, R as Hs } from "./ChaiBuilderEditor-
|
|
1
|
+
import { C as K, l as N, U as Q, m as V, W as X, n as Y, T as Z, i as _, F as $, h as ss, u as es, o as os, p as ts, q as as, r as rs, s as is, t as ps, v as ls, w as ms, x as us, y as ds, z as cs, D as Bs, E as ks, k as ns, H as Cs, I as Ss, V as Ps, M as gs, K as vs, J as ys, L as As, S as Is, X as hs, Y as Ms, N as Rs, P as Ds, O as Us, j as Ts, Q as xs, R as Hs } from "./ChaiBuilderEditor-F2yUJQdt.js";
|
|
2
2
|
import { useTranslation as bs } from "react-i18next";
|
|
3
3
|
import "./jsx-runtime-WbnYoNE9.js";
|
|
4
4
|
import "./_commonjsHelpers-UyOWmZb0.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { j as e } from "./jsx-runtime-WbnYoNE9.js";
|
|
2
|
-
import { A as p, a as l, b as n, d, e as a, g as c, B as u } from "./ChaiBuilderEditor-
|
|
3
|
-
import { h } from "./index-
|
|
2
|
+
import { A as p, a as l, b as n, d, e as a, g as c, B as u } from "./ChaiBuilderEditor-F2yUJQdt.js";
|
|
3
|
+
import { h } from "./index-Mzvi8sMV.js";
|
|
4
4
|
import { TrashIcon as x } from "@radix-ui/react-icons";
|
|
5
5
|
import "./_commonjsHelpers-UyOWmZb0.js";
|
|
6
6
|
import "react";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-Z_BpKhVy.cjs"),r=require("./ChaiBuilderEditor-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-Z_BpKhVy.cjs"),r=require("./ChaiBuilderEditor-lqHQcnh3.cjs"),l=require("./index-SZn6KcOd.cjs"),q=require("@radix-ui/react-icons");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("react");require("clsx");require("react-dom");require("@radix-ui/react-scroll-area");require("@floating-ui/react-dom");require("jotai");require("i18next");require("react-i18next");require("flagged");require("lodash-es");require("./STRINGS-gPz7CUOk.cjs");require("./Functions-N3yhPYKY.cjs");require("tailwind-merge");require("@chaibuilder/runtime");require("@react-hookz/web");require("./MODIFIERS-YPHRtwrM.cjs");require("tree-model");require("./utils-K3Zk762G.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-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-quill");require("react-hotkeys-hook");require("lucide-react");require("./core.cjs");require("sonner");require("./html-to-json-VPWiWWGH.cjs");require("himalaya");const d=({pageData:i,projectData:t})=>{const n={},u=l.useDeletePage(),s=i.uuid===t.homepage,o=()=>{u.mutate(i,{onSuccess:()=>{n({uuid:t.homepage,slug:"/home"})}})};return e.jsxRuntimeExports.jsxs(r.AlertDialog,{children:[e.jsxRuntimeExports.jsx(r.AlertDialogTrigger,{disabled:s,children:e.jsxRuntimeExports.jsx("div",{className:`flex h-full items-center justify-center rounded-md border px-2 py-2 font-medium hover:bg-red-400 hover:text-white ${s?"cursor-not-allowed border-red-200 text-red-200":"cursor-pointer border-red-400 text-red-400"}`,children:e.jsxRuntimeExports.jsx(q.TrashIcon,{})})}),e.jsxRuntimeExports.jsxs(r.AlertDialogContent,{children:[e.jsxRuntimeExports.jsxs(r.AlertDialogTitle,{children:["Are you sure you want to delete ",e.jsxRuntimeExports.jsx("i",{className:"text-red-500",children:i.name})," page?"]}),e.jsxRuntimeExports.jsx(r.AlertDialogDescription,{children:"This action cannot be undone. This will permanently delete your page."}),e.jsxRuntimeExports.jsxs("div",{className:"flex items-center justify-end gap-x-3",children:[e.jsxRuntimeExports.jsx(r.AlertDialogCancel,{disabled:u.isPending,children:"Cancel"}),e.jsxRuntimeExports.jsx(r.Button,{variant:"destructive",onClick:o,disabled:u.isPending,children:"Yes, Delete"})]})]})]})};exports.default=d;
|
package/dist/email.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-Z_BpKhVy.cjs");require("./core.cjs");const r=require("@radix-ui/react-icons"),q=require("lodash-es"),n=require("./ChaiBuilderEditor-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-Z_BpKhVy.cjs");require("./core.cjs");const r=require("@radix-ui/react-icons"),q=require("lodash-es"),n=require("./ChaiBuilderEditor-lqHQcnh3.cjs");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("react");require("react-i18next");require("clsx");require("react-dom");require("@radix-ui/react-scroll-area");require("@floating-ui/react-dom");require("jotai");require("i18next");require("flagged");require("./STRINGS-gPz7CUOk.cjs");require("./Functions-N3yhPYKY.cjs");require("tailwind-merge");require("@chaibuilder/runtime");require("@react-hookz/web");require("./MODIFIERS-YPHRtwrM.cjs");require("tree-model");require("./utils-K3Zk762G.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-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-quill");require("react-hotkeys-hook");require("lucide-react");const o=[{title:"Mobile",content:"Mobile email client",breakpoint:"xs",icon:e.jsxRuntimeExports.jsx(r.MobileIcon,{}),width:400},{title:"Email Client",content:"Content as seen inside an email client",breakpoint:"sm",icon:e.jsxRuntimeExports.jsx(r.MobileIcon,{className:"rotate-90"}),width:700}],s=i=>{const u={...i,filterChaiBlock:t=>q.includes(t.type,"Email/"),importHTMLSupport:!1,dataBindingSupport:!1,breakpoints:o};return e.jsxRuntimeExports.jsx(n.ChaiBuilderEditor,{...u})};exports.ChaiBuilderEmail=s;
|
package/dist/email.js
CHANGED
|
@@ -2,7 +2,7 @@ import { j as i } from "./jsx-runtime-WbnYoNE9.js";
|
|
|
2
2
|
import "./core.js";
|
|
3
3
|
import { MobileIcon as t } from "@radix-ui/react-icons";
|
|
4
4
|
import { includes as p } from "lodash-es";
|
|
5
|
-
import { C as e } from "./ChaiBuilderEditor-
|
|
5
|
+
import { C as e } from "./ChaiBuilderEditor-F2yUJQdt.js";
|
|
6
6
|
import "./_commonjsHelpers-UyOWmZb0.js";
|
|
7
7
|
import "react";
|
|
8
8
|
import "react-i18next";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { j as u } from "./jsx-runtime-WbnYoNE9.js";
|
|
2
|
-
import
|
|
3
|
-
import
|
|
2
|
+
import b from "@rjsf/core";
|
|
3
|
+
import x from "@rjsf/validator-ajv8";
|
|
4
4
|
import { includes as h, get as a, set as $, first as F } from "lodash-es";
|
|
5
|
-
import {
|
|
5
|
+
import { b0 as P, b1 as E, b2 as O, b3 as S } from "./ChaiBuilderEditor-F2yUJQdt.js";
|
|
6
6
|
const d = (i, l = "") => {
|
|
7
7
|
switch (i.type) {
|
|
8
8
|
case "singular":
|
|
@@ -95,7 +95,7 @@ const d = (i, l = "") => {
|
|
|
95
95
|
return /* @__PURE__ */ u.jsxs(u.Fragment, { children: [
|
|
96
96
|
i && /* @__PURE__ */ u.jsx("h1", { className: "px-1 text-sm font-semibold underline", children: i }),
|
|
97
97
|
/* @__PURE__ */ u.jsx("div", { className: "-mx-3", children: /* @__PURE__ */ u.jsx(
|
|
98
|
-
|
|
98
|
+
b,
|
|
99
99
|
{
|
|
100
100
|
widgets: {
|
|
101
101
|
richtext: P,
|
|
@@ -113,7 +113,7 @@ const d = (i, l = "") => {
|
|
|
113
113
|
uiSchema: e,
|
|
114
114
|
schema: r,
|
|
115
115
|
formData: c,
|
|
116
|
-
validator:
|
|
116
|
+
validator: x,
|
|
117
117
|
onChange: o,
|
|
118
118
|
disabled: n
|
|
119
119
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const f=require("./jsx-runtime-Z_BpKhVy.cjs"),y=require("@rjsf/core"),E=require("@rjsf/validator-ajv8"),i=require("lodash-es"),d=require("./ChaiBuilderEditor-
|
|
1
|
+
"use strict";const f=require("./jsx-runtime-Z_BpKhVy.cjs"),y=require("@rjsf/core"),E=require("@rjsf/validator-ajv8"),i=require("lodash-es"),d=require("./ChaiBuilderEditor-lqHQcnh3.cjs"),h=(c,n="")=>{switch(c.type){case"singular":return c.uiSchema;case"model":const{properties:p}=c,u={};return Object.keys(p).forEach(r=>{const e=p[r];if(i.includes(["slot","styles"],e.type))return;const o=i.get(e,"i18n",!1)?`${r}-${n}`:r;u[o]=h(e,n)}),u;case"list":const{itemProperties:m}=c,l={items:{}};return Object.keys(m).forEach(r=>{const e=m[r];if(i.includes(["slot","styles"],e.type))return;const o=i.get(e,"i18n",!1)?`${r}-${n}`:r;l.items[o]=h(e,n)}),l;default:return{}}},x=(c,n="")=>{switch(c.type){case"singular":return c.schema;case"model":const{properties:p,title:u}=c,m={title:u,type:"object",properties:{}};return Object.keys(p).forEach(o=>{const t=p[o];if(i.includes(["slot","styles"],t.type))return;const s=i.get(t,"i18n",!1)?`${o}-${n}`:o;m.properties[s]=x(t,n)}),m;case"list":const{itemProperties:l,title:r}=c,e={title:r,type:"array",items:{type:"object",properties:{}}};return Object.keys(l).forEach(o=>{const t=l[o];if(i.includes(["slot","styles"],t.type))return;const s=i.get(t,"i18n",!1)?`${o}-${n}`:o;e.items.properties[s]=x(t,n),i.set(e.items,"title",i.get(t,"itemTitle",`${r} item`))}),e;default:return{}}},$=({title:c,properties:n={},formData:p,onChange:u,disabled:m=!1,activeLang:l=""})=>{const r={type:"object",properties:{}},e={};Object.keys(n).forEach(t=>{const s=n[t];if(i.includes(["slot","styles"],s.type))return;const a=i.get(s,"i18n",!1)?`${t}-${l}`:t;r.properties[a]=x(s,l),e[a]=h(s,l)});const o=({...t},s)=>{const a=s==null?void 0:s.replace("root.","").split("/").pop();if(!s||!a)return;const j=i.first(a.split("."));s&&j&&u({...t},j)};return f.jsxRuntimeExports.jsxs(f.jsxRuntimeExports.Fragment,{children:[c&&f.jsxRuntimeExports.jsx("h1",{className:"px-1 text-sm font-semibold underline",children:c}),f.jsxRuntimeExports.jsx("div",{className:"-mx-3",children:f.jsxRuntimeExports.jsx(y,{widgets:{richtext:d.RichTextEditorField,icon:d.IconPickerField,image:d.ImagePickerField},fields:{link:d.LinkField},idSeparator:".",autoComplete:"off",omitExtraData:!0,liveOmit:!0,liveValidate:!0,uiSchema:e,schema:r,formData:p,validator:E,onChange:o,disabled:m})})]})};exports.Form=$;
|
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
import { get as e, last as g } from "lodash-es";
|
|
2
|
-
import { a as
|
|
3
|
-
|
|
4
|
-
const i = (s, t = "") => {
|
|
1
|
+
import { get as e, last as g, flattenDeep as $ } from "lodash-es";
|
|
2
|
+
import { a as d } from "./STRINGS--j49GZJP.js";
|
|
3
|
+
const b = (s, t = "") => {
|
|
5
4
|
const c = e(s, "bodyTextLightColor", "#64748b"), o = e(s, "bodyTextDarkColor", "#94a3b8"), n = e(s, "bodyBgLightColor", "#FFFFFF"), l = e(s, "bodyBgDarkColor", "#0f172a");
|
|
6
5
|
return `${t}font-body ${t}antialiased ${t}text-[${c}] ${t}bg-[${n}] dark:${t}text-[${o}] dark:${t}bg-[${l}]`;
|
|
7
6
|
}, k = (s, t = "") => {
|
|
8
|
-
const o = s.replace(
|
|
7
|
+
const o = s.replace(d, "").split(",").map((n) => n.split(" ").map((r) => {
|
|
9
8
|
if (r === "")
|
|
10
9
|
return "";
|
|
11
10
|
if (r.includes(":")) {
|
|
@@ -14,7 +13,7 @@ const i = (s, t = "") => {
|
|
|
14
13
|
}
|
|
15
14
|
return `${t}${r}`;
|
|
16
15
|
}).join(" "));
|
|
17
|
-
return
|
|
16
|
+
return $(o).join(" ");
|
|
18
17
|
}, C = (s) => {
|
|
19
18
|
if (!s)
|
|
20
19
|
return [];
|
|
@@ -27,5 +26,5 @@ const i = (s, t = "") => {
|
|
|
27
26
|
export {
|
|
28
27
|
k as a,
|
|
29
28
|
C as c,
|
|
30
|
-
|
|
29
|
+
b as g
|
|
31
30
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const e=require("lodash-es"),g=require("./STRINGS-gPz7CUOk.cjs"),d=(t,s="")=>{const c=e.get(t,"bodyTextLightColor","#64748b"),o=e.get(t,"bodyTextDarkColor","#94a3b8"),n=e.get(t,"bodyBgLightColor","#FFFFFF"),l=e.get(t,"bodyBgDarkColor","#0f172a");return`${s}font-body ${s}antialiased ${s}text-[${c}] ${s}bg-[${n}] dark:${s}text-[${o}] dark:${s}bg-[${l}]`},u=(t,s="")=>{const o=t.replace(g.STYLES_KEY,"").split(",").map(n=>n.split(" ").map(r=>{if(r==="")return"";if(r.includes(":")){const a=r.split(":");return a[a.length-1]=s+e.last(a),a.join(":")}return`${s}${r}`}).join(" "));return e.flattenDeep(o).join(" ")},$=t=>{if(!t)return[];try{return JSON.parse(t)}catch{return[{_type:"Paragraph",_id:"error",content:"Invalid JSON. Please check the JSON string."}]}};exports.addPrefixToClasses=u;exports.convertToBlocks=$;exports.getBrandingClasses=d;
|
|
@@ -20,7 +20,7 @@ import * as b from "react";
|
|
|
20
20
|
import H0, { lazy as A2, useCallback as g2, useState as M2, Suspense as u0, useEffect as s0 } from "react";
|
|
21
21
|
import "./core.js";
|
|
22
22
|
import { FileTextIcon as p0, GearIcon as V0, EyeClosedIcon as f0, EyeOpenIcon as m0 } from "@radix-ui/react-icons";
|
|
23
|
-
import { u as L0, G as Y2, B as X2, A as x0, a as w0, b as B0, c as C0, d as O0, e as A0, f as S0, g as y0, h as b0, C as P0 } from "./ChaiBuilderEditor-
|
|
23
|
+
import { u as L0, G as Y2, B as X2, A as x0, a as w0, b as B0, c as C0, d as O0, e as A0, f as S0, g as y0, h as b0, C as P0 } from "./ChaiBuilderEditor-F2yUJQdt.js";
|
|
24
24
|
import { toast as h1, Toaster as F0 } from "sonner";
|
|
25
25
|
import { useTranslation as D0 } from "react-i18next";
|
|
26
26
|
import { sortBy as R0, filter as k0, has as T0, set as E0, capitalize as N0, get as b2, omit as I0, size as P2 } from "lodash-es";
|
|
@@ -2043,7 +2043,7 @@ const k4 = () => {
|
|
|
2043
2043
|
] })
|
|
2044
2044
|
] })
|
|
2045
2045
|
] });
|
|
2046
|
-
}, W4 = () => /* @__PURE__ */ i.jsx(I4, { children: /* @__PURE__ */ i.jsx("button", { className: "border-gray-200 rounded-md p-2 mb-2 border", children: /* @__PURE__ */ i.jsx(Q0, { className: "w-4 h-4 text-red-500 cursor-pointer hover:text-red-300 duration-300" }) }) }), U4 = A2(() => import("./PagesPanel-
|
|
2046
|
+
}, W4 = () => /* @__PURE__ */ i.jsx(I4, { children: /* @__PURE__ */ i.jsx("button", { className: "border-gray-200 rounded-md p-2 mb-2 border", children: /* @__PURE__ */ i.jsx(Q0, { className: "w-4 h-4 text-red-500 cursor-pointer hover:text-red-300 duration-300" }) }) }), U4 = A2(() => import("./PagesPanel-D1TOGyVE.js")), j4 = A2(() => import("./ProjectPanel-PdvQsrbk.js")), Q4 = A2(() => import("./CurrentPage--lDu6fB9.js")), K4 = () => /* @__PURE__ */ i.jsx("h2", { children: "Your Logo" }), G4 = () => {
|
|
2047
2047
|
const { mutate: a } = y4();
|
|
2048
2048
|
return b0("editable", !0) ? /* @__PURE__ */ i.jsx(X2, { onClick: a, className: "bg-blue-600 text-white", children: "Publish" }) : null;
|
|
2049
2049
|
}, q4 = (a) => {
|