@chaibuilder/sdk 1.2.19 → 1.2.21
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-157fSrJX.cjs +1 -0
- package/dist/{AddBlocks-gcTaEIKO.js → AddBlocks-WgpssWmQ.js} +25 -27
- package/dist/{BrandingOptions-bfiFY0VR.js → BrandingOptions-4961TxX2.js} +13 -15
- package/dist/BrandingOptions-nwXR9TMl.cjs +1 -0
- package/dist/CanvasArea-_BFTu_8b.js +908 -0
- package/dist/CanvasArea-eOKWgAXR.cjs +55 -0
- package/dist/{CurrentPage-0Ap2N0uc.js → CurrentPage-VAuh7F6E.js} +13 -16
- package/dist/CurrentPage-iB6nD9Rr.cjs +1 -0
- package/dist/ListTree-dvxHTXs4.js +167 -0
- package/dist/ListTree-gTmusfso.cjs +1 -0
- package/dist/Outline-g8XFGm2t.cjs +1 -0
- package/dist/Outline-jTFv40r5.js +294 -0
- package/dist/PagesPanel-Wx9JG5qR.cjs +1 -0
- package/dist/{PagesPanel-Pk-C1956.js → PagesPanel-oky0X1Ww.js} +5 -8
- package/dist/ProjectPanel-64Xg3Y_p.cjs +1 -0
- package/dist/{ProjectPanel-_KQBhuPO.js → ProjectPanel-WjVBiB-e.js} +15 -18
- package/dist/Settings-Tlqq4mqN.cjs +1 -0
- package/dist/{Settings-XtAatoiu.js → Settings-mNRbprbx.js} +761 -709
- package/dist/SidePanels-ZF4Q2R29.cjs +1 -0
- package/dist/{SidePanels-O52zKXbH.js → SidePanels-pQImwDI6.js} +7 -10
- package/dist/Topbar-NMvzqQHW.cjs +1 -0
- package/dist/{Topbar-oTx7a12r.js → Topbar-Ny9T-7Zb.js} +3 -5
- package/dist/TypeIcon-ElNNPazl.cjs +1 -0
- package/dist/TypeIcon-qO96rNbV.js +69 -0
- package/dist/UnsplashImages-6tZv1q2_.cjs +1 -0
- package/dist/{UnsplashImages-5A21uzMK.js → UnsplashImages-Y8RGFVSh.js} +13 -15
- package/dist/UploadImages-VLlVg9Ur.cjs +1 -0
- package/dist/{UploadImages-V_54lCAO.js → UploadImages-dd8LfyFr.js} +8 -10
- package/dist/{add-page-modal-dKQLw7RQ.js → add-page-modal-1mGGtAB_.js} +16 -19
- package/dist/add-page-modal-xCUKJiZv.cjs +1 -0
- package/dist/confirm-alert-f26zJ7Js.cjs +1 -0
- package/dist/{confirm-alert-8GP3bKH_.js → confirm-alert-sc8RaWvD.js} +3 -5
- package/dist/{controls-Dy1qa8Dc.cjs → controls-KK2oLIa8.cjs} +1 -1
- package/dist/{controls-XPXGHKht.js → controls-OfJWSEqC.js} +29 -28
- package/dist/core.cjs +1 -1
- package/dist/core.d.ts +1 -1
- package/dist/core.js +45 -48
- package/dist/delete-page-modal-Qa0YqBRl.cjs +1 -0
- package/dist/{delete-page-modal-Zb5ld6O-.js → delete-page-modal-yAJNstCa.js} +8 -11
- package/dist/email-blocks.cjs +1 -1
- package/dist/email-blocks.js +5 -5
- package/dist/email.cjs +1 -1
- package/dist/email.d.ts +1 -0
- package/dist/email.js +4 -7
- package/dist/{form-yyU2x7So.js → form-Nj6Kdn3g.js} +1 -1
- package/dist/{form-o6_55v8F.cjs → form-n1Q6u16z.cjs} +1 -1
- package/dist/index-9PHdn80L.cjs +1 -0
- package/dist/{index-JdnF6lYP.cjs → index-9YNkdni8.cjs} +51 -51
- package/dist/{index-WP7IRkij.js → index-IPJAbzzO.js} +1178 -1133
- package/dist/{index-BMZLAJUV.cjs → index-PlZjGTTr.cjs} +1 -1
- package/dist/{index-lFcrvDFC.js → index-iQEapw2W.js} +3 -3
- package/dist/{index-yILWlilS.js → index-kAjyc_KA.js} +8306 -8170
- package/dist/{page-viewer-3QXwPGpg.js → page-viewer-SU_BqZDK.js} +9 -12
- package/dist/page-viewer-ZA-sJD82.cjs +1 -0
- package/dist/project-general-setting-GuQyvAHS.cjs +1 -0
- package/dist/{project-general-setting-UalRmyHm.js → project-general-setting-eEmhoFvb.js} +7 -10
- package/dist/project-seo-setting-3-vBkx2v.cjs +1 -0
- package/dist/{project-seo-setting-8FsvPSPl.js → project-seo-setting-NNvAGt4T.js} +5 -7
- package/dist/single-page-detail-Z677SWqt.cjs +1 -0
- package/dist/{single-page-detail-GaB85dNv.js → single-page-detail-nxWIy6e7.js} +36 -39
- package/dist/studio.cjs +1 -1
- package/dist/studio.d.ts +1 -0
- package/dist/studio.js +4 -7
- package/dist/ui.cjs +1 -1
- package/dist/ui.js +138 -140
- package/dist/{useAddBlockByDrop-BIK2fdgj.js → useAddBlockByDrop-V8xo-PNQ.js} +1 -1
- package/dist/{useAddBlockByDrop-6EbioQV4.cjs → useAddBlockByDrop-qRHgy8_0.cjs} +1 -1
- package/dist/web-blocks.cjs +1 -1
- package/dist/web-blocks.js +1 -1
- package/package.json +26 -38
- package/dist/AddBlocks-KeHVFaIr.cjs +0 -1
- package/dist/BrandingOptions-I2I8w6E9.cjs +0 -1
- package/dist/CanvasArea-JfHkTnQD.cjs +0 -60
- package/dist/CanvasArea-xvMCbQDL.js +0 -1404
- package/dist/CurrentPage-vj52UxMA.cjs +0 -1
- package/dist/ListTree-Vq0_s1wC.cjs +0 -1
- package/dist/ListTree-k-QMO740.js +0 -96
- package/dist/Outline-HI6-c9nf.js +0 -359
- package/dist/Outline-fAflJ_lN.cjs +0 -1
- package/dist/PagesPanel-ug8Tmva6.cjs +0 -1
- package/dist/ProjectPanel-o8-6cPX-.cjs +0 -1
- package/dist/Settings-Cc9eV4VG.cjs +0 -1
- package/dist/SidePanels-ugRobm34.cjs +0 -1
- package/dist/Topbar-e5MGWX9n.cjs +0 -1
- package/dist/UnsplashImages-KSbKGs91.cjs +0 -1
- package/dist/UploadImages-V42YSRVO.cjs +0 -1
- package/dist/add-page-modal-xMedOdsp.cjs +0 -1
- package/dist/confirm-alert-KtW-4OjG.cjs +0 -1
- package/dist/delete-page-modal-lebJCBBe.cjs +0 -1
- package/dist/index-thKfFhmr.cjs +0 -1
- package/dist/page-viewer-DTIblLiz.cjs +0 -1
- package/dist/project-general-setting-g7WhM3hc.cjs +0 -1
- package/dist/project-seo-setting-xoeLQVj3.cjs +0 -1
- package/dist/single-page-detail-XdBysrE_.cjs +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-Z_BpKhVy.cjs"),t=require("./index-thKfFhmr.cjs"),i=require("lodash-es"),h=require("sonner"),l=require("react"),o=require("./index-BMZLAJUV.cjs"),j=require("lucide-react");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("./Functions-N3yhPYKY.cjs");require("clsx");require("tailwind-merge");require("@chaibuilder/runtime");require("jotai");require("./MODIFIERS-9EwxLM8V.cjs");require("@react-hookz/web");require("flat-to-nested");require("@radix-ui/react-toggle");require("class-variance-authority");require("./Class-MmCxz2Ay.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-scroll-area");require("@radix-ui/react-tabs");require("@radix-ui/react-tooltip");require("@radix-ui/react-popover");require("@radix-ui/react-menubar");require("@radix-ui/react-hover-card");require("@radix-ui/react-select");require("@radix-ui/react-dropdown-menu");require("@radix-ui/react-separator");require("@radix-ui/react-toast");require("cmdk");require("@radix-ui/react-context-menu");require("react-icons-picker");require("react-dom");require("react-quill");require("lodash");require("react-i18next");require("./index-JdnF6lYP.cjs");require("i18next");require("@floating-ui/react-dom");require("react-textarea-autosize");require("flagged");require("react-dnd");require("@minoru/react-dnd-treeview");require("react-hotkeys-hook");require("./html-to-json-FGufPv9R.cjs");require("himalaya");require("./index-ecnGWzh9.cjs");const p=()=>{const{data:s}=o.useProject(),{data:u,isLoading:x}=o.usePages(),{syncState:d}=t.useSavePage(),q=o.useChangePage(),[n,a]=o.useCurrentPage(),c=i.sortBy(i.filter(u,{type:"STATIC"}),r=>i.get(r,"uuid")===(s==null?void 0:s.homepage)?0:1);l.useEffect(()=>{!i.isEmpty(u)&&s.homepage&&!i.find(u,{uuid:n})&&a(s.homepage)},[n,u,s,a]),l.useEffect(()=>()=>a(null),[a]);const m=r=>{if(d!=="SAVED")h.toast.error("You have unsaved changes. Please save before changing the page.");else{const g=i.find(c,{uuid:r});q(g)}};return x||i.isEmpty(n)?null:e.jsxRuntimeExports.jsx("nav",{className:"flex rounded-lg border border-gray-200 bg-gray-50 px-3 pr-0 py-1 text-gray-700 dark:border-gray-700 dark:bg-gray-800","aria-label":"Breadcrumb",children:e.jsxRuntimeExports.jsxs("ol",{className:"inline-flex items-center space-x-1 md:space-x-3",children:[e.jsxRuntimeExports.jsx("li",{className:"inline-flex items-center",children:e.jsxRuntimeExports.jsxs("div",{className:"inline-flex items-center text-sm font-medium text-gray-500 dark:text-gray-400",children:[e.jsxRuntimeExports.jsx(j.BriefcaseIcon,{className:"w-4 h-4 mr-2"}),i.capitalize(s.name)]})}),e.jsxRuntimeExports.jsx("li",{"aria-current":"page",children:e.jsxRuntimeExports.jsxs("div",{className:"flex items-center",children:[e.jsxRuntimeExports.jsx("svg",{className:"mx-1 h-3 w-3 text-gray-400","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 6 10",children:e.jsxRuntimeExports.jsx("path",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"m1 9 4-4-4-4"})}),e.jsxRuntimeExports.jsxs(t.Select,{value:n||"",onValueChange:m,children:[e.jsxRuntimeExports.jsx(t.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(t.SelectValue,{placeholder:"Page"})}),e.jsxRuntimeExports.jsx(t.SelectContent,{className:"z-[999]",children:i.map(c,r=>e.jsxRuntimeExports.jsx(t.SelectItem,{value:r.uuid,children:r==null?void 0:r.name},r.uuid))})]})]})})]})})};exports.default=p;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("./jsx-runtime-Z_BpKhVy.cjs"),a=require("react-arborist"),m=require("./Functions-N3yhPYKY.cjs"),u=require("./index-thKfFhmr.cjs");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("react");require("lodash-es");require("clsx");require("tailwind-merge");require("@chaibuilder/runtime");require("jotai");require("./MODIFIERS-9EwxLM8V.cjs");require("@react-hookz/web");require("flat-to-nested");require("@radix-ui/react-toggle");require("class-variance-authority");require("./Class-MmCxz2Ay.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-scroll-area");require("@radix-ui/react-tabs");require("@radix-ui/react-tooltip");require("@radix-ui/react-popover");require("@radix-ui/react-menubar");require("@radix-ui/react-hover-card");require("@radix-ui/react-select");require("@radix-ui/react-dropdown-menu");require("@radix-ui/react-separator");require("@radix-ui/react-toast");require("cmdk");require("@radix-ui/react-context-menu");require("react-icons-picker");require("react-dom");require("react-quill");require("lodash");require("react-i18next");const x=[{id:"1",name:"Unread"},{id:"2",name:"Threads"},{id:"3",name:"Chat Rooms",children:[{id:"c1",name:"General"},{id:"c2",name:"Random"},{id:"c3",name:"Open Source Projects"}]},{id:"4",name:"Direct Messages",children:[{id:"d1",name:"Alice"},{id:"d2",name:"Bob"},{id:"d3",name:"Charlie"}]}];function h({node:r,style:n,dragHandle:s}){return i.jsxRuntimeExports.jsxs("div",{style:n,ref:s,children:[r.isLeaf?"🍁":"🗀",r.data.name]})}const j=()=>{const[r,n]=u.useSelectedBlockIds(),[,s]=u.useSelectedStylingBlocks(),c=()=>{n([]),s([])},t=({id:e,name:o})=>{console.log("onRename",{id:e,name:o})},l=({dragIds:e,parentId:o,index:q})=>{console.log("onMove",{dragIds:e,parentId:o,index:q})},d=({ids:e})=>{console.log("onDelete",{ids:e})};return i.jsxRuntimeExports.jsx("div",{onClick:()=>c(),className:m.cn("-mx-1 -mt-1 flex h-full select-none flex-col space-y-1"),children:i.jsxRuntimeExports.jsx(u.ScrollArea,{id:"layers-view",className:"no-scrollbar h-full overflow-y-auto p-1 px-2 text-xs",children:i.jsxRuntimeExports.jsx(a.Tree,{selection:r[0]||"",onRename:t,onMove:l,onDelete:d,data:x,idAccessor:"id",childrenAccessor:e=>e.children,children:h})})})};exports.default=j;
|
|
@@ -1,96 +0,0 @@
|
|
|
1
|
-
import { j as i } from "./jsx-runtime-WbnYoNE9.js";
|
|
2
|
-
import { Tree as a } from "react-arborist";
|
|
3
|
-
import { c as d } from "./Functions-7jnEwJyw.js";
|
|
4
|
-
import { r as f, ac as h, bg as x } from "./index-WP7IRkij.js";
|
|
5
|
-
import "./_commonjsHelpers-UyOWmZb0.js";
|
|
6
|
-
import "react";
|
|
7
|
-
import "lodash-es";
|
|
8
|
-
import "clsx";
|
|
9
|
-
import "tailwind-merge";
|
|
10
|
-
import "@chaibuilder/runtime";
|
|
11
|
-
import "jotai";
|
|
12
|
-
import "./MODIFIERS-WQdaNvb8.js";
|
|
13
|
-
import "@react-hookz/web";
|
|
14
|
-
import "flat-to-nested";
|
|
15
|
-
import "@radix-ui/react-toggle";
|
|
16
|
-
import "class-variance-authority";
|
|
17
|
-
import "./Class-3k8xjeiM.js";
|
|
18
|
-
import "@radix-ui/react-switch";
|
|
19
|
-
import "@radix-ui/react-slot";
|
|
20
|
-
import "@radix-ui/react-accordion";
|
|
21
|
-
import "@radix-ui/react-icons";
|
|
22
|
-
import "@radix-ui/react-alert-dialog";
|
|
23
|
-
import "@radix-ui/react-dialog";
|
|
24
|
-
import "@radix-ui/react-label";
|
|
25
|
-
import "@radix-ui/react-scroll-area";
|
|
26
|
-
import "@radix-ui/react-tabs";
|
|
27
|
-
import "@radix-ui/react-tooltip";
|
|
28
|
-
import "@radix-ui/react-popover";
|
|
29
|
-
import "@radix-ui/react-menubar";
|
|
30
|
-
import "@radix-ui/react-hover-card";
|
|
31
|
-
import "@radix-ui/react-select";
|
|
32
|
-
import "@radix-ui/react-dropdown-menu";
|
|
33
|
-
import "@radix-ui/react-separator";
|
|
34
|
-
import "@radix-ui/react-toast";
|
|
35
|
-
import "cmdk";
|
|
36
|
-
import "@radix-ui/react-context-menu";
|
|
37
|
-
import "react-icons-picker";
|
|
38
|
-
import "react-dom";
|
|
39
|
-
import "react-quill";
|
|
40
|
-
import "lodash";
|
|
41
|
-
import "react-i18next";
|
|
42
|
-
const u = [
|
|
43
|
-
{ id: "1", name: "Unread" },
|
|
44
|
-
{ id: "2", name: "Threads" },
|
|
45
|
-
{
|
|
46
|
-
id: "3",
|
|
47
|
-
name: "Chat Rooms",
|
|
48
|
-
children: [
|
|
49
|
-
{ id: "c1", name: "General" },
|
|
50
|
-
{ id: "c2", name: "Random" },
|
|
51
|
-
{ id: "c3", name: "Open Source Projects" }
|
|
52
|
-
]
|
|
53
|
-
},
|
|
54
|
-
{
|
|
55
|
-
id: "4",
|
|
56
|
-
name: "Direct Messages",
|
|
57
|
-
children: [
|
|
58
|
-
{ id: "d1", name: "Alice" },
|
|
59
|
-
{ id: "d2", name: "Bob" },
|
|
60
|
-
{ id: "d3", name: "Charlie" }
|
|
61
|
-
]
|
|
62
|
-
}
|
|
63
|
-
];
|
|
64
|
-
function j({ node: e, style: r, dragHandle: t }) {
|
|
65
|
-
return /* @__PURE__ */ i.jsxs("div", { style: r, ref: t, children: [
|
|
66
|
-
e.isLeaf ? "🍁" : "🗀",
|
|
67
|
-
e.data.name
|
|
68
|
-
] });
|
|
69
|
-
}
|
|
70
|
-
const mo = () => {
|
|
71
|
-
const [e, r] = f(), [, t] = h(), s = () => {
|
|
72
|
-
r([]), t([]);
|
|
73
|
-
}, n = ({ id: o, name: m }) => {
|
|
74
|
-
console.log("onRename", { id: o, name: m });
|
|
75
|
-
}, c = ({ dragIds: o, parentId: m, index: p }) => {
|
|
76
|
-
console.log("onMove", { dragIds: o, parentId: m, index: p });
|
|
77
|
-
}, l = ({ ids: o }) => {
|
|
78
|
-
console.log("onDelete", { ids: o });
|
|
79
|
-
};
|
|
80
|
-
return /* @__PURE__ */ i.jsx("div", { onClick: () => s(), className: d("-mx-1 -mt-1 flex h-full select-none flex-col space-y-1"), children: /* @__PURE__ */ i.jsx(x, { id: "layers-view", className: "no-scrollbar h-full overflow-y-auto p-1 px-2 text-xs", children: /* @__PURE__ */ i.jsx(
|
|
81
|
-
a,
|
|
82
|
-
{
|
|
83
|
-
selection: e[0] || "",
|
|
84
|
-
onRename: n,
|
|
85
|
-
onMove: c,
|
|
86
|
-
onDelete: l,
|
|
87
|
-
data: u,
|
|
88
|
-
idAccessor: "id",
|
|
89
|
-
childrenAccessor: (o) => o.children,
|
|
90
|
-
children: j
|
|
91
|
-
}
|
|
92
|
-
) }) });
|
|
93
|
-
};
|
|
94
|
-
export {
|
|
95
|
-
mo as default
|
|
96
|
-
};
|
package/dist/Outline-HI6-c9nf.js
DELETED
|
@@ -1,359 +0,0 @@
|
|
|
1
|
-
import { j as e } from "./jsx-runtime-WbnYoNE9.js";
|
|
2
|
-
import { nth as v, startsWith as _, map as T, isUndefined as H, find as A, isEmpty as L, includes as P } from "lodash-es";
|
|
3
|
-
import { BoxModelIcon as V, BoxIcon as F, DragHandleHorizontalIcon as z, ViewHorizontalIcon as $, BorderAllIcon as q, BorderTopIcon as K, TableIcon as U, DropdownMenuIcon as Y, RadiobuttonIcon as Q, InputIcon as G, ButtonIcon as B, CheckboxIcon as W, GroupIcon as X, SpaceBetweenVerticallyIcon as J, ColumnsIcon as Z, RowsIcon as w, TextIcon as C, SketchLogoIcon as ee, DividerHorizontalIcon as te, CodeIcon as se, CursorTextIcon as oe, VideoIcon as re, Link1Icon as ne, HeadingIcon as ae, ImageIcon as ce, TriangleRightIcon as ie, TrashIcon as le, CopyIcon as de, DoubleArrowDownIcon as xe, StackIcon as me } from "@radix-ui/react-icons";
|
|
4
|
-
import { useDrop as ue, useDragLayer as pe } from "react-dnd";
|
|
5
|
-
import { useDragOver as ge, Tree as he } from "@minoru/react-dnd-treeview";
|
|
6
|
-
import { useTranslation as je } from "react-i18next";
|
|
7
|
-
import { Y as be, X as fe, h as Ie, ap as ye, aq as ke, ar as ve, r as I, s as Be, a1 as D, bq as N, aS as we, t as Ce, br as Te, aR as De, bs as Ne, bt as Se, E as Oe, aM as Re, ac as Me, bu as Ee, bg as _e, bv as He } from "./index-WP7IRkij.js";
|
|
8
|
-
import { DatabaseIcon as Ae } from "lucide-react";
|
|
9
|
-
import { useMemo as Le, useCallback as Pe } from "react";
|
|
10
|
-
import { a as Ve } from "./MODIFIERS-WQdaNvb8.js";
|
|
11
|
-
import { c as S } from "./Functions-7jnEwJyw.js";
|
|
12
|
-
import { a as Fe, d as ze } from "./index-yILWlilS.js";
|
|
13
|
-
import { u as $e } from "./useAddBlockByDrop-BIK2fdgj.js";
|
|
14
|
-
import "./_commonjsHelpers-UyOWmZb0.js";
|
|
15
|
-
import "@chaibuilder/runtime";
|
|
16
|
-
import "jotai";
|
|
17
|
-
import "@react-hookz/web";
|
|
18
|
-
import "flat-to-nested";
|
|
19
|
-
import "@radix-ui/react-toggle";
|
|
20
|
-
import "class-variance-authority";
|
|
21
|
-
import "./Class-3k8xjeiM.js";
|
|
22
|
-
import "clsx";
|
|
23
|
-
import "tailwind-merge";
|
|
24
|
-
import "@radix-ui/react-switch";
|
|
25
|
-
import "@radix-ui/react-slot";
|
|
26
|
-
import "@radix-ui/react-accordion";
|
|
27
|
-
import "@radix-ui/react-alert-dialog";
|
|
28
|
-
import "@radix-ui/react-dialog";
|
|
29
|
-
import "@radix-ui/react-label";
|
|
30
|
-
import "@radix-ui/react-scroll-area";
|
|
31
|
-
import "@radix-ui/react-tabs";
|
|
32
|
-
import "@radix-ui/react-tooltip";
|
|
33
|
-
import "@radix-ui/react-popover";
|
|
34
|
-
import "@radix-ui/react-menubar";
|
|
35
|
-
import "@radix-ui/react-hover-card";
|
|
36
|
-
import "@radix-ui/react-select";
|
|
37
|
-
import "@radix-ui/react-dropdown-menu";
|
|
38
|
-
import "@radix-ui/react-separator";
|
|
39
|
-
import "@radix-ui/react-toast";
|
|
40
|
-
import "cmdk";
|
|
41
|
-
import "@radix-ui/react-context-menu";
|
|
42
|
-
import "react-icons-picker";
|
|
43
|
-
import "react-dom";
|
|
44
|
-
import "react-quill";
|
|
45
|
-
import "lodash";
|
|
46
|
-
import "i18next";
|
|
47
|
-
import "@floating-ui/react-dom";
|
|
48
|
-
import "react-textarea-autosize";
|
|
49
|
-
import "flagged";
|
|
50
|
-
import "react-hotkeys-hook";
|
|
51
|
-
const O = (t) => {
|
|
52
|
-
switch (t.type) {
|
|
53
|
-
case "Image":
|
|
54
|
-
return /* @__PURE__ */ e.jsx(ce, {});
|
|
55
|
-
case "Heading":
|
|
56
|
-
return /* @__PURE__ */ e.jsx(ae, {});
|
|
57
|
-
case "Text":
|
|
58
|
-
return /* @__PURE__ */ e.jsx(C, {});
|
|
59
|
-
case "Link":
|
|
60
|
-
return /* @__PURE__ */ e.jsx(ne, {});
|
|
61
|
-
case "Video":
|
|
62
|
-
return /* @__PURE__ */ e.jsx(re, {});
|
|
63
|
-
case "RichText":
|
|
64
|
-
return /* @__PURE__ */ e.jsx(oe, {});
|
|
65
|
-
case "Button":
|
|
66
|
-
return /* @__PURE__ */ e.jsx(B, {});
|
|
67
|
-
case "CustomHTML":
|
|
68
|
-
return /* @__PURE__ */ e.jsx(se, {});
|
|
69
|
-
case "Divider":
|
|
70
|
-
return /* @__PURE__ */ e.jsx(te, {});
|
|
71
|
-
case "Icon":
|
|
72
|
-
return /* @__PURE__ */ e.jsx(ee, {});
|
|
73
|
-
case "List":
|
|
74
|
-
return /* @__PURE__ */ e.jsx(w, {});
|
|
75
|
-
case "Paragraph":
|
|
76
|
-
return /* @__PURE__ */ e.jsx(C, {});
|
|
77
|
-
case "Row":
|
|
78
|
-
return /* @__PURE__ */ e.jsx(w, {});
|
|
79
|
-
case "ListItem":
|
|
80
|
-
return /* @__PURE__ */ e.jsx(Z, {});
|
|
81
|
-
case "LineBreak":
|
|
82
|
-
return /* @__PURE__ */ e.jsx(J, {});
|
|
83
|
-
case "Form":
|
|
84
|
-
return /* @__PURE__ */ e.jsx(X, {});
|
|
85
|
-
case "Checkbox":
|
|
86
|
-
return /* @__PURE__ */ e.jsx(W, {});
|
|
87
|
-
case "FormButton":
|
|
88
|
-
return /* @__PURE__ */ e.jsx(B, {});
|
|
89
|
-
case "Input":
|
|
90
|
-
case "TextArea":
|
|
91
|
-
return /* @__PURE__ */ e.jsx(G, {});
|
|
92
|
-
case "Radio":
|
|
93
|
-
return /* @__PURE__ */ e.jsx(Q, {});
|
|
94
|
-
case "Select":
|
|
95
|
-
return /* @__PURE__ */ e.jsx(Y, {});
|
|
96
|
-
case "Table":
|
|
97
|
-
return /* @__PURE__ */ e.jsx(U, {});
|
|
98
|
-
case "TableHead":
|
|
99
|
-
return /* @__PURE__ */ e.jsx(K, {});
|
|
100
|
-
case "TableBody":
|
|
101
|
-
return /* @__PURE__ */ e.jsx(q, {});
|
|
102
|
-
case "TableRow":
|
|
103
|
-
return /* @__PURE__ */ e.jsx($, {});
|
|
104
|
-
case "TableCell":
|
|
105
|
-
return /* @__PURE__ */ e.jsx(z, {});
|
|
106
|
-
case "DataProvider":
|
|
107
|
-
return /* @__PURE__ */ e.jsx(Ae, { size: 16 });
|
|
108
|
-
case "Box":
|
|
109
|
-
return /* @__PURE__ */ e.jsx(F, {});
|
|
110
|
-
default:
|
|
111
|
-
return /* @__PURE__ */ e.jsx(V, {});
|
|
112
|
-
}
|
|
113
|
-
};
|
|
114
|
-
function qe(t = "") {
|
|
115
|
-
const s = {
|
|
116
|
-
xs: "390px",
|
|
117
|
-
sm: "640px",
|
|
118
|
-
md: "768px",
|
|
119
|
-
lg: "1024px",
|
|
120
|
-
xl: "1366px",
|
|
121
|
-
"2xl": "1536px"
|
|
122
|
-
};
|
|
123
|
-
if (new RegExp(/\bsr-only\b/).test(t))
|
|
124
|
-
return "Sr Only";
|
|
125
|
-
if (new RegExp(/\b(sm|md|lg|xl|2xl):hidden\b/).test(t))
|
|
126
|
-
return "Visible on mobile";
|
|
127
|
-
if (t.match(/(^| )hidden( |$)/g)) {
|
|
128
|
-
const i = new RegExp(
|
|
129
|
-
// checks if any of the display property is set for any higher media query
|
|
130
|
-
/\b(sm|md|lg|xl|2xl):(block|grid|flex|inline|inline-grid|inline-flex|inline-block)\b/
|
|
131
|
-
), n = t.match(i);
|
|
132
|
-
if (v(n, 1))
|
|
133
|
-
return `Visible >=${s[v(n, 1)]}`;
|
|
134
|
-
}
|
|
135
|
-
return "";
|
|
136
|
-
}
|
|
137
|
-
function Ke(t) {
|
|
138
|
-
return t.split("/").pop();
|
|
139
|
-
}
|
|
140
|
-
const Ue = (t) => {
|
|
141
|
-
let s = "";
|
|
142
|
-
return Object.keys(t).forEach((r) => {
|
|
143
|
-
_(t[r], Ve) && (s = t[r]);
|
|
144
|
-
}), s;
|
|
145
|
-
}, Ye = (t) => {
|
|
146
|
-
var u;
|
|
147
|
-
const [, s] = be(), [r] = fe(), c = Ie("outlineMenuItems", []), { isSelected: i } = t, { id: n, data: l } = t.node, p = t.depth * 10, x = (a) => {
|
|
148
|
-
a.stopPropagation(), t.onToggle(t.node.id);
|
|
149
|
-
}, g = ge(n, t.isOpen, t.onToggle), m = Le(() => {
|
|
150
|
-
const a = Ue(t.node.data);
|
|
151
|
-
return qe(a);
|
|
152
|
-
}, [t.node.data]);
|
|
153
|
-
return (
|
|
154
|
-
// eslint-disable-next-line jsx-a11y/click-events-have-key-events,jsx-a11y/no-static-element-interactions
|
|
155
|
-
/* @__PURE__ */ e.jsx(
|
|
156
|
-
"div",
|
|
157
|
-
{
|
|
158
|
-
onMouseEnter: () => s(n),
|
|
159
|
-
className: S(
|
|
160
|
-
"group flex w-full items-center justify-between space-x-px py-px",
|
|
161
|
-
i ? "bg-blue-500 text-white" : "text-gray-600 hover:bg-gray-200 dark:hover:bg-gray-800"
|
|
162
|
-
),
|
|
163
|
-
onClick: (a) => {
|
|
164
|
-
a.stopPropagation(), !r.includes(n) && t.onSelect(n);
|
|
165
|
-
},
|
|
166
|
-
onContextMenu: () => t.onSelect(n),
|
|
167
|
-
style: { paddingInlineStart: p },
|
|
168
|
-
...g,
|
|
169
|
-
children: /* @__PURE__ */ e.jsxs("div", { className: "flex w-full items-center justify-between pr-2", children: [
|
|
170
|
-
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center", children: [
|
|
171
|
-
/* @__PURE__ */ e.jsx(
|
|
172
|
-
"div",
|
|
173
|
-
{
|
|
174
|
-
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" : ""}`,
|
|
175
|
-
children: t.node.droppable && /* @__PURE__ */ e.jsx("button", { onClick: x, type: "button", children: /* @__PURE__ */ e.jsx(ie, {}) })
|
|
176
|
-
}
|
|
177
|
-
),
|
|
178
|
-
/* @__PURE__ */ e.jsxs("button", { type: "button", className: "flex items-center", children: [
|
|
179
|
-
/* @__PURE__ */ e.jsx("div", { className: "-mt-1 h-3 w-3", children: /* @__PURE__ */ e.jsx(O, { type: l == null ? void 0 : l._type }) }),
|
|
180
|
-
/* @__PURE__ */ e.jsx("div", { className: "ml-2 truncate text-[11px]", children: ((u = t.node.data) == null ? void 0 : u._name) || Ke(t.node.text) }),
|
|
181
|
-
m ? /* @__PURE__ */ e.jsxs(
|
|
182
|
-
"span",
|
|
183
|
-
{
|
|
184
|
-
className: "ml-2 flex items-center truncate text-[10px] italic " + (i ? "text-gray-200" : "text-gray-500"),
|
|
185
|
-
children: [
|
|
186
|
-
"(",
|
|
187
|
-
m,
|
|
188
|
-
")"
|
|
189
|
-
]
|
|
190
|
-
}
|
|
191
|
-
) : null
|
|
192
|
-
] })
|
|
193
|
-
] }),
|
|
194
|
-
/* @__PURE__ */ e.jsx("div", { className: "invisible flex items-center space-x-1 group-hover:visible", children: c.map((a) => /* @__PURE__ */ e.jsxs(ye, { children: [
|
|
195
|
-
/* @__PURE__ */ e.jsx(
|
|
196
|
-
ke,
|
|
197
|
-
{
|
|
198
|
-
className: "cursor-pointer rounded bg-transparent hover:bg-white hover:text-blue-500",
|
|
199
|
-
asChild: !0,
|
|
200
|
-
children: a.item(n)
|
|
201
|
-
}
|
|
202
|
-
),
|
|
203
|
-
/* @__PURE__ */ e.jsx(ve, { children: a.tooltip })
|
|
204
|
-
] })) })
|
|
205
|
-
] })
|
|
206
|
-
}
|
|
207
|
-
)
|
|
208
|
-
);
|
|
209
|
-
}, Qe = (t) => {
|
|
210
|
-
var r;
|
|
211
|
-
const { item: s } = t.monitorProps;
|
|
212
|
-
return /* @__PURE__ */ e.jsxs("div", { className: "flex w-max items-center bg-blue-200 bg-opacity-30 p-1 font-semibold text-blue-700", children: [
|
|
213
|
-
/* @__PURE__ */ e.jsx("div", { className: "", children: /* @__PURE__ */ e.jsx(O, { type: (r = s == null ? void 0 : s.data) == null ? void 0 : r._type }) }),
|
|
214
|
-
/* @__PURE__ */ e.jsx("div", { className: "ml-2 truncate text-[11px]", children: s.text })
|
|
215
|
-
] });
|
|
216
|
-
}, Ge = (t) => {
|
|
217
|
-
const s = t.depth * 10 + 16;
|
|
218
|
-
return /* @__PURE__ */ e.jsx("div", { className: "absolute right-0 top-0 h-0.5 -translate-y-1/2 transform bg-green-500", style: { left: s } });
|
|
219
|
-
}, We = () => {
|
|
220
|
-
const [t] = I(), s = Be(), r = D();
|
|
221
|
-
return /* @__PURE__ */ e.jsxs(
|
|
222
|
-
N,
|
|
223
|
-
{
|
|
224
|
-
disabled: !we(r == null ? void 0 : r._type),
|
|
225
|
-
className: "flex items-center gap-x-4 text-xs",
|
|
226
|
-
onClick: () => s(t),
|
|
227
|
-
children: [
|
|
228
|
-
/* @__PURE__ */ e.jsx(le, {}),
|
|
229
|
-
" Remove"
|
|
230
|
-
]
|
|
231
|
-
}
|
|
232
|
-
);
|
|
233
|
-
}, Xe = () => {
|
|
234
|
-
const [t] = I(), s = Ce(), r = D(), c = Pe(() => {
|
|
235
|
-
s(t);
|
|
236
|
-
}, [t, s]);
|
|
237
|
-
return /* @__PURE__ */ e.jsxs(Te, { className: "text-xs", children: [
|
|
238
|
-
/* @__PURE__ */ e.jsxs(
|
|
239
|
-
N,
|
|
240
|
-
{
|
|
241
|
-
disabled: !De(r == null ? void 0 : r._type),
|
|
242
|
-
className: "flex items-center gap-x-4 text-xs",
|
|
243
|
-
onClick: c,
|
|
244
|
-
children: [
|
|
245
|
-
/* @__PURE__ */ e.jsx(de, {}),
|
|
246
|
-
" Duplicate"
|
|
247
|
-
]
|
|
248
|
-
}
|
|
249
|
-
),
|
|
250
|
-
/* @__PURE__ */ e.jsx(We, {})
|
|
251
|
-
] });
|
|
252
|
-
}, Je = ({ children: t }) => /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsxs(Ne, { children: [
|
|
253
|
-
/* @__PURE__ */ e.jsx(Se, { children: t }),
|
|
254
|
-
/* @__PURE__ */ e.jsx(Xe, {})
|
|
255
|
-
] }) });
|
|
256
|
-
function Ze(t) {
|
|
257
|
-
return T(t, (s) => {
|
|
258
|
-
const { data: r } = s;
|
|
259
|
-
return {
|
|
260
|
-
...r,
|
|
261
|
-
_parent: s.parent === 0 ? null : s.parent
|
|
262
|
-
};
|
|
263
|
-
});
|
|
264
|
-
}
|
|
265
|
-
const Wt = () => {
|
|
266
|
-
const [t] = Oe(), { setNewBlocks: s } = Re(), [r, c, i] = I(), [, n] = Me(), { t: l } = je(), p = Fe(), x = $e(), [g] = Ee(), m = async (o, d) => {
|
|
267
|
-
const { dragSource: j, relativeIndex: b, dropTargetId: f, monitor: y } = d;
|
|
268
|
-
if (j) {
|
|
269
|
-
const k = Ze(o);
|
|
270
|
-
s(k), ze("Handle Drop -> New Blocks -> ", k);
|
|
271
|
-
const E = y.getItem();
|
|
272
|
-
c([E.id]);
|
|
273
|
-
} else
|
|
274
|
-
await x({ block: y.getItem(), dropTargetId: f, relativeIndex: b });
|
|
275
|
-
}, u = T(t, (o) => ({
|
|
276
|
-
id: o._id,
|
|
277
|
-
text: o._type,
|
|
278
|
-
parent: o._parent || 0,
|
|
279
|
-
droppable: !H(A(t, { _parent: o._id })),
|
|
280
|
-
data: o
|
|
281
|
-
})), a = () => {
|
|
282
|
-
c([]), n([]);
|
|
283
|
-
}, [{ isOver: h }, R] = ue(() => ({
|
|
284
|
-
accept: ["CHAI_BLOCK"],
|
|
285
|
-
collect: (o) => ({
|
|
286
|
-
canDrop: o.canDrop(),
|
|
287
|
-
isOver: o.isOver()
|
|
288
|
-
}),
|
|
289
|
-
drop: (o) => {
|
|
290
|
-
(async () => await x({
|
|
291
|
-
block: o,
|
|
292
|
-
dropTargetId: "",
|
|
293
|
-
relativeIndex: 0
|
|
294
|
-
}))();
|
|
295
|
-
}
|
|
296
|
-
})), { isDragging: M } = pe((o) => ({
|
|
297
|
-
isDragging: o.isDragging()
|
|
298
|
-
}));
|
|
299
|
-
return /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsx(
|
|
300
|
-
"div",
|
|
301
|
-
{
|
|
302
|
-
onClick: () => a(),
|
|
303
|
-
className: S(
|
|
304
|
-
"-mx-1 -mt-1 flex h-full select-none flex-col space-y-1",
|
|
305
|
-
M ? "bg-green-50/80" : "bg-background"
|
|
306
|
-
),
|
|
307
|
-
children: L(t) ? /* @__PURE__ */ e.jsxs(
|
|
308
|
-
"div",
|
|
309
|
-
{
|
|
310
|
-
ref: R,
|
|
311
|
-
className: `mx-1 mt-4 h-full max-w-full p-6 text-center text-sm text-gray-400 ${h ? "bg-blue-200" : ""}`,
|
|
312
|
-
children: [
|
|
313
|
-
h ? /* @__PURE__ */ e.jsx(xe, { className: "mx-auto h-12 w-12 animate-bounce" }) : /* @__PURE__ */ e.jsx(me, { className: "mx-auto h-10 w-10" }),
|
|
314
|
-
/* @__PURE__ */ e.jsx("p", { className: "mt-2", children: l(h ? "drop_here_message" : "tree_view_no_blocks") })
|
|
315
|
-
]
|
|
316
|
-
}
|
|
317
|
-
) : /* @__PURE__ */ e.jsx(_e, { id: "layers-view", className: "no-scrollbar h-full overflow-y-auto p-1", children: /* @__PURE__ */ e.jsx(
|
|
318
|
-
he,
|
|
319
|
-
{
|
|
320
|
-
initialOpen: p,
|
|
321
|
-
extraAcceptTypes: ["CHAI_BLOCK"],
|
|
322
|
-
tree: u,
|
|
323
|
-
rootId: 0,
|
|
324
|
-
render: (o, { depth: d, isOpen: j, onToggle: b }) => /* @__PURE__ */ e.jsx(Je, { id: o.id, children: /* @__PURE__ */ e.jsx(
|
|
325
|
-
Ye,
|
|
326
|
-
{
|
|
327
|
-
onSelect: (f) => {
|
|
328
|
-
n([]), c([f]);
|
|
329
|
-
},
|
|
330
|
-
isSelected: P(r, o.id),
|
|
331
|
-
node: o,
|
|
332
|
-
depth: d,
|
|
333
|
-
isOpen: j,
|
|
334
|
-
onToggle: b,
|
|
335
|
-
toggleIds: i
|
|
336
|
-
}
|
|
337
|
-
) }),
|
|
338
|
-
dragPreviewRender: (o) => /* @__PURE__ */ e.jsx(Qe, { monitorProps: o }),
|
|
339
|
-
onDrop: m,
|
|
340
|
-
classes: {
|
|
341
|
-
root: "h-[90%] " + (g ? "pl-2" : "pt-2"),
|
|
342
|
-
draggingSource: "opacity-30",
|
|
343
|
-
dropTarget: "bg-green-100",
|
|
344
|
-
placeholder: "relative"
|
|
345
|
-
},
|
|
346
|
-
sort: !1,
|
|
347
|
-
insertDroppableFirst: !1,
|
|
348
|
-
canDrop: He,
|
|
349
|
-
dropTargetOffset: 2,
|
|
350
|
-
enableAnimateExpand: !0,
|
|
351
|
-
placeholderRender: (o, { depth: d }) => /* @__PURE__ */ e.jsx(Ge, { node: o, depth: d })
|
|
352
|
-
}
|
|
353
|
-
) })
|
|
354
|
-
}
|
|
355
|
-
) });
|
|
356
|
-
};
|
|
357
|
-
export {
|
|
358
|
-
Wt as default
|
|
359
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-Z_BpKhVy.cjs"),u=require("lodash-es"),s=require("@radix-ui/react-icons"),y=require("react-dnd"),v=require("@minoru/react-dnd-treeview"),O=require("react-i18next"),r=require("./index-thKfFhmr.cjs"),M=require("lucide-react"),w=require("react"),_=require("./MODIFIERS-9EwxLM8V.cjs"),T=require("./Functions-N3yhPYKY.cjs"),B=require("./index-JdnF6lYP.cjs"),H=require("./useAddBlockByDrop-6EbioQV4.cjs");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("@chaibuilder/runtime");require("jotai");require("@react-hookz/web");require("flat-to-nested");require("@radix-ui/react-toggle");require("class-variance-authority");require("./Class-MmCxz2Ay.cjs");require("clsx");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-scroll-area");require("@radix-ui/react-tabs");require("@radix-ui/react-tooltip");require("@radix-ui/react-popover");require("@radix-ui/react-menubar");require("@radix-ui/react-hover-card");require("@radix-ui/react-select");require("@radix-ui/react-dropdown-menu");require("@radix-ui/react-separator");require("@radix-ui/react-toast");require("cmdk");require("@radix-ui/react-context-menu");require("react-icons-picker");require("react-dom");require("react-quill");require("lodash");require("i18next");require("@floating-ui/react-dom");require("react-textarea-autosize");require("flagged");require("react-hotkeys-hook");const C=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(M.DatabaseIcon,{size:16});case"Box":return e.jsxRuntimeExports.jsx(s.BoxIcon,{});default:return e.jsxRuntimeExports.jsx(s.BoxModelIcon,{})}};function A(t=""){const n={xs:"390px",sm:"640px",md:"768px",lg:"1024px",xl:"1366px","2xl":"1536px"};if(new RegExp(/\bsr-only\b/).test(t))return"Sr Only";if(new RegExp(/\b(sm|md|lg|xl|2xl):hidden\b/).test(t))return"Visible on mobile";if(t.match(/(^| )hidden( |$)/g)){const a=new RegExp(/\b(sm|md|lg|xl|2xl):(block|grid|flex|inline|inline-grid|inline-flex|inline-block)\b/),c=t.match(a);if(u.nth(c,1))return`Visible >=${n[u.nth(c,1)]}`}return""}function L(t){return t.split("/").pop()}const P=t=>{let n="";return Object.keys(t).forEach(i=>{u.startsWith(t[i],_.STYLES_KEY)&&(n=t[i])}),n},F=t=>{var g;const[,n]=r.useHighlightBlockId(),[i]=r.useHiddenBlockIds(),l=r.useBuilderProp("outlineMenuItems",[]),{isSelected:a}=t,{id:c,data:d}=t.node,R=t.depth*10,m=x=>{x.stopPropagation(),t.onToggle(t.node.id)},E=v.useDragOver(c,t.isOpen,t.onToggle),j=w.useMemo(()=>{const x=P(t.node.data);return A(x)},[t.node.data]);return e.jsxRuntimeExports.jsx("div",{onMouseEnter:()=>n(c),className:T.cn("group flex w-full items-center justify-between space-x-px py-px",a?"bg-blue-500 text-white":"text-gray-600 hover:bg-gray-200 dark:hover:bg-gray-800"),onClick:x=>{x.stopPropagation(),!i.includes(c)&&t.onSelect(c)},onContextMenu:()=>t.onSelect(c),style:{paddingInlineStart:R},...E,children:e.jsxRuntimeExports.jsxs("div",{className:"flex w-full items-center justify-between pr-2",children:[e.jsxRuntimeExports.jsxs("div",{className:"flex items-center",children:[e.jsxRuntimeExports.jsx("div",{className:`flex h-4 w-4 rotate-0 transform cursor-pointer items-center justify-center text-xs transition-transform duration-100 ${t.isOpen?"rotate-90":""}`,children:t.node.droppable&&e.jsxRuntimeExports.jsx("button",{onClick:m,type:"button",children:e.jsxRuntimeExports.jsx(s.TriangleRightIcon,{})})}),e.jsxRuntimeExports.jsxs("button",{type:"button",className:"flex items-center",children:[e.jsxRuntimeExports.jsx("div",{className:"-mt-1 h-3 w-3",children:e.jsxRuntimeExports.jsx(C,{type:d==null?void 0:d._type})}),e.jsxRuntimeExports.jsx("div",{className:"ml-2 truncate text-[11px]",children:((g=t.node.data)==null?void 0:g._name)||L(t.node.text)}),j?e.jsxRuntimeExports.jsxs("span",{className:"ml-2 flex items-center truncate text-[10px] italic "+(a?"text-gray-200":"text-gray-500"),children:["(",j,")"]}):null]})]}),e.jsxRuntimeExports.jsx("div",{className:"invisible flex items-center space-x-1 group-hover:visible",children:l.map(x=>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:x.item(c)}),e.jsxRuntimeExports.jsx(r.TooltipContent,{children:x.tooltip})]}))})]})})},V=t=>{var i;const{item:n}=t.monitorProps;return e.jsxRuntimeExports.jsxs("div",{className:"flex w-max items-center bg-blue-200 bg-opacity-30 p-1 font-semibold text-blue-700",children:[e.jsxRuntimeExports.jsx("div",{className:"",children:e.jsxRuntimeExports.jsx(C,{type:(i=n==null?void 0:n.data)==null?void 0:i._type})}),e.jsxRuntimeExports.jsx("div",{className:"ml-2 truncate text-[11px]",children:n.text})]})},z=t=>{const n=t.depth*10+16;return e.jsxRuntimeExports.jsx("div",{className:"absolute right-0 top-0 h-0.5 -translate-y-1/2 transform bg-green-500",style:{left:n}})},$=()=>{const[t]=r.useSelectedBlockIds(),n=r.useRemoveBlocks(),i=r.useSelectedBlock();return e.jsxRuntimeExports.jsxs(r.ContextMenuItem,{disabled:!r.canDeleteBlock(i==null?void 0:i._type),className:"flex items-center gap-x-4 text-xs",onClick:()=>n(t),children:[e.jsxRuntimeExports.jsx(s.TrashIcon,{})," Remove"]})},K=()=>{const[t]=r.useSelectedBlockIds(),n=r.useDuplicateBlocks(),i=r.useSelectedBlock(),l=w.useCallback(()=>{n(t)},[t,n]);return e.jsxRuntimeExports.jsxs(r.ContextMenuContent,{className:"text-xs",children:[e.jsxRuntimeExports.jsxs(r.ContextMenuItem,{disabled:!r.canDuplicateBlock(i==null?void 0:i._type),className:"flex items-center gap-x-4 text-xs",onClick:l,children:[e.jsxRuntimeExports.jsx(s.CopyIcon,{})," Duplicate"]}),e.jsxRuntimeExports.jsx($,{})]})},U=({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(K,{})]})});function Q(t){return u.map(t,n=>{const{data:i}=n;return{...i,_parent:n.parent===0?null:n.parent}})}const Y=()=>{const[t]=r.useBlocksStore(),{setNewBlocks:n}=r.useBlocksStoreUndoableActions(),[i,l,a]=r.useSelectedBlockIds(),[,c]=r.useSelectedStylingBlocks(),{t:d}=O.useTranslation(),R=B.useExpandedIds(),m=H.useAddBlockByDrop(),[E]=r.useBlocksContainer(),j=async(o,p)=>{const{dragSource:I,relativeIndex:b,dropTargetId:q,monitor:f}=p;if(I){const k=Q(o);n(k),B.debugLog("Handle Drop -> New Blocks -> ",k);const N=f.getItem();l([N.id])}else await m({block:f.getItem(),dropTargetId:q,relativeIndex:b})},g=u.map(t,o=>({id:o._id,text:o._type,parent:o._parent||0,droppable:!u.isUndefined(u.find(t,{_parent:o._id})),data:o})),x=()=>{l([]),c([])},[{isOver:h},D]=y.useDrop(()=>({accept:["CHAI_BLOCK"],collect:o=>({canDrop:o.canDrop(),isOver:o.isOver()}),drop:o=>{(async()=>await m({block:o,dropTargetId:"",relativeIndex:0}))()}})),{isDragging:S}=y.useDragLayer(o=>({isDragging:o.isDragging()}));return e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:e.jsxRuntimeExports.jsx("div",{onClick:()=>x(),className:T.cn("-mx-1 -mt-1 flex h-full select-none flex-col space-y-1",S?"bg-green-50/80":"bg-background"),children:u.isEmpty(t)?e.jsxRuntimeExports.jsxs("div",{ref:D,className:`mx-1 mt-4 h-full max-w-full p-6 text-center text-sm text-gray-400 ${h?"bg-blue-200":""}`,children:[h?e.jsxRuntimeExports.jsx(s.DoubleArrowDownIcon,{className:"mx-auto h-12 w-12 animate-bounce"}):e.jsxRuntimeExports.jsx(s.StackIcon,{className:"mx-auto h-10 w-10"}),e.jsxRuntimeExports.jsx("p",{className:"mt-2",children:d(h?"drop_here_message":"tree_view_no_blocks")})]}):e.jsxRuntimeExports.jsx(r.ScrollArea,{id:"layers-view",className:"no-scrollbar h-full overflow-y-auto p-1",children:e.jsxRuntimeExports.jsx(v.Tree,{initialOpen:R,extraAcceptTypes:["CHAI_BLOCK"],tree:g,rootId:0,render:(o,{depth:p,isOpen:I,onToggle:b})=>e.jsxRuntimeExports.jsx(U,{id:o.id,children:e.jsxRuntimeExports.jsx(F,{onSelect:q=>{c([]),l([q])},isSelected:u.includes(i,o.id),node:o,depth:p,isOpen:I,onToggle:b,toggleIds:a})}),dragPreviewRender:o=>e.jsxRuntimeExports.jsx(V,{monitorProps:o}),onDrop:j,classes:{root:"h-[90%] "+(E?"pl-2":"pt-2"),draggingSource:"opacity-30",dropTarget:"bg-green-100",placeholder:"relative"},sort:!1,insertDroppableFirst:!1,canDrop:r.canDropBlock,dropTargetOffset:2,enableAnimateExpand:!0,placeholderRender:(o,{depth:p})=>e.jsxRuntimeExports.jsx(z,{node:o,depth:p})})})})})};exports.default=Y;
|
|
@@ -1 +0,0 @@
|
|
|
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-BMZLAJUV.cjs");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("./index-JdnF6lYP.cjs");require("i18next");require("react-i18next");require("./index-thKfFhmr.cjs");require("./Functions-N3yhPYKY.cjs");require("clsx");require("tailwind-merge");require("@chaibuilder/runtime");require("jotai");require("./MODIFIERS-9EwxLM8V.cjs");require("@react-hookz/web");require("flat-to-nested");require("@radix-ui/react-toggle");require("class-variance-authority");require("./Class-MmCxz2Ay.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-scroll-area");require("@radix-ui/react-tabs");require("@radix-ui/react-tooltip");require("@radix-ui/react-popover");require("@radix-ui/react-menubar");require("@radix-ui/react-hover-card");require("@radix-ui/react-select");require("@radix-ui/react-dropdown-menu");require("@radix-ui/react-separator");require("@radix-ui/react-toast");require("cmdk");require("@radix-ui/react-context-menu");require("react-icons-picker");require("react-dom");require("react-quill");require("lodash");require("@floating-ui/react-dom");require("react-textarea-autosize");require("flagged");require("react-dnd");require("@minoru/react-dnd-treeview");require("react-hotkeys-hook");require("sonner");require("./html-to-json-FGufPv9R.cjs");require("himalaya");require("lucide-react");require("./index-ecnGWzh9.cjs");const a=u.lazy(()=>Promise.resolve().then(()=>require("./add-page-modal-xMedOdsp.cjs"))),x=u.lazy(()=>Promise.resolve().then(()=>require("./page-viewer-DTIblLiz.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 +0,0 @@
|
|
|
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("./index-thKfFhmr.cjs"),a=require("./index-BMZLAJUV.cjs");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("./Functions-N3yhPYKY.cjs");require("clsx");require("tailwind-merge");require("@chaibuilder/runtime");require("jotai");require("./MODIFIERS-9EwxLM8V.cjs");require("@react-hookz/web");require("flat-to-nested");require("@radix-ui/react-toggle");require("class-variance-authority");require("./Class-MmCxz2Ay.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-scroll-area");require("@radix-ui/react-tabs");require("@radix-ui/react-tooltip");require("@radix-ui/react-popover");require("@radix-ui/react-menubar");require("@radix-ui/react-hover-card");require("@radix-ui/react-select");require("@radix-ui/react-dropdown-menu");require("@radix-ui/react-separator");require("@radix-ui/react-toast");require("cmdk");require("@radix-ui/react-context-menu");require("react-icons-picker");require("react-dom");require("react-quill");require("lodash");require("react-i18next");require("./index-JdnF6lYP.cjs");require("i18next");require("@floating-ui/react-dom");require("react-textarea-autosize");require("flagged");require("react-dnd");require("@minoru/react-dnd-treeview");require("react-hotkeys-hook");require("sonner");require("./html-to-json-FGufPv9R.cjs");require("himalaya");require("lucide-react");require("./index-ecnGWzh9.cjs");const d=r.lazy(()=>Promise.resolve().then(()=>require("./project-general-setting-g7WhM3hc.cjs"))),q=r.lazy(()=>Promise.resolve().then(()=>require("./project-seo-setting-xoeLQVj3.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 m(){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(q,{_projectData:i,seany:o})})})]})]})})]})}exports.default=m;
|