@chaibuilder/sdk 1.1.18 → 1.2.0

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 (122) hide show
  1. package/dist/AddBlocks-57-vroWk.cjs +1 -0
  2. package/dist/AddBlocks-QvCc-oag.js +225 -0
  3. package/dist/BrandingOptions-arKT1zCy.cjs +1 -0
  4. package/dist/{BrandingOptions-zFJ28xmJ.js → BrandingOptions-mZXO7thQ.js} +27 -25
  5. package/dist/{CanvasArea-vTV3O27-.js → CanvasArea-59Gm0EZx.js} +581 -598
  6. package/dist/CanvasArea-jRg53jrS.cjs +59 -0
  7. package/dist/CurrentPage-MLObvs0K.cjs +1 -0
  8. package/dist/{CurrentPage-Ay7X9h9y.js → CurrentPage-YPI5QTjk.js} +17 -14
  9. package/dist/Functions-7jnEwJyw.js +15 -0
  10. package/dist/Functions-N3yhPYKY.cjs +1 -0
  11. package/dist/{Layers-CWnzKXMo.js → Layers-no2keK4N.js} +149 -146
  12. package/dist/Layers-x_mWeT_q.cjs +1 -0
  13. package/dist/MODIFIERS-2FeVfZQ9.cjs +1 -0
  14. package/dist/{MODIFIERS-MLfpKQY1.js → MODIFIERS-RiXS5Mn1.js} +7 -13
  15. package/dist/MarkAsGlobalBlock-S2BhHTsK.cjs +1 -0
  16. package/dist/{MarkAsGlobalBlock-uhj0kGZo.js → MarkAsGlobalBlock-SPWd6Flk.js} +9 -7
  17. package/dist/{PagesPanel-ALbBHaO3.js → PagesPanel-Q08uN4X3.js} +12 -9
  18. package/dist/PagesPanel-pOIuFPOA.cjs +1 -0
  19. package/dist/ProjectPanel-4bN_GyNm.cjs +1 -0
  20. package/dist/{ProjectPanel-tIDarI9R.js → ProjectPanel-zzYV9yrV.js} +25 -22
  21. package/dist/{Settings-5uDMY9SU.js → Settings-28A7R61i.js} +334 -331
  22. package/dist/Settings-KlTtgu3w.cjs +1 -0
  23. package/dist/{SidePanels-D6U95ur1.js → SidePanels--ZK6Iqou.js} +80 -77
  24. package/dist/SidePanels-eJBA_cUu.cjs +1 -0
  25. package/dist/{Topbar-_-1HX-EE.js → Topbar-ks1ckGLz.js} +15 -13
  26. package/dist/Topbar-u5XKdWgQ.cjs +1 -0
  27. package/dist/{UnsplashImages-mqK09h8E.js → UnsplashImages-8vJPuqrF.js} +25 -23
  28. package/dist/UnsplashImages-V8oKEHfi.cjs +1 -0
  29. package/dist/{UploadImages-IDkkRuhx.js → UploadImages-6N6UrjLo.js} +26 -24
  30. package/dist/UploadImages-eHYxwWAp.cjs +1 -0
  31. package/dist/_commonjsHelpers-UyOWmZb0.js +8 -0
  32. package/dist/_commonjsHelpers-wDK0ZLPo.cjs +1 -0
  33. package/dist/{add-page-modal-C1UGoRkw.js → add-page-modal-EHIYTW4T.js} +27 -24
  34. package/dist/add-page-modal-OvNXLGf0.cjs +1 -0
  35. package/dist/{confirm-alert-ea5xpncD.js → confirm-alert-biqvaLT-.js} +9 -7
  36. package/dist/confirm-alert-f3DYO5Hj.cjs +1 -0
  37. package/dist/controls-Dy1qa8Dc.cjs +1 -0
  38. package/dist/controls-XPXGHKht.js +182 -0
  39. package/dist/core.cjs +1 -1
  40. package/dist/core.d.ts +10 -1
  41. package/dist/core.js +60 -57
  42. package/dist/delete-page-modal-U4yiuhx0.cjs +1 -0
  43. package/dist/{delete-page-modal-0GxR128b.js → delete-page-modal-qZJCk_JH.js} +15 -12
  44. package/dist/email-blocks.cjs +1 -0
  45. package/dist/email-blocks.d.ts +3 -0
  46. package/dist/email-blocks.js +35 -0
  47. package/dist/{form-irY39wvJ.js → form-Moz_psOw.js} +16 -16
  48. package/dist/form-lJhy9DEC.cjs +1 -0
  49. package/dist/functions-Ox_svtKm.cjs +1 -0
  50. package/dist/functions-xIebp8Aw.js +23 -0
  51. package/dist/html-to-json-dfALTAdG.cjs +1 -0
  52. package/dist/{html-to-json-wmbV9eZP.js → html-to-json-xKBERAI1.js} +47 -46
  53. package/dist/index-IIJ_o44s.cjs +1 -0
  54. package/dist/{index-qEix1meh.js → index-QEchoZ98.js} +8 -8
  55. package/dist/{index-0OqmBgqo.js → index-_OgCuSUz.js} +528 -533
  56. package/dist/{index-npVo1wi3.cjs → index-hMoPNZVn.cjs} +2 -2
  57. package/dist/{jsx-runtime-NV737rRe.js → jsx-runtime-WbnYoNE9.js} +1 -1
  58. package/dist/{jsx-runtime-WUGKV8jN.cjs → jsx-runtime-Z_BpKhVy.cjs} +7 -7
  59. package/dist/lib.cjs +2 -2
  60. package/dist/lib.d.ts +1 -1
  61. package/dist/lib.js +47 -44
  62. package/dist/page-viewer-WhM1FSU0.cjs +1 -0
  63. package/dist/{page-viewer-mgnZt6nO.js → page-viewer-zFLkUu2I.js} +17 -14
  64. package/dist/{project-general-setting-M52W-vUp.js → project-general-setting-MWGOOurD.js} +16 -13
  65. package/dist/project-general-setting-y8daY7V9.cjs +1 -0
  66. package/dist/project-seo-setting-9JGBPzcA.cjs +1 -0
  67. package/dist/{project-seo-setting-EhqUcTKy.js → project-seo-setting-dXclexQW.js} +15 -13
  68. package/dist/render.cjs +1 -1
  69. package/dist/render.d.ts +1 -1
  70. package/dist/render.js +50 -49
  71. package/dist/server.cjs +1 -1
  72. package/dist/server.d.ts +1 -1
  73. package/dist/server.js +11 -11
  74. package/dist/single-page-detail--xPv74bX.cjs +1 -0
  75. package/dist/{single-page-detail-61UDUgWG.js → single-page-detail-C48IPzbd.js} +77 -74
  76. package/dist/studio.cjs +1 -1
  77. package/dist/studio.js +11 -8
  78. package/dist/ui.cjs +1 -1
  79. package/dist/ui.d.ts +3 -3
  80. package/dist/ui.js +144 -142
  81. package/dist/useAddBlockByDrop-_nd8yZBa.cjs +1 -0
  82. package/dist/useAddBlockByDrop-uPXvrg4G.js +20 -0
  83. package/dist/{utils-XsPKXMVo.js → utils-AvyFzbPC.js} +26 -35
  84. package/dist/utils-PTxFk6qT.cjs +1 -0
  85. package/dist/web-blocks.cjs +9 -0
  86. package/dist/web-blocks.d.ts +3 -0
  87. package/dist/web-blocks.js +1033 -0
  88. package/package.json +5 -2
  89. package/dist/AddBlocks-sKF4ti68.js +0 -222
  90. package/dist/AddBlocks-yPovJXtD.cjs +0 -1
  91. package/dist/BrandingOptions-TRVyCvVq.cjs +0 -1
  92. package/dist/CanvasArea-xxqOiENt.cjs +0 -59
  93. package/dist/CurrentPage-ju6otPNk.cjs +0 -1
  94. package/dist/Layers-d9OU0HRE.cjs +0 -1
  95. package/dist/MODIFIERS-WFzDQfiT.cjs +0 -1
  96. package/dist/MarkAsGlobalBlock-CDmEHNx7.cjs +0 -1
  97. package/dist/PagesPanel-F9Cdi4Pf.cjs +0 -1
  98. package/dist/ProjectPanel-T49RUDyt.cjs +0 -1
  99. package/dist/Settings-eZnusNbR.cjs +0 -1
  100. package/dist/SidePanels-BVM5JwGC.cjs +0 -1
  101. package/dist/Topbar-gQxbcPtG.cjs +0 -1
  102. package/dist/UnsplashImages-PNp5fYCc.cjs +0 -1
  103. package/dist/UploadImages-BoSSsLtD.cjs +0 -1
  104. package/dist/add-page-modal-HP1yv9yJ.cjs +0 -1
  105. package/dist/confirm-alert-dHRDZrA1.cjs +0 -1
  106. package/dist/controls-QnyBNkXG.cjs +0 -36
  107. package/dist/controls-kEuiMMDf.js +0 -4600
  108. package/dist/delete-page-modal-yOgfPcHr.cjs +0 -1
  109. package/dist/form-6qGAOYI3.cjs +0 -1
  110. package/dist/functions-86L6n983.js +0 -23
  111. package/dist/functions-Jr7gX_RX.cjs +0 -1
  112. package/dist/html-to-json-AqLy6ye-.cjs +0 -1
  113. package/dist/index-d55M5MRz.cjs +0 -1
  114. package/dist/lodash-2us0VT8I.cjs +0 -36
  115. package/dist/lodash-3gkdNK5u.js +0 -4538
  116. package/dist/page-viewer-G2YIKVSt.cjs +0 -1
  117. package/dist/project-general-setting-sinIiBKe.cjs +0 -1
  118. package/dist/project-seo-setting-N0OnBCvh.cjs +0 -1
  119. package/dist/single-page-detail-oa-yTXhQ.cjs +0 -1
  120. package/dist/useAddBlockByDrop-5QW86HjG.js +0 -20
  121. package/dist/useAddBlockByDrop-Ckzuvu-s.cjs +0 -1
  122. package/dist/utils-37UXq2O5.cjs +0 -1
