@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.
Files changed (63) hide show
  1. package/dist/CodeEditor-1LboGb1I.cjs +91 -0
  2. package/dist/CodeEditor-BKgZeXwz.js +91 -0
  3. package/dist/STRINGS-3Sn_NeX1.cjs +9 -0
  4. package/dist/STRINGS-DdpfVlsV.js +10 -0
  5. package/dist/Topbar-B8IS6y4H.js +135 -0
  6. package/dist/Topbar-DXC7DFU1.cjs +135 -0
  7. package/dist/UnsplashImages-CjJ5szAy.cjs +215 -0
  8. package/dist/UnsplashImages-Ck9qpKR0.js +215 -0
  9. package/dist/UploadImages-DW1mj4MB.cjs +117 -0
  10. package/dist/UploadImages-DgAMZ8GR.js +117 -0
  11. package/dist/context-menu-BLbuduri.cjs +1073 -0
  12. package/dist/context-menu-BgtRnByf.js +1042 -0
  13. package/dist/controls-8EZmm0Ns.js +234 -0
  14. package/dist/controls-DaW52RjX.cjs +233 -0
  15. package/dist/core.cjs +82 -1
  16. package/dist/core.d.ts +1 -1
  17. package/dist/core.js +74 -74
  18. package/dist/iconBase-BSrIcOaG.cjs +146 -0
  19. package/dist/iconBase-CWgVxu0A.js +147 -0
  20. package/dist/index-Bjw2sUN2.cjs +12139 -0
  21. package/dist/index-D8_rAW8B.js +12124 -0
  22. package/dist/jsx-runtime-B6vEU3CM.cjs +925 -0
  23. package/dist/jsx-runtime-ClFauRgV.js +926 -0
  24. package/dist/plugin-BYwesM58.cjs +54 -0
  25. package/dist/plugin-BiDLHDo3.cjs +114 -0
  26. package/dist/plugin-BukD7GJR.js +115 -0
  27. package/dist/plugin-tVAEvXiS.js +55 -0
  28. package/dist/render.cjs +208 -2
  29. package/dist/render.js +171 -125
  30. package/dist/runtime.cjs +26 -1
  31. package/dist/runtime.js +16 -16
  32. package/dist/style.css +1529 -2
  33. package/dist/tailwind.cjs +78 -1
  34. package/dist/tailwind.js +21 -19
  35. package/dist/ui.cjs +392 -1
  36. package/dist/ui.js +268 -257
  37. package/dist/web-blocks.cjs +1241 -3
  38. package/dist/web-blocks.js +764 -555
  39. package/package.json +1 -1
  40. package/dist/CodeEditor-CIj-zefC.cjs +0 -1
  41. package/dist/CodeEditor-Dg8G9eNI.js +0 -77
  42. package/dist/STRINGS-eiGM83kj.js +0 -7
  43. package/dist/STRINGS-ew98weUe.cjs +0 -1
  44. package/dist/Topbar-DnBBEcVI.js +0 -113
  45. package/dist/Topbar-HnONG7Hb.cjs +0 -1
  46. package/dist/UnsplashImages-BUjFvJDU.cjs +0 -1
  47. package/dist/UnsplashImages-DPqU7_If.js +0 -189
  48. package/dist/UploadImages-BA3AIppS.js +0 -101
  49. package/dist/UploadImages-C-rAULbD.cjs +0 -1
  50. package/dist/context-menu-BbqLeYFX.js +0 -979
  51. package/dist/context-menu-DfAXjmc8.cjs +0 -1
  52. package/dist/controls-C4n5ycp4.cjs +0 -1
  53. package/dist/controls-Com-zYCq.js +0 -234
  54. package/dist/iconBase-Cn2BsTrq.cjs +0 -1
  55. package/dist/iconBase-DHfFLkem.js +0 -124
  56. package/dist/index-Cd9gI_fI.js +0 -9235
  57. package/dist/index-D1Arkf5C.cjs +0 -63
  58. package/dist/jsx-runtime-BYECrxsp.cjs +0 -30
  59. package/dist/jsx-runtime-DGlMoOmv.js +0 -630
  60. package/dist/plugin-BOEoR5jk.js +0 -44
  61. package/dist/plugin-COMQcYlW.cjs +0 -1
  62. package/dist/plugin-Dw854zFv.js +0 -107
  63. package/dist/plugin-I9XxF65G.cjs +0 -1
