@chaibuilder/sdk 1.2.44 → 1.2.46

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 (76) hide show
  1. package/dist/AddBlocks-Jse1nYBd.cjs +1 -0
  2. package/dist/{AddBlocks-QCb-vIta.js → AddBlocks-wY7YpsXy.js} +4 -3
  3. package/dist/{CanvasArea-Hqy_21xf.js → CanvasArea-2widR9Ry.js} +6 -5
  4. package/dist/{CanvasArea-xvT325mp.cjs → CanvasArea-pQP-jR11.cjs} +1 -1
  5. package/dist/{ChaiBuilderEditor-AIXWnz29.cjs → ChaiBuilderEditor-74s7jELl.cjs} +42 -42
  6. package/dist/{ChaiBuilderEditor-NnMEdW3k.js → ChaiBuilderEditor-wriVkIG1.js} +5109 -5124
  7. package/dist/{CurrentPage-rkdt2mNr.js → CurrentPage--JhcSlGs.js} +10 -9
  8. package/dist/CurrentPage-UozVUoj8.cjs +1 -0
  9. package/dist/ListTree-aFX8fD7v.cjs +1 -0
  10. package/dist/{ListTree-PuZP9LQu.js → ListTree-qTfVR-jh.js} +2 -1
  11. package/dist/PagesPanel-1ZzPulaC.cjs +1 -0
  12. package/dist/{PagesPanel-TYArrNU6.js → PagesPanel-qatBt4Nf.js} +5 -4
  13. package/dist/ProjectPanel-QUIcKWwM.cjs +1 -0
  14. package/dist/{ProjectPanel-qY_Bnqjm.js → ProjectPanel-Vp-EZS_Y.js} +6 -5
  15. package/dist/{Settings-k9Ll55Wc.js → Settings-E_xif3_e.js} +105 -103
  16. package/dist/Settings-jKpJi5Wy.cjs +1 -0
  17. package/dist/{SidePanels-eOnxPSSw.js → SidePanels-UEa90HOL.js} +5 -4
  18. package/dist/SidePanels-s_Yl7HhG.cjs +1 -0
  19. package/dist/{ThemeConfiguration-TINcg8VX.js → ThemeConfiguration-IUuxGaDf.js} +4 -3
  20. package/dist/ThemeConfiguration-YkPc6RGq.cjs +1 -0
  21. package/dist/{Topbar--KrJ6nJg.js → Topbar-C7Qfcatg.js} +4 -3
  22. package/dist/Topbar-YzdQKElx.cjs +1 -0
  23. package/dist/{UILibrariesPanel-sleogb55.js → UILibrariesPanel-didKK7tC.js} +4 -3
  24. package/dist/UILibrariesPanel-qv8AiOn1.cjs +1 -0
  25. package/dist/UnsplashImages-QeZ65lKC.cjs +1 -0
  26. package/dist/{UnsplashImages-P7_2yEo-.js → UnsplashImages-VkZ_KszK.js} +4 -3
  27. package/dist/{UploadImages-ovzzQW6b.js → UploadImages-6drauLA-.js} +4 -3
  28. package/dist/UploadImages-igQroUtu.cjs +1 -0
  29. package/dist/add-page-modal-esHlLYay.cjs +1 -0
  30. package/dist/{add-page-modal-SmBfx0LH.js → add-page-modal-rJ7OwdoX.js} +17 -16
  31. package/dist/confirm-alert-08q_BmL6.cjs +1 -0
  32. package/dist/{confirm-alert-yipdBkkj.js → confirm-alert-HfChUtfw.js} +4 -3
  33. package/dist/core.cjs +1 -1
  34. package/dist/core.js +45 -44
  35. package/dist/{delete-page-modal-HIul7JBc.js → delete-page-modal-E3tO5Q1p.js} +5 -4
  36. package/dist/delete-page-modal-SOCB_9UB.cjs +1 -0
  37. package/dist/email.cjs +1 -1
  38. package/dist/email.js +4 -3
  39. package/dist/{form-yq_mbR58.cjs → form-gRWwpKzq.cjs} +1 -1
  40. package/dist/{form-cZPoXqTP.js → form-hi_RCepy.js} +1 -1
  41. package/dist/{index-q_bEEzdK.cjs → index-3j3SZ9Pb.cjs} +1 -1
  42. package/dist/{index-Vu40oRWp.js → index-OnzJQ25d.js} +2 -2
  43. package/dist/{page-viewer-ZOVAaE9q.js → page-viewer-K_8dfU3A.js} +6 -5
  44. package/dist/page-viewer-S3xZLu53.cjs +1 -0
  45. package/dist/project-general-setting-IRQ9TNAd.cjs +1 -0
  46. package/dist/{project-general-setting-2iNlm_kN.js → project-general-setting-vSkiqVk-.js} +6 -5
  47. package/dist/project-seo-setting-XHFqgtW9.cjs +1 -0
  48. package/dist/{project-seo-setting-FX0cbkrO.js → project-seo-setting-b9jZC0dr.js} +5 -4
  49. package/dist/single-page-detail-RG82dk4d.cjs +1 -0
  50. package/dist/{single-page-detail-4v8ojQss.js → single-page-detail-zHbO3vOI.js} +7 -6
  51. package/dist/studio.cjs +1 -1
  52. package/dist/studio.js +4 -3
  53. package/dist/ui.cjs +1 -1
  54. package/dist/ui.js +139 -138
  55. package/dist/{useCanvasSettings-A7Qj0z4L.cjs → useCanvasSettings-2Wzyf2PK.cjs} +1 -1
  56. package/dist/{useCanvasSettings-QH5zCmxD.js → useCanvasSettings-L2pW5boY.js} +1 -1
  57. package/package.json +2 -1
  58. package/dist/AddBlocks-Bb-K6Y0Z.cjs +0 -1
  59. package/dist/CurrentPage-n_oOiHx5.cjs +0 -1
  60. package/dist/ListTree-z0FeSAsc.cjs +0 -1
  61. package/dist/PagesPanel-4ftrFiS0.cjs +0 -1
  62. package/dist/ProjectPanel-2scMInUn.cjs +0 -1
  63. package/dist/Settings-kbUR5-xt.cjs +0 -1
  64. package/dist/SidePanels-ZHxoiJ7y.cjs +0 -1
  65. package/dist/ThemeConfiguration-fRsktVs4.cjs +0 -1
  66. package/dist/Topbar-tgFkKz7R.cjs +0 -1
  67. package/dist/UILibrariesPanel-2HyAEVLE.cjs +0 -1
  68. package/dist/UnsplashImages-azP_HIqG.cjs +0 -1
  69. package/dist/UploadImages-nnszHoZa.cjs +0 -1
  70. package/dist/add-page-modal-nDBqhemF.cjs +0 -1
  71. package/dist/confirm-alert-75rfTsgE.cjs +0 -1
  72. package/dist/delete-page-modal-lO-dULGW.cjs +0 -1
  73. package/dist/page-viewer-3ZqrDjrz.cjs +0 -1
  74. package/dist/project-general-setting-IIxWGrU2.cjs +0 -1
  75. package/dist/project-seo-setting-46PdN9FR.cjs +0 -1
  76. package/dist/single-page-detail-MsBTVx9h.cjs +0 -1
