@chaibuilder/sdk 2.0.0-beta.2 → 2.0.0-beta.21
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-xhb27i29.js → CodeEditor-7Cs6j_Wn.js} +14 -14
- package/dist/CodeEditor-Ifwz-vPV.cjs +1 -0
- package/dist/STRINGS-26RPxXyi.cjs +1 -0
- package/dist/STRINGS-BnWT5XcX.js +5 -0
- package/dist/Topbar-J_gRMjOQ.js +73 -0
- package/dist/Topbar-tTu3ihcy.cjs +1 -0
- package/dist/context-menu-4nQs6OxC.cjs +1 -0
- package/dist/{context-menu-I8woggB3.js → context-menu-oLipAPzI.js} +237 -254
- package/dist/core.cjs +61 -1
- package/dist/core.d.ts +56 -34
- package/dist/core.js +8598 -107
- package/dist/plugin-4xaTkTNB.cjs +1 -0
- package/dist/plugin-GuIj4Ul0.js +24 -0
- package/dist/render.cjs +2 -2
- package/dist/render.d.ts +34 -16
- package/dist/render.js +119 -121
- package/dist/runtime.cjs +1 -1
- package/dist/runtime.d.ts +0 -1
- package/dist/runtime.js +0 -20
- package/dist/style.css +1 -1
- package/dist/tailwind.cjs +1 -1
- package/dist/tailwind.d.ts +26 -25
- package/dist/tailwind.js +2 -2
- package/dist/ui.cjs +1 -1
- package/dist/ui.js +238 -223
- package/dist/web-blocks.cjs +2 -2
- package/dist/web-blocks.js +1079 -703
- package/package.json +6 -9
- package/dist/CodeEditor-e9zXhHFt.cjs +0 -1
- package/dist/STRINGS-Xxstm-7I.js +0 -7
- package/dist/STRINGS-Yl7cSWDc.cjs +0 -1
- package/dist/Topbar-CofpLWzO.cjs +0 -1
- package/dist/Topbar-xrdjosmc.js +0 -160
- package/dist/context-menu-0lRey9QY.cjs +0 -1
- package/dist/controls-lEwMTdPQ.js +0 -234
- package/dist/controls-p9IwFnPx.cjs +0 -1
- package/dist/index-CHYv1sC2.cjs +0 -63
- package/dist/index-s4RPN00p.js +0 -8540
- package/dist/plugin-UiUFs2fK.js +0 -44
- package/dist/plugin-f6SDZ_Or.js +0 -108
- package/dist/plugin-jum1MjXp.cjs +0 -1
- package/dist/plugin-xOpS-UNV.cjs +0 -1
package/dist/plugin-UiUFs2fK.js
DELETED
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import { get as n, set as d } from "lodash-es";
|
|
2
|
-
import { s as p, p as e } from "./plugin-f6SDZ_Or.js";
|
|
3
|
-
const T = (o) => {
|
|
4
|
-
const r = n(o, "primaryColor", "#000"), a = n(o, "secondaryColor", "#ccc"), s = n(o, "headingFont", "Inter"), i = n(o, "bodyFont", "Inter"), c = n(o, "roundedCorners", "0"), l = n(o, "bodyBgLightColor", "#fff"), g = n(o, "bodyBgDarkColor", "#000"), y = n(o, "bodyTextLightColor", "#000"), b = n(o, "bodyTextDarkColor", "#fff"), t = p({
|
|
5
|
-
colors: [r, a],
|
|
6
|
-
names: ["primary", "secondary"]
|
|
7
|
-
});
|
|
8
|
-
d(t, "primary.DEFAULT", r), d(t, "secondary.DEFAULT", a);
|
|
9
|
-
const f = {
|
|
10
|
-
"bg-light": l,
|
|
11
|
-
"bg-dark": g,
|
|
12
|
-
"text-dark": b,
|
|
13
|
-
"text-light": y
|
|
14
|
-
};
|
|
15
|
-
return {
|
|
16
|
-
container: {
|
|
17
|
-
center: !0,
|
|
18
|
-
padding: "1rem",
|
|
19
|
-
screens: { "2xl": "1400px" }
|
|
20
|
-
},
|
|
21
|
-
fontFamily: { heading: [s], body: [i] },
|
|
22
|
-
borderRadius: { DEFAULT: `${c || "0px"}px` },
|
|
23
|
-
colors: { ...t, ...f }
|
|
24
|
-
};
|
|
25
|
-
}, x = e(function({ addBase: o, theme: r }) {
|
|
26
|
-
o({
|
|
27
|
-
"h1,h2,h3,h4,h5,h6": {
|
|
28
|
-
fontFamily: r("fontFamily.heading")
|
|
29
|
-
},
|
|
30
|
-
body: {
|
|
31
|
-
fontFamily: r("fontFamily.body"),
|
|
32
|
-
color: r("colors.text-light"),
|
|
33
|
-
backgroundColor: r("colors.bg-light")
|
|
34
|
-
},
|
|
35
|
-
".dark body": {
|
|
36
|
-
color: r("colors.text-dark"),
|
|
37
|
-
backgroundColor: r("colors.bg-dark")
|
|
38
|
-
}
|
|
39
|
-
});
|
|
40
|
-
});
|
|
41
|
-
export {
|
|
42
|
-
x as c,
|
|
43
|
-
T as g
|
|
44
|
-
};
|
package/dist/plugin-f6SDZ_Or.js
DELETED
|
@@ -1,108 +0,0 @@
|
|
|
1
|
-
function $(e) {
|
|
2
|
-
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
|
|
3
|
-
}
|
|
4
|
-
var j = ({ hex: e, preserve: o, shades: h }) => {
|
|
5
|
-
const a = ((r) => {
|
|
6
|
-
const i = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(r) || [];
|
|
7
|
-
try {
|
|
8
|
-
let n = parseInt(i[1], 16), s = parseInt(i[2], 16), c = parseInt(i[3], 16);
|
|
9
|
-
n /= 255, s /= 255, c /= 255;
|
|
10
|
-
const d = Math.max(n, s, c), g = Math.min(n, s, c);
|
|
11
|
-
let m, f = 0, p = (d + g) / 2;
|
|
12
|
-
if (d == g)
|
|
13
|
-
f = m = 0;
|
|
14
|
-
else {
|
|
15
|
-
const l = d - g;
|
|
16
|
-
switch (m = p > 0.5 ? l / (2 - d - g) : l / (d + g), d) {
|
|
17
|
-
case n:
|
|
18
|
-
f = (s - c) / l + (s < c ? 6 : 0);
|
|
19
|
-
break;
|
|
20
|
-
case s:
|
|
21
|
-
f = (c - n) / l + 2;
|
|
22
|
-
break;
|
|
23
|
-
case c:
|
|
24
|
-
f = (n - s) / l + 4;
|
|
25
|
-
}
|
|
26
|
-
f /= 6;
|
|
27
|
-
}
|
|
28
|
-
const _ = { h: 0, s: 0, l: 0 };
|
|
29
|
-
return _.h = Math.round(360 * f), _.s = Math.round(100 * m), _.l = Math.round(100 * p), _;
|
|
30
|
-
} catch {
|
|
31
|
-
return console.log(r), { h: 0, s: 0, l: 0 };
|
|
32
|
-
}
|
|
33
|
-
})(e), t = {}, u = h.reduce((r, { name: i, lightness: n }) => {
|
|
34
|
-
const { h: s, s: c, l: d } = a, g = (({ h: m, s: f, l: p }) => {
|
|
35
|
-
p /= 100;
|
|
36
|
-
const _ = f * Math.min(p, 1 - p) / 100, l = (O) => {
|
|
37
|
-
const M = (O + m / 30) % 12, P = p - _ * Math.max(Math.min(M - 3, 9 - M, 1), -1);
|
|
38
|
-
return Math.round(255 * P).toString(16).padStart(2, "0");
|
|
39
|
-
};
|
|
40
|
-
return `#${l(0)}${l(8)}${l(4)}`;
|
|
41
|
-
})({ h: s, s: c, l: n });
|
|
42
|
-
return r[i] = g, o && (t[i] = Math.abs(d - n)), r;
|
|
43
|
-
}, {});
|
|
44
|
-
if (o) {
|
|
45
|
-
const [r] = Object.keys(t).sort((i, n) => t[i] - t[n]);
|
|
46
|
-
u[r] = e;
|
|
47
|
-
}
|
|
48
|
-
return u;
|
|
49
|
-
}, q = (e) => {
|
|
50
|
-
typeof e == "string" && (e = { colors: [e] }), typeof e == "object" && Array.isArray(e) && (e = { colors: e }), e = Object.assign({ colors: [], names: ["primary", "secondary", "tertiary", "quaternary", "quinary", "senary", "septenary", "octonary", "nonary", "denary"], preserve: !0, shades: [{ name: "50", lightness: 98 }, { name: "100", lightness: 95 }, { name: "200", lightness: 90 }, { name: "300", lightness: 82 }, { name: "400", lightness: 64 }, { name: "500", lightness: 46 }, { name: "600", lightness: 33 }, { name: "700", lightness: 24 }, { name: "800", lightness: 14 }, { name: "900", lightness: 7 }, { name: "950", lightness: 4 }] }, e);
|
|
51
|
-
const { colors: o, names: h, preserve: a, shades: t } = e;
|
|
52
|
-
return o === void 0 || h === void 0 || a === void 0 || t === void 0 ? {} : o.reduce((u, r, i) => {
|
|
53
|
-
const n = h[i], s = j({ hex: r, preserve: a, shades: t });
|
|
54
|
-
return u[n] = s, u;
|
|
55
|
-
}, {});
|
|
56
|
-
}, v = {}, b = {};
|
|
57
|
-
(function(e) {
|
|
58
|
-
Object.defineProperty(e, "__esModule", {
|
|
59
|
-
value: !0
|
|
60
|
-
}), Object.defineProperty(e, "default", {
|
|
61
|
-
enumerable: !0,
|
|
62
|
-
get: function() {
|
|
63
|
-
return h;
|
|
64
|
-
}
|
|
65
|
-
});
|
|
66
|
-
function o(a, t) {
|
|
67
|
-
return {
|
|
68
|
-
handler: a,
|
|
69
|
-
config: t
|
|
70
|
-
};
|
|
71
|
-
}
|
|
72
|
-
o.withOptions = function(a, t = () => ({})) {
|
|
73
|
-
const u = function(r) {
|
|
74
|
-
return {
|
|
75
|
-
__options: r,
|
|
76
|
-
handler: a(r),
|
|
77
|
-
config: t(r)
|
|
78
|
-
};
|
|
79
|
-
};
|
|
80
|
-
return u.__isOptionsFunction = !0, u.__pluginFunction = a, u.__configFunction = t, u;
|
|
81
|
-
};
|
|
82
|
-
const h = o;
|
|
83
|
-
})(b);
|
|
84
|
-
(function(e) {
|
|
85
|
-
Object.defineProperty(e, "__esModule", {
|
|
86
|
-
value: !0
|
|
87
|
-
}), Object.defineProperty(e, "default", {
|
|
88
|
-
enumerable: !0,
|
|
89
|
-
get: function() {
|
|
90
|
-
return a;
|
|
91
|
-
}
|
|
92
|
-
});
|
|
93
|
-
const o = /* @__PURE__ */ h(b);
|
|
94
|
-
function h(t) {
|
|
95
|
-
return t && t.__esModule ? t : {
|
|
96
|
-
default: t
|
|
97
|
-
};
|
|
98
|
-
}
|
|
99
|
-
const a = o.default;
|
|
100
|
-
})(v);
|
|
101
|
-
let y = v;
|
|
102
|
-
var k = (y.__esModule ? y : { default: y }).default;
|
|
103
|
-
const w = /* @__PURE__ */ $(k);
|
|
104
|
-
export {
|
|
105
|
-
$ as g,
|
|
106
|
-
w as p,
|
|
107
|
-
q as s
|
|
108
|
-
};
|
package/dist/plugin-jum1MjXp.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";const r=require("lodash-es"),s=require("./plugin-xOpS-UNV.cjs"),b=o=>{const n=r.get(o,"primaryColor","#000"),c=r.get(o,"secondaryColor","#ccc"),d=r.get(o,"headingFont","Inter"),a=r.get(o,"bodyFont","Inter"),i=r.get(o,"roundedCorners","0"),l=r.get(o,"bodyBgLightColor","#fff"),g=r.get(o,"bodyBgDarkColor","#000"),e=r.get(o,"bodyTextLightColor","#000"),y=r.get(o,"bodyTextDarkColor","#fff"),t=s.s({colors:[n,c],names:["primary","secondary"]});r.set(t,"primary.DEFAULT",n),r.set(t,"secondary.DEFAULT",c);const u={"bg-light":l,"bg-dark":g,"text-dark":y,"text-light":e};return{container:{center:!0,padding:"1rem",screens:{"2xl":"1400px"}},fontFamily:{heading:[d],body:[a]},borderRadius:{DEFAULT:`${i||"0px"}px`},colors:{...t,...u}}},T=s.plugin(function({addBase:o,theme:n}){o({"h1,h2,h3,h4,h5,h6":{fontFamily:n("fontFamily.heading")},body:{fontFamily:n("fontFamily.body"),color:n("colors.text-light"),backgroundColor:n("colors.bg-light")},".dark body":{color:n("colors.text-dark"),backgroundColor:n("colors.bg-dark")}})});exports.chaiBuilderPlugin=T;exports.getChaiBuilderTheme=b;
|
package/dist/plugin-xOpS-UNV.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";function v(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var $=({hex:e,preserve:o,shades:h})=>{const a=(r=>{const i=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(r)||[];try{let n=parseInt(i[1],16),s=parseInt(i[2],16),l=parseInt(i[3],16);n/=255,s/=255,l/=255;const d=Math.max(n,s,l),g=Math.min(n,s,l);let _,f=0,p=(d+g)/2;if(d==g)f=_=0;else{const c=d-g;switch(_=p>.5?c/(2-d-g):c/(d+g),d){case n:f=(s-l)/c+(s<l?6:0);break;case s:f=(l-n)/c+2;break;case l:f=(n-s)/c+4}f/=6}const m={h:0,s:0,l:0};return m.h=Math.round(360*f),m.s=Math.round(100*_),m.l=Math.round(100*p),m}catch{return console.log(r),{h:0,s:0,l:0}}})(e),t={},u=h.reduce((r,{name:i,lightness:n})=>{const{h:s,s:l,l:d}=a,g=(({h:_,s:f,l:p})=>{p/=100;const m=f*Math.min(p,1-p)/100,c=P=>{const M=(P+_/30)%12,j=p-m*Math.max(Math.min(M-3,9-M,1),-1);return Math.round(255*j).toString(16).padStart(2,"0")};return`#${c(0)}${c(8)}${c(4)}`})({h:s,s:l,l:n});return r[i]=g,o&&(t[i]=Math.abs(d-n)),r},{});if(o){const[r]=Object.keys(t).sort((i,n)=>t[i]-t[n]);u[r]=e}return u},F=e=>{typeof e=="string"&&(e={colors:[e]}),typeof e=="object"&&Array.isArray(e)&&(e={colors:e}),e=Object.assign({colors:[],names:["primary","secondary","tertiary","quaternary","quinary","senary","septenary","octonary","nonary","denary"],preserve:!0,shades:[{name:"50",lightness:98},{name:"100",lightness:95},{name:"200",lightness:90},{name:"300",lightness:82},{name:"400",lightness:64},{name:"500",lightness:46},{name:"600",lightness:33},{name:"700",lightness:24},{name:"800",lightness:14},{name:"900",lightness:7},{name:"950",lightness:4}]},e);const{colors:o,names:h,preserve:a,shades:t}=e;return o===void 0||h===void 0||a===void 0||t===void 0?{}:o.reduce((u,r,i)=>{const n=h[i],s=$({hex:r,preserve:a,shades:t});return u[n]=s,u},{})},b={},O={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return h}});function o(a,t){return{handler:a,config:t}}o.withOptions=function(a,t=()=>({})){const u=function(r){return{__options:r,handler:a(r),config:t(r)}};return u.__isOptionsFunction=!0,u.__pluginFunction=a,u.__configFunction=t,u};const h=o})(O);(function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return a}});const o=h(O);function h(t){return t&&t.__esModule?t:{default:t}}const a=o.default})(b);let y=b;var k=(y.__esModule?y:{default:y}).default;const q=v(k);exports.getDefaultExportFromCjs=v;exports.plugin=q;exports.s=F;
|