@chaibuilder/sdk 2.0.0-beta.2 → 2.0.0-beta.21

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (44) hide show
  1. package/dist/ChaiThemeFn--DgGggh_.js +190 -0
  2. package/dist/ChaiThemeFn-bugxb1Cl.cjs +13 -0
  3. package/dist/{CodeEditor-xhb27i29.js → CodeEditor-7Cs6j_Wn.js} +14 -14
  4. package/dist/CodeEditor-Ifwz-vPV.cjs +1 -0
  5. package/dist/STRINGS-26RPxXyi.cjs +1 -0
  6. package/dist/STRINGS-BnWT5XcX.js +5 -0
  7. package/dist/Topbar-J_gRMjOQ.js +73 -0
  8. package/dist/Topbar-tTu3ihcy.cjs +1 -0
  9. package/dist/context-menu-4nQs6OxC.cjs +1 -0
  10. package/dist/{context-menu-I8woggB3.js → context-menu-oLipAPzI.js} +237 -254
  11. package/dist/core.cjs +61 -1
  12. package/dist/core.d.ts +56 -34
  13. package/dist/core.js +8598 -107
  14. package/dist/plugin-4xaTkTNB.cjs +1 -0
  15. package/dist/plugin-GuIj4Ul0.js +24 -0
  16. package/dist/render.cjs +2 -2
  17. package/dist/render.d.ts +34 -16
  18. package/dist/render.js +119 -121
  19. package/dist/runtime.cjs +1 -1
  20. package/dist/runtime.d.ts +0 -1
  21. package/dist/runtime.js +0 -20
  22. package/dist/style.css +1 -1
  23. package/dist/tailwind.cjs +1 -1
  24. package/dist/tailwind.d.ts +26 -25
  25. package/dist/tailwind.js +2 -2
  26. package/dist/ui.cjs +1 -1
  27. package/dist/ui.js +238 -223
  28. package/dist/web-blocks.cjs +2 -2
  29. package/dist/web-blocks.js +1079 -703
  30. package/package.json +6 -9
  31. package/dist/CodeEditor-e9zXhHFt.cjs +0 -1
  32. package/dist/STRINGS-Xxstm-7I.js +0 -7
  33. package/dist/STRINGS-Yl7cSWDc.cjs +0 -1
  34. package/dist/Topbar-CofpLWzO.cjs +0 -1
  35. package/dist/Topbar-xrdjosmc.js +0 -160
  36. package/dist/context-menu-0lRey9QY.cjs +0 -1
  37. package/dist/controls-lEwMTdPQ.js +0 -234
  38. package/dist/controls-p9IwFnPx.cjs +0 -1
  39. package/dist/index-CHYv1sC2.cjs +0 -63
  40. package/dist/index-s4RPN00p.js +0 -8540
  41. package/dist/plugin-UiUFs2fK.js +0 -44
  42. package/dist/plugin-f6SDZ_Or.js +0 -108
  43. package/dist/plugin-jum1MjXp.cjs +0 -1
  44. package/dist/plugin-xOpS-UNV.cjs +0 -1
@@ -1,350 +1,453 @@
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
+ properties: {
310
+ type: { type: "string" },
311
+ href: { type: "string" },
312
+ target: { type: "string" }
313
+ },
314
+ default: {
315
+ type: "url",
316
+ href: "",
317
+ target: "_self"
318
+ },
319
+ ui: {
320
+ "ui:field": "link"
321
+ }
322
+ }
323
+ }
324
+ }),
325
+ aiProps: ["content"],
326
+ i18nProps: ["content"],
275
327
  canAcceptBlock: (e) => e !== "Link"
276
- }, q = (e, ...l) => ({
328
+ }, M = (e, ...o) => ({
277
329
  ...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 }
330
+ className: I(e.className, ...o)
331
+ }), ke = (e) => {
332
+ 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");
333
+ if (!t && b(n == null ? void 0 : n.className) && b(i))
334
+ return /* @__PURE__ */ r.jsx(x, { inBuilder: l });
335
+ if (l)
336
+ return t ? /* @__PURE__ */ r.jsx("span", { ...o, ...m, children: t }) : y.createElement("span", {
337
+ ...o,
338
+ ...m,
339
+ dangerouslySetInnerHTML: { __html: i }
288
340
  });
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 }
341
+ const k = {};
342
+ 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", {
343
+ ...o,
344
+ ...m,
345
+ ...k,
346
+ href: s || "#",
347
+ dangerouslySetInnerHTML: { __html: i }
296
348
  });
