@chaibuilder/sdk 0.1.11 → 0.1.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{AddBlocks-9d1873e7.js → AddBlocks-598b655e.js} +46 -46
- package/dist/{AddBlocks-12a3610b.cjs → AddBlocks-5df8b221.cjs} +2 -2
- package/dist/{BrandingOptions-69d302c5.js → BrandingOptions-0acb0974.js} +1 -1
- package/dist/{BrandingOptions-7439ff1e.cjs → BrandingOptions-2795be29.cjs} +1 -1
- package/dist/{CanvasArea-7424817c.js → CanvasArea-73b0ec3b.js} +2 -2
- package/dist/{CanvasArea-6f24eabe.cjs → CanvasArea-a637ef3a.cjs} +2 -2
- package/dist/{CurrentPage-1e98746d.js → CurrentPage-3a189b02.js} +1 -1
- package/dist/{CurrentPage-526d5497.cjs → CurrentPage-77baf305.cjs} +1 -1
- package/dist/ImagesPanel-68a11293.cjs +1 -0
- package/dist/ImagesPanel-996761b1.js +27 -0
- package/dist/{Layers-8233c000.js → Layers-42ba6c2e.js} +2 -2
- package/dist/{Layers-1fa4a7ad.cjs → Layers-7f3a2335.cjs} +1 -1
- package/dist/{MarkAsGlobalBlock-46fcc533.js → MarkAsGlobalBlock-3e708ff4.js} +1 -1
- package/dist/{MarkAsGlobalBlock-9b4b1f4f.cjs → MarkAsGlobalBlock-c18910cc.cjs} +1 -1
- package/dist/{PagesPanel-51d88965.js → PagesPanel-86323919.js} +2 -2
- package/dist/{PagesPanel-4aafb70f.cjs → PagesPanel-dfbcc68b.cjs} +1 -1
- package/dist/{ProjectPanel-0748603f.cjs → ProjectPanel-4be28a35.cjs} +1 -1
- package/dist/{ProjectPanel-af75d218.js → ProjectPanel-9f645945.js} +2 -2
- package/dist/{Settings-29f58509.js → Settings-57f2a7c2.js} +3 -3
- package/dist/{Settings-c184ce31.cjs → Settings-99916fc1.cjs} +1 -1
- package/dist/{SidePanels-279903d7.cjs → SidePanels-0e4ab159.cjs} +1 -1
- package/dist/{SidePanels-54124742.js → SidePanels-b0347e28.js} +2 -2
- package/dist/{Topbar-c7ce8963.cjs → Topbar-44c010e3.cjs} +1 -1
- package/dist/{Topbar-c52e0d3e.js → Topbar-87c1c5b2.js} +1 -1
- package/dist/UnsplashImages-47374e0c.js +181 -0
- package/dist/UnsplashImages-f761ad96.cjs +1 -0
- package/dist/{add-page-modal-fda0926e.js → add-page-modal-71c100f9.js} +4 -4
- package/dist/{add-page-modal-6be96646.cjs → add-page-modal-b4e12262.cjs} +1 -1
- package/dist/core.cjs +1 -1
- package/dist/core.d.ts +2 -0
- package/dist/core.js +1 -1
- package/dist/{delete-page-modal-0aa98758.js → delete-page-modal-9dbe3038.js} +1 -1
- package/dist/{delete-page-modal-d7a7059c.cjs → delete-page-modal-fe71e66d.cjs} +1 -1
- package/dist/{form-d82a2694.cjs → form-5d04c9b3.cjs} +1 -1
- package/dist/{form-1ead8a4a.js → form-bf09d392.js} +1 -1
- package/dist/{index-d0cc5c76.js → index-0d399aef.js} +278 -276
- package/dist/{index-2524cb40.cjs → index-d4a18b5d.cjs} +2 -2
- package/dist/{link-fcfa7b45.cjs → link-4585b2d6.cjs} +1 -1
- package/dist/{link-82714c4b.js → link-6467eda6.js} +6 -6
- package/dist/{page-viewer-b65e1389.js → page-viewer-8a0cd017.js} +2 -2
- package/dist/{page-viewer-a53f2a9b.cjs → page-viewer-eec3bdfb.cjs} +1 -1
- package/dist/{project-general-setting-c4907c79.cjs → project-general-setting-12172508.cjs} +1 -1
- package/dist/{project-general-setting-40d772a0.js → project-general-setting-155bc3fc.js} +4 -4
- package/dist/{project-seo-setting-5a54c6a6.cjs → project-seo-setting-3f645a02.cjs} +1 -1
- package/dist/{project-seo-setting-245555ef.js → project-seo-setting-e9587467.js} +3 -3
- package/dist/server.cjs +1 -1
- package/dist/server.d.ts +17 -17
- package/dist/server.js +33 -33
- package/dist/{single-page-detail-5e2a7ffe.cjs → single-page-detail-1b3195d1.cjs} +1 -1
- package/dist/{single-page-detail-15c218dc.js → single-page-detail-fb0fe01b.js} +5 -5
- package/dist/ui.cjs +1 -1
- package/dist/ui.js +2 -2
- package/package.json +1 -1
- package/dist/ImagesPanel-36a2f276.js +0 -27
- package/dist/ImagesPanel-731cda7a.cjs +0 -1
- package/dist/UnsplashImages-68492dc9.cjs +0 -1
- package/dist/UnsplashImages-afaa7706.js +0 -151
|
@@ -1,151 +0,0 @@
|
|
|
1
|
-
import { j as e } from "./jsx-runtime-944c88e2.js";
|
|
2
|
-
import { useState as c, useEffect as _ } from "react";
|
|
3
|
-
import { isEmpty as h, startCase as k } from "lodash";
|
|
4
|
-
import { MixerHorizontalIcon as z } from "@radix-ui/react-icons";
|
|
5
|
-
import { createApi as D } from "unsplash-js";
|
|
6
|
-
import { B as F } from "./useBuilderProp-81a14920.js";
|
|
7
|
-
import { I as T } from "./input-a0ea2bc7.js";
|
|
8
|
-
import { S as V } from "./scroll-area-9f64a082.js";
|
|
9
|
-
import { P as B, a as H, b as K } from "./popover-f7addcf4.js";
|
|
10
|
-
import { S as C, c as S, b as w, d as P, f as m } from "./select-7fddd7c3.js";
|
|
11
|
-
import "@radix-ui/react-slot";
|
|
12
|
-
import "class-variance-authority";
|
|
13
|
-
import "./utils-ac68b2c8.js";
|
|
14
|
-
import "clsx";
|
|
15
|
-
import "tailwind-merge";
|
|
16
|
-
import "@radix-ui/react-tooltip";
|
|
17
|
-
import "@radix-ui/react-toast";
|
|
18
|
-
import "jotai";
|
|
19
|
-
import "@radix-ui/react-scroll-area";
|
|
20
|
-
import "@radix-ui/react-popover";
|
|
21
|
-
import "@radix-ui/react-select";
|
|
22
|
-
const L = "phfFCfD_A95ICxvwEYsFxsgHD-1veFwGA4Cu8qxvcec", O = D({ accessKey: L }), I = async (d) => new Promise((x, r) => {
|
|
23
|
-
O.search.getPhotos(d).then((p) => {
|
|
24
|
-
x(p);
|
|
25
|
-
}).catch((p) => r(p));
|
|
26
|
-
}), me = ({ isModalView: d, onSelect: x }) => {
|
|
27
|
-
const [r, p] = c(""), [o, f] = c([]), [u, g] = c(0), [l, A] = c(), [n, E] = c(), [q, j] = c(0), v = async (s) => {
|
|
28
|
-
let t = u + 1;
|
|
29
|
-
s && (s.preventDefault(), t = 1), g(t);
|
|
30
|
-
const i = { query: r, page: t };
|
|
31
|
-
l && (i.orientation = l), n && (i.color = n), I(i).then((a) => {
|
|
32
|
-
var N, y, b;
|
|
33
|
-
f(t === 1 ? ((N = a == null ? void 0 : a.response) == null ? void 0 : N.results) || [] : [...o, ...((y = a == null ? void 0 : a.response) == null ? void 0 : y.results) || []]), j((b = a == null ? void 0 : a.response) == null ? void 0 : b.total_pages);
|
|
34
|
-
}).catch(() => {
|
|
35
|
-
});
|
|
36
|
-
};
|
|
37
|
-
return _(() => {
|
|
38
|
-
if (!h(r)) {
|
|
39
|
-
const s = { query: r, page: 1 };
|
|
40
|
-
l && (s.orientation = l), n && (s.color = n), g(1), I(s).then((t) => {
|
|
41
|
-
var i, a;
|
|
42
|
-
f(((i = t == null ? void 0 : t.response) == null ? void 0 : i.results) || []), j((a = t == null ? void 0 : t.response) == null ? void 0 : a.total_pages);
|
|
43
|
-
}).catch(() => {
|
|
44
|
-
});
|
|
45
|
-
}
|
|
46
|
-
}, [l, n, r]), /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
47
|
-
/* @__PURE__ */ e.jsxs("form", { className: "flex items-center rounded-md border bg-gray-100 p-px", onSubmit: v, children: [
|
|
48
|
-
/* @__PURE__ */ e.jsx(
|
|
49
|
-
T,
|
|
50
|
-
{
|
|
51
|
-
type: "text",
|
|
52
|
-
name: "query",
|
|
53
|
-
className: "input",
|
|
54
|
-
placeholder: 'Try "dog" or "apple"',
|
|
55
|
-
value: r,
|
|
56
|
-
onChange: (s) => p(s.target.value)
|
|
57
|
-
}
|
|
58
|
-
),
|
|
59
|
-
/* @__PURE__ */ e.jsxs(B, { children: [
|
|
60
|
-
/* @__PURE__ */ e.jsx(H, { asChild: !0, className: "h-full w-10 cursor-pointer p-2.5 hover:bg-slate-200", children: /* @__PURE__ */ e.jsx(z, {}) }),
|
|
61
|
-
/* @__PURE__ */ e.jsx(
|
|
62
|
-
K,
|
|
63
|
-
{
|
|
64
|
-
side: d ? "bottom" : "right",
|
|
65
|
-
className: "z-[9999] flex w-max items-center justify-center",
|
|
66
|
-
children: /* @__PURE__ */ e.jsxs("div", { children: [
|
|
67
|
-
/* @__PURE__ */ e.jsx("div", { className: "py-1 text-sm font-medium", children: "Orientation" }),
|
|
68
|
-
/* @__PURE__ */ e.jsxs(C, { defaultValue: l, onValueChange: (s) => A(s), children: [
|
|
69
|
-
/* @__PURE__ */ e.jsx(S, { className: "h-auto w-40 p-1 px-3", children: /* @__PURE__ */ e.jsx(w, { placeholder: "Select" }) }),
|
|
70
|
-
/* @__PURE__ */ e.jsxs(P, { className: "z-[9999]", children: [
|
|
71
|
-
/* @__PURE__ */ e.jsx(m, { value: "", children: "All" }),
|
|
72
|
-
/* @__PURE__ */ e.jsx(m, { value: "landscape", children: "Landscape" }),
|
|
73
|
-
/* @__PURE__ */ e.jsx(m, { value: "portrait", children: "Portrait" }),
|
|
74
|
-
/* @__PURE__ */ e.jsx(m, { value: "squarish", children: "Square" })
|
|
75
|
-
] })
|
|
76
|
-
] }),
|
|
77
|
-
/* @__PURE__ */ e.jsx("div", { className: "pb-1 pt-2 text-sm font-medium", children: "Color" }),
|
|
78
|
-
/* @__PURE__ */ e.jsxs(C, { defaultValue: n, onValueChange: (s) => E(s), children: [
|
|
79
|
-
/* @__PURE__ */ e.jsx(S, { className: "h-auto w-40 p-1 px-3", children: /* @__PURE__ */ e.jsx(w, { placeholder: "Select" }) }),
|
|
80
|
-
/* @__PURE__ */ e.jsxs(P, { className: "z-[9999]", children: [
|
|
81
|
-
/* @__PURE__ */ e.jsx(m, { value: "", children: "All" }),
|
|
82
|
-
[
|
|
83
|
-
"black_and_white",
|
|
84
|
-
"black",
|
|
85
|
-
"white",
|
|
86
|
-
"yellow",
|
|
87
|
-
"orange",
|
|
88
|
-
"red",
|
|
89
|
-
"purple",
|
|
90
|
-
"magenta",
|
|
91
|
-
"green",
|
|
92
|
-
"teal",
|
|
93
|
-
"blue"
|
|
94
|
-
].map((s) => /* @__PURE__ */ e.jsx(m, { value: s, children: k(s) }, s))
|
|
95
|
-
] })
|
|
96
|
-
] })
|
|
97
|
-
] })
|
|
98
|
-
}
|
|
99
|
-
)
|
|
100
|
-
] })
|
|
101
|
-
] }),
|
|
102
|
-
/* @__PURE__ */ e.jsxs(
|
|
103
|
-
V,
|
|
104
|
-
{
|
|
105
|
-
className: `h-full ${d && !h(o) ? "-mx-2 flex flex-wrap px-2" : "-mx-2 flex flex-col pb-8 pt-2"}`,
|
|
106
|
-
children: [
|
|
107
|
-
h(o) && /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col items-center justify-center py-6", children: [
|
|
108
|
-
/* @__PURE__ */ e.jsx("div", { className: "font-medium", children: "No Data" }),
|
|
109
|
-
/* @__PURE__ */ e.jsx("div", { className: "text-sm text-gray-500", children: "Enter query and press enter" })
|
|
110
|
-
] }),
|
|
111
|
-
d ? /* @__PURE__ */ e.jsx("div", { className: "h-full columns-5 py-2", children: o.map((s) => (
|
|
112
|
-
// eslint-disable-next-line jsx-a11y/click-events-have-key-events
|
|
113
|
-
/* @__PURE__ */ e.jsx(
|
|
114
|
-
"div",
|
|
115
|
-
{
|
|
116
|
-
role: "button",
|
|
117
|
-
tabIndex: 0,
|
|
118
|
-
className: "my-1 flex",
|
|
119
|
-
onClick: () => x(s.urls.regular),
|
|
120
|
-
children: /* @__PURE__ */ e.jsx("div", { className: "relative overflow-hidden rounded-md bg-cover bg-no-repeat", children: /* @__PURE__ */ e.jsx(
|
|
121
|
-
"img",
|
|
122
|
-
{
|
|
123
|
-
className: "h-auto flex-1 cursor-pointer rounded-md transition duration-300 ease-in-out hover:scale-105",
|
|
124
|
-
alt: s.alt_description,
|
|
125
|
-
src: s.urls.small
|
|
126
|
-
}
|
|
127
|
-
) })
|
|
128
|
-
},
|
|
129
|
-
s.id
|
|
130
|
-
)
|
|
131
|
-
)) }) : o.map((s) => (
|
|
132
|
-
// TODO: Drag and Drop Image to Canvas from Here use `pic.urls.[small, regular, full]` for image quality
|
|
133
|
-
/* @__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(
|
|
134
|
-
"img",
|
|
135
|
-
{
|
|
136
|
-
className: "h-auto cursor-pointer transition duration-300 ease-in-out hover:scale-105",
|
|
137
|
-
alt: s.alt_description,
|
|
138
|
-
src: s.urls.small
|
|
139
|
-
}
|
|
140
|
-
) }) }, s.id)
|
|
141
|
-
)),
|
|
142
|
-
!h(o) && u < q && /* @__PURE__ */ e.jsx(F, { size: "sm", variant: "link", className: "w-full", onClick: () => v(void 0), children: "Load More" })
|
|
143
|
-
]
|
|
144
|
-
}
|
|
145
|
-
)
|
|
146
|
-
] });
|
|
147
|
-
};
|
|
148
|
-
export {
|
|
149
|
-
me as default,
|
|
150
|
-
I as fetchImage
|
|
151
|
-
};
|