@@ -1,19 +1,22 @@
1
- import { j as e } from "./jsx-runtime-NV737rRe.js";
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
- import { useDrop as he, useDragLayer as be } from "react-dnd";
5
- import { useDragOver as fe, Tree as Ie } from "@minoru/react-dnd-treeview";
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 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
- import { DatabaseIcon as Ge } from "lucide-react";
9
- import { useMemo as $e, lazy as Ke, useCallback as Qe, useState as Ue, Suspense as Ye } from "react";
10
- import { a as qe } from "./MODIFIERS-MLfpKQY1.js";
11
- import { d as S } from "./utils-XsPKXMVo.js";
12
- import { f as We } from "./index-qEix1meh.js";
13
- import { useAtom as Ze } from "jotai";
14
- import { u as Je } from "./useAddBlockByDrop-5QW86HjG.js";
1
+ import { j as e } from "./jsx-runtime-WbnYoNE9.js";
2
+ import { nth as y, startsWith as _, map as w, isUndefined as E, find as A, isEmpty as H, includes as P } from "lodash-es";
3
+ import { BoxModelIcon as L, BoxIcon as z, DragHandleHorizontalIcon as V, ViewHorizontalIcon as F, BorderAllIcon as G, BorderTopIcon as $, TableIcon as K, DropdownMenuIcon as Q, RadiobuttonIcon as U, InputIcon as Y, ButtonIcon as B, CheckboxIcon as q, GroupIcon as W, SpaceBetweenVerticallyIcon as Z, ColumnsIcon as J, RowsIcon as C, TextIcon as v, SketchLogoIcon as X, DividerHorizontalIcon as ee, CodeIcon as te, CursorTextIcon as se, VideoIcon as oe, Link1Icon as ne, HeadingIcon as re, ImageIcon as ae, TriangleRightIcon as ce, ScissorsIcon as le, ClipboardIcon as ie, TrashIcon as xe, GlobeIcon as de, CopyIcon as me, ClipboardCopyIcon as pe, DoubleArrowDownIcon as ue, StackIcon as ge } from "@radix-ui/react-icons";
4
+ import { useDrop as je, useDragLayer as he } from "react-dnd";
5
+ import { useDragOver as be, Tree as Ie } from "@minoru/react-dnd-treeview";
6
+ import { useTranslation as fe } from "react-i18next";
7
+ import { _ as ke, Z as ye, j as u, n as Be, bx as i, k as Ce, l as ve, a6 as we, m as Se, o as Te, i as De, by as Ne, ak as Me, al as Oe, bz as Re, bA as _e, ae as Ee, w as Ae, aj as He, p as Pe, bn as Le, bB as ze } from "./index-_OgCuSUz.js";
8
+ import { DatabaseIcon as Ve } from "lucide-react";
9
+ import { useMemo as Fe, lazy as Ge, useCallback as $e, useState as Ke, Suspense as Qe } from "react";
10
+ import { a as Ue } from "./MODIFIERS-RiXS5Mn1.js";
11
+ import { c as S } from "./Functions-7jnEwJyw.js";
12
+ import { f as Ye } from "./index-QEchoZ98.js";
13
+ import { u as qe } from "./useAddBlockByDrop-uPXvrg4G.js";
14
+ import "./_commonjsHelpers-UyOWmZb0.js";
15
15
  import "@radix-ui/react-toggle";
16
16
  import "class-variance-authority";
17
+ import "./utils-AvyFzbPC.js";
18
+ import "clsx";
19
+ import "tailwind-merge";
17
20
  import "@radix-ui/react-switch";
18
21
  import "@radix-ui/react-slot";
19
22
  import "@radix-ui/react-accordion";
@@ -35,85 +38,85 @@ import "@radix-ui/react-context-menu";
35
38
  import "react-icons-picker";
36
39
  import "react-dom";
37
40
  import "react-quill";
41
+ import "jotai";
38
42
  import "flat-to-nested";
39
43
  import "redux-undo";
40
44
  import "@chaibuilder/runtime";
41
45
  import "@react-hookz/web";