297
- }, Me = {
349
+ }, xe = {
298
350
  type: "LightBoxLink",
299
351
  label: "Lightbox Link",
300
352
  category: "core",
301
- icon: z,
353
+ icon: j,
302
354
  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
- },
355
+ ...p({
356
+ properties: {
357
+ styles: c(""),
358
+ content: {
359
+ type: "string",
360
+ title: "Content",
361
+ default: "Link text or drop blocks inside"
362
+ },
363
+ href: {
364
+ type: "string",
365
+ title: "Href",
366
+ default: ""
367
+ },
368
+ hrefType: {
369
+ type: "string",
370
+ title: "Type",
371
+ default: "video",
372
+ oneOf: [
373
+ {
374
+ type: "string",
375
+ title: "Video",
376
+ enum: ["video"]
377
+ },
378
+ {
379
+ type: "string",
380
+ title: "Iframe",
381
+ enum: ["iframe"]
382
+ },
383
+ {
384
+ type: "string",
385
+ title: "Inline",
386
+ enum: ["inline"]
387
+ },
388
+ {
389
+ type: "string",
390
+ title: "Ajax",
391
+ enum: ["ajax"]
392
+ }
393
+ ]
394
+ },
395
+ autoplay: {
396
+ type: "boolean",
397
+ title: "Autoplay",
398
+ default: !1,
399
+ dependencies: {
400
+ hrefType: ["video"]
401
+ }
402
+ },
403
+ maxWidth: {
404
+ type: "number",
405
+ title: "Max Width",
406
+ default: ""
407
+ },
408
+ backdropColor: {
409
+ type: "string",
410
+ title: "Backdrop Color",
411
+ default: ""
412
+ },
413
+ galleryName: {
414
+ type: "string",
415
+ title: "Gallery Name",
416
+ default: ""
417
+ }
418
+ }
419
+ }),
420
+ i18nProps: ["content"],
421
+ aiProps: ["content"],
322
422
  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 },
423
+ }, we = (e) => {
424
+ const { blockProps: o, children: t, listType: n, styles: l, tag: i, inBuilder: s } = e, a = I(v(l, "className", ""), n);
425
+ return !t && b(l == null ? void 0 : l.className) ? /* @__PURE__ */ r.jsx(x, { inBuilder: s }) : y.createElement(
426
+ i || (n === "list-decimal" ? "ol" : "ul"),
427
+ { ...o, ...l, className: a },
328
428
  t
329
429
  );
330
- }, Pe = {
430
+ }, ve = {
331
431
  type: "List",
332
432
  label: "web_blocks.list",
333
- icon: Z,
433
+ icon: R,
334
434
  category: "core",
335
435
  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
- },
436
+ ...p({
437
+ properties: {
438
+ styles: c(""),
439
+ listType: {
440
+ type: "string",
441
+ title: "List Type",
442
+ default: "list-none",
443
+ oneOf: [
444
+ { enum: ["list-none"], title: "List None" },
445
+ { enum: ["list-disc"], title: "Disc" },
446
+ { enum: ["list-decimal"], title: "Decimal" }
447
+ ]
448
+ }
449
+ }
450
+ }),
348
451
  canAcceptBlock: (e) => e === "ListItem",
349
452
  blocks: [
350
453
  { _type: "List", _id: "a", listType: "list-none", styles: "#styles:," },
@@ -370,189 +473,286 @@ const de = ({ className: e = "", inBuilder: l }) => l ? /* @__PURE__ */ s.jsx("d
370
473
  content: "Item 3"
371
474
  }
372
475
  ]
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", {
476
+ }, Ie = (e) => {
477
+ const { blockProps: o, content: t, styles: n, children: l, tag: i } = e;
478
+ return l ? y.createElement(i || "li", { ...n, ...o }, l) : y.createElement(i || "li", {
479
+ ...n,
376
480
  ...o,
377
- ...l,
378
- "data-ai-key": "content",
379
481
  dangerouslySetInnerHTML: { __html: t }
380
482
  });
381
- }, $e = {
483
+ }, Le = {
382
484
  type: "ListItem",
383
485
  label: "List Item",
384
- icon: J,
486
+ icon: A,
385
487
  category: "core",
386
488
  group: "basic",
387
- props: {
388
- styles: m({ default: "" }),
389
- content: L({ title: "Content", default: "List item", ai: !0, i18n: !0 })
390
- },
489
+ ...p({
490
+ properties: {
491
+ styles: c(""),
492
+ content: {
493
+ type: "string",
494
+ default: "List item",
495
+ title: "Content",
496
+ ui: {
497
+ "ui:widget": "textarea"
498
+ }
499
+ }
500
+ }
501
+ }),
502
+ i18nProps: ["content"],
503
+ aiProps: ["content"],
391
504
  canAcceptBlock: (e) => e !== "ListItem",
392
505
  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 }
