@chaibuilder/sdk 1.2.9 → 1.2.10-7.beta.1
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/README.md +26 -21
- package/dist/CodeEditor-3Vp79cuE.cjs +1 -0
- package/dist/CodeEditor-bUqM7eCa.js +129 -0
- package/dist/STRINGS-Xxstm-7I.js +7 -0
- package/dist/STRINGS-Yl7cSWDc.cjs +1 -0
- package/dist/Topbar-P7-9Rps1.js +124 -0
- package/dist/Topbar-xwQ4JUZD.cjs +1 -0
- package/dist/UnsplashImages-BxgbXGB6.cjs +1 -0
- package/dist/UnsplashImages-nQSvWPU0.js +244 -0
- package/dist/UploadImages-L9LlI-jl.cjs +1 -0
- package/dist/UploadImages-SVnIHigg.js +153 -0
- package/dist/context-menu-YGd09SE1.js +979 -0
- package/dist/context-menu-sQn7ryJ6.cjs +1 -0
- package/dist/{controls-XPXGHKht.js → controls-lEwMTdPQ.js} +96 -44
- package/dist/controls-p9IwFnPx.cjs +1 -0
- package/dist/core.cjs +1 -1
- package/dist/core.d.ts +344 -119
- package/dist/core.js +111 -88
- package/dist/iconBase-Ief2hJUZ.js +130 -0
- package/dist/iconBase-aZzpqff_.cjs +1 -0
- package/dist/index-3NV_rst1.js +9051 -0
- package/dist/index-qTKBamQ6.cjs +63 -0
- package/dist/jsx-runtime-JYMCiFoE.cjs +27 -0
- package/dist/{jsx-runtime-WbnYoNE9.js → jsx-runtime-Sp0orL4X.js} +106 -109
- package/dist/mockServiceWorker.js +18 -10
- package/dist/plugin-UiUFs2fK.js +44 -0
- package/dist/plugin-f6SDZ_Or.js +108 -0
- package/dist/plugin-jum1MjXp.cjs +1 -0
- package/dist/plugin-xOpS-UNV.cjs +1 -0
- package/dist/render.cjs +3 -1
- package/dist/render.d.ts +21 -40
- package/dist/render.js +129 -85
- package/dist/runtime.cjs +1 -0
- package/dist/runtime.d.ts +5 -0
- package/dist/runtime.js +21 -0
- package/dist/style.css +2 -2
- package/dist/tailwind.cjs +1 -1
- package/dist/tailwind.d.ts +49 -8
- package/dist/tailwind.js +16 -20
- package/dist/ui.cjs +1 -1
- package/dist/ui.d.ts +3 -13
- package/dist/ui.js +363 -163
- package/dist/web-blocks.cjs +3 -9
- package/dist/web-blocks.d.ts +1 -1
- package/dist/web-blocks.js +722 -770
- package/package.json +66 -83
- package/dist/AddBlocks-tMxKPoen.js +0 -225
- package/dist/AddBlocks-x2LkOHSj.cjs +0 -1
- package/dist/BrandingOptions-EzT9UYd6.cjs +0 -1
- package/dist/BrandingOptions-QJJ1y5ez.js +0 -194
- package/dist/CanvasArea-mlNKmCOh.js +0 -1425
- package/dist/CanvasArea-xs4wM64L.cjs +0 -60
- package/dist/CurrentPage-aaU4F7wi.cjs +0 -1
- package/dist/CurrentPage-lBy25sZn.js +0 -111
- package/dist/Functions-7jnEwJyw.js +0 -15
- package/dist/Functions-N3yhPYKY.cjs +0 -1
- package/dist/Layers-3Xs4A5i8.js +0 -404
- package/dist/Layers-eaHy5PK9.cjs +0 -1
- package/dist/MODIFIERS-2FeVfZQ9.cjs +0 -1
- package/dist/MODIFIERS-RiXS5Mn1.js +0 -67
- package/dist/MarkAsGlobalBlock-BjP-Rqlf.js +0 -88
- package/dist/MarkAsGlobalBlock-X5dNmZcb.cjs +0 -1
- package/dist/PagesPanel--BZhafnt.js +0 -69
- package/dist/PagesPanel-gGKCV394.cjs +0 -1
- package/dist/ProjectPanel-YcLkM-DW.js +0 -90
- package/dist/ProjectPanel-yFJRy0_E.cjs +0 -1
- package/dist/Settings-7wlLcvoh.cjs +0 -1
- package/dist/Settings-TAgX4hov.js +0 -2186
- package/dist/SidePanels-5H4j0mIs.cjs +0 -1
- package/dist/SidePanels-btVQQkVK.js +0 -349
- package/dist/Topbar-V8xCetWF.cjs +0 -1
- package/dist/Topbar-j4t4AgCq.js +0 -116
- package/dist/UnsplashImages-41Y3q5_Q.js +0 -200
- package/dist/UnsplashImages-DbHky6cj.cjs +0 -1
- package/dist/UploadImages-DnQ95_NW.cjs +0 -1
- package/dist/UploadImages-xBg-kbKv.js +0 -138
- package/dist/_commonjsHelpers-UyOWmZb0.js +0 -8
- package/dist/_commonjsHelpers-wDK0ZLPo.cjs +0 -1
- package/dist/add-page-modal-MwS7iXn_.cjs +0 -1
- package/dist/add-page-modal-cm8damU2.js +0 -108
- package/dist/confirm-alert-U7-NcG7G.cjs +0 -1
- package/dist/confirm-alert-i4pM3mOt.js +0 -62
- package/dist/controls-Dy1qa8Dc.cjs +0 -1
- package/dist/delete-page-modal-5o4jXu-z.cjs +0 -1
- package/dist/delete-page-modal-YrIBvfFA.js +0 -88
- package/dist/email-blocks.cjs +0 -1
- package/dist/email-blocks.d.ts +0 -3
- package/dist/email-blocks.js +0 -274
- package/dist/form-OVmsLOrc.js +0 -125
- package/dist/form-VbouZlAW.cjs +0 -1
- package/dist/functions-Ox_svtKm.cjs +0 -1
- package/dist/functions-xIebp8Aw.js +0 -23
- package/dist/html-to-json-2PeOCVey.cjs +0 -1
- package/dist/html-to-json-57841sEK.js +0 -183
- package/dist/index-H6vIwGfD.cjs +0 -1
- package/dist/index-N50dZnlC.cjs +0 -206
- package/dist/index-e0c8PmRQ.js +0 -205
- package/dist/index-gi1LIOCw.cjs +0 -1
- package/dist/index-niHREMmR.js +0 -2938
- package/dist/index-pZhGT8uT.js +0 -41620
- package/dist/jsx-runtime-Z_BpKhVy.cjs +0 -27
- package/dist/lib.cjs +0 -4
- package/dist/lib.d.ts +0 -78
- package/dist/lib.js +0 -1322
- package/dist/page-viewer-SLt8XgYv.cjs +0 -1
- package/dist/page-viewer-feqJr1QI.js +0 -115
- package/dist/project-general-setting-SgagORzW.js +0 -83
- package/dist/project-general-setting-ym0yCdOq.cjs +0 -1
- package/dist/project-seo-setting-Snn2nZgS.cjs +0 -1
- package/dist/project-seo-setting-wxAGEkd_.js +0 -85
- package/dist/server.cjs +0 -1
- package/dist/server.d.ts +0 -299
- package/dist/server.js +0 -216
- package/dist/single-page-detail-IPod1o5P.cjs +0 -1
- package/dist/single-page-detail-dnWMyg6P.js +0 -222
- package/dist/studio.cjs +0 -1
- package/dist/studio.d.ts +0 -13
- package/dist/studio.js +0 -58
- package/dist/useAddBlockByDrop-_nwI4W3q.js +0 -20
- package/dist/useAddBlockByDrop-inkD7Lck.cjs +0 -1
- package/dist/utils-AvyFzbPC.js +0 -1075
- package/dist/utils-PTxFk6qT.cjs +0 -1
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
import { j as e } from "./jsx-runtime-Sp0orL4X.js";
|
|
2
|
+
import { useState as l, useEffect as k } from "react";
|
|
3
|
+
import { isEmpty as j, map as b } from "lodash-es";
|
|
4
|
+
import { atom as F, useAtom as U } from "jotai";
|
|
5
|
+
import { S as C } from "./context-menu-YGd09SE1.js";
|
|
6
|
+
import { useTranslation as S } from "react-i18next";
|
|
7
|
+
import { d as N } from "./index-3NV_rst1.js";
|
|
8
|
+
import { Upload as E, Loader as G } from "lucide-react";
|
|
9
|
+
import "@radix-ui/react-switch";
|
|
10
|
+
import "@radix-ui/react-accordion";
|
|
11
|
+
import "@radix-ui/react-icons";
|
|
12
|
+
import "class-variance-authority";
|
|
13
|
+
import "@radix-ui/react-alert-dialog";
|
|
14
|
+
import "@radix-ui/react-slot";
|
|
15
|
+
import "@radix-ui/react-label";
|
|
16
|
+
import "@radix-ui/react-scroll-area";
|
|
17
|
+
import "@radix-ui/react-tabs";
|
|
18
|
+
import "@radix-ui/react-tooltip";
|
|
19
|
+
import "@radix-ui/react-popover";
|
|
20
|
+
import "@radix-ui/react-hover-card";
|
|
21
|
+
import "@radix-ui/react-select";
|
|
22
|
+
import "@radix-ui/react-dropdown-menu";
|
|
23
|
+
import "@radix-ui/react-separator";
|
|
24
|
+
import "@radix-ui/react-toast";
|
|
25
|
+
import "cmdk";
|
|
26
|
+
import "@radix-ui/react-dialog";
|
|
27
|
+
import "@radix-ui/react-context-menu";
|
|
28
|
+
import "clsx";
|
|
29
|
+
import "tailwind-merge";
|
|
30
|
+
import "./iconBase-Ief2hJUZ.js";
|
|
31
|
+
import "@chaibuilder/runtime";
|
|
32
|
+
import "./plugin-f6SDZ_Or.js";
|
|
33
|
+
import "@react-hookz/web";
|
|
34
|
+
import "tree-model";
|
|
35
|
+
import "react-quill";
|
|
36
|
+
import "./STRINGS-Xxstm-7I.js";
|
|
37
|
+
import "flagged";
|
|
38
|
+
import "react-hotkeys-hook";
|
|
39
|
+
import "@floating-ui/dom";
|
|
40
|
+
import "@floating-ui/react-dom";
|
|
41
|
+
import "react-event-hook";
|
|
42
|
+
import "@tailwindcss/typography";
|
|
43
|
+
import "@tailwindcss/forms";
|
|
44
|
+
import "@tailwindcss/aspect-ratio";
|
|
45
|
+
import "react-wrap-balancer";
|
|
46
|
+
import "react-dom";
|
|
47
|
+
import "prop-types";
|
|
48
|
+
import "react-error-boundary";
|
|
49
|
+
import "re-resizable";
|
|
50
|
+
import "@rjsf/validator-ajv8";
|
|
51
|
+
import "@rjsf/core";
|
|
52
|
+
import "./controls-lEwMTdPQ.js";
|
|
53
|
+
import "react-arborist";
|
|
54
|
+
import "himalaya";
|
|
55
|
+
import "react-icons-picker";
|
|
56
|
+
import "react-autosuggest";
|
|
57
|
+
import "fuse.js";
|
|
58
|
+
import "i18next";
|
|
59
|
+
import "framer-motion";
|
|
60
|
+
const P = F([]), Re = ({ isModalView: s, onSelect: m }) => {
|
|
61
|
+
const { t: r } = S(), c = N("uploadMediaCallback"), n = N("fetchMediaCallback"), [i, d] = U(P), [y, u] = l(!1), [x, f] = l(!1), [, v] = l(), [h, p] = l("");
|
|
62
|
+
k(() => {
|
|
63
|
+
(async () => {
|
|
64
|
+
if (!n)
|
|
65
|
+
return;
|
|
66
|
+
f(!0);
|
|
67
|
+
const t = await n();
|
|
68
|
+
d(t || []), f(!1);
|
|
69
|
+
})();
|
|
70
|
+
}, []);
|
|
71
|
+
const w = (t) => {
|
|
72
|
+
var o, a;
|
|
73
|
+
if (p(""), t && ((a = (o = t == null ? void 0 : t.target) == null ? void 0 : o.files) == null ? void 0 : a.length) > 0) {
|
|
74
|
+
const g = t.target.files[0];
|
|
75
|
+
g.type.startsWith("image") ? I(g) : p(r("Please select an image"));
|
|
76
|
+
}
|
|
77
|
+
}, I = async (t) => {
|
|
78
|
+
if (c) {
|
|
79
|
+
u(!0);
|
|
80
|
+
try {
|
|
81
|
+
const { url: o } = await c(t);
|
|
82
|
+
m(o), v(void 0);
|
|
83
|
+
const a = await n();
|
|
84
|
+
d(a);
|
|
85
|
+
} catch (o) {
|
|
86
|
+
d([]), p((o == null ? void 0 : o.message) || "Something went wrong.");
|
|
87
|
+
}
|
|
88
|
+
u(!1);
|
|
89
|
+
}
|
|
90
|
+
};
|
|
91
|
+
return /* @__PURE__ */ e.jsxs("div", { children: [
|
|
92
|
+
/* @__PURE__ */ e.jsxs("label", { htmlFor: s ? "upload-in-modal" : "upload-in-panel", children: [
|
|
93
|
+
/* @__PURE__ */ e.jsx("div", { className: "flex flex-col items-center rounded-lg", children: /* @__PURE__ */ e.jsxs(
|
|
94
|
+
"label",
|
|
95
|
+
{
|
|
96
|
+
htmlFor: "image-upload",
|
|
97
|
+
className: "flex w-full cursor-pointer flex-col items-center justify-center rounded-lg border-2 border-dashed border-border",
|
|
98
|
+
children: [
|
|
99
|
+
/* @__PURE__ */ e.jsxs("div", { className: "flex flex-col items-center justify-center pb-6 pt-5", children: [
|
|
100
|
+
/* @__PURE__ */ e.jsx(E, { className: "mb-3 h-10 w-10 text-gray-400" }),
|
|
101
|
+
/* @__PURE__ */ e.jsx("p", { className: "mb-2 text-sm text-gray-500 dark:text-gray-400", children: /* @__PURE__ */ e.jsx("span", { className: "font-semibold", children: r("Click to upload") }) }),
|
|
102
|
+
/* @__PURE__ */ e.jsx("p", { className: "text-xs text-gray-500 dark:text-gray-400", children: r("SVG, PNG, JPG or GIF (Max. 2mb)") })
|
|
103
|
+
] }),
|
|
104
|
+
y ? /* @__PURE__ */ e.jsxs("div", { className: "flex h-full w-full items-center justify-center", children: [
|
|
105
|
+
/* @__PURE__ */ e.jsx(G, { className: "h-6 w-6 animate-spin" }),
|
|
106
|
+
/* @__PURE__ */ e.jsx("span", { className: "ml-2 text-sm text-gray-500", children: r("Uploading...") })
|
|
107
|
+
] }) : null,
|
|
108
|
+
h && /* @__PURE__ */ e.jsx("p", { className: "pb-2 text-xs text-red-500", children: h || r("Something went wrong") })
|
|
109
|
+
]
|
|
110
|
+
}
|
|
111
|
+
) }),
|
|
112
|
+
/* @__PURE__ */ e.jsx(
|
|
113
|
+
"input",
|
|
114
|
+
{
|
|
115
|
+
type: "file",
|
|
116
|
+
id: "image-upload",
|
|
117
|
+
accept: "image/*",
|
|
118
|
+
hidden: !0,
|
|
119
|
+
onChange: w
|
|
120
|
+
}
|
|
121
|
+
)
|
|
122
|
+
] }),
|
|
123
|
+
/* @__PURE__ */ e.jsxs(C, { className: `-mx-2 flex h-full flex-col pb-8 pt-2 ${s ? "px-2" : ""} pt-2`, children: [
|
|
124
|
+
j(i) && x && /* @__PURE__ */ e.jsx("div", { className: "flex flex-col items-center justify-center py-6", children: /* @__PURE__ */ e.jsx("div", { className: "animate-pulse font-medium", children: r("Fetching...") }) }),
|
|
125
|
+
j(i) && !x && /* @__PURE__ */ e.jsxs("div", { className: "flex h-full flex-col items-center justify-center text-center", children: [
|
|
126
|
+
/* @__PURE__ */ e.jsx("div", { className: "mb-4 h-12 rounded-full p-6" }),
|
|
127
|
+
/* @__PURE__ */ e.jsx("h3", { className: "mb-2 text-sm font-semibold", children: r("No images found") }),
|
|
128
|
+
/* @__PURE__ */ e.jsx("p", { className: "mb-4 max-w-sm text-muted-foreground", children: r("It looks like you haven't uploaded any images yet. Start by clicking the upload button above.") })
|
|
129
|
+
] }),
|
|
130
|
+
s ? /* @__PURE__ */ e.jsx("div", { className: "h-full columns-5 py-2", children: b(i, (t) => /* @__PURE__ */ e.jsx("div", { role: "button", tabIndex: 0, className: "my-1 flex", onClick: () => m(t.url), children: /* @__PURE__ */ e.jsx("div", { className: "relative overflow-hidden rounded-md bg-cover bg-no-repeat", children: /* @__PURE__ */ e.jsx(
|
|
131
|
+
"img",
|
|
132
|
+
{
|
|
133
|
+
className: "h-auto flex-1 cursor-pointer rounded-md transition duration-300 ease-in-out hover:scale-105",
|
|
134
|
+
alt: t.name,
|
|
135
|
+
src: t.thumbUrl
|
|
136
|
+
}
|
|
137
|
+
) }) }, t.id)) }) : b(i, (t) => (
|
|
138
|
+
// TODO: Drag and Drop Image to Canvas from Here use `pic.url` for image quality
|
|
139
|
+
/* @__PURE__ */ e.jsx("div", { role: "button", tabIndex: 0, className: "px-2 py-1", onClick: () => m(t.url), children: /* @__PURE__ */ e.jsx("div", { className: "relative overflow-hidden rounded-md bg-cover bg-no-repeat", children: /* @__PURE__ */ e.jsx(
|
|
140
|
+
"img",
|
|
141
|
+
{
|
|
142
|
+
className: "h-auto w-full cursor-pointer transition duration-300 ease-in-out hover:scale-105",
|
|
143
|
+
alt: t.name,
|
|
144
|
+
src: t.url
|
|
145
|
+
}
|
|
146
|
+
) }) }, t.id)
|
|
147
|
+
))
|
|
148
|
+
] })
|
|
149
|
+
] });
|
|
150
|
+
};
|
|
151
|
+
export {
|
|
152
|
+
Re as default
|
|
153
|
+
};
|