@chaibuilder/sdk 1.2.50 → 1.2.52
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{AddBlocks-IX7HKzSe.js → AddBlocks-GxEmM16E.js} +18 -18
- package/dist/{AddBlocks-zwZ63DdP.cjs → AddBlocks-fozauzIV.cjs} +1 -1
- package/dist/CanvasArea-NRtblq5d.cjs +56 -0
- package/dist/{CanvasArea-ehmBje_E.js → CanvasArea-rdY6SFYn.js} +57 -57
- package/dist/{ChaiBuilderEditor-ZRHqW7Gd.cjs → ChaiBuilderEditor-Pga_zJgw.cjs} +55 -55
- package/dist/{ChaiBuilderEditor-3xIN-AP_.js → ChaiBuilderEditor-bNZZWYMh.js} +14537 -14544
- package/dist/CodeEditor-tqtgia3I.js +115 -0
- package/dist/CodeEditor-ye3IXW3i.cjs +1 -0
- package/dist/{CurrentPage-qhBjm7th.js → CurrentPage-7NM90y76.js} +8 -8
- package/dist/{CurrentPage-HOPNdQZ-.cjs → CurrentPage-sx7KVTmt.cjs} +1 -1
- package/dist/ListTree-7Pz6H6eE.cjs +1 -0
- package/dist/ListTree-oRbeDNod.js +25724 -0
- package/dist/{PagesPanel-kdl4A0IN.cjs → PagesPanel-Nr-908vy.cjs} +1 -1
- package/dist/{PagesPanel-5iVsbDP1.js → PagesPanel-XiTUaiq_.js} +5 -5
- package/dist/{ProjectPanel-mXPBI-TU.cjs → ProjectPanel-SuFYN60H.cjs} +1 -1
- package/dist/{ProjectPanel-c8oTzhQd.js → ProjectPanel-XfknsGkz.js} +5 -5
- package/dist/Settings-22Hy7jUT.cjs +1 -0
- package/dist/{Settings-0uSGoECC.js → Settings-dJ72rwnH.js} +408 -401
- package/dist/{SidePanels-kKram02Q.cjs → SidePanels-5dnRAsJh.cjs} +1 -1
- package/dist/{SidePanels-YLWdBer9.js → SidePanels-t9oUA51J.js} +38 -38
- package/dist/{ThemeConfiguration-8W1CM4tW.cjs → ThemeConfiguration-2Sbh29qi.cjs} +1 -1
- package/dist/{ThemeConfiguration-AAGFJieC.js → ThemeConfiguration-pcHbYiIP.js} +9 -9
- package/dist/{Topbar-nX9Muoem.js → Topbar-0DmS6VpB.js} +4 -4
- package/dist/{Topbar-CLNUPx7K.cjs → Topbar-ID6Ipphd.cjs} +1 -1
- package/dist/{UILibrariesPanel-fKn2nlgI.js → UILibrariesPanel-G9J4KUsZ.js} +6 -6
- package/dist/{UILibrariesPanel-cp0Mkaq_.cjs → UILibrariesPanel-sXY6hozJ.cjs} +1 -1
- package/dist/{UnsplashImages-56HoW_ZA.cjs → UnsplashImages-HK4_1VVL.cjs} +1 -1
- package/dist/{UnsplashImages-zTZa3LjG.js → UnsplashImages-MeS5Cu7a.js} +4 -4
- package/dist/{UploadImages-SnfaTrlz.js → UploadImages-AIKATqfP.js} +2 -2
- package/dist/{UploadImages-okNGjkXb.cjs → UploadImages-LSnxByGV.cjs} +1 -1
- package/dist/{add-page-modal-uDoO0zws.js → add-page-modal-JkD45moJ.js} +9 -9
- package/dist/{add-page-modal-Y2RY3x01.cjs → add-page-modal-krxKdX7-.cjs} +1 -1
- package/dist/{confirm-alert-aD7AMK_6.cjs → confirm-alert--QTC21Z2.cjs} +1 -1
- package/dist/{confirm-alert-9XiVxCc0.js → confirm-alert-NHxthdRK.js} +2 -2
- package/dist/core.cjs +1 -1
- package/dist/core.d.ts +9 -0
- package/dist/core.js +32 -31
- package/dist/{delete-page-modal-7sfoFf9r.js → delete-page-modal-8rjPEchH.js} +4 -4
- package/dist/{delete-page-modal-ieJ367JA.cjs → delete-page-modal-BIe0kYNH.cjs} +1 -1
- package/dist/email.cjs +1 -1
- package/dist/email.js +2 -2
- package/dist/{form-KWYHDVIf.cjs → form-6OLp5uEG.cjs} +1 -1
- package/dist/{form-PQSmqcIl.js → form-PQYPrD_Q.js} +5 -5
- package/dist/functions--tdNWQDW.js +30 -0
- package/dist/functions-EVUeSwX1.cjs +1 -0
- package/dist/html-to-json-9uiQ2Dp2.cjs +1 -0
- package/dist/html-to-json-ofq1N3tB.js +186 -0
- package/dist/index--mLLy7QQ.cjs +1 -0
- package/dist/index-9_b2eou7.js +2201 -0
- package/dist/index-VBXQixVm.js +117 -0
- package/dist/index-seU0_UZX.cjs +1 -0
- package/dist/lib.cjs +1 -1
- package/dist/lib.js +11 -11
- package/dist/{page-viewer-aoro5JxT.cjs → page-viewer-WwwMC1Kq.cjs} +1 -1
- package/dist/{page-viewer-qkwZJ6e-.js → page-viewer-sKluQ_e1.js} +10 -10
- package/dist/{project-general-setting-3gkaXq1F.js → project-general-setting-Lc2ByvTt.js} +7 -7
- package/dist/{project-general-setting-arXitV5_.cjs → project-general-setting-pRO1ikDV.cjs} +1 -1
- package/dist/{project-seo-setting-X8pykTmc.js → project-seo-setting-530_6o9S.js} +3 -3
- package/dist/{project-seo-setting-kjtUt-er.cjs → project-seo-setting-BzSrXFVv.cjs} +1 -1
- package/dist/render.cjs +1 -1
- package/dist/render.js +2 -2
- package/dist/{single-page-detail-UsWG0gfh.cjs → single-page-detail-_VP4zaCI.cjs} +1 -1
- package/dist/{single-page-detail-ZXZX6Xmw.js → single-page-detail-qDxxtedN.js} +6 -6
- package/dist/studio.cjs +1 -1
- package/dist/studio.js +4 -4
- package/dist/ui.cjs +1 -1
- package/dist/ui.js +98 -98
- package/dist/useCanvasSettings-5y2fSCpN.js +6 -0
- package/dist/useCanvasSettings-pURFQG4q.cjs +1 -0
- package/dist/web-blocks.cjs +1 -1
- package/dist/web-blocks.js +320 -320
- package/package.json +3 -2
- package/dist/CanvasArea-URgoG1jc.cjs +0 -56
- package/dist/CodeEditor-0F7Dz3AB.js +0 -97
- package/dist/CodeEditor-1vu-qNgT.cjs +0 -1
- package/dist/ListTree-DkbFFDXB.cjs +0 -1
- package/dist/ListTree-sTwXvXST.js +0 -409
- package/dist/Settings-3kBSStO6.cjs +0 -1
- package/dist/functions-JO0EW8GX.js +0 -30
- package/dist/functions-ZZVUnIjD.cjs +0 -1
- package/dist/html-to-json-GJ6RioQf.js +0 -221
- package/dist/html-to-json-O1OpqICe.cjs +0 -1
- package/dist/index-VOrp9ZpX.cjs +0 -1
- package/dist/index-YpnaudSM.js +0 -63
- package/dist/index-ecnGWzh9.cjs +0 -1
- package/dist/index-i2kgLkjC.js +0 -2201
- package/dist/useCodeEditor-CtjbxWLf.cjs +0 -1
- package/dist/useCodeEditor-yl5V3Hte.js +0 -7
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { j as e } from "./jsx-runtime-WbnYoNE9.js";
|
|
2
|
-
import k, { createElement as
|
|
3
|
-
import { has as
|
|
2
|
+
import k, { createElement as D, useState as b, useEffect as L } from "react";
|
|
3
|
+
import { has as S, isFunction as E, first as h, omit as N, filter as g, groupBy as F, uniq as H, map as B, includes as M, isEmpty as y, reject as C, values as v } from "lodash-es";
|
|
4
4
|
import { useAtom as x } from "jotai";
|
|
5
5
|
import { useTranslation as A } from "react-i18next";
|
|
6
|
-
import {
|
|
6
|
+
import { n as w, L as I, D as q, ag as P, ac as z, ad as O, ae as R, bl as G, bm as J, bn as K, bo as U, aD as V, bb as W, bp as Y, B as Q, bq as X, br as Z, bs as $, h as T, ai as ee, aj as te, ak as _, bg as se, b6 as oe, b7 as re, b8 as ae, b9 as le } from "./ChaiBuilderEditor-bNZZWYMh.js";
|
|
7
7
|
import { BoxIcon as ie } from "@radix-ui/react-icons";
|
|
8
8
|
import { syncBlocksWithDefaults as ce, useChaiBlocks as ne } from "@chaibuilder/runtime";
|
|
9
9
|
import { useFeature as de } from "flagged";
|
|
10
10
|
import { O as j } from "./MODIFIERS-fd5XOmum.js";
|
|
11
11
|
import { d as me } from "./atoms-ZOWyNoiC.js";
|
|
12
|
-
import { g as pe } from "./html-to-json-
|
|
12
|
+
import { g as pe } from "./html-to-json-ofq1N3tB.js";
|
|
13
13
|
import "./_commonjsHelpers-UyOWmZb0.js";
|
|
14
14
|
import "clsx";
|
|
15
15
|
import "react-dom";
|
|
@@ -44,18 +44,18 @@ import "react-icons-picker";
|
|
|
44
44
|
import "react-quill";
|
|
45
45
|
import "react-hotkeys-hook";
|
|
46
46
|
import "lucide-react";
|
|
47
|
-
import "./index-
|
|
47
|
+
import "./index-VBXQixVm.js";
|
|
48
48
|
import "himalaya";
|
|
49
49
|
const he = ({ block: t }) => {
|
|
50
|
-
const [, o] = x(me), { type: a, icon: l, label: c } = t, { addCoreBlock: m, addPredefinedBlock: p } = w(), [s, u] = I(), [, f] =
|
|
51
|
-
if (
|
|
52
|
-
const d =
|
|
50
|
+
const [, o] = x(me), { type: a, icon: l, label: c } = t, { addCoreBlock: m, addPredefinedBlock: p } = w(), [s, u] = I(), [, f] = q(), [, n] = x(P), i = () => {
|
|
51
|
+
if (S(t, "blocks")) {
|
|
52
|
+
const d = E(t.blocks) ? t.blocks() : t.blocks;
|
|
53
53
|
p(ce(d), h(s));
|
|
54
54
|
} else
|
|
55
55
|
m(t, h(s));
|
|
56
56
|
n(j);
|
|
57
57
|
}, r = de("dnd");
|
|
58
|
-
return /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsxs(
|
|
58
|
+
return /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsxs(z, { children: [
|
|
59
59
|
/* @__PURE__ */ e.jsx(O, { asChild: !0, children: /* @__PURE__ */ e.jsxs(
|
|
60
60
|
"button",
|
|
61
61
|
{
|
|
@@ -69,20 +69,20 @@ const he = ({ block: t }) => {
|
|
|
69
69
|
draggable: "true",
|
|
70
70
|
className: "space-y-2 rounded-lg border border-border p-3 text-center hover:bg-slate-300/50 " + (r ? "cursor-grab" : "cursor-pointer"),
|
|
71
71
|
children: [
|
|
72
|
-
|
|
72
|
+
D(l || ie, { className: "w-4 h-4 mx-auto" }),
|
|
73
73
|
/* @__PURE__ */ e.jsx("p", { className: "text-xs", children: c || a })
|
|
74
74
|
]
|
|
75
75
|
}
|
|
76
76
|
) }),
|
|
77
|
-
/* @__PURE__ */ e.jsx(
|
|
77
|
+
/* @__PURE__ */ e.jsx(R, { children: /* @__PURE__ */ e.jsx("p", { children: c || a }) })
|
|
78
78
|
] }) });
|
|
79
79
|
}, xe = () => {
|
|
80
80
|
const { t } = A(), [o, a] = b(""), { addPredefinedBlock: l } = w(), [c] = I(), [, m] = x(P), p = () => {
|
|
81
81
|
const s = pe(o);
|
|
82
82
|
l([...s], h(c) || null), a(""), m(j);
|
|
83
83
|
};
|
|
84
|
-
return /* @__PURE__ */ e.jsxs(
|
|
85
|
-
/* @__PURE__ */ e.jsx(
|
|
84
|
+
return /* @__PURE__ */ e.jsxs(G, { className: "border-border/0 p-0 shadow-none", children: [
|
|
85
|
+
/* @__PURE__ */ e.jsx(J, { className: "p-3", children: /* @__PURE__ */ e.jsx(K, { children: t("html_snippet_description") }) }),
|
|
86
86
|
/* @__PURE__ */ e.jsx(U, { className: "space-y-2 px-3 py-0", children: /* @__PURE__ */ e.jsxs("div", { className: "space-y-1", children: [
|
|
87
87
|
/* @__PURE__ */ e.jsx(V, { htmlFor: "current", className: "text-sm", children: t("tailwind_html_snippet") }),
|
|
88
88
|
/* @__PURE__ */ e.jsx(
|
|
@@ -105,9 +105,9 @@ const he = ({ block: t }) => {
|
|
|
105
105
|
] })
|
|
106
106
|
] });
|
|
107
107
|
}, nt = () => {
|
|
108
|
-
const { t } = A(), [o, a] = b("core"), [l, c] = b("basic"), m = ne(), [, p] = x($), s = T("importHTMLSupport", !0), u = T("filterChaiBlock", () => !0), f = g(m, u), n =
|
|
109
|
-
return
|
|
110
|
-
!
|
|
108
|
+
const { t } = A(), [o, a] = b("core"), [l, c] = b("basic"), m = ne(), [, p] = x($), s = T("importHTMLSupport", !0), u = T("filterChaiBlock", () => !0), f = g(m, u), n = F(f, "category"), i = H(B(n.core, "group"));
|
|
109
|
+
return L(() => {
|
|
110
|
+
!M(i, l) && !y(i) && !y(l) && c(h(i));
|
|
111
111
|
}, [i, l]), /* @__PURE__ */ e.jsxs("div", { className: "flex h-full w-72 flex-col overflow-hidden", children: [
|
|
112
112
|
/* @__PURE__ */ e.jsxs("div", { className: "mb-2 flex flex-col justify-between rounded-md bg-background/30 p-1", children: [
|
|
113
113
|
/* @__PURE__ */ e.jsx("h1", { className: "flex flex-col items-baseline px-1 text-xl font-semibold xl:flex-col", children: t("add_block") }),
|
|
@@ -130,10 +130,10 @@ const he = ({ block: t }) => {
|
|
|
130
130
|
o === "core" && /* @__PURE__ */ e.jsx(se, { className: "-mx-1.5 h-[calc(100vh-156px)] overflow-y-auto", children: /* @__PURE__ */ e.jsx("div", { className: "mt-2 w-full", children: k.Children.toArray(
|
|
131
131
|
B(
|
|
132
132
|
i,
|
|
133
|
-
(r) =>
|
|
133
|
+
(r) => C(g(v(n.core), { group: r }), { hidden: !0 }).length ? /* @__PURE__ */ e.jsx(oe, { type: "single", value: r, collapsible: !0, className: "w-full", children: /* @__PURE__ */ e.jsxs(re, { value: r, children: [
|
|
134
134
|
/* @__PURE__ */ e.jsx(ae, { className: "rounded-md bg-gray-100 px-4 py-2 capitalize", children: r }),
|
|
135
135
|
/* @__PURE__ */ e.jsx(le, { className: "p-3", children: /* @__PURE__ */ e.jsx("div", { className: "grid grid-cols-3 gap-2", children: k.Children.toArray(
|
|
136
|
-
|
|
136
|
+
C(g(v(n.core), { group: r }), { hidden: !0 }).map((d) => /* @__PURE__ */ e.jsx(he, { block: d }))
|
|
137
137
|
) }) })
|
|
138
138
|
] }) }) : null
|
|
139
139
|
)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-Z_BpKhVy.cjs"),u=require("react"),t=require("lodash-es"),h=require("jotai"),E=require("react-i18next"),s=require("./ChaiBuilderEditor-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-Z_BpKhVy.cjs"),u=require("react"),t=require("lodash-es"),h=require("jotai"),E=require("react-i18next"),s=require("./ChaiBuilderEditor-Pga_zJgw.cjs"),b=require("@radix-ui/react-icons"),R=require("@chaibuilder/runtime"),T=require("flagged"),q=require("./MODIFIERS-mVmfEGgo.cjs"),N=require("./atoms-a0H_593V.cjs"),k=require("./html-to-json-9uiQ2Dp2.cjs");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("clsx");require("react-dom");require("@radix-ui/react-scroll-area");require("@floating-ui/react-dom");require("i18next");require("./Functions-N3yhPYKY.cjs");require("tailwind-merge");require("@react-hookz/web");require("tree-model");require("./utils-D_vtk3zK.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-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-quill");require("react-hotkeys-hook");require("lucide-react");require("./index--mLLy7QQ.cjs");require("himalaya");const y=({block:r})=>{const[,i]=h.useAtom(N.draggedBlockAtom),{type:l,icon:c,label:d}=r,{addCoreBlock:p,addPredefinedBlock:j}=s.useAddBlock(),[o,g]=s.useSelectedBlockIds(),[,f]=s.useHighlightBlockId(),[,x]=h.useAtom(s.activePanelAtom),a=()=>{if(t.has(r,"blocks")){const m=t.isFunction(r.blocks)?r.blocks():r.blocks;j(R.syncBlocksWithDefaults(m),t.first(o))}else p(r,t.first(o));x(q.OUTLINE_KEY)},n=T.useFeature("dnd");return e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:e.jsxRuntimeExports.jsxs(s.Tooltip,{children:[e.jsxRuntimeExports.jsx(s.TooltipTrigger,{asChild:!0,children:e.jsxRuntimeExports.jsxs("button",{onClick:a,type:"button",onDragStart:m=>{m.dataTransfer.setData("text/plain",JSON.stringify(t.omit(r,["component","icon"]))),m.dataTransfer.setDragImage(new Image,0,0),i(t.omit(r,["component","icon"])),setTimeout(()=>{g([]),f(null),x(q.OUTLINE_KEY)},200)},draggable:"true",className:"space-y-2 rounded-lg border border-border p-3 text-center hover:bg-slate-300/50 "+(n?"cursor-grab":"cursor-pointer"),children:[u.createElement(c||b.BoxIcon,{className:"w-4 h-4 mx-auto"}),e.jsxRuntimeExports.jsx("p",{className:"text-xs",children:d||l})]})}),e.jsxRuntimeExports.jsx(s.TooltipContent,{children:e.jsxRuntimeExports.jsx("p",{children:d||l})})]})})},B=()=>{const{t:r}=E.useTranslation(),[i,l]=u.useState(""),{addPredefinedBlock:c}=s.useAddBlock(),[d]=s.useSelectedBlockIds(),[,p]=h.useAtom(s.activePanelAtom),j=()=>{const o=k.getBlocksFromHTML(i);c([...o],t.first(d)||null),l(""),p(q.OUTLINE_KEY)};return e.jsxRuntimeExports.jsxs(s.Card,{className:"border-border/0 p-0 shadow-none",children:[e.jsxRuntimeExports.jsx(s.CardHeader,{className:"p-3",children:e.jsxRuntimeExports.jsx(s.CardDescription,{children:r("html_snippet_description")})}),e.jsxRuntimeExports.jsx(s.CardContent,{className:"space-y-2 px-3 py-0",children:e.jsxRuntimeExports.jsxs("div",{className:"space-y-1",children:[e.jsxRuntimeExports.jsx(s.Label,{htmlFor:"current",className:"text-sm",children:r("tailwind_html_snippet")}),e.jsxRuntimeExports.jsx(s.Textarea,{autoFocus:!0,tabIndex:1,ref:o=>o&&o.focus(),onChange:o=>l(o.target.value),rows:12,value:i,placeholder:r("enter_code_snippet"),className:"resize-none overflow-x-auto whitespace-pre bg-gray-100 font-mono text-xs font-normal"})]})}),e.jsxRuntimeExports.jsxs(s.CardFooter,{className:"flex flex-col justify-end p-3",children:[e.jsxRuntimeExports.jsx(s.Button,{disabled:i.trim()==="",onClick:()=>j(),size:"sm",className:"w-full",children:r("import_html")}),e.jsxRuntimeExports.jsx(s.Alert,{variant:"default",className:"mt-2 border-none p-1 text-gray-400",children:e.jsxRuntimeExports.jsx(s.AlertTitle,{className:"text-xs font-normal leading-4",children:r("note_imported_html")})})]})]})},v=()=>{const{t:r}=E.useTranslation(),[i,l]=u.useState("core"),[c,d]=u.useState("basic"),p=R.useChaiBlocks(),[,j]=h.useAtom(s.showPredefinedBlockCategoryAtom),o=s.useBuilderProp("importHTMLSupport",!0),g=s.useBuilderProp("filterChaiBlock",()=>!0),f=t.filter(p,g),x=t.groupBy(f,"category"),a=t.uniq(t.map(x.core,"group"));return u.useEffect(()=>{!t.includes(a,c)&&!t.isEmpty(a)&&!t.isEmpty(c)&&d(t.first(a))},[a,c]),e.jsxRuntimeExports.jsxs("div",{className:"flex h-full w-72 flex-col overflow-hidden",children:[e.jsxRuntimeExports.jsxs("div",{className:"mb-2 flex flex-col justify-between rounded-md bg-background/30 p-1",children:[e.jsxRuntimeExports.jsx("h1",{className:"flex flex-col items-baseline px-1 text-xl font-semibold xl:flex-col",children:r("add_block")}),e.jsxRuntimeExports.jsx("span",{className:"p-0 text-xs font-light leading-3 opacity-80 xl:pl-1",children:r(i==="html"?"enter_paste_tailwind_html":"click_to_add_block")})]}),e.jsxRuntimeExports.jsx(s.Tabs,{onValueChange:n=>{j(""),l(n)},value:i,className:"h-max",children:e.jsxRuntimeExports.jsxs(s.TabsList,{className:"grid w-full "+(o?"grid-cols-2":"grid-cols-1"),children:[e.jsxRuntimeExports.jsx(s.TabsTrigger,{value:"core",children:r("Blocks")}),o?e.jsxRuntimeExports.jsx(s.TabsTrigger,{value:"html",children:r("import")}):null]})}),i==="core"&&e.jsxRuntimeExports.jsx(s.ScrollArea,{className:"-mx-1.5 h-[calc(100vh-156px)] overflow-y-auto",children:e.jsxRuntimeExports.jsx("div",{className:"mt-2 w-full",children:u.Children.toArray(t.map(a,n=>t.reject(t.filter(t.values(x.core),{group:n}),{hidden:!0}).length?e.jsxRuntimeExports.jsx(s.Accordion,{type:"single",value:n,collapsible:!0,className:"w-full",children:e.jsxRuntimeExports.jsxs(s.AccordionItem,{value:n,children:[e.jsxRuntimeExports.jsx(s.AccordionTrigger,{className:"rounded-md bg-gray-100 px-4 py-2 capitalize",children:n}),e.jsxRuntimeExports.jsx(s.AccordionContent,{className:"p-3",children:e.jsxRuntimeExports.jsx("div",{className:"grid grid-cols-3 gap-2",children:u.Children.toArray(t.reject(t.filter(t.values(x.core),{group:n}),{hidden:!0}).map(m=>e.jsxRuntimeExports.jsx(y,{block:m})))})})]})}):null))})}),i==="html"&&o?e.jsxRuntimeExports.jsx(B,{}):null]})};exports.default=v;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
"use strict";var ne=Object.defineProperty;var oe=(o,s,e)=>s in o?ne(o,s,{enumerable:!0,configurable:!0,writable:!0,value:e}):o[s]=e;var I=(o,s,e)=>(oe(o,typeof s!="symbol"?s+"":s,e),e);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./jsx-runtime-Z_BpKhVy.cjs"),x=require("react"),c=require("lodash-es"),R=require("@radix-ui/react-icons"),i=require("./ChaiBuilderEditor-Pga_zJgw.cjs"),U=require("react-i18next"),k=require("jotai"),re=require("lucide-react"),Y=require("react-dom"),w=require("prop-types"),ie=require("react-quill"),M=require("./atoms-a0H_593V.cjs"),le=require("@floating-ui/dom"),G=require("@floating-ui/react-dom"),ce=require("@react-hookz/web"),ae=require("flagged"),de=require("@tailwindcss/typography"),ue=require("@tailwindcss/forms"),pe=require("@tailwindcss/aspect-ratio"),xe=require("tailwindcss-palette-generator"),he=require("tailwind-merge"),T=require("./MODIFIERS-mVmfEGgo.cjs"),me=require("@chaibuilder/runtime"),ge=require("./useCanvasSettings-pURFQG4q.cjs"),fe=require("react-wrap-balancer"),ve=require("re-resizable");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("clsx");require("@radix-ui/react-scroll-area");require("i18next");require("./Functions-N3yhPYKY.cjs");require("tree-model");require("./utils-D_vtk3zK.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-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-hotkeys-hook");require("./index--mLLy7QQ.cjs");const je=()=>{const{hasUndo:o,hasRedo:s,undo:e,redo:t}=i.useUndoManager();return r.jsxRuntimeExports.jsxs("div",{className:"flex items-center",children:[r.jsxRuntimeExports.jsx(i.Button,{disabled:!o(),size:"sm",onClick:e,className:"rounded-full",variant:"ghost",children:r.jsxRuntimeExports.jsx(R.ResetIcon,{})}),r.jsxRuntimeExports.jsx(i.Button,{disabled:!s(),onClick:t,size:"sm",className:"rounded-full",variant:"ghost",children:r.jsxRuntimeExports.jsx(R.ResetIcon,{className:"rotate-180 scale-y-[-1] transform"})})]})};function ye(){const[o,s]=i.useDarkMode();return r.jsxRuntimeExports.jsxs("div",{className:"flex items-center",children:[r.jsxRuntimeExports.jsx(R.SunIcon,{className:"size-4 shrink-0"}),r.jsxRuntimeExports.jsx(i.Switch,{id:"dark-mode-switch",checked:o,onCheckedChange:()=>{s(!o)},className:`${o?"bg-violet-600":"bg-violet-300"} 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:r.jsxRuntimeExports.jsx("span",{"aria-hidden":"true",className:`${o?"translate-x-5":"translate-x-0"} 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`})}),r.jsxRuntimeExports.jsx(i.FaMoon,{className:"size-4 ml-3 shrink-0"})]})}const X=({landscape:o=!1})=>r.jsxRuntimeExports.jsxs("svg",{className:o?"rotate-90":"",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 13 13",xmlSpace:"preserve",width:13,height:13,children:[r.jsxRuntimeExports.jsx("g",{strokeWidth:0}),r.jsxRuntimeExports.jsx("g",{strokeLinecap:"round",strokeLinejoin:"round"}),r.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"}})]}),$e=[{title:"mobile_xs_title",content:"mobile_xs_content",breakpoint:"xs",icon:r.jsxRuntimeExports.jsx(R.MobileIcon,{}),width:400},{title:"mobile_sm_title",content:"mobile_sm_content",breakpoint:"sm",icon:r.jsxRuntimeExports.jsx(R.MobileIcon,{className:"rotate-90"}),width:640},{title:"tablet_md_title",content:"tablet_md_content",breakpoint:"md",icon:r.jsxRuntimeExports.jsx(X,{}),width:800},{title:"tablet_lg_title",content:"tablet_lg_content",breakpoint:"lg",icon:r.jsxRuntimeExports.jsx(X,{landscape:!0}),width:1024},{title:"desktop_xl_title",content:"desktop_xl_content",breakpoint:"xl",icon:r.jsxRuntimeExports.jsx(R.LaptopIcon,{}),width:1420},{title:"large_desktop_2xl_title",content:"large_desktop_2xl_content",breakpoint:"2xl",icon:r.jsxRuntimeExports.jsx(R.DesktopIcon,{}),width:1920}],Z=({title:o,content:s,currentBreakpoint:e,breakpoint:t,width:n,icon:u,onClick:a})=>{const{t:l}=U.useTranslation();return r.jsxRuntimeExports.jsxs(i.HoverCard,{children:[r.jsxRuntimeExports.jsx(i.HoverCardTrigger,{asChild:!0,children:r.jsxRuntimeExports.jsx(i.Button,{onClick:()=>a(n),size:"sm",variant:t===e?"secondary":"ghost",children:u})}),r.jsxRuntimeExports.jsx(i.HoverCardContent,{className:"w-52 border-border",children:r.jsxRuntimeExports.jsx("div",{className:"flex justify-between space-x-4",children:r.jsxRuntimeExports.jsxs("div",{className:"space-y-1",children:[r.jsxRuntimeExports.jsx("h4",{className:"text-sm font-semibold",children:l(o)}),r.jsxRuntimeExports.jsx("p",{className:"text-xs",children:l(s)})]})})})]})},be=()=>{const[,o,s]=i.useCanvasWidth(),[e,t]=i.useSelectedBreakpoints(),{t:n}=U.useTranslation(),u=i.useBuilderProp("breakpoints",$e),a=l=>{e.includes(l)?e.length>2&&t(e.filter(p=>p!==l)):t(p=>[...p,l])};return u.length<4?r.jsxRuntimeExports.jsx("div",{className:"flex items-center rounded-md",children:c.map(u,l=>x.createElement(Z,{...l,onClick:s,key:l.breakpoint,currentBreakpoint:o}))}):r.jsxRuntimeExports.jsxs("div",{className:"flex items-center rounded-md",children:[c.map(u.filter(l=>c.includes(e,c.toUpper(l.breakpoint))),l=>x.createElement(Z,{...l,onClick:s,key:l.breakpoint,currentBreakpoint:o})),r.jsxRuntimeExports.jsxs(i.DropdownMenu,{children:[r.jsxRuntimeExports.jsx(i.DropdownMenuTrigger,{asChild:!0,children:r.jsxRuntimeExports.jsx("span",{className:"cursor-pointer px-2.5 hover:opacity-80",children:r.jsxRuntimeExports.jsx(R.DotsVerticalIcon,{className:"scale-90 transform"})})}),r.jsxRuntimeExports.jsxs(i.DropdownMenuContent,{className:"w-56 border-border text-xs",children:[r.jsxRuntimeExports.jsx(i.DropdownMenuLabel,{children:n("Breakpoints")}),r.jsxRuntimeExports.jsx(i.DropdownMenuSeparator,{}),c.map(u,l=>r.jsxRuntimeExports.jsx(i.DropdownMenuCheckboxItem,{disabled:l.breakpoint==="xs",onCheckedChange:()=>a(c.toUpper(l.breakpoint)),checked:c.includes(e,c.toUpper(l.breakpoint)),children:n(l.title)},l.breakpoint))]})]})]})},ke=()=>{const{t:o}=U.useTranslation(),{setNewBlocks:s}=i.useBlocksStoreUndoableActions(),[,e]=i.useSelectedBlockIds(),[,t]=i.useSelectedStylingBlocks(),n=x.useCallback(()=>{s([]),e([]),t([])},[s]);return r.jsxRuntimeExports.jsx("div",{className:"flex items-center",children:r.jsxRuntimeExports.jsxs(i.AlertDialog,{children:[r.jsxRuntimeExports.jsx(i.AlertDialogTrigger,{asChild:!0,children:r.jsxRuntimeExports.jsxs(i.Button,{size:"sm",variant:"ghost",className:"flex items-center gap-x-1",children:[r.jsxRuntimeExports.jsx(R.EraserIcon,{})," ",o("clear")]})}),r.jsxRuntimeExports.jsxs(i.AlertDialogContent,{className:"border-border",children:[r.jsxRuntimeExports.jsxs(i.AlertDialogHeader,{children:[r.jsxRuntimeExports.jsx(i.AlertDialogTitle,{children:o("clear_canvas_title")}),r.jsxRuntimeExports.jsx(i.AlertDialogDescription,{children:o("clear_canvas_description")})]}),r.jsxRuntimeExports.jsxs(i.AlertDialogFooter,{children:[r.jsxRuntimeExports.jsx(i.AlertDialogCancel,{children:o("cancel")}),r.jsxRuntimeExports.jsx(i.AlertDialogAction,{onClick:n,children:o("yes")})]})]})]})})},Ee=()=>{const[o,s]=k.useAtom(i.aiAssistantActiveAtom);return i.useBuilderProp("askAiCallBack",null)?r.jsxRuntimeExports.jsxs("div",{className:"flex items-center space-x-2",children:[r.jsxRuntimeExports.jsxs(i.Label,{htmlFor:"ai-assistant",className:"flex items-center gap-x-1 text-sm text-yellow-600",children:[r.jsxRuntimeExports.jsx(re.SparklesIcon,{className:"w-4"}),"AI Assistant"]}),r.jsxRuntimeExports.jsx(i.Switch,{className:"scale-90",checked:o,onCheckedChange:t=>{s(t)},id:"ai-assitantt"})]}):null},Re=()=>{const o=i.useBuilderProp("darkMode",!0),[s]=i.useCanvasZoom();return r.jsxRuntimeExports.jsxs("div",{className:"flex h-10 items-center justify-between border-b bg-background/70 px-2",children:[r.jsxRuntimeExports.jsxs("div",{className:"flex h-full space-x-2",children:[r.jsxRuntimeExports.jsx(be,{}),r.jsxRuntimeExports.jsx(i.Separator,{orientation:"vertical"}),o?r.jsxRuntimeExports.jsxs(r.jsxRuntimeExports.Fragment,{children:[r.jsxRuntimeExports.jsx(ye,{}),r.jsxRuntimeExports.jsx(i.Separator,{orientation:"vertical"})]}):null,r.jsxRuntimeExports.jsxs("div",{className:"flex w-12 cursor-not-allowed items-center justify-center gap-x-1 space-x-0 font-medium text-gray-400",children:[r.jsxRuntimeExports.jsx(R.ZoomInIcon,{className:"h-3.5 w-3.5 flex-shrink-0"})," ",r.jsxRuntimeExports.jsxs("div",{className:"text-xs leading-3",children:[c.round(s,0),"%"]})]}),r.jsxRuntimeExports.jsx(i.Separator,{orientation:"vertical"}),r.jsxRuntimeExports.jsx(je,{})]}),r.jsxRuntimeExports.jsxs("div",{className:"flex h-full items-center space-x-2",children:[r.jsxRuntimeExports.jsx(ke,{}),r.jsxRuntimeExports.jsx(i.Separator,{orientation:"vertical"}),r.jsxRuntimeExports.jsx(Ee,{})]})]})},we=`<!doctype html>
|
|
2
|
+
<html lang="en" dir="__HTML_DIR__" class="scroll-smooth h-full overflow-y-auto">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8">
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
6
|
+
<script src="https://cdn.tailwindcss.com?plugins=forms,typography,aspect-ratio"><\/script>
|
|
7
|
+
<style>
|
|
8
|
+
html { height: 100%; overflow:auto; }
|
|
9
|
+
body { height: 100%; }
|
|
10
|
+
.air-highlight{ outline: 1px solid #42a1fc !important; outline-offset: -1px;}
|
|
11
|
+
.air-highlight-multi{ outline: 1px solid #29e503 !important; outline-offset: -1px;}
|
|
12
|
+
body{ -webkit-touch-callout: none; -webkit-user-select: none; -khtml-user-select: none;
|
|
13
|
+
-moz-user-select: none;-ms-user-select: none; user-select: none; }
|
|
14
|
+
html{
|
|
15
|
+
-ms-overflow-style: none; /* IE and Edge */
|
|
16
|
+
scrollbar-width: none; /* Firefox */
|
|
17
|
+
}
|
|
18
|
+
/** IMPORTANT: Make fields content editable in SAFARI */
|
|
19
|
+
[contenteditable] {-webkit-user-select: text;user-select: text;}
|
|
20
|
+
|
|
21
|
+
html::-webkit-scrollbar { width: 0 !important }
|
|
22
|
+
.aspect-auto{aspect-ratio: auto;}
|
|
23
|
+
.aspect-square{aspect-ratio: 1/1;}
|
|
24
|
+
.aspect-video{aspect-ratio: 16/9;}
|
|
25
|
+
.dragging [data-dnd="leaf"] { pointer-events: none; } .dragging [data-dnd="leaf"] * { pointer-events: none; }
|
|
26
|
+
.dragging [data-dnd="ignore"], .dragging [data-dnd="ignore"] * { pointer-events: none; }
|
|
27
|
+
a{ pointer-events: none !important; }
|
|
28
|
+
[contenteditable="true"], [contenteditable="true"] * { cursor: text !important; }
|
|
29
|
+
[contenteditable="true"] {
|
|
30
|
+
outline: none;
|
|
31
|
+
box-shadow: 0 0 0px 4px rgba(36, 150, 255, 0.2);
|
|
32
|
+
-webkit-user-select: text;
|
|
33
|
+
-moz-user-select: text;
|
|
34
|
+
user-select: text;
|
|
35
|
+
}
|
|
36
|
+
.frame-root .frame-content { height: 100%; }
|
|
37
|
+
[data-drop="yes"] { outline: 2px dashed orange !important; outline-offset: -2px }
|
|
38
|
+
[data-dnd="yes"] { pointer-events: auto !important}
|
|
39
|
+
[data-dnd="no"] { pointer-events: none !important; }
|
|
40
|
+
</style>
|
|
41
|
+
<style id="hidden-blocks"></style>
|
|
42
|
+
<style id="selected-block"></style>
|
|
43
|
+
<style id="selected-styling-block"></style>
|
|
44
|
+
<style id="highlighted-block"></style>
|
|
45
|
+
<style id="dragged-block"></style>
|
|
46
|
+
|
|
47
|
+
</head>
|
|
48
|
+
<body class="font-body antialiased h-full">
|
|
49
|
+
<div class="frame-root h-full"></div>
|
|
50
|
+
<script src="https://cdn.jsdelivr.net/npm/quill@2.0.0/dist/quill.js"><\/script>
|
|
51
|
+
</body>
|
|
52
|
+
</html>`,Se=o=>{const[s]=i.useCanvasWidth(),[,e]=i.useCanvasZoom(),[t,n]=x.useState({}),u=x.useCallback(()=>{const{width:a,height:l}=o;if(a<s){const p=parseFloat((a/s).toFixed(2).toString());let d={};const g=l*p;l&&(d={height:100+(l-g)/g*100+"%"}),n({position:"relative",top:0,transform:`scale(${p})`,transformOrigin:"top left",...d,maxWidth:"none"}),e(p*100)}else n({}),e(100)},[s,o,e]);return x.useEffect(()=>{u()},[s,o,e,u]),t};let J,V;typeof document<"u"&&(J=document);typeof window<"u"&&(V=window);const ee=x.createContext({document:J,window:V}),N=()=>x.useContext(ee),{Provider:Be,Consumer:ot}=ee;class te extends x.Component{componentDidMount(){this.props.contentDidMount()}componentDidUpdate(){this.props.contentDidUpdate()}render(){return x.Children.only(this.props.children)}}I(te,"propTypes",{children:w.element.isRequired,contentDidMount:w.func.isRequired,contentDidUpdate:w.func.isRequired});class O extends x.Component{constructor(e,t){super(e,t);I(this,"setRef",e=>{this.nodeRef.current=e;const{forwardedRef:t}=this.props;typeof t=="function"?t(e):t&&(t.current=e)});I(this,"handleLoad",()=>{clearInterval(this.loadCheck),this.state.iframeLoaded||this.setState({iframeLoaded:!0})});I(this,"loadCheck",()=>setInterval(()=>{this.handleLoad()},500));this._isMounted=!1,this.nodeRef=x.createRef(),this.state={iframeLoaded:!1}}componentDidMount(){this._isMounted=!0,this.getDoc()&&this.nodeRef.current.contentWindow.addEventListener("DOMContentLoaded",this.handleLoad)}componentWillUnmount(){this._isMounted=!1,this.nodeRef.current.removeEventListener("DOMContentLoaded",this.handleLoad)}getDoc(){return this.nodeRef.current?this.nodeRef.current.contentDocument:null}getMountTarget(){const e=this.getDoc();return this.props.mountTarget?e.querySelector(this.props.mountTarget):e.body.children[0]}renderFrameContents(){if(!this._isMounted)return null;const e=this.getDoc();if(!e)return null;const t=this.props.contentDidMount,n=this.props.contentDidUpdate,u=e.defaultView||e.parentView,a=r.jsxRuntimeExports.jsx(te,{contentDidMount:t,contentDidUpdate:n,children:r.jsxRuntimeExports.jsx(Be,{value:{document:e,window:u},children:r.jsxRuntimeExports.jsx("div",{className:"frame-content",children:this.props.children})})}),l=this.getMountTarget();return[Y.createPortal(this.props.head,this.getDoc().head),Y.createPortal(a,l)]}render(){const e={...this.props,srcDoc:this.props.initialContent,children:void 0};return delete e.head,delete e.initialContent,delete e.mountTarget,delete e.contentDidMount,delete e.contentDidUpdate,delete e.forwardedRef,r.jsxRuntimeExports.jsx("iframe",{...e,ref:this.setRef,onLoad:this.handleLoad,children:this.state.iframeLoaded&&this.renderFrameContents()})}}I(O,"propTypes",{style:w.object,head:w.node,initialContent:w.string,mountTarget:w.string,contentDidMount:w.func,contentDidUpdate:w.func,children:w.oneOfType([w.element,w.arrayOf(w.element)])}),I(O,"defaultProps",{style:{},head:null,children:void 0,mountTarget:void 0,contentDidMount:()=>{},contentDidUpdate:()=>{},initialContent:'<!DOCTYPE html><html><head></head><body><div class="frame-root"></div></body></html>'});const Ce=x.forwardRef((o,s)=>r.jsxRuntimeExports.jsx(O,{...o,forwardedRef:s}));function W(o){const s=window.getComputedStyle(o),e=s.display;if(e==="flex"||e==="inline-flex"){const t=s.flexDirection;return t==="column"||t==="column-reverse"?"vertical":"horizontal"}else if(e==="grid"){const t=s.gridAutoFlow,n=s.gridTemplateRows,u=s.gridTemplateColumns;return t.includes("column")||n.split(" ").length>u.split(" ").length?"vertical":"horizontal"}else if(e==="block"||e==="inline-block")return"vertical";return"horizontal"}let y=null,B=[],_=null,P=null;const Q=(o,s,e)=>{if(!y||!o)return;const t=y==null?void 0:y.getElementById("placeholder"),n=B.map(([p])=>p),u=n.reduce((p,d)=>Math.abs(d-e)<Math.abs(p-e)?d:p,0),a=n.indexOf(u);if(!B[a])return;const l=B[a];t.style.width=s==="vertical"?l[2]+"px":"2px",t.style.height=s==="vertical"?"2px":l[2]+"px",t.style.display="block",s==="vertical"?(t.style.top=l[0]+"px",t.style.left=l[1]+"px"):(t.style.top=l[1]+"px",t.style.left=l[0]+"px")};function Ae(o,s){let e=0,t=1/0;return s.forEach((n,u)=>{const a=Math.abs(n[0]-o);a<t&&(t=a,e=u)}),e}const Ie=o=>{const e=W(o)==="horizontal";B=[],Array.from(o.children).forEach((t,n)=>{if(t.classList.contains("pointer-events-none"))return;const u=e?t.offsetLeft:t.offsetTop,a=e?[t.offsetTop,t.clientHeight]:[t.offsetLeft,t.clientWidth];if(B.push([u,a[0],a[1]]),n===o.children.length-1){const l=e?t.offsetLeft+t.clientWidth:t.offsetTop+t.clientHeight;B.push([l,a[0],a[1]])}})},De=c.throttle(o=>{var n;const s=o.target,e=W(s),t=(n=y==null?void 0:y.defaultView)==null?void 0:n.scrollY;e==="vertical"?Q(s,e,o.clientY+t):Q(s,e,o.clientX)},0);function H(){const o=y==null?void 0:y.getElementById("placeholder");o.style.display="none",_e("pointer-none"),Me()}function _e(o){(y==null?void 0:y.querySelectorAll(`.${o}`)).forEach(e=>{e.classList.remove(o)})}function Me(){const o=y==null?void 0:y.querySelector('[data-drop="yes"]');o&&o.removeAttribute("data-drop")}const Te=()=>{const{document:o}=N(),[s,e]=k.useAtom(i.draggingFlagAtom),{addCoreBlock:t}=i.useAddBlock(),[,n]=i.useHighlightBlockId(),[,u]=i.useSelectedBlockIds(),{moveBlocks:a}=i.useBlocksStoreUndoableActions(),[,l]=k.useAtom(i.draggedBlockIdAtom),[p,d]=k.useAtom(M.draggedBlockAtom),[,g]=k.useAtom(M.dropTargetAtom);return y=o,{isDragging:s,onDragOver:h=>{h.preventDefault(),h.stopPropagation(),De(h)},onDrop:h=>{var S;_==null||_.classList.remove("drop-target");const m=_,b=W(m)==="vertical"?h.clientY+((S=y==null?void 0:y.defaultView)==null?void 0:S.scrollY):h.clientX;P=Ae(b,B);const v=p,f=m.getAttribute("data-block-id");if(!c.has(v,"_id")){t(v,f==="canvas"?null:f,P),setTimeout(()=>{H()},300),B=[],e(!1),l(""),d(null),g(null);return}let E=m.getAttribute("data-block-id");E===null&&(E=h.target.parentElement.getAttribute("data-block-id")),a([v._id],E,P),H(),e(!1),l(""),B=[],setTimeout(()=>H(),300)},onDragEnter:h=>{const m=h,$=m.target;_=$;const b=$.getAttribute("data-block-id");g(b),m.stopPropagation(),m.preventDefault(),B=[],Ie($),console.log(B,h.clientY,y.defaultView.scrollY),$.classList.add("drop-target"),e(!0),n(""),u([])}}};function K(o){return o.getAttribute("data-block-id")?o:o.closest("[data-block-id]")}function Ne(o){o.container.innerHTML="",o.container.parentNode.removeChild(o.container);var s=document.querySelector(".ql-toolbar");s&&s.parentNode.removeChild(s),o=null}const qe=()=>{const o=["Heading","Paragraph","Text","Link","Span","Button"],s=i.useUpdateBlocksProps(),[,e]=i.useHighlightBlockId(),[t,n]=k.useAtom(i.inlineEditingActiveAtom);return u=>{var h;if(t)return;const a=K(u.target),l=a.getAttribute("data-block-type");if(!l||!o.includes(l))return;const p=a.cloneNode(!0);a.style.display="none",Array.from(p.attributes).forEach(m=>{m.name!=="class"&&p.removeAttribute(m.name)}),l==="Text"&&(p.style.display="inline-block"),a.parentNode.insertBefore(p,a.nextSibling);const d=new ie.Quill(p,{placeholder:"Type here..."});function g(){const m=d.getText(0,d.getLength());s([a.getAttribute("data-block-id")],{content:m}),a.removeAttribute("style"),p.removeEventListener("blur",g,!0),Ne(d),n(""),e("")}p.addEventListener("blur",g,!0),p.addEventListener("keydown",m=>{(m.key==="Enter"||m.key==="Escape")&&g()}),d.focus(),(h=p.querySelector(".ql-clipboard"))==null||h.remove(),n(a.getAttribute("data-block-id"))}},Le=()=>{const[,o]=i.useSelectedStylingBlocks(),[s,e]=i.useSelectedBlockIds(),[,t]=i.useHighlightBlockId(),[n]=k.useAtom(i.inlineEditingActiveAtom),[u]=k.useAtom(i.treeRefAtom);return a=>{if(n)return;a.stopPropagation();const l=K(a.target);if(l!=null&&l.getAttribute("data-block-id")&&(l==null?void 0:l.getAttribute("data-block-id"))==="container"){e([]),o([]),t("");return}if(l!=null&&l.getAttribute("data-block-parent")){const p=l.getAttribute("data-style-prop"),d=l.getAttribute("data-style-id"),g=l.getAttribute("data-block-parent");s.includes(g)||u==null||u.closeAll(),o([{id:d,prop:p,blockId:g}]),e([g])}else if(l!=null&&l.getAttribute("data-block-id")){let p=l.getAttribute("data-block-id");s.includes(p)||u==null||u.closeAll(),e([p])}t("")}},Fe=c.throttle((o,s)=>{const e=K(o.target);e!=null&&e.getAttribute("data-style-id")&&s(e.getAttribute("data-style-id"))},100),Pe=()=>{const[,o]=i.useHighlightBlockId(),[s]=k.useAtom(i.inlineEditingActiveAtom);return e=>{s||Fe(e,o)}},He=({children:o})=>{const{document:s}=N(),[e]=i.useSelectedBlockIds(),[t,n]=i.useSelectedStylingBlocks();x.useEffect(()=>{setTimeout(()=>{if(!c.isEmpty(t))return;const d=se(s,c.first(e));if(d){const g=d.getAttribute("data-style-prop");if(g){const h=d.getAttribute("data-style-id"),m=d.getAttribute("data-block-parent");n([{id:h,prop:g,blockId:m}])}}},100)},[s,e,n,t]);const u=qe(),a=Le(),l=Pe(),p=Te();return r.jsxRuntimeExports.jsx("div",{"data-block-id":"canvas",id:"canvas",onClick:a,onDoubleClick:u,onMouseMove:l,...c.omit(p,"isDragging"),className:"relative mb-5 h-full max-w-full "+(p.isDragging?"dragging":""),children:o})},se=(o,s)=>o.querySelector(`[data-block-id="${s}"]`),Oe=()=>{const{window:o}=N(),[s,e]=i.useSelectedBlockIds(),[t]=i.useBlocksStore(),[,n]=i.useSelectedStylingBlocks(),{undo:u,redo:a}=i.useUndoManager(),l=i.useDuplicateBlocks(),[,p]=i.usePreviewMode(),d=i.useRemoveBlocks(),{savePage:g}=i.useSavePage(),[h]=k.useAtom(i.inlineEditingActiveAtom),[,m]=k.useAtom(i.editLayerNameAtom),$=v=>{v.key==="Enter"&&(v.preventDefault(),s.length===1&&m(c.first(s)))},b=v=>{const f=t.find(E=>E._id===v);return f?f._parent:null};return x.useEffect(()=>{const v=f=>{if(f.key==="Escape"){e([]),n([]);return}if($(f),!h&&(f.key==="Delete"||f.key==="Backspace")&&(f.preventDefault(),d(s)),f.ctrlKey||f.metaKey){if(f.key==="ArrowUp"){f.preventDefault();const E=s.length>0?b(s[0]):null;E&&e([E])}if(["z","y","d","x","c","p","s","v"].includes(f.key)){if(h&&["x","z","v"].includes(f.key))return!0;f.preventDefault()}f.key==="s"&&(f.stopPropagation(),f.preventDefault(),g()),f.key==="z"&&u(),f.key==="y"&&a(),f.key==="d"&&l(s)}};return o.removeEventListener("keydown",v),o.addEventListener("keydown",v),()=>{o.removeEventListener("keydown",v)}},[s,e,u,d,p,a,l,h,g,o]),null},ze=({block:o,label:s})=>{const[,e]=i.useSelectedBlockIds(),[,t]=i.useHighlightBlockId(),[,n]=k.useAtom(M.draggedBlockAtom),u=ae.useFeature("dnd");return r.jsxRuntimeExports.jsxs("div",{className:"mr-10 flex cursor-grab items-center space-x-1 px-1",draggable:u?"true":"false",onDragStart:a=>{a.dataTransfer.setData("text/plain",JSON.stringify(c.pick(o,["_id","_type","_name"]))),n(o),setTimeout(()=>{e([]),t(null)},200)},children:[r.jsxRuntimeExports.jsx(R.DragHandleDots2Icon,{}),s]})},Ue=({selectedBlockElement:o,block:s})=>{const e=i.useRemoveBlocks(),t=i.useDuplicateBlocks(),[,n]=i.useSelectedBlockIds(),[,u]=i.useSelectedStylingBlocks(),[a]=k.useAtom(i.inlineEditingActiveAtom),{floatingStyles:l,refs:p,update:d}=G.useFloating({placement:"top-start",middleware:[G.shift(),le.flip()],elements:{reference:o}});ce.useResizeObserver(o,()=>d(),o!==null);const g=c.get(s,"_parent",null),h=c.isEmpty(c.get(s,"_name",""))?c.get(s,"_type",""):c.get(s,"_name","");return!o||!s||a?null:r.jsxRuntimeExports.jsx(r.jsxRuntimeExports.Fragment,{children:r.jsxRuntimeExports.jsxs("div",{role:"button",tabIndex:0,ref:p.setFloating,style:l,onClick:m=>{m.stopPropagation(),m.preventDefault()},onKeyDown:m=>m.stopPropagation(),className:"z-[99999] flex h-6 items-center bg-blue-500 py-2 text-xs text-white",children:[r.jsxRuntimeExports.jsx(ze,{label:h,block:s}),r.jsxRuntimeExports.jsxs("div",{className:"flex gap-2 px-1",children:[g&&r.jsxRuntimeExports.jsx(R.ArrowUpIcon,{className:"hover:scale-105",onClick:()=>{u([]),n([g])}}),i.canDuplicateBlock(c.get(s,"_type",""))?r.jsxRuntimeExports.jsx(R.CopyIcon,{className:"hover:scale-105",onClick:()=>t([s==null?void 0:s._id])}):null,i.canDeleteBlock(c.get(s,"_type",""))?r.jsxRuntimeExports.jsx(R.TrashIcon,{className:"hover:scale-105",onClick:()=>e([s==null?void 0:s._id])}):null]})]})})},We=({addVariant:o,e:s})=>{o("hs-dropdown-open",[({modifySelectors:e,separator:t})=>{e(({className:n})=>`.hs-dropdown.open > .${s(`hs-dropdown-open${t}${n}`)}`)},({modifySelectors:e,separator:t})=>{e(({className:n})=>`.hs-dropdown.open .hs-dropdown-toggle .${s(`hs-dropdown-open${t}${n}`)}`)},({modifySelectors:e,separator:t})=>{e(({className:n})=>`.hs-dropdown.open > .hs-dropdown-menu > .${s(`hs-dropdown-open${t}${n}`)}`)}]),o("hs-removing",({modifySelectors:e,separator:t})=>{e(({className:n})=>`.hs-removing.${s(`hs-removing${t}${n}`)}`)}),o("hs-tooltip-shown",({modifySelectors:e,separator:t})=>{e(({className:n})=>`.hs-tooltip.show .${s(`hs-tooltip-shown${t}${n}`)}`)}),o("hs-accordion-active",[({modifySelectors:e,separator:t})=>{e(({className:n})=>`.hs-accordion.active.${s(`hs-accordion-active${t}${n}`)}`)},({modifySelectors:e,separator:t})=>{e(({className:n})=>`.hs-accordion.active > .${s(`hs-accordion-active${t}${n}`)}`)},({modifySelectors:e,separator:t})=>{e(({className:n})=>`.hs-accordion.active > .hs-accordion-toggle .${s(`hs-accordion-active${t}${n}`)}`)},({modifySelectors:e,separator:t})=>{e(({className:n})=>`.hs-accordion.active > .hs-accordion-heading > .hs-accordion-toggle .${s(`hs-accordion-active${t}${n}`)}`)},({modifySelectors:e,separator:t})=>{e(({className:n})=>`.hs-accordion.active > .hs-accordion-toggle.${s(`hs-accordion-active${t}${n}`)}`)},({modifySelectors:e,separator:t})=>{e(({className:n})=>`.hs-accordion.active > .hs-accordion-heading > .hs-accordion-toggle.${s(`hs-accordion-active${t}${n}`)}`)}]),o("hs-accordion-selected",({modifySelectors:e,separator:t})=>{e(({className:n})=>`.hs-accordion .selected.${s(`hs-accordion-selected${t}${n}`)}`)}),o("hs-collapse-open",[({modifySelectors:e,separator:t})=>{e(({className:n})=>`.hs-collapse.open .${s(`hs-collapse-open${t}${n}`)}`)},({modifySelectors:e,separator:t})=>{e(({className:n})=>`.hs-collapse.open.${s(`hs-collapse-open${t}${n}`)}`)},({modifySelectors:e,separator:t})=>{e(({className:n})=>`.hs-collapse-toggle.open .${s(`hs-collapse-open${t}${n}`)}`)},({modifySelectors:e,separator:t})=>{e(({className:n})=>`.hs-collapse-toggle.open.${s(`hs-collapse-open${t}${n}`)}`)}]),o("hs-tab-active",[({modifySelectors:e,separator:t})=>{e(({className:n})=>`[data-hs-tab].active.${s(`hs-tab-active${t}${n}`)}`)},({modifySelectors:e,separator:t})=>{e(({className:n})=>`[data-hs-tab].active .${s(`hs-tab-active${t}${n}`)}`)}]),o("hs-overlay-open",[({modifySelectors:e,separator:t})=>{e(({className:n})=>`.open.${s(`hs-overlay-open${t}${n}`)}`)},({modifySelectors:e,separator:t})=>{e(({className:n})=>`.open .${s(`hs-overlay-open${t}${n}`)}`)}]),o("hs-overlay-layout-open",[({modifySelectors:e,separator:t})=>{e(({className:n})=>`.hs-overlay-body-open.${s(`hs-overlay-layout-open${t}${n}`)}`)},({modifySelectors:e,separator:t})=>{e(({className:n})=>`.hs-overlay-body-open .${s(`hs-overlay-layout-open${t}${n}`)}`)}]),o("hs-overlay-backdrop-open",[({modifySelectors:e,separator:t})=>{e(({className:n})=>`.hs-overlay-backdrop.${s(`hs-overlay-backdrop-open${t}${n}`)}`)},({modifySelectors:e,separator:t})=>{e(({className:n})=>`.hs-overlay-backdrop .${s(`hs-overlay-backdrop-open${t}${n}`)}`)}]),o("hs-scrollspy-active",({modifySelectors:e,separator:t})=>{e(({className:n})=>`.active.${s(`hs-scrollspy-active${t}${n}`)}`)}),o("hs-carousel-active",[({modifySelectors:e,separator:t})=>{e(({className:n})=>`.active.${s(`hs-carousel-active${t}${n}`)}`)},({modifySelectors:e,separator:t})=>{e(({className:n})=>`.active .${s(`hs-carousel-active${t}${n}`)}`)}]),o("hs-carousel-disabled",[({modifySelectors:e,separator:t})=>{e(({className:n})=>`.disabled.${s(`hs-carousel${t}disabled${t}${n}`)}`)},({modifySelectors:e,separator:t})=>{e(({className:n})=>`.disabled .${s(`hs-carousel${t}disabled${t}${n}`)}`)}]),o("hs-selected",[({modifySelectors:e,separator:t})=>{e(({className:n})=>`.selected.${s(`hs-selected${t}${n}`)}`)},({modifySelectors:e,separator:t})=>{e(({className:n})=>`.selected .${s(`hs-selected${t}${n}`)}`)}]),o("hs-select-disabled",[({modifySelectors:e,separator:t})=>{e(({className:n})=>`.disabled.${s(`hs-select-disabled${t}${n}`)}`)},({modifySelectors:e,separator:t})=>{e(({className:n})=>`.disabled .${s(`hs-select-disabled${t}${n}`)}`)}]),o("hs-select-active",[({modifySelectors:e,separator:t})=>{e(({className:n})=>`.active.${s(`hs-select-active${t}${n}`)}`)},({modifySelectors:e,separator:t})=>{e(({className:n})=>`.active .${s(`hs-select-active${t}${n}`)}`)}]),o("hs-input-number-disabled",[({modifySelectors:e,separator:t})=>{e(({className:n})=>`.disabled.${s(`hs-input-number-disabled${t}${n}`)}`)},({modifySelectors:e,separator:t})=>{e(({className:n})=>`.disabled .${s(`hs-input-number-disabled${t}${n}`)}`)}]),o("hs-pin-input-active",[({modifySelectors:e,separator:t})=>{e(({className:n})=>`.active.${s(`hs-pin-input-active${t}${n}`)}`)},({modifySelectors:e,separator:t})=>{e(({className:n})=>`.active .${s(`hs-pin-input-active${t}${n}`)}`)}]),o("hs-select-opened",[({modifySelectors:e,separator:t})=>{e(({className:n})=>`.opened.${s(`hs-select-opened${t}${n}`)}`)}]),o("hs-password-active",[({modifySelectors:e,separator:t})=>{e(({className:n})=>`.active.${s(`hs-password-active${t}${n}`)}`)},({modifySelectors:e,separator:t})=>{e(({className:n})=>`.active .${s(`hs-password-active${t}${n}`)}`)}]),o("hs-stepper-active",[({modifySelectors:e,separator:t})=>{e(({className:n})=>`.active.${s(`hs-stepper-active${t}${n}`)}`)},({modifySelectors:e,separator:t})=>{e(({className:n})=>`.active .${s(`hs-stepper-active${t}${n}`)}`)}]),o("hs-stepper-success",[({modifySelectors:e,separator:t})=>{e(({className:n})=>`.success.${s(`hs-stepper-success${t}${n}`)}`)},({modifySelectors:e,separator:t})=>{e(({className:n})=>`.success .${s(`hs-stepper-success${t}${n}`)}`)}]),o("hs-stepper-completed",[({modifySelectors:e,separator:t})=>{e(({className:n})=>`.completed.${s(`hs-stepper-completed${t}${n}`)}`)},({modifySelectors:e,separator:t})=>{e(({className:n})=>`.completed .${s(`hs-stepper-completed${t}${n}`)}`)}]),o("hs-stepper-error",[({modifySelectors:e,separator:t})=>{e(({className:n})=>`.error.${s(`hs-stepper-error${t}${n}`)}`)},({modifySelectors:e,separator:t})=>{e(({className:n})=>`.error .${s(`hs-stepper-error${t}${n}`)}`)}]),o("hs-stepper-processed",[({modifySelectors:e,separator:t})=>{e(({className:n})=>`.processed.${s(`hs-stepper-processed${t}${n}`)}`)},({modifySelectors:e,separator:t})=>{e(({className:n})=>`.processed .${s(`hs-stepper-processed${t}${n}`)}`)}]),o("hs-stepper-disabled",[({modifySelectors:e,separator:t})=>{e(({className:n})=>`.disabled.${s(`hs-stepper-disabled${t}${n}`)}`)},({modifySelectors:e,separator:t})=>{e(({className:n})=>`.disabled .${s(`hs-stepper-disabled${t}${n}`)}`)}]),o("hs-stepper-skipped",[({modifySelectors:e,separator:t})=>{e(({className:n})=>`.skipped.${s(`hs-stepper-skipped${t}${n}`)}`)},({modifySelectors:e,separator:t})=>{e(({className:n})=>`.skipped .${s(`hs-stepper-skipped${t}${n}`)}`)}]),o("hs-strong-password",[({modifySelectors:e,separator:t})=>{e(({className:n})=>`.passed.${s(`hs-strong-password${t}${n}`)}`)},({modifySelectors:e,separator:t})=>{e(({className:n})=>`.passed .${s(`hs-strong-password${t}${n}`)}`)}]),o("hs-strong-password-accepted",[({modifySelectors:e,separator:t})=>{e(({className:n})=>`.accepted.${s(`hs-strong-password-accepted${t}${n}`)}`)},({modifySelectors:e,separator:t})=>{e(({className:n})=>`.accepted .${s(`hs-strong-password-accepted${t}${n}`)}`)}]),o("hs-strong-password-active",[({modifySelectors:e,separator:t})=>{e(({className:n})=>`.active.${s(`hs-strong-password-active${t}${n}`)}`)}]),o("hs-combo-box-active",[({modifySelectors:e,separator:t})=>{e(({className:n})=>`.active .${s(`hs-combo-box-active${t}${n}`)}`)},({modifySelectors:e,separator:t})=>{e(({className:n})=>`.active.${s(`hs-combo-box-active${t}${n}`)}`)}]),o("hs-combo-box-selected",[({modifySelectors:e,separator:t})=>{e(({className:n})=>`.selected .${s(`hs-combo-box-selected${t}${n}`)}`)},({modifySelectors:e,separator:t})=>{e(({className:n})=>`.selected.${s(`hs-combo-box-selected${t}${n}`)}`)}]),o("hs-combo-box-tab-active",[({modifySelectors:e,separator:t})=>{e(({className:n})=>`.active.${s(`hs-combo-box-tab-active${t}${n}`)}`)}]),o("hs-apexcharts-tooltip-dark",[({modifySelectors:e,separator:t})=>{e(({className:n})=>`.dark.${s(`hs-apexcharts-tooltip-dark${t}${n}`)}`)}]),o("hs-success",[({modifySelectors:e,separator:t})=>{e(({className:n})=>`.success .${s(`hs-success${t}${n}`)}`)},({modifySelectors:e,separator:t})=>{e(({className:n})=>`.success.${s(`hs-success${t}${n}`)}`)}]),o("hs-error",[({modifySelectors:e,separator:t})=>{e(({className:n})=>`.error .${s(`hs-error${t}${n}`)}`)},({modifySelectors:e,separator:t})=>{e(({className:n})=>`.error.${s(`hs-error${t}${n}`)}`)}]),o("hs-default-mode-active",({modifySelectors:e,separator:t})=>{e(({className:n})=>`.default .${s(`hs-default-mode-active${t}${n}`)}`)}),o("hs-dark-mode-active",({modifySelectors:e,separator:t})=>{e(({className:n})=>`.dark .${s(`hs-dark-mode-active${t}${n}`)}`)}),o("hs-auto-mode-active",({modifySelectors:e,separator:t})=>{e(({className:n})=>`.auto .${s(`hs-auto-mode-active${t}${n}`)}`)})},Ke=({model:o})=>{const[s]=i.useBrandingOptions(),[e]=i.useSelectedBlockIds(),[t]=i.useDarkMode(),[n]=i.useHighlightBlockId(),[u]=i.useSelectedStylingBlocks(),[a]=k.useAtom(i.draggedBlockIdAtom),{document:l,window:p}=N(),[d]=x.useState(l==null?void 0:l.getElementById("highlighted-block")),[g]=x.useState(l==null?void 0:l.getElementById("selected-block")),[h]=x.useState(l==null?void 0:l.getElementById("selected-styling-block")),[m]=x.useState(l==null?void 0:l.getElementById("dragged-block"));x.useEffect(()=>{t?l==null||l.documentElement.classList.add("dark"):l==null||l.documentElement.classList.remove("dark")},[t,l]);const $=c.get(s,"headingFont","DM Sans"),b=c.get(s,"bodyFont","DM Sans");return x.useEffect(()=>{const v=c.get(s,"primaryColor","#000"),f=c.get(s,"secondaryColor","#FFF"),E=c.get(s,"bodyBgLightColor","#fff"),S=c.get(s,"bodyBgDarkColor","#000"),D=c.get(s,"bodyTextDarkColor","#000"),q=c.get(s,"bodyTextLightColor","#fff"),L=xe([{color:v,name:"primary"},{color:f,name:"secondary"}]),F={"bg-light":E,"bg-dark":S,"text-dark":D,"text-light":q},j=c.get(s,"roundedCorners","0");!p||!p.tailwind||(p.tailwind.config={darkMode:"class",theme:{extend:{container:{center:!0,padding:"1rem",screens:{"2xl":"1400px"}},fontFamily:{heading:[$],body:[b]},borderRadius:{DEFAULT:`${j||"0"}px`},colors:{...F,...L}}},plugins:[de,ue,pe,p.tailwind.plugin.withOptions(()=>We)]})},[s,p,$,b]),x.useEffect(()=>{g&&(g.textContent=`${c.map(e,v=>`[data-block-id="${v}"]`).join(",")}{
|
|
53
|
+
outline: 1px solid ${e.length===1?"#42a1fc":"orange"} !important; outline-offset: -1px;
|
|
54
|
+
}`)},[e,g]),x.useEffect(()=>{if(!a){m.textContent="";return}m.textContent=`[data-block-id="${a}"]{ pointer-events: none !important; opacity: 0.2 !important}`},[a]),x.useEffect(()=>{d&&(d.textContent=n?`[data-style-id="${n}"]{ outline: 1px solid #42a1fc !important; outline-offset: -1px;}`:"")},[n,e,d]),x.useEffect(()=>{h&&(h.textContent=`${c.map(u,({id:v})=>`[data-style-id="${v}"]`).join(",")}{
|
|
55
|
+
outline: 1px solid #42a1fc !important; outline-offset: -1px;
|
|
56
|
+
}`)},[u,h]),x.useEffect(()=>{const v=c.get(s,"bodyTextLightColor","#64748b"),f=c.get(s,"bodyTextDarkColor","#94a3b8"),E=c.get(s,"bodyBgLightColor","#FFFFFF"),S=c.get(s,"bodyBgDarkColor","#0f172a");l.body.className=`font-body antialiased text-[${v}] bg-[${E}] dark:text-[${f}] dark:bg-[${S}]`},[s,l,o]),o==="page"?r.jsxRuntimeExports.jsxs(r.jsxRuntimeExports.Fragment,{children:[$&&r.jsxRuntimeExports.jsx("link",{id:"heading-font",rel:"stylesheet",type:"text/css",href:`https://fonts.googleapis.com/css2?family=${$.replace(/ /g,"+")}:wght@300;400;500;600;700;800;900&display=swap`,media:"all"}),b&&$!==b&&r.jsxRuntimeExports.jsx("link",{id:"body-font",rel:"stylesheet",type:"text/css",href:`https://fonts.googleapis.com/css2?family=${b.replace(/ /g,"+")}:wght@300;400;500;600;700;800;900&display=swap`,media:"all"}),$&&r.jsxRuntimeExports.jsx("style",{children:`h1,h2,h3,h4,h5,h6{font-family: "${$}",ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";}`})]}):null},Ye=o=>{const s={};return Object.keys(o).forEach(e=>{c.isString(o[e])&&o[e].startsWith(T.SLOT_KEY)&&(s[e]=o[e].replace(T.SLOT_KEY,"").split(","))}),s},Ge=c.memoize(o=>{const s=o.replace(T.STYLES_KEY,"").split(",");return he.twMerge(s[0],s[1])});function Xe(o,s){return c.get(o,`${s}_attrs`,{})}function Ze(o){const s={};return Object.keys(o).forEach(e=>{if(c.isString(o[e])&&o[e].startsWith(T.STYLES_KEY)){const t=Ge(o[e]);s[e]={className:t,"data-style-prop":e,"data-block-parent":o._id,"data-style-id":`${e}-${o._id}`,...Xe(o,e)}}}),s}function Qe(o,s){const e=c.get(o,"_bindings",{});return c.isEmpty(e)?{...o}:(c.each(e,(t,n)=>{c.isString(t)&&c.get(s,t,null)&&(o[n]=c.get(s,t,null))}),o)}function z({blocks:o}){const[s]=i.useBlocksStore(),[e]=k.useAtom(M.draggedBlockAtom),[t]=k.useAtom(M.dropTargetAtom),[n]=ge.useCanvasSettings(),u=x.useCallback(d=>Ze(d),[]),[a]=i.useChaiExternalData(),[l]=k.useAtom(i.inlineEditingActiveAtom),p=x.useCallback(d=>d.reduce((g,h)=>{const m=c.get(n,h,{});return{...g,...m}},{}),[n,s]);return r.jsxRuntimeExports.jsx(r.jsxRuntimeExports.Fragment,{children:x.Children.toArray(o.map((d,g)=>{if(l===d._id)return null;const h=Ye(d),m={};c.isEmpty(h)||Object.keys(h).forEach(S=>{m[S]=x.Children.toArray(h[S].map(D=>r.jsxRuntimeExports.jsx(z,{blocks:[c.find(s,{_id:D})]})))});const $=c.filter(s,{_parent:d._id});m.children=$.length?r.jsxRuntimeExports.jsx(z,{blocks:$}):null;const b=me.getBlockComponent(d._type),v=c.get(b,"builderComponent",c.get(b,"component",null));if(c.isNull(v))return r.jsxRuntimeExports.jsx("noscript",{children:`<!-- ${d==null?void 0:d._type} not registered -->`});const f=c.has(b,"getBlockStateFrom")?b==null?void 0:b.getBlockStateFrom(d,s):[],E=p(f);return r.jsxRuntimeExports.jsx(x.Suspense,{children:x.createElement(v,{blockProps:{"data-block-id":d._id,"data-block-type":d._type,...e?{"data-dnd":i.canAcceptChildBlock(d._type,e==null?void 0:e._type)?"yes":"no"}:{},...t===d._id?{"data-drop":"yes"}:{}},index:g,...Qe(d,a),...u(d),...m,inBuilder:!0,blockState:E})})}))})}const Je=()=>{const[o]=i.useBlocksStore(),s=c.isEmpty(o)?null:r.jsxRuntimeExports.jsx(i.BlocksExternalDataProvider,{children:r.jsxRuntimeExports.jsx(z,{blocks:c.filter(o,e=>c.isEmpty(e._parent))})});return r.jsxRuntimeExports.jsx(r.jsxRuntimeExports.Fragment,{children:s})},Ve=(o,s)=>o.querySelector(`[data-style-id="${s}"]`),et=()=>{const[o]=k.useAtom(i.networkModeAtom),[s]=i.usePreviewMode(),[e]=i.useCanvasWidth(),[,t]=i.useSelectedBlockIds(),n=i.useSelectedBlock(),[,u]=i.useHighlightBlockId(),a=x.useRef(null),l=x.useRef(null),[p,d]=x.useState({width:0,height:0}),g=Se(p),[h,m]=x.useState(0),[$,b]=x.useState([]),[,v]=x.useState([]),[,f]=k.useAtom(i.canvasIframeAtom),[E,S]=i.useSelectedStylingBlocks(),D=i.useBuilderProp("loading",!1),q=i.useBuilderProp("htmlDir","ltr");x.useEffect(()=>{const{clientWidth:j,clientHeight:C}=l.current;d({width:j,height:C}),h===0&&m(j)},[l,e,h]);const L=(j,C=0)=>{const{top:A}=j.getBoundingClientRect();return A+C>=0&&A-C<=window.innerHeight};x.useEffect(()=>{var j,C;if(n&&n.type!=="Multiple"&&a.current){const A=se(a.current.contentDocument,n._id);A&&(L(A)||(C=(j=a.current)==null?void 0:j.contentWindow)==null||C.scrollTo({top:A.offsetTop,behavior:"smooth"}),b([A]))}},[n]),x.useEffect(()=>{if(!c.isEmpty(E)&&a.current){const j=Ve(a.current.contentDocument,c.first(E).id);v(j?[j]:[null])}else v([null])},[E]);const F=x.useMemo(()=>{let j=we;return j=j.replace("__HTML_DIR__",q),o==="offline"&&(j=j.replace("https://old.chaibuilder.com/offline/tailwind.cdn.js","/offline/tailwind.cdn.js"),j=j.replace("https://unpkg.com/aos@next/dist/aos.css","/offline/aos.css"),j=j.replace("https://unpkg.com/aos@next/dist/aos.js","/offline/aos.js")),j},[o]);return r.jsxRuntimeExports.jsx("div",{onClick:()=>{t([]),S([])},onMouseLeave:()=>setTimeout(()=>u(""),300),className:"relative mx-auto h-full w-full overflow-hidden",style:h>0&&!c.isEmpty(g)?{width:s?"100%":h}:{},ref:l,children:r.jsxRuntimeExports.jsxs(Ce,{contentDidMount:()=>f(a.current),ref:a,id:"canvas-iframe",style:{width:`${e}px`,...g},className:"relative mx-auto box-content h-full max-w-full shadow-lg transition-all duration-300 ease-linear",initialContent:F,children:[r.jsxRuntimeExports.jsx(Oe,{}),r.jsxRuntimeExports.jsx(Ue,{block:n,selectedBlockElement:c.first($)}),r.jsxRuntimeExports.jsx(Ke,{model:"page"}),r.jsxRuntimeExports.jsx(fe.Provider,{children:r.jsxRuntimeExports.jsx(He,{children:D?r.jsxRuntimeExports.jsx("div",{className:"h-full p-4",children:r.jsxRuntimeExports.jsx(i.Skeleton,{className:"h-full"})}):r.jsxRuntimeExports.jsx(Je,{})})}),r.jsxRuntimeExports.jsx("br",{}),r.jsxRuntimeExports.jsx("div",{id:"placeholder",className:"pointer-events-none absolute z-[99999] max-w-full bg-green-500 transition-transform"})]})})},tt=x.lazy(()=>Promise.resolve().then(()=>require("./CodeEditor-ye3IXW3i.cjs"))),st=()=>{const[o]=i.useCodeEditor();return r.jsxRuntimeExports.jsxs("div",{className:"flex h-full w-full flex-col",children:[r.jsxRuntimeExports.jsx(Re,{}),r.jsxRuntimeExports.jsxs("div",{className:"relative flex h-full flex-col overflow-hidden bg-slate-800/90 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] px-2",children:[r.jsxRuntimeExports.jsx(x.Suspense,{fallback:r.jsxRuntimeExports.jsx(i.Skeleton,{className:"h-full"}),children:r.jsxRuntimeExports.jsx(i.ErrorBoundary,{children:r.jsxRuntimeExports.jsx(et,{})})}),o?r.jsxRuntimeExports.jsx(x.Suspense,{fallback:r.jsxRuntimeExports.jsx(i.Skeleton,{className:"h-full"}),children:r.jsxRuntimeExports.jsx(ve.Resizable,{enable:{top:!0,bottom:!1},className:"max-h-[400px] min-h-[200px]",children:r.jsxRuntimeExports.jsx(tt,{})})}):null]})]})};exports.default=st;
|
|
@@ -1,30 +1,30 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var N = (n, s, e) => (
|
|
1
|
+
var He = Object.defineProperty;
|
|
2
|
+
var Pe = (n, s, e) => s in n ? He(n, s, { enumerable: !0, configurable: !0, writable: !0, value: e }) : n[s] = e;
|
|
3
|
+
var N = (n, s, e) => (Pe(n, typeof s != "symbol" ? s + "" : s, e), e);
|
|
4
4
|
import { j as r } from "./jsx-runtime-WbnYoNE9.js";
|
|
5
|
-
import A, { createElement as ce, useCallback as O, useState as B, useEffect as j, Component as $e, Children as ze, Suspense as
|
|
6
|
-
import { map as
|
|
7
|
-
import { ResetIcon as ue, SunIcon as
|
|
8
|
-
import {
|
|
5
|
+
import A, { createElement as ce, useCallback as O, useState as B, useEffect as j, Component as $e, Children as ze, Suspense as J, useRef as de, useMemo as Oe } from "react";
|
|
6
|
+
import { map as H, includes as pe, toUpper as X, round as Ue, throttle as ye, has as be, isEmpty as I, first as U, omit as We, pick as qe, get as f, isString as se, memoize as Ke, each as Ye, find as Ge, filter as ke, isNull as Xe } from "lodash-es";
|
|
7
|
+
import { ResetIcon as ue, SunIcon as Qe, MobileIcon as he, LaptopIcon as Ze, DesktopIcon as Je, DotsVerticalIcon as Ve, EraserIcon as et, ZoomInIcon as tt, DragHandleDots2Icon as st, ArrowUpIcon as ot, CopyIcon as nt, TrashIcon as rt } from "@radix-ui/react-icons";
|
|
8
|
+
import { k as we, B as W, w as je, aq as Ce, ar as it, as as at, at as lt, au as ct, p as oe, X as dt, h as P, av as pt, aw as ut, ax as ht, ay as mt, az as gt, aA as ft, aB as _e, L as D, Y as M, A as xt, a as vt, b as $t, c as yt, d as bt, e as kt, f as wt, g as jt, a3 as Ct, aC as _t, aD as Bt, q as Be, ap as z, aE as Dt, n as At, D as T, aF as De, Q as It, aG as F, aH as St, j as ne, x as Ae, F as Ie, H as Se, V as Et, aI as Nt, aJ as Mt, aK as Tt, G as Lt, aL as Ft, aM as Rt, aN as Ht, aO as Pt, M as zt, aP as Ot, ah as V, i as Ut, a2 as Wt } from "./ChaiBuilderEditor-bNZZWYMh.js";
|
|
9
9
|
import { useTranslation as re } from "react-i18next";
|
|
10
10
|
import { useAtom as b } from "jotai";
|
|
11
|
-
import { SparklesIcon as
|
|
11
|
+
import { SparklesIcon as qt } from "lucide-react";
|
|
12
12
|
import me from "react-dom";
|
|
13
13
|
import w from "prop-types";
|
|
14
|
-
import { Quill as
|
|
14
|
+
import { Quill as Kt } from "react-quill";
|
|
15
15
|
import { d as ie, a as Ee } from "./atoms-ZOWyNoiC.js";
|
|
16
|
-
import { flip as
|
|
17
|
-
import { useFloating as
|
|
18
|
-
import { useResizeObserver as
|
|
16
|
+
import { flip as Yt } from "@floating-ui/dom";
|
|
17
|
+
import { useFloating as Gt, shift as Xt } from "@floating-ui/react-dom";
|
|
18
|
+
import { useResizeObserver as Qt } from "@react-hookz/web";
|
|
19
19
|
import { useFeature as Zt } from "flagged";
|
|
20
20
|
import Jt from "@tailwindcss/typography";
|
|
21
|
-
import
|
|
22
|
-
import
|
|
23
|
-
import
|
|
24
|
-
import { twMerge as
|
|
21
|
+
import Vt from "@tailwindcss/forms";
|
|
22
|
+
import es from "@tailwindcss/aspect-ratio";
|
|
23
|
+
import ts from "tailwindcss-palette-generator";
|
|
24
|
+
import { twMerge as ss } from "tailwind-merge";
|
|
25
25
|
import { S as ge, a as Ne } from "./MODIFIERS-fd5XOmum.js";
|
|
26
|
-
import { getBlockComponent as
|
|
27
|
-
import { u as
|
|
26
|
+
import { getBlockComponent as os } from "@chaibuilder/runtime";
|
|
27
|
+
import { u as ns } from "./useCanvasSettings-5y2fSCpN.js";
|
|
28
28
|
import { Provider as rs } from "react-wrap-balancer";
|
|
29
29
|
import { Resizable as is } from "re-resizable";
|
|
30
30
|
import "./_commonjsHelpers-UyOWmZb0.js";
|
|
@@ -55,7 +55,7 @@ import "cmdk";
|
|
|
55
55
|
import "@radix-ui/react-context-menu";
|
|
56
56
|
import "react-icons-picker";
|
|
57
57
|
import "react-hotkeys-hook";
|
|
58
|
-
import "./index-
|
|
58
|
+
import "./index-VBXQixVm.js";
|
|
59
59
|
const as = () => {
|
|
60
60
|
const { hasUndo: n, hasRedo: s, undo: e, redo: t } = we();
|
|
61
61
|
return /* @__PURE__ */ r.jsxs("div", { className: "flex items-center", children: [
|
|
@@ -66,7 +66,7 @@ const as = () => {
|
|
|
66
66
|
function ls() {
|
|
67
67
|
const [n, s] = je();
|
|
68
68
|
return /* @__PURE__ */ r.jsxs("div", { className: "flex items-center", children: [
|
|
69
|
-
/* @__PURE__ */ r.jsx(
|
|
69
|
+
/* @__PURE__ */ r.jsx(Qe, { className: "size-4 shrink-0" }),
|
|
70
70
|
/* @__PURE__ */ r.jsx(
|
|
71
71
|
Ce,
|
|
72
72
|
{
|
|
@@ -144,14 +144,14 @@ const fe = ({ landscape: n = !1 }) => /* @__PURE__ */ r.jsxs(
|
|
|
144
144
|
title: "desktop_xl_title",
|
|
145
145
|
content: "desktop_xl_content",
|
|
146
146
|
breakpoint: "xl",
|
|
147
|
-
icon: /* @__PURE__ */ r.jsx(
|
|
147
|
+
icon: /* @__PURE__ */ r.jsx(Ze, {}),
|
|
148
148
|
width: 1420
|
|
149
149
|
},
|
|
150
150
|
{
|
|
151
151
|
title: "large_desktop_2xl_title",
|
|
152
152
|
content: "large_desktop_2xl_content",
|
|
153
153
|
breakpoint: "2xl",
|
|
154
|
-
icon: /* @__PURE__ */ r.jsx(
|
|
154
|
+
icon: /* @__PURE__ */ r.jsx(Je, {}),
|
|
155
155
|
width: 1920
|
|
156
156
|
}
|
|
157
157
|
], xe = ({
|
|
@@ -180,11 +180,11 @@ const fe = ({ landscape: n = !1 }) => /* @__PURE__ */ r.jsxs(
|
|
|
180
180
|
] }) }) })
|
|
181
181
|
] });
|
|
182
182
|
}, ds = () => {
|
|
183
|
-
const [, n, s] = oe(), [e, t] = dt(), { t: o } = re(), c =
|
|
183
|
+
const [, n, s] = oe(), [e, t] = dt(), { t: o } = re(), c = P("breakpoints", cs), a = (i) => {
|
|
184
184
|
e.includes(i) ? e.length > 2 && t(e.filter((d) => d !== i)) : t((d) => [...d, i]);
|
|
185
185
|
};
|
|
186
|
-
return c.length < 4 ? /* @__PURE__ */ r.jsx("div", { className: "flex items-center rounded-md", children:
|
|
187
|
-
|
|
186
|
+
return c.length < 4 ? /* @__PURE__ */ r.jsx("div", { className: "flex items-center rounded-md", children: H(c, (i) => /* @__PURE__ */ ce(xe, { ...i, onClick: s, key: i.breakpoint, currentBreakpoint: n })) }) : /* @__PURE__ */ r.jsxs("div", { className: "flex items-center rounded-md", children: [
|
|
187
|
+
H(
|
|
188
188
|
c.filter((i) => pe(e, X(i.breakpoint))),
|
|
189
189
|
(i) => /* @__PURE__ */ ce(xe, { ...i, onClick: s, key: i.breakpoint, currentBreakpoint: n })
|
|
190
190
|
),
|
|
@@ -193,7 +193,7 @@ const fe = ({ landscape: n = !1 }) => /* @__PURE__ */ r.jsxs(
|
|
|
193
193
|
/* @__PURE__ */ r.jsxs(ht, { className: "w-56 border-border text-xs", children: [
|
|
194
194
|
/* @__PURE__ */ r.jsx(mt, { children: o("Breakpoints") }),
|
|
195
195
|
/* @__PURE__ */ r.jsx(gt, {}),
|
|
196
|
-
|
|
196
|
+
H(c, (i) => /* @__PURE__ */ r.jsx(
|
|
197
197
|
ft,
|
|
198
198
|
{
|
|
199
199
|
disabled: i.breakpoint === "xs",
|
|
@@ -229,9 +229,9 @@ const fe = ({ landscape: n = !1 }) => /* @__PURE__ */ r.jsxs(
|
|
|
229
229
|
] }) });
|
|
230
230
|
}, us = () => {
|
|
231
231
|
const [n, s] = b(_t);
|
|
232
|
-
return
|
|
232
|
+
return P("askAiCallBack", null) ? /* @__PURE__ */ r.jsxs("div", { className: "flex items-center space-x-2", children: [
|
|
233
233
|
/* @__PURE__ */ r.jsxs(Bt, { htmlFor: "ai-assistant", className: "flex items-center gap-x-1 text-sm text-yellow-600", children: [
|
|
234
|
-
/* @__PURE__ */ r.jsx(
|
|
234
|
+
/* @__PURE__ */ r.jsx(qt, { className: "w-4" }),
|
|
235
235
|
"AI Assistant"
|
|
236
236
|
] }),
|
|
237
237
|
/* @__PURE__ */ r.jsx(
|
|
@@ -247,7 +247,7 @@ const fe = ({ landscape: n = !1 }) => /* @__PURE__ */ r.jsxs(
|
|
|
247
247
|
)
|
|
248
248
|
] }) : null;
|
|
249
249
|
}, hs = () => {
|
|
250
|
-
const n =
|
|
250
|
+
const n = P("darkMode", !0), [s] = Be();
|
|
251
251
|
return /* @__PURE__ */ r.jsxs("div", { className: "flex h-10 items-center justify-between border-b bg-background/70 px-2", children: [
|
|
252
252
|
/* @__PURE__ */ r.jsxs("div", { className: "flex h-full space-x-2", children: [
|
|
253
253
|
/* @__PURE__ */ r.jsx(ds, {}),
|
|
@@ -456,7 +456,7 @@ function ae(n) {
|
|
|
456
456
|
return "vertical";
|
|
457
457
|
return "horizontal";
|
|
458
458
|
}
|
|
459
|
-
let v = null, _ = [], R = null,
|
|
459
|
+
let v = null, _ = [], R = null, Q = null;
|
|
460
460
|
const ve = (n, s, e) => {
|
|
461
461
|
if (!v || !n)
|
|
462
462
|
return;
|
|
@@ -492,7 +492,7 @@ const $s = (n) => {
|
|
|
492
492
|
const s = n.target, e = ae(s), t = (o = v == null ? void 0 : v.defaultView) == null ? void 0 : o.scrollY;
|
|
493
493
|
e === "vertical" ? ve(s, e, n.clientY + t) : ve(s, e, n.clientX);
|
|
494
494
|
}, 0);
|
|
495
|
-
function
|
|
495
|
+
function Z() {
|
|
496
496
|
const n = v == null ? void 0 : v.getElementById("placeholder");
|
|
497
497
|
n.style.display = "none", bs("pointer-none"), ks();
|
|
498
498
|
}
|
|
@@ -516,16 +516,16 @@ const ws = () => {
|
|
|
516
516
|
var C;
|
|
517
517
|
R == null || R.classList.remove("drop-target");
|
|
518
518
|
const u = R, y = ae(u) === "vertical" ? p.clientY + ((C = v == null ? void 0 : v.defaultView) == null ? void 0 : C.scrollY) : p.clientX;
|
|
519
|
-
|
|
519
|
+
Q = vs(y, _);
|
|
520
520
|
const g = d, m = u.getAttribute("data-block-id");
|
|
521
521
|
if (!be(g, "_id")) {
|
|
522
|
-
t(g, m === "canvas" ? null : m,
|
|
523
|
-
|
|
522
|
+
t(g, m === "canvas" ? null : m, Q), setTimeout(() => {
|
|
523
|
+
Z();
|
|
524
524
|
}, 300), _ = [], e(!1), i(""), l(null), h(null);
|
|
525
525
|
return;
|
|
526
526
|
}
|
|
527
527
|
let k = u.getAttribute("data-block-id");
|
|
528
|
-
k === null && (k = p.target.parentElement.getAttribute("data-block-id")), a([g._id], k,
|
|
528
|
+
k === null && (k = p.target.parentElement.getAttribute("data-block-id")), a([g._id], k, Q), Z(), e(!1), i(""), _ = [], setTimeout(() => Z(), 300);
|
|
529
529
|
},
|
|
530
530
|
onDragEnter: (p) => {
|
|
531
531
|
const u = p, $ = u.target;
|
|
@@ -569,7 +569,7 @@ const Cs = () => {
|
|
|
569
569
|
a.style.display = "none", Array.from(d.attributes).forEach((u) => {
|
|
570
570
|
u.name !== "class" && d.removeAttribute(u.name);
|
|
571
571
|
}), i === "Text" && (d.style.display = "inline-block"), a.parentNode.insertBefore(d, a.nextSibling);
|
|
572
|
-
const l = new
|
|
572
|
+
const l = new Kt(d, { placeholder: "Type here..." });
|
|
573
573
|
function h() {
|
|
574
574
|
const u = l.getText(0, l.getLength());
|
|
575
575
|
s([a.getAttribute("data-block-id")], { content: u }), a.removeAttribute("style"), d.removeEventListener("blur", h, !0), js(l), o(""), e("");
|
|
@@ -686,14 +686,14 @@ const Cs = () => {
|
|
|
686
686
|
}
|
|
687
687
|
);
|
|
688
688
|
}, Es = ({ selectedBlockElement: n, block: s }) => {
|
|
689
|
-
const e = Se(), t = Ae(), [, o] = D(), [, c] = M(), [a] = b(F), { floatingStyles: i, refs: d, update: l } =
|
|
689
|
+
const e = Se(), t = Ae(), [, o] = D(), [, c] = M(), [a] = b(F), { floatingStyles: i, refs: d, update: l } = Gt({
|
|
690
690
|
placement: "top-start",
|
|
691
|
-
middleware: [
|
|
691
|
+
middleware: [Xt(), Yt()],
|
|
692
692
|
elements: {
|
|
693
693
|
reference: n
|
|
694
694
|
}
|
|
695
695
|
});
|
|
696
|
-
|
|
696
|
+
Qt(n, () => l(), n !== null);
|
|
697
697
|
const h = f(s, "_parent", null), p = I(f(s, "_name", "")) ? f(s, "_type", "") : f(s, "_name", "");
|
|
698
698
|
return !n || !s || a ? null : /* @__PURE__ */ r.jsx(r.Fragment, { children: /* @__PURE__ */ r.jsxs(
|
|
699
699
|
"div",
|
|
@@ -989,7 +989,7 @@ const Cs = () => {
|
|
|
989
989
|
}, [t, i]);
|
|
990
990
|
const $ = f(s, "headingFont", "DM Sans"), y = f(s, "bodyFont", "DM Sans");
|
|
991
991
|
return j(() => {
|
|
992
|
-
const g = f(s, "primaryColor", "#000"), m = f(s, "secondaryColor", "#FFF"), k = f(s, "bodyBgLightColor", "#fff"), C = f(s, "bodyBgDarkColor", "#000"), L = f(s, "bodyTextDarkColor", "#000"), K = f(s, "bodyTextLightColor", "#fff"), Y =
|
|
992
|
+
const g = f(s, "primaryColor", "#000"), m = f(s, "secondaryColor", "#FFF"), k = f(s, "bodyBgLightColor", "#fff"), C = f(s, "bodyBgDarkColor", "#000"), L = f(s, "bodyTextDarkColor", "#000"), K = f(s, "bodyTextLightColor", "#fff"), Y = ts([
|
|
993
993
|
{ color: g, name: "primary" },
|
|
994
994
|
{ color: m, name: "secondary" }
|
|
995
995
|
]), G = {
|
|
@@ -1019,10 +1019,10 @@ const Cs = () => {
|
|
|
1019
1019
|
colors: { ...G, ...Y }
|
|
1020
1020
|
}
|
|
1021
1021
|
},
|
|
1022
|
-
plugins: [Jt,
|
|
1022
|
+
plugins: [Jt, Vt, es, d.tailwind.plugin.withOptions(() => Ns)]
|
|
1023
1023
|
});
|
|
1024
1024
|
}, [s, d, $, y]), j(() => {
|
|
1025
|
-
h && (h.textContent = `${
|
|
1025
|
+
h && (h.textContent = `${H(e, (g) => `[data-block-id="${g}"]`).join(",")}{
|
|
1026
1026
|
outline: 1px solid ${e.length === 1 ? "#42a1fc" : "orange"} !important; outline-offset: -1px;
|
|
1027
1027
|
}`);
|
|
1028
1028
|
}, [e, h]), j(() => {
|
|
@@ -1034,7 +1034,7 @@ const Cs = () => {
|
|
|
1034
1034
|
}, [a]), j(() => {
|
|
1035
1035
|
l && (l.textContent = o ? `[data-style-id="${o}"]{ outline: 1px solid #42a1fc !important; outline-offset: -1px;}` : "");
|
|
1036
1036
|
}, [o, e, l]), j(() => {
|
|
1037
|
-
p && (p.textContent = `${
|
|
1037
|
+
p && (p.textContent = `${H(c, ({ id: g }) => `[data-style-id="${g}"]`).join(",")}{
|
|
1038
1038
|
outline: 1px solid #42a1fc !important; outline-offset: -1px;
|
|
1039
1039
|
}`);
|
|
1040
1040
|
}, [c, p]), j(() => {
|
|
@@ -1076,7 +1076,7 @@ const Cs = () => {
|
|
|
1076
1076
|
}), s;
|
|
1077
1077
|
}, Ls = Ke((n) => {
|
|
1078
1078
|
const s = n.replace(Ne, "").split(",");
|
|
1079
|
-
return
|
|
1079
|
+
return ss(s[0], s[1]);
|
|
1080
1080
|
});
|
|
1081
1081
|
function Fs(n, s) {
|
|
1082
1082
|
return f(n, `${s}_attrs`, {});
|
|
@@ -1096,14 +1096,14 @@ function Rs(n) {
|
|
|
1096
1096
|
}
|
|
1097
1097
|
}), s;
|
|
1098
1098
|
}
|
|
1099
|
-
function
|
|
1099
|
+
function Hs(n, s) {
|
|
1100
1100
|
const e = f(n, "_bindings", {});
|
|
1101
1101
|
return I(e) ? { ...n } : (Ye(e, (t, o) => {
|
|
1102
1102
|
se(t) && f(s, t, null) && (n[o] = f(s, t, null));
|
|
1103
1103
|
}), n);
|
|
1104
1104
|
}
|
|
1105
1105
|
function te({ blocks: n }) {
|
|
1106
|
-
const [s] = ne(), [e] = b(ie), [t] = b(Ee), [o] =
|
|
1106
|
+
const [s] = ne(), [e] = b(ie), [t] = b(Ee), [o] = ns(), c = O((l) => Rs(l), []), [a] = Ft(), [i] = b(F), d = O(
|
|
1107
1107
|
(l) => l.reduce((h, p) => {
|
|
1108
1108
|
const u = f(o, p, {});
|
|
1109
1109
|
return { ...h, ...u };
|
|
@@ -1122,11 +1122,11 @@ function te({ blocks: n }) {
|
|
|
1122
1122
|
});
|
|
1123
1123
|
const $ = ke(s, { _parent: l._id });
|
|
1124
1124
|
u.children = $.length ? /* @__PURE__ */ r.jsx(te, { blocks: $ }) : null;
|
|
1125
|
-
const y =
|
|
1125
|
+
const y = os(l._type), g = f(y, "builderComponent", f(y, "component", null));
|
|
1126
1126
|
if (Xe(g))
|
|
1127
1127
|
return /* @__PURE__ */ r.jsx("noscript", { children: `<!-- ${l == null ? void 0 : l._type} not registered -->` });
|
|
1128
1128
|
const m = be(y, "getBlockStateFrom") ? y == null ? void 0 : y.getBlockStateFrom(l, s) : [], k = d(m);
|
|
1129
|
-
return /* @__PURE__ */ r.jsx(
|
|
1129
|
+
return /* @__PURE__ */ r.jsx(J, { children: A.createElement(g, {
|
|
1130
1130
|
blockProps: {
|
|
1131
1131
|
"data-block-id": l._id,
|
|
1132
1132
|
"data-block-type": l._type,
|
|
@@ -1137,7 +1137,7 @@ function te({ blocks: n }) {
|
|
|
1137
1137
|
...t === l._id ? { "data-drop": "yes" } : {}
|
|
1138
1138
|
},
|
|
1139
1139
|
index: h,
|
|
1140
|
-
...
|
|
1140
|
+
...Hs(l, a),
|
|
1141
1141
|
...c(l),
|
|
1142
1142
|
...u,
|
|
1143
1143
|
inBuilder: !0,
|
|
@@ -1146,11 +1146,11 @@ function te({ blocks: n }) {
|
|
|
1146
1146
|
})
|
|
1147
1147
|
) });
|
|
1148
1148
|
}
|
|
1149
|
-
const
|
|
1150
|
-
const [n] = ne(), s = I(n) ? null : /* @__PURE__ */ r.jsx(
|
|
1149
|
+
const Ps = () => {
|
|
1150
|
+
const [n] = ne(), s = I(n) ? null : /* @__PURE__ */ r.jsx(Ht, { children: /* @__PURE__ */ r.jsx(te, { blocks: ke(n, (e) => I(e._parent)) }) });
|
|
1151
1151
|
return /* @__PURE__ */ r.jsx(r.Fragment, { children: s });
|
|
1152
1152
|
}, zs = (n, s) => n.querySelector(`[data-style-id="${s}"]`), Os = () => {
|
|
1153
|
-
const [n] = b(
|
|
1153
|
+
const [n] = b(Pt), [s] = Ie(), [e] = oe(), [, t] = D(), o = zt(), [, c] = T(), a = de(null), i = de(null), [d, l] = B({ width: 0, height: 0 }), h = gs(d), [p, u] = B(0), [$, y] = B([]), [, g] = B([]), [, m] = b(Ot), [k, C] = M(), L = P("loading", !1), K = P("htmlDir", "ltr");
|
|
1154
1154
|
j(() => {
|
|
1155
1155
|
const { clientWidth: x, clientHeight: S } = i.current;
|
|
1156
1156
|
l({ width: x, height: S }), p === 0 && u(x);
|
|
@@ -1211,7 +1211,7 @@ const Hs = () => {
|
|
|
1211
1211
|
}
|
|
1212
1212
|
),
|
|
1213
1213
|
/* @__PURE__ */ r.jsx(Ms, { model: "page" }),
|
|
1214
|
-
/* @__PURE__ */ r.jsx(rs, { children: /* @__PURE__ */ r.jsx(As, { children: L ? /* @__PURE__ */ r.jsx("div", { className: "h-full p-4", children: /* @__PURE__ */ r.jsx(V, { className: "h-full" }) }) : /* @__PURE__ */ r.jsx(
|
|
1214
|
+
/* @__PURE__ */ r.jsx(rs, { children: /* @__PURE__ */ r.jsx(As, { children: L ? /* @__PURE__ */ r.jsx("div", { className: "h-full p-4", children: /* @__PURE__ */ r.jsx(V, { className: "h-full" }) }) : /* @__PURE__ */ r.jsx(Ps, {}) }) }),
|
|
1215
1215
|
/* @__PURE__ */ r.jsx("br", {}),
|
|
1216
1216
|
/* @__PURE__ */ r.jsx(
|
|
1217
1217
|
"div",
|
|
@@ -1225,13 +1225,13 @@ const Hs = () => {
|
|
|
1225
1225
|
)
|
|
1226
1226
|
}
|
|
1227
1227
|
);
|
|
1228
|
-
}, Us = A.lazy(() => import("./CodeEditor-
|
|
1229
|
-
const [n] =
|
|
1228
|
+
}, Us = A.lazy(() => import("./CodeEditor-tqtgia3I.js")), Go = () => {
|
|
1229
|
+
const [n] = Ut();
|
|
1230
1230
|
return /* @__PURE__ */ r.jsxs("div", { className: "flex h-full w-full flex-col", children: [
|
|
1231
1231
|
/* @__PURE__ */ r.jsx(hs, {}),
|
|
1232
1232
|
/* @__PURE__ */ r.jsxs("div", { className: "relative flex h-full flex-col overflow-hidden bg-slate-800/90 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] px-2", children: [
|
|
1233
|
-
/* @__PURE__ */ r.jsx(
|
|
1234
|
-
n ? /* @__PURE__ */ r.jsx(
|
|
1233
|
+
/* @__PURE__ */ r.jsx(J, { fallback: /* @__PURE__ */ r.jsx(V, { className: "h-full" }), children: /* @__PURE__ */ r.jsx(Wt, { children: /* @__PURE__ */ r.jsx(Os, {}) }) }),
|
|
1234
|
+
n ? /* @__PURE__ */ r.jsx(J, { fallback: /* @__PURE__ */ r.jsx(V, { className: "h-full" }), children: /* @__PURE__ */ r.jsx(is, { enable: { top: !0, bottom: !1 }, className: "max-h-[400px] min-h-[200px]", children: /* @__PURE__ */ r.jsx(Us, {}) }) }) : null
|
|
1235
1235
|
] })
|
|
1236
1236
|
] });
|
|
1237
1237
|
};
|