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