@chaibuilder/sdk 1.2.99 → 1.2.100

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.
@@ -1,9 +1,9 @@
1
1
  import { j as t } from "./jsx-runtime-Sp0orL4X.js";
2
2
  import k from "@monaco-editor/react";
3
- import { B as C } from "./context-menu-9cWJcKdh.js";
3
+ import { B as C } from "./context-menu-YGd09SE1.js";
4
4
  import { useTranslation as j } from "react-i18next";
5
5
  import { useState as l, useCallback as v, useEffect as g } from "react";
6
- import { u as y, a as N, b as T, c as E } from "./index-ypVXAZEr.js";
6
+ import { u as y, a as N, b as T, c as E } from "./index-jfezM1fH.js";
7
7
  import { Cross2Icon as w } from "@radix-ui/react-icons";
8
8
  import { useThrottledCallback as B } from "@react-hookz/web";
9
9
  import "@radix-ui/react-switch";
@@ -28,12 +28,12 @@ import "clsx";
28
28
  import "tailwind-merge";
29
29
  import "lodash-es";
30
30
  import "jotai";
31
- import "./iconBase-RFUjwZUN.js";
31
+ import "./iconBase-Ief2hJUZ.js";
32
32
  import "@chaibuilder/runtime";
33
33
  import "./plugin-ooqqxWRQ.js";
34
34
  import "tree-model";
35
35
  import "react-quill";
36
- import "./STRINGS-TDN5UhWi.js";
36
+ import "./STRINGS-Xxstm-7I.js";
37
37
  import "flagged";
38
38
  import "react-hotkeys-hook";
39
39
  import "@floating-ui/dom";
@@ -51,6 +51,7 @@ import "re-resizable";
51
51
  import "lucide-react";
52
52
  import "@rjsf/validator-ajv8";
53
53
  import "@rjsf/core";
54
+ import "./controls-lEwMTdPQ.js";
54
55
  import "react-arborist";
55
56
  import "himalaya";
56
57
  import "react-icons-picker";
@@ -62,7 +63,7 @@ const a = (r) => {
62
63
  const i = document.createElement("div");
63
64
  return i.innerHTML = r, i.innerHTML;
64
65
  };
65
- function Rt() {
66
+ function St() {
66
67
  const { t: r } = j(), [i, n] = l(!1), [m, c] = l(""), [o, s] = y(), [p] = N(), d = T(), u = E(), f = B(
67
68
  (e) => {
68
69
  const b = a(e);
@@ -125,5 +126,5 @@ function Rt() {
125
126
  ] });
126
127
  }
127
128
  export {
128
- Rt as default
129
+ St as default
129
130
  };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-JYMCiFoE.cjs"),b=require("@monaco-editor/react"),k=require("./context-menu-sQn7ryJ6.cjs"),C=require("react-i18next"),u=require("react"),n=require("./index-EyRQyWtP.cjs"),E=require("@radix-ui/react-icons"),R=require("@react-hookz/web");require("@radix-ui/react-switch");require("@radix-ui/react-accordion");require("class-variance-authority");require("@radix-ui/react-alert-dialog");require("@radix-ui/react-slot");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-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-dialog");require("@radix-ui/react-context-menu");require("clsx");require("tailwind-merge");require("lodash-es");require("jotai");require("./iconBase-aZzpqff_.cjs");require("@chaibuilder/runtime");require("./plugin-KIpT3NWi.cjs");require("tree-model");require("react-quill");require("./STRINGS-Yl7cSWDc.cjs");require("flagged");require("react-hotkeys-hook");require("@floating-ui/dom");require("@floating-ui/react-dom");require("react-event-hook");require("@tailwindcss/typography");require("@tailwindcss/forms");require("@tailwindcss/aspect-ratio");require("tailwindcss-palette-generator");require("react-wrap-balancer");require("react-dom");require("prop-types");require("react-error-boundary");require("re-resizable");require("lucide-react");require("@rjsf/validator-ajv8");require("@rjsf/core");require("./controls-p9IwFnPx.cjs");require("react-arborist");require("himalaya");require("react-icons-picker");require("react-autosuggest");require("fuse.js");require("i18next");require("framer-motion");const a=s=>{const i=document.createElement("div");return i.innerHTML=s,i.innerHTML};function g(){const{t:s}=C.useTranslation(),[i,q]=u.useState(!1),[l,d]=u.useState(""),[r,o]=n.useCodeEditor(),[c]=n.useSelectedBlockIds(),x=n.useUpdateBlocksProps(),m=n.useUpdateBlocksPropsRealtime(),p=R.useThrottledCallback(t=>{const h=a(t);m([r.blockId],{[r.blockProp]:h})},[],300),j=u.useCallback(()=>{if(i){const t=a(l);x([r.blockId],{[r.blockProp]:t})}},[i,l]);u.useEffect(()=>{c.includes(r==null?void 0:r.blockId)||(j(),o(null))},[c]);const f=()=>{o(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:f,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:s("HTML Code Editor |")}),e.jsxRuntimeExports.jsx("span",{className:"text-xs text-gray-400",children:s("Scripts will be only executed in preview and live mode.")})]}),e.jsxRuntimeExports.jsx("div",{className:"flex gap-x-2",children:e.jsxRuntimeExports.jsx(k.Button,{onClick:()=>o(null),size:"sm",variant:"destructive",className:"h-6 w-fit",children:e.jsxRuntimeExports.jsx(E.Cross2Icon,{})})})]}),e.jsxRuntimeExports.jsx(b,{onMount:t=>{t.setValue(r.initialCode)},onChange:t=>{q(!0),d(t),p(t)},height:"100%",defaultLanguage:"html",theme:"vs-dark",defaultValue:"",options:{minimap:{enabled:!1}}})]})]})}exports.default=g;
