@chaibuilder/sdk 1.3.0-beta.8 → 1.3.0

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.
Files changed (63) hide show
  1. package/dist/CodeEditor-C94XQmvL.cjs +1 -0
  2. package/dist/CodeEditor-D5t7A9Po.js +77 -0
  3. package/dist/STRINGS-eiGM83kj.js +7 -0
  4. package/dist/STRINGS-ew98weUe.cjs +1 -0
  5. package/dist/Topbar-Bnxt9C5B.js +113 -0
  6. package/dist/Topbar-DFm3YQZi.cjs +1 -0
  7. package/dist/UnsplashImages-BWT3eyq3.cjs +1 -0
  8. package/dist/UnsplashImages-D-9aNQGK.js +189 -0
  9. package/dist/UploadImages-CntfFAoV.cjs +1 -0
  10. package/dist/UploadImages-CrAaKlC1.js +101 -0
  11. package/dist/context-menu-BbqLeYFX.js +979 -0
  12. package/dist/context-menu-DfAXjmc8.cjs +1 -0
  13. package/dist/controls-C4n5ycp4.cjs +1 -0
  14. package/dist/controls-Com-zYCq.js +234 -0
  15. package/dist/core.cjs +1 -82
  16. package/dist/core.d.ts +10 -5
  17. package/dist/core.js +74 -74
  18. package/dist/iconBase-Cn2BsTrq.cjs +1 -0
  19. package/dist/iconBase-DHfFLkem.js +124 -0
  20. package/dist/index-C9LOYt3W.cjs +63 -0
  21. package/dist/index-CcLk7_o6.js +9319 -0
  22. package/dist/jsx-runtime-BYECrxsp.cjs +30 -0
  23. package/dist/jsx-runtime-DGlMoOmv.js +630 -0
  24. package/dist/plugin-BOEoR5jk.js +44 -0
  25. package/dist/plugin-COMQcYlW.cjs +1 -0
  26. package/dist/plugin-Dw854zFv.js +107 -0
  27. package/dist/plugin-I9XxF65G.cjs +1 -0
  28. package/dist/render.cjs +2 -208
  29. package/dist/render.js +125 -171
  30. package/dist/runtime.cjs +1 -26
  31. package/dist/runtime.js +16 -16
  32. package/dist/style.css +2 -1529
  33. package/dist/tailwind.cjs +1 -78
  34. package/dist/tailwind.js +19 -21
  35. package/dist/ui.cjs +1 -392
  36. package/dist/ui.js +257 -268
  37. package/dist/web-blocks.cjs +3 -1241
  38. package/dist/web-blocks.js +555 -764
  39. package/package.json +1 -1
  40. package/dist/CodeEditor-1LboGb1I.cjs +0 -91
  41. package/dist/CodeEditor-BKgZeXwz.js +0 -91
  42. package/dist/STRINGS-3Sn_NeX1.cjs +0 -9
  43. package/dist/STRINGS-DdpfVlsV.js +0 -10
  44. package/dist/Topbar-B8IS6y4H.js +0 -135
  45. package/dist/Topbar-DXC7DFU1.cjs +0 -135
  46. package/dist/UnsplashImages-CjJ5szAy.cjs +0 -215
  47. package/dist/UnsplashImages-Ck9qpKR0.js +0 -215
  48. package/dist/UploadImages-DW1mj4MB.cjs +0 -117
  49. package/dist/UploadImages-DgAMZ8GR.js +0 -117
  50. package/dist/context-menu-BLbuduri.cjs +0 -1073
  51. package/dist/context-menu-BgtRnByf.js +0 -1042
  52. package/dist/controls-8EZmm0Ns.js +0 -234
  53. package/dist/controls-DaW52RjX.cjs +0 -233
  54. package/dist/iconBase-BSrIcOaG.cjs +0 -146
  55. package/dist/iconBase-CWgVxu0A.js +0 -147
  56. package/dist/index-Bjw2sUN2.cjs +0 -12139
  57. package/dist/index-D8_rAW8B.js +0 -12124
  58. package/dist/jsx-runtime-B6vEU3CM.cjs +0 -925
  59. package/dist/jsx-runtime-ClFauRgV.js +0 -926
  60. package/dist/plugin-BYwesM58.cjs +0 -54
  61. package/dist/plugin-BiDLHDo3.cjs +0 -114
  62. package/dist/plugin-BukD7GJR.js +0 -115
  63. package/dist/plugin-tVAEvXiS.js +0 -55
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-BYECrxsp.cjs"),k=require("@monaco-editor/react"),C=require("./context-menu-DfAXjmc8.cjs"),E=require("react-i18next"),i=require("react"),l=require("./index-C9LOYt3W.cjs"),R=require("@radix-ui/react-icons"),g=require("@react-hookz/web"),u=o=>{const n=document.createElement("div");return n.innerHTML=o,n.innerHTML};function v(){const{t:o}=E.useTranslation(),[n,d]=i.useState(!1),[c,x]=i.useState(""),[t,r]=l.useCodeEditor(),[a]=l.useSelectedBlockIds(),m=l.useUpdateBlocksProps(),p=l.useUpdateBlocksPropsRealtime(),j=g.useThrottledCallback(s=>{const b=u(s);p([t.blockId],{[t.blockProp]:b})},[],300),f=i.useCallback(()=>{if(n){const s=u(c);m([t.blockId],{[t.blockProp]:s})}},[n,c]);i.useEffect(()=>{a.includes(t==null?void 0:t.blockId)||(f(),r(null))},[a]);const h=()=>{r(null)};return e.jsxRuntimeExports.jsxs("div",{className:"h-full rounded-t-lg border-t-4 border-black bg-black text-white",children:[e.jsxRuntimeExports.jsx("button",{onClick:h,className:"fixed inset-0 z-[100000] cursor-default bg-gray-400/20"}),e.jsxRuntimeExports.jsxs("div",{className:"relative z-[100001] h-full w-full flex-col gap-y-1",children:[e.jsxRuntimeExports.jsxs("div",{className:"-mt-1 flex items-center justify-between px-2 py-2",children:[e.jsxRuntimeExports.jsxs("h3",{className:"space-x-3 text-sm font-semibold",children:[e.jsxRuntimeExports.jsx("span",{children:o("HTML Code Editor |")}),e.jsxRuntimeExports.jsx("span",{className:"text-xs text-gray-400",children:o("Scripts will be only executed in preview and live mode.")})]}),e.jsxRuntimeExports.jsx("div",{className:"flex gap-x-2",children:e.jsxRuntimeExports.jsx(C.Button,{onClick:()=>r(null),size:"sm",variant:"destructive",className:"h-6 w-fit",children:e.jsxRuntimeExports.jsx(R.Cross2Icon,{})})})]}),e.jsxRuntimeExports.jsx(k,{onMount:s=>{s.setValue(t.initialCode)},onChange:s=>{d(!0),x(s),j(s)},height:"100%",defaultLanguage:"html",theme:"vs-dark",defaultValue:"",options:{minimap:{enabled:!1}}})]})]})}exports.default=v;
@@ -0,0 +1,77 @@
1
+ import { j as e } from "./jsx-runtime-DGlMoOmv.js";
2
+ import k from "@monaco-editor/react";
3
+ import { B as C } from "./context-menu-BbqLeYFX.js";
4
+ import { useTranslation as j } from "react-i18next";
5
+ import { useState as r, useCallback as v, useEffect as g } from "react";
6
+ import { u as y, a as N, b as T, c as E } from "./index-CcLk7_o6.js";
7
+ import { Cross2Icon as w } from "@radix-ui/react-icons";
8
+ import { useThrottledCallback as B } from "@react-hookz/web";
9
+ const c = (l) => {
10
+ const o = document.createElement("div");
11
+ return o.innerHTML = l, o.innerHTML;
12
+ };
13
+ function U() {
14
+ const { t: l } = j(), [o, d] = r(!1), [n, m] = r(""), [t, a] = y(), [i] = N(), u = T(), p = E(), f = B(
15
+ (s) => {
16
+ const b = c(s);
17
+ p([t.blockId], { [t.blockProp]: b });
18
+ },
19
+ [],
20
+ 300
21
+ ), x = v(() => {
22
+ if (o) {
23
+ const s = c(n);
24
+ u([t.blockId], { [t.blockProp]: s });
25
+ }
26
+ }, [o, n]);
27
+ g(() => {
28
+ i.includes(t == null ? void 0 : t.blockId) || (x(), a(null));
29
+ }, [i]);
30
+ const h = () => {
31
+ a(null);
32
+ };
33
+ return /* @__PURE__ */ e.jsxs("div", { className: "h-full rounded-t-lg border-t-4 border-black bg-black text-white", children: [
34
+ /* @__PURE__ */ e.jsx("button", { onClick: h, className: "fixed inset-0 z-[100000] cursor-default bg-gray-400/20" }),
35
+ /* @__PURE__ */ e.jsxs("div", { className: "relative z-[100001] h-full w-full flex-col gap-y-1", children: [
36
+ /* @__PURE__ */ e.jsxs("div", { className: "-mt-1 flex items-center justify-between px-2 py-2", children: [
37
+ /* @__PURE__ */ e.jsxs("h3", { className: "space-x-3 text-sm font-semibold", children: [
38
+ /* @__PURE__ */ e.jsx("span", { children: l("HTML Code Editor |") }),
39
+ /* @__PURE__ */ e.jsx("span", { className: "text-xs text-gray-400", children: l("Scripts will be only executed in preview and live mode.") })
40
+ ] }),
41
+ /* @__PURE__ */ e.jsx("div", { className: "flex gap-x-2", children: /* @__PURE__ */ e.jsx(
42
+ C,
43
+ {
44
+ onClick: () => a(null),
45
+ size: "sm",
46
+ variant: "destructive",
47
+ className: "h-6 w-fit",
48
+ children: /* @__PURE__ */ e.jsx(w, {})
49
+ }
50
+ ) })
51
+ ] }),
52
+ /* @__PURE__ */ e.jsx(
53
+ k,
54
+ {
55
+ onMount: (s) => {
56
+ s.setValue(t.initialCode);
57
+ },
58
+ onChange: (s) => {
59
+ d(!0), m(s), f(s);
60
+ },
61
+ height: "100%",
62
+ defaultLanguage: "html",
63
+ theme: "vs-dark",
64
+ defaultValue: "",
65
+ options: {
66
+ minimap: {
67
+ enabled: !1
68
+ }
69
+ }
70
+ }
71
+ )
72
+ ] })
73
+ ] });
74
+ }
75
+ export {
76
+ U as default
77
+ };
@@ -0,0 +1,7 @@
1
+ const s = "#styles:", _ = "#slots:", t = "#i18n", E = "__ADD_BLOCK_INTERNAL_ROOT";
2
+ export {
3
+ t as I,
4
+ E as R,
5
+ s as S,
6
+ _ as a
7
+ };
@@ -0,0 +1 @@
1
+ "use strict";const _="#styles:",E="#slots:",s="#i18n",T="__ADD_BLOCK_INTERNAL_ROOT";exports.I18N_KEY=s;exports.ROOT_TEMP_KEY=T;exports.SLOT_KEY=E;exports.STYLES_KEY=_;
@@ -0,0 +1,113 @@
1
+ import { j as e } from "./jsx-runtime-DGlMoOmv.js";
2
+ import c, { useMemo as w, Suspense as x } from "react";
3
+ import { B as p, a6 as C, a7 as S, a8 as y, a9 as k, aq as m, al as g } from "./context-menu-BbqLeYFX.js";
4
+ import { e as A, F as D, d as i, f as P, g as B, L as d, h as f, i as E } from "./index-CcLk7_o6.js";
5
+ import { useTranslation as v } from "react-i18next";
6
+ import { c as N } from "./iconBase-DHfFLkem.js";
7
+ import { EyeOpenIcon as L, ChevronDownIcon as M } from "@radix-ui/react-icons";
8
+ import { forEach as I, uniq as G, get as u, isEmpty as j, map as V } from "lodash-es";
9
+ import "@chaibuilder/runtime";
10
+ const F = () => {
11
+ const { savePage: r, saveState: t } = A(), { t: a } = v(), n = /* @__PURE__ */ e.jsxs(
12
+ p,
13
+ {
14
+ disabled: t === "SAVING",
15
+ onClick: (s) => {
16
+ s.preventDefault(), r();
17
+ },
18
+ className: N(
19
+ "flex h-auto w-fit items-center gap-x-2 p-1 px-2",
20
+ // UNSAVED sate
21
+ "bg-gray-200 text-gray-500 hover:bg-gray-100 dark:bg-gray-800 dark:text-gray-400",
22
+ {
23
+ "animate-pulse bg-gray-300 text-gray-900": t === "SAVING",
24
+ "bg-green-500 text-white hover:bg-green-600 hover:text-white dark:bg-green-600 dark:text-white": t === "SAVED"
25
+ }
26
+ ),
27
+ size: "sm",
28
+ variant: "outline",
29
+ children: [
30
+ /* @__PURE__ */ e.jsx(D, { className: "text-sm text-white" }),
31
+ /* @__PURE__ */ e.jsx("span", { className: "text-sm", children: a(t === "SAVING" ? "Saving" : t === "SAVED" ? "Saved" : "Unsaved") })
32
+ ]
33
+ }
34
+ );
35
+ return /* @__PURE__ */ e.jsx("div", { className: "flex items-center", children: n });
36
+ }, z = function() {
37
+ const t = i("previewComponent"), [, a] = P(), { t: n } = v();
38
+ return t ? /* @__PURE__ */ e.jsxs(
39
+ p,
40
+ {
41
+ onClick: (s) => {
42
+ s.preventDefault(), a(!0);
43
+ },
44
+ className: "flex h-auto w-fit items-center gap-x-2 p-1 px-2",
45
+ size: "sm",
46
+ variant: "outline",
47
+ children: [
48
+ /* @__PURE__ */ e.jsx(L, { className: "text-xs" }),
49
+ /* @__PURE__ */ e.jsx("span", { className: "text-sm", children: n("Preview") })
50
+ ]
51
+ }
52
+ ) : null;
53
+ }, T = () => {
54
+ const { fallbackLang: r, languages: t, selectedLang: a, setSelectedLang: n } = B(), s = (a == null ? void 0 : a.length) > 0 ? a : r, b = w(() => {
55
+ const l = [];
56
+ return I(G([r, ...t]), (o) => {
57
+ const h = u(d, o);
58
+ h && l.push({ key: o, value: h, default: o === r });
59
+ }), l;
60
+ }, [r, t]);
61
+ return j(t) && s === "en" ? null : j(t) && s !== "en" ? /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-x-1 text-sm text-blue-500 hover:text-blue-600", children: [
62
+ /* @__PURE__ */ e.jsx(f, { className: "h-4 w-4" }),
63
+ u(d, s)
64
+ ] }) : /* @__PURE__ */ e.jsxs(C, { children: [
65
+ /* @__PURE__ */ e.jsx(S, { asChild: !0, children: /* @__PURE__ */ e.jsxs(p, { size: "sm", variant: "outline", className: "flex items-center gap-x-1 text-blue-500 hover:text-blue-600", children: [
66
+ /* @__PURE__ */ e.jsx(f, { className: "h-4 w-4" }),
67
+ /* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-2", children: [
68
+ /* @__PURE__ */ e.jsxs("div", { children: [
69
+ " ",
70
+ u(d, s)
71
+ ] }),
72
+ /* @__PURE__ */ e.jsx(M, { className: "h-4 w-4" })
73
+ ] })
74
+ ] }) }),
75
+ /* @__PURE__ */ e.jsx(y, { className: "border-border", children: V(b, (l) => /* @__PURE__ */ e.jsxs(
76
+ k,
77
+ {
78
+ className: N(
79
+ "flex cursor-pointer items-center text-sm",
80
+ l.key === s && "!bg-blue-500 text-white hover:!text-white"
81
+ ),
82
+ onClick: () => n(l.key),
83
+ children: [
84
+ /* @__PURE__ */ e.jsx("div", { children: l.value }),
85
+ l.key === r ? /* @__PURE__ */ e.jsx(E, { className: "ml-2 h-4 w-4 text-yellow-400" }) : null
86
+ ]
87
+ }
88
+ )) })
89
+ ] });
90
+ }, W = () => {
91
+ const r = i("topBarComponents.left", []), t = i("topBarComponents.center", []), a = i("topBarComponents.right", []), n = i("editable", !0);
92
+ return /* @__PURE__ */ e.jsxs("div", { className: "flex h-14 items-center justify-between px-2", children: [
93
+ /* @__PURE__ */ e.jsx("div", { className: "flex items-center space-x-2", children: /* @__PURE__ */ e.jsx("div", { className: "flex items-center space-x-2 font-bold", children: c.Children.toArray(
94
+ r.map((s) => /* @__PURE__ */ e.jsx(x, { fallback: /* @__PURE__ */ e.jsx(m, { className: "h-10" }), children: /* @__PURE__ */ e.jsx(s, {}) }))
95
+ ) }) }),
96
+ /* @__PURE__ */ e.jsx("div", { className: "flex items-center space-x-2", children: c.Children.toArray(
97
+ t.map((s) => /* @__PURE__ */ e.jsx(x, { fallback: /* @__PURE__ */ e.jsx(m, { className: "h-10" }), children: /* @__PURE__ */ e.jsx(s, {}) }))
98
+ ) }),
99
+ /* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-1", children: [
100
+ /* @__PURE__ */ e.jsx(T, {}),
101
+ /* @__PURE__ */ e.jsx(g, { orientation: "vertical" }),
102
+ /* @__PURE__ */ e.jsx(z, {}),
103
+ /* @__PURE__ */ e.jsx(g, { orientation: "vertical" }),
104
+ n ? /* @__PURE__ */ e.jsx(F, {}) : null,
105
+ c.Children.toArray(
106
+ a.map((s) => /* @__PURE__ */ e.jsx(x, { fallback: /* @__PURE__ */ e.jsx(m, { className: "h-10" }), children: /* @__PURE__ */ e.jsx(s, {}) }))
107
+ )
108
+ ] })
109
+ ] });
110
+ };
111
+ export {
112
+ W as default
113
+ };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-BYECrxsp.cjs"),u=require("react"),x=require("./context-menu-DfAXjmc8.cjs"),s=require("./index-C9LOYt3W.cjs"),p=require("react-i18next"),j=require("./iconBase-Cn2BsTrq.cjs"),d=require("@radix-ui/react-icons"),a=require("lodash-es");require("@chaibuilder/runtime");const E=()=>{const{savePage:i,saveState:n}=s.useSavePage(),{t:r}=p.useTranslation(),o=e.jsxRuntimeExports.jsxs(x.Button,{disabled:n==="SAVING",onClick:t=>{t.preventDefault(),i()},className:j.cn("flex h-auto w-fit items-center gap-x-2 p-1 px-2","bg-gray-200 text-gray-500 hover:bg-gray-100 dark:bg-gray-800 dark:text-gray-400",{"animate-pulse bg-gray-300 text-gray-900":n==="SAVING","bg-green-500 text-white hover:bg-green-600 hover:text-white dark:bg-green-600 dark:text-white":n==="SAVED"}),size:"sm",variant:"outline",children:[e.jsxRuntimeExports.jsx(s.FaCheck,{className:"text-sm text-white"}),e.jsxRuntimeExports.jsx("span",{className:"text-sm",children:r(n==="SAVING"?"Saving":n==="SAVED"?"Saved":"Unsaved")})]});return e.jsxRuntimeExports.jsx("div",{className:"flex items-center",children:o})},g=function(){const n=s.useBuilderProp("previewComponent"),[,r]=s.usePreviewMode(),{t:o}=p.useTranslation();return n?e.jsxRuntimeExports.jsxs(x.Button,{onClick:t=>{t.preventDefault(),r(!0)},className:"flex h-auto w-fit items-center gap-x-2 p-1 px-2",size:"sm",variant:"outline",children:[e.jsxRuntimeExports.jsx(d.EyeOpenIcon,{className:"text-xs"}),e.jsxRuntimeExports.jsx("span",{className:"text-sm",children:o("Preview")})]}):null},v=()=>{const{fallbackLang:i,languages:n,selectedLang:r,setSelectedLang:o}=s.useLanguages(),t=(r==null?void 0:r.length)>0?r:i,h=u.useMemo(()=>{const l=[];return a.forEach(a.uniq([i,...n]),c=>{const m=a.get(s.LANGUAGES,c);m&&l.push({key:c,value:m,default:c===i})}),l},[i,n]);return a.isEmpty(n)&&t==="en"?null:a.isEmpty(n)&&t!=="en"?e.jsxRuntimeExports.jsxs("div",{className:"flex items-center gap-x-1 text-sm text-blue-500 hover:text-blue-600",children:[e.jsxRuntimeExports.jsx(s.FaLanguage,{className:"h-4 w-4"}),a.get(s.LANGUAGES,t)]}):e.jsxRuntimeExports.jsxs(x.DropdownMenu,{children:[e.jsxRuntimeExports.jsx(x.DropdownMenuTrigger,{asChild:!0,children:e.jsxRuntimeExports.jsxs(x.Button,{size:"sm",variant:"outline",className:"flex items-center gap-x-1 text-blue-500 hover:text-blue-600",children:[e.jsxRuntimeExports.jsx(s.FaLanguage,{className:"h-4 w-4"}),e.jsxRuntimeExports.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsxRuntimeExports.jsxs("div",{children:[" ",a.get(s.LANGUAGES,t)]}),e.jsxRuntimeExports.jsx(d.ChevronDownIcon,{className:"h-4 w-4"})]})]})}),e.jsxRuntimeExports.jsx(x.DropdownMenuContent,{className:"border-border",children:a.map(h,l=>e.jsxRuntimeExports.jsxs(x.DropdownMenuItem,{className:j.cn("flex cursor-pointer items-center text-sm",l.key===t&&"!bg-blue-500 text-white hover:!text-white"),onClick:()=>o(l.key),children:[e.jsxRuntimeExports.jsx("div",{children:l.value}),l.key===i?e.jsxRuntimeExports.jsx(s.FaStar,{className:"ml-2 h-4 w-4 text-yellow-400"}):null]}))})]})},R=()=>{const i=s.useBuilderProp("topBarComponents.left",[]),n=s.useBuilderProp("topBarComponents.center",[]),r=s.useBuilderProp("topBarComponents.right",[]),o=s.useBuilderProp("editable",!0);return e.jsxRuntimeExports.jsxs("div",{className:"flex h-14 items-center justify-between px-2",children:[e.jsxRuntimeExports.jsx("div",{className:"flex items-center space-x-2",children:e.jsxRuntimeExports.jsx("div",{className:"flex items-center space-x-2 font-bold",children:u.Children.toArray(i.map(t=>e.jsxRuntimeExports.jsx(u.Suspense,{fallback:e.jsxRuntimeExports.jsx(x.Skeleton,{className:"h-10"}),children:e.jsxRuntimeExports.jsx(t,{})})))})}),e.jsxRuntimeExports.jsx("div",{className:"flex items-center space-x-2",children:u.Children.toArray(n.map(t=>e.jsxRuntimeExports.jsx(u.Suspense,{fallback:e.jsxRuntimeExports.jsx(x.Skeleton,{className:"h-10"}),children:e.jsxRuntimeExports.jsx(t,{})})))}),e.jsxRuntimeExports.jsxs("div",{className:"flex items-center space-x-1",children:[e.jsxRuntimeExports.jsx(v,{}),e.jsxRuntimeExports.jsx(x.Separator,{orientation:"vertical"}),e.jsxRuntimeExports.jsx(g,{}),e.jsxRuntimeExports.jsx(x.Separator,{orientation:"vertical"}),o?e.jsxRuntimeExports.jsx(E,{}):null,u.Children.toArray(r.map(t=>e.jsxRuntimeExports.jsx(u.Suspense,{fallback:e.jsxRuntimeExports.jsx(x.Skeleton,{className:"h-10"}),children:e.jsxRuntimeExports.jsx(t,{})})))]})]})};exports.default=R;
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-BYECrxsp.cjs"),l=require("react"),p=require("lodash-es"),A=require("unsplash-js"),g=require("./context-menu-DfAXjmc8.cjs"),_=require("react-i18next"),v=require("./index-C9LOYt3W.cjs"),T=require("@react-hookz/web"),B=require("lucide-react"),b=async(h,f)=>new Promise((r,n)=>{A.createApi({accessKey:f}).search.getPhotos(h).then(o=>{r(o)}).catch(o=>n(o))}),L=({isModalView:h,onSelect:f})=>{const r=v.useBuilderProp("unsplashAccessKey",""),[n,j]=l.useState([]),[o,y]=l.useState(0),[i,w]=l.useState(),[c,k]=l.useState(),[C,E]=l.useState(0),[d,P]=T.useDebouncedState("",1e3),[m,u]=l.useState(!1),{t:R}=_.useTranslation(),I=async s=>{if(p.isEmpty(d))return;let a=o+1;u(!0),y(a);const x={query:d,page:a};i&&(x.orientation=i),c&&(x.color=c),b(x,r).then(t=>{var N,q,S;j(a===1?((N=t==null?void 0:t.response)==null?void 0:N.results)||[]:[...n,...((q=t==null?void 0:t.response)==null?void 0:q.results)||[]]),E((S=t==null?void 0:t.response)==null?void 0:S.total_pages),u(!1)}).catch(()=>{u(!1)})};return l.useEffect(()=>{if(!p.isEmpty(d)&&r){u(!0);const s={query:d,page:1};i&&(s.orientation=i),c&&(s.color=c),y(1),b(s,r).then(a=>{var x,t;j(((x=a==null?void 0:a.response)==null?void 0:x.results)||[]),E((t=a==null?void 0:a.response)==null?void 0:t.total_pages),u(!1)}).catch(()=>{u(!1)})}},[i,c,d,r]),p.isEmpty(r)?e.jsxRuntimeExports.jsx("div",{className:"flex h-full 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:"px-1 underline 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 gap-x-2 rounded-md border border-border bg-background p-px",children:[e.jsxRuntimeExports.jsx(g.Input,{type:"text",name:"query",className:"text-foreground",placeholder:'Try "dog" or "apple"',onChange:s=>P(s.target.value)}),e.jsxRuntimeExports.jsx("div",{children:e.jsxRuntimeExports.jsx(v.ChaiSelect,{className:"w-40",placeholder:R("Orientation"),options:[{value:"",label:"All"},{value:"landscape",label:"Landscape"},{value:"portrait",label:"Portrait"},{value:"squarish",label:"Square"}],defaultValue:i,onValueChange:s=>w(s)})}),e.jsxRuntimeExports.jsx("div",{children:e.jsxRuntimeExports.jsx(v.ChaiSelect,{placeholder:R("Color"),options:[{value:"",label:"All"},{value:"black_and_white",label:"Black and White"},{value:"black",label:"Black"},{value:"white",label:"White"},{value:"night",label:"Night"},{value:"warm",label:"Warm"},{value:"cool",label:"Cool"},{value:"sepia",label:"Sepia"}],defaultValue:c,onValueChange:s=>k(s)})})]}),e.jsxRuntimeExports.jsxs(g.ScrollArea,{className:`h-full ${h&&!p.isEmpty(n)?"-mx-2 flex flex-wrap px-2":"-mx-2 flex flex-col pb-8 pt-2"}`,children:[p.isEmpty(n)&&!m&&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"})]}),h?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:()=>f(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)),m&&e.jsxRuntimeExports.jsxs("div",{className:"flex items-center justify-center py-8",children:[e.jsxRuntimeExports.jsx(B.Loader,{className:"h-6 w-6 animate-spin"}),"  Loading..."]}),!p.isEmpty(n)&&o<C&&!m&&e.jsxRuntimeExports.jsx(g.Button,{size:"sm",variant:"link",className:"w-full",onClick:()=>I(),disabled:m,children:m?"":"Load More"})]})]})};exports.default=L;exports.fetchImage=b;
@@ -0,0 +1,189 @@
1
+ import { j as e } from "./jsx-runtime-DGlMoOmv.js";
2
+ import { useState as m, useEffect as q } from "react";
3
+ import { isEmpty as p } from "lodash-es";
4
+ import { createApi as B } from "unsplash-js";
5
+ import { I as E, S as L, B as T } from "./context-menu-BbqLeYFX.js";
6
+ import { useTranslation as D } from "react-i18next";
7
+ import { d as F, C as k } from "./index-CcLk7_o6.js";
8
+ import { useDebouncedState as K } from "@react-hookz/web";
9
+ import { Loader as U } from "lucide-react";
10
+ const C = async (x, g) => new Promise((t, o) => {
11
+ B({ accessKey: g }).search.getPhotos(x).then((n) => {
12
+ t(n);
13
+ }).catch((n) => o(n));
14
+ }), J = ({ isModalView: x, onSelect: g }) => {
15
+ const t = F("unsplashAccessKey", ""), [o, f] = m([]), [n, v] = m(0), [r, P] = m(), [i, A] = m(), [I, b] = m(0), [h, S] = K("", 1e3), [u, c] = m(!1), { t: j } = D(), _ = async (a) => {
16
+ if (p(h)) return;
17
+ let l = n + 1;
18
+ c(!0), v(l);
19
+ const d = { query: h, page: l };
20
+ r && (d.orientation = r), i && (d.color = i), C(d, t).then((s) => {
21
+ var y, N, w;
22
+ f(l === 1 ? ((y = s == null ? void 0 : s.response) == null ? void 0 : y.results) || [] : [...o, ...((N = s == null ? void 0 : s.response) == null ? void 0 : N.results) || []]), b((w = s == null ? void 0 : s.response) == null ? void 0 : w.total_pages), c(!1);
23
+ }).catch(() => {
24
+ c(!1);
25
+ });
26
+ };
27
+ return q(() => {
28
+ if (!p(h) && t) {
29
+ c(!0);
30
+ const a = { query: h, page: 1 };
31
+ r && (a.orientation = r), i && (a.color = i), v(1), C(a, t).then((l) => {
32
+ var d, s;
33
+ f(((d = l == null ? void 0 : l.response) == null ? void 0 : d.results) || []), b((s = l == null ? void 0 : l.response) == null ? void 0 : s.total_pages), c(!1);
34
+ }).catch(() => {
35
+ c(!1);
36
+ });
37
+ }
38
+ }, [r, i, h, t]), p(t) ? /* @__PURE__ */ e.jsx("div", { className: "flex h-full flex-col items-center justify-center", children: /* @__PURE__ */ e.jsxs("p", { className: "max-w-3xl text-center text-gray-500", children: [
39
+ "To enable Unsplash, kindly provide your",
40
+ /* @__PURE__ */ e.jsx(
41
+ "a",
42
+ {
43
+ href: "https://unsplash.com/documentation#public-authentication",
44
+ className: "px-1 underline hover:text-blue-400",
45
+ target: "_blank",
46
+ rel: "noopener noreferrer",
47
+ children: "Unsplash Access Key"
48
+ }
49
+ )
50
+ ] }) }) : /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
51
+ /* @__PURE__ */ e.jsxs("form", { className: "flex items-center gap-x-2 rounded-md border border-border bg-background p-px", children: [
52
+ /* @__PURE__ */ e.jsx(
53
+ E,
54
+ {
55
+ type: "text",
56
+ name: "query",
57
+ className: "text-foreground",
58
+ placeholder: 'Try "dog" or "apple"',
59
+ onChange: (a) => S(a.target.value)
60
+ }
61
+ ),
62
+ /* @__PURE__ */ e.jsx("div", { children: /* @__PURE__ */ e.jsx(
63
+ k,
64
+ {
65
+ className: "w-40",
66
+ placeholder: j("Orientation"),
67
+ options: [
68
+ {
69
+ value: "",
70
+ label: "All"
71
+ },
72
+ {
73
+ value: "landscape",
74
+ label: "Landscape"
75
+ },
76
+ {
77
+ value: "portrait",
78
+ label: "Portrait"
79
+ },
80
+ {
81
+ value: "squarish",
82
+ label: "Square"
83
+ }
84
+ ],
85
+ defaultValue: r,
86
+ onValueChange: (a) => P(a)
87
+ }
88
+ ) }),
89
+ /* @__PURE__ */ e.jsx("div", { children: /* @__PURE__ */ e.jsx(
90
+ k,
91
+ {
92
+ placeholder: j("Color"),
93
+ options: [
94
+ {
95
+ value: "",
96
+ label: "All"
97
+ },
98
+ {
99
+ value: "black_and_white",
100
+ label: "Black and White"
101
+ },
102
+ {
103
+ value: "black",
104
+ label: "Black"
105
+ },
106
+ {
107
+ value: "white",
108
+ label: "White"
109
+ },
110
+ {
111
+ value: "night",
112
+ label: "Night"
113
+ },
114
+ {
115
+ value: "warm",
116
+ label: "Warm"
117
+ },
118
+ {
119
+ value: "cool",
120
+ label: "Cool"
121
+ },
122
+ {
123
+ value: "sepia",
124
+ label: "Sepia"
125
+ }
126
+ ],
127
+ defaultValue: i,
128
+ onValueChange: (a) => A(a)
129
+ }
130
+ ) })
131
+ ] }),
132
+ /* @__PURE__ */ e.jsxs(
133
+ L,
134
+ {
135
+ className: `h-full ${x && !p(o) ? "-mx-2 flex flex-wrap px-2" : "-mx-2 flex flex-col pb-8 pt-2"}`,
136
+ children: [
137
+ p(o) && !u && /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col items-center justify-center py-6", children: [
138
+ /* @__PURE__ */ e.jsx("div", { className: "font-medium", children: "No Data" }),
139
+ /* @__PURE__ */ e.jsx("div", { className: "text-sm text-gray-500", children: "Enter query and press enter" })
140
+ ] }),
141
+ x ? /* @__PURE__ */ e.jsx("div", { className: "h-full columns-5 py-2", children: o.map((a) => /* @__PURE__ */ e.jsx(
142
+ "div",
143
+ {
144
+ role: "button",
145
+ tabIndex: 0,
146
+ className: "my-1 flex",
147
+ onClick: () => g(a.urls.regular),
148
+ children: /* @__PURE__ */ e.jsx("div", { className: "relative overflow-hidden rounded-md bg-cover bg-no-repeat", children: /* @__PURE__ */ e.jsx(
149
+ "img",
150
+ {
151
+ className: "h-auto flex-1 cursor-pointer rounded-md transition duration-300 ease-in-out hover:scale-105",
152
+ alt: a.alt_description,
153
+ src: a.urls.small
154
+ }
155
+ ) })
156
+ },
157
+ a.id
158
+ )) }) : o.map((a) => /* @__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(
159
+ "img",
160
+ {
161
+ className: "h-auto cursor-pointer transition duration-300 ease-in-out hover:scale-105",
162
+ alt: a.alt_description,
163
+ src: a.urls.small
164
+ }
165
+ ) }) }, a.id)),
166
+ u && /* @__PURE__ */ e.jsxs("div", { className: "flex items-center justify-center py-8", children: [
167
+ /* @__PURE__ */ e.jsx(U, { className: "h-6 w-6 animate-spin" }),
168
+ "  Loading..."
169
+ ] }),
170
+ !p(o) && n < I && !u && /* @__PURE__ */ e.jsx(
171
+ T,
172
+ {
173
+ size: "sm",
174
+ variant: "link",
175
+ className: "w-full",
176
+ onClick: () => _(),
177
+ disabled: u,
178
+ children: u ? "" : "Load More"
179
+ }
180
+ )
181
+ ]
182
+ }
183
+ )
184
+ ] });
185
+ };
186
+ export {
187
+ J as default,
188
+ C as fetchImage
189
+ };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-BYECrxsp.cjs"),r=require("react"),i=require("lodash-es"),R=require("jotai"),w=require("./context-menu-DfAXjmc8.cjs"),k=require("react-i18next"),b=require("./index-C9LOYt3W.cjs"),E=require("lucide-react"),S=R.atom([]),q=({isModalView:l,onSelect:x})=>{const{t}=k.useTranslation(),d=b.useBuilderProp("uploadMediaCallback"),c=b.useBuilderProp("fetchMediaCallback"),[n,m]=R.useAtom(S),[y,p]=r.useState(!1),[j,h]=r.useState(!1),[,N]=r.useState(),[f,u]=r.useState("");r.useEffect(()=>{(async()=>{if(!c)return;h(!0);const s=await c();m(s||[]),h(!1)})()},[]);const v=s=>{var a,o;if(u(""),s&&((o=(a=s==null?void 0:s.target)==null?void 0:a.files)==null?void 0:o.length)>0){const g=s.target.files[0];g.type.startsWith("image")?I(g):u(t("Please select an image"))}},I=async s=>{if(d){p(!0);try{const{url:a}=await d(s);x(a),N(void 0);const o=await c();m(o)}catch(a){m([]),u((a==null?void 0:a.message)||"Something went wrong.")}p(!1)}};return e.jsxRuntimeExports.jsxs("div",{children:[e.jsxRuntimeExports.jsxs("label",{htmlFor:l?"upload-in-modal":"upload-in-panel",children:[e.jsxRuntimeExports.jsx("div",{className:"flex flex-col items-center rounded-lg",children:e.jsxRuntimeExports.jsxs("label",{htmlFor:"image-upload",className:"flex w-full cursor-pointer flex-col items-center justify-center rounded-lg border-2 border-dashed border-border",children:[e.jsxRuntimeExports.jsxs("div",{className:"flex flex-col items-center justify-center pb-6 pt-5",children:[e.jsxRuntimeExports.jsx(E.Upload,{className:"mb-3 h-10 w-10 text-gray-400"}),e.jsxRuntimeExports.jsx("p",{className:"mb-2 text-sm text-gray-500 dark:text-gray-400",children:e.jsxRuntimeExports.jsx("span",{className:"font-semibold",children:t("Click to upload")})}),e.jsxRuntimeExports.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400",children:t("SVG, PNG, JPG or GIF (Max. 2mb)")})]}),y?e.jsxRuntimeExports.jsxs("div",{className:"flex h-full w-full items-center justify-center",children:[e.jsxRuntimeExports.jsx(E.Loader,{className:"h-6 w-6 animate-spin"}),e.jsxRuntimeExports.jsx("span",{className:"ml-2 text-sm text-gray-500",children:t("Uploading...")})]}):null,f&&e.jsxRuntimeExports.jsx("p",{className:"pb-2 text-xs text-red-500",children:f||t("Something went wrong")})]})}),e.jsxRuntimeExports.jsx("input",{type:"file",id:"image-upload",accept:"image/*",hidden:!0,onChange:v})]}),e.jsxRuntimeExports.jsxs(w.ScrollArea,{className:`-mx-2 flex h-full flex-col pb-8 pt-2 ${l?"px-2":""} pt-2`,children:[i.isEmpty(n)&&j&&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:t("Fetching...")})}),i.isEmpty(n)&&!j&&e.jsxRuntimeExports.jsxs("div",{className:"flex h-full flex-col items-center justify-center text-center",children:[e.jsxRuntimeExports.jsx("div",{className:"mb-4 h-12 rounded-full p-6"}),e.jsxRuntimeExports.jsx("h3",{className:"mb-2 text-sm font-semibold",children:t("No images found")}),e.jsxRuntimeExports.jsx("p",{className:"mb-4 max-w-sm text-muted-foreground",children:t("It looks like you haven't uploaded any images yet. Start by clicking the upload button above.")})]}),l?e.jsxRuntimeExports.jsx("div",{className:"h-full columns-5 py-2",children:i.map(n,s=>e.jsxRuntimeExports.jsx("div",{role:"button",tabIndex:0,className:"my-1 flex",onClick:()=>x(s.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:s.name,src:s.thumbUrl})})},s.id))}):i.map(n,s=>e.jsxRuntimeExports.jsx("div",{role:"button",tabIndex:0,className:"px-2 py-1",onClick:()=>x(s.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:s.name,src:s.url})})},s.id))]})]})};exports.default=q;
@@ -0,0 +1,101 @@
1
+ import { j as e } from "./jsx-runtime-DGlMoOmv.js";
2
+ import { useState as n, useEffect as k } from "react";
3
+ import { isEmpty as j, map as b } from "lodash-es";
4
+ import { atom as F, useAtom as U } from "jotai";
5
+ import { S as C } from "./context-menu-BbqLeYFX.js";
6
+ import { useTranslation as S } from "react-i18next";
7
+ import { d as N } from "./index-CcLk7_o6.js";
8
+ import { Upload as E, Loader as G } from "lucide-react";
9
+ const P = F([]), $ = ({ isModalView: l, onSelect: i }) => {
10
+ const { t } = S(), u = N("uploadMediaCallback"), d = N("fetchMediaCallback"), [r, c] = U(P), [y, x] = n(!1), [f, p] = n(!1), [, v] = n(), [h, m] = n("");
11
+ k(() => {
12
+ (async () => {
13
+ if (!d) return;
14
+ p(!0);
15
+ const s = await d();
16
+ c(s || []), p(!1);
17
+ })();
18
+ }, []);
19
+ const w = (s) => {
20
+ var a, o;
21
+ if (m(""), s && ((o = (a = s == null ? void 0 : s.target) == null ? void 0 : a.files) == null ? void 0 : o.length) > 0) {
22
+ const g = s.target.files[0];
23
+ g.type.startsWith("image") ? I(g) : m(t("Please select an image"));
24
+ }
25
+ }, I = async (s) => {
26
+ if (u) {
27
+ x(!0);
28
+ try {
29
+ const { url: a } = await u(s);
30
+ i(a), v(void 0);
31
+ const o = await d();
32
+ c(o);
33
+ } catch (a) {
34
+ c([]), m((a == null ? void 0 : a.message) || "Something went wrong.");
35
+ }
36
+ x(!1);
37
+ }
38
+ };
39
+ return /* @__PURE__ */ e.jsxs("div", { children: [
40
+ /* @__PURE__ */ e.jsxs("label", { htmlFor: l ? "upload-in-modal" : "upload-in-panel", children: [
41
+ /* @__PURE__ */ e.jsx("div", { className: "flex flex-col items-center rounded-lg", children: /* @__PURE__ */ e.jsxs(
42
+ "label",
43
+ {
44
+ htmlFor: "image-upload",
45
+ className: "flex w-full cursor-pointer flex-col items-center justify-center rounded-lg border-2 border-dashed border-border",
46
+ children: [
47
+ /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col items-center justify-center pb-6 pt-5", children: [
48
+ /* @__PURE__ */ e.jsx(E, { className: "mb-3 h-10 w-10 text-gray-400" }),
49
+ /* @__PURE__ */ e.jsx("p", { className: "mb-2 text-sm text-gray-500 dark:text-gray-400", children: /* @__PURE__ */ e.jsx("span", { className: "font-semibold", children: t("Click to upload") }) }),
50
+ /* @__PURE__ */ e.jsx("p", { className: "text-xs text-gray-500 dark:text-gray-400", children: t("SVG, PNG, JPG or GIF (Max. 2mb)") })
51
+ ] }),
52
+ y ? /* @__PURE__ */ e.jsxs("div", { className: "flex h-full w-full items-center justify-center", children: [
53
+ /* @__PURE__ */ e.jsx(G, { className: "h-6 w-6 animate-spin" }),
54
+ /* @__PURE__ */ e.jsx("span", { className: "ml-2 text-sm text-gray-500", children: t("Uploading...") })
55
+ ] }) : null,
56
+ h && /* @__PURE__ */ e.jsx("p", { className: "pb-2 text-xs text-red-500", children: h || t("Something went wrong") })
57
+ ]
58
+ }
59
+ ) }),
60
+ /* @__PURE__ */ e.jsx(
61
+ "input",
62
+ {
63
+ type: "file",
64
+ id: "image-upload",
65
+ accept: "image/*",
66
+ hidden: !0,
67
+ onChange: w
68
+ }
69
+ )
70
+ ] }),
71
+ /* @__PURE__ */ e.jsxs(C, { className: `-mx-2 flex h-full flex-col pb-8 pt-2 ${l ? "px-2" : ""} pt-2`, children: [
72
+ j(r) && f && /* @__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: t("Fetching...") }) }),
73
+ j(r) && !f && /* @__PURE__ */ e.jsxs("div", { className: "flex h-full flex-col items-center justify-center text-center", children: [
74
+ /* @__PURE__ */ e.jsx("div", { className: "mb-4 h-12 rounded-full p-6" }),
75
+ /* @__PURE__ */ e.jsx("h3", { className: "mb-2 text-sm font-semibold", children: t("No images found") }),
76
+ /* @__PURE__ */ e.jsx("p", { className: "mb-4 max-w-sm text-muted-foreground", children: t("It looks like you haven't uploaded any images yet. Start by clicking the upload button above.") })
77
+ ] }),
78
+ l ? /* @__PURE__ */ e.jsx("div", { className: "h-full columns-5 py-2", children: b(r, (s) => /* @__PURE__ */ e.jsx("div", { role: "button", tabIndex: 0, className: "my-1 flex", onClick: () => i(s.url), children: /* @__PURE__ */ e.jsx("div", { className: "relative overflow-hidden rounded-md bg-cover bg-no-repeat", children: /* @__PURE__ */ e.jsx(
79
+ "img",
80
+ {
81
+ className: "h-auto flex-1 cursor-pointer rounded-md transition duration-300 ease-in-out hover:scale-105",
82
+ alt: s.name,
83
+ src: s.thumbUrl
84
+ }
85
+ ) }) }, s.id)) }) : b(r, (s) => (
86
+ // TODO: Drag and Drop Image to Canvas from Here use `pic.url` for image quality
87
+ /* @__PURE__ */ e.jsx("div", { role: "button", tabIndex: 0, className: "px-2 py-1", onClick: () => i(s.url), children: /* @__PURE__ */ e.jsx("div", { className: "relative overflow-hidden rounded-md bg-cover bg-no-repeat", children: /* @__PURE__ */ e.jsx(
88
+ "img",
89
+ {
90
+ className: "h-auto w-full cursor-pointer transition duration-300 ease-in-out hover:scale-105",
91
+ alt: s.name,
92
+ src: s.url
93
+ }
94
+ ) }) }, s.id)
95
+ ))
96
+ ] })
97
+ ] });
98
+ };
99
+ export {
100
+ $ as default
101
+ };