@chaibuilder/sdk 1.0.9 → 1.0.10
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/LICENSE +28 -0
- package/README.md +123 -21
- package/dist/AddBlocks-tdvDe7xL.cjs +3 -0
- package/dist/{AddBlocks-d10b7b87.js → AddBlocks-xR2s2BVa.js} +47 -44
- package/dist/BrandingOptions-DpJ-oNnf.cjs +1 -0
- package/dist/{BrandingOptions-f4ab5d9f.js → BrandingOptions-cHK2bVZy.js} +14 -18
- package/dist/{CanvasArea-10356200.js → CanvasArea-2zqT1lSE.js} +492 -503
- package/dist/CanvasArea-Br8bBSeT.cjs +46 -0
- package/dist/ChaiBuilderEditor-SacH75l4.cjs +163 -0
- package/dist/{index-aa42febc.js → ChaiBuilderEditor-h9bXC4l-.js} +11215 -15404
- package/dist/Class-_uCzl5v1.cjs +1 -0
- package/dist/{html-to-json-45e0e3b5.js → Class-l7qYbuoN.js} +185 -366
- package/dist/{CurrentPage-35e14043.js → CurrentPage-4lTETR2f.js} +26 -23
- package/dist/CurrentPage-nlUWJiUA.cjs +1 -0
- package/dist/{ImagesPanel-8b7a989d.cjs → ImagesPanel-6us7hiLN.cjs} +1 -1
- package/dist/{ImagesPanel-47ac13c3.js → ImagesPanel-oaHOD-Ex.js} +4 -4
- package/dist/Layers-Vw4XE6YB.cjs +1 -0
- package/dist/{Layers-c3dd4fc8.js → Layers-wOfijZnb.js} +42 -41
- package/dist/MarkAsGlobalBlock-1J_YyL1L.cjs +1 -0
- package/dist/{MarkAsGlobalBlock-505ae793.js → MarkAsGlobalBlock-xRyn29gC.js} +17 -20
- package/dist/{PagesPanel-bafc506f.js → PagesPanel-82gCVzHS.js} +16 -13
- package/dist/PagesPanel-ZKRdK-mI.cjs +1 -0
- package/dist/ProjectPanel-kYg4KkJu.cjs +1 -0
- package/dist/{ProjectPanel-6113f394.js → ProjectPanel-vz5WOyqZ.js} +22 -19
- package/dist/Settings-1E3Y_5r6.cjs +1 -0
- package/dist/{Settings-1c41c514.js → Settings-IuAF359L.js} +297 -296
- package/dist/SidePanels-WL1UioF2.cjs +1 -0
- package/dist/{SidePanels-c13f87dc.js → SidePanels-xssTWt4M.js} +34 -42
- package/dist/Topbar-3ozdWfSy.cjs +1 -0
- package/dist/{Topbar-b38d5d50.js → Topbar-H0f0EL6-.js} +33 -35
- package/dist/UnsplashImages-BoBBSi1a.cjs +1 -0
- package/dist/{UnsplashImages-4edb97e7.js → UnsplashImages-gPcBLjgB.js} +13 -14
- package/dist/UploadImages-T6kW0s3G.cjs +1 -0
- package/dist/{UploadImages-52181c3e.js → UploadImages-_ZyUU66E.js} +11 -12
- package/dist/{accordion-c0176dc5.js → accordion-oPUeqPCZ.js} +2 -2
- package/dist/{accordion-0afd8143.cjs → accordion-ynvFtV_p.cjs} +1 -1
- package/dist/{add-page-modal-08a19915.js → add-page-modal-J1E7rh1U.js} +25 -22
- package/dist/add-page-modal-eiiUZCJX.cjs +1 -0
- package/dist/alert-dialog-GNfnpqFB.js +64 -0
- package/dist/alert-dialog-Mv0-wAvS.cjs +1 -0
- package/dist/{command-b1103666.cjs → command-ThdTuUxt.cjs} +1 -1
- package/dist/{command-6f260f61.js → command-VHca6CcN.js} +3 -3
- package/dist/confirm-alert-8EHe0OOd.cjs +1 -0
- package/dist/confirm-alert-b0e_BLhF.js +36 -0
- package/dist/{context-menu-e1c240ce.js → context-menu-8dC9uGXj.js} +2 -2
- package/dist/{context-menu-fec580f2.cjs → context-menu-IgLbIuth.cjs} +1 -1
- package/dist/controls-Ni5kEzLz.js +103 -0
- package/dist/controls-xUKa23ic.cjs +1 -0
- package/dist/core.cjs +1 -1
- package/dist/core.d.ts +1 -10
- package/dist/core.js +116 -69
- package/dist/delete-page-modal-TGTmRjyn.cjs +1 -0
- package/dist/{delete-page-modal-9b37665b.js → delete-page-modal-ysj4O0bM.js} +25 -22
- package/dist/{dialog-170eaad9.cjs → dialog-S_QbL1iq.cjs} +1 -1
- package/dist/{dialog-18207bef.js → dialog-jrw9DF1f.js} +2 -2
- package/dist/{dropdown-menu-ae3ed09b.js → dropdown-menu-S03K_fNs.js} +2 -2
- package/dist/{dropdown-menu-84b2439e.cjs → dropdown-menu-sMXR59cB.cjs} +1 -1
- package/dist/{form-25e1af37.js → form-dVpOAyRl.js} +2 -2
- package/dist/{form-ea21db6c.cjs → form-nRAvKPQj.cjs} +1 -1
- package/dist/{functions-83b1de8d.js → functions-nNTuSTsR.js} +1 -1
- package/dist/functions-pcUZhFJM.js +12 -0
- package/dist/{functions-f84d5e2a.cjs → functions-sCuB7nvZ.cjs} +1 -1
- package/dist/functions-uw7QP2kT.cjs +1 -0
- package/dist/html-to-json-P6GpbcQX.cjs +1 -0
- package/dist/html-to-json-pdHQfRkN.js +178 -0
- package/dist/index-8L3zCc6V.cjs +1 -0
- package/dist/index-cZ4uo6aT.js +2256 -0
- package/dist/{label-e770a087.js → label-KaP7MRrs.js} +2 -2
- package/dist/{label-167415e5.cjs → label-tFm8HZdb.cjs} +1 -1
- package/dist/lib.cjs +1 -1
- package/dist/lib.d.ts +20 -13
- package/dist/lib.js +24 -23
- package/dist/{link-57de608a.js → link-6o6n2Tnd.js} +4 -4
- package/dist/link-ece8dZGH.cjs +1 -0
- package/dist/{page-viewer-5c733179.js → page-viewer-84Giu0Rs.js} +29 -26
- package/dist/page-viewer-OdVEG83P.cjs +1 -0
- package/dist/{popover-f7addcf4.js → popover-a84pbVhQ.js} +2 -2
- package/dist/{popover-7cb9079b.cjs → popover-fKjgcRUx.cjs} +1 -1
- package/dist/{project-general-setting-d9736056.js → project-general-setting-8OEVVxzn.js} +20 -17
- package/dist/project-general-setting-laHNQPW5.cjs +1 -0
- package/dist/{project-seo-setting-d81fc1e3.js → project-seo-setting-9kD_stdI.js} +11 -12
- package/dist/project-seo-setting-F3Opt9Uj.cjs +1 -0
- package/dist/render.cjs +1 -1
- package/dist/render.d.ts +7 -7
- package/dist/render.js +3 -3
- package/dist/{scroll-area-bb343b86.cjs → scroll-area-FiHvy-TZ.cjs} +1 -1
- package/dist/{scroll-area-83bd9e8f.js → scroll-area-ewXbxc3n.js} +2 -2
- package/dist/{select-0e32300c.cjs → select-7bjg-rr9.cjs} +1 -1
- package/dist/{select-7fddd7c3.js → select-POGdEDHT.js} +2 -2
- package/dist/{separator-a597dba7.cjs → separator-3Civ-6hb.cjs} +1 -1
- package/dist/{separator-a80d065b.js → separator-SctTn0Qi.js} +2 -2
- package/dist/server.d.ts +7 -10
- package/dist/server.js +0 -3
- package/dist/single-page-detail-X0TGlsT4.cjs +1 -0
- package/dist/{single-page-detail-04410e64.js → single-page-detail-iXpavDy8.js} +32 -29
- package/dist/skeleton-CU_FIbg3.js +239 -0
- package/dist/skeleton-JHP9zwL2.cjs +1 -0
- package/dist/studio.cjs +1 -0
- package/dist/studio.d.ts +13 -0
- package/dist/studio.js +39 -0
- package/dist/{tabs-85caa1e8.js → tabs-Gb9v5dVb.js} +2 -2
- package/dist/{tabs-860e37aa.cjs → tabs-iWeaaVrg.cjs} +1 -1
- package/dist/{textarea-a338ede6.cjs → textarea-1kZEh7ki.cjs} +1 -1
- package/dist/{textarea-0750bcd2.js → textarea-b2QvVhrK.js} +2 -2
- package/dist/{toggle-00c9d11e.js → toggle-ASJRAaGP.js} +2 -2
- package/dist/{toggle-b90fed97.cjs → toggle-ehNIPmme.cjs} +1 -1
- package/dist/ui.cjs +1 -1
- package/dist/ui.d.ts +69 -4
- package/dist/ui.js +272 -212
- package/dist/useAddBlock-1cMXaOVk.cjs +1 -0
- package/dist/useAddBlock-BOjrGBEO.js +86 -0
- package/dist/useAllBlocks-RU_Xw8j9.cjs +1 -0
- package/dist/useAllBlocks-lX6uVO39.js +20 -0
- package/dist/useChaiExternalData-4K9WxANa.js +6 -0
- package/dist/useChaiExternalData-DkyBJ81C.cjs +1 -0
- package/dist/useDarkMode-JWkrNFpH.js +23 -0
- package/dist/useDarkMode-zeTW_UUR.cjs +1 -0
- package/dist/useFeatureSupport-jWSuY7wk.js +16 -0
- package/dist/useFeatureSupport-tZ0QfBxp.cjs +1 -0
- package/dist/useHiddenBlocks-3MsGOJ1s.js +15 -0
- package/dist/useHiddenBlocks-oJuQDmTy.cjs +1 -0
- package/dist/useLanguage-O1uu2Bzu.js +216 -0
- package/dist/useLanguage-Y3qgAbgG.cjs +1 -0
- package/dist/useMarkAsGlobalBlock-DB5B1UP6.js +25 -0
- package/dist/useMarkAsGlobalBlock-toxRSLc_.cjs +1 -0
- package/dist/useUiLibraries-4hPOi8DI.js +12 -0
- package/dist/useUiLibraries-9FhQCpKo.cjs +1 -0
- package/package.json +19 -5
- package/dist/AddBlocks-76275943.cjs +0 -3
- package/dist/BrandingOptions-d3b3309a.cjs +0 -1
- package/dist/CanvasArea-9f94cd28.cjs +0 -46
- package/dist/CurrentPage-edb509db.cjs +0 -1
- package/dist/Layers-ecba52c1.cjs +0 -1
- package/dist/MarkAsGlobalBlock-3a06a159.cjs +0 -1
- package/dist/PagesPanel-f4329082.cjs +0 -1
- package/dist/ProjectPanel-ce3116d3.cjs +0 -1
- package/dist/Settings-b6a2bef6.cjs +0 -1
- package/dist/SidePanels-2cc72c0b.cjs +0 -1
- package/dist/Topbar-3b9db9f3.cjs +0 -1
- package/dist/UnsplashImages-98c085c2.cjs +0 -1
- package/dist/UploadImages-61ef83ad.cjs +0 -1
- package/dist/add-page-modal-7f9ff733.cjs +0 -1
- package/dist/confirm-alert-c1fdf1e4.js +0 -35
- package/dist/confirm-alert-e1ea5110.cjs +0 -1
- package/dist/delete-page-modal-7066b01f.cjs +0 -1
- package/dist/html-to-json-aadcbf66.cjs +0 -1
- package/dist/index-c535cc95.cjs +0 -164
- package/dist/link-24679521.cjs +0 -1
- package/dist/page-viewer-da99c71e.cjs +0 -1
- package/dist/project-general-setting-90f8416d.cjs +0 -1
- package/dist/project-seo-setting-6eef8387.cjs +0 -1
- package/dist/single-page-detail-90f49d7a.cjs +0 -1
- package/dist/useBuilderProp-21feb2da.js +0 -296
- package/dist/useBuilderProp-adacf42f.cjs +0 -1
- package/dist/useChaiExternalData-192c7896.js +0 -5
- package/dist/useChaiExternalData-a90e8aac.cjs +0 -1
- /package/dist/{MODIFIERS-2f19c314.js → MODIFIERS-DsEzQ3aH.js} +0 -0
- /package/dist/{MODIFIERS-4716c669.cjs → MODIFIERS-Fx6WAZcw.cjs} +0 -0
- /package/dist/{jsx-runtime-5c3ac4f7.cjs → jsx-runtime-JYMCiFoE.cjs} +0 -0
- /package/dist/{jsx-runtime-944c88e2.js → jsx-runtime-Sp0orL4X.js} +0 -0
- /package/dist/{utils-ac68b2c8.js → utils-dze1SGvB.js} +0 -0
- /package/dist/{utils-3c452dd0.cjs → utils-qK_SjzzV.cjs} +0 -0
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { j as t } from "./jsx-runtime-
|
|
1
|
+
import { j as t } from "./jsx-runtime-Sp0orL4X.js";
|
|
2
2
|
import * as s from "react";
|
|
3
3
|
import * as o from "@radix-ui/react-label";
|
|
4
4
|
import { cva as m } from "class-variance-authority";
|
|
5
|
-
import { c as i } from "./utils-
|
|
5
|
+
import { c as i } from "./utils-dze1SGvB.js";
|
|
6
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
7
|
p.displayName = o.Root.displayName;
|
|
8
8
|
export {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const i=require("./jsx-runtime-
|
|
1
|
+
"use strict";const i=require("./jsx-runtime-JYMCiFoE.cjs"),c=require("react"),l=require("@radix-ui/react-label"),u=require("class-variance-authority"),d=require("./utils-qK_SjzzV.cjs");function n(e){const a=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const r=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(a,t,r.get?r:{enumerable:!0,get:()=>e[t]})}}return a.default=e,Object.freeze(a)}const m=n(c),o=n(l),b=u.cva("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),s=m.forwardRef(({className:e,...a},t)=>i.jsxRuntimeExports.jsx(o.Root,{ref:t,className:d.cn(b(),e),...a}));s.displayName=o.Root.displayName;exports.Label=s;
|
package/dist/lib.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const T=require("./utils-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const T=require("./utils-qK_SjzzV.cjs"),f=require("./functions-uw7QP2kT.cjs"),k=require("./html-to-json-P6GpbcQX.cjs"),n=require("lodash"),b=require("./Class-_uCzl5v1.cjs"),r=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"},q={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"},y=16,S=4;function V(a){return a.indexOf("rem")!==-1&&(a=`${parseFloat(a.replace("rem",""))*y}px`),a}const w=a=>{const l=a.match(/\[.*\]/);if(l===null)return a;const p=b.constructClassObject(a);if(p===null)return a;const{property:m}=p;let e=n.first(l).replace(/\]/i,"").replace(/\[/i,"");const i=a.replace(/\[.*\]/i,"");e=V(e);let s=a;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 c=n.map(n.keys(q),t=>`${t}px`);if(n.includes(c,e)){const t=n.parseInt(e.replace("px",""),10);t===1?s=`${i}px`:s=i+t/S}}if(e.indexOf("%")!==-1){const c=n.map(n.keys(g),t=>`${t}%`);if(n.includes(c,e)){const t=parseFloat(e.replace("%",""));s=i+n.get(g,t)}}e.indexOf("vw")!==-1&&parseFloat(e.replace("vw",""))===100&&(s=`${i}screen`),e.indexOf("vh")!==-1&&parseFloat(e.replace("vh",""))===100&&(s=`${i}screen`);break;case"minWidth":e.indexOf("%")!==-1&&parseFloat(e.replace("%",""))===100&&(s=`${i}full`),e==="0px"&&(s="min-w-0");break;case"maxWidth":e==="0px"&&(s="max-w-0");const o={"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(o),e)&&(s=`max-w-${o[e]}`);break;case"minHeight":e.indexOf("%")!==-1&&parseFloat(e.replace("%",""))===100&&(s=`${i}full`),e==="0px"&&(s="min-h-0"),e==="100vh"&&(s="min-h-screen");break;case"fontSize":const x={"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(x),e)&&(s=i+x[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)&&(s=i+u[e]);break;case"zIndex":s=["0","10","20","30","40","50"].indexOf(e)!==-1?`${i}${e}`:a;break;case"opacity":const h=["0","5","10","20","25","30","40","50","60","70","75","80","90","95","100"],d=parseFloat(e)*100;n.includes(h,d.toString())&&(s=`opacity-${d}`);break}return s},O=a=>({...a}),C=a=>({...a});exports.cn=T.cn;exports.generateUUID=f.generateUUID;exports.getBreakpointValue=f.getBreakpointValue;exports.getBlocksFromHTML=k.getBlocksFromHTML;exports.addPrefixToClasses=r.addPrefixToClasses;exports.getBlocksTailwindCSS=r.getBlocksTailwindCSS;exports.getBrandingClasses=r.getBrandingClasses;exports.getStylesForPageData=r.getStylesForPageData;exports.convertArbitraryToTailwindClass=w;exports.selectable=O;exports.styling=C;
|
package/dist/lib.d.ts
CHANGED
|
@@ -2,6 +2,13 @@ import { ClassValue } from 'clsx';
|
|
|
2
2
|
|
|
3
3
|
export declare const addPrefixToClasses: (classes: string, prefix?: string) => string;
|
|
4
4
|
|
|
5
|
+
declare type BrandingOptions = {
|
|
6
|
+
bodyTextLightColor?: string;
|
|
7
|
+
bodyTextDarkColor?: string;
|
|
8
|
+
bodyBgLightColor?: string;
|
|
9
|
+
bodyBgDarkColor?: string;
|
|
10
|
+
};
|
|
11
|
+
|
|
5
12
|
declare type ChaiBlock = {
|
|
6
13
|
_id: string;
|
|
7
14
|
_name?: string;
|
|
@@ -15,8 +22,8 @@ export declare type ChaiPageData = {
|
|
|
15
22
|
blocks: ChaiBlock[];
|
|
16
23
|
seoData?: Record<string, string>;
|
|
17
24
|
slug?: string;
|
|
18
|
-
name
|
|
19
|
-
providers
|
|
25
|
+
name?: string;
|
|
26
|
+
providers?: {
|
|
20
27
|
providerKey: string;
|
|
21
28
|
args: Record<string, any>;
|
|
22
29
|
}[];
|
|
@@ -30,13 +37,13 @@ export declare type ChaiPageData = {
|
|
|
30
37
|
}[];
|
|
31
38
|
}[];
|
|
32
39
|
project: {
|
|
33
|
-
name
|
|
34
|
-
favicon
|
|
40
|
+
name?: string;
|
|
41
|
+
favicon?: string;
|
|
35
42
|
brandingOptions: Record<string, string | number>;
|
|
36
43
|
seoData?: Record<string, string>;
|
|
37
|
-
primaryLanguage
|
|
38
|
-
languages
|
|
39
|
-
homepage
|
|
44
|
+
primaryLanguage?: string;
|
|
45
|
+
languages?: string[];
|
|
46
|
+
homepage?: string;
|
|
40
47
|
};
|
|
41
48
|
};
|
|
42
49
|
|
|
@@ -44,10 +51,6 @@ export declare const cn: (...inputs: ClassValue[]) => string;
|
|
|
44
51
|
|
|
45
52
|
export declare const convertArbitraryToTailwindClass: (className: string) => string;
|
|
46
53
|
|
|
47
|
-
export declare const enableStyling: (attrs: Record<string, string>) => {
|
|
48
|
-
[x: string]: string;
|
|
49
|
-
};
|
|
50
|
-
|
|
51
54
|
/**
|
|
52
55
|
* Get the unique uuid
|
|
53
56
|
*/
|
|
@@ -62,13 +65,17 @@ export declare const getBlocksFromHTML: (html: string) => ChaiBlock[];
|
|
|
62
65
|
|
|
63
66
|
export declare const getBlocksTailwindCSS: (blocks: ChaiBlock[], brandingOptions: any, prefix?: string) => Promise<string>;
|
|
64
67
|
|
|
65
|
-
export declare const getBrandingClasses: (brandingOptions:
|
|
68
|
+
export declare const getBrandingClasses: (brandingOptions: BrandingOptions, prefix?: string) => string;
|
|
66
69
|
|
|
67
70
|
export declare const getBreakpointValue: (width: number) => "2XL" | "XL" | "LG" | "MD" | "SM" | "XS";
|
|
68
71
|
|
|
69
72
|
export declare const getStylesForPageData: (pageData: ChaiPageData, classPrefix?: string) => Promise<string>;
|
|
70
73
|
|
|
71
|
-
export declare const
|
|
74
|
+
export declare const selectable: (attrs: Record<string, string>) => {
|
|
75
|
+
[x: string]: string;
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
export declare const styling: (attrs: Record<string, string>) => {
|
|
72
79
|
[x: string]: string;
|
|
73
80
|
};
|
|
74
81
|
|
package/dist/lib.js
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
import { c as D } from "./utils-
|
|
2
|
-
import {
|
|
3
|
-
import { g as
|
|
4
|
-
import { first as T, includes as c, keys as p, map as g, parseInt as
|
|
5
|
-
import {
|
|
1
|
+
import { c as D } from "./utils-dze1SGvB.js";
|
|
2
|
+
import { g as j, a as K } from "./functions-pcUZhFJM.js";
|
|
3
|
+
import { g as G } from "./html-to-json-pdHQfRkN.js";
|
|
4
|
+
import { first as T, includes as c, keys as p, map as g, parseInt as b, get as V } from "lodash";
|
|
5
|
+
import { c as O } from "./Class-l7qYbuoN.js";
|
|
6
|
+
import { a as Q, b as Z, g as N, c as ee } from "./functions-nNTuSTsR.js";
|
|
6
7
|
import "clsx";
|
|
7
8
|
import "tailwind-merge";
|
|
8
|
-
import "./MODIFIERS-2f19c314.js";
|
|
9
9
|
import "himalaya";
|
|
10
|
+
import "./MODIFIERS-DsEzQ3aH.js";
|
|
10
11
|
import "@mhsdesign/jit-browser-tailwindcss";
|
|
11
12
|
import "@bobthered/tailwindcss-palette-generator";
|
|
12
13
|
import "@tailwindcss/forms";
|
|
@@ -30,7 +31,7 @@ const d = {
|
|
|
30
31
|
"58.33": "7/12",
|
|
31
32
|
"91.67": "11/12",
|
|
32
33
|
100: "full"
|
|
33
|
-
},
|
|
34
|
+
}, k = {
|
|
34
35
|
0: "0",
|
|
35
36
|
1: "px",
|
|
36
37
|
2: "0.5",
|
|
@@ -66,21 +67,21 @@ const d = {
|
|
|
66
67
|
288: "72",
|
|
67
68
|
320: "80",
|
|
68
69
|
384: "96"
|
|
69
|
-
}, w = 16,
|
|
70
|
-
function
|
|
70
|
+
}, w = 16, _ = 4;
|
|
71
|
+
function $(s) {
|
|
71
72
|
return s.indexOf("rem") !== -1 && (s = `${parseFloat(s.replace("rem", "")) * w}px`), s;
|
|
72
73
|
}
|
|
73
74
|
const z = (s) => {
|
|
74
75
|
const r = s.match(/\[.*\]/);
|
|
75
76
|
if (r === null)
|
|
76
77
|
return s;
|
|
77
|
-
const o =
|
|
78
|
+
const o = O(s);
|
|
78
79
|
if (o === null)
|
|
79
80
|
return s;
|
|
80
81
|
const { property: u } = o;
|
|
81
82
|
let e = T(r).replace(/\]/i, "").replace(/\[/i, "");
|
|
82
83
|
const t = s.replace(/\[.*\]/i, "");
|
|
83
|
-
e =
|
|
84
|
+
e = $(e);
|
|
84
85
|
let a = s;
|
|
85
86
|
switch (u) {
|
|
86
87
|
case "top":
|
|
@@ -115,17 +116,17 @@ const z = (s) => {
|
|
|
115
116
|
case "spaceX":
|
|
116
117
|
case "spaceY":
|
|
117
118
|
if (e.indexOf("px") !== -1) {
|
|
118
|
-
const n = g(p(
|
|
119
|
+
const n = g(p(k), (i) => `${i}px`);
|
|
119
120
|
if (c(n, e)) {
|
|
120
|
-
const i =
|
|
121
|
-
i === 1 ? a = `${t}px` : a = t + i /
|
|
121
|
+
const i = b(e.replace("px", ""), 10);
|
|
122
|
+
i === 1 ? a = `${t}px` : a = t + i / _;
|
|
122
123
|
}
|
|
123
124
|
}
|
|
124
125
|
if (e.indexOf("%") !== -1) {
|
|
125
126
|
const n = g(p(d), (i) => `${i}%`);
|
|
126
127
|
if (c(n, e)) {
|
|
127
128
|
const i = parseFloat(e.replace("%", ""));
|
|
128
|
-
a = t +
|
|
129
|
+
a = t + V(d, i);
|
|
129
130
|
}
|
|
130
131
|
}
|
|
131
132
|
e.indexOf("vw") !== -1 && parseFloat(e.replace("vw", "")) === 100 && (a = `${t}screen`), e.indexOf("vh") !== -1 && parseFloat(e.replace("vh", "")) === 100 && (a = `${t}screen`);
|
|
@@ -221,15 +222,15 @@ const z = (s) => {
|
|
|
221
222
|
return a;
|
|
222
223
|
}, H = (s) => ({ ...s }), M = (s) => ({ ...s });
|
|
223
224
|
export {
|
|
224
|
-
|
|
225
|
+
Q as addPrefixToClasses,
|
|
225
226
|
D as cn,
|
|
226
227
|
z as convertArbitraryToTailwindClass,
|
|
227
|
-
M as enableStyling,
|
|
228
228
|
j as generateUUID,
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
H as
|
|
229
|
+
G as getBlocksFromHTML,
|
|
230
|
+
Z as getBlocksTailwindCSS,
|
|
231
|
+
N as getBrandingClasses,
|
|
232
|
+
K as getBreakpointValue,
|
|
233
|
+
ee as getStylesForPageData,
|
|
234
|
+
H as selectable,
|
|
235
|
+
M as styling
|
|
235
236
|
};
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { j as e } from "./jsx-runtime-
|
|
1
|
+
import { j as e } from "./jsx-runtime-Sp0orL4X.js";
|
|
2
2
|
import m, { IconPickerItem as g } from "react-icons-picker";
|
|
3
3
|
import x from "react-dom";
|
|
4
4
|
import { isEmpty as h, map as f } from "lodash";
|
|
5
5
|
import { useState as u, useEffect as b } from "react";
|
|
6
|
-
import { D as j, a as v, b as k } from "./dialog-
|
|
7
|
-
import y from "./ImagesPanel-
|
|
6
|
+
import { D as j, a as v, b as k } from "./dialog-jrw9DF1f.js";
|
|
7
|
+
import y from "./ImagesPanel-oaHOD-Ex.js";
|
|
8
8
|
import w from "react-quill";
|
|
9
9
|
import "react-i18next";
|
|
10
|
-
import { u as N } from "./
|
|
10
|
+
import { u as N } from "./skeleton-CU_FIbg3.js";
|
|
11
11
|
const B = (t) => {
|
|
12
12
|
try {
|
|
13
13
|
const r = document.getElementById("icon-picker-field"), s = document.createElement("div");
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const e=require("./jsx-runtime-JYMCiFoE.cjs"),m=require("react-icons-picker"),h=require("react-dom"),g=require("lodash"),d=require("react"),x=require("./dialog-S_QbL1iq.cjs"),j=require("./ImagesPanel-6us7hiLN.cjs"),E=require("react-quill");require("react-i18next");const R=require("./skeleton-JHP9zwL2.cjs"),f=t=>{try{const s=document.getElementById("icon-picker-field"),r=document.createElement("div");h.render(e.jsxRuntimeExports.jsx(m.IconPickerItem,{value:t}),r),s.appendChild(r),r.hidden=!0;let l=r.innerHTML;setTimeout(()=>s.removeChild(r),1e3);const o=new DOMParser().parseFromString(l,"image/svg+xml"),n=o.querySelector("svg");return n&&(n.removeAttribute("width"),n.removeAttribute("height")),new XMLSerializer().serializeToString(o)}catch{return""}},b=({value:t,onChange:s,onBlur:r,id:l})=>{const a=o=>{s("<svg />");const n=f(o);s(n),r(l,n)};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 group",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 z-0"}),e.jsxRuntimeExports.jsx(m,{value:t?"BiSolidGrid":null,onChange:a,pickButtonStyle:{position:"relative",height:"48px",width:"48px",border:"1px solid #BBBBBB",display:"flex",alignItems:"center",justifyContent:"center",borderRadius:"6px",backgroundColor:"transparent",zIndex:1},searchInputStyle:{backgroundColor:"transparent",width:"100%",border:"1px solid #BBBBBB",margin:"0px 10px",padding:"10px"}})]}),e.jsxRuntimeExports.jsx("textarea",{value:t,onChange:o=>s(o.target.value),className:"h-full border 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"})]})},k=({children:t,onSelect:s})=>{const[r,l]=d.useState(!1),a=(...o)=>{s.call(void 0,...o),l(!1)};return e.jsxRuntimeExports.jsxs(x.Dialog,{open:r,onOpenChange:o=>l(o),children:[e.jsxRuntimeExports.jsx(x.DialogTrigger,{asChild:!0,children:t}),e.jsxRuntimeExports.jsx(x.DialogContent,{className:"flex h-3/4 max-w-5xl",children:e.jsxRuntimeExports.jsx("div",{className:"h-full w-full",children:e.jsxRuntimeExports.jsx(j.default,{isModalView:!0,onSelect:a})})})]})},p=k,v=({value:t,onChange:s,id:r,onBlur:l})=>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}})=>l(r,a),onChange:a=>s(a.target.value)})]})]}),y=({id:t,placeholder:s,value:r,onChange:l,onBlur:a})=>{const o={toolbar:[["bold","italic","underline","strike","blockquote"],[{list:"ordered"},{list:"bullet"}],[{color:[]},{background:[]},{align:[]}],["link","clean"]]},n=["header","font","list","bold","italic","underline","strike","blockquote","color","background","align","link","image"];return typeof window>"u"?null:e.jsxRuntimeExports.jsx(E,{id:t,value:r,onBlur:c=>a(t,c),onChange:c=>l(c),modules:o,formats:n,placeholder:s,className:"mt-1 rounded-md"})},w=({schema:t,formData:s,onChange:r})=>{const[l,a]=d.useState([]),o=R.useBuilderProp("getPages",()=>[]),{type:n="page",href:c="",target:u="self"}=s;return d.useEffect(()=>{(async()=>{const i=await o();a(i||[])})()},[o]),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:n,onChange:i=>r({...s,type:i.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(i=>e.jsxRuntimeExports.jsx("option",{value:i.const,children:i.title},i.const))}),n==="page"?e.jsxRuntimeExports.jsxs("select",{name:"href",defaultValue:"",placeholder:"Choose Page",value:c,onChange:i=>r({...s,href:i.target.value}),children:[e.jsxRuntimeExports.jsx("option",{value:"",children:"Choose page"}),g.map(l,i=>e.jsxRuntimeExports.jsx("option",{value:i.slug,children:i.name},i.uuid))]}):e.jsxRuntimeExports.jsx("input",{name:"href",type:"text",value:c,onChange:i=>r({...s,href:i.target.value}),placeholder:n==="page"||n==="url"?"Enter URL":n==="scroll"?"#ElementID":"Enter detail"}),(n==="page"||n==="url")&&e.jsxRuntimeExports.jsxs("div",{className:"flex items-center gap-x-2",children:[e.jsxRuntimeExports.jsx("input",{type:"checkbox",defaultChecked:u==="_blank",className:"cursor-pointer rounded-md border border-border",onChange:()=>r({...s,target:u==="_blank"?"_self":"_blank"})}),e.jsxRuntimeExports.jsx("span",{className:"pt-1 text-xs",children:"Open in new tab"})]})]})]})};exports.IconPickerField=b;exports.ImagePickerField=v;exports.LinkField=w;exports.RichTextEditorField=y;
|
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
import { j as e } from "./jsx-runtime-
|
|
2
|
-
import o, { useState as m, Suspense as
|
|
3
|
-
import { HomeIcon as
|
|
4
|
-
import { P as g, a as h, b as f } from "./popover-
|
|
5
|
-
import {
|
|
1
|
+
import { j as e } from "./jsx-runtime-Sp0orL4X.js";
|
|
2
|
+
import o, { useState as m, Suspense as p } from "react";
|
|
3
|
+
import { HomeIcon as c, FileTextIcon as u, ChevronRightIcon as d, GearIcon as x } from "@radix-ui/react-icons";
|
|
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-cZ4uo6aT.js";
|
|
6
6
|
import "@radix-ui/react-popover";
|
|
7
|
-
import "./utils-
|
|
7
|
+
import "./utils-dze1SGvB.js";
|
|
8
8
|
import "clsx";
|
|
9
9
|
import "tailwind-merge";
|
|
10
|
-
import "./
|
|
10
|
+
import "./ChaiBuilderEditor-h9bXC4l-.js";
|
|
11
|
+
import "./MODIFIERS-DsEzQ3aH.js";
|
|
11
12
|
import "@radix-ui/react-scroll-area";
|
|
12
13
|
import "react-dom";
|
|
13
14
|
import "@floating-ui/react-dom";
|
|
@@ -18,29 +19,31 @@ import "flagged";
|
|
|
18
19
|
import "react-dnd";
|
|
19
20
|
import "lodash";
|
|
20
21
|
import "@minoru/react-dnd-treeview";
|
|
21
|
-
import "./
|
|
22
|
-
import "@radix-ui/react-alert-dialog";
|
|
22
|
+
import "./skeleton-CU_FIbg3.js";
|
|
23
23
|
import "@radix-ui/react-slot";
|
|
24
24
|
import "class-variance-authority";
|
|
25
25
|
import "@radix-ui/react-tooltip";
|
|
26
26
|
import "@radix-ui/react-toast";
|
|
27
27
|
import "react-hotkeys-hook";
|
|
28
28
|
import "flat-to-nested";
|
|
29
|
-
import "./
|
|
30
|
-
import "himalaya";
|
|
29
|
+
import "./functions-pcUZhFJM.js";
|
|
31
30
|
import "redux-undo";
|
|
32
31
|
import "@react-hookz/web";
|
|
33
32
|
import "@chaibuilder/blocks";
|
|
34
33
|
import "sonner";
|
|
34
|
+
import "./html-to-json-pdHQfRkN.js";
|
|
35
|
+
import "himalaya";
|
|
35
36
|
import "lucide-react";
|
|
36
|
-
|
|
37
|
-
|
|
37
|
+
import "./alert-dialog-GNfnpqFB.js";
|
|
38
|
+
import "@radix-ui/react-alert-dialog";
|
|
39
|
+
const P = o.lazy(() => import("./single-page-detail-iXpavDy8.js")), v = ({ pageData: r }) => {
|
|
40
|
+
const [t, s] = m("CLOSE");
|
|
38
41
|
return /* @__PURE__ */ e.jsxs(
|
|
39
42
|
g,
|
|
40
43
|
{
|
|
41
44
|
open: t === "OPEN" || t === "ALERT" || t === "PENDING",
|
|
42
45
|
onOpenChange: (i) => {
|
|
43
|
-
|
|
46
|
+
s(t === "PENDING" ? "ALERT" : i ? "OPEN" : "CLOSE");
|
|
44
47
|
},
|
|
45
48
|
children: [
|
|
46
49
|
/* @__PURE__ */ e.jsx(
|
|
@@ -48,28 +51,28 @@ const P = o.lazy(() => import("./single-page-detail-04410e64.js")), v = ({ pageD
|
|
|
48
51
|
{
|
|
49
52
|
asChild: !0,
|
|
50
53
|
onClick: (i) => {
|
|
51
|
-
i.stopPropagation(),
|
|
54
|
+
i.stopPropagation(), s("OPEN");
|
|
52
55
|
},
|
|
53
56
|
children: /* @__PURE__ */ e.jsx("div", { className: "flex items-center justify-between", children: t === "OPEN" || t === "ALERT" || t === "PENDING" ? /* @__PURE__ */ e.jsx(d, {}) : /* @__PURE__ */ e.jsx("div", { className: "hidden hover:text-blue-600 group-hover:flex", children: /* @__PURE__ */ e.jsx(x, {}) }) })
|
|
54
57
|
}
|
|
55
58
|
),
|
|
56
59
|
/* @__PURE__ */ e.jsx(f, { side: "right", align: "start", alignOffset: -35, className: "h-screen w-96", children: /* @__PURE__ */ e.jsx(
|
|
57
|
-
|
|
60
|
+
p,
|
|
58
61
|
{
|
|
59
62
|
fallback: /* @__PURE__ */ e.jsxs("div", { className: "flex w-full animate-pulse flex-col gap-y-3", children: [
|
|
60
63
|
/* @__PURE__ */ e.jsx("div", { className: "bg-background-300 h-6 w-1/2" }),
|
|
61
64
|
/* @__PURE__ */ e.jsx("div", { className: "bg-background-300 h-20 w-full" }),
|
|
62
65
|
/* @__PURE__ */ e.jsx("div", { className: "bg-background-300 h-20 w-full" })
|
|
63
66
|
] }),
|
|
64
|
-
children: /* @__PURE__ */ e.jsx(P, { pageData:
|
|
67
|
+
children: /* @__PURE__ */ e.jsx(P, { pageData: r, open: t, setOpen: s })
|
|
65
68
|
}
|
|
66
69
|
) })
|
|
67
70
|
]
|
|
68
71
|
}
|
|
69
72
|
);
|
|
70
|
-
}, E = (
|
|
71
|
-
const [t] = j(), { data:
|
|
72
|
-
return
|
|
73
|
+
}, E = (r) => {
|
|
74
|
+
const [t] = j(), { data: s } = N(), i = b(), a = (s == null ? void 0 : s.homepage) === r.uuid, n = t === r.uuid, l = () => i(r);
|
|
75
|
+
return s ? /* @__PURE__ */ e.jsxs(
|
|
73
76
|
"button",
|
|
74
77
|
{
|
|
75
78
|
className: `group relative flex w-full cursor-pointer items-center justify-between px-2.5 py-2 ${n ? "bg-blue-200 " : ""}`,
|
|
@@ -77,19 +80,19 @@ const P = o.lazy(() => import("./single-page-detail-04410e64.js")), v = ({ pageD
|
|
|
77
80
|
type: "button",
|
|
78
81
|
children: [
|
|
79
82
|
/* @__PURE__ */ e.jsxs("div", { className: "flex text-sm items-center gap-x-1.5", children: [
|
|
80
|
-
a ? /* @__PURE__ */ e.jsx(
|
|
83
|
+
a ? /* @__PURE__ */ e.jsx(c, {}) : /* @__PURE__ */ e.jsx(u, {}),
|
|
81
84
|
" ",
|
|
82
|
-
|
|
85
|
+
r.name
|
|
83
86
|
] }),
|
|
84
|
-
/* @__PURE__ */ e.jsx(v, { pageData:
|
|
87
|
+
/* @__PURE__ */ e.jsx(v, { pageData: r })
|
|
85
88
|
]
|
|
86
89
|
}
|
|
87
90
|
) : null;
|
|
88
|
-
},
|
|
91
|
+
}, le = ({ pages: r, isLoading: t }) => t ? /* @__PURE__ */ e.jsxs("div", { className: "flex animate-pulse flex-col gap-y-1 px-2.5 pt-2", children: [
|
|
89
92
|
/* @__PURE__ */ e.jsx("div", { className: "bg-background-200 h-7 w-full" }),
|
|
90
93
|
/* @__PURE__ */ e.jsx("div", { className: "bg-background-200 h-7 w-full" }),
|
|
91
94
|
/* @__PURE__ */ e.jsx("div", { className: "bg-background-200 h-7 w-full" })
|
|
92
|
-
] }) :
|
|
95
|
+
] }) : r.length === 0 ? /* @__PURE__ */ e.jsx("div", { className: "px-2.5 pb-2 pt-4", children: "No pages" }) : /* @__PURE__ */ e.jsx("div", { className: "-mb-2", children: o.Children.toArray(r.map((s) => /* @__PURE__ */ e.jsx(E, { ...s }))) });
|
|
93
96
|
export {
|
|
94
|
-
|
|
97
|
+
le as default
|
|
95
98
|
};
|
|
@@ -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-8L3zCc6V.cjs");require("@radix-ui/react-popover");require("./utils-qK_SjzzV.cjs");require("clsx");require("tailwind-merge");require("./ChaiBuilderEditor-SacH75l4.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("@chaibuilder/blocks");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-X0TGlsT4.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;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { j as t } from "./jsx-runtime-
|
|
1
|
+
import { j as t } from "./jsx-runtime-Sp0orL4X.js";
|
|
2
2
|
import * as i from "react";
|
|
3
3
|
import * as o from "@radix-ui/react-popover";
|
|
4
|
-
import { c as n } from "./utils-
|
|
4
|
+
import { c as n } from "./utils-dze1SGvB.js";
|
|
5
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
6
|
o.Content,
|
|
7
7
|
{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const n=require("./jsx-runtime-
|
|
1
|
+
"use strict";const n=require("./jsx-runtime-JYMCiFoE.cjs"),c=require("react"),p=require("@radix-ui/react-popover"),l=require("./utils-qK_SjzzV.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;
|
|
@@ -1,35 +1,35 @@
|
|
|
1
|
-
import { j as i } from "./jsx-runtime-
|
|
1
|
+
import { j as i } from "./jsx-runtime-Sp0orL4X.js";
|
|
2
2
|
import * as n from "react";
|
|
3
|
-
import { S as f } from "./scroll-area-
|
|
3
|
+
import { S as f } from "./scroll-area-ewXbxc3n.js";
|
|
4
4
|
import { SingleLineText as c, Image as d } from "@chaibuilder/blocks";
|
|
5
|
-
import { F as u } from "./form-
|
|
6
|
-
import {
|
|
5
|
+
import { F as u } from "./form-dVpOAyRl.js";
|
|
6
|
+
import { a as x } from "./index-cZ4uo6aT.js";
|
|
7
7
|
import "@radix-ui/react-scroll-area";
|
|
8
|
-
import "./utils-
|
|
8
|
+
import "./utils-dze1SGvB.js";
|
|
9
9
|
import "clsx";
|
|
10
10
|
import "tailwind-merge";
|
|
11
11
|
import "@rjsf/core";
|
|
12
12
|
import "@rjsf/validator-ajv8";
|
|
13
13
|
import "lodash";
|
|
14
|
-
import "./link-
|
|
14
|
+
import "./link-6o6n2Tnd.js";
|
|
15
15
|
import "react-icons-picker";
|
|
16
16
|
import "react-dom";
|
|
17
|
-
import "./dialog-
|
|
17
|
+
import "./dialog-jrw9DF1f.js";
|
|
18
18
|
import "@radix-ui/react-dialog";
|
|
19
19
|
import "@radix-ui/react-icons";
|
|
20
|
-
import "./ImagesPanel-
|
|
21
|
-
import "./tabs-
|
|
20
|
+
import "./ImagesPanel-oaHOD-Ex.js";
|
|
21
|
+
import "./tabs-Gb9v5dVb.js";
|
|
22
22
|
import "@radix-ui/react-tabs";
|
|
23
23
|
import "react-quill";
|
|
24
24
|
import "react-i18next";
|
|
25
|
-
import "./
|
|
26
|
-
import "
|
|
25
|
+
import "./skeleton-CU_FIbg3.js";
|
|
26
|
+
import "jotai";
|
|
27
27
|
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 "
|
|
32
|
-
import "./MODIFIERS-
|
|
31
|
+
import "./ChaiBuilderEditor-h9bXC4l-.js";
|
|
32
|
+
import "./MODIFIERS-DsEzQ3aH.js";
|
|
33
33
|
import "@floating-ui/react-dom";
|
|
34
34
|
import "i18next";
|
|
35
35
|
import "flagged";
|
|
@@ -37,13 +37,16 @@ import "react-dnd";
|
|
|
37
37
|
import "@minoru/react-dnd-treeview";
|
|
38
38
|
import "react-hotkeys-hook";
|
|
39
39
|
import "flat-to-nested";
|
|
40
|
-
import "./
|
|
41
|
-
import "himalaya";
|
|
40
|
+
import "./functions-pcUZhFJM.js";
|
|
42
41
|
import "redux-undo";
|
|
43
42
|
import "@react-hookz/web";
|
|
44
43
|
import "sonner";
|
|
44
|
+
import "./html-to-json-pdHQfRkN.js";
|
|
45
|
+
import "himalaya";
|
|
45
46
|
import "lucide-react";
|
|
46
|
-
|
|
47
|
+
import "./alert-dialog-GNfnpqFB.js";
|
|
48
|
+
import "@radix-ui/react-alert-dialog";
|
|
49
|
+
const lo = ({
|
|
47
50
|
_projectData: m,
|
|
48
51
|
seany: t
|
|
49
52
|
}) => {
|
|
@@ -66,5 +69,5 @@ const eo = ({
|
|
|
66
69
|
return /* @__PURE__ */ i.jsx(f, { className: "flex h-full select-none flex-col", children: /* @__PURE__ */ i.jsx(u, { properties: a, disabled: p, formData: m, onChange: e }) });
|
|
67
70
|
};
|
|
68
71
|
export {
|
|
69
|
-
|
|
72
|
+
lo as default
|
|
70
73
|
};
|
|
@@ -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"),n=require("@chaibuilder/blocks"),d=require("./form-nRAvKPQj.cjs"),m=require("./index-8L3zCc6V.cjs");require("@radix-ui/react-scroll-area");require("./utils-qK_SjzzV.cjs");require("clsx");require("tailwind-merge");require("@rjsf/core");require("@rjsf/validator-ajv8");require("lodash");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-SacH75l4.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("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 g(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 j=g(a),b=({_projectData:r,seany:i})=>{const{data:e,isLoading:u}=m.useProject();j.useEffect(()=>{e&&i(e)},[e,i]);const o=({formData:s},t)=>{i(l=>({...l,[t]:s[t]}))},c={name:n.SingleLineText({title:"Project Name",default:e==null?void 0:e.name}),favicon:n.Image({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:o})})};exports.default=b;
|
|
@@ -1,32 +1,31 @@
|
|
|
1
|
-
import { j as p } from "./jsx-runtime-
|
|
1
|
+
import { j as p } from "./jsx-runtime-Sp0orL4X.js";
|
|
2
2
|
import { Model as D, SingleLineText as c, MultilineText as g, Image as x } from "@chaibuilder/blocks";
|
|
3
|
-
import { F as v } from "./form-
|
|
3
|
+
import { F as v } from "./form-dVpOAyRl.js";
|
|
4
4
|
import "react";
|
|
5
5
|
import "@rjsf/core";
|
|
6
6
|
import "@rjsf/validator-ajv8";
|
|
7
7
|
import "lodash";
|
|
8
|
-
import "./link-
|
|
8
|
+
import "./link-6o6n2Tnd.js";
|
|
9
9
|
import "react-icons-picker";
|
|
10
10
|
import "react-dom";
|
|
11
|
-
import "./dialog-
|
|
11
|
+
import "./dialog-jrw9DF1f.js";
|
|
12
12
|
import "@radix-ui/react-dialog";
|
|
13
13
|
import "@radix-ui/react-icons";
|
|
14
|
-
import "./utils-
|
|
14
|
+
import "./utils-dze1SGvB.js";
|
|
15
15
|
import "clsx";
|
|
16
16
|
import "tailwind-merge";
|
|
17
|
-
import "./ImagesPanel-
|
|
18
|
-
import "./tabs-
|
|
17
|
+
import "./ImagesPanel-oaHOD-Ex.js";
|
|
18
|
+
import "./tabs-Gb9v5dVb.js";
|
|
19
19
|
import "@radix-ui/react-tabs";
|
|
20
20
|
import "react-quill";
|
|
21
21
|
import "react-i18next";
|
|
22
|
-
import "./
|
|
23
|
-
import "
|
|
22
|
+
import "./skeleton-CU_FIbg3.js";
|
|
23
|
+
import "jotai";
|
|
24
24
|
import "@radix-ui/react-slot";
|
|
25
25
|
import "class-variance-authority";
|
|
26
26
|
import "@radix-ui/react-tooltip";
|
|
27
27
|
import "@radix-ui/react-toast";
|
|
28
|
-
|
|
29
|
-
const W = ({
|
|
28
|
+
const V = ({
|
|
30
29
|
_projectData: t,
|
|
31
30
|
seany: l
|
|
32
31
|
}) => {
|
|
@@ -64,5 +63,5 @@ const W = ({
|
|
|
64
63
|
return /* @__PURE__ */ p.jsx("div", { className: "flex h-full select-none flex-col", children: /* @__PURE__ */ p.jsx(v, { properties: d, formData: t, onChange: n }) });
|
|
65
64
|
};
|
|
66
65
|
export {
|
|
67
|
-
|
|
66
|
+
V as default
|
|
68
67
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("./jsx-runtime-JYMCiFoE.cjs"),r=require("@chaibuilder/blocks"),g=require("./form-nRAvKPQj.cjs");require("react");require("@rjsf/core");require("@rjsf/validator-ajv8");require("lodash");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:c})=>{const i={...c};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(f=>({...f,...i}))},m={seoData:r.Model({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.SingleLineText({title:"Default Title",default:((s=e.seoData)==null?void 0:s.title)||""}),description:r.MultilineText({title:"Default Description",default:((a=e.seoData)==null?void 0:a.description)||""}),image:r.Image({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:m,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-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("./jsx-runtime-JYMCiFoE.cjs"),j=require("react"),n=require("lodash"),R=require("tailwind-merge"),l=require("./MODIFIERS-Fx6WAZcw.cjs"),_=require("@chaibuilder/blocks"),x=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=t=>{const r={};return Object.keys(t).forEach(e=>{n.isString(t[e])&&t[e].startsWith(l.SLOT_KEY)&&(r[e]=t[e].replace(l.SLOT_KEY,"").split(","))}),r},B=n.memoize((t,r)=>{const e=t.replace(l.STYLES_KEY,"").split(","),s=R.twMerge(e[0],e[1]);return x.addPrefixToClasses(s,r).replace(l.STYLES_KEY,"").trim()});function C(t,r){return n.get(t,`${r}_attrs`,{})}function O(t,r){const e={};return Object.keys(t).forEach(s=>{if(n.isString(t[s])&&t[s].startsWith(l.STYLES_KEY)){const o=B(t[s],r);e[s]={className:o,...C(t,s)}}}),e}function T(t,r){const e=n.get(t,"_bindings",{});return n.isEmpty(e)?{...t}:(n.each(e,(s,o)=>{n.isString(s)&&n.get(r,s,null)&&(t[o]=n.get(r,s,null))}),t)}function a({blocks:t,parent:r,classPrefix:e="c-",externalData:s={}}){const o=t,p=i=>O(i,e),f=r?n.filter(t,{_parent:r}):n.filter(t,i=>n.isEmpty(i._parent));return c.jsxRuntimeExports.jsx(c.jsxRuntimeExports.Fragment,{children:j.Children.toArray(f.map((i,h)=>{const d=y(i),m={};n.isEmpty(d)||Object.keys(d).forEach(u=>{m[u]=j.Children.toArray(d[u].map(E=>c.jsxRuntimeExports.jsx(a,{externalData:s,classPrefix:e,blocks:o,parent:E})))});const S=n.filter(o,{_parent:i._id});m.children=S.length>0?c.jsxRuntimeExports.jsx(a,{externalData:s,classPrefix:e,parent:i._id,blocks:o}):null;const g=_.getBlockComponent(i._type);if(g!==null){let u=i;const E=g.component;return u={...g.defaults,...i},j.createElement(E,n.omit({blockProps:{},inBuilder:!1,...u,index:h,...T(i,s),...p(u),...m},["_parent"]))}return c.jsxRuntimeExports.jsxs("noscript",{children:[i._type," not found"]})}))})}const Y=({pageData:t,externalData:r={},before:e=null,after:s=null,classPrefix:o="c-"})=>{const p=n.get(t.project,"brandingOptions",l.BRANDING_OPTIONS_DEFAULTS);return c.jsxRuntimeExports.jsxs(c.jsxRuntimeExports.Fragment,{children:[e,c.jsxRuntimeExports.jsx("div",{className:o.replace("-","")+" "+x.getBrandingClasses(p,o)+" min-h-screen",children:c.jsxRuntimeExports.jsx(q.Provider,{children:c.jsxRuntimeExports.jsx(a,{externalData:r,blocks:t.page.blocks||[],classPrefix:o})})}),s]})};exports.RenderChaiBlocks=a;exports.RenderChaiPage=Y;
|
package/dist/render.d.ts
CHANGED
|
@@ -14,8 +14,8 @@ export declare type ChaiPageData = {
|
|
|
14
14
|
blocks: ChaiBlock[];
|
|
15
15
|
seoData?: Record<string, string>;
|
|
16
16
|
slug?: string;
|
|
17
|
-
name
|
|
18
|
-
providers
|
|
17
|
+
name?: string;
|
|
18
|
+
providers?: {
|
|
19
19
|
providerKey: string;
|
|
20
20
|
args: Record<string, any>;
|
|
21
21
|
}[];
|
|
@@ -29,13 +29,13 @@ export declare type ChaiPageData = {
|
|
|
29
29
|
}[];
|
|
30
30
|
}[];
|
|
31
31
|
project: {
|
|
32
|
-
name
|
|
33
|
-
favicon
|
|
32
|
+
name?: string;
|
|
33
|
+
favicon?: string;
|
|
34
34
|
brandingOptions: Record<string, string | number>;
|
|
35
35
|
seoData?: Record<string, string>;
|
|
36
|
-
primaryLanguage
|
|
37
|
-
languages
|
|
38
|
-
homepage
|
|
36
|
+
primaryLanguage?: string;
|
|
37
|
+
languages?: string[];
|
|
38
|
+
homepage?: string;
|
|
39
39
|
};
|
|
40
40
|
};
|
|
41
41
|
|
package/dist/render.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { j as o } from "./jsx-runtime-
|
|
1
|
+
import { j as o } from "./jsx-runtime-Sp0orL4X.js";
|
|
2
2
|
import u from "react";
|
|
3
3
|
import { memoize as y, filter as g, isEmpty as h, omit as A, isString as E, get as m, each as x } from "lodash";
|
|
4
4
|
import { twMerge as N } from "tailwind-merge";
|
|
5
|
-
import { S as _, a as B, B as R } from "./MODIFIERS-
|
|
5
|
+
import { S as _, a as B, B as R } from "./MODIFIERS-DsEzQ3aH.js";
|
|
6
6
|
import { getBlockComponent as T } from "@chaibuilder/blocks";
|
|
7
|
-
import { a as F, g as L } from "./functions-
|
|
7
|
+
import { a as F, g as L } from "./functions-nNTuSTsR.js";
|
|
8
8
|
import { Provider as Y } from "react-wrap-balancer";
|
|
9
9
|
import "@mhsdesign/jit-browser-tailwindcss";
|
|
10
10
|
import "@bobthered/tailwindcss-palette-generator";
|