506
+ }, _e = (e) => {
507
+ 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]` : ""));
508
+ if (b(t))
509
+ return /* @__PURE__ */ r.jsx(x, { inBuilder: i, className: "h-8 w-14" });
510
+ const d = t.replace(/<svg /g, '<svg class="w-[inherit] h-[inherit]" ');
511
+ return y.createElement("span", {
512
+ ...o,
513
+ ...a,
514
+ dangerouslySetInnerHTML: { __html: d }
402
515
  });
403
- }, He = {
516
+ }, Be = {
404
517
  type: "Icon",
405
518
  label: "web_blocks.icon",
406
519
  category: "core",
407
- icon: K,
520
+ icon: D,
408
521
  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,
522
+ ...p({
523
+ properties: {
524
+ styles: c("text-black"),
525
+ icon: {
526
+ type: "string",
527
+ title: "Icon",
528
+ 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>',
529
+ ui: { "ui:widget": "icon" }
530
+ },
531
+ width: {
532
+ type: "number",
533
+ default: 16,
534
+ title: "Width"
535
+ },
536
+ height: {
537
+ type: "number",
538
+ default: 16,
539
+ title: "Height"
540
+ }
541
+ }
542
+ })
543
+ }, Pe = (e) => {
544
+ const { blockProps: o, image: t, styles: n, alt: l, height: i, width: s, lazyLoading: a } = e;
545
+ return b(t) ? /* @__PURE__ */ r.jsx(x, { className: "h-36" }) : y.createElement("img", {
422
546
  ...o,
547
+ ...n,
423
548
  src: t,
424
- alt: a,
425
- loading: i ? "lazy" : "eager",
426
- height: r,
427
- width: n
549
+ alt: l,
550
+ loading: a ? "lazy" : "eager",
551
+ height: i,
552
+ width: s
428
553
  });
429
- }, Ae = {
554
+ }, Ce = {
430
555
  type: "Image",
431
556
  label: "Image",
432
557
  category: "core",
433
- icon: z,
558
+ icon: j,
434
559
  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;
560
+ ...p({
561
+ properties: {
562
+ styles: c(""),
563
+ image: {
564
+ type: "string",
565
+ title: "Image",
566
+ default: "https://fakeimg.pl/400x200?text=Choose&font=bebas",
567
+ ui: { "ui:widget": "image" }
568
+ },
569
+ alt: {
570
+ type: "string",
571
+ title: "Alt text",
572
+ default: "",
573
+ ui: { "ui:placeholder": "Enter alt text" }
574
+ },
575
+ lazyLoading: {
576
+ type: "boolean",
577
+ title: "Lazy Load",
578
+ default: !0
579
+ },
580
+ width: {
581
+ type: "number",
582
+ title: "Width",
583
+ default: "",
584
+ ui: { "ui:placeholder": "Enter width" }
585
+ },
586
+ height: {
587
+ type: "number",
588
+ title: "Height",
589
+ default: "",
590
+ ui: { "ui:placeholder": "Enter height" }
591
+ },
592
+ mobileImage: {
593
+ type: "string",
594
+ title: "Mobile Image",
595
+ default: "",
596
+ ui: { "ui:widget": "image" }
597
+ },
598
+ mobileWidth: {
599
+ type: "number",
600
+ title: "Mobile Width",
601
+ default: "",
602
+ ui: { "ui:placeholder": "Enter width" }
603
+ },
604
+ mobileHeight: {
605
+ type: "number",
606
+ title: "Mobile Height",
607
+ default: "",
608
+ ui: { "ui:placeholder": "Enter height" }
609
+ }
610
+ }
611
+ }),
612
+ aiProps: ["alt"],
613
+ i18nProps: ["alt"]
614
+ }, _ = /^(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) => {
615
+ if (_.test(e)) {
616
+ const o = e.match(_);
617
+ return o ? `https://www.youtube.com/embed/${o[4]}` : e;
450
618
  }
