@chaibuilder/sdk 0.1.32 → 1.0.0
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-4f054351.cjs +3 -0
- package/dist/{AddBlocks-4b96d545.js → AddBlocks-f6836e71.js} +5 -4
- package/dist/{BrandingOptions-c91e9d44.js → BrandingOptions-33e6da26.js} +6 -5
- package/dist/BrandingOptions-cfa79ffe.cjs +1 -0
- package/dist/{CanvasArea-957f5f74.js → CanvasArea-1e5fa968.js} +42 -43
- package/dist/CanvasArea-971b3ff8.cjs +46 -0
- package/dist/{CurrentPage-fb4c55bc.js → CurrentPage-223cc3dd.js} +5 -4
- package/dist/CurrentPage-b2d12d83.cjs +1 -0
- package/dist/{ImagesPanel-3fb8087f.js → ImagesPanel-47ac13c3.js} +1 -1
- package/dist/{ImagesPanel-56ca0618.cjs → ImagesPanel-8b7a989d.cjs} +1 -1
- package/dist/Layers-860f5e42.cjs +1 -0
- package/dist/{Layers-6866cb0c.js → Layers-b2c5aa66.js} +48 -47
- package/dist/MarkAsGlobalBlock-1a3d5e53.cjs +1 -0
- package/dist/{MarkAsGlobalBlock-f28148d9.js → MarkAsGlobalBlock-9b0135aa.js} +8 -7
- package/dist/{PagesPanel-003201ca.js → PagesPanel-034efd4c.js} +8 -7
- package/dist/PagesPanel-2a80f9b2.cjs +1 -0
- package/dist/{ProjectPanel-83321040.js → ProjectPanel-3827a349.js} +7 -6
- package/dist/ProjectPanel-5deae7f1.cjs +1 -0
- package/dist/Settings-9f61cc69.cjs +1 -0
- package/dist/{Settings-ad55d8cb.js → Settings-a2d4e9c2.js} +82 -79
- package/dist/SidePanels-0d276d29.cjs +1 -0
- package/dist/{SidePanels-96bf29c6.js → SidePanels-b881185b.js} +33 -34
- package/dist/Topbar-68a0d125.cjs +1 -0
- package/dist/{Topbar-1c4964e5.js → Topbar-fda7588e.js} +38 -37
- package/dist/{UnsplashImages-fe480747.js → UnsplashImages-4edb97e7.js} +6 -5
- package/dist/UnsplashImages-98c085c2.cjs +1 -0
- package/dist/{UploadImages-b14bd152.js → UploadImages-52181c3e.js} +9 -8
- package/dist/UploadImages-61ef83ad.cjs +1 -0
- package/dist/{add-page-modal-2ef8a63c.js → add-page-modal-38af4548.js} +11 -10
- package/dist/add-page-modal-fb51b45b.cjs +1 -0
- package/dist/confirm-alert-c1fdf1e4.js +35 -0
- package/dist/confirm-alert-e1ea5110.cjs +1 -0
- package/dist/core.cjs +1 -1
- package/dist/core.d.ts +2 -1
- package/dist/core.js +56 -55
- package/dist/delete-page-modal-305c49fd.cjs +1 -0
- package/dist/{delete-page-modal-961dcc5f.js → delete-page-modal-a226ed3a.js} +18 -19
- package/dist/{form-046bcdbc.js → form-25e1af37.js} +1 -1
- package/dist/{form-2dc05f35.cjs → form-ea21db6c.cjs} +1 -1
- package/dist/{index-86352d44.cjs → index-6fc652ec.cjs} +41 -41
- package/dist/{index-370ce00c.js → index-914d197c.js} +7239 -7070
- package/dist/{link-e71b94f1.cjs → link-24679521.cjs} +1 -1
- package/dist/{link-e3a788f7.js → link-57de608a.js} +2 -2
- package/dist/{page-viewer-0c45ce74.js → page-viewer-682940be.js} +17 -16
- package/dist/page-viewer-857a82f4.cjs +1 -0
- package/dist/{project-general-setting-c5d96f79.js → project-general-setting-0fa55bb9.js} +9 -8
- package/dist/project-general-setting-280ccd16.cjs +1 -0
- package/dist/project-seo-setting-6eef8387.cjs +1 -0
- package/dist/{project-seo-setting-639e4f33.js → project-seo-setting-d81fc1e3.js} +7 -6
- package/dist/server.cjs +1 -1
- package/dist/server.d.ts +4 -2
- package/dist/server.js +27 -23
- package/dist/{single-page-detail-22e7bc3b.js → single-page-detail-8b715650.js} +11 -10
- package/dist/single-page-detail-b9c4ac1e.cjs +1 -0
- package/dist/ui.cjs +1 -1
- package/dist/ui.js +105 -106
- package/dist/useBuilderProp-21feb2da.js +296 -0
- package/dist/useBuilderProp-adacf42f.cjs +1 -0
- package/package.json +1 -1
- package/dist/AddBlocks-e4f51b58.cjs +0 -3
- package/dist/BrandingOptions-52f9691c.cjs +0 -1
- package/dist/CanvasArea-b8c26858.cjs +0 -46
- package/dist/CurrentPage-715fe809.cjs +0 -1
- package/dist/Layers-a955d0bb.cjs +0 -1
- package/dist/MarkAsGlobalBlock-cbcb3003.cjs +0 -1
- package/dist/PagesPanel-7b8f54e1.cjs +0 -1
- package/dist/ProjectPanel-6c5f2470.cjs +0 -1
- package/dist/Settings-8f07a4b7.cjs +0 -1
- package/dist/SidePanels-446b93e7.cjs +0 -1
- package/dist/Topbar-5eeea40a.cjs +0 -1
- package/dist/UnsplashImages-ef3b6388.cjs +0 -1
- package/dist/UploadImages-10439fde.cjs +0 -1
- package/dist/add-page-modal-56dc3c56.cjs +0 -1
- package/dist/alert-dialog-4ce6ed22.cjs +0 -1
- package/dist/alert-dialog-ee98f47e.js +0 -64
- package/dist/confirm-alert-4f50caa7.cjs +0 -1
- package/dist/confirm-alert-f2a47cc7.js +0 -36
- package/dist/delete-page-modal-88aeacfd.cjs +0 -1
- package/dist/page-viewer-e0d9895d.cjs +0 -1
- package/dist/project-general-setting-d4d96611.cjs +0 -1
- package/dist/project-seo-setting-6356c72f.cjs +0 -1
- package/dist/single-page-detail-36430438.cjs +0 -1
- package/dist/useBuilderProp-5e57d0c8.cjs +0 -1
- package/dist/useBuilderProp-81a14920.js +0 -238
package/dist/core.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { a5 as
|
|
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-914d197c.js";
|
|
2
|
+
import { u as Ts } from "./useBuilderProp-21feb2da.js";
|
|
3
|
+
import { useTranslation as js } from "react-i18next";
|
|
4
4
|
import "./jsx-runtime-944c88e2.js";
|
|
5
5
|
import "react";
|
|
6
6
|
import "./MODIFIERS-2f19c314.js";
|
|
@@ -24,65 +24,66 @@ import "redux-undo";
|
|
|
24
24
|
import "@react-hookz/web";
|
|
25
25
|
import "@chaibuilder/blocks";
|
|
26
26
|
import "@radix-ui/react-icons";
|
|
27
|
-
import "lucide-react";
|
|
28
27
|
import "sonner";
|
|
28
|
+
import "lucide-react";
|
|
29
|
+
import "@radix-ui/react-alert-dialog";
|
|
29
30
|
import "@radix-ui/react-slot";
|
|
30
31
|
import "class-variance-authority";
|
|
31
32
|
import "@radix-ui/react-tooltip";
|
|
32
33
|
import "@radix-ui/react-toast";
|
|
33
34
|
export {
|
|
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
|
-
|
|
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,
|
|
63
64
|
us as useMoveBlocks,
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
65
|
+
is as usePasteBlocks,
|
|
66
|
+
ls as usePreviewMode,
|
|
67
|
+
ps as usePrimaryLanguage,
|
|
68
|
+
ms as useProject,
|
|
68
69
|
cs as useReadOnlyMode,
|
|
69
70
|
ds as useRemoveBlocks,
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
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
|
|
88
89
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-5c3ac4f7.cjs"),r=require("./useBuilderProp-adacf42f.cjs"),l=require("./index-6fc652ec.cjs"),d=require("@radix-ui/react-icons");require("react");require("@radix-ui/react-alert-dialog");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("./MODIFIERS-4716c669.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-aadcbf66.cjs");require("himalaya");require("redux-undo");require("@react-hookz/web");require("@chaibuilder/blocks");require("sonner");require("lucide-react");const x=({pageData:i,projectData:s})=>{const n={},t=l.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(d.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(r.Button,{variant:"destructive",onClick:o,disabled:t.isPending,children:"Yes, Delete"})]})]})]})};exports.default=x;
|
|
@@ -1,19 +1,18 @@
|
|
|
1
1
|
import { j as e } from "./jsx-runtime-944c88e2.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { TrashIcon as x } from "@radix-ui/react-icons";
|
|
2
|
+
import { A as l, b as n, d, f as a, g as p, i as c, B as u } from "./useBuilderProp-21feb2da.js";
|
|
3
|
+
import { a4 as x } from "./index-914d197c.js";
|
|
4
|
+
import { TrashIcon as g } from "@radix-ui/react-icons";
|
|
6
5
|
import "react";
|
|
7
|
-
import "@radix-ui/react-
|
|
8
|
-
import "class-variance-authority";
|
|
6
|
+
import "@radix-ui/react-alert-dialog";
|
|
9
7
|
import "./utils-ac68b2c8.js";
|
|
10
8
|
import "clsx";
|
|
11
9
|
import "tailwind-merge";
|
|
10
|
+
import "@radix-ui/react-slot";
|
|
11
|
+
import "class-variance-authority";
|
|
12
12
|
import "@radix-ui/react-tooltip";
|
|
13
13
|
import "@radix-ui/react-toast";
|
|
14
14
|
import "jotai";
|
|
15
15
|
import "lodash";
|
|
16
|
-
import "@radix-ui/react-alert-dialog";
|
|
17
16
|
import "./MODIFIERS-2f19c314.js";
|
|
18
17
|
import "@radix-ui/react-scroll-area";
|
|
19
18
|
import "react-dom";
|
|
@@ -30,38 +29,38 @@ import "himalaya";
|
|
|
30
29
|
import "redux-undo";
|
|
31
30
|
import "@react-hookz/web";
|
|
32
31
|
import "@chaibuilder/blocks";
|
|
33
|
-
import "lucide-react";
|
|
34
32
|
import "sonner";
|
|
35
|
-
|
|
36
|
-
|
|
33
|
+
import "lucide-react";
|
|
34
|
+
const V = ({ pageData: r, projectData: i }) => {
|
|
35
|
+
const s = {}, t = x(), o = r.uuid === i.homepage, m = () => {
|
|
37
36
|
t.mutate(r, {
|
|
38
37
|
onSuccess: () => {
|
|
39
38
|
s({ uuid: i.homepage, slug: "/home" });
|
|
40
39
|
}
|
|
41
40
|
});
|
|
42
41
|
};
|
|
43
|
-
return /* @__PURE__ */ e.jsxs(
|
|
44
|
-
/* @__PURE__ */ e.jsx(
|
|
42
|
+
return /* @__PURE__ */ e.jsxs(l, { children: [
|
|
43
|
+
/* @__PURE__ */ e.jsx(n, { disabled: o, children: /* @__PURE__ */ e.jsx(
|
|
45
44
|
"div",
|
|
46
45
|
{
|
|
47
46
|
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"}`,
|
|
48
|
-
children: /* @__PURE__ */ e.jsx(
|
|
47
|
+
children: /* @__PURE__ */ e.jsx(g, {})
|
|
49
48
|
}
|
|
50
49
|
) }),
|
|
51
|
-
/* @__PURE__ */ e.jsxs(
|
|
52
|
-
/* @__PURE__ */ e.jsxs(
|
|
50
|
+
/* @__PURE__ */ e.jsxs(d, { children: [
|
|
51
|
+
/* @__PURE__ */ e.jsxs(a, { children: [
|
|
53
52
|
"Are you sure you want to delete ",
|
|
54
53
|
/* @__PURE__ */ e.jsx("i", { className: "text-red-500", children: r.name }),
|
|
55
54
|
" page?"
|
|
56
55
|
] }),
|
|
57
|
-
/* @__PURE__ */ e.jsx(
|
|
56
|
+
/* @__PURE__ */ e.jsx(p, { children: "This action cannot be undone. This will permanently delete your page." }),
|
|
58
57
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center justify-end gap-x-3", children: [
|
|
59
|
-
/* @__PURE__ */ e.jsx(
|
|
60
|
-
/* @__PURE__ */ e.jsx(
|
|
58
|
+
/* @__PURE__ */ e.jsx(c, { disabled: t.isPending, children: "Cancel" }),
|
|
59
|
+
/* @__PURE__ */ e.jsx(u, { variant: "destructive", onClick: m, disabled: t.isPending, children: "Yes, Delete" })
|
|
61
60
|
] })
|
|
62
61
|
] })
|
|
63
62
|
] });
|
|
64
63
|
};
|
|
65
64
|
export {
|
|
66
|
-
|
|
65
|
+
V as default
|
|
67
66
|
};
|
|
@@ -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-57de608a.js";
|
|
6
6
|
const d = (i, l = "") => {
|
|
7
7
|
switch (i.type) {
|
|
8
8
|
case "singular":
|
|
@@ -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-24679521.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=$;
|