@chaibuilder/sdk 0.1.7 → 0.1.8

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 (64) hide show
  1. package/dist/AddBlocks-4e50ad65.cjs +3 -0
  2. package/dist/{AddBlocks-0d80d14e.js → AddBlocks-619d3dde.js} +26 -27
  3. package/dist/{BrandingOptions-2eb3a20f.js → BrandingOptions-05634eee.js} +5 -4
  4. package/dist/BrandingOptions-d2a7778f.cjs +1 -0
  5. package/dist/{CanvasArea-366fc7f5.js → CanvasArea-8f96a9f5.js} +91 -90
  6. package/dist/{CanvasArea-35fe4de9.cjs → CanvasArea-f26157c0.cjs} +7 -7
  7. package/dist/CurrentPage-0663041c.cjs +1 -0
  8. package/dist/CurrentPage-d372a5a9.js +85 -0
  9. package/dist/Layers-57457feb.cjs +1 -0
  10. package/dist/{Layers-c375ab6b.js → Layers-5da1d796.js} +13 -12
  11. package/dist/{MarkAsGlobalBlock-3ecff4e8.js → MarkAsGlobalBlock-1a0d0725.js} +7 -6
  12. package/dist/MarkAsGlobalBlock-dd53daec.cjs +1 -0
  13. package/dist/PagesPanel-113739d6.cjs +1 -0
  14. package/dist/{PagesPanel-28b02d06.js → PagesPanel-42dba988.js} +5 -4
  15. package/dist/{ProjectPanel-e6e95d71.js → ProjectPanel-7e26e6a3.js} +6 -5
  16. package/dist/ProjectPanel-ee6b71ab.cjs +1 -0
  17. package/dist/Settings-9f28c157.cjs +1 -0
  18. package/dist/{Settings-4c13f136.js → Settings-cdaf197a.js} +5 -4
  19. package/dist/{SidePanels-0f011b5d.js → SidePanels-7757f767.js} +6 -5
  20. package/dist/SidePanels-ce2deb33.cjs +1 -0
  21. package/dist/{Topbar-d609b15e.js → Topbar-73c9aa97.js} +5 -4
  22. package/dist/Topbar-7600678e.cjs +1 -0
  23. package/dist/{add-page-modal-fb1e7f3d.js → add-page-modal-96a1f8dc.js} +18 -17
  24. package/dist/add-page-modal-eb896eef.cjs +1 -0
  25. package/dist/core.cjs +1 -1
  26. package/dist/core.js +48 -47
  27. package/dist/delete-page-modal-306dab3c.cjs +1 -0
  28. package/dist/{delete-page-modal-1e7c44c4.js → delete-page-modal-aabd460d.js} +5 -4
  29. package/dist/{Class-1fb4c0c4.js → html-to-json-eb4de645.js} +363 -190
  30. package/dist/html-to-json-feece010.cjs +1 -0
  31. package/dist/{index-0f2acc34.js → index-38bc7894.js} +1874 -1809
  32. package/dist/index-94612af5.cjs +2 -0
  33. package/dist/lib.cjs +1 -1
  34. package/dist/lib.js +20 -21
  35. package/dist/{page-viewer-791fb7c7.js → page-viewer-be5d5315.js} +9 -8
  36. package/dist/page-viewer-f60c4980.cjs +1 -0
  37. package/dist/{project-general-setting-b8508aa1.cjs → project-general-setting-bebd5cb1.cjs} +1 -1
  38. package/dist/{project-general-setting-ba6333d9.js → project-general-setting-cc9b43cd.js} +5 -4
  39. package/dist/render.cjs +2 -2
  40. package/dist/render.d.ts +12 -14
  41. package/dist/render.js +74 -71
  42. package/dist/server.cjs +1 -1
  43. package/dist/server.d.ts +38 -24
  44. package/dist/server.js +23 -16
  45. package/dist/{single-page-detail-69dd268b.js → single-page-detail-33436195.js} +6 -5
  46. package/dist/single-page-detail-584589e0.cjs +1 -0
  47. package/package.json +2 -1
  48. package/dist/AddBlocks-263e048b.cjs +0 -3
  49. package/dist/BrandingOptions-fe2c729f.cjs +0 -1
  50. package/dist/Class-6c695ccb.cjs +0 -1
  51. package/dist/Layers-ec26b885.cjs +0 -1
  52. package/dist/MarkAsGlobalBlock-b60aa4a5.cjs +0 -1
  53. package/dist/PagesPanel-27e831e4.cjs +0 -1
  54. package/dist/ProjectPanel-d77ca4b1.cjs +0 -1
  55. package/dist/Settings-f533682d.cjs +0 -1
  56. package/dist/SidePanels-8a461fbd.cjs +0 -1
  57. package/dist/Topbar-e3b28705.cjs +0 -1
  58. package/dist/add-page-modal-345f02a4.cjs +0 -1
  59. package/dist/delete-page-modal-83b69ad2.cjs +0 -1
  60. package/dist/html-to-json-01cc5fe0.cjs +0 -1
  61. package/dist/html-to-json-d20aafdd.js +0 -178
  62. package/dist/index-334beafe.cjs +0 -2
  63. package/dist/page-viewer-83157368.cjs +0 -1
  64. package/dist/single-page-detail-a186cd56.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-94612af5.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-feece010.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("redux-undo");require("@react-hookz/web");require("./MODIFIERS-70fef873.cjs");require("sonner");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;
