@chaibuilder/sdk 1.2.13 → 1.2.14
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/{CanvasArea-nT6ZJh_V.cjs → CanvasArea-1PwexKQz.cjs} +1 -1
- package/dist/{CanvasArea-OSH8wqt1.js → CanvasArea-leUzGAdQ.js} +1 -1
- package/dist/{CurrentPage-SWR9WU4k.cjs → CurrentPage-M6uJPKhj.cjs} +1 -1
- package/dist/{CurrentPage-FzqNBLy4.js → CurrentPage-XSq62fdk.js} +1 -1
- package/dist/{Layers-g5_pwwgO.js → Layers-JoV3wull.js} +1 -1
- package/dist/{Layers-FRHRlPIH.cjs → Layers-tasAbEc8.cjs} +1 -1
- package/dist/{PagesPanel-PSg6aqlK.js → PagesPanel-5KjlPTtj.js} +2 -2
- package/dist/{PagesPanel-3jcf5-iH.cjs → PagesPanel-v1B780fd.cjs} +1 -1
- package/dist/{ProjectPanel-XW_Bx880.js → ProjectPanel-4X2KLnOi.js} +2 -2
- package/dist/{ProjectPanel-EyEcNyh8.cjs → ProjectPanel-NZYWWYTt.cjs} +1 -1
- package/dist/{Settings--7qJ7ciF.js → Settings-1WP3BWxr.js} +1 -1
- package/dist/{Settings-h1c8ukpI.cjs → Settings-FW-bX28i.cjs} +1 -1
- package/dist/{SidePanels-NbM1mfsY.cjs → SidePanels-YpyBLRub.cjs} +1 -1
- package/dist/{SidePanels-Lmj0Qkd1.js → SidePanels-ZlDXRldT.js} +2 -2
- package/dist/{add-page-modal-Bl6y65im.js → add-page-modal-iYgzDs08.js} +1 -1
- package/dist/{add-page-modal-65wltt_4.cjs → add-page-modal-ueEpfep_.cjs} +1 -1
- package/dist/core.cjs +1 -1
- package/dist/core.js +1 -1
- package/dist/{delete-page-modal-Q3Si4nyd.cjs → delete-page-modal-CT-ZA6H5.cjs} +1 -1
- package/dist/{delete-page-modal-tiJ2UA5f.js → delete-page-modal-hlR-A69E.js} +1 -1
- package/dist/email.cjs +1 -1
- package/dist/email.js +1 -1
- package/dist/{index-wwk4px_E.js → index-DXznIJrr.js} +664 -659
- package/dist/{index-hS9T9Nub.cjs → index-TBa4RPnS.cjs} +22 -22
- package/dist/{page-viewer-rLCyM4QC.js → page-viewer-Hgr72mrQ.js} +2 -2
- package/dist/{page-viewer-w-ahza8q.cjs → page-viewer-voX6SLpK.cjs} +1 -1
- package/dist/{project-general-setting-pY-Mkc8G.js → project-general-setting-OdZj-lfx.js} +1 -1
- package/dist/{project-general-setting-RTcIwUWc.cjs → project-general-setting-VFFXhGpN.cjs} +1 -1
- package/dist/{single-page-detail-HYX4R3U0.js → single-page-detail-AjhWBVK1.js} +2 -2
- package/dist/{single-page-detail-wHDpn40R.cjs → single-page-detail-FIwXvGx2.cjs} +1 -1
- package/dist/studio.cjs +1 -1
- package/dist/studio.d.ts +110 -2
- package/dist/studio.js +1 -1
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";var Ue=Object.defineProperty;var $e=(e,t,n)=>t in e?Ue(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var z=(e,t,n)=>($e(e,typeof t!="symbol"?t+"":t,n),n);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("./jsx-runtime-Z_BpKhVy.cjs"),m=require("react"),p=require("lodash-es"),P=require("@radix-ui/react-icons"),o=require("./index-bfKqnRvZ.cjs"),ne=require("react-i18next"),L=require("jotai"),ge=require("react-dom"),ze=require("./_commonjsHelpers-wDK0ZLPo.cjs"),G=require("./index-
|
|
1
|
+
"use strict";var Ue=Object.defineProperty;var $e=(e,t,n)=>t in e?Ue(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var z=(e,t,n)=>($e(e,typeof t!="symbol"?t+"":t,n),n);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("./jsx-runtime-Z_BpKhVy.cjs"),m=require("react"),p=require("lodash-es"),P=require("@radix-ui/react-icons"),o=require("./index-bfKqnRvZ.cjs"),ne=require("react-i18next"),L=require("jotai"),ge=require("react-dom"),ze=require("./_commonjsHelpers-wDK0ZLPo.cjs"),G=require("./index-TBa4RPnS.cjs"),Ye=require("react-quill"),Ke=require("./useAddBlockByDrop-1WvPoBXa.cjs"),Te=require("flagged"),Je=require("@floating-ui/dom"),me=require("@floating-ui/react-dom"),Ve=require("@react-hookz/web"),Ze=require("@bobthered/tailwindcss-palette-generator"),Qe=require("react-wrap-balancer"),Ge=require("tailwind-merge"),ee=require("./MODIFIERS-2FeVfZQ9.cjs"),Xe=require("@chaibuilder/runtime");require("./Functions-N3yhPYKY.cjs");require("clsx");require("flat-to-nested");require("@radix-ui/react-toggle");require("class-variance-authority");require("./Class-5ARpH_Tu.cjs");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("i18next");require("react-textarea-autosize");require("react-dnd");require("@minoru/react-dnd-treeview");require("react-hotkeys-hook");require("sonner");require("./html-to-json-2PeOCVey.cjs");require("himalaya");require("lucide-react");require("./web-blocks.cjs");require("./empty-slot-2LSrWJaY.cjs");const et=()=>{const{hasUndo:e,hasRedo:t,undo:n,redo:i}=o.useUndoManager();return s.jsxRuntimeExports.jsxs("div",{className:"flex items-center",children:[s.jsxRuntimeExports.jsx(o.Button,{disabled:!e(),size:"sm",onClick:n,className:"rounded-full",variant:"ghost",children:s.jsxRuntimeExports.jsx(P.ResetIcon,{})}),s.jsxRuntimeExports.jsx(o.Button,{disabled:!t(),onClick:i,size:"sm",className:"rounded-full",variant:"ghost",children:s.jsxRuntimeExports.jsx(P.ResetIcon,{className:"rotate-180 scale-y-[-1] transform"})})]})};function tt(){const[e,t]=o.useDarkMode(),{t:n}=ne.useTranslation();return s.jsxRuntimeExports.jsxs("div",{className:"flex items-center",children:[s.jsxRuntimeExports.jsx(o.Label,{htmlFor:"dark-mode-switch",children:n("dark_mode")}),s.jsxRuntimeExports.jsxs(o.Switch,{id:"dark-mode-switch",checked:e,onCheckedChange:()=>{t(!e)},className:`${e?"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:[s.jsxRuntimeExports.jsx("span",{className:"sr-only",children:n("use_setting")}),s.jsxRuntimeExports.jsx("span",{"aria-hidden":"true",className:`${e?"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 ye=({landscape:e=!1})=>s.jsxRuntimeExports.jsxs("svg",{className:e?"rotate-90":"",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 13 13",xmlSpace:"preserve",width:13,height:13,children:[s.jsxRuntimeExports.jsx("g",{strokeWidth:0}),s.jsxRuntimeExports.jsx("g",{strokeLinecap:"round",strokeLinejoin:"round"}),s.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"}})]}),nt=[{title:"mobile_xs_title",content:"mobile_xs_content",breakpoint:"xs",icon:s.jsxRuntimeExports.jsx(P.MobileIcon,{}),width:400},{title:"mobile_sm_title",content:"mobile_sm_content",breakpoint:"sm",icon:s.jsxRuntimeExports.jsx(P.MobileIcon,{className:"rotate-90"}),width:640},{title:"tablet_md_title",content:"tablet_md_content",breakpoint:"md",icon:s.jsxRuntimeExports.jsx(ye,{}),width:800},{title:"tablet_lg_title",content:"tablet_lg_content",breakpoint:"lg",icon:s.jsxRuntimeExports.jsx(ye,{landscape:!0}),width:1024},{title:"desktop_xl_title",content:"desktop_xl_content",breakpoint:"xl",icon:s.jsxRuntimeExports.jsx(P.LaptopIcon,{}),width:1420},{title:"large_desktop_2xl_title",content:"large_desktop_2xl_content",breakpoint:"2xl",icon:s.jsxRuntimeExports.jsx(P.DesktopIcon,{}),width:1920}],ve=({title:e,content:t,currentBreakpoint:n,breakpoint:i,width:a,icon:c,onClick:u})=>{const{t:r}=ne.useTranslation();return s.jsxRuntimeExports.jsxs(o.HoverCard,{children:[s.jsxRuntimeExports.jsx(o.HoverCardTrigger,{asChild:!0,children:s.jsxRuntimeExports.jsx(o.Button,{onClick:()=>u(a),size:"sm",variant:i===n?"secondary":"ghost",children:c})}),s.jsxRuntimeExports.jsx(o.HoverCardContent,{className:"w-52 border-border",children:s.jsxRuntimeExports.jsx("div",{className:"flex justify-between space-x-4",children:s.jsxRuntimeExports.jsxs("div",{className:"space-y-1",children:[s.jsxRuntimeExports.jsx("h4",{className:"text-sm font-semibold",children:r(e)}),s.jsxRuntimeExports.jsx("p",{className:"text-xs",children:r(t)})]})})})]})},st=()=>{const[,e,t]=o.useCanvasWidth(),[n,i]=o.useSelectedBreakpoints(),{t:a}=ne.useTranslation(),c=o.useBuilderProp("breakpoints",nt),u=r=>{n.includes(r)?n.length>2&&i(n.filter(d=>d!==r)):i(d=>[...d,r])};return c.length<4?s.jsxRuntimeExports.jsx("div",{className:"flex items-center rounded-md",children:p.map(c,r=>m.createElement(ve,{...r,onClick:t,key:r.breakpoint,currentBreakpoint:e}))}):s.jsxRuntimeExports.jsxs("div",{className:"flex items-center rounded-md",children:[p.map(c.filter(r=>p.includes(n,p.toUpper(r.breakpoint))),r=>m.createElement(ve,{...r,onClick:t,key:r.breakpoint,currentBreakpoint:e})),s.jsxRuntimeExports.jsxs(o.DropdownMenu,{children:[s.jsxRuntimeExports.jsx(o.DropdownMenuTrigger,{asChild:!0,children:s.jsxRuntimeExports.jsx("span",{className:"cursor-pointer px-2.5 hover:opacity-80",children:s.jsxRuntimeExports.jsx(P.DotsVerticalIcon,{className:"scale-90 transform"})})}),s.jsxRuntimeExports.jsxs(o.DropdownMenuContent,{className:"w-56 border-border text-xs",children:[s.jsxRuntimeExports.jsx(o.DropdownMenuLabel,{children:a("Breakpoints")}),s.jsxRuntimeExports.jsx(o.DropdownMenuSeparator,{}),p.map(c,r=>s.jsxRuntimeExports.jsx(o.DropdownMenuCheckboxItem,{disabled:r.breakpoint==="xs",onCheckedChange:()=>u(p.toUpper(r.breakpoint)),checked:p.includes(n,p.toUpper(r.breakpoint)),children:a(r.title)},r.breakpoint))]})]})]})},rt=()=>{const{t:e}=ne.useTranslation(),{setNewBlocks:t}=o.useBlocksStoreUndoableActions(),[,n]=o.useSelectedBlockIds(),[,i]=o.useSelectedStylingBlocks(),a=m.useCallback(()=>{t([]),n([]),i([])},[t]);return s.jsxRuntimeExports.jsx("div",{className:"flex items-center",children:s.jsxRuntimeExports.jsxs(o.AlertDialog,{children:[s.jsxRuntimeExports.jsx(o.AlertDialogTrigger,{asChild:!0,children:s.jsxRuntimeExports.jsxs(o.Button,{size:"sm",variant:"ghost",className:"flex items-center gap-x-1",children:[s.jsxRuntimeExports.jsx(P.EraserIcon,{})," ",e("clear")]})}),s.jsxRuntimeExports.jsxs(o.AlertDialogContent,{className:"border-border",children:[s.jsxRuntimeExports.jsxs(o.AlertDialogHeader,{children:[s.jsxRuntimeExports.jsx(o.AlertDialogTitle,{children:e("clear_canvas_title")}),s.jsxRuntimeExports.jsx(o.AlertDialogDescription,{children:e("clear_canvas_description")})]}),s.jsxRuntimeExports.jsxs(o.AlertDialogFooter,{children:[s.jsxRuntimeExports.jsx(o.AlertDialogCancel,{children:e("cancel")}),s.jsxRuntimeExports.jsx(o.AlertDialogAction,{onClick:a,children:e("yes")})]})]})]})})},ot=()=>{const e=o.useBuilderProp("darkMode",!1),[t]=o.useCanvasZoom();return s.jsxRuntimeExports.jsxs("div",{className:"flex h-10 items-center justify-between border-b bg-background/70 px-2",children:[s.jsxRuntimeExports.jsxs("div",{className:"flex h-full space-x-2",children:[e?s.jsxRuntimeExports.jsxs(s.jsxRuntimeExports.Fragment,{children:[s.jsxRuntimeExports.jsx(tt,{}),s.jsxRuntimeExports.jsx(o.Separator,{orientation:"vertical"})]}):null,s.jsxRuntimeExports.jsx(st,{}),s.jsxRuntimeExports.jsx(o.Separator,{orientation:"vertical"}),s.jsxRuntimeExports.jsxs("div",{className:"flex w-12 items-center justify-center gap-x-1 space-x-0 font-medium",children:[s.jsxRuntimeExports.jsx(P.ZoomInIcon,{className:"h-3.5 w-3.5 flex-shrink-0"})," ",s.jsxRuntimeExports.jsxs("div",{className:"text-xs leading-3",children:[p.round(t,0),"%"]})]}),s.jsxRuntimeExports.jsx(o.Separator,{orientation:"vertical"}),s.jsxRuntimeExports.jsx(et,{})]}),s.jsxRuntimeExports.jsxs("div",{className:"flex h-full items-center space-x-2",children:[s.jsxRuntimeExports.jsx(o.Separator,{orientation:"vertical"}),s.jsxRuntimeExports.jsx(rt,{})]})]})},it=`<!doctype html>
|
|
4
4
|
<html class="scroll-smooth h-full overflow-y-auto">
|
|
@@ -10,7 +10,7 @@ import { useTranslation as de } from "react-i18next";
|
|
|
10
10
|
import { useAtom as M } from "jotai";
|
|
11
11
|
import Pe from "react-dom";
|
|
12
12
|
import { g as kn } from "./_commonjsHelpers-UyOWmZb0.js";
|
|
13
|
-
import { r as ot, u as jn, B as Tn, E as Cn } from "./index-
|
|
13
|
+
import { r as ot, u as jn, B as Tn, E as Cn } from "./index-DXznIJrr.js";
|
|
14
14
|
import { Quill as En } from "react-quill";
|
|
15
15
|
import { u as In } from "./useAddBlockByDrop-bs_SH7Tw.js";
|
|
16
16
|
import { useFeature as st } from "flagged";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-Z_BpKhVy.cjs"),t=require("./index-bfKqnRvZ.cjs"),i=require("lodash-es"),h=require("sonner"),l=require("react"),o=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-Z_BpKhVy.cjs"),t=require("./index-bfKqnRvZ.cjs"),i=require("lodash-es"),h=require("sonner"),l=require("react"),o=require("./index-TBa4RPnS.cjs"),j=require("lucide-react");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("./Functions-N3yhPYKY.cjs");require("clsx");require("tailwind-merge");require("@chaibuilder/runtime");require("jotai");require("flat-to-nested");require("./MODIFIERS-2FeVfZQ9.cjs");require("@react-hookz/web");require("@radix-ui/react-toggle");require("class-variance-authority");require("./Class-5ARpH_Tu.cjs");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("react-i18next");require("i18next");require("@floating-ui/react-dom");require("react-textarea-autosize");require("flagged");require("react-dnd");require("@minoru/react-dnd-treeview");require("react-hotkeys-hook");require("./html-to-json-2PeOCVey.cjs");require("himalaya");require("./web-blocks.cjs");require("./empty-slot-2LSrWJaY.cjs");const p=()=>{const{data:s}=o.useProject(),{data:u,isLoading:x}=o.usePages(),{syncState:d}=t.useSavePage(),q=o.useChangePage(),[n,a]=o.useCurrentPage(),c=i.sortBy(i.filter(u,{type:"STATIC"}),r=>i.get(r,"uuid")===(s==null?void 0:s.homepage)?0:1);l.useEffect(()=>{!i.isEmpty(u)&&s.homepage&&!i.find(u,{uuid:n})&&a(s.homepage)},[n,u,s,a]),l.useEffect(()=>()=>a(null),[a]);const m=r=>{if(d!=="SAVED")h.toast.error("You have unsaved changes. Please save before changing the page.");else{const g=i.find(c,{uuid:r});q(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(s.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(t.Select,{value:n||"",onValueChange:m,children:[e.jsxRuntimeExports.jsx(t.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(t.SelectValue,{placeholder:"Page"})}),e.jsxRuntimeExports.jsx(t.SelectContent,{className:"z-[999]",children:i.map(c,r=>e.jsxRuntimeExports.jsx(t.SelectItem,{value:r.uuid,children:r==null?void 0:r.name},r.uuid))})]})]})})]})})};exports.default=p;
|
|
@@ -3,7 +3,7 @@ import { a9 as x, aj as h, ak as f, al as j, am as y, an as P } from "./index-m9
|
|
|
3
3
|
import { sortBy as v, filter as b, get as k, isEmpty as m, find as n, capitalize as w, map as C } from "lodash-es";
|
|
4
4
|
import { toast as N } from "sonner";
|
|
5
5
|
import { useEffect as p } from "react";
|
|
6
|
-
import { b as S, a as B, d as E, e as I } from "./index-
|
|
6
|
+
import { b as S, a as B, d as E, e as I } from "./index-DXznIJrr.js";
|
|
7
7
|
import { BriefcaseIcon as L } from "lucide-react";
|
|
8
8
|
import "./_commonjsHelpers-UyOWmZb0.js";
|
|
9
9
|
import "./Functions-7jnEwJyw.js";
|
|
@@ -9,7 +9,7 @@ import { DatabaseIcon as _e } from "lucide-react";
|
|
|
9
9
|
import { useMemo as Ee, useCallback as Me } from "react";
|
|
10
10
|
import { a as He } from "./MODIFIERS-RiXS5Mn1.js";
|
|
11
11
|
import { c as I } from "./Functions-7jnEwJyw.js";
|
|
12
|
-
import { f as Ae } from "./index-
|
|
12
|
+
import { f as Ae } from "./index-DXznIJrr.js";
|
|
13
13
|
import { u as Le } from "./useAddBlockByDrop-bs_SH7Tw.js";
|
|
14
14
|
import "./_commonjsHelpers-UyOWmZb0.js";
|
|
15
15
|
import "@chaibuilder/runtime";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-Z_BpKhVy.cjs"),x=require("lodash-es"),s=require("@radix-ui/react-icons"),y=require("react-dnd"),B=require("@minoru/react-dnd-treeview"),O=require("react-i18next"),n=require("./index-bfKqnRvZ.cjs"),N=require("lucide-react"),f=require("react"),M=require("./MODIFIERS-2FeVfZQ9.cjs"),q=require("./Functions-N3yhPYKY.cjs"),_=require("./index-hS9T9Nub.cjs"),A=require("./useAddBlockByDrop-1WvPoBXa.cjs");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("@chaibuilder/runtime");require("jotai");require("flat-to-nested");require("@react-hookz/web");require("@radix-ui/react-toggle");require("class-variance-authority");require("./Class-5ARpH_Tu.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("i18next");require("@floating-ui/react-dom");require("react-textarea-autosize");require("flagged");require("react-hotkeys-hook");require("sonner");require("./html-to-json-2PeOCVey.cjs");require("himalaya");require("./web-blocks.cjs");require("./empty-slot-2LSrWJaY.cjs");const v=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(N.DatabaseIcon,{size:16});case"Box":return e.jsxRuntimeExports.jsx(s.BoxIcon,{});default:return e.jsxRuntimeExports.jsx(s.BoxModelIcon,{})}};function H(t=""){const r={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 u=new RegExp(/\b(sm|md|lg|xl|2xl):(block|grid|flex|inline|inline-grid|inline-flex|inline-block)\b/),a=t.match(u);if(x.nth(a,1))return`Visible >=${r[x.nth(a,1)]}`}return""}const L=t=>{let r="";return Object.keys(t).forEach(o=>{x.startsWith(t[o],M.STYLES_KEY)&&(r=t[o])}),r},P=t=>{var j;const[,r]=n.useHighlightBlockId(),[o]=n.useHiddenBlockIds(),{isSelected:c}=t,{id:u,data:a}=t.node,g=t.depth*10,R=l=>{l.stopPropagation(),t.onToggle(t.node.id)},m=B.useDragOver(u,t.isOpen,t.onToggle),p=f.useMemo(()=>{const l=L(t.node.data);return H(l)},[t.node.data]);return e.jsxRuntimeExports.jsx("div",{onMouseEnter:()=>r(u),className:q.cn("group flex w-full items-center justify-between space-x-px py-px",c?"bg-blue-500 text-white":"text-gray-600 hover:bg-gray-200 dark:hover:bg-gray-800"),onClick:l=>{l.stopPropagation(),!o.includes(u)&&t.onSelect(u)},onContextMenu:()=>t.onSelect(u),style:{paddingInlineStart:g},...m,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:R,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(v,{type:a==null?void 0:a._type})}),e.jsxRuntimeExports.jsx("div",{className:"ml-2 truncate text-[11px]",children:((j=t.node.data)==null?void 0:j._name)||t.node.text}),p?e.jsxRuntimeExports.jsxs("span",{className:"ml-2 flex items-center text-[10px] italic "+(c?"text-gray-200":"text-gray-500"),children:["(",p,")"]}):null]})]})})},F=t=>{var o;const{item:r}=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(v,{type:(o=r==null?void 0:r.data)==null?void 0:o._type})}),e.jsxRuntimeExports.jsx("div",{className:"ml-2 truncate text-[11px]",children:r.text})]})},V=t=>{const r=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:r}})},z=()=>{const[t]=n.useSelectedBlockIds(),r=n.useRemoveBlocks(),o=n.useSelectedBlock();return e.jsxRuntimeExports.jsxs(n.ContextMenuItem,{disabled:!n.canDeleteBlock(o==null?void 0:o._type),className:"flex items-center gap-x-4 text-xs",onClick:()=>r(t),children:[e.jsxRuntimeExports.jsx(s.TrashIcon,{})," Remove"]})},$=()=>{const[t]=n.useSelectedBlockIds(),r=n.useDuplicateBlocks(),o=n.useSelectedBlock(),c=f.useCallback(()=>{r(t)},[t,r]);return e.jsxRuntimeExports.jsxs(n.ContextMenuContent,{className:"text-xs",children:[e.jsxRuntimeExports.jsxs(n.ContextMenuItem,{disabled:!n.canDuplicateBlock(o==null?void 0:o._type),className:"flex items-center gap-x-4 text-xs",onClick:c,children:[e.jsxRuntimeExports.jsx(s.CopyIcon,{})," Duplicate"]}),e.jsxRuntimeExports.jsx(z,{})]})},K=({children:t})=>e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:e.jsxRuntimeExports.jsxs(n.ContextMenu,{children:[e.jsxRuntimeExports.jsx(n.ContextMenuTrigger,{children:t}),e.jsxRuntimeExports.jsx($,{})]})});function U(t){return x.map(t,r=>{const{data:o}=r;return{...o,_parent:r.parent===0?null:r.parent}})}function Q(){const[t]=n.useBlocksContainer(),[r,o]=n.useSelectedBlockIds();return t?e.jsxRuntimeExports.jsxs("div",{onClick:c=>{c.stopPropagation(),o(["container"])},className:q.cn("flex items-center pl-2 text-xs",x.includes(r,"container")?"bg-blue-500 text-white":"hover:bg-gray-200 dark:hover:bg-gray-800"),children:[e.jsxRuntimeExports.jsx(s.BoxIcon,{})," ",t._type]}):null}const Y=()=>{const[t]=n.useBlocksStore(),{setNewBlocks:r}=n.useBlocksStoreUndoableActions(),[o,c,u]=n.useSelectedBlockIds(),[,a]=n.useSelectedStylingBlocks(),{t:g}=O.useTranslation(),R=_.useExpandedIds(),m=A.useAddBlockByDrop(),[p]=n.useBlocksContainer(),j=async(i,d)=>{const{dragSource:h,relativeIndex:I,dropTargetId:b,monitor:k}=d;if(h){const D=U(i);r(D);const T=k.getItem();c([T.id])}else await m({block:k.getItem(),dropTargetId:b,relativeIndex:I})},l=x.map(t,i=>({id:i._id,text:i._type,parent:i._parent||0,droppable:!x.isUndefined(x.find(t,{_parent:i._id})),data:i})),w=()=>{c([]),a([])},[{isOver:E},C]=y.useDrop(()=>({accept:["CHAI_BLOCK"],collect:i=>({canDrop:i.canDrop(),isOver:i.isOver()}),drop:i=>{(async()=>await m({block:i,dropTargetId:"",relativeIndex:0}))()}})),{isDragging:S}=y.useDragLayer(i=>({isDragging:i.isDragging()}));return e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:e.jsxRuntimeExports.jsx("div",{onClick:()=>w(),className:q.cn("-mx-1 -mt-1 flex h-full select-none flex-col space-y-1",S?"bg-green-50/80":"bg-background"),children:x.isEmpty(t)?e.jsxRuntimeExports.jsxs("div",{ref:C,className:`mx-1 mt-4 h-full max-w-full p-6 text-center text-sm text-gray-400 ${E?"bg-blue-200":""}`,children:[E?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:g(E?"drop_here_message":"tree_view_no_blocks")})]}):e.jsxRuntimeExports.jsxs(n.ScrollArea,{id:"layers-view",className:"no-scrollbar h-full overflow-y-auto p-1",children:[e.jsxRuntimeExports.jsx(Q,{}),e.jsxRuntimeExports.jsx(B.Tree,{initialOpen:R,extraAcceptTypes:["CHAI_BLOCK"],tree:l,rootId:0,render:(i,{depth:d,isOpen:h,onToggle:I})=>e.jsxRuntimeExports.jsx(K,{id:i.id,children:e.jsxRuntimeExports.jsx(P,{onSelect:b=>{a([]),c([b])},isSelected:x.includes(o,i.id),node:i,depth:d,isOpen:h,onToggle:I,toggleIds:u})}),dragPreviewRender:i=>e.jsxRuntimeExports.jsx(F,{monitorProps:i}),onDrop:j,classes:{root:"h-[90%] "+(p?"pl-2":"pt-2"),draggingSource:"opacity-30",dropTarget:"bg-green-100",placeholder:"relative"},sort:!1,insertDroppableFirst:!1,canDrop:n.canDropBlock,dropTargetOffset:2,enableAnimateExpand:!0,placeholderRender:(i,{depth:d})=>e.jsxRuntimeExports.jsx(V,{node:i,depth:d})})]})})})};exports.default=Y;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-Z_BpKhVy.cjs"),x=require("lodash-es"),s=require("@radix-ui/react-icons"),y=require("react-dnd"),B=require("@minoru/react-dnd-treeview"),O=require("react-i18next"),n=require("./index-bfKqnRvZ.cjs"),N=require("lucide-react"),f=require("react"),M=require("./MODIFIERS-2FeVfZQ9.cjs"),q=require("./Functions-N3yhPYKY.cjs"),_=require("./index-TBa4RPnS.cjs"),A=require("./useAddBlockByDrop-1WvPoBXa.cjs");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("@chaibuilder/runtime");require("jotai");require("flat-to-nested");require("@react-hookz/web");require("@radix-ui/react-toggle");require("class-variance-authority");require("./Class-5ARpH_Tu.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("i18next");require("@floating-ui/react-dom");require("react-textarea-autosize");require("flagged");require("react-hotkeys-hook");require("sonner");require("./html-to-json-2PeOCVey.cjs");require("himalaya");require("./web-blocks.cjs");require("./empty-slot-2LSrWJaY.cjs");const v=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(N.DatabaseIcon,{size:16});case"Box":return e.jsxRuntimeExports.jsx(s.BoxIcon,{});default:return e.jsxRuntimeExports.jsx(s.BoxModelIcon,{})}};function H(t=""){const r={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 u=new RegExp(/\b(sm|md|lg|xl|2xl):(block|grid|flex|inline|inline-grid|inline-flex|inline-block)\b/),a=t.match(u);if(x.nth(a,1))return`Visible >=${r[x.nth(a,1)]}`}return""}const L=t=>{let r="";return Object.keys(t).forEach(o=>{x.startsWith(t[o],M.STYLES_KEY)&&(r=t[o])}),r},P=t=>{var j;const[,r]=n.useHighlightBlockId(),[o]=n.useHiddenBlockIds(),{isSelected:c}=t,{id:u,data:a}=t.node,g=t.depth*10,R=l=>{l.stopPropagation(),t.onToggle(t.node.id)},m=B.useDragOver(u,t.isOpen,t.onToggle),p=f.useMemo(()=>{const l=L(t.node.data);return H(l)},[t.node.data]);return e.jsxRuntimeExports.jsx("div",{onMouseEnter:()=>r(u),className:q.cn("group flex w-full items-center justify-between space-x-px py-px",c?"bg-blue-500 text-white":"text-gray-600 hover:bg-gray-200 dark:hover:bg-gray-800"),onClick:l=>{l.stopPropagation(),!o.includes(u)&&t.onSelect(u)},onContextMenu:()=>t.onSelect(u),style:{paddingInlineStart:g},...m,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:R,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(v,{type:a==null?void 0:a._type})}),e.jsxRuntimeExports.jsx("div",{className:"ml-2 truncate text-[11px]",children:((j=t.node.data)==null?void 0:j._name)||t.node.text}),p?e.jsxRuntimeExports.jsxs("span",{className:"ml-2 flex items-center text-[10px] italic "+(c?"text-gray-200":"text-gray-500"),children:["(",p,")"]}):null]})]})})},F=t=>{var o;const{item:r}=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(v,{type:(o=r==null?void 0:r.data)==null?void 0:o._type})}),e.jsxRuntimeExports.jsx("div",{className:"ml-2 truncate text-[11px]",children:r.text})]})},V=t=>{const r=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:r}})},z=()=>{const[t]=n.useSelectedBlockIds(),r=n.useRemoveBlocks(),o=n.useSelectedBlock();return e.jsxRuntimeExports.jsxs(n.ContextMenuItem,{disabled:!n.canDeleteBlock(o==null?void 0:o._type),className:"flex items-center gap-x-4 text-xs",onClick:()=>r(t),children:[e.jsxRuntimeExports.jsx(s.TrashIcon,{})," Remove"]})},$=()=>{const[t]=n.useSelectedBlockIds(),r=n.useDuplicateBlocks(),o=n.useSelectedBlock(),c=f.useCallback(()=>{r(t)},[t,r]);return e.jsxRuntimeExports.jsxs(n.ContextMenuContent,{className:"text-xs",children:[e.jsxRuntimeExports.jsxs(n.ContextMenuItem,{disabled:!n.canDuplicateBlock(o==null?void 0:o._type),className:"flex items-center gap-x-4 text-xs",onClick:c,children:[e.jsxRuntimeExports.jsx(s.CopyIcon,{})," Duplicate"]}),e.jsxRuntimeExports.jsx(z,{})]})},K=({children:t})=>e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:e.jsxRuntimeExports.jsxs(n.ContextMenu,{children:[e.jsxRuntimeExports.jsx(n.ContextMenuTrigger,{children:t}),e.jsxRuntimeExports.jsx($,{})]})});function U(t){return x.map(t,r=>{const{data:o}=r;return{...o,_parent:r.parent===0?null:r.parent}})}function Q(){const[t]=n.useBlocksContainer(),[r,o]=n.useSelectedBlockIds();return t?e.jsxRuntimeExports.jsxs("div",{onClick:c=>{c.stopPropagation(),o(["container"])},className:q.cn("flex items-center pl-2 text-xs",x.includes(r,"container")?"bg-blue-500 text-white":"hover:bg-gray-200 dark:hover:bg-gray-800"),children:[e.jsxRuntimeExports.jsx(s.BoxIcon,{})," ",t._type]}):null}const Y=()=>{const[t]=n.useBlocksStore(),{setNewBlocks:r}=n.useBlocksStoreUndoableActions(),[o,c,u]=n.useSelectedBlockIds(),[,a]=n.useSelectedStylingBlocks(),{t:g}=O.useTranslation(),R=_.useExpandedIds(),m=A.useAddBlockByDrop(),[p]=n.useBlocksContainer(),j=async(i,d)=>{const{dragSource:h,relativeIndex:I,dropTargetId:b,monitor:k}=d;if(h){const D=U(i);r(D);const T=k.getItem();c([T.id])}else await m({block:k.getItem(),dropTargetId:b,relativeIndex:I})},l=x.map(t,i=>({id:i._id,text:i._type,parent:i._parent||0,droppable:!x.isUndefined(x.find(t,{_parent:i._id})),data:i})),w=()=>{c([]),a([])},[{isOver:E},C]=y.useDrop(()=>({accept:["CHAI_BLOCK"],collect:i=>({canDrop:i.canDrop(),isOver:i.isOver()}),drop:i=>{(async()=>await m({block:i,dropTargetId:"",relativeIndex:0}))()}})),{isDragging:S}=y.useDragLayer(i=>({isDragging:i.isDragging()}));return e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:e.jsxRuntimeExports.jsx("div",{onClick:()=>w(),className:q.cn("-mx-1 -mt-1 flex h-full select-none flex-col space-y-1",S?"bg-green-50/80":"bg-background"),children:x.isEmpty(t)?e.jsxRuntimeExports.jsxs("div",{ref:C,className:`mx-1 mt-4 h-full max-w-full p-6 text-center text-sm text-gray-400 ${E?"bg-blue-200":""}`,children:[E?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:g(E?"drop_here_message":"tree_view_no_blocks")})]}):e.jsxRuntimeExports.jsxs(n.ScrollArea,{id:"layers-view",className:"no-scrollbar h-full overflow-y-auto p-1",children:[e.jsxRuntimeExports.jsx(Q,{}),e.jsxRuntimeExports.jsx(B.Tree,{initialOpen:R,extraAcceptTypes:["CHAI_BLOCK"],tree:l,rootId:0,render:(i,{depth:d,isOpen:h,onToggle:I})=>e.jsxRuntimeExports.jsx(K,{id:i.id,children:e.jsxRuntimeExports.jsx(P,{onSelect:b=>{a([]),c([b])},isSelected:x.includes(o,i.id),node:i,depth:d,isOpen:h,onToggle:I,toggleIds:u})}),dragPreviewRender:i=>e.jsxRuntimeExports.jsx(F,{monitorProps:i}),onDrop:j,classes:{root:"h-[90%] "+(p?"pl-2":"pt-2"),draggingSource:"opacity-30",dropTarget:"bg-green-100",placeholder:"relative"},sort:!1,insertDroppableFirst:!1,canDrop:n.canDropBlock,dropTargetOffset:2,enableAnimateExpand:!0,placeholderRender:(i,{depth:d})=>e.jsxRuntimeExports.jsx(V,{node:i,depth:d})})]})})})};exports.default=Y;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { j as t } from "./jsx-runtime-WbnYoNE9.js";
|
|
2
2
|
import i, { Suspense as s } from "react";
|
|
3
3
|
import { sortBy as a, filter as d, get as n } from "lodash-es";
|
|
4
|
-
import { a as l, b as c } from "./index-
|
|
4
|
+
import { a as l, b as c } from "./index-DXznIJrr.js";
|
|
5
5
|
import "./_commonjsHelpers-UyOWmZb0.js";
|
|
6
6
|
import "i18next";
|
|
7
7
|
import "react-i18next";
|
|
@@ -51,7 +51,7 @@ import "himalaya";
|
|
|
51
51
|
import "lucide-react";
|
|
52
52
|
import "./web-blocks.js";
|
|
53
53
|
import "./empty-slot-5FRrRq1E.js";
|
|
54
|
-
const x = i.lazy(() => import("./add-page-modal-
|
|
54
|
+
const x = i.lazy(() => import("./add-page-modal-iYgzDs08.js")), g = i.lazy(() => import("./page-viewer-Hgr72mrQ.js")), gt = () => {
|
|
55
55
|
const { data: o = [], isLoading: m } = l(), { data: r } = c(), p = a(d(o, { type: "STATIC" }), (e) => n(e, "uuid") === (r == null ? void 0 : r.homepage) ? 0 : 1);
|
|
56
56
|
return /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
|
|
57
57
|
/* @__PURE__ */ t.jsxs("div", { className: "flex items-center justify-between rounded-md bg-background/30 p-1", children: [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-Z_BpKhVy.cjs"),u=require("react"),i=require("lodash-es"),s=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-Z_BpKhVy.cjs"),u=require("react"),i=require("lodash-es"),s=require("./index-TBa4RPnS.cjs");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("i18next");require("react-i18next");require("./index-bfKqnRvZ.cjs");require("./Functions-N3yhPYKY.cjs");require("clsx");require("tailwind-merge");require("@chaibuilder/runtime");require("jotai");require("flat-to-nested");require("./MODIFIERS-2FeVfZQ9.cjs");require("@react-hookz/web");require("@radix-ui/react-toggle");require("class-variance-authority");require("./Class-5ARpH_Tu.cjs");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("@floating-ui/react-dom");require("react-textarea-autosize");require("flagged");require("react-dnd");require("@minoru/react-dnd-treeview");require("react-hotkeys-hook");require("sonner");require("./html-to-json-2PeOCVey.cjs");require("himalaya");require("lucide-react");require("./web-blocks.cjs");require("./empty-slot-2LSrWJaY.cjs");const a=u.lazy(()=>Promise.resolve().then(()=>require("./add-page-modal-ueEpfep_.cjs"))),x=u.lazy(()=>Promise.resolve().then(()=>require("./page-viewer-voX6SLpK.cjs"))),d=()=>{const{data:t=[],isLoading:q}=s.usePages(),{data:r}=s.useProject(),n=i.sortBy(i.filter(t,{type:"STATIC"}),o=>i.get(o,"uuid")===(r==null?void 0:r.homepage)?0:1);return e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsxs("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:"Pages"}),e.jsxRuntimeExports.jsx(u.Suspense,{fallback:e.jsxRuntimeExports.jsx("div",{className:"text-sm text-blue-500 underline",children:"+ New Page"}),children:e.jsxRuntimeExports.jsx(a,{})})]}),e.jsxRuntimeExports.jsx("hr",{className:"-mx-1"}),e.jsxRuntimeExports.jsx("div",{className:"-mx-1 divide-y-2",children:e.jsxRuntimeExports.jsx(x,{isLoading:q,pages:n})})]})};exports.default=d;
|
|
@@ -2,7 +2,7 @@ import { j as t } from "./jsx-runtime-WbnYoNE9.js";
|
|
|
2
2
|
import m, { useRef as x, useEffect as a, Suspense as p } from "react";
|
|
3
3
|
import { isEqual as b, isEmpty as j } from "lodash-es";
|
|
4
4
|
import { b8 as f, b9 as n, ba as l, bb as c } from "./index-m9VziIOy.js";
|
|
5
|
-
import { c as h, b as g } from "./index-
|
|
5
|
+
import { c as h, b as g } from "./index-DXznIJrr.js";
|
|
6
6
|
import "./_commonjsHelpers-UyOWmZb0.js";
|
|
7
7
|
import "./Functions-7jnEwJyw.js";
|
|
8
8
|
import "clsx";
|
|
@@ -51,7 +51,7 @@ import "himalaya";
|
|
|
51
51
|
import "lucide-react";
|
|
52
52
|
import "./web-blocks.js";
|
|
53
53
|
import "./empty-slot-5FRrRq1E.js";
|
|
54
|
-
const N = m.lazy(() => import("./project-general-setting-
|
|
54
|
+
const N = m.lazy(() => import("./project-general-setting-OdZj-lfx.js")), S = m.lazy(() => import("./project-seo-setting-9V67NFil.js")), d = /* @__PURE__ */ t.jsx("div", { className: "px-3", children: /* @__PURE__ */ t.jsx("div", { className: "h-52 w-full animate-pulse rounded-md bg-gray-100" }) }), u = (r) => r && j(r.seoData) ? {
|
|
55
55
|
...r,
|
|
56
56
|
seoData: { title: "", description: "", image: "" }
|
|
57
57
|
} : r;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-Z_BpKhVy.cjs"),r=require("react"),x=require("lodash-es"),s=require("./index-bfKqnRvZ.cjs"),a=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-Z_BpKhVy.cjs"),r=require("react"),x=require("lodash-es"),s=require("./index-bfKqnRvZ.cjs"),a=require("./index-TBa4RPnS.cjs");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("./Functions-N3yhPYKY.cjs");require("clsx");require("tailwind-merge");require("@chaibuilder/runtime");require("jotai");require("flat-to-nested");require("./MODIFIERS-2FeVfZQ9.cjs");require("@react-hookz/web");require("@radix-ui/react-toggle");require("class-variance-authority");require("./Class-5ARpH_Tu.cjs");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("react-i18next");require("i18next");require("@floating-ui/react-dom");require("react-textarea-autosize");require("flagged");require("react-dnd");require("@minoru/react-dnd-treeview");require("react-hotkeys-hook");require("sonner");require("./html-to-json-2PeOCVey.cjs");require("himalaya");require("lucide-react");require("./web-blocks.cjs");require("./empty-slot-2LSrWJaY.cjs");const d=r.lazy(()=>Promise.resolve().then(()=>require("./project-general-setting-VFFXhGpN.cjs"))),m=r.lazy(()=>Promise.resolve().then(()=>require("./project-seo-setting-aRDdqu88.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 q(){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(m,{_projectData:i,seany:o})})})]})]})})]})}exports.default=q;
|
|
@@ -9,7 +9,7 @@ import { aT as Yt, aU as Xt, B as xe, aV as zt, aW as Zt, aX as Wt, aY as Ut, aZ
|
|
|
9
9
|
import { u as _r } from "./empty-slot-5FRrRq1E.js";
|
|
10
10
|
import { Check as Tr, EditIcon as Sr, TrashIcon as Rr } from "lucide-react";
|
|
11
11
|
import { getBlockComponent as et, getChaiDataProviders as Vr } from "@chaibuilder/runtime";
|
|
12
|
-
import { E as tt, u as rt } from "./index-
|
|
12
|
+
import { E as tt, u as rt } from "./index-DXznIJrr.js";
|
|
13
13
|
import { J as Hr, a as Br, d as Dr } from "./index-e0c8PmRQ.js";
|
|
14
14
|
import $r from "@rjsf/core";
|
|
15
15
|
import Ir from "@rjsf/validator-ajv8";
|