@chaibuilder/sdk 1.1.3 → 1.1.5
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-P3qHuE5J.cjs → AddBlocks-EBCXennD.cjs} +1 -1
- package/dist/{AddBlocks-imyQSCbI.js → AddBlocks-a2VUDT5t.js} +20 -20
- package/dist/{BrandingOptions-_2XBEPab.cjs → BrandingOptions-kjj0QNch.cjs} +1 -1
- package/dist/{BrandingOptions-tSNtQ1Kv.js → BrandingOptions-uU1nNRzP.js} +1 -1
- package/dist/CanvasArea-4ZhFTrfG.js +1426 -0
- package/dist/CanvasArea-_xT5Zr6U.cjs +59 -0
- package/dist/{CurrentPage--5VHTFmg.cjs → CurrentPage-NYsAabGv.cjs} +1 -1
- package/dist/{CurrentPage-ZjBcAU3o.js → CurrentPage-UcUSZ81g.js} +5 -5
- package/dist/{Layers-Qv1k4eqT.cjs → Layers-4Qo1Flcd.cjs} +1 -1
- package/dist/{Layers-RfOxPx_V.js → Layers-gtpXghW3.js} +15 -15
- package/dist/{MarkAsGlobalBlock-p_wvHkQZ.cjs → MarkAsGlobalBlock-E_w2sPGA.cjs} +1 -1
- package/dist/{MarkAsGlobalBlock-aqik3ouc.js → MarkAsGlobalBlock-vWOYzFKX.js} +1 -1
- package/dist/{PagesPanel-pQjl_qzS.cjs → PagesPanel-ebglMsO0.cjs} +1 -1
- package/dist/{PagesPanel-yOrHqpUR.js → PagesPanel-wkwMGcgn.js} +3 -3
- package/dist/{ProjectPanel-64NTjmau.js → ProjectPanel-HMY5d4po.js} +5 -5
- package/dist/{ProjectPanel-U4uQPSn8.cjs → ProjectPanel-PTTgh8uA.cjs} +1 -1
- package/dist/{Settings-2b17z_GV.js → Settings-Qxq1frcT.js} +294 -303
- package/dist/Settings-WK2g5ehT.cjs +1 -0
- package/dist/{SidePanels-gNBjhSWG.js → SidePanels-E-K69HnO.js} +9 -9
- package/dist/{SidePanels-auE-bKNc.cjs → SidePanels-fXTJlJLG.cjs} +1 -1
- package/dist/{Topbar-ZjAs5fDc.cjs → Topbar-b9Vt5SLF.cjs} +1 -1
- package/dist/{Topbar-Jc74a6oE.js → Topbar-oZ167R8x.js} +5 -5
- package/dist/UnsplashImages-dMdYJI8B.cjs +1 -0
- package/dist/{UnsplashImages-_PxEYx5c.js → UnsplashImages-yN_5vrmM.js} +5 -5
- package/dist/UploadImages-2h2MuCU2.cjs +1 -0
- package/dist/{UploadImages-zzSgKmP9.js → UploadImages-yVZs49iB.js} +29 -29
- package/dist/{add-page-modal-OukBwf5E.js → add-page-modal-f-4vS_9F.js} +3 -3
- package/dist/{add-page-modal-BREwIMPz.cjs → add-page-modal-vheD0KJZ.cjs} +1 -1
- package/dist/{confirm-alert-mzlwOW9w.cjs → confirm-alert-4bi7bxtP.cjs} +1 -1
- package/dist/{confirm-alert-2JxcNf3T.js → confirm-alert-iNzeta1I.js} +1 -1
- package/dist/core.cjs +1 -1
- package/dist/core.d.ts +0 -25
- package/dist/core.js +51 -55
- package/dist/{delete-page-modal-UWn_sHLC.cjs → delete-page-modal-Ex2OsWt4.cjs} +1 -1
- package/dist/{delete-page-modal-RZXdqvje.js → delete-page-modal-TmPs3b_D.js} +2 -2
- package/dist/{form-TQ7vwDYO.js → form-dmyeQkyn.js} +1 -1
- package/dist/{form-bSW-Pkw9.cjs → form-wY4tsyip.cjs} +1 -1
- package/dist/index-U_pW4Tkc.cjs +1 -0
- package/dist/{index-ORFlyrBx.js → index-bKgIzodL.js} +874 -878
- package/dist/{index-yo8mH0u8.cjs → index-ghpTTOME.cjs} +2 -2
- package/dist/{index-CMHxUxre.js → index-rz6hkGcq.js} +4 -4
- package/dist/{page-viewer-rPTxX-Lu.cjs → page-viewer-nVNwY5Ht.cjs} +1 -1
- package/dist/{page-viewer-PZRWwKP6.js → page-viewer-xLhBfvgr.js} +3 -3
- package/dist/{project-general-setting-FVlRHFpF.cjs → project-general-setting-8wv-2jG9.cjs} +1 -1
- package/dist/{project-general-setting-UzPhnhWp.js → project-general-setting-uCeWGv95.js} +3 -3
- package/dist/{project-seo-setting-cERASO9j.cjs → project-seo-setting-57XXrUTn.cjs} +1 -1
- package/dist/{project-seo-setting-k0HlefUD.js → project-seo-setting-dRUW-Zmp.js} +2 -2
- package/dist/{single-page-detail-Ftozh79X.cjs → single-page-detail-bGBYvzQx.cjs} +1 -1
- package/dist/{single-page-detail-Jb-S30JL.js → single-page-detail-kNdE5nsi.js} +4 -4
- package/dist/studio.cjs +1 -1
- package/dist/studio.js +2 -2
- package/dist/ui.cjs +1 -1
- package/dist/ui.js +41 -41
- package/dist/{useAddBlockByDrop-UA_Iw_4l.js → useAddBlockByDrop-LM3owe-j.js} +1 -1
- package/dist/{useAddBlockByDrop-DPV32UHP.cjs → useAddBlockByDrop-qOKe8QVt.cjs} +1 -1
- package/package.json +1 -1
- package/dist/CanvasArea-E0Mu1Cwe.cjs +0 -58
- package/dist/CanvasArea-K9fOlyJl.js +0 -1419
- package/dist/Settings-4XckYyzK.cjs +0 -1
- package/dist/UnsplashImages-nXceZLmd.cjs +0 -1
- package/dist/UploadImages-tcQb5NZu.cjs +0 -1
- package/dist/index-zkc4SQCu.cjs +0 -1
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { j as e } from "./jsx-runtime-NV737rRe.js";
|
|
2
|
-
import { useState as
|
|
2
|
+
import { useState as a, useEffect as w } from "react";
|
|
3
3
|
import { isEmpty as g, map as b } from "lodash";
|
|
4
4
|
import { GearIcon as C, UploadIcon as U, Cross1Icon as k } from "@radix-ui/react-icons";
|
|
5
5
|
import { atom as F, useAtom as E } from "jotai";
|
|
6
|
-
import { i as j,
|
|
6
|
+
import { i as j, bo as A } from "./index-bKgIzodL.js";
|
|
7
7
|
import "./MODIFIERS-MLfpKQY1.js";
|
|
8
8
|
import "@radix-ui/react-toggle";
|
|
9
9
|
import "class-variance-authority";
|
|
@@ -36,36 +36,36 @@ import "redux-undo";
|
|
|
36
36
|
import "@chaibuilder/runtime";
|
|
37
37
|
import "@react-hookz/web";
|
|
38
38
|
import "react-i18next";
|
|
39
|
-
const R = F([]), he = ({ isModalView:
|
|
40
|
-
const v = j("uploadMediaCallback", () => ""),
|
|
39
|
+
const R = F([]), he = ({ isModalView: s, onSelect: i }) => {
|
|
40
|
+
const v = j("uploadMediaCallback", () => ""), c = j("fetchMediaCallback", () => []), [r, n] = E(R), [o, p] = a(!1), [u, x] = a(!1), [m, d] = a(), [f, y] = a("");
|
|
41
41
|
w(() => {
|
|
42
42
|
(async () => {
|
|
43
43
|
x(!0);
|
|
44
|
-
const t = await
|
|
45
|
-
|
|
44
|
+
const t = await c();
|
|
45
|
+
n(t || []), x(!1);
|
|
46
46
|
})();
|
|
47
|
-
}, [
|
|
47
|
+
}, []);
|
|
48
48
|
const N = (t) => {
|
|
49
|
-
var
|
|
50
|
-
t && ((h = (
|
|
49
|
+
var l, h;
|
|
50
|
+
t && ((h = (l = t == null ? void 0 : t.target) == null ? void 0 : l.files) == null ? void 0 : h.length) > 0 && d(t.target.files[0]);
|
|
51
51
|
}, I = async () => {
|
|
52
52
|
p(!0);
|
|
53
53
|
try {
|
|
54
|
-
const { url: t } = await v(
|
|
55
|
-
|
|
56
|
-
const
|
|
57
|
-
|
|
54
|
+
const { url: t } = await v(m);
|
|
55
|
+
i(t), d(void 0);
|
|
56
|
+
const l = await c();
|
|
57
|
+
n(l);
|
|
58
58
|
} catch (t) {
|
|
59
|
-
|
|
59
|
+
n([]), y((t == null ? void 0 : t.message) || "Something went wrong.");
|
|
60
60
|
}
|
|
61
61
|
p(!1);
|
|
62
62
|
};
|
|
63
63
|
return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
64
|
-
|
|
64
|
+
m ? /* @__PURE__ */ e.jsxs("div", { className: "relative flex w-full flex-col items-center justify-center rounded-md border bg-slate-50 p-2 px-1", children: [
|
|
65
65
|
/* @__PURE__ */ e.jsx(
|
|
66
66
|
"img",
|
|
67
67
|
{
|
|
68
|
-
src: URL.createObjectURL(
|
|
68
|
+
src: URL.createObjectURL(m),
|
|
69
69
|
alt: "",
|
|
70
70
|
className: "h-auto w-full max-w-sm rounded-md max-h-96 object-contain"
|
|
71
71
|
}
|
|
@@ -77,21 +77,21 @@ const R = F([]), he = ({ isModalView: r, onSelect: n }) => {
|
|
|
77
77
|
{
|
|
78
78
|
type: "button",
|
|
79
79
|
onClick: I,
|
|
80
|
-
disabled:
|
|
80
|
+
disabled: o,
|
|
81
81
|
className: "flex items-center rounded-full bg-blue-500 px-3 py-1 text-sm text-white hover:bg-blue-600 hover:text-white",
|
|
82
82
|
children: [
|
|
83
|
-
|
|
83
|
+
o ? /* @__PURE__ */ e.jsx(C, { className: "animate-spin" }) : /* @__PURE__ */ e.jsx(U, { className: "animate-bounce" }),
|
|
84
84
|
" ",
|
|
85
|
-
|
|
85
|
+
o ? "Uploading..." : "Upload"
|
|
86
86
|
]
|
|
87
87
|
}
|
|
88
88
|
),
|
|
89
|
-
!
|
|
89
|
+
!o && /* @__PURE__ */ e.jsxs(
|
|
90
90
|
"button",
|
|
91
91
|
{
|
|
92
92
|
type: "button",
|
|
93
93
|
className: "flex items-center rounded-full border border-gray-300 px-3 py-1 text-sm hover:bg-gray-200",
|
|
94
|
-
onClick: () =>
|
|
94
|
+
onClick: () => d(void 0),
|
|
95
95
|
children: [
|
|
96
96
|
/* @__PURE__ */ e.jsx(k, {}),
|
|
97
97
|
" Cancel"
|
|
@@ -99,26 +99,26 @@ const R = F([]), he = ({ isModalView: r, onSelect: n }) => {
|
|
|
99
99
|
}
|
|
100
100
|
)
|
|
101
101
|
] })
|
|
102
|
-
] }) : /* @__PURE__ */ e.jsxs("label", { htmlFor:
|
|
102
|
+
] }) : /* @__PURE__ */ e.jsxs("label", { htmlFor: s ? "upload-in-modal" : "upload-in-panel", children: [
|
|
103
103
|
/* @__PURE__ */ e.jsxs("div", { className: "flex w-full cursor-pointer flex-col items-center justify-center rounded-md border border-dashed border-blue-900 bg-gray-200 py-8 hover:bg-blue-50", children: [
|
|
104
104
|
/* @__PURE__ */ e.jsx("div", { className: "text-3xl", children: "+" }),
|
|
105
105
|
/* @__PURE__ */ e.jsx("div", { children: "Click to choose file" })
|
|
106
106
|
] }),
|
|
107
|
-
/* @__PURE__ */ e.jsx("input", { type: "file", id:
|
|
107
|
+
/* @__PURE__ */ e.jsx("input", { type: "file", id: s ? "upload-in-modal" : "upload-in-panel", hidden: !0, onChange: N })
|
|
108
108
|
] }),
|
|
109
|
-
/* @__PURE__ */ e.jsxs(A, { className: `-mx-2 flex h-full flex-col pb-8 pt-2 ${
|
|
110
|
-
g(
|
|
111
|
-
g(
|
|
112
|
-
|
|
109
|
+
/* @__PURE__ */ e.jsxs(A, { className: `-mx-2 flex h-full flex-col pb-8 pt-2 ${s ? "px-2" : ""} pt-2`, children: [
|
|
110
|
+
g(r) && u && /* @__PURE__ */ e.jsx("div", { className: "flex flex-col items-center justify-center py-6", children: /* @__PURE__ */ e.jsx("div", { className: "animate-pulse font-medium", children: "Fetching..." }) }),
|
|
111
|
+
g(r) && !u && /* @__PURE__ */ e.jsx("div", { className: "flex flex-col items-center justify-center py-6", children: /* @__PURE__ */ e.jsx("div", { className: "font-medium", children: "No Images" }) }),
|
|
112
|
+
s ? /* @__PURE__ */ e.jsx("div", { className: "h-full columns-5 py-2", children: b(r, (t) => /* @__PURE__ */ e.jsx("div", { role: "button", tabIndex: 0, className: "my-1 flex", onClick: () => i(t.url), children: /* @__PURE__ */ e.jsx("div", { className: "relative overflow-hidden rounded-md bg-cover bg-no-repeat", children: /* @__PURE__ */ e.jsx(
|
|
113
113
|
"img",
|
|
114
114
|
{
|
|
115
115
|
className: "h-auto flex-1 cursor-pointer rounded-md transition duration-300 ease-in-out hover:scale-105",
|
|
116
116
|
alt: t.name,
|
|
117
117
|
src: t.thumbUrl
|
|
118
118
|
}
|
|
119
|
-
) }) }, t.id)) }) : b(
|
|
119
|
+
) }) }, t.id)) }) : b(r, (t) => (
|
|
120
120
|
// TODO: Drag and Drop Image to Canvas from Here use `pic.url` for image quality
|
|
121
|
-
/* @__PURE__ */ e.jsx("div", { role: "button", tabIndex: 0, className: "px-2 py-1", onClick: () =>
|
|
121
|
+
/* @__PURE__ */ e.jsx("div", { role: "button", tabIndex: 0, className: "px-2 py-1", onClick: () => i(t.url), children: /* @__PURE__ */ e.jsx("div", { className: "relative overflow-hidden rounded-md bg-cover bg-no-repeat", children: /* @__PURE__ */ e.jsx(
|
|
122
122
|
"img",
|
|
123
123
|
{
|
|
124
124
|
className: "h-auto w-full cursor-pointer transition duration-300 ease-in-out hover:scale-105",
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { j as t } from "./jsx-runtime-NV737rRe.js";
|
|
2
2
|
import { useState as c } from "react";
|
|
3
3
|
import { kebabCase as j } from "lodash";
|
|
4
|
-
import {
|
|
4
|
+
import { al as b, B as u, ak as C, ba as A } from "./index-bKgIzodL.js";
|
|
5
5
|
import { u as g } from "./controls-G0puEH71.js";
|
|
6
|
-
import { F as D } from "./form-
|
|
7
|
-
import { g as N } from "./index-
|
|
6
|
+
import { F as D } from "./form-dmyeQkyn.js";
|
|
7
|
+
import { g as N } from "./index-rz6hkGcq.js";
|
|
8
8
|
import "./MODIFIERS-MLfpKQY1.js";
|
|
9
9
|
import "@radix-ui/react-toggle";
|
|
10
10
|
import "class-variance-authority";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-WUGKV8jN.cjs"),x=require("react"),P=require("lodash"),t=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-WUGKV8jN.cjs"),x=require("react"),P=require("lodash"),t=require("./index-U_pW4Tkc.cjs"),g=require("./controls-aHZq-q4b.cjs"),R=require("./form-wY4tsyip.cjs"),f=require("./index-ghpTTOME.cjs");require("./MODIFIERS-WFzDQfiT.cjs");require("@radix-ui/react-toggle");require("class-variance-authority");require("./utils-It2K33fU.cjs");require("clsx");require("tailwind-merge");require("@radix-ui/react-switch");require("@radix-ui/react-slot");require("@radix-ui/react-accordion");require("@radix-ui/react-icons");require("@radix-ui/react-alert-dialog");require("@radix-ui/react-dialog");require("@radix-ui/react-label");require("@radix-ui/react-scroll-area");require("@radix-ui/react-tabs");require("@radix-ui/react-tooltip");require("@radix-ui/react-popover");require("@radix-ui/react-menubar");require("@radix-ui/react-hover-card");require("@radix-ui/react-select");require("@radix-ui/react-dropdown-menu");require("@radix-ui/react-separator");require("@radix-ui/react-toast");require("cmdk");require("@radix-ui/react-context-menu");require("react-icons-picker");require("react-dom");require("react-quill");require("jotai");require("flat-to-nested");require("redux-undo");require("@chaibuilder/runtime");require("@react-hookz/web");require("react-i18next");require("@rjsf/core");require("@rjsf/validator-ajv8");require("i18next");require("@floating-ui/react-dom");require("react-textarea-autosize");require("flagged");require("react-dnd");require("@minoru/react-dnd-treeview");require("./lib.cjs");require("himalaya");require("./functions-KMQYiBHf.cjs");require("@mhsdesign/jit-browser-tailwindcss");require("@bobthered/tailwindcss-palette-generator");require("@tailwindcss/forms");require("@tailwindcss/typography");require("@tailwindcss/aspect-ratio");require("@tailwindcss/line-clamp");require("./tailwind-config-OxLD7oFU.cjs");require("react-hotkeys-hook");require("sonner");require("lucide-react");const b=({closeModal:i})=>{var q,l;const u=f.useAddPage(),[r,m]=x.useState({name:"",slug:"",blocks:[],type:"STATIC",seoData:{},template:""}),p=()=>{u.mutate(r,{onSuccess:()=>i()})},j=({formData:n},s)=>{m(o=>{var d,c;const a={[s]:n[s]};return s==="name"?a.slug=P.kebabCase((d=n[s])==null?void 0:d.replace(/\d/g,"")):s==="slug"&&(a.slug=(c=n[s])==null?void 0:c.replace(/\d/g,"").replace(/\s+/g,"").replace("--","-").replace("__","_")),{...o,...a}})},h={name:g.u({title:"Page Name",default:r.name}),slug:g.u({title:"Page Slug",default:r.slug})};return e.jsxRuntimeExports.jsxs(t.DialogContent,{children:[e.jsxRuntimeExports.jsx("div",{className:"px-1 font-bold",children:"Add Page"}),e.jsxRuntimeExports.jsx(R.Form,{formData:r,properties:h,onChange:j,disabled:u.isPending}),e.jsxRuntimeExports.jsx("div",{className:"flex items-center justify-end",children:e.jsxRuntimeExports.jsx(t.Button,{type:"submit",disabled:!r.name||!r.slug||((q=r.name)==null?void 0:q.length)<2||((l=r.slug)==null?void 0:l.length)<2||u.isPending,onClick:p,children:"Add Page"})})]})},C=()=>{const[i,u]=x.useState(!1);return e.jsxRuntimeExports.jsxs(t.Dialog,{open:i,onOpenChange:()=>u(!i),children:[e.jsxRuntimeExports.jsx(t.DialogTrigger,{asChild:!0,children:e.jsxRuntimeExports.jsx(t.Button,{size:"sm",variant:"link",className:"text-blue-500",onClick:()=>u(!i),children:"+ New Page"})}),i&&e.jsxRuntimeExports.jsx(b,{closeModal:()=>u(!i)})]})};exports.default=C;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-WUGKV8jN.cjs"),r=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-WUGKV8jN.cjs"),r=require("./index-U_pW4Tkc.cjs");require("./MODIFIERS-WFzDQfiT.cjs");require("react");require("@radix-ui/react-toggle");require("class-variance-authority");require("./utils-It2K33fU.cjs");require("lodash");require("clsx");require("tailwind-merge");require("@radix-ui/react-switch");require("@radix-ui/react-slot");require("@radix-ui/react-accordion");require("@radix-ui/react-icons");require("@radix-ui/react-alert-dialog");require("@radix-ui/react-dialog");require("@radix-ui/react-label");require("@radix-ui/react-scroll-area");require("@radix-ui/react-tabs");require("@radix-ui/react-tooltip");require("@radix-ui/react-popover");require("@radix-ui/react-menubar");require("@radix-ui/react-hover-card");require("@radix-ui/react-select");require("@radix-ui/react-dropdown-menu");require("@radix-ui/react-separator");require("@radix-ui/react-toast");require("cmdk");require("@radix-ui/react-context-menu");require("react-icons-picker");require("react-dom");require("react-quill");require("jotai");require("flat-to-nested");require("redux-undo");require("@chaibuilder/runtime");require("@react-hookz/web");require("react-i18next");const x=({open:t,onCancel:q=()=>{},onConfirm:s,title:n,description:i,disabled:u,cancelText:l="Discard",confirmText:o="Save"})=>e.jsxRuntimeExports.jsx(r.AlertDialog,{open:t,children:e.jsxRuntimeExports.jsxs(r.AlertDialogContent,{children:[e.jsxRuntimeExports.jsx(r.AlertDialogTitle,{children:n}),i&&e.jsxRuntimeExports.jsx(r.AlertDialogDescription,{children:i}),e.jsxRuntimeExports.jsxs("div",{className:"flex items-center justify-end gap-x-3",children:[e.jsxRuntimeExports.jsx(r.AlertDialogCancel,{disabled:u,onClick:q,children:l}),e.jsxRuntimeExports.jsx(r.Button,{variant:"default",onClick:s,disabled:u,children:o})]})]})});exports.default=x;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { j as i } from "./jsx-runtime-NV737rRe.js";
|
|
2
|
-
import { D as a, F as n, H as c, I as x, K as j, B as d } from "./index-
|
|
2
|
+
import { D as a, F as n, H as c, I as x, K as j, B as d } from "./index-bKgIzodL.js";
|
|
3
3
|
import "./MODIFIERS-MLfpKQY1.js";
|
|
4
4
|
import "react";
|
|
5
5
|
import "@radix-ui/react-toggle";
|
package/dist/core.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("./index-ghpTTOME.cjs"),e=require("./index-U_pW4Tkc.cjs"),r=require("react-i18next");require("i18next");require("./jsx-runtime-WUGKV8jN.cjs");require("./MODIFIERS-WFzDQfiT.cjs");require("react");require("clsx");require("react-dom");require("@radix-ui/react-scroll-area");require("@floating-ui/react-dom");require("react-textarea-autosize");require("jotai");require("flagged");require("react-dnd");require("lodash");require("@minoru/react-dnd-treeview");require("./lib.cjs");require("./utils-It2K33fU.cjs");require("tailwind-merge");require("himalaya");require("./functions-KMQYiBHf.cjs");require("@mhsdesign/jit-browser-tailwindcss");require("@bobthered/tailwindcss-palette-generator");require("@tailwindcss/forms");require("@tailwindcss/typography");require("@tailwindcss/aspect-ratio");require("@tailwindcss/line-clamp");require("./tailwind-config-OxLD7oFU.cjs");require("react-hotkeys-hook");require("@chaibuilder/runtime");require("@radix-ui/react-icons");require("sonner");require("lucide-react");require("@radix-ui/react-toggle");require("class-variance-authority");require("@radix-ui/react-switch");require("@radix-ui/react-slot");require("@radix-ui/react-accordion");require("@radix-ui/react-alert-dialog");require("@radix-ui/react-dialog");require("@radix-ui/react-label");require("@radix-ui/react-tabs");require("@radix-ui/react-tooltip");require("@radix-ui/react-popover");require("@radix-ui/react-menubar");require("@radix-ui/react-hover-card");require("@radix-ui/react-select");require("@radix-ui/react-dropdown-menu");require("@radix-ui/react-separator");require("@radix-ui/react-toast");require("cmdk");require("@radix-ui/react-context-menu");require("react-icons-picker");require("react-quill");require("flat-to-nested");require("redux-undo");require("@react-hookz/web");exports.ChaiBuilderEditor=s.ChaiBuilderEditor;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.useBrandingOptions=e.useBrandingOptions;exports.useBuilderProp=e.useBuilderProp;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;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.useMarkAsGlobalBlock=e.useMarkAsGlobalBlock;exports.useMoveBlocks=e.useMoveBlocks;exports.usePasteBlocks=e.usePasteBlocks;exports.usePreviewMode=e.usePreviewMode;exports.useProject=e.useProject;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;Object.defineProperty(exports,"useTranslation",{enumerable:!0,get:()=>r.useTranslation});
|
package/dist/core.d.ts
CHANGED
|
@@ -15,11 +15,6 @@ declare interface Block {
|
|
|
15
15
|
[key: string]: any;
|
|
16
16
|
}
|
|
17
17
|
|
|
18
|
-
declare interface BlockLangContent {
|
|
19
|
-
content: string;
|
|
20
|
-
propKey: string;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
18
|
declare type CanvasHistory = {
|
|
24
19
|
redoCount: number;
|
|
25
20
|
undoCount: number;
|
|
@@ -141,8 +136,6 @@ declare interface UiLibrary {
|
|
|
141
136
|
uuid: string;
|
|
142
137
|
}
|
|
143
138
|
|
|
144
|
-
export declare const useActiveLanguage: () => [string, (args_0: string | ((prev: string) => string)) => void];
|
|
145
|
-
|
|
146
139
|
export declare const useActiveModal: () => any;
|
|
147
140
|
|
|
148
141
|
/**
|
|
@@ -164,13 +157,6 @@ export declare const useAddClassesToBlocks: () => Function;
|
|
|
164
157
|
*/
|
|
165
158
|
export declare const useAllBlocks: () => ChaiBlock[];
|
|
166
159
|
|
|
167
|
-
/**
|
|
168
|
-
* Returns the block content for the active language
|
|
169
|
-
* @param prop
|
|
170
|
-
* @param block
|
|
171
|
-
*/
|
|
172
|
-
export declare const useBlockContentByLanguage: (prop: string, block: ChaiBlock) => BlockLangContent;
|
|
173
|
-
|
|
174
160
|
/**
|
|
175
161
|
* Wrapper around useAtom
|
|
176
162
|
*/
|
|
@@ -245,11 +231,6 @@ export declare const useHiddenBlockIds: () => (string[] | ((args_0: string[] | (
|
|
|
245
231
|
*/
|
|
246
232
|
export declare const useHighlightBlockId: () => [string, Function];
|
|
247
233
|
|
|
248
|
-
/**
|
|
249
|
-
* Returns the list of languages
|
|
250
|
-
*/
|
|
251
|
-
export declare const useLanguages: () => [string[], (args_0: string[] | ((prev: string[]) => string[])) => void];
|
|
252
|
-
|
|
253
234
|
export declare const useMarkAsGlobalBlock: () => (blockId: string, name: string) => Promise<void>;
|
|
254
235
|
|
|
255
236
|
export declare const useMoveBlocks: () => {};
|
|
@@ -264,12 +245,6 @@ export declare const usePasteBlocks: () => {
|
|
|
264
245
|
*/
|
|
265
246
|
export declare const usePreviewMode: () => [boolean, Function];
|
|
266
247
|
|
|
267
|
-
/**
|
|
268
|
-
* Returns the primary language
|
|
269
|
-
* @returns [primaryLanguage, isPrimaryLanguage] tuple where isPrimaryLanguage is true if the primary language is the active language
|
|
270
|
-
*/
|
|
271
|
-
export declare const usePrimaryLanguage: () => [string, (args_0: string | ((prev: string) => string)) => void];
|
|
272
|
-
|
|
273
248
|
export declare const useProject: () => {
|
|
274
249
|
currentProject: unknown;
|
|
275
250
|
createProject: () => void;
|
package/dist/core.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { k as
|
|
2
|
-
import {
|
|
3
|
-
import { useTranslation as
|
|
1
|
+
import { k as as } from "./index-rz6hkGcq.js";
|
|
2
|
+
import { N as rs, af as is, O as ps, ah as ms, P as ls, ae as us, x as cs, i as ds, y as Bs, Q as ks, p as ns, R as Ss, U as Cs, k as Ps, V as vs, n as gs, W as ys, X as As, m as Ms, L as hs, Y as Ds, Z as Is, _ as Rs, $ as fs, a0 as xs, o as Ts, h as Us, a1 as bs, M as js, l as ws, a3 as Hs, ag as Os, a6 as Fs, a5 as Gs, a4 as Ls, j as Ws, ad as Zs, ai as Es, aj as Ns, w as Qs, a7 as Vs, a9 as Xs, a2 as Ys, aa as _s, a8 as $s, ab as qs, ac as zs } from "./index-bKgIzodL.js";
|
|
3
|
+
import { useTranslation as Ks } from "react-i18next";
|
|
4
4
|
import "i18next";
|
|
5
5
|
import "./jsx-runtime-NV737rRe.js";
|
|
6
6
|
import "./MODIFIERS-MLfpKQY1.js";
|
|
@@ -57,57 +57,53 @@ import "flat-to-nested";
|
|
|
57
57
|
import "redux-undo";
|
|
58
58
|
import "@react-hookz/web";
|
|
59
59
|
export {
|
|
60
|
-
|
|
61
|
-
rs as
|
|
62
|
-
is as
|
|
63
|
-
ps as
|
|
64
|
-
ms as
|
|
65
|
-
us as useAddBlockParent,
|
|
60
|
+
as as ChaiBuilderEditor,
|
|
61
|
+
rs as useActiveModal,
|
|
62
|
+
is as useActivePanel,
|
|
63
|
+
ps as useAddBlock,
|
|
64
|
+
ms as useAddBlockParent,
|
|
66
65
|
ls as useAddClassesToBlocks,
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
vs as
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
Rs as
|
|
85
|
-
fs as
|
|
86
|
-
xs as
|
|
87
|
-
Ts as
|
|
88
|
-
Us as
|
|
89
|
-
bs as
|
|
90
|
-
js as
|
|
91
|
-
ws as
|
|
92
|
-
Hs as
|
|
93
|
-
Os as
|
|
94
|
-
Fs as
|
|
95
|
-
Gs as
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
Ks as useUILibraryBlocks,
|
|
111
|
-
se as useUpdateBlocksProps,
|
|
112
|
-
ee as useUpdateBlocksPropsRealtime
|
|
66
|
+
us as useAllBlocks,
|
|
67
|
+
cs as useBrandingOptions,
|
|
68
|
+
ds as useBuilderProp,
|
|
69
|
+
Bs as useBuilderReset,
|
|
70
|
+
ks as useBuildingBlocks,
|
|
71
|
+
ns as useCanvasHistory,
|
|
72
|
+
Ss as useCanvasWidth,
|
|
73
|
+
Cs as useCanvasZoom,
|
|
74
|
+
Ps as useCopyBlockIds,
|
|
75
|
+
vs as useCurrentPage,
|
|
76
|
+
gs as useCutBlockIds,
|
|
77
|
+
ys as useDarkMode,
|
|
78
|
+
As as useDeveloperPreviewMode,
|
|
79
|
+
Ms as useDuplicateBlocks,
|
|
80
|
+
hs as useFeatureSupport,
|
|
81
|
+
Ds as useGetPageData,
|
|
82
|
+
Is as useHiddenBlockIds,
|
|
83
|
+
Rs as useHighlightBlockId,
|
|
84
|
+
fs as useMarkAsGlobalBlock,
|
|
85
|
+
xs as useMoveBlocks,
|
|
86
|
+
Ts as usePasteBlocks,
|
|
87
|
+
Us as usePreviewMode,
|
|
88
|
+
bs as useProject,
|
|
89
|
+
js as useReadOnlyMode,
|
|
90
|
+
ws as useRemoveBlocks,
|
|
91
|
+
Hs as useRemoveClassesFromBlocks,
|
|
92
|
+
Os as useSavePage,
|
|
93
|
+
Fs as useSelectedBlock,
|
|
94
|
+
Gs as useSelectedBlockAllClasses,
|
|
95
|
+
Ls as useSelectedBlockCurrentClasses,
|
|
96
|
+
Ws as useSelectedBlockIds,
|
|
97
|
+
Zs as useSelectedBlocksDisplayChild,
|
|
98
|
+
Es as useSelectedBreakpoints,
|
|
99
|
+
Ns as useSelectedStylingBlocks,
|
|
100
|
+
Qs as useSetAllBlocks,
|
|
101
|
+
Vs as useStylingBreakpoint,
|
|
102
|
+
Xs as useStylingState,
|
|
103
|
+
Ks as useTranslation,
|
|
104
|
+
Ys as useTranslations,
|
|
105
|
+
_s as useTreeData,
|
|
106
|
+
$s as useUILibraryBlocks,
|
|
107
|
+
qs as useUpdateBlocksProps,
|
|
108
|
+
zs as useUpdateBlocksPropsRealtime
|
|
113
109
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-WUGKV8jN.cjs"),r=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-WUGKV8jN.cjs"),r=require("./index-U_pW4Tkc.cjs"),q=require("./index-ghpTTOME.cjs"),l=require("@radix-ui/react-icons");require("./MODIFIERS-WFzDQfiT.cjs");require("react");require("@radix-ui/react-toggle");require("class-variance-authority");require("./utils-It2K33fU.cjs");require("lodash");require("clsx");require("tailwind-merge");require("@radix-ui/react-switch");require("@radix-ui/react-slot");require("@radix-ui/react-accordion");require("@radix-ui/react-alert-dialog");require("@radix-ui/react-dialog");require("@radix-ui/react-label");require("@radix-ui/react-scroll-area");require("@radix-ui/react-tabs");require("@radix-ui/react-tooltip");require("@radix-ui/react-popover");require("@radix-ui/react-menubar");require("@radix-ui/react-hover-card");require("@radix-ui/react-select");require("@radix-ui/react-dropdown-menu");require("@radix-ui/react-separator");require("@radix-ui/react-toast");require("cmdk");require("@radix-ui/react-context-menu");require("react-icons-picker");require("react-dom");require("react-quill");require("jotai");require("flat-to-nested");require("redux-undo");require("@chaibuilder/runtime");require("@react-hookz/web");require("react-i18next");require("i18next");require("@floating-ui/react-dom");require("react-textarea-autosize");require("flagged");require("react-dnd");require("@minoru/react-dnd-treeview");require("./lib.cjs");require("himalaya");require("./functions-KMQYiBHf.cjs");require("@mhsdesign/jit-browser-tailwindcss");require("@bobthered/tailwindcss-palette-generator");require("@tailwindcss/forms");require("@tailwindcss/typography");require("@tailwindcss/aspect-ratio");require("@tailwindcss/line-clamp");require("./tailwind-config-OxLD7oFU.cjs");require("react-hotkeys-hook");require("sonner");require("lucide-react");const d=({pageData:i,projectData:t})=>{const n={},u=q.useDeletePage(),s=i.uuid===t.homepage,o=()=>{u.mutate(i,{onSuccess:()=>{n({uuid:t.homepage,slug:"/home"})}})};return e.jsxRuntimeExports.jsxs(r.AlertDialog,{children:[e.jsxRuntimeExports.jsx(r.AlertDialogTrigger,{disabled:s,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 ${s?"cursor-not-allowed border-red-200 text-red-200":"cursor-pointer border-red-400 text-red-400"}`,children:e.jsxRuntimeExports.jsx(l.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:u.isPending,children:"Cancel"}),e.jsxRuntimeExports.jsx(r.Button,{variant:"destructive",onClick:o,disabled:u.isPending,children:"Yes, Delete"})]})]})]})};exports.default=d;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { j as r } from "./jsx-runtime-NV737rRe.js";
|
|
2
|
-
import { D as s, E as l, F as n, H as d, I as a, K as c, B as u } from "./index-
|
|
3
|
-
import { j as x } from "./index-
|
|
2
|
+
import { D as s, E as l, F as n, H as d, I as a, K as c, B as u } from "./index-bKgIzodL.js";
|
|
3
|
+
import { j as x } from "./index-rz6hkGcq.js";
|
|
4
4
|
import { TrashIcon as h } from "@radix-ui/react-icons";
|
|
5
5
|
import "./MODIFIERS-MLfpKQY1.js";
|
|
6
6
|
import "react";
|
|
@@ -2,7 +2,7 @@ import { j as u } from "./jsx-runtime-NV737rRe.js";
|
|
|
2
2
|
import b from "@rjsf/core";
|
|
3
3
|
import x from "@rjsf/validator-ajv8";
|
|
4
4
|
import { includes as h, get as a, set as $, first as F } from "lodash";
|
|
5
|
-
import {
|
|
5
|
+
import { bd as P, be as E, bf as O, bg as S } from "./index-bKgIzodL.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-WUGKV8jN.cjs"),y=require("@rjsf/core"),E=require("@rjsf/validator-ajv8"),i=require("lodash"),d=require("./index-
|
|
1
|
+
"use strict";const f=require("./jsx-runtime-WUGKV8jN.cjs"),y=require("@rjsf/core"),E=require("@rjsf/validator-ajv8"),i=require("lodash"),d=require("./index-U_pW4Tkc.cjs"),h=(c,n="")=>{switch(c.type){case"singular":return c.uiSchema;case"model":const{properties:p}=c,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}-${n}`:r;u[o]=h(e,n)}),u;case"list":const{itemProperties:m}=c,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}-${n}`:r;l.items[o]=h(e,n)}),l;default:return{}}},x=(c,n="")=>{switch(c.type){case"singular":return c.schema;case"model":const{properties:p,title:u}=c,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}-${n}`:o;m.properties[s]=x(t,n)}),m;case"list":const{itemProperties:l,title:r}=c,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}-${n}`:o;e.items.properties[s]=x(t,n),i.set(e.items,"title",i.get(t,"itemTitle",`${r} item`))}),e;default:return{}}},$=({title:c,properties:n={},formData:p,onChange:u,disabled:m=!1,activeLang:l=""})=>{const r={type:"object",properties:{}},e={};Object.keys(n).forEach(t=>{const s=n[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:[c&&f.jsxRuntimeExports.jsx("h1",{className:"px-1 text-sm font-semibold underline",children:c}),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=$;
|