@@ -0,0 +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-74s7jELl.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;
@@ -3,7 +3,7 @@ import k, { createElement as L, useState as b, useEffect as S } from "react";
3
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 q, 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, ag as P, ac as M, ad as O, ae as R, bk as G, bl as J, bm as K, bn as U, aq 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-NnMEdW3k.js";
6
+ import { m as w, L as I, z, ag as P, ac as M, ad as O, ae as R, bk as G, bl as J, bm as K, bn as U, aq 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-wriVkIG1.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";
@@ -20,6 +20,7 @@ import "./Functions-7jnEwJyw.js";
20
20
  import "tailwind-merge";
21
21
  import "@react-hookz/web";
22
22
  import "./MODIFIERS-cBT31iqE.js";
23
+ import "tree-model";
23
24
  import "./utils-iMv3T4WT.js";
24
25
  import "@radix-ui/react-toggle";
25
26
  import "class-variance-authority";
@@ -103,7 +104,7 @@ const he = ({ block: t }) => {
103
104
  /* @__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: t("note_imported_html") }) })
104
105
  ] })
105
106
  ] });
106
- }, ct = () => {
107
+ }, nt = () => {
107
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
109
  return S(() => {
109
110
  !q(i, l) && !y(i) && !y(l) && c(h(i));
@@ -141,5 +142,5 @@ const he = ({ block: t }) => {
141
142
  ] });
142
143
  };
143
144
  export {
144
- ct as default
145
+ nt as default
145
146
  };
@@ -5,7 +5,7 @@ import { j as r } from "./jsx-runtime-WbnYoNE9.js";
5
5
  import M, { createElement as ne, useCallback as z, useState as C, useEffect as w, Component as me, Children as Oe, Suspense as ge, useRef as re, useMemo as Ue } from "react";
6
6
  import { map as R, includes as ie, toUpper as Y, round as We, throttle as fe, has as xe, isEmpty as A, first as O, omit as qe, pick as Ke, get as f, isString as G, memoize as Ye, each as Qe, find as Xe, filter as ve, isNull as Ze } from "lodash-es";
7
7
  import { ResetIcon as ae, MobileIcon as le, LaptopIcon as Je, DesktopIcon as Ge, 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 $e, B as U, v as ye, aq as be, ar as ke, as as it, at, au as lt, o as V, X as ct, h as P, av as dt, aw as pt, ax as ut, ay as ht, az as mt, aA as gt, aB as we, L as B, Y as E, 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 je, ap as H, aD as Bt, m as Dt, z as T, aE as Ce, Q as _t, aF as L, aG as At, i as ee, w as Be, E as De, H as _e, V as It, aH as St, aI as Nt, aJ as Mt, F as Et, aK as Tt, aL as Lt, aM as Ft, aN as Rt, M as Pt, aO as Ht, ah as Ae, a2 as zt } from "./ChaiBuilderEditor-NnMEdW3k.js";
8
+ import { j as $e, B as U, v as ye, aq as be, ar as ke, as as it, at, au as lt, o as V, X as ct, h as P, av as dt, aw as pt, ax as ut, ay as ht, az as mt, aA as gt, aB as we, L as B, Y as E, 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 je, ap as H, aD as Bt, m as Dt, z as T, aE as Ce, Q as _t, aF as L, aG as At, i as ee, w as Be, E as De, H as _e, V as It, aH as St, aI as Nt, aJ as Mt, F as Et, aK as Tt, aL as Lt, aM as Ft, aN as Rt, M as Pt, aO as Ht, ah as Ae, a2 as zt } from "./ChaiBuilderEditor-wriVkIG1.js";
9
9
  import { useTranslation as W } 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 Gt from "tailwindcss-palette-generator";
24
24
  import { twMerge as Vt } from "tailwind-merge";
25
25
  import { S as de, a as Se } from "./STRINGS--j49GZJP.js";
26
26
  import { getBlockComponent as es } from "@chaibuilder/runtime";
27
- import { u as ts } from "./useCanvasSettings-QH5zCmxD.js";
27
+ import { u as ts } from "./useCanvasSettings-L2pW5boY.js";
28
28
  import { Provider as ss } from "react-wrap-balancer";
29
29
  import "./_commonjsHelpers-UyOWmZb0.js";
30
30
  import "clsx";
@@ -32,6 +32,7 @@ import "@radix-ui/react-scroll-area";
32
32
  import "i18next";
33
33
  import "./Functions-7jnEwJyw.js";
34
34
  import "./MODIFIERS-cBT31iqE.js";
35
+ import "tree-model";
35
36
  import "./utils-iMv3T4WT.js";
36
37
  import "@radix-ui/react-toggle";
37
38
  import "class-variance-authority";
@@ -353,7 +354,7 @@ const pe = ({ landscape: n = !1 }) => /* @__PURE__ */ r.jsxs(
353
354
  let Ne, Me;
354
355
  typeof document < "u" && (Ne = document);
355
356
  typeof window < "u" && (Me = window);
356
- const Ee = M.createContext({ document: Ne, window: Me }), q = () => M.useContext(Ee), { Provider: us, Consumer: Po } = Ee;
357
+ const Ee = M.createContext({ document: Ne, window: Me }), q = () => M.useContext(Ee), { Provider: us, Consumer: Ho } = Ee;
357
358
  class Te extends me {
358
359
  componentDidMount() {
359
360
  this.props.contentDidMount();
@@ -1206,10 +1207,10 @@ const Ts = () => {
1206
1207
  )
1207
1208
  }
1208
1209
  );
1209
- }, Ho = () => /* @__PURE__ */ r.jsxs("div", { className: "flex h-full w-full flex-col", children: [
1210
+ }, zo = () => /* @__PURE__ */ r.jsxs("div", { className: "flex h-full w-full flex-col", children: [
1210
1211
  /* @__PURE__ */ r.jsx(cs, {}),
1211
1212
  /* @__PURE__ */ r.jsx("div", { className: "relative h-full overflow-hidden bg-slate-800/90 bg-[linear-gradient(to_right,#222_0.5px,transparent_0.5px),linear-gradient(to_bottom,#222_0.5px,transparent_0.5px)] bg-[size:12px_12px] px-2", children: /* @__PURE__ */ r.jsx(ge, { fallback: /* @__PURE__ */ r.jsx(Ae, { className: "h-full" }), children: /* @__PURE__ */ r.jsx(zt, { children: /* @__PURE__ */ r.jsx(Fs, {}) }) }) })
1212
1213
  ] });
1213
1214
  export {
1214
- Ho as default
1215
+ zo as default
1215
1216
  };
@@ -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"),R=require("@radix-ui/react-icons"),i=require("./ChaiBuilderEditor-AIXWnz29.cjs"),N=require("react-i18next"),b=require("jotai"),re=require("lucide-react"),z=require("react-dom"),E=require("prop-types"),ie=require("react-quill"),_=require("./atoms-a0H_593V.cjs"),le=require("@floating-ui/dom"),W=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-A7Qj0z4L.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("./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(R.ResetIcon,{})}),r.jsxRuntimeExports.jsx(i.Button,{disabled:!s(),onClick:t,size:"sm",className:"rounded-full",variant:"ghost",children:r.jsxRuntimeExports.jsx(R.ResetIcon,{className:"rotate-180 scale-y-[-1] transform"})})]})};function je(){const[o,s]=i.useDarkMode(),{t:e}=N.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"}
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"),R=require("@radix-ui/react-icons"),i=require("./ChaiBuilderEditor-74s7jELl.cjs"),N=require("react-i18next"),b=require("jotai"),re=require("lucide-react"),z=require("react-dom"),E=require("prop-types"),ie=require("react-quill"),_=require("./atoms-a0H_593V.cjs"),le=require("@floating-ui/dom"),W=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-2Wzyf2PK.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(R.ResetIcon,{})}),r.jsxRuntimeExports.jsx(i.Button,{disabled:!s(),onClick:t,size:"sm",className:"rounded-full",variant:"ghost",children:r.jsxRuntimeExports.jsx(R.ResetIcon,{className:"rotate-180 scale-y-[-1] transform"})})]})};function je(){const[o,s]=i.useDarkMode(),{t:e}=N.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 K=({landscape:o=!1})=>r.jsxRuntimeExports.jsxs("svg",{className:o?"rotate-90":"",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 13 13",xmlSpace:"preserve",width:13,height:13,children:[r.jsxRuntimeExports.jsx("g",{strokeWidth:0}),r.jsxRuntimeExports.jsx("g",{strokeLinecap:"round",strokeLinejoin:"round"}),r.jsxRuntimeExports.jsx("path",{d:"M10.65 0H2.349a.851.851 0 0 0-.851.852v11.299c0 .47.382.852.851.852h8.3a.851.851 0 0 0 .851-.852V.852A.851.851 0 0 0 10.65 0zM6.599 12.466a.367.367 0 1 1 0-.735.367.367 0 0 1 0 .735zm3.9-1.267H2.5V1h8.001v10.199z",style:{fill:"#000"}})]}),$e=[{title:"mobile_xs_title",content:"mobile_xs_content",breakpoint:"xs",icon:r.jsxRuntimeExports.jsx(R.MobileIcon,{}),width:400},{title:"mobile_sm_title",content:"mobile_sm_content",breakpoint:"sm",icon:r.jsxRuntimeExports.jsx(R.MobileIcon,{className:"rotate-90"}),width:640},{title:"tablet_md_title",content:"tablet_md_content",breakpoint:"md",icon:r.jsxRuntimeExports.jsx(K,{}),width:800},{title:"tablet_lg_title",content:"tablet_lg_content",breakpoint:"lg",icon:r.jsxRuntimeExports.jsx(K,{landscape:!0}),width:1024},{title:"desktop_xl_title",content:"desktop_xl_content",breakpoint:"xl",icon:r.jsxRuntimeExports.jsx(R.LaptopIcon,{}),width:1420},{title:"large_desktop_2xl_title",content:"large_desktop_2xl_content",breakpoint:"2xl",icon:r.jsxRuntimeExports.jsx(R.DesktopIcon,{}),width:1920}],Y=({title:o,content:s,currentBreakpoint:e,breakpoint:t,width:n,icon:u,onClick:a})=>{const{t:l}=N.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}=N.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(Y,{...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(Y,{...l,onClick:s,key:l.breakpoint,currentBreakpoint:o})),r.jsxRuntimeExports.jsxs(i.DropdownMenu,{children:[r.jsxRuntimeExports.jsx(i.DropdownMenuTrigger,{asChild:!0,children:r.jsxRuntimeExports.jsx("span",{className:"cursor-pointer px-2.5 hover:opacity-80",children:r.jsxRuntimeExports.jsx(R.DotsVerticalIcon,{className:"scale-90 transform"})})}),r.jsxRuntimeExports.jsxs(i.DropdownMenuContent,{className:"w-56 border-border text-xs",children:[r.jsxRuntimeExports.jsx(i.DropdownMenuLabel,{children:n("Breakpoints")}),r.jsxRuntimeExports.jsx(i.DropdownMenuSeparator,{}),c.map(u,l=>r.jsxRuntimeExports.jsx(i.DropdownMenuCheckboxItem,{disabled:l.breakpoint==="xs",onCheckedChange:()=>a(c.toUpper(l.breakpoint)),checked:c.includes(e,c.toUpper(l.breakpoint)),children:n(l.title)},l.breakpoint))]})]})]})},be=()=>{const{t:o}=N.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(R.EraserIcon,{})," ",o("clear")]})}),r.jsxRuntimeExports.jsxs(i.AlertDialogContent,{className:"border-border",children:[r.jsxRuntimeExports.jsxs(i.AlertDialogHeader,{children:[r.jsxRuntimeExports.jsx(i.AlertDialogTitle,{children:o("clear_canvas_title")}),r.jsxRuntimeExports.jsx(i.AlertDialogDescription,{children:o("clear_canvas_description")})]}),r.jsxRuntimeExports.jsxs(i.AlertDialogFooter,{children:[r.jsxRuntimeExports.jsx(i.AlertDialogCancel,{children:o("cancel")}),r.jsxRuntimeExports.jsx(i.AlertDialogAction,{onClick:n,children:o("yes")})]})]})]})})},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",!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(je,{}),r.jsxRuntimeExports.jsx(i.Separator,{orientation:"vertical"})]}):null,r.jsxRuntimeExports.jsx(ye,{}),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(R.ZoomInIcon,{className:"h-3.5 w-3.5 flex-shrink-0"})," ",r.jsxRuntimeExports.jsxs("div",{className:"text-xs leading-3",children:[c.round(s,0),"%"]})]}),r.jsxRuntimeExports.jsx(i.Separator,{orientation:"vertical"}),r.jsxRuntimeExports.jsx(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>
4
4
  <html lang="en" dir="__HTML_DIR__" class="scroll-smooth h-full overflow-y-auto">