@chaibuilder/sdk 1.2.35 → 1.2.37
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-i2OFXcGZ.cjs → AddBlocks-D6H1c91w.cjs} +1 -1
- package/dist/{AddBlocks-fpRgZNZT.js → AddBlocks-ah7ZuAiO.js} +2 -2
- package/dist/{BrandingOptions-BuV0XItY.cjs → BrandingOptions-4D94jluh.cjs} +1 -1
- package/dist/{BrandingOptions-RxIUds41.js → BrandingOptions-d0DbWp_N.js} +1 -1
- package/dist/{CanvasArea-a-I0uB7y.cjs → CanvasArea-7l8qSx52.cjs} +1 -1
- package/dist/{CanvasArea-C1VfoHjl.js → CanvasArea-h3Nu-SWT.js} +2 -2
- package/dist/{ChaiBuilderEditor-pWAMhLiq.cjs → ChaiBuilderEditor-6o0IOkBV.cjs} +3 -3
- package/dist/{ChaiBuilderEditor-ChKigulx.js → ChaiBuilderEditor-VOCsboQ9.js} +5 -5
- package/dist/{CurrentPage-JgJ2XITk.cjs → CurrentPage-NTowK7yE.cjs} +1 -1
- package/dist/{CurrentPage-tWXo7zPq.js → CurrentPage-p6Y9JO9p.js} +3 -3
- package/dist/ListTree-4wBD1QKc.cjs +1 -0
- package/dist/ListTree-tog0B3PA.js +396 -0
- package/dist/{PagesPanel-zd48fj10.cjs → PagesPanel-3pC0vx2q.cjs} +1 -1
- package/dist/{PagesPanel-bwRvd7HB.js → PagesPanel-NPSwC_QB.js} +4 -4
- package/dist/{ProjectPanel-S7X2GDYk.js → ProjectPanel-cTPurlHf.js} +4 -4
- package/dist/{ProjectPanel-sIURK9WR.cjs → ProjectPanel-tvtrXbyb.cjs} +1 -1
- package/dist/{Settings-59DRCnXh.js → Settings-P8Bbl06y.js} +2 -2
- package/dist/{Settings-Lw_UvEWj.cjs → Settings-s19XidRS.cjs} +1 -1
- package/dist/{SidePanels-FX3WxtRi.cjs → SidePanels-8NwJG0mo.cjs} +1 -1
- package/dist/{SidePanels-QwN_fVWJ.js → SidePanels-iqAbcqUv.js} +2 -2
- package/dist/{Topbar-_k5gwR_4.js → Topbar-8tMcFyw5.js} +1 -1
- package/dist/{Topbar-cRmIAzUg.cjs → Topbar-SaVYT87H.cjs} +1 -1
- package/dist/{UnsplashImages-texUmBiW.cjs → UnsplashImages-UJthlQqt.cjs} +1 -1
- package/dist/{UnsplashImages-hI0Zvl2t.js → UnsplashImages-qTNzA02V.js} +1 -1
- package/dist/{UploadImages-diXySdpc.js → UploadImages-PJyejbcA.js} +1 -1
- package/dist/{UploadImages-kRSLsKBv.cjs → UploadImages-zPJBckqp.cjs} +1 -1
- package/dist/{add-page-modal-Md_OotSU.js → add-page-modal-9SkVr8qi.js} +4 -4
- package/dist/{add-page-modal-R9nsF97c.cjs → add-page-modal-jzDXOPVp.cjs} +1 -1
- package/dist/{confirm-alert-gKJ-H8aH.cjs → confirm-alert-NECBDLLG.cjs} +1 -1
- package/dist/{confirm-alert-DS8nMVJP.js → confirm-alert-mPe-H0Yj.js} +1 -1
- package/dist/core.cjs +1 -1
- package/dist/core.js +1 -1
- package/dist/{delete-page-modal-PVpCkC06.js → delete-page-modal-kHnMpsjv.js} +3 -3
- package/dist/{delete-page-modal-ez831xRV.cjs → delete-page-modal-pRepvBUK.cjs} +1 -1
- package/dist/email.cjs +1 -1
- package/dist/email.js +1 -1
- package/dist/{form-6D7DLOsP.cjs → form-5-WyQ9J_.cjs} +1 -1
- package/dist/{form-BcCd02eY.js → form-prkciikc.js} +1 -1
- package/dist/html-to-json-VPWiWWGH.cjs +1 -0
- package/dist/{html-to-json-ZV4QjSww.js → html-to-json-Z6R2o_fA.js} +68 -76
- package/dist/{index-NmcmhDTV.js → index-X3veo7pJ.js} +3 -3
- package/dist/{index-F_-wLCKB.cjs → index-wnXwbbRk.cjs} +1 -1
- package/dist/lib.cjs +1 -1
- package/dist/lib.js +1 -1
- package/dist/{page-viewer-MyIBh0H7.cjs → page-viewer-HGX57lyj.cjs} +1 -1
- package/dist/{page-viewer-1bDdfbfY.js → page-viewer-jsyCYHKL.js} +4 -4
- package/dist/{project-general-setting-1UvYceGY.cjs → project-general-setting-2yhhHbME.cjs} +1 -1
- package/dist/{project-general-setting-cAuIqXqs.js → project-general-setting-sVRpF1o-.js} +4 -4
- package/dist/{project-seo-setting-ePXNygH3.cjs → project-seo-setting-FMpb2qiM.cjs} +1 -1
- package/dist/{project-seo-setting-DIspBN3U.js → project-seo-setting-YTVfe0Hq.js} +2 -2
- package/dist/{single-page-detail-6M4by4GP.cjs → single-page-detail-Y4OBAZAL.cjs} +1 -1
- package/dist/{single-page-detail-VEdxOlo1.js → single-page-detail-o129SZnS.js} +5 -5
- package/dist/studio.cjs +1 -1
- package/dist/studio.js +3 -3
- package/dist/ui.cjs +1 -1
- package/dist/ui.js +1 -1
- package/dist/{useCanvasSettings-xq3gcMsb.cjs → useCanvasSettings-DVIzrXND.cjs} +1 -1
- package/dist/{useCanvasSettings-YdWIGhpI.js → useCanvasSettings-J3l6fcbV.js} +1 -1
- package/dist/web-blocks.cjs +1 -1
- package/dist/web-blocks.js +1 -1
- package/package.json +1 -1
- package/dist/ListTree-_JJ1Ka3e.js +0 -319
- package/dist/ListTree-rJ4eHyKn.cjs +0 -1
- package/dist/html-to-json-Xhu27KFD.cjs +0 -1
|
@@ -766,7 +766,7 @@ Bf.use(IS).init({
|
|
|
766
766
|
// react already safes from xss => https://www.i18next.com/translation-function/interpolation#unescape
|
|
767
767
|
}
|
|
768
768
|
});
|
|
769
|
-
var O2 = { VITE_OPENAI_API_KEY: "sk-proj-
|
|
769
|
+
var O2 = { VITE_OPENAI_API_KEY: "sk-proj-nAvrOtGLbRIhaioQtvfMT3BlbkFJg6yx4VzUmm0PXr4X0w3Q", BASE_URL: "/", MODE: "production", DEV: !1, PROD: !0, SSR: !1 };
|
|
770
770
|
let RO = 0;
|
|
771
771
|
function Y1(t, e) {
|
|
772
772
|
const c = `atom${++RO}`, a = {
|
|
@@ -1071,7 +1071,7 @@ const Ze = (t) => "init" in t, We = (t) => !!t.write, g5 = /* @__PURE__ */ new W
|
|
|
1071
1071
|
};
|
|
1072
1072
|
let Ue;
|
|
1073
1073
|
const DO = () => (Ue || (Ue = Wa()), Ue);
|
|
1074
|
-
var qO = { VITE_OPENAI_API_KEY: "sk-proj-
|
|
1074
|
+
var qO = { VITE_OPENAI_API_KEY: "sk-proj-nAvrOtGLbRIhaioQtvfMT3BlbkFJg6yx4VzUmm0PXr4X0w3Q", BASE_URL: "/", MODE: "production", DEV: !1, PROD: !0, SSR: !1 };
|
|
1075
1075
|
const ZO = Y2(void 0), W0 = (t) => {
|
|
1076
1076
|
const e = B2(ZO);
|
|
1077
1077
|
return (t == null ? void 0 : t.store) || e || DO();
|
|
@@ -24118,7 +24118,7 @@ const ut1 = Q((t, e) => {
|
|
|
24118
24118
|
}, o));
|
|
24119
24119
|
});
|
|
24120
24120
|
ut1.displayName = "@mantine/core/TypographyStylesProvider";
|
|
24121
|
-
var Dr = { VITE_OPENAI_API_KEY: "sk-proj-
|
|
24121
|
+
var Dr = { VITE_OPENAI_API_KEY: "sk-proj-nAvrOtGLbRIhaioQtvfMT3BlbkFJg6yx4VzUmm0PXr4X0w3Q", BASE_URL: "/", MODE: "production", DEV: !1, PROD: !0, SSR: !1 };
|
|
24122
24122
|
const Ly = Symbol();
|
|
24123
24123
|
const ug = (t, e, c) => (e.has(c) ? e : e.set(c, t())).get(c), dt1 = /* @__PURE__ */ new WeakMap(), ht1 = (t, e, c) => {
|
|
24124
24124
|
const a = ug(() => /* @__PURE__ */ new WeakMap(), dt1, e);
|
|
@@ -41734,7 +41734,7 @@ const Ed1 = (t) => {
|
|
|
41734
41734
|
}
|
|
41735
41735
|
)
|
|
41736
41736
|
] });
|
|
41737
|
-
}, Pd1 = p.lazy(() => import("./UnsplashImages-
|
|
41737
|
+
}, Pd1 = p.lazy(() => import("./UnsplashImages-qTNzA02V.js")), kd1 = p.lazy(() => import("./UploadImages-PJyejbcA.js")), iS = ({
|
|
41738
41738
|
isModalView: t = !1,
|
|
41739
41739
|
onSelect: e = () => {
|
|
41740
41740
|
}
|
|
@@ -42577,7 +42577,7 @@ const Ph1 = ({ blockId: t }) => {
|
|
|
42577
42577
|
}, kh1 = () => {
|
|
42578
42578
|
const [t] = i6();
|
|
42579
42579
|
return /* @__PURE__ */ S.jsx("div", { className: "absolute inset-0 z-50 h-full w-full bg-white p-2", children: /* @__PURE__ */ S.jsx(Ph1, { blockId: e4(t) }) });
|
|
42580
|
-
}, Ih1 = Qt(() => import("./SidePanels-
|
|
42580
|
+
}, Ih1 = Qt(() => import("./SidePanels-iqAbcqUv.js")), Rh1 = Qt(() => import("./Topbar-8tMcFyw5.js")), Nh1 = Qt(() => import("./CanvasArea-h3Nu-SWT.js")), Th1 = Qt(() => import("./Settings-P8Bbl06y.js")), jh1 = () => {
|
|
42581
42581
|
const { savePage: t } = Wi1(), e = W2("autoSaveSupport", !0), c = W2("autoSaveInterval", 60);
|
|
42582
42582
|
GS(() => {
|
|
42583
42583
|
e && t();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-Z_BpKhVy.cjs"),s=require("./ChaiBuilderEditor-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-Z_BpKhVy.cjs"),s=require("./ChaiBuilderEditor-6o0IOkBV.cjs"),i=require("lodash-es"),j=require("sonner"),l=require("react"),o=require("./index-wnXwbbRk.cjs"),p=require("lucide-react"),f=require("react-i18next");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("clsx");require("react-dom");require("@radix-ui/react-scroll-area");require("@floating-ui/react-dom");require("jotai");require("i18next");require("flagged");require("./STRINGS-gPz7CUOk.cjs");require("./Functions-N3yhPYKY.cjs");require("tailwind-merge");require("@chaibuilder/runtime");require("@react-hookz/web");require("./MODIFIERS-YPHRtwrM.cjs");require("@radix-ui/react-toggle");require("class-variance-authority");require("./Class-Zc8hpE7f.cjs");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-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-quill");require("react-hotkeys-hook");require("lodash");require("./core.cjs");require("./html-to-json-VPWiWWGH.cjs");require("himalaya");const E=()=>{const{data:t}=o.useProject(),{data:u,isLoading:x}=o.usePages(),{saveState:d}=s.useSavePage(),m=o.useChangePage(),{t:q}=f.useTranslation(),[n,a]=o.useCurrentPage(),c=i.sortBy(i.filter(u,{type:"STATIC"}),r=>i.get(r,"uuid")===(t==null?void 0:t.homepage)?0:1);l.useEffect(()=>{!i.isEmpty(u)&&t.homepage&&!i.find(u,{uuid:n})&&a(t.homepage)},[n,u,t,a]),l.useEffect(()=>()=>a(null),[a]);const g=r=>{if(d!=="SAVED")j.toast.error(q("You have unsaved changes. Please save before changing the page."));else{const h=i.find(c,{uuid:r});m(h)}};return x||i.isEmpty(n)?null:e.jsxRuntimeExports.jsx("nav",{className:"flex rounded-lg border border-gray-200 bg-gray-50 px-3 py-1 pr-0 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:"mr-2 h-4 w-4"}),i.capitalize(t.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(s.Select,{value:n||"",onValueChange:g,children:[e.jsxRuntimeExports.jsx(s.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(s.SelectValue,{placeholder:"Page"})}),e.jsxRuntimeExports.jsx(s.SelectContent,{className:"z-[999]",children:i.map(c,r=>e.jsxRuntimeExports.jsx(s.SelectItem,{value:r.uuid,children:r==null?void 0:r.name},r.uuid))})]})]})})]})})};exports.default=E;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { j as e } from "./jsx-runtime-WbnYoNE9.js";
|
|
2
|
-
import { V as h, a6 as f, a7 as j, a8 as y, a9 as v, aa as P } from "./ChaiBuilderEditor-
|
|
2
|
+
import { V as h, a6 as f, a7 as j, a8 as y, a9 as v, aa as P } from "./ChaiBuilderEditor-VOCsboQ9.js";
|
|
3
3
|
import { sortBy as b, filter as w, get as C, isEmpty as m, find as n, capitalize as N, map as S } from "lodash-es";
|
|
4
4
|
import { toast as k } from "sonner";
|
|
5
5
|
import { useEffect as p } from "react";
|
|
6
|
-
import { a as B, u as E, c as T, d as V } from "./index-
|
|
6
|
+
import { a as B, u as E, c as T, d as V } from "./index-X3veo7pJ.js";
|
|
7
7
|
import { BriefcaseIcon as I } from "lucide-react";
|
|
8
8
|
import { useTranslation as L } from "react-i18next";
|
|
9
9
|
import "./_commonjsHelpers-UyOWmZb0.js";
|
|
@@ -46,7 +46,7 @@ import "react-quill";
|
|
|
46
46
|
import "react-hotkeys-hook";
|
|
47
47
|
import "lodash";
|
|
48
48
|
import "./core.js";
|
|
49
|
-
import "./html-to-json-
|
|
49
|
+
import "./html-to-json-Z6R2o_fA.js";
|
|
50
50
|
import "himalaya";
|
|
51
51
|
const Te = () => {
|
|
52
52
|
const { data: t } = B(), { data: i, isLoading: l } = E(), { saveState: c } = h(), d = T(), { t: u } = L(), [a, o] = V(), s = b(w(i, { type: "STATIC" }), (r) => C(r, "uuid") === (t == null ? void 0 : t.homepage) ? 0 : 1);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const jsxRuntime=require("./jsx-runtime-Z_BpKhVy.cjs"),React=require("react"),jotai=require("jotai"),web=require("@react-hookz/web"),reactArborist=require("react-arborist"),ui=require("./ChaiBuilderEditor-6o0IOkBV.cjs"),Functions=require("./Functions-N3yhPYKY.cjs"),reactIcons=require("@radix-ui/react-icons"),lucideReact=require("lucide-react"),lodashEs=require("lodash-es");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("clsx");require("react-dom");require("@radix-ui/react-scroll-area");require("@floating-ui/react-dom");require("i18next");require("react-i18next");require("flagged");require("./STRINGS-gPz7CUOk.cjs");require("@chaibuilder/runtime");require("./MODIFIERS-YPHRtwrM.cjs");require("@radix-ui/react-toggle");require("class-variance-authority");require("./Class-Zc8hpE7f.cjs");require("tailwind-merge");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-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-quill");require("react-hotkeys-hook");require("lodash");const TypeIcon=t=>{switch(t.type){case"Image":return jsxRuntime.jsxRuntimeExports.jsx(reactIcons.ImageIcon,{});case"Heading":return jsxRuntime.jsxRuntimeExports.jsx(reactIcons.HeadingIcon,{});case"Text":return jsxRuntime.jsxRuntimeExports.jsx(reactIcons.TextIcon,{});case"Link":return jsxRuntime.jsxRuntimeExports.jsx(reactIcons.Link1Icon,{});case"Video":return jsxRuntime.jsxRuntimeExports.jsx(reactIcons.VideoIcon,{});case"RichText":return jsxRuntime.jsxRuntimeExports.jsx(reactIcons.CursorTextIcon,{});case"Button":return jsxRuntime.jsxRuntimeExports.jsx(reactIcons.ButtonIcon,{});case"CustomHTML":return jsxRuntime.jsxRuntimeExports.jsx(reactIcons.CodeIcon,{});case"Divider":return jsxRuntime.jsxRuntimeExports.jsx(reactIcons.DividerHorizontalIcon,{});case"Icon":return jsxRuntime.jsxRuntimeExports.jsx(reactIcons.SketchLogoIcon,{});case"List":return jsxRuntime.jsxRuntimeExports.jsx(reactIcons.RowsIcon,{});case"Paragraph":return jsxRuntime.jsxRuntimeExports.jsx(reactIcons.TextIcon,{});case"Row":return jsxRuntime.jsxRuntimeExports.jsx(reactIcons.RowsIcon,{});case"ListItem":return jsxRuntime.jsxRuntimeExports.jsx(reactIcons.ColumnsIcon,{});case"LineBreak":return jsxRuntime.jsxRuntimeExports.jsx(reactIcons.SpaceBetweenVerticallyIcon,{});case"Form":return jsxRuntime.jsxRuntimeExports.jsx(reactIcons.GroupIcon,{});case"Checkbox":return jsxRuntime.jsxRuntimeExports.jsx(reactIcons.CheckboxIcon,{});case"FormButton":return jsxRuntime.jsxRuntimeExports.jsx(reactIcons.ButtonIcon,{});case"Input":case"TextArea":return jsxRuntime.jsxRuntimeExports.jsx(reactIcons.InputIcon,{});case"Radio":return jsxRuntime.jsxRuntimeExports.jsx(reactIcons.RadiobuttonIcon,{});case"Select":return jsxRuntime.jsxRuntimeExports.jsx(reactIcons.DropdownMenuIcon,{});case"Table":return jsxRuntime.jsxRuntimeExports.jsx(reactIcons.TableIcon,{});case"TableHead":return jsxRuntime.jsxRuntimeExports.jsx(reactIcons.BorderTopIcon,{});case"TableBody":return jsxRuntime.jsxRuntimeExports.jsx(reactIcons.BorderAllIcon,{});case"TableRow":return jsxRuntime.jsxRuntimeExports.jsx(reactIcons.ViewHorizontalIcon,{});case"TableCell":return jsxRuntime.jsxRuntimeExports.jsx(reactIcons.DragHandleHorizontalIcon,{});case"DataProvider":return jsxRuntime.jsxRuntimeExports.jsx(lucideReact.DatabaseIcon,{size:16});case"Box":return jsxRuntime.jsxRuntimeExports.jsx(reactIcons.BoxIcon,{});default:return jsxRuntime.jsxRuntimeExports.jsx(reactIcons.BoxModelIcon,{})}},placeholderStyle={display:"flex",alignItems:"center",zIndex:1},DefaultCursor=React.memo(function({top:r,left:n}){const o={position:"absolute",pointerEvents:"none",top:r+"px",left:n+"px",right:0};return jsxRuntime.jsxRuntimeExports.jsx("div",{style:{...placeholderStyle,...o},children:jsxRuntime.jsxRuntimeExports.jsx("div",{className:"h-0.5 flex-1 rounded-[1px] bg-green-500"})})}),Overlay=React.memo(function({children:r,isDragging:n}){return n?jsxRuntime.jsxRuntimeExports.jsx("div",{className:"pointer-events-none fixed left-0 top-0 z-[100] h-full w-full",children:r}):null}),DefaultDragPreview=React.memo(({id:t,isDragging:r,mouse:n})=>{const[o]=ui.useBlocksStore(),i=React.useMemo(()=>o.find(x=>x._id===t),[o,t]),a=React.useMemo(()=>({transform:`translate(${(n==null?void 0:n.x)-10}px, ${(n==null?void 0:n.y)-10}px)`}),[n]);return n?jsxRuntime.jsxRuntimeExports.jsx("div",{children:jsxRuntime.jsxRuntimeExports.jsx(Overlay,{isDragging:r,children:jsxRuntime.jsxRuntimeExports.jsx("div",{className:"pointer-events-none absolute z-50 rounded border border-gray-200 bg-gray-100/80 font-semibold text-blue-600 shadow-md dark:border-gray-700 dark:bg-gray-800",style:a,children:jsxRuntime.jsxRuntimeExports.jsxs("button",{type:"button",className:"flex !cursor-grab items-center p-0.5","aria-label":`Type: ${i==null?void 0:i._type}`,children:[jsxRuntime.jsxRuntimeExports.jsx("div",{className:"-mt-0.5 h-3 w-3",children:jsxRuntime.jsxRuntimeExports.jsx(TypeIcon,{type:i==null?void 0:i._type})}),jsxRuntime.jsxRuntimeExports.jsx("div",{className:"ml-2 truncate text-[11px]",children:(i==null?void 0:i._name)||(i==null?void 0:i._type)})]})})})}):jsxRuntime.jsxRuntimeExports.jsx("div",{className:"hidden"})}),RemoveBlocks=()=>{const[t]=ui.useSelectedBlockIds(),r=ui.useRemoveBlocks(),n=ui.useSelectedBlock();return jsxRuntime.jsxRuntimeExports.jsxs(ui.ContextMenuItem,{disabled:!ui.canDeleteBlock(n==null?void 0:n._type),className:"flex items-center gap-x-4 text-xs",onClick:()=>r(t),children:[jsxRuntime.jsxRuntimeExports.jsx(reactIcons.TrashIcon,{})," Remove"]})},BlockContextMenuContent=()=>{const[t]=ui.useSelectedBlockIds(),r=ui.useDuplicateBlocks(),n=ui.useSelectedBlock(),o=React.useCallback(()=>{r(t)},[t,r]);return jsxRuntime.jsxRuntimeExports.jsxs(ui.ContextMenuContent,{className:"text-xs",children:[jsxRuntime.jsxRuntimeExports.jsxs(ui.ContextMenuItem,{disabled:!ui.canDuplicateBlock(n==null?void 0:n._type),className:"flex items-center gap-x-4 text-xs",onClick:o,children:[jsxRuntime.jsxRuntimeExports.jsx(reactIcons.CopyIcon,{})," Duplicate"]}),jsxRuntime.jsxRuntimeExports.jsx(RemoveBlocks,{})]})},BlockContextMenu=({children:t})=>jsxRuntime.jsxRuntimeExports.jsx(jsxRuntime.jsxRuntimeExports.Fragment,{children:jsxRuntime.jsxRuntimeExports.jsxs(ui.ContextMenu,{children:[jsxRuntime.jsxRuntimeExports.jsx(ui.ContextMenuTrigger,{children:t}),jsxRuntime.jsxRuntimeExports.jsx(BlockContextMenuContent,{})]})}),defaultShortcuts=[{key:"ArrowDown",command:"selectNext"},{key:"ArrowUp",command:"selectPrev"},{key:"ArrowLeft",command:"selectParent",when:"isLeaf || isClosed"},{key:"ArrowLeft",command:"close",when:"isOpen"},{key:"ArrowRight",command:"open",when:"isClosed"},{key:"ArrowRight",command:"selectNext",when:"isOpen"},{key:"Home",command:"selectFirst"},{key:"End",command:"selectLast"}];function selectFirst(t){t.firstNode&&t.select(t.firstNode.id)}function selectLast(t){t.lastNode&&t.select(t.lastNode.id)}function selectNext(t){const r=t.selectedNodes[0].next||t.firstNode;t.select(r.id)}function selectPrev(t){const r=t.selectedNodes[0].prev||t.lastNode;t.select(r.id)}const selectParent=(t,r)=>{const n=t.selectedIds[0].parent;n&&r&&t.select(n.id)},open=(t,r)=>{const n=t.selectedNodes[0];n.isInternal&&r&&n.open()},close=(t,r)=>{const n=t.selectedNodes[0];n.isInternal&&r&&n.close()},Node=React.memo(({node:t,style:r,dragHandle:n})=>{const o=ui.useBuilderProp("outlineMenuItems",[]),[,i]=ui.useHighlightBlockId(),a=t.children.length>0,{id:x,data:c,isSelected:m,willReceiveDrop:l,isDragging:d,isEditing:j,handleClick:p}=t,R=web.useDebouncedCallback(u=>i(u),[],300),f=u=>{u.stopPropagation(),t.toggle()},h=u=>{u.stopPropagation(),t.isOpen||t.toggle(),p(u)};return React.useEffect(()=>{const u=setTimeout(()=>{l&&!t.isOpen&&t.toggle()},500);return()=>clearTimeout(u)},[l,t]),jsxRuntime.jsxRuntimeExports.jsx(BlockContextMenu,{id:x,children:jsxRuntime.jsxRuntimeExports.jsxs("div",{onClick:h,onMouseEnter:()=>R(x),style:r,"data-node-id":x,ref:n,className:Functions.cn("group flex !h-fit w-full items-center justify-between space-x-px py-px outline-none",m?"bg-blue-500 text-white":"text-gray-600 hover:bg-gray-200 dark:hover:bg-gray-800",l&&ui.canAcceptChildBlock(c._type,"Icon")?"bg-green-200":"",d&&"opacity-20"),children:[jsxRuntime.jsxRuntimeExports.jsxs("div",{className:"flex items-center",children:[jsxRuntime.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:a&&jsxRuntime.jsxRuntimeExports.jsx("button",{onClick:f,type:"button",children:jsxRuntime.jsxRuntimeExports.jsx(reactIcons.TriangleRightIcon,{})})}),jsxRuntime.jsxRuntimeExports.jsxs("div",{className:"flex items-center",children:[jsxRuntime.jsxRuntimeExports.jsx("div",{className:"-mt-0.5 h-3 w-3",children:jsxRuntime.jsxRuntimeExports.jsx(TypeIcon,{type:c==null?void 0:c._type})}),j?jsxRuntime.jsxRuntimeExports.jsx(Input,{node:t}):jsxRuntime.jsxRuntimeExports.jsx("div",{className:"ml-2 truncate text-[11px]",onDoubleClick:u=>{u.stopPropagation(),t.edit(),t.deselect()},children:(c==null?void 0:c._name)||(c==null?void 0:c._type.split("/").pop())})]})]}),jsxRuntime.jsxRuntimeExports.jsx("div",{className:"invisible flex items-center space-x-1 pr-2 group-hover:visible",children:o.map(u=>jsxRuntime.jsxRuntimeExports.jsxs(ui.Tooltip,{children:[jsxRuntime.jsxRuntimeExports.jsx(ui.TooltipTrigger,{className:"cursor-pointer rounded bg-transparent hover:bg-white hover:text-blue-500",asChild:!0,children:React.createElement(u.item,{blockId:x})}),jsxRuntime.jsxRuntimeExports.jsx(ui.TooltipContent,{className:"z-[9999]",children:u.tooltip})]}))})]})})}),Input=({node:t})=>{var r,n;return jsxRuntime.jsxRuntimeExports.jsx("input",{autoFocus:!0,className:"ml-2 w-full rounded-sm border border-black/30 bg-transparent px-1 text-[11px] outline-none",type:"text",defaultValue:((r=t.data)==null?void 0:r._name)||((n=t.data)==null?void 0:n._type),onFocus:o=>o.currentTarget.select(),onBlur:o=>t.submit(o.currentTarget.value),onKeyDown:o=>{o.key==="Enter"&&t.submit(o.currentTarget.value)}})},useCanMove=()=>{const[t]=ui.useBlocksStore();return(r,n)=>{var a;const o=(a=lodashEs.find(t,{_id:n}))==null?void 0:a._type,i=lodashEs.first(r.map(x=>{var c;return(c=lodashEs.find(t,{_id:x}))==null?void 0:c._type}));return ui.canAcceptChildBlock(o,i)}},ListTree=()=>{const[treeData]=jotai.useAtom(ui.treeDSBlocks),[ids,setIds]=ui.useSelectedBlockIds(),updateBlockProps=ui.useUpdateBlocksProps(),[,setStyleBlocks]=ui.useSelectedStylingBlocks(),{moveBlocks}=ui.useBlocksStoreUndoableActions(),canMove=useCanMove(),treeRef=React.useRef(null),[,setTreeRef]=jotai.useAtom(ui.treeRefAtom),clearSelection=()=>{setIds([]),setStyleBlocks([])};React.useEffect(()=>{setTreeRef(treeRef.current)},[treeRef.current]);const onRename=({id:t,name:r,node:n})=>{updateBlockProps([t],{_name:r},n.data._name)},onMove=({dragIds:t,parentId:r,index:n})=>{canMove(t,r)&&moveBlocks(t,r,n)},onSelect=t=>{if(t.length===0)return;const r=t[0]?t[0].id:"";setStyleBlocks([]),setIds([r])},onContextMenu=t=>{var o;t.preventDefault();const r=t.target,n=r.getAttribute("data-node-id")||((o=r.closest("[data-node-id]"))==null?void 0:o.getAttribute("data-node-id"));n&&(setStyleBlocks([]),setIds([n]))},debouncedDisableDrop=web.useDebouncedCallback(({parentNode:t,dragNodes:r})=>{var n;return!ui.canAcceptChildBlock(t==null?void 0:t.data._type,(n=r[0])==null?void 0:n.data._type)},[],300),handleKeyDown=e=>{if(!treeRef.current)return;const tree=treeRef.current,selectedNode=tree.selectedNodes[0];if(!selectedNode)return;const isLeaf=!selectedNode.isInternal,isClosed=!selectedNode.isOpen,isOpen=selectedNode.isOpen,shortcut=defaultShortcuts.find(s=>s.key===e.key&&(!s.when||eval(s.when)));if(shortcut)switch(e.preventDefault(),shortcut.command){case"selectNext":selectNext(tree);break;case"selectPrev":selectPrev(tree);break;case"selectParent":selectParent(tree,isLeaf||isClosed);break;case"close":close(tree,isOpen);break;case"open":open(tree,isClosed);break;case"selectFirst":selectFirst(tree);break;case"selectLast":selectLast(tree);break;default:break}};return React.useEffect(()=>{if(ids[0]&&treeRef.current){const t=treeRef.current.get(ids[0]);t&&(t.select(),setIds[t.id],setStyleBlocks([]))}return window.addEventListener("keydown",handleKeyDown),()=>{window.removeEventListener("keydown",handleKeyDown)}},[treeRef]),jsxRuntime.jsxRuntimeExports.jsx("div",{className:Functions.cn("-mx-1 -mt-1 flex h-full select-none flex-col space-y-1"),onClick:()=>clearSelection(),children:jsxRuntime.jsxRuntimeExports.jsx("div",{id:"outline-view",className:"no-scrollbar h-full overflow-y-auto p-1 px-2 text-xs",children:jsxRuntime.jsxRuntimeExports.jsx(reactArborist.Tree,{ref:treeRef,height:800,className:"no-scrollbar !h-full max-w-full !overflow-y-auto !overflow-x-hidden",selection:ids[0]||"",onRename,openByDefault:!1,onMove,rowHeight:20,data:treeData,renderCursor:DefaultCursor,onSelect,childrenAccessor:t=>t.children,width:"100%",renderDragPreview:DefaultDragPreview,indent:10,onContextMenu,disableDrop:debouncedDisableDrop,idAccessor:"_id",children:Node})})})};exports.default=ListTree;
|
|
@@ -0,0 +1,396 @@
|
|
|
1
|
+
import { j as jsxRuntimeExports } from "./jsx-runtime-WbnYoNE9.js";
|
|
2
|
+
import React__default, { memo, useMemo, useCallback, useEffect, useRef } from "react";
|
|
3
|
+
import { useAtom } from "jotai";
|
|
4
|
+
import { useDebouncedCallback } from "@react-hookz/web";
|
|
5
|
+
import { Tree } from "react-arborist";
|
|
6
|
+
import { i as useBlocksStore, L as useSelectedBlockIds, H as useRemoveBlocks, M as useSelectedBlock, bp as ContextMenuItem, aJ as canDeleteBlock, w as useDuplicateBlocks, bq as ContextMenuContent, aI as canDuplicateBlock, br as ContextMenu, bs as ContextMenuTrigger, h as useBuilderProp, z as useHighlightBlockId, bt as canAcceptChildBlock, ac as Tooltip, ad as TooltipTrigger, ae as TooltipContent, bu as treeDSBlocks, Q as useUpdateBlocksProps, Y as useSelectedStylingBlocks, aB as useBlocksStoreUndoableActions, aF as treeRefAtom } from "./ChaiBuilderEditor-VOCsboQ9.js";
|
|
7
|
+
import { c as cn } from "./Functions-7jnEwJyw.js";
|
|
8
|
+
import { BoxModelIcon, BoxIcon, DragHandleHorizontalIcon, ViewHorizontalIcon, BorderAllIcon, BorderTopIcon, TableIcon, DropdownMenuIcon, RadiobuttonIcon, InputIcon, ButtonIcon, CheckboxIcon, GroupIcon, SpaceBetweenVerticallyIcon, ColumnsIcon, RowsIcon, TextIcon, SketchLogoIcon, DividerHorizontalIcon, CodeIcon, CursorTextIcon, VideoIcon, Link1Icon, HeadingIcon, ImageIcon, TrashIcon, CopyIcon, TriangleRightIcon } from "@radix-ui/react-icons";
|
|
9
|
+
import { DatabaseIcon } from "lucide-react";
|
|
10
|
+
import { find, first } from "lodash-es";
|
|
11
|
+
import "./_commonjsHelpers-UyOWmZb0.js";
|
|
12
|
+
import "clsx";
|
|
13
|
+
import "react-dom";
|
|
14
|
+
import "@radix-ui/react-scroll-area";
|
|
15
|
+
import "@floating-ui/react-dom";
|
|
16
|
+
import "i18next";
|
|
17
|
+
import "react-i18next";
|
|
18
|
+
import "flagged";
|
|
19
|
+
import "./STRINGS--j49GZJP.js";
|
|
20
|
+
import "@chaibuilder/runtime";
|
|
21
|
+
import "./MODIFIERS-cBT31iqE.js";
|
|
22
|
+
import "@radix-ui/react-toggle";
|
|
23
|
+
import "class-variance-authority";
|
|
24
|
+
import "./Class-6Hz2KzYb.js";
|
|
25
|
+
import "tailwind-merge";
|
|
26
|
+
import "@radix-ui/react-switch";
|
|
27
|
+
import "@radix-ui/react-slot";
|
|
28
|
+
import "@radix-ui/react-accordion";
|
|
29
|
+
import "@radix-ui/react-alert-dialog";
|
|
30
|
+
import "@radix-ui/react-dialog";
|
|
31
|
+
import "@radix-ui/react-label";
|
|
32
|
+
import "@radix-ui/react-tabs";
|
|
33
|
+
import "@radix-ui/react-tooltip";
|
|
34
|
+
import "@radix-ui/react-popover";
|
|
35
|
+
import "@radix-ui/react-menubar";
|
|
36
|
+
import "@radix-ui/react-hover-card";
|
|
37
|
+
import "@radix-ui/react-select";
|
|
38
|
+
import "@radix-ui/react-dropdown-menu";
|
|
39
|
+
import "@radix-ui/react-separator";
|
|
40
|
+
import "@radix-ui/react-toast";
|
|
41
|
+
import "cmdk";
|
|
42
|
+
import "@radix-ui/react-context-menu";
|
|
43
|
+
import "react-icons-picker";
|
|
44
|
+
import "react-quill";
|
|
45
|
+
import "react-hotkeys-hook";
|
|
46
|
+
import "lodash";
|
|
47
|
+
const TypeIcon = (t) => {
|
|
48
|
+
switch (t.type) {
|
|
49
|
+
case "Image":
|
|
50
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(ImageIcon, {});
|
|
51
|
+
case "Heading":
|
|
52
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(HeadingIcon, {});
|
|
53
|
+
case "Text":
|
|
54
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(TextIcon, {});
|
|
55
|
+
case "Link":
|
|
56
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(Link1Icon, {});
|
|
57
|
+
case "Video":
|
|
58
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(VideoIcon, {});
|
|
59
|
+
case "RichText":
|
|
60
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(CursorTextIcon, {});
|
|
61
|
+
case "Button":
|
|
62
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(ButtonIcon, {});
|
|
63
|
+
case "CustomHTML":
|
|
64
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(CodeIcon, {});
|
|
65
|
+
case "Divider":
|
|
66
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(DividerHorizontalIcon, {});
|
|
67
|
+
case "Icon":
|
|
68
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(SketchLogoIcon, {});
|
|
69
|
+
case "List":
|
|
70
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(RowsIcon, {});
|
|
71
|
+
case "Paragraph":
|
|
72
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(TextIcon, {});
|
|
73
|
+
case "Row":
|
|
74
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(RowsIcon, {});
|
|
75
|
+
case "ListItem":
|
|
76
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(ColumnsIcon, {});
|
|
77
|
+
case "LineBreak":
|
|
78
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(SpaceBetweenVerticallyIcon, {});
|
|
79
|
+
case "Form":
|
|
80
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(GroupIcon, {});
|
|
81
|
+
case "Checkbox":
|
|
82
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(CheckboxIcon, {});
|
|
83
|
+
case "FormButton":
|
|
84
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(ButtonIcon, {});
|
|
85
|
+
case "Input":
|
|
86
|
+
case "TextArea":
|
|
87
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(InputIcon, {});
|
|
88
|
+
case "Radio":
|
|
89
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(RadiobuttonIcon, {});
|
|
90
|
+
case "Select":
|
|
91
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(DropdownMenuIcon, {});
|
|
92
|
+
case "Table":
|
|
93
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(TableIcon, {});
|
|
94
|
+
case "TableHead":
|
|
95
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(BorderTopIcon, {});
|
|
96
|
+
case "TableBody":
|
|
97
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(BorderAllIcon, {});
|
|
98
|
+
case "TableRow":
|
|
99
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(ViewHorizontalIcon, {});
|
|
100
|
+
case "TableCell":
|
|
101
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(DragHandleHorizontalIcon, {});
|
|
102
|
+
case "DataProvider":
|
|
103
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(DatabaseIcon, { size: 16 });
|
|
104
|
+
case "Box":
|
|
105
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(BoxIcon, {});
|
|
106
|
+
default:
|
|
107
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(BoxModelIcon, {});
|
|
108
|
+
}
|
|
109
|
+
}, placeholderStyle = {
|
|
110
|
+
display: "flex",
|
|
111
|
+
alignItems: "center",
|
|
112
|
+
zIndex: 1
|
|
113
|
+
}, DefaultCursor = React__default.memo(function({ top: n, left: o }) {
|
|
114
|
+
const r = {
|
|
115
|
+
position: "absolute",
|
|
116
|
+
pointerEvents: "none",
|
|
117
|
+
top: n + "px",
|
|
118
|
+
left: o + "px",
|
|
119
|
+
right: 0
|
|
120
|
+
};
|
|
121
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { style: { ...placeholderStyle, ...r }, children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "h-0.5 flex-1 rounded-[1px] bg-green-500" }) });
|
|
122
|
+
}), Overlay = memo(function({ children: n, isDragging: o }) {
|
|
123
|
+
return o ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "pointer-events-none fixed left-0 top-0 z-[100] h-full w-full", children: n }) : null;
|
|
124
|
+
}), DefaultDragPreview = memo(({ id: t, isDragging: n, mouse: o }) => {
|
|
125
|
+
const [r] = useBlocksStore(), c = useMemo(() => r.find((a) => a._id === t), [r, t]), u = useMemo(
|
|
126
|
+
() => ({
|
|
127
|
+
transform: `translate(${(o == null ? void 0 : o.x) - 10}px, ${(o == null ? void 0 : o.y) - 10}px)`
|
|
128
|
+
}),
|
|
129
|
+
[o]
|
|
130
|
+
);
|
|
131
|
+
return o ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: /* @__PURE__ */ jsxRuntimeExports.jsx(Overlay, { isDragging: n, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
132
|
+
"div",
|
|
133
|
+
{
|
|
134
|
+
className: "pointer-events-none absolute z-50 rounded border border-gray-200 bg-gray-100/80 font-semibold text-blue-600 shadow-md dark:border-gray-700 dark:bg-gray-800",
|
|
135
|
+
style: u,
|
|
136
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsxs("button", { type: "button", className: "flex !cursor-grab items-center p-0.5", "aria-label": `Type: ${c == null ? void 0 : c._type}`, children: [
|
|
137
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "-mt-0.5 h-3 w-3", children: /* @__PURE__ */ jsxRuntimeExports.jsx(TypeIcon, { type: c == null ? void 0 : c._type }) }),
|
|
138
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "ml-2 truncate text-[11px]", children: (c == null ? void 0 : c._name) || (c == null ? void 0 : c._type) })
|
|
139
|
+
] })
|
|
140
|
+
}
|
|
141
|
+
) }) }) : /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "hidden" });
|
|
142
|
+
}), RemoveBlocks = () => {
|
|
143
|
+
const [t] = useSelectedBlockIds(), n = useRemoveBlocks(), o = useSelectedBlock();
|
|
144
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
145
|
+
ContextMenuItem,
|
|
146
|
+
{
|
|
147
|
+
disabled: !canDeleteBlock(o == null ? void 0 : o._type),
|
|
148
|
+
className: "flex items-center gap-x-4 text-xs",
|
|
149
|
+
onClick: () => n(t),
|
|
150
|
+
children: [
|
|
151
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(TrashIcon, {}),
|
|
152
|
+
" Remove"
|
|
153
|
+
]
|
|
154
|
+
}
|
|
155
|
+
);
|
|
156
|
+
}, BlockContextMenuContent = () => {
|
|
157
|
+
const [t] = useSelectedBlockIds(), n = useDuplicateBlocks(), o = useSelectedBlock(), r = useCallback(() => {
|
|
158
|
+
n(t);
|
|
159
|
+
}, [t, n]);
|
|
160
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs(ContextMenuContent, { className: "text-xs", children: [
|
|
161
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
162
|
+
ContextMenuItem,
|
|
163
|
+
{
|
|
164
|
+
disabled: !canDuplicateBlock(o == null ? void 0 : o._type),
|
|
165
|
+
className: "flex items-center gap-x-4 text-xs",
|
|
166
|
+
onClick: r,
|
|
167
|
+
children: [
|
|
168
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(CopyIcon, {}),
|
|
169
|
+
" Duplicate"
|
|
170
|
+
]
|
|
171
|
+
}
|
|
172
|
+
),
|
|
173
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(RemoveBlocks, {})
|
|
174
|
+
] });
|
|
175
|
+
}, BlockContextMenu = ({ children: t }) => /* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: /* @__PURE__ */ jsxRuntimeExports.jsxs(ContextMenu, { children: [
|
|
176
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(ContextMenuTrigger, { children: t }),
|
|
177
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(BlockContextMenuContent, {})
|
|
178
|
+
] }) }), defaultShortcuts = [
|
|
179
|
+
{ key: "ArrowDown", command: "selectNext" },
|
|
180
|
+
{ key: "ArrowUp", command: "selectPrev" },
|
|
181
|
+
{ key: "ArrowLeft", command: "selectParent", when: "isLeaf || isClosed" },
|
|
182
|
+
{ key: "ArrowLeft", command: "close", when: "isOpen" },
|
|
183
|
+
{ key: "ArrowRight", command: "open", when: "isClosed" },
|
|
184
|
+
{ key: "ArrowRight", command: "selectNext", when: "isOpen" },
|
|
185
|
+
{ key: "Home", command: "selectFirst" },
|
|
186
|
+
{ key: "End", command: "selectLast" }
|
|
187
|
+
];
|
|
188
|
+
function selectFirst(t) {
|
|
189
|
+
t.firstNode && t.select(t.firstNode.id);
|
|
190
|
+
}
|
|
191
|
+
function selectLast(t) {
|
|
192
|
+
t.lastNode && t.select(t.lastNode.id);
|
|
193
|
+
}
|
|
194
|
+
function selectNext(t) {
|
|
195
|
+
const n = t.selectedNodes[0].next || t.firstNode;
|
|
196
|
+
t.select(n.id);
|
|
197
|
+
}
|
|
198
|
+
function selectPrev(t) {
|
|
199
|
+
const n = t.selectedNodes[0].prev || t.lastNode;
|
|
200
|
+
t.select(n.id);
|
|
201
|
+
}
|
|
202
|
+
const selectParent = (t, n) => {
|
|
203
|
+
const o = t.selectedIds[0].parent;
|
|
204
|
+
o && n && t.select(o.id);
|
|
205
|
+
}, open = (t, n) => {
|
|
206
|
+
const o = t.selectedNodes[0];
|
|
207
|
+
o.isInternal && n && o.open();
|
|
208
|
+
}, close = (t, n) => {
|
|
209
|
+
const o = t.selectedNodes[0];
|
|
210
|
+
o.isInternal && n && o.close();
|
|
211
|
+
}, Node = memo(({ node: t, style: n, dragHandle: o }) => {
|
|
212
|
+
const r = useBuilderProp("outlineMenuItems", []), [, c] = useHighlightBlockId(), u = t.children.length > 0, { id: a, data: i, isSelected: p, willReceiveDrop: x, isDragging: d, isEditing: m, handleClick: j } = t, f = useDebouncedCallback((l) => c(l), [], 300), R = (l) => {
|
|
213
|
+
l.stopPropagation(), t.toggle();
|
|
214
|
+
}, h = (l) => {
|
|
215
|
+
l.stopPropagation(), t.isOpen || t.toggle(), j(l);
|
|
216
|
+
};
|
|
217
|
+
return useEffect(() => {
|
|
218
|
+
const l = setTimeout(() => {
|
|
219
|
+
x && !t.isOpen && t.toggle();
|
|
220
|
+
}, 500);
|
|
221
|
+
return () => clearTimeout(l);
|
|
222
|
+
}, [x, t]), /* @__PURE__ */ jsxRuntimeExports.jsx(BlockContextMenu, { id: a, children: /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
223
|
+
"div",
|
|
224
|
+
{
|
|
225
|
+
onClick: h,
|
|
226
|
+
onMouseEnter: () => f(a),
|
|
227
|
+
style: n,
|
|
228
|
+
"data-node-id": a,
|
|
229
|
+
ref: o,
|
|
230
|
+
className: cn(
|
|
231
|
+
"group flex !h-fit w-full items-center justify-between space-x-px py-px outline-none",
|
|
232
|
+
p ? "bg-blue-500 text-white" : "text-gray-600 hover:bg-gray-200 dark:hover:bg-gray-800",
|
|
233
|
+
x && canAcceptChildBlock(i._type, "Icon") ? "bg-green-200" : "",
|
|
234
|
+
d && "opacity-20"
|
|
235
|
+
),
|
|
236
|
+
children: [
|
|
237
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center", children: [
|
|
238
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
239
|
+
"div",
|
|
240
|
+
{
|
|
241
|
+
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" : ""}`,
|
|
242
|
+
children: u && /* @__PURE__ */ jsxRuntimeExports.jsx("button", { onClick: R, type: "button", children: /* @__PURE__ */ jsxRuntimeExports.jsx(TriangleRightIcon, {}) })
|
|
243
|
+
}
|
|
244
|
+
),
|
|
245
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center", children: [
|
|
246
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "-mt-0.5 h-3 w-3", children: /* @__PURE__ */ jsxRuntimeExports.jsx(TypeIcon, { type: i == null ? void 0 : i._type }) }),
|
|
247
|
+
m ? /* @__PURE__ */ jsxRuntimeExports.jsx(Input, { node: t }) : /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
248
|
+
"div",
|
|
249
|
+
{
|
|
250
|
+
className: "ml-2 truncate text-[11px]",
|
|
251
|
+
onDoubleClick: (l) => {
|
|
252
|
+
l.stopPropagation(), t.edit(), t.deselect();
|
|
253
|
+
},
|
|
254
|
+
children: (i == null ? void 0 : i._name) || (i == null ? void 0 : i._type.split("/").pop())
|
|
255
|
+
}
|
|
256
|
+
)
|
|
257
|
+
] })
|
|
258
|
+
] }),
|
|
259
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "invisible flex items-center space-x-1 pr-2 group-hover:visible", children: r.map((l) => /* @__PURE__ */ jsxRuntimeExports.jsxs(Tooltip, { children: [
|
|
260
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
261
|
+
TooltipTrigger,
|
|
262
|
+
{
|
|
263
|
+
className: "cursor-pointer rounded bg-transparent hover:bg-white hover:text-blue-500",
|
|
264
|
+
asChild: !0,
|
|
265
|
+
children: React__default.createElement(l.item, { blockId: a })
|
|
266
|
+
}
|
|
267
|
+
),
|
|
268
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(TooltipContent, { className: "z-[9999]", children: l.tooltip })
|
|
269
|
+
] })) })
|
|
270
|
+
]
|
|
271
|
+
}
|
|
272
|
+
) });
|
|
273
|
+
}), Input = ({ node: t }) => {
|
|
274
|
+
var n, o;
|
|
275
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
276
|
+
"input",
|
|
277
|
+
{
|
|
278
|
+
autoFocus: !0,
|
|
279
|
+
className: "ml-2 w-full rounded-sm border border-black/30 bg-transparent px-1 text-[11px] outline-none",
|
|
280
|
+
type: "text",
|
|
281
|
+
defaultValue: ((n = t.data) == null ? void 0 : n._name) || ((o = t.data) == null ? void 0 : o._type),
|
|
282
|
+
onFocus: (r) => r.currentTarget.select(),
|
|
283
|
+
onBlur: (r) => t.submit(r.currentTarget.value),
|
|
284
|
+
onKeyDown: (r) => {
|
|
285
|
+
r.key === "Enter" && t.submit(r.currentTarget.value);
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
);
|
|
289
|
+
}, useCanMove = () => {
|
|
290
|
+
const [t] = useBlocksStore();
|
|
291
|
+
return (n, o) => {
|
|
292
|
+
var u;
|
|
293
|
+
const r = (u = find(t, { _id: o })) == null ? void 0 : u._type, c = first(n.map((a) => {
|
|
294
|
+
var i;
|
|
295
|
+
return (i = find(t, { _id: a })) == null ? void 0 : i._type;
|
|
296
|
+
}));
|
|
297
|
+
return canAcceptChildBlock(r, c);
|
|
298
|
+
};
|
|
299
|
+
}, ListTree = () => {
|
|
300
|
+
const [treeData] = useAtom(treeDSBlocks), [ids, setIds] = useSelectedBlockIds(), updateBlockProps = useUpdateBlocksProps(), [, setStyleBlocks] = useSelectedStylingBlocks(), { moveBlocks } = useBlocksStoreUndoableActions(), canMove = useCanMove(), treeRef = useRef(null), [, setTreeRef] = useAtom(treeRefAtom), clearSelection = () => {
|
|
301
|
+
setIds([]), setStyleBlocks([]);
|
|
302
|
+
};
|
|
303
|
+
useEffect(() => {
|
|
304
|
+
setTreeRef(treeRef.current);
|
|
305
|
+
}, [treeRef.current]);
|
|
306
|
+
const onRename = ({ id: t, name: n, node: o }) => {
|
|
307
|
+
updateBlockProps([t], { _name: n }, o.data._name);
|
|
308
|
+
}, onMove = ({ dragIds: t, parentId: n, index: o }) => {
|
|
309
|
+
canMove(t, n) && moveBlocks(t, n, o);
|
|
310
|
+
}, onSelect = (t) => {
|
|
311
|
+
if (t.length === 0)
|
|
312
|
+
return;
|
|
313
|
+
const n = t[0] ? t[0].id : "";
|
|
314
|
+
setStyleBlocks([]), setIds([n]);
|
|
315
|
+
}, onContextMenu = (t) => {
|
|
316
|
+
var r;
|
|
317
|
+
t.preventDefault();
|
|
318
|
+
const n = t.target, o = n.getAttribute("data-node-id") || ((r = n.closest("[data-node-id]")) == null ? void 0 : r.getAttribute("data-node-id"));
|
|
319
|
+
o && (setStyleBlocks([]), setIds([o]));
|
|
320
|
+
}, debouncedDisableDrop = useDebouncedCallback(
|
|
321
|
+
({ parentNode: t, dragNodes: n }) => {
|
|
322
|
+
var o;
|
|
323
|
+
return !canAcceptChildBlock(t == null ? void 0 : t.data._type, (o = n[0]) == null ? void 0 : o.data._type);
|
|
324
|
+
},
|
|
325
|
+
[],
|
|
326
|
+
300
|
|
327
|
+
), handleKeyDown = (e) => {
|
|
328
|
+
if (!treeRef.current)
|
|
329
|
+
return;
|
|
330
|
+
const tree = treeRef.current, selectedNode = tree.selectedNodes[0];
|
|
331
|
+
if (!selectedNode)
|
|
332
|
+
return;
|
|
333
|
+
const isLeaf = !selectedNode.isInternal, isClosed = !selectedNode.isOpen, isOpen = selectedNode.isOpen, shortcut = defaultShortcuts.find((s) => s.key === e.key && (!s.when || eval(s.when)));
|
|
334
|
+
if (shortcut)
|
|
335
|
+
switch (e.preventDefault(), shortcut.command) {
|
|
336
|
+
case "selectNext":
|
|
337
|
+
selectNext(tree);
|
|
338
|
+
break;
|
|
339
|
+
case "selectPrev":
|
|
340
|
+
selectPrev(tree);
|
|
341
|
+
break;
|
|
342
|
+
case "selectParent":
|
|
343
|
+
selectParent(tree, isLeaf || isClosed);
|
|
344
|
+
break;
|
|
345
|
+
case "close":
|
|
346
|
+
close(tree, isOpen);
|
|
347
|
+
break;
|
|
348
|
+
case "open":
|
|
349
|
+
open(tree, isClosed);
|
|
350
|
+
break;
|
|
351
|
+
case "selectFirst":
|
|
352
|
+
selectFirst(tree);
|
|
353
|
+
break;
|
|
354
|
+
case "selectLast":
|
|
355
|
+
selectLast(tree);
|
|
356
|
+
break;
|
|
357
|
+
default:
|
|
358
|
+
break;
|
|
359
|
+
}
|
|
360
|
+
};
|
|
361
|
+
return useEffect(() => {
|
|
362
|
+
if (ids[0] && treeRef.current) {
|
|
363
|
+
const t = treeRef.current.get(ids[0]);
|
|
364
|
+
t && (t.select(), setIds[t.id], setStyleBlocks([]));
|
|
365
|
+
}
|
|
366
|
+
return window.addEventListener("keydown", handleKeyDown), () => {
|
|
367
|
+
window.removeEventListener("keydown", handleKeyDown);
|
|
368
|
+
};
|
|
369
|
+
}, [treeRef]), /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: cn("-mx-1 -mt-1 flex h-full select-none flex-col space-y-1"), onClick: () => clearSelection(), children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { id: "outline-view", className: "no-scrollbar h-full overflow-y-auto p-1 px-2 text-xs", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
370
|
+
Tree,
|
|
371
|
+
{
|
|
372
|
+
ref: treeRef,
|
|
373
|
+
height: 800,
|
|
374
|
+
className: "no-scrollbar !h-full max-w-full !overflow-y-auto !overflow-x-hidden",
|
|
375
|
+
selection: ids[0] || "",
|
|
376
|
+
onRename,
|
|
377
|
+
openByDefault: !1,
|
|
378
|
+
onMove,
|
|
379
|
+
rowHeight: 20,
|
|
380
|
+
data: treeData,
|
|
381
|
+
renderCursor: DefaultCursor,
|
|
382
|
+
onSelect,
|
|
383
|
+
childrenAccessor: (t) => t.children,
|
|
384
|
+
width: "100%",
|
|
385
|
+
renderDragPreview: DefaultDragPreview,
|
|
386
|
+
indent: 10,
|
|
387
|
+
onContextMenu,
|
|
388
|
+
disableDrop: debouncedDisableDrop,
|
|
389
|
+
idAccessor: "_id",
|
|
390
|
+
children: Node
|
|
391
|
+
}
|
|
392
|
+
) }) });
|
|
393
|
+
};
|
|
394
|
+
export {
|
|
395
|
+
ListTree as default
|
|
396
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-Z_BpKhVy.cjs"),u=require("react"),i=require("lodash-es"),s=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-Z_BpKhVy.cjs"),u=require("react"),i=require("lodash-es"),s=require("./index-wnXwbbRk.cjs");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("./core.cjs");require("./ChaiBuilderEditor-6o0IOkBV.cjs");require("clsx");require("react-dom");require("@radix-ui/react-scroll-area");require("@floating-ui/react-dom");require("jotai");require("i18next");require("react-i18next");require("flagged");require("./STRINGS-gPz7CUOk.cjs");require("./Functions-N3yhPYKY.cjs");require("tailwind-merge");require("@chaibuilder/runtime");require("@react-hookz/web");require("./MODIFIERS-YPHRtwrM.cjs");require("@radix-ui/react-toggle");require("class-variance-authority");require("./Class-Zc8hpE7f.cjs");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-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-quill");require("react-hotkeys-hook");require("lodash");require("lucide-react");require("sonner");require("./html-to-json-VPWiWWGH.cjs");require("himalaya");const a=u.lazy(()=>Promise.resolve().then(()=>require("./add-page-modal-jzDXOPVp.cjs"))),x=u.lazy(()=>Promise.resolve().then(()=>require("./page-viewer-HGX57lyj.cjs"))),d=()=>{const{data:t=[],isLoading:q}=s.usePages(),{data:r}=s.useProject(),n=i.sortBy(i.filter(t,{type:"STATIC"}),o=>i.get(o,"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(u.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:q,pages:n})})]})};exports.default=d;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { j as t } from "./jsx-runtime-WbnYoNE9.js";
|
|
2
2
|
import i, { Suspense as s } from "react";
|
|
3
3
|
import { sortBy as a, filter as d, get as n } from "lodash-es";
|
|
4
|
-
import { u as l, a as c } from "./index-
|
|
4
|
+
import { u as l, a as c } from "./index-X3veo7pJ.js";
|
|
5
5
|
import "./_commonjsHelpers-UyOWmZb0.js";
|
|
6
6
|
import "./core.js";
|
|
7
|
-
import "./ChaiBuilderEditor-
|
|
7
|
+
import "./ChaiBuilderEditor-VOCsboQ9.js";
|
|
8
8
|
import "clsx";
|
|
9
9
|
import "react-dom";
|
|
10
10
|
import "@radix-ui/react-scroll-area";
|
|
@@ -46,9 +46,9 @@ import "react-hotkeys-hook";
|
|
|
46
46
|
import "lodash";
|
|
47
47
|
import "lucide-react";
|
|
48
48
|
import "sonner";
|
|
49
|
-
import "./html-to-json-
|
|
49
|
+
import "./html-to-json-Z6R2o_fA.js";
|
|
50
50
|
import "himalaya";
|
|
51
|
-
const x = i.lazy(() => import("./add-page-modal-
|
|
51
|
+
const x = i.lazy(() => import("./add-page-modal-9SkVr8qi.js")), u = i.lazy(() => import("./page-viewer-jsyCYHKL.js")), lt = () => {
|
|
52
52
|
const { data: o = [], isLoading: m } = l(), { data: r } = c(), p = a(d(o, { type: "STATIC" }), (e) => n(e, "uuid") === (r == null ? void 0 : r.homepage) ? 0 : 1);
|
|
53
53
|
return /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
|
|
54
54
|
/* @__PURE__ */ t.jsxs("div", { className: "flex items-center justify-between rounded-md bg-background/30 p-1", children: [
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { j as t } from "./jsx-runtime-WbnYoNE9.js";
|
|
2
2
|
import m, { useRef as x, useEffect as a, Suspense as p } from "react";
|
|
3
3
|
import { isEqual as b, isEmpty as j } from "lodash-es";
|
|
4
|
-
import { b3 as f, b4 as n, b5 as l, b6 as c } from "./ChaiBuilderEditor-
|
|
5
|
-
import { b as h, a as g } from "./index-
|
|
4
|
+
import { b3 as f, b4 as n, b5 as l, b6 as c } from "./ChaiBuilderEditor-VOCsboQ9.js";
|
|
5
|
+
import { b as h, a as g } from "./index-X3veo7pJ.js";
|
|
6
6
|
import "./_commonjsHelpers-UyOWmZb0.js";
|
|
7
7
|
import "clsx";
|
|
8
8
|
import "react-dom";
|
|
@@ -46,9 +46,9 @@ import "lodash";
|
|
|
46
46
|
import "lucide-react";
|
|
47
47
|
import "./core.js";
|
|
48
48
|
import "sonner";
|
|
49
|
-
import "./html-to-json-
|
|
49
|
+
import "./html-to-json-Z6R2o_fA.js";
|
|
50
50
|
import "himalaya";
|
|
51
|
-
const N = m.lazy(() => import("./project-general-setting-
|
|
51
|
+
const N = m.lazy(() => import("./project-general-setting-sVRpF1o-.js")), S = m.lazy(() => import("./project-seo-setting-YTVfe0Hq.js")), d = /* @__PURE__ */ t.jsx("div", { className: "px-3", children: /* @__PURE__ */ t.jsx("div", { className: "h-52 w-full animate-pulse rounded-md bg-gray-100" }) }), u = (e) => e && j(e.seoData) ? {
|
|
52
52
|
...e,
|
|
53
53
|
seoData: { title: "", description: "", image: "" }
|
|
54
54
|
} : e;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-Z_BpKhVy.cjs"),r=require("react"),x=require("lodash-es"),s=require("./ChaiBuilderEditor-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-Z_BpKhVy.cjs"),r=require("react"),x=require("lodash-es"),s=require("./ChaiBuilderEditor-6o0IOkBV.cjs"),a=require("./index-wnXwbbRk.cjs");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("clsx");require("react-dom");require("@radix-ui/react-scroll-area");require("@floating-ui/react-dom");require("jotai");require("i18next");require("react-i18next");require("flagged");require("./STRINGS-gPz7CUOk.cjs");require("./Functions-N3yhPYKY.cjs");require("tailwind-merge");require("@chaibuilder/runtime");require("@react-hookz/web");require("./MODIFIERS-YPHRtwrM.cjs");require("@radix-ui/react-toggle");require("class-variance-authority");require("./Class-Zc8hpE7f.cjs");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-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-quill");require("react-hotkeys-hook");require("lodash");require("lucide-react");require("./core.cjs");require("sonner");require("./html-to-json-VPWiWWGH.cjs");require("himalaya");const d=r.lazy(()=>Promise.resolve().then(()=>require("./project-general-setting-2yhhHbME.cjs"))),m=r.lazy(()=>Promise.resolve().then(()=>require("./project-seo-setting-FMpb2qiM.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 q(){const t=a.useUpdateProject(),{data:n}=a.useProject(),[i,o]=r.useState(l(n||{})),u=r.useRef(i);return r.useEffect(()=>()=>{x.isEqual(n,u.current)||t.mutate(u.current,{onSuccess:()=>o(u.current)})},[u]),r.useEffect(()=>{u.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=q;
|
|
@@ -5,14 +5,14 @@ import { useThrottledCallback as ue } from "@react-hookz/web";
|
|
|
5
5
|
import { forEach as Re, isArray as xe, omit as vt, truncate as jt, includes as F, get as g, first as oe, split as wt, startCase as Y, toLower as le, isEmpty as b, map as C, find as Ge, last as Ct, filter as ve, set as qe, debounce as kt, keys as je, cloneDeep as Nt, each as _t, capitalize as we, reject as St, nth as $e, startsWith as W, isNumber as Tt, parseInt as Rt, isNaN as Je, findLast as Vt, flatten as J, intersection as Qe, has as ce, kebabCase as Ht, isNull as Dt } from "lodash-es";
|
|
6
6
|
import { useTranslation as X } from "react-i18next";
|
|
7
7
|
import { CopyIcon as Bt, PlusIcon as Ve, Cross2Icon as et, EyeOpenIcon as Pt, EyeClosedIcon as Ae, BorderAllIcon as O, WidthIcon as T, HeightIcon as R, ArrowUpIcon as ee, ArrowRightIcon as te, ArrowDownIcon as re, ArrowLeftIcon as se, ArrowTopLeftIcon as It, ArrowTopRightIcon as $t, ArrowBottomRightIcon as At, ArrowBottomLeftIcon as Mt, AlignLeftIcon as Lt, AlignCenterHorizontallyIcon as Et, AlignRightIcon as Ot, StretchHorizontallyIcon as Ft, FontItalicIcon as Yt, UnderlineIcon as zt, OverlineIcon as Xt, LetterCaseUppercaseIcon as Zt, Cross1Icon as Wt, InfoCircledIcon as He, MinusIcon as Ut, BoxIcon as tt, RowSpacingIcon as Kt, TriangleDownIcon as Gt, CrossCircledIcon as qt, CaretDownIcon as Jt, MixerHorizontalIcon as rt } from "@radix-ui/react-icons";
|
|
8
|
-
import { a2 as st, aO as Qt, aP as er, B as G, aQ as tr, aR as rr, aS as sr, aT as lr, aU as ar, aV as or, aW as nr, M as q, aK as lt, $ as ir, a0 as dr, a1 as cr, aX as pr, Z as ur, ab as xr, _ as gr, ac as $, ad as A, ae as M, aY as hr, aZ as yr, a_ as mr, a$ as br, b0 as fr, b1 as vr, b2 as jr, R as at, Q as ot, h as wr, b3 as nt, b4 as Ce, b5 as ke, b6 as Ne, Y as ge, n as De, I as it, L as dt, b7 as ct, aq as pt, b8 as _e, j as Cr, b9 as kr, J as he, v as Nr, P as ut, o as Me, av as _r, aw as Sr, ax as Tr, ba as Be, ay as Le, az as Ee, bb as Oe, bc as Fe, bd as Ye, S as Rr, be as Vr, a6 as Hr, a7 as Dr, a8 as Br, a9 as Pr, aa as V, ai as Ir, aj as $r, ak as me, al as be } from "./ChaiBuilderEditor-
|
|
8
|
+
import { a2 as st, aO as Qt, aP as er, B as G, aQ as tr, aR as rr, aS as sr, aT as lr, aU as ar, aV as or, aW as nr, M as q, aK as lt, $ as ir, a0 as dr, a1 as cr, aX as pr, Z as ur, ab as xr, _ as gr, ac as $, ad as A, ae as M, aY as hr, aZ as yr, a_ as mr, a$ as br, b0 as fr, b1 as vr, b2 as jr, R as at, Q as ot, h as wr, b3 as nt, b4 as Ce, b5 as ke, b6 as Ne, Y as ge, n as De, I as it, L as dt, b7 as ct, aq as pt, b8 as _e, j as Cr, b9 as kr, J as he, v as Nr, P as ut, o as Me, av as _r, aw as Sr, ax as Tr, ba as Be, ay as Le, az as Ee, bb as Oe, bc as Fe, bd as Ye, S as Rr, be as Vr, a6 as Hr, a7 as Dr, a8 as Br, a9 as Pr, aa as V, ai as Ir, aj as $r, ak as me, al as be } from "./ChaiBuilderEditor-VOCsboQ9.js";
|
|
9
9
|
import { l as Ar } from "./controls-VTdJhdSz.js";
|
|
10
10
|
import { Check as Mr, EditIcon as Lr, TrashIcon as Er, BrushIcon as Or, DeleteIcon as Fr } from "lucide-react";
|
|
11
11
|
import { getBlockComponent as Pe, getChaiDataProviders as Yr, useGlobalStylingPresets as zr } from "@chaibuilder/runtime";
|
|
12
12
|
import { J as Xr, a as Zr, d as Wr } from "./index-e0c8PmRQ.js";
|
|
13
13
|
import Ur from "@rjsf/core";
|
|
14
14
|
import Kr from "@rjsf/validator-ajv8";
|
|
15
|
-
import { u as Gr } from "./useCanvasSettings-
|
|
15
|
+
import { u as Gr } from "./useCanvasSettings-J3l6fcbV.js";
|
|
16
16
|
import qr from "react-autosuggest";
|
|
17
17
|
import Jr from "fuse.js";
|
|
18
18
|
import { A as Qr, C as ye, g as es } from "./Class-6Hz2KzYb.js";
|