@chaibuilder/sdk 1.2.32 → 1.2.34
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-0eVRNr1d.js → AddBlocks-RmEkZXdE.js} +37 -33
- package/dist/AddBlocks-XYCWUol8.cjs +1 -0
- package/dist/{BrandingOptions-yYAznnw2.js → BrandingOptions-TnzCIC7A.js} +37 -31
- package/dist/BrandingOptions-qnaKl27s.cjs +1 -0
- package/dist/CanvasArea-SeSRWHy0.js +1200 -0
- package/dist/CanvasArea-iIwERFUC.cjs +55 -0
- package/dist/ChaiBuilderEditor-YqEKonJ_.cjs +206 -0
- package/dist/{index-AJalHhkO.js → ChaiBuilderEditor-y1NxvXJ7.js} +24114 -20836
- package/dist/{CurrentPage-1v40uk8K.js → CurrentPage-9KDre_9q.js} +19 -19
- package/dist/CurrentPage-TNff16tH.cjs +1 -0
- package/dist/ListTree-GxCAsv2Y.cjs +1 -0
- package/dist/{ListTree-0ZrRreCs.js → ListTree-H2WaKwOs.js} +81 -76
- package/dist/PagesPanel-5DRsqV-G.cjs +1 -0
- package/dist/{PagesPanel-AxQX-BX2.js → PagesPanel-jHMmJEtv.js} +14 -14
- package/dist/ProjectPanel-CDnnGpVo.cjs +1 -0
- package/dist/{ProjectPanel-GYdge5v9.js → ProjectPanel-uxhq_D3j.js} +16 -16
- package/dist/Settings-nGnVavh4.cjs +1 -0
- package/dist/{Settings-9JAzGHau.js → Settings-yqZksAbO.js} +53 -53
- package/dist/{SidePanels-bLwsW29O.js → SidePanels-1gwirESt.js} +70 -70
- package/dist/SidePanels-33KNaSS3.cjs +1 -0
- package/dist/{Topbar-0Ql8pHVc.js → Topbar-NHF8D1di.js} +19 -14
- package/dist/Topbar-Wwdd9Flx.cjs +1 -0
- package/dist/{UnsplashImages-NYwOOgYa.js → UnsplashImages-LLu2wFeN.js} +26 -21
- package/dist/UnsplashImages-lnz6NfSD.cjs +1 -0
- package/dist/UploadImages-3nl_4mDf.cjs +1 -0
- package/dist/{UploadImages-vpZeW-YW.js → UploadImages-FtvaDyk9.js} +33 -27
- package/dist/{add-page-modal-hDyzsEU7.js → add-page-modal-V9DTBMmY.js} +22 -22
- package/dist/add-page-modal-sIZk552b.cjs +1 -0
- package/dist/confirm-alert-Uzq5XNGt.cjs +1 -0
- package/dist/{confirm-alert-FGQKKQJU.js → confirm-alert-sI4pItIN.js} +16 -10
- package/dist/{controls-OfJWSEqC.js → controls-VTdJhdSz.js} +44 -41
- package/dist/controls-jWJDao88.cjs +1 -0
- package/dist/core.cjs +1 -1
- package/dist/core.d.ts +9 -0
- package/dist/core.js +46 -45
- package/dist/delete-page-modal-UminFzYh.cjs +1 -0
- package/dist/{delete-page-modal-KxeyBri2.js → delete-page-modal-XrIpujav.js} +15 -15
- package/dist/email-blocks.cjs +1 -1
- package/dist/email-blocks.js +1 -1
- package/dist/email.cjs +1 -1
- package/dist/email.d.ts +9 -0
- package/dist/email.js +18 -16
- package/dist/{form-77dY98bF.js → form-dQQ2tTRZ.js} +7 -7
- package/dist/form-q7lxaK3j.cjs +1 -0
- package/dist/functions-ge87TVcc.js +30 -0
- package/dist/functions-sBiIevFh.cjs +1 -0
- package/dist/{index-5zkCTSAM.js → index-OsS2_gM8.js} +28 -29
- package/dist/index-eYwpNzUl.cjs +1 -0
- package/dist/lib.cjs +2 -2
- package/dist/lib.d.ts +2 -0
- package/dist/lib.js +12 -10
- package/dist/{page-viewer-umQaut1j.js → page-viewer-AoJ5HU6j.js} +21 -21
- package/dist/page-viewer-FzhqSyNO.cjs +1 -0
- package/dist/project-general-setting-WzJ8U1OW.cjs +1 -0
- package/dist/{project-general-setting-uuCemMCU.js → project-general-setting-g3YJYszB.js} +24 -24
- package/dist/{project-seo-setting-asvbPQiI.js → project-seo-setting-1sLmV-wv.js} +26 -20
- package/dist/project-seo-setting-GuObNafp.cjs +1 -0
- package/dist/render.cjs +1 -1
- package/dist/render.d.ts +2 -0
- package/dist/render.js +55 -53
- package/dist/single-page-detail-WGars7Tl.cjs +1 -0
- package/dist/{single-page-detail-F6pKWyq1.js → single-page-detail-sQ3BH6Rc.js} +25 -25
- package/dist/studio.cjs +1 -1
- package/dist/studio.d.ts +9 -0
- package/dist/studio.js +13 -13
- package/dist/ui.cjs +1 -1
- package/dist/ui.js +153 -147
- package/dist/useCanvasSettings-QcsmJd9b.cjs +1 -0
- package/dist/{useCanvasSettings-ikt217kv.js → useCanvasSettings-XwFRrknO.js} +1 -1
- package/dist/web-blocks.cjs +4 -4
- package/dist/web-blocks.js +137 -113
- package/package.json +9 -3
- package/dist/AddBlocks-t0hKDSud.cjs +0 -1
- package/dist/BrandingOptions-NVmCxZfD.cjs +0 -1
- package/dist/CanvasArea-2b4oSjRx.js +0 -1177
- package/dist/CanvasArea-OzyCq6UU.cjs +0 -55
- package/dist/CurrentPage-YBMhEBZG.cjs +0 -1
- package/dist/ListTree-jPwxgI6R.cjs +0 -1
- package/dist/PagesPanel-ivEL9tIQ.cjs +0 -1
- package/dist/ProjectPanel-shgvg_yT.cjs +0 -1
- package/dist/Settings-MMwEBADN.cjs +0 -1
- package/dist/SidePanels-iaaRCUeQ.cjs +0 -1
- package/dist/Topbar-CkUhCnSW.cjs +0 -1
- package/dist/UnsplashImages-juwtWvXe.cjs +0 -1
- package/dist/UploadImages-4_jmnoVi.cjs +0 -1
- package/dist/add-page-modal-2ZPjc54F.cjs +0 -1
- package/dist/confirm-alert-QRxOc76t.cjs +0 -1
- package/dist/controls-KK2oLIa8.cjs +0 -1
- package/dist/delete-page-modal--N1nPPIL.cjs +0 -1
- package/dist/form-hT5dGoJH.cjs +0 -1
- package/dist/functions-I6BoMqqb.js +0 -21
- package/dist/functions-r3ExvGGf.cjs +0 -1
- package/dist/index-FPBudsRF.cjs +0 -1
- package/dist/index-JIcsKKoG.cjs +0 -1
- package/dist/index-YpnaudSM.js +0 -63
- package/dist/index-ecnGWzh9.cjs +0 -1
- package/dist/index-hH5SIZ29.js +0 -3116
- package/dist/index-sJ9Uc9UY.cjs +0 -206
- package/dist/page-viewer-k-g15j8B.cjs +0 -1
- package/dist/project-general-setting-1leAiCJQ.cjs +0 -1
- package/dist/project-seo-setting-kDBSOzgX.cjs +0 -1
- package/dist/single-page-detail-IFtVxwl5.cjs +0 -1
- package/dist/useCanvasSettings-Am2o80hW.cjs +0 -1
|
@@ -1,23 +1,28 @@
|
|
|
1
1
|
import { j as e } from "./jsx-runtime-WbnYoNE9.js";
|
|
2
|
-
import {
|
|
3
|
-
import { sortBy as b, filter as
|
|
4
|
-
import { toast as
|
|
2
|
+
import { V as h, a6 as f, a7 as j, a8 as y, a9 as v, aa as P } from "./ChaiBuilderEditor-y1NxvXJ7.js";
|
|
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
|
+
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
|
|
6
|
+
import { a as B, u as E, c as T, d as V } from "./index-OsS2_gM8.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";
|
|
10
|
-
import "./Functions-7jnEwJyw.js";
|
|
11
10
|
import "clsx";
|
|
12
|
-
import "
|
|
13
|
-
import "@
|
|
11
|
+
import "react-dom";
|
|
12
|
+
import "@radix-ui/react-scroll-area";
|
|
13
|
+
import "@floating-ui/react-dom";
|
|
14
14
|
import "jotai";
|
|
15
|
+
import "i18next";
|
|
16
|
+
import "flagged";
|
|
15
17
|
import "./STRINGS--j49GZJP.js";
|
|
18
|
+
import "./Functions-7jnEwJyw.js";
|
|
19
|
+
import "tailwind-merge";
|
|
20
|
+
import "@chaibuilder/runtime";
|
|
16
21
|
import "@react-hookz/web";
|
|
17
22
|
import "./MODIFIERS-cBT31iqE.js";
|
|
18
|
-
import "./Class-6Hz2KzYb.js";
|
|
19
23
|
import "@radix-ui/react-toggle";
|
|
20
24
|
import "class-variance-authority";
|
|
25
|
+
import "./Class-6Hz2KzYb.js";
|
|
21
26
|
import "@radix-ui/react-switch";
|
|
22
27
|
import "@radix-ui/react-slot";
|
|
23
28
|
import "@radix-ui/react-accordion";
|
|
@@ -25,7 +30,6 @@ import "@radix-ui/react-icons";
|
|
|
25
30
|
import "@radix-ui/react-alert-dialog";
|
|
26
31
|
import "@radix-ui/react-dialog";
|
|
27
32
|
import "@radix-ui/react-label";
|
|
28
|
-
import "@radix-ui/react-scroll-area";
|
|
29
33
|
import "@radix-ui/react-tabs";
|
|
30
34
|
import "@radix-ui/react-tooltip";
|
|
31
35
|
import "@radix-ui/react-popover";
|
|
@@ -38,24 +42,20 @@ import "@radix-ui/react-toast";
|
|
|
38
42
|
import "cmdk";
|
|
39
43
|
import "@radix-ui/react-context-menu";
|
|
40
44
|
import "react-icons-picker";
|
|
41
|
-
import "react-dom";
|
|
42
45
|
import "react-quill";
|
|
43
|
-
import "./index-AJalHhkO.js";
|
|
44
|
-
import "i18next";
|
|
45
|
-
import "@floating-ui/react-dom";
|
|
46
|
-
import "flagged";
|
|
47
46
|
import "react-hotkeys-hook";
|
|
47
|
+
import "lodash";
|
|
48
|
+
import "./core.js";
|
|
48
49
|
import "./html-to-json-ZV4QjSww.js";
|
|
49
50
|
import "himalaya";
|
|
50
|
-
import "./index-YpnaudSM.js";
|
|
51
51
|
const Te = () => {
|
|
52
|
-
const { data: t } = B(), { data: i, isLoading: l } = E(), { saveState: c } = h(), d = T(), { t: u } = L(), [a, o] =
|
|
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);
|
|
53
53
|
p(() => {
|
|
54
54
|
!m(i) && t.homepage && !n(i, { uuid: a }) && o(t.homepage);
|
|
55
55
|
}, [a, i, t, o]), p(() => () => o(null), [o]);
|
|
56
56
|
const g = (r) => {
|
|
57
57
|
if (c !== "SAVED")
|
|
58
|
-
|
|
58
|
+
k.error(u("You have unsaved changes. Please save before changing the page."));
|
|
59
59
|
else {
|
|
60
60
|
const x = n(s, { uuid: r });
|
|
61
61
|
d(x);
|
|
@@ -69,7 +69,7 @@ const Te = () => {
|
|
|
69
69
|
children: /* @__PURE__ */ e.jsxs("ol", { className: "inline-flex items-center space-x-1 md:space-x-3", children: [
|
|
70
70
|
/* @__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: [
|
|
71
71
|
/* @__PURE__ */ e.jsx(I, { className: "mr-2 h-4 w-4" }),
|
|
72
|
-
|
|
72
|
+
N(t.name)
|
|
73
73
|
] }) }),
|
|
74
74
|
/* @__PURE__ */ e.jsx("li", { "aria-current": "page", children: /* @__PURE__ */ e.jsxs("div", { className: "flex items-center", children: [
|
|
75
75
|
/* @__PURE__ */ e.jsx(
|
|
@@ -94,7 +94,7 @@ const Te = () => {
|
|
|
94
94
|
),
|
|
95
95
|
/* @__PURE__ */ e.jsxs(f, { value: a || "", onValueChange: g, children: [
|
|
96
96
|
/* @__PURE__ */ e.jsx(j, { 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: /* @__PURE__ */ e.jsx(y, { placeholder: "Page" }) }),
|
|
97
|
-
/* @__PURE__ */ e.jsx(v, { className: "z-[999]", children:
|
|
97
|
+
/* @__PURE__ */ e.jsx(v, { className: "z-[999]", children: S(s, (r) => /* @__PURE__ */ e.jsx(P, { value: r.uuid, children: r == null ? void 0 : r.name }, r.uuid)) })
|
|
98
98
|
] })
|
|
99
99
|
] }) })
|
|
100
100
|
] })
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-Z_BpKhVy.cjs"),s=require("./ChaiBuilderEditor-YqEKonJ_.cjs"),i=require("lodash-es"),j=require("sonner"),l=require("react"),o=require("./index-eYwpNzUl.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-Xhu27KFD.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;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-Z_BpKhVy.cjs"),a=require("react"),v=require("jotai"),q=require("@react-hookz/web"),C=require("react-arborist"),r=require("./ChaiBuilderEditor-YqEKonJ_.cjs"),k=require("./Functions-N3yhPYKY.cjs"),s=require("@radix-ui/react-icons"),T=require("lucide-react"),I=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 B=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(T.DatabaseIcon,{size:16});case"Box":return e.jsxRuntimeExports.jsx(s.BoxIcon,{});default:return e.jsxRuntimeExports.jsx(s.BoxModelIcon,{})}},w={display:"flex",alignItems:"center",zIndex:1},D=a.memo(function({top:i,left:n}){const l={position:"absolute",pointerEvents:"none",top:i+"px",left:n+"px",right:0};return e.jsxRuntimeExports.jsx("div",{style:{...w,...l},children:e.jsxRuntimeExports.jsx("div",{className:"h-0.5 flex-1 rounded-[1px] bg-green-500"})})}),S=a.memo(function({children:i,isDragging:n}){return n?e.jsxRuntimeExports.jsx("div",{className:"pointer-events-none fixed left-0 top-0 z-[100] h-full w-full",children:i}):null}),N=a.memo(({id:t,isDragging:i,mouse:n})=>{const[l]=r.useBlocksStore(),c=a.useMemo(()=>l.find(p=>p._id===t),[l,t]),m=a.useMemo(()=>({transform:`translate(${(n==null?void 0:n.x)-10}px, ${(n==null?void 0:n.y)-10}px)`}),[n]);return n?e.jsxRuntimeExports.jsx("div",{children:e.jsxRuntimeExports.jsx(S,{isDragging:i,children:e.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:m,children:e.jsxRuntimeExports.jsxs("button",{type:"button",className:"flex !cursor-grab items-center p-0.5","aria-label":`Type: ${c==null?void 0:c._type}`,children:[e.jsxRuntimeExports.jsx("div",{className:"-mt-0.5 h-3 w-3",children:e.jsxRuntimeExports.jsx(B,{type:c==null?void 0:c._type})}),e.jsxRuntimeExports.jsx("div",{className:"ml-2 truncate text-[11px]",children:(c==null?void 0:c._name)||(c==null?void 0:c._type)})]})})})}):e.jsxRuntimeExports.jsx("div",{className:"hidden"})}),_=()=>{const[t]=r.useSelectedBlockIds(),i=r.useRemoveBlocks(),n=r.useSelectedBlock();return e.jsxRuntimeExports.jsxs(r.ContextMenuItem,{disabled:!r.canDeleteBlock(n==null?void 0:n._type),className:"flex items-center gap-x-4 text-xs",onClick:()=>i(t),children:[e.jsxRuntimeExports.jsx(s.TrashIcon,{})," Remove"]})},M=()=>{const[t]=r.useSelectedBlockIds(),i=r.useDuplicateBlocks(),n=r.useSelectedBlock(),l=a.useCallback(()=>{i(t)},[t,i]);return e.jsxRuntimeExports.jsxs(r.ContextMenuContent,{className:"text-xs",children:[e.jsxRuntimeExports.jsxs(r.ContextMenuItem,{disabled:!r.canDuplicateBlock(n==null?void 0:n._type),className:"flex items-center gap-x-4 text-xs",onClick:l,children:[e.jsxRuntimeExports.jsx(s.CopyIcon,{})," Duplicate"]}),e.jsxRuntimeExports.jsx(_,{})]})},A=({children:t})=>e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:e.jsxRuntimeExports.jsxs(r.ContextMenu,{children:[e.jsxRuntimeExports.jsx(r.ContextMenuTrigger,{children:t}),e.jsxRuntimeExports.jsx(M,{})]})}),P=a.memo(({node:t,style:i,dragHandle:n})=>{const l=r.useBuilderProp("outlineMenuItems",[]),[,c]=r.useHighlightBlockId(),m=t.children.length>0,{id:p,data:x,isSelected:R,willReceiveDrop:j,isDragging:h,isEditing:g,handleClick:E}=t,f=q.useDebouncedCallback(o=>c(o),[],300),b=o=>{o.stopPropagation(),t.toggle()},u=o=>{o.stopPropagation(),t.isOpen||t.toggle(),E(o)};return a.useEffect(()=>{const o=setTimeout(()=>{j&&!t.isOpen&&t.toggle()},500);return()=>clearTimeout(o)},[j,t]),e.jsxRuntimeExports.jsx(A,{id:p,children:e.jsxRuntimeExports.jsxs("div",{onClick:u,onMouseEnter:()=>f(p),style:i,"data-node-id":p,ref:n,className:k.cn("group flex !h-fit w-full items-center justify-between space-x-px py-px outline-none",R?"bg-blue-500 text-white":"text-gray-600 hover:bg-gray-200 dark:hover:bg-gray-800",j&&r.canAcceptChildBlock(x._type,"Icon")?"bg-green-200":"",h&&"opacity-20"),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:m&&e.jsxRuntimeExports.jsx("button",{onClick:b,type:"button",children:e.jsxRuntimeExports.jsx(s.TriangleRightIcon,{})})}),e.jsxRuntimeExports.jsxs("div",{className:"flex items-center",children:[e.jsxRuntimeExports.jsx("div",{className:"-mt-0.5 h-3 w-3",children:e.jsxRuntimeExports.jsx(B,{type:x==null?void 0:x._type})}),g?e.jsxRuntimeExports.jsx(H,{node:t}):e.jsxRuntimeExports.jsx("div",{className:"ml-2 truncate text-[11px]",onDoubleClick:o=>{o.stopPropagation(),t.edit(),t.deselect()},children:(x==null?void 0:x._name)||(x==null?void 0:x._type.split("/").pop())})]})]}),e.jsxRuntimeExports.jsx("div",{className:"invisible flex items-center space-x-1 pr-2 group-hover:visible",children:l.map(o=>e.jsxRuntimeExports.jsxs(r.Tooltip,{children:[e.jsxRuntimeExports.jsx(r.TooltipTrigger,{className:"cursor-pointer rounded bg-transparent hover:bg-white hover:text-blue-500",asChild:!0,children:a.createElement(o.item,{blockId:p})}),e.jsxRuntimeExports.jsx(r.TooltipContent,{className:"z-[9999]",children:o.tooltip})]}))})]})})}),H=({node:t})=>e.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:t.data.name,onFocus:i=>i.currentTarget.select(),onBlur:i=>t.submit(i.currentTarget.value),onKeyDown:i=>{i.key==="Enter"&&t.submit(i.currentTarget.value)}}),z=()=>{const[t]=r.useBlocksStore();return(i,n)=>{var m;const l=(m=I.find(t,{_id:n}))==null?void 0:m._type,c=I.first(i.map(p=>{var x;return(x=I.find(t,{_id:p}))==null?void 0:x._type}));return r.canAcceptChildBlock(l,c)}},L=()=>{const[t]=v.useAtom(r.treeDSBlocks),[i,n]=r.useSelectedBlockIds(),l=r.useUpdateBlocksProps(),[,c]=r.useSelectedStylingBlocks(),{moveBlocks:m}=r.useBlocksStoreUndoableActions(),p=z(),x=a.useRef(null),[,R]=v.useAtom(r.treeRefAtom),j=()=>{n([]),c([])};a.useEffect(()=>{R(x.current)},[x.current]);const h=({id:u,name:o,node:d})=>{l([u],{_name:o},d.data._name)},g=({dragIds:u,parentId:o,index:d})=>{p(u,o)&&m(u,o,d)},E=u=>{if(u.length===0)return;const o=u[0]?u[0].id:"";c([]),n([o])},f=u=>{var y;u.preventDefault();const o=u.target,d=o.getAttribute("data-node-id")||((y=o.closest("[data-node-id]"))==null?void 0:y.getAttribute("data-node-id"));d&&(c([]),n([d]))},b=q.useDebouncedCallback(({parentNode:u,dragNodes:o})=>{var d;return!r.canAcceptChildBlock(u==null?void 0:u.data._type,(d=o[0])==null?void 0:d.data._type)},[],300);return e.jsxRuntimeExports.jsx("div",{className:k.cn("-mx-1 -mt-1 flex h-full select-none flex-col space-y-1"),onClick:()=>j(),children:e.jsxRuntimeExports.jsx("div",{id:"outline-view",className:"no-scrollbar h-full overflow-y-auto p-1 px-2 text-xs",children:e.jsxRuntimeExports.jsx(C.Tree,{ref:x,height:800,className:"no-scrollbar !h-full max-w-full !overflow-y-auto !overflow-x-hidden",selection:i[0]||"",onRename:h,openByDefault:!1,onMove:g,rowHeight:20,data:t,renderCursor:D,onSelect:E,childrenAccessor:u=>u.children,width:"100%",renderDragPreview:N,indent:10,onContextMenu:f,disableDrop:b,idAccessor:"_id",children:P})})})};exports.default=L;
|
|
@@ -1,30 +1,34 @@
|
|
|
1
1
|
import { j as e } from "./jsx-runtime-WbnYoNE9.js";
|
|
2
|
-
import _, { memo as b, useMemo as k, useCallback as z, useEffect as N, useRef as
|
|
2
|
+
import _, { memo as b, useMemo as k, useCallback as z, useEffect as N, useRef as L } from "react";
|
|
3
3
|
import { useAtom as C } from "jotai";
|
|
4
4
|
import { useDebouncedCallback as R } from "@react-hookz/web";
|
|
5
|
-
import { Tree as
|
|
6
|
-
import {
|
|
7
|
-
import { c as
|
|
8
|
-
import { BoxModelIcon as
|
|
5
|
+
import { Tree as E } from "react-arborist";
|
|
6
|
+
import { i as M, L as y, H as F, M as S, bo as H, aI as O, w as V, bp as $, aH as U, bq as q, br as G, h as K, z as Q, bs as v, ac as W, ad as Y, ae as J, bt as X, Q as Z, Y as ee, aA as te, aE as re } from "./ChaiBuilderEditor-y1NxvXJ7.js";
|
|
7
|
+
import { c as P } from "./Functions-7jnEwJyw.js";
|
|
8
|
+
import { BoxModelIcon as se, BoxIcon as oe, DragHandleHorizontalIcon as ne, ViewHorizontalIcon as ce, BorderAllIcon as ae, BorderTopIcon as ie, TableIcon as le, DropdownMenuIcon as ue, RadiobuttonIcon as pe, InputIcon as de, ButtonIcon as B, CheckboxIcon as xe, GroupIcon as me, SpaceBetweenVerticallyIcon as he, ColumnsIcon as ge, RowsIcon as T, TextIcon as w, SketchLogoIcon as fe, DividerHorizontalIcon as je, CodeIcon as be, CursorTextIcon as ye, VideoIcon as ve, Link1Icon as Ie, HeadingIcon as ke, ImageIcon as Ce, TrashIcon as Be, CopyIcon as Te, TriangleRightIcon as we } from "@radix-ui/react-icons";
|
|
9
9
|
import { DatabaseIcon as De } from "lucide-react";
|
|
10
10
|
import { find as D, first as _e } from "lodash-es";
|
|
11
11
|
import "./_commonjsHelpers-UyOWmZb0.js";
|
|
12
|
-
import "@chaibuilder/runtime";
|
|
13
|
-
import "./STRINGS--j49GZJP.js";
|
|
14
|
-
import "./MODIFIERS-cBT31iqE.js";
|
|
15
|
-
import "./Class-6Hz2KzYb.js";
|
|
16
12
|
import "clsx";
|
|
17
|
-
import "
|
|
13
|
+
import "react-dom";
|
|
14
|
+
import "@radix-ui/react-scroll-area";
|
|
15
|
+
import "@floating-ui/react-dom";
|
|
16
|
+
import "i18next";
|
|
18
17
|
import "react-i18next";
|
|
18
|
+
import "flagged";
|
|
19
|
+
import "./STRINGS--j49GZJP.js";
|
|
20
|
+
import "@chaibuilder/runtime";
|
|
21
|
+
import "./MODIFIERS-cBT31iqE.js";
|
|
19
22
|
import "@radix-ui/react-toggle";
|
|
20
23
|
import "class-variance-authority";
|
|
24
|
+
import "./Class-6Hz2KzYb.js";
|
|
25
|
+
import "tailwind-merge";
|
|
21
26
|
import "@radix-ui/react-switch";
|
|
22
27
|
import "@radix-ui/react-slot";
|
|
23
28
|
import "@radix-ui/react-accordion";
|
|
24
29
|
import "@radix-ui/react-alert-dialog";
|
|
25
30
|
import "@radix-ui/react-dialog";
|
|
26
31
|
import "@radix-ui/react-label";
|
|
27
|
-
import "@radix-ui/react-scroll-area";
|
|
28
32
|
import "@radix-ui/react-tabs";
|
|
29
33
|
import "@radix-ui/react-tooltip";
|
|
30
34
|
import "@radix-ui/react-popover";
|
|
@@ -37,8 +41,9 @@ import "@radix-ui/react-toast";
|
|
|
37
41
|
import "cmdk";
|
|
38
42
|
import "@radix-ui/react-context-menu";
|
|
39
43
|
import "react-icons-picker";
|
|
40
|
-
import "react-dom";
|
|
41
44
|
import "react-quill";
|
|
45
|
+
import "react-hotkeys-hook";
|
|
46
|
+
import "lodash";
|
|
42
47
|
const A = (t) => {
|
|
43
48
|
switch (t.type) {
|
|
44
49
|
case "Image":
|
|
@@ -79,9 +84,9 @@ const A = (t) => {
|
|
|
79
84
|
return /* @__PURE__ */ e.jsx(B, {});
|
|
80
85
|
case "Input":
|
|
81
86
|
case "TextArea":
|
|
82
|
-
return /* @__PURE__ */ e.jsx(pe, {});
|
|
83
|
-
case "Radio":
|
|
84
87
|
return /* @__PURE__ */ e.jsx(de, {});
|
|
88
|
+
case "Radio":
|
|
89
|
+
return /* @__PURE__ */ e.jsx(pe, {});
|
|
85
90
|
case "Select":
|
|
86
91
|
return /* @__PURE__ */ e.jsx(ue, {});
|
|
87
92
|
case "Table":
|
|
@@ -99,47 +104,47 @@ const A = (t) => {
|
|
|
99
104
|
case "Box":
|
|
100
105
|
return /* @__PURE__ */ e.jsx(oe, {});
|
|
101
106
|
default:
|
|
102
|
-
return /* @__PURE__ */ e.jsx(
|
|
107
|
+
return /* @__PURE__ */ e.jsx(se, {});
|
|
103
108
|
}
|
|
104
109
|
}, Ne = {
|
|
105
110
|
display: "flex",
|
|
106
111
|
alignItems: "center",
|
|
107
112
|
zIndex: 1
|
|
108
|
-
}, Re = _.memo(function({ top: o, left:
|
|
113
|
+
}, Re = _.memo(function({ top: o, left: r }) {
|
|
109
114
|
const i = {
|
|
110
115
|
position: "absolute",
|
|
111
116
|
pointerEvents: "none",
|
|
112
117
|
top: o + "px",
|
|
113
|
-
left:
|
|
118
|
+
left: r + "px",
|
|
114
119
|
right: 0
|
|
115
120
|
};
|
|
116
121
|
return /* @__PURE__ */ e.jsx("div", { style: { ...Ne, ...i }, children: /* @__PURE__ */ e.jsx("div", { className: "h-0.5 flex-1 rounded-[1px] bg-green-500" }) });
|
|
117
|
-
}), Me = b(function({ children: o, isDragging:
|
|
118
|
-
return
|
|
119
|
-
}), Se = b(({ id: t, isDragging: o, mouse:
|
|
120
|
-
const [i] = M(), n = k(() => i.find((l) => l._id === t), [i, t]),
|
|
122
|
+
}), Me = b(function({ children: o, isDragging: r }) {
|
|
123
|
+
return r ? /* @__PURE__ */ e.jsx("div", { className: "pointer-events-none fixed left-0 top-0 z-[100] h-full w-full", children: o }) : null;
|
|
124
|
+
}), Se = b(({ id: t, isDragging: o, mouse: r }) => {
|
|
125
|
+
const [i] = M(), n = k(() => i.find((l) => l._id === t), [i, t]), p = k(
|
|
121
126
|
() => ({
|
|
122
|
-
transform: `translate(${(
|
|
127
|
+
transform: `translate(${(r == null ? void 0 : r.x) - 10}px, ${(r == null ? void 0 : r.y) - 10}px)`
|
|
123
128
|
}),
|
|
124
|
-
[
|
|
129
|
+
[r]
|
|
125
130
|
);
|
|
126
|
-
return
|
|
131
|
+
return r ? /* @__PURE__ */ e.jsx("div", { children: /* @__PURE__ */ e.jsx(Me, { isDragging: o, children: /* @__PURE__ */ e.jsx(
|
|
127
132
|
"div",
|
|
128
133
|
{
|
|
129
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",
|
|
130
|
-
style:
|
|
135
|
+
style: p,
|
|
131
136
|
children: /* @__PURE__ */ e.jsxs("button", { type: "button", className: "flex !cursor-grab items-center p-0.5", "aria-label": `Type: ${n == null ? void 0 : n._type}`, children: [
|
|
132
137
|
/* @__PURE__ */ e.jsx("div", { className: "-mt-0.5 h-3 w-3", children: /* @__PURE__ */ e.jsx(A, { type: n == null ? void 0 : n._type }) }),
|
|
133
138
|
/* @__PURE__ */ e.jsx("div", { className: "ml-2 truncate text-[11px]", children: (n == null ? void 0 : n._name) || (n == null ? void 0 : n._type) })
|
|
134
139
|
] })
|
|
135
140
|
}
|
|
136
141
|
) }) }) : /* @__PURE__ */ e.jsx("div", { className: "hidden" });
|
|
137
|
-
}),
|
|
138
|
-
const [t] = y(), o = F(),
|
|
142
|
+
}), He = () => {
|
|
143
|
+
const [t] = y(), o = F(), r = S();
|
|
139
144
|
return /* @__PURE__ */ e.jsxs(
|
|
140
|
-
|
|
145
|
+
H,
|
|
141
146
|
{
|
|
142
|
-
disabled: !O(
|
|
147
|
+
disabled: !O(r == null ? void 0 : r._type),
|
|
143
148
|
className: "flex items-center gap-x-4 text-xs",
|
|
144
149
|
onClick: () => o(t),
|
|
145
150
|
children: [
|
|
@@ -148,15 +153,15 @@ const A = (t) => {
|
|
|
148
153
|
]
|
|
149
154
|
}
|
|
150
155
|
);
|
|
151
|
-
},
|
|
152
|
-
const [t] = y(), o = V(),
|
|
156
|
+
}, Pe = () => {
|
|
157
|
+
const [t] = y(), o = V(), r = S(), i = z(() => {
|
|
153
158
|
o(t);
|
|
154
159
|
}, [t, o]);
|
|
155
160
|
return /* @__PURE__ */ e.jsxs($, { className: "text-xs", children: [
|
|
156
161
|
/* @__PURE__ */ e.jsxs(
|
|
157
|
-
|
|
162
|
+
H,
|
|
158
163
|
{
|
|
159
|
-
disabled: !U(
|
|
164
|
+
disabled: !U(r == null ? void 0 : r._type),
|
|
160
165
|
className: "flex items-center gap-x-4 text-xs",
|
|
161
166
|
onClick: i,
|
|
162
167
|
children: [
|
|
@@ -165,34 +170,34 @@ const A = (t) => {
|
|
|
165
170
|
]
|
|
166
171
|
}
|
|
167
172
|
),
|
|
168
|
-
/* @__PURE__ */ e.jsx(
|
|
173
|
+
/* @__PURE__ */ e.jsx(He, {})
|
|
169
174
|
] });
|
|
170
175
|
}, Ae = ({ children: t }) => /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsxs(q, { children: [
|
|
171
176
|
/* @__PURE__ */ e.jsx(G, { children: t }),
|
|
172
|
-
/* @__PURE__ */ e.jsx(
|
|
173
|
-
] }) }), ze = b(({ node: t, style: o, dragHandle:
|
|
174
|
-
const i = K("outlineMenuItems", []), [, n] =
|
|
175
|
-
|
|
176
|
-
}, c = (
|
|
177
|
-
|
|
177
|
+
/* @__PURE__ */ e.jsx(Pe, {})
|
|
178
|
+
] }) }), ze = b(({ node: t, style: o, dragHandle: r }) => {
|
|
179
|
+
const i = K("outlineMenuItems", []), [, n] = Q(), p = t.children.length > 0, { id: l, data: a, isSelected: x, willReceiveDrop: d, isDragging: m, isEditing: h, handleClick: g } = t, f = R((s) => n(s), [], 300), j = (s) => {
|
|
180
|
+
s.stopPropagation(), t.toggle();
|
|
181
|
+
}, c = (s) => {
|
|
182
|
+
s.stopPropagation(), t.isOpen || t.toggle(), g(s);
|
|
178
183
|
};
|
|
179
184
|
return N(() => {
|
|
180
|
-
const
|
|
181
|
-
|
|
185
|
+
const s = setTimeout(() => {
|
|
186
|
+
d && !t.isOpen && t.toggle();
|
|
182
187
|
}, 500);
|
|
183
|
-
return () => clearTimeout(
|
|
184
|
-
}, [
|
|
188
|
+
return () => clearTimeout(s);
|
|
189
|
+
}, [d, t]), /* @__PURE__ */ e.jsx(Ae, { id: l, children: /* @__PURE__ */ e.jsxs(
|
|
185
190
|
"div",
|
|
186
191
|
{
|
|
187
192
|
onClick: c,
|
|
188
193
|
onMouseEnter: () => f(l),
|
|
189
194
|
style: o,
|
|
190
195
|
"data-node-id": l,
|
|
191
|
-
ref:
|
|
192
|
-
className:
|
|
196
|
+
ref: r,
|
|
197
|
+
className: P(
|
|
193
198
|
"group flex !h-fit w-full items-center justify-between space-x-px py-px outline-none",
|
|
194
199
|
x ? "bg-blue-500 text-white" : "text-gray-600 hover:bg-gray-200 dark:hover:bg-gray-800",
|
|
195
|
-
|
|
200
|
+
d && v(a._type, "Icon") ? "bg-green-200" : "",
|
|
196
201
|
m && "opacity-20"
|
|
197
202
|
),
|
|
198
203
|
children: [
|
|
@@ -201,38 +206,38 @@ const A = (t) => {
|
|
|
201
206
|
"div",
|
|
202
207
|
{
|
|
203
208
|
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" : ""}`,
|
|
204
|
-
children:
|
|
209
|
+
children: p && /* @__PURE__ */ e.jsx("button", { onClick: j, type: "button", children: /* @__PURE__ */ e.jsx(we, {}) })
|
|
205
210
|
}
|
|
206
211
|
),
|
|
207
212
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center", children: [
|
|
208
213
|
/* @__PURE__ */ e.jsx("div", { className: "-mt-0.5 h-3 w-3", children: /* @__PURE__ */ e.jsx(A, { type: a == null ? void 0 : a._type }) }),
|
|
209
|
-
h ? /* @__PURE__ */ e.jsx(
|
|
214
|
+
h ? /* @__PURE__ */ e.jsx(Le, { node: t }) : /* @__PURE__ */ e.jsx(
|
|
210
215
|
"div",
|
|
211
216
|
{
|
|
212
217
|
className: "ml-2 truncate text-[11px]",
|
|
213
|
-
onDoubleClick: (
|
|
214
|
-
|
|
218
|
+
onDoubleClick: (s) => {
|
|
219
|
+
s.stopPropagation(), t.edit(), t.deselect();
|
|
215
220
|
},
|
|
216
221
|
children: (a == null ? void 0 : a._name) || (a == null ? void 0 : a._type.split("/").pop())
|
|
217
222
|
}
|
|
218
223
|
)
|
|
219
224
|
] })
|
|
220
225
|
] }),
|
|
221
|
-
/* @__PURE__ */ e.jsx("div", { className: "invisible flex items-center space-x-1 pr-2 group-hover:visible", children: i.map((
|
|
226
|
+
/* @__PURE__ */ e.jsx("div", { className: "invisible flex items-center space-x-1 pr-2 group-hover:visible", children: i.map((s) => /* @__PURE__ */ e.jsxs(W, { children: [
|
|
222
227
|
/* @__PURE__ */ e.jsx(
|
|
223
|
-
|
|
228
|
+
Y,
|
|
224
229
|
{
|
|
225
230
|
className: "cursor-pointer rounded bg-transparent hover:bg-white hover:text-blue-500",
|
|
226
231
|
asChild: !0,
|
|
227
|
-
children: _.createElement(
|
|
232
|
+
children: _.createElement(s.item, { blockId: l })
|
|
228
233
|
}
|
|
229
234
|
),
|
|
230
|
-
/* @__PURE__ */ e.jsx(
|
|
235
|
+
/* @__PURE__ */ e.jsx(J, { className: "z-[9999]", children: s.tooltip })
|
|
231
236
|
] })) })
|
|
232
237
|
]
|
|
233
238
|
}
|
|
234
239
|
) });
|
|
235
|
-
}),
|
|
240
|
+
}), Le = ({ node: t }) => /* @__PURE__ */ e.jsx(
|
|
236
241
|
"input",
|
|
237
242
|
{
|
|
238
243
|
autoFocus: !0,
|
|
@@ -245,47 +250,47 @@ const A = (t) => {
|
|
|
245
250
|
o.key === "Enter" && t.submit(o.currentTarget.value);
|
|
246
251
|
}
|
|
247
252
|
}
|
|
248
|
-
),
|
|
253
|
+
), Ee = () => {
|
|
249
254
|
const [t] = M();
|
|
250
|
-
return (o,
|
|
251
|
-
var
|
|
252
|
-
const i = (
|
|
255
|
+
return (o, r) => {
|
|
256
|
+
var p;
|
|
257
|
+
const i = (p = D(t, { _id: r })) == null ? void 0 : p._type, n = _e(o.map((l) => {
|
|
253
258
|
var a;
|
|
254
259
|
return (a = D(t, { _id: l })) == null ? void 0 : a._type;
|
|
255
260
|
}));
|
|
256
261
|
return v(i, n);
|
|
257
262
|
};
|
|
258
|
-
},
|
|
259
|
-
const [t] = C(X), [o,
|
|
260
|
-
|
|
263
|
+
}, Mt = () => {
|
|
264
|
+
const [t] = C(X), [o, r] = y(), i = Z(), [, n] = ee(), { moveBlocks: p } = te(), l = Ee(), a = L(null), [, x] = C(re), d = () => {
|
|
265
|
+
r([]), n([]);
|
|
261
266
|
};
|
|
262
267
|
N(() => {
|
|
263
268
|
x(a.current);
|
|
264
269
|
}, [a.current]);
|
|
265
|
-
const m = ({ id: c, name:
|
|
266
|
-
i([c], { _name:
|
|
267
|
-
}, h = ({ dragIds: c, parentId:
|
|
268
|
-
l(c,
|
|
270
|
+
const m = ({ id: c, name: s, node: u }) => {
|
|
271
|
+
i([c], { _name: s }, u.data._name);
|
|
272
|
+
}, h = ({ dragIds: c, parentId: s, index: u }) => {
|
|
273
|
+
l(c, s) && p(c, s, u);
|
|
269
274
|
}, g = (c) => {
|
|
270
275
|
if (c.length === 0)
|
|
271
276
|
return;
|
|
272
|
-
const
|
|
273
|
-
n([]),
|
|
277
|
+
const s = c[0] ? c[0].id : "";
|
|
278
|
+
n([]), r([s]);
|
|
274
279
|
}, f = (c) => {
|
|
275
280
|
var I;
|
|
276
281
|
c.preventDefault();
|
|
277
|
-
const
|
|
278
|
-
u && (n([]),
|
|
282
|
+
const s = c.target, u = s.getAttribute("data-node-id") || ((I = s.closest("[data-node-id]")) == null ? void 0 : I.getAttribute("data-node-id"));
|
|
283
|
+
u && (n([]), r([u]));
|
|
279
284
|
}, j = R(
|
|
280
|
-
({ parentNode: c, dragNodes:
|
|
285
|
+
({ parentNode: c, dragNodes: s }) => {
|
|
281
286
|
var u;
|
|
282
|
-
return !v(c == null ? void 0 : c.data._type, (u =
|
|
287
|
+
return !v(c == null ? void 0 : c.data._type, (u = s[0]) == null ? void 0 : u.data._type);
|
|
283
288
|
},
|
|
284
289
|
[],
|
|
285
290
|
300
|
|
286
291
|
);
|
|
287
|
-
return /* @__PURE__ */ e.jsx("div", { className:
|
|
288
|
-
|
|
292
|
+
return /* @__PURE__ */ e.jsx("div", { className: P("-mx-1 -mt-1 flex h-full select-none flex-col space-y-1"), onClick: () => d(), children: /* @__PURE__ */ e.jsx("div", { id: "outline-view", className: "no-scrollbar h-full overflow-y-auto p-1 px-2 text-xs", children: /* @__PURE__ */ e.jsx(
|
|
293
|
+
E,
|
|
289
294
|
{
|
|
290
295
|
ref: a,
|
|
291
296
|
height: 800,
|
|
@@ -310,5 +315,5 @@ const A = (t) => {
|
|
|
310
315
|
) }) });
|
|
311
316
|
};
|
|
312
317
|
export {
|
|
313
|
-
|
|
318
|
+
Mt as default
|
|
314
319
|
};
|
|
@@ -0,0 +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-eYwpNzUl.cjs");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("./core.cjs");require("./ChaiBuilderEditor-YqEKonJ_.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-Xhu27KFD.cjs");require("himalaya");const a=u.lazy(()=>Promise.resolve().then(()=>require("./add-page-modal-sIZk552b.cjs"))),x=u.lazy(()=>Promise.resolve().then(()=>require("./page-viewer-FzhqSyNO.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,23 +1,27 @@
|
|
|
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-OsS2_gM8.js";
|
|
5
5
|
import "./_commonjsHelpers-UyOWmZb0.js";
|
|
6
|
-
import "./
|
|
6
|
+
import "./core.js";
|
|
7
|
+
import "./ChaiBuilderEditor-y1NxvXJ7.js";
|
|
8
|
+
import "clsx";
|
|
9
|
+
import "react-dom";
|
|
10
|
+
import "@radix-ui/react-scroll-area";
|
|
11
|
+
import "@floating-ui/react-dom";
|
|
12
|
+
import "jotai";
|
|
7
13
|
import "i18next";
|
|
8
14
|
import "react-i18next";
|
|
9
|
-
import "
|
|
15
|
+
import "flagged";
|
|
16
|
+
import "./STRINGS--j49GZJP.js";
|
|
10
17
|
import "./Functions-7jnEwJyw.js";
|
|
11
|
-
import "clsx";
|
|
12
18
|
import "tailwind-merge";
|
|
13
19
|
import "@chaibuilder/runtime";
|
|
14
|
-
import "jotai";
|
|
15
|
-
import "./STRINGS--j49GZJP.js";
|
|
16
20
|
import "@react-hookz/web";
|
|
17
21
|
import "./MODIFIERS-cBT31iqE.js";
|
|
18
|
-
import "./Class-6Hz2KzYb.js";
|
|
19
22
|
import "@radix-ui/react-toggle";
|
|
20
23
|
import "class-variance-authority";
|
|
24
|
+
import "./Class-6Hz2KzYb.js";
|
|
21
25
|
import "@radix-ui/react-switch";
|
|
22
26
|
import "@radix-ui/react-slot";
|
|
23
27
|
import "@radix-ui/react-accordion";
|
|
@@ -25,7 +29,6 @@ import "@radix-ui/react-icons";
|
|
|
25
29
|
import "@radix-ui/react-alert-dialog";
|
|
26
30
|
import "@radix-ui/react-dialog";
|
|
27
31
|
import "@radix-ui/react-label";
|
|
28
|
-
import "@radix-ui/react-scroll-area";
|
|
29
32
|
import "@radix-ui/react-tabs";
|
|
30
33
|
import "@radix-ui/react-tooltip";
|
|
31
34
|
import "@radix-ui/react-popover";
|
|
@@ -38,17 +41,14 @@ import "@radix-ui/react-toast";
|
|
|
38
41
|
import "cmdk";
|
|
39
42
|
import "@radix-ui/react-context-menu";
|
|
40
43
|
import "react-icons-picker";
|
|
41
|
-
import "react-dom";
|
|
42
44
|
import "react-quill";
|
|
43
|
-
import "@floating-ui/react-dom";
|
|
44
|
-
import "flagged";
|
|
45
45
|
import "react-hotkeys-hook";
|
|
46
|
+
import "lodash";
|
|
47
|
+
import "lucide-react";
|
|
46
48
|
import "sonner";
|
|
47
49
|
import "./html-to-json-ZV4QjSww.js";
|
|
48
50
|
import "himalaya";
|
|
49
|
-
import "
|
|
50
|
-
import "./index-YpnaudSM.js";
|
|
51
|
-
const x = i.lazy(() => import("./add-page-modal-hDyzsEU7.js")), u = i.lazy(() => import("./page-viewer-umQaut1j.js")), lt = () => {
|
|
51
|
+
const x = i.lazy(() => import("./add-page-modal-V9DTBMmY.js")), u = i.lazy(() => import("./page-viewer-AoJ5HU6j.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: [
|
|
@@ -0,0 +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-YqEKonJ_.cjs"),a=require("./index-eYwpNzUl.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-Xhu27KFD.cjs");require("himalaya");const d=r.lazy(()=>Promise.resolve().then(()=>require("./project-general-setting-WzJ8U1OW.cjs"))),m=r.lazy(()=>Promise.resolve().then(()=>require("./project-seo-setting-GuObNafp.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;
|
|
@@ -1,21 +1,26 @@
|
|
|
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 {
|
|
5
|
-
import { b as h, a as g } from "./index-
|
|
4
|
+
import { b2 as f, b3 as n, b4 as l, b5 as c } from "./ChaiBuilderEditor-y1NxvXJ7.js";
|
|
5
|
+
import { b as h, a as g } from "./index-OsS2_gM8.js";
|
|
6
6
|
import "./_commonjsHelpers-UyOWmZb0.js";
|
|
7
|
-
import "./Functions-7jnEwJyw.js";
|
|
8
7
|
import "clsx";
|
|
9
|
-
import "
|
|
10
|
-
import "@
|
|
8
|
+
import "react-dom";
|
|
9
|
+
import "@radix-ui/react-scroll-area";
|
|
10
|
+
import "@floating-ui/react-dom";
|
|
11
11
|
import "jotai";
|
|
12
|
+
import "i18next";
|
|
13
|
+
import "react-i18next";
|
|
14
|
+
import "flagged";
|
|
12
15
|
import "./STRINGS--j49GZJP.js";
|
|
16
|
+
import "./Functions-7jnEwJyw.js";
|
|
17
|
+
import "tailwind-merge";
|
|
18
|
+
import "@chaibuilder/runtime";
|
|
13
19
|
import "@react-hookz/web";
|
|
14
20
|
import "./MODIFIERS-cBT31iqE.js";
|
|
15
|
-
import "./Class-6Hz2KzYb.js";
|
|
16
|
-
import "react-i18next";
|
|
17
21
|
import "@radix-ui/react-toggle";
|
|
18
22
|
import "class-variance-authority";
|
|
23
|
+
import "./Class-6Hz2KzYb.js";
|
|
19
24
|
import "@radix-ui/react-switch";
|
|
20
25
|
import "@radix-ui/react-slot";
|
|
21
26
|
import "@radix-ui/react-accordion";
|
|
@@ -23,7 +28,6 @@ import "@radix-ui/react-icons";
|
|
|
23
28
|
import "@radix-ui/react-alert-dialog";
|
|
24
29
|
import "@radix-ui/react-dialog";
|
|
25
30
|
import "@radix-ui/react-label";
|
|
26
|
-
import "@radix-ui/react-scroll-area";
|
|
27
31
|
import "@radix-ui/react-tabs";
|
|
28
32
|
import "@radix-ui/react-tooltip";
|
|
29
33
|
import "@radix-ui/react-popover";
|
|
@@ -36,19 +40,15 @@ import "@radix-ui/react-toast";
|
|
|
36
40
|
import "cmdk";
|
|
37
41
|
import "@radix-ui/react-context-menu";
|
|
38
42
|
import "react-icons-picker";
|
|
39
|
-
import "react-dom";
|
|
40
43
|
import "react-quill";
|
|
41
|
-
import "./index-AJalHhkO.js";
|
|
42
|
-
import "i18next";
|
|
43
|
-
import "@floating-ui/react-dom";
|
|
44
|
-
import "flagged";
|
|
45
44
|
import "react-hotkeys-hook";
|
|
45
|
+
import "lodash";
|
|
46
|
+
import "lucide-react";
|
|
47
|
+
import "./core.js";
|
|
46
48
|
import "sonner";
|
|
47
49
|
import "./html-to-json-ZV4QjSww.js";
|
|
48
50
|
import "himalaya";
|
|
49
|
-
import "
|
|
50
|
-
import "./index-YpnaudSM.js";
|
|
51
|
-
const N = m.lazy(() => import("./project-general-setting-uuCemMCU.js")), S = m.lazy(() => import("./project-seo-setting-asvbPQiI.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) ? {
|
|
51
|
+
const N = m.lazy(() => import("./project-general-setting-g3YJYszB.js")), S = m.lazy(() => import("./project-seo-setting-1sLmV-wv.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;
|