@@ -2,6 +2,6 @@ const s = "#styles:", _ = "#slots:", t = "#i18n", E = "__ADD_BLOCK_INTERNAL_ROOT
2
2
  export {
3
3
  t as I,
4
4
  E as R,
5
- _ as S,
6
- s as a
5
+ s as S,
6
+ _ as a
7
7
  };
@@ -1,9 +1,9 @@
1
1
  import { j as t } from "./jsx-runtime-Sp0orL4X.js";
2
2
  import m, { Suspense as p } from "react";
3
- import { B as c, S as n, ac as x } from "./context-menu-9cWJcKdh.js";
4
- import { d, F as h, e as o, f } from "./index-ypVXAZEr.js";
5
- import { useTranslation as l } from "react-i18next";
6
- import { c as u } from "./iconBase-RFUjwZUN.js";
3
+ import { B as l, a as n, b as x } from "./context-menu-YGd09SE1.js";
4
+ import { e as d, F as h, d as s, f } from "./index-jfezM1fH.js";
5
+ import { useTranslation as c } from "react-i18next";
6
+ import { c as u } from "./iconBase-Ief2hJUZ.js";
7
7
  import { EyeOpenIcon as v } from "@radix-ui/react-icons";
8
8
  import "@radix-ui/react-switch";
9
9
  import "@radix-ui/react-accordion";
@@ -32,7 +32,7 @@ import "./plugin-ooqqxWRQ.js";
32
32
  import "@react-hookz/web";
33
33
  import "tree-model";
34
34
  import "react-quill";
35
- import "./STRINGS-TDN5UhWi.js";
35
+ import "./STRINGS-Xxstm-7I.js";
36
36
  import "flagged";
37
37
  import "react-hotkeys-hook";
38
38
  import "@floating-ui/dom";
@@ -50,6 +50,7 @@ import "re-resizable";
50
50
  import "lucide-react";
51
51
  import "@rjsf/validator-ajv8";
52
52
  import "@rjsf/core";
53
+ import "./controls-lEwMTdPQ.js";
53
54
  import "react-arborist";
54
55
  import "himalaya";
55
56
  import "react-icons-picker";
@@ -58,8 +59,8 @@ import "fuse.js";
58
59
  import "i18next";
59
60
  import "framer-motion";
