@chaibuilder/sdk 1.0.9 → 1.0.11
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-7ACJv8LW.cjs +3 -0
- package/dist/{AddBlocks-d10b7b87.js → AddBlocks-H7BZYHUC.js} +43 -40
- package/dist/BrandingOptions-5j-XszLM.cjs +1 -0
- package/dist/{BrandingOptions-f4ab5d9f.js → BrandingOptions-PAgY-kvj.js} +19 -22
- package/dist/CanvasArea-Dnm-yeus.cjs +46 -0
- package/dist/{CanvasArea-10356200.js → CanvasArea-zn2ox-5h.js} +492 -503
- package/dist/ChaiBuilderEditor-BoE-sArB.cjs +163 -0
- package/dist/{index-aa42febc.js → ChaiBuilderEditor-hEuUONQ3.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-6Jp4xAWK.js} +27 -24
- package/dist/CurrentPage-YMpqOqx7.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-EzOZdWvd.cjs +1 -0
- package/dist/{Layers-c3dd4fc8.js → Layers-WkZ48AUm.js} +43 -42
- package/dist/{MarkAsGlobalBlock-505ae793.js → MarkAsGlobalBlock-0HubcRkY.js} +18 -21
- package/dist/MarkAsGlobalBlock-HmeIyLCP.cjs +1 -0
- package/dist/{PagesPanel-bafc506f.js → PagesPanel-6JuwBLFQ.js} +17 -14
- package/dist/PagesPanel-zJq8p1ja.cjs +1 -0
- package/dist/ProjectPanel-Zml2F8b9.cjs +1 -0
- package/dist/{ProjectPanel-6113f394.js → ProjectPanel-cu2QSDW9.js} +23 -20
- package/dist/{Settings-1c41c514.js → Settings-fH8fZKpm.js} +266 -264
- package/dist/Settings-lc9PfnmG.cjs +1 -0
- package/dist/SidePanels-VH72zFE2.cjs +1 -0
- package/dist/{SidePanels-c13f87dc.js → SidePanels-w8ZHKJaR.js} +34 -42
- package/dist/{Topbar-b38d5d50.js → Topbar-hm1D_5sb.js} +34 -36
- package/dist/Topbar-vQPo9xSY.cjs +1 -0
- 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--qZSwJuB.cjs +1 -0
- package/dist/{add-page-modal-08a19915.js → add-page-modal-bj7qbZuK.js} +27 -23
- 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-W97-POR_.cjs +1 -0
- package/dist/controls-enQY7NI8.js +118 -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 +117 -70
- package/dist/delete-page-modal-2LuDLEiP.cjs +1 -0
- package/dist/{delete-page-modal-9b37665b.js → delete-page-modal-cnrR8tWH.js} +26 -23
- 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-HAue58ea.cjs +1 -0
- package/dist/index-T4_wfKl5.js +2256 -0
- package/dist/index-X9ZgD09V.cjs +1 -0
- package/dist/index-ehKdBRUK.js +18 -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-IARz6OSp.cjs +1 -0
- package/dist/{page-viewer-5c733179.js → page-viewer-Y4YiaZ_m.js} +30 -27
- 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-U4S_KlhU.js} +29 -25
- package/dist/project-general-setting-eSl3t-VH.cjs +1 -0
- package/dist/{project-seo-setting-d81fc1e3.js → project-seo-setting-Ga9v_ECU.js} +18 -19
- package/dist/project-seo-setting-rankm1z3.cjs +1 -0
- package/dist/render.cjs +1 -1
- package/dist/render.d.ts +7 -7
- package/dist/render.js +36 -36
- 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.cjs +1 -1
- package/dist/server.d.ts +7 -10
- package/dist/server.js +1 -4
- package/dist/{single-page-detail-04410e64.js → single-page-detail-pAxCy_Pe.js} +69 -65
- package/dist/single-page-detail-yPgnu2AI.cjs +1 -0
- 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 +72 -7
- package/dist/ui.js +272 -212
- package/dist/useAddBlock-WJc3OgG8.js +86 -0
- package/dist/useAddBlock-dCKRFPRU.cjs +1 -0
- package/dist/useAllBlocks-6hvuNuyw.cjs +1 -0
- package/dist/useAllBlocks-PQKYvs-e.js +20 -0
- package/dist/useChaiExternalData-4K9WxANa.js +6 -0
- package/dist/useChaiExternalData-DkyBJ81C.cjs +1 -0
- package/dist/useDarkMode-ZKCO_gkt.js +23 -0
- package/dist/useDarkMode-dV6FM6l-.cjs +1 -0
- package/dist/useFeatureSupport-OLwNgEZb.js +16 -0
- package/dist/useFeatureSupport-c9IgPW2t.cjs +1 -0
- package/dist/useHiddenBlocks-3MsGOJ1s.js +15 -0
- package/dist/useHiddenBlocks-oJuQDmTy.cjs +1 -0
- package/dist/useLanguage-NKKKaxVM.cjs +1 -0
- package/dist/useLanguage-gVC5rxO5.js +216 -0
- package/dist/useMarkAsGlobalBlock-X73Vny8u.js +25 -0
- package/dist/useMarkAsGlobalBlock-ebBVGHg4.cjs +1 -0
- package/dist/useUiLibraries-4hPOi8DI.js +12 -0
- package/dist/useUiLibraries-9FhQCpKo.cjs +1 -0
- package/package.json +20 -6
- 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,35 +1,35 @@
|
|
|
1
|
-
import { j as i } from "./jsx-runtime-
|
|
2
|
-
import * as
|
|
3
|
-
import { S as
|
|
4
|
-
import {
|
|
5
|
-
import { F as
|
|
6
|
-
import {
|
|
1
|
+
import { j as i } from "./jsx-runtime-Sp0orL4X.js";
|
|
2
|
+
import * as l from "react";
|
|
3
|
+
import { S as n } from "./scroll-area-ewXbxc3n.js";
|
|
4
|
+
import { u as c, o as u } from "./controls-enQY7NI8.js";
|
|
5
|
+
import { F as d } from "./form-dVpOAyRl.js";
|
|
6
|
+
import { a as x } from "./index-T4_wfKl5.js";
|
|
7
7
|
import "@radix-ui/react-scroll-area";
|
|
8
|
-
import "./utils-
|
|
8
|
+
import "./utils-dze1SGvB.js";
|
|
9
9
|
import "clsx";
|
|
10
10
|
import "tailwind-merge";
|
|
11
|
+
import "lodash";
|
|
11
12
|
import "@rjsf/core";
|
|
12
13
|
import "@rjsf/validator-ajv8";
|
|
13
|
-
import "
|
|
14
|
-
import "./link-57de608a.js";
|
|
14
|
+
import "./link-6o6n2Tnd.js";
|
|
15
15
|
import "react-icons-picker";
|
|
16
16
|
import "react-dom";
|
|
17
|
-
import "./dialog-
|
|
17
|
+
import "./dialog-jrw9DF1f.js";
|
|
18
18
|
import "@radix-ui/react-dialog";
|
|
19
19
|
import "@radix-ui/react-icons";
|
|
20
|
-
import "./ImagesPanel-
|
|
21
|
-
import "./tabs-
|
|
20
|
+
import "./ImagesPanel-oaHOD-Ex.js";
|
|
21
|
+
import "./tabs-Gb9v5dVb.js";
|
|
22
22
|
import "@radix-ui/react-tabs";
|
|
23
23
|
import "react-quill";
|
|
24
24
|
import "react-i18next";
|
|
25
|
-
import "./
|
|
26
|
-
import "
|
|
25
|
+
import "./skeleton-CU_FIbg3.js";
|
|
26
|
+
import "jotai";
|
|
27
27
|
import "@radix-ui/react-slot";
|
|
28
28
|
import "class-variance-authority";
|
|
29
29
|
import "@radix-ui/react-tooltip";
|
|
30
30
|
import "@radix-ui/react-toast";
|
|
31
|
-
import "
|
|
32
|
-
import "./MODIFIERS-
|
|
31
|
+
import "./ChaiBuilderEditor-hEuUONQ3.js";
|
|
32
|
+
import "./MODIFIERS-DsEzQ3aH.js";
|
|
33
33
|
import "@floating-ui/react-dom";
|
|
34
34
|
import "i18next";
|
|
35
35
|
import "flagged";
|
|
@@ -37,23 +37,27 @@ import "react-dnd";
|
|
|
37
37
|
import "@minoru/react-dnd-treeview";
|
|
38
38
|
import "react-hotkeys-hook";
|
|
39
39
|
import "flat-to-nested";
|
|
40
|
-
import "./
|
|
41
|
-
import "himalaya";
|
|
40
|
+
import "./functions-pcUZhFJM.js";
|
|
42
41
|
import "redux-undo";
|
|
43
42
|
import "@react-hookz/web";
|
|
43
|
+
import "./index-ehKdBRUK.js";
|
|
44
44
|
import "sonner";
|
|
45
|
+
import "./html-to-json-pdHQfRkN.js";
|
|
46
|
+
import "himalaya";
|
|
45
47
|
import "lucide-react";
|
|
46
|
-
|
|
48
|
+
import "./alert-dialog-GNfnpqFB.js";
|
|
49
|
+
import "@radix-ui/react-alert-dialog";
|
|
50
|
+
const lo = ({
|
|
47
51
|
_projectData: m,
|
|
48
52
|
seany: t
|
|
49
53
|
}) => {
|
|
50
54
|
const { data: o, isLoading: p } = x();
|
|
51
|
-
|
|
55
|
+
l.useEffect(() => {
|
|
52
56
|
o && t(o);
|
|
53
57
|
}, [o, t]);
|
|
54
58
|
const e = ({ formData: s }, r) => {
|
|
55
|
-
t((
|
|
56
|
-
...
|
|
59
|
+
t((f) => ({
|
|
60
|
+
...f,
|
|
57
61
|
[r]: s[r]
|
|
58
62
|
}));
|
|
59
63
|
}, a = {
|
|
@@ -61,10 +65,10 @@ const eo = ({
|
|
|
61
65
|
title: "Project Name",
|
|
62
66
|
default: o == null ? void 0 : o.name
|
|
63
67
|
}),
|
|
64
|
-
favicon:
|
|
68
|
+
favicon: u({ title: "Favicon", default: o == null ? void 0 : o.favicon })
|
|
65
69
|
};
|
|
66
|
-
return /* @__PURE__ */ i.jsx(
|
|
70
|
+
return /* @__PURE__ */ i.jsx(n, { className: "flex h-full select-none flex-col", children: /* @__PURE__ */ i.jsx(d, { properties: a, disabled: p, formData: m, onChange: e }) });
|
|
67
71
|
};
|
|
68
72
|
export {
|
|
69
|
-
|
|
73
|
+
lo as default
|
|
70
74
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const q=require("./jsx-runtime-JYMCiFoE.cjs"),a=require("react"),f=require("./scroll-area-FiHvy-TZ.cjs"),o=require("./controls-W97-POR_.cjs"),d=require("./form-nRAvKPQj.cjs"),m=require("./index-X9ZgD09V.cjs");require("@radix-ui/react-scroll-area");require("./utils-qK_SjzzV.cjs");require("clsx");require("tailwind-merge");require("lodash");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("@radix-ui/react-icons");require("./ImagesPanel-6us7hiLN.cjs");require("./tabs-iWeaaVrg.cjs");require("@radix-ui/react-tabs");require("react-quill");require("react-i18next");require("./skeleton-JHP9zwL2.cjs");require("jotai");require("@radix-ui/react-slot");require("class-variance-authority");require("@radix-ui/react-tooltip");require("@radix-ui/react-toast");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("sonner");require("./html-to-json-P6GpbcQX.cjs");require("himalaya");require("lucide-react");require("./alert-dialog-Mv0-wAvS.cjs");require("@radix-ui/react-alert-dialog");function j(r){const i=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(r){for(const e in r)if(e!=="default"){const u=Object.getOwnPropertyDescriptor(r,e);Object.defineProperty(i,e,u.get?u:{enumerable:!0,get:()=>r[e]})}}return i.default=r,Object.freeze(i)}const g=j(a),b=({_projectData:r,seany:i})=>{const{data:e,isLoading:u}=m.useProject();g.useEffect(()=>{e&&i(e)},[e,i]);const n=({formData:s},t)=>{i(l=>({...l,[t]:s[t]}))},c={name:o.u({title:"Project Name",default:e==null?void 0:e.name}),favicon:o.o({title:"Favicon",default:e==null?void 0:e.favicon})};return q.jsxRuntimeExports.jsx(f.ScrollArea,{className:"flex h-full select-none flex-col",children:q.jsxRuntimeExports.jsx(d.Form,{properties:c,disabled:u,formData:r,onChange:n})})};exports.default=b;
|
|
@@ -1,36 +1,35 @@
|
|
|
1
|
-
import { j as p } from "./jsx-runtime-
|
|
2
|
-
import {
|
|
3
|
-
import { F as v } from "./form-
|
|
1
|
+
import { j as p } from "./jsx-runtime-Sp0orL4X.js";
|
|
2
|
+
import { b as D, u as c, g, o as x } from "./controls-enQY7NI8.js";
|
|
3
|
+
import { F as v } from "./form-dVpOAyRl.js";
|
|
4
4
|
import "react";
|
|
5
|
+
import "lodash";
|
|
5
6
|
import "@rjsf/core";
|
|
6
7
|
import "@rjsf/validator-ajv8";
|
|
7
|
-
import "
|
|
8
|
-
import "./link-57de608a.js";
|
|
8
|
+
import "./link-6o6n2Tnd.js";
|
|
9
9
|
import "react-icons-picker";
|
|
10
10
|
import "react-dom";
|
|
11
|
-
import "./dialog-
|
|
11
|
+
import "./dialog-jrw9DF1f.js";
|
|
12
12
|
import "@radix-ui/react-dialog";
|
|
13
13
|
import "@radix-ui/react-icons";
|
|
14
|
-
import "./utils-
|
|
14
|
+
import "./utils-dze1SGvB.js";
|
|
15
15
|
import "clsx";
|
|
16
16
|
import "tailwind-merge";
|
|
17
|
-
import "./ImagesPanel-
|
|
18
|
-
import "./tabs-
|
|
17
|
+
import "./ImagesPanel-oaHOD-Ex.js";
|
|
18
|
+
import "./tabs-Gb9v5dVb.js";
|
|
19
19
|
import "@radix-ui/react-tabs";
|
|
20
20
|
import "react-quill";
|
|
21
21
|
import "react-i18next";
|
|
22
|
-
import "./
|
|
23
|
-
import "
|
|
22
|
+
import "./skeleton-CU_FIbg3.js";
|
|
23
|
+
import "jotai";
|
|
24
24
|
import "@radix-ui/react-slot";
|
|
25
25
|
import "class-variance-authority";
|
|
26
26
|
import "@radix-ui/react-tooltip";
|
|
27
27
|
import "@radix-ui/react-toast";
|
|
28
|
-
|
|
29
|
-
const W = ({
|
|
28
|
+
const V = ({
|
|
30
29
|
_projectData: t,
|
|
31
30
|
seany: l
|
|
32
31
|
}) => {
|
|
33
|
-
var e,
|
|
32
|
+
var o, e, r, m, a, s;
|
|
34
33
|
const n = ({ formData: f }) => {
|
|
35
34
|
const i = { ...f };
|
|
36
35
|
i.seoData.title === void 0 && (i.seoData.title = ""), i.seoData.description === void 0 && (i.seoData.description = ""), i.seoData.image === void 0 && (i.seoData.image = ""), l((u) => ({
|
|
@@ -41,14 +40,14 @@ const W = ({
|
|
|
41
40
|
seoData: D({
|
|
42
41
|
title: "",
|
|
43
42
|
default: {
|
|
44
|
-
title: ((
|
|
45
|
-
description: ((
|
|
46
|
-
image: ((
|
|
43
|
+
title: ((o = t.seoData) == null ? void 0 : o.title) || "",
|
|
44
|
+
description: ((e = t.seoData) == null ? void 0 : e.description) || "",
|
|
45
|
+
image: ((r = t.seoData) == null ? void 0 : r.image) || ""
|
|
47
46
|
},
|
|
48
47
|
properties: {
|
|
49
48
|
title: c({
|
|
50
49
|
title: "Default Title",
|
|
51
|
-
default: ((
|
|
50
|
+
default: ((m = t.seoData) == null ? void 0 : m.title) || ""
|
|
52
51
|
}),
|
|
53
52
|
description: g({
|
|
54
53
|
title: "Default Description",
|
|
@@ -64,5 +63,5 @@ const W = ({
|
|
|
64
63
|
return /* @__PURE__ */ p.jsx("div", { className: "flex h-full select-none flex-col", children: /* @__PURE__ */ p.jsx(v, { properties: d, formData: t, onChange: n }) });
|
|
65
64
|
};
|
|
66
65
|
export {
|
|
67
|
-
|
|
66
|
+
V as default
|
|
68
67
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("./jsx-runtime-JYMCiFoE.cjs"),r=require("./controls-W97-POR_.cjs"),g=require("./form-nRAvKPQj.cjs");require("react");require("lodash");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("@radix-ui/react-icons");require("./utils-qK_SjzzV.cjs");require("clsx");require("tailwind-merge");require("./ImagesPanel-6us7hiLN.cjs");require("./tabs-iWeaaVrg.cjs");require("@radix-ui/react-tabs");require("react-quill");require("react-i18next");require("./skeleton-JHP9zwL2.cjs");require("jotai");require("@radix-ui/react-slot");require("class-variance-authority");require("@radix-ui/react-tooltip");require("@radix-ui/react-toast");const D=({_projectData:e,seany:q})=>{var t,o,u,s,a,l;const d=({formData:f})=>{const i={...f};i.seoData.title===void 0&&(i.seoData.title=""),i.seoData.description===void 0&&(i.seoData.description=""),i.seoData.image===void 0&&(i.seoData.image=""),q(m=>({...m,...i}))},c={seoData:r.b({title:"",default:{title:((t=e.seoData)==null?void 0:t.title)||"",description:((o=e.seoData)==null?void 0:o.description)||"",image:((u=e.seoData)==null?void 0:u.image)||""},properties:{title:r.u({title:"Default Title",default:((s=e.seoData)==null?void 0:s.title)||""}),description:r.g({title:"Default Description",default:((a=e.seoData)==null?void 0:a.description)||""}),image:r.o({title:"Social Media Image",default:((l=e.seoData)==null?void 0:l.image)||""})}})};return n.jsxRuntimeExports.jsx("div",{className:"flex h-full select-none flex-col",children:n.jsxRuntimeExports.jsx(g.Form,{properties:c,formData:e,onChange:d})})};exports.default=D;
|
package/dist/render.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("./jsx-runtime-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("./jsx-runtime-JYMCiFoE.cjs"),x=require("react"),r=require("lodash"),R=require("tailwind-merge"),l=require("./MODIFIERS-Fx6WAZcw.cjs"),_=require("./index-HAue58ea.cjs"),j=require("./functions-sCuB7nvZ.cjs"),q=require("react-wrap-balancer");require("@mhsdesign/jit-browser-tailwindcss");require("@bobthered/tailwindcss-palette-generator");require("@tailwindcss/forms");require("@tailwindcss/typography");require("@tailwindcss/aspect-ratio");require("@tailwindcss/line-clamp");const y=e=>{const s={};return Object.keys(e).forEach(t=>{r.isString(e[t])&&e[t].startsWith(l.SLOT_KEY)&&(s[t]=e[t].replace(l.SLOT_KEY,"").split(","))}),s},O=r.memoize((e,s)=>{const t=e.replace(l.STYLES_KEY,"").split(","),n=R.twMerge(t[0],t[1]);return j.addPrefixToClasses(n,s).replace(l.STYLES_KEY,"").trim()});function B(e,s){return r.get(e,`${s}_attrs`,{})}function C(e,s){const t={};return Object.keys(e).forEach(n=>{if(r.isString(e[n])&&e[n].startsWith(l.STYLES_KEY)){const o=O(e[n],s);t[n]={className:o,...B(e,n)}}}),t}function T(e,s){const t=r.get(e,"_bindings",{});return r.isEmpty(t)?{...e}:(r.each(t,(n,o)=>{r.isString(n)&&r.get(s,n,null)&&(e[o]=r.get(s,n,null))}),e)}function a({blocks:e,parent:s,classPrefix:t="c-",externalData:n={}}){const o=e,p=i=>C(i,t),h=s?r.filter(e,{_parent:s}):r.filter(e,i=>r.isEmpty(i._parent));return c.jsxRuntimeExports.jsx(c.jsxRuntimeExports.Fragment,{children:x.Children.toArray(h.map((i,f)=>{const d=y(i),m={};r.isEmpty(d)||Object.keys(d).forEach(u=>{m[u]=x.Children.toArray(d[u].map(E=>c.jsxRuntimeExports.jsx(a,{externalData:n,classPrefix:t,blocks:o,parent:E})))});const S=r.filter(o,{_parent:i._id});m.children=S.length>0?c.jsxRuntimeExports.jsx(a,{externalData:n,classPrefix:t,parent:i._id,blocks:o}):null;const g=_.h(i._type);if(g!==null){let u=i;const E=g.component;return u={...g.defaults,...i},x.createElement(E,r.omit({blockProps:{},inBuilder:!1,...u,index:f,...T(i,n),...p(u),...m},["_parent"]))}return c.jsxRuntimeExports.jsxs("noscript",{children:[i._type," not found"]})}))})}const Y=({pageData:e,externalData:s={},before:t=null,after:n=null,classPrefix:o="c-"})=>{const p=r.get(e.project,"brandingOptions",l.BRANDING_OPTIONS_DEFAULTS);return c.jsxRuntimeExports.jsxs(c.jsxRuntimeExports.Fragment,{children:[t,c.jsxRuntimeExports.jsx("div",{className:o.replace("-","")+" "+j.getBrandingClasses(p,o)+" min-h-screen",children:c.jsxRuntimeExports.jsx(q.Provider,{children:c.jsxRuntimeExports.jsx(a,{externalData:s,blocks:e.page.blocks||[],classPrefix:o})})}),n]})};exports.RenderChaiBlocks=a;exports.RenderChaiPage=Y;
|
package/dist/render.d.ts
CHANGED
|
@@ -14,8 +14,8 @@ export declare type ChaiPageData = {
|
|
|
14
14
|
blocks: ChaiBlock[];
|
|
15
15
|
seoData?: Record<string, string>;
|
|
16
16
|
slug?: string;
|
|
17
|
-
name
|
|
18
|
-
providers
|
|
17
|
+
name?: string;
|
|
18
|
+
providers?: {
|
|
19
19
|
providerKey: string;
|
|
20
20
|
args: Record<string, any>;
|
|
21
21
|
}[];
|
|
@@ -29,13 +29,13 @@ export declare type ChaiPageData = {
|
|
|
29
29
|
}[];
|
|
30
30
|
}[];
|
|
31
31
|
project: {
|
|
32
|
-
name
|
|
33
|
-
favicon
|
|
32
|
+
name?: string;
|
|
33
|
+
favicon?: string;
|
|
34
34
|
brandingOptions: Record<string, string | number>;
|
|
35
35
|
seoData?: Record<string, string>;
|
|
36
|
-
primaryLanguage
|
|
37
|
-
languages
|
|
38
|
-
homepage
|
|
36
|
+
primaryLanguage?: string;
|
|
37
|
+
languages?: string[];
|
|
38
|
+
homepage?: string;
|
|
39
39
|
};
|
|
40
40
|
};
|
|
41
41
|
|
package/dist/render.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { j as o } from "./jsx-runtime-
|
|
1
|
+
import { j as o } from "./jsx-runtime-Sp0orL4X.js";
|
|
2
2
|
import u from "react";
|
|
3
|
-
import { memoize as y, filter as g, isEmpty as h, omit as A, isString as E, get as
|
|
3
|
+
import { memoize as y, filter as g, isEmpty as h, omit as A, isString as E, get as a, each as x } from "lodash";
|
|
4
4
|
import { twMerge as N } from "tailwind-merge";
|
|
5
|
-
import { S as _, a as
|
|
6
|
-
import {
|
|
7
|
-
import { a as F, g as L } from "./functions-
|
|
5
|
+
import { S as _, a as S, B as R } from "./MODIFIERS-DsEzQ3aH.js";
|
|
6
|
+
import { h as T } from "./index-ehKdBRUK.js";
|
|
7
|
+
import { a as F, g as L } from "./functions-nNTuSTsR.js";
|
|
8
8
|
import { Provider as Y } from "react-wrap-balancer";
|
|
9
9
|
import "@mhsdesign/jit-browser-tailwindcss";
|
|
10
10
|
import "@bobthered/tailwindcss-palette-generator";
|
|
@@ -14,51 +14,51 @@ import "@tailwindcss/aspect-ratio";
|
|
|
14
14
|
import "@tailwindcss/line-clamp";
|
|
15
15
|
const I = (t) => {
|
|
16
16
|
const s = {};
|
|
17
|
-
return Object.keys(t).forEach((
|
|
18
|
-
E(t[
|
|
17
|
+
return Object.keys(t).forEach((r) => {
|
|
18
|
+
E(t[r]) && t[r].startsWith(S) && (s[r] = t[r].replace(S, "").split(","));
|
|
19
19
|
}), s;
|
|
20
20
|
}, K = y((t, s) => {
|
|
21
|
-
const
|
|
22
|
-
return F(
|
|
21
|
+
const r = t.replace(_, "").split(","), n = N(r[0], r[1]);
|
|
22
|
+
return F(n, s).replace(_, "").trim();
|
|
23
23
|
});
|
|
24
24
|
function W(t, s) {
|
|
25
|
-
return
|
|
25
|
+
return a(t, `${s}_attrs`, {});
|
|
26
26
|
}
|
|
27
27
|
function w(t, s) {
|
|
28
|
-
const
|
|
29
|
-
return Object.keys(t).forEach((
|
|
30
|
-
if (E(t[
|
|
31
|
-
const i = K(t[
|
|
32
|
-
n
|
|
28
|
+
const r = {};
|
|
29
|
+
return Object.keys(t).forEach((n) => {
|
|
30
|
+
if (E(t[n]) && t[n].startsWith(_)) {
|
|
31
|
+
const i = K(t[n], s);
|
|
32
|
+
r[n] = {
|
|
33
33
|
className: i,
|
|
34
|
-
...W(t,
|
|
34
|
+
...W(t, n)
|
|
35
35
|
};
|
|
36
36
|
}
|
|
37
|
-
}),
|
|
37
|
+
}), r;
|
|
38
38
|
}
|
|
39
39
|
function z(t, s) {
|
|
40
|
-
const
|
|
41
|
-
return h(
|
|
42
|
-
E(
|
|
40
|
+
const r = a(t, "_bindings", {});
|
|
41
|
+
return h(r) ? { ...t } : (x(r, (n, i) => {
|
|
42
|
+
E(n) && a(s, n, null) && (t[i] = a(s, n, null));
|
|
43
43
|
}), t);
|
|
44
44
|
}
|
|
45
45
|
function j({
|
|
46
46
|
blocks: t,
|
|
47
47
|
parent: s,
|
|
48
|
-
classPrefix:
|
|
49
|
-
externalData:
|
|
48
|
+
classPrefix: r = "c-",
|
|
49
|
+
externalData: n = {}
|
|
50
50
|
}) {
|
|
51
|
-
const i = t,
|
|
51
|
+
const i = t, m = (e) => w(e, r), B = s ? g(t, { _parent: s }) : g(t, (e) => h(e._parent));
|
|
52
52
|
return /* @__PURE__ */ o.jsx(o.Fragment, { children: u.Children.toArray(
|
|
53
|
-
|
|
53
|
+
B.map((e, C) => {
|
|
54
54
|
const c = I(e), l = {};
|
|
55
55
|
h(c) || Object.keys(c).forEach((p) => {
|
|
56
56
|
l[p] = u.Children.toArray(
|
|
57
57
|
c[p].map((f) => /* @__PURE__ */ o.jsx(
|
|
58
58
|
j,
|
|
59
59
|
{
|
|
60
|
-
externalData:
|
|
61
|
-
classPrefix:
|
|
60
|
+
externalData: n,
|
|
61
|
+
classPrefix: r,
|
|
62
62
|
blocks: i,
|
|
63
63
|
parent: f
|
|
64
64
|
}
|
|
@@ -69,8 +69,8 @@ function j({
|
|
|
69
69
|
l.children = O.length > 0 ? /* @__PURE__ */ o.jsx(
|
|
70
70
|
j,
|
|
71
71
|
{
|
|
72
|
-
externalData:
|
|
73
|
-
classPrefix:
|
|
72
|
+
externalData: n,
|
|
73
|
+
classPrefix: r,
|
|
74
74
|
parent: e._id,
|
|
75
75
|
blocks: i
|
|
76
76
|
}
|
|
@@ -87,8 +87,8 @@ function j({
|
|
|
87
87
|
inBuilder: !1,
|
|
88
88
|
...p,
|
|
89
89
|
index: C,
|
|
90
|
-
...z(e,
|
|
91
|
-
...
|
|
90
|
+
...z(e, n),
|
|
91
|
+
...m(p),
|
|
92
92
|
...l
|
|
93
93
|
},
|
|
94
94
|
["_parent"]
|
|
@@ -105,21 +105,21 @@ function j({
|
|
|
105
105
|
const b = ({
|
|
106
106
|
pageData: t,
|
|
107
107
|
externalData: s = {},
|
|
108
|
-
before:
|
|
109
|
-
after:
|
|
108
|
+
before: r = null,
|
|
109
|
+
after: n = null,
|
|
110
110
|
classPrefix: i = "c-"
|
|
111
111
|
}) => {
|
|
112
|
-
const
|
|
112
|
+
const m = a(t.project, "brandingOptions", R);
|
|
113
113
|
return /* @__PURE__ */ o.jsxs(o.Fragment, { children: [
|
|
114
|
-
|
|
114
|
+
r,
|
|
115
115
|
/* @__PURE__ */ o.jsx(
|
|
116
116
|
"div",
|
|
117
117
|
{
|
|
118
|
-
className: i.replace("-", "") + " " + L(
|
|
118
|
+
className: i.replace("-", "") + " " + L(m, i) + " min-h-screen",
|
|
119
119
|
children: /* @__PURE__ */ o.jsx(Y, { children: /* @__PURE__ */ o.jsx(j, { externalData: s, blocks: t.page.blocks || [], classPrefix: i }) })
|
|
120
120
|
}
|
|
121
121
|
),
|
|
122
|
-
|
|
122
|
+
n
|
|
123
123
|
] });
|
|
124
124
|
};
|
|
125
125
|
export {
|
|
@@ -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.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var u=Object.defineProperty;var g=(a,t,e)=>t in a?u(a,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):a[t]=e;var h=(a,t,e)=>(g(a,typeof t!="symbol"?t+"":t,e),e);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("lodash"),l=require("
|
|
1
|
+
"use strict";var u=Object.defineProperty;var g=(a,t,e)=>t in a?u(a,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):a[t]=e;var h=(a,t,e)=>(g(a,typeof t!="symbol"?t+"":t,e),e);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("lodash"),l=require("./index-HAue58ea.cjs"),d="https://api.chaibuilder.com";class p{constructor(t,e){h(this,"_authSecret");h(this,"_accessToken",null);h(this,"_appKey");if(!t)throw"Please provide valid auth secret.";if(!e)throw"Please provide valid project key.";this._authSecret=t,this._appKey=e}setAccessToken(t){this._accessToken=t}async getPageData(t){const e=this.getHeaders(),s=this.getURL("page-data",i.isEmpty(t)?{}:{slug:t}),o={method:"GET",headers:e,next:{tags:["everything",i.isEmpty(t)?"_homepage":t]}};return this.fetchAPI(s,o)}async unlockPage(t){if(!t)return Promise.reject({data:null,error:{message:"Invalid page uuid"},result:"error"});const e=this.getHeaders(),s=this.getURL("page/unlock"),o={method:"POST",headers:e,body:JSON.stringify({uuid:t})};return this.fetchAPI(s,o)}async getPage(t){if(!t)return Promise.reject({data:null,error:{message:"Invalid page uuid"},result:"error"});const e=this.getHeaders(),s=this.getURL("page",{uuid:t}),o={method:"GET",headers:e};return this.fetchAPI(s,o)}async getPages(){const t=this.getHeaders(),e=this.getURL("pages"),r={method:"GET",headers:t};return this.fetchAPI(e,r)}async addPage(t){const e=JSON.stringify(t),s=this.getHeaders(),r=this.getURL("page"),n={method:"POST",headers:s,body:e};return this.fetchAPI(r,n)}async deletePage(t){if(!t)return Promise.reject({data:null,error:{message:"Invalid page uuid"},result:"error"});const e=this.getHeaders(),s=this.getURL("page",{uuid:t}),o={method:"DELETE",headers:e};return this.fetchAPI(s,o)}async updatePage(t){const e=JSON.stringify(t),s=this.getHeaders(),r=this.getURL("page"),n={method:"PUT",headers:s,body:e};return this.fetchAPI(r,n)}async getProject(){const t=this.getHeaders(),e=this.getURL("project"),r={method:"GET",headers:t};return this.fetchAPI(e,r)}async updateProject(t){const e=JSON.stringify(t),s=this.getHeaders(),r=this.getURL("project"),n={method:"PUT",headers:s,body:e};return this.fetchAPI(r,n)}async uploadAsset(t){const e=this.getHeaders(),s=this.getURL("asset"),r="POST",o=await t.get("file"),n=new FormData;n.append("file",o);const c={method:r,headers:e,body:n};return this.fetchAPI(s,c)}async getAssets(t,e){const s=this.getHeaders(),r=this.getURL("asset");t&&r.concat(`?limit=${t}`),e&&r.concat(`&offset=${e}`);const n={method:"GET",headers:s};return this.fetchAPI(r,n)}async authenticate({password:t}){const e=JSON.stringify({password:t}),s=this.getHeaders(),r=this.getURL("authenticate"),n={method:"POST",headers:s,body:e};return this.fetchAPI(r,n)}async login({password:t,email:e}){const s=JSON.stringify({password:t,email:e}),r=this.getHeaders(),o=this.getURL("login"),c={method:"POST",headers:r,body:s};return this.fetchAPI(o,c)}async logout(){const t=this.getHeaders(),e=this.getURL("logout"),r={method:"POST",headers:t};return this.fetchAPI(e,r)}async verify(){const t=this.getHeaders(),e=this.getURL("verify"),r={method:"POST",headers:t};return this.fetchAPI(e,r)}getURL(t,e){const s=new URLSearchParams(e).toString();return i.isEmpty(e)?`${d}/v1/${t}`:`${d}/v1/${t}?${s}`}getHeaders(){const t=new Headers;return t.append("x-chai-app-key",this._appKey),t.append("x-chai-auth-secret",this._authSecret),this._accessToken&&t.append("x-chai-access-token",this._accessToken),t}async fetchAPI(t,e){try{const s=await fetch(t,e).then(r=>r.json());if((s==null?void 0:s.result)==="success")return{data:s==null?void 0:s.data,error:null,result:"success"};throw s==null?void 0:s.error}catch(s){return{data:null,error:s,result:"error"}}}}const y=async(a,t)=>{const e=l.A(),s=i.filter(e,n=>i.map(a,"providerKey").includes(n.providerKey)),r={},o=[];for(const n of s)try{r[n.providerKey]=await n.dataFn({},t)}catch(c){o.push(c)}return{data:r,errors:o}};exports.ChaibuilderBackend=p;exports.prepareExternalData=y;
|
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
|
@@ -2,7 +2,7 @@ var g = Object.defineProperty;
|
|
|
2
2
|
var u = (c, t, e) => t in c ? g(c, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : c[t] = e;
|
|
3
3
|
var h = (c, t, e) => (u(c, typeof t != "symbol" ? t + "" : t, e), e);
|
|
4
4
|
import { isEmpty as i, filter as l, map as p } from "lodash";
|
|
5
|
-
import {
|
|
5
|
+
import { A as m } from "./index-ehKdBRUK.js";
|
|
6
6
|
const d = "https://api.chaibuilder.com";
|
|
7
7
|
class A {
|
|
8
8
|
constructor(t, e) {
|
|
@@ -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() {
|