@chaibuilder/sdk 2.0.0-beta.5 → 2.0.0-beta.50

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