@chaibuilder/sdk 1.1.13 → 1.1.15

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 (101) hide show
  1. package/dist/AddBlocks-AG_J7s2Z.cjs +1 -0
  2. package/dist/{AddBlocks-A7WofxHV.js → AddBlocks-FsdsASNp.js} +51 -51
  3. package/dist/BrandingOptions-TRVyCvVq.cjs +1 -0
  4. package/dist/{BrandingOptions-wkFrLFI_.js → BrandingOptions-zFJ28xmJ.js} +23 -23
  5. package/dist/{CanvasArea-chEYQhH8.js → CanvasArea-IiD0f6Eq.js} +7 -7
  6. package/dist/{CanvasArea-kF46NWZK.cjs → CanvasArea-Kbw-TjPH.cjs} +7 -7
  7. package/dist/CurrentPage-lOQd17GA.cjs +1 -0
  8. package/dist/{CurrentPage-Wd7F9Egg.js → CurrentPage-n2RQMBpJ.js} +10 -10
  9. package/dist/{Layers-qMOMP2Mi.js → Layers-38kbAjTI.js} +81 -81
  10. package/dist/Layers-D2WY0CpR.cjs +1 -0
  11. package/dist/MarkAsGlobalBlock-LXDkmFUr.cjs +1 -0
  12. package/dist/{MarkAsGlobalBlock-Czq45Amf.js → MarkAsGlobalBlock-xOHhiMDl.js} +3 -3
  13. package/dist/PagesPanel-RWnIpNqP.cjs +1 -0
  14. package/dist/{PagesPanel-ay4uk4mg.js → PagesPanel-bNqfHuCk.js} +6 -6
  15. package/dist/{ProjectPanel-eLlbfAtj.js → ProjectPanel-1Kgm2-R5.js} +10 -10
  16. package/dist/ProjectPanel-cXKiyEXm.cjs +1 -0
  17. package/dist/Settings-5AI0CInt.cjs +1 -0
  18. package/dist/{Settings-lpoxaMDu.js → Settings-ou3Owu0B.js} +454 -454
  19. package/dist/SidePanels-NV3UX8kK.cjs +1 -0
  20. package/dist/{SidePanels-iRXV69vh.js → SidePanels-muLqfBql.js} +36 -36
  21. package/dist/{Topbar-dQYhW4iv.js → Topbar-_-1HX-EE.js} +3 -3
  22. package/dist/Topbar-gQxbcPtG.cjs +1 -0
  23. package/dist/UnsplashImages-PNp5fYCc.cjs +1 -0
  24. package/dist/{UnsplashImages-AL1ASAoD.js → UnsplashImages-mqK09h8E.js} +6 -6
  25. package/dist/UploadImages-BoSSsLtD.cjs +1 -0
  26. package/dist/{UploadImages-09wuhk2O.js → UploadImages-IDkkRuhx.js} +3 -3
  27. package/dist/{add-page-modal-TXREEFPZ.js → add-page-modal-AJorVipD.js} +16 -16
  28. package/dist/add-page-modal-zOdAgfvh.cjs +1 -0
  29. package/dist/confirm-alert-dHRDZrA1.cjs +1 -0
  30. package/dist/{confirm-alert-GkfW9chS.js → confirm-alert-ea5xpncD.js} +3 -3
  31. package/dist/controls-QnyBNkXG.cjs +36 -0
  32. package/dist/controls-kEuiMMDf.js +4600 -0
  33. package/dist/core.cjs +1 -1
  34. package/dist/core.d.ts +5 -15
  35. package/dist/core.js +5 -5
  36. package/dist/{delete-page-modal-LNME2FwD.js → delete-page-modal-0VAs4Heb.js} +5 -5
  37. package/dist/delete-page-modal-KRBGE4Fo.cjs +1 -0
  38. package/dist/form-6qGAOYI3.cjs +1 -0
  39. package/dist/{form-Fk4CaX1A.js → form-irY39wvJ.js} +29 -29
  40. package/dist/functions-86L6n983.js +23 -0
  41. package/dist/functions-Jr7gX_RX.cjs +1 -0
  42. package/dist/{html-to-json-kGgp07Hv.js → html-to-json-Y5M0N8PH.js} +33 -33
  43. package/dist/html-to-json-aAZkA0f5.cjs +1 -0
  44. package/dist/{index-89A3jPHh.js → index-0OqmBgqo.js} +3 -3
  45. package/dist/{index-Q5q5Y_8a.js → index-4fMl4eN2.js} +6 -6
  46. package/dist/index-d55M5MRz.cjs +1 -0
  47. package/dist/{index-61c5wSJn.cjs → index-veRjBw4J.cjs} +2 -2
  48. package/dist/lib.cjs +1 -1
  49. package/dist/lib.js +27 -27
  50. package/dist/lodash-2us0VT8I.cjs +36 -0
  51. package/dist/lodash-3gkdNK5u.js +4538 -0
  52. package/dist/page-viewer-LvBMrQas.cjs +1 -0
  53. package/dist/{page-viewer-LPx-OTCC.js → page-viewer-QuVbTBKO.js} +6 -6
  54. package/dist/{project-general-setting-sSpFUD_Y.js → project-general-setting-6Nsq4-2Z.js} +9 -9
  55. package/dist/project-general-setting-pSrUGR7K.cjs +1 -0
  56. package/dist/{project-seo-setting-CGVegBtM.js → project-seo-setting-EhqUcTKy.js} +9 -9
  57. package/dist/project-seo-setting-N0OnBCvh.cjs +1 -0
  58. package/dist/render.cjs +1 -1
  59. package/dist/render.js +46 -46
  60. package/dist/server.cjs +1 -1
  61. package/dist/server.js +11 -11
  62. package/dist/single-page-detail-JWCEEBaZ.cjs +1 -0
  63. package/dist/{single-page-detail-32H1_IG4.js → single-page-detail-SAqjZ5E1.js} +53 -53
  64. package/dist/studio.cjs +1 -1
  65. package/dist/studio.js +5 -5
  66. package/dist/ui.cjs +1 -1
  67. package/dist/ui.js +3 -3
  68. package/dist/useAddBlockByDrop-5QW86HjG.js +20 -0
  69. package/dist/useAddBlockByDrop-Ckzuvu-s.cjs +1 -0
  70. package/dist/utils-37UXq2O5.cjs +1 -0
  71. package/dist/{utils-zWMk4dB2.js → utils-XsPKXMVo.js} +5 -5
  72. package/package.json +3 -3
  73. package/dist/AddBlocks-Yuc4t0Z_.cjs +0 -1
  74. package/dist/BrandingOptions-KkPF1OGn.cjs +0 -1
  75. package/dist/CurrentPage-p9MaXTOB.cjs +0 -1
  76. package/dist/Layers-wQ0Fv9Xc.cjs +0 -1
  77. package/dist/MarkAsGlobalBlock-sb3hMXLq.cjs +0 -1
  78. package/dist/PagesPanel--maZxwX5.cjs +0 -1
  79. package/dist/ProjectPanel-KhIpO7m3.cjs +0 -1
  80. package/dist/Settings-n2DpS5Ta.cjs +0 -1
  81. package/dist/SidePanels-Dud5Xh9L.cjs +0 -1
  82. package/dist/Topbar-vqzjB75a.cjs +0 -1
  83. package/dist/UnsplashImages-3Sh4UZ-7.cjs +0 -1
  84. package/dist/UploadImages-mPzLhMiH.cjs +0 -1
  85. package/dist/add-page-modal-FPnIWwqA.cjs +0 -1
  86. package/dist/confirm-alert-YNyc3WEo.cjs +0 -1
  87. package/dist/controls-G0puEH71.js +0 -120
  88. package/dist/controls-aHZq-q4b.cjs +0 -1
  89. package/dist/delete-page-modal-sTbqZPvk.cjs +0 -1
  90. package/dist/form-OhgCJlVA.cjs +0 -1
  91. package/dist/functions-ZWGlwlQY.cjs +0 -1
  92. package/dist/functions-slns6ONz.js +0 -23
  93. package/dist/html-to-json-po8on2ju.cjs +0 -1
  94. package/dist/index-GNmGzavZ.cjs +0 -1
  95. package/dist/page-viewer-wQO9oV9h.cjs +0 -1
  96. package/dist/project-general-setting-8EwuN5lN.cjs +0 -1
  97. package/dist/project-seo-setting-R77SKM1I.cjs +0 -1
  98. package/dist/single-page-detail-nyBEHLtT.cjs +0 -1
  99. package/dist/useAddBlockByDrop-4VH-SMj7.cjs +0 -1
  100. package/dist/useAddBlockByDrop-_kyR0iI4.js +0 -20
  101. package/dist/utils-tx6hqsHY.cjs +0 -1
