@chaibuilder/sdk 1.1.13 → 1.1.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/AddBlocks-AG_J7s2Z.cjs +1 -0
- package/dist/{AddBlocks-A7WofxHV.js → AddBlocks-FsdsASNp.js} +51 -51
- package/dist/BrandingOptions-TRVyCvVq.cjs +1 -0
- package/dist/{BrandingOptions-wkFrLFI_.js → BrandingOptions-zFJ28xmJ.js} +23 -23
- package/dist/{CanvasArea-chEYQhH8.js → CanvasArea-IiD0f6Eq.js} +7 -7
- package/dist/{CanvasArea-kF46NWZK.cjs → CanvasArea-Kbw-TjPH.cjs} +7 -7
- package/dist/CurrentPage-lOQd17GA.cjs +1 -0
- package/dist/{CurrentPage-Wd7F9Egg.js → CurrentPage-n2RQMBpJ.js} +10 -10
- package/dist/{Layers-qMOMP2Mi.js → Layers-38kbAjTI.js} +81 -81
- package/dist/Layers-D2WY0CpR.cjs +1 -0
- package/dist/MarkAsGlobalBlock-LXDkmFUr.cjs +1 -0
- package/dist/{MarkAsGlobalBlock-Czq45Amf.js → MarkAsGlobalBlock-xOHhiMDl.js} +3 -3
- package/dist/PagesPanel-RWnIpNqP.cjs +1 -0
- package/dist/{PagesPanel-ay4uk4mg.js → PagesPanel-bNqfHuCk.js} +6 -6
- package/dist/{ProjectPanel-eLlbfAtj.js → ProjectPanel-1Kgm2-R5.js} +10 -10
- package/dist/ProjectPanel-cXKiyEXm.cjs +1 -0
- package/dist/Settings-5AI0CInt.cjs +1 -0
- package/dist/{Settings-lpoxaMDu.js → Settings-ou3Owu0B.js} +454 -454
- package/dist/SidePanels-NV3UX8kK.cjs +1 -0
- package/dist/{SidePanels-iRXV69vh.js → SidePanels-muLqfBql.js} +36 -36
- package/dist/{Topbar-dQYhW4iv.js → Topbar-_-1HX-EE.js} +3 -3
- package/dist/Topbar-gQxbcPtG.cjs +1 -0
- package/dist/UnsplashImages-PNp5fYCc.cjs +1 -0
- package/dist/{UnsplashImages-AL1ASAoD.js → UnsplashImages-mqK09h8E.js} +6 -6
- package/dist/UploadImages-BoSSsLtD.cjs +1 -0
- package/dist/{UploadImages-09wuhk2O.js → UploadImages-IDkkRuhx.js} +3 -3
- package/dist/{add-page-modal-TXREEFPZ.js → add-page-modal-AJorVipD.js} +16 -16
- package/dist/add-page-modal-zOdAgfvh.cjs +1 -0
- package/dist/confirm-alert-dHRDZrA1.cjs +1 -0
- package/dist/{confirm-alert-GkfW9chS.js → confirm-alert-ea5xpncD.js} +3 -3
- package/dist/controls-QnyBNkXG.cjs +36 -0
- package/dist/controls-kEuiMMDf.js +4600 -0
- package/dist/core.cjs +1 -1
- package/dist/core.d.ts +5 -15
- package/dist/core.js +5 -5
- package/dist/{delete-page-modal-LNME2FwD.js → delete-page-modal-0VAs4Heb.js} +5 -5
- package/dist/delete-page-modal-KRBGE4Fo.cjs +1 -0
- package/dist/form-6qGAOYI3.cjs +1 -0
- package/dist/{form-Fk4CaX1A.js → form-irY39wvJ.js} +29 -29
- package/dist/functions-86L6n983.js +23 -0
- package/dist/functions-Jr7gX_RX.cjs +1 -0
- package/dist/{html-to-json-kGgp07Hv.js → html-to-json-Y5M0N8PH.js} +33 -33
- package/dist/html-to-json-aAZkA0f5.cjs +1 -0
- package/dist/{index-89A3jPHh.js → index-0OqmBgqo.js} +3 -3
- package/dist/{index-Q5q5Y_8a.js → index-4fMl4eN2.js} +6 -6
- package/dist/index-d55M5MRz.cjs +1 -0
- package/dist/{index-61c5wSJn.cjs → index-veRjBw4J.cjs} +2 -2
- package/dist/lib.cjs +1 -1
- package/dist/lib.js +27 -27
- package/dist/lodash-2us0VT8I.cjs +36 -0
- package/dist/lodash-3gkdNK5u.js +4538 -0
- package/dist/page-viewer-LvBMrQas.cjs +1 -0
- package/dist/{page-viewer-LPx-OTCC.js → page-viewer-QuVbTBKO.js} +6 -6
- package/dist/{project-general-setting-sSpFUD_Y.js → project-general-setting-6Nsq4-2Z.js} +9 -9
- package/dist/project-general-setting-pSrUGR7K.cjs +1 -0
- package/dist/{project-seo-setting-CGVegBtM.js → project-seo-setting-EhqUcTKy.js} +9 -9
- package/dist/project-seo-setting-N0OnBCvh.cjs +1 -0
- package/dist/render.cjs +1 -1
- package/dist/render.js +46 -46
- package/dist/server.cjs +1 -1
- package/dist/server.js +11 -11
- package/dist/single-page-detail-JWCEEBaZ.cjs +1 -0
- package/dist/{single-page-detail-32H1_IG4.js → single-page-detail-SAqjZ5E1.js} +53 -53
- package/dist/studio.cjs +1 -1
- package/dist/studio.js +5 -5
- package/dist/ui.cjs +1 -1
- package/dist/ui.js +3 -3
- package/dist/useAddBlockByDrop-5QW86HjG.js +20 -0
- package/dist/useAddBlockByDrop-Ckzuvu-s.cjs +1 -0
- package/dist/utils-37UXq2O5.cjs +1 -0
- package/dist/{utils-zWMk4dB2.js → utils-XsPKXMVo.js} +5 -5
- package/package.json +3 -3
- package/dist/AddBlocks-Yuc4t0Z_.cjs +0 -1
- package/dist/BrandingOptions-KkPF1OGn.cjs +0 -1
- package/dist/CurrentPage-p9MaXTOB.cjs +0 -1
- package/dist/Layers-wQ0Fv9Xc.cjs +0 -1
- package/dist/MarkAsGlobalBlock-sb3hMXLq.cjs +0 -1
- package/dist/PagesPanel--maZxwX5.cjs +0 -1
- package/dist/ProjectPanel-KhIpO7m3.cjs +0 -1
- package/dist/Settings-n2DpS5Ta.cjs +0 -1
- package/dist/SidePanels-Dud5Xh9L.cjs +0 -1
- package/dist/Topbar-vqzjB75a.cjs +0 -1
- package/dist/UnsplashImages-3Sh4UZ-7.cjs +0 -1
- package/dist/UploadImages-mPzLhMiH.cjs +0 -1
- package/dist/add-page-modal-FPnIWwqA.cjs +0 -1
- package/dist/confirm-alert-YNyc3WEo.cjs +0 -1
- package/dist/controls-G0puEH71.js +0 -120
- package/dist/controls-aHZq-q4b.cjs +0 -1
- package/dist/delete-page-modal-sTbqZPvk.cjs +0 -1
- package/dist/form-OhgCJlVA.cjs +0 -1
- package/dist/functions-ZWGlwlQY.cjs +0 -1
- package/dist/functions-slns6ONz.js +0 -23
- package/dist/html-to-json-po8on2ju.cjs +0 -1
- package/dist/index-GNmGzavZ.cjs +0 -1
- package/dist/page-viewer-wQO9oV9h.cjs +0 -1
- package/dist/project-general-setting-8EwuN5lN.cjs +0 -1
- package/dist/project-seo-setting-R77SKM1I.cjs +0 -1
- package/dist/single-page-detail-nyBEHLtT.cjs +0 -1
- package/dist/useAddBlockByDrop-4VH-SMj7.cjs +0 -1
- package/dist/useAddBlockByDrop-_kyR0iI4.js +0 -20
- package/dist/utils-tx6hqsHY.cjs +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-WUGKV8jN.cjs"),c=require("react"),t=require("./lodash-2us0VT8I.cjs"),g=require("jotai"),s=require("./index-d55M5MRz.cjs"),v=require("@radix-ui/react-icons"),b=require("@chaibuilder/runtime"),T=require("flagged"),q=require("lucide-react"),B=require("react-dnd"),A=require("./html-to-json-aAZkA0f5.cjs");require("./MODIFIERS-WFzDQfiT.cjs");require("@radix-ui/react-toggle");require("class-variance-authority");require("./utils-37UXq2O5.cjs");require("clsx");require("tailwind-merge");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-scroll-area");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-dom");require("react-quill");require("flat-to-nested");require("redux-undo");require("@react-hookz/web");require("react-i18next");require("himalaya");const C=({block:r})=>{const{type:o,icon:l,label:d}=r,{addCoreBlock:x,addPredefinedBlock:m}=s.useAddBlock(),[j,p]=s.useSelectedBlockIds(),[,i]=s.useHighlightBlockId(),[,f]=g.useAtom(s.activePanelAtom),[,a]=g.useAtom(s.addBlocksModalAtom),n=()=>{t.has(r,"blocks")?m(b.syncBlocksWithDefaults(r.blocks),t.head(j)):x(r,t.head(j)),a(!1),f("layers")},h=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:n,type:"button",onDragStart:E=>{E.dataTransfer.setData("text/plain",JSON.stringify(t.omit(r,["component","icon"]))),setTimeout(()=>{p([]),i(null),a(!1),f("layers")},200)},draggable:h?"true":"false",className:"space-y-2 rounded-lg border border-border p-3 text-center hover:bg-slate-300/50 "+(h?"cursor-grab":"cursor-pointer"),children:[c.createElement(l||v.BoxIcon,{className:"w-4 h-4 mx-auto"}),e.jsxRuntimeExports.jsx("p",{className:"truncate text-xs",children:d||o})]})}),e.jsxRuntimeExports.jsx(s.TooltipContent,{children:e.jsxRuntimeExports.jsx("p",{children:d||o})})]})})},w=({block:r,closePopover:o})=>{var n;const[l,d]=c.useState(!1),x=s.useBuilderProp("getExternalPredefinedBlock"),{addCoreBlock:m,addPredefinedBlock:j}=s.useAddBlock(),[p]=s.useSelectedBlockIds(),[,i,f]=B.useDrag(()=>({type:"CHAI_BLOCK",item:r}),[r]),a=c.useCallback(async h=>{if(h.stopPropagation(),t.has(r,"component")){m(r,t.head(p)),o();return}d(!0);const E=await x(r);t.isEmpty(E)||j(b.syncBlocksWithDefaults(E),t.head(p)),o()},[r]);return e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx(B.DragPreviewImage,{connect:f,src:"https://placehold.co/100x30/000000/FFF?text="+((n=r.name||r.label)==null?void 0:n.replace(" ","+"))}),e.jsxRuntimeExports.jsxs("div",{ref:i,onClick:l?()=>{}:a,className:"relative cursor-pointer overflow-hidden rounded-md border border-transparent duration-200 hover:scale-x-105 hover:border-foreground/20 hover:shadow-2xl",children:[l&&e.jsxRuntimeExports.jsxs("div",{className:"absolute flex h-full w-full items-center justify-center bg-black bg-opacity-70",children:[e.jsxRuntimeExports.jsx(q.Loader,{className:"animate-spin",size:15,color:"white"})," ",e.jsxRuntimeExports.jsx("span",{className:"pl-2 text-sm text-white",children:"Adding..."})]}),r.preview?e.jsxRuntimeExports.jsx("img",{src:r.preview,className:"min-h-[50px] w-full rounded-md border border-gray-300",alt:r.label}):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:r.label})})]})]})},N=()=>{const{data:r}=s.useUILibraryBlocks(),o=b.useChaiBlocks(),l=t.filter(t.values(o),{category:"custom"}),d=t.groupBy(l,"group"),x=t.groupBy(r,"group"),m=c.useMemo(()=>t.mergeWith(d,x,(a,n)=>{if(t.isArray(a)&&t.isArray(n))return[...a,...n]}),[d,x]),[,j]=g.useAtom(s.addBlocksModalAtom),[p,i]=c.useState(t.head(t.keys(m))||""),f=t.get(m,p,[]);return e.jsxRuntimeExports.jsxs("div",{className:"relative flex flex-col h-full max-h-full overflow-hidden py-2",children:[e.jsxRuntimeExports.jsx("div",{className:"p-3 sticky top-0 flex w-full items-center",children:e.jsxRuntimeExports.jsxs(s.Select,{value:p,onValueChange:a=>i(a),children:[e.jsxRuntimeExports.jsx(s.SelectTrigger,{className:"w-full",children:e.jsxRuntimeExports.jsx(s.SelectValue,{placeholder:"Select a provider"})}),e.jsxRuntimeExports.jsxs(s.SelectContent,{children:[e.jsxRuntimeExports.jsx(s.SelectItem,{value:"",children:"Choose"}),c.Children.toArray(t.map(m,(a,n)=>e.jsxRuntimeExports.jsx(s.SelectItem,{value:n,children:n},n)))]})]})}),e.jsxRuntimeExports.jsx("div",{className:"h-full w-full space-y-2 overflow-y-auto px-2",children:c.Children.toArray(f.map(a=>e.jsxRuntimeExports.jsx(w,{block:a,closePopover:()=>j(!1)})))})]})},S=()=>{const[r,o]=c.useState(""),{addPredefinedBlock:l}=s.useAddBlock(),[d]=s.useSelectedBlockIds(),[,x]=g.useAtom(s.addBlockOffCanvasAtom),[,m]=g.useAtom(s.activePanelAtom),[,j]=g.useAtom(s.addBlocksModalAtom),p=()=>{const i=A.getBlocksFromHTML(r);l([...i],t.head(d)||null),o(""),x(!1),m("layers"),j(!1)};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:"Use HTML snippets from Tailwind CSS component libraries etc. or just copy paste your own HTML code."})}),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:"Tailwind HTML snippet:"}),e.jsxRuntimeExports.jsx(s.Textarea,{autoFocus:!0,tabIndex:1,ref:i=>i&&i.focus(),defaultValue:r,onChange:i=>o(i.target.value),rows:12,placeholder:"Enter your code snippet here...",className:"resize-none bg-gray-100 overflow-x-auto whitespace-pre text-xs font-mono font-normal"})]})}),e.jsxRuntimeExports.jsxs(s.CardFooter,{className:"flex flex-col justify-end p-3",children:[e.jsxRuntimeExports.jsx(s.Button,{disabled:r.trim()==="",onClick:()=>p(),size:"sm",className:"w-full",children:"Import HTML"}),e.jsxRuntimeExports.jsx(s.Alert,{variant:"default",className:"mt-2 p-1 border-none text-gray-400",children:e.jsxRuntimeExports.jsx(s.AlertTitle,{className:"text-xs font-normal leading-4",children:"NOTE: Imported html will be added to the currently selected block. If no block is selected, the html will be added to the page."})})]})]})},k=["ListItem","TableHead","TableBody","TableRow","TableCell","Column"],I=(r,o)=>{if(!r)return!t.includes(k,o);const l=r._type;return l==="List"?o==="ListItem":l==="Table"?o==="TableHead"||o==="TableBody":l==="TableHead"||l==="TableBody"?o==="TableRow":l==="TableRow"?o==="TableCell":l==="Row"?o==="Column":!t.includes(k,o)},L=()=>{const[r,o]=c.useState("core"),[l,d]=c.useState("basic"),x=b.useChaiBlocks(),[,m]=g.useAtom(s.showPredefinedBlockCategoryAtom),[j]=s.useSelectedBlockIds(),p=s.useAllBlocks(),i=t.find(p,{_id:t.head(j)}),{data:f,isLoading:a}=s.useUILibraryBlocks(),n=t.groupBy(t.filter(x,u=>I(i,u.type)),"category"),h=t.uniq(t.map(n.core,"group"));c.useEffect(()=>{!t.includes(h,l)&&!t.isEmpty(h)&&!t.isEmpty(l)&&d(t.head(h))},[h,l]);const E=u=>d(R=>R===u?"":u),y=!a&&!t.isEmpty(f)||t.find(t.values(x),{category:"custom"})!==void 0;return e.jsxRuntimeExports.jsxs("div",{className:"flex h-full 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:"Add block"}),e.jsxRuntimeExports.jsx("span",{className:"p-0 text-xs font-light leading-3 opacity-80 xl:pl-1",children:r==="html"?"(Enter or paste TailwindCSS HTML snippet)":"(Click to add block to page)"})]}),e.jsxRuntimeExports.jsx(s.Tabs,{onValueChange:u=>{m(""),o(u)},value:r,className:"h-max",children:e.jsxRuntimeExports.jsxs(s.TabsList,{className:"grid w-full "+(y?"grid-cols-3":"grid-cols-2"),children:[e.jsxRuntimeExports.jsx(s.TabsTrigger,{value:"core",children:"Core"}),y?e.jsxRuntimeExports.jsx(s.TabsTrigger,{value:"ui-blocks",children:"Custom Blocks"}):null,e.jsxRuntimeExports.jsx(s.TabsTrigger,{value:"html",children:"Import "})]})}),r==="core"&&e.jsxRuntimeExports.jsx(s.ScrollArea,{className:"-mx-1.5 h-full",children:e.jsxRuntimeExports.jsx(s.Accordion,{type:"single",value:l,className:"w-full px-3",children:c.Children.toArray(t.map(h,u=>t.reject(t.filter(t.values(n.core),{group:u}),{hidden:!0}).length?e.jsxRuntimeExports.jsxs(s.AccordionItem,{value:u,className:"border-border",children:[e.jsxRuntimeExports.jsx(s.AccordionTrigger,{onClick:()=>E(u),className:"py-2 capitalize",children:u}),e.jsxRuntimeExports.jsx(s.AccordionContent,{children:e.jsxRuntimeExports.jsx("div",{className:"grid grid-cols-3 gap-2",children:c.Children.toArray(t.reject(t.filter(t.values(n.core),{group:u}),{hidden:!0}).map(R=>e.jsxRuntimeExports.jsx(C,{block:R})))})})]}):null))})}),r==="ui-blocks"&&e.jsxRuntimeExports.jsx(c.Suspense,{fallback:e.jsxRuntimeExports.jsx(s.Skeleton,{className:"h-32 w-full"}),children:e.jsxRuntimeExports.jsx(N,{})}),r==="html"&&e.jsxRuntimeExports.jsx(S,{})]})};exports.default=L;
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import { j as e } from "./jsx-runtime-NV737rRe.js";
|
|
2
2
|
import B, { createElement as z, useState as b, useCallback as q, useMemo as V, useEffect as U, Suspense as W } from "react";
|
|
3
|
-
import {
|
|
3
|
+
import { t as R, h, o as J, a as j, b as y, F as k, Y as T, Z as K, L as P, k as Y, g as Z, d as N, c as A, j as H, _ as Q, R as E } from "./lodash-3gkdNK5u.js";
|
|
4
4
|
import { useAtom as f } from "jotai";
|
|
5
|
-
import { O as I, j as v, _ as
|
|
5
|
+
import { O as I, j as v, _ as X, av as _, aw as L, aD as $, aE as ee, aG as se, i as te, a8 as D, aq as oe, ar as re, as as ae, at as le, au as F, bp as ce, bq as ne, br as ie, bs as de, bt as me, aI as pe, bu as ue, bv as xe, B as he, bw as fe, bx as ge, by as be, ae as je, ax as ye, ay as ke, az as w, bo as Be, bh as ve, bi as Ce, bj as we, bk as Te, S as Ne } from "./index-0OqmBgqo.js";
|
|
6
6
|
import { BoxIcon as Ae } from "@radix-ui/react-icons";
|
|
7
7
|
import { syncBlocksWithDefaults as G, useChaiBlocks as O } from "@chaibuilder/runtime";
|
|
8
8
|
import { useFeature as Ie } from "flagged";
|
|
9
|
-
import { Loader as
|
|
10
|
-
import { useDrag as
|
|
11
|
-
import { g as He } from "./html-to-json-
|
|
9
|
+
import { Loader as Le } from "lucide-react";
|
|
10
|
+
import { useDrag as Se, DragPreviewImage as Pe } from "react-dnd";
|
|
11
|
+
import { g as He } from "./html-to-json-Y5M0N8PH.js";
|
|
12
12
|
import "./MODIFIERS-MLfpKQY1.js";
|
|
13
13
|
import "@radix-ui/react-toggle";
|
|
14
14
|
import "class-variance-authority";
|
|
15
|
-
import "./utils-
|
|
15
|
+
import "./utils-XsPKXMVo.js";
|
|
16
16
|
import "clsx";
|
|
17
17
|
import "tailwind-merge";
|
|
18
18
|
import "@radix-ui/react-switch";
|
|
@@ -42,24 +42,24 @@ import "@react-hookz/web";
|
|
|
42
42
|
import "react-i18next";
|
|
43
43
|
import "himalaya";
|
|
44
44
|
const Ee = ({ block: s }) => {
|
|
45
|
-
const { type: t, icon:
|
|
46
|
-
|
|
45
|
+
const { type: t, icon: o, label: c } = s, { addCoreBlock: i, addPredefinedBlock: d } = I(), [p, m] = v(), [, a] = X(), [, x] = f(_), [, l] = f(L), r = () => {
|
|
46
|
+
R(s, "blocks") ? d(G(s.blocks), h(p)) : i(s, h(p)), l(!1), x("layers");
|
|
47
47
|
}, u = Ie("dnd");
|
|
48
48
|
return /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsxs($, { children: [
|
|
49
49
|
/* @__PURE__ */ e.jsx(ee, { asChild: !0, children: /* @__PURE__ */ e.jsxs(
|
|
50
50
|
"button",
|
|
51
51
|
{
|
|
52
|
-
onClick:
|
|
52
|
+
onClick: r,
|
|
53
53
|
type: "button",
|
|
54
54
|
onDragStart: (g) => {
|
|
55
55
|
g.dataTransfer.setData("text/plain", JSON.stringify(J(s, ["component", "icon"]))), setTimeout(() => {
|
|
56
|
-
m([]),
|
|
56
|
+
m([]), a(null), l(!1), x("layers");
|
|
57
57
|
}, 200);
|
|
58
58
|
},
|
|
59
59
|
draggable: u ? "true" : "false",
|
|
60
60
|
className: "space-y-2 rounded-lg border border-border p-3 text-center hover:bg-slate-300/50 " + (u ? "cursor-grab" : "cursor-pointer"),
|
|
61
61
|
children: [
|
|
62
|
-
z(
|
|
62
|
+
z(o || Ae, { className: "w-4 h-4 mx-auto" }),
|
|
63
63
|
/* @__PURE__ */ e.jsx("p", { className: "truncate text-xs", children: c || t })
|
|
64
64
|
]
|
|
65
65
|
}
|
|
@@ -67,16 +67,16 @@ const Ee = ({ block: s }) => {
|
|
|
67
67
|
/* @__PURE__ */ e.jsx(se, { children: /* @__PURE__ */ e.jsx("p", { children: c || t }) })
|
|
68
68
|
] }) });
|
|
69
69
|
}, Fe = ({ block: s, closePopover: t }) => {
|
|
70
|
-
var
|
|
71
|
-
const [
|
|
70
|
+
var r;
|
|
71
|
+
const [o, c] = b(!1), i = te("getExternalPredefinedBlock"), { addCoreBlock: d, addPredefinedBlock: p } = I(), [m] = v(), [, a, x] = Se(
|
|
72
72
|
() => ({
|
|
73
73
|
type: "CHAI_BLOCK",
|
|
74
74
|
item: s
|
|
75
75
|
}),
|
|
76
76
|
[s]
|
|
77
|
-
),
|
|
77
|
+
), l = q(
|
|
78
78
|
async (u) => {
|
|
79
|
-
if (u.stopPropagation(),
|
|
79
|
+
if (u.stopPropagation(), R(s, "component")) {
|
|
80
80
|
d(s, h(m)), t();
|
|
81
81
|
return;
|
|
82
82
|
}
|
|
@@ -91,19 +91,19 @@ const Ee = ({ block: s }) => {
|
|
|
91
91
|
Pe,
|
|
92
92
|
{
|
|
93
93
|
connect: x,
|
|
94
|
-
src: "https://placehold.co/100x30/000000/FFF?text=" + ((
|
|
94
|
+
src: "https://placehold.co/100x30/000000/FFF?text=" + ((r = s.name || s.label) == null ? void 0 : r.replace(" ", "+"))
|
|
95
95
|
}
|
|
96
96
|
),
|
|
97
97
|
/* @__PURE__ */ e.jsxs(
|
|
98
98
|
"div",
|
|
99
99
|
{
|
|
100
|
-
ref:
|
|
101
|
-
onClick:
|
|
102
|
-
} :
|
|
100
|
+
ref: a,
|
|
101
|
+
onClick: o ? () => {
|
|
102
|
+
} : l,
|
|
103
103
|
className: "relative cursor-pointer overflow-hidden rounded-md border border-transparent duration-200 hover:scale-x-105 hover:border-foreground/20 hover:shadow-2xl",
|
|
104
104
|
children: [
|
|
105
|
-
|
|
106
|
-
/* @__PURE__ */ e.jsx(
|
|
105
|
+
o && /* @__PURE__ */ e.jsxs("div", { className: "absolute flex h-full w-full items-center justify-center bg-black bg-opacity-70", children: [
|
|
106
|
+
/* @__PURE__ */ e.jsx(Le, { className: "animate-spin", size: 15, color: "white" }),
|
|
107
107
|
" ",
|
|
108
108
|
/* @__PURE__ */ e.jsx("span", { className: "pl-2 text-sm text-white", children: "Adding..." })
|
|
109
109
|
] }),
|
|
@@ -120,28 +120,28 @@ const Ee = ({ block: s }) => {
|
|
|
120
120
|
)
|
|
121
121
|
] });
|
|
122
122
|
}, Me = () => {
|
|
123
|
-
const { data: s } =
|
|
124
|
-
if (P(
|
|
125
|
-
return [...
|
|
126
|
-
}), [c, i]), [, p] = f(
|
|
123
|
+
const { data: s } = D(), t = O(), o = y(k(t), { category: "custom" }), c = T(o, "group"), i = T(s, "group"), d = V(() => K(c, i, (l, r) => {
|
|
124
|
+
if (P(l) && P(r))
|
|
125
|
+
return [...l, ...r];
|
|
126
|
+
}), [c, i]), [, p] = f(L), [m, a] = b(h(Y(d)) || ""), x = Z(d, m, []);
|
|
127
127
|
return /* @__PURE__ */ e.jsxs("div", { className: "relative flex flex-col h-full max-h-full overflow-hidden py-2", children: [
|
|
128
|
-
/* @__PURE__ */ e.jsx("div", { className: "p-3 sticky top-0 flex w-full items-center", children: /* @__PURE__ */ e.jsxs(
|
|
129
|
-
/* @__PURE__ */ e.jsx(
|
|
130
|
-
/* @__PURE__ */ e.jsxs(
|
|
128
|
+
/* @__PURE__ */ e.jsx("div", { className: "p-3 sticky top-0 flex w-full items-center", children: /* @__PURE__ */ e.jsxs(oe, { value: m, onValueChange: (l) => a(l), children: [
|
|
129
|
+
/* @__PURE__ */ e.jsx(re, { className: "w-full", children: /* @__PURE__ */ e.jsx(ae, { placeholder: "Select a provider" }) }),
|
|
130
|
+
/* @__PURE__ */ e.jsxs(le, { children: [
|
|
131
131
|
/* @__PURE__ */ e.jsx(F, { value: "", children: "Choose" }),
|
|
132
132
|
B.Children.toArray(
|
|
133
|
-
N(d, (
|
|
133
|
+
N(d, (l, r) => /* @__PURE__ */ e.jsx(F, { value: r, children: r }, r))
|
|
134
134
|
)
|
|
135
135
|
] })
|
|
136
136
|
] }) }),
|
|
137
137
|
/* @__PURE__ */ e.jsx("div", { className: "h-full w-full space-y-2 overflow-y-auto px-2", children: B.Children.toArray(
|
|
138
|
-
x.map((
|
|
138
|
+
x.map((l) => /* @__PURE__ */ e.jsx(Fe, { block: l, closePopover: () => p(!1) }))
|
|
139
139
|
) })
|
|
140
140
|
] });
|
|
141
|
-
},
|
|
142
|
-
const [s, t] = b(""), { addPredefinedBlock:
|
|
143
|
-
const
|
|
144
|
-
|
|
141
|
+
}, Re = () => {
|
|
142
|
+
const [s, t] = b(""), { addPredefinedBlock: o } = I(), [c] = v(), [, i] = f(ce), [, d] = f(_), [, p] = f(L), m = () => {
|
|
143
|
+
const a = He(s);
|
|
144
|
+
o([...a], h(c) || null), t(""), i(!1), d("layers"), p(!1);
|
|
145
145
|
};
|
|
146
146
|
return /* @__PURE__ */ e.jsxs(ne, { className: "border-border/0 p-0 shadow-none", children: [
|
|
147
147
|
/* @__PURE__ */ e.jsx(ie, { className: "p-3", children: /* @__PURE__ */ e.jsx(de, { children: "Use HTML snippets from Tailwind CSS component libraries etc. or just copy paste your own HTML code." }) }),
|
|
@@ -152,9 +152,9 @@ const Ee = ({ block: s }) => {
|
|
|
152
152
|
{
|
|
153
153
|
autoFocus: !0,
|
|
154
154
|
tabIndex: 1,
|
|
155
|
-
ref: (
|
|
155
|
+
ref: (a) => a && a.focus(),
|
|
156
156
|
defaultValue: s,
|
|
157
|
-
onChange: (
|
|
157
|
+
onChange: (a) => t(a.target.value),
|
|
158
158
|
rows: 12,
|
|
159
159
|
placeholder: "Enter your code snippet here...",
|
|
160
160
|
className: "resize-none bg-gray-100 overflow-x-auto whitespace-pre text-xs font-mono font-normal"
|
|
@@ -166,20 +166,20 @@ const Ee = ({ block: s }) => {
|
|
|
166
166
|
/* @__PURE__ */ e.jsx(fe, { variant: "default", className: "mt-2 p-1 border-none text-gray-400", children: /* @__PURE__ */ e.jsx(ge, { className: "text-xs font-normal leading-4", children: "NOTE: Imported html will be added to the currently selected block. If no block is selected, the html will be added to the page." }) })
|
|
167
167
|
] })
|
|
168
168
|
] });
|
|
169
|
-
}, M = ["ListItem", "TableHead", "TableBody", "TableRow", "TableCell", "Column"],
|
|
169
|
+
}, M = ["ListItem", "TableHead", "TableBody", "TableRow", "TableCell", "Column"], _e = (s, t) => {
|
|
170
170
|
if (!s)
|
|
171
171
|
return !A(M, t);
|
|
172
|
-
const
|
|
173
|
-
return
|
|
172
|
+
const o = s._type;
|
|
173
|
+
return o === "List" ? t === "ListItem" : o === "Table" ? t === "TableHead" || t === "TableBody" : o === "TableHead" || o === "TableBody" ? t === "TableRow" : o === "TableRow" ? t === "TableCell" : o === "Row" ? t === "Column" : !A(M, t);
|
|
174
174
|
}, As = () => {
|
|
175
|
-
const [s, t] = b("core"), [
|
|
176
|
-
y(i, (n) =>
|
|
175
|
+
const [s, t] = b("core"), [o, c] = b("basic"), i = O(), [, d] = f(be), [p] = v(), m = je(), a = H(m, { _id: h(p) }), { data: x, isLoading: l } = D(), r = T(
|
|
176
|
+
y(i, (n) => _e(a, n.type)),
|
|
177
177
|
"category"
|
|
178
|
-
), u =
|
|
178
|
+
), u = Q(N(r.core, "group"));
|
|
179
179
|
U(() => {
|
|
180
|
-
!A(u,
|
|
181
|
-
}, [u,
|
|
182
|
-
const g = (n) => c((C) => C === n ? "" : n),
|
|
180
|
+
!A(u, o) && !j(u) && !j(o) && c(h(u));
|
|
181
|
+
}, [u, o]);
|
|
182
|
+
const g = (n) => c((C) => C === n ? "" : n), S = !l && !j(x) || H(k(i), { category: "custom" }) !== void 0;
|
|
183
183
|
return /* @__PURE__ */ e.jsxs("div", { className: "flex h-full flex-col overflow-hidden", children: [
|
|
184
184
|
/* @__PURE__ */ e.jsxs("div", { className: "mb-2 flex flex-col justify-between rounded-md bg-background/30 p-1", children: [
|
|
185
185
|
/* @__PURE__ */ e.jsx("h1", { className: "flex flex-col items-baseline px-1 text-xl font-semibold xl:flex-col", children: "Add block" }),
|
|
@@ -193,28 +193,28 @@ const Ee = ({ block: s }) => {
|
|
|
193
193
|
},
|
|
194
194
|
value: s,
|
|
195
195
|
className: "h-max",
|
|
196
|
-
children: /* @__PURE__ */ e.jsxs(ke, { className: "grid w-full " + (
|
|
196
|
+
children: /* @__PURE__ */ e.jsxs(ke, { className: "grid w-full " + (S ? "grid-cols-3" : "grid-cols-2"), children: [
|
|
197
197
|
/* @__PURE__ */ e.jsx(w, { value: "core", children: "Core" }),
|
|
198
|
-
|
|
198
|
+
S ? /* @__PURE__ */ e.jsx(w, { value: "ui-blocks", children: "Custom Blocks" }) : null,
|
|
199
199
|
/* @__PURE__ */ e.jsx(w, { value: "html", children: "Import " })
|
|
200
200
|
] })
|
|
201
201
|
}
|
|
202
202
|
),
|
|
203
|
-
s === "core" && /* @__PURE__ */ e.jsx(Be, { className: "-mx-1.5 h-full", children: /* @__PURE__ */ e.jsx(ve, { type: "single", value:
|
|
203
|
+
s === "core" && /* @__PURE__ */ e.jsx(Be, { className: "-mx-1.5 h-full", children: /* @__PURE__ */ e.jsx(ve, { type: "single", value: o, className: "w-full px-3", children: B.Children.toArray(
|
|
204
204
|
N(
|
|
205
205
|
u,
|
|
206
|
-
(n) => E(y(k(
|
|
206
|
+
(n) => E(y(k(r.core), { group: n }), {
|
|
207
207
|
hidden: !0
|
|
208
208
|
}).length ? /* @__PURE__ */ e.jsxs(Ce, { value: n, className: "border-border", children: [
|
|
209
209
|
/* @__PURE__ */ e.jsx(we, { onClick: () => g(n), className: "py-2 capitalize", children: n }),
|
|
210
210
|
/* @__PURE__ */ e.jsx(Te, { children: /* @__PURE__ */ e.jsx("div", { className: "grid grid-cols-3 gap-2", children: B.Children.toArray(
|
|
211
|
-
E(y(k(
|
|
211
|
+
E(y(k(r.core), { group: n }), { hidden: !0 }).map((C) => /* @__PURE__ */ e.jsx(Ee, { block: C }))
|
|
212
212
|
) }) })
|
|
213
213
|
] }) : null
|
|
214
214
|
)
|
|
215
215
|
) }) }),
|
|
216
216
|
s === "ui-blocks" && /* @__PURE__ */ e.jsx(W, { fallback: /* @__PURE__ */ e.jsx(Ne, { className: "h-32 w-full" }), children: /* @__PURE__ */ e.jsx(Me, {}) }),
|
|
217
|
-
s === "html" && /* @__PURE__ */ e.jsx(
|
|
217
|
+
s === "html" && /* @__PURE__ */ e.jsx(Re, {})
|
|
218
218
|
] });
|
|
219
219
|
};
|
|
220
220
|
export {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("./jsx-runtime-WUGKV8jN.cjs"),j=require("react"),B=require("@rjsf/validator-ajv8"),E=require("@rjsf/core"),g=require("./index-d55M5MRz.cjs"),r=require("./controls-QnyBNkXG.cjs"),m=require("./lodash-2us0VT8I.cjs");require("./MODIFIERS-WFzDQfiT.cjs");require("@radix-ui/react-toggle");require("class-variance-authority");require("./utils-37UXq2O5.cjs");require("clsx");require("tailwind-merge");require("@radix-ui/react-switch");require("@radix-ui/react-slot");require("@radix-ui/react-accordion");require("@radix-ui/react-icons");require("@radix-ui/react-alert-dialog");require("@radix-ui/react-dialog");require("@radix-ui/react-label");require("@radix-ui/react-scroll-area");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-dom");require("react-quill");require("jotai");require("flat-to-nested");require("redux-undo");require("@chaibuilder/runtime");require("@react-hookz/web");require("react-i18next");function R(t){const e=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(e,i,a.get?a:{enumerable:!0,get:()=>t[i]})}}return e.default=t,Object.freeze(e)}const x=R(j),N=({value:t,onChange:e,id:i,onBlur:a})=>{const d=m.debounce(e,200),c=n=>d(n.target.value);return l.jsxRuntimeExports.jsx("div",{className:"mt-1.5 flex items-center gap-x-3",children:l.jsxRuntimeExports.jsx("div",{className:"flex w-3/5 flex-col",children:l.jsxRuntimeExports.jsx("input",{type:"color",className:"text-xs p-0",value:t,onBlur:({target:{value:n}})=>a(i,n),onChange:c})})})},y=[{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=g.useBuilderProp("onSaveBrandingOptions",async()=>{}),[e,i]=g.useBrandingOptions(),a=x.useRef(e);x.useEffect(()=>()=>{m.isEqual(e,a.current)||t(a.current)},[]);const d=({formData:o},s)=>{s&&(i(o),a.current=o)},{bodyFont:c,headingFont:n,primaryColor:f,bodyTextDarkColor:q,bodyTextLightColor:b,bodyBgDarkColor:h,secondaryColor:S,bodyBgLightColor:C,roundedCorners:O}=e,v={headingFont:r.Ty({title:"Heading font",default:n,options:y}),bodyFont:r.Ty({title:"Body font",default:c,options:y}),roundedCorners:r.my({title:"Rounded Corner",default:parseInt(O||5,10)}),primaryColor:r.Ey({title:"Primary",default:f}),secondaryColor:r.Ey({title:"Secondary",default:S}),bodyBgLightColor:r.Ey({title:"Body Background (Light)",default:C}),bodyBgDarkColor:r.Ey({title:"Body Background (Dark)",default:h}),bodyTextLightColor:r.Ey({title:"Body Text (Light)",default:q}),bodyTextDarkColor:r.Ey({title:"Body Text (Dark)",default:b})},u={type:"object",properties:{}},p={};return Object.keys(v).forEach(o=>{const s=v[o];return u.properties||(u.properties={}),u.properties[o]=s.schema,p[o]=s.uiSchema,!0}),l.jsxRuntimeExports.jsxs("div",{className:"flex h-full select-none flex-col",children:[l.jsxRuntimeExports.jsx("div",{className:"rounded-md bg-background/30 p-1",children:l.jsxRuntimeExports.jsx("h1",{className:"px-1 font-semibold",children:"Branding Options"})}),l.jsxRuntimeExports.jsx("div",{className:"-mx-2",children:l.jsxRuntimeExports.jsx(E,{widgets:{color:N},idSeparator:".",autoComplete:"off",omitExtraData:!0,liveOmit:!0,liveValidate:!0,uiSchema:p,schema:u,formData:e,validator:B,onChange:d})})]})};exports.default=P;
|
|
@@ -2,13 +2,13 @@ import { j as t } from "./jsx-runtime-NV737rRe.js";
|
|
|
2
2
|
import * as c from "react";
|
|
3
3
|
import O from "@rjsf/validator-ajv8";
|
|
4
4
|
import N from "@rjsf/core";
|
|
5
|
-
import { i as j, x as k } from "./index-
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
5
|
+
import { i as j, x as k } from "./index-0OqmBgqo.js";
|
|
6
|
+
import { T as g, m as D, E as o } from "./controls-kEuiMMDf.js";
|
|
7
|
+
import { $ as P, X as R } from "./lodash-3gkdNK5u.js";
|
|
8
8
|
import "./MODIFIERS-MLfpKQY1.js";
|
|
9
9
|
import "@radix-ui/react-toggle";
|
|
10
10
|
import "class-variance-authority";
|
|
11
|
-
import "./utils-
|
|
11
|
+
import "./utils-XsPKXMVo.js";
|
|
12
12
|
import "clsx";
|
|
13
13
|
import "tailwind-merge";
|
|
14
14
|
import "@radix-ui/react-switch";
|
|
@@ -39,7 +39,7 @@ import "redux-undo";
|
|
|
39
39
|
import "@chaibuilder/runtime";
|
|
40
40
|
import "@react-hookz/web";
|
|
41
41
|
import "react-i18next";
|
|
42
|
-
const
|
|
42
|
+
const T = ({ value: s, onChange: e, id: u, onBlur: i }) => {
|
|
43
43
|
const p = P(e, 200), d = (l) => p(l.target.value);
|
|
44
44
|
return /* @__PURE__ */ t.jsx("div", { className: "mt-1.5 flex items-center gap-x-3", children: /* @__PURE__ */ t.jsx("div", { className: "flex w-3/5 flex-col", children: /* @__PURE__ */ t.jsx(
|
|
45
45
|
"input",
|
|
@@ -101,20 +101,20 @@ const w = ({ value: s, onChange: e, id: u, onBlur: i }) => {
|
|
|
101
101
|
{ title: "Lustria", value: "Lustria" },
|
|
102
102
|
{ title: "Ovo", value: "Ovo" },
|
|
103
103
|
{ title: "Suranna", value: "Suranna" }
|
|
104
|
-
],
|
|
104
|
+
], yt = () => {
|
|
105
105
|
const s = j("onSaveBrandingOptions", async () => {
|
|
106
106
|
}), [e, u] = k(), i = c.useRef(e);
|
|
107
107
|
c.useEffect(() => () => {
|
|
108
108
|
R(e, i.current) || s(i.current);
|
|
109
109
|
}, []);
|
|
110
|
-
const p = ({ formData:
|
|
111
|
-
n && (u(
|
|
110
|
+
const p = ({ formData: a }, n) => {
|
|
111
|
+
n && (u(a), i.current = a);
|
|
112
112
|
}, {
|
|
113
113
|
bodyFont: d,
|
|
114
114
|
headingFont: l,
|
|
115
115
|
primaryColor: h,
|
|
116
|
-
bodyTextDarkColor:
|
|
117
|
-
bodyTextLightColor:
|
|
116
|
+
bodyTextDarkColor: y,
|
|
117
|
+
bodyTextLightColor: x,
|
|
118
118
|
bodyBgDarkColor: b,
|
|
119
119
|
secondaryColor: C,
|
|
120
120
|
bodyBgLightColor: S,
|
|
@@ -134,39 +134,39 @@ const w = ({ value: s, onChange: e, id: u, onBlur: i }) => {
|
|
|
134
134
|
title: "Rounded Corner",
|
|
135
135
|
default: parseInt(B || 5, 10)
|
|
136
136
|
}),
|
|
137
|
-
primaryColor:
|
|
138
|
-
secondaryColor:
|
|
139
|
-
bodyBgLightColor:
|
|
137
|
+
primaryColor: o({ title: "Primary", default: h }),
|
|
138
|
+
secondaryColor: o({ title: "Secondary", default: C }),
|
|
139
|
+
bodyBgLightColor: o({
|
|
140
140
|
title: "Body Background (Light)",
|
|
141
141
|
default: S
|
|
142
142
|
}),
|
|
143
|
-
bodyBgDarkColor:
|
|
143
|
+
bodyBgDarkColor: o({
|
|
144
144
|
title: "Body Background (Dark)",
|
|
145
145
|
default: b
|
|
146
146
|
}),
|
|
147
|
-
bodyTextLightColor:
|
|
147
|
+
bodyTextLightColor: o({
|
|
148
148
|
title: "Body Text (Light)",
|
|
149
|
-
default:
|
|
149
|
+
default: y
|
|
150
150
|
}),
|
|
151
|
-
bodyTextDarkColor:
|
|
151
|
+
bodyTextDarkColor: o({
|
|
152
152
|
title: "Body Text (Dark)",
|
|
153
|
-
default:
|
|
153
|
+
default: x
|
|
154
154
|
})
|
|
155
155
|
// TODO: exteend more options from user
|
|
156
156
|
}, r = {
|
|
157
157
|
type: "object",
|
|
158
158
|
properties: {}
|
|
159
159
|
}, v = {};
|
|
160
|
-
return Object.keys(m).forEach((
|
|
161
|
-
const n = m[
|
|
162
|
-
return r.properties || (r.properties = {}), r.properties[
|
|
160
|
+
return Object.keys(m).forEach((a) => {
|
|
161
|
+
const n = m[a];
|
|
162
|
+
return r.properties || (r.properties = {}), r.properties[a] = n.schema, v[a] = n.uiSchema, !0;
|
|
163
163
|
}), /* @__PURE__ */ t.jsxs("div", { className: "flex h-full select-none flex-col", children: [
|
|
164
164
|
/* @__PURE__ */ t.jsx("div", { className: "rounded-md bg-background/30 p-1", children: /* @__PURE__ */ t.jsx("h1", { className: "px-1 font-semibold", children: "Branding Options" }) }),
|
|
165
165
|
/* @__PURE__ */ t.jsx("div", { className: "-mx-2", children: /* @__PURE__ */ t.jsx(
|
|
166
166
|
N,
|
|
167
167
|
{
|
|
168
168
|
widgets: {
|
|
169
|
-
color:
|
|
169
|
+
color: T
|
|
170
170
|
},
|
|
171
171
|
idSeparator: ".",
|
|
172
172
|
autoComplete: "off",
|
|
@@ -183,5 +183,5 @@ const w = ({ value: s, onChange: e, id: u, onBlur: i }) => {
|
|
|
183
183
|
] });
|
|
184
184
|
};
|
|
185
185
|
export {
|
|
186
|
-
|
|
186
|
+
yt as default
|
|
187
187
|
};
|
|
@@ -3,16 +3,16 @@ var bt = (e, t, n) => t in e ? xt(e, t, { enumerable: !0, configurable: !0, writ
|
|
|
3
3
|
var J = (e, t, n) => (bt(e, typeof t != "symbol" ? t + "" : t, n), n);
|
|
4
4
|
import { j as r } from "./jsx-runtime-NV737rRe.js";
|
|
5
5
|
import X, { createElement as wt, useCallback as we, useState as U, useEffect as _, Component as Ue, Children as kt, Suspense as ze, useRef as De, useMemo as jt, lazy as Ct } from "react";
|
|
6
|
-
import {
|
|
6
|
+
import { d as ie, c as Be, H as ue, I as Tt, J as Ye, K as ee, a as K, h as ae, o as St, B as It, g as O, i as ke, m as Et, f as Dt, j as Bt, b as Ke, A as Ot } from "./lodash-3gkdNK5u.js";
|
|
7
7
|
import { ResetIcon as Oe, MobileIcon as Ae, LaptopIcon as At, DesktopIcon as Pt, DotsVerticalIcon as Rt, EraserIcon as Mt, ZoomInIcon as _t, DragHandleDots2Icon as Lt, ArrowUpIcon as Nt, CopyIcon as Ft, TrashIcon as $t } from "@radix-ui/react-icons";
|
|
8
|
-
import { p as je, B as le, W as Je, aI as Wt, aJ as Ht, aK as qt, aL as Ut, aM as zt, R as Ce, ai as Yt, aN as Kt, aO as Jt, aP as Xt, aQ as Vt, aR as Zt, aS as Gt, w as Qt, j as W, aj as V, D as en, E as tn, F as nn, G as rn, H as sn, I as on, J as an, K as ln, ap as cn, L as dn, U as Xe, aH as oe, aT as un, _ as G, ab as pn, aU as re, ae as Te, m as Ve, n as fn, k as hn, o as gn, h as Ze, l as Ge, ag as mn, aV as yn, aW as Qe, aX as vn, aY as xn, x as bn, a as wn, aZ as kn, a_ as jn, a6 as Cn, a$ as Tn, i as Sn, S as et, aw as In } from "./index-
|
|
8
|
+
import { p as je, B as le, W as Je, aI as Wt, aJ as Ht, aK as qt, aL as Ut, aM as zt, R as Ce, ai as Yt, aN as Kt, aO as Jt, aP as Xt, aQ as Vt, aR as Zt, aS as Gt, w as Qt, j as W, aj as V, D as en, E as tn, F as nn, G as rn, H as sn, I as on, J as an, K as ln, ap as cn, L as dn, U as Xe, aH as oe, aT as un, _ as G, ab as pn, aU as re, ae as Te, m as Ve, n as fn, k as hn, o as gn, h as Ze, l as Ge, ag as mn, aV as yn, aW as Qe, aX as vn, aY as xn, x as bn, a as wn, aZ as kn, a_ as jn, a6 as Cn, a$ as Tn, i as Sn, S as et, aw as In } from "./index-0OqmBgqo.js";
|
|
9
9
|
import { useTranslation as En } from "react-i18next";
|
|
10
10
|
import { useAtom as F } from "jotai";
|
|
11
11
|
import Pe from "react-dom";
|
|
12
12
|
import { g as Dn, S as Re, a as tt } from "./MODIFIERS-MLfpKQY1.js";
|
|
13
|
-
import { r as nt, u as Bn, B as On, E as An } from "./index-
|
|
13
|
+
import { r as nt, u as Bn, B as On, E as An } from "./index-4fMl4eN2.js";
|
|
14
14
|
import { Quill as Pn } from "react-quill";
|
|
15
|
-
import { u as Rn } from "./useAddBlockByDrop-
|
|
15
|
+
import { u as Rn } from "./useAddBlockByDrop-5QW86HjG.js";
|
|
16
16
|
import { useFeature as rt } from "flagged";
|
|
17
17
|
import { flip as Mn } from "@floating-ui/dom";
|
|
18
18
|
import { useFloating as _n, shift as Ln } from "@floating-ui/react-dom";
|
|
@@ -23,7 +23,7 @@ import { twMerge as Wn } from "tailwind-merge";
|
|
|
23
23
|
import { getBlockComponent as Hn } from "@chaibuilder/runtime";
|
|
24
24
|
import "@radix-ui/react-toggle";
|
|
25
25
|
import "class-variance-authority";
|
|
26
|
-
import "./utils-
|
|
26
|
+
import "./utils-XsPKXMVo.js";
|
|
27
27
|
import "clsx";
|
|
28
28
|
import "@radix-ui/react-switch";
|
|
29
29
|
import "@radix-ui/react-slot";
|
|
@@ -52,7 +52,7 @@ import "react-dnd";
|
|
|
52
52
|
import "@minoru/react-dnd-treeview";
|
|
53
53
|
import "react-hotkeys-hook";
|
|
54
54
|
import "sonner";
|
|
55
|
-
import "./html-to-json-
|
|
55
|
+
import "./html-to-json-Y5M0N8PH.js";
|
|
56
56
|
import "himalaya";
|
|
57
57
|
import "lucide-react";
|
|
58
58
|
const qn = () => {
|
|
@@ -1405,7 +1405,7 @@ const Sr = () => {
|
|
|
1405
1405
|
)
|
|
1406
1406
|
}
|
|
1407
1407
|
);
|
|
1408
|
-
}, Dr = Ct(() => import("./AddBlocks-
|
|
1408
|
+
}, Dr = Ct(() => import("./AddBlocks-FsdsASNp.js")), Ps = () => {
|
|
1409
1409
|
const [e, t] = F(In);
|
|
1410
1410
|
return /* @__PURE__ */ r.jsxs("div", { className: "flex h-full w-full flex-col", children: [
|
|
1411
1411
|
/* @__PURE__ */ r.jsx(Jn, {}),
|