451
- if (E.test(e)) {
452
- const l = e.match(E);
453
- return l ? `https://player.vimeo.com/video/${l[3]}` : e;
619
+ if (B.test(e)) {
620
+ const o = e.match(B);
621
+ return o ? `https://player.vimeo.com/video/${o[3]}` : e;
454
622
  }
455
- if ($.test(e)) {
456
- const l = e.match($);
457
- return l ? `https://www.dailymotion.com/embed/video/${l[4]}` : e;
623
+ if (P.test(e)) {
624
+ const o = e.match(P);
625
+ return o ? `https://www.dailymotion.com/embed/video/${o[4]}` : e;
458
626
  }
459
627
  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 = {
628
+ }, Se = y.memo((e) => {
629
+ 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);
630
+ if (b(l))
631
+ return /* @__PURE__ */ r.jsx(x, { inBuilder: t, className: "h-36" });
632
+ let h = je(l), f = null;
633
+ if (h) {
634
+ if (!b(h)) {
635
+ const m = [];
636
+ 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("&")}`;
637
+ }
638
+ f = y.createElement("iframe", {
639
+ ...o,
640
+ className: "absolute inset-0 w-full h-full",
641
+ src: h,
642
+ allow: t ? "" : "autoplay *; fullscreen *",
643
+ allowFullScreen: !0,
644
+ frameBorder: 0
645
+ });
646
+ } else
647
+ f = y.createElement("video", {
648
+ ...o,
649
+ className: "absolute inset-0 w-full h-full",
650
+ src: l,
651
+ controls: a,
652
+ muted: d,
653
+ autoPlay: t ? !1 : s,
654
+ loop: g
655
+ });
656
+ return /* @__PURE__ */ r.jsx("div", { ...Z(n, ["className"]), children: /* @__PURE__ */ r.jsxs("div", { className: "relative w-full overflow-hidden", style: { paddingBottom: "56.25%" }, children: [
657
+ t ? /* @__PURE__ */ r.jsx("div", { ...o, ...J(n, ["className"]), className: "absolute inset-0 z-20 h-full w-full" }) : null,
658
+ f
659
+ ] }) });
660
+ }), Me = {
495
661
  type: "Video",
496
662
  label: "Video",
497
663
  category: "core",
498
- icon: Q,
664
+ icon: q,
499
665
  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 })
666
+ ...p({
667
+ properties: {
668
+ styles: c(""),
669
+ url: {
670
+ type: "string",
671
+ title: "Video URL",
672
+ default: "https://www.youtube.com/watch?v=9xwazD5SyVg&ab_channel=MaximilianMustermann"
673
+ },
674
+ controls: {
675
+ type: "object",
676
+ title: "Controls",
677
+ default: {
678
+ autoplay: !1,
679
+ controls: !0,
680
+ loop: !1,
681
+ muted: !1
682
+ },
683
+ properties: {
684
+ autoplay: {
685
+ type: "boolean",
686
+ title: "Autoplay",
687
+ default: !1
688
+ },
689
+ controls: {
690
+ type: "boolean",
691
+ title: "Show Controls",
692
+ default: !0
693
+ },
694
+ loop: {
695
+ type: "boolean",
696
+ title: "Loop Video",
697
+ default: !1
698
+ },
699
+ muted: {
700
+ type: "boolean",
701
+ title: "Muted",
702
+ default: !1
703
+ }
704
+ }
514
705
  }
515
- })
516
- }
706
+ }
707
+ }),
708
+ i18nProps: ["url"]
709
+ }, Ee = (e) => {
710
+ const { blockProps: o, styles: t } = e;
711
+ return y.createElement("hr", { ...t, ...o });
712
+ }, Te = {
713
+ type: "Divider",
714
+ label: "web_blocks.divider",
715
+ category: "core",
716
+ icon: F,
717
+ group: "basic",
718
+ ...p({
719
+ properties: {
720
+ styles: c("bg-gray-900 h-0.5 py-2 my-1")
721
+ }
722
+ })
517
723
  };
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);
724
+ function $e(e) {
725
+ 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
726
  }
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 = {
727
+ const Ne = (e) => {
728
+ const { scripts: o, inBuilder: t, blockProps: n } = e;
729
+ 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 } });
730
+ }, He = {
525
731
  type: "CustomScript",
526
732
  label: "web_blocks.custom_script",
527
733
  category: "core",
528
- icon: Fe,
734
+ icon: $e,
529
735
  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 = {
736
+ ...p({
737
+ properties: {
738
+ scripts: {
739
+ type: "string",
740
+ title: "Script",
741
+ default: "",
742
+ format: "code",
743
+ placeholder: "<script>console.log('Hello, world!');<\/script>"
744
+ }
745
+ }
746
+ })
747
+ }, ze = (e) => null, Re = {
550
748
  type: "Dark Mode",
551
749
  label: "web_blocks.dark_mode",
552
750
  category: "core",
553
- icon: te,
751
+ icon: G,
554
752
  group: "advanced",
555
- props: {},
753
+ ...p({
754
+ properties: {}
755
+ }),
556
756
  blocks: () => [
557
757
  { _id: "ultqCh", _type: "Span", tag: "span", styles: "#styles:,", _name: "Dark Mode Switcher" },
558
758
  {
@@ -602,417 +802,593 @@ const Ge = (e) => {
602
802
  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
803
  }
604
804
  ]
605
- }, Ye = (e) => {
606
- const { blockProps: l, inBuilder: t, children: o, globalBlock: a } = e;
607
- return t && !a ? /* @__PURE__ */ s.jsxs(
805
+ }, Ae = (e) => {
806
+ const { blockProps: o, inBuilder: t, children: n, globalBlock: l } = e;
807
+ return t && !l ? /* @__PURE__ */ r.jsxs(
608
808
  "div",
609
809
  {
610
810
  className: "flex flex-col items-center justify-center gap-y-1 rounded-lg bg-gray-100 py-4 dark:bg-gray-800",
611
- ...l,
811
+ ...o,
612
812
  children: [
613
- /* @__PURE__ */ s.jsxs("h1", { children: [
813
+ /* @__PURE__ */ r.jsxs("h1", { children: [
614
814
  "Global Block - ",
615
- a
815
+ l
616
816
  ] }),
617
- /* @__PURE__ */ s.jsx("p", { children: "Choose a block from the sidebar to add it to this page." })
817
+ /* @__PURE__ */ r.jsx("p", { children: "Choose a block from the sidebar to add it to this page." })
618
818
  ]
619
819
  }
620
- ) : b.createElement("div", { ...l }, o);
621
- }, Ze = {
820
+ ) : y.createElement("div", { ...o }, n);
821
+ }, De = {
622
822
  type: "GlobalBlock",
623
823
  label: "Global Block",
624
- icon: ce,
824
+ icon: K,
625
825
  category: "core",
626
826
  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 = {
827
+ ...p({
828
+ properties: {
829
+ globalBlock: {
830
+ type: "string",
831
+ title: "Global Block",
832
+ default: "",
833
+ ui: {
834
+ "ui:widget": "hidden"
835
+ }
836
+ }
837
+ }
838
+ })
839
+ }, qe = (e) => e.inBuilder || e.forceWrapper ? /* @__PURE__ */ r.jsx("span", { ...e.blockProps, children: e.content }) : `${e.content}`, Fe = {
631
840
  type: "Text",
632
841
  label: "Text",
633
842
  hidden: !0,
634
843
  category: "core",
635
844
  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 = {
845
+ icon: V,
846
+ ...p({
847
+ properties: {
848
+ styles: c("text-black"),
849
+ content: {
850
+ type: "string",
851
+ default: ""
852
+ }
853
+ }
854
+ }),
855
+ aiProps: ["content"],
856
+ i18nProps: ["content"]
857
+ }, Ge = (e) => {
858
+ const { blockProps: o, backgroundImage: t, children: n, styles: l, tag: i } = e;
859
+ let s = {};
860
+ return t && (s = { backgroundImage: `url(${t})` }), y.createElement(i || "div", { ...o, ...l, style: s }, n);
861
+ }, Ve = {
645
862
  type: "Body",
646
863
  label: "Body",
647
864
  category: "core",
648
865
  group: "basic",
649
866
  hidden: !0,
650
- props: {
651
- styles: m({ default: "font-body antialiased" }),
652
- backgroundImage: C({ title: "Background Image" })
653
- },
867
+ ...p({
868
+ properties: {
869
+ styles: c("font-body antialiased"),
870
+ backgroundImage: {
871
+ type: "string",
872
+ title: "Image",
873
+ default: "",
874
+ ui: { "ui:widget": "image" }
875
+ },
876
+ tag: {
877
+ type: "string",
878
+ default: "div",
879
+ title: "Tag",
880
+ oneOf: [
881
+ { const: "div", title: "div" },
882
+ { const: "header", title: "header" },
883
+ { const: "footer", title: "footer" },
884
+ { const: "section", title: "section" },
885
+ { const: "article", title: "article" },
886
+ { const: "aside", title: "aside" },
887
+ { const: "main", title: "main" },
888
+ { const: "nav", title: "nav" },
889
+ { const: "figure", title: "figure" },
890
+ { const: "details", title: "details" },
891
+ { const: "summary", title: "summary" },
892
+ { const: "dialog", title: "dialog" },
893
+ { const: "strike", title: "strike" },
894
+ { const: "caption", title: "caption" },
895
+ { const: "legend", title: "legend" },
896
+ { const: "figcaption", title: "figcaption" },
897
+ { const: "mark", title: "mark" }
898
+ ]
899
+ }
900
+ }
901
+ }),
654
902
  canAcceptBlock: () => !0,
655
903
  canDelete: () => !1,
656
904
  canMove: () => !1,
657
905
  canDuplicate: () => !1
658
- }, tt = (e) => {
659
- const { blockProps: l, styles: t } = e;
660
- return b.createElement("br", { ...l, ...t });
661
- }, lt = {
906
+ }, Oe = (e) => {
907
+ const { blockProps: o, styles: t } = e;
908
+ return y.createElement("br", { ...o, ...t });
909
+ }, Ue = {
662
910
  type: "LineBreak",
663
911
  label: "Line Break",
664
912
  category: "core",
665
913
  group: "basic",
666
914
  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 = {
915
+ ...p({
916
+ properties: {
917
+ styles: c("")
918
+ }
919
+ }),
920
+ canAcceptBlock: () => !0,
921
+ canDelete: () => !1,
922
+ canMove: () => !1,
923
+ canDuplicate: () => !1
924
+ }, We = (e) => {
925
+ const { children: o, blockProps: t, errorMessage: n, successMessage: l, action: i, styles: s } = e;
926
+ let a = o;
927
+ o || (a = /* @__PURE__ */ r.jsx(x, {}));
928
+ const d = {
676
929
  "x-data": "{}",
677
930
  "x-on:submit.prevent": "post"
678
- }, f = {
931
+ }, g = {
679
932
  "x-html": "",
680
933
  ":class": "{'text-red-500': formStatus === 'ERROR', 'text-green-500': formStatus === 'SUCCESS'}"
681
934
  };
682
- return /* @__PURE__ */ s.jsxs(
935
+ return /* @__PURE__ */ r.jsxs(
683
936
  "form",
684
937
  {
685
- ...h,
686
- "data-error": t,
687
- "data-success": r,
938
+ ...d,
939
+ "data-error": n,
940
+ "data-success": l,
688
941
  method: "post",
689
- action: n,
690
- ...l,
691
- ...i,
942
+ action: i,
943
+ ...t,
944
+ ...s,
692
945
  children: [
693
- /* @__PURE__ */ s.jsx("div", { ...f }),
694
- /* @__PURE__ */ s.jsx("input", { name: "formname", type: "hidden", value: o || a }),
695
- d
946
+ /* @__PURE__ */ r.jsx("div", { ...g }),
947
+ a
696
948
  ]
697
949
  }
698
950
  );
699
- }, at = {
951
+ }, Xe = {
700
952
  type: "Form",
701
953
  label: "Form",
702
954
  category: "core",
703
- icon: le,
955
+ icon: Q,
704
956
  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
- },
957
+ ...p({
958
+ properties: {
959
+ styles: c(""),
960
+ action: {
961
+ type: "string",
962
+ title: "Submit URL",
963
+ default: "/api/form/submit"
964
+ },
965
+ errorMessage: {
966
+ type: "string",
967
+ title: "Error Message",
968
+ default: "Something went wrong. Please try again",
969
+ ui: { "ui:widget": "richtext" }
970
+ },
971
+ successMessage: {
972
+ type: "string",
973
+ title: "Success Message",
974
+ default: "Thank you for your submission.",
975
+ ui: { "ui:widget": "richtext" }
976
+ }
977
+ }
978
+ }),
979
+ i18nProps: ["errorMessage", "successMessage"],
980
+ aiProps: ["errorMessage", "successMessage"],
720
981
  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 = {
982
+ }, Ye = (e) => {
983
+ const { blockProps: o, inBuilder: t, label: n, styles: l, inputStyles: i, icon: s, iconSize: a, iconPos: d } = e, g = w(), h = {
723
984
  "x-bind:disabled": "formLoading"
724
985
  };
725
- return /* @__PURE__ */ s.jsxs(
986
+ return /* @__PURE__ */ r.jsxs(
726
987
  "button",
727
988
  {
728
- id: c,
729
- ...d,
730
- ...r,
731
- ...a,
732
- ...l || {},
989
+ id: g,
990
+ ...h,
991
+ ...i,
992
+ ...l,
993
+ ...o || {},
733
994
  type: t ? "button" : "submit",
734
995
  children: [
735
- o,
736
- n && /* @__PURE__ */ s.jsx("span", { className: i, dangerouslySetInnerHTML: { __html: n } })
996
+ n,
997
+ s && /* @__PURE__ */ r.jsx(
998
+ "div",
999
+ {
1000
+ style: { width: a + "px" },
1001
+ className: d + " " + (d === "order-first" ? "mr-2" : "ml-2") || "",
1002
+ dangerouslySetInnerHTML: { __html: s }
1003
+ }
1004
+ )
737
1005
  ]
738
1006
  }
739
1007
  );
740
- }, rt = {
1008
+ }, Ze = {
741
1009
  type: "FormButton",
742
1010
  label: "Submit Button",
743
1011
  category: "core",
744
- icon: H,
1012
+ icon: C,
745
1013
  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(
1014
+ ...p({
1015
+ properties: {
1016
+ styles: c(
1017
+ "text-white bg-primary disabled:bg-gray-400 px-4 py-2 rounded-global flex items-center gap-x-2"
1018
+ ),
1019
+ inputStyles: c(""),
1020
+ label: {
1021
+ type: "string",
1022
+ title: "Label",
1023
+ default: "Submit",
1024
+ ai: !0,
1025
+ i18n: !0
1026
+ },
1027
+ icon: {
1028
+ type: "string",
1029
+ title: "Icon",
1030
+ default: "",
1031
+ ui: { "ui:widget": "icon" }
1032
+ },
1033
+ iconSize: {
1034
+ type: "number",
1035
+ title: "Icon size",
1036
+ default: 24
1037
+ },
1038
+ iconPos: {
1039
+ type: "string",
1040
+ title: "Icon Position",
1041
+ default: "order-last",
1042
+ enum: ["order-first", "order-last"]
1043
+ }
1044
+ }
1045
+ }),
1046
+ i18nProps: ["label"],
1047
+ aiProps: ["label"]
1048
+ }, Je = (e) => {
1049
+ const { blockProps: o, fieldName: t, label: n, placeholder: l, styles: i, inputStyles: s, showLabel: a, required: d, inputType: g } = e, h = w();
1050
+ return a ? /* @__PURE__ */ r.jsxs("div", { ...i, ...o, children: [
1051
+ a && /* @__PURE__ */ r.jsx("label", { htmlFor: h, children: n }),
1052
+ /* @__PURE__ */ r.jsx(
790
1053
  "input",
791
1054
  {
792
- name: h,
793
- readOnly: d,
794
- ...r,
795
- id: f,
796
- type: c,
797
- placeholder: o,
798
- required: i
1055
+ name: t,
1056
+ ...s,
1057
+ id: h,
1058
+ type: g,
1059
+ placeholder: l,
1060
+ required: d
799
1061
  }
800
1062
  )
801
- ] });
802
- }, it = {
1063
+ ] }) : /* @__PURE__ */ r.jsx(
1064
+ "input",
1065
+ {
1066
+ id: h,
1067
+ name: t,
1068
+ ...o,
1069
+ ...s,
1070
+ ...i,
1071
+ type: g,
1072
+ placeholder: l,
1073
+ required: d
1074
+ }
1075
+ );
1076
+ }, Ke = {
803
1077
  type: "Input",
804
- label: "Input",
1078
+ label: "web_blocks.input",
805
1079
  category: "core",
806
- icon: R,
1080
+ icon: S,
807
1081
  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(
1082
+ ...p({
1083
+ properties: {
1084
+ styles: c(""),
1085
+ inputStyles: c("w-full p-1"),
1086
+ showLabel: {
1087
+ type: "boolean",
1088
+ title: "Show Label",
1089
+ default: !0
1090
+ },
1091
+ label: {
1092
+ type: "string",
1093
+ title: "Label",
1094
+ default: "Label",
1095
+ ai: !0,
1096
+ i18n: !0
1097
+ },
1098
+ placeholder: {
1099
+ type: "string",
1100
+ title: "Placeholder",
1101
+ default: "Placeholder"
1102
+ },
1103
+ required: {
1104
+ type: "boolean",
1105
+ title: "Required",
1106
+ default: !1
1107
+ },
1108
+ inputType: {
1109
+ type: "string",
1110
+ title: "Input Type",
1111
+ default: "text",
1112
+ enum: [
1113
+ "text",
1114
+ "email",
1115
+ "password",
1116
+ "number",
1117
+ "tel",
1118
+ "file",
1119
+ "hidden",
1120
+ "range",
1121
+ "submit",
1122
+ "color",
1123
+ "date",
1124
+ "time"
1125
+ ]
1126
+ }
1127
+ }
1128
+ }),
1129
+ aiProps: ["label", "placeholder"],
1130
+ i18nProps: ["label", "placeholder"]
1131
+ }, Qe = (e) => {
1132
+ const { blockProps: o, fieldName: t, label: n, styles: l, inputStyles: i, required: s, checked: a, showLabel: d = !0 } = e, g = w();
1133
+ return d ? /* @__PURE__ */ r.jsxs("div", { ...l, ...o, children: [
1134
+ /* @__PURE__ */ r.jsx("input", { ...i, name: t, id: g, type: "radio", required: s, defaultChecked: a }),
1135
+ n && /* @__PURE__ */ r.jsx("label", { htmlFor: g, children: n })
1136
+ ] }) : /* @__PURE__ */ r.jsx(
838
1137
  "input",
839
1138
  {
840
- id: d,
1139
+ id: g,
1140
+ ...o,
1141
+ ...i,
841
1142
  ...l,
842
- ...r,
843
- ...a,
844
1143
  type: "radio",
845
- required: i,
846
- checked: n,
1144
+ required: s,
1145
+ checked: a,
847
1146
  name: t
848
1147
  }
849
1148
  );
850
- }, dt = {
1149
+ }, et = {
851
1150
  type: "Radio",
852
1151
  label: "web_blocks.radio",
853
1152
  category: "core",
854
- icon: oe,
1153
+ icon: O,
855
1154
  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
- ]
1155
+ ...p({
1156
+ properties: {
1157
+ styles: c("flex items-center gap-x-2"),
1158
+ inputStyles: c(""),
1159
+ label: {
1160
+ type: "string",
1161
+ title: "Label",
1162
+ default: "Label"
1163
+ },
1164
+ checked: {
1165
+ type: "boolean",
1166
+ title: "Checked",
1167
+ default: !1
1168
+ },
1169
+ required: {
1170
+ type: "boolean",
1171
+ title: "Required",
1172
+ default: !1
1173
+ },
1174
+ showLabel: {
1175
+ type: "boolean",
1176
+ title: "Show Label",
1177
+ default: !0
1178
+ }
910
1179
  }
911
- );
912
- }, pt = {
1180
+ }),
1181
+ aiProps: ["label"],
1182
+ i18nProps: ["label"]
1183
+ }, tt = (e) => {
1184
+ const { blockProps: o, fieldName: t, label: n, placeholder: l, styles: i, inputStyles: s, required: a, showLabel: d, _multiple: g, options: h } = e, f = w();
1185
+ return d ? /* @__PURE__ */ r.jsxs("div", { ...i, ...o, children: [
1186
+ d && /* @__PURE__ */ r.jsx("label", { htmlFor: f, children: n }),
1187
+ /* @__PURE__ */ r.jsxs("select", { ...s, id: f, required: a, multiple: g, name: t, children: [
1188
+ /* @__PURE__ */ r.jsx("option", { value: "", disabled: !0, selected: !0, hidden: !0, children: l }),
1189
+ L(h, (m) => /* @__PURE__ */ r.jsx("option", { value: m.value, dangerouslySetInnerHTML: { __html: m.label } }, m.value))
1190
+ ] })
1191
+ ] }) : /* @__PURE__ */ r.jsxs("select", { id: f, ...i, ...o, required: a, multiple: g, name: t, children: [
1192
+ /* @__PURE__ */ r.jsx("option", { value: "", disabled: !0, selected: !0, hidden: !0, children: l }),
1193
+ L(h, (m) => /* @__PURE__ */ r.jsx("option", { value: m.value, dangerouslySetInnerHTML: { __html: m.label } }, m.value))
1194
+ ] });
1195
+ }, ot = {
913
1196
  type: "Select",
914
1197
  label: "web_blocks.select",
915
1198
  category: "core",
916
- icon: ae,
1199
+ icon: U,
917
1200
  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: "" })
1201
+ ...p({
1202
+ properties: {
1203
+ styles: c(""),
1204
+ inputStyles: c("w-full p-1"),
1205
+ showLabel: {
1206
+ type: "boolean",
1207
+ title: "Show Label",
1208
+ default: !0
1209
+ },
1210
+ label: {
1211
+ type: "string",
1212
+ title: "Label",
1213
+ default: "Label"
1214
+ },
1215
+ placeholder: {
1216
+ type: "string",
1217
+ title: "Placeholder",
1218
+ default: "Placeholder"
1219
+ },
1220
+ required: {
1221
+ type: "boolean",
1222
+ title: "Required",
1223
+ default: !1
1224
+ },
1225
+ _multiple: {
1226
+ type: "boolean",
1227
+ title: "Multiple",
1228
+ default: !1
1229
+ },
1230
+ options: {
1231
+ title: "Options",
1232
+ type: "array",
1233
+ default: [],
1234
+ items: {
1235
+ type: "object",
1236
+ properties: {
1237
+ label: {
1238
+ type: "string",
1239
+ title: "Label",
1240
+ default: ""
1241
+ },
1242
+ value: {
1243
+ type: "string",
1244
+ title: "Value",
1245
+ default: ""
1246
+ }
1247
+ }
1248
+ }
935
1249
  }
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(
1250
+ }
1251
+ }),
1252
+ aiProps: ["label", "placeholder"],
1253
+ i18nProps: ["label", "placeholder"]
1254
+ }, lt = (e) => {
1255
+ const { blockProps: o, fieldName: t, label: n, placeholder: l, styles: i, inputStyles: s, _rows: a, showLabel: d } = e, g = w();
1256
+ return d ? /* @__PURE__ */ r.jsxs("div", { ...i, ...o, children: [
1257
+ d && /* @__PURE__ */ r.jsx("label", { htmlFor: g, children: n }),
1258
+ /* @__PURE__ */ r.jsx("textarea", { name: t, ...s, id: g, placeholder: l, rows: a })
1259
+ ] }) : /* @__PURE__ */ r.jsx(
944
1260
  "textarea",
945
1261
  {
946
- id: d,
1262
+ id: g,
947
1263
  name: t,
948
- ...l,
949
- ...n,
950
- ...r,
951
- placeholder: a,
952
- rows: i
1264
+ ...o,
1265
+ ...s,
1266
+ ...i,
1267
+ placeholder: l,
1268
+ rows: a
953
1269
  }
954
1270
  );
955
- }, mt = {
1271
+ }, nt = {
956
1272
  type: "TextArea",
957
1273
  label: "web_blocks.textarea",
958
1274
  category: "core",
959
- icon: R,
1275
+ icon: S,
960
1276
  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(
1277
+ ...p({
1278
+ properties: {
1279
+ styles: c(""),
1280
+ inputStyles: c("w-full p-1"),
1281
+ showLabel: {
1282
+ type: "boolean",
1283
+ title: "Show Label",
1284
+ default: !0
1285
+ },
1286
+ label: {
1287
+ type: "string",
1288
+ title: "Label",
1289
+ default: "Label",
1290
+ ui: { "ui:widget": "textarea", "ui:autosize": !0, "ui:rows": 3 }
1291
+ },
1292
+ placeholder: {
1293
+ type: "string",
1294
+ title: "Placeholder",
1295
+ default: "Placeholder"
1296
+ },
1297
+ _rows: {
1298
+ type: "number",
1299
+ title: "Rows",
1300
+ default: 3
1301
+ }
1302
+ }
1303
+ }),
1304
+ aiProps: ["label", "placeholder"],
1305
+ i18nProps: ["label", "placeholder"]
1306
+ }, rt = (e) => {
1307
+ const { blockProps: o, fieldName: t, label: n, styles: l, inputStyles: i, required: s, checked: a, showLabel: d = !0 } = e, g = w();
1308
+ return d ? /* @__PURE__ */ r.jsxs("div", { ...l, ...o, children: [
1309
+ /* @__PURE__ */ r.jsx(
977
1310
  "input",
978
1311
  {
979
- ...r,
1312
+ ...i,
980
1313
  name: t,
981
- id: d,
1314
+ id: g,
982
1315
  type: "checkbox",
983
- required: n,
984
- defaultChecked: i
1316
+ required: s,
1317
+ defaultChecked: a
985
1318
  }
986
1319
  ),
987
- o && o !== "Label" && /* @__PURE__ */ s.jsx("label", { htmlFor: d, children: o })
988
- ] }) : /* @__PURE__ */ s.jsx(
1320
+ n && /* @__PURE__ */ r.jsx("label", { htmlFor: g, children: n })
1321
+ ] }) : /* @__PURE__ */ r.jsx(
989
1322
  "input",
990
1323
  {
991
- id: d,
1324
+ id: g,
1325
+ ...o,
1326
+ ...i,
992
1327
  ...l,
993
- ...r,
994
- ...a,
995
1328
  type: "checkbox",
996
- required: n,
1329
+ required: s,
997
1330
  name: t
998
1331
  }
999
1332
  );
1000
- }, ht = {
1333
+ }, it = {
1001
1334
  type: "Checkbox",
1002
1335
  label: "web_blocks.checkbox",
1003
1336
  category: "core",
1004
- icon: se,
1337
+ icon: W,
1005
1338
  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);
1339
+ ...p({
1340
+ properties: {
1341
+ styles: c("flex items-center gap-x-2"),
1342
+ inputStyles: c(""),
1343
+ label: {
1344
+ type: "string",
1345
+ title: "Label",
1346
+ default: "Label"
1347
+ },
1348
+ checked: {
1349
+ type: "boolean",
1350
+ title: "Checked",
1351
+ default: !1
1352
+ },
1353
+ required: {
1354
+ type: "boolean",
1355
+ title: "Required",
1356
+ default: !1
1357
+ },
1358
+ showLabel: {
1359
+ type: "boolean",
1360
+ title: "Show Label",
1361
+ default: !0
1362
+ }
1363
+ }
1364
+ }),
1365
+ aiProps: ["label"],
1366
+ i18nProps: ["label"]
1367
+ }, st = (e) => {
1368
+ const { blockProps: o, content: t, styles: n, children: l } = e, i = { ...n, ...o };
1369
+ return l ? y.createElement("label", i, l) : y.createElement("label", {
1370
+ ...i,
1371
+ dangerouslySetInnerHTML: { __html: t }
1372
+ });
1373
+ }, at = {
1374
+ type: "Label",
1375
+ label: "Label",
1376
+ category: "core",
1377
+ icon: X,
1378
+ group: "form",
1379
+ ...p({
1380
+ properties: {
1381
+ styles: c(),
1382
+ content: {
1383
+ type: "string",
1384
+ title: "Content",
1385
+ default: ""
1386
+ }
1387
+ }
1388
+ })
1389
+ }, ft = () => {
1390
+ 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
1391
  };
1016
1392
  export {
1017
- Lt as loadWebBlocks
1393
+ ft as loadWebBlocks
1018
1394
  };