@chaibuilder/sdk 2.1.8 → 2.2.0
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/{chai-theme-helpers-GQ1UI3nD.cjs → chai-theme-helpers-BjWE6otR.cjs} +6 -6
- package/dist/{chai-theme-helpers-CVkLfKt7.js → chai-theme-helpers-FO9vdd-R.js} +5 -4
- package/dist/core.cjs +12 -4
- package/dist/core.d.ts +0 -1
- package/dist/core.js +943 -867
- package/dist/{plugin-DRtv2KR5.js → plugin-B09c0d5S.js} +1 -1
- package/dist/{plugin-uUPBh-_c.cjs → plugin-BiiuylVf.cjs} +1 -1
- package/dist/render.cjs +2 -2
- package/dist/render.d.ts +12 -4
- package/dist/render.js +152 -142
- package/dist/tailwind.cjs +1 -1
- package/dist/tailwind.js +5 -5
- package/package.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const o=require("./chai-theme-helpers-
|
|
1
|
+
"use strict";const o=require("./chai-theme-helpers-BjWE6otR.cjs"),n=(i=o.defaultThemeOptions)=>({container:{center:!0,padding:"1rem",screens:{"2xl":"1400px"}},...o.getChaiThemeOptions(i)}),r=o.plugin(function({addBase:i,theme:e}){i({"h1,h2,h3,h4,h5,h6":{fontFamily:e("fontFamily.heading")},body:{fontFamily:e("fontFamily.body"),color:e("colors.foreground"),backgroundColor:e("colors.background")}})});exports.chaiBuilderPlugin=r;exports.getChaiBuilderTheme=n;
|
package/dist/render.cjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const m=require("./chai-theme-helpers-BjWE6otR.cjs"),n=require("lodash-es"),R=require("@mhsdesign/jit-browser-tailwindcss"),O=require("@tailwindcss/aspect-ratio"),F=require("@tailwindcss/container-queries"),L=require("@tailwindcss/forms"),M=require("@tailwindcss/typography"),C=require("./plugin-BiiuylVf.cjs"),u=require("react/jsx-runtime"),P=require("@chaibuilder/runtime"),f=require("react"),N=require("tailwind-merge"),p=require("./getSplitClasses-DodqA_KW.cjs"),A=e=>{if(!e)return[];try{return JSON.parse(I(e)).filter(t=>!t._type.startsWith("@chai"))}catch{return[{_type:"Paragraph",_id:"error",content:"Invalid JSON. Please check the JSON string."}]}};function I(e){const i=/(asset:\/\/|https:\/\/asset\.localhost\/)(?:localhost\/)?[^"']+/g;return e.replace(i,t=>{const s=decodeURIComponent(t),a=s.indexOf("public");return a!==-1?s.substring(a+6):s})}async function J(e,i,t=[],s="",a){return await R.createTailwindcss({tailwindConfig:{darkMode:"class",safelist:t,theme:{extend:C.getChaiBuilderTheme(e)},plugins:[L,M,O,F,C.chaiBuilderPlugin],corePlugins:{preflight:a},...s?{prefix:`${s}`}:{}}}).generateStylesFromContent(` ${a?"@tailwind base;":""}
|
|
2
2
|
@tailwind components;
|
|
3
|
-
@tailwind utilities;`,
|
|
3
|
+
@tailwind utilities;`,i)}const V=(e,i,t)=>{const s=JSON.stringify(e).replace(/#styles:([^"]*)/g,(a,c)=>`#styles:${c.replace(/,/g," ")}`.replace(/#styles:/g,""));return J(i,[s],[],"",t)},Y=async(e,i=m.defaultThemeOptions,t=!1)=>await V(e,i,t);async function K(e){const i=e.forwardProps?await e.dataProvider({...e.forwardProps,...e.block,lang:e.lang,draft:e.draft,inBuilder:e.inBuilder}):await e.dataProvider(e.block,e.lang,e.metadata??{});return n.has(i,"$metadata")&&e.dataProviderMetadataCallback(e.block,i.$metadata),u.jsx(f.Suspense,{children:f.createElement(e.component,{...n.omit(e.props,["dataProvider","dataProviderMetadataCallback"]),...n.omit(i,"$metadata"),key:`${e.block._id}-async`})})}const z=n.memoize(e=>{const{baseClasses:i,classes:t}=p.getSplitChaiClasses(e);return N.twMerge(i,t).replace(p.STYLES_KEY,"").trim()}),T=(e,i)=>{const t=n.cloneDeep(e);return n.forEach(n.keys(t),s=>{if(n.isString(t[s])){let a=t[s];const c=/\{\{(.*?)\}\}/g,l=a.match(c);l&&l.forEach(o=>{const d=o.slice(2,-2),h=n.get(i,d,o);a=a.replace(o,h)}),t[s]=a}n.isObject(t[s])&&(t[s]=T(t[s],i))}),t};function U(e,i){const t=n.get(e,`${i}_attrs`,{}),s=n.keys(t).join(" ");return n.includes(s,"x-show")&&!n.includes(s,"x-transition")&&(t["x-transition"]=""),t}function W(e){const i={};return Object.keys(e).forEach(t=>{if(n.isString(e[t])&&e[t].startsWith(p.STYLES_KEY)){const s=z(e[t]);i[t]={className:s,...U(e,t)}}}),i}function D(e,i,t){if(n.isEmpty(i))return e;const s=n.cloneDeep(e),a=n.get(t,"i18nProps",[]);return n.forEach(n.keys(s),c=>{a.includes(c)&&!n.isEmpty(i)&&(s[c]=n.get(s,`${c}-${i}`,s[c]))}),s}const H=n.memoize(e=>{const i=P.getRegisteredChaiBlock(e),t=n.get(i,"schema.properties",{});return Object.fromEntries(Object.entries(t).filter(([,s])=>n.get(s,"runtime",!1)))}),G=(e,i,t)=>n.isEmpty(t)?{}:Object.entries(t).reduce((s,[a,c])=>{const l=[];let o=n.find(e,{_id:i});for(;o;)l.push(o),o=n.find(e,{_id:o._parent});const d=n.find(l,{_type:c.block});return d&&(s[a]=n.get(d,n.get(c,"prop"),null)),s},{}),Q=()=>u.jsx("span",{children:"Loading..."});function X(e){n.has(e,"metadata")&&console.warn(" metadata is deprecated and will be removed in upcoming version, use forwardProps instead");const i=e.lang??"en",t=e.fallbackLang??i;return u.jsx(j,{...e,lang:i,fallbackLang:t})}function j({blocks:e,parent:i,externalData:t={},lang:s="en",fallbackLang:a="en",metadata:c={},forwardProps:l={},dataProviderMetadataCallback:o=()=>{},draft:d=!1}){const h=e,x=r=>W(r),E=i?n.filter(e,{_parent:i}):n.filter(e,r=>n.isEmpty(r._parent));return n.uniqBy(E,"_id").map((r,b)=>{const S={},k=n.filter(h,{_parent:r._id});S.children=k.length>0?u.jsx(j,{externalData:t,parent:r._id,blocks:h,lang:s,fallbackLang:a,forwardProps:l,dataProviderMetadataCallback:o,draft:d,metadata:c},`${r._id}-children`):null;const g=P.getRegisteredChaiBlock(r._type);if(g!==null){let y=r;const _=g.component;y={...g.defaults,...r};const v=s===a?"":s,$=G(h,r._id,H(r._type)),w=T(D(r,v,g),t),B=n.omit({...l,...y,...w,...x(w),...S,...$,index:b,lang:s,key:r._id,draft:d,blockProps:{},inBuilder:!1},["_parent"]);if(n.has(g,"dataProvider")){const q=n.get(g,"suspenseFallback",Q);return u.jsx(f.Suspense,{fallback:f.createElement(q),children:u.jsx(K,{inBuilder:!1,dataProviderMetadataCallback:o,lang:s,metadata:c,dataProvider:g.dataProvider,block:r,component:_,props:B,forwardProps:l,draft:d},`${r._id}-async`)},`${r._id}-suspense`)}return u.jsx(f.Suspense,{children:f.createElement(_,B)},`${r._id}-suspense`)}return u.jsxs("noscript",{children:[r._type," not found"]},`${r._id}-noscript`)})}exports.getChaiThemeCssVariables=m.getChaiThemeCssVariables;exports.getThemeFontsCSSImport=m.getThemeFontsCSSImport;exports.getThemeFontsLinkMarkup=m.getThemeFontsLinkMarkup;exports.RenderChaiBlocks=X;exports.convertToBlocks=A;exports.getStylesForBlocks=Y;
|
package/dist/render.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { ChaiFontViaUrl } from '@chaibuilder/runtime';
|
|
2
|
+
import { JSX as JSX_2 } from 'react/jsx-runtime';
|
|
2
3
|
|
|
3
4
|
declare type BorderRadiusValue = false | string;
|
|
4
5
|
|
|
@@ -34,6 +35,13 @@ export declare const convertToBlocks: (chaiFormatContent: string) => ChaiBlock[]
|
|
|
34
35
|
|
|
35
36
|
export declare const getChaiThemeCssVariables: (chaiTheme: Partial<ChaiBuilderThemeValues>) => string;
|
|
36
37
|
|
|
38
|
+
/**
|
|
39
|
+
* Get the tailwind css for the blocks
|
|
40
|
+
* @param blocks - The blocks to get the tailwind css for
|
|
41
|
+
* @param themeOptions - The theme options to use
|
|
42
|
+
* @param includeBaseStyles - Whether to include the base styles
|
|
43
|
+
* @returns The tailwind css for the blocks
|
|
44
|
+
*/
|
|
37
45
|
export declare const getStylesForBlocks: (blocks: ChaiBlock[], themeOptions?: ChaiBuilderThemeOptions, includeBaseStyles?: boolean) => Promise<string>;
|
|
38
46
|
|
|
39
47
|
export declare const getThemeFontsCSSImport: (fonts: ChaiFontViaUrl[]) => any;
|
|
@@ -42,18 +50,18 @@ export declare const getThemeFontsLinkMarkup: (fonts: ChaiFontViaUrl[]) => any;
|
|
|
42
50
|
|
|
43
51
|
declare type HSLColor = string;
|
|
44
52
|
|
|
45
|
-
export declare function RenderChaiBlocks(
|
|
53
|
+
export declare function RenderChaiBlocks(props: RenderChaiBlocksProps): JSX_2.Element;
|
|
46
54
|
|
|
47
55
|
declare type RenderChaiBlocksProps = {
|
|
48
56
|
blocks: ChaiBlock[];
|
|
49
57
|
parent?: string;
|
|
50
|
-
classPrefix?: string;
|
|
51
58
|
externalData?: Record<string, any>;
|
|
52
|
-
blockModifierCallback?: (block: ChaiBlock) => ChaiBlock;
|
|
53
59
|
lang?: string;
|
|
54
60
|
fallbackLang?: string;
|
|
55
|
-
|
|
61
|
+
forwardProps?: Record<string, any>;
|
|
62
|
+
draft?: boolean;
|
|
56
63
|
dataProviderMetadataCallback?: (block: ChaiBlock, meta: Record<string, any>) => void;
|
|
64
|
+
metadata?: Record<string, any>;
|
|
57
65
|
};
|
|
58
66
|
|
|
59
67
|
declare type VariableKey = string;
|
package/dist/render.js
CHANGED
|
@@ -1,51 +1,41 @@
|
|
|
1
|
-
import { d as
|
|
2
|
-
import { a as
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import
|
|
14
|
-
import {
|
|
15
|
-
const
|
|
16
|
-
|
|
17
|
-
if (a === "") return "";
|
|
18
|
-
if (a.includes(":")) {
|
|
19
|
-
const l = a.split(":");
|
|
20
|
-
return l[l.length - 1] = s + q(l), l.join(":");
|
|
21
|
-
}
|
|
22
|
-
return `${s}${a}`;
|
|
23
|
-
}).join(" "));
|
|
24
|
-
return z(e).join(" ");
|
|
25
|
-
}, Rt = (t) => {
|
|
26
|
-
if (!t) return [];
|
|
1
|
+
import { d as U } from "./chai-theme-helpers-FO9vdd-R.js";
|
|
2
|
+
import { a as ke, b as Fe, c as Ne } from "./chai-theme-helpers-FO9vdd-R.js";
|
|
3
|
+
import { has as S, omit as _, memoize as x, get as l, filter as p, isEmpty as g, uniqBy as W, cloneDeep as O, forEach as T, keys as y, isString as E, isObject as Y, find as h, includes as v } from "lodash-es";
|
|
4
|
+
import { createTailwindcss as q } from "@mhsdesign/jit-browser-tailwindcss";
|
|
5
|
+
import z from "@tailwindcss/aspect-ratio";
|
|
6
|
+
import D from "@tailwindcss/container-queries";
|
|
7
|
+
import G from "@tailwindcss/forms";
|
|
8
|
+
import H from "@tailwindcss/typography";
|
|
9
|
+
import { g as Q, c as X } from "./plugin-B09c0d5S.js";
|
|
10
|
+
import { jsx as m, jsxs as Z } from "react/jsx-runtime";
|
|
11
|
+
import { getRegisteredChaiBlock as R } from "@chaibuilder/runtime";
|
|
12
|
+
import j, { Suspense as w, createElement as ee } from "react";
|
|
13
|
+
import { twMerge as te } from "tailwind-merge";
|
|
14
|
+
import { g as ne, S as k } from "./getSplitClasses-DphwgQiE.js";
|
|
15
|
+
const Oe = (e) => {
|
|
16
|
+
if (!e) return [];
|
|
27
17
|
try {
|
|
28
|
-
return JSON.parse(
|
|
18
|
+
return JSON.parse(se(e)).filter((t) => !t._type.startsWith("@chai"));
|
|
29
19
|
} catch {
|
|
30
20
|
return [{ _type: "Paragraph", _id: "error", content: "Invalid JSON. Please check the JSON string." }];
|
|
31
21
|
}
|
|
32
22
|
};
|
|
33
|
-
function
|
|
23
|
+
function se(e) {
|
|
34
24
|
const s = /(asset:\/\/|https:\/\/asset\.localhost\/)(?:localhost\/)?[^"']+/g;
|
|
35
|
-
return
|
|
36
|
-
const
|
|
37
|
-
return r !== -1 ?
|
|
25
|
+
return e.replace(s, (t) => {
|
|
26
|
+
const n = decodeURIComponent(t), r = n.indexOf("public");
|
|
27
|
+
return r !== -1 ? n.substring(r + 6) : n;
|
|
38
28
|
});
|
|
39
29
|
}
|
|
40
|
-
async function
|
|
41
|
-
return await
|
|
30
|
+
async function ie(e, s, t = [], n = "", r) {
|
|
31
|
+
return await q({
|
|
42
32
|
tailwindConfig: {
|
|
43
33
|
darkMode: "class",
|
|
44
|
-
safelist:
|
|
45
|
-
theme: { extend:
|
|
46
|
-
plugins: [
|
|
34
|
+
safelist: t,
|
|
35
|
+
theme: { extend: Q(e) },
|
|
36
|
+
plugins: [G, H, z, D, X],
|
|
47
37
|
corePlugins: { preflight: r },
|
|
48
|
-
...
|
|
38
|
+
...n ? { prefix: `${n}` } : {}
|
|
49
39
|
}
|
|
50
40
|
}).generateStylesFromContent(
|
|
51
41
|
` ${r ? "@tailwind base;" : ""}
|
|
@@ -54,148 +44,168 @@ async function ot(t, s, n = [], e = "", r) {
|
|
|
54
44
|
s
|
|
55
45
|
);
|
|
56
46
|
}
|
|
57
|
-
const
|
|
58
|
-
const
|
|
59
|
-
return
|
|
60
|
-
},
|
|
61
|
-
async function
|
|
62
|
-
const s =
|
|
63
|
-
|
|
64
|
-
...
|
|
65
|
-
|
|
66
|
-
|
|
47
|
+
const re = (e, s, t) => {
|
|
48
|
+
const n = JSON.stringify(e).replace(/#styles:([^"]*)/g, (r, a) => `#styles:${a.replace(/,/g, " ")}`.replace(/#styles:/g, ""));
|
|
49
|
+
return ie(s, [n], [], "", t);
|
|
50
|
+
}, Te = async (e, s = U, t = !1) => await re(e, s, t);
|
|
51
|
+
async function ae(e) {
|
|
52
|
+
const s = e.forwardProps ? await e.dataProvider({
|
|
53
|
+
...e.forwardProps,
|
|
54
|
+
...e.block,
|
|
55
|
+
lang: e.lang,
|
|
56
|
+
draft: e.draft,
|
|
57
|
+
inBuilder: e.inBuilder
|
|
58
|
+
}) : await e.dataProvider(
|
|
59
|
+
e.block,
|
|
60
|
+
e.lang,
|
|
61
|
+
e.metadata ?? {}
|
|
62
|
+
);
|
|
63
|
+
return S(s, "$metadata") && e.dataProviderMetadataCallback(e.block, s.$metadata), /* @__PURE__ */ m(w, { children: j.createElement(e.component, {
|
|
64
|
+
..._(e.props, ["dataProvider", "dataProviderMetadataCallback"]),
|
|
65
|
+
..._(s, "$metadata"),
|
|
66
|
+
key: `${e.block._id}-async`
|
|
67
67
|
}) });
|
|
68
68
|
}
|
|
69
|
-
const
|
|
70
|
-
const { baseClasses:
|
|
71
|
-
return s
|
|
72
|
-
}),
|
|
73
|
-
const
|
|
74
|
-
return
|
|
75
|
-
if (
|
|
76
|
-
let r = n
|
|
77
|
-
const
|
|
78
|
-
c && c.forEach((
|
|
79
|
-
const
|
|
80
|
-
r = r.replace(
|
|
81
|
-
}), n
|
|
69
|
+
const oe = x((e) => {
|
|
70
|
+
const { baseClasses: s, classes: t } = ne(e);
|
|
71
|
+
return te(s, t).replace(k, "").trim();
|
|
72
|
+
}), F = (e, s) => {
|
|
73
|
+
const t = O(e);
|
|
74
|
+
return T(y(t), (n) => {
|
|
75
|
+
if (E(t[n])) {
|
|
76
|
+
let r = t[n];
|
|
77
|
+
const a = /\{\{(.*?)\}\}/g, c = r.match(a);
|
|
78
|
+
c && c.forEach((o) => {
|
|
79
|
+
const d = o.slice(2, -2), f = l(s, d, o);
|
|
80
|
+
r = r.replace(o, f);
|
|
81
|
+
}), t[n] = r;
|
|
82
82
|
}
|
|
83
|
-
|
|
84
|
-
}),
|
|
83
|
+
Y(t[n]) && (t[n] = F(t[n], s));
|
|
84
|
+
}), t;
|
|
85
85
|
};
|
|
86
|
-
function
|
|
87
|
-
const
|
|
88
|
-
return
|
|
86
|
+
function ce(e, s) {
|
|
87
|
+
const t = l(e, `${s}_attrs`, {}), n = y(t).join(" ");
|
|
88
|
+
return v(n, "x-show") && !v(n, "x-transition") && (t["x-transition"] = ""), t;
|
|
89
89
|
}
|
|
90
|
-
function
|
|
91
|
-
const
|
|
92
|
-
return Object.keys(
|
|
93
|
-
if (
|
|
94
|
-
const
|
|
95
|
-
|
|
96
|
-
className:
|
|
97
|
-
...
|
|
90
|
+
function le(e) {
|
|
91
|
+
const s = {};
|
|
92
|
+
return Object.keys(e).forEach((t) => {
|
|
93
|
+
if (E(e[t]) && e[t].startsWith(k)) {
|
|
94
|
+
const n = oe(e[t]);
|
|
95
|
+
s[t] = {
|
|
96
|
+
className: n,
|
|
97
|
+
...ce(e, t)
|
|
98
98
|
};
|
|
99
99
|
}
|
|
100
|
-
}),
|
|
100
|
+
}), s;
|
|
101
101
|
}
|
|
102
|
-
function
|
|
103
|
-
if (g(s)) return
|
|
104
|
-
const
|
|
105
|
-
return
|
|
106
|
-
r.includes(
|
|
107
|
-
}),
|
|
102
|
+
function de(e, s, t) {
|
|
103
|
+
if (g(s)) return e;
|
|
104
|
+
const n = O(e), r = l(t, "i18nProps", []);
|
|
105
|
+
return T(y(n), (a) => {
|
|
106
|
+
r.includes(a) && !g(s) && (n[a] = l(n, `${a}-${s}`, n[a]));
|
|
107
|
+
}), n;
|
|
108
108
|
}
|
|
109
|
-
const
|
|
110
|
-
const s =
|
|
111
|
-
return Object.fromEntries(Object.entries(
|
|
112
|
-
}),
|
|
109
|
+
const ue = x((e) => {
|
|
110
|
+
const s = R(e), t = l(s, "schema.properties", {});
|
|
111
|
+
return Object.fromEntries(Object.entries(t).filter(([, n]) => l(n, "runtime", !1)));
|
|
112
|
+
}), me = (e, s, t) => g(t) ? {} : Object.entries(t).reduce((n, [r, a]) => {
|
|
113
113
|
const c = [];
|
|
114
|
-
let
|
|
115
|
-
for (;
|
|
116
|
-
c.push(
|
|
117
|
-
const
|
|
118
|
-
return
|
|
119
|
-
}, {}),
|
|
120
|
-
function
|
|
121
|
-
|
|
114
|
+
let o = h(e, { _id: s });
|
|
115
|
+
for (; o; )
|
|
116
|
+
c.push(o), o = h(e, { _id: o._parent });
|
|
117
|
+
const d = h(c, { _type: a.block });
|
|
118
|
+
return d && (n[r] = l(d, l(a, "prop"), null)), n;
|
|
119
|
+
}, {}), fe = () => /* @__PURE__ */ m("span", { children: "Loading..." });
|
|
120
|
+
function Ee(e) {
|
|
121
|
+
S(e, "metadata") && console.warn(" metadata is deprecated and will be removed in upcoming version, use forwardProps instead");
|
|
122
|
+
const s = e.lang ?? "en", t = e.fallbackLang ?? s;
|
|
123
|
+
return /* @__PURE__ */ m(N, { ...e, lang: s, fallbackLang: t });
|
|
124
|
+
}
|
|
125
|
+
function N({
|
|
126
|
+
blocks: e,
|
|
122
127
|
parent: s,
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
lang: o = "",
|
|
127
|
-
fallbackLang: c = "",
|
|
128
|
+
externalData: t = {},
|
|
129
|
+
lang: n = "en",
|
|
130
|
+
fallbackLang: r = "en",
|
|
128
131
|
metadata: a = {},
|
|
129
|
-
|
|
130
|
-
|
|
132
|
+
forwardProps: c = {},
|
|
133
|
+
dataProviderMetadataCallback: o = () => {
|
|
134
|
+
},
|
|
135
|
+
draft: d = !1
|
|
131
136
|
}) {
|
|
132
|
-
const
|
|
133
|
-
return
|
|
134
|
-
const
|
|
135
|
-
|
|
136
|
-
|
|
137
|
+
const f = e, A = (i) => le(i), L = s ? p(e, { _parent: s }) : p(e, (i) => g(i._parent));
|
|
138
|
+
return W(L, "_id").map((i, I) => {
|
|
139
|
+
const B = {}, J = p(f, { _parent: i._id });
|
|
140
|
+
B.children = J.length > 0 ? /* @__PURE__ */ m(
|
|
141
|
+
N,
|
|
137
142
|
{
|
|
138
|
-
externalData:
|
|
139
|
-
classPrefix: n,
|
|
143
|
+
externalData: t,
|
|
140
144
|
parent: i._id,
|
|
141
|
-
blocks:
|
|
142
|
-
lang:
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
dataProviderMetadataCallback:
|
|
145
|
+
blocks: f,
|
|
146
|
+
lang: n,
|
|
147
|
+
fallbackLang: r,
|
|
148
|
+
forwardProps: c,
|
|
149
|
+
dataProviderMetadataCallback: o,
|
|
150
|
+
draft: d,
|
|
151
|
+
metadata: a
|
|
146
152
|
},
|
|
147
153
|
`${i._id}-children`
|
|
148
154
|
) : null;
|
|
149
|
-
const u =
|
|
155
|
+
const u = R(i._type);
|
|
150
156
|
if (u !== null) {
|
|
151
|
-
let
|
|
152
|
-
const
|
|
153
|
-
|
|
154
|
-
const
|
|
157
|
+
let P = i;
|
|
158
|
+
const C = u.component;
|
|
159
|
+
P = { ...u.defaults, ...i };
|
|
160
|
+
const M = n === r ? "" : n, V = me(f, i._id, ue(i._type)), $ = F(de(i, M, u), t), b = _(
|
|
155
161
|
{
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
...f,
|
|
159
|
-
index: M,
|
|
162
|
+
...c,
|
|
163
|
+
...P,
|
|
160
164
|
...$,
|
|
161
|
-
...
|
|
162
|
-
...
|
|
163
|
-
...
|
|
164
|
-
|
|
165
|
-
lang:
|
|
166
|
-
key: i._id
|
|
165
|
+
...A($),
|
|
166
|
+
...B,
|
|
167
|
+
...V,
|
|
168
|
+
index: I,
|
|
169
|
+
lang: n,
|
|
170
|
+
key: i._id,
|
|
171
|
+
draft: d,
|
|
172
|
+
blockProps: {},
|
|
173
|
+
inBuilder: !1
|
|
167
174
|
},
|
|
168
175
|
["_parent"]
|
|
169
176
|
);
|
|
170
|
-
if (
|
|
171
|
-
const
|
|
172
|
-
return /* @__PURE__ */
|
|
173
|
-
|
|
177
|
+
if (S(u, "dataProvider")) {
|
|
178
|
+
const K = l(u, "suspenseFallback", fe);
|
|
179
|
+
return /* @__PURE__ */ m(w, { fallback: ee(K), children: /* @__PURE__ */ m(
|
|
180
|
+
ae,
|
|
174
181
|
{
|
|
175
|
-
|
|
176
|
-
|
|
182
|
+
inBuilder: !1,
|
|
183
|
+
dataProviderMetadataCallback: o,
|
|
184
|
+
lang: n,
|
|
177
185
|
metadata: a,
|
|
178
186
|
dataProvider: u.dataProvider,
|
|
179
187
|
block: i,
|
|
180
|
-
component:
|
|
181
|
-
props:
|
|
188
|
+
component: C,
|
|
189
|
+
props: b,
|
|
190
|
+
forwardProps: c,
|
|
191
|
+
draft: d
|
|
182
192
|
},
|
|
183
193
|
`${i._id}-async`
|
|
184
194
|
) }, `${i._id}-suspense`);
|
|
185
195
|
}
|
|
186
|
-
return /* @__PURE__ */
|
|
196
|
+
return /* @__PURE__ */ m(w, { children: j.createElement(C, b) }, `${i._id}-suspense`);
|
|
187
197
|
}
|
|
188
|
-
return /* @__PURE__ */
|
|
198
|
+
return /* @__PURE__ */ Z("noscript", { children: [
|
|
189
199
|
i._type,
|
|
190
200
|
" not found"
|
|
191
201
|
] }, `${i._id}-noscript`);
|
|
192
202
|
});
|
|
193
203
|
}
|
|
194
204
|
export {
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
205
|
+
Ee as RenderChaiBlocks,
|
|
206
|
+
Oe as convertToBlocks,
|
|
207
|
+
ke as getChaiThemeCssVariables,
|
|
208
|
+
Te as getStylesForBlocks,
|
|
209
|
+
Fe as getThemeFontsCSSImport,
|
|
210
|
+
Ne as getThemeFontsLinkMarkup
|
|
201
211
|
};
|
package/dist/tailwind.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("@tailwindcss/aspect-ratio"),a=require("@tailwindcss/forms"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("@tailwindcss/aspect-ratio"),a=require("@tailwindcss/forms"),i=require("@tailwindcss/typography"),n=require("tailwindcss-animate"),r=require("./plugin-BiiuylVf.cjs");function d(){return{colors:{border:"hsl(var(--border))",input:"hsl(var(--input))",ring:"hsl(var(--ring))",background:"hsl(var(--background))",foreground:"hsl(var(--foreground))",primary:{DEFAULT:"hsl(var(--primary))",foreground:"hsl(var(--primary-foreground))"},secondary:{DEFAULT:"hsl(var(--secondary))",foreground:"hsl(var(--secondary-foreground))"},destructive:{DEFAULT:"hsl(var(--destructive))",foreground:"hsl(var(--destructive-foreground))"},muted:{DEFAULT:"hsl(var(--muted))",foreground:"hsl(var(--muted-foreground))"},accent:{DEFAULT:"hsl(var(--accent))",foreground:"hsl(var(--accent-foreground))"},popover:{DEFAULT:"hsl(var(--popover))",foreground:"hsl(var(--popover-foreground))"},card:{DEFAULT:"hsl(var(--card))",foreground:"hsl(var(--card-foreground))"}},borderRadius:{lg:"var(--radius)",md:"calc(var(--radius) - 2px)",sm:"calc(var(--radius) - 4px)"},keyframes:{"accordion-down":{from:{height:"0"},to:{height:"var(--radix-accordion-content-height)"}},"accordion-up":{from:{height:"var(--radix-accordion-content-height)"},to:{height:"0"}}},animation:{"accordion-down":"accordion-down 0.2s ease-out","accordion-up":"accordion-up 0.2s ease-out"}}}const t=e=>({darkMode:"class",content:[...e,"node_modules/@chaibuilder/sdk/dist/*.{js,cjs}"],theme:{extend:d()},plugins:[n,i,a,o]});exports.chaiBuilderPlugin=r.chaiBuilderPlugin;exports.getChaiBuilderTheme=r.getChaiBuilderTheme;exports.getChaiBuilderTailwindConfig=t;
|
package/dist/tailwind.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import o from "@tailwindcss/aspect-ratio";
|
|
2
|
-
import
|
|
3
|
-
import
|
|
2
|
+
import a from "@tailwindcss/forms";
|
|
3
|
+
import e from "@tailwindcss/typography";
|
|
4
4
|
import d from "tailwindcss-animate";
|
|
5
|
-
import { c as
|
|
5
|
+
import { c as g, g as v } from "./plugin-B09c0d5S.js";
|
|
6
6
|
function n() {
|
|
7
7
|
return {
|
|
8
8
|
colors: {
|
|
@@ -67,10 +67,10 @@ const u = (r) => ({
|
|
|
67
67
|
theme: {
|
|
68
68
|
extend: n()
|
|
69
69
|
},
|
|
70
|
-
plugins: [d,
|
|
70
|
+
plugins: [d, e, a, o]
|
|
71
71
|
});
|
|
72
72
|
export {
|
|
73
|
-
|
|
73
|
+
g as chaiBuilderPlugin,
|
|
74
74
|
u as getChaiBuilderTailwindConfig,
|
|
75
75
|
v as getChaiBuilderTheme
|
|
76
76
|
};
|
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.
|
|
8
|
+
"version": "2.2.0",
|
|
9
9
|
"type": "module",
|
|
10
10
|
"repository": {
|
|
11
11
|
"type": "git",
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
}
|
|
54
54
|
},
|
|
55
55
|
"peerDependencies": {
|
|
56
|
-
"@chaibuilder/runtime": "2.0.
|
|
56
|
+
"@chaibuilder/runtime": "2.0.8",
|
|
57
57
|
"@types/react": "*",
|
|
58
58
|
"@types/react-dom": "*",
|
|
59
59
|
"jotai": "2.12.1",
|
|
@@ -70,7 +70,7 @@
|
|
|
70
70
|
},
|
|
71
71
|
"dependencies": {
|
|
72
72
|
"@ai-sdk/react": "^1.2.2",
|
|
73
|
-
"@chaibuilder/runtime": "2.0.
|
|
73
|
+
"@chaibuilder/runtime": "2.0.8",
|
|
74
74
|
"@floating-ui/dom": "1.6.13",
|
|
75
75
|
"@floating-ui/react-dom": "2.1.2",
|
|
76
76
|
"@mhsdesign/jit-browser-tailwindcss": "0.4.2",
|