@chaibuilder/sdk 1.2.40 → 1.2.42
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-Q--k4QYI.js → AddBlocks--7JKHvJX.js} +17 -17
- package/dist/{AddBlocks-a20tIXfX.cjs → AddBlocks-HZaa1NM6.cjs} +1 -1
- package/dist/{CanvasArea-QQn0aXpj.cjs → CanvasArea-CTmYdaUo.cjs} +1 -1
- package/dist/{CanvasArea-ahsds4rc.js → CanvasArea-myZvxQCj.js} +2 -2
- package/dist/{ChaiBuilderEditor-hcoLrtq8.cjs → ChaiBuilderEditor-GronwWg6.cjs} +37 -37
- package/dist/{ChaiBuilderEditor-wfEkvtJ0.js → ChaiBuilderEditor-f4SJU7kK.js} +3839 -3827
- package/dist/{CurrentPage-f_5eIFbX.js → CurrentPage-S5EFVi8y.js} +2 -2
- package/dist/{CurrentPage-zo2GKFUx.cjs → CurrentPage-hq3wJX-B.cjs} +1 -1
- package/dist/{ListTree-FWHoDfbO.cjs → ListTree-PbmMwEnK.cjs} +1 -1
- package/dist/{ListTree-3riQsfip.js → ListTree-un8hNvIi.js} +1 -1
- package/dist/{PagesPanel-0Wi0ezNZ.cjs → PagesPanel-2zdTxUbm.cjs} +1 -1
- package/dist/{PagesPanel-3KIZEXOS.js → PagesPanel-f0XKYnEj.js} +3 -3
- package/dist/{ProjectPanel-fEYrObPB.cjs → ProjectPanel-RMEd0gwn.cjs} +1 -1
- package/dist/{ProjectPanel-0W6XTu0Y.js → ProjectPanel-vbBl5OmU.js} +3 -3
- package/dist/{Settings-ifUbqcam.js → Settings-Lsp-FmFS.js} +110 -110
- package/dist/Settings-UqeNroki.cjs +1 -0
- package/dist/{SidePanels-JIuL8NLu.cjs → SidePanels-DimF3tJV.cjs} +1 -1
- package/dist/{SidePanels-0P4IaIVn.js → SidePanels-zU4GsqbI.js} +2 -2
- package/dist/{ThemeConfiguration-7Hef-UKR.js → ThemeConfiguration-1rD36g89.js} +4 -4
- package/dist/{ThemeConfiguration-CcUA1_9A.cjs → ThemeConfiguration-76oEQ5z0.cjs} +1 -1
- package/dist/{Topbar-0hOp8tE7.js → Topbar--M5IjXGt.js} +1 -1
- package/dist/{Topbar-Wte9Jbw7.cjs → Topbar-7bRZS3P8.cjs} +1 -1
- package/dist/{UILibrariesPanel-vXOD3qRz.cjs → UILibrariesPanel-1F_Kcnkm.cjs} +1 -1
- package/dist/{UILibrariesPanel-qgwFZYvn.js → UILibrariesPanel-EaMt1AzV.js} +1 -1
- package/dist/{UnsplashImages-Cfq1lKeC.cjs → UnsplashImages-eq44FmxF.cjs} +1 -1
- package/dist/{UnsplashImages-qUDa1vAS.js → UnsplashImages-o7mUozj7.js} +1 -1
- package/dist/{UploadImages-Zle03BGi.cjs → UploadImages-o4teNCqv.cjs} +1 -1
- package/dist/{UploadImages-Xh-lPuZy.js → UploadImages-s52Hvpts.js} +6 -6
- package/dist/{add-page-modal-0jmyeD0x.cjs → add-page-modal-7FLXbRFp.cjs} +1 -1
- package/dist/{add-page-modal-ued8fkUY.js → add-page-modal-eoOwcRKz.js} +3 -3
- package/dist/{confirm-alert-4kucBgrO.js → confirm-alert-o0OjZdvp.js} +1 -1
- package/dist/{confirm-alert-rucvO9GC.cjs → confirm-alert-rFmTdGxh.cjs} +1 -1
- package/dist/core.cjs +1 -1
- package/dist/core.js +1 -1
- package/dist/{delete-page-modal-kxeOpfNd.js → delete-page-modal-OU79XN8M.js} +2 -2
- package/dist/{delete-page-modal-Eym3aZzC.cjs → delete-page-modal-sG2uFkT0.cjs} +1 -1
- package/dist/email.cjs +1 -1
- package/dist/email.js +1 -1
- package/dist/{form-2Veryr30.js → form--h34bK4z.js} +1 -1
- package/dist/{form-pdF1XhvW.cjs → form-SuV0Z9nJ.cjs} +1 -1
- package/dist/{index-SQ1sNajH.cjs → index-3mF2lq-B.cjs} +1 -1
- package/dist/{index-OdzdznTv.js → index-7hLL3kv4.js} +2 -2
- package/dist/{page-viewer-qr3NscoT.cjs → page-viewer-9-Dy66-a.cjs} +1 -1
- package/dist/{page-viewer-6qv40Sm2.js → page-viewer-tfXRwkWz.js} +3 -3
- package/dist/{project-general-setting-fm1YfS_2.cjs → project-general-setting-ZbNwglNP.cjs} +1 -1
- package/dist/{project-general-setting-GVzAsfrk.js → project-general-setting-ZjAN2VZX.js} +3 -3
- package/dist/{project-seo-setting-iPqsGKuc.js → project-seo-setting-gAXZ15Wb.js} +2 -2
- package/dist/{project-seo-setting-06jt9oDD.cjs → project-seo-setting-vqWoo5Ev.cjs} +1 -1
- package/dist/{single-page-detail-GVtRl8Pt.js → single-page-detail-ISRJ-Ebt.js} +4 -4
- package/dist/{single-page-detail-KQVwWJ-J.cjs → single-page-detail-a4nAhK0N.cjs} +1 -1
- package/dist/studio.cjs +1 -1
- package/dist/studio.js +2 -2
- package/dist/ui.cjs +1 -1
- package/dist/ui.js +1 -1
- package/dist/{useCanvasSettings-yYU51FJ3.cjs → useCanvasSettings-EyxD8eas.cjs} +1 -1
- package/dist/{useCanvasSettings-E5uIyvUR.js → useCanvasSettings-fsSISbZ6.js} +1 -1
- package/dist/web-blocks.cjs +2 -2
- package/dist/web-blocks.js +44 -46
- package/package.json +4 -4
- package/dist/Settings-kDwumlBm.cjs +0 -1
|
@@ -3,7 +3,7 @@ import j, { createElement as L, useState as f, useEffect as S } from "react";
|
|
|
3
3
|
import { has as E, isFunction as F, first as h, omit as H, filter as x, groupBy as I, uniq as z, map as k, includes as D, isEmpty as N, reject as C, values as y } from "lodash-es";
|
|
4
4
|
import { useAtom as g } from "jotai";
|
|
5
5
|
import { useTranslation as T } from "react-i18next";
|
|
6
|
-
import { m as _, L as A, z as M, ag as w, ac as q, ad as O, ae as R,
|
|
6
|
+
import { m as _, L as A, z as M, ag as w, ac as q, ad as O, ae as R, bh as G, bi as J, bj as K, bk as U, aq as V, bl as W, bm as Y, B as Q, bn as X, bo as Z, bp as $, h as B, ai as ee, aj as se, ak as v, bb as te, b4 as oe, b5 as re, b6 as le, b7 as ae } from "./ChaiBuilderEditor-f4SJU7kK.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";
|
|
@@ -45,14 +45,14 @@ import "react-hotkeys-hook";
|
|
|
45
45
|
import "lucide-react";
|
|
46
46
|
import "himalaya";
|
|
47
47
|
const pe = ({ block: s }) => {
|
|
48
|
-
const { type: o, icon: i, label:
|
|
48
|
+
const { type: o, icon: i, label: l } = s, { addCoreBlock: n, addPredefinedBlock: d } = _(), [c, t] = A(), [, u] = M(), [, p] = g(w), m = () => {
|
|
49
49
|
if (E(s, "blocks")) {
|
|
50
50
|
const r = F(s.blocks) ? s.blocks() : s.blocks;
|
|
51
51
|
d(ce(r), h(c));
|
|
52
52
|
} else
|
|
53
53
|
n(s, h(c));
|
|
54
54
|
p(b);
|
|
55
|
-
},
|
|
55
|
+
}, a = de("dnd");
|
|
56
56
|
return /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsxs(q, { children: [
|
|
57
57
|
/* @__PURE__ */ e.jsx(O, { asChild: !0, children: /* @__PURE__ */ e.jsxs(
|
|
58
58
|
"button",
|
|
@@ -64,20 +64,20 @@ const pe = ({ block: s }) => {
|
|
|
64
64
|
t([]), u(null), p(b);
|
|
65
65
|
}, 200);
|
|
66
66
|
},
|
|
67
|
-
draggable:
|
|
68
|
-
className: "space-y-2 rounded-lg border border-border p-3 text-center hover:bg-slate-300/50 " + (
|
|
67
|
+
draggable: a ? "true" : "false",
|
|
68
|
+
className: "space-y-2 rounded-lg border border-border p-3 text-center hover:bg-slate-300/50 " + (a ? "cursor-grab" : "cursor-pointer"),
|
|
69
69
|
children: [
|
|
70
70
|
L(i || ie, { className: "w-4 h-4 mx-auto" }),
|
|
71
|
-
/* @__PURE__ */ e.jsx("p", { className: "text-xs", children:
|
|
71
|
+
/* @__PURE__ */ e.jsx("p", { className: "text-xs", children: l || o })
|
|
72
72
|
]
|
|
73
73
|
}
|
|
74
74
|
) }),
|
|
75
|
-
/* @__PURE__ */ e.jsx(R, { children: /* @__PURE__ */ e.jsx("p", { children:
|
|
75
|
+
/* @__PURE__ */ e.jsx(R, { children: /* @__PURE__ */ e.jsx("p", { children: l || o }) })
|
|
76
76
|
] }) });
|
|
77
77
|
}, he = () => {
|
|
78
|
-
const { t: s } = T(), [o, i] = f(""), { addPredefinedBlock:
|
|
78
|
+
const { t: s } = T(), [o, i] = f(""), { addPredefinedBlock: l } = _(), [n] = A(), [, d] = g(w), c = () => {
|
|
79
79
|
const t = me(o);
|
|
80
|
-
|
|
80
|
+
l([...t], h(n) || null), i(""), d(b);
|
|
81
81
|
};
|
|
82
82
|
return /* @__PURE__ */ e.jsxs(G, { className: "border-border/0 p-0 shadow-none", children: [
|
|
83
83
|
/* @__PURE__ */ e.jsx(J, { className: "p-3", children: /* @__PURE__ */ e.jsx(K, { children: s("html_snippet_description") }) }),
|
|
@@ -102,11 +102,11 @@ const pe = ({ block: s }) => {
|
|
|
102
102
|
/* @__PURE__ */ e.jsx(X, { variant: "default", className: "mt-2 border-none p-1 text-gray-400", children: /* @__PURE__ */ e.jsx(Z, { className: "text-xs font-normal leading-4", children: s("note_imported_html") }) })
|
|
103
103
|
] })
|
|
104
104
|
] });
|
|
105
|
-
},
|
|
106
|
-
const { t: s } = T(), [o, i] = f("core"), [
|
|
105
|
+
}, as = () => {
|
|
106
|
+
const { t: s } = T(), [o, i] = f("core"), [l, n] = f("basic"), d = ne(), [, c] = g($), t = B("importHTMLSupport", !0), u = B("filterChaiBlock", () => !0), p = x(d, u), m = I(p, "category"), a = z(k(m.core, "group"));
|
|
107
107
|
return S(() => {
|
|
108
|
-
!D(
|
|
109
|
-
}, [
|
|
108
|
+
!D(a, l) && !N(a) && !N(l) && n(h(a));
|
|
109
|
+
}, [a, l]), /* @__PURE__ */ e.jsxs("div", { className: "flex h-full w-72 flex-col overflow-hidden", children: [
|
|
110
110
|
/* @__PURE__ */ e.jsxs("div", { className: "mb-2 flex flex-col justify-between rounded-md bg-background/30 p-1", children: [
|
|
111
111
|
/* @__PURE__ */ e.jsx("h1", { className: "flex flex-col items-baseline px-1 text-xl font-semibold xl:flex-col", children: s("add_block") }),
|
|
112
112
|
/* @__PURE__ */ e.jsx("span", { className: "p-0 text-xs font-light leading-3 opacity-80 xl:pl-1", children: s(o === "html" ? "enter_paste_tailwind_html" : "click_to_add_block") })
|
|
@@ -127,10 +127,10 @@ const pe = ({ block: s }) => {
|
|
|
127
127
|
),
|
|
128
128
|
o === "core" && /* @__PURE__ */ e.jsx(te, { className: "-mx-1.5 h-full", children: /* @__PURE__ */ e.jsx("div", { className: "mt-2 w-full", children: j.Children.toArray(
|
|
129
129
|
k(
|
|
130
|
-
|
|
130
|
+
a,
|
|
131
131
|
(r) => C(x(y(m.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: [
|
|
132
|
-
/* @__PURE__ */ e.jsx(
|
|
133
|
-
/* @__PURE__ */ e.jsx(
|
|
132
|
+
/* @__PURE__ */ e.jsx(le, { className: "rounded-md bg-gray-100 px-4 py-2 capitalize", children: r }),
|
|
133
|
+
/* @__PURE__ */ e.jsx(ae, { className: "p-3", children: /* @__PURE__ */ e.jsx("div", { className: "grid grid-cols-3 gap-2", children: j.Children.toArray(
|
|
134
134
|
C(x(y(m.core), { group: r }), { hidden: !0 }).map((P) => /* @__PURE__ */ e.jsx(pe, { block: P }))
|
|
135
135
|
) }) })
|
|
136
136
|
] }) }) : null
|
|
@@ -140,5 +140,5 @@ const pe = ({ block: s }) => {
|
|
|
140
140
|
] });
|
|
141
141
|
};
|
|
142
142
|
export {
|
|
143
|
-
|
|
143
|
+
as as default
|
|
144
144
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-Z_BpKhVy.cjs"),a=require("react"),t=require("lodash-es"),g=require("jotai"),q=require("react-i18next"),s=require("./ChaiBuilderEditor-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-Z_BpKhVy.cjs"),a=require("react"),t=require("lodash-es"),g=require("jotai"),q=require("react-i18next"),s=require("./ChaiBuilderEditor-GronwWg6.cjs"),b=require("@radix-ui/react-icons"),E=require("@chaibuilder/runtime"),N=require("flagged"),f=require("./STRINGS-gPz7CUOk.cjs"),T=require("./html-to-json-VPWiWWGH.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("./MODIFIERS-YPHRtwrM.cjs");require("@radix-ui/react-toggle");require("class-variance-authority");require("./Class-Zc8hpE7f.cjs");require("@radix-ui/react-switch");require("@radix-ui/react-slot");require("@radix-ui/react-accordion");require("@radix-ui/react-alert-dialog");require("@radix-ui/react-dialog");require("@radix-ui/react-label");require("@radix-ui/react-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("himalaya");const k=({block:r})=>{const{type:o,icon:u,label:l}=r,{addCoreBlock:d,addPredefinedBlock:m}=s.useAddBlock(),[x,i]=s.useSelectedBlockIds(),[,h]=s.useHighlightBlockId(),[,j]=g.useAtom(s.activePanelAtom),p=()=>{if(t.has(r,"blocks")){const n=t.isFunction(r.blocks)?r.blocks():r.blocks;m(E.syncBlocksWithDefaults(n),t.first(x))}else d(r,t.first(x));j(f.OUTLINE_KEY)},c=N.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:p,type:"button",onDragStart:n=>{n.dataTransfer.setData("text/plain",JSON.stringify(t.omit(r,["component","icon"]))),setTimeout(()=>{i([]),h(null),j(f.OUTLINE_KEY)},200)},draggable:c?"true":"false",className:"space-y-2 rounded-lg border border-border p-3 text-center hover:bg-slate-300/50 "+(c?"cursor-grab":"cursor-pointer"),children:[a.createElement(u||b.BoxIcon,{className:"w-4 h-4 mx-auto"}),e.jsxRuntimeExports.jsx("p",{className:"text-xs",children:l||o})]})}),e.jsxRuntimeExports.jsx(s.TooltipContent,{children:e.jsxRuntimeExports.jsx("p",{children:l||o})})]})})},y=()=>{const{t:r}=q.useTranslation(),[o,u]=a.useState(""),{addPredefinedBlock:l}=s.useAddBlock(),[d]=s.useSelectedBlockIds(),[,m]=g.useAtom(s.activePanelAtom),x=()=>{const i=T.getBlocksFromHTML(o);l([...i],t.first(d)||null),u(""),m(f.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:i=>i&&i.focus(),onChange:i=>u(i.target.value),rows:12,value:o,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:o.trim()==="",onClick:()=>x(),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")})})]})]})},B=()=>{const{t:r}=q.useTranslation(),[o,u]=a.useState("core"),[l,d]=a.useState("basic"),m=E.useChaiBlocks(),[,x]=g.useAtom(s.showPredefinedBlockCategoryAtom),i=s.useBuilderProp("importHTMLSupport",!0),h=s.useBuilderProp("filterChaiBlock",()=>!0),j=t.filter(m,h),p=t.groupBy(j,"category"),c=t.uniq(t.map(p.core,"group"));return a.useEffect(()=>{!t.includes(c,l)&&!t.isEmpty(c)&&!t.isEmpty(l)&&d(t.first(c))},[c,l]),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(o==="html"?"enter_paste_tailwind_html":"click_to_add_block")})]}),e.jsxRuntimeExports.jsx(s.Tabs,{onValueChange:n=>{x(""),u(n)},value:o,className:"h-max",children:e.jsxRuntimeExports.jsxs(s.TabsList,{className:"grid w-full "+(i?"grid-cols-2":"grid-cols-1"),children:[e.jsxRuntimeExports.jsx(s.TabsTrigger,{value:"core",children:r("Blocks")}),i?e.jsxRuntimeExports.jsx(s.TabsTrigger,{value:"html",children:r("import")}):null]})}),o==="core"&&e.jsxRuntimeExports.jsx(s.ScrollArea,{className:"-mx-1.5 h-full",children:e.jsxRuntimeExports.jsx("div",{className:"mt-2 w-full",children:a.Children.toArray(t.map(c,n=>t.reject(t.filter(t.values(p.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:a.Children.toArray(t.reject(t.filter(t.values(p.core),{group:n}),{hidden:!0}).map(R=>e.jsxRuntimeExports.jsx(k,{block:R})))})})]})}):null))})}),o==="html"&&i?e.jsxRuntimeExports.jsx(y,{}):null]})};exports.default=B;
|
|
@@ -1,4 +1,4 @@
|
|
|
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 C=(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"),h=require("react"),a=require("lodash-es"),E=require("@radix-ui/react-icons"),i=require("./ChaiBuilderEditor-
|
|
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 C=(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"),h=require("react"),a=require("lodash-es"),E=require("@radix-ui/react-icons"),i=require("./ChaiBuilderEditor-GronwWg6.cjs"),M=require("react-i18next"),b=require("jotai"),re=require("lucide-react"),F=require("react-dom"),k=require("prop-types"),ie=require("react-quill"),W=require("flagged"),le=require("@floating-ui/dom"),H=require("@floating-ui/react-dom"),ce=require("@react-hookz/web"),ae=require("@tailwindcss/typography"),de=require("@tailwindcss/forms"),ue=require("@tailwindcss/aspect-ratio"),pe=require("tailwindcss-palette-generator"),he=require("react-wrap-balancer"),xe=require("tailwind-merge"),_=require("./STRINGS-gPz7CUOk.cjs"),me=require("@chaibuilder/runtime"),ge=require("./useCanvasSettings-EyxD8eas.cjs");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("clsx");require("@radix-ui/react-scroll-area");require("i18next");require("./Functions-N3yhPYKY.cjs");require("./MODIFIERS-YPHRtwrM.cjs");require("@radix-ui/react-toggle");require("class-variance-authority");require("./Class-Zc8hpE7f.cjs");require("@radix-ui/react-switch");require("@radix-ui/react-slot");require("@radix-ui/react-accordion");require("@radix-ui/react-alert-dialog");require("@radix-ui/react-dialog");require("@radix-ui/react-label");require("@radix-ui/react-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");const fe=()=>{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(E.ResetIcon,{})}),r.jsxRuntimeExports.jsx(i.Button,{disabled:!s(),onClick:t,size:"sm",className:"rounded-full",variant:"ghost",children:r.jsxRuntimeExports.jsx(E.ResetIcon,{className:"rotate-180 scale-y-[-1] transform"})})]})};function ve(){const[o,s]=i.useDarkMode(),{t:e}=M.useTranslation();return r.jsxRuntimeExports.jsxs("div",{className:"flex items-center",children:[r.jsxRuntimeExports.jsx(i.Label,{htmlFor:"dark-mode-switch",children:e("dark_mode")}),r.jsxRuntimeExports.jsxs(i.Switch,{id:"dark-mode-switch",checked:o,onCheckedChange:()=>{s(!o)},className:`${o?"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:[r.jsxRuntimeExports.jsx("span",{className:"sr-only",children:e("use_setting")}),r.jsxRuntimeExports.jsx("span",{"aria-hidden":"true",className:`${o?"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 O=({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"}})]}),je=[{title:"mobile_xs_title",content:"mobile_xs_content",breakpoint:"xs",icon:r.jsxRuntimeExports.jsx(E.MobileIcon,{}),width:400},{title:"mobile_sm_title",content:"mobile_sm_content",breakpoint:"sm",icon:r.jsxRuntimeExports.jsx(E.MobileIcon,{className:"rotate-90"}),width:640},{title:"tablet_md_title",content:"tablet_md_content",breakpoint:"md",icon:r.jsxRuntimeExports.jsx(O,{}),width:800},{title:"tablet_lg_title",content:"tablet_lg_content",breakpoint:"lg",icon:r.jsxRuntimeExports.jsx(O,{landscape:!0}),width:1024},{title:"desktop_xl_title",content:"desktop_xl_content",breakpoint:"xl",icon:r.jsxRuntimeExports.jsx(E.LaptopIcon,{}),width:1420},{title:"large_desktop_2xl_title",content:"large_desktop_2xl_content",breakpoint:"2xl",icon:r.jsxRuntimeExports.jsx(E.DesktopIcon,{}),width:1920}],U=({title:o,content:s,currentBreakpoint:e,breakpoint:t,width:n,icon:p,onClick:c})=>{const{t:l}=M.useTranslation();return r.jsxRuntimeExports.jsxs(i.HoverCard,{children:[r.jsxRuntimeExports.jsx(i.HoverCardTrigger,{asChild:!0,children:r.jsxRuntimeExports.jsx(i.Button,{onClick:()=>c(n),size:"sm",variant:t===e?"secondary":"ghost",children:p})}),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)})]})})})]})},$e=()=>{const[,o,s]=i.useCanvasWidth(),[e,t]=i.useSelectedBreakpoints(),{t:n}=M.useTranslation(),p=i.useBuilderProp("breakpoints",je),c=l=>{e.includes(l)?e.length>2&&t(e.filter(d=>d!==l)):t(d=>[...d,l])};return p.length<4?r.jsxRuntimeExports.jsx("div",{className:"flex items-center rounded-md",children:a.map(p,l=>h.createElement(U,{...l,onClick:s,key:l.breakpoint,currentBreakpoint:o}))}):r.jsxRuntimeExports.jsxs("div",{className:"flex items-center rounded-md",children:[a.map(p.filter(l=>a.includes(e,a.toUpper(l.breakpoint))),l=>h.createElement(U,{...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(E.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,{}),a.map(p,l=>r.jsxRuntimeExports.jsx(i.DropdownMenuCheckboxItem,{disabled:l.breakpoint==="xs",onCheckedChange:()=>c(a.toUpper(l.breakpoint)),checked:a.includes(e,a.toUpper(l.breakpoint)),children:n(l.title)},l.breakpoint))]})]})]})},ye=()=>{const{t:o}=M.useTranslation(),{setNewBlocks:s}=i.useBlocksStoreUndoableActions(),[,e]=i.useSelectedBlockIds(),[,t]=i.useSelectedStylingBlocks(),n=h.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(E.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")})]})]})]})})},be=()=>{const[o,s]=b.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},ke=()=>{const o=i.useBuilderProp("darkMode",!1),[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:[o?r.jsxRuntimeExports.jsxs(r.jsxRuntimeExports.Fragment,{children:[r.jsxRuntimeExports.jsx(ve,{}),r.jsxRuntimeExports.jsx(i.Separator,{orientation:"vertical"})]}):null,r.jsxRuntimeExports.jsx($e,{}),r.jsxRuntimeExports.jsx(i.Separator,{orientation:"vertical"}),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(E.ZoomInIcon,{className:"h-3.5 w-3.5 flex-shrink-0"})," ",r.jsxRuntimeExports.jsxs("div",{className:"text-xs leading-3",children:[a.round(s,0),"%"]})]}),r.jsxRuntimeExports.jsx(i.Separator,{orientation:"vertical"}),r.jsxRuntimeExports.jsx(fe,{})]}),r.jsxRuntimeExports.jsxs("div",{className:"flex h-full items-center space-x-2",children:[r.jsxRuntimeExports.jsx(ye,{}),r.jsxRuntimeExports.jsx(i.Separator,{orientation:"vertical"}),r.jsxRuntimeExports.jsx(be,{})]})]})},Ee=`<!doctype html>
|
|
4
4
|
<html lang="en" dir="__HTML_DIR__" class="scroll-smooth h-full overflow-y-auto">
|
|
@@ -5,7 +5,7 @@ import { j as r } from "./jsx-runtime-WbnYoNE9.js";
|
|
|
5
5
|
import A, { createElement as se, useCallback as H, useState as j, useEffect as k, Component as ue, Children as Oe, Suspense as he, useRef as ne, useMemo as ze } from "react";
|
|
6
6
|
import { map as P, includes as oe, toUpper as Y, round as Ue, noop as T, has as Q, throttle as me, isEmpty as D, first as U, omit as We, pick as qe, get as f, isString as G, memoize as Ke, each as Ye, find as Je, filter as ge, isNull as Qe } from "lodash-es";
|
|
7
7
|
import { ResetIcon as re, MobileIcon as ie, LaptopIcon as Ze, DesktopIcon as Xe, DotsVerticalIcon as Ge, EraserIcon as Ve, ZoomInIcon as et, DragHandleDots2Icon as tt, ArrowUpIcon as st, CopyIcon as nt, TrashIcon as ot } from "@radix-ui/react-icons";
|
|
8
|
-
import { j as fe, B as W, v as xe, aq as ve, ar as $e, as as rt, at as it, au as at, o as V, X as lt, h as L, av as ct, aw as dt, ax as pt, ay as ut, az as ht, aA as mt, aB as gt, L as C, Y as N, A as ft, a as xt, b as vt, c as $t, d as yt, e as bt, f as kt, g as wt, a3 as jt, aC as Ct, p as ye, ap as z, m as Bt, aD as Dt, z as M, Q as It, aE as R, aF as St, i as ee, w as be, E as ke, H as we, V as _t, aG as At, aH as je, aI as Nt, aJ as Mt, F as Et, aK as Tt, aL as Lt, aM as Rt, M as Ft, aN as Pt, ah as Ce, a2 as Ht } from "./ChaiBuilderEditor-
|
|
8
|
+
import { j as fe, B as W, v as xe, aq as ve, ar as $e, as as rt, at as it, au as at, o as V, X as lt, h as L, av as ct, aw as dt, ax as pt, ay as ut, az as ht, aA as mt, aB as gt, L as C, Y as N, A as ft, a as xt, b as vt, c as $t, d as yt, e as bt, f as kt, g as wt, a3 as jt, aC as Ct, p as ye, ap as z, m as Bt, aD as Dt, z as M, Q as It, aE as R, aF as St, i as ee, w as be, E as ke, H as we, V as _t, aG as At, aH as je, aI as Nt, aJ as Mt, F as Et, aK as Tt, aL as Lt, aM as Rt, M as Ft, aN as Pt, ah as Ce, a2 as Ht } from "./ChaiBuilderEditor-f4SJU7kK.js";
|
|
9
9
|
import { useTranslation as q } from "react-i18next";
|
|
10
10
|
import { useAtom as y } from "jotai";
|
|
11
11
|
import { SparklesIcon as Ot } from "lucide-react";
|
|
@@ -24,7 +24,7 @@ import { Provider as Xt } from "react-wrap-balancer";
|
|
|
24
24
|
import { twMerge as Gt } from "tailwind-merge";
|
|
25
25
|
import { S as le, a as De } from "./STRINGS--j49GZJP.js";
|
|
26
26
|
import { getBlockComponent as Vt } from "@chaibuilder/runtime";
|
|
27
|
-
import { u as es } from "./useCanvasSettings-
|
|
27
|
+
import { u as es } from "./useCanvasSettings-fsSISbZ6.js";
|
|
28
28
|
import "./_commonjsHelpers-UyOWmZb0.js";
|
|
29
29
|
import "clsx";
|
|
30
30
|
import "@radix-ui/react-scroll-area";
|