@chaibuilder/sdk 1.2.38 → 1.2.39
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-2_dpKDpp.js +144 -0
- package/dist/AddBlocks-p4Hrxjdf.cjs +1 -0
- package/dist/{CanvasArea-WJYJtUFt.js → CanvasArea-iN0LxF74.js} +183 -184
- package/dist/{CanvasArea-MuuWWyW0.cjs → CanvasArea-sbec3R-f.cjs} +5 -5
- package/dist/{ChaiBuilderEditor-vzyVasJe.js → ChaiBuilderEditor-JnZFji5_.js} +8191 -8073
- package/dist/{ChaiBuilderEditor-PLQ8Sq34.cjs → ChaiBuilderEditor-qxbkVVLu.cjs} +49 -49
- package/dist/{CurrentPage-j6xVMVFH.js → CurrentPage-Lr3ztuMx.js} +9 -10
- package/dist/CurrentPage-m7_GkZ8a.cjs +1 -0
- package/dist/ListTree-piETqoz9.cjs +1 -0
- package/dist/{ListTree-1oWz6vwo.js → ListTree-uJFhqUk9.js} +1 -2
- package/dist/{PagesPanel-PKnqTla9.js → PagesPanel-R8FWg5Xg.js} +4 -5
- package/dist/PagesPanel-lShO3SmJ.cjs +1 -0
- package/dist/{ProjectPanel-hx21JHK8.js → ProjectPanel-2dX4bM5q.js} +5 -6
- package/dist/ProjectPanel-_4546hym.cjs +1 -0
- package/dist/{Settings-3omes6Yj.js → Settings-J785mqWv.js} +4 -5
- package/dist/Settings-e2AZkjqY.cjs +1 -0
- package/dist/SidePanels-Vfw9Ir6p.cjs +1 -0
- package/dist/{SidePanels-vNc0pvVt.js → SidePanels-cN9er64h.js} +165 -146
- package/dist/{BrandingOptions-z7hXgff2.js → ThemeConfiguration-m_jkR2zi.js} +42 -41
- package/dist/ThemeConfiguration-nler1cz3.cjs +1 -0
- package/dist/Topbar-DmIPkF8D.cjs +1 -0
- package/dist/{Topbar-c3HIPa_q.js → Topbar-gaBycI3a.js} +3 -4
- package/dist/UILibrariesPanel-Igx0R4zc.js +138 -0
- package/dist/UILibrariesPanel-N144UO0E.cjs +1 -0
- package/dist/{UnsplashImages-IQo081nF.js → UnsplashImages-6HmGnetM.js} +3 -4
- package/dist/UnsplashImages-mC2ewX9D.cjs +1 -0
- package/dist/UploadImages-fo9ufcCE.cjs +1 -0
- package/dist/{UploadImages-BAy3wsRT.js → UploadImages-qRW8zhKj.js} +3 -4
- package/dist/{add-page-modal-WWRdRyDM.js → add-page-modal-0OuVNgx3.js} +16 -17
- package/dist/add-page-modal-mP9aTfG9.cjs +1 -0
- package/dist/{confirm-alert-LvvLsCWh.cjs → confirm-alert-3cDnni4v.cjs} +1 -1
- package/dist/{confirm-alert-h4RiwjkJ.js → confirm-alert-Mv-Iofef.js} +3 -4
- package/dist/core.cjs +1 -1
- package/dist/core.d.ts +3 -0
- package/dist/core.js +44 -45
- package/dist/{delete-page-modal-XymJxo7r.js → delete-page-modal-BVz9nreM.js} +4 -5
- package/dist/delete-page-modal-PTwcrTET.cjs +1 -0
- package/dist/email.cjs +1 -1
- package/dist/email.d.ts +3 -0
- package/dist/email.js +3 -4
- package/dist/{form-P0nEC3WH.js → form-e8l4xtI9.js} +1 -1
- package/dist/{form-I4uC5vkq.cjs → form-o7e6NNTk.cjs} +1 -1
- package/dist/{index-mVQVs_cP.cjs → index--XTVdy1h.cjs} +1 -1
- package/dist/{index-SP6aKHPH.js → index-CdnwVCXv.js} +2 -2
- package/dist/{page-viewer-OSlqdbEV.js → page-viewer-OopsJHBE.js} +5 -6
- package/dist/page-viewer-cjvx3lg7.cjs +1 -0
- package/dist/{project-general-setting-JR9L7fMQ.cjs → project-general-setting-3sdmeYrS.cjs} +1 -1
- package/dist/{project-general-setting-LXfl5i5Z.js → project-general-setting-n8KKf8qD.js} +5 -6
- package/dist/{project-seo-setting-cVDCPjBD.cjs → project-seo-setting-E554FQ3V.cjs} +1 -1
- package/dist/{project-seo-setting-lyzUUxe2.js → project-seo-setting-pu3qUSE0.js} +4 -5
- package/dist/single-page-detail-KdxEu4WS.cjs +1 -0
- package/dist/{single-page-detail-GeG-SXWn.js → single-page-detail-hcTkta3X.js} +6 -7
- package/dist/studio.cjs +1 -1
- package/dist/studio.d.ts +3 -0
- package/dist/studio.js +3 -4
- package/dist/ui.cjs +1 -1
- package/dist/ui.js +138 -139
- package/dist/{useCanvasSettings-_EzUaA9P.js → useCanvasSettings-6lwRwexD.js} +1 -1
- package/dist/{useCanvasSettings-bP_V0UR2.cjs → useCanvasSettings-oERGzYXb.cjs} +1 -1
- package/package.json +2 -2
- package/dist/AddBlocks-G9pjsIyq.cjs +0 -1
- package/dist/AddBlocks-dljjAE5r.js +0 -210
- package/dist/BrandingOptions-N7iDaMgM.cjs +0 -1
- package/dist/CurrentPage-LaeYQ-Ke.cjs +0 -1
- package/dist/ListTree-_7e5p_e3.cjs +0 -1
- package/dist/PagesPanel-BsELxMie.cjs +0 -1
- package/dist/ProjectPanel-1aAFwguw.cjs +0 -1
- package/dist/Settings-tYjuuUgX.cjs +0 -1
- package/dist/SidePanels-7WG6SXw0.cjs +0 -1
- package/dist/Topbar-1zU6Ljsn.cjs +0 -1
- package/dist/UnsplashImages-zCQkmow-.cjs +0 -1
- package/dist/UploadImages-6K3GdM-b.cjs +0 -1
- package/dist/add-page-modal-8FJnOckX.cjs +0 -1
- package/dist/delete-page-modal-IRX0oKZJ.cjs +0 -1
- package/dist/page-viewer-fonOyiuT.cjs +0 -1
- package/dist/single-page-detail-LL8m0Va7.cjs +0 -1
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { j as t } from "./jsx-runtime-WbnYoNE9.js";
|
|
2
2
|
import * as c from "react";
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import { h as
|
|
6
|
-
import { y as f, c as
|
|
7
|
-
import { debounce as
|
|
3
|
+
import j from "@rjsf/validator-ajv8";
|
|
4
|
+
import k from "@rjsf/core";
|
|
5
|
+
import { h as M, F as T, bv as w } from "./ChaiBuilderEditor-JnZFji5_.js";
|
|
6
|
+
import { y as f, c as D, f as a } from "./controls-VTdJhdSz.js";
|
|
7
|
+
import { debounce as P, noop as R, isEqual as F } from "lodash-es";
|
|
8
|
+
import { useTranslation as L } from "react-i18next";
|
|
8
9
|
import "./_commonjsHelpers-UyOWmZb0.js";
|
|
9
10
|
import "clsx";
|
|
10
11
|
import "react-dom";
|
|
@@ -12,7 +13,6 @@ import "@radix-ui/react-scroll-area";
|
|
|
12
13
|
import "@floating-ui/react-dom";
|
|
13
14
|
import "jotai";
|
|
14
15
|
import "i18next";
|
|
15
|
-
import "react-i18next";
|
|
16
16
|
import "flagged";
|
|
17
17
|
import "./STRINGS--j49GZJP.js";
|
|
18
18
|
import "./Functions-7jnEwJyw.js";
|
|
@@ -44,10 +44,9 @@ import "@radix-ui/react-context-menu";
|
|
|
44
44
|
import "react-icons-picker";
|
|
45
45
|
import "react-quill";
|
|
46
46
|
import "react-hotkeys-hook";
|
|
47
|
-
import "lodash";
|
|
48
47
|
import "lucide-react";
|
|
49
|
-
const
|
|
50
|
-
const
|
|
48
|
+
const E = ({ value: u, onChange: e, id: p, onBlur: m }) => {
|
|
49
|
+
const i = P(e, 200), d = (l) => i(l.target.value);
|
|
51
50
|
return /* @__PURE__ */ t.jsx("div", { className: "mt-1.5 flex items-center gap-x-3", children: /* @__PURE__ */ t.jsx("div", { className: "flex w-3/5 flex-col", children: /* @__PURE__ */ t.jsx(
|
|
52
51
|
"input",
|
|
53
52
|
{
|
|
@@ -107,60 +106,62 @@ const M = ({ value: u, onChange: e, id: p, onBlur: m }) => {
|
|
|
107
106
|
{ title: "Overlock", value: "Overlock" },
|
|
108
107
|
{ title: "Lustria", value: "Lustria" },
|
|
109
108
|
{ title: "Ovo", value: "Ovo" },
|
|
110
|
-
{ title: "Suranna", value: "Suranna" }
|
|
111
|
-
|
|
112
|
-
|
|
109
|
+
{ title: "Suranna", value: "Suranna" },
|
|
110
|
+
{ title: "Bebas Neue", value: "Bebas Neue" },
|
|
111
|
+
{ title: "Manrope", value: "Manrope" }
|
|
112
|
+
], Tt = () => {
|
|
113
|
+
const u = M("onSaveBrandingOptions", R), [e, p] = T(), [m] = w(), i = c.useRef(e), { t: d } = L();
|
|
113
114
|
c.useEffect(() => () => {
|
|
114
|
-
|
|
115
|
+
F(e, i.current) || u(i.current);
|
|
115
116
|
}, []);
|
|
116
|
-
const
|
|
117
|
-
s && (p(o),
|
|
117
|
+
const l = ({ formData: o }, s) => {
|
|
118
|
+
s && (p(o), i.current = o);
|
|
118
119
|
}, {
|
|
119
|
-
bodyFont:
|
|
120
|
-
headingFont:
|
|
120
|
+
bodyFont: h,
|
|
121
|
+
headingFont: b,
|
|
121
122
|
primaryColor: x,
|
|
122
123
|
bodyTextDarkColor: y,
|
|
123
|
-
bodyTextLightColor:
|
|
124
|
-
bodyBgDarkColor:
|
|
125
|
-
secondaryColor:
|
|
126
|
-
bodyBgLightColor:
|
|
127
|
-
roundedCorners:
|
|
124
|
+
bodyTextLightColor: C,
|
|
125
|
+
bodyBgDarkColor: S,
|
|
126
|
+
secondaryColor: B,
|
|
127
|
+
bodyBgLightColor: O,
|
|
128
|
+
roundedCorners: N
|
|
128
129
|
} = e;
|
|
129
130
|
let r = {
|
|
130
131
|
headingFont: f({
|
|
131
132
|
title: "Heading font",
|
|
132
|
-
default:
|
|
133
|
+
default: b,
|
|
133
134
|
options: g
|
|
134
135
|
}),
|
|
135
136
|
bodyFont: f({
|
|
136
137
|
title: "Body font",
|
|
137
|
-
default:
|
|
138
|
+
default: h,
|
|
138
139
|
options: g
|
|
139
140
|
}),
|
|
140
|
-
roundedCorners:
|
|
141
|
+
roundedCorners: D({
|
|
141
142
|
title: "Rounded Corner",
|
|
142
|
-
default: parseInt(
|
|
143
|
+
default: parseInt(N || 5, 10)
|
|
143
144
|
}),
|
|
144
|
-
primaryColor:
|
|
145
|
-
secondaryColor:
|
|
145
|
+
primaryColor: a({ title: "Primary", default: x }),
|
|
146
|
+
secondaryColor: a({ title: "Secondary", default: B })
|
|
146
147
|
};
|
|
147
148
|
m || (r = {
|
|
148
149
|
...r,
|
|
149
|
-
bodyBgLightColor:
|
|
150
|
+
bodyBgLightColor: a({
|
|
150
151
|
title: "Body Background (Light Mode)",
|
|
151
|
-
default:
|
|
152
|
+
default: O
|
|
152
153
|
}),
|
|
153
|
-
bodyTextLightColor:
|
|
154
|
+
bodyTextLightColor: a({
|
|
154
155
|
title: "Body Text (Light Mode)",
|
|
155
156
|
default: y
|
|
156
157
|
}),
|
|
157
|
-
bodyBgDarkColor:
|
|
158
|
+
bodyBgDarkColor: a({
|
|
158
159
|
title: "Body Background (Dark mode)",
|
|
159
|
-
default:
|
|
160
|
+
default: S
|
|
160
161
|
}),
|
|
161
|
-
bodyTextDarkColor:
|
|
162
|
+
bodyTextDarkColor: a({
|
|
162
163
|
title: "Body Text (Dark mode)",
|
|
163
|
-
default:
|
|
164
|
+
default: C
|
|
164
165
|
})
|
|
165
166
|
});
|
|
166
167
|
const n = {
|
|
@@ -171,11 +172,11 @@ const M = ({ value: u, onChange: e, id: p, onBlur: m }) => {
|
|
|
171
172
|
const s = r[o];
|
|
172
173
|
return n.properties || (n.properties = {}), n.properties[o] = s.schema, v[o] = s.uiSchema, !0;
|
|
173
174
|
}), /* @__PURE__ */ t.jsxs("div", { className: "flex h-full w-60 select-none flex-col", children: [
|
|
174
|
-
/* @__PURE__ */ t.jsx("div", { className: "rounded-md bg-background/30 p-1", children: /* @__PURE__ */ t.jsx("h1", { className: "px-1 font-semibold", children: "
|
|
175
|
+
/* @__PURE__ */ t.jsx("div", { className: "rounded-md bg-background/30 p-1", children: /* @__PURE__ */ t.jsx("h1", { className: "px-1 font-semibold", children: d("Theme Configuration") }) }),
|
|
175
176
|
/* @__PURE__ */ t.jsx("div", { className: "-mx-2", children: /* @__PURE__ */ t.jsx(
|
|
176
|
-
|
|
177
|
+
k,
|
|
177
178
|
{
|
|
178
|
-
widgets: { color:
|
|
179
|
+
widgets: { color: E },
|
|
179
180
|
idSeparator: ".",
|
|
180
181
|
autoComplete: "off",
|
|
181
182
|
omitExtraData: !0,
|
|
@@ -184,12 +185,12 @@ const M = ({ value: u, onChange: e, id: p, onBlur: m }) => {
|
|
|
184
185
|
uiSchema: v,
|
|
185
186
|
schema: n,
|
|
186
187
|
formData: e,
|
|
187
|
-
validator:
|
|
188
|
-
onChange:
|
|
188
|
+
validator: j,
|
|
189
|
+
onChange: l
|
|
189
190
|
}
|
|
190
191
|
) })
|
|
191
192
|
] });
|
|
192
193
|
};
|
|
193
194
|
export {
|
|
194
|
-
|
|
195
|
+
Tt as default
|
|
195
196
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./jsx-runtime-Z_BpKhVy.cjs"),R=require("react"),N=require("@rjsf/validator-ajv8"),E=require("@rjsf/core"),p=require("./ChaiBuilderEditor-qxbkVVLu.cjs"),r=require("./controls-jWJDao88.cjs"),f=require("lodash-es"),k=require("react-i18next");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("clsx");require("react-dom");require("@radix-ui/react-scroll-area");require("@floating-ui/react-dom");require("jotai");require("i18next");require("flagged");require("./STRINGS-gPz7CUOk.cjs");require("./Functions-N3yhPYKY.cjs");require("tailwind-merge");require("@chaibuilder/runtime");require("@react-hookz/web");require("./MODIFIERS-YPHRtwrM.cjs");require("@radix-ui/react-toggle");require("class-variance-authority");require("./Class-Zc8hpE7f.cjs");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-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");require("react-hotkeys-hook");require("lucide-react");function M(t){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const i in t)if(i!=="default"){const l=Object.getOwnPropertyDescriptor(t,i);Object.defineProperty(e,i,l.get?l:{enumerable:!0,get:()=>t[i]})}}return e.default=t,Object.freeze(e)}const m=M(R),P=({value:t,onChange:e,id:i,onBlur:l})=>{const n=f.debounce(e,200),v=u=>n(u.target.value);return a.jsxRuntimeExports.jsx("div",{className:"mt-1.5 flex items-center gap-x-3",children:a.jsxRuntimeExports.jsx("div",{className:"flex w-3/5 flex-col",children:a.jsxRuntimeExports.jsx("input",{type:"color",className:"text-xs p-0",value:t,onBlur:({target:{value:u}})=>l(i,u),onChange:v})})})},x=[{title:"Roboto",value:"Roboto"},{title:"Open Sans",value:"Open Sans"},{title:"Montserrat",value:"Montserrat"},{title:"Lato",value:"Lato"},{title:"Poppins",value:"Poppins"},{title:"Oswald",value:"Oswald"},{title:"Raleway",value:"Raleway"},{title:"Ubuntu",value:"Ubuntu"},{title:"Nunito",value:"Nunito"},{title:"Merriweather",value:"Merriweather"},{title:"Nunito Sans",value:"Nunito Sans"},{title:"Playfair Display",value:"Playfair Display"},{title:"Rubik",value:"Rubik"},{title:"Inter",value:"Inter"},{title:"Lora",value:"Lora"},{title:"Kanit",value:"Kanit"},{title:"Fira Sans",value:"Fira Sans"},{title:"Hind",value:"Hind"},{title:"Quicksand",value:"Quicksand"},{title:"Mulish",value:"Mulish"},{title:"Barlow",value:"Barlow"},{title:"Inconsolata",value:"Inconsolata"},{title:"Titillium Web",value:"Titillium Web"},{title:"Heebo",value:"Heebo"},{title:"IBM Plex Sans",value:"IBM Plex Sans"},{title:"DM Sans",value:"DM Sans"},{title:"Nanum Gothic",value:"Nanum Gothic"},{title:"Karla",value:"Karla"},{title:"Arimo",value:"Arimo"},{title:"Cabin",value:"Cabin"},{title:"Oxygen",value:"Oxygen"},{title:"Overpass",value:"Overpass"},{title:"Assistant",value:"Assistant"},{title:"Tajawal",value:"Tajawal"},{title:"Play",value:"Play"},{title:"Exo",value:"Exo"},{title:"Cinzel",value:"Cinzel"},{title:"Faustina",value:"Faustina"},{title:"Philosopher",value:"Philosopher"},{title:"Gelasio",value:"Gelasio"},{title:"Sofia Sans Condensed",value:"Sofia Sans Condensed"},{title:"Noto Sans Devanagari",value:"Noto Sans Devanagari"},{title:"Actor",value:"Actor"},{title:"Epilogue",value:"Epilogue"},{title:"Glegoo",value:"Glegoo"},{title:"Overlock",value:"Overlock"},{title:"Lustria",value:"Lustria"},{title:"Ovo",value:"Ovo"},{title:"Suranna",value:"Suranna"},{title:"Bebas Neue",value:"Bebas Neue"},{title:"Manrope",value:"Manrope"}],T=()=>{const t=p.useBuilderProp("onSaveBrandingOptions",f.noop),[e,i]=p.useBrandingOptions(),[l]=p.useBlocksContainer(),n=m.useRef(e),{t:v}=k.useTranslation();m.useEffect(()=>()=>{f.isEqual(e,n.current)||t(n.current)},[]);const u=({formData:o},d)=>{d&&(i(o),n.current=o)},{bodyFont:q,headingFont:b,primaryColor:h,bodyTextDarkColor:y,bodyTextLightColor:C,bodyBgDarkColor:S,secondaryColor:j,bodyBgLightColor:O,roundedCorners:B}=e;let s={headingFont:r.y({title:"Heading font",default:b,options:x}),bodyFont:r.y({title:"Body font",default:q,options:x}),roundedCorners:r.c({title:"Rounded Corner",default:parseInt(B||5,10)}),primaryColor:r.f({title:"Primary",default:h}),secondaryColor:r.f({title:"Secondary",default:j})};l||(s={...s,bodyBgLightColor:r.f({title:"Body Background (Light Mode)",default:O}),bodyTextLightColor:r.f({title:"Body Text (Light Mode)",default:y}),bodyBgDarkColor:r.f({title:"Body Background (Dark mode)",default:S}),bodyTextDarkColor:r.f({title:"Body Text (Dark mode)",default:C})});const c={type:"object",properties:{}},g={};return Object.keys(s).forEach(o=>{const d=s[o];return c.properties||(c.properties={}),c.properties[o]=d.schema,g[o]=d.uiSchema,!0}),a.jsxRuntimeExports.jsxs("div",{className:"flex h-full w-60 select-none flex-col",children:[a.jsxRuntimeExports.jsx("div",{className:"rounded-md bg-background/30 p-1",children:a.jsxRuntimeExports.jsx("h1",{className:"px-1 font-semibold",children:v("Theme Configuration")})}),a.jsxRuntimeExports.jsx("div",{className:"-mx-2",children:a.jsxRuntimeExports.jsx(E,{widgets:{color:P},idSeparator:".",autoComplete:"off",omitExtraData:!0,liveOmit:!0,liveValidate:!0,uiSchema:g,schema:c,formData:e,validator:N,onChange:u})})]})};exports.default=T;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-Z_BpKhVy.cjs"),n=require("react"),a=require("@radix-ui/react-icons"),r=require("./ChaiBuilderEditor-qxbkVVLu.cjs"),l=require("react-i18next");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("clsx");require("react-dom");require("@radix-ui/react-scroll-area");require("@floating-ui/react-dom");require("jotai");require("i18next");require("flagged");require("lodash-es");require("./STRINGS-gPz7CUOk.cjs");require("./Functions-N3yhPYKY.cjs");require("tailwind-merge");require("@chaibuilder/runtime");require("@react-hookz/web");require("./MODIFIERS-YPHRtwrM.cjs");require("@radix-ui/react-toggle");require("class-variance-authority");require("./Class-Zc8hpE7f.cjs");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");require("react-hotkeys-hook");require("lucide-react");const p=()=>r.useBuilderProp("languages",["en"]),m=()=>p().length===1?null:e.jsxRuntimeExports.jsx("div",{className:"flex items-center",children:e.jsxRuntimeExports.jsxs(r.Select,{children:[e.jsxRuntimeExports.jsx(r.SelectTrigger,{className:"w-[150px] border-0",children:e.jsxRuntimeExports.jsx(r.SelectValue,{placeholder:e.jsxRuntimeExports.jsxs("span",{className:"flex items-center",children:[e.jsxRuntimeExports.jsx(a.FontFamilyIcon,{className:"h-4 w-4"})," English(US)"]})})}),e.jsxRuntimeExports.jsx(r.SelectContent,{children:e.jsxRuntimeExports.jsxs(r.SelectGroup,{children:[e.jsxRuntimeExports.jsx(r.SelectLabel,{children:"Fruits"}),e.jsxRuntimeExports.jsx(r.SelectItem,{value:"apple",children:"Apple"}),e.jsxRuntimeExports.jsx(r.SelectItem,{value:"banana",children:"Banana"}),e.jsxRuntimeExports.jsx(r.SelectItem,{value:"blueberry",children:"Blueberry"}),e.jsxRuntimeExports.jsx(r.SelectItem,{value:"grapes",children:"Grapes"}),e.jsxRuntimeExports.jsx(r.SelectItem,{value:"pineapple",children:"Pineapple"})]})})]})}),j=()=>{const{savePage:u,saveState:s}=r.useSavePage(),{t:i}=l.useTranslation(),x=r.useBuilderProp("hideSaveButton",!1),t=n.useMemo(()=>{switch(s){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"}},[s]);if(x)return null;const o=e.jsxRuntimeExports.jsxs(r.Button,{disabled:s==="SAVING",onClick:c=>{c.preventDefault(),u()},className:`flex h-auto w-fit items-center gap-x-2 rounded-full p-1.5 px-3 ${t}`,size:"sm",variant:"outline",children:[e.jsxRuntimeExports.jsx(r.FaCircleCheck,{className:"text-lg"}),e.jsxRuntimeExports.jsx("span",{className:"text-sm",children:s==="SAVING"?"Saving...":i(s==="SAVED"?"Saved":"Unsaved")})]});return e.jsxRuntimeExports.jsx("div",{className:"flex items-center",children:o})},d=function(){const s=r.useBuilderProp("previewComponent"),[,i]=r.usePreviewMode(),{t:x}=l.useTranslation();return s?e.jsxRuntimeExports.jsxs(r.Button,{onClick:t=>{t.preventDefault(),i(!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:[e.jsxRuntimeExports.jsx(a.EyeOpenIcon,{className:"text-xs"}),e.jsxRuntimeExports.jsx("span",{className:"text-sm",children:x("Preview")})]}):null},h=()=>{const u=r.useBuilderProp("topBarComponents.left",[]),s=r.useBuilderProp("topBarComponents.center",[]),i=r.useBuilderProp("topBarComponents.right",[]),x=r.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(u.map(t=>e.jsxRuntimeExports.jsx(n.Suspense,{fallback:e.jsxRuntimeExports.jsx(r.Skeleton,{className:"h-10"}),children:e.jsxRuntimeExports.jsx(t,{})})))})}),e.jsxRuntimeExports.jsx("div",{className:"flex items-center space-x-2",children:n.Children.toArray(s.map(t=>e.jsxRuntimeExports.jsx(n.Suspense,{fallback:e.jsxRuntimeExports.jsx(r.Skeleton,{className:"h-10"}),children:e.jsxRuntimeExports.jsx(t,{})})))}),e.jsxRuntimeExports.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsxRuntimeExports.jsx(m,{}),e.jsxRuntimeExports.jsx(d,{}),e.jsxRuntimeExports.jsx(r.Separator,{orientation:"vertical"}),x?e.jsxRuntimeExports.jsx(j,{}):null,n.Children.toArray(i.map(t=>e.jsxRuntimeExports.jsx(n.Suspense,{fallback:e.jsxRuntimeExports.jsx(r.Skeleton,{className:"h-10"}),children:e.jsxRuntimeExports.jsx(t,{})})))]})]})};exports.default=h;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { j as e } from "./jsx-runtime-WbnYoNE9.js";
|
|
2
2
|
import o, { useMemo as h, Suspense as c } from "react";
|
|
3
3
|
import { FontFamilyIcon as j, EyeOpenIcon as g } from "@radix-ui/react-icons";
|
|
4
|
-
import { h as r, a6 as f, a7 as v, a8 as b, a9 as N, am as S, an as w, aa as l, V as y, B as p, ao as C, E as B, ah as m, ap as A } from "./ChaiBuilderEditor-
|
|
4
|
+
import { h as r, a6 as f, a7 as v, a8 as b, a9 as N, am as S, an as w, aa as l, V as y, B as p, ao as C, E as B, ah as m, ap as A } from "./ChaiBuilderEditor-JnZFji5_.js";
|
|
5
5
|
import { useTranslation as x } from "react-i18next";
|
|
6
6
|
import "./_commonjsHelpers-UyOWmZb0.js";
|
|
7
7
|
import "clsx";
|
|
@@ -41,7 +41,6 @@ import "@radix-ui/react-context-menu";
|
|
|
41
41
|
import "react-icons-picker";
|
|
42
42
|
import "react-quill";
|
|
43
43
|
import "react-hotkeys-hook";
|
|
44
|
-
import "lodash";
|
|
45
44
|
import "lucide-react";
|
|
46
45
|
const P = () => r("languages", ["en"]), k = () => P().length === 1 ? null : /* @__PURE__ */ e.jsx("div", { className: "flex items-center", children: /* @__PURE__ */ e.jsxs(f, { children: [
|
|
47
46
|
/* @__PURE__ */ e.jsx(v, { className: "w-[150px] border-0", children: /* @__PURE__ */ e.jsx(
|
|
@@ -108,7 +107,7 @@ const P = () => r("languages", ["en"]), k = () => P().length === 1 ? null : /* @
|
|
|
108
107
|
]
|
|
109
108
|
}
|
|
110
109
|
) : null;
|
|
111
|
-
},
|
|
110
|
+
}, Se = () => {
|
|
112
111
|
const n = r("topBarComponents.left", []), t = r("topBarComponents.center", []), a = r("topBarComponents.right", []), i = r("editable", !0);
|
|
113
112
|
return /* @__PURE__ */ e.jsxs("div", { className: "flex h-14 items-center justify-between px-2", children: [
|
|
114
113
|
/* @__PURE__ */ e.jsx("div", { className: "flex items-center space-x-2", children: /* @__PURE__ */ e.jsx("div", { className: "flex items-center space-x-2 font-bold", children: o.Children.toArray(
|
|
@@ -129,5 +128,5 @@ const P = () => r("languages", ["en"]), k = () => P().length === 1 ? null : /* @
|
|
|
129
128
|
] });
|
|
130
129
|
};
|
|
131
130
|
export {
|
|
132
|
-
|
|
131
|
+
Se as default
|
|
133
132
|
};
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
import { j as e } from "./jsx-runtime-WbnYoNE9.js";
|
|
2
|
+
import { noop as w, has as y, first as f, isEmpty as k, filter as N, values as B, groupBy as h, mergeWith as A, isArray as g, keys as C, get as E, map as L } from "lodash-es";
|
|
3
|
+
import b, { useState as j, useCallback as P, useMemo as I, useRef as T } from "react";
|
|
4
|
+
import { h as M, m as R, L as z, O as G, ag as U, ba as _ } from "./ChaiBuilderEditor-JnZFji5_.js";
|
|
5
|
+
import { syncBlocksWithDefaults as O, useChaiBlocks as S } from "@chaibuilder/runtime";
|
|
6
|
+
import { Loader as F } from "lucide-react";
|
|
7
|
+
import { useAtom as W } from "jotai";
|
|
8
|
+
import { O as D } from "./STRINGS--j49GZJP.js";
|
|
9
|
+
import { CaretRightIcon as K } from "@radix-ui/react-icons";
|
|
10
|
+
import Y from "clsx";
|
|
11
|
+
import { c as q } from "./Functions-7jnEwJyw.js";
|
|
12
|
+
import { useTranslation as H } from "react-i18next";
|
|
13
|
+
import "./_commonjsHelpers-UyOWmZb0.js";
|
|
14
|
+
import "react-dom";
|
|
15
|
+
import "@radix-ui/react-scroll-area";
|
|
16
|
+
import "@floating-ui/react-dom";
|
|
17
|
+
import "i18next";
|
|
18
|
+
import "flagged";
|
|
19
|
+
import "@react-hookz/web";
|
|
20
|
+
import "./MODIFIERS-cBT31iqE.js";
|
|
21
|
+
import "@radix-ui/react-toggle";
|
|
22
|
+
import "class-variance-authority";
|
|
23
|
+
import "./Class-6Hz2KzYb.js";
|
|
24
|
+
import "tailwind-merge";
|
|
25
|
+
import "@radix-ui/react-switch";
|
|
26
|
+
import "@radix-ui/react-slot";
|
|
27
|
+
import "@radix-ui/react-accordion";
|
|
28
|
+
import "@radix-ui/react-alert-dialog";
|
|
29
|
+
import "@radix-ui/react-dialog";
|
|
30
|
+
import "@radix-ui/react-label";
|
|
31
|
+
import "@radix-ui/react-tabs";
|
|
32
|
+
import "@radix-ui/react-tooltip";
|
|
33
|
+
import "@radix-ui/react-popover";
|
|
34
|
+
import "@radix-ui/react-menubar";
|
|
35
|
+
import "@radix-ui/react-hover-card";
|
|
36
|
+
import "@radix-ui/react-select";
|
|
37
|
+
import "@radix-ui/react-dropdown-menu";
|
|
38
|
+
import "@radix-ui/react-separator";
|
|
39
|
+
import "@radix-ui/react-toast";
|
|
40
|
+
import "cmdk";
|
|
41
|
+
import "@radix-ui/react-context-menu";
|
|
42
|
+
import "react-icons-picker";
|
|
43
|
+
import "react-quill";
|
|
44
|
+
import "react-hotkeys-hook";
|
|
45
|
+
const J = ({ block: r, closePopover: c }) => {
|
|
46
|
+
const [m, d] = j(!1), p = M("getExternalPredefinedBlock", w()), { addCoreBlock: i, addPredefinedBlock: a } = R(), [n] = z(), u = P(
|
|
47
|
+
async (x) => {
|
|
48
|
+
if (x.stopPropagation(), y(r, "component")) {
|
|
49
|
+
i(r, f(n)), c();
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
d(!0);
|
|
53
|
+
const l = await p(r);
|
|
54
|
+
k(l) || a(O(l), f(n)), c();
|
|
55
|
+
},
|
|
56
|
+
[r]
|
|
57
|
+
);
|
|
58
|
+
return /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsxs(
|
|
59
|
+
"div",
|
|
60
|
+
{
|
|
61
|
+
onClick: m ? () => {
|
|
62
|
+
} : u,
|
|
63
|
+
className: "relative mt-2 cursor-pointer overflow-hidden rounded-md border border-gray-300 bg-white duration-200 hover:border-blue-500 hover:shadow-xl",
|
|
64
|
+
children: [
|
|
65
|
+
m && /* @__PURE__ */ e.jsxs("div", { className: "absolute flex h-full w-full items-center justify-center bg-black/70", children: [
|
|
66
|
+
/* @__PURE__ */ e.jsx(F, { className: "animate-spin", size: 15, color: "white" }),
|
|
67
|
+
" ",
|
|
68
|
+
/* @__PURE__ */ e.jsx("span", { className: "pl-2 text-sm text-white", children: "Adding..." })
|
|
69
|
+
] }),
|
|
70
|
+
r.preview ? /* @__PURE__ */ e.jsx("img", { src: r.preview, className: "min-h-[25px] w-full rounded-md", alt: r.label }) : /* @__PURE__ */ e.jsx("div", { className: "flex h-20 items-center justify-center rounded-md border border-border border-gray-300 bg-gray-200", children: /* @__PURE__ */ e.jsx("p", { className: "max-w-xs text-center text-sm text-gray-700", children: r.label }) })
|
|
71
|
+
]
|
|
72
|
+
}
|
|
73
|
+
) });
|
|
74
|
+
}, Oe = () => {
|
|
75
|
+
const { data: r } = G(), c = S(), m = N(B(c), { category: "custom" }), d = h(m, "group"), p = h(r, "group"), i = I(() => A(d, p, (o, s) => {
|
|
76
|
+
if (g(o) && g(s))
|
|
77
|
+
return [...o, ...s];
|
|
78
|
+
}), [d, p]), [a, n] = j(f(C(i)) || ""), [, u] = W(U), x = E(i, a, []), { t: l } = H(), t = T(null), v = (o) => {
|
|
79
|
+
t.current && (clearTimeout(t.current), t.current = null), t.current = setTimeout(() => {
|
|
80
|
+
t.current && n(o);
|
|
81
|
+
}, 300);
|
|
82
|
+
};
|
|
83
|
+
return /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsxs("div", { className: "relative flex h-full max-h-full overflow-hidden", children: [
|
|
84
|
+
/* @__PURE__ */ e.jsxs("div", { className: "z-20 flex h-full max-h-full w-40 flex-col overflow-hidden bg-white", children: [
|
|
85
|
+
/* @__PURE__ */ e.jsxs("div", { className: "mb-2 flex flex-col justify-between rounded-md bg-background/30 p-1", children: [
|
|
86
|
+
/* @__PURE__ */ e.jsxs("h1", { className: "flex w-full flex-col items-baseline truncate px-1 text-sm font-semibold xl:flex-col", children: [
|
|
87
|
+
l("Library"),
|
|
88
|
+
": ",
|
|
89
|
+
l("Preline UI")
|
|
90
|
+
] }),
|
|
91
|
+
/* @__PURE__ */ e.jsx("span", { className: "p-0 text-[9px] font-light leading-3 opacity-80 xl:pl-1", children: l("Click to add blocks to page") })
|
|
92
|
+
] }),
|
|
93
|
+
/* @__PURE__ */ e.jsx("hr", {}),
|
|
94
|
+
/* @__PURE__ */ e.jsx("div", { className: "sticky top-0 mt-2 flex h-full w-full flex-col items-center gap-1 px-1", children: b.Children.toArray(
|
|
95
|
+
L(i, (o, s) => /* @__PURE__ */ e.jsxs(
|
|
96
|
+
"div",
|
|
97
|
+
{
|
|
98
|
+
onMouseEnter: () => v(s),
|
|
99
|
+
onMouseLeave: () => clearTimeout(t.current),
|
|
100
|
+
onClick: () => n(s),
|
|
101
|
+
className: q(
|
|
102
|
+
"flex w-full cursor-pointer items-center justify-between rounded-md p-1 text-sm transition-all ease-in-out hover:bg-gray-200",
|
|
103
|
+
s === a ? "bg-blue-500 text-white hover:bg-blue-600" : ""
|
|
104
|
+
),
|
|
105
|
+
children: [
|
|
106
|
+
/* @__PURE__ */ e.jsx("span", { children: s }),
|
|
107
|
+
/* @__PURE__ */ e.jsx(K, { className: "ml-2 h-5 w-5" })
|
|
108
|
+
]
|
|
109
|
+
},
|
|
110
|
+
s
|
|
111
|
+
))
|
|
112
|
+
) })
|
|
113
|
+
] }),
|
|
114
|
+
/* @__PURE__ */ e.jsx(
|
|
115
|
+
"div",
|
|
116
|
+
{
|
|
117
|
+
onMouseEnter: () => {
|
|
118
|
+
t.current && clearTimeout(t.current);
|
|
119
|
+
},
|
|
120
|
+
className: Y(
|
|
121
|
+
"fixed top-0 z-10 flex h-full max-h-full w-80 flex-col gap-2 border-l border-gray-300 bg-white px-2 py-2 transition-all ease-linear",
|
|
122
|
+
a ? "translate-x-40" : "-z-10 -translate-x-40"
|
|
123
|
+
),
|
|
124
|
+
children: /* @__PURE__ */ e.jsx("div", { className: "h--[90%] w-full overflow-hidden", children: /* @__PURE__ */ e.jsxs(_, { className: "h-full space-y-2 px-2", children: [
|
|
125
|
+
b.Children.toArray(
|
|
126
|
+
x.map((o) => /* @__PURE__ */ e.jsx(J, { block: o, closePopover: () => u(D) }))
|
|
127
|
+
),
|
|
128
|
+
/* @__PURE__ */ e.jsx("br", {}),
|
|
129
|
+
/* @__PURE__ */ e.jsx("br", {}),
|
|
130
|
+
/* @__PURE__ */ e.jsx("br", {})
|
|
131
|
+
] }) })
|
|
132
|
+
}
|
|
133
|
+
)
|
|
134
|
+
] }) });
|
|
135
|
+
};
|
|
136
|
+
export {
|
|
137
|
+
Oe as default
|
|
138
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-Z_BpKhVy.cjs"),r=require("lodash-es"),o=require("react"),u=require("./ChaiBuilderEditor-qxbkVVLu.cjs"),q=require("@chaibuilder/runtime"),E=require("lucide-react"),R=require("jotai"),b=require("./STRINGS-gPz7CUOk.cjs"),y=require("@radix-ui/react-icons"),v=require("clsx"),w=require("./Functions-N3yhPYKY.cjs"),N=require("react-i18next");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("react-dom");require("@radix-ui/react-scroll-area");require("@floating-ui/react-dom");require("i18next");require("flagged");require("@react-hookz/web");require("./MODIFIERS-YPHRtwrM.cjs");require("@radix-ui/react-toggle");require("class-variance-authority");require("./Class-Zc8hpE7f.cjs");require("tailwind-merge");require("@radix-ui/react-switch");require("@radix-ui/react-slot");require("@radix-ui/react-accordion");require("@radix-ui/react-alert-dialog");require("@radix-ui/react-dialog");require("@radix-ui/react-label");require("@radix-ui/react-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");require("react-hotkeys-hook");const k=({block:s,closePopover:d})=>{const[m,p]=o.useState(!1),f=u.useBuilderProp("getExternalPredefinedBlock",r.noop()),{addCoreBlock:c,addPredefinedBlock:a}=u.useAddBlock(),[x]=u.useSelectedBlockIds(),j=o.useCallback(async h=>{if(h.stopPropagation(),r.has(s,"component")){c(s,r.first(x)),d();return}p(!0);const l=await f(s);r.isEmpty(l)||a(q.syncBlocksWithDefaults(l),r.first(x)),d()},[s]);return e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:e.jsxRuntimeExports.jsxs("div",{onClick:m?()=>{}:j,className:"relative mt-2 cursor-pointer overflow-hidden rounded-md border border-gray-300 bg-white duration-200 hover:border-blue-500 hover:shadow-xl",children:[m&&e.jsxRuntimeExports.jsxs("div",{className:"absolute flex h-full w-full items-center justify-center bg-black/70",children:[e.jsxRuntimeExports.jsx(E.Loader,{className:"animate-spin",size:15,color:"white"})," ",e.jsxRuntimeExports.jsx("span",{className:"pl-2 text-sm text-white",children:"Adding..."})]}),s.preview?e.jsxRuntimeExports.jsx("img",{src:s.preview,className:"min-h-[25px] w-full rounded-md",alt:s.label}):e.jsxRuntimeExports.jsx("div",{className:"flex h-20 items-center justify-center rounded-md border border-border border-gray-300 bg-gray-200",children:e.jsxRuntimeExports.jsx("p",{className:"max-w-xs text-center text-sm text-gray-700",children:s.label})})]})})},B=()=>{const{data:s}=u.useUILibraryBlocks(),d=q.useChaiBlocks(),m=r.filter(r.values(d),{category:"custom"}),p=r.groupBy(m,"group"),f=r.groupBy(s,"group"),c=o.useMemo(()=>r.mergeWith(p,f,(n,i)=>{if(r.isArray(n)&&r.isArray(i))return[...n,...i]}),[p,f]),[a,x]=o.useState(r.first(r.keys(c))||""),[,j]=R.useAtom(u.activePanelAtom),h=r.get(c,a,[]),{t:l}=N.useTranslation(),t=o.useRef(null),g=n=>{t.current&&(clearTimeout(t.current),t.current=null),t.current=setTimeout(()=>{t.current&&x(n)},300)};return e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:e.jsxRuntimeExports.jsxs("div",{className:"relative flex h-full max-h-full overflow-hidden",children:[e.jsxRuntimeExports.jsxs("div",{className:"z-20 flex h-full max-h-full w-40 flex-col overflow-hidden bg-white",children:[e.jsxRuntimeExports.jsxs("div",{className:"mb-2 flex flex-col justify-between rounded-md bg-background/30 p-1",children:[e.jsxRuntimeExports.jsxs("h1",{className:"flex w-full flex-col items-baseline truncate px-1 text-sm font-semibold xl:flex-col",children:[l("Library"),": ",l("Preline UI")]}),e.jsxRuntimeExports.jsx("span",{className:"p-0 text-[9px] font-light leading-3 opacity-80 xl:pl-1",children:l("Click to add blocks to page")})]}),e.jsxRuntimeExports.jsx("hr",{}),e.jsxRuntimeExports.jsx("div",{className:"sticky top-0 mt-2 flex h-full w-full flex-col items-center gap-1 px-1",children:o.Children.toArray(r.map(c,(n,i)=>e.jsxRuntimeExports.jsxs("div",{onMouseEnter:()=>g(i),onMouseLeave:()=>clearTimeout(t.current),onClick:()=>x(i),className:w.cn("flex w-full cursor-pointer items-center justify-between rounded-md p-1 text-sm transition-all ease-in-out hover:bg-gray-200",i===a?"bg-blue-500 text-white hover:bg-blue-600":""),children:[e.jsxRuntimeExports.jsx("span",{children:i}),e.jsxRuntimeExports.jsx(y.CaretRightIcon,{className:"ml-2 h-5 w-5"})]},i)))})]}),e.jsxRuntimeExports.jsx("div",{onMouseEnter:()=>{t.current&&clearTimeout(t.current)},className:v("fixed top-0 z-10 flex h-full max-h-full w-80 flex-col gap-2 border-l border-gray-300 bg-white px-2 py-2 transition-all ease-linear",a?"translate-x-40":"-z-10 -translate-x-40"),children:e.jsxRuntimeExports.jsx("div",{className:"h--[90%] w-full overflow-hidden",children:e.jsxRuntimeExports.jsxs(u.ScrollArea,{className:"h-full space-y-2 px-2",children:[o.Children.toArray(h.map(n=>e.jsxRuntimeExports.jsx(k,{block:n,closePopover:()=>j(b.OUTLINE_KEY)}))),e.jsxRuntimeExports.jsx("br",{}),e.jsxRuntimeExports.jsx("br",{}),e.jsxRuntimeExports.jsx("br",{})]})})})]})})};exports.default=B;
|
|
@@ -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 B } from "unsplash-js";
|
|
6
|
-
import { h as F, b8 as K, aO as O, aP as Q, aQ as U, a6 as P, a7 as C, a8 as S, a9 as I, aa as h, ba as V, B as H } from "./ChaiBuilderEditor-
|
|
6
|
+
import { h as F, b8 as K, aO as O, aP as Q, aQ as U, a6 as P, a7 as C, a8 as S, a9 as I, aa as h, ba as V, B as H } from "./ChaiBuilderEditor-JnZFji5_.js";
|
|
7
7
|
import { useDebouncedState as R } from "@react-hookz/web";
|
|
8
8
|
import { Loader as $ } from "lucide-react";
|
|
9
9
|
import "./_commonjsHelpers-UyOWmZb0.js";
|
|
@@ -43,12 +43,11 @@ import "@radix-ui/react-context-menu";
|
|
|
43
43
|
import "react-icons-picker";
|
|
44
44
|
import "react-quill";
|
|
45
45
|
import "react-hotkeys-hook";
|
|
46
|
-
import "lodash";
|
|
47
46
|
const k = async (x, g) => new Promise((o, r) => {
|
|
48
47
|
B({ accessKey: g }).search.getPhotos(x).then((i) => {
|
|
49
48
|
o(i);
|
|
50
49
|
}).catch((i) => r(i));
|
|
51
|
-
}),
|
|
50
|
+
}), Fe = ({ isModalView: x, onSelect: g }) => {
|
|
52
51
|
const o = F("unsplashAccessKey", ""), [r, j] = p([]), [i, v] = p(0), [l, A] = p(), [n, q] = p(), [z, y] = p(0), [u, T] = R("", 1e3), [f, c] = p(!1), _ = async (s) => {
|
|
53
52
|
if (d(u))
|
|
54
53
|
return;
|
|
@@ -198,6 +197,6 @@ const k = async (x, g) => new Promise((o, r) => {
|
|
|
198
197
|
] });
|
|
199
198
|
};
|
|
200
199
|
export {
|
|
201
|
-
|
|
200
|
+
Fe as default,
|
|
202
201
|
k as fetchImage
|
|
203
202
|
};
|
|
@@ -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("./ChaiBuilderEditor-qxbkVVLu.cjs"),A=require("@react-hookz/web"),T=require("lucide-react");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("clsx");require("react-dom");require("@radix-ui/react-scroll-area");require("@floating-ui/react-dom");require("jotai");require("i18next");require("react-i18next");require("flagged");require("./STRINGS-gPz7CUOk.cjs");require("./Functions-N3yhPYKY.cjs");require("tailwind-merge");require("@chaibuilder/runtime");require("./MODIFIERS-YPHRtwrM.cjs");require("@radix-ui/react-toggle");require("class-variance-authority");require("./Class-Zc8hpE7f.cjs");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");require("react-hotkeys-hook");const E=async(d,q)=>new Promise((a,n)=>{k.createApi({accessKey:q}).search.getPhotos(d).then(u=>{a(u)}).catch(u=>n(u))}),z=({isModalView:d,onSelect:q})=>{const a=t.useBuilderProp("unsplashAccessKey",""),[n,f]=o.useState([]),[u,g]=o.useState(0),[c,S]=o.useState(),[x,b]=o.useState(),[I,R]=o.useState(0),[j,w]=A.useDebouncedState("",1e3),[h,m]=o.useState(!1),P=async s=>{if(l.isEmpty(j))return;let i=u+1;s&&(s.preventDefault(),i=1),m(!0),g(i);const p={query:j,page:i};c&&(p.orientation=c),x&&(p.color=x),E(p,a).then(r=>{var y,v,N;f(i===1?((y=r==null?void 0:r.response)==null?void 0:y.results)||[]:[...n,...((v=r==null?void 0:r.response)==null?void 0:v.results)||[]]),R((N=r==null?void 0:r.response)==null?void 0:N.total_pages),m(!1)}).catch(()=>{m(!1)})};return o.useEffect(()=>{if(!l.isEmpty(j)&&a){m(!0);const s={query:j,page:1};c&&(s.orientation=c),x&&(s.color=x),g(1),E(s,a).then(i=>{var p,r;f(((p=i==null?void 0:i.response)==null?void 0:p.results)||[]),R((r=i==null?void 0:i.response)==null?void 0:r.total_pages),m(!1)}).catch(()=>{m(!1)})}},[c,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:c,onValueChange:s=>S(s),children:[e.jsxRuntimeExports.jsx(t.SelectTrigger,{className:"h-auto w-40 p-1 px-3",children:e.jsxRuntimeExports.jsx(t.SelectValue,{placeholder:"Select"})}),e.jsxRuntimeExports.jsxs(t.SelectContent,{className:"z-[9999]",children:[e.jsxRuntimeExports.jsx(t.SelectItem,{value:"",children:"All"}),e.jsxRuntimeExports.jsx(t.SelectItem,{value:"landscape",children:"Landscape"}),e.jsxRuntimeExports.jsx(t.SelectItem,{value:"portrait",children:"Portrait"}),e.jsxRuntimeExports.jsx(t.SelectItem,{value:"squarish",children:"Square"})]})]}),e.jsxRuntimeExports.jsx("div",{className:"pb-1 pt-2 text-sm font-medium",children:"Color"}),e.jsxRuntimeExports.jsxs(t.Select,{defaultValue:x,onValueChange:s=>b(s),children:[e.jsxRuntimeExports.jsx(t.SelectTrigger,{className:"h-auto w-40 p-1 px-3",children:e.jsxRuntimeExports.jsx(t.SelectValue,{placeholder:"Select"})}),e.jsxRuntimeExports.jsxs(t.SelectContent,{className:"z-[9999]",children:[e.jsxRuntimeExports.jsx(t.SelectItem,{value:"",children:"All"}),["black_and_white","black","white","yellow","orange","red","purple","magenta","green","teal","blue"].map(s=>e.jsxRuntimeExports.jsx(t.SelectItem,{value:s,children:l.startCase(s)},s))]})]})]})})]})]}),e.jsxRuntimeExports.jsxs(t.ScrollArea,{className:`h-full ${d&&!l.isEmpty(n)?"-mx-2 flex flex-wrap px-2":"-mx-2 flex flex-col pb-8 pt-2"}`,children:[l.isEmpty(n)&&!h&&e.jsxRuntimeExports.jsxs("div",{className:"flex flex-col items-center justify-center py-6",children:[e.jsxRuntimeExports.jsx("div",{className:"font-medium",children:"No Data"}),e.jsxRuntimeExports.jsx("div",{className:"text-sm text-gray-500",children:"Enter query and press enter"})]}),d?e.jsxRuntimeExports.jsx("div",{className:"h-full columns-5 py-2",children:n.map(s=>e.jsxRuntimeExports.jsx("div",{role:"button",tabIndex:0,className:"my-1 flex",onClick:()=>q(s.urls.regular),children:e.jsxRuntimeExports.jsx("div",{className:"relative overflow-hidden rounded-md bg-cover bg-no-repeat",children:e.jsxRuntimeExports.jsx("img",{className:"h-auto flex-1 cursor-pointer rounded-md transition duration-300 ease-in-out hover:scale-105",alt:s.alt_description,src:s.urls.small})})},s.id))}):n.map(s=>e.jsxRuntimeExports.jsx("div",{className:"w-full px-2 py-1",children:e.jsxRuntimeExports.jsx("div",{className:"relative overflow-hidden rounded-md bg-cover bg-no-repeat",children:e.jsxRuntimeExports.jsx("img",{className:"h-auto cursor-pointer transition duration-300 ease-in-out hover:scale-105",alt:s.alt_description,src:s.urls.small})})},s.id)),h&&e.jsxRuntimeExports.jsxs("div",{className:"flex items-center justify-center py-8",children:[e.jsxRuntimeExports.jsx(T.Loader,{className:"animate-spin w-6 h-6"})," Loading..."]}),!l.isEmpty(n)&&u<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=E;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-Z_BpKhVy.cjs"),s=require("react"),u=require("lodash-es"),m=require("@radix-ui/react-icons"),E=require("jotai"),p=require("./ChaiBuilderEditor-qxbkVVLu.cjs");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("clsx");require("react-dom");require("@radix-ui/react-scroll-area");require("@floating-ui/react-dom");require("i18next");require("react-i18next");require("flagged");require("./STRINGS-gPz7CUOk.cjs");require("./Functions-N3yhPYKY.cjs");require("tailwind-merge");require("@chaibuilder/runtime");require("@react-hookz/web");require("./MODIFIERS-YPHRtwrM.cjs");require("@radix-ui/react-toggle");require("class-variance-authority");require("./Class-Zc8hpE7f.cjs");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");require("react-hotkeys-hook");require("lucide-react");const N=E.atom([]),I=({isModalView:t,onSelect:l})=>{const j=p.useBuilderProp("uploadMediaCallback"),a=p.useBuilderProp("fetchMediaCallback"),[i,x]=E.useAtom(N),[n,f]=s.useState(!1),[h,q]=s.useState(!1),[c,d]=s.useState(),[g,R]=s.useState("");s.useEffect(()=>{(async()=>{if(!a)return;q(!0);const r=await a();x(r||[]),q(!1)})()},[]);const v=r=>{var o,b;r&&((b=(o=r==null?void 0:r.target)==null?void 0:o.files)==null?void 0:b.length)>0&&d(r.target.files[0])},y=async()=>{if(j){f(!0);try{const{url:r}=await j(c);l(r),d(void 0);const o=await a();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"}),g&&e.jsxRuntimeExports.jsx("div",{className:"w-full pt-2 text-center text-sm text-red-500",children:g}),e.jsxRuntimeExports.jsxs("div",{className:"flex w-full items-center justify-center gap-2 pt-2",children:[e.jsxRuntimeExports.jsxs("button",{type:"button",onClick:y,disabled:n,className:"flex items-center rounded-full bg-blue-500 px-3 py-1 text-sm text-white hover:bg-blue-600 hover:text-white",children:[n?e.jsxRuntimeExports.jsx(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:[u.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..."})}),u.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:u.map(i,r=>e.jsxRuntimeExports.jsx("div",{role:"button",tabIndex:0,className:"my-1 flex",onClick:()=>l(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))}):u.map(i,r=>e.jsxRuntimeExports.jsx("div",{role:"button",tabIndex:0,className:"px-2 py-1",onClick:()=>l(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;
|
|
@@ -3,7 +3,7 @@ import { useState as l, 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, ba as A } from "./ChaiBuilderEditor-
|
|
6
|
+
import { h as v, ba as A } from "./ChaiBuilderEditor-JnZFji5_.js";
|
|
7
7
|
import "./_commonjsHelpers-UyOWmZb0.js";
|
|
8
8
|
import "clsx";
|
|
9
9
|
import "react-dom";
|
|
@@ -41,9 +41,8 @@ import "@radix-ui/react-context-menu";
|
|
|
41
41
|
import "react-icons-picker";
|
|
42
42
|
import "react-quill";
|
|
43
43
|
import "react-hotkeys-hook";
|
|
44
|
-
import "lodash";
|
|
45
44
|
import "lucide-react";
|
|
46
|
-
const R = F([]),
|
|
45
|
+
const R = F([]), Ne = ({ isModalView: r, onSelect: a }) => {
|
|
47
46
|
const p = v("uploadMediaCallback"), m = v("fetchMediaCallback"), [o, n] = E(R), [s, u] = l(!1), [x, f] = l(!1), [d, c] = l(), [h, y] = l("");
|
|
48
47
|
w(() => {
|
|
49
48
|
(async () => {
|
|
@@ -142,5 +141,5 @@ const R = F([]), Ie = ({ isModalView: r, onSelect: a }) => {
|
|
|
142
141
|
] });
|
|
143
142
|
};
|
|
144
143
|
export {
|
|
145
|
-
|
|
144
|
+
Ne as default
|
|
146
145
|
};
|
|
@@ -1,10 +1,10 @@
|
|
|
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 { _ as b, B as u, Z as C, ab as A } from "./ChaiBuilderEditor-
|
|
4
|
+
import { _ as b, B as u, Z as C, ab as A } from "./ChaiBuilderEditor-JnZFji5_.js";
|
|
5
5
|
import { l as g } from "./controls-VTdJhdSz.js";
|
|
6
|
-
import { F as D } from "./form-
|
|
7
|
-
import { e as N } from "./index-
|
|
6
|
+
import { F as D } from "./form-e8l4xtI9.js";
|
|
7
|
+
import { e as N } from "./index-CdnwVCXv.js";
|
|
8
8
|
import "./_commonjsHelpers-UyOWmZb0.js";
|
|
9
9
|
import "clsx";
|
|
10
10
|
import "react-dom";
|
|
@@ -44,7 +44,6 @@ import "@radix-ui/react-context-menu";
|
|
|
44
44
|
import "react-icons-picker";
|
|
45
45
|
import "react-quill";
|
|
46
46
|
import "react-hotkeys-hook";
|
|
47
|
-
import "lodash";
|
|
48
47
|
import "lucide-react";
|
|
49
48
|
import "@rjsf/core";
|
|
50
49
|
import "@rjsf/validator-ajv8";
|
|
@@ -52,9 +51,9 @@ import "./core.js";
|
|
|
52
51
|
import "sonner";
|
|
53
52
|
import "./html-to-json-Z6R2o_fA.js";
|
|
54
53
|
import "himalaya";
|
|
55
|
-
const S = ({ closeModal:
|
|
54
|
+
const S = ({ closeModal: o }) => {
|
|
56
55
|
var a, s;
|
|
57
|
-
const i = N(), [
|
|
56
|
+
const i = N(), [e, f] = c({
|
|
58
57
|
name: "",
|
|
59
58
|
slug: "",
|
|
60
59
|
blocks: [],
|
|
@@ -62,7 +61,7 @@ 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;
|
|
@@ -75,30 +74,30 @@ const S = ({ closeModal: e }) => {
|
|
|
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(b, { 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 || ((a = e.name) == null ? void 0 : a.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(C, { 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(C, { 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"),x=require("react"),P=require("lodash-es"),t=require("./ChaiBuilderEditor-qxbkVVLu.cjs"),g=require("./controls-jWJDao88.cjs"),R=require("./form-o7e6NNTk.cjs"),f=require("./index--XTVdy1h.cjs");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("clsx");require("react-dom");require("@radix-ui/react-scroll-area");require("@floating-ui/react-dom");require("jotai");require("i18next");require("react-i18next");require("flagged");require("./STRINGS-gPz7CUOk.cjs");require("./Functions-N3yhPYKY.cjs");require("tailwind-merge");require("@chaibuilder/runtime");require("@react-hookz/web");require("./MODIFIERS-YPHRtwrM.cjs");require("@radix-ui/react-toggle");require("class-variance-authority");require("./Class-Zc8hpE7f.cjs");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-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");require("react-hotkeys-hook");require("lucide-react");require("@rjsf/core");require("@rjsf/validator-ajv8");require("./core.cjs");require("sonner");require("./html-to-json-VPWiWWGH.cjs");require("himalaya");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.l({title:"Page Name",default:r.name}),slug:g.l({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 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-Z_BpKhVy.cjs"),r=require("./ChaiBuilderEditor-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-Z_BpKhVy.cjs"),r=require("./ChaiBuilderEditor-qxbkVVLu.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("i18next");require("react-i18next");require("flagged");require("lodash-es");require("./STRINGS-gPz7CUOk.cjs");require("./Functions-N3yhPYKY.cjs");require("tailwind-merge");require("@chaibuilder/runtime");require("@react-hookz/web");require("./MODIFIERS-YPHRtwrM.cjs");require("@radix-ui/react-toggle");require("class-variance-authority");require("./Class-Zc8hpE7f.cjs");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-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");require("react-hotkeys-hook");require("lucide-react");const x=({open:q,onCancel:t=()=>{},onConfirm:s,title:n,description:i,disabled:u,cancelText:l="Discard",confirmText:o="Save"})=>e.jsxRuntimeExports.jsx(r.AlertDialog,{open:q,children:e.jsxRuntimeExports.jsxs(r.AlertDialogContent,{children:[e.jsxRuntimeExports.jsx(r.AlertDialogTitle,{children:n}),i&&e.jsxRuntimeExports.jsx(r.AlertDialogDescription,{children:i}),e.jsxRuntimeExports.jsxs("div",{className:"flex items-center justify-end gap-x-3",children:[e.jsxRuntimeExports.jsx(r.AlertDialogCancel,{disabled:u,onClick:t,children:l}),e.jsxRuntimeExports.jsx(r.Button,{variant:"default",onClick:s,disabled:u,children:o})]})]})});exports.default=x;
|
|
@@ -1,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 "./ChaiBuilderEditor-
|
|
2
|
+
import { A as a, b as n, d as c, e as x, g as d, B as j } from "./ChaiBuilderEditor-JnZFji5_.js";
|
|
3
3
|
import "./_commonjsHelpers-UyOWmZb0.js";
|
|
4
4
|
import "react";
|
|
5
5
|
import "clsx";
|
|
@@ -41,9 +41,8 @@ import "@radix-ui/react-context-menu";
|
|
|
41
41
|
import "react-icons-picker";
|
|
42
42
|
import "react-quill";
|
|
43
43
|
import "react-hotkeys-hook";
|
|
44
|
-
import "lodash";
|
|
45
44
|
import "lucide-react";
|
|
46
|
-
const
|
|
45
|
+
const pi = ({
|
|
47
46
|
open: o,
|
|
48
47
|
onCancel: m = () => {
|
|
49
48
|
},
|
|
@@ -62,5 +61,5 @@ const ei = ({
|
|
|
62
61
|
] })
|
|
63
62
|
] }) });
|
|
64
63
|
export {
|
|
65
|
-
|
|
64
|
+
pi as default
|
|
66
65
|
};
|