@chaibuilder/sdk 1.0.13 → 1.0.15
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-H7BZYHUC.js → AddBlocks-eoo1CzaK.js} +114 -111
- package/dist/AddBlocks-jU0NwP_s.cjs +3 -0
- package/dist/BrandingOptions-WSCFnWAf.cjs +1 -0
- package/dist/{BrandingOptions-PAgY-kvj.js → BrandingOptions-_Og7VUHA.js} +57 -41
- package/dist/{CanvasArea-zn2ox-5h.js → CanvasArea-cky_d2Lu.js} +517 -519
- package/dist/CanvasArea-hT9uHhkz.cjs +46 -0
- package/dist/Class-RZuPYbUS.cjs +1 -0
- package/dist/{Class-l7qYbuoN.js → Class-nQk08vqd.js} +204 -124
- package/dist/{CurrentPage-6Jp4xAWK.js → CurrentPage--OlBwyNE.js} +58 -40
- package/dist/CurrentPage-x6Ez11gP.cjs +1 -0
- package/dist/Layers-gEA0qWYP.cjs +1 -0
- package/dist/{Layers-WkZ48AUm.js → Layers-uzA3QA-4.js} +158 -141
- package/dist/MarkAsGlobalBlock-lYL8cO9x.cjs +1 -0
- package/dist/MarkAsGlobalBlock-ySc-D4SB.js +84 -0
- package/dist/PagesPanel-5t0bV9T2.cjs +1 -0
- package/dist/PagesPanel-tH6c9Mnv.js +70 -0
- package/dist/ProjectPanel-NdrR6a8t.cjs +1 -0
- package/dist/ProjectPanel-Q2-15-In.js +91 -0
- package/dist/Settings-DBiwm1hY.cjs +1 -0
- package/dist/{Settings-fH8fZKpm.js → Settings-LOqpvQ_1.js} +411 -408
- package/dist/SidePanels-8JWYXGqN.cjs +1 -0
- package/dist/{SidePanels-w8ZHKJaR.js → SidePanels-F7ccs2Xf.js} +106 -88
- package/dist/{Topbar-hm1D_5sb.js → Topbar-lX9OMPwj.js} +47 -45
- package/dist/Topbar-qi5ab8rR.cjs +1 -0
- package/dist/UnsplashImages-a2r7b3kB.cjs +1 -0
- package/dist/{UnsplashImages-gPcBLjgB.js → UnsplashImages-u_QTABzi.js} +56 -44
- package/dist/{UploadImages-_ZyUU66E.js → UploadImages-gV5xDHIu.js} +55 -34
- package/dist/UploadImages-jLQgLujd.cjs +1 -0
- package/dist/add-page-modal-U5ramelz.js +110 -0
- package/dist/add-page-modal-tIt3N8jH.cjs +1 -0
- package/dist/confirm-alert-ZQ-sxX0X.js +58 -0
- package/dist/confirm-alert-z74-fGOT.cjs +1 -0
- package/dist/core.cjs +1 -1
- package/dist/core.js +99 -124
- package/dist/delete-page-modal-5XuSfQT0.cjs +1 -0
- package/dist/delete-page-modal-_E87bVUZ.js +89 -0
- package/dist/form-Osm1AmO5.cjs +1 -0
- package/dist/{form-dVpOAyRl.js → form-zZJyZuNH.js} +12 -12
- package/dist/index-2EHcmZqL.js +2947 -0
- package/dist/index-RVm8Txnj.js +1149 -0
- package/dist/index-_jFEo7h5.cjs +206 -0
- package/dist/index-c8zW_D2V.cjs +1 -0
- package/dist/index-cU5eyVRU.js +40872 -0
- package/dist/index-fwo4wa7u.cjs +1 -0
- package/dist/index-gmZcUXyn.js +25 -0
- package/dist/index-m2muA80V.cjs +9 -0
- package/dist/{jsx-runtime-JYMCiFoE.cjs → jsx-runtime-WKRPbKtm.cjs} +7 -7
- package/dist/{jsx-runtime-Sp0orL4X.js → jsx-runtime-qAwJ85SY.js} +109 -106
- package/dist/lib.cjs +2 -1
- package/dist/lib.js +1333 -71
- package/dist/page-viewer-BSc-5M4B.cjs +1 -0
- package/dist/{page-viewer-Y4YiaZ_m.js → page-viewer-nLqIs_9w.js} +62 -44
- package/dist/project-general-setting-14MA_cX5.cjs +1 -0
- package/dist/{project-general-setting-U4S_KlhU.js → project-general-setting-kXh5myAr.js} +46 -36
- package/dist/project-seo-setting-POGPEJZ8.cjs +1 -0
- package/dist/project-seo-setting-nT1qo1Bb.js +89 -0
- package/dist/render.cjs +1 -1
- package/dist/render.js +23 -19
- package/dist/server.cjs +1 -1
- package/dist/server.js +1 -1
- package/dist/single-page-detail-EgQd9TSA.cjs +1 -0
- package/dist/{single-page-detail-pAxCy_Pe.js → single-page-detail-fV-A6vJR.js} +90 -80
- package/dist/studio.cjs +1 -1
- package/dist/studio.js +45 -25
- package/dist/ui.cjs +1 -1
- package/dist/ui.js +156 -357
- package/package.json +1 -1
- package/dist/AddBlocks-7ACJv8LW.cjs +0 -3
- package/dist/BrandingOptions-5j-XszLM.cjs +0 -1
- package/dist/CanvasArea-Dnm-yeus.cjs +0 -46
- package/dist/ChaiBuilderEditor-BoE-sArB.cjs +0 -163
- package/dist/ChaiBuilderEditor-hEuUONQ3.js +0 -27094
- package/dist/Class-_uCzl5v1.cjs +0 -1
- package/dist/CurrentPage-YMpqOqx7.cjs +0 -1
- package/dist/ImagesPanel-6us7hiLN.cjs +0 -1
- package/dist/ImagesPanel-oaHOD-Ex.js +0 -27
- package/dist/Layers-EzOZdWvd.cjs +0 -1
- package/dist/MODIFIERS-DsEzQ3aH.js +0 -73
- package/dist/MODIFIERS-Fx6WAZcw.cjs +0 -1
- package/dist/MarkAsGlobalBlock-0HubcRkY.js +0 -77
- package/dist/MarkAsGlobalBlock-HmeIyLCP.cjs +0 -1
- package/dist/PagesPanel-6JuwBLFQ.js +0 -50
- package/dist/PagesPanel-zJq8p1ja.cjs +0 -1
- package/dist/ProjectPanel-Zml2F8b9.cjs +0 -1
- package/dist/ProjectPanel-cu2QSDW9.js +0 -73
- package/dist/Settings-lc9PfnmG.cjs +0 -1
- package/dist/SidePanels-VH72zFE2.cjs +0 -1
- package/dist/Topbar-vQPo9xSY.cjs +0 -1
- package/dist/UnsplashImages-BoBBSi1a.cjs +0 -1
- package/dist/UploadImages-T6kW0s3G.cjs +0 -1
- package/dist/accordion-oPUeqPCZ.js +0 -42
- package/dist/accordion-ynvFtV_p.cjs +0 -1
- package/dist/add-page-modal--qZSwJuB.cjs +0 -1
- package/dist/add-page-modal-bj7qbZuK.js +0 -99
- package/dist/alert-dialog-GNfnpqFB.js +0 -64
- package/dist/alert-dialog-Mv0-wAvS.cjs +0 -1
- package/dist/command-ThdTuUxt.cjs +0 -1
- package/dist/command-VHca6CcN.js +0 -97
- package/dist/confirm-alert-8EHe0OOd.cjs +0 -1
- package/dist/confirm-alert-b0e_BLhF.js +0 -36
- package/dist/context-menu-8dC9uGXj.js +0 -122
- package/dist/context-menu-IgLbIuth.cjs +0 -1
- package/dist/controls-Ni5kEzLz.js +0 -103
- package/dist/controls-W97-POR_.cjs +0 -1
- package/dist/controls-enQY7NI8.js +0 -118
- package/dist/controls-xUKa23ic.cjs +0 -1
- package/dist/delete-page-modal-2LuDLEiP.cjs +0 -1
- package/dist/delete-page-modal-cnrR8tWH.js +0 -69
- package/dist/dialog-S_QbL1iq.cjs +0 -1
- package/dist/dialog-jrw9DF1f.js +0 -65
- package/dist/dropdown-menu-S03K_fNs.js +0 -164
- package/dist/dropdown-menu-sMXR59cB.cjs +0 -1
- package/dist/form-nRAvKPQj.cjs +0 -1
- package/dist/functions-nNTuSTsR.js +0 -1106
- package/dist/functions-pcUZhFJM.js +0 -12
- package/dist/functions-sCuB7nvZ.cjs +0 -2
- package/dist/functions-uw7QP2kT.cjs +0 -1
- package/dist/html-to-json-P6GpbcQX.cjs +0 -1
- package/dist/html-to-json-pdHQfRkN.js +0 -178
- package/dist/index-HAue58ea.cjs +0 -1
- package/dist/index-T4_wfKl5.js +0 -2256
- package/dist/index-X9ZgD09V.cjs +0 -1
- package/dist/index-ehKdBRUK.js +0 -18
- package/dist/label-KaP7MRrs.js +0 -10
- package/dist/label-tFm8HZdb.cjs +0 -1
- package/dist/link-6o6n2Tnd.js +0 -204
- package/dist/link-ece8dZGH.cjs +0 -1
- package/dist/page-viewer-IARz6OSp.cjs +0 -1
- package/dist/popover-a84pbVhQ.js +0 -23
- package/dist/popover-fKjgcRUx.cjs +0 -1
- package/dist/project-general-setting-eSl3t-VH.cjs +0 -1
- package/dist/project-seo-setting-Ga9v_ECU.js +0 -67
- package/dist/project-seo-setting-rankm1z3.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-yPgnu2AI.cjs +0 -1
- package/dist/skeleton-CU_FIbg3.js +0 -239
- package/dist/skeleton-JHP9zwL2.cjs +0 -1
- package/dist/tabs-Gb9v5dVb.js +0 -46
- package/dist/tabs-iWeaaVrg.cjs +0 -1
- package/dist/textarea-1kZEh7ki.cjs +0 -1
- package/dist/textarea-b2QvVhrK.js +0 -73
- package/dist/toggle-ASJRAaGP.js +0 -30
- package/dist/toggle-ehNIPmme.cjs +0 -1
- package/dist/useAddBlock-WJc3OgG8.js +0 -86
- package/dist/useAddBlock-dCKRFPRU.cjs +0 -1
- package/dist/useAllBlocks-6hvuNuyw.cjs +0 -1
- package/dist/useAllBlocks-PQKYvs-e.js +0 -20
- package/dist/useChaiExternalData-4K9WxANa.js +0 -6
- package/dist/useChaiExternalData-DkyBJ81C.cjs +0 -1
- package/dist/useDarkMode-ZKCO_gkt.js +0 -23
- package/dist/useDarkMode-dV6FM6l-.cjs +0 -1
- package/dist/useFeatureSupport-OLwNgEZb.js +0 -16
- package/dist/useFeatureSupport-c9IgPW2t.cjs +0 -1
- package/dist/useHiddenBlocks-3MsGOJ1s.js +0 -15
- package/dist/useHiddenBlocks-oJuQDmTy.cjs +0 -1
- package/dist/useLanguage-NKKKaxVM.cjs +0 -1
- package/dist/useLanguage-gVC5rxO5.js +0 -216
- package/dist/useMarkAsGlobalBlock-X73Vny8u.js +0 -25
- package/dist/useMarkAsGlobalBlock-ebBVGHg4.cjs +0 -1
- package/dist/useUiLibraries-4hPOi8DI.js +0 -12
- package/dist/useUiLibraries-9FhQCpKo.cjs +0 -1
- 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"),M=require("@radix-ui/react-icons"),H=require("./skeleton-JHP9zwL2.cjs"),w=require("./scroll-area-FiHvy-TZ.cjs"),d=require("./controls-W97-POR_.cjs"),z=require("sonner"),p=require("./form-nRAvKPQj.cjs"),P=require("./index-X9ZgD09V.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-BoE-sArB.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("./index-HAue58ea.cjs");require("./html-to-json-P6GpbcQX.cjs");require("himalaya");require("lucide-react");require("./alert-dialog-Mv0-wAvS.cjs");require("@radix-ui/react-alert-dialog");const L=f.lazy(()=>Promise.resolve().then(()=>require("./delete-page-modal-2LuDLEiP.cjs"))),G=f.lazy(()=>Promise.resolve().then(()=>require("./confirm-alert-8EHe0OOd.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,239 +0,0 @@
|
|
|
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
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
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/tabs-Gb9v5dVb.js
DELETED
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import { j as a } from "./jsx-runtime-Sp0orL4X.js";
|
|
2
|
-
import * as o from "react";
|
|
3
|
-
import * as e from "@radix-ui/react-tabs";
|
|
4
|
-
import { c as n } from "./utils-dze1SGvB.js";
|
|
5
|
-
const m = e.Root, r = o.forwardRef(({ className: s, ...i }, t) => /* @__PURE__ */ a.jsx(
|
|
6
|
-
e.List,
|
|
7
|
-
{
|
|
8
|
-
ref: t,
|
|
9
|
-
className: n(
|
|
10
|
-
"inline-flex h-9 items-center justify-center rounded-lg bg-muted p-1 text-muted-foreground",
|
|
11
|
-
s
|
|
12
|
-
),
|
|
13
|
-
...i
|
|
14
|
-
}
|
|
15
|
-
));
|
|
16
|
-
r.displayName = e.List.displayName;
|
|
17
|
-
const f = o.forwardRef(({ className: s, ...i }, t) => /* @__PURE__ */ a.jsx(
|
|
18
|
-
e.Trigger,
|
|
19
|
-
{
|
|
20
|
-
ref: t,
|
|
21
|
-
className: n(
|
|
22
|
-
"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",
|
|
23
|
-
s
|
|
24
|
-
),
|
|
25
|
-
...i
|
|
26
|
-
}
|
|
27
|
-
));
|
|
28
|
-
f.displayName = e.Trigger.displayName;
|
|
29
|
-
const c = o.forwardRef(({ className: s, ...i }, t) => /* @__PURE__ */ a.jsx(
|
|
30
|
-
e.Content,
|
|
31
|
-
{
|
|
32
|
-
ref: t,
|
|
33
|
-
className: n(
|
|
34
|
-
"mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",
|
|
35
|
-
s
|
|
36
|
-
),
|
|
37
|
-
...i
|
|
38
|
-
}
|
|
39
|
-
));
|
|
40
|
-
c.displayName = e.Content.displayName;
|
|
41
|
-
export {
|
|
42
|
-
m as T,
|
|
43
|
-
r as a,
|
|
44
|
-
f as b,
|
|
45
|
-
c
|
|
46
|
-
};
|
package/dist/tabs-iWeaaVrg.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
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;
|
|
@@ -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
|
-
};
|
package/dist/toggle-ASJRAaGP.js
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { j as n } from "./jsx-runtime-Sp0orL4X.js";
|
|
2
|
-
import * as s from "react";
|
|
3
|
-
import * as e from "@radix-ui/react-toggle";
|
|
4
|
-
import { cva as d } from "class-variance-authority";
|
|
5
|
-
import { c as f } from "./utils-dze1SGvB.js";
|
|
6
|
-
const c = d(
|
|
7
|
-
"inline-flex items-center justify-center rounded-md text-sm font-medium ring-offset-background transition-colors hover:bg-muted hover:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground",
|
|
8
|
-
{
|
|
9
|
-
variants: {
|
|
10
|
-
variant: {
|
|
11
|
-
default: "bg-transparent",
|
|
12
|
-
outline: "border border-input bg-transparent hover:bg-accent hover:text-accent-foreground"
|
|
13
|
-
},
|
|
14
|
-
size: {
|
|
15
|
-
default: "h-10 px-3",
|
|
16
|
-
sm: "h-9 px-2.5",
|
|
17
|
-
lg: "h-11 px-5"
|
|
18
|
-
}
|
|
19
|
-
},
|
|
20
|
-
defaultVariants: {
|
|
21
|
-
variant: "default",
|
|
22
|
-
size: "default"
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
), l = s.forwardRef(({ className: t, variant: o, size: r, ...a }, i) => /* @__PURE__ */ n.jsx(e.Root, { ref: i, className: f(c({ variant: o, size: r, className: t })), ...a }));
|
|
26
|
-
l.displayName = e.Root.displayName;
|
|
27
|
-
export {
|
|
28
|
-
l as T,
|
|
29
|
-
c as t
|
|
30
|
-
};
|
package/dist/toggle-ehNIPmme.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";const u=require("./jsx-runtime-JYMCiFoE.cjs"),l=require("react"),g=require("@radix-ui/react-toggle"),d=require("class-variance-authority"),f=require("./utils-qK_SjzzV.cjs");function o(e){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const r=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(n,t,r.get?r:{enumerable:!0,get:()=>e[t]})}}return n.default=e,Object.freeze(n)}const b=o(l),a=o(g),i=d.cva("inline-flex items-center justify-center rounded-md text-sm font-medium ring-offset-background transition-colors hover:bg-muted hover:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground",{variants:{variant:{default:"bg-transparent",outline:"border border-input bg-transparent hover:bg-accent hover:text-accent-foreground"},size:{default:"h-10 px-3",sm:"h-9 px-2.5",lg:"h-11 px-5"}},defaultVariants:{variant:"default",size:"default"}}),s=b.forwardRef(({className:e,variant:n,size:t,...r},c)=>u.jsxRuntimeExports.jsx(a.Root,{ref:c,className:f.cn(i({variant:n,size:t,className:e})),...r}));s.displayName=a.Root.displayName;exports.Toggle=s;exports.toggleVariants=i;
|
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
import { useCallback as x } from "react";
|
|
2
|
-
import { findIndex as l, filter as P, isEmpty as j, last as J, find as A, first as S, has as K, forIn as L, startsWith as O } from "lodash";
|
|
3
|
-
import { J as T, l as W } from "./ChaiBuilderEditor-hEuUONQ3.js";
|
|
4
|
-
import { g } from "./functions-pcUZhFJM.js";
|
|
5
|
-
import { u as Y, d as C } from "./useAllBlocks-PQKYvs-e.js";
|
|
6
|
-
import { b as q } from "./controls-Ni5kEzLz.js";
|
|
7
|
-
import { a as D } from "./MODIFIERS-DsEzQ3aH.js";
|
|
8
|
-
function E(e, s, d, o, h) {
|
|
9
|
-
if (s === null)
|
|
10
|
-
return [...e, ...o];
|
|
11
|
-
if (d !== null) {
|
|
12
|
-
const r = l(e, { _parent: s }), p = (r === -1 ? 0 : r) + d;
|
|
13
|
-
return e.splice(p, 0, ...o), e;
|
|
14
|
-
}
|
|
15
|
-
if (!h) {
|
|
16
|
-
const p = l(e, { _id: s }) + 1;
|
|
17
|
-
return e.splice(p, 0, ...o), e;
|
|
18
|
-
}
|
|
19
|
-
let t = l(e, { _id: s });
|
|
20
|
-
const n = P(e, { _parent: s });
|
|
21
|
-
j(n) || (t = l(e, { _id: J(n)._id }));
|
|
22
|
-
const f = t + 1;
|
|
23
|
-
return e.splice(f, 0, ...o), e;
|
|
24
|
-
}
|
|
25
|
-
const Q = () => {
|
|
26
|
-
const e = T(), s = Y(), [, d] = W(), o = x(
|
|
27
|
-
(t, n, f) => {
|
|
28
|
-
var u;
|
|
29
|
-
for (let i = 0; i < t.length; i++) {
|
|
30
|
-
const { _id: _ } = t[i];
|
|
31
|
-
t[i]._id = g();
|
|
32
|
-
const c = P(t, { _parent: _ });
|
|
33
|
-
for (let a = 0; a < c.length; a++)
|
|
34
|
-
c[a]._parent = t[i]._id;
|
|
35
|
-
}
|
|
36
|
-
let r;
|
|
37
|
-
n && (r = A(s, { _id: n }), t[0]._parent = n);
|
|
38
|
-
const p = r ? C(r._type) : !0;
|
|
39
|
-
return !p && r && (t[0]._parent = r._parent), e({
|
|
40
|
-
type: "set_blocks",
|
|
41
|
-
payload: E(s, n || null, f || null, t, p)
|
|
42
|
-
}), d([(u = S(t)) == null ? void 0 : u._id]), S(t);
|
|
43
|
-
},
|
|
44
|
-
[s, e, d]
|
|
45
|
-
);
|
|
46
|
-
return { addCoreBlock: x(
|
|
47
|
-
(t, n, f) => {
|
|
48
|
-
if (K(t, "blocks")) {
|
|
49
|
-
const m = t.blocks;
|
|
50
|
-
return o(m, n, f);
|
|
51
|
-
}
|
|
52
|
-
const r = g(), p = q(t.props), u = [];
|
|
53
|
-
L(p, (m, y) => {
|
|
54
|
-
if (O(m, D)) {
|
|
55
|
-
const U = m.replace(D, "");
|
|
56
|
-
u.push({
|
|
57
|
-
_id: U,
|
|
58
|
-
_type: "Slot",
|
|
59
|
-
_parent: r,
|
|
60
|
-
_name: t.props[y].name,
|
|
61
|
-
_styles: t.props[y].styles,
|
|
62
|
-
_emptyStyles: t.props[y].emptyStyles
|
|
63
|
-
});
|
|
64
|
-
}
|
|
65
|
-
});
|
|
66
|
-
const i = {
|
|
67
|
-
_type: t.type,
|
|
68
|
-
_id: r,
|
|
69
|
-
...p
|
|
70
|
-
};
|
|
71
|
-
let _;
|
|
72
|
-
n && (_ = A(s, { _id: n }), i._parent = n);
|
|
73
|
-
const c = _ ? C(_._type) : !0;
|
|
74
|
-
!c && _ && (i._parent = _._parent);
|
|
75
|
-
const a = [i, ...u];
|
|
76
|
-
return e({
|
|
77
|
-
type: "set_blocks",
|
|
78
|
-
payload: E(s, n || null, f || null, a, c)
|
|
79
|
-
}), d([i._id]), i;
|
|
80
|
-
},
|
|
81
|
-
[o, s, e, d]
|
|
82
|
-
), addPredefinedBlock: o };
|
|
83
|
-
};
|
|
84
|
-
export {
|
|
85
|
-
Q as u
|
|
86
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";const S=require("react"),n=require("lodash"),q=require("./ChaiBuilderEditor-BoE-sArB.cjs"),C=require("./functions-uw7QP2kT.cjs"),x=require("./useAllBlocks-6hvuNuyw.cjs"),D=require("./controls-xUKa23ic.cjs"),I=require("./MODIFIERS-Fx6WAZcw.cjs");function g(e,i,u,o,A){if(i===null)return[...e,...o];if(u!==null){const r=n.findIndex(e,{_parent:i}),c=(r===-1?0:r)+u;return e.splice(c,0,...o),e}if(!A){const c=n.findIndex(e,{_id:i})+1;return e.splice(c,0,...o),e}let t=n.findIndex(e,{_id:i});const s=n.filter(e,{_parent:i});n.isEmpty(s)||(t=n.findIndex(e,{_id:n.last(s)._id}));const p=t+1;return e.splice(p,0,...o),e}const E=()=>{const e=q.useDispatch(),i=x.useAllBlocks(),[,u]=q.useSelectedBlockIds(),o=S.useCallback((t,s,p)=>{var l;for(let d=0;d<t.length;d++){const{_id:_}=t[d];t[d]._id=C.generateUUID();const f=n.filter(t,{_parent:_});for(let a=0;a<f.length;a++)f[a]._parent=t[d]._id}let r;s&&(r=n.find(i,{_id:s}),t[0]._parent=s);const c=r?x.canAddChildBlock(r._type):!0;return!c&&r&&(t[0]._parent=r._parent),e({type:"set_blocks",payload:g(i,s||null,p||null,t,c)}),u([(l=n.first(t))==null?void 0:l._id]),n.first(t)},[i,e,u]);return{addCoreBlock:S.useCallback((t,s,p)=>{if(n.has(t,"blocks")){const y=t.blocks;return o(y,s,p)}const r=C.generateUUID(),c=D.getBlockDefaultProps(t.props),l=[];n.forIn(c,(y,h)=>{if(n.startsWith(y,I.SLOT_KEY)){const m=y.replace(I.SLOT_KEY,"");l.push({_id:m,_type:"Slot",_parent:r,_name:t.props[h].name,_styles:t.props[h].styles,_emptyStyles:t.props[h].emptyStyles})}});const d={_type:t.type,_id:r,...c};let _;s&&(_=n.find(i,{_id:s}),d._parent=s);const f=_?x.canAddChildBlock(_._type):!0;!f&&_&&(d._parent=_._parent);const a=[d,...l];return e({type:"set_blocks",payload:g(i,s||null,p||null,a,f)}),u([d._id]),d},[o,i,e,u]),addPredefinedBlock:o}};exports.useAddBlock=E;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";const l=require("lodash"),i=require("jotai"),r=require("./ChaiBuilderEditor-BoE-sArB.cjs"),s=t=>["Box","Slot","Form","DataProvider","Link","List","ListItem","Row","Column","Table","TableCell"].includes(t),u=t=>!["Slot"].includes(t),a=t=>!["Slot"].includes(t);function d(t,e){return t==="Slot"||e==="List"&&t!=="ListItem"||e==="Row"&&t!=="Column"?!1:s(e)}const B=(t,{dragSource:e,dropTarget:n})=>{const o=l.get(e,"data._type",""),c=l.get(n,"data._type","");return o==="Slot"||l.get(e,"id")&&l.get(e,"id")===l.get(n,"id")?!1:l.isEmpty(c)?!0:d(o,c)},k=()=>i.useAtomValue(r.presentBlocksAtom);exports.canAddChildBlock=s;exports.canDeleteBlock=a;exports.canDropBlock=B;exports.canDuplicateBlock=u;exports.useAllBlocks=k;
|