@chaibuilder/sdk 1.0.10 → 1.0.12
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/AddBlocks-7ACJv8LW.cjs +3 -0
- package/dist/{AddBlocks-xR2s2BVa.js → AddBlocks-H7BZYHUC.js} +30 -30
- package/dist/BrandingOptions-5j-XszLM.cjs +1 -0
- package/dist/{BrandingOptions-cHK2bVZy.js → BrandingOptions-PAgY-kvj.js} +13 -12
- package/dist/{CanvasArea-Br8bBSeT.cjs → CanvasArea-Dnm-yeus.cjs} +2 -2
- package/dist/{CanvasArea-2zqT1lSE.js → CanvasArea-zn2ox-5h.js} +6 -6
- package/dist/{ChaiBuilderEditor-SacH75l4.cjs → ChaiBuilderEditor-BoE-sArB.cjs} +2 -2
- package/dist/{ChaiBuilderEditor-h9bXC4l-.js → ChaiBuilderEditor-hEuUONQ3.js} +2 -2
- package/dist/{CurrentPage-4lTETR2f.js → CurrentPage-6Jp4xAWK.js} +3 -3
- package/dist/CurrentPage-YMpqOqx7.cjs +1 -0
- package/dist/Layers-EzOZdWvd.cjs +1 -0
- package/dist/{Layers-wOfijZnb.js → Layers-WkZ48AUm.js} +5 -5
- package/dist/{MarkAsGlobalBlock-xRyn29gC.js → MarkAsGlobalBlock-0HubcRkY.js} +3 -3
- package/dist/MarkAsGlobalBlock-HmeIyLCP.cjs +1 -0
- package/dist/{PagesPanel-82gCVzHS.js → PagesPanel-6JuwBLFQ.js} +4 -4
- package/dist/PagesPanel-zJq8p1ja.cjs +1 -0
- package/dist/ProjectPanel-Zml2F8b9.cjs +1 -0
- package/dist/{ProjectPanel-vz5WOyqZ.js → ProjectPanel-cu2QSDW9.js} +4 -4
- package/dist/{Settings-IuAF359L.js → Settings-fH8fZKpm.js} +70 -69
- package/dist/Settings-lc9PfnmG.cjs +1 -0
- package/dist/SidePanels-VH72zFE2.cjs +1 -0
- package/dist/{SidePanels-xssTWt4M.js → SidePanels-w8ZHKJaR.js} +3 -3
- package/dist/{Topbar-H0f0EL6-.js → Topbar-hm1D_5sb.js} +2 -2
- package/dist/Topbar-vQPo9xSY.cjs +1 -0
- package/dist/add-page-modal--qZSwJuB.cjs +1 -0
- package/dist/{add-page-modal-J1E7rh1U.js → add-page-modal-bj7qbZuK.js} +6 -5
- package/dist/controls-W97-POR_.cjs +1 -0
- package/dist/controls-enQY7NI8.js +118 -0
- package/dist/core.cjs +1 -1
- package/dist/core.js +9 -9
- package/dist/delete-page-modal-2LuDLEiP.cjs +1 -0
- package/dist/{delete-page-modal-ysj4O0bM.js → delete-page-modal-cnrR8tWH.js} +3 -3
- package/dist/index-HAue58ea.cjs +1 -0
- package/dist/{index-cZ4uo6aT.js → index-T4_wfKl5.js} +2 -2
- package/dist/{index-8L3zCc6V.cjs → index-X9ZgD09V.cjs} +1 -1
- package/dist/index-ehKdBRUK.js +18 -0
- package/dist/lib.cjs +1 -1
- package/dist/lib.d.ts +65 -0
- package/dist/lib.js +117 -57
- package/dist/page-viewer-IARz6OSp.cjs +1 -0
- package/dist/{page-viewer-84Giu0Rs.js → page-viewer-Y4YiaZ_m.js} +4 -4
- package/dist/{project-general-setting-8OEVVxzn.js → project-general-setting-U4S_KlhU.js} +13 -12
- package/dist/project-general-setting-eSl3t-VH.cjs +1 -0
- package/dist/{project-seo-setting-9kD_stdI.js → project-seo-setting-Ga9v_ECU.js} +7 -7
- package/dist/project-seo-setting-rankm1z3.cjs +1 -0
- package/dist/render.cjs +1 -1
- package/dist/render.js +34 -34
- package/dist/server.cjs +1 -1
- package/dist/server.js +1 -1
- package/dist/{single-page-detail-iXpavDy8.js → single-page-detail-pAxCy_Pe.js} +43 -42
- package/dist/single-page-detail-yPgnu2AI.cjs +1 -0
- package/dist/studio.cjs +1 -1
- package/dist/studio.js +3 -3
- package/dist/ui.cjs +1 -1
- package/dist/ui.d.ts +4 -69
- package/dist/ui.js +208 -267
- package/dist/{useAddBlock-BOjrGBEO.js → useAddBlock-WJc3OgG8.js} +2 -2
- package/dist/{useAddBlock-1cMXaOVk.cjs → useAddBlock-dCKRFPRU.cjs} +1 -1
- package/dist/{useAllBlocks-RU_Xw8j9.cjs → useAllBlocks-6hvuNuyw.cjs} +1 -1
- package/dist/{useAllBlocks-lX6uVO39.js → useAllBlocks-PQKYvs-e.js} +1 -1
- package/dist/{useDarkMode-JWkrNFpH.js → useDarkMode-ZKCO_gkt.js} +1 -1
- package/dist/{useDarkMode-zeTW_UUR.cjs → useDarkMode-dV6FM6l-.cjs} +1 -1
- package/dist/{useFeatureSupport-jWSuY7wk.js → useFeatureSupport-OLwNgEZb.js} +1 -1
- package/dist/{useFeatureSupport-tZ0QfBxp.cjs → useFeatureSupport-c9IgPW2t.cjs} +1 -1
- package/dist/{useLanguage-Y3qgAbgG.cjs → useLanguage-NKKKaxVM.cjs} +1 -1
- package/dist/{useLanguage-O1uu2Bzu.js → useLanguage-gVC5rxO5.js} +2 -2
- package/dist/{useMarkAsGlobalBlock-DB5B1UP6.js → useMarkAsGlobalBlock-X73Vny8u.js} +2 -2
- package/dist/useMarkAsGlobalBlock-ebBVGHg4.cjs +1 -0
- package/package.json +2 -2
- package/dist/AddBlocks-tdvDe7xL.cjs +0 -3
- package/dist/BrandingOptions-DpJ-oNnf.cjs +0 -1
- package/dist/CurrentPage-nlUWJiUA.cjs +0 -1
- package/dist/Layers-Vw4XE6YB.cjs +0 -1
- package/dist/MarkAsGlobalBlock-1J_YyL1L.cjs +0 -1
- package/dist/PagesPanel-ZKRdK-mI.cjs +0 -1
- package/dist/ProjectPanel-kYg4KkJu.cjs +0 -1
- package/dist/Settings-1E3Y_5r6.cjs +0 -1
- package/dist/SidePanels-WL1UioF2.cjs +0 -1
- package/dist/Topbar-3ozdWfSy.cjs +0 -1
- package/dist/add-page-modal-eiiUZCJX.cjs +0 -1
- package/dist/delete-page-modal-TGTmRjyn.cjs +0 -1
- package/dist/page-viewer-OdVEG83P.cjs +0 -1
- package/dist/project-general-setting-laHNQPW5.cjs +0 -1
- package/dist/project-seo-setting-F3Opt9Uj.cjs +0 -1
- package/dist/single-page-detail-X0TGlsT4.cjs +0 -1
- package/dist/useMarkAsGlobalBlock-toxRSLc_.cjs +0 -1
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { get as s, values as _, pick as a, keys as i, pickBy as o, endsWith as u, mapValues as y } from "lodash";
|
|
2
|
+
const r = {}, f = () => r, k = (t) => s(r, t, null), l = (t) => y(r[t].props, "default"), g = (t) => t.map((p) => {
|
|
3
|
+
if (r[p._type]) {
|
|
4
|
+
const e = l(p._type);
|
|
5
|
+
return {
|
|
6
|
+
...e,
|
|
7
|
+
...a(p, [...i(e), "_type", "_id", "_name", "_parent", "_bindings"]),
|
|
8
|
+
...o(p, (c, n) => u(n, "_attrs"))
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
return p;
|
|
12
|
+
}), m = {}, h = () => _(m);
|
|
13
|
+
export {
|
|
14
|
+
h as A,
|
|
15
|
+
f as C,
|
|
16
|
+
g as P,
|
|
17
|
+
k as h
|
|
18
|
+
};
|
package/dist/lib.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const v=require("./utils-qK_SjzzV.cjs"),f=require("./functions-uw7QP2kT.cjs"),T=require("./html-to-json-P6GpbcQX.cjs"),n=require("lodash"),b=require("./Class-_uCzl5v1.cjs"),o=require("./functions-sCuB7nvZ.cjs");require("clsx");require("tailwind-merge");require("himalaya");require("./MODIFIERS-Fx6WAZcw.cjs");require("@mhsdesign/jit-browser-tailwindcss");require("@bobthered/tailwindcss-palette-generator");require("@tailwindcss/forms");require("@tailwindcss/typography");require("@tailwindcss/aspect-ratio");require("@tailwindcss/line-clamp");const g={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"},y={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"},k=16,F=4;function w(a){return a.indexOf("rem")!==-1&&(a=`${parseFloat(a.replace("rem",""))*k}px`),a}const q=a=>{const t=a.match(/\[.*\]/);if(t===null)return a;const l=b.constructClassObject(a);if(l===null)return a;const{property:h}=l;let e=n.first(t).replace(/\]/i,"").replace(/\[/i,"");const s=a.replace(/\[.*\]/i,"");e=w(e);let r=a;switch(h){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 c=n.map(n.keys(y),i=>`${i}px`);if(n.includes(c,e)){const i=n.parseInt(e.replace("px",""),10);i===1?r=`${s}px`:r=s+i/F}}if(e.indexOf("%")!==-1){const c=n.map(n.keys(g),i=>`${i}%`);if(n.includes(c,e)){const i=parseFloat(e.replace("%",""));r=s+n.get(g,i)}}e.indexOf("vw")!==-1&&parseFloat(e.replace("vw",""))===100&&(r=`${s}screen`),e.indexOf("vh")!==-1&&parseFloat(e.replace("vh",""))===100&&(r=`${s}screen`);break;case"minWidth":e.indexOf("%")!==-1&&parseFloat(e.replace("%",""))===100&&(r=`${s}full`),e==="0px"&&(r="min-w-0");break;case"maxWidth":e==="0px"&&(r="max-w-0");const p={"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"};n.includes(n.keys(p),e)&&(r=`max-w-${p[e]}`);break;case"minHeight":e.indexOf("%")!==-1&&parseFloat(e.replace("%",""))===100&&(r=`${s}full`),e==="0px"&&(r="min-h-0"),e==="100vh"&&(r="min-h-screen");break;case"fontSize":const d={"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"};n.includes(n.keys(d),e)&&(r=s+d[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"};n.includes(n.keys(u),e)&&(r=s+u[e]);break;case"zIndex":r=["0","10","20","30","40","50"].indexOf(e)!==-1?`${s}${e}`:a;break;case"opacity":const m=["0","5","10","20","25","30","40","50","60","70","75","80","90","95","100"],x=parseFloat(e)*100;n.includes(m,x.toString())&&(r=`opacity-${x}`);break}return r};function S(){return{colors:{border:"hsl(var(--border))",input:"hsl(var(--input))",ring:"hsl(var(--ring))",background:"hsl(var(--background))",foreground:"hsl(var(--foreground))",primary:{DEFAULT:"hsl(var(--primary))",foreground:"hsl(var(--primary-foreground))"},secondary:{DEFAULT:"hsl(var(--secondary))",foreground:"hsl(var(--secondary-foreground))"},destructive:{DEFAULT:"hsl(var(--destructive))",foreground:"hsl(var(--destructive-foreground))"},muted:{DEFAULT:"hsl(var(--muted))",foreground:"hsl(var(--muted-foreground))"},accent:{DEFAULT:"hsl(var(--accent))",foreground:"hsl(var(--accent-foreground))"},popover:{DEFAULT:"hsl(var(--popover))",foreground:"hsl(var(--popover-foreground))"},card:{DEFAULT:"hsl(var(--card))",foreground:"hsl(var(--card-foreground))"}},borderRadius:{lg:"var(--radius)",md:"calc(var(--radius) - 2px)",sm:"calc(var(--radius) - 4px)"},keyframes:{"accordion-down":{from:{height:"0"},to:{height:"var(--radix-accordion-content-height)"}},"accordion-up":{from:{height:"var(--radix-accordion-content-height)"},to:{height:"0"}}},animation:{"accordion-down":"accordion-down 0.2s ease-out","accordion-up":"accordion-up 0.2s ease-out"}}}const L=a=>({...a}),V=a=>({...a});exports.cn=v.cn;exports.generateUUID=f.generateUUID;exports.getBreakpointValue=f.getBreakpointValue;exports.getBlocksFromHTML=T.getBlocksFromHTML;exports.addPrefixToClasses=o.addPrefixToClasses;exports.getBlocksTailwindCSS=o.getBlocksTailwindCSS;exports.getBrandingClasses=o.getBrandingClasses;exports.getStylesForPageData=o.getStylesForPageData;exports.chaiBuilderTheme=S;exports.convertArbitraryToTailwindClass=q;exports.selectable=L;exports.styling=V;
|
package/dist/lib.d.ts
CHANGED
|
@@ -17,6 +17,71 @@ declare type ChaiBlock = {
|
|
|
17
17
|
readonly _type: string;
|
|
18
18
|
} & Record<string, any>;
|
|
19
19
|
|
|
20
|
+
export declare function chaiBuilderTheme(): {
|
|
21
|
+
colors: {
|
|
22
|
+
border: string;
|
|
23
|
+
input: string;
|
|
24
|
+
ring: string;
|
|
25
|
+
background: string;
|
|
26
|
+
foreground: string;
|
|
27
|
+
primary: {
|
|
28
|
+
DEFAULT: string;
|
|
29
|
+
foreground: string;
|
|
30
|
+
};
|
|
31
|
+
secondary: {
|
|
32
|
+
DEFAULT: string;
|
|
33
|
+
foreground: string;
|
|
34
|
+
};
|
|
35
|
+
destructive: {
|
|
36
|
+
DEFAULT: string;
|
|
37
|
+
foreground: string;
|
|
38
|
+
};
|
|
39
|
+
muted: {
|
|
40
|
+
DEFAULT: string;
|
|
41
|
+
foreground: string;
|
|
42
|
+
};
|
|
43
|
+
accent: {
|
|
44
|
+
DEFAULT: string;
|
|
45
|
+
foreground: string;
|
|
46
|
+
};
|
|
47
|
+
popover: {
|
|
48
|
+
DEFAULT: string;
|
|
49
|
+
foreground: string;
|
|
50
|
+
};
|
|
51
|
+
card: {
|
|
52
|
+
DEFAULT: string;
|
|
53
|
+
foreground: string;
|
|
54
|
+
};
|
|
55
|
+
};
|
|
56
|
+
borderRadius: {
|
|
57
|
+
lg: string;
|
|
58
|
+
md: string;
|
|
59
|
+
sm: string;
|
|
60
|
+
};
|
|
61
|
+
keyframes: {
|
|
62
|
+
"accordion-down": {
|
|
63
|
+
from: {
|
|
64
|
+
height: string;
|
|
65
|
+
};
|
|
66
|
+
to: {
|
|
67
|
+
height: string;
|
|
68
|
+
};
|
|
69
|
+
};
|
|
70
|
+
"accordion-up": {
|
|
71
|
+
from: {
|
|
72
|
+
height: string;
|
|
73
|
+
};
|
|
74
|
+
to: {
|
|
75
|
+
height: string;
|
|
76
|
+
};
|
|
77
|
+
};
|
|
78
|
+
};
|
|
79
|
+
animation: {
|
|
80
|
+
"accordion-down": string;
|
|
81
|
+
"accordion-up": string;
|
|
82
|
+
};
|
|
83
|
+
};
|
|
84
|
+
|
|
20
85
|
export declare type ChaiPageData = {
|
|
21
86
|
page: {
|
|
22
87
|
blocks: ChaiBlock[];
|
package/dist/lib.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { c as
|
|
2
|
-
import { g as
|
|
3
|
-
import { g as
|
|
4
|
-
import { first as
|
|
5
|
-
import { c as
|
|
6
|
-
import { a as
|
|
1
|
+
import { c as Y } from "./utils-dze1SGvB.js";
|
|
2
|
+
import { g as K, a as q } from "./functions-pcUZhFJM.js";
|
|
3
|
+
import { g as J } from "./html-to-json-pdHQfRkN.js";
|
|
4
|
+
import { first as v, includes as c, keys as t, map as f, parseInt as T, get as b } from "lodash";
|
|
5
|
+
import { c as F } from "./Class-l7qYbuoN.js";
|
|
6
|
+
import { a as Z, b as N, g as ee, c as re } from "./functions-nNTuSTsR.js";
|
|
7
7
|
import "clsx";
|
|
8
8
|
import "tailwind-merge";
|
|
9
9
|
import "himalaya";
|
|
@@ -14,7 +14,7 @@ import "@tailwindcss/forms";
|
|
|
14
14
|
import "@tailwindcss/typography";
|
|
15
15
|
import "@tailwindcss/aspect-ratio";
|
|
16
16
|
import "@tailwindcss/line-clamp";
|
|
17
|
-
const
|
|
17
|
+
const g = {
|
|
18
18
|
25: "1/4",
|
|
19
19
|
"33.33": "1/3",
|
|
20
20
|
50: "1/2",
|
|
@@ -67,23 +67,23 @@ const d = {
|
|
|
67
67
|
288: "72",
|
|
68
68
|
320: "80",
|
|
69
69
|
384: "96"
|
|
70
|
-
}, w = 16,
|
|
71
|
-
function
|
|
72
|
-
return
|
|
70
|
+
}, w = 16, y = 4;
|
|
71
|
+
function L(a) {
|
|
72
|
+
return a.indexOf("rem") !== -1 && (a = `${parseFloat(a.replace("rem", "")) * w}px`), a;
|
|
73
73
|
}
|
|
74
|
-
const
|
|
75
|
-
const
|
|
76
|
-
if (
|
|
77
|
-
return
|
|
78
|
-
const
|
|
79
|
-
if (
|
|
80
|
-
return
|
|
81
|
-
const { property:
|
|
82
|
-
let e =
|
|
83
|
-
const
|
|
84
|
-
e =
|
|
85
|
-
let
|
|
86
|
-
switch (
|
|
74
|
+
const X = (a) => {
|
|
75
|
+
const i = a.match(/\[.*\]/);
|
|
76
|
+
if (i === null)
|
|
77
|
+
return a;
|
|
78
|
+
const p = F(a);
|
|
79
|
+
if (p === null)
|
|
80
|
+
return a;
|
|
81
|
+
const { property: m } = p;
|
|
82
|
+
let e = v(i).replace(/\]/i, "").replace(/\[/i, "");
|
|
83
|
+
const o = a.replace(/\[.*\]/i, "");
|
|
84
|
+
e = L(e);
|
|
85
|
+
let r = a;
|
|
86
|
+
switch (m) {
|
|
87
87
|
case "top":
|
|
88
88
|
case "right":
|
|
89
89
|
case "left":
|
|
@@ -116,27 +116,27 @@ const z = (s) => {
|
|
|
116
116
|
case "spaceX":
|
|
117
117
|
case "spaceY":
|
|
118
118
|
if (e.indexOf("px") !== -1) {
|
|
119
|
-
const
|
|
120
|
-
if (c(
|
|
121
|
-
const
|
|
122
|
-
|
|
119
|
+
const s = f(t(k), (n) => `${n}px`);
|
|
120
|
+
if (c(s, e)) {
|
|
121
|
+
const n = T(e.replace("px", ""), 10);
|
|
122
|
+
n === 1 ? r = `${o}px` : r = o + n / y;
|
|
123
123
|
}
|
|
124
124
|
}
|
|
125
125
|
if (e.indexOf("%") !== -1) {
|
|
126
|
-
const
|
|
127
|
-
if (c(
|
|
128
|
-
const
|
|
129
|
-
|
|
126
|
+
const s = f(t(g), (n) => `${n}%`);
|
|
127
|
+
if (c(s, e)) {
|
|
128
|
+
const n = parseFloat(e.replace("%", ""));
|
|
129
|
+
r = o + b(g, n);
|
|
130
130
|
}
|
|
131
131
|
}
|
|
132
|
-
e.indexOf("vw") !== -1 && parseFloat(e.replace("vw", "")) === 100 && (
|
|
132
|
+
e.indexOf("vw") !== -1 && parseFloat(e.replace("vw", "")) === 100 && (r = `${o}screen`), e.indexOf("vh") !== -1 && parseFloat(e.replace("vh", "")) === 100 && (r = `${o}screen`);
|
|
133
133
|
break;
|
|
134
134
|
case "minWidth":
|
|
135
|
-
e.indexOf("%") !== -1 && parseFloat(e.replace("%", "")) === 100 && (
|
|
135
|
+
e.indexOf("%") !== -1 && parseFloat(e.replace("%", "")) === 100 && (r = `${o}full`), e === "0px" && (r = "min-w-0");
|
|
136
136
|
break;
|
|
137
137
|
case "maxWidth":
|
|
138
|
-
e === "0px" && (
|
|
139
|
-
const
|
|
138
|
+
e === "0px" && (r = "max-w-0");
|
|
139
|
+
const l = {
|
|
140
140
|
"320px": "xs",
|
|
141
141
|
"384px": "sm",
|
|
142
142
|
"448px": "md",
|
|
@@ -153,13 +153,13 @@ const z = (s) => {
|
|
|
153
153
|
"640px": "screen-sm",
|
|
154
154
|
"1536px": "screen-2xl"
|
|
155
155
|
};
|
|
156
|
-
c(
|
|
156
|
+
c(t(l), e) && (r = `max-w-${l[e]}`);
|
|
157
157
|
break;
|
|
158
158
|
case "minHeight":
|
|
159
|
-
e.indexOf("%") !== -1 && parseFloat(e.replace("%", "")) === 100 && (
|
|
159
|
+
e.indexOf("%") !== -1 && parseFloat(e.replace("%", "")) === 100 && (r = `${o}full`), e === "0px" && (r = "min-h-0"), e === "100vh" && (r = "min-h-screen");
|
|
160
160
|
break;
|
|
161
161
|
case "fontSize":
|
|
162
|
-
const
|
|
162
|
+
const x = {
|
|
163
163
|
"12px": "xs",
|
|
164
164
|
"14px": "sm",
|
|
165
165
|
"16px": "base",
|
|
@@ -174,10 +174,10 @@ const z = (s) => {
|
|
|
174
174
|
"96px": "8xl",
|
|
175
175
|
"128px": "9xl"
|
|
176
176
|
};
|
|
177
|
-
c(
|
|
177
|
+
c(t(x), e) && (r = o + x[e]);
|
|
178
178
|
break;
|
|
179
179
|
case "lineHeight":
|
|
180
|
-
const
|
|
180
|
+
const d = {
|
|
181
181
|
"12px": "3",
|
|
182
182
|
"16px": "4",
|
|
183
183
|
"20px": "5",
|
|
@@ -193,10 +193,10 @@ const z = (s) => {
|
|
|
193
193
|
"1.625": "relaxed",
|
|
194
194
|
2: "loose"
|
|
195
195
|
};
|
|
196
|
-
c(
|
|
196
|
+
c(t(d), e) && (r = o + d[e]);
|
|
197
197
|
break;
|
|
198
198
|
case "zIndex":
|
|
199
|
-
|
|
199
|
+
r = ["0", "10", "20", "30", "40", "50"].indexOf(e) !== -1 ? `${o}${e}` : a;
|
|
200
200
|
break;
|
|
201
201
|
case "opacity":
|
|
202
202
|
const h = [
|
|
@@ -215,22 +215,82 @@ const z = (s) => {
|
|
|
215
215
|
"90",
|
|
216
216
|
"95",
|
|
217
217
|
"100"
|
|
218
|
-
],
|
|
219
|
-
c(h,
|
|
218
|
+
], u = parseFloat(e) * 100;
|
|
219
|
+
c(h, u.toString()) && (r = `opacity-${u}`);
|
|
220
220
|
break;
|
|
221
221
|
}
|
|
222
|
-
return
|
|
223
|
-
}
|
|
222
|
+
return r;
|
|
223
|
+
};
|
|
224
|
+
function R() {
|
|
225
|
+
return {
|
|
226
|
+
colors: {
|
|
227
|
+
border: "hsl(var(--border))",
|
|
228
|
+
input: "hsl(var(--input))",
|
|
229
|
+
ring: "hsl(var(--ring))",
|
|
230
|
+
background: "hsl(var(--background))",
|
|
231
|
+
foreground: "hsl(var(--foreground))",
|
|
232
|
+
primary: {
|
|
233
|
+
DEFAULT: "hsl(var(--primary))",
|
|
234
|
+
foreground: "hsl(var(--primary-foreground))"
|
|
235
|
+
},
|
|
236
|
+
secondary: {
|
|
237
|
+
DEFAULT: "hsl(var(--secondary))",
|
|
238
|
+
foreground: "hsl(var(--secondary-foreground))"
|
|
239
|
+
},
|
|
240
|
+
destructive: {
|
|
241
|
+
DEFAULT: "hsl(var(--destructive))",
|
|
242
|
+
foreground: "hsl(var(--destructive-foreground))"
|
|
243
|
+
},
|
|
244
|
+
muted: {
|
|
245
|
+
DEFAULT: "hsl(var(--muted))",
|
|
246
|
+
foreground: "hsl(var(--muted-foreground))"
|
|
247
|
+
},
|
|
248
|
+
accent: {
|
|
249
|
+
DEFAULT: "hsl(var(--accent))",
|
|
250
|
+
foreground: "hsl(var(--accent-foreground))"
|
|
251
|
+
},
|
|
252
|
+
popover: {
|
|
253
|
+
DEFAULT: "hsl(var(--popover))",
|
|
254
|
+
foreground: "hsl(var(--popover-foreground))"
|
|
255
|
+
},
|
|
256
|
+
card: {
|
|
257
|
+
DEFAULT: "hsl(var(--card))",
|
|
258
|
+
foreground: "hsl(var(--card-foreground))"
|
|
259
|
+
}
|
|
260
|
+
},
|
|
261
|
+
borderRadius: {
|
|
262
|
+
lg: "var(--radius)",
|
|
263
|
+
md: "calc(var(--radius) - 2px)",
|
|
264
|
+
sm: "calc(var(--radius) - 4px)"
|
|
265
|
+
},
|
|
266
|
+
keyframes: {
|
|
267
|
+
"accordion-down": {
|
|
268
|
+
from: { height: "0" },
|
|
269
|
+
to: { height: "var(--radix-accordion-content-height)" }
|
|
270
|
+
},
|
|
271
|
+
"accordion-up": {
|
|
272
|
+
from: { height: "var(--radix-accordion-content-height)" },
|
|
273
|
+
to: { height: "0" }
|
|
274
|
+
}
|
|
275
|
+
},
|
|
276
|
+
animation: {
|
|
277
|
+
"accordion-down": "accordion-down 0.2s ease-out",
|
|
278
|
+
"accordion-up": "accordion-up 0.2s ease-out"
|
|
279
|
+
}
|
|
280
|
+
};
|
|
281
|
+
}
|
|
282
|
+
const z = (a) => ({ ...a }), H = (a) => ({ ...a });
|
|
224
283
|
export {
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
N as
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
284
|
+
Z as addPrefixToClasses,
|
|
285
|
+
R as chaiBuilderTheme,
|
|
286
|
+
Y as cn,
|
|
287
|
+
X as convertArbitraryToTailwindClass,
|
|
288
|
+
K as generateUUID,
|
|
289
|
+
J as getBlocksFromHTML,
|
|
290
|
+
N as getBlocksTailwindCSS,
|
|
291
|
+
ee as getBrandingClasses,
|
|
292
|
+
q as getBreakpointValue,
|
|
293
|
+
re as getStylesForPageData,
|
|
294
|
+
z as selectable,
|
|
295
|
+
H as styling
|
|
236
296
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-JYMCiFoE.cjs"),u=require("react"),n=require("@radix-ui/react-icons"),o=require("./popover-fKjgcRUx.cjs"),x=require("./index-X9ZgD09V.cjs");require("@radix-ui/react-popover");require("./utils-qK_SjzzV.cjs");require("clsx");require("tailwind-merge");require("./ChaiBuilderEditor-BoE-sArB.cjs");require("./MODIFIERS-Fx6WAZcw.cjs");require("@radix-ui/react-scroll-area");require("react-dom");require("@floating-ui/react-dom");require("jotai");require("i18next");require("react-i18next");require("flagged");require("react-dnd");require("lodash");require("@minoru/react-dnd-treeview");require("./skeleton-JHP9zwL2.cjs");require("@radix-ui/react-slot");require("class-variance-authority");require("@radix-ui/react-tooltip");require("@radix-ui/react-toast");require("react-hotkeys-hook");require("flat-to-nested");require("./functions-uw7QP2kT.cjs");require("redux-undo");require("@react-hookz/web");require("./index-HAue58ea.cjs");require("sonner");require("./html-to-json-P6GpbcQX.cjs");require("himalaya");require("lucide-react");require("./alert-dialog-Mv0-wAvS.cjs");require("@radix-ui/react-alert-dialog");const m=u.lazy(()=>Promise.resolve().then(()=>require("./single-page-detail-yPgnu2AI.cjs"))),j=({pageData:s})=>{const[r,t]=u.useState("CLOSE");return e.jsxRuntimeExports.jsxs(o.Popover,{open:r==="OPEN"||r==="ALERT"||r==="PENDING",onOpenChange:i=>{t(r==="PENDING"?"ALERT":i?"OPEN":"CLOSE")},children:[e.jsxRuntimeExports.jsx(o.PopoverTrigger,{asChild:!0,onClick:i=>{i.stopPropagation(),t("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:t})})})]})},p=s=>{const[r]=x.useCurrentPage(),{data:t}=x.useProject(),i=x.useChangePage(),l=(t==null?void 0:t.homepage)===s.uuid,a=r===s.uuid,c=()=>i(s);return t?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},d=({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(t=>e.jsxRuntimeExports.jsx(p,{...t})))});exports.default=d;
|
|
@@ -2,12 +2,12 @@ import { j as e } from "./jsx-runtime-Sp0orL4X.js";
|
|
|
2
2
|
import o, { useState as m, Suspense as p } from "react";
|
|
3
3
|
import { HomeIcon as c, FileTextIcon as u, ChevronRightIcon as d, GearIcon as x } from "@radix-ui/react-icons";
|
|
4
4
|
import { P as g, a as h, b as f } from "./popover-a84pbVhQ.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-T4_wfKl5.js";
|
|
6
6
|
import "@radix-ui/react-popover";
|
|
7
7
|
import "./utils-dze1SGvB.js";
|
|
8
8
|
import "clsx";
|
|
9
9
|
import "tailwind-merge";
|
|
10
|
-
import "./ChaiBuilderEditor-
|
|
10
|
+
import "./ChaiBuilderEditor-hEuUONQ3.js";
|
|
11
11
|
import "./MODIFIERS-DsEzQ3aH.js";
|
|
12
12
|
import "@radix-ui/react-scroll-area";
|
|
13
13
|
import "react-dom";
|
|
@@ -29,14 +29,14 @@ import "flat-to-nested";
|
|
|
29
29
|
import "./functions-pcUZhFJM.js";
|
|
30
30
|
import "redux-undo";
|
|
31
31
|
import "@react-hookz/web";
|
|
32
|
-
import "
|
|
32
|
+
import "./index-ehKdBRUK.js";
|
|
33
33
|
import "sonner";
|
|
34
34
|
import "./html-to-json-pdHQfRkN.js";
|
|
35
35
|
import "himalaya";
|
|
36
36
|
import "lucide-react";
|
|
37
37
|
import "./alert-dialog-GNfnpqFB.js";
|
|
38
38
|
import "@radix-ui/react-alert-dialog";
|
|
39
|
-
const P = o.lazy(() => import("./single-page-detail-
|
|
39
|
+
const P = o.lazy(() => import("./single-page-detail-pAxCy_Pe.js")), v = ({ pageData: r }) => {
|
|
40
40
|
const [t, s] = m("CLOSE");
|
|
41
41
|
return /* @__PURE__ */ e.jsxs(
|
|
42
42
|
g,
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { j as i } from "./jsx-runtime-Sp0orL4X.js";
|
|
2
|
-
import * as
|
|
3
|
-
import { S as
|
|
4
|
-
import {
|
|
5
|
-
import { F as
|
|
6
|
-
import { a as x } from "./index-
|
|
2
|
+
import * as l from "react";
|
|
3
|
+
import { S as n } from "./scroll-area-ewXbxc3n.js";
|
|
4
|
+
import { u as c, o as u } from "./controls-enQY7NI8.js";
|
|
5
|
+
import { F as d } from "./form-dVpOAyRl.js";
|
|
6
|
+
import { a as x } from "./index-T4_wfKl5.js";
|
|
7
7
|
import "@radix-ui/react-scroll-area";
|
|
8
8
|
import "./utils-dze1SGvB.js";
|
|
9
9
|
import "clsx";
|
|
10
10
|
import "tailwind-merge";
|
|
11
|
+
import "lodash";
|
|
11
12
|
import "@rjsf/core";
|
|
12
13
|
import "@rjsf/validator-ajv8";
|
|
13
|
-
import "lodash";
|
|
14
14
|
import "./link-6o6n2Tnd.js";
|
|
15
15
|
import "react-icons-picker";
|
|
16
16
|
import "react-dom";
|
|
@@ -28,7 +28,7 @@ import "@radix-ui/react-slot";
|
|
|
28
28
|
import "class-variance-authority";
|
|
29
29
|
import "@radix-ui/react-tooltip";
|
|
30
30
|
import "@radix-ui/react-toast";
|
|
31
|
-
import "./ChaiBuilderEditor-
|
|
31
|
+
import "./ChaiBuilderEditor-hEuUONQ3.js";
|
|
32
32
|
import "./MODIFIERS-DsEzQ3aH.js";
|
|
33
33
|
import "@floating-ui/react-dom";
|
|
34
34
|
import "i18next";
|
|
@@ -40,6 +40,7 @@ import "flat-to-nested";
|
|
|
40
40
|
import "./functions-pcUZhFJM.js";
|
|
41
41
|
import "redux-undo";
|
|
42
42
|
import "@react-hookz/web";
|
|
43
|
+
import "./index-ehKdBRUK.js";
|
|
43
44
|
import "sonner";
|
|
44
45
|
import "./html-to-json-pdHQfRkN.js";
|
|
45
46
|
import "himalaya";
|
|
@@ -51,12 +52,12 @@ const lo = ({
|
|
|
51
52
|
seany: t
|
|
52
53
|
}) => {
|
|
53
54
|
const { data: o, isLoading: p } = x();
|
|
54
|
-
|
|
55
|
+
l.useEffect(() => {
|
|
55
56
|
o && t(o);
|
|
56
57
|
}, [o, t]);
|
|
57
58
|
const e = ({ formData: s }, r) => {
|
|
58
|
-
t((
|
|
59
|
-
...
|
|
59
|
+
t((f) => ({
|
|
60
|
+
...f,
|
|
60
61
|
[r]: s[r]
|
|
61
62
|
}));
|
|
62
63
|
}, a = {
|
|
@@ -64,9 +65,9 @@ const lo = ({
|
|
|
64
65
|
title: "Project Name",
|
|
65
66
|
default: o == null ? void 0 : o.name
|
|
66
67
|
}),
|
|
67
|
-
favicon:
|
|
68
|
+
favicon: u({ title: "Favicon", default: o == null ? void 0 : o.favicon })
|
|
68
69
|
};
|
|
69
|
-
return /* @__PURE__ */ i.jsx(
|
|
70
|
+
return /* @__PURE__ */ i.jsx(n, { className: "flex h-full select-none flex-col", children: /* @__PURE__ */ i.jsx(d, { properties: a, disabled: p, formData: m, onChange: e }) });
|
|
70
71
|
};
|
|
71
72
|
export {
|
|
72
73
|
lo as default
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const q=require("./jsx-runtime-JYMCiFoE.cjs"),a=require("react"),f=require("./scroll-area-FiHvy-TZ.cjs"),o=require("./controls-W97-POR_.cjs"),d=require("./form-nRAvKPQj.cjs"),m=require("./index-X9ZgD09V.cjs");require("@radix-ui/react-scroll-area");require("./utils-qK_SjzzV.cjs");require("clsx");require("tailwind-merge");require("lodash");require("@rjsf/core");require("@rjsf/validator-ajv8");require("./link-ece8dZGH.cjs");require("react-icons-picker");require("react-dom");require("./dialog-S_QbL1iq.cjs");require("@radix-ui/react-dialog");require("@radix-ui/react-icons");require("./ImagesPanel-6us7hiLN.cjs");require("./tabs-iWeaaVrg.cjs");require("@radix-ui/react-tabs");require("react-quill");require("react-i18next");require("./skeleton-JHP9zwL2.cjs");require("jotai");require("@radix-ui/react-slot");require("class-variance-authority");require("@radix-ui/react-tooltip");require("@radix-ui/react-toast");require("./ChaiBuilderEditor-BoE-sArB.cjs");require("./MODIFIERS-Fx6WAZcw.cjs");require("@floating-ui/react-dom");require("i18next");require("flagged");require("react-dnd");require("@minoru/react-dnd-treeview");require("react-hotkeys-hook");require("flat-to-nested");require("./functions-uw7QP2kT.cjs");require("redux-undo");require("@react-hookz/web");require("./index-HAue58ea.cjs");require("sonner");require("./html-to-json-P6GpbcQX.cjs");require("himalaya");require("lucide-react");require("./alert-dialog-Mv0-wAvS.cjs");require("@radix-ui/react-alert-dialog");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;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { j as p } from "./jsx-runtime-Sp0orL4X.js";
|
|
2
|
-
import {
|
|
2
|
+
import { b as D, u as c, g, o as x } from "./controls-enQY7NI8.js";
|
|
3
3
|
import { F as v } from "./form-dVpOAyRl.js";
|
|
4
4
|
import "react";
|
|
5
|
+
import "lodash";
|
|
5
6
|
import "@rjsf/core";
|
|
6
7
|
import "@rjsf/validator-ajv8";
|
|
7
|
-
import "lodash";
|
|
8
8
|
import "./link-6o6n2Tnd.js";
|
|
9
9
|
import "react-icons-picker";
|
|
10
10
|
import "react-dom";
|
|
@@ -29,7 +29,7 @@ const V = ({
|
|
|
29
29
|
_projectData: t,
|
|
30
30
|
seany: l
|
|
31
31
|
}) => {
|
|
32
|
-
var e,
|
|
32
|
+
var o, e, r, m, a, s;
|
|
33
33
|
const n = ({ formData: f }) => {
|
|
34
34
|
const i = { ...f };
|
|
35
35
|
i.seoData.title === void 0 && (i.seoData.title = ""), i.seoData.description === void 0 && (i.seoData.description = ""), i.seoData.image === void 0 && (i.seoData.image = ""), l((u) => ({
|
|
@@ -40,14 +40,14 @@ const V = ({
|
|
|
40
40
|
seoData: D({
|
|
41
41
|
title: "",
|
|
42
42
|
default: {
|
|
43
|
-
title: ((
|
|
44
|
-
description: ((
|
|
45
|
-
image: ((
|
|
43
|
+
title: ((o = t.seoData) == null ? void 0 : o.title) || "",
|
|
44
|
+
description: ((e = t.seoData) == null ? void 0 : e.description) || "",
|
|
45
|
+
image: ((r = t.seoData) == null ? void 0 : r.image) || ""
|
|
46
46
|
},
|
|
47
47
|
properties: {
|
|
48
48
|
title: c({
|
|
49
49
|
title: "Default Title",
|
|
50
|
-
default: ((
|
|
50
|
+
default: ((m = t.seoData) == null ? void 0 : m.title) || ""
|
|
51
51
|
}),
|
|
52
52
|
description: g({
|
|
53
53
|
title: "Default Description",
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("./jsx-runtime-JYMCiFoE.cjs"),r=require("./controls-W97-POR_.cjs"),g=require("./form-nRAvKPQj.cjs");require("react");require("lodash");require("@rjsf/core");require("@rjsf/validator-ajv8");require("./link-ece8dZGH.cjs");require("react-icons-picker");require("react-dom");require("./dialog-S_QbL1iq.cjs");require("@radix-ui/react-dialog");require("@radix-ui/react-icons");require("./utils-qK_SjzzV.cjs");require("clsx");require("tailwind-merge");require("./ImagesPanel-6us7hiLN.cjs");require("./tabs-iWeaaVrg.cjs");require("@radix-ui/react-tabs");require("react-quill");require("react-i18next");require("./skeleton-JHP9zwL2.cjs");require("jotai");require("@radix-ui/react-slot");require("class-variance-authority");require("@radix-ui/react-tooltip");require("@radix-ui/react-toast");const D=({_projectData:e,seany:q})=>{var t,o,u,s,a,l;const d=({formData:f})=>{const i={...f};i.seoData.title===void 0&&(i.seoData.title=""),i.seoData.description===void 0&&(i.seoData.description=""),i.seoData.image===void 0&&(i.seoData.image=""),q(m=>({...m,...i}))},c={seoData:r.b({title:"",default:{title:((t=e.seoData)==null?void 0:t.title)||"",description:((o=e.seoData)==null?void 0:o.description)||"",image:((u=e.seoData)==null?void 0:u.image)||""},properties:{title:r.u({title:"Default Title",default:((s=e.seoData)==null?void 0:s.title)||""}),description:r.g({title:"Default Description",default:((a=e.seoData)==null?void 0:a.description)||""}),image:r.o({title:"Social Media Image",default:((l=e.seoData)==null?void 0:l.image)||""})}})};return n.jsxRuntimeExports.jsx("div",{className:"flex h-full select-none flex-col",children:n.jsxRuntimeExports.jsx(g.Form,{properties:c,formData:e,onChange:d})})};exports.default=D;
|
package/dist/render.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("./jsx-runtime-JYMCiFoE.cjs"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("./jsx-runtime-JYMCiFoE.cjs"),x=require("react"),r=require("lodash"),R=require("tailwind-merge"),l=require("./MODIFIERS-Fx6WAZcw.cjs"),_=require("./index-HAue58ea.cjs"),j=require("./functions-sCuB7nvZ.cjs"),q=require("react-wrap-balancer");require("@mhsdesign/jit-browser-tailwindcss");require("@bobthered/tailwindcss-palette-generator");require("@tailwindcss/forms");require("@tailwindcss/typography");require("@tailwindcss/aspect-ratio");require("@tailwindcss/line-clamp");const y=e=>{const s={};return Object.keys(e).forEach(t=>{r.isString(e[t])&&e[t].startsWith(l.SLOT_KEY)&&(s[t]=e[t].replace(l.SLOT_KEY,"").split(","))}),s},O=r.memoize((e,s)=>{const t=e.replace(l.STYLES_KEY,"").split(","),n=R.twMerge(t[0],t[1]);return j.addPrefixToClasses(n,s).replace(l.STYLES_KEY,"").trim()});function B(e,s){return r.get(e,`${s}_attrs`,{})}function C(e,s){const t={};return Object.keys(e).forEach(n=>{if(r.isString(e[n])&&e[n].startsWith(l.STYLES_KEY)){const o=O(e[n],s);t[n]={className:o,...B(e,n)}}}),t}function T(e,s){const t=r.get(e,"_bindings",{});return r.isEmpty(t)?{...e}:(r.each(t,(n,o)=>{r.isString(n)&&r.get(s,n,null)&&(e[o]=r.get(s,n,null))}),e)}function a({blocks:e,parent:s,classPrefix:t="c-",externalData:n={}}){const o=e,p=i=>C(i,t),h=s?r.filter(e,{_parent:s}):r.filter(e,i=>r.isEmpty(i._parent));return c.jsxRuntimeExports.jsx(c.jsxRuntimeExports.Fragment,{children:x.Children.toArray(h.map((i,f)=>{const d=y(i),m={};r.isEmpty(d)||Object.keys(d).forEach(u=>{m[u]=x.Children.toArray(d[u].map(E=>c.jsxRuntimeExports.jsx(a,{externalData:n,classPrefix:t,blocks:o,parent:E})))});const S=r.filter(o,{_parent:i._id});m.children=S.length>0?c.jsxRuntimeExports.jsx(a,{externalData:n,classPrefix:t,parent:i._id,blocks:o}):null;const g=_.h(i._type);if(g!==null){let u=i;const E=g.component;return u={...g.defaults,...i},x.createElement(E,r.omit({blockProps:{},inBuilder:!1,...u,index:f,...T(i,n),...p(u),...m},["_parent"]))}return c.jsxRuntimeExports.jsxs("noscript",{children:[i._type," not found"]})}))})}const Y=({pageData:e,externalData:s={},before:t=null,after:n=null,classPrefix:o="c-"})=>{const p=r.get(e.project,"brandingOptions",l.BRANDING_OPTIONS_DEFAULTS);return c.jsxRuntimeExports.jsxs(c.jsxRuntimeExports.Fragment,{children:[t,c.jsxRuntimeExports.jsx("div",{className:o.replace("-","")+" "+j.getBrandingClasses(p,o)+" min-h-screen",children:c.jsxRuntimeExports.jsx(q.Provider,{children:c.jsxRuntimeExports.jsx(a,{externalData:s,blocks:e.page.blocks||[],classPrefix:o})})}),n]})};exports.RenderChaiBlocks=a;exports.RenderChaiPage=Y;
|