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

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 L, 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 I } 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: L("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: s = "div", styles: i } = 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(s, { ...o, ...i, 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: s, children: i, iconPos: a } = e, d = n, g = i || /* @__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
+ ...s,
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
+ }, se = {
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
+ }, ie = (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: s = null } = e;
164
+ return s ? y.createElement(l, { ...t, ...o }, s) : 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: s } = e;
226
+ return l ? y.createElement("span", { ...t, ...o }, l) : y.createElement(s || "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: s, content: i } = e;
274
+ let a = {};
275
+ return !n && b(i) && (a = { minHeight: "50px", display: "flex", alignItems: "center", justifyContent: "center" }), s ? 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
+ i
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
+ i
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: L(e.className, ...o)
332
+ }), ke = (e) => {
333
+ const { blockProps: o, children: t, styles: n, inBuilder: l, content: s, href: i } = 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(s))
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: s }
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: i || "#/", ...o, ...m, children: t }) : y.createElement("a", {
344
+ ...o,
345
+ ...m,
346
+ ...k,
347
+ href: i || "#",
348
+ dangerouslySetInnerHTML: { __html: s }
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: s, inBuilder: i } = e, a = L(v(l, "className", ""), n);
426
+ return !t && b(l == null ? void 0 : l.className) ? /* @__PURE__ */ r.jsx(x, { inBuilder: i }) : y.createElement(
427
+ s || (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,276 @@ 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
+ }, Le = (e) => {
478
+ const { blockProps: o, content: t, styles: n, children: l, tag: s } = e;
479
+ return l ? y.createElement(s || "li", { ...n, ...o }, l) : y.createElement(s || "li", {
480
+ ...n,
376
481
  ...o,
377
- ...l,
378
- "data-ai-key": "content",
379
482
  dangerouslySetInnerHTML: { __html: t }
380
483
  });
381
- }, $e = {
484
+ }, Ie = {
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: s, height: i } = e, a = M(n, L(l ? `w-[${l}px]` : "", i ? `h-[${i}px]` : ""));
509
+ if (b(t))
510
+ return /* @__PURE__ */ r.jsx(x, { inBuilder: s, 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: s, width: i, 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: s,
553
+ width: i
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: {
569
+ "ui:widget": "image"
570
+ }
571
+ },
572
+ alt: {
573
+ type: "string",
574
+ title: "Alt text",
575
+ default: "",
576
+ ui: {
577
+ "ui:placeholder": "Enter Here"
578
+ }
579
+ },
580
+ height: {
581
+ type: "number",
582
+ title: "Height",
583
+ default: "",
584
+ ui: {
585
+ "ui:placeholder": "Enter Here"
586
+ }
587
+ },
588
+ width: {
589
+ type: "number",
590
+ title: "Width",
591
+ default: "",
592
+ ui: {
593
+ "ui:placeholder": "Enter Here"
594
+ }
595
+ },
596
+ lazyLoading: {
597
+ type: "boolean",
598
+ title: "Lazy Load",
599
+ default: !0
600
+ }
601
+ }
602
+ }),
603
+ aiProps: ["alt"],
604
+ i18nProps: ["alt"]
605
+ }, _ = /^(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) => {
606
+ if (_.test(e)) {
607
+ const o = e.match(_);
608
+ return o ? `https://www.youtube.com/embed/${o[4]}` : e;
450
609
  }
451
- if (E.test(e)) {
452
- const l = e.match(E);
453
- return l ? `https://player.vimeo.com/video/${l[3]}` : e;
610
+ if (B.test(e)) {
611
+ const o = e.match(B);
612
+ return o ? `https://player.vimeo.com/video/${o[3]}` : e;
454
613
  }
455
- if ($.test(e)) {
456
- const l = e.match($);
457
- return l ? `https://www.dailymotion.com/embed/video/${l[4]}` : e;
614
+ if (P.test(e)) {
615
+ const o = e.match(P);
616
+ return o ? `https://www.dailymotion.com/embed/video/${o[4]}` : e;
458
617
  }
459
618
  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 = {
619
+ }, Se = y.memo((e) => {
620
+ const { blockProps: o, inBuilder: t, styles: n, url: l, controls: s } = e, i = v(s, "autoPlay", !1), a = v(s, "controls", !1), d = i || v(s, "muted", !0), g = v(s, "loop", !1);
621
+ if (b(l))
622
+ return /* @__PURE__ */ r.jsx(x, { inBuilder: t, className: "h-36" });
623
+ let h = je(l), f = null;
624
+ if (h) {
625
+ if (!b(h)) {
626
+ const m = [];
627
+ m.push(`autoplay=${i ? 1 : 0}`), m.push(`controls=${s ? 1 : 0}`), m.push(`mute=${d ? 1 : 0}&muted=${d ? 1 : 0}`), m.push(`loop=${g ? 1 : 0}`), h = `${h}?${m.join("&")}`;
628
+ }
629
+ f = y.createElement("iframe", {
630
+ ...o,
631
+ className: "absolute inset-0 w-full h-full",
632
+ src: h,
633
+ allow: t ? "" : "autoplay *; fullscreen *",
634
+ allowFullScreen: !0,
635
+ frameBorder: 0
636
+ });
637
+ } else
638
+ f = y.createElement("video", {
639
+ ...o,
640
+ className: "absolute inset-0 w-full h-full",
641
+ src: l,
642
+ controls: a,
643
+ muted: d,
644
+ autoPlay: t ? !1 : i,
645
+ loop: g
646
+ });
647
+ return /* @__PURE__ */ r.jsx("div", { ...Z(n, ["className"]), children: /* @__PURE__ */ r.jsxs("div", { className: "relative w-full overflow-hidden", style: { paddingBottom: "56.25%" }, children: [
648
+ t ? /* @__PURE__ */ r.jsx("div", { ...o, ...J(n, ["className"]), className: "absolute inset-0 z-20 h-full w-full" }) : null,
649
+ f
650
+ ] }) });
651
+ }), Me = {
495
652
  type: "Video",
496
653
  label: "Video",
497
654
  category: "core",
498
- icon: Q,
655
+ icon: q,
499
656
  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 })
657
+ ...p({
658
+ properties: {
659
+ styles: c(""),
660
+ url: {
661
+ type: "string",
662
+ title: "Video URL",
663
+ default: "https://www.youtube.com/watch?v=9xwazD5SyVg&ab_channel=MaximilianMustermann"
664
+ },
665
+ controls: {
666
+ type: "object",
667
+ title: "Controls",
668
+ default: {
669
+ autoplay: !1,
670
+ controls: !0,
671
+ loop: !1,
672
+ muted: !1
673
+ },
674
+ properties: {
675
+ autoplay: {
676
+ type: "boolean",
677
+ title: "Autoplay",
678
+ default: !1
679
+ },
680
+ controls: {
681
+ type: "boolean",
682
+ title: "Show Controls",
683
+ default: !0
684
+ },
685
+ loop: {
686
+ type: "boolean",
687
+ title: "Loop Video",
688
+ default: !1
689
+ },
690
+ muted: {
691
+ type: "boolean",
692
+ title: "Muted",
693
+ default: !1
694
+ }
695
+ }
514
696
  }
515
- })
516
- }
697
+ }
698
+ }),
699
+ i18nProps: ["url"]
700
+ }, Ee = (e) => {
701
+ const { blockProps: o, styles: t } = e;
702
+ return y.createElement("hr", { ...t, ...o });
703
+ }, Te = {
704
+ type: "Divider",
705
+ label: "web_blocks.divider",
706
+ category: "core",
707
+ icon: F,
708
+ group: "basic",
709
+ ...p({
710
+ properties: {
711
+ styles: c("bg-gray-900 h-0.5 py-2 my-1")
712
+ }
713
+ })
517
714
  };
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);
715
+ function $e(e) {
716
+ 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
717
  }
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 = {
718
+ const Ne = (e) => {
719
+ const { scripts: o, inBuilder: t, blockProps: n } = e;
720
+ return t ? /* @__PURE__ */ r.jsx("div", { ...n, children: /* @__PURE__ */ r.jsx("div", { className: L("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 } });
721
+ }, He = {
525
722
  type: "CustomScript",
526
723
  label: "web_blocks.custom_script",
527
724
  category: "core",
528
- icon: Fe,
725
+ icon: $e,
529
726
  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 = {
727
+ ...p({
728
+ properties: {
729
+ scripts: {
730
+ type: "string",
731
+ title: "Script",
732
+ default: "",
733
+ format: "code",
734
+ placeholder: "<script>console.log('Hello, world!');<\/script>"
735
+ }
736
+ }
737
+ })
738
+ }, ze = (e) => null, Re = {
550
739
  type: "Dark Mode",
551
740
  label: "web_blocks.dark_mode",
552
741
  category: "core",
553
- icon: te,
742
+ icon: G,
554
743
  group: "advanced",
555
- props: {},
744
+ ...p({
745
+ properties: {}
746
+ }),
556
747
  blocks: () => [
557
748
  { _id: "ultqCh", _type: "Span", tag: "span", styles: "#styles:,", _name: "Dark Mode Switcher" },
558
749
  {
@@ -602,417 +793,591 @@ const Ge = (e) => {
602
793
  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
794
  }
604
795
  ]
605
- }, Ye = (e) => {
606
- const { blockProps: l, inBuilder: t, children: o, globalBlock: a } = e;
607
- return t && !a ? /* @__PURE__ */ s.jsxs(
796
+ }, Ae = (e) => {
797
+ const { blockProps: o, inBuilder: t, children: n, globalBlock: l } = e;
798
+ return t && !l ? /* @__PURE__ */ r.jsxs(
608
799
  "div",
609
800
  {
610
801
  className: "flex flex-col items-center justify-center gap-y-1 rounded-lg bg-gray-100 py-4 dark:bg-gray-800",
611
- ...l,
802
+ ...o,
612
803
  children: [
613
- /* @__PURE__ */ s.jsxs("h1", { children: [
804
+ /* @__PURE__ */ r.jsxs("h1", { children: [
614
805
  "Global Block - ",
615
- a
806
+ l
616
807
  ] }),
617
- /* @__PURE__ */ s.jsx("p", { children: "Choose a block from the sidebar to add it to this page." })
808
+ /* @__PURE__ */ r.jsx("p", { children: "Choose a block from the sidebar to add it to this page." })
618
809
  ]
619
810
  }
620
- ) : b.createElement("div", { ...l }, o);
621
- }, Ze = {
811
+ ) : y.createElement("div", { ...o }, n);
812
+ }, De = {
622
813
  type: "GlobalBlock",
623
814
  label: "Global Block",
624
- icon: ce,
815
+ icon: K,
625
816
  category: "core",
626
817
  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 = {
818
+ ...p({
819
+ properties: {
820
+ globalBlock: {
821
+ type: "string",
822
+ title: "Global Block",
823
+ default: "",
824
+ hidden: !0
825
+ }
826
+ }
827
+ })
828
+ }, qe = (e) => e.inBuilder || e.forceWrapper ? /* @__PURE__ */ r.jsx("span", { ...e.blockProps, children: e.content }) : `${e.content}`, Fe = {
631
829
  type: "Text",
632
830
  label: "Text",
633
831
  hidden: !0,
634
832
  category: "core",
635
833
  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 = {
834
+ icon: V,
835
+ ...p({
836
+ properties: {
837
+ styles: c("text-black"),
838
+ content: {
839
+ type: "string",
840
+ default: ""
841
+ }
842
+ }
843
+ }),
844
+ aiProps: ["content"],
845
+ i18nProps: ["content"]
846
+ }, Ge = (e) => {
847
+ const { blockProps: o, backgroundImage: t, children: n, styles: l, tag: s } = e;
848
+ let i = {};
849
+ return t && (i = { backgroundImage: `url(${t})` }), y.createElement(s || "div", { ...o, ...l, style: i }, n);
850
+ }, Ve = {
645
851
  type: "Body",
646
852
  label: "Body",
647
853
  category: "core",
648
854
  group: "basic",
649
855
  hidden: !0,
650
- props: {
651
- styles: m({ default: "font-body antialiased" }),
652
- backgroundImage: C({ title: "Background Image" })
653
- },
856
+ ...p({
857
+ properties: {
858
+ styles: c("font-body antialiased"),
859
+ backgroundImage: {
860
+ type: "string",
861
+ title: "Image",
862
+ default: "",
863
+ ui: { "ui:widget": "image" }
864
+ },
865
+ tag: {
866
+ type: "string",
867
+ default: "div",
868
+ title: "Tag",
869
+ oneOf: [
870
+ { const: "div", title: "div" },
871
+ { const: "header", title: "header" },
872
+ { const: "footer", title: "footer" },
873
+ { const: "section", title: "section" },
874
+ { const: "article", title: "article" },
875
+ { const: "aside", title: "aside" },
876
+ { const: "main", title: "main" },
877
+ { const: "nav", title: "nav" },
878
+ { const: "figure", title: "figure" },
879
+ { const: "details", title: "details" },
880
+ { const: "summary", title: "summary" },
881
+ { const: "dialog", title: "dialog" },
882
+ { const: "strike", title: "strike" },
883
+ { const: "caption", title: "caption" },
884
+ { const: "legend", title: "legend" },
885
+ { const: "figcaption", title: "figcaption" },
886
+ { const: "mark", title: "mark" }
887
+ ]
888
+ }
889
+ }
890
+ }),
654
891
  canAcceptBlock: () => !0,
655
892
  canDelete: () => !1,
656
893
  canMove: () => !1,
657
894
  canDuplicate: () => !1
658
- }, tt = (e) => {
659
- const { blockProps: l, styles: t } = e;
660
- return b.createElement("br", { ...l, ...t });
661
- }, lt = {
895
+ }, Oe = (e) => {
896
+ const { blockProps: o, styles: t } = e;
897
+ return y.createElement("br", { ...o, ...t });
898
+ }, Ue = {
662
899
  type: "LineBreak",
663
900
  label: "Line Break",
664
901
  category: "core",
665
902
  group: "basic",
666
903
  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 = {
904
+ ...p({
905
+ properties: {
906
+ styles: c("")
907
+ }
908
+ }),
909
+ canAcceptBlock: () => !0,
910
+ canDelete: () => !1,
911
+ canMove: () => !1,
912
+ canDuplicate: () => !1
913
+ }, We = (e) => {
914
+ const { children: o, blockProps: t, errorMessage: n, successMessage: l, action: s, styles: i } = e;
915
+ let a = o;
916
+ o || (a = /* @__PURE__ */ r.jsx(x, {}));
917
+ const d = {
676
918
  "x-data": "{}",
677
919
  "x-on:submit.prevent": "post"
678
- }, f = {
920
+ }, g = {
679
921
  "x-html": "",
680
922
  ":class": "{'text-red-500': formStatus === 'ERROR', 'text-green-500': formStatus === 'SUCCESS'}"
681
923
  };
682
- return /* @__PURE__ */ s.jsxs(
924
+ return /* @__PURE__ */ r.jsxs(
683
925
  "form",
684
926
  {
685
- ...h,
686
- "data-error": t,
687
- "data-success": r,
927
+ ...d,
928
+ "data-error": n,
929
+ "data-success": l,
688
930
  method: "post",
689
- action: n,
690
- ...l,
931
+ action: s,
932
+ ...t,
691
933
  ...i,
692
934
  children: [
693
- /* @__PURE__ */ s.jsx("div", { ...f }),
694
- /* @__PURE__ */ s.jsx("input", { name: "formname", type: "hidden", value: o || a }),
695
- d
935
+ /* @__PURE__ */ r.jsx("div", { ...g }),
936
+ a
696
937
  ]
697
938
  }
698
939
  );
699
- }, at = {
940
+ }, Xe = {
700
941
  type: "Form",
701
942
  label: "Form",
702
943
  category: "core",
703
- icon: le,
944
+ icon: Q,
704
945
  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
- },
946
+ ...p({
947
+ properties: {
948
+ styles: c(""),
949
+ action: {
950
+ type: "string",
951
+ title: "Submit URL",
952
+ default: "/api/form/submit"
953
+ },
954
+ errorMessage: {
955
+ type: "string",
956
+ title: "Error Message",
957
+ default: "Something went wrong. Please try again",
958
+ ui: { "ui:widget": "richtext" }
959
+ },
960
+ successMessage: {
961
+ type: "string",
962
+ title: "Success Message",
963
+ default: "Thank you for your submission.",
964
+ ui: { "ui:widget": "richtext" }
965
+ }
966
+ }
967
+ }),
968
+ i18nProps: ["errorMessage", "successMessage"],
969
+ aiProps: ["errorMessage", "successMessage"],
720
970
  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 = {
971
+ }, Ye = (e) => {
972
+ const { blockProps: o, inBuilder: t, label: n, styles: l, inputStyles: s, icon: i, iconSize: a, iconPos: d } = e, g = w(), h = {
723
973
  "x-bind:disabled": "formLoading"
724
974
  };
725
- return /* @__PURE__ */ s.jsxs(
975
+ return /* @__PURE__ */ r.jsxs(
726
976
  "button",
727
977
  {
728
- id: c,
729
- ...d,
730
- ...r,
731
- ...a,
732
- ...l || {},
978
+ id: g,
979
+ ...h,
980
+ ...s,
981
+ ...l,
982
+ ...o || {},
733
983
  type: t ? "button" : "submit",
734
984
  children: [
735
- o,
736
- n && /* @__PURE__ */ s.jsx("span", { className: i, dangerouslySetInnerHTML: { __html: n } })
985
+ n,
986
+ i && /* @__PURE__ */ r.jsx(
987
+ "div",
988
+ {
989
+ style: { width: a + "px" },
990
+ className: d + " " + (d === "order-first" ? "mr-2" : "ml-2") || "",
991
+ dangerouslySetInnerHTML: { __html: i }
992
+ }
993
+ )
737
994
  ]
738
995
  }
739
996
  );
740
- }, rt = {
997
+ }, Ze = {
741
998
  type: "FormButton",
742
999
  label: "Submit Button",
743
1000
  category: "core",
744
- icon: H,
1001
+ icon: C,
745
1002
  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(
1003
+ ...p({
1004
+ properties: {
1005
+ styles: c(
1006
+ "text-white bg-primary disabled:bg-gray-400 px-4 py-2 rounded-global flex items-center gap-x-2"
1007
+ ),
1008
+ inputStyles: c(""),
1009
+ label: {
1010
+ type: "string",
1011
+ title: "Label",
1012
+ default: "Submit",
1013
+ ai: !0,
1014
+ i18n: !0
1015
+ },
1016
+ icon: {
1017
+ type: "string",
1018
+ title: "Icon",
1019
+ default: "",
1020
+ ui: { "ui:widget": "icon" }
1021
+ },
1022
+ iconSize: {
1023
+ type: "number",
1024
+ title: "Icon size",
1025
+ default: 24
1026
+ },
1027
+ iconPos: {
1028
+ type: "string",
1029
+ title: "Icon Position",
1030
+ default: "order-last",
1031
+ enum: ["order-first", "order-last"]
1032
+ }
1033
+ }
1034
+ }),
1035
+ i18nProps: ["label"],
1036
+ aiProps: ["label"]
1037
+ }, Je = (e) => {
1038
+ const { blockProps: o, fieldName: t, label: n, placeholder: l, styles: s, inputStyles: i, showLabel: a, required: d, inputType: g } = e, h = w();
1039
+ return a ? /* @__PURE__ */ r.jsxs("div", { ...s, ...o, children: [
1040
+ a && /* @__PURE__ */ r.jsx("label", { htmlFor: h, children: n }),
1041
+ /* @__PURE__ */ r.jsx(
790
1042
  "input",
791
1043
  {
792
- name: h,
793
- readOnly: d,
794
- ...r,
795
- id: f,
796
- type: c,
797
- placeholder: o,
798
- required: i
1044
+ name: t,
1045
+ ...i,
1046
+ id: h,
1047
+ type: g,
1048
+ placeholder: l,
1049
+ required: d
799
1050
  }
800
1051
  )
801
- ] });
802
- }, it = {
1052
+ ] }) : /* @__PURE__ */ r.jsx(
1053
+ "input",
1054
+ {
1055
+ id: h,
1056
+ name: t,
1057
+ ...o,
1058
+ ...i,
1059
+ ...s,
1060
+ type: g,
1061
+ placeholder: l,
1062
+ required: d
1063
+ }
1064
+ );
1065
+ }, Ke = {
803
1066
  type: "Input",
804
- label: "Input",
1067
+ label: "web_blocks.input",
805
1068
  category: "core",
806
- icon: R,
1069
+ icon: S,
807
1070
  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(
1071
+ ...p({
1072
+ properties: {
1073
+ styles: c(""),
1074
+ inputStyles: c("w-full p-1"),
1075
+ showLabel: {
1076
+ type: "boolean",
1077
+ title: "Show Label",
1078
+ default: !0
1079
+ },
1080
+ label: {
1081
+ type: "string",
1082
+ title: "Label",
1083
+ default: "Label",
1084
+ ai: !0,
1085
+ i18n: !0
1086
+ },
1087
+ placeholder: {
1088
+ type: "string",
1089
+ title: "Placeholder",
1090
+ default: "Placeholder"
1091
+ },
1092
+ required: {
1093
+ type: "boolean",
1094
+ title: "Required",
1095
+ default: !1
1096
+ },
1097
+ inputType: {
1098
+ type: "string",
1099
+ title: "Input Type",
1100
+ default: "text",
1101
+ enum: [
1102
+ "text",
1103
+ "email",
1104
+ "password",
1105
+ "number",
1106
+ "tel",
1107
+ "file",
1108
+ "hidden",
1109
+ "range",
1110
+ "submit",
1111
+ "color",
1112
+ "date",
1113
+ "time"
1114
+ ]
1115
+ }
1116
+ }
1117
+ }),
1118
+ aiProps: ["label", "placeholder"],
1119
+ i18nProps: ["label", "placeholder"]
1120
+ }, Qe = (e) => {
1121
+ const { blockProps: o, fieldName: t, label: n, styles: l, inputStyles: s, required: i, checked: a, showLabel: d = !0 } = e, g = w();
1122
+ return d ? /* @__PURE__ */ r.jsxs("div", { ...l, ...o, children: [
1123
+ /* @__PURE__ */ r.jsx("input", { ...s, name: t, id: g, type: "radio", required: i, defaultChecked: a }),
1124
+ n && /* @__PURE__ */ r.jsx("label", { htmlFor: g, children: n })
1125
+ ] }) : /* @__PURE__ */ r.jsx(
838
1126
  "input",
839
1127
  {
840
- id: d,
1128
+ id: g,
1129
+ ...o,
1130
+ ...s,
841
1131
  ...l,
842
- ...r,
843
- ...a,
844
1132
  type: "radio",
845
1133
  required: i,
846
- checked: n,
1134
+ checked: a,
847
1135
  name: t
848
1136
  }
849
1137
  );
850
- }, dt = {
1138
+ }, et = {
851
1139
  type: "Radio",
852
1140
  label: "web_blocks.radio",
853
1141
  category: "core",
854
- icon: oe,
1142
+ icon: O,
855
1143
  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
- ]
1144
+ ...p({
1145
+ properties: {
1146
+ styles: c("flex items-center gap-x-2"),
1147
+ inputStyles: c(""),
1148
+ label: {
1149
+ type: "string",
1150
+ title: "Label",
1151
+ default: "Label"
1152
+ },
1153
+ checked: {
1154
+ type: "boolean",
1155
+ title: "Checked",
1156
+ default: !1
1157
+ },
1158
+ required: {
1159
+ type: "boolean",
1160
+ title: "Required",
1161
+ default: !1
1162
+ },
1163
+ showLabel: {
1164
+ type: "boolean",
1165
+ title: "Show Label",
1166
+ default: !0
1167
+ }
910
1168
  }
911
- );
912
- }, pt = {
1169
+ }),
1170
+ aiProps: ["label"],
1171
+ i18nProps: ["label"]
1172
+ }, tt = (e) => {
1173
+ const { blockProps: o, fieldName: t, label: n, placeholder: l, styles: s, inputStyles: i, required: a, showLabel: d, _multiple: g, options: h } = e, f = w();
1174
+ return d ? /* @__PURE__ */ r.jsxs("div", { ...s, ...o, children: [
1175
+ d && /* @__PURE__ */ r.jsx("label", { htmlFor: f, children: n }),
1176
+ /* @__PURE__ */ r.jsxs("select", { ...i, id: f, required: a, multiple: g, name: t, children: [
1177
+ /* @__PURE__ */ r.jsx("option", { value: "", disabled: !0, selected: !0, hidden: !0, children: l }),
1178
+ I(h, (m) => /* @__PURE__ */ r.jsx("option", { value: m.value, dangerouslySetInnerHTML: { __html: m.label } }, m.value))
1179
+ ] })
1180
+ ] }) : /* @__PURE__ */ r.jsxs("select", { id: f, ...s, ...o, required: a, multiple: g, name: t, children: [
1181
+ /* @__PURE__ */ r.jsx("option", { value: "", disabled: !0, selected: !0, hidden: !0, children: l }),
1182
+ I(h, (m) => /* @__PURE__ */ r.jsx("option", { value: m.value, dangerouslySetInnerHTML: { __html: m.label } }, m.value))
1183
+ ] });
1184
+ }, ot = {
913
1185
  type: "Select",
914
1186
  label: "web_blocks.select",
915
1187
  category: "core",
916
- icon: ae,
1188
+ icon: U,
917
1189
  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: "" })
1190
+ ...p({
1191
+ properties: {
1192
+ styles: c(""),
1193
+ inputStyles: c("w-full p-1"),
1194
+ showLabel: {
1195
+ type: "boolean",
1196
+ title: "Show Label",
1197
+ default: !0
1198
+ },
1199
+ label: {
1200
+ type: "string",
1201
+ title: "Label",
1202
+ default: "Label"
1203
+ },
1204
+ placeholder: {
1205
+ type: "string",
1206
+ title: "Placeholder",
1207
+ default: "Placeholder"
1208
+ },
1209
+ required: {
1210
+ type: "boolean",
1211
+ title: "Required",
1212
+ default: !1
1213
+ },
1214
+ _multiple: {
1215
+ type: "boolean",
1216
+ title: "Multiple",
1217
+ default: !1
1218
+ },
1219
+ options: {
1220
+ title: "Options",
1221
+ type: "array",
1222
+ default: [],
1223
+ items: {
1224
+ type: "object",
1225
+ properties: {
1226
+ label: {
1227
+ type: "string",
1228
+ title: "Label",
1229
+ default: ""
1230
+ },
1231
+ value: {
1232
+ type: "string",
1233
+ title: "Value",
1234
+ default: ""
1235
+ }
1236
+ }
1237
+ }
935
1238
  }
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(
1239
+ }
1240
+ }),
1241
+ aiProps: ["label", "placeholder"],
1242
+ i18nProps: ["label", "placeholder"]
1243
+ }, lt = (e) => {
1244
+ const { blockProps: o, fieldName: t, label: n, placeholder: l, styles: s, inputStyles: i, _rows: a, showLabel: d } = e, g = w();
1245
+ return d ? /* @__PURE__ */ r.jsxs("div", { ...s, ...o, children: [
1246
+ d && /* @__PURE__ */ r.jsx("label", { htmlFor: g, children: n }),
1247
+ /* @__PURE__ */ r.jsx("textarea", { name: t, ...i, id: g, placeholder: l, rows: a })
1248
+ ] }) : /* @__PURE__ */ r.jsx(
944
1249
  "textarea",
945
1250
  {
946
- id: d,
1251
+ id: g,
947
1252
  name: t,
948
- ...l,
949
- ...n,
950
- ...r,
951
- placeholder: a,
952
- rows: i
1253
+ ...o,
1254
+ ...i,
1255
+ ...s,
1256
+ placeholder: l,
1257
+ rows: a
953
1258
  }
954
1259
  );
955
- }, mt = {
1260
+ }, nt = {
956
1261
  type: "TextArea",
957
1262
  label: "web_blocks.textarea",
958
1263
  category: "core",
959
- icon: R,
1264
+ icon: S,
960
1265
  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(
1266
+ ...p({
1267
+ properties: {
1268
+ styles: c(""),
1269
+ inputStyles: c("w-full p-1"),
1270
+ showLabel: {
1271
+ type: "boolean",
1272
+ title: "Show Label",
1273
+ default: !0
1274
+ },
1275
+ label: {
1276
+ type: "string",
1277
+ title: "Label",
1278
+ default: "Label",
1279
+ ui: { "ui:widget": "textarea", "ui:autosize": !0, "ui:rows": 3 }
1280
+ },
1281
+ placeholder: {
1282
+ type: "string",
1283
+ title: "Placeholder",
1284
+ default: "Placeholder"
1285
+ },
1286
+ _rows: {
1287
+ type: "number",
1288
+ title: "Rows",
1289
+ default: 3
1290
+ }
1291
+ }
1292
+ }),
1293
+ aiProps: ["label", "placeholder"],
1294
+ i18nProps: ["label", "placeholder"]
1295
+ }, rt = (e) => {
1296
+ const { blockProps: o, fieldName: t, label: n, styles: l, inputStyles: s, required: i, checked: a, showLabel: d = !0 } = e, g = w();
1297
+ return d ? /* @__PURE__ */ r.jsxs("div", { ...l, ...o, children: [
1298
+ /* @__PURE__ */ r.jsx(
977
1299
  "input",
978
1300
  {
979
- ...r,
1301
+ ...s,
980
1302
  name: t,
981
- id: d,
1303
+ id: g,
982
1304
  type: "checkbox",
983
- required: n,
984
- defaultChecked: i
1305
+ required: i,
1306
+ defaultChecked: a
985
1307
  }
986
1308
  ),
987
- o && o !== "Label" && /* @__PURE__ */ s.jsx("label", { htmlFor: d, children: o })
988
- ] }) : /* @__PURE__ */ s.jsx(
1309
+ n && /* @__PURE__ */ r.jsx("label", { htmlFor: g, children: n })
1310
+ ] }) : /* @__PURE__ */ r.jsx(
989
1311
  "input",
990
1312
  {
991
- id: d,
1313
+ id: g,
1314
+ ...o,
1315
+ ...s,
992
1316
  ...l,
993
- ...r,
994
- ...a,
995
1317
  type: "checkbox",
996
- required: n,
1318
+ required: i,
997
1319
  name: t
998
1320
  }
999
1321
  );
1000
- }, ht = {
1322
+ }, st = {
1001
1323
  type: "Checkbox",
1002
1324
  label: "web_blocks.checkbox",
1003
1325
  category: "core",
1004
- icon: se,
1326
+ icon: W,
1005
1327
  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);
1328
+ ...p({
1329
+ properties: {
1330
+ styles: c("flex items-center gap-x-2"),
1331
+ inputStyles: c(""),
1332
+ label: {
1333
+ type: "string",
1334
+ title: "Label",
1335
+ default: "Label"
1336
+ },
1337
+ checked: {
1338
+ type: "boolean",
1339
+ title: "Checked",
1340
+ default: !1
1341
+ },
1342
+ required: {
1343
+ type: "boolean",
1344
+ title: "Required",
1345
+ default: !1
1346
+ },
1347
+ showLabel: {
1348
+ type: "boolean",
1349
+ title: "Show Label",
1350
+ default: !0
1351
+ }
1352
+ }
1353
+ }),
1354
+ aiProps: ["label"],
1355
+ i18nProps: ["label"]
1356
+ }, it = (e) => {
1357
+ const { blockProps: o, content: t, styles: n, children: l } = e, s = { ...n, ...o };
1358
+ return l ? y.createElement("label", s, l) : y.createElement("label", {
1359
+ ...s,
1360
+ dangerouslySetInnerHTML: { __html: t }
1361
+ });
1362
+ }, at = {
1363
+ type: "Label",
1364
+ label: "Label",
1365
+ category: "core",
1366
+ icon: X,
1367
+ group: "form",
1368
+ ...p({
1369
+ properties: {
1370
+ styles: c(),
1371
+ content: {
1372
+ type: "string",
1373
+ title: "Content",
1374
+ default: ""
1375
+ }
1376
+ }
1377
+ })
1378
+ }, ft = () => {
1379
+ u(te, oe), u(ie, 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(Le, Ie), u(_e, Be), u(Pe, Ce), u(Se, Me), u(re, se), u(Ne, He), u(qe, Fe), u(We, Xe), u(Ye, Ze), u(Je, Ke), u(rt, st), u(Qe, et), u(tt, ot), u(lt, nt), u(it, at), u(Oe, Ue), u(Ge, Ve), u(Ee, Te), u(ze, Re), u(Ae, De);
1015
1380
  };
1016
1381
  export {
1017
- Lt as loadWebBlocks
1382
+ ft as loadWebBlocks
1018
1383
  };