@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.
Files changed (71) hide show
  1. package/dist/{AddBlocks-cX8vIt0V.js → AddBlocks-JCSA6hLF.js} +8 -8
  2. package/dist/{AddBlocks-_fhhS7Lm.cjs → AddBlocks-JiIeMTE-.cjs} +1 -1
  3. package/dist/{CanvasArea-N3rYeBJV.cjs → CanvasArea-K_d6ORTZ.cjs} +1 -1
  4. package/dist/{CanvasArea-HRipTJFS.js → CanvasArea-c3xbVSoY.js} +13 -13
  5. package/dist/{ChaiBuilderEditor-dKHRL-Es.js → ChaiBuilderEditor-F2yUJQdt.js} +1533 -1528
  6. package/dist/{ChaiBuilderEditor-EtQOC5uy.cjs → ChaiBuilderEditor-lqHQcnh3.cjs} +25 -25
  7. package/dist/{CurrentPage-U8ms8Hs7.js → CurrentPage--lDu6fB9.js} +2 -2
  8. package/dist/{CurrentPage-9FijxWbn.cjs → CurrentPage-DnQKF1wT.cjs} +1 -1
  9. package/dist/{ListTree-OgLdyfQs.js → ListTree-7DWSal1i.js} +120 -111
  10. package/dist/ListTree-HVFqaM0-.cjs +1 -0
  11. package/dist/{PagesPanel-MsUBq9Xx.js → PagesPanel-D1TOGyVE.js} +3 -3
  12. package/dist/{PagesPanel-8Cd6UYsh.cjs → PagesPanel-pIFhxLGC.cjs} +1 -1
  13. package/dist/{ProjectPanel-hsZG_Btj.js → ProjectPanel-PdvQsrbk.js} +3 -3
  14. package/dist/{ProjectPanel-KmnXPfxx.cjs → ProjectPanel-t7s3-URx.cjs} +1 -1
  15. package/dist/Settings-WevLeOpk.cjs +1 -0
  16. package/dist/{Settings-WcLqIeQy.js → Settings-aEcWAB0x.js} +268 -263
  17. package/dist/{SidePanels-6zRgfZpi.cjs → SidePanels-mavyE3q_.cjs} +1 -1
  18. package/dist/{SidePanels-PmCljlnf.js → SidePanels-uym8wfA0.js} +103 -110
  19. package/dist/{ThemeConfiguration-mkbFdePB.js → ThemeConfiguration-7J_Qt53c.js} +5 -5
  20. package/dist/{ThemeConfiguration-pt7TTAty.cjs → ThemeConfiguration-F-_ieF8J.cjs} +1 -1
  21. package/dist/{Topbar-FPywhpub.js → Topbar-DkbE0ccQ.js} +1 -1
  22. package/dist/{Topbar--m1E08Jl.cjs → Topbar-FjX_5927.cjs} +1 -1
  23. package/dist/UILibrariesPanel-3cSqwsMi.js +196 -0
  24. package/dist/UILibrariesPanel-qsjCsv10.cjs +1 -0
  25. package/dist/{UnsplashImages-Yu0msAD8.cjs → UnsplashImages-5skIflMr.cjs} +1 -1
  26. package/dist/{UnsplashImages-7uAXYHPH.js → UnsplashImages-owPv8UfV.js} +3 -3
  27. package/dist/{UploadImages-jS51ZcPG.cjs → UploadImages-olCKp-66.cjs} +1 -1
  28. package/dist/{UploadImages-5M0Q27R-.js → UploadImages-zGp0fN1z.js} +1 -1
  29. package/dist/{add-page-modal-KAbflupJ.cjs → add-page-modal-JE2NTOKQ.cjs} +1 -1
  30. package/dist/{add-page-modal-6o7MAbq-.js → add-page-modal-pOnhQNMH.js} +3 -3
  31. package/dist/{confirm-alert-dow0GlxC.cjs → confirm-alert-GTawvuT8.cjs} +1 -1
  32. package/dist/{confirm-alert-jL0z_gFv.js → confirm-alert-lbkop3bB.js} +1 -1
  33. package/dist/core.cjs +1 -1
  34. package/dist/core.js +1 -1
  35. package/dist/{delete-page-modal-U5_JYYp7.js → delete-page-modal-3OWHRhV4.js} +2 -2
  36. package/dist/{delete-page-modal-EDQZneVM.cjs → delete-page-modal-S42VXCGh.cjs} +1 -1
  37. package/dist/email.cjs +1 -1
  38. package/dist/email.js +1 -1
  39. package/dist/{form-Sgpl2fXL.js → form-CetbKOxf.js} +5 -5
  40. package/dist/{form-KBtrnNWh.cjs → form-Rqiu0P7V.cjs} +1 -1
  41. package/dist/{functions-7ybAMUuA.js → functions-WB3m-mfN.js} +6 -7
  42. package/dist/functions-fujiWLsg.cjs +1 -0
  43. package/dist/{index-po-naEa5.js → index-Mzvi8sMV.js} +2 -2
  44. package/dist/{index-HjN7LtDT.cjs → index-SZn6KcOd.cjs} +1 -1
  45. package/dist/lib.cjs +1 -1
  46. package/dist/lib.d.ts +1 -1
  47. package/dist/lib.js +17 -18
  48. package/dist/{page-viewer-nLRRk7DR.js → page-viewer-7iyxGntn.js} +8 -8
  49. package/dist/{page-viewer-PfZEbcDZ.cjs → page-viewer-fFmRhZs3.cjs} +1 -1
  50. package/dist/{project-general-setting-HO6zeum2.cjs → project-general-setting-0HJ_qyW3.cjs} +1 -1
  51. package/dist/{project-general-setting-D1UJdZ2D.js → project-general-setting-tHdsXTwH.js} +7 -7
  52. package/dist/{project-seo-setting-gT9N1tnB.cjs → project-seo-setting-Ln9aX7b5.cjs} +1 -1
  53. package/dist/{project-seo-setting-VIZWEMRk.js → project-seo-setting-zEBZ91Xk.js} +2 -2
  54. package/dist/render.cjs +1 -1
  55. package/dist/render.js +68 -68
  56. package/dist/{single-page-detail-To8TcpgJ.cjs → single-page-detail-H0heOB33.cjs} +1 -1
  57. package/dist/{single-page-detail-lQ8fujC5.js → single-page-detail-RBfdbTs3.js} +4 -4
  58. package/dist/studio.cjs +1 -1
  59. package/dist/studio.js +2 -2
  60. package/dist/ui.cjs +1 -1
  61. package/dist/ui.js +31 -31
  62. package/dist/{useCanvasSettings-UzjYHFG5.js → useCanvasSettings-2YhM5XKu.js} +1 -1
  63. package/dist/{useCanvasSettings-7BXlDuLG.cjs → useCanvasSettings-tDzAqXUt.cjs} +1 -1
  64. package/dist/web-blocks.cjs +1 -1
  65. package/dist/web-blocks.js +1 -1
  66. package/package.json +1 -1
  67. package/dist/ListTree-jOvHpo3_.cjs +0 -1
  68. package/dist/Settings-xVjTnVSf.cjs +0 -1
  69. package/dist/UILibrariesPanel-HhHGcexY.cjs +0 -1
  70. package/dist/UILibrariesPanel-VrA2X4LO.js +0 -145
  71. 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 E, isFunction as F, first as h, omit as N, filter as g, groupBy as H, uniq as D, map as B, includes as z, isEmpty as C, reject as y, values as v } from "lodash-es";
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, bk as G, bl as J, bm as K, bn as U, aC as V, ba as W, bo as Y, B as Q, bp as X, bq as Z, br as $, h as T, ai as ee, aj as te, ak as _, bf as se, b5 as oe, b6 as re, b7 as ae, b8 as le } from "./ChaiBuilderEditor-dKHRL-Es.js";
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 (E(t, "blocks")) {
52
- const d = F(t.blocks) ? t.blocks() : t.blocks;
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 = H(f, "category"), i = D(B(n.core, "group"));
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) && !C(i) && !C(l) && c(h(i));
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) => y(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: [
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
- y(g(v(n.core), { group: r }), { hidden: !0 }).map((d) => /* @__PURE__ */ e.jsx(he, { block: d }))
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-EtQOC5uy.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
+ "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-EtQOC5uy.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-7BXlDuLG.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(E.MoonIcon,{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>
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, MoonIcon as Ze, MobileIcon as pe, LaptopIcon as Je, DesktopIcon as Ve, DotsVerticalIcon as et, EraserIcon as tt, ZoomInIcon as st, DragHandleDots2Icon as ot, ArrowUpIcon as nt, CopyIcon as rt, TrashIcon as it } from "@radix-ui/react-icons";
8
- import { j as ke, B as W, v as we, aq as je, ar as at, as as lt, at as ct, o as te, X as dt, h as P, au as pt, av as ut, aw as ht, ax as mt, ay as gt, az as ft, aA 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, aB as Dt, aC as _t, p as De, ap as z, aD as Bt, m as At, z as T, aE as _e, Q as It, aF as L, aG as St, i as se, w as Be, E as Ae, H as Ie, V as Et, aH as Mt, aI as Nt, aJ as Tt, F as Lt, aK as Ft, aL as Rt, aM as Ht, aN as Pt, M as zt, aO as Ot, ah as Se, a2 as Ut } from "./ChaiBuilderEditor-dKHRL-Es.js";
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-UzjYHFG5.js";
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(Ze, { className: "size-4 ml-3 shrink-0" })
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(Je, {}),
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(Ve, {}),
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(et, { className: "scale-90 transform" }) }) }),
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(tt, {}),
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(st, { className: "h-3.5 w-3.5 flex-shrink-0" }),
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(ot, {}),
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
- nt,
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(rt, { className: "hover:scale-105", onClick: () => t([s == null ? void 0 : s._id]) }) : null,
713
- Tt(f(s, "_type", "")) ? /* @__PURE__ */ r.jsx(it, { className: "hover:scale-105", onClick: () => e([s == null ? void 0 : s._id]) }) : null
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
  }