60
61
  const j = () => {
61
- const { savePage: a, saveState: e } = d(), { t: s } = l(), i = /* @__PURE__ */ t.jsxs(
62
- c,
62
+ const { savePage: a, saveState: e } = d(), { t: i } = c(), o = /* @__PURE__ */ t.jsxs(
63
+ l,
63
64
  {
64
65
  disabled: e === "SAVING",
65
66
  onClick: (r) => {
@@ -78,30 +79,30 @@ const j = () => {
78
79
  variant: "outline",
79
80
  children: [
80
81
  /* @__PURE__ */ t.jsx(h, { className: "text-sm text-white" }),
81
- /* @__PURE__ */ t.jsx("span", { className: "text-sm", children: s(e === "SAVING" ? "saving" : e === "SAVED" ? "saved" : "unsaved") })
82
+ /* @__PURE__ */ t.jsx("span", { className: "text-sm", children: i(e === "SAVING" ? "saving" : e === "SAVED" ? "saved" : "unsaved") })
82
83
  ]
83
84
  }
84
85
  );
85
- return /* @__PURE__ */ t.jsx("div", { className: "flex items-center", children: i });
86
+ return /* @__PURE__ */ t.jsx("div", { className: "flex items-center", children: o });
86
87
  }, g = function() {
87
- const e = o("previewComponent"), [, s] = f(), { t: i } = l();
88
+ const e = s("previewComponent"), [, i] = f(), { t: o } = c();
88
89
  return e ? /* @__PURE__ */ t.jsxs(
89
- c,
90
+ l,
90
91
  {
91
92
  onClick: (r) => {
92
- r.preventDefault(), s(!0);
93
+ r.preventDefault(), i(!0);
93
94
  },
94
95
  className: "flex h-auto w-fit items-center gap-x-2 p-1 px-2",
95
96
  size: "sm",
96
97
  variant: "outline",
97
98
  children: [
98
99
  /* @__PURE__ */ t.jsx(v, { className: "text-xs" }),
99
- /* @__PURE__ */ t.jsx("span", { className: "text-sm", children: i("preview") })
100
+ /* @__PURE__ */ t.jsx("span", { className: "text-sm", children: o("preview") })
100
101
  ]
101
102
  }
102
103
  ) : null;
103
104
  }, St = () => {
104
- const a = o("topBarComponents.left", []), e = o("topBarComponents.center", []), s = o("topBarComponents.right", []), i = o("editable", !0);
105
+ const a = s("topBarComponents.left", []), e = s("topBarComponents.center", []), i = s("topBarComponents.right", []), o = s("editable", !0);
105
106
  return /* @__PURE__ */ t.jsxs("div", { className: "flex h-14 items-center justify-between px-2", children: [
106
107
  /* @__PURE__ */ t.jsx("div", { className: "flex items-center space-x-2", children: /* @__PURE__ */ t.jsx("div", { className: "flex items-center space-x-2 font-bold", children: m.Children.toArray(
107
108
  a.map((r) => /* @__PURE__ */ t.jsx(p, { fallback: /* @__PURE__ */ t.jsx(n, { className: "h-10" }), children: /* @__PURE__ */ t.jsx(r, {}) }))
@@ -112,9 +113,9 @@ const j = () => {
112
113
  /* @__PURE__ */ t.jsxs("div", { className: "flex items-center space-x-1", children: [
113
114
  /* @__PURE__ */ t.jsx(g, {}),
114
115
  /* @__PURE__ */ t.jsx(x, { orientation: "vertical" }),
115
- i ? /* @__PURE__ */ t.jsx(j, {}) : null,
116
+ o ? /* @__PURE__ */ t.jsx(j, {}) : null,
116
117
  m.Children.toArray(
117
- s.map((r) => /* @__PURE__ */ t.jsx(p, { fallback: /* @__PURE__ */ t.jsx(n, { className: "h-10" }), children: /* @__PURE__ */ t.jsx(r, {}) }))
118
+ i.map((r) => /* @__PURE__ */ t.jsx(p, { fallback: /* @__PURE__ */ t.jsx(n, { className: "h-10" }), children: /* @__PURE__ */ t.jsx(r, {}) }))
118
119
  )
119
120
  ] })
120
121
  ] });
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-JYMCiFoE.cjs"),n=require("react"),u=require("./context-menu-sQn7ryJ6.cjs"),s=require("./index-EyRQyWtP.cjs"),x=require("react-i18next"),c=require("./iconBase-aZzpqff_.cjs"),l=require("@radix-ui/react-icons");require("@radix-ui/react-switch");require("@radix-ui/react-accordion");require("class-variance-authority");require("@radix-ui/react-alert-dialog");require("@radix-ui/react-slot");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-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-dialog");require("@radix-ui/react-context-menu");require("clsx");require("tailwind-merge");require("lodash-es");require("jotai");require("@chaibuilder/runtime");require("./plugin-KIpT3NWi.cjs");require("@react-hookz/web");require("tree-model");require("react-quill");require("./STRINGS-Yl7cSWDc.cjs");require("flagged");require("react-hotkeys-hook");require("@floating-ui/dom");require("@floating-ui/react-dom");require("react-event-hook");require("@tailwindcss/typography");require("@tailwindcss/forms");require("@tailwindcss/aspect-ratio");require("tailwindcss-palette-generator");require("react-wrap-balancer");require("react-dom");require("prop-types");require("react-error-boundary");require("re-resizable");require("lucide-react");require("@rjsf/validator-ajv8");require("@rjsf/core");require("./controls-p9IwFnPx.cjs");require("react-arborist");require("himalaya");require("react-icons-picker");require("react-autosuggest");require("fuse.js");require("i18next");require("framer-motion");const p=()=>{const{savePage:a,saveState:r}=s.useSavePage(),{t:i}=x.useTranslation(),o=e.jsxRuntimeExports.jsxs(u.Button,{disabled:r==="SAVING",onClick:t=>{t.preventDefault(),a()},className:c.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":r==="SAVING","bg-green-500 text-white hover:bg-green-600 hover:text-white dark:bg-green-600 dark:text-white":r==="SAVED"}),size:"sm",variant:"outline",children:[e.jsxRuntimeExports.jsx(s.FaCheck,{className:"text-sm text-white"}),e.jsxRuntimeExports.jsx("span",{className:"text-sm",children:i(r==="SAVING"?"saving":r==="SAVED"?"saved":"unsaved")})]});return e.jsxRuntimeExports.jsx("div",{className:"flex items-center",children:o})},m=function(){const r=s.useBuilderProp("previewComponent"),[,i]=s.usePreviewMode(),{t:o}=x.useTranslation();return r?e.jsxRuntimeExports.jsxs(u.Button,{onClick:t=>{t.preventDefault(),i(!0)},className:"flex h-auto w-fit items-center gap-x-2 p-1 px-2",size:"sm",variant:"outline",children:[e.jsxRuntimeExports.jsx(l.EyeOpenIcon,{className:"text-xs"}),e.jsxRuntimeExports.jsx("span",{className:"text-sm",children:o("preview")})]}):null},q=()=>{const a=s.useBuilderProp("topBarComponents.left",[]),r=s.useBuilderProp("topBarComponents.center",[]),i=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:n.Children.toArray(a.map(t=>e.jsxRuntimeExports.jsx(n.Suspense,{fallback:e.jsxRuntimeExports.jsx(u.Skeleton,{className:"h-10"}),children:e.jsxRuntimeExports.jsx(t,{})})))})}),e.jsxRuntimeExports.jsx("div",{className:"flex items-center space-x-2",children:n.Children.toArray(r.map(t=>e.jsxRuntimeExports.jsx(n.Suspense,{fallback:e.jsxRuntimeExports.jsx(u.Skeleton,{className:"h-10"}),children:e.jsxRuntimeExports.jsx(t,{})})))}),e.jsxRuntimeExports.jsxs("div",{className:"flex items-center space-x-1",children:[e.jsxRuntimeExports.jsx(m,{}),e.jsxRuntimeExports.jsx(u.Separator,{orientation:"vertical"}),o?e.jsxRuntimeExports.jsx(p,{}):null,n.Children.toArray(i.map(t=>e.jsxRuntimeExports.jsx(n.Suspense,{fallback:e.jsxRuntimeExports.jsx(u.Skeleton,{className:"h-10"}),children:e.jsxRuntimeExports.jsx(t,{})})))]})]})};exports.default=q;
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-JYMCiFoE.cjs"),n=require("react"),p=require("lodash-es"),A=require("unsplash-js"),f=require("./context-menu-sQn7ryJ6.cjs"),_=require("react-i18next"),g=require("./index-EyRQyWtP.cjs"),T=require("@react-hookz/web"),B=require("lucide-react");require("@radix-ui/react-switch");require("@radix-ui/react-accordion");require("@radix-ui/react-icons");require("class-variance-authority");require("@radix-ui/react-alert-dialog");require("@radix-ui/react-slot");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-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-dialog");require("@radix-ui/react-context-menu");require("clsx");require("tailwind-merge");require("jotai");require("./iconBase-aZzpqff_.cjs");require("@chaibuilder/runtime");require("./plugin-KIpT3NWi.cjs");require("tree-model");require("react-quill");require("./STRINGS-Yl7cSWDc.cjs");require("flagged");require("react-hotkeys-hook");require("@floating-ui/dom");require("@floating-ui/react-dom");require("react-event-hook");require("@tailwindcss/typography");require("@tailwindcss/forms");require("@tailwindcss/aspect-ratio");require("tailwindcss-palette-generator");require("react-wrap-balancer");require("react-dom");require("prop-types");require("react-error-boundary");require("re-resizable");require("@rjsf/validator-ajv8");require("@rjsf/core");require("./controls-p9IwFnPx.cjs");require("react-arborist");require("himalaya");require("react-icons-picker");require("react-autosuggest");require("fuse.js");require("i18next");require("framer-motion");const v=async(h,j)=>new Promise((i,a)=>{A.createApi({accessKey:j}).search.getPhotos(h).then(l=>{i(l)}).catch(l=>a(l))}),D=({isModalView:h,onSelect:j})=>{const i=g.useBuilderProp("unsplashAccessKey",""),[a,q]=n.useState([]),[l,b]=n.useState(0),[o,w]=n.useState(),[u,k]=n.useState(),[C,y]=n.useState(0),[d,P]=T.useDebouncedState("",1e3),[m,c]=n.useState(!1),{t:E}=_.useTranslation(),I=async r=>{if(p.isEmpty(d))return;let t=l+1;r&&(r.preventDefault(),t=1),c(!0),b(t);const x={query:d,page:t};o&&(x.orientation=o),u&&(x.color=u),v(x,i).then(s=>{var R,N,S;q(t===1?((R=s==null?void 0:s.response)==null?void 0:R.results)||[]:[...a,...((N=s==null?void 0:s.response)==null?void 0:N.results)||[]]),y((S=s==null?void 0:s.response)==null?void 0:S.total_pages),c(!1)}).catch(()=>{c(!1)})};return n.useEffect(()=>{if(!p.isEmpty(d)&&i){c(!0);const r={query:d,page:1};o&&(r.orientation=o),u&&(r.color=u),b(1),v(r,i).then(t=>{var x,s;q(((x=t==null?void 0:t.response)==null?void 0:x.results)||[]),y((s=t==null?void 0:t.response)==null?void 0:s.total_pages),c(!1)}).catch(()=>{c(!1)})}},[o,u,d,i]),p.isEmpty(i)?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(f.Input,{type:"text",name:"query",className:"text-foreground",placeholder:'Try "dog" or "apple"',onChange:r=>P(r.target.value)}),e.jsxRuntimeExports.jsx("div",{children:e.jsxRuntimeExports.jsx(g.ChaiSelect,{className:"w-40",placeholder:E("Orientation"),options:[{value:"",label:"All"},{value:"landscape",label:"Landscape"},{value:"portrait",label:"Portrait"},{value:"squarish",label:"Square"}],defaultValue:o,onValueChange:r=>w(r)})}),e.jsxRuntimeExports.jsx("div",{children:e.jsxRuntimeExports.jsx(g.ChaiSelect,{placeholder:E("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:u,onValueChange:r=>k(r)})})]}),e.jsxRuntimeExports.jsxs(f.ScrollArea,{className:`h-full ${h&&!p.isEmpty(a)?"-mx-2 flex flex-wrap px-2":"-mx-2 flex flex-col pb-8 pt-2"}`,children:[p.isEmpty(a)&&!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:a.map(r=>e.jsxRuntimeExports.jsx("div",{role:"button",tabIndex:0,className:"my-1 flex",onClick:()=>j(r.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:r.alt_description,src:r.urls.small})})},r.id))}):a.map(r=>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:r.alt_description,src:r.urls.small})})},r.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(a)&&l<C&&!m&&e.jsxRuntimeExports.jsx(f.Button,{size:"sm",variant:"link",className:"w-full",onClick:()=>I(void 0),disabled:m,children:m?"":"Load More"})]})]})};exports.default=D;exports.fetchImage=v;
@@ -1,12 +1,12 @@
1
1
  import { j as e } from "./jsx-runtime-Sp0orL4X.js";
2
- import { useState as c, useEffect as S } from "react";
2
+ import { useState as c, useEffect as q } from "react";
3
3
  import { isEmpty as d } from "lodash-es";
4
4
  import { createApi as B } from "unsplash-js";
5
- import { N as D, V as E, B as L } from "./context-menu-9cWJcKdh.js";
5
+ import { I as D, S as E, B as L } from "./context-menu-YGd09SE1.js";
6
6
  import { useTranslation as T } from "react-i18next";
7
- import { e as V, C as k } from "./index-ypVXAZEr.js";
8
- import { useDebouncedState as F } from "@react-hookz/web";
9
- import { Loader as K } from "lucide-react";
7
+ import { d as F, C as k } from "./index-jfezM1fH.js";
8
+ import { useDebouncedState as K } from "@react-hookz/web";
9
+ import { Loader as U } from "lucide-react";
10
10
  import "@radix-ui/react-switch";
11
11
  import "@radix-ui/react-accordion";
12
12
  import "@radix-ui/react-icons";
@@ -29,12 +29,12 @@ import "@radix-ui/react-context-menu";
29
29
  import "clsx";
30
30
  import "tailwind-merge";
31
31
  import "jotai";
32
- import "./iconBase-RFUjwZUN.js";
32
+ import "./iconBase-Ief2hJUZ.js";
33
33
  import "@chaibuilder/runtime";
34
34
  import "./plugin-ooqqxWRQ.js";
35
35
  import "tree-model";
36
36
  import "react-quill";
37
- import "./STRINGS-TDN5UhWi.js";
37
+ import "./STRINGS-Xxstm-7I.js";
38
38
  import "flagged";
39
39
  import "react-hotkeys-hook";
40
40
  import "@floating-ui/dom";
@@ -51,6 +51,7 @@ import "react-error-boundary";
51
51
  import "re-resizable";
52
52
  import "@rjsf/validator-ajv8";
53
53
  import "@rjsf/core";
54
+ import "./controls-lEwMTdPQ.js";
54
55
  import "react-arborist";
55
56
  import "himalaya";
56
57
  import "react-icons-picker";
@@ -62,8 +63,8 @@ const C = async (f, g) => new Promise((s, r) => {
62
63
  B({ accessKey: g }).search.getPhotos(f).then((i) => {
63
64
  s(i);
64
65
  }).catch((i) => r(i));
65
- }), $e = ({ isModalView: f, onSelect: g }) => {
66
- const s = V("unsplashAccessKey", ""), [r, x] = c([]), [i, v] = c(0), [l, P] = c(), [n, A] = c(), [_, b] = c(0), [h, q] = F("", 1e3), [u, m] = c(!1), { t: j } = T(), I = async (a) => {
66
+ }), Ge = ({ isModalView: f, onSelect: g }) => {
67
+ const s = F("unsplashAccessKey", ""), [r, x] = c([]), [i, v] = c(0), [l, P] = c(), [n, A] = c(), [I, b] = c(0), [h, S] = K("", 1e3), [u, m] = c(!1), { t: j } = T(), _ = async (a) => {
67
68
  if (d(h))
68
69
  return;
69
70
  let t = i + 1;
@@ -76,7 +77,7 @@ const C = async (f, g) => new Promise((s, r) => {
76
77
  m(!1);
77
78
  });
78
79
  };
79
- return S(() => {
80
+ return q(() => {
80
81
  if (!d(h) && s) {
81
82
  m(!0);
82
83
  const a = { query: h, page: 1 };
@@ -108,7 +109,7 @@ const C = async (f, g) => new Promise((s, r) => {
108
109
  name: "query",
109
110
  className: "text-foreground",
110
111
  placeholder: 'Try "dog" or "apple"',
111
- onChange: (a) => q(a.target.value)
112
+ onChange: (a) => S(a.target.value)
112
113
  }
113
114
  ),
114
115
  /* @__PURE__ */ e.jsx("div", { children: /* @__PURE__ */ e.jsx(
@@ -219,16 +220,16 @@ const C = async (f, g) => new Promise((s, r) => {
219
220
  ) }) }, a.id)
220
221
  )),
221
222
  u && /* @__PURE__ */ e.jsxs("div", { className: "flex items-center justify-center py-8", children: [
222
- /* @__PURE__ */ e.jsx(K, { className: "h-6 w-6 animate-spin" }),
223
+ /* @__PURE__ */ e.jsx(U, { className: "h-6 w-6 animate-spin" }),
223
224
  "  Loading..."
224
225
  ] }),
225
- !d(r) && i < _ && !u && /* @__PURE__ */ e.jsx(
226
+ !d(r) && i < I && !u && /* @__PURE__ */ e.jsx(
226
227
  L,
227
228
  {
228
229
  size: "sm",
229
230
  variant: "link",
230
231
  className: "w-full",
231
- onClick: () => I(void 0),
232
+ onClick: () => _(void 0),
232
233
  disabled: u,
233
234
  children: u ? "" : "Load More"
234
235
  }
@@ -239,6 +240,6 @@ const C = async (f, g) => new Promise((s, r) => {
239
240
  ] });
240
241
  };
241
242
  export {
242
- $e as default,
243
+ Ge as default,
243
244
  C as fetchImage
244
245
  };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-JYMCiFoE.cjs"),i=require("react"),n=require("lodash-es"),E=require("jotai"),I=require("./context-menu-sQn7ryJ6.cjs"),w=require("react-i18next"),g=require("./index-EyRQyWtP.cjs"),b=require("lucide-react");require("@radix-ui/react-switch");require("@radix-ui/react-accordion");require("@radix-ui/react-icons");require("class-variance-authority");require("@radix-ui/react-alert-dialog");require("@radix-ui/react-slot");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-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-dialog");require("@radix-ui/react-context-menu");require("clsx");require("tailwind-merge");require("./iconBase-aZzpqff_.cjs");require("@chaibuilder/runtime");require("./plugin-KIpT3NWi.cjs");require("@react-hookz/web");require("tree-model");require("react-quill");require("./STRINGS-Yl7cSWDc.cjs");require("flagged");require("react-hotkeys-hook");require("@floating-ui/dom");require("@floating-ui/react-dom");require("react-event-hook");require("@tailwindcss/typography");require("@tailwindcss/forms");require("@tailwindcss/aspect-ratio");require("tailwindcss-palette-generator");require("react-wrap-balancer");require("react-dom");require("prop-types");require("react-error-boundary");require("re-resizable");require("@rjsf/validator-ajv8");require("@rjsf/core");require("./controls-p9IwFnPx.cjs");require("react-arborist");require("himalaya");require("react-icons-picker");require("react-autosuggest");require("fuse.js");require("i18next");require("framer-motion");const k=E.atom([]),S=({isModalView:a,onSelect:o})=>{const{t:s}=w.useTranslation(),d=g.useBuilderProp("uploadMediaCallback"),x=g.useBuilderProp("fetchMediaCallback"),[u,c]=E.useAtom(k),[R,p]=i.useState(!1),[j,q]=i.useState(!1),[,y]=i.useState(),[h,m]=i.useState("");i.useEffect(()=>{(async()=>{if(!x)return;q(!0);const r=await x();c(r||[]),q(!1)})()},[]);const N=r=>{var t,l;if(m(""),r&&((l=(t=r==null?void 0:r.target)==null?void 0:t.files)==null?void 0:l.length)>0){const f=r.target.files[0];f.type.startsWith("image")?v(f):m(s("Please select an image"))}},v=async r=>{if(d){p(!0);try{const{url:t}=await d(r);o(t),y(void 0);const l=await x();c(l)}catch(t){c([]),m((t==null?void 0:t.message)||"Something went wrong.")}p(!1)}};return e.jsxRuntimeExports.jsxs("div",{children:[e.jsxRuntimeExports.jsxs("label",{htmlFor:a?"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(b.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:s("Click to upload")})}),e.jsxRuntimeExports.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400",children:s("SVG, PNG, JPG or GIF (Max. 2mb)")})]}),R?e.jsxRuntimeExports.jsxs("div",{className:"flex h-full w-full items-center justify-center",children:[e.jsxRuntimeExports.jsx(b.Loader,{className:"h-6 w-6 animate-spin"}),e.jsxRuntimeExports.jsx("span",{className:"ml-2 text-sm text-gray-500",children:s("Uploading...")})]}):null,h&&e.jsxRuntimeExports.jsx("p",{className:"pb-2 text-xs text-red-500",children:h||s("Something went wrong")})]})}),e.jsxRuntimeExports.jsx("input",{type:"file",id:"image-upload",accept:"image/*",hidden:!0,onChange:N})]}),e.jsxRuntimeExports.jsxs(I.ScrollArea,{className:`-mx-2 flex h-full flex-col pb-8 pt-2 ${a?"px-2":""} pt-2`,children:[n.isEmpty(u)&&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:s("Fetching...")})}),n.isEmpty(u)&&!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:s("No images found")}),e.jsxRuntimeExports.jsx("p",{className:"mb-4 max-w-sm text-muted-foreground",children:s("It looks like you haven't uploaded any images yet. Start by clicking the upload button above.")})]}),a?e.jsxRuntimeExports.jsx("div",{className:"h-full columns-5 py-2",children:n.map(u,r=>e.jsxRuntimeExports.jsx("div",{role:"button",tabIndex:0,className:"my-1 flex",onClick:()=>o(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))}):n.map(u,r=>e.jsxRuntimeExports.jsx("div",{role:"button",tabIndex:0,className:"px-2 py-1",onClick:()=>o(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=S;
@@ -2,10 +2,10 @@ import { j as e } from "./jsx-runtime-Sp0orL4X.js";
2
2
  import { useState as l, useEffect as k } from "react";
3
3
  import { isEmpty as j, map as b } from "lodash-es";
4
4
  import { atom as F, useAtom as U } from "jotai";
5
- import { V as C } from "./context-menu-9cWJcKdh.js";
6
- import { useTranslation as E } from "react-i18next";
7
- import { e as N } from "./index-ypVXAZEr.js";
8
- import { Upload as G, Loader as P } from "lucide-react";
5
+ import { S as C } from "./context-menu-YGd09SE1.js";
6
+ import { useTranslation as S } from "react-i18next";
7
+ import { d as N } from "./index-jfezM1fH.js";
8
+ import { Upload as E, Loader as G } from "lucide-react";
9
9
  import "@radix-ui/react-switch";
10
10
  import "@radix-ui/react-accordion";
11
11
  import "@radix-ui/react-icons";
@@ -27,13 +27,13 @@ import "@radix-ui/react-dialog";
27
27
  import "@radix-ui/react-context-menu";
28
28
  import "clsx";
29
29
  import "tailwind-merge";
30
- import "./iconBase-RFUjwZUN.js";
30
+ import "./iconBase-Ief2hJUZ.js";
31
31
  import "@chaibuilder/runtime";
32
32
  import "./plugin-ooqqxWRQ.js";
33
33
  import "@react-hookz/web";
34
34
  import "tree-model";
35
35
  import "react-quill";
36
- import "./STRINGS-TDN5UhWi.js";
36
+ import "./STRINGS-Xxstm-7I.js";
37
37
  import "flagged";
38
38
  import "react-hotkeys-hook";
39
39
  import "@floating-ui/dom";
@@ -50,6 +50,7 @@ import "react-error-boundary";
50
50
  import "re-resizable";
51
51
  import "@rjsf/validator-ajv8";
52
52
  import "@rjsf/core";
53
+ import "./controls-lEwMTdPQ.js";
53
54
  import "react-arborist";
54
55
  import "himalaya";
55
56
  import "react-icons-picker";
@@ -57,8 +58,8 @@ import "react-autosuggest";
57
58
  import "fuse.js";
58
59
  import "i18next";
59
60
  import "framer-motion";
60
- const S = F([]), Re = ({ isModalView: s, onSelect: m }) => {
61
- const { t: r } = E(), c = N("uploadMediaCallback"), n = N("fetchMediaCallback"), [i, p] = U(S), [y, u] = l(!1), [x, f] = l(!1), [, v] = l(), [h, d] = l("");
61
+ const P = F([]), Te = ({ isModalView: s, onSelect: m }) => {
62
+ const { t: r } = S(), c = N("uploadMediaCallback"), n = N("fetchMediaCallback"), [i, p] = U(P), [y, u] = l(!1), [x, f] = l(!1), [, v] = l(), [h, d] = l("");
62
63
  k(() => {
63
64
  (async () => {
64
65
  if (!n)
@@ -97,12 +98,12 @@ const S = F([]), Re = ({ isModalView: s, onSelect: m }) => {
97
98
  className: "flex w-full cursor-pointer flex-col items-center justify-center rounded-lg border-2 border-dashed border-border",
98
99
  children: [
99
100
  /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col items-center justify-center pb-6 pt-5", children: [
100
- /* @__PURE__ */ e.jsx(G, { className: "mb-3 h-10 w-10 text-gray-400" }),
101
+ /* @__PURE__ */ e.jsx(E, { className: "mb-3 h-10 w-10 text-gray-400" }),
101
102
  /* @__PURE__ */ e.jsx("p", { className: "mb-2 text-sm text-gray-500 dark:text-gray-400", children: /* @__PURE__ */ e.jsx("span", { className: "font-semibold", children: r("Click to upload") }) }),
102
103
  /* @__PURE__ */ e.jsx("p", { className: "text-xs text-gray-500 dark:text-gray-400", children: r("SVG, PNG, JPG or GIF (Max. 2mb)") })
103
104
  ] }),
104
105
  y ? /* @__PURE__ */ e.jsxs("div", { className: "flex h-full w-full items-center justify-center", children: [
105
- /* @__PURE__ */ e.jsx(P, { className: "h-6 w-6 animate-spin" }),
106
+ /* @__PURE__ */ e.jsx(G, { className: "h-6 w-6 animate-spin" }),
106
107
  /* @__PURE__ */ e.jsx("span", { className: "ml-2 text-sm text-gray-500", children: r("Uploading...") })
107
108
  ] }) : null,
108
109
  h && /* @__PURE__ */ e.jsx("p", { className: "pb-2 text-xs text-red-500", children: h || r("Something went wrong") })
@@ -149,5 +150,5 @@ const S = F([]), Re = ({ isModalView: s, onSelect: m }) => {
149
150
  ] });
150
151
  };
151
152
  export {
152
- Re as default
153
+ Te as default
153
154
  };
@@ -871,49 +871,49 @@ wt.displayName = i.Separator.displayName;
871
871
  const vt = ({ className: e, ...t }) => /* @__PURE__ */ o.jsx("span", { className: s("ml-auto text-xs tracking-widest text-muted-foreground", e), ...t });
872
872
  vt.displayName = "ContextMenuShortcut";
873
873
  export {
874
- Mt as $,
875
- Ae as A,
874
+ Oe as $,
875
+ It as A,
876
876
  oe as B,
877
- aa as C,
877
+ he as C,
878
878
  xe as D,
879
- Me as E,
880
- ze as F,
881
- ae as G,
882
- It as H,
883
- se as I,
884
- re as J,
885
- de as K,
879
+ Re as E,
880
+ ve as F,
881
+ je as G,
882
+ Ce as H,
883
+ Te as I,
884
+ F as J,
885
+ _t as K,
886
886
  ke as L,
887
- ot as M,
888
- Te as N,
889
- Ot as O,
890
- Gt as P,
891
- Kt as Q,
892
- Qt as R,
893
- ea as S,
894
- Et as T,
895
- Ue as U,
896
- Ie as V,
897
- Qe as W,
898
- Xe as X,
899
- Xt as Y,
900
- qe as Z,
901
- Ye as _,
902
- oa as a,
903
- ie as a0,
904
- le as a1,
905
- me as a2,
906
- zt as a3,
907
- pe as a4,
908
- ce as a5,
909
- ue as a6,
910
- fe as a7,
911
- Je as a8,
912
- Ft as a9,
913
- at as aA,
914
- ta as aB,
915
- ft as aC,
916
- mt as aD,
887
+ Ae as M,
888
+ Me as N,
889
+ ze as O,
890
+ Et as P,
891
+ Vt as Q,
892
+ Pe as R,
893
+ Ie as S,
894
+ De as T,
895
+ Lt as U,
896
+ Ot as V,
897
+ Gt as W,
898
+ Ht as X,
899
+ _e as Y,
900
+ Ft as Z,
901
+ Bt as _,
902
+ ea as a,
903
+ Ut as a0,
904
+ qt as a1,
905
+ Jt as a2,
906
+ Le as a3,
907
+ Ee as a4,
908
+ Ve as a5,
909
+ Ge as a6,
910
+ He as a7,
911
+ Kt as a8,
912
+ Qt as a9,
913
+ aa as aA,
914
+ oa as aB,
915
+ gt as aC,
916
+ bt as aD,
917
917
  yt as aE,
918
918
  Nt as aF,
919
919
  ht as aG,
@@ -925,55 +925,55 @@ export {
925
925
  xt as aM,
926
926
  ut as aN,
927
927
  na as aO,
928
- Bt as aa,
929
- Oe as ab,
930
- $e as ac,
931
- At as ad,
932
- Ut as ae,
933
- Le as af,
934
- Jt as ag,
935
- Ee as ah,
936
- Ge as ai,
937
- Lt as aj,
938
- Zt as ak,
939
- s as al,
940
- I as am,
941
- ne as an,
942
- ve as ao,
943
- F as ap,
944
- qt as aq,
945
- Ve as ar,
946
- He as as,
947
- Ke as at,
948
- Yt as au,
949
- $t as av,
950
- Be as aw,
951
- Fe as ax,
952
- Wt as ay,
953
- tt as az,
954
- gt as b,
955
- bt as c,
956
- Vt as d,
957
- Pe as e,
958
- he as f,
959
- we as g,
960
- je as h,
961
- Ce as i,
962
- De as j,
963
- Re as k,
964
- Pt as l,
965
- H as m,
966
- ge as n,
967
- ye as o,
968
- Ne as p,
969
- be as q,
970
- Ht as r,
971
- _e as s,
972
- Q as t,
973
- nt as u,
974
- it as v,
975
- lt as w,
976
- ct as x,
977
- pt as y,
978
- _t as z
928
+ Ue as aa,
929
+ qe as ab,
930
+ Je as ac,
931
+ Ke as ad,
932
+ Qe as ae,
933
+ Xe as af,
934
+ Ye as ag,
935
+ Xt as ah,
936
+ Yt as ai,
937
+ $t as aj,
938
+ Be as ak,
939
+ Fe as al,
940
+ Wt as am,
941
+ tt as an,
942
+ ot as ao,
943
+ at as ap,
944
+ Zt as aq,
945
+ Q as ar,
946
+ ta as as,
947
+ nt as at,
948
+ it as au,
949
+ lt as av,
950
+ ct as aw,
951
+ pt as ax,
952
+ ft as ay,
953
+ mt as az,
954
+ $e as b,
955
+ s as c,
956
+ ae as d,
957
+ I as e,
958
+ se as f,
959
+ re as g,
960
+ de as h,
961
+ At as i,
962
+ ne as j,
963
+ Mt as k,
964
+ zt as l,
965
+ ie as m,
966
+ le as n,
967
+ ce as o,
968
+ me as p,
969
+ pe as q,
970
+ fe as r,
971
+ ue as s,
972
+ Pt as t,
973
+ H as u,
974
+ ge as v,
975
+ be as w,
976
+ ye as x,
977
+ Ne as y,
978
+ we as z
979
979
  };