@chaibuilder/sdk 1.2.8 → 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 +725 -766
- 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-EfZgx-gN.js +0 -1425
- package/dist/CanvasArea-rIDwPHl5.cjs +0 -60
- package/dist/CurrentPage-QNFPD078.cjs +0 -1
- package/dist/CurrentPage-ulHTz4MD.js +0 -111
- package/dist/Functions-7jnEwJyw.js +0 -15
- package/dist/Functions-N3yhPYKY.cjs +0 -1
- package/dist/Layers-rehZkz78.js +0 -404
- package/dist/Layers-v-7k3W2I.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-acGVGJf-.js +0 -69
- package/dist/PagesPanel-x5ms_LOD.cjs +0 -1
- package/dist/ProjectPanel-5BHQ5ANP.cjs +0 -1
- package/dist/ProjectPanel-aLFJq49M.js +0 -90
- package/dist/Settings-iOjfw5NQ.cjs +0 -1
- package/dist/Settings-v-txwlII.js +0 -2193
- package/dist/SidePanels-Vdc-J5wK.js +0 -349
- package/dist/SidePanels-t0g9ZQFT.cjs +0 -1
- 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-0YAI9dXr.cjs +0 -1
- package/dist/add-page-modal-6DlGzdA4.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-T_rlQfNd.js +0 -88
- package/dist/delete-page-modal-qXpi_2xR.cjs +0 -1
- 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-EGUphg4R.js +0 -41620
- package/dist/index-H6vIwGfD.cjs +0 -1
- package/dist/index-e0c8PmRQ.js +0 -205
- package/dist/index-gi1LIOCw.cjs +0 -1
- package/dist/index-jw8RxsTv.cjs +0 -206
- package/dist/index-niHREMmR.js +0 -2938
- 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-EoYYnA56.js +0 -115
- package/dist/page-viewer-Ou8vDXGV.cjs +0 -1
- package/dist/project-general-setting-92q4oEYv.cjs +0 -1
- package/dist/project-general-setting-DC_nADG-.js +0 -83
- 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-QmmhR_h2.cjs +0 -1
- package/dist/single-page-detail-xtNZ9YxX.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
|
@@ -1,200 +0,0 @@
|
|
|
1
|
-
import { j as e } from "./jsx-runtime-WbnYoNE9.js";
|
|
2
|
-
import { useState as p, useEffect as D } from "react";
|
|
3
|
-
import { isEmpty as d, startCase as E } from "lodash-es";
|
|
4
|
-
import { MixerHorizontalIcon as L } from "@radix-ui/react-icons";
|
|
5
|
-
import { createApi as B } from "unsplash-js";
|
|
6
|
-
import { i as F, bk as K, a$ as U, b0 as V, b1 as O, ar as P, as as C, at as S, au as k, av as h, bn as Q, B as $ } from "./index-niHREMmR.js";
|
|
7
|
-
import { useDebouncedState as H } from "@react-hookz/web";
|
|
8
|
-
import { Loader as R } from "lucide-react";
|
|
9
|
-
import "./_commonjsHelpers-UyOWmZb0.js";
|
|
10
|
-
import "@radix-ui/react-toggle";
|
|
11
|
-
import "class-variance-authority";
|
|
12
|
-
import "./utils-AvyFzbPC.js";
|
|
13
|
-
import "./MODIFIERS-RiXS5Mn1.js";
|
|
14
|
-
import "clsx";
|
|
15
|
-
import "tailwind-merge";
|
|
16
|
-
import "@radix-ui/react-switch";
|
|
17
|
-
import "@radix-ui/react-slot";
|
|
18
|
-
import "@radix-ui/react-accordion";
|
|
19
|
-
import "@radix-ui/react-alert-dialog";
|
|
20
|
-
import "@radix-ui/react-dialog";
|
|
21
|
-
import "@radix-ui/react-label";
|
|
22
|
-
import "@radix-ui/react-scroll-area";
|
|
23
|
-
import "@radix-ui/react-tabs";
|
|
24
|
-
import "@radix-ui/react-tooltip";
|
|
25
|
-
import "@radix-ui/react-popover";
|
|
26
|
-
import "@radix-ui/react-menubar";
|
|
27
|
-
import "@radix-ui/react-hover-card";
|
|
28
|
-
import "@radix-ui/react-select";
|
|
29
|
-
import "@radix-ui/react-dropdown-menu";
|
|
30
|
-
import "@radix-ui/react-separator";
|
|
31
|
-
import "@radix-ui/react-toast";
|
|
32
|
-
import "cmdk";
|
|
33
|
-
import "@radix-ui/react-context-menu";
|
|
34
|
-
import "react-icons-picker";
|
|
35
|
-
import "react-dom";
|
|
36
|
-
import "react-quill";
|
|
37
|
-
import "jotai";
|
|
38
|
-
import "flat-to-nested";
|
|
39
|
-
import "./Functions-7jnEwJyw.js";
|
|
40
|
-
import "redux-undo";
|
|
41
|
-
import "@chaibuilder/runtime";
|
|
42
|
-
import "lodash";
|
|
43
|
-
import "react-i18next";
|
|
44
|
-
const I = async (x, g) => new Promise((o, r) => {
|
|
45
|
-
B({ accessKey: g }).search.getPhotos(x).then((i) => {
|
|
46
|
-
o(i);
|
|
47
|
-
}).catch((i) => r(i));
|
|
48
|
-
}), Le = ({ isModalView: x, onSelect: g }) => {
|
|
49
|
-
const o = F("unsplashAccessKey", ""), [r, j] = p([]), [i, v] = p(0), [l, A] = p(), [n, q] = p(), [z, y] = p(0), [u, T] = H("", 1e3), [f, c] = p(!1), _ = async (s) => {
|
|
50
|
-
if (d(u))
|
|
51
|
-
return;
|
|
52
|
-
let t = i + 1;
|
|
53
|
-
s && (s.preventDefault(), t = 1), c(!0), v(t);
|
|
54
|
-
const m = { query: u, page: t };
|
|
55
|
-
l && (m.orientation = l), n && (m.color = n), I(m, o).then((a) => {
|
|
56
|
-
var N, b, w;
|
|
57
|
-
j(t === 1 ? ((N = a == null ? void 0 : a.response) == null ? void 0 : N.results) || [] : [...r, ...((b = a == null ? void 0 : a.response) == null ? void 0 : b.results) || []]), y((w = a == null ? void 0 : a.response) == null ? void 0 : w.total_pages), c(!1);
|
|
58
|
-
}).catch(() => {
|
|
59
|
-
c(!1);
|
|
60
|
-
});
|
|
61
|
-
};
|
|
62
|
-
return D(() => {
|
|
63
|
-
if (!d(u) && o) {
|
|
64
|
-
c(!0);
|
|
65
|
-
const s = { query: u, page: 1 };
|
|
66
|
-
l && (s.orientation = l), n && (s.color = n), v(1), I(s, o).then((t) => {
|
|
67
|
-
var m, a;
|
|
68
|
-
j(((m = t == null ? void 0 : t.response) == null ? void 0 : m.results) || []), y((a = t == null ? void 0 : t.response) == null ? void 0 : a.total_pages), c(!1);
|
|
69
|
-
}).catch(() => {
|
|
70
|
-
c(!1);
|
|
71
|
-
});
|
|
72
|
-
}
|
|
73
|
-
}, [l, n, u, o]), d(o) ? /* @__PURE__ */ e.jsx("div", { className: "h-full flex flex-col items-center justify-center", children: /* @__PURE__ */ e.jsxs("p", { className: "max-w-3xl text-center text-gray-500", children: [
|
|
74
|
-
"To enable Unsplash, kindly provide your",
|
|
75
|
-
/* @__PURE__ */ e.jsx(
|
|
76
|
-
"a",
|
|
77
|
-
{
|
|
78
|
-
href: "https://unsplash.com/documentation#public-authentication",
|
|
79
|
-
className: "underline px-1 hover:text-blue-400",
|
|
80
|
-
target: "_blank",
|
|
81
|
-
rel: "noopener noreferrer",
|
|
82
|
-
children: "Unsplash Access Key"
|
|
83
|
-
}
|
|
84
|
-
)
|
|
85
|
-
] }) }) : /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
86
|
-
/* @__PURE__ */ e.jsxs("form", { className: "flex items-center rounded-md border bg-gray-100 p-px", children: [
|
|
87
|
-
/* @__PURE__ */ e.jsx(
|
|
88
|
-
K,
|
|
89
|
-
{
|
|
90
|
-
type: "text",
|
|
91
|
-
name: "query",
|
|
92
|
-
className: "input",
|
|
93
|
-
placeholder: 'Try "dog" or "apple"',
|
|
94
|
-
onChange: (s) => T(s.target.value)
|
|
95
|
-
}
|
|
96
|
-
),
|
|
97
|
-
/* @__PURE__ */ e.jsxs(U, { children: [
|
|
98
|
-
/* @__PURE__ */ e.jsx(V, { asChild: !0, className: "h-full w-10 cursor-pointer p-2.5 hover:bg-slate-200", children: /* @__PURE__ */ e.jsx(L, {}) }),
|
|
99
|
-
/* @__PURE__ */ e.jsx(
|
|
100
|
-
O,
|
|
101
|
-
{
|
|
102
|
-
side: x ? "bottom" : "right",
|
|
103
|
-
className: "z-[9999] flex w-max items-center justify-center",
|
|
104
|
-
children: /* @__PURE__ */ e.jsxs("div", { children: [
|
|
105
|
-
/* @__PURE__ */ e.jsx("div", { className: "py-1 text-sm font-medium", children: "Orientation" }),
|
|
106
|
-
/* @__PURE__ */ e.jsxs(P, { defaultValue: l, onValueChange: (s) => A(s), children: [
|
|
107
|
-
/* @__PURE__ */ e.jsx(C, { className: "h-auto w-40 p-1 px-3", children: /* @__PURE__ */ e.jsx(S, { placeholder: "Select" }) }),
|
|
108
|
-
/* @__PURE__ */ e.jsxs(k, { className: "z-[9999]", children: [
|
|
109
|
-
/* @__PURE__ */ e.jsx(h, { value: "", children: "All" }),
|
|
110
|
-
/* @__PURE__ */ e.jsx(h, { value: "landscape", children: "Landscape" }),
|
|
111
|
-
/* @__PURE__ */ e.jsx(h, { value: "portrait", children: "Portrait" }),
|
|
112
|
-
/* @__PURE__ */ e.jsx(h, { value: "squarish", children: "Square" })
|
|
113
|
-
] })
|
|
114
|
-
] }),
|
|
115
|
-
/* @__PURE__ */ e.jsx("div", { className: "pb-1 pt-2 text-sm font-medium", children: "Color" }),
|
|
116
|
-
/* @__PURE__ */ e.jsxs(P, { defaultValue: n, onValueChange: (s) => q(s), children: [
|
|
117
|
-
/* @__PURE__ */ e.jsx(C, { className: "h-auto w-40 p-1 px-3", children: /* @__PURE__ */ e.jsx(S, { placeholder: "Select" }) }),
|
|
118
|
-
/* @__PURE__ */ e.jsxs(k, { className: "z-[9999]", children: [
|
|
119
|
-
/* @__PURE__ */ e.jsx(h, { value: "", children: "All" }),
|
|
120
|
-
[
|
|
121
|
-
"black_and_white",
|
|
122
|
-
"black",
|
|
123
|
-
"white",
|
|
124
|
-
"yellow",
|
|
125
|
-
"orange",
|
|
126
|
-
"red",
|
|
127
|
-
"purple",
|
|
128
|
-
"magenta",
|
|
129
|
-
"green",
|
|
130
|
-
"teal",
|
|
131
|
-
"blue"
|
|
132
|
-
].map((s) => /* @__PURE__ */ e.jsx(h, { value: s, children: E(s) }, s))
|
|
133
|
-
] })
|
|
134
|
-
] })
|
|
135
|
-
] })
|
|
136
|
-
}
|
|
137
|
-
)
|
|
138
|
-
] })
|
|
139
|
-
] }),
|
|
140
|
-
/* @__PURE__ */ e.jsxs(
|
|
141
|
-
Q,
|
|
142
|
-
{
|
|
143
|
-
className: `h-full ${x && !d(r) ? "-mx-2 flex flex-wrap px-2" : "-mx-2 flex flex-col pb-8 pt-2"}`,
|
|
144
|
-
children: [
|
|
145
|
-
d(r) && !f && /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col items-center justify-center py-6", children: [
|
|
146
|
-
/* @__PURE__ */ e.jsx("div", { className: "font-medium", children: "No Data" }),
|
|
147
|
-
/* @__PURE__ */ e.jsx("div", { className: "text-sm text-gray-500", children: "Enter query and press enter" })
|
|
148
|
-
] }),
|
|
149
|
-
x ? /* @__PURE__ */ e.jsx("div", { className: "h-full columns-5 py-2", children: r.map((s) => /* @__PURE__ */ e.jsx(
|
|
150
|
-
"div",
|
|
151
|
-
{
|
|
152
|
-
role: "button",
|
|
153
|
-
tabIndex: 0,
|
|
154
|
-
className: "my-1 flex",
|
|
155
|
-
onClick: () => g(s.urls.regular),
|
|
156
|
-
children: /* @__PURE__ */ e.jsx("div", { className: "relative overflow-hidden rounded-md bg-cover bg-no-repeat", children: /* @__PURE__ */ e.jsx(
|
|
157
|
-
"img",
|
|
158
|
-
{
|
|
159
|
-
className: "h-auto flex-1 cursor-pointer rounded-md transition duration-300 ease-in-out hover:scale-105",
|
|
160
|
-
alt: s.alt_description,
|
|
161
|
-
src: s.urls.small
|
|
162
|
-
}
|
|
163
|
-
) })
|
|
164
|
-
},
|
|
165
|
-
s.id
|
|
166
|
-
)) }) : r.map((s) => (
|
|
167
|
-
// TODO: Drag and Drop Image to Canvas from Here use `pic.urls.[small, regular, full]` for image quality
|
|
168
|
-
/* @__PURE__ */ e.jsx("div", { className: "w-full px-2 py-1", children: /* @__PURE__ */ e.jsx("div", { className: "relative overflow-hidden rounded-md bg-cover bg-no-repeat", children: /* @__PURE__ */ e.jsx(
|
|
169
|
-
"img",
|
|
170
|
-
{
|
|
171
|
-
className: "h-auto cursor-pointer transition duration-300 ease-in-out hover:scale-105",
|
|
172
|
-
alt: s.alt_description,
|
|
173
|
-
src: s.urls.small
|
|
174
|
-
}
|
|
175
|
-
) }) }, s.id)
|
|
176
|
-
)),
|
|
177
|
-
f && /* @__PURE__ */ e.jsxs("div", { className: "flex items-center justify-center py-8", children: [
|
|
178
|
-
/* @__PURE__ */ e.jsx(R, { className: "animate-spin w-6 h-6" }),
|
|
179
|
-
" Loading..."
|
|
180
|
-
] }),
|
|
181
|
-
!d(r) && i < z && !f && /* @__PURE__ */ e.jsx(
|
|
182
|
-
$,
|
|
183
|
-
{
|
|
184
|
-
size: "sm",
|
|
185
|
-
variant: "link",
|
|
186
|
-
className: "w-full",
|
|
187
|
-
onClick: () => _(void 0),
|
|
188
|
-
disabled: f,
|
|
189
|
-
children: f ? "" : "Load More"
|
|
190
|
-
}
|
|
191
|
-
)
|
|
192
|
-
]
|
|
193
|
-
}
|
|
194
|
-
)
|
|
195
|
-
] });
|
|
196
|
-
};
|
|
197
|
-
export {
|
|
198
|
-
Le as default,
|
|
199
|
-
I as fetchImage
|
|
200
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-Z_BpKhVy.cjs"),o=require("react"),l=require("lodash-es"),C=require("@radix-ui/react-icons"),k=require("unsplash-js"),t=require("./index-H6vIwGfD.cjs"),A=require("@react-hookz/web"),T=require("lucide-react");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("@radix-ui/react-toggle");require("class-variance-authority");require("./utils-PTxFk6qT.cjs");require("./MODIFIERS-2FeVfZQ9.cjs");require("clsx");require("tailwind-merge");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("jotai");require("flat-to-nested");require("./Functions-N3yhPYKY.cjs");require("redux-undo");require("@chaibuilder/runtime");require("lodash");require("react-i18next");const g=async(d,E)=>new Promise((a,n)=>{k.createApi({accessKey:E}).search.getPhotos(d).then(c=>{a(c)}).catch(c=>n(c))}),z=({isModalView:d,onSelect:E})=>{const a=t.useBuilderProp("unsplashAccessKey",""),[n,f]=o.useState([]),[c,q]=o.useState(0),[u,S]=o.useState(),[x,b]=o.useState(),[I,R]=o.useState(0),[j,w]=A.useDebouncedState("",1e3),[h,m]=o.useState(!1),P=async s=>{if(l.isEmpty(j))return;let i=c+1;s&&(s.preventDefault(),i=1),m(!0),q(i);const p={query:j,page:i};u&&(p.orientation=u),x&&(p.color=x),g(p,a).then(r=>{var y,v,N;f(i===1?((y=r==null?void 0:r.response)==null?void 0:y.results)||[]:[...n,...((v=r==null?void 0:r.response)==null?void 0:v.results)||[]]),R((N=r==null?void 0:r.response)==null?void 0:N.total_pages),m(!1)}).catch(()=>{m(!1)})};return o.useEffect(()=>{if(!l.isEmpty(j)&&a){m(!0);const s={query:j,page:1};u&&(s.orientation=u),x&&(s.color=x),q(1),g(s,a).then(i=>{var p,r;f(((p=i==null?void 0:i.response)==null?void 0:p.results)||[]),R((r=i==null?void 0:i.response)==null?void 0:r.total_pages),m(!1)}).catch(()=>{m(!1)})}},[u,x,j,a]),l.isEmpty(a)?e.jsxRuntimeExports.jsx("div",{className:"h-full flex flex-col items-center justify-center",children:e.jsxRuntimeExports.jsxs("p",{className:"max-w-3xl text-center text-gray-500",children:["To enable Unsplash, kindly provide your",e.jsxRuntimeExports.jsx("a",{href:"https://unsplash.com/documentation#public-authentication",className:"underline px-1 hover:text-blue-400",target:"_blank",rel:"noopener noreferrer",children:"Unsplash Access Key"})]})}):e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsxs("form",{className:"flex items-center rounded-md border bg-gray-100 p-px",children:[e.jsxRuntimeExports.jsx(t.Input,{type:"text",name:"query",className:"input",placeholder:'Try "dog" or "apple"',onChange:s=>w(s.target.value)}),e.jsxRuntimeExports.jsxs(t.Popover,{children:[e.jsxRuntimeExports.jsx(t.PopoverTrigger,{asChild:!0,className:"h-full w-10 cursor-pointer p-2.5 hover:bg-slate-200",children:e.jsxRuntimeExports.jsx(C.MixerHorizontalIcon,{})}),e.jsxRuntimeExports.jsx(t.PopoverContent,{side:d?"bottom":"right",className:"z-[9999] flex w-max items-center justify-center",children:e.jsxRuntimeExports.jsxs("div",{children:[e.jsxRuntimeExports.jsx("div",{className:"py-1 text-sm font-medium",children:"Orientation"}),e.jsxRuntimeExports.jsxs(t.Select,{defaultValue:u,onValueChange:s=>S(s),children:[e.jsxRuntimeExports.jsx(t.SelectTrigger,{className:"h-auto w-40 p-1 px-3",children:e.jsxRuntimeExports.jsx(t.SelectValue,{placeholder:"Select"})}),e.jsxRuntimeExports.jsxs(t.SelectContent,{className:"z-[9999]",children:[e.jsxRuntimeExports.jsx(t.SelectItem,{value:"",children:"All"}),e.jsxRuntimeExports.jsx(t.SelectItem,{value:"landscape",children:"Landscape"}),e.jsxRuntimeExports.jsx(t.SelectItem,{value:"portrait",children:"Portrait"}),e.jsxRuntimeExports.jsx(t.SelectItem,{value:"squarish",children:"Square"})]})]}),e.jsxRuntimeExports.jsx("div",{className:"pb-1 pt-2 text-sm font-medium",children:"Color"}),e.jsxRuntimeExports.jsxs(t.Select,{defaultValue:x,onValueChange:s=>b(s),children:[e.jsxRuntimeExports.jsx(t.SelectTrigger,{className:"h-auto w-40 p-1 px-3",children:e.jsxRuntimeExports.jsx(t.SelectValue,{placeholder:"Select"})}),e.jsxRuntimeExports.jsxs(t.SelectContent,{className:"z-[9999]",children:[e.jsxRuntimeExports.jsx(t.SelectItem,{value:"",children:"All"}),["black_and_white","black","white","yellow","orange","red","purple","magenta","green","teal","blue"].map(s=>e.jsxRuntimeExports.jsx(t.SelectItem,{value:s,children:l.startCase(s)},s))]})]})]})})]})]}),e.jsxRuntimeExports.jsxs(t.ScrollArea,{className:`h-full ${d&&!l.isEmpty(n)?"-mx-2 flex flex-wrap px-2":"-mx-2 flex flex-col pb-8 pt-2"}`,children:[l.isEmpty(n)&&!h&&e.jsxRuntimeExports.jsxs("div",{className:"flex flex-col items-center justify-center py-6",children:[e.jsxRuntimeExports.jsx("div",{className:"font-medium",children:"No Data"}),e.jsxRuntimeExports.jsx("div",{className:"text-sm text-gray-500",children:"Enter query and press enter"})]}),d?e.jsxRuntimeExports.jsx("div",{className:"h-full columns-5 py-2",children:n.map(s=>e.jsxRuntimeExports.jsx("div",{role:"button",tabIndex:0,className:"my-1 flex",onClick:()=>E(s.urls.regular),children:e.jsxRuntimeExports.jsx("div",{className:"relative overflow-hidden rounded-md bg-cover bg-no-repeat",children:e.jsxRuntimeExports.jsx("img",{className:"h-auto flex-1 cursor-pointer rounded-md transition duration-300 ease-in-out hover:scale-105",alt:s.alt_description,src:s.urls.small})})},s.id))}):n.map(s=>e.jsxRuntimeExports.jsx("div",{className:"w-full px-2 py-1",children:e.jsxRuntimeExports.jsx("div",{className:"relative overflow-hidden rounded-md bg-cover bg-no-repeat",children:e.jsxRuntimeExports.jsx("img",{className:"h-auto cursor-pointer transition duration-300 ease-in-out hover:scale-105",alt:s.alt_description,src:s.urls.small})})},s.id)),h&&e.jsxRuntimeExports.jsxs("div",{className:"flex items-center justify-center py-8",children:[e.jsxRuntimeExports.jsx(T.Loader,{className:"animate-spin w-6 h-6"})," Loading..."]}),!l.isEmpty(n)&&c<I&&!h&&e.jsxRuntimeExports.jsx(t.Button,{size:"sm",variant:"link",className:"w-full",onClick:()=>P(void 0),disabled:h,children:h?"":"Load More"})]})]})};exports.default=z;exports.fetchImage=g;
|
|
@@ -1 +0,0 @@
|
|
|
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"),d=require("@radix-ui/react-icons"),b=require("jotai"),m=require("./index-H6vIwGfD.cjs");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("@radix-ui/react-toggle");require("class-variance-authority");require("./utils-PTxFk6qT.cjs");require("./MODIFIERS-2FeVfZQ9.cjs");require("clsx");require("tailwind-merge");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("flat-to-nested");require("./Functions-N3yhPYKY.cjs");require("redux-undo");require("@chaibuilder/runtime");require("lodash");require("@react-hookz/web");require("react-i18next");const N=b.atom([]),I=({isModalView:t,onSelect:a})=>{const E=m.useBuilderProp("uploadMediaCallback",()=>""),p=m.useBuilderProp("fetchMediaCallback",()=>[]),[i,u]=b.useAtom(N),[n,j]=s.useState(!1),[h,f]=s.useState(!1),[x,c]=s.useState(),[g,R]=s.useState("");s.useEffect(()=>{(async()=>{f(!0);const r=await p();u(r||[]),f(!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&&c(r.target.files[0])},y=async()=>{j(!0);try{const{url:r}=await E(x);a(r),c(void 0);const o=await p();u(o)}catch(r){u([]),R((r==null?void 0:r.message)||"Something went wrong.")}j(!1)};return e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[x?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(x),alt:"",className:"h-auto w-full max-w-sm rounded-md max-h-96 object-contain"}),g&&e.jsxRuntimeExports.jsx("div",{className:"w-full pt-2 text-center text-sm text-red-500",children:g}),e.jsxRuntimeExports.jsxs("div",{className:"flex w-full items-center justify-center gap-2 pt-2",children:[e.jsxRuntimeExports.jsxs("button",{type:"button",onClick:y,disabled:n,className:"flex items-center rounded-full bg-blue-500 px-3 py-1 text-sm text-white hover:bg-blue-600 hover:text-white",children:[n?e.jsxRuntimeExports.jsx(d.GearIcon,{className:"animate-spin"}):e.jsxRuntimeExports.jsx(d.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:()=>c(void 0),children:[e.jsxRuntimeExports.jsx(d.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(m.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,138 +0,0 @@
|
|
|
1
|
-
import { j as e } from "./jsx-runtime-WbnYoNE9.js";
|
|
2
|
-
import { useState as i, useEffect as w } from "react";
|
|
3
|
-
import { isEmpty as g, map as b } from "lodash-es";
|
|
4
|
-
import { GearIcon as C, UploadIcon as U, Cross1Icon as k } from "@radix-ui/react-icons";
|
|
5
|
-
import { atom as F, useAtom as E } from "jotai";
|
|
6
|
-
import { i as j, bn as A } from "./index-niHREMmR.js";
|
|
7
|
-
import "./_commonjsHelpers-UyOWmZb0.js";
|
|
8
|
-
import "@radix-ui/react-toggle";
|
|
9
|
-
import "class-variance-authority";
|
|
10
|
-
import "./utils-AvyFzbPC.js";
|
|
11
|
-
import "./MODIFIERS-RiXS5Mn1.js";
|
|
12
|
-
import "clsx";
|
|
13
|
-
import "tailwind-merge";
|
|
14
|
-
import "@radix-ui/react-switch";
|
|
15
|
-
import "@radix-ui/react-slot";
|
|
16
|
-
import "@radix-ui/react-accordion";
|
|
17
|
-
import "@radix-ui/react-alert-dialog";
|
|
18
|
-
import "@radix-ui/react-dialog";
|
|
19
|
-
import "@radix-ui/react-label";
|
|
20
|
-
import "@radix-ui/react-scroll-area";
|
|
21
|
-
import "@radix-ui/react-tabs";
|
|
22
|
-
import "@radix-ui/react-tooltip";
|
|
23
|
-
import "@radix-ui/react-popover";
|
|
24
|
-
import "@radix-ui/react-menubar";
|
|
25
|
-
import "@radix-ui/react-hover-card";
|
|
26
|
-
import "@radix-ui/react-select";
|
|
27
|
-
import "@radix-ui/react-dropdown-menu";
|
|
28
|
-
import "@radix-ui/react-separator";
|
|
29
|
-
import "@radix-ui/react-toast";
|
|
30
|
-
import "cmdk";
|
|
31
|
-
import "@radix-ui/react-context-menu";
|
|
32
|
-
import "react-icons-picker";
|
|
33
|
-
import "react-dom";
|
|
34
|
-
import "react-quill";
|
|
35
|
-
import "flat-to-nested";
|
|
36
|
-
import "./Functions-7jnEwJyw.js";
|
|
37
|
-
import "redux-undo";
|
|
38
|
-
import "@chaibuilder/runtime";
|
|
39
|
-
import "lodash";
|
|
40
|
-
import "@react-hookz/web";
|
|
41
|
-
import "react-i18next";
|
|
42
|
-
const R = F([]), je = ({ isModalView: r, onSelect: a }) => {
|
|
43
|
-
const v = j("uploadMediaCallback", () => ""), c = j("fetchMediaCallback", () => []), [o, m] = E(R), [s, p] = i(!1), [u, x] = i(!1), [n, d] = i(), [f, y] = i("");
|
|
44
|
-
w(() => {
|
|
45
|
-
(async () => {
|
|
46
|
-
x(!0);
|
|
47
|
-
const t = await c();
|
|
48
|
-
m(t || []), x(!1);
|
|
49
|
-
})();
|
|
50
|
-
}, []);
|
|
51
|
-
const N = (t) => {
|
|
52
|
-
var l, h;
|
|
53
|
-
t && ((h = (l = t == null ? void 0 : t.target) == null ? void 0 : l.files) == null ? void 0 : h.length) > 0 && d(t.target.files[0]);
|
|
54
|
-
}, I = async () => {
|
|
55
|
-
p(!0);
|
|
56
|
-
try {
|
|
57
|
-
const { url: t } = await v(n);
|
|
58
|
-
a(t), d(void 0);
|
|
59
|
-
const l = await c();
|
|
60
|
-
m(l);
|
|
61
|
-
} catch (t) {
|
|
62
|
-
m([]), y((t == null ? void 0 : t.message) || "Something went wrong.");
|
|
63
|
-
}
|
|
64
|
-
p(!1);
|
|
65
|
-
};
|
|
66
|
-
return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
67
|
-
n ? /* @__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: [
|
|
68
|
-
/* @__PURE__ */ e.jsx(
|
|
69
|
-
"img",
|
|
70
|
-
{
|
|
71
|
-
src: URL.createObjectURL(n),
|
|
72
|
-
alt: "",
|
|
73
|
-
className: "h-auto w-full max-w-sm rounded-md max-h-96 object-contain"
|
|
74
|
-
}
|
|
75
|
-
),
|
|
76
|
-
f && /* @__PURE__ */ e.jsx("div", { className: "w-full pt-2 text-center text-sm text-red-500", children: f }),
|
|
77
|
-
/* @__PURE__ */ e.jsxs("div", { className: "flex w-full items-center justify-center gap-2 pt-2", children: [
|
|
78
|
-
/* @__PURE__ */ e.jsxs(
|
|
79
|
-
"button",
|
|
80
|
-
{
|
|
81
|
-
type: "button",
|
|
82
|
-
onClick: I,
|
|
83
|
-
disabled: s,
|
|
84
|
-
className: "flex items-center rounded-full bg-blue-500 px-3 py-1 text-sm text-white hover:bg-blue-600 hover:text-white",
|
|
85
|
-
children: [
|
|
86
|
-
s ? /* @__PURE__ */ e.jsx(C, { className: "animate-spin" }) : /* @__PURE__ */ e.jsx(U, { className: "animate-bounce" }),
|
|
87
|
-
" ",
|
|
88
|
-
s ? "Uploading..." : "Upload"
|
|
89
|
-
]
|
|
90
|
-
}
|
|
91
|
-
),
|
|
92
|
-
!s && /* @__PURE__ */ e.jsxs(
|
|
93
|
-
"button",
|
|
94
|
-
{
|
|
95
|
-
type: "button",
|
|
96
|
-
className: "flex items-center rounded-full border border-gray-300 px-3 py-1 text-sm hover:bg-gray-200",
|
|
97
|
-
onClick: () => d(void 0),
|
|
98
|
-
children: [
|
|
99
|
-
/* @__PURE__ */ e.jsx(k, {}),
|
|
100
|
-
" Cancel"
|
|
101
|
-
]
|
|
102
|
-
}
|
|
103
|
-
)
|
|
104
|
-
] })
|
|
105
|
-
] }) : /* @__PURE__ */ e.jsxs("label", { htmlFor: r ? "upload-in-modal" : "upload-in-panel", children: [
|
|
106
|
-
/* @__PURE__ */ e.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: [
|
|
107
|
-
/* @__PURE__ */ e.jsx("div", { className: "text-3xl", children: "+" }),
|
|
108
|
-
/* @__PURE__ */ e.jsx("div", { children: "Click to choose file" })
|
|
109
|
-
] }),
|
|
110
|
-
/* @__PURE__ */ e.jsx("input", { type: "file", id: r ? "upload-in-modal" : "upload-in-panel", hidden: !0, onChange: N })
|
|
111
|
-
] }),
|
|
112
|
-
/* @__PURE__ */ e.jsxs(A, { className: `-mx-2 flex h-full flex-col pb-8 pt-2 ${r ? "px-2" : ""} pt-2`, children: [
|
|
113
|
-
g(o) && u && /* @__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..." }) }),
|
|
114
|
-
g(o) && !u && /* @__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" }) }),
|
|
115
|
-
r ? /* @__PURE__ */ e.jsx("div", { className: "h-full columns-5 py-2", children: b(o, (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(
|
|
116
|
-
"img",
|
|
117
|
-
{
|
|
118
|
-
className: "h-auto flex-1 cursor-pointer rounded-md transition duration-300 ease-in-out hover:scale-105",
|
|
119
|
-
alt: t.name,
|
|
120
|
-
src: t.thumbUrl
|
|
121
|
-
}
|
|
122
|
-
) }) }, t.id)) }) : b(o, (t) => (
|
|
123
|
-
// TODO: Drag and Drop Image to Canvas from Here use `pic.url` for image quality
|
|
124
|
-
/* @__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(
|
|
125
|
-
"img",
|
|
126
|
-
{
|
|
127
|
-
className: "h-auto w-full cursor-pointer transition duration-300 ease-in-out hover:scale-105",
|
|
128
|
-
alt: t.name,
|
|
129
|
-
src: t.url
|
|
130
|
-
}
|
|
131
|
-
) }) }, t.id)
|
|
132
|
-
))
|
|
133
|
-
] })
|
|
134
|
-
] });
|
|
135
|
-
};
|
|
136
|
-
export {
|
|
137
|
-
je as default
|
|
138
|
-
};
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
var t = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
|
|
2
|
-
function r(e) {
|
|
3
|
-
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
|
|
4
|
-
}
|
|
5
|
-
export {
|
|
6
|
-
t as c,
|
|
7
|
-
r as g
|
|
8
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";var t=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function o(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}exports.commonjsGlobal=t;exports.getDefaultExportFromCjs=o;
|
|
@@ -1 +0,0 @@
|
|
|
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-H6vIwGfD.cjs"),g=require("./controls-Dy1qa8Dc.cjs"),R=require("./form-VbouZlAW.cjs"),f=require("./index-jw8RxsTv.cjs");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("@radix-ui/react-toggle");require("class-variance-authority");require("./utils-PTxFk6qT.cjs");require("./MODIFIERS-2FeVfZQ9.cjs");require("clsx");require("tailwind-merge");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("jotai");require("flat-to-nested");require("./Functions-N3yhPYKY.cjs");require("redux-undo");require("@chaibuilder/runtime");require("lodash");require("@react-hookz/web");require("react-i18next");require("@rjsf/core");require("@rjsf/validator-ajv8");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-2PeOCVey.cjs");require("himalaya");require("lucide-react");require("./web-blocks.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,108 +0,0 @@
|
|
|
1
|
-
import { j as t } from "./jsx-runtime-WbnYoNE9.js";
|
|
2
|
-
import { useState as c } from "react";
|
|
3
|
-
import { kebabCase as j } from "lodash-es";
|
|
4
|
-
import { am as b, B as u, al as C, b9 as A } from "./index-niHREMmR.js";
|
|
5
|
-
import { u as g } from "./controls-XPXGHKht.js";
|
|
6
|
-
import { F as D } from "./form-OVmsLOrc.js";
|
|
7
|
-
import { g as N } from "./index-EGUphg4R.js";
|
|
8
|
-
import "./_commonjsHelpers-UyOWmZb0.js";
|
|
9
|
-
import "@radix-ui/react-toggle";
|
|
10
|
-
import "class-variance-authority";
|
|
11
|
-
import "./utils-AvyFzbPC.js";
|
|
12
|
-
import "./MODIFIERS-RiXS5Mn1.js";
|
|
13
|
-
import "clsx";
|
|
14
|
-
import "tailwind-merge";
|
|
15
|
-
import "@radix-ui/react-switch";
|
|
16
|
-
import "@radix-ui/react-slot";
|
|
17
|
-
import "@radix-ui/react-accordion";
|
|
18
|
-
import "@radix-ui/react-icons";
|
|
19
|
-
import "@radix-ui/react-alert-dialog";
|
|
20
|
-
import "@radix-ui/react-dialog";
|
|
21
|
-
import "@radix-ui/react-label";
|
|
22
|
-
import "@radix-ui/react-scroll-area";
|
|
23
|
-
import "@radix-ui/react-tabs";
|
|
24
|
-
import "@radix-ui/react-tooltip";
|
|
25
|
-
import "@radix-ui/react-popover";
|
|
26
|
-
import "@radix-ui/react-menubar";
|
|
27
|
-
import "@radix-ui/react-hover-card";
|
|
28
|
-
import "@radix-ui/react-select";
|
|
29
|
-
import "@radix-ui/react-dropdown-menu";
|
|
30
|
-
import "@radix-ui/react-separator";
|
|
31
|
-
import "@radix-ui/react-toast";
|
|
32
|
-
import "cmdk";
|
|
33
|
-
import "@radix-ui/react-context-menu";
|
|
34
|
-
import "react-icons-picker";
|
|
35
|
-
import "react-dom";
|
|
36
|
-
import "react-quill";
|
|
37
|
-
import "jotai";
|
|
38
|
-
import "flat-to-nested";
|
|
39
|
-
import "./Functions-7jnEwJyw.js";
|
|
40
|
-
import "redux-undo";
|
|
41
|
-
import "@chaibuilder/runtime";
|
|
42
|
-
import "lodash";
|
|
43
|
-
import "@react-hookz/web";
|
|
44
|
-
import "react-i18next";
|
|
45
|
-
import "@rjsf/core";
|
|
46
|
-
import "@rjsf/validator-ajv8";
|
|
47
|
-
import "i18next";
|
|
48
|
-
import "@floating-ui/react-dom";
|
|
49
|
-
import "react-textarea-autosize";
|
|
50
|
-
import "flagged";
|
|
51
|
-
import "react-dnd";
|
|
52
|
-
import "@minoru/react-dnd-treeview";
|
|
53
|
-
import "react-hotkeys-hook";
|
|
54
|
-
import "sonner";
|
|
55
|
-
import "./html-to-json-57841sEK.js";
|
|
56
|
-
import "himalaya";
|
|
57
|
-
import "lucide-react";
|
|
58
|
-
import "./web-blocks.js";
|
|
59
|
-
const S = ({ closeModal: i }) => {
|
|
60
|
-
var a, s;
|
|
61
|
-
const e = N(), [o, f] = c({
|
|
62
|
-
name: "",
|
|
63
|
-
slug: "",
|
|
64
|
-
blocks: [],
|
|
65
|
-
type: "STATIC",
|
|
66
|
-
seoData: {},
|
|
67
|
-
template: ""
|
|
68
|
-
}), x = () => {
|
|
69
|
-
e.mutate(o, { onSuccess: () => i() });
|
|
70
|
-
}, h = ({ formData: m }, r) => {
|
|
71
|
-
f((l) => {
|
|
72
|
-
var n, d;
|
|
73
|
-
const p = { [r]: m[r] };
|
|
74
|
-
return r === "name" ? p.slug = j((n = m[r]) == null ? void 0 : n.replace(/\d/g, "")) : r === "slug" && (p.slug = (d = m[r]) == null ? void 0 : d.replace(/\d/g, "").replace(/\s+/g, "").replace("--", "-").replace("__", "_")), {
|
|
75
|
-
...l,
|
|
76
|
-
...p
|
|
77
|
-
};
|
|
78
|
-
});
|
|
79
|
-
}, P = {
|
|
80
|
-
name: g({
|
|
81
|
-
title: "Page Name",
|
|
82
|
-
default: o.name
|
|
83
|
-
}),
|
|
84
|
-
slug: g({ title: "Page Slug", default: o.slug })
|
|
85
|
-
};
|
|
86
|
-
return /* @__PURE__ */ t.jsxs(b, { children: [
|
|
87
|
-
/* @__PURE__ */ t.jsx("div", { className: "px-1 font-bold", children: "Add Page" }),
|
|
88
|
-
/* @__PURE__ */ t.jsx(D, { formData: o, properties: P, onChange: h, disabled: e.isPending }),
|
|
89
|
-
/* @__PURE__ */ t.jsx("div", { className: "flex items-center justify-end", children: /* @__PURE__ */ t.jsx(
|
|
90
|
-
u,
|
|
91
|
-
{
|
|
92
|
-
type: "submit",
|
|
93
|
-
disabled: !o.name || !o.slug || ((a = o.name) == null ? void 0 : a.length) < 2 || ((s = o.slug) == null ? void 0 : s.length) < 2 || e.isPending,
|
|
94
|
-
onClick: x,
|
|
95
|
-
children: "Add Page"
|
|
96
|
-
}
|
|
97
|
-
) })
|
|
98
|
-
] });
|
|
99
|
-
}, wt = () => {
|
|
100
|
-
const [i, e] = c(!1);
|
|
101
|
-
return /* @__PURE__ */ t.jsxs(C, { open: i, onOpenChange: () => e(!i), children: [
|
|
102
|
-
/* @__PURE__ */ t.jsx(A, { asChild: !0, children: /* @__PURE__ */ t.jsx(u, { size: "sm", variant: "link", className: "text-blue-500", onClick: () => e(!i), children: "+ New Page" }) }),
|
|
103
|
-
i && /* @__PURE__ */ t.jsx(S, { closeModal: () => e(!i) })
|
|
104
|
-
] });
|
|
105
|
-
};
|
|
106
|
-
export {
|
|
107
|
-
wt as default
|
|
108
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-Z_BpKhVy.cjs"),r=require("./index-H6vIwGfD.cjs");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("react");require("@radix-ui/react-toggle");require("class-variance-authority");require("./utils-PTxFk6qT.cjs");require("lodash-es");require("./MODIFIERS-2FeVfZQ9.cjs");require("clsx");require("tailwind-merge");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("jotai");require("flat-to-nested");require("./Functions-N3yhPYKY.cjs");require("redux-undo");require("@chaibuilder/runtime");require("lodash");require("@react-hookz/web");require("react-i18next");const x=({open:q,onCancel:t=()=>{},onConfirm:s,title:n,description:i,disabled:u,cancelText:l="Discard",confirmText:o="Save"})=>e.jsxRuntimeExports.jsx(r.AlertDialog,{open:q,children:e.jsxRuntimeExports.jsxs(r.AlertDialogContent,{children:[e.jsxRuntimeExports.jsx(r.AlertDialogTitle,{children:n}),i&&e.jsxRuntimeExports.jsx(r.AlertDialogDescription,{children:i}),e.jsxRuntimeExports.jsxs("div",{className:"flex items-center justify-end gap-x-3",children:[e.jsxRuntimeExports.jsx(r.AlertDialogCancel,{disabled:u,onClick:t,children:l}),e.jsxRuntimeExports.jsx(r.Button,{variant:"default",onClick:s,disabled:u,children:o})]})]})});exports.default=x;
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
import { j as i } from "./jsx-runtime-WbnYoNE9.js";
|
|
2
|
-
import { E as a, G as n, I as c, J as x, L as j, B as d } from "./index-niHREMmR.js";
|
|
3
|
-
import "./_commonjsHelpers-UyOWmZb0.js";
|
|
4
|
-
import "react";
|
|
5
|
-
import "@radix-ui/react-toggle";
|
|
6
|
-
import "class-variance-authority";
|
|
7
|
-
import "./utils-AvyFzbPC.js";
|
|
8
|
-
import "lodash-es";
|
|
9
|
-
import "./MODIFIERS-RiXS5Mn1.js";
|
|
10
|
-
import "clsx";
|
|
11
|
-
import "tailwind-merge";
|
|
12
|
-
import "@radix-ui/react-switch";
|
|
13
|
-
import "@radix-ui/react-slot";
|
|
14
|
-
import "@radix-ui/react-accordion";
|
|
15
|
-
import "@radix-ui/react-icons";
|
|
16
|
-
import "@radix-ui/react-alert-dialog";
|
|
17
|
-
import "@radix-ui/react-dialog";
|
|
18
|
-
import "@radix-ui/react-label";
|
|
19
|
-
import "@radix-ui/react-scroll-area";
|
|
20
|
-
import "@radix-ui/react-tabs";
|
|
21
|
-
import "@radix-ui/react-tooltip";
|
|
22
|
-
import "@radix-ui/react-popover";
|
|
23
|
-
import "@radix-ui/react-menubar";
|
|
24
|
-
import "@radix-ui/react-hover-card";
|
|
25
|
-
import "@radix-ui/react-select";
|
|
26
|
-
import "@radix-ui/react-dropdown-menu";
|
|
27
|
-
import "@radix-ui/react-separator";
|
|
28
|
-
import "@radix-ui/react-toast";
|
|
29
|
-
import "cmdk";
|
|
30
|
-
import "@radix-ui/react-context-menu";
|
|
31
|
-
import "react-icons-picker";
|
|
32
|
-
import "react-dom";
|
|
33
|
-
import "react-quill";
|
|
34
|
-
import "jotai";
|
|
35
|
-
import "flat-to-nested";
|
|
36
|
-
import "./Functions-7jnEwJyw.js";
|
|
37
|
-
import "redux-undo";
|
|
38
|
-
import "@chaibuilder/runtime";
|
|
39
|
-
import "lodash";
|
|
40
|
-
import "@react-hookz/web";
|
|
41
|
-
import "react-i18next";
|
|
42
|
-
const ti = ({
|
|
43
|
-
open: o,
|
|
44
|
-
onCancel: m = () => {
|
|
45
|
-
},
|
|
46
|
-
onConfirm: p,
|
|
47
|
-
title: e,
|
|
48
|
-
description: r,
|
|
49
|
-
disabled: t,
|
|
50
|
-
cancelText: l = "Discard",
|
|
51
|
-
confirmText: s = "Save"
|
|
52
|
-
}) => /* @__PURE__ */ i.jsx(a, { open: o, children: /* @__PURE__ */ i.jsxs(n, { children: [
|
|
53
|
-
/* @__PURE__ */ i.jsx(c, { children: e }),
|
|
54
|
-
r && /* @__PURE__ */ i.jsx(x, { children: r }),
|
|
55
|
-
/* @__PURE__ */ i.jsxs("div", { className: "flex items-center justify-end gap-x-3", children: [
|
|
56
|
-
/* @__PURE__ */ i.jsx(j, { disabled: t, onClick: m, children: l }),
|
|
57
|
-
/* @__PURE__ */ i.jsx(d, { variant: "default", onClick: p, disabled: t, children: s })
|
|
58
|
-
] })
|
|
59
|
-
] }) });
|
|
60
|
-
export {
|
|
61
|
-
ti as default
|
|
62
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
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;
|