42
- import "clsx";
43
- import "tailwind-merge";
44
46
  import "i18next";
45
47
  import "@floating-ui/react-dom";
46
48
  import "react-textarea-autosize";
47
49
  import "flagged";
48
50
  import "react-hotkeys-hook";
49
51
  import "sonner";
50
- import "./html-to-json-wmbV9eZP.js";
52
+ import "./html-to-json-xKBERAI1.js";
51
53
  import "himalaya";
52
- const D = (s) => {
53
- switch (s.type) {
54
+ import "lodash";
55
+ const T = (t) => {
56
+ switch (t.type) {
54
57
  case "Image":
55
- return /* @__PURE__ */ e.jsx(ce, {});
56
- case "Heading":
57
58
  return /* @__PURE__ */ e.jsx(ae, {});
59
+ case "Heading":
60
+ return /* @__PURE__ */ e.jsx(re, {});
58
61
  case "Text":
59
- return /* @__PURE__ */ e.jsx(w, {});
62
+ return /* @__PURE__ */ e.jsx(v, {});
60
63
  case "Link":
61
- return /* @__PURE__ */ e.jsx(re, {});
62
- case "Video":
63
64
  return /* @__PURE__ */ e.jsx(ne, {});
64
- case "RichText":
65
+ case "Video":
65
66
  return /* @__PURE__ */ e.jsx(oe, {});
67
+ case "RichText":
68
+ return /* @__PURE__ */ e.jsx(se, {});
66
69
  case "Button":
67
70
  return /* @__PURE__ */ e.jsx(B, {});
68
71
  case "CustomHTML":
69
72
  return /* @__PURE__ */ e.jsx(te, {});
70
73
  case "Divider":
71
- return /* @__PURE__ */ e.jsx(se, {});
72
- case "Icon":
73
74
  return /* @__PURE__ */ e.jsx(ee, {});
75
+ case "Icon":
76
+ return /* @__PURE__ */ e.jsx(X, {});
74
77
  case "List":
75
78
  return /* @__PURE__ */ e.jsx(C, {});
76
79
  case "Paragraph":
77
- return /* @__PURE__ */ e.jsx(w, {});
80
+ return /* @__PURE__ */ e.jsx(v, {});
78
81
  case "Row":
79
82
  return /* @__PURE__ */ e.jsx(C, {});
80
83
  case "ListItem":
81
- return /* @__PURE__ */ e.jsx(X, {});
82
- case "LineBreak":
83
84
  return /* @__PURE__ */ e.jsx(J, {});
84
- case "Form":
85
+ case "LineBreak":
85
86
  return /* @__PURE__ */ e.jsx(Z, {});
86
- case "Checkbox":
87
+ case "Form":
87
88
  return /* @__PURE__ */ e.jsx(W, {});
89
+ case "Checkbox":
90
+ return /* @__PURE__ */ e.jsx(q, {});
88
91
  case "FormButton":
89
92
  return /* @__PURE__ */ e.jsx(B, {});
90
93
  case "Input":
91
94
  case "TextArea":
92
- return /* @__PURE__ */ e.jsx(q, {});
93
- case "Radio":
94
95
  return /* @__PURE__ */ e.jsx(Y, {});
95
- case "Select":
96
+ case "Radio":
96
97
  return /* @__PURE__ */ e.jsx(U, {});
97
- case "Table":
98
+ case "Select":
98
99
  return /* @__PURE__ */ e.jsx(Q, {});
99
- case "TableHead":
100
+ case "Table":
100
101
  return /* @__PURE__ */ e.jsx(K, {});
101
- case "TableBody":
102
+ case "TableHead":
102
103
  return /* @__PURE__ */ e.jsx($, {});
103
- case "TableRow":
104
+ case "TableBody":
104
105
  return /* @__PURE__ */ e.jsx(G, {});
105
- case "TableCell":
106
+ case "TableRow":
106
107
  return /* @__PURE__ */ e.jsx(F, {});
108
+ case "TableCell":
109
+ return /* @__PURE__ */ e.jsx(V, {});
107
110
  case "DataProvider":
108
- return /* @__PURE__ */ e.jsx(Ge, { size: 16 });
111
+ return /* @__PURE__ */ e.jsx(Ve, { size: 16 });
109
112
  case "Box":
110
- return /* @__PURE__ */ e.jsx(V, {});
111
- default:
112
113
  return /* @__PURE__ */ e.jsx(z, {});
114
+ default:
115
+ return /* @__PURE__ */ e.jsx(L, {});
113
116
  }
114
117
  };
115
- function Xe(s = "") {
116
- const t = {
118
+ function We(t = "") {
119
+ const s = {
117
120
  xs: "390px",
118
121
  sm: "640px",
119
122
  md: "768px",
@@ -121,60 +124,60 @@ function Xe(s = "") {
121
124
  xl: "1366px",
122
125
  "2xl": "1536px"
123
126
  };
124
- if (new RegExp(/\bsr-only\b/).test(s))
127
+ if (new RegExp(/\bsr-only\b/).test(t))
125
128
  return "Sr Only";
126
- if (new RegExp(/\b(sm|md|lg|xl|2xl):hidden\b/).test(s))
129
+ if (new RegExp(/\b(sm|md|lg|xl|2xl):hidden\b/).test(t))
127
130
  return "Visible on mobile";
128
- if (s.match(/(^| )hidden( |$)/g)) {
131
+ if (t.match(/(^| )hidden( |$)/g)) {
129
132
  const a = new RegExp(
130
133
  // checks if any of the display property is set for any higher media query
131
134
  /\b(sm|md|lg|xl|2xl):(block|grid|flex|inline|inline-grid|inline-flex|inline-block)\b/
132
- ), c = s.match(a);
135
+ ), c = t.match(a);
133
136
  if (y(c, 1))
134
- return `Visible >=${t[y(c, 1)]}`;
137
+ return `Visible >=${s[y(c, 1)]}`;
135
138
  }
136
139
  return "";
137
140
  }
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
- var p;
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
- return Xe(l);
150
- }, [s.node.data]);
141
+ const Ze = (t) => {
142
+ let s = "";
143
+ return Object.keys(t).forEach((o) => {
144
+ _(t[o], Ue) && (s = t[o]);
145
+ }), s;
146
+ }, Je = (t) => {
147
+ var g;
148
+ const [, s] = ke(), [o] = ye(), { isSelected: r } = t, { id: a, data: c } = t.node, x = t.depth * 10, d = (l) => {
149
+ l.stopPropagation(), t.onToggle(t.node.id);
150
+ }, j = be(a, t.isOpen, t.onToggle), m = Fe(() => {
151
+ const l = Ze(t.node.data);
152
+ return We(l);
153
+ }, [t.node.data]);
151
154
  return (
152
155
  // eslint-disable-next-line jsx-a11y/click-events-have-key-events,jsx-a11y/no-static-element-interactions
153
156
  /* @__PURE__ */ e.jsx(
154
157
  "div",
155
158
  {
156
- onMouseEnter: () => t(a),
159
+ onMouseEnter: () => s(a),
157
160
  className: S(
158
161
  "group flex w-full items-center justify-between space-x-px py-px ",
159
162
  r ? "bg-blue-500 text-white" : "hover:bg-gray-200 dark:hover:bg-gray-800"
160
163
  ),
161
164
  onClick: (l) => {
162
- l.stopPropagation(), !o.includes(a) && s.onSelect(a);
165
+ l.stopPropagation(), !o.includes(a) && t.onSelect(a);
163
166
  },
164
- onContextMenu: () => s.onSelect(a),
167
+ onContextMenu: () => t.onSelect(a),
165
168
  style: { paddingInlineStart: x },
166
169
  ...j,
167
170
  children: /* @__PURE__ */ e.jsxs("div", { className: "flex items-center", children: [
168
171
  /* @__PURE__ */ e.jsx(
169
172
  "div",
170
173
  {
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, {}) })
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: d, type: "button", children: /* @__PURE__ */ e.jsx(ce, {}) })
173
176
  }
174
177
  ),
175
178
  /* @__PURE__ */ e.jsxs("button", { type: "button", className: "flex items-center", children: [
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 = s.node.data) == null ? void 0 : p._name) || s.node.text }),
179
+ /* @__PURE__ */ e.jsx("div", { className: "-mt-1 h-3 w-3", children: /* @__PURE__ */ e.jsx(T, { type: c == null ? void 0 : c._type }) }),
180
+ /* @__PURE__ */ e.jsx("div", { className: "ml-2 truncate text-[11px]", children: ((g = t.node.data) == null ? void 0 : g._name) || t.node.text }),
178
181
  m ? /* @__PURE__ */ e.jsxs(
179
182
  "span",
180
183
  {
@@ -191,169 +194,169 @@ const es = (s) => {
191
194
  }
192
195
  )
193
196
  );
194
- }, ts = (s) => {
197
+ }, Xe = (t) => {
195
198
  var o;
196
- const { item: t } = s.monitorProps;
199
+ const { item: s } = t.monitorProps;
197
200
  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 = 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 })
201
+ /* @__PURE__ */ e.jsx("div", { className: "", children: /* @__PURE__ */ e.jsx(T, { type: (o = s == null ? void 0 : s.data) == null ? void 0 : o._type }) }),
202
+ /* @__PURE__ */ e.jsx("div", { className: "ml-2 truncate text-[11px]", children: s.text })
200
203
  ] });
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-uhj0kGZo.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
- /* @__PURE__ */ e.jsx(ie, {}),
204
+ }, et = (t) => {
205
+ const s = t.depth * 10 + 16;
206
+ 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
+ }, tt = Ge(() => import("./MarkAsGlobalBlock-SPWd6Flk.js")), st = () => {
208
+ const [t] = u(), [, s] = Be();
209
+ return /* @__PURE__ */ e.jsxs(i, { className: "flex items-center gap-x-4 text-xs", onClick: () => s(t), children: [
210
+ /* @__PURE__ */ e.jsx(le, {}),
208
211
  " Cut"
209
212
  ] });
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
- /* @__PURE__ */ e.jsx(xe, {}),
213
+ }, ot = () => {
214
+ const [t] = u(), [, s] = Ce();
215
+ return /* @__PURE__ */ e.jsxs(i, { className: "flex items-center gap-x-4 text-xs", onClick: () => s(t), children: [
216
+ /* @__PURE__ */ e.jsx(ie, {}),
214
217
  " Copy"
215
218
  ] });
216
- }, cs = () => {
217
- const [s] = g(), t = ve(), o = Se();
219
+ }, nt = () => {
220
+ const [t] = u(), s = ve(), o = we();
218
221
  return /* @__PURE__ */ e.jsxs(
219
222
  i,
220
223
  {
221
224
  disabled: (o == null ? void 0 : o._type) === "Slot",
222
225
  className: "flex items-center gap-x-4 text-xs",
223
- onClick: () => t(s),
226
+ onClick: () => s(t),
224
227
  children: [
225
- /* @__PURE__ */ e.jsx(de, {}),
228
+ /* @__PURE__ */ e.jsx(xe, {}),
226
229
  " Remove"
227
230
  ]
228
231
  }
229
232
  );
230
- }, ls = ({
231
- id: s = null,
232
- openMarkAsGlobalModal: t
233
+ }, rt = ({
234
+ id: t = null,
235
+ openMarkAsGlobalModal: s
233
236
  }) => {
234
- const [o] = g(), r = De(), { pasteBlocks: a, canPaste: c } = Te(), x = Ne("globalBlocksSupport", !1), d = Qe(() => {
237
+ const [o] = u(), r = Se(), { pasteBlocks: a, canPaste: c } = Te(), x = De("globalBlocksSupport", !1), d = $e(() => {
235
238
  r(o);
236
239
  }, [o, r]);
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: t, children: /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-x-4", children: [
239
- /* @__PURE__ */ e.jsx(me, {}),
240
+ return /* @__PURE__ */ e.jsxs(Ne, { className: "text-xs", children: [
241
+ 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: [
242
+ /* @__PURE__ */ e.jsx(de, {}),
240
243
  " Mark as global"
241
244
  ] }) }),
242
245
  /* @__PURE__ */ e.jsxs(i, { className: "flex items-center gap-x-4 text-xs", onClick: d, children: [
243
- /* @__PURE__ */ e.jsx(pe, {}),
246
+ /* @__PURE__ */ e.jsx(me, {}),
244
247
  " Duplicate"
245
248
  ] }),
246
- /* @__PURE__ */ e.jsx(rs, {}),
247
- /* @__PURE__ */ e.jsx(as, {}),
249
+ /* @__PURE__ */ e.jsx(st, {}),
250
+ /* @__PURE__ */ e.jsx(ot, {}),
248
251
  /* @__PURE__ */ e.jsxs(
249
252
  i,
250
253
  {
251
254
  className: "flex items-center gap-x-4 text-xs",
252
- onClick: () => a(s),
255
+ onClick: () => a(t),
253
256
  disabled: !c,
254
257
  children: [
255
- /* @__PURE__ */ e.jsx(ue, {}),
258
+ /* @__PURE__ */ e.jsx(pe, {}),
256
259
  " Paste"
257
260
  ]
258
261
  }
259
262
  ),
260
- /* @__PURE__ */ e.jsx(cs, {})
263
+ /* @__PURE__ */ e.jsx(nt, {})
261
264
  ] });
