@chaibuilder/sdk 0.1.0
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/README.md +41 -0
- package/dist/AddBlocks-04c49399.js +258 -0
- package/dist/AddBlocks-c27c81fa.cjs +3 -0
- package/dist/BrandingOptions-055cf22a.js +157 -0
- package/dist/BrandingOptions-c25f6370.cjs +1 -0
- package/dist/CONTROLS-031e1de3.cjs +1 -0
- package/dist/CONTROLS-442caee5.js +6 -0
- package/dist/CanvasArea-97dfbb52.cjs +60 -0
- package/dist/CanvasArea-a7901131.js +1455 -0
- package/dist/Class-0801d193.cjs +1 -0
- package/dist/Class-e6b07b79.js +1138 -0
- package/dist/ImagesPanel-160aa664.cjs +1 -0
- package/dist/ImagesPanel-815d5e6f.js +27 -0
- package/dist/Layers-3aa6aae7.cjs +1 -0
- package/dist/Layers-6f1c162e.js +370 -0
- package/dist/MarkAsGlobalBlock-209ddfd5.js +73 -0
- package/dist/MarkAsGlobalBlock-536770e7.cjs +1 -0
- package/dist/Settings-2b1ff1a3.cjs +1 -0
- package/dist/Settings-b1afcefe.js +1845 -0
- package/dist/SidePanels-f48777bb.js +144 -0
- package/dist/SidePanels-f79dbace.cjs +1 -0
- package/dist/Topbar-64729901.js +105 -0
- package/dist/Topbar-bff765dc.cjs +1 -0
- package/dist/UnsplashImages-04fffeed.cjs +1 -0
- package/dist/UnsplashImages-315ce7a8.js +160 -0
- package/dist/UploadImages-43c16a2d.cjs +1 -0
- package/dist/UploadImages-f317eef0.js +107 -0
- package/dist/_commonjsHelpers-5a53b418.cjs +1 -0
- package/dist/_commonjsHelpers-d4512b9c.js +6 -0
- package/dist/accordion-0afd8143.cjs +1 -0
- package/dist/accordion-c0176dc5.js +42 -0
- package/dist/context-menu-e1c240ce.js +122 -0
- package/dist/context-menu-fec580f2.cjs +1 -0
- package/dist/core.cjs +1 -0
- package/dist/core.d.ts +353 -0
- package/dist/core.js +83 -0
- package/dist/dialog-170eaad9.cjs +1 -0
- package/dist/dialog-3d4e82ed.js +65 -0
- package/dist/dropdown-menu-a9b096f9.cjs +1 -0
- package/dist/dropdown-menu-d912a52e.js +223 -0
- package/dist/html-to-json-d8ac554d.cjs +1 -0
- package/dist/html-to-json-fecbbe16.js +178 -0
- package/dist/index-aea5c557.cjs +2 -0
- package/dist/index-cdd49c4c.js +2651 -0
- package/dist/jsx-runtime-5c3ac4f7.cjs +27 -0
- package/dist/jsx-runtime-944c88e2.js +631 -0
- package/dist/label-167415e5.cjs +1 -0
- package/dist/label-e770a087.js +10 -0
- package/dist/lib.cjs +1 -0
- package/dist/lib.d.ts +29 -0
- package/dist/lib.js +223 -0
- package/dist/link-43d13383.cjs +1 -0
- package/dist/link-8594fd8f.js +211 -0
- package/dist/popover-7cb9079b.cjs +1 -0
- package/dist/popover-f7addcf4.js +23 -0
- package/dist/render.cjs +2 -0
- package/dist/render.d.ts +49 -0
- package/dist/render.js +1171 -0
- package/dist/scroll-area-088530b9.cjs +1 -0
- package/dist/scroll-area-9f64a082.js +30 -0
- package/dist/select-0e32300c.cjs +1 -0
- package/dist/select-7fddd7c3.js +75 -0
- package/dist/separator-a597dba7.cjs +1 -0
- package/dist/separator-a80d065b.js +18 -0
- package/dist/style.css +6 -0
- package/dist/tabs-85caa1e8.js +46 -0
- package/dist/tabs-860e37aa.cjs +1 -0
- package/dist/textarea-0750bcd2.js +73 -0
- package/dist/textarea-a338ede6.cjs +1 -0
- package/dist/toggle-00c9d11e.js +30 -0
- package/dist/toggle-b90fed97.cjs +1 -0
- package/dist/ui.cjs +1 -0
- package/dist/ui.d.ts +471 -0
- package/dist/ui.js +442 -0
- package/dist/useBuilderProp-5e57d0c8.cjs +1 -0
- package/dist/useBuilderProp-81a14920.js +238 -0
- package/dist/utils-3c452dd0.cjs +1 -0
- package/dist/utils-ac68b2c8.js +6 -0
- package/dist/vite.svg +1 -0
- package/package.json +156 -0
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { j as t } from "./jsx-runtime-944c88e2.js";
|
|
2
|
+
import * as s from "react";
|
|
3
|
+
import * as o from "@radix-ui/react-label";
|
|
4
|
+
import { cva as m } from "class-variance-authority";
|
|
5
|
+
import { c as i } from "./utils-ac68b2c8.js";
|
|
6
|
+
const l = m("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"), p = s.forwardRef(({ className: a, ...e }, r) => /* @__PURE__ */ t.jsx(o.Root, { ref: r, className: i(l(), a), ...e }));
|
|
7
|
+
p.displayName = o.Root.displayName;
|
|
8
|
+
export {
|
|
9
|
+
p as L
|
|
10
|
+
};
|
package/dist/lib.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const h=require("./utils-3c452dd0.cjs"),r=require("./Class-0801d193.cjs"),T=require("./html-to-json-d8ac554d.cjs"),s=require("lodash");require("clsx");require("tailwind-merge");require("himalaya");require("./CONTROLS-031e1de3.cjs");const d={25:"1/4","33.33":"1/3",50:"1/2","66.67":"2/3",75:"3/4",20:"1/5",40:"2/5",60:"3/5",80:"4/5","16.67":"1/6","83.33":"5/6","8.33":"1/12","41.67":"5/12","58.33":"7/12","91.67":"11/12",100:"full"},k={0:"0",1:"px",2:"0.5",4:"1",6:"1.5",8:"2",10:"2.5",12:"3",14:"3.5",16:"4",20:"5",24:"6",28:"7",32:"8",36:"9",40:"10",44:"11",48:"12",56:"14",64:"16",80:"20",96:"24",112:"28",128:"32",144:"36",160:"40",176:"44",192:"48",208:"52",224:"56",240:"60",256:"64",288:"72",320:"80",384:"96"},b=16,V=4;function O(n){return n.indexOf("rem")!==-1&&(n=`${parseFloat(n.replace("rem",""))*b}px`),n}const w=n=>{const p=n.match(/\[.*\]/);if(p===null)return n;const l=r.constructClassObject(n);if(l===null)return n;const{property:m}=l;let e=s.first(p).replace(/\]/i,"").replace(/\[/i,"");const c=n.replace(/\[.*\]/i,"");e=O(e);let a=n;switch(m){case"top":case"right":case"left":case"bottom":case"inset":case"insetX":case"insetY":case"gap":case"gapX":case"gapY":case"padding":case"paddingX":case"paddingY":case"paddingTop":case"paddingRight":case"paddingBottom":case"paddingLeft":case"margin":case"marginX":case"marginY":case"marginTop":case"marginRight":case"marginBottom":case"marginLeft":case"flexBasis":case"width":case"height":case"maxHeight":case"textIndent":case"spaceX":case"spaceY":if(e.indexOf("px")!==-1){const t=s.map(s.keys(k),i=>`${i}px`);if(s.includes(t,e)){const i=s.parseInt(e.replace("px",""),10);i===1?a=`${c}px`:a=c+i/V}}if(e.indexOf("%")!==-1){const t=s.map(s.keys(d),i=>`${i}%`);if(s.includes(t,e)){const i=parseFloat(e.replace("%",""));a=c+s.get(d,i)}}e.indexOf("vw")!==-1&&parseFloat(e.replace("vw",""))===100&&(a=`${c}screen`),e.indexOf("vh")!==-1&&parseFloat(e.replace("vh",""))===100&&(a=`${c}screen`);break;case"minWidth":e.indexOf("%")!==-1&&parseFloat(e.replace("%",""))===100&&(a=`${c}full`),e==="0px"&&(a="min-w-0");break;case"maxWidth":e==="0px"&&(a="max-w-0");const x={"320px":"xs","384px":"sm","448px":"md","512px":"lg","576px":"xl","672px":"2xl","768px":"3xl","896px":"4xl","1024px":"5xl","1152px":"6xl","1280px":"7xl","100%":"full","65ch":"prose","640px":"screen-sm","1536px":"screen-2xl"};s.includes(s.keys(x),e)&&(a=`max-w-${x[e]}`);break;case"minHeight":e.indexOf("%")!==-1&&parseFloat(e.replace("%",""))===100&&(a=`${c}full`),e==="0px"&&(a="min-h-0"),e==="100vh"&&(a="min-h-screen");break;case"fontSize":const o={"12px":"xs","14px":"sm","16px":"base","18px":"lg","20px":"xl","24px":"2xl","30px":"3xl","36px":"4xl","48px":"5xl","60px":"6xl","72px":"7xl","96px":"8xl","128px":"9xl"};s.includes(s.keys(o),e)&&(a=c+o[e]);break;case"lineHeight":const u={"12px":"3","16px":"4","20px":"5","24px":"6","28px":"7","32px":"8","36px":"9","40px":"10",1:"none","1.25":"tight","1.375":"snug","1.5":"normal","1.625":"relaxed",2:"loose"};s.includes(s.keys(u),e)&&(a=c+u[e]);break;case"zIndex":a=["0","10","20","30","40","50"].indexOf(e)!==-1?`${c}${e}`:n;break;case"opacity":const g=["0","5","10","20","25","30","40","50","60","70","75","80","90","95","100"],f=parseFloat(e)*100;s.includes(g,f.toString())&&(a=`opacity-${f}`);break}return a};exports.cn=h.cn;exports.generateUUID=r.generateUUID;exports.getBreakpointValue=r.getBreakpointValue;exports.getBlocksFromHTML=T.getBlocksFromHTML;exports.convertArbitraryToTailwindClass=w;
|
package/dist/lib.d.ts
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { ClassValue } from 'clsx';
|
|
2
|
+
|
|
3
|
+
declare type ChaiBlock = {
|
|
4
|
+
_id: string;
|
|
5
|
+
_name?: string;
|
|
6
|
+
_parent?: string | null | undefined;
|
|
7
|
+
_bindings?: Record<string, string>;
|
|
8
|
+
readonly _type: string;
|
|
9
|
+
} & Record<string, string>;
|
|
10
|
+
|
|
11
|
+
export declare const cn: (...inputs: ClassValue[]) => string;
|
|
12
|
+
|
|
13
|
+
export declare const convertArbitraryToTailwindClass: (className: string) => string;
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Get the unique uuid
|
|
17
|
+
*/
|
|
18
|
+
export declare function generateUUID(length?: number, chars?: string): string;
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
*
|
|
22
|
+
* @param html
|
|
23
|
+
* @returns Blocks JSON
|
|
24
|
+
*/
|
|
25
|
+
export declare const getBlocksFromHTML: (html: string) => ChaiBlock[];
|
|
26
|
+
|
|
27
|
+
export declare const getBreakpointValue: (width: number) => "2XL" | "XL" | "LG" | "MD" | "SM" | "XS";
|
|
28
|
+
|
|
29
|
+
export { }
|
package/dist/lib.js
ADDED
|
@@ -0,0 +1,223 @@
|
|
|
1
|
+
import { c as R } from "./utils-ac68b2c8.js";
|
|
2
|
+
import { c as T } from "./Class-e6b07b79.js";
|
|
3
|
+
import { g as z, a as C } from "./Class-e6b07b79.js";
|
|
4
|
+
import { g as M } from "./html-to-json-fecbbe16.js";
|
|
5
|
+
import { first as V, includes as t, keys as i, map as u, parseInt as b, get as O } from "lodash";
|
|
6
|
+
import "clsx";
|
|
7
|
+
import "tailwind-merge";
|
|
8
|
+
import "himalaya";
|
|
9
|
+
import "./CONTROLS-442caee5.js";
|
|
10
|
+
const g = {
|
|
11
|
+
25: "1/4",
|
|
12
|
+
"33.33": "1/3",
|
|
13
|
+
50: "1/2",
|
|
14
|
+
"66.67": "2/3",
|
|
15
|
+
75: "3/4",
|
|
16
|
+
20: "1/5",
|
|
17
|
+
40: "2/5",
|
|
18
|
+
60: "3/5",
|
|
19
|
+
80: "4/5",
|
|
20
|
+
"16.67": "1/6",
|
|
21
|
+
"83.33": "5/6",
|
|
22
|
+
"8.33": "1/12",
|
|
23
|
+
"41.67": "5/12",
|
|
24
|
+
"58.33": "7/12",
|
|
25
|
+
"91.67": "11/12",
|
|
26
|
+
100: "full"
|
|
27
|
+
}, _ = {
|
|
28
|
+
0: "0",
|
|
29
|
+
1: "px",
|
|
30
|
+
2: "0.5",
|
|
31
|
+
4: "1",
|
|
32
|
+
6: "1.5",
|
|
33
|
+
8: "2",
|
|
34
|
+
10: "2.5",
|
|
35
|
+
12: "3",
|
|
36
|
+
14: "3.5",
|
|
37
|
+
16: "4",
|
|
38
|
+
20: "5",
|
|
39
|
+
24: "6",
|
|
40
|
+
28: "7",
|
|
41
|
+
32: "8",
|
|
42
|
+
36: "9",
|
|
43
|
+
40: "10",
|
|
44
|
+
44: "11",
|
|
45
|
+
48: "12",
|
|
46
|
+
56: "14",
|
|
47
|
+
64: "16",
|
|
48
|
+
80: "20",
|
|
49
|
+
96: "24",
|
|
50
|
+
112: "28",
|
|
51
|
+
128: "32",
|
|
52
|
+
144: "36",
|
|
53
|
+
160: "40",
|
|
54
|
+
176: "44",
|
|
55
|
+
192: "48",
|
|
56
|
+
208: "52",
|
|
57
|
+
224: "56",
|
|
58
|
+
240: "60",
|
|
59
|
+
256: "64",
|
|
60
|
+
288: "72",
|
|
61
|
+
320: "80",
|
|
62
|
+
384: "96"
|
|
63
|
+
}, $ = 16, k = 4;
|
|
64
|
+
function w(s) {
|
|
65
|
+
return s.indexOf("rem") !== -1 && (s = `${parseFloat(s.replace("rem", "")) * $}px`), s;
|
|
66
|
+
}
|
|
67
|
+
const B = (s) => {
|
|
68
|
+
const r = s.match(/\[.*\]/);
|
|
69
|
+
if (r === null)
|
|
70
|
+
return s;
|
|
71
|
+
const x = T(s);
|
|
72
|
+
if (x === null)
|
|
73
|
+
return s;
|
|
74
|
+
const { property: d } = x;
|
|
75
|
+
let e = V(r).replace(/\]/i, "").replace(/\[/i, "");
|
|
76
|
+
const c = s.replace(/\[.*\]/i, "");
|
|
77
|
+
e = w(e);
|
|
78
|
+
let a = s;
|
|
79
|
+
switch (d) {
|
|
80
|
+
case "top":
|
|
81
|
+
case "right":
|
|
82
|
+
case "left":
|
|
83
|
+
case "bottom":
|
|
84
|
+
case "inset":
|
|
85
|
+
case "insetX":
|
|
86
|
+
case "insetY":
|
|
87
|
+
case "gap":
|
|
88
|
+
case "gapX":
|
|
89
|
+
case "gapY":
|
|
90
|
+
case "padding":
|
|
91
|
+
case "paddingX":
|
|
92
|
+
case "paddingY":
|
|
93
|
+
case "paddingTop":
|
|
94
|
+
case "paddingRight":
|
|
95
|
+
case "paddingBottom":
|
|
96
|
+
case "paddingLeft":
|
|
97
|
+
case "margin":
|
|
98
|
+
case "marginX":
|
|
99
|
+
case "marginY":
|
|
100
|
+
case "marginTop":
|
|
101
|
+
case "marginRight":
|
|
102
|
+
case "marginBottom":
|
|
103
|
+
case "marginLeft":
|
|
104
|
+
case "flexBasis":
|
|
105
|
+
case "width":
|
|
106
|
+
case "height":
|
|
107
|
+
case "maxHeight":
|
|
108
|
+
case "textIndent":
|
|
109
|
+
case "spaceX":
|
|
110
|
+
case "spaceY":
|
|
111
|
+
if (e.indexOf("px") !== -1) {
|
|
112
|
+
const p = u(i(_), (n) => `${n}px`);
|
|
113
|
+
if (t(p, e)) {
|
|
114
|
+
const n = b(e.replace("px", ""), 10);
|
|
115
|
+
n === 1 ? a = `${c}px` : a = c + n / k;
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
if (e.indexOf("%") !== -1) {
|
|
119
|
+
const p = u(i(g), (n) => `${n}%`);
|
|
120
|
+
if (t(p, e)) {
|
|
121
|
+
const n = parseFloat(e.replace("%", ""));
|
|
122
|
+
a = c + O(g, n);
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
e.indexOf("vw") !== -1 && parseFloat(e.replace("vw", "")) === 100 && (a = `${c}screen`), e.indexOf("vh") !== -1 && parseFloat(e.replace("vh", "")) === 100 && (a = `${c}screen`);
|
|
126
|
+
break;
|
|
127
|
+
case "minWidth":
|
|
128
|
+
e.indexOf("%") !== -1 && parseFloat(e.replace("%", "")) === 100 && (a = `${c}full`), e === "0px" && (a = "min-w-0");
|
|
129
|
+
break;
|
|
130
|
+
case "maxWidth":
|
|
131
|
+
e === "0px" && (a = "max-w-0");
|
|
132
|
+
const l = {
|
|
133
|
+
"320px": "xs",
|
|
134
|
+
"384px": "sm",
|
|
135
|
+
"448px": "md",
|
|
136
|
+
"512px": "lg",
|
|
137
|
+
"576px": "xl",
|
|
138
|
+
"672px": "2xl",
|
|
139
|
+
"768px": "3xl",
|
|
140
|
+
"896px": "4xl",
|
|
141
|
+
"1024px": "5xl",
|
|
142
|
+
"1152px": "6xl",
|
|
143
|
+
"1280px": "7xl",
|
|
144
|
+
"100%": "full",
|
|
145
|
+
"65ch": "prose",
|
|
146
|
+
"640px": "screen-sm",
|
|
147
|
+
"1536px": "screen-2xl"
|
|
148
|
+
};
|
|
149
|
+
t(i(l), e) && (a = `max-w-${l[e]}`);
|
|
150
|
+
break;
|
|
151
|
+
case "minHeight":
|
|
152
|
+
e.indexOf("%") !== -1 && parseFloat(e.replace("%", "")) === 100 && (a = `${c}full`), e === "0px" && (a = "min-h-0"), e === "100vh" && (a = "min-h-screen");
|
|
153
|
+
break;
|
|
154
|
+
case "fontSize":
|
|
155
|
+
const o = {
|
|
156
|
+
"12px": "xs",
|
|
157
|
+
"14px": "sm",
|
|
158
|
+
"16px": "base",
|
|
159
|
+
"18px": "lg",
|
|
160
|
+
"20px": "xl",
|
|
161
|
+
"24px": "2xl",
|
|
162
|
+
"30px": "3xl",
|
|
163
|
+
"36px": "4xl",
|
|
164
|
+
"48px": "5xl",
|
|
165
|
+
"60px": "6xl",
|
|
166
|
+
"72px": "7xl",
|
|
167
|
+
"96px": "8xl",
|
|
168
|
+
"128px": "9xl"
|
|
169
|
+
};
|
|
170
|
+
t(i(o), e) && (a = c + o[e]);
|
|
171
|
+
break;
|
|
172
|
+
case "lineHeight":
|
|
173
|
+
const f = {
|
|
174
|
+
"12px": "3",
|
|
175
|
+
"16px": "4",
|
|
176
|
+
"20px": "5",
|
|
177
|
+
"24px": "6",
|
|
178
|
+
"28px": "7",
|
|
179
|
+
"32px": "8",
|
|
180
|
+
"36px": "9",
|
|
181
|
+
"40px": "10",
|
|
182
|
+
1: "none",
|
|
183
|
+
"1.25": "tight",
|
|
184
|
+
"1.375": "snug",
|
|
185
|
+
"1.5": "normal",
|
|
186
|
+
"1.625": "relaxed",
|
|
187
|
+
2: "loose"
|
|
188
|
+
};
|
|
189
|
+
t(i(f), e) && (a = c + f[e]);
|
|
190
|
+
break;
|
|
191
|
+
case "zIndex":
|
|
192
|
+
a = ["0", "10", "20", "30", "40", "50"].indexOf(e) !== -1 ? `${c}${e}` : s;
|
|
193
|
+
break;
|
|
194
|
+
case "opacity":
|
|
195
|
+
const h = [
|
|
196
|
+
"0",
|
|
197
|
+
"5",
|
|
198
|
+
"10",
|
|
199
|
+
"20",
|
|
200
|
+
"25",
|
|
201
|
+
"30",
|
|
202
|
+
"40",
|
|
203
|
+
"50",
|
|
204
|
+
"60",
|
|
205
|
+
"70",
|
|
206
|
+
"75",
|
|
207
|
+
"80",
|
|
208
|
+
"90",
|
|
209
|
+
"95",
|
|
210
|
+
"100"
|
|
211
|
+
], m = parseFloat(e) * 100;
|
|
212
|
+
t(h, m.toString()) && (a = `opacity-${m}`);
|
|
213
|
+
break;
|
|
214
|
+
}
|
|
215
|
+
return a;
|
|
216
|
+
};
|
|
217
|
+
export {
|
|
218
|
+
R as cn,
|
|
219
|
+
B as convertArbitraryToTailwindClass,
|
|
220
|
+
z as generateUUID,
|
|
221
|
+
M as getBlocksFromHTML,
|
|
222
|
+
C as getBreakpointValue
|
|
223
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const e=require("./jsx-runtime-5c3ac4f7.cjs"),d=require("react"),h=require("./utils-3c452dd0.cjs"),m=require("react-icons-picker"),f=require("react-dom"),g=require("lodash"),u=require("./dialog-170eaad9.cjs"),b=require("./ImagesPanel-160aa664.cjs"),R=require("react-quill");require("react-i18next");const E=require("./useBuilderProp-5e57d0c8.cjs");function k(t){const s=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const r in t)if(r!=="default"){const n=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(s,r,n.get?n:{enumerable:!0,get:()=>t[r]})}}return s.default=t,Object.freeze(s)}const v=k(d),j=v.forwardRef(({className:t,type:s,...r},n)=>e.jsxRuntimeExports.jsx("input",{type:s,className:h.cn("flex h-9 w-full rounded-md border border-border bg-background px-3 py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",t),ref:n,...r}));j.displayName="Input";const y=t=>{const s=document.getElementById("icon-picker-field"),r=document.createElement("div");f.render(e.jsxRuntimeExports.jsx(m.IconPickerItem,{value:t}),r),s.appendChild(r),r.hidden=!0;const n=r.innerHTML;return setTimeout(()=>s.removeChild(r),1e3),n},I=({value:t,onChange:s,onBlur:r,id:n})=>{const a=i=>{s("<svg />");const l=y(i);s(l),r(n,l)};return e.jsxRuntimeExports.jsxs("div",{className:"mt-1 flex h-20 items-center gap-x-2",id:"icon-picker-field",children:[e.jsxRuntimeExports.jsxs("div",{className:"relative h-12 w-12",children:[e.jsxRuntimeExports.jsx("div",{dangerouslySetInnerHTML:{__html:t==null?void 0:t.replace("<svg",'<svg class="h-5 w-5"')},className:"absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 transform cursor-pointer bg-white hover:hidden hover:h-0"}),e.jsxRuntimeExports.jsx(m,{value:t?"BiSolidGrid":null,onChange:a,pickButtonStyle:{height:"48px",width:"48px",border:"1px solid #BBBBBB",display:"flex",alignItems:"center",justifyContent:"center",borderRadius:"6px"},searchInputStyle:{backgroundColor:"transparent",width:"100%",border:"1px solid #BBBBBB",margin:"0px 10px",padding:"10px"}})]}),e.jsxRuntimeExports.jsx("textarea",{value:t,onChange:i=>s(i.target.value),className:"h-full w-full rounded-sm border-foreground/20 px-2 py-1 text-xs shadow-sm focus:border-gray-500/80 focus:outline-none focus:ring-0",placeholder:"Choose icon or enter svg"})]})},P=I,w=({children:t,onSelect:s})=>{const[r,n]=d.useState(!1),a=(...i)=>{s.call(void 0,...i),n(!1)};return e.jsxRuntimeExports.jsxs(u.Dialog,{open:r,onOpenChange:i=>n(i),children:[e.jsxRuntimeExports.jsx(u.DialogTrigger,{asChild:!0,children:t}),e.jsxRuntimeExports.jsx(u.DialogContent,{className:"flex h-3/4 max-w-5xl",children:e.jsxRuntimeExports.jsx("div",{className:"h-full w-full",children:e.jsxRuntimeExports.jsx(b.default,{isModalView:!0,onSelect:a})})})]})},p=w,N=({value:t,onChange:s,id:r,onBlur:n})=>e.jsxRuntimeExports.jsxs("div",{className:"mt-1.5 flex items-center gap-x-3",children:[t?e.jsxRuntimeExports.jsx("img",{src:t,className:"h-20 w-20 overflow-hidden rounded-md border object-cover",alt:""}):e.jsxRuntimeExports.jsx(p,{onSelect:s,children:e.jsxRuntimeExports.jsx("div",{className:"h-20 w-20 cursor-pointer rounded-md border bg-[radial-gradient(#AAA,transparent_1px)] duration-300 [background-size:10px_10px] hover:border-gray-400"})}),e.jsxRuntimeExports.jsxs("div",{className:"flex w-3/5 flex-col",children:[e.jsxRuntimeExports.jsx(p,{onSelect:s,children:e.jsxRuntimeExports.jsx("small",{className:"cursor-pointer rounded-full bg-gray-600 px-2 py-1 text-center text-xs text-white hover:bg-gray-500 dark:bg-gray-700",children:t||!g.isEmpty(t)?"Replace Image":"Choose Image"})}),e.jsxRuntimeExports.jsx("small",{className:"-pl-4 pt-2 text-center text-xs text-gray-600",children:"OR"}),e.jsxRuntimeExports.jsx("input",{type:"url",className:"text-xs",placeholder:"Enter image URL",value:t,onBlur:({target:{value:a}})=>n(r,a),onChange:a=>s(a.target.value)})]})]}),B=N,C=({id:t,placeholder:s,value:r,onChange:n,onBlur:a})=>{const i={toolbar:[["bold","italic","underline","strike","blockquote"],[{list:"ordered"},{list:"bullet"}],[{color:[]},{background:[]},{align:[]}],["link","clean"]]},l=["header","font","list","bold","italic","underline","strike","blockquote","color","background","align","link","image"];return e.jsxRuntimeExports.jsx(R,{id:t,value:r,onBlur:c=>a(t,c),onChange:c=>n(c),modules:i,formats:l,placeholder:s,className:"mt-1 rounded-md"})},S=C,q=({schema:t,formData:s,onChange:r})=>{const[n,a]=d.useState([]),i=E.useBuilderProp("getPages",()=>[]),{type:l="page",href:c="",target:x="self"}=s;return d.useEffect(()=>{(async()=>{const o=await i();a(o)})()},[i]),e.jsxRuntimeExports.jsxs("div",{children:[e.jsxRuntimeExports.jsx("span",{className:"text-xs font-medium",children:(t==null?void 0:t.title)??"Link"}),e.jsxRuntimeExports.jsxs("div",{className:"flex flex-col gap-y-1.5",children:[e.jsxRuntimeExports.jsx("select",{name:"type",defaultValue:"page",value:l,onChange:o=>r({...s,type:o.target.value}),children:[{const:"page",title:"Open Page"},{const:"url",title:"Open URL"},{const:"email",title:"Compose Email"},{const:"telephone",title:"Call Phone"},{const:"scroll",title:"Scroll to element"}].map(o=>e.jsxRuntimeExports.jsx("option",{value:o.const,children:o.title},o.const))}),l==="page"?e.jsxRuntimeExports.jsxs("select",{name:"href",defaultValue:"",placeholder:"Choose Page",value:c,onChange:o=>r({...s,href:o.target.value}),children:[e.jsxRuntimeExports.jsx("option",{value:"",children:"Choose page"}),g.map(n,o=>e.jsxRuntimeExports.jsx("option",{value:o.slug,children:o.page_name},o.uuid))]}):e.jsxRuntimeExports.jsx("input",{name:"href",type:"text",value:c,onChange:o=>r({...s,href:o.target.value}),placeholder:l==="page"||l==="url"?"Enter URL":l==="scroll"?"#ElementID":"Enter detail"}),(l==="page"||l==="url")&&e.jsxRuntimeExports.jsxs("div",{className:"flex items-center gap-x-2",children:[e.jsxRuntimeExports.jsx("input",{type:"checkbox",defaultChecked:x==="_blank",className:"cursor-pointer rounded-md border border-border",onChange:()=>r({...s,target:x==="_blank"?"_self":"_blank"})}),e.jsxRuntimeExports.jsx("span",{className:"pt-1 text-xs",children:"Open in new tab"})]})]})]})},_=q;exports.IconPickerField=P;exports.ImagePickerField=B;exports.Input=j;exports.LinkField=_;exports.RTEField=S;
|
|
@@ -0,0 +1,211 @@
|
|
|
1
|
+
import { j as e } from "./jsx-runtime-944c88e2.js";
|
|
2
|
+
import * as u from "react";
|
|
3
|
+
import { useState as m, useEffect as x } from "react";
|
|
4
|
+
import { c as g } from "./utils-ac68b2c8.js";
|
|
5
|
+
import h, { IconPickerItem as f } from "react-icons-picker";
|
|
6
|
+
import b from "react-dom";
|
|
7
|
+
import { isEmpty as j, map as k } from "lodash";
|
|
8
|
+
import { D as v, b as y, a as w } from "./dialog-3d4e82ed.js";
|
|
9
|
+
import I from "./ImagesPanel-815d5e6f.js";
|
|
10
|
+
import N from "react-quill";
|
|
11
|
+
import "react-i18next";
|
|
12
|
+
import { u as B } from "./useBuilderProp-81a14920.js";
|
|
13
|
+
const P = u.forwardRef(({ className: t, type: r, ...s }, o) => /* @__PURE__ */ e.jsx(
|
|
14
|
+
"input",
|
|
15
|
+
{
|
|
16
|
+
type: r,
|
|
17
|
+
className: g(
|
|
18
|
+
"flex h-9 w-full rounded-md border border-border bg-background px-3 py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",
|
|
19
|
+
t
|
|
20
|
+
),
|
|
21
|
+
ref: o,
|
|
22
|
+
...s
|
|
23
|
+
}
|
|
24
|
+
));
|
|
25
|
+
P.displayName = "Input";
|
|
26
|
+
const C = (t) => {
|
|
27
|
+
const r = document.getElementById("icon-picker-field"), s = document.createElement("div");
|
|
28
|
+
b.render(/* @__PURE__ */ e.jsx(f, { value: t }), s), r.appendChild(s), s.hidden = !0;
|
|
29
|
+
const o = s.innerHTML;
|
|
30
|
+
return setTimeout(() => r.removeChild(s), 1e3), o;
|
|
31
|
+
}, R = ({ value: t, onChange: r, onBlur: s, id: o }) => {
|
|
32
|
+
const i = (n) => {
|
|
33
|
+
r("<svg />");
|
|
34
|
+
const a = C(n);
|
|
35
|
+
r(a), s(o, a);
|
|
36
|
+
};
|
|
37
|
+
return /* @__PURE__ */ e.jsxs("div", { className: "mt-1 flex h-20 items-center gap-x-2", id: "icon-picker-field", children: [
|
|
38
|
+
/* @__PURE__ */ e.jsxs("div", { className: "relative h-12 w-12", children: [
|
|
39
|
+
/* @__PURE__ */ e.jsx(
|
|
40
|
+
"div",
|
|
41
|
+
{
|
|
42
|
+
dangerouslySetInnerHTML: { __html: t == null ? void 0 : t.replace("<svg", '<svg class="h-5 w-5"') },
|
|
43
|
+
className: "absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 transform cursor-pointer bg-white hover:hidden hover:h-0"
|
|
44
|
+
}
|
|
45
|
+
),
|
|
46
|
+
/* @__PURE__ */ e.jsx(
|
|
47
|
+
h,
|
|
48
|
+
{
|
|
49
|
+
value: t ? "BiSolidGrid" : null,
|
|
50
|
+
onChange: i,
|
|
51
|
+
pickButtonStyle: {
|
|
52
|
+
height: "48px",
|
|
53
|
+
width: "48px",
|
|
54
|
+
border: "1px solid #BBBBBB",
|
|
55
|
+
display: "flex",
|
|
56
|
+
alignItems: "center",
|
|
57
|
+
justifyContent: "center",
|
|
58
|
+
borderRadius: "6px"
|
|
59
|
+
},
|
|
60
|
+
searchInputStyle: {
|
|
61
|
+
backgroundColor: "transparent",
|
|
62
|
+
width: "100%",
|
|
63
|
+
border: "1px solid #BBBBBB",
|
|
64
|
+
margin: "0px 10px",
|
|
65
|
+
padding: "10px"
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
)
|
|
69
|
+
] }),
|
|
70
|
+
/* @__PURE__ */ e.jsx(
|
|
71
|
+
"textarea",
|
|
72
|
+
{
|
|
73
|
+
value: t,
|
|
74
|
+
onChange: (n) => r(n.target.value),
|
|
75
|
+
className: "h-full w-full rounded-sm border-foreground/20 px-2 py-1 text-xs shadow-sm focus:border-gray-500/80 focus:outline-none focus:ring-0",
|
|
76
|
+
placeholder: "Choose icon or enter svg"
|
|
77
|
+
}
|
|
78
|
+
)
|
|
79
|
+
] });
|
|
80
|
+
}, z = R, E = ({ children: t, onSelect: r }) => {
|
|
81
|
+
const [s, o] = m(!1), i = (...n) => {
|
|
82
|
+
r.call(void 0, ...n), o(!1);
|
|
83
|
+
};
|
|
84
|
+
return /* @__PURE__ */ e.jsxs(v, { open: s, onOpenChange: (n) => o(n), children: [
|
|
85
|
+
/* @__PURE__ */ e.jsx(y, { asChild: !0, children: t }),
|
|
86
|
+
/* @__PURE__ */ e.jsx(w, { className: "flex h-3/4 max-w-5xl", children: /* @__PURE__ */ e.jsx("div", { className: "h-full w-full", children: /* @__PURE__ */ e.jsx(I, { isModalView: !0, onSelect: i }) }) })
|
|
87
|
+
] });
|
|
88
|
+
}, p = E, S = ({ value: t, onChange: r, id: s, onBlur: o }) => /* @__PURE__ */ e.jsxs("div", { className: "mt-1.5 flex items-center gap-x-3", children: [
|
|
89
|
+
t ? /* @__PURE__ */ e.jsx("img", { src: t, className: "h-20 w-20 overflow-hidden rounded-md border object-cover", alt: "" }) : /* @__PURE__ */ e.jsx(p, { onSelect: r, children: /* @__PURE__ */ e.jsx("div", { className: "h-20 w-20 cursor-pointer rounded-md border bg-[radial-gradient(#AAA,transparent_1px)] duration-300 [background-size:10px_10px] hover:border-gray-400" }) }),
|
|
90
|
+
/* @__PURE__ */ e.jsxs("div", { className: "flex w-3/5 flex-col", children: [
|
|
91
|
+
/* @__PURE__ */ e.jsx(p, { onSelect: r, children: /* @__PURE__ */ e.jsx("small", { className: "cursor-pointer rounded-full bg-gray-600 px-2 py-1 text-center text-xs text-white hover:bg-gray-500 dark:bg-gray-700", children: t || !j(t) ? "Replace Image" : "Choose Image" }) }),
|
|
92
|
+
/* @__PURE__ */ e.jsx("small", { className: "-pl-4 pt-2 text-center text-xs text-gray-600", children: "OR" }),
|
|
93
|
+
/* @__PURE__ */ e.jsx(
|
|
94
|
+
"input",
|
|
95
|
+
{
|
|
96
|
+
type: "url",
|
|
97
|
+
className: "text-xs",
|
|
98
|
+
placeholder: "Enter image URL",
|
|
99
|
+
value: t,
|
|
100
|
+
onBlur: ({ target: { value: i } }) => o(s, i),
|
|
101
|
+
onChange: (i) => r(i.target.value)
|
|
102
|
+
}
|
|
103
|
+
)
|
|
104
|
+
] })
|
|
105
|
+
] }), G = S, _ = ({ id: t, placeholder: r, value: s, onChange: o, onBlur: i }) => {
|
|
106
|
+
const n = {
|
|
107
|
+
toolbar: [
|
|
108
|
+
["bold", "italic", "underline", "strike", "blockquote"],
|
|
109
|
+
[{ list: "ordered" }, { list: "bullet" }],
|
|
110
|
+
[{ color: [] }, { background: [] }, { align: [] }],
|
|
111
|
+
["link", "clean"]
|
|
112
|
+
]
|
|
113
|
+
}, a = [
|
|
114
|
+
"header",
|
|
115
|
+
"font",
|
|
116
|
+
"list",
|
|
117
|
+
"bold",
|
|
118
|
+
"italic",
|
|
119
|
+
"underline",
|
|
120
|
+
"strike",
|
|
121
|
+
"blockquote",
|
|
122
|
+
"color",
|
|
123
|
+
"background",
|
|
124
|
+
"align",
|
|
125
|
+
"link",
|
|
126
|
+
"image"
|
|
127
|
+
];
|
|
128
|
+
return /* @__PURE__ */ e.jsx(
|
|
129
|
+
N,
|
|
130
|
+
{
|
|
131
|
+
id: t,
|
|
132
|
+
value: s,
|
|
133
|
+
onBlur: (c) => i(t, c),
|
|
134
|
+
onChange: (c) => o(c),
|
|
135
|
+
modules: n,
|
|
136
|
+
formats: a,
|
|
137
|
+
placeholder: r,
|
|
138
|
+
className: "mt-1 rounded-md"
|
|
139
|
+
}
|
|
140
|
+
);
|
|
141
|
+
}, Q = _, L = ({ schema: t, formData: r, onChange: s }) => {
|
|
142
|
+
const [o, i] = m([]), n = B("getPages", () => []), { type: a = "page", href: c = "", target: d = "self" } = r;
|
|
143
|
+
return x(() => {
|
|
144
|
+
(async () => {
|
|
145
|
+
const l = await n();
|
|
146
|
+
i(l);
|
|
147
|
+
})();
|
|
148
|
+
}, [n]), /* @__PURE__ */ e.jsxs("div", { children: [
|
|
149
|
+
/* @__PURE__ */ e.jsx("span", { className: "text-xs font-medium", children: (t == null ? void 0 : t.title) ?? "Link" }),
|
|
150
|
+
/* @__PURE__ */ e.jsxs("div", { className: "flex flex-col gap-y-1.5", children: [
|
|
151
|
+
/* @__PURE__ */ e.jsx(
|
|
152
|
+
"select",
|
|
153
|
+
{
|
|
154
|
+
name: "type",
|
|
155
|
+
defaultValue: "page",
|
|
156
|
+
value: a,
|
|
157
|
+
onChange: (l) => s({ ...r, type: l.target.value }),
|
|
158
|
+
children: [
|
|
159
|
+
{ const: "page", title: "Open Page" },
|
|
160
|
+
{ const: "url", title: "Open URL" },
|
|
161
|
+
{ const: "email", title: "Compose Email" },
|
|
162
|
+
{ const: "telephone", title: "Call Phone" },
|
|
163
|
+
{ const: "scroll", title: "Scroll to element" }
|
|
164
|
+
].map((l) => /* @__PURE__ */ e.jsx("option", { value: l.const, children: l.title }, l.const))
|
|
165
|
+
}
|
|
166
|
+
),
|
|
167
|
+
a === "page" ? /* @__PURE__ */ e.jsxs(
|
|
168
|
+
"select",
|
|
169
|
+
{
|
|
170
|
+
name: "href",
|
|
171
|
+
defaultValue: "",
|
|
172
|
+
placeholder: "Choose Page",
|
|
173
|
+
value: c,
|
|
174
|
+
onChange: (l) => s({ ...r, href: l.target.value }),
|
|
175
|
+
children: [
|
|
176
|
+
/* @__PURE__ */ e.jsx("option", { value: "", children: "Choose page" }),
|
|
177
|
+
k(o, (l) => /* @__PURE__ */ e.jsx("option", { value: l.slug, children: l.page_name }, l.uuid))
|
|
178
|
+
]
|
|
179
|
+
}
|
|
180
|
+
) : /* @__PURE__ */ e.jsx(
|
|
181
|
+
"input",
|
|
182
|
+
{
|
|
183
|
+
name: "href",
|
|
184
|
+
type: "text",
|
|
185
|
+
value: c,
|
|
186
|
+
onChange: (l) => s({ ...r, href: l.target.value }),
|
|
187
|
+
placeholder: a === "page" || a === "url" ? "Enter URL" : a === "scroll" ? "#ElementID" : "Enter detail"
|
|
188
|
+
}
|
|
189
|
+
),
|
|
190
|
+
(a === "page" || a === "url") && /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-x-2", children: [
|
|
191
|
+
/* @__PURE__ */ e.jsx(
|
|
192
|
+
"input",
|
|
193
|
+
{
|
|
194
|
+
type: "checkbox",
|
|
195
|
+
defaultChecked: d === "_blank",
|
|
196
|
+
className: "cursor-pointer rounded-md border border-border",
|
|
197
|
+
onChange: () => s({ ...r, target: d === "_blank" ? "_self" : "_blank" })
|
|
198
|
+
}
|
|
199
|
+
),
|
|
200
|
+
/* @__PURE__ */ e.jsx("span", { className: "pt-1 text-xs", children: "Open in new tab" })
|
|
201
|
+
] })
|
|
202
|
+
] })
|
|
203
|
+
] });
|
|
204
|
+
}, J = L;
|
|
205
|
+
export {
|
|
206
|
+
P as I,
|
|
207
|
+
J as L,
|
|
208
|
+
Q as R,
|
|
209
|
+
z as a,
|
|
210
|
+
G as b
|
|
211
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const n=require("./jsx-runtime-5c3ac4f7.cjs"),c=require("react"),p=require("@radix-ui/react-popover"),l=require("./utils-3c452dd0.cjs");function i(e){const o=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const a=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(o,t,a.get?a:{enumerable:!0,get:()=>e[t]})}}return o.default=e,Object.freeze(o)}const m=i(c),r=i(p),u=r.Root,f=r.Trigger,s=m.forwardRef(({className:e,align:o="center",sideOffset:t=4,...a},d)=>n.jsxRuntimeExports.jsx(r.Portal,{children:n.jsxRuntimeExports.jsx(r.Content,{ref:d,align:o,sideOffset:t,className:l.cn("z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...a})}));s.displayName=r.Content.displayName;exports.Popover=u;exports.PopoverContent=s;exports.PopoverTrigger=f;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { j as t } from "./jsx-runtime-944c88e2.js";
|
|
2
|
+
import * as i from "react";
|
|
3
|
+
import * as o from "@radix-ui/react-popover";
|
|
4
|
+
import { c as n } from "./utils-ac68b2c8.js";
|
|
5
|
+
const l = o.Root, c = o.Trigger, m = i.forwardRef(({ className: e, align: a = "center", sideOffset: r = 4, ...s }, d) => /* @__PURE__ */ t.jsx(o.Portal, { children: /* @__PURE__ */ t.jsx(
|
|
6
|
+
o.Content,
|
|
7
|
+
{
|
|
8
|
+
ref: d,
|
|
9
|
+
align: a,
|
|
10
|
+
sideOffset: r,
|
|
11
|
+
className: n(
|
|
12
|
+
"z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
|
|
13
|
+
e
|
|
14
|
+
),
|
|
15
|
+
...s
|
|
16
|
+
}
|
|
17
|
+
) }));
|
|
18
|
+
m.displayName = o.Content.displayName;
|
|
19
|
+
export {
|
|
20
|
+
l as P,
|
|
21
|
+
c as a,
|
|
22
|
+
m as b
|
|
23
|
+
};
|
package/dist/render.cjs
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("./jsx-runtime-5c3ac4f7.cjs"),b=require("react"),n=require("lodash"),F=require("tailwind-merge"),u=require("./CONTROLS-031e1de3.cjs"),E=require("chaibuilder-blocks"),T=require("react-wrap-balancer"),z=require("@mhsdesign/jit-browser-tailwindcss"),S=require("@bobthered/tailwindcss-palette-generator"),D=require("./_commonjsHelpers-5a53b418.cjs"),_=require("@tailwindcss/forms"),j=require("@tailwindcss/typography"),L=require("@tailwindcss/aspect-ratio"),v=require("@tailwindcss/line-clamp"),R=e=>{const t={};return Object.keys(e).forEach(r=>{n.isString(e[r])&&e[r].startsWith(u.SLOT_KEY)&&(t[r]=e[r].replace(u.SLOT_KEY,"").split(","))}),t},A=n.memoize(e=>{const t=e.replace(u.STYLES_KEY,"").split(",");return F.twMerge(t[0],t[1])});function U(e,t){return n.get(e,`${t}_attrs`,{})}function $(e){const t={};return Object.keys(e).forEach(r=>{if(n.isString(e[r])&&e[r].startsWith(u.STYLES_KEY)){const o=A(e[r]);t[r]={className:o,...U(e,r)}}}),t}function x({blocks:e,parent:t}){const r=e,o=a=>$(a),i=t?n.filter(e,{_parent:t}):n.filter(e,a=>n.isEmpty(a._parent));return s.jsxRuntimeExports.jsx(s.jsxRuntimeExports.Fragment,{children:b.Children.toArray(i.map((a,g)=>{const m=R(a),p={};n.isEmpty(m)||Object.keys(m).forEach(l=>{p[l]=b.Children.toArray(m[l].map(f=>s.jsxRuntimeExports.jsx(x,{blocks:r,parent:f})))});const c=n.filter(r,{_parent:a._id});p.children=c.length>0?s.jsxRuntimeExports.jsx(x,{parent:a._id,blocks:r}):null;const d=E.getBlockComponent(a._type);if(d!==null){let l=a;const f=d.component;return l={...d.defaults,...a},b.createElement(f,n.omit({blockProps:{},...l,index:g,...o(l),...p,inBuilder:!1},["_parent"]))}return s.jsxRuntimeExports.jsxs("noscript",{children:[a._type," not found"]})}))})}const B=e=>{const t=n.get(e,"_bodyTextLightColor","#64748b"),r=n.get(e,"_bodyTextDarkColor","#94a3b8"),o=n.get(e,"_bodyBgLightColor","#FFFFFF"),i=n.get(e,"_bodyBgDarkColor","#0f172a");return`font-body antialiased text-[${t}] bg-[${o}] dark:text-[${r}] dark:bg-[${i}]`},O=({snapshot:e,before:t=null,after:r=null,classPrefix:o="c-"})=>{const i=n.get(e.projectData,"brandingOptions",{});return s.jsxRuntimeExports.jsxs(s.jsxRuntimeExports.Fragment,{children:[t,s.jsxRuntimeExports.jsx("div",{className:o.replace("-","")+" "+B(i)+" min-h-screen",children:s.jsxRuntimeExports.jsx(T.Provider,{children:s.jsxRuntimeExports.jsx(x,{blocks:e.pageData.blocks||[]})})}),r]})};var w={},C={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"cloneDeep",{enumerable:!0,get:function(){return t}});function t(r){return Array.isArray(r)?r.map(o=>t(o)):typeof r=="object"&&r!==null?Object.fromEntries(Object.entries(r).map(([o,i])=>[o,t(i)])):r}})(C);var q={content:[],presets:[],darkMode:"media",theme:{accentColor:({theme:e})=>({...e("colors"),auto:"auto"}),animation:{none:"none",spin:"spin 1s linear infinite",ping:"ping 1s cubic-bezier(0, 0, 0.2, 1) infinite",pulse:"pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite",bounce:"bounce 1s infinite"},aria:{busy:'busy="true"',checked:'checked="true"',disabled:'disabled="true"',expanded:'expanded="true"',hidden:'hidden="true"',pressed:'pressed="true"',readonly:'readonly="true"',required:'required="true"',selected:'selected="true"'},aspectRatio:{auto:"auto",square:"1 / 1",video:"16 / 9"},backdropBlur:({theme:e})=>e("blur"),backdropBrightness:({theme:e})=>e("brightness"),backdropContrast:({theme:e})=>e("contrast"),backdropGrayscale:({theme:e})=>e("grayscale"),backdropHueRotate:({theme:e})=>e("hueRotate"),backdropInvert:({theme:e})=>e("invert"),backdropOpacity:({theme:e})=>e("opacity"),backdropSaturate:({theme:e})=>e("saturate"),backdropSepia:({theme:e})=>e("sepia"),backgroundColor:({theme:e})=>e("colors"),backgroundImage:{none:"none","gradient-to-t":"linear-gradient(to top, var(--tw-gradient-stops))","gradient-to-tr":"linear-gradient(to top right, var(--tw-gradient-stops))","gradient-to-r":"linear-gradient(to right, var(--tw-gradient-stops))","gradient-to-br":"linear-gradient(to bottom right, var(--tw-gradient-stops))","gradient-to-b":"linear-gradient(to bottom, var(--tw-gradient-stops))","gradient-to-bl":"linear-gradient(to bottom left, var(--tw-gradient-stops))","gradient-to-l":"linear-gradient(to left, var(--tw-gradient-stops))","gradient-to-tl":"linear-gradient(to top left, var(--tw-gradient-stops))"},backgroundOpacity:({theme:e})=>e("opacity"),backgroundPosition:{bottom:"bottom",center:"center",left:"left","left-bottom":"left bottom","left-top":"left top",right:"right","right-bottom":"right bottom","right-top":"right top",top:"top"},backgroundSize:{auto:"auto",cover:"cover",contain:"contain"},blur:{0:"0",none:"0",sm:"4px",DEFAULT:"8px",md:"12px",lg:"16px",xl:"24px","2xl":"40px","3xl":"64px"},borderColor:({theme:e})=>({...e("colors"),DEFAULT:e("colors.gray.200","currentColor")}),borderOpacity:({theme:e})=>e("opacity"),borderRadius:{none:"0px",sm:"0.125rem",DEFAULT:"0.25rem",md:"0.375rem",lg:"0.5rem",xl:"0.75rem","2xl":"1rem","3xl":"1.5rem",full:"9999px"},borderSpacing:({theme:e})=>({...e("spacing")}),borderWidth:{DEFAULT:"1px",0:"0px",2:"2px",4:"4px",8:"8px"},boxShadow:{sm:"0 1px 2px 0 rgb(0 0 0 / 0.05)",DEFAULT:"0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1)",md:"0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1)",lg:"0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1)",xl:"0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1)","2xl":"0 25px 50px -12px rgb(0 0 0 / 0.25)",inner:"inset 0 2px 4px 0 rgb(0 0 0 / 0.05)",none:"none"},boxShadowColor:({theme:e})=>e("colors"),brightness:{0:"0",50:".5",75:".75",90:".9",95:".95",100:"1",105:"1.05",110:"1.1",125:"1.25",150:"1.5",200:"2"},caretColor:({theme:e})=>e("colors"),colors:({colors:e})=>({inherit:e.inherit,current:e.current,transparent:e.transparent,black:e.black,white:e.white,slate:e.slate,gray:e.gray,zinc:e.zinc,neutral:e.neutral,stone:e.stone,red:e.red,orange:e.orange,amber:e.amber,yellow:e.yellow,lime:e.lime,green:e.green,emerald:e.emerald,teal:e.teal,cyan:e.cyan,sky:e.sky,blue:e.blue,indigo:e.indigo,violet:e.violet,purple:e.purple,fuchsia:e.fuchsia,pink:e.pink,rose:e.rose}),columns:{auto:"auto",1:"1",2:"2",3:"3",4:"4",5:"5",6:"6",7:"7",8:"8",9:"9",10:"10",11:"11",12:"12","3xs":"16rem","2xs":"18rem",xs:"20rem",sm:"24rem",md:"28rem",lg:"32rem",xl:"36rem","2xl":"42rem","3xl":"48rem","4xl":"56rem","5xl":"64rem","6xl":"72rem","7xl":"80rem"},container:{},content:{none:"none"},contrast:{0:"0",50:".5",75:".75",100:"1",125:"1.25",150:"1.5",200:"2"},cursor:{auto:"auto",default:"default",pointer:"pointer",wait:"wait",text:"text",move:"move",help:"help","not-allowed":"not-allowed",none:"none","context-menu":"context-menu",progress:"progress",cell:"cell",crosshair:"crosshair","vertical-text":"vertical-text",alias:"alias",copy:"copy","no-drop":"no-drop",grab:"grab",grabbing:"grabbing","all-scroll":"all-scroll","col-resize":"col-resize","row-resize":"row-resize","n-resize":"n-resize","e-resize":"e-resize","s-resize":"s-resize","w-resize":"w-resize","ne-resize":"ne-resize","nw-resize":"nw-resize","se-resize":"se-resize","sw-resize":"sw-resize","ew-resize":"ew-resize","ns-resize":"ns-resize","nesw-resize":"nesw-resize","nwse-resize":"nwse-resize","zoom-in":"zoom-in","zoom-out":"zoom-out"},divideColor:({theme:e})=>e("borderColor"),divideOpacity:({theme:e})=>e("borderOpacity"),divideWidth:({theme:e})=>e("borderWidth"),dropShadow:{sm:"0 1px 1px rgb(0 0 0 / 0.05)",DEFAULT:["0 1px 2px rgb(0 0 0 / 0.1)","0 1px 1px rgb(0 0 0 / 0.06)"],md:["0 4px 3px rgb(0 0 0 / 0.07)","0 2px 2px rgb(0 0 0 / 0.06)"],lg:["0 10px 8px rgb(0 0 0 / 0.04)","0 4px 3px rgb(0 0 0 / 0.1)"],xl:["0 20px 13px rgb(0 0 0 / 0.03)","0 8px 5px rgb(0 0 0 / 0.08)"],"2xl":"0 25px 25px rgb(0 0 0 / 0.15)",none:"0 0 #0000"},fill:({theme:e})=>({none:"none",...e("colors")}),flex:{1:"1 1 0%",auto:"1 1 auto",initial:"0 1 auto",none:"none"},flexBasis:({theme:e})=>({auto:"auto",...e("spacing"),"1/2":"50%","1/3":"33.333333%","2/3":"66.666667%","1/4":"25%","2/4":"50%","3/4":"75%","1/5":"20%","2/5":"40%","3/5":"60%","4/5":"80%","1/6":"16.666667%","2/6":"33.333333%","3/6":"50%","4/6":"66.666667%","5/6":"83.333333%","1/12":"8.333333%","2/12":"16.666667%","3/12":"25%","4/12":"33.333333%","5/12":"41.666667%","6/12":"50%","7/12":"58.333333%","8/12":"66.666667%","9/12":"75%","10/12":"83.333333%","11/12":"91.666667%",full:"100%"}),flexGrow:{0:"0",DEFAULT:"1"},flexShrink:{0:"0",DEFAULT:"1"},fontFamily:{sans:["ui-sans-serif","system-ui","-apple-system","BlinkMacSystemFont",'"Segoe UI"',"Roboto",'"Helvetica Neue"',"Arial",'"Noto Sans"',"sans-serif",'"Apple Color Emoji"','"Segoe UI Emoji"','"Segoe UI Symbol"','"Noto Color Emoji"'],serif:["ui-serif","Georgia","Cambria",'"Times New Roman"',"Times","serif"],mono:["ui-monospace","SFMono-Regular","Menlo","Monaco","Consolas",'"Liberation Mono"','"Courier New"',"monospace"]},fontSize:{xs:["0.75rem",{lineHeight:"1rem"}],sm:["0.875rem",{lineHeight:"1.25rem"}],base:["1rem",{lineHeight:"1.5rem"}],lg:["1.125rem",{lineHeight:"1.75rem"}],xl:["1.25rem",{lineHeight:"1.75rem"}],"2xl":["1.5rem",{lineHeight:"2rem"}],"3xl":["1.875rem",{lineHeight:"2.25rem"}],"4xl":["2.25rem",{lineHeight:"2.5rem"}],"5xl":["3rem",{lineHeight:"1"}],"6xl":["3.75rem",{lineHeight:"1"}],"7xl":["4.5rem",{lineHeight:"1"}],"8xl":["6rem",{lineHeight:"1"}],"9xl":["8rem",{lineHeight:"1"}]},fontWeight:{thin:"100",extralight:"200",light:"300",normal:"400",medium:"500",semibold:"600",bold:"700",extrabold:"800",black:"900"},gap:({theme:e})=>e("spacing"),gradientColorStops:({theme:e})=>e("colors"),gradientColorStopPositions:{"0%":"0%","5%":"5%","10%":"10%","15%":"15%","20%":"20%","25%":"25%","30%":"30%","35%":"35%","40%":"40%","45%":"45%","50%":"50%","55%":"55%","60%":"60%","65%":"65%","70%":"70%","75%":"75%","80%":"80%","85%":"85%","90%":"90%","95%":"95%","100%":"100%"},grayscale:{0:"0",DEFAULT:"100%"},gridAutoColumns:{auto:"auto",min:"min-content",max:"max-content",fr:"minmax(0, 1fr)"},gridAutoRows:{auto:"auto",min:"min-content",max:"max-content",fr:"minmax(0, 1fr)"},gridColumn:{auto:"auto","span-1":"span 1 / span 1","span-2":"span 2 / span 2","span-3":"span 3 / span 3","span-4":"span 4 / span 4","span-5":"span 5 / span 5","span-6":"span 6 / span 6","span-7":"span 7 / span 7","span-8":"span 8 / span 8","span-9":"span 9 / span 9","span-10":"span 10 / span 10","span-11":"span 11 / span 11","span-12":"span 12 / span 12","span-full":"1 / -1"},gridColumnEnd:{auto:"auto",1:"1",2:"2",3:"3",4:"4",5:"5",6:"6",7:"7",8:"8",9:"9",10:"10",11:"11",12:"12",13:"13"},gridColumnStart:{auto:"auto",1:"1",2:"2",3:"3",4:"4",5:"5",6:"6",7:"7",8:"8",9:"9",10:"10",11:"11",12:"12",13:"13"},gridRow:{auto:"auto","span-1":"span 1 / span 1","span-2":"span 2 / span 2","span-3":"span 3 / span 3","span-4":"span 4 / span 4","span-5":"span 5 / span 5","span-6":"span 6 / span 6","span-full":"1 / -1"},gridRowEnd:{auto:"auto",1:"1",2:"2",3:"3",4:"4",5:"5",6:"6",7:"7"},gridRowStart:{auto:"auto",1:"1",2:"2",3:"3",4:"4",5:"5",6:"6",7:"7"},gridTemplateColumns:{none:"none",1:"repeat(1, minmax(0, 1fr))",2:"repeat(2, minmax(0, 1fr))",3:"repeat(3, minmax(0, 1fr))",4:"repeat(4, minmax(0, 1fr))",5:"repeat(5, minmax(0, 1fr))",6:"repeat(6, minmax(0, 1fr))",7:"repeat(7, minmax(0, 1fr))",8:"repeat(8, minmax(0, 1fr))",9:"repeat(9, minmax(0, 1fr))",10:"repeat(10, minmax(0, 1fr))",11:"repeat(11, minmax(0, 1fr))",12:"repeat(12, minmax(0, 1fr))"},gridTemplateRows:{none:"none",1:"repeat(1, minmax(0, 1fr))",2:"repeat(2, minmax(0, 1fr))",3:"repeat(3, minmax(0, 1fr))",4:"repeat(4, minmax(0, 1fr))",5:"repeat(5, minmax(0, 1fr))",6:"repeat(6, minmax(0, 1fr))"},height:({theme:e})=>({auto:"auto",...e("spacing"),"1/2":"50%","1/3":"33.333333%","2/3":"66.666667%","1/4":"25%","2/4":"50%","3/4":"75%","1/5":"20%","2/5":"40%","3/5":"60%","4/5":"80%","1/6":"16.666667%","2/6":"33.333333%","3/6":"50%","4/6":"66.666667%","5/6":"83.333333%",full:"100%",screen:"100vh",min:"min-content",max:"max-content",fit:"fit-content"}),hueRotate:{0:"0deg",15:"15deg",30:"30deg",60:"60deg",90:"90deg",180:"180deg"},inset:({theme:e})=>({auto:"auto",...e("spacing"),"1/2":"50%","1/3":"33.333333%","2/3":"66.666667%","1/4":"25%","2/4":"50%","3/4":"75%",full:"100%"}),invert:{0:"0",DEFAULT:"100%"},keyframes:{spin:{to:{transform:"rotate(360deg)"}},ping:{"75%, 100%":{transform:"scale(2)",opacity:"0"}},pulse:{"50%":{opacity:".5"}},bounce:{"0%, 100%":{transform:"translateY(-25%)",animationTimingFunction:"cubic-bezier(0.8,0,1,1)"},"50%":{transform:"none",animationTimingFunction:"cubic-bezier(0,0,0.2,1)"}}},letterSpacing:{tighter:"-0.05em",tight:"-0.025em",normal:"0em",wide:"0.025em",wider:"0.05em",widest:"0.1em"},lineHeight:{none:"1",tight:"1.25",snug:"1.375",normal:"1.5",relaxed:"1.625",loose:"2",3:".75rem",4:"1rem",5:"1.25rem",6:"1.5rem",7:"1.75rem",8:"2rem",9:"2.25rem",10:"2.5rem"},listStyleType:{none:"none",disc:"disc",decimal:"decimal"},listStyleImage:{none:"none"},margin:({theme:e})=>({auto:"auto",...e("spacing")}),lineClamp:{1:"1",2:"2",3:"3",4:"4",5:"5",6:"6"},maxHeight:({theme:e})=>({...e("spacing"),none:"none",full:"100%",screen:"100vh",min:"min-content",max:"max-content",fit:"fit-content"}),maxWidth:({theme:e,breakpoints:t})=>({none:"none",0:"0rem",xs:"20rem",sm:"24rem",md:"28rem",lg:"32rem",xl:"36rem","2xl":"42rem","3xl":"48rem","4xl":"56rem","5xl":"64rem","6xl":"72rem","7xl":"80rem",full:"100%",min:"min-content",max:"max-content",fit:"fit-content",prose:"65ch",...t(e("screens"))}),minHeight:{0:"0px",full:"100%",screen:"100vh",min:"min-content",max:"max-content",fit:"fit-content"},minWidth:{0:"0px",full:"100%",min:"min-content",max:"max-content",fit:"fit-content"},objectPosition:{bottom:"bottom",center:"center",left:"left","left-bottom":"left bottom","left-top":"left top",right:"right","right-bottom":"right bottom","right-top":"right top",top:"top"},opacity:{0:"0",5:"0.05",10:"0.1",20:"0.2",25:"0.25",30:"0.3",40:"0.4",50:"0.5",60:"0.6",70:"0.7",75:"0.75",80:"0.8",90:"0.9",95:"0.95",100:"1"},order:{first:"-9999",last:"9999",none:"0",1:"1",2:"2",3:"3",4:"4",5:"5",6:"6",7:"7",8:"8",9:"9",10:"10",11:"11",12:"12"},outlineColor:({theme:e})=>e("colors"),outlineOffset:{0:"0px",1:"1px",2:"2px",4:"4px",8:"8px"},outlineWidth:{0:"0px",1:"1px",2:"2px",4:"4px",8:"8px"},padding:({theme:e})=>e("spacing"),placeholderColor:({theme:e})=>e("colors"),placeholderOpacity:({theme:e})=>e("opacity"),ringColor:({theme:e})=>({DEFAULT:e("colors.blue.500","#3b82f6"),...e("colors")}),ringOffsetColor:({theme:e})=>e("colors"),ringOffsetWidth:{0:"0px",1:"1px",2:"2px",4:"4px",8:"8px"},ringOpacity:({theme:e})=>({DEFAULT:"0.5",...e("opacity")}),ringWidth:{DEFAULT:"3px",0:"0px",1:"1px",2:"2px",4:"4px",8:"8px"},rotate:{0:"0deg",1:"1deg",2:"2deg",3:"3deg",6:"6deg",12:"12deg",45:"45deg",90:"90deg",180:"180deg"},saturate:{0:"0",50:".5",100:"1",150:"1.5",200:"2"},scale:{0:"0",50:".5",75:".75",90:".9",95:".95",100:"1",105:"1.05",110:"1.1",125:"1.25",150:"1.5"},screens:{sm:"640px",md:"768px",lg:"1024px",xl:"1280px","2xl":"1536px"},scrollMargin:({theme:e})=>({...e("spacing")}),scrollPadding:({theme:e})=>e("spacing"),sepia:{0:"0",DEFAULT:"100%"},skew:{0:"0deg",1:"1deg",2:"2deg",3:"3deg",6:"6deg",12:"12deg"},space:({theme:e})=>({...e("spacing")}),spacing:{px:"1px",0:"0px",.5:"0.125rem",1:"0.25rem",1.5:"0.375rem",2:"0.5rem",2.5:"0.625rem",3:"0.75rem",3.5:"0.875rem",4:"1rem",5:"1.25rem",6:"1.5rem",7:"1.75rem",8:"2rem",9:"2.25rem",10:"2.5rem",11:"2.75rem",12:"3rem",14:"3.5rem",16:"4rem",20:"5rem",24:"6rem",28:"7rem",32:"8rem",36:"9rem",40:"10rem",44:"11rem",48:"12rem",52:"13rem",56:"14rem",60:"15rem",64:"16rem",72:"18rem",80:"20rem",96:"24rem"},stroke:({theme:e})=>({none:"none",...e("colors")}),strokeWidth:{0:"0",1:"1",2:"2"},supports:{},data:{},textColor:({theme:e})=>e("colors"),textDecorationColor:({theme:e})=>e("colors"),textDecorationThickness:{auto:"auto","from-font":"from-font",0:"0px",1:"1px",2:"2px",4:"4px",8:"8px"},textIndent:({theme:e})=>({...e("spacing")}),textOpacity:({theme:e})=>e("opacity"),textUnderlineOffset:{auto:"auto",0:"0px",1:"1px",2:"2px",4:"4px",8:"8px"},transformOrigin:{center:"center",top:"top","top-right":"top right",right:"right","bottom-right":"bottom right",bottom:"bottom","bottom-left":"bottom left",left:"left","top-left":"top left"},transitionDelay:{0:"0s",75:"75ms",100:"100ms",150:"150ms",200:"200ms",300:"300ms",500:"500ms",700:"700ms",1e3:"1000ms"},transitionDuration:{DEFAULT:"150ms",0:"0s",75:"75ms",100:"100ms",150:"150ms",200:"200ms",300:"300ms",500:"500ms",700:"700ms",1e3:"1000ms"},transitionProperty:{none:"none",all:"all",DEFAULT:"color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter",colors:"color, background-color, border-color, text-decoration-color, fill, stroke",opacity:"opacity",shadow:"box-shadow",transform:"transform"},transitionTimingFunction:{DEFAULT:"cubic-bezier(0.4, 0, 0.2, 1)",linear:"linear",in:"cubic-bezier(0.4, 0, 1, 1)",out:"cubic-bezier(0, 0, 0.2, 1)","in-out":"cubic-bezier(0.4, 0, 0.2, 1)"},translate:({theme:e})=>({...e("spacing"),"1/2":"50%","1/3":"33.333333%","2/3":"66.666667%","1/4":"25%","2/4":"50%","3/4":"75%",full:"100%"}),width:({theme:e})=>({auto:"auto",...e("spacing"),"1/2":"50%","1/3":"33.333333%","2/3":"66.666667%","1/4":"25%","2/4":"50%","3/4":"75%","1/5":"20%","2/5":"40%","3/5":"60%","4/5":"80%","1/6":"16.666667%","2/6":"33.333333%","3/6":"50%","4/6":"66.666667%","5/6":"83.333333%","1/12":"8.333333%","2/12":"16.666667%","3/12":"25%","4/12":"33.333333%","5/12":"41.666667%","6/12":"50%","7/12":"58.333333%","8/12":"66.666667%","9/12":"75%","10/12":"83.333333%","11/12":"91.666667%",full:"100%",screen:"100vw",min:"min-content",max:"max-content",fit:"fit-content"}),willChange:{auto:"auto",scroll:"scroll-position",contents:"contents",transform:"transform"},zIndex:{auto:"auto",0:"0",10:"10",20:"20",30:"30",40:"40",50:"50"}},plugins:[]};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return i}});const t=C,r=o(q);function o(a){return a&&a.__esModule?a:{default:a}}const i=(0,t.cloneDeep)(r.default.theme)})(w);let h=w;var H=(h.__esModule?h:{default:h}).default;const y=D.getDefaultExportFromCjs(H),k=(e,t="c-")=>{const r=n.get(e,"_bodyTextLightColor","#64748b"),o=n.get(e,"_bodyTextDarkColor","#94a3b8"),i=n.get(e,"_bodyBgLightColor","#FFFFFF"),a=n.get(e,"_bodyBgDarkColor","#0f172a");return`${t}font-body ${t}antialiased ${t}text-[${r}] ${t}bg-[${i}] dark:${t}text-[${o}] dark:${t}bg-[${a}]`},M=(e,t,r,o="c-")=>{const i=k(r,o);return P(r,[n.replace(JSON.stringify(e),/#styles:/g,""),n.replace(JSON.stringify(t),/#styles:/g,"")],i.split(" ").concat(`${o}inline-block`,`${o}w-full`,`${o}h-full`))};async function P(e,t,r=[],o="c-"){const i=n.get(e,"_primaryColor","#000"),a=n.get(e,"_secondaryColor","#ccc"),g=n.get(e,"_headingFont","Inter"),m=n.get(e,"_bodyFont","Inter"),p=n.get(e,"_roundedCorners","0"),c=S.tailwindcssPaletteGenerator({colors:[i,a],names:["primary","secondary"]});return n.set(c,"primary.DEFAULT",i),n.set(c,"secondary.DEFAULT",a),`${await z.createTailwindcss({tailwindConfig:{prefix:o,darkMode:"class",safelist:r,theme:{fontFamily:{heading:[g,...y.fontFamily.sans],body:[m,...y.fontFamily.sans]},extend:{borderRadius:{global:`${p||"0"}px`},colors:c}},plugins:[_,j,L,v],corePlugins:{preflight:!1}}}).generateStylesFromContent(` @tailwind components;
|
|
2
|
+
@tailwind utilities;`,t)} .${o}bg-clip-text{background-clip: text;-webkit-background-clip: text;} h1,h2,h3,h4,h5,h6{font-family: "${g}",${y.fontFamily.sans.join(", ")};}`}function W(e=6,t="abcdefghijklmnopqrstuvwxyzABCD"){let r="";for(let o=e;o>0;--o)r+=t[Math.floor(Math.random()*t.length)];return r}exports.RenderChaiBlocks=x;exports.RenderChaiPage=O;exports.generateUUID=W;exports.getBlocksTailwindCSS=M;exports.getBrandingClasses=k;
|
package/dist/render.d.ts
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { JSX as JSX_2 } from 'react/jsx-runtime';
|
|
2
|
+
import { default as React_2 } from 'react';
|
|
3
|
+
|
|
4
|
+
declare type ChaiBlock = {
|
|
5
|
+
_id: string;
|
|
6
|
+
_name?: string;
|
|
7
|
+
_parent?: string | null | undefined;
|
|
8
|
+
_bindings?: Record<string, string>;
|
|
9
|
+
readonly _type: string;
|
|
10
|
+
} & Record<string, string>;
|
|
11
|
+
|
|
12
|
+
declare type ChaiPageProps = {
|
|
13
|
+
before?: React_2.ReactNode;
|
|
14
|
+
after?: React_2.ReactNode;
|
|
15
|
+
snapshot: ChaiPageSnapshot;
|
|
16
|
+
classPrefix?: string;
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
declare type ChaiPageSnapshot = {
|
|
20
|
+
pageData: {
|
|
21
|
+
blocks: ChaiBlock[];
|
|
22
|
+
customCode?: string;
|
|
23
|
+
seoData?: Record<string, string>;
|
|
24
|
+
};
|
|
25
|
+
globalBlocks?: any[];
|
|
26
|
+
projectData: {
|
|
27
|
+
brandingOptions: Record<string, string>;
|
|
28
|
+
customCode?: string;
|
|
29
|
+
seoData?: Record<string, string>;
|
|
30
|
+
};
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Get the unique uuid
|
|
35
|
+
*/
|
|
36
|
+
export declare function generateUUID(length?: number, chars?: string): string;
|
|
37
|
+
|
|
38
|
+
export declare const getBlocksTailwindCSS: (blocks: ChaiBlock[], globalBlocks: any[], brandingOptions: any, prefix?: string) => Promise<string>;
|
|
39
|
+
|
|
40
|
+
export declare const getBrandingClasses: (brandingOptions: any, prefix?: string) => string;
|
|
41
|
+
|
|
42
|
+
export declare function RenderChaiBlocks({ blocks, parent }: {
|
|
43
|
+
blocks: ChaiBlock[];
|
|
44
|
+
parent?: string;
|
|
45
|
+
}): JSX_2.Element;
|
|
46
|
+
|
|
47
|
+
export declare const RenderChaiPage: ({ snapshot, before, after, classPrefix }: ChaiPageProps) => JSX_2.Element;
|
|
48
|
+
|
|
49
|
+
export { }
|