@chaibuilder/sdk 0.1.4 → 0.1.6
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-b6a12d50.js → AddBlocks-671fde09.js} +20 -19
- package/dist/AddBlocks-862cf7e0.cjs +3 -0
- package/dist/{BrandingOptions-1190723a.js → BrandingOptions-520c438d.js} +11 -9
- package/dist/BrandingOptions-8bbdd54f.cjs +1 -0
- package/dist/{CanvasArea-f5d27245.cjs → CanvasArea-86eef07f.cjs} +2 -2
- package/dist/{CanvasArea-15458836.js → CanvasArea-d912e63e.js} +226 -224
- package/dist/{Class-e34b2337.js → Class-1fb4c0c4.js} +110 -169
- package/dist/Class-6c695ccb.cjs +1 -0
- package/dist/Layers-ae78b10e.cjs +1 -0
- package/dist/{Layers-ff4ef9c0.js → Layers-db65053b.js} +12 -10
- package/dist/MODIFIERS-70fef873.cjs +1 -0
- package/dist/MODIFIERS-c2e02614.js +67 -0
- package/dist/{MarkAsGlobalBlock-dea26aa7.js → MarkAsGlobalBlock-a1274d49.js} +10 -8
- package/dist/MarkAsGlobalBlock-d5b40fdb.cjs +1 -0
- package/dist/PagesPanel-41ebbdd1.cjs +1 -0
- package/dist/{PagesPanel-3e9163c4.js → PagesPanel-48cb686f.js} +12 -10
- package/dist/ProjectPanel-08a229f3.cjs +1 -0
- package/dist/{ProjectPanel-17c5f131.js → ProjectPanel-920b0f75.js} +9 -10
- package/dist/Settings-0c125f1b.cjs +1 -0
- package/dist/{Settings-6f2e86a9.js → Settings-9ccc4a65.js} +7 -5
- package/dist/{SidePanels-96e64da9.js → SidePanels-9684bfe2.js} +8 -6
- package/dist/SidePanels-ef33ed66.cjs +1 -0
- package/dist/{Topbar-08d10607.js → Topbar-2f40d770.js} +7 -5
- package/dist/Topbar-84eadc0e.cjs +1 -0
- package/dist/add-page-modal-7fc782b9.cjs +1 -0
- package/dist/add-page-modal-fb7d069a.js +93 -0
- package/dist/core.cjs +1 -1
- package/dist/core.d.ts +13 -11
- package/dist/core.js +63 -61
- package/dist/delete-page-modal-15e71ba4.cjs +1 -0
- package/dist/{delete-page-modal-fa7b4272.js → delete-page-modal-cc906461.js} +9 -8
- package/dist/html-to-json-01cc5fe0.cjs +1 -0
- package/dist/{html-to-json-9304dbda.js → html-to-json-d20aafdd.js} +2 -2
- package/dist/index-1217461b.cjs +2 -0
- package/dist/index-32519c31.js +4909 -0
- package/dist/lib.cjs +1 -1
- package/dist/lib.js +4 -4
- package/dist/page-viewer-15b9eb5f.cjs +1 -0
- package/dist/{page-viewer-f1452439.js → page-viewer-77998a4d.js} +21 -18
- package/dist/{project-general-setting-0d7715b8.cjs → project-general-setting-a8be43b9.cjs} +1 -1
- package/dist/{project-general-setting-e5d14fa6.js → project-general-setting-e66f4966.js} +7 -5
- package/dist/render.cjs +2 -2
- package/dist/render.d.ts +9 -3
- package/dist/render.js +154 -134
- package/dist/single-page-detail-116281ae.cjs +1 -0
- package/dist/{single-page-detail-74f88ed2.js → single-page-detail-a0332ab5.js} +39 -38
- package/dist/style.css +1 -1
- package/dist/useChangePage-6a7c7374.js +12 -0
- package/dist/useChangePage-f22cea36.cjs +1 -0
- package/dist/usePageActions-5e28a006.cjs +1 -0
- package/dist/usePageActions-d6e1d325.js +38 -0
- package/package.json +3 -2
- package/dist/AddBlocks-1f683caa.cjs +0 -3
- package/dist/BrandingOptions-02e4ebcf.cjs +0 -1
- package/dist/CONTROLS-031e1de3.cjs +0 -1
- package/dist/CONTROLS-442caee5.js +0 -6
- package/dist/Class-7d6aadbc.cjs +0 -1
- package/dist/Layers-06fa708d.cjs +0 -1
- package/dist/MarkAsGlobalBlock-fa0e0543.cjs +0 -1
- package/dist/PagesPanel-b08e1357.cjs +0 -1
- package/dist/ProjectPanel-f0b94e3f.cjs +0 -1
- package/dist/Settings-739cff3b.cjs +0 -1
- package/dist/SidePanels-ce4d41d5.cjs +0 -1
- package/dist/Topbar-b97472fc.cjs +0 -1
- package/dist/add-page-modal-3275cfb2.cjs +0 -1
- package/dist/add-page-modal-bcd9249e.js +0 -93
- package/dist/delete-page-modal-420a17e3.cjs +0 -1
- package/dist/html-to-json-9c9961da.cjs +0 -1
- package/dist/index-133d90a5.cjs +0 -2
- package/dist/index-3f65447f.js +0 -4754
- package/dist/page-viewer-139bfb2a.cjs +0 -1
- package/dist/single-page-detail-54d7feca.cjs +0 -1
- package/dist/useMutation-7d536740.cjs +0 -1
- package/dist/useMutation-97876a40.js +0 -126
- package/dist/usePageActions-ac9ad321.cjs +0 -1
- package/dist/usePageActions-de3b7515.js +0 -37
- package/dist/useProjectActions-3b1dbb5e.js +0 -18
- package/dist/useProjectActions-41af0f70.cjs +0 -1
|
@@ -8,16 +8,16 @@ import { PlusIcon as pe, Cross2Icon as Ae, EyeOpenIcon as st, EyeClosedIcon as b
|
|
|
8
8
|
import { T as Ct, a as jt, b as fe, c as ve } from "./tabs-85caa1e8.js";
|
|
9
9
|
import kt from "@rjsf/core";
|
|
10
10
|
import Nt from "@rjsf/validator-ajv8";
|
|
11
|
-
import { A as oe, c as De, C as Me, D as St, F as Rt, G as Tt, i as ge, H as Oe, I as Ee, h as Pe, d as Vt, J as Fe, e as we, K as se, u as Ht, L as Bt, M as At } from "./index-
|
|
11
|
+
import { A as oe, c as De, C as Me, D as St, F as Rt, G as Tt, i as ge, H as Oe, I as Ee, h as Pe, d as Vt, J as Fe, e as we, K as se, u as Ht, L as Bt, M as At } from "./index-32519c31.js";
|
|
12
12
|
import { getBlockComponent as $t } from "@chaibuilder/blocks";
|
|
13
13
|
import { R as Lt, I as It, a as Dt, L as Mt } from "./link-f80a947d.js";
|
|
14
14
|
import { useAtom as Ot } from "jotai";
|
|
15
15
|
import Et from "react-autosuggest";
|
|
16
16
|
import Pt from "fuse.js";
|
|
17
|
-
import { A as Ft, C as ae, b as Xt } from "./Class-
|
|
17
|
+
import { A as Ft, C as ae, b as Xt } from "./Class-1fb4c0c4.js";
|
|
18
18
|
import { B as Xe, d as W, e as Z, f as _, g as Yt } from "./useBuilderProp-81a14920.js";
|
|
19
19
|
import { L as xe } from "./label-e770a087.js";
|
|
20
|
-
import { S as Wt } from "./
|
|
20
|
+
import { S as Wt } from "./MODIFIERS-c2e02614.js";
|
|
21
21
|
import { I as Zt } from "./input-a0ea2bc7.js";
|
|
22
22
|
import { a as Ye, b as We, c as Ze, A as _t } from "./accordion-c0176dc5.js";
|
|
23
23
|
import { S as zt } from "./scroll-area-9f64a082.js";
|
|
@@ -33,6 +33,8 @@ import "@minoru/react-dnd-treeview";
|
|
|
33
33
|
import "react-hotkeys-hook";
|
|
34
34
|
import "flat-to-nested";
|
|
35
35
|
import "redux-undo";
|
|
36
|
+
import "sonner";
|
|
37
|
+
import "lucide-react";
|
|
36
38
|
import "react-icons-picker";
|
|
37
39
|
import "react-dom";
|
|
38
40
|
import "./dialog-3d4e82ed.js";
|
|
@@ -1770,7 +1772,7 @@ const jr = {
|
|
|
1770
1772
|
"-": 1,
|
|
1771
1773
|
deg: 1,
|
|
1772
1774
|
ms: 0.1
|
|
1773
|
-
},
|
|
1775
|
+
}, vl = () => {
|
|
1774
1776
|
const r = oe(), { t: o } = Be(), [t, l] = L.useState(""), [s, n] = L.useState({
|
|
1775
1777
|
onDrag: (a) => a,
|
|
1776
1778
|
onDragEnd: (a) => a,
|
|
@@ -1842,5 +1844,5 @@ const jr = {
|
|
|
1842
1844
|
);
|
|
1843
1845
|
};
|
|
1844
1846
|
export {
|
|
1845
|
-
|
|
1847
|
+
vl as default
|
|
1846
1848
|
};
|
|
@@ -4,7 +4,7 @@ import i, { lazy as c, useState as f, Suspense as r } from "react";
|
|
|
4
4
|
import { useAtom as h } from "jotai";
|
|
5
5
|
import { each as P, get as A } from "lodash";
|
|
6
6
|
import { u as b, B as o, S as j } from "./useBuilderProp-81a14920.js";
|
|
7
|
-
import { a as B, b as T } from "./index-
|
|
7
|
+
import { a as B, b as T } from "./index-32519c31.js";
|
|
8
8
|
import "react-i18next";
|
|
9
9
|
import { c as S } from "./utils-ac68b2c8.js";
|
|
10
10
|
import "@radix-ui/react-slot";
|
|
@@ -17,16 +17,18 @@ import "react-dnd";
|
|
|
17
17
|
import "@minoru/react-dnd-treeview";
|
|
18
18
|
import "react-hotkeys-hook";
|
|
19
19
|
import "flat-to-nested";
|
|
20
|
-
import "./Class-
|
|
20
|
+
import "./Class-1fb4c0c4.js";
|
|
21
|
+
import "./MODIFIERS-c2e02614.js";
|
|
21
22
|
import "redux-undo";
|
|
22
23
|
import "@react-hookz/web";
|
|
23
24
|
import "@chaibuilder/blocks";
|
|
24
|
-
import "
|
|
25
|
+
import "sonner";
|
|
26
|
+
import "lucide-react";
|
|
25
27
|
import "clsx";
|
|
26
28
|
import "tailwind-merge";
|
|
27
|
-
const g = c(() => import("./Layers-
|
|
29
|
+
const g = c(() => import("./Layers-db65053b.js")), E = c(() => import("./BrandingOptions-520c438d.js")), I = c(() => import("./ImagesPanel-8ccab6d9.js"));
|
|
28
30
|
let v = null;
|
|
29
|
-
const
|
|
31
|
+
const ne = () => {
|
|
30
32
|
const m = b("sideBarComponents.top", []), y = b("sideBarComponents.bottom", []), [a, d] = h(B), [N, p] = f(a), [t, k] = f(null), x = {
|
|
31
33
|
layers: g,
|
|
32
34
|
"branding-options": E,
|
|
@@ -142,5 +144,5 @@ const re = () => {
|
|
|
142
144
|
] });
|
|
143
145
|
};
|
|
144
146
|
export {
|
|
145
|
-
|
|
147
|
+
ne as default
|
|
146
148
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-5c3ac4f7.cjs"),o=require("@radix-ui/react-icons"),s=require("react"),j=require("jotai"),p=require("lodash"),i=require("./useBuilderProp-5e57d0c8.cjs"),h=require("./index-1217461b.cjs");require("react-i18next");const g=require("./utils-3c452dd0.cjs");require("@radix-ui/react-slot");require("class-variance-authority");require("@radix-ui/react-tooltip");require("@radix-ui/react-toast");require("i18next");require("flagged");require("react-dnd");require("@minoru/react-dnd-treeview");require("react-hotkeys-hook");require("flat-to-nested");require("./Class-6c695ccb.cjs");require("./MODIFIERS-70fef873.cjs");require("redux-undo");require("@react-hookz/web");require("@chaibuilder/blocks");require("sonner");require("lucide-react");require("clsx");require("tailwind-merge");const f=s.lazy(()=>Promise.resolve().then(()=>require("./Layers-ae78b10e.cjs"))),q=s.lazy(()=>Promise.resolve().then(()=>require("./BrandingOptions-8bbdd54f.cjs"))),y=s.lazy(()=>Promise.resolve().then(()=>require("./ImagesPanel-addb2bf9.cjs")));let b=null;const N=()=>{const u=i.useBuilderProp("sideBarComponents.top",[]),E=i.useBuilderProp("sideBarComponents.bottom",[]),[r,x]=j.useAtom(h.activePanelAtom),[v,c]=s.useState(r),[n,R]=s.useState(null),m={layers:f,"branding-options":q,images:y};p.each(u,({name:t,panel:a})=>{m[t]=a});const l=t=>{clearTimeout(b),d(!1),r!=="layers"&&t==="layers"?b=setTimeout(()=>c("layers"),500):c(t),x(t)},[,d]=j.useAtom(h.addBlocksModalAtom);return e.jsxRuntimeExports.jsxs("div",{className:"relative flex",children:[e.jsxRuntimeExports.jsxs("div",{className:"z-[100] flex h-full w-fit flex-col items-center justify-between border-b border-r border-border bg-background pt-2",children:[e.jsxRuntimeExports.jsxs("div",{className:"relative z-[100] flex w-14 flex-col items-center space-y-2",children:[e.jsxRuntimeExports.jsx(i.Button,{onClick:()=>{d(!0),x("layers")},size:"sm",variant:r==="add-blocks"?"default":"outline",children:e.jsxRuntimeExports.jsx(o.PlusIcon,{className:"text-xl"})}),e.jsxRuntimeExports.jsx(i.Button,{onClick:()=>l("layers"),size:"sm",variant:r==="layers"?"default":"outline",children:e.jsxRuntimeExports.jsx(o.StackIcon,{className:"text-xl"})}),e.jsxRuntimeExports.jsx(i.Button,{onClick:()=>l("branding-options"),size:"sm",variant:r==="branding-options"?"default":"outline",children:e.jsxRuntimeExports.jsx(o.Half2Icon,{className:"w-4 max-w-[40px] text-xs"})}),s.Children.toArray(u.map(({name:t,icon:a})=>e.jsxRuntimeExports.jsx(s.Suspense,{fallback:e.jsxRuntimeExports.jsx(i.Skeleton,{className:"h-10"}),children:e.jsxRuntimeExports.jsx(i.Button,{onClick:()=>l(t),size:"sm",className:"w-10",variant:r===t?"default":"outline",children:e.jsxRuntimeExports.jsx(a,{})})})))]}),e.jsxRuntimeExports.jsx("div",{className:"flex flex-col items-center space-y-2",children:s.Children.toArray(E.map(t=>e.jsxRuntimeExports.jsx(s.Suspense,{fallback:e.jsxRuntimeExports.jsx(i.Skeleton,{className:"h-10"}),children:e.jsxRuntimeExports.jsx(t,{})})))})]}),e.jsxRuntimeExports.jsx("div",{onClick:()=>{l("layers")},className:"absolute inset-0 right-0 z-50 w-screen bg-black/20"+(r==="layers"?" hidden":"")}),e.jsxRuntimeExports.jsx("div",{className:`fixed left-14 z-[50] h-full w-96 border-r bg-background duration-500 ease-in-out ${r!=="layers"?"translate-x-0":"-translate-x-full"}`,children:e.jsxRuntimeExports.jsx(s.Suspense,{fallback:e.jsxRuntimeExports.jsxs("div",{className:"flex animate-pulse flex-col gap-y-2 bg-white p-4",children:[e.jsxRuntimeExports.jsx("div",{className:"h-6 w-1/2 bg-gray-300"}),e.jsxRuntimeExports.jsx("div",{className:"h-16 w-full bg-gray-200"}),e.jsxRuntimeExports.jsx("div",{className:"h-16 w-full bg-gray-200"})]}),children:e.jsxRuntimeExports.jsx("div",{className:g.cn("relative h-full max-h-[93%] bg-background p-1",r==="layers"?"":"z-[100]"),onMouseEnter:()=>{n&&clearTimeout(n)},onMouseLeave:()=>{const t=setTimeout(()=>{n&&(l("layers"),clearTimeout(n))},1e3);R(t)},children:s.createElement(p.get(m,v,()=>e.jsxRuntimeExports.jsx("div",{})))})})}),e.jsxRuntimeExports.jsx("div",{className:"h-full w-60 border-r p-1",children:e.jsxRuntimeExports.jsx(s.Suspense,{fallback:e.jsxRuntimeExports.jsxs("div",{className:"flex animate-pulse flex-col gap-y-2 p-4",children:[e.jsxRuntimeExports.jsx("div",{className:"h-6 w-1/2 bg-gray-300"}),e.jsxRuntimeExports.jsx("div",{className:"h-16 w-full bg-gray-200"}),e.jsxRuntimeExports.jsx("div",{className:"h-16 w-full bg-gray-200"})]}),children:s.createElement(f)})})]})};exports.default=N;
|
|
@@ -5,7 +5,7 @@ import { S as x, c as d, b as h, d as u, a as g, e as j, f as t } from "./select
|
|
|
5
5
|
import { u as l, d as f, e as v, f as S, S as c } from "./useBuilderProp-81a14920.js";
|
|
6
6
|
import { S as b } from "./separator-a80d065b.js";
|
|
7
7
|
import { T as N } from "./toggle-00c9d11e.js";
|
|
8
|
-
import { u as C } from "./index-
|
|
8
|
+
import { u as C } from "./index-32519c31.js";
|
|
9
9
|
import { useTranslation as w } from "react-i18next";
|
|
10
10
|
import "@radix-ui/react-select";
|
|
11
11
|
import "./utils-ac68b2c8.js";
|
|
@@ -25,11 +25,13 @@ import "react-dnd";
|
|
|
25
25
|
import "@minoru/react-dnd-treeview";
|
|
26
26
|
import "react-hotkeys-hook";
|
|
27
27
|
import "flat-to-nested";
|
|
28
|
-
import "./Class-
|
|
28
|
+
import "./Class-1fb4c0c4.js";
|
|
29
|
+
import "./MODIFIERS-c2e02614.js";
|
|
29
30
|
import "redux-undo";
|
|
30
31
|
import "@react-hookz/web";
|
|
31
32
|
import "@chaibuilder/blocks";
|
|
32
|
-
import "
|
|
33
|
+
import "sonner";
|
|
34
|
+
import "lucide-react";
|
|
33
35
|
const y = () => l("languages", ["en"]), A = () => y().length === 1 ? null : /* @__PURE__ */ e.jsx("div", { className: "flex items-center", children: /* @__PURE__ */ e.jsxs(x, { children: [
|
|
34
36
|
/* @__PURE__ */ e.jsx(d, { className: "w-[150px] border-0", children: /* @__PURE__ */ e.jsx(
|
|
35
37
|
h,
|
|
@@ -81,7 +83,7 @@ const y = () => l("languages", ["en"]), A = () => y().length === 1 ? null : /* @
|
|
|
81
83
|
) }),
|
|
82
84
|
/* @__PURE__ */ e.jsx(S, { children: /* @__PURE__ */ e.jsx("p", { children: s === "SAVING" ? "Saving..." : s === "SAVED" ? "Saved" : "Save changes" }) })
|
|
83
85
|
] }) });
|
|
84
|
-
},
|
|
86
|
+
}, oe = () => {
|
|
85
87
|
const a = l("topBarComponents.left", []), s = l("topBarComponents.center", []), n = l("topBarComponents.right", []);
|
|
86
88
|
return /* @__PURE__ */ e.jsxs("div", { className: "flex h-14 items-center justify-between px-2", children: [
|
|
87
89
|
/* @__PURE__ */ e.jsx("div", { className: "flex items-center space-x-2", children: /* @__PURE__ */ e.jsx("div", { className: "flex items-center space-x-2 font-bold", children: i.Children.toArray(
|
|
@@ -101,5 +103,5 @@ const y = () => l("languages", ["en"]), A = () => y().length === 1 ? null : /* @
|
|
|
101
103
|
] });
|
|
102
104
|
};
|
|
103
105
|
export {
|
|
104
|
-
|
|
106
|
+
oe as default
|
|
105
107
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-5c3ac4f7.cjs"),i=require("react"),u=require("@radix-ui/react-icons"),s=require("./select-0e32300c.cjs"),r=require("./useBuilderProp-5e57d0c8.cjs"),o=require("./separator-a597dba7.cjs"),a=require("./toggle-b90fed97.cjs"),c=require("./index-1217461b.cjs"),p=require("react-i18next");require("@radix-ui/react-select");require("./utils-3c452dd0.cjs");require("clsx");require("tailwind-merge");require("@radix-ui/react-slot");require("class-variance-authority");require("@radix-ui/react-tooltip");require("@radix-ui/react-toast");require("jotai");require("lodash");require("@radix-ui/react-separator");require("@radix-ui/react-toggle");require("i18next");require("flagged");require("react-dnd");require("@minoru/react-dnd-treeview");require("react-hotkeys-hook");require("flat-to-nested");require("./Class-6c695ccb.cjs");require("./MODIFIERS-70fef873.cjs");require("redux-undo");require("@react-hookz/web");require("@chaibuilder/blocks");require("sonner");require("lucide-react");const m=()=>r.useBuilderProp("languages",["en"]),j=()=>m().length===1?null:e.jsxRuntimeExports.jsx("div",{className:"flex items-center",children:e.jsxRuntimeExports.jsxs(s.Select,{children:[e.jsxRuntimeExports.jsx(s.SelectTrigger,{className:"w-[150px] border-0",children:e.jsxRuntimeExports.jsx(s.SelectValue,{placeholder:e.jsxRuntimeExports.jsxs("span",{className:"flex items-center",children:[e.jsxRuntimeExports.jsx(u.FontFamilyIcon,{className:"h-4 w-4"})," English(US)"]})})}),e.jsxRuntimeExports.jsx(s.SelectContent,{children:e.jsxRuntimeExports.jsxs(s.SelectGroup,{children:[e.jsxRuntimeExports.jsx(s.SelectLabel,{children:"Fruits"}),e.jsxRuntimeExports.jsx(s.SelectItem,{value:"apple",children:"Apple"}),e.jsxRuntimeExports.jsx(s.SelectItem,{value:"banana",children:"Banana"}),e.jsxRuntimeExports.jsx(s.SelectItem,{value:"blueberry",children:"Blueberry"}),e.jsxRuntimeExports.jsx(s.SelectItem,{value:"grapes",children:"Grapes"}),e.jsxRuntimeExports.jsx(s.SelectItem,{value:"pineapple",children:"Pineapple"})]})})]})}),d=()=>{const{savePage:x,syncState:t}=c.useSavePage(),{t:l}=p.useTranslation(),n=i.useMemo(()=>{switch(t){case"SAVING":return"animate-pulse bg-gray-500 text-gray-900";case"SAVED":return"bg-green-500 text-white hover:bg-green-600 hover:text-white";default:return"bg-gray-200 text-gray-500 hover:bg-gray-100"}},[t]);return e.jsxRuntimeExports.jsx("div",{className:"flex items-center",children:e.jsxRuntimeExports.jsxs(r.Tooltip,{children:[e.jsxRuntimeExports.jsx(r.TooltipTrigger,{asChild:!0,children:e.jsxRuntimeExports.jsxs(a.Toggle,{onClick:()=>x(),className:`flex h-auto w-20 items-center gap-x-1 rounded-full p-1 px-2 ${n}`,size:"sm",variant:"outline",children:[e.jsxRuntimeExports.jsx("svg",{fill:"currentColor",width:"16",height:"16",viewBox:"0 0 0.32 0.32",xmlns:"http://www.w3.org/2000/svg",children:e.jsxRuntimeExports.jsx("path",{fillRule:"evenodd",d:"M.274.086a.02.02 0 0 1 0 .028l-.12.12a.02.02 0 0 1-.028 0l-.06-.06A.02.02 0 0 1 .094.146L.14.192.246.086a.02.02 0 0 1 .028 0Z"})}),t==="SAVING"?"Saving...":t==="SAVED"?l("Saved"):"Save"]})}),e.jsxRuntimeExports.jsx(r.TooltipContent,{children:e.jsxRuntimeExports.jsx("p",{children:t==="SAVING"?"Saving...":t==="SAVED"?"Saved":"Save changes"})})]})})},h=()=>{const x=r.useBuilderProp("topBarComponents.left",[]),t=r.useBuilderProp("topBarComponents.center",[]),l=r.useBuilderProp("topBarComponents.right",[]);return e.jsxRuntimeExports.jsxs("div",{className:"flex h-14 items-center justify-between px-2",children:[e.jsxRuntimeExports.jsx("div",{className:"flex items-center space-x-2",children:e.jsxRuntimeExports.jsx("div",{className:"flex items-center space-x-2 font-bold",children:i.Children.toArray(x.map(n=>e.jsxRuntimeExports.jsx(i.Suspense,{fallback:e.jsxRuntimeExports.jsx(r.Skeleton,{className:"h-10"}),children:e.jsxRuntimeExports.jsx(n,{})})))})}),e.jsxRuntimeExports.jsx("div",{className:"flex items-center space-x-2",children:i.Children.toArray(t.map(n=>e.jsxRuntimeExports.jsx(i.Suspense,{fallback:e.jsxRuntimeExports.jsx(r.Skeleton,{className:"h-10"}),children:e.jsxRuntimeExports.jsx(n,{})})))}),e.jsxRuntimeExports.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsxRuntimeExports.jsx(j,{}),e.jsxRuntimeExports.jsx(o.Separator,{orientation:"vertical"}),e.jsxRuntimeExports.jsx(d,{}),i.Children.toArray(l.map(n=>e.jsxRuntimeExports.jsx(i.Suspense,{fallback:e.jsxRuntimeExports.jsx(r.Skeleton,{className:"h-10"}),children:e.jsxRuntimeExports.jsx(n,{})})))]})]})};exports.default=h;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-5c3ac4f7.cjs"),g=require("react"),R=require("lodash"),x=require("./useBuilderProp-5e57d0c8.cjs"),a=require("./dialog-170eaad9.cjs"),q=require("@chaibuilder/blocks"),b=require("./form-6eac0287.cjs"),f=require("./usePageActions-5e28a006.cjs");require("@radix-ui/react-slot");require("class-variance-authority");require("./utils-3c452dd0.cjs");require("clsx");require("tailwind-merge");require("@radix-ui/react-tooltip");require("@radix-ui/react-icons");require("@radix-ui/react-toast");require("jotai");require("@radix-ui/react-dialog");require("@rjsf/core");require("@rjsf/validator-ajv8");require("./link-86c532b5.cjs");require("react-icons-picker");require("react-dom");require("./ImagesPanel-addb2bf9.cjs");require("./tabs-860e37aa.cjs");require("@radix-ui/react-tabs");require("react-quill");require("react-i18next");require("./index-1217461b.cjs");require("i18next");require("flagged");require("react-dnd");require("@minoru/react-dnd-treeview");require("react-hotkeys-hook");require("flat-to-nested");require("./Class-6c695ccb.cjs");require("./MODIFIERS-70fef873.cjs");require("redux-undo");require("@react-hookz/web");require("sonner");require("lucide-react");require("./useChangePage-f22cea36.cjs");const E=({closeModal:i})=>{var l,o;const s=f.useAddPage(),[r,m]=g.useState({name:"",slug:"",blocks:[],type:"STATIC",seoData:{}}),p=()=>{s.mutate(r,{onSuccess:()=>i()})},j=({formData:u},t)=>{m(h=>{var d,c;const n={[t]:u[t]};return t==="name"?n.slug=R.kebabCase((d=u[t])==null?void 0:d.replace(/\d/g,"")):t==="slug"&&(n.slug=(c=u[t])==null?void 0:c.replace(/\d/g,"").replace(/\s+/g,"").replace("--","-").replace("__","_")),{...h,...n}})},P={name:q.SingleLineText({title:"Page Name",default:r.name}),slug:q.SingleLineText({title:"Page Slug",default:r.slug})};return e.jsxRuntimeExports.jsxs(a.DialogContent,{children:[e.jsxRuntimeExports.jsx("div",{className:"px-1 font-bold",children:"Add Page"}),e.jsxRuntimeExports.jsx(b.Form,{formData:r,properties:P,onChange:j,disabled:s.isPending}),e.jsxRuntimeExports.jsx("div",{className:"flex items-center justify-end",children:e.jsxRuntimeExports.jsx(x.Button,{type:"submit",disabled:!r.name||!r.slug||((l=r.name)==null?void 0:l.length)<2||((o=r.slug)==null?void 0:o.length)<2||s.isPending,onClick:p,children:"Add Page"})})]})},S=()=>{const[i,s]=g.useState(!1);return e.jsxRuntimeExports.jsxs(a.Dialog,{open:i,onOpenChange:()=>s(!i),children:[e.jsxRuntimeExports.jsx(a.DialogTrigger,{children:e.jsxRuntimeExports.jsx(x.Button,{size:"sm",variant:"link",className:"text-blue-500",onClick:()=>s(!i),children:"+ New Page"})}),i&&e.jsxRuntimeExports.jsx(E,{closeModal:()=>s(!i)})]})};exports.default=S;
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import { j as t } from "./jsx-runtime-944c88e2.js";
|
|
2
|
+
import { useState as g } from "react";
|
|
3
|
+
import { kebabCase as j } from "lodash";
|
|
4
|
+
import { B as c } from "./useBuilderProp-81a14920.js";
|
|
5
|
+
import { D as b, b as C, a as A } from "./dialog-3d4e82ed.js";
|
|
6
|
+
import { SingleLineText as d } from "@chaibuilder/blocks";
|
|
7
|
+
import { F as D } from "./form-5d5c5c9e.js";
|
|
8
|
+
import { u as N } from "./usePageActions-d6e1d325.js";
|
|
9
|
+
import "@radix-ui/react-slot";
|
|
10
|
+
import "class-variance-authority";
|
|
11
|
+
import "./utils-ac68b2c8.js";
|
|
12
|
+
import "clsx";
|
|
13
|
+
import "tailwind-merge";
|
|
14
|
+
import "@radix-ui/react-tooltip";
|
|
15
|
+
import "@radix-ui/react-icons";
|
|
16
|
+
import "@radix-ui/react-toast";
|
|
17
|
+
import "jotai";
|
|
18
|
+
import "@radix-ui/react-dialog";
|
|
19
|
+
import "@rjsf/core";
|
|
20
|
+
import "@rjsf/validator-ajv8";
|
|
21
|
+
import "./link-f80a947d.js";
|
|
22
|
+
import "react-icons-picker";
|
|
23
|
+
import "react-dom";
|
|
24
|
+
import "./ImagesPanel-8ccab6d9.js";
|
|
25
|
+
import "./tabs-85caa1e8.js";
|
|
26
|
+
import "@radix-ui/react-tabs";
|
|
27
|
+
import "react-quill";
|
|
28
|
+
import "react-i18next";
|
|
29
|
+
import "./index-32519c31.js";
|
|
30
|
+
import "i18next";
|
|
31
|
+
import "flagged";
|
|
32
|
+
import "react-dnd";
|
|
33
|
+
import "@minoru/react-dnd-treeview";
|
|
34
|
+
import "react-hotkeys-hook";
|
|
35
|
+
import "flat-to-nested";
|
|
36
|
+
import "./Class-1fb4c0c4.js";
|
|
37
|
+
import "./MODIFIERS-c2e02614.js";
|
|
38
|
+
import "redux-undo";
|
|
39
|
+
import "@react-hookz/web";
|
|
40
|
+
import "sonner";
|
|
41
|
+
import "lucide-react";
|
|
42
|
+
import "./useChangePage-6a7c7374.js";
|
|
43
|
+
const S = ({ closeModal: o }) => {
|
|
44
|
+
var m, p;
|
|
45
|
+
const i = N(), [e, u] = g({
|
|
46
|
+
name: "",
|
|
47
|
+
slug: "",
|
|
48
|
+
blocks: [],
|
|
49
|
+
type: "STATIC",
|
|
50
|
+
seoData: {}
|
|
51
|
+
}), f = () => {
|
|
52
|
+
i.mutate(e, {
|
|
53
|
+
onSuccess: () => o()
|
|
54
|
+
});
|
|
55
|
+
}, x = ({ formData: a }, r) => {
|
|
56
|
+
u((h) => {
|
|
57
|
+
var n, l;
|
|
58
|
+
const s = { [r]: a[r] };
|
|
59
|
+
return r === "name" ? s.slug = j((n = a[r]) == null ? void 0 : n.replace(/\d/g, "")) : r === "slug" && (s.slug = (l = a[r]) == null ? void 0 : l.replace(/\d/g, "").replace(/\s+/g, "").replace("--", "-").replace("__", "_")), {
|
|
60
|
+
...h,
|
|
61
|
+
...s
|
|
62
|
+
};
|
|
63
|
+
});
|
|
64
|
+
}, P = {
|
|
65
|
+
name: d({
|
|
66
|
+
title: "Page Name",
|
|
67
|
+
default: e.name
|
|
68
|
+
}),
|
|
69
|
+
slug: d({ title: "Page Slug", default: e.slug })
|
|
70
|
+
};
|
|
71
|
+
return /* @__PURE__ */ t.jsxs(A, { children: [
|
|
72
|
+
/* @__PURE__ */ t.jsx("div", { className: "px-1 font-bold", children: "Add Page" }),
|
|
73
|
+
/* @__PURE__ */ t.jsx(D, { formData: e, properties: P, onChange: x, disabled: i.isPending }),
|
|
74
|
+
/* @__PURE__ */ t.jsx("div", { className: "flex items-center justify-end", children: /* @__PURE__ */ t.jsx(
|
|
75
|
+
c,
|
|
76
|
+
{
|
|
77
|
+
type: "submit",
|
|
78
|
+
disabled: !e.name || !e.slug || ((m = e.name) == null ? void 0 : m.length) < 2 || ((p = e.slug) == null ? void 0 : p.length) < 2 || i.isPending,
|
|
79
|
+
onClick: f,
|
|
80
|
+
children: "Add Page"
|
|
81
|
+
}
|
|
82
|
+
) })
|
|
83
|
+
] });
|
|
84
|
+
}, ut = () => {
|
|
85
|
+
const [o, i] = g(!1);
|
|
86
|
+
return /* @__PURE__ */ t.jsxs(b, { open: o, onOpenChange: () => i(!o), children: [
|
|
87
|
+
/* @__PURE__ */ t.jsx(C, { children: /* @__PURE__ */ t.jsx(c, { size: "sm", variant: "link", className: "text-blue-500", onClick: () => i(!o), children: "+ New Page" }) }),
|
|
88
|
+
o && /* @__PURE__ */ t.jsx(S, { closeModal: () => i(!o) })
|
|
89
|
+
] });
|
|
90
|
+
};
|
|
91
|
+
export {
|
|
92
|
+
ut as default
|
|
93
|
+
};
|
package/dist/core.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-1217461b.cjs"),s=require("./useBuilderProp-5e57d0c8.cjs"),u=require("react-i18next");require("./jsx-runtime-5c3ac4f7.cjs");require("react");require("i18next");require("flagged");require("react-dnd");require("lodash");require("@minoru/react-dnd-treeview");require("jotai");require("./utils-3c452dd0.cjs");require("clsx");require("tailwind-merge");require("react-hotkeys-hook");require("flat-to-nested");require("./Class-6c695ccb.cjs");require("./MODIFIERS-70fef873.cjs");require("redux-undo");require("@react-hookz/web");require("@chaibuilder/blocks");require("sonner");require("@radix-ui/react-icons");require("lucide-react");require("@radix-ui/react-slot");require("class-variance-authority");require("@radix-ui/react-tooltip");require("@radix-ui/react-toast");exports.ChaiBuilderEditor=e.ChaiBuilderEditor;exports.ChaiBuilderStudio=e.ChaiBuilderStudio;exports.enableStyling=e.enableStyling;exports.setBlockProps=e.setBlockProps;exports.useActiveLanguage=e.useActiveLanguage;exports.useActiveModal=e.useActiveModal;exports.useActivePanel=e.useActivePanel;exports.useAddBlock=e.useAddBlock;exports.useAddBlockParent=e.useAddBlockParent;exports.useAddClassesToBlocks=e.useAddClassesToBlocks;exports.useAllBlocks=e.useAllBlocks;exports.useBlockContentByLanguage=e.useBlockContentByLanguage;exports.useBrandingOptions=e.useBrandingOptions;exports.useBuilderReset=e.useBuilderReset;exports.useBuildingBlocks=e.useBuildingBlocks;exports.useCanvasHistory=e.useCanvasHistory;exports.useCanvasWidth=e.useCanvasWidth;exports.useCanvasZoom=e.useCanvasZoom;exports.useCopyBlockIds=e.useCopyBlockIds;exports.useCurrentPage=e.useCurrentPage$1;exports.useCutBlockIds=e.useCutBlockIds;exports.useDarkMode=e.useDarkMode;exports.useDeveloperPreviewMode=e.useDeveloperPreviewMode;exports.useDuplicateBlocks=e.useDuplicateBlocks;exports.useFeatureSupport=e.useFeatureSupport;exports.useGetPageData=e.useGetPageData;exports.useHiddenBlockIds=e.useHiddenBlockIds;exports.useHighlightBlockId=e.useHighlightBlockId;exports.useLanguages=e.useLanguages;exports.useMarkAsGlobalBlock=e.useMarkAsGlobalBlock;exports.useMoveBlocks=e.useMoveBlocks;exports.usePasteBlocks=e.usePasteBlocks;exports.usePreviewMode=e.usePreviewMode;exports.usePrimaryLanguage=e.usePrimaryLanguage;exports.useProject=e.useProject$1;exports.useReadOnlyMode=e.useReadOnlyMode;exports.useRemoveBlocks=e.useRemoveBlocks;exports.useRemoveClassesFromBlocks=e.useRemoveClassesFromBlocks;exports.useSavePage=e.useSavePage;exports.useSelectedBlock=e.useSelectedBlock;exports.useSelectedBlockAllClasses=e.useSelectedBlockAllClasses;exports.useSelectedBlockCurrentClasses=e.useSelectedBlockCurrentClasses;exports.useSelectedBlockIds=e.useSelectedBlockIds;exports.useSelectedBlocksDisplayChild=e.useSelectedBlocksDisplayChild;exports.useSelectedBreakpoints=e.useSelectedBreakpoints;exports.useSelectedStylingBlocks=e.useSelectedStylingBlocks;exports.useSetAllBlocks=e.useSetAllBlocks;exports.useStylingBreakpoint=e.useStylingBreakpoint;exports.useStylingState=e.useStylingState;exports.useTranslations=e.useTranslations;exports.useTreeData=e.useTreeData;exports.useUILibraryBlocks=e.useUILibraryBlocks;exports.useUpdateBlocksProps=e.useUpdateBlocksProps;exports.useUpdateBlocksPropsRealtime=e.useUpdateBlocksPropsRealtime;exports.useBuilderProp=s.useBuilderProp;Object.defineProperty(exports,"useTranslation",{enumerable:!0,get:()=>u.useTranslation});
|
package/dist/core.d.ts
CHANGED
|
@@ -6,8 +6,8 @@ import { ThrottledFunction } from '@react-hookz/web';
|
|
|
6
6
|
import { useTranslation } from 'react-i18next';
|
|
7
7
|
|
|
8
8
|
declare type AddBlocks = {
|
|
9
|
-
addCoreBlock:
|
|
10
|
-
addPredefinedBlock:
|
|
9
|
+
addCoreBlock: any;
|
|
10
|
+
addPredefinedBlock: any;
|
|
11
11
|
};
|
|
12
12
|
|
|
13
13
|
declare interface Block {
|
|
@@ -70,17 +70,17 @@ export declare interface ChaiBuilderEditorProps {
|
|
|
70
70
|
onSyncStatusChange?: (syncStatus: "UNSAVED" | "SAVED") => void;
|
|
71
71
|
previewComponent?: LazyExoticComponent<any>;
|
|
72
72
|
sideBarComponents?: {
|
|
73
|
-
bottom?: [
|
|
73
|
+
bottom?: ReactComponents[];
|
|
74
74
|
top?: {
|
|
75
|
-
icon: React_2.FC<any
|
|
75
|
+
icon: React_2.FC<any> | string;
|
|
76
76
|
name: string;
|
|
77
|
-
panel:
|
|
77
|
+
panel: ReactComponents;
|
|
78
78
|
}[];
|
|
79
79
|
};
|
|
80
80
|
topBarComponents?: {
|
|
81
|
-
center?:
|
|
82
|
-
left?:
|
|
83
|
-
right?:
|
|
81
|
+
center?: ReactComponents[];
|
|
82
|
+
left?: ReactComponents[];
|
|
83
|
+
right?: ReactComponents[];
|
|
84
84
|
};
|
|
85
85
|
uiLibraries?: UiLibrary[];
|
|
86
86
|
uploadMediaCallback?: (file: File) => Promise<string>;
|
|
@@ -89,10 +89,10 @@ export declare interface ChaiBuilderEditorProps {
|
|
|
89
89
|
|
|
90
90
|
export declare const ChaiBuilderStudio: (props: ChaiBuilderStudioProps) => JSX_2.Element;
|
|
91
91
|
|
|
92
|
-
declare type ChaiBuilderStudioProps = {
|
|
92
|
+
export declare type ChaiBuilderStudioProps = {
|
|
93
93
|
apiBaseUrl?: string;
|
|
94
|
-
logo?:
|
|
95
|
-
|
|
94
|
+
logo?: React_2.FC<any> | React_2.LazyExoticComponent<any>;
|
|
95
|
+
darkMode?: boolean;
|
|
96
96
|
};
|
|
97
97
|
|
|
98
98
|
declare type ChaiPage = {
|
|
@@ -126,6 +126,8 @@ declare type PredefinedBlock = {
|
|
|
126
126
|
html?: string;
|
|
127
127
|
};
|
|
128
128
|
|
|
129
|
+
declare type ReactComponents = React_2.LazyExoticComponent<any> | React_2.FC<any>;
|
|
130
|
+
|
|
129
131
|
export declare const setBlockProps: (attrs: Record<string, string>) => {
|
|
130
132
|
[x: string]: string;
|
|
131
133
|
};
|
package/dist/core.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { u as
|
|
3
|
-
import { useTranslation as
|
|
1
|
+
import { a3 as L, am as R, a2 as f, a1 as b, D as x, a5 as H, ah as T, R as U, ai as j, H as w, y as F, al as G, w as O, Y as Z, a6 as q, c as E, e as J, k as K, n as Q, a7 as W, m as Y, d as z, a8 as N, l as V, j as X, a9 as _, Q as $, x as ss, ak as es, Z as as, aa as os, o as ts, p as us, aj as ls, ab as rs, a4 as is, q as ps, I as cs, u as ds, A as ms, ad as Bs, K as ks, h as ns, L as gs, f as Cs, i as Ss, g as Ps, ae as vs, J as ys, ac as As, af as hs, U as Ds, ag as Is, C as Ms } from "./index-32519c31.js";
|
|
2
|
+
import { u as Rs } from "./useBuilderProp-81a14920.js";
|
|
3
|
+
import { useTranslation as bs } from "react-i18next";
|
|
4
4
|
import "./jsx-runtime-944c88e2.js";
|
|
5
5
|
import "react";
|
|
6
6
|
import "i18next";
|
|
@@ -14,71 +14,73 @@ import "clsx";
|
|
|
14
14
|
import "tailwind-merge";
|
|
15
15
|
import "react-hotkeys-hook";
|
|
16
16
|
import "flat-to-nested";
|
|
17
|
-
import "./Class-
|
|
17
|
+
import "./Class-1fb4c0c4.js";
|
|
18
|
+
import "./MODIFIERS-c2e02614.js";
|
|
18
19
|
import "redux-undo";
|
|
19
20
|
import "@react-hookz/web";
|
|
20
21
|
import "@chaibuilder/blocks";
|
|
22
|
+
import "sonner";
|
|
21
23
|
import "@radix-ui/react-icons";
|
|
22
|
-
import "
|
|
24
|
+
import "lucide-react";
|
|
23
25
|
import "@radix-ui/react-slot";
|
|
24
26
|
import "class-variance-authority";
|
|
25
27
|
import "@radix-ui/react-tooltip";
|
|
26
28
|
import "@radix-ui/react-toast";
|
|
27
29
|
export {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
30
|
+
L as ChaiBuilderEditor,
|
|
31
|
+
R as ChaiBuilderStudio,
|
|
32
|
+
f as enableStyling,
|
|
33
|
+
b as setBlockProps,
|
|
34
|
+
x as useActiveLanguage,
|
|
35
|
+
H as useActiveModal,
|
|
36
|
+
T as useActivePanel,
|
|
37
|
+
U as useAddBlock,
|
|
38
|
+
j as useAddBlockParent,
|
|
39
|
+
w as useAddClassesToBlocks,
|
|
40
|
+
F as useAllBlocks,
|
|
41
|
+
G as useBlockContentByLanguage,
|
|
42
|
+
O as useBrandingOptions,
|
|
43
|
+
Rs as useBuilderProp,
|
|
44
|
+
Z as useBuilderReset,
|
|
45
|
+
q as useBuildingBlocks,
|
|
46
|
+
E as useCanvasHistory,
|
|
47
|
+
J as useCanvasWidth,
|
|
48
|
+
K as useCanvasZoom,
|
|
49
|
+
Q as useCopyBlockIds,
|
|
50
|
+
W as useCurrentPage,
|
|
51
|
+
Y as useCutBlockIds,
|
|
52
|
+
z as useDarkMode,
|
|
53
|
+
N as useDeveloperPreviewMode,
|
|
54
|
+
V as useDuplicateBlocks,
|
|
55
|
+
X as useFeatureSupport,
|
|
56
|
+
_ as useGetPageData,
|
|
57
|
+
$ as useHiddenBlockIds,
|
|
58
|
+
ss as useHighlightBlockId,
|
|
59
|
+
es as useLanguages,
|
|
60
|
+
as as useMarkAsGlobalBlock,
|
|
61
|
+
os as useMoveBlocks,
|
|
62
|
+
ts as usePasteBlocks,
|
|
63
|
+
us as usePreviewMode,
|
|
64
|
+
ls as usePrimaryLanguage,
|
|
65
|
+
rs as useProject,
|
|
66
|
+
is as useReadOnlyMode,
|
|
67
|
+
ps as useRemoveBlocks,
|
|
68
|
+
cs as useRemoveClassesFromBlocks,
|
|
69
|
+
ds as useSavePage,
|
|
70
|
+
ms as useSelectedBlock,
|
|
71
|
+
Bs as useSelectedBlockAllClasses,
|
|
72
|
+
ks as useSelectedBlockCurrentClasses,
|
|
73
|
+
ns as useSelectedBlockIds,
|
|
74
|
+
gs as useSelectedBlocksDisplayChild,
|
|
75
|
+
Cs as useSelectedBreakpoints,
|
|
76
|
+
Ss as useSelectedStylingBlocks,
|
|
77
|
+
Ps as useSetAllBlocks,
|
|
78
|
+
vs as useStylingBreakpoint,
|
|
79
|
+
ys as useStylingState,
|
|
80
|
+
bs as useTranslation,
|
|
81
|
+
As as useTranslations,
|
|
82
|
+
hs as useTreeData,
|
|
83
|
+
Ds as useUILibraryBlocks,
|
|
84
|
+
Is as useUpdateBlocksProps,
|
|
85
|
+
Ms as useUpdateBlocksPropsRealtime
|
|
84
86
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-5c3ac4f7.cjs"),l=require("./useBuilderProp-5e57d0c8.cjs"),r=require("./alert-dialog-4ce6ed22.cjs"),d=require("./usePageActions-5e28a006.cjs");require("react");require("@radix-ui/react-slot");require("class-variance-authority");require("./utils-3c452dd0.cjs");require("clsx");require("tailwind-merge");require("@radix-ui/react-tooltip");require("@radix-ui/react-icons");require("@radix-ui/react-toast");require("jotai");require("lodash");require("@radix-ui/react-alert-dialog");require("./index-1217461b.cjs");require("i18next");require("react-i18next");require("flagged");require("react-dnd");require("@minoru/react-dnd-treeview");require("react-hotkeys-hook");require("flat-to-nested");require("./Class-6c695ccb.cjs");require("./MODIFIERS-70fef873.cjs");require("redux-undo");require("@react-hookz/web");require("@chaibuilder/blocks");require("sonner");require("lucide-react");require("./useChangePage-f22cea36.cjs");const x=({pageData:i,projectData:s})=>{const n={},t=d.useDeletePage(),u=i.uuid===s.homepage,o=()=>{t.mutate(i,{onSuccess:()=>{n({uuid:s.homepage,slug:"/home"})}})};return e.jsxRuntimeExports.jsxs(r.AlertDialog,{children:[e.jsxRuntimeExports.jsx(r.AlertDialogTrigger,{disabled:u,children:e.jsxRuntimeExports.jsx("div",{className:`flex h-full items-center justify-center rounded-md border px-2 py-2 font-medium hover:bg-red-400 hover:text-white ${u?"cursor-not-allowed border-red-200 text-red-200":"cursor-pointer border-red-400 text-red-400"}`,children:e.jsxRuntimeExports.jsx("div",{children:"Del"})})}),e.jsxRuntimeExports.jsxs(r.AlertDialogContent,{children:[e.jsxRuntimeExports.jsxs(r.AlertDialogTitle,{children:["Are you sure you want to delete ",e.jsxRuntimeExports.jsx("i",{className:"text-red-500",children:i.name})," page?"]}),e.jsxRuntimeExports.jsx(r.AlertDialogDescription,{children:"This action cannot be undone. This will permanently delete your page."}),e.jsxRuntimeExports.jsxs("div",{className:"flex items-center justify-end gap-x-3",children:[e.jsxRuntimeExports.jsx(r.AlertDialogCancel,{disabled:t.isPending,children:"Cancel"}),e.jsxRuntimeExports.jsx(l.Button,{variant:"destructive",onClick:o,disabled:t.isPending,children:"Yes, Delete"})]})]})]})};exports.default=x;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { j as e } from "./jsx-runtime-944c88e2.js";
|
|
2
2
|
import { B as m } from "./useBuilderProp-81a14920.js";
|
|
3
3
|
import { A as n, a as d, b as a, e as p, f as c, h as u } from "./alert-dialog-ee98f47e.js";
|
|
4
|
-
import {
|
|
4
|
+
import { b as h } from "./usePageActions-d6e1d325.js";
|
|
5
5
|
import "react";
|
|
6
6
|
import "@radix-ui/react-slot";
|
|
7
7
|
import "class-variance-authority";
|
|
@@ -14,7 +14,7 @@ import "@radix-ui/react-toast";
|
|
|
14
14
|
import "jotai";
|
|
15
15
|
import "lodash";
|
|
16
16
|
import "@radix-ui/react-alert-dialog";
|
|
17
|
-
import "./index-
|
|
17
|
+
import "./index-32519c31.js";
|
|
18
18
|
import "i18next";
|
|
19
19
|
import "react-i18next";
|
|
20
20
|
import "flagged";
|
|
@@ -22,14 +22,15 @@ import "react-dnd";
|
|
|
22
22
|
import "@minoru/react-dnd-treeview";
|
|
23
23
|
import "react-hotkeys-hook";
|
|
24
24
|
import "flat-to-nested";
|
|
25
|
-
import "./Class-
|
|
25
|
+
import "./Class-1fb4c0c4.js";
|
|
26
|
+
import "./MODIFIERS-c2e02614.js";
|
|
26
27
|
import "redux-undo";
|
|
27
28
|
import "@react-hookz/web";
|
|
28
29
|
import "@chaibuilder/blocks";
|
|
29
|
-
import "./CONTROLS-442caee5.js";
|
|
30
|
-
import "./useMutation-97876a40.js";
|
|
31
30
|
import "sonner";
|
|
32
|
-
|
|
31
|
+
import "lucide-react";
|
|
32
|
+
import "./useChangePage-6a7c7374.js";
|
|
33
|
+
const Q = ({ pageData: r, projectData: i }) => {
|
|
33
34
|
const s = {}, t = h(), o = r.uuid === i.homepage, l = () => {
|
|
34
35
|
t.mutate(r, {
|
|
35
36
|
onSuccess: () => {
|
|
@@ -48,7 +49,7 @@ const M = ({ pageData: r, projectData: i }) => {
|
|
|
48
49
|
/* @__PURE__ */ e.jsxs(a, { children: [
|
|
49
50
|
/* @__PURE__ */ e.jsxs(p, { children: [
|
|
50
51
|
"Are you sure you want to delete ",
|
|
51
|
-
/* @__PURE__ */ e.jsx("i", { className: "text-red-500", children: r.
|
|
52
|
+
/* @__PURE__ */ e.jsx("i", { className: "text-red-500", children: r.name }),
|
|
52
53
|
" page?"
|
|
53
54
|
] }),
|
|
54
55
|
/* @__PURE__ */ e.jsx(c, { children: "This action cannot be undone. This will permanently delete your page." }),
|
|
@@ -60,5 +61,5 @@ const M = ({ pageData: r, projectData: i }) => {
|
|
|
60
61
|
] });
|
|
61
62
|
};
|
|
62
63
|
export {
|
|
63
|
-
|
|
64
|
+
Q as default
|
|
64
65
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const o=require("himalaya"),b=require("./Class-6c695ccb.cjs"),e=require("lodash"),T=require("./utils-3c452dd0.cjs"),u=require("./MODIFIERS-70fef873.cjs"),v={img:{alt:"alt",width:"width",height:"height",src:"image"},video:{src:"url",autoplay:"controls.autoPlay",muted:"controls.muted",loop:"controls.loop",controls:"controls.widgets"},a:{href:"link.href",target:"link.target",type:""},input:{placeholder:"placeholder",required:"required",type:"inputType",name:"fieldName"},textarea:{placeholder:"placeholder",required:"required",type:"inputType",name:"fieldName"},select:{placeholder:"placeholder",required:"required",multiple:"multiple",name:"fieldName"}},k=(t,r)=>t.children.length===1&&e.includes(["Heading","Paragraph","Span","ListItem","Button","Label","TableCell","Link"],r._type),y=t=>t.map(r=>r.type==="text"?e.get(r,"content",""):e.isEmpty(r.children)?"":y(r.children)).join(""),p=t=>t===null?!0:t,g=t=>{const r={},s=v[t.tagName]||{},a=t.attributes;return e.forEach(a,({key:l,value:c})=>{if(s[l]){if(t.tagName==="img"&&l==="src"&&!c.startsWith("http")){const i=e.find(t.attributes,{key:"width"}),n=e.find(t.attributes,{key:"height"});i&&n?c=`https://via.placeholder.com/${i==null?void 0:i.value}x${n==null?void 0:n.value}`:c="https://via.placeholder.com/150x150"}e.set(r,s[l],p(c))}else e.includes(["style","class","srcset"],l)||e.set(r,`styles_attrs.${l}`,p(c))}),delete r.class,r},N=(t,r="styles")=>{if(!t.attributes)return{[r]:`${u.STYLES_KEY},`};const s=e.find(t.attributes,{key:"class"});if(s){const a=s.value;return{[r]:`${u.STYLES_KEY},${a}`}}return{[r]:`${u.STYLES_KEY},`}},L=t=>{switch(t.tagName){case"img":return{_type:"Image"};case"input":return{_type:"Input",showLabel:!1};case"hr":return{_type:"Divider"};case"br":return{_type:"LineBreak"};case"textarea":return{_type:"TextArea",showLabel:!1};case"audio":return{_type:"Audio"};case"iframe":return{_type:"Iframe"};case"canvas":return{_type:"Canvas"};case"video":return{_type:"CustomHTML"};case"svg":return{_type:"Icon"};case"select":return{_type:"Select",options:[]};case"option":return{_type:"Option"};case"ul":case"ol":case"dl":return{_type:"List",tag:t.tagName,_listType:t.tagName==="ol"?"list-decimal":"list-none"};case"li":case"dt":return{_type:"ListItem",tag:t.tagName};case"span":case"figcaption":case"legend":return{_type:"Span",tag:t.tagName};case"p":return{_type:"Paragraph",content:""};case"a":return{_type:"Link"};case"form":return{_type:"Form"};case"label":return{_type:"Label"};case"button":return{_type:"Button"};case"code":return{_type:"Code"};case"h1":case"h2":case"h3":case"h4":case"h5":case"h6":return{_type:"Heading",tag:t.tagName};case"table":return{_type:"Table"};case"tr":return{_type:"TableRow"};case"td":case"th":return{_type:"TableCell",tag:t.tagName};case"thead":return{_type:"TableHead"};case"tbody":return{_type:"TableBody"};case"tfoot":return{_type:"TableFooter"};default:return{_type:"Box",tag:t.tagName,name:t.tagName==="div"?"Box":e.capitalize(t.tagName)}}},h=(t,r=null)=>e.flatMapDeep(t,s=>{var c;if(s.type==="comment")return[];let a={_id:b.generateUUID()};if(r&&(a._parent=r.block._id),s.type==="text")return e.isEmpty(e.get(s,"content",""))?[]:r&&k(r.node,r.block)?(e.set(r,"block.content",e.get(s,"content","")),[]):{...a,_type:"Text",content:e.get(s,"content","")};if(a={...a,...L(s),...g(s),...N(s)},a._type==="Input"){const i=a.inputType||"text";i==="checkbox"?e.set(a,"_type","Checkbox"):i==="radio"&&e.set(a,"_type","Radio")}else{if(s.tagName==="video")return a.content=o.stringify([s]),[a];if(s.tagName==="svg"){const i=e.find(s.attributes,{key:"height"}),n=e.find(s.attributes,{key:"width"}),m=e.get(i,"value")?`[${e.get(i,"value")}px]`:"full",f=e.get(n,"value")?`[${e.get(n,"value")}px]`:"full",_=e.get(e.find(s.attributes,{key:"class"}),"value");return a.styles=`${u.STYLES_KEY}, ${T.cn(`w-${f} h-${m}`,_)}`.trim(),s.attributes=e.filter(s.attributes,d=>!e.includes(["style","width","height","class"],d.key)),a._icon=o.stringify([s]),e.set(a,"styles_attrs",e.omit(e.get(a,"styles_attrs")||{},["height","width","style","class"])),[a]}else if(s.tagName=="option"&&r&&((c=r.block)==null?void 0:c._type)==="Select")return r.block.options.push({label:y(s.children),...g(s)}),[]}const l=h(s.children,{block:a,node:s});return[a,...l]}),S=t=>{const r=t.match(/<body[^>]*>[\s\S]*?<\/body>/);return(r&&r.length>0?r[0].replace(/<body/,"<div").replace(/<\/body>/,"</div>"):t).replace(/\s+/g," ").replaceAll("> <","><").replace(/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,"").trim()},x=t=>{const r=o.parse(S(t));return e.isEmpty(t)?[]:e.flatten(h(r))};exports.getBlocksFromHTML=x;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { parse as k, stringify as h } from "himalaya";
|
|
2
|
-
import { g as x } from "./Class-
|
|
2
|
+
import { g as x } from "./Class-1fb4c0c4.js";
|
|
3
3
|
import { isEmpty as y, flatten as L, flatMapDeep as $, get as c, set as o, find as u, filter as w, includes as g, omit as S, forEach as C, capitalize as B } from "lodash";
|
|
4
4
|
import { c as I } from "./utils-ac68b2c8.js";
|
|
5
|
-
import { S as p } from "./
|
|
5
|
+
import { S as p } from "./MODIFIERS-c2e02614.js";
|
|
6
6
|
const A = {
|
|
7
7
|
img: { alt: "alt", width: "width", height: "height", src: "image" },
|
|
8
8
|
video: {
|