@chaibuilder/sdk 0.1.28 → 0.1.30
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-b911e9a5.js → AddBlocks-4f2c5dc4.js} +1 -1
- package/dist/{AddBlocks-d8eeb0dd.cjs → AddBlocks-5ca17264.cjs} +1 -1
- package/dist/{BrandingOptions-a8616f59.cjs → BrandingOptions-0773c5fd.cjs} +1 -1
- package/dist/{BrandingOptions-4032f865.js → BrandingOptions-2044d3cb.js} +1 -1
- package/dist/{CanvasArea-b7d0a194.js → CanvasArea-575f601e.js} +2 -2
- package/dist/{CanvasArea-27ab7707.cjs → CanvasArea-71355900.cjs} +2 -2
- package/dist/{CurrentPage-e13ae173.cjs → CurrentPage-09c74e35.cjs} +1 -1
- package/dist/{CurrentPage-55258bb1.js → CurrentPage-e6f23078.js} +1 -1
- package/dist/{Layers-112b19c0.cjs → Layers-975fed10.cjs} +1 -1
- package/dist/{Layers-1405e155.js → Layers-a7dc3c09.js} +2 -2
- package/dist/{MarkAsGlobalBlock-84173746.js → MarkAsGlobalBlock-39df9332.js} +1 -1
- package/dist/{MarkAsGlobalBlock-322ed7f1.cjs → MarkAsGlobalBlock-b988f89e.cjs} +1 -1
- package/dist/{PagesPanel-34789f58.js → PagesPanel-9de2d25b.js} +2 -2
- package/dist/{PagesPanel-2a46af87.cjs → PagesPanel-ba746cd1.cjs} +1 -1
- package/dist/{ProjectPanel-c9ed0480.js → ProjectPanel-862243ef.js} +2 -2
- package/dist/{ProjectPanel-555e1a66.cjs → ProjectPanel-eef9f5d4.cjs} +1 -1
- package/dist/{Settings-13aa6dcd.cjs → Settings-8796249e.cjs} +1 -1
- package/dist/{Settings-99578adc.js → Settings-8b2a5a12.js} +1 -1
- package/dist/SidePanels-41116ddd.cjs +1 -0
- package/dist/{SidePanels-f3e07c15.js → SidePanels-c1abd140.js} +56 -57
- package/dist/{Topbar-4c71d6a1.js → Topbar-3f8ee9ec.js} +1 -1
- package/dist/{Topbar-004f71e2.cjs → Topbar-f622beef.cjs} +1 -1
- package/dist/{add-page-modal-38a486dc.js → add-page-modal-3be04ab6.js} +1 -1
- package/dist/{add-page-modal-4ec6974d.cjs → add-page-modal-7c2eea7f.cjs} +1 -1
- package/dist/core.cjs +1 -1
- package/dist/core.js +1 -1
- package/dist/{delete-page-modal-344825c3.cjs → delete-page-modal-13bf57f1.cjs} +1 -1
- package/dist/{delete-page-modal-54c2f791.js → delete-page-modal-e6d85612.js} +1 -1
- package/dist/{index-b534abc9.js → index-91c0470a.js} +12 -9
- package/dist/{index-ca6f6afc.cjs → index-a954d733.cjs} +2 -2
- package/dist/{page-viewer-3a0c13aa.js → page-viewer-18a13862.js} +2 -2
- package/dist/{page-viewer-e0542daa.cjs → page-viewer-e0508ce9.cjs} +1 -1
- package/dist/{project-general-setting-791e767e.js → project-general-setting-4c7172c1.js} +1 -1
- package/dist/{project-general-setting-21c0f38d.cjs → project-general-setting-66ba78e9.cjs} +1 -1
- package/dist/{single-page-detail-5e257353.cjs → single-page-detail-6872bd4d.cjs} +1 -1
- package/dist/{single-page-detail-6c623469.js → single-page-detail-6ece84b9.js} +2 -2
- package/package.json +2 -2
- package/dist/SidePanels-d6bdd8bd.cjs +0 -1
|
@@ -1,19 +1,18 @@
|
|
|
1
1
|
import { j as e } from "./jsx-runtime-944c88e2.js";
|
|
2
2
|
import { PlusIcon as V, Half2Icon as E } from "@radix-ui/react-icons";
|
|
3
|
-
import
|
|
4
|
-
import { useAtom as
|
|
5
|
-
import { filter as g, map as k, isNull as
|
|
3
|
+
import h, { useMemo as L, useState as u, useEffect as M, lazy as N, Suspense as j } from "react";
|
|
4
|
+
import { useAtom as w } from "jotai";
|
|
5
|
+
import { filter as g, map as k, isNull as H, isEmpty as I, find as R, each as _, get as F } from "lodash";
|
|
6
6
|
import { u as C, B as b, S as D } from "./useBuilderProp-81a14920.js";
|
|
7
7
|
import { T as O, a as Y, b as A, c as P } from "./tabs-85caa1e8.js";
|
|
8
|
-
import { u as
|
|
8
|
+
import { u as U, p as $, E as J, a as Z, b as q } from "./index-91c0470a.js";
|
|
9
9
|
import "react-i18next";
|
|
10
|
-
import { c as
|
|
11
|
-
import { ListTreeIcon as S, DatabaseIcon as
|
|
12
|
-
import { getChaiDataProviders as
|
|
13
|
-
import { A as
|
|
14
|
-
import { D as
|
|
15
|
-
import { S as
|
|
16
|
-
import fe from "react-json-view";
|
|
10
|
+
import { c as G } from "./utils-ac68b2c8.js";
|
|
11
|
+
import { ListTreeIcon as S, DatabaseIcon as Q } from "lucide-react";
|
|
12
|
+
import { getChaiDataProviders as W } from "@chaibuilder/blocks";
|
|
13
|
+
import { A as X, a as ee, b as se, c as re, e as ae, f as le, d as ie, h as te, g as oe } from "./alert-dialog-ee98f47e.js";
|
|
14
|
+
import { D as ne, a as ce, c as de, e as me, f as xe } from "./dialog-3d4e82ed.js";
|
|
15
|
+
import { S as ue, c as pe, b as he, d as fe, f as T } from "./select-7fddd7c3.js";
|
|
17
16
|
import "@radix-ui/react-slot";
|
|
18
17
|
import "class-variance-authority";
|
|
19
18
|
import "@radix-ui/react-tooltip";
|
|
@@ -39,20 +38,20 @@ import "tailwind-merge";
|
|
|
39
38
|
import "@radix-ui/react-alert-dialog";
|
|
40
39
|
import "@radix-ui/react-dialog";
|
|
41
40
|
import "@radix-ui/react-select";
|
|
42
|
-
const ve = ({ provider: r, onClose: o }) => {
|
|
41
|
+
const ve = h.lazy(() => import("react-json-view")), je = ({ provider: r, onClose: o }) => {
|
|
43
42
|
const [a, n] = u(null);
|
|
44
|
-
return
|
|
43
|
+
return M(() => {
|
|
45
44
|
r && (r.mockFn ? r.mockFn : r.dataFn)().then((c) => n(c));
|
|
46
|
-
}, [r]), r ? /* @__PURE__ */ e.jsx(
|
|
47
|
-
/* @__PURE__ */ e.jsxs(
|
|
48
|
-
/* @__PURE__ */ e.jsxs(
|
|
45
|
+
}, [r]), r ? /* @__PURE__ */ e.jsx(ne, { onOpenChange: (i) => i ? "" : o(), defaultOpen: !0, children: /* @__PURE__ */ e.jsxs(ce, { children: [
|
|
46
|
+
/* @__PURE__ */ e.jsxs(de, { children: [
|
|
47
|
+
/* @__PURE__ */ e.jsxs(me, { children: [
|
|
49
48
|
"Data Provider: ",
|
|
50
49
|
r.name
|
|
51
50
|
] }),
|
|
52
|
-
/* @__PURE__ */ e.jsx(
|
|
51
|
+
/* @__PURE__ */ e.jsx(xe, { children: r.description })
|
|
53
52
|
] }),
|
|
54
|
-
/* @__PURE__ */ e.jsx(
|
|
55
|
-
|
|
53
|
+
/* @__PURE__ */ e.jsx(J, { children: /* @__PURE__ */ e.jsx(
|
|
54
|
+
ve,
|
|
56
55
|
{
|
|
57
56
|
style: { maxHeight: "80vh", overflowY: "auto" },
|
|
58
57
|
name: r.providerKey,
|
|
@@ -61,56 +60,56 @@ const ve = ({ provider: r, onClose: o }) => {
|
|
|
61
60
|
displayDataTypes: !1,
|
|
62
61
|
src: a
|
|
63
62
|
}
|
|
64
|
-
)
|
|
63
|
+
) })
|
|
65
64
|
] }) }) : null;
|
|
66
65
|
};
|
|
67
|
-
function
|
|
66
|
+
function ge({
|
|
68
67
|
children: r,
|
|
69
68
|
name: o,
|
|
70
69
|
onRemove: a
|
|
71
70
|
}) {
|
|
72
|
-
return /* @__PURE__ */ e.jsxs(
|
|
73
|
-
/* @__PURE__ */ e.jsx(
|
|
74
|
-
/* @__PURE__ */ e.jsxs(
|
|
75
|
-
/* @__PURE__ */ e.jsxs(
|
|
76
|
-
/* @__PURE__ */ e.jsxs(
|
|
71
|
+
return /* @__PURE__ */ e.jsxs(X, { children: [
|
|
72
|
+
/* @__PURE__ */ e.jsx(ee, { asChild: !0, children: r }),
|
|
73
|
+
/* @__PURE__ */ e.jsxs(se, { children: [
|
|
74
|
+
/* @__PURE__ */ e.jsxs(re, { children: [
|
|
75
|
+
/* @__PURE__ */ e.jsxs(ae, { children: [
|
|
77
76
|
"Are you sure, you want to remove ",
|
|
78
77
|
/* @__PURE__ */ e.jsx("span", { className: "text-blue-500", children: o }),
|
|
79
78
|
" provider?"
|
|
80
79
|
] }),
|
|
81
|
-
/* @__PURE__ */ e.jsx(
|
|
80
|
+
/* @__PURE__ */ e.jsx(le, { children: "Your data provider will be removed from this page and all added data binding will be not visible on blocks." })
|
|
82
81
|
] }),
|
|
83
|
-
/* @__PURE__ */ e.jsxs(
|
|
84
|
-
/* @__PURE__ */ e.jsx(
|
|
85
|
-
/* @__PURE__ */ e.jsx(
|
|
82
|
+
/* @__PURE__ */ e.jsxs(ie, { children: [
|
|
83
|
+
/* @__PURE__ */ e.jsx(te, { children: "Cancel" }),
|
|
84
|
+
/* @__PURE__ */ e.jsx(oe, { onClick: a, className: "bg-red-600 hover:bg-red-700", children: "Remove" })
|
|
86
85
|
] })
|
|
87
86
|
] })
|
|
88
87
|
] });
|
|
89
88
|
}
|
|
90
|
-
const
|
|
91
|
-
const r =
|
|
89
|
+
const be = () => {
|
|
90
|
+
const r = L(() => W(), []), [o, a] = U(), [, n] = w($), [i, c] = u(
|
|
92
91
|
g(r, (s) => k(o, "providerKey").includes(s.providerKey))
|
|
93
|
-
), [m, y] = u(""), [
|
|
92
|
+
), [m, y] = u(""), [f, t] = u(null), v = g(
|
|
94
93
|
r.map((s) => k(i, "providerKey").includes(s.providerKey) ? null : { value: s.providerKey, label: s.name }),
|
|
95
|
-
(s) => !
|
|
94
|
+
(s) => !H(s)
|
|
96
95
|
), l = (s) => {
|
|
97
|
-
const x =
|
|
96
|
+
const x = R(r, { providerKey: s });
|
|
98
97
|
c((d) => [...d, x]), a((d) => [...d, { providerKey: x.providerKey, args: {} }]), y(""), n("UNSAVED");
|
|
99
98
|
}, p = (s) => {
|
|
100
99
|
c((x) => g(x, (d) => d.providerKey !== s.providerKey)), a((x) => g(x, (d) => d.providerKey !== s.providerKey)), n("UNSAVED");
|
|
101
100
|
}, B = (s) => t(s);
|
|
102
|
-
return
|
|
101
|
+
return I(r) ? /* @__PURE__ */ e.jsx("div", { children: /* @__PURE__ */ e.jsxs("p", { className: "text-gray-500 mb-1.5 text-xs p-4", children: [
|
|
103
102
|
"You have no data providers registered. Please add a data provider to your project. ",
|
|
104
103
|
/* @__PURE__ */ e.jsx("br", {}),
|
|
105
104
|
/* @__PURE__ */ e.jsx("a", { className: "text-blue-500", href: "https://chaibuilder.com/docs/registering-data-providers", target: "_blank", children: "Learn more" })
|
|
106
105
|
] }) }) : /* @__PURE__ */ e.jsxs("div", { className: "px-1", children: [
|
|
107
106
|
/* @__PURE__ */ e.jsx("br", {}),
|
|
108
107
|
/* @__PURE__ */ e.jsx("label", { children: /* @__PURE__ */ e.jsx("p", { className: "text-gray-500 mb-1.5 text-xs", children: "Add data providers:" }) }),
|
|
109
|
-
/* @__PURE__ */ e.jsx("div", { className: "flex items-center space-x-1", children: /* @__PURE__ */ e.jsxs(
|
|
110
|
-
/* @__PURE__ */ e.jsx(
|
|
111
|
-
/* @__PURE__ */ e.jsxs(
|
|
108
|
+
/* @__PURE__ */ e.jsx("div", { className: "flex items-center space-x-1", children: /* @__PURE__ */ e.jsxs(ue, { value: m, onValueChange: (s) => l(s), children: [
|
|
109
|
+
/* @__PURE__ */ e.jsx(pe, { className: "w-full", children: /* @__PURE__ */ e.jsx(he, { placeholder: "Select a provider" }) }),
|
|
110
|
+
/* @__PURE__ */ e.jsxs(fe, { children: [
|
|
112
111
|
/* @__PURE__ */ e.jsx(T, { value: "", children: "Choose" }),
|
|
113
|
-
|
|
112
|
+
v.map((s) => /* @__PURE__ */ e.jsx(T, { value: s.value, children: s.label }, s.value))
|
|
114
113
|
] })
|
|
115
114
|
] }) }),
|
|
116
115
|
/* @__PURE__ */ e.jsx("br", {}),
|
|
@@ -156,7 +155,7 @@ const ge = () => {
|
|
|
156
155
|
]
|
|
157
156
|
}
|
|
158
157
|
),
|
|
159
|
-
/* @__PURE__ */ e.jsx(
|
|
158
|
+
/* @__PURE__ */ e.jsx(ge, { onRemove: () => p(s), name: s.name, children: /* @__PURE__ */ e.jsxs("button", { className: "inline-flex items-center justify-center text-xs font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 underline-offset-4 hover:underline h-9 rounded-md px-3 text-red-500", children: [
|
|
160
159
|
/* @__PURE__ */ e.jsxs(
|
|
161
160
|
"svg",
|
|
162
161
|
{
|
|
@@ -184,23 +183,23 @@ const ge = () => {
|
|
|
184
183
|
},
|
|
185
184
|
s.providerKey
|
|
186
185
|
)) }),
|
|
187
|
-
/* @__PURE__ */ e.jsx(
|
|
186
|
+
/* @__PURE__ */ e.jsx(je, { onClose: () => t(null), provider: f })
|
|
188
187
|
] })
|
|
189
188
|
] });
|
|
190
|
-
}, K =
|
|
189
|
+
}, K = N(() => import("./Layers-a7dc3c09.js")), ye = N(() => import("./BrandingOptions-2044d3cb.js")), we = N(() => import("./ImagesPanel-38c44785.js"));
|
|
191
190
|
let z = null;
|
|
192
191
|
const cs = () => {
|
|
193
|
-
const r = C("sideBarComponents.top", []), o = C("sideBarComponents.bottom", []), [a, n] =
|
|
192
|
+
const r = C("sideBarComponents.top", []), o = C("sideBarComponents.bottom", []), [a, n] = w(Z), [i, c] = u(a), [m, y] = u(null), f = {
|
|
194
193
|
layers: K,
|
|
195
|
-
"branding-options":
|
|
196
|
-
images:
|
|
194
|
+
"branding-options": ye,
|
|
195
|
+
images: we
|
|
197
196
|
};
|
|
198
197
|
_(r, ({ name: l, panel: p }) => {
|
|
199
|
-
|
|
198
|
+
f[l] = p;
|
|
200
199
|
});
|
|
201
200
|
const t = (l) => {
|
|
202
|
-
clearTimeout(z),
|
|
203
|
-
}, [,
|
|
201
|
+
clearTimeout(z), v(!1), a !== "layers" && l === "layers" ? z = setTimeout(() => c("layers"), 500) : c(l), n(l);
|
|
202
|
+
}, [, v] = w(q);
|
|
204
203
|
return /* @__PURE__ */ e.jsxs("div", { className: "relative flex", children: [
|
|
205
204
|
/* @__PURE__ */ e.jsxs("div", { className: "z-[100] flex h-full w-fit flex-col items-center justify-between border-b border-r border-border bg-background pt-2", children: [
|
|
206
205
|
/* @__PURE__ */ e.jsxs("div", { className: "relative z-[100] flex w-14 flex-col items-center space-y-2", children: [
|
|
@@ -208,7 +207,7 @@ const cs = () => {
|
|
|
208
207
|
b,
|
|
209
208
|
{
|
|
210
209
|
onClick: () => {
|
|
211
|
-
|
|
210
|
+
v(!0), n("layers");
|
|
212
211
|
},
|
|
213
212
|
size: "sm",
|
|
214
213
|
variant: a === "add-blocks" ? "default" : "outline",
|
|
@@ -233,7 +232,7 @@ const cs = () => {
|
|
|
233
232
|
children: /* @__PURE__ */ e.jsx(E, { className: "w-4 max-w-[40px] text-xs" })
|
|
234
233
|
}
|
|
235
234
|
),
|
|
236
|
-
|
|
235
|
+
h.Children.toArray(
|
|
237
236
|
r.map(({ name: l, icon: p }) => /* @__PURE__ */ e.jsx(j, { fallback: /* @__PURE__ */ e.jsx(D, { className: "h-10" }), children: /* @__PURE__ */ e.jsx(
|
|
238
237
|
b,
|
|
239
238
|
{
|
|
@@ -246,7 +245,7 @@ const cs = () => {
|
|
|
246
245
|
) }))
|
|
247
246
|
)
|
|
248
247
|
] }),
|
|
249
|
-
/* @__PURE__ */ e.jsx("div", { className: "flex flex-col items-center space-y-2", children:
|
|
248
|
+
/* @__PURE__ */ e.jsx("div", { className: "flex flex-col items-center space-y-2", children: h.Children.toArray(
|
|
250
249
|
o.map((l) => /* @__PURE__ */ e.jsx(j, { fallback: /* @__PURE__ */ e.jsx(D, { className: "h-10" }), children: /* @__PURE__ */ e.jsx(l, {}) }))
|
|
251
250
|
) })
|
|
252
251
|
] }),
|
|
@@ -274,7 +273,7 @@ const cs = () => {
|
|
|
274
273
|
children: /* @__PURE__ */ e.jsx(
|
|
275
274
|
"div",
|
|
276
275
|
{
|
|
277
|
-
className:
|
|
276
|
+
className: G("relative h-full max-h-[93%] bg-background p-1", a === "layers" ? "" : "z-[100]"),
|
|
278
277
|
onMouseEnter: () => {
|
|
279
278
|
m && clearTimeout(m);
|
|
280
279
|
},
|
|
@@ -284,7 +283,7 @@ const cs = () => {
|
|
|
284
283
|
}, 1e3);
|
|
285
284
|
y(l);
|
|
286
285
|
},
|
|
287
|
-
children:
|
|
286
|
+
children: h.createElement(F(f, i, () => /* @__PURE__ */ e.jsx("div", {})))
|
|
288
287
|
}
|
|
289
288
|
)
|
|
290
289
|
}
|
|
@@ -306,7 +305,7 @@ const cs = () => {
|
|
|
306
305
|
" Layers"
|
|
307
306
|
] }),
|
|
308
307
|
/* @__PURE__ */ e.jsxs(A, { value: "data-provider", children: [
|
|
309
|
-
/* @__PURE__ */ e.jsx(
|
|
308
|
+
/* @__PURE__ */ e.jsx(Q, { className: "w-3 mr-2" }),
|
|
310
309
|
"Data"
|
|
311
310
|
] })
|
|
312
311
|
] }),
|
|
@@ -315,10 +314,10 @@ const cs = () => {
|
|
|
315
314
|
{
|
|
316
315
|
value: "layers",
|
|
317
316
|
className: "no-scrollbar -mx-1 -mr-2 h-full flex-1 overflow-y-auto overflow-x-hidden",
|
|
318
|
-
children:
|
|
317
|
+
children: h.createElement(K)
|
|
319
318
|
}
|
|
320
319
|
),
|
|
321
|
-
/* @__PURE__ */ e.jsx(P, { value: "data-provider", className: "flex-1 overflow-y-auto overflow-x-hidden", children: /* @__PURE__ */ e.jsx(
|
|
320
|
+
/* @__PURE__ */ e.jsx(P, { value: "data-provider", className: "flex-1 overflow-y-auto overflow-x-hidden", children: /* @__PURE__ */ e.jsx(be, {}) })
|
|
322
321
|
] })
|
|
323
322
|
}
|
|
324
323
|
) })
|
|
@@ -5,7 +5,7 @@ import { S as x, c as d, b as h, d as u, a as g, e as j, f as t } from "./select
|
|
|
5
5
|
import { u as i, d as f, e as v, f as S, S as c } from "./useBuilderProp-81a14920.js";
|
|
6
6
|
import { S as b } from "./separator-a80d065b.js";
|
|
7
7
|
import { T as N } from "./toggle-00c9d11e.js";
|
|
8
|
-
import { c as C } from "./index-
|
|
8
|
+
import { c as C } from "./index-91c0470a.js";
|
|
9
9
|
import { useTranslation as w } from "react-i18next";
|
|
10
10
|
import "@radix-ui/react-select";
|
|
11
11
|
import "./utils-ac68b2c8.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-5c3ac4f7.cjs"),i=require("react"),l=require("@radix-ui/react-icons"),r=require("./select-0e32300c.cjs"),s=require("./useBuilderProp-5e57d0c8.cjs"),o=require("./separator-a597dba7.cjs"),a=require("./toggle-b90fed97.cjs"),c=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-5c3ac4f7.cjs"),i=require("react"),l=require("@radix-ui/react-icons"),r=require("./select-0e32300c.cjs"),s=require("./useBuilderProp-5e57d0c8.cjs"),o=require("./separator-a597dba7.cjs"),a=require("./toggle-b90fed97.cjs"),c=require("./index-a954d733.cjs"),p=require("react-i18next");require("@radix-ui/react-select");require("./utils-3c452dd0.cjs");require("clsx");require("tailwind-merge");require("@radix-ui/react-slot");require("class-variance-authority");require("@radix-ui/react-tooltip");require("@radix-ui/react-toast");require("jotai");require("lodash");require("@radix-ui/react-separator");require("@radix-ui/react-toggle");require("./MODIFIERS-4716c669.cjs");require("@radix-ui/react-scroll-area");require("react-dom");require("@floating-ui/react-dom");require("i18next");require("flagged");require("react-dnd");require("@minoru/react-dnd-treeview");require("react-hotkeys-hook");require("flat-to-nested");require("./html-to-json-aadcbf66.cjs");require("himalaya");require("redux-undo");require("@react-hookz/web");require("@chaibuilder/blocks");require("lucide-react");require("sonner");const m=()=>s.useBuilderProp("languages",["en"]),j=()=>m().length===1?null:e.jsxRuntimeExports.jsx("div",{className:"flex items-center",children:e.jsxRuntimeExports.jsxs(r.Select,{children:[e.jsxRuntimeExports.jsx(r.SelectTrigger,{className:"w-[150px] border-0",children:e.jsxRuntimeExports.jsx(r.SelectValue,{placeholder:e.jsxRuntimeExports.jsxs("span",{className:"flex items-center",children:[e.jsxRuntimeExports.jsx(l.FontFamilyIcon,{className:"h-4 w-4"})," English(US)"]})})}),e.jsxRuntimeExports.jsx(r.SelectContent,{children:e.jsxRuntimeExports.jsxs(r.SelectGroup,{children:[e.jsxRuntimeExports.jsx(r.SelectLabel,{children:"Fruits"}),e.jsxRuntimeExports.jsx(r.SelectItem,{value:"apple",children:"Apple"}),e.jsxRuntimeExports.jsx(r.SelectItem,{value:"banana",children:"Banana"}),e.jsxRuntimeExports.jsx(r.SelectItem,{value:"blueberry",children:"Blueberry"}),e.jsxRuntimeExports.jsx(r.SelectItem,{value:"grapes",children:"Grapes"}),e.jsxRuntimeExports.jsx(r.SelectItem,{value:"pineapple",children:"Pineapple"})]})})]})}),d=()=>{const{savePage:x,syncState:t}=c.useSavePage(),{t:u}=p.useTranslation(),n=i.useMemo(()=>{switch(t){case"SAVING":return"animate-pulse bg-gray-500 text-gray-900";case"SAVED":return"bg-green-500 text-white hover:bg-green-600 hover:text-white";default:return"bg-gray-200 text-gray-500 hover:bg-gray-100"}},[t]);return e.jsxRuntimeExports.jsx("div",{className:"flex items-center",children:e.jsxRuntimeExports.jsxs(s.Tooltip,{children:[e.jsxRuntimeExports.jsx(s.TooltipTrigger,{asChild:!0,children:e.jsxRuntimeExports.jsxs(a.Toggle,{onClick:()=>x(),className:`flex h-auto w-20 items-center gap-x-1 rounded-full p-1 px-2 ${n}`,size:"sm",variant:"outline",children:[e.jsxRuntimeExports.jsx("svg",{fill:"currentColor",width:"16",height:"16",viewBox:"0 0 0.32 0.32",xmlns:"http://www.w3.org/2000/svg",children:e.jsxRuntimeExports.jsx("path",{fillRule:"evenodd",d:"M.274.086a.02.02 0 0 1 0 .028l-.12.12a.02.02 0 0 1-.028 0l-.06-.06A.02.02 0 0 1 .094.146L.14.192.246.086a.02.02 0 0 1 .028 0Z"})}),t==="SAVING"?"Saving...":t==="SAVED"?u("Saved"):"Save"]})}),e.jsxRuntimeExports.jsx(s.TooltipContent,{children:e.jsxRuntimeExports.jsx("p",{children:t==="SAVING"?"Saving...":t==="SAVED"?"Saved":"Save changes"})})]})})},h=()=>{const x=s.useBuilderProp("topBarComponents.left",[]),t=s.useBuilderProp("topBarComponents.center",[]),u=s.useBuilderProp("topBarComponents.right",[]);return e.jsxRuntimeExports.jsxs("div",{className:"flex h-14 items-center justify-between px-2",children:[e.jsxRuntimeExports.jsx("div",{className:"flex items-center space-x-2",children:e.jsxRuntimeExports.jsx("div",{className:"flex items-center space-x-2 font-bold",children:i.Children.toArray(x.map(n=>e.jsxRuntimeExports.jsx(i.Suspense,{fallback:e.jsxRuntimeExports.jsx(s.Skeleton,{className:"h-10"}),children:e.jsxRuntimeExports.jsx(n,{})})))})}),e.jsxRuntimeExports.jsx("div",{className:"flex items-center space-x-2",children:i.Children.toArray(t.map(n=>e.jsxRuntimeExports.jsx(i.Suspense,{fallback:e.jsxRuntimeExports.jsx(s.Skeleton,{className:"h-10"}),children:e.jsxRuntimeExports.jsx(n,{})})))}),e.jsxRuntimeExports.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsxRuntimeExports.jsx(j,{}),e.jsxRuntimeExports.jsx(o.Separator,{orientation:"vertical"}),e.jsxRuntimeExports.jsx(d,{}),i.Children.toArray(u.map(n=>e.jsxRuntimeExports.jsx(i.Suspense,{fallback:e.jsxRuntimeExports.jsx(s.Skeleton,{className:"h-10"}),children:e.jsxRuntimeExports.jsx(n,{})})))]})]})};exports.default=h;
|
|
@@ -5,7 +5,7 @@ import { B as c } from "./useBuilderProp-81a14920.js";
|
|
|
5
5
|
import { D as b, b as C, a as A } from "./dialog-3d4e82ed.js";
|
|
6
6
|
import { SingleLineText as d } from "@chaibuilder/blocks";
|
|
7
7
|
import { F as D } from "./form-725e3191.js";
|
|
8
|
-
import { a0 as N } from "./index-
|
|
8
|
+
import { a0 as N } from "./index-91c0470a.js";
|
|
9
9
|
import "@radix-ui/react-slot";
|
|
10
10
|
import "class-variance-authority";
|
|
11
11
|
import "./utils-ac68b2c8.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-5c3ac4f7.cjs"),g=require("react"),R=require("lodash"),x=require("./useBuilderProp-5e57d0c8.cjs"),a=require("./dialog-170eaad9.cjs"),q=require("@chaibuilder/blocks"),b=require("./form-99b51245.cjs"),f=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-5c3ac4f7.cjs"),g=require("react"),R=require("lodash"),x=require("./useBuilderProp-5e57d0c8.cjs"),a=require("./dialog-170eaad9.cjs"),q=require("@chaibuilder/blocks"),b=require("./form-99b51245.cjs"),f=require("./index-a954d733.cjs");require("@radix-ui/react-slot");require("class-variance-authority");require("./utils-3c452dd0.cjs");require("clsx");require("tailwind-merge");require("@radix-ui/react-tooltip");require("@radix-ui/react-icons");require("@radix-ui/react-toast");require("jotai");require("@radix-ui/react-dialog");require("@rjsf/core");require("@rjsf/validator-ajv8");require("./link-86ac8848.cjs");require("react-icons-picker");require("react-dom");require("./ImagesPanel-0db5c72f.cjs");require("./tabs-860e37aa.cjs");require("@radix-ui/react-tabs");require("react-quill");require("react-i18next");require("./MODIFIERS-4716c669.cjs");require("@radix-ui/react-scroll-area");require("@floating-ui/react-dom");require("i18next");require("flagged");require("react-dnd");require("@minoru/react-dnd-treeview");require("react-hotkeys-hook");require("flat-to-nested");require("./html-to-json-aadcbf66.cjs");require("himalaya");require("redux-undo");require("@react-hookz/web");require("lucide-react");require("sonner");const E=({closeModal:i})=>{var l,o;const s=f.useAddPage(),[r,m]=g.useState({name:"",slug:"",blocks:[],type:"STATIC",seoData:{}}),p=()=>{s.mutate(r,{onSuccess:()=>i()})},j=({formData:u},t)=>{m(h=>{var d,c;const n={[t]:u[t]};return t==="name"?n.slug=R.kebabCase((d=u[t])==null?void 0:d.replace(/\d/g,"")):t==="slug"&&(n.slug=(c=u[t])==null?void 0:c.replace(/\d/g,"").replace(/\s+/g,"").replace("--","-").replace("__","_")),{...h,...n}})},P={name:q.SingleLineText({title:"Page Name",default:r.name}),slug:q.SingleLineText({title:"Page Slug",default:r.slug})};return e.jsxRuntimeExports.jsxs(a.DialogContent,{children:[e.jsxRuntimeExports.jsx("div",{className:"px-1 font-bold",children:"Add Page"}),e.jsxRuntimeExports.jsx(b.Form,{formData:r,properties:P,onChange:j,disabled:s.isPending}),e.jsxRuntimeExports.jsx("div",{className:"flex items-center justify-end",children:e.jsxRuntimeExports.jsx(x.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||s.isPending,onClick:p,children:"Add Page"})})]})},S=()=>{const[i,s]=g.useState(!1);return e.jsxRuntimeExports.jsxs(a.Dialog,{open:i,onOpenChange:()=>s(!i),children:[e.jsxRuntimeExports.jsx(a.DialogTrigger,{children:e.jsxRuntimeExports.jsx(x.Button,{size:"sm",variant:"link",className:"text-blue-500",onClick:()=>s(!i),children:"+ New Page"})}),i&&e.jsxRuntimeExports.jsx(E,{closeModal:()=>s(!i)})]})};exports.default=S;
|
package/dist/core.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-a954d733.cjs"),s=require("./useBuilderProp-5e57d0c8.cjs"),u=require("react-i18next");require("./jsx-runtime-5c3ac4f7.cjs");require("react");require("./MODIFIERS-4716c669.cjs");require("clsx");require("@radix-ui/react-scroll-area");require("react-dom");require("@floating-ui/react-dom");require("jotai");require("i18next");require("flagged");require("react-dnd");require("lodash");require("@minoru/react-dnd-treeview");require("./utils-3c452dd0.cjs");require("tailwind-merge");require("react-hotkeys-hook");require("flat-to-nested");require("./html-to-json-aadcbf66.cjs");require("himalaya");require("redux-undo");require("@react-hookz/web");require("@chaibuilder/blocks");require("@radix-ui/react-icons");require("lucide-react");require("sonner");require("@radix-ui/react-slot");require("class-variance-authority");require("@radix-ui/react-tooltip");require("@radix-ui/react-toast");exports.ChaiBuilderEditor=e.ChaiBuilderEditor;exports.ChaiBuilderStudio=e.ChaiBuilderStudio;exports.useActiveLanguage=e.useActiveLanguage;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.useBlockContentByLanguage=e.useBlockContentByLanguage;exports.useBrandingOptions=e.useBrandingOptions;exports.useBuilderReset=e.useBuilderReset;exports.useBuildingBlocks=e.useBuildingBlocks;exports.useCanvasHistory=e.useCanvasHistory;exports.useCanvasWidth=e.useCanvasWidth;exports.useCanvasZoom=e.useCanvasZoom;exports.useCopyBlockIds=e.useCopyBlockIds;exports.useCurrentPage=e.useCurrentPage$1;exports.useCutBlockIds=e.useCutBlockIds;exports.useDarkMode=e.useDarkMode;exports.useDeveloperPreviewMode=e.useDeveloperPreviewMode;exports.useDuplicateBlocks=e.useDuplicateBlocks;exports.useFeatureSupport=e.useFeatureSupport;exports.useGetPageData=e.useGetPageData;exports.useHiddenBlockIds=e.useHiddenBlockIds;exports.useHighlightBlockId=e.useHighlightBlockId;exports.useLanguages=e.useLanguages;exports.useMarkAsGlobalBlock=e.useMarkAsGlobalBlock;exports.useMoveBlocks=e.useMoveBlocks;exports.usePasteBlocks=e.usePasteBlocks;exports.usePreviewMode=e.usePreviewMode;exports.usePrimaryLanguage=e.usePrimaryLanguage;exports.useProject=e.useProject$1;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.useSetAllBlocks=e.useSetAllBlocks;exports.useStylingBreakpoint=e.useStylingBreakpoint;exports.useStylingState=e.useStylingState;exports.useTranslations=e.useTranslations;exports.useTreeData=e.useTreeData;exports.useUILibraryBlocks=e.useUILibraryBlocks;exports.useUpdateBlocksProps=e.useUpdateBlocksProps;exports.useUpdateBlocksPropsRealtime=e.useUpdateBlocksPropsRealtime;exports.useBuilderProp=s.useBuilderProp;Object.defineProperty(exports,"useTranslation",{enumerable:!0,get:()=>u.useTranslation});
|
package/dist/core.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a5 as T, ap as b, H as j, a8 as x, ak as G, W as O, al as U, K as w, B as F, ao as W, z as Z, a6 as q, a9 as z, d as E, f as K, l as N, o as V, aa as J, n as Q, e as X, ab as Y, m as _, k as $, ac as ss, V as es, A as as, an as os, a1 as ts, ad as us, q as rs, s as is, am as ls, ae as ps, a7 as cs, t as ds, L as ms, c as Bs, D as ks, ag as ns, N as gs, i as Cs, O as Ss, g as vs, j as Ps, h as As, ah as ys, M as hs, af as Ms, ai as Ds, Z as Is, aj as Ls, G as fs } from "./index-
|
|
1
|
+
import { a5 as T, ap as b, H as j, a8 as x, ak as G, W as O, al as U, K as w, B as F, ao as W, z as Z, a6 as q, a9 as z, d as E, f as K, l as N, o as V, aa as J, n as Q, e as X, ab as Y, m as _, k as $, ac as ss, V as es, A as as, an as os, a1 as ts, ad as us, q as rs, s as is, am as ls, ae as ps, a7 as cs, t as ds, L as ms, c as Bs, D as ks, ag as ns, N as gs, i as Cs, O as Ss, g as vs, j as Ps, h as As, ah as ys, M as hs, af as Ms, ai as Ds, Z as Is, aj as Ls, G as fs } from "./index-91c0470a.js";
|
|
2
2
|
import { u as Hs } from "./useBuilderProp-81a14920.js";
|
|
3
3
|
import { useTranslation as bs } from "react-i18next";
|
|
4
4
|
import "./jsx-runtime-944c88e2.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-5c3ac4f7.cjs"),l=require("./useBuilderProp-5e57d0c8.cjs"),r=require("./alert-dialog-4ce6ed22.cjs"),d=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-5c3ac4f7.cjs"),l=require("./useBuilderProp-5e57d0c8.cjs"),r=require("./alert-dialog-4ce6ed22.cjs"),d=require("./index-a954d733.cjs"),c=require("@radix-ui/react-icons");require("react");require("@radix-ui/react-slot");require("class-variance-authority");require("./utils-3c452dd0.cjs");require("clsx");require("tailwind-merge");require("@radix-ui/react-tooltip");require("@radix-ui/react-toast");require("jotai");require("lodash");require("@radix-ui/react-alert-dialog");require("./MODIFIERS-4716c669.cjs");require("@radix-ui/react-scroll-area");require("react-dom");require("@floating-ui/react-dom");require("i18next");require("react-i18next");require("flagged");require("react-dnd");require("@minoru/react-dnd-treeview");require("react-hotkeys-hook");require("flat-to-nested");require("./html-to-json-aadcbf66.cjs");require("himalaya");require("redux-undo");require("@react-hookz/web");require("@chaibuilder/blocks");require("lucide-react");require("sonner");const x=({pageData:i,projectData:s})=>{const n={},t=d.useDeletePage(),u=i.uuid===s.homepage,o=()=>{t.mutate(i,{onSuccess:()=>{n({uuid:s.homepage,slug:"/home"})}})};return e.jsxRuntimeExports.jsxs(r.AlertDialog,{children:[e.jsxRuntimeExports.jsx(r.AlertDialogTrigger,{disabled:u,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 ${u?"cursor-not-allowed border-red-200 text-red-200":"cursor-pointer border-red-400 text-red-400"}`,children:e.jsxRuntimeExports.jsx(c.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:t.isPending,children:"Cancel"}),e.jsxRuntimeExports.jsx(l.Button,{variant:"destructive",onClick:o,disabled:t.isPending,children:"Yes, Delete"})]})]})]})};exports.default=x;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { j as e } from "./jsx-runtime-944c88e2.js";
|
|
2
2
|
import { B as l } from "./useBuilderProp-81a14920.js";
|
|
3
3
|
import { A as n, a as d, b as a, e as p, f as c, h as u } from "./alert-dialog-ee98f47e.js";
|
|
4
|
-
import { a4 as h } from "./index-
|
|
4
|
+
import { a4 as h } from "./index-91c0470a.js";
|
|
5
5
|
import { TrashIcon as x } from "@radix-ui/react-icons";
|
|
6
6
|
import "react";
|
|
7
7
|
import "@radix-ui/react-slot";
|
|
@@ -26597,11 +26597,14 @@ class $B extends y.Component {
|
|
|
26597
26597
|
* A static method that returns an object to update the state when an error is caught.
|
|
26598
26598
|
* @returns {object} An object to update the state when an error is caught.
|
|
26599
26599
|
*/
|
|
26600
|
-
static getDerivedStateFromError(
|
|
26601
|
-
return
|
|
26600
|
+
static getDerivedStateFromError() {
|
|
26601
|
+
return { hasError: !0 };
|
|
26602
26602
|
}
|
|
26603
26603
|
render() {
|
|
26604
|
-
return this.state.hasError ? /* @__PURE__ */ oe.
|
|
26604
|
+
return this.state.hasError ? /* @__PURE__ */ oe.jsxs("div", { className: "bg-red-200 h-full w-full rounded-md text-red-500 p-4", id: "errorBoundary", children: [
|
|
26605
|
+
/* @__PURE__ */ oe.jsx("p", { className: "font-semibold", children: "Oops! Something went wrong." }),
|
|
26606
|
+
/* @__PURE__ */ oe.jsx("p", { children: "Please try again later." })
|
|
26607
|
+
] }) : this.props.children;
|
|
26605
26608
|
}
|
|
26606
26609
|
}
|
|
26607
26610
|
const eV = (e) => {
|
|
@@ -27488,7 +27491,7 @@ const uZ = () => {
|
|
|
27488
27491
|
const a = pr(e);
|
|
27489
27492
|
Cf(a) && (n = [a, ...pL(t, a)]), r(n);
|
|
27490
27493
|
}, [e, t, r]);
|
|
27491
|
-
}, FZ = () => Ge(fA), bL = Fn(() => import("./SidePanels-
|
|
27494
|
+
}, FZ = () => Ge(fA), bL = Fn(() => import("./SidePanels-c1abd140.js")), gL = Fn(() => import("./Topbar-3f8ee9ec.js")), mL = Fn(() => import("./CanvasArea-575f601e.js")), vL = Fn(() => import("./Settings-8b2a5a12.js")), yL = () => {
|
|
27492
27495
|
const [e] = Me(Oc), t = (r) => {
|
|
27493
27496
|
r.preventDefault();
|
|
27494
27497
|
};
|
|
@@ -28743,7 +28746,7 @@ function hW() {
|
|
|
28743
28746
|
};
|
|
28744
28747
|
return nW(om(om({}, t), e));
|
|
28745
28748
|
}
|
|
28746
|
-
const bW = "@chaibuilder/sdk", gW = "0.1.
|
|
28749
|
+
const bW = "@chaibuilder/sdk", gW = "0.1.30", mW = "module", vW = [
|
|
28747
28750
|
"dist"
|
|
28748
28751
|
], yW = "dist/core.js", wW = !1, SW = {
|
|
28749
28752
|
".": {
|
|
@@ -28789,7 +28792,7 @@ const bW = "@chaibuilder/sdk", gW = "0.1.28", mW = "module", vW = [
|
|
|
28789
28792
|
docs: "jsdoc -c jsdoc.conf.json"
|
|
28790
28793
|
}, EW = {
|
|
28791
28794
|
"@bobthered/tailwindcss-palette-generator": "3.1.1",
|
|
28792
|
-
"@chaibuilder/blocks": "0.
|
|
28795
|
+
"@chaibuilder/blocks": "^0.2.0",
|
|
28793
28796
|
"@floating-ui/dom": "1.4.5",
|
|
28794
28797
|
"@floating-ui/react-dom": "2.0.1",
|
|
28795
28798
|
"@mhsdesign/jit-browser-tailwindcss": "0.3.0",
|
|
@@ -30826,7 +30829,7 @@ const ls = () => {
|
|
|
30826
30829
|
})).json();
|
|
30827
30830
|
}
|
|
30828
30831
|
});
|
|
30829
|
-
}, vK = Fn(() => import("./PagesPanel-
|
|
30832
|
+
}, vK = Fn(() => import("./PagesPanel-9de2d25b.js")), yK = Fn(() => import("./ProjectPanel-862243ef.js")), wK = Fn(() => import("./CurrentPage-e6f23078.js")), SK = () => /* @__PURE__ */ oe.jsx("h2", { children: "Your Logo" }), AK = () => {
|
|
30830
30833
|
const e = Pr();
|
|
30831
30834
|
return /* @__PURE__ */ oe.jsx("div", { className: "border-gray-200 rounded-md p-2 mb-2 border", children: /* @__PURE__ */ oe.jsx(
|
|
30832
30835
|
kE,
|
|
@@ -30989,8 +30992,8 @@ export {
|
|
|
30989
30992
|
hV as B,
|
|
30990
30993
|
MV as C,
|
|
30991
30994
|
iZ as D,
|
|
30992
|
-
|
|
30993
|
-
|
|
30995
|
+
$B as E,
|
|
30996
|
+
FV as F,
|
|
30994
30997
|
OZ as G,
|
|
30995
30998
|
uL as H,
|
|
30996
30999
|
Rg as I,
|