@chaibuilder/sdk 0.1.1 → 0.1.3

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 (82) hide show
  1. package/dist/AddBlocks-0916e841.cjs +3 -0
  2. package/dist/AddBlocks-c195f577.js +258 -0
  3. package/dist/{BrandingOptions-77957074.cjs → BrandingOptions-742992b6.cjs} +1 -1
  4. package/dist/{BrandingOptions-86dc389a.js → BrandingOptions-766c19c6.js} +27 -27
  5. package/dist/{CanvasArea-29d479f2.js → CanvasArea-25800a3e.js} +19 -18
  6. package/dist/CanvasArea-e855c4a2.cjs +60 -0
  7. package/dist/Class-7d6aadbc.cjs +1 -0
  8. package/dist/{Class-e6b07b79.js → Class-e34b2337.js} +9 -9
  9. package/dist/{ImagesPanel-6595528d.js → ImagesPanel-8ccab6d9.js} +1 -1
  10. package/dist/{ImagesPanel-5cde797f.cjs → ImagesPanel-addb2bf9.cjs} +1 -1
  11. package/dist/{Layers-3a270af5.cjs → Layers-a2169d0b.cjs} +1 -1
  12. package/dist/{Layers-81832d92.js → Layers-f7e792f6.js} +3 -3
  13. package/dist/{MarkAsGlobalBlock-f2186631.cjs → MarkAsGlobalBlock-6187e6fd.cjs} +1 -1
  14. package/dist/{MarkAsGlobalBlock-a1b5646c.js → MarkAsGlobalBlock-6bac1842.js} +2 -2
  15. package/dist/PagesPanel-0827c264.js +46 -0
  16. package/dist/PagesPanel-5698953d.cjs +1 -0
  17. package/dist/ProjectPanel-a3cb7396.cjs +1 -0
  18. package/dist/ProjectPanel-e577029a.js +66 -0
  19. package/dist/{Settings-a8cea8ee.js → Settings-b214f859.js} +25 -24
  20. package/dist/Settings-bee21026.cjs +1 -0
  21. package/dist/{SidePanels-1dcabe54.js → SidePanels-03fa10e8.js} +20 -18
  22. package/dist/SidePanels-934159a4.cjs +1 -0
  23. package/dist/{Topbar-ce65bdce.js → Topbar-9bc8c9cf.js} +2 -2
  24. package/dist/{Topbar-00cfceeb.cjs → Topbar-c083cc2a.cjs} +1 -1
  25. package/dist/UnsplashImages-68492dc9.cjs +1 -0
  26. package/dist/{UnsplashImages-43ec34a9.js → UnsplashImages-afaa7706.js} +19 -28
  27. package/dist/add-page-modal-63858244.js +92 -0
  28. package/dist/add-page-modal-cb367c9d.cjs +1 -0
  29. package/dist/alert-dialog-4ce6ed22.cjs +1 -0
  30. package/dist/alert-dialog-ee98f47e.js +64 -0
  31. package/dist/confirm-alert-4f50caa7.cjs +1 -0
  32. package/dist/confirm-alert-f2a47cc7.js +36 -0
  33. package/dist/core.cjs +1 -1
  34. package/dist/core.d.ts +20 -12
  35. package/dist/core.js +53 -52
  36. package/dist/delete-page-modal-1e3914e3.cjs +1 -0
  37. package/dist/delete-page-modal-def9012d.js +64 -0
  38. package/dist/dropdown-menu-84b2439e.cjs +1 -0
  39. package/dist/dropdown-menu-ae3ed09b.js +164 -0
  40. package/dist/form-5d5c5c9e.js +125 -0
  41. package/dist/form-6eac0287.cjs +1 -0
  42. package/dist/{html-to-json-fecbbe16.js → html-to-json-9304dbda.js} +47 -47
  43. package/dist/html-to-json-9c9961da.cjs +1 -0
  44. package/dist/index-207f2cbf.cjs +2 -0
  45. package/dist/index-390f7bef.js +4749 -0
  46. package/dist/index-824a7bd0.js +188 -0
  47. package/dist/index-ebd86d7f.cjs +2 -0
  48. package/dist/input-42acea7e.cjs +1 -0
  49. package/dist/input-a0ea2bc7.js +19 -0
  50. package/dist/lib.cjs +1 -1
  51. package/dist/lib.js +3 -3
  52. package/dist/link-86c532b5.cjs +1 -0
  53. package/dist/{link-0bfd8606.js → link-f80a947d.js} +52 -68
  54. package/dist/mockServiceWorker.js +292 -0
  55. package/dist/page-viewer-41cbb548.js +88 -0
  56. package/dist/page-viewer-83ce2c70.cjs +1 -0
  57. package/dist/project-general-setting-0262fe62.js +65 -0
  58. package/dist/project-general-setting-2c8bed74.cjs +1 -0
  59. package/dist/project-seo-setting-01536592.js +67 -0
  60. package/dist/project-seo-setting-e3924578.cjs +1 -0
  61. package/dist/single-page-detail-924d57fc.js +206 -0
  62. package/dist/single-page-detail-cfeae896.cjs +1 -0
  63. package/dist/ui.cjs +1 -1
  64. package/dist/ui.js +124 -122
  65. package/dist/usePageActions-3bed2330.cjs +1 -0
  66. package/dist/usePageActions-f86f6f65.js +36 -0
  67. package/dist/useProjectActions-1de05f63.js +17 -0
  68. package/dist/useProjectActions-5092ed79.cjs +1 -0
  69. package/package.json +14 -1
  70. package/dist/AddBlocks-52d9b4d7.cjs +0 -3
  71. package/dist/AddBlocks-e047b93d.js +0 -260
  72. package/dist/CanvasArea-9ce217a4.cjs +0 -60
  73. package/dist/Class-0801d193.cjs +0 -1
  74. package/dist/Settings-6a3f0f70.cjs +0 -1
  75. package/dist/SidePanels-7fe6bebe.cjs +0 -1
  76. package/dist/UnsplashImages-1b2310ad.cjs +0 -1
  77. package/dist/dropdown-menu-a9b096f9.cjs +0 -1
  78. package/dist/dropdown-menu-d912a52e.js +0 -223
  79. package/dist/html-to-json-d8ac554d.cjs +0 -1
  80. package/dist/index-32d7b6e5.js +0 -2657
  81. package/dist/index-506fb888.cjs +0 -2
  82. package/dist/link-158970ee.cjs +0 -1
