@chaibuilder/sdk 1.0.21 → 1.0.23
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 +30 -103
- package/dist/{AddBlocks-0-e393Fn.js → AddBlocks-Izn_rxXD.js} +5 -4
- package/dist/AddBlocks-RHuwwfe5.cjs +3 -0
- package/dist/{BrandingOptions-HtNCJO9_.cjs → BrandingOptions-Fyo8qs4o.cjs} +1 -1
- package/dist/{BrandingOptions-QqqJ-YRb.js → BrandingOptions-orZyDGiL.js} +1 -1
- package/dist/{CanvasArea-0hMAhzxn.js → CanvasArea-C30uJLef.js} +72 -71
- package/dist/{CanvasArea-pZz5czrV.cjs → CanvasArea-IM2K8bud.cjs} +2 -2
- package/dist/{CurrentPage-UOkxZISs.js → CurrentPage-70sBzc2_.js} +6 -5
- package/dist/CurrentPage-lIithDJy.cjs +1 -0
- package/dist/{Layers-TB-Lriju.js → Layers-W0N2zfnf.js} +7 -6
- package/dist/Layers-YMtavzUG.cjs +1 -0
- package/dist/{MarkAsGlobalBlock-5h3wP4zj.cjs → MarkAsGlobalBlock-EOsABFjY.cjs} +1 -1
- package/dist/{MarkAsGlobalBlock-Pa8po8qP.js → MarkAsGlobalBlock-FPCQmRIh.js} +1 -1
- package/dist/{PagesPanel-mAMSbYPt.js → PagesPanel-RbHN6lvQ.js} +6 -5
- package/dist/{PagesPanel-ffrNyFyp.cjs → PagesPanel-i-MQEmm_.cjs} +1 -1
- package/dist/ProjectPanel-0BGx-hP-.cjs +1 -0
- package/dist/{ProjectPanel-XvsYajju.js → ProjectPanel-CzwuyR0N.js} +7 -6
- package/dist/{Settings-8AbHXcDP.js → Settings-lxTrbI-C.js} +330 -320
- package/dist/Settings-mTWkKG82.cjs +1 -0
- package/dist/{SidePanels-LQg3mdC4.js → SidePanels-g4M6oTs-.js} +7 -6
- package/dist/SidePanels-pUOJTYfr.cjs +1 -0
- package/dist/{Topbar-wA6jhMj9.js → Topbar-KqZt4TEY.js} +1 -1
- package/dist/{Topbar-A3WZDrK4.cjs → Topbar-kHffytzr.cjs} +1 -1
- package/dist/{UnsplashImages-mzIO1QeT.js → UnsplashImages-Ua7ksJ8c.js} +1 -1
- package/dist/{UnsplashImages-E8zPMgJf.cjs → UnsplashImages-y7I_7_W7.cjs} +1 -1
- package/dist/{UploadImages-qEuDUEMn.cjs → UploadImages-RzEm0Stb.cjs} +1 -1
- package/dist/{UploadImages-qMeaY4sk.js → UploadImages-YP_J6erG.js} +1 -1
- package/dist/{add-page-modal-oER3yE4F.js → add-page-modal-btGWaXyq.js} +18 -18
- package/dist/add-page-modal-ekFis5D8.cjs +1 -0
- package/dist/{confirm-alert-rDSai_jQ.js → confirm-alert-Py2WqZhJ.js} +1 -1
- package/dist/{confirm-alert-tH8UCCSF.cjs → confirm-alert-mAhT8vln.cjs} +1 -1
- package/dist/core.cjs +1 -1
- package/dist/core.js +56 -55
- package/dist/{delete-page-modal-ShTRkqkB.cjs → delete-page-modal-QzleoJG2.cjs} +1 -1
- package/dist/{delete-page-modal-QzQdrLYI.js → delete-page-modal-Rq4ThQpu.js} +6 -5
- package/dist/{form-vWeEsG9Y.js → form-Lm3bupAq.js} +1 -1
- package/dist/{form-MlgUSEy_.cjs → form-kAjrBaV-.cjs} +1 -1
- package/dist/{functions-hmbWDcnW.js → functions-JFP-oMsY.js} +28 -27
- package/dist/{functions-eu6BbvqO.cjs → functions-KMQYiBHf.cjs} +2 -2
- package/dist/{index-G55KtqnU.js → index-Vx4ctSV6.js} +10 -20
- package/dist/{index-T5MFAHA0.cjs → index-W5drgyWI.cjs} +1 -1
- package/dist/{index-mLIwGF5W.js → index-WPlT_Q87.js} +3 -3
- package/dist/{index-pCHSFoQO.cjs → index-fvoD_laH.cjs} +2 -2
- package/dist/lib.cjs +1 -1
- package/dist/lib.d.ts +3 -9
- package/dist/lib.js +93 -152
- package/dist/page-viewer-AlOCzh1b.cjs +1 -0
- package/dist/{page-viewer-X3IEOrUC.js → page-viewer-_wGsV2_o.js} +29 -28
- package/dist/{project-general-setting-oujmeWOG.js → project-general-setting-B8uuHccU.js} +7 -6
- package/dist/{project-general-setting-HZeYf9A1.cjs → project-general-setting-XnNyOpXO.cjs} +1 -1
- package/dist/{project-seo-setting-3FZQXaTn.cjs → project-seo-setting-QJBATF59.cjs} +1 -1
- package/dist/{project-seo-setting-_X6ckVa4.js → project-seo-setting-Zg2Z-Frr.js} +2 -2
- package/dist/render.cjs +1 -1
- package/dist/render.js +1 -1
- package/dist/{single-page-detail-SxboE7TI.js → single-page-detail-HXpxgQnU.js} +8 -7
- package/dist/single-page-detail-MWh30E_-.cjs +1 -0
- package/dist/studio.cjs +1 -1
- package/dist/studio.js +5 -4
- package/dist/tailwind-config-OxLD7oFU.cjs +1 -0
- package/dist/tailwind-config-d1VL1lzE.js +62 -0
- package/dist/tailwind.cjs +1 -0
- package/dist/tailwind.d.ts +80 -0
- package/dist/tailwind.js +24 -0
- package/dist/ui.cjs +1 -1
- package/dist/ui.d.ts +1 -1
- package/dist/ui.js +1 -1
- package/package.json +9 -4
- package/dist/AddBlocks-p68Cz79o.cjs +0 -3
- package/dist/CurrentPage-phMDH1Ub.cjs +0 -1
- package/dist/Layers-NKZXi2LV.cjs +0 -1
- package/dist/ProjectPanel-1ywILLme.cjs +0 -1
- package/dist/Settings-hdmnT_mI.cjs +0 -1
- package/dist/SidePanels-xaNrI3oK.cjs +0 -1
- package/dist/add-page-modal-9deiA1W9.cjs +0 -1
- package/dist/page-viewer-GPNN1H92.cjs +0 -1
- package/dist/single-page-detail-ILshOKys.cjs +0 -1
|
@@ -2,11 +2,11 @@ import { j as s } from "./jsx-runtime-NV737rRe.js";
|
|
|
2
2
|
import I, { useState as j, useEffect as z } from "react";
|
|
3
3
|
import { isString as L, isEmpty as x, isEqual as C, omit as y, kebabCase as B } from "lodash";
|
|
4
4
|
import { HomeIcon as G } from "@radix-ui/react-icons";
|
|
5
|
-
import { bp as Y, B as q } from "./index-
|
|
5
|
+
import { bp as Y, B as q } from "./index-Vx4ctSV6.js";
|
|
6
6
|
import { u as g, b as Z, g as $, o as F, r as Q } from "./controls-G0puEH71.js";
|
|
7
7
|
import { toast as U } from "sonner";
|
|
8
|
-
import { F as h } from "./form-
|
|
9
|
-
import { h as V, b as X, i as _, c as K } from "./index-
|
|
8
|
+
import { F as h } from "./form-Lm3bupAq.js";
|
|
9
|
+
import { h as V, b as X, i as _, c as K } from "./index-WPlT_Q87.js";
|
|
10
10
|
import "./MODIFIERS-MLfpKQY1.js";
|
|
11
11
|
import "@radix-ui/react-toggle";
|
|
12
12
|
import "class-variance-authority";
|
|
@@ -50,16 +50,17 @@ import "react-dnd";
|
|
|
50
50
|
import "@minoru/react-dnd-treeview";
|
|
51
51
|
import "./lib.js";
|
|
52
52
|
import "himalaya";
|
|
53
|
-
import "./functions-
|
|
53
|
+
import "./functions-JFP-oMsY.js";
|
|
54
54
|
import "@mhsdesign/jit-browser-tailwindcss";
|
|
55
55
|
import "@bobthered/tailwindcss-palette-generator";
|
|
56
56
|
import "@tailwindcss/forms";
|
|
57
57
|
import "@tailwindcss/typography";
|
|
58
58
|
import "@tailwindcss/aspect-ratio";
|
|
59
59
|
import "@tailwindcss/line-clamp";
|
|
60
|
+
import "./tailwind-config-d1VL1lzE.js";
|
|
60
61
|
import "react-hotkeys-hook";
|
|
61
62
|
import "lucide-react";
|
|
62
|
-
const O = I.lazy(() => import("./delete-page-modal-
|
|
63
|
+
const O = I.lazy(() => import("./delete-page-modal-Rq4ThQpu.js")), J = I.lazy(() => import("./confirm-alert-Py2WqZhJ.js")), P = (r) => {
|
|
63
64
|
if (!L(r) || !(r.includes("/[") && r.includes("]")))
|
|
64
65
|
return !1;
|
|
65
66
|
const t = /^\[((?:\.{3})?[a-zA-Z0-9_-]+)\]$/, p = /^[a-zA-Z0-9_-]+$/;
|
|
@@ -73,7 +74,7 @@ const O = I.lazy(() => import("./delete-page-modal-QzQdrLYI.js")), J = I.lazy(()
|
|
|
73
74
|
} : r, W = (r, n) => {
|
|
74
75
|
const t = !C(y(r, ["seoData"]), y(n, ["seoData"])), p = !C(f(n).seoData, f(r).seoData);
|
|
75
76
|
return t || p;
|
|
76
|
-
},
|
|
77
|
+
}, mi = ({ open: r, setOpen: n, pageData: t }) => {
|
|
77
78
|
const p = V(), { data: e } = X(), m = _(), c = K("Homepage updated successfully."), [i, T] = j(f(t)), [d, v] = j({
|
|
78
79
|
isHomePage: (e == null ? void 0 : e.homepage) === t.uuid
|
|
79
80
|
}), N = W(i, t);
|
|
@@ -221,5 +222,5 @@ const O = I.lazy(() => import("./delete-page-modal-QzQdrLYI.js")), J = I.lazy(()
|
|
|
221
222
|
] });
|
|
222
223
|
};
|
|
223
224
|
export {
|
|
224
|
-
|
|
225
|
+
mi as default
|
|
225
226
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./jsx-runtime-WUGKV8jN.cjs"),f=require("react"),c=require("lodash"),H=require("@radix-ui/react-icons"),y=require("./index-W5drgyWI.cjs"),d=require("./controls-aHZq-q4b.cjs"),w=require("sonner"),p=require("./form-kAjrBaV-.cjs"),P=require("./index-fvoD_laH.cjs");require("./MODIFIERS-WFzDQfiT.cjs");require("@radix-ui/react-toggle");require("class-variance-authority");require("./utils-It2K33fU.cjs");require("clsx");require("tailwind-merge");require("@radix-ui/react-switch");require("@radix-ui/react-slot");require("@radix-ui/react-accordion");require("@radix-ui/react-alert-dialog");require("@radix-ui/react-dialog");require("@radix-ui/react-label");require("@radix-ui/react-scroll-area");require("@radix-ui/react-tabs");require("@radix-ui/react-tooltip");require("@radix-ui/react-popover");require("@radix-ui/react-menubar");require("@radix-ui/react-hover-card");require("@radix-ui/react-select");require("@radix-ui/react-dropdown-menu");require("@radix-ui/react-separator");require("@radix-ui/react-toast");require("cmdk");require("@radix-ui/react-context-menu");require("react-icons-picker");require("react-dom");require("react-quill");require("jotai");require("flat-to-nested");require("redux-undo");require("@chaibuilder/runtime");require("@react-hookz/web");require("react-i18next");require("@rjsf/core");require("@rjsf/validator-ajv8");require("i18next");require("@floating-ui/react-dom");require("react-textarea-autosize");require("flagged");require("react-dnd");require("@minoru/react-dnd-treeview");require("./lib.cjs");require("himalaya");require("./functions-KMQYiBHf.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");require("./tailwind-config-OxLD7oFU.cjs");require("react-hotkeys-hook");require("lucide-react");const z=f.lazy(()=>Promise.resolve().then(()=>require("./delete-page-modal-QzleoJG2.cjs"))),L=f.lazy(()=>Promise.resolve().then(()=>require("./confirm-alert-mAhT8vln.cjs"))),E=u=>{if(!c.isString(u)||!(u.includes("/[")&&u.includes("]")))return!1;const s=/^\[((?:\.{3})?[a-zA-Z0-9_-]+)\]$/,q=/^[a-zA-Z0-9_-]+$/;let e=!0;return u.split("/").forEach(n=>{e&&(n.includes("[[")&&n.includes("]]")?e=/^\[\[\.{3}[a-zA-Z0-9_-]+\]\]$/.test(n):n.includes("[")&&n.includes("]")?e=s.test(n):e=q.test(n))}),e},h=u=>u&&c.isEmpty(u.seoData)?{...u,seoData:{title:"",description:"",image:""}}:u,G=(u,o)=>{const s=!c.isEqual(c.omit(u,["seoData"]),c.omit(o,["seoData"])),q=!c.isEqual(h(o).seoData,h(u).seoData);return s||q},Y=({open:u,setOpen:o,pageData:s})=>{const q=P.useQueryClient(),{data:e}=P.useProject(),n=P.useUpdatePage(),m=P.useUpdateProject("Homepage updated successfully."),[i,b]=f.useState(h(s)),[a,A]=f.useState({isHomePage:(e==null?void 0:e.homepage)===s.uuid}),j=G(i,s);f.useEffect(()=>{const l=!c.isEqual(h(s),i),t=(e==null?void 0:e.homepage)!==s.uuid&&a.isHomePage;o(l||t?"PENDING":"OPEN")},[e,s,i,a,o]);const C=()=>{if(j){if(s.type==="DYNAMIC"&&!E((i==null?void 0:i.slug)||"")){u==="ALERT"&&o("PENDING");return}n.mutate(i,{onSuccess:()=>{q.invalidateQueries({refetchType:"active",queryKey:["pages",e==null?void 0:e.uuid]}),o("CLOSE"),w.toast.success("Page updated successfully.")}})}a.isHomePage&&(e==null?void 0:e.homepage)!==s.uuid&&m.mutate({...e,homepage:s==null?void 0:s.uuid},{onSuccess:()=>o("CLOSE")})},R=({formData:l},t)=>{b(g=>{var S,N;if(!t)return g;const x={[t]:l[t]};return t==="name"?x.slug=c.kebabCase((S=l[t])==null?void 0:S.replace(/\d/g,"")):t==="slug"?x.slug=(N=l[t])==null?void 0:N.replace(/\d/g,"").replace(/\s+/g,"").replace("--","-").replace("__","_"):t==="seoData"&&(x.seoData={title:l[t].title||"",description:l[t].description||"",image:l[t].image||""}),{...g,...x}})},I=({formData:l},t)=>{A(g=>{const x={[t]:l[t]};return{...g,...x}})},v={name:d.u({title:"Page Name",default:i.name}),slug:d.u({title:"Page Slug",default:i.slug})},T={seoData:d.b({title:"",description:"",default:{title:"",description:"",image:""},properties:{title:d.u({title:"Meta Title",default:i.name}),description:d.g({title:"Meta Description",default:i.slug}),image:d.o({title:"Social Media Image",default:""})}})},M={isHomePage:d.r({title:"Set as homepage",default:a.isHomePage})};return r.jsxRuntimeExports.jsxs(y.ScrollArea,{className:"flex h-full select-none flex-col",children:[r.jsxRuntimeExports.jsx(L,{open:u==="ALERT",title:"Do yo want to save changes?",onCancel:()=>o("CLOSE"),onConfirm:C,disabled:m.isPending||n.isPending}),r.jsxRuntimeExports.jsx("div",{className:"rounded-md bg-background/30 px-2.5 py-1",children:r.jsxRuntimeExports.jsx("h1",{className:"px-1 font-semibold",children:"Page Details"})}),r.jsxRuntimeExports.jsx("div",{className:"px-2.5 pt-2",children:r.jsxRuntimeExports.jsxs("div",{className:"flex flex-col space-y-2",children:[r.jsxRuntimeExports.jsx(p.Form,{title:"Basic Details",formData:i,properties:v,onChange:R,disabled:n.isPending||m.isPending}),r.jsxRuntimeExports.jsx("div",{className:"h-2 w-full"}),r.jsxRuntimeExports.jsx(p.Form,{title:"SEO Details",formData:i,properties:T,onChange:R,disabled:n.isPending||m.isPending}),(e==null?void 0:e.homepage)!==s.uuid&&s.type==="STATIC"?r.jsxRuntimeExports.jsx(p.Form,{formData:a,properties:M,onChange:I,disabled:n.isPending||m.isPending}):s.type==="STATIC"&&r.jsxRuntimeExports.jsxs("div",{className:"flex items-center gap-x-1 px-1 pt-2 text-xs font-medium text-gray-500",children:[r.jsxRuntimeExports.jsx(H.HomeIcon,{})," This is homepage"," "]}),i.type==="DYNAMIC"&&!E((i==null?void 0:i.slug)||"")&&r.jsxRuntimeExports.jsxs("small",{className:"px-1 text-red-400",children:["Add dynamic ID in page slug Eg: ",r.jsxRuntimeExports.jsx("i",{className:"underline",children:"some-url/[some-id]"})]}),r.jsxRuntimeExports.jsxs("div",{className:"my-2 flex w-full items-center justify-between gap-x-2 px-1",children:[r.jsxRuntimeExports.jsx(y.Button,{className:"w-full",type:"submit",onClick:C,disabled:(e==null?void 0:e.homepage)!==s.uuid&&a.isHomePage?!1:c.isEmpty(i.name)||c.isEmpty(i.slug)||!j||n.isPending||m.isPending||i.type==="DYNAMIC"&&!E((i==null?void 0:i.slug)||""),children:"Save"}),r.jsxRuntimeExports.jsx(z,{pageData:s,projectData:e})]})]})})]})};exports.default=Y;
|
package/dist/studio.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("./jsx-runtime-WUGKV8jN.cjs");const e=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("./jsx-runtime-WUGKV8jN.cjs");const e=require("./index-fvoD_laH.cjs");require("react");require("sonner");require("./MODIFIERS-WFzDQfiT.cjs");require("i18next");require("react-i18next");require("./index-W5drgyWI.cjs");require("@radix-ui/react-toggle");require("class-variance-authority");require("./utils-It2K33fU.cjs");require("lodash");require("clsx");require("tailwind-merge");require("@radix-ui/react-switch");require("@radix-ui/react-slot");require("@radix-ui/react-accordion");require("@radix-ui/react-icons");require("@radix-ui/react-alert-dialog");require("@radix-ui/react-dialog");require("@radix-ui/react-label");require("@radix-ui/react-scroll-area");require("@radix-ui/react-tabs");require("@radix-ui/react-tooltip");require("@radix-ui/react-popover");require("@radix-ui/react-menubar");require("@radix-ui/react-hover-card");require("@radix-ui/react-select");require("@radix-ui/react-dropdown-menu");require("@radix-ui/react-separator");require("@radix-ui/react-toast");require("cmdk");require("@radix-ui/react-context-menu");require("react-icons-picker");require("react-dom");require("react-quill");require("jotai");require("flat-to-nested");require("redux-undo");require("@chaibuilder/runtime");require("@react-hookz/web");require("@floating-ui/react-dom");require("react-textarea-autosize");require("flagged");require("react-dnd");require("@minoru/react-dnd-treeview");require("./lib.cjs");require("himalaya");require("./functions-KMQYiBHf.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");require("./tailwind-config-OxLD7oFU.cjs");require("react-hotkeys-hook");require("lucide-react");exports.ChaiBuilderStudio=e.ChaiBuilderStudio;
|
package/dist/studio.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import "./jsx-runtime-NV737rRe.js";
|
|
2
|
-
import { C as
|
|
2
|
+
import { C as pi } from "./index-WPlT_Q87.js";
|
|
3
3
|
import "react";
|
|
4
4
|
import "sonner";
|
|
5
5
|
import "./MODIFIERS-MLfpKQY1.js";
|
|
6
6
|
import "i18next";
|
|
7
7
|
import "react-i18next";
|
|
8
|
-
import "./index-
|
|
8
|
+
import "./index-Vx4ctSV6.js";
|
|
9
9
|
import "@radix-ui/react-toggle";
|
|
10
10
|
import "class-variance-authority";
|
|
11
11
|
import "./utils-PPBbw5bk.js";
|
|
@@ -46,15 +46,16 @@ import "react-dnd";
|
|
|
46
46
|
import "@minoru/react-dnd-treeview";
|
|
47
47
|
import "./lib.js";
|
|
48
48
|
import "himalaya";
|
|
49
|
-
import "./functions-
|
|
49
|
+
import "./functions-JFP-oMsY.js";
|
|
50
50
|
import "@mhsdesign/jit-browser-tailwindcss";
|
|
51
51
|
import "@bobthered/tailwindcss-palette-generator";
|
|
52
52
|
import "@tailwindcss/forms";
|
|
53
53
|
import "@tailwindcss/typography";
|
|
54
54
|
import "@tailwindcss/aspect-ratio";
|
|
55
55
|
import "@tailwindcss/line-clamp";
|
|
56
|
+
import "./tailwind-config-d1VL1lzE.js";
|
|
56
57
|
import "react-hotkeys-hook";
|
|
57
58
|
import "lucide-react";
|
|
58
59
|
export {
|
|
59
|
-
|
|
60
|
+
pi as ChaiBuilderStudio
|
|
60
61
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";function o(r={}){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"},...r}}exports.chaiBuilderTheme=o;
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
function o(r = {}) {
|
|
2
|
+
return {
|
|
3
|
+
colors: {
|
|
4
|
+
border: "hsl(var(--border))",
|
|
5
|
+
input: "hsl(var(--input))",
|
|
6
|
+
ring: "hsl(var(--ring))",
|
|
7
|
+
background: "hsl(var(--background))",
|
|
8
|
+
foreground: "hsl(var(--foreground))",
|
|
9
|
+
primary: {
|
|
10
|
+
DEFAULT: "hsl(var(--primary))",
|
|
11
|
+
foreground: "hsl(var(--primary-foreground))"
|
|
12
|
+
},
|
|
13
|
+
secondary: {
|
|
14
|
+
DEFAULT: "hsl(var(--secondary))",
|
|
15
|
+
foreground: "hsl(var(--secondary-foreground))"
|
|
16
|
+
},
|
|
17
|
+
destructive: {
|
|
18
|
+
DEFAULT: "hsl(var(--destructive))",
|
|
19
|
+
foreground: "hsl(var(--destructive-foreground))"
|
|
20
|
+
},
|
|
21
|
+
muted: {
|
|
22
|
+
DEFAULT: "hsl(var(--muted))",
|
|
23
|
+
foreground: "hsl(var(--muted-foreground))"
|
|
24
|
+
},
|
|
25
|
+
accent: {
|
|
26
|
+
DEFAULT: "hsl(var(--accent))",
|
|
27
|
+
foreground: "hsl(var(--accent-foreground))"
|
|
28
|
+
},
|
|
29
|
+
popover: {
|
|
30
|
+
DEFAULT: "hsl(var(--popover))",
|
|
31
|
+
foreground: "hsl(var(--popover-foreground))"
|
|
32
|
+
},
|
|
33
|
+
card: {
|
|
34
|
+
DEFAULT: "hsl(var(--card))",
|
|
35
|
+
foreground: "hsl(var(--card-foreground))"
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
borderRadius: {
|
|
39
|
+
lg: "var(--radius)",
|
|
40
|
+
md: "calc(var(--radius) - 2px)",
|
|
41
|
+
sm: "calc(var(--radius) - 4px)"
|
|
42
|
+
},
|
|
43
|
+
keyframes: {
|
|
44
|
+
"accordion-down": {
|
|
45
|
+
from: { height: "0" },
|
|
46
|
+
to: { height: "var(--radix-accordion-content-height)" }
|
|
47
|
+
},
|
|
48
|
+
"accordion-up": {
|
|
49
|
+
from: { height: "var(--radix-accordion-content-height)" },
|
|
50
|
+
to: { height: "0" }
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
animation: {
|
|
54
|
+
"accordion-down": "accordion-down 0.2s ease-out",
|
|
55
|
+
"accordion-up": "accordion-up 0.2s ease-out"
|
|
56
|
+
},
|
|
57
|
+
...r
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
export {
|
|
61
|
+
o as c
|
|
62
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("tailwindcss-animate"),n=require("./tailwind-config-OxLD7oFU.cjs"),d=e=>({darkMode:"class",content:[...e,"node_modules/@chaibuilder/sdk/dist/*.{js,cjs}","node_modules/@chaibuilder/runtime/dist/*.{js,cjs}"],theme:{container:{center:!0,padding:"2rem",screens:{"2xl":"1400px"}},extend:n.chaiBuilderTheme()},plugins:[i]});exports.chaiBuilderTailwindConfig=d;
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
export declare const chaiBuilderTailwindConfig: (content: string[]) => {
|
|
2
|
+
darkMode: string;
|
|
3
|
+
content: string[];
|
|
4
|
+
theme: {
|
|
5
|
+
container: {
|
|
6
|
+
center: boolean;
|
|
7
|
+
padding: string;
|
|
8
|
+
screens: {
|
|
9
|
+
"2xl": string;
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
extend: {
|
|
13
|
+
colors: {
|
|
14
|
+
border: string;
|
|
15
|
+
input: string;
|
|
16
|
+
ring: string;
|
|
17
|
+
background: string;
|
|
18
|
+
foreground: string;
|
|
19
|
+
primary: {
|
|
20
|
+
DEFAULT: string;
|
|
21
|
+
foreground: string;
|
|
22
|
+
};
|
|
23
|
+
secondary: {
|
|
24
|
+
DEFAULT: string;
|
|
25
|
+
foreground: string;
|
|
26
|
+
};
|
|
27
|
+
destructive: {
|
|
28
|
+
DEFAULT: string;
|
|
29
|
+
foreground: string;
|
|
30
|
+
};
|
|
31
|
+
muted: {
|
|
32
|
+
DEFAULT: string;
|
|
33
|
+
foreground: string;
|
|
34
|
+
};
|
|
35
|
+
accent: {
|
|
36
|
+
DEFAULT: string;
|
|
37
|
+
foreground: string;
|
|
38
|
+
};
|
|
39
|
+
popover: {
|
|
40
|
+
DEFAULT: string;
|
|
41
|
+
foreground: string;
|
|
42
|
+
};
|
|
43
|
+
card: {
|
|
44
|
+
DEFAULT: string;
|
|
45
|
+
foreground: string;
|
|
46
|
+
};
|
|
47
|
+
};
|
|
48
|
+
borderRadius: {
|
|
49
|
+
lg: string;
|
|
50
|
+
md: string;
|
|
51
|
+
sm: string;
|
|
52
|
+
};
|
|
53
|
+
keyframes: {
|
|
54
|
+
"accordion-down": {
|
|
55
|
+
from: {
|
|
56
|
+
height: string;
|
|
57
|
+
};
|
|
58
|
+
to: {
|
|
59
|
+
height: string;
|
|
60
|
+
};
|
|
61
|
+
};
|
|
62
|
+
"accordion-up": {
|
|
63
|
+
from: {
|
|
64
|
+
height: string;
|
|
65
|
+
};
|
|
66
|
+
to: {
|
|
67
|
+
height: string;
|
|
68
|
+
};
|
|
69
|
+
};
|
|
70
|
+
};
|
|
71
|
+
animation: {
|
|
72
|
+
"accordion-down": string;
|
|
73
|
+
"accordion-up": string;
|
|
74
|
+
};
|
|
75
|
+
};
|
|
76
|
+
};
|
|
77
|
+
plugins: any[];
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
export { }
|
package/dist/tailwind.js
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import i from "tailwindcss-animate";
|
|
2
|
+
import { c as d } from "./tailwind-config-d1VL1lzE.js";
|
|
3
|
+
const t = (e) => ({
|
|
4
|
+
darkMode: "class",
|
|
5
|
+
content: [
|
|
6
|
+
...e,
|
|
7
|
+
"node_modules/@chaibuilder/sdk/dist/*.{js,cjs}",
|
|
8
|
+
"node_modules/@chaibuilder/runtime/dist/*.{js,cjs}"
|
|
9
|
+
],
|
|
10
|
+
theme: {
|
|
11
|
+
container: {
|
|
12
|
+
center: !0,
|
|
13
|
+
padding: "2rem",
|
|
14
|
+
screens: {
|
|
15
|
+
"2xl": "1400px"
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
extend: d()
|
|
19
|
+
},
|
|
20
|
+
plugins: [i]
|
|
21
|
+
});
|
|
22
|
+
export {
|
|
23
|
+
t as chaiBuilderTailwindConfig
|
|
24
|
+
};
|
package/dist/ui.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-W5drgyWI.cjs");require("./jsx-runtime-WUGKV8jN.cjs");require("./MODIFIERS-WFzDQfiT.cjs");require("react");require("@radix-ui/react-toggle");require("class-variance-authority");require("./utils-It2K33fU.cjs");require("lodash");require("clsx");require("tailwind-merge");require("@radix-ui/react-switch");require("@radix-ui/react-slot");require("@radix-ui/react-accordion");require("@radix-ui/react-icons");require("@radix-ui/react-alert-dialog");require("@radix-ui/react-dialog");require("@radix-ui/react-label");require("@radix-ui/react-scroll-area");require("@radix-ui/react-tabs");require("@radix-ui/react-tooltip");require("@radix-ui/react-popover");require("@radix-ui/react-menubar");require("@radix-ui/react-hover-card");require("@radix-ui/react-select");require("@radix-ui/react-dropdown-menu");require("@radix-ui/react-separator");require("@radix-ui/react-toast");require("cmdk");require("@radix-ui/react-context-menu");require("react-icons-picker");require("react-dom");require("react-quill");require("jotai");require("flat-to-nested");require("redux-undo");require("@chaibuilder/runtime");require("@react-hookz/web");require("react-i18next");exports.Accordion=e.Accordion;exports.AccordionContent=e.AccordionContent;exports.AccordionItem=e.AccordionItem;exports.AccordionTrigger=e.AccordionTrigger;exports.Alert=e.Alert;exports.AlertDescription=e.AlertDescription;exports.AlertDialog=e.AlertDialog;exports.AlertDialogAction=e.AlertDialogAction;exports.AlertDialogCancel=e.AlertDialogCancel;exports.AlertDialogContent=e.AlertDialogContent;exports.AlertDialogDescription=e.AlertDialogDescription;exports.AlertDialogFooter=e.AlertDialogFooter;exports.AlertDialogHeader=e.AlertDialogHeader;exports.AlertDialogTitle=e.AlertDialogTitle;exports.AlertDialogTrigger=e.AlertDialogTrigger;exports.AlertTitle=e.AlertTitle;exports.Badge=e.Badge;exports.Button=e.Button;exports.Card=e.Card;exports.CardContent=e.CardContent;exports.CardDescription=e.CardDescription;exports.CardFooter=e.CardFooter;exports.CardHeader=e.CardHeader;exports.CardTitle=e.CardTitle;exports.Command=e.Command;exports.CommandDialog=e.CommandDialog;exports.CommandEmpty=e.CommandEmpty;exports.CommandGroup=e.CommandGroup;exports.CommandInput=e.CommandInput;exports.CommandItem=e.CommandItem;exports.CommandList=e.CommandList;exports.CommandSeparator=e.CommandSeparator;exports.CommandShortcut=e.CommandShortcut;exports.ContextMenu=e.ContextMenu;exports.ContextMenuCheckboxItem=e.ContextMenuCheckboxItem;exports.ContextMenuContent=e.ContextMenuContent;exports.ContextMenuGroup=e.ContextMenuGroup;exports.ContextMenuItem=e.ContextMenuItem;exports.ContextMenuLabel=e.ContextMenuLabel;exports.ContextMenuPortal=e.ContextMenuPortal;exports.ContextMenuRadioGroup=e.ContextMenuRadioGroup;exports.ContextMenuRadioItem=e.ContextMenuRadioItem;exports.ContextMenuSeparator=e.ContextMenuSeparator;exports.ContextMenuShortcut=e.ContextMenuShortcut;exports.ContextMenuSub=e.ContextMenuSub;exports.ContextMenuSubContent=e.ContextMenuSubContent;exports.ContextMenuSubTrigger=e.ContextMenuSubTrigger;exports.ContextMenuTrigger=e.ContextMenuTrigger;exports.Dialog=e.Dialog;exports.DialogContent=e.DialogContent;exports.DialogDescription=e.DialogDescription;exports.DialogFooter=e.DialogFooter;exports.DialogHeader=e.DialogHeader;exports.DialogTitle=e.DialogTitle;exports.DialogTrigger=e.DialogTrigger;exports.DropdownMenu=e.DropdownMenu;exports.DropdownMenuCheckboxItem=e.DropdownMenuCheckboxItem;exports.DropdownMenuContent=e.DropdownMenuContent;exports.DropdownMenuGroup=e.DropdownMenuGroup;exports.DropdownMenuItem=e.DropdownMenuItem;exports.DropdownMenuLabel=e.DropdownMenuLabel;exports.DropdownMenuPortal=e.DropdownMenuPortal;exports.DropdownMenuRadioGroup=e.DropdownMenuRadioGroup;exports.DropdownMenuRadioItem=e.DropdownMenuRadioItem;exports.DropdownMenuSeparator=e.DropdownMenuSeparator;exports.DropdownMenuShortcut=e.DropdownMenuShortcut;exports.DropdownMenuSub=e.DropdownMenuSub;exports.DropdownMenuSubContent=e.DropdownMenuSubContent;exports.DropdownMenuSubTrigger=e.DropdownMenuSubTrigger;exports.DropdownMenuTrigger=e.DropdownMenuTrigger;exports.HoverCard=e.HoverCard;exports.HoverCardContent=e.HoverCardContent;exports.HoverCardTrigger=e.HoverCardTrigger;exports.IconPickerField=e.IconPickerField;exports.ImagePickerField=e.ImagePickerField;exports.Input=e.Input;exports.Label=e.Label;exports.LinkField=e.LinkField;exports.Menubar=e.Menubar;exports.MenubarCheckboxItem=e.MenubarCheckboxItem;exports.MenubarContent=e.MenubarContent;exports.MenubarGroup=e.MenubarGroup;exports.MenubarItem=e.MenubarItem;exports.MenubarLabel=e.MenubarLabel;exports.MenubarMenu=e.MenubarMenu;exports.MenubarPortal=e.MenubarPortal;exports.MenubarRadioGroup=e.MenubarRadioGroup;exports.MenubarRadioItem=e.MenubarRadioItem;exports.MenubarSeparator=e.MenubarSeparator;exports.MenubarShortcut=e.MenubarShortcut;exports.MenubarSub=e.MenubarSub;exports.MenubarSubContent=e.MenubarSubContent;exports.MenubarSubTrigger=e.MenubarSubTrigger;exports.MenubarTrigger=e.MenubarTrigger;exports.Popover=e.Popover;exports.PopoverContent=e.PopoverContent;exports.PopoverTrigger=e.PopoverTrigger;exports.RTEField=e.RichTextEditorField;exports.ScrollArea=e.ScrollArea;exports.ScrollBar=e.ScrollBar;exports.Select=e.Select;exports.SelectContent=e.SelectContent;exports.SelectGroup=e.SelectGroup;exports.SelectItem=e.SelectItem;exports.SelectLabel=e.SelectLabel;exports.SelectSeparator=e.SelectSeparator;exports.SelectTrigger=e.SelectTrigger;exports.SelectValue=e.SelectValue;exports.Separator=e.Separator;exports.Sheet=e.Sheet;exports.SheetClose=e.SheetClose;exports.SheetContent=e.SheetContent;exports.SheetDescription=e.SheetDescription;exports.SheetFooter=e.SheetFooter;exports.SheetHeader=e.SheetHeader;exports.SheetTitle=e.SheetTitle;exports.SheetTrigger=e.SheetTrigger;exports.Skeleton=e.Skeleton;exports.Switch=e.Switch;exports.Tabs=e.Tabs;exports.TabsContent=e.TabsContent;exports.TabsList=e.TabsList;exports.TabsTrigger=e.TabsTrigger;exports.Textarea=e.Textarea;exports.Toaster=e.Toaster;exports.Toggle=e.Toggle;exports.Tooltip=e.Tooltip;exports.TooltipContent=e.TooltipContent;exports.TooltipPortal=e.TooltipPortal;exports.TooltipProvider=e.TooltipProvider;exports.TooltipTrigger=e.TooltipTrigger;exports.badgeVariants=e.badgeVariants;exports.buttonVariants=e.buttonVariants;exports.reducer=e.reducer;exports.toast=e.toast;exports.toggleVariants=e.toggleVariants;exports.useToast=e.useToast;
|
package/dist/ui.d.ts
CHANGED
|
@@ -104,7 +104,7 @@ export declare interface ButtonProps extends React_2.ButtonHTMLAttributes<HTMLBu
|
|
|
104
104
|
|
|
105
105
|
export declare const buttonVariants: (props?: {
|
|
106
106
|
variant?: "link" | "default" | "outline" | "secondary" | "destructive" | "ghost";
|
|
107
|
-
size?: "
|
|
107
|
+
size?: "default" | "sm" | "lg" | "icon";
|
|
108
108
|
} & ClassProp) => string;
|
|
109
109
|
|
|
110
110
|
export declare const Card: React_2.ForwardRefExoticComponent<React_2.HTMLAttributes<HTMLDivElement> & React_2.RefAttributes<HTMLDivElement>>;
|
package/dist/ui.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { bi as q, bl as J, bj as K, bk as j, bD as N, bI as O, D as Q, at as U, K as W, F as z, I as X, J as Y, G as Z, H as _, E as $, bE as aa, bJ as ea, B as oa, bw as ta, bA as ra, bz as sa, bC as na, bx as ia, by as ba, b4 as pa, cl as ua, b7 as ca, b8 as la, b5 as ma, b9 as Ca, b6 as da, cn as ga, cm as Ma, bs as Sa, co as Da, br as Ta, ct as xa, bq as wa, cq as Aa, cu as Ia, cy as ha, cp as Pa, cr as Ga, cs as Fa, cv as Ha, cw as La, cx as ka, bt as va, ao as Ra, ap as Ba, as as Va, ba as Ea, aq as ya, ar as fa, bb as qa, aR as Ja, aW as Ka, aT as ja, cc as Na, c9 as Oa, aU as Qa, cd as Ua, ch as Wa, ca as za, aV as Xa, cb as Ya, ce as Za, cf as _a, cg as $a, aS as ae, aO as ee, aQ as oe, aP as te, bf as re, bg as se, bm as ne, aM as ie, bh as be, bM as pe, bT as ue, bP as ce, bZ as le, bQ as me, bS as Ce, bN as de, bW as ge, bU as Me, bV as Se, bR as De, b$ as Te, b_ as xe, bX as we, bY as Ae, bO as Ie, b1 as he, b3 as Pe, b2 as Ge, be as Fe, bp as He, bL as Le, au as ke, ax as ve, aF as Re, ay as Be, aG as Ve, c0 as Ee, av as ye, aw as fe, aL as qe, c1 as Je, c3 as Ke, c4 as je, c8 as Ne, c6 as Oe, c5 as Qe, c7 as Ue, c2 as We, S as ze, aN as Xe, aB as Ye, aE as Ze, aC as _e, aD as $e, bB as ao, C as eo, aJ as oo, aH as to, aK as ro, bn as so, T as no, aI as io, bK as bo, bH as po, ci as uo, ck as co, bG as lo, cj as mo } from "./index-
|
|
1
|
+
import { bi as q, bl as J, bj as K, bk as j, bD as N, bI as O, D as Q, at as U, K as W, F as z, I as X, J as Y, G as Z, H as _, E as $, bE as aa, bJ as ea, B as oa, bw as ta, bA as ra, bz as sa, bC as na, bx as ia, by as ba, b4 as pa, cl as ua, b7 as ca, b8 as la, b5 as ma, b9 as Ca, b6 as da, cn as ga, cm as Ma, bs as Sa, co as Da, br as Ta, ct as xa, bq as wa, cq as Aa, cu as Ia, cy as ha, cp as Pa, cr as Ga, cs as Fa, cv as Ha, cw as La, cx as ka, bt as va, ao as Ra, ap as Ba, as as Va, ba as Ea, aq as ya, ar as fa, bb as qa, aR as Ja, aW as Ka, aT as ja, cc as Na, c9 as Oa, aU as Qa, cd as Ua, ch as Wa, ca as za, aV as Xa, cb as Ya, ce as Za, cf as _a, cg as $a, aS as ae, aO as ee, aQ as oe, aP as te, bf as re, bg as se, bm as ne, aM as ie, bh as be, bM as pe, bT as ue, bP as ce, bZ as le, bQ as me, bS as Ce, bN as de, bW as ge, bU as Me, bV as Se, bR as De, b$ as Te, b_ as xe, bX as we, bY as Ae, bO as Ie, b1 as he, b3 as Pe, b2 as Ge, be as Fe, bp as He, bL as Le, au as ke, ax as ve, aF as Re, ay as Be, aG as Ve, c0 as Ee, av as ye, aw as fe, aL as qe, c1 as Je, c3 as Ke, c4 as je, c8 as Ne, c6 as Oe, c5 as Qe, c7 as Ue, c2 as We, S as ze, aN as Xe, aB as Ye, aE as Ze, aC as _e, aD as $e, bB as ao, C as eo, aJ as oo, aH as to, aK as ro, bn as so, T as no, aI as io, bK as bo, bH as po, ci as uo, ck as co, bG as lo, cj as mo } from "./index-Vx4ctSV6.js";
|
|
2
2
|
import "./jsx-runtime-NV737rRe.js";
|
|
3
3
|
import "./MODIFIERS-MLfpKQY1.js";
|
|
4
4
|
import "react";
|
package/package.json
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
"author": "Suraj Air",
|
|
6
6
|
"license": "BSD-3-Clause",
|
|
7
7
|
"homepage": "https://chaibuilder.com",
|
|
8
|
-
"version": "1.0.
|
|
8
|
+
"version": "1.0.23",
|
|
9
9
|
"type": "module",
|
|
10
10
|
"repository": {
|
|
11
11
|
"type": "git",
|
|
@@ -47,6 +47,11 @@
|
|
|
47
47
|
"require": "./dist/studio.cjs",
|
|
48
48
|
"types": "./dist/studio.d.ts"
|
|
49
49
|
},
|
|
50
|
+
"./tailwind": {
|
|
51
|
+
"import": "./dist/tailwind.js",
|
|
52
|
+
"require": "./dist/tailwind.cjs",
|
|
53
|
+
"types": "./dist/tailwind.d.ts"
|
|
54
|
+
},
|
|
50
55
|
"./styles": {
|
|
51
56
|
"import": "./dist/style.css",
|
|
52
57
|
"require": "./dist/style.css"
|
|
@@ -57,7 +62,7 @@
|
|
|
57
62
|
"build": "tsc && vite build",
|
|
58
63
|
"lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
|
|
59
64
|
"preview": "vite preview",
|
|
60
|
-
"test": "jest --colors",
|
|
65
|
+
"test": "jest --colors --verbose",
|
|
61
66
|
"test:watch": "jest --watch --colors",
|
|
62
67
|
"test:coverage": "jest --coverage --colors",
|
|
63
68
|
"e2e": "playwright test",
|
|
@@ -68,7 +73,7 @@
|
|
|
68
73
|
},
|
|
69
74
|
"dependencies": {
|
|
70
75
|
"@bobthered/tailwindcss-palette-generator": "3.1.1",
|
|
71
|
-
"@chaibuilder/runtime": "0.1.
|
|
76
|
+
"@chaibuilder/runtime": "0.1.5",
|
|
72
77
|
"@floating-ui/dom": "1.4.5",
|
|
73
78
|
"@floating-ui/react-dom": "2.0.1",
|
|
74
79
|
"@mhsdesign/jit-browser-tailwindcss": "0.4.0",
|
|
@@ -138,7 +143,6 @@
|
|
|
138
143
|
"redux-undo": "1.1.0",
|
|
139
144
|
"sonner": "^1.2.0",
|
|
140
145
|
"tailwind-merge": "1.13.2",
|
|
141
|
-
"tailwindcss-animate": "1.0.6",
|
|
142
146
|
"tippy.js": "^6.3.7",
|
|
143
147
|
"unist-util-visit": "^4.1.2",
|
|
144
148
|
"unsplash-js": "^7.0.18"
|
|
@@ -181,6 +185,7 @@
|
|
|
181
185
|
"prop-types": "^15.8.1",
|
|
182
186
|
"react-router-dom": "^6.19.0",
|
|
183
187
|
"tailwindcss": "^3.3.5",
|
|
188
|
+
"tailwindcss-animate": "1.0.6",
|
|
184
189
|
"ts-jest": "^29.1.1",
|
|
185
190
|
"typescript": "^5.2.2",
|
|
186
191
|
"vite": "^5.0.12",
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-WUGKV8jN.cjs"),n=require("react"),t=require("lodash"),g=require("jotai"),s=require("./index-T5MFAHA0.cjs"),y=require("react-dnd"),w=require("@radix-ui/react-icons"),k=require("@chaibuilder/runtime"),q=require("lucide-react"),A=require("./lib.cjs"),T=require("./utils-It2K33fU.cjs");require("./MODIFIERS-WFzDQfiT.cjs");require("@radix-ui/react-toggle");require("class-variance-authority");require("@radix-ui/react-switch");require("@radix-ui/react-slot");require("@radix-ui/react-accordion");require("@radix-ui/react-alert-dialog");require("@radix-ui/react-dialog");require("@radix-ui/react-label");require("@radix-ui/react-scroll-area");require("@radix-ui/react-tabs");require("@radix-ui/react-tooltip");require("@radix-ui/react-popover");require("@radix-ui/react-menubar");require("@radix-ui/react-hover-card");require("@radix-ui/react-select");require("@radix-ui/react-dropdown-menu");require("@radix-ui/react-separator");require("@radix-ui/react-toast");require("cmdk");require("@radix-ui/react-context-menu");require("react-icons-picker");require("react-dom");require("react-quill");require("flat-to-nested");require("redux-undo");require("@react-hookz/web");require("react-i18next");require("himalaya");require("./functions-eu6BbvqO.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");require("clsx");require("tailwind-merge");const C=({block:r})=>{const{type:o,icon:l,label:c}=r,{addCoreBlock:d,addPredefinedBlock:m}=s.useAddBlock(),[p]=s.useSelectedBlockIds(),[,x]=g.useAtom(s.activePanelAtom),[,i]=g.useAtom(s.addBlocksModalAtom),E=()=>{t.has(r,"blocks")?m(k.syncBlocksWithDefaults(r.blocks),t.first(p)):d(r,t.first(p)),i(!1),x("layers")},[,f,j]=y.useDrag(()=>({type:"CHAI_BLOCK",item:r}));return e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx(y.DragPreviewImage,{connect:j,src:"https://placehold.co/100x30/000000/FFF?text="+(c||o).replace(/ /g,"+")}),e.jsxRuntimeExports.jsxs(s.Tooltip,{children:[e.jsxRuntimeExports.jsx(s.TooltipTrigger,{asChild:!0,children:e.jsxRuntimeExports.jsxs("button",{onClick:E,type:"button",ref:f,className:"cursor-grab space-y-2 rounded-lg border border-border p-3 text-center hover:bg-slate-300/50",children:[n.createElement(l||w.BoxIcon,{className:"w-4 h-4 mx-auto"}),e.jsxRuntimeExports.jsx("p",{className:"truncate text-xs",children:c||o})]})}),e.jsxRuntimeExports.jsx(s.TooltipContent,{children:e.jsxRuntimeExports.jsx("p",{children:c||o})})]})]})},N=({block:r,closePopover:o})=>{var j;const[l,c]=n.useState(!1),d=s.useBuilderProp("getExternalPredefinedBlock"),{addCoreBlock:m,addPredefinedBlock:p}=s.useAddBlock(),[x]=s.useSelectedBlockIds(),[,i,E]=y.useDrag(()=>({type:"CHAI_BLOCK",item:r}),[r]),f=n.useCallback(async b=>{if(b.stopPropagation(),t.has(r,"component")){m(r,t.first(x)),o();return}c(!0);const a=await d(r);t.isEmpty(a)||p(k.syncBlocksWithDefaults(a),t.first(x)),o()},[r]);return e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx(y.DragPreviewImage,{connect:E,src:"https://placehold.co/100x30/000000/FFF?text="+((j=r.name||r.label)==null?void 0:j.replace(" ","+"))}),e.jsxRuntimeExports.jsxs("div",{ref:i,onClick:l?()=>{}:f,className:"relative cursor-grab overflow-hidden rounded-md border border-transparent duration-200 hover:scale-x-105 hover:border-foreground/20 hover:shadow-2xl",children:[l&&e.jsxRuntimeExports.jsxs("div",{className:"absolute flex h-full w-full items-center justify-center bg-black bg-opacity-70",children:[e.jsxRuntimeExports.jsx(q.Loader,{className:"animate-spin",size:15,color:"white"})," ",e.jsxRuntimeExports.jsx("span",{className:"pl-2 text-sm text-white",children:"Adding..."})]}),r.preview?e.jsxRuntimeExports.jsx("img",{src:r.preview,className:"min-h-[50px] w-full rounded-md border border-gray-300",alt:r.name}):e.jsxRuntimeExports.jsx("div",{className:"flex h-20 items-center justify-center rounded-md border border-border border-gray-300 bg-gray-200",children:e.jsxRuntimeExports.jsx("p",{className:"max-w-xs text-center text-sm text-gray-700",children:r.name})})]})]})},I=()=>{const{data:r,isLoading:o}=s.useUILibraryBlocks(),l=k.useChaiBlocks(),c=t.filter(t.values(l),{category:"custom"}),d=t.groupBy(c,"group"),m=t.groupBy(r,"group"),[p,x]=n.useState(null),i=n.useMemo(()=>t.mergeWith(d,m,(a,h)=>{if(t.isArray(a)&&t.isArray(h))return[...a,...h]}),[d,m]),[,E]=g.useAtom(s.addBlocksModalAtom),[f,j]=n.useState("Navbar"),b=t.get(i,f,[]);return e.jsxRuntimeExports.jsxs("div",{className:"relative flex h-full max-h-full overflow-hidden py-2",children:[e.jsxRuntimeExports.jsx("ul",{className:"sticky top-0 h-full w-48 space-y-1 overflow-y-auto border-r px-2",children:o?e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx("li",{className:"h-8 w-full animate-pulse bg-gray-200"}),e.jsxRuntimeExports.jsx("li",{className:"mt-2 h-8 w-full animate-pulse bg-gray-200"}),e.jsxRuntimeExports.jsx("li",{className:"mt-2 h-8 w-full animate-pulse bg-gray-200"}),e.jsxRuntimeExports.jsx("li",{className:"mt-2 h-8 w-full animate-pulse bg-gray-200"}),e.jsxRuntimeExports.jsx("li",{className:"mt-2 h-8 w-full animate-pulse bg-gray-200"}),e.jsxRuntimeExports.jsx("li",{className:"mt-2 h-8 w-full animate-pulse bg-gray-200"})]}):n.Children.toArray(t.map(i,(a,h)=>e.jsxRuntimeExports.jsx("li",{onMouseOut:()=>{clearTimeout(p),x(null)},onMouseEnter:()=>{const R=setTimeout(()=>{j(h)},300);x(R)},onClick:()=>j(h),className:T.cn("-mx-2 cursor-default rounded-md rounded-r-none px-2 py-1 text-sm font-medium capitalize",f===h?"bg-blue-500 text-white":" text-gray-700 hover:bg-foreground/10"),children:h})))}),e.jsxRuntimeExports.jsx("div",{className:"h-full w-full space-y-2 overflow-y-auto px-8",children:n.Children.toArray(b.map(a=>e.jsxRuntimeExports.jsx(N,{block:a,closePopover:()=>E(!1)})))})]})},L=()=>{const[r,o]=n.useState(""),{addPredefinedBlock:l}=s.useAddBlock(),[c]=s.useSelectedBlockIds(),[,d]=g.useAtom(s.addBlockOffCanvasAtom),[,m]=g.useAtom(s.activePanelAtom),[,p]=g.useAtom(s.addBlocksModalAtom),x=()=>{const i=A.getBlocksFromHTML(r);l([...i],t.first(c)||null),o(""),d(!1),m("layers"),p(!1)};return e.jsxRuntimeExports.jsxs(s.Card,{className:"border-border/0 p-0 shadow-none",children:[e.jsxRuntimeExports.jsxs(s.CardHeader,{className:"p-3",children:[e.jsxRuntimeExports.jsx(s.CardTitle,{children:"Import HTML"}),e.jsxRuntimeExports.jsx(s.CardDescription,{children:"Use HTML snippets from component libraries like Tailwind UI, Flowbite, Preline, Kitwind, Tailblocks etc. or just copy paste your own HTML code. Only Tailwind CSS markup is supported."})]}),e.jsxRuntimeExports.jsx(s.CardContent,{className:"space-y-2 px-3 py-0",children:e.jsxRuntimeExports.jsxs("div",{className:"space-y-1",children:[e.jsxRuntimeExports.jsx(s.Label,{htmlFor:"current",className:"text-sm",children:"Enter HTML Code:"}),e.jsxRuntimeExports.jsx(s.Textarea,{autoFocus:!0,tabIndex:1,ref:i=>i&&i.focus(),defaultValue:r,onChange:i=>o(i.target.value),rows:12,placeholder:`<div>
|
|
2
|
-
<h1>Enter code here</h1>
|
|
3
|
-
</div>`,className:"resize-none overflow-x-auto whitespace-pre font-mono font-normal"})]})}),e.jsxRuntimeExports.jsxs(s.CardFooter,{className:"flex flex-col justify-end p-3",children:[e.jsxRuntimeExports.jsx(s.Button,{disabled:r.trim()==="",onClick:()=>x(),size:"sm",className:"w-full",children:"Import"}),e.jsxRuntimeExports.jsxs(s.Alert,{variant:"default",className:"mt-2 p-1 text-blue-400",children:[e.jsxRuntimeExports.jsx(w.ExclamationTriangleIcon,{className:"h-4 w-4"}),e.jsxRuntimeExports.jsx(s.AlertTitle,{className:"text-sm leading-4",children:"Imported html will be added to the currently selected block. If no block is selected, the html will be added to the page."})]})]})]})},v=["ListItem","TableHead","TableBody","TableRow","TableCell","Column"],P=(r,o)=>{if(!r)return!t.includes(v,o);const l=r._type;return l==="List"?o==="ListItem":l==="Table"?o==="TableHead"||o==="TableBody":l==="TableHead"||l==="TableBody"?o==="TableRow":l==="TableRow"?o==="TableCell":l==="Row"?o==="Column":!t.includes(v,o)},S=()=>{const[r,o]=n.useState("core"),[l,c]=n.useState("basic"),d=k.useChaiBlocks(),[,m]=g.useAtom(s.showPredefinedBlockCategoryAtom),[,p]=g.useAtom(s.addBlocksModalAtom),[x]=s.useSelectedBlockIds(),i=s.useAllBlocks(),E=t.find(i,{_id:t.first(x)}),{data:f,isLoading:j}=s.useUILibraryBlocks(),b=t.groupBy(t.filter(d,u=>P(E,u.type)),"category"),a=t.uniq(t.map(b.core,"group"));n.useEffect(()=>{!t.includes(a,l)&&!t.isEmpty(a)&&!t.isEmpty(l)&&c(t.first(a))},[a,l]);const h=u=>c(B=>B===u?"":u),R=!j&&!t.isEmpty(f)||t.find(t.values(d),{category:"custom"})!==void 0;return e.jsxRuntimeExports.jsxs("div",{className:"flex h-full flex-col overflow-hidden",children:[e.jsxRuntimeExports.jsxs("div",{className:"mb-2 flex justify-between rounded-md bg-background/30 p-1",children:[e.jsxRuntimeExports.jsxs("h1",{className:"flex flex-col items-baseline px-1 text-2xl font-semibold xl:flex-row",children:["Add block",e.jsxRuntimeExports.jsx("span",{className:"p-0 text-xs font-light leading-3 opacity-80 xl:pl-1",children:r==="html"?"(Enter or paste your own HTML code)":"(Drag & drop into tree view or click to add)"})]}),e.jsxRuntimeExports.jsxs("button",{onClick:()=>p(!1),className:"flex h-max items-center gap-x-1 rounded-full border p-px text-xs text-gray-800 hover:bg-gray-100 md:p-2",children:[e.jsxRuntimeExports.jsx(w.Cross1Icon,{width:12})," Close"]})]}),e.jsxRuntimeExports.jsx(s.Tabs,{onValueChange:u=>{m(""),o(u)},value:r,className:"h-max",children:e.jsxRuntimeExports.jsxs(s.TabsList,{className:"grid w-full "+(R?"grid-cols-3":"grid-cols-2"),children:[e.jsxRuntimeExports.jsx(s.TabsTrigger,{value:"core",children:"Core"}),R?e.jsxRuntimeExports.jsx(s.TabsTrigger,{value:"ui-blocks",children:"UI Blocks"}):null,e.jsxRuntimeExports.jsx(s.TabsTrigger,{value:"html",children:"Import"})]})}),r==="core"&&e.jsxRuntimeExports.jsx(s.ScrollArea,{className:"-mx-1.5 h-full",children:e.jsxRuntimeExports.jsx(s.Accordion,{type:"single",value:l,className:"w-full px-3",children:n.Children.toArray(t.map(a,u=>t.reject(t.filter(t.values(b.core),{group:u}),{hidden:!0}).length?e.jsxRuntimeExports.jsxs(s.AccordionItem,{value:u,className:"border-border",children:[e.jsxRuntimeExports.jsx(s.AccordionTrigger,{onClick:()=>h(u),className:"py-2 capitalize",children:u}),e.jsxRuntimeExports.jsx(s.AccordionContent,{children:e.jsxRuntimeExports.jsx("div",{className:"grid grid-cols-4 gap-2",children:n.Children.toArray(t.reject(t.filter(t.values(b.core),{group:u}),{hidden:!0}).map(B=>e.jsxRuntimeExports.jsx(C,{block:B})))})})]}):null))})}),r==="ui-blocks"&&e.jsxRuntimeExports.jsx(n.Suspense,{fallback:e.jsxRuntimeExports.jsx(s.Skeleton,{className:"h-32 w-full"}),children:e.jsxRuntimeExports.jsx(I,{})}),r==="html"&&e.jsxRuntimeExports.jsx(L,{})]})};exports.default=S;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-WUGKV8jN.cjs"),s=require("./index-T5MFAHA0.cjs"),i=require("lodash"),h=require("sonner"),l=require("react"),o=require("./index-pCHSFoQO.cjs"),j=require("lucide-react");require("./MODIFIERS-WFzDQfiT.cjs");require("@radix-ui/react-toggle");require("class-variance-authority");require("./utils-It2K33fU.cjs");require("clsx");require("tailwind-merge");require("@radix-ui/react-switch");require("@radix-ui/react-slot");require("@radix-ui/react-accordion");require("@radix-ui/react-icons");require("@radix-ui/react-alert-dialog");require("@radix-ui/react-dialog");require("@radix-ui/react-label");require("@radix-ui/react-scroll-area");require("@radix-ui/react-tabs");require("@radix-ui/react-tooltip");require("@radix-ui/react-popover");require("@radix-ui/react-menubar");require("@radix-ui/react-hover-card");require("@radix-ui/react-select");require("@radix-ui/react-dropdown-menu");require("@radix-ui/react-separator");require("@radix-ui/react-toast");require("cmdk");require("@radix-ui/react-context-menu");require("react-icons-picker");require("react-dom");require("react-quill");require("jotai");require("flat-to-nested");require("redux-undo");require("@chaibuilder/runtime");require("@react-hookz/web");require("react-i18next");require("i18next");require("@floating-ui/react-dom");require("react-textarea-autosize");require("flagged");require("react-dnd");require("@minoru/react-dnd-treeview");require("./lib.cjs");require("himalaya");require("./functions-eu6BbvqO.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");require("react-hotkeys-hook");const p=()=>{const{data:t}=o.useProject(),{data:u,isLoading:x}=o.usePages(),{syncState:q}=s.useSavePage(),d=o.useChangePage(),[n,a]=o.useCurrentPage(),c=i.sortBy(i.filter(u,{type:"STATIC"}),r=>i.get(r,"uuid")===(t==null?void 0:t.homepage)?0:1);l.useEffect(()=>{!i.isEmpty(u)&&t.homepage&&!i.find(u,{uuid:n})&&a(t.homepage)},[n,u,t,a]),l.useEffect(()=>()=>a(null),[a]);const m=r=>{if(q!=="SAVED")h.toast.error("You have unsaved changes. Please save before changing the page.");else{const g=i.find(c,{uuid:r});d(g)}};return x||i.isEmpty(n)?null:e.jsxRuntimeExports.jsx("nav",{className:"flex rounded-lg border border-gray-200 bg-gray-50 px-3 pr-0 py-1 text-gray-700 dark:border-gray-700 dark:bg-gray-800","aria-label":"Breadcrumb",children:e.jsxRuntimeExports.jsxs("ol",{className:"inline-flex items-center space-x-1 md:space-x-3",children:[e.jsxRuntimeExports.jsx("li",{className:"inline-flex items-center",children:e.jsxRuntimeExports.jsxs("div",{className:"inline-flex items-center text-sm font-medium text-gray-500 dark:text-gray-400",children:[e.jsxRuntimeExports.jsx(j.BriefcaseIcon,{className:"w-4 h-4 mr-2"}),i.capitalize(t.name)]})}),e.jsxRuntimeExports.jsx("li",{"aria-current":"page",children:e.jsxRuntimeExports.jsxs("div",{className:"flex items-center",children:[e.jsxRuntimeExports.jsx("svg",{className:"mx-1 h-3 w-3 text-gray-400","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 6 10",children:e.jsxRuntimeExports.jsx("path",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"m1 9 4-4-4-4"})}),e.jsxRuntimeExports.jsxs(s.Select,{value:n||"",onValueChange:m,children:[e.jsxRuntimeExports.jsx(s.SelectTrigger,{className:"h-max border-0 py-0 text-sm font-medium text-gray-600 shadow-none outline-none ring-0 focus:ring-0 dark:text-gray-400",children:e.jsxRuntimeExports.jsx(s.SelectValue,{placeholder:"Page"})}),e.jsxRuntimeExports.jsx(s.SelectContent,{className:"z-[999]",children:i.map(c,r=>e.jsxRuntimeExports.jsx(s.SelectItem,{value:r.uuid,children:r==null?void 0:r.name},r.uuid))})]})]})})]})})};exports.default=p;
|
package/dist/Layers-NKZXi2LV.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-WUGKV8jN.cjs"),u=require("lodash"),s=require("@radix-ui/react-icons"),f=require("react-dnd"),B=require("@minoru/react-dnd-treeview"),N=require("react-i18next"),r=require("./index-T5MFAHA0.cjs"),O=require("lucide-react");require("./lib.cjs");const p=require("react"),A=require("./MODIFIERS-WFzDQfiT.cjs"),q=require("./utils-It2K33fU.cjs"),_=require("./index-pCHSFoQO.cjs"),P=require("jotai");require("@radix-ui/react-toggle");require("class-variance-authority");require("@radix-ui/react-switch");require("@radix-ui/react-slot");require("@radix-ui/react-accordion");require("@radix-ui/react-alert-dialog");require("@radix-ui/react-dialog");require("@radix-ui/react-label");require("@radix-ui/react-scroll-area");require("@radix-ui/react-tabs");require("@radix-ui/react-tooltip");require("@radix-ui/react-popover");require("@radix-ui/react-menubar");require("@radix-ui/react-hover-card");require("@radix-ui/react-select");require("@radix-ui/react-dropdown-menu");require("@radix-ui/react-separator");require("@radix-ui/react-toast");require("cmdk");require("@radix-ui/react-context-menu");require("react-icons-picker");require("react-dom");require("react-quill");require("flat-to-nested");require("redux-undo");require("@chaibuilder/runtime");require("@react-hookz/web");require("himalaya");require("./functions-eu6BbvqO.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");require("clsx");require("tailwind-merge");require("i18next");require("@floating-ui/react-dom");require("react-textarea-autosize");require("flagged");require("react-hotkeys-hook");require("sonner");const C=t=>{switch(t.type){case"Image":return e.jsxRuntimeExports.jsx(s.ImageIcon,{});case"Heading":return e.jsxRuntimeExports.jsx(s.HeadingIcon,{});case"Text":return e.jsxRuntimeExports.jsx(s.TextIcon,{});case"Link":return e.jsxRuntimeExports.jsx(s.Link1Icon,{});case"Video":return e.jsxRuntimeExports.jsx(s.VideoIcon,{});case"RichText":return e.jsxRuntimeExports.jsx(s.CursorTextIcon,{});case"Button":return e.jsxRuntimeExports.jsx(s.ButtonIcon,{});case"CustomHTML":return e.jsxRuntimeExports.jsx(s.CodeIcon,{});case"Divider":return e.jsxRuntimeExports.jsx(s.DividerHorizontalIcon,{});case"Icon":return e.jsxRuntimeExports.jsx(s.SketchLogoIcon,{});case"List":return e.jsxRuntimeExports.jsx(s.RowsIcon,{});case"Paragraph":return e.jsxRuntimeExports.jsx(s.TextIcon,{});case"Row":return e.jsxRuntimeExports.jsx(s.RowsIcon,{});case"ListItem":return e.jsxRuntimeExports.jsx(s.ColumnsIcon,{});case"LineBreak":return e.jsxRuntimeExports.jsx(s.SpaceBetweenVerticallyIcon,{});case"Form":return e.jsxRuntimeExports.jsx(s.GroupIcon,{});case"Checkbox":return e.jsxRuntimeExports.jsx(s.CheckboxIcon,{});case"FormButton":return e.jsxRuntimeExports.jsx(s.ButtonIcon,{});case"Input":case"TextArea":return e.jsxRuntimeExports.jsx(s.InputIcon,{});case"Radio":return e.jsxRuntimeExports.jsx(s.RadiobuttonIcon,{});case"Select":return e.jsxRuntimeExports.jsx(s.DropdownMenuIcon,{});case"Table":return e.jsxRuntimeExports.jsx(s.TableIcon,{});case"TableHead":return e.jsxRuntimeExports.jsx(s.BorderTopIcon,{});case"TableBody":return e.jsxRuntimeExports.jsx(s.BorderAllIcon,{});case"TableRow":return e.jsxRuntimeExports.jsx(s.ViewHorizontalIcon,{});case"TableCell":return e.jsxRuntimeExports.jsx(s.DragHandleHorizontalIcon,{});case"DataProvider":return e.jsxRuntimeExports.jsx(O.DatabaseIcon,{size:16});case"Box":return e.jsxRuntimeExports.jsx(s.BoxIcon,{});default:return e.jsxRuntimeExports.jsx(s.BoxModelIcon,{})}};function H(t=""){const n={xs:"390px",sm:"640px",md:"768px",lg:"1024px",xl:"1366px","2xl":"1536px"};if(new RegExp(/\bsr-only\b/).test(t))return"Sr Only";if(new RegExp(/\b(sm|md|lg|xl|2xl):hidden\b/).test(t))return"Visible on mobile";if(t.match(/(^| )hidden( |$)/g)){const c=new RegExp(/\b(sm|md|lg|xl|2xl):(block|grid|flex|inline|inline-grid|inline-flex|inline-block)\b/),l=t.match(c);if(u.nth(l,1))return`Visible >=${n[u.nth(l,1)]}`}return""}const L=t=>{let n="";return Object.keys(t).forEach(o=>{u.startsWith(t[o],A.STYLES_KEY)&&(n=t[o])}),n},F=t=>{var g;const[,n]=r.useHighlightBlockId(),[o]=r.useHiddenBlockIds(),{isSelected:x}=t,{id:c,data:l}=t.node,a=t.depth*10,m=d=>{d.stopPropagation(),t.onToggle(t.node.id)},E=B.useDragOver(c,t.isOpen,t.onToggle),j=p.useMemo(()=>{const d=L(t.node.data);return H(d)},[t.node.data]);return e.jsxRuntimeExports.jsx("div",{onMouseEnter:()=>n(c),className:q.cn("group flex w-full items-center justify-between space-x-px py-px ",x?"bg-blue-500 text-white":"hover:bg-gray-200 dark:hover:bg-gray-800"),onClick:d=>{d.stopPropagation(),!o.includes(c)&&t.onSelect(c)},onContextMenu:()=>t.onSelect(c),style:{paddingInlineStart:a},...E,children:e.jsxRuntimeExports.jsxs("div",{className:"flex items-center",children:[e.jsxRuntimeExports.jsx("div",{className:`flex h-4 w-4 rotate-0 transform cursor-pointer items-center justify-center text-xs transition-transform duration-100 ${t.isOpen?"rotate-90":""}`,children:t.node.droppable&&e.jsxRuntimeExports.jsx("button",{onClick:m,type:"button",children:e.jsxRuntimeExports.jsx(s.TriangleRightIcon,{})})}),e.jsxRuntimeExports.jsxs("button",{type:"button",className:"flex items-center",children:[e.jsxRuntimeExports.jsx("div",{className:"-mt-1 h-3 w-3",children:e.jsxRuntimeExports.jsx(C,{type:l==null?void 0:l._type})}),e.jsxRuntimeExports.jsx("div",{className:"ml-2 truncate text-[11px]",children:((g=t.node.data)==null?void 0:g._name)||t.node.text}),j?e.jsxRuntimeExports.jsxs("span",{className:"ml-2 flex items-center text-[10px] italic "+(x?"text-gray-200":"text-gray-500"),children:["(",j,")"]}):null]})]})})},V=t=>{var o;const{item:n}=t.monitorProps;return e.jsxRuntimeExports.jsxs("div",{className:"flex w-max items-center bg-blue-200 bg-opacity-30 p-1 font-semibold text-blue-700",children:[e.jsxRuntimeExports.jsx("div",{className:"",children:e.jsxRuntimeExports.jsx(C,{type:(o=n==null?void 0:n.data)==null?void 0:o._type})}),e.jsxRuntimeExports.jsx("div",{className:"ml-2 truncate text-[11px]",children:n.text})]})},z=t=>{const n=t.depth*10+16;return e.jsxRuntimeExports.jsx("div",{className:"absolute right-0 top-0 h-0.5 -translate-y-1/2 transform bg-green-500",style:{left:n}})},G=p.lazy(()=>Promise.resolve().then(()=>require("./MarkAsGlobalBlock-5h3wP4zj.cjs"))),$=()=>{const[t]=r.useSelectedBlockIds(),[,n]=r.useCutBlockIds();return e.jsxRuntimeExports.jsxs(r.ContextMenuItem,{className:"flex items-center gap-x-4 text-xs",onClick:()=>n(t),children:[e.jsxRuntimeExports.jsx(s.ScissorsIcon,{})," Cut"]})},K=()=>{const[t]=r.useSelectedBlockIds(),[,n]=r.useCopyBlockIds();return e.jsxRuntimeExports.jsxs(r.ContextMenuItem,{className:"flex items-center gap-x-4 text-xs",onClick:()=>n(t),children:[e.jsxRuntimeExports.jsx(s.ClipboardIcon,{})," Copy"]})},Q=()=>{const[t]=r.useSelectedBlockIds(),n=r.useRemoveBlocks(),o=r.useSelectedBlock();return e.jsxRuntimeExports.jsxs(r.ContextMenuItem,{disabled:(o==null?void 0:o._type)==="Slot",className:"flex items-center gap-x-4 text-xs",onClick:()=>n(t),children:[e.jsxRuntimeExports.jsx(s.TrashIcon,{})," Remove"]})},U=({id:t=null,openMarkAsGlobalModal:n})=>{const[o]=r.useSelectedBlockIds(),x=r.useDuplicateBlocks(),{pasteBlocks:c,canPaste:l}=r.usePasteBlocks(),a=r.useBuilderProp("globalBlocksSupport",!1),m=p.useCallback(()=>{x(o)},[o,x]);return e.jsxRuntimeExports.jsxs(r.ContextMenuContent,{className:"text-xs",children:[a&&e.jsxRuntimeExports.jsx(r.ContextMenuItem,{className:"flex items-center gap-x-4 border-b text-xs",onClick:n,children:e.jsxRuntimeExports.jsxs("div",{className:"flex items-center gap-x-4",children:[e.jsxRuntimeExports.jsx(s.GlobeIcon,{})," Mark as global"]})}),e.jsxRuntimeExports.jsxs(r.ContextMenuItem,{className:"flex items-center gap-x-4 text-xs",onClick:m,children:[e.jsxRuntimeExports.jsx(s.CopyIcon,{})," Duplicate"]}),e.jsxRuntimeExports.jsx($,{}),e.jsxRuntimeExports.jsx(K,{}),e.jsxRuntimeExports.jsxs(r.ContextMenuItem,{className:"flex items-center gap-x-4 text-xs",onClick:()=>c(t),disabled:!l,children:[e.jsxRuntimeExports.jsx(s.ClipboardCopyIcon,{})," Paste"]}),e.jsxRuntimeExports.jsx(Q,{})]})},Y=({children:t,id:n=null})=>{const[o,x]=p.useState(!1);return e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx(r.Dialog,{open:o,onOpenChange:x,children:o&&e.jsxRuntimeExports.jsx(r.DialogContent,{children:e.jsxRuntimeExports.jsx(p.Suspense,{fallback:e.jsxRuntimeExports.jsx("div",{className:"h-96 w-full animate-pulse bg-gray-200"}),children:e.jsxRuntimeExports.jsx(G,{closeModal:()=>x(!1),id:n})})})}),e.jsxRuntimeExports.jsxs(r.ContextMenu,{children:[e.jsxRuntimeExports.jsx(r.ContextMenuTrigger,{children:t}),e.jsxRuntimeExports.jsx(U,{id:n,openMarkAsGlobalModal:()=>x(!0)})]})]})},W=()=>{const{addCoreBlock:t}=r.useAddBlock(),n=r.useBuilderProp("getExternalPredefinedBlock");return p.useCallback(async o=>{const{block:x,dropTargetId:c,relativeIndex:l}=o;if(u.has(x,"format")){const a=await n(x);return t({blocks:a},c===0?null:c,l)}return t(x,c===0?null:c,l)},[t])};function J(t){return u.map(t,n=>{const{data:o}=n;return{...o,_parent:n.parent===0?null:n.parent}})}const X=()=>{const t=r.useAllBlocks(),[n]=r.useSetAllBlocks(),[o,x,c]=r.useSelectedBlockIds(),[,l]=r.useSelectedStylingBlocks(),{t:a}=N.useTranslation(),{createSnapshot:m}=r.useCanvasHistory(),E=_.useExpandedIds(),j=W(),[,g]=P.useAtom(r.addBlocksModalAtom),d=async(i,R)=>{const{dragSource:h,destinationIndex:b,relativeIndex:k,dropTargetId:T,monitor:D}=R,M=J(i);n(M),h?m():(await j({block:D.getItem(),dropTargetId:T,destinationIndex:b,relativeIndex:k}),g(!1))},y=u.map(t,i=>({id:i._id,text:i._type,parent:i._parent||0,droppable:!u.isUndefined(u.find(t,{_parent:i._id})),data:i})),v=()=>{x([]),l([])},[{isOver:I},S]=f.useDrop(()=>({accept:["CHAI_BLOCK"],collect:i=>({canDrop:i.canDrop(),isOver:i.isOver()}),drop:i=>{(async()=>(await j({block:i,dropTargetId:"",destinationIndex:0,relativeIndex:0}),g(!1)))()}})),{isDragging:w}=f.useDragLayer(i=>({isDragging:i.isDragging()}));return e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:e.jsxRuntimeExports.jsx("div",{onClick:()=>v(),className:q.cn("-mx-1 -mt-1 flex h-full select-none flex-col space-y-1",w?"bg-green-50/80":"bg-background"),children:u.isEmpty(t)?e.jsxRuntimeExports.jsxs("div",{ref:S,className:`mx-1 mt-4 max-w-full h-full p-6 text-center text-sm text-gray-400 ${I?"bg-blue-200":""}`,children:[I?e.jsxRuntimeExports.jsx(s.DoubleArrowDownIcon,{className:"mx-auto h-12 w-12 animate-bounce"}):e.jsxRuntimeExports.jsx(s.StackIcon,{className:"mx-auto h-10 w-10"}),e.jsxRuntimeExports.jsx("p",{className:"mt-2",children:a(I?"drop_here_message":"tree_view_no_blocks")})]}):e.jsxRuntimeExports.jsx(r.ScrollArea,{id:"layers-view",className:"no-scrollbar h-full overflow-y-auto p-1",children:e.jsxRuntimeExports.jsx(B.Tree,{initialOpen:E,extraAcceptTypes:["CHAI_BLOCK"],tree:y,rootId:0,render:(i,{depth:R,isOpen:h,onToggle:b})=>e.jsxRuntimeExports.jsx(Y,{id:i.id,children:e.jsxRuntimeExports.jsx(F,{onSelect:k=>{l([]),x([k])},isSelected:u.includes(o,i.id),node:i,depth:R,isOpen:h,onToggle:b,toggleIds:c})}),dragPreviewRender:i=>e.jsxRuntimeExports.jsx(V,{monitorProps:i}),onDrop:d,classes:{root:"h-full pt-2",draggingSource:"opacity-30",dropTarget:"bg-green-100",placeholder:"relative"},sort:!1,insertDroppableFirst:!1,canDrop:r.canDropBlock,dropTargetOffset:2,enableAnimateExpand:!0,placeholderRender:(i,{depth:R})=>e.jsxRuntimeExports.jsx(z,{node:i,depth:R})})})})})};exports.default=X;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-WUGKV8jN.cjs"),r=require("react"),x=require("lodash"),s=require("./index-T5MFAHA0.cjs"),a=require("./index-pCHSFoQO.cjs");require("./MODIFIERS-WFzDQfiT.cjs");require("@radix-ui/react-toggle");require("class-variance-authority");require("./utils-It2K33fU.cjs");require("clsx");require("tailwind-merge");require("@radix-ui/react-switch");require("@radix-ui/react-slot");require("@radix-ui/react-accordion");require("@radix-ui/react-icons");require("@radix-ui/react-alert-dialog");require("@radix-ui/react-dialog");require("@radix-ui/react-label");require("@radix-ui/react-scroll-area");require("@radix-ui/react-tabs");require("@radix-ui/react-tooltip");require("@radix-ui/react-popover");require("@radix-ui/react-menubar");require("@radix-ui/react-hover-card");require("@radix-ui/react-select");require("@radix-ui/react-dropdown-menu");require("@radix-ui/react-separator");require("@radix-ui/react-toast");require("cmdk");require("@radix-ui/react-context-menu");require("react-icons-picker");require("react-dom");require("react-quill");require("jotai");require("flat-to-nested");require("redux-undo");require("@chaibuilder/runtime");require("@react-hookz/web");require("react-i18next");require("i18next");require("@floating-ui/react-dom");require("react-textarea-autosize");require("flagged");require("react-dnd");require("@minoru/react-dnd-treeview");require("./lib.cjs");require("himalaya");require("./functions-eu6BbvqO.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");require("react-hotkeys-hook");require("sonner");require("lucide-react");const d=r.lazy(()=>Promise.resolve().then(()=>require("./project-general-setting-HZeYf9A1.cjs"))),q=r.lazy(()=>Promise.resolve().then(()=>require("./project-seo-setting-3FZQXaTn.cjs"))),c=e.jsxRuntimeExports.jsx("div",{className:"px-3",children:e.jsxRuntimeExports.jsx("div",{className:"h-52 w-full animate-pulse rounded-md bg-gray-100"})}),l=t=>t&&x.isEmpty(t.seoData)?{...t,seoData:{title:"",description:"",image:""}}:t;function m(){const t=a.useUpdateProject(),{data:n}=a.useProject(),[i,o]=r.useState(l(n||{})),u=r.useRef(i);return r.useEffect(()=>()=>{x.isEqual(n,u.current)||t.mutate(u.current,{onSuccess:()=>o(u.current)})},[u]),r.useEffect(()=>{u.current=i},[i]),e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx("div",{className:"flex items-center justify-between rounded-md bg-background/30 p-1",children:e.jsxRuntimeExports.jsx("h1",{className:"px-1 font-semibold",children:"Website Settings"})}),e.jsxRuntimeExports.jsx("hr",{className:"-mx-1"}),e.jsxRuntimeExports.jsx("div",{className:"-mx-1",children:e.jsxRuntimeExports.jsxs(s.Accordion,{type:"single",className:"w-full",defaultValue:"GENERAL",children:[e.jsxRuntimeExports.jsxs(s.AccordionItem,{value:"GENERAL",className:"border-b-2 border-slate-100 dark:border-slate-800",children:[e.jsxRuntimeExports.jsx(s.AccordionTrigger,{className:"bg-slate-200 px-2.5 py-1.5 font-medium hover:bg-slate-100 hover:no-underline dark:bg-slate-900 dark:hover:bg-slate-800",children:"General Settings"}),e.jsxRuntimeExports.jsx(s.AccordionContent,{className:"px-2 pt-4 text-sm",children:e.jsxRuntimeExports.jsx(r.Suspense,{fallback:c,children:e.jsxRuntimeExports.jsx(d,{_projectData:i,seany:o})})})]}),e.jsxRuntimeExports.jsxs(s.AccordionItem,{value:"SEO",className:"border-b-2 border-slate-100 dark:border-slate-800",children:[e.jsxRuntimeExports.jsx(s.AccordionTrigger,{className:"bg-slate-200 px-2.5 py-1.5 font-medium hover:bg-slate-100 hover:no-underline dark:bg-slate-900 dark:hover:bg-slate-800",children:"SEO Settings"}),e.jsxRuntimeExports.jsx(s.AccordionContent,{className:"px-1 pt-4 text-sm",children:e.jsxRuntimeExports.jsx(r.Suspense,{fallback:c,children:e.jsxRuntimeExports.jsx(q,{_projectData:i,seany:o})})})]})]})})]})}exports.default=m;
|