@chaibuilder/sdk 2.2.18 → 2.2.20

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,18 +1,18 @@
1
- import { registerChaiBlockSchema as u, StylesProp as p, registerChaiBlock as d, stylesProp as T, closestBlockProp as H } from "@chaibuilder/runtime";
2
- import { jsx as s, jsxs as h, Fragment as N } from "react/jsx-runtime";
3
- import { c as x, g as C } from "./common-functions-BGzDsf1z.js";
1
+ import { registerChaiBlockSchema as u, StylesProp as d, registerChaiBlock as p, stylesProp as P, closestBlockProp as H } from "@chaibuilder/runtime";
2
+ import { jsx as s, jsxs as f, Fragment as N } from "react/jsx-runtime";
3
+ import { c as B, g as v } from "./common-functions-BGzDsf1z.js";
4
4
  import * as b from "react";
5
5
  import { createElement as w } from "react";
6
- import { ButtonIcon as R, CopyIcon as z, CodeIcon as V, DividerHorizontalIcon as D, CheckboxIcon as j, InputIcon as M, LetterCaseToggleIcon as q, RadiobuttonIcon as F, DropdownMenuIcon as U, HeadingIcon as G, TableIcon as O, BorderTopIcon as Y, BorderAllIcon as W, ViewHorizontalIcon as X, DragHandleHorizontalIcon as J, SketchLogoIcon as Q, ImageIcon as Z, Link1Icon as K, RowsIcon as ee, ColumnsIcon as te, TextIcon as oe, CursorTextIcon as le, SpaceBetweenVerticallyIcon as re, VideoIcon as ne, LoopIcon as $ } from "@radix-ui/react-icons";
7
- import { isEmpty as v, get as f, map as P, isNull as ie, omit as se, pick as ae } from "lodash-es";
8
- import { FileCode as ce, GroupIcon as pe, GlobeIcon as E, Columns as de, Rows as ue } from "lucide-react";
9
- const I = ({ className: e = "", inBuilder: o }) => o ? /* @__PURE__ */ s("div", { className: x("pointer-events-none flex h-20 flex-col items-center justify-center p-2", e), children: /* @__PURE__ */ s("div", { className: "h-full w-full rounded bg-gray-200 p-2 dark:bg-gray-800", children: /* @__PURE__ */ s("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, ye = (e) => {
6
+ import { ButtonIcon as R, CopyIcon as z, CodeIcon as D, DividerHorizontalIcon as j, CheckboxIcon as V, InputIcon as M, LetterCaseToggleIcon as q, RadiobuttonIcon as F, DropdownMenuIcon as U, HeadingIcon as G, TableIcon as O, BorderTopIcon as Y, BorderAllIcon as W, ViewHorizontalIcon as X, DragHandleHorizontalIcon as J, SketchLogoIcon as Q, ImageIcon as Z, Link1Icon as K, RowsIcon as ee, ColumnsIcon as te, TextIcon as oe, CursorTextIcon as le, SpaceBetweenVerticallyIcon as re, VideoIcon as ne, LoopIcon as E } from "@radix-ui/react-icons";
7
+ import { isEmpty as C, get as h, map as S, isNull as ie, omit as se, pick as ae } from "lodash-es";
8
+ import { FileCode as ce, GroupIcon as pe, GlobeIcon as $, Columns as de, Rows as ue } from "lucide-react";
9
+ const I = ({ className: e = "", inBuilder: o }) => o ? /* @__PURE__ */ s("div", { className: B("pointer-events-none flex h-20 flex-col items-center justify-center p-2", e), children: /* @__PURE__ */ s("div", { className: "h-full w-full rounded bg-gray-200 p-2 dark:bg-gray-800", children: /* @__PURE__ */ s("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, me = (e) => {
10
10
  const { blockProps: o, inBuilder: t, backgroundImage: l, children: r, tag: n = "div", styles: i } = e;
11
11
  let a = r;
12
12
  r || (a = /* @__PURE__ */ s(I, { inBuilder: t }));
13
13
  let c = {};
14
14
  return l && (c = { backgroundImage: `url(${l})` }), b.createElement(n, { ...o, ...i, style: c }, a);
15
- }, me = {
15
+ }, ye = {
16
16
  type: "Box",
17
17
  description: "Similar to a div or section elements in HTML",
18
18
  label: "Box",
@@ -20,7 +20,7 @@ const I = ({ className: e = "", inBuilder: o }) => o ? /* @__PURE__ */ s("div",
20
20
  group: "basic",
21
21
  ...u({
22
22
  properties: {
23
- styles: p(""),
23
+ styles: d(""),
24
24
  backgroundImage: {
25
25
  type: "string",
26
26
  default: "",
@@ -55,7 +55,7 @@ const I = ({ className: e = "", inBuilder: o }) => o ? /* @__PURE__ */ s("div",
55
55
  }),
56
56
  canAcceptBlock: () => !0
57
57
  }, ge = (e) => {
58
- const { blockProps: o, iconSize: t, icon: l, content: r, styles: n, children: i, iconPos: a, link: c, inBuilder: y } = e, k = l, g = i || /* @__PURE__ */ h(N, { children: [
58
+ const { blockProps: o, iconSize: t, icon: l, content: r, styles: n, children: i, iconPos: a, link: c, inBuilder: m } = e, k = l, g = i || /* @__PURE__ */ f(N, { children: [
59
59
  /* @__PURE__ */ s("span", { "data-ai-key": "content", children: r }),
60
60
  k && /* @__PURE__ */ s(
61
61
  "div",
@@ -65,7 +65,7 @@ const I = ({ className: e = "", inBuilder: o }) => o ? /* @__PURE__ */ s("div",
65
65
  dangerouslySetInnerHTML: { __html: k }
66
66
  }
67
67
  )
68
- ] }), m = w(
68
+ ] }), y = w(
69
69
  "button",
70
70
  {
71
71
  ...o,
@@ -75,7 +75,7 @@ const I = ({ className: e = "", inBuilder: o }) => o ? /* @__PURE__ */ s("div",
75
75
  },
76
76
  g
77
77
  );
78
- return v(f(c, "href")) ? m : y ? /* @__PURE__ */ s("span", { children: m }) : /* @__PURE__ */ s("a", { "aria-label": r, href: f(c, "href") || "/", target: f(c, "target", "_self"), children: m });
78
+ return C(h(c, "href")) ? y : m ? /* @__PURE__ */ s("span", { children: y }) : /* @__PURE__ */ s("a", { "aria-label": r, href: h(c, "href") || "/", target: h(c, "target", "_self"), children: y });
79
79
  }, be = {
80
80
  type: "Button",
81
81
  description: "similar to a button element in HTML",
@@ -85,7 +85,7 @@ const I = ({ className: e = "", inBuilder: o }) => o ? /* @__PURE__ */ s("div",
85
85
  group: "basic",
86
86
  ...u({
87
87
  properties: {
88
- styles: p("text-primary-foreground bg-primary px-4 py-2 rounded-lg flex items-center"),
88
+ styles: d("text-primary-foreground bg-primary px-4 py-2 rounded-lg flex items-center"),
89
89
  content: {
90
90
  type: "string",
91
91
  title: "Button label",
@@ -129,7 +129,7 @@ const I = ({ className: e = "", inBuilder: o }) => o ? /* @__PURE__ */ s("div",
129
129
  i18nProps: ["content"],
130
130
  aiProps: ["content"]
131
131
  }, fe = (e) => {
132
- const { blockProps: o, iconSize: t, icon: l, content: r, styles: n } = e, i = l, a = /* @__PURE__ */ h(N, { children: [
132
+ const { blockProps: o, iconSize: t, icon: l, content: r, styles: n } = e, i = l, a = /* @__PURE__ */ f(N, { children: [
133
133
  /* @__PURE__ */ s("span", { "data-ai-key": "content", children: r }),
134
134
  i && /* @__PURE__ */ s("div", { style: { width: t + "px" }, dangerouslySetInnerHTML: { __html: i } })
135
135
  ] });
@@ -152,7 +152,7 @@ const I = ({ className: e = "", inBuilder: o }) => o ? /* @__PURE__ */ s("div",
152
152
  group: "basic",
153
153
  ...u({
154
154
  properties: {
155
- styles: p("p-2 rounded-md flex items-center"),
155
+ styles: d("p-2 rounded-md flex items-center"),
156
156
  content: {
157
157
  type: "string",
158
158
  title: "Button label",
@@ -175,7 +175,7 @@ const I = ({ className: e = "", inBuilder: o }) => o ? /* @__PURE__ */ s("div",
175
175
  aiProps: ["content"]
176
176
  }, ke = (e) => {
177
177
  const { blockProps: o, styles: t, htmlCode: l, inBuilder: r } = e;
178
- return r ? /* @__PURE__ */ h("div", { className: "relative", children: [
178
+ return r ? /* @__PURE__ */ f("div", { className: "relative", children: [
179
179
  r ? /* @__PURE__ */ s("div", { ...o, ...t, className: "absolute z-20 h-full w-full" }) : null,
180
180
  b.createElement("div", {
181
181
  ...t,
@@ -191,11 +191,11 @@ const I = ({ className: e = "", inBuilder: o }) => o ? /* @__PURE__ */ s("div",
191
191
  description: "similar to a div or section elements in HTML",
192
192
  label: "Custom HTML",
193
193
  category: "core",
194
- icon: V,
194
+ icon: D,
195
195
  group: "advanced",
196
196
  ...u({
197
197
  properties: {
198
- styles: p(""),
198
+ styles: d(""),
199
199
  htmlCode: {
200
200
  type: "string",
201
201
  default: "<div><p>Enter your HTML code here...</p></div>",
@@ -203,10 +203,10 @@ const I = ({ className: e = "", inBuilder: o }) => o ? /* @__PURE__ */ s("div",
203
203
  }
204
204
  }
205
205
  })
206
- }, Ce = (e) => {
206
+ }, ve = (e) => {
207
207
  const { scripts: o, inBuilder: t, blockProps: l } = e;
208
- return t ? /* @__PURE__ */ s("div", { ...l, children: /* @__PURE__ */ s("div", { className: x("pointer-events-none flex flex-col items-center justify-center p-2", ""), children: /* @__PURE__ */ s("div", { className: "h-full w-full rounded bg-gray-200 p-1 dark:bg-gray-800", children: /* @__PURE__ */ s("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("div", { dangerouslySetInnerHTML: { __html: o } });
209
- }, ve = {
208
+ return t ? /* @__PURE__ */ s("div", { ...l, children: /* @__PURE__ */ s("div", { className: B("pointer-events-none flex flex-col items-center justify-center p-2", ""), children: /* @__PURE__ */ s("div", { className: "h-full w-full rounded bg-gray-200 p-1 dark:bg-gray-800", children: /* @__PURE__ */ s("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("div", { dangerouslySetInnerHTML: { __html: o } });
209
+ }, Ce = {
210
210
  type: "CustomScript",
211
211
  description: "similar to a script element in HTML",
212
212
  label: "Custom Script",
@@ -227,19 +227,19 @@ const I = ({ className: e = "", inBuilder: o }) => o ? /* @__PURE__ */ s("div",
227
227
  }, Ie = (e) => {
228
228
  const { blockProps: o, styles: t } = e;
229
229
  return w("hr", { ...t, ...o });
230
- }, Be = {
230
+ }, xe = {
231
231
  type: "Divider",
232
232
  description: "A horizontal line component",
233
233
  label: "Divider",
234
234
  category: "core",
235
- icon: D,
235
+ icon: j,
236
236
  group: "basic",
237
237
  ...u({
238
238
  properties: {
239
- styles: p("bg-gray-900 h-0.5 py-2 my-1")
239
+ styles: d("bg-gray-900 h-0.5 py-2 my-1")
240
240
  }
241
241
  })
242
- }, xe = (e) => {
242
+ }, Be = (e) => {
243
243
  const { blockProps: o, styles: t, backgroundImage: l } = e;
244
244
  let r = {};
245
245
  return l && (r = { backgroundImage: `url(${l})` }), b.createElement("div", { ...o, ...t, style: r });
@@ -251,7 +251,7 @@ const I = ({ className: e = "", inBuilder: o }) => o ? /* @__PURE__ */ s("div",
251
251
  group: "basic",
252
252
  ...u({
253
253
  properties: {
254
- styles: p(""),
254
+ styles: d(""),
255
255
  backgroundImage: {
256
256
  type: "string",
257
257
  title: "Background Image",
@@ -261,24 +261,24 @@ const I = ({ className: e = "", inBuilder: o }) => o ? /* @__PURE__ */ s("div",
261
261
  }
262
262
  })
263
263
  }, Pe = (e) => {
264
- const { blockProps: o, fieldName: t, label: l, styles: r, inputStyles: n, required: i, checked: a, showLabel: c = !0 } = e, y = C();
265
- return c ? /* @__PURE__ */ h("div", { ...r, ...o, children: [
264
+ const { blockProps: o, fieldName: t, label: l, styles: r, inputStyles: n, required: i, checked: a, showLabel: c = !0 } = e, m = v();
265
+ return c ? /* @__PURE__ */ f("div", { ...r, ...o, children: [
266
266
  /* @__PURE__ */ s(
267
267
  "input",
268
268
  {
269
269
  ...n,
270
270
  name: t,
271
- id: y,
271
+ id: m,
272
272
  type: "checkbox",
273
273
  required: i,
274
274
  defaultChecked: a
275
275
  }
276
276
  ),
277
- l && /* @__PURE__ */ s("label", { htmlFor: y, children: l })
277
+ l && /* @__PURE__ */ s("label", { htmlFor: m, children: l })
278
278
  ] }) : /* @__PURE__ */ s(
279
279
  "input",
280
280
  {
281
- id: y,
281
+ id: m,
282
282
  ...o,
283
283
  ...n,
284
284
  ...r,
@@ -287,16 +287,16 @@ const I = ({ className: e = "", inBuilder: o }) => o ? /* @__PURE__ */ s("div",
287
287
  name: t
288
288
  }
289
289
  );
290
- }, _e = {
290
+ }, Se = {
291
291
  type: "Checkbox",
292
292
  label: "web_blocks.checkbox",
293
293
  category: "core",
294
- icon: j,
294
+ icon: V,
295
295
  group: "form",
296
296
  ...u({
297
297
  properties: {
298
- styles: p("flex items-center gap-x-2"),
299
- inputStyles: p(""),
298
+ styles: d("flex items-center gap-x-2"),
299
+ inputStyles: d(""),
300
300
  fieldName: {
301
301
  type: "string",
302
302
  title: "Field Name",
@@ -326,10 +326,10 @@ const I = ({ className: e = "", inBuilder: o }) => o ? /* @__PURE__ */ s("div",
326
326
  }),
327
327
  aiProps: ["label"],
328
328
  i18nProps: ["label"]
329
- }, Se = (e) => {
329
+ }, _e = (e) => {
330
330
  const { children: o, blockProps: t, errorMessage: l, successMessage: r, action: n, styles: i, inBuilder: a } = e;
331
331
  let c = o;
332
- return o || (c = /* @__PURE__ */ s(I, { inBuilder: a })), /* @__PURE__ */ h(
332
+ return o || (c = /* @__PURE__ */ s(I, { inBuilder: a })), /* @__PURE__ */ f(
333
333
  "form",
334
334
  {
335
335
  ...{
@@ -369,7 +369,7 @@ const I = ({ className: e = "", inBuilder: o }) => o ? /* @__PURE__ */ s("div",
369
369
  ],
370
370
  ...u({
371
371
  properties: {
372
- styles: p(""),
372
+ styles: d(""),
373
373
  action: {
374
374
  type: "string",
375
375
  title: "Submit URL",
@@ -393,11 +393,11 @@ const I = ({ className: e = "", inBuilder: o }) => o ? /* @__PURE__ */ s("div",
393
393
  aiProps: ["errorMessage", "successMessage"],
394
394
  canAcceptBlock: () => !0
395
395
  }, Ne = (e) => {
396
- const { blockProps: o, inBuilder: t, label: l, styles: r, inputStyles: n, icon: i, iconSize: a, iconPos: c } = e, y = C();
397
- return /* @__PURE__ */ h(
396
+ const { blockProps: o, inBuilder: t, label: l, styles: r, inputStyles: n, icon: i, iconSize: a, iconPos: c } = e, m = v();
397
+ return /* @__PURE__ */ f(
398
398
  "button",
399
399
  {
400
- id: y,
400
+ id: m,
401
401
  ...{
402
402
  "x-bind:disabled": "formLoading"
403
403
  },
@@ -427,10 +427,10 @@ const I = ({ className: e = "", inBuilder: o }) => o ? /* @__PURE__ */ s("div",
427
427
  group: "form",
428
428
  ...u({
429
429
  properties: {
430
- styles: p(
430
+ styles: d(
431
431
  "text-white bg-primary disabled:bg-gray-400 px-4 py-2 rounded-global flex items-center gap-x-2"
432
432
  ),
433
- inputStyles: p(""),
433
+ inputStyles: d(""),
434
434
  label: {
435
435
  type: "string",
436
436
  title: "Label",
@@ -469,10 +469,10 @@ const I = ({ className: e = "", inBuilder: o }) => o ? /* @__PURE__ */ s("div",
469
469
  inputStyles: i,
470
470
  showLabel: a,
471
471
  required: c,
472
- inputType: y,
472
+ inputType: m,
473
473
  autocomplete: k
474
- } = e, g = C();
475
- return a ? /* @__PURE__ */ h("div", { ...n, ...o, children: [
474
+ } = e, g = v();
475
+ return a ? /* @__PURE__ */ f("div", { ...n, ...o, children: [
476
476
  a && /* @__PURE__ */ s("label", { htmlFor: g, children: l }),
477
477
  /* @__PURE__ */ s(
478
478
  "input",
@@ -480,7 +480,7 @@ const I = ({ className: e = "", inBuilder: o }) => o ? /* @__PURE__ */ s("div",
480
480
  name: t,
481
481
  ...i,
482
482
  id: g,
483
- type: y,
483
+ type: m,
484
484
  placeholder: r,
485
485
  required: c,
486
486
  autoComplete: k ? "on" : "off"
@@ -494,13 +494,13 @@ const I = ({ className: e = "", inBuilder: o }) => o ? /* @__PURE__ */ s("div",
494
494
  ...o,
495
495
  ...i,
496
496
  ...n,
497
- type: y,
497
+ type: m,
498
498
  placeholder: r,
499
499
  required: c,
500
500
  autoComplete: k ? "on" : "off"
501
501
  }
502
502
  );
503
- }, $e = {
503
+ }, Ee = {
504
504
  type: "Input",
505
505
  label: "web_blocks.input",
506
506
  category: "core",
@@ -508,8 +508,8 @@ const I = ({ className: e = "", inBuilder: o }) => o ? /* @__PURE__ */ s("div",
508
508
  group: "form",
509
509
  ...u({
510
510
  properties: {
511
- styles: p(""),
512
- inputStyles: p("w-full p-1"),
511
+ styles: d(""),
512
+ inputStyles: d("w-full p-1"),
513
513
  fieldName: {
514
514
  type: "string",
515
515
  title: "Field Name",
@@ -536,7 +536,20 @@ const I = ({ className: e = "", inBuilder: o }) => o ? /* @__PURE__ */ s("div",
536
536
  type: "string",
537
537
  title: "Input Type",
538
538
  default: "text",
539
- enum: ["text", "email", "password", "number", "tel", "hidden", "range", "color", "date", "time"]
539
+ enum: [
540
+ "text",
541
+ "email",
542
+ "password",
543
+ "number",
544
+ "tel",
545
+ "hidden",
546
+ "range",
547
+ "color",
548
+ "date",
549
+ "time",
550
+ "name",
551
+ "postal-code"
552
+ ]
540
553
  },
541
554
  required: {
542
555
  type: "boolean",
@@ -552,7 +565,7 @@ const I = ({ className: e = "", inBuilder: o }) => o ? /* @__PURE__ */ s("div",
552
565
  }),
553
566
  aiProps: ["label", "placeholder"],
554
567
  i18nProps: ["label", "placeholder"]
555
- }, Ee = (e) => {
568
+ }, $e = (e) => {
556
569
  const { blockProps: o, content: t, styles: l, children: r } = e, n = { ...l, ...o };
557
570
  return r ? b.createElement("label", n, r) : b.createElement("label", {
558
571
  ...n,
@@ -566,7 +579,7 @@ const I = ({ className: e = "", inBuilder: o }) => o ? /* @__PURE__ */ s("div",
566
579
  group: "form",
567
580
  ...u({
568
581
  properties: {
569
- styles: p(),
582
+ styles: d(),
570
583
  content: {
571
584
  type: "string",
572
585
  title: "Content",
@@ -577,14 +590,14 @@ const I = ({ className: e = "", inBuilder: o }) => o ? /* @__PURE__ */ s("div",
577
590
  aiProps: ["content"],
578
591
  i18nProps: ["content"]
579
592
  }, He = (e) => {
580
- const { blockProps: o, fieldName: t, label: l, styles: r, inputStyles: n, required: i, checked: a, showLabel: c = !0 } = e, y = C();
581
- return c ? /* @__PURE__ */ h("div", { ...r, ...o, children: [
582
- /* @__PURE__ */ s("input", { ...n, name: t, id: y, type: "radio", required: i, defaultChecked: a }),
583
- l && /* @__PURE__ */ s("label", { htmlFor: y, children: l })
593
+ const { blockProps: o, fieldName: t, label: l, styles: r, inputStyles: n, required: i, checked: a, showLabel: c = !0 } = e, m = v();
594
+ return c ? /* @__PURE__ */ f("div", { ...r, ...o, children: [
595
+ /* @__PURE__ */ s("input", { ...n, name: t, id: m, type: "radio", required: i, defaultChecked: a }),
596
+ l && /* @__PURE__ */ s("label", { htmlFor: m, children: l })
584
597
  ] }) : /* @__PURE__ */ s(
585
598
  "input",
586
599
  {
587
- id: y,
600
+ id: m,
588
601
  ...o,
589
602
  ...n,
590
603
  ...r,
@@ -602,8 +615,8 @@ const I = ({ className: e = "", inBuilder: o }) => o ? /* @__PURE__ */ s("div",
602
615
  group: "form",
603
616
  ...u({
604
617
  properties: {
605
- styles: p("flex items-center gap-x-2"),
606
- inputStyles: p(""),
618
+ styles: d("flex items-center gap-x-2"),
619
+ inputStyles: d(""),
607
620
  fieldName: {
608
621
  type: "string",
609
622
  title: "Field Name",
@@ -633,19 +646,19 @@ const I = ({ className: e = "", inBuilder: o }) => o ? /* @__PURE__ */ s("div",
633
646
  }),
634
647
  aiProps: ["label"],
635
648
  i18nProps: ["label"]
636
- }, Ve = (e) => {
637
- const { blockProps: o, fieldName: t, label: l, placeholder: r, styles: n, inputStyles: i, required: a, showLabel: c, _multiple: y, options: k } = e, g = C();
638
- return c ? /* @__PURE__ */ h("div", { ...n, ...o, children: [
649
+ }, De = (e) => {
650
+ const { blockProps: o, fieldName: t, label: l, placeholder: r, styles: n, inputStyles: i, required: a, showLabel: c, _multiple: m, options: k } = e, g = v();
651
+ return c ? /* @__PURE__ */ f("div", { ...n, ...o, children: [
639
652
  c && /* @__PURE__ */ s("label", { htmlFor: g, children: l }),
640
- /* @__PURE__ */ h("select", { ...i, id: g, required: a, multiple: y, name: t, children: [
653
+ /* @__PURE__ */ f("select", { ...i, id: g, required: a, multiple: m, name: t, children: [
641
654
  /* @__PURE__ */ s("option", { value: "", disabled: !0, selected: !0, hidden: !0, children: r }),
642
- P(k, (m) => /* @__PURE__ */ s("option", { value: m == null ? void 0 : m.value, children: m == null ? void 0 : m.label }, m == null ? void 0 : m.value))
655
+ S(k, (y) => /* @__PURE__ */ s("option", { value: y == null ? void 0 : y.value, children: y == null ? void 0 : y.label }, y == null ? void 0 : y.value))
643
656
  ] })
644
- ] }) : /* @__PURE__ */ h("select", { id: g, ...n, ...o, required: a, multiple: y, name: t, children: [
657
+ ] }) : /* @__PURE__ */ f("select", { id: g, ...n, ...o, required: a, multiple: m, name: t, children: [
645
658
  /* @__PURE__ */ s("option", { value: "", disabled: !0, selected: !0, hidden: !0, children: r }),
646
- P(k, (m) => /* @__PURE__ */ s("option", { value: m == null ? void 0 : m.value, children: m == null ? void 0 : m.label }, m == null ? void 0 : m.value))
659
+ S(k, (y) => /* @__PURE__ */ s("option", { value: y == null ? void 0 : y.value, children: y == null ? void 0 : y.label }, y == null ? void 0 : y.value))
647
660
  ] });
648
- }, De = {
661
+ }, je = {
649
662
  type: "Select",
650
663
  label: "web_blocks.select",
651
664
  category: "core",
@@ -653,8 +666,8 @@ const I = ({ className: e = "", inBuilder: o }) => o ? /* @__PURE__ */ s("div",
653
666
  group: "form",
654
667
  ...u({
655
668
  properties: {
656
- styles: p(""),
657
- inputStyles: p("w-full p-1"),
669
+ styles: d(""),
670
+ inputStyles: d("w-full p-1"),
658
671
  fieldName: {
659
672
  type: "string",
660
673
  title: "Field Name",
@@ -709,9 +722,9 @@ const I = ({ className: e = "", inBuilder: o }) => o ? /* @__PURE__ */ s("div",
709
722
  }),
710
723
  aiProps: ["label", "placeholder"],
711
724
  i18nProps: ["label", "placeholder"]
712
- }, je = (e) => {
713
- const { blockProps: o, fieldName: t, label: l, placeholder: r, styles: n, inputStyles: i, rows: a, showLabel: c, required: y } = e, k = C();
714
- return c ? /* @__PURE__ */ h("div", { ...n, ...o, children: [
725
+ }, Ve = (e) => {
726
+ const { blockProps: o, fieldName: t, label: l, placeholder: r, styles: n, inputStyles: i, rows: a, showLabel: c, required: m } = e, k = v();
727
+ return c ? /* @__PURE__ */ f("div", { ...n, ...o, children: [
715
728
  c && /* @__PURE__ */ s("label", { htmlFor: k, children: l }),
716
729
  /* @__PURE__ */ s(
717
730
  "textarea",
@@ -721,7 +734,7 @@ const I = ({ className: e = "", inBuilder: o }) => o ? /* @__PURE__ */ s("div",
721
734
  id: k,
722
735
  placeholder: r,
723
736
  rows: a,
724
- required: y
737
+ required: m
725
738
  }
726
739
  )
727
740
  ] }) : /* @__PURE__ */ s(
@@ -734,7 +747,7 @@ const I = ({ className: e = "", inBuilder: o }) => o ? /* @__PURE__ */ s("div",
734
747
  ...n,
735
748
  placeholder: r,
736
749
  rows: a,
737
- required: y
750
+ required: m
738
751
  }
739
752
  );
740
753
  }, qe = {
@@ -750,8 +763,8 @@ const I = ({ className: e = "", inBuilder: o }) => o ? /* @__PURE__ */ s("div",
750
763
  title: "Field Name",
751
764
  default: "fieldName"
752
765
  },
753
- styles: p(""),
754
- inputStyles: p("w-full p-1"),
766
+ styles: d(""),
767
+ inputStyles: d("w-full p-1"),
755
768
  showLabel: {
756
769
  type: "boolean",
757
770
  title: "Show Label",
@@ -784,13 +797,13 @@ const I = ({ className: e = "", inBuilder: o }) => o ? /* @__PURE__ */ s("div",
784
797
  i18nProps: ["label", "placeholder"]
785
798
  }, Fe = (e) => {
786
799
  const { blockProps: o, inBuilder: t, children: l, globalBlock: r } = e;
787
- return t && !r ? /* @__PURE__ */ h(
800
+ return t && !r ? /* @__PURE__ */ f(
788
801
  "div",
789
802
  {
790
803
  className: "flex flex-col items-center justify-center gap-y-1 rounded-lg bg-gray-100 py-4 dark:bg-gray-800",
791
804
  ...o,
792
805
  children: [
793
- /* @__PURE__ */ h("h1", { children: [
806
+ /* @__PURE__ */ f("h1", { children: [
794
807
  "Global Block - ",
795
808
  r
796
809
  ] }),
@@ -802,7 +815,7 @@ const I = ({ className: e = "", inBuilder: o }) => o ? /* @__PURE__ */ s("div",
802
815
  type: "GlobalBlock",
803
816
  description: "A global block component",
804
817
  label: "Global Block",
805
- icon: E,
818
+ icon: $,
806
819
  category: "core",
807
820
  group: "basic",
808
821
  hidden: !0,
@@ -838,7 +851,7 @@ const I = ({ className: e = "", inBuilder: o }) => o ? /* @__PURE__ */ s("div",
838
851
  title: "Level",
839
852
  enum: ["h1", "h2", "h3", "h4", "h5", "h6"]
840
853
  },
841
- styles: p("text-3xl"),
854
+ styles: d("text-3xl"),
842
855
  content: {
843
856
  type: "string",
844
857
  default: "Heading goes here",
@@ -861,7 +874,7 @@ const I = ({ className: e = "", inBuilder: o }) => o ? /* @__PURE__ */ s("div",
861
874
  hidden: !0,
862
875
  ...u({
863
876
  properties: {
864
- styles: p("")
877
+ styles: d("")
865
878
  }
866
879
  }),
867
880
  canAcceptBlock: () => !0,
@@ -882,13 +895,13 @@ const I = ({ className: e = "", inBuilder: o }) => o ? /* @__PURE__ */ s("div",
882
895
  return t ? w("tr", { ...o, ...l }, t) : /* @__PURE__ */ s(I, {});
883
896
  }, Ke = (e) => {
884
897
  const { blockProps: o, children: t, content: l, styles: r } = e;
885
- return !t && v(l) ? /* @__PURE__ */ s(I, {}) : t ? w("td", { ...o, ...r }, t) : w("td", {
898
+ return !t && C(l) ? /* @__PURE__ */ s(I, {}) : t ? w("td", { ...o, ...r }, t) : w("td", {
886
899
  ...o,
887
900
  ...r,
888
901
  dangerouslySetInnerHTML: { __html: l }
889
902
  });
890
903
  };
891
- d(Xe, {
904
+ p(Xe, {
892
905
  type: "Table",
893
906
  label: "Table",
894
907
  category: "core",
@@ -897,12 +910,12 @@ d(Xe, {
897
910
  icon: O,
898
911
  ...u({
899
912
  properties: {
900
- styles: p("")
913
+ styles: d("")
901
914
  }
902
915
  }),
903
- blocks: B("Table")
916
+ blocks: x("Table")
904
917
  });
905
- d(Je, {
918
+ p(Je, {
906
919
  type: "TableHead",
907
920
  label: "Table Head",
908
921
  category: "core",
@@ -911,12 +924,12 @@ d(Je, {
911
924
  icon: Y,
912
925
  ...u({
913
926
  properties: {
914
- styles: p("")
927
+ styles: d("")
915
928
  }
916
929
  }),
917
- blocks: B("TableHead")
930
+ blocks: x("TableHead")
918
931
  });
919
- d(Qe, {
932
+ p(Qe, {
920
933
  type: "TableBody",
921
934
  label: "Table Body",
922
935
  category: "core",
@@ -925,12 +938,12 @@ d(Qe, {
925
938
  icon: W,
926
939
  ...u({
927
940
  properties: {
928
- styles: p("")
941
+ styles: d("")
929
942
  }
930
943
  }),
931
- blocks: B("TableBody")
944
+ blocks: x("TableBody")
932
945
  });
933
- d(Ze, {
946
+ p(Ze, {
934
947
  type: "TableRow",
935
948
  label: "Table Row",
936
949
  category: "core",
@@ -939,12 +952,12 @@ d(Ze, {
939
952
  icon: X,
940
953
  ...u({
941
954
  properties: {
942
- styles: p("")
955
+ styles: d("")
943
956
  }
944
957
  }),
945
- blocks: B("TableRow")
958
+ blocks: x("TableRow")
946
959
  });
947
- d(Ke, {
960
+ p(Ke, {
948
961
  type: "TableCell",
949
962
  label: "Table Cell",
950
963
  category: "core",
@@ -953,7 +966,7 @@ d(Ke, {
953
966
  icon: J,
954
967
  ...u({
955
968
  properties: {
956
- styles: p(""),
969
+ styles: d(""),
957
970
  content: {
958
971
  type: "string",
959
972
  default: "Heading goes here",
@@ -962,33 +975,33 @@ d(Ke, {
962
975
  }
963
976
  }
964
977
  }),
965
- blocks: B("TableCell"),
978
+ blocks: x("TableCell"),
966
979
  i18nProps: ["content"],
967
980
  aiProps: ["content"]
968
981
  });
969
- function B(e) {
982
+ function x(e) {
970
983
  const o = (n, i) => ({
971
- _id: C(),
984
+ _id: v(),
972
985
  _parent: n,
973
986
  _type: "TableCell",
974
987
  styles: "#styles:,",
975
988
  content: `${e === "TableHead" ? "Table Head" : "Table Cell " + i}`
976
989
  }), t = (n) => {
977
- const i = C(), a = {
990
+ const i = v(), a = {
978
991
  _type: "TableRow",
979
992
  _id: i,
980
993
  styles: "#styles:,border-b"
981
994
  };
982
995
  return n && (a._parent = n), [a, o(i, "1"), o(i, "2"), o(i, "3")];
983
996
  }, l = (n) => {
984
- const i = C(), a = {
997
+ const i = v(), a = {
985
998
  _id: i,
986
999
  _type: "TableHead",
987
1000
  styles: "#styles:,font-medium"
988
1001
  };
989
1002
  return n && (a._parent = n), [a, ...t(i)];
990
1003
  }, r = (n) => {
991
- const i = C(), a = {
1004
+ const i = v(), a = {
992
1005
  _id: i,
993
1006
  _type: "TableBody",
994
1007
  styles: "#styles:,"
@@ -996,7 +1009,7 @@ function B(e) {
996
1009
  return n && (a._parent = n), [a, ...t(i), ...t(i)];
997
1010
  };
998
1011
  if (e === "Table") {
999
- const n = C();
1012
+ const n = v();
1000
1013
  return [
1001
1014
  {
1002
1015
  _id: n,
@@ -1011,10 +1024,10 @@ function B(e) {
1011
1024
  }
1012
1025
  const A = (e, ...o) => ({
1013
1026
  ...e,
1014
- className: x(e.className, ...o)
1027
+ className: B(e.className, ...o)
1015
1028
  }), et = (e) => {
1016
1029
  const { blockProps: o, icon: t, styles: l, width: r, inBuilder: n, height: i } = e, a = A(l, "");
1017
- if (v(t))
1030
+ if (C(t))
1018
1031
  return /* @__PURE__ */ s(I, { inBuilder: n, className: "h-8 w-14" });
1019
1032
  const c = t.replace(/<svg /g, '<svg class="w-[inherit] h-[inherit]" ');
1020
1033
  return b.createElement("span", {
@@ -1034,7 +1047,7 @@ const A = (e, ...o) => ({
1034
1047
  group: "media",
1035
1048
  ...u({
1036
1049
  properties: {
1037
- styles: p(""),
1050
+ styles: d(""),
1038
1051
  icon: {
1039
1052
  type: "string",
1040
1053
  title: "Icon",
@@ -1055,7 +1068,7 @@ const A = (e, ...o) => ({
1055
1068
  })
1056
1069
  }, ot = (e) => {
1057
1070
  const { blockProps: o, image: t, mobileImage: l, styles: r, alt: n, height: i, width: a, lazyLoading: c } = e;
1058
- return v(t) ? /* @__PURE__ */ s(I, { className: "h-36" }) : /* @__PURE__ */ h("picture", { children: [
1071
+ return C(t) ? /* @__PURE__ */ s(I, { className: "h-36" }) : /* @__PURE__ */ f("picture", { children: [
1059
1072
  l && /* @__PURE__ */ s("source", { srcSet: l, media: "(max-width: 480px)" }),
1060
1073
  /* @__PURE__ */ s(
1061
1074
  "img",
@@ -1079,7 +1092,7 @@ const A = (e, ...o) => ({
1079
1092
  group: "media",
1080
1093
  ...u({
1081
1094
  properties: {
1082
- styles: p(""),
1095
+ styles: d(""),
1083
1096
  image: {
1084
1097
  type: "string",
1085
1098
  title: "Image",
@@ -1128,7 +1141,7 @@ const A = (e, ...o) => ({
1128
1141
  }, rt = (e) => {
1129
1142
  const { blockProps: o, link: t, children: l, styles: r, inBuilder: n, content: i } = e;
1130
1143
  let a = {};
1131
- return !l && v(i) && (a = { minHeight: "50px", display: "flex", alignItems: "center", justifyContent: "center" }), n ? l ? /* @__PURE__ */ s("span", { ...o, style: a, ...r, children: l }) : w(
1144
+ return !l && C(i) && (a = { minHeight: "50px", display: "flex", alignItems: "center", justifyContent: "center" }), n ? l ? /* @__PURE__ */ s("span", { ...o, style: a, ...r, children: l }) : w(
1132
1145
  "span",
1133
1146
  {
1134
1147
  ...o,
@@ -1156,7 +1169,7 @@ const A = (e, ...o) => ({
1156
1169
  group: "basic",
1157
1170
  ...u({
1158
1171
  properties: {
1159
- styles: p(""),
1172
+ styles: d(""),
1160
1173
  content: {
1161
1174
  type: "string",
1162
1175
  default: "Link goes here",
@@ -1184,8 +1197,8 @@ const A = (e, ...o) => ({
1184
1197
  i18nProps: ["content"],
1185
1198
  canAcceptBlock: (e) => e !== "Link"
1186
1199
  }, it = (e) => {
1187
- const { blockProps: o, children: t, listType: l, styles: r, tag: n, inBuilder: i } = e, a = x(f(r, "className", ""), l);
1188
- return !t && v(r == null ? void 0 : r.className) ? /* @__PURE__ */ s(I, { inBuilder: i }) : b.createElement(
1200
+ const { blockProps: o, children: t, listType: l, styles: r, tag: n, inBuilder: i } = e, a = B(h(r, "className", ""), l);
1201
+ return !t && C(r == null ? void 0 : r.className) ? /* @__PURE__ */ s(I, { inBuilder: i }) : b.createElement(
1189
1202
  n || (l === "list-decimal" ? "ol" : "ul"),
1190
1203
  { ...o, ...r, className: a },
1191
1204
  t
@@ -1199,7 +1212,7 @@ const A = (e, ...o) => ({
1199
1212
  group: "basic",
1200
1213
  ...u({
1201
1214
  properties: {
1202
- styles: p(""),
1215
+ styles: d(""),
1203
1216
  listType: {
1204
1217
  type: "string",
1205
1218
  title: "List Type",
@@ -1253,7 +1266,7 @@ const A = (e, ...o) => ({
1253
1266
  group: "basic",
1254
1267
  ...u({
1255
1268
  properties: {
1256
- styles: p(""),
1269
+ styles: d(""),
1257
1270
  content: {
1258
1271
  type: "string",
1259
1272
  default: "List item",
@@ -1284,7 +1297,7 @@ const A = (e, ...o) => ({
1284
1297
  group: "typography",
1285
1298
  ...u({
1286
1299
  properties: {
1287
- styles: p(""),
1300
+ styles: d(""),
1288
1301
  content: {
1289
1302
  type: "string",
1290
1303
  title: "Content",
@@ -1300,13 +1313,13 @@ const A = (e, ...o) => ({
1300
1313
  canAcceptBlock: (e) => e === "Span" || e === "Link" || e === "Text"
1301
1314
  }, ut = (e) => {
1302
1315
  const { blockProps: o, inBuilder: t, children: l, partialBlockId: r } = e;
1303
- return t && !r ? /* @__PURE__ */ h(
1316
+ return t && !r ? /* @__PURE__ */ f(
1304
1317
  "div",
1305
1318
  {
1306
1319
  className: "flex flex-col items-center justify-center gap-y-1 rounded-lg bg-gray-100 py-4 dark:bg-gray-800",
1307
1320
  ...o,
1308
1321
  children: [
1309
- /* @__PURE__ */ h("h1", { children: [
1322
+ /* @__PURE__ */ f("h1", { children: [
1310
1323
  "Partial Block - ",
1311
1324
  r
1312
1325
  ] }),
@@ -1314,11 +1327,11 @@ const A = (e, ...o) => ({
1314
1327
  ]
1315
1328
  }
1316
1329
  ) : b.createElement("span", { ...o }, l);
1317
- }, yt = {
1330
+ }, mt = {
1318
1331
  type: "PartialBlock",
1319
1332
  description: "A partial block component",
1320
1333
  label: "Partial Block",
1321
- icon: E,
1334
+ icon: $,
1322
1335
  category: "core",
1323
1336
  group: "basic",
1324
1337
  hidden: !0,
@@ -1375,12 +1388,12 @@ const A = (e, ...o) => ({
1375
1388
  11: "lg:col-span-11",
1376
1389
  12: "lg:col-span-12"
1377
1390
  }
1378
- }, mt = (e) => {
1391
+ }, yt = (e) => {
1379
1392
  const { blockProps: o, children: t, styles: l, colSpan: r, tabletColSpan: n, desktopColSpan: i } = e, c = { className: [
1380
- f(l, "className", ""),
1381
- f(L, ["SMALL", isNaN(r) || !r ? 6 : r], ""),
1382
- n ? f(L, ["MEDIUM", n || r], "") : "",
1383
- i ? f(L, ["LARGE", n || r], "") : ""
1393
+ h(l, "className", ""),
1394
+ h(L, ["SMALL", isNaN(r) || !r ? 6 : r], ""),
1395
+ n ? h(L, ["MEDIUM", n || r], "") : "",
1396
+ i ? h(L, ["LARGE", n || r], "") : ""
1384
1397
  ].join(" ") };
1385
1398
  return /* @__PURE__ */ s("div", { ...o, ...l, ...c, children: t || /* @__PURE__ */ s("div", { className: "h-full min-h-12 w-full border-2 border-dashed border-gray-400 bg-gray-100 dark:bg-gray-900" }) });
1386
1399
  }, gt = {
@@ -1396,7 +1409,7 @@ const A = (e, ...o) => ({
1396
1409
  canBeNested: (e) => e === "Row",
1397
1410
  ...u({
1398
1411
  properties: {
1399
- styles: p(""),
1412
+ styles: d(""),
1400
1413
  colSpan: {
1401
1414
  type: "number",
1402
1415
  title: "Column Span",
@@ -1420,7 +1433,7 @@ const A = (e, ...o) => ({
1420
1433
  }
1421
1434
  })
1422
1435
  }, bt = (e) => {
1423
- const { blockProps: o, children: t, styles: l, gutter: r } = e, i = { className: [f(l, "className", ""), " grid grid-cols-12"].join() };
1436
+ const { blockProps: o, children: t, styles: l, gutter: r } = e, i = { className: [h(l, "className", ""), " grid grid-cols-12"].join() };
1424
1437
  return typeof (l == null ? void 0 : l.style) == "object" ? l.style.gap = `${r}px` : i.style = { gap: `${r}px` }, /* @__PURE__ */ s("div", { ...o, ...l, ...i, children: t });
1425
1438
  }, ft = {
1426
1439
  type: "Row",
@@ -1438,7 +1451,7 @@ const A = (e, ...o) => ({
1438
1451
  canAcceptBlock: (e) => e === "Column",
1439
1452
  ...u({
1440
1453
  properties: {
1441
- styles: p(""),
1454
+ styles: d(""),
1442
1455
  colCount: {
1443
1456
  type: "number",
1444
1457
  default: 2,
@@ -1469,7 +1482,7 @@ const A = (e, ...o) => ({
1469
1482
  group: "typography",
1470
1483
  ...u({
1471
1484
  properties: {
1472
- styles: p(""),
1485
+ styles: d(""),
1473
1486
  content: {
1474
1487
  type: "string",
1475
1488
  title: "Content",
@@ -1487,7 +1500,7 @@ const A = (e, ...o) => ({
1487
1500
  ...o,
1488
1501
  dangerouslySetInnerHTML: { __html: l || "" }
1489
1502
  });
1490
- }, Ct = {
1503
+ }, vt = {
1491
1504
  type: "Span",
1492
1505
  description: "A span component",
1493
1506
  label: "Span",
@@ -1495,7 +1508,7 @@ const A = (e, ...o) => ({
1495
1508
  group: "typography",
1496
1509
  ...u({
1497
1510
  properties: {
1498
- styles: p(""),
1511
+ styles: d(""),
1499
1512
  content: {
1500
1513
  type: "string",
1501
1514
  title: "Content",
@@ -1507,7 +1520,7 @@ const A = (e, ...o) => ({
1507
1520
  aiProps: ["content"],
1508
1521
  i18nProps: ["content"],
1509
1522
  canAcceptBlock: () => !0
1510
- }, vt = (e) => e.inBuilder || e.forceWrapper ? /* @__PURE__ */ s("span", { ...e.blockProps, children: e.content }) : `${e.content}`, It = {
1523
+ }, Ct = (e) => e.inBuilder || e.forceWrapper ? /* @__PURE__ */ s("span", { ...e.blockProps, children: e.content }) : `${e.content}`, It = {
1511
1524
  type: "Text",
1512
1525
  description: "A text component with no styling",
1513
1526
  label: "Text",
@@ -1517,7 +1530,7 @@ const A = (e, ...o) => ({
1517
1530
  icon: re,
1518
1531
  ...u({
1519
1532
  properties: {
1520
- styles: p("text-black"),
1533
+ styles: d("text-black"),
1521
1534
  content: {
1522
1535
  title: "Content",
1523
1536
  type: "string",
@@ -1527,7 +1540,7 @@ const A = (e, ...o) => ({
1527
1540
  }),
1528
1541
  aiProps: ["content"],
1529
1542
  i18nProps: ["content"]
1530
- }, Bt = {
1543
+ }, xt = {
1531
1544
  type: "object",
1532
1545
  title: "Controls",
1533
1546
  default: {
@@ -1558,18 +1571,18 @@ const A = (e, ...o) => ({
1558
1571
  default: !1
1559
1572
  }
1560
1573
  }
1561
- }, _ = /^(https?:\/\/)?(www\.)?youtube\.com\/(watch\?v=|embed\/)([a-zA-Z0-9_-]{11})/, S = /(?:https?:\/\/)?(?:www\.)?(?:vimeo\.com\/(?:channels\/[\w]+\/|groups\/[^\/]+\/videos\/|album\/\d+\/video\/|video\/)?|player\.vimeo\.com\/video\/)(\d+)/, xt = (e, o) => {
1562
- const t = f(o, "autoplay", !1), l = f(o, "controls", !1), r = f(o, "loop", !1), n = t || f(o, "muted", !0);
1574
+ }, _ = /^(https?:\/\/)?(www\.)?youtube\.com\/(watch\?v=|embed\/)([a-zA-Z0-9_-]{11})/, T = /(?:https?:\/\/)?(?:www\.)?(?:vimeo\.com\/(?:channels\/[\w]+\/|groups\/[^\/]+\/videos\/|album\/\d+\/video\/|video\/)?|player\.vimeo\.com\/video\/)(\d+)/, Bt = (e, o) => {
1575
+ const t = h(o, "autoplay", !1), l = h(o, "controls", !1), r = h(o, "loop", !1), n = t || h(o, "muted", !0);
1563
1576
  if (_.test(e)) {
1564
1577
  const i = e.match(_);
1565
1578
  if (i) {
1566
1579
  const a = i[4];
1567
- let c = `https://www.youtube.com/embed/${a}`, y = t ? "autoplay=1" : "";
1568
- return y += r ? `&loop=1&playlist=${a}` : "", y += n ? "&mute=1&muted=1" : "", y += l ? "&controls=1" : "&controls=0", `${c}?${y}`;
1580
+ let c = `https://www.youtube.com/embed/${a}`, m = t ? "autoplay=1" : "";
1581
+ return m += r ? `&loop=1&playlist=${a}` : "", m += n ? "&mute=1&muted=1" : "", m += l ? "&controls=1" : "&controls=0", `${c}?${m}`;
1569
1582
  }
1570
1583
  }
1571
- if (S.test(e)) {
1572
- const i = e.match(S);
1584
+ if (T.test(e)) {
1585
+ const i = e.match(T);
1573
1586
  if (i) {
1574
1587
  const a = i[1];
1575
1588
  let c = "";
@@ -1578,45 +1591,45 @@ const A = (e, ...o) => ({
1578
1591
  }
1579
1592
  return null;
1580
1593
  }, Lt = (e) => {
1581
- const { url: o, blockProps: t, styles: l, controls: r, videoSource: n, inBuilder: i } = e, a = xt(o, r);
1582
- return /* @__PURE__ */ h("div", { ...se(l, "className"), className: "relative w-full overflow-hidden", style: { paddingBottom: "56.25%" }, children: [
1583
- !a && i ? /* @__PURE__ */ s("div", { className: "absolute flex h-full w-full items-center justify-center bg-gray-300 text-center", children: v(o) ? `Provided ${n} video link in settings Video URL.` : `Provided ${n} video link is invalid.` }) : /* @__PURE__ */ s("iframe", { width: "100%", src: a, ...ae(l, "className") }),
1594
+ const { url: o, blockProps: t, styles: l, controls: r, videoSource: n, inBuilder: i } = e, a = Bt(o, r);
1595
+ return /* @__PURE__ */ f("div", { ...se(l, "className"), className: "relative w-full overflow-hidden", style: { paddingBottom: "56.25%" }, children: [
1596
+ !a && i ? /* @__PURE__ */ s("div", { className: "absolute flex h-full w-full items-center justify-center bg-gray-300 text-center", children: C(o) ? `Provided ${n} video link in settings Video URL.` : `Provided ${n} video link is invalid.` }) : /* @__PURE__ */ s("iframe", { width: "100%", src: a, ...ae(l, "className") }),
1584
1597
  i && /* @__PURE__ */ s("div", { ...t, className: "absolute top-0 h-full w-full" })
1585
1598
  ] });
1586
1599
  }, Pt = (e) => {
1587
1600
  const { url: o, styles: t, controls: l, sources: r, poster: n, blockProps: i } = e;
1588
1601
  let a = n;
1589
- const c = [...f(r, "srcsets", []) || []];
1602
+ const c = [...h(r, "srcsets", []) || []];
1590
1603
  o && typeof o == "string" && c.push({ url: o, width: "9999" });
1591
- const y = c.sort((g, m) => parseInt(g.width) - parseInt(m.width)).filter((g) => !v(g.url) && !v(g.width));
1592
- y.length === 0 && !a && (a = "https://placehold.co/300x200/EEE/ccc?text=Choose%20Video");
1593
- const k = f(l, "autoplay", !1) || f(l, "muted", !0);
1594
- return (a || !v(y)) && /* @__PURE__ */ s("div", { className: "relative w-full overflow-hidden", style: { paddingBottom: "56.25%" }, children: /* @__PURE__ */ w(
1604
+ const m = c.sort((g, y) => parseInt(g.width) - parseInt(y.width)).filter((g) => !C(g.url) && !C(g.width));
1605
+ m.length === 0 && !a && (a = "https://placehold.co/300x200/EEE/ccc?text=Choose%20Video");
1606
+ const k = h(l, "autoplay", !1) || h(l, "muted", !0);
1607
+ return (a || !C(m)) && /* @__PURE__ */ s("div", { className: "relative w-full overflow-hidden", style: { paddingBottom: "56.25%" }, children: /* @__PURE__ */ w(
1595
1608
  "video",
1596
1609
  {
1597
1610
  ...t,
1598
1611
  ...i,
1599
- key: JSON.stringify(y),
1600
- controls: f(l, "controls", !1),
1601
- autoPlay: f(l, "autoplay", !1),
1602
- loop: f(l, "loop", !1),
1612
+ key: JSON.stringify(m),
1613
+ controls: h(l, "controls", !1),
1614
+ autoPlay: h(l, "autoplay", !1),
1615
+ loop: h(l, "loop", !1),
1603
1616
  poster: a,
1604
1617
  ...k ? { muted: !0 } : {}
1605
1618
  },
1606
- y.map((g) => {
1619
+ m.map((g) => {
1607
1620
  if (!g.url || g.url.length < 4 || isNaN(g.width)) return null;
1608
- const m = `(max-width: ${g.width}px)`;
1609
- return /* @__PURE__ */ s("source", { src: g.url, media: m, type: g.type }, g.url);
1621
+ const y = `(max-width: ${g.width}px)`;
1622
+ return /* @__PURE__ */ s("source", { src: g.url, media: y, type: g.type }, g.url);
1610
1623
  }),
1611
1624
  "Your browser does not support the video tag."
1612
1625
  ) });
1613
- }, _t = (e) => {
1626
+ }, St = (e) => {
1614
1627
  const { videoSource: o } = e;
1615
- return o === "Custom" ? /* @__PURE__ */ s(Pt, { ...e }) : o === "Youtube" || o === "Vimeo" ? /* @__PURE__ */ s(Lt, { ...e }) : /* @__PURE__ */ h("div", { children: [
1628
+ return o === "Custom" ? /* @__PURE__ */ s(Pt, { ...e }) : o === "Youtube" || o === "Vimeo" ? /* @__PURE__ */ s(Lt, { ...e }) : /* @__PURE__ */ f("div", { children: [
1616
1629
  "Invalid video source : ",
1617
1630
  o
1618
1631
  ] });
1619
- }, St = {
1632
+ }, _t = {
1620
1633
  type: "Video",
1621
1634
  label: "Video",
1622
1635
  category: "core",
@@ -1624,7 +1637,7 @@ const A = (e, ...o) => ({
1624
1637
  group: "media",
1625
1638
  ...u({
1626
1639
  properties: {
1627
- styles: p("absolute h-full w-full object-cover"),
1640
+ styles: d("absolute h-full w-full object-cover"),
1628
1641
  videoSource: {
1629
1642
  type: "string",
1630
1643
  default: "Custom",
@@ -1655,7 +1668,7 @@ const A = (e, ...o) => ({
1655
1668
  type: "object",
1656
1669
  default: { srcsets: [] }
1657
1670
  },
1658
- controls: { ...Bt }
1671
+ controls: { ...xt }
1659
1672
  }
1660
1673
  }
1661
1674
  },
@@ -1699,22 +1712,51 @@ const A = (e, ...o) => ({
1699
1712
  }
1700
1713
  }),
1701
1714
  i18nProps: ["url"]
1702
- }, Tt = ({ children: e, tag: o, blockProps: t, styles: l }) => b.createElement(o, { ...t, ...l }, e), Nt = {
1715
+ }, Tt = ({
1716
+ children: e,
1717
+ tag: o,
1718
+ blockProps: t,
1719
+ styles: l,
1720
+ inBuilder: r,
1721
+ $loading: n
1722
+ }) => {
1723
+ let i = e;
1724
+ return C(i) && r && (i = /* @__PURE__ */ s("div", { className: "col-span-3 flex items-center justify-center bg-orange-50 p-5", children: "No items found" })), b.createElement(
1725
+ o,
1726
+ { ...t, ...l },
1727
+ n ? Array.from({ length: 2 }).map((a, c) => /* @__PURE__ */ f("div", { className: "animate-pulse rounded-md bg-primary/10 p-5", children: [
1728
+ /* @__PURE__ */ s("div", { className: "h-6 w-1/2 rounded-md bg-primary/10" }),
1729
+ /* @__PURE__ */ s("div", { className: "mt-2 h-4 w-1/2 rounded-md bg-primary/10" })
1730
+ ] }, c)) : i
1731
+ );
1732
+ }, Nt = {
1703
1733
  type: "Repeater",
1704
1734
  label: "Repeater",
1705
- icon: $,
1735
+ icon: E,
1706
1736
  group: "basic",
1737
+ dataProviderDependencies: ["filter", "sort", "limit", "repeaterItems"],
1707
1738
  blocks: () => [
1708
1739
  { _id: "A", _type: "Repeater", tag: "ul" },
1709
- { _id: "B", _type: "RepeaterItem", parentTag: "ul", _parent: "A" }
1740
+ { _id: "B", _name: "Repeater Item", _type: "RepeaterItem", parentTag: "ul", _parent: "A" }
1741
+ // { _id: "C", _name: "Empty State", _type: "RepeaterEmptyState", _parent: "A" },
1742
+ // {
1743
+ // _id: "D",
1744
+ // _name: "Empty State Heading",
1745
+ // _type: "Heading",
1746
+ // _parent: "C",
1747
+ // styles: "#styles:,text-2xl text-center",
1748
+ // content: "No items",
1749
+ // },
1710
1750
  ],
1711
1751
  ...u({
1712
1752
  properties: {
1753
+ styles: P("grid gap-4 md:grid-cols-2 xl:grid-cols-3"),
1713
1754
  repeaterItems: {
1714
1755
  title: "Items",
1715
1756
  type: "string",
1716
1757
  binding: "array",
1717
- default: ""
1758
+ default: "",
1759
+ ui: { "ui:readonly": !0 }
1718
1760
  },
1719
1761
  tag: {
1720
1762
  title: "Tag",
@@ -1722,11 +1764,22 @@ const A = (e, ...o) => ({
1722
1764
  default: "ul",
1723
1765
  enum: ["div", "ul", "ol"]
1724
1766
  },
1725
- styles: T(""),
1726
1767
  limit: {
1727
1768
  title: "Limit",
1728
1769
  type: "number",
1729
- default: ""
1770
+ default: 3
1771
+ },
1772
+ filter: {
1773
+ title: "Filter by",
1774
+ type: "string",
1775
+ default: "",
1776
+ ui: { "ui:widget": "collectionSelect" }
1777
+ },
1778
+ sort: {
1779
+ title: "Sort by",
1780
+ type: "string",
1781
+ default: "",
1782
+ ui: { "ui:widget": "collectionSelect" }
1730
1783
  }
1731
1784
  }
1732
1785
  })
@@ -1751,12 +1804,12 @@ const A = (e, ...o) => ({
1751
1804
  }, Mt = {
1752
1805
  type: "RepeaterItem",
1753
1806
  label: "Repeater Item",
1754
- icon: $,
1807
+ icon: E,
1755
1808
  hidden: !0,
1756
1809
  group: "basic",
1757
1810
  ...u({
1758
1811
  properties: {
1759
- styles: T(""),
1812
+ styles: P(""),
1760
1813
  parentTag: H("Repeater", "tag")
1761
1814
  }
1762
1815
  }),
@@ -1764,9 +1817,25 @@ const A = (e, ...o) => ({
1764
1817
  canDelete: () => !1,
1765
1818
  canMove: () => !1,
1766
1819
  canDuplicate: () => !1
1767
- }, jt = () => {
1768
- d(ye, me), d(xe, Le), d(ge, be), d(Ge, Oe), d(pt, dt), d(wt, Ct), d(ht, kt), d(rt, nt), d(it, st), d(at, ct), d(et, tt), d(ot, lt), d(_t, St), d(ke, we), d(Ce, ve), d(vt, It), d(Se, Te), d(Ne, Re), d(Me, $e), d(Pe, _e), d(He, ze), d(Ve, De), d(je, qe), d(Ee, Ae), d(Ye, We), d(Ie, Be), d(Fe, Ue), d(ut, yt), d(bt, ft), d(mt, gt), d(fe, he), d(Tt, Nt), d(Rt, Mt);
1820
+ }, Et = ({
1821
+ children: e,
1822
+ blockProps: o,
1823
+ styles: t
1824
+ }) => b.createElement("div", { ...o, ...t }, e), $t = {
1825
+ type: "RepeaterEmptyState",
1826
+ label: "Empty State",
1827
+ hidden: !0,
1828
+ group: "basic",
1829
+ ...u({
1830
+ properties: { styles: P("p-5 flex items-center justify-center") }
1831
+ }),
1832
+ canAcceptBlock: () => !0,
1833
+ canDelete: () => !1,
1834
+ canMove: () => !1,
1835
+ canDuplicate: () => !1
1836
+ }, Ft = () => {
1837
+ p(me, ye), p(Be, Le), p(ge, be), p(Ge, Oe), p(pt, dt), p(wt, vt), p(ht, kt), p(rt, nt), p(it, st), p(at, ct), p(et, tt), p(ot, lt), p(St, _t), p(ke, we), p(ve, Ce), p(Ct, It), p(_e, Te), p(Ne, Re), p(Me, Ee), p(Pe, Se), p(He, ze), p(De, je), p(Ve, qe), p($e, Ae), p(Ye, We), p(Ie, xe), p(Fe, Ue), p(ut, mt), p(bt, ft), p(yt, gt), p(fe, he), p(Tt, Nt), p(Rt, Mt), p(Et, $t);
1769
1838
  };
1770
1839
  export {
1771
- jt as loadWebBlocks
1840
+ Ft as loadWebBlocks
1772
1841
  };