@chaibuilder/sdk 1.2.15 → 1.2.17

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 (109) hide show
  1. package/README.md +6 -4
  2. package/dist/AddBlocks--SllKzEG.js +224 -0
  3. package/dist/AddBlocks-7TF41ISQ.cjs +1 -0
  4. package/dist/{BrandingOptions-t_MjeHSM.js → BrandingOptions-IqtZrxqX.js} +14 -15
  5. package/dist/BrandingOptions-uKE1vuWd.cjs +1 -0
  6. package/dist/{CanvasArea-TR5t1xxh.js → CanvasArea-T1XNnB7d.js} +89 -95
  7. package/dist/{CanvasArea-SBeW-Kdq.cjs → CanvasArea-iLUw-tom.cjs} +3 -3
  8. package/dist/{Class-17XFhL48.js → Class-3k8xjeiM.js} +1 -1
  9. package/dist/{Class-5ARpH_Tu.cjs → Class-MmCxz2Ay.cjs} +1 -1
  10. package/dist/CurrentPage-N5hSL1xB.cjs +1 -0
  11. package/dist/{CurrentPage-JUlhyVbI.js → CurrentPage-TCduhO-X.js} +16 -16
  12. package/dist/MODIFIERS-9EwxLM8V.cjs +1 -0
  13. package/dist/{MODIFIERS-RiXS5Mn1.js → MODIFIERS-WQdaNvb8.js} +5 -4
  14. package/dist/{Layers-Dav1kBNN.js → Outline-3IPrK7F-.js} +153 -145
  15. package/dist/Outline-g4TXJ-hK.cjs +1 -0
  16. package/dist/{PagesPanel--feFCDeH.js → PagesPanel-7goyNL8t.js} +10 -10
  17. package/dist/PagesPanel-qI3sijis.cjs +1 -0
  18. package/dist/{ProjectPanel--Vq6HSMl.js → ProjectPanel-CdPFwsXg.js} +8 -8
  19. package/dist/ProjectPanel-bMllQ4_a.cjs +1 -0
  20. package/dist/Settings-8f4ivm4-.cjs +1 -0
  21. package/dist/{Settings-DjE6HR2E.js → Settings-pva9XRUC.js} +293 -293
  22. package/dist/SidePanels-7HqZM4-j.cjs +1 -0
  23. package/dist/SidePanels-u5QXQrWL.js +389 -0
  24. package/dist/Topbar-S3zgo3N8.js +129 -0
  25. package/dist/Topbar-poeqjjZb.cjs +1 -0
  26. package/dist/{UnsplashImages-ppQXZ28F.js → UnsplashImages-132gZ842.js} +13 -13
  27. package/dist/{UnsplashImages-SrxA-yNu.cjs → UnsplashImages-BOypn-e5.cjs} +1 -1
  28. package/dist/UploadImages-giiNNHKq.cjs +1 -0
  29. package/dist/{UploadImages-IKR4oX2k.js → UploadImages-tr54Ik1I.js} +35 -31
  30. package/dist/{add-page-modal-nZJaunuz.js → add-page-modal-AsP5g0Fp.js} +13 -12
  31. package/dist/add-page-modal-ajpd-Gmw.cjs +1 -0
  32. package/dist/{confirm-alert-uV_PtYc3.cjs → confirm-alert-bw0VBgoG.cjs} +1 -1
  33. package/dist/{confirm-alert-QKtbNbWz.js → confirm-alert-dYoU1ln_.js} +5 -5
  34. package/dist/controls-Dy1qa8Dc.cjs +1 -0
  35. package/dist/{empty-slot-5FRrRq1E.js → controls-XPXGHKht.js} +50 -61
  36. package/dist/core.cjs +1 -1
  37. package/dist/core.d.ts +16 -1
  38. package/dist/core.js +47 -53
  39. package/dist/{defaultTheme-IH19g4fv.cjs → defaultTheme-1XwPZT2b.cjs} +1 -1
  40. package/dist/{defaultTheme-YY8mlQS3.js → defaultTheme-s0cpA5Oy.js} +1 -1
  41. package/dist/delete-page-modal-H4JOWYZe.cjs +1 -0
  42. package/dist/{delete-page-modal-pN5cFz-m.js → delete-page-modal-_Hy6ls6b.js} +12 -12
  43. package/dist/email-blocks.cjs +1 -1
  44. package/dist/email-blocks.js +11 -10
  45. package/dist/email.cjs +1 -1
  46. package/dist/email.d.ts +13 -0
  47. package/dist/email.js +7 -12
  48. package/dist/empty-slot-ZBlsQi6m.js +15 -0
  49. package/dist/empty-slot-nzYOgZuS.cjs +1 -0
  50. package/dist/{form-faX0Yn4Q.js → form-f13cs-An.js} +1 -1
  51. package/dist/{form-KkP1F7h1.cjs → form-jzX2YXUO.cjs} +1 -1
  52. package/dist/{html-to-json-57841sEK.js → html-to-json-C5sExaSD.js} +1 -1
  53. package/dist/{html-to-json-2PeOCVey.cjs → html-to-json-FGufPv9R.cjs} +1 -1
  54. package/dist/index-0JU8vPT_.cjs +206 -0
  55. package/dist/index-4xyhDki2.cjs +1 -0
  56. package/dist/index-MQH3blB-.cjs +1 -0
  57. package/dist/{index-QGA4ayU7.js → index-MaXiXghQ.js} +246 -246
  58. package/dist/index-YpnaudSM.js +63 -0
  59. package/dist/index-ecnGWzh9.cjs +1 -0
  60. package/dist/{index-nrRnwUaC.js → index-eyVVbA05.js} +22843 -25118
  61. package/dist/index-ugsWasKp.js +2202 -0
  62. package/dist/lib.cjs +1 -1
  63. package/dist/lib.js +5 -5
  64. package/dist/{page-viewer-U7o88VvR.js → page-viewer-P5Im9RfR.js} +11 -11
  65. package/dist/page-viewer-Xj9v8mji.cjs +1 -0
  66. package/dist/project-general-setting--5DT1RoW.cjs +1 -0
  67. package/dist/{project-general-setting-h0TeKYRf.js → project-general-setting-R3pVVXmY.js} +11 -10
  68. package/dist/project-seo-setting-3DzzF83_.cjs +1 -0
  69. package/dist/{project-seo-setting-Sl6AE-Q7.js → project-seo-setting-pGpm3-6U.js} +7 -7
  70. package/dist/render.cjs +1 -1
  71. package/dist/render.js +2 -2
  72. package/dist/{single-page-detail-a8zY-XHs.js → single-page-detail-m-THVQnz.js} +43 -42
  73. package/dist/single-page-detail-nJzGUDym.cjs +1 -0
  74. package/dist/studio.cjs +1 -1
  75. package/dist/studio.d.ts +13 -0
  76. package/dist/studio.js +7 -7
  77. package/dist/ui.cjs +1 -1
  78. package/dist/ui.d.ts +4 -4
  79. package/dist/ui.js +50 -50
  80. package/dist/useAddBlockByDrop-6qaL4Ufz.cjs +1 -0
  81. package/dist/useAddBlockByDrop-vGme3brY.js +20 -0
  82. package/dist/web-blocks.cjs +1 -1
  83. package/dist/web-blocks.js +4 -3
  84. package/package.json +1 -1
  85. package/dist/AddBlocks-IE14csoo.js +0 -224
  86. package/dist/AddBlocks-OpGQyVQZ.cjs +0 -1
  87. package/dist/BrandingOptions-tBWzqas5.cjs +0 -1
  88. package/dist/CurrentPage--ag-4O2R.cjs +0 -1
  89. package/dist/Layers-05Ut4xZA.cjs +0 -1
  90. package/dist/MODIFIERS-2FeVfZQ9.cjs +0 -1
  91. package/dist/PagesPanel-TLVCJtcF.cjs +0 -1
  92. package/dist/ProjectPanel-Q8sNFs1f.cjs +0 -1
  93. package/dist/Settings-9iryF0yE.cjs +0 -1
  94. package/dist/SidePanels-4zpCzCM6.js +0 -352
  95. package/dist/SidePanels-LVED6uuT.cjs +0 -1
  96. package/dist/Topbar-iH2L4pe0.cjs +0 -1
  97. package/dist/Topbar-ryFhl-PC.js +0 -114
  98. package/dist/UploadImages-VBiO6lqp.cjs +0 -1
  99. package/dist/add-page-modal-KixvLXAG.cjs +0 -1
  100. package/dist/delete-page-modal-6GxLQkEk.cjs +0 -1
  101. package/dist/empty-slot-2LSrWJaY.cjs +0 -1
  102. package/dist/index-ERorPL9q.cjs +0 -1
  103. package/dist/index-xJ8LmB04.cjs +0 -206
  104. package/dist/page-viewer-Nn__90Uo.cjs +0 -1
  105. package/dist/project-general-setting-C98_GooL.cjs +0 -1
  106. package/dist/project-seo-setting-8oJUrOqk.cjs +0 -1
  107. package/dist/single-page-detail-RYI1ukX6.cjs +0 -1
  108. package/dist/useAddBlockByDrop-LBgi6GL7.cjs +0 -1
  109. package/dist/useAddBlockByDrop-Y-g4O8UC.js +0 -20
