@chaibuilder/sdk 1.2.6 → 1.2.8
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-gbfzju1d.js → AddBlocks-tMxKPoen.js} +50 -50
- package/dist/{AddBlocks-wuKI1ieB.cjs → AddBlocks-x2LkOHSj.cjs} +1 -1
- package/dist/BrandingOptions-EzT9UYd6.cjs +1 -0
- package/dist/{BrandingOptions-mZXO7thQ.js → BrandingOptions-QJJ1y5ez.js} +55 -50
- package/dist/{CanvasArea-7GpvsKP6.js → CanvasArea-EfZgx-gN.js} +406 -404
- package/dist/CanvasArea-rIDwPHl5.cjs +60 -0
- package/dist/{CurrentPage-tHBommaV.cjs → CurrentPage-QNFPD078.cjs} +1 -1
- package/dist/{CurrentPage-C52wu_r7.js → CurrentPage-ulHTz4MD.js} +7 -7
- package/dist/{Layers-NDtp2-im.js → Layers-rehZkz78.js} +171 -148
- package/dist/Layers-v-7k3W2I.cjs +1 -0
- package/dist/{MarkAsGlobalBlock-SPWd6Flk.js → MarkAsGlobalBlock-BjP-Rqlf.js} +6 -5
- package/dist/MarkAsGlobalBlock-X5dNmZcb.cjs +1 -0
- package/dist/{PagesPanel-qV7yGT-K.js → PagesPanel-acGVGJf-.js} +5 -5
- package/dist/{PagesPanel-qZ_-tybb.cjs → PagesPanel-x5ms_LOD.cjs} +1 -1
- package/dist/{ProjectPanel-vzyFbBNU.cjs → ProjectPanel-5BHQ5ANP.cjs} +1 -1
- package/dist/{ProjectPanel-RJqNz-uq.js → ProjectPanel-aLFJq49M.js} +5 -5
- package/dist/Settings-iOjfw5NQ.cjs +1 -0
- package/dist/{Settings-t0I7LKxe.js → Settings-v-txwlII.js} +172 -171
- package/dist/{SidePanels-rXx-fGjB.js → SidePanels-Vdc-J5wK.js} +96 -93
- package/dist/SidePanels-t0g9ZQFT.cjs +1 -0
- package/dist/Topbar-V8xCetWF.cjs +1 -0
- package/dist/{Topbar-ks1ckGLz.js → Topbar-j4t4AgCq.js} +4 -3
- package/dist/{UnsplashImages-8vJPuqrF.js → UnsplashImages-41Y3q5_Q.js} +7 -6
- package/dist/UnsplashImages-DbHky6cj.cjs +1 -0
- package/dist/UploadImages-DnQ95_NW.cjs +1 -0
- package/dist/{UploadImages-6N6UrjLo.js → UploadImages-xBg-kbKv.js} +13 -12
- package/dist/{add-page-modal-a8r8poMY.cjs → add-page-modal-0YAI9dXr.cjs} +1 -1
- package/dist/{add-page-modal-2VlONTs5.js → add-page-modal-6DlGzdA4.js} +5 -5
- package/dist/{confirm-alert-f3DYO5Hj.cjs → confirm-alert-U7-NcG7G.cjs} +1 -1
- package/dist/{confirm-alert-biqvaLT-.js → confirm-alert-i4pM3mOt.js} +4 -3
- package/dist/core.cjs +1 -1
- package/dist/core.js +19 -19
- package/dist/{delete-page-modal-_8O4RCkG.js → delete-page-modal-T_rlQfNd.js} +4 -4
- package/dist/{delete-page-modal-NmwHGjZP.cjs → delete-page-modal-qXpi_2xR.cjs} +1 -1
- package/dist/email-blocks.cjs +1 -1
- package/dist/email-blocks.js +263 -24
- package/dist/{form-Moz_psOw.js → form-OVmsLOrc.js} +1 -1
- package/dist/{form-lJhy9DEC.cjs → form-VbouZlAW.cjs} +1 -1
- package/dist/html-to-json-2PeOCVey.cjs +1 -0
- package/dist/{html-to-json-yjzEN9OX.js → html-to-json-57841sEK.js} +25 -26
- package/dist/{index-482XFRhB.js → index-EGUphg4R.js} +5402 -5366
- package/dist/index-H6vIwGfD.cjs +1 -0
- package/dist/index-e0c8PmRQ.js +205 -0
- package/dist/index-gi1LIOCw.cjs +1 -0
- package/dist/{index-3OU9zl6c.cjs → index-jw8RxsTv.cjs} +33 -33
- package/dist/{index-_OgCuSUz.js → index-niHREMmR.js} +1051 -1043
- package/dist/lib.cjs +1 -1
- package/dist/lib.js +20 -21
- package/dist/mockServiceWorker.js +1 -1
- package/dist/{page-viewer-ajtG_WZC.js → page-viewer-EoYYnA56.js} +5 -5
- package/dist/{page-viewer-k2VlWE3T.cjs → page-viewer-Ou8vDXGV.cjs} +1 -1
- package/dist/{project-general-setting-tAgCjUtR.cjs → project-general-setting-92q4oEYv.cjs} +1 -1
- package/dist/{project-general-setting-TIHLI4Qg.js → project-general-setting-DC_nADG-.js} +5 -5
- package/dist/{project-seo-setting-9JGBPzcA.cjs → project-seo-setting-Snn2nZgS.cjs} +1 -1
- package/dist/{project-seo-setting-dXclexQW.js → project-seo-setting-wxAGEkd_.js} +8 -7
- package/dist/{single-page-detail-6btKDNjs.cjs → single-page-detail-QmmhR_h2.cjs} +1 -1
- package/dist/{single-page-detail-lST7hWvC.js → single-page-detail-xtNZ9YxX.js} +6 -6
- package/dist/studio.cjs +1 -1
- package/dist/studio.js +4 -4
- package/dist/style.css +1 -1
- package/dist/ui.cjs +1 -1
- package/dist/ui.js +134 -133
- package/dist/{useAddBlockByDrop-uPXvrg4G.js → useAddBlockByDrop-_nwI4W3q.js} +1 -1
- package/dist/{useAddBlockByDrop-_nd8yZBa.cjs → useAddBlockByDrop-inkD7Lck.cjs} +1 -1
- package/dist/web-blocks.cjs +2 -2
- package/dist/web-blocks.js +138 -139
- package/package.json +5 -5
- package/dist/BrandingOptions-arKT1zCy.cjs +0 -1
- package/dist/CanvasArea-jvwkPvtQ.cjs +0 -59
- package/dist/Layers-4G-0aNk9.cjs +0 -1
- package/dist/MarkAsGlobalBlock-S2BhHTsK.cjs +0 -1
- package/dist/Settings-SV08lVcH.cjs +0 -1
- package/dist/SidePanels-TOJotvzn.cjs +0 -1
- package/dist/Topbar-u5XKdWgQ.cjs +0 -1
- package/dist/UnsplashImages-V8oKEHfi.cjs +0 -1
- package/dist/UploadImages-eHYxwWAp.cjs +0 -1
- package/dist/html-to-json-5UoswV2Q.cjs +0 -1
- package/dist/index-IIJ_o44s.cjs +0 -1
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { j as e } from "./jsx-runtime-WbnYoNE9.js";
|
|
2
|
-
import { nth as
|
|
3
|
-
import { BoxModelIcon as
|
|
4
|
-
import { useDrop as
|
|
5
|
-
import { useDragOver as
|
|
6
|
-
import { useTranslation as
|
|
7
|
-
import {
|
|
8
|
-
import { DatabaseIcon as
|
|
9
|
-
import { useMemo as
|
|
10
|
-
import { a as
|
|
11
|
-
import { c as
|
|
12
|
-
import { f as
|
|
13
|
-
import { u as
|
|
2
|
+
import { nth as C, startsWith as P, map as S, includes as T, isUndefined as L, find as z, isEmpty as V } from "lodash-es";
|
|
3
|
+
import { BoxModelIcon as F, BoxIcon as D, DragHandleHorizontalIcon as $, ViewHorizontalIcon as G, BorderAllIcon as K, BorderTopIcon as Q, TableIcon as U, DropdownMenuIcon as Y, RadiobuttonIcon as q, InputIcon as W, ButtonIcon as B, CheckboxIcon as J, GroupIcon as X, SpaceBetweenVerticallyIcon as Z, ColumnsIcon as ee, RowsIcon as v, TextIcon as w, SketchLogoIcon as te, DividerHorizontalIcon as se, CodeIcon as oe, CursorTextIcon as ne, VideoIcon as re, Link1Icon as ae, HeadingIcon as ce, ImageIcon as le, TriangleRightIcon as ie, ScissorsIcon as xe, ClipboardIcon as de, TrashIcon as me, GlobeIcon as pe, CopyIcon as ue, ClipboardCopyIcon as ge, DoubleArrowDownIcon as je, StackIcon as he } from "@radix-ui/react-icons";
|
|
4
|
+
import { useDrop as be, useDragLayer as fe } from "react-dnd";
|
|
5
|
+
import { useDragOver as Ie, Tree as ke } from "@minoru/react-dnd-treeview";
|
|
6
|
+
import { useTranslation as ye } from "react-i18next";
|
|
7
|
+
import { $ as Ce, _ as Be, j as x, n as ve, bx as i, k as we, l as Se, a7 as Te, m as De, o as Ne, i as Me, by as Oe, al as Re, am as _e, bz as Ee, bA as Ae, y as N, af as He, w as Pe, ak as Le, p as ze, bn as Ve, bB as Fe } from "./index-niHREMmR.js";
|
|
8
|
+
import { DatabaseIcon as $e } from "lucide-react";
|
|
9
|
+
import { useMemo as Ge, lazy as Ke, useCallback as Qe, useState as Ue, Suspense as Ye } from "react";
|
|
10
|
+
import { a as qe } from "./MODIFIERS-RiXS5Mn1.js";
|
|
11
|
+
import { c as k } from "./Functions-7jnEwJyw.js";
|
|
12
|
+
import { f as We } from "./index-EGUphg4R.js";
|
|
13
|
+
import { u as Je } from "./useAddBlockByDrop-_nwI4W3q.js";
|
|
14
14
|
import "./_commonjsHelpers-UyOWmZb0.js";
|
|
15
15
|
import "@radix-ui/react-toggle";
|
|
16
16
|
import "class-variance-authority";
|
|
@@ -42,6 +42,7 @@ import "jotai";
|
|
|
42
42
|
import "flat-to-nested";
|
|
43
43
|
import "redux-undo";
|
|
44
44
|
import "@chaibuilder/runtime";
|
|
45
|
+
import "lodash";
|
|
45
46
|
import "@react-hookz/web";
|
|
46
47
|
import "i18next";
|
|
47
48
|
import "@floating-ui/react-dom";
|
|
@@ -49,75 +50,74 @@ import "react-textarea-autosize";
|
|
|
49
50
|
import "flagged";
|
|
50
51
|
import "react-hotkeys-hook";
|
|
51
52
|
import "sonner";
|
|
52
|
-
import "./html-to-json-
|
|
53
|
+
import "./html-to-json-57841sEK.js";
|
|
53
54
|
import "himalaya";
|
|
54
|
-
import "lodash";
|
|
55
55
|
import "./web-blocks.js";
|
|
56
56
|
import "./controls-XPXGHKht.js";
|
|
57
|
-
const
|
|
57
|
+
const M = (t) => {
|
|
58
58
|
switch (t.type) {
|
|
59
59
|
case "Image":
|
|
60
|
-
return /* @__PURE__ */ e.jsx(
|
|
60
|
+
return /* @__PURE__ */ e.jsx(le, {});
|
|
61
61
|
case "Heading":
|
|
62
|
-
return /* @__PURE__ */ e.jsx(
|
|
62
|
+
return /* @__PURE__ */ e.jsx(ce, {});
|
|
63
63
|
case "Text":
|
|
64
|
-
return /* @__PURE__ */ e.jsx(
|
|
64
|
+
return /* @__PURE__ */ e.jsx(w, {});
|
|
65
65
|
case "Link":
|
|
66
|
-
return /* @__PURE__ */ e.jsx(
|
|
66
|
+
return /* @__PURE__ */ e.jsx(ae, {});
|
|
67
67
|
case "Video":
|
|
68
|
-
return /* @__PURE__ */ e.jsx(
|
|
68
|
+
return /* @__PURE__ */ e.jsx(re, {});
|
|
69
69
|
case "RichText":
|
|
70
|
-
return /* @__PURE__ */ e.jsx(
|
|
70
|
+
return /* @__PURE__ */ e.jsx(ne, {});
|
|
71
71
|
case "Button":
|
|
72
72
|
return /* @__PURE__ */ e.jsx(B, {});
|
|
73
73
|
case "CustomHTML":
|
|
74
|
-
return /* @__PURE__ */ e.jsx(
|
|
74
|
+
return /* @__PURE__ */ e.jsx(oe, {});
|
|
75
75
|
case "Divider":
|
|
76
|
-
return /* @__PURE__ */ e.jsx(
|
|
76
|
+
return /* @__PURE__ */ e.jsx(se, {});
|
|
77
77
|
case "Icon":
|
|
78
|
-
return /* @__PURE__ */ e.jsx(
|
|
78
|
+
return /* @__PURE__ */ e.jsx(te, {});
|
|
79
79
|
case "List":
|
|
80
|
-
return /* @__PURE__ */ e.jsx(C, {});
|
|
81
|
-
case "Paragraph":
|
|
82
80
|
return /* @__PURE__ */ e.jsx(v, {});
|
|
81
|
+
case "Paragraph":
|
|
82
|
+
return /* @__PURE__ */ e.jsx(w, {});
|
|
83
83
|
case "Row":
|
|
84
|
-
return /* @__PURE__ */ e.jsx(
|
|
84
|
+
return /* @__PURE__ */ e.jsx(v, {});
|
|
85
85
|
case "ListItem":
|
|
86
|
-
return /* @__PURE__ */ e.jsx(
|
|
86
|
+
return /* @__PURE__ */ e.jsx(ee, {});
|
|
87
87
|
case "LineBreak":
|
|
88
88
|
return /* @__PURE__ */ e.jsx(Z, {});
|
|
89
89
|
case "Form":
|
|
90
|
-
return /* @__PURE__ */ e.jsx(
|
|
90
|
+
return /* @__PURE__ */ e.jsx(X, {});
|
|
91
91
|
case "Checkbox":
|
|
92
|
-
return /* @__PURE__ */ e.jsx(
|
|
92
|
+
return /* @__PURE__ */ e.jsx(J, {});
|
|
93
93
|
case "FormButton":
|
|
94
94
|
return /* @__PURE__ */ e.jsx(B, {});
|
|
95
95
|
case "Input":
|
|
96
96
|
case "TextArea":
|
|
97
|
-
return /* @__PURE__ */ e.jsx(
|
|
97
|
+
return /* @__PURE__ */ e.jsx(W, {});
|
|
98
98
|
case "Radio":
|
|
99
|
-
return /* @__PURE__ */ e.jsx(
|
|
99
|
+
return /* @__PURE__ */ e.jsx(q, {});
|
|
100
100
|
case "Select":
|
|
101
|
-
return /* @__PURE__ */ e.jsx(
|
|
101
|
+
return /* @__PURE__ */ e.jsx(Y, {});
|
|
102
102
|
case "Table":
|
|
103
|
-
return /* @__PURE__ */ e.jsx(
|
|
103
|
+
return /* @__PURE__ */ e.jsx(U, {});
|
|
104
104
|
case "TableHead":
|
|
105
|
-
return /* @__PURE__ */ e.jsx(
|
|
105
|
+
return /* @__PURE__ */ e.jsx(Q, {});
|
|
106
106
|
case "TableBody":
|
|
107
|
-
return /* @__PURE__ */ e.jsx(
|
|
107
|
+
return /* @__PURE__ */ e.jsx(K, {});
|
|
108
108
|
case "TableRow":
|
|
109
|
-
return /* @__PURE__ */ e.jsx(
|
|
109
|
+
return /* @__PURE__ */ e.jsx(G, {});
|
|
110
110
|
case "TableCell":
|
|
111
|
-
return /* @__PURE__ */ e.jsx(
|
|
111
|
+
return /* @__PURE__ */ e.jsx($, {});
|
|
112
112
|
case "DataProvider":
|
|
113
|
-
return /* @__PURE__ */ e.jsx(
|
|
113
|
+
return /* @__PURE__ */ e.jsx($e, { size: 16 });
|
|
114
114
|
case "Box":
|
|
115
|
-
return /* @__PURE__ */ e.jsx(
|
|
115
|
+
return /* @__PURE__ */ e.jsx(D, {});
|
|
116
116
|
default:
|
|
117
|
-
return /* @__PURE__ */ e.jsx(
|
|
117
|
+
return /* @__PURE__ */ e.jsx(F, {});
|
|
118
118
|
}
|
|
119
119
|
};
|
|
120
|
-
function
|
|
120
|
+
function Xe(t = "") {
|
|
121
121
|
const s = {
|
|
122
122
|
xs: "390px",
|
|
123
123
|
sm: "640px",
|
|
@@ -135,23 +135,23 @@ function We(t = "") {
|
|
|
135
135
|
// checks if any of the display property is set for any higher media query
|
|
136
136
|
/\b(sm|md|lg|xl|2xl):(block|grid|flex|inline|inline-grid|inline-flex|inline-block)\b/
|
|
137
137
|
), c = t.match(a);
|
|
138
|
-
if (
|
|
139
|
-
return `Visible >=${s[
|
|
138
|
+
if (C(c, 1))
|
|
139
|
+
return `Visible >=${s[C(c, 1)]}`;
|
|
140
140
|
}
|
|
141
141
|
return "";
|
|
142
142
|
}
|
|
143
143
|
const Ze = (t) => {
|
|
144
144
|
let s = "";
|
|
145
145
|
return Object.keys(t).forEach((o) => {
|
|
146
|
-
|
|
146
|
+
P(t[o], qe) && (s = t[o]);
|
|
147
147
|
}), s;
|
|
148
|
-
},
|
|
148
|
+
}, et = (t) => {
|
|
149
149
|
var g;
|
|
150
|
-
const [, s] =
|
|
150
|
+
const [, s] = Ce(), [o] = Be(), { isSelected: r } = t, { id: a, data: c } = t.node, d = t.depth * 10, m = (l) => {
|
|
151
151
|
l.stopPropagation(), t.onToggle(t.node.id);
|
|
152
|
-
}, j =
|
|
152
|
+
}, j = Ie(a, t.isOpen, t.onToggle), p = Ge(() => {
|
|
153
153
|
const l = Ze(t.node.data);
|
|
154
|
-
return
|
|
154
|
+
return Xe(l);
|
|
155
155
|
}, [t.node.data]);
|
|
156
156
|
return (
|
|
157
157
|
// eslint-disable-next-line jsx-a11y/click-events-have-key-events,jsx-a11y/no-static-element-interactions
|
|
@@ -159,34 +159,34 @@ const Ze = (t) => {
|
|
|
159
159
|
"div",
|
|
160
160
|
{
|
|
161
161
|
onMouseEnter: () => s(a),
|
|
162
|
-
className:
|
|
163
|
-
"group flex w-full items-center justify-between space-x-px py-px
|
|
162
|
+
className: k(
|
|
163
|
+
"group flex w-full items-center justify-between space-x-px py-px",
|
|
164
164
|
r ? "bg-blue-500 text-white" : "hover:bg-gray-200 dark:hover:bg-gray-800"
|
|
165
165
|
),
|
|
166
166
|
onClick: (l) => {
|
|
167
167
|
l.stopPropagation(), !o.includes(a) && t.onSelect(a);
|
|
168
168
|
},
|
|
169
169
|
onContextMenu: () => t.onSelect(a),
|
|
170
|
-
style: { paddingInlineStart:
|
|
170
|
+
style: { paddingInlineStart: d },
|
|
171
171
|
...j,
|
|
172
172
|
children: /* @__PURE__ */ e.jsxs("div", { className: "flex items-center", children: [
|
|
173
173
|
/* @__PURE__ */ e.jsx(
|
|
174
174
|
"div",
|
|
175
175
|
{
|
|
176
176
|
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" : ""}`,
|
|
177
|
-
children: t.node.droppable && /* @__PURE__ */ e.jsx("button", { onClick:
|
|
177
|
+
children: t.node.droppable && /* @__PURE__ */ e.jsx("button", { onClick: m, type: "button", children: /* @__PURE__ */ e.jsx(ie, {}) })
|
|
178
178
|
}
|
|
179
179
|
),
|
|
180
180
|
/* @__PURE__ */ e.jsxs("button", { type: "button", className: "flex items-center", children: [
|
|
181
|
-
/* @__PURE__ */ e.jsx("div", { className: "-mt-1 h-3 w-3", children: /* @__PURE__ */ e.jsx(
|
|
181
|
+
/* @__PURE__ */ e.jsx("div", { className: "-mt-1 h-3 w-3", children: /* @__PURE__ */ e.jsx(M, { type: c == null ? void 0 : c._type }) }),
|
|
182
182
|
/* @__PURE__ */ e.jsx("div", { className: "ml-2 truncate text-[11px]", children: ((g = t.node.data) == null ? void 0 : g._name) || t.node.text }),
|
|
183
|
-
|
|
183
|
+
p ? /* @__PURE__ */ e.jsxs(
|
|
184
184
|
"span",
|
|
185
185
|
{
|
|
186
186
|
className: "ml-2 flex items-center text-[10px] italic " + (r ? "text-gray-200" : "text-gray-500"),
|
|
187
187
|
children: [
|
|
188
188
|
"(",
|
|
189
|
-
|
|
189
|
+
p,
|
|
190
190
|
")"
|
|
191
191
|
]
|
|
192
192
|
}
|
|
@@ -196,30 +196,30 @@ const Ze = (t) => {
|
|
|
196
196
|
}
|
|
197
197
|
)
|
|
198
198
|
);
|
|
199
|
-
},
|
|
199
|
+
}, tt = (t) => {
|
|
200
200
|
var o;
|
|
201
201
|
const { item: s } = t.monitorProps;
|
|
202
202
|
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: [
|
|
203
|
-
/* @__PURE__ */ e.jsx("div", { className: "", children: /* @__PURE__ */ e.jsx(
|
|
203
|
+
/* @__PURE__ */ e.jsx("div", { className: "", children: /* @__PURE__ */ e.jsx(M, { type: (o = s == null ? void 0 : s.data) == null ? void 0 : o._type }) }),
|
|
204
204
|
/* @__PURE__ */ e.jsx("div", { className: "ml-2 truncate text-[11px]", children: s.text })
|
|
205
205
|
] });
|
|
206
|
-
},
|
|
206
|
+
}, st = (t) => {
|
|
207
207
|
const s = t.depth * 10 + 16;
|
|
208
208
|
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 } });
|
|
209
|
-
},
|
|
210
|
-
const [t] =
|
|
209
|
+
}, ot = Ke(() => import("./MarkAsGlobalBlock-BjP-Rqlf.js")), nt = () => {
|
|
210
|
+
const [t] = x(), [, s] = ve();
|
|
211
211
|
return /* @__PURE__ */ e.jsxs(i, { className: "flex items-center gap-x-4 text-xs", onClick: () => s(t), children: [
|
|
212
|
-
/* @__PURE__ */ e.jsx(
|
|
212
|
+
/* @__PURE__ */ e.jsx(xe, {}),
|
|
213
213
|
" Cut"
|
|
214
214
|
] });
|
|
215
|
-
},
|
|
216
|
-
const [t] =
|
|
215
|
+
}, rt = () => {
|
|
216
|
+
const [t] = x(), [, s] = we();
|
|
217
217
|
return /* @__PURE__ */ e.jsxs(i, { className: "flex items-center gap-x-4 text-xs", onClick: () => s(t), children: [
|
|
218
|
-
/* @__PURE__ */ e.jsx(
|
|
218
|
+
/* @__PURE__ */ e.jsx(de, {}),
|
|
219
219
|
" Copy"
|
|
220
220
|
] });
|
|
221
|
-
},
|
|
222
|
-
const [t] =
|
|
221
|
+
}, at = () => {
|
|
222
|
+
const [t] = x(), s = Se(), o = Te();
|
|
223
223
|
return /* @__PURE__ */ e.jsxs(
|
|
224
224
|
i,
|
|
225
225
|
{
|
|
@@ -227,29 +227,29 @@ const Ze = (t) => {
|
|
|
227
227
|
className: "flex items-center gap-x-4 text-xs",
|
|
228
228
|
onClick: () => s(t),
|
|
229
229
|
children: [
|
|
230
|
-
/* @__PURE__ */ e.jsx(
|
|
230
|
+
/* @__PURE__ */ e.jsx(me, {}),
|
|
231
231
|
" Remove"
|
|
232
232
|
]
|
|
233
233
|
}
|
|
234
234
|
);
|
|
235
|
-
},
|
|
235
|
+
}, ct = ({
|
|
236
236
|
id: t = null,
|
|
237
237
|
openMarkAsGlobalModal: s
|
|
238
238
|
}) => {
|
|
239
|
-
const [o] =
|
|
239
|
+
const [o] = x(), r = De(), { pasteBlocks: a, canPaste: c } = Ne(), d = Me("globalBlocksSupport", !1), m = Qe(() => {
|
|
240
240
|
r(o);
|
|
241
241
|
}, [o, r]);
|
|
242
|
-
return /* @__PURE__ */ e.jsxs(
|
|
243
|
-
|
|
244
|
-
/* @__PURE__ */ e.jsx(
|
|
242
|
+
return /* @__PURE__ */ e.jsxs(Oe, { className: "text-xs", children: [
|
|
243
|
+
d && /* @__PURE__ */ e.jsx(i, { className: "flex items-center gap-x-4 border-b text-xs", onClick: s, children: /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-x-4", children: [
|
|
244
|
+
/* @__PURE__ */ e.jsx(pe, {}),
|
|
245
245
|
" Mark as global"
|
|
246
246
|
] }) }),
|
|
247
|
-
/* @__PURE__ */ e.jsxs(i, { className: "flex items-center gap-x-4 text-xs", onClick:
|
|
248
|
-
/* @__PURE__ */ e.jsx(
|
|
247
|
+
/* @__PURE__ */ e.jsxs(i, { className: "flex items-center gap-x-4 text-xs", onClick: m, children: [
|
|
248
|
+
/* @__PURE__ */ e.jsx(ue, {}),
|
|
249
249
|
" Duplicate"
|
|
250
250
|
] }),
|
|
251
|
-
/* @__PURE__ */ e.jsx(
|
|
252
|
-
/* @__PURE__ */ e.jsx(
|
|
251
|
+
/* @__PURE__ */ e.jsx(nt, {}),
|
|
252
|
+
/* @__PURE__ */ e.jsx(rt, {}),
|
|
253
253
|
/* @__PURE__ */ e.jsxs(
|
|
254
254
|
i,
|
|
255
255
|
{
|
|
@@ -257,25 +257,25 @@ const Ze = (t) => {
|
|
|
257
257
|
onClick: () => a(t),
|
|
258
258
|
disabled: !c,
|
|
259
259
|
children: [
|
|
260
|
-
/* @__PURE__ */ e.jsx(
|
|
260
|
+
/* @__PURE__ */ e.jsx(ge, {}),
|
|
261
261
|
" Paste"
|
|
262
262
|
]
|
|
263
263
|
}
|
|
264
264
|
),
|
|
265
|
-
/* @__PURE__ */ e.jsx(
|
|
265
|
+
/* @__PURE__ */ e.jsx(at, {})
|
|
266
266
|
] });
|
|
267
|
-
},
|
|
268
|
-
const [o, r] =
|
|
267
|
+
}, lt = ({ children: t, id: s = null }) => {
|
|
268
|
+
const [o, r] = Ue(!1);
|
|
269
269
|
return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
270
|
-
/* @__PURE__ */ e.jsx(
|
|
271
|
-
/* @__PURE__ */ e.jsxs(
|
|
272
|
-
/* @__PURE__ */ e.jsx(
|
|
273
|
-
/* @__PURE__ */ e.jsx(
|
|
270
|
+
/* @__PURE__ */ e.jsx(Re, { open: o, onOpenChange: r, children: o && /* @__PURE__ */ e.jsx(_e, { children: /* @__PURE__ */ e.jsx(Ye, { fallback: /* @__PURE__ */ e.jsx("div", { className: "h-96 w-full animate-pulse bg-gray-200" }), children: /* @__PURE__ */ e.jsx(ot, { closeModal: () => r(!1), id: s }) }) }) }),
|
|
271
|
+
/* @__PURE__ */ e.jsxs(Ee, { children: [
|
|
272
|
+
/* @__PURE__ */ e.jsx(Ae, { children: t }),
|
|
273
|
+
/* @__PURE__ */ e.jsx(ct, { id: s, openMarkAsGlobalModal: () => r(!0) })
|
|
274
274
|
] })
|
|
275
275
|
] });
|
|
276
276
|
};
|
|
277
|
-
function
|
|
278
|
-
return
|
|
277
|
+
function it(t) {
|
|
278
|
+
return S(t, (s) => {
|
|
279
279
|
const { data: o } = s;
|
|
280
280
|
return {
|
|
281
281
|
...o,
|
|
@@ -283,99 +283,122 @@ function ct(t) {
|
|
|
283
283
|
};
|
|
284
284
|
});
|
|
285
285
|
}
|
|
286
|
-
|
|
287
|
-
const t =
|
|
288
|
-
|
|
286
|
+
function xt() {
|
|
287
|
+
const [t] = N(), [s, o] = x();
|
|
288
|
+
return t ? (console.log("container", t), /* @__PURE__ */ e.jsxs(
|
|
289
|
+
"div",
|
|
290
|
+
{
|
|
291
|
+
onClick: (r) => {
|
|
292
|
+
r.stopPropagation(), o(["container"]);
|
|
293
|
+
},
|
|
294
|
+
className: k(
|
|
295
|
+
"flex items-center pl-2 text-xs",
|
|
296
|
+
T(s, "container") ? "bg-blue-500 text-white" : "hover:bg-gray-200 dark:hover:bg-gray-800"
|
|
297
|
+
),
|
|
298
|
+
children: [
|
|
299
|
+
/* @__PURE__ */ e.jsx(D, {}),
|
|
300
|
+
" ",
|
|
301
|
+
t._type
|
|
302
|
+
]
|
|
303
|
+
}
|
|
304
|
+
)) : null;
|
|
305
|
+
}
|
|
306
|
+
const ps = () => {
|
|
307
|
+
const t = He(), [s] = Pe(), [o, r, a] = x(), [, c] = Le(), { t: d } = ye(), { createSnapshot: m } = ze(), j = We(), p = Je(), [g] = N(), l = async (n, u) => {
|
|
308
|
+
const { dragSource: b, relativeIndex: f, dropTargetId: I, monitor: y } = u;
|
|
289
309
|
if (b) {
|
|
290
|
-
|
|
291
|
-
const
|
|
292
|
-
s(
|
|
293
|
-
const
|
|
294
|
-
r([
|
|
310
|
+
m();
|
|
311
|
+
const A = it(n);
|
|
312
|
+
s(A);
|
|
313
|
+
const H = y.getItem();
|
|
314
|
+
r([H.id]);
|
|
295
315
|
} else
|
|
296
|
-
await
|
|
297
|
-
},
|
|
316
|
+
await p({ block: y.getItem(), dropTargetId: I, relativeIndex: f });
|
|
317
|
+
}, O = S(t, (n) => ({
|
|
298
318
|
id: n._id,
|
|
299
319
|
text: n._type,
|
|
300
320
|
parent: n._parent || 0,
|
|
301
|
-
droppable: !
|
|
321
|
+
droppable: !L(z(t, { _parent: n._id })),
|
|
302
322
|
data: n
|
|
303
|
-
})),
|
|
323
|
+
})), R = () => {
|
|
304
324
|
r([]), c([]);
|
|
305
|
-
}, [{ isOver: h },
|
|
325
|
+
}, [{ isOver: h }, _] = be(() => ({
|
|
306
326
|
accept: ["CHAI_BLOCK"],
|
|
307
327
|
collect: (n) => ({
|
|
308
328
|
canDrop: n.canDrop(),
|
|
309
329
|
isOver: n.isOver()
|
|
310
330
|
}),
|
|
311
331
|
drop: (n) => {
|
|
312
|
-
(async () => await
|
|
332
|
+
(async () => await p({
|
|
313
333
|
block: n,
|
|
314
334
|
dropTargetId: "",
|
|
315
335
|
relativeIndex: 0
|
|
316
336
|
}))();
|
|
317
337
|
}
|
|
318
|
-
})), { isDragging:
|
|
338
|
+
})), { isDragging: E } = fe((n) => ({
|
|
319
339
|
isDragging: n.isDragging()
|
|
320
340
|
}));
|
|
321
341
|
return /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsx(
|
|
322
342
|
"div",
|
|
323
343
|
{
|
|
324
|
-
onClick: () =>
|
|
325
|
-
className:
|
|
344
|
+
onClick: () => R(),
|
|
345
|
+
className: k(
|
|
326
346
|
"-mx-1 -mt-1 flex h-full select-none flex-col space-y-1",
|
|
327
|
-
|
|
347
|
+
E ? "bg-green-50/80" : "bg-background"
|
|
328
348
|
),
|
|
329
|
-
children:
|
|
349
|
+
children: V(t) ? /* @__PURE__ */ e.jsxs(
|
|
330
350
|
"div",
|
|
331
351
|
{
|
|
332
|
-
ref:
|
|
333
|
-
className: `mx-1 mt-4 max-w-full
|
|
352
|
+
ref: _,
|
|
353
|
+
className: `mx-1 mt-4 h-full max-w-full p-6 text-center text-sm text-gray-400 ${h ? "bg-blue-200" : ""}`,
|
|
334
354
|
children: [
|
|
335
|
-
h ? /* @__PURE__ */ e.jsx(
|
|
336
|
-
/* @__PURE__ */ e.jsx("p", { className: "mt-2", children:
|
|
355
|
+
h ? /* @__PURE__ */ e.jsx(je, { className: "mx-auto h-12 w-12 animate-bounce" }) : /* @__PURE__ */ e.jsx(he, { className: "mx-auto h-10 w-10" }),
|
|
356
|
+
/* @__PURE__ */ e.jsx("p", { className: "mt-2", children: d(h ? "drop_here_message" : "tree_view_no_blocks") })
|
|
337
357
|
]
|
|
338
358
|
}
|
|
339
|
-
) : /* @__PURE__ */ e.
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
{
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
359
|
+
) : /* @__PURE__ */ e.jsxs(Ve, { id: "layers-view", className: "no-scrollbar h-full overflow-y-auto p-1", children: [
|
|
360
|
+
/* @__PURE__ */ e.jsx(xt, {}),
|
|
361
|
+
/* @__PURE__ */ e.jsx(
|
|
362
|
+
ke,
|
|
363
|
+
{
|
|
364
|
+
initialOpen: j,
|
|
365
|
+
extraAcceptTypes: ["CHAI_BLOCK"],
|
|
366
|
+
tree: O,
|
|
367
|
+
rootId: 0,
|
|
368
|
+
render: (n, { depth: u, isOpen: b, onToggle: f }) => /* @__PURE__ */ e.jsx(lt, { id: n.id, children: /* @__PURE__ */ e.jsx(
|
|
369
|
+
et,
|
|
370
|
+
{
|
|
371
|
+
onSelect: (I) => {
|
|
372
|
+
c([]), r([I]);
|
|
373
|
+
},
|
|
374
|
+
isSelected: T(o, n.id),
|
|
375
|
+
node: n,
|
|
376
|
+
depth: u,
|
|
377
|
+
isOpen: b,
|
|
378
|
+
onToggle: f,
|
|
379
|
+
toggleIds: a
|
|
380
|
+
}
|
|
381
|
+
) }),
|
|
382
|
+
dragPreviewRender: (n) => /* @__PURE__ */ e.jsx(tt, { monitorProps: n }),
|
|
383
|
+
onDrop: l,
|
|
384
|
+
classes: {
|
|
385
|
+
root: "h-[90%] " + (g ? "pl-2" : "pt-2"),
|
|
386
|
+
draggingSource: "opacity-30",
|
|
387
|
+
dropTarget: "bg-green-100",
|
|
388
|
+
placeholder: "relative"
|
|
389
|
+
},
|
|
390
|
+
sort: !1,
|
|
391
|
+
insertDroppableFirst: !1,
|
|
392
|
+
canDrop: Fe,
|
|
393
|
+
dropTargetOffset: 2,
|
|
394
|
+
enableAnimateExpand: !0,
|
|
395
|
+
placeholderRender: (n, { depth: u }) => /* @__PURE__ */ e.jsx(st, { node: n, depth: u })
|
|
396
|
+
}
|
|
397
|
+
)
|
|
398
|
+
] })
|
|
376
399
|
}
|
|
377
400
|
) });
|
|
378
401
|
};
|
|
379
402
|
export {
|
|
380
|
-
|
|
403
|
+
ps as default
|
|
381
404
|
};
|
|
@@ -0,0 +1 @@
|
|
|
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"),q=require("react-dnd"),C=require("@minoru/react-dnd-treeview"),N=require("react-i18next"),n=require("./index-H6vIwGfD.cjs"),O=require("lucide-react"),g=require("react"),_=require("./MODIFIERS-2FeVfZQ9.cjs"),B=require("./Functions-N3yhPYKY.cjs"),A=require("./index-jw8RxsTv.cjs"),P=require("./useAddBlockByDrop-inkD7Lck.cjs");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("@radix-ui/react-toggle");require("class-variance-authority");require("./utils-PTxFk6qT.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("jotai");require("flat-to-nested");require("redux-undo");require("@chaibuilder/runtime");require("lodash");require("@react-hookz/web");require("i18next");require("@floating-ui/react-dom");require("react-textarea-autosize");require("flagged");require("react-hotkeys-hook");require("sonner");require("./html-to-json-2PeOCVey.cjs");require("himalaya");require("./web-blocks.cjs");require("./controls-Dy1qa8Dc.cjs");const y=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(O.DatabaseIcon,{size:16});case"Box":return e.jsxRuntimeExports.jsx(s.BoxIcon,{});default:return e.jsxRuntimeExports.jsx(s.BoxModelIcon,{})}};function H(t=""){const r={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 c=new RegExp(/\b(sm|md|lg|xl|2xl):(block|grid|flex|inline|inline-grid|inline-flex|inline-block)\b/),l=t.match(c);if(u.nth(l,1))return`Visible >=${r[u.nth(l,1)]}`}return""}const L=t=>{let r="";return Object.keys(t).forEach(o=>{u.startsWith(t[o],_.STYLES_KEY)&&(r=t[o])}),r},F=t=>{var R;const[,r]=n.useHighlightBlockId(),[o]=n.useHiddenBlockIds(),{isSelected:x}=t,{id:c,data:l}=t.node,d=t.depth*10,p=a=>{a.stopPropagation(),t.onToggle(t.node.id)},E=C.useDragOver(c,t.isOpen,t.onToggle),m=g.useMemo(()=>{const a=L(t.node.data);return H(a)},[t.node.data]);return e.jsxRuntimeExports.jsx("div",{onMouseEnter:()=>r(c),className:B.cn("group flex w-full items-center justify-between space-x-px py-px",x?"bg-blue-500 text-white":"hover:bg-gray-200 dark:hover:bg-gray-800"),onClick:a=>{a.stopPropagation(),!o.includes(c)&&t.onSelect(c)},onContextMenu:()=>t.onSelect(c),style:{paddingInlineStart:d},...E,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:p,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(y,{type:l==null?void 0:l._type})}),e.jsxRuntimeExports.jsx("div",{className:"ml-2 truncate text-[11px]",children:((R=t.node.data)==null?void 0:R._name)||t.node.text}),m?e.jsxRuntimeExports.jsxs("span",{className:"ml-2 flex items-center text-[10px] italic "+(x?"text-gray-200":"text-gray-500"),children:["(",m,")"]}):null]})]})})},V=t=>{var o;const{item:r}=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(y,{type:(o=r==null?void 0:r.data)==null?void 0:o._type})}),e.jsxRuntimeExports.jsx("div",{className:"ml-2 truncate text-[11px]",children:r.text})]})},z=t=>{const r=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:r}})},G=g.lazy(()=>Promise.resolve().then(()=>require("./MarkAsGlobalBlock-X5dNmZcb.cjs"))),$=()=>{const[t]=n.useSelectedBlockIds(),[,r]=n.useCutBlockIds();return e.jsxRuntimeExports.jsxs(n.ContextMenuItem,{className:"flex items-center gap-x-4 text-xs",onClick:()=>r(t),children:[e.jsxRuntimeExports.jsx(s.ScissorsIcon,{})," Cut"]})},K=()=>{const[t]=n.useSelectedBlockIds(),[,r]=n.useCopyBlockIds();return e.jsxRuntimeExports.jsxs(n.ContextMenuItem,{className:"flex items-center gap-x-4 text-xs",onClick:()=>r(t),children:[e.jsxRuntimeExports.jsx(s.ClipboardIcon,{})," Copy"]})},Q=()=>{const[t]=n.useSelectedBlockIds(),r=n.useRemoveBlocks(),o=n.useSelectedBlock();return e.jsxRuntimeExports.jsxs(n.ContextMenuItem,{disabled:(o==null?void 0:o._type)==="Slot",className:"flex items-center gap-x-4 text-xs",onClick:()=>r(t),children:[e.jsxRuntimeExports.jsx(s.TrashIcon,{})," Remove"]})},U=({id:t=null,openMarkAsGlobalModal:r})=>{const[o]=n.useSelectedBlockIds(),x=n.useDuplicateBlocks(),{pasteBlocks:c,canPaste:l}=n.usePasteBlocks(),d=n.useBuilderProp("globalBlocksSupport",!1),p=g.useCallback(()=>{x(o)},[o,x]);return e.jsxRuntimeExports.jsxs(n.ContextMenuContent,{className:"text-xs",children:[d&&e.jsxRuntimeExports.jsx(n.ContextMenuItem,{className:"flex items-center gap-x-4 border-b text-xs",onClick:r,children:e.jsxRuntimeExports.jsxs("div",{className:"flex items-center gap-x-4",children:[e.jsxRuntimeExports.jsx(s.GlobeIcon,{})," Mark as global"]})}),e.jsxRuntimeExports.jsxs(n.ContextMenuItem,{className:"flex items-center gap-x-4 text-xs",onClick:p,children:[e.jsxRuntimeExports.jsx(s.CopyIcon,{})," Duplicate"]}),e.jsxRuntimeExports.jsx($,{}),e.jsxRuntimeExports.jsx(K,{}),e.jsxRuntimeExports.jsxs(n.ContextMenuItem,{className:"flex items-center gap-x-4 text-xs",onClick:()=>c(t),disabled:!l,children:[e.jsxRuntimeExports.jsx(s.ClipboardCopyIcon,{})," Paste"]}),e.jsxRuntimeExports.jsx(Q,{})]})},Y=({children:t,id:r=null})=>{const[o,x]=g.useState(!1);return e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx(n.Dialog,{open:o,onOpenChange:x,children:o&&e.jsxRuntimeExports.jsx(n.DialogContent,{children:e.jsxRuntimeExports.jsx(g.Suspense,{fallback:e.jsxRuntimeExports.jsx("div",{className:"h-96 w-full animate-pulse bg-gray-200"}),children:e.jsxRuntimeExports.jsx(G,{closeModal:()=>x(!1),id:r})})})}),e.jsxRuntimeExports.jsxs(n.ContextMenu,{children:[e.jsxRuntimeExports.jsx(n.ContextMenuTrigger,{children:t}),e.jsxRuntimeExports.jsx(U,{id:r,openMarkAsGlobalModal:()=>x(!0)})]})]})};function W(t){return u.map(t,r=>{const{data:o}=r;return{...o,_parent:r.parent===0?null:r.parent}})}function J(){const[t]=n.useBlocksContainer(),[r,o]=n.useSelectedBlockIds();return t?(console.log("container",t),e.jsxRuntimeExports.jsxs("div",{onClick:x=>{x.stopPropagation(),o(["container"])},className:B.cn("flex items-center pl-2 text-xs",u.includes(r,"container")?"bg-blue-500 text-white":"hover:bg-gray-200 dark:hover:bg-gray-800"),children:[e.jsxRuntimeExports.jsx(s.BoxIcon,{})," ",t._type]})):null}const X=()=>{const t=n.useAllBlocks(),[r]=n.useSetAllBlocks(),[o,x,c]=n.useSelectedBlockIds(),[,l]=n.useSelectedStylingBlocks(),{t:d}=N.useTranslation(),{createSnapshot:p}=n.useCanvasHistory(),E=A.useExpandedIds(),m=P.useAddBlockByDrop(),[R]=n.useBlocksContainer(),a=async(i,j)=>{const{dragSource:h,relativeIndex:b,dropTargetId:k,monitor:f}=j;if(h){p();const T=W(i);r(T);const M=f.getItem();x([M.id])}else await m({block:f.getItem(),dropTargetId:k,relativeIndex:b})},v=u.map(t,i=>({id:i._id,text:i._type,parent:i._parent||0,droppable:!u.isUndefined(u.find(t,{_parent:i._id})),data:i})),S=()=>{x([]),l([])},[{isOver:I},w]=q.useDrop(()=>({accept:["CHAI_BLOCK"],collect:i=>({canDrop:i.canDrop(),isOver:i.isOver()}),drop:i=>{(async()=>await m({block:i,dropTargetId:"",relativeIndex:0}))()}})),{isDragging:D}=q.useDragLayer(i=>({isDragging:i.isDragging()}));return e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:e.jsxRuntimeExports.jsx("div",{onClick:()=>S(),className:B.cn("-mx-1 -mt-1 flex h-full select-none flex-col space-y-1",D?"bg-green-50/80":"bg-background"),children:u.isEmpty(t)?e.jsxRuntimeExports.jsxs("div",{ref:w,className:`mx-1 mt-4 h-full max-w-full p-6 text-center text-sm text-gray-400 ${I?"bg-blue-200":""}`,children:[I?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(I?"drop_here_message":"tree_view_no_blocks")})]}):e.jsxRuntimeExports.jsxs(n.ScrollArea,{id:"layers-view",className:"no-scrollbar h-full overflow-y-auto p-1",children:[e.jsxRuntimeExports.jsx(J,{}),e.jsxRuntimeExports.jsx(C.Tree,{initialOpen:E,extraAcceptTypes:["CHAI_BLOCK"],tree:v,rootId:0,render:(i,{depth:j,isOpen:h,onToggle:b})=>e.jsxRuntimeExports.jsx(Y,{id:i.id,children:e.jsxRuntimeExports.jsx(F,{onSelect:k=>{l([]),x([k])},isSelected:u.includes(o,i.id),node:i,depth:j,isOpen:h,onToggle:b,toggleIds:c})}),dragPreviewRender:i=>e.jsxRuntimeExports.jsx(V,{monitorProps:i}),onDrop:a,classes:{root:"h-[90%] "+(R?"pl-2":"pt-2"),draggingSource:"opacity-30",dropTarget:"bg-green-100",placeholder:"relative"},sort:!1,insertDroppableFirst:!1,canDrop:n.canDropBlock,dropTargetOffset:2,enableAnimateExpand:!0,placeholderRender:(i,{depth:j})=>e.jsxRuntimeExports.jsx(z,{node:i,depth:j})})]})})})};exports.default=X;
|
|
@@ -2,7 +2,7 @@ import { j as t } from "./jsx-runtime-WbnYoNE9.js";
|
|
|
2
2
|
import { useTranslation as p } from "react-i18next";
|
|
3
3
|
import { GlobeIcon as n } from "@radix-ui/react-icons";
|
|
4
4
|
import { useState as c } from "react";
|
|
5
|
-
import {
|
|
5
|
+
import { a0 as d, B as l } from "./index-niHREMmR.js";
|
|
6
6
|
import { capitalize as x } from "lodash-es";
|
|
7
7
|
import "./_commonjsHelpers-UyOWmZb0.js";
|
|
8
8
|
import "@radix-ui/react-toggle";
|
|
@@ -37,9 +37,10 @@ import "flat-to-nested";
|
|
|
37
37
|
import "./Functions-7jnEwJyw.js";
|
|
38
38
|
import "redux-undo";
|
|
39
39
|
import "@chaibuilder/runtime";
|
|
40
|
+
import "lodash";
|
|
40
41
|
import "@react-hookz/web";
|
|
41
|
-
const
|
|
42
|
-
const { t: o } = p(), e = d(), [r,
|
|
42
|
+
const ot = ({ id: m = null, closeModal: i }) => {
|
|
43
|
+
const { t: o } = p(), e = d(), [r, a] = c("");
|
|
43
44
|
return /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
|
|
44
45
|
/* @__PURE__ */ t.jsx("h1", { className: "text-lg font-bold", children: o("mark_as_global") }),
|
|
45
46
|
/* @__PURE__ */ t.jsxs("div", { className: "py-2 text-sm", children: [
|
|
@@ -62,7 +63,7 @@ const tt = ({ id: m = null, closeModal: i }) => {
|
|
|
62
63
|
placeholder: o("eg_header_footer"),
|
|
63
64
|
className: "mt-2 w-full",
|
|
64
65
|
value: r,
|
|
65
|
-
onChange: (
|
|
66
|
+
onChange: (s) => a(s.target.value)
|
|
66
67
|
}
|
|
67
68
|
)
|
|
68
69
|
] }),
|
|
@@ -83,5 +84,5 @@ const tt = ({ id: m = null, closeModal: i }) => {
|
|
|
83
84
|
] });
|
|
84
85
|
};
|
|
85
86
|
export {
|
|
86
|
-
|
|
87
|
+
ot as default
|
|
87
88
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-Z_BpKhVy.cjs"),o=require("react-i18next"),c=require("@radix-ui/react-icons"),x=require("react"),i=require("./index-H6vIwGfD.cjs"),q=require("lodash-es");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("@radix-ui/react-toggle");require("class-variance-authority");require("./utils-PTxFk6qT.cjs");require("./MODIFIERS-2FeVfZQ9.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("jotai");require("flat-to-nested");require("./Functions-N3yhPYKY.cjs");require("redux-undo");require("@chaibuilder/runtime");require("lodash");require("@react-hookz/web");const m=({id:u=null,closeModal:t})=>{const{t:r}=o.useTranslation(),l=i.useMarkAsGlobalBlock(),[s,n]=x.useState("");return e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx("h1",{className:"text-lg font-bold",children:r("mark_as_global")}),e.jsxRuntimeExports.jsxs("div",{className:"py-2 text-sm",children:[r("global_block_note"),e.jsxRuntimeExports.jsx("br",{}),e.jsxRuntimeExports.jsxs("ul",{className:"mt-4 list-inside list-disc space-y-1",children:[e.jsxRuntimeExports.jsxs("li",{children:[r("global_block_indicator")," ",e.jsxRuntimeExports.jsx(c.GlobeIcon,{className:"inline"})]}),e.jsxRuntimeExports.jsx("li",{children:r("global_block_category")})]})]}),e.jsxRuntimeExports.jsxs("div",{className:"my-4",children:[e.jsxRuntimeExports.jsx("label",{className:"block text-sm font-medium text-gray-400",children:r("enter_global_block_name")}),e.jsxRuntimeExports.jsx("input",{placeholder:r("eg_header_footer"),className:"mt-2 w-full",value:s,onChange:a=>n(a.target.value)})]}),e.jsxRuntimeExports.jsxs("div",{className:"flex items-center justify-end gap-x-4",children:[e.jsxRuntimeExports.jsx(i.Button,{onClick:()=>{l(u,q.capitalize(s)),t()},disabled:s.length<=2,variant:"default",children:r("mark_as_global")}),e.jsxRuntimeExports.jsx(i.Button,{variant:"outline",onClick:t,children:r("cancel")})]})]})};exports.default=m;
|
|
@@ -1,11 +1,11 @@
|
|
|
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 { a as l, b as c } from "./index-
|
|
4
|
+
import { a as l, b as c } from "./index-EGUphg4R.js";
|
|
5
5
|
import "./_commonjsHelpers-UyOWmZb0.js";
|
|
6
6
|
import "i18next";
|
|
7
7
|
import "react-i18next";
|
|
8
|
-
import "./index-
|
|
8
|
+
import "./index-niHREMmR.js";
|
|
9
9
|
import "@radix-ui/react-toggle";
|
|
10
10
|
import "class-variance-authority";
|
|
11
11
|
import "./utils-AvyFzbPC.js";
|
|
@@ -39,6 +39,7 @@ import "flat-to-nested";
|
|
|
39
39
|
import "./Functions-7jnEwJyw.js";
|
|
40
40
|
import "redux-undo";
|
|
41
41
|
import "@chaibuilder/runtime";
|
|
42
|
+
import "lodash";
|
|
42
43
|
import "@react-hookz/web";
|
|
43
44
|
import "@floating-ui/react-dom";
|
|
44
45
|
import "react-textarea-autosize";
|
|
@@ -47,13 +48,12 @@ import "react-dnd";
|
|
|
47
48
|
import "@minoru/react-dnd-treeview";
|
|
48
49
|
import "react-hotkeys-hook";
|
|
49
50
|
import "sonner";
|
|
50
|
-
import "./html-to-json-
|
|
51
|
+
import "./html-to-json-57841sEK.js";
|
|
51
52
|
import "himalaya";
|
|
52
|
-
import "lodash";
|
|
53
53
|
import "lucide-react";
|
|
54
54
|
import "./web-blocks.js";
|
|
55
55
|
import "./controls-XPXGHKht.js";
|
|
56
|
-
const x = i.lazy(() => import("./add-page-modal-
|
|
56
|
+
const x = i.lazy(() => import("./add-page-modal-6DlGzdA4.js")), g = i.lazy(() => import("./page-viewer-EoYYnA56.js")), jt = () => {
|
|
57
57
|
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);
|
|
58
58
|
return /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
|
|
59
59
|
/* @__PURE__ */ t.jsxs("div", { className: "flex items-center justify-between rounded-md bg-background/30 p-1", children: [
|