@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
|
@@ -1,113 +1,105 @@
|
|
|
1
|
-
import { j as t } from "./jsx-runtime-
|
|
1
|
+
import { j as t } from "./jsx-runtime-Sp0orL4X.js";
|
|
2
2
|
import I, { useState as j, useEffect as z } from "react";
|
|
3
|
-
import {
|
|
3
|
+
import { isEqual as x, isEmpty as C, isString as L, omit as y, kebabCase as B } from "lodash-es";
|
|
4
4
|
import { HomeIcon as G } from "@radix-ui/react-icons";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
5
|
+
import { B as Y } from "./skeleton-lu8e7q2y.js";
|
|
6
|
+
import { S as q } from "./scroll-area-ewXbxc3n.js";
|
|
7
|
+
import { u as g, b as Z, g as $, o as F, r as Q } from "./controls-IS5qnRce.js";
|
|
7
8
|
import { toast as U } from "sonner";
|
|
8
|
-
import { F as P } from "./form-
|
|
9
|
-
import { f as V, a as X, g as _, b as K } from "./index-
|
|
10
|
-
import "./_commonjsHelpers-UyOWmZb0.js";
|
|
11
|
-
import "./Functions-7jnEwJyw.js";
|
|
12
|
-
import "clsx";
|
|
13
|
-
import "tailwind-merge";
|
|
14
|
-
import "@chaibuilder/runtime";
|
|
9
|
+
import { F as P } from "./form-0_RLz2TB.js";
|
|
10
|
+
import { f as V, a as X, g as _, b as K } from "./index-hElOGcFr.js";
|
|
15
11
|
import "jotai";
|
|
16
|
-
import "./STRINGS--j49GZJP.js";
|
|
17
|
-
import "@react-hookz/web";
|
|
18
|
-
import "./MODIFIERS-dytZ-osO.js";
|
|
19
|
-
import "@radix-ui/react-toggle";
|
|
20
|
-
import "class-variance-authority";
|
|
21
|
-
import "./Class-lGzsNBOK.js";
|
|
22
|
-
import "@radix-ui/react-switch";
|
|
23
12
|
import "@radix-ui/react-slot";
|
|
24
|
-
import "
|
|
25
|
-
import "
|
|
26
|
-
import "
|
|
27
|
-
import "
|
|
28
|
-
import "@radix-ui/react-scroll-area";
|
|
29
|
-
import "@radix-ui/react-tabs";
|
|
13
|
+
import "class-variance-authority";
|
|
14
|
+
import "./utils-dze1SGvB.js";
|
|
15
|
+
import "clsx";
|
|
16
|
+
import "tailwind-merge";
|
|
30
17
|
import "@radix-ui/react-tooltip";
|
|
31
|
-
import "@radix-ui/react-popover";
|
|
32
|
-
import "@radix-ui/react-menubar";
|
|
33
|
-
import "@radix-ui/react-hover-card";
|
|
34
|
-
import "@radix-ui/react-select";
|
|
35
|
-
import "@radix-ui/react-dropdown-menu";
|
|
36
|
-
import "@radix-ui/react-separator";
|
|
37
18
|
import "@radix-ui/react-toast";
|
|
38
|
-
import "
|
|
39
|
-
import "@
|
|
19
|
+
import "@radix-ui/react-scroll-area";
|
|
20
|
+
import "@rjsf/core";
|
|
21
|
+
import "@rjsf/validator-ajv8";
|
|
22
|
+
import "./link-xuhP-4dN.js";
|
|
40
23
|
import "react-icons-picker";
|
|
41
24
|
import "react-dom";
|
|
25
|
+
import "./tabs-yQ3oGziM.js";
|
|
26
|
+
import "@radix-ui/react-dialog";
|
|
27
|
+
import "@radix-ui/react-tabs";
|
|
28
|
+
import "./ImagesPanel-Wb0GF_NA.js";
|
|
42
29
|
import "react-quill";
|
|
43
30
|
import "react-i18next";
|
|
44
|
-
import "
|
|
45
|
-
import "
|
|
46
|
-
import "./index-uLtBNl55.js";
|
|
47
|
-
import "i18next";
|
|
31
|
+
import "./ChaiBuilderEditor-vP4at00I.js";
|
|
32
|
+
import "./MODIFIERS-CNqNUapY.js";
|
|
48
33
|
import "@floating-ui/react-dom";
|
|
34
|
+
import "i18next";
|
|
49
35
|
import "flagged";
|
|
36
|
+
import "./Functions-NzT2Six_.js";
|
|
50
37
|
import "react-hotkeys-hook";
|
|
51
|
-
import "
|
|
38
|
+
import "@react-hookz/web";
|
|
39
|
+
import "@chaibuilder/runtime";
|
|
40
|
+
import "./html-to-json-2xtb7520.js";
|
|
52
41
|
import "himalaya";
|
|
42
|
+
import "./STRINGS-b432aBJJ.js";
|
|
53
43
|
import "lucide-react";
|
|
54
|
-
import "./
|
|
55
|
-
|
|
56
|
-
|
|
44
|
+
import "./iconBase-h4DuR_XT.js";
|
|
45
|
+
import "./alert-dialog-rypfO5ly.js";
|
|
46
|
+
import "@radix-ui/react-alert-dialog";
|
|
47
|
+
const O = I.lazy(() => import("./delete-page-modal-7KmP1elv.js")), J = I.lazy(() => import("./confirm-alert-wR5_VJ1l.js")), h = (n) => {
|
|
48
|
+
if (!L(n) || !(n.includes("/[") && n.includes("]")))
|
|
57
49
|
return !1;
|
|
58
50
|
const s = /^\[((?:\.{3})?[a-zA-Z0-9_-]+)\]$/, u = /^[a-zA-Z0-9_-]+$/;
|
|
59
51
|
let e = !0;
|
|
60
|
-
return
|
|
61
|
-
e && (
|
|
52
|
+
return n.split("/").forEach((r) => {
|
|
53
|
+
e && (r.includes("[[") && r.includes("]]") ? e = /^\[\[\.{3}[a-zA-Z0-9_-]+\]\]$/.test(r) : r.includes("[") && r.includes("]") ? e = s.test(r) : e = u.test(r));
|
|
62
54
|
}), e;
|
|
63
|
-
}, f = (
|
|
64
|
-
...
|
|
55
|
+
}, f = (n) => n && C(n.seoData) ? {
|
|
56
|
+
...n,
|
|
65
57
|
seoData: { title: "", description: "", image: "" }
|
|
66
|
-
} :
|
|
67
|
-
const s = !
|
|
58
|
+
} : n, W = (n, l) => {
|
|
59
|
+
const s = !x(y(n, ["seoData"]), y(l, ["seoData"])), u = !x(f(l).seoData, f(n).seoData);
|
|
68
60
|
return s || u;
|
|
69
|
-
},
|
|
70
|
-
const u = V(), { data: e } = X(),
|
|
61
|
+
}, Ue = ({ open: n, setOpen: l, pageData: s }) => {
|
|
62
|
+
const u = V(), { data: e } = X(), r = _(), c = K("Homepage updated successfully."), [i, T] = j(f(s)), [d, v] = j({
|
|
71
63
|
isHomePage: (e == null ? void 0 : e.homepage) === s.uuid
|
|
72
64
|
}), N = W(i, s);
|
|
73
65
|
z(() => {
|
|
74
|
-
const
|
|
75
|
-
m
|
|
76
|
-
}, [e, s, i, d,
|
|
66
|
+
const m = !x(f(s), i), o = (e == null ? void 0 : e.homepage) !== s.uuid && d.isHomePage;
|
|
67
|
+
l(m || o ? "PENDING" : "OPEN");
|
|
68
|
+
}, [e, s, i, d, l]);
|
|
77
69
|
const S = () => {
|
|
78
70
|
if (N) {
|
|
79
71
|
if (s.type === "DYNAMIC" && !h((i == null ? void 0 : i.slug) || "")) {
|
|
80
|
-
|
|
72
|
+
n === "ALERT" && l("PENDING");
|
|
81
73
|
return;
|
|
82
74
|
}
|
|
83
|
-
|
|
75
|
+
r.mutate(i, {
|
|
84
76
|
onSuccess: () => {
|
|
85
77
|
u.invalidateQueries({
|
|
86
78
|
refetchType: "active",
|
|
87
79
|
queryKey: ["pages", e == null ? void 0 : e.uuid]
|
|
88
|
-
}),
|
|
80
|
+
}), l("CLOSE"), U.success("Page updated successfully.");
|
|
89
81
|
}
|
|
90
82
|
});
|
|
91
83
|
}
|
|
92
|
-
d.isHomePage && (e == null ? void 0 : e.homepage) !== s.uuid && c.mutate({ ...e, homepage: s == null ? void 0 : s.uuid }, { onSuccess: () =>
|
|
93
|
-
}, b = ({ formData:
|
|
84
|
+
d.isHomePage && (e == null ? void 0 : e.homepage) !== s.uuid && c.mutate({ ...e, homepage: s == null ? void 0 : s.uuid }, { onSuccess: () => l("CLOSE") });
|
|
85
|
+
}, b = ({ formData: m }, o) => {
|
|
94
86
|
T((p) => {
|
|
95
87
|
var E, A;
|
|
96
88
|
if (!o)
|
|
97
89
|
return p;
|
|
98
|
-
const a = { [o]:
|
|
99
|
-
return o === "name" ? a.slug = B((E =
|
|
100
|
-
title:
|
|
101
|
-
description:
|
|
102
|
-
image:
|
|
90
|
+
const a = { [o]: m[o] };
|
|
91
|
+
return o === "name" ? a.slug = B((E = m[o]) == null ? void 0 : E.replace(/\d/g, "")) : o === "slug" ? a.slug = (A = m[o]) == null ? void 0 : A.replace(/\d/g, "").replace(/\s+/g, "").replace("--", "-").replace("__", "_") : o === "seoData" && (a.seoData = {
|
|
92
|
+
title: m[o].title || "",
|
|
93
|
+
description: m[o].description || "",
|
|
94
|
+
image: m[o].image || ""
|
|
103
95
|
}), {
|
|
104
96
|
...p,
|
|
105
97
|
...a
|
|
106
98
|
};
|
|
107
99
|
});
|
|
108
|
-
}, H = ({ formData:
|
|
100
|
+
}, H = ({ formData: m }, o) => {
|
|
109
101
|
v((p) => {
|
|
110
|
-
const a = { [o]:
|
|
102
|
+
const a = { [o]: m[o] };
|
|
111
103
|
return {
|
|
112
104
|
...p,
|
|
113
105
|
...a
|
|
@@ -146,15 +138,15 @@ const O = I.lazy(() => import("./delete-page-modal-iMmkPec0.js")), J = I.lazy(()
|
|
|
146
138
|
default: d.isHomePage
|
|
147
139
|
})
|
|
148
140
|
};
|
|
149
|
-
return /* @__PURE__ */ t.jsxs(
|
|
141
|
+
return /* @__PURE__ */ t.jsxs(q, { className: "flex h-full select-none flex-col", children: [
|
|
150
142
|
/* @__PURE__ */ t.jsx(
|
|
151
143
|
J,
|
|
152
144
|
{
|
|
153
|
-
open:
|
|
145
|
+
open: n === "ALERT",
|
|
154
146
|
title: "Do yo want to save changes?",
|
|
155
|
-
onCancel: () =>
|
|
147
|
+
onCancel: () => l("CLOSE"),
|
|
156
148
|
onConfirm: S,
|
|
157
|
-
disabled: c.isPending ||
|
|
149
|
+
disabled: c.isPending || r.isPending
|
|
158
150
|
}
|
|
159
151
|
),
|
|
160
152
|
/* @__PURE__ */ t.jsx("div", { className: "rounded-md bg-background/30 px-2.5 py-1", children: /* @__PURE__ */ t.jsx("h1", { className: "px-1 font-semibold", children: "Page Details" }) }),
|
|
@@ -166,7 +158,7 @@ const O = I.lazy(() => import("./delete-page-modal-iMmkPec0.js")), J = I.lazy(()
|
|
|
166
158
|
formData: i,
|
|
167
159
|
properties: M,
|
|
168
160
|
onChange: b,
|
|
169
|
-
disabled:
|
|
161
|
+
disabled: r.isPending || c.isPending
|
|
170
162
|
}
|
|
171
163
|
),
|
|
172
164
|
/* @__PURE__ */ t.jsx("div", { className: "h-2 w-full" }),
|
|
@@ -177,7 +169,7 @@ const O = I.lazy(() => import("./delete-page-modal-iMmkPec0.js")), J = I.lazy(()
|
|
|
177
169
|
formData: i,
|
|
178
170
|
properties: w,
|
|
179
171
|
onChange: b,
|
|
180
|
-
disabled:
|
|
172
|
+
disabled: r.isPending || c.isPending
|
|
181
173
|
}
|
|
182
174
|
),
|
|
183
175
|
(e == null ? void 0 : e.homepage) !== s.uuid && s.type === "STATIC" ? /* @__PURE__ */ t.jsx(
|
|
@@ -186,7 +178,7 @@ const O = I.lazy(() => import("./delete-page-modal-iMmkPec0.js")), J = I.lazy(()
|
|
|
186
178
|
formData: d,
|
|
187
179
|
properties: R,
|
|
188
180
|
onChange: H,
|
|
189
|
-
disabled:
|
|
181
|
+
disabled: r.isPending || c.isPending
|
|
190
182
|
}
|
|
191
183
|
) : s.type === "STATIC" && /* @__PURE__ */ t.jsxs("div", { className: "flex items-center gap-x-1 px-1 pt-2 text-xs font-medium text-gray-500", children: [
|
|
192
184
|
/* @__PURE__ */ t.jsx(G, {}),
|
|
@@ -199,12 +191,12 @@ const O = I.lazy(() => import("./delete-page-modal-iMmkPec0.js")), J = I.lazy(()
|
|
|
199
191
|
] }),
|
|
200
192
|
/* @__PURE__ */ t.jsxs("div", { className: "my-2 flex w-full items-center justify-between gap-x-2 px-1", children: [
|
|
201
193
|
/* @__PURE__ */ t.jsx(
|
|
202
|
-
|
|
194
|
+
Y,
|
|
203
195
|
{
|
|
204
196
|
className: "w-full",
|
|
205
197
|
type: "submit",
|
|
206
198
|
onClick: S,
|
|
207
|
-
disabled: (e == null ? void 0 : e.homepage) !== s.uuid && d.isHomePage ? !1 :
|
|
199
|
+
disabled: (e == null ? void 0 : e.homepage) !== s.uuid && d.isHomePage ? !1 : C(i.name) || C(i.slug) || !N || r.isPending || c.isPending || i.type === "DYNAMIC" && !h((i == null ? void 0 : i.slug) || ""),
|
|
208
200
|
children: "Save"
|
|
209
201
|
}
|
|
210
202
|
),
|
|
@@ -214,5 +206,5 @@ const O = I.lazy(() => import("./delete-page-modal-iMmkPec0.js")), J = I.lazy(()
|
|
|
214
206
|
] });
|
|
215
207
|
};
|
|
216
208
|
export {
|
|
217
|
-
|
|
209
|
+
Ue as default
|
|
218
210
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const g=require("jotai"),I=require("lodash-es"),r=require("./jsx-runtime-JYMCiFoE.cjs"),q=require("@radix-ui/react-slot"),b=require("class-variance-authority"),C=require("react"),n=require("./utils-qK_SjzzV.cjs"),M=require("@radix-ui/react-tooltip"),B=require("@radix-ui/react-icons"),k=require("@radix-ui/react-toast");function v(t){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const o in t)if(o!=="default"){const s=Object.getOwnPropertyDescriptor(t,o);Object.defineProperty(e,o,s.get?s:{enumerable:!0,get:()=>t[o]})}}return e.default=t,Object.freeze(e)}const i=v(C),c=v(M),a=v(k),T=g.atom(null);T.debugLabel="chaiBuilderPropsAtom";const y=g.atom({});y.debugLabel="chaiExternalDataAtom";const z=(t,e=void 0)=>{const o=g.useAtomValue(T);return I.get(o,t,e)},j=b.cva("inline-flex items-center justify-center rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{default:"bg-primary text-primary-foreground shadow hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90",outline:"border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2",sm:"h-8 rounded-md px-3 text-xs",lg:"h-10 rounded-md px-8",icon:"h-9 w-9"}},defaultVariants:{variant:"default",size:"default"}}),R=i.forwardRef(({className:t,variant:e,size:o,asChild:s=!1,...d},m)=>{const V=s?q.Slot:"button";return r.jsxRuntimeExports.jsx(V,{className:n.cn(j({variant:e,size:o,className:t})),ref:m,...d})});R.displayName="Button";const L=c.Portal,U=c.Provider,Q=c.Root,X=c.Trigger,w=i.forwardRef(({className:t,sideOffset:e=4,...o},s)=>r.jsxRuntimeExports.jsx(c.Content,{ref:s,sideOffset:e,className:n.cn("z-50 overflow-hidden rounded-md bg-primary px-3 py-1.5 text-xs text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-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}));w.displayName=c.Content.displayName;const Y=1,F=1e6;let f=0;function G(){return f=(f+1)%Number.MAX_VALUE,f.toString()}const x=new Map,h=t=>{if(x.has(t))return;const e=setTimeout(()=>{x.delete(t),u({type:"REMOVE_TOAST",toastId:t})},F);x.set(t,e)},E=(t,e)=>{switch(e.type){case"ADD_TOAST":return{...t,toasts:[e.toast,...t.toasts].slice(0,Y)};case"UPDATE_TOAST":return{...t,toasts:t.toasts.map(o=>o.id===e.toast.id?{...o,...e.toast}:o)};case"DISMISS_TOAST":{const{toastId:o}=e;return o?h(o):t.toasts.forEach(s=>{h(s.id)}),{...t,toasts:t.toasts.map(s=>s.id===o||o===void 0?{...s,open:!1}:s)}}case"REMOVE_TOAST":return e.toastId===void 0?{...t,toasts:[]}:{...t,toasts:t.toasts.filter(o=>o.id!==e.toastId)}}},l=[];let p={toasts:[]};function u(t){p=E(p,t),l.forEach(e=>{e(p)})}function S({...t}){const e=G(),o=d=>u({type:"UPDATE_TOAST",toast:{...d,id:e}}),s=()=>u({type:"DISMISS_TOAST",toastId:e});return u({type:"ADD_TOAST",toast:{...t,id:e,open:!0,onOpenChange:d=>{d||s()}}}),{id:e,dismiss:s,update:o}}function A(){const[t,e]=i.useState(p);return i.useEffect(()=>(l.push(e),()=>{const o=l.indexOf(e);o>-1&&l.splice(o,1)}),[t]),{...t,toast:S,dismiss:o=>u({type:"DISMISS_TOAST",toastId:o})}}const H=a.Provider,N=i.forwardRef(({className:t,...e},o)=>r.jsxRuntimeExports.jsx(a.Viewport,{ref:o,className:n.cn("fixed top-0 z-[100] flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-[420px]",t),...e}));N.displayName=a.Viewport.displayName;const J=b.cva("group pointer-events-auto relative flex w-full items-center justify-between space-x-2 overflow-hidden rounded-md border p-4 pr-6 shadow-lg transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full",{variants:{variant:{default:"border bg-background",destructive:"destructive group border-destructive bg-destructive text-destructive-foreground"}},defaultVariants:{variant:"default"}}),P=i.forwardRef(({className:t,variant:e,...o},s)=>r.jsxRuntimeExports.jsx(a.Root,{ref:s,className:n.cn(J({variant:e}),t),...o}));P.displayName=a.Root.displayName;const K=i.forwardRef(({className:t,...e},o)=>r.jsxRuntimeExports.jsx(a.Action,{ref:o,className:n.cn("inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium transition-colors hover:bg-secondary focus:outline-none focus:ring-1 focus:ring-ring disabled:pointer-events-none disabled:opacity-50 group-[.destructive]:border-muted/40 group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground group-[.destructive]:focus:ring-destructive",t),...e}));K.displayName=a.Action.displayName;const O=i.forwardRef(({className:t,...e},o)=>r.jsxRuntimeExports.jsx(a.Close,{ref:o,className:n.cn("absolute right-1 top-1 rounded-md p-1 text-foreground/50 opacity-0 transition-opacity hover:text-foreground focus:opacity-100 focus:outline-none focus:ring-1 group-hover:opacity-100 group-[.destructive]:text-red-300 group-[.destructive]:hover:text-red-50 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600",t),"toast-close":"",...e,children:r.jsxRuntimeExports.jsx(B.Cross2Icon,{className:"h-4 w-4"})}));O.displayName=a.Close.displayName;const _=i.forwardRef(({className:t,...e},o)=>r.jsxRuntimeExports.jsx(a.Title,{ref:o,className:n.cn("text-sm font-semibold [&+div]:text-xs",t),...e}));_.displayName=a.Title.displayName;const D=i.forwardRef(({className:t,...e},o)=>r.jsxRuntimeExports.jsx(a.Description,{ref:o,className:n.cn("text-sm opacity-90",t),...e}));D.displayName=a.Description.displayName;function W(){const{toasts:t}=A();return r.jsxRuntimeExports.jsxs(H,{children:[t.map(({id:e,title:o,description:s,action:d,...m})=>r.jsxRuntimeExports.jsxs(P,{...m,children:[r.jsxRuntimeExports.jsxs("div",{className:"grid gap-1",children:[o&&r.jsxRuntimeExports.jsx(_,{children:o}),s&&r.jsxRuntimeExports.jsx(D,{children:s})]}),d,r.jsxRuntimeExports.jsx(O,{})]},e)),r.jsxRuntimeExports.jsx(N,{})]})}const Z=({className:t,...e})=>r.jsxRuntimeExports.jsx("div",{className:n.cn("animate-pulse rounded-md bg-primary/10",t),...e});exports.Button=R;exports.Skeleton=Z;exports.Toaster=W;exports.Tooltip=Q;exports.TooltipContent=w;exports.TooltipPortal=L;exports.TooltipProvider=U;exports.TooltipTrigger=X;exports.buttonVariants=j;exports.chaiBuilderPropsAtom=T;exports.chaiExternalDataAtom=y;exports.reducer=E;exports.toast=S;exports.useBuilderProp=z;exports.useToast=A;
|
|
@@ -0,0 +1,239 @@
|
|
|
1
|
+
import { atom as x, useAtomValue as j } from "jotai";
|
|
2
|
+
import { get as R } from "lodash-es";
|
|
3
|
+
import { j as r } from "./jsx-runtime-Sp0orL4X.js";
|
|
4
|
+
import { Slot as E } from "@radix-ui/react-slot";
|
|
5
|
+
import { cva as h } from "class-variance-authority";
|
|
6
|
+
import * as i from "react";
|
|
7
|
+
import { c as n } from "./utils-dze1SGvB.js";
|
|
8
|
+
import * as c from "@radix-ui/react-tooltip";
|
|
9
|
+
import { Cross2Icon as O } from "@radix-ui/react-icons";
|
|
10
|
+
import * as a from "@radix-ui/react-toast";
|
|
11
|
+
const T = x(null);
|
|
12
|
+
T.debugLabel = "chaiBuilderPropsAtom";
|
|
13
|
+
const D = x({});
|
|
14
|
+
D.debugLabel = "chaiExternalDataAtom";
|
|
15
|
+
const K = (t, e = void 0) => {
|
|
16
|
+
const o = j(T);
|
|
17
|
+
return R(o, t, e);
|
|
18
|
+
}, P = h(
|
|
19
|
+
"inline-flex items-center justify-center rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50",
|
|
20
|
+
{
|
|
21
|
+
variants: {
|
|
22
|
+
variant: {
|
|
23
|
+
default: "bg-primary text-primary-foreground shadow hover:bg-primary/90",
|
|
24
|
+
destructive: "bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90",
|
|
25
|
+
outline: "border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground",
|
|
26
|
+
secondary: "bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80",
|
|
27
|
+
ghost: "hover:bg-accent hover:text-accent-foreground",
|
|
28
|
+
link: "text-primary underline-offset-4 hover:underline"
|
|
29
|
+
},
|
|
30
|
+
size: {
|
|
31
|
+
default: "h-9 px-4 py-2",
|
|
32
|
+
sm: "h-8 rounded-md px-3 text-xs",
|
|
33
|
+
lg: "h-10 rounded-md px-8",
|
|
34
|
+
icon: "h-9 w-9"
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
defaultVariants: {
|
|
38
|
+
variant: "default",
|
|
39
|
+
size: "default"
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
), _ = i.forwardRef(
|
|
43
|
+
({ className: t, variant: e, size: o, asChild: s = !1, ...d }, p) => {
|
|
44
|
+
const A = s ? E : "button";
|
|
45
|
+
return /* @__PURE__ */ r.jsx(A, { className: n(P({ variant: e, size: o, className: t })), ref: p, ...d });
|
|
46
|
+
}
|
|
47
|
+
);
|
|
48
|
+
_.displayName = "Button";
|
|
49
|
+
const W = c.Portal, Z = c.Provider, $ = c.Root, tt = c.Trigger, V = i.forwardRef(({ className: t, sideOffset: e = 4, ...o }, s) => /* @__PURE__ */ r.jsx(
|
|
50
|
+
c.Content,
|
|
51
|
+
{
|
|
52
|
+
ref: s,
|
|
53
|
+
sideOffset: e,
|
|
54
|
+
className: n(
|
|
55
|
+
"z-50 overflow-hidden rounded-md bg-primary px-3 py-1.5 text-xs text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-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",
|
|
56
|
+
t
|
|
57
|
+
),
|
|
58
|
+
...o
|
|
59
|
+
}
|
|
60
|
+
));
|
|
61
|
+
V.displayName = c.Content.displayName;
|
|
62
|
+
const I = 1, C = 1e6;
|
|
63
|
+
let f = 0;
|
|
64
|
+
function M() {
|
|
65
|
+
return f = (f + 1) % Number.MAX_VALUE, f.toString();
|
|
66
|
+
}
|
|
67
|
+
const v = /* @__PURE__ */ new Map(), g = (t) => {
|
|
68
|
+
if (v.has(t))
|
|
69
|
+
return;
|
|
70
|
+
const e = setTimeout(() => {
|
|
71
|
+
v.delete(t), u({
|
|
72
|
+
type: "REMOVE_TOAST",
|
|
73
|
+
toastId: t
|
|
74
|
+
});
|
|
75
|
+
}, C);
|
|
76
|
+
v.set(t, e);
|
|
77
|
+
}, z = (t, e) => {
|
|
78
|
+
switch (e.type) {
|
|
79
|
+
case "ADD_TOAST":
|
|
80
|
+
return {
|
|
81
|
+
...t,
|
|
82
|
+
toasts: [e.toast, ...t.toasts].slice(0, I)
|
|
83
|
+
};
|
|
84
|
+
case "UPDATE_TOAST":
|
|
85
|
+
return {
|
|
86
|
+
...t,
|
|
87
|
+
toasts: t.toasts.map((o) => o.id === e.toast.id ? { ...o, ...e.toast } : o)
|
|
88
|
+
};
|
|
89
|
+
case "DISMISS_TOAST": {
|
|
90
|
+
const { toastId: o } = e;
|
|
91
|
+
return o ? g(o) : t.toasts.forEach((s) => {
|
|
92
|
+
g(s.id);
|
|
93
|
+
}), {
|
|
94
|
+
...t,
|
|
95
|
+
toasts: t.toasts.map(
|
|
96
|
+
(s) => s.id === o || o === void 0 ? {
|
|
97
|
+
...s,
|
|
98
|
+
open: !1
|
|
99
|
+
} : s
|
|
100
|
+
)
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
case "REMOVE_TOAST":
|
|
104
|
+
return e.toastId === void 0 ? {
|
|
105
|
+
...t,
|
|
106
|
+
toasts: []
|
|
107
|
+
} : {
|
|
108
|
+
...t,
|
|
109
|
+
toasts: t.toasts.filter((o) => o.id !== e.toastId)
|
|
110
|
+
};
|
|
111
|
+
}
|
|
112
|
+
}, l = [];
|
|
113
|
+
let m = { toasts: [] };
|
|
114
|
+
function u(t) {
|
|
115
|
+
m = z(m, t), l.forEach((e) => {
|
|
116
|
+
e(m);
|
|
117
|
+
});
|
|
118
|
+
}
|
|
119
|
+
function B({ ...t }) {
|
|
120
|
+
const e = M(), o = (d) => u({
|
|
121
|
+
type: "UPDATE_TOAST",
|
|
122
|
+
toast: { ...d, id: e }
|
|
123
|
+
}), s = () => u({ type: "DISMISS_TOAST", toastId: e });
|
|
124
|
+
return u({
|
|
125
|
+
type: "ADD_TOAST",
|
|
126
|
+
toast: {
|
|
127
|
+
...t,
|
|
128
|
+
id: e,
|
|
129
|
+
open: !0,
|
|
130
|
+
onOpenChange: (d) => {
|
|
131
|
+
d || s();
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
}), {
|
|
135
|
+
id: e,
|
|
136
|
+
dismiss: s,
|
|
137
|
+
update: o
|
|
138
|
+
};
|
|
139
|
+
}
|
|
140
|
+
function k() {
|
|
141
|
+
const [t, e] = i.useState(m);
|
|
142
|
+
return i.useEffect(() => (l.push(e), () => {
|
|
143
|
+
const o = l.indexOf(e);
|
|
144
|
+
o > -1 && l.splice(o, 1);
|
|
145
|
+
}), [t]), {
|
|
146
|
+
...t,
|
|
147
|
+
toast: B,
|
|
148
|
+
dismiss: (o) => u({ type: "DISMISS_TOAST", toastId: o })
|
|
149
|
+
};
|
|
150
|
+
}
|
|
151
|
+
const L = a.Provider, b = i.forwardRef(({ className: t, ...e }, o) => /* @__PURE__ */ r.jsx(
|
|
152
|
+
a.Viewport,
|
|
153
|
+
{
|
|
154
|
+
ref: o,
|
|
155
|
+
className: n(
|
|
156
|
+
"fixed top-0 z-[100] flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-[420px]",
|
|
157
|
+
t
|
|
158
|
+
),
|
|
159
|
+
...e
|
|
160
|
+
}
|
|
161
|
+
));
|
|
162
|
+
b.displayName = a.Viewport.displayName;
|
|
163
|
+
const U = h(
|
|
164
|
+
"group pointer-events-auto relative flex w-full items-center justify-between space-x-2 overflow-hidden rounded-md border p-4 pr-6 shadow-lg transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full",
|
|
165
|
+
{
|
|
166
|
+
variants: {
|
|
167
|
+
variant: {
|
|
168
|
+
default: "border bg-background",
|
|
169
|
+
destructive: "destructive group border-destructive bg-destructive text-destructive-foreground"
|
|
170
|
+
}
|
|
171
|
+
},
|
|
172
|
+
defaultVariants: {
|
|
173
|
+
variant: "default"
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
), y = i.forwardRef(({ className: t, variant: e, ...o }, s) => /* @__PURE__ */ r.jsx(a.Root, { ref: s, className: n(U({ variant: e }), t), ...o }));
|
|
177
|
+
y.displayName = a.Root.displayName;
|
|
178
|
+
const Q = i.forwardRef(({ className: t, ...e }, o) => /* @__PURE__ */ r.jsx(
|
|
179
|
+
a.Action,
|
|
180
|
+
{
|
|
181
|
+
ref: o,
|
|
182
|
+
className: n(
|
|
183
|
+
"inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium transition-colors hover:bg-secondary focus:outline-none focus:ring-1 focus:ring-ring disabled:pointer-events-none disabled:opacity-50 group-[.destructive]:border-muted/40 group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground group-[.destructive]:focus:ring-destructive",
|
|
184
|
+
t
|
|
185
|
+
),
|
|
186
|
+
...e
|
|
187
|
+
}
|
|
188
|
+
));
|
|
189
|
+
Q.displayName = a.Action.displayName;
|
|
190
|
+
const w = i.forwardRef(({ className: t, ...e }, o) => /* @__PURE__ */ r.jsx(
|
|
191
|
+
a.Close,
|
|
192
|
+
{
|
|
193
|
+
ref: o,
|
|
194
|
+
className: n(
|
|
195
|
+
"absolute right-1 top-1 rounded-md p-1 text-foreground/50 opacity-0 transition-opacity hover:text-foreground focus:opacity-100 focus:outline-none focus:ring-1 group-hover:opacity-100 group-[.destructive]:text-red-300 group-[.destructive]:hover:text-red-50 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600",
|
|
196
|
+
t
|
|
197
|
+
),
|
|
198
|
+
"toast-close": "",
|
|
199
|
+
...e,
|
|
200
|
+
children: /* @__PURE__ */ r.jsx(O, { className: "h-4 w-4" })
|
|
201
|
+
}
|
|
202
|
+
));
|
|
203
|
+
w.displayName = a.Close.displayName;
|
|
204
|
+
const N = i.forwardRef(({ className: t, ...e }, o) => /* @__PURE__ */ r.jsx(a.Title, { ref: o, className: n("text-sm font-semibold [&+div]:text-xs", t), ...e }));
|
|
205
|
+
N.displayName = a.Title.displayName;
|
|
206
|
+
const S = i.forwardRef(({ className: t, ...e }, o) => /* @__PURE__ */ r.jsx(a.Description, { ref: o, className: n("text-sm opacity-90", t), ...e }));
|
|
207
|
+
S.displayName = a.Description.displayName;
|
|
208
|
+
function et() {
|
|
209
|
+
const { toasts: t } = k();
|
|
210
|
+
return /* @__PURE__ */ r.jsxs(L, { children: [
|
|
211
|
+
t.map(({ id: e, title: o, description: s, action: d, ...p }) => /* @__PURE__ */ r.jsxs(y, { ...p, children: [
|
|
212
|
+
/* @__PURE__ */ r.jsxs("div", { className: "grid gap-1", children: [
|
|
213
|
+
o && /* @__PURE__ */ r.jsx(N, { children: o }),
|
|
214
|
+
s && /* @__PURE__ */ r.jsx(S, { children: s })
|
|
215
|
+
] }),
|
|
216
|
+
d,
|
|
217
|
+
/* @__PURE__ */ r.jsx(w, {})
|
|
218
|
+
] }, e)),
|
|
219
|
+
/* @__PURE__ */ r.jsx(b, {})
|
|
220
|
+
] });
|
|
221
|
+
}
|
|
222
|
+
const ot = ({ className: t, ...e }) => /* @__PURE__ */ r.jsx("div", { className: n("animate-pulse rounded-md bg-primary/10", t), ...e });
|
|
223
|
+
export {
|
|
224
|
+
_ as B,
|
|
225
|
+
ot as S,
|
|
226
|
+
$ as T,
|
|
227
|
+
tt as a,
|
|
228
|
+
P as b,
|
|
229
|
+
V as c,
|
|
230
|
+
Z as d,
|
|
231
|
+
W as e,
|
|
232
|
+
k as f,
|
|
233
|
+
et as g,
|
|
234
|
+
T as h,
|
|
235
|
+
D as i,
|
|
236
|
+
z as r,
|
|
237
|
+
B as t,
|
|
238
|
+
K as u
|
|
239
|
+
};
|
package/dist/studio.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("./jsx-runtime-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("./jsx-runtime-JYMCiFoE.cjs");const e=require("./index-9MmykVSc.cjs");require("react");require("sonner");require("./ChaiBuilderEditor-m30yoOgJ.cjs");require("./MODIFIERS-o1p3VnpS.cjs");require("clsx");require("@radix-ui/react-scroll-area");require("react-dom");require("@floating-ui/react-dom");require("jotai");require("i18next");require("react-i18next");require("flagged");require("lodash-es");require("./skeleton-STeL9VrJ.cjs");require("@radix-ui/react-slot");require("class-variance-authority");require("./utils-qK_SjzzV.cjs");require("tailwind-merge");require("@radix-ui/react-tooltip");require("@radix-ui/react-icons");require("@radix-ui/react-toast");require("./Functions-Hvon6AMZ.cjs");require("react-hotkeys-hook");require("@react-hookz/web");require("@chaibuilder/runtime");require("./html-to-json-uSnxl72F.cjs");require("himalaya");require("./STRINGS-gPz7CUOk.cjs");require("lucide-react");require("./iconBase-gbUAAO2L.cjs");require("./alert-dialog-P9xMMB6C.cjs");require("@radix-ui/react-alert-dialog");exports.ChaiBuilderStudio=e.ChaiBuilderStudio;
|
package/dist/studio.d.ts
CHANGED
|
@@ -24,6 +24,7 @@ declare type ChaiBlock = {
|
|
|
24
24
|
} & Record<string, any>;
|
|
25
25
|
|
|
26
26
|
declare interface ChaiBuilderEditorProps {
|
|
27
|
+
hideSaveButton?: boolean;
|
|
27
28
|
filterChaiBlock?: (block: any) => boolean;
|
|
28
29
|
showDebugLogs?: boolean;
|
|
29
30
|
autoSaveSupport?: boolean;
|
|
@@ -61,7 +62,7 @@ declare interface ChaiBuilderEditorProps {
|
|
|
61
62
|
onSave?: ({ blocks, providers }: SavePageData) => Promise<boolean | Error>;
|
|
62
63
|
brandingOptions?: Record<string, string>;
|
|
63
64
|
onSaveBrandingOptions?: (brandingOptions: Record<string, any>) => Promise<boolean | Error>;
|
|
64
|
-
|
|
65
|
+
onSaveStateChange?: (syncStatus: "UNSAVED" | "SAVED" | "SAVING") => void;
|
|
65
66
|
previewComponent?: ReactComponentType;
|
|
66
67
|
sideBarComponents?: {
|
|
67
68
|
bottom?: ReactComponentType[];
|
|
@@ -105,7 +106,9 @@ declare type DataProvider = {
|
|
|
105
106
|
};
|
|
106
107
|
|
|
107
108
|
declare type OutlineMenuItem = {
|
|
108
|
-
item:
|
|
109
|
+
item: React_2.ComponentType<{
|
|
110
|
+
blockId: string;
|
|
111
|
+
}>;
|
|
109
112
|
tooltip: string | ReactNode;
|
|
110
113
|
};
|
|
111
114
|
|
package/dist/studio.js
CHANGED
|
@@ -1,53 +1,37 @@
|
|
|
1
|
-
import "./jsx-runtime-
|
|
2
|
-
import { C as
|
|
1
|
+
import "./jsx-runtime-Sp0orL4X.js";
|
|
2
|
+
import { C as I } from "./index-hElOGcFr.js";
|
|
3
3
|
import "react";
|
|
4
4
|
import "sonner";
|
|
5
|
-
import "./
|
|
6
|
-
import "./
|
|
5
|
+
import "./ChaiBuilderEditor-vP4at00I.js";
|
|
6
|
+
import "./MODIFIERS-CNqNUapY.js";
|
|
7
|
+
import "clsx";
|
|
8
|
+
import "@radix-ui/react-scroll-area";
|
|
9
|
+
import "react-dom";
|
|
10
|
+
import "@floating-ui/react-dom";
|
|
11
|
+
import "jotai";
|
|
7
12
|
import "i18next";
|
|
8
13
|
import "react-i18next";
|
|
9
|
-
import "
|
|
14
|
+
import "flagged";
|
|
10
15
|
import "lodash-es";
|
|
11
|
-
import "./
|
|
12
|
-
import "clsx";
|
|
13
|
-
import "tailwind-merge";
|
|
14
|
-
import "@chaibuilder/runtime";
|
|
15
|
-
import "jotai";
|
|
16
|
-
import "./STRINGS--j49GZJP.js";
|
|
17
|
-
import "@react-hookz/web";
|
|
18
|
-
import "./MODIFIERS-dytZ-osO.js";
|
|
19
|
-
import "@radix-ui/react-toggle";
|
|
20
|
-
import "class-variance-authority";
|
|
21
|
-
import "./Class-lGzsNBOK.js";
|
|
22
|
-
import "@radix-ui/react-switch";
|
|
16
|
+
import "./skeleton-lu8e7q2y.js";
|
|
23
17
|
import "@radix-ui/react-slot";
|
|
24
|
-
import "
|
|
25
|
-
import "
|
|
26
|
-
import "
|
|
27
|
-
import "@radix-ui/react-dialog";
|
|
28
|
-
import "@radix-ui/react-label";
|
|
29
|
-
import "@radix-ui/react-scroll-area";
|
|
30
|
-
import "@radix-ui/react-tabs";
|
|
18
|
+
import "class-variance-authority";
|
|
19
|
+
import "./utils-dze1SGvB.js";
|
|
20
|
+
import "tailwind-merge";
|
|
31
21
|
import "@radix-ui/react-tooltip";
|
|
32
|
-
import "@radix-ui/react-
|
|
33
|
-
import "@radix-ui/react-menubar";
|
|
34
|
-
import "@radix-ui/react-hover-card";
|
|
35
|
-
import "@radix-ui/react-select";
|
|
36
|
-
import "@radix-ui/react-dropdown-menu";
|
|
37
|
-
import "@radix-ui/react-separator";
|
|
22
|
+
import "@radix-ui/react-icons";
|
|
38
23
|
import "@radix-ui/react-toast";
|
|
39
|
-
import "
|
|
40
|
-
import "@radix-ui/react-context-menu";
|
|
41
|
-
import "react-icons-picker";
|
|
42
|
-
import "react-dom";
|
|
43
|
-
import "react-quill";
|
|
44
|
-
import "@floating-ui/react-dom";
|
|
45
|
-
import "flagged";
|
|
24
|
+
import "./Functions-NzT2Six_.js";
|
|
46
25
|
import "react-hotkeys-hook";
|
|
47
|
-
import "
|
|
26
|
+
import "@react-hookz/web";
|
|
27
|
+
import "@chaibuilder/runtime";
|
|
28
|
+
import "./html-to-json-2xtb7520.js";
|
|
48
29
|
import "himalaya";
|
|
30
|
+
import "./STRINGS-b432aBJJ.js";
|
|
49
31
|
import "lucide-react";
|
|
50
|
-
import "./
|
|
32
|
+
import "./iconBase-h4DuR_XT.js";
|
|
33
|
+
import "./alert-dialog-rypfO5ly.js";
|
|
34
|
+
import "@radix-ui/react-alert-dialog";
|
|
51
35
|
export {
|
|
52
|
-
|
|
36
|
+
I as ChaiBuilderStudio
|
|
53
37
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const a=require("./jsx-runtime-JYMCiFoE.cjs"),N=require("react"),R=require("@radix-ui/react-dialog"),v=require("@radix-ui/react-icons"),i=require("./utils-qK_SjzzV.cjs"),D=require("@radix-ui/react-tabs");function c(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const s in e)if(s!=="default"){const l=Object.getOwnPropertyDescriptor(e,s);Object.defineProperty(t,s,l.get?l:{enumerable:!0,get:()=>e[s]})}}return t.default=e,Object.freeze(t)}const n=c(N),o=c(R),r=c(D),T=o.Root,w=o.Trigger,d=({className:e,...t})=>a.jsxRuntimeExports.jsx(o.Portal,{className:i.cn(e),...t});d.displayName=o.Portal.displayName;const m=n.forwardRef(({className:e,...t},s)=>a.jsxRuntimeExports.jsx(o.Overlay,{ref:s,className:i.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}));m.displayName=o.Overlay.displayName;const u=n.forwardRef(({className:e,children:t,...s},l)=>a.jsxRuntimeExports.jsxs(d,{children:[a.jsxRuntimeExports.jsx(m,{}),a.jsxRuntimeExports.jsxs(o.Content,{ref:l,className:i.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,a.jsxRuntimeExports.jsxs(o.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:[a.jsxRuntimeExports.jsx(v.Cross2Icon,{className:"h-4 w-4"}),a.jsxRuntimeExports.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));u.displayName=o.Content.displayName;const g=({className:e,...t})=>a.jsxRuntimeExports.jsx("div",{className:i.cn("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});g.displayName="DialogHeader";const f=({className:e,...t})=>a.jsxRuntimeExports.jsx("div",{className:i.cn("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});f.displayName="DialogFooter";const p=n.forwardRef(({className:e,...t},s)=>a.jsxRuntimeExports.jsx(o.Title,{ref:s,className:i.cn("text-lg font-semibold leading-none tracking-tight",e),...t}));p.displayName=o.Title.displayName;const x=n.forwardRef(({className:e,...t},s)=>a.jsxRuntimeExports.jsx(o.Description,{ref:s,className:i.cn("text-sm text-muted-foreground",e),...t}));x.displayName=o.Description.displayName;const E=r.Root,b=n.forwardRef(({className:e,...t},s)=>a.jsxRuntimeExports.jsx(r.List,{ref:s,className:i.cn("inline-flex h-9 items-center justify-center rounded-lg bg-muted p-1 text-muted-foreground",e),...t}));b.displayName=r.List.displayName;const j=n.forwardRef(({className:e,...t},s)=>a.jsxRuntimeExports.jsx(r.Trigger,{ref:s,className:i.cn("inline-flex items-center justify-center whitespace-nowrap rounded-md px-3 py-1 text-sm font-medium ring-offset-background transition-all 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=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow",e),...t}));j.displayName=r.Trigger.displayName;const y=n.forwardRef(({className:e,...t},s)=>a.jsxRuntimeExports.jsx(r.Content,{ref:s,className:i.cn("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...t}));y.displayName=r.Content.displayName;exports.Dialog=T;exports.DialogContent=u;exports.DialogDescription=x;exports.DialogFooter=f;exports.DialogHeader=g;exports.DialogTitle=p;exports.DialogTrigger=w;exports.Tabs=E;exports.TabsContent=y;exports.TabsList=b;exports.TabsTrigger=j;
|