@chaibuilder/sdk 1.2.26 → 1.2.27
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-S-4jzdWv.cjs +1 -0
- package/dist/{AddBlocks-l1JENNvq.js → AddBlocks-ksZjjn0k.js} +6 -7
- package/dist/BrandingOptions-EMCT0Wa3.cjs +1 -0
- package/dist/{BrandingOptions-udtH5yJs.js → BrandingOptions-T_kbQFQv.js} +5 -6
- package/dist/{CanvasArea-zme1r3Zi.cjs → CanvasArea-SDzbubar.cjs} +2 -2
- package/dist/{CanvasArea-h0W-Tyha.js → CanvasArea-rhOeubmu.js} +7 -8
- package/dist/{Class-lGzsNBOK.js → Class-3k8xjeiM.js} +1 -1
- package/dist/{Class-PoYusiA5.cjs → Class-MmCxz2Ay.cjs} +1 -1
- package/dist/{CurrentPage-tJUjXWdb.js → CurrentPage-0eeU1V_c.js} +8 -9
- package/dist/CurrentPage-aTjWjc3o.cjs +1 -0
- package/dist/{ListTree-cZ-Ihlt3.js → ListTree-Muu4rAtp.js} +8 -9
- package/dist/ListTree-SWsqdfcG.cjs +1 -0
- package/dist/MODIFIERS-9EwxLM8V.cjs +1 -0
- package/dist/{MODIFIERS-dytZ-osO.js → MODIFIERS-WQdaNvb8.js} +8 -4
- package/dist/PagesPanel-n3x-0ozR.cjs +1 -0
- package/dist/{PagesPanel-6rrLXEO-.js → PagesPanel-rYN28QpN.js} +8 -9
- package/dist/{ProjectPanel-tz3bjdXy.js → ProjectPanel-ivFOhdcz.js} +13 -14
- package/dist/ProjectPanel-pBePMOta.cjs +1 -0
- package/dist/Settings-JRyJayf5.cjs +1 -0
- package/dist/{Settings-4s2LUVmC.js → Settings-XWmKzRl9.js} +6 -7
- package/dist/SidePanels-BtUeo6M9.cjs +1 -0
- package/dist/{SidePanels-bugFfInz.js → SidePanels-ODktnGbC.js} +16 -17
- package/dist/Topbar-QMeD3hvq.cjs +1 -0
- package/dist/{Topbar-pWzBEOed.js → Topbar-Yunooh00.js} +5 -6
- package/dist/UnsplashImages-05JR8oIu.cjs +1 -0
- package/dist/{UnsplashImages-qvwFbV-E.js → UnsplashImages-QMl0bxix.js} +15 -16
- package/dist/UploadImages-OgSN1HVt.cjs +1 -0
- package/dist/{UploadImages-9NapgXBq.js → UploadImages-Si-A26bc.js} +10 -11
- package/dist/add-page-modal-9pTKItY-.cjs +1 -0
- package/dist/{add-page-modal-k2Kb92HS.js → add-page-modal-U7AUUrI1.js} +24 -25
- package/dist/confirm-alert-DhRc-Zcd.cjs +1 -0
- package/dist/{confirm-alert-GUhZ_G8w.js → confirm-alert-kV5-c70T.js} +5 -6
- package/dist/core.cjs +1 -1
- package/dist/core.js +46 -47
- package/dist/defaultTheme-7Lk2zq60.cjs +1 -0
- package/dist/{defaultTheme-D8B4-wHO.js → defaultTheme-gunU_Fe5.js} +1 -1
- package/dist/delete-page-modal-4s-6AIy4.cjs +1 -0
- package/dist/{delete-page-modal-zONvdebd.js → delete-page-modal-UCBpdjLe.js} +8 -9
- package/dist/email-blocks.cjs +1 -1
- package/dist/email-blocks.js +1 -1
- package/dist/email.cjs +1 -1
- package/dist/email.js +6 -7
- package/dist/{form-lBQ_76Uw.cjs → form-Ap63cNec.cjs} +1 -1
- package/dist/{form-STUz-6nE.js → form-zmlTjM9j.js} +1 -1
- package/dist/html-to-json-C_Eobs_d.cjs +1 -0
- package/dist/{html-to-json-ngX9ef2u.js → html-to-json-p__Fgqdg.js} +75 -50
- package/dist/{index-Gk6sASBd.js → index-CFUoB97-.js} +128 -129
- package/dist/index-F4AQQ6qq.cjs +1 -0
- package/dist/{index-mbyqq81O.cjs → index-Qk028f-N.cjs} +1 -1
- package/dist/{index-llTXLDGE.js → index-f0AbmoYY.js} +4 -4
- package/dist/{index-OB199Izc.cjs → index-l19JVVXI.cjs} +2 -2
- package/dist/{index-SkyM3d6Q.js → index-lOJfSheQ.js} +2 -2
- package/dist/lib.cjs +3 -3
- package/dist/lib.js +16 -17
- package/dist/page-viewer-YFrIG3L7.cjs +1 -0
- package/dist/{page-viewer-Pdg9F5Hv.js → page-viewer-jOwy--9A.js} +9 -10
- package/dist/{project-general-setting-f8Ebsn6K.js → project-general-setting-3N8HZ2fe.js} +9 -10
- package/dist/project-general-setting-hK7I7FuN.cjs +1 -0
- package/dist/{project-seo-setting-pX34Qsym.js → project-seo-setting-bSiNgO_1.js} +6 -7
- package/dist/project-seo-setting-x-FK0pez.cjs +1 -0
- package/dist/render.cjs +1 -1
- package/dist/render.js +13 -14
- package/dist/{single-page-detail-dpe5LT0M.js → single-page-detail--AZlZ-pC.js} +10 -11
- package/dist/single-page-detail-9abF2g2R.cjs +1 -0
- package/dist/studio.cjs +1 -1
- package/dist/studio.js +7 -8
- package/dist/ui.cjs +1 -1
- package/dist/ui.js +137 -138
- package/dist/web-blocks.cjs +1 -6
- package/dist/web-blocks.js +385 -486
- package/package.json +1 -1
- package/dist/AddBlocks-zPPKkeKs.cjs +0 -1
- package/dist/BrandingOptions-DkpqGARR.cjs +0 -1
- package/dist/CurrentPage-Hl52iub_.cjs +0 -1
- package/dist/ListTree-WvTjY5rr.cjs +0 -1
- package/dist/MODIFIERS-0g14w5RS.cjs +0 -1
- package/dist/PagesPanel-WzCocl6u.cjs +0 -1
- package/dist/ProjectPanel-o7gdcwPn.cjs +0 -1
- package/dist/STRINGS--j49GZJP.js +0 -7
- package/dist/STRINGS-gPz7CUOk.cjs +0 -1
- package/dist/Settings-AqoKwR92.cjs +0 -1
- package/dist/SidePanels-3o6Okmvu.cjs +0 -1
- package/dist/Topbar-CqW7G360.cjs +0 -1
- package/dist/UnsplashImages-NGskB93R.cjs +0 -1
- package/dist/UploadImages-Oh7Glr9A.cjs +0 -1
- package/dist/add-page-modal--6TTBRYa.cjs +0 -1
- package/dist/confirm-alert-C4M9eF-o.cjs +0 -1
- package/dist/defaultTheme-7VqqhOcp.cjs +0 -1
- package/dist/delete-page-modal-cFoL-wdo.cjs +0 -1
- package/dist/html-to-json-efmv1pCj.cjs +0 -1
- package/dist/index-h-hd6EvN.cjs +0 -1
- package/dist/page-viewer-2kwnKM6v.cjs +0 -1
- package/dist/project-general-setting-CnNL98NM.cjs +0 -1
- package/dist/project-seo-setting-mlxL_e2_.cjs +0 -1
- package/dist/single-page-detail-XfzrGlzA.cjs +0 -1
|
@@ -1,20 +1,19 @@
|
|
|
1
1
|
import { j as e } from "./jsx-runtime-WbnYoNE9.js";
|
|
2
2
|
import { KeyboardIcon as U, PlusIcon as J, Half2Icon as q } from "@radix-ui/react-icons";
|
|
3
|
-
import j, { useState as
|
|
3
|
+
import j, { useState as h, useEffect as W, useMemo as Y, lazy as w, Suspense as N } from "react";
|
|
4
4
|
import { useAtom as O } from "jotai";
|
|
5
5
|
import { filter as y, map as K, isNull as Z, find as $, isEmpty as G, each as Q, get as X } from "lodash-es";
|
|
6
|
-
import { ad as M, ae as H, af as F, ag as R, ah as ee, A as se, a as re, b as ae, c as le, d as ie, e as te, f as oe, g as ne, ai as ce, y as de, C as me, aj as xe, ak as
|
|
6
|
+
import { ad as M, ae as H, af as F, ag as R, ah as ee, A as se, a as re, b as ae, c as le, d as ie, e as te, f as oe, g as ne, ai as ce, y as de, C as me, aj as xe, ak as he, al as pe, am as ue, an as E, ao as fe, ap as je, aq as ve, B as v, ar as ge, as as B, h as T, at as be, S as z, au as V, av as I, aw as A, ax as S } from "./index-CFUoB97-.js";
|
|
7
7
|
import { ListTreeIcon as _, DatabaseIcon as Ne } from "lucide-react";
|
|
8
8
|
import { getChaiDataProviders as ye } from "@chaibuilder/runtime";
|
|
9
9
|
import { useTranslation as g } from "react-i18next";
|
|
10
10
|
import { J as we, a as ke, d as Ce } from "./index-e0c8PmRQ.js";
|
|
11
|
-
import { E as De } from "./index-
|
|
12
|
-
import { O as i } from "./
|
|
11
|
+
import { E as De } from "./index-lOJfSheQ.js";
|
|
12
|
+
import { O as i } from "./MODIFIERS-WQdaNvb8.js";
|
|
13
13
|
import { c as Te } from "./Functions-7jnEwJyw.js";
|
|
14
14
|
import "./_commonjsHelpers-UyOWmZb0.js";
|
|
15
15
|
import "@react-hookz/web";
|
|
16
|
-
import "./
|
|
17
|
-
import "./Class-lGzsNBOK.js";
|
|
16
|
+
import "./Class-3k8xjeiM.js";
|
|
18
17
|
import "clsx";
|
|
19
18
|
import "tailwind-merge";
|
|
20
19
|
import "@radix-ui/react-toggle";
|
|
@@ -45,9 +44,9 @@ import "@floating-ui/react-dom";
|
|
|
45
44
|
import "flagged";
|
|
46
45
|
import "react-hotkeys-hook";
|
|
47
46
|
const Ae = ({ provider: s, onClose: o }) => {
|
|
48
|
-
const { t: l } = g(), [a,
|
|
47
|
+
const { t: l } = g(), [a, p] = h(null);
|
|
49
48
|
return W(() => {
|
|
50
|
-
s && (s.mockFn ? s.mockFn : s.dataFn)().then((n) =>
|
|
49
|
+
s && (s.mockFn ? s.mockFn : s.dataFn)().then((n) => p(n));
|
|
51
50
|
}, [s]), s ? /* @__PURE__ */ e.jsx(M, { onOpenChange: (d) => d ? "" : o(), defaultOpen: !0, children: /* @__PURE__ */ e.jsxs(H, { children: [
|
|
52
51
|
/* @__PURE__ */ e.jsxs(F, { children: [
|
|
53
52
|
/* @__PURE__ */ e.jsxs(R, { children: [
|
|
@@ -98,16 +97,16 @@ function Se({
|
|
|
98
97
|
] });
|
|
99
98
|
}
|
|
100
99
|
const _e = () => {
|
|
101
|
-
const { t: s } = g(), o = Y(() => ye(), []), [l, a] = de(), [,
|
|
100
|
+
const { t: s } = g(), o = Y(() => ye(), []), [l, a] = de(), [, p] = O(me), [d, n] = h(
|
|
102
101
|
y(o, (r) => K(l, "providerKey").includes(r.providerKey))
|
|
103
|
-
), [k, u] =
|
|
102
|
+
), [k, u] = h(""), [b, c] = h(null), C = y(
|
|
104
103
|
o.map((r) => K(d, "providerKey").includes(r.providerKey) ? null : { value: r.providerKey, label: r.name }),
|
|
105
104
|
(r) => !Z(r)
|
|
106
105
|
), D = (r) => {
|
|
107
106
|
const x = $(o, { providerKey: r });
|
|
108
|
-
n((m) => [...m, x]), a((m) => [...m, { providerKey: x.providerKey, args: {} }]), u(""),
|
|
107
|
+
n((m) => [...m, x]), a((m) => [...m, { providerKey: x.providerKey, args: {} }]), u(""), p("UNSAVED");
|
|
109
108
|
}, t = (r) => {
|
|
110
|
-
n((x) => y(x, (m) => m.providerKey !== r.providerKey)), a((x) => y(x, (m) => m.providerKey !== r.providerKey)),
|
|
109
|
+
n((x) => y(x, (m) => m.providerKey !== r.providerKey)), a((x) => y(x, (m) => m.providerKey !== r.providerKey)), p("UNSAVED");
|
|
111
110
|
}, f = (r) => c(r);
|
|
112
111
|
return G(o) ? /* @__PURE__ */ e.jsx("div", { children: /* @__PURE__ */ e.jsxs("p", { className: "mb-1.5 p-4 text-xs text-gray-500", children: [
|
|
113
112
|
s("no_data_providers"),
|
|
@@ -117,7 +116,7 @@ const _e = () => {
|
|
|
117
116
|
/* @__PURE__ */ e.jsx("br", {}),
|
|
118
117
|
/* @__PURE__ */ e.jsx("label", { children: /* @__PURE__ */ e.jsx("p", { className: "mb-1.5 text-xs text-gray-500", children: s("add_data_providers") }) }),
|
|
119
118
|
/* @__PURE__ */ e.jsx("div", { className: "flex items-center space-x-1", children: /* @__PURE__ */ e.jsxs(xe, { value: k, onValueChange: (r) => D(r), children: [
|
|
120
|
-
/* @__PURE__ */ e.jsx(
|
|
119
|
+
/* @__PURE__ */ e.jsx(he, { className: "w-full", children: /* @__PURE__ */ e.jsx(pe, { placeholder: s("select_provider") }) }),
|
|
121
120
|
/* @__PURE__ */ e.jsxs(ue, { children: [
|
|
122
121
|
/* @__PURE__ */ e.jsx(E, { value: "", children: s("choose") }),
|
|
123
122
|
C.map((r) => /* @__PURE__ */ e.jsx(E, { value: r.value, children: r.label }, r.value))
|
|
@@ -230,10 +229,10 @@ const _e = () => {
|
|
|
230
229
|
] }) })
|
|
231
230
|
] })
|
|
232
231
|
] });
|
|
233
|
-
}, Ke = w(() => import("./AddBlocks-
|
|
232
|
+
}, Ke = w(() => import("./AddBlocks-ksZjjn0k.js")), P = w(() => import("./ListTree-Muu4rAtp.js")), Ee = w(() => import("./BrandingOptions-T_kbQFQv.js")), Be = w(() => import("./index-CFUoB97-.js").then((s) => s.cq));
|
|
234
233
|
let L = null;
|
|
235
|
-
const
|
|
236
|
-
const s = T("sideBarComponents.top", []), o = T("sideBarComponents.bottom", []), [l, a] = O(be), [
|
|
234
|
+
const Ds = () => {
|
|
235
|
+
const s = T("sideBarComponents.top", []), o = T("sideBarComponents.bottom", []), [l, a] = O(be), [p, d] = h(l), [n, k] = h(null), { t: u } = g(), b = {
|
|
237
236
|
"add-blocks": Ke,
|
|
238
237
|
[i]: P,
|
|
239
238
|
"branding-options": Ee,
|
|
@@ -379,5 +378,5 @@ const Ts = () => {
|
|
|
379
378
|
] });
|
|
380
379
|
};
|
|
381
380
|
export {
|
|
382
|
-
|
|
381
|
+
Ds as default
|
|
383
382
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("./jsx-runtime-Z_BpKhVy.cjs"),r=require("react"),h=require("@radix-ui/react-icons"),t=require("./index-F4AQQ6qq.cjs"),v=require("./index-ecnGWzh9.cjs"),i=require("react-i18next");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("lodash-es");require("./Functions-N3yhPYKY.cjs");require("clsx");require("tailwind-merge");require("@chaibuilder/runtime");require("jotai");require("./MODIFIERS-9EwxLM8V.cjs");require("@react-hookz/web");require("./Class-MmCxz2Ay.cjs");require("@radix-ui/react-toggle");require("class-variance-authority");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");const g=()=>t.useBuilderProp("languages",["en"]),H=()=>g().length===1?null:c.jsxRuntimeExports.jsx("div",{className:"flex items-center",children:c.jsxRuntimeExports.jsxs(t.Select,{children:[c.jsxRuntimeExports.jsx(t.SelectTrigger,{className:"w-[150px] border-0",children:c.jsxRuntimeExports.jsx(t.SelectValue,{placeholder:c.jsxRuntimeExports.jsxs("span",{className:"flex items-center",children:[c.jsxRuntimeExports.jsx(h.FontFamilyIcon,{className:"h-4 w-4"})," English(US)"]})})}),c.jsxRuntimeExports.jsx(t.SelectContent,{children:c.jsxRuntimeExports.jsxs(t.SelectGroup,{children:[c.jsxRuntimeExports.jsx(t.SelectLabel,{children:"Fruits"}),c.jsxRuntimeExports.jsx(t.SelectItem,{value:"apple",children:"Apple"}),c.jsxRuntimeExports.jsx(t.SelectItem,{value:"banana",children:"Banana"}),c.jsxRuntimeExports.jsx(t.SelectItem,{value:"blueberry",children:"Blueberry"}),c.jsxRuntimeExports.jsx(t.SelectItem,{value:"grapes",children:"Grapes"}),c.jsxRuntimeExports.jsx(t.SelectItem,{value:"pineapple",children:"Pineapple"})]})})]})});function V(l){return v.GenIcon({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM369 209L241 337c-9.4 9.4-24.6 9.4-33.9 0l-64-64c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0l47 47L335 175c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9z"}}]})(l)}const M=()=>{const{savePage:l,saveState:a}=t.useSavePage(),{t:s}=i.useTranslation(),e=t.useBuilderProp("hideSaveButton",!1),n=r.useMemo(()=>{switch(a){case"SAVING":return"animate-pulse bg-gray-300 text-gray-900";case"SAVED":return"bg-green-500 text-white hover:bg-green-600 hover:text-white";default:return"bg-gray-200 text-gray-500 hover:bg-gray-100"}},[a]);if(e)return null;const o=c.jsxRuntimeExports.jsxs(t.Button,{disabled:a==="SAVING",onClick:z=>{z.preventDefault(),l()},className:`flex h-auto w-fit items-center gap-x-2 rounded-full p-1.5 px-3 ${n}`,size:"sm",variant:"outline",children:[c.jsxRuntimeExports.jsx(V,{className:"text-lg"}),c.jsxRuntimeExports.jsx("span",{className:"text-sm",children:a==="SAVING"?"Saving...":s(a==="SAVED"?"Saved":"Unsaved")})]});return c.jsxRuntimeExports.jsx("div",{className:"flex items-center",children:o})},u=function(){const a=t.useBuilderProp("previewComponent"),[,s]=t.usePreviewMode(),{t:e}=i.useTranslation();return a?c.jsxRuntimeExports.jsxs(t.Button,{onClick:n=>{n.preventDefault(),s(!0)},className:"flex h-auto w-fit items-center gap-x-2 rounded-full bg-gray-200 px-3 py-1",size:"sm",variant:"outline",children:[c.jsxRuntimeExports.jsx(h.EyeOpenIcon,{className:"text-xs"}),c.jsxRuntimeExports.jsx("span",{className:"text-sm",children:e("Preview")})]}):null},d=()=>{const l=t.useBuilderProp("topBarComponents.left",[]),a=t.useBuilderProp("topBarComponents.center",[]),s=t.useBuilderProp("topBarComponents.right",[]),e=t.useBuilderProp("editable",!0);return c.jsxRuntimeExports.jsxs("div",{className:"flex h-14 items-center justify-between px-2",children:[c.jsxRuntimeExports.jsx("div",{className:"flex items-center space-x-2",children:c.jsxRuntimeExports.jsx("div",{className:"flex items-center space-x-2 font-bold",children:r.Children.toArray(l.map(n=>c.jsxRuntimeExports.jsx(r.Suspense,{fallback:c.jsxRuntimeExports.jsx(t.Skeleton,{className:"h-10"}),children:c.jsxRuntimeExports.jsx(n,{})})))})}),c.jsxRuntimeExports.jsx("div",{className:"flex items-center space-x-2",children:r.Children.toArray(a.map(n=>c.jsxRuntimeExports.jsx(r.Suspense,{fallback:c.jsxRuntimeExports.jsx(t.Skeleton,{className:"h-10"}),children:c.jsxRuntimeExports.jsx(n,{})})))}),c.jsxRuntimeExports.jsxs("div",{className:"flex items-center space-x-2",children:[c.jsxRuntimeExports.jsx(H,{}),c.jsxRuntimeExports.jsx(u,{}),c.jsxRuntimeExports.jsx(t.Separator,{orientation:"vertical"}),e?c.jsxRuntimeExports.jsx(M,{}):null,r.Children.toArray(s.map(n=>c.jsxRuntimeExports.jsx(r.Suspense,{fallback:c.jsxRuntimeExports.jsx(t.Skeleton,{className:"h-10"}),children:c.jsxRuntimeExports.jsx(n,{})})))]})]})};exports.default=d;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { j as c } from "./jsx-runtime-WbnYoNE9.js";
|
|
2
2
|
import z, { useMemo as o, Suspense as n } from "react";
|
|
3
3
|
import { FontFamilyIcon as M, EyeOpenIcon as u } from "@radix-ui/react-icons";
|
|
4
|
-
import { h as r, aj as d, ak as C, al as L, am as m, ay as p, az as F, an as i, z as w, B as g, q as B, S as v, aA as f } from "./index-
|
|
4
|
+
import { h as r, aj as d, ak as C, al as L, am as m, ay as p, az as F, an as i, z as w, B as g, q as B, S as v, aA as f } from "./index-CFUoB97-.js";
|
|
5
5
|
import { G as x } from "./index-YpnaudSM.js";
|
|
6
6
|
import { useTranslation as e } from "react-i18next";
|
|
7
7
|
import "./_commonjsHelpers-UyOWmZb0.js";
|
|
@@ -11,10 +11,9 @@ import "clsx";
|
|
|
11
11
|
import "tailwind-merge";
|
|
12
12
|
import "@chaibuilder/runtime";
|
|
13
13
|
import "jotai";
|
|
14
|
-
import "./
|
|
14
|
+
import "./MODIFIERS-WQdaNvb8.js";
|
|
15
15
|
import "@react-hookz/web";
|
|
16
|
-
import "./
|
|
17
|
-
import "./Class-lGzsNBOK.js";
|
|
16
|
+
import "./Class-3k8xjeiM.js";
|
|
18
17
|
import "@radix-ui/react-toggle";
|
|
19
18
|
import "class-variance-authority";
|
|
20
19
|
import "@radix-ui/react-switch";
|
|
@@ -107,7 +106,7 @@ const k = () => {
|
|
|
107
106
|
]
|
|
108
107
|
}
|
|
109
108
|
) : null;
|
|
110
|
-
},
|
|
109
|
+
}, d1 = () => {
|
|
111
110
|
const l = r("topBarComponents.left", []), t = r("topBarComponents.center", []), s = r("topBarComponents.right", []), h = r("editable", !0);
|
|
112
111
|
return /* @__PURE__ */ c.jsxs("div", { className: "flex h-14 items-center justify-between px-2", children: [
|
|
113
112
|
/* @__PURE__ */ c.jsx("div", { className: "flex items-center space-x-2", children: /* @__PURE__ */ c.jsx("div", { className: "flex items-center space-x-2 font-bold", children: z.Children.toArray(
|
|
@@ -128,5 +127,5 @@ const k = () => {
|
|
|
128
127
|
] });
|
|
129
128
|
};
|
|
130
129
|
export {
|
|
131
|
-
|
|
130
|
+
d1 as default
|
|
132
131
|
};
|
|
@@ -0,0 +1 @@
|
|
|
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-F4AQQ6qq.cjs"),A=require("@react-hookz/web"),T=require("lucide-react");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("./Functions-N3yhPYKY.cjs");require("clsx");require("tailwind-merge");require("@chaibuilder/runtime");require("jotai");require("./MODIFIERS-9EwxLM8V.cjs");require("./Class-MmCxz2Ay.cjs");require("react-i18next");require("@radix-ui/react-toggle");require("class-variance-authority");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");const g=async(d,E)=>new Promise((a,i)=>{k.createApi({accessKey:E}).search.getPhotos(d).then(c=>{a(c)}).catch(c=>i(c))}),z=({isModalView:d,onSelect:E})=>{const a=t.useBuilderProp("unsplashAccessKey",""),[i,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 n=c+1;s&&(s.preventDefault(),n=1),m(!0),q(n);const p={query:j,page:n};u&&(p.orientation=u),x&&(p.color=x),g(p,a).then(r=>{var y,v,N;f(n===1?((y=r==null?void 0:r.response)==null?void 0:y.results)||[]:[...i,...((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(n=>{var p,r;f(((p=n==null?void 0:n.response)==null?void 0:p.results)||[]),R((r=n==null?void 0:n.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(i)?"-mx-2 flex flex-wrap px-2":"-mx-2 flex flex-col pb-8 pt-2"}`,children:[l.isEmpty(i)&&!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:i.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))}):i.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(i)&&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;
|
|
@@ -3,7 +3,7 @@ import { useState as p, useEffect as D } from "react";
|
|
|
3
3
|
import { isEmpty as d, startCase as E } from "lodash-es";
|
|
4
4
|
import { MixerHorizontalIcon as L } from "@radix-ui/react-icons";
|
|
5
5
|
import { createApi as V } from "unsplash-js";
|
|
6
|
-
import { h as B, bd as F, aV as K, aW as U, aX as O, aj as P, ak as C, al as S, am as k, an as h, bf as Q, B as H } from "./index-
|
|
6
|
+
import { h as B, bd as F, aV as K, aW as U, aX as O, aj as P, ak as C, al as S, am as k, an as h, bf as Q, B as H } from "./index-CFUoB97-.js";
|
|
7
7
|
import { useDebouncedState as R } from "@react-hookz/web";
|
|
8
8
|
import { Loader as W } from "lucide-react";
|
|
9
9
|
import "./_commonjsHelpers-UyOWmZb0.js";
|
|
@@ -12,9 +12,8 @@ import "clsx";
|
|
|
12
12
|
import "tailwind-merge";
|
|
13
13
|
import "@chaibuilder/runtime";
|
|
14
14
|
import "jotai";
|
|
15
|
-
import "./
|
|
16
|
-
import "./
|
|
17
|
-
import "./Class-lGzsNBOK.js";
|
|
15
|
+
import "./MODIFIERS-WQdaNvb8.js";
|
|
16
|
+
import "./Class-3k8xjeiM.js";
|
|
18
17
|
import "react-i18next";
|
|
19
18
|
import "@radix-ui/react-toggle";
|
|
20
19
|
import "class-variance-authority";
|
|
@@ -40,17 +39,17 @@ import "react-icons-picker";
|
|
|
40
39
|
import "react-dom";
|
|
41
40
|
import "react-quill";
|
|
42
41
|
const I = async (x, g) => new Promise((o, r) => {
|
|
43
|
-
V({ accessKey: g }).search.getPhotos(x).then((
|
|
44
|
-
o(
|
|
45
|
-
}).catch((
|
|
46
|
-
}),
|
|
47
|
-
const o = B("unsplashAccessKey", ""), [r, j] = p([]), [
|
|
42
|
+
V({ accessKey: g }).search.getPhotos(x).then((l) => {
|
|
43
|
+
o(l);
|
|
44
|
+
}).catch((l) => r(l));
|
|
45
|
+
}), _e = ({ isModalView: x, onSelect: g }) => {
|
|
46
|
+
const o = B("unsplashAccessKey", ""), [r, j] = p([]), [l, v] = p(0), [i, A] = p(), [n, q] = p(), [z, y] = p(0), [u, T] = R("", 1e3), [f, c] = p(!1), _ = async (s) => {
|
|
48
47
|
if (d(u))
|
|
49
48
|
return;
|
|
50
|
-
let t =
|
|
49
|
+
let t = l + 1;
|
|
51
50
|
s && (s.preventDefault(), t = 1), c(!0), v(t);
|
|
52
51
|
const m = { query: u, page: t };
|
|
53
|
-
|
|
52
|
+
i && (m.orientation = i), n && (m.color = n), I(m, o).then((a) => {
|
|
54
53
|
var N, b, w;
|
|
55
54
|
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);
|
|
56
55
|
}).catch(() => {
|
|
@@ -61,14 +60,14 @@ const I = async (x, g) => new Promise((o, r) => {
|
|
|
61
60
|
if (!d(u) && o) {
|
|
62
61
|
c(!0);
|
|
63
62
|
const s = { query: u, page: 1 };
|
|
64
|
-
|
|
63
|
+
i && (s.orientation = i), n && (s.color = n), v(1), I(s, o).then((t) => {
|
|
65
64
|
var m, a;
|
|
66
65
|
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);
|
|
67
66
|
}).catch(() => {
|
|
68
67
|
c(!1);
|
|
69
68
|
});
|
|
70
69
|
}
|
|
71
|
-
}, [
|
|
70
|
+
}, [i, 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: [
|
|
72
71
|
"To enable Unsplash, kindly provide your",
|
|
73
72
|
/* @__PURE__ */ e.jsx(
|
|
74
73
|
"a",
|
|
@@ -101,7 +100,7 @@ const I = async (x, g) => new Promise((o, r) => {
|
|
|
101
100
|
className: "z-[9999] flex w-max items-center justify-center",
|
|
102
101
|
children: /* @__PURE__ */ e.jsxs("div", { children: [
|
|
103
102
|
/* @__PURE__ */ e.jsx("div", { className: "py-1 text-sm font-medium", children: "Orientation" }),
|
|
104
|
-
/* @__PURE__ */ e.jsxs(P, { defaultValue:
|
|
103
|
+
/* @__PURE__ */ e.jsxs(P, { defaultValue: i, onValueChange: (s) => A(s), children: [
|
|
105
104
|
/* @__PURE__ */ e.jsx(C, { className: "h-auto w-40 p-1 px-3", children: /* @__PURE__ */ e.jsx(S, { placeholder: "Select" }) }),
|
|
106
105
|
/* @__PURE__ */ e.jsxs(k, { className: "z-[9999]", children: [
|
|
107
106
|
/* @__PURE__ */ e.jsx(h, { value: "", children: "All" }),
|
|
@@ -176,7 +175,7 @@ const I = async (x, g) => new Promise((o, r) => {
|
|
|
176
175
|
/* @__PURE__ */ e.jsx(W, { className: "animate-spin w-6 h-6" }),
|
|
177
176
|
" Loading..."
|
|
178
177
|
] }),
|
|
179
|
-
!d(r) &&
|
|
178
|
+
!d(r) && l < z && !f && /* @__PURE__ */ e.jsx(
|
|
180
179
|
H,
|
|
181
180
|
{
|
|
182
181
|
size: "sm",
|
|
@@ -193,6 +192,6 @@ const I = async (x, g) => new Promise((o, r) => {
|
|
|
193
192
|
] });
|
|
194
193
|
};
|
|
195
194
|
export {
|
|
196
|
-
|
|
195
|
+
_e as default,
|
|
197
196
|
I as fetchImage
|
|
198
197
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-Z_BpKhVy.cjs"),s=require("react"),l=require("lodash-es"),m=require("@radix-ui/react-icons"),E=require("jotai"),p=require("./index-F4AQQ6qq.cjs");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("./Functions-N3yhPYKY.cjs");require("clsx");require("tailwind-merge");require("@chaibuilder/runtime");require("./MODIFIERS-9EwxLM8V.cjs");require("@react-hookz/web");require("./Class-MmCxz2Ay.cjs");require("react-i18next");require("@radix-ui/react-toggle");require("class-variance-authority");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");const N=E.atom([]),I=({isModalView:t,onSelect:a})=>{const j=p.useBuilderProp("uploadMediaCallback"),u=p.useBuilderProp("fetchMediaCallback"),[i,x]=E.useAtom(N),[n,f]=s.useState(!1),[h,g]=s.useState(!1),[c,d]=s.useState(),[b,R]=s.useState("");s.useEffect(()=>{(async()=>{if(!u)return;g(!0);const r=await u();x(r||[]),g(!1)})()},[]);const v=r=>{var o,q;r&&((q=(o=r==null?void 0:r.target)==null?void 0:o.files)==null?void 0:q.length)>0&&d(r.target.files[0])},y=async()=>{if(j){f(!0);try{const{url:r}=await j(c);a(r),d(void 0);const o=await u();x(o)}catch(r){x([]),R((r==null?void 0:r.message)||"Something went wrong.")}f(!1)}};return e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[c?e.jsxRuntimeExports.jsxs("div",{className:"relative flex w-full flex-col items-center justify-center rounded-md border bg-slate-50 p-2 px-1",children:[e.jsxRuntimeExports.jsx("img",{src:URL.createObjectURL(c),alt:"",className:"h-auto max-h-96 w-full max-w-sm rounded-md object-contain"}),b&&e.jsxRuntimeExports.jsx("div",{className:"w-full pt-2 text-center text-sm text-red-500",children:b}),e.jsxRuntimeExports.jsxs("div",{className:"flex w-full items-center justify-center gap-2 pt-2",children:[e.jsxRuntimeExports.jsxs("button",{type:"button",onClick:y,disabled:n,className:"flex items-center rounded-full bg-blue-500 px-3 py-1 text-sm text-white hover:bg-blue-600 hover:text-white",children:[n?e.jsxRuntimeExports.jsx(m.GearIcon,{className:"animate-spin"}):e.jsxRuntimeExports.jsx(m.UploadIcon,{className:"animate-bounce"})," ",n?"Uploading...":"Upload"]}),!n&&e.jsxRuntimeExports.jsxs("button",{type:"button",className:"flex items-center rounded-full border border-gray-300 px-3 py-1 text-sm hover:bg-gray-200",onClick:()=>d(void 0),children:[e.jsxRuntimeExports.jsx(m.Cross1Icon,{})," Cancel"]})]})]}):e.jsxRuntimeExports.jsxs("label",{htmlFor:t?"upload-in-modal":"upload-in-panel",children:[e.jsxRuntimeExports.jsxs("div",{className:"flex w-full cursor-pointer flex-col items-center justify-center rounded-md border border-dashed border-blue-900 bg-gray-200 py-8 hover:bg-blue-50",children:[e.jsxRuntimeExports.jsx("div",{className:"text-3xl",children:"+"}),e.jsxRuntimeExports.jsx("div",{children:"Click to choose file"})]}),e.jsxRuntimeExports.jsx("input",{type:"file",id:t?"upload-in-modal":"upload-in-panel",hidden:!0,onChange:v})]}),e.jsxRuntimeExports.jsxs(p.ScrollArea,{className:`-mx-2 flex h-full flex-col pb-8 pt-2 ${t?"px-2":""} pt-2`,children:[l.isEmpty(i)&&h&&e.jsxRuntimeExports.jsx("div",{className:"flex flex-col items-center justify-center py-6",children:e.jsxRuntimeExports.jsx("div",{className:"animate-pulse font-medium",children:"Fetching..."})}),l.isEmpty(i)&&!h&&e.jsxRuntimeExports.jsx("div",{className:"flex flex-col items-center justify-center py-6",children:e.jsxRuntimeExports.jsx("div",{className:"font-medium",children:"No Images"})}),t?e.jsxRuntimeExports.jsx("div",{className:"h-full columns-5 py-2",children:l.map(i,r=>e.jsxRuntimeExports.jsx("div",{role:"button",tabIndex:0,className:"my-1 flex",onClick:()=>a(r.url),children:e.jsxRuntimeExports.jsx("div",{className:"relative overflow-hidden rounded-md bg-cover bg-no-repeat",children:e.jsxRuntimeExports.jsx("img",{className:"h-auto flex-1 cursor-pointer rounded-md transition duration-300 ease-in-out hover:scale-105",alt:r.name,src:r.thumbUrl})})},r.id))}):l.map(i,r=>e.jsxRuntimeExports.jsx("div",{role:"button",tabIndex:0,className:"px-2 py-1",onClick:()=>a(r.url),children:e.jsxRuntimeExports.jsx("div",{className:"relative overflow-hidden rounded-md bg-cover bg-no-repeat",children:e.jsxRuntimeExports.jsx("img",{className:"h-auto w-full cursor-pointer transition duration-300 ease-in-out hover:scale-105",alt:r.name,src:r.url})})},r.id))]})]})};exports.default=I;
|
|
@@ -1,18 +1,17 @@
|
|
|
1
1
|
import { j as e } from "./jsx-runtime-WbnYoNE9.js";
|
|
2
|
-
import { useState as
|
|
2
|
+
import { useState as a, useEffect as w } from "react";
|
|
3
3
|
import { isEmpty as b, map as j } from "lodash-es";
|
|
4
4
|
import { GearIcon as C, UploadIcon as U, Cross1Icon as k } from "@radix-ui/react-icons";
|
|
5
5
|
import { atom as F, useAtom as E } from "jotai";
|
|
6
|
-
import { h as v, bf as A } from "./index-
|
|
6
|
+
import { h as v, bf as A } from "./index-CFUoB97-.js";
|
|
7
7
|
import "./_commonjsHelpers-UyOWmZb0.js";
|
|
8
8
|
import "./Functions-7jnEwJyw.js";
|
|
9
9
|
import "clsx";
|
|
10
10
|
import "tailwind-merge";
|
|
11
11
|
import "@chaibuilder/runtime";
|
|
12
|
-
import "./
|
|
12
|
+
import "./MODIFIERS-WQdaNvb8.js";
|
|
13
13
|
import "@react-hookz/web";
|
|
14
|
-
import "./
|
|
15
|
-
import "./Class-lGzsNBOK.js";
|
|
14
|
+
import "./Class-3k8xjeiM.js";
|
|
16
15
|
import "react-i18next";
|
|
17
16
|
import "@radix-ui/react-toggle";
|
|
18
17
|
import "class-variance-authority";
|
|
@@ -37,8 +36,8 @@ import "@radix-ui/react-context-menu";
|
|
|
37
36
|
import "react-icons-picker";
|
|
38
37
|
import "react-dom";
|
|
39
38
|
import "react-quill";
|
|
40
|
-
const R = F([]),
|
|
41
|
-
const p = v("uploadMediaCallback"), n = v("fetchMediaCallback"), [s, m] = E(R), [o, u] =
|
|
39
|
+
const R = F([]), he = ({ isModalView: r, onSelect: i }) => {
|
|
40
|
+
const p = v("uploadMediaCallback"), n = v("fetchMediaCallback"), [s, m] = E(R), [o, u] = a(!1), [x, f] = a(!1), [d, c] = a(), [h, y] = a("");
|
|
42
41
|
w(() => {
|
|
43
42
|
(async () => {
|
|
44
43
|
if (!n)
|
|
@@ -56,7 +55,7 @@ const R = F([]), ge = ({ isModalView: r, onSelect: a }) => {
|
|
|
56
55
|
u(!0);
|
|
57
56
|
try {
|
|
58
57
|
const { url: t } = await p(d);
|
|
59
|
-
|
|
58
|
+
i(t), c(void 0);
|
|
60
59
|
const l = await n();
|
|
61
60
|
m(l);
|
|
62
61
|
} catch (t) {
|
|
@@ -114,7 +113,7 @@ const R = F([]), ge = ({ isModalView: r, onSelect: a }) => {
|
|
|
114
113
|
/* @__PURE__ */ e.jsxs(A, { className: `-mx-2 flex h-full flex-col pb-8 pt-2 ${r ? "px-2" : ""} pt-2`, children: [
|
|
115
114
|
b(s) && x && /* @__PURE__ */ e.jsx("div", { className: "flex flex-col items-center justify-center py-6", children: /* @__PURE__ */ e.jsx("div", { className: "animate-pulse font-medium", children: "Fetching..." }) }),
|
|
116
115
|
b(s) && !x && /* @__PURE__ */ e.jsx("div", { className: "flex flex-col items-center justify-center py-6", children: /* @__PURE__ */ e.jsx("div", { className: "font-medium", children: "No Images" }) }),
|
|
117
|
-
r ? /* @__PURE__ */ e.jsx("div", { className: "h-full columns-5 py-2", children: j(s, (t) => /* @__PURE__ */ e.jsx("div", { role: "button", tabIndex: 0, className: "my-1 flex", onClick: () =>
|
|
116
|
+
r ? /* @__PURE__ */ e.jsx("div", { className: "h-full columns-5 py-2", children: j(s, (t) => /* @__PURE__ */ e.jsx("div", { role: "button", tabIndex: 0, className: "my-1 flex", onClick: () => i(t.url), children: /* @__PURE__ */ e.jsx("div", { className: "relative overflow-hidden rounded-md bg-cover bg-no-repeat", children: /* @__PURE__ */ e.jsx(
|
|
118
117
|
"img",
|
|
119
118
|
{
|
|
120
119
|
className: "h-auto flex-1 cursor-pointer rounded-md transition duration-300 ease-in-out hover:scale-105",
|
|
@@ -123,7 +122,7 @@ const R = F([]), ge = ({ isModalView: r, onSelect: a }) => {
|
|
|
123
122
|
}
|
|
124
123
|
) }) }, t.id)) }) : j(s, (t) => (
|
|
125
124
|
// TODO: Drag and Drop Image to Canvas from Here use `pic.url` for image quality
|
|
126
|
-
/* @__PURE__ */ e.jsx("div", { role: "button", tabIndex: 0, className: "px-2 py-1", onClick: () =>
|
|
125
|
+
/* @__PURE__ */ e.jsx("div", { role: "button", tabIndex: 0, className: "px-2 py-1", onClick: () => i(t.url), children: /* @__PURE__ */ e.jsx("div", { className: "relative overflow-hidden rounded-md bg-cover bg-no-repeat", children: /* @__PURE__ */ e.jsx(
|
|
127
126
|
"img",
|
|
128
127
|
{
|
|
129
128
|
className: "h-auto w-full cursor-pointer transition duration-300 ease-in-out hover:scale-105",
|
|
@@ -136,5 +135,5 @@ const R = F([]), ge = ({ isModalView: r, onSelect: a }) => {
|
|
|
136
135
|
] });
|
|
137
136
|
};
|
|
138
137
|
export {
|
|
139
|
-
|
|
138
|
+
he as default
|
|
140
139
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-Z_BpKhVy.cjs"),x=require("react"),P=require("lodash-es"),t=require("./index-F4AQQ6qq.cjs"),g=require("./controls-KK2oLIa8.cjs"),R=require("./form-Ap63cNec.cjs"),f=require("./index-Qk028f-N.cjs");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("./Functions-N3yhPYKY.cjs");require("clsx");require("tailwind-merge");require("@chaibuilder/runtime");require("jotai");require("./MODIFIERS-9EwxLM8V.cjs");require("@react-hookz/web");require("./Class-MmCxz2Ay.cjs");require("react-i18next");require("@radix-ui/react-toggle");require("class-variance-authority");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("@rjsf/core");require("@rjsf/validator-ajv8");require("./index-l19JVVXI.cjs");require("i18next");require("@floating-ui/react-dom");require("flagged");require("react-hotkeys-hook");require("sonner");require("./html-to-json-C_Eobs_d.cjs");require("himalaya");require("lucide-react");require("./index-ecnGWzh9.cjs");const b=({closeModal:i})=>{var l,o;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(q=>{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("__","_")),{...q,...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||((o=r.slug)==null?void 0:o.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,20 +1,19 @@
|
|
|
1
1
|
import { j as t } from "./jsx-runtime-WbnYoNE9.js";
|
|
2
2
|
import { useState as c } from "react";
|
|
3
3
|
import { kebabCase as j } from "lodash-es";
|
|
4
|
-
import { ae as C, B as u, ad as b, ao as A } from "./index-
|
|
4
|
+
import { ae as C, B as u, ad as b, ao as A } from "./index-CFUoB97-.js";
|
|
5
5
|
import { u as g } from "./controls-OfJWSEqC.js";
|
|
6
|
-
import { F as D } from "./form-
|
|
7
|
-
import { e as N } from "./index-
|
|
6
|
+
import { F as D } from "./form-zmlTjM9j.js";
|
|
7
|
+
import { e as N } from "./index-f0AbmoYY.js";
|
|
8
8
|
import "./_commonjsHelpers-UyOWmZb0.js";
|
|
9
9
|
import "./Functions-7jnEwJyw.js";
|
|
10
10
|
import "clsx";
|
|
11
11
|
import "tailwind-merge";
|
|
12
12
|
import "@chaibuilder/runtime";
|
|
13
13
|
import "jotai";
|
|
14
|
-
import "./
|
|
14
|
+
import "./MODIFIERS-WQdaNvb8.js";
|
|
15
15
|
import "@react-hookz/web";
|
|
16
|
-
import "./
|
|
17
|
-
import "./Class-lGzsNBOK.js";
|
|
16
|
+
import "./Class-3k8xjeiM.js";
|
|
18
17
|
import "react-i18next";
|
|
19
18
|
import "@radix-ui/react-toggle";
|
|
20
19
|
import "class-variance-authority";
|
|
@@ -42,19 +41,19 @@ import "react-dom";
|
|
|
42
41
|
import "react-quill";
|
|
43
42
|
import "@rjsf/core";
|
|
44
43
|
import "@rjsf/validator-ajv8";
|
|
45
|
-
import "./index-
|
|
44
|
+
import "./index-lOJfSheQ.js";
|
|
46
45
|
import "i18next";
|
|
47
46
|
import "@floating-ui/react-dom";
|
|
48
47
|
import "flagged";
|
|
49
48
|
import "react-hotkeys-hook";
|
|
50
49
|
import "sonner";
|
|
51
|
-
import "./html-to-json-
|
|
50
|
+
import "./html-to-json-p__Fgqdg.js";
|
|
52
51
|
import "himalaya";
|
|
53
52
|
import "lucide-react";
|
|
54
53
|
import "./index-YpnaudSM.js";
|
|
55
|
-
const S = ({ closeModal:
|
|
56
|
-
var
|
|
57
|
-
const i = N(), [
|
|
54
|
+
const S = ({ closeModal: o }) => {
|
|
55
|
+
var p, s;
|
|
56
|
+
const i = N(), [e, f] = c({
|
|
58
57
|
name: "",
|
|
59
58
|
slug: "",
|
|
60
59
|
blocks: [],
|
|
@@ -62,43 +61,43 @@ const S = ({ closeModal: e }) => {
|
|
|
62
61
|
seoData: {},
|
|
63
62
|
template: ""
|
|
64
63
|
}), x = () => {
|
|
65
|
-
i.mutate(
|
|
64
|
+
i.mutate(e, { onSuccess: () => o() });
|
|
66
65
|
}, h = ({ formData: m }, r) => {
|
|
67
66
|
f((l) => {
|
|
68
67
|
var n, d;
|
|
69
|
-
const
|
|
70
|
-
return r === "name" ?
|
|
68
|
+
const a = { [r]: m[r] };
|
|
69
|
+
return r === "name" ? a.slug = j((n = m[r]) == null ? void 0 : n.replace(/\d/g, "")) : r === "slug" && (a.slug = (d = m[r]) == null ? void 0 : d.replace(/\d/g, "").replace(/\s+/g, "").replace("--", "-").replace("__", "_")), {
|
|
71
70
|
...l,
|
|
72
|
-
...
|
|
71
|
+
...a
|
|
73
72
|
};
|
|
74
73
|
});
|
|
75
74
|
}, P = {
|
|
76
75
|
name: g({
|
|
77
76
|
title: "Page Name",
|
|
78
|
-
default:
|
|
77
|
+
default: e.name
|
|
79
78
|
}),
|
|
80
|
-
slug: g({ title: "Page Slug", default:
|
|
79
|
+
slug: g({ title: "Page Slug", default: e.slug })
|
|
81
80
|
};
|
|
82
81
|
return /* @__PURE__ */ t.jsxs(C, { children: [
|
|
83
82
|
/* @__PURE__ */ t.jsx("div", { className: "px-1 font-bold", children: "Add Page" }),
|
|
84
|
-
/* @__PURE__ */ t.jsx(D, { formData:
|
|
83
|
+
/* @__PURE__ */ t.jsx(D, { formData: e, properties: P, onChange: h, disabled: i.isPending }),
|
|
85
84
|
/* @__PURE__ */ t.jsx("div", { className: "flex items-center justify-end", children: /* @__PURE__ */ t.jsx(
|
|
86
85
|
u,
|
|
87
86
|
{
|
|
88
87
|
type: "submit",
|
|
89
|
-
disabled: !
|
|
88
|
+
disabled: !e.name || !e.slug || ((p = e.name) == null ? void 0 : p.length) < 2 || ((s = e.slug) == null ? void 0 : s.length) < 2 || i.isPending,
|
|
90
89
|
onClick: x,
|
|
91
90
|
children: "Add Page"
|
|
92
91
|
}
|
|
93
92
|
) })
|
|
94
93
|
] });
|
|
95
|
-
},
|
|
96
|
-
const [
|
|
97
|
-
return /* @__PURE__ */ t.jsxs(b, { open:
|
|
98
|
-
/* @__PURE__ */ t.jsx(A, { asChild: !0, children: /* @__PURE__ */ t.jsx(u, { size: "sm", variant: "link", className: "text-blue-500", onClick: () => i(!
|
|
99
|
-
|
|
94
|
+
}, St = () => {
|
|
95
|
+
const [o, i] = c(!1);
|
|
96
|
+
return /* @__PURE__ */ t.jsxs(b, { open: o, onOpenChange: () => i(!o), children: [
|
|
97
|
+
/* @__PURE__ */ t.jsx(A, { asChild: !0, children: /* @__PURE__ */ t.jsx(u, { size: "sm", variant: "link", className: "text-blue-500", onClick: () => i(!o), children: "+ New Page" }) }),
|
|
98
|
+
o && /* @__PURE__ */ t.jsx(S, { closeModal: () => i(!o) })
|
|
100
99
|
] });
|
|
101
100
|
};
|
|
102
101
|
export {
|
|
103
|
-
|
|
102
|
+
St as default
|
|
104
103
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-Z_BpKhVy.cjs"),r=require("./index-F4AQQ6qq.cjs");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("react");require("lodash-es");require("./Functions-N3yhPYKY.cjs");require("clsx");require("tailwind-merge");require("@chaibuilder/runtime");require("jotai");require("./MODIFIERS-9EwxLM8V.cjs");require("@react-hookz/web");require("./Class-MmCxz2Ay.cjs");require("react-i18next");require("@radix-ui/react-toggle");require("class-variance-authority");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");const x=({open:t,onCancel:q=()=>{},onConfirm:s,title:n,description:i,disabled:u,cancelText:l="Discard",confirmText:o="Save"})=>e.jsxRuntimeExports.jsx(r.AlertDialog,{open:t,children:e.jsxRuntimeExports.jsxs(r.AlertDialogContent,{children:[e.jsxRuntimeExports.jsx(r.AlertDialogTitle,{children:n}),i&&e.jsxRuntimeExports.jsx(r.AlertDialogDescription,{children:i}),e.jsxRuntimeExports.jsxs("div",{className:"flex items-center justify-end gap-x-3",children:[e.jsxRuntimeExports.jsx(r.AlertDialogCancel,{disabled:u,onClick:q,children:l}),e.jsxRuntimeExports.jsx(r.Button,{variant:"default",onClick:s,disabled:u,children:o})]})]})});exports.default=x;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { j as i } from "./jsx-runtime-WbnYoNE9.js";
|
|
2
|
-
import { A as a, b as n, d as c, e as x, g as d, B as j } from "./index-
|
|
2
|
+
import { A as a, b as n, d as c, e as x, g as d, B as j } from "./index-CFUoB97-.js";
|
|
3
3
|
import "./_commonjsHelpers-UyOWmZb0.js";
|
|
4
4
|
import "react";
|
|
5
5
|
import "lodash-es";
|
|
@@ -8,10 +8,9 @@ import "clsx";
|
|
|
8
8
|
import "tailwind-merge";
|
|
9
9
|
import "@chaibuilder/runtime";
|
|
10
10
|
import "jotai";
|
|
11
|
-
import "./
|
|
11
|
+
import "./MODIFIERS-WQdaNvb8.js";
|
|
12
12
|
import "@react-hookz/web";
|
|
13
|
-
import "./
|
|
14
|
-
import "./Class-lGzsNBOK.js";
|
|
13
|
+
import "./Class-3k8xjeiM.js";
|
|
15
14
|
import "react-i18next";
|
|
16
15
|
import "@radix-ui/react-toggle";
|
|
17
16
|
import "class-variance-authority";
|
|
@@ -37,7 +36,7 @@ import "@radix-ui/react-context-menu";
|
|
|
37
36
|
import "react-icons-picker";
|
|
38
37
|
import "react-dom";
|
|
39
38
|
import "react-quill";
|
|
40
|
-
const
|
|
39
|
+
const $ = ({
|
|
41
40
|
open: o,
|
|
42
41
|
onCancel: m = () => {
|
|
43
42
|
},
|
|
@@ -56,5 +55,5 @@ const ii = ({
|
|
|
56
55
|
] })
|
|
57
56
|
] }) });
|
|
58
57
|
export {
|
|
59
|
-
|
|
58
|
+
$ as default
|
|
60
59
|
};
|
package/dist/core.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("./index-l19JVVXI.cjs"),e=require("./index-F4AQQ6qq.cjs"),u=require("react-i18next");require("i18next");require("./jsx-runtime-Z_BpKhVy.cjs");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("react");require("clsx");require("react-dom");require("@radix-ui/react-scroll-area");require("@floating-ui/react-dom");require("jotai");require("flagged");require("lodash-es");require("./Functions-N3yhPYKY.cjs");require("tailwind-merge");require("@radix-ui/react-icons");require("react-hotkeys-hook");require("@chaibuilder/runtime");require("@react-hookz/web");require("./MODIFIERS-9EwxLM8V.cjs");require("./Class-MmCxz2Ay.cjs");require("@radix-ui/react-toggle");require("class-variance-authority");require("@radix-ui/react-switch");require("@radix-ui/react-slot");require("@radix-ui/react-accordion");require("@radix-ui/react-alert-dialog");require("@radix-ui/react-dialog");require("@radix-ui/react-label");require("@radix-ui/react-tabs");require("@radix-ui/react-tooltip");require("@radix-ui/react-popover");require("@radix-ui/react-menubar");require("@radix-ui/react-hover-card");require("@radix-ui/react-select");require("@radix-ui/react-dropdown-menu");require("@radix-ui/react-separator");require("@radix-ui/react-toast");require("cmdk");require("@radix-ui/react-context-menu");require("react-icons-picker");require("react-quill");exports.ChaiBuilderEditor=s.ChaiBuilderEditor;exports.useActiveModal=e.useActiveModal;exports.useActivePanel=e.useActivePanel;exports.useAddBlock=e.useAddBlock;exports.useAddBlockParent=e.useAddBlockParent;exports.useAddClassesToBlocks=e.useAddClassesToBlocks;exports.useAllBlocks=e.useAllBlocks;exports.useBlocksStore=e.useBlocksStore;exports.useBrandingOptions=e.useBrandingOptions;exports.useBuilderProp=e.useBuilderProp;exports.useBuilderReset=e.useBuilderReset;exports.useCanvasWidth=e.useCanvasWidth;exports.useCanvasZoom=e.useCanvasZoom;exports.useCopyBlockIds=e.useCopyBlockIds;exports.useCopyToClipboard=e.useCopyToClipboard;exports.useCurrentPage=e.useCurrentPage;exports.useCutBlockIds=e.useCutBlockIds;exports.useDarkMode=e.useDarkMode;exports.useDuplicateBlocks=e.useDuplicateBlocks;exports.useGetPageData=e.useGetPageData;exports.useHiddenBlockIds=e.useHiddenBlockIds;exports.useHighlightBlockId=e.useHighlightBlockId;exports.usePasteBlocks=e.usePasteBlocks;exports.usePreviewMode=e.usePreviewMode;exports.useReadOnlyMode=e.useReadOnlyMode;exports.useRemoveBlocks=e.useRemoveBlocks;exports.useRemoveClassesFromBlocks=e.useRemoveClassesFromBlocks;exports.useSavePage=e.useSavePage;exports.useSelectedBlock=e.useSelectedBlock;exports.useSelectedBlockAllClasses=e.useSelectedBlockAllClasses;exports.useSelectedBlockCurrentClasses=e.useSelectedBlockCurrentClasses;exports.useSelectedBlockIds=e.useSelectedBlockIds;exports.useSelectedBlocksDisplayChild=e.useSelectedBlocksDisplayChild;exports.useSelectedBreakpoints=e.useSelectedBreakpoints;exports.useSelectedStylingBlocks=e.useSelectedStylingBlocks;exports.useStylingBreakpoint=e.useStylingBreakpoint;exports.useStylingState=e.useStylingState;exports.useUILibraryBlocks=e.useUILibraryBlocks;exports.useUndoManager=e.useUndoManager;exports.useUpdateBlocksProps=e.useUpdateBlocksProps;exports.useUpdateBlocksPropsRealtime=e.useUpdateBlocksPropsRealtime;Object.defineProperty(exports,"useTranslation",{enumerable:!0,get:()=>u.useTranslation});
|