@chaibuilder/sdk 3.1.1 → 3.1.3

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,9 +1,9 @@
1
- import { registerChaiBlockSchema as p, StylesProp as u, registerChaiBlock as d, getRegisteredChaiBlock as U, stylesProp as L, closestBlockProp as q } from "@chaibuilder/runtime";
1
+ import { registerChaiBlockSchema as p, StylesProp as u, registerChaiBlock as d, getRegisteredChaiBlock as U, stylesProp as L, closestBlockProp as Z } from "@chaibuilder/runtime";
2
2
  import { jsx as a, jsxs as g, Fragment as N } from "react/jsx-runtime";
3
3
  import { c as _, g as I } from "./common-functions-BGzDsf1z.js";
4
4
  import * as y from "react";
5
5
  import { createElement as w } from "react";
6
- import { ButtonIcon as E, CodeIcon as H, FrameIcon as $, SketchLogoIcon as Z, LayoutIcon as G, RowsIcon as z, DividerHorizontalIcon as W, CheckboxIcon as O, FileTextIcon as Y, InputIcon as j, LetterCaseToggleIcon as Q, RadiobuttonIcon as J, DropdownMenuIcon as X, HeadingIcon as K, TableIcon as ee, BorderTopIcon as te, BorderAllIcon as oe, ViewHorizontalIcon as le, DragHandleHorizontalIcon as re, ImageIcon as ne, Link1Icon as ae, ColumnsIcon as ie, TextIcon as se, CursorTextIcon as ce, SpaceBetweenVerticallyIcon as de, VideoIcon as pe, ChevronLeftIcon as ue, ChevronRightIcon as me, LoopIcon as D } from "@radix-ui/react-icons";
6
+ import { ButtonIcon as M, CodeIcon as H, FrameIcon as $, SketchLogoIcon as q, LayoutIcon as G, RowsIcon as j, DividerHorizontalIcon as W, CheckboxIcon as O, FileTextIcon as Y, InputIcon as D, LetterCaseToggleIcon as Q, RadiobuttonIcon as J, DropdownMenuIcon as X, HeadingIcon as K, TableIcon as ee, BorderTopIcon as te, BorderAllIcon as oe, ViewHorizontalIcon as le, DragHandleHorizontalIcon as re, ImageIcon as ne, Link1Icon as ae, ColumnsIcon as ie, TextIcon as se, CursorTextIcon as ce, SpaceBetweenVerticallyIcon as de, VideoIcon as pe, ChevronLeftIcon as ue, ChevronRightIcon as me, LoopIcon as z } from "@radix-ui/react-icons";
7
7
  import { isEmpty as v, get as k, map as R, isNull as ye, omit as V, pick as F } from "lodash-es";
