@chaibuilder/sdk 1.0.9 → 1.0.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +28 -0
- package/README.md +123 -21
- package/dist/AddBlocks-tdvDe7xL.cjs +3 -0
- package/dist/{AddBlocks-d10b7b87.js → AddBlocks-xR2s2BVa.js} +47 -44
- package/dist/BrandingOptions-DpJ-oNnf.cjs +1 -0
- package/dist/{BrandingOptions-f4ab5d9f.js → BrandingOptions-cHK2bVZy.js} +14 -18
- package/dist/{CanvasArea-10356200.js → CanvasArea-2zqT1lSE.js} +492 -503
- package/dist/CanvasArea-Br8bBSeT.cjs +46 -0
- package/dist/ChaiBuilderEditor-SacH75l4.cjs +163 -0
- package/dist/{index-aa42febc.js → ChaiBuilderEditor-h9bXC4l-.js} +11215 -15404
- package/dist/Class-_uCzl5v1.cjs +1 -0
- package/dist/{html-to-json-45e0e3b5.js → Class-l7qYbuoN.js} +185 -366
- package/dist/{CurrentPage-35e14043.js → CurrentPage-4lTETR2f.js} +26 -23
- package/dist/CurrentPage-nlUWJiUA.cjs +1 -0
- package/dist/{ImagesPanel-8b7a989d.cjs → ImagesPanel-6us7hiLN.cjs} +1 -1
- package/dist/{ImagesPanel-47ac13c3.js → ImagesPanel-oaHOD-Ex.js} +4 -4
- package/dist/Layers-Vw4XE6YB.cjs +1 -0
- package/dist/{Layers-c3dd4fc8.js → Layers-wOfijZnb.js} +42 -41
- package/dist/MarkAsGlobalBlock-1J_YyL1L.cjs +1 -0
- package/dist/{MarkAsGlobalBlock-505ae793.js → MarkAsGlobalBlock-xRyn29gC.js} +17 -20
- package/dist/{PagesPanel-bafc506f.js → PagesPanel-82gCVzHS.js} +16 -13
- package/dist/PagesPanel-ZKRdK-mI.cjs +1 -0
- package/dist/ProjectPanel-kYg4KkJu.cjs +1 -0
- package/dist/{ProjectPanel-6113f394.js → ProjectPanel-vz5WOyqZ.js} +22 -19
- package/dist/Settings-1E3Y_5r6.cjs +1 -0
- package/dist/{Settings-1c41c514.js → Settings-IuAF359L.js} +297 -296
- package/dist/SidePanels-WL1UioF2.cjs +1 -0
- package/dist/{SidePanels-c13f87dc.js → SidePanels-xssTWt4M.js} +34 -42
- package/dist/Topbar-3ozdWfSy.cjs +1 -0
- package/dist/{Topbar-b38d5d50.js → Topbar-H0f0EL6-.js} +33 -35
- package/dist/UnsplashImages-BoBBSi1a.cjs +1 -0
- package/dist/{UnsplashImages-4edb97e7.js → UnsplashImages-gPcBLjgB.js} +13 -14
- package/dist/UploadImages-T6kW0s3G.cjs +1 -0
- package/dist/{UploadImages-52181c3e.js → UploadImages-_ZyUU66E.js} +11 -12
- package/dist/{accordion-c0176dc5.js → accordion-oPUeqPCZ.js} +2 -2
- package/dist/{accordion-0afd8143.cjs → accordion-ynvFtV_p.cjs} +1 -1
- package/dist/{add-page-modal-08a19915.js → add-page-modal-J1E7rh1U.js} +25 -22
- package/dist/add-page-modal-eiiUZCJX.cjs +1 -0
- package/dist/alert-dialog-GNfnpqFB.js +64 -0
- package/dist/alert-dialog-Mv0-wAvS.cjs +1 -0
- package/dist/{command-b1103666.cjs → command-ThdTuUxt.cjs} +1 -1
- package/dist/{command-6f260f61.js → command-VHca6CcN.js} +3 -3
- package/dist/confirm-alert-8EHe0OOd.cjs +1 -0
- package/dist/confirm-alert-b0e_BLhF.js +36 -0
- package/dist/{context-menu-e1c240ce.js → context-menu-8dC9uGXj.js} +2 -2
- package/dist/{context-menu-fec580f2.cjs → context-menu-IgLbIuth.cjs} +1 -1
- package/dist/controls-Ni5kEzLz.js +103 -0
- package/dist/controls-xUKa23ic.cjs +1 -0
- package/dist/core.cjs +1 -1
- package/dist/core.d.ts +1 -10
- package/dist/core.js +116 -69
- package/dist/delete-page-modal-TGTmRjyn.cjs +1 -0
- package/dist/{delete-page-modal-9b37665b.js → delete-page-modal-ysj4O0bM.js} +25 -22
- package/dist/{dialog-170eaad9.cjs → dialog-S_QbL1iq.cjs} +1 -1
- package/dist/{dialog-18207bef.js → dialog-jrw9DF1f.js} +2 -2
- package/dist/{dropdown-menu-ae3ed09b.js → dropdown-menu-S03K_fNs.js} +2 -2
- package/dist/{dropdown-menu-84b2439e.cjs → dropdown-menu-sMXR59cB.cjs} +1 -1
- package/dist/{form-25e1af37.js → form-dVpOAyRl.js} +2 -2
- package/dist/{form-ea21db6c.cjs → form-nRAvKPQj.cjs} +1 -1
- package/dist/{functions-83b1de8d.js → functions-nNTuSTsR.js} +1 -1
- package/dist/functions-pcUZhFJM.js +12 -0
- package/dist/{functions-f84d5e2a.cjs → functions-sCuB7nvZ.cjs} +1 -1
- package/dist/functions-uw7QP2kT.cjs +1 -0
- package/dist/html-to-json-P6GpbcQX.cjs +1 -0
- package/dist/html-to-json-pdHQfRkN.js +178 -0
- package/dist/index-8L3zCc6V.cjs +1 -0
- package/dist/index-cZ4uo6aT.js +2256 -0
- package/dist/{label-e770a087.js → label-KaP7MRrs.js} +2 -2
- package/dist/{label-167415e5.cjs → label-tFm8HZdb.cjs} +1 -1
- package/dist/lib.cjs +1 -1
- package/dist/lib.d.ts +20 -13
- package/dist/lib.js +24 -23
- package/dist/{link-57de608a.js → link-6o6n2Tnd.js} +4 -4
- package/dist/link-ece8dZGH.cjs +1 -0
- package/dist/{page-viewer-5c733179.js → page-viewer-84Giu0Rs.js} +29 -26
- package/dist/page-viewer-OdVEG83P.cjs +1 -0
- package/dist/{popover-f7addcf4.js → popover-a84pbVhQ.js} +2 -2
- package/dist/{popover-7cb9079b.cjs → popover-fKjgcRUx.cjs} +1 -1
- package/dist/{project-general-setting-d9736056.js → project-general-setting-8OEVVxzn.js} +20 -17
- package/dist/project-general-setting-laHNQPW5.cjs +1 -0
- package/dist/{project-seo-setting-d81fc1e3.js → project-seo-setting-9kD_stdI.js} +11 -12
- package/dist/project-seo-setting-F3Opt9Uj.cjs +1 -0
- package/dist/render.cjs +1 -1
- package/dist/render.d.ts +7 -7
- package/dist/render.js +3 -3
- package/dist/{scroll-area-bb343b86.cjs → scroll-area-FiHvy-TZ.cjs} +1 -1
- package/dist/{scroll-area-83bd9e8f.js → scroll-area-ewXbxc3n.js} +2 -2
- package/dist/{select-0e32300c.cjs → select-7bjg-rr9.cjs} +1 -1
- package/dist/{select-7fddd7c3.js → select-POGdEDHT.js} +2 -2
- package/dist/{separator-a597dba7.cjs → separator-3Civ-6hb.cjs} +1 -1
- package/dist/{separator-a80d065b.js → separator-SctTn0Qi.js} +2 -2
- package/dist/server.d.ts +7 -10
- package/dist/server.js +0 -3
- package/dist/single-page-detail-X0TGlsT4.cjs +1 -0
- package/dist/{single-page-detail-04410e64.js → single-page-detail-iXpavDy8.js} +32 -29
- package/dist/skeleton-CU_FIbg3.js +239 -0
- package/dist/skeleton-JHP9zwL2.cjs +1 -0
- package/dist/studio.cjs +1 -0
- package/dist/studio.d.ts +13 -0
- package/dist/studio.js +39 -0
- package/dist/{tabs-85caa1e8.js → tabs-Gb9v5dVb.js} +2 -2
- package/dist/{tabs-860e37aa.cjs → tabs-iWeaaVrg.cjs} +1 -1
- package/dist/{textarea-a338ede6.cjs → textarea-1kZEh7ki.cjs} +1 -1
- package/dist/{textarea-0750bcd2.js → textarea-b2QvVhrK.js} +2 -2
- package/dist/{toggle-00c9d11e.js → toggle-ASJRAaGP.js} +2 -2
- package/dist/{toggle-b90fed97.cjs → toggle-ehNIPmme.cjs} +1 -1
- package/dist/ui.cjs +1 -1
- package/dist/ui.d.ts +69 -4
- package/dist/ui.js +272 -212
- package/dist/useAddBlock-1cMXaOVk.cjs +1 -0
- package/dist/useAddBlock-BOjrGBEO.js +86 -0
- package/dist/useAllBlocks-RU_Xw8j9.cjs +1 -0
- package/dist/useAllBlocks-lX6uVO39.js +20 -0
- package/dist/useChaiExternalData-4K9WxANa.js +6 -0
- package/dist/useChaiExternalData-DkyBJ81C.cjs +1 -0
- package/dist/useDarkMode-JWkrNFpH.js +23 -0
- package/dist/useDarkMode-zeTW_UUR.cjs +1 -0
- package/dist/useFeatureSupport-jWSuY7wk.js +16 -0
- package/dist/useFeatureSupport-tZ0QfBxp.cjs +1 -0
- package/dist/useHiddenBlocks-3MsGOJ1s.js +15 -0
- package/dist/useHiddenBlocks-oJuQDmTy.cjs +1 -0
- package/dist/useLanguage-O1uu2Bzu.js +216 -0
- package/dist/useLanguage-Y3qgAbgG.cjs +1 -0
- package/dist/useMarkAsGlobalBlock-DB5B1UP6.js +25 -0
- package/dist/useMarkAsGlobalBlock-toxRSLc_.cjs +1 -0
- package/dist/useUiLibraries-4hPOi8DI.js +12 -0
- package/dist/useUiLibraries-9FhQCpKo.cjs +1 -0
- package/package.json +19 -5
- package/dist/AddBlocks-76275943.cjs +0 -3
- package/dist/BrandingOptions-d3b3309a.cjs +0 -1
- package/dist/CanvasArea-9f94cd28.cjs +0 -46
- package/dist/CurrentPage-edb509db.cjs +0 -1
- package/dist/Layers-ecba52c1.cjs +0 -1
- package/dist/MarkAsGlobalBlock-3a06a159.cjs +0 -1
- package/dist/PagesPanel-f4329082.cjs +0 -1
- package/dist/ProjectPanel-ce3116d3.cjs +0 -1
- package/dist/Settings-b6a2bef6.cjs +0 -1
- package/dist/SidePanels-2cc72c0b.cjs +0 -1
- package/dist/Topbar-3b9db9f3.cjs +0 -1
- package/dist/UnsplashImages-98c085c2.cjs +0 -1
- package/dist/UploadImages-61ef83ad.cjs +0 -1
- package/dist/add-page-modal-7f9ff733.cjs +0 -1
- package/dist/confirm-alert-c1fdf1e4.js +0 -35
- package/dist/confirm-alert-e1ea5110.cjs +0 -1
- package/dist/delete-page-modal-7066b01f.cjs +0 -1
- package/dist/html-to-json-aadcbf66.cjs +0 -1
- package/dist/index-c535cc95.cjs +0 -164
- package/dist/link-24679521.cjs +0 -1
- package/dist/page-viewer-da99c71e.cjs +0 -1
- package/dist/project-general-setting-90f8416d.cjs +0 -1
- package/dist/project-seo-setting-6eef8387.cjs +0 -1
- package/dist/single-page-detail-90f49d7a.cjs +0 -1
- package/dist/useBuilderProp-21feb2da.js +0 -296
- package/dist/useBuilderProp-adacf42f.cjs +0 -1
- package/dist/useChaiExternalData-192c7896.js +0 -5
- package/dist/useChaiExternalData-a90e8aac.cjs +0 -1
- /package/dist/{MODIFIERS-2f19c314.js → MODIFIERS-DsEzQ3aH.js} +0 -0
- /package/dist/{MODIFIERS-4716c669.cjs → MODIFIERS-Fx6WAZcw.cjs} +0 -0
- /package/dist/{jsx-runtime-5c3ac4f7.cjs → jsx-runtime-JYMCiFoE.cjs} +0 -0
- /package/dist/{jsx-runtime-944c88e2.js → jsx-runtime-Sp0orL4X.js} +0 -0
- /package/dist/{utils-ac68b2c8.js → utils-dze1SGvB.js} +0 -0
- /package/dist/{utils-3c452dd0.cjs → utils-qK_SjzzV.cjs} +0 -0
|
@@ -1,59 +1,62 @@
|
|
|
1
|
-
import { j as e } from "./jsx-runtime-
|
|
2
|
-
import { S as x, c as h, b as f, d as j, f as y } from "./select-
|
|
3
|
-
import { sortBy as P, filter as v, get as b, isEmpty as
|
|
1
|
+
import { j as e } from "./jsx-runtime-Sp0orL4X.js";
|
|
2
|
+
import { S as x, c as h, b as f, d as j, f as y } from "./select-POGdEDHT.js";
|
|
3
|
+
import { sortBy as P, filter as v, get as b, isEmpty as m, find as n, capitalize as S, map as w } from "lodash";
|
|
4
4
|
import { toast as C } from "sonner";
|
|
5
5
|
import { useEffect as l } from "react";
|
|
6
|
-
import {
|
|
6
|
+
import { a as N, u as k, c as B, d as E } from "./index-cZ4uo6aT.js";
|
|
7
|
+
import { p as I } from "./ChaiBuilderEditor-h9bXC4l-.js";
|
|
7
8
|
import "react-i18next";
|
|
8
|
-
import { BriefcaseIcon as
|
|
9
|
+
import { BriefcaseIcon as L } from "lucide-react";
|
|
9
10
|
import "@radix-ui/react-icons";
|
|
10
11
|
import "@radix-ui/react-select";
|
|
11
|
-
import "./utils-
|
|
12
|
+
import "./utils-dze1SGvB.js";
|
|
12
13
|
import "clsx";
|
|
13
14
|
import "tailwind-merge";
|
|
14
|
-
import "./
|
|
15
|
+
import "./skeleton-CU_FIbg3.js";
|
|
16
|
+
import "jotai";
|
|
17
|
+
import "@radix-ui/react-slot";
|
|
18
|
+
import "class-variance-authority";
|
|
19
|
+
import "@radix-ui/react-tooltip";
|
|
20
|
+
import "@radix-ui/react-toast";
|
|
21
|
+
import "./html-to-json-pdHQfRkN.js";
|
|
22
|
+
import "himalaya";
|
|
23
|
+
import "./functions-pcUZhFJM.js";
|
|
24
|
+
import "./MODIFIERS-DsEzQ3aH.js";
|
|
25
|
+
import "./alert-dialog-GNfnpqFB.js";
|
|
26
|
+
import "@radix-ui/react-alert-dialog";
|
|
15
27
|
import "@radix-ui/react-scroll-area";
|
|
16
28
|
import "react-dom";
|
|
17
29
|
import "@floating-ui/react-dom";
|
|
18
|
-
import "jotai";
|
|
19
30
|
import "i18next";
|
|
20
31
|
import "flagged";
|
|
21
32
|
import "react-dnd";
|
|
22
33
|
import "@minoru/react-dnd-treeview";
|
|
23
|
-
import "./useBuilderProp-21feb2da.js";
|
|
24
|
-
import "@radix-ui/react-alert-dialog";
|
|
25
|
-
import "@radix-ui/react-slot";
|
|
26
|
-
import "class-variance-authority";
|
|
27
|
-
import "@radix-ui/react-tooltip";
|
|
28
|
-
import "@radix-ui/react-toast";
|
|
29
34
|
import "react-hotkeys-hook";
|
|
30
35
|
import "flat-to-nested";
|
|
31
|
-
import "./html-to-json-45e0e3b5.js";
|
|
32
|
-
import "himalaya";
|
|
33
36
|
import "redux-undo";
|
|
34
37
|
import "@react-hookz/web";
|
|
35
38
|
import "@chaibuilder/blocks";
|
|
36
|
-
const
|
|
37
|
-
const { data: t } = N(), { data: a, isLoading: c } = k(), { syncState: p } =
|
|
39
|
+
const he = () => {
|
|
40
|
+
const { data: t } = N(), { data: a, isLoading: c } = k(), { syncState: p } = I(), d = B(), [i, s] = E(), o = P(v(a, { type: "STATIC" }), (r) => b(r, "uuid") === (t == null ? void 0 : t.homepage) ? 0 : 1);
|
|
38
41
|
l(() => {
|
|
39
|
-
!
|
|
42
|
+
!m(a) && t.homepage && !n(a, { uuid: i }) && s(t.homepage);
|
|
40
43
|
}, [i, a, t, s]), l(() => () => s(null), [s]);
|
|
41
44
|
const u = (r) => {
|
|
42
45
|
if (p !== "SAVED")
|
|
43
46
|
C.error("You have unsaved changes. Please save before changing the page.");
|
|
44
47
|
else {
|
|
45
|
-
const g =
|
|
48
|
+
const g = n(o, { uuid: r });
|
|
46
49
|
d(g);
|
|
47
50
|
}
|
|
48
51
|
};
|
|
49
|
-
return c ||
|
|
52
|
+
return c || m(i) ? null : /* @__PURE__ */ e.jsx(
|
|
50
53
|
"nav",
|
|
51
54
|
{
|
|
52
55
|
className: "flex rounded-lg border border-gray-200 bg-gray-50 px-3 pr-0 py-1 text-gray-700 dark:border-gray-700 dark:bg-gray-800",
|
|
53
56
|
"aria-label": "Breadcrumb",
|
|
54
57
|
children: /* @__PURE__ */ e.jsxs("ol", { className: "inline-flex items-center space-x-1 md:space-x-3", children: [
|
|
55
58
|
/* @__PURE__ */ e.jsx("li", { className: "inline-flex items-center", children: /* @__PURE__ */ e.jsxs("div", { className: "inline-flex items-center text-sm font-medium text-gray-500 dark:text-gray-400", children: [
|
|
56
|
-
/* @__PURE__ */ e.jsx(
|
|
59
|
+
/* @__PURE__ */ e.jsx(L, { className: "w-4 h-4 mr-2" }),
|
|
57
60
|
S(t.name)
|
|
58
61
|
] }) }),
|
|
59
62
|
/* @__PURE__ */ e.jsx("li", { "aria-current": "page", children: /* @__PURE__ */ e.jsxs("div", { className: "flex items-center", children: [
|
|
@@ -87,5 +90,5 @@ const ue = () => {
|
|
|
87
90
|
);
|
|
88
91
|
};
|
|
89
92
|
export {
|
|
90
|
-
|
|
93
|
+
he as default
|
|
91
94
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-JYMCiFoE.cjs"),i=require("./select-7bjg-rr9.cjs"),t=require("lodash"),h=require("sonner"),l=require("react"),o=require("./index-8L3zCc6V.cjs"),j=require("./ChaiBuilderEditor-SacH75l4.cjs");require("react-i18next");const p=require("lucide-react");require("@radix-ui/react-icons");require("@radix-ui/react-select");require("./utils-qK_SjzzV.cjs");require("clsx");require("tailwind-merge");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("./html-to-json-P6GpbcQX.cjs");require("himalaya");require("./functions-uw7QP2kT.cjs");require("./MODIFIERS-Fx6WAZcw.cjs");require("./alert-dialog-Mv0-wAvS.cjs");require("@radix-ui/react-alert-dialog");require("@radix-ui/react-scroll-area");require("react-dom");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("redux-undo");require("@react-hookz/web");require("@chaibuilder/blocks");const f=()=>{const{data:s}=o.useProject(),{data:n,isLoading:x}=o.usePages(),{syncState:d}=j.useSavePage(),m=o.useChangePage(),[u,a]=o.useCurrentPage(),c=t.sortBy(t.filter(n,{type:"STATIC"}),r=>t.get(r,"uuid")===(s==null?void 0:s.homepage)?0:1);l.useEffect(()=>{!t.isEmpty(n)&&s.homepage&&!t.find(n,{uuid:u})&&a(s.homepage)},[u,n,s,a]),l.useEffect(()=>()=>a(null),[a]);const g=r=>{if(d!=="SAVED")h.toast.error("You have unsaved changes. Please save before changing the page.");else{const q=t.find(c,{uuid:r});m(q)}};return x||t.isEmpty(u)?null:e.jsxRuntimeExports.jsx("nav",{className:"flex rounded-lg border border-gray-200 bg-gray-50 px-3 pr-0 py-1 text-gray-700 dark:border-gray-700 dark:bg-gray-800","aria-label":"Breadcrumb",children:e.jsxRuntimeExports.jsxs("ol",{className:"inline-flex items-center space-x-1 md:space-x-3",children:[e.jsxRuntimeExports.jsx("li",{className:"inline-flex items-center",children:e.jsxRuntimeExports.jsxs("div",{className:"inline-flex items-center text-sm font-medium text-gray-500 dark:text-gray-400",children:[e.jsxRuntimeExports.jsx(p.BriefcaseIcon,{className:"w-4 h-4 mr-2"}),t.capitalize(s.name)]})}),e.jsxRuntimeExports.jsx("li",{"aria-current":"page",children:e.jsxRuntimeExports.jsxs("div",{className:"flex items-center",children:[e.jsxRuntimeExports.jsx("svg",{className:"mx-1 h-3 w-3 text-gray-400","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 6 10",children:e.jsxRuntimeExports.jsx("path",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"m1 9 4-4-4-4"})}),e.jsxRuntimeExports.jsxs(i.Select,{value:u||"",onValueChange:g,children:[e.jsxRuntimeExports.jsx(i.SelectTrigger,{className:"h-max border-0 py-0 text-sm font-medium text-gray-600 shadow-none outline-none ring-0 focus:ring-0 dark:text-gray-400",children:e.jsxRuntimeExports.jsx(i.SelectValue,{placeholder:"Page"})}),e.jsxRuntimeExports.jsx(i.SelectContent,{className:"z-[999]",children:t.map(c,r=>e.jsxRuntimeExports.jsx(i.SelectItem,{value:r.uuid,children:r==null?void 0:r.name},r.uuid))})]})]})})]})})};exports.default=f;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-JYMCiFoE.cjs"),l=require("react"),s=require("./tabs-iWeaaVrg.cjs");require("@radix-ui/react-tabs");require("./utils-qK_SjzzV.cjs");require("clsx");require("tailwind-merge");const x=l.lazy(()=>Promise.resolve().then(()=>require("./UnsplashImages-BoBBSi1a.cjs"))),i=l.lazy(()=>Promise.resolve().then(()=>require("./UploadImages-T6kW0s3G.cjs"))),o=({isModalView:a=!1,onSelect:t=()=>{}})=>{const[r,n]=l.useState("upload");return e.jsxRuntimeExports.jsxs("div",{className:"flex h-full flex-col",children:[e.jsxRuntimeExports.jsx("div",{className:"flex items-center justify-between rounded-md bg-background/30 p-1",children:e.jsxRuntimeExports.jsx("h1",{className:"px-1 font-semibold",children:a?"Select or upload images":"Images"})}),e.jsxRuntimeExports.jsxs(s.Tabs,{value:r,onValueChange:u=>n(u),className:"flex h-full w-full flex-col py-2",children:[e.jsxRuntimeExports.jsxs(s.TabsList,{className:"w-full",children:[e.jsxRuntimeExports.jsx(s.TabsTrigger,{value:"upload",className:"w-1/2",children:"Upload"}),e.jsxRuntimeExports.jsx(s.TabsTrigger,{value:"unsplash",className:"w-1/2",children:"Unsplash"})]}),r==="unsplash"?e.jsxRuntimeExports.jsx(s.TabsContent,{value:"unsplash",className:"flex h-full flex-col overflow-hidden",children:e.jsxRuntimeExports.jsx(l.Suspense,{fallback:e.jsxRuntimeExports.jsx("div",{className:"h-64 w-full animate-pulse bg-gray-100"}),children:e.jsxRuntimeExports.jsx(x,{isModalView:a,onSelect:t})})}):e.jsxRuntimeExports.jsx(s.TabsContent,{value:"upload",className:"flex h-full flex-col overflow-hidden",children:e.jsxRuntimeExports.jsx(l.Suspense,{fallback:e.jsxRuntimeExports.jsx("div",{className:"h-64 w-full animate-pulse bg-gray-100"}),children:e.jsxRuntimeExports.jsx(i,{isModalView:a,onSelect:t})})})]})]})},c=o;exports.default=c;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { j as l } from "./jsx-runtime-
|
|
1
|
+
import { j as l } from "./jsx-runtime-Sp0orL4X.js";
|
|
2
2
|
import r, { useState as u, Suspense as n } from "react";
|
|
3
|
-
import { T as i, a as d, b as c, c as o } from "./tabs-
|
|
3
|
+
import { T as i, a as d, b as c, c as o } from "./tabs-Gb9v5dVb.js";
|
|
4
4
|
import "@radix-ui/react-tabs";
|
|
5
|
-
import "./utils-
|
|
5
|
+
import "./utils-dze1SGvB.js";
|
|
6
6
|
import "clsx";
|
|
7
7
|
import "tailwind-merge";
|
|
8
|
-
const f = r.lazy(() => import("./UnsplashImages-
|
|
8
|
+
const f = r.lazy(() => import("./UnsplashImages-gPcBLjgB.js")), p = r.lazy(() => import("./UploadImages-_ZyUU66E.js")), x = ({
|
|
9
9
|
isModalView: s = !1,
|
|
10
10
|
onSelect: a = () => {
|
|
11
11
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-JYMCiFoE.cjs"),a=require("lodash"),s=require("@radix-ui/react-icons"),f=require("react-dnd"),q=require("@minoru/react-dnd-treeview"),P=require("react-i18next"),c=require("./ChaiBuilderEditor-SacH75l4.cjs"),C=require("./useAllBlocks-RU_Xw8j9.cjs"),H=require("lucide-react"),v=require("./utils-qK_SjzzV.cjs"),L=require("./useHiddenBlocks-oJuQDmTy.cjs"),m=require("react"),F=require("./MODIFIERS-Fx6WAZcw.cjs"),y=require("./dialog-S_QbL1iq.cjs"),u=require("./context-menu-IgLbIuth.cjs"),S=require("./skeleton-JHP9zwL2.cjs"),V=require("./scroll-area-FiHvy-TZ.cjs"),z=require("jotai"),G=require("./useAddBlock-1cMXaOVk.cjs");require("clsx");require("@radix-ui/react-scroll-area");require("react-dom");require("@floating-ui/react-dom");require("i18next");require("flagged");require("react-hotkeys-hook");require("flat-to-nested");require("./functions-uw7QP2kT.cjs");require("redux-undo");require("@react-hookz/web");require("@chaibuilder/blocks");require("tailwind-merge");require("@radix-ui/react-dialog");require("@radix-ui/react-context-menu");require("@radix-ui/react-slot");require("class-variance-authority");require("@radix-ui/react-tooltip");require("@radix-ui/react-toast");require("./controls-xUKa23ic.cjs");const w=t=>{switch(t.type){case"Image":return e.jsxRuntimeExports.jsx(s.ImageIcon,{});case"Heading":return e.jsxRuntimeExports.jsx(s.HeadingIcon,{});case"Text":return e.jsxRuntimeExports.jsx(s.TextIcon,{});case"Link":return e.jsxRuntimeExports.jsx(s.Link1Icon,{});case"Video":return e.jsxRuntimeExports.jsx(s.VideoIcon,{});case"RichText":return e.jsxRuntimeExports.jsx(s.CursorTextIcon,{});case"Button":return e.jsxRuntimeExports.jsx(s.ButtonIcon,{});case"CustomHTML":return e.jsxRuntimeExports.jsx(s.CodeIcon,{});case"Divider":return e.jsxRuntimeExports.jsx(s.DividerHorizontalIcon,{});case"Icon":return e.jsxRuntimeExports.jsx(s.SketchLogoIcon,{});case"List":return e.jsxRuntimeExports.jsx(s.RowsIcon,{});case"Paragraph":return e.jsxRuntimeExports.jsx(s.TextIcon,{});case"Row":return e.jsxRuntimeExports.jsx(s.RowsIcon,{});case"ListItem":return e.jsxRuntimeExports.jsx(s.ColumnsIcon,{});case"LineBreak":return e.jsxRuntimeExports.jsx(s.SpaceBetweenVerticallyIcon,{});case"Form":return e.jsxRuntimeExports.jsx(s.GroupIcon,{});case"Checkbox":return e.jsxRuntimeExports.jsx(s.CheckboxIcon,{});case"FormButton":return e.jsxRuntimeExports.jsx(s.ButtonIcon,{});case"Input":case"TextArea":return e.jsxRuntimeExports.jsx(s.InputIcon,{});case"Radio":return e.jsxRuntimeExports.jsx(s.RadiobuttonIcon,{});case"Select":return e.jsxRuntimeExports.jsx(s.DropdownMenuIcon,{});case"Table":return e.jsxRuntimeExports.jsx(s.TableIcon,{});case"TableHead":return e.jsxRuntimeExports.jsx(s.BorderTopIcon,{});case"TableBody":return e.jsxRuntimeExports.jsx(s.BorderAllIcon,{});case"TableRow":return e.jsxRuntimeExports.jsx(s.ViewHorizontalIcon,{});case"TableCell":return e.jsxRuntimeExports.jsx(s.DragHandleHorizontalIcon,{});case"DataProvider":return e.jsxRuntimeExports.jsx(H.DatabaseIcon,{size:16});case"Box":return e.jsxRuntimeExports.jsx(s.BoxIcon,{});default:return e.jsxRuntimeExports.jsx(s.BoxModelIcon,{})}};function $(t=""){const n={xs:"390px",sm:"640px",md:"768px",lg:"1024px",xl:"1366px","2xl":"1536px"};if(new RegExp(/\bsr-only\b/).test(t))return"Sr Only";if(new RegExp(/\b(sm|md|lg|xl|2xl):hidden\b/).test(t))return"Visible on mobile";if(t.match(/(^| )hidden( |$)/g)){const i=new RegExp(/\b(sm|md|lg|xl|2xl):(block|grid|flex|inline|inline-grid|inline-flex|inline-block)\b/),l=t.match(i);if(a.nth(l,1))return`Visible >=${n[a.nth(l,1)]}`}return""}const K=t=>{let n="";return Object.keys(t).forEach(r=>{a.startsWith(t[r],F.STYLES_KEY)&&(n=t[r])}),n},Q=t=>{var R;const[,n]=c.useHighlightBlockId(),[r]=L.useHiddenBlockIds(),{isSelected:x}=t,{id:i,data:l}=t.node,d=t.depth*10,j=p=>{p.stopPropagation(),t.onToggle(t.node.id)},I=q.useDragOver(i,t.isOpen,t.onToggle),g=m.useMemo(()=>{const p=K(t.node.data);return $(p)},[t.node.data]);return e.jsxRuntimeExports.jsx("div",{onMouseEnter:()=>n(i),className:v.cn("group flex w-full items-center justify-between space-x-px py-px ",x?"bg-blue-500 text-white":"hover:bg-gray-200 dark:hover:bg-gray-800"),onClick:p=>{p.stopPropagation(),!r.includes(i)&&t.onSelect(i)},onContextMenu:()=>t.onSelect(i),style:{paddingInlineStart:d},...I,children:e.jsxRuntimeExports.jsxs("div",{className:"flex items-center",children:[e.jsxRuntimeExports.jsx("div",{className:`flex h-4 w-4 rotate-0 transform cursor-pointer items-center justify-center text-xs transition-transform duration-100 ${t.isOpen?"rotate-90":""}`,children:t.node.droppable&&e.jsxRuntimeExports.jsx("button",{onClick:j,type:"button",children:e.jsxRuntimeExports.jsx(s.TriangleRightIcon,{})})}),e.jsxRuntimeExports.jsxs("button",{type:"button",className:"flex items-center",children:[e.jsxRuntimeExports.jsx("div",{className:"-mt-1 h-3 w-3",children:e.jsxRuntimeExports.jsx(w,{type:l==null?void 0:l._type})}),e.jsxRuntimeExports.jsx("div",{className:"ml-2 truncate text-[11px]",children:((R=t.node.data)==null?void 0:R._name)||t.node.text}),g?e.jsxRuntimeExports.jsxs("span",{className:"ml-2 flex items-center text-[10px] italic "+(x?"text-gray-200":"text-gray-500"),children:["(",g,")"]}):null]})]})})},U=t=>{var r;const{item:n}=t.monitorProps;return e.jsxRuntimeExports.jsxs("div",{className:"flex w-max items-center bg-blue-200 bg-opacity-30 p-1 font-semibold text-blue-700",children:[e.jsxRuntimeExports.jsx("div",{className:"",children:e.jsxRuntimeExports.jsx(w,{type:(r=n==null?void 0:n.data)==null?void 0:r._type})}),e.jsxRuntimeExports.jsx("div",{className:"ml-2 truncate text-[11px]",children:n.text})]})},Y=t=>{const n=t.depth*10+16;return e.jsxRuntimeExports.jsx("div",{className:"absolute right-0 top-0 h-0.5 -translate-y-1/2 transform bg-green-500",style:{left:n}})},W=m.lazy(()=>Promise.resolve().then(()=>require("./MarkAsGlobalBlock-1J_YyL1L.cjs"))),J=()=>{const[t]=c.useSelectedBlockIds(),[,n]=c.useCutBlockIds();return e.jsxRuntimeExports.jsxs(u.ContextMenuItem,{className:"flex items-center gap-x-4 text-xs",onClick:()=>n(t),children:[e.jsxRuntimeExports.jsx(s.ScissorsIcon,{})," Cut"]})},X=()=>{const[t]=c.useSelectedBlockIds(),[,n]=c.useCopyBlockIds();return e.jsxRuntimeExports.jsxs(u.ContextMenuItem,{className:"flex items-center gap-x-4 text-xs",onClick:()=>n(t),children:[e.jsxRuntimeExports.jsx(s.ClipboardIcon,{})," Copy"]})},Z=()=>{const[t]=c.useSelectedBlockIds(),n=c.useRemoveBlocks(),r=c.useSelectedBlock();return e.jsxRuntimeExports.jsxs(u.ContextMenuItem,{disabled:(r==null?void 0:r._type)==="Slot",className:"flex items-center gap-x-4 text-xs",onClick:()=>n(t),children:[e.jsxRuntimeExports.jsx(s.TrashIcon,{})," Remove"]})},ee=({id:t=null,openMarkAsGlobalModal:n})=>{const[r]=c.useSelectedBlockIds(),x=c.useDuplicateBlocks(),{pasteBlocks:i,canPaste:l}=c.usePasteBlocks(),d=S.useBuilderProp("globalBlocksSupport",!1),j=m.useCallback(()=>{x(r)},[r,x]);return e.jsxRuntimeExports.jsxs(u.ContextMenuContent,{className:"text-xs",children:[d&&e.jsxRuntimeExports.jsx(u.ContextMenuItem,{className:"flex items-center gap-x-4 border-b text-xs",onClick:n,children:e.jsxRuntimeExports.jsxs("div",{className:"flex items-center gap-x-4",children:[e.jsxRuntimeExports.jsx(s.GlobeIcon,{})," Mark as global"]})}),e.jsxRuntimeExports.jsxs(u.ContextMenuItem,{className:"flex items-center gap-x-4 text-xs",onClick:j,children:[e.jsxRuntimeExports.jsx(s.CopyIcon,{})," Duplicate"]}),e.jsxRuntimeExports.jsx(J,{}),e.jsxRuntimeExports.jsx(X,{}),e.jsxRuntimeExports.jsxs(u.ContextMenuItem,{className:"flex items-center gap-x-4 text-xs",onClick:()=>i(t),disabled:!l,children:[e.jsxRuntimeExports.jsx(s.ClipboardCopyIcon,{})," Paste"]}),e.jsxRuntimeExports.jsx(Z,{})]})},te=({children:t,id:n=null})=>{const[r,x]=m.useState(!1);return e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx(y.Dialog,{open:r,onOpenChange:x,children:r&&e.jsxRuntimeExports.jsx(y.DialogContent,{children:e.jsxRuntimeExports.jsx(m.Suspense,{fallback:e.jsxRuntimeExports.jsx("div",{className:"h-96 w-full animate-pulse bg-gray-200"}),children:e.jsxRuntimeExports.jsx(W,{closeModal:()=>x(!1),id:n})})})}),e.jsxRuntimeExports.jsxs(u.ContextMenu,{children:[e.jsxRuntimeExports.jsx(u.ContextMenuTrigger,{children:t}),e.jsxRuntimeExports.jsx(ee,{id:n,openMarkAsGlobalModal:()=>x(!0)})]})]})},se=()=>{const{addCoreBlock:t}=G.useAddBlock(),n=S.useBuilderProp("getExternalPredefinedBlock");return m.useCallback(async r=>{const{block:x,dropTargetId:i,relativeIndex:l}=r;if(a.has(x,"format")){const d=await n(x);return t({blocks:d},i===0?null:i,l)}return t(x,i===0?null:i,l)},[t])};function ne(t){return a.map(t,n=>{const{data:r}=n;return{...r,_parent:n.parent===0?null:n.parent}})}const re=()=>{const t=C.useAllBlocks(),[n]=c.useSetAllBlocks(),[r,x,i]=c.useSelectedBlockIds(),[,l]=c.useSelectedStylingBlocks(),{t:d}=P.useTranslation(),{createSnapshot:j}=c.useCanvasHistory(),I=c.useExpandedIds(),g=se(),[,R]=z.useAtom(c.addBlocksModalAtom),p=async(o,E)=>{const{dragSource:k,destinationIndex:b,relativeIndex:B,dropTargetId:O,monitor:A}=E,_=ne(o);n(_),k?j():(await g({block:A.getItem(),dropTargetId:O,destinationIndex:b,relativeIndex:B}),R(!1))},T=a.map(t,o=>({id:o._id,text:o._type,parent:o._parent||0,droppable:!a.isUndefined(a.find(t,{_parent:o._id})),data:o})),M=()=>{x([]),l([])},[{isOver:h},D]=f.useDrop(()=>({accept:["CHAI_BLOCK"],collect:o=>({canDrop:o.canDrop(),isOver:o.isOver()}),drop:o=>{(async()=>(await g({block:o,dropTargetId:"",destinationIndex:0,relativeIndex:0}),R(!1)))()}})),{isDragging:N}=f.useDragLayer(o=>({isDragging:o.isDragging()}));return e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:e.jsxRuntimeExports.jsx("div",{onClick:()=>M(),className:v.cn("-mx-1 -mt-1 flex h-full select-none flex-col space-y-1",N?"bg-green-50/80":"bg-background"),children:a.isEmpty(t)?e.jsxRuntimeExports.jsxs("div",{ref:D,className:`mx-1 mt-4 max-w-full h-full p-6 text-center text-sm text-gray-400 ${h?"bg-blue-200":""}`,children:[h?e.jsxRuntimeExports.jsx(s.DoubleArrowDownIcon,{className:"mx-auto h-12 w-12 animate-bounce"}):e.jsxRuntimeExports.jsx(s.StackIcon,{className:"mx-auto h-10 w-10"}),e.jsxRuntimeExports.jsx("p",{className:"mt-2",children:d(h?"drop_here_message":"tree_view_no_blocks")})]}):e.jsxRuntimeExports.jsx(V.ScrollArea,{id:"layers-view",className:"no-scrollbar h-full overflow-y-auto p-1",children:e.jsxRuntimeExports.jsx(q.Tree,{initialOpen:I,extraAcceptTypes:["CHAI_BLOCK"],tree:T,rootId:0,render:(o,{depth:E,isOpen:k,onToggle:b})=>e.jsxRuntimeExports.jsx(te,{id:o.id,children:e.jsxRuntimeExports.jsx(Q,{onSelect:B=>{l([]),x([B])},isSelected:a.includes(r,o.id),node:o,depth:E,isOpen:k,onToggle:b,toggleIds:i})}),dragPreviewRender:o=>e.jsxRuntimeExports.jsx(U,{monitorProps:o}),onDrop:p,classes:{root:"h-full pt-2",draggingSource:"opacity-30",dropTarget:"bg-green-100",placeholder:"relative"},sort:!1,insertDroppableFirst:!1,canDrop:C.canDropBlock,dropTargetOffset:2,enableAnimateExpand:!0,placeholderRender:(o,{depth:E})=>e.jsxRuntimeExports.jsx(Y,{node:o,depth:E})})})})})};exports.default=re;
|
|
@@ -1,19 +1,22 @@
|
|
|
1
|
-
import { j as e } from "./jsx-runtime-
|
|
1
|
+
import { j as e } from "./jsx-runtime-Sp0orL4X.js";
|
|
2
2
|
import { nth as k, startsWith as P, has as H, map as v, isUndefined as L, find as V, isEmpty as z, includes as F } from "lodash";
|
|
3
|
-
import { BoxModelIcon as G, BoxIcon as $, DragHandleHorizontalIcon as K, ViewHorizontalIcon as
|
|
3
|
+
import { BoxModelIcon as G, BoxIcon as $, DragHandleHorizontalIcon as K, ViewHorizontalIcon as q, BorderAllIcon as Q, BorderTopIcon as U, TableIcon as Y, DropdownMenuIcon as W, RadiobuttonIcon as J, InputIcon as X, ButtonIcon as B, CheckboxIcon as Z, GroupIcon as ee, SpaceBetweenVerticallyIcon as se, ColumnsIcon as te, RowsIcon as y, TextIcon as C, SketchLogoIcon as oe, DividerHorizontalIcon as ne, CodeIcon as re, CursorTextIcon as ae, VideoIcon as ce, Link1Icon as le, HeadingIcon as ie, ImageIcon as de, TriangleRightIcon as xe, GlobeIcon as ue, CopyIcon as me, ClipboardCopyIcon as pe, ScissorsIcon as ge, ClipboardIcon as je, TrashIcon as he, DoubleArrowDownIcon as fe, StackIcon as Ie } from "@radix-ui/react-icons";
|
|
4
4
|
import { useDrop as be, useDragLayer as ke } from "react-dnd";
|
|
5
5
|
import { useDragOver as Be, Tree as ye } from "@minoru/react-dnd-treeview";
|
|
6
6
|
import { useTranslation as Ce } from "react-i18next";
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
7
|
+
import { g as ve, l as g, e as we, h as Se, d as Te, b as De, k as Ne, m as Me, s as Oe, q as Re, a as Ee, N as Ae, x as _e } from "./ChaiBuilderEditor-h9bXC4l-.js";
|
|
8
|
+
import { u as Pe, b as He } from "./useAllBlocks-lX6uVO39.js";
|
|
9
|
+
import { DatabaseIcon as Le } from "lucide-react";
|
|
10
|
+
import { c as w } from "./utils-dze1SGvB.js";
|
|
11
|
+
import { u as Ve } from "./useHiddenBlocks-3MsGOJ1s.js";
|
|
12
|
+
import { useMemo as ze, lazy as Fe, useState as Ge, Suspense as $e, useCallback as S } from "react";
|
|
13
|
+
import { S as Ke } from "./MODIFIERS-DsEzQ3aH.js";
|
|
14
|
+
import { D as qe, b as Qe } from "./dialog-jrw9DF1f.js";
|
|
15
|
+
import { C as Ue, a as Ye, b as We, c as d } from "./context-menu-8dC9uGXj.js";
|
|
16
|
+
import { u as T } from "./skeleton-CU_FIbg3.js";
|
|
17
|
+
import { S as Je } from "./scroll-area-ewXbxc3n.js";
|
|
18
|
+
import { useAtom as Xe } from "jotai";
|
|
19
|
+
import { u as Ze } from "./useAddBlock-BOjrGBEO.js";
|
|
17
20
|
import "clsx";
|
|
18
21
|
import "@radix-ui/react-scroll-area";
|
|
19
22
|
import "react-dom";
|
|
@@ -22,21 +25,19 @@ import "i18next";
|
|
|
22
25
|
import "flagged";
|
|
23
26
|
import "react-hotkeys-hook";
|
|
24
27
|
import "flat-to-nested";
|
|
25
|
-
import "./
|
|
26
|
-
import "himalaya";
|
|
28
|
+
import "./functions-pcUZhFJM.js";
|
|
27
29
|
import "redux-undo";
|
|
28
30
|
import "@react-hookz/web";
|
|
29
31
|
import "@chaibuilder/blocks";
|
|
30
|
-
import "sonner";
|
|
31
32
|
import "tailwind-merge";
|
|
32
33
|
import "@radix-ui/react-dialog";
|
|
33
34
|
import "@radix-ui/react-context-menu";
|
|
34
|
-
import "@radix-ui/react-alert-dialog";
|
|
35
35
|
import "@radix-ui/react-slot";
|
|
36
36
|
import "class-variance-authority";
|
|
37
37
|
import "@radix-ui/react-tooltip";
|
|
38
38
|
import "@radix-ui/react-toast";
|
|
39
|
-
|
|
39
|
+
import "./controls-Ni5kEzLz.js";
|
|
40
|
+
const D = (s) => {
|
|
40
41
|
switch (s.type) {
|
|
41
42
|
case "Image":
|
|
42
43
|
return /* @__PURE__ */ e.jsx(de, {});
|
|
@@ -76,23 +77,23 @@ const T = (s) => {
|
|
|
76
77
|
return /* @__PURE__ */ e.jsx(B, {});
|
|
77
78
|
case "Input":
|
|
78
79
|
case "TextArea":
|
|
79
|
-
return /* @__PURE__ */ e.jsx(J, {});
|
|
80
|
-
case "Radio":
|
|
81
80
|
return /* @__PURE__ */ e.jsx(X, {});
|
|
81
|
+
case "Radio":
|
|
82
|
+
return /* @__PURE__ */ e.jsx(J, {});
|
|
82
83
|
case "Select":
|
|
83
84
|
return /* @__PURE__ */ e.jsx(W, {});
|
|
84
85
|
case "Table":
|
|
85
|
-
return /* @__PURE__ */ e.jsx(
|
|
86
|
+
return /* @__PURE__ */ e.jsx(Y, {});
|
|
86
87
|
case "TableHead":
|
|
87
|
-
return /* @__PURE__ */ e.jsx(
|
|
88
|
+
return /* @__PURE__ */ e.jsx(U, {});
|
|
88
89
|
case "TableBody":
|
|
89
|
-
return /* @__PURE__ */ e.jsx(
|
|
90
|
+
return /* @__PURE__ */ e.jsx(Q, {});
|
|
90
91
|
case "TableRow":
|
|
91
|
-
return /* @__PURE__ */ e.jsx(
|
|
92
|
+
return /* @__PURE__ */ e.jsx(q, {});
|
|
92
93
|
case "TableCell":
|
|
93
94
|
return /* @__PURE__ */ e.jsx(K, {});
|
|
94
95
|
case "DataProvider":
|
|
95
|
-
return /* @__PURE__ */ e.jsx(
|
|
96
|
+
return /* @__PURE__ */ e.jsx(Le, { size: 16 });
|
|
96
97
|
case "Box":
|
|
97
98
|
return /* @__PURE__ */ e.jsx($, {});
|
|
98
99
|
default:
|
|
@@ -125,13 +126,13 @@ function es(s = "") {
|
|
|
125
126
|
const ss = (s) => {
|
|
126
127
|
let t = "";
|
|
127
128
|
return Object.keys(s).forEach((o) => {
|
|
128
|
-
P(s[o],
|
|
129
|
+
P(s[o], Ke) && (t = s[o]);
|
|
129
130
|
}), t;
|
|
130
131
|
}, ts = (s) => {
|
|
131
132
|
var m;
|
|
132
|
-
const [, t] = ve(), [o] =
|
|
133
|
+
const [, t] = ve(), [o] = Ve(), { isSelected: r } = s, { id: a, data: c } = s.node, l = s.depth * 10, x = (i) => {
|
|
133
134
|
i.stopPropagation(), s.onToggle(s.node.id);
|
|
134
|
-
}, j = Be(a, s.isOpen, s.onToggle), u =
|
|
135
|
+
}, j = Be(a, s.isOpen, s.onToggle), u = ze(() => {
|
|
135
136
|
const i = ss(s.node.data);
|
|
136
137
|
return es(i);
|
|
137
138
|
}, [s.node.data]);
|
|
@@ -160,7 +161,7 @@ const ss = (s) => {
|
|
|
160
161
|
}
|
|
161
162
|
),
|
|
162
163
|
/* @__PURE__ */ e.jsxs("button", { type: "button", className: "flex items-center", children: [
|
|
163
|
-
/* @__PURE__ */ e.jsx("div", { className: "-mt-1 h-3 w-3", children: /* @__PURE__ */ e.jsx(
|
|
164
|
+
/* @__PURE__ */ e.jsx("div", { className: "-mt-1 h-3 w-3", children: /* @__PURE__ */ e.jsx(D, { type: c == null ? void 0 : c._type }) }),
|
|
164
165
|
/* @__PURE__ */ e.jsx("div", { className: "ml-2 truncate text-[11px]", children: ((m = s.node.data) == null ? void 0 : m._name) || s.node.text }),
|
|
165
166
|
u ? /* @__PURE__ */ e.jsxs(
|
|
166
167
|
"span",
|
|
@@ -182,26 +183,26 @@ const ss = (s) => {
|
|
|
182
183
|
var o;
|
|
183
184
|
const { item: t } = s.monitorProps;
|
|
184
185
|
return /* @__PURE__ */ e.jsxs("div", { className: "flex w-max items-center bg-blue-200 bg-opacity-30 p-1 font-semibold text-blue-700", children: [
|
|
185
|
-
/* @__PURE__ */ e.jsx("div", { className: "", children: /* @__PURE__ */ e.jsx(
|
|
186
|
+
/* @__PURE__ */ e.jsx("div", { className: "", children: /* @__PURE__ */ e.jsx(D, { type: (o = t == null ? void 0 : t.data) == null ? void 0 : o._type }) }),
|
|
186
187
|
/* @__PURE__ */ e.jsx("div", { className: "ml-2 truncate text-[11px]", children: t.text })
|
|
187
188
|
] });
|
|
188
189
|
}, ns = (s) => {
|
|
189
190
|
const t = s.depth * 10 + 16;
|
|
190
191
|
return /* @__PURE__ */ e.jsx("div", { className: "absolute right-0 top-0 h-0.5 -translate-y-1/2 transform bg-green-500", style: { left: t } });
|
|
191
|
-
}, rs =
|
|
192
|
+
}, rs = Fe(() => import("./MarkAsGlobalBlock-xRyn29gC.js")), as = () => {
|
|
192
193
|
const [s] = g(), [, t] = Te();
|
|
193
194
|
return /* @__PURE__ */ e.jsxs(d, { className: "flex items-center gap-x-4 text-xs", onClick: () => t(s), children: [
|
|
194
195
|
/* @__PURE__ */ e.jsx(ge, {}),
|
|
195
196
|
" Cut"
|
|
196
197
|
] });
|
|
197
198
|
}, cs = () => {
|
|
198
|
-
const [s] = g(), [, t] =
|
|
199
|
+
const [s] = g(), [, t] = De();
|
|
199
200
|
return /* @__PURE__ */ e.jsxs(d, { className: "flex items-center gap-x-4 text-xs", onClick: () => t(s), children: [
|
|
200
201
|
/* @__PURE__ */ e.jsx(je, {}),
|
|
201
202
|
" Copy"
|
|
202
203
|
] });
|
|
203
204
|
}, ls = () => {
|
|
204
|
-
const [s] = g(), t =
|
|
205
|
+
const [s] = g(), t = Ne(), o = Me();
|
|
205
206
|
return /* @__PURE__ */ e.jsxs(
|
|
206
207
|
d,
|
|
207
208
|
{
|
|
@@ -218,10 +219,10 @@ const ss = (s) => {
|
|
|
218
219
|
id: s = null,
|
|
219
220
|
openMarkAsGlobalModal: t
|
|
220
221
|
}) => {
|
|
221
|
-
const [o] = g(), r =
|
|
222
|
+
const [o] = g(), r = we(), { pasteBlocks: a, canPaste: c } = Se(), l = T("globalBlocksSupport", !1), x = S(() => {
|
|
222
223
|
r(o);
|
|
223
224
|
}, [o, r]);
|
|
224
|
-
return /* @__PURE__ */ e.jsxs(
|
|
225
|
+
return /* @__PURE__ */ e.jsxs(We, { className: "text-xs", children: [
|
|
225
226
|
l && /* @__PURE__ */ e.jsx(d, { className: "flex items-center gap-x-4 border-b text-xs", onClick: t, children: /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-x-4", children: [
|
|
226
227
|
/* @__PURE__ */ e.jsx(ue, {}),
|
|
227
228
|
" Mark as global"
|
|
@@ -247,16 +248,16 @@ const ss = (s) => {
|
|
|
247
248
|
/* @__PURE__ */ e.jsx(ls, {})
|
|
248
249
|
] });
|
|
249
250
|
}, ds = ({ children: s, id: t = null }) => {
|
|
250
|
-
const [o, r] =
|
|
251
|
+
const [o, r] = Ge(!1);
|
|
251
252
|
return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
252
|
-
/* @__PURE__ */ e.jsx(qe, { open: o, onOpenChange: r, children: o && /* @__PURE__ */ e.jsx(Qe, { children: /* @__PURE__ */ e.jsx(
|
|
253
|
+
/* @__PURE__ */ e.jsx(qe, { open: o, onOpenChange: r, children: o && /* @__PURE__ */ e.jsx(Qe, { children: /* @__PURE__ */ e.jsx($e, { fallback: /* @__PURE__ */ e.jsx("div", { className: "h-96 w-full animate-pulse bg-gray-200" }), children: /* @__PURE__ */ e.jsx(rs, { closeModal: () => r(!1), id: t }) }) }) }),
|
|
253
254
|
/* @__PURE__ */ e.jsxs(Ue, { children: [
|
|
254
|
-
/* @__PURE__ */ e.jsx(
|
|
255
|
+
/* @__PURE__ */ e.jsx(Ye, { children: s }),
|
|
255
256
|
/* @__PURE__ */ e.jsx(is, { id: t, openMarkAsGlobalModal: () => r(!0) })
|
|
256
257
|
] })
|
|
257
258
|
] });
|
|
258
259
|
}, xs = () => {
|
|
259
|
-
const { addCoreBlock: s } =
|
|
260
|
+
const { addCoreBlock: s } = Ze(), t = T("getExternalPredefinedBlock");
|
|
260
261
|
return S(
|
|
261
262
|
async (o) => {
|
|
262
263
|
const { block: r, dropTargetId: a, relativeIndex: c } = o;
|
|
@@ -279,7 +280,7 @@ function us(s) {
|
|
|
279
280
|
});
|
|
280
281
|
}
|
|
281
282
|
const Xs = () => {
|
|
282
|
-
const s =
|
|
283
|
+
const s = Pe(), [t] = Oe(), [o, r, a] = g(), [, c] = Re(), { t: l } = Ce(), { createSnapshot: x } = Ee(), j = Ae(), u = xs(), [, m] = Xe(_e), i = async (n, p) => {
|
|
283
284
|
const { dragSource: f, destinationIndex: I, relativeIndex: b, dropTargetId: E, monitor: A } = p, _ = us(n);
|
|
284
285
|
t(_), f ? x() : (await u({
|
|
285
286
|
block: A.getItem(),
|
|
@@ -324,7 +325,7 @@ const Xs = () => {
|
|
|
324
325
|
"div",
|
|
325
326
|
{
|
|
326
327
|
ref: O,
|
|
327
|
-
className: `mx-1 mt-4 h-full p-6 text-center text-sm text-gray-400 ${h ? "bg-blue-200" : ""}`,
|
|
328
|
+
className: `mx-1 mt-4 max-w-full h-full p-6 text-center text-sm text-gray-400 ${h ? "bg-blue-200" : ""}`,
|
|
328
329
|
children: [
|
|
329
330
|
h ? /* @__PURE__ */ e.jsx(fe, { className: "mx-auto h-12 w-12 animate-bounce" }) : /* @__PURE__ */ e.jsx(Ie, { className: "mx-auto h-10 w-10" }),
|
|
330
331
|
/* @__PURE__ */ e.jsx("p", { className: "mt-2", children: l(h ? "drop_here_message" : "tree_view_no_blocks") })
|
|
@@ -361,7 +362,7 @@ const Xs = () => {
|
|
|
361
362
|
},
|
|
362
363
|
sort: !1,
|
|
363
364
|
insertDroppableFirst: !1,
|
|
364
|
-
canDrop:
|
|
365
|
+
canDrop: He,
|
|
365
366
|
dropTargetOffset: 2,
|
|
366
367
|
enableAnimateExpand: !0,
|
|
367
368
|
placeholderRender: (n, { depth: p }) => /* @__PURE__ */ e.jsx(ns, { node: n, depth: p })
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-JYMCiFoE.cjs"),o=require("@radix-ui/react-icons"),u=require("react"),i=require("./skeleton-JHP9zwL2.cjs"),c=require("./useMarkAsGlobalBlock-toxRSLc_.cjs");require("react-i18next");const x=require("lodash");require("jotai");require("@radix-ui/react-slot");require("class-variance-authority");require("./utils-qK_SjzzV.cjs");require("clsx");require("tailwind-merge");require("@radix-ui/react-tooltip");require("@radix-ui/react-toast");require("./ChaiBuilderEditor-SacH75l4.cjs");require("./MODIFIERS-Fx6WAZcw.cjs");require("@radix-ui/react-scroll-area");require("react-dom");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("@chaibuilder/blocks");const m=({id:t=null,closeModal:s})=>{const l=c.useMarkAsGlobalBlock(),[r,a]=u.useState("");return e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx("h1",{className:"text-lg font-bold",children:"Mark as Global"}),e.jsxRuntimeExports.jsxs("div",{className:"py-2 text-sm",children:["Note: Global blocks are single instances. Editing global blocks will be reflected on all pages using these blocks. ",e.jsxRuntimeExports.jsx("br",{}),e.jsxRuntimeExports.jsxs("ul",{className:"mt-4 list-inside list-disc space-y-1",children:[e.jsxRuntimeExports.jsxs("li",{children:["Global blocks are indicated with ",e.jsxRuntimeExports.jsx(o.GlobeIcon,{className:"inline"})," icon in left sidebar"]}),e.jsxRuntimeExports.jsx("li",{children:'Global blocks are available under "Global" category'})]})]}),e.jsxRuntimeExports.jsxs("div",{className:"my-4",children:[e.jsxRuntimeExports.jsx("label",{className:"block text-sm font-medium text-gray-400",children:"Enter global block name"}),e.jsxRuntimeExports.jsx("input",{placeholder:"Eg: Header, Footer ",className:"mt-2 w-full",value:r,onChange:n=>a(n.target.value)})]}),e.jsxRuntimeExports.jsxs("div",{className:"flex items-center justify-end gap-x-4",children:[e.jsxRuntimeExports.jsx(i.Button,{onClick:()=>{l(t,x.capitalize(r)),s()},disabled:r.length<=2,variant:"default",children:"Mark as Global"}),e.jsxRuntimeExports.jsx(i.Button,{variant:"outline",onClick:s,children:"Cancel"})]})]})};exports.default=m;
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import { j as l } from "./jsx-runtime-
|
|
1
|
+
import { j as l } from "./jsx-runtime-Sp0orL4X.js";
|
|
2
2
|
import { GlobeIcon as m } from "@radix-ui/react-icons";
|
|
3
3
|
import { useState as n } from "react";
|
|
4
|
-
import { B as
|
|
5
|
-
import {
|
|
4
|
+
import { B as i } from "./skeleton-CU_FIbg3.js";
|
|
5
|
+
import { a as c } from "./useMarkAsGlobalBlock-DB5B1UP6.js";
|
|
6
6
|
import "react-i18next";
|
|
7
7
|
import { capitalize as p } from "lodash";
|
|
8
|
-
import "
|
|
9
|
-
import "./utils-ac68b2c8.js";
|
|
10
|
-
import "clsx";
|
|
11
|
-
import "tailwind-merge";
|
|
8
|
+
import "jotai";
|
|
12
9
|
import "@radix-ui/react-slot";
|
|
13
10
|
import "class-variance-authority";
|
|
11
|
+
import "./utils-dze1SGvB.js";
|
|
12
|
+
import "clsx";
|
|
13
|
+
import "tailwind-merge";
|
|
14
14
|
import "@radix-ui/react-tooltip";
|
|
15
15
|
import "@radix-ui/react-toast";
|
|
16
|
-
import "
|
|
17
|
-
import "./MODIFIERS-
|
|
16
|
+
import "./ChaiBuilderEditor-h9bXC4l-.js";
|
|
17
|
+
import "./MODIFIERS-DsEzQ3aH.js";
|
|
18
18
|
import "@radix-ui/react-scroll-area";
|
|
19
19
|
import "react-dom";
|
|
20
20
|
import "@floating-ui/react-dom";
|
|
@@ -24,15 +24,12 @@ import "react-dnd";
|
|
|
24
24
|
import "@minoru/react-dnd-treeview";
|
|
25
25
|
import "react-hotkeys-hook";
|
|
26
26
|
import "flat-to-nested";
|
|
27
|
-
import "./
|
|
28
|
-
import "himalaya";
|
|
27
|
+
import "./functions-pcUZhFJM.js";
|
|
29
28
|
import "redux-undo";
|
|
30
29
|
import "@react-hookz/web";
|
|
31
30
|
import "@chaibuilder/blocks";
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
const T = ({ id: o = null, closeModal: i }) => {
|
|
35
|
-
const r = c(), [t, a] = n("");
|
|
31
|
+
const O = ({ id: o = null, closeModal: e }) => {
|
|
32
|
+
const a = c(), [t, r] = n("");
|
|
36
33
|
return /* @__PURE__ */ l.jsxs(l.Fragment, { children: [
|
|
37
34
|
/* @__PURE__ */ l.jsx("h1", { className: "text-lg font-bold", children: "Mark as Global" }),
|
|
38
35
|
/* @__PURE__ */ l.jsxs("div", { className: "py-2 text-sm", children: [
|
|
@@ -55,26 +52,26 @@ const T = ({ id: o = null, closeModal: i }) => {
|
|
|
55
52
|
placeholder: "Eg: Header, Footer ",
|
|
56
53
|
className: "mt-2 w-full",
|
|
57
54
|
value: t,
|
|
58
|
-
onChange: (s) =>
|
|
55
|
+
onChange: (s) => r(s.target.value)
|
|
59
56
|
}
|
|
60
57
|
)
|
|
61
58
|
] }),
|
|
62
59
|
/* @__PURE__ */ l.jsxs("div", { className: "flex items-center justify-end gap-x-4", children: [
|
|
63
60
|
/* @__PURE__ */ l.jsx(
|
|
64
|
-
|
|
61
|
+
i,
|
|
65
62
|
{
|
|
66
63
|
onClick: () => {
|
|
67
|
-
|
|
64
|
+
a(o, p(t)), e();
|
|
68
65
|
},
|
|
69
66
|
disabled: t.length <= 2,
|
|
70
67
|
variant: "default",
|
|
71
68
|
children: "Mark as Global"
|
|
72
69
|
}
|
|
73
70
|
),
|
|
74
|
-
/* @__PURE__ */ l.jsx(
|
|
71
|
+
/* @__PURE__ */ l.jsx(i, { variant: "outline", onClick: e, children: "Cancel" })
|
|
75
72
|
] })
|
|
76
73
|
] });
|
|
77
74
|
};
|
|
78
75
|
export {
|
|
79
|
-
|
|
76
|
+
O as default
|
|
80
77
|
};
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { j as t } from "./jsx-runtime-
|
|
1
|
+
import { j as t } from "./jsx-runtime-Sp0orL4X.js";
|
|
2
2
|
import i, { Suspense as p } from "react";
|
|
3
3
|
import { sortBy as a, filter as d, get as n } from "lodash";
|
|
4
|
-
import {
|
|
5
|
-
import "./
|
|
4
|
+
import { u as l, a as c } from "./index-cZ4uo6aT.js";
|
|
5
|
+
import "./ChaiBuilderEditor-h9bXC4l-.js";
|
|
6
|
+
import "./MODIFIERS-DsEzQ3aH.js";
|
|
6
7
|
import "clsx";
|
|
7
8
|
import "@radix-ui/react-scroll-area";
|
|
8
9
|
import "react-dom";
|
|
@@ -13,35 +14,37 @@ import "react-i18next";
|
|
|
13
14
|
import "flagged";
|
|
14
15
|
import "react-dnd";
|
|
15
16
|
import "@minoru/react-dnd-treeview";
|
|
16
|
-
import "./
|
|
17
|
-
import "@radix-ui/react-alert-dialog";
|
|
18
|
-
import "./utils-ac68b2c8.js";
|
|
19
|
-
import "tailwind-merge";
|
|
17
|
+
import "./skeleton-CU_FIbg3.js";
|
|
20
18
|
import "@radix-ui/react-slot";
|
|
21
19
|
import "class-variance-authority";
|
|
20
|
+
import "./utils-dze1SGvB.js";
|
|
21
|
+
import "tailwind-merge";
|
|
22
22
|
import "@radix-ui/react-tooltip";
|
|
23
23
|
import "@radix-ui/react-icons";
|
|
24
24
|
import "@radix-ui/react-toast";
|
|
25
25
|
import "react-hotkeys-hook";
|
|
26
26
|
import "flat-to-nested";
|
|
27
|
-
import "./
|
|
28
|
-
import "himalaya";
|
|
27
|
+
import "./functions-pcUZhFJM.js";
|
|
29
28
|
import "redux-undo";
|
|
30
29
|
import "@react-hookz/web";
|
|
31
30
|
import "@chaibuilder/blocks";
|
|
32
31
|
import "sonner";
|
|
32
|
+
import "./html-to-json-pdHQfRkN.js";
|
|
33
|
+
import "himalaya";
|
|
33
34
|
import "lucide-react";
|
|
34
|
-
|
|
35
|
-
|
|
35
|
+
import "./alert-dialog-GNfnpqFB.js";
|
|
36
|
+
import "@radix-ui/react-alert-dialog";
|
|
37
|
+
const x = i.lazy(() => import("./add-page-modal-J1E7rh1U.js")), u = i.lazy(() => import("./page-viewer-84Giu0Rs.js")), Y = () => {
|
|
38
|
+
const { data: o = [], isLoading: m } = l(), { data: r } = c(), e = a(d(o, { type: "STATIC" }), (s) => n(s, "uuid") === (r == null ? void 0 : r.homepage) ? 0 : 1);
|
|
36
39
|
return /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
|
|
37
40
|
/* @__PURE__ */ t.jsxs("div", { className: "flex items-center justify-between rounded-md bg-background/30 p-1", children: [
|
|
38
41
|
/* @__PURE__ */ t.jsx("h1", { className: "px-1 font-semibold", children: "Pages" }),
|
|
39
42
|
/* @__PURE__ */ t.jsx(p, { fallback: /* @__PURE__ */ t.jsx("div", { className: "text-sm text-blue-500 underline", children: "+ New Page" }), children: /* @__PURE__ */ t.jsx(x, {}) })
|
|
40
43
|
] }),
|
|
41
44
|
/* @__PURE__ */ t.jsx("hr", { className: "-mx-1" }),
|
|
42
|
-
/* @__PURE__ */ t.jsx("div", { className: "-mx-1 divide-y-2", children: /* @__PURE__ */ t.jsx(
|
|
45
|
+
/* @__PURE__ */ t.jsx("div", { className: "-mx-1 divide-y-2", children: /* @__PURE__ */ t.jsx(u, { isLoading: m, pages: e }) })
|
|
43
46
|
] });
|
|
44
47
|
};
|
|
45
48
|
export {
|
|
46
|
-
|
|
49
|
+
Y as default
|
|
47
50
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-JYMCiFoE.cjs"),i=require("react"),s=require("lodash"),u=require("./index-8L3zCc6V.cjs");require("./ChaiBuilderEditor-SacH75l4.cjs");require("./MODIFIERS-Fx6WAZcw.cjs");require("clsx");require("@radix-ui/react-scroll-area");require("react-dom");require("@floating-ui/react-dom");require("jotai");require("i18next");require("react-i18next");require("flagged");require("react-dnd");require("@minoru/react-dnd-treeview");require("./skeleton-JHP9zwL2.cjs");require("@radix-ui/react-slot");require("class-variance-authority");require("./utils-qK_SjzzV.cjs");require("tailwind-merge");require("@radix-ui/react-tooltip");require("@radix-ui/react-icons");require("@radix-ui/react-toast");require("react-hotkeys-hook");require("flat-to-nested");require("./functions-uw7QP2kT.cjs");require("redux-undo");require("@react-hookz/web");require("@chaibuilder/blocks");require("sonner");require("./html-to-json-P6GpbcQX.cjs");require("himalaya");require("lucide-react");require("./alert-dialog-Mv0-wAvS.cjs");require("@radix-ui/react-alert-dialog");const a=i.lazy(()=>Promise.resolve().then(()=>require("./add-page-modal-eiiUZCJX.cjs"))),x=i.lazy(()=>Promise.resolve().then(()=>require("./page-viewer-OdVEG83P.cjs"))),d=()=>{const{data:t=[],isLoading:n}=u.usePages(),{data:r}=u.useProject(),o=s.sortBy(s.filter(t,{type:"STATIC"}),q=>s.get(q,"uuid")===(r==null?void 0:r.homepage)?0:1);return e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsxs("div",{className:"flex items-center justify-between rounded-md bg-background/30 p-1",children:[e.jsxRuntimeExports.jsx("h1",{className:"px-1 font-semibold",children:"Pages"}),e.jsxRuntimeExports.jsx(i.Suspense,{fallback:e.jsxRuntimeExports.jsx("div",{className:"text-sm text-blue-500 underline",children:"+ New Page"}),children:e.jsxRuntimeExports.jsx(a,{})})]}),e.jsxRuntimeExports.jsx("hr",{className:"-mx-1"}),e.jsxRuntimeExports.jsx("div",{className:"-mx-1 divide-y-2",children:e.jsxRuntimeExports.jsx(x,{isLoading:n,pages:o})})]})};exports.default=d;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-JYMCiFoE.cjs"),r=require("react"),x=require("lodash"),s=require("./accordion-ynvFtV_p.cjs"),a=require("./index-8L3zCc6V.cjs");require("@radix-ui/react-accordion");require("@radix-ui/react-icons");require("./utils-qK_SjzzV.cjs");require("clsx");require("tailwind-merge");require("./ChaiBuilderEditor-SacH75l4.cjs");require("./MODIFIERS-Fx6WAZcw.cjs");require("@radix-ui/react-scroll-area");require("react-dom");require("@floating-ui/react-dom");require("jotai");require("i18next");require("react-i18next");require("flagged");require("react-dnd");require("@minoru/react-dnd-treeview");require("./skeleton-JHP9zwL2.cjs");require("@radix-ui/react-slot");require("class-variance-authority");require("@radix-ui/react-tooltip");require("@radix-ui/react-toast");require("react-hotkeys-hook");require("flat-to-nested");require("./functions-uw7QP2kT.cjs");require("redux-undo");require("@react-hookz/web");require("@chaibuilder/blocks");require("sonner");require("./html-to-json-P6GpbcQX.cjs");require("himalaya");require("lucide-react");require("./alert-dialog-Mv0-wAvS.cjs");require("@radix-ui/react-alert-dialog");const d=r.lazy(()=>Promise.resolve().then(()=>require("./project-general-setting-laHNQPW5.cjs"))),m=r.lazy(()=>Promise.resolve().then(()=>require("./project-seo-setting-F3Opt9Uj.cjs"))),c=e.jsxRuntimeExports.jsx("div",{className:"px-3",children:e.jsxRuntimeExports.jsx("div",{className:"h-52 w-full animate-pulse rounded-md bg-gray-100"})}),l=t=>t&&x.isEmpty(t.seoData)?{...t,seoData:{title:"",description:"",image:""}}:t;function j(){const t=a.useUpdateProject(),{data:u}=a.useProject(),[i,o]=r.useState(l(u||{})),n=r.useRef(i);return r.useEffect(()=>()=>{x.isEqual(u,n.current)||t.mutate(n.current,{onSuccess:()=>o(n.current)})},[n]),r.useEffect(()=>{n.current=i},[i]),e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx("div",{className:"flex items-center justify-between rounded-md bg-background/30 p-1",children:e.jsxRuntimeExports.jsx("h1",{className:"px-1 font-semibold",children:"Website Settings"})}),e.jsxRuntimeExports.jsx("hr",{className:"-mx-1"}),e.jsxRuntimeExports.jsx("div",{className:"-mx-1",children:e.jsxRuntimeExports.jsxs(s.Accordion,{type:"single",className:"w-full",defaultValue:"GENERAL",children:[e.jsxRuntimeExports.jsxs(s.AccordionItem,{value:"GENERAL",className:"border-b-2 border-slate-100 dark:border-slate-800",children:[e.jsxRuntimeExports.jsx(s.AccordionTrigger,{className:"bg-slate-200 px-2.5 py-1.5 font-medium hover:bg-slate-100 hover:no-underline dark:bg-slate-900 dark:hover:bg-slate-800",children:"General Settings"}),e.jsxRuntimeExports.jsx(s.AccordionContent,{className:"px-2 pt-4 text-sm",children:e.jsxRuntimeExports.jsx(r.Suspense,{fallback:c,children:e.jsxRuntimeExports.jsx(d,{_projectData:i,seany:o})})})]}),e.jsxRuntimeExports.jsxs(s.AccordionItem,{value:"SEO",className:"border-b-2 border-slate-100 dark:border-slate-800",children:[e.jsxRuntimeExports.jsx(s.AccordionTrigger,{className:"bg-slate-200 px-2.5 py-1.5 font-medium hover:bg-slate-100 hover:no-underline dark:bg-slate-900 dark:hover:bg-slate-800",children:"SEO Settings"}),e.jsxRuntimeExports.jsx(s.AccordionContent,{className:"px-1 pt-4 text-sm",children:e.jsxRuntimeExports.jsx(r.Suspense,{fallback:c,children:e.jsxRuntimeExports.jsx(m,{_projectData:i,seany:o})})})]})]})})]})}exports.default=j;
|