262
- }, is = ({ children: s, id: t = null }) => {
263
- const [o, r] = Ue(!1);
265
+ }, at = ({ children: t, id: s = null }) => {
266
+ const [o, r] = Ke(!1);
264
267
  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(ns, { closeModal: () => r(!1), id: t }) }) }) }),
266
- /* @__PURE__ */ e.jsxs(_e, { children: [
267
- /* @__PURE__ */ e.jsx(Ae, { children: s }),
268
- /* @__PURE__ */ e.jsx(ls, { id: t, openMarkAsGlobalModal: () => r(!0) })
268
+ /* @__PURE__ */ e.jsx(Me, { open: o, onOpenChange: r, children: o && /* @__PURE__ */ e.jsx(Oe, { children: /* @__PURE__ */ e.jsx(Qe, { fallback: /* @__PURE__ */ e.jsx("div", { className: "h-96 w-full animate-pulse bg-gray-200" }), children: /* @__PURE__ */ e.jsx(tt, { closeModal: () => r(!1), id: s }) }) }) }),
269
+ /* @__PURE__ */ e.jsxs(Re, { children: [
270
+ /* @__PURE__ */ e.jsx(_e, { children: t }),
271
+ /* @__PURE__ */ e.jsx(rt, { id: s, openMarkAsGlobalModal: () => r(!0) })
269
272
  ] })
270
273
  ] });
