@chaibuilder/sdk 1.2.48 → 1.2.50
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-IX7HKzSe.js} +15 -15
- package/dist/AddBlocks-zwZ63DdP.cjs +1 -0
- package/dist/CanvasArea-URgoG1jc.cjs +56 -0
- package/dist/{CanvasArea-HRipTJFS.js → CanvasArea-ehmBje_E.js} +285 -269
- package/dist/{ChaiBuilderEditor-dKHRL-Es.js → ChaiBuilderEditor-3xIN-AP_.js} +7592 -7645
- package/dist/{ChaiBuilderEditor-EtQOC5uy.cjs → ChaiBuilderEditor-ZRHqW7Gd.cjs} +50 -50
- package/dist/CodeEditor-0F7Dz3AB.js +97 -0
- package/dist/CodeEditor-1vu-qNgT.cjs +1 -0
- package/dist/CurrentPage-HOPNdQZ-.cjs +1 -0
- package/dist/{CurrentPage-U8ms8Hs7.js → CurrentPage-qhBjm7th.js} +10 -10
- package/dist/ListTree-DkbFFDXB.cjs +1 -0
- package/dist/{ListTree-OgLdyfQs.js → ListTree-sTwXvXST.js} +123 -114
- package/dist/{MODIFIERS-cBT31iqE.js → MODIFIERS-fd5XOmum.js} +8 -4
- package/dist/MODIFIERS-mVmfEGgo.cjs +1 -0
- package/dist/{PagesPanel-MsUBq9Xx.js → PagesPanel-5iVsbDP1.js} +7 -7
- package/dist/PagesPanel-kdl4A0IN.cjs +1 -0
- package/dist/{ProjectPanel-hsZG_Btj.js → ProjectPanel-c8oTzhQd.js} +7 -7
- package/dist/ProjectPanel-mXPBI-TU.cjs +1 -0
- package/dist/{Settings-WcLqIeQy.js → Settings-0uSGoECC.js} +536 -514
- package/dist/Settings-3kBSStO6.cjs +1 -0
- package/dist/{SidePanels-PmCljlnf.js → SidePanels-YLWdBer9.js} +108 -115
- package/dist/SidePanels-kKram02Q.cjs +1 -0
- package/dist/ThemeConfiguration-8W1CM4tW.cjs +1 -0
- package/dist/{ThemeConfiguration-mkbFdePB.js → ThemeConfiguration-AAGFJieC.js} +5 -5
- package/dist/Topbar-CLNUPx7K.cjs +1 -0
- package/dist/{Topbar-FPywhpub.js → Topbar-nX9Muoem.js} +8 -8
- package/dist/UILibrariesPanel-cp0Mkaq_.cjs +1 -0
- package/dist/UILibrariesPanel-fKn2nlgI.js +196 -0
- package/dist/UnsplashImages-56HoW_ZA.cjs +1 -0
- package/dist/{UnsplashImages-7uAXYHPH.js → UnsplashImages-zTZa3LjG.js} +4 -4
- package/dist/{UploadImages-5M0Q27R-.js → UploadImages-SnfaTrlz.js} +4 -4
- package/dist/UploadImages-okNGjkXb.cjs +1 -0
- package/dist/add-page-modal-Y2RY3x01.cjs +1 -0
- package/dist/{add-page-modal-6o7MAbq-.js → add-page-modal-uDoO0zws.js} +12 -12
- package/dist/{confirm-alert-jL0z_gFv.js → confirm-alert-9XiVxCc0.js} +4 -4
- package/dist/confirm-alert-aD7AMK_6.cjs +1 -0
- package/dist/controls-rRZhz0vu.cjs +1 -0
- package/dist/{controls-VTdJhdSz.js → controls-yjgoZzB6.js} +31 -18
- package/dist/core.cjs +1 -1
- package/dist/core.js +6 -6
- package/dist/{delete-page-modal-U5_JYYp7.js → delete-page-modal-7sfoFf9r.js} +6 -6
- package/dist/delete-page-modal-ieJ367JA.cjs +1 -0
- package/dist/email-blocks.cjs +1 -1
- package/dist/email-blocks.js +1 -1
- package/dist/email.cjs +1 -1
- package/dist/email.js +4 -4
- package/dist/{form-KBtrnNWh.cjs → form-KWYHDVIf.cjs} +1 -1
- package/dist/{form-Sgpl2fXL.js → form-PQSmqcIl.js} +1 -1
- package/dist/{functions-7ybAMUuA.js → functions-JO0EW8GX.js} +6 -7
- package/dist/functions-ZZVUnIjD.cjs +1 -0
- package/dist/{html-to-json-Z6R2o_fA.js → html-to-json-GJ6RioQf.js} +1 -1
- package/dist/html-to-json-O1OpqICe.cjs +1 -0
- package/dist/index-VOrp9ZpX.cjs +1 -0
- package/dist/index-YpnaudSM.js +63 -0
- package/dist/index-ecnGWzh9.cjs +1 -0
- package/dist/{index-po-naEa5.js → index-i2kgLkjC.js} +15 -14
- package/dist/lib.cjs +2 -2
- package/dist/lib.d.ts +1 -1
- package/dist/lib.js +19 -21
- package/dist/page-viewer-aoro5JxT.cjs +1 -0
- package/dist/{page-viewer-nLRRk7DR.js → page-viewer-qkwZJ6e-.js} +7 -7
- package/dist/{project-general-setting-D1UJdZ2D.js → project-general-setting-3gkaXq1F.js} +8 -8
- package/dist/project-general-setting-arXitV5_.cjs +1 -0
- package/dist/{project-seo-setting-VIZWEMRk.js → project-seo-setting-X8pykTmc.js} +6 -6
- package/dist/project-seo-setting-kjtUt-er.cjs +1 -0
- package/dist/render.cjs +1 -1
- package/dist/render.js +89 -90
- package/dist/single-page-detail-UsWG0gfh.cjs +1 -0
- package/dist/{single-page-detail-lQ8fujC5.js → single-page-detail-ZXZX6Xmw.js} +21 -21
- package/dist/studio.cjs +1 -1
- package/dist/studio.js +6 -6
- package/dist/ui.cjs +1 -1
- package/dist/ui.js +93 -93
- package/dist/useCodeEditor-CtjbxWLf.cjs +1 -0
- package/dist/useCodeEditor-yl5V3Hte.js +7 -0
- package/dist/{utils-K3Zk762G.cjs → utils-D_vtk3zK.cjs} +1 -1
- package/dist/{utils-iMv3T4WT.js → utils-VpVqnC9m.js} +1 -1
- package/dist/web-blocks.cjs +1 -33
- package/dist/web-blocks.js +468 -616
- package/package.json +4 -2
- package/dist/AddBlocks-_fhhS7Lm.cjs +0 -1
- package/dist/CanvasArea-N3rYeBJV.cjs +0 -55
- package/dist/CurrentPage-9FijxWbn.cjs +0 -1
- package/dist/ListTree-jOvHpo3_.cjs +0 -1
- package/dist/MODIFIERS-YPHRtwrM.cjs +0 -1
- package/dist/PagesPanel-8Cd6UYsh.cjs +0 -1
- package/dist/ProjectPanel-KmnXPfxx.cjs +0 -1
- package/dist/STRINGS--j49GZJP.js +0 -7
- package/dist/STRINGS-gPz7CUOk.cjs +0 -1
- package/dist/Settings-xVjTnVSf.cjs +0 -1
- package/dist/SidePanels-6zRgfZpi.cjs +0 -1
- package/dist/ThemeConfiguration-pt7TTAty.cjs +0 -1
- package/dist/Topbar--m1E08Jl.cjs +0 -1
- package/dist/UILibrariesPanel-HhHGcexY.cjs +0 -1
- package/dist/UILibrariesPanel-VrA2X4LO.js +0 -145
- package/dist/UnsplashImages-Yu0msAD8.cjs +0 -1
- package/dist/UploadImages-jS51ZcPG.cjs +0 -1
- package/dist/add-page-modal-KAbflupJ.cjs +0 -1
- package/dist/confirm-alert-dow0GlxC.cjs +0 -1
- package/dist/controls-jWJDao88.cjs +0 -1
- package/dist/delete-page-modal-EDQZneVM.cjs +0 -1
- package/dist/functions-yvRwasT2.cjs +0 -1
- package/dist/html-to-json-VPWiWWGH.cjs +0 -1
- package/dist/index-HjN7LtDT.cjs +0 -1
- package/dist/page-viewer-PfZEbcDZ.cjs +0 -1
- package/dist/project-general-setting-HO6zeum2.cjs +0 -1
- package/dist/project-seo-setting-gT9N1tnB.cjs +0 -1
- package/dist/single-page-detail-To8TcpgJ.cjs +0 -1
- package/dist/useCanvasSettings-7BXlDuLG.cjs +0 -1
- package/dist/useCanvasSettings-UzjYHFG5.js +0 -6
|
@@ -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 { aP as G, aQ as M, B as O, aR as W, aS as F, aT as K, aU as $, aV as D, aW as H, aX as Q, h as v, m as V, K as X, by as Y, af as q, ag as J, bf as Z } from "./ChaiBuilderEditor-3xIN-AP_.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 "./MODIFIERS-fd5XOmum.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 "tree-model";
|
|
22
|
+
import "./utils-VpVqnC9m.js";
|
|
23
|
+
import "tailwind-merge";
|
|
24
|
+
import "@radix-ui/react-toggle";
|
|
25
|
+
import "class-variance-authority";
|
|
26
|
+
import "@radix-ui/react-switch";
|
|
27
|
+
import "@radix-ui/react-slot";
|
|
28
|
+
import "@radix-ui/react-accordion";
|
|
29
|
+
import "@radix-ui/react-alert-dialog";
|
|
30
|
+
import "@radix-ui/react-dialog";
|
|
31
|
+
import "@radix-ui/react-label";
|
|
32
|
+
import "@radix-ui/react-tabs";
|
|
33
|
+
import "@radix-ui/react-tooltip";
|
|
34
|
+
import "@radix-ui/react-popover";
|
|
35
|
+
import "@radix-ui/react-menubar";
|
|
36
|
+
import "@radix-ui/react-hover-card";
|
|
37
|
+
import "@radix-ui/react-select";
|
|
38
|
+
import "@radix-ui/react-dropdown-menu";
|
|
39
|
+
import "@radix-ui/react-separator";
|
|
40
|
+
import "@radix-ui/react-toast";
|
|
41
|
+
import "cmdk";
|
|
42
|
+
import "@radix-ui/react-context-menu";
|
|
43
|
+
import "react-icons-picker";
|
|
44
|
+
import "react-quill";
|
|
45
|
+
import "react-hotkeys-hook";
|
|
46
|
+
import "./index-YpnaudSM.js";
|
|
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(K, { 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
|
+
Q,
|
|
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 } = V(), [d] = X(), 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 = Y("_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("react"),l=require("lodash-es"),C=require("@radix-ui/react-icons"),k=require("unsplash-js"),t=require("./ChaiBuilderEditor-ZRHqW7Gd.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("./MODIFIERS-mVmfEGgo.cjs");require("./Functions-N3yhPYKY.cjs");require("tailwind-merge");require("@chaibuilder/runtime");require("tree-model");require("./utils-D_vtk3zK.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("./index-ecnGWzh9.cjs");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, bd as K, aP as Q, aQ as U, aR as V,
|
|
6
|
+
import { h as F, bd as K, aP as Q, aQ as U, aR as V, a5 as P, a6 as C, a7 as S, a8 as I, a9 as h, bf as O, B as R } from "./ChaiBuilderEditor-3xIN-AP_.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";
|
|
@@ -15,13 +15,12 @@ import "jotai";
|
|
|
15
15
|
import "i18next";
|
|
16
16
|
import "react-i18next";
|
|
17
17
|
import "flagged";
|
|
18
|
-
import "./
|
|
18
|
+
import "./MODIFIERS-fd5XOmum.js";
|
|
19
19
|
import "./Functions-7jnEwJyw.js";
|
|
20
20
|
import "tailwind-merge";
|
|
21
21
|
import "@chaibuilder/runtime";
|
|
22
|
-
import "./MODIFIERS-cBT31iqE.js";
|
|
23
22
|
import "tree-model";
|
|
24
|
-
import "./utils-
|
|
23
|
+
import "./utils-VpVqnC9m.js";
|
|
25
24
|
import "@radix-ui/react-toggle";
|
|
26
25
|
import "class-variance-authority";
|
|
27
26
|
import "@radix-ui/react-switch";
|
|
@@ -44,6 +43,7 @@ import "@radix-ui/react-context-menu";
|
|
|
44
43
|
import "react-icons-picker";
|
|
45
44
|
import "react-quill";
|
|
46
45
|
import "react-hotkeys-hook";
|
|
46
|
+
import "./index-YpnaudSM.js";
|
|
47
47
|
const k = async (x, g) => new Promise((o, r) => {
|
|
48
48
|
B({ accessKey: g }).search.getPhotos(x).then((i) => {
|
|
49
49
|
o(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, bf as A } from "./ChaiBuilderEditor-
|
|
6
|
+
import { h as v, bf as A } from "./ChaiBuilderEditor-3xIN-AP_.js";
|
|
7
7
|
import "./_commonjsHelpers-UyOWmZb0.js";
|
|
8
8
|
import "clsx";
|
|
9
9
|
import "react-dom";
|
|
@@ -12,14 +12,13 @@ import "@floating-ui/react-dom";
|
|
|
12
12
|
import "i18next";
|
|
13
13
|
import "react-i18next";
|
|
14
14
|
import "flagged";
|
|
15
|
-
import "./
|
|
15
|
+
import "./MODIFIERS-fd5XOmum.js";
|
|
16
16
|
import "./Functions-7jnEwJyw.js";
|
|
17
17
|
import "tailwind-merge";
|
|
18
18
|
import "@chaibuilder/runtime";
|
|
19
19
|
import "@react-hookz/web";
|
|
20
|
-
import "./MODIFIERS-cBT31iqE.js";
|
|
21
20
|
import "tree-model";
|
|
22
|
-
import "./utils-
|
|
21
|
+
import "./utils-VpVqnC9m.js";
|
|
23
22
|
import "@radix-ui/react-toggle";
|
|
24
23
|
import "class-variance-authority";
|
|
25
24
|
import "@radix-ui/react-switch";
|
|
@@ -43,6 +42,7 @@ import "react-icons-picker";
|
|
|
43
42
|
import "react-quill";
|
|
44
43
|
import "react-hotkeys-hook";
|
|
45
44
|
import "lucide-react";
|
|
45
|
+
import "./index-YpnaudSM.js";
|
|
46
46
|
const R = F([]), Ie = ({ isModalView: r, onSelect: a }) => {
|
|
47
47
|
const p = v("uploadMediaCallback"), m = v("fetchMediaCallback"), [o, n] = E(R), [s, u] = l(!1), [x, f] = l(!1), [d, c] = l(), [h, y] = l("");
|
|
48
48
|
w(() => {
|
|
@@ -0,0 +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-ZRHqW7Gd.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("./MODIFIERS-mVmfEGgo.cjs");require("./Functions-N3yhPYKY.cjs");require("tailwind-merge");require("@chaibuilder/runtime");require("@react-hookz/web");require("tree-model");require("./utils-D_vtk3zK.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("./index-ecnGWzh9.cjs");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;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-Z_BpKhVy.cjs"),x=require("react"),P=require("lodash-es"),t=require("./ChaiBuilderEditor-ZRHqW7Gd.cjs"),g=require("./controls-rRZhz0vu.cjs"),R=require("./form-KWYHDVIf.cjs"),f=require("./index-VOrp9ZpX.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("./MODIFIERS-mVmfEGgo.cjs");require("./Functions-N3yhPYKY.cjs");require("tailwind-merge");require("@chaibuilder/runtime");require("@react-hookz/web");require("tree-model");require("./utils-D_vtk3zK.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("./index-ecnGWzh9.cjs");require("@rjsf/core");require("@rjsf/validator-ajv8");require("./core.cjs");require("sonner");require("./html-to-json-O1OpqICe.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.g({title:"Page Name",default:r.name}),slug:g.g({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 {
|
|
5
|
-
import {
|
|
6
|
-
import { F as D } from "./form-
|
|
7
|
-
import { e as N } from "./index-
|
|
4
|
+
import { Z as C, B as u, Y as b, aa as A } from "./ChaiBuilderEditor-3xIN-AP_.js";
|
|
5
|
+
import { g } from "./controls-yjgoZzB6.js";
|
|
6
|
+
import { F as D } from "./form-PQSmqcIl.js";
|
|
7
|
+
import { e as N } from "./index-i2kgLkjC.js";
|
|
8
8
|
import "./_commonjsHelpers-UyOWmZb0.js";
|
|
9
9
|
import "clsx";
|
|
10
10
|
import "react-dom";
|
|
@@ -14,14 +14,13 @@ import "jotai";
|
|
|
14
14
|
import "i18next";
|
|
15
15
|
import "react-i18next";
|
|
16
16
|
import "flagged";
|
|
17
|
-
import "./
|
|
17
|
+
import "./MODIFIERS-fd5XOmum.js";
|
|
18
18
|
import "./Functions-7jnEwJyw.js";
|
|
19
19
|
import "tailwind-merge";
|
|
20
20
|
import "@chaibuilder/runtime";
|
|
21
21
|
import "@react-hookz/web";
|
|
22
|
-
import "./MODIFIERS-cBT31iqE.js";
|
|
23
22
|
import "tree-model";
|
|
24
|
-
import "./utils-
|
|
23
|
+
import "./utils-VpVqnC9m.js";
|
|
25
24
|
import "@radix-ui/react-toggle";
|
|
26
25
|
import "class-variance-authority";
|
|
27
26
|
import "@radix-ui/react-switch";
|
|
@@ -46,11 +45,12 @@ import "react-icons-picker";
|
|
|
46
45
|
import "react-quill";
|
|
47
46
|
import "react-hotkeys-hook";
|
|
48
47
|
import "lucide-react";
|
|
48
|
+
import "./index-YpnaudSM.js";
|
|
49
49
|
import "@rjsf/core";
|
|
50
50
|
import "@rjsf/validator-ajv8";
|
|
51
51
|
import "./core.js";
|
|
52
52
|
import "sonner";
|
|
53
|
-
import "./html-to-json-
|
|
53
|
+
import "./html-to-json-GJ6RioQf.js";
|
|
54
54
|
import "himalaya";
|
|
55
55
|
const S = ({ closeModal: e }) => {
|
|
56
56
|
var a, s;
|
|
@@ -79,7 +79,7 @@ const S = ({ closeModal: e }) => {
|
|
|
79
79
|
}),
|
|
80
80
|
slug: g({ title: "Page Slug", default: o.slug })
|
|
81
81
|
};
|
|
82
|
-
return /* @__PURE__ */ t.jsxs(
|
|
82
|
+
return /* @__PURE__ */ t.jsxs(C, { children: [
|
|
83
83
|
/* @__PURE__ */ t.jsx("div", { className: "px-1 font-bold", children: "Add Page" }),
|
|
84
84
|
/* @__PURE__ */ t.jsx(D, { formData: o, properties: P, onChange: h, disabled: i.isPending }),
|
|
85
85
|
/* @__PURE__ */ t.jsx("div", { className: "flex items-center justify-end", children: /* @__PURE__ */ t.jsx(
|
|
@@ -92,13 +92,13 @@ const S = ({ closeModal: e }) => {
|
|
|
92
92
|
}
|
|
93
93
|
) })
|
|
94
94
|
] });
|
|
95
|
-
},
|
|
95
|
+
}, vt = () => {
|
|
96
96
|
const [e, i] = c(!1);
|
|
97
|
-
return /* @__PURE__ */ t.jsxs(
|
|
97
|
+
return /* @__PURE__ */ t.jsxs(b, { open: e, onOpenChange: () => i(!e), children: [
|
|
98
98
|
/* @__PURE__ */ t.jsx(A, { asChild: !0, children: /* @__PURE__ */ t.jsx(u, { size: "sm", variant: "link", className: "text-blue-500", onClick: () => i(!e), children: "+ New Page" }) }),
|
|
99
99
|
e && /* @__PURE__ */ t.jsx(S, { closeModal: () => i(!e) })
|
|
100
100
|
] });
|
|
101
101
|
};
|
|
102
102
|
export {
|
|
103
|
-
|
|
103
|
+
vt as default
|
|
104
104
|
};
|
|
@@ -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-3xIN-AP_.js";
|
|
3
3
|
import "./_commonjsHelpers-UyOWmZb0.js";
|
|
4
4
|
import "react";
|
|
5
5
|
import "clsx";
|
|
@@ -11,14 +11,13 @@ import "i18next";
|
|
|
11
11
|
import "react-i18next";
|
|
12
12
|
import "flagged";
|
|
13
13
|
import "lodash-es";
|
|
14
|
-
import "./
|
|
14
|
+
import "./MODIFIERS-fd5XOmum.js";
|
|
15
15
|
import "./Functions-7jnEwJyw.js";
|
|
16
16
|
import "tailwind-merge";
|
|
17
17
|
import "@chaibuilder/runtime";
|
|
18
18
|
import "@react-hookz/web";
|
|
19
|
-
import "./MODIFIERS-cBT31iqE.js";
|
|
20
19
|
import "tree-model";
|
|
21
|
-
import "./utils-
|
|
20
|
+
import "./utils-VpVqnC9m.js";
|
|
22
21
|
import "@radix-ui/react-toggle";
|
|
23
22
|
import "class-variance-authority";
|
|
24
23
|
import "@radix-ui/react-switch";
|
|
@@ -43,6 +42,7 @@ import "react-icons-picker";
|
|
|
43
42
|
import "react-quill";
|
|
44
43
|
import "react-hotkeys-hook";
|
|
45
44
|
import "lucide-react";
|
|
45
|
+
import "./index-YpnaudSM.js";
|
|
46
46
|
const ei = ({
|
|
47
47
|
open: o,
|
|
48
48
|
onCancel: m = () => {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-Z_BpKhVy.cjs"),r=require("./ChaiBuilderEditor-ZRHqW7Gd.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("./MODIFIERS-mVmfEGgo.cjs");require("./Functions-N3yhPYKY.cjs");require("tailwind-merge");require("@chaibuilder/runtime");require("@react-hookz/web");require("tree-model");require("./utils-D_vtk3zK.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("./index-ecnGWzh9.cjs");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;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const t=require("lodash-es"),a="#styles:",n=i=>({type:"singular",default:i.default||"",binding:t.get(i,"binding",!0),dataType:"string",schema:{type:"string",...t.omit(i,["i18n","required"])},uiSchema:{"ui:widget":"code"}});const d=i=>({type:"singular",default:i.default||"",binding:t.get(i,"binding",!0),dataType:"string",required:i.required||!1,ai:i.ai||void 0,schema:{type:"string",...t.omit(i,["ai","required"])},uiSchema:{"ui:placeholder":i.placeholder||"Enter here"}}),r=i=>({type:"singular",default:i.default||"",binding:t.get(i,"binding",!0),dataType:"string",required:i.required||!1,ai:i.ai||void 0,schema:{type:"string",...t.omit(i,["i18n","required","rows"])},uiSchema:{"ui:widget":"textarea","ui:placeholder":i.placeholder||"Enter here","ui:options":{rows:i.rows||4}}}),u=i=>({type:"singular",i18n:i.i18n||!1,default:i.default||!1,dataType:"boolean",binding:t.get(i,"binding",!0),ai:i.ai||void 0,schema:{type:"boolean",...t.omit(i,["i18n","required"])},uiSchema:{"ui:title":i.title||"Select Item","ui:description":""}}),g=i=>({type:"singular",default:i.default||"",binding:t.get(i,"binding",!0),dataType:"number",required:i.required||!1,ai:i.ai||void 0,schema:{type:"number",...t.omit(i,["i18n","required"])},uiSchema:{}}),l=i=>({type:"singular",default:i.default||"",binding:t.get(i,"binding",!0),required:i.required||!1,dataType:"string",ai:i.ai||void 0,schema:{type:"string",...t.omit(i,["i18n","required","options","binding"]),oneOf:i.options.map(e=>({const:e.value,title:e.title}))},uiSchema:{"ui:widget":"select"}}),s=i=>({type:"singular",i18n:i.i18n||!1,default:i.default||"",binding:t.get(i,"binding",!0),dataType:"string",ai:i.ai||void 0,schema:{type:"string",...t.omit(i,["i18n","required"])},uiSchema:{"ui:widget":"color"}});const p=i=>({type:"singular",default:i.default||"",binding:t.get(i,"binding",!0),dataType:"string",ai:i.ai||void 0,schema:{type:"string",...t.omit(i,["i18n","required"])},uiSchema:{"ui:widget":"richtext"}}),o=i=>({type:"model",title:i.title,dataType:"object",default:i.default||{},binding:t.get(i,"binding",!0),properties:i.properties}),y=i=>({type:"list",itemProperties:i.itemProperties,binding:t.get(i,"binding",!0),title:i.title,ai:i.ai||void 0,dataType:"array",default:i.default||[],itemTitle:i.getItemLabel?i.getItemLabel({}):()=>""}),m=i=>({type:"styles",binding:!1,default:`${a},${i.default||""}`,presets:i.presets||{}}),c=i=>({default:i.default||"",binding:t.get(i,"binding",!0),type:"singular",dataType:"string",ai:i.ai||void 0,schema:{type:"string",title:"Icon",default:i.default||""},uiSchema:{"ui:widget":"icon"}}),b=i=>({default:i.default,type:"singular",binding:t.get(i,"binding",!0),dataType:"object",ai:i.ai||void 0,schema:{type:"object",...i||{},properties:{type:{type:"string"},href:{type:"string"},target:{type:"string"}}},uiSchema:{"ui:field":"link"}}),f=i=>({type:"singular",default:i.default||"",binding:t.get(i,"binding",!0),dataType:"string",ai:i.ai||void 0,schema:{type:"string",...t.omit(i,["i18n","required"])},uiSchema:{"ui:widget":"image"}});exports.S=y;exports.T=c;exports.b=p;exports.c=u;exports.f=l;exports.g=d;exports.h=o;exports.o=m;exports.q=b;exports.r=r;exports.s=s;exports.u=n;exports.v=f;exports.y=g;
|
|
@@ -1,6 +1,18 @@
|
|
|
1
1
|
import { get as t, omit as e } from "lodash-es";
|
|
2
|
-
const n = "#styles:"
|
|
3
|
-
|
|
2
|
+
const n = "#styles:", r = (i) => ({
|
|
3
|
+
type: "singular",
|
|
4
|
+
default: i.default || "",
|
|
5
|
+
binding: t(i, "binding", !0),
|
|
6
|
+
dataType: "string",
|
|
7
|
+
schema: {
|
|
8
|
+
type: "string",
|
|
9
|
+
...e(i, ["i18n", "required"])
|
|
10
|
+
},
|
|
11
|
+
uiSchema: {
|
|
12
|
+
"ui:widget": "code"
|
|
13
|
+
}
|
|
14
|
+
});
|
|
15
|
+
const u = (i) => ({
|
|
4
16
|
type: "singular",
|
|
5
17
|
default: i.default || "",
|
|
6
18
|
binding: t(i, "binding", !0),
|
|
@@ -14,7 +26,7 @@ const r = (i) => ({
|
|
|
14
26
|
uiSchema: {
|
|
15
27
|
"ui:placeholder": i.placeholder || "Enter here"
|
|
16
28
|
}
|
|
17
|
-
}),
|
|
29
|
+
}), l = (i) => ({
|
|
18
30
|
type: "singular",
|
|
19
31
|
default: i.default || "",
|
|
20
32
|
binding: t(i, "binding", !0),
|
|
@@ -32,7 +44,7 @@ const r = (i) => ({
|
|
|
32
44
|
rows: i.rows || 4
|
|
33
45
|
}
|
|
34
46
|
}
|
|
35
|
-
}),
|
|
47
|
+
}), g = (i) => ({
|
|
36
48
|
type: "singular",
|
|
37
49
|
i18n: i.i18n || !1,
|
|
38
50
|
default: i.default || !1,
|
|
@@ -59,7 +71,7 @@ const r = (i) => ({
|
|
|
59
71
|
...e(i, ["i18n", "required"])
|
|
60
72
|
},
|
|
61
73
|
uiSchema: {}
|
|
62
|
-
}),
|
|
74
|
+
}), p = (i) => ({
|
|
63
75
|
type: "singular",
|
|
64
76
|
default: i.default || "",
|
|
65
77
|
binding: t(i, "binding", !0),
|
|
@@ -74,7 +86,7 @@ const r = (i) => ({
|
|
|
74
86
|
uiSchema: {
|
|
75
87
|
"ui:widget": "select"
|
|
76
88
|
}
|
|
77
|
-
}),
|
|
89
|
+
}), y = (i) => ({
|
|
78
90
|
type: "singular",
|
|
79
91
|
i18n: i.i18n || !1,
|
|
80
92
|
default: i.default || "",
|
|
@@ -89,7 +101,7 @@ const r = (i) => ({
|
|
|
89
101
|
"ui:widget": "color"
|
|
90
102
|
}
|
|
91
103
|
});
|
|
92
|
-
const
|
|
104
|
+
const o = (i) => ({
|
|
93
105
|
type: "singular",
|
|
94
106
|
default: i.default || "",
|
|
95
107
|
binding: t(i, "binding", !0),
|
|
@@ -102,7 +114,7 @@ const y = (i) => ({
|
|
|
102
114
|
uiSchema: {
|
|
103
115
|
"ui:widget": "richtext"
|
|
104
116
|
}
|
|
105
|
-
}),
|
|
117
|
+
}), c = (i) => ({
|
|
106
118
|
type: "model",
|
|
107
119
|
title: i.title,
|
|
108
120
|
dataType: "object",
|
|
@@ -118,12 +130,12 @@ const y = (i) => ({
|
|
|
118
130
|
dataType: "array",
|
|
119
131
|
default: i.default || [],
|
|
120
132
|
itemTitle: i.getItemLabel ? i.getItemLabel({}) : () => ""
|
|
121
|
-
}),
|
|
133
|
+
}), b = (i) => ({
|
|
122
134
|
type: "styles",
|
|
123
135
|
binding: !1,
|
|
124
136
|
default: `${n},${i.default || ""}`,
|
|
125
137
|
presets: i.presets || {}
|
|
126
|
-
}),
|
|
138
|
+
}), f = (i) => ({
|
|
127
139
|
default: i.default || "",
|
|
128
140
|
binding: t(i, "binding", !0),
|
|
129
141
|
type: "singular",
|
|
@@ -137,7 +149,7 @@ const y = (i) => ({
|
|
|
137
149
|
uiSchema: {
|
|
138
150
|
"ui:widget": "icon"
|
|
139
151
|
}
|
|
140
|
-
}),
|
|
152
|
+
}), h = (i) => ({
|
|
141
153
|
default: i.default,
|
|
142
154
|
type: "singular",
|
|
143
155
|
binding: t(i, "binding", !0),
|
|
@@ -155,7 +167,7 @@ const y = (i) => ({
|
|
|
155
167
|
uiSchema: {
|
|
156
168
|
"ui:field": "link"
|
|
157
169
|
}
|
|
158
|
-
}),
|
|
170
|
+
}), q = (i) => ({
|
|
159
171
|
type: "singular",
|
|
160
172
|
default: i.default || "",
|
|
161
173
|
binding: t(i, "binding", !0),
|
|
@@ -170,17 +182,18 @@ const y = (i) => ({
|
|
|
170
182
|
}
|
|
171
183
|
});
|
|
172
184
|
export {
|
|
173
|
-
|
|
185
|
+
m as S,
|
|
174
186
|
f as T,
|
|
175
187
|
o as b,
|
|
176
|
-
|
|
188
|
+
g as c,
|
|
177
189
|
p as f,
|
|
178
190
|
u as g,
|
|
179
|
-
|
|
180
|
-
r as l,
|
|
181
|
-
y as m,
|
|
191
|
+
c as h,
|
|
182
192
|
b as o,
|
|
183
193
|
h as q,
|
|
184
194
|
l as r,
|
|
185
|
-
|
|
195
|
+
y as s,
|
|
196
|
+
r as u,
|
|
197
|
+
q as v,
|
|
198
|
+
s as y
|
|
186
199
|
};
|
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-ZRHqW7Gd.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("./MODIFIERS-mVmfEGgo.cjs");require("./Functions-N3yhPYKY.cjs");require("tailwind-merge");require("@chaibuilder/runtime");require("@react-hookz/web");require("tree-model");require("./utils-D_vtk3zK.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("./index-ecnGWzh9.cjs");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,
|
|
1
|
+
import { C as K, l as N, T as Q, m as V, V as X, n as Z, S as Y, 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, G as Cs, H as Ss, U as Ps, L as gs, J as vs, I as ys, K as As, R as Is, W as hs, X as Ms, M as Rs, O as Ds, N as Us, j as Ts, P as xs, Q as Hs } from "./ChaiBuilderEditor-3xIN-AP_.js";
|
|
2
2
|
import { useTranslation as bs } from "react-i18next";
|
|
3
3
|
import "./jsx-runtime-WbnYoNE9.js";
|
|
4
4
|
import "./_commonjsHelpers-UyOWmZb0.js";
|
|
@@ -11,14 +11,13 @@ import "jotai";
|
|
|
11
11
|
import "i18next";
|
|
12
12
|
import "flagged";
|
|
13
13
|
import "lodash-es";
|
|
14
|
-
import "./
|
|
14
|
+
import "./MODIFIERS-fd5XOmum.js";
|
|
15
15
|
import "./Functions-7jnEwJyw.js";
|
|
16
16
|
import "tailwind-merge";
|
|
17
17
|
import "@chaibuilder/runtime";
|
|
18
18
|
import "@react-hookz/web";
|
|
19
|
-
import "./MODIFIERS-cBT31iqE.js";
|
|
20
19
|
import "tree-model";
|
|
21
|
-
import "./utils-
|
|
20
|
+
import "./utils-VpVqnC9m.js";
|
|
22
21
|
import "@radix-ui/react-toggle";
|
|
23
22
|
import "class-variance-authority";
|
|
24
23
|
import "@radix-ui/react-switch";
|
|
@@ -43,14 +42,15 @@ import "react-icons-picker";
|
|
|
43
42
|
import "react-quill";
|
|
44
43
|
import "react-hotkeys-hook";
|
|
45
44
|
import "lucide-react";
|
|
45
|
+
import "./index-YpnaudSM.js";
|
|
46
46
|
export {
|
|
47
47
|
K as ChaiBuilderEditor,
|
|
48
48
|
N as useActiveModal,
|
|
49
49
|
Q as useActivePanel,
|
|
50
50
|
V as useAddBlock,
|
|
51
51
|
X as useAddBlockParent,
|
|
52
|
-
|
|
53
|
-
|
|
52
|
+
Z as useAddClassesToBlocks,
|
|
53
|
+
Y as useAllBlocks,
|
|
54
54
|
_ as useBlocksStore,
|
|
55
55
|
$ as useBrandingOptions,
|
|
56
56
|
ss as useBuilderProp,
|