@chaibuilder/sdk 1.0.10 → 1.0.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/AddBlocks-7ACJv8LW.cjs +3 -0
- package/dist/{AddBlocks-xR2s2BVa.js → AddBlocks-H7BZYHUC.js} +30 -30
- package/dist/BrandingOptions-5j-XszLM.cjs +1 -0
- package/dist/{BrandingOptions-cHK2bVZy.js → BrandingOptions-PAgY-kvj.js} +13 -12
- package/dist/{CanvasArea-Br8bBSeT.cjs → CanvasArea-Dnm-yeus.cjs} +2 -2
- package/dist/{CanvasArea-2zqT1lSE.js → CanvasArea-zn2ox-5h.js} +6 -6
- package/dist/{ChaiBuilderEditor-SacH75l4.cjs → ChaiBuilderEditor-BoE-sArB.cjs} +2 -2
- package/dist/{ChaiBuilderEditor-h9bXC4l-.js → ChaiBuilderEditor-hEuUONQ3.js} +2 -2
- package/dist/{CurrentPage-4lTETR2f.js → CurrentPage-6Jp4xAWK.js} +3 -3
- package/dist/CurrentPage-YMpqOqx7.cjs +1 -0
- package/dist/Layers-EzOZdWvd.cjs +1 -0
- package/dist/{Layers-wOfijZnb.js → Layers-WkZ48AUm.js} +5 -5
- package/dist/{MarkAsGlobalBlock-xRyn29gC.js → MarkAsGlobalBlock-0HubcRkY.js} +3 -3
- package/dist/MarkAsGlobalBlock-HmeIyLCP.cjs +1 -0
- package/dist/{PagesPanel-82gCVzHS.js → PagesPanel-6JuwBLFQ.js} +4 -4
- package/dist/PagesPanel-zJq8p1ja.cjs +1 -0
- package/dist/ProjectPanel-Zml2F8b9.cjs +1 -0
- package/dist/{ProjectPanel-vz5WOyqZ.js → ProjectPanel-cu2QSDW9.js} +4 -4
- package/dist/{Settings-IuAF359L.js → Settings-fH8fZKpm.js} +70 -69
- package/dist/Settings-lc9PfnmG.cjs +1 -0
- package/dist/SidePanels-VH72zFE2.cjs +1 -0
- package/dist/{SidePanels-xssTWt4M.js → SidePanels-w8ZHKJaR.js} +3 -3
- package/dist/{Topbar-H0f0EL6-.js → Topbar-hm1D_5sb.js} +2 -2
- package/dist/Topbar-vQPo9xSY.cjs +1 -0
- package/dist/add-page-modal--qZSwJuB.cjs +1 -0
- package/dist/{add-page-modal-J1E7rh1U.js → add-page-modal-bj7qbZuK.js} +6 -5
- package/dist/controls-W97-POR_.cjs +1 -0
- package/dist/controls-enQY7NI8.js +118 -0
- package/dist/core.cjs +1 -1
- package/dist/core.js +9 -9
- package/dist/delete-page-modal-2LuDLEiP.cjs +1 -0
- package/dist/{delete-page-modal-ysj4O0bM.js → delete-page-modal-cnrR8tWH.js} +3 -3
- package/dist/index-HAue58ea.cjs +1 -0
- package/dist/{index-cZ4uo6aT.js → index-T4_wfKl5.js} +2 -2
- package/dist/{index-8L3zCc6V.cjs → index-X9ZgD09V.cjs} +1 -1
- package/dist/index-ehKdBRUK.js +18 -0
- package/dist/page-viewer-IARz6OSp.cjs +1 -0
- package/dist/{page-viewer-84Giu0Rs.js → page-viewer-Y4YiaZ_m.js} +4 -4
- package/dist/{project-general-setting-8OEVVxzn.js → project-general-setting-U4S_KlhU.js} +13 -12
- package/dist/project-general-setting-eSl3t-VH.cjs +1 -0
- package/dist/{project-seo-setting-9kD_stdI.js → project-seo-setting-Ga9v_ECU.js} +7 -7
- package/dist/project-seo-setting-rankm1z3.cjs +1 -0
- package/dist/render.cjs +1 -1
- package/dist/render.js +34 -34
- package/dist/server.cjs +1 -1
- package/dist/server.js +1 -1
- package/dist/{single-page-detail-iXpavDy8.js → single-page-detail-pAxCy_Pe.js} +43 -42
- package/dist/single-page-detail-yPgnu2AI.cjs +1 -0
- package/dist/studio.cjs +1 -1
- package/dist/studio.js +3 -3
- package/dist/ui.d.ts +4 -4
- package/dist/{useAddBlock-BOjrGBEO.js → useAddBlock-WJc3OgG8.js} +2 -2
- package/dist/{useAddBlock-1cMXaOVk.cjs → useAddBlock-dCKRFPRU.cjs} +1 -1
- package/dist/{useAllBlocks-RU_Xw8j9.cjs → useAllBlocks-6hvuNuyw.cjs} +1 -1
- package/dist/{useAllBlocks-lX6uVO39.js → useAllBlocks-PQKYvs-e.js} +1 -1
- package/dist/{useDarkMode-JWkrNFpH.js → useDarkMode-ZKCO_gkt.js} +1 -1
- package/dist/{useDarkMode-zeTW_UUR.cjs → useDarkMode-dV6FM6l-.cjs} +1 -1
- package/dist/{useFeatureSupport-jWSuY7wk.js → useFeatureSupport-OLwNgEZb.js} +1 -1
- package/dist/{useFeatureSupport-tZ0QfBxp.cjs → useFeatureSupport-c9IgPW2t.cjs} +1 -1
- package/dist/{useLanguage-Y3qgAbgG.cjs → useLanguage-NKKKaxVM.cjs} +1 -1
- package/dist/{useLanguage-O1uu2Bzu.js → useLanguage-gVC5rxO5.js} +2 -2
- package/dist/{useMarkAsGlobalBlock-DB5B1UP6.js → useMarkAsGlobalBlock-X73Vny8u.js} +2 -2
- package/dist/useMarkAsGlobalBlock-ebBVGHg4.cjs +1 -0
- package/package.json +2 -2
- package/dist/AddBlocks-tdvDe7xL.cjs +0 -3
- package/dist/BrandingOptions-DpJ-oNnf.cjs +0 -1
- package/dist/CurrentPage-nlUWJiUA.cjs +0 -1
- package/dist/Layers-Vw4XE6YB.cjs +0 -1
- package/dist/MarkAsGlobalBlock-1J_YyL1L.cjs +0 -1
- package/dist/PagesPanel-ZKRdK-mI.cjs +0 -1
- package/dist/ProjectPanel-kYg4KkJu.cjs +0 -1
- package/dist/Settings-1E3Y_5r6.cjs +0 -1
- package/dist/SidePanels-WL1UioF2.cjs +0 -1
- package/dist/Topbar-3ozdWfSy.cjs +0 -1
- package/dist/add-page-modal-eiiUZCJX.cjs +0 -1
- package/dist/delete-page-modal-TGTmRjyn.cjs +0 -1
- package/dist/page-viewer-OdVEG83P.cjs +0 -1
- package/dist/project-general-setting-laHNQPW5.cjs +0 -1
- package/dist/project-seo-setting-F3Opt9Uj.cjs +0 -1
- package/dist/single-page-detail-X0TGlsT4.cjs +0 -1
- package/dist/useMarkAsGlobalBlock-toxRSLc_.cjs +0 -1
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-JYMCiFoE.cjs"),i=require("react"),s=require("lodash"),b=require("jotai"),w=require("./accordion-ynvFtV_p.cjs"),L=require("./scroll-area-FiHvy-TZ.cjs"),k=require("./tabs-iWeaaVrg.cjs"),y=require("./skeleton-JHP9zwL2.cjs"),v=require("react-dnd"),C=require("@radix-ui/react-icons"),d=require("./ChaiBuilderEditor-BoE-sArB.cjs"),q=require("./useAddBlock-dCKRFPRU.cjs");require("react-i18next");const A=require("./index-HAue58ea.cjs"),I=require("./useUiLibraries-9FhQCpKo.cjs"),P=require("lucide-react"),S=require("./utils-qK_SjzzV.cjs"),M=require("./useAllBlocks-6hvuNuyw.cjs"),f=require("./textarea-1kZEh7ki.cjs"),F=require("./label-tFm8HZdb.cjs"),H=require("./html-to-json-P6GpbcQX.cjs");require("@radix-ui/react-accordion");require("@radix-ui/react-scroll-area");require("@radix-ui/react-tabs");require("@radix-ui/react-slot");require("class-variance-authority");require("@radix-ui/react-tooltip");require("@radix-ui/react-toast");require("./MODIFIERS-Fx6WAZcw.cjs");require("clsx");require("react-dom");require("@floating-ui/react-dom");require("i18next");require("flagged");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("./controls-xUKa23ic.cjs");require("tailwind-merge");require("@radix-ui/react-label");require("himalaya");const D=({block:t})=>{const{type:r,icon:o,label:a}=t,{addCoreBlock:u,addPredefinedBlock:m}=q.useAddBlock(),[p]=d.useSelectedBlockIds(),[,x]=b.useAtom(d.activePanelAtom),[,l]=b.useAtom(d.addBlocksModalAtom),E=()=>{s.has(t,"blocks")?m(A.P(t.blocks),s.first(p)):u(t,s.first(p)),l(!1),x("layers")},[,g,j]=v.useDrag(()=>({type:"CHAI_BLOCK",item:t}));return e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx(v.DragPreviewImage,{connect:j,src:"https://placehold.co/100x30/000000/FFF?text="+(a||r).replace(/ /g,"+")}),e.jsxRuntimeExports.jsxs(y.Tooltip,{children:[e.jsxRuntimeExports.jsx(y.TooltipTrigger,{asChild:!0,children:e.jsxRuntimeExports.jsxs("button",{onClick:E,type:"button",ref:g,className:"cursor-grab space-y-2 rounded-lg border border-border p-3 text-center hover:bg-slate-300/50",children:[i.createElement(o||C.BoxIcon,{className:"w-4 h-4 mx-auto"}),e.jsxRuntimeExports.jsx("p",{className:"truncate text-xs",children:a||r})]})}),e.jsxRuntimeExports.jsx(y.TooltipContent,{children:e.jsxRuntimeExports.jsx("p",{children:a||r})})]})]})},O=({block:t,closePopover:r})=>{var j;const[o,a]=i.useState(!1),u=y.useBuilderProp("getExternalPredefinedBlock"),{addCoreBlock:m,addPredefinedBlock:p}=q.useAddBlock(),[x]=d.useSelectedBlockIds(),[,l,E]=v.useDrag(()=>({type:"CHAI_BLOCK",item:t}),[t]),g=i.useCallback(async R=>{if(R.stopPropagation(),s.has(t,"component")){m(t,s.first(x)),r();return}a(!0);const n=await u(t);s.isEmpty(n)||p(A.P(n),s.first(x)),r()},[t]);return e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx(v.DragPreviewImage,{connect:E,src:"https://placehold.co/100x30/000000/FFF?text="+((j=t.name||t.label)==null?void 0:j.replace(" ","+"))}),e.jsxRuntimeExports.jsxs("div",{ref:l,onClick:o?()=>{}:g,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:[o&&e.jsxRuntimeExports.jsxs("div",{className:"absolute flex h-full w-full items-center justify-center bg-black bg-opacity-70",children:[e.jsxRuntimeExports.jsx(P.Loader,{className:"animate-spin",size:15,color:"white"})," ",e.jsxRuntimeExports.jsx("span",{className:"pl-2 text-sm text-white",children:"Adding..."})]}),t.preview?e.jsxRuntimeExports.jsx("img",{src:t.preview,className:"min-h-[50px] w-full rounded-md border border-gray-300",alt:t.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:t.name})})]})]})},U=()=>{const{data:t,isLoading:r}=I.useUILibraryBlocks(),o=A.C(),a=s.filter(s.values(o),{category:"custom"}),u=s.groupBy(a,"group"),m=s.groupBy(t,"group"),[p,x]=i.useState(null),l=i.useMemo(()=>s.mergeWith(u,m,(n,h)=>{if(s.isArray(n)&&s.isArray(h))return[...n,...h]}),[u,m]),[,E]=b.useAtom(d.addBlocksModalAtom),[g,j]=i.useState("Navbar"),R=s.get(l,g,[]);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:r?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"})]}):i.Children.toArray(s.map(l,(n,h)=>e.jsxRuntimeExports.jsx("li",{onMouseOut:()=>{clearTimeout(p),x(null)},onMouseEnter:()=>{const B=setTimeout(()=>{j(h)},300);x(B)},onClick:()=>j(h),className:S.cn("-mx-2 cursor-default rounded-md rounded-r-none px-2 py-1 text-sm font-medium capitalize",g===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:i.Children.toArray(R.map(n=>e.jsxRuntimeExports.jsx(O,{block:n,closePopover:()=>E(!1)})))})]})},z=()=>{const[t,r]=i.useState(""),{addPredefinedBlock:o}=q.useAddBlock(),[a]=d.useSelectedBlockIds(),[,u]=b.useAtom(d.addBlockOffCanvasAtom),[,m]=b.useAtom(d.activePanelAtom),[,p]=b.useAtom(d.addBlocksModalAtom),x=()=>{const l=H.getBlocksFromHTML(t);o([...l],s.first(a)||null),r(""),u(!1),m("layers"),p(!1)};return e.jsxRuntimeExports.jsxs(f.Card,{className:"border-border/0 p-0 shadow-none",children:[e.jsxRuntimeExports.jsxs(f.CardHeader,{className:"p-3",children:[e.jsxRuntimeExports.jsx(f.CardTitle,{children:"Import HTML"}),e.jsxRuntimeExports.jsx(f.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(f.CardContent,{className:"space-y-2 px-3 py-0",children:e.jsxRuntimeExports.jsxs("div",{className:"space-y-1",children:[e.jsxRuntimeExports.jsx(F.Label,{htmlFor:"current",className:"text-sm",children:"Enter HTML Code:"}),e.jsxRuntimeExports.jsx(f.Textarea,{autoFocus:!0,tabIndex:1,ref:l=>l&&l.focus(),defaultValue:t,onChange:l=>r(l.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(f.CardFooter,{className:"flex flex-col justify-end p-3",children:[e.jsxRuntimeExports.jsx(y.Button,{disabled:t.trim()==="",onClick:()=>x(),size:"sm",className:"w-full",children:"Import"}),e.jsxRuntimeExports.jsxs(f.Alert,{variant:"default",className:"mt-2 p-1 text-blue-400",children:[e.jsxRuntimeExports.jsx(C.ExclamationTriangleIcon,{className:"h-4 w-4"}),e.jsxRuntimeExports.jsx(f.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."})]})]})]})},G=z,N=["ListItem","TableHead","TableBody","TableRow","TableCell","Column"],_=(t,r)=>{if(!t)return!s.includes(N,r);const o=t._type;return o==="List"?r==="ListItem":o==="Table"?r==="TableHead"||r==="TableBody":o==="TableHead"||o==="TableBody"?r==="TableRow":o==="TableRow"?r==="TableCell":o==="Row"?r==="Column":!s.includes(N,r)},K=()=>{const[t,r]=i.useState("core"),[o,a]=i.useState("basic"),u=A.C(),[,m]=b.useAtom(d.showPredefinedBlockCategoryAtom),[,p]=b.useAtom(d.addBlocksModalAtom),[x]=d.useSelectedBlockIds(),l=M.useAllBlocks(),E=s.find(l,{_id:s.first(x)}),{data:g,isLoading:j}=I.useUILibraryBlocks(),R=s.groupBy(s.filter(u,c=>_(E,c.type)),"category"),n=s.uniq(s.map(R.core,"group"));i.useEffect(()=>{!s.includes(n,o)&&!s.isEmpty(n)&&!s.isEmpty(o)&&a(s.first(n))},[n,o]);const h=c=>a(T=>T===c?"":c),B=!j&&!s.isEmpty(g)||s.find(s.values(u),{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:t==="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(C.Cross1Icon,{width:12})," Close"]})]}),e.jsxRuntimeExports.jsx(k.Tabs,{onValueChange:c=>{m(""),r(c)},value:t,className:"h-max",children:e.jsxRuntimeExports.jsxs(k.TabsList,{className:"grid w-full "+(B?"grid-cols-3":"grid-cols-2"),children:[e.jsxRuntimeExports.jsx(k.TabsTrigger,{value:"core",children:"Core"}),B?e.jsxRuntimeExports.jsx(k.TabsTrigger,{value:"ui-blocks",children:"UI Blocks"}):null,e.jsxRuntimeExports.jsx(k.TabsTrigger,{value:"html",children:"Import"})]})}),t==="core"&&e.jsxRuntimeExports.jsx(L.ScrollArea,{className:"-mx-1.5 h-full",children:e.jsxRuntimeExports.jsx(w.Accordion,{type:"single",value:o,className:"w-full px-3",children:i.Children.toArray(s.map(n,c=>s.reject(s.filter(s.values(R.core),{group:c}),{hidden:!0}).length?e.jsxRuntimeExports.jsxs(w.AccordionItem,{value:c,className:"border-border",children:[e.jsxRuntimeExports.jsx(w.AccordionTrigger,{onClick:()=>h(c),className:"py-2 capitalize",children:c}),e.jsxRuntimeExports.jsx(w.AccordionContent,{children:e.jsxRuntimeExports.jsx("div",{className:"grid grid-cols-4 gap-2",children:i.Children.toArray(s.reject(s.filter(s.values(R.core),{group:c}),{hidden:!0}).map(T=>e.jsxRuntimeExports.jsx(D,{block:T})))})})]}):null))})}),t==="ui-blocks"&&e.jsxRuntimeExports.jsx(i.Suspense,{fallback:e.jsxRuntimeExports.jsx(y.Skeleton,{className:"h-32 w-full"}),children:e.jsxRuntimeExports.jsx(U,{})}),t==="html"&&e.jsxRuntimeExports.jsx(G,{})]})};exports.default=K;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { j as e } from "./jsx-runtime-Sp0orL4X.js";
|
|
2
|
-
import
|
|
3
|
-
import { has as R, first as b, filter as w, values as k, groupBy as I, mergeWith as $, isArray as H, get as J, map as L, isEmpty as
|
|
2
|
+
import v, { createElement as K, useState as j, useMemo as q, useCallback as V, useEffect as Q, Suspense as W } from "react";
|
|
3
|
+
import { has as R, first as b, filter as w, values as k, groupBy as I, mergeWith as $, isArray as H, get as J, map as L, isEmpty as T, find as M, uniq as X, includes as P, reject as E } from "lodash";
|
|
4
4
|
import { useAtom as h } from "jotai";
|
|
5
5
|
import { A as Y, a as Z, b as ee, c as se } from "./accordion-oPUeqPCZ.js";
|
|
6
6
|
import { S as re } from "./scroll-area-ewXbxc3n.js";
|
|
@@ -8,15 +8,15 @@ import { T as oe, a as te, b as A } from "./tabs-Gb9v5dVb.js";
|
|
|
8
8
|
import { T as le, a as ae, c as ce, u as ie, B as ne, S as de } from "./skeleton-CU_FIbg3.js";
|
|
9
9
|
import { useDrag as _, DragPreviewImage as O } from "react-dnd";
|
|
10
10
|
import { BoxIcon as me, ExclamationTriangleIcon as ue, Cross1Icon as pe } from "@radix-ui/react-icons";
|
|
11
|
-
import { l as
|
|
12
|
-
import { u as F } from "./useAddBlock-
|
|
11
|
+
import { l as C, w as z, x as B, P as xe, Q as he } from "./ChaiBuilderEditor-hEuUONQ3.js";
|
|
12
|
+
import { u as F } from "./useAddBlock-WJc3OgG8.js";
|
|
13
13
|
import "react-i18next";
|
|
14
|
-
import {
|
|
15
|
-
import { u as
|
|
14
|
+
import { P as G, C as U } from "./index-ehKdBRUK.js";
|
|
15
|
+
import { u as D } from "./useUiLibraries-4hPOi8DI.js";
|
|
16
16
|
import { Loader as fe } from "lucide-react";
|
|
17
17
|
import { c as ge } from "./utils-dze1SGvB.js";
|
|
18
|
-
import { u as be } from "./useAllBlocks-
|
|
19
|
-
import { C as je, c as ye, e as we, f as ke, g as
|
|
18
|
+
import { u as be } from "./useAllBlocks-PQKYvs-e.js";
|
|
19
|
+
import { C as je, c as ye, e as we, f as ke, g as Te, T as ve, d as Ce, A as Be, a as Ne } from "./textarea-b2QvVhrK.js";
|
|
20
20
|
import { L as Ae } from "./label-KaP7MRrs.js";
|
|
21
21
|
import { g as Ie } from "./html-to-json-pdHQfRkN.js";
|
|
22
22
|
import "@radix-ui/react-accordion";
|
|
@@ -43,8 +43,8 @@ import "tailwind-merge";
|
|
|
43
43
|
import "@radix-ui/react-label";
|
|
44
44
|
import "himalaya";
|
|
45
45
|
const Le = ({ block: s }) => {
|
|
46
|
-
const { type: r, icon: o, label: a } = s, { addCoreBlock: i, addPredefinedBlock: d } = F(), [m] =
|
|
47
|
-
R(s, "blocks") ? d(
|
|
46
|
+
const { type: r, icon: o, label: a } = s, { addCoreBlock: i, addPredefinedBlock: d } = F(), [m] = C(), [, n] = h(z), [, t] = h(B), f = () => {
|
|
47
|
+
R(s, "blocks") ? d(G(s.blocks), b(m)) : i(s, b(m)), t(!1), n("layers");
|
|
48
48
|
}, [, x, u] = _(() => ({
|
|
49
49
|
type: "CHAI_BLOCK",
|
|
50
50
|
item: s
|
|
@@ -76,7 +76,7 @@ const Le = ({ block: s }) => {
|
|
|
76
76
|
] });
|
|
77
77
|
}, Pe = ({ block: s, closePopover: r }) => {
|
|
78
78
|
var u;
|
|
79
|
-
const [o, a] = j(!1), i = ie("getExternalPredefinedBlock"), { addCoreBlock: d, addPredefinedBlock: m } = F(), [n] =
|
|
79
|
+
const [o, a] = j(!1), i = ie("getExternalPredefinedBlock"), { addCoreBlock: d, addPredefinedBlock: m } = F(), [n] = C(), [, t, f] = _(
|
|
80
80
|
() => ({
|
|
81
81
|
type: "CHAI_BLOCK",
|
|
82
82
|
item: s
|
|
@@ -90,7 +90,7 @@ const Le = ({ block: s }) => {
|
|
|
90
90
|
}
|
|
91
91
|
a(!0);
|
|
92
92
|
const l = await i(s);
|
|
93
|
-
|
|
93
|
+
T(l) || m(G(l), b(n)), r();
|
|
94
94
|
},
|
|
95
95
|
[s]
|
|
96
96
|
);
|
|
@@ -121,10 +121,10 @@ const Le = ({ block: s }) => {
|
|
|
121
121
|
)
|
|
122
122
|
] });
|
|
123
123
|
}, Fe = () => {
|
|
124
|
-
const { data: s, isLoading: r } =
|
|
124
|
+
const { data: s, isLoading: r } = D(), o = U(), a = w(k(o), { category: "custom" }), i = I(a, "group"), d = I(s, "group"), [m, n] = j(null), t = q(() => $(i, d, (l, p) => {
|
|
125
125
|
if (H(l) && H(p))
|
|
126
126
|
return [...l, ...p];
|
|
127
|
-
}), [i, d]), [, f] = h(
|
|
127
|
+
}), [i, d]), [, f] = h(B), [x, u] = j("Navbar"), g = J(t, x, []);
|
|
128
128
|
return /* @__PURE__ */ e.jsxs("div", { className: "relative flex h-full max-h-full overflow-hidden py-2", children: [
|
|
129
129
|
/* @__PURE__ */ e.jsx("ul", { className: "sticky top-0 h-full w-48 space-y-1 overflow-y-auto border-r px-2", children: r ? /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
130
130
|
/* @__PURE__ */ e.jsx("li", { className: "h-8 w-full animate-pulse bg-gray-200" }),
|
|
@@ -133,7 +133,7 @@ const Le = ({ block: s }) => {
|
|
|
133
133
|
/* @__PURE__ */ e.jsx("li", { className: "mt-2 h-8 w-full animate-pulse bg-gray-200" }),
|
|
134
134
|
/* @__PURE__ */ e.jsx("li", { className: "mt-2 h-8 w-full animate-pulse bg-gray-200" }),
|
|
135
135
|
/* @__PURE__ */ e.jsx("li", { className: "mt-2 h-8 w-full animate-pulse bg-gray-200" })
|
|
136
|
-
] }) :
|
|
136
|
+
] }) : v.Children.toArray(
|
|
137
137
|
L(t, (l, p) => /* @__PURE__ */ e.jsx(
|
|
138
138
|
"li",
|
|
139
139
|
{
|
|
@@ -155,12 +155,12 @@ const Le = ({ block: s }) => {
|
|
|
155
155
|
}
|
|
156
156
|
))
|
|
157
157
|
) }),
|
|
158
|
-
/* @__PURE__ */ e.jsx("div", { className: "h-full w-full space-y-2 overflow-y-auto px-8", children:
|
|
158
|
+
/* @__PURE__ */ e.jsx("div", { className: "h-full w-full space-y-2 overflow-y-auto px-8", children: v.Children.toArray(
|
|
159
159
|
g.map((l) => /* @__PURE__ */ e.jsx(Pe, { block: l, closePopover: () => f(!1) }))
|
|
160
160
|
) })
|
|
161
161
|
] });
|
|
162
162
|
}, He = () => {
|
|
163
|
-
const [s, r] = j(""), { addPredefinedBlock: o } = F(), [a] =
|
|
163
|
+
const [s, r] = j(""), { addPredefinedBlock: o } = F(), [a] = C(), [, i] = h(xe), [, d] = h(z), [, m] = h(B), n = () => {
|
|
164
164
|
const t = Ie(s);
|
|
165
165
|
o([...t], b(a) || null), r(""), i(!1), d("layers"), m(!1);
|
|
166
166
|
};
|
|
@@ -169,10 +169,10 @@ const Le = ({ block: s }) => {
|
|
|
169
169
|
/* @__PURE__ */ e.jsx(we, { children: "Import HTML" }),
|
|
170
170
|
/* @__PURE__ */ e.jsx(ke, { 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." })
|
|
171
171
|
] }),
|
|
172
|
-
/* @__PURE__ */ e.jsx(
|
|
172
|
+
/* @__PURE__ */ e.jsx(Te, { className: "space-y-2 px-3 py-0", children: /* @__PURE__ */ e.jsxs("div", { className: "space-y-1", children: [
|
|
173
173
|
/* @__PURE__ */ e.jsx(Ae, { htmlFor: "current", className: "text-sm", children: "Enter HTML Code:" }),
|
|
174
174
|
/* @__PURE__ */ e.jsx(
|
|
175
|
-
|
|
175
|
+
ve,
|
|
176
176
|
{
|
|
177
177
|
autoFocus: !0,
|
|
178
178
|
tabIndex: 1,
|
|
@@ -187,9 +187,9 @@ const Le = ({ block: s }) => {
|
|
|
187
187
|
}
|
|
188
188
|
)
|
|
189
189
|
] }) }),
|
|
190
|
-
/* @__PURE__ */ e.jsxs(
|
|
190
|
+
/* @__PURE__ */ e.jsxs(Ce, { className: "flex flex-col justify-end p-3", children: [
|
|
191
191
|
/* @__PURE__ */ e.jsx(ne, { disabled: s.trim() === "", onClick: () => n(), size: "sm", className: "w-full", children: "Import" }),
|
|
192
|
-
/* @__PURE__ */ e.jsxs(
|
|
192
|
+
/* @__PURE__ */ e.jsxs(Be, { variant: "default", className: "mt-2 p-1 text-blue-400", children: [
|
|
193
193
|
/* @__PURE__ */ e.jsx(ue, { className: "h-4 w-4" }),
|
|
194
194
|
/* @__PURE__ */ e.jsx(Ne, { 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." })
|
|
195
195
|
] })
|
|
@@ -200,15 +200,15 @@ const Le = ({ block: s }) => {
|
|
|
200
200
|
return !P(S, r);
|
|
201
201
|
const o = s._type;
|
|
202
202
|
return o === "List" ? r === "ListItem" : o === "Table" ? r === "TableHead" || r === "TableBody" : o === "TableHead" || o === "TableBody" ? r === "TableRow" : o === "TableRow" ? r === "TableCell" : o === "Row" ? r === "Column" : !P(S, r);
|
|
203
|
-
},
|
|
204
|
-
const [s, r] = j("core"), [o, a] = j("basic"), i =
|
|
203
|
+
}, Bs = () => {
|
|
204
|
+
const [s, r] = j("core"), [o, a] = j("basic"), i = U(), [, d] = h(he), [, m] = h(B), [n] = C(), t = be(), f = M(t, { _id: b(n) }), { data: x, isLoading: u } = D(), g = I(
|
|
205
205
|
w(i, (c) => Ee(f, c.type)),
|
|
206
206
|
"category"
|
|
207
207
|
), l = X(L(g.core, "group"));
|
|
208
|
-
|
|
209
|
-
!P(l, o) && !
|
|
208
|
+
Q(() => {
|
|
209
|
+
!P(l, o) && !T(l) && !T(o) && a(b(l));
|
|
210
210
|
}, [l, o]);
|
|
211
|
-
const p = (c) => a((N) => N === c ? "" : c), y = !u && !
|
|
211
|
+
const p = (c) => a((N) => N === c ? "" : c), y = !u && !T(x) || M(k(i), { category: "custom" }) !== void 0;
|
|
212
212
|
return /* @__PURE__ */ e.jsxs("div", { className: "flex h-full flex-col overflow-hidden", children: [
|
|
213
213
|
/* @__PURE__ */ e.jsxs("div", { className: "mb-2 flex justify-between rounded-md bg-background/30 p-1", children: [
|
|
214
214
|
/* @__PURE__ */ e.jsxs("h1", { className: "flex flex-col items-baseline px-1 text-2xl font-semibold xl:flex-row", children: [
|
|
@@ -242,23 +242,23 @@ const Le = ({ block: s }) => {
|
|
|
242
242
|
] })
|
|
243
243
|
}
|
|
244
244
|
),
|
|
245
|
-
s === "core" && /* @__PURE__ */ e.jsx(re, { className: "-mx-1.5 h-full", children: /* @__PURE__ */ e.jsx(Y, { type: "single", value: o, className: "w-full px-3", children:
|
|
245
|
+
s === "core" && /* @__PURE__ */ e.jsx(re, { className: "-mx-1.5 h-full", children: /* @__PURE__ */ e.jsx(Y, { type: "single", value: o, className: "w-full px-3", children: v.Children.toArray(
|
|
246
246
|
L(
|
|
247
247
|
l,
|
|
248
248
|
(c) => E(w(k(g.core), { group: c }), {
|
|
249
249
|
hidden: !0
|
|
250
250
|
}).length ? /* @__PURE__ */ e.jsxs(Z, { value: c, className: "border-border", children: [
|
|
251
251
|
/* @__PURE__ */ e.jsx(ee, { onClick: () => p(c), className: "py-2 capitalize", children: c }),
|
|
252
|
-
/* @__PURE__ */ e.jsx(se, { children: /* @__PURE__ */ e.jsx("div", { className: "grid grid-cols-4 gap-2", children:
|
|
252
|
+
/* @__PURE__ */ e.jsx(se, { children: /* @__PURE__ */ e.jsx("div", { className: "grid grid-cols-4 gap-2", children: v.Children.toArray(
|
|
253
253
|
E(w(k(g.core), { group: c }), { hidden: !0 }).map((N) => /* @__PURE__ */ e.jsx(Le, { block: N }))
|
|
254
254
|
) }) })
|
|
255
255
|
] }) : null
|
|
256
256
|
)
|
|
257
257
|
) }) }),
|
|
258
|
-
s === "ui-blocks" && /* @__PURE__ */ e.jsx(
|
|
258
|
+
s === "ui-blocks" && /* @__PURE__ */ e.jsx(W, { fallback: /* @__PURE__ */ e.jsx(de, { className: "h-32 w-full" }), children: /* @__PURE__ */ e.jsx(Fe, {}) }),
|
|
259
259
|
s === "html" && /* @__PURE__ */ e.jsx(Me, {})
|
|
260
260
|
] });
|
|
261
261
|
};
|
|
262
262
|
export {
|
|
263
|
-
|
|
263
|
+
Bs as default
|
|
264
264
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./jsx-runtime-JYMCiFoE.cjs"),O=require("react"),C=require("@rjsf/validator-ajv8"),B=require("@rjsf/core"),j=require("./ChaiBuilderEditor-BoE-sArB.cjs");require("react-i18next");const R=require("./skeleton-JHP9zwL2.cjs"),e=require("./controls-W97-POR_.cjs"),k=require("lodash");require("./MODIFIERS-Fx6WAZcw.cjs");require("clsx");require("@radix-ui/react-scroll-area");require("react-dom");require("@floating-ui/react-dom");require("jotai");require("i18next");require("flagged");require("react-dnd");require("@minoru/react-dnd-treeview");require("./utils-qK_SjzzV.cjs");require("tailwind-merge");require("react-hotkeys-hook");require("flat-to-nested");require("./functions-uw7QP2kT.cjs");require("redux-undo");require("@react-hookz/web");require("./index-HAue58ea.cjs");require("@radix-ui/react-slot");require("class-variance-authority");require("@radix-ui/react-tooltip");require("@radix-ui/react-icons");require("@radix-ui/react-toast");function P(i){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(i){for(const a in i)if(a!=="default"){const r=Object.getOwnPropertyDescriptor(i,a);Object.defineProperty(t,a,r.get?r:{enumerable:!0,get:()=>i[a]})}}return t.default=i,Object.freeze(t)}const c=P(O),v=[{title:"Roboto",value:"Roboto"},{title:"Open Sans",value:"Open Sans"},{title:"Montserrat",value:"Montserrat"},{title:"Lato",value:"Lato"},{title:"Poppins",value:"Poppins"},{title:"Oswald",value:"Oswald"},{title:"Raleway",value:"Raleway"},{title:"Ubuntu",value:"Ubuntu"},{title:"Nunito",value:"Nunito"},{title:"Merriweather",value:"Merriweather"},{title:"Nunito Sans",value:"Nunito Sans"},{title:"Playfair Display",value:"Playfair Display"},{title:"Rubik",value:"Rubik"},{title:"Inter",value:"Inter"},{title:"Lora",value:"Lora"},{title:"Kanit",value:"Kanit"},{title:"Fira Sans",value:"Fira Sans"},{title:"Hind",value:"Hind"},{title:"Quicksand",value:"Quicksand"},{title:"Mulish",value:"Mulish"},{title:"Barlow",value:"Barlow"},{title:"Inconsolata",value:"Inconsolata"},{title:"Titillium Web",value:"Titillium Web"},{title:"Heebo",value:"Heebo"},{title:"IBM Plex Sans",value:"IBM Plex Sans"},{title:"DM Sans",value:"DM Sans"},{title:"Nanum Gothic",value:"Nanum Gothic"},{title:"Karla",value:"Karla"},{title:"Arimo",value:"Arimo"},{title:"Cabin",value:"Cabin"},{title:"Oxygen",value:"Oxygen"},{title:"Overpass",value:"Overpass"},{title:"Assistant",value:"Assistant"},{title:"Tajawal",value:"Tajawal"},{title:"Play",value:"Play"},{title:"Exo",value:"Exo"},{title:"Cinzel",value:"Cinzel"},{title:"Faustina",value:"Faustina"},{title:"Philosopher",value:"Philosopher"},{title:"Gelasio",value:"Gelasio"},{title:"Sofia Sans Condensed",value:"Sofia Sans Condensed"},{title:"Noto Sans Devanagari",value:"Noto Sans Devanagari"},{title:"Actor",value:"Actor"},{title:"Epilogue",value:"Epilogue"},{title:"Glegoo",value:"Glegoo"},{title:"Overlock",value:"Overlock"},{title:"Lustria",value:"Lustria"},{title:"Ovo",value:"Ovo"},{title:"Suranna",value:"Suranna"}],D=()=>{const i=R.useBuilderProp("onSaveBrandingOptions",async()=>{}),[t,a]=j.useBrandingOptions(),r=c.useRef(t);c.useEffect(()=>()=>{k.isEqual(t,r.current)||i(r.current)},[]);const p=({formData:l},u)=>{u&&(a(l),r.current=l)},{bodyFont:y,headingFont:f,primaryColor:g,bodyTextDarkColor:b,bodyTextLightColor:m,bodyBgDarkColor:h,secondaryColor:q,bodyBgLightColor:x,roundedCorners:S}=t,s={headingFont:e.f({title:"Heading font",default:f,options:v}),bodyFont:e.f({title:"Body font",default:y,options:v}),roundedCorners:e.c({title:"Rounded Corner",default:parseInt(S||5,10)}),primaryColor:e.y({title:"Primary",default:g}),secondaryColor:e.y({title:"Secondary",default:q}),bodyBgLightColor:e.y({title:"Body Background (Light)",default:x}),bodyBgDarkColor:e.y({title:"Body Background (Dark)",default:h}),bodyTextLightColor:e.y({title:"Body Text (Light)",default:b}),bodyTextDarkColor:e.y({title:"Body Text (Dark)",default:m})},n={type:"object",properties:{}},d={};return Object.keys(s).forEach(l=>{const u=s[l];return n.properties||(n.properties={}),n.properties[l]=u.schema,d[l]=u.uiSchema,!0}),o.jsxRuntimeExports.jsxs("div",{className:"flex h-full select-none flex-col",children:[o.jsxRuntimeExports.jsx("div",{className:"rounded-md bg-background/30 p-1",children:o.jsxRuntimeExports.jsx("h1",{className:"px-1 font-semibold",children:"Branding Options"})}),o.jsxRuntimeExports.jsx("div",{className:"-mx-2",children:o.jsxRuntimeExports.jsx(B,{idSeparator:".",autoComplete:"off",omitExtraData:!0,liveOmit:!0,liveValidate:!0,uiSchema:d,schema:n,formData:t,validator:C,onChange:p})})]})};exports.default=D;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { j as a } from "./jsx-runtime-Sp0orL4X.js";
|
|
2
2
|
import * as s from "react";
|
|
3
|
-
import
|
|
3
|
+
import O from "@rjsf/validator-ajv8";
|
|
4
4
|
import k from "@rjsf/core";
|
|
5
|
-
import { j
|
|
5
|
+
import { j } from "./ChaiBuilderEditor-hEuUONQ3.js";
|
|
6
6
|
import "react-i18next";
|
|
7
|
-
import { u as
|
|
8
|
-
import {
|
|
7
|
+
import { u as D } from "./skeleton-CU_FIbg3.js";
|
|
8
|
+
import { f as p, c as N, y as e } from "./controls-enQY7NI8.js";
|
|
9
9
|
import { isEqual as P } from "lodash";
|
|
10
10
|
import "./MODIFIERS-DsEzQ3aH.js";
|
|
11
11
|
import "clsx";
|
|
@@ -24,6 +24,7 @@ import "flat-to-nested";
|
|
|
24
24
|
import "./functions-pcUZhFJM.js";
|
|
25
25
|
import "redux-undo";
|
|
26
26
|
import "@react-hookz/web";
|
|
27
|
+
import "./index-ehKdBRUK.js";
|
|
27
28
|
import "@radix-ui/react-slot";
|
|
28
29
|
import "class-variance-authority";
|
|
29
30
|
import "@radix-ui/react-tooltip";
|
|
@@ -79,9 +80,9 @@ const d = [
|
|
|
79
80
|
{ title: "Lustria", value: "Lustria" },
|
|
80
81
|
{ title: "Ovo", value: "Ovo" },
|
|
81
82
|
{ title: "Suranna", value: "Suranna" }
|
|
82
|
-
],
|
|
83
|
-
const m =
|
|
84
|
-
}), [o, v] =
|
|
83
|
+
], nt = () => {
|
|
84
|
+
const m = D("onSaveBrandingOptions", async () => {
|
|
85
|
+
}), [o, v] = j(), r = s.useRef(o);
|
|
85
86
|
s.useEffect(() => () => {
|
|
86
87
|
P(o, r.current) || m(r.current);
|
|
87
88
|
}, []);
|
|
@@ -96,7 +97,7 @@ const d = [
|
|
|
96
97
|
bodyBgDarkColor: S,
|
|
97
98
|
secondaryColor: x,
|
|
98
99
|
bodyBgLightColor: C,
|
|
99
|
-
roundedCorners:
|
|
100
|
+
roundedCorners: B
|
|
100
101
|
} = o, n = {
|
|
101
102
|
headingFont: p({
|
|
102
103
|
title: "Heading font",
|
|
@@ -108,9 +109,9 @@ const d = [
|
|
|
108
109
|
default: f,
|
|
109
110
|
options: d
|
|
110
111
|
}),
|
|
111
|
-
roundedCorners:
|
|
112
|
+
roundedCorners: N({
|
|
112
113
|
title: "Rounded Corner",
|
|
113
|
-
default: parseInt(
|
|
114
|
+
default: parseInt(B || 5, 10)
|
|
114
115
|
}),
|
|
115
116
|
primaryColor: e({ title: "Primary", default: y }),
|
|
116
117
|
secondaryColor: e({ title: "Secondary", default: x }),
|
|
@@ -151,12 +152,12 @@ const d = [
|
|
|
151
152
|
uiSchema: u,
|
|
152
153
|
schema: i,
|
|
153
154
|
formData: o,
|
|
154
|
-
validator:
|
|
155
|
+
validator: O,
|
|
155
156
|
onChange: c
|
|
156
157
|
}
|
|
157
158
|
) })
|
|
158
159
|
] });
|
|
159
160
|
};
|
|
160
161
|
export {
|
|
161
|
-
|
|
162
|
+
nt as default
|
|
162
163
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";var $e=Object.defineProperty;var Ue=(n,t,s)=>t in n?$e(n,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):n[t]=s;var z=(n,t,s)=>(Ue(n,typeof t!="symbol"?t+"":t,s),s);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-JYMCiFoE.cjs"),x=require("react"),u=require("lodash"),M=require("@radix-ui/react-icons"),K=require("./skeleton-JHP9zwL2.cjs"),h=require("./ChaiBuilderEditor-
|
|
1
|
+
"use strict";var $e=Object.defineProperty;var Ue=(n,t,s)=>t in n?$e(n,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):n[t]=s;var z=(n,t,s)=>(Ue(n,typeof t!="symbol"?t+"":t,s),s);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-JYMCiFoE.cjs"),x=require("react"),u=require("lodash"),M=require("@radix-ui/react-icons"),K=require("./skeleton-JHP9zwL2.cjs"),h=require("./ChaiBuilderEditor-BoE-sArB.cjs"),Se=require("react-i18next"),Q=require("./separator-3Civ-6hb.cjs"),G=require("./useDarkMode-dV6FM6l-.cjs"),L=require("./dropdown-menu-sMXR59cB.cjs"),He=require("./label-tFm8HZdb.cjs"),ee=require("./useFeatureSupport-c9IgPW2t.cjs"),$=require("./alert-dialog-Mv0-wAvS.cjs"),X=require("jotai"),ze=require("@floating-ui/dom"),me=require("@floating-ui/react-dom"),Ke=require("react-dnd"),te=require("./useAllBlocks-6hvuNuyw.cjs"),Ye=require("@react-hookz/web"),Ve=require("@bobthered/tailwindcss-palette-generator"),Xe=require("react-wrap-balancer"),Ze=require("tailwind-merge"),Z=require("./MODIFIERS-Fx6WAZcw.cjs"),Ce=require("./index-HAue58ea.cjs"),Te=require("./useChaiExternalData-DkyBJ81C.cjs"),ye=require("react-dom");require("@radix-ui/react-slot");require("class-variance-authority");require("./utils-qK_SjzzV.cjs");require("clsx");require("@radix-ui/react-tooltip");require("@radix-ui/react-toast");require("@radix-ui/react-scroll-area");require("i18next");require("flagged");require("@minoru/react-dnd-treeview");require("react-hotkeys-hook");require("flat-to-nested");require("./functions-uw7QP2kT.cjs");require("redux-undo");require("@radix-ui/react-separator");require("@radix-ui/react-switch");require("@radix-ui/react-hover-card");require("@radix-ui/react-dropdown-menu");require("@radix-ui/react-label");require("@radix-ui/react-alert-dialog");const Ge=()=>x.useMemo(()=>Ce.A(),[]),Je=({children:n})=>{const[,t]=Te.useChaiExternalData(),[s]=h.usePageDataProviders(),a=Ge();return x.useEffect(()=>(t({}),u.each(s,l=>{const r=u.find(a,{providerKey:l.providerKey});if(r){const i=(r==null?void 0:r.mockFn)||(r==null?void 0:r.dataFn);i&&i(l.args).then(d=>t(v=>({...v,[l.providerKey]:d})))}}),()=>{u.each(s,l=>{t(r=>(delete r[l.providerKey],r))})}),[a,s,t]),e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:n})},Qe=()=>{const{undoCount:n,redoCount:t,undo:s,redo:a}=h.useCanvasHistory();return e.jsxRuntimeExports.jsxs("div",{className:"flex items-center",children:[e.jsxRuntimeExports.jsx(K.Button,{disabled:!n,size:"sm",onClick:s,className:"rounded-full",variant:"ghost",children:e.jsxRuntimeExports.jsx(M.ResetIcon,{})}),e.jsxRuntimeExports.jsx(K.Button,{disabled:!t,onClick:a,size:"sm",className:"rounded-full",variant:"ghost",children:e.jsxRuntimeExports.jsx(M.ResetIcon,{className:"rotate-180 scale-y-[-1] transform"})})]})};function et(){const[n,t]=G.useDarkMode(),{t:s}=Se.useTranslation();return e.jsxRuntimeExports.jsxs("div",{className:"flex items-center",children:[e.jsxRuntimeExports.jsx(He.Label,{htmlFor:"dark-mode-switch",children:s("dark_mode")}),e.jsxRuntimeExports.jsxs(L.Switch,{id:"dark-mode-switch",checked:n,onCheckedChange:()=>{t(!n)},className:`${n?"bg-violet-600":"bg-violet-300"}
|
|
2
2
|
relative ml-2 inline-flex h-[20px] w-[40px] shrink-0 cursor-pointer rounded-full border-2 border-transparent transition-colors duration-200 ease-in-out focus:outline-none focus-visible:ring-2 focus-visible:ring-white focus-visible:ring-opacity-75`,children:[e.jsxRuntimeExports.jsx("span",{className:"sr-only",children:"Use setting"}),e.jsxRuntimeExports.jsx("span",{"aria-hidden":"true",className:`${n?"translate-x-5":"translate-x-0"}
|
|
3
3
|
pointer-events-none -mt-px inline-block h-[18px] w-[20px] transform rounded-full bg-white shadow-lg ring-0 transition duration-200 ease-in-out`})]})]})}const ge=({landscape:n=!1})=>e.jsxRuntimeExports.jsxs("svg",{className:n?"rotate-90":"",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 13 13",xmlSpace:"preserve",width:13,height:13,children:[e.jsxRuntimeExports.jsx("g",{strokeWidth:0}),e.jsxRuntimeExports.jsx("g",{strokeLinecap:"round",strokeLinejoin:"round"}),e.jsxRuntimeExports.jsx("path",{d:"M10.65 0H2.349a.851.851 0 0 0-.851.852v11.299c0 .47.382.852.851.852h8.3a.851.851 0 0 0 .851-.852V.852A.851.851 0 0 0 10.65 0zM6.599 12.466a.367.367 0 1 1 0-.735.367.367 0 0 1 0 .735zm3.9-1.267H2.5V1h8.001v10.199z",style:{fill:"#000"}})]}),ve=[{title:"Mobile (XS)",content:"Styles set here are applied to all screen unless edited at higher breakpoint",breakpoint:"xs",icon:e.jsxRuntimeExports.jsx(M.MobileIcon,{}),width:400},{title:"Mobile landscape (SM)",content:"Styles set here are applied at 640px and up unless edited at higher breakpoint",breakpoint:"sm",icon:e.jsxRuntimeExports.jsx(M.MobileIcon,{className:"rotate-90"}),width:640},{title:"Tablet (MD)",content:"Styles set here are applied at 768px and up",breakpoint:"md",icon:e.jsxRuntimeExports.jsx(ge,{}),width:800},{title:"Tablet Landscape (LG)",content:"Styles set here are applied at 1024px and up unless edited at higher breakpoint",breakpoint:"lg",icon:e.jsxRuntimeExports.jsx(ge,{landscape:!0}),width:1024},{title:"Desktop (XL)",content:"Styles set here are applied at 1280px and up unless edited at higher breakpoint",breakpoint:"xl",icon:e.jsxRuntimeExports.jsx(M.LaptopIcon,{}),width:1420},{title:"Large Desktop (2XL)",content:"Styles set here are applied at 1536px and up",breakpoint:"2xl",icon:e.jsxRuntimeExports.jsx(M.DesktopIcon,{}),width:1920}],tt=({title:n,content:t,currentBreakpoint:s,breakpoint:a,width:l,icon:r,onClick:i})=>e.jsxRuntimeExports.jsxs(L.HoverCard,{children:[e.jsxRuntimeExports.jsx(L.HoverCardTrigger,{asChild:!0,children:e.jsxRuntimeExports.jsx(K.Button,{onClick:()=>i(l),size:"sm",variant:a===s?"secondary":"ghost",children:r})}),e.jsxRuntimeExports.jsx(L.HoverCardContent,{className:"w-52 border-border",children:e.jsxRuntimeExports.jsx("div",{className:"flex justify-between space-x-4",children:e.jsxRuntimeExports.jsxs("div",{className:"space-y-1",children:[e.jsxRuntimeExports.jsx("h4",{className:"text-sm font-semibold",children:n}),e.jsxRuntimeExports.jsx("p",{className:"text-xs",children:t})]})})})]}),nt=()=>{const[,n,t]=G.useCanvasWidth(),[s,a]=ee.useSelectedBreakpoints(),l=r=>{s.includes(r)?s.length>2&&a(s.filter(i=>i!==r)):a(i=>[...i,r])};return e.jsxRuntimeExports.jsxs("div",{className:"flex items-center rounded-md",children:[u.map(ve.filter(r=>u.includes(s,u.toUpper(r.breakpoint))),r=>x.createElement(tt,{...r,onClick:t,key:r.breakpoint,currentBreakpoint:n})),e.jsxRuntimeExports.jsxs(L.DropdownMenu,{children:[e.jsxRuntimeExports.jsx(L.DropdownMenuTrigger,{asChild:!0,children:e.jsxRuntimeExports.jsx("span",{className:"cursor-pointer px-2.5 hover:opacity-80",children:e.jsxRuntimeExports.jsx(M.DotsVerticalIcon,{className:"scale-90 transform"})})}),e.jsxRuntimeExports.jsxs(L.DropdownMenuContent,{className:"w-56 border-border text-xs",children:[e.jsxRuntimeExports.jsx(L.DropdownMenuLabel,{children:"Breakpoints"}),e.jsxRuntimeExports.jsx(L.DropdownMenuSeparator,{}),u.map(ve,r=>e.jsxRuntimeExports.jsx(L.DropdownMenuCheckboxItem,{disabled:r.breakpoint==="xs",onCheckedChange:()=>l(u.toUpper(r.breakpoint)),checked:u.includes(s,u.toUpper(r.breakpoint)),children:r.title},r.breakpoint))]})]})]})},st=()=>{const[n]=h.useSetAllBlocks(),{createSnapshot:t}=h.useCanvasHistory(),[,s]=h.useSelectedBlockIds(),[,a]=h.useSelectedStylingBlocks(),l=x.useCallback(()=>{n([]),s([]),a([]),t()},[n,t]);return e.jsxRuntimeExports.jsx("div",{className:"flex items-center",children:e.jsxRuntimeExports.jsxs($.AlertDialog,{children:[e.jsxRuntimeExports.jsx($.AlertDialogTrigger,{asChild:!0,children:e.jsxRuntimeExports.jsxs(K.Button,{size:"sm",variant:"ghost",className:"flex items-center gap-x-1",children:[e.jsxRuntimeExports.jsx(M.EraserIcon,{})," Clear"]})}),e.jsxRuntimeExports.jsxs($.AlertDialogContent,{className:"border-border",children:[e.jsxRuntimeExports.jsxs($.AlertDialogHeader,{children:[e.jsxRuntimeExports.jsx($.AlertDialogTitle,{children:"Clear whole canvas?"}),e.jsxRuntimeExports.jsx($.AlertDialogDescription,{children:"Are you sure you want to clear the whole canvas?"})]}),e.jsxRuntimeExports.jsxs($.AlertDialogFooter,{children:[e.jsxRuntimeExports.jsx($.AlertDialogCancel,{children:"Cancel"}),e.jsxRuntimeExports.jsx($.AlertDialogAction,{onClick:l,children:"Yes"})]})]})]})})},rt=()=>{const n=ee.useFeatureSupport("darkMode",!1),[t]=ee.useCanvasZoom();return e.jsxRuntimeExports.jsxs("div",{className:"flex h-10 items-center justify-between border-b bg-background/70 px-2",children:[e.jsxRuntimeExports.jsxs("div",{className:"flex h-full space-x-2",children:[n?e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx(et,{}),e.jsxRuntimeExports.jsx(Q.Separator,{orientation:"vertical"})]}):null,e.jsxRuntimeExports.jsx(nt,{}),e.jsxRuntimeExports.jsx(Q.Separator,{orientation:"vertical"}),e.jsxRuntimeExports.jsxs("div",{className:"flex w-12 items-center justify-center gap-x-1 space-x-0 font-medium",children:[e.jsxRuntimeExports.jsx(M.ZoomInIcon,{className:"h-3.5 w-3.5 flex-shrink-0"})," ",e.jsxRuntimeExports.jsxs("div",{className:"text-xs leading-3",children:[u.round(t,0),"%"]})]}),e.jsxRuntimeExports.jsx(Q.Separator,{orientation:"vertical"}),e.jsxRuntimeExports.jsx(Qe,{})]}),e.jsxRuntimeExports.jsxs("div",{className:"flex h-full items-center space-x-2",children:[e.jsxRuntimeExports.jsx(Q.Separator,{orientation:"vertical"}),e.jsxRuntimeExports.jsx(st,{})]})]})},ot=`<!doctype html>
|
|
4
4
|
<html class="scroll-smooth h-full overflow-y-auto">
|
|
@@ -43,4 +43,4 @@ Valid keys: `+JSON.stringify(Object.keys(o),null," "));var P=_(b,I,y,C,j+"."+I,
|
|
|
43
43
|
outline: 1px solid ${s.length===1?"#42a1fc":"orange"} !important; outline-offset: -1px;
|
|
44
44
|
}`)},[s,R]),x.useEffect(()=>{v&&(v.textContent=l?`[data-style-id="${l}"]{ outline: 1px solid orange !important; outline-offset: -1px;}`:"")},[l,s,v]),x.useEffect(()=>{f&&(f.textContent=`${u.map(r,({id:S})=>`[data-style-id="${S}"]`).join(",")}{
|
|
45
45
|
outline: 1px solid orange !important; outline-offset: -1px;
|
|
46
|
-
}`)},[r,f]),x.useEffect(()=>{if(n==="section")return;const S=u.get(t,"bodyTextLightColor","#64748b"),O=u.get(t,"bodyTextDarkColor","#94a3b8"),w=u.get(t,"bodyBgLightColor","#FFFFFF"),D=u.get(t,"bodyBgDarkColor","#0f172a");i.body.className=`font-body antialiased text-[${S}] bg-[${w}] dark:text-[${O}] dark:bg-[${D}]`},[t,i,n]),n==="page"?e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[p&&e.jsxRuntimeExports.jsx("link",{id:"heading-font",rel:"stylesheet",type:"text/css",href:`https://fonts.googleapis.com/css2?family=${p.replace(/ /g,"+")}:wght@300;400;500;600;700;800;900&display=swap`,media:"all"}),g&&p!==g&&e.jsxRuntimeExports.jsx("link",{id:"body-font",rel:"stylesheet",type:"text/css",href:`https://fonts.googleapis.com/css2?family=${g.replace(/ /g,"+")}:wght@300;400;500;600;700;800;900&display=swap`,media:"all"}),p&&e.jsxRuntimeExports.jsx("style",{children:`h1,h2,h3,h4,h5,h6{font-family: "${p}",ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";}`})]}):null},Et=()=>{const{t:n}=Se.useTranslation();return e.jsxRuntimeExports.jsx("div",{className:"my-auto py-24 text-center text-gray-600 dark:text-white",children:e.jsxRuntimeExports.jsx("h1",{className:"mb-10 text-4xl ",children:n("canvas_empty")})})},bt=n=>{const t={};return Object.keys(n).forEach(s=>{u.isString(n[s])&&n[s].startsWith(Z.SLOT_KEY)&&(t[s]=n[s].replace(Z.SLOT_KEY,"").split(","))}),t},Rt=u.memoize(n=>{const t=n.replace(Z.STYLES_KEY,"").split(",");return Ze.twMerge(t[0],t[1])});function kt(n,t){return u.get(n,`${t}_attrs`,{})}function wt(n,t,s,a){const l={};return Object.keys(n).forEach(r=>{if(u.isString(n[r])&&n[r].startsWith(Z.STYLES_KEY)){const i=Rt(n[r]);l[r]={className:i,"data-style-prop":r,"data-block-parent":n._id,"data-style-id":`${r}-${n._id}`,onMouseEnter:t,onMouseLeave:s,onClick:a,...kt(n,r)}}}),l}function St(n,t){const s=u.get(n,"_bindings",{});return u.isEmpty(s)?{...n}:(u.each(s,(a,l)=>{u.isString(a)&&u.get(t,a,null)&&(n[l]=u.get(t,a,null))}),n)}function pe({blocks:n}){const t=te.useAllBlocks(),[,s]=h.useHighlightBlockId(),[,a]=h.useSelectedStylingBlocks(),[,l]=h.useSelectedBlockIds(),r=x.useCallback(f=>{var g;const p=(g=f.currentTarget)==null?void 0:g.getAttribute("data-style-id");s(p||""),f.stopPropagation()},[s]),i=x.useCallback(f=>{s(""),f.stopPropagation()},[s]),d=x.useCallback(f=>{f.stopPropagation();const p=f.currentTarget;if(p.getAttribute("data-block-parent")){const g=p.getAttribute("data-style-prop"),S=p.getAttribute("data-style-id"),O=p.getAttribute("data-block-parent");a([{id:S,prop:g,blockId:O}]),l([O])}else if(p.getAttribute("data-block-id")&&(l([p.getAttribute("data-block-id")]),p.getAttribute("data-block-parent"))){const g=p.getAttribute("data-style-prop"),S=p.getAttribute("data-style-id"),O=p.getAttribute("data-block-parent");a([{id:S,prop:g,blockId:O}])}},[a,l]),v=x.useCallback(f=>wt(f,r,i,d),[d,r,i]),[R]=Te.useChaiExternalData();return e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:x.Children.toArray(n.map((f,p)=>{const g=bt(f),S={};u.isEmpty(g)||Object.keys(g).forEach(m=>{S[m]=x.Children.toArray(g[m].map(U=>e.jsxRuntimeExports.jsx(pe,{blocks:[u.find(t,{_id:U})]})))});const O=u.filter(t,{_parent:f._id});S.children=O.length?e.jsxRuntimeExports.jsx(pe,{blocks:O}):null;const w=Ce.
|
|
46
|
+
}`)},[r,f]),x.useEffect(()=>{if(n==="section")return;const S=u.get(t,"bodyTextLightColor","#64748b"),O=u.get(t,"bodyTextDarkColor","#94a3b8"),w=u.get(t,"bodyBgLightColor","#FFFFFF"),D=u.get(t,"bodyBgDarkColor","#0f172a");i.body.className=`font-body antialiased text-[${S}] bg-[${w}] dark:text-[${O}] dark:bg-[${D}]`},[t,i,n]),n==="page"?e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[p&&e.jsxRuntimeExports.jsx("link",{id:"heading-font",rel:"stylesheet",type:"text/css",href:`https://fonts.googleapis.com/css2?family=${p.replace(/ /g,"+")}:wght@300;400;500;600;700;800;900&display=swap`,media:"all"}),g&&p!==g&&e.jsxRuntimeExports.jsx("link",{id:"body-font",rel:"stylesheet",type:"text/css",href:`https://fonts.googleapis.com/css2?family=${g.replace(/ /g,"+")}:wght@300;400;500;600;700;800;900&display=swap`,media:"all"}),p&&e.jsxRuntimeExports.jsx("style",{children:`h1,h2,h3,h4,h5,h6{font-family: "${p}",ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";}`})]}):null},Et=()=>{const{t:n}=Se.useTranslation();return e.jsxRuntimeExports.jsx("div",{className:"my-auto py-24 text-center text-gray-600 dark:text-white",children:e.jsxRuntimeExports.jsx("h1",{className:"mb-10 text-4xl ",children:n("canvas_empty")})})},bt=n=>{const t={};return Object.keys(n).forEach(s=>{u.isString(n[s])&&n[s].startsWith(Z.SLOT_KEY)&&(t[s]=n[s].replace(Z.SLOT_KEY,"").split(","))}),t},Rt=u.memoize(n=>{const t=n.replace(Z.STYLES_KEY,"").split(",");return Ze.twMerge(t[0],t[1])});function kt(n,t){return u.get(n,`${t}_attrs`,{})}function wt(n,t,s,a){const l={};return Object.keys(n).forEach(r=>{if(u.isString(n[r])&&n[r].startsWith(Z.STYLES_KEY)){const i=Rt(n[r]);l[r]={className:i,"data-style-prop":r,"data-block-parent":n._id,"data-style-id":`${r}-${n._id}`,onMouseEnter:t,onMouseLeave:s,onClick:a,...kt(n,r)}}}),l}function St(n,t){const s=u.get(n,"_bindings",{});return u.isEmpty(s)?{...n}:(u.each(s,(a,l)=>{u.isString(a)&&u.get(t,a,null)&&(n[l]=u.get(t,a,null))}),n)}function pe({blocks:n}){const t=te.useAllBlocks(),[,s]=h.useHighlightBlockId(),[,a]=h.useSelectedStylingBlocks(),[,l]=h.useSelectedBlockIds(),r=x.useCallback(f=>{var g;const p=(g=f.currentTarget)==null?void 0:g.getAttribute("data-style-id");s(p||""),f.stopPropagation()},[s]),i=x.useCallback(f=>{s(""),f.stopPropagation()},[s]),d=x.useCallback(f=>{f.stopPropagation();const p=f.currentTarget;if(p.getAttribute("data-block-parent")){const g=p.getAttribute("data-style-prop"),S=p.getAttribute("data-style-id"),O=p.getAttribute("data-block-parent");a([{id:S,prop:g,blockId:O}]),l([O])}else if(p.getAttribute("data-block-id")&&(l([p.getAttribute("data-block-id")]),p.getAttribute("data-block-parent"))){const g=p.getAttribute("data-style-prop"),S=p.getAttribute("data-style-id"),O=p.getAttribute("data-block-parent");a([{id:S,prop:g,blockId:O}])}},[a,l]),v=x.useCallback(f=>wt(f,r,i,d),[d,r,i]),[R]=Te.useChaiExternalData();return e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:x.Children.toArray(n.map((f,p)=>{const g=bt(f),S={};u.isEmpty(g)||Object.keys(g).forEach(m=>{S[m]=x.Children.toArray(g[m].map(U=>e.jsxRuntimeExports.jsx(pe,{blocks:[u.find(t,{_id:U})]})))});const O=u.filter(t,{_parent:f._id});S.children=O.length?e.jsxRuntimeExports.jsx(pe,{blocks:O}):null;const w=Ce.h(f._type),D=u.get(w,"component",null);return u.isNull(D)?e.jsxRuntimeExports.jsx("noscript",{children:`<!-- ${f==null?void 0:f._type} not registered -->`}):e.jsxRuntimeExports.jsx(x.Suspense,{children:x.createElement(D,{blockProps:{onClick:d,"data-block-id":f._id,"data-block-type":f._type},inBuilder:!0,index:p,...St(f,R),...v(f),...S})})}))})}const Ct=()=>{const n=te.useAllBlocks();return e.jsxRuntimeExports.jsx(Xe.Provider,{children:u.isEmpty(n)?e.jsxRuntimeExports.jsx(Et,{}):e.jsxRuntimeExports.jsx(Je,{children:e.jsxRuntimeExports.jsx(pe,{blocks:u.filter(n,t=>u.isEmpty(t._parent))})})})},Tt=(n,t)=>n.querySelector(`[data-style-id="${t}"]`),It=()=>{const[n]=X.useAtom(h.networkModeAtom),[t]=h.usePreviewMode(),[s]=G.useCanvasWidth(),[,a]=h.useSelectedBlockIds(),l=h.useSelectedBlock(),[,r]=h.useHighlightBlockId(),i=x.useRef(null),d=x.useRef(null),[v,R]=x.useState({width:0,height:0}),f=it(v),[p,g]=x.useState(0),[S,O]=x.useState([]),[,w]=x.useState([]),[,D]=X.useAtom(h.canvasIframeAtom),[m,U]=h.useSelectedStylingBlocks(),N=K.useBuilderProp("loadingCanvas",!1);x.useEffect(()=>{const{clientWidth:A,clientHeight:F}=d.current;R({width:A,height:F}),p===0&&g(A)},[d,s,p]);const ne=(A,F=0)=>{const{top:W}=A.getBoundingClientRect();return W+F>=0&&W-F<=window.innerHeight};x.useEffect(()=>{var A,F;if(l&&l.type!=="Multiple"&&i.current){const W=Pe(i.current.contentDocument,l._id);W&&(ne(W)||(F=(A=i.current)==null?void 0:A.contentWindow)==null||F.scrollTo({top:W.offsetTop,behavior:"smooth"}),O([W]))}},[l]),x.useEffect(()=>{if(!u.isEmpty(m)&&i.current){const A=Tt(i.current.contentDocument,u.first(m).id);w(A?[A]:[null])}else w([null])},[m]);const se=x.useMemo(()=>{let A=ot;return n==="offline"&&(A=A.replace("https://old.chaibuilder.com/offline/tailwind.cdn.js","/offline/tailwind.cdn.js"),A=A.replace("https://unpkg.com/aos@next/dist/aos.css","/offline/aos.css"),A=A.replace("https://unpkg.com/aos@next/dist/aos.js","/offline/aos.js")),A},[n]);return e.jsxRuntimeExports.jsx("div",{onClick:()=>{a([]),U([])},onMouseLeave:()=>setTimeout(()=>r(""),300),className:"relative mx-auto h-full w-full",style:p>0&&!u.isEmpty(f)?{width:t?"100%":p}:{},ref:d,children:e.jsxRuntimeExports.jsxs(ht,{contentDidMount:()=>D(i.current),ref:i,id:"canvas-iframe",style:{width:`${s}px`,...f},className:"relative mx-auto box-content h-full max-w-full shadow-md transition-all duration-300 ease-linear",initialContent:se,children:[e.jsxRuntimeExports.jsx(yt,{}),e.jsxRuntimeExports.jsx(vt,{block:l,selectedBlockElement:u.first(S)}),e.jsxRuntimeExports.jsx(jt,{model:"page"}),e.jsxRuntimeExports.jsxs(mt,{children:[N?e.jsxRuntimeExports.jsx("div",{className:"h-full p-4",children:e.jsxRuntimeExports.jsx(K.Skeleton,{className:"h-full"})}):e.jsxRuntimeExports.jsx(Ct,{}),e.jsxRuntimeExports.jsx("div",{className:"h-60"})]})]})})},Dt=x.lazy(()=>Promise.resolve().then(()=>require("./AddBlocks-7ACJv8LW.cjs"))),Bt=()=>{const[n,t]=X.useAtom(h.addBlocksModalAtom);return e.jsxRuntimeExports.jsxs("div",{className:"flex h-full w-full flex-col",children:[e.jsxRuntimeExports.jsx(rt,{}),e.jsxRuntimeExports.jsxs("div",{className:"relative flex-1 overflow-hidden bg-slate-800/80 px-2 bg-[linear-gradient(to_right,#EEE_0.5px,transparent_0.5px),linear-gradient(to_bottom,#EEE_0.5px,transparent_0.5px)] bg-[size:12px_12px]",children:[e.jsxRuntimeExports.jsx(x.Suspense,{fallback:e.jsxRuntimeExports.jsx(K.Skeleton,{className:"h-full"}),children:e.jsxRuntimeExports.jsx(h.ErrorBoundary,{children:e.jsxRuntimeExports.jsx(It,{})})}),n?e.jsxRuntimeExports.jsx("div",{onClick:()=>t(!1),className:"absolute inset-0 z-50 flex items-center bg-black/30 backdrop-blur-sm",children:e.jsxRuntimeExports.jsx("div",{onClick:s=>s.stopPropagation(),className:"mx-auto h-[90%] w-[90%] max-w-3xl rounded-md bg-white p-4 shadow-lg shadow-black/10 xl:w-[65%]",children:e.jsxRuntimeExports.jsx(Dt,{})})}):null]})]})};exports.default=Bt;
|
|
@@ -6,25 +6,25 @@ import z, { useMemo as Me, useEffect as R, createElement as ft, useCallback as V
|
|
|
6
6
|
import { each as ue, find as Fe, map as Q, includes as ke, toUpper as se, round as yt, isEmpty as q, first as ee, get as A, memoize as gt, filter as We, isNull as vt, isString as me } from "lodash";
|
|
7
7
|
import { ResetIcon as Ce, DotsVerticalIcon as xt, MobileIcon as Te, LaptopIcon as bt, DesktopIcon as jt, EraserIcon as wt, ZoomInIcon as kt, ArrowUpIcon as Ct, CopyIcon as Tt, TrashIcon as Et, DragHandleDots2Icon as St } from "@radix-ui/react-icons";
|
|
8
8
|
import { B as te, u as Dt, S as $e } from "./skeleton-CU_FIbg3.js";
|
|
9
|
-
import { t as Ot, a as ye, s as It, l as H, q as K, y as qe, e as Ue, d as At, b as Bt, h as Pt, i as ze, k as He, p as Rt, z as _t, A as Mt, j as Nt, g as ge, B as Lt, m as Ft, D as Wt, x as $t, E as qt } from "./ChaiBuilderEditor-
|
|
9
|
+
import { t as Ot, a as ye, s as It, l as H, q as K, y as qe, e as Ue, d as At, b as Bt, h as Pt, i as ze, k as He, p as Rt, z as _t, A as Mt, j as Nt, g as ge, B as Lt, m as Ft, D as Wt, x as $t, E as qt } from "./ChaiBuilderEditor-hEuUONQ3.js";
|
|
10
10
|
import { useTranslation as Ke } from "react-i18next";
|
|
11
11
|
import { S as G } from "./separator-SctTn0Qi.js";
|
|
12
|
-
import { a as Ye, u as ve } from "./useDarkMode-
|
|
12
|
+
import { a as Ye, u as ve } from "./useDarkMode-ZKCO_gkt.js";
|
|
13
13
|
import { S as Ut, D as zt, c as Ht, d as Kt, h as Yt, i as Vt, f as Xt, H as Jt, a as Zt, b as Gt } from "./dropdown-menu-S03K_fNs.js";
|
|
14
14
|
import { L as Qt } from "./label-KaP7MRrs.js";
|
|
15
|
-
import { b as en, u as tn, a as Ve } from "./useFeatureSupport-
|
|
15
|
+
import { b as en, u as tn, a as Ve } from "./useFeatureSupport-OLwNgEZb.js";
|
|
16
16
|
import { A as nn, a as rn, b as sn, c as on, e as an, f as ln, d as cn, h as dn, g as un } from "./alert-dialog-GNfnpqFB.js";
|
|
17
17
|
import { useAtom as J } from "jotai";
|
|
18
18
|
import { flip as pn } from "@floating-ui/dom";
|
|
19
19
|
import { useFloating as fn, shift as hn } from "@floating-ui/react-dom";
|
|
20
20
|
import { useDrag as mn } from "react-dnd";
|
|
21
|
-
import { c as yn, a as gn, u as Xe } from "./useAllBlocks-
|
|
21
|
+
import { c as yn, a as gn, u as Xe } from "./useAllBlocks-PQKYvs-e.js";
|
|
22
22
|
import { useResizeObserver as vn } from "@react-hookz/web";
|
|
23
23
|
import { tailwindcssPaletteGenerator as xn } from "@bobthered/tailwindcss-palette-generator";
|
|
24
24
|
import { Provider as bn } from "react-wrap-balancer";
|
|
25
25
|
import { twMerge as jn } from "tailwind-merge";
|
|
26
26
|
import { g as wn, S as Je, a as Ee } from "./MODIFIERS-DsEzQ3aH.js";
|
|
27
|
-
import {
|
|
27
|
+
import { A as kn, h as Cn } from "./index-ehKdBRUK.js";
|
|
28
28
|
import { u as Ze } from "./useChaiExternalData-4K9WxANa.js";
|
|
29
29
|
import Se from "react-dom";
|
|
30
30
|
import "@radix-ui/react-slot";
|
|
@@ -1269,7 +1269,7 @@ const tr = () => {
|
|
|
1269
1269
|
)
|
|
1270
1270
|
}
|
|
1271
1271
|
);
|
|
1272
|
-
}, sr = mt(() => import("./AddBlocks-
|
|
1272
|
+
}, sr = mt(() => import("./AddBlocks-H7BZYHUC.js")), Qr = () => {
|
|
1273
1273
|
const [n, t] = J($t);
|
|
1274
1274
|
return /* @__PURE__ */ e.jsxs("div", { className: "flex h-full w-full flex-col", children: [
|
|
1275
1275
|
/* @__PURE__ */ e.jsx(Bn, {}),
|