@chaibuilder/sdk 1.2.30 → 1.2.31
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/{CanvasArea-e829y1ts.cjs → CanvasArea-AP2VxTme.cjs} +4 -4
- package/dist/{CanvasArea-3D9rpjpk.js → CanvasArea-AgZG60eK.js} +67 -67
- package/dist/{CurrentPage-5xKDQqvg.cjs → CurrentPage-lBwqlXua.cjs} +1 -1
- package/dist/{CurrentPage-VbdmddMv.js → CurrentPage-urEDcMfR.js} +2 -2
- package/dist/{PagesPanel-_VzJ1__k.js → PagesPanel-C3yfpE0O.js} +3 -3
- package/dist/{PagesPanel-wex1zGzm.cjs → PagesPanel-QAb3JjVO.cjs} +1 -1
- package/dist/{ProjectPanel-rPNO2QsE.js → ProjectPanel--8xzmpgT.js} +3 -3
- package/dist/{ProjectPanel-N6iWd_4Z.cjs → ProjectPanel-DJHfHFni.cjs} +1 -1
- package/dist/{Settings-mlh0i_1M.cjs → Settings-alHeC0FS.cjs} +1 -1
- package/dist/{Settings-jTl7IOPc.js → Settings-oMxnykls.js} +1 -1
- package/dist/{SidePanels-jYJEFpxC.js → SidePanels-TuKVMKxP.js} +1 -1
- package/dist/{SidePanels-mx5TyZBn.cjs → SidePanels-znlH133C.cjs} +1 -1
- package/dist/{add-page-modal-v5smARyL.cjs → add-page-modal-PhWtC-ZY.cjs} +1 -1
- package/dist/{add-page-modal-o1euqbsp.js → add-page-modal-Q3c1EOw1.js} +2 -2
- package/dist/core.cjs +1 -1
- package/dist/core.js +1 -1
- package/dist/defaultTheme-9e2np_iI.cjs +1 -0
- package/dist/{defaultTheme-D8B4-wHO.js → defaultTheme-ocvEtKQ3.js} +14 -5
- package/dist/{delete-page-modal-QzRkBAct.js → delete-page-modal-9B7603s-.js} +2 -2
- package/dist/{delete-page-modal-DNjqQuop.cjs → delete-page-modal-eh0Afqbu.cjs} +1 -1
- package/dist/email.cjs +1 -1
- package/dist/email.js +1 -1
- package/dist/{index-5c_rU-9B.cjs → index-B1EMostm.cjs} +1 -1
- package/dist/{index-SEJRE2ab.js → index-FVtnWx9d.js} +1 -1
- package/dist/{index-DtBYhldP.js → index-TXu6kBv9.js} +2 -2
- package/dist/{index-DHwvjZ5z.cjs → index-tFX6mX_R.cjs} +1 -1
- package/dist/lib.cjs +3 -3
- package/dist/lib.d.ts +2 -0
- package/dist/lib.js +83 -81
- package/dist/{page-viewer-1vswRGpL.js → page-viewer-3UIfb9p1.js} +3 -3
- package/dist/{page-viewer-87wtE0pN.cjs → page-viewer-wVQGkDJd.cjs} +1 -1
- package/dist/{project-general-setting-SE9QJ6mF.js → project-general-setting-8vqXfr75.js} +2 -2
- package/dist/{project-general-setting-RSG7ZQSx.cjs → project-general-setting-LrABWutT.cjs} +1 -1
- package/dist/render.cjs +1 -1
- package/dist/render.d.ts +2 -0
- package/dist/render.js +76 -74
- package/dist/{single-page-detail-8Arndzmw.cjs → single-page-detail-76C_iDiS.cjs} +1 -1
- package/dist/{single-page-detail-bels-Cjo.js → single-page-detail-py5_WxGu.js} +3 -3
- package/dist/studio.cjs +1 -1
- package/dist/studio.js +2 -2
- package/dist/tailwind.cjs +1 -1
- package/dist/tailwind.d.ts +37 -0
- package/dist/tailwind.js +102 -11
- package/package.json +2 -2
- package/dist/defaultTheme-7VqqhOcp.cjs +0 -1
package/dist/lib.js
CHANGED
|
@@ -1,21 +1,22 @@
|
|
|
1
|
-
import { c as
|
|
2
|
-
import { a as
|
|
3
|
-
import { g as
|
|
4
|
-
import { g as
|
|
5
|
-
import { first as
|
|
6
|
-
import { d as
|
|
7
|
-
import {
|
|
8
|
-
import { createTailwindcss as
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
1
|
+
import { c as S } from "./Class-6Hz2KzYb.js";
|
|
2
|
+
import { a as re } from "./Class-6Hz2KzYb.js";
|
|
3
|
+
import { g as ie, a as le } from "./Functions-7jnEwJyw.js";
|
|
4
|
+
import { g as xe } from "./html-to-json-ZV4QjSww.js";
|
|
5
|
+
import { first as _, includes as l, keys as f, map as y, parseInt as $, get as p, startsWith as k, replace as F } from "lodash-es";
|
|
6
|
+
import { d as u, a as O, g as C } from "./defaultTheme-ocvEtKQ3.js";
|
|
7
|
+
import { c as fe } from "./defaultTheme-ocvEtKQ3.js";
|
|
8
|
+
import { createTailwindcss as I } from "@mhsdesign/jit-browser-tailwindcss";
|
|
9
|
+
import V from "@tailwindcss/forms";
|
|
10
|
+
import P from "@tailwindcss/typography";
|
|
11
|
+
import E from "@tailwindcss/aspect-ratio";
|
|
12
12
|
import { a as R } from "./STRINGS--j49GZJP.js";
|
|
13
|
+
import A from "tailwindcss-palette-generator";
|
|
13
14
|
import "clsx";
|
|
14
15
|
import "tailwind-merge";
|
|
15
16
|
import "./MODIFIERS-cBT31iqE.js";
|
|
16
17
|
import "himalaya";
|
|
17
18
|
import "./_commonjsHelpers-UyOWmZb0.js";
|
|
18
|
-
const
|
|
19
|
+
const T = {
|
|
19
20
|
25: "1/4",
|
|
20
21
|
"33.33": "1/3",
|
|
21
22
|
50: "1/2",
|
|
@@ -32,7 +33,7 @@ const w = {
|
|
|
32
33
|
"58.33": "7/12",
|
|
33
34
|
"91.67": "11/12",
|
|
34
35
|
100: "full"
|
|
35
|
-
},
|
|
36
|
+
}, L = {
|
|
36
37
|
0: "0",
|
|
37
38
|
1: "px",
|
|
38
39
|
2: "0.5",
|
|
@@ -69,22 +70,22 @@ const w = {
|
|
|
69
70
|
320: "80",
|
|
70
71
|
384: "96"
|
|
71
72
|
};
|
|
72
|
-
const B = 16,
|
|
73
|
+
const B = 16, W = 4;
|
|
73
74
|
function v(a) {
|
|
74
75
|
return a.indexOf("rem") !== -1 && (a = `${parseFloat(a.replace("rem", "")) * B}px`), a;
|
|
75
76
|
}
|
|
76
|
-
const
|
|
77
|
-
const
|
|
78
|
-
if (
|
|
77
|
+
const ae = (a) => {
|
|
78
|
+
const c = a.match(/\[.*\]/);
|
|
79
|
+
if (c === null)
|
|
79
80
|
return a;
|
|
80
|
-
const
|
|
81
|
-
if (
|
|
81
|
+
const t = S(a);
|
|
82
|
+
if (t === null)
|
|
82
83
|
return a;
|
|
83
|
-
const { property: n } =
|
|
84
|
-
let e =
|
|
85
|
-
const
|
|
84
|
+
const { property: n } = t;
|
|
85
|
+
let e = _(c).replace(/\]/i, "").replace(/\[/i, "");
|
|
86
|
+
const r = a.replace(/\[.*\]/i, "");
|
|
86
87
|
e = v(e);
|
|
87
|
-
let
|
|
88
|
+
let s = a;
|
|
88
89
|
switch (n) {
|
|
89
90
|
case "top":
|
|
90
91
|
case "right":
|
|
@@ -118,26 +119,26 @@ const te = (a) => {
|
|
|
118
119
|
case "spaceX":
|
|
119
120
|
case "spaceY":
|
|
120
121
|
if (e.indexOf("px") !== -1) {
|
|
121
|
-
const
|
|
122
|
-
if (l(
|
|
123
|
-
const
|
|
124
|
-
|
|
122
|
+
const i = y(f(L), (o) => `${o}px`);
|
|
123
|
+
if (l(i, e)) {
|
|
124
|
+
const o = $(e.replace("px", ""), 10);
|
|
125
|
+
o === 1 ? s = `${r}px` : s = r + o / W;
|
|
125
126
|
}
|
|
126
127
|
}
|
|
127
128
|
if (e.indexOf("%") !== -1) {
|
|
128
|
-
const
|
|
129
|
-
if (l(
|
|
130
|
-
const
|
|
131
|
-
|
|
129
|
+
const i = y(f(T), (o) => `${o}%`);
|
|
130
|
+
if (l(i, e)) {
|
|
131
|
+
const o = parseFloat(e.replace("%", ""));
|
|
132
|
+
s = r + p(T, o);
|
|
132
133
|
}
|
|
133
134
|
}
|
|
134
|
-
e.indexOf("vw") !== -1 && parseFloat(e.replace("vw", "")) === 100 && (
|
|
135
|
+
e.indexOf("vw") !== -1 && parseFloat(e.replace("vw", "")) === 100 && (s = `${r}screen`), e.indexOf("vh") !== -1 && parseFloat(e.replace("vh", "")) === 100 && (s = `${r}screen`);
|
|
135
136
|
break;
|
|
136
137
|
case "minWidth":
|
|
137
|
-
e.indexOf("%") !== -1 && parseFloat(e.replace("%", "")) === 100 && (
|
|
138
|
+
e.indexOf("%") !== -1 && parseFloat(e.replace("%", "")) === 100 && (s = `${r}full`), e === "0px" && (s = "min-w-0");
|
|
138
139
|
break;
|
|
139
140
|
case "maxWidth":
|
|
140
|
-
e === "0px" && (
|
|
141
|
+
e === "0px" && (s = "max-w-0");
|
|
141
142
|
const x = {
|
|
142
143
|
"320px": "xs",
|
|
143
144
|
"384px": "sm",
|
|
@@ -155,13 +156,13 @@ const te = (a) => {
|
|
|
155
156
|
"640px": "screen-sm",
|
|
156
157
|
"1536px": "screen-2xl"
|
|
157
158
|
};
|
|
158
|
-
l(
|
|
159
|
+
l(f(x), e) && (s = `max-w-${x[e]}`);
|
|
159
160
|
break;
|
|
160
161
|
case "minHeight":
|
|
161
|
-
e.indexOf("%") !== -1 && parseFloat(e.replace("%", "")) === 100 && (
|
|
162
|
+
e.indexOf("%") !== -1 && parseFloat(e.replace("%", "")) === 100 && (s = `${r}full`), e === "0px" && (s = "min-h-0"), e === "100vh" && (s = "min-h-screen");
|
|
162
163
|
break;
|
|
163
164
|
case "fontSize":
|
|
164
|
-
const
|
|
165
|
+
const d = {
|
|
165
166
|
"12px": "xs",
|
|
166
167
|
"14px": "sm",
|
|
167
168
|
"16px": "base",
|
|
@@ -176,7 +177,7 @@ const te = (a) => {
|
|
|
176
177
|
"96px": "8xl",
|
|
177
178
|
"128px": "9xl"
|
|
178
179
|
};
|
|
179
|
-
l(d
|
|
180
|
+
l(f(d), e) && (s = r + d[e]);
|
|
180
181
|
break;
|
|
181
182
|
case "lineHeight":
|
|
182
183
|
const m = {
|
|
@@ -195,13 +196,13 @@ const te = (a) => {
|
|
|
195
196
|
"1.625": "relaxed",
|
|
196
197
|
2: "loose"
|
|
197
198
|
};
|
|
198
|
-
l(
|
|
199
|
+
l(f(m), e) && (s = r + m[e]);
|
|
199
200
|
break;
|
|
200
201
|
case "zIndex":
|
|
201
|
-
|
|
202
|
+
s = ["0", "10", "20", "30", "40", "50"].indexOf(e) !== -1 ? `${r}${e}` : a;
|
|
202
203
|
break;
|
|
203
204
|
case "opacity":
|
|
204
|
-
const
|
|
205
|
+
const b = [
|
|
205
206
|
"0",
|
|
206
207
|
"5",
|
|
207
208
|
"10",
|
|
@@ -217,36 +218,36 @@ const te = (a) => {
|
|
|
217
218
|
"90",
|
|
218
219
|
"95",
|
|
219
220
|
"100"
|
|
220
|
-
],
|
|
221
|
-
l(
|
|
221
|
+
], g = parseFloat(e) * 100;
|
|
222
|
+
l(b, g.toString()) && (s = `opacity-${g}`);
|
|
222
223
|
break;
|
|
223
224
|
default:
|
|
224
225
|
break;
|
|
225
226
|
}
|
|
226
|
-
return
|
|
227
|
+
return s;
|
|
227
228
|
};
|
|
228
|
-
async function
|
|
229
|
-
const
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
return
|
|
229
|
+
async function X(a, c, t = [], n = "c-", e = !1) {
|
|
230
|
+
const r = p(a, "primaryColor", "#000"), s = p(a, "secondaryColor", "#ccc"), x = p(a, "headingFont", "Inter"), d = p(a, "bodyFont", "Inter"), m = p(a, "roundedCorners", "0"), h = A([
|
|
231
|
+
{ color: r, name: "primary" },
|
|
232
|
+
{ color: s, name: "secondary" }
|
|
233
|
+
]);
|
|
234
|
+
return `${await I({
|
|
234
235
|
tailwindConfig: {
|
|
235
236
|
darkMode: "class",
|
|
236
|
-
safelist:
|
|
237
|
+
safelist: t,
|
|
237
238
|
theme: {
|
|
238
239
|
fontFamily: {
|
|
239
|
-
heading: [x, ...
|
|
240
|
-
body: [
|
|
240
|
+
heading: [x, ...u.fontFamily.sans],
|
|
241
|
+
body: [d, ...u.fontFamily.sans]
|
|
241
242
|
},
|
|
242
243
|
extend: {
|
|
243
244
|
borderRadius: {
|
|
244
245
|
global: `${m || "0"}px`
|
|
245
246
|
},
|
|
246
|
-
colors:
|
|
247
|
+
colors: h
|
|
247
248
|
}
|
|
248
249
|
},
|
|
249
|
-
plugins: [
|
|
250
|
+
plugins: [V, P, E],
|
|
250
251
|
corePlugins: { preflight: e },
|
|
251
252
|
...n ? { prefix: `${n}` } : {}
|
|
252
253
|
}
|
|
@@ -254,40 +255,41 @@ async function D(a, r, s = [], n = "c-", e = !1) {
|
|
|
254
255
|
` ${e ? "@tailwind base;" : ""}
|
|
255
256
|
@tailwind components;
|
|
256
257
|
@tailwind utilities;`,
|
|
257
|
-
|
|
258
|
+
c
|
|
258
259
|
)}
|
|
259
|
-
.${n}bg-clip-text{background-clip: text;-webkit-background-clip: text;} h1,h2,h3,h4,h5,h6{font-family: "${x}",${
|
|
260
|
+
.${n}bg-clip-text{background-clip: text;-webkit-background-clip: text;} h1,h2,h3,h4,h5,h6{font-family: "${x}",${u.fontFamily.sans.join(
|
|
260
261
|
", "
|
|
261
262
|
)};}`;
|
|
262
263
|
}
|
|
263
|
-
const
|
|
264
|
+
const M = (a, c) => a.map((t) => {
|
|
264
265
|
const n = {};
|
|
265
|
-
return Object.keys(
|
|
266
|
-
k(
|
|
266
|
+
return Object.keys(t).forEach((e) => {
|
|
267
|
+
k(t[e], R) && (n[e] = O(t[e], c));
|
|
267
268
|
}), n;
|
|
268
|
-
}),
|
|
269
|
-
const e =
|
|
270
|
-
return
|
|
271
|
-
|
|
272
|
-
[
|
|
273
|
-
e.split(" ").concat(`${
|
|
274
|
-
|
|
269
|
+
}), w = (a, c, t = "c-", n = !1) => {
|
|
270
|
+
const e = C(c, t);
|
|
271
|
+
return X(
|
|
272
|
+
c,
|
|
273
|
+
[F(JSON.stringify(M(a, t)), /#styles:/g, "")],
|
|
274
|
+
e.split(" ").concat(`${t}inline-block`, `${t}w-full`, `${t}h-full`),
|
|
275
|
+
t,
|
|
275
276
|
n
|
|
276
277
|
);
|
|
277
|
-
},
|
|
278
|
+
}, te = async (a, c = "c-", t = !1) => {
|
|
278
279
|
const n = a.page.blocks;
|
|
279
|
-
return await
|
|
280
|
-
},
|
|
280
|
+
return await w(n, a.project.brandingOptions, c, t);
|
|
281
|
+
}, se = async (a, c, t = "c-", n = !1) => await w(a, c, t, n);
|
|
281
282
|
export {
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
se as
|
|
292
|
-
|
|
283
|
+
O as addPrefixToClasses,
|
|
284
|
+
re as cn,
|
|
285
|
+
ae as convertArbitraryToTailwindClass,
|
|
286
|
+
fe as convertToBlocks,
|
|
287
|
+
ie as generateUUID,
|
|
288
|
+
xe as getBlocksFromHTML,
|
|
289
|
+
w as getBlocksTailwindCSS,
|
|
290
|
+
C as getBrandingClasses,
|
|
291
|
+
le as getBreakpointValue,
|
|
292
|
+
se as getStylesForBlocks,
|
|
293
|
+
te as getStylesForPageData,
|
|
294
|
+
X as getTailwindCSS
|
|
293
295
|
};
|
|
@@ -2,7 +2,7 @@ import { j as e } from "./jsx-runtime-WbnYoNE9.js";
|
|
|
2
2
|
import s, { useState as p, Suspense as l } from "react";
|
|
3
3
|
import { ChevronRightIcon as c, GearIcon as u, HomeIcon as d, FileTextIcon as x } from "@radix-ui/react-icons";
|
|
4
4
|
import { aW as g, aX as h, aY as f } from "./index-HiiWSXkE.js";
|
|
5
|
-
import { d as j, a as N, c as b } from "./index-
|
|
5
|
+
import { d as j, a as N, c as b } from "./index-TXu6kBv9.js";
|
|
6
6
|
import "./_commonjsHelpers-UyOWmZb0.js";
|
|
7
7
|
import "lodash-es";
|
|
8
8
|
import "./Functions-7jnEwJyw.js";
|
|
@@ -38,7 +38,7 @@ import "@radix-ui/react-context-menu";
|
|
|
38
38
|
import "react-icons-picker";
|
|
39
39
|
import "react-dom";
|
|
40
40
|
import "react-quill";
|
|
41
|
-
import "./index-
|
|
41
|
+
import "./index-FVtnWx9d.js";
|
|
42
42
|
import "i18next";
|
|
43
43
|
import "@floating-ui/react-dom";
|
|
44
44
|
import "flagged";
|
|
@@ -48,7 +48,7 @@ import "./html-to-json-ZV4QjSww.js";
|
|
|
48
48
|
import "himalaya";
|
|
49
49
|
import "lucide-react";
|
|
50
50
|
import "./index-YpnaudSM.js";
|
|
51
|
-
const v = s.lazy(() => import("./single-page-detail-
|
|
51
|
+
const v = s.lazy(() => import("./single-page-detail-py5_WxGu.js")), P = ({ pageData: r }) => {
|
|
52
52
|
const [t, i] = p("CLOSE");
|
|
53
53
|
return /* @__PURE__ */ e.jsxs(
|
|
54
54
|
g,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-Z_BpKhVy.cjs"),u=require("react"),n=require("@radix-ui/react-icons"),o=require("./index-12HbDLon.cjs"),x=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-Z_BpKhVy.cjs"),u=require("react"),n=require("@radix-ui/react-icons"),o=require("./index-12HbDLon.cjs"),x=require("./index-B1EMostm.cjs");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("lodash-es");require("./Functions-N3yhPYKY.cjs");require("clsx");require("tailwind-merge");require("@chaibuilder/runtime");require("jotai");require("./STRINGS-gPz7CUOk.cjs");require("@react-hookz/web");require("./MODIFIERS-YPHRtwrM.cjs");require("./Class-Zc8hpE7f.cjs");require("react-i18next");require("@radix-ui/react-toggle");require("class-variance-authority");require("@radix-ui/react-switch");require("@radix-ui/react-slot");require("@radix-ui/react-accordion");require("@radix-ui/react-alert-dialog");require("@radix-ui/react-dialog");require("@radix-ui/react-label");require("@radix-ui/react-scroll-area");require("@radix-ui/react-tabs");require("@radix-ui/react-tooltip");require("@radix-ui/react-popover");require("@radix-ui/react-menubar");require("@radix-ui/react-hover-card");require("@radix-ui/react-select");require("@radix-ui/react-dropdown-menu");require("@radix-ui/react-separator");require("@radix-ui/react-toast");require("cmdk");require("@radix-ui/react-context-menu");require("react-icons-picker");require("react-dom");require("react-quill");require("./index-tFX6mX_R.cjs");require("i18next");require("@floating-ui/react-dom");require("flagged");require("react-hotkeys-hook");require("sonner");require("./html-to-json-Xhu27KFD.cjs");require("himalaya");require("lucide-react");require("./index-ecnGWzh9.cjs");const m=u.lazy(()=>Promise.resolve().then(()=>require("./single-page-detail-76C_iDiS.cjs"))),j=({pageData:s})=>{const[r,i]=u.useState("CLOSE");return e.jsxRuntimeExports.jsxs(o.Popover,{open:r==="OPEN"||r==="ALERT"||r==="PENDING",onOpenChange:t=>{i(r==="PENDING"?"ALERT":t?"OPEN":"CLOSE")},children:[e.jsxRuntimeExports.jsx(o.PopoverTrigger,{asChild:!0,onClick:t=>{t.stopPropagation(),i("OPEN")},children:e.jsxRuntimeExports.jsx("div",{className:"flex items-center justify-between",children:r==="OPEN"||r==="ALERT"||r==="PENDING"?e.jsxRuntimeExports.jsx(n.ChevronRightIcon,{}):e.jsxRuntimeExports.jsx("div",{className:"hidden hover:text-blue-600 group-hover:flex",children:e.jsxRuntimeExports.jsx(n.GearIcon,{})})})}),e.jsxRuntimeExports.jsx(o.PopoverContent,{side:"right",align:"start",alignOffset:-35,className:"h-screen w-96",children:e.jsxRuntimeExports.jsx(u.Suspense,{fallback:e.jsxRuntimeExports.jsxs("div",{className:"flex w-full animate-pulse flex-col gap-y-3",children:[e.jsxRuntimeExports.jsx("div",{className:"bg-background-300 h-6 w-1/2"}),e.jsxRuntimeExports.jsx("div",{className:"bg-background-300 h-20 w-full"}),e.jsxRuntimeExports.jsx("div",{className:"bg-background-300 h-20 w-full"})]}),children:e.jsxRuntimeExports.jsx(m,{pageData:s,open:r,setOpen:i})})})]})},p=s=>{const[r]=x.useCurrentPage(),{data:i}=x.useProject(),t=x.useChangePage(),l=(i==null?void 0:i.homepage)===s.uuid,a=r===s.uuid,c=()=>t(s);return i?e.jsxRuntimeExports.jsxs("button",{className:`group relative flex w-full cursor-pointer items-center justify-between px-2.5 py-2 ${a?"bg-blue-200 ":""}`,onClick:c,type:"button",children:[e.jsxRuntimeExports.jsxs("div",{className:"flex text-sm items-center gap-x-1.5",children:[l?e.jsxRuntimeExports.jsx(n.HomeIcon,{}):e.jsxRuntimeExports.jsx(n.FileTextIcon,{})," ",s.name]}),e.jsxRuntimeExports.jsx(j,{pageData:s})]}):null},q=({pages:s,isLoading:r})=>r?e.jsxRuntimeExports.jsxs("div",{className:"flex animate-pulse flex-col gap-y-1 px-2.5 pt-2",children:[e.jsxRuntimeExports.jsx("div",{className:"bg-background-200 h-7 w-full"}),e.jsxRuntimeExports.jsx("div",{className:"bg-background-200 h-7 w-full"}),e.jsxRuntimeExports.jsx("div",{className:"bg-background-200 h-7 w-full"})]}):s.length===0?e.jsxRuntimeExports.jsx("div",{className:"px-2.5 pb-2 pt-4",children:"No pages"}):e.jsxRuntimeExports.jsx("div",{className:"-mb-2",children:u.Children.toArray(s.map(i=>e.jsxRuntimeExports.jsx(p,{...i})))});exports.default=q;
|
|
@@ -3,7 +3,7 @@ import * as l from "react";
|
|
|
3
3
|
import { bi as n } from "./index-HiiWSXkE.js";
|
|
4
4
|
import { u as c, o as u } from "./controls-OfJWSEqC.js";
|
|
5
5
|
import { F as d } from "./form-yw3Uuk6v.js";
|
|
6
|
-
import { a as x } from "./index-
|
|
6
|
+
import { a as x } from "./index-TXu6kBv9.js";
|
|
7
7
|
import "./_commonjsHelpers-UyOWmZb0.js";
|
|
8
8
|
import "lodash-es";
|
|
9
9
|
import "./Functions-7jnEwJyw.js";
|
|
@@ -42,7 +42,7 @@ import "react-dom";
|
|
|
42
42
|
import "react-quill";
|
|
43
43
|
import "@rjsf/core";
|
|
44
44
|
import "@rjsf/validator-ajv8";
|
|
45
|
-
import "./index-
|
|
45
|
+
import "./index-FVtnWx9d.js";
|
|
46
46
|
import "i18next";
|
|
47
47
|
import "@floating-ui/react-dom";
|
|
48
48
|
import "flagged";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const q=require("./jsx-runtime-Z_BpKhVy.cjs"),a=require("react"),f=require("./index-12HbDLon.cjs"),o=require("./controls-KK2oLIa8.cjs"),d=require("./form-jQj7E-hS.cjs"),m=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const q=require("./jsx-runtime-Z_BpKhVy.cjs"),a=require("react"),f=require("./index-12HbDLon.cjs"),o=require("./controls-KK2oLIa8.cjs"),d=require("./form-jQj7E-hS.cjs"),m=require("./index-B1EMostm.cjs");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("lodash-es");require("./Functions-N3yhPYKY.cjs");require("clsx");require("tailwind-merge");require("@chaibuilder/runtime");require("jotai");require("./STRINGS-gPz7CUOk.cjs");require("@react-hookz/web");require("./MODIFIERS-YPHRtwrM.cjs");require("./Class-Zc8hpE7f.cjs");require("react-i18next");require("@radix-ui/react-toggle");require("class-variance-authority");require("@radix-ui/react-switch");require("@radix-ui/react-slot");require("@radix-ui/react-accordion");require("@radix-ui/react-icons");require("@radix-ui/react-alert-dialog");require("@radix-ui/react-dialog");require("@radix-ui/react-label");require("@radix-ui/react-scroll-area");require("@radix-ui/react-tabs");require("@radix-ui/react-tooltip");require("@radix-ui/react-popover");require("@radix-ui/react-menubar");require("@radix-ui/react-hover-card");require("@radix-ui/react-select");require("@radix-ui/react-dropdown-menu");require("@radix-ui/react-separator");require("@radix-ui/react-toast");require("cmdk");require("@radix-ui/react-context-menu");require("react-icons-picker");require("react-dom");require("react-quill");require("@rjsf/core");require("@rjsf/validator-ajv8");require("./index-tFX6mX_R.cjs");require("i18next");require("@floating-ui/react-dom");require("flagged");require("react-hotkeys-hook");require("sonner");require("./html-to-json-Xhu27KFD.cjs");require("himalaya");require("lucide-react");require("./index-ecnGWzh9.cjs");function j(r){const i=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(r){for(const e in r)if(e!=="default"){const u=Object.getOwnPropertyDescriptor(r,e);Object.defineProperty(i,e,u.get?u:{enumerable:!0,get:()=>r[e]})}}return i.default=r,Object.freeze(i)}const g=j(a),b=({_projectData:r,seany:i})=>{const{data:e,isLoading:u}=m.useProject();g.useEffect(()=>{e&&i(e)},[e,i]);const n=({formData:s},t)=>{i(l=>({...l,[t]:s[t]}))},c={name:o.u({title:"Project Name",default:e==null?void 0:e.name}),favicon:o.o({title:"Favicon",default:e==null?void 0:e.favicon})};return q.jsxRuntimeExports.jsx(f.ScrollArea,{className:"flex h-full select-none flex-col",children:q.jsxRuntimeExports.jsx(d.Form,{properties:c,disabled:u,formData:r,onChange:n})})};exports.default=b;
|
package/dist/render.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./jsx-runtime-Z_BpKhVy.cjs"),E=require("react"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./jsx-runtime-Z_BpKhVy.cjs"),E=require("react"),r=require("lodash-es"),C=require("tailwind-merge"),a=require("./STRINGS-gPz7CUOk.cjs"),S=require("./defaultTheme-9e2np_iI.cjs"),Y=require("@chaibuilder/runtime"),B=require("react-wrap-balancer"),F=require("./MODIFIERS-YPHRtwrM.cjs"),O=require("@react-email/render"),y=require("@react-email/components"),q=require("tailwindcss-palette-generator");require("./_commonjsHelpers-wDK0ZLPo.cjs");const L=t=>{const n={};return Object.keys(t).forEach(e=>{r.isString(t[e])&&t[e].startsWith(a.SLOT_KEY)&&(n[e]=t[e].replace(a.SLOT_KEY,"").split(","))}),n},A=r.memoize((t,n)=>{const e=t.replace(a.STYLES_KEY,"").split(","),s=C.twMerge(e[0],e[1]);return n?S.addPrefixToClasses(s,n).replace(a.STYLES_KEY,"").trim():s.replace(a.STYLES_KEY,"").trim()});function K(t,n){return r.get(t,`${n}_attrs`,{})}function w(t,n){const e={};return Object.keys(t).forEach(s=>{if(r.isString(t[s])&&t[s].startsWith(a.STYLES_KEY)){const i=A(t[s],n);e[s]={className:i,...K(t,s)}}}),e}function N(t,n){const e=r.get(t,"_bindings",{});return r.isEmpty(e)?{...t}:(r.each(e,(s,i)=>{r.isString(s)&&r.get(n,s,null)&&(t[i]=r.get(n,s,null))}),t)}function T(t){const{components:n,blocks:e,parent:s,classPrefix:i="",externalData:u={}}=t,p=e,c=l=>w(l,i),R=s?r.filter(e,{_parent:s}):r.filter(e,l=>r.isEmpty(l._parent));return o.jsxRuntimeExports.jsx(o.jsxRuntimeExports.Fragment,{children:E.Children.toArray(R.map((l,x)=>{const f=L(l),d={};r.isEmpty(f)||Object.keys(f).forEach(j=>{d[j]=E.Children.toArray(f[j].map(_=>o.jsxRuntimeExports.jsx(T,{externalData:u,classPrefix:i,blocks:p,parent:_,components:n})))});const m=r.filter(p,{_parent:l._id});d.children=m.length>0?o.jsxRuntimeExports.jsx(T,{externalData:u,classPrefix:i,parent:l._id,blocks:p,components:n}):null;const g=r.get(n,l._type,null);if(g!==null){let j=l;const _=g;return E.createElement(_,r.omit({...j,index:x,...N(l,u),...c(j),...d},["_parent"]))}return o.jsxRuntimeExports.jsxs("noscript",{children:[l._type," not found"]})}))})}const $=t=>{const n={};return Object.keys(t).forEach(e=>{r.isString(t[e])&&t[e].startsWith(a.SLOT_KEY)&&(n[e]=t[e].replace(a.SLOT_KEY,"").split(","))}),n},I=r.memoize((t,n)=>{const e=t.replace(a.STYLES_KEY,"").split(","),s=C.twMerge(e[0],e[1]);return n===""?s.replace(a.STYLES_KEY,"").trim():S.addPrefixToClasses(s,n).replace(a.STYLES_KEY,"").trim()});function W(t,n){return r.get(t,`${n}_attrs`,{})}function M(t,n){const e={};return Object.keys(t).forEach(s=>{if(r.isString(t[s])&&t[s].startsWith(a.STYLES_KEY)){const i=I(t[s],n);e[s]={className:i,...W(t,s)}}}),e}function P(t,n){const e=r.get(t,"_bindings",{});return r.isEmpty(e)?{...t}:(r.each(e,(s,i)=>{r.isString(s)&&r.get(n,s,null)&&(t[i]=r.get(n,s,null))}),t)}function h({blocks:t,parent:n,classPrefix:e="",externalData:s={}}){const i=t,u=c=>M(c,e),p=n?r.filter(t,{_parent:n}):r.filter(t,c=>r.isEmpty(c._parent));return o.jsxRuntimeExports.jsx(o.jsxRuntimeExports.Fragment,{children:E.Children.toArray(p.map((c,R)=>{const l=$(c),x={};r.isEmpty(l)||Object.keys(l).forEach(m=>{x[m]=E.Children.toArray(l[m].map(g=>o.jsxRuntimeExports.jsx(h,{externalData:s,classPrefix:e,blocks:i,parent:g})))});const f=r.filter(i,{_parent:c._id});x.children=f.length>0?o.jsxRuntimeExports.jsx(h,{externalData:s,classPrefix:e,parent:c._id,blocks:i}):null;const d=Y.getBlockComponent(c._type);if(d!==null){let m=c;const g=d.component;return m={...d.defaults,...c},E.createElement(g,r.omit({blockProps:{},inBuilder:!1,...m,index:R,...P(c,s),...u(m),...x},["_parent"]))}return o.jsxRuntimeExports.jsxs("noscript",{children:[c._type," not found"]})}))})}const U=({pageData:t,externalData:n={},before:e=null,after:s=null,classPrefix:i="c-"})=>{const u=r.get(t.project,"brandingOptions",F.BRANDING_OPTIONS_DEFAULTS);return o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[e,o.jsxRuntimeExports.jsx("div",{className:i.replace("-","")+" "+S.getBrandingClasses(u,i)+" min-h-screen",children:o.jsxRuntimeExports.jsx(B.Provider,{children:o.jsxRuntimeExports.jsx(h,{externalData:n,blocks:t.page.blocks||[],classPrefix:i})})}),s]})},z=(t,n="c-")=>{const e=r.get(t,"primaryColor","#000"),s=r.get(t,"secondaryColor","#ccc"),i=r.get(t,"bodyFont","Inter"),u=r.get(t,"roundedCorners","0"),p=q([{color:e,name:"primary"},{color:s,name:"secondary"}]);return{theme:{fontFamily:{body:[i,...S.defaultTheme.fontFamily.sans]},extend:{borderRadius:{global:`${u||"0"}px`},colors:p}},...n?{prefix:n}:{}}},G=t=>({fontFamily:t,fallbackFontFamily:"Verdana",webFont:{url:`https://fonts.googleapis.com/css2?family=${t}&display=swap`,format:"woff"},fontWeight:400,fontStyle:"normal"}),H=(t,n,e="html")=>{const s=z(n);return O.render(o.jsxRuntimeExports.jsx(y.Tailwind,{config:s,children:o.jsxRuntimeExports.jsxs(y.Html,{lang:"en",dir:"ltr",children:[o.jsxRuntimeExports.jsx(y.Head,{children:o.jsxRuntimeExports.jsx(y.Font,{...G(r.get(n,"bodyFont","Verdana"))})}),o.jsxRuntimeExports.jsx("body",{children:o.jsxRuntimeExports.jsx(h,{blocks:t})})]})}),e==="html"?{pretty:!0}:{plainText:!0})};exports.convertToBlocks=S.convertToBlocks;exports.RenderChaiBlocks=h;exports.RenderChaiPage=U;exports.RenderUnregisteredComponents=T;exports.generateEmailTemplate=H;
|
package/dist/render.d.ts
CHANGED
|
@@ -47,6 +47,8 @@ declare type ChaiPageProps = {
|
|
|
47
47
|
externalData?: Record<string, any>;
|
|
48
48
|
};
|
|
49
49
|
|
|
50
|
+
export declare const convertToBlocks: (jsonString: string) => ChaiBlock[];
|
|
51
|
+
|
|
50
52
|
export declare const generateEmailTemplate: (blocks: ChaiBlock[], brandingOptions: Record<string, any>, output?: "plain" | "html") => string;
|
|
51
53
|
|
|
52
54
|
export declare function RenderChaiBlocks({ blocks, parent, classPrefix, externalData, }: {
|