@chaibuilder/sdk 1.0.9 → 1.0.10
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/LICENSE +28 -0
- package/README.md +123 -21
- package/dist/AddBlocks-tdvDe7xL.cjs +3 -0
- package/dist/{AddBlocks-d10b7b87.js → AddBlocks-xR2s2BVa.js} +47 -44
- package/dist/BrandingOptions-DpJ-oNnf.cjs +1 -0
- package/dist/{BrandingOptions-f4ab5d9f.js → BrandingOptions-cHK2bVZy.js} +14 -18
- package/dist/{CanvasArea-10356200.js → CanvasArea-2zqT1lSE.js} +492 -503
- package/dist/CanvasArea-Br8bBSeT.cjs +46 -0
- package/dist/ChaiBuilderEditor-SacH75l4.cjs +163 -0
- package/dist/{index-aa42febc.js → ChaiBuilderEditor-h9bXC4l-.js} +11215 -15404
- package/dist/Class-_uCzl5v1.cjs +1 -0
- package/dist/{html-to-json-45e0e3b5.js → Class-l7qYbuoN.js} +185 -366
- package/dist/{CurrentPage-35e14043.js → CurrentPage-4lTETR2f.js} +26 -23
- package/dist/CurrentPage-nlUWJiUA.cjs +1 -0
- package/dist/{ImagesPanel-8b7a989d.cjs → ImagesPanel-6us7hiLN.cjs} +1 -1
- package/dist/{ImagesPanel-47ac13c3.js → ImagesPanel-oaHOD-Ex.js} +4 -4
- package/dist/Layers-Vw4XE6YB.cjs +1 -0
- package/dist/{Layers-c3dd4fc8.js → Layers-wOfijZnb.js} +42 -41
- package/dist/MarkAsGlobalBlock-1J_YyL1L.cjs +1 -0
- package/dist/{MarkAsGlobalBlock-505ae793.js → MarkAsGlobalBlock-xRyn29gC.js} +17 -20
- package/dist/{PagesPanel-bafc506f.js → PagesPanel-82gCVzHS.js} +16 -13
- package/dist/PagesPanel-ZKRdK-mI.cjs +1 -0
- package/dist/ProjectPanel-kYg4KkJu.cjs +1 -0
- package/dist/{ProjectPanel-6113f394.js → ProjectPanel-vz5WOyqZ.js} +22 -19
- package/dist/Settings-1E3Y_5r6.cjs +1 -0
- package/dist/{Settings-1c41c514.js → Settings-IuAF359L.js} +297 -296
- package/dist/SidePanels-WL1UioF2.cjs +1 -0
- package/dist/{SidePanels-c13f87dc.js → SidePanels-xssTWt4M.js} +34 -42
- package/dist/Topbar-3ozdWfSy.cjs +1 -0
- package/dist/{Topbar-b38d5d50.js → Topbar-H0f0EL6-.js} +33 -35
- package/dist/UnsplashImages-BoBBSi1a.cjs +1 -0
- package/dist/{UnsplashImages-4edb97e7.js → UnsplashImages-gPcBLjgB.js} +13 -14
- package/dist/UploadImages-T6kW0s3G.cjs +1 -0
- package/dist/{UploadImages-52181c3e.js → UploadImages-_ZyUU66E.js} +11 -12
- package/dist/{accordion-c0176dc5.js → accordion-oPUeqPCZ.js} +2 -2
- package/dist/{accordion-0afd8143.cjs → accordion-ynvFtV_p.cjs} +1 -1
- package/dist/{add-page-modal-08a19915.js → add-page-modal-J1E7rh1U.js} +25 -22
- package/dist/add-page-modal-eiiUZCJX.cjs +1 -0
- package/dist/alert-dialog-GNfnpqFB.js +64 -0
- package/dist/alert-dialog-Mv0-wAvS.cjs +1 -0
- package/dist/{command-b1103666.cjs → command-ThdTuUxt.cjs} +1 -1
- package/dist/{command-6f260f61.js → command-VHca6CcN.js} +3 -3
- package/dist/confirm-alert-8EHe0OOd.cjs +1 -0
- package/dist/confirm-alert-b0e_BLhF.js +36 -0
- package/dist/{context-menu-e1c240ce.js → context-menu-8dC9uGXj.js} +2 -2
- package/dist/{context-menu-fec580f2.cjs → context-menu-IgLbIuth.cjs} +1 -1
- package/dist/controls-Ni5kEzLz.js +103 -0
- package/dist/controls-xUKa23ic.cjs +1 -0
- package/dist/core.cjs +1 -1
- package/dist/core.d.ts +1 -10
- package/dist/core.js +116 -69
- package/dist/delete-page-modal-TGTmRjyn.cjs +1 -0
- package/dist/{delete-page-modal-9b37665b.js → delete-page-modal-ysj4O0bM.js} +25 -22
- package/dist/{dialog-170eaad9.cjs → dialog-S_QbL1iq.cjs} +1 -1
- package/dist/{dialog-18207bef.js → dialog-jrw9DF1f.js} +2 -2
- package/dist/{dropdown-menu-ae3ed09b.js → dropdown-menu-S03K_fNs.js} +2 -2
- package/dist/{dropdown-menu-84b2439e.cjs → dropdown-menu-sMXR59cB.cjs} +1 -1
- package/dist/{form-25e1af37.js → form-dVpOAyRl.js} +2 -2
- package/dist/{form-ea21db6c.cjs → form-nRAvKPQj.cjs} +1 -1
- package/dist/{functions-83b1de8d.js → functions-nNTuSTsR.js} +1 -1
- package/dist/functions-pcUZhFJM.js +12 -0
- package/dist/{functions-f84d5e2a.cjs → functions-sCuB7nvZ.cjs} +1 -1
- package/dist/functions-uw7QP2kT.cjs +1 -0
- package/dist/html-to-json-P6GpbcQX.cjs +1 -0
- package/dist/html-to-json-pdHQfRkN.js +178 -0
- package/dist/index-8L3zCc6V.cjs +1 -0
- package/dist/index-cZ4uo6aT.js +2256 -0
- package/dist/{label-e770a087.js → label-KaP7MRrs.js} +2 -2
- package/dist/{label-167415e5.cjs → label-tFm8HZdb.cjs} +1 -1
- package/dist/lib.cjs +1 -1
- package/dist/lib.d.ts +20 -13
- package/dist/lib.js +24 -23
- package/dist/{link-57de608a.js → link-6o6n2Tnd.js} +4 -4
- package/dist/link-ece8dZGH.cjs +1 -0
- package/dist/{page-viewer-5c733179.js → page-viewer-84Giu0Rs.js} +29 -26
- package/dist/page-viewer-OdVEG83P.cjs +1 -0
- package/dist/{popover-f7addcf4.js → popover-a84pbVhQ.js} +2 -2
- package/dist/{popover-7cb9079b.cjs → popover-fKjgcRUx.cjs} +1 -1
- package/dist/{project-general-setting-d9736056.js → project-general-setting-8OEVVxzn.js} +20 -17
- package/dist/project-general-setting-laHNQPW5.cjs +1 -0
- package/dist/{project-seo-setting-d81fc1e3.js → project-seo-setting-9kD_stdI.js} +11 -12
- package/dist/project-seo-setting-F3Opt9Uj.cjs +1 -0
- package/dist/render.cjs +1 -1
- package/dist/render.d.ts +7 -7
- package/dist/render.js +3 -3
- package/dist/{scroll-area-bb343b86.cjs → scroll-area-FiHvy-TZ.cjs} +1 -1
- package/dist/{scroll-area-83bd9e8f.js → scroll-area-ewXbxc3n.js} +2 -2
- package/dist/{select-0e32300c.cjs → select-7bjg-rr9.cjs} +1 -1
- package/dist/{select-7fddd7c3.js → select-POGdEDHT.js} +2 -2
- package/dist/{separator-a597dba7.cjs → separator-3Civ-6hb.cjs} +1 -1
- package/dist/{separator-a80d065b.js → separator-SctTn0Qi.js} +2 -2
- package/dist/server.d.ts +7 -10
- package/dist/server.js +0 -3
- package/dist/single-page-detail-X0TGlsT4.cjs +1 -0
- package/dist/{single-page-detail-04410e64.js → single-page-detail-iXpavDy8.js} +32 -29
- package/dist/skeleton-CU_FIbg3.js +239 -0
- package/dist/skeleton-JHP9zwL2.cjs +1 -0
- package/dist/studio.cjs +1 -0
- package/dist/studio.d.ts +13 -0
- package/dist/studio.js +39 -0
- package/dist/{tabs-85caa1e8.js → tabs-Gb9v5dVb.js} +2 -2
- package/dist/{tabs-860e37aa.cjs → tabs-iWeaaVrg.cjs} +1 -1
- package/dist/{textarea-a338ede6.cjs → textarea-1kZEh7ki.cjs} +1 -1
- package/dist/{textarea-0750bcd2.js → textarea-b2QvVhrK.js} +2 -2
- package/dist/{toggle-00c9d11e.js → toggle-ASJRAaGP.js} +2 -2
- package/dist/{toggle-b90fed97.cjs → toggle-ehNIPmme.cjs} +1 -1
- package/dist/ui.cjs +1 -1
- package/dist/ui.d.ts +69 -4
- package/dist/ui.js +272 -212
- package/dist/useAddBlock-1cMXaOVk.cjs +1 -0
- package/dist/useAddBlock-BOjrGBEO.js +86 -0
- package/dist/useAllBlocks-RU_Xw8j9.cjs +1 -0
- package/dist/useAllBlocks-lX6uVO39.js +20 -0
- package/dist/useChaiExternalData-4K9WxANa.js +6 -0
- package/dist/useChaiExternalData-DkyBJ81C.cjs +1 -0
- package/dist/useDarkMode-JWkrNFpH.js +23 -0
- package/dist/useDarkMode-zeTW_UUR.cjs +1 -0
- package/dist/useFeatureSupport-jWSuY7wk.js +16 -0
- package/dist/useFeatureSupport-tZ0QfBxp.cjs +1 -0
- package/dist/useHiddenBlocks-3MsGOJ1s.js +15 -0
- package/dist/useHiddenBlocks-oJuQDmTy.cjs +1 -0
- package/dist/useLanguage-O1uu2Bzu.js +216 -0
- package/dist/useLanguage-Y3qgAbgG.cjs +1 -0
- package/dist/useMarkAsGlobalBlock-DB5B1UP6.js +25 -0
- package/dist/useMarkAsGlobalBlock-toxRSLc_.cjs +1 -0
- package/dist/useUiLibraries-4hPOi8DI.js +12 -0
- package/dist/useUiLibraries-9FhQCpKo.cjs +1 -0
- package/package.json +19 -5
- package/dist/AddBlocks-76275943.cjs +0 -3
- package/dist/BrandingOptions-d3b3309a.cjs +0 -1
- package/dist/CanvasArea-9f94cd28.cjs +0 -46
- package/dist/CurrentPage-edb509db.cjs +0 -1
- package/dist/Layers-ecba52c1.cjs +0 -1
- package/dist/MarkAsGlobalBlock-3a06a159.cjs +0 -1
- package/dist/PagesPanel-f4329082.cjs +0 -1
- package/dist/ProjectPanel-ce3116d3.cjs +0 -1
- package/dist/Settings-b6a2bef6.cjs +0 -1
- package/dist/SidePanels-2cc72c0b.cjs +0 -1
- package/dist/Topbar-3b9db9f3.cjs +0 -1
- package/dist/UnsplashImages-98c085c2.cjs +0 -1
- package/dist/UploadImages-61ef83ad.cjs +0 -1
- package/dist/add-page-modal-7f9ff733.cjs +0 -1
- package/dist/confirm-alert-c1fdf1e4.js +0 -35
- package/dist/confirm-alert-e1ea5110.cjs +0 -1
- package/dist/delete-page-modal-7066b01f.cjs +0 -1
- package/dist/html-to-json-aadcbf66.cjs +0 -1
- package/dist/index-c535cc95.cjs +0 -164
- package/dist/link-24679521.cjs +0 -1
- package/dist/page-viewer-da99c71e.cjs +0 -1
- package/dist/project-general-setting-90f8416d.cjs +0 -1
- package/dist/project-seo-setting-6eef8387.cjs +0 -1
- package/dist/single-page-detail-90f49d7a.cjs +0 -1
- package/dist/useBuilderProp-21feb2da.js +0 -296
- package/dist/useBuilderProp-adacf42f.cjs +0 -1
- package/dist/useChaiExternalData-192c7896.js +0 -5
- package/dist/useChaiExternalData-a90e8aac.cjs +0 -1
- /package/dist/{MODIFIERS-2f19c314.js → MODIFIERS-DsEzQ3aH.js} +0 -0
- /package/dist/{MODIFIERS-4716c669.cjs → MODIFIERS-Fx6WAZcw.cjs} +0 -0
- /package/dist/{jsx-runtime-5c3ac4f7.cjs → jsx-runtime-JYMCiFoE.cjs} +0 -0
- /package/dist/{jsx-runtime-944c88e2.js → jsx-runtime-Sp0orL4X.js} +0 -0
- /package/dist/{utils-ac68b2c8.js → utils-dze1SGvB.js} +0 -0
- /package/dist/{utils-3c452dd0.cjs → utils-qK_SjzzV.cjs} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const s=require("./jsx-runtime-
|
|
1
|
+
"use strict";const s=require("./jsx-runtime-JYMCiFoE.cjs"),d=require("react"),x=require("@radix-ui/react-scroll-area"),c=require("./utils-qK_SjzzV.cjs");function n(e){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const o=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(r,t,o.get?o:{enumerable:!0,get:()=>e[t]})}}return r.default=e,Object.freeze(r)}const i=n(d),l=n(x),u=i.forwardRef(({className:e,children:r,...t},o)=>s.jsxRuntimeExports.jsxs(l.Root,{ref:o,className:c.cn("relative overflow-hidden",e),...t,children:[s.jsxRuntimeExports.jsx(l.Viewport,{className:"h-full w-full rounded-[inherit]",children:r}),s.jsxRuntimeExports.jsx(a,{}),s.jsxRuntimeExports.jsx(l.Corner,{})]}));u.displayName=l.Root.displayName;const a=i.forwardRef(({className:e,orientation:r="vertical",...t},o)=>s.jsxRuntimeExports.jsx(l.ScrollAreaScrollbar,{ref:o,orientation:r,className:c.cn("flex touch-none select-none transition-colors",r==="vertical"&&"h-full w-2.5 border-l border-l-transparent p-[1px]",r==="horizontal"&&"h-2.5 border-t border-t-transparent p-[1px]",e),...t,children:s.jsxRuntimeExports.jsx(l.ScrollAreaThumb,{className:"relative flex-1 rounded-full bg-border"})}));a.displayName=l.ScrollAreaScrollbar.displayName;exports.ScrollArea=u;exports.ScrollBar=a;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { j as l } from "./jsx-runtime-
|
|
1
|
+
import { j as l } from "./jsx-runtime-Sp0orL4X.js";
|
|
2
2
|
import * as t from "react";
|
|
3
3
|
import * as r from "@radix-ui/react-scroll-area";
|
|
4
|
-
import { c } from "./utils-
|
|
4
|
+
import { c } from "./utils-dze1SGvB.js";
|
|
5
5
|
const i = t.forwardRef(({ className: a, children: e, ...o }, s) => /* @__PURE__ */ l.jsxs(r.Root, { ref: s, className: c("relative overflow-hidden", a), ...o, children: [
|
|
6
6
|
/* @__PURE__ */ l.jsx(r.Viewport, { className: "h-full w-full rounded-[inherit]", children: e }),
|
|
7
7
|
/* @__PURE__ */ l.jsx(d, {}),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const r=require("./jsx-runtime-
|
|
1
|
+
"use strict";const r=require("./jsx-runtime-JYMCiFoE.cjs"),g=require("react"),l=require("@radix-ui/react-icons"),j=require("@radix-ui/react-select"),n=require("./utils-qK_SjzzV.cjs");function c(a){const s=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(a){for(const t in a)if(t!=="default"){const o=Object.getOwnPropertyDescriptor(a,t);Object.defineProperty(s,t,o.get?o:{enumerable:!0,get:()=>a[t]})}}return s.default=a,Object.freeze(s)}const i=c(g),e=c(j),b=e.Root,h=e.Group,S=e.Value,d=i.forwardRef(({className:a,children:s,...t},o)=>r.jsxRuntimeExports.jsxs(e.Trigger,{ref:o,className:n.cn("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",a),...t,children:[s,r.jsxRuntimeExports.jsx(e.Icon,{asChild:!0,children:r.jsxRuntimeExports.jsx(l.CaretSortIcon,{className:"h-4 w-4 opacity-50"})})]}));d.displayName=e.Trigger.displayName;const m=i.forwardRef(({className:a,children:s,position:t="popper",...o},f)=>r.jsxRuntimeExports.jsx(e.Portal,{children:r.jsxRuntimeExports.jsx(e.Content,{ref:f,className:n.cn("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",t==="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",a),position:t,...o,children:r.jsxRuntimeExports.jsx(e.Viewport,{className:n.cn("p-1",t==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:s})})}));m.displayName=e.Content.displayName;const p=i.forwardRef(({className:a,...s},t)=>r.jsxRuntimeExports.jsx(e.Label,{ref:t,className:n.cn("px-2 py-1.5 text-sm font-semibold",a),...s}));p.displayName=e.Label.displayName;const u=i.forwardRef(({className:a,children:s,...t},o)=>r.jsxRuntimeExports.jsxs(e.Item,{ref:o,className:n.cn("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",a),...t,children:[r.jsxRuntimeExports.jsx("span",{className:"absolute right-2 flex h-3.5 w-3.5 items-center justify-center",children:r.jsxRuntimeExports.jsx(e.ItemIndicator,{children:r.jsxRuntimeExports.jsx(l.CheckIcon,{className:"h-4 w-4"})})}),r.jsxRuntimeExports.jsx(e.ItemText,{children:s})]}));u.displayName=e.Item.displayName;const x=i.forwardRef(({className:a,...s},t)=>r.jsxRuntimeExports.jsx(e.Separator,{ref:t,className:n.cn("-mx-1 my-1 h-px bg-muted",a),...s}));x.displayName=e.Separator.displayName;exports.Select=b;exports.SelectContent=m;exports.SelectGroup=h;exports.SelectItem=u;exports.SelectLabel=p;exports.SelectSeparator=x;exports.SelectTrigger=d;exports.SelectValue=S;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { j as t } from "./jsx-runtime-
|
|
1
|
+
import { j as t } from "./jsx-runtime-Sp0orL4X.js";
|
|
2
2
|
import * as i from "react";
|
|
3
3
|
import { CaretSortIcon as n, CheckIcon as c } from "@radix-ui/react-icons";
|
|
4
4
|
import * as e from "@radix-ui/react-select";
|
|
5
|
-
import { c as r } from "./utils-
|
|
5
|
+
import { c as r } from "./utils-dze1SGvB.js";
|
|
6
6
|
const y = e.Root, w = e.Group, N = e.Value, m = i.forwardRef(({ className: s, children: o, ...a }, d) => /* @__PURE__ */ t.jsxs(
|
|
7
7
|
e.Trigger,
|
|
8
8
|
{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const i=require("./jsx-runtime-
|
|
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,7 +1,7 @@
|
|
|
1
|
-
import { j as p } from "./jsx-runtime-
|
|
1
|
+
import { j as p } from "./jsx-runtime-Sp0orL4X.js";
|
|
2
2
|
import * as e from "react";
|
|
3
3
|
import * as o from "@radix-ui/react-separator";
|
|
4
|
-
import { c as i } from "./utils-
|
|
4
|
+
import { c as i } from "./utils-dze1SGvB.js";
|
|
5
5
|
const l = e.forwardRef(({ className: a, orientation: r = "horizontal", decorative: t = !0, ...s }, m) => /* @__PURE__ */ p.jsx(
|
|
6
6
|
o.Root,
|
|
7
7
|
{
|
package/dist/server.d.ts
CHANGED
|
@@ -108,7 +108,6 @@ export declare class ChaibuilderBackend implements ChaibuilderBackendInterface {
|
|
|
108
108
|
*
|
|
109
109
|
* @returns Upload asset
|
|
110
110
|
* @param formData
|
|
111
|
-
* @param req
|
|
112
111
|
*/
|
|
113
112
|
uploadAsset(formData: FormData): Promise<{
|
|
114
113
|
data: {
|
|
@@ -161,7 +160,6 @@ export declare class ChaibuilderBackend implements ChaibuilderBackendInterface {
|
|
|
161
160
|
}>;
|
|
162
161
|
/**
|
|
163
162
|
*
|
|
164
|
-
* @param { password }
|
|
165
163
|
* @returns { token }
|
|
166
164
|
*/
|
|
167
165
|
logout(): Promise<{
|
|
@@ -171,7 +169,6 @@ export declare class ChaibuilderBackend implements ChaibuilderBackendInterface {
|
|
|
171
169
|
}>;
|
|
172
170
|
/**
|
|
173
171
|
*
|
|
174
|
-
* @param token
|
|
175
172
|
* @returns { result: 'success' | 'error' }
|
|
176
173
|
*/
|
|
177
174
|
verify(): Promise<{
|
|
@@ -250,8 +247,8 @@ export declare class ChaibuilderBackend implements ChaibuilderBackendInterface {
|
|
|
250
247
|
blocks: ChaiBlock[];
|
|
251
248
|
seoData?: Record<string, string>;
|
|
252
249
|
slug?: string;
|
|
253
|
-
name
|
|
254
|
-
providers
|
|
250
|
+
name?: string;
|
|
251
|
+
providers?: {
|
|
255
252
|
providerKey: string;
|
|
256
253
|
args: Record<string, any>;
|
|
257
254
|
}[];
|
|
@@ -265,13 +262,13 @@ export declare class ChaibuilderBackend implements ChaibuilderBackendInterface {
|
|
|
265
262
|
}[];
|
|
266
263
|
}[];
|
|
267
264
|
project: {
|
|
268
|
-
name
|
|
269
|
-
favicon
|
|
265
|
+
name?: string;
|
|
266
|
+
favicon?: string;
|
|
270
267
|
brandingOptions: Record<string, string | number>;
|
|
271
268
|
seoData?: Record<string, string>;
|
|
272
|
-
primaryLanguage
|
|
273
|
-
languages
|
|
274
|
-
homepage
|
|
269
|
+
primaryLanguage?: string;
|
|
270
|
+
languages?: string[];
|
|
271
|
+
homepage?: string;
|
|
275
272
|
};
|
|
276
273
|
};
|
|
277
274
|
|
package/dist/server.js
CHANGED
|
@@ -114,7 +114,6 @@ class A {
|
|
|
114
114
|
*
|
|
115
115
|
* @returns Upload asset
|
|
116
116
|
* @param formData
|
|
117
|
-
* @param req
|
|
118
117
|
*/
|
|
119
118
|
async uploadAsset(t) {
|
|
120
119
|
const e = this.getHeaders(), s = this.getURL("asset"), o = "POST", r = await t.get("file"), n = new FormData();
|
|
@@ -154,7 +153,6 @@ class A {
|
|
|
154
153
|
}
|
|
155
154
|
/**
|
|
156
155
|
*
|
|
157
|
-
* @param { password }
|
|
158
156
|
* @returns { token }
|
|
159
157
|
*/
|
|
160
158
|
async logout() {
|
|
@@ -163,7 +161,6 @@ class A {
|
|
|
163
161
|
}
|
|
164
162
|
/**
|
|
165
163
|
*
|
|
166
|
-
* @param token
|
|
167
164
|
* @returns { result: 'success' | 'error' }
|
|
168
165
|
*/
|
|
169
166
|
async verify() {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./jsx-runtime-JYMCiFoE.cjs"),g=require("react"),c=require("lodash"),M=require("@radix-ui/react-icons"),H=require("./skeleton-JHP9zwL2.cjs"),w=require("./scroll-area-FiHvy-TZ.cjs"),d=require("@chaibuilder/blocks"),L=require("sonner"),p=require("./form-nRAvKPQj.cjs"),h=require("./index-8L3zCc6V.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-ece8dZGH.cjs");require("react-icons-picker");require("react-dom");require("./dialog-S_QbL1iq.cjs");require("@radix-ui/react-dialog");require("./ImagesPanel-6us7hiLN.cjs");require("./tabs-iWeaaVrg.cjs");require("@radix-ui/react-tabs");require("react-quill");require("react-i18next");require("./ChaiBuilderEditor-SacH75l4.cjs");require("./MODIFIERS-Fx6WAZcw.cjs");require("@floating-ui/react-dom");require("i18next");require("flagged");require("react-dnd");require("@minoru/react-dnd-treeview");require("react-hotkeys-hook");require("flat-to-nested");require("./functions-uw7QP2kT.cjs");require("redux-undo");require("@react-hookz/web");require("./html-to-json-P6GpbcQX.cjs");require("himalaya");require("lucide-react");require("./alert-dialog-Mv0-wAvS.cjs");require("@radix-ui/react-alert-dialog");const z=g.lazy(()=>Promise.resolve().then(()=>require("./delete-page-modal-TGTmRjyn.cjs"))),G=g.lazy(()=>Promise.resolve().then(()=>require("./confirm-alert-8EHe0OOd.cjs"))),E=n=>{if(!c.isString(n)||!(n.includes("/[")&&n.includes("]")))return!1;const s=/^\[((?:\.{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=s.test(u):e=q.test(u))}),e},P=n=>n&&c.isEmpty(n.seoData)?{...n,seoData:{title:"",description:"",image:""}}:n,Y=(n,o)=>{const s=!c.isEqual(c.omit(n,["seoData"]),c.omit(o,["seoData"])),q=!c.isEqual(P(o).seoData,P(n).seoData);return s||q},B=({open:n,setOpen:o,pageData:s})=>{const q=h.useQueryClient(),{data:e}=h.useProject(),u=h.useUpdatePage(),m=h.useUpdateProject("Homepage updated successfully."),[i,b]=g.useState(P(s)),[a,y]=g.useState({isHomePage:(e==null?void 0:e.homepage)===s.uuid}),j=Y(i,s);g.useEffect(()=>{const l=!c.isEqual(P(s),i),r=(e==null?void 0:e.homepage)!==s.uuid&&a.isHomePage;o(l||r?"PENDING":"OPEN")},[e,s,i,a,o]);const S=()=>{if(j){if(s.type==="DYNAMIC"&&!E((i==null?void 0:i.slug)||"")){n==="ALERT"&&o("PENDING");return}u.mutate(i,{onSuccess:()=>{q.invalidateQueries({refetchType:"active",queryKey:["pages",e==null?void 0:e.uuid]}),o("CLOSE"),L.toast.success("Page updated successfully.")}})}a.isHomePage&&(e==null?void 0:e.homepage)!==s.uuid&&m.mutate({...e,homepage:s==null?void 0:s.uuid},{onSuccess:()=>o("CLOSE")})},C=({formData:l},r)=>{b(f=>{var R,N;if(!r)return f;const x={[r]:l[r]};return r==="name"?x.slug=c.kebabCase((R=l[r])==null?void 0:R.replace(/\d/g,"")):r==="slug"?x.slug=(N=l[r])==null?void 0:N.replace(/\d/g,"").replace(/\s+/g,"").replace("--","-").replace("__","_"):r==="seoData"&&(x.seoData={title:l[r].title||"",description:l[r].description||"",image:l[r].image||""}),{...f,...x}})},A=({formData:l},r)=>{y(f=>{const x={[r]:l[r]};return{...f,...x}})},I={name:d.SingleLineText({title:"Page Name",default:i.name}),slug:d.SingleLineText({title:"Page Slug",default:i.slug})},T={seoData:d.Model({title:"",description:"",default:{title:"",description:"",image:""},properties:{title:d.SingleLineText({title:"Meta Title",default:i.name}),description:d.MultilineText({title:"Meta Description",default:i.slug}),image:d.Image({title:"Social Media Image",default:""})}})},v={isHomePage:d.Checkbox({title:"Set as homepage",default:a.isHomePage})};return t.jsxRuntimeExports.jsxs(w.ScrollArea,{className:"flex h-full select-none flex-col",children:[t.jsxRuntimeExports.jsx(G,{open:n==="ALERT",title:"Do yo want to save changes?",onCancel:()=>o("CLOSE"),onConfirm:S,disabled:m.isPending||u.isPending}),t.jsxRuntimeExports.jsx("div",{className:"rounded-md bg-background/30 px-2.5 py-1",children:t.jsxRuntimeExports.jsx("h1",{className:"px-1 font-semibold",children:"Page Details"})}),t.jsxRuntimeExports.jsx("div",{className:"px-2.5 pt-2",children:t.jsxRuntimeExports.jsxs("div",{className:"flex flex-col space-y-2",children:[t.jsxRuntimeExports.jsx(p.Form,{title:"Basic Details",formData:i,properties:I,onChange:C,disabled:u.isPending||m.isPending}),t.jsxRuntimeExports.jsx("div",{className:"h-2 w-full"}),t.jsxRuntimeExports.jsx(p.Form,{title:"SEO Details",formData:i,properties:T,onChange:C,disabled:u.isPending||m.isPending}),(e==null?void 0:e.homepage)!==s.uuid&&s.type==="STATIC"?t.jsxRuntimeExports.jsx(p.Form,{formData:a,properties:v,onChange:A,disabled:u.isPending||m.isPending}):s.type==="STATIC"&&t.jsxRuntimeExports.jsxs("div",{className:"flex items-center gap-x-1 px-1 pt-2 text-xs font-medium text-gray-500",children:[t.jsxRuntimeExports.jsx(M.HomeIcon,{})," This is homepage"," "]}),i.type==="DYNAMIC"&&!E((i==null?void 0:i.slug)||"")&&t.jsxRuntimeExports.jsxs("small",{className:"px-1 text-red-400",children:["Add dynamic ID in page slug Eg: ",t.jsxRuntimeExports.jsx("i",{className:"underline",children:"some-url/[some-id]"})]}),t.jsxRuntimeExports.jsxs("div",{className:"my-2 flex w-full items-center justify-between gap-x-2 px-1",children:[t.jsxRuntimeExports.jsx(H.Button,{className:"w-full",type:"submit",onClick:S,disabled:(e==null?void 0:e.homepage)!==s.uuid&&a.isHomePage?!1:c.isEmpty(i.name)||c.isEmpty(i.slug)||!j||u.isPending||m.isPending||i.type==="DYNAMIC"&&!E((i==null?void 0:i.slug)||""),children:"Save"}),t.jsxRuntimeExports.jsx(z,{pageData:s,projectData:e})]})]})})]})};exports.default=B;
|
|
@@ -1,36 +1,36 @@
|
|
|
1
|
-
import { j as t } from "./jsx-runtime-
|
|
1
|
+
import { j as t } from "./jsx-runtime-Sp0orL4X.js";
|
|
2
2
|
import y, { useState as I, useEffect as L } from "react";
|
|
3
3
|
import { isEqual as P, isEmpty as C, isString as z, omit as j, kebabCase as B } from "lodash";
|
|
4
4
|
import { HomeIcon as G } from "@radix-ui/react-icons";
|
|
5
|
-
import { B as Y } from "./
|
|
6
|
-
import { S as q } from "./scroll-area-
|
|
5
|
+
import { B as Y } from "./skeleton-CU_FIbg3.js";
|
|
6
|
+
import { S as q } from "./scroll-area-ewXbxc3n.js";
|
|
7
7
|
import { SingleLineText as g, Model as Z, MultilineText as $, Image as F, Checkbox as Q } from "@chaibuilder/blocks";
|
|
8
8
|
import { toast as U } from "sonner";
|
|
9
|
-
import { F as h } from "./form-
|
|
10
|
-
import {
|
|
11
|
-
import "
|
|
12
|
-
import "./utils-ac68b2c8.js";
|
|
13
|
-
import "clsx";
|
|
14
|
-
import "tailwind-merge";
|
|
9
|
+
import { F as h } from "./form-dVpOAyRl.js";
|
|
10
|
+
import { f as V, a as X, g as _, b as K } from "./index-cZ4uo6aT.js";
|
|
11
|
+
import "jotai";
|
|
15
12
|
import "@radix-ui/react-slot";
|
|
16
13
|
import "class-variance-authority";
|
|
14
|
+
import "./utils-dze1SGvB.js";
|
|
15
|
+
import "clsx";
|
|
16
|
+
import "tailwind-merge";
|
|
17
17
|
import "@radix-ui/react-tooltip";
|
|
18
18
|
import "@radix-ui/react-toast";
|
|
19
|
-
import "jotai";
|
|
20
19
|
import "@radix-ui/react-scroll-area";
|
|
21
20
|
import "@rjsf/core";
|
|
22
21
|
import "@rjsf/validator-ajv8";
|
|
23
|
-
import "./link-
|
|
22
|
+
import "./link-6o6n2Tnd.js";
|
|
24
23
|
import "react-icons-picker";
|
|
25
24
|
import "react-dom";
|
|
26
|
-
import "./dialog-
|
|
25
|
+
import "./dialog-jrw9DF1f.js";
|
|
27
26
|
import "@radix-ui/react-dialog";
|
|
28
|
-
import "./ImagesPanel-
|
|
29
|
-
import "./tabs-
|
|
27
|
+
import "./ImagesPanel-oaHOD-Ex.js";
|
|
28
|
+
import "./tabs-Gb9v5dVb.js";
|
|
30
29
|
import "@radix-ui/react-tabs";
|
|
31
30
|
import "react-quill";
|
|
32
31
|
import "react-i18next";
|
|
33
|
-
import "./
|
|
32
|
+
import "./ChaiBuilderEditor-h9bXC4l-.js";
|
|
33
|
+
import "./MODIFIERS-DsEzQ3aH.js";
|
|
34
34
|
import "@floating-ui/react-dom";
|
|
35
35
|
import "i18next";
|
|
36
36
|
import "flagged";
|
|
@@ -38,12 +38,15 @@ import "react-dnd";
|
|
|
38
38
|
import "@minoru/react-dnd-treeview";
|
|
39
39
|
import "react-hotkeys-hook";
|
|
40
40
|
import "flat-to-nested";
|
|
41
|
-
import "./
|
|
42
|
-
import "himalaya";
|
|
41
|
+
import "./functions-pcUZhFJM.js";
|
|
43
42
|
import "redux-undo";
|
|
44
43
|
import "@react-hookz/web";
|
|
44
|
+
import "./html-to-json-pdHQfRkN.js";
|
|
45
|
+
import "himalaya";
|
|
45
46
|
import "lucide-react";
|
|
46
|
-
|
|
47
|
+
import "./alert-dialog-GNfnpqFB.js";
|
|
48
|
+
import "@radix-ui/react-alert-dialog";
|
|
49
|
+
const O = y.lazy(() => import("./delete-page-modal-ysj4O0bM.js")), J = y.lazy(() => import("./confirm-alert-b0e_BLhF.js")), x = (n) => {
|
|
47
50
|
if (!z(n) || !(n.includes("/[") && n.includes("]")))
|
|
48
51
|
return !1;
|
|
49
52
|
const s = /^\[((?:\.{3})?[a-zA-Z0-9_-]+)\]$/, u = /^[a-zA-Z0-9_-]+$/;
|
|
@@ -57,7 +60,7 @@ const O = y.lazy(() => import("./delete-page-modal-9b37665b.js")), J = y.lazy(()
|
|
|
57
60
|
} : n, W = (n, l) => {
|
|
58
61
|
const s = !P(j(n, ["seoData"]), j(l, ["seoData"])), u = !P(f(l).seoData, f(n).seoData);
|
|
59
62
|
return s || u;
|
|
60
|
-
},
|
|
63
|
+
}, Xe = ({ open: n, setOpen: l, pageData: s }) => {
|
|
61
64
|
const u = V(), { data: e } = X(), r = _(), c = K("Homepage updated successfully."), [i, T] = I(f(s)), [d, M] = I({
|
|
62
65
|
isHomePage: (e == null ? void 0 : e.homepage) === s.uuid
|
|
63
66
|
}), S = W(i, s);
|
|
@@ -81,13 +84,13 @@ const O = y.lazy(() => import("./delete-page-modal-9b37665b.js")), J = y.lazy(()
|
|
|
81
84
|
});
|
|
82
85
|
}
|
|
83
86
|
d.isHomePage && (e == null ? void 0 : e.homepage) !== s.uuid && c.mutate({ ...e, homepage: s == null ? void 0 : s.uuid }, { onSuccess: () => l("CLOSE") });
|
|
84
|
-
},
|
|
87
|
+
}, b = ({ formData: m }, o) => {
|
|
85
88
|
T((p) => {
|
|
86
|
-
var
|
|
89
|
+
var E, A;
|
|
87
90
|
if (!o)
|
|
88
91
|
return p;
|
|
89
92
|
const a = { [o]: m[o] };
|
|
90
|
-
return o === "name" ? a.slug = B((
|
|
93
|
+
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 = {
|
|
91
94
|
title: m[o].title || "",
|
|
92
95
|
description: m[o].description || "",
|
|
93
96
|
image: m[o].image || ""
|
|
@@ -110,7 +113,7 @@ const O = y.lazy(() => import("./delete-page-modal-9b37665b.js")), J = y.lazy(()
|
|
|
110
113
|
default: i.name
|
|
111
114
|
}),
|
|
112
115
|
slug: g({ title: "Page Slug", default: i.slug })
|
|
113
|
-
},
|
|
116
|
+
}, w = {
|
|
114
117
|
seoData: Z({
|
|
115
118
|
title: "",
|
|
116
119
|
description: "",
|
|
@@ -131,7 +134,7 @@ const O = y.lazy(() => import("./delete-page-modal-9b37665b.js")), J = y.lazy(()
|
|
|
131
134
|
image: F({ title: "Social Media Image", default: "" })
|
|
132
135
|
}
|
|
133
136
|
})
|
|
134
|
-
},
|
|
137
|
+
}, R = {
|
|
135
138
|
isHomePage: Q({
|
|
136
139
|
title: "Set as homepage",
|
|
137
140
|
default: d.isHomePage
|
|
@@ -156,7 +159,7 @@ const O = y.lazy(() => import("./delete-page-modal-9b37665b.js")), J = y.lazy(()
|
|
|
156
159
|
title: "Basic Details",
|
|
157
160
|
formData: i,
|
|
158
161
|
properties: H,
|
|
159
|
-
onChange:
|
|
162
|
+
onChange: b,
|
|
160
163
|
disabled: r.isPending || c.isPending
|
|
161
164
|
}
|
|
162
165
|
),
|
|
@@ -166,8 +169,8 @@ const O = y.lazy(() => import("./delete-page-modal-9b37665b.js")), J = y.lazy(()
|
|
|
166
169
|
{
|
|
167
170
|
title: "SEO Details",
|
|
168
171
|
formData: i,
|
|
169
|
-
properties:
|
|
170
|
-
onChange:
|
|
172
|
+
properties: w,
|
|
173
|
+
onChange: b,
|
|
171
174
|
disabled: r.isPending || c.isPending
|
|
172
175
|
}
|
|
173
176
|
),
|
|
@@ -175,7 +178,7 @@ const O = y.lazy(() => import("./delete-page-modal-9b37665b.js")), J = y.lazy(()
|
|
|
175
178
|
h,
|
|
176
179
|
{
|
|
177
180
|
formData: d,
|
|
178
|
-
properties:
|
|
181
|
+
properties: R,
|
|
179
182
|
onChange: v,
|
|
180
183
|
disabled: r.isPending || c.isPending
|
|
181
184
|
}
|
|
@@ -205,5 +208,5 @@ const O = y.lazy(() => import("./delete-page-modal-9b37665b.js")), J = y.lazy(()
|
|
|
205
208
|
] });
|
|
206
209
|
};
|
|
207
210
|
export {
|
|
208
|
-
|
|
211
|
+
Xe as default
|
|
209
212
|
};
|
|
@@ -0,0 +1,239 @@
|
|
|
1
|
+
import { atom as x, useAtomValue as j } from "jotai";
|
|
2
|
+
import { get as R } from "lodash";
|
|
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
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const g=require("jotai"),I=require("lodash"),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;
|
package/dist/studio.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("./jsx-runtime-JYMCiFoE.cjs");const e=require("./index-8L3zCc6V.cjs");require("react");require("sonner");require("./ChaiBuilderEditor-SacH75l4.cjs");require("./MODIFIERS-Fx6WAZcw.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("react-dnd");require("lodash");require("@minoru/react-dnd-treeview");require("./skeleton-JHP9zwL2.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("react-hotkeys-hook");require("flat-to-nested");require("./functions-uw7QP2kT.cjs");require("redux-undo");require("@react-hookz/web");require("@chaibuilder/blocks");require("./html-to-json-P6GpbcQX.cjs");require("himalaya");require("lucide-react");require("./alert-dialog-Mv0-wAvS.cjs");require("@radix-ui/react-alert-dialog");exports.ChaiBuilderStudio=e.ChaiBuilderStudio;
|
package/dist/studio.d.ts
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { JSX as JSX_2 } from 'react/jsx-runtime';
|
|
2
|
+
import { default as React_2 } from 'react';
|
|
3
|
+
|
|
4
|
+
export declare const ChaiBuilderStudio: (props: ChaiBuilderStudioProps) => JSX_2.Element;
|
|
5
|
+
|
|
6
|
+
export declare type ChaiBuilderStudioProps = {
|
|
7
|
+
apiBaseUrl?: string;
|
|
8
|
+
logo?: React_2.FC<any> | React_2.LazyExoticComponent<any>;
|
|
9
|
+
darkMode?: boolean;
|
|
10
|
+
unsplashAccessKey?: string;
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export { }
|
package/dist/studio.js
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import "./jsx-runtime-Sp0orL4X.js";
|
|
2
|
+
import { C as K } from "./index-cZ4uo6aT.js";
|
|
3
|
+
import "react";
|
|
4
|
+
import "sonner";
|
|
5
|
+
import "./ChaiBuilderEditor-h9bXC4l-.js";
|
|
6
|
+
import "./MODIFIERS-DsEzQ3aH.js";
|
|
7
|
+
import "clsx";
|
|
8
|
+
import "@radix-ui/react-scroll-area";
|
|
9
|
+
import "react-dom";
|
|
10
|
+
import "@floating-ui/react-dom";
|
|
11
|
+
import "jotai";
|
|
12
|
+
import "i18next";
|
|
13
|
+
import "react-i18next";
|
|
14
|
+
import "flagged";
|
|
15
|
+
import "react-dnd";
|
|
16
|
+
import "lodash";
|
|
17
|
+
import "@minoru/react-dnd-treeview";
|
|
18
|
+
import "./skeleton-CU_FIbg3.js";
|
|
19
|
+
import "@radix-ui/react-slot";
|
|
20
|
+
import "class-variance-authority";
|
|
21
|
+
import "./utils-dze1SGvB.js";
|
|
22
|
+
import "tailwind-merge";
|
|
23
|
+
import "@radix-ui/react-tooltip";
|
|
24
|
+
import "@radix-ui/react-icons";
|
|
25
|
+
import "@radix-ui/react-toast";
|
|
26
|
+
import "react-hotkeys-hook";
|
|
27
|
+
import "flat-to-nested";
|
|
28
|
+
import "./functions-pcUZhFJM.js";
|
|
29
|
+
import "redux-undo";
|
|
30
|
+
import "@react-hookz/web";
|
|
31
|
+
import "@chaibuilder/blocks";
|
|
32
|
+
import "./html-to-json-pdHQfRkN.js";
|
|
33
|
+
import "himalaya";
|
|
34
|
+
import "lucide-react";
|
|
35
|
+
import "./alert-dialog-GNfnpqFB.js";
|
|
36
|
+
import "@radix-ui/react-alert-dialog";
|
|
37
|
+
export {
|
|
38
|
+
K as ChaiBuilderStudio
|
|
39
|
+
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { j as a } from "./jsx-runtime-
|
|
1
|
+
import { j as a } from "./jsx-runtime-Sp0orL4X.js";
|
|
2
2
|
import * as o from "react";
|
|
3
3
|
import * as e from "@radix-ui/react-tabs";
|
|
4
|
-
import { c as n } from "./utils-
|
|
4
|
+
import { c as n } from "./utils-dze1SGvB.js";
|
|
5
5
|
const m = e.Root, r = o.forwardRef(({ className: s, ...i }, t) => /* @__PURE__ */ a.jsx(
|
|
6
6
|
e.List,
|
|
7
7
|
{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const n=require("./jsx-runtime-
|
|
1
|
+
"use strict";const n=require("./jsx-runtime-JYMCiFoE.cjs"),d=require("react"),b=require("@radix-ui/react-tabs"),a=require("./utils-qK_SjzzV.cjs");function c(e){const s=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const o=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(s,t,o.get?o:{enumerable:!0,get:()=>e[t]})}}return s.default=e,Object.freeze(s)}const r=c(d),i=c(b),g=i.Root,u=r.forwardRef(({className:e,...s},t)=>n.jsxRuntimeExports.jsx(i.List,{ref:t,className:a.cn("inline-flex h-9 items-center justify-center rounded-lg bg-muted p-1 text-muted-foreground",e),...s}));u.displayName=i.List.displayName;const f=r.forwardRef(({className:e,...s},t)=>n.jsxRuntimeExports.jsx(i.Trigger,{ref:t,className:a.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),...s}));f.displayName=i.Trigger.displayName;const l=r.forwardRef(({className:e,...s},t)=>n.jsxRuntimeExports.jsx(i.Content,{ref:t,className:a.cn("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...s}));l.displayName=i.Content.displayName;exports.Tabs=g;exports.TabsContent=l;exports.TabsList=u;exports.TabsTrigger=f;
|