@chaibuilder/sdk 1.2.25 → 1.2.26
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/AddBlocks-l1JENNvq.js +206 -0
- package/dist/AddBlocks-zPPKkeKs.cjs +1 -0
- package/dist/BrandingOptions-DkpqGARR.cjs +1 -0
- package/dist/{BrandingOptions-iTyWpwTs.js → BrandingOptions-udtH5yJs.js} +54 -40
- package/dist/{CanvasArea-dZjng782.js → CanvasArea-h0W-Tyha.js} +324 -340
- package/dist/CanvasArea-zme1r3Zi.cjs +55 -0
- package/dist/Class-PoYusiA5.cjs +1 -0
- package/dist/{Class-ahc3NIbq.js → Class-lGzsNBOK.js} +29 -26
- package/dist/CurrentPage-Hl52iub_.cjs +1 -0
- package/dist/{CurrentPage-Kmfp-kFk.js → CurrentPage-tJUjXWdb.js} +54 -40
- package/dist/Functions-7jnEwJyw.js +15 -0
- package/dist/Functions-N3yhPYKY.cjs +1 -0
- package/dist/ListTree-WvTjY5rr.cjs +1 -0
- package/dist/{ListTree-N3jeD790.js → ListTree-cZ-Ihlt3.js} +96 -86
- package/dist/MODIFIERS-0g14w5RS.cjs +1 -0
- package/dist/{MODIFIERS-CNqNUapY.js → MODIFIERS-dytZ-osO.js} +4 -10
- package/dist/PagesPanel-6rrLXEO-.js +64 -0
- package/dist/PagesPanel-WzCocl6u.cjs +1 -0
- package/dist/ProjectPanel-o7gdcwPn.cjs +1 -0
- package/dist/ProjectPanel-tz3bjdXy.js +85 -0
- package/dist/{STRINGS-b432aBJJ.js → STRINGS--j49GZJP.js} +2 -2
- package/dist/{Settings-jCcd-VE6.js → Settings-4s2LUVmC.js} +401 -407
- package/dist/Settings-AqoKwR92.cjs +1 -0
- package/dist/SidePanels-3o6Okmvu.cjs +1 -0
- package/dist/{SidePanels-pHMYprpW.js → SidePanels-bugFfInz.js} +118 -108
- package/dist/Topbar-CqW7G360.cjs +1 -0
- package/dist/Topbar-pWzBEOed.js +132 -0
- package/dist/UnsplashImages-NGskB93R.cjs +1 -0
- package/dist/{UnsplashImages-L7x_3RQf.js → UnsplashImages-qvwFbV-E.js} +63 -50
- package/dist/{UploadImages-zdEJRLD8.js → UploadImages-9NapgXBq.js} +60 -37
- package/dist/UploadImages-Oh7Glr9A.cjs +1 -0
- package/dist/_commonjsHelpers-UyOWmZb0.js +8 -0
- package/dist/_commonjsHelpers-wDK0ZLPo.cjs +1 -0
- package/dist/add-page-modal--6TTBRYa.cjs +1 -0
- package/dist/add-page-modal-k2Kb92HS.js +104 -0
- package/dist/confirm-alert-C4M9eF-o.cjs +1 -0
- package/dist/confirm-alert-GUhZ_G8w.js +60 -0
- package/dist/controls-KK2oLIa8.cjs +1 -0
- package/dist/{controls-IS5qnRce.js → controls-OfJWSEqC.js} +85 -20
- package/dist/core.cjs +1 -1
- package/dist/core.js +75 -150
- package/dist/defaultTheme-7VqqhOcp.cjs +1 -0
- package/dist/{defaultTheme-4kA60XdB.js → defaultTheme-D8B4-wHO.js} +8 -6
- package/dist/delete-page-modal-cFoL-wdo.cjs +1 -0
- package/dist/delete-page-modal-zONvdebd.js +83 -0
- package/dist/email-blocks.cjs +1 -1
- package/dist/email-blocks.js +292 -3
- package/dist/email.cjs +1 -1
- package/dist/email.js +37 -18
- package/dist/empty-slot-ZBlsQi6m.js +15 -0
- package/dist/empty-slot-nzYOgZuS.cjs +1 -0
- package/dist/{form-0_RLz2TB.js → form-STUz-6nE.js} +12 -12
- package/dist/form-lBQ_76Uw.cjs +1 -0
- package/dist/{html-to-json-uSnxl72F.cjs → html-to-json-efmv1pCj.cjs} +1 -1
- package/dist/{html-to-json-2xtb7520.js → html-to-json-ngX9ef2u.js} +41 -41
- package/dist/index-Gk6sASBd.js +3080 -0
- package/dist/index-OB199Izc.cjs +206 -0
- package/dist/index-SkyM3d6Q.js +39503 -0
- package/dist/index-YpnaudSM.js +63 -0
- package/dist/index-e0c8PmRQ.js +205 -0
- package/dist/index-ecnGWzh9.cjs +1 -0
- package/dist/index-gi1LIOCw.cjs +1 -0
- package/dist/index-h-hd6EvN.cjs +1 -0
- package/dist/index-llTXLDGE.js +2201 -0
- package/dist/index-mbyqq81O.cjs +1 -0
- package/dist/{jsx-runtime-Sp0orL4X.js → jsx-runtime-WbnYoNE9.js} +109 -106
- package/dist/jsx-runtime-Z_BpKhVy.cjs +27 -0
- package/dist/lib.cjs +2 -2
- package/dist/lib.js +66 -62
- package/dist/page-viewer-2kwnKM6v.cjs +1 -0
- package/dist/{page-viewer-NnOwmAmu.js → page-viewer-Pdg9F5Hv.js} +57 -43
- package/dist/project-general-setting-CnNL98NM.cjs +1 -0
- package/dist/{project-general-setting-9ju3TDju.js → project-general-setting-f8Ebsn6K.js} +43 -35
- package/dist/project-seo-setting-mlxL_e2_.cjs +1 -0
- package/dist/{project-seo-setting-36CdUszM.js → project-seo-setting-pX34Qsym.js} +40 -23
- package/dist/render.cjs +1 -1
- package/dist/render.js +14 -13
- package/dist/single-page-detail-XfzrGlzA.cjs +1 -0
- package/dist/{single-page-detail-hD1jKZ8k.js → single-page-detail-dpe5LT0M.js} +74 -66
- package/dist/studio.cjs +1 -1
- package/dist/studio.js +40 -24
- package/dist/ui.cjs +1 -1
- package/dist/ui.js +160 -365
- package/dist/web-blocks.cjs +6 -1
- package/dist/web-blocks.js +1153 -3
- package/package.json +1 -1
- package/dist/AddBlocks-Ol3iIVKa.js +0 -207
- package/dist/AddBlocks-a1c-7Ewz.cjs +0 -1
- package/dist/BrandingOptions-6rnt0UaA.cjs +0 -1
- package/dist/CanvasArea-R4ogF9AT.cjs +0 -55
- package/dist/ChaiBuilderEditor-m30yoOgJ.cjs +0 -163
- package/dist/ChaiBuilderEditor-vP4at00I.js +0 -27974
- package/dist/Class-eieto7e-.cjs +0 -1
- package/dist/Controls-3Cc1XYXg.js +0 -105
- package/dist/Controls-ky25Ebo3.cjs +0 -1
- package/dist/CurrentPage-3gQTH0Zt.cjs +0 -1
- package/dist/Functions-Hvon6AMZ.cjs +0 -1
- package/dist/Functions-NzT2Six_.js +0 -15
- package/dist/ImagesPanel-J1RlG7xG.cjs +0 -1
- package/dist/ImagesPanel-Wb0GF_NA.js +0 -29
- package/dist/ListTree-CZ-mtjZ9.cjs +0 -1
- package/dist/MODIFIERS-o1p3VnpS.cjs +0 -1
- package/dist/PagesPanel-Gi0z6gaf.cjs +0 -1
- package/dist/PagesPanel-u1IB-nRr.js +0 -48
- package/dist/ProjectPanel-EydGZmMW.js +0 -71
- package/dist/ProjectPanel-kiiljG4H.cjs +0 -1
- package/dist/Settings-8ilCSH8b.cjs +0 -1
- package/dist/SidePanels-T36C6Lhc.cjs +0 -1
- package/dist/Topbar-CvWQuspR.cjs +0 -1
- package/dist/Topbar-pbIDUE_B.js +0 -122
- package/dist/UnsplashImages-KBZPd9dv.cjs +0 -1
- package/dist/UploadImages-GkkJVAgG.cjs +0 -1
- package/dist/accordion-oPUeqPCZ.js +0 -42
- package/dist/accordion-ynvFtV_p.cjs +0 -1
- package/dist/add-page-modal-9SGv2hgc.cjs +0 -1
- package/dist/add-page-modal-JCDXZIPW.js +0 -95
- package/dist/alert-dialog-P9xMMB6C.cjs +0 -1
- package/dist/alert-dialog-rypfO5ly.js +0 -64
- package/dist/badge-E-S7CqUt.cjs +0 -1
- package/dist/badge-tEwO7C51.js +0 -23
- package/dist/block-helpers-OKHmRRol.cjs +0 -1
- package/dist/block-helpers-oSFpSsGz.js +0 -23
- package/dist/command-BxR6jaCI.cjs +0 -1
- package/dist/command-Pn3HKDuV.js +0 -97
- package/dist/confirm-alert-uNm0lZ0y.cjs +0 -1
- package/dist/confirm-alert-wR5_VJ1l.js +0 -36
- package/dist/context-menu-8dC9uGXj.js +0 -122
- package/dist/context-menu-IgLbIuth.cjs +0 -1
- package/dist/controls-L7DPvB0m.cjs +0 -1
- package/dist/defaultTheme-mrkeGFGI.cjs +0 -1
- package/dist/delete-page-modal-7KmP1elv.js +0 -67
- package/dist/delete-page-modal-SgfwvfNu.cjs +0 -1
- package/dist/dropdown-menu-El86_9Uo.js +0 -124
- package/dist/dropdown-menu-SiHzqWwZ.cjs +0 -1
- package/dist/form-W58AVUdf.cjs +0 -1
- package/dist/hover-card-KUwpDkW8.cjs +0 -1
- package/dist/hover-card-q138xxXR.js +0 -45
- package/dist/iconBase-gbUAAO2L.cjs +0 -1
- package/dist/iconBase-h4DuR_XT.js +0 -63
- package/dist/index-9MmykVSc.cjs +0 -1
- package/dist/index-hElOGcFr.js +0 -2200
- package/dist/index-lDTsQp7h.js +0 -188
- package/dist/index-rq5Y9ZDy.cjs +0 -1
- package/dist/jsx-runtime-JYMCiFoE.cjs +0 -27
- package/dist/label-KaP7MRrs.js +0 -10
- package/dist/label-tFm8HZdb.cjs +0 -1
- package/dist/link-WbcKdQ9k.cjs +0 -1
- package/dist/link-xuhP-4dN.js +0 -196
- package/dist/page-viewer-Hx5hxHKm.cjs +0 -1
- package/dist/popover-a84pbVhQ.js +0 -23
- package/dist/popover-fKjgcRUx.cjs +0 -1
- package/dist/project-general-setting-FxkwjvJz.cjs +0 -1
- package/dist/project-seo-setting-RU7qiXxb.cjs +0 -1
- package/dist/scroll-area-FiHvy-TZ.cjs +0 -1
- package/dist/scroll-area-ewXbxc3n.js +0 -30
- package/dist/select-7bjg-rr9.cjs +0 -1
- package/dist/select-POGdEDHT.js +0 -75
- package/dist/separator-3Civ-6hb.cjs +0 -1
- package/dist/separator-SctTn0Qi.js +0 -18
- package/dist/single-page-detail-beY0MT1b.cjs +0 -1
- package/dist/skeleton-STeL9VrJ.cjs +0 -1
- package/dist/skeleton-lu8e7q2y.js +0 -239
- package/dist/tabs-_4WbA1cc.cjs +0 -1
- package/dist/tabs-yQ3oGziM.js +0 -106
- package/dist/textarea-1kZEh7ki.cjs +0 -1
- package/dist/textarea-b2QvVhrK.js +0 -73
- package/dist/useAddBlock-8pxOEYIl.cjs +0 -1
- package/dist/useAddBlock-FEKFJNwQ.js +0 -69
- package/dist/useChaiExternalData-fkFgoS80.js +0 -6
- package/dist/useChaiExternalData-rwoAZ6uU.cjs +0 -1
- package/dist/useDarkMode-7i57segK.cjs +0 -1
- package/dist/useDarkMode-8VHJlYyE.js +0 -23
- package/dist/useSelectedBreakpoints-6NK5qd7T.js +0 -10
- package/dist/useSelectedBreakpoints-7ONXb-vN.cjs +0 -1
- package/dist/useStylingState-Iuj84yvc.js +0 -186
- package/dist/useStylingState-OIvJMV6p.cjs +0 -1
- package/dist/useUiLibraries-nCdauJ4N.cjs +0 -1
- package/dist/useUiLibraries-psyWFbNc.js +0 -12
- package/dist/useUpdateBlocksProps-Unn8lUyj.cjs +0 -1
- package/dist/useUpdateBlocksProps-vWcDp-P9.js +0 -23
- package/dist/utils-dze1SGvB.js +0 -6
- package/dist/utils-qK_SjzzV.cjs +0 -1
package/dist/select-POGdEDHT.js
DELETED
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
import { j as t } from "./jsx-runtime-Sp0orL4X.js";
|
|
2
|
-
import * as i from "react";
|
|
3
|
-
import { CaretSortIcon as n, CheckIcon as c } from "@radix-ui/react-icons";
|
|
4
|
-
import * as e from "@radix-ui/react-select";
|
|
5
|
-
import { c as r } from "./utils-dze1SGvB.js";
|
|
6
|
-
const y = e.Root, w = e.Group, N = e.Value, m = i.forwardRef(({ className: s, children: o, ...a }, d) => /* @__PURE__ */ t.jsxs(
|
|
7
|
-
e.Trigger,
|
|
8
|
-
{
|
|
9
|
-
ref: d,
|
|
10
|
-
className: r(
|
|
11
|
-
"flex h-9 w-full items-center justify-between rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring disabled:cursor-not-allowed disabled:opacity-50",
|
|
12
|
-
s
|
|
13
|
-
),
|
|
14
|
-
...a,
|
|
15
|
-
children: [
|
|
16
|
-
o,
|
|
17
|
-
/* @__PURE__ */ t.jsx(e.Icon, { asChild: !0, children: /* @__PURE__ */ t.jsx(n, { className: "h-4 w-4 opacity-50" }) })
|
|
18
|
-
]
|
|
19
|
-
}
|
|
20
|
-
));
|
|
21
|
-
m.displayName = e.Trigger.displayName;
|
|
22
|
-
const p = i.forwardRef(({ className: s, children: o, position: a = "popper", ...d }, l) => /* @__PURE__ */ t.jsx(e.Portal, { children: /* @__PURE__ */ t.jsx(
|
|
23
|
-
e.Content,
|
|
24
|
-
{
|
|
25
|
-
ref: l,
|
|
26
|
-
className: r(
|
|
27
|
-
"relative z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover 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",
|
|
28
|
-
a === "popper" && "data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",
|
|
29
|
-
s
|
|
30
|
-
),
|
|
31
|
-
position: a,
|
|
32
|
-
...d,
|
|
33
|
-
children: /* @__PURE__ */ t.jsx(
|
|
34
|
-
e.Viewport,
|
|
35
|
-
{
|
|
36
|
-
className: r(
|
|
37
|
-
"p-1",
|
|
38
|
-
a === "popper" && "h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"
|
|
39
|
-
),
|
|
40
|
-
children: o
|
|
41
|
-
}
|
|
42
|
-
)
|
|
43
|
-
}
|
|
44
|
-
) }));
|
|
45
|
-
p.displayName = e.Content.displayName;
|
|
46
|
-
const f = i.forwardRef(({ className: s, ...o }, a) => /* @__PURE__ */ t.jsx(e.Label, { ref: a, className: r("px-2 py-1.5 text-sm font-semibold", s), ...o }));
|
|
47
|
-
f.displayName = e.Label.displayName;
|
|
48
|
-
const u = i.forwardRef(({ className: s, children: o, ...a }, d) => /* @__PURE__ */ t.jsxs(
|
|
49
|
-
e.Item,
|
|
50
|
-
{
|
|
51
|
-
ref: d,
|
|
52
|
-
className: r(
|
|
53
|
-
"relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-2 pr-8 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
|
|
54
|
-
s
|
|
55
|
-
),
|
|
56
|
-
...a,
|
|
57
|
-
children: [
|
|
58
|
-
/* @__PURE__ */ t.jsx("span", { className: "absolute right-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ t.jsx(e.ItemIndicator, { children: /* @__PURE__ */ t.jsx(c, { className: "h-4 w-4" }) }) }),
|
|
59
|
-
/* @__PURE__ */ t.jsx(e.ItemText, { children: o })
|
|
60
|
-
]
|
|
61
|
-
}
|
|
62
|
-
));
|
|
63
|
-
u.displayName = e.Item.displayName;
|
|
64
|
-
const x = i.forwardRef(({ className: s, ...o }, a) => /* @__PURE__ */ t.jsx(e.Separator, { ref: a, className: r("-mx-1 my-1 h-px bg-muted", s), ...o }));
|
|
65
|
-
x.displayName = e.Separator.displayName;
|
|
66
|
-
export {
|
|
67
|
-
y as S,
|
|
68
|
-
w as a,
|
|
69
|
-
N as b,
|
|
70
|
-
m as c,
|
|
71
|
-
p as d,
|
|
72
|
-
f as e,
|
|
73
|
-
u as f,
|
|
74
|
-
x as g
|
|
75
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";const i=require("./jsx-runtime-JYMCiFoE.cjs"),u=require("react"),l=require("@radix-ui/react-separator"),p=require("./utils-qK_SjzzV.cjs");function a(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const o=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,o.get?o:{enumerable:!0,get:()=>e[r]})}}return t.default=e,Object.freeze(t)}const f=a(u),n=a(l),s=f.forwardRef(({className:e,orientation:t="horizontal",decorative:r=!0,...o},c)=>i.jsxRuntimeExports.jsx(n.Root,{ref:c,decorative:r,orientation:t,className:p.cn("shrink-0 bg-border",t==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",e),...o}));s.displayName=n.Root.displayName;exports.Separator=s;
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { j as p } from "./jsx-runtime-Sp0orL4X.js";
|
|
2
|
-
import * as e from "react";
|
|
3
|
-
import * as o from "@radix-ui/react-separator";
|
|
4
|
-
import { c as i } from "./utils-dze1SGvB.js";
|
|
5
|
-
const l = e.forwardRef(({ className: a, orientation: r = "horizontal", decorative: t = !0, ...s }, m) => /* @__PURE__ */ p.jsx(
|
|
6
|
-
o.Root,
|
|
7
|
-
{
|
|
8
|
-
ref: m,
|
|
9
|
-
decorative: t,
|
|
10
|
-
orientation: r,
|
|
11
|
-
className: i("shrink-0 bg-border", r === "horizontal" ? "h-[1px] w-full" : "h-full w-[1px]", a),
|
|
12
|
-
...s
|
|
13
|
-
}
|
|
14
|
-
));
|
|
15
|
-
l.displayName = o.Root.displayName;
|
|
16
|
-
export {
|
|
17
|
-
l as S
|
|
18
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./jsx-runtime-JYMCiFoE.cjs"),f=require("react"),c=require("lodash-es"),M=require("@radix-ui/react-icons"),H=require("./skeleton-STeL9VrJ.cjs"),w=require("./scroll-area-FiHvy-TZ.cjs"),d=require("./controls-L7DPvB0m.cjs"),z=require("sonner"),p=require("./form-W58AVUdf.cjs"),P=require("./index-9MmykVSc.cjs");require("jotai");require("@radix-ui/react-slot");require("class-variance-authority");require("./utils-qK_SjzzV.cjs");require("clsx");require("tailwind-merge");require("@radix-ui/react-tooltip");require("@radix-ui/react-toast");require("@radix-ui/react-scroll-area");require("@rjsf/core");require("@rjsf/validator-ajv8");require("./link-WbcKdQ9k.cjs");require("react-icons-picker");require("react-dom");require("./tabs-_4WbA1cc.cjs");require("@radix-ui/react-dialog");require("@radix-ui/react-tabs");require("./ImagesPanel-J1RlG7xG.cjs");require("react-quill");require("react-i18next");require("./ChaiBuilderEditor-m30yoOgJ.cjs");require("./MODIFIERS-o1p3VnpS.cjs");require("@floating-ui/react-dom");require("i18next");require("flagged");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");const L=f.lazy(()=>Promise.resolve().then(()=>require("./delete-page-modal-SgfwvfNu.cjs"))),G=f.lazy(()=>Promise.resolve().then(()=>require("./confirm-alert-uNm0lZ0y.cjs"))),E=n=>{if(!c.isString(n)||!(n.includes("/[")&&n.includes("]")))return!1;const i=/^\[((?:\.{3})?[a-zA-Z0-9_-]+)\]$/,q=/^[a-zA-Z0-9_-]+$/;let e=!0;return n.split("/").forEach(u=>{e&&(u.includes("[[")&&u.includes("]]")?e=/^\[\[\.{3}[a-zA-Z0-9_-]+\]\]$/.test(u):u.includes("[")&&u.includes("]")?e=i.test(u):e=q.test(u))}),e},h=n=>n&&c.isEmpty(n.seoData)?{...n,seoData:{title:"",description:"",image:""}}:n,Y=(n,o)=>{const i=!c.isEqual(c.omit(n,["seoData"]),c.omit(o,["seoData"])),q=!c.isEqual(h(o).seoData,h(n).seoData);return i||q},B=({open:n,setOpen:o,pageData:i})=>{const q=P.useQueryClient(),{data:e}=P.useProject(),u=P.useUpdatePage(),m=P.useUpdateProject("Homepage updated successfully."),[s,y]=f.useState(h(i)),[a,b]=f.useState({isHomePage:(e==null?void 0:e.homepage)===i.uuid}),j=Y(s,i);f.useEffect(()=>{const l=!c.isEqual(h(i),s),t=(e==null?void 0:e.homepage)!==i.uuid&&a.isHomePage;o(l||t?"PENDING":"OPEN")},[e,i,s,a,o]);const C=()=>{if(j){if(i.type==="DYNAMIC"&&!E((s==null?void 0:s.slug)||"")){n==="ALERT"&&o("PENDING");return}u.mutate(s,{onSuccess:()=>{q.invalidateQueries({refetchType:"active",queryKey:["pages",e==null?void 0:e.uuid]}),o("CLOSE"),z.toast.success("Page updated successfully.")}})}a.isHomePage&&(e==null?void 0:e.homepage)!==i.uuid&&m.mutate({...e,homepage:i==null?void 0:i.uuid},{onSuccess:()=>o("CLOSE")})},R=({formData:l},t)=>{y(g=>{var S,N;if(!t)return g;const x={[t]:l[t]};return t==="name"?x.slug=c.kebabCase((S=l[t])==null?void 0:S.replace(/\d/g,"")):t==="slug"?x.slug=(N=l[t])==null?void 0:N.replace(/\d/g,"").replace(/\s+/g,"").replace("--","-").replace("__","_"):t==="seoData"&&(x.seoData={title:l[t].title||"",description:l[t].description||"",image:l[t].image||""}),{...g,...x}})},A=({formData:l},t)=>{b(g=>{const x={[t]:l[t]};return{...g,...x}})},I={name:d.u({title:"Page Name",default:s.name}),slug:d.u({title:"Page Slug",default:s.slug})},v={seoData:d.b({title:"",description:"",default:{title:"",description:"",image:""},properties:{title:d.u({title:"Meta Title",default:s.name}),description:d.g({title:"Meta Description",default:s.slug}),image:d.o({title:"Social Media Image",default:""})}})},T={isHomePage:d.r({title:"Set as homepage",default:a.isHomePage})};return r.jsxRuntimeExports.jsxs(w.ScrollArea,{className:"flex h-full select-none flex-col",children:[r.jsxRuntimeExports.jsx(G,{open:n==="ALERT",title:"Do yo want to save changes?",onCancel:()=>o("CLOSE"),onConfirm:C,disabled:m.isPending||u.isPending}),r.jsxRuntimeExports.jsx("div",{className:"rounded-md bg-background/30 px-2.5 py-1",children:r.jsxRuntimeExports.jsx("h1",{className:"px-1 font-semibold",children:"Page Details"})}),r.jsxRuntimeExports.jsx("div",{className:"px-2.5 pt-2",children:r.jsxRuntimeExports.jsxs("div",{className:"flex flex-col space-y-2",children:[r.jsxRuntimeExports.jsx(p.Form,{title:"Basic Details",formData:s,properties:I,onChange:R,disabled:u.isPending||m.isPending}),r.jsxRuntimeExports.jsx("div",{className:"h-2 w-full"}),r.jsxRuntimeExports.jsx(p.Form,{title:"SEO Details",formData:s,properties:v,onChange:R,disabled:u.isPending||m.isPending}),(e==null?void 0:e.homepage)!==i.uuid&&i.type==="STATIC"?r.jsxRuntimeExports.jsx(p.Form,{formData:a,properties:T,onChange:A,disabled:u.isPending||m.isPending}):i.type==="STATIC"&&r.jsxRuntimeExports.jsxs("div",{className:"flex items-center gap-x-1 px-1 pt-2 text-xs font-medium text-gray-500",children:[r.jsxRuntimeExports.jsx(M.HomeIcon,{})," This is homepage"," "]}),s.type==="DYNAMIC"&&!E((s==null?void 0:s.slug)||"")&&r.jsxRuntimeExports.jsxs("small",{className:"px-1 text-red-400",children:["Add dynamic ID in page slug Eg: ",r.jsxRuntimeExports.jsx("i",{className:"underline",children:"some-url/[some-id]"})]}),r.jsxRuntimeExports.jsxs("div",{className:"my-2 flex w-full items-center justify-between gap-x-2 px-1",children:[r.jsxRuntimeExports.jsx(H.Button,{className:"w-full",type:"submit",onClick:C,disabled:(e==null?void 0:e.homepage)!==i.uuid&&a.isHomePage?!1:c.isEmpty(s.name)||c.isEmpty(s.slug)||!j||u.isPending||m.isPending||s.type==="DYNAMIC"&&!E((s==null?void 0:s.slug)||""),children:"Save"}),r.jsxRuntimeExports.jsx(L,{pageData:i,projectData:e})]})]})})]})};exports.default=B;
|
|
@@ -1 +0,0 @@
|
|
|
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;
|
|
@@ -1,239 +0,0 @@
|
|
|
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/tabs-_4WbA1cc.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
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;
|
package/dist/tabs-yQ3oGziM.js
DELETED
|
@@ -1,106 +0,0 @@
|
|
|
1
|
-
import { j as t } from "./jsx-runtime-Sp0orL4X.js";
|
|
2
|
-
import * as n from "react";
|
|
3
|
-
import * as o from "@radix-ui/react-dialog";
|
|
4
|
-
import { Cross2Icon as m } from "@radix-ui/react-icons";
|
|
5
|
-
import { c as i } from "./utils-dze1SGvB.js";
|
|
6
|
-
import * as r from "@radix-ui/react-tabs";
|
|
7
|
-
const D = o.Root, h = o.Trigger, l = ({ className: e, ...a }) => /* @__PURE__ */ t.jsx(o.Portal, { className: i(e), ...a });
|
|
8
|
-
l.displayName = o.Portal.displayName;
|
|
9
|
-
const d = n.forwardRef(({ className: e, ...a }, s) => /* @__PURE__ */ t.jsx(
|
|
10
|
-
o.Overlay,
|
|
11
|
-
{
|
|
12
|
-
ref: s,
|
|
13
|
-
className: i(
|
|
14
|
-
"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",
|
|
15
|
-
e
|
|
16
|
-
),
|
|
17
|
-
...a
|
|
18
|
-
}
|
|
19
|
-
));
|
|
20
|
-
d.displayName = o.Overlay.displayName;
|
|
21
|
-
const f = n.forwardRef(({ className: e, children: a, ...s }, c) => /* @__PURE__ */ t.jsxs(l, { children: [
|
|
22
|
-
/* @__PURE__ */ t.jsx(d, {}),
|
|
23
|
-
/* @__PURE__ */ t.jsxs(
|
|
24
|
-
o.Content,
|
|
25
|
-
{
|
|
26
|
-
ref: c,
|
|
27
|
-
className: i(
|
|
28
|
-
"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",
|
|
29
|
-
e
|
|
30
|
-
),
|
|
31
|
-
...s,
|
|
32
|
-
children: [
|
|
33
|
-
a,
|
|
34
|
-
/* @__PURE__ */ t.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: [
|
|
35
|
-
/* @__PURE__ */ t.jsx(m, { className: "h-4 w-4" }),
|
|
36
|
-
/* @__PURE__ */ t.jsx("span", { className: "sr-only", children: "Close" })
|
|
37
|
-
] })
|
|
38
|
-
]
|
|
39
|
-
}
|
|
40
|
-
)
|
|
41
|
-
] }));
|
|
42
|
-
f.displayName = o.Content.displayName;
|
|
43
|
-
const g = ({ className: e, ...a }) => /* @__PURE__ */ t.jsx("div", { className: i("flex flex-col space-y-1.5 text-center sm:text-left", e), ...a });
|
|
44
|
-
g.displayName = "DialogHeader";
|
|
45
|
-
const p = ({ className: e, ...a }) => /* @__PURE__ */ t.jsx("div", { className: i("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2", e), ...a });
|
|
46
|
-
p.displayName = "DialogFooter";
|
|
47
|
-
const u = n.forwardRef(({ className: e, ...a }, s) => /* @__PURE__ */ t.jsx(
|
|
48
|
-
o.Title,
|
|
49
|
-
{
|
|
50
|
-
ref: s,
|
|
51
|
-
className: i("text-lg font-semibold leading-none tracking-tight", e),
|
|
52
|
-
...a
|
|
53
|
-
}
|
|
54
|
-
));
|
|
55
|
-
u.displayName = o.Title.displayName;
|
|
56
|
-
const x = n.forwardRef(({ className: e, ...a }, s) => /* @__PURE__ */ t.jsx(o.Description, { ref: s, className: i("text-sm text-muted-foreground", e), ...a }));
|
|
57
|
-
x.displayName = o.Description.displayName;
|
|
58
|
-
const T = r.Root, b = n.forwardRef(({ className: e, ...a }, s) => /* @__PURE__ */ t.jsx(
|
|
59
|
-
r.List,
|
|
60
|
-
{
|
|
61
|
-
ref: s,
|
|
62
|
-
className: i(
|
|
63
|
-
"inline-flex h-9 items-center justify-center rounded-lg bg-muted p-1 text-muted-foreground",
|
|
64
|
-
e
|
|
65
|
-
),
|
|
66
|
-
...a
|
|
67
|
-
}
|
|
68
|
-
));
|
|
69
|
-
b.displayName = r.List.displayName;
|
|
70
|
-
const y = n.forwardRef(({ className: e, ...a }, s) => /* @__PURE__ */ t.jsx(
|
|
71
|
-
r.Trigger,
|
|
72
|
-
{
|
|
73
|
-
ref: s,
|
|
74
|
-
className: i(
|
|
75
|
-
"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",
|
|
76
|
-
e
|
|
77
|
-
),
|
|
78
|
-
...a
|
|
79
|
-
}
|
|
80
|
-
));
|
|
81
|
-
y.displayName = r.Trigger.displayName;
|
|
82
|
-
const N = n.forwardRef(({ className: e, ...a }, s) => /* @__PURE__ */ t.jsx(
|
|
83
|
-
r.Content,
|
|
84
|
-
{
|
|
85
|
-
ref: s,
|
|
86
|
-
className: i(
|
|
87
|
-
"mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",
|
|
88
|
-
e
|
|
89
|
-
),
|
|
90
|
-
...a
|
|
91
|
-
}
|
|
92
|
-
));
|
|
93
|
-
N.displayName = r.Content.displayName;
|
|
94
|
-
export {
|
|
95
|
-
D,
|
|
96
|
-
T,
|
|
97
|
-
h as a,
|
|
98
|
-
f as b,
|
|
99
|
-
g as c,
|
|
100
|
-
p as d,
|
|
101
|
-
u as e,
|
|
102
|
-
x as f,
|
|
103
|
-
b as g,
|
|
104
|
-
y as h,
|
|
105
|
-
N as i
|
|
106
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";const a=require("./jsx-runtime-JYMCiFoE.cjs"),v=require("react"),j=require("class-variance-authority"),s=require("./utils-qK_SjzzV.cjs");function b(e){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const n=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(r,t,n.get?n:{enumerable:!0,get:()=>e[t]})}}return r.default=e,Object.freeze(r)}const o=b(v),R=j.cva("relative w-full rounded-lg border px-4 py-3 text-sm [&:has(svg)]:pl-11 [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground",{variants:{variant:{default:"bg-background text-foreground",destructive:"border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive"}},defaultVariants:{variant:"default"}}),d=o.forwardRef(({className:e,variant:r,...t},n)=>a.jsxRuntimeExports.jsx("div",{ref:n,role:"alert",className:s.cn(R({variant:r}),e),...t}));d.displayName="Alert";const i=o.forwardRef(({className:e,...r},t)=>a.jsxRuntimeExports.jsx("h5",{ref:t,className:s.cn("mb-1 font-medium leading-none tracking-tight",e),...r}));i.displayName="AlertTitle";const l=o.forwardRef(({className:e,...r},t)=>a.jsxRuntimeExports.jsx("div",{ref:t,className:s.cn("text-sm [&_p]:leading-relaxed",e),...r}));l.displayName="AlertDescription";const c=o.forwardRef(({className:e,...r},t)=>a.jsxRuntimeExports.jsx("div",{ref:t,className:s.cn("rounded-xl border bg-card text-card-foreground shadow",e),...r}));c.displayName="Card";const u=o.forwardRef(({className:e,...r},t)=>a.jsxRuntimeExports.jsx("div",{ref:t,className:s.cn("flex flex-col space-y-1.5 p-6",e),...r}));u.displayName="CardHeader";const x=o.forwardRef(({className:e,...r},t)=>a.jsxRuntimeExports.jsx("h3",{ref:t,className:s.cn("font-semibold leading-none tracking-tight",e),...r}));x.displayName="CardTitle";const p=o.forwardRef(({className:e,...r},t)=>a.jsxRuntimeExports.jsx("p",{ref:t,className:s.cn("text-sm text-muted-foreground",e),...r}));p.displayName="CardDescription";const f=o.forwardRef(({className:e,...r},t)=>a.jsxRuntimeExports.jsx("div",{ref:t,className:s.cn("p-6 pt-0",e),...r}));f.displayName="CardContent";const m=o.forwardRef(({className:e,...r},t)=>a.jsxRuntimeExports.jsx("div",{ref:t,className:s.cn(" flex items-center p-6 pt-0",e),...r}));m.displayName="CardFooter";const g=o.forwardRef(({className:e,...r},t)=>a.jsxRuntimeExports.jsx("textarea",{className:s.cn("flex min-h-[60px] w-full rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",e),ref:t,...r}));g.displayName="Textarea";exports.Alert=d;exports.AlertDescription=l;exports.AlertTitle=i;exports.Card=c;exports.CardContent=f;exports.CardDescription=p;exports.CardFooter=m;exports.CardHeader=u;exports.CardTitle=x;exports.Textarea=g;
|
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
import { j as t } from "./jsx-runtime-Sp0orL4X.js";
|
|
2
|
-
import * as s from "react";
|
|
3
|
-
import { cva as i } from "class-variance-authority";
|
|
4
|
-
import { c as d } from "./utils-dze1SGvB.js";
|
|
5
|
-
const l = i(
|
|
6
|
-
"relative w-full rounded-lg border px-4 py-3 text-sm [&:has(svg)]:pl-11 [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground",
|
|
7
|
-
{
|
|
8
|
-
variants: {
|
|
9
|
-
variant: {
|
|
10
|
-
default: "bg-background text-foreground",
|
|
11
|
-
destructive: "border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive"
|
|
12
|
-
}
|
|
13
|
-
},
|
|
14
|
-
defaultVariants: {
|
|
15
|
-
variant: "default"
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
), n = s.forwardRef(({ className: e, variant: a, ...r }, o) => /* @__PURE__ */ t.jsx("div", { ref: o, role: "alert", className: d(l({ variant: a }), e), ...r }));
|
|
19
|
-
n.displayName = "Alert";
|
|
20
|
-
const c = s.forwardRef(
|
|
21
|
-
({ className: e, ...a }, r) => /* @__PURE__ */ t.jsx("h5", { ref: r, className: d("mb-1 font-medium leading-none tracking-tight", e), ...a })
|
|
22
|
-
);
|
|
23
|
-
c.displayName = "AlertTitle";
|
|
24
|
-
const f = s.forwardRef(
|
|
25
|
-
({ className: e, ...a }, r) => /* @__PURE__ */ t.jsx("div", { ref: r, className: d("text-sm [&_p]:leading-relaxed", e), ...a })
|
|
26
|
-
);
|
|
27
|
-
f.displayName = "AlertDescription";
|
|
28
|
-
const m = s.forwardRef(({ className: e, ...a }, r) => /* @__PURE__ */ t.jsx("div", { ref: r, className: d("rounded-xl border bg-card text-card-foreground shadow", e), ...a }));
|
|
29
|
-
m.displayName = "Card";
|
|
30
|
-
const p = s.forwardRef(
|
|
31
|
-
({ className: e, ...a }, r) => /* @__PURE__ */ t.jsx("div", { ref: r, className: d("flex flex-col space-y-1.5 p-6", e), ...a })
|
|
32
|
-
);
|
|
33
|
-
p.displayName = "CardHeader";
|
|
34
|
-
const x = s.forwardRef(
|
|
35
|
-
({ className: e, ...a }, r) => /* @__PURE__ */ t.jsx("h3", { ref: r, className: d("font-semibold leading-none tracking-tight", e), ...a })
|
|
36
|
-
);
|
|
37
|
-
x.displayName = "CardTitle";
|
|
38
|
-
const u = s.forwardRef(
|
|
39
|
-
({ className: e, ...a }, r) => /* @__PURE__ */ t.jsx("p", { ref: r, className: d("text-sm text-muted-foreground", e), ...a })
|
|
40
|
-
);
|
|
41
|
-
u.displayName = "CardDescription";
|
|
42
|
-
const g = s.forwardRef(
|
|
43
|
-
({ className: e, ...a }, r) => /* @__PURE__ */ t.jsx("div", { ref: r, className: d("p-6 pt-0", e), ...a })
|
|
44
|
-
);
|
|
45
|
-
g.displayName = "CardContent";
|
|
46
|
-
const v = s.forwardRef(
|
|
47
|
-
({ className: e, ...a }, r) => /* @__PURE__ */ t.jsx("div", { ref: r, className: d(" flex items-center p-6 pt-0", e), ...a })
|
|
48
|
-
);
|
|
49
|
-
v.displayName = "CardFooter";
|
|
50
|
-
const N = s.forwardRef(({ className: e, ...a }, r) => /* @__PURE__ */ t.jsx(
|
|
51
|
-
"textarea",
|
|
52
|
-
{
|
|
53
|
-
className: d(
|
|
54
|
-
"flex min-h-[60px] w-full rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",
|
|
55
|
-
e
|
|
56
|
-
),
|
|
57
|
-
ref: r,
|
|
58
|
-
...a
|
|
59
|
-
}
|
|
60
|
-
));
|
|
61
|
-
N.displayName = "Textarea";
|
|
62
|
-
export {
|
|
63
|
-
n as A,
|
|
64
|
-
m as C,
|
|
65
|
-
N as T,
|
|
66
|
-
c as a,
|
|
67
|
-
f as b,
|
|
68
|
-
p as c,
|
|
69
|
-
v as d,
|
|
70
|
-
x as e,
|
|
71
|
-
u as f,
|
|
72
|
-
g
|
|
73
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
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;
|
|
@@ -1,69 +0,0 @@
|
|
|
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
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";const t=require("jotai"),a=require("./skeleton-STeL9VrJ.cjs"),e=()=>t.useAtom(a.chaiExternalDataAtom);exports.useChaiExternalData=e;
|