@chaibuilder/sdk 2.1.2 → 2.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.
- package/dist/{CodeEditor-BG4oToVY.cjs → CodeEditor-Ca96GgCc.cjs} +1 -1
- package/dist/{CodeEditor-CdNhJvdd.js → CodeEditor-gWBq2ypP.js} +1 -1
- package/dist/{chai-theme-helpers-BpnwYsLZ.js → chai-theme-helpers-CVkLfKt7.js} +4 -5
- package/dist/chai-theme-helpers-GQ1UI3nD.cjs +22 -0
- package/dist/core.cjs +6 -6
- package/dist/core.js +4060 -7360
- package/dist/{plugin-D56-CF7U.js → plugin-DRtv2KR5.js} +1 -1
- package/dist/{plugin-PDQQ8m4D.cjs → plugin-uUPBh-_c.cjs} +1 -1
- package/dist/render.cjs +1 -1
- package/dist/render.js +3 -3
- package/dist/tailwind.cjs +1 -1
- package/dist/tailwind.js +1 -1
- package/dist/tooltip-BU2vOhlU.js +821 -0
- package/dist/tooltip-CUA6Xg5r.cjs +1 -0
- package/dist/ui.cjs +1 -1
- package/dist/ui.js +2 -2
- package/package.json +1 -1
- package/dist/chai-theme-helpers-D2bHv81c.cjs +0 -22
- package/dist/tooltip-CkYl0YhP.cjs +0 -1
- package/dist/tooltip-D9DF_nUo.js +0 -1900
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const o=require("./chai-theme-helpers-
|
|
1
|
+
"use strict";const o=require("./chai-theme-helpers-GQ1UI3nD.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 S=require("./chai-theme-helpers-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const S=require("./chai-theme-helpers-GQ1UI3nD.cjs"),s=require("lodash-es"),m=require("./getSplitClasses-DodqA_KW.cjs"),F=require("@mhsdesign/jit-browser-tailwindcss"),b=require("@tailwindcss/aspect-ratio"),k=require("@tailwindcss/container-queries"),M=require("@tailwindcss/forms"),N=require("@tailwindcss/typography"),w=require("./plugin-uUPBh-_c.cjs"),g=require("react/jsx-runtime"),T=require("@chaibuilder/runtime"),p=require("react"),Y=require("tailwind-merge"),I=(e,r="")=>{const{classes:n}=m.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(" ")},A=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 F.createTailwindcss({tailwindConfig:{darkMode:"class",safelist:n,theme:{extend:w.getChaiBuilderTheme(e)},plugins:[M,N,b,k,w.chaiBuilderPlugin],corePlugins:{preflight:i},...t?{prefix:`${t}`}:{}}}).generateStylesFromContent(` ${i?"@tailwind base;":""}
|
|
2
2
|
@tailwind components;
|
|
3
3
|
@tailwind utilities;`,r)}const V=(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)},L=async(e,r=S.defaultThemeOptions,n=!1)=>await V(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),g.jsx(p.Suspense,{children:p.createElement(e.component,{...s.omit(e.props,["dataProvider","dataProviderMetadataCallback"]),...s.omit(r,"$metadata"),key:`${e.block._id}-async`})})}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():I(i,r).replace(m.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 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 H(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},{}),X=()=>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=>W(c,n),$=r?s.filter(e,{_parent:r}):s.filter(e,c=>s.isEmpty(c._parent));return s.uniqBy($,"_id").map((c,q)=>{const y={},v=s.filter(h,{_parent:c._id});y.children=v.length>0?g.jsx(E,{externalData:t,classPrefix:n,parent:c._id,blocks:h,lang:o||l,metadata:a,fallbackLang:l,dataProviderMetadataCallback:u},`${c._id}-children`):null;const d=T.getRegisteredChaiBlock(c._type);if(d!==null){let f=c;const _=d.component;f={...d.defaults,...c},i&&(f=i(f));const x=o===l?"":o,O=G(h,c._id,Q(c._type)),C=j(H(c,x,d),t),B=s.omit({blockProps:{},inBuilder:!1,...f,index:q,...C,...P(C),...y,...O,metadata:a,lang:o||l,key:c._id},["_parent"]);if(s.has(d,"dataProvider")){const R=s.get(d,"suspenseFallback",X);return g.jsx(p.Suspense,{fallback:p.createElement(R),children:g.jsx(U,{dataProviderMetadataCallback:u,lang:o||l,metadata:a,dataProvider:d.dataProvider,block:c,component:_,props:B},`${c._id}-async`)},`${c._id}-suspense`)}return g.jsx(p.Suspense,{children:p.createElement(_,B)},`${c._id}-suspense`)}return g.jsxs("noscript",{children:[c._type," not found"]},`${c._id}-noscript`)})}exports.getChaiThemeCssVariables=S.getChaiThemeCssVariables;exports.getThemeFontsCSSImport=S.getThemeFontsCSSImport;exports.getThemeFontsLinkMarkup=S.getThemeFontsLinkMarkup;exports.RenderChaiBlocks=E;exports.convertToBlocks=A;exports.getStylesForBlocks=L;
|
package/dist/render.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { d as Y } from "./chai-theme-helpers-
|
|
2
|
-
import { a as At, b as It, c as Jt } from "./chai-theme-helpers-
|
|
1
|
+
import { d as Y } from "./chai-theme-helpers-CVkLfKt7.js";
|
|
2
|
+
import { a as At, b as It, c as Jt } from "./chai-theme-helpers-CVkLfKt7.js";
|
|
3
3
|
import { last as q, flattenDeep as z, has as v, omit as y, memoize as O, get as d, filter as h, isEmpty as g, uniqBy as D, cloneDeep as E, forEach as x, keys as B, isString as R, isObject as Q, find as _, includes as j } from "lodash-es";
|
|
4
4
|
import { g as F, S } from "./getSplitClasses-DphwgQiE.js";
|
|
5
5
|
import { createTailwindcss as G } from "@mhsdesign/jit-browser-tailwindcss";
|
|
@@ -7,7 +7,7 @@ import H from "@tailwindcss/aspect-ratio";
|
|
|
7
7
|
import L from "@tailwindcss/container-queries";
|
|
8
8
|
import X from "@tailwindcss/forms";
|
|
9
9
|
import Z from "@tailwindcss/typography";
|
|
10
|
-
import { g as k, c as tt } from "./plugin-
|
|
10
|
+
import { g as k, c as tt } from "./plugin-DRtv2KR5.js";
|
|
11
11
|
import { jsx as p, jsxs as et } from "react/jsx-runtime";
|
|
12
12
|
import { getRegisteredChaiBlock as N } from "@chaibuilder/runtime";
|
|
13
13
|
import b, { Suspense as w, createElement as nt } from "react";
|
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"),n=require("@tailwindcss/typography"),d=require("tailwindcss-animate"),r=require("./plugin-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("@tailwindcss/aspect-ratio"),a=require("@tailwindcss/forms"),n=require("@tailwindcss/typography"),d=require("tailwindcss-animate"),r=require("./plugin-uUPBh-_c.cjs");function i(){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:i()},plugins:[d,n,a,o]});exports.chaiBuilderPlugin=r.chaiBuilderPlugin;exports.getChaiBuilderTheme=r.getChaiBuilderTheme;exports.getChaiBuilderTailwindConfig=t;
|
package/dist/tailwind.js
CHANGED
|
@@ -2,7 +2,7 @@ import o from "@tailwindcss/aspect-ratio";
|
|
|
2
2
|
import e from "@tailwindcss/forms";
|
|
3
3
|
import a from "@tailwindcss/typography";
|
|
4
4
|
import d from "tailwindcss-animate";
|
|
5
|
-
import { c as l, g as v } from "./plugin-
|
|
5
|
+
import { c as l, g as v } from "./plugin-DRtv2KR5.js";
|
|
6
6
|
function n() {
|
|
7
7
|
return {
|
|
8
8
|
colors: {
|