@@ -1,21 +1,21 @@
1
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 W, Suspense as q } from "react";
3
- import { has as S, first as b, filter as w, values as A, groupBy as I, mergeWith as $, isArray as H, get as J, map as L, isEmpty as k, find as Q, uniq as X, includes as P, reject as M } from "lodash";
2
+ import B, { createElement as U, useState as j, useMemo as K, useCallback as W, useEffect as q, Suspense as V } from "react";
3
+ import { has as S, first as b, filter as w, values as A, groupBy as I, mergeWith as X, isArray as H, get as Y, map as L, isEmpty as k, find as $, uniq as J, includes as P, reject as M } from "lodash";
4
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";
5
+ import { A as Q, a as Z, b as ee, c as se } from "./accordion-c0176dc5.js";
6
6
  import { S as re } from "./scroll-area-9f64a082.js";
7
7
  import { T as oe, a as te, b as N } from "./tabs-85caa1e8.js";
8
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
9
  import { useDrag as R, DragPreviewImage as _ } from "react-dnd";
10
10
  import { BoxIcon as me, ExclamationTriangleIcon as ue, Cross1Icon as pe } from "@radix-ui/react-icons";
11
- import { R as F, h as C, a as O, b as T, U, V as xe, W as he, y as fe } from "./index-0f2acc34.js";
11
+ import { T as F, h as T, a as O, b as C, W as z, X as xe, Y as he, y as fe } from "./index-38bc7894.js";
12
12
  import "react-i18next";
13
- import { syncBlocksWithDefaults as z, useChaiBlocks as D } from "@chaibuilder/blocks";
13
+ import { syncBlocksWithDefaults as D, useChaiBlocks as G } from "@chaibuilder/blocks";
14
14
  import { Loader as ge } from "lucide-react";
15
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 Ce, d as Te, A as ve, a as Ne } from "./textarea-0750bcd2.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
17
  import { L as Ae } from "./label-e770a087.js";
18
- import { g as Ie } from "./html-to-json-d20aafdd.js";
18
+ import { b as Ie } from "./html-to-json-eb4de645.js";
19
19
  import "@radix-ui/react-accordion";
20
20
  import "@radix-ui/react-scroll-area";
21
21
  import "@radix-ui/react-tabs";
