@chaibuilder/sdk 1.2.9 → 1.2.10-7.beta.2

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.
Files changed (124) hide show
  1. package/README.md +26 -21
  2. package/dist/CodeEditor-2fowVPcS.cjs +143 -0
  3. package/dist/CodeEditor-b6uePnTe.js +143 -0
  4. package/dist/STRINGS-RCf9qnaS.cjs +9 -0
  5. package/dist/STRINGS-t8UhMYZ6.js +10 -0
  6. package/dist/Topbar-O21Nrw2O.cjs +137 -0
  7. package/dist/Topbar-xFfdTq1m.js +137 -0
  8. package/dist/UnsplashImages-awQiGFMX.cjs +280 -0
  9. package/dist/UnsplashImages-qQmFIWEy.js +280 -0
  10. package/dist/UploadImages-a8Hl0tyg.cjs +170 -0
  11. package/dist/UploadImages-cudxJepv.js +170 -0
  12. package/dist/context-menu-VMB9i0d8.cjs +1074 -0
  13. package/dist/context-menu-mp3Gu2KA.js +1043 -0
  14. package/dist/controls-4t-C_rP2.cjs +233 -0
  15. package/dist/controls-fQIu127i.js +234 -0
  16. package/dist/core.cjs +135 -1
  17. package/dist/core.d.ts +344 -119
  18. package/dist/core.js +111 -88
  19. package/dist/iconBase-OGxLGBQ1.cjs +156 -0
  20. package/dist/iconBase-Ofd16yeE.js +157 -0
  21. package/dist/index-R7v8ZYnu.js +12110 -0
  22. package/dist/index-WHVUpVPa.cjs +12125 -0
  23. package/dist/jsx-runtime-_yxTjXEh.js +931 -0
  24. package/dist/jsx-runtime-vPqyLgmD.cjs +930 -0
  25. package/dist/mockServiceWorker.js +18 -10
  26. package/dist/plugin-RAiM74uD.cjs +116 -0
  27. package/dist/plugin-T1qbgBUO.js +55 -0
  28. package/dist/plugin-YcxlCmRm.js +117 -0
  29. package/dist/plugin-cYi6q9KC.cjs +54 -0
  30. package/dist/render.cjs +215 -1
  31. package/dist/render.d.ts +21 -40
  32. package/dist/render.js +190 -98
  33. package/dist/runtime.cjs +28 -0
  34. package/dist/runtime.d.ts +5 -0
  35. package/dist/runtime.js +21 -0
  36. package/dist/style.css +1524 -1
  37. package/dist/tailwind.cjs +80 -1
  38. package/dist/tailwind.d.ts +49 -8
  39. package/dist/tailwind.js +23 -25
  40. package/dist/ui.cjs +410 -1
  41. package/dist/ui.d.ts +3 -13
  42. package/dist/ui.js +374 -163
  43. package/dist/web-blocks.cjs +1246 -9
  44. package/dist/web-blocks.d.ts +1 -1
  45. package/dist/web-blocks.js +961 -789
  46. package/package.json +66 -83
  47. package/dist/AddBlocks-tMxKPoen.js +0 -225
  48. package/dist/AddBlocks-x2LkOHSj.cjs +0 -1
  49. package/dist/BrandingOptions-EzT9UYd6.cjs +0 -1
  50. package/dist/BrandingOptions-QJJ1y5ez.js +0 -194
  51. package/dist/CanvasArea-mlNKmCOh.js +0 -1425
  52. package/dist/CanvasArea-xs4wM64L.cjs +0 -60
  53. package/dist/CurrentPage-aaU4F7wi.cjs +0 -1
  54. package/dist/CurrentPage-lBy25sZn.js +0 -111
  55. package/dist/Functions-7jnEwJyw.js +0 -15
  56. package/dist/Functions-N3yhPYKY.cjs +0 -1
  57. package/dist/Layers-3Xs4A5i8.js +0 -404
  58. package/dist/Layers-eaHy5PK9.cjs +0 -1
  59. package/dist/MODIFIERS-2FeVfZQ9.cjs +0 -1
  60. package/dist/MODIFIERS-RiXS5Mn1.js +0 -67
  61. package/dist/MarkAsGlobalBlock-BjP-Rqlf.js +0 -88
  62. package/dist/MarkAsGlobalBlock-X5dNmZcb.cjs +0 -1
  63. package/dist/PagesPanel--BZhafnt.js +0 -69
  64. package/dist/PagesPanel-gGKCV394.cjs +0 -1
  65. package/dist/ProjectPanel-YcLkM-DW.js +0 -90
  66. package/dist/ProjectPanel-yFJRy0_E.cjs +0 -1
  67. package/dist/Settings-7wlLcvoh.cjs +0 -1
  68. package/dist/Settings-TAgX4hov.js +0 -2186
  69. package/dist/SidePanels-5H4j0mIs.cjs +0 -1
  70. package/dist/SidePanels-btVQQkVK.js +0 -349
  71. package/dist/Topbar-V8xCetWF.cjs +0 -1
  72. package/dist/Topbar-j4t4AgCq.js +0 -116
  73. package/dist/UnsplashImages-41Y3q5_Q.js +0 -200
  74. package/dist/UnsplashImages-DbHky6cj.cjs +0 -1
  75. package/dist/UploadImages-DnQ95_NW.cjs +0 -1
  76. package/dist/UploadImages-xBg-kbKv.js +0 -138
  77. package/dist/_commonjsHelpers-UyOWmZb0.js +0 -8
  78. package/dist/_commonjsHelpers-wDK0ZLPo.cjs +0 -1
  79. package/dist/add-page-modal-MwS7iXn_.cjs +0 -1
  80. package/dist/add-page-modal-cm8damU2.js +0 -108
  81. package/dist/confirm-alert-U7-NcG7G.cjs +0 -1
  82. package/dist/confirm-alert-i4pM3mOt.js +0 -62
  83. package/dist/controls-Dy1qa8Dc.cjs +0 -1
  84. package/dist/controls-XPXGHKht.js +0 -182
  85. package/dist/delete-page-modal-5o4jXu-z.cjs +0 -1
  86. package/dist/delete-page-modal-YrIBvfFA.js +0 -88
  87. package/dist/email-blocks.cjs +0 -1
  88. package/dist/email-blocks.d.ts +0 -3
  89. package/dist/email-blocks.js +0 -274
  90. package/dist/form-OVmsLOrc.js +0 -125
  91. package/dist/form-VbouZlAW.cjs +0 -1
  92. package/dist/functions-Ox_svtKm.cjs +0 -1
  93. package/dist/functions-xIebp8Aw.js +0 -23
  94. package/dist/html-to-json-2PeOCVey.cjs +0 -1
  95. package/dist/html-to-json-57841sEK.js +0 -183
  96. package/dist/index-H6vIwGfD.cjs +0 -1
  97. package/dist/index-N50dZnlC.cjs +0 -206
  98. package/dist/index-e0c8PmRQ.js +0 -205
  99. package/dist/index-gi1LIOCw.cjs +0 -1
  100. package/dist/index-niHREMmR.js +0 -2938
  101. package/dist/index-pZhGT8uT.js +0 -41620
  102. package/dist/jsx-runtime-WbnYoNE9.js +0 -634
  103. package/dist/jsx-runtime-Z_BpKhVy.cjs +0 -27
  104. package/dist/lib.cjs +0 -4
  105. package/dist/lib.d.ts +0 -78
  106. package/dist/lib.js +0 -1322
  107. package/dist/page-viewer-SLt8XgYv.cjs +0 -1
  108. package/dist/page-viewer-feqJr1QI.js +0 -115
  109. package/dist/project-general-setting-SgagORzW.js +0 -83
  110. package/dist/project-general-setting-ym0yCdOq.cjs +0 -1
  111. package/dist/project-seo-setting-Snn2nZgS.cjs +0 -1
  112. package/dist/project-seo-setting-wxAGEkd_.js +0 -85
  113. package/dist/server.cjs +0 -1
  114. package/dist/server.d.ts +0 -299
  115. package/dist/server.js +0 -216
  116. package/dist/single-page-detail-IPod1o5P.cjs +0 -1
  117. package/dist/single-page-detail-dnWMyg6P.js +0 -222
  118. package/dist/studio.cjs +0 -1
  119. package/dist/studio.d.ts +0 -13
  120. package/dist/studio.js +0 -58
  121. package/dist/useAddBlockByDrop-_nwI4W3q.js +0 -20
  122. package/dist/useAddBlockByDrop-inkD7Lck.cjs +0 -1
  123. package/dist/utils-AvyFzbPC.js +0 -1075
  124. package/dist/utils-PTxFk6qT.cjs +0 -1
