@chaibuilder/sdk 1.2.23 → 1.2.25
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 +6 -5
- package/dist/AddBlocks-Ol3iIVKa.js +207 -0
- package/dist/AddBlocks-a1c-7Ewz.cjs +1 -0
- package/dist/BrandingOptions-6rnt0UaA.cjs +1 -0
- package/dist/{BrandingOptions-eUSoIgjj.js → BrandingOptions-iTyWpwTs.js} +40 -54
- package/dist/CanvasArea-R4ogF9AT.cjs +55 -0
- package/dist/{CanvasArea-ulUy_rmB.js → CanvasArea-dZjng782.js} +340 -324
- package/dist/ChaiBuilderEditor-m30yoOgJ.cjs +163 -0
- package/dist/ChaiBuilderEditor-vP4at00I.js +27974 -0
- package/dist/{Class-lGzsNBOK.js → Class-ahc3NIbq.js} +26 -29
- package/dist/Class-eieto7e-.cjs +1 -0
- package/dist/Controls-3Cc1XYXg.js +105 -0
- package/dist/Controls-ky25Ebo3.cjs +1 -0
- package/dist/CurrentPage-3gQTH0Zt.cjs +1 -0
- package/dist/{CurrentPage-SFhXzQMy.js → CurrentPage-Kmfp-kFk.js} +41 -55
- package/dist/Functions-Hvon6AMZ.cjs +1 -0
- package/dist/Functions-NzT2Six_.js +15 -0
- package/dist/ImagesPanel-J1RlG7xG.cjs +1 -0
- package/dist/ImagesPanel-Wb0GF_NA.js +29 -0
- package/dist/ListTree-CZ-mtjZ9.cjs +1 -0
- package/dist/{ListTree-ZeVWczTF.js → ListTree-N3jeD790.js} +92 -102
- package/dist/{MODIFIERS-dytZ-osO.js → MODIFIERS-CNqNUapY.js} +10 -4
- package/dist/MODIFIERS-o1p3VnpS.cjs +1 -0
- package/dist/PagesPanel-Gi0z6gaf.cjs +1 -0
- package/dist/PagesPanel-u1IB-nRr.js +48 -0
- package/dist/ProjectPanel-EydGZmMW.js +71 -0
- package/dist/ProjectPanel-kiiljG4H.cjs +1 -0
- package/dist/{STRINGS--j49GZJP.js → STRINGS-b432aBJJ.js} +2 -2
- package/dist/Settings-8ilCSH8b.cjs +1 -0
- package/dist/{Settings-FZWm8Fc3.js → Settings-jCcd-VE6.js} +407 -401
- package/dist/SidePanels-T36C6Lhc.cjs +1 -0
- package/dist/{SidePanels-wrkkpcGE.js → SidePanels-pHMYprpW.js} +107 -117
- package/dist/Topbar-CvWQuspR.cjs +1 -0
- package/dist/Topbar-pbIDUE_B.js +122 -0
- package/dist/UnsplashImages-KBZPd9dv.cjs +1 -0
- package/dist/{UnsplashImages-eZedbK2J.js → UnsplashImages-L7x_3RQf.js} +50 -63
- package/dist/UploadImages-GkkJVAgG.cjs +1 -0
- package/dist/{UploadImages-71QziLbr.js → UploadImages-zdEJRLD8.js} +37 -60
- package/dist/accordion-oPUeqPCZ.js +42 -0
- package/dist/accordion-ynvFtV_p.cjs +1 -0
- package/dist/add-page-modal-9SGv2hgc.cjs +1 -0
- package/dist/add-page-modal-JCDXZIPW.js +95 -0
- package/dist/alert-dialog-P9xMMB6C.cjs +1 -0
- package/dist/alert-dialog-rypfO5ly.js +64 -0
- package/dist/badge-E-S7CqUt.cjs +1 -0
- package/dist/badge-tEwO7C51.js +23 -0
- package/dist/block-helpers-OKHmRRol.cjs +1 -0
- package/dist/block-helpers-oSFpSsGz.js +23 -0
- package/dist/command-BxR6jaCI.cjs +1 -0
- package/dist/command-Pn3HKDuV.js +97 -0
- package/dist/confirm-alert-uNm0lZ0y.cjs +1 -0
- package/dist/confirm-alert-wR5_VJ1l.js +36 -0
- package/dist/context-menu-8dC9uGXj.js +122 -0
- package/dist/context-menu-IgLbIuth.cjs +1 -0
- package/dist/{controls-OfJWSEqC.js → controls-IS5qnRce.js} +20 -85
- package/dist/controls-L7DPvB0m.cjs +1 -0
- package/dist/core.cjs +1 -1
- package/dist/core.d.ts +7 -4
- package/dist/core.js +150 -75
- package/dist/{defaultTheme-D8B4-wHO.js → defaultTheme-4kA60XdB.js} +6 -8
- package/dist/defaultTheme-mrkeGFGI.cjs +1 -0
- package/dist/delete-page-modal-7KmP1elv.js +67 -0
- package/dist/delete-page-modal-SgfwvfNu.cjs +1 -0
- package/dist/dropdown-menu-El86_9Uo.js +124 -0
- package/dist/dropdown-menu-SiHzqWwZ.cjs +1 -0
- package/dist/email-blocks.cjs +1 -1
- package/dist/email-blocks.js +3 -292
- package/dist/email.cjs +1 -1
- package/dist/email.d.ts +5 -2
- package/dist/email.js +18 -37
- package/dist/{form-zKUMQFuB.js → form-0_RLz2TB.js} +12 -12
- package/dist/form-W58AVUdf.cjs +1 -0
- package/dist/hover-card-KUwpDkW8.cjs +1 -0
- package/dist/hover-card-q138xxXR.js +45 -0
- package/dist/{html-to-json-ngX9ef2u.js → html-to-json-2xtb7520.js} +41 -41
- package/dist/{html-to-json-efmv1pCj.cjs → html-to-json-uSnxl72F.cjs} +1 -1
- package/dist/iconBase-gbUAAO2L.cjs +1 -0
- package/dist/iconBase-h4DuR_XT.js +63 -0
- package/dist/index-9MmykVSc.cjs +1 -0
- package/dist/index-hElOGcFr.js +2200 -0
- package/dist/index-lDTsQp7h.js +188 -0
- package/dist/index-rq5Y9ZDy.cjs +1 -0
- package/dist/jsx-runtime-JYMCiFoE.cjs +27 -0
- package/dist/{jsx-runtime-WbnYoNE9.js → jsx-runtime-Sp0orL4X.js} +106 -109
- package/dist/label-KaP7MRrs.js +10 -0
- package/dist/label-tFm8HZdb.cjs +1 -0
- package/dist/lib.cjs +2 -2
- package/dist/lib.js +62 -66
- package/dist/link-WbcKdQ9k.cjs +1 -0
- package/dist/link-xuhP-4dN.js +196 -0
- package/dist/page-viewer-Hx5hxHKm.cjs +1 -0
- package/dist/{page-viewer-7AwzWRtB.js → page-viewer-NnOwmAmu.js} +44 -58
- package/dist/popover-a84pbVhQ.js +23 -0
- package/dist/popover-fKjgcRUx.cjs +1 -0
- package/dist/{project-general-setting-pYPoqvqd.js → project-general-setting-9ju3TDju.js} +35 -43
- package/dist/project-general-setting-FxkwjvJz.cjs +1 -0
- package/dist/{project-seo-setting-zXKOcjep.js → project-seo-setting-36CdUszM.js} +23 -40
- package/dist/project-seo-setting-RU7qiXxb.cjs +1 -0
- package/dist/render.cjs +1 -1
- package/dist/render.js +13 -14
- package/dist/scroll-area-FiHvy-TZ.cjs +1 -0
- package/dist/scroll-area-ewXbxc3n.js +30 -0
- package/dist/select-7bjg-rr9.cjs +1 -0
- package/dist/select-POGdEDHT.js +75 -0
- package/dist/separator-3Civ-6hb.cjs +1 -0
- package/dist/separator-SctTn0Qi.js +18 -0
- package/dist/single-page-detail-beY0MT1b.cjs +1 -0
- package/dist/{single-page-detail-q2TDxN-P.js → single-page-detail-hD1jKZ8k.js} +65 -73
- package/dist/skeleton-STeL9VrJ.cjs +1 -0
- package/dist/skeleton-lu8e7q2y.js +239 -0
- package/dist/studio.cjs +1 -1
- package/dist/studio.d.ts +5 -2
- package/dist/studio.js +24 -40
- package/dist/tabs-_4WbA1cc.cjs +1 -0
- package/dist/tabs-yQ3oGziM.js +106 -0
- package/dist/textarea-1kZEh7ki.cjs +1 -0
- package/dist/textarea-b2QvVhrK.js +73 -0
- package/dist/ui.cjs +1 -1
- package/dist/ui.js +364 -159
- package/dist/useAddBlock-8pxOEYIl.cjs +1 -0
- package/dist/useAddBlock-FEKFJNwQ.js +69 -0
- package/dist/useChaiExternalData-fkFgoS80.js +6 -0
- package/dist/useChaiExternalData-rwoAZ6uU.cjs +1 -0
- package/dist/useDarkMode-7i57segK.cjs +1 -0
- package/dist/useDarkMode-8VHJlYyE.js +23 -0
- package/dist/useSelectedBreakpoints-6NK5qd7T.js +10 -0
- package/dist/useSelectedBreakpoints-7ONXb-vN.cjs +1 -0
- package/dist/useStylingState-Iuj84yvc.js +186 -0
- package/dist/useStylingState-OIvJMV6p.cjs +1 -0
- package/dist/useUiLibraries-nCdauJ4N.cjs +1 -0
- package/dist/useUiLibraries-psyWFbNc.js +12 -0
- package/dist/useUpdateBlocksProps-Unn8lUyj.cjs +1 -0
- package/dist/useUpdateBlocksProps-vWcDp-P9.js +23 -0
- package/dist/utils-dze1SGvB.js +6 -0
- package/dist/utils-qK_SjzzV.cjs +1 -0
- package/dist/web-blocks.cjs +1 -6
- package/dist/web-blocks.js +3 -1153
- package/package.json +1 -1
- package/dist/AddBlocks-b0Vk6eqO.js +0 -206
- package/dist/AddBlocks-bgu08YJC.cjs +0 -1
- package/dist/BrandingOptions-AljW1cXz.cjs +0 -1
- package/dist/CanvasArea-dp1tzDkK.cjs +0 -55
- package/dist/Class-PoYusiA5.cjs +0 -1
- package/dist/CurrentPage-rWHgPomd.cjs +0 -1
- package/dist/Functions-7jnEwJyw.js +0 -15
- package/dist/Functions-N3yhPYKY.cjs +0 -1
- package/dist/ListTree-5n8U4-IF.cjs +0 -1
- package/dist/MODIFIERS-0g14w5RS.cjs +0 -1
- package/dist/PagesPanel-IkZjy0Gn.js +0 -64
- package/dist/PagesPanel-sBN51kKZ.cjs +0 -1
- package/dist/ProjectPanel-e98TJLfI.js +0 -85
- package/dist/ProjectPanel-lbQH31jc.cjs +0 -1
- package/dist/Settings-qytQoyTv.cjs +0 -1
- package/dist/SidePanels-YRIM1IPq.cjs +0 -1
- package/dist/Topbar-LUyDFBkK.js +0 -129
- package/dist/Topbar-NOSnWo7V.cjs +0 -1
- package/dist/UnsplashImages-f-ObKOC-.cjs +0 -1
- package/dist/UploadImages-oOnccvT9.cjs +0 -1
- package/dist/_commonjsHelpers-UyOWmZb0.js +0 -8
- package/dist/_commonjsHelpers-wDK0ZLPo.cjs +0 -1
- package/dist/add-page-modal-g3fd00P5.cjs +0 -1
- package/dist/add-page-modal-yQ6qL6Ui.js +0 -104
- package/dist/confirm-alert-3flAvzWH.js +0 -60
- package/dist/confirm-alert-LQsGNYz8.cjs +0 -1
- package/dist/controls-KK2oLIa8.cjs +0 -1
- package/dist/defaultTheme-7VqqhOcp.cjs +0 -1
- package/dist/delete-page-modal-iMmkPec0.js +0 -83
- package/dist/delete-page-modal-tzZmqGzE.cjs +0 -1
- package/dist/empty-slot-ZBlsQi6m.js +0 -15
- package/dist/empty-slot-nzYOgZuS.cjs +0 -1
- package/dist/form-LBHtTduy.cjs +0 -1
- package/dist/index--dUsFH1I.cjs +0 -1
- package/dist/index-HD1UKc4P.js +0 -3079
- package/dist/index-YpnaudSM.js +0 -63
- package/dist/index-bOWwCMRF.cjs +0 -206
- package/dist/index-e0c8PmRQ.js +0 -205
- package/dist/index-ecnGWzh9.cjs +0 -1
- package/dist/index-fvMaxES9.cjs +0 -1
- package/dist/index-gi1LIOCw.cjs +0 -1
- package/dist/index-m4WGov7e.js +0 -2202
- package/dist/index-uLtBNl55.js +0 -39503
- package/dist/jsx-runtime-Z_BpKhVy.cjs +0 -27
- package/dist/page-viewer-5gTszT-n.cjs +0 -1
- package/dist/project-general-setting-52CTYL_w.cjs +0 -1
- package/dist/project-seo-setting-jTweI1DX.cjs +0 -1
- package/dist/single-page-detail-jy2SPcp1.cjs +0 -1
package/dist/ui.js
CHANGED
|
@@ -1,178 +1,383 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import "react";
|
|
3
|
-
import "
|
|
4
|
-
import "
|
|
1
|
+
import { j as a } from "./jsx-runtime-Sp0orL4X.js";
|
|
2
|
+
import * as i from "react";
|
|
3
|
+
import * as m from "@radix-ui/react-toggle";
|
|
4
|
+
import { cva as c } from "class-variance-authority";
|
|
5
|
+
import { c as r } from "./utils-dze1SGvB.js";
|
|
6
|
+
import { H as we, b as Me, a as ve, S as Te } from "./hover-card-q138xxXR.js";
|
|
7
|
+
import { B as je, S as Re, g as Ie, T as Ae, c as ke, e as Pe, d as Le, a as ze, b as Fe, r as Ge, t as He, f as Ve } from "./skeleton-lu8e7q2y.js";
|
|
8
|
+
import { A as Ee, c as Oe, a as qe, b as Je } from "./accordion-oPUeqPCZ.js";
|
|
9
|
+
import { A as Qe, b as Ue, a as We, C as Xe, g as Ye, f as Ze, d as _e, c as $e, e as et, T as tt } from "./textarea-b2QvVhrK.js";
|
|
10
|
+
import { B as ot, b as st } from "./badge-tEwO7C51.js";
|
|
11
|
+
import { A as nt, g as it, h as dt, b as lt, f as mt, d as ct, c as pt, e as ut, a as ft } from "./alert-dialog-rypfO5ly.js";
|
|
12
|
+
import { D as xt, b as bt, f as ht, d as Ct, c as yt, e as Nt, a as St, T as wt, i as Mt, g as vt, h as Tt } from "./tabs-yQ3oGziM.js";
|
|
13
|
+
import { C as jt, a as Rt, d as It, e as At, b as kt, f as Pt, c as Lt, h as zt, g as Ft, I as Gt } from "./command-Pn3HKDuV.js";
|
|
14
|
+
import { L as Vt } from "./label-KaP7MRrs.js";
|
|
15
|
+
import { S as Et, a as Ot } from "./scroll-area-ewXbxc3n.js";
|
|
16
|
+
import { P as Jt, b as Kt, a as Qt } from "./popover-a84pbVhQ.js";
|
|
17
|
+
import { ChevronRightIcon as g, CheckIcon as x, DotFilledIcon as b, Cross2Icon as h } from "@radix-ui/react-icons";
|
|
18
|
+
import * as s from "@radix-ui/react-menubar";
|
|
19
|
+
import { S as Wt, d as Xt, a as Yt, f as Zt, e as _t, g as $t, c as ea, b as ta } from "./select-POGdEDHT.js";
|
|
20
|
+
import * as d from "@radix-ui/react-dialog";
|
|
21
|
+
import { D as oa, d as sa, b as ra, i as na, c as ia, f as da, j as la, n as ma, e as ca, g as pa, h as ua, k as fa, l as ga, m as xa, a as ba } from "./dropdown-menu-El86_9Uo.js";
|
|
22
|
+
import { S as Ca } from "./separator-SctTn0Qi.js";
|
|
23
|
+
import { C as Na, d as Sa, b as wa, i as Ma, c as va, f as Ta, j as Da, n as ja, e as Ra, g as Ia, h as Aa, k as ka, l as Pa, m as La, a as za } from "./context-menu-8dC9uGXj.js";
|
|
24
|
+
import { I as Ga, a as Ha, L as Va, R as Ba } from "./link-xuhP-4dN.js";
|
|
5
25
|
import "clsx";
|
|
6
26
|
import "tailwind-merge";
|
|
7
|
-
import "@chaibuilder/runtime";
|
|
8
|
-
import "jotai";
|
|
9
|
-
import "./STRINGS--j49GZJP.js";
|
|
10
|
-
import "./_commonjsHelpers-UyOWmZb0.js";
|
|
11
|
-
import "@react-hookz/web";
|
|
12
|
-
import "./MODIFIERS-dytZ-osO.js";
|
|
13
|
-
import "./jsx-runtime-WbnYoNE9.js";
|
|
14
|
-
import "@radix-ui/react-toggle";
|
|
15
|
-
import "class-variance-authority";
|
|
16
|
-
import "./Class-lGzsNBOK.js";
|
|
17
27
|
import "@radix-ui/react-switch";
|
|
28
|
+
import "@radix-ui/react-hover-card";
|
|
29
|
+
import "jotai";
|
|
30
|
+
import "lodash-es";
|
|
18
31
|
import "@radix-ui/react-slot";
|
|
32
|
+
import "@radix-ui/react-tooltip";
|
|
33
|
+
import "@radix-ui/react-toast";
|
|
19
34
|
import "@radix-ui/react-accordion";
|
|
20
|
-
import "@radix-ui/react-icons";
|
|
21
35
|
import "@radix-ui/react-alert-dialog";
|
|
22
|
-
import "@radix-ui/react-
|
|
36
|
+
import "@radix-ui/react-tabs";
|
|
37
|
+
import "cmdk";
|
|
23
38
|
import "@radix-ui/react-label";
|
|
24
39
|
import "@radix-ui/react-scroll-area";
|
|
25
|
-
import "@radix-ui/react-tabs";
|
|
26
|
-
import "@radix-ui/react-tooltip";
|
|
27
40
|
import "@radix-ui/react-popover";
|
|
28
|
-
import "@radix-ui/react-menubar";
|
|
29
|
-
import "@radix-ui/react-hover-card";
|
|
30
41
|
import "@radix-ui/react-select";
|
|
31
42
|
import "@radix-ui/react-dropdown-menu";
|
|
32
43
|
import "@radix-ui/react-separator";
|
|
33
|
-
import "@radix-ui/react-toast";
|
|
34
|
-
import "cmdk";
|
|
35
44
|
import "@radix-ui/react-context-menu";
|
|
36
45
|
import "react-icons-picker";
|
|
37
46
|
import "react-dom";
|
|
47
|
+
import "./ImagesPanel-Wb0GF_NA.js";
|
|
38
48
|
import "react-quill";
|
|
39
49
|
import "react-i18next";
|
|
50
|
+
const C = c(
|
|
51
|
+
"inline-flex items-center justify-center rounded-md text-sm font-medium ring-offset-background transition-colors hover:bg-muted hover:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground",
|
|
52
|
+
{
|
|
53
|
+
variants: {
|
|
54
|
+
variant: {
|
|
55
|
+
default: "bg-transparent",
|
|
56
|
+
outline: "border border-input bg-transparent hover:bg-accent hover:text-accent-foreground"
|
|
57
|
+
},
|
|
58
|
+
size: {
|
|
59
|
+
default: "h-10 px-3",
|
|
60
|
+
sm: "h-9 px-2.5",
|
|
61
|
+
lg: "h-11 px-5"
|
|
62
|
+
}
|
|
63
|
+
},
|
|
64
|
+
defaultVariants: {
|
|
65
|
+
variant: "default",
|
|
66
|
+
size: "default"
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
), y = i.forwardRef(({ className: e, variant: t, size: o, ...n }, l) => /* @__PURE__ */ a.jsx(m.Root, { ref: l, className: r(C({ variant: t, size: o, className: e })), ...n }));
|
|
70
|
+
y.displayName = m.Root.displayName;
|
|
71
|
+
const ue = s.Menu, fe = s.Group, ge = s.Portal, xe = s.Sub, be = s.RadioGroup, N = i.forwardRef(({ className: e, ...t }, o) => /* @__PURE__ */ a.jsx(
|
|
72
|
+
s.Root,
|
|
73
|
+
{
|
|
74
|
+
ref: o,
|
|
75
|
+
className: r("flex h-9 items-center space-x-1 rounded-md border bg-background p-1 shadow-sm", e),
|
|
76
|
+
...t
|
|
77
|
+
}
|
|
78
|
+
));
|
|
79
|
+
N.displayName = s.Root.displayName;
|
|
80
|
+
const S = i.forwardRef(({ className: e, ...t }, o) => /* @__PURE__ */ a.jsx(
|
|
81
|
+
s.Trigger,
|
|
82
|
+
{
|
|
83
|
+
ref: o,
|
|
84
|
+
className: r(
|
|
85
|
+
"flex cursor-default select-none items-center rounded-sm px-3 py-1 text-sm font-medium outline-none focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground",
|
|
86
|
+
e
|
|
87
|
+
),
|
|
88
|
+
...t
|
|
89
|
+
}
|
|
90
|
+
));
|
|
91
|
+
S.displayName = s.Trigger.displayName;
|
|
92
|
+
const w = i.forwardRef(({ className: e, inset: t, children: o, ...n }, l) => /* @__PURE__ */ a.jsxs(
|
|
93
|
+
s.SubTrigger,
|
|
94
|
+
{
|
|
95
|
+
ref: l,
|
|
96
|
+
className: r(
|
|
97
|
+
"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",
|
|
98
|
+
t && "pl-8",
|
|
99
|
+
e
|
|
100
|
+
),
|
|
101
|
+
...n,
|
|
102
|
+
children: [
|
|
103
|
+
o,
|
|
104
|
+
/* @__PURE__ */ a.jsx(g, { className: "ml-auto h-4 w-4" })
|
|
105
|
+
]
|
|
106
|
+
}
|
|
107
|
+
));
|
|
108
|
+
w.displayName = s.SubTrigger.displayName;
|
|
109
|
+
const M = i.forwardRef(({ className: e, ...t }, o) => /* @__PURE__ */ a.jsx(
|
|
110
|
+
s.SubContent,
|
|
111
|
+
{
|
|
112
|
+
ref: o,
|
|
113
|
+
className: r(
|
|
114
|
+
"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",
|
|
115
|
+
e
|
|
116
|
+
),
|
|
117
|
+
...t
|
|
118
|
+
}
|
|
119
|
+
));
|
|
120
|
+
M.displayName = s.SubContent.displayName;
|
|
121
|
+
const v = i.forwardRef(({ className: e, align: t = "start", alignOffset: o = -4, sideOffset: n = 8, ...l }, f) => /* @__PURE__ */ a.jsx(s.Portal, { children: /* @__PURE__ */ a.jsx(
|
|
122
|
+
s.Content,
|
|
123
|
+
{
|
|
124
|
+
ref: f,
|
|
125
|
+
align: t,
|
|
126
|
+
alignOffset: o,
|
|
127
|
+
sideOffset: n,
|
|
128
|
+
className: r(
|
|
129
|
+
"z-50 min-w-[12rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in 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",
|
|
130
|
+
e
|
|
131
|
+
),
|
|
132
|
+
...l
|
|
133
|
+
}
|
|
134
|
+
) }));
|
|
135
|
+
v.displayName = s.Content.displayName;
|
|
136
|
+
const T = i.forwardRef(({ className: e, inset: t, ...o }, n) => /* @__PURE__ */ a.jsx(
|
|
137
|
+
s.Item,
|
|
138
|
+
{
|
|
139
|
+
ref: n,
|
|
140
|
+
className: r(
|
|
141
|
+
"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",
|
|
142
|
+
t && "pl-8",
|
|
143
|
+
e
|
|
144
|
+
),
|
|
145
|
+
...o
|
|
146
|
+
}
|
|
147
|
+
));
|
|
148
|
+
T.displayName = s.Item.displayName;
|
|
149
|
+
const D = i.forwardRef(({ className: e, children: t, checked: o, ...n }, l) => /* @__PURE__ */ a.jsxs(
|
|
150
|
+
s.CheckboxItem,
|
|
151
|
+
{
|
|
152
|
+
ref: l,
|
|
153
|
+
className: r(
|
|
154
|
+
"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",
|
|
155
|
+
e
|
|
156
|
+
),
|
|
157
|
+
checked: o,
|
|
158
|
+
...n,
|
|
159
|
+
children: [
|
|
160
|
+
/* @__PURE__ */ a.jsx("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ a.jsx(s.ItemIndicator, { children: /* @__PURE__ */ a.jsx(x, { className: "h-4 w-4" }) }) }),
|
|
161
|
+
t
|
|
162
|
+
]
|
|
163
|
+
}
|
|
164
|
+
));
|
|
165
|
+
D.displayName = s.CheckboxItem.displayName;
|
|
166
|
+
const j = i.forwardRef(({ className: e, children: t, ...o }, n) => /* @__PURE__ */ a.jsxs(
|
|
167
|
+
s.RadioItem,
|
|
168
|
+
{
|
|
169
|
+
ref: n,
|
|
170
|
+
className: r(
|
|
171
|
+
"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",
|
|
172
|
+
e
|
|
173
|
+
),
|
|
174
|
+
...o,
|
|
175
|
+
children: [
|
|
176
|
+
/* @__PURE__ */ a.jsx("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ a.jsx(s.ItemIndicator, { children: /* @__PURE__ */ a.jsx(b, { className: "h-4 w-4 fill-current" }) }) }),
|
|
177
|
+
t
|
|
178
|
+
]
|
|
179
|
+
}
|
|
180
|
+
));
|
|
181
|
+
j.displayName = s.RadioItem.displayName;
|
|
182
|
+
const R = i.forwardRef(({ className: e, inset: t, ...o }, n) => /* @__PURE__ */ a.jsx(
|
|
183
|
+
s.Label,
|
|
184
|
+
{
|
|
185
|
+
ref: n,
|
|
186
|
+
className: r("px-2 py-1.5 text-sm font-semibold", t && "pl-8", e),
|
|
187
|
+
...o
|
|
188
|
+
}
|
|
189
|
+
));
|
|
190
|
+
R.displayName = s.Label.displayName;
|
|
191
|
+
const I = i.forwardRef(({ className: e, ...t }, o) => /* @__PURE__ */ a.jsx(s.Separator, { ref: o, className: r("-mx-1 my-1 h-px bg-muted", e), ...t }));
|
|
192
|
+
I.displayName = s.Separator.displayName;
|
|
193
|
+
const A = ({ className: e, ...t }) => /* @__PURE__ */ a.jsx("span", { className: r("ml-auto text-xs tracking-widest text-muted-foreground", e), ...t });
|
|
194
|
+
A.displayname = "MenubarShortcut";
|
|
195
|
+
const he = d.Root, Ce = d.Trigger, ye = d.Close, p = ({ className: e, ...t }) => /* @__PURE__ */ a.jsx(d.Portal, { className: r(e), ...t });
|
|
196
|
+
p.displayName = d.Portal.displayName;
|
|
197
|
+
const u = i.forwardRef(({ className: e, ...t }, o) => /* @__PURE__ */ a.jsx(
|
|
198
|
+
d.Overlay,
|
|
199
|
+
{
|
|
200
|
+
className: r(
|
|
201
|
+
"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",
|
|
202
|
+
e
|
|
203
|
+
),
|
|
204
|
+
...t,
|
|
205
|
+
ref: o
|
|
206
|
+
}
|
|
207
|
+
));
|
|
208
|
+
u.displayName = d.Overlay.displayName;
|
|
209
|
+
const k = c(
|
|
210
|
+
"fixed z-50 gap-4 bg-background p-6 shadow-lg transition ease-in-out data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:duration-300 data-[state=open]:duration-500",
|
|
211
|
+
{
|
|
212
|
+
variants: {
|
|
213
|
+
side: {
|
|
214
|
+
top: "inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",
|
|
215
|
+
bottom: "inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",
|
|
216
|
+
left: "inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm",
|
|
217
|
+
right: "inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm"
|
|
218
|
+
}
|
|
219
|
+
},
|
|
220
|
+
defaultVariants: {
|
|
221
|
+
side: "right"
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
), P = i.forwardRef(
|
|
225
|
+
({ side: e = "right", className: t, children: o, ...n }, l) => /* @__PURE__ */ a.jsxs(p, { children: [
|
|
226
|
+
/* @__PURE__ */ a.jsx(u, {}),
|
|
227
|
+
/* @__PURE__ */ a.jsxs(d.Content, { ref: l, className: r(k({ side: e }), t), ...n, children: [
|
|
228
|
+
o,
|
|
229
|
+
/* @__PURE__ */ a.jsxs(d.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-secondary", children: [
|
|
230
|
+
/* @__PURE__ */ a.jsx(h, { className: "h-4 w-4" }),
|
|
231
|
+
/* @__PURE__ */ a.jsx("span", { className: "sr-only", children: "Close" })
|
|
232
|
+
] })
|
|
233
|
+
] })
|
|
234
|
+
] })
|
|
235
|
+
);
|
|
236
|
+
P.displayName = d.Content.displayName;
|
|
237
|
+
const L = ({ className: e, ...t }) => /* @__PURE__ */ a.jsx("div", { className: r("flex flex-col space-y-2 text-center sm:text-left", e), ...t });
|
|
238
|
+
L.displayName = "SheetHeader";
|
|
239
|
+
const z = ({ className: e, ...t }) => /* @__PURE__ */ a.jsx("div", { className: r("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2", e), ...t });
|
|
240
|
+
z.displayName = "SheetFooter";
|
|
241
|
+
const F = i.forwardRef(({ className: e, ...t }, o) => /* @__PURE__ */ a.jsx(d.Title, { ref: o, className: r("text-lg font-semibold text-foreground", e), ...t }));
|
|
242
|
+
F.displayName = d.Title.displayName;
|
|
243
|
+
const G = i.forwardRef(({ className: e, ...t }, o) => /* @__PURE__ */ a.jsx(d.Description, { ref: o, className: r("text-sm text-muted-foreground", e), ...t }));
|
|
244
|
+
G.displayName = d.Description.displayName;
|
|
40
245
|
export {
|
|
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
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
246
|
+
Ee as Accordion,
|
|
247
|
+
Oe as AccordionContent,
|
|
248
|
+
qe as AccordionItem,
|
|
249
|
+
Je as AccordionTrigger,
|
|
250
|
+
Qe as Alert,
|
|
251
|
+
Ue as AlertDescription,
|
|
252
|
+
nt as AlertDialog,
|
|
253
|
+
it as AlertDialogAction,
|
|
254
|
+
dt as AlertDialogCancel,
|
|
255
|
+
lt as AlertDialogContent,
|
|
256
|
+
mt as AlertDialogDescription,
|
|
257
|
+
ct as AlertDialogFooter,
|
|
258
|
+
pt as AlertDialogHeader,
|
|
259
|
+
ut as AlertDialogTitle,
|
|
260
|
+
ft as AlertDialogTrigger,
|
|
261
|
+
We as AlertTitle,
|
|
262
|
+
ot as Badge,
|
|
263
|
+
je as Button,
|
|
264
|
+
Xe as Card,
|
|
265
|
+
Ye as CardContent,
|
|
266
|
+
Ze as CardDescription,
|
|
267
|
+
_e as CardFooter,
|
|
268
|
+
$e as CardHeader,
|
|
269
|
+
et as CardTitle,
|
|
270
|
+
jt as Command,
|
|
271
|
+
Rt as CommandDialog,
|
|
272
|
+
It as CommandEmpty,
|
|
273
|
+
At as CommandGroup,
|
|
274
|
+
kt as CommandInput,
|
|
275
|
+
Pt as CommandItem,
|
|
276
|
+
Lt as CommandList,
|
|
277
|
+
zt as CommandSeparator,
|
|
278
|
+
Ft as CommandShortcut,
|
|
279
|
+
Na as ContextMenu,
|
|
280
|
+
Sa as ContextMenuCheckboxItem,
|
|
281
|
+
wa as ContextMenuContent,
|
|
282
|
+
Ma as ContextMenuGroup,
|
|
283
|
+
va as ContextMenuItem,
|
|
284
|
+
Ta as ContextMenuLabel,
|
|
285
|
+
Da as ContextMenuPortal,
|
|
286
|
+
ja as ContextMenuRadioGroup,
|
|
287
|
+
Ra as ContextMenuRadioItem,
|
|
288
|
+
Ia as ContextMenuSeparator,
|
|
289
|
+
Aa as ContextMenuShortcut,
|
|
290
|
+
ka as ContextMenuSub,
|
|
291
|
+
Pa as ContextMenuSubContent,
|
|
292
|
+
La as ContextMenuSubTrigger,
|
|
293
|
+
za as ContextMenuTrigger,
|
|
294
|
+
xt as Dialog,
|
|
295
|
+
bt as DialogContent,
|
|
296
|
+
ht as DialogDescription,
|
|
297
|
+
Ct as DialogFooter,
|
|
298
|
+
yt as DialogHeader,
|
|
299
|
+
Nt as DialogTitle,
|
|
300
|
+
St as DialogTrigger,
|
|
301
|
+
oa as DropdownMenu,
|
|
302
|
+
sa as DropdownMenuCheckboxItem,
|
|
303
|
+
ra as DropdownMenuContent,
|
|
304
|
+
na as DropdownMenuGroup,
|
|
305
|
+
ia as DropdownMenuItem,
|
|
306
|
+
da as DropdownMenuLabel,
|
|
307
|
+
la as DropdownMenuPortal,
|
|
308
|
+
ma as DropdownMenuRadioGroup,
|
|
309
|
+
ca as DropdownMenuRadioItem,
|
|
310
|
+
pa as DropdownMenuSeparator,
|
|
311
|
+
ua as DropdownMenuShortcut,
|
|
312
|
+
fa as DropdownMenuSub,
|
|
313
|
+
ga as DropdownMenuSubContent,
|
|
314
|
+
xa as DropdownMenuSubTrigger,
|
|
315
|
+
ba as DropdownMenuTrigger,
|
|
316
|
+
we as HoverCard,
|
|
317
|
+
Me as HoverCardContent,
|
|
318
|
+
ve as HoverCardTrigger,
|
|
319
|
+
Ga as IconPickerField,
|
|
320
|
+
Ha as ImagePickerField,
|
|
321
|
+
Gt as Input,
|
|
322
|
+
Vt as Label,
|
|
323
|
+
Va as LinkField,
|
|
324
|
+
N as Menubar,
|
|
325
|
+
D as MenubarCheckboxItem,
|
|
326
|
+
v as MenubarContent,
|
|
327
|
+
fe as MenubarGroup,
|
|
328
|
+
T as MenubarItem,
|
|
329
|
+
R as MenubarLabel,
|
|
330
|
+
ue as MenubarMenu,
|
|
331
|
+
ge as MenubarPortal,
|
|
332
|
+
be as MenubarRadioGroup,
|
|
333
|
+
j as MenubarRadioItem,
|
|
334
|
+
I as MenubarSeparator,
|
|
335
|
+
A as MenubarShortcut,
|
|
336
|
+
xe as MenubarSub,
|
|
337
|
+
M as MenubarSubContent,
|
|
338
|
+
w as MenubarSubTrigger,
|
|
339
|
+
S as MenubarTrigger,
|
|
340
|
+
Jt as Popover,
|
|
341
|
+
Kt as PopoverContent,
|
|
342
|
+
Qt as PopoverTrigger,
|
|
343
|
+
Ba as RTEField,
|
|
344
|
+
Et as ScrollArea,
|
|
345
|
+
Ot as ScrollBar,
|
|
346
|
+
Wt as Select,
|
|
347
|
+
Xt as SelectContent,
|
|
348
|
+
Yt as SelectGroup,
|
|
349
|
+
Zt as SelectItem,
|
|
350
|
+
_t as SelectLabel,
|
|
351
|
+
$t as SelectSeparator,
|
|
352
|
+
ea as SelectTrigger,
|
|
353
|
+
ta as SelectValue,
|
|
354
|
+
Ca as Separator,
|
|
355
|
+
he as Sheet,
|
|
356
|
+
ye as SheetClose,
|
|
357
|
+
P as SheetContent,
|
|
358
|
+
G as SheetDescription,
|
|
359
|
+
z as SheetFooter,
|
|
360
|
+
L as SheetHeader,
|
|
361
|
+
F as SheetTitle,
|
|
362
|
+
Ce as SheetTrigger,
|
|
363
|
+
Re as Skeleton,
|
|
364
|
+
Te as Switch,
|
|
365
|
+
wt as Tabs,
|
|
366
|
+
Mt as TabsContent,
|
|
367
|
+
vt as TabsList,
|
|
368
|
+
Tt as TabsTrigger,
|
|
369
|
+
tt as Textarea,
|
|
370
|
+
Ie as Toaster,
|
|
371
|
+
y as Toggle,
|
|
372
|
+
Ae as Tooltip,
|
|
373
|
+
ke as TooltipContent,
|
|
374
|
+
Pe as TooltipPortal,
|
|
375
|
+
Le as TooltipProvider,
|
|
376
|
+
ze as TooltipTrigger,
|
|
377
|
+
st as badgeVariants,
|
|
378
|
+
Fe as buttonVariants,
|
|
379
|
+
Ge as reducer,
|
|
380
|
+
He as toast,
|
|
381
|
+
C as toggleVariants,
|
|
382
|
+
Ve as useToast
|
|
178
383
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const B=require("react"),o=require("lodash-es"),C=require("./Functions-Hvon6AMZ.cjs"),S=require("./block-helpers-OKHmRRol.cjs"),h=require("./ChaiBuilderEditor-m30yoOgJ.cjs"),m=require("./Controls-ky25Ebo3.cjs"),g=require("./STRINGS-gPz7CUOk.cjs"),T=require("./skeleton-STeL9VrJ.cjs"),k=()=>{const[l]=h.useBlocksStore(),[,a]=h.useSelectedBlockIds(),{addBlocks:A}=h.useBlocksStoreUndoableActions(),{toast:E}=T.useToast(),f=B.useCallback((t,s,p)=>{var e;for(let r=0;r<t.length;r++){const{_id:q}=t[r];t[r]._id=C.generateUUID();const u=o.filter(t,{_parent:q});for(let d=0;d<u.length;d++)u[d]._parent=t[r]._id}const _=o.first(t);let n,i;return s&&(n=o.find(l,{_id:s}),t[0]._parent=s,i=s),!(n?S.canAcceptChildBlock(n._type,_._type):!0)&&n&&(t[0]._parent=n._parent,i=n._parent),A(t,i,p),a([(e=o.first(t))==null?void 0:e._id]),o.first(t)},[l,a]);return{addCoreBlock:B.useCallback((t,s,p)=>{if(o.has(t,"blocks")){const d=t.blocks;return f(d,s,p)}const _=C.generateUUID(),n=m.getBlockDefaultProps(t.props),i=[];o.forIn(n,(d,y)=>{if(o.startsWith(d,g.SLOT_KEY)){const U=d.replace(g.SLOT_KEY,"");i.push({_id:U,_type:"Slot",_parent:_,_name:t.props[y].name,_styles:t.props[y].styles,_emptyStyles:t.props[y].emptyStyles})}});const c={_type:t.type,_id:_,...n};let e,r;if(s&&(e=o.find(l,{_id:s}),c._parent=s,r=s),!S.canBeNestedInside(e==null?void 0:e._type,t.type)){E({variant:"destructive",title:"Error",description:`"${t.type}" cannot be added under "${e?e==null?void 0:e._type:"root"}"`}),a([]);return}!(e?S.canAcceptChildBlock(e._type,t.type):!0)&&e&&(c._parent=e._parent,r=e._parent);const u=[c,...i];return A(u,r,p),a([c._id]),c},[f,l,a]),addPredefinedBlock:f}};exports.useAddBlock=k;
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { useCallback as h } from "react";
|
|
2
|
+
import { filter as w, first as u, find as A, has as D, forIn as E, startsWith as P } from "lodash-es";
|
|
3
|
+
import { g } from "./Functions-NzT2Six_.js";
|
|
4
|
+
import { b as B, d as T } from "./block-helpers-oSFpSsGz.js";
|
|
5
|
+
import { a as $, j as v, t as x } from "./ChaiBuilderEditor-vP4at00I.js";
|
|
6
|
+
import { b as I } from "./Controls-3Cc1XYXg.js";
|
|
7
|
+
import { a as C } from "./STRINGS-b432aBJJ.js";
|
|
8
|
+
import { f as K } from "./skeleton-lu8e7q2y.js";
|
|
9
|
+
const G = () => {
|
|
10
|
+
const [i] = $(), [, p] = v(), { addBlocks: y } = x(), { toast: U } = K(), f = h(
|
|
11
|
+
(t, s, _) => {
|
|
12
|
+
var e;
|
|
13
|
+
for (let r = 0; r < t.length; r++) {
|
|
14
|
+
const { _id: S } = t[r];
|
|
15
|
+
t[r]._id = g();
|
|
16
|
+
const l = w(t, { _parent: S });
|
|
17
|
+
for (let o = 0; o < l.length; o++)
|
|
18
|
+
l[o]._parent = t[r]._id;
|
|
19
|
+
}
|
|
20
|
+
const c = u(t);
|
|
21
|
+
let n, a;
|
|
22
|
+
return s && (n = A(i, { _id: s }), t[0]._parent = s, a = s), !(n ? B(n._type, c._type) : !0) && n && (t[0]._parent = n._parent, a = n._parent), y(t, a, _), p([(e = u(t)) == null ? void 0 : e._id]), u(t);
|
|
23
|
+
},
|
|
24
|
+
[i, p]
|
|
25
|
+
);
|
|
26
|
+
return { addCoreBlock: h(
|
|
27
|
+
(t, s, _) => {
|
|
28
|
+
if (D(t, "blocks")) {
|
|
29
|
+
const o = t.blocks;
|
|
30
|
+
return f(o, s, _);
|
|
31
|
+
}
|
|
32
|
+
const c = g(), n = I(t.props), a = [];
|
|
33
|
+
E(n, (o, m) => {
|
|
34
|
+
if (P(o, C)) {
|
|
35
|
+
const j = o.replace(C, "");
|
|
36
|
+
a.push({
|
|
37
|
+
_id: j,
|
|
38
|
+
_type: "Slot",
|
|
39
|
+
_parent: c,
|
|
40
|
+
_name: t.props[m].name,
|
|
41
|
+
_styles: t.props[m].styles,
|
|
42
|
+
_emptyStyles: t.props[m].emptyStyles
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
});
|
|
46
|
+
const d = {
|
|
47
|
+
_type: t.type,
|
|
48
|
+
_id: c,
|
|
49
|
+
...n
|
|
50
|
+
};
|
|
51
|
+
let e, r;
|
|
52
|
+
if (s && (e = A(i, { _id: s }), d._parent = s, r = s), !T(e == null ? void 0 : e._type, t.type)) {
|
|
53
|
+
U({
|
|
54
|
+
variant: "destructive",
|
|
55
|
+
title: "Error",
|
|
56
|
+
description: `"${t.type}" cannot be added under "${e ? e == null ? void 0 : e._type : "root"}"`
|
|
57
|
+
}), p([]);
|
|
58
|
+
return;
|
|
59
|
+
}
|
|
60
|
+
!(e ? B(e._type, t.type) : !0) && e && (d._parent = e._parent, r = e._parent);
|
|
61
|
+
const l = [d, ...a];
|
|
62
|
+
return y(l, r, _), p([d._id]), d;
|
|
63
|
+
},
|
|
64
|
+
[f, i, p]
|
|
65
|
+
), addPredefinedBlock: f };
|
|
66
|
+
};
|
|
67
|
+
export {
|
|
68
|
+
G as u
|
|
69
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const t=require("jotai"),a=require("./skeleton-STeL9VrJ.cjs"),e=()=>t.useAtom(a.chaiExternalDataAtom);exports.useChaiExternalData=e;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const o=require("jotai"),k=require("react"),m=require("./Functions-Hvon6AMZ.cjs"),a=require("./ChaiBuilderEditor-m30yoOgJ.cjs"),i=()=>o.useAtom(a.styleBreakpointAtom),c=a.atomWithStorage("canvasWidth",800),u=o.atom(t=>{const e=t(c);return m.getBreakpointValue(e).toLowerCase()}),h=()=>{const[t,e]=o.useAtom(c),s=o.useAtomValue(u),[n,r]=i();return k.useEffect(()=>{n!=="xs"&&r(s)},[s,n,r]),[t,s,e]},d=a.atomWithStorage("darkMode",!1),A=()=>{const[t,e]=o.useAtom(d);return[t,e]};exports.canvasBreakpointAtom=u;exports.darkModeAtom=d;exports.useCanvasWidth=h;exports.useDarkMode=A;exports.useStylingBreakpoint=i;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { useAtom as s, atom as c, useAtomValue as m } from "jotai";
|
|
2
|
+
import { useEffect as d } from "react";
|
|
3
|
+
import { a as u } from "./Functions-NzT2Six_.js";
|
|
4
|
+
import { I as k, B as n } from "./ChaiBuilderEditor-vP4at00I.js";
|
|
5
|
+
const p = () => s(k), i = n("canvasWidth", 800), f = c((t) => {
|
|
6
|
+
const o = t(i);
|
|
7
|
+
return u(o).toLowerCase();
|
|
8
|
+
}), g = () => {
|
|
9
|
+
const [t, o] = s(i), a = m(f), [e, r] = p();
|
|
10
|
+
return d(() => {
|
|
11
|
+
e !== "xs" && r(a);
|
|
12
|
+
}, [a, e, r]), [t, a, o];
|
|
13
|
+
}, h = n("darkMode", !1), v = () => {
|
|
14
|
+
const [t, o] = s(h);
|
|
15
|
+
return [t, o];
|
|
16
|
+
};
|
|
17
|
+
export {
|
|
18
|
+
v as a,
|
|
19
|
+
p as b,
|
|
20
|
+
f as c,
|
|
21
|
+
h as d,
|
|
22
|
+
g as u
|
|
23
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { useAtom as e } from "jotai";
|
|
2
|
+
import { B as o } from "./ChaiBuilderEditor-vP4at00I.js";
|
|
3
|
+
const a = o("canvasZoom", 100), m = () => e(a), n = o("selectedBreakpoints", ["XS", "MD", "XL"]), i = () => {
|
|
4
|
+
const [t, s] = e(n);
|
|
5
|
+
return [t, s];
|
|
6
|
+
};
|
|
7
|
+
export {
|
|
8
|
+
i as a,
|
|
9
|
+
m as u
|
|
10
|
+
};
|