@chaibuilder/sdk 2.0.0-beta.10 → 2.0.0-beta.13

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.
@@ -1,350 +1,454 @@
1
- import { registerChaiBlock as u } from "@chaibuilder/runtime";
2
- import { j as s } from "./jsx-runtime-Sp0orL4X.js";
3
- import * as b from "react";
4
- import { T as m, y as v, x as C, g as p, q as N, s as B, l as T, f as L, m as S, w as D, c as y, b as F, S as G } from "./controls-lEwMTdPQ.js";
5
- import { c as j, G as V, g as I } from "./iconBase-Ief2hJUZ.js";
6
- import { ButtonIcon as H, CodeIcon as U, HeadingIcon as O, TextIcon as W, CursorTextIcon as X, Link1Icon as Y, ImageIcon as z, RowsIcon as Z, ColumnsIcon as J, SketchLogoIcon as K, VideoIcon as Q, DividerHorizontalIcon as ee, MoonIcon as te, SpaceBetweenVerticallyIcon as A, GroupIcon as le, InputIcon as R, 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";
1
+ import { registerChaiBlockSchema as p, StylesProp as c, registerChaiBlock as u } from "@chaibuilder/runtime";
2
+ import { j as r } from "./jsx-runtime-Sp0orL4X.js";
3
+ import * as y from "react";
4
+ import { c as I, G as E, g as w } from "./iconBase-Ief2hJUZ.js";
5
+ import { ButtonIcon as C, CodeIcon as T, HeadingIcon as $, TextIcon as N, CursorTextIcon as H, Link1Icon as z, ImageIcon as j, RowsIcon as R, ColumnsIcon as A, SketchLogoIcon as D, VideoIcon as q, DividerHorizontalIcon as F, MoonIcon as G, SpaceBetweenVerticallyIcon as V, InputIcon as S, RadiobuttonIcon as O, DropdownMenuIcon as U, CheckboxIcon as W, LetterCaseToggleIcon as X } from "@radix-ui/react-icons";
6
+ import { isNull as Y, isEmpty as b, get as v, pick as Z, omit as J, map as L } from "lodash-es";
7
+ import { GlobeIcon as K, GroupIcon as Q } from "lucide-react";
9
8
  import "clsx";
10
9
  import "tailwind-merge";
11
- const de = ({ className: e = "", inBuilder: l }) => l ? /* @__PURE__ */ s.jsx("div", { className: j("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, ue = (e) => {
12
- const { blockProps: l, inBuilder: t, backgroundImage: o, children: a, tag: r = "div", styles: n } = e;
13
- let i = a;
14
- a || (i = /* @__PURE__ */ s.jsx(_, { inBuilder: t }));
15
- let c = {};
16
- return o && (c = { backgroundImage: `url(${o})` }), b.createElement(r, { ...l, ...n, style: c }, i);
17
- }, pe = {
10
+ const ee = ({ className: e = "", inBuilder: o }) => o ? /* @__PURE__ */ r.jsx("div", { className: I("pointer-events-none flex h-20 flex-col items-center justify-center p-2", e), children: /* @__PURE__ */ r.jsx("div", { className: "h-full w-full rounded bg-gray-200 p-2 dark:bg-gray-800", children: /* @__PURE__ */ r.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, x = ee, te = (e) => {
11
+ const { blockProps: o, inBuilder: t, backgroundImage: n, children: l, tag: i = "div", styles: s } = e;
12
+ let a = l;
13
+ l || (a = /* @__PURE__ */ r.jsx(x, { inBuilder: t }));
14
+ let d = {};
15
+ return n && (d = { backgroundImage: `url(${n})` }), y.createElement(i, { ...o, ...s, style: d }, a);
16
+ }, oe = {
18
17
  type: "Box",
19
- label: "web_blocks.box",
18
+ label: "Box",
20
19
  category: "core",
21
20
  group: "basic",
22
- props: {
23
- styles: m({ default: "" }),
24
- tag: v({
25
- title: "web_blocks.tag",
26
- default: "div",
27
- options: [
28
- { value: "div", title: "web_blocks.div" },
29
- { value: "header", title: "web_blocks.header" },
30
- { value: "footer", title: "web_blocks.footer" },
31
- { value: "section", title: "web_blocks.section" },
32
- { value: "article", title: "web_blocks.article" },
33
- { value: "aside", title: "web_blocks.aside" },
34
- { value: "main", title: "web_blocks.main" },
35
- { value: "nav", title: "web_blocks.nav" },
36
- { value: "figure", title: "web_blocks.figure" },
37
- { value: "details", title: "web_blocks.details" },
38
- { value: "summary", title: "web_blocks.summary" },
39
- { value: "dialog", title: "web_blocks.dialog" },
40
- { value: "strike", title: "web_blocks.strike" },
41
- { value: "caption", title: "web_blocks.caption" },
42
- { value: "legend", title: "web_blocks.legend" },
43
- { value: "figcaption", title: "web_blocks.figcaption" },
44
- { value: "mark", title: "web_blocks.mark" }
45
- ]
46
- }),
47
- backgroundImage: C({ title: "web_blocks.background_image" })
48
- },
21
+ ...p({
22
+ properties: {
23
+ styles: c(""),
24
+ backgroundImage: {
25
+ type: "string",
26
+ default: "",
27
+ title: "Background Image",
28
+ ui: { "ui:widget": "image" }
29
+ },
30
+ tag: {
31
+ type: "string",
32
+ default: "div",
33
+ title: "Tag",
34
+ oneOf: [
35
+ { const: "div", title: "div" },
36
+ { const: "header", title: "header" },
37
+ { const: "footer", title: "footer" },
38
+ { const: "section", title: "section" },
39
+ { const: "article", title: "article" },
40
+ { const: "aside", title: "aside" },
41
+ { const: "main", title: "main" },
42
+ { const: "nav", title: "nav" },
43
+ { const: "figure", title: "figure" },
44
+ { const: "details", title: "details" },
45
+ { const: "summary", title: "summary" },
46
+ { const: "dialog", title: "dialog" },
47
+ { const: "strike", title: "strike" },
48
+ { const: "caption", title: "caption" },
49
+ { const: "legend", title: "legend" },
50
+ { const: "figcaption", title: "figcaption" },
51
+ { const: "mark", title: "mark" }
52
+ ]
53
+ }
54
+ }
55
+ }),
49
56
  canAcceptBlock: () => !0
50
- }, be = (e) => {
51
- 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: [
52
- /* @__PURE__ */ s.jsx("span", { "data-ai-key": "content", children: a }),
53
- c && /* @__PURE__ */ s.jsx(
57
+ }, le = (e) => {
58
+ const { blockProps: o, iconSize: t, icon: n, content: l, styles: i, children: s, iconPos: a } = e, d = n, g = s || /* @__PURE__ */ r.jsxs(r.Fragment, { children: [
59
+ /* @__PURE__ */ r.jsx("span", { "data-ai-key": "content", children: l }),
60
+ d && /* @__PURE__ */ r.jsx(
54
61
  "div",
55
62
  {
56
63
  style: { width: t + "px" },
57
- className: r + " " + (r === "order-first" ? "mr-2" : "ml-2") || "",
58
- dangerouslySetInnerHTML: { __html: c }
64
+ className: a + " " + (a === "order-first" ? "mr-2" : "ml-2") || "",
65
+ dangerouslySetInnerHTML: { __html: d }
59
66
  }
60
67
  )
61
68
  ] });
62
- return b.createElement(
69
+ return y.createElement(
63
70
  "button",
64
71
  {
65
- ...l,
66
- ...n,
72
+ ...o,
73
+ ...i,
67
74
  type: "button"
68
75
  },
69
- d
76
+ g
70
77
  );
71
- }, me = {
78
+ }, ne = {
72
79
  type: "Button",
73
- label: "web_blocks.button",
80
+ label: "Button",
74
81
  category: "core",
75
- icon: H,
82
+ icon: C,
76
83
  group: "basic",
77
- props: {
78
- content: p({ title: "web_blocks.label", default: "Button", ai: !0, i18n: !0 }),
79
- styles: m({ default: "text-white bg-primary px-4 py-2 rounded-global flex items-center" }),
80
- icon: N({ title: "web_blocks.icon", default: "" }),
81
- iconSize: B({ title: "web_blocks.icon_size", default: 24 }),
82
- iconPos: v({
83
- title: "web_blocks.icon_position",
84
- default: "order-last",
85
- options: [
86
- { title: "web_blocks.start", value: "order-first" },
87
- { title: "web_blocks.end", value: "order-last" }
88
- ]
89
- })
90
- }
91
- }, fe = (e) => {
92
- const { blockProps: l, styles: t, htmlCode: o, inBuilder: a } = e;
93
- return a ? /* @__PURE__ */ s.jsxs("div", { className: "relative", children: [
94
- a ? /* @__PURE__ */ s.jsx("div", { ...l, ...t, className: "absolute z-20 h-full w-full" }) : null,
95
- b.createElement("div", {
84
+ ...p({
85
+ properties: {
86
+ styles: c("text-primary-foreground bg-primary px-4 py-2 rounded-lg flex items-center"),
87
+ content: {
88
+ type: "string",
89
+ title: "Button label",
90
+ default: "Button"
91
+ },
92
+ icon: {
93
+ type: "string",
94
+ title: "Icon",
95
+ default: "",
96
+ ui: { "ui:widget": "icon" }
97
+ },
98
+ iconSize: {
99
+ type: "number",
100
+ title: "Icon size",
101
+ default: 24
102
+ },
103
+ iconPos: {
104
+ type: "string",
105
+ title: "Icon position",
106
+ default: "order-last",
107
+ enum: ["order-first", "order-last"]
108
+ }
109
+ }
110
+ }),
111
+ i18nProps: ["content"],
112
+ aiProps: ["content"]
113
+ }, re = (e) => {
114
+ const { blockProps: o, styles: t, htmlCode: n, inBuilder: l } = e;
115
+ return l ? /* @__PURE__ */ r.jsxs("div", { className: "relative", children: [
116
+ l ? /* @__PURE__ */ r.jsx("div", { ...o, ...t, className: "absolute z-20 h-full w-full" }) : null,
117
+ y.createElement("div", {
96
118
  ...t,
97
- dangerouslySetInnerHTML: { __html: o.replace(/<script.*?>.*?<\/script>/g, "") }
119
+ dangerouslySetInnerHTML: { __html: n.replace(/<script.*?>.*?<\/script>/g, "") }
98
120
  })
99
- ] }) : b.createElement("div", {
100
- ...l,
121
+ ] }) : y.createElement("div", {
122
+ ...o,
101
123
  ...t,
102
- dangerouslySetInnerHTML: { __html: o }
124
+ dangerouslySetInnerHTML: { __html: n }
103
125
  });
104
- }, he = {
126
+ }, ie = {
105
127
  type: "CustomHTML",
106
128
  label: "web_blocks.custom_html",
107
129
  category: "core",
108
- icon: U,
130
+ icon: T,
109
131
  group: "advanced",
110
- props: {
111
- styles: m({ default: "" }),
112
- htmlCode: T({
113
- title: "web_blocks.html_code",
114
- default: "<div><p>Enter your HTML code here...</p></div>",
115
- placeholder: "web_blocks.placeholder"
116
- })
117
- }
118
- }, ye = b.memo(
119
- (e) => {
120
- const { blockProps: l, styles: t, backgroundImage: o } = e;
121
- let a = {};
122
- return o && (a = { backgroundImage: `url(${o})` }), b.createElement("div", { ...l, ...t, style: a });
123
- }
124
- ), ge = {
132
+ ...p({
133
+ properties: {
134
+ styles: c(""),
135
+ htmlCode: {
136
+ type: "string",
137
+ default: "<div><p>Enter your HTML code here...</p></div>",
138
+ ui: { "ui:widget": "code" }
139
+ }
140
+ }
141
+ })
142
+ }, se = (e) => {
143
+ const { blockProps: o, styles: t, backgroundImage: n } = e;
144
+ let l = {};
145
+ return n && (l = { backgroundImage: `url(${n})` }), y.createElement("div", { ...o, ...t, style: l });
146
+ }, ae = {
125
147
  type: "EmptyBox",
126
- label: "web_blocks.empty_box",
148
+ label: "Empty Box",
127
149
  category: "core",
128
150
  group: "basic",
129
- props: {
130
- styles: m({ default: "" }),
131
- backgroundImage: C({ title: "Background Image" })
132
- }
133
- }, ke = (e) => {
134
- const { blockProps: l, styles: t, content: o, level: a = "h1", children: r = null } = e;
135
- return r ? b.createElement(a, { ...t, ...l }, r) : b.createElement(a, {
151
+ ...p({
152
+ properties: {
153
+ styles: c(""),
154
+ backgroundImage: {
155
+ type: "string",
156
+ title: "Background Image",
157
+ default: "",
158
+ ui: { "ui:widget": "image" }
159
+ }
160
+ }
161
+ })
162
+ }, ce = (e) => {
163
+ const { blockProps: o, styles: t, content: n, level: l = "h1", children: i = null } = e;
164
+ return i ? y.createElement(l, { ...t, ...o }, i) : y.createElement(l, {
136
165
  ...t,
137
- ...l,
138
- "data-ai-key": "content",
139
- "data-ai-type": "html",
140
- dangerouslySetInnerHTML: { __html: o }
166
+ ...o,
167
+ dangerouslySetInnerHTML: { __html: n }
141
168
  });
142
- }, xe = {
169
+ }, de = {
143
170
  type: "Heading",
144
171
  label: "web_blocks.heading",
145
172
  category: "core",
146
- icon: O,
173
+ icon: $,
147
174
  group: "typography",
148
- props: {
149
- level: v({
150
- title: "web_blocks.level",
151
- default: "h2",
152
- binding: !1,
153
- options: [
154
- { value: "h1", title: "h1" },
155
- { value: "h2", title: "h2" },
156
- { value: "h3", title: "h3" },
157
- { value: "h4", title: "h4" },
158
- { value: "h5", title: "h5" },
159
- { value: "h6", title: "h6" }
160
- ]
161
- }),
162
- styles: m({ default: "text-3xl" }),
163
- content: L({ title: "Content", default: "Heading goes here", ai: !0, i18n: !0 })
164
- },
175
+ ...p({
176
+ properties: {
177
+ level: {
178
+ type: "string",
179
+ default: "h2",
180
+ title: "Level",
181
+ enum: ["h1", "h2", "h3", "h4", "h5", "h6"]
182
+ },
183
+ styles: c("text-3xl"),
184
+ content: {
185
+ type: "string",
186
+ default: "Heading goes here",
187
+ title: "Content",
188
+ ui: { "ui:widget": "textarea" }
189
+ }
190
+ }
191
+ }),
192
+ aiProps: ["content"],
193
+ i18nProps: ["content"],
165
194
  canAcceptBlock: (e) => e === "Span" || e === "Text"
166
- }, we = (e) => {
167
- const { blockProps: l, styles: t, content: o } = e;
168
- return re(e.children) ? b.createElement("p", {
195
+ }, ue = (e) => {
196
+ const { blockProps: o, styles: t, content: n } = e;
197
+ return Y(e.children) ? y.createElement("p", {
169
198
  ...t,
170
- ...l,
171
- "data-ai-key": "content",
172
- "data-ai-type": "html",
173
- dangerouslySetInnerHTML: { __html: o }
174
- }) : b.createElement("p", { ...t, ...l }, e.children);
175
- }, ve = {
199
+ ...o,
200
+ dangerouslySetInnerHTML: { __html: n }
201
+ }) : y.createElement("p", { ...t, ...o }, e.children);
202
+ }, pe = {
176
203
  type: "Paragraph",
177
204
  label: "Paragraph",
178
205
  category: "core",
179
- icon: W,
206
+ icon: N,
180
207
  group: "typography",
181
- props: {
182
- styles: m({ default: "" }),
183
- content: L({
184
- title: "Content",
185
- default: `Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse varius enim in eros elementum tristique.
208
+ ...p({
209
+ properties: {
210
+ styles: c(""),
211
+ content: {
212
+ type: "string",
213
+ title: "Content",
214
+ default: `Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse varius enim in eros elementum tristique.
186
215
  Duis cursus, mi quis viverra ornare, eros dolor interdum nulla, ut commodo diam libero vitae erat. Aenean faucibus
187
216
  nibh et justo cursus id rutrum lorem imperdiet. Nunc ut sem vitae risus tristique posuere.`,
188
- ai: !0,
189
- i18n: !0
190
- })
191
- },
217
+ ui: { "ui:widget": "textarea", "ui:autosize": !0, "ui:rows": 5 }
218
+ }
219
+ }
220
+ }),
221
+ i18nProps: ["content"],
222
+ aiProps: ["content"],
192
223
  canAcceptBlock: (e) => e === "Span" || e === "Link" || e === "Text"
193
- }, _e = (e) => {
194
- const { blockProps: l, styles: t, content: o, children: a = null, tag: r } = e;
195
- return a ? b.createElement("span", { ...t, ...l }, a) : b.createElement(r || "span", {
224
+ }, ge = (e) => {
225
+ const { blockProps: o, styles: t, content: n, children: l = null, tag: i } = e;
226
+ return l ? y.createElement("span", { ...t, ...o }, l) : y.createElement(i || "span", {
196
227
  ...t,
197
- ...l,
198
- "data-ai-key": "content",
199
- dangerouslySetInnerHTML: { __html: o || "" }
228
+ ...o,
229
+ dangerouslySetInnerHTML: { __html: n || "" }
200
230
  });
201
- }, Ie = {
231
+ }, ye = {
202
232
  type: "Span",
203
233
  label: "Span",
204
234
  category: "core",
205
235
  group: "typography",
206
- props: {
207
- styles: m({ default: "" }),
208
- content: L({ title: "Content", default: "", ai: !0, i18n: !0 })
209
- },
210
- canAcceptBlock: () => !0
211
- }, Be = (e) => {
212
- const { blockProps: l, content: t, styles: o } = e;
213
- return /* @__PURE__ */ s.jsx("div", { className: "max-w-full", children: /* @__PURE__ */ s.jsx(
214
- "div",
215
- {
216
- "data-ai-key": "content",
217
- "data-ai-type": "richtext",
218
- ...l,
219
- ...o,
220
- dangerouslySetInnerHTML: { __html: t }
236
+ ...p({
237
+ properties: {
238
+ styles: c(""),
239
+ content: {
240
+ type: "string",
241
+ title: "Content",
242
+ default: "Lorem ipsum dolor sit amet, consectetur adipiscing elit.",
243
+ ui: { "ui:widget": "textarea", "ui:autosize": !0, "ui:rows": 3 }
244
+ }
221
245
  }
222
- ) });
223
- }, Le = {
246
+ }),
247
+ aiProps: ["content"],
248
+ i18nProps: ["content"],
249
+ canAcceptBlock: () => !0
250
+ }, me = (e) => {
251
+ const { blockProps: o, content: t, styles: n } = e;
252
+ return /* @__PURE__ */ r.jsx("div", { className: "max-w-full", children: /* @__PURE__ */ r.jsx("div", { ...o, ...n, dangerouslySetInnerHTML: { __html: t } }) });
253
+ }, he = {
224
254
  type: "RichText",
225
255
  label: "Rich Text",
226
256
  category: "core",
227
- icon: X,
257
+ icon: H,
228
258
  group: "typography",
229
- props: {
230
- styles: m({ default: "" }),
231
- content: S({
232
- title: "Content",
233
- ai: !0,
234
- i18n: !0,
235
- default: "<p>This is a rich text block. You can add text, and other content here.</p>"
236
- })
237
- }
238
- }, je = (e) => {
239
- const { blockProps: l, link: t, children: o, styles: a, inBuilder: r, content: n } = e;
240
- let i = {};
241
- 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(
259
+ ...p({
260
+ properties: {
261
+ styles: c(""),
262
+ content: {
263
+ type: "string",
264
+ title: "Content",
265
+ default: "<p>This is a rich text block. You can add text, and other content here.</p>",
266
+ ui: { "ui:widget": "richtext" }
267
+ }
268
+ }
269
+ }),
270
+ aiProps: ["content"],
271
+ i18nProps: ["content"]
272
+ }, fe = (e) => {
273
+ const { blockProps: o, link: t, children: n, styles: l, inBuilder: i, content: s } = e;
274
+ let a = {};
275
+ return !n && b(s) && (a = { minHeight: "50px", display: "flex", alignItems: "center", justifyContent: "center" }), i ? n ? /* @__PURE__ */ r.jsx("span", { ...o, style: a, ...l, children: n }) : y.createElement(
242
276
  "span",
243
277
  {
278
+ ...o,
244
279
  ...l,
245
- ...a,
246
- style: i,
247
- "data-ai-key": "content"
280
+ style: a
248
281
  },
249
- n
250
- ) : 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(
282
+ s
283
+ ) : n ? /* @__PURE__ */ r.jsx("a", { href: (t == null ? void 0 : t.href) || "#/", target: t == null ? void 0 : t.target, ...o, ...l, children: n }) : y.createElement(
251
284
  "a",
252
285
  {
286
+ ...o,
253
287
  ...l,
254
- ...a,
255
- "data-ai-key": "content",
256
288
  href: (t == null ? void 0 : t.href) || "#",
257
289
  target: (t == null ? void 0 : t.target) || "_self"
258
290
  },
259
- n
291
+ s
260
292
  );
261
- }, Ce = {
293
+ }, be = {
262
294
  type: "Link",
263
295
  label: "Link",
264
296
  category: "core",
265
- icon: Y,
297
+ icon: z,
266
298
  group: "basic",
267
- props: {
268
- styles: m({ default: "" }),
269
- content: p({ title: "Content", default: "", ai: !0, i18n: !0 }),
270
- link: D({
271
- title: "Link",
272
- default: { type: "collection", target: "_self", href: "" }
273
- })
274
- },
299
+ ...p({
300
+ properties: {
301
+ styles: c(""),
302
+ content: {
303
+ type: "string",
304
+ default: "Link goes here",
305
+ title: "Content"
306
+ },
307
+ link: {
308
+ type: "object",
309
+ title: "Link",
310
+ properties: {
311
+ type: { type: "string" },
312
+ href: { type: "string" },
313
+ target: { type: "string" }
314
+ },
315
+ default: {
316
+ type: "url",
317
+ href: "",
318
+ target: "_self"
319
+ },
320
+ ui: {
321
+ "ui:field": "link"
322
+ }
323
+ }
324
+ }
325
+ }),
326
+ aiProps: ["content"],
327
+ i18nProps: ["content"],
275
328
  canAcceptBlock: (e) => e !== "Link"
276
- }, q = (e, ...l) => ({
329
+ }, M = (e, ...o) => ({
277
330
  ...e,
278
- className: j(e.className, ...l)
279
- }), Se = (e) => {
280
- const { blockProps: l, children: t, styles: o, inBuilder: a, content: r, href: n } = e, { hrefType: i, autoplay: c, maxWidth: d, backdropColor: h, galleryName: f } = e, g = q(o, "cb-lightbox");
281
- if (!t && k(o == null ? void 0 : o.className) && k(r))
282
- return /* @__PURE__ */ s.jsx(_, { inBuilder: a });
283
- if (a)
284
- return t ? /* @__PURE__ */ s.jsx("span", { ...l, ...g, children: t }) : b.createElement("span", {
285
- ...l,
286
- ...g,
287
- dangerouslySetInnerHTML: { __html: r }
331
+ className: I(e.className, ...o)
332
+ }), ke = (e) => {
333
+ const { blockProps: o, children: t, styles: n, inBuilder: l, content: i, href: s } = e, { hrefType: a, autoplay: d, maxWidth: g, backdropColor: h, galleryName: f } = e, m = M(n, "cb-lightbox");
334
+ if (!t && b(n == null ? void 0 : n.className) && b(i))
335
+ return /* @__PURE__ */ r.jsx(x, { inBuilder: l });
336
+ if (l)
337
+ return t ? /* @__PURE__ */ r.jsx("span", { ...o, ...m, children: t }) : y.createElement("span", {
338
+ ...o,
339
+ ...m,
340
+ dangerouslySetInnerHTML: { __html: i }
288
341
  });
289
- const x = {};
290
- return x["data-vbtype"] = i, c && (x["data-autoplay"] = "true"), d && (x["data-maxwidth"] = d + "px"), h && (x["data-overlay"] = h), f && (x["data-gall"] = f), t ? /* @__PURE__ */ s.jsx("a", { ...x, href: n || "#/", ...l, ...g, children: t }) : b.createElement("a", {
291
- ...l,
292
- ...g,
293
- ...x,
294
- href: n || "#",
295
- dangerouslySetInnerHTML: { __html: r }
342
+ const k = {};
343
+ return k["data-vbtype"] = a, d && (k["data-autoplay"] = "true"), g && (k["data-maxwidth"] = g + "px"), h && (k["data-overlay"] = h), f && (k["data-gall"] = f), t ? /* @__PURE__ */ r.jsx("a", { ...k, href: s || "#/", ...o, ...m, children: t }) : y.createElement("a", {
344
+ ...o,
345
+ ...m,
346
+ ...k,
347
+ href: s || "#",
348
+ dangerouslySetInnerHTML: { __html: i }
296
349
  });
297
- }, Me = {
350
+ }, xe = {
298
351
  type: "LightBoxLink",
299
352
  label: "Lightbox Link",
300
353
  category: "core",
301
- icon: z,
354
+ icon: j,
302
355
  group: "basic",
303
- props: {
304
- styles: m({ default: "" }),
305
- content: p({ title: "Content", default: "Link text or drop blocks inside", ai: !0, i18n: !0 }),
306
- href: p({ title: "Href", default: "" }),
307
- hrefType: v({
308
- title: "Type",
309
- default: "video",
310
- options: [
311
- { value: "video", title: "Video" },
312
- { value: "iframe", title: "Iframe" },
313
- { value: "inline", title: "Inline" },
314
- { value: "ajax", title: "Ajax" }
315
- ]
316
- }),
317
- autoplay: y({ title: "Autoplay", default: !1 }),
318
- maxWidth: B({ title: "Max Width", default: "" }),
319
- backdropColor: p({ title: "Backdrop Color", default: "" }),
320
- galleryName: p({ title: "Gallery Name", default: "" })
321
- },
356
+ ...p({
357
+ properties: {
358
+ styles: c(""),
359
+ content: {
360
+ type: "string",
361
+ title: "Content",
362
+ default: "Link text or drop blocks inside"
363
+ },
364
+ href: {
365
+ type: "string",
366
+ title: "Href",
367
+ default: ""
368
+ },
369
+ hrefType: {
370
+ type: "string",
371
+ title: "Type",
372
+ default: "video",
373
+ oneOf: [
374
+ {
375
+ type: "string",
376
+ title: "Video",
377
+ enum: ["video"]
378
+ },
379
+ {
380
+ type: "string",
381
+ title: "Iframe",
382
+ enum: ["iframe"]
383
+ },
384
+ {
385
+ type: "string",
386
+ title: "Inline",
387
+ enum: ["inline"]
388
+ },
389
+ {
390
+ type: "string",
391
+ title: "Ajax",
392
+ enum: ["ajax"]
393
+ }
394
+ ]
395
+ },
396
+ autoplay: {
397
+ type: "boolean",
398
+ title: "Autoplay",
399
+ default: !1,
400
+ dependencies: {
401
+ hrefType: ["video"]
402
+ }
403
+ },
404
+ maxWidth: {
405
+ type: "number",
406
+ title: "Max Width",
407
+ default: ""
408
+ },
409
+ backdropColor: {
410
+ type: "string",
411
+ title: "Backdrop Color",
412
+ default: ""
413
+ },
414
+ galleryName: {
415
+ type: "string",
416
+ title: "Gallery Name",
417
+ default: ""
418
+ }
419
+ }
420
+ }),
421
+ i18nProps: ["content"],
422
+ aiProps: ["content"],
322
423
  canAcceptBlock: (e) => e !== "Link" && e !== "LightBoxLink"
323
- }, Ne = (e) => {
324
- const { blockProps: l, children: t, listType: o, styles: a, tag: r, inBuilder: n } = e, i = j(w(a, "className", ""), o);
325
- return !t && k(a == null ? void 0 : a.className) ? /* @__PURE__ */ s.jsx(_, { inBuilder: n }) : b.createElement(
326
- r || (o === "list-decimal" ? "ol" : "ul"),
327
- { ...l, ...a, className: i },
424
+ }, we = (e) => {
425
+ const { blockProps: o, children: t, listType: n, styles: l, tag: i, inBuilder: s } = e, a = I(v(l, "className", ""), n);
426
+ return !t && b(l == null ? void 0 : l.className) ? /* @__PURE__ */ r.jsx(x, { inBuilder: s }) : y.createElement(
427
+ i || (n === "list-decimal" ? "ol" : "ul"),
428
+ { ...o, ...l, className: a },
328
429
  t
329
430
  );
330
- }, Pe = {
431
+ }, ve = {
331
432
  type: "List",
332
433
  label: "web_blocks.list",
333
- icon: Z,
434
+ icon: R,
334
435
  category: "core",
335
436
  group: "basic",
336
- props: {
337
- styles: m({ default: "" }),
338
- listType: v({
339
- title: "web_blocks.list_type",
340
- default: "list-none",
341
- options: [
342
- { value: "list-none", title: "web_blocks.none" },
343
- { value: "list-disc", title: "web_blocks.disc" },
344
- { value: "list-decimal", title: "web_blocks.number" }
345
- ]
346
- })
347
- },
437
+ ...p({
438
+ properties: {
439
+ styles: c(""),
440
+ listType: {
441
+ type: "string",
442
+ title: "List Type",
443
+ default: "list-none",
444
+ oneOf: [
445
+ { enum: ["list-none"], title: "List None" },
446
+ { enum: ["list-disc"], title: "Disc" },
447
+ { enum: ["list-decimal"], title: "Decimal" }
448
+ ]
449
+ }
450
+ }
451
+ }),
348
452
  canAcceptBlock: (e) => e === "ListItem",
349
453
  blocks: [
350
454
  { _type: "List", _id: "a", listType: "list-none", styles: "#styles:," },
@@ -370,189 +474,286 @@ const de = ({ className: e = "", inBuilder: l }) => l ? /* @__PURE__ */ s.jsx("d
370
474
  content: "Item 3"
371
475
  }
372
476
  ]
373
- }, Ee = (e) => {
374
- const { blockProps: l, content: t, styles: o, children: a, tag: r } = e;
375
- return a ? b.createElement(r || "li", { ...o, ...l }, a) : b.createElement(r || "li", {
477
+ }, Ie = (e) => {
478
+ const { blockProps: o, content: t, styles: n, children: l, tag: i } = e;
479
+ return l ? y.createElement(i || "li", { ...n, ...o }, l) : y.createElement(i || "li", {
480
+ ...n,
376
481
  ...o,
377
- ...l,
378
- "data-ai-key": "content",
379
482
  dangerouslySetInnerHTML: { __html: t }
380
483
  });
381
- }, $e = {
484
+ }, Le = {
382
485
  type: "ListItem",
383
486
  label: "List Item",
384
- icon: J,
487
+ icon: A,
385
488
  category: "core",
386
489
  group: "basic",
387
- props: {
388
- styles: m({ default: "" }),
389
- content: L({ title: "Content", default: "List item", ai: !0, i18n: !0 })
390
- },
490
+ ...p({
491
+ properties: {
492
+ styles: c(""),
493
+ content: {
494
+ type: "string",
495
+ default: "List item",
496
+ title: "Content",
497
+ ui: {
498
+ "ui:widget": "textarea"
499
+ }
500
+ }
501
+ }
502
+ }),
503
+ i18nProps: ["content"],
504
+ aiProps: ["content"],
391
505
  canAcceptBlock: (e) => e !== "ListItem",
392
506
  canBeNested: (e) => e === "List"
393
- }, Te = (e) => {
394
- const { blockProps: l, icon: t, styles: o, width: a, inBuilder: r, height: n } = e, i = q(o, j(a ? `w-[${a}px]` : "", n ? `h-[${n}px]` : ""));
395
- if (k(t))
396
- return /* @__PURE__ */ s.jsx(_, { inBuilder: r, className: "h-8 w-14" });
397
- const c = t.replace(/<svg /g, '<svg class="w-[inherit] h-[inherit]" ');
398
- return b.createElement("span", {
399
- ...l,
400
- ...i,
401
- dangerouslySetInnerHTML: { __html: c }
507
+ }, _e = (e) => {
508
+ const { blockProps: o, icon: t, styles: n, width: l, inBuilder: i, height: s } = e, a = M(n, I(l ? `w-[${l}px]` : "", s ? `h-[${s}px]` : ""));
509
+ if (b(t))
510
+ return /* @__PURE__ */ r.jsx(x, { inBuilder: i, className: "h-8 w-14" });
511
+ const d = t.replace(/<svg /g, '<svg class="w-[inherit] h-[inherit]" ');
512
+ return y.createElement("span", {
513
+ ...o,
514
+ ...a,
515
+ dangerouslySetInnerHTML: { __html: d }
402
516
  });
403
- }, He = {
517
+ }, Be = {
404
518
  type: "Icon",
405
519
  label: "web_blocks.icon",
406
520
  category: "core",
407
- icon: K,
521
+ icon: D,
408
522
  group: "media",
409
- props: {
410
- styles: m({ default: "text-black" }),
411
- icon: N({
412
- title: "web_blocks.icon",
413
- 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>'
414
- }),
415
- width: B({ title: "web_blocks.width", default: "" }),
416
- height: B({ title: "web_blocks.height", default: "" })
417
- }
418
- }, ze = (e) => {
419
- const { blockProps: l, image: t, styles: o, alt: a, height: r, width: n, lazyLoading: i } = e;
420
- return k(t) ? /* @__PURE__ */ s.jsx(_, { className: "h-36" }) : b.createElement("img", {
421
- ...l,
523
+ ...p({
524
+ properties: {
525
+ styles: c("text-black"),
526
+ icon: {
527
+ type: "string",
528
+ title: "Icon",
529
+ 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>',
530
+ ui: { "ui:widget": "icon" }
531
+ },
532
+ width: {
533
+ type: "number",
534
+ default: 16,
535
+ title: "Width"
536
+ },
537
+ height: {
538
+ type: "number",
539
+ default: 16,
540
+ title: "Height"
541
+ }
542
+ }
543
+ })
544
+ }, Pe = (e) => {
545
+ const { blockProps: o, image: t, styles: n, alt: l, height: i, width: s, lazyLoading: a } = e;
546
+ return b(t) ? /* @__PURE__ */ r.jsx(x, { className: "h-36" }) : y.createElement("img", {
422
547
  ...o,
548
+ ...n,
423
549
  src: t,
424
- alt: a,
425
- loading: i ? "lazy" : "eager",
426
- height: r,
427
- width: n
550
+ alt: l,
551
+ loading: a ? "lazy" : "eager",
552
+ height: i,
553
+ width: s
428
554
  });
429
- }, Ae = {
555
+ }, Ce = {
430
556
  type: "Image",
431
557
  label: "Image",
432
558
  category: "core",
433
- icon: z,
559
+ icon: j,
434
560
  group: "media",
435
- props: {
436
- styles: m({ default: "" }),
437
- image: C({
438
- title: "Image",
439
- default: "https://fakeimg.pl/400x200?text=Choose&font=bebas"
440
- }),
441
- alt: p({ title: "Alt text", default: "", ai: !0, i18n: !0 }),
442
- width: p({ title: "Width", default: "" }),
443
- height: p({ title: "Height", default: "" }),
444
- lazyLoading: y({ title: "Lazy Load", default: !0 })
445
- }
446
- }, P = /^(https?:\/\/)?(www\.)?youtube\.com\/(watch\?v=|embed\/)([a-zA-Z0-9_-]{11})/, E = /^(https?:\/\/)?(www\.)?player.vimeo\.com/, $ = /^(https?:\/\/)?(www\.)?dailymotion\.com\/(video|embed\/video)\/([a-zA-Z0-9_-]+)/, Re = (e) => {
447
- if (P.test(e)) {
448
- const l = e.match(P);
449
- return l ? `https://www.youtube.com/embed/${l[4]}` : e;
561
+ ...p({
562
+ properties: {
563
+ styles: c(""),
564
+ image: {
565
+ type: "string",
566
+ title: "Image",
567
+ default: "https://fakeimg.pl/400x200?text=Choose&font=bebas",
568
+ ui: { "ui:widget": "image" }
569
+ },
570
+ alt: {
571
+ type: "string",
572
+ title: "Alt text",
573
+ default: "",
574
+ ui: { "ui:placeholder": "Enter alt text" }
575
+ },
576
+ lazyLoading: {
577
+ type: "boolean",
578
+ title: "Lazy Load",
579
+ default: !0
580
+ },
581
+ width: {
582
+ type: "number",
583
+ title: "Width",
584
+ default: "",
585
+ ui: { "ui:placeholder": "Enter width" }
586
+ },
587
+ height: {
588
+ type: "number",
589
+ title: "Height",
590
+ default: "",
591
+ ui: { "ui:placeholder": "Enter height" }
592
+ },
593
+ mobileImage: {
594
+ type: "string",
595
+ title: "Mobile Image",
596
+ default: "",
597
+ ui: { "ui:widget": "image" }
598
+ },
599
+ mobileWidth: {
600
+ type: "number",
601
+ title: "Mobile Width",
602
+ default: "",
603
+ ui: { "ui:placeholder": "Enter width" }
604
+ },
605
+ mobileHeight: {
606
+ type: "number",
607
+ title: "Mobile Height",
608
+ default: "",
609
+ ui: { "ui:placeholder": "Enter height" }
610
+ }
611
+ }
612
+ }),
613
+ aiProps: ["alt"],
614
+ i18nProps: ["alt"]
615
+ }, _ = /^(https?:\/\/)?(www\.)?youtube\.com\/(watch\?v=|embed\/)([a-zA-Z0-9_-]{11})/, B = /^(https?:\/\/)?(www\.)?player.vimeo\.com/, P = /^(https?:\/\/)?(www\.)?dailymotion\.com\/(video|embed\/video)\/([a-zA-Z0-9_-]+)/, je = (e) => {
616
+ if (_.test(e)) {
617
+ const o = e.match(_);
618
+ return o ? `https://www.youtube.com/embed/${o[4]}` : e;
450
619
  }
451
- if (E.test(e)) {
452
- const l = e.match(E);
453
- return l ? `https://player.vimeo.com/video/${l[3]}` : e;
620
+ if (B.test(e)) {
621
+ const o = e.match(B);
622
+ return o ? `https://player.vimeo.com/video/${o[3]}` : e;
454
623
  }
455
- if ($.test(e)) {
456
- const l = e.match($);
457
- return l ? `https://www.dailymotion.com/embed/video/${l[4]}` : e;
624
+ if (P.test(e)) {
625
+ const o = e.match(P);
626
+ return o ? `https://www.dailymotion.com/embed/video/${o[4]}` : e;
458
627
  }
459
628
  return null;
460
- }, qe = b.memo(
461
- (e) => {
462
- 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);
463
- if (k(a))
464
- return /* @__PURE__ */ s.jsx(_, { inBuilder: t, className: "h-36" });
465
- let h = Re(a), f = null;
466
- if (h) {
467
- if (!k(h)) {
468
- const g = [];
469
- 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("&")}`;
470
- }
471
- f = b.createElement("iframe", {
472
- ...l,
473
- className: "absolute inset-0 w-full h-full",
474
- src: h,
475
- allow: t ? "" : "autoplay *; fullscreen *",
476
- allowFullScreen: !0,
477
- frameBorder: 0
478
- });
479
- } else
480
- f = b.createElement("video", {
481
- ...l,
482
- className: "absolute inset-0 w-full h-full",
483
- src: a,
484
- controls: i,
485
- muted: c,
486
- autoPlay: t ? !1 : n,
487
- loop: d
488
- });
489
- return /* @__PURE__ */ s.jsx("div", { ...ne(o, ["className"]), children: /* @__PURE__ */ s.jsxs("div", { className: "relative w-full overflow-hidden", style: { paddingBottom: "56.25%" }, children: [
490
- t ? /* @__PURE__ */ s.jsx("div", { ...l, ...ie(o, ["className"]), className: "absolute inset-0 z-20 h-full w-full" }) : null,
491
- f
492
- ] }) });
493
- }
494
- ), De = {
629
+ }, Se = y.memo((e) => {
630
+ const { blockProps: o, inBuilder: t, styles: n, url: l, controls: i } = e, s = v(i, "autoPlay", !1), a = v(i, "controls", !1), d = s || v(i, "muted", !0), g = v(i, "loop", !1);
631
+ if (b(l))
632
+ return /* @__PURE__ */ r.jsx(x, { inBuilder: t, className: "h-36" });
633
+ let h = je(l), f = null;
634
+ if (h) {
635
+ if (!b(h)) {
636
+ const m = [];
637
+ m.push(`autoplay=${s ? 1 : 0}`), m.push(`controls=${i ? 1 : 0}`), m.push(`mute=${d ? 1 : 0}&muted=${d ? 1 : 0}`), m.push(`loop=${g ? 1 : 0}`), h = `${h}?${m.join("&")}`;
638
+ }
639
+ f = y.createElement("iframe", {
640
+ ...o,
641
+ className: "absolute inset-0 w-full h-full",
642
+ src: h,
643
+ allow: t ? "" : "autoplay *; fullscreen *",
644
+ allowFullScreen: !0,
645
+ frameBorder: 0
646
+ });
647
+ } else
648
+ f = y.createElement("video", {
649
+ ...o,
650
+ className: "absolute inset-0 w-full h-full",
651
+ src: l,
652
+ controls: a,
653
+ muted: d,
654
+ autoPlay: t ? !1 : s,
655
+ loop: g
656
+ });
657
+ return /* @__PURE__ */ r.jsx("div", { ...Z(n, ["className"]), children: /* @__PURE__ */ r.jsxs("div", { className: "relative w-full overflow-hidden", style: { paddingBottom: "56.25%" }, children: [
658
+ t ? /* @__PURE__ */ r.jsx("div", { ...o, ...J(n, ["className"]), className: "absolute inset-0 z-20 h-full w-full" }) : null,
659
+ f
660
+ ] }) });
661
+ }), Me = {
495
662
  type: "Video",
496
663
  label: "Video",
497
664
  category: "core",
498
- icon: Q,
665
+ icon: q,
499
666
  group: "media",
500
- props: {
501
- styles: m({ default: "" }),
502
- url: p({
503
- title: "Video URL",
504
- default: "https://www.youtube.com/watch?v=9xwazD5SyVg&ab_channel=MaximilianMustermann",
505
- i18n: !0
506
- }),
507
- controls: F({
508
- title: "Controls",
509
- properties: {
510
- autoPlay: y({ title: "Autoplay", default: !0 }),
511
- controls: y({ title: "Controls", default: !1 }),
512
- loop: y({ title: "Loop", default: !1 }),
513
- muted: y({ title: "Muted", default: !0 })
667
+ ...p({
668
+ properties: {
669
+ styles: c(""),
670
+ url: {
671
+ type: "string",
672
+ title: "Video URL",
673
+ default: "https://www.youtube.com/watch?v=9xwazD5SyVg&ab_channel=MaximilianMustermann"
674
+ },
675
+ controls: {
676
+ type: "object",
677
+ title: "Controls",
678
+ default: {
679
+ autoplay: !1,
680
+ controls: !0,
681
+ loop: !1,
682
+ muted: !1
683
+ },
684
+ properties: {
685
+ autoplay: {
686
+ type: "boolean",
687
+ title: "Autoplay",
688
+ default: !1
689
+ },
690
+ controls: {
691
+ type: "boolean",
692
+ title: "Show Controls",
693
+ default: !0
694
+ },
695
+ loop: {
696
+ type: "boolean",
697
+ title: "Loop Video",
698
+ default: !1
699
+ },
700
+ muted: {
701
+ type: "boolean",
702
+ title: "Muted",
703
+ default: !1
704
+ }
705
+ }
514
706
  }
515
- })
516
- }
707
+ }
708
+ }),
709
+ i18nProps: ["url"]
710
+ }, Ee = (e) => {
711
+ const { blockProps: o, styles: t } = e;
712
+ return y.createElement("hr", { ...t, ...o });
713
+ }, Te = {
714
+ type: "Divider",
715
+ label: "web_blocks.divider",
716
+ category: "core",
717
+ icon: F,
718
+ group: "basic",
719
+ ...p({
720
+ properties: {
721
+ styles: c("bg-gray-900 h-0.5 py-2 my-1")
722
+ }
723
+ })
517
724
  };
518
- function Fe(e) {
519
- 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);
725
+ function $e(e) {
726
+ return E({ 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);
520
727
  }
521
- const Ge = (e) => {
522
- const { scripts: l, inBuilder: t, blockProps: o } = e;
523
- return t ? /* @__PURE__ */ s.jsx("div", { ...o, children: /* @__PURE__ */ s.jsx("div", { className: j("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 } });
524
- }, Ve = {
728
+ const Ne = (e) => {
729
+ const { scripts: o, inBuilder: t, blockProps: n } = e;
730
+ return t ? /* @__PURE__ */ r.jsx("div", { ...n, children: /* @__PURE__ */ r.jsx("div", { className: I("pointer-events-none flex flex-col items-center justify-center p-2", ""), children: /* @__PURE__ */ r.jsx("div", { className: "h-full w-full rounded bg-gray-200 p-1 dark:bg-gray-800", children: /* @__PURE__ */ r.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__ */ r.jsx("div", { dangerouslySetInnerHTML: { __html: o } });
731
+ }, He = {
525
732
  type: "CustomScript",
526
733
  label: "web_blocks.custom_script",
527
734
  category: "core",
528
- icon: Fe,
735
+ icon: $e,
529
736
  group: "advanced",
530
- props: {
531
- scripts: T({
532
- title: "Script",
533
- default: "",
534
- placeholder: "<script>console.log('Hello, world!');<\/script>"
535
- })
536
- }
537
- }, Ue = (e) => {
538
- const { blockProps: l, styles: t } = e;
539
- return b.createElement("hr", { ...t, ...l });
540
- }, Oe = {
541
- type: "Divider",
542
- label: "web_blocks.divider",
543
- category: "core",
544
- icon: ee,
545
- group: "basic",
546
- props: {
547
- styles: m({ default: "bg-gray-900 h-0.5 py-2 my-1" })
548
- }
549
- }, We = () => null, Xe = {
737
+ ...p({
738
+ properties: {
739
+ scripts: {
740
+ type: "string",
741
+ title: "Script",
742
+ default: "",
743
+ format: "code",
744
+ placeholder: "<script>console.log('Hello, world!');<\/script>"
745
+ }
746
+ }
747
+ })
748
+ }, ze = (e) => null, Re = {
550
749
  type: "Dark Mode",
551
750
  label: "web_blocks.dark_mode",
552
751
  category: "core",
553
- icon: te,
752
+ icon: G,
554
753
  group: "advanced",
555
- props: {},
754
+ ...p({
755
+ properties: {}
756
+ }),
556
757
  blocks: () => [
557
758
  { _id: "ultqCh", _type: "Span", tag: "span", styles: "#styles:,", _name: "Dark Mode Switcher" },
558
759
  {
@@ -602,417 +803,591 @@ const Ge = (e) => {
602
803
  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>"
603
804
  }
604
805
  ]
605
- }, Ye = (e) => {
606
- const { blockProps: l, inBuilder: t, children: o, globalBlock: a } = e;
607
- return t && !a ? /* @__PURE__ */ s.jsxs(
806
+ }, Ae = (e) => {
807
+ const { blockProps: o, inBuilder: t, children: n, globalBlock: l } = e;
808
+ return t && !l ? /* @__PURE__ */ r.jsxs(
608
809
  "div",
609
810
  {
610
811
  className: "flex flex-col items-center justify-center gap-y-1 rounded-lg bg-gray-100 py-4 dark:bg-gray-800",
611
- ...l,
812
+ ...o,
612
813
  children: [
613
- /* @__PURE__ */ s.jsxs("h1", { children: [
814
+ /* @__PURE__ */ r.jsxs("h1", { children: [
614
815
  "Global Block - ",
615
- a
816
+ l
616
817
  ] }),
617
- /* @__PURE__ */ s.jsx("p", { children: "Choose a block from the sidebar to add it to this page." })
818
+ /* @__PURE__ */ r.jsx("p", { children: "Choose a block from the sidebar to add it to this page." })
618
819
  ]
619
820
  }
620
- ) : b.createElement("div", { ...l }, o);
621
- }, Ze = {
821
+ ) : y.createElement("div", { ...o }, n);
822
+ }, De = {
622
823
  type: "GlobalBlock",
623
824
  label: "Global Block",
624
- icon: ce,
825
+ icon: K,
625
826
  category: "core",
626
827
  group: "advanced",
627
- props: {
628
- globalBlock: p({ title: "global block", default: "", hidden: !0 })
629
- }
630
- }, Je = (e) => e.inBuilder || e.forceWrapper ? /* @__PURE__ */ s.jsx("span", { "data-ai-key": "content", ...e.blockProps, children: e.content }) : `${e.content}`, Ke = {
828
+ ...p({
829
+ properties: {
830
+ globalBlock: {
831
+ type: "string",
832
+ title: "Global Block",
833
+ default: "",
834
+ hidden: !0
835
+ }
836
+ }
837
+ })
838
+ }, qe = (e) => e.inBuilder || e.forceWrapper ? /* @__PURE__ */ r.jsx("span", { ...e.blockProps, children: e.content }) : `${e.content}`, Fe = {
631
839
  type: "Text",
632
840
  label: "Text",
633
841
  hidden: !0,
634
842
  category: "core",
635
843
  group: "typography",
636
- icon: A,
637
- props: {
638
- content: L({ title: "Content", default: "", ai: !0, i18n: !0 })
639
- }
640
- }, Qe = (e) => {
641
- const { blockProps: l, backgroundImage: t, children: o, styles: a } = e;
642
- let r = {};
643
- return t && (r = { backgroundImage: `url(${t})` }), b.createElement("div", { ...l, ...a, style: r }, o);
644
- }, et = {
844
+ icon: V,
845
+ ...p({
846
+ properties: {
847
+ styles: c("text-black"),
848
+ content: {
849
+ type: "string",
850
+ default: ""
851
+ }
852
+ }
853
+ }),
854
+ aiProps: ["content"],
855
+ i18nProps: ["content"]
856
+ }, Ge = (e) => {
857
+ const { blockProps: o, backgroundImage: t, children: n, styles: l, tag: i } = e;
858
+ let s = {};
859
+ return t && (s = { backgroundImage: `url(${t})` }), y.createElement(i || "div", { ...o, ...l, style: s }, n);
860
+ }, Ve = {
645
861
  type: "Body",
646
862
  label: "Body",
647
863
  category: "core",
648
864
  group: "basic",
649
865
  hidden: !0,
650
- props: {
651
- styles: m({ default: "font-body antialiased" }),
652
- backgroundImage: C({ title: "Background Image" })
653
- },
866
+ ...p({
867
+ properties: {
868
+ styles: c("font-body antialiased"),
869
+ backgroundImage: {
870
+ type: "string",
871
+ title: "Image",
872
+ default: "",
873
+ ui: { "ui:widget": "image" }
874
+ },
875
+ tag: {
876
+ type: "string",
877
+ default: "div",
878
+ title: "Tag",
879
+ oneOf: [
880
+ { const: "div", title: "div" },
881
+ { const: "header", title: "header" },
882
+ { const: "footer", title: "footer" },
883
+ { const: "section", title: "section" },
884
+ { const: "article", title: "article" },
885
+ { const: "aside", title: "aside" },
886
+ { const: "main", title: "main" },
887
+ { const: "nav", title: "nav" },
888
+ { const: "figure", title: "figure" },
889
+ { const: "details", title: "details" },
890
+ { const: "summary", title: "summary" },
891
+ { const: "dialog", title: "dialog" },
892
+ { const: "strike", title: "strike" },
893
+ { const: "caption", title: "caption" },
894
+ { const: "legend", title: "legend" },
895
+ { const: "figcaption", title: "figcaption" },
896
+ { const: "mark", title: "mark" }
897
+ ]
898
+ }
899
+ }
900
+ }),
654
901
  canAcceptBlock: () => !0,
655
902
  canDelete: () => !1,
656
903
  canMove: () => !1,
657
904
  canDuplicate: () => !1
658
- }, tt = (e) => {
659
- const { blockProps: l, styles: t } = e;
660
- return b.createElement("br", { ...l, ...t });
661
- }, lt = {
905
+ }, Oe = (e) => {
906
+ const { blockProps: o, styles: t } = e;
907
+ return y.createElement("br", { ...o, ...t });
908
+ }, Ue = {
662
909
  type: "LineBreak",
663
910
  label: "Line Break",
664
911
  category: "core",
665
912
  group: "basic",
666
913
  hidden: !0,
667
- icon: A,
668
- props: {
669
- styles: m({ default: "" })
670
- }
671
- }, ot = (e) => {
672
- const { blockProps: l, errorMessage: t, name: o, _type: a, successMessage: r, action: n, styles: i, children: c } = e;
673
- let d = c;
674
- c || (d = /* @__PURE__ */ s.jsx(_, {}));
675
- const h = {
914
+ ...p({
915
+ properties: {
916
+ styles: c("")
917
+ }
918
+ }),
919
+ canAcceptBlock: () => !0,
920
+ canDelete: () => !1,
921
+ canMove: () => !1,
922
+ canDuplicate: () => !1
923
+ }, We = (e) => {
924
+ const { children: o, blockProps: t, errorMessage: n, successMessage: l, action: i, styles: s } = e;
925
+ let a = o;
926
+ o || (a = /* @__PURE__ */ r.jsx(x, {}));
927
+ const d = {
676
928
  "x-data": "{}",
677
929
  "x-on:submit.prevent": "post"
678
- }, f = {
930
+ }, g = {
679
931
  "x-html": "",
680
932
  ":class": "{'text-red-500': formStatus === 'ERROR', 'text-green-500': formStatus === 'SUCCESS'}"
681
933
  };
682
- return /* @__PURE__ */ s.jsxs(
934
+ return /* @__PURE__ */ r.jsxs(
683
935
  "form",
684
936
  {
685
- ...h,
686
- "data-error": t,
687
- "data-success": r,
937
+ ...d,
938
+ "data-error": n,
939
+ "data-success": l,
688
940
  method: "post",
689
- action: n,
690
- ...l,
691
- ...i,
941
+ action: i,
942
+ ...t,
943
+ ...s,
692
944
  children: [
693
- /* @__PURE__ */ s.jsx("div", { ...f }),
694
- /* @__PURE__ */ s.jsx("input", { name: "formname", type: "hidden", value: o || a }),
695
- d
945
+ /* @__PURE__ */ r.jsx("div", { ...g }),
946
+ a
696
947
  ]
697
948
  }
698
949
  );
699
- }, at = {
950
+ }, Xe = {
700
951
  type: "Form",
701
952
  label: "Form",
702
953
  category: "core",
703
- icon: le,
954
+ icon: Q,
704
955
  group: "form",
705
- props: {
706
- styles: m({ default: "" }),
707
- action: p({
708
- title: "Submit URL",
709
- default: "/api/form/submit"
710
- }),
711
- errorMessage: S({
712
- title: "Error Message",
713
- default: "Something went wrong. Please try again"
714
- }),
715
- successMessage: S({
716
- title: "Success Message",
717
- default: "Thank you for your submission."
718
- })
719
- },
956
+ ...p({
957
+ properties: {
958
+ styles: c(""),
959
+ action: {
960
+ type: "string",
961
+ title: "Submit URL",
962
+ default: "/api/form/submit"
963
+ },
964
+ errorMessage: {
965
+ type: "string",
966
+ title: "Error Message",
967
+ default: "Something went wrong. Please try again",
968
+ ui: { "ui:widget": "richtext" }
969
+ },
970
+ successMessage: {
971
+ type: "string",
972
+ title: "Success Message",
973
+ default: "Thank you for your submission.",
974
+ ui: { "ui:widget": "richtext" }
975
+ }
976
+ }
977
+ }),
978
+ i18nProps: ["errorMessage", "successMessage"],
979
+ aiProps: ["errorMessage", "successMessage"],
720
980
  canAcceptBlock: () => !0
721
- }, st = (e) => {
722
- const { blockProps: l, inBuilder: t, label: o, styles: a, inputStyles: r, icon: n, iconPos: i } = e, c = I(), d = {
981
+ }, Ye = (e) => {
982
+ const { blockProps: o, inBuilder: t, label: n, styles: l, inputStyles: i, icon: s, iconSize: a, iconPos: d } = e, g = w(), h = {
723
983
  "x-bind:disabled": "formLoading"
724
984
  };
725
- return /* @__PURE__ */ s.jsxs(
985
+ return /* @__PURE__ */ r.jsxs(
726
986
  "button",
727
987
  {
728
- id: c,
729
- ...d,
730
- ...r,
731
- ...a,
732
- ...l || {},
988
+ id: g,
989
+ ...h,
990
+ ...i,
991
+ ...l,
992
+ ...o || {},
733
993
  type: t ? "button" : "submit",
734
994
  children: [
735
- o,
736
- n && /* @__PURE__ */ s.jsx("span", { className: i, dangerouslySetInnerHTML: { __html: n } })
995
+ n,
996
+ s && /* @__PURE__ */ r.jsx(
997
+ "div",
998
+ {
999
+ style: { width: a + "px" },
1000
+ className: d + " " + (d === "order-first" ? "mr-2" : "ml-2") || "",
1001
+ dangerouslySetInnerHTML: { __html: s }
1002
+ }
1003
+ )
737
1004
  ]
738
1005
  }
739
1006
  );
740
- }, rt = {
1007
+ }, Ze = {
741
1008
  type: "FormButton",
742
1009
  label: "Submit Button",
743
1010
  category: "core",
744
- icon: H,
1011
+ icon: C,
745
1012
  group: "form",
746
- props: {
747
- label: p({ title: "Label", default: "Submit", ai: !0, i18n: !0 }),
748
- styles: m({
749
- default: "text-white bg-primary disabled:bg-gray-400 px-4 py-2 rounded-global flex items-center gap-x-2"
750
- }),
751
- icon: N({ title: "Icon", default: "" }),
752
- iconPos: v({
753
- title: "Icon Position",
754
- default: "order-last",
755
- options: [
756
- { title: "Start", value: "order-first" },
757
- { title: "End", value: "order-last" }
758
- ]
759
- })
760
- }
761
- }, nt = (e) => {
762
- const {
763
- blockProps: l,
764
- label: t,
765
- placeholder: o,
766
- styles: a,
767
- inputStyles: r,
768
- showLabel: n,
769
- required: i,
770
- inputType: c = "text",
771
- inBuilder: d,
772
- fieldName: h
773
- } = e, f = I();
774
- return !n || c === "submit" ? (c === "submit" && (l.value = t), /* @__PURE__ */ s.jsx(
775
- "input",
776
- {
777
- id: f,
778
- name: h,
779
- readOnly: d,
780
- ...l,
781
- ...r,
782
- ...a,
783
- type: c,
784
- placeholder: o,
785
- required: i
786
- }
787
- )) : /* @__PURE__ */ s.jsxs("div", { ...a, ...l, children: [
788
- n && /* @__PURE__ */ s.jsx("label", { htmlFor: f, children: t }),
789
- /* @__PURE__ */ s.jsx(
1013
+ ...p({
1014
+ properties: {
1015
+ styles: c(
1016
+ "text-white bg-primary disabled:bg-gray-400 px-4 py-2 rounded-global flex items-center gap-x-2"
1017
+ ),
1018
+ inputStyles: c(""),
1019
+ label: {
1020
+ type: "string",
1021
+ title: "Label",
1022
+ default: "Submit",
1023
+ ai: !0,
1024
+ i18n: !0
1025
+ },
1026
+ icon: {
1027
+ type: "string",
1028
+ title: "Icon",
1029
+ default: "",
1030
+ ui: { "ui:widget": "icon" }
1031
+ },
1032
+ iconSize: {
1033
+ type: "number",
1034
+ title: "Icon size",
1035
+ default: 24
1036
+ },
1037
+ iconPos: {
1038
+ type: "string",
1039
+ title: "Icon Position",
1040
+ default: "order-last",
1041
+ enum: ["order-first", "order-last"]
1042
+ }
1043
+ }
1044
+ }),
1045
+ i18nProps: ["label"],
1046
+ aiProps: ["label"]
1047
+ }, Je = (e) => {
1048
+ const { blockProps: o, fieldName: t, label: n, placeholder: l, styles: i, inputStyles: s, showLabel: a, required: d, inputType: g } = e, h = w();
1049
+ return a ? /* @__PURE__ */ r.jsxs("div", { ...i, ...o, children: [
1050
+ a && /* @__PURE__ */ r.jsx("label", { htmlFor: h, children: n }),
1051
+ /* @__PURE__ */ r.jsx(
790
1052
  "input",
791
1053
  {
792
- name: h,
793
- readOnly: d,
794
- ...r,
795
- id: f,
796
- type: c,
797
- placeholder: o,
798
- required: i
1054
+ name: t,
1055
+ ...s,
1056
+ id: h,
1057
+ type: g,
1058
+ placeholder: l,
1059
+ required: d
799
1060
  }
800
1061
  )
801
- ] });
802
- }, it = {
1062
+ ] }) : /* @__PURE__ */ r.jsx(
1063
+ "input",
1064
+ {
1065
+ id: h,
1066
+ name: t,
1067
+ ...o,
1068
+ ...s,
1069
+ ...i,
1070
+ type: g,
1071
+ placeholder: l,
1072
+ required: d
1073
+ }
1074
+ );
1075
+ }, Ke = {
803
1076
  type: "Input",
804
- label: "Input",
1077
+ label: "web_blocks.input",
805
1078
  category: "core",
806
- icon: R,
1079
+ icon: S,
807
1080
  group: "form",
808
- props: {
809
- styles: m({ default: "" }),
810
- fieldName: p({ title: "Field Name", default: "input" }),
811
- inputType: v({
812
- title: "Type",
813
- options: M(
814
- ["text", "email", "password", "number", "tel", "file", "hidden", "range", "submit", "color", "date", "time"],
815
- (e) => ({
816
- value: e,
817
- title: e
818
- })
819
- ),
820
- default: "text"
821
- }),
822
- value: p({ title: "Value", default: "", ai: !0, i18n: !0 }),
823
- showLabel: y({ title: "Show Label", default: !0 }),
824
- inputStyles: m({ default: "w-full p-1" }),
825
- label: p({ title: "Label", default: "Label", ai: !0, i18n: !0 }),
826
- placeholder: p({
827
- title: "Placeholder",
828
- default: "Placeholder"
829
- }),
830
- required: y({ title: "Required", default: !1 })
831
- }
832
- }, ct = (e) => {
833
- const { blockProps: l, fieldName: t, label: o, styles: a, inputStyles: r, checked: n, required: i, showLabel: c = !0 } = e, d = I();
834
- return c ? /* @__PURE__ */ s.jsxs("div", { ...a, ...l, children: [
835
- /* @__PURE__ */ s.jsx("input", { ...r, name: t, id: d, type: "radio", required: i, defaultChecked: n }),
836
- o && /* @__PURE__ */ s.jsx("label", { htmlFor: d, children: o })
837
- ] }) : /* @__PURE__ */ s.jsx(
1081
+ ...p({
1082
+ properties: {
1083
+ styles: c(""),
1084
+ inputStyles: c("w-full p-1"),
1085
+ showLabel: {
1086
+ type: "boolean",
1087
+ title: "Show Label",
1088
+ default: !0
1089
+ },
1090
+ label: {
1091
+ type: "string",
1092
+ title: "Label",
1093
+ default: "Label",
1094
+ ai: !0,
1095
+ i18n: !0
1096
+ },
1097
+ placeholder: {
1098
+ type: "string",
1099
+ title: "Placeholder",
1100
+ default: "Placeholder"
1101
+ },
1102
+ required: {
1103
+ type: "boolean",
1104
+ title: "Required",
1105
+ default: !1
1106
+ },
1107
+ inputType: {
1108
+ type: "string",
1109
+ title: "Input Type",
1110
+ default: "text",
1111
+ enum: [
1112
+ "text",
1113
+ "email",
1114
+ "password",
1115
+ "number",
1116
+ "tel",
1117
+ "file",
1118
+ "hidden",
1119
+ "range",
1120
+ "submit",
1121
+ "color",
1122
+ "date",
1123
+ "time"
1124
+ ]
1125
+ }
1126
+ }
1127
+ }),
1128
+ aiProps: ["label", "placeholder"],
1129
+ i18nProps: ["label", "placeholder"]
1130
+ }, Qe = (e) => {
1131
+ const { blockProps: o, fieldName: t, label: n, styles: l, inputStyles: i, required: s, checked: a, showLabel: d = !0 } = e, g = w();
1132
+ return d ? /* @__PURE__ */ r.jsxs("div", { ...l, ...o, children: [
1133
+ /* @__PURE__ */ r.jsx("input", { ...i, name: t, id: g, type: "radio", required: s, defaultChecked: a }),
1134
+ n && /* @__PURE__ */ r.jsx("label", { htmlFor: g, children: n })
1135
+ ] }) : /* @__PURE__ */ r.jsx(
838
1136
  "input",
839
1137
  {
840
- id: d,
1138
+ id: g,
1139
+ ...o,
1140
+ ...i,
841
1141
  ...l,
842
- ...r,
843
- ...a,
844
1142
  type: "radio",
845
- required: i,
846
- checked: n,
1143
+ required: s,
1144
+ checked: a,
847
1145
  name: t
848
1146
  }
849
1147
  );
850
- }, dt = {
1148
+ }, et = {
851
1149
  type: "Radio",
852
1150
  label: "web_blocks.radio",
853
1151
  category: "core",
854
- icon: oe,
1152
+ icon: O,
855
1153
  group: "form",
856
- props: {
857
- styles: m({ default: "flex items-center w-max gap-x-2" }),
858
- fieldName: p({ title: "web_blocks.field_name", default: "radio" }),
859
- label: p({ title: "web_blocks.label", default: "Label" }),
860
- checked: y({ title: "web_blocks.checked", default: !1 }),
861
- required: y({ title: "web_blocks.required", default: !1 })
862
- }
863
- }, ut = (e) => {
864
- const {
865
- blockProps: l,
866
- fieldName: t,
867
- label: o,
868
- placeholder: a,
869
- styles: r,
870
- inputStyles: n,
871
- required: i,
872
- showLabel: c,
873
- _multiple: d = !1
874
- } = e, h = I();
875
- return c ? /* @__PURE__ */ s.jsxs("div", { ...r, children: [
876
- c && /* @__PURE__ */ s.jsx("label", { htmlFor: h, children: o }),
877
- /* @__PURE__ */ s.jsxs("select", { ...n, id: h, required: i, multiple: d, name: t, children: [
878
- /* @__PURE__ */ s.jsx("option", { value: "", disabled: !0, selected: !0, hidden: !0, children: a }),
879
- M(e.options, (f) => /* @__PURE__ */ s.jsx(
880
- "option",
881
- {
882
- selected: w(f, "selected", !1),
883
- value: f.value,
884
- dangerouslySetInnerHTML: { __html: f.label }
885
- },
886
- f.value
887
- ))
888
- ] })
889
- ] }) : /* @__PURE__ */ s.jsxs(
890
- "select",
891
- {
892
- id: h,
893
- ...r,
894
- ...l,
895
- required: i,
896
- multiple: d,
897
- name: t,
898
- children: [
899
- /* @__PURE__ */ s.jsx("option", { value: "", disabled: !0, selected: !0, hidden: !0, children: a }),
900
- M(e.options, (f) => /* @__PURE__ */ s.jsx(
901
- "option",
902
- {
903
- selected: w(f, "selected", !1),
904
- value: f.value,
905
- dangerouslySetInnerHTML: { __html: f.label }
906
- },
907
- f.value
908
- ))
909
- ]
1154
+ ...p({
1155
+ properties: {
1156
+ styles: c("flex items-center gap-x-2"),
1157
+ inputStyles: c(""),
1158
+ label: {
1159
+ type: "string",
1160
+ title: "Label",
1161
+ default: "Label"
1162
+ },
1163
+ checked: {
1164
+ type: "boolean",
1165
+ title: "Checked",
1166
+ default: !1
1167
+ },
1168
+ required: {
1169
+ type: "boolean",
1170
+ title: "Required",
1171
+ default: !1
1172
+ },
1173
+ showLabel: {
1174
+ type: "boolean",
1175
+ title: "Show Label",
1176
+ default: !0
1177
+ }
910
1178
  }
911
- );
912
- }, pt = {
1179
+ }),
1180
+ aiProps: ["label"],
1181
+ i18nProps: ["label"]
1182
+ }, tt = (e) => {
1183
+ const { blockProps: o, fieldName: t, label: n, placeholder: l, styles: i, inputStyles: s, required: a, showLabel: d, _multiple: g, options: h } = e, f = w();
1184
+ return d ? /* @__PURE__ */ r.jsxs("div", { ...i, ...o, children: [
1185
+ d && /* @__PURE__ */ r.jsx("label", { htmlFor: f, children: n }),
1186
+ /* @__PURE__ */ r.jsxs("select", { ...s, id: f, required: a, multiple: g, name: t, children: [
1187
+ /* @__PURE__ */ r.jsx("option", { value: "", disabled: !0, selected: !0, hidden: !0, children: l }),
1188
+ L(h, (m) => /* @__PURE__ */ r.jsx("option", { value: m.value, dangerouslySetInnerHTML: { __html: m.label } }, m.value))
1189
+ ] })
1190
+ ] }) : /* @__PURE__ */ r.jsxs("select", { id: f, ...i, ...o, required: a, multiple: g, name: t, children: [
1191
+ /* @__PURE__ */ r.jsx("option", { value: "", disabled: !0, selected: !0, hidden: !0, children: l }),
1192
+ L(h, (m) => /* @__PURE__ */ r.jsx("option", { value: m.value, dangerouslySetInnerHTML: { __html: m.label } }, m.value))
1193
+ ] });
1194
+ }, ot = {
913
1195
  type: "Select",
914
1196
  label: "web_blocks.select",
915
1197
  category: "core",
916
- icon: ae,
1198
+ icon: U,
917
1199
  group: "form",
918
- props: {
919
- styles: m({ default: "" }),
920
- fieldName: p({ title: "Field Name", default: "select" }),
921
- showLabel: y({ title: "Show Label", default: !0 }),
922
- inputStyles: m({ default: "w-full p-1" }),
923
- label: p({ title: "Label", default: "Label", ai: !0, i18n: !0 }),
924
- placeholder: p({
925
- title: "Placeholder",
926
- default: "Placeholder"
927
- }),
928
- required: y({ title: "Required", default: !1 }),
929
- _multiple: y({ title: "Multiple", default: !1 }),
930
- options: G({
931
- title: "Options",
932
- itemProperties: {
933
- label: p({ title: "Label", default: "", ai: !0, i18n: !0 }),
934
- value: p({ title: "Value", default: "" })
1200
+ ...p({
1201
+ properties: {
1202
+ styles: c(""),
1203
+ inputStyles: c("w-full p-1"),
1204
+ showLabel: {
1205
+ type: "boolean",
1206
+ title: "Show Label",
1207
+ default: !0
1208
+ },
1209
+ label: {
1210
+ type: "string",
1211
+ title: "Label",
1212
+ default: "Label"
1213
+ },
1214
+ placeholder: {
1215
+ type: "string",
1216
+ title: "Placeholder",
1217
+ default: "Placeholder"
1218
+ },
1219
+ required: {
1220
+ type: "boolean",
1221
+ title: "Required",
1222
+ default: !1
1223
+ },
1224
+ _multiple: {
1225
+ type: "boolean",
1226
+ title: "Multiple",
1227
+ default: !1
1228
+ },
1229
+ options: {
1230
+ title: "Options",
1231
+ type: "array",
1232
+ default: [],
1233
+ items: {
1234
+ type: "object",
1235
+ properties: {
1236
+ label: {
1237
+ type: "string",
1238
+ title: "Label",
1239
+ default: ""
1240
+ },
1241
+ value: {
1242
+ type: "string",
1243
+ title: "Value",
1244
+ default: ""
1245
+ }
1246
+ }
1247
+ }
935
1248
  }
936
- })
937
- }
938
- }, bt = (e) => {
939
- const { blockProps: l, fieldName: t, label: o, placeholder: a, styles: r, inputStyles: n, _rows: i, showLabel: c } = e, d = I();
940
- return c ? /* @__PURE__ */ s.jsxs("div", { ...r, ...l, children: [
941
- c && /* @__PURE__ */ s.jsx("label", { htmlFor: d, children: o }),
942
- /* @__PURE__ */ s.jsx("textarea", { name: t, ...n, id: d, placeholder: a, rows: i })
943
- ] }) : /* @__PURE__ */ s.jsx(
1249
+ }
1250
+ }),
1251
+ aiProps: ["label", "placeholder"],
1252
+ i18nProps: ["label", "placeholder"]
1253
+ }, lt = (e) => {
1254
+ const { blockProps: o, fieldName: t, label: n, placeholder: l, styles: i, inputStyles: s, _rows: a, showLabel: d } = e, g = w();
1255
+ return d ? /* @__PURE__ */ r.jsxs("div", { ...i, ...o, children: [
1256
+ d && /* @__PURE__ */ r.jsx("label", { htmlFor: g, children: n }),
1257
+ /* @__PURE__ */ r.jsx("textarea", { name: t, ...s, id: g, placeholder: l, rows: a })
1258
+ ] }) : /* @__PURE__ */ r.jsx(
944
1259
  "textarea",
945
1260
  {
946
- id: d,
1261
+ id: g,
947
1262
  name: t,
948
- ...l,
949
- ...n,
950
- ...r,
951
- placeholder: a,
952
- rows: i
1263
+ ...o,
1264
+ ...s,
1265
+ ...i,
1266
+ placeholder: l,
1267
+ rows: a
953
1268
  }
954
1269
  );
955
- }, mt = {
1270
+ }, nt = {
956
1271
  type: "TextArea",
957
1272
  label: "web_blocks.textarea",
958
1273
  category: "core",
959
- icon: R,
1274
+ icon: S,
960
1275
  group: "form",
961
- props: {
962
- fieldName: p({ title: "Field Name", default: "textarea" }),
963
- showLabel: y({ title: "Show Label", default: !0 }),
964
- styles: m({ default: "" }),
965
- inputStyles: m({ default: "w-full p-1" }),
966
- label: p({ title: "Label", default: "Label", ai: !0, i18n: !0 }),
967
- placeholder: p({
968
- title: "Placeholder",
969
- default: "Placeholder"
970
- }),
971
- _rows: B({ title: "Rows", default: 3 })
972
- }
973
- }, ft = (e) => {
974
- const { blockProps: l, fieldName: t, label: o, styles: a, inputStyles: r, required: n, checked: i, showLabel: c = !0 } = e, d = I();
975
- return c ? /* @__PURE__ */ s.jsxs("div", { ...a, ...l, children: [
976
- /* @__PURE__ */ s.jsx(
1276
+ ...p({
1277
+ properties: {
1278
+ styles: c(""),
1279
+ inputStyles: c("w-full p-1"),
1280
+ showLabel: {
1281
+ type: "boolean",
1282
+ title: "Show Label",
1283
+ default: !0
1284
+ },
1285
+ label: {
1286
+ type: "string",
1287
+ title: "Label",
1288
+ default: "Label",
1289
+ ui: { "ui:widget": "textarea", "ui:autosize": !0, "ui:rows": 3 }
1290
+ },
1291
+ placeholder: {
1292
+ type: "string",
1293
+ title: "Placeholder",
1294
+ default: "Placeholder"
1295
+ },
1296
+ _rows: {
1297
+ type: "number",
1298
+ title: "Rows",
1299
+ default: 3
1300
+ }
1301
+ }
1302
+ }),
1303
+ aiProps: ["label", "placeholder"],
1304
+ i18nProps: ["label", "placeholder"]
1305
+ }, rt = (e) => {
1306
+ const { blockProps: o, fieldName: t, label: n, styles: l, inputStyles: i, required: s, checked: a, showLabel: d = !0 } = e, g = w();
1307
+ return d ? /* @__PURE__ */ r.jsxs("div", { ...l, ...o, children: [
1308
+ /* @__PURE__ */ r.jsx(
977
1309
  "input",
978
1310
  {
979
- ...r,
1311
+ ...i,
980
1312
  name: t,
981
- id: d,
1313
+ id: g,
982
1314
  type: "checkbox",
983
- required: n,
984
- defaultChecked: i
1315
+ required: s,
1316
+ defaultChecked: a
985
1317
  }
986
1318
  ),
987
- o && o !== "Label" && /* @__PURE__ */ s.jsx("label", { htmlFor: d, children: o })
988
- ] }) : /* @__PURE__ */ s.jsx(
1319
+ n && /* @__PURE__ */ r.jsx("label", { htmlFor: g, children: n })
1320
+ ] }) : /* @__PURE__ */ r.jsx(
989
1321
  "input",
990
1322
  {
991
- id: d,
1323
+ id: g,
1324
+ ...o,
1325
+ ...i,
992
1326
  ...l,
993
- ...r,
994
- ...a,
995
1327
  type: "checkbox",
996
- required: n,
1328
+ required: s,
997
1329
  name: t
998
1330
  }
999
1331
  );
1000
- }, ht = {
1332
+ }, it = {
1001
1333
  type: "Checkbox",
1002
1334
  label: "web_blocks.checkbox",
1003
1335
  category: "core",
1004
- icon: se,
1336
+ icon: W,
1005
1337
  group: "form",
1006
- props: {
1007
- fieldName: p({ title: "Field Name", default: "checkbox" }),
1008
- styles: m({ default: "flex items-center gap-x-2" }),
1009
- label: p({ title: "web_blocks.label", default: "Label" }),
1010
- checked: y({ title: "web_blocks.checked", default: !1 }),
1011
- required: y({ title: "web_blocks.required", default: !1 })
1012
- }
1013
- }, Lt = () => {
1014
- u(ue, pe), u(ye, ge), u(be, me), u(ke, xe), u(we, ve), u(_e, Ie), u(Be, Le), u(je, Ce), u(Se, Me), u(Ne, Pe), u(Ee, $e), u(Te, He), u(ze, Ae), u(qe, De), u(fe, he), u(Je, Ke), u(ot, at), u(st, rt), u(nt, it), u(ft, ht), u(ct, dt), u(ut, pt), u(bt, mt), u(tt, lt), u(Qe, et), u(Ge, Ve), u(Ue, Oe), u(We, Xe), u(Ye, Ze);
1338
+ ...p({
1339
+ properties: {
1340
+ styles: c("flex items-center gap-x-2"),
1341
+ inputStyles: c(""),
1342
+ label: {
1343
+ type: "string",
1344
+ title: "Label",
1345
+ default: "Label"
1346
+ },
1347
+ checked: {
1348
+ type: "boolean",
1349
+ title: "Checked",
1350
+ default: !1
1351
+ },
1352
+ required: {
1353
+ type: "boolean",
1354
+ title: "Required",
1355
+ default: !1
1356
+ },
1357
+ showLabel: {
1358
+ type: "boolean",
1359
+ title: "Show Label",
1360
+ default: !0
1361
+ }
1362
+ }
1363
+ }),
1364
+ aiProps: ["label"],
1365
+ i18nProps: ["label"]
1366
+ }, st = (e) => {
1367
+ const { blockProps: o, content: t, styles: n, children: l } = e, i = { ...n, ...o };
1368
+ return l ? y.createElement("label", i, l) : y.createElement("label", {
1369
+ ...i,
1370
+ dangerouslySetInnerHTML: { __html: t }
1371
+ });
1372
+ }, at = {
1373
+ type: "Label",
1374
+ label: "Label",
1375
+ category: "core",
1376
+ icon: X,
1377
+ group: "form",
1378
+ ...p({
1379
+ properties: {
1380
+ styles: c(),
1381
+ content: {
1382
+ type: "string",
1383
+ title: "Content",
1384
+ default: ""
1385
+ }
1386
+ }
1387
+ })
1388
+ }, ft = () => {
1389
+ u(te, oe), u(se, ae), u(le, ne), u(ce, de), u(ue, pe), u(ge, ye), u(me, he), u(fe, be), u(ke, xe), u(we, ve), u(Ie, Le), u(_e, Be), u(Pe, Ce), u(Se, Me), u(re, ie), u(Ne, He), u(qe, Fe), u(We, Xe), u(Ye, Ze), u(Je, Ke), u(rt, it), u(Qe, et), u(tt, ot), u(lt, nt), u(st, at), u(Oe, Ue), u(Ge, Ve), u(Ee, Te), u(ze, Re), u(Ae, De);
1015
1390
  };
1016
1391
  export {
1017
- Lt as loadWebBlocks
1392
+ ft as loadWebBlocks
1018
1393
  };