@@ -1,17 +1,17 @@
1
1
  import { j as e } from "./jsx-runtime-NV737rRe.js";
2
- import { nth as y, startsWith as A, map as w, isUndefined as E, find as H, isEmpty as P, includes as L } from "lodash";
3
- import { BoxModelIcon as z, BoxIcon as V, DragHandleHorizontalIcon as F, ViewHorizontalIcon as G, BorderAllIcon as $, BorderTopIcon as K, TableIcon as Q, DropdownMenuIcon as U, RadiobuttonIcon as Y, InputIcon as q, ButtonIcon as B, CheckboxIcon as W, GroupIcon as Z, SpaceBetweenVerticallyIcon as J, ColumnsIcon as X, RowsIcon as C, TextIcon as v, SketchLogoIcon as ee, DividerHorizontalIcon as te, CodeIcon as se, CursorTextIcon as oe, VideoIcon as ne, Link1Icon as re, HeadingIcon as ae, ImageIcon as ce, TriangleRightIcon as le, ScissorsIcon as ie, ClipboardIcon as xe, TrashIcon as de, GlobeIcon as me, CopyIcon as pe, ClipboardCopyIcon as ue, DoubleArrowDownIcon as ge, StackIcon as je } from "@radix-ui/react-icons";
2
+ import { S as y, e as A, d as v, w as E, j as H, a as P, c as L } from "./lodash-3gkdNK5u.js";
3
+ import { BoxModelIcon as z, BoxIcon as V, DragHandleHorizontalIcon as F, ViewHorizontalIcon as G, BorderAllIcon as $, BorderTopIcon as K, TableIcon as Q, DropdownMenuIcon as U, RadiobuttonIcon as Y, InputIcon as q, ButtonIcon as B, CheckboxIcon as W, GroupIcon as Z, SpaceBetweenVerticallyIcon as J, ColumnsIcon as X, RowsIcon as C, TextIcon as w, SketchLogoIcon as ee, DividerHorizontalIcon as se, CodeIcon as te, CursorTextIcon as oe, VideoIcon as ne, Link1Icon as re, HeadingIcon as ae, ImageIcon as ce, TriangleRightIcon as le, ScissorsIcon as ie, ClipboardIcon as xe, TrashIcon as de, GlobeIcon as me, CopyIcon as pe, ClipboardCopyIcon as ue, DoubleArrowDownIcon as ge, StackIcon as je } from "@radix-ui/react-icons";
4
4
  import { useDrop as he, useDragLayer as be } from "react-dnd";
5
5
  import { useDragOver as fe, Tree as Ie } from "@minoru/react-dnd-treeview";
6
6
  import { useTranslation as ke } from "react-i18next";
7
- import { _ as ye, Z as Be, j as g, n as Ce, bz as i, k as ve, l as we, a6 as Se, m as De, o as Te, i as Ne, bA as Me, ak as Oe, al as Re, bB as _e, bC as Ae, ae as Ee, w as He, aj as Pe, p as Le, aw as ze, bo as Ve, bD as Fe } from "./index-89A3jPHh.js";
7
+ import { _ as ye, Z as Be, j as g, n as Ce, bz as i, k as we, l as ve, a6 as Se, m as De, o as Te, i as Ne, bA as Me, ak as Oe, al as Re, bB as _e, bC as Ae, ae as Ee, w as He, aj as Pe, p as Le, aw as ze, bo as Ve, bD as Fe } from "./index-0OqmBgqo.js";
8
8
  import { DatabaseIcon as Ge } from "lucide-react";
9
9
  import { useMemo as $e, lazy as Ke, useCallback as Qe, useState as Ue, Suspense as Ye } from "react";
10
10
  import { a as qe } from "./MODIFIERS-MLfpKQY1.js";
11
- import { d as S } from "./utils-zWMk4dB2.js";
12
- import { f as We } from "./index-Q5q5Y_8a.js";
11
+ import { d as S } from "./utils-XsPKXMVo.js";
12
+ import { f as We } from "./index-4fMl4eN2.js";
13
13
  import { useAtom as Ze } from "jotai";
14
- import { u as Je } from "./useAddBlockByDrop-_kyR0iI4.js";
14
+ import { u as Je } from "./useAddBlockByDrop-5QW86HjG.js";
15
15
  import "@radix-ui/react-toggle";
16
16
  import "class-variance-authority";
17
17
  import "@radix-ui/react-switch";
@@ -47,16 +47,16 @@ import "react-textarea-autosize";
47
47
  import "flagged";
48
48
  import "react-hotkeys-hook";
49
49
  import "sonner";
50
- import "./html-to-json-kGgp07Hv.js";
50
+ import "./html-to-json-Y5M0N8PH.js";
51
51
  import "himalaya";
