@chaibuilder/sdk 2.0.0 → 2.0.2

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.
package/dist/render.cjs CHANGED
@@ -1,3 +1,3 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const S=require("./ChaiThemeFn-DQu-2Eh9.cjs"),s=require("lodash-es"),m=require("./getSplitClasses-DodqA_KW.cjs"),R=require("@mhsdesign/jit-browser-tailwindcss"),$=require("@tailwindcss/aspect-ratio"),k=require("@tailwindcss/container-queries"),M=require("@tailwindcss/forms"),N=require("@tailwindcss/typography"),_=require("./plugin-2xcljWGM.cjs"),d=require("react/jsx-runtime"),j=require("@chaibuilder/runtime"),p=require("react"),Y=require("tailwind-merge"),A=(e,r="")=>{const{classes:n}=m.getSplitChaiClasses(e),t=n.split(" ").map(i=>i.split(" ").map(c=>{if(c==="")return"";if(c.includes(":")){const u=c.split(":");return u[u.length-1]=r+s.last(u),u.join(":")}return`${r}${c}`}).join(" "));return s.flattenDeep(t).join(" ")},I=e=>{if(!e)return[];try{return JSON.parse(J(e)).filter(n=>!n._type.startsWith("@chai"))}catch{return[{_type:"Paragraph",_id:"error",content:"Invalid JSON. Please check the JSON string."}]}};function J(e){const r=/(asset:\/\/|https:\/\/asset\.localhost\/)(?:localhost\/)?[^"']+/g;return e.replace(r,n=>{const t=decodeURIComponent(n),i=t.indexOf("public");return i!==-1?t.substring(i+6):t})}async function K(e,r,n=[],t="",i){return await R.createTailwindcss({tailwindConfig:{darkMode:"class",safelist:n,theme:{extend:_.getChaiBuilderTheme(e)},plugins:[M,N,$,k,_.chaiBuilderPlugin],corePlugins:{preflight:i},...t?{prefix:`${t}`}:{}}}).generateStylesFromContent(` ${i?"@tailwind base;":""}
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const S=require("./ChaiThemeFn-DQu-2Eh9.cjs"),s=require("lodash-es"),f=require("./getSplitClasses-DodqA_KW.cjs"),$=require("@mhsdesign/jit-browser-tailwindcss"),b=require("@tailwindcss/aspect-ratio"),F=require("@tailwindcss/container-queries"),k=require("@tailwindcss/forms"),M=require("@tailwindcss/typography"),B=require("./plugin-2xcljWGM.cjs"),g=require("react/jsx-runtime"),T=require("@chaibuilder/runtime"),p=require("react"),N=require("tailwind-merge"),Y=(e,r="")=>{const{classes:n}=f.getSplitChaiClasses(e),t=n.split(" ").map(i=>i.split(" ").map(a=>{if(a==="")return"";if(a.includes(":")){const u=a.split(":");return u[u.length-1]=r+s.last(u),u.join(":")}return`${r}${a}`}).join(" "));return s.flattenDeep(t).join(" ")},I=e=>{if(!e)return[];try{return JSON.parse(A(e)).filter(n=>!n._type.startsWith("@chai"))}catch{return[{_type:"Paragraph",_id:"error",content:"Invalid JSON. Please check the JSON string."}]}};function A(e){const r=/(asset:\/\/|https:\/\/asset\.localhost\/)(?:localhost\/)?[^"']+/g;return e.replace(r,n=>{const t=decodeURIComponent(n),i=t.indexOf("public");return i!==-1?t.substring(i+6):t})}async function J(e,r,n=[],t="",i){return await $.createTailwindcss({tailwindConfig:{darkMode:"class",safelist:n,theme:{extend:B.getChaiBuilderTheme(e)},plugins:[k,M,b,F,B.chaiBuilderPlugin],corePlugins:{preflight:i},...t?{prefix:`${t}`}:{}}}).generateStylesFromContent(` ${i?"@tailwind base;":""}
2
2
  @tailwind components;
3
- @tailwind utilities;`,r)}const L=(e,r,n)=>{const t=JSON.stringify(e).replace(/#styles:([^"]*)/g,(i,o)=>`#styles:${o.replace(/,/g," ")}`.replace(/#styles:/g,""));return K(r,[t],[],"",n)},V=async(e,r=S.defaultThemeOptions,n=!1)=>await L(e,r,n);async function U(e){const r=await(e==null?void 0:e.dataProvider(e.block,e.lang,e.metadata));return s.has(r,"$metadata")&&e.dataProviderMetadataCallback(e.block,r.$metadata),d.jsx(p.Suspense,{children:p.createElement(e.component,{...s.omit(e.props,["dataProvider","dataProviderMetadataCallback"]),...s.omit(r,"$metadata")})})}const z=s.memoize((e,r)=>{const{baseClasses:n,classes:t}=m.getSplitChaiClasses(e),i=Y.twMerge(n,t);return r===""?i.replace(m.STYLES_KEY,"").trim():A(i,r).replace(m.STYLES_KEY,"").trim()}),B=(e,r)=>{const n=s.cloneDeep(e);return s.forEach(s.keys(n),t=>{if(s.isString(n[t])){let i=n[t];const o=/\{\{(.*?)\}\}/g,l=i.match(o);l&&l.forEach(c=>{const u=c.slice(2,-2),h=s.get(r,u,c);i=i.replace(c,h)}),n[t]=i}s.isObject(n[t])&&(n[t]=B(n[t],r))}),n};function D(e,r){const n=s.get(e,`${r}_attrs`,{}),t=s.keys(n).join(" ");return s.includes(t,"x-show")&&!s.includes(t,"x-transition")&&(n["x-transition"]=""),n}function W(e,r){const n={};return Object.keys(e).forEach(t=>{if(s.isString(e[t])&&e[t].startsWith(m.STYLES_KEY)){const i=z(e[t],r);n[t]={className:i,...D(e,t)}}}),n}function Q(e,r,n){if(s.isEmpty(r))return e;const t=s.cloneDeep(e),i=s.get(n,"i18nProps",[]);return s.forEach(s.keys(t),o=>{i.includes(o)&&!s.isEmpty(r)&&(t[o]=s.get(t,`${o}-${r}`,t[o]))}),t}const G=s.memoize(e=>{const r=j.getRegisteredChaiBlock(e),n=s.get(r,"schema.properties",{});return Object.fromEntries(Object.entries(n).filter(([,t])=>s.get(t,"runtime",!1)))}),H=(e,r,n)=>s.isEmpty(n)?{}:Object.entries(n).reduce((t,[i,o])=>{const l=[];let c=s.find(e,{_id:r});for(;c;)l.push(c),c=s.find(e,{_id:c._parent});const u=s.find(l,{_type:o.block});return u&&(t[i]=s.get(u,s.get(o,"prop"),null)),t},{}),X=()=>d.jsx("span",{children:"Loading..."});function E({blocks:e,parent:r,classPrefix:n="",externalData:t={},blockModifierCallback:i=null,lang:o="",fallbackLang:l="",metadata:c={},dataProviderMetadataCallback:u=()=>{}}){const h=e,P=a=>W(a,n),b=r?s.filter(e,{_parent:r}):s.filter(e,a=>s.isEmpty(a._parent));return d.jsx(d.Fragment,{children:p.Children.toArray(b.map((a,v)=>{const C={},x=s.filter(h,{_parent:a._id});C.children=x.length>0?d.jsx(E,{externalData:t,classPrefix:n,parent:a._id,blocks:h,lang:o||l,metadata:c}):null;const g=j.getRegisteredChaiBlock(a._type);if(g!==null){let f=a;const y=g.component;f={...g.defaults,...a},i&&(f=i(f));const q=o===l?"":o,O=H(h,a._id,G(a._type)),w=B(Q(a,q,g),t),T=s.omit({blockProps:{},inBuilder:!1,...f,index:v,...w,...P(w),...C,...O,metadata:c,lang:o||l},["_parent"]);if(s.has(g,"dataProvider")){const F=s.get(g,"suspenseFallback",X);return d.jsx(p.Suspense,{fallback:p.createElement(F),children:d.jsx(U,{dataProviderMetadataCallback:u,lang:o||l,metadata:c,dataProvider:g.dataProvider,block:a,component:y,props:T})})}return d.jsx(p.Suspense,{children:p.createElement(y,T)})}return d.jsxs("noscript",{children:[a._type," not found"]})}))})}exports.getChaiThemeCssVariables=S.getChaiThemeCssVariables;exports.getThemeFontsCSSImport=S.getThemeFontsCSSImport;exports.getThemeFontsLinkMarkup=S.getThemeFontsLinkMarkup;exports.RenderChaiBlocks=E;exports.convertToBlocks=I;exports.getStylesForBlocks=V;
3
+ @tailwind utilities;`,r)}const K=(e,r,n)=>{const t=JSON.stringify(e).replace(/#styles:([^"]*)/g,(i,o)=>`#styles:${o.replace(/,/g," ")}`.replace(/#styles:/g,""));return J(r,[t],[],"",n)},L=async(e,r=S.defaultThemeOptions,n=!1)=>await K(e,r,n);async function V(e){const r=await(e==null?void 0:e.dataProvider(e.block,e.lang,e.metadata));return s.has(r,"$metadata")&&e.dataProviderMetadataCallback(e.block,r.$metadata),g.jsx(p.Suspense,{children:p.createElement(e.component,{...s.omit(e.props,["dataProvider","dataProviderMetadataCallback"]),...s.omit(r,"$metadata")})})}const U=s.memoize((e,r)=>{const{baseClasses:n,classes:t}=f.getSplitChaiClasses(e),i=N.twMerge(n,t);return r===""?i.replace(f.STYLES_KEY,"").trim():Y(i,r).replace(f.STYLES_KEY,"").trim()}),j=(e,r)=>{const n=s.cloneDeep(e);return s.forEach(s.keys(n),t=>{if(s.isString(n[t])){let i=n[t];const o=/\{\{(.*?)\}\}/g,l=i.match(o);l&&l.forEach(a=>{const u=a.slice(2,-2),h=s.get(r,u,a);i=i.replace(a,h)}),n[t]=i}s.isObject(n[t])&&(n[t]=j(n[t],r))}),n};function z(e,r){const n=s.get(e,`${r}_attrs`,{}),t=s.keys(n).join(" ");return s.includes(t,"x-show")&&!s.includes(t,"x-transition")&&(n["x-transition"]=""),n}function D(e,r){const n={};return Object.keys(e).forEach(t=>{if(s.isString(e[t])&&e[t].startsWith(f.STYLES_KEY)){const i=U(e[t],r);n[t]={className:i,...z(e,t)}}}),n}function W(e,r,n){if(s.isEmpty(r))return e;const t=s.cloneDeep(e),i=s.get(n,"i18nProps",[]);return s.forEach(s.keys(t),o=>{i.includes(o)&&!s.isEmpty(r)&&(t[o]=s.get(t,`${o}-${r}`,t[o]))}),t}const Q=s.memoize(e=>{const r=T.getRegisteredChaiBlock(e),n=s.get(r,"schema.properties",{});return Object.fromEntries(Object.entries(n).filter(([,t])=>s.get(t,"runtime",!1)))}),G=(e,r,n)=>s.isEmpty(n)?{}:Object.entries(n).reduce((t,[i,o])=>{const l=[];let a=s.find(e,{_id:r});for(;a;)l.push(a),a=s.find(e,{_id:a._parent});const u=s.find(l,{_type:o.block});return u&&(t[i]=s.get(u,s.get(o,"prop"),null)),t},{}),H=()=>g.jsx("span",{children:"Loading..."});function E({blocks:e,parent:r,classPrefix:n="",externalData:t={},blockModifierCallback:i=null,lang:o="",fallbackLang:l="",metadata:a={},dataProviderMetadataCallback:u=()=>{}}){const h=e,P=c=>D(c,n);return(r?s.filter(e,{_parent:r}):s.filter(e,c=>s.isEmpty(c._parent))).map((c,v)=>{const C={},q=s.filter(h,{_parent:c._id});C.children=q.length>0?g.jsx(E,{externalData:t,classPrefix:n,parent:c._id,blocks:h,lang:o||l,metadata:a},c._id):null;const d=T.getRegisteredChaiBlock(c._type);if(d!==null){let m=c;const y=d.component;m={...d.defaults,...c},i&&(m=i(m));const x=o===l?"":o,O=G(h,c._id,Q(c._type)),_=j(W(c,x,d),t),w=s.omit({blockProps:{},inBuilder:!1,...m,index:v,..._,...P(_),...C,...O,metadata:a,lang:o||l},["_parent"]);if(s.has(d,"dataProvider")){const R=s.get(d,"suspenseFallback",H);return g.jsx(p.Suspense,{fallback:p.createElement(R),children:g.jsx(V,{dataProviderMetadataCallback:u,lang:o||l,metadata:a,dataProvider:d.dataProvider,block:c,component:y,props:w})},c._id)}return g.jsx(p.Suspense,{children:p.createElement(y,w)},c._id)}return g.jsxs("noscript",{children:[c._type," not found"]},c._id)})}exports.getChaiThemeCssVariables=S.getChaiThemeCssVariables;exports.getThemeFontsCSSImport=S.getThemeFontsCSSImport;exports.getThemeFontsLinkMarkup=S.getThemeFontsLinkMarkup;exports.RenderChaiBlocks=E;exports.convertToBlocks=I;exports.getStylesForBlocks=L;
package/dist/render.d.ts CHANGED
@@ -1,5 +1,3 @@
1
- import { JSX as JSX_2 } from 'react/jsx-runtime';
2
-
3
1
  declare type BorderRadiusValue = false | string;
4
2
 
5
3
  declare type ChaiBlock<T = Record<string, any>> = {
@@ -43,7 +41,7 @@ export declare const getThemeFontsLinkMarkup: (chaiTheme: Pick<Partial<ChaiBuild
43
41
 
44
42
  declare type HSLColor = string;
45
43
 
46
- export declare function RenderChaiBlocks({ blocks, parent, classPrefix, externalData, blockModifierCallback, lang, fallbackLang, metadata, dataProviderMetadataCallback, }: RenderChaiBlocksProps): JSX_2.Element;
44
+ export declare function RenderChaiBlocks({ blocks, parent, classPrefix, externalData, blockModifierCallback, lang, fallbackLang, metadata, dataProviderMetadataCallback, }: RenderChaiBlocksProps): any;
47
45
 
48
46
  declare type RenderChaiBlocksProps = {
49
47
  blocks: ChaiBlock[];
package/dist/render.js CHANGED
@@ -1,43 +1,43 @@
1
1
  import { d as W } from "./ChaiThemeFn-Cort9tch.js";
2
- import { a as Nt, b as At, c as It } from "./ChaiThemeFn-Cort9tch.js";
3
- import { last as Y, flattenDeep as z, has as O, omit as _, memoize as $, get as d, filter as h, isEmpty as g, cloneDeep as E, forEach as x, keys as P, isString as R, isObject as D, find as S, includes as j } from "lodash-es";
4
- import { g as F, S as C } from "./getSplitClasses-DphwgQiE.js";
2
+ import { a as Ft, b as Nt, c as At } from "./ChaiThemeFn-Cort9tch.js";
3
+ import { last as Y, flattenDeep as z, has as O, omit as S, memoize as $, get as d, filter as h, isEmpty as g, cloneDeep as E, forEach as x, keys as y, isString as b, isObject as D, find as _, includes as j } from "lodash-es";
4
+ import { g as R, S as C } from "./getSplitClasses-DphwgQiE.js";
5
5
  import { createTailwindcss as L } from "@mhsdesign/jit-browser-tailwindcss";
6
6
  import Q from "@tailwindcss/aspect-ratio";
7
7
  import q from "@tailwindcss/container-queries";
8
8
  import G from "@tailwindcss/forms";
9
9
  import H from "@tailwindcss/typography";
10
10
  import { g as X, c as Z } from "./plugin-kUMxtQR5.js";
11
- import { jsx as p, Fragment as tt, jsxs as et } from "react/jsx-runtime";
12
- import { getRegisteredChaiBlock as N } from "@chaibuilder/runtime";
13
- import y, { Suspense as w, createElement as nt } from "react";
14
- import { twMerge as st } from "tailwind-merge";
15
- const rt = (t, s = "") => {
16
- const { classes: n } = F(t), e = n.split(" ").map((r) => r.split(" ").map((o) => {
17
- if (o === "") return "";
18
- if (o.includes(":")) {
19
- const l = o.split(":");
11
+ import { jsx as p, jsxs as k } from "react/jsx-runtime";
12
+ import { getRegisteredChaiBlock as F } from "@chaibuilder/runtime";
13
+ import N, { Suspense as w, createElement as tt } from "react";
14
+ import { twMerge as et } from "tailwind-merge";
15
+ const nt = (t, s = "") => {
16
+ const { classes: n } = R(t), e = n.split(" ").map((r) => r.split(" ").map((a) => {
17
+ if (a === "") return "";
18
+ if (a.includes(":")) {
19
+ const l = a.split(":");
20
20
  return l[l.length - 1] = s + Y(l), l.join(":");
21
21
  }
22
- return `${s}${o}`;
22
+ return `${s}${a}`;
23
23
  }).join(" "));
24
24
  return z(e).join(" ");
25
25
  }, Et = (t) => {
26
26
  if (!t) return [];
27
27
  try {
28
- return JSON.parse(it(t)).filter((n) => !n._type.startsWith("@chai"));
28
+ return JSON.parse(st(t)).filter((n) => !n._type.startsWith("@chai"));
29
29
  } catch {
30
30
  return [{ _type: "Paragraph", _id: "error", content: "Invalid JSON. Please check the JSON string." }];
31
31
  }
32
32
  };
33
- function it(t) {
33
+ function st(t) {
34
34
  const s = /(asset:\/\/|https:\/\/asset\.localhost\/)(?:localhost\/)?[^"']+/g;
35
35
  return t.replace(s, (n) => {
36
36
  const e = decodeURIComponent(n), r = e.indexOf("public");
37
37
  return r !== -1 ? e.substring(r + 6) : e;
38
38
  });
39
39
  }
40
- async function ot(t, s, n = [], e = "", r) {
40
+ async function rt(t, s, n = [], e = "", r) {
41
41
  return await L({
42
42
  tailwindConfig: {
43
43
  darkMode: "class",
@@ -54,69 +54,69 @@ async function ot(t, s, n = [], e = "", r) {
54
54
  s
55
55
  );
56
56
  }
57
- const at = (t, s, n) => {
57
+ const it = (t, s, n) => {
58
58
  const e = JSON.stringify(t).replace(/#styles:([^"]*)/g, (r, i) => `#styles:${i.replace(/,/g, " ")}`.replace(/#styles:/g, ""));
59
- return ot(s, [e], [], "", n);
60
- }, xt = async (t, s = W, n = !1) => await at(t, s, n);
61
- async function ct(t) {
59
+ return rt(s, [e], [], "", n);
60
+ }, xt = async (t, s = W, n = !1) => await it(t, s, n);
61
+ async function ot(t) {
62
62
  const s = await (t == null ? void 0 : t.dataProvider(t.block, t.lang, t.metadata));
63
- return O(s, "$metadata") && t.dataProviderMetadataCallback(t.block, s.$metadata), /* @__PURE__ */ p(w, { children: y.createElement(t.component, {
64
- ..._(t.props, ["dataProvider", "dataProviderMetadataCallback"]),
65
- ..._(s, "$metadata")
63
+ return O(s, "$metadata") && t.dataProviderMetadataCallback(t.block, s.$metadata), /* @__PURE__ */ p(w, { children: N.createElement(t.component, {
64
+ ...S(t.props, ["dataProvider", "dataProviderMetadataCallback"]),
65
+ ...S(s, "$metadata")
66
66
  }) });
67
67
  }
68
- const lt = $((t, s) => {
69
- const { baseClasses: n, classes: e } = F(t), r = st(n, e);
70
- return s === "" ? r.replace(C, "").trim() : rt(r, s).replace(C, "").trim();
68
+ const at = $((t, s) => {
69
+ const { baseClasses: n, classes: e } = R(t), r = et(n, e);
70
+ return s === "" ? r.replace(C, "").trim() : nt(r, s).replace(C, "").trim();
71
71
  }), A = (t, s) => {
72
72
  const n = E(t);
73
- return x(P(n), (e) => {
74
- if (R(n[e])) {
73
+ return x(y(n), (e) => {
74
+ if (b(n[e])) {
75
75
  let r = n[e];
76
76
  const i = /\{\{(.*?)\}\}/g, c = r.match(i);
77
- c && c.forEach((o) => {
78
- const l = o.slice(2, -2), m = d(s, l, o);
79
- r = r.replace(o, m);
77
+ c && c.forEach((a) => {
78
+ const l = a.slice(2, -2), m = d(s, l, a);
79
+ r = r.replace(a, m);
80
80
  }), n[e] = r;
81
81
  }
82
82
  D(n[e]) && (n[e] = A(n[e], s));
83
83
  }), n;
84
84
  };
85
- function dt(t, s) {
86
- const n = d(t, `${s}_attrs`, {}), e = P(n).join(" ");
85
+ function ct(t, s) {
86
+ const n = d(t, `${s}_attrs`, {}), e = y(n).join(" ");
87
87
  return j(e, "x-show") && !j(e, "x-transition") && (n["x-transition"] = ""), n;
88
88
  }
89
- function ut(t, s) {
89
+ function lt(t, s) {
90
90
  const n = {};
91
91
  return Object.keys(t).forEach((e) => {
92
- if (R(t[e]) && t[e].startsWith(C)) {
93
- const r = lt(t[e], s);
92
+ if (b(t[e]) && t[e].startsWith(C)) {
93
+ const r = at(t[e], s);
94
94
  n[e] = {
95
95
  className: r,
96
- ...dt(t, e)
96
+ ...ct(t, e)
97
97
  };
98
98
  }
99
99
  }), n;
100
100
  }
101
- function pt(t, s, n) {
101
+ function dt(t, s, n) {
102
102
  if (g(s)) return t;
103
103
  const e = E(t), r = d(n, "i18nProps", []);
104
- return x(P(e), (i) => {
104
+ return x(y(e), (i) => {
105
105
  r.includes(i) && !g(s) && (e[i] = d(e, `${i}-${s}`, e[i]));
106
106
  }), e;
107
107
  }
108
- const mt = $((t) => {
109
- const s = N(t), n = d(s, "schema.properties", {});
108
+ const ut = $((t) => {
109
+ const s = F(t), n = d(s, "schema.properties", {});
110
110
  return Object.fromEntries(Object.entries(n).filter(([, e]) => d(e, "runtime", !1)));
111
- }), ft = (t, s, n) => g(n) ? {} : Object.entries(n).reduce((e, [r, i]) => {
111
+ }), pt = (t, s, n) => g(n) ? {} : Object.entries(n).reduce((e, [r, i]) => {
112
112
  const c = [];
113
- let o = S(t, { _id: s });
114
- for (; o; )
115
- c.push(o), o = S(t, { _id: o._parent });
116
- const l = S(c, { _type: i.block });
113
+ let a = _(t, { _id: s });
114
+ for (; a; )
115
+ c.push(a), a = _(t, { _id: a._parent });
116
+ const l = _(c, { _type: i.block });
117
117
  return l && (e[r] = d(l, d(i, "prop"), null)), e;
118
- }, {}), gt = () => /* @__PURE__ */ p("span", { children: "Loading..." });
119
- function ht({
118
+ }, {}), mt = () => /* @__PURE__ */ p("span", { children: "Loading..." });
119
+ function ft({
120
120
  blocks: t,
121
121
  parent: s,
122
122
  classPrefix: n = "",
@@ -124,78 +124,73 @@ function ht({
124
124
  blockModifierCallback: r = null,
125
125
  lang: i = "",
126
126
  fallbackLang: c = "",
127
- metadata: o = {},
127
+ metadata: a = {},
128
128
  dataProviderMetadataCallback: l = () => {
129
129
  }
130
130
  }) {
131
- const m = t, I = (a) => ut(a, n), J = s ? h(t, { _parent: s }) : h(t, (a) => g(a._parent));
132
- return /* @__PURE__ */ p(tt, { children: y.Children.toArray(
133
- J.map((a, M) => {
134
- const B = {}, U = h(m, { _parent: a._id });
135
- B.children = U.length > 0 ? /* @__PURE__ */ p(
136
- ht,
131
+ const m = t, I = (o) => lt(o, n);
132
+ return (s ? h(t, { _parent: s }) : h(t, (o) => g(o._parent))).map((o, J) => {
133
+ const P = {}, M = h(m, { _parent: o._id });
134
+ P.children = M.length > 0 ? /* @__PURE__ */ p(
135
+ ft,
136
+ {
137
+ externalData: e,
138
+ classPrefix: n,
139
+ parent: o._id,
140
+ blocks: m,
141
+ lang: i || c,
142
+ metadata: a
143
+ },
144
+ o._id
145
+ ) : null;
146
+ const u = F(o._type);
147
+ if (u !== null) {
148
+ let f = o;
149
+ const B = u.component;
150
+ f = { ...u.defaults, ...o }, r && (f = r(f));
151
+ const U = i === c ? "" : i, V = pt(m, o._id, ut(o._type)), v = A(dt(o, U, u), e), T = S(
137
152
  {
138
- externalData: e,
139
- classPrefix: n,
140
- parent: a._id,
141
- blocks: m,
142
- lang: i || c,
143
- metadata: o
144
- }
145
- ) : null;
146
- const u = N(a._type);
147
- if (u !== null) {
148
- let f = a;
149
- const b = u.component;
150
- f = { ...u.defaults, ...a }, r && (f = r(f));
151
- const V = i === c ? "" : i, k = ft(m, a._id, mt(a._type)), v = A(pt(a, V, u), e), T = _(
153
+ blockProps: {},
154
+ inBuilder: !1,
155
+ ...f,
156
+ index: J,
157
+ ...v,
158
+ ...I(v),
159
+ ...P,
160
+ ...V,
161
+ metadata: a,
162
+ lang: i || c
163
+ },
164
+ ["_parent"]
165
+ );
166
+ if (O(u, "dataProvider")) {
167
+ const K = d(u, "suspenseFallback", mt);
168
+ return /* @__PURE__ */ p(w, { fallback: tt(K), children: /* @__PURE__ */ p(
169
+ ot,
152
170
  {
153
- blockProps: {},
154
- inBuilder: !1,
155
- ...f,
156
- index: M,
157
- ...v,
158
- ...I(v),
159
- ...B,
160
- ...k,
161
- metadata: o,
162
- lang: i || c
163
- },
164
- ["_parent"]
165
- );
166
- if (O(u, "dataProvider")) {
167
- const K = d(
168
- u,
169
- "suspenseFallback",
170
- gt
171
- );
172
- return /* @__PURE__ */ p(w, { fallback: nt(K), children: /* @__PURE__ */ p(
173
- ct,
174
- {
175
- dataProviderMetadataCallback: l,
176
- lang: i || c,
177
- metadata: o,
178
- dataProvider: u.dataProvider,
179
- block: a,
180
- component: b,
181
- props: T
182
- }
183
- ) });
184
- }
185
- return /* @__PURE__ */ p(w, { children: y.createElement(b, T) });
171
+ dataProviderMetadataCallback: l,
172
+ lang: i || c,
173
+ metadata: a,
174
+ dataProvider: u.dataProvider,
175
+ block: o,
176
+ component: B,
177
+ props: T
178
+ }
179
+ ) }, o._id);
186
180
  }
187
- return /* @__PURE__ */ et("noscript", { children: [
188
- a._type,
189
- " not found"
190
- ] });
191
- })
192
- ) });
181
+ return /* @__PURE__ */ p(w, { children: N.createElement(B, T) }, o._id);
182
+ }
183
+ return /* @__PURE__ */ k("noscript", { children: [
184
+ o._type,
185
+ " not found"
186
+ ] }, o._id);
187
+ });
193
188
  }
194
189
  export {
195
- ht as RenderChaiBlocks,
190
+ ft as RenderChaiBlocks,
196
191
  Et as convertToBlocks,
197
- Nt as getChaiThemeCssVariables,
192
+ Ft as getChaiThemeCssVariables,
198
193
  xt as getStylesForBlocks,
199
- At as getThemeFontsCSSImport,
200
- It as getThemeFontsLinkMarkup
194
+ Nt as getThemeFontsCSSImport,
195
+ At as getThemeFontsLinkMarkup
201
196
  };
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": "2.0.0",
8
+ "version": "2.0.2",
9
9
  "type": "module",
10
10
  "repository": {
11
11
  "type": "git",