@@ -28,18 +28,17 @@ import "flagged";
28
28
  import "@minoru/react-dnd-treeview";
29
29
  import "react-hotkeys-hook";
30
30
  import "flat-to-nested";
31
- import "./Class-1fb4c0c4.js";
32
- import "./MODIFIERS-c2e02614.js";
33
31
  import "redux-undo";
34
32
  import "@react-hookz/web";
33
+ import "./MODIFIERS-c2e02614.js";
35
34
  import "sonner";
36
35
  import "clsx";
37
36
  import "tailwind-merge";
38
37
  import "@radix-ui/react-label";
39
38
  import "himalaya";
40
39
  const Le = ({ block: s }) => {
41
- const { type: r, icon: o, label: a } = s, { addCoreBlock: i, addPredefinedBlock: d } = F(), [m] = C(), [, n] = h(O), [, t] = h(T), f = () => {
42
- S(s, "blocks") ? d(z(s.blocks), b(m)) : i(s, b(m)), t(!1), n("layers");
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(D(s.blocks), b(m)) : i(s, b(m)), t(!1), n("layers");
43
42
  }, [, x, u] = R(() => ({
44
43
  type: "CHAI_BLOCK",
45
44
  item: s
@@ -61,7 +60,7 @@ const Le = ({ block: s }) => {
61
60
  ref: x,
62
61
  className: "cursor-grab space-y-2 rounded-lg border border-border p-3 text-center hover:bg-slate-300/50",
63
62
  children: [
64
- G(o || me, { className: "w-4 h-4 mx-auto" }),
63
+ U(o || me, { className: "w-4 h-4 mx-auto" }),
65
64
  /* @__PURE__ */ e.jsx("p", { className: "truncate text-xs", children: a || r })
66
65
  ]
67
66
  }
@@ -71,13 +70,13 @@ const Le = ({ block: s }) => {
71
70
  ] });
72
71
  }, Pe = ({ block: s, closePopover: r }) => {
73
72
  var u;
74
- const [o, a] = j(!1), i = ne("getExternalPredefinedBlock"), { addCoreBlock: d, addPredefinedBlock: m } = F(), [n] = C(), [, t, f] = R(
73
+ const [o, a] = j(!1), i = ne("getExternalPredefinedBlock"), { addCoreBlock: d, addPredefinedBlock: m } = F(), [n] = T(), [, t, f] = R(
75
74
  () => ({
76
75
  type: "CHAI_BLOCK",
77
76
  item: s
78
77
  }),
79
78
  [s]
80
- ), x = V(
79
+ ), x = W(
81
80
  async (g) => {
82
81
  if (g.stopPropagation(), S(s, "component")) {
83
82
  d(s, b(n)), r();
@@ -85,7 +84,7 @@ const Le = ({ block: s }) => {
85
84
  }
86
85
  a(!0);
87
86
  const l = await i(s);
88
- k(l) || m(z(l), b(n)), r();
87
+ k(l) || m(D(l), b(n)), r();
89
88
  },
90
89
  [s]
91
90
  );
@@ -116,10 +115,10 @@ const Le = ({ block: s }) => {
116
115
  )
117
116
  ] });
118
117
  }, Fe = () => {
119
- 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(() => $(i, d, (l, p) => {
118
+ const { data: s, isLoading: r } = z(), o = G(), a = w(A(o), { category: "custom" }), i = I(a, "group"), d = I(s, "group"), [m, n] = j(null), t = K(() => X(i, d, (l, p) => {
120
119
  if (H(l) && H(p))
121
120
  return [...l, ...p];
122
- }), [i, d]), [, f] = h(T), [x, u] = j("Navbar"), g = J(t, x, []);
121
+ }), [i, d]), [, f] = h(C), [x, u] = j("Navbar"), g = Y(t, x, []);
123
122
  return /* @__PURE__ */ e.jsxs("div", { className: "relative flex h-full max-h-full overflow-hidden py-2", children: [
124
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: [
125
124
  /* @__PURE__ */ e.jsx("li", { className: "h-8 w-full animate-pulse bg-gray-200" }),
@@ -155,7 +154,7 @@ const Le = ({ block: s }) => {
155
154
  ) })
156
155
  ] });
