@chaibuilder/sdk 2.0.0-beta.10 → 2.0.0-beta.100

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.
Files changed (52) hide show
  1. package/README.md +1 -3
  2. package/dist/ChaiThemeFn-Cort9tch.js +201 -0
  3. package/dist/ChaiThemeFn-DQu-2Eh9.cjs +13 -0
  4. package/dist/CodeEditor-B2x4yruH.cjs +1 -0
  5. package/dist/CodeEditor-VcQsGvTM.js +65 -0
  6. package/dist/Topbar-BQsjWb-A.js +16 -0
  7. package/dist/Topbar-DEw_kBMz.cjs +1 -0
  8. package/dist/chaibuilder-logo.png +0 -0
  9. package/dist/context-menu-C4lLV8gP.cjs +1 -0
  10. package/dist/{context-menu-oLipAPzI.js → context-menu-D5ViOi6K.js} +304 -290
  11. package/dist/core.cjs +7 -18
  12. package/dist/core.d.ts +79 -46
  13. package/dist/core.js +5231 -5131
  14. package/dist/getSplitClasses-DodqA_KW.cjs +1 -0
  15. package/dist/getSplitClasses-DphwgQiE.js +48 -0
  16. package/dist/{iconBase-Ief2hJUZ.js → iconBase-DHfFLkem.js} +6 -12
  17. package/dist/mockServiceWorker.js +39 -24
  18. package/dist/plugin-2xcljWGM.cjs +1 -0
  19. package/dist/plugin-kUMxtQR5.js +24 -0
  20. package/dist/render.cjs +2 -2
  21. package/dist/render.d.ts +41 -16
  22. package/dist/render.js +166 -139
  23. package/dist/runtime.cjs +1 -1
  24. package/dist/runtime.d.ts +6 -1
  25. package/dist/runtime.js +0 -20
  26. package/dist/{style.css → sdk.css} +1 -1
  27. package/dist/tailwind.cjs +1 -1
  28. package/dist/tailwind.d.ts +37 -26
  29. package/dist/tailwind.js +8 -10
  30. package/dist/ui.cjs +1 -1
  31. package/dist/ui.d.ts +12 -51
  32. package/dist/ui.js +218 -390
  33. package/dist/web-blocks.cjs +2 -2
  34. package/dist/web-blocks.d.ts +6 -0
  35. package/dist/web-blocks.js +1230 -813
  36. package/package.json +136 -132
  37. package/dist/CodeEditor-9qjIOTD0.js +0 -126
  38. package/dist/CodeEditor-pceepCns.cjs +0 -1
  39. package/dist/STRINGS-Xxstm-7I.js +0 -7
  40. package/dist/STRINGS-Yl7cSWDc.cjs +0 -1
  41. package/dist/Topbar-7bGqLcSJ.js +0 -73
  42. package/dist/Topbar-EXPx1Yg2.cjs +0 -1
  43. package/dist/context-menu-4nQs6OxC.cjs +0 -1
  44. package/dist/controls-lEwMTdPQ.js +0 -234
  45. package/dist/controls-p9IwFnPx.cjs +0 -1
  46. package/dist/jsx-runtime-JYMCiFoE.cjs +0 -27
  47. package/dist/jsx-runtime-Sp0orL4X.js +0 -631
  48. package/dist/plugin-Dm5EFGnP.cjs +0 -1
  49. package/dist/plugin-KIpT3NWi.cjs +0 -1
  50. package/dist/plugin-PFjzFeON.js +0 -97
  51. package/dist/plugin-ooqqxWRQ.js +0 -55
  52. /package/dist/{iconBase-aZzpqff_.cjs → iconBase-Cn2BsTrq.cjs} +0 -0
