@chaibuilder/sdk 1.3.0-beta.8 → 1.3.0-beta.9
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/CodeEditor-CTpbkvn0.cjs +1 -0
- package/dist/CodeEditor-ChxA5nBg.js +77 -0
- package/dist/STRINGS-eiGM83kj.js +7 -0
- package/dist/STRINGS-ew98weUe.cjs +1 -0
- package/dist/Topbar-QwR6PKnl.cjs +1 -0
- package/dist/Topbar-z1o2yz-v.js +113 -0
- package/dist/UnsplashImages-BZ4Uvn_u.cjs +1 -0
- package/dist/UnsplashImages-BiXwCeGg.js +189 -0
- package/dist/UploadImages-BeAGmTnm.js +101 -0
- package/dist/UploadImages-e9ItP1o-.cjs +1 -0
- package/dist/context-menu-BbqLeYFX.js +979 -0
- package/dist/context-menu-DfAXjmc8.cjs +1 -0
- package/dist/controls-C4n5ycp4.cjs +1 -0
- package/dist/controls-Com-zYCq.js +234 -0
- package/dist/core.cjs +1 -82
- package/dist/core.d.ts +8 -4
- package/dist/core.js +74 -74
- package/dist/iconBase-Cn2BsTrq.cjs +1 -0
- package/dist/iconBase-DHfFLkem.js +124 -0
- package/dist/index-Cu1kFTGh.cjs +63 -0
- package/dist/index-D1NbGHAC.js +9318 -0
- package/dist/jsx-runtime-BYECrxsp.cjs +30 -0
- package/dist/jsx-runtime-DGlMoOmv.js +630 -0
- package/dist/plugin-BOEoR5jk.js +44 -0
- package/dist/plugin-COMQcYlW.cjs +1 -0
- package/dist/plugin-Dw854zFv.js +107 -0
- package/dist/plugin-I9XxF65G.cjs +1 -0
- package/dist/render.cjs +2 -208
- package/dist/render.js +125 -171
- package/dist/runtime.cjs +1 -26
- package/dist/runtime.js +16 -16
- package/dist/style.css +2 -1529
- package/dist/tailwind.cjs +1 -78
- package/dist/tailwind.js +19 -21
- package/dist/ui.cjs +1 -392
- package/dist/ui.js +257 -268
- package/dist/web-blocks.cjs +3 -1241
- package/dist/web-blocks.js +555 -764
- package/package.json +1 -1
- package/dist/CodeEditor-1LboGb1I.cjs +0 -91
- package/dist/CodeEditor-BKgZeXwz.js +0 -91
- package/dist/STRINGS-3Sn_NeX1.cjs +0 -9
- package/dist/STRINGS-DdpfVlsV.js +0 -10
- package/dist/Topbar-B8IS6y4H.js +0 -135
- package/dist/Topbar-DXC7DFU1.cjs +0 -135
- package/dist/UnsplashImages-CjJ5szAy.cjs +0 -215
- package/dist/UnsplashImages-Ck9qpKR0.js +0 -215
- package/dist/UploadImages-DW1mj4MB.cjs +0 -117
- package/dist/UploadImages-DgAMZ8GR.js +0 -117
- package/dist/context-menu-BLbuduri.cjs +0 -1073
- package/dist/context-menu-BgtRnByf.js +0 -1042
- package/dist/controls-8EZmm0Ns.js +0 -234
- package/dist/controls-DaW52RjX.cjs +0 -233
- package/dist/iconBase-BSrIcOaG.cjs +0 -146
- package/dist/iconBase-CWgVxu0A.js +0 -147
- package/dist/index-Bjw2sUN2.cjs +0 -12139
- package/dist/index-D8_rAW8B.js +0 -12124
- package/dist/jsx-runtime-B6vEU3CM.cjs +0 -925
- package/dist/jsx-runtime-ClFauRgV.js +0 -926
- package/dist/plugin-BYwesM58.cjs +0 -54
- package/dist/plugin-BiDLHDo3.cjs +0 -114
- package/dist/plugin-BukD7GJR.js +0 -115
- package/dist/plugin-tVAEvXiS.js +0 -55
package/dist/web-blocks.cjs
CHANGED
|
@@ -1,840 +1,6 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const runtime = require("@chaibuilder/runtime");
|
|
4
|
-
const jsxRuntime = require("./jsx-runtime-B6vEU3CM.cjs");
|
|
5
|
-
const React = require("react");
|
|
6
|
-
const controls = require("./controls-DaW52RjX.cjs");
|
|
7
|
-
const iconBase = require("./iconBase-BSrIcOaG.cjs");
|
|
8
|
-
const reactIcons = require("@radix-ui/react-icons");
|
|
9
|
-
const lodashEs = require("lodash-es");
|
|
10
|
-
const lucideReact = require("lucide-react");
|
|
11
|
-
function _interopNamespaceDefault(e) {
|
|
12
|
-
const n = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } });
|
|
13
|
-
if (e) {
|
|
14
|
-
for (const k in e) {
|
|
15
|
-
if (k !== "default") {
|
|
16
|
-
const d = Object.getOwnPropertyDescriptor(e, k);
|
|
17
|
-
Object.defineProperty(n, k, d.get ? d : {
|
|
18
|
-
enumerable: true,
|
|
19
|
-
get: () => e[k]
|
|
20
|
-
});
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
n.default = e;
|
|
25
|
-
return Object.freeze(n);
|
|
26
|
-
}
|
|
27
|
-
const React__namespace = /* @__PURE__ */ _interopNamespaceDefault(React);
|
|
28
|
-
const EmptySlot = ({ className = "", inBuilder }) => {
|
|
29
|
-
if (!inBuilder) return null;
|
|
30
|
-
return /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx("div", { className: iconBase.cn("pointer-events-none flex h-20 flex-col items-center justify-center p-2", className), children: /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx("div", { className: "h-full w-full rounded bg-gray-200 p-2 dark:bg-gray-800", children: /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx("div", { className: "flex h-full w-full items-center justify-center outline-dashed outline-1 -outline-offset-1 outline-gray-400 duration-300 dark:outline-gray-700" }) }) });
|
|
31
|
-
};
|
|
32
|
-
const Component$2 = (props) => {
|
|
33
|
-
const { blockProps, inBuilder, backgroundImage, children, tag = "div", styles } = props;
|
|
34
|
-
let nestedChildren = children;
|
|
35
|
-
if (!children) {
|
|
36
|
-
nestedChildren = /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(EmptySlot, { inBuilder });
|
|
37
|
-
}
|
|
38
|
-
let cssStyles = {};
|
|
39
|
-
if (backgroundImage) {
|
|
40
|
-
cssStyles = { backgroundImage: `url(${backgroundImage})` };
|
|
41
|
-
}
|
|
42
|
-
return React__namespace.createElement(tag, { ...blockProps, ...styles, style: cssStyles }, nestedChildren);
|
|
43
|
-
};
|
|
44
|
-
const Config$s = {
|
|
45
|
-
type: "Box",
|
|
46
|
-
label: "web_blocks.box",
|
|
47
|
-
category: "core",
|
|
48
|
-
group: "basic",
|
|
49
|
-
props: {
|
|
50
|
-
styles: controls.T({ default: "" }),
|
|
51
|
-
tag: controls.y({
|
|
52
|
-
title: "web_blocks.tag",
|
|
53
|
-
default: "div",
|
|
54
|
-
options: [
|
|
55
|
-
{ value: "div", title: "web_blocks.div" },
|
|
56
|
-
{ value: "header", title: "web_blocks.header" },
|
|
57
|
-
{ value: "footer", title: "web_blocks.footer" },
|
|
58
|
-
{ value: "section", title: "web_blocks.section" },
|
|
59
|
-
{ value: "article", title: "web_blocks.article" },
|
|
60
|
-
{ value: "aside", title: "web_blocks.aside" },
|
|
61
|
-
{ value: "main", title: "web_blocks.main" },
|
|
62
|
-
{ value: "nav", title: "web_blocks.nav" },
|
|
63
|
-
{ value: "figure", title: "web_blocks.figure" },
|
|
64
|
-
{ value: "details", title: "web_blocks.details" },
|
|
65
|
-
{ value: "summary", title: "web_blocks.summary" },
|
|
66
|
-
{ value: "dialog", title: "web_blocks.dialog" },
|
|
67
|
-
{ value: "strike", title: "web_blocks.strike" },
|
|
68
|
-
{ value: "caption", title: "web_blocks.caption" },
|
|
69
|
-
{ value: "legend", title: "web_blocks.legend" },
|
|
70
|
-
{ value: "figcaption", title: "web_blocks.figcaption" },
|
|
71
|
-
{ value: "mark", title: "web_blocks.mark" }
|
|
72
|
-
]
|
|
73
|
-
}),
|
|
74
|
-
backgroundImage: controls.x({ title: "web_blocks.background_image" })
|
|
75
|
-
},
|
|
76
|
-
canAcceptBlock: () => true
|
|
77
|
-
};
|
|
78
|
-
const Component$1 = (block) => {
|
|
79
|
-
const { blockProps, iconSize, icon, content, iconPos, styles, children } = block;
|
|
80
|
-
const _icon = icon;
|
|
81
|
-
const child = children || /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsxs(jsxRuntime.jsxRuntimeExports.Fragment, { children: [
|
|
82
|
-
/* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx("span", { "data-ai-key": "content", children: content }),
|
|
83
|
-
_icon && /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(
|
|
84
|
-
"div",
|
|
85
|
-
{
|
|
86
|
-
style: { width: iconSize + "px" },
|
|
87
|
-
className: iconPos + " " + (iconPos === "order-first" ? "mr-2" : "ml-2") || "",
|
|
88
|
-
dangerouslySetInnerHTML: { __html: _icon }
|
|
89
|
-
}
|
|
90
|
-
)
|
|
91
|
-
] });
|
|
92
|
-
return React__namespace.createElement(
|
|
93
|
-
"button",
|
|
94
|
-
{
|
|
95
|
-
...blockProps,
|
|
96
|
-
...styles,
|
|
97
|
-
type: "button"
|
|
98
|
-
},
|
|
99
|
-
child
|
|
100
|
-
);
|
|
101
|
-
};
|
|
102
|
-
const Config$r = {
|
|
103
|
-
type: "Button",
|
|
104
|
-
label: "web_blocks.button",
|
|
105
|
-
category: "core",
|
|
106
|
-
icon: reactIcons.ButtonIcon,
|
|
107
|
-
group: "basic",
|
|
108
|
-
props: {
|
|
109
|
-
content: controls.g({ title: "web_blocks.label", default: "Button", ai: true, i18n: true }),
|
|
110
|
-
styles: controls.T({ default: "text-white bg-primary px-4 py-2 rounded-global flex items-center" }),
|
|
111
|
-
icon: controls.q({ title: "web_blocks.icon", default: `` }),
|
|
112
|
-
iconSize: controls.s({ title: "web_blocks.icon_size", default: 24 }),
|
|
113
|
-
iconPos: controls.y({
|
|
114
|
-
title: "web_blocks.icon_position",
|
|
115
|
-
default: "order-last",
|
|
116
|
-
options: [
|
|
117
|
-
{ title: "web_blocks.start", value: "order-first" },
|
|
118
|
-
{ title: "web_blocks.end", value: "order-last" }
|
|
119
|
-
]
|
|
120
|
-
})
|
|
121
|
-
}
|
|
122
|
-
};
|
|
123
|
-
const CustomHTMLBlock = (props) => {
|
|
124
|
-
const { blockProps, styles, htmlCode, inBuilder } = props;
|
|
125
|
-
return inBuilder ? /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsxs("div", { className: "relative", children: [
|
|
126
|
-
inBuilder ? /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx("div", { ...blockProps, ...styles, className: "absolute z-20 h-full w-full" }) : null,
|
|
127
|
-
React__namespace.createElement("div", {
|
|
128
|
-
...styles,
|
|
129
|
-
dangerouslySetInnerHTML: { __html: htmlCode.replace(/<script.*?>.*?<\/script>/g, "") }
|
|
130
|
-
})
|
|
131
|
-
] }) : React__namespace.createElement("div", {
|
|
132
|
-
...blockProps,
|
|
133
|
-
...styles,
|
|
134
|
-
dangerouslySetInnerHTML: { __html: htmlCode }
|
|
135
|
-
});
|
|
136
|
-
};
|
|
137
|
-
const Config$q = {
|
|
138
|
-
type: "CustomHTML",
|
|
139
|
-
label: "web_blocks.custom_html",
|
|
140
|
-
category: "core",
|
|
141
|
-
icon: reactIcons.CodeIcon,
|
|
142
|
-
group: "advanced",
|
|
143
|
-
props: {
|
|
144
|
-
styles: controls.T({ default: "" }),
|
|
145
|
-
htmlCode: controls.l({
|
|
146
|
-
title: "web_blocks.html_code",
|
|
147
|
-
default: "<div><p>Enter your HTML code here...</p></div>",
|
|
148
|
-
placeholder: "web_blocks.placeholder"
|
|
149
|
-
})
|
|
150
|
-
}
|
|
151
|
-
};
|
|
152
|
-
const EmptyBox = React__namespace.memo(
|
|
153
|
-
(props) => {
|
|
154
|
-
const { blockProps, styles, backgroundImage } = props;
|
|
155
|
-
let cssStyles = {};
|
|
156
|
-
if (backgroundImage) {
|
|
157
|
-
cssStyles = { backgroundImage: `url(${backgroundImage})` };
|
|
158
|
-
}
|
|
159
|
-
return React__namespace.createElement("div", { ...blockProps, ...styles, style: cssStyles });
|
|
160
|
-
}
|
|
161
|
-
);
|
|
162
|
-
const Config$p = {
|
|
163
|
-
type: "EmptyBox",
|
|
164
|
-
label: "web_blocks.empty_box",
|
|
165
|
-
category: "core",
|
|
166
|
-
group: "basic",
|
|
167
|
-
props: {
|
|
168
|
-
styles: controls.T({ default: "" }),
|
|
169
|
-
backgroundImage: controls.x({ title: "Background Image" })
|
|
170
|
-
}
|
|
171
|
-
};
|
|
172
|
-
const HeadingBlock = (props) => {
|
|
173
|
-
const { blockProps, styles, content, level = "h1", children = null } = props;
|
|
174
|
-
if (children) return React__namespace.createElement(level, { ...styles, ...blockProps }, children);
|
|
175
|
-
return React__namespace.createElement(level, {
|
|
176
|
-
...styles,
|
|
177
|
-
...blockProps,
|
|
178
|
-
"data-ai-key": "content",
|
|
179
|
-
"data-ai-type": "html",
|
|
180
|
-
dangerouslySetInnerHTML: { __html: content }
|
|
181
|
-
});
|
|
182
|
-
};
|
|
183
|
-
const Config$o = {
|
|
184
|
-
type: "Heading",
|
|
185
|
-
label: "web_blocks.heading",
|
|
186
|
-
category: "core",
|
|
187
|
-
icon: reactIcons.HeadingIcon,
|
|
188
|
-
group: "typography",
|
|
189
|
-
props: {
|
|
190
|
-
level: controls.y({
|
|
191
|
-
title: "web_blocks.level",
|
|
192
|
-
default: "h2",
|
|
193
|
-
binding: false,
|
|
194
|
-
options: [
|
|
195
|
-
{ value: "h1", title: "h1" },
|
|
196
|
-
{ value: "h2", title: "h2" },
|
|
197
|
-
{ value: "h3", title: "h3" },
|
|
198
|
-
{ value: "h4", title: "h4" },
|
|
199
|
-
{ value: "h5", title: "h5" },
|
|
200
|
-
{ value: "h6", title: "h6" }
|
|
201
|
-
]
|
|
202
|
-
}),
|
|
203
|
-
styles: controls.T({ default: "text-3xl" }),
|
|
204
|
-
content: controls.f({ title: "Content", default: "Heading goes here", ai: true, i18n: true })
|
|
205
|
-
},
|
|
206
|
-
canAcceptBlock: (type) => type === "Span" || type === "Text"
|
|
207
|
-
};
|
|
208
|
-
const ParagraphBlock = (props) => {
|
|
209
|
-
const { blockProps, styles, content } = props;
|
|
210
|
-
if (!lodashEs.isNull(props.children)) return React__namespace.createElement("p", { ...styles, ...blockProps }, props.children);
|
|
211
|
-
return React__namespace.createElement("p", {
|
|
212
|
-
...styles,
|
|
213
|
-
...blockProps,
|
|
214
|
-
"data-ai-key": "content",
|
|
215
|
-
"data-ai-type": "html",
|
|
216
|
-
dangerouslySetInnerHTML: { __html: content }
|
|
217
|
-
});
|
|
218
|
-
};
|
|
219
|
-
const Config$n = {
|
|
220
|
-
type: "Paragraph",
|
|
221
|
-
label: "Paragraph",
|
|
222
|
-
category: "core",
|
|
223
|
-
icon: reactIcons.TextIcon,
|
|
224
|
-
group: "typography",
|
|
225
|
-
props: {
|
|
226
|
-
styles: controls.T({ default: "" }),
|
|
227
|
-
content: controls.f({
|
|
228
|
-
title: "Content",
|
|
229
|
-
default: `Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse varius enim in eros elementum tristique.
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const p=require("@chaibuilder/runtime"),a=require("./jsx-runtime-BYECrxsp.cjs"),E=require("react"),t=require("./controls-C4n5ycp4.cjs"),y=require("./iconBase-Cn2BsTrq.cjs"),g=require("@radix-ui/react-icons"),f=require("lodash-es"),C=require("lucide-react");function I(e){const o=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const l in e)if(l!=="default"){const s=Object.getOwnPropertyDescriptor(e,l);Object.defineProperty(o,l,s.get?s:{enumerable:!0,get:()=>e[l]})}}return o.default=e,Object.freeze(o)}const m=I(E),w=({className:e="",inBuilder:o})=>o?a.jsxRuntimeExports.jsx("div",{className:y.cn("pointer-events-none flex h-20 flex-col items-center justify-center p-2",e),children:a.jsxRuntimeExports.jsx("div",{className:"h-full w-full rounded bg-gray-200 p-2 dark:bg-gray-800",children:a.jsxRuntimeExports.jsx("div",{className:"flex h-full w-full items-center justify-center outline-dashed outline-1 -outline-offset-1 outline-gray-400 duration-300 dark:outline-gray-700"})})}):null,L=e=>{const{blockProps:o,inBuilder:l,backgroundImage:s,children:r,tag:n="div",styles:i}=e;let c=r;r||(c=a.jsxRuntimeExports.jsx(w,{inBuilder:l}));let u={};return s&&(u={backgroundImage:`url(${s})`}),m.createElement(n,{...o,...i,style:u},c)},R={type:"Box",label:"web_blocks.box",category:"core",group:"basic",props:{styles:t.T({default:""}),tag:t.y({title:"web_blocks.tag",default:"div",options:[{value:"div",title:"web_blocks.div"},{value:"header",title:"web_blocks.header"},{value:"footer",title:"web_blocks.footer"},{value:"section",title:"web_blocks.section"},{value:"article",title:"web_blocks.article"},{value:"aside",title:"web_blocks.aside"},{value:"main",title:"web_blocks.main"},{value:"nav",title:"web_blocks.nav"},{value:"figure",title:"web_blocks.figure"},{value:"details",title:"web_blocks.details"},{value:"summary",title:"web_blocks.summary"},{value:"dialog",title:"web_blocks.dialog"},{value:"strike",title:"web_blocks.strike"},{value:"caption",title:"web_blocks.caption"},{value:"legend",title:"web_blocks.legend"},{value:"figcaption",title:"web_blocks.figcaption"},{value:"mark",title:"web_blocks.mark"}]}),backgroundImage:t.x({title:"web_blocks.background_image"})},canAcceptBlock:()=>!0},S=e=>{const{blockProps:o,iconSize:l,icon:s,content:r,iconPos:n,styles:i,children:c}=e,u=s,d=c||a.jsxRuntimeExports.jsxs(a.jsxRuntimeExports.Fragment,{children:[a.jsxRuntimeExports.jsx("span",{"data-ai-key":"content",children:r}),u&&a.jsxRuntimeExports.jsx("div",{style:{width:l+"px"},className:n+" "+(n==="order-first"?"mr-2":"ml-2")||"",dangerouslySetInnerHTML:{__html:u}})]});return m.createElement("button",{...o,...i,type:"button"},d)},T={type:"Button",label:"web_blocks.button",category:"core",icon:g.ButtonIcon,group:"basic",props:{content:t.g({title:"web_blocks.label",default:"Button",ai:!0,i18n:!0}),styles:t.T({default:"text-white bg-primary px-4 py-2 rounded-global flex items-center"}),icon:t.q({title:"web_blocks.icon",default:""}),iconSize:t.s({title:"web_blocks.icon_size",default:24}),iconPos:t.y({title:"web_blocks.icon_position",default:"order-last",options:[{title:"web_blocks.start",value:"order-first"},{title:"web_blocks.end",value:"order-last"}]})}},M=e=>{const{blockProps:o,styles:l,htmlCode:s,inBuilder:r}=e;return r?a.jsxRuntimeExports.jsxs("div",{className:"relative",children:[r?a.jsxRuntimeExports.jsx("div",{...o,...l,className:"absolute z-20 h-full w-full"}):null,m.createElement("div",{...l,dangerouslySetInnerHTML:{__html:s.replace(/<script.*?>.*?<\/script>/g,"")}})]}):m.createElement("div",{...o,...l,dangerouslySetInnerHTML:{__html:s}})},$={type:"CustomHTML",label:"web_blocks.custom_html",category:"core",icon:g.CodeIcon,group:"advanced",props:{styles:t.T({default:""}),htmlCode:t.l({title:"web_blocks.html_code",default:"<div><p>Enter your HTML code here...</p></div>",placeholder:"web_blocks.placeholder"})}},P=m.memo(e=>{const{blockProps:o,styles:l,backgroundImage:s}=e;let r={};return s&&(r={backgroundImage:`url(${s})`}),m.createElement("div",{...o,...l,style:r})}),N={type:"EmptyBox",label:"web_blocks.empty_box",category:"core",group:"basic",props:{styles:t.T({default:""}),backgroundImage:t.x({title:"Background Image"})}},q=e=>{const{blockProps:o,styles:l,content:s,level:r="h1",children:n=null}=e;return n?m.createElement(r,{...l,...o},n):m.createElement(r,{...l,...o,"data-ai-key":"content","data-ai-type":"html",dangerouslySetInnerHTML:{__html:s}})},H={type:"Heading",label:"web_blocks.heading",category:"core",icon:g.HeadingIcon,group:"typography",props:{level:t.y({title:"web_blocks.level",default:"h2",binding:!1,options:[{value:"h1",title:"h1"},{value:"h2",title:"h2"},{value:"h3",title:"h3"},{value:"h4",title:"h4"},{value:"h5",title:"h5"},{value:"h6",title:"h6"}]}),styles:t.T({default:"text-3xl"}),content:t.f({title:"Content",default:"Heading goes here",ai:!0,i18n:!0})},canAcceptBlock:e=>e==="Span"||e==="Text"},D=e=>{const{blockProps:o,styles:l,content:s}=e;return f.isNull(e.children)?m.createElement("p",{...l,...o,"data-ai-key":"content","data-ai-type":"html",dangerouslySetInnerHTML:{__html:s}}):m.createElement("p",{...l,...o},e.children)},z={type:"Paragraph",label:"Paragraph",category:"core",icon:g.TextIcon,group:"typography",props:{styles:t.T({default:""}),content:t.f({title:"Content",default:`Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse varius enim in eros elementum tristique.
|
|
230
2
|
Duis cursus, mi quis viverra ornare, eros dolor interdum nulla, ut commodo diam libero vitae erat. Aenean faucibus
|
|
231
|
-
nibh et justo cursus id rutrum lorem imperdiet. Nunc ut sem vitae risus tristique posuere.`,
|
|
232
|
-
ai: true,
|
|
233
|
-
i18n: true
|
|
234
|
-
})
|
|
235
|
-
},
|
|
236
|
-
canAcceptBlock: (type) => type === "Span" || type === "Link" || type === "Text"
|
|
237
|
-
};
|
|
238
|
-
const SpanBlock = (props) => {
|
|
239
|
-
const { blockProps, styles, content, children = null, tag } = props;
|
|
240
|
-
if (children) return React__namespace.createElement("span", { ...styles, ...blockProps }, children);
|
|
241
|
-
return React__namespace.createElement(tag || "span", {
|
|
242
|
-
...styles,
|
|
243
|
-
...blockProps,
|
|
244
|
-
"data-ai-key": "content",
|
|
245
|
-
dangerouslySetInnerHTML: { __html: content || "" }
|
|
246
|
-
});
|
|
247
|
-
};
|
|
248
|
-
const Config$m = {
|
|
249
|
-
type: "Span",
|
|
250
|
-
label: "Span",
|
|
251
|
-
category: "core",
|
|
252
|
-
group: "typography",
|
|
253
|
-
props: {
|
|
254
|
-
styles: controls.T({ default: "" }),
|
|
255
|
-
content: controls.f({ title: "Content", default: "", ai: true, i18n: true })
|
|
256
|
-
},
|
|
257
|
-
canAcceptBlock: () => true
|
|
258
|
-
};
|
|
259
|
-
const RichTextBlock = (props) => {
|
|
260
|
-
const { blockProps, content, styles } = props;
|
|
261
|
-
return /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx("div", { className: "max-w-full", children: /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(
|
|
262
|
-
"div",
|
|
263
|
-
{
|
|
264
|
-
"data-ai-key": "content",
|
|
265
|
-
"data-ai-type": "richtext",
|
|
266
|
-
...blockProps,
|
|
267
|
-
...styles,
|
|
268
|
-
dangerouslySetInnerHTML: { __html: content }
|
|
269
|
-
}
|
|
270
|
-
) });
|
|
271
|
-
};
|
|
272
|
-
const Config$l = {
|
|
273
|
-
type: "RichText",
|
|
274
|
-
label: "Rich Text",
|
|
275
|
-
category: "core",
|
|
276
|
-
icon: reactIcons.CursorTextIcon,
|
|
277
|
-
group: "typography",
|
|
278
|
-
props: {
|
|
279
|
-
styles: controls.T({ default: "" }),
|
|
280
|
-
content: controls.m({
|
|
281
|
-
title: "Content",
|
|
282
|
-
ai: true,
|
|
283
|
-
i18n: true,
|
|
284
|
-
default: "<p>This is a rich text block. You can add text, and other content here.</p>"
|
|
285
|
-
})
|
|
286
|
-
}
|
|
287
|
-
};
|
|
288
|
-
const LinkBlock = (props) => {
|
|
289
|
-
const { blockProps, link, children, styles, inBuilder, content } = props;
|
|
290
|
-
let emptyStyles = {};
|
|
291
|
-
if (!children && lodashEs.isEmpty(content)) {
|
|
292
|
-
emptyStyles = { minHeight: "50px", display: "flex", alignItems: "center", justifyContent: "center" };
|
|
293
|
-
}
|
|
294
|
-
if (inBuilder) {
|
|
295
|
-
if (children) {
|
|
296
|
-
return /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx("span", { ...blockProps, style: emptyStyles, ...styles, children });
|
|
297
|
-
} else {
|
|
298
|
-
return React__namespace.createElement(
|
|
299
|
-
"span",
|
|
300
|
-
{
|
|
301
|
-
...blockProps,
|
|
302
|
-
...styles,
|
|
303
|
-
style: emptyStyles,
|
|
304
|
-
"data-ai-key": "content"
|
|
305
|
-
},
|
|
306
|
-
content
|
|
307
|
-
);
|
|
308
|
-
}
|
|
309
|
-
}
|
|
310
|
-
if (children) {
|
|
311
|
-
return /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx("a", { href: (link == null ? void 0 : link.href) || "#/", target: link == null ? void 0 : link.target, ...blockProps, ...styles, children });
|
|
312
|
-
}
|
|
313
|
-
return React__namespace.createElement(
|
|
314
|
-
"a",
|
|
315
|
-
{
|
|
316
|
-
...blockProps,
|
|
317
|
-
...styles,
|
|
318
|
-
"data-ai-key": "content",
|
|
319
|
-
href: (link == null ? void 0 : link.href) || "#",
|
|
320
|
-
target: (link == null ? void 0 : link.target) || "_self"
|
|
321
|
-
},
|
|
322
|
-
content
|
|
323
|
-
);
|
|
324
|
-
};
|
|
325
|
-
const Config$k = {
|
|
326
|
-
type: "Link",
|
|
327
|
-
label: "Link",
|
|
328
|
-
category: "core",
|
|
329
|
-
icon: reactIcons.Link1Icon,
|
|
330
|
-
group: "basic",
|
|
331
|
-
props: {
|
|
332
|
-
styles: controls.T({ default: "" }),
|
|
333
|
-
content: controls.g({ title: "Content", default: "", ai: true, i18n: true }),
|
|
334
|
-
link: controls.w({
|
|
335
|
-
title: "Link",
|
|
336
|
-
default: { type: "collection", target: "_self", href: "" }
|
|
337
|
-
})
|
|
338
|
-
},
|
|
339
|
-
canAcceptBlock: (type) => type !== "Link"
|
|
340
|
-
};
|
|
341
|
-
const addForcedClasses = (styles, ...classes) => {
|
|
342
|
-
return {
|
|
343
|
-
...styles,
|
|
344
|
-
className: iconBase.cn(styles.className, ...classes)
|
|
345
|
-
};
|
|
346
|
-
};
|
|
347
|
-
const LightBoxLinkBlock = (props) => {
|
|
348
|
-
const { blockProps, children, styles, inBuilder, content, href } = props;
|
|
349
|
-
const { hrefType, autoplay, maxWidth, backdropColor, galleryName } = props;
|
|
350
|
-
const forcedStyles = addForcedClasses(styles, "cb-lightbox");
|
|
351
|
-
if (!children && lodashEs.isEmpty(styles == null ? void 0 : styles.className) && lodashEs.isEmpty(content)) {
|
|
352
|
-
return /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(EmptySlot, { inBuilder });
|
|
353
|
-
}
|
|
354
|
-
if (inBuilder) {
|
|
355
|
-
if (children) {
|
|
356
|
-
return /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx("span", { ...blockProps, ...forcedStyles, children });
|
|
357
|
-
} else {
|
|
358
|
-
return React__namespace.createElement("span", {
|
|
359
|
-
...blockProps,
|
|
360
|
-
...forcedStyles,
|
|
361
|
-
dangerouslySetInnerHTML: { __html: content }
|
|
362
|
-
});
|
|
363
|
-
}
|
|
364
|
-
}
|
|
365
|
-
const lightBoxAttrs = {};
|
|
366
|
-
lightBoxAttrs["data-vbtype"] = hrefType;
|
|
367
|
-
if (autoplay) lightBoxAttrs["data-autoplay"] = "true";
|
|
368
|
-
if (maxWidth) lightBoxAttrs["data-maxwidth"] = maxWidth + "px";
|
|
369
|
-
if (backdropColor) lightBoxAttrs["data-overlay"] = backdropColor;
|
|
370
|
-
if (galleryName) lightBoxAttrs["data-gall"] = galleryName;
|
|
371
|
-
if (children) {
|
|
372
|
-
return /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx("a", { ...lightBoxAttrs, href: href || "#/", ...blockProps, ...forcedStyles, children });
|
|
373
|
-
}
|
|
374
|
-
return React__namespace.createElement("a", {
|
|
375
|
-
...blockProps,
|
|
376
|
-
...forcedStyles,
|
|
377
|
-
...lightBoxAttrs,
|
|
378
|
-
href: href || "#",
|
|
379
|
-
dangerouslySetInnerHTML: { __html: content }
|
|
380
|
-
});
|
|
381
|
-
};
|
|
382
|
-
const Config$j = {
|
|
383
|
-
type: "LightBoxLink",
|
|
384
|
-
label: "Lightbox Link",
|
|
385
|
-
category: "core",
|
|
386
|
-
icon: reactIcons.ImageIcon,
|
|
387
|
-
group: "basic",
|
|
388
|
-
props: {
|
|
389
|
-
styles: controls.T({ default: "" }),
|
|
390
|
-
content: controls.g({ title: "Content", default: "Link text or drop blocks inside", ai: true, i18n: true }),
|
|
391
|
-
href: controls.g({ title: "Href", default: "" }),
|
|
392
|
-
hrefType: controls.y({
|
|
393
|
-
title: "Type",
|
|
394
|
-
default: "video",
|
|
395
|
-
options: [
|
|
396
|
-
{ value: "video", title: "Video" },
|
|
397
|
-
{ value: "iframe", title: "Iframe" },
|
|
398
|
-
{ value: "inline", title: "Inline" },
|
|
399
|
-
{ value: "ajax", title: "Ajax" }
|
|
400
|
-
]
|
|
401
|
-
}),
|
|
402
|
-
autoplay: controls.c({ title: "Autoplay", default: false }),
|
|
403
|
-
maxWidth: controls.s({ title: "Max Width", default: "" }),
|
|
404
|
-
backdropColor: controls.g({ title: "Backdrop Color", default: "" }),
|
|
405
|
-
galleryName: controls.g({ title: "Gallery Name", default: "" })
|
|
406
|
-
},
|
|
407
|
-
canAcceptBlock: (type) => type !== "Link" && type !== "LightBoxLink"
|
|
408
|
-
};
|
|
409
|
-
const ListBlock = (props) => {
|
|
410
|
-
const { blockProps, children, listType, styles, tag, inBuilder } = props;
|
|
411
|
-
const className = iconBase.cn(lodashEs.get(styles, "className", ""), listType);
|
|
412
|
-
if (!children && lodashEs.isEmpty(styles == null ? void 0 : styles.className)) {
|
|
413
|
-
return /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(EmptySlot, { inBuilder });
|
|
414
|
-
}
|
|
415
|
-
return React__namespace.createElement(
|
|
416
|
-
tag ? tag : listType === "list-decimal" ? "ol" : "ul",
|
|
417
|
-
{ ...blockProps, ...styles, className },
|
|
418
|
-
children
|
|
419
|
-
);
|
|
420
|
-
};
|
|
421
|
-
const Config$i = {
|
|
422
|
-
type: "List",
|
|
423
|
-
label: "web_blocks.list",
|
|
424
|
-
icon: reactIcons.RowsIcon,
|
|
425
|
-
category: "core",
|
|
426
|
-
group: "basic",
|
|
427
|
-
props: {
|
|
428
|
-
styles: controls.T({ default: "" }),
|
|
429
|
-
listType: controls.y({
|
|
430
|
-
title: "web_blocks.list_type",
|
|
431
|
-
default: "list-none",
|
|
432
|
-
options: [
|
|
433
|
-
{ value: "list-none", title: "web_blocks.none" },
|
|
434
|
-
{ value: "list-disc", title: "web_blocks.disc" },
|
|
435
|
-
{ value: "list-decimal", title: "web_blocks.number" }
|
|
436
|
-
]
|
|
437
|
-
})
|
|
438
|
-
},
|
|
439
|
-
canAcceptBlock: (blockType) => blockType === "ListItem",
|
|
440
|
-
blocks: [
|
|
441
|
-
{ _type: "List", _id: "a", listType: "list-none", styles: "#styles:," },
|
|
442
|
-
{
|
|
443
|
-
_type: "ListItem",
|
|
444
|
-
_id: "b",
|
|
445
|
-
_parent: "a",
|
|
446
|
-
styles: "#styles:,",
|
|
447
|
-
content: "Item 1"
|
|
448
|
-
},
|
|
449
|
-
{
|
|
450
|
-
_type: "ListItem",
|
|
451
|
-
_id: "c",
|
|
452
|
-
_parent: "a",
|
|
453
|
-
styles: "#styles:,",
|
|
454
|
-
content: "Item 2"
|
|
455
|
-
},
|
|
456
|
-
{
|
|
457
|
-
_type: "ListItem",
|
|
458
|
-
_id: "d",
|
|
459
|
-
_parent: "a",
|
|
460
|
-
styles: "#styles:,",
|
|
461
|
-
content: "Item 3"
|
|
462
|
-
}
|
|
463
|
-
]
|
|
464
|
-
};
|
|
465
|
-
const ListItemBlock = (props) => {
|
|
466
|
-
const { blockProps, content, styles, children, tag } = props;
|
|
467
|
-
if (!children) {
|
|
468
|
-
return React__namespace.createElement(tag || "li", {
|
|
469
|
-
...styles,
|
|
470
|
-
...blockProps,
|
|
471
|
-
"data-ai-key": "content",
|
|
472
|
-
dangerouslySetInnerHTML: { __html: content }
|
|
473
|
-
});
|
|
474
|
-
}
|
|
475
|
-
return React__namespace.createElement(tag || "li", { ...styles, ...blockProps }, children);
|
|
476
|
-
};
|
|
477
|
-
const Config$h = {
|
|
478
|
-
type: "ListItem",
|
|
479
|
-
label: "List Item",
|
|
480
|
-
icon: reactIcons.ColumnsIcon,
|
|
481
|
-
category: "core",
|
|
482
|
-
group: "basic",
|
|
483
|
-
props: {
|
|
484
|
-
styles: controls.T({ default: "" }),
|
|
485
|
-
content: controls.f({ title: "Content", default: "List item", ai: true, i18n: true })
|
|
486
|
-
},
|
|
487
|
-
canAcceptBlock: (type) => type !== "ListItem",
|
|
488
|
-
canBeNested: (type) => type === "List"
|
|
489
|
-
};
|
|
490
|
-
const IconBlock = (block) => {
|
|
491
|
-
const { blockProps, icon, styles, width, inBuilder, height } = block;
|
|
492
|
-
const iStyles = addForcedClasses(styles, iconBase.cn(width ? `w-[${width}px]` : "", height ? `h-[${height}px]` : ""));
|
|
493
|
-
if (lodashEs.isEmpty(icon)) {
|
|
494
|
-
return /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(EmptySlot, { inBuilder, className: "h-8 w-14" });
|
|
495
|
-
}
|
|
496
|
-
const svg = icon.replace(/<svg /g, '<svg class="w-[inherit] h-[inherit]" ');
|
|
497
|
-
return React__namespace.createElement("span", {
|
|
498
|
-
...blockProps,
|
|
499
|
-
...iStyles,
|
|
500
|
-
dangerouslySetInnerHTML: { __html: svg }
|
|
501
|
-
});
|
|
502
|
-
};
|
|
503
|
-
const Config$g = {
|
|
504
|
-
type: "Icon",
|
|
505
|
-
label: "web_blocks.icon",
|
|
506
|
-
category: "core",
|
|
507
|
-
icon: reactIcons.SketchLogoIcon,
|
|
508
|
-
group: "media",
|
|
509
|
-
props: {
|
|
510
|
-
styles: controls.T({ default: "text-black" }),
|
|
511
|
-
icon: controls.q({
|
|
512
|
-
title: "web_blocks.icon",
|
|
513
|
-
default: `<svg stroke="currentColor" fill="currentColor" stroke-width="0" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg"><path d="M8 16c4.418 0 8-3.582 8-8s-3.582-8-8-8-8 3.582-8 8 3.582 8 8 8zM8 1.5c3.59 0 6.5 2.91 6.5 6.5s-2.91 6.5-6.5 6.5-6.5-2.91-6.5-6.5 2.91-6.5 6.5-6.5zM8 9.356c1.812 0 3.535-0.481 5-1.327-0.228 2.788-2.393 4.971-5 4.971s-4.772-2.186-5-4.973c1.465 0.845 3.188 1.329 5 1.329zM4 5.5c0-0.828 0.448-1.5 1-1.5s1 0.672 1 1.5c0 0.828-0.448 1.5-1 1.5s-1-0.672-1-1.5zM10 5.5c0-0.828 0.448-1.5 1-1.5s1 0.672 1 1.5c0 0.828-0.448 1.5-1 1.5s-1-0.672-1-1.5z"></path></svg>`
|
|
514
|
-
}),
|
|
515
|
-
width: controls.s({ title: "web_blocks.width", default: "" }),
|
|
516
|
-
height: controls.s({ title: "web_blocks.height", default: "" })
|
|
517
|
-
}
|
|
518
|
-
};
|
|
519
|
-
const ImageBlock = (block) => {
|
|
520
|
-
const { blockProps, image, styles, alt, height, width, lazyLoading } = block;
|
|
521
|
-
if (lodashEs.isEmpty(image)) return /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(EmptySlot, { className: "h-36" });
|
|
522
|
-
return React__namespace.createElement("img", {
|
|
523
|
-
...blockProps,
|
|
524
|
-
...styles,
|
|
525
|
-
src: image,
|
|
526
|
-
alt,
|
|
527
|
-
loading: lazyLoading ? "lazy" : "eager",
|
|
528
|
-
height,
|
|
529
|
-
width
|
|
530
|
-
});
|
|
531
|
-
};
|
|
532
|
-
const Config$f = {
|
|
533
|
-
type: "Image",
|
|
534
|
-
label: "Image",
|
|
535
|
-
category: "core",
|
|
536
|
-
icon: reactIcons.ImageIcon,
|
|
537
|
-
group: "media",
|
|
538
|
-
props: {
|
|
539
|
-
styles: controls.T({ default: "" }),
|
|
540
|
-
image: controls.x({
|
|
541
|
-
title: "Image",
|
|
542
|
-
default: "https://fakeimg.pl/400x200?text=Choose&font=bebas"
|
|
543
|
-
}),
|
|
544
|
-
alt: controls.g({ title: "Alt text", default: "", ai: true, i18n: true }),
|
|
545
|
-
width: controls.g({ title: "Width", default: "" }),
|
|
546
|
-
height: controls.g({ title: "Height", default: "" }),
|
|
547
|
-
lazyLoading: controls.c({ title: "Lazy Load", default: true })
|
|
548
|
-
}
|
|
549
|
-
};
|
|
550
|
-
const YOUTUBE_REGEX = /^(https?:\/\/)?(www\.)?youtube\.com\/(watch\?v=|embed\/)([a-zA-Z0-9_-]{11})/;
|
|
551
|
-
const VIMEO_REGEX = /^(https?:\/\/)?(www\.)?player.vimeo\.com/;
|
|
552
|
-
const DAILYMOTION_REGEX = /^(https?:\/\/)?(www\.)?dailymotion\.com\/(video|embed\/video)\/([a-zA-Z0-9_-]+)/;
|
|
553
|
-
const getEmbedURL = (url) => {
|
|
554
|
-
if (YOUTUBE_REGEX.test(url)) {
|
|
555
|
-
const match = url.match(YOUTUBE_REGEX);
|
|
556
|
-
if (match) {
|
|
557
|
-
const videoId = match[4];
|
|
558
|
-
return `https://www.youtube.com/embed/${videoId}`;
|
|
559
|
-
}
|
|
560
|
-
return url;
|
|
561
|
-
}
|
|
562
|
-
if (VIMEO_REGEX.test(url)) {
|
|
563
|
-
const match = url.match(VIMEO_REGEX);
|
|
564
|
-
if (match) {
|
|
565
|
-
const videoId = match[3];
|
|
566
|
-
return `https://player.vimeo.com/video/${videoId}`;
|
|
567
|
-
}
|
|
568
|
-
return url;
|
|
569
|
-
}
|
|
570
|
-
if (DAILYMOTION_REGEX.test(url)) {
|
|
571
|
-
const match = url.match(DAILYMOTION_REGEX);
|
|
572
|
-
if (match) {
|
|
573
|
-
const videoId = match[4];
|
|
574
|
-
return `https://www.dailymotion.com/embed/video/${videoId}`;
|
|
575
|
-
}
|
|
576
|
-
return url;
|
|
577
|
-
}
|
|
578
|
-
return null;
|
|
579
|
-
};
|
|
580
|
-
const VideoBlock = React__namespace.memo(
|
|
581
|
-
(block) => {
|
|
582
|
-
const { blockProps, inBuilder, styles, url, controls: controls2 } = block;
|
|
583
|
-
const autoplay = lodashEs.get(controls2, "autoPlay", false);
|
|
584
|
-
const _controls = lodashEs.get(controls2, "controls", false);
|
|
585
|
-
const muted = autoplay || lodashEs.get(controls2, "muted", true);
|
|
586
|
-
const loop = lodashEs.get(controls2, "loop", false);
|
|
587
|
-
if (lodashEs.isEmpty(url)) return /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(EmptySlot, { inBuilder, className: "h-36" });
|
|
588
|
-
let embedURL = getEmbedURL(url);
|
|
589
|
-
let videoElement = null;
|
|
590
|
-
if (embedURL) {
|
|
591
|
-
if (!lodashEs.isEmpty(embedURL)) {
|
|
592
|
-
const iframeControls = [];
|
|
593
|
-
iframeControls.push(`autoplay=${autoplay ? 1 : 0}`);
|
|
594
|
-
iframeControls.push(`controls=${controls2 ? 1 : 0}`);
|
|
595
|
-
iframeControls.push(`mute=${muted ? 1 : 0}&muted=${muted ? 1 : 0}`);
|
|
596
|
-
iframeControls.push(`loop=${loop ? 1 : 0}`);
|
|
597
|
-
embedURL = `${embedURL}?${iframeControls.join("&")}`;
|
|
598
|
-
}
|
|
599
|
-
videoElement = React__namespace.createElement("iframe", {
|
|
600
|
-
...blockProps,
|
|
601
|
-
className: "absolute inset-0 w-full h-full",
|
|
602
|
-
src: embedURL,
|
|
603
|
-
allow: inBuilder ? "" : "autoplay *; fullscreen *",
|
|
604
|
-
allowFullScreen: true,
|
|
605
|
-
frameBorder: 0
|
|
606
|
-
});
|
|
607
|
-
} else {
|
|
608
|
-
videoElement = React__namespace.createElement("video", {
|
|
609
|
-
...blockProps,
|
|
610
|
-
className: "absolute inset-0 w-full h-full",
|
|
611
|
-
src: url,
|
|
612
|
-
controls: _controls,
|
|
613
|
-
muted,
|
|
614
|
-
autoPlay: inBuilder ? false : autoplay,
|
|
615
|
-
loop
|
|
616
|
-
});
|
|
617
|
-
}
|
|
618
|
-
return /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx("div", { ...lodashEs.pick(styles, ["className"]), children: /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsxs("div", { className: "relative w-full overflow-hidden", style: { paddingBottom: "56.25%" }, children: [
|
|
619
|
-
inBuilder ? /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx("div", { ...blockProps, ...lodashEs.omit(styles, ["className"]), className: "absolute inset-0 z-20 h-full w-full" }) : null,
|
|
620
|
-
videoElement
|
|
621
|
-
] }) });
|
|
622
|
-
}
|
|
623
|
-
);
|
|
624
|
-
const Config$e = {
|
|
625
|
-
type: "Video",
|
|
626
|
-
label: "Video",
|
|
627
|
-
category: "core",
|
|
628
|
-
icon: reactIcons.VideoIcon,
|
|
629
|
-
group: "media",
|
|
630
|
-
props: {
|
|
631
|
-
styles: controls.T({ default: "" }),
|
|
632
|
-
url: controls.g({
|
|
633
|
-
title: "Video URL",
|
|
634
|
-
default: "https://www.youtube.com/watch?v=9xwazD5SyVg&ab_channel=MaximilianMustermann",
|
|
635
|
-
i18n: true
|
|
636
|
-
}),
|
|
637
|
-
controls: controls.b({
|
|
638
|
-
title: "Controls",
|
|
639
|
-
properties: {
|
|
640
|
-
autoPlay: controls.c({ title: "Autoplay", default: true }),
|
|
641
|
-
controls: controls.c({ title: "Controls", default: false }),
|
|
642
|
-
loop: controls.c({ title: "Loop", default: false }),
|
|
643
|
-
muted: controls.c({ title: "Muted", default: true })
|
|
644
|
-
}
|
|
645
|
-
})
|
|
646
|
-
}
|
|
647
|
-
};
|
|
648
|
-
function DiJavascript(props) {
|
|
649
|
-
return iconBase.GenIcon({ "tag": "svg", "attr": { "version": "1.1", "viewBox": "0 0 32 32" }, "child": [{ "tag": "path", "attr": { "d": "M4.698 3.419l2.057 23.073 9.231 2.563 9.256-2.566 2.059-23.069h-22.604zM13.226 9.394l-0.409 4.441 9.671 0.001-0.069 0.76-0.665 7.45-0.042 0.478-5.804 1.609-5.796-1.609-0.396-4.443h2.84l0.202 2.257 3.154 0.85 3.156-0.852 0.328-3.67-9.671-0.001 0.069-0.76 0.665-7.45 0.209-2.086h11.287l0.131 1.598 0.403 4.453h-2.841l-0.262-2.922-2.889-0.174h-0.515v-0.004l-2.755 0.074z" }, "child": [] }] })(props);
|
|
650
|
-
}
|
|
651
|
-
const CustomScript = (props) => {
|
|
652
|
-
const { scripts, inBuilder, blockProps } = props;
|
|
653
|
-
if (inBuilder)
|
|
654
|
-
return /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx("div", { ...blockProps, children: /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx("div", { className: iconBase.cn("pointer-events-none flex flex-col items-center justify-center p-2", ""), children: /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx("div", { className: "h-full w-full rounded bg-gray-200 p-1 dark:bg-gray-800", children: /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx("p", { className: "text-left text-xs text-gray-400", children: "Scripts will be only executed in preview and live mode. Place your script at the bottom of the" }) }) }) });
|
|
655
|
-
return /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx("div", { dangerouslySetInnerHTML: { __html: scripts } });
|
|
656
|
-
};
|
|
657
|
-
const Config$d = {
|
|
658
|
-
type: "CustomScript",
|
|
659
|
-
label: "web_blocks.custom_script",
|
|
660
|
-
category: "core",
|
|
661
|
-
icon: DiJavascript,
|
|
662
|
-
group: "advanced",
|
|
663
|
-
props: {
|
|
664
|
-
scripts: controls.l({
|
|
665
|
-
title: "Script",
|
|
666
|
-
default: "",
|
|
667
|
-
placeholder: "<script>console.log('Hello, world!');<\/script>"
|
|
668
|
-
})
|
|
669
|
-
}
|
|
670
|
-
};
|
|
671
|
-
const DividerBlock = (props) => {
|
|
672
|
-
const { blockProps, styles } = props;
|
|
673
|
-
return React__namespace.createElement("hr", { ...styles, ...blockProps });
|
|
674
|
-
};
|
|
675
|
-
const Config$c = {
|
|
676
|
-
type: "Divider",
|
|
677
|
-
label: "web_blocks.divider",
|
|
678
|
-
category: "core",
|
|
679
|
-
icon: reactIcons.DividerHorizontalIcon,
|
|
680
|
-
group: "basic",
|
|
681
|
-
props: {
|
|
682
|
-
styles: controls.T({ default: "bg-gray-900 h-0.5 py-2 my-1" })
|
|
683
|
-
}
|
|
684
|
-
};
|
|
685
|
-
const DarkMode = () => {
|
|
686
|
-
return null;
|
|
687
|
-
};
|
|
688
|
-
const Config$b = {
|
|
689
|
-
type: "Dark Mode",
|
|
690
|
-
label: "web_blocks.dark_mode",
|
|
691
|
-
category: "core",
|
|
692
|
-
icon: reactIcons.MoonIcon,
|
|
693
|
-
group: "advanced",
|
|
694
|
-
props: {},
|
|
695
|
-
blocks: () => [
|
|
696
|
-
{ _id: "ultqCh", _type: "Span", tag: "span", styles: "#styles:,", _name: "Dark Mode Switcher" },
|
|
697
|
-
{
|
|
698
|
-
_id: "vroabi",
|
|
699
|
-
_parent: "ultqCh",
|
|
700
|
-
_type: "Button",
|
|
701
|
-
// @ts-ignore
|
|
702
|
-
styles_attrs: { type: "button", "x-on:click": "darkMode = 'dark'", "x-show": "darkMode === 'light'" },
|
|
703
|
-
styles: "#styles:,bg-white dark:bg-black font-medium text-gray-800 rounded-full hover:bg-gray-200 focus:outline-none focus:bg-gray-200 dark:text-neutral-200 dark:hover:bg-neutral-800 dark:focus:bg-neutral-800",
|
|
704
|
-
_name: "Dark Mode Btn"
|
|
705
|
-
},
|
|
706
|
-
{
|
|
707
|
-
_id: "eweibk",
|
|
708
|
-
_parent: "vroabi",
|
|
709
|
-
_type: "Span",
|
|
710
|
-
tag: "span",
|
|
711
|
-
styles: "#styles:,group inline-flex shrink-0 justify-center items-center size-9"
|
|
712
|
-
},
|
|
713
|
-
{
|
|
714
|
-
_id: "nltBrv",
|
|
715
|
-
_parent: "eweibk",
|
|
716
|
-
_type: "Icon",
|
|
717
|
-
styles: "#styles:, shrink-0 size-4",
|
|
718
|
-
icon: "<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z'></path></svg>"
|
|
719
|
-
},
|
|
720
|
-
{
|
|
721
|
-
_id: "gesydi",
|
|
722
|
-
_parent: "ultqCh",
|
|
723
|
-
_type: "Button",
|
|
724
|
-
// @ts-ignore
|
|
725
|
-
styles_attrs: { type: "button", "x-on:click": "darkMode = 'light'", "x-show": "darkMode === 'dark'" },
|
|
726
|
-
styles: "#styles:,bg-white dark:bg-black font-medium text-gray-800 rounded-full hover:bg-gray-200 focus:outline-none focus:bg-gray-200 dark:text-neutral-200 dark:hover:bg-neutral-800 dark:focus:bg-neutral-800",
|
|
727
|
-
_name: "Light Mode Btn"
|
|
728
|
-
},
|
|
729
|
-
{
|
|
730
|
-
_id: "sgbhDo",
|
|
731
|
-
_parent: "gesydi",
|
|
732
|
-
_type: "Span",
|
|
733
|
-
tag: "span",
|
|
734
|
-
styles: "#styles:,group inline-flex shrink-0 justify-center items-center size-9"
|
|
735
|
-
},
|
|
736
|
-
{
|
|
737
|
-
_id: "AdDwBC",
|
|
738
|
-
_parent: "sgbhDo",
|
|
739
|
-
_type: "Icon",
|
|
740
|
-
styles: "#styles:, shrink-0 size-4",
|
|
741
|
-
icon: "<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><circle cx='12' cy='12' r='4'></circle><path d='M12 2v2'></path><path d='M12 20v2'></path><path d='m4.93 4.93 1.41 1.41'></path><path d='m17.66 17.66 1.41 1.41'></path><path d='M2 12h2'></path><path d='M20 12h2'></path><path d='m6.34 17.66-1.41 1.41'></path><path d='m19.07 4.93-1.41 1.41'></path></svg>"
|
|
742
|
-
}
|
|
743
|
-
]
|
|
744
|
-
};
|
|
745
|
-
const Component = (props) => {
|
|
746
|
-
const { blockProps, inBuilder, children, globalBlock } = props;
|
|
747
|
-
if (inBuilder && !globalBlock) {
|
|
748
|
-
return /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsxs(
|
|
749
|
-
"div",
|
|
750
|
-
{
|
|
751
|
-
className: "flex flex-col items-center justify-center gap-y-1 rounded-lg bg-gray-100 py-4 dark:bg-gray-800",
|
|
752
|
-
...blockProps,
|
|
753
|
-
children: [
|
|
754
|
-
/* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsxs("h1", { children: [
|
|
755
|
-
"Global Block - ",
|
|
756
|
-
globalBlock
|
|
757
|
-
] }),
|
|
758
|
-
/* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx("p", { children: "Choose a block from the sidebar to add it to this page." })
|
|
759
|
-
]
|
|
760
|
-
}
|
|
761
|
-
);
|
|
762
|
-
}
|
|
763
|
-
return React__namespace.createElement("div", { ...blockProps }, children);
|
|
764
|
-
};
|
|
765
|
-
const Config$a = {
|
|
766
|
-
type: "GlobalBlock",
|
|
767
|
-
label: "Global Block",
|
|
768
|
-
icon: lucideReact.GlobeIcon,
|
|
769
|
-
category: "core",
|
|
770
|
-
group: "advanced",
|
|
771
|
-
props: {
|
|
772
|
-
globalBlock: controls.g({ title: "global block", default: "", hidden: true })
|
|
773
|
-
}
|
|
774
|
-
};
|
|
775
|
-
const RawTextBlock = (props) => {
|
|
776
|
-
if (props.inBuilder || props.forceWrapper) {
|
|
777
|
-
return /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx("span", { "data-ai-key": "content", ...props.blockProps, children: props.content });
|
|
778
|
-
}
|
|
779
|
-
return `${props.content}`;
|
|
780
|
-
};
|
|
781
|
-
const Config$9 = {
|
|
782
|
-
type: "Text",
|
|
783
|
-
label: "Text",
|
|
784
|
-
hidden: true,
|
|
785
|
-
category: "core",
|
|
786
|
-
group: "typography",
|
|
787
|
-
icon: reactIcons.SpaceBetweenVerticallyIcon,
|
|
788
|
-
props: {
|
|
789
|
-
content: controls.f({ title: "Content", default: "", ai: true, i18n: true })
|
|
790
|
-
}
|
|
791
|
-
};
|
|
792
|
-
const BodyBlock = (props) => {
|
|
793
|
-
const { blockProps, backgroundImage, children, styles } = props;
|
|
794
|
-
let cssStyles = {};
|
|
795
|
-
if (backgroundImage) {
|
|
796
|
-
cssStyles = { backgroundImage: `url(${backgroundImage})` };
|
|
797
|
-
}
|
|
798
|
-
return React__namespace.createElement("div", { ...blockProps, ...styles, style: cssStyles }, children);
|
|
799
|
-
};
|
|
800
|
-
const Config$8 = {
|
|
801
|
-
type: "Body",
|
|
802
|
-
label: "Body",
|
|
803
|
-
category: "core",
|
|
804
|
-
group: "basic",
|
|
805
|
-
hidden: true,
|
|
806
|
-
props: {
|
|
807
|
-
styles: controls.T({ default: "font-body antialiased" }),
|
|
808
|
-
backgroundImage: controls.x({ title: "Background Image" })
|
|
809
|
-
},
|
|
810
|
-
canAcceptBlock: () => true,
|
|
811
|
-
canDelete: () => false,
|
|
812
|
-
canMove: () => false,
|
|
813
|
-
canDuplicate: () => false
|
|
814
|
-
};
|
|
815
|
-
const LineBreakComponent = (props) => {
|
|
816
|
-
const { blockProps, styles } = props;
|
|
817
|
-
return React__namespace.createElement("br", { ...blockProps, ...styles });
|
|
818
|
-
};
|
|
819
|
-
const Config$7 = {
|
|
820
|
-
type: "LineBreak",
|
|
821
|
-
label: "Line Break",
|
|
822
|
-
category: "core",
|
|
823
|
-
group: "basic",
|
|
824
|
-
hidden: true,
|
|
825
|
-
icon: reactIcons.SpaceBetweenVerticallyIcon,
|
|
826
|
-
props: {
|
|
827
|
-
styles: controls.T({ default: "" })
|
|
828
|
-
}
|
|
829
|
-
};
|
|
830
|
-
const FormBlock = (props) => {
|
|
831
|
-
const { blockProps, errorMessage, name, _type, successMessage, action, styles, children } = props;
|
|
832
|
-
let nestedChildren = children;
|
|
833
|
-
if (!children) {
|
|
834
|
-
nestedChildren = /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(EmptySlot, {});
|
|
835
|
-
}
|
|
836
|
-
const alpineAttrs = {
|
|
837
|
-
"x-data": `{
|
|
3
|
+
nibh et justo cursus id rutrum lorem imperdiet. Nunc ut sem vitae risus tristique posuere.`,ai:!0,i18n:!0})},canAcceptBlock:e=>e==="Span"||e==="Link"||e==="Text"},A=e=>{const{blockProps:o,styles:l,content:s,children:r=null,tag:n}=e;return r?m.createElement("span",{...l,...o},r):m.createElement(n||"span",{...l,...o,"data-ai-key":"content",dangerouslySetInnerHTML:{__html:s||""}})},U={type:"Span",label:"Span",category:"core",group:"typography",props:{styles:t.T({default:""}),content:t.f({title:"Content",default:"",ai:!0,i18n:!0})},canAcceptBlock:()=>!0},F=e=>{const{blockProps:o,content:l,styles:s}=e;return a.jsxRuntimeExports.jsx("div",{className:"max-w-full",children:a.jsxRuntimeExports.jsx("div",{"data-ai-key":"content","data-ai-type":"richtext",...o,...s,dangerouslySetInnerHTML:{__html:l}})})},O={type:"RichText",label:"Rich Text",category:"core",icon:g.CursorTextIcon,group:"typography",props:{styles:t.T({default:""}),content:t.m({title:"Content",ai:!0,i18n:!0,default:"<p>This is a rich text block. You can add text, and other content here.</p>"})}},V=e=>{const{blockProps:o,link:l,children:s,styles:r,inBuilder:n,content:i}=e;let c={};return!s&&f.isEmpty(i)&&(c={minHeight:"50px",display:"flex",alignItems:"center",justifyContent:"center"}),n?s?a.jsxRuntimeExports.jsx("span",{...o,style:c,...r,children:s}):m.createElement("span",{...o,...r,style:c,"data-ai-key":"content"},i):s?a.jsxRuntimeExports.jsx("a",{href:(l==null?void 0:l.href)||"#/",target:l==null?void 0:l.target,...o,...r,children:s}):m.createElement("a",{...o,...r,"data-ai-key":"content",href:(l==null?void 0:l.href)||"#",target:(l==null?void 0:l.target)||"_self"},i)},G={type:"Link",label:"Link",category:"core",icon:g.Link1Icon,group:"basic",props:{styles:t.T({default:""}),content:t.g({title:"Content",default:"",ai:!0,i18n:!0}),link:t.w({title:"Link",default:{type:"collection",target:"_self",href:""}})},canAcceptBlock:e=>e!=="Link"},B=(e,...o)=>({...e,className:y.cn(e.className,...o)}),W=e=>{const{blockProps:o,children:l,styles:s,inBuilder:r,content:n,href:i}=e,{hrefType:c,autoplay:u,maxWidth:d,backdropColor:h,galleryName:b}=e,x=B(s,"cb-lightbox");if(!l&&f.isEmpty(s==null?void 0:s.className)&&f.isEmpty(n))return a.jsxRuntimeExports.jsx(w,{inBuilder:r});if(r)return l?a.jsxRuntimeExports.jsx("span",{...o,...x,children:l}):m.createElement("span",{...o,...x,dangerouslySetInnerHTML:{__html:n}});const k={};return k["data-vbtype"]=c,u&&(k["data-autoplay"]="true"),d&&(k["data-maxwidth"]=d+"px"),h&&(k["data-overlay"]=h),b&&(k["data-gall"]=b),l?a.jsxRuntimeExports.jsx("a",{...k,href:i||"#/",...o,...x,children:l}):m.createElement("a",{...o,...x,...k,href:i||"#",dangerouslySetInnerHTML:{__html:n}})},X={type:"LightBoxLink",label:"Lightbox Link",category:"core",icon:g.ImageIcon,group:"basic",props:{styles:t.T({default:""}),content:t.g({title:"Content",default:"Link text or drop blocks inside",ai:!0,i18n:!0}),href:t.g({title:"Href",default:""}),hrefType:t.y({title:"Type",default:"video",options:[{value:"video",title:"Video"},{value:"iframe",title:"Iframe"},{value:"inline",title:"Inline"},{value:"ajax",title:"Ajax"}]}),autoplay:t.c({title:"Autoplay",default:!1}),maxWidth:t.s({title:"Max Width",default:""}),backdropColor:t.g({title:"Backdrop Color",default:""}),galleryName:t.g({title:"Gallery Name",default:""})},canAcceptBlock:e=>e!=="Link"&&e!=="LightBoxLink"},Y=e=>{const{blockProps:o,children:l,listType:s,styles:r,tag:n,inBuilder:i}=e,c=y.cn(f.get(r,"className",""),s);return!l&&f.isEmpty(r==null?void 0:r.className)?a.jsxRuntimeExports.jsx(w,{inBuilder:i}):m.createElement(n||(s==="list-decimal"?"ol":"ul"),{...o,...r,className:c},l)},Z={type:"List",label:"web_blocks.list",icon:g.RowsIcon,category:"core",group:"basic",props:{styles:t.T({default:""}),listType:t.y({title:"web_blocks.list_type",default:"list-none",options:[{value:"list-none",title:"web_blocks.none"},{value:"list-disc",title:"web_blocks.disc"},{value:"list-decimal",title:"web_blocks.number"}]})},canAcceptBlock:e=>e==="ListItem",blocks:[{_type:"List",_id:"a",listType:"list-none",styles:"#styles:,"},{_type:"ListItem",_id:"b",_parent:"a",styles:"#styles:,",content:"Item 1"},{_type:"ListItem",_id:"c",_parent:"a",styles:"#styles:,",content:"Item 2"},{_type:"ListItem",_id:"d",_parent:"a",styles:"#styles:,",content:"Item 3"}]},J=e=>{const{blockProps:o,content:l,styles:s,children:r,tag:n}=e;return r?m.createElement(n||"li",{...s,...o},r):m.createElement(n||"li",{...s,...o,"data-ai-key":"content",dangerouslySetInnerHTML:{__html:l}})},K={type:"ListItem",label:"List Item",icon:g.ColumnsIcon,category:"core",group:"basic",props:{styles:t.T({default:""}),content:t.f({title:"Content",default:"List item",ai:!0,i18n:!0})},canAcceptBlock:e=>e!=="ListItem",canBeNested:e=>e==="List"},Q=e=>{const{blockProps:o,icon:l,styles:s,width:r,inBuilder:n,height:i}=e,c=B(s,y.cn(r?`w-[${r}px]`:"",i?`h-[${i}px]`:""));if(f.isEmpty(l))return a.jsxRuntimeExports.jsx(w,{inBuilder:n,className:"h-8 w-14"});const u=l.replace(/<svg /g,'<svg class="w-[inherit] h-[inherit]" ');return m.createElement("span",{...o,...c,dangerouslySetInnerHTML:{__html:u}})},ee={type:"Icon",label:"web_blocks.icon",category:"core",icon:g.SketchLogoIcon,group:"media",props:{styles:t.T({default:"text-black"}),icon:t.q({title:"web_blocks.icon",default:'<svg stroke="currentColor" fill="currentColor" stroke-width="0" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg"><path d="M8 16c4.418 0 8-3.582 8-8s-3.582-8-8-8-8 3.582-8 8 3.582 8 8 8zM8 1.5c3.59 0 6.5 2.91 6.5 6.5s-2.91 6.5-6.5 6.5-6.5-2.91-6.5-6.5 2.91-6.5 6.5-6.5zM8 9.356c1.812 0 3.535-0.481 5-1.327-0.228 2.788-2.393 4.971-5 4.971s-4.772-2.186-5-4.973c1.465 0.845 3.188 1.329 5 1.329zM4 5.5c0-0.828 0.448-1.5 1-1.5s1 0.672 1 1.5c0 0.828-0.448 1.5-1 1.5s-1-0.672-1-1.5zM10 5.5c0-0.828 0.448-1.5 1-1.5s1 0.672 1 1.5c0 0.828-0.448 1.5-1 1.5s-1-0.672-1-1.5z"></path></svg>'}),width:t.s({title:"web_blocks.width",default:""}),height:t.s({title:"web_blocks.height",default:""})}},te=e=>{const{blockProps:o,image:l,styles:s,alt:r,height:n,width:i,lazyLoading:c}=e;return f.isEmpty(l)?a.jsxRuntimeExports.jsx(w,{className:"h-36"}):m.createElement("img",{...o,...s,src:l,alt:r,loading:c?"lazy":"eager",height:n,width:i})},le={type:"Image",label:"Image",category:"core",icon:g.ImageIcon,group:"media",props:{styles:t.T({default:""}),image:t.x({title:"Image",default:"https://fakeimg.pl/400x200?text=Choose&font=bebas"}),alt:t.g({title:"Alt text",default:"",ai:!0,i18n:!0}),width:t.g({title:"Width",default:""}),height:t.g({title:"Height",default:""}),lazyLoading:t.c({title:"Lazy Load",default:!0})}},v=/^(https?:\/\/)?(www\.)?youtube\.com\/(watch\?v=|embed\/)([a-zA-Z0-9_-]{11})/,_=/^(https?:\/\/)?(www\.)?player.vimeo\.com/,j=/^(https?:\/\/)?(www\.)?dailymotion\.com\/(video|embed\/video)\/([a-zA-Z0-9_-]+)/,oe=e=>{if(v.test(e)){const o=e.match(v);return o?`https://www.youtube.com/embed/${o[4]}`:e}if(_.test(e)){const o=e.match(_);return o?`https://player.vimeo.com/video/${o[3]}`:e}if(j.test(e)){const o=e.match(j);return o?`https://www.dailymotion.com/embed/video/${o[4]}`:e}return null},se=m.memo(e=>{const{blockProps:o,inBuilder:l,styles:s,url:r,controls:n}=e,i=f.get(n,"autoPlay",!1),c=f.get(n,"controls",!1),u=i||f.get(n,"muted",!0),d=f.get(n,"loop",!1);if(f.isEmpty(r))return a.jsxRuntimeExports.jsx(w,{inBuilder:l,className:"h-36"});let h=oe(r),b=null;if(h){if(!f.isEmpty(h)){const x=[];x.push(`autoplay=${i?1:0}`),x.push(`controls=${n?1:0}`),x.push(`mute=${u?1:0}&muted=${u?1:0}`),x.push(`loop=${d?1:0}`),h=`${h}?${x.join("&")}`}b=m.createElement("iframe",{...o,className:"absolute inset-0 w-full h-full",src:h,allow:l?"":"autoplay *; fullscreen *",allowFullScreen:!0,frameBorder:0})}else b=m.createElement("video",{...o,className:"absolute inset-0 w-full h-full",src:r,controls:c,muted:u,autoPlay:l?!1:i,loop:d});return a.jsxRuntimeExports.jsx("div",{...f.pick(s,["className"]),children:a.jsxRuntimeExports.jsxs("div",{className:"relative w-full overflow-hidden",style:{paddingBottom:"56.25%"},children:[l?a.jsxRuntimeExports.jsx("div",{...o,...f.omit(s,["className"]),className:"absolute inset-0 z-20 h-full w-full"}):null,b]})})}),re={type:"Video",label:"Video",category:"core",icon:g.VideoIcon,group:"media",props:{styles:t.T({default:""}),url:t.g({title:"Video URL",default:"https://www.youtube.com/watch?v=9xwazD5SyVg&ab_channel=MaximilianMustermann",i18n:!0}),controls:t.b({title:"Controls",properties:{autoPlay:t.c({title:"Autoplay",default:!0}),controls:t.c({title:"Controls",default:!1}),loop:t.c({title:"Loop",default:!1}),muted:t.c({title:"Muted",default:!0})}})}};function ae(e){return y.GenIcon({tag:"svg",attr:{version:"1.1",viewBox:"0 0 32 32"},child:[{tag:"path",attr:{d:"M4.698 3.419l2.057 23.073 9.231 2.563 9.256-2.566 2.059-23.069h-22.604zM13.226 9.394l-0.409 4.441 9.671 0.001-0.069 0.76-0.665 7.45-0.042 0.478-5.804 1.609-5.796-1.609-0.396-4.443h2.84l0.202 2.257 3.154 0.85 3.156-0.852 0.328-3.67-9.671-0.001 0.069-0.76 0.665-7.45 0.209-2.086h11.287l0.131 1.598 0.403 4.453h-2.841l-0.262-2.922-2.889-0.174h-0.515v-0.004l-2.755 0.074z"},child:[]}]})(e)}const ne=e=>{const{scripts:o,inBuilder:l,blockProps:s}=e;return l?a.jsxRuntimeExports.jsx("div",{...s,children:a.jsxRuntimeExports.jsx("div",{className:y.cn("pointer-events-none flex flex-col items-center justify-center p-2",""),children:a.jsxRuntimeExports.jsx("div",{className:"h-full w-full rounded bg-gray-200 p-1 dark:bg-gray-800",children:a.jsxRuntimeExports.jsx("p",{className:"text-left text-xs text-gray-400",children:"Scripts will be only executed in preview and live mode. Place your script at the bottom of the"})})})}):a.jsxRuntimeExports.jsx("div",{dangerouslySetInnerHTML:{__html:o}})},ie={type:"CustomScript",label:"web_blocks.custom_script",category:"core",icon:ae,group:"advanced",props:{scripts:t.l({title:"Script",default:"",placeholder:"<script>console.log('Hello, world!');<\/script>"})}},ce=e=>{const{blockProps:o,styles:l}=e;return m.createElement("hr",{...l,...o})},ue={type:"Divider",label:"web_blocks.divider",category:"core",icon:g.DividerHorizontalIcon,group:"basic",props:{styles:t.T({default:"bg-gray-900 h-0.5 py-2 my-1"})}},de=()=>null,pe={type:"Dark Mode",label:"web_blocks.dark_mode",category:"core",icon:g.MoonIcon,group:"advanced",props:{},blocks:()=>[{_id:"ultqCh",_type:"Span",tag:"span",styles:"#styles:,",_name:"Dark Mode Switcher"},{_id:"vroabi",_parent:"ultqCh",_type:"Button",styles_attrs:{type:"button","x-on:click":"darkMode = 'dark'","x-show":"darkMode === 'light'"},styles:"#styles:,bg-white dark:bg-black font-medium text-gray-800 rounded-full hover:bg-gray-200 focus:outline-none focus:bg-gray-200 dark:text-neutral-200 dark:hover:bg-neutral-800 dark:focus:bg-neutral-800",_name:"Dark Mode Btn"},{_id:"eweibk",_parent:"vroabi",_type:"Span",tag:"span",styles:"#styles:,group inline-flex shrink-0 justify-center items-center size-9"},{_id:"nltBrv",_parent:"eweibk",_type:"Icon",styles:"#styles:, shrink-0 size-4",icon:"<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z'></path></svg>"},{_id:"gesydi",_parent:"ultqCh",_type:"Button",styles_attrs:{type:"button","x-on:click":"darkMode = 'light'","x-show":"darkMode === 'dark'"},styles:"#styles:,bg-white dark:bg-black font-medium text-gray-800 rounded-full hover:bg-gray-200 focus:outline-none focus:bg-gray-200 dark:text-neutral-200 dark:hover:bg-neutral-800 dark:focus:bg-neutral-800",_name:"Light Mode Btn"},{_id:"sgbhDo",_parent:"gesydi",_type:"Span",tag:"span",styles:"#styles:,group inline-flex shrink-0 justify-center items-center size-9"},{_id:"AdDwBC",_parent:"sgbhDo",_type:"Icon",styles:"#styles:, shrink-0 size-4",icon:"<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><circle cx='12' cy='12' r='4'></circle><path d='M12 2v2'></path><path d='M12 20v2'></path><path d='m4.93 4.93 1.41 1.41'></path><path d='m17.66 17.66 1.41 1.41'></path><path d='M2 12h2'></path><path d='M20 12h2'></path><path d='m6.34 17.66-1.41 1.41'></path><path d='m19.07 4.93-1.41 1.41'></path></svg>"}]},me=e=>{const{blockProps:o,inBuilder:l,children:s,globalBlock:r}=e;return l&&!r?a.jsxRuntimeExports.jsxs("div",{className:"flex flex-col items-center justify-center gap-y-1 rounded-lg bg-gray-100 py-4 dark:bg-gray-800",...o,children:[a.jsxRuntimeExports.jsxs("h1",{children:["Global Block - ",r]}),a.jsxRuntimeExports.jsx("p",{children:"Choose a block from the sidebar to add it to this page."})]}):m.createElement("div",{...o},s)},ge={type:"GlobalBlock",label:"Global Block",icon:C.GlobeIcon,category:"core",group:"advanced",props:{globalBlock:t.g({title:"global block",default:"",hidden:!0})}},be=e=>e.inBuilder||e.forceWrapper?a.jsxRuntimeExports.jsx("span",{"data-ai-key":"content",...e.blockProps,children:e.content}):`${e.content}`,fe={type:"Text",label:"Text",hidden:!0,category:"core",group:"typography",icon:g.SpaceBetweenVerticallyIcon,props:{content:t.f({title:"Content",default:"",ai:!0,i18n:!0})}},he=e=>{const{blockProps:o,backgroundImage:l,children:s,styles:r}=e;let n={};return l&&(n={backgroundImage:`url(${l})`}),m.createElement("div",{...o,...r,style:n},s)},ye={type:"Body",label:"Body",category:"core",group:"basic",hidden:!0,props:{styles:t.T({default:"font-body antialiased"}),backgroundImage:t.x({title:"Background Image"})},canAcceptBlock:()=>!0,canDelete:()=>!1,canMove:()=>!1,canDuplicate:()=>!1},xe=e=>{const{blockProps:o,styles:l}=e;return m.createElement("br",{...o,...l})},ke={type:"LineBreak",label:"Line Break",category:"core",group:"basic",hidden:!0,icon:g.SpaceBetweenVerticallyIcon,props:{styles:t.T({default:""})}},we=e=>{const{blockProps:o,errorMessage:l,name:s,_type:r,successMessage:n,action:i,styles:c,children:u}=e;let d=u;u||(d=a.jsxRuntimeExports.jsx(w,{}));const h={"x-data":`{
|
|
838
4
|
formStatus: '',
|
|
839
5
|
formLoading: false,
|
|
840
6
|
async submit() {
|
|
@@ -855,408 +21,4 @@ const FormBlock = (props) => {
|
|
|
855
21
|
this.formLoading = false;
|
|
856
22
|
}
|
|
857
23
|
}
|
|
858
|
-
}`,
|
|
859
|
-
"x-on:submit.prevent": "submit"
|
|
860
|
-
};
|
|
861
|
-
const formResponseAttr = {
|
|
862
|
-
"data-response": "",
|
|
863
|
-
":class": "{'text-red-500': formStatus === 'ERROR', 'text-green-500': formStatus === 'SUCCESS'}"
|
|
864
|
-
};
|
|
865
|
-
return /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsxs(
|
|
866
|
-
"form",
|
|
867
|
-
{
|
|
868
|
-
...alpineAttrs,
|
|
869
|
-
"data-error": errorMessage,
|
|
870
|
-
"data-success": successMessage,
|
|
871
|
-
method: "post",
|
|
872
|
-
action,
|
|
873
|
-
...blockProps,
|
|
874
|
-
...styles,
|
|
875
|
-
children: [
|
|
876
|
-
/* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx("div", { ...formResponseAttr }),
|
|
877
|
-
/* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx("input", { name: "formname", type: "hidden", value: name || _type }),
|
|
878
|
-
nestedChildren
|
|
879
|
-
]
|
|
880
|
-
}
|
|
881
|
-
);
|
|
882
|
-
};
|
|
883
|
-
const Config$6 = {
|
|
884
|
-
type: "Form",
|
|
885
|
-
label: "Form",
|
|
886
|
-
category: "core",
|
|
887
|
-
icon: reactIcons.GroupIcon,
|
|
888
|
-
group: "form",
|
|
889
|
-
props: {
|
|
890
|
-
styles: controls.T({ default: "" }),
|
|
891
|
-
action: controls.g({
|
|
892
|
-
title: "Submit URL",
|
|
893
|
-
default: "/api/form/submit"
|
|
894
|
-
}),
|
|
895
|
-
errorMessage: controls.m({
|
|
896
|
-
title: "Error Message",
|
|
897
|
-
default: "Something went wrong. Please try again"
|
|
898
|
-
}),
|
|
899
|
-
successMessage: controls.m({
|
|
900
|
-
title: "Success Message",
|
|
901
|
-
default: "Thank you for your submission."
|
|
902
|
-
})
|
|
903
|
-
},
|
|
904
|
-
canAcceptBlock: () => true
|
|
905
|
-
};
|
|
906
|
-
const FormButtonBlock = (block) => {
|
|
907
|
-
const { blockProps, inBuilder, label, styles, inputStyles, icon, iconPos } = block;
|
|
908
|
-
const fieldId = iconBase.generateUUID();
|
|
909
|
-
const attrs = {
|
|
910
|
-
"x-bind:disabled": "formLoading"
|
|
911
|
-
};
|
|
912
|
-
return /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsxs(
|
|
913
|
-
"button",
|
|
914
|
-
{
|
|
915
|
-
id: fieldId,
|
|
916
|
-
...attrs,
|
|
917
|
-
...inputStyles,
|
|
918
|
-
...styles,
|
|
919
|
-
...blockProps || {},
|
|
920
|
-
type: inBuilder ? "button" : "submit",
|
|
921
|
-
children: [
|
|
922
|
-
label,
|
|
923
|
-
icon && /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx("span", { className: iconPos, dangerouslySetInnerHTML: { __html: icon } })
|
|
924
|
-
]
|
|
925
|
-
}
|
|
926
|
-
);
|
|
927
|
-
};
|
|
928
|
-
const Config$5 = {
|
|
929
|
-
type: "FormButton",
|
|
930
|
-
label: "Submit Button",
|
|
931
|
-
category: "core",
|
|
932
|
-
icon: reactIcons.ButtonIcon,
|
|
933
|
-
group: "form",
|
|
934
|
-
props: {
|
|
935
|
-
label: controls.g({ title: "Label", default: "Submit", ai: true, i18n: true }),
|
|
936
|
-
styles: controls.T({
|
|
937
|
-
default: "text-white bg-primary disabled:bg-gray-400 px-4 py-2 rounded-global flex items-center gap-x-2"
|
|
938
|
-
}),
|
|
939
|
-
icon: controls.q({ title: "Icon", default: "" }),
|
|
940
|
-
iconPos: controls.y({
|
|
941
|
-
title: "Icon Position",
|
|
942
|
-
default: "order-last",
|
|
943
|
-
options: [
|
|
944
|
-
{ title: "Start", value: "order-first" },
|
|
945
|
-
{ title: "End", value: "order-last" }
|
|
946
|
-
]
|
|
947
|
-
})
|
|
948
|
-
}
|
|
949
|
-
};
|
|
950
|
-
const InputBlock = (block) => {
|
|
951
|
-
const {
|
|
952
|
-
blockProps,
|
|
953
|
-
label,
|
|
954
|
-
placeholder,
|
|
955
|
-
styles,
|
|
956
|
-
inputStyles,
|
|
957
|
-
showLabel,
|
|
958
|
-
required,
|
|
959
|
-
inputType = "text",
|
|
960
|
-
inBuilder,
|
|
961
|
-
fieldName
|
|
962
|
-
} = block;
|
|
963
|
-
const fieldId = iconBase.generateUUID();
|
|
964
|
-
if (!showLabel || inputType === "submit") {
|
|
965
|
-
if (inputType === "submit") blockProps.value = label;
|
|
966
|
-
return /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(
|
|
967
|
-
"input",
|
|
968
|
-
{
|
|
969
|
-
id: fieldId,
|
|
970
|
-
name: fieldName,
|
|
971
|
-
readOnly: inBuilder,
|
|
972
|
-
...blockProps,
|
|
973
|
-
...inputStyles,
|
|
974
|
-
...styles,
|
|
975
|
-
type: inputType,
|
|
976
|
-
placeholder,
|
|
977
|
-
required
|
|
978
|
-
}
|
|
979
|
-
);
|
|
980
|
-
}
|
|
981
|
-
return /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsxs("div", { ...styles, ...blockProps, children: [
|
|
982
|
-
showLabel && /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx("label", { htmlFor: fieldId, children: label }),
|
|
983
|
-
/* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(
|
|
984
|
-
"input",
|
|
985
|
-
{
|
|
986
|
-
name: fieldName,
|
|
987
|
-
readOnly: inBuilder,
|
|
988
|
-
...inputStyles,
|
|
989
|
-
id: fieldId,
|
|
990
|
-
type: inputType,
|
|
991
|
-
placeholder,
|
|
992
|
-
required
|
|
993
|
-
}
|
|
994
|
-
)
|
|
995
|
-
] });
|
|
996
|
-
};
|
|
997
|
-
const Config$4 = {
|
|
998
|
-
type: "Input",
|
|
999
|
-
label: "Input",
|
|
1000
|
-
category: "core",
|
|
1001
|
-
icon: reactIcons.InputIcon,
|
|
1002
|
-
group: "form",
|
|
1003
|
-
props: {
|
|
1004
|
-
styles: controls.T({ default: "" }),
|
|
1005
|
-
fieldName: controls.g({ title: "Field Name", default: "input" }),
|
|
1006
|
-
inputType: controls.y({
|
|
1007
|
-
title: "Type",
|
|
1008
|
-
options: lodashEs.map(
|
|
1009
|
-
["text", "email", "password", "number", "tel", "file", "hidden", "range", "submit", "color", "date", "time"],
|
|
1010
|
-
(type) => ({
|
|
1011
|
-
value: type,
|
|
1012
|
-
title: type
|
|
1013
|
-
})
|
|
1014
|
-
),
|
|
1015
|
-
default: "text"
|
|
1016
|
-
}),
|
|
1017
|
-
value: controls.g({ title: "Value", default: "", ai: true, i18n: true }),
|
|
1018
|
-
showLabel: controls.c({ title: "Show Label", default: true }),
|
|
1019
|
-
inputStyles: controls.T({ default: "w-full p-1" }),
|
|
1020
|
-
label: controls.g({ title: "Label", default: "Label", ai: true, i18n: true }),
|
|
1021
|
-
placeholder: controls.g({
|
|
1022
|
-
title: "Placeholder",
|
|
1023
|
-
default: "Placeholder"
|
|
1024
|
-
}),
|
|
1025
|
-
required: controls.c({ title: "Required", default: false })
|
|
1026
|
-
}
|
|
1027
|
-
};
|
|
1028
|
-
const RadioBlock = (block) => {
|
|
1029
|
-
const { blockProps, fieldName, label, styles, inputStyles, checked, required, showLabel = true } = block;
|
|
1030
|
-
const fieldId = iconBase.generateUUID();
|
|
1031
|
-
if (!showLabel)
|
|
1032
|
-
return /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(
|
|
1033
|
-
"input",
|
|
1034
|
-
{
|
|
1035
|
-
id: fieldId,
|
|
1036
|
-
...blockProps,
|
|
1037
|
-
...inputStyles,
|
|
1038
|
-
...styles,
|
|
1039
|
-
type: "radio",
|
|
1040
|
-
required,
|
|
1041
|
-
checked,
|
|
1042
|
-
name: fieldName
|
|
1043
|
-
}
|
|
1044
|
-
);
|
|
1045
|
-
return /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsxs("div", { ...styles, ...blockProps, children: [
|
|
1046
|
-
/* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx("input", { ...inputStyles, name: fieldName, id: fieldId, type: "radio", required, defaultChecked: checked }),
|
|
1047
|
-
label && /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx("label", { htmlFor: fieldId, children: label })
|
|
1048
|
-
] });
|
|
1049
|
-
};
|
|
1050
|
-
const Config$3 = {
|
|
1051
|
-
type: "Radio",
|
|
1052
|
-
label: "web_blocks.radio",
|
|
1053
|
-
category: "core",
|
|
1054
|
-
icon: reactIcons.RadiobuttonIcon,
|
|
1055
|
-
group: "form",
|
|
1056
|
-
props: {
|
|
1057
|
-
styles: controls.T({ default: "flex items-center w-max gap-x-2" }),
|
|
1058
|
-
fieldName: controls.g({ title: "web_blocks.field_name", default: "radio" }),
|
|
1059
|
-
label: controls.g({ title: "web_blocks.label", default: "Label" }),
|
|
1060
|
-
checked: controls.c({ title: "web_blocks.checked", default: false }),
|
|
1061
|
-
required: controls.c({ title: "web_blocks.required", default: false })
|
|
1062
|
-
}
|
|
1063
|
-
};
|
|
1064
|
-
const SelectBlock = (block) => {
|
|
1065
|
-
const {
|
|
1066
|
-
blockProps,
|
|
1067
|
-
fieldName,
|
|
1068
|
-
label,
|
|
1069
|
-
placeholder,
|
|
1070
|
-
styles,
|
|
1071
|
-
inputStyles,
|
|
1072
|
-
required,
|
|
1073
|
-
showLabel,
|
|
1074
|
-
_multiple = false
|
|
1075
|
-
} = block;
|
|
1076
|
-
const fieldId = iconBase.generateUUID();
|
|
1077
|
-
if (!showLabel) {
|
|
1078
|
-
return /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsxs(
|
|
1079
|
-
"select",
|
|
1080
|
-
{
|
|
1081
|
-
id: fieldId,
|
|
1082
|
-
...styles,
|
|
1083
|
-
...blockProps,
|
|
1084
|
-
required,
|
|
1085
|
-
multiple: _multiple,
|
|
1086
|
-
name: fieldName,
|
|
1087
|
-
children: [
|
|
1088
|
-
/* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx("option", { value: "", disabled: true, selected: true, hidden: true, children: placeholder }),
|
|
1089
|
-
lodashEs.map(block.options, (option) => /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(
|
|
1090
|
-
"option",
|
|
1091
|
-
{
|
|
1092
|
-
selected: lodashEs.get(option, "selected", false),
|
|
1093
|
-
value: option.value,
|
|
1094
|
-
dangerouslySetInnerHTML: { __html: option.label }
|
|
1095
|
-
},
|
|
1096
|
-
option.value
|
|
1097
|
-
))
|
|
1098
|
-
]
|
|
1099
|
-
}
|
|
1100
|
-
);
|
|
1101
|
-
}
|
|
1102
|
-
return /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsxs("div", { ...styles, children: [
|
|
1103
|
-
showLabel && /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx("label", { htmlFor: fieldId, children: label }),
|
|
1104
|
-
/* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsxs("select", { ...inputStyles, id: fieldId, required, multiple: _multiple, name: fieldName, children: [
|
|
1105
|
-
/* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx("option", { value: "", disabled: true, selected: true, hidden: true, children: placeholder }),
|
|
1106
|
-
lodashEs.map(block.options, (option) => /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(
|
|
1107
|
-
"option",
|
|
1108
|
-
{
|
|
1109
|
-
selected: lodashEs.get(option, "selected", false),
|
|
1110
|
-
value: option.value,
|
|
1111
|
-
dangerouslySetInnerHTML: { __html: option.label }
|
|
1112
|
-
},
|
|
1113
|
-
option.value
|
|
1114
|
-
))
|
|
1115
|
-
] })
|
|
1116
|
-
] });
|
|
1117
|
-
};
|
|
1118
|
-
const Config$2 = {
|
|
1119
|
-
type: "Select",
|
|
1120
|
-
label: "web_blocks.select",
|
|
1121
|
-
category: "core",
|
|
1122
|
-
icon: reactIcons.DropdownMenuIcon,
|
|
1123
|
-
group: "form",
|
|
1124
|
-
props: {
|
|
1125
|
-
styles: controls.T({ default: "" }),
|
|
1126
|
-
fieldName: controls.g({ title: "Field Name", default: "select" }),
|
|
1127
|
-
showLabel: controls.c({ title: "Show Label", default: true }),
|
|
1128
|
-
inputStyles: controls.T({ default: "w-full p-1" }),
|
|
1129
|
-
label: controls.g({ title: "Label", default: "Label", ai: true, i18n: true }),
|
|
1130
|
-
placeholder: controls.g({
|
|
1131
|
-
title: "Placeholder",
|
|
1132
|
-
default: "Placeholder"
|
|
1133
|
-
}),
|
|
1134
|
-
required: controls.c({ title: "Required", default: false }),
|
|
1135
|
-
_multiple: controls.c({ title: "Multiple", default: false }),
|
|
1136
|
-
options: controls.S({
|
|
1137
|
-
title: "Options",
|
|
1138
|
-
itemProperties: {
|
|
1139
|
-
label: controls.g({ title: "Label", default: "", ai: true, i18n: true }),
|
|
1140
|
-
value: controls.g({ title: "Value", default: "" })
|
|
1141
|
-
}
|
|
1142
|
-
})
|
|
1143
|
-
}
|
|
1144
|
-
};
|
|
1145
|
-
const TextAreaBlock = (block) => {
|
|
1146
|
-
const { blockProps, fieldName, label, placeholder, styles, inputStyles, _rows, showLabel } = block;
|
|
1147
|
-
const fieldId = iconBase.generateUUID();
|
|
1148
|
-
if (!showLabel) {
|
|
1149
|
-
return /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(
|
|
1150
|
-
"textarea",
|
|
1151
|
-
{
|
|
1152
|
-
id: fieldId,
|
|
1153
|
-
name: fieldName,
|
|
1154
|
-
...blockProps,
|
|
1155
|
-
...inputStyles,
|
|
1156
|
-
...styles,
|
|
1157
|
-
placeholder,
|
|
1158
|
-
rows: _rows
|
|
1159
|
-
}
|
|
1160
|
-
);
|
|
1161
|
-
}
|
|
1162
|
-
return /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsxs("div", { ...styles, ...blockProps, children: [
|
|
1163
|
-
showLabel && /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx("label", { htmlFor: fieldId, children: label }),
|
|
1164
|
-
/* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx("textarea", { name: fieldName, ...inputStyles, id: fieldId, placeholder, rows: _rows })
|
|
1165
|
-
] });
|
|
1166
|
-
};
|
|
1167
|
-
const Config$1 = {
|
|
1168
|
-
type: "TextArea",
|
|
1169
|
-
label: "web_blocks.textarea",
|
|
1170
|
-
category: "core",
|
|
1171
|
-
icon: reactIcons.InputIcon,
|
|
1172
|
-
group: "form",
|
|
1173
|
-
props: {
|
|
1174
|
-
fieldName: controls.g({ title: "Field Name", default: "textarea" }),
|
|
1175
|
-
showLabel: controls.c({ title: "Show Label", default: true }),
|
|
1176
|
-
styles: controls.T({ default: "" }),
|
|
1177
|
-
inputStyles: controls.T({ default: "w-full p-1" }),
|
|
1178
|
-
label: controls.g({ title: "Label", default: "Label", ai: true, i18n: true }),
|
|
1179
|
-
placeholder: controls.g({
|
|
1180
|
-
title: "Placeholder",
|
|
1181
|
-
default: "Placeholder"
|
|
1182
|
-
}),
|
|
1183
|
-
_rows: controls.s({ title: "Rows", default: 3 })
|
|
1184
|
-
}
|
|
1185
|
-
};
|
|
1186
|
-
const CheckboxBlock = (block) => {
|
|
1187
|
-
const { blockProps, fieldName, label, styles, inputStyles, required, checked, showLabel = true } = block;
|
|
1188
|
-
const fieldId = iconBase.generateUUID();
|
|
1189
|
-
if (!showLabel)
|
|
1190
|
-
return /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(
|
|
1191
|
-
"input",
|
|
1192
|
-
{
|
|
1193
|
-
id: fieldId,
|
|
1194
|
-
...blockProps,
|
|
1195
|
-
...inputStyles,
|
|
1196
|
-
...styles,
|
|
1197
|
-
type: "checkbox",
|
|
1198
|
-
required,
|
|
1199
|
-
name: fieldName
|
|
1200
|
-
}
|
|
1201
|
-
);
|
|
1202
|
-
return /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsxs("div", { ...styles, ...blockProps, children: [
|
|
1203
|
-
/* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(
|
|
1204
|
-
"input",
|
|
1205
|
-
{
|
|
1206
|
-
...inputStyles,
|
|
1207
|
-
name: fieldName,
|
|
1208
|
-
id: fieldId,
|
|
1209
|
-
type: "checkbox",
|
|
1210
|
-
required,
|
|
1211
|
-
defaultChecked: checked
|
|
1212
|
-
}
|
|
1213
|
-
),
|
|
1214
|
-
label && label !== "Label" && /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx("label", { htmlFor: fieldId, children: label })
|
|
1215
|
-
] });
|
|
1216
|
-
};
|
|
1217
|
-
const Config = {
|
|
1218
|
-
type: "Checkbox",
|
|
1219
|
-
label: "web_blocks.checkbox",
|
|
1220
|
-
category: "core",
|
|
1221
|
-
icon: reactIcons.CheckboxIcon,
|
|
1222
|
-
group: "form",
|
|
1223
|
-
props: {
|
|
1224
|
-
fieldName: controls.g({ title: "Field Name", default: "checkbox" }),
|
|
1225
|
-
styles: controls.T({ default: "flex items-center gap-x-2" }),
|
|
1226
|
-
label: controls.g({ title: "web_blocks.label", default: "Label" }),
|
|
1227
|
-
checked: controls.c({ title: "web_blocks.checked", default: false }),
|
|
1228
|
-
required: controls.c({ title: "web_blocks.required", default: false })
|
|
1229
|
-
}
|
|
1230
|
-
};
|
|
1231
|
-
const loadWebBlocks = () => {
|
|
1232
|
-
runtime.registerChaiBlock(Component$2, Config$s);
|
|
1233
|
-
runtime.registerChaiBlock(EmptyBox, Config$p);
|
|
1234
|
-
runtime.registerChaiBlock(Component$1, Config$r);
|
|
1235
|
-
runtime.registerChaiBlock(HeadingBlock, Config$o);
|
|
1236
|
-
runtime.registerChaiBlock(ParagraphBlock, Config$n);
|
|
1237
|
-
runtime.registerChaiBlock(SpanBlock, Config$m);
|
|
1238
|
-
runtime.registerChaiBlock(RichTextBlock, Config$l);
|
|
1239
|
-
runtime.registerChaiBlock(LinkBlock, Config$k);
|
|
1240
|
-
runtime.registerChaiBlock(LightBoxLinkBlock, Config$j);
|
|
1241
|
-
runtime.registerChaiBlock(ListBlock, Config$i);
|
|
1242
|
-
runtime.registerChaiBlock(ListItemBlock, Config$h);
|
|
1243
|
-
runtime.registerChaiBlock(IconBlock, Config$g);
|
|
1244
|
-
runtime.registerChaiBlock(ImageBlock, Config$f);
|
|
1245
|
-
runtime.registerChaiBlock(VideoBlock, Config$e);
|
|
1246
|
-
runtime.registerChaiBlock(CustomHTMLBlock, Config$q);
|
|
1247
|
-
runtime.registerChaiBlock(RawTextBlock, Config$9);
|
|
1248
|
-
runtime.registerChaiBlock(FormBlock, Config$6);
|
|
1249
|
-
runtime.registerChaiBlock(FormButtonBlock, Config$5);
|
|
1250
|
-
runtime.registerChaiBlock(InputBlock, Config$4);
|
|
1251
|
-
runtime.registerChaiBlock(CheckboxBlock, Config);
|
|
1252
|
-
runtime.registerChaiBlock(RadioBlock, Config$3);
|
|
1253
|
-
runtime.registerChaiBlock(SelectBlock, Config$2);
|
|
1254
|
-
runtime.registerChaiBlock(TextAreaBlock, Config$1);
|
|
1255
|
-
runtime.registerChaiBlock(LineBreakComponent, Config$7);
|
|
1256
|
-
runtime.registerChaiBlock(BodyBlock, Config$8);
|
|
1257
|
-
runtime.registerChaiBlock(CustomScript, Config$d);
|
|
1258
|
-
runtime.registerChaiBlock(DividerBlock, Config$c);
|
|
1259
|
-
runtime.registerChaiBlock(DarkMode, Config$b);
|
|
1260
|
-
runtime.registerChaiBlock(Component, Config$a);
|
|
1261
|
-
};
|
|
1262
|
-
exports.loadWebBlocks = loadWebBlocks;
|
|
24
|
+
}`,"x-on:submit.prevent":"submit"},b={"data-response":"",":class":"{'text-red-500': formStatus === 'ERROR', 'text-green-500': formStatus === 'SUCCESS'}"};return a.jsxRuntimeExports.jsxs("form",{...h,"data-error":l,"data-success":n,method:"post",action:i,...o,...c,children:[a.jsxRuntimeExports.jsx("div",{...b}),a.jsxRuntimeExports.jsx("input",{name:"formname",type:"hidden",value:s||r}),d]})},ve={type:"Form",label:"Form",category:"core",icon:g.GroupIcon,group:"form",props:{styles:t.T({default:""}),action:t.g({title:"Submit URL",default:"/api/form/submit"}),errorMessage:t.m({title:"Error Message",default:"Something went wrong. Please try again"}),successMessage:t.m({title:"Success Message",default:"Thank you for your submission."})},canAcceptBlock:()=>!0},_e=e=>{const{blockProps:o,inBuilder:l,label:s,styles:r,inputStyles:n,icon:i,iconPos:c}=e,u=y.generateUUID(),d={"x-bind:disabled":"formLoading"};return a.jsxRuntimeExports.jsxs("button",{id:u,...d,...n,...r,...o||{},type:l?"button":"submit",children:[s,i&&a.jsxRuntimeExports.jsx("span",{className:c,dangerouslySetInnerHTML:{__html:i}})]})},je={type:"FormButton",label:"Submit Button",category:"core",icon:g.ButtonIcon,group:"form",props:{label:t.g({title:"Label",default:"Submit",ai:!0,i18n:!0}),styles:t.T({default:"text-white bg-primary disabled:bg-gray-400 px-4 py-2 rounded-global flex items-center gap-x-2"}),icon:t.q({title:"Icon",default:""}),iconPos:t.y({title:"Icon Position",default:"order-last",options:[{title:"Start",value:"order-first"},{title:"End",value:"order-last"}]})}},Be=e=>{const{blockProps:o,label:l,placeholder:s,styles:r,inputStyles:n,showLabel:i,required:c,inputType:u="text",inBuilder:d,fieldName:h}=e,b=y.generateUUID();return!i||u==="submit"?(u==="submit"&&(o.value=l),a.jsxRuntimeExports.jsx("input",{id:b,name:h,readOnly:d,...o,...n,...r,type:u,placeholder:s,required:c})):a.jsxRuntimeExports.jsxs("div",{...r,...o,children:[i&&a.jsxRuntimeExports.jsx("label",{htmlFor:b,children:l}),a.jsxRuntimeExports.jsx("input",{name:h,readOnly:d,...n,id:b,type:u,placeholder:s,required:c})]})},Ee={type:"Input",label:"Input",category:"core",icon:g.InputIcon,group:"form",props:{styles:t.T({default:""}),fieldName:t.g({title:"Field Name",default:"input"}),inputType:t.y({title:"Type",options:f.map(["text","email","password","number","tel","file","hidden","range","submit","color","date","time"],e=>({value:e,title:e})),default:"text"}),value:t.g({title:"Value",default:"",ai:!0,i18n:!0}),showLabel:t.c({title:"Show Label",default:!0}),inputStyles:t.T({default:"w-full p-1"}),label:t.g({title:"Label",default:"Label",ai:!0,i18n:!0}),placeholder:t.g({title:"Placeholder",default:"Placeholder"}),required:t.c({title:"Required",default:!1})}},Ce=e=>{const{blockProps:o,fieldName:l,label:s,styles:r,inputStyles:n,checked:i,required:c,showLabel:u=!0}=e,d=y.generateUUID();return u?a.jsxRuntimeExports.jsxs("div",{...r,...o,children:[a.jsxRuntimeExports.jsx("input",{...n,name:l,id:d,type:"radio",required:c,defaultChecked:i}),s&&a.jsxRuntimeExports.jsx("label",{htmlFor:d,children:s})]}):a.jsxRuntimeExports.jsx("input",{id:d,...o,...n,...r,type:"radio",required:c,checked:i,name:l})},Ie={type:"Radio",label:"web_blocks.radio",category:"core",icon:g.RadiobuttonIcon,group:"form",props:{styles:t.T({default:"flex items-center w-max gap-x-2"}),fieldName:t.g({title:"web_blocks.field_name",default:"radio"}),label:t.g({title:"web_blocks.label",default:"Label"}),checked:t.c({title:"web_blocks.checked",default:!1}),required:t.c({title:"web_blocks.required",default:!1})}},Le=e=>{const{blockProps:o,fieldName:l,label:s,placeholder:r,styles:n,inputStyles:i,required:c,showLabel:u,_multiple:d=!1}=e,h=y.generateUUID();return u?a.jsxRuntimeExports.jsxs("div",{...n,children:[u&&a.jsxRuntimeExports.jsx("label",{htmlFor:h,children:s}),a.jsxRuntimeExports.jsxs("select",{...i,id:h,required:c,multiple:d,name:l,children:[a.jsxRuntimeExports.jsx("option",{value:"",disabled:!0,selected:!0,hidden:!0,children:r}),f.map(e.options,b=>a.jsxRuntimeExports.jsx("option",{selected:f.get(b,"selected",!1),value:b.value,dangerouslySetInnerHTML:{__html:b.label}},b.value))]})]}):a.jsxRuntimeExports.jsxs("select",{id:h,...n,...o,required:c,multiple:d,name:l,children:[a.jsxRuntimeExports.jsx("option",{value:"",disabled:!0,selected:!0,hidden:!0,children:r}),f.map(e.options,b=>a.jsxRuntimeExports.jsx("option",{selected:f.get(b,"selected",!1),value:b.value,dangerouslySetInnerHTML:{__html:b.label}},b.value))]})},Re={type:"Select",label:"web_blocks.select",category:"core",icon:g.DropdownMenuIcon,group:"form",props:{styles:t.T({default:""}),fieldName:t.g({title:"Field Name",default:"select"}),showLabel:t.c({title:"Show Label",default:!0}),inputStyles:t.T({default:"w-full p-1"}),label:t.g({title:"Label",default:"Label",ai:!0,i18n:!0}),placeholder:t.g({title:"Placeholder",default:"Placeholder"}),required:t.c({title:"Required",default:!1}),_multiple:t.c({title:"Multiple",default:!1}),options:t.S({title:"Options",itemProperties:{label:t.g({title:"Label",default:"",ai:!0,i18n:!0}),value:t.g({title:"Value",default:""})}})}},Se=e=>{const{blockProps:o,fieldName:l,label:s,placeholder:r,styles:n,inputStyles:i,_rows:c,showLabel:u}=e,d=y.generateUUID();return u?a.jsxRuntimeExports.jsxs("div",{...n,...o,children:[u&&a.jsxRuntimeExports.jsx("label",{htmlFor:d,children:s}),a.jsxRuntimeExports.jsx("textarea",{name:l,...i,id:d,placeholder:r,rows:c})]}):a.jsxRuntimeExports.jsx("textarea",{id:d,name:l,...o,...i,...n,placeholder:r,rows:c})},Te={type:"TextArea",label:"web_blocks.textarea",category:"core",icon:g.InputIcon,group:"form",props:{fieldName:t.g({title:"Field Name",default:"textarea"}),showLabel:t.c({title:"Show Label",default:!0}),styles:t.T({default:""}),inputStyles:t.T({default:"w-full p-1"}),label:t.g({title:"Label",default:"Label",ai:!0,i18n:!0}),placeholder:t.g({title:"Placeholder",default:"Placeholder"}),_rows:t.s({title:"Rows",default:3})}},Me=e=>{const{blockProps:o,fieldName:l,label:s,styles:r,inputStyles:n,required:i,checked:c,showLabel:u=!0}=e,d=y.generateUUID();return u?a.jsxRuntimeExports.jsxs("div",{...r,...o,children:[a.jsxRuntimeExports.jsx("input",{...n,name:l,id:d,type:"checkbox",required:i,defaultChecked:c}),s&&s!=="Label"&&a.jsxRuntimeExports.jsx("label",{htmlFor:d,children:s})]}):a.jsxRuntimeExports.jsx("input",{id:d,...o,...n,...r,type:"checkbox",required:i,name:l})},$e={type:"Checkbox",label:"web_blocks.checkbox",category:"core",icon:g.CheckboxIcon,group:"form",props:{fieldName:t.g({title:"Field Name",default:"checkbox"}),styles:t.T({default:"flex items-center gap-x-2"}),label:t.g({title:"web_blocks.label",default:"Label"}),checked:t.c({title:"web_blocks.checked",default:!1}),required:t.c({title:"web_blocks.required",default:!1})}},Pe=()=>{p.registerChaiBlock(L,R),p.registerChaiBlock(P,N),p.registerChaiBlock(S,T),p.registerChaiBlock(q,H),p.registerChaiBlock(D,z),p.registerChaiBlock(A,U),p.registerChaiBlock(F,O),p.registerChaiBlock(V,G),p.registerChaiBlock(W,X),p.registerChaiBlock(Y,Z),p.registerChaiBlock(J,K),p.registerChaiBlock(Q,ee),p.registerChaiBlock(te,le),p.registerChaiBlock(se,re),p.registerChaiBlock(M,$),p.registerChaiBlock(be,fe),p.registerChaiBlock(we,ve),p.registerChaiBlock(_e,je),p.registerChaiBlock(Be,Ee),p.registerChaiBlock(Me,$e),p.registerChaiBlock(Ce,Ie),p.registerChaiBlock(Le,Re),p.registerChaiBlock(Se,Te),p.registerChaiBlock(xe,ke),p.registerChaiBlock(he,ye),p.registerChaiBlock(ne,ie),p.registerChaiBlock(ce,ue),p.registerChaiBlock(de,pe),p.registerChaiBlock(me,ge)};exports.loadWebBlocks=Pe;
|