157
156
  }, He = () => {
158
- const [s, r] = j(""), { addPredefinedBlock: o } = F(), [a] = C(), [, i] = h(xe), [, d] = h(O), [, m] = h(T), n = () => {
157
+ const [s, r] = j(""), { addPredefinedBlock: o } = F(), [a] = T(), [, i] = h(xe), [, d] = h(O), [, m] = h(C), n = () => {
159
158
  const t = Ie(s);
160
159
  o([...t], b(a) || null), r(""), i(!1), d("layers"), m(!1);
161
160
  };
@@ -167,7 +166,7 @@ const Le = ({ block: s }) => {
167
166
  /* @__PURE__ */ e.jsx(Be, { className: "space-y-2 px-3 py-0", children: /* @__PURE__ */ e.jsxs("div", { className: "space-y-1", children: [
168
167
  /* @__PURE__ */ e.jsx(Ae, { htmlFor: "current", className: "text-sm", children: "Enter HTML Code:" }),
169
168
  /* @__PURE__ */ e.jsx(
170
- Ce,
169
+ Te,
171
170
  {
172
171
  autoFocus: !0,
173
172
  tabIndex: 1,
@@ -182,7 +181,7 @@ const Le = ({ block: s }) => {
182
181
  }
183
182
  )
184
183
  ] }) }),
185
- /* @__PURE__ */ e.jsxs(Te, { className: "flex flex-col justify-end p-3", children: [
184
+ /* @__PURE__ */ e.jsxs(Ce, { className: "flex flex-col justify-end p-3", children: [
186
185
  /* @__PURE__ */ e.jsx(ie, { disabled: s.trim() === "", onClick: () => n(), size: "sm", className: "w-full", children: "Import" }),
187
186
  /* @__PURE__ */ e.jsxs(ve, { variant: "default", className: "mt-2 p-1 text-blue-400", children: [
188
187
  /* @__PURE__ */ e.jsx(ue, { className: "h-4 w-4" }),
@@ -195,12 +194,12 @@ const Le = ({ block: s }) => {
195
194
  return !P(E, r);
196
195
  const o = s._type;
197
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);
198
- }, ws = () => {
199
- const [s, r] = j("core"), [o, a] = j("basic"), i = D(), [, d] = h(he), [, m] = h(T), [n] = C(), t = fe(), f = Q(t, { _id: b(n) }), { data: x, isLoading: u } = U(), g = I(
197
+ }, ys = () => {
198
+ const [s, r] = j("core"), [o, a] = j("basic"), i = G(), [, d] = h(he), [, m] = h(C), [n] = T(), t = fe(), f = $(t, { _id: b(n) }), { data: x, isLoading: u } = z(), g = I(
200
199
  w(i, (c) => Ee(f, c.type)),
201
200
  "category"
202
- ), l = X(L(g.core, "group"));
203
- W(() => {
201
+ ), l = J(L(g.core, "group"));
202
+ q(() => {
204
203
  !P(l, o) && !k(l) && !k(o) && a(b(l));
205
204
  }, [l, o]);
206
205
  const p = (c) => a((v) => v === c ? "" : c), y = !u && !k(x);
@@ -237,7 +236,7 @@ const Le = ({ block: s }) => {
237
236
  ] })
238
237
  }
239
238
  ),
240
- 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(
239
+ s === "core" && /* @__PURE__ */ e.jsx(re, { className: "-mx-1.5 h-full", children: /* @__PURE__ */ e.jsx(Q, { type: "single", value: o, className: "w-full px-3", children: B.Children.toArray(
241
240
  L(
242
241
  l,
243
242
  (c) => M(w(A(g.core), { group: c }), {
@@ -250,10 +249,10 @@ const Le = ({ block: s }) => {
250
249
  ] }) : null
251
250
  )
252
251
  ) }) }),
253
- s === "ui-blocks" && /* @__PURE__ */ e.jsx(q, { fallback: /* @__PURE__ */ e.jsx(de, { className: "h-32 w-full" }), children: /* @__PURE__ */ e.jsx(Fe, {}) }),
252
+ s === "ui-blocks" && /* @__PURE__ */ e.jsx(V, { fallback: /* @__PURE__ */ e.jsx(de, { className: "h-32 w-full" }), children: /* @__PURE__ */ e.jsx(Fe, {}) }),
254
253
  s === "html" && /* @__PURE__ */ e.jsx(Me, {})
255
254
  ] });
256
255
  };
257
256
  export {
258
- ws as default
257
+ ys as default
259
258
  };
@@ -2,7 +2,7 @@ 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
4
  import k from "@rjsf/core";
5
- import { w as N } from "./index-0f2acc34.js";
5
+ import { w as N } from "./index-38bc7894.js";
6
6
  import "react-i18next";
7
7
  import { u as D } from "./useBuilderProp-81a14920.js";
8
8
  import { SelectOption as p, Numeric as P, Color as e } from "@chaibuilder/blocks";
@@ -17,8 +17,9 @@ import "clsx";
17
17
  import "tailwind-merge";
18
18
  import "react-hotkeys-hook";
19
19
  import "flat-to-nested";
20
- import "./Class-1fb4c0c4.js";
20
+ import "./html-to-json-eb4de645.js";
21
21
  import "./MODIFIERS-c2e02614.js";
22
+ import "himalaya";
22
23
  import "redux-undo";
23
24
  import "@react-hookz/web";
24
25
  import "sonner";
@@ -78,7 +79,7 @@ const d = [
78
79
  { title: "Lustria", value: "Lustria" },
79
80
  { title: "Ovo", value: "Ovo" },
80
81
  { title: "Suranna", value: "Suranna" }
81
- ], it = () => {
82
+ ], lt = () => {
82
83
  const m = D("onSaveBrandingOptions", async () => {
83
84
  }), [l, v] = N(), r = s.useRef(l);
84
85
  s.useEffect(() => () => m(r.current), [r]);
@@ -155,5 +156,5 @@ const d = [
155
156
  ] });
156
157
  };
157
158
  export {
158
- it as default
159
+ lt as default
159
160
  };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./jsx-runtime-5c3ac4f7.cjs"),O=require("react"),C=require("@rjsf/validator-ajv8"),B=require("@rjsf/core"),j=require("./index-94612af5.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("./html-to-json-feece010.cjs");require("./MODIFIERS-70fef873.cjs");require("himalaya");require("redux-undo");require("@react-hookz/web");require("sonner");require("@radix-ui/react-icons");require("lucide-react");require("@radix-ui/react-slot");require("class-variance-authority");require("@radix-ui/react-tooltip");require("@radix-ui/react-toast");function P(t){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const i in t)if(i!=="default"){const a=Object.getOwnPropertyDescriptor(t,i);Object.defineProperty(r,i,a.get?a:{enumerable:!0,get:()=>t[i]})}}return r.default=t,Object.freeze(r)}const c=P(O),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()=>{}),[r,i]=j.useBrandingOptions(),a=c.useRef(r);c.useEffect(()=>()=>t(a.current),[a]);const p=({formData:l},u)=>{u&&(i(l),a.current=l)},{bodyFont:g,headingFont:b,primaryColor:f,bodyTextDarkColor:m,bodyTextLightColor:y,bodyBgDarkColor:x,secondaryColor:S,bodyBgLightColor:h,roundedCorners:q}=r,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(q||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:r,validator:C,onChange:p})})]})};exports.default=k;