@@ -1,16 +1,16 @@
1
1
  import { j as e } from "./jsx-runtime-WbnYoNE9.js";
2
- import { nth as y, startsWith as M, map as v, isUndefined as H, find as A, isEmpty as L, includes as P } from "lodash-es";
3
- import { BoxModelIcon as V, BoxIcon as F, DragHandleHorizontalIcon as z, ViewHorizontalIcon as K, BorderAllIcon as $, BorderTopIcon as Q, TableIcon as U, DropdownMenuIcon as q, RadiobuttonIcon as W, InputIcon as Y, ButtonIcon as k, CheckboxIcon as G, GroupIcon as X, SpaceBetweenVerticallyIcon as J, ColumnsIcon as Z, RowsIcon as B, TextIcon as w, SketchLogoIcon as ee, DividerHorizontalIcon as te, CodeIcon as se, CursorTextIcon as oe, VideoIcon as re, Link1Icon as ne, HeadingIcon as ae, ImageIcon as ce, TriangleRightIcon as ie, TrashIcon as le, CopyIcon as xe, DoubleArrowDownIcon as de, StackIcon as me } from "@radix-ui/react-icons";
4
- import { useDrop as pe, useDragLayer as ue } from "react-dnd";
5
- import { useDragOver as ge, Tree as je } from "@minoru/react-dnd-treeview";
6
- import { useTranslation as he } from "react-i18next";
7
- import { X as be, W as Ie, j as I, k as fe, a0 as C, bp as T, aQ as ye, l as ke, bq as Be, aP as we, br as ve, bs as Ce, s as Te, aK as De, ac as Se, bt as Ne, bf as Oe, bu as Re } from "./index-QGA4ayU7.js";
8
- import { DatabaseIcon as _e } from "lucide-react";
9
- import { useMemo as Ee, useCallback as Me } from "react";
10
- import { a as He } from "./MODIFIERS-RiXS5Mn1.js";
11
- import { c as D } from "./Functions-7jnEwJyw.js";
12
- import { f as Ae } from "./index-nrRnwUaC.js";
13
- import { u as Le } from "./useAddBlockByDrop-Y-g4O8UC.js";
2
+ import { nth as k, startsWith as _, map as C, isUndefined as H, find as A, isEmpty as L, includes as P } from "lodash-es";
3
+ import { BoxModelIcon as V, BoxIcon as F, DragHandleHorizontalIcon as z, ViewHorizontalIcon as $, BorderAllIcon as q, BorderTopIcon as K, TableIcon as U, DropdownMenuIcon as Y, RadiobuttonIcon as Q, InputIcon as G, ButtonIcon as v, CheckboxIcon as W, GroupIcon as X, SpaceBetweenVerticallyIcon as J, ColumnsIcon as Z, RowsIcon as B, TextIcon as w, SketchLogoIcon as ee, DividerHorizontalIcon as te, CodeIcon as se, CursorTextIcon as re, VideoIcon as ne, Link1Icon as oe, HeadingIcon as ae, ImageIcon as ce, TriangleRightIcon as ie, TrashIcon as le, CopyIcon as xe, DoubleArrowDownIcon as de, StackIcon as me } from "@radix-ui/react-icons";
4
+ import { useDrop as ue, useDragLayer as pe } from "react-dnd";
5
+ import { useDragOver as ge, Tree as he } from "@minoru/react-dnd-treeview";
6
+ import { useTranslation as je } from "react-i18next";
7
+ import { Y as be, X as Ie, h as fe, ap as ye, aq as ke, ar as ve, r as f, s as Be, a1 as T, bq as D, aS as we, t as Ce, br as Te, aR as De, bs as Se, bt as Ne, E as Oe, aM as Re, ac as Me, bu as Ee, bg as _e, bv as He } from "./index-MaXiXghQ.js";
8
+ import { DatabaseIcon as Ae } from "lucide-react";
9
+ import { useMemo as Le, useCallback as Pe } from "react";
10
+ import { a as Ve } from "./MODIFIERS-WQdaNvb8.js";
11
+ import { c as S } from "./Functions-7jnEwJyw.js";
12
+ import { a as Fe } from "./index-eyVVbA05.js";
13
+ import { u as ze } from "./useAddBlockByDrop-vGme3brY.js";
14
14
  import "./_commonjsHelpers-UyOWmZb0.js";
15
15
  import "@chaibuilder/runtime";
16
16
  import "jotai";
@@ -18,7 +18,7 @@ import "flat-to-nested";
18
18
  import "@react-hookz/web";
19
19
  import "@radix-ui/react-toggle";
20
20
  import "class-variance-authority";
21
- import "./Class-17XFhL48.js";
21
+ import "./Class-3k8xjeiM.js";
22
22
  import "clsx";
23
23
  import "tailwind-merge";
24
24
  import "@radix-ui/react-switch";
