@chaibuilder/sdk 1.2.19 → 1.2.21
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-157fSrJX.cjs +1 -0
- package/dist/{AddBlocks-gcTaEIKO.js → AddBlocks-WgpssWmQ.js} +25 -27
- package/dist/{BrandingOptions-bfiFY0VR.js → BrandingOptions-4961TxX2.js} +13 -15
- package/dist/BrandingOptions-nwXR9TMl.cjs +1 -0
- package/dist/CanvasArea-_BFTu_8b.js +908 -0
- package/dist/CanvasArea-eOKWgAXR.cjs +55 -0
- package/dist/{CurrentPage-0Ap2N0uc.js → CurrentPage-VAuh7F6E.js} +13 -16
- package/dist/CurrentPage-iB6nD9Rr.cjs +1 -0
- package/dist/ListTree-dvxHTXs4.js +167 -0
- package/dist/ListTree-gTmusfso.cjs +1 -0
- package/dist/Outline-g8XFGm2t.cjs +1 -0
- package/dist/Outline-jTFv40r5.js +294 -0
- package/dist/PagesPanel-Wx9JG5qR.cjs +1 -0
- package/dist/{PagesPanel-Pk-C1956.js → PagesPanel-oky0X1Ww.js} +5 -8
- package/dist/ProjectPanel-64Xg3Y_p.cjs +1 -0
- package/dist/{ProjectPanel-_KQBhuPO.js → ProjectPanel-WjVBiB-e.js} +15 -18
- package/dist/Settings-Tlqq4mqN.cjs +1 -0
- package/dist/{Settings-XtAatoiu.js → Settings-mNRbprbx.js} +761 -709
- package/dist/SidePanels-ZF4Q2R29.cjs +1 -0
- package/dist/{SidePanels-O52zKXbH.js → SidePanels-pQImwDI6.js} +7 -10
- package/dist/Topbar-NMvzqQHW.cjs +1 -0
- package/dist/{Topbar-oTx7a12r.js → Topbar-Ny9T-7Zb.js} +3 -5
- package/dist/TypeIcon-ElNNPazl.cjs +1 -0
- package/dist/TypeIcon-qO96rNbV.js +69 -0
- package/dist/UnsplashImages-6tZv1q2_.cjs +1 -0
- package/dist/{UnsplashImages-5A21uzMK.js → UnsplashImages-Y8RGFVSh.js} +13 -15
- package/dist/UploadImages-VLlVg9Ur.cjs +1 -0
- package/dist/{UploadImages-V_54lCAO.js → UploadImages-dd8LfyFr.js} +8 -10
- package/dist/{add-page-modal-dKQLw7RQ.js → add-page-modal-1mGGtAB_.js} +16 -19
- package/dist/add-page-modal-xCUKJiZv.cjs +1 -0
- package/dist/confirm-alert-f26zJ7Js.cjs +1 -0
- package/dist/{confirm-alert-8GP3bKH_.js → confirm-alert-sc8RaWvD.js} +3 -5
- package/dist/{controls-Dy1qa8Dc.cjs → controls-KK2oLIa8.cjs} +1 -1
- package/dist/{controls-XPXGHKht.js → controls-OfJWSEqC.js} +29 -28
- package/dist/core.cjs +1 -1
- package/dist/core.d.ts +1 -1
- package/dist/core.js +45 -48
- package/dist/delete-page-modal-Qa0YqBRl.cjs +1 -0
- package/dist/{delete-page-modal-Zb5ld6O-.js → delete-page-modal-yAJNstCa.js} +8 -11
- package/dist/email-blocks.cjs +1 -1
- package/dist/email-blocks.js +5 -5
- package/dist/email.cjs +1 -1
- package/dist/email.d.ts +1 -0
- package/dist/email.js +4 -7
- package/dist/{form-yyU2x7So.js → form-Nj6Kdn3g.js} +1 -1
- package/dist/{form-o6_55v8F.cjs → form-n1Q6u16z.cjs} +1 -1
- package/dist/index-9PHdn80L.cjs +1 -0
- package/dist/{index-JdnF6lYP.cjs → index-9YNkdni8.cjs} +51 -51
- package/dist/{index-WP7IRkij.js → index-IPJAbzzO.js} +1178 -1133
- package/dist/{index-BMZLAJUV.cjs → index-PlZjGTTr.cjs} +1 -1
- package/dist/{index-lFcrvDFC.js → index-iQEapw2W.js} +3 -3
- package/dist/{index-yILWlilS.js → index-kAjyc_KA.js} +8306 -8170
- package/dist/{page-viewer-3QXwPGpg.js → page-viewer-SU_BqZDK.js} +9 -12
- package/dist/page-viewer-ZA-sJD82.cjs +1 -0
- package/dist/project-general-setting-GuQyvAHS.cjs +1 -0
- package/dist/{project-general-setting-UalRmyHm.js → project-general-setting-eEmhoFvb.js} +7 -10
- package/dist/project-seo-setting-3-vBkx2v.cjs +1 -0
- package/dist/{project-seo-setting-8FsvPSPl.js → project-seo-setting-NNvAGt4T.js} +5 -7
- package/dist/single-page-detail-Z677SWqt.cjs +1 -0
- package/dist/{single-page-detail-GaB85dNv.js → single-page-detail-nxWIy6e7.js} +36 -39
- package/dist/studio.cjs +1 -1
- package/dist/studio.d.ts +1 -0
- package/dist/studio.js +4 -7
- package/dist/ui.cjs +1 -1
- package/dist/ui.js +138 -140
- package/dist/{useAddBlockByDrop-BIK2fdgj.js → useAddBlockByDrop-V8xo-PNQ.js} +1 -1
- package/dist/{useAddBlockByDrop-6EbioQV4.cjs → useAddBlockByDrop-qRHgy8_0.cjs} +1 -1
- package/dist/web-blocks.cjs +1 -1
- package/dist/web-blocks.js +1 -1
- package/package.json +26 -38
- package/dist/AddBlocks-KeHVFaIr.cjs +0 -1
- package/dist/BrandingOptions-I2I8w6E9.cjs +0 -1
- package/dist/CanvasArea-JfHkTnQD.cjs +0 -60
- package/dist/CanvasArea-xvMCbQDL.js +0 -1404
- package/dist/CurrentPage-vj52UxMA.cjs +0 -1
- package/dist/ListTree-Vq0_s1wC.cjs +0 -1
- package/dist/ListTree-k-QMO740.js +0 -96
- package/dist/Outline-HI6-c9nf.js +0 -359
- package/dist/Outline-fAflJ_lN.cjs +0 -1
- package/dist/PagesPanel-ug8Tmva6.cjs +0 -1
- package/dist/ProjectPanel-o8-6cPX-.cjs +0 -1
- package/dist/Settings-Cc9eV4VG.cjs +0 -1
- package/dist/SidePanels-ugRobm34.cjs +0 -1
- package/dist/Topbar-e5MGWX9n.cjs +0 -1
- package/dist/UnsplashImages-KSbKGs91.cjs +0 -1
- package/dist/UploadImages-V42YSRVO.cjs +0 -1
- package/dist/add-page-modal-xMedOdsp.cjs +0 -1
- package/dist/confirm-alert-KtW-4OjG.cjs +0 -1
- package/dist/delete-page-modal-lebJCBBe.cjs +0 -1
- package/dist/index-thKfFhmr.cjs +0 -1
- package/dist/page-viewer-DTIblLiz.cjs +0 -1
- package/dist/project-general-setting-g7WhM3hc.cjs +0 -1
- package/dist/project-seo-setting-xoeLQVj3.cjs +0 -1
- package/dist/single-page-detail-XdBysrE_.cjs +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-Z_BpKhVy.cjs"),c=require("react"),t=require("lodash-es"),E=require("jotai"),v=require("react-i18next"),s=require("./index-9PHdn80L.cjs"),B=require("@radix-ui/react-icons"),R=require("@chaibuilder/runtime"),q=require("flagged"),g=require("./MODIFIERS-9EwxLM8V.cjs"),k=require("lucide-react"),y=require("react-dnd"),N=require("./html-to-json-FGufPv9R.cjs");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("./Functions-N3yhPYKY.cjs");require("clsx");require("tailwind-merge");require("@react-hookz/web");require("@radix-ui/react-toggle");require("class-variance-authority");require("./Class-MmCxz2Ay.cjs");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("himalaya");const w=({block:r})=>{const{type:n,icon:d,label:a}=r,{addCoreBlock:m,addPredefinedBlock:u}=s.useAddBlock(),[x,o]=s.useSelectedBlockIds(),[,f]=s.useHighlightBlockId(),[,j]=E.useAtom(s.activePanelAtom),l=()=>{t.has(r,"blocks")?u(R.syncBlocksWithDefaults(r.blocks),t.first(x)):m(r,t.first(x)),j(g.OUTLINE_KEY)},i=q.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:l,type:"button",onDragStart:h=>{h.dataTransfer.setData("text/plain",JSON.stringify(t.omit(r,["component","icon"]))),setTimeout(()=>{o([]),f(null),j(g.OUTLINE_KEY)},200)},draggable:i?"true":"false",className:"space-y-2 rounded-lg border border-border p-3 text-center hover:bg-slate-300/50 "+(i?"cursor-grab":"cursor-pointer"),children:[c.createElement(d||B.BoxIcon,{className:"w-4 h-4 mx-auto"}),e.jsxRuntimeExports.jsx("p",{className:"truncate text-xs",children:a||n})]})}),e.jsxRuntimeExports.jsx(s.TooltipContent,{children:e.jsxRuntimeExports.jsx("p",{children:a||n})})]})})},A=({block:r,closePopover:n})=>{var i;const[d,a]=c.useState(!1),m=s.useBuilderProp("getExternalPredefinedBlock",t.noop()),{addCoreBlock:u,addPredefinedBlock:x}=s.useAddBlock(),[o]=s.useSelectedBlockIds(),[,f,j]=y.useDrag(()=>({type:"CHAI_BLOCK",item:r}),[r]),l=c.useCallback(async h=>{if(h.stopPropagation(),t.has(r,"component")){u(r,t.first(o)),n();return}a(!0);const p=await m(r);t.isEmpty(p)||x(R.syncBlocksWithDefaults(p),t.first(o)),n()},[r]);return e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx(y.DragPreviewImage,{connect:j,src:"https://placehold.co/100x30/000000/FFF?text="+((i=r.name||r.label)==null?void 0:i.replace(" ","+"))}),e.jsxRuntimeExports.jsxs("div",{ref:f,onClick:d?()=>{}:l,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:[d&&e.jsxRuntimeExports.jsxs("div",{className:"absolute flex h-full w-full items-center justify-center bg-black bg-opacity-70",children:[e.jsxRuntimeExports.jsx(k.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})})]})]})},C=()=>{const{data:r}=s.useUILibraryBlocks(),n=R.useChaiBlocks(),d=t.filter(t.values(n),{category:"custom"}),a=t.groupBy(d,"group"),m=t.groupBy(r,"group"),u=c.useMemo(()=>t.mergeWith(a,m,(l,i)=>{if(t.isArray(l)&&t.isArray(i))return[...l,...i]}),[a,m]),[x,o]=c.useState(t.first(t.keys(u))||""),[,f]=E.useAtom(s.activePanelAtom),j=t.get(u,x,[]);return e.jsxRuntimeExports.jsxs("div",{className:"relative flex h-full max-h-full flex-col overflow-hidden py-2",children:[e.jsxRuntimeExports.jsx("div",{className:"sticky top-0 flex w-full items-center p-3",children:e.jsxRuntimeExports.jsxs(s.Select,{value:x,onValueChange:l=>o(l),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(u,(l,i)=>e.jsxRuntimeExports.jsx(s.SelectItem,{value:i,children:i},i)))]})]})}),e.jsxRuntimeExports.jsx("div",{className:"h-full w-full space-y-2 overflow-y-auto px-2",children:c.Children.toArray(j.map(l=>e.jsxRuntimeExports.jsx(A,{block:l,closePopover:()=>f(g.OUTLINE_KEY)})))})]})},T=()=>{const{t:r}=v.useTranslation(),[n,d]=c.useState(""),{addPredefinedBlock:a}=s.useAddBlock(),[m]=s.useSelectedBlockIds(),[,u]=E.useAtom(s.activePanelAtom),x=()=>{const o=N.getBlocksFromHTML(n);a([...o],t.first(m)||null),d(""),u(g.OUTLINE_KEY)};return e.jsxRuntimeExports.jsxs(s.Card,{className:"border-border/0 p-0 shadow-none",children:[e.jsxRuntimeExports.jsx(s.CardHeader,{className:"p-3",children:e.jsxRuntimeExports.jsx(s.CardDescription,{children:r("html_snippet_description")})}),e.jsxRuntimeExports.jsx(s.CardContent,{className:"space-y-2 px-3 py-0",children:e.jsxRuntimeExports.jsxs("div",{className:"space-y-1",children:[e.jsxRuntimeExports.jsx(s.Label,{htmlFor:"current",className:"text-sm",children:r("tailwind_html_snippet")}),e.jsxRuntimeExports.jsx(s.Textarea,{autoFocus:!0,tabIndex:1,ref:o=>o&&o.focus(),onChange:o=>d(o.target.value),rows:12,value:n,placeholder:r("enter_code_snippet"),className:"resize-none overflow-x-auto whitespace-pre bg-gray-100 font-mono text-xs font-normal"})]})}),e.jsxRuntimeExports.jsxs(s.CardFooter,{className:"flex flex-col justify-end p-3",children:[e.jsxRuntimeExports.jsx(s.Button,{disabled:n.trim()==="",onClick:()=>x(),size:"sm",className:"w-full",children:r("import_html")}),e.jsxRuntimeExports.jsx(s.Alert,{variant:"default",className:"mt-2 border-none p-1 text-gray-400",children:e.jsxRuntimeExports.jsx(s.AlertTitle,{className:"text-xs font-normal leading-4",children:r("note_imported_html")})})]})]})},S=()=>!0,I=()=>{const{t:r}=v.useTranslation(),[n,d]=c.useState("core"),[a,m]=c.useState("basic"),u=R.useChaiBlocks(),[,x]=E.useAtom(s.showPredefinedBlockCategoryAtom),o=s.useBuilderProp("importHTMLSupport",!0),{data:f,isLoading:j}=s.useUILibraryBlocks(),l=t.groupBy(t.filter(u,()=>S()),"category"),i=t.uniq(t.map(l.core,"group"));c.useEffect(()=>{!t.includes(i,a)&&!t.isEmpty(i)&&!t.isEmpty(a)&&m(t.first(i))},[i,a]);const h=!j&&!t.isEmpty(f)||t.find(t.values(u),{category:"custom"})!==void 0;return e.jsxRuntimeExports.jsxs("div",{className:"flex h-full w-72 flex-col overflow-hidden",children:[e.jsxRuntimeExports.jsxs("div",{className:"mb-2 flex flex-col justify-between rounded-md bg-background/30 p-1",children:[e.jsxRuntimeExports.jsx("h1",{className:"flex flex-col items-baseline px-1 text-xl font-semibold xl:flex-col",children:r("add_block")}),e.jsxRuntimeExports.jsx("span",{className:"p-0 text-xs font-light leading-3 opacity-80 xl:pl-1",children:r(n==="html"?"enter_paste_tailwind_html":"click_to_add_block")})]}),e.jsxRuntimeExports.jsx(s.Tabs,{onValueChange:p=>{x(""),d(p)},value:n,className:"h-max",children:e.jsxRuntimeExports.jsxs(s.TabsList,{className:"grid w-full "+(h&&o?"grid-cols-3":h&&!o||!h&&o?"grid-cols-2":"grid-cols-1"),children:[e.jsxRuntimeExports.jsx(s.TabsTrigger,{value:"core",children:r("Blocks")}),h?e.jsxRuntimeExports.jsx(s.TabsTrigger,{value:"ui-blocks",children:r("ui_library")}):null,o?e.jsxRuntimeExports.jsx(s.TabsTrigger,{value:"html",children:r("import")}):null]})}),n==="core"&&e.jsxRuntimeExports.jsx(s.ScrollArea,{className:"-mx-1.5 h-full",children:e.jsxRuntimeExports.jsx("div",{className:"mt-2 w-full",children:c.Children.toArray(t.map(i,p=>t.reject(t.filter(t.values(l.core),{group:p}),{hidden:!0}).length?e.jsxRuntimeExports.jsx(s.Accordion,{type:"single",value:p,collapsible:!0,className:"w-full",children:e.jsxRuntimeExports.jsxs(s.AccordionItem,{value:p,children:[e.jsxRuntimeExports.jsx(s.AccordionTrigger,{className:"rounded-md bg-gray-100 px-4 py-2 capitalize",children:p}),e.jsxRuntimeExports.jsx(s.AccordionContent,{className:"p-3",children:e.jsxRuntimeExports.jsx("div",{className:"grid grid-cols-3 gap-2",children:c.Children.toArray(t.reject(t.filter(t.values(l.core),{group:p}),{hidden:!0}).map(b=>e.jsxRuntimeExports.jsx(w,{block:b})))})})]})}):null))})}),n==="ui-blocks"&&e.jsxRuntimeExports.jsx(c.Suspense,{fallback:e.jsxRuntimeExports.jsx(s.Skeleton,{className:"h-32 w-full"}),children:e.jsxRuntimeExports.jsx(C,{})}),n==="html"&&o?e.jsxRuntimeExports.jsx(T,{}):null]})};exports.default=I;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { j as e } from "./jsx-runtime-WbnYoNE9.js";
|
|
2
|
-
import v, { createElement as M, useState as f, useCallback as
|
|
2
|
+
import v, { createElement as M, useState as f, useCallback as q, useMemo as z, useEffect as O, Suspense as U } from "react";
|
|
3
3
|
import { has as L, first as h, omit as V, noop as K, isEmpty as g, filter as j, values as b, groupBy as k, mergeWith as R, isArray as _, keys as W, get as Y, map as w, uniq as J, includes as Q, find as X, reject as P } from "lodash-es";
|
|
4
4
|
import { useAtom as B } from "jotai";
|
|
5
5
|
import { useTranslation as I } from "react-i18next";
|
|
6
|
-
import { L as C, r as A, Y as Z, at as T, ap as $, aq as ee, ar as se, h as F, a3 as E, aj as re, ak as te, al as oe, am as ae, an as S,
|
|
6
|
+
import { L as C, r as A, Y as Z, at as T, ap as $, aq as ee, ar as se, h as F, a3 as E, aj as re, ak as te, al as oe, am as ae, an as S, bj as le, bk as ce, bl as ie, bm as ne, aB as de, bn as me, bo as pe, B as ue, bp as xe, bq as he, br as fe, au as ge, av as je, aw as N, bf as be, b9 as ve, ba as ye, bb as Be, bc as Ne, S as ke } from "./index-IPJAbzzO.js";
|
|
7
7
|
import { BoxIcon as we } from "@radix-ui/react-icons";
|
|
8
8
|
import { syncBlocksWithDefaults as H, useChaiBlocks as D } from "@chaibuilder/runtime";
|
|
9
9
|
import { useFeature as Ce } from "flagged";
|
|
@@ -16,7 +16,6 @@ import "./Functions-7jnEwJyw.js";
|
|
|
16
16
|
import "clsx";
|
|
17
17
|
import "tailwind-merge";
|
|
18
18
|
import "@react-hookz/web";
|
|
19
|
-
import "flat-to-nested";
|
|
20
19
|
import "@radix-ui/react-toggle";
|
|
21
20
|
import "class-variance-authority";
|
|
22
21
|
import "./Class-3k8xjeiM.js";
|
|
@@ -41,11 +40,10 @@ import "@radix-ui/react-context-menu";
|
|
|
41
40
|
import "react-icons-picker";
|
|
42
41
|
import "react-dom";
|
|
43
42
|
import "react-quill";
|
|
44
|
-
import "lodash";
|
|
45
43
|
import "himalaya";
|
|
46
44
|
const Se = ({ block: s }) => {
|
|
47
|
-
const { type: o, icon:
|
|
48
|
-
L(s, "blocks") ?
|
|
45
|
+
const { type: o, icon: i, label: l } = s, { addCoreBlock: d, addPredefinedBlock: c } = C(), [n, r] = A(), [, x] = Z(), [, p] = B(T), a = () => {
|
|
46
|
+
L(s, "blocks") ? c(H(s.blocks), h(n)) : d(s, h(n)), p(y);
|
|
49
47
|
}, t = Ce("dnd");
|
|
50
48
|
return /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsxs($, { children: [
|
|
51
49
|
/* @__PURE__ */ e.jsx(ee, { asChild: !0, children: /* @__PURE__ */ e.jsxs(
|
|
@@ -61,7 +59,7 @@ const Se = ({ block: s }) => {
|
|
|
61
59
|
draggable: t ? "true" : "false",
|
|
62
60
|
className: "space-y-2 rounded-lg border border-border p-3 text-center hover:bg-slate-300/50 " + (t ? "cursor-grab" : "cursor-pointer"),
|
|
63
61
|
children: [
|
|
64
|
-
M(
|
|
62
|
+
M(i || we, { className: "w-4 h-4 mx-auto" }),
|
|
65
63
|
/* @__PURE__ */ e.jsx("p", { className: "truncate text-xs", children: l || o })
|
|
66
64
|
]
|
|
67
65
|
}
|
|
@@ -70,16 +68,16 @@ const Se = ({ block: s }) => {
|
|
|
70
68
|
] }) });
|
|
71
69
|
}, Le = ({ block: s, closePopover: o }) => {
|
|
72
70
|
var t;
|
|
73
|
-
const [
|
|
71
|
+
const [i, l] = f(!1), d = F("getExternalPredefinedBlock", K()), { addCoreBlock: c, addPredefinedBlock: n } = C(), [r] = A(), [, x, p] = Te(
|
|
74
72
|
() => ({
|
|
75
73
|
type: "CHAI_BLOCK",
|
|
76
74
|
item: s
|
|
77
75
|
}),
|
|
78
76
|
[s]
|
|
79
|
-
), a =
|
|
77
|
+
), a = q(
|
|
80
78
|
async (u) => {
|
|
81
79
|
if (u.stopPropagation(), L(s, "component")) {
|
|
82
|
-
|
|
80
|
+
c(s, h(r)), o();
|
|
83
81
|
return;
|
|
84
82
|
}
|
|
85
83
|
l(!0);
|
|
@@ -100,11 +98,11 @@ const Se = ({ block: s }) => {
|
|
|
100
98
|
"div",
|
|
101
99
|
{
|
|
102
100
|
ref: x,
|
|
103
|
-
onClick:
|
|
101
|
+
onClick: i ? () => {
|
|
104
102
|
} : a,
|
|
105
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",
|
|
106
104
|
children: [
|
|
107
|
-
|
|
105
|
+
i && /* @__PURE__ */ e.jsxs("div", { className: "absolute flex h-full w-full items-center justify-center bg-black bg-opacity-70", children: [
|
|
108
106
|
/* @__PURE__ */ e.jsx(Ae, { className: "animate-spin", size: 15, color: "white" }),
|
|
109
107
|
" ",
|
|
110
108
|
/* @__PURE__ */ e.jsx("span", { className: "pl-2 text-sm text-white", children: "Adding..." })
|
|
@@ -122,17 +120,17 @@ const Se = ({ block: s }) => {
|
|
|
122
120
|
)
|
|
123
121
|
] });
|
|
124
122
|
}, Ie = () => {
|
|
125
|
-
const { data: s } = E(), o = D(),
|
|
123
|
+
const { data: s } = E(), o = D(), i = j(b(o), { category: "custom" }), l = k(i, "group"), d = k(s, "group"), c = z(() => R(l, d, (a, t) => {
|
|
126
124
|
if (_(a) && _(t))
|
|
127
125
|
return [...a, ...t];
|
|
128
|
-
}), [l, d]), [n, r] = f(h(W(
|
|
126
|
+
}), [l, d]), [n, r] = f(h(W(c)) || ""), [, x] = B(T), p = Y(c, n, []);
|
|
129
127
|
return /* @__PURE__ */ e.jsxs("div", { className: "relative flex h-full max-h-full flex-col overflow-hidden py-2", children: [
|
|
130
128
|
/* @__PURE__ */ e.jsx("div", { className: "sticky top-0 flex w-full items-center p-3", children: /* @__PURE__ */ e.jsxs(re, { value: n, onValueChange: (a) => r(a), children: [
|
|
131
129
|
/* @__PURE__ */ e.jsx(te, { className: "w-full", children: /* @__PURE__ */ e.jsx(oe, { placeholder: "Select a provider" }) }),
|
|
132
130
|
/* @__PURE__ */ e.jsxs(ae, { children: [
|
|
133
131
|
/* @__PURE__ */ e.jsx(S, { value: "", children: "Choose" }),
|
|
134
132
|
v.Children.toArray(
|
|
135
|
-
w(
|
|
133
|
+
w(c, (a, t) => /* @__PURE__ */ e.jsx(S, { value: t, children: t }, t))
|
|
136
134
|
)
|
|
137
135
|
] })
|
|
138
136
|
] }) }),
|
|
@@ -141,12 +139,12 @@ const Se = ({ block: s }) => {
|
|
|
141
139
|
) })
|
|
142
140
|
] });
|
|
143
141
|
}, Fe = () => {
|
|
144
|
-
const { t: s } = I(), [o,
|
|
142
|
+
const { t: s } = I(), [o, i] = f(""), { addPredefinedBlock: l } = C(), [d] = A(), [, c] = B(T), n = () => {
|
|
145
143
|
const r = Pe(o);
|
|
146
|
-
l([...r], h(d) || null),
|
|
144
|
+
l([...r], h(d) || null), i(""), c(y);
|
|
147
145
|
};
|
|
148
146
|
return /* @__PURE__ */ e.jsxs(le, { className: "border-border/0 p-0 shadow-none", children: [
|
|
149
|
-
/* @__PURE__ */ e.jsx(
|
|
147
|
+
/* @__PURE__ */ e.jsx(ce, { className: "p-3", children: /* @__PURE__ */ e.jsx(ie, { children: s("html_snippet_description") }) }),
|
|
150
148
|
/* @__PURE__ */ e.jsx(ne, { className: "space-y-2 px-3 py-0", children: /* @__PURE__ */ e.jsxs("div", { className: "space-y-1", children: [
|
|
151
149
|
/* @__PURE__ */ e.jsx(de, { htmlFor: "current", className: "text-sm", children: s("tailwind_html_snippet") }),
|
|
152
150
|
/* @__PURE__ */ e.jsx(
|
|
@@ -155,7 +153,7 @@ const Se = ({ block: s }) => {
|
|
|
155
153
|
autoFocus: !0,
|
|
156
154
|
tabIndex: 1,
|
|
157
155
|
ref: (r) => r && r.focus(),
|
|
158
|
-
onChange: (r) =>
|
|
156
|
+
onChange: (r) => i(r.target.value),
|
|
159
157
|
rows: 12,
|
|
160
158
|
value: o,
|
|
161
159
|
placeholder: s("enter_code_snippet"),
|
|
@@ -168,16 +166,16 @@ const Se = ({ block: s }) => {
|
|
|
168
166
|
/* @__PURE__ */ e.jsx(xe, { variant: "default", className: "mt-2 border-none p-1 text-gray-400", children: /* @__PURE__ */ e.jsx(he, { className: "text-xs font-normal leading-4", children: s("note_imported_html") }) })
|
|
169
167
|
] })
|
|
170
168
|
] });
|
|
171
|
-
}, Ee = () => !0,
|
|
172
|
-
const { t: s } = I(), [o,
|
|
173
|
-
j(
|
|
169
|
+
}, Ee = () => !0, ws = () => {
|
|
170
|
+
const { t: s } = I(), [o, i] = f("core"), [l, d] = f("basic"), c = D(), [, n] = B(fe), r = F("importHTMLSupport", !0), { data: x, isLoading: p } = E(), a = k(
|
|
171
|
+
j(c, () => Ee()),
|
|
174
172
|
"category"
|
|
175
173
|
), t = J(w(a.core, "group"));
|
|
176
|
-
|
|
174
|
+
O(() => {
|
|
177
175
|
!Q(t, l) && !g(t) && !g(l) && d(h(t));
|
|
178
176
|
}, [t, l]);
|
|
179
|
-
const u = !p && !g(x) || X(b(
|
|
180
|
-
return /* @__PURE__ */ e.jsxs("div", { className: "flex h-full flex-col overflow-hidden", children: [
|
|
177
|
+
const u = !p && !g(x) || X(b(c), { category: "custom" }) !== void 0;
|
|
178
|
+
return /* @__PURE__ */ e.jsxs("div", { className: "flex h-full w-72 flex-col overflow-hidden", children: [
|
|
181
179
|
/* @__PURE__ */ e.jsxs("div", { className: "mb-2 flex flex-col justify-between rounded-md bg-background/30 p-1", children: [
|
|
182
180
|
/* @__PURE__ */ e.jsx("h1", { className: "flex flex-col items-baseline px-1 text-xl font-semibold xl:flex-col", children: s("add_block") }),
|
|
183
181
|
/* @__PURE__ */ e.jsx("span", { className: "p-0 text-xs font-light leading-3 opacity-80 xl:pl-1", children: s(o === "html" ? "enter_paste_tailwind_html" : "click_to_add_block") })
|
|
@@ -186,7 +184,7 @@ const Se = ({ block: s }) => {
|
|
|
186
184
|
ge,
|
|
187
185
|
{
|
|
188
186
|
onValueChange: (m) => {
|
|
189
|
-
n(""),
|
|
187
|
+
n(""), i(m);
|
|
190
188
|
},
|
|
191
189
|
value: o,
|
|
192
190
|
className: "h-max",
|
|
@@ -221,5 +219,5 @@ const Se = ({ block: s }) => {
|
|
|
221
219
|
] });
|
|
222
220
|
};
|
|
223
221
|
export {
|
|
224
|
-
|
|
222
|
+
ws as default
|
|
225
223
|
};
|
|
@@ -2,9 +2,9 @@ import { j as t } from "./jsx-runtime-WbnYoNE9.js";
|
|
|
2
2
|
import * as c from "react";
|
|
3
3
|
import N from "@rjsf/validator-ajv8";
|
|
4
4
|
import j from "@rjsf/core";
|
|
5
|
-
import { h as k, F as
|
|
6
|
-
import { f, c as
|
|
7
|
-
import { debounce as
|
|
5
|
+
import { h as k, F as w, bw as D } from "./index-IPJAbzzO.js";
|
|
6
|
+
import { s as f, c as P, f as a } from "./controls-OfJWSEqC.js";
|
|
7
|
+
import { debounce as R, noop as F, isEqual as L } from "lodash-es";
|
|
8
8
|
import "./_commonjsHelpers-UyOWmZb0.js";
|
|
9
9
|
import "./Functions-7jnEwJyw.js";
|
|
10
10
|
import "clsx";
|
|
@@ -13,7 +13,6 @@ import "@chaibuilder/runtime";
|
|
|
13
13
|
import "jotai";
|
|
14
14
|
import "./MODIFIERS-WQdaNvb8.js";
|
|
15
15
|
import "@react-hookz/web";
|
|
16
|
-
import "flat-to-nested";
|
|
17
16
|
import "@radix-ui/react-toggle";
|
|
18
17
|
import "class-variance-authority";
|
|
19
18
|
import "./Class-3k8xjeiM.js";
|
|
@@ -39,10 +38,9 @@ import "@radix-ui/react-context-menu";
|
|
|
39
38
|
import "react-icons-picker";
|
|
40
39
|
import "react-dom";
|
|
41
40
|
import "react-quill";
|
|
42
|
-
import "lodash";
|
|
43
41
|
import "react-i18next";
|
|
44
42
|
const M = ({ value: u, onChange: e, id: p, onBlur: d }) => {
|
|
45
|
-
const i =
|
|
43
|
+
const i = R(e, 200), m = (l) => i(l.target.value);
|
|
46
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(
|
|
47
45
|
"input",
|
|
48
46
|
{
|
|
@@ -103,8 +101,8 @@ const M = ({ value: u, onChange: e, id: p, onBlur: d }) => {
|
|
|
103
101
|
{ title: "Lustria", value: "Lustria" },
|
|
104
102
|
{ title: "Ovo", value: "Ovo" },
|
|
105
103
|
{ title: "Suranna", value: "Suranna" }
|
|
106
|
-
],
|
|
107
|
-
const u = k("onSaveBrandingOptions", F), [e, p] =
|
|
104
|
+
], Ct = () => {
|
|
105
|
+
const u = k("onSaveBrandingOptions", F), [e, p] = w(), [d] = D(), i = c.useRef(e);
|
|
108
106
|
c.useEffect(() => () => {
|
|
109
107
|
L(e, i.current) || u(i.current);
|
|
110
108
|
}, []);
|
|
@@ -114,8 +112,8 @@ const M = ({ value: u, onChange: e, id: p, onBlur: d }) => {
|
|
|
114
112
|
bodyFont: l,
|
|
115
113
|
headingFont: h,
|
|
116
114
|
primaryColor: x,
|
|
117
|
-
bodyTextDarkColor:
|
|
118
|
-
bodyTextLightColor:
|
|
115
|
+
bodyTextDarkColor: b,
|
|
116
|
+
bodyTextLightColor: y,
|
|
119
117
|
bodyBgDarkColor: C,
|
|
120
118
|
secondaryColor: S,
|
|
121
119
|
bodyBgLightColor: B,
|
|
@@ -132,7 +130,7 @@ const M = ({ value: u, onChange: e, id: p, onBlur: d }) => {
|
|
|
132
130
|
default: l,
|
|
133
131
|
options: g
|
|
134
132
|
}),
|
|
135
|
-
roundedCorners:
|
|
133
|
+
roundedCorners: P({
|
|
136
134
|
title: "Rounded Corner",
|
|
137
135
|
default: parseInt(O || 5, 10)
|
|
138
136
|
}),
|
|
@@ -147,7 +145,7 @@ const M = ({ value: u, onChange: e, id: p, onBlur: d }) => {
|
|
|
147
145
|
}),
|
|
148
146
|
bodyTextLightColor: a({
|
|
149
147
|
title: "Body Text (Light Mode)",
|
|
150
|
-
default:
|
|
148
|
+
default: b
|
|
151
149
|
}),
|
|
152
150
|
bodyBgDarkColor: a({
|
|
153
151
|
title: "Body Background (Dark mode)",
|
|
@@ -155,7 +153,7 @@ const M = ({ value: u, onChange: e, id: p, onBlur: d }) => {
|
|
|
155
153
|
}),
|
|
156
154
|
bodyTextDarkColor: a({
|
|
157
155
|
title: "Body Text (Dark mode)",
|
|
158
|
-
default:
|
|
156
|
+
default: y
|
|
159
157
|
})
|
|
160
158
|
});
|
|
161
159
|
const n = {
|
|
@@ -165,7 +163,7 @@ const M = ({ value: u, onChange: e, id: p, onBlur: d }) => {
|
|
|
165
163
|
return Object.keys(r).forEach((o) => {
|
|
166
164
|
const s = r[o];
|
|
167
165
|
return n.properties || (n.properties = {}), n.properties[o] = s.schema, v[o] = s.uiSchema, !0;
|
|
168
|
-
}), /* @__PURE__ */ t.jsxs("div", { className: "flex h-full select-none flex-col", children: [
|
|
166
|
+
}), /* @__PURE__ */ t.jsxs("div", { className: "flex h-full w-60 select-none flex-col", children: [
|
|
169
167
|
/* @__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" }) }),
|
|
170
168
|
/* @__PURE__ */ t.jsx("div", { className: "-mx-2", children: /* @__PURE__ */ t.jsx(
|
|
171
169
|
j,
|
|
@@ -186,5 +184,5 @@ const M = ({ value: u, onChange: e, id: p, onBlur: d }) => {
|
|
|
186
184
|
] });
|
|
187
185
|
};
|
|
188
186
|
export {
|
|
189
|
-
|
|
187
|
+
Ct as default
|
|
190
188
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./jsx-runtime-Z_BpKhVy.cjs"),B=require("react"),R=require("@rjsf/validator-ajv8"),E=require("@rjsf/core"),p=require("./index-9PHdn80L.cjs"),r=require("./controls-KK2oLIa8.cjs"),f=require("lodash-es");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("./Functions-N3yhPYKY.cjs");require("clsx");require("tailwind-merge");require("@chaibuilder/runtime");require("jotai");require("./MODIFIERS-9EwxLM8V.cjs");require("@react-hookz/web");require("@radix-ui/react-toggle");require("class-variance-authority");require("./Class-MmCxz2Ay.cjs");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("react-i18next");function N(t){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const i in t)if(i!=="default"){const l=Object.getOwnPropertyDescriptor(t,i);Object.defineProperty(e,i,l.get?l:{enumerable:!0,get:()=>t[i]})}}return e.default=t,Object.freeze(e)}const x=N(B),k=({value:t,onChange:e,id:i,onBlur:l})=>{const n=f.debounce(e,200),v=u=>n(u.target.value);return a.jsxRuntimeExports.jsx("div",{className:"mt-1.5 flex items-center gap-x-3",children:a.jsxRuntimeExports.jsx("div",{className:"flex w-3/5 flex-col",children:a.jsxRuntimeExports.jsx("input",{type:"color",className:"text-xs p-0",value:t,onBlur:({target:{value:u}})=>l(i,u),onChange:v})})})},m=[{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=p.useBuilderProp("onSaveBrandingOptions",f.noop),[e,i]=p.useBrandingOptions(),[l]=p.useBlocksContainer(),n=x.useRef(e);x.useEffect(()=>()=>{f.isEqual(e,n.current)||t(n.current)},[]);const v=({formData:o},c)=>{c&&(i(o),n.current=o)},{bodyFont:u,headingFont:q,primaryColor:b,bodyTextDarkColor:h,bodyTextLightColor:y,bodyBgDarkColor:S,secondaryColor:C,bodyBgLightColor:O,roundedCorners:j}=e;let s={headingFont:r.s({title:"Heading font",default:q,options:m}),bodyFont:r.s({title:"Body font",default:u,options:m}),roundedCorners:r.c({title:"Rounded Corner",default:parseInt(j||5,10)}),primaryColor:r.f({title:"Primary",default:b}),secondaryColor:r.f({title:"Secondary",default:C})};l||(s={...s,bodyBgLightColor:r.f({title:"Body Background (Light Mode)",default:O}),bodyTextLightColor:r.f({title:"Body Text (Light Mode)",default:h}),bodyBgDarkColor:r.f({title:"Body Background (Dark mode)",default:S}),bodyTextDarkColor:r.f({title:"Body Text (Dark mode)",default:y})});const d={type:"object",properties:{}},g={};return Object.keys(s).forEach(o=>{const c=s[o];return d.properties||(d.properties={}),d.properties[o]=c.schema,g[o]=c.uiSchema,!0}),a.jsxRuntimeExports.jsxs("div",{className:"flex h-full w-60 select-none flex-col",children:[a.jsxRuntimeExports.jsx("div",{className:"rounded-md bg-background/30 p-1",children:a.jsxRuntimeExports.jsx("h1",{className:"px-1 font-semibold",children:"Branding Options"})}),a.jsxRuntimeExports.jsx("div",{className:"-mx-2",children:a.jsxRuntimeExports.jsx(E,{widgets:{color:k},idSeparator:".",autoComplete:"off",omitExtraData:!0,liveOmit:!0,liveValidate:!0,uiSchema:g,schema:d,formData:e,validator:R,onChange:v})})]})};exports.default=P;
|