@chaibuilder/sdk 1.2.3 → 1.2.4
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/{CanvasArea-lBmLPSqX.js → CanvasArea-WS9dnLyS.js} +7 -5
- package/dist/{CanvasArea-yDkGNbGZ.cjs → CanvasArea-wpskKN1H.cjs} +1 -1
- package/dist/CurrentPage-X9fCVXgY.cjs +1 -0
- package/dist/{CurrentPage-B6hjYNzI.js → CurrentPage-iaGHiR2B.js} +10 -8
- package/dist/Layers-EGhZWmvD.cjs +1 -0
- package/dist/{Layers-IDVZrVlL.js → Layers-V15IDskJ.js} +5 -3
- package/dist/{PagesPanel-Q_uSjTW1.cjs → PagesPanel-Vla7HZkm.cjs} +1 -1
- package/dist/{PagesPanel-j_Fpa3sl.js → PagesPanel-wfyKhLJ5.js} +5 -3
- package/dist/ProjectPanel-YLS4oOuU.cjs +1 -0
- package/dist/{ProjectPanel-vjK_4VSG.js → ProjectPanel-aiKhpNvr.js} +12 -10
- package/dist/{Settings-V07siWr-.js → Settings-JjYbPJrt.js} +4 -3
- package/dist/Settings-rnHnjhZ4.cjs +1 -0
- package/dist/{SidePanels-0B2_uHyb.js → SidePanels-XABN8kD3.js} +30 -28
- package/dist/SidePanels-vcWHxatg.cjs +1 -0
- package/dist/{add-page-modal-dQ4vsAOV.js → add-page-modal-Gwhl6J1F.js} +4 -3
- package/dist/{add-page-modal-ELiuGxwH.cjs → add-page-modal-o5dy8nwt.cjs} +1 -1
- package/dist/core.cjs +1 -1
- package/dist/core.js +54 -52
- package/dist/{delete-page-modal-gViErMeG.cjs → delete-page-modal-IO_9ZCm4.cjs} +1 -1
- package/dist/{delete-page-modal-gWvIto0r.js → delete-page-modal-xGWX8RHn.js} +18 -16
- package/dist/{index-aHQmo59Y.js → index-7mV_OcXd.js} +33 -32
- package/dist/{index-99vxkDWJ.cjs → index-mUPP605-.cjs} +2 -2
- package/dist/{page-viewer-YU2ON-TT.js → page-viewer-Xl1i1V3J.js} +6 -4
- package/dist/page-viewer-pJFW_LaN.cjs +1 -0
- package/dist/{project-general-setting-m6C3KOQm.js → project-general-setting-8H1Rka2z.js} +4 -3
- package/dist/{project-general-setting-vDHVl9_W.cjs → project-general-setting-lNEoQK1n.cjs} +1 -1
- package/dist/render.d.ts +1 -1
- package/dist/{single-page-detail-GxzBw_k6.js → single-page-detail-1hsqXV8c.js} +5 -4
- package/dist/single-page-detail-VKqGt-s1.cjs +1 -0
- package/dist/studio.cjs +1 -1
- package/dist/studio.js +4 -2
- package/dist/web-blocks.cjs +2 -2
- package/dist/web-blocks.js +1 -1
- package/package.json +1 -1
- package/dist/CurrentPage-0VSOB-Hb.cjs +0 -1
- package/dist/Layers-y2knU0bT.cjs +0 -1
- package/dist/ProjectPanel-qEwohLIY.cjs +0 -1
- package/dist/Settings-ky8B7ncY.cjs +0 -1
- package/dist/SidePanels-Rf7LJBOR.cjs +0 -1
- package/dist/page-viewer-vW3LE2Lt.cjs +0 -1
- package/dist/single-page-detail-MFwjDf9d.cjs +0 -1
|
@@ -3,11 +3,11 @@ import { PlusIcon as V, Half2Icon as H } from "@radix-ui/react-icons";
|
|
|
3
3
|
import x, { useState as p, useEffect as I, useMemo as L, lazy as y, Suspense as j } from "react";
|
|
4
4
|
import { useAtom as E } from "jotai";
|
|
5
5
|
import { filter as g, map as P, isNull as M, find as F, isEmpty as O, each as R, get as J } from "lodash-es";
|
|
6
|
-
import { ak as U, al as $, am as q, an as G, ao as Y, D as Z, E as Q, F as W, G as X, H as ee, I as se, J as re, K as ae, ap as
|
|
6
|
+
import { ak as U, al as $, am as q, an as G, ao as Y, D as Z, E as Q, F as W, G as X, H as ee, I as se, J as re, K as ae, ap as ie, s as le, t as te, aq as oe, ar as ne, as as ce, at as de, au as S, i as k, av as me, B as b, S as T, aw as xe, ax as pe, ay as _, az as z } from "./index-_OgCuSUz.js";
|
|
7
7
|
import { ListTreeIcon as C, DatabaseIcon as ue } from "lucide-react";
|
|
8
8
|
import { getChaiDataProviders as he } from "@chaibuilder/runtime";
|
|
9
9
|
import { useTranslation as A } from "react-i18next";
|
|
10
|
-
import { E as fe } from "./index-
|
|
10
|
+
import { E as fe } from "./index-7mV_OcXd.js";
|
|
11
11
|
import { c as ve } from "./Functions-7jnEwJyw.js";
|
|
12
12
|
import "./_commonjsHelpers-UyOWmZb0.js";
|
|
13
13
|
import "@radix-ui/react-toggle";
|
|
@@ -51,8 +51,10 @@ import "sonner";
|
|
|
51
51
|
import "./html-to-json-yjzEN9OX.js";
|
|
52
52
|
import "himalaya";
|
|
53
53
|
import "lodash";
|
|
54
|
+
import "./web-blocks.js";
|
|
55
|
+
import "./controls-XPXGHKht.js";
|
|
54
56
|
const je = x.lazy(() => import("react-json-view")), ge = ({ provider: r, onClose: t }) => {
|
|
55
|
-
const { t: a } = A(), [
|
|
57
|
+
const { t: a } = A(), [l, u] = p(null);
|
|
56
58
|
return I(() => {
|
|
57
59
|
r && (r.mockFn ? r.mockFn : r.dataFn)().then((o) => u(o));
|
|
58
60
|
}, [r]), r ? /* @__PURE__ */ e.jsx(U, { onOpenChange: (n) => n ? "" : t(), defaultOpen: !0, children: /* @__PURE__ */ e.jsxs($, { children: [
|
|
@@ -72,7 +74,7 @@ const je = x.lazy(() => import("react-json-view")), ge = ({ provider: r, onClose
|
|
|
72
74
|
enableClipboard: !1,
|
|
73
75
|
displayObjectSize: !1,
|
|
74
76
|
displayDataTypes: !1,
|
|
75
|
-
src:
|
|
77
|
+
src: l
|
|
76
78
|
}
|
|
77
79
|
) })
|
|
78
80
|
] }) }) : null;
|
|
@@ -82,32 +84,32 @@ function be({
|
|
|
82
84
|
name: t,
|
|
83
85
|
onRemove: a
|
|
84
86
|
}) {
|
|
85
|
-
const { t:
|
|
87
|
+
const { t: l } = A();
|
|
86
88
|
return /* @__PURE__ */ e.jsxs(Z, { children: [
|
|
87
89
|
/* @__PURE__ */ e.jsx(Q, { asChild: !0, children: r }),
|
|
88
90
|
/* @__PURE__ */ e.jsxs(W, { children: [
|
|
89
91
|
/* @__PURE__ */ e.jsxs(X, { children: [
|
|
90
|
-
/* @__PURE__ */ e.jsx(ee, { children:
|
|
91
|
-
/* @__PURE__ */ e.jsx(se, { children:
|
|
92
|
+
/* @__PURE__ */ e.jsx(ee, { children: l("remove_provider_confirmation", { name: t }) }),
|
|
93
|
+
/* @__PURE__ */ e.jsx(se, { children: l("remove_provider_warning") })
|
|
92
94
|
] }),
|
|
93
95
|
/* @__PURE__ */ e.jsxs(re, { children: [
|
|
94
|
-
/* @__PURE__ */ e.jsx(ae, { children:
|
|
95
|
-
/* @__PURE__ */ e.jsx(
|
|
96
|
+
/* @__PURE__ */ e.jsx(ae, { children: l("cancel") }),
|
|
97
|
+
/* @__PURE__ */ e.jsx(ie, { onClick: a, className: "bg-red-600 hover:bg-red-700", children: l("remove") })
|
|
96
98
|
] })
|
|
97
99
|
] })
|
|
98
100
|
] });
|
|
99
101
|
}
|
|
100
102
|
const ye = () => {
|
|
101
|
-
const { t: r } = A(), t = L(() => he(), []), [a,
|
|
103
|
+
const { t: r } = A(), t = L(() => he(), []), [a, l] = le(), [, u] = E(te), [n, o] = p(
|
|
102
104
|
g(t, (s) => P(a, "providerKey").includes(s.providerKey))
|
|
103
105
|
), [w, f] = p(""), [c, v] = p(null), N = g(
|
|
104
106
|
t.map((s) => P(n, "providerKey").includes(s.providerKey) ? null : { value: s.providerKey, label: s.name }),
|
|
105
107
|
(s) => !M(s)
|
|
106
|
-
),
|
|
108
|
+
), i = (s) => {
|
|
107
109
|
const m = F(t, { providerKey: s });
|
|
108
|
-
o((d) => [...d, m]),
|
|
110
|
+
o((d) => [...d, m]), l((d) => [...d, { providerKey: m.providerKey, args: {} }]), f(""), u("UNSAVED");
|
|
109
111
|
}, h = (s) => {
|
|
110
|
-
o((m) => g(m, (d) => d.providerKey !== s.providerKey)),
|
|
112
|
+
o((m) => g(m, (d) => d.providerKey !== s.providerKey)), l((m) => g(m, (d) => d.providerKey !== s.providerKey)), u("UNSAVED");
|
|
111
113
|
}, B = (s) => v(s);
|
|
112
114
|
return O(t) ? /* @__PURE__ */ e.jsx("div", { children: /* @__PURE__ */ e.jsxs("p", { className: "text-gray-500 mb-1.5 text-xs p-4", children: [
|
|
113
115
|
r("no_data_providers"),
|
|
@@ -116,7 +118,7 @@ const ye = () => {
|
|
|
116
118
|
] }) }) : /* @__PURE__ */ e.jsxs("div", { className: "px-1", children: [
|
|
117
119
|
/* @__PURE__ */ e.jsx("br", {}),
|
|
118
120
|
/* @__PURE__ */ e.jsx("label", { children: /* @__PURE__ */ e.jsx("p", { className: "text-gray-500 mb-1.5 text-xs", children: r("add_data_providers") }) }),
|
|
119
|
-
/* @__PURE__ */ e.jsx("div", { className: "flex items-center space-x-1", children: /* @__PURE__ */ e.jsxs(oe, { value: w, onValueChange: (s) =>
|
|
121
|
+
/* @__PURE__ */ e.jsx("div", { className: "flex items-center space-x-1", children: /* @__PURE__ */ e.jsxs(oe, { value: w, onValueChange: (s) => i(s), children: [
|
|
120
122
|
/* @__PURE__ */ e.jsx(ne, { className: "w-full", children: /* @__PURE__ */ e.jsx(ce, { placeholder: r("select_provider") }) }),
|
|
121
123
|
/* @__PURE__ */ e.jsxs(de, { children: [
|
|
122
124
|
/* @__PURE__ */ e.jsx(S, { value: "", children: r("choose") }),
|
|
@@ -200,26 +202,26 @@ const ye = () => {
|
|
|
200
202
|
/* @__PURE__ */ e.jsx(ge, { onClose: () => v(null), provider: c })
|
|
201
203
|
] })
|
|
202
204
|
] });
|
|
203
|
-
}, we = y(() => import("./AddBlocks-gbfzju1d.js")), D = y(() => import("./Layers-
|
|
205
|
+
}, we = y(() => import("./AddBlocks-gbfzju1d.js")), D = y(() => import("./Layers-V15IDskJ.js")), Ne = y(() => import("./BrandingOptions-mZXO7thQ.js")), ke = y(() => import("./index-_OgCuSUz.js").then((r) => r.cw));
|
|
204
206
|
let K = null;
|
|
205
|
-
const
|
|
206
|
-
const r = k("sideBarComponents.top", []), t = k("sideBarComponents.bottom", []), [a,
|
|
207
|
+
const Ds = () => {
|
|
208
|
+
const r = k("sideBarComponents.top", []), t = k("sideBarComponents.bottom", []), [a, l] = E(me), [u, n] = p(a), [o, w] = p(null), f = {
|
|
207
209
|
"add-blocks": we,
|
|
208
210
|
layers: D,
|
|
209
211
|
"branding-options": Ne,
|
|
210
212
|
images: ke
|
|
211
213
|
};
|
|
212
|
-
R(r, ({ name:
|
|
213
|
-
f[
|
|
214
|
+
R(r, ({ name: i, panel: h }) => {
|
|
215
|
+
f[i] = h;
|
|
214
216
|
});
|
|
215
|
-
const c = (
|
|
216
|
-
clearTimeout(K), a !== "layers" &&
|
|
217
|
+
const c = (i) => {
|
|
218
|
+
clearTimeout(K), a !== "layers" && i === "layers" ? K = setTimeout(() => l("layers"), 500) : n(i), l(i);
|
|
217
219
|
}, v = k("dataBindingSupport", !1);
|
|
218
220
|
function N() {
|
|
219
|
-
const
|
|
221
|
+
const i = setTimeout(() => {
|
|
220
222
|
o && (c("layers"), clearTimeout(o));
|
|
221
223
|
}, 500);
|
|
222
|
-
w(
|
|
224
|
+
w(i);
|
|
223
225
|
}
|
|
224
226
|
return /* @__PURE__ */ e.jsxs("div", { className: "relative flex ", children: [
|
|
225
227
|
a !== "layers" ? /* @__PURE__ */ e.jsx(
|
|
@@ -262,20 +264,20 @@ const ks = () => {
|
|
|
262
264
|
}
|
|
263
265
|
),
|
|
264
266
|
x.Children.toArray(
|
|
265
|
-
r.map(({ name:
|
|
267
|
+
r.map(({ name: i, icon: h }) => /* @__PURE__ */ e.jsx(j, { fallback: /* @__PURE__ */ e.jsx(T, { className: "h-10" }), children: /* @__PURE__ */ e.jsx(
|
|
266
268
|
b,
|
|
267
269
|
{
|
|
268
|
-
onClick: () => c(
|
|
270
|
+
onClick: () => c(i),
|
|
269
271
|
size: "sm",
|
|
270
272
|
className: "w-10",
|
|
271
|
-
variant: a ===
|
|
273
|
+
variant: a === i ? "default" : "outline",
|
|
272
274
|
children: /* @__PURE__ */ e.jsx(h, {})
|
|
273
275
|
}
|
|
274
276
|
) }))
|
|
275
277
|
)
|
|
276
278
|
] }),
|
|
277
279
|
/* @__PURE__ */ e.jsx("div", { className: "relative z-[100] flex w-14 flex-col items-center space-y-2", children: x.Children.toArray(
|
|
278
|
-
t.map((
|
|
280
|
+
t.map((i) => /* @__PURE__ */ e.jsx(j, { fallback: /* @__PURE__ */ e.jsx(T, { className: "h-10" }), children: /* @__PURE__ */ e.jsx(i, {}) }))
|
|
279
281
|
) })
|
|
280
282
|
] }),
|
|
281
283
|
/* @__PURE__ */ e.jsx(
|
|
@@ -340,5 +342,5 @@ const ks = () => {
|
|
|
340
342
|
] });
|
|
341
343
|
};
|
|
342
344
|
export {
|
|
343
|
-
|
|
345
|
+
Ds as default
|
|
344
346
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var S=Object.create;var q=Object.defineProperty;var P=Object.getOwnPropertyDescriptor;var T=Object.getOwnPropertyNames;var D=Object.getPrototypeOf,A=Object.prototype.hasOwnProperty;var z=(r,o,i,l)=>{if(o&&typeof o=="object"||typeof o=="function")for(let x of T(o))!A.call(r,x)&&x!==i&&q(r,x,{get:()=>o[x],enumerable:!(l=P(o,x))||l.enumerable});return r};var _=(r,o,i)=>(i=r!=null?S(D(r)):{},z(o||!r||!r.__esModule?q(i,"default",{value:r,enumerable:!0}):i,r));Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-Z_BpKhVy.cjs"),w=require("@radix-ui/react-icons"),n=require("react"),k=require("jotai"),u=require("lodash-es"),s=require("./index-IIJ_o44s.cjs"),E=require("lucide-react"),B=require("@chaibuilder/runtime"),y=require("react-i18next"),K=require("./index-mUPP605-.cjs"),I=require("./Functions-N3yhPYKY.cjs");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("@radix-ui/react-toggle");require("class-variance-authority");require("./utils-PTxFk6qT.cjs");require("./MODIFIERS-2FeVfZQ9.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-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("flat-to-nested");require("redux-undo");require("@react-hookz/web");require("i18next");require("@floating-ui/react-dom");require("react-textarea-autosize");require("flagged");require("react-dnd");require("@minoru/react-dnd-treeview");require("react-hotkeys-hook");require("sonner");require("./html-to-json-5UoswV2Q.cjs");require("himalaya");require("lodash");require("./web-blocks.cjs");require("./controls-Dy1qa8Dc.cjs");const V=n.lazy(()=>import("react-json-view")),L=({provider:r,onClose:o})=>{const{t:i}=y.useTranslation(),[l,x]=n.useState(null);return n.useEffect(()=>{r&&(r.mockFn?r.mockFn:r.dataFn)().then(c=>x(c))},[r]),r?e.jsxRuntimeExports.jsx(s.Dialog,{onOpenChange:d=>d?"":o(),defaultOpen:!0,children:e.jsxRuntimeExports.jsxs(s.DialogContent,{children:[e.jsxRuntimeExports.jsxs(s.DialogHeader,{children:[e.jsxRuntimeExports.jsxs(s.DialogTitle,{children:[i("data_provider"),": ",r.name]}),e.jsxRuntimeExports.jsx(s.DialogDescription,{children:r.description})]}),e.jsxRuntimeExports.jsx(K.ErrorBoundary,{children:e.jsxRuntimeExports.jsx(V,{style:{maxHeight:"80vh",overflowY:"auto"},name:r.providerKey,enableClipboard:!1,displayObjectSize:!1,displayDataTypes:!1,src:l})})]})}):null};function M({children:r,name:o,onRemove:i}){const{t:l}=y.useTranslation();return e.jsxRuntimeExports.jsxs(s.AlertDialog,{children:[e.jsxRuntimeExports.jsx(s.AlertDialogTrigger,{asChild:!0,children:r}),e.jsxRuntimeExports.jsxs(s.AlertDialogContent,{children:[e.jsxRuntimeExports.jsxs(s.AlertDialogHeader,{children:[e.jsxRuntimeExports.jsx(s.AlertDialogTitle,{children:l("remove_provider_confirmation",{name:o})}),e.jsxRuntimeExports.jsx(s.AlertDialogDescription,{children:l("remove_provider_warning")})]}),e.jsxRuntimeExports.jsxs(s.AlertDialogFooter,{children:[e.jsxRuntimeExports.jsx(s.AlertDialogCancel,{children:l("cancel")}),e.jsxRuntimeExports.jsx(s.AlertDialogAction,{onClick:i,className:"bg-red-600 hover:bg-red-700",children:l("remove")})]})]})]})}const F=()=>{const{t:r}=y.useTranslation(),o=n.useMemo(()=>B.getChaiDataProviders(),[]),[i,l]=s.usePageDataProviders(),[,x]=k.useAtom(s.pageSyncStateAtom),[d,c]=n.useState(u.filter(o,t=>u.map(i,"providerKey").includes(t.providerKey))),[g,v]=n.useState(""),[m,f]=n.useState(null),R=u.filter(o.map(t=>u.map(d,"providerKey").includes(t.providerKey)?null:{value:t.providerKey,label:t.name}),t=>!u.isNull(t)),a=t=>{const p=u.find(o,{providerKey:t});c(j=>[...j,p]),l(j=>[...j,{providerKey:p.providerKey,args:{}}]),v(""),x("UNSAVED")},h=t=>{c(p=>u.filter(p,j=>j.providerKey!==t.providerKey)),l(p=>u.filter(p,j=>j.providerKey!==t.providerKey)),x("UNSAVED")},C=t=>f(t);return u.isEmpty(o)?e.jsxRuntimeExports.jsx("div",{children:e.jsxRuntimeExports.jsxs("p",{className:"text-gray-500 mb-1.5 text-xs p-4",children:[r("no_data_providers"),e.jsxRuntimeExports.jsx("br",{}),e.jsxRuntimeExports.jsx("a",{className:"text-blue-500",href:"https://chaibuilder.com/docs/registering-data-providers",target:"_blank",children:r("learn_more")})]})}):e.jsxRuntimeExports.jsxs("div",{className:"px-1",children:[e.jsxRuntimeExports.jsx("br",{}),e.jsxRuntimeExports.jsx("label",{children:e.jsxRuntimeExports.jsx("p",{className:"text-gray-500 mb-1.5 text-xs",children:r("add_data_providers")})}),e.jsxRuntimeExports.jsx("div",{className:"flex items-center space-x-1",children:e.jsxRuntimeExports.jsxs(s.Select,{value:g,onValueChange:t=>a(t),children:[e.jsxRuntimeExports.jsx(s.SelectTrigger,{className:"w-full",children:e.jsxRuntimeExports.jsx(s.SelectValue,{placeholder:r("select_provider")})}),e.jsxRuntimeExports.jsxs(s.SelectContent,{children:[e.jsxRuntimeExports.jsx(s.SelectItem,{value:"",children:r("choose")}),R.map(t=>e.jsxRuntimeExports.jsx(s.SelectItem,{value:t.value,children:t.label},t.value))]})]})}),e.jsxRuntimeExports.jsx("br",{}),e.jsxRuntimeExports.jsxs("div",{className:`border-t ${d.length?"block":"hidden"}`,children:[e.jsxRuntimeExports.jsxs("p",{className:"text-gray-500 pt-4 pb-1.5 text-xs flex-1 font-medium",children:[r("page_data_providers"),":"]}),e.jsxRuntimeExports.jsx("div",{className:"space-y-2",children:d.map(t=>e.jsxRuntimeExports.jsxs("div",{className:"rounded-lg border bg-card text-card-foreground shadow-sm w-full","data-v0-t":"card",children:[e.jsxRuntimeExports.jsx("div",{className:"flex flex-col space-y-1.5 px-4 pt-4",children:e.jsxRuntimeExports.jsx("div",{className:"flex justify-between items-center",children:e.jsxRuntimeExports.jsxs("div",{children:[e.jsxRuntimeExports.jsx("h3",{className:"font-medium leading-4",children:t.name}),e.jsxRuntimeExports.jsx("p",{className:"text-xs text-gray-400 pt-1",children:t.description})]})})}),e.jsxRuntimeExports.jsxs("div",{className:"items-center p-2 py-2 flex justify-between",children:[e.jsxRuntimeExports.jsxs("button",{onClick:()=>C(t),className:"inline-flex items-center justify-center text-xs font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 underline-offset-4 hover:underline h-9 rounded-md px-3 text-blue-500",children:[e.jsxRuntimeExports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",className:"w-4 h-4 mr-2",children:[e.jsxRuntimeExports.jsx("path",{d:"M2 12s3-7 10-7 10 7 10 7-3 7-10 7-10-7-10-7Z"}),e.jsxRuntimeExports.jsx("circle",{cx:"12",cy:"12",r:"3"})]}),r("view_data")]}),e.jsxRuntimeExports.jsx(M,{onRemove:()=>h(t),name:t.name,children:e.jsxRuntimeExports.jsxs("button",{className:"inline-flex items-center justify-center text-xs font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 underline-offset-4 hover:underline h-9 rounded-md px-3 text-red-500",children:[e.jsxRuntimeExports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",className:"w-4 h-4 mr-2",children:[e.jsxRuntimeExports.jsx("path",{d:"M3 6h18"}),e.jsxRuntimeExports.jsx("path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6"}),e.jsxRuntimeExports.jsx("path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2"})]}),r("remove")]})})]})]},t.providerKey))}),e.jsxRuntimeExports.jsx(L,{onClose:()=>f(null),provider:m})]})]})},H=n.lazy(()=>Promise.resolve().then(()=>require("./AddBlocks-wuKI1ieB.cjs"))),b=n.lazy(()=>Promise.resolve().then(()=>require("./Layers-EGhZWmvD.cjs"))),O=n.lazy(()=>Promise.resolve().then(()=>require("./BrandingOptions-arKT1zCy.cjs"))),U=n.lazy(()=>Promise.resolve().then(()=>require("./index-IIJ_o44s.cjs")).then(r=>r.ImagesPanel));let N=null;const $=()=>{const r=s.useBuilderProp("sideBarComponents.top",[]),o=s.useBuilderProp("sideBarComponents.bottom",[]),[i,l]=k.useAtom(s.activePanelAtom),[x,d]=n.useState(i),[c,g]=n.useState(null),v={"add-blocks":H,layers:b,"branding-options":O,images:U};u.each(r,({name:a,panel:h})=>{v[a]=h});const m=a=>{clearTimeout(N),i!=="layers"&&a==="layers"?N=setTimeout(()=>l("layers"),500):d(a),l(a)},f=s.useBuilderProp("dataBindingSupport",!1);function R(){const a=setTimeout(()=>{c&&(m("layers"),clearTimeout(c))},500);g(a)}return e.jsxRuntimeExports.jsxs("div",{className:"relative flex ",children:[i!=="layers"?e.jsxRuntimeExports.jsx("div",{onMouseEnter:R,onClick:()=>m("layers"),className:"fixed inset-0 bg-black/20 z-[50]"}):null,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(s.Button,{onClick:()=>{m("add-blocks")},size:"sm",variant:i==="add-blocks"?"default":"outline",children:e.jsxRuntimeExports.jsx(w.PlusIcon,{className:"text-xl"})}),e.jsxRuntimeExports.jsx(s.Button,{onClick:()=>m("layers"),size:"sm",variant:i==="layers"?"default":"outline",children:e.jsxRuntimeExports.jsx(E.ListTreeIcon,{className:"w-4"})}),e.jsxRuntimeExports.jsx(s.Button,{onClick:()=>m("branding-options"),size:"sm",variant:i==="branding-options"?"default":"outline",children:e.jsxRuntimeExports.jsx(w.Half2Icon,{className:"w-4 max-w-[40px] text-xs"})}),n.Children.toArray(r.map(({name:a,icon:h})=>e.jsxRuntimeExports.jsx(n.Suspense,{fallback:e.jsxRuntimeExports.jsx(s.Skeleton,{className:"h-10"}),children:e.jsxRuntimeExports.jsx(s.Button,{onClick:()=>m(a),size:"sm",className:"w-10",variant:i===a?"default":"outline",children:e.jsxRuntimeExports.jsx(h,{})})})))]}),e.jsxRuntimeExports.jsx("div",{className:"relative z-[100] flex w-14 flex-col items-center space-y-2",children:n.Children.toArray(o.map(a=>e.jsxRuntimeExports.jsx(n.Suspense,{fallback:e.jsxRuntimeExports.jsx(s.Skeleton,{className:"h-10"}),children:e.jsxRuntimeExports.jsx(a,{})})))})]}),e.jsxRuntimeExports.jsx("div",{className:`absolute left-14 z-[50] h-full w-96 border-r bg-background duration-500 ease-in-out ${i!=="layers"?"translate-x-0":"-translate-x-full"}`,children:e.jsxRuntimeExports.jsx(n.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:I.cn("relative h-full max-h-[93%] overflow-y-auto overflow-x-hidden bg-background p-1",i==="layers"?"":"z-[100]"),onMouseEnter:()=>{c&&clearTimeout(c)},children:n.createElement(u.get(v,i,()=>e.jsxRuntimeExports.jsx("div",{})))})})}),e.jsxRuntimeExports.jsx("div",{className:"h-full w-60 border-r p-1",children:e.jsxRuntimeExports.jsx(n.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:f?e.jsxRuntimeExports.jsxs(s.Tabs,{defaultValue:"layers",className:"flex h-full w-full flex-col py-1",children:[e.jsxRuntimeExports.jsxs(s.TabsList,{className:"mx-1 h-10 grid grid-cols-2",children:[e.jsxRuntimeExports.jsxs(s.TabsTrigger,{value:"layers",children:[e.jsxRuntimeExports.jsx(E.ListTreeIcon,{className:"h-3 mr-2"})," Layers"]}),e.jsxRuntimeExports.jsxs(s.TabsTrigger,{value:"data-provider",children:[e.jsxRuntimeExports.jsx(E.DatabaseIcon,{className:"w-3 mr-2"}),"Data"]})]}),e.jsxRuntimeExports.jsx(s.TabsContent,{value:"layers",className:"no-scrollbar h-full flex-1 overflow-y-auto overflow-x-hidden",children:n.createElement(b)}),e.jsxRuntimeExports.jsx(s.TabsContent,{value:"data-provider",className:"flex-1 overflow-y-auto overflow-x-hidden",children:e.jsxRuntimeExports.jsx(F,{})})]}):e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsxs("div",{className:"flex items-center bg-gray-200 rounded-md py-1",children:[e.jsxRuntimeExports.jsx(E.ListTreeIcon,{className:"h-4 mr-2 ml-2"})," Layers"]}),e.jsxRuntimeExports.jsx("div",{className:"no-scrollbar h-full flex-1 overflow-y-auto overflow-x-hidden",children:n.createElement(b)})]})})})]})};exports.default=$;
|
|
@@ -4,7 +4,7 @@ import { kebabCase as j } from "lodash-es";
|
|
|
4
4
|
import { al as b, B as u, ak as C, b9 as A } from "./index-_OgCuSUz.js";
|
|
5
5
|
import { u as g } from "./controls-XPXGHKht.js";
|
|
6
6
|
import { F as D } from "./form-Moz_psOw.js";
|
|
7
|
-
import { g as N } from "./index-
|
|
7
|
+
import { g as N } from "./index-7mV_OcXd.js";
|
|
8
8
|
import "./_commonjsHelpers-UyOWmZb0.js";
|
|
9
9
|
import "@radix-ui/react-toggle";
|
|
10
10
|
import "class-variance-authority";
|
|
@@ -55,6 +55,7 @@ import "./html-to-json-yjzEN9OX.js";
|
|
|
55
55
|
import "himalaya";
|
|
56
56
|
import "lodash";
|
|
57
57
|
import "lucide-react";
|
|
58
|
+
import "./web-blocks.js";
|
|
58
59
|
const S = ({ closeModal: i }) => {
|
|
59
60
|
var a, s;
|
|
60
61
|
const e = N(), [o, f] = c({
|
|
@@ -95,7 +96,7 @@ const S = ({ closeModal: i }) => {
|
|
|
95
96
|
}
|
|
96
97
|
) })
|
|
97
98
|
] });
|
|
98
|
-
},
|
|
99
|
+
}, wt = () => {
|
|
99
100
|
const [i, e] = c(!1);
|
|
100
101
|
return /* @__PURE__ */ t.jsxs(C, { open: i, onOpenChange: () => e(!i), children: [
|
|
101
102
|
/* @__PURE__ */ t.jsx(A, { asChild: !0, children: /* @__PURE__ */ t.jsx(u, { size: "sm", variant: "link", className: "text-blue-500", onClick: () => e(!i), children: "+ New Page" }) }),
|
|
@@ -103,5 +104,5 @@ const S = ({ closeModal: i }) => {
|
|
|
103
104
|
] });
|
|
104
105
|
};
|
|
105
106
|
export {
|
|
106
|
-
|
|
107
|
+
wt as default
|
|
107
108
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-Z_BpKhVy.cjs"),x=require("react"),P=require("lodash-es"),t=require("./index-IIJ_o44s.cjs"),g=require("./controls-Dy1qa8Dc.cjs"),R=require("./form-lJhy9DEC.cjs"),f=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-Z_BpKhVy.cjs"),x=require("react"),P=require("lodash-es"),t=require("./index-IIJ_o44s.cjs"),g=require("./controls-Dy1qa8Dc.cjs"),R=require("./form-lJhy9DEC.cjs"),f=require("./index-mUPP605-.cjs");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("@radix-ui/react-toggle");require("class-variance-authority");require("./utils-PTxFk6qT.cjs");require("./MODIFIERS-2FeVfZQ9.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("./Functions-N3yhPYKY.cjs");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("react-hotkeys-hook");require("sonner");require("./html-to-json-5UoswV2Q.cjs");require("himalaya");require("lodash");require("lucide-react");require("./web-blocks.cjs");const b=({closeModal:i})=>{var l,q;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||((l=r.name)==null?void 0:l.length)<2||((q=r.slug)==null?void 0:q.length)<2||u.isPending,onClick:p,children:"Add Page"})})]})},E=()=>{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=E;
|
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-mUPP605-.cjs"),e=require("./index-IIJ_o44s.cjs"),r=require("react-i18next");require("i18next");require("./jsx-runtime-Z_BpKhVy.cjs");require("./_commonjsHelpers-wDK0ZLPo.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-es");require("@minoru/react-dnd-treeview");require("./Functions-N3yhPYKY.cjs");require("tailwind-merge");require("react-hotkeys-hook");require("@chaibuilder/runtime");require("@radix-ui/react-icons");require("sonner");require("./html-to-json-5UoswV2Q.cjs");require("himalaya");require("./MODIFIERS-2FeVfZQ9.cjs");require("lodash");require("lucide-react");require("./web-blocks.cjs");require("./controls-Dy1qa8Dc.cjs");require("@radix-ui/react-toggle");require("class-variance-authority");require("./utils-PTxFk6qT.cjs");require("@radix-ui/react-switch");require("@radix-ui/react-slot");require("@radix-ui/react-accordion");require("@radix-ui/react-alert-dialog");require("@radix-ui/react-dialog");require("@radix-ui/react-label");require("@radix-ui/react-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.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { k as
|
|
2
|
-
import { N as
|
|
3
|
-
import { useTranslation as
|
|
1
|
+
import { k as ss } from "./index-7mV_OcXd.js";
|
|
2
|
+
import { N as as, af as os, O as ts, ah as rs, P as is, ae as ps, x as ls, i as ms, y as us, Q as cs, p as ds, R as Bs, U as ks, k as ns, V as Ss, n as Cs, W as Ps, X as vs, m as gs, L as ys, Y as As, Z as Ms, _ as hs, $ as Ds, a0 as Is, o as Rs, h as fs, a1 as xs, M as Ts, l as Us, a3 as bs, ag as js, a6 as ws, a5 as Hs, a4 as Os, j as Fs, ad as Gs, ai as Ls, aj as Ws, w as Zs, a7 as Es, a9 as Ns, a2 as Qs, aa as Vs, a8 as Xs, ab as Ys, ac as _s } from "./index-_OgCuSUz.js";
|
|
3
|
+
import { useTranslation as qs } from "react-i18next";
|
|
4
4
|
import "i18next";
|
|
5
5
|
import "./jsx-runtime-WbnYoNE9.js";
|
|
6
6
|
import "./_commonjsHelpers-UyOWmZb0.js";
|
|
@@ -26,6 +26,8 @@ import "himalaya";
|
|
|
26
26
|
import "./MODIFIERS-RiXS5Mn1.js";
|
|
27
27
|
import "lodash";
|
|
28
28
|
import "lucide-react";
|
|
29
|
+
import "./web-blocks.js";
|
|
30
|
+
import "./controls-XPXGHKht.js";
|
|
29
31
|
import "@radix-ui/react-toggle";
|
|
30
32
|
import "class-variance-authority";
|
|
31
33
|
import "./utils-AvyFzbPC.js";
|
|
@@ -52,53 +54,53 @@ import "flat-to-nested";
|
|
|
52
54
|
import "redux-undo";
|
|
53
55
|
import "@react-hookz/web";
|
|
54
56
|
export {
|
|
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
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
57
|
+
ss as ChaiBuilderEditor,
|
|
58
|
+
as as useActiveModal,
|
|
59
|
+
os as useActivePanel,
|
|
60
|
+
ts as useAddBlock,
|
|
61
|
+
rs as useAddBlockParent,
|
|
62
|
+
is as useAddClassesToBlocks,
|
|
63
|
+
ps as useAllBlocks,
|
|
64
|
+
ls as useBrandingOptions,
|
|
65
|
+
ms as useBuilderProp,
|
|
66
|
+
us as useBuilderReset,
|
|
67
|
+
cs as useBuildingBlocks,
|
|
68
|
+
ds as useCanvasHistory,
|
|
69
|
+
Bs as useCanvasWidth,
|
|
70
|
+
ks as useCanvasZoom,
|
|
71
|
+
ns as useCopyBlockIds,
|
|
72
|
+
Ss as useCurrentPage,
|
|
73
|
+
Cs as useCutBlockIds,
|
|
74
|
+
Ps as useDarkMode,
|
|
75
|
+
vs as useDeveloperPreviewMode,
|
|
76
|
+
gs as useDuplicateBlocks,
|
|
77
|
+
ys as useFeatureSupport,
|
|
78
|
+
As as useGetPageData,
|
|
79
|
+
Ms as useHiddenBlockIds,
|
|
80
|
+
hs as useHighlightBlockId,
|
|
81
|
+
Ds as useMarkAsGlobalBlock,
|
|
82
|
+
Is as useMoveBlocks,
|
|
83
|
+
Rs as usePasteBlocks,
|
|
84
|
+
fs as usePreviewMode,
|
|
85
|
+
xs as useProject,
|
|
86
|
+
Ts as useReadOnlyMode,
|
|
87
|
+
Us as useRemoveBlocks,
|
|
88
|
+
bs as useRemoveClassesFromBlocks,
|
|
89
|
+
js as useSavePage,
|
|
90
|
+
ws as useSelectedBlock,
|
|
91
|
+
Hs as useSelectedBlockAllClasses,
|
|
92
|
+
Os as useSelectedBlockCurrentClasses,
|
|
93
|
+
Fs as useSelectedBlockIds,
|
|
94
|
+
Gs as useSelectedBlocksDisplayChild,
|
|
95
|
+
Ls as useSelectedBreakpoints,
|
|
96
|
+
Ws as useSelectedStylingBlocks,
|
|
97
|
+
Zs as useSetAllBlocks,
|
|
98
|
+
Es as useStylingBreakpoint,
|
|
99
|
+
Ns as useStylingState,
|
|
100
|
+
qs as useTranslation,
|
|
101
|
+
Qs as useTranslations,
|
|
102
|
+
Vs as useTreeData,
|
|
103
|
+
Xs as useUILibraryBlocks,
|
|
104
|
+
Ys as useUpdateBlocksProps,
|
|
105
|
+
_s as useUpdateBlocksPropsRealtime
|
|
104
106
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-Z_BpKhVy.cjs"),r=require("./index-IIJ_o44s.cjs"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-Z_BpKhVy.cjs"),r=require("./index-IIJ_o44s.cjs"),q=require("./index-mUPP605-.cjs"),l=require("@radix-ui/react-icons");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("react");require("@radix-ui/react-toggle");require("class-variance-authority");require("./utils-PTxFk6qT.cjs");require("lodash-es");require("./MODIFIERS-2FeVfZQ9.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-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("./Functions-N3yhPYKY.cjs");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("react-hotkeys-hook");require("sonner");require("./html-to-json-5UoswV2Q.cjs");require("himalaya");require("lodash");require("lucide-react");require("./web-blocks.cjs");require("./controls-Dy1qa8Dc.cjs");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
|
-
import { j as
|
|
1
|
+
import { j as r } from "./jsx-runtime-WbnYoNE9.js";
|
|
2
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-_OgCuSUz.js";
|
|
3
|
-
import { j as x } from "./index-
|
|
3
|
+
import { j as x } from "./index-7mV_OcXd.js";
|
|
4
4
|
import { TrashIcon as h } from "@radix-ui/react-icons";
|
|
5
5
|
import "./_commonjsHelpers-UyOWmZb0.js";
|
|
6
6
|
import "react";
|
|
@@ -51,36 +51,38 @@ import "./html-to-json-yjzEN9OX.js";
|
|
|
51
51
|
import "himalaya";
|
|
52
52
|
import "lodash";
|
|
53
53
|
import "lucide-react";
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
54
|
+
import "./web-blocks.js";
|
|
55
|
+
import "./controls-XPXGHKht.js";
|
|
56
|
+
const jr = ({ pageData: e, projectData: i }) => {
|
|
57
|
+
const m = {}, t = x(), o = e.uuid === i.homepage, p = () => {
|
|
58
|
+
t.mutate(e, {
|
|
57
59
|
onSuccess: () => {
|
|
58
60
|
m({ uuid: i.homepage, slug: "/home" });
|
|
59
61
|
}
|
|
60
62
|
});
|
|
61
63
|
};
|
|
62
|
-
return /* @__PURE__ */
|
|
63
|
-
/* @__PURE__ */
|
|
64
|
+
return /* @__PURE__ */ r.jsxs(s, { children: [
|
|
65
|
+
/* @__PURE__ */ r.jsx(l, { disabled: o, children: /* @__PURE__ */ r.jsx(
|
|
64
66
|
"div",
|
|
65
67
|
{
|
|
66
68
|
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"}`,
|
|
67
|
-
children: /* @__PURE__ */
|
|
69
|
+
children: /* @__PURE__ */ r.jsx(h, {})
|
|
68
70
|
}
|
|
69
71
|
) }),
|
|
70
|
-
/* @__PURE__ */
|
|
71
|
-
/* @__PURE__ */
|
|
72
|
+
/* @__PURE__ */ r.jsxs(n, { children: [
|
|
73
|
+
/* @__PURE__ */ r.jsxs(d, { children: [
|
|
72
74
|
"Are you sure you want to delete ",
|
|
73
|
-
/* @__PURE__ */
|
|
75
|
+
/* @__PURE__ */ r.jsx("i", { className: "text-red-500", children: e.name }),
|
|
74
76
|
" page?"
|
|
75
77
|
] }),
|
|
76
|
-
/* @__PURE__ */
|
|
77
|
-
/* @__PURE__ */
|
|
78
|
-
/* @__PURE__ */
|
|
79
|
-
/* @__PURE__ */
|
|
78
|
+
/* @__PURE__ */ r.jsx(a, { children: "This action cannot be undone. This will permanently delete your page." }),
|
|
79
|
+
/* @__PURE__ */ r.jsxs("div", { className: "flex items-center justify-end gap-x-3", children: [
|
|
80
|
+
/* @__PURE__ */ r.jsx(c, { disabled: t.isPending, children: "Cancel" }),
|
|
81
|
+
/* @__PURE__ */ r.jsx(u, { variant: "destructive", onClick: p, disabled: t.isPending, children: "Yes, Delete" })
|
|
80
82
|
] })
|
|
81
83
|
] })
|
|
82
84
|
] });
|
|
83
85
|
};
|
|
84
86
|
export {
|
|
85
|
-
|
|
87
|
+
jr as default
|
|
86
88
|
};
|