@@ -47,12 +47,7 @@ import "@floating-ui/react-dom";
47
47
  import "react-textarea-autosize";
48
48
  import "flagged";
49
49
  import "react-hotkeys-hook";
50
- import "sonner";
51
- import "./html-to-json-57841sEK.js";
52
- import "himalaya";
53
- import "./web-blocks.js";
54
- import "./empty-slot-5FRrRq1E.js";
55
- const S = (t) => {
50
+ const N = (t) => {
56
51
  switch (t.type) {
57
52
  case "Image":
58
53
  return /* @__PURE__ */ e.jsx(ce, {});
@@ -61,13 +56,13 @@ const S = (t) => {
61
56
  case "Text":
62
57
  return /* @__PURE__ */ e.jsx(w, {});
63
58
  case "Link":
64
- return /* @__PURE__ */ e.jsx(ne, {});
59
+ return /* @__PURE__ */ e.jsx(oe, {});
65
60
  case "Video":
66
- return /* @__PURE__ */ e.jsx(re, {});
61
+ return /* @__PURE__ */ e.jsx(ne, {});
67
62
  case "RichText":
68
- return /* @__PURE__ */ e.jsx(oe, {});
63
+ return /* @__PURE__ */ e.jsx(re, {});
69
64
  case "Button":
70
- return /* @__PURE__ */ e.jsx(k, {});
65
+ return /* @__PURE__ */ e.jsx(v, {});
71
66
  case "CustomHTML":
72
67
  return /* @__PURE__ */ e.jsx(se, {});
73
68
  case "Divider":
@@ -87,35 +82,35 @@ const S = (t) => {
87
82
  case "Form":
88
83
  return /* @__PURE__ */ e.jsx(X, {});
89
84
  case "Checkbox":
90
- return /* @__PURE__ */ e.jsx(G, {});
85
+ return /* @__PURE__ */ e.jsx(W, {});
91
86
  case "FormButton":
92
- return /* @__PURE__ */ e.jsx(k, {});
87
+ return /* @__PURE__ */ e.jsx(v, {});
93
88
  case "Input":
94
89
  case "TextArea":
95
- return /* @__PURE__ */ e.jsx(Y, {});
90
+ return /* @__PURE__ */ e.jsx(G, {});
96
91
  case "Radio":
97
- return /* @__PURE__ */ e.jsx(W, {});
92
+ return /* @__PURE__ */ e.jsx(Q, {});
98
93
  case "Select":
99
- return /* @__PURE__ */ e.jsx(q, {});
94
+ return /* @__PURE__ */ e.jsx(Y, {});
100
95
  case "Table":
101
96
  return /* @__PURE__ */ e.jsx(U, {});
102
97
  case "TableHead":
103
- return /* @__PURE__ */ e.jsx(Q, {});
98
+ return /* @__PURE__ */ e.jsx(K, {});
104
99
  case "TableBody":
105
- return /* @__PURE__ */ e.jsx($, {});
100
+ return /* @__PURE__ */ e.jsx(q, {});
106
101
  case "TableRow":
107
- return /* @__PURE__ */ e.jsx(K, {});
102
+ return /* @__PURE__ */ e.jsx($, {});
108
103
  case "TableCell":
109
104
  return /* @__PURE__ */ e.jsx(z, {});
110
105
  case "DataProvider":
111
- return /* @__PURE__ */ e.jsx(_e, { size: 16 });
106
+ return /* @__PURE__ */ e.jsx(Ae, { size: 16 });
112
107
  case "Box":
113
108
  return /* @__PURE__ */ e.jsx(F, {});
114
109
  default:
115
110
  return /* @__PURE__ */ e.jsx(V, {});
116
111
  }
117
112
  };
118
- function Pe(t = "") {
113
+ function $e(t = "") {
119
114
  const s = {
120
115
  xs: "390px",
121
116
  sm: "640px",
@@ -129,87 +124,100 @@ function Pe(t = "") {
129
124
  if (new RegExp(/\b(sm|md|lg|xl|2xl):hidden\b/).test(t))
130
125
  return "Visible on mobile";
131
126
  if (t.match(/(^| )hidden( |$)/g)) {
132
- const a = new RegExp(
127
+ const i = new RegExp(
133
128
  // checks if any of the display property is set for any higher media query
134
129
  /\b(sm|md|lg|xl|2xl):(block|grid|flex|inline|inline-grid|inline-flex|inline-block)\b/
135
- ), c = t.match(a);
136
- if (y(c, 1))
137
- return `Visible >=${s[y(c, 1)]}`;
130
+ ), o = t.match(i);
131
+ if (k(o, 1))
132
+ return `Visible >=${s[k(o, 1)]}`;
138
133
  }
139
134
  return "";
140
135
  }
141
- const Ve = (t) => {
136
+ const qe = (t) => {
142
137
  let s = "";
143
- return Object.keys(t).forEach((r) => {
144
- M(t[r], He) && (s = t[r]);
138
+ return Object.keys(t).forEach((n) => {
139
+ _(t[n], Ve) && (s = t[n]);
145
140
  }), s;
146
- }, Fe = (t) => {
147
- var m;
148
- const [, s] = be(), [r] = Ie(), { isSelected: n } = t, { id: a, data: c } = t.node, p = t.depth * 10, u = (i) => {
149
- i.stopPropagation(), t.onToggle(t.node.id);
150
- }, x = ge(a, t.isOpen, t.onToggle), d = Ee(() => {
151
- const i = Ve(t.node.data);
152
- return Pe(i);
141
+ }, Ke = (t) => {
142
+ var u;
143
+ const [, s] = be(), [n] = Ie(), c = fe("outlineMenuItems", []), { isSelected: i } = t, { id: o, data: l } = t.node, p = t.depth * 10, d = (a) => {
144
+ a.stopPropagation(), t.onToggle(t.node.id);
145
+ }, g = ge(o, t.isOpen, t.onToggle), m = Le(() => {
146
+ const a = qe(t.node.data);
147
+ return $e(a);
153
148
  }, [t.node.data]);
154
149
  return (
155
150
  // eslint-disable-next-line jsx-a11y/click-events-have-key-events,jsx-a11y/no-static-element-interactions
156
151
  /* @__PURE__ */ e.jsx(
157
152
  "div",
158
153
  {
159
- onMouseEnter: () => s(a),
160
- className: D(
154
+ onMouseEnter: () => s(o),
155
+ className: S(
161
156
  "group flex w-full items-center justify-between space-x-px py-px",
162
- n ? "bg-blue-500 text-white" : "text-gray-600 hover:bg-gray-200 dark:hover:bg-gray-800"
157
+ i ? "bg-blue-500 text-white" : "text-gray-600 hover:bg-gray-200 dark:hover:bg-gray-800"
163
158
  ),
164
- onClick: (i) => {
165
- i.stopPropagation(), !r.includes(a) && t.onSelect(a);
159
+ onClick: (a) => {
160
+ a.stopPropagation(), !n.includes(o) && t.onSelect(o);
166
161
  },
167
- onContextMenu: () => t.onSelect(a),
162
+ onContextMenu: () => t.onSelect(o),
168
163
  style: { paddingInlineStart: p },
169
- ...x,
170
- children: /* @__PURE__ */ e.jsxs("div", { className: "flex items-center", children: [
171
- /* @__PURE__ */ e.jsx(
172
- "div",
173
- {
174
- className: `flex h-4 w-4 rotate-0 transform cursor-pointer items-center justify-center text-xs transition-transform duration-100 ${t.isOpen ? "rotate-90" : ""}`,
175
- children: t.node.droppable && /* @__PURE__ */ e.jsx("button", { onClick: u, type: "button", children: /* @__PURE__ */ e.jsx(ie, {}) })
176
- }
177
- ),
178
- /* @__PURE__ */ e.jsxs("button", { type: "button", className: "flex items-center", children: [
179
- /* @__PURE__ */ e.jsx("div", { className: "-mt-1 h-3 w-3", children: /* @__PURE__ */ e.jsx(S, { type: c == null ? void 0 : c._type }) }),
180
- /* @__PURE__ */ e.jsx("div", { className: "ml-2 truncate text-[11px]", children: ((m = t.node.data) == null ? void 0 : m._name) || t.node.text }),
181
- d ? /* @__PURE__ */ e.jsxs(
182
- "span",
164
+ ...g,
165
+ children: /* @__PURE__ */ e.jsxs("div", { className: "flex w-full items-center justify-between pr-2", children: [
166
+ /* @__PURE__ */ e.jsxs("div", { className: "flex items-center", children: [
167
+ /* @__PURE__ */ e.jsx(
168
+ "div",
169
+ {
170
+ 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" : ""}`,
171
+ children: t.node.droppable && /* @__PURE__ */ e.jsx("button", { onClick: d, type: "button", children: /* @__PURE__ */ e.jsx(ie, {}) })
172
+ }
173
+ ),
174
+ /* @__PURE__ */ e.jsxs("button", { type: "button", className: "flex items-center", children: [
175
+ /* @__PURE__ */ e.jsx("div", { className: "-mt-1 h-3 w-3", children: /* @__PURE__ */ e.jsx(N, { type: l == null ? void 0 : l._type }) }),
176
+ /* @__PURE__ */ e.jsx("div", { className: "ml-2 truncate text-[11px]", children: ((u = t.node.data) == null ? void 0 : u._name) || t.node.text }),
177
+ m ? /* @__PURE__ */ e.jsxs(
178
+ "span",
179
+ {
180
+ className: "ml-2 flex items-center text-[10px] italic " + (i ? "text-gray-200" : "text-gray-500"),
181
+ children: [
182
+ "(",
183
+ m,
184
+ ")"
185
+ ]
186
+ }
187
+ ) : null
188
+ ] })
189
+ ] }),
190
+ /* @__PURE__ */ e.jsx("div", { className: "invisible flex items-center space-x-1 group-hover:visible", children: c.map((a) => /* @__PURE__ */ e.jsxs(ye, { children: [
191
+ /* @__PURE__ */ e.jsx(
192
+ ke,
183
193
  {
184
- className: "ml-2 flex items-center text-[10px] italic " + (n ? "text-gray-200" : "text-gray-500"),
185
- children: [
186
- "(",
187
- d,
188
- ")"
189
- ]
194
+ className: "cursor-pointer rounded bg-transparent hover:bg-white hover:text-blue-500",
195
+ asChild: !0,
196
+ children: a.item(o)
190
197
  }
191
- ) : null
192
- ] })
198
+ ),
199
+ /* @__PURE__ */ e.jsx(ve, { children: a.tooltip })
200
+ ] })) })
193
201
  ] })
194
202
  }
195
203
  )
196
204
  );
197
- }, ze = (t) => {
198
- var r;
205
+ }, Ue = (t) => {
206
+ var n;
199
207
  const { item: s } = t.monitorProps;
200
208
  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: [
201
- /* @__PURE__ */ e.jsx("div", { className: "", children: /* @__PURE__ */ e.jsx(S, { type: (r = s == null ? void 0 : s.data) == null ? void 0 : r._type }) }),
209
+ /* @__PURE__ */ e.jsx("div", { className: "", children: /* @__PURE__ */ e.jsx(N, { type: (n = s == null ? void 0 : s.data) == null ? void 0 : n._type }) }),
202
210
  /* @__PURE__ */ e.jsx("div", { className: "ml-2 truncate text-[11px]", children: s.text })
203
211
  ] });
204
- }, Ke = (t) => {
212
+ }, Ye = (t) => {
205
213
  const s = t.depth * 10 + 16;
206
214
  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 } });
207
- }, $e = () => {
208
- const [t] = I(), s = fe(), r = C();
215
+ }, Qe = () => {
216
+ const [t] = f(), s = Be(), n = T();
209
217
  return /* @__PURE__ */ e.jsxs(
210
- T,
218
+ D,
211
219
  {
212
- disabled: !ye(r == null ? void 0 : r._type),
220
+ disabled: !we(n == null ? void 0 : n._type),
213
221
  className: "flex items-center gap-x-4 text-xs",
214
222
  onClick: () => s(t),
215
223
  children: [
@@ -218,77 +226,77 @@ const Ve = (t) => {
218
226
  ]
219
227
  }
220
228
  );
221
- }, Qe = () => {
222
- const [t] = I(), s = ke(), r = C(), n = Me(() => {
229
+ }, Ge = () => {
230
+ const [t] = f(), s = Ce(), n = T(), c = Pe(() => {
223
231
  s(t);
224
232
  }, [t, s]);
225
- return /* @__PURE__ */ e.jsxs(Be, { className: "text-xs", children: [
233
+ return /* @__PURE__ */ e.jsxs(Te, { className: "text-xs", children: [
226
234
  /* @__PURE__ */ e.jsxs(
227
- T,
235
+ D,
228
236
  {
229
- disabled: !we(r == null ? void 0 : r._type),
237
+ disabled: !De(n == null ? void 0 : n._type),
230
238
  className: "flex items-center gap-x-4 text-xs",
231
- onClick: n,
239
+ onClick: c,
232
240
  children: [
233
241
  /* @__PURE__ */ e.jsx(xe, {}),
234
242
  " Duplicate"
235
243
  ]
236
244
  }
237
245
  ),
238
- /* @__PURE__ */ e.jsx($e, {})
246
+ /* @__PURE__ */ e.jsx(Qe, {})
239
247
  ] });
240
- }, Ue = ({ children: t }) => /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsxs(ve, { children: [
241
- /* @__PURE__ */ e.jsx(Ce, { children: t }),
242
- /* @__PURE__ */ e.jsx(Qe, {})
248
+ }, We = ({ children: t }) => /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsxs(Se, { children: [
249
+ /* @__PURE__ */ e.jsx(Ne, { children: t }),
250
+ /* @__PURE__ */ e.jsx(Ge, {})
243
251
  ] }) });
244
- function qe(t) {
245
- return v(t, (s) => {
246
- const { data: r } = s;
252
+ function Xe(t) {
253
+ return C(t, (s) => {
254
+ const { data: n } = s;
247
255
  return {
248
- ...r,
256
+ ...n,
249
257
  _parent: s.parent === 0 ? null : s.parent
250
258
  };
251
259
  });
252
260
  }
253
- const Wt = () => {
254
- const [t] = Te(), { setNewBlocks: s } = De(), [r, n, a] = I(), [, c] = Se(), { t: p } = he(), u = Ae(), x = Le(), [d] = Ne(), m = async (o, l) => {
255
- const { dragSource: j, relativeIndex: h, dropTargetId: b, monitor: f } = l;
261
+ const Yt = () => {
262
+ const [t] = Oe(), { setNewBlocks: s } = Re(), [n, c, i] = f(), [, o] = Me(), { t: l } = je(), p = Fe(), d = ze(), [g] = Ee(), m = async (r, x) => {
263
+ const { dragSource: j, relativeIndex: b, dropTargetId: I, monitor: y } = x;
256
264
  if (j) {
257
- const _ = qe(o);
258
- s(_);
259
- const E = f.getItem();
260
- n([E.id]);
265
+ const M = Xe(r);
266
+ s(M);
267
+ const E = y.getItem();
268
+ c([E.id]);
261
269
  } else
262
- await x({ block: f.getItem(), dropTargetId: b, relativeIndex: h });
263
- }, i = v(t, (o) => ({
264
- id: o._id,
265
- text: o._type,
266
- parent: o._parent || 0,
267
- droppable: !H(A(t, { _parent: o._id })),
268
- data: o
269
- })), N = () => {
270
- n([]), c([]);
271
- }, [{ isOver: g }, O] = pe(() => ({
270
+ await d({ block: y.getItem(), dropTargetId: I, relativeIndex: b });
271
+ }, u = C(t, (r) => ({
272
+ id: r._id,
273
+ text: r._type,
274
+ parent: r._parent || 0,
275
+ droppable: !H(A(t, { _parent: r._id })),
276
+ data: r
277
+ })), a = () => {
278
+ c([]), o([]);
279
+ }, [{ isOver: h }, O] = ue(() => ({
272
280
  accept: ["CHAI_BLOCK"],
273
- collect: (o) => ({
274
- canDrop: o.canDrop(),
275
- isOver: o.isOver()
281
+ collect: (r) => ({
282
+ canDrop: r.canDrop(),
283
+ isOver: r.isOver()
276
284
  }),
277
- drop: (o) => {
278
- (async () => await x({
279
- block: o,
285
+ drop: (r) => {
286
+ (async () => await d({
287
+ block: r,
280
288
  dropTargetId: "",
281
289
  relativeIndex: 0
282
290
  }))();
283
291
  }
284
- })), { isDragging: R } = ue((o) => ({
285
- isDragging: o.isDragging()
292
+ })), { isDragging: R } = pe((r) => ({
293
+ isDragging: r.isDragging()
286
294
  }));
287
295
  return /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsx(
288
296
  "div",
289
297
  {
290
- onClick: () => N(),
291
- className: D(
298
+ onClick: () => a(),
299
+ className: S(
292
300
  "-mx-1 -mt-1 flex h-full select-none flex-col space-y-1",
293
301
  R ? "bg-green-50/80" : "bg-background"
294
302
  ),
@@ -296,52 +304,52 @@ const Wt = () => {
296
304
  "div",
297
305
  {
298
306
  ref: O,
299
- className: `mx-1 mt-4 h-full max-w-full p-6 text-center text-sm text-gray-400 ${g ? "bg-blue-200" : ""}`,
307
+ className: `mx-1 mt-4 h-full max-w-full p-6 text-center text-sm text-gray-400 ${h ? "bg-blue-200" : ""}`,
300
308
  children: [
301
- g ? /* @__PURE__ */ e.jsx(de, { className: "mx-auto h-12 w-12 animate-bounce" }) : /* @__PURE__ */ e.jsx(me, { className: "mx-auto h-10 w-10" }),
302
- /* @__PURE__ */ e.jsx("p", { className: "mt-2", children: p(g ? "drop_here_message" : "tree_view_no_blocks") })
309
+ h ? /* @__PURE__ */ e.jsx(de, { className: "mx-auto h-12 w-12 animate-bounce" }) : /* @__PURE__ */ e.jsx(me, { className: "mx-auto h-10 w-10" }),
310
+ /* @__PURE__ */ e.jsx("p", { className: "mt-2", children: l(h ? "drop_here_message" : "tree_view_no_blocks") })
303
311
  ]
304
312
  }
305
- ) : /* @__PURE__ */ e.jsx(Oe, { id: "layers-view", className: "no-scrollbar h-full overflow-y-auto p-1", children: /* @__PURE__ */ e.jsx(
306
- je,
313
+ ) : /* @__PURE__ */ e.jsx(_e, { id: "layers-view", className: "no-scrollbar h-full overflow-y-auto p-1", children: /* @__PURE__ */ e.jsx(
314
+ he,
307
315
  {
308
- initialOpen: u,
316
+ initialOpen: p,
309
317
  extraAcceptTypes: ["CHAI_BLOCK"],
310
- tree: i,
318
+ tree: u,
311
319
  rootId: 0,
312
- render: (o, { depth: l, isOpen: j, onToggle: h }) => /* @__PURE__ */ e.jsx(Ue, { id: o.id, children: /* @__PURE__ */ e.jsx(
313
- Fe,
320
+ render: (r, { depth: x, isOpen: j, onToggle: b }) => /* @__PURE__ */ e.jsx(We, { id: r.id, children: /* @__PURE__ */ e.jsx(
321
+ Ke,
314
322
  {
315
- onSelect: (b) => {
316
- c([]), n([b]);
323
+ onSelect: (I) => {
324
+ o([]), c([I]);
317
325
  },
318
- isSelected: P(r, o.id),
319
- node: o,
320
- depth: l,
326
+ isSelected: P(n, r.id),
327
+ node: r,
328
+ depth: x,
321
329
  isOpen: j,
322
- onToggle: h,
323
- toggleIds: a
330
+ onToggle: b,
331
+ toggleIds: i
324
332
  }
325
333
  ) }),
326
- dragPreviewRender: (o) => /* @__PURE__ */ e.jsx(ze, { monitorProps: o }),
334
+ dragPreviewRender: (r) => /* @__PURE__ */ e.jsx(Ue, { monitorProps: r }),
327
335
  onDrop: m,
328
336
  classes: {
329
- root: "h-[90%] " + (d ? "pl-2" : "pt-2"),
337
+ root: "h-[90%] " + (g ? "pl-2" : "pt-2"),
330
338
  draggingSource: "opacity-30",
331
339
  dropTarget: "bg-green-100",
332
340
  placeholder: "relative"
333
341
  },
334
342
  sort: !1,
335
343
  insertDroppableFirst: !1,
336
- canDrop: Re,
344
+ canDrop: He,
337
345
  dropTargetOffset: 2,
338
346
  enableAnimateExpand: !0,
339
- placeholderRender: (o, { depth: l }) => /* @__PURE__ */ e.jsx(Ke, { node: o, depth: l })
347
+ placeholderRender: (r, { depth: x }) => /* @__PURE__ */ e.jsx(Ye, { node: r, depth: x })
340
348
  }
341
349
  ) })
342
350
  }
343
351
  ) });
344
352
  };
345
353
  export {
346
- Wt as default
354
+ Yt as default
347
355
  };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-Z_BpKhVy.cjs"),u=require("lodash-es"),s=require("@radix-ui/react-icons"),y=require("react-dnd"),k=require("@minoru/react-dnd-treeview"),N=require("react-i18next"),r=require("./index-MQH3blB-.cjs"),O=require("lucide-react"),B=require("react"),M=require("./MODIFIERS-9EwxLM8V.cjs"),v=require("./Functions-N3yhPYKY.cjs"),_=require("./index-0JU8vPT_.cjs"),A=require("./useAddBlockByDrop-6qaL4Ufz.cjs");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("@chaibuilder/runtime");require("jotai");require("flat-to-nested");require("@react-hookz/web");require("@radix-ui/react-toggle");require("class-variance-authority");require("./Class-MmCxz2Ay.cjs");require("clsx");require("tailwind-merge");require("@radix-ui/react-switch");require("@radix-ui/react-slot");require("@radix-ui/react-accordion");require("@radix-ui/react-alert-dialog");require("@radix-ui/react-dialog");require("@radix-ui/react-label");require("@radix-ui/react-scroll-area");require("@radix-ui/react-tabs");require("@radix-ui/react-tooltip");require("@radix-ui/react-popover");require("@radix-ui/react-menubar");require("@radix-ui/react-hover-card");require("@radix-ui/react-select");require("@radix-ui/react-dropdown-menu");require("@radix-ui/react-separator");require("@radix-ui/react-toast");require("cmdk");require("@radix-ui/react-context-menu");require("react-icons-picker");require("react-dom");require("react-quill");require("i18next");require("@floating-ui/react-dom");require("react-textarea-autosize");require("flagged");require("react-hotkeys-hook");const w=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 n={xs:"390px",sm:"640px",md:"768px",lg:"1024px",xl:"1366px","2xl":"1536px"};if(new RegExp(/\bsr-only\b/).test(t))return"Sr Only";if(new RegExp(/\b(sm|md|lg|xl|2xl):hidden\b/).test(t))return"Visible on mobile";if(t.match(/(^| )hidden( |$)/g)){const a=new RegExp(/\b(sm|md|lg|xl|2xl):(block|grid|flex|inline|inline-grid|inline-flex|inline-block)\b/),x=t.match(a);if(u.nth(x,1))return`Visible >=${n[u.nth(x,1)]}`}return""}const L=t=>{let n="";return Object.keys(t).forEach(i=>{u.startsWith(t[i],M.STYLES_KEY)&&(n=t[i])}),n},P=t=>{var g;const[,n]=r.useHighlightBlockId(),[i]=r.useHiddenBlockIds(),l=r.useBuilderProp("outlineMenuItems",[]),{isSelected:a}=t,{id:x,data:d}=t.node,R=t.depth*10,p=c=>{c.stopPropagation(),t.onToggle(t.node.id)},E=k.useDragOver(x,t.isOpen,t.onToggle),j=B.useMemo(()=>{const c=L(t.node.data);return H(c)},[t.node.data]);return e.jsxRuntimeExports.jsx("div",{onMouseEnter:()=>n(x),className:v.cn("group flex w-full items-center justify-between space-x-px py-px",a?"bg-blue-500 text-white":"text-gray-600 hover:bg-gray-200 dark:hover:bg-gray-800"),onClick:c=>{c.stopPropagation(),!i.includes(x)&&t.onSelect(x)},onContextMenu:()=>t.onSelect(x),style:{paddingInlineStart:R},...E,children:e.jsxRuntimeExports.jsxs("div",{className:"flex w-full items-center justify-between pr-2",children:[e.jsxRuntimeExports.jsxs("div",{className:"flex items-center",children:[e.jsxRuntimeExports.jsx("div",{className:`flex h-4 w-4 rotate-0 transform cursor-pointer items-center justify-center text-xs transition-transform duration-100 ${t.isOpen?"rotate-90":""}`,children:t.node.droppable&&e.jsxRuntimeExports.jsx("button",{onClick: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(w,{type:d==null?void 0:d._type})}),e.jsxRuntimeExports.jsx("div",{className:"ml-2 truncate text-[11px]",children:((g=t.node.data)==null?void 0:g._name)||t.node.text}),j?e.jsxRuntimeExports.jsxs("span",{className:"ml-2 flex items-center text-[10px] italic "+(a?"text-gray-200":"text-gray-500"),children:["(",j,")"]}):null]})]}),e.jsxRuntimeExports.jsx("div",{className:"invisible flex items-center space-x-1 group-hover:visible",children:l.map(c=>e.jsxRuntimeExports.jsxs(r.Tooltip,{children:[e.jsxRuntimeExports.jsx(r.TooltipTrigger,{className:"cursor-pointer rounded bg-transparent hover:bg-white hover:text-blue-500",asChild:!0,children:c.item(x)}),e.jsxRuntimeExports.jsx(r.TooltipContent,{children:c.tooltip})]}))})]})})},F=t=>{var i;const{item:n}=t.monitorProps;return e.jsxRuntimeExports.jsxs("div",{className:"flex w-max items-center bg-blue-200 bg-opacity-30 p-1 font-semibold text-blue-700",children:[e.jsxRuntimeExports.jsx("div",{className:"",children:e.jsxRuntimeExports.jsx(w,{type:(i=n==null?void 0:n.data)==null?void 0:i._type})}),e.jsxRuntimeExports.jsx("div",{className:"ml-2 truncate text-[11px]",children:n.text})]})},V=t=>{const n=t.depth*10+16;return e.jsxRuntimeExports.jsx("div",{className:"absolute right-0 top-0 h-0.5 -translate-y-1/2 transform bg-green-500",style:{left:n}})},z=()=>{const[t]=r.useSelectedBlockIds(),n=r.useRemoveBlocks(),i=r.useSelectedBlock();return e.jsxRuntimeExports.jsxs(r.ContextMenuItem,{disabled:!r.canDeleteBlock(i==null?void 0:i._type),className:"flex items-center gap-x-4 text-xs",onClick:()=>n(t),children:[e.jsxRuntimeExports.jsx(s.TrashIcon,{})," Remove"]})},$=()=>{const[t]=r.useSelectedBlockIds(),n=r.useDuplicateBlocks(),i=r.useSelectedBlock(),l=B.useCallback(()=>{n(t)},[t,n]);return e.jsxRuntimeExports.jsxs(r.ContextMenuContent,{className:"text-xs",children:[e.jsxRuntimeExports.jsxs(r.ContextMenuItem,{disabled:!r.canDuplicateBlock(i==null?void 0:i._type),className:"flex items-center gap-x-4 text-xs",onClick:l,children:[e.jsxRuntimeExports.jsx(s.CopyIcon,{})," Duplicate"]}),e.jsxRuntimeExports.jsx(z,{})]})},K=({children:t})=>e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:e.jsxRuntimeExports.jsxs(r.ContextMenu,{children:[e.jsxRuntimeExports.jsx(r.ContextMenuTrigger,{children:t}),e.jsxRuntimeExports.jsx($,{})]})});function U(t){return u.map(t,n=>{const{data:i}=n;return{...i,_parent:n.parent===0?null:n.parent}})}const Q=()=>{const[t]=r.useBlocksStore(),{setNewBlocks:n}=r.useBlocksStoreUndoableActions(),[i,l,a]=r.useSelectedBlockIds(),[,x]=r.useSelectedStylingBlocks(),{t:d}=N.useTranslation(),R=_.useExpandedIds(),p=A.useAddBlockByDrop(),[E]=r.useBlocksContainer(),j=async(o,m)=>{const{dragSource:I,relativeIndex:b,dropTargetId:q,monitor:f}=m;if(I){const D=U(o);n(D);const S=f.getItem();l([S.id])}else await p({block:f.getItem(),dropTargetId:q,relativeIndex:b})},g=u.map(t,o=>({id:o._id,text:o._type,parent:o._parent||0,droppable:!u.isUndefined(u.find(t,{_parent:o._id})),data:o})),c=()=>{l([]),x([])},[{isOver:h},T]=y.useDrop(()=>({accept:["CHAI_BLOCK"],collect:o=>({canDrop:o.canDrop(),isOver:o.isOver()}),drop:o=>{(async()=>await p({block:o,dropTargetId:"",relativeIndex:0}))()}})),{isDragging:C}=y.useDragLayer(o=>({isDragging:o.isDragging()}));return e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:e.jsxRuntimeExports.jsx("div",{onClick:()=>c(),className:v.cn("-mx-1 -mt-1 flex h-full select-none flex-col space-y-1",C?"bg-green-50/80":"bg-background"),children:u.isEmpty(t)?e.jsxRuntimeExports.jsxs("div",{ref:T,className:`mx-1 mt-4 h-full max-w-full p-6 text-center text-sm text-gray-400 ${h?"bg-blue-200":""}`,children:[h?e.jsxRuntimeExports.jsx(s.DoubleArrowDownIcon,{className:"mx-auto h-12 w-12 animate-bounce"}):e.jsxRuntimeExports.jsx(s.StackIcon,{className:"mx-auto h-10 w-10"}),e.jsxRuntimeExports.jsx("p",{className:"mt-2",children:d(h?"drop_here_message":"tree_view_no_blocks")})]}):e.jsxRuntimeExports.jsx(r.ScrollArea,{id:"layers-view",className:"no-scrollbar h-full overflow-y-auto p-1",children:e.jsxRuntimeExports.jsx(k.Tree,{initialOpen:R,extraAcceptTypes:["CHAI_BLOCK"],tree:g,rootId:0,render:(o,{depth:m,isOpen:I,onToggle:b})=>e.jsxRuntimeExports.jsx(K,{id:o.id,children:e.jsxRuntimeExports.jsx(P,{onSelect:q=>{x([]),l([q])},isSelected:u.includes(i,o.id),node:o,depth:m,isOpen:I,onToggle:b,toggleIds:a})}),dragPreviewRender:o=>e.jsxRuntimeExports.jsx(F,{monitorProps:o}),onDrop:j,classes:{root:"h-[90%] "+(E?"pl-2":"pt-2"),draggingSource:"opacity-30",dropTarget:"bg-green-100",placeholder:"relative"},sort:!1,insertDroppableFirst:!1,canDrop:r.canDropBlock,dropTargetOffset:2,enableAnimateExpand:!0,placeholderRender:(o,{depth:m})=>e.jsxRuntimeExports.jsx(V,{node:o,depth:m})})})})})};exports.default=Q;
@@ -1,22 +1,23 @@
1
1
  import { j as t } from "./jsx-runtime-WbnYoNE9.js";
2
2
  import i, { Suspense as s } from "react";
3
3
  import { sortBy as a, filter as d, get as n } from "lodash-es";
4
- import { a as l, b as c } from "./index-nrRnwUaC.js";
4
+ import { u as l, a as c } from "./index-ugsWasKp.js";
5
5
  import "./_commonjsHelpers-UyOWmZb0.js";
6
+ import "./index-eyVVbA05.js";
6
7
  import "i18next";
7
8
  import "react-i18next";
8
- import "./index-QGA4ayU7.js";
9
+ import "./index-MaXiXghQ.js";
9
10
  import "./Functions-7jnEwJyw.js";
10
11
  import "clsx";
11
12
  import "tailwind-merge";
12
13
  import "@chaibuilder/runtime";
13
14
  import "jotai";
14
15
  import "flat-to-nested";
15
- import "./MODIFIERS-RiXS5Mn1.js";
16
+ import "./MODIFIERS-WQdaNvb8.js";
16
17
  import "@react-hookz/web";
17
18
  import "@radix-ui/react-toggle";
18
19
  import "class-variance-authority";
19
- import "./Class-17XFhL48.js";
20
+ import "./Class-3k8xjeiM.js";
20
21
  import "@radix-ui/react-switch";
21
22
  import "@radix-ui/react-slot";
22
23
  import "@radix-ui/react-accordion";
@@ -46,12 +47,11 @@ import "react-dnd";
46
47
  import "@minoru/react-dnd-treeview";
47
48
  import "react-hotkeys-hook";
48
49
  import "sonner";
49
- import "./html-to-json-57841sEK.js";
50
+ import "./html-to-json-C5sExaSD.js";
50
51
  import "himalaya";
51
52
  import "lucide-react";
52
- import "./web-blocks.js";
53
- import "./empty-slot-5FRrRq1E.js";
54
- const x = i.lazy(() => import("./add-page-modal-nZJaunuz.js")), g = i.lazy(() => import("./page-viewer-U7o88VvR.js")), gt = () => {
53
+ import "./index-YpnaudSM.js";
54
+ const x = i.lazy(() => import("./add-page-modal-AsP5g0Fp.js")), u = i.lazy(() => import("./page-viewer-P5Im9RfR.js")), ut = () => {
55
55
  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);
56
56
  return /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
57
57
  /* @__PURE__ */ t.jsxs("div", { className: "flex items-center justify-between rounded-md bg-background/30 p-1", children: [
@@ -59,9 +59,9 @@ const x = i.lazy(() => import("./add-page-modal-nZJaunuz.js")), g = i.lazy(() =>
59
59
  /* @__PURE__ */ t.jsx(s, { fallback: /* @__PURE__ */ t.jsx("div", { className: "text-sm text-blue-500 underline", children: "+ New Page" }), children: /* @__PURE__ */ t.jsx(x, {}) })
60
60
  ] }),
61
61
  /* @__PURE__ */ t.jsx("hr", { className: "-mx-1" }),
62
- /* @__PURE__ */ t.jsx("div", { className: "-mx-1 divide-y-2", children: /* @__PURE__ */ t.jsx(g, { isLoading: m, pages: p }) })
62
+ /* @__PURE__ */ t.jsx("div", { className: "-mx-1 divide-y-2", children: /* @__PURE__ */ t.jsx(u, { isLoading: m, pages: p }) })
63
63
  ] });
64
64
  };
65
65
  export {
66
- gt as default
66
+ ut as default
67
67
  };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-Z_BpKhVy.cjs"),u=require("react"),i=require("lodash-es"),s=require("./index-4xyhDki2.cjs");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("./index-0JU8vPT_.cjs");require("i18next");require("react-i18next");require("./index-MQH3blB-.cjs");require("./Functions-N3yhPYKY.cjs");require("clsx");require("tailwind-merge");require("@chaibuilder/runtime");require("jotai");require("flat-to-nested");require("./MODIFIERS-9EwxLM8V.cjs");require("@react-hookz/web");require("@radix-ui/react-toggle");require("class-variance-authority");require("./Class-MmCxz2Ay.cjs");require("@radix-ui/react-switch");require("@radix-ui/react-slot");require("@radix-ui/react-accordion");require("@radix-ui/react-icons");require("@radix-ui/react-alert-dialog");require("@radix-ui/react-dialog");require("@radix-ui/react-label");require("@radix-ui/react-scroll-area");require("@radix-ui/react-tabs");require("@radix-ui/react-tooltip");require("@radix-ui/react-popover");require("@radix-ui/react-menubar");require("@radix-ui/react-hover-card");require("@radix-ui/react-select");require("@radix-ui/react-dropdown-menu");require("@radix-ui/react-separator");require("@radix-ui/react-toast");require("cmdk");require("@radix-ui/react-context-menu");require("react-icons-picker");require("react-dom");require("react-quill");require("@floating-ui/react-dom");require("react-textarea-autosize");require("flagged");require("react-dnd");require("@minoru/react-dnd-treeview");require("react-hotkeys-hook");require("sonner");require("./html-to-json-FGufPv9R.cjs");require("himalaya");require("lucide-react");require("./index-ecnGWzh9.cjs");const a=u.lazy(()=>Promise.resolve().then(()=>require("./add-page-modal-ajpd-Gmw.cjs"))),x=u.lazy(()=>Promise.resolve().then(()=>require("./page-viewer-Xj9v8mji.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,8 +1,8 @@
1
1
  import { j as t } from "./jsx-runtime-WbnYoNE9.js";
2
2
  import m, { useRef as x, useEffect as a, Suspense as p } from "react";
3
3
  import { isEqual as b, isEmpty as j } from "lodash-es";
4
- import { b8 as f, b9 as n, ba as l, bb as c } from "./index-QGA4ayU7.js";
5
- import { c as h, b as g } from "./index-nrRnwUaC.js";
4
+ import { b9 as f, ba as n, bb as l, bc as c } from "./index-MaXiXghQ.js";
5
+ import { b as h, a as g } from "./index-ugsWasKp.js";
6
6
  import "./_commonjsHelpers-UyOWmZb0.js";
7
7
  import "./Functions-7jnEwJyw.js";
8
8
  import "clsx";
@@ -10,11 +10,11 @@ import "tailwind-merge";
10
10
  import "@chaibuilder/runtime";
11
11
  import "jotai";
12
12
  import "flat-to-nested";
13
- import "./MODIFIERS-RiXS5Mn1.js";
13
+ import "./MODIFIERS-WQdaNvb8.js";
14
14
  import "@react-hookz/web";
15
15
  import "@radix-ui/react-toggle";
16
16
  import "class-variance-authority";
17
- import "./Class-17XFhL48.js";
17
+ import "./Class-3k8xjeiM.js";
18
18
  import "@radix-ui/react-switch";
19
19
  import "@radix-ui/react-slot";
20
20
  import "@radix-ui/react-accordion";
@@ -38,6 +38,7 @@ import "react-icons-picker";
38
38
  import "react-dom";
39
39
  import "react-quill";
40
40
  import "react-i18next";
41
+ import "./index-eyVVbA05.js";
41
42
  import "i18next";
42
43
  import "@floating-ui/react-dom";
43
44
  import "react-textarea-autosize";
@@ -46,12 +47,11 @@ import "react-dnd";
46
47
  import "@minoru/react-dnd-treeview";
47
48
  import "react-hotkeys-hook";
48
49
  import "sonner";
49
- import "./html-to-json-57841sEK.js";
50
+ import "./html-to-json-C5sExaSD.js";
50
51
  import "himalaya";
51
52
  import "lucide-react";
52
- import "./web-blocks.js";
53
- import "./empty-slot-5FRrRq1E.js";
54
- const N = m.lazy(() => import("./project-general-setting-h0TeKYRf.js")), S = m.lazy(() => import("./project-seo-setting-Sl6AE-Q7.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 = (r) => r && j(r.seoData) ? {
53
+ import "./index-YpnaudSM.js";
54
+ const N = m.lazy(() => import("./project-general-setting-R3pVVXmY.js")), S = m.lazy(() => import("./project-seo-setting-pGpm3-6U.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 = (r) => r && j(r.seoData) ? {
55
55
  ...r,
56
56
  seoData: { title: "", description: "", image: "" }
57
57
  } : r;
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-Z_BpKhVy.cjs"),r=require("react"),x=require("lodash-es"),s=require("./index-MQH3blB-.cjs"),a=require("./index-4xyhDki2.cjs");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("./Functions-N3yhPYKY.cjs");require("clsx");require("tailwind-merge");require("@chaibuilder/runtime");require("jotai");require("flat-to-nested");require("./MODIFIERS-9EwxLM8V.cjs");require("@react-hookz/web");require("@radix-ui/react-toggle");require("class-variance-authority");require("./Class-MmCxz2Ay.cjs");require("@radix-ui/react-switch");require("@radix-ui/react-slot");require("@radix-ui/react-accordion");require("@radix-ui/react-icons");require("@radix-ui/react-alert-dialog");require("@radix-ui/react-dialog");require("@radix-ui/react-label");require("@radix-ui/react-scroll-area");require("@radix-ui/react-tabs");require("@radix-ui/react-tooltip");require("@radix-ui/react-popover");require("@radix-ui/react-menubar");require("@radix-ui/react-hover-card");require("@radix-ui/react-select");require("@radix-ui/react-dropdown-menu");require("@radix-ui/react-separator");require("@radix-ui/react-toast");require("cmdk");require("@radix-ui/react-context-menu");require("react-icons-picker");require("react-dom");require("react-quill");require("react-i18next");require("./index-0JU8vPT_.cjs");require("i18next");require("@floating-ui/react-dom");require("react-textarea-autosize");require("flagged");require("react-dnd");require("@minoru/react-dnd-treeview");require("react-hotkeys-hook");require("sonner");require("./html-to-json-FGufPv9R.cjs");require("himalaya");require("lucide-react");require("./index-ecnGWzh9.cjs");const d=r.lazy(()=>Promise.resolve().then(()=>require("./project-general-setting--5DT1RoW.cjs"))),m=r.lazy(()=>Promise.resolve().then(()=>require("./project-seo-setting-3DzzF83_.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;