271
274
  };
272
- function xs(s) {
273
- return v(s, (t) => {
274
- const { data: o } = t;
275
+ function ct(t) {
276
+ return w(t, (s) => {
277
+ const { data: o } = s;
275
278
  return {
276
279
  ...o,
277
- _parent: t.parent === 0 ? null : t.parent
280
+ _parent: s.parent === 0 ? null : s.parent
278
281
  };
279
282
  });
280
283
  }
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
- const { dragSource: b, relativeIndex: f, dropTargetId: I, monitor: k } = u;
284
+ const ls = () => {
285
+ const t = Ee(), [s] = Ae(), [o, r, a] = u(), [, c] = He(), { t: x } = fe(), { createSnapshot: d } = Pe(), j = Ye(), m = qe(), g = async (n, p) => {
286
+ const { dragSource: b, relativeIndex: I, dropTargetId: f, monitor: k } = p;
284
287
  if (b) {
285
288
  d();
286
- const R = xs(n);
287
- t(R);
288
- const _ = k.getItem();
289
- r([_.id]);
289
+ const O = ct(n);
290
+ s(O);
291
+ const R = k.getItem();
292
+ r([R.id]);
290
293
  } else
291
- await m({ block: k.getItem(), dropTargetId: I, relativeIndex: f }), p(!1);
292
- }, T = v(s, (n) => ({
294
+ await m({ block: k.getItem(), dropTargetId: f, relativeIndex: I });
295
+ }, l = w(t, (n) => ({
293
296
  id: n._id,
294
297
  text: n._type,
295
298
  parent: n._parent || 0,
296
- droppable: !E(H(s, { _parent: n._id })),
299
+ droppable: !E(A(t, { _parent: n._id })),
297
300
  data: n
298
- })), N = () => {
301
+ })), D = () => {
299
302
  r([]), c([]);
300
- }, [{ isOver: h }, M] = he(() => ({
303
+ }, [{ isOver: h }, N] = je(() => ({
301
304
  accept: ["CHAI_BLOCK"],
302
305
  collect: (n) => ({
303
306
  canDrop: n.canDrop(),
304
307
  isOver: n.isOver()
305
308
  }),
306
309
  drop: (n) => {
307
- (async () => (await m({
310
+ (async () => await m({
308
311
  block: n,
309
312
  dropTargetId: "",
310
313
  relativeIndex: 0
311
- }), p(!1)))();
314
+ }))();
312
315
  }
313
- })), { isDragging: O } = be((n) => ({
316
+ })), { isDragging: M } = he((n) => ({
314
317
  isDragging: n.isDragging()
315
318
  }));
316
319
  return /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsx(
317
320
  "div",
318
321
  {
319
- onClick: () => N(),
322
+ onClick: () => D(),
320
323
  className: S(
321
324
  "-mx-1 -mt-1 flex h-full select-none flex-col space-y-1",
322
- O ? "bg-green-50/80" : "bg-background"
325
+ M ? "bg-green-50/80" : "bg-background"
323
326
  ),
324
- children: P(s) ? /* @__PURE__ */ e.jsxs(
327
+ children: H(t) ? /* @__PURE__ */ e.jsxs(
325
328
  "div",
326
329
  {
327
- ref: M,
330
+ ref: N,
328
331
  className: `mx-1 mt-4 max-w-full h-full p-6 text-center text-sm text-gray-400 ${h ? "bg-blue-200" : ""}`,
329
332
  children: [
330
- h ? /* @__PURE__ */ e.jsx(ge, { className: "mx-auto h-12 w-12 animate-bounce" }) : /* @__PURE__ */ e.jsx(je, { className: "mx-auto h-10 w-10" }),
333
+ h ? /* @__PURE__ */ e.jsx(ue, { className: "mx-auto h-12 w-12 animate-bounce" }) : /* @__PURE__ */ e.jsx(ge, { className: "mx-auto h-10 w-10" }),
331
334
  /* @__PURE__ */ e.jsx("p", { className: "mt-2", children: x(h ? "drop_here_message" : "tree_view_no_blocks") })
332
335
  ]
333
336
  }
334
- ) : /* @__PURE__ */ e.jsx(Ve, { id: "layers-view", className: "no-scrollbar h-full overflow-y-auto p-1", children: /* @__PURE__ */ e.jsx(
337
+ ) : /* @__PURE__ */ e.jsx(Le, { id: "layers-view", className: "no-scrollbar h-full overflow-y-auto p-1", children: /* @__PURE__ */ e.jsx(
335
338
  Ie,
336
339
  {
337
340
  initialOpen: j,
338
341
  extraAcceptTypes: ["CHAI_BLOCK"],
339
- tree: T,
342
+ tree: l,
340
343
  rootId: 0,
341
- render: (n, { depth: u, isOpen: b, onToggle: f }) => /* @__PURE__ */ e.jsx(is, { id: n.id, children: /* @__PURE__ */ e.jsx(
342
- ss,
344
+ render: (n, { depth: p, isOpen: b, onToggle: I }) => /* @__PURE__ */ e.jsx(at, { id: n.id, children: /* @__PURE__ */ e.jsx(
345
+ Je,
343
346
  {
344
- onSelect: (I) => {
345
- c([]), r([I]);
347
+ onSelect: (f) => {
348
+ c([]), r([f]);
346
349
  },
347
- isSelected: L(o, n.id),
350
+ isSelected: P(o, n.id),
348
351
  node: n,
349
- depth: u,
352
+ depth: p,
350
353
  isOpen: b,
351
- onToggle: f,
354
+ onToggle: I,
352
355
  toggleIds: a
353
356
  }
354
357
  ) }),
355
- dragPreviewRender: (n) => /* @__PURE__ */ e.jsx(ts, { monitorProps: n }),
356
- onDrop: l,
358
+ dragPreviewRender: (n) => /* @__PURE__ */ e.jsx(Xe, { monitorProps: n }),
359
+ onDrop: g,
357
360
  classes: {
358
361
  root: "h-full pt-2",
359
362
  draggingSource: "opacity-30",
@@ -362,15 +365,15 @@ const lt = () => {
362
365
  },
363
366
  sort: !1,
364
367
  insertDroppableFirst: !1,
365
- canDrop: Fe,
368
+ canDrop: ze,
366
369
  dropTargetOffset: 2,
367
370
  enableAnimateExpand: !0,
368
- placeholderRender: (n, { depth: u }) => /* @__PURE__ */ e.jsx(os, { node: n, depth: u })
371
+ placeholderRender: (n, { depth: p }) => /* @__PURE__ */ e.jsx(et, { node: n, depth: p })
369
372
  }
370
373
  ) })
371
374
  }
372
375
  ) });
373
376
  };
374
377
  export {
375
- lt as default
378
+ ls as default
376
379
  };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-Z_BpKhVy.cjs"),u=require("lodash-es"),s=require("@radix-ui/react-icons"),q=require("react-dnd"),y=require("@minoru/react-dnd-treeview"),M=require("react-i18next"),r=require("./index-IIJ_o44s.cjs"),N=require("lucide-react"),g=require("react"),O=require("./MODIFIERS-2FeVfZQ9.cjs"),B=require("./Functions-N3yhPYKY.cjs"),_=require("./index-hMoPNZVn.cjs"),A=require("./useAddBlockByDrop-_nd8yZBa.cjs");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("@radix-ui/react-toggle");require("class-variance-authority");require("./utils-PTxFk6qT.cjs");require("clsx");require("tailwind-merge");require("@radix-ui/react-switch");require("@radix-ui/react-slot");require("@radix-ui/react-accordion");require("@radix-ui/react-alert-dialog");require("@radix-ui/react-dialog");require("@radix-ui/react-label");require("@radix-ui/react-scroll-area");require("@radix-ui/react-tabs");require("@radix-ui/react-tooltip");require("@radix-ui/react-popover");require("@radix-ui/react-menubar");require("@radix-ui/react-hover-card");require("@radix-ui/react-select");require("@radix-ui/react-dropdown-menu");require("@radix-ui/react-separator");require("@radix-ui/react-toast");require("cmdk");require("@radix-ui/react-context-menu");require("react-icons-picker");require("react-dom");require("react-quill");require("jotai");require("flat-to-nested");require("redux-undo");require("@chaibuilder/runtime");require("@react-hookz/web");require("i18next");require("@floating-ui/react-dom");require("react-textarea-autosize");require("flagged");require("react-hotkeys-hook");require("sonner");require("./html-to-json-dfALTAdG.cjs");require("himalaya");require("lodash");const C=t=>{switch(t.type){case"Image":return e.jsxRuntimeExports.jsx(s.ImageIcon,{});case"Heading":return e.jsxRuntimeExports.jsx(s.HeadingIcon,{});case"Text":return e.jsxRuntimeExports.jsx(s.TextIcon,{});case"Link":return e.jsxRuntimeExports.jsx(s.Link1Icon,{});case"Video":return e.jsxRuntimeExports.jsx(s.VideoIcon,{});case"RichText":return e.jsxRuntimeExports.jsx(s.CursorTextIcon,{});case"Button":return e.jsxRuntimeExports.jsx(s.ButtonIcon,{});case"CustomHTML":return e.jsxRuntimeExports.jsx(s.CodeIcon,{});case"Divider":return e.jsxRuntimeExports.jsx(s.DividerHorizontalIcon,{});case"Icon":return e.jsxRuntimeExports.jsx(s.SketchLogoIcon,{});case"List":return e.jsxRuntimeExports.jsx(s.RowsIcon,{});case"Paragraph":return e.jsxRuntimeExports.jsx(s.TextIcon,{});case"Row":return e.jsxRuntimeExports.jsx(s.RowsIcon,{});case"ListItem":return e.jsxRuntimeExports.jsx(s.ColumnsIcon,{});case"LineBreak":return e.jsxRuntimeExports.jsx(s.SpaceBetweenVerticallyIcon,{});case"Form":return e.jsxRuntimeExports.jsx(s.GroupIcon,{});case"Checkbox":return e.jsxRuntimeExports.jsx(s.CheckboxIcon,{});case"FormButton":return e.jsxRuntimeExports.jsx(s.ButtonIcon,{});case"Input":case"TextArea":return e.jsxRuntimeExports.jsx(s.InputIcon,{});case"Radio":return e.jsxRuntimeExports.jsx(s.RadiobuttonIcon,{});case"Select":return e.jsxRuntimeExports.jsx(s.DropdownMenuIcon,{});case"Table":return e.jsxRuntimeExports.jsx(s.TableIcon,{});case"TableHead":return e.jsxRuntimeExports.jsx(s.BorderTopIcon,{});case"TableBody":return e.jsxRuntimeExports.jsx(s.BorderAllIcon,{});case"TableRow":return e.jsxRuntimeExports.jsx(s.ViewHorizontalIcon,{});case"TableCell":return e.jsxRuntimeExports.jsx(s.DragHandleHorizontalIcon,{});case"DataProvider":return e.jsxRuntimeExports.jsx(N.DatabaseIcon,{size:16});case"Box":return e.jsxRuntimeExports.jsx(s.BoxIcon,{});default:return e.jsxRuntimeExports.jsx(s.BoxModelIcon,{})}};function P(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 c=new RegExp(/\b(sm|md|lg|xl|2xl):(block|grid|flex|inline|inline-grid|inline-flex|inline-block)\b/),l=t.match(c);if(u.nth(l,1))return`Visible >=${n[u.nth(l,1)]}`}return""}const H=t=>{let n="";return Object.keys(t).forEach(o=>{u.startsWith(t[o],O.STYLES_KEY)&&(n=t[o])}),n},L=t=>{var R;const[,n]=r.useHighlightBlockId(),[o]=r.useHiddenBlockIds(),{isSelected:i}=t,{id:c,data:l}=t.node,d=t.depth*10,p=a=>{a.stopPropagation(),t.onToggle(t.node.id)},E=y.useDragOver(c,t.isOpen,t.onToggle),m=g.useMemo(()=>{const a=H(t.node.data);return P(a)},[t.node.data]);return e.jsxRuntimeExports.jsx("div",{onMouseEnter:()=>n(c),className:B.cn("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)&&t.onSelect(c)},onContextMenu:()=>t.onSelect(c),style:{paddingInlineStart:d},...E,children:e.jsxRuntimeExports.jsxs("div",{className:"flex items-center",children:[e.jsxRuntimeExports.jsx("div",{className:`flex h-4 w-4 rotate-0 transform cursor-pointer items-center justify-center text-xs transition-transform duration-100 ${t.isOpen?"rotate-90":""}`,children:t.node.droppable&&e.jsxRuntimeExports.jsx("button",{onClick:p,type:"button",children:e.jsxRuntimeExports.jsx(s.TriangleRightIcon,{})})}),e.jsxRuntimeExports.jsxs("button",{type:"button",className:"flex items-center",children:[e.jsxRuntimeExports.jsx("div",{className:"-mt-1 h-3 w-3",children:e.jsxRuntimeExports.jsx(C,{type:l==null?void 0:l._type})}),e.jsxRuntimeExports.jsx("div",{className:"ml-2 truncate text-[11px]",children:((R=t.node.data)==null?void 0:R._name)||t.node.text}),m?e.jsxRuntimeExports.jsxs("span",{className:"ml-2 flex items-center text-[10px] italic "+(i?"text-gray-200":"text-gray-500"),children:["(",m,")"]}):null]})]})})},F=t=>{var o;const{item:n}=t.monitorProps;return e.jsxRuntimeExports.jsxs("div",{className:"flex w-max items-center bg-blue-200 bg-opacity-30 p-1 font-semibold text-blue-700",children:[e.jsxRuntimeExports.jsx("div",{className:"",children:e.jsxRuntimeExports.jsx(C,{type:(o=n==null?void 0:n.data)==null?void 0:o._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=g.lazy(()=>Promise.resolve().then(()=>require("./MarkAsGlobalBlock-S2BhHTsK.cjs"))),G=()=>{const[t]=r.useSelectedBlockIds(),[,n]=r.useCutBlockIds();return e.jsxRuntimeExports.jsxs(r.ContextMenuItem,{className:"flex items-center gap-x-4 text-xs",onClick:()=>n(t),children:[e.jsxRuntimeExports.jsx(s.ScissorsIcon,{})," Cut"]})},$=()=>{const[t]=r.useSelectedBlockIds(),[,n]=r.useCopyBlockIds();return e.jsxRuntimeExports.jsxs(r.ContextMenuItem,{className:"flex items-center gap-x-4 text-xs",onClick:()=>n(t),children:[e.jsxRuntimeExports.jsx(s.ClipboardIcon,{})," Copy"]})},K=()=>{const[t]=r.useSelectedBlockIds(),n=r.useRemoveBlocks(),o=r.useSelectedBlock();return e.jsxRuntimeExports.jsxs(r.ContextMenuItem,{disabled:(o==null?void 0:o._type)==="Slot",className:"flex items-center gap-x-4 text-xs",onClick:()=>n(t),children:[e.jsxRuntimeExports.jsx(s.TrashIcon,{})," Remove"]})},Q=({id:t=null,openMarkAsGlobalModal:n})=>{const[o]=r.useSelectedBlockIds(),i=r.useDuplicateBlocks(),{pasteBlocks:c,canPaste:l}=r.usePasteBlocks(),d=r.useBuilderProp("globalBlocksSupport",!1),p=g.useCallback(()=>{i(o)},[o,i]);return e.jsxRuntimeExports.jsxs(r.ContextMenuContent,{className:"text-xs",children:[d&&e.jsxRuntimeExports.jsx(r.ContextMenuItem,{className:"flex items-center gap-x-4 border-b text-xs",onClick:n,children:e.jsxRuntimeExports.jsxs("div",{className:"flex items-center gap-x-4",children:[e.jsxRuntimeExports.jsx(s.GlobeIcon,{})," Mark as global"]})}),e.jsxRuntimeExports.jsxs(r.ContextMenuItem,{className:"flex items-center gap-x-4 text-xs",onClick:p,children:[e.jsxRuntimeExports.jsx(s.CopyIcon,{})," Duplicate"]}),e.jsxRuntimeExports.jsx(G,{}),e.jsxRuntimeExports.jsx($,{}),e.jsxRuntimeExports.jsxs(r.ContextMenuItem,{className:"flex items-center gap-x-4 text-xs",onClick:()=>c(t),disabled:!l,children:[e.jsxRuntimeExports.jsx(s.ClipboardCopyIcon,{})," Paste"]}),e.jsxRuntimeExports.jsx(K,{})]})},U=({children:t,id:n=null})=>{const[o,i]=g.useState(!1);return e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx(r.Dialog,{open:o,onOpenChange:i,children:o&&e.jsxRuntimeExports.jsx(r.DialogContent,{children:e.jsxRuntimeExports.jsx(g.Suspense,{fallback:e.jsxRuntimeExports.jsx("div",{className:"h-96 w-full animate-pulse bg-gray-200"}),children:e.jsxRuntimeExports.jsx(z,{closeModal:()=>i(!1),id:n})})})}),e.jsxRuntimeExports.jsxs(r.ContextMenu,{children:[e.jsxRuntimeExports.jsx(r.ContextMenuTrigger,{children:t}),e.jsxRuntimeExports.jsx(Q,{id:n,openMarkAsGlobalModal:()=>i(!0)})]})]})};function Y(t){return u.map(t,n=>{const{data:o}=n;return{...o,_parent:n.parent===0?null:n.parent}})}const W=()=>{const t=r.useAllBlocks(),[n]=r.useSetAllBlocks(),[o,i,c]=r.useSelectedBlockIds(),[,l]=r.useSelectedStylingBlocks(),{t:d}=M.useTranslation(),{createSnapshot:p}=r.useCanvasHistory(),E=_.useExpandedIds(),m=A.useAddBlockByDrop(),R=async(x,j)=>{const{dragSource:h,relativeIndex:b,dropTargetId:k,monitor:f}=j;if(h){p();const D=Y(x);n(D);const T=f.getItem();i([T.id])}else await m({block:f.getItem(),dropTargetId:k,relativeIndex:b})},a=u.map(t,x=>({id:x._id,text:x._type,parent:x._parent||0,droppable:!u.isUndefined(u.find(t,{_parent:x._id})),data:x})),v=()=>{i([]),l([])},[{isOver:I},S]=q.useDrop(()=>({accept:["CHAI_BLOCK"],collect:x=>({canDrop:x.canDrop(),isOver:x.isOver()}),drop:x=>{(async()=>await m({block:x,dropTargetId:"",relativeIndex:0}))()}})),{isDragging:w}=q.useDragLayer(x=>({isDragging:x.isDragging()}));return e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:e.jsxRuntimeExports.jsx("div",{onClick:()=>v(),className:B.cn("-mx-1 -mt-1 flex h-full select-none flex-col space-y-1",w?"bg-green-50/80":"bg-background"),children:u.isEmpty(t)?e.jsxRuntimeExports.jsxs("div",{ref:S,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(s.DoubleArrowDownIcon,{className:"mx-auto h-12 w-12 animate-bounce"}):e.jsxRuntimeExports.jsx(s.StackIcon,{className:"mx-auto h-10 w-10"}),e.jsxRuntimeExports.jsx("p",{className:"mt-2",children:d(I?"drop_here_message":"tree_view_no_blocks")})]}):e.jsxRuntimeExports.jsx(r.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:a,rootId:0,render:(x,{depth:j,isOpen:h,onToggle:b})=>e.jsxRuntimeExports.jsx(U,{id:x.id,children:e.jsxRuntimeExports.jsx(L,{onSelect:k=>{l([]),i([k])},isSelected:u.includes(o,x.id),node:x,depth:j,isOpen:h,onToggle:b,toggleIds:c})}),dragPreviewRender:x=>e.jsxRuntimeExports.jsx(F,{monitorProps:x}),onDrop:R,classes:{root:"h-full pt-2",draggingSource:"opacity-30",dropTarget:"bg-green-100",placeholder:"relative"},sort:!1,insertDroppableFirst:!1,canDrop:r.canDropBlock,dropTargetOffset:2,enableAnimateExpand:!0,placeholderRender:(x,{depth:j})=>e.jsxRuntimeExports.jsx(V,{node:x,depth:j})})})})})};exports.default=W;
@@ -0,0 +1 @@
1
+ "use strict";const e="#styles:",o="#slots:",t="#i18n",i=["hover","focus","focus-within","focus-visible","active","visited","target","first","last","only","odd","even","first-of-type","last-of-type","only-of-type","empty","disabled","checked","indeterminate","default","required","valid","invalid","in-range","out-of-range","placeholder-shown","autofill","read-only","open","before","after","first-letter","first-line","marker","selection","file","placeholder","ui-open","ui-disabled","ui-active","ui-selected","ui-checked","ui-not-open","ui-not-disabled","ui-not-active","ui-not-selected","ui-not-checked"],n={bodyFont:"Inter",headingFont:"Inter",roundedCorners:5,primaryColor:"#570df8",secondaryColor:"#f002b8",bodyBgDarkColor:"#031022",bodyBgLightColor:"#fcfcfc",bodyTextDarkColor:"#ffffff",bodyTextLightColor:"#000000"};exports.BRANDING_OPTIONS_DEFAULTS=n;exports.I18N_KEY=t;exports.MODIFIERS=i;exports.SLOT_KEY=o;exports.STYLES_KEY=e;
@@ -1,8 +1,4 @@
1
- var t = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
2
- function o(e) {
3
- return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
4
- }
5
- const r = "#styles:", n = "#slots:", a = "#i18n", l = [
1
+ const e = "#styles:", o = "#slots:", t = "#i18n", i = [
6
2
  "hover",
7
3
  "focus",
8
4
  "focus-within",
@@ -51,7 +47,7 @@ const r = "#styles:", n = "#slots:", a = "#i18n", l = [
51
47
  "ui-not-active",
52
48
  "ui-not-selected",
53
49
  "ui-not-checked"
54
- ], i = {
50
+ ], n = {
55
51
  bodyFont: "Inter",
56
52
  headingFont: "Inter",
57
53
  roundedCorners: 5,
@@ -63,11 +59,9 @@ const r = "#styles:", n = "#slots:", a = "#i18n", l = [
63
59
  bodyTextLightColor: "#000000"
64
60
  };
65
61
  export {
66
- i as B,
67
- a as I,
68
- l as M,
69
- n as S,
70
- r as a,
71
- t as c,
72
- o as g
62
+ n as B,
63
+ t as I,
64
+ i as M,
65
+ o as S,
66
+ e as a
73
67
  };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-Z_BpKhVy.cjs"),o=require("react-i18next"),c=require("@radix-ui/react-icons"),x=require("react"),i=require("./index-IIJ_o44s.cjs"),m=require("lodash-es");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("@radix-ui/react-toggle");require("class-variance-authority");require("./utils-PTxFk6qT.cjs");require("./MODIFIERS-2FeVfZQ9.cjs");require("clsx");require("tailwind-merge");require("@radix-ui/react-switch");require("@radix-ui/react-slot");require("@radix-ui/react-accordion");require("@radix-ui/react-alert-dialog");require("@radix-ui/react-dialog");require("@radix-ui/react-label");require("@radix-ui/react-scroll-area");require("@radix-ui/react-tabs");require("@radix-ui/react-tooltip");require("@radix-ui/react-popover");require("@radix-ui/react-menubar");require("@radix-ui/react-hover-card");require("@radix-ui/react-select");require("@radix-ui/react-dropdown-menu");require("@radix-ui/react-separator");require("@radix-ui/react-toast");require("cmdk");require("@radix-ui/react-context-menu");require("react-icons-picker");require("react-dom");require("react-quill");require("jotai");require("flat-to-nested");require("./Functions-N3yhPYKY.cjs");require("redux-undo");require("@chaibuilder/runtime");require("@react-hookz/web");const q=({id:u=null,closeModal:t})=>{const{t:r}=o.useTranslation(),l=i.useMarkAsGlobalBlock(),[s,n]=x.useState("");return e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx("h1",{className:"text-lg font-bold",children:r("mark_as_global")}),e.jsxRuntimeExports.jsxs("div",{className:"py-2 text-sm",children:[r("global_block_note"),e.jsxRuntimeExports.jsx("br",{}),e.jsxRuntimeExports.jsxs("ul",{className:"mt-4 list-inside list-disc space-y-1",children:[e.jsxRuntimeExports.jsxs("li",{children:[r("global_block_indicator")," ",e.jsxRuntimeExports.jsx(c.GlobeIcon,{className:"inline"})]}),e.jsxRuntimeExports.jsx("li",{children:r("global_block_category")})]})]}),e.jsxRuntimeExports.jsxs("div",{className:"my-4",children:[e.jsxRuntimeExports.jsx("label",{className:"block text-sm font-medium text-gray-400",children:r("enter_global_block_name")}),e.jsxRuntimeExports.jsx("input",{placeholder:r("eg_header_footer"),className:"mt-2 w-full",value:s,onChange:a=>n(a.target.value)})]}),e.jsxRuntimeExports.jsxs("div",{className:"flex items-center justify-end gap-x-4",children:[e.jsxRuntimeExports.jsx(i.Button,{onClick:()=>{l(u,m.capitalize(s)),t()},disabled:s.length<=2,variant:"default",children:r("mark_as_global")}),e.jsxRuntimeExports.jsx(i.Button,{variant:"outline",onClick:t,children:r("cancel")})]})]})};exports.default=q;
@@ -1,13 +1,14 @@
1
- import { j as t } from "./jsx-runtime-NV737rRe.js";
1
+ import { j as t } from "./jsx-runtime-WbnYoNE9.js";
2
2
  import { useTranslation as p } from "react-i18next";
3
3
  import { GlobeIcon as n } from "@radix-ui/react-icons";
4
4
  import { useState as c } from "react";
5
- import { $ as d, B as l } from "./index-0OqmBgqo.js";
6
- import { u as x } from "./lodash-3gkdNK5u.js";
7
- import "./MODIFIERS-MLfpKQY1.js";
5
+ import { $ as d, B as l } from "./index-_OgCuSUz.js";
6
+ import { capitalize as x } from "lodash-es";
7
+ import "./_commonjsHelpers-UyOWmZb0.js";
8
8
  import "@radix-ui/react-toggle";
9
9
  import "class-variance-authority";
10
- import "./utils-XsPKXMVo.js";
10
+ import "./utils-AvyFzbPC.js";
11
+ import "./MODIFIERS-RiXS5Mn1.js";
11
12
  import "clsx";
12
13
  import "tailwind-merge";
13
14
  import "@radix-ui/react-switch";
@@ -33,10 +34,11 @@ import "react-dom";
33
34
  import "react-quill";
34
35
  import "jotai";
35
36
  import "flat-to-nested";
37
+ import "./Functions-7jnEwJyw.js";
36
38
  import "redux-undo";
37
39
  import "@chaibuilder/runtime";
38
40
  import "@react-hookz/web";
39
- const Y = ({ id: m = null, closeModal: i }) => {
41
+ const tt = ({ id: m = null, closeModal: i }) => {
40
42
  const { t: o } = p(), e = d(), [r, s] = c("");
41
43
  return /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
42
44
  /* @__PURE__ */ t.jsx("h1", { className: "text-lg font-bold", children: o("mark_as_global") }),
@@ -81,5 +83,5 @@ const Y = ({ id: m = null, closeModal: i }) => {
81
83
  ] });
82
84
  };
83
85
  export {
84
- Y as default
86
+ tt as default
85
87
  };