@chaibuilder/sdk 0.1.16 → 0.1.18
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-5cb44efb.cjs +3 -0
- package/dist/{AddBlocks-6f4db22d.js → AddBlocks-c47af38f.js} +49 -45
- package/dist/BrandingOptions-4f3e3a8d.cjs +1 -0
- package/dist/{BrandingOptions-d6351932.js → BrandingOptions-52b2de6f.js} +11 -7
- package/dist/CanvasArea-90a395c1.js +1311 -0
- package/dist/CanvasArea-aef3fa5e.cjs +46 -0
- package/dist/{CurrentPage-e8f8ff05.js → CurrentPage-2721bc7b.js} +18 -14
- package/dist/CurrentPage-d1ec06db.cjs +1 -0
- package/dist/{ImagesPanel-68a11293.cjs → ImagesPanel-0db5c72f.cjs} +1 -1
- package/dist/{ImagesPanel-996761b1.js → ImagesPanel-38c44785.js} +1 -1
- package/dist/{Layers-6fc21e86.js → Layers-a9cf4d7c.js} +144 -142
- package/dist/Layers-d0edf1a8.cjs +1 -0
- package/dist/{MarkAsGlobalBlock-cf7e8b31.js → MarkAsGlobalBlock-0cf6e5a2.js} +15 -11
- package/dist/MarkAsGlobalBlock-c43c3b2c.cjs +1 -0
- package/dist/PagesPanel-22050a98.cjs +1 -0
- package/dist/{PagesPanel-7db807df.js → PagesPanel-589544c2.js} +12 -8
- package/dist/ProjectPanel-215ba7f1.cjs +1 -0
- package/dist/{ProjectPanel-a7c78e1f.js → ProjectPanel-dbea8af1.js} +12 -8
- package/dist/Settings-71c0312b.cjs +1 -0
- package/dist/{Settings-1e6e0534.js → Settings-c347533e.js} +909 -640
- package/dist/SidePanels-214fef72.js +2999 -0
- package/dist/SidePanels-3844d8b5.cjs +13 -0
- package/dist/{Topbar-4f1aca98.js → Topbar-1dd5c34e.js} +23 -19
- package/dist/Topbar-4fa3ab61.cjs +1 -0
- package/dist/{UnsplashImages-f761ad96.cjs → UnsplashImages-0d091e33.cjs} +1 -1
- package/dist/{UnsplashImages-47374e0c.js → UnsplashImages-10c95b63.js} +1 -1
- package/dist/{UploadImages-33c1507a.cjs → UploadImages-10439fde.cjs} +1 -1
- package/dist/{UploadImages-f0ba3215.js → UploadImages-b14bd152.js} +1 -1
- package/dist/_commonjsHelpers-10dfc225.js +8 -0
- package/dist/_commonjsHelpers-87b0abe8.cjs +1 -0
- package/dist/add-page-modal-05c947fb.cjs +1 -0
- package/dist/{add-page-modal-d4f5ba20.js → add-page-modal-5cc1393d.js} +14 -11
- package/dist/card-14e1d020.cjs +1 -0
- package/dist/card-f8f4f985.js +33 -0
- package/dist/core.cjs +1 -1
- package/dist/core.d.ts +6 -4
- package/dist/core.js +63 -59
- package/dist/delete-page-modal-859c3a09.cjs +1 -0
- package/dist/{delete-page-modal-00d5fbab.js → delete-page-modal-a79bfc45.js} +15 -11
- package/dist/{form-bf09d392.js → form-725e3191.js} +3 -3
- package/dist/{form-5d04c9b3.cjs → form-99b51245.cjs} +1 -1
- package/dist/index-dfeadcce.cjs +164 -0
- package/dist/index-f8a2f8ef.js +31068 -0
- package/dist/{link-6467eda6.js → link-2af5de8b.js} +1 -1
- package/dist/{link-4585b2d6.cjs → link-86ac8848.cjs} +1 -1
- package/dist/page-viewer-aac7b439.cjs +1 -0
- package/dist/{page-viewer-c494031b.js → page-viewer-c6421156.js} +22 -18
- package/dist/project-general-setting-ce814ecf.cjs +1 -0
- package/dist/{project-general-setting-fca12629.js → project-general-setting-f9fd21cc.js} +9 -7
- package/dist/{project-seo-setting-3f645a02.cjs → project-seo-setting-a9403f1d.cjs} +1 -1
- package/dist/{project-seo-setting-e9587467.js → project-seo-setting-c1980ec3.js} +3 -3
- package/dist/render.cjs +1 -1
- package/dist/render.js +1 -1
- package/dist/{scroll-area-9f64a082.js → scroll-area-83bd9e8f.js} +7 -7
- package/dist/{scroll-area-088530b9.cjs → scroll-area-bb343b86.cjs} +1 -1
- package/dist/{single-page-detail-ff7fceb1.js → single-page-detail-2ac00c2e.js} +32 -30
- package/dist/single-page-detail-dcbb3cab.cjs +1 -0
- package/dist/style.css +1 -1
- package/dist/textarea-20b2f6b2.cjs +1 -0
- package/dist/textarea-9dfb6a32.js +45 -0
- package/dist/ui.cjs +1 -1
- package/dist/ui.js +74 -73
- package/dist/useChaiExternalData-192c7896.js +5 -0
- package/dist/useChaiExternalData-a90e8aac.cjs +1 -0
- package/package.json +5 -3
- package/dist/AddBlocks-59a68fc9.cjs +0 -3
- package/dist/BrandingOptions-8e7a159f.cjs +0 -1
- package/dist/CanvasArea-08537c6e.cjs +0 -60
- package/dist/CanvasArea-a585620d.js +0 -1459
- package/dist/CurrentPage-cbbfdbf4.cjs +0 -1
- package/dist/Layers-636e0bc6.cjs +0 -1
- package/dist/MarkAsGlobalBlock-23dd24b9.cjs +0 -1
- package/dist/PagesPanel-bf13d0a5.cjs +0 -1
- package/dist/ProjectPanel-d98d3585.cjs +0 -1
- package/dist/Settings-1b76c006.cjs +0 -1
- package/dist/SidePanels-55124e18.cjs +0 -1
- package/dist/SidePanels-af4f2c45.js +0 -149
- package/dist/Topbar-5df341d7.cjs +0 -1
- package/dist/_commonjsHelpers-5a53b418.cjs +0 -1
- package/dist/_commonjsHelpers-d4512b9c.js +0 -6
- package/dist/add-page-modal-b685709e.cjs +0 -1
- package/dist/delete-page-modal-bbd3ffa2.cjs +0 -1
- package/dist/index-8a7a37ce.js +0 -5028
- package/dist/index-bf44bc93.cjs +0 -2
- package/dist/page-viewer-f0a54a92.cjs +0 -1
- package/dist/project-general-setting-a3e99d1e.cjs +0 -1
- package/dist/single-page-detail-84c67e67.cjs +0 -1
- package/dist/textarea-0750bcd2.js +0 -73
- package/dist/textarea-a338ede6.cjs +0 -1
|
@@ -4,8 +4,8 @@ import { kebabCase as j } from "lodash";
|
|
|
4
4
|
import { B as c } from "./useBuilderProp-81a14920.js";
|
|
5
5
|
import { D as b, b as C, a as A } from "./dialog-3d4e82ed.js";
|
|
6
6
|
import { SingleLineText as d } from "@chaibuilder/blocks";
|
|
7
|
-
import { F as D } from "./form-
|
|
8
|
-
import {
|
|
7
|
+
import { F as D } from "./form-725e3191.js";
|
|
8
|
+
import { a0 as N } from "./index-f8a2f8ef.js";
|
|
9
9
|
import "@radix-ui/react-slot";
|
|
10
10
|
import "class-variance-authority";
|
|
11
11
|
import "./utils-ac68b2c8.js";
|
|
@@ -18,14 +18,17 @@ import "jotai";
|
|
|
18
18
|
import "@radix-ui/react-dialog";
|
|
19
19
|
import "@rjsf/core";
|
|
20
20
|
import "@rjsf/validator-ajv8";
|
|
21
|
-
import "./link-
|
|
21
|
+
import "./link-2af5de8b.js";
|
|
22
22
|
import "react-icons-picker";
|
|
23
23
|
import "react-dom";
|
|
24
|
-
import "./ImagesPanel-
|
|
24
|
+
import "./ImagesPanel-38c44785.js";
|
|
25
25
|
import "./tabs-85caa1e8.js";
|
|
26
26
|
import "@radix-ui/react-tabs";
|
|
27
27
|
import "react-quill";
|
|
28
28
|
import "react-i18next";
|
|
29
|
+
import "./_commonjsHelpers-10dfc225.js";
|
|
30
|
+
import "@radix-ui/react-scroll-area";
|
|
31
|
+
import "@floating-ui/react-dom";
|
|
29
32
|
import "i18next";
|
|
30
33
|
import "flagged";
|
|
31
34
|
import "react-dnd";
|
|
@@ -40,7 +43,7 @@ import "@react-hookz/web";
|
|
|
40
43
|
import "lucide-react";
|
|
41
44
|
import "sonner";
|
|
42
45
|
const S = ({ closeModal: o }) => {
|
|
43
|
-
var
|
|
46
|
+
var s, p;
|
|
44
47
|
const i = N(), [e, u] = g({
|
|
45
48
|
name: "",
|
|
46
49
|
slug: "",
|
|
@@ -54,10 +57,10 @@ const S = ({ closeModal: o }) => {
|
|
|
54
57
|
}, x = ({ formData: a }, r) => {
|
|
55
58
|
u((h) => {
|
|
56
59
|
var n, l;
|
|
57
|
-
const
|
|
58
|
-
return r === "name" ?
|
|
60
|
+
const m = { [r]: a[r] };
|
|
61
|
+
return r === "name" ? m.slug = j((n = a[r]) == null ? void 0 : n.replace(/\d/g, "")) : r === "slug" && (m.slug = (l = a[r]) == null ? void 0 : l.replace(/\d/g, "").replace(/\s+/g, "").replace("--", "-").replace("__", "_")), {
|
|
59
62
|
...h,
|
|
60
|
-
...
|
|
63
|
+
...m
|
|
61
64
|
};
|
|
62
65
|
});
|
|
63
66
|
}, P = {
|
|
@@ -74,13 +77,13 @@ const S = ({ closeModal: o }) => {
|
|
|
74
77
|
c,
|
|
75
78
|
{
|
|
76
79
|
type: "submit",
|
|
77
|
-
disabled: !e.name || !e.slug || ((
|
|
80
|
+
disabled: !e.name || !e.slug || ((s = e.name) == null ? void 0 : s.length) < 2 || ((p = e.slug) == null ? void 0 : p.length) < 2 || i.isPending,
|
|
78
81
|
onClick: f,
|
|
79
82
|
children: "Add Page"
|
|
80
83
|
}
|
|
81
84
|
) })
|
|
82
85
|
] });
|
|
83
|
-
},
|
|
86
|
+
}, xt = () => {
|
|
84
87
|
const [o, i] = g(!1);
|
|
85
88
|
return /* @__PURE__ */ t.jsxs(b, { open: o, onOpenChange: () => i(!o), children: [
|
|
86
89
|
/* @__PURE__ */ t.jsx(C, { children: /* @__PURE__ */ t.jsx(c, { size: "sm", variant: "link", className: "text-blue-500", onClick: () => i(!o), children: "+ New Page" }) }),
|
|
@@ -88,5 +91,5 @@ const S = ({ closeModal: o }) => {
|
|
|
88
91
|
] });
|
|
89
92
|
};
|
|
90
93
|
export {
|
|
91
|
-
|
|
94
|
+
xt as default
|
|
92
95
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const a=require("./jsx-runtime-5c3ac4f7.cjs"),m=require("react"),s=require("./utils-3c452dd0.cjs");function u(e){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const n=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(r,t,n.get?n:{enumerable:!0,get:()=>e[t]})}}return r.default=e,Object.freeze(r)}const o=u(m),d=o.forwardRef(({className:e,...r},t)=>a.jsxRuntimeExports.jsx("div",{ref:t,className:s.cn("rounded-xl border bg-card text-card-foreground shadow",e),...r}));d.displayName="Card";const c=o.forwardRef(({className:e,...r},t)=>a.jsxRuntimeExports.jsx("div",{ref:t,className:s.cn("flex flex-col space-y-1.5 p-6",e),...r}));c.displayName="CardHeader";const i=o.forwardRef(({className:e,...r},t)=>a.jsxRuntimeExports.jsx("h3",{ref:t,className:s.cn("font-semibold leading-none tracking-tight",e),...r}));i.displayName="CardTitle";const l=o.forwardRef(({className:e,...r},t)=>a.jsxRuntimeExports.jsx("p",{ref:t,className:s.cn("text-sm text-muted-foreground",e),...r}));l.displayName="CardDescription";const p=o.forwardRef(({className:e,...r},t)=>a.jsxRuntimeExports.jsx("div",{ref:t,className:s.cn("p-6 pt-0",e),...r}));p.displayName="CardContent";const f=o.forwardRef(({className:e,...r},t)=>a.jsxRuntimeExports.jsx("div",{ref:t,className:s.cn(" flex items-center p-6 pt-0",e),...r}));f.displayName="CardFooter";exports.Card=d;exports.CardContent=p;exports.CardDescription=l;exports.CardFooter=f;exports.CardHeader=c;exports.CardTitle=i;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { j as s } from "./jsx-runtime-944c88e2.js";
|
|
2
|
+
import * as d from "react";
|
|
3
|
+
import { c as o } from "./utils-ac68b2c8.js";
|
|
4
|
+
const t = d.forwardRef(({ className: a, ...e }, r) => /* @__PURE__ */ s.jsx("div", { ref: r, className: o("rounded-xl border bg-card text-card-foreground shadow", a), ...e }));
|
|
5
|
+
t.displayName = "Card";
|
|
6
|
+
const i = d.forwardRef(
|
|
7
|
+
({ className: a, ...e }, r) => /* @__PURE__ */ s.jsx("div", { ref: r, className: o("flex flex-col space-y-1.5 p-6", a), ...e })
|
|
8
|
+
);
|
|
9
|
+
i.displayName = "CardHeader";
|
|
10
|
+
const c = d.forwardRef(
|
|
11
|
+
({ className: a, ...e }, r) => /* @__PURE__ */ s.jsx("h3", { ref: r, className: o("font-semibold leading-none tracking-tight", a), ...e })
|
|
12
|
+
);
|
|
13
|
+
c.displayName = "CardTitle";
|
|
14
|
+
const m = d.forwardRef(
|
|
15
|
+
({ className: a, ...e }, r) => /* @__PURE__ */ s.jsx("p", { ref: r, className: o("text-sm text-muted-foreground", a), ...e })
|
|
16
|
+
);
|
|
17
|
+
m.displayName = "CardDescription";
|
|
18
|
+
const n = d.forwardRef(
|
|
19
|
+
({ className: a, ...e }, r) => /* @__PURE__ */ s.jsx("div", { ref: r, className: o("p-6 pt-0", a), ...e })
|
|
20
|
+
);
|
|
21
|
+
n.displayName = "CardContent";
|
|
22
|
+
const f = d.forwardRef(
|
|
23
|
+
({ className: a, ...e }, r) => /* @__PURE__ */ s.jsx("div", { ref: r, className: o(" flex items-center p-6 pt-0", a), ...e })
|
|
24
|
+
);
|
|
25
|
+
f.displayName = "CardFooter";
|
|
26
|
+
export {
|
|
27
|
+
t as C,
|
|
28
|
+
i as a,
|
|
29
|
+
f as b,
|
|
30
|
+
c,
|
|
31
|
+
m as d,
|
|
32
|
+
n as e
|
|
33
|
+
};
|
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-dfeadcce.cjs"),s=require("./useBuilderProp-5e57d0c8.cjs"),u=require("react-i18next");require("./jsx-runtime-5c3ac4f7.cjs");require("react");require("./_commonjsHelpers-87b0abe8.cjs");require("clsx");require("@radix-ui/react-scroll-area");require("react-dom");require("@floating-ui/react-dom");require("jotai");require("i18next");require("flagged");require("react-dnd");require("lodash");require("@minoru/react-dnd-treeview");require("./utils-3c452dd0.cjs");require("tailwind-merge");require("react-hotkeys-hook");require("flat-to-nested");require("./html-to-json-78bfa1f3.cjs");require("./MODIFIERS-70fef873.cjs");require("himalaya");require("redux-undo");require("@react-hookz/web");require("@chaibuilder/blocks");require("@radix-ui/react-icons");require("lucide-react");require("sonner");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.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
|
@@ -53,6 +53,7 @@ export declare interface ChaiBuilderEditorProps {
|
|
|
53
53
|
canvasTopBarComponents?: {
|
|
54
54
|
right?: React_2.LazyExoticComponent<any>[];
|
|
55
55
|
};
|
|
56
|
+
dataProviders?: any[];
|
|
56
57
|
darkMode?: boolean;
|
|
57
58
|
dndOptions?: any;
|
|
58
59
|
fetchMediaCallback?: (limit?: number, offset?: number) => Promise<any[]>;
|
|
@@ -61,12 +62,13 @@ export declare interface ChaiBuilderEditorProps {
|
|
|
61
62
|
html: string;
|
|
62
63
|
}>;
|
|
63
64
|
getUILibraryBlocks?: (libraryUuid: string) => Promise<PredefinedBlock[]>;
|
|
64
|
-
|
|
65
|
-
|
|
65
|
+
subPages?: Block[];
|
|
66
|
+
subPagesSupport?: boolean;
|
|
66
67
|
importHTML?: boolean;
|
|
67
68
|
loading?: boolean;
|
|
68
|
-
onSaveBlocks
|
|
69
|
-
|
|
69
|
+
onSaveBlocks?: ({ blocks, providers }: any) => Promise<any>;
|
|
70
|
+
onSavePage: ({ blocks, providers }: any) => Promise<boolean>;
|
|
71
|
+
onSaveBrandingOptions: (brandingOptions: any) => Promise<boolean>;
|
|
70
72
|
onSyncStatusChange?: (syncStatus: "UNSAVED" | "SAVED") => void;
|
|
71
73
|
previewComponent?: LazyExoticComponent<any>;
|
|
72
74
|
sideBarComponents?: {
|
package/dist/core.js
CHANGED
|
@@ -1,16 +1,20 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { u as
|
|
3
|
-
import { useTranslation as
|
|
1
|
+
import { a5 as b, ap as j, H as x, a8 as G, ak as O, W as U, al as w, K as F, B as W, ao as Z, z as q, a6 as z, a9 as E, d as K, f as N, l as V, o as J, aa as Q, n as X, e as Y, ab as _, m as $, k as ss, ac as es, V as as, A as os, an as ts, a1 as rs, ad as us, q as is, s as ls, am as ps, ae as ms, a7 as cs, t as ds, L as Bs, c as ks, D as ns, ag as gs, N as Cs, i as Ss, O as vs, g as Ps, j as As, h as ys, ah as hs, M as Ms, af as Ds, ai as Is, Z as Ls, aj as fs, G as Rs } from "./index-f8a2f8ef.js";
|
|
2
|
+
import { u as Ts } from "./useBuilderProp-81a14920.js";
|
|
3
|
+
import { useTranslation as js } from "react-i18next";
|
|
4
4
|
import "./jsx-runtime-944c88e2.js";
|
|
5
5
|
import "react";
|
|
6
|
+
import "./_commonjsHelpers-10dfc225.js";
|
|
7
|
+
import "clsx";
|
|
8
|
+
import "@radix-ui/react-scroll-area";
|
|
9
|
+
import "react-dom";
|
|
10
|
+
import "@floating-ui/react-dom";
|
|
11
|
+
import "jotai";
|
|
6
12
|
import "i18next";
|
|
7
13
|
import "flagged";
|
|
8
14
|
import "react-dnd";
|
|
9
15
|
import "lodash";
|
|
10
16
|
import "@minoru/react-dnd-treeview";
|
|
11
|
-
import "jotai";
|
|
12
17
|
import "./utils-ac68b2c8.js";
|
|
13
|
-
import "clsx";
|
|
14
18
|
import "tailwind-merge";
|
|
15
19
|
import "react-hotkeys-hook";
|
|
16
20
|
import "flat-to-nested";
|
|
@@ -28,58 +32,58 @@ import "class-variance-authority";
|
|
|
28
32
|
import "@radix-ui/react-tooltip";
|
|
29
33
|
import "@radix-ui/react-toast";
|
|
30
34
|
export {
|
|
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
|
-
|
|
84
|
-
|
|
35
|
+
b as ChaiBuilderEditor,
|
|
36
|
+
j as ChaiBuilderStudio,
|
|
37
|
+
x as useActiveLanguage,
|
|
38
|
+
G as useActiveModal,
|
|
39
|
+
O as useActivePanel,
|
|
40
|
+
U as useAddBlock,
|
|
41
|
+
w as useAddBlockParent,
|
|
42
|
+
F as useAddClassesToBlocks,
|
|
43
|
+
W as useAllBlocks,
|
|
44
|
+
Z as useBlockContentByLanguage,
|
|
45
|
+
q as useBrandingOptions,
|
|
46
|
+
Ts as useBuilderProp,
|
|
47
|
+
z as useBuilderReset,
|
|
48
|
+
E as useBuildingBlocks,
|
|
49
|
+
K as useCanvasHistory,
|
|
50
|
+
N as useCanvasWidth,
|
|
51
|
+
V as useCanvasZoom,
|
|
52
|
+
J as useCopyBlockIds,
|
|
53
|
+
Q as useCurrentPage,
|
|
54
|
+
X as useCutBlockIds,
|
|
55
|
+
Y as useDarkMode,
|
|
56
|
+
_ as useDeveloperPreviewMode,
|
|
57
|
+
$ as useDuplicateBlocks,
|
|
58
|
+
ss as useFeatureSupport,
|
|
59
|
+
es as useGetPageData,
|
|
60
|
+
as as useHiddenBlockIds,
|
|
61
|
+
os as useHighlightBlockId,
|
|
62
|
+
ts as useLanguages,
|
|
63
|
+
rs as useMarkAsGlobalBlock,
|
|
64
|
+
us as useMoveBlocks,
|
|
65
|
+
is as usePasteBlocks,
|
|
66
|
+
ls as usePreviewMode,
|
|
67
|
+
ps as usePrimaryLanguage,
|
|
68
|
+
ms as useProject,
|
|
69
|
+
cs as useReadOnlyMode,
|
|
70
|
+
ds as useRemoveBlocks,
|
|
71
|
+
Bs as useRemoveClassesFromBlocks,
|
|
72
|
+
ks as useSavePage,
|
|
73
|
+
ns as useSelectedBlock,
|
|
74
|
+
gs as useSelectedBlockAllClasses,
|
|
75
|
+
Cs as useSelectedBlockCurrentClasses,
|
|
76
|
+
Ss as useSelectedBlockIds,
|
|
77
|
+
vs as useSelectedBlocksDisplayChild,
|
|
78
|
+
Ps as useSelectedBreakpoints,
|
|
79
|
+
As as useSelectedStylingBlocks,
|
|
80
|
+
ys as useSetAllBlocks,
|
|
81
|
+
hs as useStylingBreakpoint,
|
|
82
|
+
Ms as useStylingState,
|
|
83
|
+
js as useTranslation,
|
|
84
|
+
Ds as useTranslations,
|
|
85
|
+
Is as useTreeData,
|
|
86
|
+
Ls as useUILibraryBlocks,
|
|
87
|
+
fs as useUpdateBlocksProps,
|
|
88
|
+
Rs as useUpdateBlocksPropsRealtime
|
|
85
89
|
};
|
|
@@ -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("./index-dfeadcce.cjs"),c=require("@radix-ui/react-icons");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-toast");require("jotai");require("lodash");require("@radix-ui/react-alert-dialog");require("./_commonjsHelpers-87b0abe8.cjs");require("@radix-ui/react-scroll-area");require("react-dom");require("@floating-ui/react-dom");require("i18next");require("react-i18next");require("flagged");require("react-dnd");require("@minoru/react-dnd-treeview");require("react-hotkeys-hook");require("flat-to-nested");require("./html-to-json-78bfa1f3.cjs");require("./MODIFIERS-70fef873.cjs");require("himalaya");require("redux-undo");require("@react-hookz/web");require("@chaibuilder/blocks");require("lucide-react");require("sonner");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(c.TrashIcon,{})})}),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,8 @@
|
|
|
1
1
|
import { j as e } from "./jsx-runtime-944c88e2.js";
|
|
2
|
-
import { B as
|
|
3
|
-
import { A as n, a as d, b as
|
|
4
|
-
import {
|
|
2
|
+
import { B as l } from "./useBuilderProp-81a14920.js";
|
|
3
|
+
import { A as n, a as d, b as p, e as a, f as c, h as u } from "./alert-dialog-ee98f47e.js";
|
|
4
|
+
import { a4 as h } from "./index-f8a2f8ef.js";
|
|
5
|
+
import { TrashIcon as x } from "@radix-ui/react-icons";
|
|
5
6
|
import "react";
|
|
6
7
|
import "@radix-ui/react-slot";
|
|
7
8
|
import "class-variance-authority";
|
|
@@ -9,11 +10,14 @@ import "./utils-ac68b2c8.js";
|
|
|
9
10
|
import "clsx";
|
|
10
11
|
import "tailwind-merge";
|
|
11
12
|
import "@radix-ui/react-tooltip";
|
|
12
|
-
import "@radix-ui/react-icons";
|
|
13
13
|
import "@radix-ui/react-toast";
|
|
14
14
|
import "jotai";
|
|
15
15
|
import "lodash";
|
|
16
16
|
import "@radix-ui/react-alert-dialog";
|
|
17
|
+
import "./_commonjsHelpers-10dfc225.js";
|
|
18
|
+
import "@radix-ui/react-scroll-area";
|
|
19
|
+
import "react-dom";
|
|
20
|
+
import "@floating-ui/react-dom";
|
|
17
21
|
import "i18next";
|
|
18
22
|
import "react-i18next";
|
|
19
23
|
import "flagged";
|
|
@@ -29,8 +33,8 @@ import "@react-hookz/web";
|
|
|
29
33
|
import "@chaibuilder/blocks";
|
|
30
34
|
import "lucide-react";
|
|
31
35
|
import "sonner";
|
|
32
|
-
const
|
|
33
|
-
const s = {}, t = h(), o = r.uuid === i.homepage,
|
|
36
|
+
const X = ({ pageData: r, projectData: i }) => {
|
|
37
|
+
const s = {}, t = h(), o = r.uuid === i.homepage, m = () => {
|
|
34
38
|
t.mutate(r, {
|
|
35
39
|
onSuccess: () => {
|
|
36
40
|
s({ uuid: i.homepage, slug: "/home" });
|
|
@@ -42,11 +46,11 @@ const O = ({ pageData: r, projectData: i }) => {
|
|
|
42
46
|
"div",
|
|
43
47
|
{
|
|
44
48
|
className: `flex h-full items-center justify-center rounded-md border px-2 py-2 font-medium hover:bg-red-400 hover:text-white ${o ? "cursor-not-allowed border-red-200 text-red-200" : "cursor-pointer border-red-400 text-red-400"}`,
|
|
45
|
-
children: /* @__PURE__ */ e.jsx(
|
|
49
|
+
children: /* @__PURE__ */ e.jsx(x, {})
|
|
46
50
|
}
|
|
47
51
|
) }),
|
|
48
|
-
/* @__PURE__ */ e.jsxs(
|
|
49
|
-
/* @__PURE__ */ e.jsxs(
|
|
52
|
+
/* @__PURE__ */ e.jsxs(p, { children: [
|
|
53
|
+
/* @__PURE__ */ e.jsxs(a, { children: [
|
|
50
54
|
"Are you sure you want to delete ",
|
|
51
55
|
/* @__PURE__ */ e.jsx("i", { className: "text-red-500", children: r.name }),
|
|
52
56
|
" page?"
|
|
@@ -54,11 +58,11 @@ const O = ({ pageData: r, projectData: i }) => {
|
|
|
54
58
|
/* @__PURE__ */ e.jsx(c, { children: "This action cannot be undone. This will permanently delete your page." }),
|
|
55
59
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center justify-end gap-x-3", children: [
|
|
56
60
|
/* @__PURE__ */ e.jsx(u, { disabled: t.isPending, children: "Cancel" }),
|
|
57
|
-
/* @__PURE__ */ e.jsx(
|
|
61
|
+
/* @__PURE__ */ e.jsx(l, { variant: "destructive", onClick: m, disabled: t.isPending, children: "Yes, Delete" })
|
|
58
62
|
] })
|
|
59
63
|
] })
|
|
60
64
|
] });
|
|
61
65
|
};
|
|
62
66
|
export {
|
|
63
|
-
|
|
67
|
+
X as default
|
|
64
68
|
};
|
|
@@ -2,7 +2,7 @@ import { j as u } from "./jsx-runtime-944c88e2.js";
|
|
|
2
2
|
import x from "@rjsf/core";
|
|
3
3
|
import $ from "@rjsf/validator-ajv8";
|
|
4
4
|
import { includes as h, get as a, set as F, first as P } from "lodash";
|
|
5
|
-
import { R as b, I as E, a as O, L as S } from "./link-
|
|
5
|
+
import { R as b, I as E, a as O, L as S } from "./link-2af5de8b.js";
|
|
6
6
|
const d = (i, l = "") => {
|
|
7
7
|
switch (i.type) {
|
|
8
8
|
case "singular":
|
|
@@ -66,7 +66,7 @@ const d = (i, l = "") => {
|
|
|
66
66
|
default:
|
|
67
67
|
return {};
|
|
68
68
|
}
|
|
69
|
-
},
|
|
69
|
+
}, g = ({
|
|
70
70
|
title: i,
|
|
71
71
|
properties: l = {},
|
|
72
72
|
formData: c,
|
|
@@ -121,5 +121,5 @@ const d = (i, l = "") => {
|
|
|
121
121
|
] });
|
|
122
122
|
};
|
|
123
123
|
export {
|
|
124
|
-
|
|
124
|
+
g as F
|
|
125
125
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const f=require("./jsx-runtime-5c3ac4f7.cjs"),y=require("@rjsf/core"),E=require("@rjsf/validator-ajv8"),i=require("lodash"),d=require("./link-
|
|
1
|
+
"use strict";const f=require("./jsx-runtime-5c3ac4f7.cjs"),y=require("@rjsf/core"),E=require("@rjsf/validator-ajv8"),i=require("lodash"),d=require("./link-86ac8848.cjs"),h=(n,c="")=>{switch(n.type){case"singular":return n.uiSchema;case"model":const{properties:p}=n,u={};return Object.keys(p).forEach(r=>{const e=p[r];if(i.includes(["slot","styles"],e.type))return;const o=i.get(e,"i18n",!1)?`${r}-${c}`:r;u[o]=h(e,c)}),u;case"list":const{itemProperties:m}=n,l={items:{}};return Object.keys(m).forEach(r=>{const e=m[r];if(i.includes(["slot","styles"],e.type))return;const o=i.get(e,"i18n",!1)?`${r}-${c}`:r;l.items[o]=h(e,c)}),l;default:return{}}},x=(n,c="")=>{switch(n.type){case"singular":return n.schema;case"model":const{properties:p,title:u}=n,m={title:u,type:"object",properties:{}};return Object.keys(p).forEach(o=>{const t=p[o];if(i.includes(["slot","styles"],t.type))return;const s=i.get(t,"i18n",!1)?`${o}-${c}`:o;m.properties[s]=x(t,c)}),m;case"list":const{itemProperties:l,title:r}=n,e={title:r,type:"array",items:{type:"object",properties:{}}};return Object.keys(l).forEach(o=>{const t=l[o];if(i.includes(["slot","styles"],t.type))return;const s=i.get(t,"i18n",!1)?`${o}-${c}`:o;e.items.properties[s]=x(t,c),i.set(e.items,"title",i.get(t,"itemTitle",`${r} item`))}),e;default:return{}}},$=({title:n,properties:c={},formData:p,onChange:u,disabled:m=!1,activeLang:l=""})=>{const r={type:"object",properties:{}},e={};Object.keys(c).forEach(t=>{const s=c[t];if(i.includes(["slot","styles"],s.type))return;const a=i.get(s,"i18n",!1)?`${t}-${l}`:t;r.properties[a]=x(s,l),e[a]=h(s,l)});const o=({...t},s)=>{const a=s==null?void 0:s.replace("root.","").split("/").pop();if(!s||!a)return;const j=i.first(a.split("."));s&&j&&u({...t},j)};return f.jsxRuntimeExports.jsxs(f.jsxRuntimeExports.Fragment,{children:[n&&f.jsxRuntimeExports.jsx("h1",{className:"px-1 text-sm font-semibold underline",children:n}),f.jsxRuntimeExports.jsx("div",{className:"-mx-3",children:f.jsxRuntimeExports.jsx(y,{widgets:{richtext:d.RichTextEditorField,icon:d.IconPickerField,image:d.ImagePickerField},fields:{link:d.LinkField},idSeparator:".",autoComplete:"off",omitExtraData:!0,liveOmit:!0,liveValidate:!0,uiSchema:e,schema:r,formData:p,validator:E,onChange:o,disabled:m})})]})};exports.Form=$;
|