@chaibuilder/sdk 2.0.0-beta.15 → 2.0.0-beta.17
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/ChaiThemeFn--DgGggh_.js +190 -0
- package/dist/ChaiThemeFn-bugxb1Cl.cjs +13 -0
- package/dist/{CodeEditor-sNAuI6ze.js → CodeEditor-7Cs6j_Wn.js} +2 -2
- package/dist/{CodeEditor-X6vNIJCu.cjs → CodeEditor-Ifwz-vPV.cjs} +1 -1
- package/dist/STRINGS-26RPxXyi.cjs +1 -0
- package/dist/STRINGS-BnWT5XcX.js +5 -0
- package/dist/{Topbar-qZzyNmon.js → Topbar-J_gRMjOQ.js} +2 -2
- package/dist/{Topbar-vtG8-dxs.cjs → Topbar-tTu3ihcy.cjs} +1 -1
- package/dist/core.cjs +3 -3
- package/dist/core.d.ts +3 -3
- package/dist/core.js +71 -36
- package/dist/plugin-4xaTkTNB.cjs +1 -0
- package/dist/{plugin-LMd_CSyg.js → plugin-GuIj4Ul0.js} +5 -5
- package/dist/render.cjs +2 -2
- package/dist/render.d.ts +4 -0
- package/dist/render.js +33 -31
- package/dist/tailwind.cjs +1 -1
- package/dist/tailwind.d.ts +1 -1
- package/dist/tailwind.js +2 -2
- package/dist/web-blocks.cjs +2 -2
- package/dist/web-blocks.js +293 -212
- package/package.json +1 -1
- package/dist/ChaiThemeFn-6Rmrzvu_.cjs +0 -12
- package/dist/ChaiThemeFn-i9QJeB_e.js +0 -114
- package/dist/STRINGS-hyOI9q1v.js +0 -78
- package/dist/STRINGS-sVplluh6.cjs +0 -1
- package/dist/plugin-TWM10GFj.cjs +0 -1
package/package.json
CHANGED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
"use strict";const i=require("lodash-es");function g(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var _={},m={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t}});function o(r,n){return{handler:r,config:n}}o.withOptions=function(r,n=()=>({})){const a=function(s){return{__options:s,handler:r(s),config:n(s)}};return a.__isOptionsFunction=!0,a.__pluginFunction=r,a.__configFunction=n,a};const t=o})(m);(function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return r}});const o=t(m);function t(n){return n&&n.__esModule?n:{default:n}}const r=o.default})(_);let d=_;var $=(d.__esModule?d:{default:d}).default;const b=g($),y=e=>({fontFamily:e.fontFamily?i.keys(e.fontFamily).reduce((t,r)=>({...t,[r.replace("font-","")]:`var(--${r})`}),{}):{},borderRadius:e.borderRadius?{lg:"var(--radius)",md:"calc(var(--radius) - 2px)",sm:"calc(var(--radius) - 4px)"}:{},colors:e.colors?i.flatten(e.colors.map(t=>Object.entries(t.items))).reduce((t,[r])=>({...t,[r]:`hsl(var(--${r}))`}),{}):{}});function p(e){const o=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);let t=parseInt(o[1],16),r=parseInt(o[2],16),n=parseInt(o[3],16);t/=255,r/=255,n/=255;const a=Math.max(t,r,n),s=Math.min(t,r,n);let u,c;const f=(a+s)/2;if(a==s)u=c=0;else{const l=a-s;switch(c=f>.5?l/(2-a-s):l/(a+s),a){case t:u=(r-n)/l+(r<n?6:0);break;case r:u=(n-t)/l+2;break;case n:u=(t-r)/l+4;break}u/=6}return`${Math.round(u*360)} ${Math.round(c*100)}% ${Math.round(f*100)}%`}const F=e=>`:root {
|
|
2
|
-
${e.fontFamily&&Object.entries(e.fontFamily).map(([o,t])=>`--font-${o}: "${t}";`).join(`
|
|
3
|
-
`)}
|
|
4
|
-
${e.borderRadius&&`--radius: ${e.borderRadius};`}
|
|
5
|
-
${e.colors&&Object.entries(e.colors).map(([o,t])=>`--${o}: ${p(t[0])};`).join(`
|
|
6
|
-
`)}
|
|
7
|
-
}
|
|
8
|
-
.dark {
|
|
9
|
-
${e.colors&&Object.entries(e.colors).map(([o,t])=>`--${o}: ${p(t[1])};`).join(`
|
|
10
|
-
`)}
|
|
11
|
-
}`,j=e=>i.isEmpty(e.fontFamily)?"":i.uniq(Object.entries(e.fontFamily).map(([,t])=>t)).map(t=>`<link rel="stylesheet" href="${`https://fonts.googleapis.com/css2?family=${t.replace(/\s+/g,"+")}&display=swap`}">`).join(`
|
|
12
|
-
`);exports.getChaiThemeCssVariables=F;exports.getChaiThemeOptions=y;exports.getDefaultExportFromCjs=g;exports.getThemeFontsLinkMarkup=j;exports.plugin=b;
|
|
@@ -1,114 +0,0 @@
|
|
|
1
|
-
import { isEmpty as _, uniq as $, keys as m, flatten as b } from "lodash-es";
|
|
2
|
-
function y(t) {
|
|
3
|
-
return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
|
|
4
|
-
}
|
|
5
|
-
var p = {}, g = {};
|
|
6
|
-
(function(t) {
|
|
7
|
-
Object.defineProperty(t, "__esModule", {
|
|
8
|
-
value: !0
|
|
9
|
-
}), Object.defineProperty(t, "default", {
|
|
10
|
-
enumerable: !0,
|
|
11
|
-
get: function() {
|
|
12
|
-
return e;
|
|
13
|
-
}
|
|
14
|
-
});
|
|
15
|
-
function o(r, n) {
|
|
16
|
-
return {
|
|
17
|
-
handler: r,
|
|
18
|
-
config: n
|
|
19
|
-
};
|
|
20
|
-
}
|
|
21
|
-
o.withOptions = function(r, n = () => ({})) {
|
|
22
|
-
const a = function(s) {
|
|
23
|
-
return {
|
|
24
|
-
__options: s,
|
|
25
|
-
handler: r(s),
|
|
26
|
-
config: n(s)
|
|
27
|
-
};
|
|
28
|
-
};
|
|
29
|
-
return a.__isOptionsFunction = !0, a.__pluginFunction = r, a.__configFunction = n, a;
|
|
30
|
-
};
|
|
31
|
-
const e = o;
|
|
32
|
-
})(g);
|
|
33
|
-
(function(t) {
|
|
34
|
-
Object.defineProperty(t, "__esModule", {
|
|
35
|
-
value: !0
|
|
36
|
-
}), Object.defineProperty(t, "default", {
|
|
37
|
-
enumerable: !0,
|
|
38
|
-
get: function() {
|
|
39
|
-
return r;
|
|
40
|
-
}
|
|
41
|
-
});
|
|
42
|
-
const o = /* @__PURE__ */ e(g);
|
|
43
|
-
function e(n) {
|
|
44
|
-
return n && n.__esModule ? n : {
|
|
45
|
-
default: n
|
|
46
|
-
};
|
|
47
|
-
}
|
|
48
|
-
const r = o.default;
|
|
49
|
-
})(p);
|
|
50
|
-
let c = p;
|
|
51
|
-
var F = (c.__esModule ? c : { default: c }).default;
|
|
52
|
-
const M = /* @__PURE__ */ y(F), v = (t) => ({
|
|
53
|
-
fontFamily: t.fontFamily ? m(t.fontFamily).reduce(
|
|
54
|
-
(e, r) => ({
|
|
55
|
-
...e,
|
|
56
|
-
[r.replace("font-", "")]: `var(--${r})`
|
|
57
|
-
}),
|
|
58
|
-
{}
|
|
59
|
-
) : {},
|
|
60
|
-
borderRadius: t.borderRadius ? {
|
|
61
|
-
lg: "var(--radius)",
|
|
62
|
-
md: "calc(var(--radius) - 2px)",
|
|
63
|
-
sm: "calc(var(--radius) - 4px)"
|
|
64
|
-
} : {},
|
|
65
|
-
colors: t.colors ? b(t.colors.map((e) => Object.entries(e.items))).reduce(
|
|
66
|
-
(e, [r]) => ({ ...e, [r]: `hsl(var(--${r}))` }),
|
|
67
|
-
{}
|
|
68
|
-
) : {}
|
|
69
|
-
});
|
|
70
|
-
function f(t) {
|
|
71
|
-
const o = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(t);
|
|
72
|
-
let e = parseInt(o[1], 16), r = parseInt(o[2], 16), n = parseInt(o[3], 16);
|
|
73
|
-
e /= 255, r /= 255, n /= 255;
|
|
74
|
-
const a = Math.max(e, r, n), s = Math.min(e, r, n);
|
|
75
|
-
let l, i;
|
|
76
|
-
const d = (a + s) / 2;
|
|
77
|
-
if (a == s)
|
|
78
|
-
l = i = 0;
|
|
79
|
-
else {
|
|
80
|
-
const u = a - s;
|
|
81
|
-
switch (i = d > 0.5 ? u / (2 - a - s) : u / (a + s), a) {
|
|
82
|
-
case e:
|
|
83
|
-
l = (r - n) / u + (r < n ? 6 : 0);
|
|
84
|
-
break;
|
|
85
|
-
case r:
|
|
86
|
-
l = (n - e) / u + 2;
|
|
87
|
-
break;
|
|
88
|
-
case n:
|
|
89
|
-
l = (e - r) / u + 4;
|
|
90
|
-
break;
|
|
91
|
-
}
|
|
92
|
-
l /= 6;
|
|
93
|
-
}
|
|
94
|
-
return `${Math.round(l * 360)} ${Math.round(i * 100)}% ${Math.round(d * 100)}%`;
|
|
95
|
-
}
|
|
96
|
-
const O = (t) => `:root {
|
|
97
|
-
${t.fontFamily && Object.entries(t.fontFamily).map(([o, e]) => `--font-${o}: "${e}";`).join(`
|
|
98
|
-
`)}
|
|
99
|
-
${t.borderRadius && `--radius: ${t.borderRadius};`}
|
|
100
|
-
${t.colors && Object.entries(t.colors).map(([o, e]) => `--${o}: ${f(e[0])};`).join(`
|
|
101
|
-
`)}
|
|
102
|
-
}
|
|
103
|
-
.dark {
|
|
104
|
-
${t.colors && Object.entries(t.colors).map(([o, e]) => `--${o}: ${f(e[1])};`).join(`
|
|
105
|
-
`)}
|
|
106
|
-
}`, P = (t) => _(t.fontFamily) ? "" : $(Object.entries(t.fontFamily).map(([, e]) => e)).map((e) => `<link rel="stylesheet" href="${`https://fonts.googleapis.com/css2?family=${e.replace(/\s+/g, "+")}&display=swap`}">`).join(`
|
|
107
|
-
`);
|
|
108
|
-
export {
|
|
109
|
-
P as a,
|
|
110
|
-
O as b,
|
|
111
|
-
y as c,
|
|
112
|
-
v as g,
|
|
113
|
-
M as p
|
|
114
|
-
};
|
package/dist/STRINGS-hyOI9q1v.js
DELETED
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
const F = {
|
|
2
|
-
fontFamily: {
|
|
3
|
-
"font-heading": "Inter",
|
|
4
|
-
"font-body": "Inter"
|
|
5
|
-
},
|
|
6
|
-
borderRadius: "10px",
|
|
7
|
-
colors: [
|
|
8
|
-
{
|
|
9
|
-
group: "Body",
|
|
10
|
-
items: {
|
|
11
|
-
background: ["#FFFFFF", "#121212"],
|
|
12
|
-
foreground: ["#121212", "#FFFFFF"]
|
|
13
|
-
}
|
|
14
|
-
},
|
|
15
|
-
{
|
|
16
|
-
group: "Primary",
|
|
17
|
-
items: {
|
|
18
|
-
primary: ["#2563EB", "#3B82F6"],
|
|
19
|
-
"primary-foreground": ["#FFFFFF", "#FFFFFF"]
|
|
20
|
-
}
|
|
21
|
-
},
|
|
22
|
-
{
|
|
23
|
-
group: "Secondary",
|
|
24
|
-
items: {
|
|
25
|
-
secondary: ["#F3F4F6", "#374151"],
|
|
26
|
-
"secondary-foreground": ["#1F2937", "#F9FAFB"]
|
|
27
|
-
}
|
|
28
|
-
},
|
|
29
|
-
{
|
|
30
|
-
group: "Border, Input & Ring",
|
|
31
|
-
items: {
|
|
32
|
-
border: ["#E5E7EB", "#374151"],
|
|
33
|
-
input: ["#E5E7EB", "#374151"],
|
|
34
|
-
ring: ["#2563EB", "#3B82F6"]
|
|
35
|
-
}
|
|
36
|
-
},
|
|
37
|
-
{
|
|
38
|
-
group: "Card",
|
|
39
|
-
items: {
|
|
40
|
-
card: ["#FFFFFF", "#1F2937"],
|
|
41
|
-
"card-foreground": ["#121212", "#FFFFFF"]
|
|
42
|
-
}
|
|
43
|
-
},
|
|
44
|
-
{
|
|
45
|
-
group: "Popover",
|
|
46
|
-
items: {
|
|
47
|
-
popover: ["#FFFFFF", "#1F2937"],
|
|
48
|
-
"popover-foreground": ["#121212", "#FFFFFF"]
|
|
49
|
-
}
|
|
50
|
-
},
|
|
51
|
-
{
|
|
52
|
-
group: "Muted",
|
|
53
|
-
items: {
|
|
54
|
-
muted: ["#F3F4F6", "#374151"],
|
|
55
|
-
"muted-foreground": ["#6B7280", "#9CA3AF"]
|
|
56
|
-
}
|
|
57
|
-
},
|
|
58
|
-
{
|
|
59
|
-
group: "Accent",
|
|
60
|
-
items: {
|
|
61
|
-
accent: ["#F3F4F6", "#374151"],
|
|
62
|
-
"accent-foreground": ["#1F2937", "#FFFFFF"]
|
|
63
|
-
}
|
|
64
|
-
},
|
|
65
|
-
{
|
|
66
|
-
group: "Destructive",
|
|
67
|
-
items: {
|
|
68
|
-
destructive: ["#DC2626", "#EF4444"],
|
|
69
|
-
"destructive-foreground": ["#FFFFFF", "#FFFFFF"]
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
]
|
|
73
|
-
}, r = "#styles:", o = "__ADD_BLOCK_INTERNAL_ROOT";
|
|
74
|
-
export {
|
|
75
|
-
o as R,
|
|
76
|
-
r as S,
|
|
77
|
-
F as d
|
|
78
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";const F={fontFamily:{"font-heading":"Inter","font-body":"Inter"},borderRadius:"10px",colors:[{group:"Body",items:{background:["#FFFFFF","#121212"],foreground:["#121212","#FFFFFF"]}},{group:"Primary",items:{primary:["#2563EB","#3B82F6"],"primary-foreground":["#FFFFFF","#FFFFFF"]}},{group:"Secondary",items:{secondary:["#F3F4F6","#374151"],"secondary-foreground":["#1F2937","#F9FAFB"]}},{group:"Border, Input & Ring",items:{border:["#E5E7EB","#374151"],input:["#E5E7EB","#374151"],ring:["#2563EB","#3B82F6"]}},{group:"Card",items:{card:["#FFFFFF","#1F2937"],"card-foreground":["#121212","#FFFFFF"]}},{group:"Popover",items:{popover:["#FFFFFF","#1F2937"],"popover-foreground":["#121212","#FFFFFF"]}},{group:"Muted",items:{muted:["#F3F4F6","#374151"],"muted-foreground":["#6B7280","#9CA3AF"]}},{group:"Accent",items:{accent:["#F3F4F6","#374151"],"accent-foreground":["#1F2937","#FFFFFF"]}},{group:"Destructive",items:{destructive:["#DC2626","#EF4444"],"destructive-foreground":["#FFFFFF","#FFFFFF"]}}]},r="#styles:",o="__ADD_BLOCK_INTERNAL_ROOT";exports.ROOT_TEMP_KEY=o;exports.STYLES_KEY=r;exports.defaultThemeOptions=F;
|
package/dist/plugin-TWM10GFj.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";const o=require("./ChaiThemeFn-6Rmrzvu_.cjs"),e=n=>({container:{center:!0,padding:"1rem",screens:{"2xl":"1400px"}},...o.getChaiThemeOptions(n)}),r=o.plugin(function({addBase:n,theme:i}){n({"h1,h2,h3,h4,h5,h6":{fontFamily:i("fontFamily.heading")},body:{fontFamily:i("fontFamily.body"),color:i("colors.foreground"),backgroundColor:i("colors.background")}})});exports.chaiBuilderPlugin=r;exports.getChaiBuilderTheme=e;
|