@chaibuilder/sdk 2.0.0-beta.97 → 2.0.0-beta.98
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-DcE5RdLQ.cjs +236 -0
- package/dist/ChaiThemeFn-DzirXKjI.js +237 -0
- package/dist/CodeEditor-C8_JzwHn.cjs +81 -0
- package/dist/CodeEditor-DdIk_PEV.js +81 -0
- package/dist/Topbar-62QmCKWL.cjs +18 -0
- package/dist/Topbar-Cqt0j3Yt.js +18 -0
- package/dist/context-menu-DHla8ofZ.js +893 -0
- package/dist/context-menu-DawHUIXd.cjs +923 -0
- package/dist/core.cjs +11771 -5
- package/dist/core.js +6893 -3995
- package/dist/getSplitClasses-BuALfSLX.js +54 -0
- package/dist/getSplitClasses-mbQmvwI3.cjs +53 -0
- package/dist/iconBase-BSrIcOaG.cjs +146 -0
- package/dist/iconBase-CWgVxu0A.js +147 -0
- package/dist/plugin-BcTnEZwx.cjs +26 -0
- package/dist/plugin-DGEKY3uC.js +27 -0
- package/dist/render.cjs +247 -2
- package/dist/render.js +205 -150
- package/dist/runtime.cjs +9 -1
- package/dist/sdk.css +1336 -1
- package/dist/tailwind.cjs +78 -1
- package/dist/tailwind.js +21 -19
- package/dist/ui.cjs +378 -1
- package/dist/ui.js +254 -244
- package/dist/web-blocks.cjs +1679 -2
- package/dist/web-blocks.js +747 -518
- package/package.json +1 -1
- package/dist/ChaiThemeFn-Cort9tch.js +0 -201
- package/dist/ChaiThemeFn-DQu-2Eh9.cjs +0 -13
- package/dist/CodeEditor-B2x4yruH.cjs +0 -1
- package/dist/CodeEditor-VcQsGvTM.js +0 -65
- package/dist/Topbar-BQsjWb-A.js +0 -16
- package/dist/Topbar-DEw_kBMz.cjs +0 -1
- package/dist/context-menu-C4lLV8gP.cjs +0 -1
- package/dist/context-menu-D5ViOi6K.js +0 -831
- package/dist/getSplitClasses-DodqA_KW.cjs +0 -1
- package/dist/getSplitClasses-DphwgQiE.js +0 -48
- package/dist/iconBase-Cn2BsTrq.cjs +0 -1
- package/dist/iconBase-DHfFLkem.js +0 -124
- package/dist/plugin-2xcljWGM.cjs +0 -1
- package/dist/plugin-kUMxtQR5.js +0 -24
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";const a="#styles:",r="__ADD_BLOCK_INTERNAL_ROOT",n=s=>{if(s=s.replace(a,""),!s)return{baseClasses:"",classes:""};const e=s.split(/,(?![^\[]*\])/);if(e.length===1)return{baseClasses:"",classes:e[0].trim()};const[t,...l]=e;return{baseClasses:t.trim(),classes:l.join(",").trim().replace(/ +(?= )/g,"")}};exports.ROOT_TEMP_KEY=r;exports.STYLES_KEY=a;exports.getSplitChaiClasses=n;
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
const t = "#styles:", n = "__ADD_BLOCK_INTERNAL_ROOT", r = (s) => {
|
|
2
|
-
if (s = s.replace(t, ""), !s) return { baseClasses: "", classes: "" };
|
|
3
|
-
const e = s.split(/,(?![^\[]*\])/);
|
|
4
|
-
if (e.length === 1)
|
|
5
|
-
return { baseClasses: "", classes: e[0].trim() };
|
|
6
|
-
const [a, ...l] = e;
|
|
7
|
-
return {
|
|
8
|
-
baseClasses: a.trim(),
|
|
9
|
-
classes: l.join(",").trim().replace(/ +(?= )/g, "")
|
|
10
|
-
};
|
|
11
|
-
};
|
|
12
|
-
import.meta.vitest && describe("getSplitChaiClasses", () => {
|
|
13
|
-
it("should return the base classes and the classes", () => {
|
|
14
|
-
const s = {
|
|
15
|
-
",styles-2": { baseClasses: "", classes: "styles-2" },
|
|
16
|
-
"styles-1,styles-2": { baseClasses: "styles-1", classes: "styles-2" },
|
|
17
|
-
",bg-[linear-gradient(-10deg,black,transparent_100%)]": {
|
|
18
|
-
baseClasses: "",
|
|
19
|
-
classes: "bg-[linear-gradient(-10deg,black,transparent_100%)]"
|
|
20
|
-
},
|
|
21
|
-
"styles-1,bg-[linear-gradient(-10deg,black,transparent_100%)]": {
|
|
22
|
-
baseClasses: "styles-1",
|
|
23
|
-
classes: "bg-[linear-gradient(-10deg,black,transparent_100%)]"
|
|
24
|
-
},
|
|
25
|
-
someclass: {
|
|
26
|
-
baseClasses: "",
|
|
27
|
-
classes: "someclass"
|
|
28
|
-
},
|
|
29
|
-
",bg-red-500 text-center font-bold": {
|
|
30
|
-
baseClasses: "",
|
|
31
|
-
classes: "bg-red-500 text-center font-bold"
|
|
32
|
-
},
|
|
33
|
-
"bg-[linear-gradient(-10deg,black,transparent_100%)], bg-[linear-gradient(-10deg,black,transparent_100%)]": {
|
|
34
|
-
baseClasses: "bg-[linear-gradient(-10deg,black,transparent_100%)]",
|
|
35
|
-
classes: "bg-[linear-gradient(-10deg,black,transparent_100%)]"
|
|
36
|
-
}
|
|
37
|
-
};
|
|
38
|
-
for (let e in s) {
|
|
39
|
-
const a = r(`${t}${e}`);
|
|
40
|
-
expect(a).toEqual(s[e]);
|
|
41
|
-
}
|
|
42
|
-
});
|
|
43
|
-
});
|
|
44
|
-
export {
|
|
45
|
-
n as R,
|
|
46
|
-
t as S,
|
|
47
|
-
r as g
|
|
48
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";require("lodash-es");const v=require("clsx"),O=require("tailwind-merge"),a=require("react");function y(e=6,t="abcdefghijklmnopqrstuvwxyzABCD"){let r="";for(let n=e;n>0;--n)r+=t[Math.floor(Math.random()*t.length)];return r}const d=e=>e>=1536?"2XL":e>=1280?"XL":e>=1024?"LG":e>=768?"MD":e>=640?"SM":"XS",j=(...e)=>O.twMerge(v.clsx(e));var g={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},f=a.createContext&&a.createContext(g),P=["attr","size","title"];function h(e,t){if(e==null)return{};var r=w(e,t),n,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i<o.length;i++)n=o[i],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function w(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function c(){return c=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},c.apply(this,arguments)}function m(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function u(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?m(Object(r),!0).forEach(function(n){x(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):m(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function x(e,t,r){return t=E(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function E(e){var t=D(e,"string");return typeof t=="symbol"?t:t+""}function D(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function p(e){return e&&e.map((t,r)=>a.createElement(t.tag,u({key:r},t.attr),p(t.child)))}function S(e){return t=>a.createElement(C,c({attr:u({},e.attr)},t),p(e.child))}function C(e){var t=r=>{var{attr:n,size:i,title:o}=e,b=h(e,P),s=i||r.size||"1em",l;return r.className&&(l=r.className),e.className&&(l=(l?l+" ":"")+e.className),a.createElement("svg",c({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},r.attr,n,b,{className:l,style:u(u({color:e.color||r.color},r.style),e.style),height:s,width:s,xmlns:"http://www.w3.org/2000/svg"}),o&&a.createElement("title",null,o),e.children)};return f!==void 0?a.createElement(f.Consumer,null,r=>t(r)):t(g)}exports.GenIcon=S;exports.cn=j;exports.generateUUID=y;exports.getBreakpointValue=d;
|
|
@@ -1,124 +0,0 @@
|
|
|
1
|
-
import "lodash-es";
|
|
2
|
-
import { clsx as v } from "clsx";
|
|
3
|
-
import { twMerge as O } from "tailwind-merge";
|
|
4
|
-
import a from "react";
|
|
5
|
-
function D(e = 6, t = "abcdefghijklmnopqrstuvwxyzABCD") {
|
|
6
|
-
let r = "";
|
|
7
|
-
for (let n = e; n > 0; --n) r += t[Math.floor(Math.random() * t.length)];
|
|
8
|
-
return r;
|
|
9
|
-
}
|
|
10
|
-
const N = (e) => e >= 1536 ? "2XL" : e >= 1280 ? "XL" : e >= 1024 ? "LG" : e >= 768 ? "MD" : e >= 640 ? "SM" : "XS", z = (...e) => O(v(e));
|
|
11
|
-
var p = {
|
|
12
|
-
color: void 0,
|
|
13
|
-
size: void 0,
|
|
14
|
-
className: void 0,
|
|
15
|
-
style: void 0,
|
|
16
|
-
attr: void 0
|
|
17
|
-
}, s = a.createContext && /* @__PURE__ */ a.createContext(p), y = ["attr", "size", "title"];
|
|
18
|
-
function d(e, t) {
|
|
19
|
-
if (e == null) return {};
|
|
20
|
-
var r = j(e, t), n, i;
|
|
21
|
-
if (Object.getOwnPropertySymbols) {
|
|
22
|
-
var o = Object.getOwnPropertySymbols(e);
|
|
23
|
-
for (i = 0; i < o.length; i++)
|
|
24
|
-
n = o[i], !(t.indexOf(n) >= 0) && Object.prototype.propertyIsEnumerable.call(e, n) && (r[n] = e[n]);
|
|
25
|
-
}
|
|
26
|
-
return r;
|
|
27
|
-
}
|
|
28
|
-
function j(e, t) {
|
|
29
|
-
if (e == null) return {};
|
|
30
|
-
var r = {};
|
|
31
|
-
for (var n in e)
|
|
32
|
-
if (Object.prototype.hasOwnProperty.call(e, n)) {
|
|
33
|
-
if (t.indexOf(n) >= 0) continue;
|
|
34
|
-
r[n] = e[n];
|
|
35
|
-
}
|
|
36
|
-
return r;
|
|
37
|
-
}
|
|
38
|
-
function c() {
|
|
39
|
-
return c = Object.assign ? Object.assign.bind() : function(e) {
|
|
40
|
-
for (var t = 1; t < arguments.length; t++) {
|
|
41
|
-
var r = arguments[t];
|
|
42
|
-
for (var n in r)
|
|
43
|
-
Object.prototype.hasOwnProperty.call(r, n) && (e[n] = r[n]);
|
|
44
|
-
}
|
|
45
|
-
return e;
|
|
46
|
-
}, c.apply(this, arguments);
|
|
47
|
-
}
|
|
48
|
-
function m(e, t) {
|
|
49
|
-
var r = Object.keys(e);
|
|
50
|
-
if (Object.getOwnPropertySymbols) {
|
|
51
|
-
var n = Object.getOwnPropertySymbols(e);
|
|
52
|
-
t && (n = n.filter(function(i) {
|
|
53
|
-
return Object.getOwnPropertyDescriptor(e, i).enumerable;
|
|
54
|
-
})), r.push.apply(r, n);
|
|
55
|
-
}
|
|
56
|
-
return r;
|
|
57
|
-
}
|
|
58
|
-
function u(e) {
|
|
59
|
-
for (var t = 1; t < arguments.length; t++) {
|
|
60
|
-
var r = arguments[t] != null ? arguments[t] : {};
|
|
61
|
-
t % 2 ? m(Object(r), !0).forEach(function(n) {
|
|
62
|
-
P(e, n, r[n]);
|
|
63
|
-
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(r)) : m(Object(r)).forEach(function(n) {
|
|
64
|
-
Object.defineProperty(e, n, Object.getOwnPropertyDescriptor(r, n));
|
|
65
|
-
});
|
|
66
|
-
}
|
|
67
|
-
return e;
|
|
68
|
-
}
|
|
69
|
-
function P(e, t, r) {
|
|
70
|
-
return t = h(t), t in e ? Object.defineProperty(e, t, { value: r, enumerable: !0, configurable: !0, writable: !0 }) : e[t] = r, e;
|
|
71
|
-
}
|
|
72
|
-
function h(e) {
|
|
73
|
-
var t = w(e, "string");
|
|
74
|
-
return typeof t == "symbol" ? t : t + "";
|
|
75
|
-
}
|
|
76
|
-
function w(e, t) {
|
|
77
|
-
if (typeof e != "object" || !e) return e;
|
|
78
|
-
var r = e[Symbol.toPrimitive];
|
|
79
|
-
if (r !== void 0) {
|
|
80
|
-
var n = r.call(e, t || "default");
|
|
81
|
-
if (typeof n != "object") return n;
|
|
82
|
-
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
83
|
-
}
|
|
84
|
-
return (t === "string" ? String : Number)(e);
|
|
85
|
-
}
|
|
86
|
-
function g(e) {
|
|
87
|
-
return e && e.map((t, r) => /* @__PURE__ */ a.createElement(t.tag, u({
|
|
88
|
-
key: r
|
|
89
|
-
}, t.attr), g(t.child)));
|
|
90
|
-
}
|
|
91
|
-
function I(e) {
|
|
92
|
-
return (t) => /* @__PURE__ */ a.createElement(x, c({
|
|
93
|
-
attr: u({}, e.attr)
|
|
94
|
-
}, t), g(e.child));
|
|
95
|
-
}
|
|
96
|
-
function x(e) {
|
|
97
|
-
var t = (r) => {
|
|
98
|
-
var {
|
|
99
|
-
attr: n,
|
|
100
|
-
size: i,
|
|
101
|
-
title: o
|
|
102
|
-
} = e, b = d(e, y), f = i || r.size || "1em", l;
|
|
103
|
-
return r.className && (l = r.className), e.className && (l = (l ? l + " " : "") + e.className), /* @__PURE__ */ a.createElement("svg", c({
|
|
104
|
-
stroke: "currentColor",
|
|
105
|
-
fill: "currentColor",
|
|
106
|
-
strokeWidth: "0"
|
|
107
|
-
}, r.attr, n, b, {
|
|
108
|
-
className: l,
|
|
109
|
-
style: u(u({
|
|
110
|
-
color: e.color || r.color
|
|
111
|
-
}, r.style), e.style),
|
|
112
|
-
height: f,
|
|
113
|
-
width: f,
|
|
114
|
-
xmlns: "http://www.w3.org/2000/svg"
|
|
115
|
-
}), o && /* @__PURE__ */ a.createElement("title", null, o), e.children);
|
|
116
|
-
};
|
|
117
|
-
return s !== void 0 ? /* @__PURE__ */ a.createElement(s.Consumer, null, (r) => t(r)) : t(p);
|
|
118
|
-
}
|
|
119
|
-
export {
|
|
120
|
-
I as G,
|
|
121
|
-
N as a,
|
|
122
|
-
z as c,
|
|
123
|
-
D as g
|
|
124
|
-
};
|
package/dist/plugin-2xcljWGM.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";const n=require("./ChaiThemeFn-DQu-2Eh9.cjs"),o=(i=n.defaultThemeOptions)=>({container:{center:!0,padding:"1rem",screens:{"2xl":"1400px"}},...n.getChaiThemeOptions(i)}),r=n.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=o;
|
package/dist/plugin-kUMxtQR5.js
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { g as r, d as a, p as i } from "./ChaiThemeFn-Cort9tch.js";
|
|
2
|
-
const t = (n = a) => ({
|
|
3
|
-
container: {
|
|
4
|
-
center: !0,
|
|
5
|
-
padding: "1rem",
|
|
6
|
-
screens: { "2xl": "1400px" }
|
|
7
|
-
},
|
|
8
|
-
...r(n)
|
|
9
|
-
}), l = i(function({ addBase: n, theme: o }) {
|
|
10
|
-
n({
|
|
11
|
-
"h1,h2,h3,h4,h5,h6": {
|
|
12
|
-
fontFamily: o("fontFamily.heading")
|
|
13
|
-
},
|
|
14
|
-
body: {
|
|
15
|
-
fontFamily: o("fontFamily.body"),
|
|
16
|
-
color: o("colors.foreground"),
|
|
17
|
-
backgroundColor: o("colors.background")
|
|
18
|
-
}
|
|
19
|
-
});
|
|
20
|
-
});
|
|
21
|
-
export {
|
|
22
|
-
l as c,
|
|
23
|
-
t as g
|
|
24
|
-
};
|