@chaibuilder/sdk 0.1.1 → 0.1.3
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-0916e841.cjs +3 -0
- package/dist/AddBlocks-c195f577.js +258 -0
- package/dist/{BrandingOptions-77957074.cjs → BrandingOptions-742992b6.cjs} +1 -1
- package/dist/{BrandingOptions-86dc389a.js → BrandingOptions-766c19c6.js} +27 -27
- package/dist/{CanvasArea-29d479f2.js → CanvasArea-25800a3e.js} +19 -18
- package/dist/CanvasArea-e855c4a2.cjs +60 -0
- package/dist/Class-7d6aadbc.cjs +1 -0
- package/dist/{Class-e6b07b79.js → Class-e34b2337.js} +9 -9
- package/dist/{ImagesPanel-6595528d.js → ImagesPanel-8ccab6d9.js} +1 -1
- package/dist/{ImagesPanel-5cde797f.cjs → ImagesPanel-addb2bf9.cjs} +1 -1
- package/dist/{Layers-3a270af5.cjs → Layers-a2169d0b.cjs} +1 -1
- package/dist/{Layers-81832d92.js → Layers-f7e792f6.js} +3 -3
- package/dist/{MarkAsGlobalBlock-f2186631.cjs → MarkAsGlobalBlock-6187e6fd.cjs} +1 -1
- package/dist/{MarkAsGlobalBlock-a1b5646c.js → MarkAsGlobalBlock-6bac1842.js} +2 -2
- package/dist/PagesPanel-0827c264.js +46 -0
- package/dist/PagesPanel-5698953d.cjs +1 -0
- package/dist/ProjectPanel-a3cb7396.cjs +1 -0
- package/dist/ProjectPanel-e577029a.js +66 -0
- package/dist/{Settings-a8cea8ee.js → Settings-b214f859.js} +25 -24
- package/dist/Settings-bee21026.cjs +1 -0
- package/dist/{SidePanels-1dcabe54.js → SidePanels-03fa10e8.js} +20 -18
- package/dist/SidePanels-934159a4.cjs +1 -0
- package/dist/{Topbar-ce65bdce.js → Topbar-9bc8c9cf.js} +2 -2
- package/dist/{Topbar-00cfceeb.cjs → Topbar-c083cc2a.cjs} +1 -1
- package/dist/UnsplashImages-68492dc9.cjs +1 -0
- package/dist/{UnsplashImages-43ec34a9.js → UnsplashImages-afaa7706.js} +19 -28
- package/dist/add-page-modal-63858244.js +92 -0
- package/dist/add-page-modal-cb367c9d.cjs +1 -0
- package/dist/alert-dialog-4ce6ed22.cjs +1 -0
- package/dist/alert-dialog-ee98f47e.js +64 -0
- package/dist/confirm-alert-4f50caa7.cjs +1 -0
- package/dist/confirm-alert-f2a47cc7.js +36 -0
- package/dist/core.cjs +1 -1
- package/dist/core.d.ts +20 -12
- package/dist/core.js +53 -52
- package/dist/delete-page-modal-1e3914e3.cjs +1 -0
- package/dist/delete-page-modal-def9012d.js +64 -0
- package/dist/dropdown-menu-84b2439e.cjs +1 -0
- package/dist/dropdown-menu-ae3ed09b.js +164 -0
- package/dist/form-5d5c5c9e.js +125 -0
- package/dist/form-6eac0287.cjs +1 -0
- package/dist/{html-to-json-fecbbe16.js → html-to-json-9304dbda.js} +47 -47
- package/dist/html-to-json-9c9961da.cjs +1 -0
- package/dist/index-207f2cbf.cjs +2 -0
- package/dist/index-390f7bef.js +4749 -0
- package/dist/index-824a7bd0.js +188 -0
- package/dist/index-ebd86d7f.cjs +2 -0
- package/dist/input-42acea7e.cjs +1 -0
- package/dist/input-a0ea2bc7.js +19 -0
- package/dist/lib.cjs +1 -1
- package/dist/lib.js +3 -3
- package/dist/link-86c532b5.cjs +1 -0
- package/dist/{link-0bfd8606.js → link-f80a947d.js} +52 -68
- package/dist/mockServiceWorker.js +292 -0
- package/dist/page-viewer-41cbb548.js +88 -0
- package/dist/page-viewer-83ce2c70.cjs +1 -0
- package/dist/project-general-setting-0262fe62.js +65 -0
- package/dist/project-general-setting-2c8bed74.cjs +1 -0
- package/dist/project-seo-setting-01536592.js +67 -0
- package/dist/project-seo-setting-e3924578.cjs +1 -0
- package/dist/single-page-detail-924d57fc.js +206 -0
- package/dist/single-page-detail-cfeae896.cjs +1 -0
- package/dist/ui.cjs +1 -1
- package/dist/ui.js +124 -122
- package/dist/usePageActions-3bed2330.cjs +1 -0
- package/dist/usePageActions-f86f6f65.js +36 -0
- package/dist/useProjectActions-1de05f63.js +17 -0
- package/dist/useProjectActions-5092ed79.cjs +1 -0
- package/package.json +14 -1
- package/dist/AddBlocks-52d9b4d7.cjs +0 -3
- package/dist/AddBlocks-e047b93d.js +0 -260
- package/dist/CanvasArea-9ce217a4.cjs +0 -60
- package/dist/Class-0801d193.cjs +0 -1
- package/dist/Settings-6a3f0f70.cjs +0 -1
- package/dist/SidePanels-7fe6bebe.cjs +0 -1
- package/dist/UnsplashImages-1b2310ad.cjs +0 -1
- package/dist/dropdown-menu-a9b096f9.cjs +0 -1
- package/dist/dropdown-menu-d912a52e.js +0 -223
- package/dist/html-to-json-d8ac554d.cjs +0 -1
- package/dist/index-32d7b6e5.js +0 -2657
- package/dist/index-506fb888.cjs +0 -2
- package/dist/link-158970ee.cjs +0 -1
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { j as e } from "./jsx-runtime-944c88e2.js";
|
|
2
|
+
import { useState as c } from "react";
|
|
3
|
+
import { kebabCase as _ } from "lodash";
|
|
4
|
+
import { B as u } from "./useBuilderProp-81a14920.js";
|
|
5
|
+
import { D as b, b as C, a as A } from "./dialog-3d4e82ed.js";
|
|
6
|
+
import { SingleLineText as g } from "@chaibuilder/blocks";
|
|
7
|
+
import { F as D } from "./form-5d5c5c9e.js";
|
|
8
|
+
import { O as N } from "./index-390f7bef.js";
|
|
9
|
+
import { u as S } from "./usePageActions-f86f6f65.js";
|
|
10
|
+
import "@radix-ui/react-slot";
|
|
11
|
+
import "class-variance-authority";
|
|
12
|
+
import "./utils-ac68b2c8.js";
|
|
13
|
+
import "clsx";
|
|
14
|
+
import "tailwind-merge";
|
|
15
|
+
import "@radix-ui/react-tooltip";
|
|
16
|
+
import "@radix-ui/react-icons";
|
|
17
|
+
import "@radix-ui/react-toast";
|
|
18
|
+
import "jotai";
|
|
19
|
+
import "@radix-ui/react-dialog";
|
|
20
|
+
import "@rjsf/core";
|
|
21
|
+
import "@rjsf/validator-ajv8";
|
|
22
|
+
import "./link-f80a947d.js";
|
|
23
|
+
import "react-icons-picker";
|
|
24
|
+
import "react-dom";
|
|
25
|
+
import "./ImagesPanel-8ccab6d9.js";
|
|
26
|
+
import "./tabs-85caa1e8.js";
|
|
27
|
+
import "@radix-ui/react-tabs";
|
|
28
|
+
import "react-quill";
|
|
29
|
+
import "react-i18next";
|
|
30
|
+
import "i18next";
|
|
31
|
+
import "flagged";
|
|
32
|
+
import "react-dnd";
|
|
33
|
+
import "@minoru/react-dnd-treeview";
|
|
34
|
+
import "react-hotkeys-hook";
|
|
35
|
+
import "flat-to-nested";
|
|
36
|
+
import "./Class-e34b2337.js";
|
|
37
|
+
import "redux-undo";
|
|
38
|
+
import "@react-hookz/web";
|
|
39
|
+
import "./CONTROLS-442caee5.js";
|
|
40
|
+
import "./index-824a7bd0.js";
|
|
41
|
+
const T = ({ closeModal: o }) => {
|
|
42
|
+
var p, n;
|
|
43
|
+
const { data: i } = N(), r = S(), [t, f] = c({
|
|
44
|
+
page_name: "",
|
|
45
|
+
slug: "",
|
|
46
|
+
blocks: [],
|
|
47
|
+
type: "STATIC",
|
|
48
|
+
project: i == null ? void 0 : i.uuid,
|
|
49
|
+
seo_data: {}
|
|
50
|
+
}), x = () => {
|
|
51
|
+
r.mutate(t, {
|
|
52
|
+
onSuccess: () => o()
|
|
53
|
+
});
|
|
54
|
+
}, P = ({ formData: s }, a) => {
|
|
55
|
+
f((h) => {
|
|
56
|
+
var l, d;
|
|
57
|
+
const m = { [a]: s[a] };
|
|
58
|
+
return a === "page_name" ? m.slug = _((l = s[a]) == null ? void 0 : l.replace(/\d/g, "")) : a === "slug" && (m.slug = (d = s[a]) == null ? void 0 : d.replace(/\d/g, "").replace(/\s+/g, "").replace("--", "-").replace("__", "_")), {
|
|
59
|
+
...h,
|
|
60
|
+
...m
|
|
61
|
+
};
|
|
62
|
+
});
|
|
63
|
+
}, j = {
|
|
64
|
+
page_name: g({
|
|
65
|
+
title: "Page Name",
|
|
66
|
+
default: t.page_name
|
|
67
|
+
}),
|
|
68
|
+
slug: g({ title: "Page Slug", default: t.slug })
|
|
69
|
+
};
|
|
70
|
+
return /* @__PURE__ */ e.jsxs(A, { children: [
|
|
71
|
+
/* @__PURE__ */ e.jsx("div", { className: "px-1 font-bold", children: "Add Page" }),
|
|
72
|
+
/* @__PURE__ */ e.jsx(D, { formData: t, properties: j, onChange: P, disabled: r.isPending }),
|
|
73
|
+
/* @__PURE__ */ e.jsx("div", { className: "flex items-center justify-end", children: /* @__PURE__ */ e.jsx(
|
|
74
|
+
u,
|
|
75
|
+
{
|
|
76
|
+
type: "submit",
|
|
77
|
+
disabled: !t.page_name || !t.slug || ((p = t.page_name) == null ? void 0 : p.length) < 2 || ((n = t.slug) == null ? void 0 : n.length) < 2 || r.isPending,
|
|
78
|
+
onClick: x,
|
|
79
|
+
children: "Add Page"
|
|
80
|
+
}
|
|
81
|
+
) })
|
|
82
|
+
] });
|
|
83
|
+
}, ue = () => {
|
|
84
|
+
const [o, i] = c(!1);
|
|
85
|
+
return /* @__PURE__ */ e.jsxs(b, { open: o, onOpenChange: () => i(!o), children: [
|
|
86
|
+
/* @__PURE__ */ e.jsx(C, { children: /* @__PURE__ */ e.jsx(u, { size: "sm", variant: "link", className: "text-blue-500", onClick: () => i(!o), children: "+ New Page" }) }),
|
|
87
|
+
o && /* @__PURE__ */ e.jsx(T, { closeModal: () => i(!o) })
|
|
88
|
+
] });
|
|
89
|
+
};
|
|
90
|
+
export {
|
|
91
|
+
ue as default
|
|
92
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-5c3ac4f7.cjs"),x=require("react"),b=require("lodash"),p=require("./useBuilderProp-5e57d0c8.cjs"),o=require("./dialog-170eaad9.cjs"),q=require("@chaibuilder/blocks"),f=require("./form-6eac0287.cjs"),_=require("./index-ebd86d7f.cjs"),E=require("./usePageActions-3bed2330.cjs");require("@radix-ui/react-slot");require("class-variance-authority");require("./utils-3c452dd0.cjs");require("clsx");require("tailwind-merge");require("@radix-ui/react-tooltip");require("@radix-ui/react-icons");require("@radix-ui/react-toast");require("jotai");require("@radix-ui/react-dialog");require("@rjsf/core");require("@rjsf/validator-ajv8");require("./link-86c532b5.cjs");require("react-icons-picker");require("react-dom");require("./ImagesPanel-addb2bf9.cjs");require("./tabs-860e37aa.cjs");require("@radix-ui/react-tabs");require("react-quill");require("react-i18next");require("i18next");require("flagged");require("react-dnd");require("@minoru/react-dnd-treeview");require("react-hotkeys-hook");require("flat-to-nested");require("./Class-7d6aadbc.cjs");require("redux-undo");require("@react-hookz/web");require("./CONTROLS-031e1de3.cjs");require("./index-207f2cbf.cjs");const S=({closeModal:s})=>{var l,d;const{data:i}=_.useProject(),u=E.useAddPage(),[r,m]=x.useState({page_name:"",slug:"",blocks:[],type:"STATIC",project:i==null?void 0:i.uuid,seo_data:{}}),j=()=>{u.mutate(r,{onSuccess:()=>s()})},P=({formData:n},t)=>{m(R=>{var c,g;const a={[t]:n[t]};return t==="page_name"?a.slug=b.kebabCase((c=n[t])==null?void 0:c.replace(/\d/g,"")):t==="slug"&&(a.slug=(g=n[t])==null?void 0:g.replace(/\d/g,"").replace(/\s+/g,"").replace("--","-").replace("__","_")),{...R,...a}})},h={page_name:q.SingleLineText({title:"Page Name",default:r.page_name}),slug:q.SingleLineText({title:"Page Slug",default:r.slug})};return e.jsxRuntimeExports.jsxs(o.DialogContent,{children:[e.jsxRuntimeExports.jsx("div",{className:"px-1 font-bold",children:"Add Page"}),e.jsxRuntimeExports.jsx(f.Form,{formData:r,properties:h,onChange:P,disabled:u.isPending}),e.jsxRuntimeExports.jsx("div",{className:"flex items-center justify-end",children:e.jsxRuntimeExports.jsx(p.Button,{type:"submit",disabled:!r.page_name||!r.slug||((l=r.page_name)==null?void 0:l.length)<2||((d=r.slug)==null?void 0:d.length)<2||u.isPending,onClick:j,children:"Add Page"})})]})},A=()=>{const[s,i]=x.useState(!1);return e.jsxRuntimeExports.jsxs(o.Dialog,{open:s,onOpenChange:()=>i(!s),children:[e.jsxRuntimeExports.jsx(o.DialogTrigger,{children:e.jsxRuntimeExports.jsx(p.Button,{size:"sm",variant:"link",className:"text-blue-500",onClick:()=>i(!s),children:"+ New Page"})}),s&&e.jsxRuntimeExports.jsx(S,{closeModal:()=>i(!s)})]})};exports.default=A;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const o=require("./jsx-runtime-5c3ac4f7.cjs"),A=require("react"),N=require("@radix-ui/react-alert-dialog"),l=require("./utils-3c452dd0.cjs"),n=require("./useBuilderProp-5e57d0c8.cjs");function c(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const a in e)if(a!=="default"){const r=Object.getOwnPropertyDescriptor(e,a);Object.defineProperty(t,a,r.get?r:{enumerable:!0,get:()=>e[a]})}}return t.default=e,Object.freeze(t)}const i=c(A),s=c(N),y=s.Root,R=s.Trigger,d=({className:e,...t})=>o.jsxRuntimeExports.jsx(s.Portal,{className:l.cn(e),...t});d.displayName=s.Portal.displayName;const m=i.forwardRef(({className:e,...t},a)=>o.jsxRuntimeExports.jsx(s.Overlay,{className:l.cn("fixed inset-0 z-50 bg-background/80 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t,ref:a}));m.displayName=s.Overlay.displayName;const p=i.forwardRef(({className:e,...t},a)=>o.jsxRuntimeExports.jsxs(d,{children:[o.jsxRuntimeExports.jsx(m,{}),o.jsxRuntimeExports.jsx(s.Content,{ref:a,className:l.cn("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg md:w-full",e),...t})]}));p.displayName=s.Content.displayName;const u=({className:e,...t})=>o.jsxRuntimeExports.jsx("div",{className:l.cn("flex flex-col space-y-2 text-center sm:text-left",e),...t});u.displayName="AlertDialogHeader";const x=({className:e,...t})=>o.jsxRuntimeExports.jsx("div",{className:l.cn("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});x.displayName="AlertDialogFooter";const g=i.forwardRef(({className:e,...t},a)=>o.jsxRuntimeExports.jsx(s.Title,{ref:a,className:l.cn("text-lg font-semibold",e),...t}));g.displayName=s.Title.displayName;const f=i.forwardRef(({className:e,...t},a)=>o.jsxRuntimeExports.jsx(s.Description,{ref:a,className:l.cn("text-sm text-muted-foreground",e),...t}));f.displayName=s.Description.displayName;const D=i.forwardRef(({className:e,...t},a)=>o.jsxRuntimeExports.jsx(s.Action,{ref:a,className:l.cn(n.buttonVariants(),e),...t}));D.displayName=s.Action.displayName;const j=i.forwardRef(({className:e,...t},a)=>o.jsxRuntimeExports.jsx(s.Cancel,{ref:a,className:l.cn(n.buttonVariants({variant:"outline"}),"mt-2 sm:mt-0",e),...t}));j.displayName=s.Cancel.displayName;exports.AlertDialog=y;exports.AlertDialogAction=D;exports.AlertDialogCancel=j;exports.AlertDialogContent=p;exports.AlertDialogDescription=f;exports.AlertDialogFooter=x;exports.AlertDialogHeader=u;exports.AlertDialogTitle=g;exports.AlertDialogTrigger=R;
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { j as o } from "./jsx-runtime-944c88e2.js";
|
|
2
|
+
import * as i from "react";
|
|
3
|
+
import * as t from "@radix-ui/react-alert-dialog";
|
|
4
|
+
import { c as l } from "./utils-ac68b2c8.js";
|
|
5
|
+
import { b as r } from "./useBuilderProp-81a14920.js";
|
|
6
|
+
const D = t.Root, j = t.Trigger, d = ({ className: a, ...e }) => /* @__PURE__ */ o.jsx(t.Portal, { className: l(a), ...e });
|
|
7
|
+
d.displayName = t.Portal.displayName;
|
|
8
|
+
const n = i.forwardRef(({ className: a, ...e }, s) => /* @__PURE__ */ o.jsx(
|
|
9
|
+
t.Overlay,
|
|
10
|
+
{
|
|
11
|
+
className: l(
|
|
12
|
+
"fixed inset-0 z-50 bg-background/80 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
|
|
13
|
+
a
|
|
14
|
+
),
|
|
15
|
+
...e,
|
|
16
|
+
ref: s
|
|
17
|
+
}
|
|
18
|
+
));
|
|
19
|
+
n.displayName = t.Overlay.displayName;
|
|
20
|
+
const m = i.forwardRef(({ className: a, ...e }, s) => /* @__PURE__ */ o.jsxs(d, { children: [
|
|
21
|
+
/* @__PURE__ */ o.jsx(n, {}),
|
|
22
|
+
/* @__PURE__ */ o.jsx(
|
|
23
|
+
t.Content,
|
|
24
|
+
{
|
|
25
|
+
ref: s,
|
|
26
|
+
className: l(
|
|
27
|
+
"fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg md:w-full",
|
|
28
|
+
a
|
|
29
|
+
),
|
|
30
|
+
...e
|
|
31
|
+
}
|
|
32
|
+
)
|
|
33
|
+
] }));
|
|
34
|
+
m.displayName = t.Content.displayName;
|
|
35
|
+
const c = ({ className: a, ...e }) => /* @__PURE__ */ o.jsx("div", { className: l("flex flex-col space-y-2 text-center sm:text-left", a), ...e });
|
|
36
|
+
c.displayName = "AlertDialogHeader";
|
|
37
|
+
const p = ({ className: a, ...e }) => /* @__PURE__ */ o.jsx("div", { className: l("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2", a), ...e });
|
|
38
|
+
p.displayName = "AlertDialogFooter";
|
|
39
|
+
const f = i.forwardRef(({ className: a, ...e }, s) => /* @__PURE__ */ o.jsx(t.Title, { ref: s, className: l("text-lg font-semibold", a), ...e }));
|
|
40
|
+
f.displayName = t.Title.displayName;
|
|
41
|
+
const g = i.forwardRef(({ className: a, ...e }, s) => /* @__PURE__ */ o.jsx(t.Description, { ref: s, className: l("text-sm text-muted-foreground", a), ...e }));
|
|
42
|
+
g.displayName = t.Description.displayName;
|
|
43
|
+
const x = i.forwardRef(({ className: a, ...e }, s) => /* @__PURE__ */ o.jsx(t.Action, { ref: s, className: l(r(), a), ...e }));
|
|
44
|
+
x.displayName = t.Action.displayName;
|
|
45
|
+
const N = i.forwardRef(({ className: a, ...e }, s) => /* @__PURE__ */ o.jsx(
|
|
46
|
+
t.Cancel,
|
|
47
|
+
{
|
|
48
|
+
ref: s,
|
|
49
|
+
className: l(r({ variant: "outline" }), "mt-2 sm:mt-0", a),
|
|
50
|
+
...e
|
|
51
|
+
}
|
|
52
|
+
));
|
|
53
|
+
N.displayName = t.Cancel.displayName;
|
|
54
|
+
export {
|
|
55
|
+
D as A,
|
|
56
|
+
j as a,
|
|
57
|
+
m as b,
|
|
58
|
+
c,
|
|
59
|
+
p as d,
|
|
60
|
+
f as e,
|
|
61
|
+
g as f,
|
|
62
|
+
x as g,
|
|
63
|
+
N as h
|
|
64
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-5c3ac4f7.cjs"),c=require("./useBuilderProp-5e57d0c8.cjs"),r=require("./alert-dialog-4ce6ed22.cjs");require("react");require("@radix-ui/react-slot");require("class-variance-authority");require("./utils-3c452dd0.cjs");require("clsx");require("tailwind-merge");require("@radix-ui/react-tooltip");require("@radix-ui/react-icons");require("@radix-ui/react-toast");require("jotai");require("lodash");require("@radix-ui/react-alert-dialog");const a=({open:s,onCancel:u=()=>{},onConfirm:l,title:n,description:i,disabled:t,cancelText:o="Discard",confirmText:x="Save"})=>e.jsxRuntimeExports.jsx(r.AlertDialog,{open:s,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:t,onClick:u,children:o}),e.jsxRuntimeExports.jsx(c.Button,{variant:"default",onClick:l,disabled:t,children:x})]})]})});exports.default=a;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { j as r } from "./jsx-runtime-944c88e2.js";
|
|
2
|
+
import { B as n } from "./useBuilderProp-81a14920.js";
|
|
3
|
+
import { A as p, b as c, e as x, f as j, h as d } from "./alert-dialog-ee98f47e.js";
|
|
4
|
+
import "react";
|
|
5
|
+
import "@radix-ui/react-slot";
|
|
6
|
+
import "class-variance-authority";
|
|
7
|
+
import "./utils-ac68b2c8.js";
|
|
8
|
+
import "clsx";
|
|
9
|
+
import "tailwind-merge";
|
|
10
|
+
import "@radix-ui/react-tooltip";
|
|
11
|
+
import "@radix-ui/react-icons";
|
|
12
|
+
import "@radix-ui/react-toast";
|
|
13
|
+
import "jotai";
|
|
14
|
+
import "lodash";
|
|
15
|
+
import "@radix-ui/react-alert-dialog";
|
|
16
|
+
const T = ({
|
|
17
|
+
open: o,
|
|
18
|
+
onCancel: e = () => {
|
|
19
|
+
},
|
|
20
|
+
onConfirm: l,
|
|
21
|
+
title: s,
|
|
22
|
+
description: i,
|
|
23
|
+
disabled: t,
|
|
24
|
+
cancelText: a = "Discard",
|
|
25
|
+
confirmText: m = "Save"
|
|
26
|
+
}) => /* @__PURE__ */ r.jsx(p, { open: o, children: /* @__PURE__ */ r.jsxs(c, { children: [
|
|
27
|
+
/* @__PURE__ */ r.jsx(x, { children: s }),
|
|
28
|
+
i && /* @__PURE__ */ r.jsx(j, { children: i }),
|
|
29
|
+
/* @__PURE__ */ r.jsxs("div", { className: "flex items-center justify-end gap-x-3", children: [
|
|
30
|
+
/* @__PURE__ */ r.jsx(d, { disabled: t, onClick: e, children: a }),
|
|
31
|
+
/* @__PURE__ */ r.jsx(n, { variant: "default", onClick: l, disabled: t, children: m })
|
|
32
|
+
] })
|
|
33
|
+
] }) });
|
|
34
|
+
export {
|
|
35
|
+
T as default
|
|
36
|
+
};
|
package/dist/core.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-ebd86d7f.cjs"),s=require("./useBuilderProp-5e57d0c8.cjs"),u=require("react-i18next");require("./jsx-runtime-5c3ac4f7.cjs");require("react");require("i18next");require("flagged");require("react-dnd");require("lodash");require("@minoru/react-dnd-treeview");require("jotai");require("./utils-3c452dd0.cjs");require("clsx");require("tailwind-merge");require("react-hotkeys-hook");require("flat-to-nested");require("./Class-7d6aadbc.cjs");require("redux-undo");require("@react-hookz/web");require("@chaibuilder/blocks");require("@radix-ui/react-icons");require("./CONTROLS-031e1de3.cjs");require("@radix-ui/react-slot");require("class-variance-authority");require("@radix-ui/react-tooltip");require("@radix-ui/react-toast");exports.ChaiBuilderEditor=e.ChaiBuilderEditor;exports.ChaiBuilderStudio=e.ChaiBuilderStudio;exports.enableStyling=e.enableStyling;exports.setBlockProps=e.setBlockProps;exports.useActiveLanguage=e.useActiveLanguage;exports.useActiveModal=e.useActiveModal;exports.useActivePanel=e.useActivePanel;exports.useAddBlock=e.useAddBlock;exports.useAddBlockParent=e.useAddBlockParent;exports.useAddClassesToBlocks=e.useAddClassesToBlocks;exports.useAllBlocks=e.useAllBlocks;exports.useBlockContentByLanguage=e.useBlockContentByLanguage;exports.useBrandingOptions=e.useBrandingOptions;exports.useBuilderReset=e.useBuilderReset;exports.useBuildingBlocks=e.useBuildingBlocks;exports.useCanvasHistory=e.useCanvasHistory;exports.useCanvasWidth=e.useCanvasWidth;exports.useCanvasZoom=e.useCanvasZoom;exports.useCopyBlockIds=e.useCopyBlockIds;exports.useCurrentPage=e.useCurrentPage$1;exports.useCutBlockIds=e.useCutBlockIds;exports.useDarkMode=e.useDarkMode;exports.useDeveloperPreviewMode=e.useDeveloperPreviewMode;exports.useDuplicateBlocks=e.useDuplicateBlocks;exports.useFeatureSupport=e.useFeatureSupport;exports.useGetPageData=e.useGetPageData;exports.useHiddenBlockIds=e.useHiddenBlockIds;exports.useHighlightBlockId=e.useHighlightBlockId;exports.useLanguages=e.useLanguages;exports.useMarkAsGlobalBlock=e.useMarkAsGlobalBlock;exports.useMoveBlocks=e.useMoveBlocks;exports.usePasteBlocks=e.usePasteBlocks;exports.usePreviewMode=e.usePreviewMode;exports.usePrimaryLanguage=e.usePrimaryLanguage;exports.useProject=e.useProject$1;exports.useReadOnlyMode=e.useReadOnlyMode;exports.useRemoveBlocks=e.useRemoveBlocks;exports.useRemoveClassesFromBlocks=e.useRemoveClassesFromBlocks;exports.useSavePage=e.useSavePage;exports.useSelectedBlock=e.useSelectedBlock;exports.useSelectedBlockAllClasses=e.useSelectedBlockAllClasses;exports.useSelectedBlockCurrentClasses=e.useSelectedBlockCurrentClasses;exports.useSelectedBlockIds=e.useSelectedBlockIds;exports.useSelectedBlocksDisplayChild=e.useSelectedBlocksDisplayChild;exports.useSelectedBreakpoints=e.useSelectedBreakpoints;exports.useSelectedStylingBlocks=e.useSelectedStylingBlocks;exports.useSetAllBlocks=e.useSetAllBlocks;exports.useStylingBreakpoint=e.useStylingBreakpoint;exports.useStylingState=e.useStylingState;exports.useTranslations=e.useTranslations;exports.useTreeData=e.useTreeData;exports.useUILibraryBlocks=e.useUILibraryBlocks;exports.useUpdateBlocksProps=e.useUpdateBlocksProps;exports.useUpdateBlocksPropsRealtime=e.useUpdateBlocksPropsRealtime;exports.useBuilderProp=s.useBuilderProp;Object.defineProperty(exports,"useTranslation",{enumerable:!0,get:()=>u.useTranslation});
|
package/dist/core.d.ts
CHANGED
|
@@ -38,13 +38,13 @@ export declare type ChaiBlock = {
|
|
|
38
38
|
} & Record<string, string>;
|
|
39
39
|
|
|
40
40
|
/**
|
|
41
|
-
*
|
|
41
|
+
* ChaiBuilder is the main entry point for the Chai Builder Studio.
|
|
42
42
|
* @param props
|
|
43
43
|
* @constructor
|
|
44
44
|
*/
|
|
45
|
-
export declare const
|
|
45
|
+
export declare const ChaiBuilderEditor: (props: ChaiBuilderEditorProps) => JSX_2.Element;
|
|
46
46
|
|
|
47
|
-
export declare interface
|
|
47
|
+
export declare interface ChaiBuilderEditorProps {
|
|
48
48
|
apiKey?: string;
|
|
49
49
|
blocks?: ChaiBlock[];
|
|
50
50
|
brandingOptions?: Record<string, string>;
|
|
@@ -87,6 +87,14 @@ export declare interface ChaiBuilderStudioProps {
|
|
|
87
87
|
getPages?: () => Promise<ChaiPage[]>;
|
|
88
88
|
}
|
|
89
89
|
|
|
90
|
+
export declare const ChaiBuilderStudio: (props: ChaiBuilderStudioProps) => JSX_2.Element;
|
|
91
|
+
|
|
92
|
+
declare type ChaiBuilderStudioProps = {
|
|
93
|
+
apiBaseUrl?: string;
|
|
94
|
+
logo?: string | React_2.FC<any>;
|
|
95
|
+
darkModeSupport?: boolean;
|
|
96
|
+
};
|
|
97
|
+
|
|
90
98
|
declare type ChaiPage = {
|
|
91
99
|
uuid?: string;
|
|
92
100
|
page_name?: string;
|
|
@@ -171,15 +179,15 @@ export declare const useBlockContentByLanguage: (prop: string, block: ChaiBlock)
|
|
|
171
179
|
* Wrapper around useAtom
|
|
172
180
|
*/
|
|
173
181
|
export declare const useBrandingOptions: () => readonly [{
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
182
|
+
bodyFont: string;
|
|
183
|
+
headingFont: string;
|
|
184
|
+
roundedCorners: number;
|
|
185
|
+
primaryColor: string;
|
|
186
|
+
secondaryColor: string;
|
|
187
|
+
bodyBgDarkColor: string;
|
|
188
|
+
bodyBgLightColor: string;
|
|
189
|
+
bodyTextDarkColor: string;
|
|
190
|
+
bodyTextLightColor: string;
|
|
183
191
|
}, (...args: unknown[]) => unknown];
|
|
184
192
|
|
|
185
193
|
export declare const useBuilderProp: (propKey: string, defaultValue?: any) => any;
|
package/dist/core.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { a6 as I, ap as M, a5 as L, a4 as f, D as R, a8 as T, ak as b, Q as x, al as H, H as j, y as w, ao as U, w as F, a3 as G, a9 as O, c as W, e as q, k as E, n as J, aa as K, m as Q, d as Z, ab as z, l as N, j as V, ac as X, P as Y, x as _, an as $, W as ss, ad as es, o as as, p as os, am as ts, ae as us, a7 as ls, q as rs, I as is, u as ps, A as cs, ag as ds, K as Bs, h as ms, L as ks, f as ns, i as gs, g as Cs, ah as Ss, J as Ps, af as vs, ai as ys, T as As, aj as hs, C as Ds } from "./index-390f7bef.js";
|
|
2
2
|
import { u as Ms } from "./useBuilderProp-81a14920.js";
|
|
3
|
-
import { useTranslation as
|
|
3
|
+
import { useTranslation as fs } from "react-i18next";
|
|
4
4
|
import "./jsx-runtime-944c88e2.js";
|
|
5
5
|
import "react";
|
|
6
6
|
import "i18next";
|
|
@@ -14,70 +14,71 @@ import "clsx";
|
|
|
14
14
|
import "tailwind-merge";
|
|
15
15
|
import "react-hotkeys-hook";
|
|
16
16
|
import "flat-to-nested";
|
|
17
|
-
import "./Class-
|
|
17
|
+
import "./Class-e34b2337.js";
|
|
18
18
|
import "redux-undo";
|
|
19
19
|
import "@react-hookz/web";
|
|
20
20
|
import "@chaibuilder/blocks";
|
|
21
|
+
import "@radix-ui/react-icons";
|
|
21
22
|
import "./CONTROLS-442caee5.js";
|
|
22
23
|
import "@radix-ui/react-slot";
|
|
23
24
|
import "class-variance-authority";
|
|
24
25
|
import "@radix-ui/react-tooltip";
|
|
25
|
-
import "@radix-ui/react-icons";
|
|
26
26
|
import "@radix-ui/react-toast";
|
|
27
27
|
export {
|
|
28
|
+
I as ChaiBuilderEditor,
|
|
28
29
|
M as ChaiBuilderStudio,
|
|
29
|
-
|
|
30
|
-
|
|
30
|
+
L as enableStyling,
|
|
31
|
+
f as setBlockProps,
|
|
31
32
|
R as useActiveLanguage,
|
|
32
|
-
|
|
33
|
-
|
|
33
|
+
T as useActiveModal,
|
|
34
|
+
b as useActivePanel,
|
|
34
35
|
x as useAddBlock,
|
|
35
36
|
H as useAddBlockParent,
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
37
|
+
j as useAddClassesToBlocks,
|
|
38
|
+
w as useAllBlocks,
|
|
39
|
+
U as useBlockContentByLanguage,
|
|
40
|
+
F as useBrandingOptions,
|
|
40
41
|
Ms as useBuilderProp,
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
42
|
+
G as useBuilderReset,
|
|
43
|
+
O as useBuildingBlocks,
|
|
44
|
+
W as useCanvasHistory,
|
|
45
|
+
q as useCanvasWidth,
|
|
46
|
+
E as useCanvasZoom,
|
|
47
|
+
J as useCopyBlockIds,
|
|
48
|
+
K as useCurrentPage,
|
|
49
|
+
Q as useCutBlockIds,
|
|
50
|
+
Z as useDarkMode,
|
|
51
|
+
z as useDeveloperPreviewMode,
|
|
52
|
+
N as useDuplicateBlocks,
|
|
53
|
+
V as useFeatureSupport,
|
|
54
|
+
X as useGetPageData,
|
|
55
|
+
Y as useHiddenBlockIds,
|
|
56
|
+
_ as useHighlightBlockId,
|
|
57
|
+
$ as useLanguages,
|
|
58
|
+
ss as useMarkAsGlobalBlock,
|
|
59
|
+
es as useMoveBlocks,
|
|
60
|
+
as as usePasteBlocks,
|
|
61
|
+
os as usePreviewMode,
|
|
62
|
+
ts as usePrimaryLanguage,
|
|
63
|
+
us as useProject,
|
|
64
|
+
ls as useReadOnlyMode,
|
|
65
|
+
rs as useRemoveBlocks,
|
|
66
|
+
is as useRemoveClassesFromBlocks,
|
|
67
|
+
ps as useSavePage,
|
|
68
|
+
cs as useSelectedBlock,
|
|
69
|
+
ds as useSelectedBlockAllClasses,
|
|
70
|
+
Bs as useSelectedBlockCurrentClasses,
|
|
71
|
+
ms as useSelectedBlockIds,
|
|
72
|
+
ks as useSelectedBlocksDisplayChild,
|
|
73
|
+
ns as useSelectedBreakpoints,
|
|
74
|
+
gs as useSelectedStylingBlocks,
|
|
75
|
+
Cs as useSetAllBlocks,
|
|
75
76
|
Ss as useStylingBreakpoint,
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
77
|
+
Ps as useStylingState,
|
|
78
|
+
fs as useTranslation,
|
|
79
|
+
vs as useTranslations,
|
|
80
|
+
ys as useTreeData,
|
|
81
|
+
As as useUILibraryBlocks,
|
|
82
|
+
hs as useUpdateBlocksProps,
|
|
82
83
|
Ds as useUpdateBlocksPropsRealtime
|
|
83
84
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-5c3ac4f7.cjs"),l=require("./useBuilderProp-5e57d0c8.cjs"),r=require("./alert-dialog-4ce6ed22.cjs"),d=require("./usePageActions-3bed2330.cjs");require("react");require("@radix-ui/react-slot");require("class-variance-authority");require("./utils-3c452dd0.cjs");require("clsx");require("tailwind-merge");require("@radix-ui/react-tooltip");require("@radix-ui/react-icons");require("@radix-ui/react-toast");require("jotai");require("lodash");require("@radix-ui/react-alert-dialog");require("./index-ebd86d7f.cjs");require("i18next");require("react-i18next");require("flagged");require("react-dnd");require("@minoru/react-dnd-treeview");require("react-hotkeys-hook");require("flat-to-nested");require("./Class-7d6aadbc.cjs");require("redux-undo");require("@react-hookz/web");require("@chaibuilder/blocks");require("./CONTROLS-031e1de3.cjs");require("./index-207f2cbf.cjs");require("react-dom");const x=({pageData:i,projectData:s})=>{const n={},t=d.useDeletePage(),u=i.uuid===s.homepage,o=()=>{t.mutate(i,{onSuccess:()=>{n({uuid:s.homepage,slug:"/home"})}})};return e.jsxRuntimeExports.jsxs(r.AlertDialog,{children:[e.jsxRuntimeExports.jsx(r.AlertDialogTrigger,{disabled:u,children:e.jsxRuntimeExports.jsx("div",{className:`flex h-full items-center justify-center rounded-md border px-2 py-2 font-medium hover:bg-red-400 hover:text-white ${u?"cursor-not-allowed border-red-200 text-red-200":"cursor-pointer border-red-400 text-red-400"}`,children:e.jsxRuntimeExports.jsx("div",{children:"Del"})})}),e.jsxRuntimeExports.jsxs(r.AlertDialogContent,{children:[e.jsxRuntimeExports.jsxs(r.AlertDialogTitle,{children:["Are you sure you want to delete ",e.jsxRuntimeExports.jsx("i",{className:"text-red-500",children:i.page_name})," page?"]}),e.jsxRuntimeExports.jsx(r.AlertDialogDescription,{children:"This action cannot be undone. This will permanently delete your page."}),e.jsxRuntimeExports.jsxs("div",{className:"flex items-center justify-end gap-x-3",children:[e.jsxRuntimeExports.jsx(r.AlertDialogCancel,{disabled:t.isPending,children:"Cancel"}),e.jsxRuntimeExports.jsx(l.Button,{variant:"destructive",onClick:o,disabled:t.isPending,children:"Yes, Delete"})]})]})]})};exports.default=x;
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { j as e } from "./jsx-runtime-944c88e2.js";
|
|
2
|
+
import { B as m } from "./useBuilderProp-81a14920.js";
|
|
3
|
+
import { A as n, a as d, b as a, e as p, f as c, h as u } from "./alert-dialog-ee98f47e.js";
|
|
4
|
+
import { a as h } from "./usePageActions-f86f6f65.js";
|
|
5
|
+
import "react";
|
|
6
|
+
import "@radix-ui/react-slot";
|
|
7
|
+
import "class-variance-authority";
|
|
8
|
+
import "./utils-ac68b2c8.js";
|
|
9
|
+
import "clsx";
|
|
10
|
+
import "tailwind-merge";
|
|
11
|
+
import "@radix-ui/react-tooltip";
|
|
12
|
+
import "@radix-ui/react-icons";
|
|
13
|
+
import "@radix-ui/react-toast";
|
|
14
|
+
import "jotai";
|
|
15
|
+
import "lodash";
|
|
16
|
+
import "@radix-ui/react-alert-dialog";
|
|
17
|
+
import "./index-390f7bef.js";
|
|
18
|
+
import "i18next";
|
|
19
|
+
import "react-i18next";
|
|
20
|
+
import "flagged";
|
|
21
|
+
import "react-dnd";
|
|
22
|
+
import "@minoru/react-dnd-treeview";
|
|
23
|
+
import "react-hotkeys-hook";
|
|
24
|
+
import "flat-to-nested";
|
|
25
|
+
import "./Class-e34b2337.js";
|
|
26
|
+
import "redux-undo";
|
|
27
|
+
import "@react-hookz/web";
|
|
28
|
+
import "@chaibuilder/blocks";
|
|
29
|
+
import "./CONTROLS-442caee5.js";
|
|
30
|
+
import "./index-824a7bd0.js";
|
|
31
|
+
import "react-dom";
|
|
32
|
+
const M = ({ pageData: r, projectData: i }) => {
|
|
33
|
+
const s = {}, t = h(), o = r.uuid === i.homepage, l = () => {
|
|
34
|
+
t.mutate(r, {
|
|
35
|
+
onSuccess: () => {
|
|
36
|
+
s({ uuid: i.homepage, slug: "/home" });
|
|
37
|
+
}
|
|
38
|
+
});
|
|
39
|
+
};
|
|
40
|
+
return /* @__PURE__ */ e.jsxs(n, { children: [
|
|
41
|
+
/* @__PURE__ */ e.jsx(d, { disabled: o, children: /* @__PURE__ */ e.jsx(
|
|
42
|
+
"div",
|
|
43
|
+
{
|
|
44
|
+
className: `flex h-full items-center justify-center rounded-md border px-2 py-2 font-medium hover:bg-red-400 hover:text-white ${o ? "cursor-not-allowed border-red-200 text-red-200" : "cursor-pointer border-red-400 text-red-400"}`,
|
|
45
|
+
children: /* @__PURE__ */ e.jsx("div", { children: "Del" })
|
|
46
|
+
}
|
|
47
|
+
) }),
|
|
48
|
+
/* @__PURE__ */ e.jsxs(a, { children: [
|
|
49
|
+
/* @__PURE__ */ e.jsxs(p, { children: [
|
|
50
|
+
"Are you sure you want to delete ",
|
|
51
|
+
/* @__PURE__ */ e.jsx("i", { className: "text-red-500", children: r.page_name }),
|
|
52
|
+
" page?"
|
|
53
|
+
] }),
|
|
54
|
+
/* @__PURE__ */ e.jsx(c, { children: "This action cannot be undone. This will permanently delete your page." }),
|
|
55
|
+
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center justify-end gap-x-3", children: [
|
|
56
|
+
/* @__PURE__ */ e.jsx(u, { disabled: t.isPending, children: "Cancel" }),
|
|
57
|
+
/* @__PURE__ */ e.jsx(m, { variant: "destructive", onClick: l, disabled: t.isPending, children: "Yes, Delete" })
|
|
58
|
+
] })
|
|
59
|
+
] })
|
|
60
|
+
] });
|
|
61
|
+
};
|
|
62
|
+
export {
|
|
63
|
+
M as default
|
|
64
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const a=require("./jsx-runtime-5c3ac4f7.cjs"),y=require("@radix-ui/react-switch"),D=require("react"),r=require("./utils-3c452dd0.cjs"),M=require("@radix-ui/react-hover-card"),C=require("@radix-ui/react-dropdown-menu"),p=require("@radix-ui/react-icons");function c(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const s=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,s.get?s:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const u=c(y),d=c(D),l=c(M),o=c(C),m=d.forwardRef(({className:e,...t},n)=>a.jsxRuntimeExports.jsx(u.Root,{className:r.cn("peer inline-flex h-[24px] w-[44px] shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-slate-400 focus-visible:ring-offset-2 focus-visible:ring-offset-white disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-slate-900 data-[state=unchecked]:bg-slate-200 dark:focus-visible:ring-slate-800 dark:focus-visible:ring-offset-slate-950 dark:data-[state=checked]:bg-slate-50 dark:data-[state=unchecked]:bg-slate-800",e),...t,ref:n,children:a.jsxRuntimeExports.jsx(u.Thumb,{className:r.cn("pointer-events-none block h-5 w-5 rounded-full bg-white shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0 dark:bg-slate-950")})}));m.displayName=u.Root.displayName;const S=l.Root,k=l.Trigger,f=d.forwardRef(({className:e,align:t="center",sideOffset:n=4,...s},i)=>a.jsxRuntimeExports.jsx(l.Content,{ref:i,align:t,sideOffset:n,className:r.cn("z-50 w-64 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...s}));f.displayName=l.Content.displayName;const E=o.Root,I=o.Trigger,P=o.Group,T=o.Portal,z=o.Sub,_=o.RadioGroup,x=d.forwardRef(({className:e,inset:t,children:n,...s},i)=>a.jsxRuntimeExports.jsxs(o.SubTrigger,{ref:i,className:r.cn("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent",t&&"pl-8",e),...s,children:[n,a.jsxRuntimeExports.jsx(p.ChevronRightIcon,{className:"ml-auto h-4 w-4"})]}));x.displayName=o.SubTrigger.displayName;const b=d.forwardRef(({className:e,...t},n)=>a.jsxRuntimeExports.jsx(o.SubContent,{ref:n,className:r.cn("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...t}));b.displayName=o.SubContent.displayName;const w=d.forwardRef(({className:e,sideOffset:t=4,...n},s)=>a.jsxRuntimeExports.jsx(o.Portal,{children:a.jsxRuntimeExports.jsx(o.Content,{ref:s,sideOffset:t,className:r.cn("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md","data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...n})}));w.displayName=o.Content.displayName;const g=d.forwardRef(({className:e,inset:t,...n},s)=>a.jsxRuntimeExports.jsx(o.Item,{ref:s,className:r.cn("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t&&"pl-8",e),...n}));g.displayName=o.Item.displayName;const h=d.forwardRef(({className:e,children:t,checked:n,...s},i)=>a.jsxRuntimeExports.jsxs(o.CheckboxItem,{ref:i,className:r.cn("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),checked:n,...s,children:[a.jsxRuntimeExports.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:a.jsxRuntimeExports.jsx(o.ItemIndicator,{children:a.jsxRuntimeExports.jsx(p.CheckIcon,{className:"h-4 w-4"})})}),t]}));h.displayName=o.CheckboxItem.displayName;const j=d.forwardRef(({className:e,children:t,...n},s)=>a.jsxRuntimeExports.jsxs(o.RadioItem,{ref:s,className:r.cn("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...n,children:[a.jsxRuntimeExports.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:a.jsxRuntimeExports.jsx(o.ItemIndicator,{children:a.jsxRuntimeExports.jsx(p.DotFilledIcon,{className:"h-4 w-4 fill-current"})})}),t]}));j.displayName=o.RadioItem.displayName;const R=d.forwardRef(({className:e,inset:t,...n},s)=>a.jsxRuntimeExports.jsx(o.Label,{ref:s,className:r.cn("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...n}));R.displayName=o.Label.displayName;const N=d.forwardRef(({className:e,...t},n)=>a.jsxRuntimeExports.jsx(o.Separator,{ref:n,className:r.cn("-mx-1 my-1 h-px bg-muted",e),...t}));N.displayName=o.Separator.displayName;const v=({className:e,...t})=>a.jsxRuntimeExports.jsx("span",{className:r.cn("ml-auto text-xs tracking-widest opacity-60",e),...t});v.displayName="DropdownMenuShortcut";exports.DropdownMenu=E;exports.DropdownMenuCheckboxItem=h;exports.DropdownMenuContent=w;exports.DropdownMenuGroup=P;exports.DropdownMenuItem=g;exports.DropdownMenuLabel=R;exports.DropdownMenuPortal=T;exports.DropdownMenuRadioGroup=_;exports.DropdownMenuRadioItem=j;exports.DropdownMenuSeparator=N;exports.DropdownMenuShortcut=v;exports.DropdownMenuSub=z;exports.DropdownMenuSubContent=b;exports.DropdownMenuSubTrigger=x;exports.DropdownMenuTrigger=I;exports.HoverCard=S;exports.HoverCardContent=f;exports.HoverCardTrigger=k;exports.Switch=m;
|