@@ -1,97 +0,0 @@
1
- import { get as d, set as M } from "lodash-es";
2
- import { p as T } from "./plugin-ooqqxWRQ.js";
3
- var D = ({ hex: r, preserve: n, shades: y }) => {
4
- const b = ((e) => {
5
- const a = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e) || [];
6
- try {
7
- let o = parseInt(a[1], 16), t = parseInt(a[2], 16), s = parseInt(a[3], 16);
8
- o /= 255, t /= 255, s /= 255;
9
- const c = Math.max(o, t, s), u = Math.min(o, t, s);
10
- let f, g = 0, p = (c + u) / 2;
11
- if (c == u)
12
- g = f = 0;
13
- else {
14
- const l = c - u;
15
- switch (f = p > 0.5 ? l / (2 - c - u) : l / (c + u), c) {
16
- case o:
17
- g = (t - s) / l + (t < s ? 6 : 0);
18
- break;
19
- case t:
20
- g = (s - o) / l + 2;
21
- break;
22
- case s:
23
- g = (o - t) / l + 4;
24
- }
25
- g /= 6;
26
- }
27
- const m = { h: 0, s: 0, l: 0 };
28
- return m.h = Math.round(360 * g), m.s = Math.round(100 * f), m.l = Math.round(100 * p), m;
29
- } catch {
30
- return console.log(e), { h: 0, s: 0, l: 0 };
31
- }
32
- })(r), i = {}, h = y.reduce((e, { name: a, lightness: o }) => {
33
- const { h: t, s, l: c } = b, u = (({ h: f, s: g, l: p }) => {
34
- p /= 100;
35
- const m = g * Math.min(p, 1 - p) / 100, l = (k) => {
36
- const x = (k + f / 30) % 12, F = p - m * Math.max(Math.min(x - 3, 9 - x, 1), -1);
37
- return Math.round(255 * F).toString(16).padStart(2, "0");
38
- };
39
- return `#${l(0)}${l(8)}${l(4)}`;
40
- })({ h: t, s, l: o });
41
- return e[a] = u, n && (i[a] = Math.abs(c - o)), e;
42
- }, {});
43
- if (n) {
44
- const [e] = Object.keys(i).sort((a, o) => i[a] - i[o]);
45
- h[e] = r;
46
- }
47
- return h;
48
- }, C = (r) => {
49
- typeof r == "string" && (r = { colors: [r] }), typeof r == "object" && Array.isArray(r) && (r = { colors: r }), r = 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 }] }, r);
50
- const { colors: n, names: y, preserve: b, shades: i } = r;
51
- return n === void 0 || y === void 0 || b === void 0 || i === void 0 ? {} : n.reduce((h, e, a) => {
52
- const o = y[a], t = D({ hex: e, preserve: b, shades: i });
53
- return h[o] = t, h;
54
- }, {});
55
- };
56
- const _ = (r) => {
57
- const n = d(r, "primaryColor", "#000"), y = d(r, "secondaryColor", "#ccc"), b = d(r, "headingFont", "Inter"), i = d(r, "bodyFont", "Inter"), h = d(r, "roundedCorners", "0"), e = d(r, "bodyBgLightColor", "#fff"), a = d(r, "bodyBgDarkColor", "#000"), o = d(r, "bodyTextLightColor", "#000"), t = d(r, "bodyTextDarkColor", "#fff"), s = C({
58
- colors: [n, y],
59
- names: ["primary", "secondary"]
60
- });
61
- M(s, "primary.DEFAULT", n), M(s, "secondary.DEFAULT", y);
62
- const c = {
63
- "bg-light": e,
64
- "bg-dark": a,
65
- "text-dark": t,
66
- "text-light": o
67
- };
68
- return {
69
- container: {
70
- center: !0,
71
- padding: "1rem",
72
- screens: { "2xl": "1400px" }
73
- },
74
- fontFamily: { heading: [b], body: [i] },
75
- borderRadius: { DEFAULT: `${h || "0px"}px` },
76
- colors: { ...s, ...c }
77
- };
78
- }, A = T(function({ addBase: r, theme: n }) {
79
- r({
80
- "h1,h2,h3,h4,h5,h6": {
81
- fontFamily: n("fontFamily.heading")
82
- },
83
- body: {
84
- fontFamily: n("fontFamily.body"),
85
- color: n("colors.text-light"),
86
- backgroundColor: n("colors.bg-light")
87
- },
88
- ".dark body": {
89
- color: n("colors.text-dark"),
90
- backgroundColor: n("colors.bg-dark")
91
- }
92
- });
93
- });
94
- export {
95
- A as c,
96
- _ as g
97
- };
@@ -1,55 +0,0 @@
1
- function f(e) {
2
- return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
3
- }
4
- var i = {}, c = {};
5
- (function(e) {
6
- Object.defineProperty(e, "__esModule", {
7
- value: !0
8
- }), Object.defineProperty(e, "default", {
9
- enumerable: !0,
10
- get: function() {
11
- return l;
12
- }
13
- });
14
- function u(n, t) {
15
- return {
16
- handler: n,
17
- config: t
18
- };
19
- }
20
- u.withOptions = function(n, t = () => ({})) {
21
- const r = function(a) {
22
- return {
23
- __options: a,
24
- handler: n(a),
25
- config: t(a)
26
- };
27
- };
28
- return r.__isOptionsFunction = !0, r.__pluginFunction = n, r.__configFunction = t, r;
29
- };
30
- const l = u;
31
- })(c);
32
- (function(e) {
33
- Object.defineProperty(e, "__esModule", {
34
- value: !0
35
- }), Object.defineProperty(e, "default", {
36
- enumerable: !0,
37
- get: function() {
38
- return n;
39
- }
40
- });
41
- const u = /* @__PURE__ */ l(c);
42
- function l(t) {
43
- return t && t.__esModule ? t : {
44
- default: t
45
- };
46
- }
47
- const n = u.default;
48
- })(i);
49
- let o = i;
50
- var _ = (o.__esModule ? o : { default: o }).default;
51
- const d = /* @__PURE__ */ f(_);
52
- export {
53
- f as g,
54
- d as p
55
- };