@@ -1,404 +0,0 @@
1
- import { j as e } from "./jsx-runtime-WbnYoNE9.js";
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-pZhGT8uT.js";
13
- import { u as Je } from "./useAddBlockByDrop-_nwI4W3q.js";
14
- import "./_commonjsHelpers-UyOWmZb0.js";
15
- import "@radix-ui/react-toggle";
16
- import "class-variance-authority";
17
- import "./utils-AvyFzbPC.js";
18
- import "clsx";
19
- import "tailwind-merge";
20
- import "@radix-ui/react-switch";
21
- import "@radix-ui/react-slot";
22
- import "@radix-ui/react-accordion";
23
- import "@radix-ui/react-alert-dialog";
24
- import "@radix-ui/react-dialog";
25
- import "@radix-ui/react-label";
26
- import "@radix-ui/react-scroll-area";
27
- import "@radix-ui/react-tabs";
28
- import "@radix-ui/react-tooltip";
29
- import "@radix-ui/react-popover";
30
- import "@radix-ui/react-menubar";
31
- import "@radix-ui/react-hover-card";
32
- import "@radix-ui/react-select";
33
- import "@radix-ui/react-dropdown-menu";
34
- import "@radix-ui/react-separator";
35
- import "@radix-ui/react-toast";
36
- import "cmdk";
37
- import "@radix-ui/react-context-menu";
38
- import "react-icons-picker";
39
- import "react-dom";
40
- import "react-quill";
41
- import "jotai";
42
- import "flat-to-nested";
43
- import "redux-undo";
44
- import "@chaibuilder/runtime";
45
- import "lodash";
46
- import "@react-hookz/web";
47
- import "i18next";
48
- import "@floating-ui/react-dom";
49
- import "react-textarea-autosize";
50
- import "flagged";
51
- import "react-hotkeys-hook";
52
- import "sonner";
53
- import "./html-to-json-57841sEK.js";
54
- import "himalaya";
55
- import "./web-blocks.js";
56
- import "./controls-XPXGHKht.js";
57
- const M = (t) => {
58
- switch (t.type) {
59
- case "Image":
60
- return /* @__PURE__ */ e.jsx(le, {});
61
- case "Heading":
62
- return /* @__PURE__ */ e.jsx(ce, {});
63
- case "Text":
64
- return /* @__PURE__ */ e.jsx(w, {});
65
- case "Link":
66
- return /* @__PURE__ */ e.jsx(ae, {});
67
- case "Video":
68
- return /* @__PURE__ */ e.jsx(re, {});
69
- case "RichText":
70
- return /* @__PURE__ */ e.jsx(ne, {});
71
- case "Button":
72
- return /* @__PURE__ */ e.jsx(B, {});
73
- case "CustomHTML":
74
- return /* @__PURE__ */ e.jsx(oe, {});
75
- case "Divider":
76
- return /* @__PURE__ */ e.jsx(se, {});
77
- case "Icon":
78
- return /* @__PURE__ */ e.jsx(te, {});
79
- case "List":
80
- return /* @__PURE__ */ e.jsx(v, {});
81
- case "Paragraph":
82
- return /* @__PURE__ */ e.jsx(w, {});
83
- case "Row":
84
- return /* @__PURE__ */ e.jsx(v, {});
85
- case "ListItem":
86
- return /* @__PURE__ */ e.jsx(ee, {});
87
- case "LineBreak":
88
- return /* @__PURE__ */ e.jsx(Z, {});
89
- case "Form":
90
- return /* @__PURE__ */ e.jsx(X, {});
91
- case "Checkbox":
92
- return /* @__PURE__ */ e.jsx(J, {});
93
- case "FormButton":
94
- return /* @__PURE__ */ e.jsx(B, {});
95
- case "Input":
96
- case "TextArea":
97
- return /* @__PURE__ */ e.jsx(W, {});
98
- case "Radio":
99
- return /* @__PURE__ */ e.jsx(q, {});
100
- case "Select":
101
- return /* @__PURE__ */ e.jsx(Y, {});
102
- case "Table":
103
- return /* @__PURE__ */ e.jsx(U, {});
104
- case "TableHead":
105
- return /* @__PURE__ */ e.jsx(Q, {});
106
- case "TableBody":
107
- return /* @__PURE__ */ e.jsx(K, {});
108
- case "TableRow":
109
- return /* @__PURE__ */ e.jsx(G, {});
110
- case "TableCell":
111
- return /* @__PURE__ */ e.jsx($, {});
112
- case "DataProvider":
113
- return /* @__PURE__ */ e.jsx($e, { size: 16 });
114
- case "Box":
115
- return /* @__PURE__ */ e.jsx(D, {});
116
- default:
117
- return /* @__PURE__ */ e.jsx(F, {});
118
- }
119
- };
120
- function Xe(t = "") {
121
- const s = {
122
- xs: "390px",
123
- sm: "640px",
124
- md: "768px",
125
- lg: "1024px",
126
- xl: "1366px",
127
- "2xl": "1536px"
128
- };
129
- if (new RegExp(/\bsr-only\b/).test(t))
130
- return "Sr Only";
131
- if (new RegExp(/\b(sm|md|lg|xl|2xl):hidden\b/).test(t))
132
- return "Visible on mobile";
133
- if (t.match(/(^| )hidden( |$)/g)) {
134
- const a = new RegExp(
135
- // checks if any of the display property is set for any higher media query
136
- /\b(sm|md|lg|xl|2xl):(block|grid|flex|inline|inline-grid|inline-flex|inline-block)\b/
137
- ), c = t.match(a);
138
- if (C(c, 1))
139
- return `Visible >=${s[C(c, 1)]}`;
140
- }
141
- return "";
142
- }
143
- const Ze = (t) => {
144
- let s = "";
145
- return Object.keys(t).forEach((o) => {
146
- P(t[o], qe) && (s = t[o]);
147
- }), s;
148
- }, et = (t) => {
149
- var g;
150
- const [, s] = Ce(), [o] = Be(), { isSelected: r } = t, { id: a, data: c } = t.node, d = t.depth * 10, m = (l) => {
151
- l.stopPropagation(), t.onToggle(t.node.id);
152
- }, j = Ie(a, t.isOpen, t.onToggle), p = Ge(() => {
153
- const l = Ze(t.node.data);
154
- return Xe(l);
155
- }, [t.node.data]);
156
- return (
157
- // eslint-disable-next-line jsx-a11y/click-events-have-key-events,jsx-a11y/no-static-element-interactions
158
- /* @__PURE__ */ e.jsx(
159
- "div",
160
- {
161
- onMouseEnter: () => s(a),
162
- className: k(
163
- "group flex w-full items-center justify-between space-x-px py-px",
164
- r ? "bg-blue-500 text-white" : "hover:bg-gray-200 dark:hover:bg-gray-800"
165
- ),
166
- onClick: (l) => {
167
- l.stopPropagation(), !o.includes(a) && t.onSelect(a);
168
- },
169
- onContextMenu: () => t.onSelect(a),
170
- style: { paddingInlineStart: d },
171
- ...j,
172
- children: /* @__PURE__ */ e.jsxs("div", { className: "flex items-center", children: [
173
- /* @__PURE__ */ e.jsx(
174
- "div",
175
- {
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: m, type: "button", children: /* @__PURE__ */ e.jsx(ie, {}) })
178
- }
179
- ),
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(M, { type: c == null ? void 0 : c._type }) }),
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
- p ? /* @__PURE__ */ e.jsxs(
184
- "span",
185
- {
186
- className: "ml-2 flex items-center text-[10px] italic " + (r ? "text-gray-200" : "text-gray-500"),
187
- children: [
188
- "(",
189
- p,
190
- ")"
191
- ]
192
- }
193
- ) : null
194
- ] })
195
- ] })
196
- }
197
- )
198
- );
199
- }, tt = (t) => {
200
- var o;
201
- const { item: s } = t.monitorProps;
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(M, { type: (o = s == null ? void 0 : s.data) == null ? void 0 : o._type }) }),
204
- /* @__PURE__ */ e.jsx("div", { className: "ml-2 truncate text-[11px]", children: s.text })
205
- ] });
206
- }, st = (t) => {
207
- const s = t.depth * 10 + 16;
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
- }, ot = Ke(() => import("./MarkAsGlobalBlock-BjP-Rqlf.js")), nt = () => {
210
- const [t] = x(), [, s] = ve();
211
- return /* @__PURE__ */ e.jsxs(i, { className: "flex items-center gap-x-4 text-xs", onClick: () => s(t), children: [
212
- /* @__PURE__ */ e.jsx(xe, {}),
213
- " Cut"
214
- ] });
215
- }, rt = () => {
216
- const [t] = x(), [, s] = we();
217
- return /* @__PURE__ */ e.jsxs(i, { className: "flex items-center gap-x-4 text-xs", onClick: () => s(t), children: [
218
- /* @__PURE__ */ e.jsx(de, {}),
219
- " Copy"
220
- ] });
221
- }, at = () => {
222
- const [t] = x(), s = Se(), o = Te();
223
- return /* @__PURE__ */ e.jsxs(
224
- i,
225
- {
226
- disabled: (o == null ? void 0 : o._type) === "Slot",
227
- className: "flex items-center gap-x-4 text-xs",
228
- onClick: () => s(t),
229
- children: [
230
- /* @__PURE__ */ e.jsx(me, {}),
231
- " Remove"
232
- ]
233
- }
234
- );
235
- }, ct = ({
236
- id: t = null,
237
- openMarkAsGlobalModal: s
238
- }) => {
239
- const [o] = x(), r = De(), { pasteBlocks: a, canPaste: c } = Ne(), d = Me("globalBlocksSupport", !1), m = Qe(() => {
240
- r(o);
241
- }, [o, r]);
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
- " Mark as global"
246
- ] }) }),
247
- /* @__PURE__ */ e.jsxs(i, { className: "flex items-center gap-x-4 text-xs", onClick: m, children: [
248
- /* @__PURE__ */ e.jsx(ue, {}),
249
- " Duplicate"
250
- ] }),
251
- /* @__PURE__ */ e.jsx(nt, {}),
252
- /* @__PURE__ */ e.jsx(rt, {}),
253
- /* @__PURE__ */ e.jsxs(
254
- i,
255
- {
256
- className: "flex items-center gap-x-4 text-xs",
257
- onClick: () => a(t),
258
- disabled: !c,
259
- children: [
260
- /* @__PURE__ */ e.jsx(ge, {}),
261
- " Paste"
262
- ]
263
- }
264
- ),
265
- /* @__PURE__ */ e.jsx(at, {})
266
- ] });
267
- }, lt = ({ children: t, id: s = null }) => {
268
- const [o, r] = Ue(!1);
269
- return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
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
- ] })
275
- ] });
276
- };
277
- function it(t) {
278
- return S(t, (s) => {
279
- const { data: o } = s;
280
- return {
281
- ...o,
282
- _parent: s.parent === 0 ? null : s.parent
283
- };
284
- });
285
- }
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;
309
- if (b) {
310
- m();
311
- const A = it(n);
312
- s(A);
313
- const H = y.getItem();
314
- r([H.id]);
315
- } else
316
- await p({ block: y.getItem(), dropTargetId: I, relativeIndex: f });
317
- }, O = S(t, (n) => ({
318
- id: n._id,
319
- text: n._type,
320
- parent: n._parent || 0,
321
- droppable: !L(z(t, { _parent: n._id })),
322
- data: n
323
- })), R = () => {
324
- r([]), c([]);
325
- }, [{ isOver: h }, _] = be(() => ({
326
- accept: ["CHAI_BLOCK"],
327
- collect: (n) => ({
328
- canDrop: n.canDrop(),
329
- isOver: n.isOver()
330
- }),
331
- drop: (n) => {
332
- (async () => await p({
333
- block: n,
334
- dropTargetId: "",
335
- relativeIndex: 0
336
- }))();
337
- }
338
- })), { isDragging: E } = fe((n) => ({
339
- isDragging: n.isDragging()
340
- }));
341
- return /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsx(
342
- "div",
343
- {
344
- onClick: () => R(),
345
- className: k(
346
- "-mx-1 -mt-1 flex h-full select-none flex-col space-y-1",
347
- E ? "bg-green-50/80" : "bg-background"
348
- ),
349
- children: V(t) ? /* @__PURE__ */ e.jsxs(
350
- "div",
351
- {
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" : ""}`,
354
- 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") })
357
- ]
358
- }
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
- ] })
399
- }
400
- ) });
401
- };
402
- export {
403
- ps as default
404
- };
@@ -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"),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-N50dZnlC.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;
@@ -1 +0,0 @@
1
- "use strict";const e="#styles:",o="#slots:",t="#i18n",i=["hover","focus","focus-within","focus-visible","active","visited","target","first","last","only","odd","even","first-of-type","last-of-type","only-of-type","empty","disabled","checked","indeterminate","default","required","valid","invalid","in-range","out-of-range","placeholder-shown","autofill","read-only","open","before","after","first-letter","first-line","marker","selection","file","placeholder","ui-open","ui-disabled","ui-active","ui-selected","ui-checked","ui-not-open","ui-not-disabled","ui-not-active","ui-not-selected","ui-not-checked"],n={bodyFont:"Inter",headingFont:"Inter",roundedCorners:5,primaryColor:"#570df8",secondaryColor:"#f002b8",bodyBgDarkColor:"#031022",bodyBgLightColor:"#fcfcfc",bodyTextDarkColor:"#ffffff",bodyTextLightColor:"#000000"};exports.BRANDING_OPTIONS_DEFAULTS=n;exports.I18N_KEY=t;exports.MODIFIERS=i;exports.SLOT_KEY=o;exports.STYLES_KEY=e;
@@ -1,67 +0,0 @@
1
- const e = "#styles:", o = "#slots:", t = "#i18n", i = [
2
- "hover",
3
- "focus",
4
- "focus-within",
5
- "focus-visible",
6
- "active",
7
- "visited",
8
- "target",
9
- "first",
10
- "last",
11
- "only",
12
- "odd",
13
- "even",
14
- "first-of-type",
15
- "last-of-type",
16
- "only-of-type",
17
- "empty",
18
- "disabled",
19
- "checked",
20
- "indeterminate",
21
- "default",
22
- "required",
23
- "valid",
24
- "invalid",
25
- "in-range",
26
- "out-of-range",
27
- "placeholder-shown",
28
- "autofill",
29
- "read-only",
30
- "open",
31
- "before",
32
- "after",
33
- "first-letter",
34
- "first-line",
35
- "marker",
36
- "selection",
37
- "file",
38
- "placeholder",
39
- // headless UI
40
- "ui-open",
41
- "ui-disabled",
42
- "ui-active",
43
- "ui-selected",
44
- "ui-checked",
45
- "ui-not-open",
46
- "ui-not-disabled",
47
- "ui-not-active",
48
- "ui-not-selected",
49
- "ui-not-checked"
50
- ], n = {
51
- bodyFont: "Inter",
52
- headingFont: "Inter",
53
- roundedCorners: 5,
54
- primaryColor: "#570df8",
55
- secondaryColor: "#f002b8",
56
- bodyBgDarkColor: "#031022",
57
- bodyBgLightColor: "#fcfcfc",
58
- bodyTextDarkColor: "#ffffff",
59
- bodyTextLightColor: "#000000"
60
- };
61
- export {
62
- n as B,
63
- t as I,
64
- i as M,
65
- o as S,
66
- e as a
67
- };
@@ -1,88 +0,0 @@
1
- import { j as t } from "./jsx-runtime-WbnYoNE9.js";
2
- import { useTranslation as p } from "react-i18next";
3
- import { GlobeIcon as n } from "@radix-ui/react-icons";
4
- import { useState as c } from "react";
5
- import { a0 as d, B as l } from "./index-niHREMmR.js";
6
- import { capitalize as x } from "lodash-es";
7
- import "./_commonjsHelpers-UyOWmZb0.js";
8
- import "@radix-ui/react-toggle";
9
- import "class-variance-authority";
10
- import "./utils-AvyFzbPC.js";
11
- import "./MODIFIERS-RiXS5Mn1.js";
12
- import "clsx";
13
- import "tailwind-merge";
14
- import "@radix-ui/react-switch";
15
- import "@radix-ui/react-slot";
16
- import "@radix-ui/react-accordion";
17
- import "@radix-ui/react-alert-dialog";
18
- import "@radix-ui/react-dialog";
19
- import "@radix-ui/react-label";
20
- import "@radix-ui/react-scroll-area";
21
- import "@radix-ui/react-tabs";
22
- import "@radix-ui/react-tooltip";
23
- import "@radix-ui/react-popover";
24
- import "@radix-ui/react-menubar";
25
- import "@radix-ui/react-hover-card";
26
- import "@radix-ui/react-select";
27
- import "@radix-ui/react-dropdown-menu";
28
- import "@radix-ui/react-separator";
29
- import "@radix-ui/react-toast";
30
- import "cmdk";
31
- import "@radix-ui/react-context-menu";
32
- import "react-icons-picker";
33
- import "react-dom";
34
- import "react-quill";
35
- import "jotai";
36
- import "flat-to-nested";
37
- import "./Functions-7jnEwJyw.js";
38
- import "redux-undo";
39
- import "@chaibuilder/runtime";
40
- import "lodash";
41
- import "@react-hookz/web";
42
- const ot = ({ id: m = null, closeModal: i }) => {
43
- const { t: o } = p(), e = d(), [r, a] = c("");
44
- return /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
45
- /* @__PURE__ */ t.jsx("h1", { className: "text-lg font-bold", children: o("mark_as_global") }),
46
- /* @__PURE__ */ t.jsxs("div", { className: "py-2 text-sm", children: [
47
- o("global_block_note"),
48
- /* @__PURE__ */ t.jsx("br", {}),
49
- /* @__PURE__ */ t.jsxs("ul", { className: "mt-4 list-inside list-disc space-y-1", children: [
50
- /* @__PURE__ */ t.jsxs("li", { children: [
51
- o("global_block_indicator"),
52
- " ",
53
- /* @__PURE__ */ t.jsx(n, { className: "inline" })
54
- ] }),
55
- /* @__PURE__ */ t.jsx("li", { children: o("global_block_category") })
56
- ] })
57
- ] }),
58
- /* @__PURE__ */ t.jsxs("div", { className: "my-4", children: [
59
- /* @__PURE__ */ t.jsx("label", { className: "block text-sm font-medium text-gray-400", children: o("enter_global_block_name") }),
60
- /* @__PURE__ */ t.jsx(
61
- "input",
62
- {
63
- placeholder: o("eg_header_footer"),
64
- className: "mt-2 w-full",
65
- value: r,
66
- onChange: (s) => a(s.target.value)
67
- }
68
- )
69
- ] }),
70
- /* @__PURE__ */ t.jsxs("div", { className: "flex items-center justify-end gap-x-4", children: [
71
- /* @__PURE__ */ t.jsx(
72
- l,
73
- {
74
- onClick: () => {
75
- e(m, x(r)), i();
76
- },
77
- disabled: r.length <= 2,
78
- variant: "default",
79
- children: o("mark_as_global")
80
- }
81
- ),
82
- /* @__PURE__ */ t.jsx(l, { variant: "outline", onClick: i, children: o("cancel") })
83
- ] })
84
- ] });
85
- };
86
- export {
87
- ot as default
88
- };
@@ -1 +0,0 @@
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,69 +0,0 @@
1
- import { j as t } from "./jsx-runtime-WbnYoNE9.js";
2
- import i, { Suspense as s } from "react";
3
- import { sortBy as a, filter as d, get as n } from "lodash-es";
4
- import { a as l, b as c } from "./index-pZhGT8uT.js";
5
- import "./_commonjsHelpers-UyOWmZb0.js";
6
- import "i18next";
7
- import "react-i18next";
8
- import "./index-niHREMmR.js";
9
- import "@radix-ui/react-toggle";
10
- import "class-variance-authority";
11
- import "./utils-AvyFzbPC.js";
12
- import "./MODIFIERS-RiXS5Mn1.js";
13
- import "clsx";
14
- import "tailwind-merge";
15
- import "@radix-ui/react-switch";
16
- import "@radix-ui/react-slot";
17
- import "@radix-ui/react-accordion";
18
- import "@radix-ui/react-icons";
19
- import "@radix-ui/react-alert-dialog";
20
- import "@radix-ui/react-dialog";
21
- import "@radix-ui/react-label";
22
- import "@radix-ui/react-scroll-area";
23
- import "@radix-ui/react-tabs";
24
- import "@radix-ui/react-tooltip";
25
- import "@radix-ui/react-popover";
26
- import "@radix-ui/react-menubar";
27
- import "@radix-ui/react-hover-card";
28
- import "@radix-ui/react-select";
29
- import "@radix-ui/react-dropdown-menu";
30
- import "@radix-ui/react-separator";
31
- import "@radix-ui/react-toast";
32
- import "cmdk";
33
- import "@radix-ui/react-context-menu";
34
- import "react-icons-picker";
35
- import "react-dom";
36
- import "react-quill";
37
- import "jotai";
38
- import "flat-to-nested";
39
- import "./Functions-7jnEwJyw.js";
40
- import "redux-undo";
41
- import "@chaibuilder/runtime";
42
- import "lodash";
43
- import "@react-hookz/web";
44
- import "@floating-ui/react-dom";
45
- import "react-textarea-autosize";
46
- import "flagged";
47
- import "react-dnd";
48
- import "@minoru/react-dnd-treeview";
49
- import "react-hotkeys-hook";
50
- import "sonner";
51
- import "./html-to-json-57841sEK.js";
52
- import "himalaya";
53
- import "lucide-react";
54
- import "./web-blocks.js";
55
- import "./controls-XPXGHKht.js";
56
- const x = i.lazy(() => import("./add-page-modal-cm8damU2.js")), g = i.lazy(() => import("./page-viewer-feqJr1QI.js")), jt = () => {
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
- return /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
59
- /* @__PURE__ */ t.jsxs("div", { className: "flex items-center justify-between rounded-md bg-background/30 p-1", children: [
60
- /* @__PURE__ */ t.jsx("h1", { className: "px-1 font-semibold", children: "Pages" }),
61
- /* @__PURE__ */ t.jsx(s, { fallback: /* @__PURE__ */ t.jsx("div", { className: "text-sm text-blue-500 underline", children: "+ New Page" }), children: /* @__PURE__ */ t.jsx(x, {}) })
62
- ] }),
63
- /* @__PURE__ */ t.jsx("hr", { className: "-mx-1" }),
64
- /* @__PURE__ */ t.jsx("div", { className: "-mx-1 divide-y-2", children: /* @__PURE__ */ t.jsx(g, { isLoading: m, pages: p }) })
65
- ] });
66
- };
67
- export {
68
- jt as default
69
- };