@chaibuilder/sdk 1.1.18 → 1.2.1
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-57-vroWk.cjs +1 -0
- package/dist/AddBlocks-QvCc-oag.js +225 -0
- package/dist/BrandingOptions-arKT1zCy.cjs +1 -0
- package/dist/{BrandingOptions-zFJ28xmJ.js → BrandingOptions-mZXO7thQ.js} +27 -25
- package/dist/{CanvasArea-vTV3O27-.js → CanvasArea-59Gm0EZx.js} +581 -598
- package/dist/CanvasArea-jRg53jrS.cjs +59 -0
- package/dist/CurrentPage-MLObvs0K.cjs +1 -0
- package/dist/{CurrentPage-Ay7X9h9y.js → CurrentPage-YPI5QTjk.js} +17 -14
- package/dist/Functions-7jnEwJyw.js +15 -0
- package/dist/Functions-N3yhPYKY.cjs +1 -0
- package/dist/{Layers-CWnzKXMo.js → Layers-no2keK4N.js} +149 -146
- package/dist/Layers-x_mWeT_q.cjs +1 -0
- package/dist/MODIFIERS-2FeVfZQ9.cjs +1 -0
- package/dist/{MODIFIERS-MLfpKQY1.js → MODIFIERS-RiXS5Mn1.js} +7 -13
- package/dist/MarkAsGlobalBlock-S2BhHTsK.cjs +1 -0
- package/dist/{MarkAsGlobalBlock-uhj0kGZo.js → MarkAsGlobalBlock-SPWd6Flk.js} +9 -7
- package/dist/{PagesPanel-ALbBHaO3.js → PagesPanel-Q08uN4X3.js} +12 -9
- package/dist/PagesPanel-pOIuFPOA.cjs +1 -0
- package/dist/ProjectPanel-4bN_GyNm.cjs +1 -0
- package/dist/{ProjectPanel-tIDarI9R.js → ProjectPanel-zzYV9yrV.js} +25 -22
- package/dist/{Settings-5uDMY9SU.js → Settings-28A7R61i.js} +334 -331
- package/dist/Settings-KlTtgu3w.cjs +1 -0
- package/dist/{SidePanels-D6U95ur1.js → SidePanels--ZK6Iqou.js} +80 -77
- package/dist/SidePanels-eJBA_cUu.cjs +1 -0
- package/dist/{Topbar-_-1HX-EE.js → Topbar-ks1ckGLz.js} +15 -13
- package/dist/Topbar-u5XKdWgQ.cjs +1 -0
- package/dist/{UnsplashImages-mqK09h8E.js → UnsplashImages-8vJPuqrF.js} +25 -23
- package/dist/UnsplashImages-V8oKEHfi.cjs +1 -0
- package/dist/{UploadImages-IDkkRuhx.js → UploadImages-6N6UrjLo.js} +26 -24
- package/dist/UploadImages-eHYxwWAp.cjs +1 -0
- package/dist/_commonjsHelpers-UyOWmZb0.js +8 -0
- package/dist/_commonjsHelpers-wDK0ZLPo.cjs +1 -0
- package/dist/{add-page-modal-C1UGoRkw.js → add-page-modal-EHIYTW4T.js} +27 -24
- package/dist/add-page-modal-OvNXLGf0.cjs +1 -0
- package/dist/{confirm-alert-ea5xpncD.js → confirm-alert-biqvaLT-.js} +9 -7
- package/dist/confirm-alert-f3DYO5Hj.cjs +1 -0
- package/dist/controls-Dy1qa8Dc.cjs +1 -0
- package/dist/controls-XPXGHKht.js +182 -0
- package/dist/core.cjs +1 -1
- package/dist/core.d.ts +10 -1
- package/dist/core.js +60 -57
- package/dist/delete-page-modal-U4yiuhx0.cjs +1 -0
- package/dist/{delete-page-modal-0GxR128b.js → delete-page-modal-qZJCk_JH.js} +15 -12
- package/dist/email-blocks.cjs +1 -0
- package/dist/email-blocks.d.ts +3 -0
- package/dist/email-blocks.js +35 -0
- package/dist/{form-irY39wvJ.js → form-Moz_psOw.js} +16 -16
- package/dist/form-lJhy9DEC.cjs +1 -0
- package/dist/functions-Ox_svtKm.cjs +1 -0
- package/dist/functions-xIebp8Aw.js +23 -0
- package/dist/html-to-json-dfALTAdG.cjs +1 -0
- package/dist/{html-to-json-wmbV9eZP.js → html-to-json-xKBERAI1.js} +47 -46
- package/dist/index-IIJ_o44s.cjs +1 -0
- package/dist/{index-qEix1meh.js → index-QEchoZ98.js} +8 -8
- package/dist/{index-0OqmBgqo.js → index-_OgCuSUz.js} +528 -533
- package/dist/{index-npVo1wi3.cjs → index-hMoPNZVn.cjs} +2 -2
- package/dist/{jsx-runtime-NV737rRe.js → jsx-runtime-WbnYoNE9.js} +1 -1
- package/dist/{jsx-runtime-WUGKV8jN.cjs → jsx-runtime-Z_BpKhVy.cjs} +7 -7
- package/dist/lib.cjs +2 -2
- package/dist/lib.d.ts +1 -1
- package/dist/lib.js +47 -44
- package/dist/page-viewer-WhM1FSU0.cjs +1 -0
- package/dist/{page-viewer-mgnZt6nO.js → page-viewer-zFLkUu2I.js} +17 -14
- package/dist/{project-general-setting-M52W-vUp.js → project-general-setting-MWGOOurD.js} +16 -13
- package/dist/project-general-setting-y8daY7V9.cjs +1 -0
- package/dist/project-seo-setting-9JGBPzcA.cjs +1 -0
- package/dist/{project-seo-setting-EhqUcTKy.js → project-seo-setting-dXclexQW.js} +15 -13
- package/dist/render.cjs +1 -1
- package/dist/render.d.ts +1 -1
- package/dist/render.js +50 -49
- package/dist/server.cjs +1 -1
- package/dist/server.d.ts +1 -1
- package/dist/server.js +11 -11
- package/dist/single-page-detail--xPv74bX.cjs +1 -0
- package/dist/{single-page-detail-61UDUgWG.js → single-page-detail-C48IPzbd.js} +77 -74
- package/dist/studio.cjs +1 -1
- package/dist/studio.js +11 -8
- package/dist/ui.cjs +1 -1
- package/dist/ui.d.ts +3 -3
- package/dist/ui.js +144 -142
- package/dist/useAddBlockByDrop-_nd8yZBa.cjs +1 -0
- package/dist/useAddBlockByDrop-uPXvrg4G.js +20 -0
- package/dist/{utils-XsPKXMVo.js → utils-AvyFzbPC.js} +26 -35
- package/dist/utils-PTxFk6qT.cjs +1 -0
- package/dist/web-blocks.cjs +9 -0
- package/dist/web-blocks.d.ts +3 -0
- package/dist/web-blocks.js +1033 -0
- package/package.json +5 -2
- package/dist/AddBlocks-sKF4ti68.js +0 -222
- package/dist/AddBlocks-yPovJXtD.cjs +0 -1
- package/dist/BrandingOptions-TRVyCvVq.cjs +0 -1
- package/dist/CanvasArea-xxqOiENt.cjs +0 -59
- package/dist/CurrentPage-ju6otPNk.cjs +0 -1
- package/dist/Layers-d9OU0HRE.cjs +0 -1
- package/dist/MODIFIERS-WFzDQfiT.cjs +0 -1
- package/dist/MarkAsGlobalBlock-CDmEHNx7.cjs +0 -1
- package/dist/PagesPanel-F9Cdi4Pf.cjs +0 -1
- package/dist/ProjectPanel-T49RUDyt.cjs +0 -1
- package/dist/Settings-eZnusNbR.cjs +0 -1
- package/dist/SidePanels-BVM5JwGC.cjs +0 -1
- package/dist/Topbar-gQxbcPtG.cjs +0 -1
- package/dist/UnsplashImages-PNp5fYCc.cjs +0 -1
- package/dist/UploadImages-BoSSsLtD.cjs +0 -1
- package/dist/add-page-modal-HP1yv9yJ.cjs +0 -1
- package/dist/confirm-alert-dHRDZrA1.cjs +0 -1
- package/dist/controls-QnyBNkXG.cjs +0 -36
- package/dist/controls-kEuiMMDf.js +0 -4600
- package/dist/delete-page-modal-yOgfPcHr.cjs +0 -1
- package/dist/form-6qGAOYI3.cjs +0 -1
- package/dist/functions-86L6n983.js +0 -23
- package/dist/functions-Jr7gX_RX.cjs +0 -1
- package/dist/html-to-json-AqLy6ye-.cjs +0 -1
- package/dist/index-d55M5MRz.cjs +0 -1
- package/dist/lodash-2us0VT8I.cjs +0 -36
- package/dist/lodash-3gkdNK5u.js +0 -4538
- package/dist/page-viewer-G2YIKVSt.cjs +0 -1
- package/dist/project-general-setting-sinIiBKe.cjs +0 -1
- package/dist/project-seo-setting-N0OnBCvh.cjs +0 -1
- package/dist/single-page-detail-oa-yTXhQ.cjs +0 -1
- package/dist/useAddBlockByDrop-5QW86HjG.js +0 -20
- package/dist/useAddBlockByDrop-Ckzuvu-s.cjs +0 -1
- package/dist/utils-37UXq2O5.cjs +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-Z_BpKhVy.cjs"),a=require("react"),t=require("lodash-es"),R=require("jotai"),q=require("react-i18next"),s=require("./index-IIJ_o44s.cjs"),C=require("@radix-ui/react-icons"),b=require("@chaibuilder/runtime"),w=require("flagged"),N=require("lucide-react"),B=require("react-dnd"),A=require("./html-to-json-dfALTAdG.cjs");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("@radix-ui/react-toggle");require("class-variance-authority");require("./utils-PTxFk6qT.cjs");require("./MODIFIERS-2FeVfZQ9.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("./Functions-N3yhPYKY.cjs");require("redux-undo");require("@react-hookz/web");require("himalaya");require("lodash");const S=({block:r})=>{const{type:o,icon:i,label:n}=r,{addCoreBlock:m,addPredefinedBlock:d}=s.useAddBlock(),[p,l]=s.useSelectedBlockIds(),[,h]=s.useHighlightBlockId(),[,j]=R.useAtom(s.activePanelAtom),u=()=>{t.has(r,"blocks")?d(b.syncBlocksWithDefaults(r.blocks),t.first(p)):m(r,t.first(p)),j("layers")},c=w.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:u,type:"button",onDragStart:g=>{g.dataTransfer.setData("text/plain",JSON.stringify(t.omit(r,["component","icon"]))),setTimeout(()=>{l([]),h(null),j("layers")},200)},draggable:c?"true":"false",className:"space-y-2 rounded-lg border border-border p-3 text-center hover:bg-slate-300/50 "+(c?"cursor-grab":"cursor-pointer"),children:[a.createElement(i||C.BoxIcon,{className:"w-4 h-4 mx-auto"}),e.jsxRuntimeExports.jsx("p",{className:"truncate text-xs",children:n||o})]})}),e.jsxRuntimeExports.jsx(s.TooltipContent,{children:e.jsxRuntimeExports.jsx("p",{children:n||o})})]})})},I=({block:r,closePopover:o})=>{var c;const[i,n]=a.useState(!1),m=s.useBuilderProp("getExternalPredefinedBlock"),{addCoreBlock:d,addPredefinedBlock:p}=s.useAddBlock(),[l]=s.useSelectedBlockIds(),[,h,j]=B.useDrag(()=>({type:"CHAI_BLOCK",item:r}),[r]),u=a.useCallback(async g=>{if(g.stopPropagation(),t.has(r,"component")){d(r,t.first(l)),o();return}n(!0);const f=await m(r);t.isEmpty(f)||p(b.syncBlocksWithDefaults(f),t.first(l)),o()},[r]);return e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx(B.DragPreviewImage,{connect:j,src:"https://placehold.co/100x30/000000/FFF?text="+((c=r.name||r.label)==null?void 0:c.replace(" ","+"))}),e.jsxRuntimeExports.jsxs("div",{ref:h,onClick:i?()=>{}:u,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:[i&&e.jsxRuntimeExports.jsxs("div",{className:"absolute flex h-full w-full items-center justify-center bg-black bg-opacity-70",children:[e.jsxRuntimeExports.jsx(N.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})})]})]})},P=()=>{const{data:r}=s.useUILibraryBlocks(),o=b.useChaiBlocks(),i=t.filter(t.values(o),{category:"custom"}),n=t.groupBy(i,"group"),m=t.groupBy(r,"group"),d=a.useMemo(()=>t.mergeWith(n,m,(u,c)=>{if(t.isArray(u)&&t.isArray(c))return[...u,...c]}),[n,m]),[p,l]=a.useState(t.first(t.keys(d))||""),[,h]=R.useAtom(s.activePanelAtom),j=t.get(d,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:u=>l(u),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"}),a.Children.toArray(t.map(d,(u,c)=>e.jsxRuntimeExports.jsx(s.SelectItem,{value:c,children:c},c)))]})]})}),e.jsxRuntimeExports.jsx("div",{className:"h-full w-full space-y-2 overflow-y-auto px-2",children:a.Children.toArray(j.map(u=>e.jsxRuntimeExports.jsx(I,{block:u,closePopover:()=>h("layers")})))})]})},_=()=>{const{t:r}=q.useTranslation(),[o,i]=a.useState(""),{addPredefinedBlock:n}=s.useAddBlock(),[m]=s.useSelectedBlockIds(),[,d]=R.useAtom(s.activePanelAtom),p=()=>{const l=A.getBlocksFromHTML(o);n([...l],t.first(m)||null),i(""),d("layers")};return e.jsxRuntimeExports.jsxs(s.Card,{className:"border-border/0 p-0 shadow-none",children:[e.jsxRuntimeExports.jsx(s.CardHeader,{className:"p-3",children:e.jsxRuntimeExports.jsx(s.CardDescription,{children:r("html_snippet_description")})}),e.jsxRuntimeExports.jsx(s.CardContent,{className:"space-y-2 px-3 py-0",children:e.jsxRuntimeExports.jsxs("div",{className:"space-y-1",children:[e.jsxRuntimeExports.jsx(s.Label,{htmlFor:"current",className:"text-sm",children:r("tailwind_html_snippet")}),e.jsxRuntimeExports.jsx(s.Textarea,{autoFocus:!0,tabIndex:1,ref:l=>l&&l.focus(),onChange:l=>i(l.target.value),rows:12,value:o,placeholder:r("enter_code_snippet"),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:o.trim()==="",onClick:()=>p(),size:"sm",className:"w-full",children:r("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:r("note_imported_html")})})]})]})},k=["ListItem","TableHead","TableBody","TableRow","TableCell","Column"],L=(r,o)=>{if(!r)return!t.includes(k,o);const i=r._type;return i==="List"?o==="ListItem":i==="Table"?o==="TableHead"||o==="TableBody":i==="TableHead"||i==="TableBody"?o==="TableRow":i==="TableRow"?o==="TableCell":i==="Row"?o==="Column":!t.includes(k,o)},H=()=>{const{t:r}=q.useTranslation(),[o,i]=a.useState("core"),[n,m]=a.useState("basic"),d=b.useChaiBlocks(),[,p]=R.useAtom(s.showPredefinedBlockCategoryAtom),l=s.useBuilderProp("importHTML",!0),[h]=s.useSelectedBlockIds(),j=s.useAllBlocks(),u=t.find(j,{_id:t.first(h)}),{data:c,isLoading:g}=s.useUILibraryBlocks(),f=t.groupBy(t.filter(d,x=>L(u,x.type)),"category"),E=t.uniq(t.map(f.core,"group"));a.useEffect(()=>{!t.includes(E,n)&&!t.isEmpty(E)&&!t.isEmpty(n)&&m(t.first(E))},[E,n]);const T=x=>m(y=>y===x?"":x),v=!g&&!t.isEmpty(c)||t.find(t.values(d),{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:r("add_block")}),e.jsxRuntimeExports.jsx("span",{className:"p-0 text-xs font-light leading-3 opacity-80 xl:pl-1",children:r(o==="html"?"enter_paste_tailwind_html":"click_to_add_block")})]}),e.jsxRuntimeExports.jsx(s.Tabs,{onValueChange:x=>{p(""),i(x)},value:o,className:"h-max",children:e.jsxRuntimeExports.jsxs(s.TabsList,{className:"grid w-full "+(v&&l?"grid-cols-3":"grid-cols-2"),children:[e.jsxRuntimeExports.jsx(s.TabsTrigger,{value:"core",children:r("core")}),v?e.jsxRuntimeExports.jsx(s.TabsTrigger,{value:"ui-blocks",children:r("custom_blocks")}):null,l?e.jsxRuntimeExports.jsx(s.TabsTrigger,{value:"html",children:r("import")}):null]})}),o==="core"&&e.jsxRuntimeExports.jsx(s.ScrollArea,{className:"-mx-1.5 h-full",children:e.jsxRuntimeExports.jsx(s.Accordion,{type:"single",value:n,className:"w-full px-3",children:a.Children.toArray(t.map(E,x=>t.reject(t.filter(t.values(f.core),{group:x}),{hidden:!0}).length?e.jsxRuntimeExports.jsxs(s.AccordionItem,{value:x,className:"border-border",children:[e.jsxRuntimeExports.jsx(s.AccordionTrigger,{onClick:()=>T(x),className:"py-2 capitalize",children:x}),e.jsxRuntimeExports.jsx(s.AccordionContent,{children:e.jsxRuntimeExports.jsx("div",{className:"grid grid-cols-3 gap-2",children:a.Children.toArray(t.reject(t.filter(t.values(f.core),{group:x}),{hidden:!0}).map(y=>e.jsxRuntimeExports.jsx(S,{block:y})))})})]}):null))})}),o==="ui-blocks"&&e.jsxRuntimeExports.jsx(a.Suspense,{fallback:e.jsxRuntimeExports.jsx(s.Skeleton,{className:"h-32 w-full"}),children:e.jsxRuntimeExports.jsx(P,{})}),o==="html"&&l?e.jsxRuntimeExports.jsx(_,{}):null]})};exports.default=H;
|
|
@@ -0,0 +1,225 @@
|
|
|
1
|
+
import { j as e } from "./jsx-runtime-WbnYoNE9.js";
|
|
2
|
+
import B, { createElement as U, useState as b, useCallback as W, useMemo as J, useEffect as K, Suspense as Q } from "react";
|
|
3
|
+
import { has as R, first as u, omit as X, isEmpty as j, filter as y, values as v, groupBy as T, mergeWith as Y, isArray as I, keys as Z, get as $, map as A, includes as _, find as H, uniq as ee, reject as F } from "lodash-es";
|
|
4
|
+
import { useAtom as k } from "jotai";
|
|
5
|
+
import { useTranslation as G } from "react-i18next";
|
|
6
|
+
import { O as P, j as w, _ as se, av as L, aC as re, aD as te, aF as oe, i as M, a8 as q, aq as le, ar as ae, as as ie, at as ce, au as D, bo as ne, bp as de, bq as me, br as pe, aH as ue, bs as xe, bt as he, B as fe, bu as ge, bv as be, bw as je, ae as ye, aw as ve, ax as Be, ay as N, bn as ke, bg as we, bh as Ce, bi as Ne, bj as Te, S as Ae } from "./index-_OgCuSUz.js";
|
|
7
|
+
import { BoxIcon as _e } from "@radix-ui/react-icons";
|
|
8
|
+
import { syncBlocksWithDefaults as z, useChaiBlocks as O } from "@chaibuilder/runtime";
|
|
9
|
+
import { useFeature as Pe } from "flagged";
|
|
10
|
+
import { Loader as Le } from "lucide-react";
|
|
11
|
+
import { useDrag as Se, DragPreviewImage as Ie } from "react-dnd";
|
|
12
|
+
import { g as He } from "./html-to-json-xKBERAI1.js";
|
|
13
|
+
import "./_commonjsHelpers-UyOWmZb0.js";
|
|
14
|
+
import "@radix-ui/react-toggle";
|
|
15
|
+
import "class-variance-authority";
|
|
16
|
+
import "./utils-AvyFzbPC.js";
|
|
17
|
+
import "./MODIFIERS-RiXS5Mn1.js";
|
|
18
|
+
import "clsx";
|
|
19
|
+
import "tailwind-merge";
|
|
20
|
+
import "@radix-ui/react-switch";
|
|
21
|
+
import "@radix-ui/react-slot";
|
|
22
|
+
import "@radix-ui/react-accordion";
|
|
23
|
+
import "@radix-ui/react-alert-dialog";
|
|
24
|
+
import "@radix-ui/react-dialog";
|
|
25
|
+
import "@radix-ui/react-label";
|
|
26
|
+
import "@radix-ui/react-scroll-area";
|
|
27
|
+
import "@radix-ui/react-tabs";
|
|
28
|
+
import "@radix-ui/react-tooltip";
|
|
29
|
+
import "@radix-ui/react-popover";
|
|
30
|
+
import "@radix-ui/react-menubar";
|
|
31
|
+
import "@radix-ui/react-hover-card";
|
|
32
|
+
import "@radix-ui/react-select";
|
|
33
|
+
import "@radix-ui/react-dropdown-menu";
|
|
34
|
+
import "@radix-ui/react-separator";
|
|
35
|
+
import "@radix-ui/react-toast";
|
|
36
|
+
import "cmdk";
|
|
37
|
+
import "@radix-ui/react-context-menu";
|
|
38
|
+
import "react-icons-picker";
|
|
39
|
+
import "react-dom";
|
|
40
|
+
import "react-quill";
|
|
41
|
+
import "flat-to-nested";
|
|
42
|
+
import "./Functions-7jnEwJyw.js";
|
|
43
|
+
import "redux-undo";
|
|
44
|
+
import "@react-hookz/web";
|
|
45
|
+
import "himalaya";
|
|
46
|
+
import "lodash";
|
|
47
|
+
const Fe = ({ block: s }) => {
|
|
48
|
+
const { type: r, icon: t, label: l } = s, { addCoreBlock: d, addPredefinedBlock: c } = P(), [m, o] = w(), [, x] = se(), [, p] = k(L), i = () => {
|
|
49
|
+
R(s, "blocks") ? c(z(s.blocks), u(m)) : d(s, u(m)), p("layers");
|
|
50
|
+
}, a = Pe("dnd");
|
|
51
|
+
return /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsxs(re, { children: [
|
|
52
|
+
/* @__PURE__ */ e.jsx(te, { asChild: !0, children: /* @__PURE__ */ e.jsxs(
|
|
53
|
+
"button",
|
|
54
|
+
{
|
|
55
|
+
onClick: i,
|
|
56
|
+
type: "button",
|
|
57
|
+
onDragStart: (f) => {
|
|
58
|
+
f.dataTransfer.setData("text/plain", JSON.stringify(X(s, ["component", "icon"]))), setTimeout(() => {
|
|
59
|
+
o([]), x(null), p("layers");
|
|
60
|
+
}, 200);
|
|
61
|
+
},
|
|
62
|
+
draggable: a ? "true" : "false",
|
|
63
|
+
className: "space-y-2 rounded-lg border border-border p-3 text-center hover:bg-slate-300/50 " + (a ? "cursor-grab" : "cursor-pointer"),
|
|
64
|
+
children: [
|
|
65
|
+
U(t || _e, { className: "w-4 h-4 mx-auto" }),
|
|
66
|
+
/* @__PURE__ */ e.jsx("p", { className: "truncate text-xs", children: l || r })
|
|
67
|
+
]
|
|
68
|
+
}
|
|
69
|
+
) }),
|
|
70
|
+
/* @__PURE__ */ e.jsx(oe, { children: /* @__PURE__ */ e.jsx("p", { children: l || r }) })
|
|
71
|
+
] }) });
|
|
72
|
+
}, De = ({ block: s, closePopover: r }) => {
|
|
73
|
+
var a;
|
|
74
|
+
const [t, l] = b(!1), d = M("getExternalPredefinedBlock"), { addCoreBlock: c, addPredefinedBlock: m } = P(), [o] = w(), [, x, p] = Se(
|
|
75
|
+
() => ({
|
|
76
|
+
type: "CHAI_BLOCK",
|
|
77
|
+
item: s
|
|
78
|
+
}),
|
|
79
|
+
[s]
|
|
80
|
+
), i = W(
|
|
81
|
+
async (f) => {
|
|
82
|
+
if (f.stopPropagation(), R(s, "component")) {
|
|
83
|
+
c(s, u(o)), r();
|
|
84
|
+
return;
|
|
85
|
+
}
|
|
86
|
+
l(!0);
|
|
87
|
+
const h = await d(s);
|
|
88
|
+
j(h) || m(z(h), u(o)), r();
|
|
89
|
+
},
|
|
90
|
+
[s]
|
|
91
|
+
);
|
|
92
|
+
return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
93
|
+
/* @__PURE__ */ e.jsx(
|
|
94
|
+
Ie,
|
|
95
|
+
{
|
|
96
|
+
connect: p,
|
|
97
|
+
src: "https://placehold.co/100x30/000000/FFF?text=" + ((a = s.name || s.label) == null ? void 0 : a.replace(" ", "+"))
|
|
98
|
+
}
|
|
99
|
+
),
|
|
100
|
+
/* @__PURE__ */ e.jsxs(
|
|
101
|
+
"div",
|
|
102
|
+
{
|
|
103
|
+
ref: x,
|
|
104
|
+
onClick: t ? () => {
|
|
105
|
+
} : i,
|
|
106
|
+
className: "relative cursor-pointer overflow-hidden rounded-md border border-transparent duration-200 hover:scale-x-105 hover:border-foreground/20 hover:shadow-2xl",
|
|
107
|
+
children: [
|
|
108
|
+
t && /* @__PURE__ */ e.jsxs("div", { className: "absolute flex h-full w-full items-center justify-center bg-black bg-opacity-70", children: [
|
|
109
|
+
/* @__PURE__ */ e.jsx(Le, { className: "animate-spin", size: 15, color: "white" }),
|
|
110
|
+
" ",
|
|
111
|
+
/* @__PURE__ */ e.jsx("span", { className: "pl-2 text-sm text-white", children: "Adding..." })
|
|
112
|
+
] }),
|
|
113
|
+
s.preview ? /* @__PURE__ */ e.jsx(
|
|
114
|
+
"img",
|
|
115
|
+
{
|
|
116
|
+
src: s.preview,
|
|
117
|
+
className: "min-h-[50px] w-full rounded-md border border-gray-300",
|
|
118
|
+
alt: s.label
|
|
119
|
+
}
|
|
120
|
+
) : /* @__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.label }) })
|
|
121
|
+
]
|
|
122
|
+
}
|
|
123
|
+
)
|
|
124
|
+
] });
|
|
125
|
+
}, Ee = () => {
|
|
126
|
+
const { data: s } = q(), r = O(), t = y(v(r), { category: "custom" }), l = T(t, "group"), d = T(s, "group"), c = J(() => Y(l, d, (i, a) => {
|
|
127
|
+
if (I(i) && I(a))
|
|
128
|
+
return [...i, ...a];
|
|
129
|
+
}), [l, d]), [m, o] = b(u(Z(c)) || ""), [, x] = k(L), p = $(c, m, []);
|
|
130
|
+
return /* @__PURE__ */ e.jsxs("div", { className: "relative flex flex-col h-full max-h-full overflow-hidden py-2", children: [
|
|
131
|
+
/* @__PURE__ */ e.jsx("div", { className: "p-3 sticky top-0 flex w-full items-center", children: /* @__PURE__ */ e.jsxs(le, { value: m, onValueChange: (i) => o(i), children: [
|
|
132
|
+
/* @__PURE__ */ e.jsx(ae, { className: "w-full", children: /* @__PURE__ */ e.jsx(ie, { placeholder: "Select a provider" }) }),
|
|
133
|
+
/* @__PURE__ */ e.jsxs(ce, { children: [
|
|
134
|
+
/* @__PURE__ */ e.jsx(D, { value: "", children: "Choose" }),
|
|
135
|
+
B.Children.toArray(
|
|
136
|
+
A(c, (i, a) => /* @__PURE__ */ e.jsx(D, { value: a, children: a }, a))
|
|
137
|
+
)
|
|
138
|
+
] })
|
|
139
|
+
] }) }),
|
|
140
|
+
/* @__PURE__ */ e.jsx("div", { className: "h-full w-full space-y-2 overflow-y-auto px-2", children: B.Children.toArray(
|
|
141
|
+
p.map((i) => /* @__PURE__ */ e.jsx(De, { block: i, closePopover: () => x("layers") }))
|
|
142
|
+
) })
|
|
143
|
+
] });
|
|
144
|
+
}, Re = () => {
|
|
145
|
+
const { t: s } = G(), [r, t] = b(""), { addPredefinedBlock: l } = P(), [d] = w(), [, c] = k(L), m = () => {
|
|
146
|
+
const o = He(r);
|
|
147
|
+
l([...o], u(d) || null), t(""), c("layers");
|
|
148
|
+
};
|
|
149
|
+
return /* @__PURE__ */ e.jsxs(ne, { className: "border-border/0 p-0 shadow-none", children: [
|
|
150
|
+
/* @__PURE__ */ e.jsx(de, { className: "p-3", children: /* @__PURE__ */ e.jsx(me, { children: s("html_snippet_description") }) }),
|
|
151
|
+
/* @__PURE__ */ e.jsx(pe, { className: "space-y-2 px-3 py-0", children: /* @__PURE__ */ e.jsxs("div", { className: "space-y-1", children: [
|
|
152
|
+
/* @__PURE__ */ e.jsx(ue, { htmlFor: "current", className: "text-sm", children: s("tailwind_html_snippet") }),
|
|
153
|
+
/* @__PURE__ */ e.jsx(
|
|
154
|
+
xe,
|
|
155
|
+
{
|
|
156
|
+
autoFocus: !0,
|
|
157
|
+
tabIndex: 1,
|
|
158
|
+
ref: (o) => o && o.focus(),
|
|
159
|
+
onChange: (o) => t(o.target.value),
|
|
160
|
+
rows: 12,
|
|
161
|
+
value: r,
|
|
162
|
+
placeholder: s("enter_code_snippet"),
|
|
163
|
+
className: "resize-none bg-gray-100 overflow-x-auto whitespace-pre text-xs font-mono font-normal"
|
|
164
|
+
}
|
|
165
|
+
)
|
|
166
|
+
] }) }),
|
|
167
|
+
/* @__PURE__ */ e.jsxs(he, { className: "flex flex-col justify-end p-3", children: [
|
|
168
|
+
/* @__PURE__ */ e.jsx(fe, { disabled: r.trim() === "", onClick: () => m(), size: "sm", className: "w-full", children: s("import_html") }),
|
|
169
|
+
/* @__PURE__ */ e.jsx(ge, { variant: "default", className: "mt-2 p-1 border-none text-gray-400", children: /* @__PURE__ */ e.jsx(be, { className: "text-xs font-normal leading-4", children: s("note_imported_html") }) })
|
|
170
|
+
] })
|
|
171
|
+
] });
|
|
172
|
+
}, E = ["ListItem", "TableHead", "TableBody", "TableRow", "TableCell", "Column"], Ge = (s, r) => {
|
|
173
|
+
if (!s)
|
|
174
|
+
return !_(E, r);
|
|
175
|
+
const t = s._type;
|
|
176
|
+
return t === "List" ? r === "ListItem" : t === "Table" ? r === "TableHead" || r === "TableBody" : t === "TableHead" || t === "TableBody" ? r === "TableRow" : t === "TableRow" ? r === "TableCell" : t === "Row" ? r === "Column" : !_(E, r);
|
|
177
|
+
}, Ss = () => {
|
|
178
|
+
const { t: s } = G(), [r, t] = b("core"), [l, d] = b("basic"), c = O(), [, m] = k(je), o = M("importHTML", !0), [x] = w(), p = ye(), i = H(p, { _id: u(x) }), { data: a, isLoading: f } = q(), h = T(
|
|
179
|
+
y(c, (n) => Ge(i, n.type)),
|
|
180
|
+
"category"
|
|
181
|
+
), g = ee(A(h.core, "group"));
|
|
182
|
+
K(() => {
|
|
183
|
+
!_(g, l) && !j(g) && !j(l) && d(u(g));
|
|
184
|
+
}, [g, l]);
|
|
185
|
+
const V = (n) => d((C) => C === n ? "" : n), S = !f && !j(a) || H(v(c), { category: "custom" }) !== void 0;
|
|
186
|
+
return /* @__PURE__ */ e.jsxs("div", { className: "flex h-full flex-col overflow-hidden", children: [
|
|
187
|
+
/* @__PURE__ */ e.jsxs("div", { className: "mb-2 flex flex-col justify-between rounded-md bg-background/30 p-1", children: [
|
|
188
|
+
/* @__PURE__ */ e.jsx("h1", { className: "flex flex-col items-baseline px-1 text-xl font-semibold xl:flex-col", children: s("add_block") }),
|
|
189
|
+
/* @__PURE__ */ e.jsx("span", { className: "p-0 text-xs font-light leading-3 opacity-80 xl:pl-1", children: s(r === "html" ? "enter_paste_tailwind_html" : "click_to_add_block") })
|
|
190
|
+
] }),
|
|
191
|
+
/* @__PURE__ */ e.jsx(
|
|
192
|
+
ve,
|
|
193
|
+
{
|
|
194
|
+
onValueChange: (n) => {
|
|
195
|
+
m(""), t(n);
|
|
196
|
+
},
|
|
197
|
+
value: r,
|
|
198
|
+
className: "h-max",
|
|
199
|
+
children: /* @__PURE__ */ e.jsxs(Be, { className: "grid w-full " + (S && o ? "grid-cols-3" : "grid-cols-2"), children: [
|
|
200
|
+
/* @__PURE__ */ e.jsx(N, { value: "core", children: s("core") }),
|
|
201
|
+
S ? /* @__PURE__ */ e.jsx(N, { value: "ui-blocks", children: s("custom_blocks") }) : null,
|
|
202
|
+
o ? /* @__PURE__ */ e.jsx(N, { value: "html", children: s("import") }) : null
|
|
203
|
+
] })
|
|
204
|
+
}
|
|
205
|
+
),
|
|
206
|
+
r === "core" && /* @__PURE__ */ e.jsx(ke, { className: "-mx-1.5 h-full", children: /* @__PURE__ */ e.jsx(we, { type: "single", value: l, className: "w-full px-3", children: B.Children.toArray(
|
|
207
|
+
A(
|
|
208
|
+
g,
|
|
209
|
+
(n) => F(y(v(h.core), { group: n }), {
|
|
210
|
+
hidden: !0
|
|
211
|
+
}).length ? /* @__PURE__ */ e.jsxs(Ce, { value: n, className: "border-border", children: [
|
|
212
|
+
/* @__PURE__ */ e.jsx(Ne, { onClick: () => V(n), className: "py-2 capitalize", children: n }),
|
|
213
|
+
/* @__PURE__ */ e.jsx(Te, { children: /* @__PURE__ */ e.jsx("div", { className: "grid grid-cols-3 gap-2", children: B.Children.toArray(
|
|
214
|
+
F(y(v(h.core), { group: n }), { hidden: !0 }).map((C) => /* @__PURE__ */ e.jsx(Fe, { block: C }))
|
|
215
|
+
) }) })
|
|
216
|
+
] }) : null
|
|
217
|
+
)
|
|
218
|
+
) }) }),
|
|
219
|
+
r === "ui-blocks" && /* @__PURE__ */ e.jsx(Q, { fallback: /* @__PURE__ */ e.jsx(Ae, { className: "h-32 w-full" }), children: /* @__PURE__ */ e.jsx(Ee, {}) }),
|
|
220
|
+
r === "html" && o ? /* @__PURE__ */ e.jsx(Re, {}) : null
|
|
221
|
+
] });
|
|
222
|
+
};
|
|
223
|
+
export {
|
|
224
|
+
Ss as default
|
|
225
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("./jsx-runtime-Z_BpKhVy.cjs"),j=require("react"),B=require("@rjsf/validator-ajv8"),R=require("@rjsf/core"),g=require("./index-IIJ_o44s.cjs"),r=require("./controls-Dy1qa8Dc.cjs"),m=require("lodash-es");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("@radix-ui/react-toggle");require("class-variance-authority");require("./utils-PTxFk6qT.cjs");require("./MODIFIERS-2FeVfZQ9.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("./Functions-N3yhPYKY.cjs");require("redux-undo");require("@chaibuilder/runtime");require("@react-hookz/web");require("react-i18next");function E(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=E(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})})})},f=[{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:y,bodyTextDarkColor:q,bodyTextLightColor:b,bodyBgDarkColor:h,secondaryColor:S,bodyBgLightColor:C,roundedCorners:O}=e,v={headingFont:r.f({title:"Heading font",default:n,options:f}),bodyFont:r.f({title:"Body font",default:c,options:f}),roundedCorners:r.c({title:"Rounded Corner",default:parseInt(O||5,10)}),primaryColor:r.y({title:"Primary",default:y}),secondaryColor:r.y({title:"Secondary",default:S}),bodyBgLightColor:r.y({title:"Body Background (Light)",default:C}),bodyBgDarkColor:r.y({title:"Body Background (Dark)",default:h}),bodyTextLightColor:r.y({title:"Body Text (Light)",default:q}),bodyTextDarkColor:r.y({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(R,{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;
|
|
@@ -1,14 +1,15 @@
|
|
|
1
|
-
import { j as t } from "./jsx-runtime-
|
|
1
|
+
import { j as t } from "./jsx-runtime-WbnYoNE9.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 {
|
|
8
|
-
import "./
|
|
5
|
+
import { i as j, x as k } from "./index-_OgCuSUz.js";
|
|
6
|
+
import { f as g, c as D, y as a } from "./controls-XPXGHKht.js";
|
|
7
|
+
import { debounce as P, isEqual as R } from "lodash-es";
|
|
8
|
+
import "./_commonjsHelpers-UyOWmZb0.js";
|
|
9
9
|
import "@radix-ui/react-toggle";
|
|
10
10
|
import "class-variance-authority";
|
|
11
|
-
import "./utils-
|
|
11
|
+
import "./utils-AvyFzbPC.js";
|
|
12
|
+
import "./MODIFIERS-RiXS5Mn1.js";
|
|
12
13
|
import "clsx";
|
|
13
14
|
import "tailwind-merge";
|
|
14
15
|
import "@radix-ui/react-switch";
|
|
@@ -35,11 +36,12 @@ import "react-dom";
|
|
|
35
36
|
import "react-quill";
|
|
36
37
|
import "jotai";
|
|
37
38
|
import "flat-to-nested";
|
|
39
|
+
import "./Functions-7jnEwJyw.js";
|
|
38
40
|
import "redux-undo";
|
|
39
41
|
import "@chaibuilder/runtime";
|
|
40
42
|
import "@react-hookz/web";
|
|
41
43
|
import "react-i18next";
|
|
42
|
-
const
|
|
44
|
+
const w = ({ value: s, onChange: e, id: u, onBlur: i }) => {
|
|
43
45
|
const p = P(e, 200), d = (l) => p(l.target.value);
|
|
44
46
|
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
47
|
"input",
|
|
@@ -101,20 +103,20 @@ const T = ({ value: s, onChange: e, id: u, onBlur: i }) => {
|
|
|
101
103
|
{ title: "Lustria", value: "Lustria" },
|
|
102
104
|
{ title: "Ovo", value: "Ovo" },
|
|
103
105
|
{ title: "Suranna", value: "Suranna" }
|
|
104
|
-
],
|
|
106
|
+
], bt = () => {
|
|
105
107
|
const s = j("onSaveBrandingOptions", async () => {
|
|
106
108
|
}), [e, u] = k(), i = c.useRef(e);
|
|
107
109
|
c.useEffect(() => () => {
|
|
108
110
|
R(e, i.current) || s(i.current);
|
|
109
111
|
}, []);
|
|
110
|
-
const p = ({ formData:
|
|
111
|
-
n && (u(
|
|
112
|
+
const p = ({ formData: o }, n) => {
|
|
113
|
+
n && (u(o), i.current = o);
|
|
112
114
|
}, {
|
|
113
115
|
bodyFont: d,
|
|
114
116
|
headingFont: l,
|
|
115
117
|
primaryColor: h,
|
|
116
|
-
bodyTextDarkColor:
|
|
117
|
-
bodyTextLightColor:
|
|
118
|
+
bodyTextDarkColor: x,
|
|
119
|
+
bodyTextLightColor: y,
|
|
118
120
|
bodyBgDarkColor: b,
|
|
119
121
|
secondaryColor: C,
|
|
120
122
|
bodyBgLightColor: S,
|
|
@@ -134,39 +136,39 @@ const T = ({ value: s, onChange: e, id: u, onBlur: i }) => {
|
|
|
134
136
|
title: "Rounded Corner",
|
|
135
137
|
default: parseInt(B || 5, 10)
|
|
136
138
|
}),
|
|
137
|
-
primaryColor:
|
|
138
|
-
secondaryColor:
|
|
139
|
-
bodyBgLightColor:
|
|
139
|
+
primaryColor: a({ title: "Primary", default: h }),
|
|
140
|
+
secondaryColor: a({ title: "Secondary", default: C }),
|
|
141
|
+
bodyBgLightColor: a({
|
|
140
142
|
title: "Body Background (Light)",
|
|
141
143
|
default: S
|
|
142
144
|
}),
|
|
143
|
-
bodyBgDarkColor:
|
|
145
|
+
bodyBgDarkColor: a({
|
|
144
146
|
title: "Body Background (Dark)",
|
|
145
147
|
default: b
|
|
146
148
|
}),
|
|
147
|
-
bodyTextLightColor:
|
|
149
|
+
bodyTextLightColor: a({
|
|
148
150
|
title: "Body Text (Light)",
|
|
149
|
-
default:
|
|
151
|
+
default: x
|
|
150
152
|
}),
|
|
151
|
-
bodyTextDarkColor:
|
|
153
|
+
bodyTextDarkColor: a({
|
|
152
154
|
title: "Body Text (Dark)",
|
|
153
|
-
default:
|
|
155
|
+
default: y
|
|
154
156
|
})
|
|
155
157
|
// TODO: exteend more options from user
|
|
156
158
|
}, r = {
|
|
157
159
|
type: "object",
|
|
158
160
|
properties: {}
|
|
159
161
|
}, v = {};
|
|
160
|
-
return Object.keys(m).forEach((
|
|
161
|
-
const n = m[
|
|
162
|
-
return r.properties || (r.properties = {}), r.properties[
|
|
162
|
+
return Object.keys(m).forEach((o) => {
|
|
163
|
+
const n = m[o];
|
|
164
|
+
return r.properties || (r.properties = {}), r.properties[o] = n.schema, v[o] = n.uiSchema, !0;
|
|
163
165
|
}), /* @__PURE__ */ t.jsxs("div", { className: "flex h-full select-none flex-col", children: [
|
|
164
166
|
/* @__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
167
|
/* @__PURE__ */ t.jsx("div", { className: "-mx-2", children: /* @__PURE__ */ t.jsx(
|
|
166
168
|
N,
|
|
167
169
|
{
|
|
168
170
|
widgets: {
|
|
169
|
-
color:
|
|
171
|
+
color: w
|
|
170
172
|
},
|
|
171
173
|
idSeparator: ".",
|
|
172
174
|
autoComplete: "off",
|
|
@@ -183,5 +185,5 @@ const T = ({ value: s, onChange: e, id: u, onBlur: i }) => {
|
|
|
183
185
|
] });
|
|
184
186
|
};
|
|
185
187
|
export {
|
|
186
|
-
|
|
188
|
+
bt as default
|
|
187
189
|
};
|