@chaibuilder/sdk 1.2.3 → 1.2.5
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-lBmLPSqX.js → CanvasArea-WS9dnLyS.js} +7 -5
- package/dist/{CanvasArea-yDkGNbGZ.cjs → CanvasArea-wpskKN1H.cjs} +1 -1
- package/dist/CurrentPage-X9fCVXgY.cjs +1 -0
- package/dist/{CurrentPage-B6hjYNzI.js → CurrentPage-iaGHiR2B.js} +10 -8
- package/dist/Layers-EGhZWmvD.cjs +1 -0
- package/dist/{Layers-IDVZrVlL.js → Layers-V15IDskJ.js} +5 -3
- package/dist/{PagesPanel-Q_uSjTW1.cjs → PagesPanel-Vla7HZkm.cjs} +1 -1
- package/dist/{PagesPanel-j_Fpa3sl.js → PagesPanel-wfyKhLJ5.js} +5 -3
- package/dist/ProjectPanel-YLS4oOuU.cjs +1 -0
- package/dist/{ProjectPanel-vjK_4VSG.js → ProjectPanel-aiKhpNvr.js} +12 -10
- package/dist/{Settings-V07siWr-.js → Settings-JjYbPJrt.js} +4 -3
- package/dist/Settings-rnHnjhZ4.cjs +1 -0
- package/dist/{SidePanels-0B2_uHyb.js → SidePanels-XABN8kD3.js} +30 -28
- package/dist/SidePanels-vcWHxatg.cjs +1 -0
- package/dist/{add-page-modal-dQ4vsAOV.js → add-page-modal-Gwhl6J1F.js} +4 -3
- package/dist/{add-page-modal-ELiuGxwH.cjs → add-page-modal-o5dy8nwt.cjs} +1 -1
- package/dist/core.cjs +1 -1
- package/dist/core.js +54 -52
- package/dist/{delete-page-modal-gViErMeG.cjs → delete-page-modal-IO_9ZCm4.cjs} +1 -1
- package/dist/{delete-page-modal-gWvIto0r.js → delete-page-modal-xGWX8RHn.js} +18 -16
- package/dist/{index-aHQmo59Y.js → index-7mV_OcXd.js} +33 -32
- package/dist/{index-99vxkDWJ.cjs → index-mUPP605-.cjs} +2 -2
- package/dist/lib.cjs +4 -2
- package/dist/lib.d.ts +4 -4
- package/dist/lib.js +88 -85
- package/dist/{page-viewer-YU2ON-TT.js → page-viewer-Xl1i1V3J.js} +6 -4
- package/dist/page-viewer-pJFW_LaN.cjs +1 -0
- package/dist/{project-general-setting-m6C3KOQm.js → project-general-setting-8H1Rka2z.js} +4 -3
- package/dist/{project-general-setting-vDHVl9_W.cjs → project-general-setting-lNEoQK1n.cjs} +1 -1
- package/dist/render.d.ts +1 -1
- package/dist/{single-page-detail-GxzBw_k6.js → single-page-detail-1hsqXV8c.js} +5 -4
- package/dist/single-page-detail-VKqGt-s1.cjs +1 -0
- package/dist/studio.cjs +1 -1
- package/dist/studio.js +4 -2
- package/dist/web-blocks.cjs +2 -2
- package/dist/web-blocks.js +1 -1
- package/package.json +1 -1
- package/dist/CurrentPage-0VSOB-Hb.cjs +0 -1
- package/dist/Layers-y2knU0bT.cjs +0 -1
- package/dist/ProjectPanel-qEwohLIY.cjs +0 -1
- package/dist/Settings-ky8B7ncY.cjs +0 -1
- package/dist/SidePanels-Rf7LJBOR.cjs +0 -1
- package/dist/page-viewer-vW3LE2Lt.cjs +0 -1
- package/dist/single-page-detail-MFwjDf9d.cjs +0 -1
|
@@ -10,7 +10,7 @@ import { useTranslation as de } from "react-i18next";
|
|
|
10
10
|
import { useAtom as F } from "jotai";
|
|
11
11
|
import Pe from "react-dom";
|
|
12
12
|
import { g as En } from "./_commonjsHelpers-UyOWmZb0.js";
|
|
13
|
-
import { r as ot, u as Sn, B as Dn, E as _n } from "./index-
|
|
13
|
+
import { r as ot, u as Sn, B as Dn, E as _n } from "./index-7mV_OcXd.js";
|
|
14
14
|
import { Quill as Bn } from "react-quill";
|
|
15
15
|
import { u as On } from "./useAddBlockByDrop-uPXvrg4G.js";
|
|
16
16
|
import { useFeature as st } from "flagged";
|
|
@@ -58,6 +58,8 @@ import "./html-to-json-yjzEN9OX.js";
|
|
|
58
58
|
import "himalaya";
|
|
59
59
|
import "lodash";
|
|
60
60
|
import "lucide-react";
|
|
61
|
+
import "./web-blocks.js";
|
|
62
|
+
import "./controls-XPXGHKht.js";
|
|
61
63
|
const $n = () => {
|
|
62
64
|
const { undoCount: e, redoCount: t, undo: n, redo: s } = Te();
|
|
63
65
|
return /* @__PURE__ */ r.jsxs("div", { className: "flex items-center", children: [
|
|
@@ -817,7 +819,7 @@ function Qn() {
|
|
|
817
819
|
return a.PropTypes = a, a;
|
|
818
820
|
}, ve;
|
|
819
821
|
}
|
|
820
|
-
var
|
|
822
|
+
var Ro = ce.exports;
|
|
821
823
|
if (process.env.NODE_ENV !== "production") {
|
|
822
824
|
var Xn = ot, er = !0;
|
|
823
825
|
ce.exports = Gn()(Xn.isElement, er);
|
|
@@ -828,7 +830,7 @@ const P = /* @__PURE__ */ En(tr);
|
|
|
828
830
|
let lt, ct;
|
|
829
831
|
typeof document < "u" && (lt = document);
|
|
830
832
|
typeof window < "u" && (ct = window);
|
|
831
|
-
const dt = V.createContext({ document: lt, window: ct }), ue = () => V.useContext(dt), { Provider: nr, Consumer:
|
|
833
|
+
const dt = V.createContext({ document: lt, window: ct }), ue = () => V.useContext(dt), { Provider: nr, Consumer: Po } = dt;
|
|
832
834
|
class ut extends Ye {
|
|
833
835
|
componentDidMount() {
|
|
834
836
|
this.props.contentDidMount();
|
|
@@ -1412,10 +1414,10 @@ const Tr = () => {
|
|
|
1412
1414
|
)
|
|
1413
1415
|
}
|
|
1414
1416
|
);
|
|
1415
|
-
},
|
|
1417
|
+
}, Mo = () => /* @__PURE__ */ r.jsxs("div", { className: "flex h-full w-full flex-col", children: [
|
|
1416
1418
|
/* @__PURE__ */ r.jsx(Yn, {}),
|
|
1417
1419
|
/* @__PURE__ */ r.jsx("div", { className: "relative h-full overflow-hidden bg-slate-800/90 px-2 bg-[linear-gradient(to_right,#222_0.5px,transparent_0.5px),linear-gradient(to_bottom,#222_0.5px,transparent_0.5px)] bg-[size:12px_12px]", children: /* @__PURE__ */ r.jsx(Ke, { fallback: /* @__PURE__ */ r.jsx(rt, { className: "h-full" }), children: /* @__PURE__ */ r.jsx(_n, { children: /* @__PURE__ */ r.jsx(Ir, {}) }) }) })
|
|
1418
1420
|
] });
|
|
1419
1421
|
export {
|
|
1420
|
-
|
|
1422
|
+
Mo as default
|
|
1421
1423
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";var $e=Object.defineProperty;var Ue=(e,t,n)=>t in e?$e(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var K=(e,t,n)=>(Ue(e,typeof t!="symbol"?t+"":t,n),n);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("./jsx-runtime-Z_BpKhVy.cjs"),g=require("react"),p=require("lodash-es"),L=require("@radix-ui/react-icons"),o=require("./index-IIJ_o44s.cjs"),ne=require("react-i18next"),H=require("jotai"),ge=require("react-dom"),ze=require("./_commonjsHelpers-wDK0ZLPo.cjs"),G=require("./index-
|
|
1
|
+
"use strict";var $e=Object.defineProperty;var Ue=(e,t,n)=>t in e?$e(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var K=(e,t,n)=>(Ue(e,typeof t!="symbol"?t+"":t,n),n);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("./jsx-runtime-Z_BpKhVy.cjs"),g=require("react"),p=require("lodash-es"),L=require("@radix-ui/react-icons"),o=require("./index-IIJ_o44s.cjs"),ne=require("react-i18next"),H=require("jotai"),ge=require("react-dom"),ze=require("./_commonjsHelpers-wDK0ZLPo.cjs"),G=require("./index-mUPP605-.cjs"),Ye=require("react-quill"),Ke=require("./useAddBlockByDrop-_nd8yZBa.cjs"),Ce=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("@radix-ui/react-toggle");require("class-variance-authority");require("./utils-PTxFk6qT.cjs");require("clsx");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("flat-to-nested");require("./Functions-N3yhPYKY.cjs");require("redux-undo");require("i18next");require("react-textarea-autosize");require("react-dnd");require("@minoru/react-dnd-treeview");require("react-hotkeys-hook");require("sonner");require("./html-to-json-5UoswV2Q.cjs");require("himalaya");require("lodash");require("lucide-react");require("./web-blocks.cjs");require("./controls-Dy1qa8Dc.cjs");const et=()=>{const{undoCount:e,redoCount:t,undo:n,redo:i}=o.useCanvasHistory();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(L.ResetIcon,{})}),s.jsxRuntimeExports.jsx(o.Button,{disabled:!t,onClick:i,size:"sm",className:"rounded-full",variant:"ghost",children:s.jsxRuntimeExports.jsx(L.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(L.MobileIcon,{}),width:400},{title:"mobile_sm_title",content:"mobile_sm_content",breakpoint:"sm",icon:s.jsxRuntimeExports.jsx(L.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(L.LaptopIcon,{}),width:1420},{title:"large_desktop_2xl_title",content:"large_desktop_2xl_content",breakpoint:"2xl",icon:s.jsxRuntimeExports.jsx(L.DesktopIcon,{}),width:1920}],ve=({title:e,content:t,currentBreakpoint:n,breakpoint:i,width:a,icon:l,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:l})}),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(),l=o.useBuilderProp("breakpoints",nt),u=r=>{n.includes(r)?n.length>2&&i(n.filter(d=>d!==r)):i(d=>[...d,r])};return l.length<4?s.jsxRuntimeExports.jsx("div",{className:"flex items-center rounded-md",children:p.map(l,r=>g.createElement(ve,{...r,onClick:t,key:r.breakpoint,currentBreakpoint:e}))}):s.jsxRuntimeExports.jsxs("div",{className:"flex items-center rounded-md",children:[p.map(l.filter(r=>p.includes(n,p.toUpper(r.breakpoint))),r=>g.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(L.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(l,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(),[t]=o.useSetAllBlocks(),{createSnapshot:n}=o.useCanvasHistory(),[,i]=o.useSelectedBlockIds(),[,a]=o.useSelectedStylingBlocks(),l=g.useCallback(()=>{t([]),i([]),a([]),n()},[t,n]);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(L.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:l,children:e("yes")})]})]})]})})},ot=()=>{const e=o.useFeatureSupport("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(L.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">
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-Z_BpKhVy.cjs"),t=require("./index-IIJ_o44s.cjs"),i=require("lodash-es"),h=require("sonner"),l=require("react"),o=require("./index-mUPP605-.cjs"),j=require("lucide-react");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("@radix-ui/react-toggle");require("class-variance-authority");require("./utils-PTxFk6qT.cjs");require("./MODIFIERS-2FeVfZQ9.cjs");require("clsx");require("tailwind-merge");require("@radix-ui/react-switch");require("@radix-ui/react-slot");require("@radix-ui/react-accordion");require("@radix-ui/react-icons");require("@radix-ui/react-alert-dialog");require("@radix-ui/react-dialog");require("@radix-ui/react-label");require("@radix-ui/react-scroll-area");require("@radix-ui/react-tabs");require("@radix-ui/react-tooltip");require("@radix-ui/react-popover");require("@radix-ui/react-menubar");require("@radix-ui/react-hover-card");require("@radix-ui/react-select");require("@radix-ui/react-dropdown-menu");require("@radix-ui/react-separator");require("@radix-ui/react-toast");require("cmdk");require("@radix-ui/react-context-menu");require("react-icons-picker");require("react-dom");require("react-quill");require("jotai");require("flat-to-nested");require("./Functions-N3yhPYKY.cjs");require("redux-undo");require("@chaibuilder/runtime");require("@react-hookz/web");require("react-i18next");require("i18next");require("@floating-ui/react-dom");require("react-textarea-autosize");require("flagged");require("react-dnd");require("@minoru/react-dnd-treeview");require("react-hotkeys-hook");require("./html-to-json-5UoswV2Q.cjs");require("himalaya");require("lodash");require("./web-blocks.cjs");require("./controls-Dy1qa8Dc.cjs");const p=()=>{const{data:s}=o.useProject(),{data:u,isLoading:x}=o.usePages(),{syncState:q}=t.useSavePage(),d=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(q!=="SAVED")h.toast.error("You have unsaved changes. Please save before changing the page.");else{const g=i.find(c,{uuid:r});d(g)}};return x||i.isEmpty(n)?null:e.jsxRuntimeExports.jsx("nav",{className:"flex rounded-lg border border-gray-200 bg-gray-50 px-3 pr-0 py-1 text-gray-700 dark:border-gray-700 dark:bg-gray-800","aria-label":"Breadcrumb",children:e.jsxRuntimeExports.jsxs("ol",{className:"inline-flex items-center space-x-1 md:space-x-3",children:[e.jsxRuntimeExports.jsx("li",{className:"inline-flex items-center",children:e.jsxRuntimeExports.jsxs("div",{className:"inline-flex items-center text-sm font-medium text-gray-500 dark:text-gray-400",children:[e.jsxRuntimeExports.jsx(j.BriefcaseIcon,{className:"w-4 h-4 mr-2"}),i.capitalize(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 { ag as x, aq as h, ar as f, as as j, at as y, au as P } from "./index-_O
|
|
|
3
3
|
import { sortBy as v, filter as b, get as w, isEmpty as m, find as n, capitalize as C, map as N } from "lodash-es";
|
|
4
4
|
import { toast as S } from "sonner";
|
|
5
5
|
import { useEffect as p } from "react";
|
|
6
|
-
import { b as k, a as B, d as E, e as I } from "./index-
|
|
6
|
+
import { b as k, a as B, d as E, e as I } from "./index-7mV_OcXd.js";
|
|
7
7
|
import { BriefcaseIcon as L } from "lucide-react";
|
|
8
8
|
import "./_commonjsHelpers-UyOWmZb0.js";
|
|
9
9
|
import "@radix-ui/react-toggle";
|
|
@@ -51,11 +51,13 @@ import "react-hotkeys-hook";
|
|
|
51
51
|
import "./html-to-json-yjzEN9OX.js";
|
|
52
52
|
import "himalaya";
|
|
53
53
|
import "lodash";
|
|
54
|
-
|
|
55
|
-
|
|
54
|
+
import "./web-blocks.js";
|
|
55
|
+
import "./controls-XPXGHKht.js";
|
|
56
|
+
const Ve = () => {
|
|
57
|
+
const { data: t } = k(), { data: i, isLoading: l } = B(), { syncState: c } = x(), d = E(), [o, a] = I(), s = v(b(i, { type: "STATIC" }), (r) => w(r, "uuid") === (t == null ? void 0 : t.homepage) ? 0 : 1);
|
|
56
58
|
p(() => {
|
|
57
|
-
!m(i) && t.homepage && !n(i, { uuid:
|
|
58
|
-
}, [
|
|
59
|
+
!m(i) && t.homepage && !n(i, { uuid: o }) && a(t.homepage);
|
|
60
|
+
}, [o, i, t, a]), p(() => () => a(null), [a]);
|
|
59
61
|
const u = (r) => {
|
|
60
62
|
if (c !== "SAVED")
|
|
61
63
|
S.error("You have unsaved changes. Please save before changing the page.");
|
|
@@ -64,7 +66,7 @@ const Le = () => {
|
|
|
64
66
|
d(g);
|
|
65
67
|
}
|
|
66
68
|
};
|
|
67
|
-
return l || m(
|
|
69
|
+
return l || m(o) ? null : /* @__PURE__ */ e.jsx(
|
|
68
70
|
"nav",
|
|
69
71
|
{
|
|
70
72
|
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",
|
|
@@ -95,7 +97,7 @@ const Le = () => {
|
|
|
95
97
|
)
|
|
96
98
|
}
|
|
97
99
|
),
|
|
98
|
-
/* @__PURE__ */ e.jsxs(h, { value:
|
|
100
|
+
/* @__PURE__ */ e.jsxs(h, { value: o || "", onValueChange: u, children: [
|
|
99
101
|
/* @__PURE__ */ e.jsx(f, { 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: /* @__PURE__ */ e.jsx(j, { placeholder: "Page" }) }),
|
|
100
102
|
/* @__PURE__ */ e.jsx(y, { className: "z-[999]", children: N(s, (r) => /* @__PURE__ */ e.jsx(P, { value: r.uuid, children: r == null ? void 0 : r.name }, r.uuid)) })
|
|
101
103
|
] })
|
|
@@ -105,5 +107,5 @@ const Le = () => {
|
|
|
105
107
|
);
|
|
106
108
|
};
|
|
107
109
|
export {
|
|
108
|
-
|
|
110
|
+
Ve as default
|
|
109
111
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-Z_BpKhVy.cjs"),u=require("lodash-es"),s=require("@radix-ui/react-icons"),f=require("react-dnd"),y=require("@minoru/react-dnd-treeview"),M=require("react-i18next"),r=require("./index-IIJ_o44s.cjs"),N=require("lucide-react"),g=require("react"),O=require("./MODIFIERS-2FeVfZQ9.cjs"),B=require("./Functions-N3yhPYKY.cjs"),_=require("./index-mUPP605-.cjs"),A=require("./useAddBlockByDrop-_nd8yZBa.cjs");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("@radix-ui/react-toggle");require("class-variance-authority");require("./utils-PTxFk6qT.cjs");require("clsx");require("tailwind-merge");require("@radix-ui/react-switch");require("@radix-ui/react-slot");require("@radix-ui/react-accordion");require("@radix-ui/react-alert-dialog");require("@radix-ui/react-dialog");require("@radix-ui/react-label");require("@radix-ui/react-scroll-area");require("@radix-ui/react-tabs");require("@radix-ui/react-tooltip");require("@radix-ui/react-popover");require("@radix-ui/react-menubar");require("@radix-ui/react-hover-card");require("@radix-ui/react-select");require("@radix-ui/react-dropdown-menu");require("@radix-ui/react-separator");require("@radix-ui/react-toast");require("cmdk");require("@radix-ui/react-context-menu");require("react-icons-picker");require("react-dom");require("react-quill");require("jotai");require("flat-to-nested");require("redux-undo");require("@chaibuilder/runtime");require("@react-hookz/web");require("i18next");require("@floating-ui/react-dom");require("react-textarea-autosize");require("flagged");require("react-hotkeys-hook");require("sonner");require("./html-to-json-5UoswV2Q.cjs");require("himalaya");require("lodash");require("./web-blocks.cjs");require("./controls-Dy1qa8Dc.cjs");const C=t=>{switch(t.type){case"Image":return e.jsxRuntimeExports.jsx(s.ImageIcon,{});case"Heading":return e.jsxRuntimeExports.jsx(s.HeadingIcon,{});case"Text":return e.jsxRuntimeExports.jsx(s.TextIcon,{});case"Link":return e.jsxRuntimeExports.jsx(s.Link1Icon,{});case"Video":return e.jsxRuntimeExports.jsx(s.VideoIcon,{});case"RichText":return e.jsxRuntimeExports.jsx(s.CursorTextIcon,{});case"Button":return e.jsxRuntimeExports.jsx(s.ButtonIcon,{});case"CustomHTML":return e.jsxRuntimeExports.jsx(s.CodeIcon,{});case"Divider":return e.jsxRuntimeExports.jsx(s.DividerHorizontalIcon,{});case"Icon":return e.jsxRuntimeExports.jsx(s.SketchLogoIcon,{});case"List":return e.jsxRuntimeExports.jsx(s.RowsIcon,{});case"Paragraph":return e.jsxRuntimeExports.jsx(s.TextIcon,{});case"Row":return e.jsxRuntimeExports.jsx(s.RowsIcon,{});case"ListItem":return e.jsxRuntimeExports.jsx(s.ColumnsIcon,{});case"LineBreak":return e.jsxRuntimeExports.jsx(s.SpaceBetweenVerticallyIcon,{});case"Form":return e.jsxRuntimeExports.jsx(s.GroupIcon,{});case"Checkbox":return e.jsxRuntimeExports.jsx(s.CheckboxIcon,{});case"FormButton":return e.jsxRuntimeExports.jsx(s.ButtonIcon,{});case"Input":case"TextArea":return e.jsxRuntimeExports.jsx(s.InputIcon,{});case"Radio":return e.jsxRuntimeExports.jsx(s.RadiobuttonIcon,{});case"Select":return e.jsxRuntimeExports.jsx(s.DropdownMenuIcon,{});case"Table":return e.jsxRuntimeExports.jsx(s.TableIcon,{});case"TableHead":return e.jsxRuntimeExports.jsx(s.BorderTopIcon,{});case"TableBody":return e.jsxRuntimeExports.jsx(s.BorderAllIcon,{});case"TableRow":return e.jsxRuntimeExports.jsx(s.ViewHorizontalIcon,{});case"TableCell":return e.jsxRuntimeExports.jsx(s.DragHandleHorizontalIcon,{});case"DataProvider":return e.jsxRuntimeExports.jsx(N.DatabaseIcon,{size:16});case"Box":return e.jsxRuntimeExports.jsx(s.BoxIcon,{});default:return e.jsxRuntimeExports.jsx(s.BoxModelIcon,{})}};function P(t=""){const n={xs:"390px",sm:"640px",md:"768px",lg:"1024px",xl:"1366px","2xl":"1536px"};if(new RegExp(/\bsr-only\b/).test(t))return"Sr Only";if(new RegExp(/\b(sm|md|lg|xl|2xl):hidden\b/).test(t))return"Visible on mobile";if(t.match(/(^| )hidden( |$)/g)){const c=new RegExp(/\b(sm|md|lg|xl|2xl):(block|grid|flex|inline|inline-grid|inline-flex|inline-block)\b/),l=t.match(c);if(u.nth(l,1))return`Visible >=${n[u.nth(l,1)]}`}return""}const H=t=>{let n="";return Object.keys(t).forEach(o=>{u.startsWith(t[o],O.STYLES_KEY)&&(n=t[o])}),n},L=t=>{var R;const[,n]=r.useHighlightBlockId(),[o]=r.useHiddenBlockIds(),{isSelected:i}=t,{id:c,data:l}=t.node,d=t.depth*10,p=a=>{a.stopPropagation(),t.onToggle(t.node.id)},E=y.useDragOver(c,t.isOpen,t.onToggle),m=g.useMemo(()=>{const a=H(t.node.data);return P(a)},[t.node.data]);return e.jsxRuntimeExports.jsx("div",{onMouseEnter:()=>n(c),className:B.cn("group flex w-full items-center justify-between space-x-px py-px ",i?"bg-blue-500 text-white":"hover:bg-gray-200 dark:hover:bg-gray-800"),onClick:a=>{a.stopPropagation(),!o.includes(c)&&t.onSelect(c)},onContextMenu:()=>t.onSelect(c),style:{paddingInlineStart:d},...E,children:e.jsxRuntimeExports.jsxs("div",{className:"flex items-center",children:[e.jsxRuntimeExports.jsx("div",{className:`flex h-4 w-4 rotate-0 transform cursor-pointer items-center justify-center text-xs transition-transform duration-100 ${t.isOpen?"rotate-90":""}`,children:t.node.droppable&&e.jsxRuntimeExports.jsx("button",{onClick:p,type:"button",children:e.jsxRuntimeExports.jsx(s.TriangleRightIcon,{})})}),e.jsxRuntimeExports.jsxs("button",{type:"button",className:"flex items-center",children:[e.jsxRuntimeExports.jsx("div",{className:"-mt-1 h-3 w-3",children:e.jsxRuntimeExports.jsx(C,{type:l==null?void 0:l._type})}),e.jsxRuntimeExports.jsx("div",{className:"ml-2 truncate text-[11px]",children:((R=t.node.data)==null?void 0:R._name)||t.node.text}),m?e.jsxRuntimeExports.jsxs("span",{className:"ml-2 flex items-center text-[10px] italic "+(i?"text-gray-200":"text-gray-500"),children:["(",m,")"]}):null]})]})})},F=t=>{var o;const{item:n}=t.monitorProps;return e.jsxRuntimeExports.jsxs("div",{className:"flex w-max items-center bg-blue-200 bg-opacity-30 p-1 font-semibold text-blue-700",children:[e.jsxRuntimeExports.jsx("div",{className:"",children:e.jsxRuntimeExports.jsx(C,{type:(o=n==null?void 0:n.data)==null?void 0:o._type})}),e.jsxRuntimeExports.jsx("div",{className:"ml-2 truncate text-[11px]",children:n.text})]})},V=t=>{const n=t.depth*10+16;return e.jsxRuntimeExports.jsx("div",{className:"absolute right-0 top-0 h-0.5 -translate-y-1/2 transform bg-green-500",style:{left:n}})},z=g.lazy(()=>Promise.resolve().then(()=>require("./MarkAsGlobalBlock-S2BhHTsK.cjs"))),G=()=>{const[t]=r.useSelectedBlockIds(),[,n]=r.useCutBlockIds();return e.jsxRuntimeExports.jsxs(r.ContextMenuItem,{className:"flex items-center gap-x-4 text-xs",onClick:()=>n(t),children:[e.jsxRuntimeExports.jsx(s.ScissorsIcon,{})," Cut"]})},$=()=>{const[t]=r.useSelectedBlockIds(),[,n]=r.useCopyBlockIds();return e.jsxRuntimeExports.jsxs(r.ContextMenuItem,{className:"flex items-center gap-x-4 text-xs",onClick:()=>n(t),children:[e.jsxRuntimeExports.jsx(s.ClipboardIcon,{})," Copy"]})},K=()=>{const[t]=r.useSelectedBlockIds(),n=r.useRemoveBlocks(),o=r.useSelectedBlock();return e.jsxRuntimeExports.jsxs(r.ContextMenuItem,{disabled:(o==null?void 0:o._type)==="Slot",className:"flex items-center gap-x-4 text-xs",onClick:()=>n(t),children:[e.jsxRuntimeExports.jsx(s.TrashIcon,{})," Remove"]})},Q=({id:t=null,openMarkAsGlobalModal:n})=>{const[o]=r.useSelectedBlockIds(),i=r.useDuplicateBlocks(),{pasteBlocks:c,canPaste:l}=r.usePasteBlocks(),d=r.useBuilderProp("globalBlocksSupport",!1),p=g.useCallback(()=>{i(o)},[o,i]);return e.jsxRuntimeExports.jsxs(r.ContextMenuContent,{className:"text-xs",children:[d&&e.jsxRuntimeExports.jsx(r.ContextMenuItem,{className:"flex items-center gap-x-4 border-b text-xs",onClick:n,children:e.jsxRuntimeExports.jsxs("div",{className:"flex items-center gap-x-4",children:[e.jsxRuntimeExports.jsx(s.GlobeIcon,{})," Mark as global"]})}),e.jsxRuntimeExports.jsxs(r.ContextMenuItem,{className:"flex items-center gap-x-4 text-xs",onClick:p,children:[e.jsxRuntimeExports.jsx(s.CopyIcon,{})," Duplicate"]}),e.jsxRuntimeExports.jsx(G,{}),e.jsxRuntimeExports.jsx($,{}),e.jsxRuntimeExports.jsxs(r.ContextMenuItem,{className:"flex items-center gap-x-4 text-xs",onClick:()=>c(t),disabled:!l,children:[e.jsxRuntimeExports.jsx(s.ClipboardCopyIcon,{})," Paste"]}),e.jsxRuntimeExports.jsx(K,{})]})},U=({children:t,id:n=null})=>{const[o,i]=g.useState(!1);return e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx(r.Dialog,{open:o,onOpenChange:i,children:o&&e.jsxRuntimeExports.jsx(r.DialogContent,{children:e.jsxRuntimeExports.jsx(g.Suspense,{fallback:e.jsxRuntimeExports.jsx("div",{className:"h-96 w-full animate-pulse bg-gray-200"}),children:e.jsxRuntimeExports.jsx(z,{closeModal:()=>i(!1),id:n})})})}),e.jsxRuntimeExports.jsxs(r.ContextMenu,{children:[e.jsxRuntimeExports.jsx(r.ContextMenuTrigger,{children:t}),e.jsxRuntimeExports.jsx(Q,{id:n,openMarkAsGlobalModal:()=>i(!0)})]})]})};function Y(t){return u.map(t,n=>{const{data:o}=n;return{...o,_parent:n.parent===0?null:n.parent}})}const W=()=>{const t=r.useAllBlocks(),[n]=r.useSetAllBlocks(),[o,i,c]=r.useSelectedBlockIds(),[,l]=r.useSelectedStylingBlocks(),{t:d}=M.useTranslation(),{createSnapshot:p}=r.useCanvasHistory(),E=_.useExpandedIds(),m=A.useAddBlockByDrop(),R=async(x,j)=>{const{dragSource:h,relativeIndex:b,dropTargetId:k,monitor:q}=j;if(h){p();const D=Y(x);n(D);const T=q.getItem();i([T.id])}else await m({block:q.getItem(),dropTargetId:k,relativeIndex:b})},a=u.map(t,x=>({id:x._id,text:x._type,parent:x._parent||0,droppable:!u.isUndefined(u.find(t,{_parent:x._id})),data:x})),v=()=>{i([]),l([])},[{isOver:I},S]=f.useDrop(()=>({accept:["CHAI_BLOCK"],collect:x=>({canDrop:x.canDrop(),isOver:x.isOver()}),drop:x=>{(async()=>await m({block:x,dropTargetId:"",relativeIndex:0}))()}})),{isDragging:w}=f.useDragLayer(x=>({isDragging:x.isDragging()}));return e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:e.jsxRuntimeExports.jsx("div",{onClick:()=>v(),className:B.cn("-mx-1 -mt-1 flex h-full select-none flex-col space-y-1",w?"bg-green-50/80":"bg-background"),children:u.isEmpty(t)?e.jsxRuntimeExports.jsxs("div",{ref:S,className:`mx-1 mt-4 max-w-full h-full p-6 text-center text-sm text-gray-400 ${I?"bg-blue-200":""}`,children:[I?e.jsxRuntimeExports.jsx(s.DoubleArrowDownIcon,{className:"mx-auto h-12 w-12 animate-bounce"}):e.jsxRuntimeExports.jsx(s.StackIcon,{className:"mx-auto h-10 w-10"}),e.jsxRuntimeExports.jsx("p",{className:"mt-2",children:d(I?"drop_here_message":"tree_view_no_blocks")})]}):e.jsxRuntimeExports.jsx(r.ScrollArea,{id:"layers-view",className:"no-scrollbar h-full overflow-y-auto p-1",children:e.jsxRuntimeExports.jsx(y.Tree,{initialOpen:E,extraAcceptTypes:["CHAI_BLOCK"],tree:a,rootId:0,render:(x,{depth:j,isOpen:h,onToggle:b})=>e.jsxRuntimeExports.jsx(U,{id:x.id,children:e.jsxRuntimeExports.jsx(L,{onSelect:k=>{l([]),i([k])},isSelected:u.includes(o,x.id),node:x,depth:j,isOpen:h,onToggle:b,toggleIds:c})}),dragPreviewRender:x=>e.jsxRuntimeExports.jsx(F,{monitorProps:x}),onDrop:R,classes:{root:"h-full pt-2",draggingSource:"opacity-30",dropTarget:"bg-green-100",placeholder:"relative"},sort:!1,insertDroppableFirst:!1,canDrop:r.canDropBlock,dropTargetOffset:2,enableAnimateExpand:!0,placeholderRender:(x,{depth:j})=>e.jsxRuntimeExports.jsx(V,{node:x,depth:j})})})})})};exports.default=W;
|
|
@@ -9,7 +9,7 @@ import { DatabaseIcon as Ve } from "lucide-react";
|
|
|
9
9
|
import { useMemo as Fe, lazy as Ge, useCallback as $e, useState as Ke, Suspense as Qe } from "react";
|
|
10
10
|
import { a as Ue } from "./MODIFIERS-RiXS5Mn1.js";
|
|
11
11
|
import { c as S } from "./Functions-7jnEwJyw.js";
|
|
12
|
-
import { f as Ye } from "./index-
|
|
12
|
+
import { f as Ye } from "./index-7mV_OcXd.js";
|
|
13
13
|
import { u as qe } from "./useAddBlockByDrop-uPXvrg4G.js";
|
|
14
14
|
import "./_commonjsHelpers-UyOWmZb0.js";
|
|
15
15
|
import "@radix-ui/react-toggle";
|
|
@@ -52,6 +52,8 @@ import "sonner";
|
|
|
52
52
|
import "./html-to-json-yjzEN9OX.js";
|
|
53
53
|
import "himalaya";
|
|
54
54
|
import "lodash";
|
|
55
|
+
import "./web-blocks.js";
|
|
56
|
+
import "./controls-XPXGHKht.js";
|
|
55
57
|
const T = (t) => {
|
|
56
58
|
switch (t.type) {
|
|
57
59
|
case "Image":
|
|
@@ -281,7 +283,7 @@ function ct(t) {
|
|
|
281
283
|
};
|
|
282
284
|
});
|
|
283
285
|
}
|
|
284
|
-
const
|
|
286
|
+
const xs = () => {
|
|
285
287
|
const t = Ee(), [s] = Ae(), [o, r, a] = u(), [, c] = He(), { t: x } = fe(), { createSnapshot: d } = Pe(), j = Ye(), m = qe(), g = async (n, p) => {
|
|
286
288
|
const { dragSource: b, relativeIndex: I, dropTargetId: f, monitor: k } = p;
|
|
287
289
|
if (b) {
|
|
@@ -375,5 +377,5 @@ const ls = () => {
|
|
|
375
377
|
) });
|
|
376
378
|
};
|
|
377
379
|
export {
|
|
378
|
-
|
|
380
|
+
xs as default
|
|
379
381
|
};
|
|
@@ -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-mUPP605-.cjs");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("i18next");require("react-i18next");require("./index-IIJ_o44s.cjs");require("@radix-ui/react-toggle");require("class-variance-authority");require("./utils-PTxFk6qT.cjs");require("./MODIFIERS-2FeVfZQ9.cjs");require("clsx");require("tailwind-merge");require("@radix-ui/react-switch");require("@radix-ui/react-slot");require("@radix-ui/react-accordion");require("@radix-ui/react-icons");require("@radix-ui/react-alert-dialog");require("@radix-ui/react-dialog");require("@radix-ui/react-label");require("@radix-ui/react-scroll-area");require("@radix-ui/react-tabs");require("@radix-ui/react-tooltip");require("@radix-ui/react-popover");require("@radix-ui/react-menubar");require("@radix-ui/react-hover-card");require("@radix-ui/react-select");require("@radix-ui/react-dropdown-menu");require("@radix-ui/react-separator");require("@radix-ui/react-toast");require("cmdk");require("@radix-ui/react-context-menu");require("react-icons-picker");require("react-dom");require("react-quill");require("jotai");require("flat-to-nested");require("./Functions-N3yhPYKY.cjs");require("redux-undo");require("@chaibuilder/runtime");require("@react-hookz/web");require("@floating-ui/react-dom");require("react-textarea-autosize");require("flagged");require("react-dnd");require("@minoru/react-dnd-treeview");require("react-hotkeys-hook");require("sonner");require("./html-to-json-5UoswV2Q.cjs");require("himalaya");require("lodash");require("lucide-react");require("./web-blocks.cjs");require("./controls-Dy1qa8Dc.cjs");const a=u.lazy(()=>Promise.resolve().then(()=>require("./add-page-modal-o5dy8nwt.cjs"))),x=u.lazy(()=>Promise.resolve().then(()=>require("./page-viewer-pJFW_LaN.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;
|
|
@@ -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-7mV_OcXd.js";
|
|
5
5
|
import "./_commonjsHelpers-UyOWmZb0.js";
|
|
6
6
|
import "i18next";
|
|
7
7
|
import "react-i18next";
|
|
@@ -51,7 +51,9 @@ import "./html-to-json-yjzEN9OX.js";
|
|
|
51
51
|
import "himalaya";
|
|
52
52
|
import "lodash";
|
|
53
53
|
import "lucide-react";
|
|
54
|
-
|
|
54
|
+
import "./web-blocks.js";
|
|
55
|
+
import "./controls-XPXGHKht.js";
|
|
56
|
+
const x = i.lazy(() => import("./add-page-modal-Gwhl6J1F.js")), g = i.lazy(() => import("./page-viewer-Xl1i1V3J.js")), jt = () => {
|
|
55
57
|
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
58
|
return /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
|
|
57
59
|
/* @__PURE__ */ t.jsxs("div", { className: "flex items-center justify-between rounded-md bg-background/30 p-1", children: [
|
|
@@ -63,5 +65,5 @@ const x = i.lazy(() => import("./add-page-modal-dQ4vsAOV.js")), g = i.lazy(() =>
|
|
|
63
65
|
] });
|
|
64
66
|
};
|
|
65
67
|
export {
|
|
66
|
-
|
|
68
|
+
jt as default
|
|
67
69
|
};
|
|
@@ -0,0 +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-IIJ_o44s.cjs"),a=require("./index-mUPP605-.cjs");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("@radix-ui/react-toggle");require("class-variance-authority");require("./utils-PTxFk6qT.cjs");require("./MODIFIERS-2FeVfZQ9.cjs");require("clsx");require("tailwind-merge");require("@radix-ui/react-switch");require("@radix-ui/react-slot");require("@radix-ui/react-accordion");require("@radix-ui/react-icons");require("@radix-ui/react-alert-dialog");require("@radix-ui/react-dialog");require("@radix-ui/react-label");require("@radix-ui/react-scroll-area");require("@radix-ui/react-tabs");require("@radix-ui/react-tooltip");require("@radix-ui/react-popover");require("@radix-ui/react-menubar");require("@radix-ui/react-hover-card");require("@radix-ui/react-select");require("@radix-ui/react-dropdown-menu");require("@radix-ui/react-separator");require("@radix-ui/react-toast");require("cmdk");require("@radix-ui/react-context-menu");require("react-icons-picker");require("react-dom");require("react-quill");require("jotai");require("flat-to-nested");require("./Functions-N3yhPYKY.cjs");require("redux-undo");require("@chaibuilder/runtime");require("@react-hookz/web");require("react-i18next");require("i18next");require("@floating-ui/react-dom");require("react-textarea-autosize");require("flagged");require("react-dnd");require("@minoru/react-dnd-treeview");require("react-hotkeys-hook");require("sonner");require("./html-to-json-5UoswV2Q.cjs");require("himalaya");require("lodash");require("lucide-react");require("./web-blocks.cjs");require("./controls-Dy1qa8Dc.cjs");const d=r.lazy(()=>Promise.resolve().then(()=>require("./project-general-setting-lNEoQK1n.cjs"))),q=r.lazy(()=>Promise.resolve().then(()=>require("./project-seo-setting-9JGBPzcA.cjs"))),c=e.jsxRuntimeExports.jsx("div",{className:"px-3",children:e.jsxRuntimeExports.jsx("div",{className:"h-52 w-full animate-pulse rounded-md bg-gray-100"})}),l=t=>t&&x.isEmpty(t.seoData)?{...t,seoData:{title:"",description:"",image:""}}:t;function m(){const t=a.useUpdateProject(),{data:n}=a.useProject(),[i,o]=r.useState(l(n||{})),u=r.useRef(i);return r.useEffect(()=>()=>{x.isEqual(n,u.current)||t.mutate(u.current,{onSuccess:()=>o(u.current)})},[u]),r.useEffect(()=>{u.current=i},[i]),e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx("div",{className:"flex items-center justify-between rounded-md bg-background/30 p-1",children:e.jsxRuntimeExports.jsx("h1",{className:"px-1 font-semibold",children:"Website Settings"})}),e.jsxRuntimeExports.jsx("hr",{className:"-mx-1"}),e.jsxRuntimeExports.jsx("div",{className:"-mx-1",children:e.jsxRuntimeExports.jsxs(s.Accordion,{type:"single",className:"w-full",defaultValue:"GENERAL",children:[e.jsxRuntimeExports.jsxs(s.AccordionItem,{value:"GENERAL",className:"border-b-2 border-slate-100 dark:border-slate-800",children:[e.jsxRuntimeExports.jsx(s.AccordionTrigger,{className:"bg-slate-200 px-2.5 py-1.5 font-medium hover:bg-slate-100 hover:no-underline dark:bg-slate-900 dark:hover:bg-slate-800",children:"General Settings"}),e.jsxRuntimeExports.jsx(s.AccordionContent,{className:"px-2 pt-4 text-sm",children:e.jsxRuntimeExports.jsx(r.Suspense,{fallback:c,children:e.jsxRuntimeExports.jsx(d,{_projectData:i,seany:o})})})]}),e.jsxRuntimeExports.jsxs(s.AccordionItem,{value:"SEO",className:"border-b-2 border-slate-100 dark:border-slate-800",children:[e.jsxRuntimeExports.jsx(s.AccordionTrigger,{className:"bg-slate-200 px-2.5 py-1.5 font-medium hover:bg-slate-100 hover:no-underline dark:bg-slate-900 dark:hover:bg-slate-800",children:"SEO Settings"}),e.jsxRuntimeExports.jsx(s.AccordionContent,{className:"px-1 pt-4 text-sm",children:e.jsxRuntimeExports.jsx(r.Suspense,{fallback:c,children:e.jsxRuntimeExports.jsx(q,{_projectData:i,seany:o})})})]})]})})]})}exports.default=m;
|
|
@@ -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 { bg as h, bh as n, bi as l, bj as c } from "./index-_OgCuSUz.js";
|
|
5
|
-
import { c as f, b as g } from "./index-
|
|
5
|
+
import { c as f, b as g } from "./index-7mV_OcXd.js";
|
|
6
6
|
import "./_commonjsHelpers-UyOWmZb0.js";
|
|
7
7
|
import "@radix-ui/react-toggle";
|
|
8
8
|
import "class-variance-authority";
|
|
@@ -51,18 +51,20 @@ import "./html-to-json-yjzEN9OX.js";
|
|
|
51
51
|
import "himalaya";
|
|
52
52
|
import "lodash";
|
|
53
53
|
import "lucide-react";
|
|
54
|
-
|
|
54
|
+
import "./web-blocks.js";
|
|
55
|
+
import "./controls-XPXGHKht.js";
|
|
56
|
+
const N = m.lazy(() => import("./project-general-setting-8H1Rka2z.js")), S = m.lazy(() => import("./project-seo-setting-dXclexQW.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
57
|
...r,
|
|
56
58
|
seoData: { title: "", description: "", image: "" }
|
|
57
59
|
} : r;
|
|
58
|
-
function
|
|
59
|
-
const r = f(), { data:
|
|
60
|
-
u(
|
|
60
|
+
function Et() {
|
|
61
|
+
const r = f(), { data: i } = g(), [e, s] = m.useState(
|
|
62
|
+
u(i || {})
|
|
61
63
|
), o = x(e);
|
|
62
64
|
return a(
|
|
63
65
|
() => () => {
|
|
64
|
-
b(
|
|
65
|
-
onSuccess: () =>
|
|
66
|
+
b(i, o.current) || r.mutate(o.current, {
|
|
67
|
+
onSuccess: () => s(o.current)
|
|
66
68
|
});
|
|
67
69
|
},
|
|
68
70
|
[o]
|
|
@@ -74,15 +76,15 @@ function St() {
|
|
|
74
76
|
/* @__PURE__ */ t.jsx("div", { className: "-mx-1", children: /* @__PURE__ */ t.jsxs(h, { type: "single", className: "w-full", defaultValue: "GENERAL", children: [
|
|
75
77
|
/* @__PURE__ */ t.jsxs(n, { value: "GENERAL", className: "border-b-2 border-slate-100 dark:border-slate-800", children: [
|
|
76
78
|
/* @__PURE__ */ t.jsx(l, { 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" }),
|
|
77
|
-
/* @__PURE__ */ t.jsx(c, { className: "px-2 pt-4 text-sm", children: /* @__PURE__ */ t.jsx(p, { fallback: d, children: /* @__PURE__ */ t.jsx(N, { _projectData: e, seany:
|
|
79
|
+
/* @__PURE__ */ t.jsx(c, { className: "px-2 pt-4 text-sm", children: /* @__PURE__ */ t.jsx(p, { fallback: d, children: /* @__PURE__ */ t.jsx(N, { _projectData: e, seany: s }) }) })
|
|
78
80
|
] }),
|
|
79
81
|
/* @__PURE__ */ t.jsxs(n, { value: "SEO", className: "border-b-2 border-slate-100 dark:border-slate-800", children: [
|
|
80
82
|
/* @__PURE__ */ t.jsx(l, { 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" }),
|
|
81
|
-
/* @__PURE__ */ t.jsx(c, { className: "px-1 pt-4 text-sm", children: /* @__PURE__ */ t.jsx(p, { fallback: d, children: /* @__PURE__ */ t.jsx(S, { _projectData: e, seany:
|
|
83
|
+
/* @__PURE__ */ t.jsx(c, { className: "px-1 pt-4 text-sm", children: /* @__PURE__ */ t.jsx(p, { fallback: d, children: /* @__PURE__ */ t.jsx(S, { _projectData: e, seany: s }) }) })
|
|
82
84
|
] })
|
|
83
85
|
] }) })
|
|
84
86
|
] });
|
|
85
87
|
}
|
|
86
88
|
export {
|
|
87
|
-
|
|
89
|
+
Et as default
|
|
88
90
|
};
|
|
@@ -9,7 +9,7 @@ import { a$ as Yt, b0 as Ft, B as ge, b1 as Xt, b2 as Zt, b3 as Wt, b4 as Ut, b5
|
|
|
9
9
|
import { u as kr } from "./controls-XPXGHKht.js";
|
|
10
10
|
import { Check as Nr, EditIcon as _r, TrashIcon as Sr } from "lucide-react";
|
|
11
11
|
import { getBlockComponent as tt, getChaiDataProviders as Tr } from "@chaibuilder/runtime";
|
|
12
|
-
import { E as rt, u as lt } from "./index-
|
|
12
|
+
import { E as rt, u as lt } from "./index-7mV_OcXd.js";
|
|
13
13
|
import Rr from "@rjsf/core";
|
|
14
14
|
import Vr from "@rjsf/validator-ajv8";
|
|
15
15
|
import { useAtom as Hr } from "jotai";
|
|
@@ -57,6 +57,7 @@ import "sonner";
|
|
|
57
57
|
import "./html-to-json-yjzEN9OX.js";
|
|
58
58
|
import "himalaya";
|
|
59
59
|
import "lodash";
|
|
60
|
+
import "./web-blocks.js";
|
|
60
61
|
const Ar = $.lazy(() => import("react-json-view"));
|
|
61
62
|
function Lr(r) {
|
|
62
63
|
const s = [], t = {};
|
|
@@ -2123,7 +2124,7 @@ const xl = {
|
|
|
2123
2124
|
"-": 1,
|
|
2124
2125
|
deg: 1,
|
|
2125
2126
|
ms: 0.1
|
|
2126
|
-
},
|
|
2127
|
+
}, vs = () => {
|
|
2127
2128
|
const r = q(), { t: s } = K(), [t, o] = $.useState(""), [l, d] = $.useState({
|
|
2128
2129
|
onDrag: (i) => i,
|
|
2129
2130
|
onDragEnd: (i) => i,
|
|
@@ -2187,5 +2188,5 @@ const xl = {
|
|
|
2187
2188
|
] }) });
|
|
2188
2189
|
};
|
|
2189
2190
|
export {
|
|
2190
|
-
|
|
2191
|
+
vs as default
|
|
2191
2192
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var ae=Object.create;var K=Object.defineProperty;var pe=Object.getOwnPropertyDescriptor;var ue=Object.getOwnPropertyNames;var de=Object.getPrototypeOf,ce=Object.prototype.hasOwnProperty;var xe=(s,n,r,l)=>{if(n&&typeof n=="object"||typeof n=="function")for(let i of ue(n))!ce.call(s,i)&&i!==r&&K(s,i,{get:()=>n[i],enumerable:!(l=pe(n,i))||l.enumerable});return s};var me=(s,n,r)=>(r=s!=null?ae(de(s)):{},xe(n||!s||!s.__esModule?K(r,"default",{value:s,enumerable:!0}):r,s));Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-Z_BpKhVy.cjs"),m=require("react"),z=require("@react-hookz/web"),t=require("lodash-es"),A=require("react-i18next"),d=require("@radix-ui/react-icons"),o=require("./index-IIJ_o44s.cjs"),ge=require("./controls-Dy1qa8Dc.cjs"),Y=require("lucide-react"),Z=require("@chaibuilder/runtime"),q=require("./index-mUPP605-.cjs"),ye=require("@rjsf/core"),he=require("@rjsf/validator-ajv8"),be=require("jotai"),fe=require("react-autosuggest"),je=require("fuse.js"),B=require("./utils-PTxFk6qT.cjs"),ve=require("./MODIFIERS-2FeVfZQ9.cjs");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("@radix-ui/react-toggle");require("class-variance-authority");require("@radix-ui/react-switch");require("@radix-ui/react-slot");require("@radix-ui/react-accordion");require("@radix-ui/react-alert-dialog");require("@radix-ui/react-dialog");require("@radix-ui/react-label");require("@radix-ui/react-scroll-area");require("@radix-ui/react-tabs");require("@radix-ui/react-tooltip");require("@radix-ui/react-popover");require("@radix-ui/react-menubar");require("@radix-ui/react-hover-card");require("@radix-ui/react-select");require("@radix-ui/react-dropdown-menu");require("@radix-ui/react-separator");require("@radix-ui/react-toast");require("cmdk");require("@radix-ui/react-context-menu");require("react-icons-picker");require("react-dom");require("react-quill");require("flat-to-nested");require("./Functions-N3yhPYKY.cjs");require("clsx");require("tailwind-merge");require("redux-undo");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-5UoswV2Q.cjs");require("himalaya");require("lodash");require("./web-blocks.cjs");function Re(s){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(s){for(const r in s)if(r!=="default"){const l=Object.getOwnPropertyDescriptor(s,r);Object.defineProperty(n,r,l.get?l:{enumerable:!0,get:()=>s[r]})}}return n.default=s,Object.freeze(n)}const M=Re(m),Ee=m.lazy(()=>import("react-json-view"));function we(s){const n=[],r={};function l(i,c){t.forEach(c,(a,x)=>{const u=i?`${i}.${x}`:x,g=t.isArray(a)?"list":typeof a;n.push(u),r[u]=g==="string"?"text":g==="object"?"model":g,g==="object"&&!t.isArray(a)&&l(u,a)})}return l("",t.omit(s,["styles","_type","_id","_name","_bindings"])),{paths:n,pathsType:r}}const F=({data:s,fullView:n})=>{if(!s)return null;const r=typeof s;return n?typeof s=="object"?e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx("div",{className:"h-3"}),e.jsxRuntimeExports.jsx(q.ErrorBoundary,{children:e.jsxRuntimeExports.jsx(Ee,{style:{maxHeight:"40vh",overflowY:"auto"},name:"Content",enableClipboard:!1,displayObjectSize:!1,displayDataTypes:!1,src:s,collapsed:!0})})]}):e.jsxRuntimeExports.jsxs("div",{className:"text-gray-800/50 text-[12px] leading-4 w-full max-h-36 overflow-x-hidden overflow-y-auto",children:[e.jsxRuntimeExports.jsx("span",{className:"font-medium text-gray-800/80",children:"Content: "}),s]}):e.jsxRuntimeExports.jsx("div",{className:"text-[10px] text-gray-800/50 leading-3 whitespace-nowrap overflow-hidden w-full",children:t.truncate(r==="object"?JSON.stringify(s):s,{length:40})})},G=({type:s,value:n="",setValue:r,data:l,onChange:i,dataType:c,appliedBindings:a})=>{const{paths:x,pathsType:u}=we(l),g=s==="PROP"?Z.getBlockComponent(l==null?void 0:l._type):{},f=s==="PROP",[p,b]=m.useState(!1),h=m.useMemo(()=>s==="PROP"?x.filter(y=>!t.includes(a,y)&&t.get(g,`props.${t.first(t.split(y,"."))}.binding`)):x.filter(y=>c===t.get(u,y,"")),[s,x,a,c,g]);return m.useEffect(()=>{n&&i(n)},[n,s]),e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsxs("div",{className:"flex items-center space-x-4",children:[e.jsxRuntimeExports.jsx("p",{className:"text-sm text-muted-foreground",children:t.startCase(t.toLower(s))}),e.jsxRuntimeExports.jsxs(o.Popover,{open:p,onOpenChange:b,children:[e.jsxRuntimeExports.jsx(o.PopoverTrigger,{asChild:!0,children:e.jsxRuntimeExports.jsx(o.Button,{variant:"outline",size:"sm",className:` ${t.isEmpty(n)?"bg-blue-500 text-gray-100 hover:bg-blue-400 hover:text-white w-44 justify-center":"min-w-[350px] justify-between items-center"}`,children:n?e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsxs("span",{className:"text-sm pr-8",children:[f&&e.jsxRuntimeExports.jsx("span",{className:"text-[10px] text-purple-500 bg-purple-100 px-2 py-0.5 mr-2 rounded-full",children:t.startCase(c)}),n]}),e.jsxRuntimeExports.jsx("span",{className:"text-[9px] text-blue-400 underline cursor-pointer hover:text-blue-700",children:"Change"})]}):e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:["+ Set ",t.startCase(t.toLower(s))]})})}),e.jsxRuntimeExports.jsx(o.PopoverContent,{className:"p-0 z-[999] min-w-[300px]",side:"right",align:"start",children:e.jsxRuntimeExports.jsxs(o.Command,{children:[e.jsxRuntimeExports.jsx(o.CommandInput,{placeholder:`Choose ${t.toLower(s)}...`}),e.jsxRuntimeExports.jsxs(o.CommandList,{children:[e.jsxRuntimeExports.jsx(o.CommandEmpty,{children:"No results found."}),e.jsxRuntimeExports.jsx(o.CommandGroup,{children:t.map(h,y=>e.jsxRuntimeExports.jsxs(o.CommandItem,{value:y,className:`cursor-pointer ${f?"flex justify-between items-center":"flex flex-col items-start justify-start"}`,onSelect:v=>{r(t.find(h,w=>w===v)||null),b(!1)},children:[e.jsxRuntimeExports.jsxs("div",{className:"flex items-center gap-x-2",children:[e.jsxRuntimeExports.jsx(Y.Check,{className:`w-4 h-4 text-green-500 ${n===y?"":"opacity-0"}`}),y]}),f?e.jsxRuntimeExports.jsx("div",{children:e.jsxRuntimeExports.jsx("span",{className:"text-[10px] text-purple-500 bg-purple-100 px-2 py-0.5 rounded-full",children:t.startCase(t.get(u,y,""))})}):e.jsxRuntimeExports.jsx("div",{className:"pl-6",children:e.jsxRuntimeExports.jsx(F,{data:t.get(l,y)})})]},y))})]})]})})]})]}),!f&&!t.isEmpty(n)&&e.jsxRuntimeExports.jsx("div",{className:"pt-2",children:e.jsxRuntimeExports.jsx(F,{data:t.get(l,n,""),fullView:!0})})]})},Ce=({appliedBindings:s=[],onAddBinding:n,editMode:r,item:l})=>{const[i,c]=m.useState(r?l.key:""),[a,x]=m.useState(r?l.value:""),u=o.useSelectedBlock(),[g]=q.useChaiExternalData(),f=m.useCallback((h,y)=>{if(t.isEmpty(h))return"";{const v=t.get(y==="PROP"?u:g,h,"");if(t.isArray(v))return"list";const w=typeof v;return w==="string"?"text":w==="object"?"model":w}},[u,g]),[p,b]=m.useState(r?f(l.key,"PROP"):"");return e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsxs(o.DialogHeader,{children:[e.jsxRuntimeExports.jsx(o.DialogTitle,{children:"Add Data Binding"}),e.jsxRuntimeExports.jsx(o.DialogDescription,{className:"text-xs",children:"Add prop and path of binding. Click save when you're done."})]}),e.jsxRuntimeExports.jsxs("div",{className:"flex flex-col gap-1 relative",children:[e.jsxRuntimeExports.jsx(G,{type:"PROP",isDisabled:!1,placeholder:"Enter prop key",value:i,setValue:c,onChange:h=>{const y=f(h,"PROP");c(h),p!==y&&x(""),b(y)},data:u,dataType:p,appliedBindings:s}),e.jsxRuntimeExports.jsx("div",{className:"h-2"}),e.jsxRuntimeExports.jsx(G,{type:"PATH",isDisabled:t.isEmpty(i),placeholder:"Enter data path",value:a,setValue:x,onChange:h=>{const y=f(h,"PATH");x(p===y?h:"")},data:g,dataType:p,appliedBindings:s})]}),e.jsxRuntimeExports.jsx(o.DialogFooter,{children:e.jsxRuntimeExports.jsx(o.Button,{type:"submit",className:"mt-4",disabled:t.isEmpty(i)&&t.isEmpty(a),onClick:()=>n({key:i,value:a}),children:"Save"})})]})},re=({disabled:s,children:n,onAddBinding:r,appliedBindings:l,editMode:i=!0,item:c={}})=>{const[a,x]=m.useState(!1);return e.jsxRuntimeExports.jsxs(o.Dialog,{children:[e.jsxRuntimeExports.jsx(o.DialogTrigger,{disabled:s,asChild:!0,onClick:()=>x(!0),children:n}),a&&e.jsxRuntimeExports.jsx(o.DialogContent,{children:e.jsxRuntimeExports.jsx(Ce,{item:c,editMode:i,appliedBindings:l,onAddBinding:u=>{r(u),x(!1)}})})]})},ke=({item:s,onAddBinding:n,onRemove:r,selectedBlock:l,dataProvider:i,appliedBindings:c})=>{const[a,x]=m.useState("string"),u=(g,f)=>{if(t.isEmpty(g))return"";{const p=t.get(f==="PROP"?l:i,g,"");if(t.isArray(p))return"list";const b=typeof p;return b==="string"?"text":b==="object"?"model":b}};return m.useEffect(()=>x(()=>u(s.key,"PROP")),[s.key]),e.jsxRuntimeExports.jsxs("div",{className:"flex flex-col border border-gray-200 relative rounded-md p-2",children:[e.jsxRuntimeExports.jsx("div",{className:"text-gray-500 font-normal text-sm",children:s.key}),e.jsxRuntimeExports.jsx("div",{className:"font-medium leading-5",children:s.value}),e.jsxRuntimeExports.jsx(F,{data:t.get(i,s.value,"")}),e.jsxRuntimeExports.jsxs("div",{className:"flex items-center justify-end gap-x-2",children:[e.jsxRuntimeExports.jsx(re,{editMode:!0,onAddBinding:n,appliedBindings:c,item:s,children:e.jsxRuntimeExports.jsx(Y.EditIcon,{className:"h-6 w-6 mt-1 cursor-pointer rounded border hover:bg-blue-400 hover:text-white border-blue-400 p-1 text-blue-400 hover:scale-105 duration-200"})}),e.jsxRuntimeExports.jsx(Y.TrashIcon,{onClick:()=>r(),className:"h-6 w-6 mt-1 cursor-pointer rounded border hover:bg-red-400 hover:text-white border-red-400 p-1 text-red-400 hover:scale-105 duration-200"})]}),!t.isEmpty(a)&&!t.isEmpty(s.key)&&e.jsxRuntimeExports.jsx("div",{className:"mt-px absolute right-0 top-1 text-purple-600 text-[10px] flex items-center font-medium h-4 px-2 rounded-full",children:t.startCase(a)})]})},Ne=({bindingData:s,onChange:n})=>{const r=o.useSelectedBlock(),[l]=q.useChaiExternalData(),i=Z.getChaiDataProviders(),[c,a]=m.useState(t.map(s,(p,b)=>({key:b,value:p})));m.useEffect(()=>{a(t.map(s,(p,b)=>({key:b,value:p})))},[r==null?void 0:r._id]);const x=m.useMemo(()=>{if(t.isEmpty(l))return!0;if(t.isEmpty(c))return!1;const p=t.last(c);return t.isEmpty(p==null?void 0:p.key)||t.isEmpty(p==null?void 0:p.value)},[l,c]),u=p=>{const b=t.filter(c,h=>h.key!==p.key);a([...b,p]),f([...b,p])},g=p=>{const b=t.filter(c,(h,y)=>p!==y);f([...b])},f=m.useCallback((p=[])=>{if(a(p),t.isEmpty(p)){n({});return}const b={};t.forEach(p,h=>{!t.isEmpty(h==null?void 0:h.key)&&!t.isEmpty(h==null?void 0:h.value)&&t.set(b,h.key,h.value)}),n(b)},[n]);return t.isEmpty(i)?e.jsxRuntimeExports.jsx("div",{className:"w-full flex items-center justify-center",children:e.jsxRuntimeExports.jsxs("p",{className:"text-gray-500 mb-1.5 text-xs",children:["You have no data providers registered. Please add a data provider to your project. ",e.jsxRuntimeExports.jsx("br",{}),e.jsxRuntimeExports.jsx("a",{className:"text-blue-500",href:"https://chaibuilder.com/docs/registering-data-providers",target:"_blank",children:"Learn more"})]})}):e.jsxRuntimeExports.jsxs("div",{className:"space-y-2",children:[t.map(c,(p,b)=>e.jsxRuntimeExports.jsx(ke,{item:p,onAddBinding:u,onRemove:()=>g(b),selectedBlock:r,dataProvider:l,appliedBindings:t.map(c,"key")},p.key)),e.jsxRuntimeExports.jsxs(o.Tooltip,{delayDuration:200,children:[e.jsxRuntimeExports.jsx(o.TooltipTrigger,{className:"w-full",children:e.jsxRuntimeExports.jsx(re,{disabled:x,appliedBindings:t.map(c,"key"),onAddBinding:u,children:e.jsxRuntimeExports.jsx("span",{className:`w-full px-5 py-1.5 text-xs rounded-md font-medium duration-200 ${x?"cursor-not-allowed bg-gray-200 text-gray-400":"bg-blue-700/20 text-blue-800 hover:bg-blue-700/30"}`,children:t.isEmpty(l)?e.jsxRuntimeExports.jsx("small",{className:"text-gray-500 text-[9.5px]",children:"No data provider has been set up for this page"}):"+ Add Data Binding"})})}),x&&e.jsxRuntimeExports.jsx(o.TooltipContent,{sideOffset:-55,className:"text-[11px]",children:t.isEmpty(l)?"No data provider has been set up for this page.":"Complete last added data binding to add more"})]})]})},Se=()=>e.jsxRuntimeExports.jsx("div",{className:"text-xs border rounded-sm p-1 mt-1 border-orange-500 text-orange-500 bg-orange-100",children:"Data binding is set for this field"}),O=m.memo(({createHistorySnapshot:s,properties:n,formData:r,onChange:l})=>{const i={type:"object",properties:{}},c={};return Object.keys(n).forEach(a=>{const x=n[a];if(t.includes(["slot","styles"],x.type))return;const u=a;i.properties[u]=o.getBlockJSONFromSchemas(x),c[u]=o.getBlockJSONFromUISchemas(x)}),e.jsxRuntimeExports.jsx(ye,{widgets:{binding:Se,richtext:o.RichTextEditorField,icon:o.IconPickerField,image:o.ImagePickerField},fields:{link:o.LinkField},idSeparator:".",autoComplete:"off",omitExtraData:!1,liveOmit:!1,liveValidate:!1,validator:he,uiSchema:c,onBlur:s,schema:i,formData:r,onChange:l})});function Te(){const s=o.useSelectedBlock(),{createSnapshot:n}=o.useCanvasHistory(),r=o.useUpdateBlocksPropsRealtime(),l=Z.getBlockComponent(s._type),i={...s},c=o.useBuilderProp("dataBindingSupport",!1),a=()=>n(),x=({formData:p},b)=>{if(b){const h=b.replace("root.","");r([s._id],{[h]:t.get(p,h)})}},u={_name:ge.u({title:"Name",default:t.get(s,"_name",s._type)})},g=t.keys(t.get(i,"_bindings",{})),f=m.useMemo(()=>{const p=t.cloneDeep(t.get(l,"props",{}));return c&&t.each(g,b=>delete p[b]),p},[l,g,c]);return e.jsxRuntimeExports.jsxs("div",{className:"overflow-x-hidden",children:[e.jsxRuntimeExports.jsx(O,{onChange:x,createHistorySnapshot:a,formData:i,properties:u}),e.jsxRuntimeExports.jsx("hr",{className:"mt-4"}),c?e.jsxRuntimeExports.jsxs(o.Accordion,{type:"multiple",defaultValue:["STATIC","BINDING"],className:"h-full w-full",children:[e.jsxRuntimeExports.jsxs(o.AccordionItem,{value:"BINDING",children:[e.jsxRuntimeExports.jsx(o.AccordionTrigger,{className:"px-3 py-2 text-xs hover:no-underline bg-gray-100 ml-1",children:e.jsxRuntimeExports.jsxs("div",{className:"flex items-center gap-x-2",children:[e.jsxRuntimeExports.jsx("div",{className:`h-[8px] w-[8px] rounded-full ${t.isEmpty(t.get(s,"_bindings",{}))?"bg-gray-300":"bg-blue-500"}`}),"Data Binding"]})}),e.jsxRuntimeExports.jsx(o.AccordionContent,{className:"pt-4 px-4",children:e.jsxRuntimeExports.jsx(Ne,{bindingData:t.get(i,"_bindings",{}),onChange:p=>{x({formData:{...i,_bindings:p}},"root._bindings")}})})]}),e.jsxRuntimeExports.jsxs(o.AccordionItem,{value:"STATIC",children:[e.jsxRuntimeExports.jsx(o.AccordionTrigger,{className:"px-3 py-2 text-xs hover:no-underline bg-gray-100 ml-1",children:e.jsxRuntimeExports.jsxs("div",{className:"flex items-center gap-x-2",children:[e.jsxRuntimeExports.jsx("div",{className:"h-[8px] w-[8px] rounded-full bg-blue-500"}),"Static Content"]})}),e.jsxRuntimeExports.jsxs(o.AccordionContent,{className:"pt-4",children:[t.isEmpty(g)?null:e.jsxRuntimeExports.jsxs("div",{className:"text-xs mx-4 border rounded-sm p-1 mb-1 mt-0 border-orange-500 text-orange-500 bg-orange-100",children:["Data binding is set for ",e.jsxRuntimeExports.jsx("b",{children:t.map(g,t.capitalize).join(", ")})," ",g.length===1?"property":"properties",". Remove data binding to edit static content."]}),e.jsxRuntimeExports.jsx(O,{onChange:x,createHistorySnapshot:a,formData:i,properties:f})]})]})]}):e.jsxRuntimeExports.jsx(O,{onChange:x,createHistorySnapshot:a,formData:i,properties:f}),e.jsxRuntimeExports.jsx("div",{className:"pb-60"})]})}const J=new je(B.ALL_TW_CLASSES,{isCaseSensitive:!1,threshold:.2,minMatchCharLength:2,keys:["name"]});function Ie(){var I;const[s]=o.useSelectedStylingBlocks(),n=o.useSelectedBlock(),r=o.useAddClassesToBlocks(),l=o.useRemoveClassesFromBlocks(),[i]=o.useSelectedBlockIds(),[c,a]=m.useState(""),x=(I=t.first(s))==null?void 0:I.prop,u=t.reject((t.get(n,x,"").replace(ve.STYLES_KEY,"").split(",").pop()||"").split(" "),t.isEmpty),g=()=>{const E=c.trim().toLowerCase().replace(/ +(?= )/g,"").split(" ");r(i,E,!0),a("")},[f,p]=m.useState([]),b=({value:E})=>{const T=E.trim().toLowerCase(),_=T.match(/.+:/g);let C=[];if(_&&_.length>0){const[S]=_,V=T.replace(S,"");C=J.search(V).map(j=>({...j,item:{...j.item,name:S+j.item.name}}))}else C=J.search(T);p(t.map(C,"item"))},h=()=>{p([])},y=E=>E.name,v=E=>e.jsxRuntimeExports.jsx("div",{className:"rounded-md p-1",children:E.name}),w={autoComplete:"off",autoCorrect:"off",autoCapitalize:"off",spellCheck:!1,placeholder:"Enter class name",value:c,onKeyDown:E=>{E.key==="Enter"&&c.trim()!==""&&g()},onChange:(E,{newValue:T})=>a(T),className:"w-full rounded-md text-xs px-2 hover:outline-0 bg-background border-border py-1"};return e.jsxRuntimeExports.jsxs("div",{className:`no-scrollbar flex ${f.length>0?"min-h-[300px]":"min-h-max"} w-full flex-col gap-y-5 overflow-y-auto bg-gray-100 px-px`,children:[e.jsxRuntimeExports.jsx(o.Label,{className:"mt-2",children:"Add Tailwind classes"}),e.jsxRuntimeExports.jsxs("div",{className:"relative -mt-4 flex items-center gap-x-3",children:[e.jsxRuntimeExports.jsx("div",{className:"relative flex w-full items-center gap-x-3",children:e.jsxRuntimeExports.jsx(fe,{suggestions:f,onSuggestionsFetchRequested:b,onSuggestionsClearRequested:h,getSuggestionValue:y,renderSuggestion:v,inputProps:w,containerProps:{className:"relative h-8 w-full gap-y-1 py-1 border-gray-600"},theme:{suggestion:"bg-transparent",suggestionHighlighted:"bg-gray-700 ",suggestionsContainerOpen:"absolute bg-gray-100 z-50 max-h-[230px] overflow-y-auto w-full border border-gray-600 rounded-md"}})}),e.jsxRuntimeExports.jsx(o.Button,{variant:"outline",className:"h-6 border-gray-700",onClick:g,disabled:c.trim()==="",size:"sm",children:e.jsxRuntimeExports.jsx(d.PlusIcon,{})})]}),e.jsxRuntimeExports.jsxs("div",{className:"flex w-full flex-wrap gap-2",children:[t.isEmpty(u)&&e.jsxRuntimeExports.jsx("div",{className:"flex h-10 w-full items-center justify-center text-center text-sm text-gray-400",children:"No class added"}),M.Children.toArray(u.map(E=>e.jsxRuntimeExports.jsxs("div",{className:"group relative flex cursor-default items-center gap-x-1 rounded-full border border-blue-600 bg-blue-500 p-px px-1.5 text-[11px] text-white hover:border-blue-900",children:[E,e.jsxRuntimeExports.jsx(d.Cross2Icon,{onClick:()=>l(i,[E]),className:"invisible absolute right-1 hover:text-white group-hover:visible group-hover:cursor-pointer"})]},E)))]})]})}const N=["px","%","em","rem","ch","vh","vw"],_e={heading:"flex.heading",items:[{type:"arbitrary",label:"flex.basis",units:N,property:"flexBasis"},{type:"range",label:"flex.order",property:"order"},{type:"dropdown",label:"flex.flex",property:"flexGrowShrink"},{type:"dropdown",label:"flex.grow",property:"flexGrow"},{type:"dropdown",label:"flex.shrink",property:"flexShrink"}]},He={heading:"grid.heading",items:[{type:"range",label:"grid.col_span",property:"gridColSpan"},{type:"range",label:"grid.col_start",property:"gridColStart"},{type:"range",label:"grid.col_end",property:"gridColEnd"},{type:"range",label:"grid.row_span",property:"gridRowSpan"},{type:"range",label:"grid.row_start",property:"gridRowStart"},{type:"range",label:"grid.row_end",property:"gridRowEnd"},{type:"range",label:"grid.order",property:"order"}]},Ve=[{heading:"layout.heading",items:[{type:"arbitrary",label:"layout.width",units:N.concat("auto"),property:"width"},{type:"arbitrary",label:"layout.height",units:N.concat("auto"),property:"height"},{styleType:"multiple",label:"layout.margin",negative:!0,units:[...N,"auto"],options:[{key:"margin",label:"layout.margin_all"},{key:"marginX",label:"layout.margin_lr"},{key:"marginY",label:"layout.margin_tb"},{key:"marginTop",label:"layout.margin_top"},{key:"marginRight",label:"layout.margin_right"},{key:"marginBottom",label:"layout.margin_bottom"},{key:"marginLeft",label:"layout.margin_left"}]},{styleType:"multiple",label:"layout.padding",options:[{key:"padding",label:"layout.padding_all"},{key:"paddingX",label:"layout.padding_lr"},{key:"paddingY",label:"layout.padding_tb"},{key:"paddingTop",label:"layout.padding_top"},{key:"paddingRight",label:"layout.padding_right"},{key:"paddingBottom",label:"layout.padding_bottom"},{key:"paddingLeft",label:"layout.padding_left"}]},{styleType:"multiple",label:"layout.space_bt",options:[{key:"spaceX",label:"layout.space_lr"},{key:"spaceY",label:"layout.space_tb"}]}]},{heading:"size.heading",items:[{styleType:"accordion",heading:"size.min_width_height",items:[{type:"arbitrary",label:"size.min_width",units:N.concat("auto"),property:"minWidth"},{type:"arbitrary",label:"size.min_height",units:N.concat("auto"),property:"minHeight"}]},{styleType:"accordion",heading:"size.max_width_height",items:[{type:"arbitrary",label:"size.max_width",units:N.concat("auto"),property:"maxWidth"},{type:"arbitrary",label:"size.max_height",units:N.concat("auto"),property:"maxHeight"}]},{styleType:"accordion",heading:"size.object_options_aspect_ratio",items:[{type:"dropdown",label:"size.aspect",property:"aspectRatio"},{type:"dropdown",label:"size.fit",property:"objectFit"},{type:"dropdown",label:"size.position",property:"objectPosition"}]}]},{heading:"display.heading",items:[{type:"dropdown",label:"display.display",property:"display",units:N},{styleType:"accordion",heading:"display.flex_options",items:[{type:"dropdown",label:"display.flex_direction",property:"flexDirection"},{type:"dropdown",label:"display.flex_wrap",property:"flexWrap"},{type:"dropdown",label:"display.justify_content",property:"justifyContent"},{type:"dropdown",label:"display.align_content",property:"alignContent"},{type:"dropdown",label:"display.align_items",property:"alignItems"},{styleType:"multiple",label:"display.gap",options:[{key:"gap",label:"display.gap_all"},{key:"gapX",label:"display.gap_lr"},{key:"gapY",label:"display.gap_tb"}]}],conditions:{display:"flex"}},{styleType:"accordion",heading:"display.grid_options",items:[{type:"range",label:"display.grid_columns",property:"gridColumns"},{type:"range",label:"display.grid_rows",property:"gridRows"},{type:"dropdown",label:"display.grid_auto_flow",property:"gridAutoFlow"},{type:"dropdown",label:"display.grid_auto_cols",property:"gridAutoColumns"},{type:"dropdown",label:"display.grid_auto_rows",property:"gridAutoRows"},{type:"dropdown",label:"display.justify_content",property:"justifyContent"},{type:"dropdown",label:"display.align_content",property:"alignContent"},{type:"dropdown",label:"display.align_items",property:"alignItems"},{styleType:"multiple",label:"display.gap",units:["px","rem"],options:[{key:"gap",label:"display.gap_all"},{key:"gapX",label:"display.gap_lr"},{key:"gapY",label:"display.gap_tb"}]}],conditions:{display:"grid"}},{styleType:"accordion",heading:"display.visibility_opacity",items:[{type:"dropdown",label:"display.visibility",property:"visibility",units:N},{type:"arbitrary",label:"display.opacity",property:"opacity",units:["-"]}]}]},{heading:"position.heading",items:[{type:"icons",label:"position.position",property:"position"},{styleType:"accordion",heading:"position.options",items:[{styleType:"multiple",label:"position.direction",options:[{key:"top",label:"position.top"},{key:"right",label:"position.right"},{key:"bottom",label:"position.bottom"},{key:"left",label:"position.left"}]},{styleType:"multiple",label:"position.inset",options:[{key:"inset",label:"position.all"},{key:"insetX",label:"position.lr"},{key:"insetY",label:"position.tb"}]},{type:"arbitrary",label:"position.z_index",units:["-","auto"],property:"zIndex"}]},{styleType:"accordion",heading:"position.float_clear",items:[{type:"icons",label:"position.float",property:"float"},{type:"dropdown",label:"position.clear",property:"clear"}]},{styleType:"accordion",heading:"position.overflow_overscroll",items:[{styleType:"multiple",type:"dropdown",label:"position.overflow",options:[{key:"overflow",label:"position.all"},{key:"overflowX",label:"position.lr"},{key:"overflowY",label:"position.tb"}]},{styleType:"multiple",type:"dropdown",label:"position.overscroll",options:[{key:"overscroll",label:"position.all"},{key:"overscrollX",label:"position.lr"},{key:"overscrollY",label:"position.tb"}]}]}]},{heading:"typography.heading",items:[{type:"dropdown",property:"typography.font",label:"typography.font"},{type:"arbitrary",property:"typography.size",label:"typography.size",units:N},{type:"arbitrary",property:"typography.height",label:"typography.height",units:N.concat("-")},{type:"range",property:"typography.weight",label:"typography.weight"},{type:"color",property:"typography.color",label:"typography.color"},{styleType:"accordion",heading:"typography.alignments",items:[{type:"dropdown",property:"typography.align",label:"typography.align"},{type:"dropdown",property:"typography.valign",label:"typography.valign"}]},{styleType:"accordion",heading:"typography.spacing_decoration_more",items:[{type:"dropdown",property:"typography.spacing",label:"typography.spacing"},{type:"dropdown",property:"typography.decoration",label:"typography.decoration"},{type:"range",property:"typography.thickness",label:"typography.thickness"},{type:"dropdown",property:"typography.transform",label:"typography.transform"}]},{styleType:"accordion",heading:"typography.whitespace_breaks",items:[{type:"dropdown",property:"typography.whitespace",label:"typography.whitespace"},{type:"dropdown",property:"typography.wordbreak",label:"typography.wordbreak"}]}]},{heading:"background.heading",items:[{type:"color",label:"background.bgcolor",property:"backgroundColor"},{styleType:"accordion",heading:"background.position_size_more",items:[{type:"dropdown",label:"background.attachment",property:"backgroundAttachment"},{type:"dropdown",label:"background.clipping",property:"backgroundClip"},{type:"dropdown",label:"background.origin",property:"backgroundOrigin"},{type:"dropdown",label:"background.position",property:"backgroundPosition"},{type:"dropdown",label:"background.repeat",property:"backgroundRepeat"},{type:"dropdown",label:"background.size",property:"backgroundSize"}]},{type:"dropdown",label:"background.gradient",property:"backgroundGradient"},{styleType:"accordion",heading:"background.gradient_colors",items:[{type:"color",label:"background.from_color",property:"fromColor"},{type:"color",label:"background.via_color",property:"viaColor"},{type:"color",label:"background.to_color",property:"toColor"}]}]},{heading:"border.heading",items:[{styleType:"multiple",type:"dropdown",label:"border.width",options:[{key:"border",label:"border.all"},{key:"borderX",label:"border.lr"},{key:"borderY",label:"border.tb"},{key:"borderTop",label:"border.top"},{key:"borderRight",label:"border.right"},{key:"borderBottom",label:"border.bottom"},{key:"borderLeft",label:"border.left"}]},{styleType:"multiple",type:"dropdown",label:"border.corners",options:[{key:"borderRadius",label:"border.all"},{key:"borderRadiusTop",label:"border.top"},{key:"borderRadiusRight",label:"border.right"},{key:"borderRadiusBottom",label:"border.bottom"},{key:"borderRadiusLeft",label:"border.left"},{key:"borderRadiusTopLeft",label:"border.top_left"},{key:"borderRadiusTopRight",label:"border.top_right"},{key:"borderRadiusBottomRight",label:"border.bottom_right"},{key:"borderRadiusBottomLeft",label:"border.bottom_left"}]},{type:"color",label:"border.color",property:"borderColor"},{type:"dropdown",label:"border.style",property:"borderStyle"},{styleType:"accordion",heading:"border.divide_options",items:[{styleType:"multiple",type:"range",label:"border.width",options:[{key:"divideXWidth",label:"border.lr"},{key:"divideYWidth",label:"border.tb"}]},{type:"color",label:"border.divide_color",property:"divideColor"},{type:"dropdown",label:"border.divide_style",property:"divideStyle"}]},{styleType:"accordion",heading:"border.outline_styling",items:[{type:"range",label:"border.outline_width",property:"outlineWidth"},{type:"range",label:"border.outline_offset",property:"outlineOffset"},{type:"dropdown",label:"border.outline_style",property:"outlineStyle"}]},{styleType:"accordion",heading:"border.ring_options",items:[{type:"range",label:"border.ring_width",property:"ringWidth"},{type:"color",label:"border.ring_color",property:"ringColor"},{type:"range",label:"border.ring_offset_width",property:"ringOffsetWidth"},{type:"color",label:"border.ring_offset_color",property:"ringOffsetColor"}]}]},{heading:"effect.heading",items:[{type:"range",label:"effect.shadow",property:"boxShadow"},{type:"color",label:"effect.color",property:"boxShadowColor"},{type:"dropdown",label:"effect.cursor",property:"cursor"},{styleType:"accordion",heading:"effect.blend_cursor",items:[{type:"dropdown",label:"effect.mix_blend",property:"mixBlendMode"},{type:"dropdown",label:"effect.bg_blend",property:"bgBlendMode"}]},{styleType:"accordion",heading:"effect.transform",items:[{type:"dropdown",label:"effect.origin",property:"transformOrigin"},{styleType:"multiple",label:"effect.scale",units:["-"],options:[{key:"scale",label:"effect.all"},{key:"scaleX",label:"effect.lr"},{key:"scaleY",label:"effect.tb"}]},{styleType:"multiple",label:"effect.skew",units:["deg"],options:[{key:"skewX",label:"effect.lr"},{key:"skewY",label:"effect.tb"}]},{styleType:"multiple",label:"effect.translate",negative:!0,options:[{key:"translateX",label:"effect.lr"},{key:"translateY",label:"effect.tb"}]},{type:"arbitrary",units:["deg"],negative:!0,label:"effect.rotate",property:"rotate"}]},{styleType:"accordion",heading:"effect.animation",items:[{type:"dropdown",label:"effect.animation",property:"animation"},{type:"dropdown",label:"effect.transition",property:"transition"},{type:"dropdown",label:"effect.easing",property:"transitionEase"},{type:"arbitrary",units:["ms"],label:"effect.duration",property:"duration"},{type:"arbitrary",units:["ms"],label:"effect.delay",property:"delay"}]}]},{heading:"classes.heading",items:[{component:Ie}]}],se={"not-italic":()=>e.jsxRuntimeExports.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.jsxRuntimeExports.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9 3H11V5H9V11H11V13H5V11H7V5H5V3H9Z",fill:"white"})}),visible:d.EyeOpenIcon,invisible:d.EyeClosedIcon,hidden:d.EyeClosedIcon,gap:d.BorderAllIcon,gapX:d.WidthIcon,gapY:d.HeightIcon,spaceX:d.WidthIcon,spaceY:d.HeightIcon,overscroll:d.BorderAllIcon,overscrollX:d.WidthIcon,overscrollY:d.HeightIcon,overflow:d.BorderAllIcon,overflowX:d.WidthIcon,overflowY:d.HeightIcon,top:d.ArrowUpIcon,right:d.ArrowRightIcon,bottom:d.ArrowDownIcon,left:d.ArrowLeftIcon,inset:d.BorderAllIcon,insetX:d.WidthIcon,insetY:d.HeightIcon,border:d.BorderAllIcon,borderX:d.WidthIcon,borderY:d.HeightIcon,borderTop:d.ArrowUpIcon,borderRight:d.ArrowRightIcon,borderBottom:d.ArrowDownIcon,borderLeft:d.ArrowLeftIcon,borderRadius:d.BorderAllIcon,borderRadiusX:d.WidthIcon,borderRadiusY:d.HeightIcon,borderRadiusTop:d.ArrowUpIcon,borderRadiusRight:d.ArrowRightIcon,borderRadiusBottom:d.ArrowDownIcon,borderRadiusLeft:d.ArrowLeftIcon,borderRadiusTopLeft:d.ArrowTopLeftIcon,borderRadiusTopRight:d.ArrowTopRightIcon,borderRadiusBottomRight:d.ArrowBottomRightIcon,borderRadiusBottomLeft:d.ArrowBottomLeftIcon,divideXWidth:d.WidthIcon,divideYWidth:d.HeightIcon,scale:d.BorderAllIcon,scaleX:d.WidthIcon,scaleY:d.HeightIcon,skewX:d.WidthIcon,skewY:d.HeightIcon,translateX:d.WidthIcon,translateY:d.HeightIcon,padding:d.BorderAllIcon,paddingX:d.WidthIcon,paddingY:d.HeightIcon,paddingTop:d.ArrowUpIcon,paddingRight:d.ArrowRightIcon,paddingBottom:d.ArrowDownIcon,paddingLeft:d.ArrowLeftIcon,margin:d.BorderAllIcon,marginX:d.WidthIcon,marginY:d.HeightIcon,marginTop:d.ArrowUpIcon,marginRight:d.ArrowRightIcon,marginBottom:d.ArrowDownIcon,marginLeft:d.ArrowLeftIcon,textLeft:d.AlignLeftIcon,textCenter:d.AlignCenterHorizontallyIcon,textRight:d.AlignRightIcon,textJustify:d.StretchHorizontallyIcon,italic:d.FontItalicIcon,underline:d.UnderlineIcon,overline:d.OverlineIcon,uppercase:d.LetterCaseUppercaseIcon,block:()=>e.jsxRuntimeExports.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[e.jsxRuntimeExports.jsx("path",{opacity:"0.6",fillRule:"evenodd",clipRule:"evenodd",d:"M2 2H14V14H2V2ZM1 1H15V15H1V1Z",fill:"currentColor"}),e.jsxRuntimeExports.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7 4H4V12H7V4ZM9 4H12V12H9V4Z",fill:"currentColor"})]}),"float-right":()=>e.jsxRuntimeExports.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[e.jsxRuntimeExports.jsx("path",{d:"M8 4H16V12H8V4Z",fill:"currentColor"}),e.jsxRuntimeExports.jsx("path",{opacity:"0.6",fillRule:"evenodd",clipRule:"evenodd",d:"M0 4H6V6H0V4ZM0 7H6V9H0V7ZM4 10H0V12H4V10Z",fill:"currentColor"})]}),"float-left":()=>e.jsxRuntimeExports.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[e.jsxRuntimeExports.jsx("path",{d:"M0 4H8V12H0V4Z",fill:"currentColor"}),e.jsxRuntimeExports.jsx("path",{opacity:"0.6",fillRule:"evenodd",clipRule:"evenodd",d:"M10 4H16V6H10V4ZM10 7H16V9H10V7ZM14 10H10V12H14V10Z",fill:"currentColor"})]}),"float-none":d.Cross2Icon,fixed:()=>e.jsxRuntimeExports.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[e.jsxRuntimeExports.jsx("path",{opacity:"0.6",fillRule:"evenodd",clipRule:"evenodd",d:"M15 2H14V4H13V5H14V6H15V2ZM10 5V4H9V2H1V8H2V5H10ZM7 4V3H5V4H7ZM4 4V3H2V4H4ZM1 13H7V14H1V13Z",fill:"currentColor"}),e.jsxRuntimeExports.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M11 2H10V3H11V6H12V3H13V2H11ZM2 9H1V12H2V11H7V10H2V9ZM15 7H8V14H15V7Z",fill:"currentColor"})]}),absolute:()=>e.jsxRuntimeExports.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[e.jsxRuntimeExports.jsx("path",{opacity:"0.6",fillRule:"evenodd",clipRule:"evenodd",d:"M14 2H15V6H14V2ZM9 3V2H1V8H2V3H9ZM7 13H1V14H7V13Z",fill:"currentColor"}),e.jsxRuntimeExports.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M11 2H10V3H11V6H12V3H13V2H11ZM2 9H1V12H2V11H7V10H2V9ZM15 7H8V14H15V7Z",fill:"currentColor"})]}),relative:()=>e.jsxRuntimeExports.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.jsxRuntimeExports.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M11 2H9V3H11V6H12V3H14V2H11ZM2 8H1V13H2V11H7V10H2V8ZM15 7H8V14H15V7Z",fill:"currentColor"})}),sticky:()=>e.jsxRuntimeExports.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[e.jsxRuntimeExports.jsx("path",{d:"M12.9998 7C13.6558 7 14.2937 6.78498 14.8158 6.38787C15.338 5.99076 15.7156 5.43345 15.8908 4.80128C16.066 4.16912 16.0292 3.49694 15.7859 2.8877C15.5427 2.27846 15.1065 1.76573 14.5441 1.42804C13.9817 1.09034 13.3241 0.946293 12.672 1.01795C12.02 1.08961 11.4094 1.37303 10.9337 1.8248C10.4581 2.27658 10.1436 2.8718 10.0385 3.51932C9.93341 4.16685 10.0434 4.83097 10.3518 5.41L6.88176 8.88C6.80034 8.96122 6.73572 9.05769 6.69158 9.16388C6.64744 9.27008 6.62465 9.38393 6.62451 9.49894C6.62437 9.61395 6.64689 9.72785 6.69077 9.83416C6.73465 9.94046 6.79904 10.0371 6.88026 10.1185C6.96149 10.1999 7.05795 10.2645 7.16415 10.3087C7.27035 10.3528 7.3842 10.3756 7.4992 10.3758C7.61421 10.3759 7.72812 10.3534 7.83442 10.3095C7.94072 10.2656 8.03734 10.2012 8.11876 10.12L11.5888 6.648C12.0088 6.873 12.4888 7 12.9988 7H12.9998Z",fill:"currentColor"}),e.jsxRuntimeExports.jsx("path",{opacity:"0.6",fillRule:"evenodd",clipRule:"evenodd",d:"M9.535 2H1V14H15V7.465C14.69 7.645 14.355 7.783 14 7.875V13H2V5H9.126C8.86504 3.98486 9.01223 2.90789 9.536 2H9.535ZM7 3V4H5V3H7ZM4 3V4H2V3H4Z",fill:"currentColor"})]}),static:d.Cross1Icon},$=m.createContext({canReset:!1,canChange:!0}),Ae=({children:s,canReset:n=!1,canChange:r=!0})=>e.jsxRuntimeExports.jsx($.Provider,{value:{canReset:n,canChange:r},children:s}),oe=({label:s,property:n,onChange:r})=>{const l=m.useMemo(()=>t.get(B.CLASSES_LIST,`${n}.classes`,[""]),[n]),i=L(n),c=m.useMemo(()=>t.get(i,"cls",""),[i]),{canChange:a}=m.useContext($),x=/\[.*\]/g.test(c);return e.jsxRuntimeExports.jsx("div",{className:s?"w-full rounded ":"grow",children:x?e.jsxRuntimeExports.jsxs("div",{className:"flex items-center",children:[e.jsxRuntimeExports.jsx(o.Input,{className:"w-[70%] rounded py-1",readOnly:!0,value:c}),e.jsxRuntimeExports.jsxs(o.Tooltip,{delayDuration:100,children:[e.jsxRuntimeExports.jsx(o.TooltipTrigger,{asChild:!0,children:e.jsxRuntimeExports.jsx("button",{type:"button",className:"invisible ml-3 mt-1 text-blue-600 group-hover:visible",children:e.jsxRuntimeExports.jsx(d.InfoCircledIcon,{})})}),e.jsxRuntimeExports.jsx(o.TooltipContent,{children:"Current value is using a Tailwind arbitrary value."})]})]}):e.jsxRuntimeExports.jsx(X,{rounded:s,onChange:u=>r(u,n),selected:c,options:l,disabled:!a})})};function X({selected:s,onChange:n,rounded:r=!1,options:l,disabled:i=!1}){const c=s.replace(/.*:/g,"").trim(),{undo:a,redo:x}=o.useCanvasHistory();return e.jsxRuntimeExports.jsxs("select",{disabled:!l.length||i,className:`${r?"rounded-md border border-border":"border-0"} w-full disable:bg-gray-500 h-full truncate rounded bg-background px-2 py-1 text-xs outline-none disabled:cursor-not-allowed`,onChange:u=>n(u.target.value),onKeyDown:u=>{u.ctrlKey&&(u.key==="z"&&a(),u.key==="y"&&x())},value:c,children:[e.jsxRuntimeExports.jsx("option",{className:"bg-transparent",value:""}),m.Children.toArray(l.map(u=>e.jsxRuntimeExports.jsx("option",{className:"bg-transparent",value:u,children:u})))]})}const Be=({property:s,onChange:n})=>{const{canReset:r,canChange:l}=m.useContext($),i=L(s),c=m.useMemo(()=>t.get(i,"cls",""),[i]),a=m.useMemo(()=>t.get(B.CLASSES_LIST,`${s}.classes`,[""]),[s]),x=a.indexOf(c)>-1?a.indexOf(c):0,u=/\[.*\]/g.test(c);return e.jsxRuntimeExports.jsx("div",{className:"flex flex-row divide-x divide-solid divide-border rounded border border-border text-xs",children:u?e.jsxRuntimeExports.jsx("div",{className:"py-[5px] px-2",children:c}):e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx("button",{type:"button",className:"box-border w-2/12 rounded-tl rounded-bl bg-background px-1 text-center hover:bg-bg-gray-700 disabled:cursor-not-allowed disabled:bg-gray-600",disabled:!l&&(!r||x-1<0),onClick:()=>n(t.nth(a,x-1),s),children:e.jsxRuntimeExports.jsx("span",{className:"flex items-center justify-center",children:e.jsxRuntimeExports.jsx(d.MinusIcon,{className:!l&&(!r||x-1<0)?"text-gray-500":"text-black/60 dark:text-white/60"})})}),e.jsxRuntimeExports.jsx("div",{className:"w-8/12 text-center",children:e.jsxRuntimeExports.jsx(oe,{label:!1,property:s,onChange:n})}),e.jsxRuntimeExports.jsx("button",{type:"button",className:"w-2/12 rounded-tr rounded-br bg-background px-1 text-center hover:bg-bg-gray-700 disabled:cursor-not-allowed disabled:bg-gray-600",disabled:!l&&(!r||x+1>=a.length),onClick:()=>n(t.nth(a,x+1),s),children:e.jsxRuntimeExports.jsx("span",{className:"flex items-center justify-center",children:e.jsxRuntimeExports.jsx(d.PlusIcon,{className:!l&&(!r||x+1>=a.length)?"text-gray-500":"text-black/60 dark:text-white/60"})})})]})})},De=({property:s,onChange:n})=>{const r=m.useMemo(()=>t.get(B.CLASSES_LIST,`${s}.classes`,[""]),[s]),{canChange:l}=m.useContext($),i=L(s),c=m.useMemo(()=>t.get(i,"cls",""),[i]);return e.jsxRuntimeExports.jsx("div",{className:"flex grow flex-wrap gap-1",children:t.map(r,a=>e.jsxRuntimeExports.jsxs(o.Tooltip,{children:[e.jsxRuntimeExports.jsx(o.TooltipTrigger,{asChild:!0,children:e.jsxRuntimeExports.jsx("button",{type:"button",disabled:!l,onClick:()=>n(a,s),className:`cursor-pointer rounded border border-gray-600 p-1 disabled:cursor-not-allowed ${c===a?" bg-blue-500 text-white":"disabled:bg-gray-600 disabled:text-gray-400"}`,children:m.createElement(t.get(se,a,d.BoxIcon))})}),e.jsxRuntimeExports.jsx(o.TooltipContent,{children:t.startCase(t.toLower(a))})]}))})},Pe={backgroundColor:"bg",textColor:"text",borderColor:"border",boxShadowColor:"shadow",outlineColor:"outline",divideColor:"divide",fromColor:"from",viaColor:"via",toColor:"to",ringColor:"ring",ringOffsetColor:"ring-offset"},$e=({property:s,onChange:n})=>{const r=L(s),l=m.useMemo(()=>t.get(r,"cls",""),[r]),{canChange:i}=m.useContext($),[c,a]=m.useState([]),[x,u]=m.useState({color:"",shade:""}),g=l.split("-"),f=t.get(g,"1",""),p=t.get(g,"2",""),b=m.useCallback(y=>{["current","inherit","transparent","black","white"].includes(y)?(a([]),u({color:y})):(a(["50","100","200","300","400","500","600","700","800","900"]),u(v=>({...v,color:y,shade:v.shade?v.shade:"500"})))},[a,u]);m.useEffect(()=>{if(["current","inherit","transparent","black","white"].includes(f))return a([]);a(["50","100","200","300","400","500","600","700","800","900"])},[f]);const h=m.useCallback(y=>{u({color:f,shade:y})},[f]);return m.useEffect(()=>{u({color:"",shade:""})},[r]),m.useEffect(()=>{const v=`${t.get(Pe,s,"")}-${x.color}${x.shade?`-${x.shade}`:""}`;v.match(new RegExp(t.get(B.CLASSES_LIST,`${s}.regExp`,"")))&&n(v,s)},[x,n,s]),e.jsxRuntimeExports.jsxs("div",{className:"flex flex-row divide-x divide-solid divide-border rounded-lg border border-border text-xs",children:[e.jsxRuntimeExports.jsx("div",{className:"grow text-center",children:e.jsxRuntimeExports.jsx(X,{disabled:!i,rounded:!0,selected:f,onChange:b,options:["current","transparent","primary","secondary","black","white","slate","gray","zinc","neutral","stone","red","orange","amber","yellow","lime","green","emerald","teal","cyan","sky","blue","indigo","violet","purple","fuchsia","pink","rose"]})}),e.jsxRuntimeExports.jsx("button",{type:"button",className:"grow text-center",children:e.jsxRuntimeExports.jsx(X,{rounded:!0,selected:p,disabled:!f||!i,onChange:h,options:c})})]})},Q=(s,n)=>{s=s.toLowerCase();let r=s.trim().replace(/ |\+/g,"");if((r==="auto"||r==="none")&&n.includes(r))return{value:"",unit:r};const l=n.length?new RegExp(n.join("|"),"g"):/XXXXXX/g;r=r.replace(l,"");const i=s.match(l),c=i&&i.length>1,a=!t.isEmpty(r)&&Number.isNaN(Number(r));return c||a?{error:"Invalid value"}:i&&(i[0]==="auto"||i[0]==="none")?{value:i[0],unit:""}:{value:r,unit:i?i[0]:""}};const Le=s=>{const n=s.startsWith("-")?"-":"",r=s.split("-").pop();if(["auto","none"].includes(r))return{value:"",unit:r};if(r==="px")return{value:"1",unit:"px"};if(r==="screen")return{value:"100",unit:s.indexOf("w-")!==-1?"vw":"vh"};if(r==="full")return{value:"100",unit:"%"};if(t.includes(s,"skew-"))return{value:`${n}${r}`,unit:"deg"};if(t.includes(s,"rotate-"))return{value:`${n}${r}`,unit:"deg"};if(t.includes(s,"opacity-"))return{value:`${r/100}`,unit:"-"};if(t.includes(s,"duration-")||t.includes(s,"delay-"))return{value:`${r}`,unit:"ms"};if(t.includes(s,"translate-")&&!r.includes("/"))return{value:`${n}${`${r/4}`}`,unit:"rem"};if(t.includes(s,"scale-"))return{value:`${n}${`${r/100}`}`,unit:"-"};if(t.startsWith(s,"border")){const l=s.match(/border-?(x|y|t|r|b|l)?\d+/g);if(l)return{value:l[0].split("-").pop(),unit:"px"};if(s.match(/border-?(x|y|t|r|b|l)?/g))return{value:"1",unit:"px"}}if(t.startsWith(s,"max-w-")){if(s==="max-w-screen-sm")return{value:"640",unit:"px"};if(s==="max-w-screen-md")return{value:"768",unit:"px"};if(s==="max-w-screen-lg")return{value:"1024",unit:"px"};if(s==="max-w-screen-xl")return{value:"1280",unit:"px"};if(s==="max-w-screen-2xl")return{value:"1536",unit:"px"};if(r==="xs")return{value:"320",unit:"px"};if(r==="sm")return{value:"384",unit:"px"};if(r==="md")return{value:"448",unit:"px"};if(r==="lg")return{value:"512",unit:"px"};if(r==="xl")return{value:"576",unit:"px"};if(r==="2xl")return{value:"672",unit:"px"};if(r==="3xl")return{value:"768",unit:"px"};if(r==="4xl")return{value:"896",unit:"px"};if(r==="5xl")return{value:"1024",unit:"px"};if(r==="6xl")return{value:"1152",unit:"px"};if(r==="7xl")return{value:"1280",unit:"px"};if(r==="prose")return{value:"65",unit:"ch"}}if(t.startsWith(s,"text-")){if(r==="xs")return{value:"12",unit:"px"};if(r==="sm")return{value:"14",unit:"px"};if(r==="base")return{value:"16",unit:"px"};if(r==="lg")return{value:"18",unit:"px"};if(r==="xl")return{value:"20",unit:"px"};if(r==="2xl")return{value:"24",unit:"px"};if(r==="3xl")return{value:"30",unit:"px"};if(r==="4xl")return{value:"36",unit:"px"};if(r==="5xl")return{value:"48",unit:"px"};if(r==="6xl")return{value:"60",unit:"px"};if(r==="7xl")return{value:"72",unit:"px"};if(r==="8xl")return{value:"96",unit:"px"};if(r==="9xl")return{value:"128",unit:"px"}}if(t.startsWith(s,"leading-")){if(r==="none")return{value:"1",unit:"-"};if(r==="tight")return{value:"1.25",unit:"-"};if(r==="snug")return{value:"1.375",unit:"-"};if(r==="normal")return{value:"1.5",unit:"-"};if(r==="relaxed")return{value:"1.625",unit:"-"};if(r==="loose")return{value:"2",unit:"-"}}if(t.startsWith(s,"tracking-")){if(r==="tighter")return{value:"-0.05",unit:"em"};if(r==="tight")return{value:"-0.025",unit:"em"};if(r==="normal")return{value:"0",unit:"em"};if(r==="wide")return{value:"0.025",unit:"em"};if(r==="wider")return{value:"0.05",unit:"em"};if(r==="widest")return{value:"0.1",unit:"em"}}if(["max","min","fit"].includes(r))return{value:s,unit:"class"};if(r.includes("/")){const[l,i]=t.map(r.split("/"),c=>parseInt(c,10));return{value:n+(l/i*100).toFixed(2).replace(".00",""),unit:"%"}}return t.isNumber(parseFloat(r))?{value:`${n+parseFloat(r)*4}`,unit:"px"}:{value:r,unit:"class"}};const Me=s=>{if(t.isEmpty(s))return{value:"",unit:""};const n=s.match(/\[.*\]/g);if(n===null)return qe(s);const r=t.get(n,"0","").replace(/\[|\]/g,""),l=s.startsWith("-")?"-":"",i=t.first(r.match(/\d+.\d+|\d+/g));return{value:`${l}${i}`,unit:r.replace(i,"")}},qe=s=>t.isEmpty(s)?{value:"",unit:""}:Le(s),ne=m.createContext({setDragData:()=>{}}),Oe=({unit:s,currentValue:n,onDrag:r,onDragEnd:l,onDragStart:i,negative:c,cssProperty:a})=>{const{setDragData:x}=m.useContext(ne);return e.jsxRuntimeExports.jsx("button",{type:"button",onMouseDown:u=>{const g={onDrag:r,onDragEnd:l,dragging:!0,dragStartY:u.pageY,dragStartValue:`${n}`,dragUnit:s,negative:c,cssProperty:a};i(g),x(g)},color:void 0,className:"relative z-50 ml-1 hidden h-6 cursor-row-resize rounded bg-background/70 px-2 group-hover:inline",children:e.jsxRuntimeExports.jsx(d.RowSpacingIcon,{})})},We=({onSelect:s,current:n,units:r})=>e.jsxRuntimeExports.jsx("div",{"data-theme":"light",className:"-m-[7px] -mx-[13px] flex w-9 flex-col",children:r.map(l=>e.jsxRuntimeExports.jsx(o.Button,{className:"h-max rounded-none px-1 py-1 text-right text-[11px] hover:bg-blue-400",color:n===l?"primary":void 0,size:"sm",onClick:i=>{i.stopPropagation(),s(l)},children:l},l))}),ee=50,ze=s=>{const[n,r]=m.useState(!1),[l,i]=m.useState(""),{currentClass:c,onChange:a,classPrefix:x,cssProperty:u,units:g,negative:f}=s,[p,b]=m.useState(u!=null&&u.toLowerCase().includes("width")?"%":g[0]),[h,y]=m.useState(!1),[v,w]=m.useState(""),[I,E]=m.useState(!1),[T,_]=m.useState(!1);m.useEffect(()=>{const{value:j,unit:R}=Me(c);if(R===""){i(j),b(u!=null&&u.toLowerCase().includes("width")?"%":t.first(g));return}b(R),i(R==="class"||t.isEmpty(j)?"":j)},[c,u,g]);const C=z.useThrottledCallback(j=>a(j),[a],ee),S=z.useThrottledCallback(j=>a(j,!1),[a],ee),V=m.useCallback((j=!1)=>{const R=Q(`${l}`,g);if(t.get(R,"error",!1)){y(!0);return}const k=t.get(R,"unit")!==""?t.get(R,"unit"):p;if(k==="auto"||k==="none"){C(`${x}${k}`);return}if(t.get(R,"value")==="")return;const P=`${t.get(R,"value","").startsWith("-")?"-":""}${x}[${t.get(R,"value","").replace("-","")}${k==="-"?"":k}]`;j?S(P):C(P)},[C,S,l,p,x,g]),D=m.useCallback(j=>{const R=Q(`${l}`,g);if(t.get(R,"error",!1)){y(!0);return}if(j==="auto"||j==="none"){C(`${x}${j}`);return}if(t.get(R,"value")==="")return;const k=t.get(R,"unit")!==""?t.get(R,"unit"):j,P=`${t.get(R,"value","").startsWith("-")?"-":""}${x}[${t.get(R,"value","").replace("-","")}${k==="-"?"":k}]`;C(P)},[C,l,x,g]);return e.jsxRuntimeExports.jsx("div",{className:"flex w-full flex-col",children:e.jsxRuntimeExports.jsx("div",{className:"flex items-center justify-start",children:p==="class"?e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx("input",{className:"w-20 rounded py-1",readOnly:!0,value:c}),e.jsxRuntimeExports.jsxs(o.Tooltip,{children:[e.jsxRuntimeExports.jsx(o.TooltipTrigger,{asChild:!0,children:e.jsxRuntimeExports.jsx("button",{type:"button",className:"invisible ml-3 mt-1 text-blue-600 group-hover:visible",children:e.jsxRuntimeExports.jsx(d.InfoCircledIcon,{})})}),e.jsxRuntimeExports.jsx(o.TooltipContent,{children:"Current value is using a Tailwind preset class."})]})]}):e.jsxRuntimeExports.jsxs("div",{className:`group relative flex items-center ${I?"z-auto":""}`,children:[e.jsxRuntimeExports.jsxs("div",{className:"flex items-center rounded-md border border-border",children:[["none","auto"].indexOf(p)!==-1?null:e.jsxRuntimeExports.jsx("input",{readOnly:p==="class",onKeyPress:j=>{j.key==="Enter"&&V()},onKeyDown:j=>{if(j.keyCode!==38&&j.keyCode!==40)return;j.preventDefault(),_(!0);const R=t.parseInt(j.target.value);let k=t.isNaN(R)?0:R;j.keyCode===38&&(k+=1),j.keyCode===40&&(k-=1);const H=`${k}`,le=`${H.startsWith("-")?"-":""}${x}[${H.replace("-","")}${p==="-"?"":p}]`;S(le)},onKeyUp:j=>{T&&(j.preventDefault(),_(!1))},onBlur:()=>V(),onChange:j=>{y(!1),i(j.target.value)},onClick:j=>{var R;(R=j==null?void 0:j.target)==null||R.select(),r(!1)},value:I?v:l,className:"h-6 w-14 rounded rounded-r-none bg-background pl-2 text-sm focus-visible:outline-0 ".concat(" ",h?"border-red-500 text-red-500":"border-foreground/20")}),e.jsxRuntimeExports.jsxs(o.Tooltip,{open:n,delayDuration:100,children:[e.jsxRuntimeExports.jsx(o.TooltipTrigger,{asChild:!0,children:e.jsxRuntimeExports.jsxs("button",{type:"button",onClick:()=>r(!n),className:"flex h-6 cursor-pointer items-center gap-x-1 rounded rounded-l-none bg-background p-px px-1 text-[11px] uppercase",children:[e.jsxRuntimeExports.jsx("span",{className:`inline-block ${g.length===1?"px-2 font-semibold":""}`,children:p}),g.length>1?e.jsxRuntimeExports.jsx(d.TriangleDownIcon,{}):null]})}),e.jsxRuntimeExports.jsx(o.TooltipPortal,{children:e.jsxRuntimeExports.jsx(o.TooltipContent,{className:"bg-background",children:e.jsxRuntimeExports.jsx(We,{units:g,current:p,onSelect:j=>{r(!1),b(j),D(j)}})})})]})]}),["none","auto"].indexOf(p)!==-1||I?null:e.jsxRuntimeExports.jsx(Oe,{onDragStart:()=>E(!0),onDragEnd:j=>{if(w(()=>""),E(!1),t.isEmpty(j))return;const R=`${j}`,H=`${R.startsWith("-")?"-":""}${x}[${R.replace("-","")}${p==="-"?"":p}]`;C(H)},onDrag:j=>{if(t.isEmpty(j))return;w(j);const R=`${j}`,H=`${R.startsWith("-")?"-":""}${x}[${R.replace("-","")}${p==="-"?"":p}]`;S(H)},currentValue:l,unit:p,negative:f,cssProperty:u})]})})})},L=s=>{const n=o.useSelectedBlockCurrentClasses();return t.findLast(n,{property:s})},Ye=(s,n)=>{const r={xs:0,sm:1,md:2,lg:3,xl:4,"2xl":5};return r[t.get(s,"mq","xs")]<=r[n]},Fe={width:"w-",height:"h-",minWidth:"min-w-",minHeight:"min-h-",maxWidth:"max-w-",maxHeight:"max-h-",zIndex:"z-",gap:"gap-",gapX:"gap-x-",gapY:"gap-y-",margin:"m-",marginX:"mx-",marginY:"my-",marginTop:"mt-",marginBottom:"mb-",marginLeft:"ml-",marginRight:"mr-",padding:"p-",paddingX:"px-",paddingY:"py-",paddingTop:"pt-",paddingBottom:"pb-",paddingLeft:"pl-",paddingRight:"pr-",spaceX:"space-x-",spaceY:"space-y-",border:"border-",borderTop:"border-t-",borderBottom:"border-b-",borderLeft:"border-l-",borderRight:"border-r-",borderX:"border-x-",borderY:"border-y-",borderRadius:"rounded-",borderRadiusTop:"rounded-t-",borderRadiusRight:"rounded-r-",borderRadiusBottom:"rounded-b-",borderRadiusLeft:"rounded-l-",borderRadiusTopLeft:"rounded-tl-",borderRadiusTopRight:"rounded-tr-",borderRadiusBottomRight:"rounded-br-",borderRadiusBottomLeft:"rounded-bl-",fontSize:"text-",lineHeight:"leading-",letterSpacing:"tracking-",textIndent:"indent-",rotate:"rotate-",duration:"duration-",transitionDelay:"delay-",scale:"scale-",scaleX:"scale-x-",scaleY:"scale-y-",translateX:"translate-x-",translateY:"translate-y-",skewX:"skew-x-",skewY:"skew-y-",top:"top-",bottom:"bottom-",left:"left-",right:"right-",inset:"inset-",insetX:"inset-x-",insetY:"inset-y-",opacity:"opacity-",flexBasis:"basis-"},te={xs:"",sm:"640px",md:"768px",lg:"1024px",xl:"1280px","2xl":"1536px"},Xe=s=>`${s.toUpperCase()} ${te[s]?`(${te[s]} & up)`:""}`,U=s=>{const{t:n}=A.useTranslation(),{type:r="icons",label:l,property:i,onEmitChange:c=()=>{},units:a,negative:x=!1}=s,[u]=o.useDarkMode(),[g]=o.useStylingState(),[,f]=o.useCanvasWidth(),p=L(i),b=o.useAddClassesToBlocks(),h=o.useRemoveClassesFromBlocks(),[y]=o.useSelectedBlockIds(),v=m.useMemo(()=>t.get(p,"fullCls",""),[p]),w=m.useCallback((S,V=!0)=>{const D={dark:u,mq:f,mod:g,cls:S,property:i,fullCls:""};(u||g!=="")&&(D.mq="xs");const j=B.generateFullClsName(D);b(y,[j],V)},[y,u,f,g,i,b]),I=m.useCallback(()=>{h(y,[v])},[y,v,h]),E=m.useMemo(()=>Ye(p,f),[p,f]);m.useEffect(()=>{c(E,p)},[E,c,p]);const[,,T]=o.useCanvasWidth(),_=m.useCallback(S=>{T({xs:400,sm:640,md:800,lg:1024,xl:1420,"2xl":1920}[S])},[T]),C=t.get(p,"dark",null)===u&&t.get(p,"mod",null)===g&&t.get(p,"mq",null)===f;return e.jsxRuntimeExports.jsx(Ae,{canChange:E,canReset:p&&C,children:e.jsxRuntimeExports.jsxs("div",{className:"group flex flex-row items-center py-2 first:pt-0 last:pb-0",children:[e.jsxRuntimeExports.jsx("div",{className:"relative w-[70px] truncate text-xs text-foreground",children:e.jsxRuntimeExports.jsx("span",{className:`text-[11px] ${p&&!C?"text-foreground":""}`,children:n(l)})}),e.jsxRuntimeExports.jsxs("div",{className:"flex flex-row items-center",children:[e.jsxRuntimeExports.jsxs("div",{className:"w-[150px]",children:[r==="arbitrary"?e.jsxRuntimeExports.jsx(ze,{currentClass:t.get(p,"cls",""),classPrefix:t.get(Fe,i,""),units:a||[],onChange:w,negative:x,cssProperty:i}):null,r==="icons"&&e.jsxRuntimeExports.jsx(De,{property:i,onChange:w}),r==="range"&&e.jsxRuntimeExports.jsx(Be,{property:i,onChange:w}),r==="color"&&e.jsxRuntimeExports.jsx($e,{property:i,onChange:w}),r==="dropdown"&&e.jsxRuntimeExports.jsx(oe,{label:l,property:i,onChange:w})]}),e.jsxRuntimeExports.jsx("div",{className:`w-[30px] cursor-pointer ${v?"visible":"invisible"}`,children:C?e.jsxRuntimeExports.jsx("button",{type:"button",onClick:()=>I(),title:"Reset",className:"flex px-1.5 text-xs",children:e.jsxRuntimeExports.jsx(d.CrossCircledIcon,{className:"h-5 w-5 text-blue-500 hover:opacity-80"})}):E&&p?e.jsxRuntimeExports.jsxs(o.Tooltip,{delayDuration:100,children:[e.jsxRuntimeExports.jsx(o.TooltipTrigger,{asChild:!0,children:e.jsxRuntimeExports.jsx("button",{type:"button",className:"invisible ml-3 mt-1 rounded-full bg-blue-500 text-white group-hover:visible",children:e.jsxRuntimeExports.jsx(d.InfoCircledIcon,{})})}),e.jsxRuntimeExports.jsx(o.TooltipContent,{children:e.jsxRuntimeExports.jsx("div",{className:"text-right",children:e.jsxRuntimeExports.jsxs("div",{children:["Current style is set at ",e.jsxRuntimeExports.jsxs("span",{className:"font-bold ",children:[Xe(t.get(p,"mq")),u&&!p.dark?"(Light mode)":""]}),e.jsxRuntimeExports.jsx("br",{}),e.jsxRuntimeExports.jsxs("button",{type:"button",onClick:()=>_(t.get(p,"mq")),className:"block w-full cursor-default text-right font-semibold text-blue-500",children:["Switch to ",t.get(p,"mq").toUpperCase()]})]})})})]}):null})]})]})})},Ze=["px","%","em","rem","ch","vh","vw"],ie=({label:s,options:n,borderB:r=!1,borderT:l=!1,type:i="arbitrary",units:c=Ze,negative:a=!1})=>{const{t:x}=A.useTranslation(),[u,g]=m.useState(n[0].key),f=o.useSelectedBlockCurrentClasses(),p=m.useCallback(b=>t.map(f,"property").includes(b),[f]);return e.jsxRuntimeExports.jsxs("div",{className:`mb-2 border-gray-800 py-2 first:pt-0 last:pb-0 ${r?"border-b":""} ${l?"border-t":""}`,children:[e.jsxRuntimeExports.jsxs("div",{className:"flex flex-row text-xs",children:[s&&e.jsxRuntimeExports.jsx("span",{className:"relative w-[70px] flex-none text-xs text-foreground",children:x(s)}),e.jsxRuntimeExports.jsx("div",{className:"mb-3 flex grow flex-row flex-wrap gap-x-px",children:m.Children.toArray(n.map(({label:b,key:h})=>e.jsxRuntimeExports.jsx("div",{className:"first:rounded-l last:rounded-r",children:e.jsxRuntimeExports.jsxs(o.Tooltip,{children:[e.jsxRuntimeExports.jsx(o.TooltipTrigger,{asChild:!0,children:e.jsxRuntimeExports.jsxs("button",{type:"button",onClick:()=>g(h),className:`relative cursor-pointer rounded-full p-1 text-[8px] ${h===u?" bg-[#3E57F0] text-white":"text-gray-600 dark:text-gray-300"}`,children:[m.createElement("div",{className:p(h)?"-bottom-1.5 absolute bg-[#3E57F0] h-[2px] left-0 w-full":""}),m.createElement(t.get(se,h,d.BoxIcon),{className:"text-inherit w-3 h-3"})]})}),e.jsxRuntimeExports.jsx(o.TooltipContent,{children:t.startCase(t.toLower(b))})]})})))})]}),e.jsxRuntimeExports.jsx("div",{className:"mt-0 flex items-center",children:e.jsxRuntimeExports.jsx(U,{type:i,units:[...c],label:"",property:u,negative:a})})]})},Ue=({heading:s,items:n})=>{const{t:r}=A.useTranslation(),l=o.useSelectedBlockCurrentClasses(),i=m.useMemo(()=>{const c=u=>t.flatten(u.map(g=>g.styleType==="multiple"?t.map(g.options,"key"):g.property)),a=t.flatten(n.map(u=>u.styleType==="accordion"?c(u.items):u.styleType==="multiple"?t.map(u.options,"key"):u.property)),x=t.map(l,"property");return t.intersection(a,x).length>0},[l,n]);return e.jsxRuntimeExports.jsxs("details",{children:[e.jsxRuntimeExports.jsx("summary",{className:"my-px cursor-default rounded-md bg-background p-px px-2 text-[11px] text-foreground",children:e.jsxRuntimeExports.jsxs("div",{className:"inline",children:[r(s),i?e.jsxRuntimeExports.jsx("span",{className:`ml-1 mr-2 inline-block h-[8px] w-[8px] rounded-full ${i?"bg-blue-500":"bg-gray-300"}`}):null]})}),e.jsxRuntimeExports.jsx("div",{className:"p-2",children:n.map(c=>c.styleType==="multiple"?e.jsxRuntimeExports.jsx(ie,{...c},c.label):e.jsxRuntimeExports.jsx(U,{...c},c.label))})]})},Ke=m.createContext({}),W=({section:s})=>{const{t:n}=A.useTranslation(),r=o.useSelectedBlockCurrentClasses(),l=m.useCallback((a=[])=>{const x={};for(let g=0;g<r.length;g++)x[r[g].property]=r[g].cls;let u=!0;for(const g in a)if(!t.has(x,g)||x[g]!==a[g]){u=!1;break}return u},[r]),i=m.useMemo(()=>{if(r.length>0&&s.heading==="classes.heading")return!0;const a=g=>t.flatten(g.map(f=>f.styleType==="multiple"?t.flatten(t.map(f.options,"key")):f.property)),x=t.flatten(s.items.map(g=>g.styleType==="accordion"?a(g.items):g.styleType==="multiple"?t.flatten(t.map(g.options,"key")):g.property)),u=t.map(r,"property");return t.intersection(x,u).length>0},[r,s.heading,s.items]),c=m.useMemo(()=>({}),[]);return e.jsxRuntimeExports.jsx(Ke.Provider,{value:c,children:e.jsxRuntimeExports.jsxs(o.AccordionItem,{value:s.heading,children:[e.jsxRuntimeExports.jsx(o.AccordionTrigger,{className:"px-3 py-2 text-xs hover:no-underline",children:e.jsxRuntimeExports.jsxs("div",{className:"flex items-center gap-x-2",children:[e.jsxRuntimeExports.jsx("div",{className:`h-[8px] w-[8px] rounded-full ${i?"bg-blue-500":"bg-gray-300"}`}),n(s.heading)]})}),e.jsxRuntimeExports.jsx(o.AccordionContent,{className:"bg-gray-100 px-3.5 py-2",children:m.Children.toArray(s.items.map(a=>t.has(a,"component")?m.createElement(a.component,{key:a.label}):t.has(a,"styleType")?a.styleType==="multiple"?e.jsxRuntimeExports.jsx(ie,{...a},a.label):a.styleType==="accordion"&&l(a==null?void 0:a.conditions)?e.jsxRuntimeExports.jsx(Ue,{...a},a.label):null:e.jsxRuntimeExports.jsx(U,{...a},a.label)))})]})})},Ge=({item:s,index:n,canDelete:r,onChange:l,onRemove:i})=>e.jsxRuntimeExports.jsxs("div",{className:`flex flex-col gap-1 border-gray-400 py-2 ${r?"border-b":""}`,children:[e.jsxRuntimeExports.jsx("input",{name:"key",onChange:c=>l(c,n),value:s.key,placeholder:"Key",className:"w-full rounded border-gray-300 bg-background p-0.5 pl-2 text-sm focus-visible:outline-0",autoComplete:"off",autoCapitalize:"off"}),e.jsxRuntimeExports.jsxs("div",{className:"flex items-center gap-x-1.5",children:[e.jsxRuntimeExports.jsx("input",{name:"value",onChange:c=>t.isEmpty(s.key)?{}:l(c,n),value:s.value,placeholder:"Value",className:"w-full rounded border-gray-300 bg-background p-0.5 pl-2 text-sm focus-visible:outline-0",autoComplete:"off",autoCapitalize:"off"}),e.jsxRuntimeExports.jsx(d.TrashIcon,{onClick:i,className:"h-6 w-6 cursor-pointer rounded border border-red-400 p-1 text-red-400 hover:opacity-80"})]})]}),Je=({section:s})=>{var b;const{setSyncState:n}=o.useSavePage(),r=o.useSelectedBlock(),[l,i]=m.useState([]),[c]=o.useSelectedStylingBlocks(),a=o.useUpdateBlocksPropsRealtime(),x=`${t.get(c,"0.prop")}_attrs`;M.useEffect(()=>{const h=t.map(t.get(r,x),(y,v)=>({key:v,value:y}));t.isEmpty(h)?i([]):i(h)},[t.get(r,x)]);const u=()=>i([...l,{key:"",value:""}]),g=h=>{const y=t.filter(l,(v,w)=>h!==w);p(y)},f=(h,y)=>{const v=[...l];v[y][h.target.name]=h.target.value,p(v)},p=M.useCallback((h=[])=>{const y={};t.forEach(h,v=>{t.isEmpty(v.key)||t.set(y,v.key,v.value)}),a([t.get(r,"_id")],{[x]:y}),n("UNSAVED")},[r,n,a,x]);return e.jsxRuntimeExports.jsxs(o.AccordionItem,{value:s.heading,children:[e.jsxRuntimeExports.jsx(o.AccordionTrigger,{className:"px-3 py-2 text-xs hover:no-underline",children:e.jsxRuntimeExports.jsxs("div",{className:"flex items-center gap-x-2",children:[e.jsxRuntimeExports.jsx("div",{className:`h-[8px] w-[8px] rounded-full ${t.isEmpty(t.get(r,x))?"bg-gray-300":"bg-blue-500"}`}),"Attributes"]})}),e.jsxRuntimeExports.jsx(o.AccordionContent,{className:"bg-gray-100 px-3.5 py-2",children:e.jsxRuntimeExports.jsxs("div",{className:"no-scrollbar flex min-h-max flex-col gap-y-2 overflow-y-auto bg-gray-100 p-px",children:[e.jsxRuntimeExports.jsxs(o.Label,{className:"mt-2 flex w-full items-center justify-between",children:["Add Custom attributes",e.jsxRuntimeExports.jsxs("div",{className:`flex h-6 w-max items-center justify-center gap-x-0.5 rounded-full border p-1 px-2 text-xs ${!t.isEmpty(l)&&t.isEmpty((b=t.last(l))==null?void 0:b.key)?"cursor-not-allowed border-gray-400 text-gray-400":"cursor-pointer border-blue-400 text-blue-400 hover:bg-blue-400 hover:text-white"}`,onClick:()=>{var h;!t.isEmpty(l)&&t.isEmpty((h=t.last(l))==null?void 0:h.key)||u()},children:[e.jsxRuntimeExports.jsx(d.PlusIcon,{width:12,height:12})," Add"]})]}),e.jsxRuntimeExports.jsxs("div",{className:"flex flex-col",children:[t.isEmpty(l)&&e.jsxRuntimeExports.jsx("div",{className:"flex h-12 items-center justify-center text-sm text-gray-400",children:"Click + Add to add attributes"}),M.Children.toArray(t.map(l,(h,y)=>{const v=l.length>0&&y<l.length-1;return e.jsxRuntimeExports.jsx(Ge,{item:h,index:y,canDelete:v,onChange:f,onRemove:()=>g(y)})}))]})]})})]})};function Qe(){const[s,n]=o.useStylingState(),{flexChild:r,gridChild:l}=o.useSelectedBlocksDisplayChild(),[,i]=be.useAtom(o.advanceStylingOpenAtom),{t:c}=A.useTranslation(),[a]=o.useSelectedStylingBlocks();return t.isEmpty(a)?e.jsxRuntimeExports.jsx("div",{className:"p-4 text-center",children:e.jsxRuntimeExports.jsxs("div",{className:"space-y-4 rounded-xl p-4",children:[e.jsxRuntimeExports.jsx(d.MixerHorizontalIcon,{className:"mx-auto text-3xl"}),e.jsxRuntimeExports.jsx("h1",{children:c("no_styling_block_selected")}),e.jsxRuntimeExports.jsxs("p",{className:"text-xs ",children:["Hint: Styling allowed blocks are highlighted with"," ",e.jsxRuntimeExports.jsx("span",{className:"border border-orange-500 p-px",children:"orange"})," border"]})]})}):e.jsxRuntimeExports.jsxs("div",{onClick:()=>i(!1),className:"flex h-full flex-col",children:[e.jsxRuntimeExports.jsx("div",{className:"flex flex-col space-x-4 space-y-3 border-b h-12 border-border px-4 py-1",children:e.jsxRuntimeExports.jsxs("div",{className:"flex items-center justify-end gap-x-1.5",children:[e.jsxRuntimeExports.jsx(o.Label,{htmlFor:"",className:"flex gap-x-1.5 text-xs italic",children:"State"}),e.jsxRuntimeExports.jsxs(o.Select,{defaultValue:s,onValueChange:x=>n(x),children:[e.jsxRuntimeExports.jsx(o.SelectTrigger,{className:"h-auto w-fit p-1 px-3",children:e.jsxRuntimeExports.jsx(o.SelectValue,{placeholder:"State"})}),e.jsxRuntimeExports.jsxs(o.SelectContent,{children:[e.jsxRuntimeExports.jsx(o.SelectItem,{value:"",children:"Normal"}),e.jsxRuntimeExports.jsx(o.SelectItem,{value:"hover",children:"Hover"}),e.jsxRuntimeExports.jsx(o.SelectItem,{value:"active",children:"Active"}),e.jsxRuntimeExports.jsx(o.SelectItem,{value:"focus",children:"Focus"}),e.jsxRuntimeExports.jsx(o.SelectItem,{value:"before",children:"Before"}),e.jsxRuntimeExports.jsx(o.SelectItem,{value:"after",children:"After"}),e.jsxRuntimeExports.jsx(o.SelectItem,{value:"only",children:"Only"}),e.jsxRuntimeExports.jsx(o.SelectItem,{value:"first",children:"First"}),e.jsxRuntimeExports.jsx(o.SelectItem,{value:"last",children:"Last"}),e.jsxRuntimeExports.jsx(o.SelectItem,{value:"first-letter",children:"First Letter"}),e.jsxRuntimeExports.jsx(o.SelectItem,{value:"first-line",children:"First Line"}),e.jsxRuntimeExports.jsx(o.SelectItem,{value:"disabled",children:"Disabled"})]})]})]})}),e.jsxRuntimeExports.jsx(o.ScrollArea,{className:"no-scrollbar -mx-1 flex-1 max-h-full overflow-y-hidden overflow-x-hidden",children:e.jsxRuntimeExports.jsxs(o.Accordion,{defaultValue:["Layout"],type:"multiple",className:"w-full",children:[r&&e.jsxRuntimeExports.jsx(W,{section:_e}),l?e.jsxRuntimeExports.jsx(W,{section:He}):null,Ve.map(x=>e.jsxRuntimeExports.jsx(W,{section:x},x.heading)),e.jsxRuntimeExports.jsx(Je,{section:{heading:"Attributes"}})]})})]})}const et={px:1,"%":1,em:100,rem:100,ch:1,vw:1,vh:1,"-":1,deg:1,ms:.1},tt=()=>{const s=o.useSelectedBlock(),{t:n}=A.useTranslation(),[r,l]=m.useState(""),[i,c]=m.useState({onDrag:u=>u,onDragEnd:u=>u,dragStartY:0,dragging:!1,dragStartValue:0,dragUnit:"",negative:!1,cssProperty:""}),a=z.useThrottledCallback(u=>{const g=!t.get(i,"negative",!1),f=t.get(i,"cssProperty","");let p=parseFloat(i.dragStartValue);p=t.isNaN(p)?0:p;let b=et[i.dragUnit];(t.startsWith(f,"scale")||f==="opacity")&&(b=10);let y=(i.dragStartY-u.pageY)/b+p;g&&y<0&&(y=0),f==="opacity"&&y>1&&(y=1),i.onDrag(`${y}`),l(`${y}`)},[i],50),x=m.useCallback(()=>{setTimeout(()=>i.onDragEnd(`${r}`),100),c({onDrag:u=>u,onDragEnd:u=>u,dragStartY:0,dragging:!1,dragStartValue:0,dragUnit:"",negative:!1,cssProperty:""})},[i,r,c]);return t.isNull(s)?e.jsxRuntimeExports.jsx("div",{className:"p-4 text-center",children:e.jsxRuntimeExports.jsxs("div",{className:"space-y-4 rounded-xl p-4",children:[e.jsxRuntimeExports.jsx(d.MixerHorizontalIcon,{className:"mx-auto text-3xl"}),e.jsxRuntimeExports.jsx("h1",{children:n("no_block_selected_for_styling")})]})}):e.jsxRuntimeExports.jsx(q.ErrorBoundary,{children:e.jsxRuntimeExports.jsxs(ne.Provider,{value:{setDragData:c},children:[i.dragging?e.jsxRuntimeExports.jsx("div",{onMouseMove:a,onMouseUp:()=>x(),className:"absolute inset-0 z-30 cursor-row-resize bg-gray-300/10 "}):null,e.jsxRuntimeExports.jsxs(o.Tabs,{defaultValue:"settings",className:"flex h-full w-full flex-col py-1",children:[e.jsxRuntimeExports.jsxs(o.TabsList,{className:"mx-1 grid grid-cols-2",children:[e.jsxRuntimeExports.jsx(o.TabsTrigger,{value:"settings",children:n("settings")}),e.jsxRuntimeExports.jsx(o.TabsTrigger,{value:"styling",children:n("styling")})]}),e.jsxRuntimeExports.jsx(o.TabsContent,{value:"settings",className:"no-scrollbar -mx-1 -mr-2 h-full flex-1 overflow-y-auto overflow-x-hidden",children:e.jsxRuntimeExports.jsx(o.ScrollArea,{className:"no-scrollbar -mx-1 pb-5 flex-1 max-h-full overflow-y-hidden overflow-x-hidden",children:e.jsxRuntimeExports.jsx(Te,{})})}),e.jsxRuntimeExports.jsx(o.TabsContent,{value:"styling",className:"flex-1 h-full overflow-y-auto overflow-x-hidden",children:e.jsxRuntimeExports.jsx(Qe,{})})]})]})})};exports.default=tt;
|