@@ -0,0 +1,3 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-5c3ac4f7.cjs"),n=require("react"),s=require("lodash"),b=require("jotai"),w=require("./accordion-0afd8143.cjs"),q=require("./scroll-area-088530b9.cjs"),k=require("./tabs-860e37aa.cjs"),y=require("./useBuilderProp-5e57d0c8.cjs"),v=require("react-dnd"),C=require("@radix-ui/react-icons"),l=require("./index-ebd86d7f.cjs");require("react-i18next");const T=require("@chaibuilder/blocks"),I=require("lucide-react"),L=require("./utils-3c452dd0.cjs"),f=require("./textarea-a338ede6.cjs"),P=require("./label-167415e5.cjs"),S=require("./html-to-json-9c9961da.cjs");require("@radix-ui/react-accordion");require("@radix-ui/react-scroll-area");require("@radix-ui/react-tabs");require("@radix-ui/react-slot");require("class-variance-authority");require("@radix-ui/react-tooltip");require("@radix-ui/react-toast");require("i18next");require("flagged");require("@minoru/react-dnd-treeview");require("react-hotkeys-hook");require("flat-to-nested");require("./Class-7d6aadbc.cjs");require("redux-undo");require("@react-hookz/web");require("./CONTROLS-031e1de3.cjs");require("clsx");require("tailwind-merge");require("@radix-ui/react-label");require("himalaya");const M=({block:t})=>{const{type:r,icon:o,label:c}=t,{addCoreBlock:x,addPredefinedBlock:m}=l.useAddBlock(),[p]=l.useSelectedBlockIds(),[,u]=b.useAtom(l.activePanelAtom),[,i]=b.useAtom(l.addBlocksModalAtom),E=()=>{s.has(t,"blocks")?m(T.syncBlocksWithDefaults(t.blocks),s.first(p)):x(t,s.first(p)),i(!1),u("layers")},[,g,j]=v.useDrag(()=>({type:"CHAI_BLOCK",item:t}));return e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx(v.DragPreviewImage,{connect:j,src:"https://placehold.co/100x30/000000/FFF?text="+(c||r).replace(/ /g,"+")}),e.jsxRuntimeExports.jsxs(y.Tooltip,{children:[e.jsxRuntimeExports.jsx(y.TooltipTrigger,{asChild:!0,children:e.jsxRuntimeExports.jsxs("button",{onClick:E,type:"button",ref:g,className:"cursor-grab space-y-2 rounded-lg border border-border p-3 text-center hover:bg-slate-300/50",children:[n.createElement(o||C.BoxIcon,{className:"w-4 h-4 mx-auto"}),e.jsxRuntimeExports.jsx("p",{className:"truncate text-xs",children:c||r})]})}),e.jsxRuntimeExports.jsx(y.TooltipContent,{children:e.jsxRuntimeExports.jsx("p",{children:c||r})})]})]})},F=({block:t,closePopover:r})=>{var j;const[o,c]=n.useState(!1),x=y.useBuilderProp("getExternalPredefinedBlock"),{addCoreBlock:m,addPredefinedBlock:p}=l.useAddBlock(),[u]=l.useSelectedBlockIds(),[,i,E]=v.useDrag(()=>({type:"CHAI_BLOCK",item:t}),[t]),g=n.useCallback(async R=>{if(R.stopPropagation(),s.has(t,"component")){m(t,s.first(u)),r();return}c(!0);const a=await x(t);s.isEmpty(a)||p(T.syncBlocksWithDefaults(a),s.first(u)),r()},[t]);return e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx(v.DragPreviewImage,{connect:E,src:"https://placehold.co/100x30/000000/FFF?text="+((j=t.name||t.label)==null?void 0:j.replace(" ","+"))}),e.jsxRuntimeExports.jsxs("div",{ref:i,onClick:o?()=>{}:g,className:"relative cursor-grab overflow-hidden rounded-md border border-transparent duration-200 hover:scale-x-105 hover:border-foreground/20 hover:shadow-2xl",children:[o&&e.jsxRuntimeExports.jsxs("div",{className:"absolute flex h-full w-full items-center justify-center bg-black bg-opacity-70",children:[e.jsxRuntimeExports.jsx(I.Loader,{className:"animate-spin",size:15,color:"white"})," ",e.jsxRuntimeExports.jsx("span",{className:"pl-2 text-sm text-white",children:"Adding..."})]}),t.preview?e.jsxRuntimeExports.jsx("img",{src:t.preview,className:"min-h-[50px] w-full rounded-md border border-gray-300",alt:t.name}):e.jsxRuntimeExports.jsx("div",{className:"flex h-20 items-center justify-center rounded-md border border-border border-gray-300 bg-gray-200",children:e.jsxRuntimeExports.jsx("p",{className:"max-w-xs text-center text-sm text-gray-700",children:t.name})})]})]})},H=()=>{const{data:t,isLoading:r}=l.useUILibraryBlocks(),o=T.useChaiBlocks(),c=s.filter(s.values(o),{category:"custom"}),x=s.groupBy(c,"group"),m=s.groupBy(t,"group"),[p,u]=n.useState(null),i=n.useMemo(()=>s.mergeWith(x,m,(a,h)=>{if(s.isArray(a)&&s.isArray(h))return[...a,...h]}),[x,m]),[,E]=b.useAtom(l.addBlocksModalAtom),[g,j]=n.useState("Navbar"),R=s.get(i,g,[]);return e.jsxRuntimeExports.jsxs("div",{className:"relative flex h-full max-h-full overflow-hidden py-2",children:[e.jsxRuntimeExports.jsx("ul",{className:"sticky top-0 h-full w-48 space-y-1 overflow-y-auto border-r px-2",children:r?e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx("li",{className:"h-8 w-full animate-pulse bg-gray-200"}),e.jsxRuntimeExports.jsx("li",{className:"mt-2 h-8 w-full animate-pulse bg-gray-200"}),e.jsxRuntimeExports.jsx("li",{className:"mt-2 h-8 w-full animate-pulse bg-gray-200"}),e.jsxRuntimeExports.jsx("li",{className:"mt-2 h-8 w-full animate-pulse bg-gray-200"}),e.jsxRuntimeExports.jsx("li",{className:"mt-2 h-8 w-full animate-pulse bg-gray-200"}),e.jsxRuntimeExports.jsx("li",{className:"mt-2 h-8 w-full animate-pulse bg-gray-200"})]}):n.Children.toArray(s.map(i,(a,h)=>e.jsxRuntimeExports.jsx("li",{onMouseOut:()=>{clearTimeout(p),u(null)},onMouseEnter:()=>{const B=setTimeout(()=>{j(h)},300);u(B)},onClick:()=>j(h),className:L.cn("-mx-2 cursor-default rounded-md rounded-r-none px-2 py-1 text-sm font-medium capitalize",g===h?"bg-blue-500 text-white":" text-gray-700 hover:bg-foreground/10"),children:h})))}),e.jsxRuntimeExports.jsx("div",{className:"h-full w-full space-y-2 overflow-y-auto px-8",children:n.Children.toArray(R.map(a=>e.jsxRuntimeExports.jsx(F,{block:a,closePopover:()=>E(!1)})))})]})},D=()=>{const[t,r]=n.useState(""),{addPredefinedBlock:o}=l.useAddBlock(),[c]=l.useSelectedBlockIds(),[,x]=b.useAtom(l.addBlockOffCanvasAtom),[,m]=b.useAtom(l.activePanelAtom),[,p]=b.useAtom(l.addBlocksModalAtom),u=()=>{const i=S.getBlocksFromHTML(t);o([...i],s.first(c)||null),r(""),x(!1),m("layers"),p(!1)};return e.jsxRuntimeExports.jsxs(f.Card,{className:"border-border/0 p-0 shadow-none",children:[e.jsxRuntimeExports.jsxs(f.CardHeader,{className:"p-3",children:[e.jsxRuntimeExports.jsx(f.CardTitle,{children:"Import HTML"}),e.jsxRuntimeExports.jsx(f.CardDescription,{children:"Use HTML snippets from component libraries like Tailwind UI, Flowbite, Preline, Kitwind, Tailblocks etc. or just copy paste your own HTML code. Only Tailwind CSS markup is supported."})]}),e.jsxRuntimeExports.jsx(f.CardContent,{className:"space-y-2 px-3 py-0",children:e.jsxRuntimeExports.jsxs("div",{className:"space-y-1",children:[e.jsxRuntimeExports.jsx(P.Label,{htmlFor:"current",className:"text-sm",children:"Enter HTML Code:"}),e.jsxRuntimeExports.jsx(f.Textarea,{autoFocus:!0,tabIndex:1,ref:i=>i&&i.focus(),defaultValue:t,onChange:i=>r(i.target.value),rows:12,placeholder:`<div>
2
+ <h1>Enter code here</h1>
3
+ </div>`,className:"resize-none overflow-x-auto whitespace-pre font-mono font-normal"})]})}),e.jsxRuntimeExports.jsxs(f.CardFooter,{className:"flex flex-col justify-end p-3",children:[e.jsxRuntimeExports.jsx(y.Button,{disabled:t.trim()==="",onClick:()=>u(),size:"sm",className:"w-full",children:"Import"}),e.jsxRuntimeExports.jsxs(f.Alert,{variant:"default",className:"mt-2 p-1 text-blue-400",children:[e.jsxRuntimeExports.jsx(C.ExclamationTriangleIcon,{className:"h-4 w-4"}),e.jsxRuntimeExports.jsx(f.AlertTitle,{className:"text-sm leading-4",children:"Imported html will be added to the currently selected block. If no block is selected, the html will be added to the page."})]})]})]})},O=D,N=["ListItem","TableHead","TableBody","TableRow","TableCell","Column"],U=(t,r)=>{if(!t)return!s.includes(N,r);const o=t._type;return o==="List"?r==="ListItem":o==="Table"?r==="TableHead"||r==="TableBody":o==="TableHead"||o==="TableBody"?r==="TableRow":o==="TableRow"?r==="TableCell":o==="Row"?r==="Column":!s.includes(N,r)},z=()=>{const[t,r]=n.useState("core"),[o,c]=n.useState("basic"),x=T.useChaiBlocks(),[,m]=b.useAtom(l.showPredefinedBlockCategoryAtom),[,p]=b.useAtom(l.addBlocksModalAtom),[u]=l.useSelectedBlockIds(),i=l.useAllBlocks(),E=s.find(i,{_id:s.first(u)}),{data:g,isLoading:j}=l.useUILibraryBlocks(),R=s.groupBy(s.filter(x,d=>U(E,d.type)),"category"),a=s.uniq(s.map(R.core,"group"));n.useEffect(()=>{!s.includes(a,o)&&!s.isEmpty(a)&&!s.isEmpty(o)&&c(s.first(a))},[a,o]);const h=d=>c(A=>A===d?"":d),B=!j&&!s.isEmpty(g);return e.jsxRuntimeExports.jsxs("div",{className:"flex h-full flex-col overflow-hidden",children:[e.jsxRuntimeExports.jsxs("div",{className:"mb-2 flex justify-between rounded-md bg-background/30 p-1",children:[e.jsxRuntimeExports.jsxs("h1",{className:"flex flex-col items-baseline px-1 text-2xl font-semibold xl:flex-row",children:["Add block",e.jsxRuntimeExports.jsx("span",{className:"p-0 text-xs font-light leading-3 opacity-80 xl:pl-1",children:t==="html"?"(Enter or paste your own HTML code)":"(Drag & drop into tree view or click to add)"})]}),e.jsxRuntimeExports.jsxs("button",{onClick:()=>p(!1),className:"flex h-max items-center gap-x-1 rounded-full border p-px text-xs text-gray-800 hover:bg-gray-100 md:p-2",children:[e.jsxRuntimeExports.jsx(C.Cross1Icon,{width:12})," Close"]})]}),e.jsxRuntimeExports.jsx(k.Tabs,{onValueChange:d=>{m(""),r(d)},value:t,className:"h-max",children:e.jsxRuntimeExports.jsxs(k.TabsList,{className:"grid w-full "+(B?"grid-cols-3":"grid-cols-2"),children:[e.jsxRuntimeExports.jsx(k.TabsTrigger,{value:"core",children:"Core"}),B?e.jsxRuntimeExports.jsx(k.TabsTrigger,{value:"ui-blocks",children:"UI Blocks"}):null,e.jsxRuntimeExports.jsx(k.TabsTrigger,{value:"html",children:"Import"})]})}),t==="core"&&e.jsxRuntimeExports.jsx(q.ScrollArea,{className:"-mx-1.5 h-full",children:e.jsxRuntimeExports.jsx(w.Accordion,{type:"single",value:o,className:"w-full px-3",children:n.Children.toArray(s.map(a,d=>s.reject(s.filter(s.values(R.core),{group:d}),{hidden:!0}).length?e.jsxRuntimeExports.jsxs(w.AccordionItem,{value:d,className:"border-border",children:[e.jsxRuntimeExports.jsx(w.AccordionTrigger,{onClick:()=>h(d),className:"py-2 capitalize",children:d}),e.jsxRuntimeExports.jsx(w.AccordionContent,{children:e.jsxRuntimeExports.jsx("div",{className:"grid grid-cols-4 gap-2",children:n.Children.toArray(s.reject(s.filter(s.values(R.core),{group:d}),{hidden:!0}).map(A=>e.jsxRuntimeExports.jsx(M,{block:A})))})})]}):null))})}),t==="ui-blocks"&&e.jsxRuntimeExports.jsx(n.Suspense,{fallback:e.jsxRuntimeExports.jsx(y.Skeleton,{className:"h-32 w-full"}),children:e.jsxRuntimeExports.jsx(H,{})}),t==="html"&&e.jsxRuntimeExports.jsx(O,{})]})};exports.default=z;
@@ -0,0 +1,258 @@
1
+ import { j as e } from "./jsx-runtime-944c88e2.js";
2
+ import B, { createElement as G, useState as j, useMemo as K, useCallback as V, useEffect as q, Suspense as W } from "react";
3
+ import { has as S, first as b, filter as w, values as A, groupBy as I, mergeWith as Q, isArray as H, get as $, map as L, isEmpty as k, find as J, uniq as X, includes as P, reject as M } from "lodash";
4
+ import { useAtom as h } from "jotai";
5
+ import { A as Y, a as Z, b as ee, c as se } from "./accordion-c0176dc5.js";
6
+ import { S as re } from "./scroll-area-9f64a082.js";
7
+ import { T as oe, a as te, b as N } from "./tabs-85caa1e8.js";
8
+ import { d as le, e as ae, f as ce, u as ne, B as ie, S as de } from "./useBuilderProp-81a14920.js";
9
+ import { useDrag as R, DragPreviewImage as _ } from "react-dnd";
10
+ import { BoxIcon as me, ExclamationTriangleIcon as ue, Cross1Icon as pe } from "@radix-ui/react-icons";
11
+ import { Q as F, h as T, a as O, b as C, T as U, U as xe, V as he, y as fe } from "./index-390f7bef.js";
12
+ import "react-i18next";
13
+ import { syncBlocksWithDefaults as z, useChaiBlocks as D } from "@chaibuilder/blocks";
14
+ import { Loader as ge } from "lucide-react";
15
+ import { c as be } from "./utils-ac68b2c8.js";
16
+ import { C as je, c as ye, e as we, f as ke, g as Be, T as Te, d as Ce, A as ve, a as Ne } from "./textarea-0750bcd2.js";
17
+ import { L as Ae } from "./label-e770a087.js";
18
+ import { g as Ie } from "./html-to-json-9304dbda.js";
19
+ import "@radix-ui/react-accordion";
20
+ import "@radix-ui/react-scroll-area";
21
+ import "@radix-ui/react-tabs";
22
+ import "@radix-ui/react-slot";
23
+ import "class-variance-authority";
24
+ import "@radix-ui/react-tooltip";
25
+ import "@radix-ui/react-toast";
26
+ import "i18next";
27
+ import "flagged";
28
+ import "@minoru/react-dnd-treeview";
29
+ import "react-hotkeys-hook";
30
+ import "flat-to-nested";
31
+ import "./Class-e34b2337.js";
32
+ import "redux-undo";
33
+ import "@react-hookz/web";
34
+ import "./CONTROLS-442caee5.js";
35
+ import "clsx";
36
+ import "tailwind-merge";
37
+ import "@radix-ui/react-label";
38
+ import "himalaya";
39
+ const Le = ({ block: s }) => {
40
+ const { type: r, icon: o, label: a } = s, { addCoreBlock: i, addPredefinedBlock: d } = F(), [m] = T(), [, n] = h(O), [, t] = h(C), f = () => {
41
+ S(s, "blocks") ? d(z(s.blocks), b(m)) : i(s, b(m)), t(!1), n("layers");
42
+ }, [, x, u] = R(() => ({
43
+ type: "CHAI_BLOCK",
44
+ item: s
45
+ }));
46
+ return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
47
+ /* @__PURE__ */ e.jsx(
48
+ _,
49
+ {
50
+ connect: u,
51
+ src: "https://placehold.co/100x30/000000/FFF?text=" + (a || r).replace(/ /g, "+")
52
+ }
53
+ ),
54
+ /* @__PURE__ */ e.jsxs(le, { children: [
55
+ /* @__PURE__ */ e.jsx(ae, { asChild: !0, children: /* @__PURE__ */ e.jsxs(
56
+ "button",
57
+ {
58
+ onClick: f,
59
+ type: "button",
60
+ ref: x,
61
+ className: "cursor-grab space-y-2 rounded-lg border border-border p-3 text-center hover:bg-slate-300/50",
62
+ children: [
63
+ G(o || me, { className: "w-4 h-4 mx-auto" }),
64
+ /* @__PURE__ */ e.jsx("p", { className: "truncate text-xs", children: a || r })
65
+ ]
66
+ }
67
+ ) }),
68
+ /* @__PURE__ */ e.jsx(ce, { children: /* @__PURE__ */ e.jsx("p", { children: a || r }) })
69
+ ] })
70
+ ] });
71
+ }, Pe = ({ block: s, closePopover: r }) => {
72
+ var u;
73
+ const [o, a] = j(!1), i = ne("getExternalPredefinedBlock"), { addCoreBlock: d, addPredefinedBlock: m } = F(), [n] = T(), [, t, f] = R(
74
+ () => ({
75
+ type: "CHAI_BLOCK",
76
+ item: s
77
+ }),
78
+ [s]
79
+ ), x = V(
80
+ async (g) => {
81
+ if (g.stopPropagation(), S(s, "component")) {
82
+ d(s, b(n)), r();
83
+ return;
84
+ }
85
+ a(!0);
86
+ const l = await i(s);
87
+ k(l) || m(z(l), b(n)), r();
88
+ },
89
+ [s]
90
+ );
91
+ return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
92
+ /* @__PURE__ */ e.jsx(
93
+ _,
94
+ {
95
+ connect: f,
96
+ src: "https://placehold.co/100x30/000000/FFF?text=" + ((u = s.name || s.label) == null ? void 0 : u.replace(" ", "+"))
97
+ }
98
+ ),
99
+ /* @__PURE__ */ e.jsxs(
100
+ "div",
101
+ {
102
+ ref: t,
103
+ onClick: o ? () => {
104
+ } : x,
105
+ className: "relative cursor-grab overflow-hidden rounded-md border border-transparent duration-200 hover:scale-x-105 hover:border-foreground/20 hover:shadow-2xl",
106
+ children: [
107
+ o && /* @__PURE__ */ e.jsxs("div", { className: "absolute flex h-full w-full items-center justify-center bg-black bg-opacity-70", children: [
108
+ /* @__PURE__ */ e.jsx(ge, { className: "animate-spin", size: 15, color: "white" }),
109
+ " ",
110
+ /* @__PURE__ */ e.jsx("span", { className: "pl-2 text-sm text-white", children: "Adding..." })
111
+ ] }),
112
+ s.preview ? /* @__PURE__ */ e.jsx("img", { src: s.preview, className: "min-h-[50px] w-full rounded-md border border-gray-300", alt: s.name }) : /* @__PURE__ */ e.jsx("div", { className: "flex h-20 items-center justify-center rounded-md border border-border border-gray-300 bg-gray-200", children: /* @__PURE__ */ e.jsx("p", { className: "max-w-xs text-center text-sm text-gray-700", children: s.name }) })
113
+ ]
114
+ }
115
+ )
116
+ ] });
117
+ }, Fe = () => {
118
+ const { data: s, isLoading: r } = U(), o = D(), a = w(A(o), { category: "custom" }), i = I(a, "group"), d = I(s, "group"), [m, n] = j(null), t = K(() => Q(i, d, (l, p) => {
119
+ if (H(l) && H(p))
120
+ return [...l, ...p];
121
+ }), [i, d]), [, f] = h(C), [x, u] = j("Navbar"), g = $(t, x, []);
122
+ return /* @__PURE__ */ e.jsxs("div", { className: "relative flex h-full max-h-full overflow-hidden py-2", children: [
123
+ /* @__PURE__ */ e.jsx("ul", { className: "sticky top-0 h-full w-48 space-y-1 overflow-y-auto border-r px-2", children: r ? /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
124
+ /* @__PURE__ */ e.jsx("li", { className: "h-8 w-full animate-pulse bg-gray-200" }),
125
+ /* @__PURE__ */ e.jsx("li", { className: "mt-2 h-8 w-full animate-pulse bg-gray-200" }),
126
+ /* @__PURE__ */ e.jsx("li", { className: "mt-2 h-8 w-full animate-pulse bg-gray-200" }),
127
+ /* @__PURE__ */ e.jsx("li", { className: "mt-2 h-8 w-full animate-pulse bg-gray-200" }),
128
+ /* @__PURE__ */ e.jsx("li", { className: "mt-2 h-8 w-full animate-pulse bg-gray-200" }),
129
+ /* @__PURE__ */ e.jsx("li", { className: "mt-2 h-8 w-full animate-pulse bg-gray-200" })
130
+ ] }) : B.Children.toArray(
131
+ L(t, (l, p) => /* @__PURE__ */ e.jsx(
132
+ "li",
133
+ {
134
+ onMouseOut: () => {
135
+ clearTimeout(m), n(null);
136
+ },
137
+ onMouseEnter: () => {
138
+ const y = setTimeout(() => {
139
+ u(p);
140
+ }, 300);
141
+ n(y);
142
+ },
143
+ onClick: () => u(p),
144
+ className: be(
145
+ "-mx-2 cursor-default rounded-md rounded-r-none px-2 py-1 text-sm font-medium capitalize",
146
+ x === p ? "bg-blue-500 text-white" : " text-gray-700 hover:bg-foreground/10"
147
+ ),
148
+ children: p
149
+ }
150
+ ))
151
+ ) }),
152
+ /* @__PURE__ */ e.jsx("div", { className: "h-full w-full space-y-2 overflow-y-auto px-8", children: B.Children.toArray(
153
+ g.map((l) => /* @__PURE__ */ e.jsx(Pe, { block: l, closePopover: () => f(!1) }))
154
+ ) })
155
+ ] });
156
+ }, He = () => {
157
+ const [s, r] = j(""), { addPredefinedBlock: o } = F(), [a] = T(), [, i] = h(xe), [, d] = h(O), [, m] = h(C), n = () => {
158
+ const t = Ie(s);
159
+ o([...t], b(a) || null), r(""), i(!1), d("layers"), m(!1);
160
+ };
161
+ return /* @__PURE__ */ e.jsxs(je, { className: "border-border/0 p-0 shadow-none", children: [
162
+ /* @__PURE__ */ e.jsxs(ye, { className: "p-3", children: [
163
+ /* @__PURE__ */ e.jsx(we, { children: "Import HTML" }),
164
+ /* @__PURE__ */ e.jsx(ke, { children: "Use HTML snippets from component libraries like Tailwind UI, Flowbite, Preline, Kitwind, Tailblocks etc. or just copy paste your own HTML code. Only Tailwind CSS markup is supported." })
165
+ ] }),
166
+ /* @__PURE__ */ e.jsx(Be, { className: "space-y-2 px-3 py-0", children: /* @__PURE__ */ e.jsxs("div", { className: "space-y-1", children: [
167
+ /* @__PURE__ */ e.jsx(Ae, { htmlFor: "current", className: "text-sm", children: "Enter HTML Code:" }),
168
+ /* @__PURE__ */ e.jsx(
169
+ Te,
170
+ {
171
+ autoFocus: !0,
172
+ tabIndex: 1,
173
+ ref: (t) => t && t.focus(),
174
+ defaultValue: s,
175
+ onChange: (t) => r(t.target.value),
176
+ rows: 12,
177
+ placeholder: `<div>
178
+ <h1>Enter code here</h1>
179
+ </div>`,
180
+ className: "resize-none overflow-x-auto whitespace-pre font-mono font-normal"
181
+ }
182
+ )
183
+ ] }) }),
184
+ /* @__PURE__ */ e.jsxs(Ce, { className: "flex flex-col justify-end p-3", children: [
185
+ /* @__PURE__ */ e.jsx(ie, { disabled: s.trim() === "", onClick: () => n(), size: "sm", className: "w-full", children: "Import" }),
186
+ /* @__PURE__ */ e.jsxs(ve, { variant: "default", className: "mt-2 p-1 text-blue-400", children: [
187
+ /* @__PURE__ */ e.jsx(ue, { className: "h-4 w-4" }),
188
+ /* @__PURE__ */ e.jsx(Ne, { className: "text-sm leading-4", children: "Imported html will be added to the currently selected block. If no block is selected, the html will be added to the page." })
189
+ ] })
190
+ ] })
191
+ ] });
192
+ }, Me = He, E = ["ListItem", "TableHead", "TableBody", "TableRow", "TableCell", "Column"], Ee = (s, r) => {
193
+ if (!s)
194
+ return !P(E, r);
195
+ const o = s._type;
196
+ return o === "List" ? r === "ListItem" : o === "Table" ? r === "TableHead" || r === "TableBody" : o === "TableHead" || o === "TableBody" ? r === "TableRow" : o === "TableRow" ? r === "TableCell" : o === "Row" ? r === "Column" : !P(E, r);
197
+ }, ys = () => {
198
+ const [s, r] = j("core"), [o, a] = j("basic"), i = D(), [, d] = h(he), [, m] = h(C), [n] = T(), t = fe(), f = J(t, { _id: b(n) }), { data: x, isLoading: u } = U(), g = I(
199
+ w(i, (c) => Ee(f, c.type)),
200
+ "category"
201
+ ), l = X(L(g.core, "group"));
202
+ q(() => {
203
+ !P(l, o) && !k(l) && !k(o) && a(b(l));
204
+ }, [l, o]);
205
+ const p = (c) => a((v) => v === c ? "" : c), y = !u && !k(x);
206
+ return /* @__PURE__ */ e.jsxs("div", { className: "flex h-full flex-col overflow-hidden", children: [
207
+ /* @__PURE__ */ e.jsxs("div", { className: "mb-2 flex justify-between rounded-md bg-background/30 p-1", children: [
208
+ /* @__PURE__ */ e.jsxs("h1", { className: "flex flex-col items-baseline px-1 text-2xl font-semibold xl:flex-row", children: [
209
+ "Add block",
210
+ /* @__PURE__ */ e.jsx("span", { className: "p-0 text-xs font-light leading-3 opacity-80 xl:pl-1", children: s === "html" ? "(Enter or paste your own HTML code)" : "(Drag & drop into tree view or click to add)" })
211
+ ] }),
212
+ /* @__PURE__ */ e.jsxs(
213
+ "button",
214
+ {
215
+ onClick: () => m(!1),
216
+ className: "flex h-max items-center gap-x-1 rounded-full border p-px text-xs text-gray-800 hover:bg-gray-100 md:p-2",
217
+ children: [
218
+ /* @__PURE__ */ e.jsx(pe, { width: 12 }),
219
+ " Close"
220
+ ]
221
+ }
222
+ )
223
+ ] }),
224
+ /* @__PURE__ */ e.jsx(
225
+ oe,
226
+ {
227
+ onValueChange: (c) => {
228
+ d(""), r(c);
229
+ },
230
+ value: s,
231
+ className: "h-max",
232
+ children: /* @__PURE__ */ e.jsxs(te, { className: "grid w-full " + (y ? "grid-cols-3" : "grid-cols-2"), children: [
233
+ /* @__PURE__ */ e.jsx(N, { value: "core", children: "Core" }),
234
+ y ? /* @__PURE__ */ e.jsx(N, { value: "ui-blocks", children: "UI Blocks" }) : null,
235
+ /* @__PURE__ */ e.jsx(N, { value: "html", children: "Import" })
236
+ ] })
237
+ }
238
+ ),
239
+ s === "core" && /* @__PURE__ */ e.jsx(re, { className: "-mx-1.5 h-full", children: /* @__PURE__ */ e.jsx(Y, { type: "single", value: o, className: "w-full px-3", children: B.Children.toArray(
240
+ L(
241
+ l,
242
+ (c) => M(w(A(g.core), { group: c }), {
243
+ hidden: !0
244
+ }).length ? /* @__PURE__ */ e.jsxs(Z, { value: c, className: "border-border", children: [
245
+ /* @__PURE__ */ e.jsx(ee, { onClick: () => p(c), className: "py-2 capitalize", children: c }),
246
+ /* @__PURE__ */ e.jsx(se, { children: /* @__PURE__ */ e.jsx("div", { className: "grid grid-cols-4 gap-2", children: B.Children.toArray(
247
+ M(w(A(g.core), { group: c }), { hidden: !0 }).map((v) => /* @__PURE__ */ e.jsx(Le, { block: v }))
248
+ ) }) })
249
+ ] }) : null
250
+ )
251
+ ) }) }),
252
+ s === "ui-blocks" && /* @__PURE__ */ e.jsx(W, { fallback: /* @__PURE__ */ e.jsx(de, { className: "h-32 w-full" }), children: /* @__PURE__ */ e.jsx(Fe, {}) }),
253
+ s === "html" && /* @__PURE__ */ e.jsx(Me, {})
254
+ ] });
255
+ };
256
+ export {
257
+ ys as default
258
+ };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./jsx-runtime-5c3ac4f7.cjs"),C=require("react"),q=require("@rjsf/validator-ajv8"),B=require("@rjsf/core"),_=require("./index-506fb888.cjs");require("react-i18next");const j=require("./useBuilderProp-5e57d0c8.cjs"),e=require("@chaibuilder/blocks");require("i18next");require("flagged");require("react-dnd");require("lodash");require("@minoru/react-dnd-treeview");require("jotai");require("./utils-3c452dd0.cjs");require("clsx");require("tailwind-merge");require("react-hotkeys-hook");require("flat-to-nested");require("./Class-0801d193.cjs");require("redux-undo");require("@react-hookz/web");require("./CONTROLS-031e1de3.cjs");require("@radix-ui/react-slot");require("class-variance-authority");require("@radix-ui/react-tooltip");require("@radix-ui/react-icons");require("@radix-ui/react-toast");function R(t){const a=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const i in t)if(i!=="default"){const r=Object.getOwnPropertyDescriptor(t,i);Object.defineProperty(a,i,r.get?r:{enumerable:!0,get:()=>t[i]})}}return a.default=t,Object.freeze(a)}const c=R(C),v=[{title:"Roboto",value:"Roboto"},{title:"Open Sans",value:"Open Sans"},{title:"Montserrat",value:"Montserrat"},{title:"Lato",value:"Lato"},{title:"Poppins",value:"Poppins"},{title:"Oswald",value:"Oswald"},{title:"Raleway",value:"Raleway"},{title:"Ubuntu",value:"Ubuntu"},{title:"Nunito",value:"Nunito"},{title:"Merriweather",value:"Merriweather"},{title:"Nunito Sans",value:"Nunito Sans"},{title:"Playfair Display",value:"Playfair Display"},{title:"Rubik",value:"Rubik"},{title:"Inter",value:"Inter"},{title:"Lora",value:"Lora"},{title:"Kanit",value:"Kanit"},{title:"Fira Sans",value:"Fira Sans"},{title:"Hind",value:"Hind"},{title:"Quicksand",value:"Quicksand"},{title:"Mulish",value:"Mulish"},{title:"Barlow",value:"Barlow"},{title:"Inconsolata",value:"Inconsolata"},{title:"Titillium Web",value:"Titillium Web"},{title:"Heebo",value:"Heebo"},{title:"IBM Plex Sans",value:"IBM Plex Sans"},{title:"DM Sans",value:"DM Sans"},{title:"Nanum Gothic",value:"Nanum Gothic"},{title:"Karla",value:"Karla"},{title:"Arimo",value:"Arimo"},{title:"Cabin",value:"Cabin"},{title:"Oxygen",value:"Oxygen"},{title:"Overpass",value:"Overpass"},{title:"Assistant",value:"Assistant"},{title:"Tajawal",value:"Tajawal"},{title:"Play",value:"Play"},{title:"Exo",value:"Exo"},{title:"Cinzel",value:"Cinzel"},{title:"Faustina",value:"Faustina"},{title:"Philosopher",value:"Philosopher"},{title:"Gelasio",value:"Gelasio"},{title:"Sofia Sans Condensed",value:"Sofia Sans Condensed"},{title:"Noto Sans Devanagari",value:"Noto Sans Devanagari"},{title:"Actor",value:"Actor"},{title:"Epilogue",value:"Epilogue"},{title:"Glegoo",value:"Glegoo"},{title:"Overlock",value:"Overlock"},{title:"Lustria",value:"Lustria"},{title:"Ovo",value:"Ovo"},{title:"Suranna",value:"Suranna"}],P=()=>{const t=j.useBuilderProp("onSaveBrandingOptions",async()=>{}),[a,i]=_.useBrandingOptions(),r=c.useRef(a);c.useEffect(()=>()=>t(r.current),[r]);const p=({formData:l},u)=>{u&&(i(l),r.current=l)},{_bodyFont:g,_headingFont:b,_primaryColor:f,_bodyTextDarkColor:m,_bodyTextLightColor:y,_bodyBgDarkColor:x,_secondaryColor:S,_bodyBgLightColor:h,_roundedCorners:O}=a,s={_headingFont:e.SelectOption({title:"Heading font",default:b,options:v}),_bodyFont:e.SelectOption({title:"Body font",default:g,options:v}),_roundedCorners:e.Numeric({title:"Rounded Corner",default:parseInt(O||5,10)}),_primaryColor:e.Color({title:"Primary",default:f}),_secondaryColor:e.Color({title:"Secondary",default:S}),_bodyBgLightColor:e.Color({title:"Body Background (Light)",default:h}),_bodyBgDarkColor:e.Color({title:"Body Background (Dark)",default:x}),_bodyTextLightColor:e.Color({title:"Body Text (Light)",default:m}),_bodyTextDarkColor:e.Color({title:"Body Text (Dark)",default:y})},n={type:"object",properties:{}},d={};return Object.keys(s).forEach(l=>{const u=s[l];return n.properties||(n.properties={}),n.properties[l]=u.schema,d[l]=u.uiSchema,!0}),o.jsxRuntimeExports.jsxs("div",{className:"flex h-full select-none flex-col",children:[o.jsxRuntimeExports.jsx("div",{className:"rounded-md bg-background/30 p-1",children:o.jsxRuntimeExports.jsx("h1",{className:"px-1 font-semibold",children:"Branding Options"})}),o.jsxRuntimeExports.jsx("div",{className:"-mx-2",children:o.jsxRuntimeExports.jsx(B,{idSeparator:".",autoComplete:"off",omitExtraData:!0,liveOmit:!0,liveValidate:!0,uiSchema:d,schema:n,formData:a,validator:q,onChange:p})})]})};exports.default=P;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./jsx-runtime-5c3ac4f7.cjs"),C=require("react"),q=require("@rjsf/validator-ajv8"),B=require("@rjsf/core"),j=require("./index-ebd86d7f.cjs");require("react-i18next");const R=require("./useBuilderProp-5e57d0c8.cjs"),e=require("@chaibuilder/blocks");require("i18next");require("flagged");require("react-dnd");require("lodash");require("@minoru/react-dnd-treeview");require("jotai");require("./utils-3c452dd0.cjs");require("clsx");require("tailwind-merge");require("react-hotkeys-hook");require("flat-to-nested");require("./Class-7d6aadbc.cjs");require("redux-undo");require("@react-hookz/web");require("@radix-ui/react-icons");require("./CONTROLS-031e1de3.cjs");require("@radix-ui/react-slot");require("class-variance-authority");require("@radix-ui/react-tooltip");require("@radix-ui/react-toast");function P(t){const a=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const i in t)if(i!=="default"){const r=Object.getOwnPropertyDescriptor(t,i);Object.defineProperty(a,i,r.get?r:{enumerable:!0,get:()=>t[i]})}}return a.default=t,Object.freeze(a)}const c=P(C),v=[{title:"Roboto",value:"Roboto"},{title:"Open Sans",value:"Open Sans"},{title:"Montserrat",value:"Montserrat"},{title:"Lato",value:"Lato"},{title:"Poppins",value:"Poppins"},{title:"Oswald",value:"Oswald"},{title:"Raleway",value:"Raleway"},{title:"Ubuntu",value:"Ubuntu"},{title:"Nunito",value:"Nunito"},{title:"Merriweather",value:"Merriweather"},{title:"Nunito Sans",value:"Nunito Sans"},{title:"Playfair Display",value:"Playfair Display"},{title:"Rubik",value:"Rubik"},{title:"Inter",value:"Inter"},{title:"Lora",value:"Lora"},{title:"Kanit",value:"Kanit"},{title:"Fira Sans",value:"Fira Sans"},{title:"Hind",value:"Hind"},{title:"Quicksand",value:"Quicksand"},{title:"Mulish",value:"Mulish"},{title:"Barlow",value:"Barlow"},{title:"Inconsolata",value:"Inconsolata"},{title:"Titillium Web",value:"Titillium Web"},{title:"Heebo",value:"Heebo"},{title:"IBM Plex Sans",value:"IBM Plex Sans"},{title:"DM Sans",value:"DM Sans"},{title:"Nanum Gothic",value:"Nanum Gothic"},{title:"Karla",value:"Karla"},{title:"Arimo",value:"Arimo"},{title:"Cabin",value:"Cabin"},{title:"Oxygen",value:"Oxygen"},{title:"Overpass",value:"Overpass"},{title:"Assistant",value:"Assistant"},{title:"Tajawal",value:"Tajawal"},{title:"Play",value:"Play"},{title:"Exo",value:"Exo"},{title:"Cinzel",value:"Cinzel"},{title:"Faustina",value:"Faustina"},{title:"Philosopher",value:"Philosopher"},{title:"Gelasio",value:"Gelasio"},{title:"Sofia Sans Condensed",value:"Sofia Sans Condensed"},{title:"Noto Sans Devanagari",value:"Noto Sans Devanagari"},{title:"Actor",value:"Actor"},{title:"Epilogue",value:"Epilogue"},{title:"Glegoo",value:"Glegoo"},{title:"Overlock",value:"Overlock"},{title:"Lustria",value:"Lustria"},{title:"Ovo",value:"Ovo"},{title:"Suranna",value:"Suranna"}],k=()=>{const t=R.useBuilderProp("onSaveBrandingOptions",async()=>{}),[a,i]=j.useBrandingOptions(),r=c.useRef(a);c.useEffect(()=>()=>t(r.current),[r]);const p=({formData:l},u)=>{u&&(i(l),r.current=l)},{bodyFont:g,headingFont:b,primaryColor:f,bodyTextDarkColor:m,bodyTextLightColor:y,bodyBgDarkColor:x,secondaryColor:S,bodyBgLightColor:h,roundedCorners:O}=a,s={headingFont:e.SelectOption({title:"Heading font",default:b,options:v}),bodyFont:e.SelectOption({title:"Body font",default:g,options:v}),roundedCorners:e.Numeric({title:"Rounded Corner",default:parseInt(O||5,10)}),primaryColor:e.Color({title:"Primary",default:f}),secondaryColor:e.Color({title:"Secondary",default:S}),bodyBgLightColor:e.Color({title:"Body Background (Light)",default:h}),bodyBgDarkColor:e.Color({title:"Body Background (Dark)",default:x}),bodyTextLightColor:e.Color({title:"Body Text (Light)",default:m}),bodyTextDarkColor:e.Color({title:"Body Text (Dark)",default:y})},n={type:"object",properties:{}},d={};return Object.keys(s).forEach(l=>{const u=s[l];return n.properties||(n.properties={}),n.properties[l]=u.schema,d[l]=u.uiSchema,!0}),o.jsxRuntimeExports.jsxs("div",{className:"flex h-full select-none flex-col",children:[o.jsxRuntimeExports.jsx("div",{className:"rounded-md bg-background/30 p-1",children:o.jsxRuntimeExports.jsx("h1",{className:"px-1 font-semibold",children:"Branding Options"})}),o.jsxRuntimeExports.jsx("div",{className:"-mx-2",children:o.jsxRuntimeExports.jsx(B,{idSeparator:".",autoComplete:"off",omitExtraData:!0,liveOmit:!0,liveValidate:!0,uiSchema:d,schema:n,formData:a,validator:q,onChange:p})})]})};exports.default=k;
@@ -1,11 +1,11 @@
1
1
  import { j as a } from "./jsx-runtime-944c88e2.js";
2
2
  import * as s from "react";
3
3
  import B from "@rjsf/validator-ajv8";
4
- import _ from "@rjsf/core";
5
- import { w as k } from "./index-32d7b6e5.js";
4
+ import k from "@rjsf/core";
5
+ import { w as N } from "./index-390f7bef.js";
6
6
  import "react-i18next";
7
- import { u as N } from "./useBuilderProp-81a14920.js";
8
- import { SelectOption as p, Numeric as D, Color as e } from "@chaibuilder/blocks";
7
+ import { u as D } from "./useBuilderProp-81a14920.js";
8
+ import { SelectOption as p, Numeric as P, Color as e } from "@chaibuilder/blocks";
9
9
  import "i18next";
10
10
  import "flagged";
11
11
  import "react-dnd";
@@ -17,14 +17,14 @@ import "clsx";
17
17
  import "tailwind-merge";
18
18
  import "react-hotkeys-hook";
19
19
  import "flat-to-nested";
20
- import "./Class-e6b07b79.js";
20
+ import "./Class-e34b2337.js";
21
21
  import "redux-undo";
22
22
  import "@react-hookz/web";
23
+ import "@radix-ui/react-icons";
23
24
  import "./CONTROLS-442caee5.js";
24
25
  import "@radix-ui/react-slot";
25
26
  import "class-variance-authority";
26
27
  import "@radix-ui/react-tooltip";
27
- import "@radix-ui/react-icons";
28
28
  import "@radix-ui/react-toast";
29
29
  const d = [
30
30
  { title: "Roboto", value: "Roboto" },
@@ -77,51 +77,51 @@ const d = [
77
77
  { title: "Ovo", value: "Ovo" },
78
78
  { title: "Suranna", value: "Suranna" }
79
79
  ], at = () => {
80
- const v = N("onSaveBrandingOptions", async () => {
81
- }), [l, m] = k(), r = s.useRef(l);
80
+ const v = D("onSaveBrandingOptions", async () => {
81
+ }), [l, m] = N(), r = s.useRef(l);
82
82
  s.useEffect(() => () => v(r.current), [r]);
83
83
  const c = ({ formData: t }, i) => {
84
84
  i && (m(t), r.current = t);
85
85
  }, {
86
- _bodyFont: f,
87
- _headingFont: g,
88
- _primaryColor: y,
89
- _bodyTextDarkColor: h,
90
- _bodyTextLightColor: b,
91
- _bodyBgDarkColor: S,
92
- _secondaryColor: x,
93
- _bodyBgLightColor: C,
94
- _roundedCorners: O
86
+ bodyFont: f,
87
+ headingFont: g,
88
+ primaryColor: y,
89
+ bodyTextDarkColor: h,
90
+ bodyTextLightColor: b,
91
+ bodyBgDarkColor: S,
92
+ secondaryColor: x,
93
+ bodyBgLightColor: C,
94
+ roundedCorners: O
95
95
  } = l, n = {
96
- _headingFont: p({
96
+ headingFont: p({
97
97
  title: "Heading font",
98
98
  default: g,
99
99
  options: d
100
100
  }),
101
- _bodyFont: p({
101
+ bodyFont: p({
102
102
  title: "Body font",
103
103
  default: f,
104
104
  options: d
105
105
  }),
106
- _roundedCorners: D({
106
+ roundedCorners: P({
107
107
  title: "Rounded Corner",
108
108
  default: parseInt(O || 5, 10)
109
109
  }),
110
- _primaryColor: e({ title: "Primary", default: y }),
111
- _secondaryColor: e({ title: "Secondary", default: x }),
112
- _bodyBgLightColor: e({
110
+ primaryColor: e({ title: "Primary", default: y }),
111
+ secondaryColor: e({ title: "Secondary", default: x }),
112
+ bodyBgLightColor: e({
113
113
  title: "Body Background (Light)",
114
114
  default: C
115
115
  }),
116
- _bodyBgDarkColor: e({
116
+ bodyBgDarkColor: e({
117
117
  title: "Body Background (Dark)",
118
118
  default: S
119
119
  }),
120
- _bodyTextLightColor: e({
120
+ bodyTextLightColor: e({
121
121
  title: "Body Text (Light)",
122
122
  default: h
123
123
  }),
124
- _bodyTextDarkColor: e({
124
+ bodyTextDarkColor: e({
125
125
  title: "Body Text (Dark)",
126
126
  default: b
127
127
  })
@@ -136,7 +136,7 @@ const d = [
136
136
  }), /* @__PURE__ */ a.jsxs("div", { className: "flex h-full select-none flex-col", children: [
137
137
  /* @__PURE__ */ a.jsx("div", { className: "rounded-md bg-background/30 p-1", children: /* @__PURE__ */ a.jsx("h1", { className: "px-1 font-semibold", children: "Branding Options" }) }),
138
138
  /* @__PURE__ */ a.jsx("div", { className: "-mx-2", children: /* @__PURE__ */ a.jsx(
139
- _,
139
+ k,
140
140
  {
141
141
  idSeparator: ".",
142
142
  autoComplete: "off",
@@ -6,11 +6,12 @@ import G, { createElement as gt, useCallback as Q, useState as H, useEffect as F
6
6
  import { map as ie, includes as Me, toUpper as ye, round as St, isEmpty as ee, first as ce, get as $, memoize as Tt, find as jt, filter as Ze, isString as Je } from "lodash";
7
7
  import { ResetIcon as De, DotsVerticalIcon as Ct, MobileIcon as Be, LaptopIcon as kt, DesktopIcon as _t, EraserIcon as Rt, ZoomInIcon as At, ArrowUpIcon as Pt, CopyIcon as It, TrashIcon as Ot, DragHandleDots2Icon as Mt } from "@radix-ui/react-icons";
8
8
  import { B as le, u as Qe, S as et } from "./useBuilderProp-81a14920.js";
9
- import { c as ke, d as tt, e as _e, f as Dt, g as Bt, h as X, i as Z, j as $t, k as nt, l as rt, m as Nt, n as Lt, o as Ft, p as ot, q as st, u as Wt, r as qt, s as Ut, t as Yt, v as zt, w as Ht, x as Re, y as at, z as Kt, A as Vt, B as Gt, b as Xt, E as Zt } from "./index-32d7b6e5.js";
9
+ import { c as ke, d as tt, e as _e, f as Dt, g as Bt, h as X, i as Z, j as $t, k as nt, l as rt, m as Nt, n as Lt, o as Ft, p as ot, q as st, u as Wt, r as qt, s as Ut, t as Yt, v as zt, w as Ht, x as Re, y as at, z as Kt, A as Vt, B as Gt, b as Xt, E as Zt } from "./index-390f7bef.js";
10
10
  import { useTranslation as it } from "react-i18next";
11
11
  import { S as se } from "./separator-a80d065b.js";
12
- import { S as Jt, D as Qt, k as en, l as tn, p as nn, q as rn, n as on, H as sn, i as an, j as cn, A as ln, a as dn, b as un, c as fn, e as pn, f as hn, d as mn, h as yn, g as vn } from "./dropdown-menu-d912a52e.js";
13
- import { L as gn } from "./label-e770a087.js";
12
+ import { S as Jt, D as Qt, c as en, d as tn, h as nn, i as rn, f as on, H as sn, a as an, b as cn } from "./dropdown-menu-ae3ed09b.js";
13
+ import { L as ln } from "./label-e770a087.js";
14
+ import { A as dn, a as un, b as fn, c as pn, e as hn, f as mn, d as yn, h as vn, g as gn } from "./alert-dialog-ee98f47e.js";
14
15
  import { useAtom as te } from "jotai";
15
16
  import { flip as xn } from "@floating-ui/dom";
16
17
  import { useFloating as bn, shift as wn } from "@floating-ui/react-dom";
@@ -34,14 +35,14 @@ import "flagged";
34
35
  import "@minoru/react-dnd-treeview";
35
36
  import "react-hotkeys-hook";
36
37
  import "flat-to-nested";
37
- import "./Class-e6b07b79.js";
38
+ import "./Class-e34b2337.js";
38
39
  import "redux-undo";
39
40
  import "@radix-ui/react-separator";
40
41
  import "@radix-ui/react-switch";
41
- import "@radix-ui/react-alert-dialog";
42
42
  import "@radix-ui/react-hover-card";
43
43
  import "@radix-ui/react-dropdown-menu";
44
44
  import "@radix-ui/react-label";
45
+ import "@radix-ui/react-alert-dialog";
45
46
  const Rn = () => {
46
47
  const { undoCount: e, redoCount: n, undo: r, redo: i } = ke();
47
48
  return /* @__PURE__ */ t.jsxs("div", { className: "flex items-center", children: [
@@ -52,7 +53,7 @@ const Rn = () => {
52
53
  function An() {
53
54
  const [e, n] = tt(), { t: r } = it();
54
55
  return /* @__PURE__ */ t.jsxs("div", { className: "flex items-center", children: [
55
- /* @__PURE__ */ t.jsx(gn, { htmlFor: "dark-mode-switch", children: r("dark_mode") }),
56
+ /* @__PURE__ */ t.jsx(ln, { htmlFor: "dark-mode-switch", children: r("dark_mode") }),
56
57
  /* @__PURE__ */ t.jsxs(
57
58
  Jt,
58
59
  {
@@ -197,19 +198,19 @@ const Le = ({ landscape: e = !1 }) => /* @__PURE__ */ t.jsxs(
197
198
  const [e] = Bt(), { createSnapshot: n } = ke(), [, r] = X(), [, i] = Z(), d = Q(() => {
198
199
  e([]), r([]), i([]), n();
199
200
  }, [e, n]);
200
- return /* @__PURE__ */ t.jsx("div", { className: "flex items-center", children: /* @__PURE__ */ t.jsxs(ln, { children: [
201
- /* @__PURE__ */ t.jsx(dn, { asChild: !0, children: /* @__PURE__ */ t.jsxs(le, { size: "sm", variant: "ghost", className: "flex items-center gap-x-1", children: [
201
+ return /* @__PURE__ */ t.jsx("div", { className: "flex items-center", children: /* @__PURE__ */ t.jsxs(dn, { children: [
202
+ /* @__PURE__ */ t.jsx(un, { asChild: !0, children: /* @__PURE__ */ t.jsxs(le, { size: "sm", variant: "ghost", className: "flex items-center gap-x-1", children: [
202
203
  /* @__PURE__ */ t.jsx(Rt, {}),
203
204
  " Clear"
204
205
  ] }) }),
205
- /* @__PURE__ */ t.jsxs(un, { className: "border-border", children: [
206
- /* @__PURE__ */ t.jsxs(fn, { children: [
207
- /* @__PURE__ */ t.jsx(pn, { children: "Clear whole canvas?" }),
208
- /* @__PURE__ */ t.jsx(hn, { children: "Are you sure you want to clear the whole canvas?" })
206
+ /* @__PURE__ */ t.jsxs(fn, { className: "border-border", children: [
207
+ /* @__PURE__ */ t.jsxs(pn, { children: [
208
+ /* @__PURE__ */ t.jsx(hn, { children: "Clear whole canvas?" }),
209
+ /* @__PURE__ */ t.jsx(mn, { children: "Are you sure you want to clear the whole canvas?" })
209
210
  ] }),
210
- /* @__PURE__ */ t.jsxs(mn, { children: [
211
- /* @__PURE__ */ t.jsx(yn, { children: "Cancel" }),
212
- /* @__PURE__ */ t.jsx(vn, { onClick: d, children: "Yes" })
211
+ /* @__PURE__ */ t.jsxs(yn, { children: [
212
+ /* @__PURE__ */ t.jsx(vn, { children: "Cancel" }),
213
+ /* @__PURE__ */ t.jsx(gn, { onClick: d, children: "Yes" })
213
214
  ] })
214
215
  ] })
215
216
  ] }) });
@@ -965,7 +966,7 @@ const L = /* @__PURE__ */ _n(zn);
965
966
  let ut, ft;
966
967
  typeof document < "u" && (ut = document);
967
968
  typeof window < "u" && (ft = window);
968
- const pt = G.createContext({ document: ut, window: ft }), Pe = () => G.useContext(pt), { Provider: Hn, Consumer: Xr } = pt;
969
+ const pt = G.createContext({ document: ut, window: ft }), Pe = () => G.useContext(pt), { Provider: Hn, Consumer: Zr } = pt;
969
970
  class ht extends Xe {
970
971
  componentDidMount() {
971
972
  this.props.contentDidMount();
@@ -1423,7 +1424,7 @@ const or = () => {
1423
1424
  )
1424
1425
  }
1425
1426
  );
1426
- }, ir = wt(() => import("./AddBlocks-e047b93d.js")), Zr = () => {
1427
+ }, ir = wt(() => import("./AddBlocks-c195f577.js")), Jr = () => {
1427
1428
  const e = Qe("mode", ve.STATIC), [n, r] = te(Xt), i = {
1428
1429
  [ve.STATIC]: /* @__PURE__ */ t.jsx(ar, {}),
1429
1430
  [ve.FRAMEWORK]: null
@@ -1451,5 +1452,5 @@ const or = () => {
1451
1452
  ] });
1452
1453
  };
1453
1454
  export {
1454
- Zr as default
1455
+ Jr as default
1455
1456
  };