@chaibuilder/sdk 1.2.16 → 1.2.18
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 +6 -4
- package/dist/AddBlocks-5Q5w5lPJ.cjs +1 -0
- package/dist/{AddBlocks-TBFBvBvo.js → AddBlocks-uCdu9Xpr.js} +81 -81
- package/dist/{BrandingOptions-t_MjeHSM.js → BrandingOptions-JbHRN7V5.js} +18 -19
- package/dist/BrandingOptions-xrGQI1Kn.cjs +1 -0
- package/dist/{CanvasArea-ZYC8QbQB.js → CanvasArea-aWzbzB9p.js} +89 -95
- package/dist/{CanvasArea-oTylYgH9.cjs → CanvasArea-oUIvLfdq.cjs} +3 -3
- package/dist/{Class-17XFhL48.js → Class-3k8xjeiM.js} +1 -1
- package/dist/{Class-5ARpH_Tu.cjs → Class-MmCxz2Ay.cjs} +1 -1
- package/dist/{CurrentPage-4vC6olJo.js → CurrentPage-AlOLPG4o.js} +16 -16
- package/dist/CurrentPage-atmd8UrZ.cjs +1 -0
- package/dist/MODIFIERS-9EwxLM8V.cjs +1 -0
- package/dist/{MODIFIERS-RiXS5Mn1.js → MODIFIERS-WQdaNvb8.js} +5 -4
- package/dist/{Layers-m61dThGR.js → Outline-oGoAdnBw.js} +153 -145
- package/dist/Outline-uMUTwN-R.cjs +1 -0
- package/dist/{PagesPanel-v3KV_vfG.js → PagesPanel-VbSQHEu_.js} +10 -10
- package/dist/PagesPanel-nN3QUwXp.cjs +1 -0
- package/dist/ProjectPanel-UIEFhref.cjs +1 -0
- package/dist/{ProjectPanel-xsUuVX64.js → ProjectPanel-fqux215P.js} +8 -8
- package/dist/Settings-8qUW0Iow.cjs +1 -0
- package/dist/{Settings-ZNxfF14G.js → Settings-IhWI1ice.js} +293 -293
- package/dist/SidePanels-cOHgPE9y.cjs +1 -0
- package/dist/SidePanels-lMCXrchR.js +389 -0
- package/dist/Topbar-DYiisBtw.js +129 -0
- package/dist/Topbar-vLD-rWl5.cjs +1 -0
- package/dist/{UnsplashImages-SrxA-yNu.cjs → UnsplashImages-1JWfKlBc.cjs} +1 -1
- package/dist/{UnsplashImages-ppQXZ28F.js → UnsplashImages-lGLcqo4M.js} +13 -13
- package/dist/{UploadImages-IKR4oX2k.js → UploadImages-06m6vjbL.js} +35 -31
- package/dist/UploadImages-T4MYMOhW.cjs +1 -0
- package/dist/{add-page-modal-pc5-Yw4C.js → add-page-modal-mEbIXSKX.js} +13 -12
- package/dist/add-page-modal-niwhffYL.cjs +1 -0
- package/dist/{confirm-alert-QKtbNbWz.js → confirm-alert-YETlIRpE.js} +5 -5
- package/dist/{confirm-alert-uV_PtYc3.cjs → confirm-alert-ZpEIxh3X.cjs} +1 -1
- package/dist/controls-Dy1qa8Dc.cjs +1 -0
- package/dist/{empty-slot-5FRrRq1E.js → controls-XPXGHKht.js} +50 -61
- package/dist/core.cjs +1 -1
- package/dist/core.d.ts +18 -3
- package/dist/core.js +47 -53
- package/dist/{defaultTheme-IH19g4fv.cjs → defaultTheme-1XwPZT2b.cjs} +1 -1
- package/dist/{defaultTheme-YY8mlQS3.js → defaultTheme-s0cpA5Oy.js} +1 -1
- package/dist/{delete-page-modal-Zf3-4wLg.js → delete-page-modal-J_SmPWrw.js} +12 -12
- package/dist/delete-page-modal-sOqRlmKb.cjs +1 -0
- package/dist/email-blocks.cjs +1 -1
- package/dist/email-blocks.js +11 -10
- package/dist/email.cjs +1 -1
- package/dist/email.d.ts +15 -2
- package/dist/email.js +7 -12
- package/dist/empty-slot-ZBlsQi6m.js +15 -0
- package/dist/empty-slot-nzYOgZuS.cjs +1 -0
- package/dist/{form-faX0Yn4Q.js → form-2xJcQs_Y.js} +1 -1
- package/dist/{form-KkP1F7h1.cjs → form-Y0Vb4m04.cjs} +1 -1
- package/dist/{html-to-json-57841sEK.js → html-to-json-C5sExaSD.js} +1 -1
- package/dist/{html-to-json-2PeOCVey.cjs → html-to-json-FGufPv9R.cjs} +1 -1
- package/dist/index-3TQsdso6.cjs +1 -0
- package/dist/index-627XtO9e.js +2202 -0
- package/dist/{index-rktN6W1Y.js → index-LF3KXx4u.js} +22845 -25123
- package/dist/index-T3wfa1kz.cjs +1 -0
- package/dist/index-YpnaudSM.js +63 -0
- package/dist/{index-QGA4ayU7.js → index-ZBqiaKhx.js} +378 -378
- package/dist/index-ZwpjuB-N.cjs +206 -0
- package/dist/index-ecnGWzh9.cjs +1 -0
- package/dist/lib.cjs +1 -1
- package/dist/lib.js +5 -5
- package/dist/page-viewer-6UDraUKW.cjs +1 -0
- package/dist/{page-viewer-Cv_WZY-t.js → page-viewer-7u0SWWmO.js} +11 -11
- package/dist/project-general-setting-AW5Vtmgx.cjs +1 -0
- package/dist/{project-general-setting-x6qqF0T8.js → project-general-setting-SqC85J7F.js} +11 -10
- package/dist/{project-seo-setting-Sl6AE-Q7.js → project-seo-setting-TlQherop.js} +7 -7
- package/dist/project-seo-setting-cWiNZcxW.cjs +1 -0
- package/dist/render.cjs +1 -1
- package/dist/render.js +2 -2
- package/dist/{single-page-detail-sGbwXXs1.js → single-page-detail-ClZYIdSO.js} +43 -42
- package/dist/single-page-detail-kJUW6FE9.cjs +1 -0
- package/dist/studio.cjs +1 -1
- package/dist/studio.d.ts +15 -2
- package/dist/studio.js +7 -7
- package/dist/ui.cjs +1 -1
- package/dist/ui.d.ts +4 -4
- package/dist/ui.js +50 -50
- package/dist/useAddBlockByDrop-E343zoB3.cjs +1 -0
- package/dist/useAddBlockByDrop-sPX4lN-O.js +20 -0
- package/dist/web-blocks.cjs +1 -1
- package/dist/web-blocks.js +4 -3
- package/package.json +1 -1
- package/dist/AddBlocks-FUKuRbn6.cjs +0 -1
- package/dist/BrandingOptions-tBWzqas5.cjs +0 -1
- package/dist/CurrentPage-g8aT56B2.cjs +0 -1
- package/dist/Layers-fEb6biiU.cjs +0 -1
- package/dist/MODIFIERS-2FeVfZQ9.cjs +0 -1
- package/dist/PagesPanel-ewHplHej.cjs +0 -1
- package/dist/ProjectPanel-pgpe3fyR.cjs +0 -1
- package/dist/Settings-zk2jUrHc.cjs +0 -1
- package/dist/SidePanels-MbJufIbe.js +0 -352
- package/dist/SidePanels-zXHw8T3P.cjs +0 -1
- package/dist/Topbar-iH2L4pe0.cjs +0 -1
- package/dist/Topbar-ryFhl-PC.js +0 -114
- package/dist/UploadImages-VBiO6lqp.cjs +0 -1
- package/dist/add-page-modal-myA0a2nW.cjs +0 -1
- package/dist/delete-page-modal-q4G_-zBl.cjs +0 -1
- package/dist/empty-slot-2LSrWJaY.cjs +0 -1
- package/dist/index-DT71IahS.cjs +0 -206
- package/dist/index-ERorPL9q.cjs +0 -1
- package/dist/page-viewer-z9Kn4i1K.cjs +0 -1
- package/dist/project-general-setting-ZiLidijs.cjs +0 -1
- package/dist/project-seo-setting-8oJUrOqk.cjs +0 -1
- package/dist/single-page-detail-cnwttu4D.cjs +0 -1
- package/dist/useAddBlockByDrop-LBgi6GL7.cjs +0 -1
- package/dist/useAddBlockByDrop-Y-g4O8UC.js +0 -20
|
@@ -2,10 +2,10 @@ import { j as e } from "./jsx-runtime-WbnYoNE9.js";
|
|
|
2
2
|
import { useState as p, useEffect as D } from "react";
|
|
3
3
|
import { isEmpty as d, startCase as E } from "lodash-es";
|
|
4
4
|
import { MixerHorizontalIcon as L } from "@radix-ui/react-icons";
|
|
5
|
-
import { createApi as
|
|
6
|
-
import {
|
|
5
|
+
import { createApi as V } from "unsplash-js";
|
|
6
|
+
import { h as B, bd as F, aV as K, aW as U, aX as O, aj as P, ak as C, al as S, am as k, an as h, bg as Q, B as H } from "./index-ZBqiaKhx.js";
|
|
7
7
|
import { useDebouncedState as R } from "@react-hookz/web";
|
|
8
|
-
import { Loader as
|
|
8
|
+
import { Loader as W } from "lucide-react";
|
|
9
9
|
import "./_commonjsHelpers-UyOWmZb0.js";
|
|
10
10
|
import "./Functions-7jnEwJyw.js";
|
|
11
11
|
import "clsx";
|
|
@@ -13,10 +13,10 @@ import "tailwind-merge";
|
|
|
13
13
|
import "@chaibuilder/runtime";
|
|
14
14
|
import "jotai";
|
|
15
15
|
import "flat-to-nested";
|
|
16
|
-
import "./MODIFIERS-
|
|
16
|
+
import "./MODIFIERS-WQdaNvb8.js";
|
|
17
17
|
import "@radix-ui/react-toggle";
|
|
18
18
|
import "class-variance-authority";
|
|
19
|
-
import "./Class-
|
|
19
|
+
import "./Class-3k8xjeiM.js";
|
|
20
20
|
import "@radix-ui/react-switch";
|
|
21
21
|
import "@radix-ui/react-slot";
|
|
22
22
|
import "@radix-ui/react-accordion";
|
|
@@ -40,11 +40,11 @@ import "react-dom";
|
|
|
40
40
|
import "react-quill";
|
|
41
41
|
import "react-i18next";
|
|
42
42
|
const I = async (x, g) => new Promise((o, r) => {
|
|
43
|
-
|
|
43
|
+
V({ accessKey: g }).search.getPhotos(x).then((i) => {
|
|
44
44
|
o(i);
|
|
45
45
|
}).catch((i) => r(i));
|
|
46
46
|
}), De = ({ isModalView: x, onSelect: g }) => {
|
|
47
|
-
const o =
|
|
47
|
+
const o = B("unsplashAccessKey", ""), [r, j] = p([]), [i, v] = p(0), [l, A] = p(), [n, q] = p(), [z, y] = p(0), [u, T] = R("", 1e3), [f, c] = p(!1), _ = async (s) => {
|
|
48
48
|
if (d(u))
|
|
49
49
|
return;
|
|
50
50
|
let t = i + 1;
|
|
@@ -83,17 +83,17 @@ const I = async (x, g) => new Promise((o, r) => {
|
|
|
83
83
|
] }) }) : /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
84
84
|
/* @__PURE__ */ e.jsxs("form", { className: "flex items-center rounded-md border bg-gray-100 p-px", children: [
|
|
85
85
|
/* @__PURE__ */ e.jsx(
|
|
86
|
-
|
|
86
|
+
F,
|
|
87
87
|
{
|
|
88
88
|
type: "text",
|
|
89
89
|
name: "query",
|
|
90
90
|
className: "input",
|
|
91
91
|
placeholder: 'Try "dog" or "apple"',
|
|
92
|
-
onChange: (s) =>
|
|
92
|
+
onChange: (s) => T(s.target.value)
|
|
93
93
|
}
|
|
94
94
|
),
|
|
95
|
-
/* @__PURE__ */ e.jsxs(
|
|
96
|
-
/* @__PURE__ */ e.jsx(
|
|
95
|
+
/* @__PURE__ */ e.jsxs(K, { children: [
|
|
96
|
+
/* @__PURE__ */ e.jsx(U, { asChild: !0, className: "h-full w-10 cursor-pointer p-2.5 hover:bg-slate-200", children: /* @__PURE__ */ e.jsx(L, {}) }),
|
|
97
97
|
/* @__PURE__ */ e.jsx(
|
|
98
98
|
O,
|
|
99
99
|
{
|
|
@@ -173,10 +173,10 @@ const I = async (x, g) => new Promise((o, r) => {
|
|
|
173
173
|
) }) }, s.id)
|
|
174
174
|
)),
|
|
175
175
|
f && /* @__PURE__ */ e.jsxs("div", { className: "flex items-center justify-center py-8", children: [
|
|
176
|
-
/* @__PURE__ */ e.jsx(
|
|
176
|
+
/* @__PURE__ */ e.jsx(W, { className: "animate-spin w-6 h-6" }),
|
|
177
177
|
" Loading..."
|
|
178
178
|
] }),
|
|
179
|
-
!d(r) && i <
|
|
179
|
+
!d(r) && i < z && !f && /* @__PURE__ */ e.jsx(
|
|
180
180
|
H,
|
|
181
181
|
{
|
|
182
182
|
size: "sm",
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import { j as e } from "./jsx-runtime-WbnYoNE9.js";
|
|
2
|
-
import { useState as
|
|
3
|
-
import { isEmpty as
|
|
2
|
+
import { useState as i, useEffect as w } from "react";
|
|
3
|
+
import { isEmpty as b, map as j } from "lodash-es";
|
|
4
4
|
import { GearIcon as C, UploadIcon as U, Cross1Icon as k } from "@radix-ui/react-icons";
|
|
5
5
|
import { atom as F, useAtom as E } from "jotai";
|
|
6
|
-
import {
|
|
6
|
+
import { h as v, bg as A } from "./index-ZBqiaKhx.js";
|
|
7
7
|
import "./_commonjsHelpers-UyOWmZb0.js";
|
|
8
8
|
import "./Functions-7jnEwJyw.js";
|
|
9
9
|
import "clsx";
|
|
10
10
|
import "tailwind-merge";
|
|
11
11
|
import "@chaibuilder/runtime";
|
|
12
12
|
import "flat-to-nested";
|
|
13
|
-
import "./MODIFIERS-
|
|
13
|
+
import "./MODIFIERS-WQdaNvb8.js";
|
|
14
14
|
import "@react-hookz/web";
|
|
15
15
|
import "@radix-ui/react-toggle";
|
|
16
16
|
import "class-variance-authority";
|
|
17
|
-
import "./Class-
|
|
17
|
+
import "./Class-3k8xjeiM.js";
|
|
18
18
|
import "@radix-ui/react-switch";
|
|
19
19
|
import "@radix-ui/react-slot";
|
|
20
20
|
import "@radix-ui/react-accordion";
|
|
@@ -37,41 +37,45 @@ import "react-icons-picker";
|
|
|
37
37
|
import "react-dom";
|
|
38
38
|
import "react-quill";
|
|
39
39
|
import "react-i18next";
|
|
40
|
-
const R = F([]), ge = ({ isModalView: r, onSelect:
|
|
41
|
-
const
|
|
40
|
+
const R = F([]), ge = ({ isModalView: r, onSelect: a }) => {
|
|
41
|
+
const p = v("uploadMediaCallback"), n = v("fetchMediaCallback"), [s, m] = E(R), [o, u] = i(!1), [x, f] = i(!1), [d, c] = i(), [h, y] = i("");
|
|
42
42
|
w(() => {
|
|
43
43
|
(async () => {
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
44
|
+
if (!n)
|
|
45
|
+
return;
|
|
46
|
+
f(!0);
|
|
47
|
+
const t = await n();
|
|
48
|
+
m(t || []), f(!1);
|
|
47
49
|
})();
|
|
48
50
|
}, []);
|
|
49
51
|
const N = (t) => {
|
|
50
|
-
var l,
|
|
51
|
-
t && ((
|
|
52
|
+
var l, g;
|
|
53
|
+
t && ((g = (l = t == null ? void 0 : t.target) == null ? void 0 : l.files) == null ? void 0 : g.length) > 0 && c(t.target.files[0]);
|
|
52
54
|
}, I = async () => {
|
|
53
|
-
p
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
55
|
+
if (p) {
|
|
56
|
+
u(!0);
|
|
57
|
+
try {
|
|
58
|
+
const { url: t } = await p(d);
|
|
59
|
+
a(t), c(void 0);
|
|
60
|
+
const l = await n();
|
|
61
|
+
m(l);
|
|
62
|
+
} catch (t) {
|
|
63
|
+
m([]), y((t == null ? void 0 : t.message) || "Something went wrong.");
|
|
64
|
+
}
|
|
65
|
+
u(!1);
|
|
61
66
|
}
|
|
62
|
-
p(!1);
|
|
63
67
|
};
|
|
64
68
|
return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
65
|
-
|
|
69
|
+
d ? /* @__PURE__ */ e.jsxs("div", { className: "relative flex w-full flex-col items-center justify-center rounded-md border bg-slate-50 p-2 px-1", children: [
|
|
66
70
|
/* @__PURE__ */ e.jsx(
|
|
67
71
|
"img",
|
|
68
72
|
{
|
|
69
|
-
src: URL.createObjectURL(
|
|
73
|
+
src: URL.createObjectURL(d),
|
|
70
74
|
alt: "",
|
|
71
|
-
className: "h-auto w-full max-w-sm rounded-md
|
|
75
|
+
className: "h-auto max-h-96 w-full max-w-sm rounded-md object-contain"
|
|
72
76
|
}
|
|
73
77
|
),
|
|
74
|
-
|
|
78
|
+
h && /* @__PURE__ */ e.jsx("div", { className: "w-full pt-2 text-center text-sm text-red-500", children: h }),
|
|
75
79
|
/* @__PURE__ */ e.jsxs("div", { className: "flex w-full items-center justify-center gap-2 pt-2", children: [
|
|
76
80
|
/* @__PURE__ */ e.jsxs(
|
|
77
81
|
"button",
|
|
@@ -92,7 +96,7 @@ const R = F([]), ge = ({ isModalView: r, onSelect: i }) => {
|
|
|
92
96
|
{
|
|
93
97
|
type: "button",
|
|
94
98
|
className: "flex items-center rounded-full border border-gray-300 px-3 py-1 text-sm hover:bg-gray-200",
|
|
95
|
-
onClick: () =>
|
|
99
|
+
onClick: () => c(void 0),
|
|
96
100
|
children: [
|
|
97
101
|
/* @__PURE__ */ e.jsx(k, {}),
|
|
98
102
|
" Cancel"
|
|
@@ -108,18 +112,18 @@ const R = F([]), ge = ({ isModalView: r, onSelect: i }) => {
|
|
|
108
112
|
/* @__PURE__ */ e.jsx("input", { type: "file", id: r ? "upload-in-modal" : "upload-in-panel", hidden: !0, onChange: N })
|
|
109
113
|
] }),
|
|
110
114
|
/* @__PURE__ */ e.jsxs(A, { className: `-mx-2 flex h-full flex-col pb-8 pt-2 ${r ? "px-2" : ""} pt-2`, children: [
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
r ? /* @__PURE__ */ e.jsx("div", { className: "h-full columns-5 py-2", children:
|
|
115
|
+
b(s) && 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: "Fetching..." }) }),
|
|
116
|
+
b(s) && !x && /* @__PURE__ */ e.jsx("div", { className: "flex flex-col items-center justify-center py-6", children: /* @__PURE__ */ e.jsx("div", { className: "font-medium", children: "No Images" }) }),
|
|
117
|
+
r ? /* @__PURE__ */ e.jsx("div", { className: "h-full columns-5 py-2", children: j(s, (t) => /* @__PURE__ */ e.jsx("div", { role: "button", tabIndex: 0, className: "my-1 flex", onClick: () => a(t.url), children: /* @__PURE__ */ e.jsx("div", { className: "relative overflow-hidden rounded-md bg-cover bg-no-repeat", children: /* @__PURE__ */ e.jsx(
|
|
114
118
|
"img",
|
|
115
119
|
{
|
|
116
120
|
className: "h-auto flex-1 cursor-pointer rounded-md transition duration-300 ease-in-out hover:scale-105",
|
|
117
121
|
alt: t.name,
|
|
118
122
|
src: t.thumbUrl
|
|
119
123
|
}
|
|
120
|
-
) }) }, t.id)) }) :
|
|
124
|
+
) }) }, t.id)) }) : j(s, (t) => (
|
|
121
125
|
// TODO: Drag and Drop Image to Canvas from Here use `pic.url` for image quality
|
|
122
|
-
/* @__PURE__ */ e.jsx("div", { role: "button", tabIndex: 0, className: "px-2 py-1", onClick: () =>
|
|
126
|
+
/* @__PURE__ */ e.jsx("div", { role: "button", tabIndex: 0, className: "px-2 py-1", onClick: () => a(t.url), children: /* @__PURE__ */ e.jsx("div", { className: "relative overflow-hidden rounded-md bg-cover bg-no-repeat", children: /* @__PURE__ */ e.jsx(
|
|
123
127
|
"img",
|
|
124
128
|
{
|
|
125
129
|
className: "h-auto w-full cursor-pointer transition duration-300 ease-in-out hover:scale-105",
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-Z_BpKhVy.cjs"),s=require("react"),l=require("lodash-es"),m=require("@radix-ui/react-icons"),E=require("jotai"),p=require("./index-T3wfa1kz.cjs");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("./Functions-N3yhPYKY.cjs");require("clsx");require("tailwind-merge");require("@chaibuilder/runtime");require("flat-to-nested");require("./MODIFIERS-9EwxLM8V.cjs");require("@react-hookz/web");require("@radix-ui/react-toggle");require("class-variance-authority");require("./Class-MmCxz2Ay.cjs");require("@radix-ui/react-switch");require("@radix-ui/react-slot");require("@radix-ui/react-accordion");require("@radix-ui/react-alert-dialog");require("@radix-ui/react-dialog");require("@radix-ui/react-label");require("@radix-ui/react-scroll-area");require("@radix-ui/react-tabs");require("@radix-ui/react-tooltip");require("@radix-ui/react-popover");require("@radix-ui/react-menubar");require("@radix-ui/react-hover-card");require("@radix-ui/react-select");require("@radix-ui/react-dropdown-menu");require("@radix-ui/react-separator");require("@radix-ui/react-toast");require("cmdk");require("@radix-ui/react-context-menu");require("react-icons-picker");require("react-dom");require("react-quill");require("react-i18next");const N=E.atom([]),I=({isModalView:t,onSelect:a})=>{const j=p.useBuilderProp("uploadMediaCallback"),u=p.useBuilderProp("fetchMediaCallback"),[i,x]=E.useAtom(N),[n,f]=s.useState(!1),[h,g]=s.useState(!1),[c,d]=s.useState(),[b,R]=s.useState("");s.useEffect(()=>{(async()=>{if(!u)return;g(!0);const r=await u();x(r||[]),g(!1)})()},[]);const v=r=>{var o,q;r&&((q=(o=r==null?void 0:r.target)==null?void 0:o.files)==null?void 0:q.length)>0&&d(r.target.files[0])},y=async()=>{if(j){f(!0);try{const{url:r}=await j(c);a(r),d(void 0);const o=await u();x(o)}catch(r){x([]),R((r==null?void 0:r.message)||"Something went wrong.")}f(!1)}};return e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[c?e.jsxRuntimeExports.jsxs("div",{className:"relative flex w-full flex-col items-center justify-center rounded-md border bg-slate-50 p-2 px-1",children:[e.jsxRuntimeExports.jsx("img",{src:URL.createObjectURL(c),alt:"",className:"h-auto max-h-96 w-full max-w-sm rounded-md object-contain"}),b&&e.jsxRuntimeExports.jsx("div",{className:"w-full pt-2 text-center text-sm text-red-500",children:b}),e.jsxRuntimeExports.jsxs("div",{className:"flex w-full items-center justify-center gap-2 pt-2",children:[e.jsxRuntimeExports.jsxs("button",{type:"button",onClick:y,disabled:n,className:"flex items-center rounded-full bg-blue-500 px-3 py-1 text-sm text-white hover:bg-blue-600 hover:text-white",children:[n?e.jsxRuntimeExports.jsx(m.GearIcon,{className:"animate-spin"}):e.jsxRuntimeExports.jsx(m.UploadIcon,{className:"animate-bounce"})," ",n?"Uploading...":"Upload"]}),!n&&e.jsxRuntimeExports.jsxs("button",{type:"button",className:"flex items-center rounded-full border border-gray-300 px-3 py-1 text-sm hover:bg-gray-200",onClick:()=>d(void 0),children:[e.jsxRuntimeExports.jsx(m.Cross1Icon,{})," Cancel"]})]})]}):e.jsxRuntimeExports.jsxs("label",{htmlFor:t?"upload-in-modal":"upload-in-panel",children:[e.jsxRuntimeExports.jsxs("div",{className:"flex w-full cursor-pointer flex-col items-center justify-center rounded-md border border-dashed border-blue-900 bg-gray-200 py-8 hover:bg-blue-50",children:[e.jsxRuntimeExports.jsx("div",{className:"text-3xl",children:"+"}),e.jsxRuntimeExports.jsx("div",{children:"Click to choose file"})]}),e.jsxRuntimeExports.jsx("input",{type:"file",id:t?"upload-in-modal":"upload-in-panel",hidden:!0,onChange:v})]}),e.jsxRuntimeExports.jsxs(p.ScrollArea,{className:`-mx-2 flex h-full flex-col pb-8 pt-2 ${t?"px-2":""} pt-2`,children:[l.isEmpty(i)&&h&&e.jsxRuntimeExports.jsx("div",{className:"flex flex-col items-center justify-center py-6",children:e.jsxRuntimeExports.jsx("div",{className:"animate-pulse font-medium",children:"Fetching..."})}),l.isEmpty(i)&&!h&&e.jsxRuntimeExports.jsx("div",{className:"flex flex-col items-center justify-center py-6",children:e.jsxRuntimeExports.jsx("div",{className:"font-medium",children:"No Images"})}),t?e.jsxRuntimeExports.jsx("div",{className:"h-full columns-5 py-2",children:l.map(i,r=>e.jsxRuntimeExports.jsx("div",{role:"button",tabIndex:0,className:"my-1 flex",onClick:()=>a(r.url),children:e.jsxRuntimeExports.jsx("div",{className:"relative overflow-hidden rounded-md bg-cover bg-no-repeat",children:e.jsxRuntimeExports.jsx("img",{className:"h-auto flex-1 cursor-pointer rounded-md transition duration-300 ease-in-out hover:scale-105",alt:r.name,src:r.thumbUrl})})},r.id))}):l.map(i,r=>e.jsxRuntimeExports.jsx("div",{role:"button",tabIndex:0,className:"px-2 py-1",onClick:()=>a(r.url),children:e.jsxRuntimeExports.jsx("div",{className:"relative overflow-hidden rounded-md bg-cover bg-no-repeat",children:e.jsxRuntimeExports.jsx("img",{className:"h-auto w-full cursor-pointer transition duration-300 ease-in-out hover:scale-105",alt:r.name,src:r.url})})},r.id))]})]})};exports.default=I;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { j as t } from "./jsx-runtime-WbnYoNE9.js";
|
|
2
2
|
import { useState as c } from "react";
|
|
3
3
|
import { kebabCase as j } from "lodash-es";
|
|
4
|
-
import { ae as
|
|
5
|
-
import { u as g } from "./
|
|
6
|
-
import { F as D } from "./form-
|
|
7
|
-
import {
|
|
4
|
+
import { ae as C, B as u, ad as b, ao as A } from "./index-ZBqiaKhx.js";
|
|
5
|
+
import { u as g } from "./controls-XPXGHKht.js";
|
|
6
|
+
import { F as D } from "./form-2xJcQs_Y.js";
|
|
7
|
+
import { e as N } from "./index-627XtO9e.js";
|
|
8
8
|
import "./_commonjsHelpers-UyOWmZb0.js";
|
|
9
9
|
import "./Functions-7jnEwJyw.js";
|
|
10
10
|
import "clsx";
|
|
@@ -12,11 +12,11 @@ import "tailwind-merge";
|
|
|
12
12
|
import "@chaibuilder/runtime";
|
|
13
13
|
import "jotai";
|
|
14
14
|
import "flat-to-nested";
|
|
15
|
-
import "./MODIFIERS-
|
|
15
|
+
import "./MODIFIERS-WQdaNvb8.js";
|
|
16
16
|
import "@react-hookz/web";
|
|
17
17
|
import "@radix-ui/react-toggle";
|
|
18
18
|
import "class-variance-authority";
|
|
19
|
-
import "./Class-
|
|
19
|
+
import "./Class-3k8xjeiM.js";
|
|
20
20
|
import "@radix-ui/react-switch";
|
|
21
21
|
import "@radix-ui/react-slot";
|
|
22
22
|
import "@radix-ui/react-accordion";
|
|
@@ -42,6 +42,7 @@ import "react-quill";
|
|
|
42
42
|
import "react-i18next";
|
|
43
43
|
import "@rjsf/core";
|
|
44
44
|
import "@rjsf/validator-ajv8";
|
|
45
|
+
import "./index-LF3KXx4u.js";
|
|
45
46
|
import "i18next";
|
|
46
47
|
import "@floating-ui/react-dom";
|
|
47
48
|
import "react-textarea-autosize";
|
|
@@ -50,10 +51,10 @@ import "react-dnd";
|
|
|
50
51
|
import "@minoru/react-dnd-treeview";
|
|
51
52
|
import "react-hotkeys-hook";
|
|
52
53
|
import "sonner";
|
|
53
|
-
import "./html-to-json-
|
|
54
|
+
import "./html-to-json-C5sExaSD.js";
|
|
54
55
|
import "himalaya";
|
|
55
56
|
import "lucide-react";
|
|
56
|
-
import "./
|
|
57
|
+
import "./index-YpnaudSM.js";
|
|
57
58
|
const S = ({ closeModal: e }) => {
|
|
58
59
|
var a, s;
|
|
59
60
|
const i = N(), [o, f] = c({
|
|
@@ -81,7 +82,7 @@ const S = ({ closeModal: e }) => {
|
|
|
81
82
|
}),
|
|
82
83
|
slug: g({ title: "Page Slug", default: o.slug })
|
|
83
84
|
};
|
|
84
|
-
return /* @__PURE__ */ t.jsxs(
|
|
85
|
+
return /* @__PURE__ */ t.jsxs(C, { children: [
|
|
85
86
|
/* @__PURE__ */ t.jsx("div", { className: "px-1 font-bold", children: "Add Page" }),
|
|
86
87
|
/* @__PURE__ */ t.jsx(D, { formData: o, properties: P, onChange: h, disabled: i.isPending }),
|
|
87
88
|
/* @__PURE__ */ t.jsx("div", { className: "flex items-center justify-end", children: /* @__PURE__ */ t.jsx(
|
|
@@ -94,13 +95,13 @@ const S = ({ closeModal: e }) => {
|
|
|
94
95
|
}
|
|
95
96
|
) })
|
|
96
97
|
] });
|
|
97
|
-
},
|
|
98
|
+
}, _t = () => {
|
|
98
99
|
const [e, i] = c(!1);
|
|
99
|
-
return /* @__PURE__ */ t.jsxs(
|
|
100
|
+
return /* @__PURE__ */ t.jsxs(b, { open: e, onOpenChange: () => i(!e), children: [
|
|
100
101
|
/* @__PURE__ */ t.jsx(A, { asChild: !0, children: /* @__PURE__ */ t.jsx(u, { size: "sm", variant: "link", className: "text-blue-500", onClick: () => i(!e), children: "+ New Page" }) }),
|
|
101
102
|
e && /* @__PURE__ */ t.jsx(S, { closeModal: () => i(!e) })
|
|
102
103
|
] });
|
|
103
104
|
};
|
|
104
105
|
export {
|
|
105
|
-
|
|
106
|
+
_t as default
|
|
106
107
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-Z_BpKhVy.cjs"),x=require("react"),P=require("lodash-es"),t=require("./index-T3wfa1kz.cjs"),g=require("./controls-Dy1qa8Dc.cjs"),R=require("./form-Y0Vb4m04.cjs"),f=require("./index-3TQsdso6.cjs");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("./Functions-N3yhPYKY.cjs");require("clsx");require("tailwind-merge");require("@chaibuilder/runtime");require("jotai");require("flat-to-nested");require("./MODIFIERS-9EwxLM8V.cjs");require("@react-hookz/web");require("@radix-ui/react-toggle");require("class-variance-authority");require("./Class-MmCxz2Ay.cjs");require("@radix-ui/react-switch");require("@radix-ui/react-slot");require("@radix-ui/react-accordion");require("@radix-ui/react-icons");require("@radix-ui/react-alert-dialog");require("@radix-ui/react-dialog");require("@radix-ui/react-label");require("@radix-ui/react-scroll-area");require("@radix-ui/react-tabs");require("@radix-ui/react-tooltip");require("@radix-ui/react-popover");require("@radix-ui/react-menubar");require("@radix-ui/react-hover-card");require("@radix-ui/react-select");require("@radix-ui/react-dropdown-menu");require("@radix-ui/react-separator");require("@radix-ui/react-toast");require("cmdk");require("@radix-ui/react-context-menu");require("react-icons-picker");require("react-dom");require("react-quill");require("react-i18next");require("@rjsf/core");require("@rjsf/validator-ajv8");require("./index-ZwpjuB-N.cjs");require("i18next");require("@floating-ui/react-dom");require("react-textarea-autosize");require("flagged");require("react-dnd");require("@minoru/react-dnd-treeview");require("react-hotkeys-hook");require("sonner");require("./html-to-json-FGufPv9R.cjs");require("himalaya");require("lucide-react");require("./index-ecnGWzh9.cjs");const b=({closeModal:i})=>{var l,q;const u=f.useAddPage(),[r,m]=x.useState({name:"",slug:"",blocks:[],type:"STATIC",seoData:{},template:""}),p=()=>{u.mutate(r,{onSuccess:()=>i()})},j=({formData:n},s)=>{m(o=>{var d,c;const a={[s]:n[s]};return s==="name"?a.slug=P.kebabCase((d=n[s])==null?void 0:d.replace(/\d/g,"")):s==="slug"&&(a.slug=(c=n[s])==null?void 0:c.replace(/\d/g,"").replace(/\s+/g,"").replace("--","-").replace("__","_")),{...o,...a}})},h={name:g.u({title:"Page Name",default:r.name}),slug:g.u({title:"Page Slug",default:r.slug})};return e.jsxRuntimeExports.jsxs(t.DialogContent,{children:[e.jsxRuntimeExports.jsx("div",{className:"px-1 font-bold",children:"Add Page"}),e.jsxRuntimeExports.jsx(R.Form,{formData:r,properties:h,onChange:j,disabled:u.isPending}),e.jsxRuntimeExports.jsx("div",{className:"flex items-center justify-end",children:e.jsxRuntimeExports.jsx(t.Button,{type:"submit",disabled:!r.name||!r.slug||((l=r.name)==null?void 0:l.length)<2||((q=r.slug)==null?void 0:q.length)<2||u.isPending,onClick:p,children:"Add Page"})})]})},E=()=>{const[i,u]=x.useState(!1);return e.jsxRuntimeExports.jsxs(t.Dialog,{open:i,onOpenChange:()=>u(!i),children:[e.jsxRuntimeExports.jsx(t.DialogTrigger,{asChild:!0,children:e.jsxRuntimeExports.jsx(t.Button,{size:"sm",variant:"link",className:"text-blue-500",onClick:()=>u(!i),children:"+ New Page"})}),i&&e.jsxRuntimeExports.jsx(b,{closeModal:()=>u(!i)})]})};exports.default=E;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { j as i } from "./jsx-runtime-WbnYoNE9.js";
|
|
2
|
-
import { A as a,
|
|
2
|
+
import { A as a, b as n, d as c, e as x, g as d, B as j } from "./index-ZBqiaKhx.js";
|
|
3
3
|
import "./_commonjsHelpers-UyOWmZb0.js";
|
|
4
4
|
import "react";
|
|
5
5
|
import "lodash-es";
|
|
@@ -9,11 +9,11 @@ import "tailwind-merge";
|
|
|
9
9
|
import "@chaibuilder/runtime";
|
|
10
10
|
import "jotai";
|
|
11
11
|
import "flat-to-nested";
|
|
12
|
-
import "./MODIFIERS-
|
|
12
|
+
import "./MODIFIERS-WQdaNvb8.js";
|
|
13
13
|
import "@react-hookz/web";
|
|
14
14
|
import "@radix-ui/react-toggle";
|
|
15
15
|
import "class-variance-authority";
|
|
16
|
-
import "./Class-
|
|
16
|
+
import "./Class-3k8xjeiM.js";
|
|
17
17
|
import "@radix-ui/react-switch";
|
|
18
18
|
import "@radix-ui/react-slot";
|
|
19
19
|
import "@radix-ui/react-accordion";
|
|
@@ -51,8 +51,8 @@ const ii = ({
|
|
|
51
51
|
/* @__PURE__ */ i.jsx(c, { children: e }),
|
|
52
52
|
r && /* @__PURE__ */ i.jsx(x, { children: r }),
|
|
53
53
|
/* @__PURE__ */ i.jsxs("div", { className: "flex items-center justify-end gap-x-3", children: [
|
|
54
|
-
/* @__PURE__ */ i.jsx(
|
|
55
|
-
/* @__PURE__ */ i.jsx(
|
|
54
|
+
/* @__PURE__ */ i.jsx(d, { disabled: t, onClick: m, children: l }),
|
|
55
|
+
/* @__PURE__ */ i.jsx(j, { variant: "default", onClick: p, disabled: t, children: s })
|
|
56
56
|
] })
|
|
57
57
|
] }) });
|
|
58
58
|
export {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-Z_BpKhVy.cjs"),r=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-Z_BpKhVy.cjs"),r=require("./index-T3wfa1kz.cjs");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("react");require("lodash-es");require("./Functions-N3yhPYKY.cjs");require("clsx");require("tailwind-merge");require("@chaibuilder/runtime");require("jotai");require("flat-to-nested");require("./MODIFIERS-9EwxLM8V.cjs");require("@react-hookz/web");require("@radix-ui/react-toggle");require("class-variance-authority");require("./Class-MmCxz2Ay.cjs");require("@radix-ui/react-switch");require("@radix-ui/react-slot");require("@radix-ui/react-accordion");require("@radix-ui/react-icons");require("@radix-ui/react-alert-dialog");require("@radix-ui/react-dialog");require("@radix-ui/react-label");require("@radix-ui/react-scroll-area");require("@radix-ui/react-tabs");require("@radix-ui/react-tooltip");require("@radix-ui/react-popover");require("@radix-ui/react-menubar");require("@radix-ui/react-hover-card");require("@radix-ui/react-select");require("@radix-ui/react-dropdown-menu");require("@radix-ui/react-separator");require("@radix-ui/react-toast");require("cmdk");require("@radix-ui/react-context-menu");require("react-icons-picker");require("react-dom");require("react-quill");require("react-i18next");const x=({open:t,onCancel:q=()=>{},onConfirm:s,title:n,description:i,disabled:u,cancelText:l="Discard",confirmText:o="Save"})=>e.jsxRuntimeExports.jsx(r.AlertDialog,{open:t,children:e.jsxRuntimeExports.jsxs(r.AlertDialogContent,{children:[e.jsxRuntimeExports.jsx(r.AlertDialogTitle,{children:n}),i&&e.jsxRuntimeExports.jsx(r.AlertDialogDescription,{children:i}),e.jsxRuntimeExports.jsxs("div",{className:"flex items-center justify-end gap-x-3",children:[e.jsxRuntimeExports.jsx(r.AlertDialogCancel,{disabled:u,onClick:q,children:l}),e.jsxRuntimeExports.jsx(r.Button,{variant:"default",onClick:s,disabled:u,children:o})]})]})});exports.default=x;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const t=require("lodash-es"),n="#styles:";const a=i=>({type:"singular",default:i.default||"",binding:t.get(i,"binding",!0),i18n:i.i18n||!1,dataType:"string",required:i.required||!1,schema:{type:"string",...t.omit(i,["i18n","required"])},uiSchema:{"ui:placeholder":i.placeholder||"Enter here"}}),d=i=>({type:"singular",default:i.default||"",binding:t.get(i,"binding",!0),dataType:"string",i18n:i.i18n||!1,required:i.required||!1,schema:{type:"string",...t.omit(i,["i18n","required","rows"])},uiSchema:{"ui:widget":"textarea","ui:placeholder":i.placeholder||"Enter here","ui:options":{rows:i.rows||4}}}),r=i=>({type:"singular",i18n:i.i18n||!1,default:i.default||!1,dataType:"boolean",binding:t.get(i,"binding",!0),schema:{type:"boolean",...t.omit(i,["i18n","required"])},uiSchema:{"ui:title":i.title||"Select Item","ui:description":""}}),u=i=>({type:"singular",default:i.default||"",binding:t.get(i,"binding",!0),dataType:"number",i18n:i.i18n||!1,required:i.required||!1,schema:{type:"number",...t.omit(i,["i18n","required"])},uiSchema:{}}),g=i=>({type:"singular",default:i.default||"",binding:t.get(i,"binding",!0),i18n:i.i18n||!1,required:i.required||!1,dataType:"string",schema:{type:"string",...t.omit(i,["i18n","required","options","binding"]),oneOf:i.options.map(e=>({const:e.value,title:e.title}))},uiSchema:{"ui:widget":"select"}}),l=i=>({type:"singular",i18n:i.i18n||!1,default:i.default||"",binding:t.get(i,"binding",!0),dataType:"string",schema:{type:"string",...t.omit(i,["i18n","required"])},uiSchema:{"ui:widget":"color"}});const s=i=>({type:"singular",default:i.default||"",i18n:i.i18n||!1,binding:t.get(i,"binding",!0),dataType:"string",schema:{type:"string",...t.omit(i,["i18n","required"])},uiSchema:{"ui:widget":"richtext"}}),p=i=>({type:"model",title:i.title,dataType:"object",default:i.default||{},binding:t.get(i,"binding",!0),properties:i.properties}),y=i=>({type:"list",itemProperties:i.itemProperties,binding:t.get(i,"binding",!0),title:i.title,dataType:"array",default:i.default||[],itemTitle:i.getItemLabel?i.getItemLabel({}):()=>""}),o=i=>({type:"styles",binding:!1,default:`${n},${i.default||""}`}),m=i=>({default:i.default||"",binding:t.get(i,"binding",!0),type:"singular",i18n:i.i18n||!1,dataType:"string",schema:{type:"string",title:"Icon",default:i.default||""},uiSchema:{"ui:widget":"icon"}}),c=i=>({default:i.default,type:"singular",binding:t.get(i,"binding",!0),dataType:"object",i18n:i.i18n||!1,schema:{type:"object",...i||{},properties:{type:{type:"string"},href:{type:"string"},target:{type:"string"}}},uiSchema:{"ui:field":"link"}}),b=i=>({type:"singular",default:i.default||"",binding:t.get(i,"binding",!0),dataType:"string",i18n:i.i18n||!1,schema:{type:"string",...t.omit(i,["i18n","required"])},uiSchema:{"ui:widget":"image"}});exports.S=o;exports.T=m;exports.b=p;exports.c=u;exports.f=g;exports.g=d;exports.h=y;exports.m=s;exports.o=b;exports.q=c;exports.r=r;exports.u=a;exports.y=l;
|
|
@@ -1,31 +1,29 @@
|
|
|
1
|
-
import { get as
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const u = "#styles:";
|
|
5
|
-
const o = (i) => ({
|
|
1
|
+
import { get as t, omit as e } from "lodash-es";
|
|
2
|
+
const a = "#styles:";
|
|
3
|
+
const r = (i) => ({
|
|
6
4
|
type: "singular",
|
|
7
5
|
default: i.default || "",
|
|
8
|
-
binding:
|
|
6
|
+
binding: t(i, "binding", !0),
|
|
9
7
|
i18n: i.i18n || !1,
|
|
10
8
|
dataType: "string",
|
|
11
9
|
required: i.required || !1,
|
|
12
10
|
schema: {
|
|
13
11
|
type: "string",
|
|
14
|
-
...
|
|
12
|
+
...e(i, ["i18n", "required"])
|
|
15
13
|
},
|
|
16
14
|
uiSchema: {
|
|
17
15
|
"ui:placeholder": i.placeholder || "Enter here"
|
|
18
16
|
}
|
|
19
|
-
}),
|
|
17
|
+
}), u = (i) => ({
|
|
20
18
|
type: "singular",
|
|
21
19
|
default: i.default || "",
|
|
22
|
-
binding:
|
|
20
|
+
binding: t(i, "binding", !0),
|
|
23
21
|
dataType: "string",
|
|
24
22
|
i18n: i.i18n || !1,
|
|
25
23
|
required: i.required || !1,
|
|
26
24
|
schema: {
|
|
27
25
|
type: "string",
|
|
28
|
-
...
|
|
26
|
+
...e(i, ["i18n", "required", "rows"])
|
|
29
27
|
},
|
|
30
28
|
uiSchema: {
|
|
31
29
|
"ui:widget": "textarea",
|
|
@@ -34,96 +32,96 @@ const o = (i) => ({
|
|
|
34
32
|
rows: i.rows || 4
|
|
35
33
|
}
|
|
36
34
|
}
|
|
37
|
-
}),
|
|
35
|
+
}), l = (i) => ({
|
|
38
36
|
type: "singular",
|
|
39
37
|
i18n: i.i18n || !1,
|
|
40
38
|
default: i.default || !1,
|
|
41
39
|
dataType: "boolean",
|
|
42
|
-
binding:
|
|
40
|
+
binding: t(i, "binding", !0),
|
|
43
41
|
schema: {
|
|
44
42
|
type: "boolean",
|
|
45
|
-
...
|
|
43
|
+
...e(i, ["i18n", "required"])
|
|
46
44
|
},
|
|
47
45
|
uiSchema: {
|
|
48
46
|
"ui:title": i.title || "Select Item",
|
|
49
47
|
"ui:description": ""
|
|
50
48
|
}
|
|
51
|
-
}),
|
|
49
|
+
}), g = (i) => ({
|
|
52
50
|
type: "singular",
|
|
53
51
|
default: i.default || "",
|
|
54
|
-
binding:
|
|
52
|
+
binding: t(i, "binding", !0),
|
|
55
53
|
dataType: "number",
|
|
56
54
|
i18n: i.i18n || !1,
|
|
57
55
|
required: i.required || !1,
|
|
58
56
|
schema: {
|
|
59
57
|
type: "number",
|
|
60
|
-
...
|
|
58
|
+
...e(i, ["i18n", "required"])
|
|
61
59
|
},
|
|
62
60
|
uiSchema: {}
|
|
63
|
-
}),
|
|
61
|
+
}), s = (i) => ({
|
|
64
62
|
type: "singular",
|
|
65
63
|
default: i.default || "",
|
|
66
|
-
binding:
|
|
64
|
+
binding: t(i, "binding", !0),
|
|
67
65
|
i18n: i.i18n || !1,
|
|
68
66
|
required: i.required || !1,
|
|
69
67
|
dataType: "string",
|
|
70
68
|
schema: {
|
|
71
69
|
type: "string",
|
|
72
|
-
...
|
|
70
|
+
...e(i, ["i18n", "required", "options", "binding"]),
|
|
73
71
|
oneOf: i.options.map((n) => ({ const: n.value, title: n.title }))
|
|
74
72
|
},
|
|
75
73
|
uiSchema: {
|
|
76
74
|
"ui:widget": "select"
|
|
77
75
|
}
|
|
78
|
-
}),
|
|
76
|
+
}), p = (i) => ({
|
|
79
77
|
type: "singular",
|
|
80
78
|
i18n: i.i18n || !1,
|
|
81
79
|
default: i.default || "",
|
|
82
|
-
binding:
|
|
80
|
+
binding: t(i, "binding", !0),
|
|
83
81
|
dataType: "string",
|
|
84
82
|
schema: {
|
|
85
83
|
type: "string",
|
|
86
|
-
...
|
|
84
|
+
...e(i, ["i18n", "required"])
|
|
87
85
|
},
|
|
88
86
|
uiSchema: {
|
|
89
87
|
"ui:widget": "color"
|
|
90
88
|
}
|
|
91
89
|
});
|
|
92
|
-
const
|
|
90
|
+
const y = (i) => ({
|
|
93
91
|
type: "singular",
|
|
94
92
|
default: i.default || "",
|
|
95
93
|
i18n: i.i18n || !1,
|
|
96
|
-
binding:
|
|
94
|
+
binding: t(i, "binding", !0),
|
|
97
95
|
dataType: "string",
|
|
98
96
|
schema: {
|
|
99
97
|
type: "string",
|
|
100
|
-
...
|
|
98
|
+
...e(i, ["i18n", "required"])
|
|
101
99
|
},
|
|
102
100
|
uiSchema: {
|
|
103
101
|
"ui:widget": "richtext"
|
|
104
102
|
}
|
|
105
|
-
}),
|
|
103
|
+
}), m = (i) => ({
|
|
106
104
|
type: "model",
|
|
107
105
|
title: i.title,
|
|
108
106
|
dataType: "object",
|
|
109
107
|
default: i.default || {},
|
|
110
|
-
binding:
|
|
108
|
+
binding: t(i, "binding", !0),
|
|
111
109
|
properties: i.properties
|
|
112
|
-
}),
|
|
110
|
+
}), o = (i) => ({
|
|
113
111
|
type: "list",
|
|
114
112
|
itemProperties: i.itemProperties,
|
|
115
|
-
binding:
|
|
113
|
+
binding: t(i, "binding", !0),
|
|
116
114
|
title: i.title,
|
|
117
115
|
dataType: "array",
|
|
118
116
|
default: i.default || [],
|
|
119
117
|
itemTitle: i.getItemLabel ? i.getItemLabel({}) : () => ""
|
|
120
|
-
}),
|
|
118
|
+
}), c = (i) => ({
|
|
121
119
|
type: "styles",
|
|
122
120
|
binding: !1,
|
|
123
|
-
default: `${
|
|
124
|
-
}),
|
|
121
|
+
default: `${a},${i.default || ""}`
|
|
122
|
+
}), b = (i) => ({
|
|
125
123
|
default: i.default || "",
|
|
126
|
-
binding:
|
|
124
|
+
binding: t(i, "binding", !0),
|
|
127
125
|
type: "singular",
|
|
128
126
|
i18n: i.i18n || !1,
|
|
129
127
|
dataType: "string",
|
|
@@ -135,10 +133,10 @@ const h = (i) => ({
|
|
|
135
133
|
uiSchema: {
|
|
136
134
|
"ui:widget": "icon"
|
|
137
135
|
}
|
|
138
|
-
}),
|
|
136
|
+
}), f = (i) => ({
|
|
139
137
|
default: i.default,
|
|
140
138
|
type: "singular",
|
|
141
|
-
binding:
|
|
139
|
+
binding: t(i, "binding", !0),
|
|
142
140
|
dataType: "object",
|
|
143
141
|
i18n: i.i18n || !1,
|
|
144
142
|
schema: {
|
|
@@ -153,41 +151,32 @@ const h = (i) => ({
|
|
|
153
151
|
uiSchema: {
|
|
154
152
|
"ui:field": "link"
|
|
155
153
|
}
|
|
156
|
-
}),
|
|
154
|
+
}), h = (i) => ({
|
|
157
155
|
type: "singular",
|
|
158
156
|
default: i.default || "",
|
|
159
|
-
binding:
|
|
157
|
+
binding: t(i, "binding", !0),
|
|
160
158
|
dataType: "string",
|
|
161
159
|
i18n: i.i18n || !1,
|
|
162
160
|
schema: {
|
|
163
161
|
type: "string",
|
|
164
|
-
...
|
|
162
|
+
...e(i, ["i18n", "required"])
|
|
165
163
|
},
|
|
166
164
|
uiSchema: {
|
|
167
165
|
"ui:widget": "image"
|
|
168
166
|
}
|
|
169
|
-
})
|
|
170
|
-
"div",
|
|
171
|
-
{
|
|
172
|
-
...i,
|
|
173
|
-
className: l("flex h-20 flex-col items-center justify-center", n),
|
|
174
|
-
...t(r, ["className"]),
|
|
175
|
-
children: /* @__PURE__ */ a.jsx("div", { className: "flex h-full w-full items-center justify-center outline-dashed outline-1 -outline-offset-1 outline-gray-400 duration-300", children: /* @__PURE__ */ a.jsx("span", { className: "opacit flex items-center gap-x-1.5 text-xs font-semibold text-gray-400" }) })
|
|
176
|
-
}
|
|
177
|
-
) : null;
|
|
167
|
+
});
|
|
178
168
|
export {
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
h as
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
b as y
|
|
169
|
+
c as S,
|
|
170
|
+
b as T,
|
|
171
|
+
m as b,
|
|
172
|
+
g as c,
|
|
173
|
+
s as f,
|
|
174
|
+
u as g,
|
|
175
|
+
o as h,
|
|
176
|
+
y as m,
|
|
177
|
+
h as o,
|
|
178
|
+
f as q,
|
|
179
|
+
l as r,
|
|
180
|
+
r as u,
|
|
181
|
+
p as y
|
|
193
182
|
};
|
package/dist/core.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("./index-ZwpjuB-N.cjs"),e=require("./index-T3wfa1kz.cjs"),r=require("react-i18next");require("i18next");require("./jsx-runtime-Z_BpKhVy.cjs");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("react");require("clsx");require("react-dom");require("@radix-ui/react-scroll-area");require("@floating-ui/react-dom");require("react-textarea-autosize");require("jotai");require("flagged");require("react-dnd");require("lodash-es");require("@minoru/react-dnd-treeview");require("./Functions-N3yhPYKY.cjs");require("tailwind-merge");require("@radix-ui/react-icons");require("react-hotkeys-hook");require("@chaibuilder/runtime");require("@react-hookz/web");require("flat-to-nested");require("./MODIFIERS-9EwxLM8V.cjs");require("@radix-ui/react-toggle");require("class-variance-authority");require("./Class-MmCxz2Ay.cjs");require("@radix-ui/react-switch");require("@radix-ui/react-slot");require("@radix-ui/react-accordion");require("@radix-ui/react-alert-dialog");require("@radix-ui/react-dialog");require("@radix-ui/react-label");require("@radix-ui/react-tabs");require("@radix-ui/react-tooltip");require("@radix-ui/react-popover");require("@radix-ui/react-menubar");require("@radix-ui/react-hover-card");require("@radix-ui/react-select");require("@radix-ui/react-dropdown-menu");require("@radix-ui/react-separator");require("@radix-ui/react-toast");require("cmdk");require("@radix-ui/react-context-menu");require("react-icons-picker");require("react-quill");exports.ChaiBuilderEditor=s.ChaiBuilderEditor;exports.useActiveModal=e.useActiveModal;exports.useActivePanel=e.useActivePanel;exports.useAddBlock=e.useAddBlock;exports.useAddBlockParent=e.useAddBlockParent;exports.useAddClassesToBlocks=e.useAddClassesToBlocks;exports.useAllBlocks=e.useAllBlocks;exports.useBlocksStore=e.useBlocksStore;exports.useBrandingOptions=e.useBrandingOptions;exports.useBuilderProp=e.useBuilderProp;exports.useBuilderReset=e.useBuilderReset;exports.useCanvasWidth=e.useCanvasWidth;exports.useCanvasZoom=e.useCanvasZoom;exports.useCopyBlockIds=e.useCopyBlockIds;exports.useCopyToClipboard=e.useCopyToClipboard;exports.useCurrentPage=e.useCurrentPage;exports.useCutBlockIds=e.useCutBlockIds;exports.useDarkMode=e.useDarkMode;exports.useDuplicateBlocks=e.useDuplicateBlocks;exports.useGetPageData=e.useGetPageData;exports.useHiddenBlockIds=e.useHiddenBlockIds;exports.useHighlightBlockId=e.useHighlightBlockId;exports.usePasteBlocks=e.usePasteBlocks;exports.usePreviewMode=e.usePreviewMode;exports.useReadOnlyMode=e.useReadOnlyMode;exports.useRemoveBlocks=e.useRemoveBlocks;exports.useRemoveClassesFromBlocks=e.useRemoveClassesFromBlocks;exports.useSavePage=e.useSavePage;exports.useSelectedBlock=e.useSelectedBlock;exports.useSelectedBlockAllClasses=e.useSelectedBlockAllClasses;exports.useSelectedBlockCurrentClasses=e.useSelectedBlockCurrentClasses;exports.useSelectedBlockIds=e.useSelectedBlockIds;exports.useSelectedBlocksDisplayChild=e.useSelectedBlocksDisplayChild;exports.useSelectedBreakpoints=e.useSelectedBreakpoints;exports.useSelectedStylingBlocks=e.useSelectedStylingBlocks;exports.useStylingBreakpoint=e.useStylingBreakpoint;exports.useStylingState=e.useStylingState;exports.useUILibraryBlocks=e.useUILibraryBlocks;exports.useUndoManager=e.useUndoManager;exports.useUpdateBlocksProps=e.useUpdateBlocksProps;exports.useUpdateBlocksPropsRealtime=e.useUpdateBlocksPropsRealtime;Object.defineProperty(exports,"useTranslation",{enumerable:!0,get:()=>r.useTranslation});
|