8
8
  const C = ({ className: e = "", inBuilder: o }) => o ? /* @__PURE__ */ a("div", { className: _("pointer-events-none flex h-20 flex-col items-center justify-center p-2", e), children: /* @__PURE__ */ a("div", { className: "h-full w-full rounded bg-gray-200 p-2 dark:bg-gray-800", children: /* @__PURE__ */ a("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, ge = (e) => {
9
9
  const { blockProps: o, inBuilder: t, backgroundImage: l, children: r, tag: n = "div", styles: i } = e;
@@ -80,7 +80,7 @@ const C = ({ className: e = "", inBuilder: o }) => o ? /* @__PURE__ */ a("div",
80
80
  description: "similar to a button element in HTML",
81
81
  label: "Button",
82
82
  category: "core",
83
- icon: E,
83
+ icon: M,
84
84
  group: "basic",
85
85
  ...p({
86
86
  properties: {
@@ -240,7 +240,7 @@ const C = ({ className: e = "", inBuilder: o }) => o ? /* @__PURE__ */ a("div",
240
240
  label: "web_blocks.icon",
241
241
  category: "core",
242
242
  description: "Icon block is used to display an icon/svg.",
243
- icon: Z,
243
+ icon: q,
244
244
  group: "media",
245
245
  ...p({
246
246
  properties: {
@@ -248,7 +248,7 @@ const C = ({ className: e = "", inBuilder: o }) => o ? /* @__PURE__ */ a("div",
248
248
  icon: {
249
249
  type: "string",
250
250
  title: "Icon",
251
- 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>',
251
+ default: '<svg xmlns="http://www.w3.org/2000/svg" class="chai-default-svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-diamond-icon lucide-diamond"><path d="M2.7 10.3a2.41 2.41 0 0 0 0 3.41l7.59 7.59a2.41 2.41 0 0 0 3.41 0l7.59-7.59a2.41 2.41 0 0 0 0-3.41l-7.59-7.59a2.41 2.41 0 0 0-3.41 0Z"/></svg>',
252
252
  ui: { "ui:widget": "icon" }
253
253
  },
254
254
  width: {
@@ -393,7 +393,7 @@ const C = ({ className: e = "", inBuilder: o }) => o ? /* @__PURE__ */ a("div",
393
393
  description: "A row component",
394
394
  label: "Row",
395
395
  group: "basic",
396
- icon: z,
396
+ icon: j,
397
397
  hidden: !0,
398
398
  blocks: () => [
399
399
  { _type: "Row", _id: "row", styles: "#styles:,p-1" },
@@ -423,7 +423,7 @@ const C = ({ className: e = "", inBuilder: o }) => o ? /* @__PURE__ */ a("div",
423
423
  }, Ae = (e) => {
424
424
  const { blockProps: o, styles: t } = e;
425
425
  return w("hr", { ...t, ...o });
426
- }, Me = {
426
+ }, Ee = {
427
427
  type: "Divider",
428
428
  description: "A horizontal line component",
429
429
  label: "Divider",
@@ -435,7 +435,7 @@ const C = ({ className: e = "", inBuilder: o }) => o ? /* @__PURE__ */ a("div",
435
435
  styles: u("bg-gray-900 h-0.5 py-2 my-1")
436
436
  }
437
437
  })
438
- }, Ee = (e) => {
438
+ }, Me = (e) => {
439
439
  const { blockProps: o, styles: t, backgroundImage: l } = e;
440
440
  let r = {};
441
441
  return l && (r = { backgroundImage: `url(${l})` }), y.createElement("div", { ...o, ...t, style: r });
@@ -473,7 +473,7 @@ const C = ({ className: e = "", inBuilder: o }) => o ? /* @__PURE__ */ a("div",
473
473
  defaultChecked: s
474
474
  }
475
475
  );
476
- }, ze = {
476
+ }, je = {
477
477
  type: "Checkbox",
478
478
  label: "web_blocks.checkbox",
479
479
  category: "core",
@@ -512,7 +512,7 @@ const C = ({ className: e = "", inBuilder: o }) => o ? /* @__PURE__ */ a("div",
512
512
  }),
513
513
  aiProps: ["label"],
514
514
  i18nProps: ["label"]
515
- }, je = (e) => {
515
+ }, De = (e) => {
516
516
  const { children: o, blockProps: t, errorMessage: l, successMessage: r, action: n, styles: i, inBuilder: s } = e;
517
517
  let c = o;
518
518
  return o || (c = /* @__PURE__ */ a(C, { inBuilder: s })), /* @__PURE__ */ g(
@@ -537,7 +537,7 @@ const C = ({ className: e = "", inBuilder: o }) => o ? /* @__PURE__ */ a("div",
537
537
  ]
538
538
  }
539
539
  );
540
- }, De = {
540
+ }, ze = {
541
541
  type: "Form",
542
542
  label: "Form",
543
543
  category: "core",
@@ -595,7 +595,7 @@ const C = ({ className: e = "", inBuilder: o }) => o ? /* @__PURE__ */ a("div",
595
595
  type: "FormButton",
596
596
  label: "Submit Button",
597
597
  category: "core",
598
- icon: E,
598
+ icon: M,
599
599
  group: "form",
600
600
  ...p({
601
601
  properties: {
@@ -698,7 +698,7 @@ const C = ({ className: e = "", inBuilder: o }) => o ? /* @__PURE__ */ a("div",
698
698
  organization: { type: "text", autocomplete: "organization" },
699
699
  language: { type: "text", autocomplete: "language" }
700
700
  }[e] || o : o;
701
- }, qe = (e) => {
701
+ }, Ze = (e) => {
702
702
  const {
703
703
  blockProps: o,
704
704
  fieldName: t,
@@ -739,11 +739,11 @@ const C = ({ className: e = "", inBuilder: o }) => o ? /* @__PURE__ */ a("div",
739
739
  defaultValue: h
740
740
  }
741
741
  );
742
- }, Ze = {
742
+ }, qe = {
743
743
  type: "Input",
744
744
  label: "web_blocks.input",
745
745
  category: "core",
746
- icon: j,
746
+ icon: D,
747
747
  group: "form",
748
748
  ...p({
749
749
  properties: {
@@ -1080,7 +1080,7 @@ const C = ({ className: e = "", inBuilder: o }) => o ? /* @__PURE__ */ a("div",
1080
1080
  type: "TextArea",
1081
1081
  label: "web_blocks.textarea",
1082
1082
  category: "core",
1083
- icon: j,
1083
+ icon: D,
1084
1084
  group: "form",
1085
1085
  ...p({
1086
1086
  properties: {
@@ -1469,7 +1469,7 @@ const ct = "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTAwIiBoZWlnaHQ9IjQwMCIgeG
1469
1469
  type: "List",
1470
1470
  description: "A list component",
1471
1471
  label: "List",
1472
- icon: z,
1472
+ icon: j,
1473
1473
  category: "core",
1474
1474
  group: "basic",
1475
1475
  ...p({
@@ -1665,7 +1665,7 @@ const ct = "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTAwIiBoZWlnaHQ9IjQwMCIgeG
1665
1665
  default: !1
1666
1666
  }
1667
1667
  }
1668
- }, A = /^(https?:\/\/)?(www\.)?youtube\.com\/(watch\?v=|embed\/)([a-zA-Z0-9_-]{11})/, M = /(?:https?:\/\/)?(?:www\.)?(?:vimeo\.com\/(?:channels\/[\w]+\/|groups\/[^\/]+\/videos\/|album\/\d+\/video\/|video\/)?|player\.vimeo\.com\/video\/)(\d+)/, Lt = (e, o) => {
1668
+ }, A = /^(https?:\/\/)?(www\.)?youtube\.com\/(watch\?v=|embed\/)([a-zA-Z0-9_-]{11})/, E = /(?:https?:\/\/)?(?:www\.)?(?:vimeo\.com\/(?:channels\/[\w]+\/|groups\/[^\/]+\/videos\/|album\/\d+\/video\/|video\/)?|player\.vimeo\.com\/video\/)(\d+)/, Lt = (e, o) => {
1669
1669
  const t = k(o, "autoplay", !1), l = k(o, "controls", !1), r = k(o, "loop", !1), n = t || k(o, "muted", !0);
1670
1670
  if (A.test(e)) {
1671
1671
  const i = e.match(A);
@@ -1675,8 +1675,8 @@ const ct = "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTAwIiBoZWlnaHQ9IjQwMCIgeG
1675
1675
  return m += r ? `&loop=1&playlist=${s}` : "", m += n ? "&mute=1&muted=1" : "", m += l ? "&controls=1" : "&controls=0", `${c}?${m}`;
1676
1676
  }
1677
1677
  }
1678
- if (M.test(e)) {
1679
- const i = e.match(M);
1678
+ if (E.test(e)) {
1679
+ const i = e.match(E);
1680
1680
  if (i) {
1681
1681
  const s = i[1];
1682
1682
  let c = "";
@@ -1859,7 +1859,7 @@ const ct = "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTAwIiBoZWlnaHQ9IjQwMCIgeG
1859
1859
  }, At = {
1860
1860
  type: "Repeater",
1861
1861
  label: "Repeater",
1862
- icon: D,
1862
+ icon: z,
1863
1863
  group: "basic",
1864
1864
  description: "Repeater block is used to display a list of items based on data binding in repeaterItems",
1865
1865
  dataProviderMode: "live",
@@ -1951,7 +1951,7 @@ const ct = "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTAwIiBoZWlnaHQ9IjQwMCIgeG
1951
1951
  ]
1952
1952
  }),
1953
1953
  canAcceptBlock: (e) => e === "Pagination"
1954
- }, Mt = ({
1954
+ }, Et = ({
1955
1955
  children: e,
1956
1956
  blockProps: o,
1957
1957
  styles: t,
@@ -1974,16 +1974,16 @@ const ct = "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTAwIiBoZWlnaHQ9IjQwMCIgeG
1974
1974
  { ...o, ...t },
1975
1975
  /* @__PURE__ */ a("div", { className: "col-span-3 flex items-center justify-center bg-orange-50 p-5 text-sm text-muted-foreground", children: "Add children to repeater item" })
1976
1976
  ) : y.createElement(n, { ...o, ...t }, e);
1977
- }, Et = {
1977
+ }, Mt = {
1978
1978
  type: "RepeaterItem",
1979
1979
  label: "Repeater Item",
1980
- icon: D,
1980
+ icon: z,
1981
1981
  hidden: !0,
1982
1982
  group: "basic",
1983
1983
  ...p({
1984
1984
  properties: {
1985
1985
  styles: L(""),
1986
- parentTag: q("Repeater", "tag")
1986
+ parentTag: Z("Repeater", "tag")
1987
1987
  }
1988
1988
  }),
1989
1989
  canAcceptBlock: (e) => e !== "RepeaterItem",
@@ -2006,9 +2006,9 @@ const ct = "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTAwIiBoZWlnaHQ9IjQwMCIgeG
2006
2006
  canDelete: () => !1,
2007
2007
  canMove: () => !1,
2008
2008
  canDuplicate: () => !1
2009
- }, qt = () => {
2010
- d(ge, be), d(Ee, He), d(fe, he), d(et, tt), d(ht, kt), d(vt, Ct), d(xt, wt), d(ut, mt), d(yt, gt), d(bt, ft), d(Pe, Le), d(dt, pt), d(Nt, _t), d(ke, xe), d(we, ve), d(It, Pt), d(je, De), d(Ve, Fe), d(qe, Ze), d($e, ze), d(Oe, Ye), d(Qe, Je), d(Xe, Ke), d(Ge, We), d(ot, lt), d(Ae, Me), d(Ce, Ie), d(Be, Se), d(Te, Re), d(Ne, _e), d(Rt, At), d(Mt, Et), d(Ht, $t);
2009
+ }, Zt = () => {
2010
+ d(ge, be), d(Me, He), d(fe, he), d(et, tt), d(ht, kt), d(vt, Ct), d(xt, wt), d(ut, mt), d(yt, gt), d(bt, ft), d(Pe, Le), d(dt, pt), d(Nt, _t), d(ke, xe), d(we, ve), d(It, Pt), d(De, ze), d(Ve, Fe), d(Ze, qe), d($e, je), d(Oe, Ye), d(Qe, Je), d(Xe, Ke), d(Ge, We), d(ot, lt), d(Ae, Ee), d(Ce, Ie), d(Be, Se), d(Te, Re), d(Ne, _e), d(Rt, At), d(Et, Mt), d(Ht, $t);
2011
2011
  };
2012
2012
  export {
2013
- qt as loadWebBlocks
2013
+ Zt as loadWebBlocks
2014
2014
  };
package/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "author": "Suraj Air",
6
6
  "license": "BSD-3-Clause",
7
7
  "homepage": "https://chaibuilder.com",
8
- "version": "3.1.1",
8
+ "version": "3.1.3",
9
9
  "type": "module",
10
10
  "repository": {
11
11
  "type": "git",