@@ -1,25 +1,35 @@
1
- import { registerChaiBlock as u } from "@chaibuilder/runtime";
2
- import { j as s } from "./jsx-runtime-DGlMoOmv.js";
3
- import * as b from "react";
4
- import { T as f, y as v, x as j, g as p, q as $, s as L, l as T, f as B, m as S, w as D, c as y, b as F, S as G } from "./controls-Com-zYCq.js";
5
- import { c as C, G as V, g as I } from "./iconBase-DHfFLkem.js";
6
- import { ButtonIcon as H, CodeIcon as U, HeadingIcon as O, TextIcon as W, CursorTextIcon as X, Link1Icon as Y, ImageIcon as R, RowsIcon as Z, ColumnsIcon as J, SketchLogoIcon as K, VideoIcon as Q, DividerHorizontalIcon as ee, MoonIcon as te, SpaceBetweenVerticallyIcon as z, GroupIcon as le, InputIcon as A, RadiobuttonIcon as oe, DropdownMenuIcon as ae, CheckboxIcon as se } from "@radix-ui/react-icons";
7
- import { isNull as re, isEmpty as k, get as w, pick as ne, omit as ie, map as M } from "lodash-es";
8
- import { GlobeIcon as ce } from "lucide-react";
9
- const _ = ({ className: e = "", inBuilder: l }) => l ? /* @__PURE__ */ s.jsx("div", { className: C("pointer-events-none flex h-20 flex-col items-center justify-center p-2", e), children: /* @__PURE__ */ s.jsx("div", { className: "h-full w-full rounded bg-gray-200 p-2 dark:bg-gray-800", children: /* @__PURE__ */ s.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, de = (e) => {
10
- const { blockProps: l, inBuilder: t, backgroundImage: o, children: a, tag: r = "div", styles: n } = e;
11
- let i = a;
12
- a || (i = /* @__PURE__ */ s.jsx(_, { inBuilder: t }));
13
- let c = {};
14
- return o && (c = { backgroundImage: `url(${o})` }), b.createElement(r, { ...l, ...n, style: c }, i);
15
- }, ue = {
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: f({ default: "" }),
22
- tag: v({
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: j({ title: "web_blocks.background_image" })
55
+ backgroundImage: x({ title: "web_blocks.background_image" })
46
56
  },
47
- canAcceptBlock: () => !0
48
- }, pe = (e) => {
49
- const { blockProps: l, iconSize: t, icon: o, content: a, iconPos: r, styles: n, children: i } = e, c = o, d = i || /* @__PURE__ */ s.jsxs(s.Fragment, { children: [
50
- /* @__PURE__ */ s.jsx("span", { "data-ai-key": "content", children: a }),
51
- c && /* @__PURE__ */ s.jsx(
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: t + "px" },
55
- className: r + " " + (r === "order-first" ? "mr-2" : "ml-2") || "",
56
- dangerouslySetInnerHTML: { __html: c }
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 b.createElement(
73
+ return React.createElement(
61
74
  "button",
62
75
  {
63
- ...l,
64
- ...n,
76
+ ...blockProps,
77
+ ...styles,
65
78
  type: "button"
66
79
  },
67
- d
80
+ child
68
81
  );
69
- }, be = {
82
+ };
83
+ const Config$r = {
70
84
  type: "Button",
71
85
  label: "web_blocks.button",
72
86
  category: "core",
73
- icon: H,
87
+ icon: ButtonIcon,
74
88
  group: "basic",
75
89
  props: {
76
- content: p({ title: "web_blocks.label", default: "Button", ai: !0, i18n: !0 }),
77
- styles: f({ default: "text-white bg-primary px-4 py-2 rounded-global flex items-center" }),
78
- icon: $({ title: "web_blocks.icon", default: "" }),
79
- iconSize: L({ title: "web_blocks.icon_size", default: 24 }),
80
- iconPos: v({
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
- }, fe = (e) => {
90
- const { blockProps: l, styles: t, htmlCode: o, inBuilder: a } = e;
91
- return a ? /* @__PURE__ */ s.jsxs("div", { className: "relative", children: [
92
- a ? /* @__PURE__ */ s.jsx("div", { ...l, ...t, className: "absolute z-20 h-full w-full" }) : null,
93
- b.createElement("div", {
94
- ...t,
95
- dangerouslySetInnerHTML: { __html: o.replace(/<script.*?>.*?<\/script>/g, "") }
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
- ] }) : b.createElement("div", {
98
- ...l,
99
- ...t,
100
- dangerouslySetInnerHTML: { __html: o }
112
+ ] }) : React.createElement("div", {
113
+ ...blockProps,
114
+ ...styles,
115
+ dangerouslySetInnerHTML: { __html: htmlCode }
101
116
  });
102
- }, me = {
117
+ };
118
+ const Config$q = {
103
119
  type: "CustomHTML",
104
120
  label: "web_blocks.custom_html",
105
121
  category: "core",
106
- icon: U,
122
+ icon: CodeIcon,
107
123
  group: "advanced",
108
124
  props: {
109
- styles: f({ default: "" }),
110
- htmlCode: T({
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
- }, he = b.memo(
117
- (e) => {
118
- const { blockProps: l, styles: t, backgroundImage: o } = e;
119
- let a = {};
120
- return o && (a = { backgroundImage: `url(${o})` }), b.createElement("div", { ...l, ...t, style: a });
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
- ), ye = {
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: f({ default: "" }),
129
- backgroundImage: j({ title: "Background Image" })
149
+ styles: T({ default: "" }),
150
+ backgroundImage: x({ title: "Background Image" })
130
151
  }
131
- }, ge = (e) => {
132
- const { blockProps: l, styles: t, content: o, level: a = "h1", children: r = null } = e;
133
- return r ? b.createElement(a, { ...t, ...l }, r) : b.createElement(a, {
134
- ...t,
135
- ...l,
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: o }
161
+ dangerouslySetInnerHTML: { __html: content }
139
162
  });
140
- }, ke = {
163
+ };
164
+ const Config$o = {
141
165
  type: "Heading",
142
166
  label: "web_blocks.heading",
143
167
  category: "core",
144
- icon: O,
168
+ icon: HeadingIcon,
145
169
  group: "typography",
146
170
  props: {
147
- level: v({
171
+ level: y({
148
172
  title: "web_blocks.level",
149
173
  default: "h2",
150
- binding: !1,
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: f({ default: "text-3xl" }),
161
- content: B({ title: "Content", default: "Heading goes here", ai: !0, i18n: !0 })
184
+ styles: T({ default: "text-3xl" }),
185
+ content: f({ title: "Content", default: "Heading goes here", ai: true, i18n: true })
162
186
  },
163
- canAcceptBlock: (e) => e === "Span" || e === "Text"
164
- }, xe = (e) => {
165
- const { blockProps: l, styles: t, content: o } = e;
166
- return re(e.children) ? b.createElement("p", {
167
- ...t,
168
- ...l,
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: o }
172
- }) : b.createElement("p", { ...t, ...l }, e.children);
173
- }, we = {
197
+ dangerouslySetInnerHTML: { __html: content }
198
+ });
199
+ };
200
+ const Config$n = {
174
201
  type: "Paragraph",
175
202
  label: "Paragraph",
176
203
  category: "core",
177
- icon: W,
204
+ icon: TextIcon,
178
205
  group: "typography",
179
206
  props: {
180
- styles: f({ default: "" }),
181
- content: B({
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: !0,
187
- i18n: !0
213
+ ai: true,
214
+ i18n: true
188
215
  })
189
216
  },
190
- canAcceptBlock: (e) => e === "Span" || e === "Link" || e === "Text"
191
- }, ve = (e) => {
192
- const { blockProps: l, styles: t, content: o, children: a = null, tag: r } = e;
193
- return a ? b.createElement("span", { ...t, ...l }, a) : b.createElement(r || "span", {
194
- ...t,
195
- ...l,
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: o || "" }
226
+ dangerouslySetInnerHTML: { __html: content || "" }
198
227
  });
199
- }, _e = {
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: f({ default: "" }),
206
- content: B({ title: "Content", default: "", ai: !0, i18n: !0 })
235
+ styles: T({ default: "" }),
236
+ content: f({ title: "Content", default: "", ai: true, i18n: true })
207
237
  },
208
- canAcceptBlock: () => !0
209
- }, Ie = (e) => {
210
- const { blockProps: l, content: t, styles: o } = e;
211
- return /* @__PURE__ */ s.jsx("div", { className: "max-w-full", children: /* @__PURE__ */ s.jsx(
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
- ...l,
217
- ...o,
218
- dangerouslySetInnerHTML: { __html: t }
247
+ ...blockProps,
248
+ ...styles,
249
+ dangerouslySetInnerHTML: { __html: content }
219
250
  }
220
251
  ) });
221
- }, Le = {
252
+ };
253
+ const Config$l = {
222
254
  type: "RichText",
223
255
  label: "Rich Text",
224
256
  category: "core",
225
- icon: X,
257
+ icon: CursorTextIcon,
226
258
  group: "typography",
227
259
  props: {
228
- styles: f({ default: "" }),
229
- content: S({
260
+ styles: T({ default: "" }),
261
+ content: m({
230
262
  title: "Content",
231
- ai: !0,
232
- i18n: !0,
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
- }, Be = (e) => {
237
- const { blockProps: l, link: t, children: o, styles: a, inBuilder: r, content: n } = e;
238
- let i = {};
239
- return !o && k(n) && (i = { minHeight: "50px", display: "flex", alignItems: "center", justifyContent: "center" }), r ? o ? /* @__PURE__ */ s.jsx("span", { ...l, style: i, ...a, children: o }) : b.createElement(
240
- "span",
241
- {
242
- ...l,
243
- ...a,
244
- style: i,
245
- "data-ai-key": "content"
246
- },
247
- n
248
- ) : o ? /* @__PURE__ */ s.jsx("a", { href: (t == null ? void 0 : t.href) || "#/", target: t == null ? void 0 : t.target, ...l, ...a, children: o }) : b.createElement(
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
- ...l,
252
- ...a,
297
+ ...blockProps,
298
+ ...styles,
253
299
  "data-ai-key": "content",
254
- href: (t == null ? void 0 : t.href) || "#",
255
- target: (t == null ? void 0 : t.target) || "_self"
300
+ href: (link == null ? void 0 : link.href) || "#",
301
+ target: (link == null ? void 0 : link.target) || "_self"
256
302
  },
257
- n
303
+ content
258
304
  );
259
- }, Ce = {
305
+ };
306
+ const Config$k = {
260
307
  type: "Link",
261
308
  label: "Link",
262
309
  category: "core",
263
- icon: Y,
310
+ icon: Link1Icon,
264
311
  group: "basic",
265
312
  props: {
266
- styles: f({ default: "" }),
267
- content: p({ title: "Content", default: "", ai: !0, i18n: !0 }),
268
- link: D({
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: (e) => e !== "Link"
274
- }, q = (e, ...l) => ({
275
- ...e,
276
- className: C(e.className, ...l)
277
- }), je = (e) => {
278
- const { blockProps: l, children: t, styles: o, inBuilder: a, content: r, href: n } = e, { hrefType: i, autoplay: c, maxWidth: d, backdropColor: h, galleryName: m } = e, g = q(o, "cb-lightbox");
279
- if (!t && k(o == null ? void 0 : o.className) && k(r))
280
- return /* @__PURE__ */ s.jsx(_, { inBuilder: a });
281
- if (a)
282
- return t ? /* @__PURE__ */ s.jsx("span", { ...l, ...g, children: t }) : b.createElement("span", {
283
- ...l,
284
- ...g,
285
- dangerouslySetInnerHTML: { __html: r }
286
- });
287
- const x = {};
288
- return x["data-vbtype"] = i, c && (x["data-autoplay"] = "true"), d && (x["data-maxwidth"] = d + "px"), h && (x["data-overlay"] = h), m && (x["data-gall"] = m), t ? /* @__PURE__ */ s.jsx("a", { ...x, href: n || "#/", ...l, ...g, children: t }) : b.createElement("a", {
289
- ...l,
290
- ...g,
291
- ...x,
292
- href: n || "#",
293
- dangerouslySetInnerHTML: { __html: r }
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
- }, Se = {
362
+ };
363
+ const Config$j = {
296
364
  type: "LightBoxLink",
297
365
  label: "Lightbox Link",
298
366
  category: "core",
299
- icon: R,
367
+ icon: ImageIcon,
300
368
  group: "basic",
301
369
  props: {
302
- styles: f({ default: "" }),
303
- content: p({ title: "Content", default: "Link text or drop blocks inside", ai: !0, i18n: !0 }),
304
- href: p({ title: "Href", default: "" }),
305
- hrefType: v({
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: y({ title: "Autoplay", default: !1 }),
316
- maxWidth: L({ title: "Max Width", default: "" }),
317
- backdropColor: p({ title: "Backdrop Color", default: "" }),
318
- galleryName: p({ title: "Gallery Name", default: "" })
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: (e) => e !== "Link" && e !== "LightBoxLink"
321
- }, Me = (e) => {
322
- const { blockProps: l, children: t, listType: o, styles: a, tag: r, inBuilder: n } = e, i = C(w(a, "className", ""), o);
323
- return !t && k(a == null ? void 0 : a.className) ? /* @__PURE__ */ s.jsx(_, { inBuilder: n }) : b.createElement(
324
- r || (o === "list-decimal" ? "ol" : "ul"),
325
- { ...l, ...a, className: i },
326
- t
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
- }, $e = {
401
+ };
402
+ const Config$i = {
329
403
  type: "List",
330
404
  label: "web_blocks.list",
331
- icon: Z,
405
+ icon: RowsIcon,
332
406
  category: "core",
333
407
  group: "basic",
334
408
  props: {
335
- styles: f({ default: "" }),
336
- listType: v({
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: (e) => e === "ListItem",
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
- }, Ee = (e) => {
372
- const { blockProps: l, content: t, styles: o, children: a, tag: r } = e;
373
- return a ? b.createElement(r || "li", { ...o, ...l }, a) : b.createElement(r || "li", {
374
- ...o,
375
- ...l,
376
- "data-ai-key": "content",
377
- dangerouslySetInnerHTML: { __html: t }
378
- });
379
- }, Ne = {
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: J,
461
+ icon: ColumnsIcon,
383
462
  category: "core",
384
463
  group: "basic",
385
464
  props: {
386
- styles: f({ default: "" }),
387
- content: B({ title: "Content", default: "List item", ai: !0, i18n: !0 })
465
+ styles: T({ default: "" }),
466
+ content: f({ title: "Content", default: "List item", ai: true, i18n: true })
388
467
  },
389
- canAcceptBlock: (e) => e !== "ListItem",
390
- canBeNested: (e) => e === "List"
391
- }, Pe = (e) => {
392
- const { blockProps: l, icon: t, styles: o, width: a, inBuilder: r, height: n } = e, i = q(o, C(a ? `w-[${a}px]` : "", n ? `h-[${n}px]` : ""));
393
- if (k(t))
394
- return /* @__PURE__ */ s.jsx(_, { inBuilder: r, className: "h-8 w-14" });
395
- const c = t.replace(/<svg /g, '<svg class="w-[inherit] h-[inherit]" ');
396
- return b.createElement("span", {
397
- ...l,
398
- ...i,
399
- dangerouslySetInnerHTML: { __html: c }
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
- }, Te = {
483
+ };
484
+ const Config$g = {
402
485
  type: "Icon",
403
486
  label: "web_blocks.icon",
404
487
  category: "core",
405
- icon: K,
488
+ icon: SketchLogoIcon,
406
489
  group: "media",
407
490
  props: {
408
- styles: f({ default: "text-black" }),
409
- icon: $({
491
+ styles: T({ default: "text-black" }),
492
+ icon: q({
410
493
  title: "web_blocks.icon",
411
- 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>'
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: L({ title: "web_blocks.width", default: "" }),
414
- height: L({ title: "web_blocks.height", default: "" })
496
+ width: s({ title: "web_blocks.width", default: "" }),
497
+ height: s({ title: "web_blocks.height", default: "" })
415
498
  }
416
- }, He = (e) => {
417
- const { blockProps: l, image: t, styles: o, alt: a, height: r, width: n, lazyLoading: i } = e;
418
- return k(t) ? /* @__PURE__ */ s.jsx(_, { className: "h-36" }) : b.createElement("img", {
419
- ...l,
420
- ...o,
421
- src: t,
422
- alt: a,
423
- loading: i ? "lazy" : "eager",
424
- height: r,
425
- width: n
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
- }, Re = {
512
+ };
513
+ const Config$f = {
428
514
  type: "Image",
429
515
  label: "Image",
430
516
  category: "core",
431
- icon: R,
517
+ icon: ImageIcon,
432
518
  group: "media",
433
519
  props: {
434
- styles: f({ default: "" }),
435
- image: j({
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: p({ title: "Alt text", default: "", ai: !0, i18n: !0 }),
440
- width: p({ title: "Width", default: "" }),
441
- height: p({ title: "Height", default: "" }),
442
- lazyLoading: y({ title: "Lazy Load", default: !0 })
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
- }, E = /^(https?:\/\/)?(www\.)?youtube\.com\/(watch\?v=|embed\/)([a-zA-Z0-9_-]{11})/, N = /^(https?:\/\/)?(www\.)?player.vimeo\.com/, P = /^(https?:\/\/)?(www\.)?dailymotion\.com\/(video|embed\/video)\/([a-zA-Z0-9_-]+)/, ze = (e) => {
445
- if (E.test(e)) {
446
- const l = e.match(E);
447
- return l ? `https://www.youtube.com/embed/${l[4]}` : e;
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 (N.test(e)) {
450
- const l = e.match(N);
451
- return l ? `https://player.vimeo.com/video/${l[3]}` : e;
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 (P.test(e)) {
454
- const l = e.match(P);
455
- return l ? `https://www.dailymotion.com/embed/video/${l[4]}` : e;
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
- }, Ae = b.memo(
459
- (e) => {
460
- const { blockProps: l, inBuilder: t, styles: o, url: a, controls: r } = e, n = w(r, "autoPlay", !1), i = w(r, "controls", !1), c = n || w(r, "muted", !0), d = w(r, "loop", !1);
461
- if (k(a)) return /* @__PURE__ */ s.jsx(_, { inBuilder: t, className: "h-36" });
462
- let h = ze(a), m = null;
463
- if (h) {
464
- if (!k(h)) {
465
- const g = [];
466
- g.push(`autoplay=${n ? 1 : 0}`), g.push(`controls=${r ? 1 : 0}`), g.push(`mute=${c ? 1 : 0}&muted=${c ? 1 : 0}`), g.push(`loop=${d ? 1 : 0}`), h = `${h}?${g.join("&")}`;
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
- m = b.createElement("iframe", {
469
- ...l,
580
+ videoElement = React.createElement("iframe", {
581
+ ...blockProps,
470
582
  className: "absolute inset-0 w-full h-full",
471
- src: h,
472
- allow: t ? "" : "autoplay *; fullscreen *",
473
- allowFullScreen: !0,
583
+ src: embedURL,
584
+ allow: inBuilder ? "" : "autoplay *; fullscreen *",
585
+ allowFullScreen: true,
474
586
  frameBorder: 0
475
587
  });
476
- } else
477
- m = b.createElement("video", {
478
- ...l,
588
+ } else {
589
+ videoElement = React.createElement("video", {
590
+ ...blockProps,
479
591
  className: "absolute inset-0 w-full h-full",
480
- src: a,
481
- controls: i,
482
- muted: c,
483
- autoPlay: t ? !1 : n,
484
- loop: d
592
+ src: url,
593
+ controls: _controls,
594
+ muted,
595
+ autoPlay: inBuilder ? false : autoplay,
596
+ loop
485
597
  });
486
- return /* @__PURE__ */ s.jsx("div", { ...ne(o, ["className"]), children: /* @__PURE__ */ s.jsxs("div", { className: "relative w-full overflow-hidden", style: { paddingBottom: "56.25%" }, children: [
487
- t ? /* @__PURE__ */ s.jsx("div", { ...l, ...ie(o, ["className"]), className: "absolute inset-0 z-20 h-full w-full" }) : null,
488
- m
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
- ), qe = {
604
+ );
605
+ const Config$e = {
492
606
  type: "Video",
493
607
  label: "Video",
494
608
  category: "core",
495
- icon: Q,
609
+ icon: VideoIcon,
496
610
  group: "media",
497
611
  props: {
498
- styles: f({ default: "" }),
499
- url: p({
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: !0
616
+ i18n: true
503
617
  }),
504
- controls: F({
618
+ controls: b({
505
619
  title: "Controls",
506
620
  properties: {
507
- autoPlay: y({ title: "Autoplay", default: !0 }),
508
- controls: y({ title: "Controls", default: !1 }),
509
- loop: y({ title: "Loop", default: !1 }),
510
- muted: y({ title: "Muted", default: !0 })
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 De(e) {
516
- return V({ 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);
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 Fe = (e) => {
519
- const { scripts: l, inBuilder: t, blockProps: o } = e;
520
- return t ? /* @__PURE__ */ s.jsx("div", { ...o, children: /* @__PURE__ */ s.jsx("div", { className: C("pointer-events-none flex flex-col items-center justify-center p-2", ""), children: /* @__PURE__ */ s.jsx("div", { className: "h-full w-full rounded bg-gray-200 p-1 dark:bg-gray-800", children: /* @__PURE__ */ s.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" }) }) }) }) : /* @__PURE__ */ s.jsx("div", { dangerouslySetInnerHTML: { __html: l } });
521
- }, Ge = {
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: De,
642
+ icon: DiJavascript,
526
643
  group: "advanced",
527
644
  props: {
528
- scripts: T({
645
+ scripts: l({
529
646
  title: "Script",
530
647
  default: "",
531
648
  placeholder: "<script>console.log('Hello, world!');<\/script>"
532
649
  })
533
650
  }
534
- }, Ve = (e) => {
535
- const { blockProps: l, styles: t } = e;
536
- return b.createElement("hr", { ...t, ...l });
537
- }, Ue = {
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: ee,
660
+ icon: DividerHorizontalIcon,
542
661
  group: "basic",
543
662
  props: {
544
- styles: f({ default: "bg-gray-900 h-0.5 py-2 my-1" })
663
+ styles: T({ default: "bg-gray-900 h-0.5 py-2 my-1" })
545
664
  }
546
- }, Oe = () => null, We = {
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: te,
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
- }, Xe = (e) => {
603
- const { blockProps: l, inBuilder: t, children: o, globalBlock: a } = e;
604
- return t && !a ? /* @__PURE__ */ s.jsxs(
605
- "div",
606
- {
607
- className: "flex flex-col items-center justify-center gap-y-1 rounded-lg bg-gray-100 py-4 dark:bg-gray-800",
608
- ...l,
609
- children: [
610
- /* @__PURE__ */ s.jsxs("h1", { children: [
611
- "Global Block - ",
612
- a
613
- ] }),
614
- /* @__PURE__ */ s.jsx("p", { children: "Choose a block from the sidebar to add it to this page." })
615
- ]
616
- }
617
- ) : b.createElement("div", { ...l }, o);
618
- }, Ye = {
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: ce,
749
+ icon: GlobeIcon,
622
750
  category: "core",
623
751
  group: "advanced",
624
752
  props: {
625
- globalBlock: p({ title: "global block", default: "", hidden: !0 })
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
- }, Ze = (e) => e.inBuilder || e.forceWrapper ? /* @__PURE__ */ s.jsx("span", { "data-ai-key": "content", ...e.blockProps, children: e.content }) : `${e.content}`, Je = {
760
+ return `${props.content}`;
761
+ };
762
+ const Config$9 = {
628
763
  type: "Text",
629
764
  label: "Text",
630
- hidden: !0,
765
+ hidden: true,
631
766
  category: "core",
632
767
  group: "typography",
633
- icon: z,
768
+ icon: SpaceBetweenVerticallyIcon,
634
769
  props: {
635
- content: B({ title: "Content", default: "", ai: !0, i18n: !0 })
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
- }, Ke = (e) => {
638
- const { blockProps: l, backgroundImage: t, children: o, styles: a } = e;
639
- let r = {};
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: !0,
786
+ hidden: true,
647
787
  props: {
648
- styles: f({ default: "font-body antialiased" }),
649
- backgroundImage: j({ title: "Background Image" })
788
+ styles: T({ default: "font-body antialiased" }),
789
+ backgroundImage: x({ title: "Background Image" })
650
790
  },
651
- canAcceptBlock: () => !0,
652
- canDelete: () => !1,
653
- canMove: () => !1,
654
- canDuplicate: () => !1
655
- }, et = (e) => {
656
- const { blockProps: l, styles: t } = e;
657
- return b.createElement("br", { ...l, ...t });
658
- }, tt = {
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: !0,
664
- icon: z,
805
+ hidden: true,
806
+ icon: SpaceBetweenVerticallyIcon,
665
807
  props: {
666
- styles: f({ default: "" })
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
- }, lt = (e) => {
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
- }, m = {
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__ */ s.jsxs(
846
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs(
701
847
  "form",
702
848
  {
703
- ...h,
704
- "data-error": t,
705
- "data-success": r,
849
+ ...alpineAttrs,
850
+ "data-error": errorMessage,
851
+ "data-success": successMessage,
706
852
  method: "post",
707
- action: n,
708
- ...l,
709
- ...i,
853
+ action,
854
+ ...blockProps,
855
+ ...styles,
710
856
  children: [
711
- /* @__PURE__ */ s.jsx("div", { ...m }),
712
- /* @__PURE__ */ s.jsx("input", { name: "formname", type: "hidden", value: o || a }),
713
- d
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
- }, ot = {
863
+ };
864
+ const Config$6 = {
718
865
  type: "Form",
719
866
  label: "Form",
720
867
  category: "core",
721
- icon: le,
868
+ icon: GroupIcon,
722
869
  group: "form",
723
870
  props: {
724
- styles: f({ default: "" }),
725
- action: p({
871
+ styles: T({ default: "" }),
872
+ action: g({
726
873
  title: "Submit URL",
727
874
  default: "/api/form/submit"
728
875
  }),
729
- errorMessage: S({
876
+ errorMessage: m({
730
877
  title: "Error Message",
731
878
  default: "Something went wrong. Please try again"
732
879
  }),
733
- successMessage: S({
880
+ successMessage: m({
734
881
  title: "Success Message",
735
882
  default: "Thank you for your submission."
736
883
  })
737
884
  },
738
- canAcceptBlock: () => !0
739
- }, at = (e) => {
740
- const { blockProps: l, inBuilder: t, label: o, styles: a, inputStyles: r, icon: n, iconPos: i } = e, c = I(), d = {
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__ */ s.jsxs(
893
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs(
744
894
  "button",
745
895
  {
746
- id: c,
747
- ...d,
748
- ...r,
749
- ...a,
750
- ...l || {},
751
- type: t ? "button" : "submit",
896
+ id: fieldId,
897
+ ...attrs,
898
+ ...inputStyles,
899
+ ...styles,
900
+ ...blockProps || {},
901
+ type: inBuilder ? "button" : "submit",
752
902
  children: [
753
- o,
754
- n && /* @__PURE__ */ s.jsx("span", { className: i, dangerouslySetInnerHTML: { __html: n } })
903
+ label,
904
+ icon && /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: iconPos, dangerouslySetInnerHTML: { __html: icon } })
755
905
  ]
756
906
  }
757
907
  );
758
- }, st = {
908
+ };
909
+ const Config$5 = {
759
910
  type: "FormButton",
760
911
  label: "Submit Button",
761
912
  category: "core",
762
- icon: H,
913
+ icon: ButtonIcon,
763
914
  group: "form",
764
915
  props: {
765
- label: p({ title: "Label", default: "Submit", ai: !0, i18n: !0 }),
766
- styles: f({
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: $({ title: "Icon", default: "" }),
770
- iconPos: v({
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
- }, rt = (e) => {
930
+ };
931
+ const InputBlock = (block) => {
780
932
  const {
781
- blockProps: l,
782
- label: t,
783
- placeholder: o,
784
- styles: a,
785
- inputStyles: r,
786
- showLabel: n,
787
- required: i,
788
- inputType: c = "text",
789
- inBuilder: d,
790
- fieldName: h
791
- } = e, m = I();
792
- return !n || c === "submit" ? (c === "submit" && (l.value = t), /* @__PURE__ */ s.jsx(
793
- "input",
794
- {
795
- id: m,
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
- name: h,
811
- readOnly: d,
812
- ...r,
813
- id: m,
814
- type: c,
815
- placeholder: o,
816
- required: i
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
- }, nt = {
977
+ };
978
+ const Config$4 = {
821
979
  type: "Input",
822
980
  label: "Input",
823
981
  category: "core",
824
- icon: A,
982
+ icon: InputIcon,
825
983
  group: "form",
826
984
  props: {
827
- styles: f({ default: "" }),
828
- fieldName: p({ title: "Field Name", default: "input" }),
829
- inputType: v({
985
+ styles: T({ default: "" }),
986
+ fieldName: g({ title: "Field Name", default: "input" }),
987
+ inputType: y({
830
988
  title: "Type",
831
- options: M(
989
+ options: map(
832
990
  ["text", "email", "password", "number", "tel", "file", "hidden", "range", "submit", "color", "date", "time"],
833
- (e) => ({
834
- value: e,
835
- title: e
991
+ (type) => ({
992
+ value: type,
993
+ title: type
836
994
  })
837
995
  ),
838
996
  default: "text"
839
997
  }),
840
- value: p({ title: "Value", default: "", ai: !0, i18n: !0 }),
841
- showLabel: y({ title: "Show Label", default: !0 }),
842
- inputStyles: f({ default: "w-full p-1" }),
843
- label: p({ title: "Label", default: "Label", ai: !0, i18n: !0 }),
844
- placeholder: p({
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: y({ title: "Required", default: !1 })
1006
+ required: c({ title: "Required", default: false })
849
1007
  }
850
- }, it = (e) => {
851
- const { blockProps: l, fieldName: t, label: o, styles: a, inputStyles: r, checked: n, required: i, showLabel: c = !0 } = e, d = I();
852
- return c ? /* @__PURE__ */ s.jsxs("div", { ...a, ...l, children: [
853
- /* @__PURE__ */ s.jsx("input", { ...r, name: t, id: d, type: "radio", required: i, defaultChecked: n }),
854
- o && /* @__PURE__ */ s.jsx("label", { htmlFor: d, children: o })
855
- ] }) : /* @__PURE__ */ s.jsx(
856
- "input",
857
- {
858
- id: d,
859
- ...l,
860
- ...r,
861
- ...a,
862
- type: "radio",
863
- required: i,
864
- checked: n,
865
- name: t
866
- }
867
- );
868
- }, ct = {
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: oe,
1035
+ icon: RadiobuttonIcon,
873
1036
  group: "form",
874
1037
  props: {
875
- styles: f({ default: "flex items-center w-max gap-x-2" }),
876
- fieldName: p({ title: "web_blocks.field_name", default: "radio" }),
877
- label: p({ title: "web_blocks.label", default: "Label" }),
878
- checked: y({ title: "web_blocks.checked", default: !1 }),
879
- required: y({ title: "web_blocks.required", default: !1 })
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
- }, dt = (e) => {
1044
+ };
1045
+ const SelectBlock = (block) => {
882
1046
  const {
883
- blockProps: l,
884
- fieldName: t,
885
- label: o,
886
- placeholder: a,
887
- styles: r,
888
- inputStyles: n,
889
- required: i,
890
- showLabel: c,
891
- _multiple: d = !1
892
- } = e, h = I();
893
- return c ? /* @__PURE__ */ s.jsxs("div", { ...r, children: [
894
- c && /* @__PURE__ */ s.jsx("label", { htmlFor: h, children: o }),
895
- /* @__PURE__ */ s.jsxs("select", { ...n, id: h, required: i, multiple: d, name: t, children: [
896
- /* @__PURE__ */ s.jsx("option", { value: "", disabled: !0, selected: !0, hidden: !0, children: a }),
897
- M(e.options, (m) => /* @__PURE__ */ s.jsx(
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: w(m, "selected", !1),
901
- value: m.value,
902
- dangerouslySetInnerHTML: { __html: m.label }
1090
+ selected: get(option, "selected", false),
1091
+ value: option.value,
1092
+ dangerouslySetInnerHTML: { __html: option.label }
903
1093
  },
904
- m.value
1094
+ option.value
905
1095
  ))
906
1096
  ] })
907
- ] }) : /* @__PURE__ */ s.jsxs(
908
- "select",
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: ae,
1103
+ icon: DropdownMenuIcon,
935
1104
  group: "form",
936
1105
  props: {
937
- styles: f({ default: "" }),
938
- fieldName: p({ title: "Field Name", default: "select" }),
939
- showLabel: y({ title: "Show Label", default: !0 }),
940
- inputStyles: f({ default: "w-full p-1" }),
941
- label: p({ title: "Label", default: "Label", ai: !0, i18n: !0 }),
942
- placeholder: p({
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: y({ title: "Required", default: !1 }),
947
- _multiple: y({ title: "Multiple", default: !1 }),
948
- options: G({
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: p({ title: "Label", default: "", ai: !0, i18n: !0 }),
952
- value: p({ title: "Value", default: "" })
1120
+ label: g({ title: "Label", default: "", ai: true, i18n: true }),
1121
+ value: g({ title: "Value", default: "" })
953
1122
  }
954
1123
  })
955
1124
  }
956
- }, pt = (e) => {
957
- const { blockProps: l, fieldName: t, label: o, placeholder: a, styles: r, inputStyles: n, _rows: i, showLabel: c } = e, d = I();
958
- return c ? /* @__PURE__ */ s.jsxs("div", { ...r, ...l, children: [
959
- c && /* @__PURE__ */ s.jsx("label", { htmlFor: d, children: o }),
960
- /* @__PURE__ */ s.jsx("textarea", { name: t, ...n, id: d, placeholder: a, rows: i })
961
- ] }) : /* @__PURE__ */ s.jsx(
962
- "textarea",
963
- {
964
- id: d,
965
- name: t,
966
- ...l,
967
- ...n,
968
- ...r,
969
- placeholder: a,
970
- rows: i
971
- }
972
- );
973
- }, bt = {
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: A,
1152
+ icon: InputIcon,
978
1153
  group: "form",
979
1154
  props: {
980
- fieldName: p({ title: "Field Name", default: "textarea" }),
981
- showLabel: y({ title: "Show Label", default: !0 }),
982
- styles: f({ default: "" }),
983
- inputStyles: f({ default: "w-full p-1" }),
984
- label: p({ title: "Label", default: "Label", ai: !0, i18n: !0 }),
985
- placeholder: p({
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: L({ title: "Rows", default: 3 })
1164
+ _rows: s({ title: "Rows", default: 3 })
990
1165
  }
991
- }, ft = (e) => {
992
- const { blockProps: l, fieldName: t, label: o, styles: a, inputStyles: r, required: n, checked: i, showLabel: c = !0 } = e, d = I();
993
- return c ? /* @__PURE__ */ s.jsxs("div", { ...a, ...l, children: [
994
- /* @__PURE__ */ s.jsx(
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
- ...r,
998
- name: t,
999
- id: d,
1174
+ id: fieldId,
1175
+ ...blockProps,
1176
+ ...inputStyles,
1177
+ ...styles,
1000
1178
  type: "checkbox",
1001
- required: n,
1002
- defaultChecked: i
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
- o && o !== "Label" && /* @__PURE__ */ s.jsx("label", { htmlFor: d, children: o })
1006
- ] }) : /* @__PURE__ */ s.jsx(
1007
- "input",
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: se,
1202
+ icon: CheckboxIcon,
1023
1203
  group: "form",
1024
1204
  props: {
1025
- fieldName: p({ title: "Field Name", default: "checkbox" }),
1026
- styles: f({ default: "flex items-center gap-x-2" }),
1027
- label: p({ title: "web_blocks.label", default: "Label" }),
1028
- checked: y({ title: "web_blocks.checked", default: !1 }),
1029
- required: y({ title: "web_blocks.required", default: !1 })
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
- }, _t = () => {
1032
- u(de, ue), u(he, ye), u(pe, be), u(ge, ke), u(xe, we), u(ve, _e), u(Ie, Le), u(Be, Ce), u(je, Se), u(Me, $e), u(Ee, Ne), u(Pe, Te), u(He, Re), u(Ae, qe), u(fe, me), u(Ze, Je), u(lt, ot), u(at, st), u(rt, nt), u(ft, mt), u(it, ct), u(dt, ut), u(pt, bt), u(et, tt), u(Ke, Qe), u(Fe, Ge), u(Ve, Ue), u(Oe, We), u(Xe, Ye);
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
- _t as loadWebBlocks
1244
+ loadWebBlocks
1036
1245
  };