@chaibuilder/sdk 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +41 -0
- package/dist/AddBlocks-04c49399.js +258 -0
- package/dist/AddBlocks-c27c81fa.cjs +3 -0
- package/dist/BrandingOptions-055cf22a.js +157 -0
- package/dist/BrandingOptions-c25f6370.cjs +1 -0
- package/dist/CONTROLS-031e1de3.cjs +1 -0
- package/dist/CONTROLS-442caee5.js +6 -0
- package/dist/CanvasArea-97dfbb52.cjs +60 -0
- package/dist/CanvasArea-a7901131.js +1455 -0
- package/dist/Class-0801d193.cjs +1 -0
- package/dist/Class-e6b07b79.js +1138 -0
- package/dist/ImagesPanel-160aa664.cjs +1 -0
- package/dist/ImagesPanel-815d5e6f.js +27 -0
- package/dist/Layers-3aa6aae7.cjs +1 -0
- package/dist/Layers-6f1c162e.js +370 -0
- package/dist/MarkAsGlobalBlock-209ddfd5.js +73 -0
- package/dist/MarkAsGlobalBlock-536770e7.cjs +1 -0
- package/dist/Settings-2b1ff1a3.cjs +1 -0
- package/dist/Settings-b1afcefe.js +1845 -0
- package/dist/SidePanels-f48777bb.js +144 -0
- package/dist/SidePanels-f79dbace.cjs +1 -0
- package/dist/Topbar-64729901.js +105 -0
- package/dist/Topbar-bff765dc.cjs +1 -0
- package/dist/UnsplashImages-04fffeed.cjs +1 -0
- package/dist/UnsplashImages-315ce7a8.js +160 -0
- package/dist/UploadImages-43c16a2d.cjs +1 -0
- package/dist/UploadImages-f317eef0.js +107 -0
- package/dist/_commonjsHelpers-5a53b418.cjs +1 -0
- package/dist/_commonjsHelpers-d4512b9c.js +6 -0
- package/dist/accordion-0afd8143.cjs +1 -0
- package/dist/accordion-c0176dc5.js +42 -0
- package/dist/context-menu-e1c240ce.js +122 -0
- package/dist/context-menu-fec580f2.cjs +1 -0
- package/dist/core.cjs +1 -0
- package/dist/core.d.ts +353 -0
- package/dist/core.js +83 -0
- package/dist/dialog-170eaad9.cjs +1 -0
- package/dist/dialog-3d4e82ed.js +65 -0
- package/dist/dropdown-menu-a9b096f9.cjs +1 -0
- package/dist/dropdown-menu-d912a52e.js +223 -0
- package/dist/html-to-json-d8ac554d.cjs +1 -0
- package/dist/html-to-json-fecbbe16.js +178 -0
- package/dist/index-aea5c557.cjs +2 -0
- package/dist/index-cdd49c4c.js +2651 -0
- package/dist/jsx-runtime-5c3ac4f7.cjs +27 -0
- package/dist/jsx-runtime-944c88e2.js +631 -0
- package/dist/label-167415e5.cjs +1 -0
- package/dist/label-e770a087.js +10 -0
- package/dist/lib.cjs +1 -0
- package/dist/lib.d.ts +29 -0
- package/dist/lib.js +223 -0
- package/dist/link-43d13383.cjs +1 -0
- package/dist/link-8594fd8f.js +211 -0
- package/dist/popover-7cb9079b.cjs +1 -0
- package/dist/popover-f7addcf4.js +23 -0
- package/dist/render.cjs +2 -0
- package/dist/render.d.ts +49 -0
- package/dist/render.js +1171 -0
- package/dist/scroll-area-088530b9.cjs +1 -0
- package/dist/scroll-area-9f64a082.js +30 -0
- package/dist/select-0e32300c.cjs +1 -0
- package/dist/select-7fddd7c3.js +75 -0
- package/dist/separator-a597dba7.cjs +1 -0
- package/dist/separator-a80d065b.js +18 -0
- package/dist/style.css +6 -0
- package/dist/tabs-85caa1e8.js +46 -0
- package/dist/tabs-860e37aa.cjs +1 -0
- package/dist/textarea-0750bcd2.js +73 -0
- package/dist/textarea-a338ede6.cjs +1 -0
- package/dist/toggle-00c9d11e.js +30 -0
- package/dist/toggle-b90fed97.cjs +1 -0
- package/dist/ui.cjs +1 -0
- package/dist/ui.d.ts +471 -0
- package/dist/ui.js +442 -0
- package/dist/useBuilderProp-5e57d0c8.cjs +1 -0
- package/dist/useBuilderProp-81a14920.js +238 -0
- package/dist/utils-3c452dd0.cjs +1 -0
- package/dist/utils-ac68b2c8.js +6 -0
- package/dist/vite.svg +1 -0
- package/package.json +156 -0
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
import { j as o } from "./jsx-runtime-944c88e2.js";
|
|
2
|
+
import * as r from "react";
|
|
3
|
+
import * as e from "@radix-ui/react-context-menu";
|
|
4
|
+
import { ChevronRightIcon as l, CheckIcon as c, DotFilledIcon as m } from "@radix-ui/react-icons";
|
|
5
|
+
import { c as d } from "./utils-ac68b2c8.js";
|
|
6
|
+
const M = e.Root, R = e.Trigger, I = e.Group, v = e.Portal, S = e.Sub, k = e.RadioGroup, u = r.forwardRef(({ className: t, inset: a, children: s, ...n }, i) => /* @__PURE__ */ o.jsxs(
|
|
7
|
+
e.SubTrigger,
|
|
8
|
+
{
|
|
9
|
+
ref: i,
|
|
10
|
+
className: d(
|
|
11
|
+
"flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground",
|
|
12
|
+
a && "pl-8",
|
|
13
|
+
t
|
|
14
|
+
),
|
|
15
|
+
...n,
|
|
16
|
+
children: [
|
|
17
|
+
s,
|
|
18
|
+
/* @__PURE__ */ o.jsx(l, { className: "ml-auto h-4 w-4" })
|
|
19
|
+
]
|
|
20
|
+
}
|
|
21
|
+
));
|
|
22
|
+
u.displayName = e.SubTrigger.displayName;
|
|
23
|
+
const p = r.forwardRef(({ className: t, ...a }, s) => /* @__PURE__ */ o.jsx(
|
|
24
|
+
e.SubContent,
|
|
25
|
+
{
|
|
26
|
+
ref: s,
|
|
27
|
+
className: d(
|
|
28
|
+
"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",
|
|
29
|
+
t
|
|
30
|
+
),
|
|
31
|
+
...a
|
|
32
|
+
}
|
|
33
|
+
));
|
|
34
|
+
p.displayName = e.SubContent.displayName;
|
|
35
|
+
const f = r.forwardRef(({ className: t, ...a }, s) => /* @__PURE__ */ o.jsx(e.Portal, { children: /* @__PURE__ */ o.jsx(
|
|
36
|
+
e.Content,
|
|
37
|
+
{
|
|
38
|
+
ref: s,
|
|
39
|
+
className: d(
|
|
40
|
+
"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",
|
|
41
|
+
t
|
|
42
|
+
),
|
|
43
|
+
...a
|
|
44
|
+
}
|
|
45
|
+
) }));
|
|
46
|
+
f.displayName = e.Content.displayName;
|
|
47
|
+
const x = r.forwardRef(({ className: t, inset: a, ...s }, n) => /* @__PURE__ */ o.jsx(
|
|
48
|
+
e.Item,
|
|
49
|
+
{
|
|
50
|
+
ref: n,
|
|
51
|
+
className: d(
|
|
52
|
+
"relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
|
|
53
|
+
a && "pl-8",
|
|
54
|
+
t
|
|
55
|
+
),
|
|
56
|
+
...s
|
|
57
|
+
}
|
|
58
|
+
));
|
|
59
|
+
x.displayName = e.Item.displayName;
|
|
60
|
+
const b = r.forwardRef(({ className: t, children: a, checked: s, ...n }, i) => /* @__PURE__ */ o.jsxs(
|
|
61
|
+
e.CheckboxItem,
|
|
62
|
+
{
|
|
63
|
+
ref: i,
|
|
64
|
+
className: d(
|
|
65
|
+
"relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
|
|
66
|
+
t
|
|
67
|
+
),
|
|
68
|
+
checked: s,
|
|
69
|
+
...n,
|
|
70
|
+
children: [
|
|
71
|
+
/* @__PURE__ */ o.jsx("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ o.jsx(e.ItemIndicator, { children: /* @__PURE__ */ o.jsx(c, { className: "h-4 w-4" }) }) }),
|
|
72
|
+
a
|
|
73
|
+
]
|
|
74
|
+
}
|
|
75
|
+
));
|
|
76
|
+
b.displayName = e.CheckboxItem.displayName;
|
|
77
|
+
const g = r.forwardRef(({ className: t, children: a, ...s }, n) => /* @__PURE__ */ o.jsxs(
|
|
78
|
+
e.RadioItem,
|
|
79
|
+
{
|
|
80
|
+
ref: n,
|
|
81
|
+
className: d(
|
|
82
|
+
"relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
|
|
83
|
+
t
|
|
84
|
+
),
|
|
85
|
+
...s,
|
|
86
|
+
children: [
|
|
87
|
+
/* @__PURE__ */ o.jsx("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ o.jsx(e.ItemIndicator, { children: /* @__PURE__ */ o.jsx(m, { className: "h-4 w-4 fill-current" }) }) }),
|
|
88
|
+
a
|
|
89
|
+
]
|
|
90
|
+
}
|
|
91
|
+
));
|
|
92
|
+
g.displayName = e.RadioItem.displayName;
|
|
93
|
+
const h = r.forwardRef(({ className: t, inset: a, ...s }, n) => /* @__PURE__ */ o.jsx(
|
|
94
|
+
e.Label,
|
|
95
|
+
{
|
|
96
|
+
ref: n,
|
|
97
|
+
className: d("px-2 py-1.5 text-sm font-semibold text-foreground", a && "pl-8", t),
|
|
98
|
+
...s
|
|
99
|
+
}
|
|
100
|
+
));
|
|
101
|
+
h.displayName = e.Label.displayName;
|
|
102
|
+
const N = r.forwardRef(({ className: t, ...a }, s) => /* @__PURE__ */ o.jsx(e.Separator, { ref: s, className: d("-mx-1 my-1 h-px bg-border", t), ...a }));
|
|
103
|
+
N.displayName = e.Separator.displayName;
|
|
104
|
+
const C = ({ className: t, ...a }) => /* @__PURE__ */ o.jsx("span", { className: d("ml-auto text-xs tracking-widest text-muted-foreground", t), ...a });
|
|
105
|
+
C.displayName = "ContextMenuShortcut";
|
|
106
|
+
export {
|
|
107
|
+
M as C,
|
|
108
|
+
R as a,
|
|
109
|
+
f as b,
|
|
110
|
+
x as c,
|
|
111
|
+
b as d,
|
|
112
|
+
g as e,
|
|
113
|
+
h as f,
|
|
114
|
+
N as g,
|
|
115
|
+
C as h,
|
|
116
|
+
I as i,
|
|
117
|
+
v as j,
|
|
118
|
+
S as k,
|
|
119
|
+
p as l,
|
|
120
|
+
u as m,
|
|
121
|
+
k as n
|
|
122
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const a=require("./jsx-runtime-5c3ac4f7.cjs"),R=require("react"),M=require("@radix-ui/react-context-menu"),c=require("@radix-ui/react-icons"),r=require("./utils-3c452dd0.cjs");function u(t){const o=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const n in t)if(n!=="default"){const s=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(o,n,s.get?s:{enumerable:!0,get:()=>t[n]})}}return o.default=t,Object.freeze(o)}const i=u(R),e=u(M),h=e.Root,N=e.Trigger,y=e.Group,w=e.Portal,I=e.Sub,S=e.RadioGroup,l=i.forwardRef(({className:t,inset:o,children:n,...s},d)=>a.jsxRuntimeExports.jsxs(e.SubTrigger,{ref:d,className:r.cn("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground",o&&"pl-8",t),...s,children:[n,a.jsxRuntimeExports.jsx(c.ChevronRightIcon,{className:"ml-auto h-4 w-4"})]}));l.displayName=e.SubTrigger.displayName;const m=i.forwardRef(({className:t,...o},n)=>a.jsxRuntimeExports.jsx(e.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",t),...o}));m.displayName=e.SubContent.displayName;const x=i.forwardRef(({className:t,...o},n)=>a.jsxRuntimeExports.jsx(e.Portal,{children:a.jsxRuntimeExports.jsx(e.Content,{ref:n,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",t),...o})}));x.displayName=e.Content.displayName;const p=i.forwardRef(({className:t,inset:o,...n},s)=>a.jsxRuntimeExports.jsx(e.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 focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",o&&"pl-8",t),...n}));p.displayName=e.Item.displayName;const f=i.forwardRef(({className:t,children:o,checked:n,...s},d)=>a.jsxRuntimeExports.jsxs(e.CheckboxItem,{ref:d,className:r.cn("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t),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(e.ItemIndicator,{children:a.jsxRuntimeExports.jsx(c.CheckIcon,{className:"h-4 w-4"})})}),o]}));f.displayName=e.CheckboxItem.displayName;const b=i.forwardRef(({className:t,children:o,...n},s)=>a.jsxRuntimeExports.jsxs(e.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 focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t),...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(e.ItemIndicator,{children:a.jsxRuntimeExports.jsx(c.DotFilledIcon,{className:"h-4 w-4 fill-current"})})}),o]}));b.displayName=e.RadioItem.displayName;const C=i.forwardRef(({className:t,inset:o,...n},s)=>a.jsxRuntimeExports.jsx(e.Label,{ref:s,className:r.cn("px-2 py-1.5 text-sm font-semibold text-foreground",o&&"pl-8",t),...n}));C.displayName=e.Label.displayName;const g=i.forwardRef(({className:t,...o},n)=>a.jsxRuntimeExports.jsx(e.Separator,{ref:n,className:r.cn("-mx-1 my-1 h-px bg-border",t),...o}));g.displayName=e.Separator.displayName;const j=({className:t,...o})=>a.jsxRuntimeExports.jsx("span",{className:r.cn("ml-auto text-xs tracking-widest text-muted-foreground",t),...o});j.displayName="ContextMenuShortcut";exports.ContextMenu=h;exports.ContextMenuCheckboxItem=f;exports.ContextMenuContent=x;exports.ContextMenuGroup=y;exports.ContextMenuItem=p;exports.ContextMenuLabel=C;exports.ContextMenuPortal=w;exports.ContextMenuRadioGroup=S;exports.ContextMenuRadioItem=b;exports.ContextMenuSeparator=g;exports.ContextMenuShortcut=j;exports.ContextMenuSub=I;exports.ContextMenuSubContent=m;exports.ContextMenuSubTrigger=l;exports.ContextMenuTrigger=N;
|
package/dist/core.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-aea5c557.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-0801d193.cjs");require("redux-undo");require("@react-hookz/web");require("chaibuilder-blocks");require("./CONTROLS-031e1de3.cjs");require("@radix-ui/react-slot");require("class-variance-authority");require("@radix-ui/react-tooltip");require("@radix-ui/react-icons");require("@radix-ui/react-toast");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;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;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
ADDED
|
@@ -0,0 +1,353 @@
|
|
|
1
|
+
import { JSX as JSX_2 } from 'react/jsx-runtime';
|
|
2
|
+
import { LazyExoticComponent } from 'react';
|
|
3
|
+
import { default as React_2 } from 'react';
|
|
4
|
+
import { RESET } from 'jotai/utils';
|
|
5
|
+
import { ThrottledFunction } from '@react-hookz/web';
|
|
6
|
+
import { useTranslation } from 'react-i18next';
|
|
7
|
+
|
|
8
|
+
declare type AddBlocks = {
|
|
9
|
+
addCoreBlock: Function;
|
|
10
|
+
addPredefinedBlock: Function;
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
declare interface Block {
|
|
14
|
+
type: string;
|
|
15
|
+
[key: string]: any;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
declare interface BlockLangContent {
|
|
19
|
+
content: string;
|
|
20
|
+
propKey: string;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
declare type CanvasHistory = {
|
|
24
|
+
redoCount: number;
|
|
25
|
+
undoCount: number;
|
|
26
|
+
clear: Function;
|
|
27
|
+
createSnapshot: Function;
|
|
28
|
+
redo: Function;
|
|
29
|
+
undo: Function;
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
export declare type ChaiBlock = {
|
|
33
|
+
_id: string;
|
|
34
|
+
_name?: string;
|
|
35
|
+
_parent?: string | null | undefined;
|
|
36
|
+
_bindings?: Record<string, string>;
|
|
37
|
+
readonly _type: string;
|
|
38
|
+
} & Record<string, string>;
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* ChaiBuilderStudio is the main entry point for the Chai Builder Studio.
|
|
42
|
+
* @param props
|
|
43
|
+
* @constructor
|
|
44
|
+
*/
|
|
45
|
+
export declare const ChaiBuilderStudio: (props: ChaiBuilderStudioProps) => JSX_2.Element;
|
|
46
|
+
|
|
47
|
+
export declare interface ChaiBuilderStudioProps {
|
|
48
|
+
apiKey?: string;
|
|
49
|
+
blocks?: ChaiBlock[];
|
|
50
|
+
brandingOptions?: Record<string, string>;
|
|
51
|
+
canvas?: React_2.FC<any>;
|
|
52
|
+
previewLink?: string;
|
|
53
|
+
canvasTopBarComponents?: {
|
|
54
|
+
right?: React_2.LazyExoticComponent<any>[];
|
|
55
|
+
};
|
|
56
|
+
darkMode?: boolean;
|
|
57
|
+
dndOptions?: any;
|
|
58
|
+
fetchMediaCallback?: (limit?: number, offset?: number) => Promise<any[]>;
|
|
59
|
+
getExternalPredefinedBlock?: (block: PredefinedBlock) => Promise<PredefinedBlock & {
|
|
60
|
+
blocks: ChaiBlock[];
|
|
61
|
+
html: string;
|
|
62
|
+
}>;
|
|
63
|
+
getUILibraryBlocks?: (libraryUuid: string) => Promise<PredefinedBlock[]>;
|
|
64
|
+
globalBlocks?: Block[];
|
|
65
|
+
globalBlocksSupport?: boolean;
|
|
66
|
+
importHTML?: boolean;
|
|
67
|
+
loading?: boolean;
|
|
68
|
+
onSaveBlocks: ({ blocks, globalBlocks }: any) => Promise<any>;
|
|
69
|
+
onSaveBrandingOptions: (brandingOptions: any) => Promise<any>;
|
|
70
|
+
onSyncStatusChange?: (syncStatus: "UNSAVED" | "SAVED") => void;
|
|
71
|
+
previewComponent?: LazyExoticComponent<any>;
|
|
72
|
+
sideBarComponents?: {
|
|
73
|
+
bottom?: [React_2.LazyExoticComponent<any>];
|
|
74
|
+
top?: {
|
|
75
|
+
icon: React_2.FC<any>;
|
|
76
|
+
name: string;
|
|
77
|
+
panel: React_2.LazyExoticComponent<any>;
|
|
78
|
+
}[];
|
|
79
|
+
};
|
|
80
|
+
topBarComponents?: {
|
|
81
|
+
center?: React_2.LazyExoticComponent<any>[];
|
|
82
|
+
left?: React_2.LazyExoticComponent<any>[];
|
|
83
|
+
right?: React_2.LazyExoticComponent<any>[];
|
|
84
|
+
};
|
|
85
|
+
uiLibraries?: UiLibrary[];
|
|
86
|
+
uploadMediaCallback?: (file: File) => Promise<string>;
|
|
87
|
+
getPages?: () => Promise<ChaiPage[]>;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
declare type ChaiPage = {
|
|
91
|
+
uuid?: string;
|
|
92
|
+
page_name?: string;
|
|
93
|
+
blocks: ChaiBlock[];
|
|
94
|
+
custom_code: string;
|
|
95
|
+
seo_data: Record<string, string>;
|
|
96
|
+
slug: string;
|
|
97
|
+
translations: Record<string, Record<string, string>>;
|
|
98
|
+
};
|
|
99
|
+
|
|
100
|
+
declare type ClassDerivedObject = {
|
|
101
|
+
cls: string;
|
|
102
|
+
dark: boolean;
|
|
103
|
+
fullCls: string;
|
|
104
|
+
mod: string;
|
|
105
|
+
mq: string;
|
|
106
|
+
property: string;
|
|
107
|
+
};
|
|
108
|
+
|
|
109
|
+
export declare const enableStyling: (attrs: Record<string, string>) => {
|
|
110
|
+
[x: string]: string;
|
|
111
|
+
};
|
|
112
|
+
|
|
113
|
+
declare type PredefinedBlock = {
|
|
114
|
+
uuid: string;
|
|
115
|
+
name: string;
|
|
116
|
+
preview: string;
|
|
117
|
+
blocks?: ChaiBlock[];
|
|
118
|
+
html?: string;
|
|
119
|
+
};
|
|
120
|
+
|
|
121
|
+
export declare const setBlockProps: (attrs: Record<string, string>) => {
|
|
122
|
+
[x: string]: string;
|
|
123
|
+
};
|
|
124
|
+
|
|
125
|
+
declare type TBlockTranslation = {
|
|
126
|
+
[_path: string]: any;
|
|
127
|
+
};
|
|
128
|
+
|
|
129
|
+
declare type TStyleBlock = {
|
|
130
|
+
blockId: string;
|
|
131
|
+
id: string;
|
|
132
|
+
prop: string;
|
|
133
|
+
};
|
|
134
|
+
|
|
135
|
+
declare interface UiLibrary {
|
|
136
|
+
name: string;
|
|
137
|
+
uuid: string;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
export declare const useActiveLanguage: () => [string, (args_0: string | ((prev: string) => string)) => void];
|
|
141
|
+
|
|
142
|
+
export declare const useActiveModal: () => any;
|
|
143
|
+
|
|
144
|
+
/**
|
|
145
|
+
*
|
|
146
|
+
*/
|
|
147
|
+
export declare const useActivePanel: () => [string, (args_0: string | ((prev: string) => string)) => void];
|
|
148
|
+
|
|
149
|
+
export declare const useAddBlock: () => AddBlocks;
|
|
150
|
+
|
|
151
|
+
/**
|
|
152
|
+
*
|
|
153
|
+
*/
|
|
154
|
+
export declare const useAddBlockParent: () => [string, never];
|
|
155
|
+
|
|
156
|
+
export declare const useAddClassesToBlocks: () => Function;
|
|
157
|
+
|
|
158
|
+
/**
|
|
159
|
+
* useTreeData hook
|
|
160
|
+
*/
|
|
161
|
+
export declare const useAllBlocks: () => ChaiBlock[];
|
|
162
|
+
|
|
163
|
+
/**
|
|
164
|
+
* Returns the block content for the active language
|
|
165
|
+
* @param prop
|
|
166
|
+
* @param block
|
|
167
|
+
*/
|
|
168
|
+
export declare const useBlockContentByLanguage: (prop: string, block: ChaiBlock) => BlockLangContent;
|
|
169
|
+
|
|
170
|
+
/**
|
|
171
|
+
* Wrapper around useAtom
|
|
172
|
+
*/
|
|
173
|
+
export declare const useBrandingOptions: () => readonly [{
|
|
174
|
+
_bodyFont: string;
|
|
175
|
+
_headingFont: string;
|
|
176
|
+
_roundedCorners: number;
|
|
177
|
+
_primaryColor: string;
|
|
178
|
+
_secondaryColor: string;
|
|
179
|
+
_bodyBgDarkColor: string;
|
|
180
|
+
_bodyBgLightColor: string;
|
|
181
|
+
_bodyTextDarkColor: string;
|
|
182
|
+
_bodyTextLightColor: string;
|
|
183
|
+
}, (...args: unknown[]) => unknown];
|
|
184
|
+
|
|
185
|
+
export declare const useBuilderProp: (propKey: string, defaultValue?: any) => any;
|
|
186
|
+
|
|
187
|
+
export declare const useBuilderReset: () => () => void;
|
|
188
|
+
|
|
189
|
+
export declare const useBuildingBlocks: () => [Array<any>, Array<any>, () => never, () => never];
|
|
190
|
+
|
|
191
|
+
/**
|
|
192
|
+
*
|
|
193
|
+
*/
|
|
194
|
+
export declare const useCanvasHistory: () => CanvasHistory;
|
|
195
|
+
|
|
196
|
+
/**
|
|
197
|
+
*
|
|
198
|
+
*/
|
|
199
|
+
export declare const useCanvasWidth: () => [number, string, Function];
|
|
200
|
+
|
|
201
|
+
/**
|
|
202
|
+
* Wrapper hook around useAtom
|
|
203
|
+
*/
|
|
204
|
+
export declare const useCanvasZoom: () => [number, (args_0: number | typeof RESET | ((prev: number) => number | typeof RESET)) => void];
|
|
205
|
+
|
|
206
|
+
export declare const useCopyBlockIds: () => [Array<string>, Function];
|
|
207
|
+
|
|
208
|
+
export declare const useCurrentPage: () => {
|
|
209
|
+
currentPage: unknown;
|
|
210
|
+
};
|
|
211
|
+
|
|
212
|
+
export declare const useCutBlockIds: () => [Array<string>, Function];
|
|
213
|
+
|
|
214
|
+
/**
|
|
215
|
+
* Wrapper hook around useAtom
|
|
216
|
+
*/
|
|
217
|
+
export declare const useDarkMode: () => [boolean, Function];
|
|
218
|
+
|
|
219
|
+
/**
|
|
220
|
+
* Wrapper hook around useAtom
|
|
221
|
+
*/
|
|
222
|
+
export declare const useDeveloperPreviewMode: () => [boolean, Function];
|
|
223
|
+
|
|
224
|
+
/**
|
|
225
|
+
* useDuplicateBlock
|
|
226
|
+
*/
|
|
227
|
+
export declare const useDuplicateBlocks: () => Function;
|
|
228
|
+
|
|
229
|
+
export declare const useFeatureSupport: (feature: string, defaultValue: boolean) => boolean;
|
|
230
|
+
|
|
231
|
+
export declare const useGetPageData: () => () => {
|
|
232
|
+
currentPage: unknown;
|
|
233
|
+
blocks: {};
|
|
234
|
+
globalBlocks: {};
|
|
235
|
+
};
|
|
236
|
+
|
|
237
|
+
export declare const useHiddenBlockIds: () => [Array<string>, Function, Function];
|
|
238
|
+
|
|
239
|
+
/**
|
|
240
|
+
*
|
|
241
|
+
*/
|
|
242
|
+
export declare const useHighlightBlockId: () => [string, Function];
|
|
243
|
+
|
|
244
|
+
/**
|
|
245
|
+
* Returns the list of languages
|
|
246
|
+
*/
|
|
247
|
+
export declare const useLanguages: () => [string[], (args_0: string[] | ((prev: string[]) => string[])) => void];
|
|
248
|
+
|
|
249
|
+
export declare const useMarkAsGlobalBlock: () => (blockId: string, name: string) => Promise<void>;
|
|
250
|
+
|
|
251
|
+
export declare const useMoveBlocks: () => {};
|
|
252
|
+
|
|
253
|
+
export declare const usePasteBlocks: () => {
|
|
254
|
+
canPaste: boolean;
|
|
255
|
+
pasteBlocks: Function;
|
|
256
|
+
};
|
|
257
|
+
|
|
258
|
+
/**
|
|
259
|
+
*
|
|
260
|
+
*/
|
|
261
|
+
export declare const usePreviewMode: () => [boolean, Function];
|
|
262
|
+
|
|
263
|
+
/**
|
|
264
|
+
* Returns the primary language
|
|
265
|
+
* @returns [primaryLanguage, isPrimaryLanguage] tuple where isPrimaryLanguage is true if the primary language is the active language
|
|
266
|
+
*/
|
|
267
|
+
export declare const usePrimaryLanguage: () => [string, (args_0: string | ((prev: string) => string)) => void];
|
|
268
|
+
|
|
269
|
+
export declare const useProject: () => {
|
|
270
|
+
currentProject: unknown;
|
|
271
|
+
createProject: () => void;
|
|
272
|
+
deleteProject: () => void;
|
|
273
|
+
updateProject: () => void;
|
|
274
|
+
};
|
|
275
|
+
|
|
276
|
+
export declare const useReadOnlyMode: () => unknown;
|
|
277
|
+
|
|
278
|
+
export declare const useRemoveBlocks: () => (blockIds: Array<string>) => void;
|
|
279
|
+
|
|
280
|
+
export declare const useRemoveClassesFromBlocks: () => Function;
|
|
281
|
+
|
|
282
|
+
export declare const useSavePage: () => {
|
|
283
|
+
savePage: ThrottledFunction<() => Promise<boolean>>;
|
|
284
|
+
syncState: "UNSAVED" | "SAVED" | "SAVING";
|
|
285
|
+
setSyncState: (args_0: "UNSAVED" | "SAVED" | "SAVING" | ((prev: "UNSAVED" | "SAVED" | "SAVING") => "UNSAVED" | "SAVED" | "SAVING")) => void;
|
|
286
|
+
};
|
|
287
|
+
|
|
288
|
+
/**
|
|
289
|
+
* useSelectedBlock hook
|
|
290
|
+
*/
|
|
291
|
+
export declare const useSelectedBlock: () => string | {
|
|
292
|
+
type: string;
|
|
293
|
+
id: any[];
|
|
294
|
+
};
|
|
295
|
+
|
|
296
|
+
export declare const useSelectedBlockAllClasses: () => Array<ClassDerivedObject>;
|
|
297
|
+
|
|
298
|
+
export declare const useSelectedBlockCurrentClasses: () => Array<ClassDerivedObject>;
|
|
299
|
+
|
|
300
|
+
/**
|
|
301
|
+
*
|
|
302
|
+
*/
|
|
303
|
+
export declare const useSelectedBlockIds: () => [Array<string>, Function, Function];
|
|
304
|
+
|
|
305
|
+
/**
|
|
306
|
+
* Hook to get selected block ids
|
|
307
|
+
*/
|
|
308
|
+
export declare const useSelectedBlocksDisplayChild: () => {
|
|
309
|
+
flexChild: boolean;
|
|
310
|
+
gridChild: boolean;
|
|
311
|
+
};
|
|
312
|
+
|
|
313
|
+
export declare const useSelectedBreakpoints: () => [string[], Function];
|
|
314
|
+
|
|
315
|
+
/**
|
|
316
|
+
*
|
|
317
|
+
*/
|
|
318
|
+
export declare const useSelectedStylingBlocks: () => [TStyleBlock[], (args_0: TStyleBlock[] | ((prev: TStyleBlock[]) => TStyleBlock[])) => void];
|
|
319
|
+
|
|
320
|
+
export declare const useSetAllBlocks: () => [Function];
|
|
321
|
+
|
|
322
|
+
export declare const useStylingBreakpoint: () => [string, (args_0: string | typeof RESET | ((prev: string) => string | typeof RESET)) => void];
|
|
323
|
+
|
|
324
|
+
export declare const useStylingState: () => [unknown, (...args: unknown[]) => unknown];
|
|
325
|
+
|
|
326
|
+
export { useTranslation }
|
|
327
|
+
|
|
328
|
+
export declare const useTranslations: () => ({
|
|
329
|
+
[key: string]: TBlockTranslation;
|
|
330
|
+
} | ((lang: string, path: string, value: any) => void))[];
|
|
331
|
+
|
|
332
|
+
/**
|
|
333
|
+
* useTreeData hook
|
|
334
|
+
*/
|
|
335
|
+
export declare const useTreeData: () => [Array<any>, Function];
|
|
336
|
+
|
|
337
|
+
export declare const useUILibraryBlocks: () => {
|
|
338
|
+
data: any[];
|
|
339
|
+
isLoading: boolean;
|
|
340
|
+
};
|
|
341
|
+
|
|
342
|
+
/**
|
|
343
|
+
*
|
|
344
|
+
*/
|
|
345
|
+
export declare const useUpdateBlocksProps: () => (blockIds: Array<string>, props: {
|
|
346
|
+
string: any;
|
|
347
|
+
}) => void;
|
|
348
|
+
|
|
349
|
+
export declare const useUpdateBlocksPropsRealtime: () => (blockIds: Array<string>, props: {
|
|
350
|
+
string: any;
|
|
351
|
+
}) => void;
|
|
352
|
+
|
|
353
|
+
export { }
|
package/dist/core.js
ADDED
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { X as M, W as h, V as L, D as R, _ as b, aa as f, O as x, ab as H, H as T, y as U, ae as w, w as O, Y as j, $ as F, c as G, e as W, k as Z, n as q, a0 as J, m as K, d as N, a1 as V, l as X, j as Y, a2 as _, N as $, x as z, ad as E, U as Q, a3 as ss, o as es, p as as, ac as os, a4 as ts, Z as us, q as ls, I as rs, u as is, A as ps, a6 as cs, K as ds, h as Bs, L as ms, f as ks, i as ns, g as gs, a7 as Ss, J as Cs, a5 as Ps, a8 as vs, R as ys, a9 as As, C as Ds } from "./index-cdd49c4c.js";
|
|
2
|
+
import { u as Ms } from "./useBuilderProp-81a14920.js";
|
|
3
|
+
import { useTranslation as Ls } from "react-i18next";
|
|
4
|
+
import "./jsx-runtime-944c88e2.js";
|
|
5
|
+
import "react";
|
|
6
|
+
import "i18next";
|
|
7
|
+
import "flagged";
|
|
8
|
+
import "react-dnd";
|
|
9
|
+
import "lodash";
|
|
10
|
+
import "@minoru/react-dnd-treeview";
|
|
11
|
+
import "jotai";
|
|
12
|
+
import "./utils-ac68b2c8.js";
|
|
13
|
+
import "clsx";
|
|
14
|
+
import "tailwind-merge";
|
|
15
|
+
import "react-hotkeys-hook";
|
|
16
|
+
import "flat-to-nested";
|
|
17
|
+
import "./Class-e6b07b79.js";
|
|
18
|
+
import "redux-undo";
|
|
19
|
+
import "@react-hookz/web";
|
|
20
|
+
import "chaibuilder-blocks";
|
|
21
|
+
import "./CONTROLS-442caee5.js";
|
|
22
|
+
import "@radix-ui/react-slot";
|
|
23
|
+
import "class-variance-authority";
|
|
24
|
+
import "@radix-ui/react-tooltip";
|
|
25
|
+
import "@radix-ui/react-icons";
|
|
26
|
+
import "@radix-ui/react-toast";
|
|
27
|
+
export {
|
|
28
|
+
M as ChaiBuilderStudio,
|
|
29
|
+
h as enableStyling,
|
|
30
|
+
L as setBlockProps,
|
|
31
|
+
R as useActiveLanguage,
|
|
32
|
+
b as useActiveModal,
|
|
33
|
+
f as useActivePanel,
|
|
34
|
+
x as useAddBlock,
|
|
35
|
+
H as useAddBlockParent,
|
|
36
|
+
T as useAddClassesToBlocks,
|
|
37
|
+
U as useAllBlocks,
|
|
38
|
+
w as useBlockContentByLanguage,
|
|
39
|
+
O as useBrandingOptions,
|
|
40
|
+
Ms as useBuilderProp,
|
|
41
|
+
j as useBuilderReset,
|
|
42
|
+
F as useBuildingBlocks,
|
|
43
|
+
G as useCanvasHistory,
|
|
44
|
+
W as useCanvasWidth,
|
|
45
|
+
Z as useCanvasZoom,
|
|
46
|
+
q as useCopyBlockIds,
|
|
47
|
+
J as useCurrentPage,
|
|
48
|
+
K as useCutBlockIds,
|
|
49
|
+
N as useDarkMode,
|
|
50
|
+
V as useDeveloperPreviewMode,
|
|
51
|
+
X as useDuplicateBlocks,
|
|
52
|
+
Y as useFeatureSupport,
|
|
53
|
+
_ as useGetPageData,
|
|
54
|
+
$ as useHiddenBlockIds,
|
|
55
|
+
z as useHighlightBlockId,
|
|
56
|
+
E as useLanguages,
|
|
57
|
+
Q as useMarkAsGlobalBlock,
|
|
58
|
+
ss as useMoveBlocks,
|
|
59
|
+
es as usePasteBlocks,
|
|
60
|
+
as as usePreviewMode,
|
|
61
|
+
os as usePrimaryLanguage,
|
|
62
|
+
ts as useProject,
|
|
63
|
+
us as useReadOnlyMode,
|
|
64
|
+
ls as useRemoveBlocks,
|
|
65
|
+
rs as useRemoveClassesFromBlocks,
|
|
66
|
+
is as useSavePage,
|
|
67
|
+
ps as useSelectedBlock,
|
|
68
|
+
cs as useSelectedBlockAllClasses,
|
|
69
|
+
ds as useSelectedBlockCurrentClasses,
|
|
70
|
+
Bs as useSelectedBlockIds,
|
|
71
|
+
ms as useSelectedBlocksDisplayChild,
|
|
72
|
+
ks as useSelectedBreakpoints,
|
|
73
|
+
ns as useSelectedStylingBlocks,
|
|
74
|
+
gs as useSetAllBlocks,
|
|
75
|
+
Ss as useStylingBreakpoint,
|
|
76
|
+
Cs as useStylingState,
|
|
77
|
+
Ls as useTranslation,
|
|
78
|
+
Ps as useTranslations,
|
|
79
|
+
vs as useTreeData,
|
|
80
|
+
ys as useUILibraryBlocks,
|
|
81
|
+
As as useUpdateBlocksProps,
|
|
82
|
+
Ds as useUpdateBlocksPropsRealtime
|
|
83
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const o=require("./jsx-runtime-5c3ac4f7.cjs"),f=require("react"),j=require("@radix-ui/react-dialog"),y=require("@radix-ui/react-icons"),n=require("./utils-3c452dd0.cjs");function l(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const s in e)if(s!=="default"){const i=Object.getOwnPropertyDescriptor(e,s);Object.defineProperty(t,s,i.get?i:{enumerable:!0,get:()=>e[s]})}}return t.default=e,Object.freeze(t)}const r=l(f),a=l(j),D=a.Root,N=a.Trigger,c=({className:e,...t})=>o.jsxRuntimeExports.jsx(a.Portal,{className:n.cn(e),...t});c.displayName=a.Portal.displayName;const d=r.forwardRef(({className:e,...t},s)=>o.jsxRuntimeExports.jsx(a.Overlay,{ref:s,className:n.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}));d.displayName=a.Overlay.displayName;const m=r.forwardRef(({className:e,children:t,...s},i)=>o.jsxRuntimeExports.jsxs(c,{children:[o.jsxRuntimeExports.jsx(d,{}),o.jsxRuntimeExports.jsxs(a.Content,{ref:i,className:n.cn("fixed left-[50%] top-[50%] z-[999] 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),...s,children:[t,o.jsxRuntimeExports.jsxs(a.Close,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[o.jsxRuntimeExports.jsx(y.Cross2Icon,{className:"h-4 w-4"}),o.jsxRuntimeExports.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));m.displayName=a.Content.displayName;const p=({className:e,...t})=>o.jsxRuntimeExports.jsx("div",{className:n.cn("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});p.displayName="DialogHeader";const u=({className:e,...t})=>o.jsxRuntimeExports.jsx("div",{className:n.cn("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});u.displayName="DialogFooter";const x=r.forwardRef(({className:e,...t},s)=>o.jsxRuntimeExports.jsx(a.Title,{ref:s,className:n.cn("text-lg font-semibold leading-none tracking-tight",e),...t}));x.displayName=a.Title.displayName;const g=r.forwardRef(({className:e,...t},s)=>o.jsxRuntimeExports.jsx(a.Description,{ref:s,className:n.cn("text-sm text-muted-foreground",e),...t}));g.displayName=a.Description.displayName;exports.Dialog=D;exports.DialogContent=m;exports.DialogDescription=g;exports.DialogFooter=u;exports.DialogHeader=p;exports.DialogTitle=x;exports.DialogTrigger=N;
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { j as s } from "./jsx-runtime-944c88e2.js";
|
|
2
|
+
import * as l from "react";
|
|
3
|
+
import * as t from "@radix-ui/react-dialog";
|
|
4
|
+
import { Cross2Icon as c } from "@radix-ui/react-icons";
|
|
5
|
+
import { c as i } from "./utils-ac68b2c8.js";
|
|
6
|
+
const j = t.Root, D = t.Trigger, d = ({ className: a, ...e }) => /* @__PURE__ */ s.jsx(t.Portal, { className: i(a), ...e });
|
|
7
|
+
d.displayName = t.Portal.displayName;
|
|
8
|
+
const n = l.forwardRef(({ className: a, ...e }, o) => /* @__PURE__ */ s.jsx(
|
|
9
|
+
t.Overlay,
|
|
10
|
+
{
|
|
11
|
+
ref: o,
|
|
12
|
+
className: i(
|
|
13
|
+
"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",
|
|
14
|
+
a
|
|
15
|
+
),
|
|
16
|
+
...e
|
|
17
|
+
}
|
|
18
|
+
));
|
|
19
|
+
n.displayName = t.Overlay.displayName;
|
|
20
|
+
const m = l.forwardRef(({ className: a, children: e, ...o }, r) => /* @__PURE__ */ s.jsxs(d, { children: [
|
|
21
|
+
/* @__PURE__ */ s.jsx(n, {}),
|
|
22
|
+
/* @__PURE__ */ s.jsxs(
|
|
23
|
+
t.Content,
|
|
24
|
+
{
|
|
25
|
+
ref: r,
|
|
26
|
+
className: i(
|
|
27
|
+
"fixed left-[50%] top-[50%] z-[999] 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
|
+
...o,
|
|
31
|
+
children: [
|
|
32
|
+
e,
|
|
33
|
+
/* @__PURE__ */ s.jsxs(t.Close, { className: "absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground", children: [
|
|
34
|
+
/* @__PURE__ */ s.jsx(c, { className: "h-4 w-4" }),
|
|
35
|
+
/* @__PURE__ */ s.jsx("span", { className: "sr-only", children: "Close" })
|
|
36
|
+
] })
|
|
37
|
+
]
|
|
38
|
+
}
|
|
39
|
+
)
|
|
40
|
+
] }));
|
|
41
|
+
m.displayName = t.Content.displayName;
|
|
42
|
+
const f = ({ className: a, ...e }) => /* @__PURE__ */ s.jsx("div", { className: i("flex flex-col space-y-1.5 text-center sm:text-left", a), ...e });
|
|
43
|
+
f.displayName = "DialogHeader";
|
|
44
|
+
const p = ({ className: a, ...e }) => /* @__PURE__ */ s.jsx("div", { className: i("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2", a), ...e });
|
|
45
|
+
p.displayName = "DialogFooter";
|
|
46
|
+
const g = l.forwardRef(({ className: a, ...e }, o) => /* @__PURE__ */ s.jsx(
|
|
47
|
+
t.Title,
|
|
48
|
+
{
|
|
49
|
+
ref: o,
|
|
50
|
+
className: i("text-lg font-semibold leading-none tracking-tight", a),
|
|
51
|
+
...e
|
|
52
|
+
}
|
|
53
|
+
));
|
|
54
|
+
g.displayName = t.Title.displayName;
|
|
55
|
+
const x = l.forwardRef(({ className: a, ...e }, o) => /* @__PURE__ */ s.jsx(t.Description, { ref: o, className: i("text-sm text-muted-foreground", a), ...e }));
|
|
56
|
+
x.displayName = t.Description.displayName;
|
|
57
|
+
export {
|
|
58
|
+
j as D,
|
|
59
|
+
m as a,
|
|
60
|
+
D as b,
|
|
61
|
+
f as c,
|
|
62
|
+
p as d,
|
|
63
|
+
g as e,
|
|
64
|
+
x as f
|
|
65
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const a=require("./jsx-runtime-5c3ac4f7.cjs"),z=require("@radix-ui/react-switch"),H=require("react"),n=require("./utils-3c452dd0.cjs"),_=require("@radix-ui/react-alert-dialog"),x=require("./useBuilderProp-5e57d0c8.cjs"),q=require("@radix-ui/react-hover-card"),O=require("@radix-ui/react-dropdown-menu"),u=require("@radix-ui/react-icons");function c(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const o in e)if(o!=="default"){const r=Object.getOwnPropertyDescriptor(e,o);Object.defineProperty(t,o,r.get?r:{enumerable:!0,get:()=>e[o]})}}return t.default=e,Object.freeze(t)}const p=c(z),i=c(H),d=c(_),m=c(q),s=c(O),f=i.forwardRef(({className:e,...t},o)=>a.jsxRuntimeExports.jsx(p.Root,{className:n.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:o,children:a.jsxRuntimeExports.jsx(p.Thumb,{className:n.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")})}));f.displayName=p.Root.displayName;const G=d.Root,F=d.Trigger,g=({className:e,...t})=>a.jsxRuntimeExports.jsx(d.Portal,{className:n.cn(e),...t});g.displayName=d.Portal.displayName;const b=i.forwardRef(({className:e,...t},o)=>a.jsxRuntimeExports.jsx(d.Overlay,{className:n.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:o}));b.displayName=d.Overlay.displayName;const w=i.forwardRef(({className:e,...t},o)=>a.jsxRuntimeExports.jsxs(g,{children:[a.jsxRuntimeExports.jsx(b,{}),a.jsxRuntimeExports.jsx(d.Content,{ref:o,className:n.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})]}));w.displayName=d.Content.displayName;const j=({className:e,...t})=>a.jsxRuntimeExports.jsx("div",{className:n.cn("flex flex-col space-y-2 text-center sm:text-left",e),...t});j.displayName="AlertDialogHeader";const D=({className:e,...t})=>a.jsxRuntimeExports.jsx("div",{className:n.cn("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});D.displayName="AlertDialogFooter";const N=i.forwardRef(({className:e,...t},o)=>a.jsxRuntimeExports.jsx(d.Title,{ref:o,className:n.cn("text-lg font-semibold",e),...t}));N.displayName=d.Title.displayName;const R=i.forwardRef(({className:e,...t},o)=>a.jsxRuntimeExports.jsx(d.Description,{ref:o,className:n.cn("text-sm text-muted-foreground",e),...t}));R.displayName=d.Description.displayName;const y=i.forwardRef(({className:e,...t},o)=>a.jsxRuntimeExports.jsx(d.Action,{ref:o,className:n.cn(x.buttonVariants(),e),...t}));y.displayName=d.Action.displayName;const h=i.forwardRef(({className:e,...t},o)=>a.jsxRuntimeExports.jsx(d.Cancel,{ref:o,className:n.cn(x.buttonVariants({variant:"outline"}),"mt-2 sm:mt-0",e),...t}));h.displayName=d.Cancel.displayName;const L=m.Root,V=m.Trigger,v=i.forwardRef(({className:e,align:t="center",sideOffset:o=4,...r},l)=>a.jsxRuntimeExports.jsx(m.Content,{ref:l,align:t,sideOffset:o,className:n.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),...r}));v.displayName=m.Content.displayName;const B=s.Root,J=s.Trigger,K=s.Group,Q=s.Portal,U=s.Sub,W=s.RadioGroup,C=i.forwardRef(({className:e,inset:t,children:o,...r},l)=>a.jsxRuntimeExports.jsxs(s.SubTrigger,{ref:l,className:n.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),...r,children:[o,a.jsxRuntimeExports.jsx(u.ChevronRightIcon,{className:"ml-auto h-4 w-4"})]}));C.displayName=s.SubTrigger.displayName;const M=i.forwardRef(({className:e,...t},o)=>a.jsxRuntimeExports.jsx(s.SubContent,{ref:o,className:n.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}));M.displayName=s.SubContent.displayName;const E=i.forwardRef(({className:e,sideOffset:t=4,...o},r)=>a.jsxRuntimeExports.jsx(s.Portal,{children:a.jsxRuntimeExports.jsx(s.Content,{ref:r,sideOffset:t,className:n.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),...o})}));E.displayName=s.Content.displayName;const A=i.forwardRef(({className:e,inset:t,...o},r)=>a.jsxRuntimeExports.jsx(s.Item,{ref:r,className:n.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),...o}));A.displayName=s.Item.displayName;const S=i.forwardRef(({className:e,children:t,checked:o,...r},l)=>a.jsxRuntimeExports.jsxs(s.CheckboxItem,{ref:l,className:n.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:o,...r,children:[a.jsxRuntimeExports.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:a.jsxRuntimeExports.jsx(s.ItemIndicator,{children:a.jsxRuntimeExports.jsx(u.CheckIcon,{className:"h-4 w-4"})})}),t]}));S.displayName=s.CheckboxItem.displayName;const k=i.forwardRef(({className:e,children:t,...o},r)=>a.jsxRuntimeExports.jsxs(s.RadioItem,{ref:r,className:n.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),...o,children:[a.jsxRuntimeExports.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:a.jsxRuntimeExports.jsx(s.ItemIndicator,{children:a.jsxRuntimeExports.jsx(u.DotFilledIcon,{className:"h-4 w-4 fill-current"})})}),t]}));k.displayName=s.RadioItem.displayName;const I=i.forwardRef(({className:e,inset:t,...o},r)=>a.jsxRuntimeExports.jsx(s.Label,{ref:r,className:n.cn("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...o}));I.displayName=s.Label.displayName;const T=i.forwardRef(({className:e,...t},o)=>a.jsxRuntimeExports.jsx(s.Separator,{ref:o,className:n.cn("-mx-1 my-1 h-px bg-muted",e),...t}));T.displayName=s.Separator.displayName;const P=({className:e,...t})=>a.jsxRuntimeExports.jsx("span",{className:n.cn("ml-auto text-xs tracking-widest opacity-60",e),...t});P.displayName="DropdownMenuShortcut";exports.AlertDialog=G;exports.AlertDialogAction=y;exports.AlertDialogCancel=h;exports.AlertDialogContent=w;exports.AlertDialogDescription=R;exports.AlertDialogFooter=D;exports.AlertDialogHeader=j;exports.AlertDialogTitle=N;exports.AlertDialogTrigger=F;exports.DropdownMenu=B;exports.DropdownMenuCheckboxItem=S;exports.DropdownMenuContent=E;exports.DropdownMenuGroup=K;exports.DropdownMenuItem=A;exports.DropdownMenuLabel=I;exports.DropdownMenuPortal=Q;exports.DropdownMenuRadioGroup=W;exports.DropdownMenuRadioItem=k;exports.DropdownMenuSeparator=T;exports.DropdownMenuShortcut=P;exports.DropdownMenuSub=U;exports.DropdownMenuSubContent=M;exports.DropdownMenuSubTrigger=C;exports.DropdownMenuTrigger=J;exports.HoverCard=L;exports.HoverCardContent=v;exports.HoverCardTrigger=V;exports.Switch=f;
|