@chaibuilder/sdk 1.2.18 → 1.2.19
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-KeHVFaIr.cjs +1 -0
- package/dist/{AddBlocks-uCdu9Xpr.js → AddBlocks-gcTaEIKO.js} +5 -4
- package/dist/BrandingOptions-I2I8w6E9.cjs +1 -0
- package/dist/{BrandingOptions-JbHRN7V5.js → BrandingOptions-bfiFY0VR.js} +5 -4
- package/dist/{CanvasArea-oUIvLfdq.cjs → CanvasArea-JfHkTnQD.cjs} +1 -1
- package/dist/{CanvasArea-aWzbzB9p.js → CanvasArea-xvMCbQDL.js} +8 -7
- package/dist/{CurrentPage-AlOLPG4o.js → CurrentPage-0Ap2N0uc.js} +13 -12
- package/dist/CurrentPage-vj52UxMA.cjs +1 -0
- package/dist/ListTree-Vq0_s1wC.cjs +1 -0
- package/dist/ListTree-k-QMO740.js +96 -0
- package/dist/{Outline-oGoAdnBw.js → Outline-HI6-c9nf.js} +96 -92
- package/dist/Outline-fAflJ_lN.cjs +1 -0
- package/dist/{PagesPanel-VbSQHEu_.js → PagesPanel-Pk-C1956.js} +7 -6
- package/dist/PagesPanel-ug8Tmva6.cjs +1 -0
- package/dist/{ProjectPanel-fqux215P.js → ProjectPanel-_KQBhuPO.js} +8 -7
- package/dist/ProjectPanel-o8-6cPX-.cjs +1 -0
- package/dist/Settings-Cc9eV4VG.cjs +1 -0
- package/dist/{Settings-IhWI1ice.js → Settings-XtAatoiu.js} +5 -4
- package/dist/{SidePanels-lMCXrchR.js → SidePanels-O52zKXbH.js} +134 -133
- package/dist/SidePanels-ugRobm34.cjs +1 -0
- package/dist/Topbar-e5MGWX9n.cjs +1 -0
- package/dist/{Topbar-DYiisBtw.js → Topbar-oTx7a12r.js} +5 -4
- package/dist/{UnsplashImages-lGLcqo4M.js → UnsplashImages-5A21uzMK.js} +5 -4
- package/dist/UnsplashImages-KSbKGs91.cjs +1 -0
- package/dist/UploadImages-V42YSRVO.cjs +1 -0
- package/dist/{UploadImages-06m6vjbL.js → UploadImages-V_54lCAO.js} +5 -4
- package/dist/{add-page-modal-mEbIXSKX.js → add-page-modal-dKQLw7RQ.js} +17 -16
- package/dist/add-page-modal-xMedOdsp.cjs +1 -0
- package/dist/{confirm-alert-YETlIRpE.js → confirm-alert-8GP3bKH_.js} +5 -4
- package/dist/{confirm-alert-ZpEIxh3X.cjs → confirm-alert-KtW-4OjG.cjs} +1 -1
- package/dist/core.cjs +1 -1
- package/dist/core.d.ts +1 -0
- package/dist/core.js +47 -46
- package/dist/defaultTheme-7Lk2zq60.cjs +1 -0
- package/dist/{defaultTheme-s0cpA5Oy.js → defaultTheme-gunU_Fe5.js} +31 -33
- package/dist/{delete-page-modal-J_SmPWrw.js → delete-page-modal-Zb5ld6O-.js} +7 -6
- package/dist/delete-page-modal-lebJCBBe.cjs +1 -0
- package/dist/email-blocks.cjs +1 -1
- package/dist/email-blocks.js +79 -79
- package/dist/email.cjs +1 -1
- package/dist/email.d.ts +1 -0
- package/dist/email.js +6 -5
- package/dist/{form-Y0Vb4m04.cjs → form-o6_55v8F.cjs} +1 -1
- package/dist/{form-2xJcQs_Y.js → form-yyU2x7So.js} +1 -1
- package/dist/{index-3TQsdso6.cjs → index-BMZLAJUV.cjs} +1 -1
- package/dist/{index-ZwpjuB-N.cjs → index-JdnF6lYP.cjs} +42 -42
- package/dist/{index-ZBqiaKhx.js → index-WP7IRkij.js} +739 -739
- package/dist/{index-627XtO9e.js → index-lFcrvDFC.js} +3 -3
- package/dist/index-thKfFhmr.cjs +1 -0
- package/dist/{index-LF3KXx4u.js → index-yILWlilS.js} +3142 -3132
- package/dist/lib.cjs +1 -1
- package/dist/lib.js +1 -1
- package/dist/{page-viewer-7u0SWWmO.js → page-viewer-3QXwPGpg.js} +11 -10
- package/dist/page-viewer-DTIblLiz.cjs +1 -0
- package/dist/{project-general-setting-SqC85J7F.js → project-general-setting-UalRmyHm.js} +8 -7
- package/dist/project-general-setting-g7WhM3hc.cjs +1 -0
- package/dist/{project-seo-setting-TlQherop.js → project-seo-setting-8FsvPSPl.js} +6 -5
- package/dist/project-seo-setting-xoeLQVj3.cjs +1 -0
- package/dist/render.cjs +1 -1
- package/dist/render.d.ts +10 -0
- package/dist/render.js +164 -78
- package/dist/{single-page-detail-ClZYIdSO.js → single-page-detail-GaB85dNv.js} +9 -8
- package/dist/single-page-detail-XdBysrE_.cjs +1 -0
- package/dist/studio.cjs +1 -1
- package/dist/studio.d.ts +1 -0
- package/dist/studio.js +6 -5
- package/dist/ui.cjs +1 -1
- package/dist/ui.d.ts +1 -1
- package/dist/ui.js +140 -139
- package/dist/{useAddBlockByDrop-E343zoB3.cjs → useAddBlockByDrop-6EbioQV4.cjs} +1 -1
- package/dist/{useAddBlockByDrop-sPX4lN-O.js → useAddBlockByDrop-BIK2fdgj.js} +1 -1
- package/package.json +2 -1
- package/dist/AddBlocks-5Q5w5lPJ.cjs +0 -1
- package/dist/BrandingOptions-xrGQI1Kn.cjs +0 -1
- package/dist/CurrentPage-atmd8UrZ.cjs +0 -1
- package/dist/Outline-uMUTwN-R.cjs +0 -1
- package/dist/PagesPanel-nN3QUwXp.cjs +0 -1
- package/dist/ProjectPanel-UIEFhref.cjs +0 -1
- package/dist/Settings-8qUW0Iow.cjs +0 -1
- package/dist/SidePanels-cOHgPE9y.cjs +0 -1
- package/dist/Topbar-vLD-rWl5.cjs +0 -1
- package/dist/UnsplashImages-1JWfKlBc.cjs +0 -1
- package/dist/UploadImages-T4MYMOhW.cjs +0 -1
- package/dist/add-page-modal-niwhffYL.cjs +0 -1
- package/dist/defaultTheme-1XwPZT2b.cjs +0 -1
- package/dist/delete-page-modal-sOqRlmKb.cjs +0 -1
- package/dist/index-T3wfa1kz.cjs +0 -1
- package/dist/page-viewer-6UDraUKW.cjs +0 -1
- package/dist/project-general-setting-AW5Vtmgx.cjs +0 -1
- package/dist/project-seo-setting-cWiNZcxW.cjs +0 -1
- package/dist/single-page-detail-kJUW6FE9.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-thKfFhmr.cjs"),q=require("@radix-ui/react-icons"),R=require("@chaibuilder/runtime"),B=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("flat-to-nested");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("lodash");require("himalaya");const A=({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=B.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||q.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})})]})})},C=({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})})]})]})},T=()=>{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(C,{block:l,closePopover:()=>f(g.OUTLINE_KEY)})))})]})},w=()=>{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 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(A,{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(T,{})}),n==="html"&&o?e.jsxRuntimeExports.jsx(w,{}):null]})};exports.default=I;
|
|
@@ -3,7 +3,7 @@ import v, { createElement as M, useState as f, useCallback as z, useMemo as O, u
|
|
|
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, bh as le, bi as ie, bj as ce, bk as ne, aB as de, bl as me, bm as pe, B as ue, bn as xe, bo as he, bp as fe, au as ge, av as je, aw as N, bg as be, b9 as ve, ba as ye, bb as Be, bc as Ne, S as ke } from "./index-
|
|
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, bh as le, bi as ie, bj as ce, bk as ne, aB as de, bl as me, bm as pe, B as ue, bn as xe, bo as he, bp as fe, au as ge, av as je, aw as N, bg as be, b9 as ve, ba as ye, bb as Be, bc as Ne, S as ke } from "./index-WP7IRkij.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";
|
|
@@ -15,8 +15,8 @@ import "./_commonjsHelpers-UyOWmZb0.js";
|
|
|
15
15
|
import "./Functions-7jnEwJyw.js";
|
|
16
16
|
import "clsx";
|
|
17
17
|
import "tailwind-merge";
|
|
18
|
-
import "flat-to-nested";
|
|
19
18
|
import "@react-hookz/web";
|
|
19
|
+
import "flat-to-nested";
|
|
20
20
|
import "@radix-ui/react-toggle";
|
|
21
21
|
import "class-variance-authority";
|
|
22
22
|
import "./Class-3k8xjeiM.js";
|
|
@@ -41,6 +41,7 @@ import "@radix-ui/react-context-menu";
|
|
|
41
41
|
import "react-icons-picker";
|
|
42
42
|
import "react-dom";
|
|
43
43
|
import "react-quill";
|
|
44
|
+
import "lodash";
|
|
44
45
|
import "himalaya";
|
|
45
46
|
const Se = ({ block: s }) => {
|
|
46
47
|
const { type: o, icon: c, label: l } = s, { addCoreBlock: d, addPredefinedBlock: i } = C(), [n, r] = A(), [, x] = Z(), [, p] = B(T), a = () => {
|
|
@@ -167,7 +168,7 @@ const Se = ({ block: s }) => {
|
|
|
167
168
|
/* @__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") }) })
|
|
168
169
|
] })
|
|
169
170
|
] });
|
|
170
|
-
}, Ee = () => !0,
|
|
171
|
+
}, Ee = () => !0, As = () => {
|
|
171
172
|
const { t: s } = I(), [o, c] = f("core"), [l, d] = f("basic"), i = D(), [, n] = B(fe), r = F("importHTMLSupport", !0), { data: x, isLoading: p } = E(), a = k(
|
|
172
173
|
j(i, () => Ee()),
|
|
173
174
|
"category"
|
|
@@ -220,5 +221,5 @@ const Se = ({ block: s }) => {
|
|
|
220
221
|
] });
|
|
221
222
|
};
|
|
222
223
|
export {
|
|
223
|
-
|
|
224
|
+
As as default
|
|
224
225
|
};
|
|
@@ -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-thKfFhmr.cjs"),r=require("./controls-Dy1qa8Dc.cjs"),g=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("flat-to-nested");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("lodash");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 m=N(B),k=({value:t,onChange:e,id:i,onBlur:l})=>{const n=g.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})})})},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=p.useBuilderProp("onSaveBrandingOptions",g.noop),[e,i]=p.useBrandingOptions(),[l]=p.useBlocksContainer(),n=m.useRef(e);m.useEffect(()=>()=>{g.isEqual(e,n.current)||t(n.current)},[]);const v=({formData:o},c)=>{c&&(i(o),n.current=o)},{bodyFont:u,headingFont:q,primaryColor:y,bodyTextDarkColor:b,bodyTextLightColor:h,bodyBgDarkColor:S,secondaryColor:C,bodyBgLightColor:O,roundedCorners:j}=e;let s={headingFont:r.f({title:"Heading font",default:q,options:f}),bodyFont:r.f({title:"Body font",default:u,options:f}),roundedCorners:r.c({title:"Rounded Corner",default:parseInt(j||5,10)}),primaryColor:r.y({title:"Primary",default:y}),secondaryColor:r.y({title:"Secondary",default:C})};l||(s={...s,bodyBgLightColor:r.y({title:"Body Background (Light Mode)",default:O}),bodyTextLightColor:r.y({title:"Body Text (Light Mode)",default:b}),bodyBgDarkColor:r.y({title:"Body Background (Dark mode)",default:S}),bodyTextDarkColor:r.y({title:"Body Text (Dark mode)",default:h})});const d={type:"object",properties:{}},x={};return Object.keys(s).forEach(o=>{const c=s[o];return d.properties||(d.properties={}),d.properties[o]=c.schema,x[o]=c.uiSchema,!0}),a.jsxRuntimeExports.jsxs("div",{className:"flex h-full 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:x,schema:d,formData:e,validator:R,onChange:v})})]})};exports.default=P;
|
|
@@ -2,7 +2,7 @@ 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 D, bu as P } from "./index-
|
|
5
|
+
import { h as k, F as D, bu as P } from "./index-WP7IRkij.js";
|
|
6
6
|
import { f, c as R, y as a } from "./controls-XPXGHKht.js";
|
|
7
7
|
import { debounce as w, noop as F, isEqual as L } from "lodash-es";
|
|
8
8
|
import "./_commonjsHelpers-UyOWmZb0.js";
|
|
@@ -11,9 +11,9 @@ import "clsx";
|
|
|
11
11
|
import "tailwind-merge";
|
|
12
12
|
import "@chaibuilder/runtime";
|
|
13
13
|
import "jotai";
|
|
14
|
-
import "flat-to-nested";
|
|
15
14
|
import "./MODIFIERS-WQdaNvb8.js";
|
|
16
15
|
import "@react-hookz/web";
|
|
16
|
+
import "flat-to-nested";
|
|
17
17
|
import "@radix-ui/react-toggle";
|
|
18
18
|
import "class-variance-authority";
|
|
19
19
|
import "./Class-3k8xjeiM.js";
|
|
@@ -39,6 +39,7 @@ import "@radix-ui/react-context-menu";
|
|
|
39
39
|
import "react-icons-picker";
|
|
40
40
|
import "react-dom";
|
|
41
41
|
import "react-quill";
|
|
42
|
+
import "lodash";
|
|
42
43
|
import "react-i18next";
|
|
43
44
|
const M = ({ value: u, onChange: e, id: p, onBlur: d }) => {
|
|
44
45
|
const i = w(e, 200), m = (l) => i(l.target.value);
|
|
@@ -102,7 +103,7 @@ const M = ({ value: u, onChange: e, id: p, onBlur: d }) => {
|
|
|
102
103
|
{ title: "Lustria", value: "Lustria" },
|
|
103
104
|
{ title: "Ovo", value: "Ovo" },
|
|
104
105
|
{ title: "Suranna", value: "Suranna" }
|
|
105
|
-
],
|
|
106
|
+
], Bt = () => {
|
|
106
107
|
const u = k("onSaveBrandingOptions", F), [e, p] = D(), [d] = P(), i = c.useRef(e);
|
|
107
108
|
c.useEffect(() => () => {
|
|
108
109
|
L(e, i.current) || u(i.current);
|
|
@@ -185,5 +186,5 @@ const M = ({ value: u, onChange: e, id: p, onBlur: d }) => {
|
|
|
185
186
|
] });
|
|
186
187
|
};
|
|
187
188
|
export {
|
|
188
|
-
|
|
189
|
+
Bt as default
|
|
189
190
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";var $e=Object.defineProperty;var Ue=(e,t,n)=>t in e?$e(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var z=(e,t,n)=>(Ue(e,typeof t!="symbol"?t+"":t,n),n);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("./jsx-runtime-Z_BpKhVy.cjs"),m=require("react"),p=require("lodash-es"),P=require("@radix-ui/react-icons"),o=require("./index-
|
|
1
|
+
"use strict";var $e=Object.defineProperty;var Ue=(e,t,n)=>t in e?$e(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var z=(e,t,n)=>(Ue(e,typeof t!="symbol"?t+"":t,n),n);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("./jsx-runtime-Z_BpKhVy.cjs"),m=require("react"),p=require("lodash-es"),P=require("@radix-ui/react-icons"),o=require("./index-thKfFhmr.cjs"),ne=require("react-i18next"),L=require("jotai"),ge=require("react-dom"),ze=require("./_commonjsHelpers-wDK0ZLPo.cjs"),G=require("./index-JdnF6lYP.cjs"),Ye=require("react-quill"),Ke=require("./useAddBlockByDrop-6EbioQV4.cjs"),Te=require("flagged"),Je=require("@floating-ui/dom"),me=require("@floating-ui/react-dom"),Ve=require("@react-hookz/web"),Ze=require("@bobthered/tailwindcss-palette-generator"),Qe=require("react-wrap-balancer"),Ge=require("tailwind-merge"),ee=require("./MODIFIERS-9EwxLM8V.cjs"),Xe=require("@chaibuilder/runtime");require("./Functions-N3yhPYKY.cjs");require("clsx");require("flat-to-nested");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("lodash");require("i18next");require("react-textarea-autosize");require("react-dnd");require("@minoru/react-dnd-treeview");require("react-hotkeys-hook");const et=()=>{const{hasUndo:e,hasRedo:t,undo:n,redo:i}=o.useUndoManager();return s.jsxRuntimeExports.jsxs("div",{className:"flex items-center",children:[s.jsxRuntimeExports.jsx(o.Button,{disabled:!e(),size:"sm",onClick:n,className:"rounded-full",variant:"ghost",children:s.jsxRuntimeExports.jsx(P.ResetIcon,{})}),s.jsxRuntimeExports.jsx(o.Button,{disabled:!t(),onClick:i,size:"sm",className:"rounded-full",variant:"ghost",children:s.jsxRuntimeExports.jsx(P.ResetIcon,{className:"rotate-180 scale-y-[-1] transform"})})]})};function tt(){const[e,t]=o.useDarkMode(),{t:n}=ne.useTranslation();return s.jsxRuntimeExports.jsxs("div",{className:"flex items-center",children:[s.jsxRuntimeExports.jsx(o.Label,{htmlFor:"dark-mode-switch",children:n("dark_mode")}),s.jsxRuntimeExports.jsxs(o.Switch,{id:"dark-mode-switch",checked:e,onCheckedChange:()=>{t(!e)},className:`${e?"bg-violet-600":"bg-violet-300"}
|
|
2
2
|
relative ml-2 inline-flex h-[20px] w-[40px] shrink-0 cursor-pointer rounded-full border-2 border-transparent transition-colors duration-200 ease-in-out focus:outline-none focus-visible:ring-2 focus-visible:ring-white focus-visible:ring-opacity-75`,children:[s.jsxRuntimeExports.jsx("span",{className:"sr-only",children:n("use_setting")}),s.jsxRuntimeExports.jsx("span",{"aria-hidden":"true",className:`${e?"translate-x-5":"translate-x-0"}
|
|
3
3
|
pointer-events-none -mt-px inline-block h-[18px] w-[20px] transform rounded-full bg-white shadow-lg ring-0 transition duration-200 ease-in-out`})]})]})}const ye=({landscape:e=!1})=>s.jsxRuntimeExports.jsxs("svg",{className:e?"rotate-90":"",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 13 13",xmlSpace:"preserve",width:13,height:13,children:[s.jsxRuntimeExports.jsx("g",{strokeWidth:0}),s.jsxRuntimeExports.jsx("g",{strokeLinecap:"round",strokeLinejoin:"round"}),s.jsxRuntimeExports.jsx("path",{d:"M10.65 0H2.349a.851.851 0 0 0-.851.852v11.299c0 .47.382.852.851.852h8.3a.851.851 0 0 0 .851-.852V.852A.851.851 0 0 0 10.65 0zM6.599 12.466a.367.367 0 1 1 0-.735.367.367 0 0 1 0 .735zm3.9-1.267H2.5V1h8.001v10.199z",style:{fill:"#000"}})]}),nt=[{title:"mobile_xs_title",content:"mobile_xs_content",breakpoint:"xs",icon:s.jsxRuntimeExports.jsx(P.MobileIcon,{}),width:400},{title:"mobile_sm_title",content:"mobile_sm_content",breakpoint:"sm",icon:s.jsxRuntimeExports.jsx(P.MobileIcon,{className:"rotate-90"}),width:640},{title:"tablet_md_title",content:"tablet_md_content",breakpoint:"md",icon:s.jsxRuntimeExports.jsx(ye,{}),width:800},{title:"tablet_lg_title",content:"tablet_lg_content",breakpoint:"lg",icon:s.jsxRuntimeExports.jsx(ye,{landscape:!0}),width:1024},{title:"desktop_xl_title",content:"desktop_xl_content",breakpoint:"xl",icon:s.jsxRuntimeExports.jsx(P.LaptopIcon,{}),width:1420},{title:"large_desktop_2xl_title",content:"large_desktop_2xl_content",breakpoint:"2xl",icon:s.jsxRuntimeExports.jsx(P.DesktopIcon,{}),width:1920}],ve=({title:e,content:t,currentBreakpoint:n,breakpoint:i,width:a,icon:c,onClick:u})=>{const{t:r}=ne.useTranslation();return s.jsxRuntimeExports.jsxs(o.HoverCard,{children:[s.jsxRuntimeExports.jsx(o.HoverCardTrigger,{asChild:!0,children:s.jsxRuntimeExports.jsx(o.Button,{onClick:()=>u(a),size:"sm",variant:i===n?"secondary":"ghost",children:c})}),s.jsxRuntimeExports.jsx(o.HoverCardContent,{className:"w-52 border-border",children:s.jsxRuntimeExports.jsx("div",{className:"flex justify-between space-x-4",children:s.jsxRuntimeExports.jsxs("div",{className:"space-y-1",children:[s.jsxRuntimeExports.jsx("h4",{className:"text-sm font-semibold",children:r(e)}),s.jsxRuntimeExports.jsx("p",{className:"text-xs",children:r(t)})]})})})]})},st=()=>{const[,e,t]=o.useCanvasWidth(),[n,i]=o.useSelectedBreakpoints(),{t:a}=ne.useTranslation(),c=o.useBuilderProp("breakpoints",nt),u=r=>{n.includes(r)?n.length>2&&i(n.filter(d=>d!==r)):i(d=>[...d,r])};return c.length<4?s.jsxRuntimeExports.jsx("div",{className:"flex items-center rounded-md",children:p.map(c,r=>m.createElement(ve,{...r,onClick:t,key:r.breakpoint,currentBreakpoint:e}))}):s.jsxRuntimeExports.jsxs("div",{className:"flex items-center rounded-md",children:[p.map(c.filter(r=>p.includes(n,p.toUpper(r.breakpoint))),r=>m.createElement(ve,{...r,onClick:t,key:r.breakpoint,currentBreakpoint:e})),s.jsxRuntimeExports.jsxs(o.DropdownMenu,{children:[s.jsxRuntimeExports.jsx(o.DropdownMenuTrigger,{asChild:!0,children:s.jsxRuntimeExports.jsx("span",{className:"cursor-pointer px-2.5 hover:opacity-80",children:s.jsxRuntimeExports.jsx(P.DotsVerticalIcon,{className:"scale-90 transform"})})}),s.jsxRuntimeExports.jsxs(o.DropdownMenuContent,{className:"w-56 border-border text-xs",children:[s.jsxRuntimeExports.jsx(o.DropdownMenuLabel,{children:a("Breakpoints")}),s.jsxRuntimeExports.jsx(o.DropdownMenuSeparator,{}),p.map(c,r=>s.jsxRuntimeExports.jsx(o.DropdownMenuCheckboxItem,{disabled:r.breakpoint==="xs",onCheckedChange:()=>u(p.toUpper(r.breakpoint)),checked:p.includes(n,p.toUpper(r.breakpoint)),children:a(r.title)},r.breakpoint))]})]})]})},rt=()=>{const{t:e}=ne.useTranslation(),{setNewBlocks:t}=o.useBlocksStoreUndoableActions(),[,n]=o.useSelectedBlockIds(),[,i]=o.useSelectedStylingBlocks(),a=m.useCallback(()=>{t([]),n([]),i([])},[t]);return s.jsxRuntimeExports.jsx("div",{className:"flex items-center",children:s.jsxRuntimeExports.jsxs(o.AlertDialog,{children:[s.jsxRuntimeExports.jsx(o.AlertDialogTrigger,{asChild:!0,children:s.jsxRuntimeExports.jsxs(o.Button,{size:"sm",variant:"ghost",className:"flex items-center gap-x-1",children:[s.jsxRuntimeExports.jsx(P.EraserIcon,{})," ",e("clear")]})}),s.jsxRuntimeExports.jsxs(o.AlertDialogContent,{className:"border-border",children:[s.jsxRuntimeExports.jsxs(o.AlertDialogHeader,{children:[s.jsxRuntimeExports.jsx(o.AlertDialogTitle,{children:e("clear_canvas_title")}),s.jsxRuntimeExports.jsx(o.AlertDialogDescription,{children:e("clear_canvas_description")})]}),s.jsxRuntimeExports.jsxs(o.AlertDialogFooter,{children:[s.jsxRuntimeExports.jsx(o.AlertDialogCancel,{children:e("cancel")}),s.jsxRuntimeExports.jsx(o.AlertDialogAction,{onClick:a,children:e("yes")})]})]})]})})},ot=()=>{const e=o.useBuilderProp("darkMode",!1),[t]=o.useCanvasZoom();return s.jsxRuntimeExports.jsxs("div",{className:"flex h-10 items-center justify-between border-b bg-background/70 px-2",children:[s.jsxRuntimeExports.jsxs("div",{className:"flex h-full space-x-2",children:[e?s.jsxRuntimeExports.jsxs(s.jsxRuntimeExports.Fragment,{children:[s.jsxRuntimeExports.jsx(tt,{}),s.jsxRuntimeExports.jsx(o.Separator,{orientation:"vertical"})]}):null,s.jsxRuntimeExports.jsx(st,{}),s.jsxRuntimeExports.jsx(o.Separator,{orientation:"vertical"}),s.jsxRuntimeExports.jsxs("div",{className:"flex w-12 items-center justify-center gap-x-1 space-x-0 font-medium",children:[s.jsxRuntimeExports.jsx(P.ZoomInIcon,{className:"h-3.5 w-3.5 flex-shrink-0"})," ",s.jsxRuntimeExports.jsxs("div",{className:"text-xs leading-3",children:[p.round(t,0),"%"]})]}),s.jsxRuntimeExports.jsx(o.Separator,{orientation:"vertical"}),s.jsxRuntimeExports.jsx(et,{})]}),s.jsxRuntimeExports.jsxs("div",{className:"flex h-full items-center space-x-2",children:[s.jsxRuntimeExports.jsx(o.Separator,{orientation:"vertical"}),s.jsxRuntimeExports.jsx(rt,{})]})]})},it=`<!doctype html>
|
|
4
4
|
<html class="scroll-smooth h-full overflow-y-auto">
|
|
@@ -5,14 +5,14 @@ import { j as r } from "./jsx-runtime-WbnYoNE9.js";
|
|
|
5
5
|
import K, { createElement as _e, useCallback as ke, useState as $, useEffect as R, Component as Ye, Children as Tt, Suspense as Ke, useRef as Be, useMemo as Ct } from "react";
|
|
6
6
|
import { map as re, includes as Oe, toUpper as pe, round as Et, throttle as Je, noop as te, isEmpty as z, first as ae, omit as It, pick as St, get as D, isString as je, memoize as Dt, each as _t, find as Bt, filter as Ve, isNull as Ot, has as At } from "lodash-es";
|
|
7
7
|
import { ResetIcon as Ae, MobileIcon as Re, LaptopIcon as Rt, DesktopIcon as Pt, DotsVerticalIcon as Mt, EraserIcon as Lt, ZoomInIcon as Nt, DragHandleDots2Icon as Ft, ArrowUpIcon as $t, CopyIcon as Wt, TrashIcon as qt } from "@radix-ui/react-icons";
|
|
8
|
-
import { v as Qe, B as le, V as Ze, aB as Ht, aC as Ut, aD as zt, aE as Yt, aF as Kt, N as Te, ab as Jt, h as Ce, aG as Vt, aH as Qt, aI as Zt, aJ as Gt, aK as Xt, aL as en, aM as tn, r as W, ac as J, A as nn, a as rn, b as on, c as sn, d as an, e as ln, f as cn, g as dn, ai as un, O as Ge, aA as ie, aN as pn, Y as G, a5 as fn, aO as X, E as Ee, t as Xe, q as et, s as tt, z as hn, aP as gn, aQ as nt, aR as mn, aS as yn, F as vn, aT as xn, a1 as bn, aU as wn, S as rt } from "./index-
|
|
8
|
+
import { v as Qe, B as le, V as Ze, aB as Ht, aC as Ut, aD as zt, aE as Yt, aF as Kt, N as Te, ab as Jt, h as Ce, aG as Vt, aH as Qt, aI as Zt, aJ as Gt, aK as Xt, aL as en, aM as tn, r as W, ac as J, A as nn, a as rn, b as on, c as sn, d as an, e as ln, f as cn, g as dn, ai as un, O as Ge, aA as ie, aN as pn, Y as G, a5 as fn, aO as X, E as Ee, t as Xe, q as et, s as tt, z as hn, aP as gn, aQ as nt, aR as mn, aS as yn, F as vn, aT as xn, a1 as bn, aU as wn, S as rt } from "./index-WP7IRkij.js";
|
|
9
9
|
import { useTranslation as de } from "react-i18next";
|
|
10
10
|
import { useAtom as M } from "jotai";
|
|
11
11
|
import Pe from "react-dom";
|
|
12
12
|
import { g as kn } from "./_commonjsHelpers-UyOWmZb0.js";
|
|
13
|
-
import { r as ot, u as jn, B as Tn, E as Cn } from "./index-
|
|
13
|
+
import { r as ot, u as jn, B as Tn, E as Cn } from "./index-yILWlilS.js";
|
|
14
14
|
import { Quill as En } from "react-quill";
|
|
15
|
-
import { u as In } from "./useAddBlockByDrop-
|
|
15
|
+
import { u as In } from "./useAddBlockByDrop-BIK2fdgj.js";
|
|
16
16
|
import { useFeature as st } from "flagged";
|
|
17
17
|
import { flip as Sn } from "@floating-ui/dom";
|
|
18
18
|
import { useFloating as Dn, shift as _n } from "@floating-ui/react-dom";
|
|
@@ -47,6 +47,7 @@ import "@radix-ui/react-toast";
|
|
|
47
47
|
import "cmdk";
|
|
48
48
|
import "@radix-ui/react-context-menu";
|
|
49
49
|
import "react-icons-picker";
|
|
50
|
+
import "lodash";
|
|
50
51
|
import "i18next";
|
|
51
52
|
import "react-textarea-autosize";
|
|
52
53
|
import "react-dnd";
|
|
@@ -812,7 +813,7 @@ function Kn() {
|
|
|
812
813
|
return l.PropTypes = l, l;
|
|
813
814
|
}, ve;
|
|
814
815
|
}
|
|
815
|
-
var
|
|
816
|
+
var ko = ce.exports;
|
|
816
817
|
if (process.env.NODE_ENV !== "production") {
|
|
817
818
|
var Jn = ot, Vn = !0;
|
|
818
819
|
ce.exports = Yn()(Jn.isElement, Vn);
|
|
@@ -823,7 +824,7 @@ const A = /* @__PURE__ */ kn(Qn);
|
|
|
823
824
|
let lt, ct;
|
|
824
825
|
typeof document < "u" && (lt = document);
|
|
825
826
|
typeof window < "u" && (ct = window);
|
|
826
|
-
const dt = K.createContext({ document: lt, window: ct }), ue = () => K.useContext(dt), { Provider: Zn, Consumer:
|
|
827
|
+
const dt = K.createContext({ document: lt, window: ct }), ue = () => K.useContext(dt), { Provider: Zn, Consumer: jo } = dt;
|
|
827
828
|
class ut extends Ye {
|
|
828
829
|
componentDidMount() {
|
|
829
830
|
this.props.contentDidMount();
|
|
@@ -1394,10 +1395,10 @@ const xr = () => {
|
|
|
1394
1395
|
)
|
|
1395
1396
|
}
|
|
1396
1397
|
);
|
|
1397
|
-
},
|
|
1398
|
+
}, To = () => /* @__PURE__ */ r.jsxs("div", { className: "flex h-full w-full flex-col", children: [
|
|
1398
1399
|
/* @__PURE__ */ r.jsx(Wn, {}),
|
|
1399
1400
|
/* @__PURE__ */ r.jsx("div", { className: "relative h-full overflow-hidden bg-slate-800/90 bg-[linear-gradient(to_right,#222_0.5px,transparent_0.5px),linear-gradient(to_bottom,#222_0.5px,transparent_0.5px)] bg-[size:12px_12px] px-2", children: /* @__PURE__ */ r.jsx(Ke, { fallback: /* @__PURE__ */ r.jsx(rt, { className: "h-full" }), children: /* @__PURE__ */ r.jsx(Cn, { children: /* @__PURE__ */ r.jsx(wr, {}) }) }) })
|
|
1400
1401
|
] });
|
|
1401
1402
|
export {
|
|
1402
|
-
|
|
1403
|
+
To as default
|
|
1403
1404
|
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { j as e } from "./jsx-runtime-WbnYoNE9.js";
|
|
2
|
-
import { z as x, aj as h, ak as f, al as j, am as y, an as P } from "./index-
|
|
3
|
-
import { sortBy as v, filter as b, get as k, isEmpty as
|
|
2
|
+
import { z as x, aj as h, ak as f, al as j, am as y, an as P } from "./index-WP7IRkij.js";
|
|
3
|
+
import { sortBy as v, filter as b, get as k, isEmpty as s, find as n, capitalize as w, map as C } from "lodash-es";
|
|
4
4
|
import { toast as N } from "sonner";
|
|
5
5
|
import { useEffect as p } from "react";
|
|
6
|
-
import { a as S, u as B, c as E, d as z } from "./index-
|
|
6
|
+
import { a as S, u as B, c as E, d as z } from "./index-lFcrvDFC.js";
|
|
7
7
|
import { BriefcaseIcon as I } from "lucide-react";
|
|
8
8
|
import "./_commonjsHelpers-UyOWmZb0.js";
|
|
9
9
|
import "./Functions-7jnEwJyw.js";
|
|
@@ -11,9 +11,9 @@ import "clsx";
|
|
|
11
11
|
import "tailwind-merge";
|
|
12
12
|
import "@chaibuilder/runtime";
|
|
13
13
|
import "jotai";
|
|
14
|
-
import "flat-to-nested";
|
|
15
14
|
import "./MODIFIERS-WQdaNvb8.js";
|
|
16
15
|
import "@react-hookz/web";
|
|
16
|
+
import "flat-to-nested";
|
|
17
17
|
import "@radix-ui/react-toggle";
|
|
18
18
|
import "class-variance-authority";
|
|
19
19
|
import "./Class-3k8xjeiM.js";
|
|
@@ -39,8 +39,9 @@ import "@radix-ui/react-context-menu";
|
|
|
39
39
|
import "react-icons-picker";
|
|
40
40
|
import "react-dom";
|
|
41
41
|
import "react-quill";
|
|
42
|
+
import "lodash";
|
|
42
43
|
import "react-i18next";
|
|
43
|
-
import "./index-
|
|
44
|
+
import "./index-yILWlilS.js";
|
|
44
45
|
import "i18next";
|
|
45
46
|
import "@floating-ui/react-dom";
|
|
46
47
|
import "react-textarea-autosize";
|
|
@@ -51,20 +52,20 @@ import "react-hotkeys-hook";
|
|
|
51
52
|
import "./html-to-json-C5sExaSD.js";
|
|
52
53
|
import "himalaya";
|
|
53
54
|
import "./index-YpnaudSM.js";
|
|
54
|
-
const
|
|
55
|
-
const { data: t } = S(), { data: i, isLoading: l } = B(), { syncState: c } = x(), d = E(), [o, a] = z(),
|
|
55
|
+
const Le = () => {
|
|
56
|
+
const { data: t } = S(), { data: i, isLoading: l } = B(), { syncState: c } = x(), d = E(), [o, a] = z(), m = v(b(i, { type: "STATIC" }), (r) => k(r, "uuid") === (t == null ? void 0 : t.homepage) ? 0 : 1);
|
|
56
57
|
p(() => {
|
|
57
|
-
!
|
|
58
|
+
!s(i) && t.homepage && !n(i, { uuid: o }) && a(t.homepage);
|
|
58
59
|
}, [o, i, t, a]), p(() => () => a(null), [a]);
|
|
59
60
|
const u = (r) => {
|
|
60
61
|
if (c !== "SAVED")
|
|
61
62
|
N.error("You have unsaved changes. Please save before changing the page.");
|
|
62
63
|
else {
|
|
63
|
-
const g = n(
|
|
64
|
+
const g = n(m, { uuid: r });
|
|
64
65
|
d(g);
|
|
65
66
|
}
|
|
66
67
|
};
|
|
67
|
-
return l ||
|
|
68
|
+
return l || s(o) ? null : /* @__PURE__ */ e.jsx(
|
|
68
69
|
"nav",
|
|
69
70
|
{
|
|
70
71
|
className: "flex rounded-lg border border-gray-200 bg-gray-50 px-3 pr-0 py-1 text-gray-700 dark:border-gray-700 dark:bg-gray-800",
|
|
@@ -97,7 +98,7 @@ const Ie = () => {
|
|
|
97
98
|
),
|
|
98
99
|
/* @__PURE__ */ e.jsxs(h, { value: o || "", onValueChange: u, children: [
|
|
99
100
|
/* @__PURE__ */ e.jsx(f, { className: "h-max border-0 py-0 text-sm font-medium text-gray-600 shadow-none outline-none ring-0 focus:ring-0 dark:text-gray-400", children: /* @__PURE__ */ e.jsx(j, { placeholder: "Page" }) }),
|
|
100
|
-
/* @__PURE__ */ e.jsx(y, { className: "z-[999]", children: C(
|
|
101
|
+
/* @__PURE__ */ e.jsx(y, { className: "z-[999]", children: C(m, (r) => /* @__PURE__ */ e.jsx(P, { value: r.uuid, children: r == null ? void 0 : r.name }, r.uuid)) })
|
|
101
102
|
] })
|
|
102
103
|
] }) })
|
|
103
104
|
] })
|
|
@@ -105,5 +106,5 @@ const Ie = () => {
|
|
|
105
106
|
);
|
|
106
107
|
};
|
|
107
108
|
export {
|
|
108
|
-
|
|
109
|
+
Le as default
|
|
109
110
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-Z_BpKhVy.cjs"),t=require("./index-thKfFhmr.cjs"),i=require("lodash-es"),h=require("sonner"),l=require("react"),o=require("./index-BMZLAJUV.cjs"),j=require("lucide-react");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("flat-to-nested");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("lodash");require("react-i18next");require("./index-JdnF6lYP.cjs");require("i18next");require("@floating-ui/react-dom");require("react-textarea-autosize");require("flagged");require("react-dnd");require("@minoru/react-dnd-treeview");require("react-hotkeys-hook");require("./html-to-json-FGufPv9R.cjs");require("himalaya");require("./index-ecnGWzh9.cjs");const p=()=>{const{data:s}=o.useProject(),{data:u,isLoading:x}=o.usePages(),{syncState:d}=t.useSavePage(),q=o.useChangePage(),[n,a]=o.useCurrentPage(),c=i.sortBy(i.filter(u,{type:"STATIC"}),r=>i.get(r,"uuid")===(s==null?void 0:s.homepage)?0:1);l.useEffect(()=>{!i.isEmpty(u)&&s.homepage&&!i.find(u,{uuid:n})&&a(s.homepage)},[n,u,s,a]),l.useEffect(()=>()=>a(null),[a]);const m=r=>{if(d!=="SAVED")h.toast.error("You have unsaved changes. Please save before changing the page.");else{const g=i.find(c,{uuid:r});q(g)}};return x||i.isEmpty(n)?null:e.jsxRuntimeExports.jsx("nav",{className:"flex rounded-lg border border-gray-200 bg-gray-50 px-3 pr-0 py-1 text-gray-700 dark:border-gray-700 dark:bg-gray-800","aria-label":"Breadcrumb",children:e.jsxRuntimeExports.jsxs("ol",{className:"inline-flex items-center space-x-1 md:space-x-3",children:[e.jsxRuntimeExports.jsx("li",{className:"inline-flex items-center",children:e.jsxRuntimeExports.jsxs("div",{className:"inline-flex items-center text-sm font-medium text-gray-500 dark:text-gray-400",children:[e.jsxRuntimeExports.jsx(j.BriefcaseIcon,{className:"w-4 h-4 mr-2"}),i.capitalize(s.name)]})}),e.jsxRuntimeExports.jsx("li",{"aria-current":"page",children:e.jsxRuntimeExports.jsxs("div",{className:"flex items-center",children:[e.jsxRuntimeExports.jsx("svg",{className:"mx-1 h-3 w-3 text-gray-400","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 6 10",children:e.jsxRuntimeExports.jsx("path",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"m1 9 4-4-4-4"})}),e.jsxRuntimeExports.jsxs(t.Select,{value:n||"",onValueChange:m,children:[e.jsxRuntimeExports.jsx(t.SelectTrigger,{className:"h-max border-0 py-0 text-sm font-medium text-gray-600 shadow-none outline-none ring-0 focus:ring-0 dark:text-gray-400",children:e.jsxRuntimeExports.jsx(t.SelectValue,{placeholder:"Page"})}),e.jsxRuntimeExports.jsx(t.SelectContent,{className:"z-[999]",children:i.map(c,r=>e.jsxRuntimeExports.jsx(t.SelectItem,{value:r.uuid,children:r==null?void 0:r.name},r.uuid))})]})]})})]})})};exports.default=p;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("./jsx-runtime-Z_BpKhVy.cjs"),a=require("react-arborist"),m=require("./Functions-N3yhPYKY.cjs"),u=require("./index-thKfFhmr.cjs");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("react");require("lodash-es");require("clsx");require("tailwind-merge");require("@chaibuilder/runtime");require("jotai");require("./MODIFIERS-9EwxLM8V.cjs");require("@react-hookz/web");require("flat-to-nested");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("lodash");require("react-i18next");const x=[{id:"1",name:"Unread"},{id:"2",name:"Threads"},{id:"3",name:"Chat Rooms",children:[{id:"c1",name:"General"},{id:"c2",name:"Random"},{id:"c3",name:"Open Source Projects"}]},{id:"4",name:"Direct Messages",children:[{id:"d1",name:"Alice"},{id:"d2",name:"Bob"},{id:"d3",name:"Charlie"}]}];function h({node:r,style:n,dragHandle:s}){return i.jsxRuntimeExports.jsxs("div",{style:n,ref:s,children:[r.isLeaf?"🍁":"🗀",r.data.name]})}const j=()=>{const[r,n]=u.useSelectedBlockIds(),[,s]=u.useSelectedStylingBlocks(),c=()=>{n([]),s([])},t=({id:e,name:o})=>{console.log("onRename",{id:e,name:o})},l=({dragIds:e,parentId:o,index:q})=>{console.log("onMove",{dragIds:e,parentId:o,index:q})},d=({ids:e})=>{console.log("onDelete",{ids:e})};return i.jsxRuntimeExports.jsx("div",{onClick:()=>c(),className:m.cn("-mx-1 -mt-1 flex h-full select-none flex-col space-y-1"),children:i.jsxRuntimeExports.jsx(u.ScrollArea,{id:"layers-view",className:"no-scrollbar h-full overflow-y-auto p-1 px-2 text-xs",children:i.jsxRuntimeExports.jsx(a.Tree,{selection:r[0]||"",onRename:t,onMove:l,onDelete:d,data:x,idAccessor:"id",childrenAccessor:e=>e.children,children:h})})})};exports.default=j;
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import { j as i } from "./jsx-runtime-WbnYoNE9.js";
|
|
2
|
+
import { Tree as a } from "react-arborist";
|
|
3
|
+
import { c as d } from "./Functions-7jnEwJyw.js";
|
|
4
|
+
import { r as f, ac as h, bg as x } from "./index-WP7IRkij.js";
|
|
5
|
+
import "./_commonjsHelpers-UyOWmZb0.js";
|
|
6
|
+
import "react";
|
|
7
|
+
import "lodash-es";
|
|
8
|
+
import "clsx";
|
|
9
|
+
import "tailwind-merge";
|
|
10
|
+
import "@chaibuilder/runtime";
|
|
11
|
+
import "jotai";
|
|
12
|
+
import "./MODIFIERS-WQdaNvb8.js";
|
|
13
|
+
import "@react-hookz/web";
|
|
14
|
+
import "flat-to-nested";
|
|
15
|
+
import "@radix-ui/react-toggle";
|
|
16
|
+
import "class-variance-authority";
|
|
17
|
+
import "./Class-3k8xjeiM.js";
|
|
18
|
+
import "@radix-ui/react-switch";
|
|
19
|
+
import "@radix-ui/react-slot";
|
|
20
|
+
import "@radix-ui/react-accordion";
|
|
21
|
+
import "@radix-ui/react-icons";
|
|
22
|
+
import "@radix-ui/react-alert-dialog";
|
|
23
|
+
import "@radix-ui/react-dialog";
|
|
24
|
+
import "@radix-ui/react-label";
|
|
25
|
+
import "@radix-ui/react-scroll-area";
|
|
26
|
+
import "@radix-ui/react-tabs";
|
|
27
|
+
import "@radix-ui/react-tooltip";
|
|
28
|
+
import "@radix-ui/react-popover";
|
|
29
|
+
import "@radix-ui/react-menubar";
|
|
30
|
+
import "@radix-ui/react-hover-card";
|
|
31
|
+
import "@radix-ui/react-select";
|
|
32
|
+
import "@radix-ui/react-dropdown-menu";
|
|
33
|
+
import "@radix-ui/react-separator";
|
|
34
|
+
import "@radix-ui/react-toast";
|
|
35
|
+
import "cmdk";
|
|
36
|
+
import "@radix-ui/react-context-menu";
|
|
37
|
+
import "react-icons-picker";
|
|
38
|
+
import "react-dom";
|
|
39
|
+
import "react-quill";
|
|
40
|
+
import "lodash";
|
|
41
|
+
import "react-i18next";
|
|
42
|
+
const u = [
|
|
43
|
+
{ id: "1", name: "Unread" },
|
|
44
|
+
{ id: "2", name: "Threads" },
|
|
45
|
+
{
|
|
46
|
+
id: "3",
|
|
47
|
+
name: "Chat Rooms",
|
|
48
|
+
children: [
|
|
49
|
+
{ id: "c1", name: "General" },
|
|
50
|
+
{ id: "c2", name: "Random" },
|
|
51
|
+
{ id: "c3", name: "Open Source Projects" }
|
|
52
|
+
]
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
id: "4",
|
|
56
|
+
name: "Direct Messages",
|
|
57
|
+
children: [
|
|
58
|
+
{ id: "d1", name: "Alice" },
|
|
59
|
+
{ id: "d2", name: "Bob" },
|
|
60
|
+
{ id: "d3", name: "Charlie" }
|
|
61
|
+
]
|
|
62
|
+
}
|
|
63
|
+
];
|
|
64
|
+
function j({ node: e, style: r, dragHandle: t }) {
|
|
65
|
+
return /* @__PURE__ */ i.jsxs("div", { style: r, ref: t, children: [
|
|
66
|
+
e.isLeaf ? "🍁" : "🗀",
|
|
67
|
+
e.data.name
|
|
68
|
+
] });
|
|
69
|
+
}
|
|
70
|
+
const mo = () => {
|
|
71
|
+
const [e, r] = f(), [, t] = h(), s = () => {
|
|
72
|
+
r([]), t([]);
|
|
73
|
+
}, n = ({ id: o, name: m }) => {
|
|
74
|
+
console.log("onRename", { id: o, name: m });
|
|
75
|
+
}, c = ({ dragIds: o, parentId: m, index: p }) => {
|
|
76
|
+
console.log("onMove", { dragIds: o, parentId: m, index: p });
|
|
77
|
+
}, l = ({ ids: o }) => {
|
|
78
|
+
console.log("onDelete", { ids: o });
|
|
79
|
+
};
|
|
80
|
+
return /* @__PURE__ */ i.jsx("div", { onClick: () => s(), className: d("-mx-1 -mt-1 flex h-full select-none flex-col space-y-1"), children: /* @__PURE__ */ i.jsx(x, { id: "layers-view", className: "no-scrollbar h-full overflow-y-auto p-1 px-2 text-xs", children: /* @__PURE__ */ i.jsx(
|
|
81
|
+
a,
|
|
82
|
+
{
|
|
83
|
+
selection: e[0] || "",
|
|
84
|
+
onRename: n,
|
|
85
|
+
onMove: c,
|
|
86
|
+
onDelete: l,
|
|
87
|
+
data: u,
|
|
88
|
+
idAccessor: "id",
|
|
89
|
+
childrenAccessor: (o) => o.children,
|
|
90
|
+
children: j
|
|
91
|
+
}
|
|
92
|
+
) }) });
|
|
93
|
+
};
|
|
94
|
+
export {
|
|
95
|
+
mo as default
|
|
96
|
+
};
|