52
- const D = (t) => {
53
- switch (t.type) {
52
+ const D = (s) => {
53
+ switch (s.type) {
54
54
  case "Image":
55
55
  return /* @__PURE__ */ e.jsx(ce, {});
56
56
  case "Heading":
57
57
  return /* @__PURE__ */ e.jsx(ae, {});
58
58
  case "Text":
59
- return /* @__PURE__ */ e.jsx(v, {});
59
+ return /* @__PURE__ */ e.jsx(w, {});
60
60
  case "Link":
61
61
  return /* @__PURE__ */ e.jsx(re, {});
62
62
  case "Video":
@@ -66,15 +66,15 @@ const D = (t) => {
66
66
  case "Button":
67
67
  return /* @__PURE__ */ e.jsx(B, {});
68
68
  case "CustomHTML":
69
- return /* @__PURE__ */ e.jsx(se, {});
70
- case "Divider":
71
69
  return /* @__PURE__ */ e.jsx(te, {});
70
+ case "Divider":
71
+ return /* @__PURE__ */ e.jsx(se, {});
72
72
  case "Icon":
73
73
  return /* @__PURE__ */ e.jsx(ee, {});
74
74
  case "List":
75
75
  return /* @__PURE__ */ e.jsx(C, {});
76
76
  case "Paragraph":
77
- return /* @__PURE__ */ e.jsx(v, {});
77
+ return /* @__PURE__ */ e.jsx(w, {});
78
78
  case "Row":
79
79
  return /* @__PURE__ */ e.jsx(C, {});
80
80
  case "ListItem":
@@ -112,8 +112,8 @@ const D = (t) => {
112
112
  return /* @__PURE__ */ e.jsx(z, {});
113
113
  }
114
114
  };
115
- function Xe(t = "") {
116
- const s = {
115
+ function Xe(s = "") {
116
+ const t = {
117
117
  xs: "390px",
118
118
  sm: "640px",
119
119
  md: "768px",
@@ -121,60 +121,60 @@ function Xe(t = "") {
121
121
  xl: "1366px",
122
122
  "2xl": "1536px"
123
123
  };
124
- if (new RegExp(/\bsr-only\b/).test(t))
124
+ if (new RegExp(/\bsr-only\b/).test(s))
125
125
  return "Sr Only";
126
- if (new RegExp(/\b(sm|md|lg|xl|2xl):hidden\b/).test(t))
126
+ if (new RegExp(/\b(sm|md|lg|xl|2xl):hidden\b/).test(s))
127
127
  return "Visible on mobile";
128
- if (t.match(/(^| )hidden( |$)/g)) {
128
+ if (s.match(/(^| )hidden( |$)/g)) {
129
129
  const a = new RegExp(
130
130
  // checks if any of the display property is set for any higher media query
131
131
  /\b(sm|md|lg|xl|2xl):(block|grid|flex|inline|inline-grid|inline-flex|inline-block)\b/
132
- ), c = t.match(a);
132
+ ), c = s.match(a);
133
133
  if (y(c, 1))
134
- return `Visible >=${s[y(c, 1)]}`;
134
+ return `Visible >=${t[y(c, 1)]}`;
135
135
  }
136
136
  return "";
137
137
  }
138
- const et = (t) => {
139
- let s = "";
140
- return Object.keys(t).forEach((o) => {
141
- A(t[o], qe) && (s = t[o]);
142
- }), s;
143
- }, tt = (t) => {
138
+ const es = (s) => {
139
+ let t = "";
140
+ return Object.keys(s).forEach((o) => {
141
+ A(s[o], qe) && (t = s[o]);
142
+ }), t;
143
+ }, ss = (s) => {
144
144
  var p;
145
- const [, s] = ye(), [o] = Be(), { isSelected: r } = t, { id: a, data: c } = t.node, x = t.depth * 10, d = (l) => {
146
- l.stopPropagation(), t.onToggle(t.node.id);
147
- }, j = fe(a, t.isOpen, t.onToggle), m = $e(() => {
148
- const l = et(t.node.data);
145
+ const [, t] = ye(), [o] = Be(), { isSelected: r } = s, { id: a, data: c } = s.node, x = s.depth * 10, d = (l) => {
146
+ l.stopPropagation(), s.onToggle(s.node.id);
147
+ }, j = fe(a, s.isOpen, s.onToggle), m = $e(() => {
148
+ const l = es(s.node.data);
149
149
  return Xe(l);
150
- }, [t.node.data]);
150
+ }, [s.node.data]);
151
151
  return (
152
152
  // eslint-disable-next-line jsx-a11y/click-events-have-key-events,jsx-a11y/no-static-element-interactions
153
153
  /* @__PURE__ */ e.jsx(
154
154
  "div",
155
155
  {
156
- onMouseEnter: () => s(a),
156
+ onMouseEnter: () => t(a),
157
157
  className: S(
158
158
  "group flex w-full items-center justify-between space-x-px py-px ",
159
159
  r ? "bg-blue-500 text-white" : "hover:bg-gray-200 dark:hover:bg-gray-800"
160
160
  ),
161
161
  onClick: (l) => {
162
- l.stopPropagation(), !o.includes(a) && t.onSelect(a);
162
+ l.stopPropagation(), !o.includes(a) && s.onSelect(a);
163
163
  },
164
- onContextMenu: () => t.onSelect(a),
164
+ onContextMenu: () => s.onSelect(a),
165
165
  style: { paddingInlineStart: x },
166
166
  ...j,
167
167
  children: /* @__PURE__ */ e.jsxs("div", { className: "flex items-center", children: [
168
168
  /* @__PURE__ */ e.jsx(
169
169
  "div",
170
170
  {
171
- 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" : ""}`,
172
- children: t.node.droppable && /* @__PURE__ */ e.jsx("button", { onClick: d, type: "button", children: /* @__PURE__ */ e.jsx(le, {}) })
171
+ className: `flex h-4 w-4 rotate-0 transform cursor-pointer items-center justify-center text-xs transition-transform duration-100 ${s.isOpen ? "rotate-90" : ""}`,
172
+ children: s.node.droppable && /* @__PURE__ */ e.jsx("button", { onClick: d, type: "button", children: /* @__PURE__ */ e.jsx(le, {}) })
173
173
  }
174
174
  ),
175
175
  /* @__PURE__ */ e.jsxs("button", { type: "button", className: "flex items-center", children: [
176
176
  /* @__PURE__ */ e.jsx("div", { className: "-mt-1 h-3 w-3", children: /* @__PURE__ */ e.jsx(D, { type: c == null ? void 0 : c._type }) }),
177
- /* @__PURE__ */ e.jsx("div", { className: "ml-2 truncate text-[11px]", children: ((p = t.node.data) == null ? void 0 : p._name) || t.node.text }),
177
+ /* @__PURE__ */ e.jsx("div", { className: "ml-2 truncate text-[11px]", children: ((p = s.node.data) == null ? void 0 : p._name) || s.node.text }),
178
178
  m ? /* @__PURE__ */ e.jsxs(
179
179
  "span",
180
180
  {
@@ -191,51 +191,51 @@ const et = (t) => {
191
191
  }
192
192
  )
193
193
  );
194
- }, st = (t) => {
194
+ }, ts = (s) => {
195
195
  var o;
196
- const { item: s } = t.monitorProps;
196
+ const { item: t } = s.monitorProps;
197
197
  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: [
198
- /* @__PURE__ */ e.jsx("div", { className: "", children: /* @__PURE__ */ e.jsx(D, { type: (o = s == null ? void 0 : s.data) == null ? void 0 : o._type }) }),
199
- /* @__PURE__ */ e.jsx("div", { className: "ml-2 truncate text-[11px]", children: s.text })
198
+ /* @__PURE__ */ e.jsx("div", { className: "", children: /* @__PURE__ */ e.jsx(D, { type: (o = t == null ? void 0 : t.data) == null ? void 0 : o._type }) }),
199
+ /* @__PURE__ */ e.jsx("div", { className: "ml-2 truncate text-[11px]", children: t.text })
200
200
  ] });
201
- }, ot = (t) => {
202
- const s = t.depth * 10 + 16;
203
- 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 } });
204
- }, nt = Ke(() => import("./MarkAsGlobalBlock-Czq45Amf.js")), rt = () => {
205
- const [t] = g(), [, s] = Ce();
206
- return /* @__PURE__ */ e.jsxs(i, { className: "flex items-center gap-x-4 text-xs", onClick: () => s(t), children: [
201
+ }, os = (s) => {
202
+ const t = s.depth * 10 + 16;
203
+ return /* @__PURE__ */ e.jsx("div", { className: "absolute right-0 top-0 h-0.5 -translate-y-1/2 transform bg-green-500", style: { left: t } });
204
+ }, ns = Ke(() => import("./MarkAsGlobalBlock-xOHhiMDl.js")), rs = () => {
205
+ const [s] = g(), [, t] = Ce();
206
+ return /* @__PURE__ */ e.jsxs(i, { className: "flex items-center gap-x-4 text-xs", onClick: () => t(s), children: [
207
207
  /* @__PURE__ */ e.jsx(ie, {}),
208
208
  " Cut"
209
209
  ] });
210
- }, at = () => {
211
- const [t] = g(), [, s] = ve();
212
- return /* @__PURE__ */ e.jsxs(i, { className: "flex items-center gap-x-4 text-xs", onClick: () => s(t), children: [
210
+ }, as = () => {
211
+ const [s] = g(), [, t] = we();
212
+ return /* @__PURE__ */ e.jsxs(i, { className: "flex items-center gap-x-4 text-xs", onClick: () => t(s), children: [
213
213
  /* @__PURE__ */ e.jsx(xe, {}),
214
214
  " Copy"
215
215
  ] });
216
- }, ct = () => {
217
- const [t] = g(), s = we(), o = Se();
216
+ }, cs = () => {
217
+ const [s] = g(), t = ve(), o = Se();
218
218
  return /* @__PURE__ */ e.jsxs(
219
219
  i,
220
220
  {
221
221
  disabled: (o == null ? void 0 : o._type) === "Slot",
222
222
  className: "flex items-center gap-x-4 text-xs",
223
- onClick: () => s(t),
223
+ onClick: () => t(s),
224
224
  children: [
225
225
  /* @__PURE__ */ e.jsx(de, {}),
226
226
  " Remove"
227
227
  ]
228
228
  }
229
229
  );
230
- }, lt = ({
231
- id: t = null,
232
- openMarkAsGlobalModal: s
230
+ }, ls = ({
231
+ id: s = null,
232
+ openMarkAsGlobalModal: t
233
233
  }) => {
234
234
  const [o] = g(), r = De(), { pasteBlocks: a, canPaste: c } = Te(), x = Ne("globalBlocksSupport", !1), d = Qe(() => {
235
235
  r(o);
236
236
  }, [o, r]);
237
237
  return /* @__PURE__ */ e.jsxs(Me, { className: "text-xs", children: [
238
- x && /* @__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: [
238
+ x && /* @__PURE__ */ e.jsx(i, { className: "flex items-center gap-x-4 border-b text-xs", onClick: t, children: /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-x-4", children: [
239
239
  /* @__PURE__ */ e.jsx(me, {}),
240
240
  " Mark as global"
241
241
  ] }) }),
@@ -243,13 +243,13 @@ const et = (t) => {
243
243
  /* @__PURE__ */ e.jsx(pe, {}),
244
244
  " Duplicate"
245
245
  ] }),
246
- /* @__PURE__ */ e.jsx(rt, {}),
247
- /* @__PURE__ */ e.jsx(at, {}),
246
+ /* @__PURE__ */ e.jsx(rs, {}),
247
+ /* @__PURE__ */ e.jsx(as, {}),
248
248
  /* @__PURE__ */ e.jsxs(
249
249
  i,
250
250
  {
251
251
  className: "flex items-center gap-x-4 text-xs",
252
- onClick: () => a(t),
252
+ onClick: () => a(s),
253
253
  disabled: !c,
254
254
  children: [
255
255
  /* @__PURE__ */ e.jsx(ue, {}),
@@ -257,43 +257,43 @@ const et = (t) => {
257
257
  ]
258
258
  }
259
259
  ),
260
- /* @__PURE__ */ e.jsx(ct, {})
260
+ /* @__PURE__ */ e.jsx(cs, {})
261
261
  ] });
262
- }, it = ({ children: t, id: s = null }) => {
262
+ }, is = ({ children: s, id: t = null }) => {
263
263
  const [o, r] = Ue(!1);
264
264
  return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
265
- /* @__PURE__ */ e.jsx(Oe, { open: o, onOpenChange: r, children: o && /* @__PURE__ */ e.jsx(Re, { children: /* @__PURE__ */ e.jsx(Ye, { fallback: /* @__PURE__ */ e.jsx("div", { className: "h-96 w-full animate-pulse bg-gray-200" }), children: /* @__PURE__ */ e.jsx(nt, { closeModal: () => r(!1), id: s }) }) }) }),
265
+ /* @__PURE__ */ e.jsx(Oe, { open: o, onOpenChange: r, children: o && /* @__PURE__ */ e.jsx(Re, { children: /* @__PURE__ */ e.jsx(Ye, { fallback: /* @__PURE__ */ e.jsx("div", { className: "h-96 w-full animate-pulse bg-gray-200" }), children: /* @__PURE__ */ e.jsx(ns, { closeModal: () => r(!1), id: t }) }) }) }),
266
266
  /* @__PURE__ */ e.jsxs(_e, { children: [
267
- /* @__PURE__ */ e.jsx(Ae, { children: t }),
268
- /* @__PURE__ */ e.jsx(lt, { id: s, openMarkAsGlobalModal: () => r(!0) })
267
+ /* @__PURE__ */ e.jsx(Ae, { children: s }),
268
+ /* @__PURE__ */ e.jsx(ls, { id: t, openMarkAsGlobalModal: () => r(!0) })
269
269
  ] })
270
270
  ] });
271
271
  };
272
- function xt(t) {
273
- return w(t, (s) => {
274
- const { data: o } = s;
272
+ function xs(s) {
273
+ return v(s, (t) => {
274
+ const { data: o } = t;
275
275
  return {
276
276
  ...o,
277
- _parent: s.parent === 0 ? null : s.parent
277
+ _parent: t.parent === 0 ? null : t.parent
278
278
  };
279
279
  });
280
280
  }
281
- const ls = () => {
282
- const t = Ee(), [s] = He(), [o, r, a] = g(), [, c] = Pe(), { t: x } = ke(), { createSnapshot: d } = Le(), j = We(), m = Je(), [, p] = Ze(ze), l = async (n, u) => {
281
+ const lt = () => {
282
+ const s = Ee(), [t] = He(), [o, r, a] = g(), [, c] = Pe(), { t: x } = ke(), { createSnapshot: d } = Le(), j = We(), m = Je(), [, p] = Ze(ze), l = async (n, u) => {
283
283
  const { dragSource: b, relativeIndex: f, dropTargetId: I, monitor: k } = u;
284
284
  if (b) {
285
285
  d();
286
- const R = xt(n);
287
- s(R);
286
+ const R = xs(n);
287
+ t(R);
288
288
  const _ = k.getItem();
289
289
  r([_.id]);
290
290
  } else
291
291
  await m({ block: k.getItem(), dropTargetId: I, relativeIndex: f }), p(!1);
292
- }, T = w(t, (n) => ({
292
+ }, T = v(s, (n) => ({
293
293
  id: n._id,
294
294
  text: n._type,
295
295
  parent: n._parent || 0,
296
- droppable: !E(H(t, { _parent: n._id })),
296
+ droppable: !E(H(s, { _parent: n._id })),
297
297
  data: n
298
298
  })), N = () => {
299
299
  r([]), c([]);
@@ -321,7 +321,7 @@ const ls = () => {
321
321
  "-mx-1 -mt-1 flex h-full select-none flex-col space-y-1",
322
322
  O ? "bg-green-50/80" : "bg-background"
323
323
  ),
324
- children: P(t) ? /* @__PURE__ */ e.jsxs(
324
+ children: P(s) ? /* @__PURE__ */ e.jsxs(
325
325
  "div",
326
326
  {
327
327
  ref: M,
@@ -338,8 +338,8 @@ const ls = () => {
338
338
  extraAcceptTypes: ["CHAI_BLOCK"],
339
339
  tree: T,
340
340
  rootId: 0,
341
- render: (n, { depth: u, isOpen: b, onToggle: f }) => /* @__PURE__ */ e.jsx(it, { id: n.id, children: /* @__PURE__ */ e.jsx(
342
- tt,
341
+ render: (n, { depth: u, isOpen: b, onToggle: f }) => /* @__PURE__ */ e.jsx(is, { id: n.id, children: /* @__PURE__ */ e.jsx(
342
+ ss,
343
343
  {
344
344
  onSelect: (I) => {
345
345
  c([]), r([I]);
@@ -352,7 +352,7 @@ const ls = () => {
352
352
  toggleIds: a
353
353
  }
354
354
  ) }),
355
- dragPreviewRender: (n) => /* @__PURE__ */ e.jsx(st, { monitorProps: n }),
355
+ dragPreviewRender: (n) => /* @__PURE__ */ e.jsx(ts, { monitorProps: n }),
356
356
  onDrop: l,
357
357
  classes: {
358
358
  root: "h-full pt-2",
@@ -365,12 +365,12 @@ const ls = () => {
365
365
  canDrop: Fe,
366
366
  dropTargetOffset: 2,
367
367
  enableAnimateExpand: !0,
368
- placeholderRender: (n, { depth: u }) => /* @__PURE__ */ e.jsx(ot, { node: n, depth: u })
368
+ placeholderRender: (n, { depth: u }) => /* @__PURE__ */ e.jsx(os, { node: n, depth: u })
369
369
  }
370
370
  ) })
371
371
  }
372
372
  ) });
373
373
  };
374
374
  export {
375
- ls as default
375
+ lt as default
376
376
  };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-WUGKV8jN.cjs"),u=require("./lodash-2us0VT8I.cjs"),t=require("@radix-ui/react-icons"),B=require("react-dnd"),y=require("@minoru/react-dnd-treeview"),N=require("react-i18next"),n=require("./index-d55M5MRz.cjs"),O=require("lucide-react"),R=require("react"),A=require("./MODIFIERS-WFzDQfiT.cjs"),q=require("./utils-37UXq2O5.cjs"),_=require("./index-veRjBw4J.cjs"),P=require("jotai"),H=require("./useAddBlockByDrop-Ckzuvu-s.cjs");require("@radix-ui/react-toggle");require("class-variance-authority");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("flat-to-nested");require("redux-undo");require("@chaibuilder/runtime");require("@react-hookz/web");require("clsx");require("tailwind-merge");require("i18next");require("@floating-ui/react-dom");require("react-textarea-autosize");require("flagged");require("react-hotkeys-hook");require("sonner");require("./html-to-json-aAZkA0f5.cjs");require("himalaya");const C=s=>{switch(s.type){case"Image":return e.jsxRuntimeExports.jsx(t.ImageIcon,{});case"Heading":return e.jsxRuntimeExports.jsx(t.HeadingIcon,{});case"Text":return e.jsxRuntimeExports.jsx(t.TextIcon,{});case"Link":return e.jsxRuntimeExports.jsx(t.Link1Icon,{});case"Video":return e.jsxRuntimeExports.jsx(t.VideoIcon,{});case"RichText":return e.jsxRuntimeExports.jsx(t.CursorTextIcon,{});case"Button":return e.jsxRuntimeExports.jsx(t.ButtonIcon,{});case"CustomHTML":return e.jsxRuntimeExports.jsx(t.CodeIcon,{});case"Divider":return e.jsxRuntimeExports.jsx(t.DividerHorizontalIcon,{});case"Icon":return e.jsxRuntimeExports.jsx(t.SketchLogoIcon,{});case"List":return e.jsxRuntimeExports.jsx(t.RowsIcon,{});case"Paragraph":return e.jsxRuntimeExports.jsx(t.TextIcon,{});case"Row":return e.jsxRuntimeExports.jsx(t.RowsIcon,{});case"ListItem":return e.jsxRuntimeExports.jsx(t.ColumnsIcon,{});case"LineBreak":return e.jsxRuntimeExports.jsx(t.SpaceBetweenVerticallyIcon,{});case"Form":return e.jsxRuntimeExports.jsx(t.GroupIcon,{});case"Checkbox":return e.jsxRuntimeExports.jsx(t.CheckboxIcon,{});case"FormButton":return e.jsxRuntimeExports.jsx(t.ButtonIcon,{});case"Input":case"TextArea":return e.jsxRuntimeExports.jsx(t.InputIcon,{});case"Radio":return e.jsxRuntimeExports.jsx(t.RadiobuttonIcon,{});case"Select":return e.jsxRuntimeExports.jsx(t.DropdownMenuIcon,{});case"Table":return e.jsxRuntimeExports.jsx(t.TableIcon,{});case"TableHead":return e.jsxRuntimeExports.jsx(t.BorderTopIcon,{});case"TableBody":return e.jsxRuntimeExports.jsx(t.BorderAllIcon,{});case"TableRow":return e.jsxRuntimeExports.jsx(t.ViewHorizontalIcon,{});case"TableCell":return e.jsxRuntimeExports.jsx(t.DragHandleHorizontalIcon,{});case"DataProvider":return e.jsxRuntimeExports.jsx(O.DatabaseIcon,{size:16});case"Box":return e.jsxRuntimeExports.jsx(t.BoxIcon,{});default:return e.jsxRuntimeExports.jsx(t.BoxModelIcon,{})}};function L(s=""){const r={xs:"390px",sm:"640px",md:"768px",lg:"1024px",xl:"1366px","2xl":"1536px"};if(new RegExp(/\bsr-only\b/).test(s))return"Sr Only";if(new RegExp(/\b(sm|md|lg|xl|2xl):hidden\b/).test(s))return"Visible on mobile";if(s.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=s.match(c);if(u.nth(l,1))return`Visible >=${r[u.nth(l,1)]}`}return""}const F=s=>{let r="";return Object.keys(s).forEach(o=>{u.startsWith(s[o],A.STYLES_KEY)&&(r=s[o])}),r},V=s=>{var j;const[,r]=n.useHighlightBlockId(),[o]=n.useHiddenBlockIds(),{isSelected:i}=s,{id:c,data:l}=s.node,d=s.depth*10,m=a=>{a.stopPropagation(),s.onToggle(s.node.id)},E=y.useDragOver(c,s.isOpen,s.onToggle),p=R.useMemo(()=>{const a=F(s.node.data);return L(a)},[s.node.data]);return e.jsxRuntimeExports.jsx("div",{onMouseEnter:()=>r(c),className:q.cn$1("group flex w-full items-center justify-between space-x-px py-px ",i?"bg-blue-500 text-white":"hover:bg-gray-200 dark:hover:bg-gray-800"),onClick:a=>{a.stopPropagation(),!o.includes(c)&&s.onSelect(c)},onContextMenu:()=>s.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 ${s.isOpen?"rotate-90":""}`,children:s.node.droppable&&e.jsxRuntimeExports.jsx("button",{onClick:m,type:"button",children:e.jsxRuntimeExports.jsx(t.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:l==null?void 0:l._type})}),e.jsxRuntimeExports.jsx("div",{className:"ml-2 truncate text-[11px]",children:((j=s.node.data)==null?void 0:j._name)||s.node.text}),p?e.jsxRuntimeExports.jsxs("span",{className:"ml-2 flex items-center text-[10px] italic "+(i?"text-gray-200":"text-gray-500"),children:["(",p,")"]}):null]})]})})},$=s=>{var o;const{item:r}=s.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:(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=s=>{const r=s.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=R.lazy(()=>Promise.resolve().then(()=>require("./MarkAsGlobalBlock-LXDkmFUr.cjs"))),K=()=>{const[s]=n.useSelectedBlockIds(),[,r]=n.useCutBlockIds();return e.jsxRuntimeExports.jsxs(n.ContextMenuItem,{className:"flex items-center gap-x-4 text-xs",onClick:()=>r(s),children:[e.jsxRuntimeExports.jsx(t.ScissorsIcon,{})," Cut"]})},Q=()=>{const[s]=n.useSelectedBlockIds(),[,r]=n.useCopyBlockIds();return e.jsxRuntimeExports.jsxs(n.ContextMenuItem,{className:"flex items-center gap-x-4 text-xs",onClick:()=>r(s),children:[e.jsxRuntimeExports.jsx(t.ClipboardIcon,{})," Copy"]})},U=()=>{const[s]=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(s),children:[e.jsxRuntimeExports.jsx(t.TrashIcon,{})," Remove"]})},Y=({id:s=null,openMarkAsGlobalModal:r})=>{const[o]=n.useSelectedBlockIds(),i=n.useDuplicateBlocks(),{pasteBlocks:c,canPaste:l}=n.usePasteBlocks(),d=n.useBuilderProp("globalBlocksSupport",!1),m=R.useCallback(()=>{i(o)},[o,i]);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(t.GlobeIcon,{})," Mark as global"]})}),e.jsxRuntimeExports.jsxs(n.ContextMenuItem,{className:"flex items-center gap-x-4 text-xs",onClick:m,children:[e.jsxRuntimeExports.jsx(t.CopyIcon,{})," Duplicate"]}),e.jsxRuntimeExports.jsx(K,{}),e.jsxRuntimeExports.jsx(Q,{}),e.jsxRuntimeExports.jsxs(n.ContextMenuItem,{className:"flex items-center gap-x-4 text-xs",onClick:()=>c(s),disabled:!l,children:[e.jsxRuntimeExports.jsx(t.ClipboardCopyIcon,{})," Paste"]}),e.jsxRuntimeExports.jsx(U,{})]})},W=({children:s,id:r=null})=>{const[o,i]=R.useState(!1);return e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx(n.Dialog,{open:o,onOpenChange:i,children:o&&e.jsxRuntimeExports.jsx(n.DialogContent,{children:e.jsxRuntimeExports.jsx(R.Suspense,{fallback:e.jsxRuntimeExports.jsx("div",{className:"h-96 w-full animate-pulse bg-gray-200"}),children:e.jsxRuntimeExports.jsx(G,{closeModal:()=>i(!1),id:r})})})}),e.jsxRuntimeExports.jsxs(n.ContextMenu,{children:[e.jsxRuntimeExports.jsx(n.ContextMenuTrigger,{children:s}),e.jsxRuntimeExports.jsx(Y,{id:r,openMarkAsGlobalModal:()=>i(!0)})]})]})};function J(s){return u.map(s,r=>{const{data:o}=r;return{...o,_parent:r.parent===0?null:r.parent}})}const X=()=>{const s=n.useAllBlocks(),[r]=n.useSetAllBlocks(),[o,i,c]=n.useSelectedBlockIds(),[,l]=n.useSelectedStylingBlocks(),{t:d}=N.useTranslation(),{createSnapshot:m}=n.useCanvasHistory(),E=_.useExpandedIds(),p=H.useAddBlockByDrop(),[,j]=P.useAtom(n.addBlocksModalAtom),a=async(x,g)=>{const{dragSource:h,relativeIndex:b,dropTargetId:k,monitor:f}=g;if(h){m();const T=J(x);r(T);const M=f.getItem();i([M.id])}else await p({block:f.getItem(),dropTargetId:k,relativeIndex:b}),j(!1)},v=u.map(s,x=>({id:x._id,text:x._type,parent:x._parent||0,droppable:!u.isUndefined(u.find(s,{_parent:x._id})),data:x})),S=()=>{i([]),l([])},[{isOver:I},w]=B.useDrop(()=>({accept:["CHAI_BLOCK"],collect:x=>({canDrop:x.canDrop(),isOver:x.isOver()}),drop:x=>{(async()=>(await p({block:x,dropTargetId:"",relativeIndex:0}),j(!1)))()}})),{isDragging:D}=B.useDragLayer(x=>({isDragging:x.isDragging()}));return e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:e.jsxRuntimeExports.jsx("div",{onClick:()=>S(),className:q.cn$1("-mx-1 -mt-1 flex h-full select-none flex-col space-y-1",D?"bg-green-50/80":"bg-background"),children:u.isEmpty(s)?e.jsxRuntimeExports.jsxs("div",{ref:w,className:`mx-1 mt-4 max-w-full h-full p-6 text-center text-sm text-gray-400 ${I?"bg-blue-200":""}`,children:[I?e.jsxRuntimeExports.jsx(t.DoubleArrowDownIcon,{className:"mx-auto h-12 w-12 animate-bounce"}):e.jsxRuntimeExports.jsx(t.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.jsx(n.ScrollArea,{id:"layers-view",className:"no-scrollbar h-full overflow-y-auto p-1",children:e.jsxRuntimeExports.jsx(y.Tree,{initialOpen:E,extraAcceptTypes:["CHAI_BLOCK"],tree:v,rootId:0,render:(x,{depth:g,isOpen:h,onToggle:b})=>e.jsxRuntimeExports.jsx(W,{id:x.id,children:e.jsxRuntimeExports.jsx(V,{onSelect:k=>{l([]),i([k])},isSelected:u.includes(o,x.id),node:x,depth:g,isOpen:h,onToggle:b,toggleIds:c})}),dragPreviewRender:x=>e.jsxRuntimeExports.jsx($,{monitorProps:x}),onDrop:a,classes:{root:"h-full pt-2",draggingSource:"opacity-30",dropTarget:"bg-green-100",placeholder:"relative"},sort:!1,insertDroppableFirst:!1,canDrop:n.canDropBlock,dropTargetOffset:2,enableAnimateExpand:!0,placeholderRender:(x,{depth:g})=>e.jsxRuntimeExports.jsx(z,{node:x,depth:g})})})})})};exports.default=X;
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-WUGKV8jN.cjs"),n=require("@radix-ui/react-icons"),o=require("react"),s=require("./index-d55M5MRz.cjs"),c=require("./lodash-2us0VT8I.cjs");require("./MODIFIERS-WFzDQfiT.cjs");require("@radix-ui/react-toggle");require("class-variance-authority");require("./utils-37UXq2O5.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("@react-hookz/web");require("react-i18next");const x=({id:t=null,closeModal:i})=>{const l=s.useMarkAsGlobalBlock(),[r,u]=o.useState("");return e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx("h1",{className:"text-lg font-bold",children:"Mark as Global"}),e.jsxRuntimeExports.jsxs("div",{className:"py-2 text-sm",children:["Note: Global blocks are single instances. Editing global blocks will be reflected on all pages using these blocks. ",e.jsxRuntimeExports.jsx("br",{}),e.jsxRuntimeExports.jsxs("ul",{className:"mt-4 list-inside list-disc space-y-1",children:[e.jsxRuntimeExports.jsxs("li",{children:["Global blocks are indicated with ",e.jsxRuntimeExports.jsx(n.GlobeIcon,{className:"inline"})," icon in left sidebar"]}),e.jsxRuntimeExports.jsx("li",{children:'Global blocks are available under "Global" category'})]})]}),e.jsxRuntimeExports.jsxs("div",{className:"my-4",children:[e.jsxRuntimeExports.jsx("label",{className:"block text-sm font-medium text-gray-400",children:"Enter global block name"}),e.jsxRuntimeExports.jsx("input",{placeholder:"Eg: Header, Footer ",className:"mt-2 w-full",value:r,onChange:a=>u(a.target.value)})]}),e.jsxRuntimeExports.jsxs("div",{className:"flex items-center justify-end gap-x-4",children:[e.jsxRuntimeExports.jsx(s.Button,{onClick:()=>{l(t,c.capitalize(r)),i()},disabled:r.length<=2,variant:"default",children:"Mark as Global"}),e.jsxRuntimeExports.jsx(s.Button,{variant:"outline",onClick:i,children:"Cancel"})]})]})};exports.default=x;
@@ -1,12 +1,12 @@
1
1
  import { j as t } from "./jsx-runtime-NV737rRe.js";
2
2
  import { GlobeIcon as m } from "@radix-ui/react-icons";
3
3
  import { useState as n } from "react";
4
- import { $ as p, B as o } from "./index-89A3jPHh.js";
5
- import { capitalize as c } from "lodash";
4
+ import { $ as p, B as o } from "./index-0OqmBgqo.js";
5
+ import { u as c } from "./lodash-3gkdNK5u.js";
6
6
  import "./MODIFIERS-MLfpKQY1.js";
7
7
  import "@radix-ui/react-toggle";
8
8
  import "class-variance-authority";
9
- import "./utils-zWMk4dB2.js";
9
+ import "./utils-XsPKXMVo.js";
10
10
  import "clsx";
11
11
  import "tailwind-merge";
12
12
  import "@radix-ui/react-switch";
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-WUGKV8jN.cjs"),u=require("react"),i=require("./lodash-2us0VT8I.cjs"),s=require("./index-veRjBw4J.cjs");require("./MODIFIERS-WFzDQfiT.cjs");require("i18next");require("react-i18next");require("./index-d55M5MRz.cjs");require("@radix-ui/react-toggle");require("class-variance-authority");require("./utils-37UXq2O5.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-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("jotai");require("flat-to-nested");require("redux-undo");require("@chaibuilder/runtime");require("@react-hookz/web");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-aAZkA0f5.cjs");require("himalaya");require("lucide-react");const a=u.lazy(()=>Promise.resolve().then(()=>require("./add-page-modal-zOdAgfvh.cjs"))),x=u.lazy(()=>Promise.resolve().then(()=>require("./page-viewer-LvBMrQas.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,14 +1,14 @@
1
1
  import { j as t } from "./jsx-runtime-NV737rRe.js";
2
2
  import i, { Suspense as s } from "react";
3
- import { sortBy as a, filter as d, get as n } from "lodash";
4
- import { a as l, b as c } from "./index-Q5q5Y_8a.js";
3
+ import { q as a, b as d, g as n } from "./lodash-3gkdNK5u.js";
4
+ import { a as l, b as c } from "./index-4fMl4eN2.js";
5
5
  import "./MODIFIERS-MLfpKQY1.js";
6
6
  import "i18next";
7
7
  import "react-i18next";
8
- import "./index-89A3jPHh.js";
8
+ import "./index-0OqmBgqo.js";
9
9
  import "@radix-ui/react-toggle";
10
10
  import "class-variance-authority";
11
- import "./utils-zWMk4dB2.js";
11
+ import "./utils-XsPKXMVo.js";
12
12
  import "clsx";
13
13
  import "tailwind-merge";
14
14
  import "@radix-ui/react-switch";
@@ -45,10 +45,10 @@ import "react-dnd";
45
45
  import "@minoru/react-dnd-treeview";
46
46
  import "react-hotkeys-hook";
47
47
  import "sonner";
48
- import "./html-to-json-kGgp07Hv.js";
48
+ import "./html-to-json-Y5M0N8PH.js";
49
49
  import "himalaya";
50
50
  import "lucide-react";
51
- const x = i.lazy(() => import("./add-page-modal-TXREEFPZ.js")), g = i.lazy(() => import("./page-viewer-LPx-OTCC.js")), lt = () => {
51
+ const x = i.lazy(() => import("./add-page-modal-AJorVipD.js")), g = i.lazy(() => import("./page-viewer-QuVbTBKO.js")), lt = () => {
52
52
  const { data: o = [], isLoading: m } = l(), { data: r } = c(), p = a(d(o, { type: "STATIC" }), (e) => n(e, "uuid") === (r == null ? void 0 : r.homepage) ? 0 : 1);
53
53
  return /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
54
54
  /* @__PURE__ */ t.jsxs("div", { className: "flex items-center justify-between rounded-md bg-background/30 p-1", children: [
@@ -1,12 +1,12 @@
1
1
  import { j as t } from "./jsx-runtime-NV737rRe.js";
2
- import m, { useRef as x, useEffect as a, Suspense as p } from "react";
3
- import { isEqual as b, isEmpty as j } from "lodash";
4
- import { bh as h, bi as n, bj as l, bk as c } from "./index-89A3jPHh.js";
5
- import { c as f, b as g } from "./index-Q5q5Y_8a.js";
2
+ import a, { useRef as x, useEffect as m, Suspense as p } from "react";
3
+ import { X as b, a as j } from "./lodash-3gkdNK5u.js";
4
+ import { bh as h, bi as n, bj as l, bk as c } from "./index-0OqmBgqo.js";
5
+ import { c as f, b as g } from "./index-4fMl4eN2.js";
6
6
  import "./MODIFIERS-MLfpKQY1.js";
7
7
  import "@radix-ui/react-toggle";
8
8
  import "class-variance-authority";
9
- import "./utils-zWMk4dB2.js";
9
+ import "./utils-XsPKXMVo.js";
10
10
  import "clsx";
11
11
  import "tailwind-merge";
12
12
  import "@radix-ui/react-switch";
@@ -45,25 +45,25 @@ import "react-dnd";
45
45
  import "@minoru/react-dnd-treeview";
46
46
  import "react-hotkeys-hook";
47
47
  import "sonner";
48
- import "./html-to-json-kGgp07Hv.js";
48
+ import "./html-to-json-Y5M0N8PH.js";
49
49
  import "himalaya";
50
50
  import "lucide-react";
51
- const N = m.lazy(() => import("./project-general-setting-sSpFUD_Y.js")), S = m.lazy(() => import("./project-seo-setting-CGVegBtM.js")), d = /* @__PURE__ */ t.jsx("div", { className: "px-3", children: /* @__PURE__ */ t.jsx("div", { className: "h-52 w-full animate-pulse rounded-md bg-gray-100" }) }), u = (e) => e && j(e.seoData) ? {
51
+ const N = a.lazy(() => import("./project-general-setting-6Nsq4-2Z.js")), S = a.lazy(() => import("./project-seo-setting-EhqUcTKy.js")), d = /* @__PURE__ */ t.jsx("div", { className: "px-3", children: /* @__PURE__ */ t.jsx("div", { className: "h-52 w-full animate-pulse rounded-md bg-gray-100" }) }), u = (e) => e && j(e.seoData) ? {
52
52
  ...e,
53
53
  seoData: { title: "", description: "", image: "" }
54
54
  } : e;
55
55
  function ft() {
56
- const e = f(), { data: s } = g(), [r, i] = m.useState(
56
+ const e = f(), { data: s } = g(), [r, i] = a.useState(
57
57
  u(s || {})
58
58
  ), o = x(r);
59
- return a(
59
+ return m(
60
60
  () => () => {
61
61
  b(s, o.current) || e.mutate(o.current, {
62
62
  onSuccess: () => i(o.current)
63
63
  });
64
64
  },
65
65
  [o]
66
- ), a(() => {
66
+ ), m(() => {
67
67
  o.current = r;
68
68
  }, [r]), /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
69
69
  /* @__PURE__ */ t.jsx("div", { className: "flex items-center justify-between rounded-md bg-background/30 p-1", children: /* @__PURE__ */ t.jsx("h1", { className: "px-1 font-semibold", children: "Website Settings" }) }),
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-WUGKV8jN.cjs"),r=require("react"),x=require("./lodash-2us0VT8I.cjs"),s=require("./index-d55M5MRz.cjs"),a=require("./index-veRjBw4J.cjs");require("./MODIFIERS-WFzDQfiT.cjs");require("@radix-ui/react-toggle");require("class-variance-authority");require("./utils-37UXq2O5.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-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("jotai");require("flat-to-nested");require("redux-undo");require("@chaibuilder/runtime");require("@react-hookz/web");require("react-i18next");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-aAZkA0f5.cjs");require("himalaya");require("lucide-react");const d=r.lazy(()=>Promise.resolve().then(()=>require("./project-general-setting-pSrUGR7K.cjs"))),m=r.lazy(()=>Promise.resolve().then(()=>require("./project-seo-setting-N0OnBCvh.cjs"))),c=e.jsxRuntimeExports.jsx("div",{className:"px-3",children:e.jsxRuntimeExports.jsx("div",{className:"h-52 w-full animate-pulse rounded-md bg-gray-100"})}),l=t=>t&&x.isEmpty(t.seoData)?{...t,seoData:{title:"",description:"",image:""}}:t;function q(){const t=a.useUpdateProject(),{data:n}=a.useProject(),[i,o]=r.useState(l(n||{})),u=r.useRef(i);return r.useEffect(()=>()=>{x.isEqual(n,u.current)||t.mutate(u.current,{onSuccess:()=>o(u.current)})},[u]),r.useEffect(()=>{u.current=i},[i]),e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx("div",{className:"flex items-center justify-between rounded-md bg-background/30 p-1",children:e.jsxRuntimeExports.jsx("h1",{className:"px-1 font-semibold",children:"Website Settings"})}),e.jsxRuntimeExports.jsx("hr",{className:"-mx-1"}),e.jsxRuntimeExports.jsx("div",{className:"-mx-1",children:e.jsxRuntimeExports.jsxs(s.Accordion,{type:"single",className:"w-full",defaultValue:"GENERAL",children:[e.jsxRuntimeExports.jsxs(s.AccordionItem,{value:"GENERAL",className:"border-b-2 border-slate-100 dark:border-slate-800",children:[e.jsxRuntimeExports.jsx(s.AccordionTrigger,{className:"bg-slate-200 px-2.5 py-1.5 font-medium hover:bg-slate-100 hover:no-underline dark:bg-slate-900 dark:hover:bg-slate-800",children:"General Settings"}),e.jsxRuntimeExports.jsx(s.AccordionContent,{className:"px-2 pt-4 text-sm",children:e.jsxRuntimeExports.jsx(r.Suspense,{fallback:c,children:e.jsxRuntimeExports.jsx(d,{_projectData:i,seany:o})})})]}),e.jsxRuntimeExports.jsxs(s.AccordionItem,{value:"SEO",className:"border-b-2 border-slate-100 dark:border-slate-800",children:[e.jsxRuntimeExports.jsx(s.AccordionTrigger,{className:"bg-slate-200 px-2.5 py-1.5 font-medium hover:bg-slate-100 hover:no-underline dark:bg-slate-900 dark:hover:bg-slate-800",children:"SEO Settings"}),e.jsxRuntimeExports.jsx(s.AccordionContent,{className:"px-1 pt-4 text-sm",children:e.jsxRuntimeExports.jsx(r.Suspense,{fallback:c,children:e.jsxRuntimeExports.jsx(m,{_projectData:i,seany:o})})})]})]})})]})}exports.default=q;