@chaibuilder/sdk 1.2.64 → 1.2.66
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-Mm5byzEC.js +124 -0
- package/dist/AddBlocks-jaxiAG4L.cjs +1 -0
- package/dist/CanvasArea-8NXGRRYC.js +137 -0
- package/dist/CanvasArea-SkeoJz9W.cjs +1 -0
- package/dist/{CodeEditor-37od44Ou.js → CodeEditor-3l-mFvg4.js} +61 -46
- package/dist/CodeEditor-o-CkvDnY.cjs +1 -0
- package/dist/STRINGS--j49GZJP.js +7 -0
- package/dist/STRINGS-gPz7CUOk.cjs +1 -0
- package/dist/SettingsPanel-2uYGx-MQ.cjs +1 -0
- package/dist/SettingsPanel-Q3xQQm81.js +82 -0
- package/dist/{SidePanels-UQj0XTnb.js → SidePanels-JyziIpDA.js} +125 -116
- package/dist/SidePanels-d04PONzN.cjs +1 -0
- package/dist/{Topbar-1O05wogM.js → Topbar-Xgd6YI66.js} +68 -57
- package/dist/Topbar-eIenyfZu.cjs +1 -0
- package/dist/UILibrariesPanel-ADjJse3_.cjs +1 -0
- package/dist/{UILibrariesPanel-vshiYI6G.js → UILibrariesPanel-a7TrMuAU.js} +98 -86
- package/dist/{UnsplashImages-Eq7hprBO.js → UnsplashImages-6Bj8nQ8n.js} +65 -49
- package/dist/UnsplashImages-hLdMtY12.cjs +1 -0
- package/dist/{UploadImages-lco2Tea3.js → UploadImages-4PxhlZMB.js} +58 -44
- package/dist/UploadImages-uL2R7fju.cjs +1 -0
- package/dist/badge-7BVT3zxN.cjs +1 -0
- package/dist/badge-pJqQSA13.js +23 -0
- package/dist/context-menu-_8TFbFEJ.cjs +1 -0
- package/dist/context-menu-sks9vdzC.js +906 -0
- package/dist/core.cjs +1 -1
- package/dist/core.d.ts +45 -21
- package/dist/core.js +93 -79
- package/dist/iconBase-vJD0OXxU.cjs +1 -0
- package/dist/iconBase-zweRWSz0.js +323 -0
- package/dist/index-Dgo2PNEV.js +33210 -0
- package/dist/index-jhNzBWrV.cjs +223 -0
- package/dist/jsx-runtime-JYMCiFoE.cjs +27 -0
- package/dist/{jsx-runtime-WbnYoNE9.js → jsx-runtime-Sp0orL4X.js} +106 -109
- package/dist/plugin-P0tpo_XZ.cjs +1 -0
- package/dist/plugin-_F-KZp1i.cjs +1 -0
- package/dist/plugin-f5uJtdXY.js +43 -0
- package/dist/plugin-sJ3Hzvpv.js +57 -0
- package/dist/render.cjs +3 -1
- package/dist/render.d.ts +19 -52
- package/dist/render.js +136 -183
- package/dist/select-JW3OMYm-.js +75 -0
- package/dist/select-fXj5tdMX.cjs +1 -0
- package/dist/separator-hT24N-xp.cjs +1 -0
- package/dist/separator-sgwOa1FE.js +18 -0
- package/dist/style.css +2 -2
- package/dist/tailwind.cjs +1 -1
- package/dist/tailwind.d.ts +41 -1
- package/dist/tailwind.js +16 -8
- package/dist/ui.cjs +1 -1
- package/dist/ui.d.ts +0 -10
- package/dist/ui.js +345 -163
- package/dist/web-blocks.cjs +1 -1
- package/dist/web-blocks.d.ts +1 -1
- package/dist/web-blocks.js +489 -724
- package/package.json +15 -45
- package/dist/AddBlocks-6dJmFSgk.js +0 -142
- package/dist/AddBlocks-doCNVVbk.cjs +0 -1
- package/dist/CanvasArea-kB6ky_uL.js +0 -164
- package/dist/CanvasArea-kdnkFfKR.cjs +0 -1
- package/dist/CodeEditor-ypUx3RAV.cjs +0 -1
- package/dist/CurrentPage-Ekl5Cwbv.cjs +0 -1
- package/dist/CurrentPage-bHq9Uusr.js +0 -108
- package/dist/Functions-7jnEwJyw.js +0 -15
- package/dist/Functions-N3yhPYKY.cjs +0 -1
- package/dist/MODIFIERS-fd5XOmum.js +0 -60
- package/dist/MODIFIERS-mVmfEGgo.cjs +0 -1
- package/dist/PagesPanel-SMHrEmCb.cjs +0 -1
- package/dist/PagesPanel-wIPAyjJK.js +0 -66
- package/dist/ProjectPanel-L-SlDizV.js +0 -87
- package/dist/ProjectPanel-YruLal65.cjs +0 -1
- package/dist/Settings-WXkCyhAv.js +0 -2380
- package/dist/Settings-_5VHcgFC.cjs +0 -1
- package/dist/SidePanels-UeIZB3e1.cjs +0 -1
- package/dist/StaticCanvas-7C52tXAv.js +0 -749
- package/dist/StaticCanvas-ll9VTXI5.cjs +0 -60
- package/dist/ThemeConfigPanel-_86vVxLz.cjs +0 -1
- package/dist/ThemeConfigPanel-gw8B2zvx.js +0 -194
- package/dist/Topbar-gb17oHdJ.cjs +0 -1
- package/dist/UILibrariesPanel-03Y3F3A_.cjs +0 -1
- package/dist/UnsplashImages-6UjgojvF.cjs +0 -1
- package/dist/UploadImages-3h0cRsvr.cjs +0 -1
- package/dist/_commonjsHelpers-UyOWmZb0.js +0 -8
- package/dist/_commonjsHelpers-wDK0ZLPo.cjs +0 -1
- package/dist/add-page-modal-qr7rvJzN.js +0 -106
- package/dist/add-page-modal-rOKavDFX.cjs +0 -1
- package/dist/atoms-KQpaDRnF.cjs +0 -1
- package/dist/atoms-Oomqut88.js +0 -6
- package/dist/confirm-alert-P6TAevaP.js +0 -60
- package/dist/confirm-alert-v1lG8ex4.cjs +0 -1
- package/dist/controls-rRZhz0vu.cjs +0 -1
- package/dist/controls-yjgoZzB6.js +0 -199
- package/dist/delete-page-modal-55oioI9i.js +0 -85
- package/dist/delete-page-modal-wdAiMVnL.cjs +0 -1
- package/dist/email-blocks.cjs +0 -1
- package/dist/email-blocks.d.ts +0 -3
- package/dist/email-blocks.js +0 -294
- package/dist/email.cjs +0 -1
- package/dist/email.d.ts +0 -171
- package/dist/email.js +0 -75
- package/dist/empty-slot-Lsxjts7Q.js +0 -6
- package/dist/empty-slot-Sy930lX6.cjs +0 -1
- package/dist/form-4jTocVbZ.cjs +0 -1
- package/dist/form-5ke_lZv8.js +0 -125
- package/dist/functions--tdNWQDW.js +0 -30
- package/dist/functions-EVUeSwX1.cjs +0 -1
- package/dist/html-to-json-_01DXd-a.js +0 -192
- package/dist/html-to-json-ndxaXRT8.cjs +0 -1
- package/dist/index--mLLy7QQ.cjs +0 -1
- package/dist/index-6w-6HYBd.cjs +0 -1
- package/dist/index-VBXQixVm.js +0 -117
- package/dist/index-aeDphKpP.cjs +0 -1
- package/dist/index-audsIPBC.cjs +0 -231
- package/dist/index-b33n_-zO.js +0 -3141
- package/dist/index-e0c8PmRQ.js +0 -205
- package/dist/index-fnkMn4Pk.js +0 -2201
- package/dist/index-gi1LIOCw.cjs +0 -1
- package/dist/index-wRAIA8zZ.js +0 -80248
- package/dist/jsx-runtime-Z_BpKhVy.cjs +0 -27
- package/dist/lib.cjs +0 -3
- package/dist/lib.d.ts +0 -80
- package/dist/lib.js +0 -1350
- package/dist/page-viewer-t44DP65U.js +0 -112
- package/dist/page-viewer-wU7T0f48.cjs +0 -1
- package/dist/plugin-2hf9pCRy.cjs +0 -1
- package/dist/plugin-wDnsBVPp.js +0 -54
- package/dist/project-general-setting-87cX9vvO.cjs +0 -1
- package/dist/project-general-setting-NEkNjf7V.js +0 -81
- package/dist/project-seo-setting-YmspOYsF.js +0 -83
- package/dist/project-seo-setting-o0V9acCV.cjs +0 -1
- package/dist/server.cjs +0 -1
- package/dist/server.d.ts +0 -299
- package/dist/server.js +0 -216
- package/dist/single-page-detail-27UjWK8L.cjs +0 -1
- package/dist/single-page-detail-jHzoDP7B.js +0 -220
- package/dist/studio.cjs +0 -1
- package/dist/studio.d.ts +0 -176
- package/dist/studio.js +0 -55
- package/dist/utils-D_vtk3zK.cjs +0 -1
- package/dist/utils-VpVqnC9m.js +0 -1075
|
@@ -1,53 +1,64 @@
|
|
|
1
|
-
import { j as e } from "./jsx-runtime-
|
|
2
|
-
import l, { useMemo as h, Suspense as
|
|
1
|
+
import { j as e } from "./jsx-runtime-Sp0orL4X.js";
|
|
2
|
+
import l, { useMemo as h, Suspense as m } from "react";
|
|
3
3
|
import { FontFamilyIcon as j, EyeOpenIcon as f } from "@radix-ui/react-icons";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
4
|
+
import { S as g, c as v, b as S, d as b, a as N, e as w, f as n } from "./select-JW3OMYm-.js";
|
|
5
|
+
import { c as s, f as y, F as C, g as B } from "./index-Dgo2PNEV.js";
|
|
6
|
+
import { S as A } from "./separator-sgwOa1FE.js";
|
|
7
|
+
import { B as c, S as p } from "./context-menu-sks9vdzC.js";
|
|
6
8
|
import { useTranslation as x } from "react-i18next";
|
|
7
|
-
import "
|
|
8
|
-
import "@radix-ui/react-toggle";
|
|
9
|
-
import "class-variance-authority";
|
|
10
|
-
import "./utils-VpVqnC9m.js";
|
|
9
|
+
import "@radix-ui/react-select";
|
|
11
10
|
import "lodash-es";
|
|
12
|
-
import "
|
|
11
|
+
import "jotai";
|
|
12
|
+
import "./iconBase-zweRWSz0.js";
|
|
13
13
|
import "clsx";
|
|
14
14
|
import "tailwind-merge";
|
|
15
|
+
import "@chaibuilder/runtime";
|
|
16
|
+
import "./plugin-sJ3Hzvpv.js";
|
|
17
|
+
import "@react-hookz/web";
|
|
18
|
+
import "tree-model";
|
|
19
|
+
import "react-quill";
|
|
20
|
+
import "./STRINGS--j49GZJP.js";
|
|
21
|
+
import "react-hotkeys-hook";
|
|
22
|
+
import "@floating-ui/dom";
|
|
23
|
+
import "@floating-ui/react-dom";
|
|
24
|
+
import "flagged";
|
|
25
|
+
import "@tailwindcss/typography";
|
|
26
|
+
import "@tailwindcss/forms";
|
|
27
|
+
import "@tailwindcss/aspect-ratio";
|
|
28
|
+
import "tailwindcss-palette-generator";
|
|
29
|
+
import "lodash";
|
|
30
|
+
import "react-wrap-balancer";
|
|
31
|
+
import "react-dom";
|
|
32
|
+
import "prop-types";
|
|
33
|
+
import "@rjsf/validator-ajv8";
|
|
34
|
+
import "@rjsf/core";
|
|
35
|
+
import "react-arborist";
|
|
36
|
+
import "lucide-react";
|
|
37
|
+
import "himalaya";
|
|
38
|
+
import "react-icons-picker";
|
|
39
|
+
import "react-autosuggest";
|
|
40
|
+
import "fuse.js";
|
|
41
|
+
import "@radix-ui/react-scroll-area";
|
|
42
|
+
import "i18next";
|
|
43
|
+
import "@radix-ui/react-separator";
|
|
15
44
|
import "@radix-ui/react-switch";
|
|
16
|
-
import "@radix-ui/react-slot";
|
|
17
45
|
import "@radix-ui/react-accordion";
|
|
46
|
+
import "class-variance-authority";
|
|
18
47
|
import "@radix-ui/react-alert-dialog";
|
|
19
|
-
import "@radix-ui/react-
|
|
48
|
+
import "@radix-ui/react-slot";
|
|
20
49
|
import "@radix-ui/react-label";
|
|
21
|
-
import "@radix-ui/react-scroll-area";
|
|
22
50
|
import "@radix-ui/react-tabs";
|
|
23
51
|
import "@radix-ui/react-tooltip";
|
|
24
52
|
import "@radix-ui/react-popover";
|
|
25
|
-
import "@radix-ui/react-menubar";
|
|
26
53
|
import "@radix-ui/react-hover-card";
|
|
27
|
-
import "@radix-ui/react-select";
|
|
28
54
|
import "@radix-ui/react-dropdown-menu";
|
|
29
|
-
import "@radix-ui/react-separator";
|
|
30
55
|
import "@radix-ui/react-toast";
|
|
31
56
|
import "cmdk";
|
|
57
|
+
import "@radix-ui/react-dialog";
|
|
32
58
|
import "@radix-ui/react-context-menu";
|
|
33
|
-
|
|
34
|
-
import "react-dom";
|
|
35
|
-
import "react-quill";
|
|
36
|
-
import "./Functions-7jnEwJyw.js";
|
|
37
|
-
import "@chaibuilder/runtime";
|
|
38
|
-
import "jotai";
|
|
39
|
-
import "@react-hookz/web";
|
|
40
|
-
import "tree-model";
|
|
41
|
-
import "i18next";
|
|
42
|
-
import "react-arborist";
|
|
43
|
-
import "lucide-react";
|
|
44
|
-
import "./index-VBXQixVm.js";
|
|
45
|
-
import "@floating-ui/react-dom";
|
|
46
|
-
import "flagged";
|
|
47
|
-
import "react-hotkeys-hook";
|
|
48
|
-
const P = () => r("languages", ["en"]), k = () => P().length === 1 ? null : /* @__PURE__ */ e.jsx("div", { className: "flex items-center", children: /* @__PURE__ */ e.jsxs(g, { children: [
|
|
59
|
+
const P = () => s("languages", ["en"]), k = () => P().length === 1 ? null : /* @__PURE__ */ e.jsx("div", { className: "flex items-center", children: /* @__PURE__ */ e.jsxs(g, { children: [
|
|
49
60
|
/* @__PURE__ */ e.jsx(v, { className: "w-[150px] border-0", children: /* @__PURE__ */ e.jsx(
|
|
50
|
-
|
|
61
|
+
S,
|
|
51
62
|
{
|
|
52
63
|
placeholder: /* @__PURE__ */ e.jsxs("span", { className: "flex items-center", children: [
|
|
53
64
|
/* @__PURE__ */ e.jsx(j, { className: "h-4 w-4" }),
|
|
@@ -55,16 +66,16 @@ const P = () => r("languages", ["en"]), k = () => P().length === 1 ? null : /* @
|
|
|
55
66
|
] })
|
|
56
67
|
}
|
|
57
68
|
) }),
|
|
58
|
-
/* @__PURE__ */ e.jsx(
|
|
69
|
+
/* @__PURE__ */ e.jsx(b, { children: /* @__PURE__ */ e.jsxs(N, { children: [
|
|
59
70
|
/* @__PURE__ */ e.jsx(w, { children: "Fruits" }),
|
|
60
|
-
/* @__PURE__ */ e.jsx(
|
|
61
|
-
/* @__PURE__ */ e.jsx(
|
|
62
|
-
/* @__PURE__ */ e.jsx(
|
|
63
|
-
/* @__PURE__ */ e.jsx(
|
|
64
|
-
/* @__PURE__ */ e.jsx(
|
|
71
|
+
/* @__PURE__ */ e.jsx(n, { value: "apple", children: "Apple" }),
|
|
72
|
+
/* @__PURE__ */ e.jsx(n, { value: "banana", children: "Banana" }),
|
|
73
|
+
/* @__PURE__ */ e.jsx(n, { value: "blueberry", children: "Blueberry" }),
|
|
74
|
+
/* @__PURE__ */ e.jsx(n, { value: "grapes", children: "Grapes" }),
|
|
75
|
+
/* @__PURE__ */ e.jsx(n, { value: "pineapple", children: "Pineapple" })
|
|
65
76
|
] }) })
|
|
66
77
|
] }) }), I = () => {
|
|
67
|
-
const { savePage:
|
|
78
|
+
const { savePage: i, saveState: t } = y(), { t: a } = x(), o = s("hideSaveButton", !1), r = h(() => {
|
|
68
79
|
switch (t) {
|
|
69
80
|
case "SAVING":
|
|
70
81
|
return "animate-pulse bg-gray-300 text-gray-900";
|
|
@@ -74,62 +85,62 @@ const P = () => r("languages", ["en"]), k = () => P().length === 1 ? null : /* @
|
|
|
74
85
|
return "bg-gray-200 text-gray-500 hover:bg-gray-100";
|
|
75
86
|
}
|
|
76
87
|
}, [t]);
|
|
77
|
-
if (
|
|
88
|
+
if (o)
|
|
78
89
|
return null;
|
|
79
90
|
const u = /* @__PURE__ */ e.jsxs(
|
|
80
|
-
|
|
91
|
+
c,
|
|
81
92
|
{
|
|
82
93
|
disabled: t === "SAVING",
|
|
83
94
|
onClick: (d) => {
|
|
84
|
-
d.preventDefault(),
|
|
95
|
+
d.preventDefault(), i();
|
|
85
96
|
},
|
|
86
|
-
className: `flex h-auto w-fit items-center gap-x-2 rounded-full p-1.5 px-3 ${
|
|
97
|
+
className: `flex h-auto w-fit items-center gap-x-2 rounded-full p-1.5 px-3 ${r}`,
|
|
87
98
|
size: "sm",
|
|
88
99
|
variant: "outline",
|
|
89
100
|
children: [
|
|
90
|
-
/* @__PURE__ */ e.jsx(
|
|
101
|
+
/* @__PURE__ */ e.jsx(C, { className: "text-lg" }),
|
|
91
102
|
/* @__PURE__ */ e.jsx("span", { className: "text-sm", children: t === "SAVING" ? "Saving..." : a(t === "SAVED" ? "Saved" : "Unsaved") })
|
|
92
103
|
]
|
|
93
104
|
}
|
|
94
105
|
);
|
|
95
106
|
return /* @__PURE__ */ e.jsx("div", { className: "flex items-center", children: u });
|
|
96
107
|
}, V = function() {
|
|
97
|
-
const t =
|
|
108
|
+
const t = s("previewComponent"), [, a] = B(), { t: o } = x();
|
|
98
109
|
return t ? /* @__PURE__ */ e.jsxs(
|
|
99
|
-
|
|
110
|
+
c,
|
|
100
111
|
{
|
|
101
|
-
onClick: (
|
|
102
|
-
|
|
112
|
+
onClick: (r) => {
|
|
113
|
+
r.preventDefault(), a(!0);
|
|
103
114
|
},
|
|
104
115
|
className: "flex h-auto w-fit items-center gap-x-2 rounded-full bg-gray-200 px-3 py-1",
|
|
105
116
|
size: "sm",
|
|
106
117
|
variant: "outline",
|
|
107
118
|
children: [
|
|
108
119
|
/* @__PURE__ */ e.jsx(f, { className: "text-xs" }),
|
|
109
|
-
/* @__PURE__ */ e.jsx("span", { className: "text-sm", children:
|
|
120
|
+
/* @__PURE__ */ e.jsx("span", { className: "text-sm", children: o("Preview") })
|
|
110
121
|
]
|
|
111
122
|
}
|
|
112
123
|
) : null;
|
|
113
|
-
},
|
|
114
|
-
const
|
|
124
|
+
}, Le = () => {
|
|
125
|
+
const i = s("topBarComponents.left", []), t = s("topBarComponents.center", []), a = s("topBarComponents.right", []), o = s("editable", !0);
|
|
115
126
|
return /* @__PURE__ */ e.jsxs("div", { className: "flex h-14 items-center justify-between px-2", children: [
|
|
116
127
|
/* @__PURE__ */ e.jsx("div", { className: "flex items-center space-x-2", children: /* @__PURE__ */ e.jsx("div", { className: "flex items-center space-x-2 font-bold", children: l.Children.toArray(
|
|
117
|
-
|
|
128
|
+
i.map((r) => /* @__PURE__ */ e.jsx(m, { fallback: /* @__PURE__ */ e.jsx(p, { className: "h-10" }), children: /* @__PURE__ */ e.jsx(r, {}) }))
|
|
118
129
|
) }) }),
|
|
119
130
|
/* @__PURE__ */ e.jsx("div", { className: "flex items-center space-x-2", children: l.Children.toArray(
|
|
120
|
-
t.map((
|
|
131
|
+
t.map((r) => /* @__PURE__ */ e.jsx(m, { fallback: /* @__PURE__ */ e.jsx(p, { className: "h-10" }), children: /* @__PURE__ */ e.jsx(r, {}) }))
|
|
121
132
|
) }),
|
|
122
133
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-2", children: [
|
|
123
134
|
/* @__PURE__ */ e.jsx(k, {}),
|
|
124
135
|
/* @__PURE__ */ e.jsx(V, {}),
|
|
125
|
-
/* @__PURE__ */ e.jsx(
|
|
126
|
-
|
|
136
|
+
/* @__PURE__ */ e.jsx(A, { orientation: "vertical" }),
|
|
137
|
+
o ? /* @__PURE__ */ e.jsx(I, {}) : null,
|
|
127
138
|
l.Children.toArray(
|
|
128
|
-
a.map((
|
|
139
|
+
a.map((r) => /* @__PURE__ */ e.jsx(m, { fallback: /* @__PURE__ */ e.jsx(p, { className: "h-10" }), children: /* @__PURE__ */ e.jsx(r, {}) }))
|
|
129
140
|
)
|
|
130
141
|
] })
|
|
131
142
|
] });
|
|
132
143
|
};
|
|
133
144
|
export {
|
|
134
|
-
|
|
145
|
+
Le as default
|
|
135
146
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-JYMCiFoE.cjs"),i=require("react"),o=require("@radix-ui/react-icons"),r=require("./select-fXj5tdMX.cjs"),s=require("./index-jhNzBWrV.cjs"),j=require("./separator-hT24N-xp.cjs"),l=require("./context-menu-_8TFbFEJ.cjs"),c=require("react-i18next");require("@radix-ui/react-select");require("lodash-es");require("jotai");require("./iconBase-vJD0OXxU.cjs");require("clsx");require("tailwind-merge");require("@chaibuilder/runtime");require("./plugin-_F-KZp1i.cjs");require("@react-hookz/web");require("tree-model");require("react-quill");require("./STRINGS-gPz7CUOk.cjs");require("react-hotkeys-hook");require("@floating-ui/dom");require("@floating-ui/react-dom");require("flagged");require("@tailwindcss/typography");require("@tailwindcss/forms");require("@tailwindcss/aspect-ratio");require("tailwindcss-palette-generator");require("lodash");require("react-wrap-balancer");require("react-dom");require("prop-types");require("@rjsf/validator-ajv8");require("@rjsf/core");require("react-arborist");require("lucide-react");require("himalaya");require("react-icons-picker");require("react-autosuggest");require("fuse.js");require("@radix-ui/react-scroll-area");require("i18next");require("@radix-ui/react-separator");require("@radix-ui/react-switch");require("@radix-ui/react-accordion");require("class-variance-authority");require("@radix-ui/react-alert-dialog");require("@radix-ui/react-slot");require("@radix-ui/react-label");require("@radix-ui/react-tabs");require("@radix-ui/react-tooltip");require("@radix-ui/react-popover");require("@radix-ui/react-hover-card");require("@radix-ui/react-dropdown-menu");require("@radix-ui/react-toast");require("cmdk");require("@radix-ui/react-dialog");require("@radix-ui/react-context-menu");const d=()=>s.useBuilderProp("languages",["en"]),q=()=>d().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(o.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"})]})})]})}),h=()=>{const{savePage:x,saveState:t}=s.useSavePage(),{t:u}=c.useTranslation(),a=s.useBuilderProp("hideSaveButton",!1),n=i.useMemo(()=>{switch(t){case"SAVING":return"animate-pulse bg-gray-300 text-gray-900";case"SAVED":return"bg-green-500 text-white hover:bg-green-600 hover:text-white";default:return"bg-gray-200 text-gray-500 hover:bg-gray-100"}},[t]);if(a)return null;const p=e.jsxRuntimeExports.jsxs(l.Button,{disabled:t==="SAVING",onClick:m=>{m.preventDefault(),x()},className:`flex h-auto w-fit items-center gap-x-2 rounded-full p-1.5 px-3 ${n}`,size:"sm",variant:"outline",children:[e.jsxRuntimeExports.jsx(s.FaCircleCheck,{className:"text-lg"}),e.jsxRuntimeExports.jsx("span",{className:"text-sm",children:t==="SAVING"?"Saving...":u(t==="SAVED"?"Saved":"Unsaved")})]});return e.jsxRuntimeExports.jsx("div",{className:"flex items-center",children:p})},E=function(){const t=s.useBuilderProp("previewComponent"),[,u]=s.usePreviewMode(),{t:a}=c.useTranslation();return t?e.jsxRuntimeExports.jsxs(l.Button,{onClick:n=>{n.preventDefault(),u(!0)},className:"flex h-auto w-fit items-center gap-x-2 rounded-full bg-gray-200 px-3 py-1",size:"sm",variant:"outline",children:[e.jsxRuntimeExports.jsx(o.EyeOpenIcon,{className:"text-xs"}),e.jsxRuntimeExports.jsx("span",{className:"text-sm",children:a("Preview")})]}):null},R=()=>{const x=s.useBuilderProp("topBarComponents.left",[]),t=s.useBuilderProp("topBarComponents.center",[]),u=s.useBuilderProp("topBarComponents.right",[]),a=s.useBuilderProp("editable",!0);return e.jsxRuntimeExports.jsxs("div",{className:"flex h-14 items-center justify-between px-2",children:[e.jsxRuntimeExports.jsx("div",{className:"flex items-center space-x-2",children:e.jsxRuntimeExports.jsx("div",{className:"flex items-center space-x-2 font-bold",children:i.Children.toArray(x.map(n=>e.jsxRuntimeExports.jsx(i.Suspense,{fallback:e.jsxRuntimeExports.jsx(l.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(l.Skeleton,{className:"h-10"}),children:e.jsxRuntimeExports.jsx(n,{})})))}),e.jsxRuntimeExports.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsxRuntimeExports.jsx(q,{}),e.jsxRuntimeExports.jsx(E,{}),e.jsxRuntimeExports.jsx(j.Separator,{orientation:"vertical"}),a?e.jsxRuntimeExports.jsx(h,{}):null,i.Children.toArray(u.map(n=>e.jsxRuntimeExports.jsx(i.Suspense,{fallback:e.jsxRuntimeExports.jsx(l.Skeleton,{className:"h-10"}),children:e.jsxRuntimeExports.jsx(n,{})})))]})]})};exports.default=R;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-JYMCiFoE.cjs"),s=require("lodash-es"),g=require("react"),p=require("./index-jhNzBWrV.cjs"),S=require("react-i18next"),C=require("@chaibuilder/runtime"),T=require("lucide-react"),q=require("jotai"),I=require("./iconBase-vJD0OXxU.cjs"),N=require("@radix-ui/react-icons"),i=require("./context-menu-_8TFbFEJ.cjs"),L=require("./STRINGS-gPz7CUOk.cjs"),A=require("clsx"),P=require("flagged");require("./plugin-_F-KZp1i.cjs");require("@react-hookz/web");require("tree-model");require("react-quill");require("react-hotkeys-hook");require("@floating-ui/dom");require("@floating-ui/react-dom");require("@tailwindcss/typography");require("@tailwindcss/forms");require("@tailwindcss/aspect-ratio");require("tailwindcss-palette-generator");require("tailwind-merge");require("lodash");require("react-wrap-balancer");require("react-dom");require("prop-types");require("@rjsf/validator-ajv8");require("@rjsf/core");require("react-arborist");require("himalaya");require("react-icons-picker");require("react-autosuggest");require("fuse.js");require("@radix-ui/react-scroll-area");require("i18next");require("@radix-ui/react-switch");require("@radix-ui/react-accordion");require("class-variance-authority");require("@radix-ui/react-alert-dialog");require("@radix-ui/react-slot");require("@radix-ui/react-label");require("@radix-ui/react-tabs");require("@radix-ui/react-tooltip");require("@radix-ui/react-popover");require("@radix-ui/react-hover-card");require("@radix-ui/react-dropdown-menu");require("@radix-ui/react-toast");require("cmdk");require("@radix-ui/react-dialog");require("@radix-ui/react-context-menu");function O(t){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const o in t)if(o!=="default"){const l=Object.getOwnPropertyDescriptor(t,o);Object.defineProperty(n,o,l.get?l:{enumerable:!0,get:()=>t[o]})}}return n.default=t,Object.freeze(n)}const D=O(g);function _({uiLibraries:t,library:n,setLibrary:o}){var j;const[l,x]=D.useState(!1),{t:r}=S.useTranslation();return n?e.jsxRuntimeExports.jsxs(i.Popover,{open:l,onOpenChange:x,children:[e.jsxRuntimeExports.jsx(i.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(i.Button,{variant:"outline",size:"sm",role:"combobox","aria-expanded":l,className:"w-[200px] justify-between",children:[n?(j=t.find(u=>u.uuid===n))==null?void 0:j.name:r("Select library"),e.jsxRuntimeExports.jsx(N.CaretSortIcon,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})]})}),e.jsxRuntimeExports.jsx(i.PopoverContent,{className:"w-[200px] p-0",children:e.jsxRuntimeExports.jsxs(i.Command,{children:[e.jsxRuntimeExports.jsx(i.CommandInput,{placeholder:"Search library...",className:"h-9"}),e.jsxRuntimeExports.jsxs(i.CommandList,{children:[e.jsxRuntimeExports.jsx(i.CommandEmpty,{children:"No library found."}),e.jsxRuntimeExports.jsx(i.CommandGroup,{children:t.map(u=>e.jsxRuntimeExports.jsxs(i.CommandItem,{value:u.uuid,onSelect:f=>{o(f),x(!1)},children:[u.name,e.jsxRuntimeExports.jsx(N.CheckIcon,{className:I.cn("ml-auto h-4 w-4",n===u.uuid?"opacity-100":"opacity-0")})]},u.uuid))})]})]})})]}):null}const M=({block:t,closePopover:n,library:o})=>{const[l,x]=g.useState(!1),r=p.useBuilderProp("getUILibraryBlock",s.noop),{addCoreBlock:j,addPredefinedBlock:u}=p.useAddBlock(),[f,R]=p.useSelectedBlockIds(),[,b]=p.useHighlightBlockId(),h=s.get(t,"name",s.get(t,"label")),k=P.useFeature("dnd"),[,v]=q.useAtom(p.draggedBlockAtom),a=c=>{const m=s.has(c,"styles_attrs.data-page-section");return c._type==="Box"&&m},w=g.useCallback(async c=>{if(c.stopPropagation(),s.has(t,"component")){j(t,s.first(f)),n();return}x(!0);const m=await r(o,t);let E=s.first(f);a(s.first(m))&&(E=null),s.isEmpty(m)||u(C.syncBlocksWithDefaults(m),E),n()},[t]),d=async c=>{const m=await r(o,t);let E=s.first(f);if(a(s.first(m))&&(E=null),!s.isEmpty(m)){const y={blocks:m,uiLibrary:!0,parent:E};if(c.dataTransfer.setData("text/plain",JSON.stringify(y)),t.preview){const B=new Image;B.src=t.preview,B.onload=()=>{c.dataTransfer.setDragImage(B,0,0)}}else c.dataTransfer.setDragImage(new Image,0,0);v(y),setTimeout(()=>{R([]),b(null),n()},200)}};return e.jsxRuntimeExports.jsxs(i.Tooltip,{children:[e.jsxRuntimeExports.jsx(i.TooltipTrigger,{asChild:!0,children:e.jsxRuntimeExports.jsxs("div",{onClick:l?()=>{}:w,draggable:k?"true":"false",onDragStart:d,className:A("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:[l&&e.jsxRuntimeExports.jsxs("div",{className:"absolute flex h-full w-full items-center justify-center bg-black/70",children:[e.jsxRuntimeExports.jsx(T.Loader,{className:"animate-spin",size:15,color:"white"}),e.jsxRuntimeExports.jsx("span",{className:"pl-2 text-sm text-white",children:"Adding..."})]}),t.preview?e.jsxRuntimeExports.jsx("img",{src:t.preview,className:"min-h-[25px] w-full rounded-md",alt:h}):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:h})})]})}),e.jsxRuntimeExports.jsx(i.TooltipContent,{children:e.jsxRuntimeExports.jsx("p",{children:h})})]})},U=q.atom({}),z=t=>{const[n,o]=q.useAtom(U),l=p.useBuilderProp("getUILibraryBlocks",s.noop),x=s.get(n,`${t==null?void 0:t.uuid}.blocks`,[]),r=s.get(n,`${t==null?void 0:t.uuid}.loading`,!1);return g.useEffect(()=>{(async()=>{if(r||x.length>0||!t)return;o(u=>({...u,[t==null?void 0:t.uuid]:{loading:!0,blocks:[]}}));const j=await l(t);o(u=>({...u,[t==null?void 0:t.uuid]:{loading:!1,blocks:j||[]}}))})()},[t,x,r]),{data:x,isLoading:r}},G=p.atomWithStorage("_selectedLibrary",null),H=()=>{const[t,n]=q.useAtom(G),o=p.useBuilderProp("uiLibraries",[]),l=C.useChaiBlocks(),x=s.values(l).filter(d=>d.category==="custom"),r=o.find(d=>d.uuid===t)||s.first(o),{data:j,isLoading:u}=z(r),f=s.groupBy([...j,...x],"group"),[R,b]=g.useState("Hero"),[,h]=q.useAtom(p.activePanelAtom),k=s.get(f,R,[]),{t:v}=S.useTranslation(),a=g.useRef(null),w=d=>{a.current&&(clearTimeout(a.current),a.current=null),a.current=setTimeout(()=>{a.current&&b(d)},300)};return u?e.jsxRuntimeExports.jsx(i.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(_,{library:r==null?void 0:r.uuid,setLibrary:n,uiLibraries:o})})})}):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:g.Children.toArray(s.map(f,(d,c)=>e.jsxRuntimeExports.jsxs("div",{onMouseEnter:()=>w(c),onMouseLeave:()=>clearTimeout(a.current),onClick:()=>b(c),className:I.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",c===R?"bg-blue-500 text-white hover:bg-blue-600":""),children:[e.jsxRuntimeExports.jsx("span",{children:s.capitalize(c)}),e.jsxRuntimeExports.jsx(N.CaretRightIcon,{className:"ml-2 h-5 w-5"})]},c)))}),e.jsxRuntimeExports.jsxs(i.ScrollArea,{onMouseEnter:()=>a.current?clearTimeout(a.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:v("Click on a block to add it to the page")}),e.jsxRuntimeExports.jsx("div",{className:"flex flex-col gap-2 px-2",children:g.Children.toArray(k.map(d=>e.jsxRuntimeExports.jsx(M,{block:d,library:r,closePopover:()=>h(L.OUTLINE_KEY)})))}),e.jsxRuntimeExports.jsx("br",{}),e.jsxRuntimeExports.jsx("br",{}),e.jsxRuntimeExports.jsx("br",{})]})]})]})})},F=()=>e.jsxRuntimeExports.jsx(H,{});exports.default=F;
|
|
@@ -1,88 +1,100 @@
|
|
|
1
|
-
import { j as e } from "./jsx-runtime-
|
|
2
|
-
import {
|
|
3
|
-
import * as
|
|
4
|
-
import S, { useState as A,
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
1
|
+
import { j as e } from "./jsx-runtime-Sp0orL4X.js";
|
|
2
|
+
import { values as D, first as x, groupBy as U, get as g, map as _, capitalize as z, noop as T, has as I, isEmpty as L } from "lodash-es";
|
|
3
|
+
import * as R from "react";
|
|
4
|
+
import S, { useState as A, useRef as O, useCallback as G, useEffect as M } from "react";
|
|
5
|
+
import { w as H, c as C, e as F, s as W, i as $, t as J, r as K } from "./index-Dgo2PNEV.js";
|
|
6
|
+
import { useTranslation as P } from "react-i18next";
|
|
7
|
+
import { useChaiBlocks as X, syncBlocksWithDefaults as Y } from "@chaibuilder/runtime";
|
|
8
|
+
import { Loader as q } from "lucide-react";
|
|
9
|
+
import { atom as Q, useAtom as w } from "jotai";
|
|
10
|
+
import { c as E } from "./iconBase-zweRWSz0.js";
|
|
11
|
+
import { CaretSortIcon as V, CheckIcon as Z, CaretRightIcon as ee } from "@radix-ui/react-icons";
|
|
12
|
+
import { P as te, s as se, B as oe, t as re, u as ae, v as ie, w as ne, x as le, y as ce, z as me, S as de, X as ue, T as pe, d as xe, e as fe } from "./context-menu-sks9vdzC.js";
|
|
13
|
+
import { O as he } from "./STRINGS--j49GZJP.js";
|
|
14
14
|
import ge from "clsx";
|
|
15
15
|
import { useFeature as je } from "flagged";
|
|
16
|
-
import "./
|
|
17
|
-
import "@
|
|
18
|
-
import "
|
|
19
|
-
import "
|
|
16
|
+
import "./plugin-sJ3Hzvpv.js";
|
|
17
|
+
import "@react-hookz/web";
|
|
18
|
+
import "tree-model";
|
|
19
|
+
import "react-quill";
|
|
20
|
+
import "react-hotkeys-hook";
|
|
21
|
+
import "@floating-ui/dom";
|
|
22
|
+
import "@floating-ui/react-dom";
|
|
23
|
+
import "@tailwindcss/typography";
|
|
24
|
+
import "@tailwindcss/forms";
|
|
25
|
+
import "@tailwindcss/aspect-ratio";
|
|
26
|
+
import "tailwindcss-palette-generator";
|
|
20
27
|
import "tailwind-merge";
|
|
28
|
+
import "lodash";
|
|
29
|
+
import "react-wrap-balancer";
|
|
30
|
+
import "react-dom";
|
|
31
|
+
import "prop-types";
|
|
32
|
+
import "@rjsf/validator-ajv8";
|
|
33
|
+
import "@rjsf/core";
|
|
34
|
+
import "react-arborist";
|
|
35
|
+
import "himalaya";
|
|
36
|
+
import "react-icons-picker";
|
|
37
|
+
import "react-autosuggest";
|
|
38
|
+
import "fuse.js";
|
|
39
|
+
import "@radix-ui/react-scroll-area";
|
|
40
|
+
import "i18next";
|
|
21
41
|
import "@radix-ui/react-switch";
|
|
22
|
-
import "@radix-ui/react-slot";
|
|
23
42
|
import "@radix-ui/react-accordion";
|
|
43
|
+
import "class-variance-authority";
|
|
24
44
|
import "@radix-ui/react-alert-dialog";
|
|
25
|
-
import "@radix-ui/react-
|
|
45
|
+
import "@radix-ui/react-slot";
|
|
26
46
|
import "@radix-ui/react-label";
|
|
27
|
-
import "@radix-ui/react-scroll-area";
|
|
28
47
|
import "@radix-ui/react-tabs";
|
|
29
48
|
import "@radix-ui/react-tooltip";
|
|
30
49
|
import "@radix-ui/react-popover";
|
|
31
|
-
import "@radix-ui/react-menubar";
|
|
32
50
|
import "@radix-ui/react-hover-card";
|
|
33
|
-
import "@radix-ui/react-select";
|
|
34
51
|
import "@radix-ui/react-dropdown-menu";
|
|
35
|
-
import "@radix-ui/react-separator";
|
|
36
52
|
import "@radix-ui/react-toast";
|
|
37
53
|
import "cmdk";
|
|
54
|
+
import "@radix-ui/react-dialog";
|
|
38
55
|
import "@radix-ui/react-context-menu";
|
|
39
|
-
import "react-icons-picker";
|
|
40
|
-
import "react-dom";
|
|
41
|
-
import "react-quill";
|
|
42
|
-
import "@react-hookz/web";
|
|
43
|
-
import "tree-model";
|
|
44
56
|
function ke({
|
|
45
57
|
uiLibraries: t,
|
|
46
58
|
library: a,
|
|
47
|
-
setLibrary:
|
|
59
|
+
setLibrary: i
|
|
48
60
|
}) {
|
|
49
61
|
var u;
|
|
50
|
-
const [
|
|
51
|
-
return a ? /* @__PURE__ */ e.jsxs(
|
|
52
|
-
/* @__PURE__ */ e.jsx(
|
|
62
|
+
const [m, l] = R.useState(!1), { t: s } = P();
|
|
63
|
+
return a ? /* @__PURE__ */ e.jsxs(te, { open: m, onOpenChange: l, children: [
|
|
64
|
+
/* @__PURE__ */ e.jsx(se, { asChild: !0, children: /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-x-2", children: [
|
|
53
65
|
/* @__PURE__ */ e.jsx("span", { children: s("Choose Library") }),
|
|
54
66
|
/* @__PURE__ */ e.jsxs(
|
|
55
|
-
|
|
67
|
+
oe,
|
|
56
68
|
{
|
|
57
69
|
variant: "outline",
|
|
58
70
|
size: "sm",
|
|
59
71
|
role: "combobox",
|
|
60
|
-
"aria-expanded":
|
|
72
|
+
"aria-expanded": m,
|
|
61
73
|
className: "w-[200px] justify-between",
|
|
62
74
|
children: [
|
|
63
75
|
a ? (u = t.find((o) => o.uuid === a)) == null ? void 0 : u.name : s("Select library"),
|
|
64
|
-
/* @__PURE__ */ e.jsx(
|
|
76
|
+
/* @__PURE__ */ e.jsx(V, { className: "ml-2 h-4 w-4 shrink-0 opacity-50" })
|
|
65
77
|
]
|
|
66
78
|
}
|
|
67
79
|
)
|
|
68
80
|
] }) }),
|
|
69
|
-
/* @__PURE__ */ e.jsx(
|
|
70
|
-
/* @__PURE__ */ e.jsx(
|
|
71
|
-
/* @__PURE__ */ e.jsxs(
|
|
72
|
-
/* @__PURE__ */ e.jsx(
|
|
73
|
-
/* @__PURE__ */ e.jsx(
|
|
74
|
-
|
|
81
|
+
/* @__PURE__ */ e.jsx(re, { className: "w-[200px] p-0", children: /* @__PURE__ */ e.jsxs(ae, { children: [
|
|
82
|
+
/* @__PURE__ */ e.jsx(ie, { placeholder: "Search library...", className: "h-9" }),
|
|
83
|
+
/* @__PURE__ */ e.jsxs(ne, { children: [
|
|
84
|
+
/* @__PURE__ */ e.jsx(le, { children: "No library found." }),
|
|
85
|
+
/* @__PURE__ */ e.jsx(ce, { children: t.map((o) => /* @__PURE__ */ e.jsxs(
|
|
86
|
+
me,
|
|
75
87
|
{
|
|
76
88
|
value: o.uuid,
|
|
77
89
|
onSelect: (p) => {
|
|
78
|
-
|
|
90
|
+
i(p), l(!1);
|
|
79
91
|
},
|
|
80
92
|
children: [
|
|
81
93
|
o.name,
|
|
82
94
|
/* @__PURE__ */ e.jsx(
|
|
83
|
-
|
|
95
|
+
Z,
|
|
84
96
|
{
|
|
85
|
-
className:
|
|
97
|
+
className: E("ml-auto h-4 w-4", a === o.uuid ? "opacity-100" : "opacity-0")
|
|
86
98
|
}
|
|
87
99
|
)
|
|
88
100
|
]
|
|
@@ -96,28 +108,28 @@ function ke({
|
|
|
96
108
|
const we = ({
|
|
97
109
|
block: t,
|
|
98
110
|
closePopover: a,
|
|
99
|
-
library:
|
|
111
|
+
library: i
|
|
100
112
|
}) => {
|
|
101
|
-
const [
|
|
102
|
-
const
|
|
103
|
-
return r._type === "Box" &&
|
|
104
|
-
},
|
|
113
|
+
const [m, l] = A(!1), s = C("getUILibraryBlock", T), { addCoreBlock: u, addPredefinedBlock: o } = W(), [p, j] = $(), [, k] = J(), f = g(t, "name", g(t, "label")), v = je("dnd"), [, B] = w(K), n = (r) => {
|
|
114
|
+
const d = I(r, "styles_attrs.data-page-section");
|
|
115
|
+
return r._type === "Box" && d;
|
|
116
|
+
}, b = G(
|
|
105
117
|
async (r) => {
|
|
106
118
|
if (r.stopPropagation(), I(t, "component")) {
|
|
107
119
|
u(t, x(p)), a();
|
|
108
120
|
return;
|
|
109
121
|
}
|
|
110
122
|
l(!0);
|
|
111
|
-
const
|
|
123
|
+
const d = await s(i, t);
|
|
112
124
|
let h = x(p);
|
|
113
|
-
|
|
125
|
+
n(x(d)) && (h = null), L(d) || o(Y(d), h), a();
|
|
114
126
|
},
|
|
115
127
|
[t]
|
|
116
128
|
), c = async (r) => {
|
|
117
|
-
const
|
|
129
|
+
const d = await s(i, t);
|
|
118
130
|
let h = x(p);
|
|
119
|
-
if (
|
|
120
|
-
const y = { blocks:
|
|
131
|
+
if (n(x(d)) && (h = null), !L(d)) {
|
|
132
|
+
const y = { blocks: d, uiLibrary: !0, parent: h };
|
|
121
133
|
if (r.dataTransfer.setData("text/plain", JSON.stringify(y)), t.preview) {
|
|
122
134
|
const N = new Image();
|
|
123
135
|
N.src = t.preview, N.onload = () => {
|
|
@@ -125,81 +137,81 @@ const we = ({
|
|
|
125
137
|
};
|
|
126
138
|
} else
|
|
127
139
|
r.dataTransfer.setDragImage(new Image(), 0, 0);
|
|
128
|
-
|
|
140
|
+
B(y), setTimeout(() => {
|
|
129
141
|
j([]), k(null), a();
|
|
130
142
|
}, 200);
|
|
131
143
|
}
|
|
132
144
|
};
|
|
133
|
-
return /* @__PURE__ */ e.jsxs(
|
|
134
|
-
/* @__PURE__ */ e.jsx(
|
|
145
|
+
return /* @__PURE__ */ e.jsxs(pe, { children: [
|
|
146
|
+
/* @__PURE__ */ e.jsx(xe, { asChild: !0, children: /* @__PURE__ */ e.jsxs(
|
|
135
147
|
"div",
|
|
136
148
|
{
|
|
137
|
-
onClick:
|
|
138
|
-
} :
|
|
149
|
+
onClick: m ? () => {
|
|
150
|
+
} : b,
|
|
139
151
|
draggable: v ? "true" : "false",
|
|
140
152
|
onDragStart: c,
|
|
141
153
|
className: ge(
|
|
142
154
|
"relative mt-2 cursor-pointer overflow-hidden rounded-md border border-gray-300 bg-white duration-200 hover:border-blue-500 hover:shadow-xl"
|
|
143
155
|
),
|
|
144
156
|
children: [
|
|
145
|
-
|
|
146
|
-
/* @__PURE__ */ e.jsx(
|
|
157
|
+
m && /* @__PURE__ */ e.jsxs("div", { className: "absolute flex h-full w-full items-center justify-center bg-black/70", children: [
|
|
158
|
+
/* @__PURE__ */ e.jsx(q, { className: "animate-spin", size: 15, color: "white" }),
|
|
147
159
|
/* @__PURE__ */ e.jsx("span", { className: "pl-2 text-sm text-white", children: "Adding..." })
|
|
148
160
|
] }),
|
|
149
161
|
t.preview ? /* @__PURE__ */ e.jsx("img", { src: t.preview, className: "min-h-[25px] w-full rounded-md", alt: f }) : /* @__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: f }) })
|
|
150
162
|
]
|
|
151
163
|
}
|
|
152
164
|
) }),
|
|
153
|
-
/* @__PURE__ */ e.jsx(
|
|
165
|
+
/* @__PURE__ */ e.jsx(fe, { children: /* @__PURE__ */ e.jsx("p", { children: f }) })
|
|
154
166
|
] });
|
|
155
|
-
}, ve =
|
|
156
|
-
const [a,
|
|
157
|
-
return
|
|
167
|
+
}, ve = Q({}), Be = (t) => {
|
|
168
|
+
const [a, i] = w(ve), m = C("getUILibraryBlocks", T), l = g(a, `${t == null ? void 0 : t.uuid}.blocks`, []), s = g(a, `${t == null ? void 0 : t.uuid}.loading`, !1);
|
|
169
|
+
return M(() => {
|
|
158
170
|
(async () => {
|
|
159
171
|
if (s || l.length > 0 || !t)
|
|
160
172
|
return;
|
|
161
|
-
|
|
162
|
-
const u = await
|
|
163
|
-
|
|
173
|
+
i((o) => ({ ...o, [t == null ? void 0 : t.uuid]: { loading: !0, blocks: [] } }));
|
|
174
|
+
const u = await m(t);
|
|
175
|
+
i((o) => ({ ...o, [t == null ? void 0 : t.uuid]: { loading: !1, blocks: u || [] } }));
|
|
164
176
|
})();
|
|
165
177
|
}, [t, l, s]), { data: l, isLoading: s };
|
|
166
|
-
},
|
|
167
|
-
const [t, a] = w(
|
|
168
|
-
|
|
169
|
-
|
|
178
|
+
}, be = H("_selectedLibrary", null), Ne = () => {
|
|
179
|
+
const [t, a] = w(be), i = C("uiLibraries", []), m = X(), l = D(m).filter((c) => c.category === "custom"), s = i.find((c) => c.uuid === t) || x(i), { data: u, isLoading: o } = Be(s), p = U([...u, ...l], "group"), [j, k] = A("Hero"), [, f] = w(F), v = g(p, j, []), { t: B } = P(), n = O(null), b = (c) => {
|
|
180
|
+
n.current && (clearTimeout(n.current), n.current = null), n.current = setTimeout(() => {
|
|
181
|
+
n.current && k(c);
|
|
170
182
|
}, 300);
|
|
171
183
|
};
|
|
172
|
-
return o ? /* @__PURE__ */ e.jsx(
|
|
173
|
-
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(ke, { library: s == null ? void 0 : s.uuid, setLibrary: a, uiLibraries:
|
|
184
|
+
return o ? /* @__PURE__ */ e.jsx(de, { 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: [
|
|
185
|
+
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(ke, { library: s == null ? void 0 : s.uuid, setLibrary: a, uiLibraries: i }) }) }) }) : null,
|
|
174
186
|
/* @__PURE__ */ e.jsxs("div", { className: "flex h-[95%] border-t border-gray-300 pt-2", children: [
|
|
175
187
|
/* @__PURE__ */ e.jsx("div", { className: "flex h-full w-40 flex-col gap-1 px-1", children: S.Children.toArray(
|
|
176
|
-
|
|
188
|
+
_(p, (c, r) => /* @__PURE__ */ e.jsxs(
|
|
177
189
|
"div",
|
|
178
190
|
{
|
|
179
|
-
onMouseEnter: () =>
|
|
180
|
-
onMouseLeave: () => clearTimeout(
|
|
191
|
+
onMouseEnter: () => b(r),
|
|
192
|
+
onMouseLeave: () => clearTimeout(n.current),
|
|
181
193
|
onClick: () => k(r),
|
|
182
|
-
className:
|
|
194
|
+
className: E(
|
|
183
195
|
"flex w-full cursor-pointer items-center justify-between rounded-md p-1 text-sm transition-all ease-in-out hover:bg-gray-200",
|
|
184
196
|
r === j ? "bg-blue-500 text-white hover:bg-blue-600" : ""
|
|
185
197
|
),
|
|
186
198
|
children: [
|
|
187
|
-
/* @__PURE__ */ e.jsx("span", { children:
|
|
188
|
-
/* @__PURE__ */ e.jsx(
|
|
199
|
+
/* @__PURE__ */ e.jsx("span", { children: z(r) }),
|
|
200
|
+
/* @__PURE__ */ e.jsx(ee, { className: "ml-2 h-5 w-5" })
|
|
189
201
|
]
|
|
190
202
|
},
|
|
191
203
|
r
|
|
192
204
|
))
|
|
193
205
|
) }),
|
|
194
206
|
/* @__PURE__ */ e.jsxs(
|
|
195
|
-
|
|
207
|
+
ue,
|
|
196
208
|
{
|
|
197
|
-
onMouseEnter: () =>
|
|
209
|
+
onMouseEnter: () => n.current ? clearTimeout(n.current) : null,
|
|
198
210
|
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",
|
|
199
211
|
children: [
|
|
200
|
-
/* @__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:
|
|
212
|
+
/* @__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: B("Click on a block to add it to the page") }),
|
|
201
213
|
/* @__PURE__ */ e.jsx("div", { className: "flex flex-col gap-2 px-2", children: S.Children.toArray(
|
|
202
|
-
v.map((c) => /* @__PURE__ */ e.jsx(we, { block: c, library: s, closePopover: () => f(
|
|
214
|
+
v.map((c) => /* @__PURE__ */ e.jsx(we, { block: c, library: s, closePopover: () => f(he) }))
|
|
203
215
|
) }),
|
|
204
216
|
/* @__PURE__ */ e.jsx("br", {}),
|
|
205
217
|
/* @__PURE__ */ e.jsx("br", {}),
|
|
@@ -209,7 +221,7 @@ const we = ({
|
|
|
209
221
|
)
|
|
210
222
|
] })
|
|
211
223
|
] }) });
|
|
212
|
-
},
|
|
224
|
+
}, Ct = () => /* @__PURE__ */ e.jsx(Ne, {});
|
|
213
225
|
export {
|
|
214
|
-
|
|
226
|
+
Ct as default
|
|
215
227
|
};
|