@chaibuilder/sdk 1.2.48 → 1.2.49
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-cX8vIt0V.js → AddBlocks-JCSA6hLF.js} +8 -8
- package/dist/{AddBlocks-_fhhS7Lm.cjs → AddBlocks-JiIeMTE-.cjs} +1 -1
- package/dist/{CanvasArea-N3rYeBJV.cjs → CanvasArea-K_d6ORTZ.cjs} +1 -1
- package/dist/{CanvasArea-HRipTJFS.js → CanvasArea-c3xbVSoY.js} +13 -13
- package/dist/{ChaiBuilderEditor-dKHRL-Es.js → ChaiBuilderEditor-F2yUJQdt.js} +1533 -1528
- package/dist/{ChaiBuilderEditor-EtQOC5uy.cjs → ChaiBuilderEditor-lqHQcnh3.cjs} +25 -25
- package/dist/{CurrentPage-U8ms8Hs7.js → CurrentPage--lDu6fB9.js} +2 -2
- package/dist/{CurrentPage-9FijxWbn.cjs → CurrentPage-DnQKF1wT.cjs} +1 -1
- package/dist/{ListTree-OgLdyfQs.js → ListTree-7DWSal1i.js} +120 -111
- package/dist/ListTree-HVFqaM0-.cjs +1 -0
- package/dist/{PagesPanel-MsUBq9Xx.js → PagesPanel-D1TOGyVE.js} +3 -3
- package/dist/{PagesPanel-8Cd6UYsh.cjs → PagesPanel-pIFhxLGC.cjs} +1 -1
- package/dist/{ProjectPanel-hsZG_Btj.js → ProjectPanel-PdvQsrbk.js} +3 -3
- package/dist/{ProjectPanel-KmnXPfxx.cjs → ProjectPanel-t7s3-URx.cjs} +1 -1
- package/dist/Settings-WevLeOpk.cjs +1 -0
- package/dist/{Settings-WcLqIeQy.js → Settings-aEcWAB0x.js} +268 -263
- package/dist/{SidePanels-6zRgfZpi.cjs → SidePanels-mavyE3q_.cjs} +1 -1
- package/dist/{SidePanels-PmCljlnf.js → SidePanels-uym8wfA0.js} +103 -110
- package/dist/{ThemeConfiguration-mkbFdePB.js → ThemeConfiguration-7J_Qt53c.js} +5 -5
- package/dist/{ThemeConfiguration-pt7TTAty.cjs → ThemeConfiguration-F-_ieF8J.cjs} +1 -1
- package/dist/{Topbar-FPywhpub.js → Topbar-DkbE0ccQ.js} +1 -1
- package/dist/{Topbar--m1E08Jl.cjs → Topbar-FjX_5927.cjs} +1 -1
- package/dist/UILibrariesPanel-3cSqwsMi.js +196 -0
- package/dist/UILibrariesPanel-qsjCsv10.cjs +1 -0
- package/dist/{UnsplashImages-Yu0msAD8.cjs → UnsplashImages-5skIflMr.cjs} +1 -1
- package/dist/{UnsplashImages-7uAXYHPH.js → UnsplashImages-owPv8UfV.js} +3 -3
- package/dist/{UploadImages-jS51ZcPG.cjs → UploadImages-olCKp-66.cjs} +1 -1
- package/dist/{UploadImages-5M0Q27R-.js → UploadImages-zGp0fN1z.js} +1 -1
- package/dist/{add-page-modal-KAbflupJ.cjs → add-page-modal-JE2NTOKQ.cjs} +1 -1
- package/dist/{add-page-modal-6o7MAbq-.js → add-page-modal-pOnhQNMH.js} +3 -3
- package/dist/{confirm-alert-dow0GlxC.cjs → confirm-alert-GTawvuT8.cjs} +1 -1
- package/dist/{confirm-alert-jL0z_gFv.js → confirm-alert-lbkop3bB.js} +1 -1
- package/dist/core.cjs +1 -1
- package/dist/core.js +1 -1
- package/dist/{delete-page-modal-U5_JYYp7.js → delete-page-modal-3OWHRhV4.js} +2 -2
- package/dist/{delete-page-modal-EDQZneVM.cjs → delete-page-modal-S42VXCGh.cjs} +1 -1
- package/dist/email.cjs +1 -1
- package/dist/email.js +1 -1
- package/dist/{form-Sgpl2fXL.js → form-CetbKOxf.js} +5 -5
- package/dist/{form-KBtrnNWh.cjs → form-Rqiu0P7V.cjs} +1 -1
- package/dist/{functions-7ybAMUuA.js → functions-WB3m-mfN.js} +6 -7
- package/dist/functions-fujiWLsg.cjs +1 -0
- package/dist/{index-po-naEa5.js → index-Mzvi8sMV.js} +2 -2
- package/dist/{index-HjN7LtDT.cjs → index-SZn6KcOd.cjs} +1 -1
- package/dist/lib.cjs +1 -1
- package/dist/lib.d.ts +1 -1
- package/dist/lib.js +17 -18
- package/dist/{page-viewer-nLRRk7DR.js → page-viewer-7iyxGntn.js} +8 -8
- package/dist/{page-viewer-PfZEbcDZ.cjs → page-viewer-fFmRhZs3.cjs} +1 -1
- package/dist/{project-general-setting-HO6zeum2.cjs → project-general-setting-0HJ_qyW3.cjs} +1 -1
- package/dist/{project-general-setting-D1UJdZ2D.js → project-general-setting-tHdsXTwH.js} +7 -7
- package/dist/{project-seo-setting-gT9N1tnB.cjs → project-seo-setting-Ln9aX7b5.cjs} +1 -1
- package/dist/{project-seo-setting-VIZWEMRk.js → project-seo-setting-zEBZ91Xk.js} +2 -2
- package/dist/render.cjs +1 -1
- package/dist/render.js +68 -68
- package/dist/{single-page-detail-To8TcpgJ.cjs → single-page-detail-H0heOB33.cjs} +1 -1
- package/dist/{single-page-detail-lQ8fujC5.js → single-page-detail-RBfdbTs3.js} +4 -4
- package/dist/studio.cjs +1 -1
- package/dist/studio.js +2 -2
- package/dist/ui.cjs +1 -1
- package/dist/ui.js +31 -31
- package/dist/{useCanvasSettings-UzjYHFG5.js → useCanvasSettings-2YhM5XKu.js} +1 -1
- package/dist/{useCanvasSettings-7BXlDuLG.cjs → useCanvasSettings-tDzAqXUt.cjs} +1 -1
- package/dist/web-blocks.cjs +1 -1
- package/dist/web-blocks.js +1 -1
- package/package.json +1 -1
- package/dist/ListTree-jOvHpo3_.cjs +0 -1
- package/dist/Settings-xVjTnVSf.cjs +0 -1
- package/dist/UILibrariesPanel-HhHGcexY.cjs +0 -1
- package/dist/UILibrariesPanel-VrA2X4LO.js +0 -145
- package/dist/functions-yvRwasT2.cjs +0 -1
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { j as e } from "./jsx-runtime-WbnYoNE9.js";
|
|
2
2
|
import k, { createElement as L, useState as b, useEffect as S } from "react";
|
|
3
|
-
import { has as
|
|
3
|
+
import { has as D, isFunction as E, first as h, omit as N, filter as g, groupBy as F, uniq as H, map as B, includes as z, 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 { m as w, L as I, z as M, ag as P, ac as q, ad as O, ae as R,
|
|
6
|
+
import { m as w, L as I, z as M, ag as P, ac as q, 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-F2yUJQdt.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";
|
|
@@ -48,8 +48,8 @@ import "lucide-react";
|
|
|
48
48
|
import "himalaya";
|
|
49
49
|
const he = ({ block: t }) => {
|
|
50
50
|
const [, o] = x(me), { type: a, icon: l, label: c } = t, { addCoreBlock: m, addPredefinedBlock: p } = w(), [s, u] = I(), [, f] = M(), [, n] = x(P), i = () => {
|
|
51
|
-
if (
|
|
52
|
-
const d =
|
|
51
|
+
if (D(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));
|
|
@@ -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 =
|
|
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
109
|
return S(() => {
|
|
110
|
-
!z(i, l) && !
|
|
110
|
+
!z(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-lqHQcnh3.cjs"),b=require("@radix-ui/react-icons"),R=require("@chaibuilder/runtime"),T=require("flagged"),q=require("./STRINGS-gPz7CUOk.cjs"),N=require("./atoms-a0H_593V.cjs"),k=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("tree-model");require("./utils-K3Zk762G.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("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;
|
|
@@ -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 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"),h=require("react"),c=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 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"),h=require("react"),c=require("lodash-es"),E=require("@radix-ui/react-icons"),i=require("./ChaiBuilderEditor-lqHQcnh3.cjs"),U=require("react-i18next"),b=require("jotai"),re=require("lucide-react"),Y=require("react-dom"),R=require("prop-types"),ie=require("react-quill"),T=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"),he=require("tailwindcss-palette-generator"),xe=require("tailwind-merge"),M=require("./STRINGS-gPz7CUOk.cjs"),me=require("@chaibuilder/runtime"),ge=require("./useCanvasSettings-tDzAqXUt.cjs"),fe=require("react-wrap-balancer");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("clsx");require("@radix-ui/react-scroll-area");require("i18next");require("./Functions-N3yhPYKY.cjs");require("./MODIFIERS-YPHRtwrM.cjs");require("tree-model");require("./utils-K3Zk762G.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");const ve=()=>{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 je(){const[o,s]=i.useDarkMode();return r.jsxRuntimeExports.jsxs("div",{className:"flex items-center",children:[r.jsxRuntimeExports.jsx(E.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(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(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(E.LaptopIcon,{}),width:1420},{title:"large_desktop_2xl_title",content:"large_desktop_2xl_content",breakpoint:"2xl",icon:r.jsxRuntimeExports.jsx(E.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)})]})})})]})},ye=()=>{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=>h.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=>h.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(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,{}),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))]})]})]})},be=()=>{const{t:o}=U.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")})]})]})]})})},ke=()=>{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},Ee=()=>{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(ye,{}),r.jsxRuntimeExports.jsx(i.Separator,{orientation:"vertical"}),o?r.jsxRuntimeExports.jsxs(r.jsxRuntimeExports.Fragment,{children:[r.jsxRuntimeExports.jsx(je,{}),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(E.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(ve,{})]}),r.jsxRuntimeExports.jsxs("div",{className:"flex h-full items-center space-x-2",children:[r.jsxRuntimeExports.jsx(be,{}),r.jsxRuntimeExports.jsx(i.Separator,{orientation:"vertical"}),r.jsxRuntimeExports.jsx(ke,{})]})]})},Re=`<!doctype html>
|
|
2
2
|
<html lang="en" dir="__HTML_DIR__" class="scroll-smooth h-full overflow-y-auto">
|
|
3
3
|
<head>
|
|
4
4
|
<meta charset="UTF-8">
|
|
@@ -4,8 +4,8 @@ var E = (n, s, e) => (Pe(n, typeof s != "symbol" ? s + "" : s, e), e);
|
|
|
4
4
|
import { j as r } from "./jsx-runtime-WbnYoNE9.js";
|
|
5
5
|
import M, { createElement as ae, useCallback as O, useState as C, useEffect as w, Component as xe, Children as ze, Suspense as ve, useRef as le, useMemo as Oe } from "react";
|
|
6
6
|
import { map as H, includes as ce, toUpper as X, round as Ue, throttle as $e, has as ye, isEmpty as A, first as U, omit as We, pick as qe, get as f, isString as ee, memoize as Ke, each as Ye, find as Ge, filter as be, isNull as Xe } from "lodash-es";
|
|
7
|
-
import { ResetIcon as de, SunIcon as Qe,
|
|
8
|
-
import { j as ke, B as W, v as we, aq as je, ar as
|
|
7
|
+
import { ResetIcon as de, SunIcon as Qe, MobileIcon as pe, 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 { j as ke, B as W, v as we, aq as je, ar as it, as as at, at as lt, au as ct, o as te, 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 Ce, L as D, Y as N, 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 Dt, aD as _t, p as De, ap as z, aE as Bt, m as At, z as T, aF as _e, Q as It, aG as L, aH as St, i as se, w as Be, E as Ae, H as Ie, V as Et, aI as Mt, aJ as Nt, aK as Tt, F as Lt, aL as Ft, aM as Rt, aN as Ht, aO as Pt, M as zt, aP as Ot, ah as Se, a2 as Ut } from "./ChaiBuilderEditor-F2yUJQdt.js";
|
|
9
9
|
import { useTranslation as oe } from "react-i18next";
|
|
10
10
|
import { useAtom as y } from "jotai";
|
|
11
11
|
import { SparklesIcon as Wt } from "lucide-react";
|
|
@@ -24,7 +24,7 @@ import es from "tailwindcss-palette-generator";
|
|
|
24
24
|
import { twMerge as ts } from "tailwind-merge";
|
|
25
25
|
import { S as he, a as Me } from "./STRINGS--j49GZJP.js";
|
|
26
26
|
import { getBlockComponent as ss } from "@chaibuilder/runtime";
|
|
27
|
-
import { u as os } from "./useCanvasSettings-
|
|
27
|
+
import { u as os } from "./useCanvasSettings-2YhM5XKu.js";
|
|
28
28
|
import { Provider as ns } from "react-wrap-balancer";
|
|
29
29
|
import "./_commonjsHelpers-UyOWmZb0.js";
|
|
30
30
|
import "clsx";
|
|
@@ -84,7 +84,7 @@ function is() {
|
|
|
84
84
|
)
|
|
85
85
|
}
|
|
86
86
|
),
|
|
87
|
-
/* @__PURE__ */ r.jsx(
|
|
87
|
+
/* @__PURE__ */ r.jsx(it, { className: "size-4 ml-3 shrink-0" })
|
|
88
88
|
] });
|
|
89
89
|
}
|
|
90
90
|
const me = ({ landscape: n = !1 }) => /* @__PURE__ */ r.jsxs(
|
|
@@ -143,14 +143,14 @@ const me = ({ landscape: n = !1 }) => /* @__PURE__ */ r.jsxs(
|
|
|
143
143
|
title: "desktop_xl_title",
|
|
144
144
|
content: "desktop_xl_content",
|
|
145
145
|
breakpoint: "xl",
|
|
146
|
-
icon: /* @__PURE__ */ r.jsx(
|
|
146
|
+
icon: /* @__PURE__ */ r.jsx(Ze, {}),
|
|
147
147
|
width: 1420
|
|
148
148
|
},
|
|
149
149
|
{
|
|
150
150
|
title: "large_desktop_2xl_title",
|
|
151
151
|
content: "large_desktop_2xl_content",
|
|
152
152
|
breakpoint: "2xl",
|
|
153
|
-
icon: /* @__PURE__ */ r.jsx(
|
|
153
|
+
icon: /* @__PURE__ */ r.jsx(Je, {}),
|
|
154
154
|
width: 1920
|
|
155
155
|
}
|
|
156
156
|
], ge = ({
|
|
@@ -188,7 +188,7 @@ const me = ({ landscape: n = !1 }) => /* @__PURE__ */ r.jsxs(
|
|
|
188
188
|
(i) => /* @__PURE__ */ ae(ge, { ...i, onClick: s, key: i.breakpoint, currentBreakpoint: n })
|
|
189
189
|
),
|
|
190
190
|
/* @__PURE__ */ r.jsxs(pt, { children: [
|
|
191
|
-
/* @__PURE__ */ r.jsx(ut, { asChild: !0, children: /* @__PURE__ */ r.jsx("span", { className: "cursor-pointer px-2.5 hover:opacity-80", children: /* @__PURE__ */ r.jsx(
|
|
191
|
+
/* @__PURE__ */ r.jsx(ut, { asChild: !0, children: /* @__PURE__ */ r.jsx("span", { className: "cursor-pointer px-2.5 hover:opacity-80", children: /* @__PURE__ */ r.jsx(Ve, { className: "scale-90 transform" }) }) }),
|
|
192
192
|
/* @__PURE__ */ r.jsxs(ht, { className: "w-56 border-border text-xs", children: [
|
|
193
193
|
/* @__PURE__ */ r.jsx(mt, { children: o("Breakpoints") }),
|
|
194
194
|
/* @__PURE__ */ r.jsx(gt, {}),
|
|
@@ -211,7 +211,7 @@ const me = ({ landscape: n = !1 }) => /* @__PURE__ */ r.jsxs(
|
|
|
211
211
|
}, [s]);
|
|
212
212
|
return /* @__PURE__ */ r.jsx("div", { className: "flex items-center", children: /* @__PURE__ */ r.jsxs(xt, { children: [
|
|
213
213
|
/* @__PURE__ */ r.jsx(vt, { asChild: !0, children: /* @__PURE__ */ r.jsxs(W, { size: "sm", variant: "ghost", className: "flex items-center gap-x-1", children: [
|
|
214
|
-
/* @__PURE__ */ r.jsx(
|
|
214
|
+
/* @__PURE__ */ r.jsx(et, {}),
|
|
215
215
|
" ",
|
|
216
216
|
n("clear")
|
|
217
217
|
] }) }),
|
|
@@ -256,7 +256,7 @@ const me = ({ landscape: n = !1 }) => /* @__PURE__ */ r.jsxs(
|
|
|
256
256
|
/* @__PURE__ */ r.jsx(z, { orientation: "vertical" })
|
|
257
257
|
] }) : null,
|
|
258
258
|
/* @__PURE__ */ r.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: [
|
|
259
|
-
/* @__PURE__ */ r.jsx(
|
|
259
|
+
/* @__PURE__ */ r.jsx(tt, { className: "h-3.5 w-3.5 flex-shrink-0" }),
|
|
260
260
|
" ",
|
|
261
261
|
/* @__PURE__ */ r.jsxs("div", { className: "text-xs leading-3", children: [
|
|
262
262
|
Ue(s, 0),
|
|
@@ -670,7 +670,7 @@ const ks = () => {
|
|
|
670
670
|
}, 200);
|
|
671
671
|
},
|
|
672
672
|
children: [
|
|
673
|
-
/* @__PURE__ */ r.jsx(
|
|
673
|
+
/* @__PURE__ */ r.jsx(st, {}),
|
|
674
674
|
s
|
|
675
675
|
]
|
|
676
676
|
}
|
|
@@ -701,7 +701,7 @@ const ks = () => {
|
|
|
701
701
|
/* @__PURE__ */ r.jsx(Bs, { label: p, block: s }),
|
|
702
702
|
/* @__PURE__ */ r.jsxs("div", { className: "flex gap-2 px-1", children: [
|
|
703
703
|
h && /* @__PURE__ */ r.jsx(
|
|
704
|
-
|
|
704
|
+
ot,
|
|
705
705
|
{
|
|
706
706
|
className: "hover:scale-105",
|
|
707
707
|
onClick: () => {
|
|
@@ -709,8 +709,8 @@ const ks = () => {
|
|
|
709
709
|
}
|
|
710
710
|
}
|
|
711
711
|
),
|
|
712
|
-
Nt(f(s, "_type", "")) ? /* @__PURE__ */ r.jsx(
|
|
713
|
-
Tt(f(s, "_type", "")) ? /* @__PURE__ */ r.jsx(
|
|
712
|
+
Nt(f(s, "_type", "")) ? /* @__PURE__ */ r.jsx(nt, { className: "hover:scale-105", onClick: () => t([s == null ? void 0 : s._id]) }) : null,
|
|
713
|
+
Tt(f(s, "_type", "")) ? /* @__PURE__ */ r.jsx(rt, { className: "hover:scale-105", onClick: () => e([s == null ? void 0 : s._id]) }) : null
|
|
714
714
|
] })
|
|
715
715
|
]
|
|
716
716
|
}
|