@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
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-WKRPbKtm.cjs"),t=require("react"),n=require("@radix-ui/react-icons"),o=require("./index-c8zW_D2V.cjs"),x=require("./index-_jFEo7h5.cjs");require("./Class-RZuPYbUS.cjs");require("clsx");require("tailwind-merge");require("lodash");require("@radix-ui/react-toggle");require("class-variance-authority");require("@radix-ui/react-switch");require("@radix-ui/react-slot");require("@radix-ui/react-accordion");require("@radix-ui/react-alert-dialog");require("@radix-ui/react-dialog");require("@radix-ui/react-label");require("@radix-ui/react-scroll-area");require("@radix-ui/react-tabs");require("@radix-ui/react-tooltip");require("@radix-ui/react-popover");require("@radix-ui/react-menubar");require("@radix-ui/react-hover-card");require("@radix-ui/react-select");require("@radix-ui/react-dropdown-menu");require("@radix-ui/react-separator");require("@radix-ui/react-toast");require("cmdk");require("@radix-ui/react-context-menu");require("react-icons-picker");require("react-dom");require("react-quill");require("jotai");require("flat-to-nested");require("redux-undo");require("./index-fwo4wa7u.cjs");require("@react-hookz/web");require("react-i18next");require("i18next");require("./index-m2muA80V.cjs");require("./lib.cjs");require("himalaya");require("@mhsdesign/jit-browser-tailwindcss");require("@bobthered/tailwindcss-palette-generator");require("@tailwindcss/forms");require("@tailwindcss/typography");require("@tailwindcss/aspect-ratio");require("@tailwindcss/line-clamp");require("@floating-ui/react-dom");require("react-textarea-autosize");require("flagged");require("react-dnd");require("@minoru/react-dnd-treeview");require("react-hotkeys-hook");require("sonner");require("lucide-react");const q=t.lazy(()=>Promise.resolve().then(()=>require("./single-page-detail-EgQd9TSA.cjs"))),m=({pageData:s})=>{const[r,i]=t.useState("CLOSE");return e.jsxRuntimeExports.jsxs(o.Popover,{open:r==="OPEN"||r==="ALERT"||r==="PENDING",onOpenChange:u=>{i(r==="PENDING"?"ALERT":u?"OPEN":"CLOSE")},children:[e.jsxRuntimeExports.jsx(o.PopoverTrigger,{asChild:!0,onClick:u=>{u.stopPropagation(),i("OPEN")},children:e.jsxRuntimeExports.jsx("div",{className:"flex items-center justify-between",children:r==="OPEN"||r==="ALERT"||r==="PENDING"?e.jsxRuntimeExports.jsx(n.ChevronRightIcon,{}):e.jsxRuntimeExports.jsx("div",{className:"hidden hover:text-blue-600 group-hover:flex",children:e.jsxRuntimeExports.jsx(n.GearIcon,{})})})}),e.jsxRuntimeExports.jsx(o.PopoverContent,{side:"right",align:"start",alignOffset:-35,className:"h-screen w-96",children:e.jsxRuntimeExports.jsx(t.Suspense,{fallback:e.jsxRuntimeExports.jsxs("div",{className:"flex w-full animate-pulse flex-col gap-y-3",children:[e.jsxRuntimeExports.jsx("div",{className:"bg-background-300 h-6 w-1/2"}),e.jsxRuntimeExports.jsx("div",{className:"bg-background-300 h-20 w-full"}),e.jsxRuntimeExports.jsx("div",{className:"bg-background-300 h-20 w-full"})]}),children:e.jsxRuntimeExports.jsx(q,{pageData:s,open:r,setOpen:i})})})]})},j=s=>{const[r]=x.useCurrentPage(),{data:i}=x.useProject(),u=x.useChangePage(),l=(i==null?void 0:i.homepage)===s.uuid,a=r===s.uuid,c=()=>u(s);return i?e.jsxRuntimeExports.jsxs("button",{className:`group relative flex w-full cursor-pointer items-center justify-between px-2.5 py-2 ${a?"bg-blue-200 ":""}`,onClick:c,type:"button",children:[e.jsxRuntimeExports.jsxs("div",{className:"flex text-sm items-center gap-x-1.5",children:[l?e.jsxRuntimeExports.jsx(n.HomeIcon,{}):e.jsxRuntimeExports.jsx(n.FileTextIcon,{})," ",s.name]}),e.jsxRuntimeExports.jsx(m,{pageData:s})]}):null},p=({pages:s,isLoading:r})=>r?e.jsxRuntimeExports.jsxs("div",{className:"flex animate-pulse flex-col gap-y-1 px-2.5 pt-2",children:[e.jsxRuntimeExports.jsx("div",{className:"bg-background-200 h-7 w-full"}),e.jsxRuntimeExports.jsx("div",{className:"bg-background-200 h-7 w-full"}),e.jsxRuntimeExports.jsx("div",{className:"bg-background-200 h-7 w-full"})]}):s.length===0?e.jsxRuntimeExports.jsx("div",{className:"px-2.5 pb-2 pt-4",children:"No pages"}):e.jsxRuntimeExports.jsx("div",{className:"-mb-2",children:t.Children.toArray(s.map(i=>e.jsxRuntimeExports.jsx(j,{...i})))});exports.default=p;
|
|
@@ -1,98 +1,116 @@
|
|
|
1
|
-
import { j as e } from "./jsx-runtime-
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import "
|
|
7
|
-
import "./utils-dze1SGvB.js";
|
|
1
|
+
import { j as e } from "./jsx-runtime-qAwJ85SY.js";
|
|
2
|
+
import s, { useState as n, Suspense as l } from "react";
|
|
3
|
+
import { ChevronRightIcon as c, GearIcon as u, HomeIcon as d, FileTextIcon as x } from "@radix-ui/react-icons";
|
|
4
|
+
import { b1 as g, b2 as h, b3 as f } from "./index-2EHcmZqL.js";
|
|
5
|
+
import { e as j, b, d as N } from "./index-cU5eyVRU.js";
|
|
6
|
+
import "./Class-nQk08vqd.js";
|
|
8
7
|
import "clsx";
|
|
9
8
|
import "tailwind-merge";
|
|
10
|
-
import "
|
|
11
|
-
import "
|
|
9
|
+
import "lodash";
|
|
10
|
+
import "@radix-ui/react-toggle";
|
|
11
|
+
import "class-variance-authority";
|
|
12
|
+
import "@radix-ui/react-switch";
|
|
13
|
+
import "@radix-ui/react-slot";
|
|
14
|
+
import "@radix-ui/react-accordion";
|
|
15
|
+
import "@radix-ui/react-alert-dialog";
|
|
16
|
+
import "@radix-ui/react-dialog";
|
|
17
|
+
import "@radix-ui/react-label";
|
|
12
18
|
import "@radix-ui/react-scroll-area";
|
|
19
|
+
import "@radix-ui/react-tabs";
|
|
20
|
+
import "@radix-ui/react-tooltip";
|
|
21
|
+
import "@radix-ui/react-popover";
|
|
22
|
+
import "@radix-ui/react-menubar";
|
|
23
|
+
import "@radix-ui/react-hover-card";
|
|
24
|
+
import "@radix-ui/react-select";
|
|
25
|
+
import "@radix-ui/react-dropdown-menu";
|
|
26
|
+
import "@radix-ui/react-separator";
|
|
27
|
+
import "@radix-ui/react-toast";
|
|
28
|
+
import "cmdk";
|
|
29
|
+
import "@radix-ui/react-context-menu";
|
|
30
|
+
import "react-icons-picker";
|
|
13
31
|
import "react-dom";
|
|
14
|
-
import "
|
|
32
|
+
import "react-quill";
|
|
15
33
|
import "jotai";
|
|
16
|
-
import "
|
|
34
|
+
import "flat-to-nested";
|
|
35
|
+
import "redux-undo";
|
|
36
|
+
import "./index-gmZcUXyn.js";
|
|
37
|
+
import "@react-hookz/web";
|
|
17
38
|
import "react-i18next";
|
|
39
|
+
import "i18next";
|
|
40
|
+
import "./index-RVm8Txnj.js";
|
|
41
|
+
import "./lib.js";
|
|
42
|
+
import "himalaya";
|
|
43
|
+
import "@mhsdesign/jit-browser-tailwindcss";
|
|
44
|
+
import "@bobthered/tailwindcss-palette-generator";
|
|
45
|
+
import "@tailwindcss/forms";
|
|
46
|
+
import "@tailwindcss/typography";
|
|
47
|
+
import "@tailwindcss/aspect-ratio";
|
|
48
|
+
import "@tailwindcss/line-clamp";
|
|
49
|
+
import "@floating-ui/react-dom";
|
|
50
|
+
import "react-textarea-autosize";
|
|
18
51
|
import "flagged";
|
|
19
52
|
import "react-dnd";
|
|
20
|
-
import "lodash";
|
|
21
53
|
import "@minoru/react-dnd-treeview";
|
|
22
|
-
import "./skeleton-CU_FIbg3.js";
|
|
23
|
-
import "@radix-ui/react-slot";
|
|
24
|
-
import "class-variance-authority";
|
|
25
|
-
import "@radix-ui/react-tooltip";
|
|
26
|
-
import "@radix-ui/react-toast";
|
|
27
54
|
import "react-hotkeys-hook";
|
|
28
|
-
import "flat-to-nested";
|
|
29
|
-
import "./functions-pcUZhFJM.js";
|
|
30
|
-
import "redux-undo";
|
|
31
|
-
import "@react-hookz/web";
|
|
32
|
-
import "./index-ehKdBRUK.js";
|
|
33
55
|
import "sonner";
|
|
34
|
-
import "./html-to-json-pdHQfRkN.js";
|
|
35
|
-
import "himalaya";
|
|
36
56
|
import "lucide-react";
|
|
37
|
-
import
|
|
38
|
-
|
|
39
|
-
const P = o.lazy(() => import("./single-page-detail-pAxCy_Pe.js")), v = ({ pageData: r }) => {
|
|
40
|
-
const [t, s] = m("CLOSE");
|
|
57
|
+
const v = s.lazy(() => import("./single-page-detail-fV-A6vJR.js")), P = ({ pageData: r }) => {
|
|
58
|
+
const [t, i] = n("CLOSE");
|
|
41
59
|
return /* @__PURE__ */ e.jsxs(
|
|
42
60
|
g,
|
|
43
61
|
{
|
|
44
62
|
open: t === "OPEN" || t === "ALERT" || t === "PENDING",
|
|
45
|
-
onOpenChange: (
|
|
46
|
-
|
|
63
|
+
onOpenChange: (o) => {
|
|
64
|
+
i(t === "PENDING" ? "ALERT" : o ? "OPEN" : "CLOSE");
|
|
47
65
|
},
|
|
48
66
|
children: [
|
|
49
67
|
/* @__PURE__ */ e.jsx(
|
|
50
68
|
h,
|
|
51
69
|
{
|
|
52
70
|
asChild: !0,
|
|
53
|
-
onClick: (
|
|
54
|
-
|
|
71
|
+
onClick: (o) => {
|
|
72
|
+
o.stopPropagation(), i("OPEN");
|
|
55
73
|
},
|
|
56
|
-
children: /* @__PURE__ */ e.jsx("div", { className: "flex items-center justify-between", children: t === "OPEN" || t === "ALERT" || t === "PENDING" ? /* @__PURE__ */ e.jsx(
|
|
74
|
+
children: /* @__PURE__ */ e.jsx("div", { className: "flex items-center justify-between", children: t === "OPEN" || t === "ALERT" || t === "PENDING" ? /* @__PURE__ */ e.jsx(c, {}) : /* @__PURE__ */ e.jsx("div", { className: "hidden hover:text-blue-600 group-hover:flex", children: /* @__PURE__ */ e.jsx(u, {}) }) })
|
|
57
75
|
}
|
|
58
76
|
),
|
|
59
77
|
/* @__PURE__ */ e.jsx(f, { side: "right", align: "start", alignOffset: -35, className: "h-screen w-96", children: /* @__PURE__ */ e.jsx(
|
|
60
|
-
|
|
78
|
+
l,
|
|
61
79
|
{
|
|
62
80
|
fallback: /* @__PURE__ */ e.jsxs("div", { className: "flex w-full animate-pulse flex-col gap-y-3", children: [
|
|
63
81
|
/* @__PURE__ */ e.jsx("div", { className: "bg-background-300 h-6 w-1/2" }),
|
|
64
82
|
/* @__PURE__ */ e.jsx("div", { className: "bg-background-300 h-20 w-full" }),
|
|
65
83
|
/* @__PURE__ */ e.jsx("div", { className: "bg-background-300 h-20 w-full" })
|
|
66
84
|
] }),
|
|
67
|
-
children: /* @__PURE__ */ e.jsx(
|
|
85
|
+
children: /* @__PURE__ */ e.jsx(v, { pageData: r, open: t, setOpen: i })
|
|
68
86
|
}
|
|
69
87
|
) })
|
|
70
88
|
]
|
|
71
89
|
}
|
|
72
90
|
);
|
|
73
91
|
}, E = (r) => {
|
|
74
|
-
const [t] = j(), { data:
|
|
75
|
-
return
|
|
92
|
+
const [t] = j(), { data: i } = b(), o = N(), m = (i == null ? void 0 : i.homepage) === r.uuid, p = t === r.uuid, a = () => o(r);
|
|
93
|
+
return i ? /* @__PURE__ */ e.jsxs(
|
|
76
94
|
"button",
|
|
77
95
|
{
|
|
78
|
-
className: `group relative flex w-full cursor-pointer items-center justify-between px-2.5 py-2 ${
|
|
79
|
-
onClick:
|
|
96
|
+
className: `group relative flex w-full cursor-pointer items-center justify-between px-2.5 py-2 ${p ? "bg-blue-200 " : ""}`,
|
|
97
|
+
onClick: a,
|
|
80
98
|
type: "button",
|
|
81
99
|
children: [
|
|
82
100
|
/* @__PURE__ */ e.jsxs("div", { className: "flex text-sm items-center gap-x-1.5", children: [
|
|
83
|
-
|
|
101
|
+
m ? /* @__PURE__ */ e.jsx(d, {}) : /* @__PURE__ */ e.jsx(x, {}),
|
|
84
102
|
" ",
|
|
85
103
|
r.name
|
|
86
104
|
] }),
|
|
87
|
-
/* @__PURE__ */ e.jsx(
|
|
105
|
+
/* @__PURE__ */ e.jsx(P, { pageData: r })
|
|
88
106
|
]
|
|
89
107
|
}
|
|
90
108
|
) : null;
|
|
91
|
-
},
|
|
109
|
+
}, ke = ({ pages: r, isLoading: t }) => t ? /* @__PURE__ */ e.jsxs("div", { className: "flex animate-pulse flex-col gap-y-1 px-2.5 pt-2", children: [
|
|
92
110
|
/* @__PURE__ */ e.jsx("div", { className: "bg-background-200 h-7 w-full" }),
|
|
93
111
|
/* @__PURE__ */ e.jsx("div", { className: "bg-background-200 h-7 w-full" }),
|
|
94
112
|
/* @__PURE__ */ e.jsx("div", { className: "bg-background-200 h-7 w-full" })
|
|
95
|
-
] }) : r.length === 0 ? /* @__PURE__ */ e.jsx("div", { className: "px-2.5 pb-2 pt-4", children: "No pages" }) : /* @__PURE__ */ e.jsx("div", { className: "-mb-2", children:
|
|
113
|
+
] }) : r.length === 0 ? /* @__PURE__ */ e.jsx("div", { className: "px-2.5 pb-2 pt-4", children: "No pages" }) : /* @__PURE__ */ e.jsx("div", { className: "-mb-2", children: s.Children.toArray(r.map((i) => /* @__PURE__ */ e.jsx(E, { ...i }))) });
|
|
96
114
|
export {
|
|
97
|
-
|
|
115
|
+
ke as default
|
|
98
116
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const q=require("./jsx-runtime-WKRPbKtm.cjs"),a=require("react"),f=require("./index-c8zW_D2V.cjs"),n=require("./index-m2muA80V.cjs"),d=require("./form-Osm1AmO5.cjs"),m=require("./index-_jFEo7h5.cjs");require("./Class-RZuPYbUS.cjs");require("clsx");require("tailwind-merge");require("lodash");require("@radix-ui/react-toggle");require("class-variance-authority");require("@radix-ui/react-switch");require("@radix-ui/react-slot");require("@radix-ui/react-accordion");require("@radix-ui/react-icons");require("@radix-ui/react-alert-dialog");require("@radix-ui/react-dialog");require("@radix-ui/react-label");require("@radix-ui/react-scroll-area");require("@radix-ui/react-tabs");require("@radix-ui/react-tooltip");require("@radix-ui/react-popover");require("@radix-ui/react-menubar");require("@radix-ui/react-hover-card");require("@radix-ui/react-select");require("@radix-ui/react-dropdown-menu");require("@radix-ui/react-separator");require("@radix-ui/react-toast");require("cmdk");require("@radix-ui/react-context-menu");require("react-icons-picker");require("react-dom");require("react-quill");require("jotai");require("flat-to-nested");require("redux-undo");require("./index-fwo4wa7u.cjs");require("@react-hookz/web");require("react-i18next");require("./lib.cjs");require("himalaya");require("@mhsdesign/jit-browser-tailwindcss");require("@bobthered/tailwindcss-palette-generator");require("@tailwindcss/forms");require("@tailwindcss/typography");require("@tailwindcss/aspect-ratio");require("@tailwindcss/line-clamp");require("@rjsf/core");require("@rjsf/validator-ajv8");require("i18next");require("@floating-ui/react-dom");require("react-textarea-autosize");require("flagged");require("react-dnd");require("@minoru/react-dnd-treeview");require("react-hotkeys-hook");require("sonner");require("lucide-react");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),x=({_projectData:r,seany:i})=>{const{data:e,isLoading:u}=m.useProject();g.useEffect(()=>{e&&i(e)},[e,i]);const o=({formData:s},t)=>{i(l=>({...l,[t]:s[t]}))},c={name:n.u({title:"Project Name",default:e==null?void 0:e.name}),favicon:n.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:o})})};exports.default=x;
|
|
@@ -1,53 +1,63 @@
|
|
|
1
|
-
import { j as i } from "./jsx-runtime-
|
|
1
|
+
import { j as i } from "./jsx-runtime-qAwJ85SY.js";
|
|
2
2
|
import * as l from "react";
|
|
3
|
-
import {
|
|
4
|
-
import { u as c, o as u } from "./
|
|
5
|
-
import { F as d } from "./form-
|
|
6
|
-
import {
|
|
7
|
-
import "
|
|
8
|
-
import "./utils-dze1SGvB.js";
|
|
3
|
+
import { bp as n } from "./index-2EHcmZqL.js";
|
|
4
|
+
import { u as c, o as u } from "./index-RVm8Txnj.js";
|
|
5
|
+
import { F as d } from "./form-zZJyZuNH.js";
|
|
6
|
+
import { b as x } from "./index-cU5eyVRU.js";
|
|
7
|
+
import "./Class-nQk08vqd.js";
|
|
9
8
|
import "clsx";
|
|
10
9
|
import "tailwind-merge";
|
|
11
10
|
import "lodash";
|
|
12
|
-
import "@
|
|
13
|
-
import "
|
|
14
|
-
import "
|
|
15
|
-
import "react-
|
|
16
|
-
import "react-
|
|
17
|
-
import "./dialog-jrw9DF1f.js";
|
|
18
|
-
import "@radix-ui/react-dialog";
|
|
11
|
+
import "@radix-ui/react-toggle";
|
|
12
|
+
import "class-variance-authority";
|
|
13
|
+
import "@radix-ui/react-switch";
|
|
14
|
+
import "@radix-ui/react-slot";
|
|
15
|
+
import "@radix-ui/react-accordion";
|
|
19
16
|
import "@radix-ui/react-icons";
|
|
20
|
-
import "
|
|
21
|
-
import "
|
|
17
|
+
import "@radix-ui/react-alert-dialog";
|
|
18
|
+
import "@radix-ui/react-dialog";
|
|
19
|
+
import "@radix-ui/react-label";
|
|
20
|
+
import "@radix-ui/react-scroll-area";
|
|
22
21
|
import "@radix-ui/react-tabs";
|
|
23
|
-
import "react-quill";
|
|
24
|
-
import "react-i18next";
|
|
25
|
-
import "./skeleton-CU_FIbg3.js";
|
|
26
|
-
import "jotai";
|
|
27
|
-
import "@radix-ui/react-slot";
|
|
28
|
-
import "class-variance-authority";
|
|
29
22
|
import "@radix-ui/react-tooltip";
|
|
23
|
+
import "@radix-ui/react-popover";
|
|
24
|
+
import "@radix-ui/react-menubar";
|
|
25
|
+
import "@radix-ui/react-hover-card";
|
|
26
|
+
import "@radix-ui/react-select";
|
|
27
|
+
import "@radix-ui/react-dropdown-menu";
|
|
28
|
+
import "@radix-ui/react-separator";
|
|
30
29
|
import "@radix-ui/react-toast";
|
|
31
|
-
import "
|
|
32
|
-
import "
|
|
33
|
-
import "
|
|
30
|
+
import "cmdk";
|
|
31
|
+
import "@radix-ui/react-context-menu";
|
|
32
|
+
import "react-icons-picker";
|
|
33
|
+
import "react-dom";
|
|
34
|
+
import "react-quill";
|
|
35
|
+
import "jotai";
|
|
36
|
+
import "flat-to-nested";
|
|
37
|
+
import "redux-undo";
|
|
38
|
+
import "./index-gmZcUXyn.js";
|
|
39
|
+
import "@react-hookz/web";
|
|
40
|
+
import "react-i18next";
|
|
41
|
+
import "./lib.js";
|
|
42
|
+
import "himalaya";
|
|
43
|
+
import "@mhsdesign/jit-browser-tailwindcss";
|
|
44
|
+
import "@bobthered/tailwindcss-palette-generator";
|
|
45
|
+
import "@tailwindcss/forms";
|
|
46
|
+
import "@tailwindcss/typography";
|
|
47
|
+
import "@tailwindcss/aspect-ratio";
|
|
48
|
+
import "@tailwindcss/line-clamp";
|
|
49
|
+
import "@rjsf/core";
|
|
50
|
+
import "@rjsf/validator-ajv8";
|
|
34
51
|
import "i18next";
|
|
52
|
+
import "@floating-ui/react-dom";
|
|
53
|
+
import "react-textarea-autosize";
|
|
35
54
|
import "flagged";
|
|
36
55
|
import "react-dnd";
|
|
37
56
|
import "@minoru/react-dnd-treeview";
|
|
38
57
|
import "react-hotkeys-hook";
|
|
39
|
-
import "flat-to-nested";
|
|
40
|
-
import "./functions-pcUZhFJM.js";
|
|
41
|
-
import "redux-undo";
|
|
42
|
-
import "@react-hookz/web";
|
|
43
|
-
import "./index-ehKdBRUK.js";
|
|
44
58
|
import "sonner";
|
|
45
|
-
import "./html-to-json-pdHQfRkN.js";
|
|
46
|
-
import "himalaya";
|
|
47
59
|
import "lucide-react";
|
|
48
|
-
|
|
49
|
-
import "@radix-ui/react-alert-dialog";
|
|
50
|
-
const lo = ({
|
|
60
|
+
const vo = ({
|
|
51
61
|
_projectData: m,
|
|
52
62
|
seany: t
|
|
53
63
|
}) => {
|
|
@@ -70,5 +80,5 @@ const lo = ({
|
|
|
70
80
|
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 }) });
|
|
71
81
|
};
|
|
72
82
|
export {
|
|
73
|
-
|
|
83
|
+
vo as default
|
|
74
84
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("./jsx-runtime-WKRPbKtm.cjs"),i=require("./index-m2muA80V.cjs"),g=require("./form-Osm1AmO5.cjs");require("./Class-RZuPYbUS.cjs");require("clsx");require("tailwind-merge");require("lodash");require("react");require("@radix-ui/react-icons");require("./index-fwo4wa7u.cjs");require("./lib.cjs");require("himalaya");require("@mhsdesign/jit-browser-tailwindcss");require("@bobthered/tailwindcss-palette-generator");require("@tailwindcss/forms");require("@tailwindcss/typography");require("@tailwindcss/aspect-ratio");require("@tailwindcss/line-clamp");require("@rjsf/core");require("@rjsf/validator-ajv8");require("./index-c8zW_D2V.cjs");require("@radix-ui/react-toggle");require("class-variance-authority");require("@radix-ui/react-switch");require("@radix-ui/react-slot");require("@radix-ui/react-accordion");require("@radix-ui/react-alert-dialog");require("@radix-ui/react-dialog");require("@radix-ui/react-label");require("@radix-ui/react-scroll-area");require("@radix-ui/react-tabs");require("@radix-ui/react-tooltip");require("@radix-ui/react-popover");require("@radix-ui/react-menubar");require("@radix-ui/react-hover-card");require("@radix-ui/react-select");require("@radix-ui/react-dropdown-menu");require("@radix-ui/react-separator");require("@radix-ui/react-toast");require("cmdk");require("@radix-ui/react-context-menu");require("react-icons-picker");require("react-dom");require("react-quill");require("jotai");require("flat-to-nested");require("redux-undo");require("@react-hookz/web");require("react-i18next");const D=({_projectData:e,seany:n})=>{var u,t,q,o,s,a;const d=({formData:m})=>{const r={...m};r.seoData.title===void 0&&(r.seoData.title=""),r.seoData.description===void 0&&(r.seoData.description=""),r.seoData.image===void 0&&(r.seoData.image=""),n(c=>({...c,...r}))},f={seoData:i.b({title:"",default:{title:((u=e.seoData)==null?void 0:u.title)||"",description:((t=e.seoData)==null?void 0:t.description)||"",image:((q=e.seoData)==null?void 0:q.image)||""},properties:{title:i.u({title:"Default Title",default:((o=e.seoData)==null?void 0:o.title)||""}),description:i.g({title:"Default Description",default:((s=e.seoData)==null?void 0:s.description)||""}),image:i.o({title:"Social Media Image",default:((a=e.seoData)==null?void 0:a.image)||""})}})};return l.jsxRuntimeExports.jsx("div",{className:"flex h-full select-none flex-col",children:l.jsxRuntimeExports.jsx(g.Form,{properties:f,formData:e,onChange:d})})};exports.default=D;
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { j as s } from "./jsx-runtime-qAwJ85SY.js";
|
|
2
|
+
import { b as D, u as c, g, o as x } from "./index-RVm8Txnj.js";
|
|
3
|
+
import { F as v } from "./form-zZJyZuNH.js";
|
|
4
|
+
import "./Class-nQk08vqd.js";
|
|
5
|
+
import "clsx";
|
|
6
|
+
import "tailwind-merge";
|
|
7
|
+
import "lodash";
|
|
8
|
+
import "react";
|
|
9
|
+
import "@radix-ui/react-icons";
|
|
10
|
+
import "./index-gmZcUXyn.js";
|
|
11
|
+
import "./lib.js";
|
|
12
|
+
import "himalaya";
|
|
13
|
+
import "@mhsdesign/jit-browser-tailwindcss";
|
|
14
|
+
import "@bobthered/tailwindcss-palette-generator";
|
|
15
|
+
import "@tailwindcss/forms";
|
|
16
|
+
import "@tailwindcss/typography";
|
|
17
|
+
import "@tailwindcss/aspect-ratio";
|
|
18
|
+
import "@tailwindcss/line-clamp";
|
|
19
|
+
import "@rjsf/core";
|
|
20
|
+
import "@rjsf/validator-ajv8";
|
|
21
|
+
import "./index-2EHcmZqL.js";
|
|
22
|
+
import "@radix-ui/react-toggle";
|
|
23
|
+
import "class-variance-authority";
|
|
24
|
+
import "@radix-ui/react-switch";
|
|
25
|
+
import "@radix-ui/react-slot";
|
|
26
|
+
import "@radix-ui/react-accordion";
|
|
27
|
+
import "@radix-ui/react-alert-dialog";
|
|
28
|
+
import "@radix-ui/react-dialog";
|
|
29
|
+
import "@radix-ui/react-label";
|
|
30
|
+
import "@radix-ui/react-scroll-area";
|
|
31
|
+
import "@radix-ui/react-tabs";
|
|
32
|
+
import "@radix-ui/react-tooltip";
|
|
33
|
+
import "@radix-ui/react-popover";
|
|
34
|
+
import "@radix-ui/react-menubar";
|
|
35
|
+
import "@radix-ui/react-hover-card";
|
|
36
|
+
import "@radix-ui/react-select";
|
|
37
|
+
import "@radix-ui/react-dropdown-menu";
|
|
38
|
+
import "@radix-ui/react-separator";
|
|
39
|
+
import "@radix-ui/react-toast";
|
|
40
|
+
import "cmdk";
|
|
41
|
+
import "@radix-ui/react-context-menu";
|
|
42
|
+
import "react-icons-picker";
|
|
43
|
+
import "react-dom";
|
|
44
|
+
import "react-quill";
|
|
45
|
+
import "jotai";
|
|
46
|
+
import "flat-to-nested";
|
|
47
|
+
import "redux-undo";
|
|
48
|
+
import "@react-hookz/web";
|
|
49
|
+
import "react-i18next";
|
|
50
|
+
const Dt = ({
|
|
51
|
+
_projectData: t,
|
|
52
|
+
seany: l
|
|
53
|
+
}) => {
|
|
54
|
+
var o, r, m, e, p, a;
|
|
55
|
+
const n = ({ formData: f }) => {
|
|
56
|
+
const i = { ...f };
|
|
57
|
+
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) => ({
|
|
58
|
+
...u,
|
|
59
|
+
...i
|
|
60
|
+
}));
|
|
61
|
+
}, d = {
|
|
62
|
+
seoData: D({
|
|
63
|
+
title: "",
|
|
64
|
+
default: {
|
|
65
|
+
title: ((o = t.seoData) == null ? void 0 : o.title) || "",
|
|
66
|
+
description: ((r = t.seoData) == null ? void 0 : r.description) || "",
|
|
67
|
+
image: ((m = t.seoData) == null ? void 0 : m.image) || ""
|
|
68
|
+
},
|
|
69
|
+
properties: {
|
|
70
|
+
title: c({
|
|
71
|
+
title: "Default Title",
|
|
72
|
+
default: ((e = t.seoData) == null ? void 0 : e.title) || ""
|
|
73
|
+
}),
|
|
74
|
+
description: g({
|
|
75
|
+
title: "Default Description",
|
|
76
|
+
default: ((p = t.seoData) == null ? void 0 : p.description) || ""
|
|
77
|
+
}),
|
|
78
|
+
image: x({
|
|
79
|
+
title: "Social Media Image",
|
|
80
|
+
default: ((a = t.seoData) == null ? void 0 : a.image) || ""
|
|
81
|
+
})
|
|
82
|
+
}
|
|
83
|
+
})
|
|
84
|
+
};
|
|
85
|
+
return /* @__PURE__ */ s.jsx("div", { className: "flex h-full select-none flex-col", children: /* @__PURE__ */ s.jsx(v, { properties: d, formData: t, onChange: n }) });
|
|
86
|
+
};
|
|
87
|
+
export {
|
|
88
|
+
Dt as default
|
|
89
|
+
};
|
package/dist/render.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("./index-m2muA80V.cjs");const u=require("./jsx-runtime-WKRPbKtm.cjs"),x=require("react"),s=require("lodash"),S=require("tailwind-merge"),l=require("./Class-RZuPYbUS.cjs"),R=require("./index-fwo4wa7u.cjs"),j=require("./lib.cjs"),_=require("react-wrap-balancer");require("@radix-ui/react-icons");require("clsx");require("himalaya");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 n={};return Object.keys(e).forEach(t=>{s.isString(e[t])&&e[t].startsWith(l.SLOT_KEY)&&(n[t]=e[t].replace(l.SLOT_KEY,"").split(","))}),n},C=s.memoize((e,n)=>{const t=e.replace(l.STYLES_KEY,"").split(","),r=S.twMerge(t[0],t[1]);return j.addPrefixToClasses(r,n).replace(l.STYLES_KEY,"").trim()});function B(e,n){return s.get(e,`${n}_attrs`,{})}function O(e,n){const t={};return Object.keys(e).forEach(r=>{if(s.isString(e[r])&&e[r].startsWith(l.STYLES_KEY)){const o=C(e[r],n);t[r]={className:o,...B(e,r)}}}),t}function T(e,n){const t=s.get(e,"_bindings",{});return s.isEmpty(t)?{...e}:(s.each(t,(r,o)=>{s.isString(r)&&s.get(n,r,null)&&(e[o]=s.get(n,r,null))}),e)}function a({blocks:e,parent:n,classPrefix:t="c-",externalData:r={}}){const o=e,p=i=>O(i,t),h=n?s.filter(e,{_parent:n}):s.filter(e,i=>s.isEmpty(i._parent));return u.jsxRuntimeExports.jsx(u.jsxRuntimeExports.Fragment,{children:x.Children.toArray(h.map((i,f)=>{const d=y(i),m={};s.isEmpty(d)||Object.keys(d).forEach(c=>{m[c]=x.Children.toArray(d[c].map(E=>u.jsxRuntimeExports.jsx(a,{externalData:r,classPrefix:t,blocks:o,parent:E})))});const q=s.filter(o,{_parent:i._id});m.children=q.length>0?u.jsxRuntimeExports.jsx(a,{externalData:r,classPrefix:t,parent:i._id,blocks:o}):null;const g=R.h(i._type);if(g!==null){let c=i;const E=g.component;return c={...g.defaults,...i},x.createElement(E,s.omit({blockProps:{},inBuilder:!1,...c,index:f,...T(i,r),...p(c),...m},["_parent"]))}return u.jsxRuntimeExports.jsxs("noscript",{children:[i._type," not found"]})}))})}const Y=({pageData:e,externalData:n={},before:t=null,after:r=null,classPrefix:o="c-"})=>{const p=s.get(e.project,"brandingOptions",l.BRANDING_OPTIONS_DEFAULTS);return u.jsxRuntimeExports.jsxs(u.jsxRuntimeExports.Fragment,{children:[t,u.jsxRuntimeExports.jsx("div",{className:o.replace("-","")+" "+j.getBrandingClasses(p,o)+" min-h-screen",children:u.jsxRuntimeExports.jsx(_.Provider,{children:u.jsxRuntimeExports.jsx(a,{externalData:n,blocks:e.page.blocks||[],classPrefix:o})})}),r]})};exports.RenderChaiBlocks=a;exports.RenderChaiPage=Y;
|
package/dist/render.js
CHANGED
|
@@ -1,11 +1,15 @@
|
|
|
1
|
-
import
|
|
1
|
+
import "./index-RVm8Txnj.js";
|
|
2
|
+
import { j as o } from "./jsx-runtime-qAwJ85SY.js";
|
|
2
3
|
import u from "react";
|
|
3
|
-
import { memoize as y,
|
|
4
|
+
import { isString as E, memoize as y, get as m, isEmpty as h, each as A, filter as g, omit as x } from "lodash";
|
|
4
5
|
import { twMerge as N } from "tailwind-merge";
|
|
5
|
-
import { S
|
|
6
|
-
import { h as T } from "./index-
|
|
7
|
-
import {
|
|
6
|
+
import { S, a as _, B as R } from "./Class-nQk08vqd.js";
|
|
7
|
+
import { h as T } from "./index-gmZcUXyn.js";
|
|
8
|
+
import { addPrefixToClasses as F, getBrandingClasses as L } from "./lib.js";
|
|
8
9
|
import { Provider as Y } from "react-wrap-balancer";
|
|
10
|
+
import "@radix-ui/react-icons";
|
|
11
|
+
import "clsx";
|
|
12
|
+
import "himalaya";
|
|
9
13
|
import "@mhsdesign/jit-browser-tailwindcss";
|
|
10
14
|
import "@bobthered/tailwindcss-palette-generator";
|
|
11
15
|
import "@tailwindcss/forms";
|
|
@@ -22,7 +26,7 @@ const I = (t) => {
|
|
|
22
26
|
return F(n, s).replace(_, "").trim();
|
|
23
27
|
});
|
|
24
28
|
function W(t, s) {
|
|
25
|
-
return
|
|
29
|
+
return m(t, `${s}_attrs`, {});
|
|
26
30
|
}
|
|
27
31
|
function w(t, s) {
|
|
28
32
|
const r = {};
|
|
@@ -37,9 +41,9 @@ function w(t, s) {
|
|
|
37
41
|
}), r;
|
|
38
42
|
}
|
|
39
43
|
function z(t, s) {
|
|
40
|
-
const r =
|
|
41
|
-
return h(r) ? { ...t } : (
|
|
42
|
-
E(n) &&
|
|
44
|
+
const r = m(t, "_bindings", {});
|
|
45
|
+
return h(r) ? { ...t } : (A(r, (n, i) => {
|
|
46
|
+
E(n) && m(s, n, null) && (t[i] = m(s, n, null));
|
|
43
47
|
}), t);
|
|
44
48
|
}
|
|
45
49
|
function j({
|
|
@@ -48,13 +52,13 @@ function j({
|
|
|
48
52
|
classPrefix: r = "c-",
|
|
49
53
|
externalData: n = {}
|
|
50
54
|
}) {
|
|
51
|
-
const i = t,
|
|
55
|
+
const i = t, c = (e) => w(e, r), B = s ? g(t, { _parent: s }) : g(t, (e) => h(e._parent));
|
|
52
56
|
return /* @__PURE__ */ o.jsx(o.Fragment, { children: u.Children.toArray(
|
|
53
57
|
B.map((e, C) => {
|
|
54
|
-
const
|
|
55
|
-
h(
|
|
58
|
+
const a = I(e), l = {};
|
|
59
|
+
h(a) || Object.keys(a).forEach((p) => {
|
|
56
60
|
l[p] = u.Children.toArray(
|
|
57
|
-
|
|
61
|
+
a[p].map((f) => /* @__PURE__ */ o.jsx(
|
|
58
62
|
j,
|
|
59
63
|
{
|
|
60
64
|
externalData: n,
|
|
@@ -81,14 +85,14 @@ function j({
|
|
|
81
85
|
const f = d.component;
|
|
82
86
|
return p = { ...d.defaults, ...e }, u.createElement(
|
|
83
87
|
f,
|
|
84
|
-
|
|
88
|
+
x(
|
|
85
89
|
{
|
|
86
90
|
blockProps: {},
|
|
87
91
|
inBuilder: !1,
|
|
88
92
|
...p,
|
|
89
93
|
index: C,
|
|
90
94
|
...z(e, n),
|
|
91
|
-
...
|
|
95
|
+
...c(p),
|
|
92
96
|
...l
|
|
93
97
|
},
|
|
94
98
|
["_parent"]
|
|
@@ -102,20 +106,20 @@ function j({
|
|
|
102
106
|
})
|
|
103
107
|
) });
|
|
104
108
|
}
|
|
105
|
-
const
|
|
109
|
+
const nt = ({
|
|
106
110
|
pageData: t,
|
|
107
111
|
externalData: s = {},
|
|
108
112
|
before: r = null,
|
|
109
113
|
after: n = null,
|
|
110
114
|
classPrefix: i = "c-"
|
|
111
115
|
}) => {
|
|
112
|
-
const
|
|
116
|
+
const c = m(t.project, "brandingOptions", R);
|
|
113
117
|
return /* @__PURE__ */ o.jsxs(o.Fragment, { children: [
|
|
114
118
|
r,
|
|
115
119
|
/* @__PURE__ */ o.jsx(
|
|
116
120
|
"div",
|
|
117
121
|
{
|
|
118
|
-
className: i.replace("-", "") + " " + L(
|
|
122
|
+
className: i.replace("-", "") + " " + L(c, i) + " min-h-screen",
|
|
119
123
|
children: /* @__PURE__ */ o.jsx(Y, { children: /* @__PURE__ */ o.jsx(j, { externalData: s, blocks: t.page.blocks || [], classPrefix: i }) })
|
|
120
124
|
}
|
|
121
125
|
),
|
|
@@ -124,5 +128,5 @@ const b = ({
|
|
|
124
128
|
};
|
|
125
129
|
export {
|
|
126
130
|
j as RenderChaiBlocks,
|
|
127
|
-
|
|
131
|
+
nt as RenderChaiPage
|
|
128
132
|
};
|
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("./index-
|
|
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-fwo4wa7u.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.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 { A as m } from "./index-
|
|
5
|
+
import { A as m } from "./index-gmZcUXyn.js";
|
|
6
6
|
const d = "https://api.chaibuilder.com";
|
|
7
7
|
class A {
|
|
8
8
|
constructor(t, e) {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./jsx-runtime-WKRPbKtm.cjs"),f=require("react"),c=require("lodash"),H=require("@radix-ui/react-icons"),y=require("./index-c8zW_D2V.cjs"),d=require("./index-m2muA80V.cjs"),w=require("sonner"),p=require("./form-Osm1AmO5.cjs"),P=require("./index-_jFEo7h5.cjs");require("./Class-RZuPYbUS.cjs");require("clsx");require("tailwind-merge");require("@radix-ui/react-toggle");require("class-variance-authority");require("@radix-ui/react-switch");require("@radix-ui/react-slot");require("@radix-ui/react-accordion");require("@radix-ui/react-alert-dialog");require("@radix-ui/react-dialog");require("@radix-ui/react-label");require("@radix-ui/react-scroll-area");require("@radix-ui/react-tabs");require("@radix-ui/react-tooltip");require("@radix-ui/react-popover");require("@radix-ui/react-menubar");require("@radix-ui/react-hover-card");require("@radix-ui/react-select");require("@radix-ui/react-dropdown-menu");require("@radix-ui/react-separator");require("@radix-ui/react-toast");require("cmdk");require("@radix-ui/react-context-menu");require("react-icons-picker");require("react-dom");require("react-quill");require("jotai");require("flat-to-nested");require("redux-undo");require("./index-fwo4wa7u.cjs");require("@react-hookz/web");require("react-i18next");require("./lib.cjs");require("himalaya");require("@mhsdesign/jit-browser-tailwindcss");require("@bobthered/tailwindcss-palette-generator");require("@tailwindcss/forms");require("@tailwindcss/typography");require("@tailwindcss/aspect-ratio");require("@tailwindcss/line-clamp");require("@rjsf/core");require("@rjsf/validator-ajv8");require("i18next");require("@floating-ui/react-dom");require("react-textarea-autosize");require("flagged");require("react-dnd");require("@minoru/react-dnd-treeview");require("react-hotkeys-hook");require("lucide-react");const z=f.lazy(()=>Promise.resolve().then(()=>require("./delete-page-modal-5XuSfQT0.cjs"))),L=f.lazy(()=>Promise.resolve().then(()=>require("./confirm-alert-z74-fGOT.cjs"))),E=u=>{if(!c.isString(u)||!(u.includes("/[")&&u.includes("]")))return!1;const s=/^\[((?:\.{3})?[a-zA-Z0-9_-]+)\]$/,q=/^[a-zA-Z0-9_-]+$/;let e=!0;return u.split("/").forEach(n=>{e&&(n.includes("[[")&&n.includes("]]")?e=/^\[\[\.{3}[a-zA-Z0-9_-]+\]\]$/.test(n):n.includes("[")&&n.includes("]")?e=s.test(n):e=q.test(n))}),e},h=u=>u&&c.isEmpty(u.seoData)?{...u,seoData:{title:"",description:"",image:""}}:u,G=(u,o)=>{const s=!c.isEqual(c.omit(u,["seoData"]),c.omit(o,["seoData"])),q=!c.isEqual(h(o).seoData,h(u).seoData);return s||q},Y=({open:u,setOpen:o,pageData:s})=>{const q=P.useQueryClient(),{data:e}=P.useProject(),n=P.useUpdatePage(),m=P.useUpdateProject("Homepage updated successfully."),[i,b]=f.useState(h(s)),[a,A]=f.useState({isHomePage:(e==null?void 0:e.homepage)===s.uuid}),j=G(i,s);f.useEffect(()=>{const l=!c.isEqual(h(s),i),t=(e==null?void 0:e.homepage)!==s.uuid&&a.isHomePage;o(l||t?"PENDING":"OPEN")},[e,s,i,a,o]);const C=()=>{if(j){if(s.type==="DYNAMIC"&&!E((i==null?void 0:i.slug)||"")){u==="ALERT"&&o("PENDING");return}n.mutate(i,{onSuccess:()=>{q.invalidateQueries({refetchType:"active",queryKey:["pages",e==null?void 0:e.uuid]}),o("CLOSE"),w.toast.success("Page updated successfully.")}})}a.isHomePage&&(e==null?void 0:e.homepage)!==s.uuid&&m.mutate({...e,homepage:s==null?void 0:s.uuid},{onSuccess:()=>o("CLOSE")})},R=({formData:l},t)=>{b(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}})},I=({formData:l},t)=>{A(g=>{const x={[t]:l[t]};return{...g,...x}})},v={name:d.u({title:"Page Name",default:i.name}),slug:d.u({title:"Page Slug",default:i.slug})},T={seoData:d.b({title:"",description:"",default:{title:"",description:"",image:""},properties:{title:d.u({title:"Meta Title",default:i.name}),description:d.g({title:"Meta Description",default:i.slug}),image:d.o({title:"Social Media Image",default:""})}})},M={isHomePage:d.r({title:"Set as homepage",default:a.isHomePage})};return r.jsxRuntimeExports.jsxs(y.ScrollArea,{className:"flex h-full select-none flex-col",children:[r.jsxRuntimeExports.jsx(L,{open:u==="ALERT",title:"Do yo want to save changes?",onCancel:()=>o("CLOSE"),onConfirm:C,disabled:m.isPending||n.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:i,properties:v,onChange:R,disabled:n.isPending||m.isPending}),r.jsxRuntimeExports.jsx("div",{className:"h-2 w-full"}),r.jsxRuntimeExports.jsx(p.Form,{title:"SEO Details",formData:i,properties:T,onChange:R,disabled:n.isPending||m.isPending}),(e==null?void 0:e.homepage)!==s.uuid&&s.type==="STATIC"?r.jsxRuntimeExports.jsx(p.Form,{formData:a,properties:M,onChange:I,disabled:n.isPending||m.isPending}):s.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(H.HomeIcon,{})," This is homepage"," "]}),i.type==="DYNAMIC"&&!E((i==null?void 0:i.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(y.Button,{className:"w-full",type:"submit",onClick:C,disabled:(e==null?void 0:e.homepage)!==s.uuid&&a.isHomePage?!1:c.isEmpty(i.name)||c.isEmpty(i.slug)||!j||n.isPending||m.isPending||i.type==="DYNAMIC"&&!E((i==null?void 0:i.slug)||""),children:"Save"}),r.jsxRuntimeExports.jsx(z,{pageData:s,projectData:e})]})]})})]})};exports.default=Y;
|