@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
@@ -4,15 +4,15 @@ var Y = (e, t, n) => (jt(e, typeof t != "symbol" ? t + "" : t, n), n);
4
4
  import { j as r } from "./jsx-runtime-WbnYoNE9.js";
5
5
  import K, { createElement as _e, useCallback as ke, useState as $, useEffect as R, Component as Ye, Children as Tt, Suspense as Ke, useRef as Be, useMemo as Ct } from "react";
6
6
  import { map as re, includes as Oe, toUpper as pe, round as Et, throttle as Je, noop as te, isEmpty as z, first as ae, omit as It, pick as St, get as D, isString as je, memoize as Dt, each as _t, find as Bt, filter as Ve, isNull as Ot, has as At } from "lodash-es";
7
- import { ResetIcon as Ae, MobileIcon as Re, LaptopIcon as Rt, DesktopIcon as Pt, DotsVerticalIcon as Mt, EraserIcon as Lt, ZoomInIcon as Nt, DragHandleDots2Icon as Ft, ArrowUpIcon as $t, CopyIcon as Wt, TrashIcon as Ht } from "@radix-ui/react-icons";
8
- import { m as Ge, B as le, U as Qe, az as Ut, aA as qt, aB as zt, aC as Yt, aD as Kt, M as Te, ab as Jt, i as Ce, aE as Vt, aF as Gt, aG as Qt, aH as Xt, aI as Zt, aJ as en, aK as tn, j as W, ac as J, A as nn, z as rn, C as on, D as sn, E as an, F as ln, G as cn, H as dn, ai as un, N as Xe, ay as ie, aL as pn, X, a4 as fn, aM as Z, s as Ee, l as Ze, h as et, k as tt, a9 as hn, aN as gn, aO as nt, aP as mn, aQ as yn, t as vn, aR as xn, a0 as bn, aS as wn, S as rt } from "./index-QGA4ayU7.js";
7
+ import { ResetIcon as Ae, MobileIcon as Re, LaptopIcon as Rt, DesktopIcon as Pt, DotsVerticalIcon as Mt, EraserIcon as Lt, ZoomInIcon as Nt, DragHandleDots2Icon as Ft, ArrowUpIcon as $t, CopyIcon as Wt, TrashIcon as qt } from "@radix-ui/react-icons";
8
+ import { v as Qe, B as le, V as Ze, aB as Ht, aC as Ut, aD as zt, aE as Yt, aF as Kt, N as Te, ab as Jt, h as Ce, aG as Vt, aH as Qt, aI as Zt, aJ as Gt, aK as Xt, aL as en, aM as tn, r as W, ac as J, A as nn, a as rn, b as on, c as sn, d as an, e as ln, f as cn, g as dn, ai as un, O as Ge, aA as ie, aN as pn, Y as G, a5 as fn, aO as X, E as Ee, t as Xe, q as et, s as tt, z as hn, aP as gn, aQ as nt, aR as mn, aS as yn, F as vn, aT as xn, a1 as bn, aU as wn, S as rt } from "./index-MaXiXghQ.js";
9
9
  import { useTranslation as de } from "react-i18next";
10
10
  import { useAtom as M } from "jotai";
11
11
  import Pe from "react-dom";
12
12
  import { g as kn } from "./_commonjsHelpers-UyOWmZb0.js";
13
- import { r as ot, u as jn, B as Tn, E as Cn } from "./index-nrRnwUaC.js";
13
+ import { r as ot, u as jn, B as Tn, E as Cn } from "./index-eyVVbA05.js";
14
14
  import { Quill as En } from "react-quill";
15
- import { u as In } from "./useAddBlockByDrop-Y-g4O8UC.js";
15
+ import { u as In } from "./useAddBlockByDrop-vGme3brY.js";
16
16
  import { useFeature as st } from "flagged";
17
17
  import { flip as Sn } from "@floating-ui/dom";
18
18
  import { useFloating as Dn, shift as _n } from "@floating-ui/react-dom";
@@ -20,14 +20,14 @@ import { useResizeObserver as Bn } from "@react-hookz/web";
20
20
  import { tailwindcssPaletteGenerator as On } from "@bobthered/tailwindcss-palette-generator";
21
21
  import { Provider as An } from "react-wrap-balancer";
22
22
  import { twMerge as Rn } from "tailwind-merge";
23
- import { S as Me, a as it } from "./MODIFIERS-RiXS5Mn1.js";
23
+ import { S as Me, a as it } from "./MODIFIERS-WQdaNvb8.js";
24
24
  import { getBlockComponent as Pn } from "@chaibuilder/runtime";
25
25
  import "./Functions-7jnEwJyw.js";
26
26
  import "clsx";
27
27
  import "flat-to-nested";
28
28
  import "@radix-ui/react-toggle";
29
29
  import "class-variance-authority";
30
- import "./Class-17XFhL48.js";
30
+ import "./Class-3k8xjeiM.js";
31
31
  import "@radix-ui/react-switch";
32
32
  import "@radix-ui/react-slot";
33
33
  import "@radix-ui/react-accordion";
@@ -52,25 +52,19 @@ import "react-textarea-autosize";
52
52
  import "react-dnd";
53
53
  import "@minoru/react-dnd-treeview";
54
54
  import "react-hotkeys-hook";
55
- import "sonner";
56
- import "./html-to-json-57841sEK.js";
57
- import "himalaya";
58
- import "lucide-react";
59
- import "./web-blocks.js";
60
- import "./empty-slot-5FRrRq1E.js";
61
55
  const Mn = () => {
62
- const { hasUndo: e, hasRedo: t, undo: n, redo: s } = Ge();
56
+ const { hasUndo: e, hasRedo: t, undo: n, redo: s } = Qe();
63
57
  return /* @__PURE__ */ r.jsxs("div", { className: "flex items-center", children: [
64
58
  /* @__PURE__ */ r.jsx(le, { disabled: !e(), size: "sm", onClick: n, className: "rounded-full", variant: "ghost", children: /* @__PURE__ */ r.jsx(Ae, {}) }),
65
59
  /* @__PURE__ */ r.jsx(le, { disabled: !t(), onClick: s, size: "sm", className: "rounded-full", variant: "ghost", children: /* @__PURE__ */ r.jsx(Ae, { className: "rotate-180 scale-y-[-1] transform" }) })
66
60
  ] });
67
61
  };
68
62
  function Ln() {
69
- const [e, t] = Qe(), { t: n } = de();
63
+ const [e, t] = Ze(), { t: n } = de();
70
64
  return /* @__PURE__ */ r.jsxs("div", { className: "flex items-center", children: [
71
- /* @__PURE__ */ r.jsx(Ut, { htmlFor: "dark-mode-switch", children: n("dark_mode") }),
65
+ /* @__PURE__ */ r.jsx(Ht, { htmlFor: "dark-mode-switch", children: n("dark_mode") }),
72
66
  /* @__PURE__ */ r.jsxs(
73
- qt,
67
+ Ut,
74
68
  {
75
69
  id: "dark-mode-switch",
76
70
  checked: e,
@@ -195,10 +189,10 @@ const Le = ({ landscape: e = !1 }) => /* @__PURE__ */ r.jsxs(
195
189
  (o) => /* @__PURE__ */ _e(Ne, { ...o, onClick: t, key: o.breakpoint, currentBreakpoint: e })
196
190
  ),
197
191
  /* @__PURE__ */ r.jsxs(Vt, { children: [
198
- /* @__PURE__ */ r.jsx(Gt, { asChild: !0, children: /* @__PURE__ */ r.jsx("span", { className: "cursor-pointer px-2.5 hover:opacity-80", children: /* @__PURE__ */ r.jsx(Mt, { className: "scale-90 transform" }) }) }),
199
- /* @__PURE__ */ r.jsxs(Qt, { className: "w-56 border-border text-xs", children: [
200
- /* @__PURE__ */ r.jsx(Xt, { children: i("Breakpoints") }),
201
- /* @__PURE__ */ r.jsx(Zt, {}),
192
+ /* @__PURE__ */ r.jsx(Qt, { asChild: !0, children: /* @__PURE__ */ r.jsx("span", { className: "cursor-pointer px-2.5 hover:opacity-80", children: /* @__PURE__ */ r.jsx(Mt, { className: "scale-90 transform" }) }) }),
193
+ /* @__PURE__ */ r.jsxs(Zt, { className: "w-56 border-border text-xs", children: [
194
+ /* @__PURE__ */ r.jsx(Gt, { children: i("Breakpoints") }),
195
+ /* @__PURE__ */ r.jsx(Xt, {}),
202
196
  re(l, (o) => /* @__PURE__ */ r.jsx(
203
197
  en,
204
198
  {
@@ -234,7 +228,7 @@ const Le = ({ landscape: e = !1 }) => /* @__PURE__ */ r.jsxs(
234
228
  ] })
235
229
  ] }) });
236
230
  }, Wn = () => {
237
- const e = Ce("darkMode", !1), [t] = Xe();
231
+ const e = Ce("darkMode", !1), [t] = Ge();
238
232
  return /* @__PURE__ */ r.jsxs("div", { className: "flex h-10 items-center justify-between border-b bg-background/70 px-2", children: [
239
233
  /* @__PURE__ */ r.jsxs("div", { className: "flex h-full space-x-2", children: [
240
234
  e ? /* @__PURE__ */ r.jsxs(r.Fragment, { children: [
@@ -259,12 +253,12 @@ const Le = ({ landscape: e = !1 }) => /* @__PURE__ */ r.jsxs(
259
253
  /* @__PURE__ */ r.jsx($n, {})
260
254
  ] })
261
255
  ] });
262
- }, Hn = `<!doctype html>
256
+ }, qn = `<!doctype html>
263
257
  <html class="scroll-smooth h-full overflow-y-auto">
264
258
  <head>
265
259
  <meta charset="UTF-8">
266
260
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
267
- <script src="https://old.chaibuilder.com/offline/tailwind.cdn.js"><\/script>
261
+ <script src="https://cdn.tailwindcss.com?plugins=forms,typography,aspect-ratio"><\/script>
268
262
  <style>
269
263
  html { height: 100%; overflow:auto; }
270
264
  body { height: 100%; }
@@ -307,8 +301,8 @@ const Le = ({ landscape: e = !1 }) => /* @__PURE__ */ r.jsxs(
307
301
  <div class="frame-root h-full"></div>
308
302
  <script src="https://cdn.jsdelivr.net/npm/quill@2.0.0/dist/quill.js"><\/script>
309
303
  </body>
310
- </html>`, Un = (e) => {
311
- const [t] = Te(), [, n] = Xe(), [s, i] = $({}), l = ke(() => {
304
+ </html>`, Hn = (e) => {
305
+ const [t] = Te(), [, n] = Ge(), [s, i] = $({}), l = ke(() => {
312
306
  const { width: d, height: o } = e;
313
307
  if (d < t) {
314
308
  const c = parseFloat((d / t).toFixed(2).toString());
@@ -339,7 +333,7 @@ object-assign
339
333
  @license MIT
340
334
  */
341
335
  var fe, Fe;
342
- function qn() {
336
+ function Un() {
343
337
  if (Fe)
344
338
  return fe;
345
339
  Fe = 1;
@@ -397,11 +391,11 @@ var ge, We;
397
391
  function at() {
398
392
  return We || (We = 1, ge = Function.call.bind(Object.prototype.hasOwnProperty)), ge;
399
393
  }
400
- var me, He;
394
+ var me, qe;
401
395
  function zn() {
402
- if (He)
396
+ if (qe)
403
397
  return me;
404
- He = 1;
398
+ qe = 1;
405
399
  var e = function() {
406
400
  };
407
401
  if (process.env.NODE_ENV !== "production") {
@@ -447,12 +441,12 @@ function zn() {
447
441
  process.env.NODE_ENV !== "production" && (n = {});
448
442
  }, me = i, me;
449
443
  }
450
- var ye, Ue;
444
+ var ye, He;
451
445
  function Yn() {
452
- if (Ue)
446
+ if (He)
453
447
  return ye;
454
- Ue = 1;
455
- var e = ot, t = qn(), n = Ie(), s = at(), i = zn(), l = function() {
448
+ He = 1;
449
+ var e = ot, t = Un(), n = Ie(), s = at(), i = zn(), l = function() {
456
450
  };
457
451
  process.env.NODE_ENV !== "production" && (l = function(o) {
458
452
  var c = "Warning: " + o;
@@ -481,9 +475,9 @@ function Yn() {
481
475
  object: I("object"),
482
476
  string: I("string"),
483
477
  symbol: I("symbol"),
484
- any: H(),
478
+ any: q(),
485
479
  arrayOf: V,
486
- element: G(),
480
+ element: Q(),
487
481
  elementType: L(),
488
482
  instanceOf: _,
489
483
  node: mt(),
@@ -511,11 +505,11 @@ function Yn() {
511
505
  );
512
506
  throw B.name = "Invariant Violation", B;
513
507
  } else if (process.env.NODE_ENV !== "production" && typeof console < "u") {
514
- var Q = T + ":" + w;
515
- !u[Q] && // Avoid spamming the console because they are often not actionable except for lib authors
508
+ var Z = T + ":" + w;
509
+ !u[Z] && // Avoid spamming the console because they are often not actionable except for lib authors
516
510
  k < 3 && (l(
517
511
  "You are manually calling a React.PropTypes validation function for the `" + C + "` prop on `" + T + "`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."
518
- ), u[Q] = !0, k++);
512
+ ), u[Z] = !0, k++);
519
513
  }
520
514
  }
521
515
  return x[w] == null ? j ? x[w] === null ? new m("The " + E + " `" + C + "` is marked as required " + ("in `" + T + "`, but its value is `null`.")) : new m("The " + E + " `" + C + "` is marked as required in " + ("`" + T + "`, but its value is `undefined`.")) : null : a(x, w, T, E, C);
@@ -525,7 +519,7 @@ function Yn() {
525
519
  }
526
520
  function I(a) {
527
521
  function u(k, b, y, j, x, w) {
528
- var T = k[b], E = U(T);
522
+ var T = k[b], E = H(T);
529
523
  if (E !== a) {
530
524
  var C = ee(T);
531
525
  return new m(
@@ -537,7 +531,7 @@ function Yn() {
537
531
  }
538
532
  return g(u);
539
533
  }
540
- function H() {
534
+ function q() {
541
535
  return g(d);
542
536
  }
543
537
  function V(a) {
@@ -546,7 +540,7 @@ function Yn() {
546
540
  return new m("Property `" + x + "` of component `" + y + "` has invalid PropType notation inside arrayOf.");
547
541
  var w = k[b];
548
542
  if (!Array.isArray(w)) {
549
- var T = U(w);
543
+ var T = H(w);
550
544
  return new m("Invalid " + j + " `" + x + "` of type " + ("`" + T + "` supplied to `" + y + "`, expected an array."));
551
545
  }
552
546
  for (var E = 0; E < w.length; E++) {
@@ -558,11 +552,11 @@ function Yn() {
558
552
  }
559
553
  return g(u);
560
554
  }
561
- function G() {
555
+ function Q() {
562
556
  function a(u, k, b, y, j) {
563
557
  var x = u[k];
564
558
  if (!o(x)) {
565
- var w = U(x);
559
+ var w = H(x);
566
560
  return new m("Invalid " + y + " `" + j + "` of type " + ("`" + w + "` supplied to `" + b + "`, expected a single ReactElement."));
567
561
  }
568
562
  return null;
@@ -573,7 +567,7 @@ function Yn() {
573
567
  function a(u, k, b, y, j) {
574
568
  var x = u[k];
575
569
  if (!e.isValidElementType(x)) {
576
- var w = U(x);
570
+ var w = H(x);
577
571
  return new m("Invalid " + y + " `" + j + "` of type " + ("`" + w + "` supplied to `" + b + "`, expected a single ReactElement type."));
578
572
  }
579
573
  return null;
@@ -600,8 +594,8 @@ function Yn() {
600
594
  if (O(w, a[T]))
601
595
  return null;
602
596
  var E = JSON.stringify(a, function(P, B) {
603
- var Q = ee(B);
604
- return Q === "symbol" ? String(B) : B;
597
+ var Z = ee(B);
598
+ return Z === "symbol" ? String(B) : B;
605
599
  });
606
600
  return new m("Invalid " + j + " `" + x + "` of value `" + String(w) + "` " + ("supplied to `" + y + "`, expected one of " + E + "."));
607
601
  }
@@ -611,7 +605,7 @@ function Yn() {
611
605
  function u(k, b, y, j, x) {
612
606
  if (typeof a != "function")
613
607
  return new m("Property `" + x + "` of component `" + y + "` has invalid PropType notation inside objectOf.");
614
- var w = k[b], T = U(w);
608
+ var w = k[b], T = H(w);
615
609
  if (T !== "object")
616
610
  return new m("Invalid " + j + " `" + x + "` of type " + ("`" + T + "` supplied to `" + y + "`, expected an object."));
617
611
  for (var E in w)
@@ -641,8 +635,8 @@ function Yn() {
641
635
  return null;
642
636
  B.data && s(B.data, "expectedType") && E.push(B.data.expectedType);
643
637
  }
644
- var Q = E.length > 0 ? ", expected one of type [" + E.join(", ") + "]" : "";
645
- return new m("Invalid " + w + " `" + T + "` supplied to " + ("`" + x + "`" + Q + "."));
638
+ var Z = E.length > 0 ? ", expected one of type [" + E.join(", ") + "]" : "";
639
+ return new m("Invalid " + w + " `" + T + "` supplied to " + ("`" + x + "`" + Z + "."));
646
640
  }
647
641
  return g(b);
648
642
  }
@@ -659,7 +653,7 @@ function Yn() {
659
653
  }
660
654
  function yt(a) {
661
655
  function u(k, b, y, j, x) {
662
- var w = k[b], T = U(w);
656
+ var w = k[b], T = H(w);
663
657
  if (T !== "object")
664
658
  return new m("Invalid " + j + " `" + x + "` of type `" + T + "` " + ("supplied to `" + y + "`, expected `object`."));
665
659
  for (var E in a) {
@@ -676,7 +670,7 @@ function Yn() {
676
670
  }
677
671
  function vt(a) {
678
672
  function u(k, b, y, j, x) {
679
- var w = k[b], T = U(w);
673
+ var w = k[b], T = H(w);
680
674
  if (T !== "object")
681
675
  return new m("Invalid " + j + " `" + x + "` of type `" + T + "` " + ("supplied to `" + y + "`, expected `object`."));
682
676
  var E = t({}, k[b], a);
@@ -733,14 +727,14 @@ Valid keys: ` + JSON.stringify(Object.keys(a), null, " ")
733
727
  function xt(a, u) {
734
728
  return a === "symbol" ? !0 : u ? u["@@toStringTag"] === "Symbol" || typeof Symbol == "function" && u instanceof Symbol : !1;
735
729
  }
736
- function U(a) {
730
+ function H(a) {
737
731
  var u = typeof a;
738
732
  return Array.isArray(a) ? "array" : a instanceof RegExp ? "object" : xt(u, a) ? "symbol" : u;
739
733
  }
740
734
  function ee(a) {
741
735
  if (typeof a > "u" || a === null)
742
736
  return "" + a;
743
- var u = U(a);
737
+ var u = H(a);
744
738
  if (u === "object") {
745
739
  if (a instanceof Date)
746
740
  return "date";
@@ -769,11 +763,11 @@ Valid keys: ` + JSON.stringify(Object.keys(a), null, " ")
769
763
  return S.checkPropTypes = i, S.resetWarningCache = i.resetWarningCache, S.PropTypes = S, S;
770
764
  }, ye;
771
765
  }
772
- var ve, qe;
766
+ var ve, Ue;
773
767
  function Kn() {
774
- if (qe)
768
+ if (Ue)
775
769
  return ve;
776
- qe = 1;
770
+ Ue = 1;
777
771
  var e = Ie();
778
772
  function t() {
779
773
  }
@@ -818,18 +812,18 @@ function Kn() {
818
812
  return l.PropTypes = l, l;
819
813
  }, ve;
820
814
  }
821
- var Io = ce.exports;
815
+ var wo = ce.exports;
822
816
  if (process.env.NODE_ENV !== "production") {
823
817
  var Jn = ot, Vn = !0;
824
818
  ce.exports = Yn()(Jn.isElement, Vn);
825
819
  } else
826
820
  ce.exports = Kn()();
827
- var Gn = ce.exports;
828
- const A = /* @__PURE__ */ kn(Gn);
821
+ var Qn = ce.exports;
822
+ const A = /* @__PURE__ */ kn(Qn);
829
823
  let lt, ct;
830
824
  typeof document < "u" && (lt = document);
831
825
  typeof window < "u" && (ct = window);
832
- const dt = K.createContext({ document: lt, window: ct }), ue = () => K.useContext(dt), { Provider: Qn, Consumer: So } = dt;
826
+ const dt = K.createContext({ document: lt, window: ct }), ue = () => K.useContext(dt), { Provider: Zn, Consumer: ko } = dt;
833
827
  class ut extends Ye {
834
828
  componentDidMount() {
835
829
  this.props.contentDidMount();
@@ -883,7 +877,7 @@ class be extends Ye {
883
877
  const n = this.getDoc();
884
878
  if (!n)
885
879
  return null;
886
- const s = this.props.contentDidMount, i = this.props.contentDidUpdate, l = n.defaultView || n.parentView, d = /* @__PURE__ */ r.jsx(ut, { contentDidMount: s, contentDidUpdate: i, children: /* @__PURE__ */ r.jsx(Qn, { value: { document: n, window: l }, children: /* @__PURE__ */ r.jsx("div", { className: "frame-content", children: this.props.children }) }) }), o = this.getMountTarget();
880
+ const s = this.props.contentDidMount, i = this.props.contentDidUpdate, l = n.defaultView || n.parentView, d = /* @__PURE__ */ r.jsx(ut, { contentDidMount: s, contentDidUpdate: i, children: /* @__PURE__ */ r.jsx(Zn, { value: { document: n, window: l }, children: /* @__PURE__ */ r.jsx("div", { className: "frame-content", children: this.props.children }) }) }), o = this.getMountTarget();
887
881
  return [Pe.createPortal(this.props.head, this.getDoc().head), Pe.createPortal(d, o)];
888
882
  }
889
883
  render() {
@@ -920,16 +914,16 @@ Y(be, "propTypes", {
920
914
  },
921
915
  initialContent: '<!DOCTYPE html><html><head></head><body><div class="frame-root"></div></body></html>'
922
916
  });
923
- const Xn = K.forwardRef((e, t) => /* @__PURE__ */ r.jsx(be, { ...e, forwardedRef: t }));
924
- let q = null, oe = [], ne = null, pt = null;
925
- function Zn(e) {
917
+ const Gn = K.forwardRef((e, t) => /* @__PURE__ */ r.jsx(be, { ...e, forwardedRef: t }));
918
+ let U = null, oe = [], ne = null, pt = null;
919
+ function Xn(e) {
926
920
  const t = window.getComputedStyle(e), n = parseInt(t.paddingLeft, 10), s = parseInt(t.paddingTop, 10), i = parseInt(t.paddingRight, 10), l = parseInt(t.paddingBottom, 10);
927
921
  return { paddingLeft: n, paddingTop: s, paddingRight: i, paddingBottom: l };
928
922
  }
929
923
  const ze = (e, t, n) => {
930
- if (!q)
924
+ if (!U)
931
925
  return;
932
- const s = e.getBoundingClientRect(), i = q == null ? void 0 : q.getElementById("placeholder"), { paddingLeft: l, paddingTop: d, paddingRight: o, paddingBottom: c } = Zn(e);
926
+ const s = e.getBoundingClientRect(), i = U == null ? void 0 : U.getElementById("placeholder"), { paddingLeft: l, paddingTop: d, paddingRight: o, paddingBottom: c } = Xn(e);
933
927
  i.style.width = t === "vertical" ? s.width - l - o + "px" : "2px", i.style.height = t === "vertical" ? "2px" : s.height - d - c + "px", i.style.display = "block";
934
928
  const p = oe.reduce(
935
929
  (f, h) => Math.abs(h - n) < Math.abs(f - n) ? h : f
@@ -971,12 +965,12 @@ const tr = Je((e) => {
971
965
  e.preventDefault(), e.stopPropagation(), tr(e);
972
966
  };
973
967
  function xe() {
974
- const e = q == null ? void 0 : q.getElementById("placeholder");
968
+ const e = U == null ? void 0 : U.getElementById("placeholder");
975
969
  e.style.display = "none";
976
970
  }
977
971
  const rr = () => {
978
- const { document: e } = ue(), [t, n] = M(pn), s = In(), i = st("dnd"), [, l] = X(), [, d] = W();
979
- return q = e, {
972
+ const { document: e } = ue(), [t, n] = M(pn), s = In(), i = st("dnd"), [, l] = G(), [, d] = W();
973
+ return U = e, {
980
974
  isDragging: t,
981
975
  "data-dnd": "branch",
982
976
  onDragOver: i ? nr : te,
@@ -1012,7 +1006,7 @@ function or(e) {
1012
1006
  t && t.parentNode.removeChild(t), e = null;
1013
1007
  }
1014
1008
  const sr = () => {
1015
- const e = ["Heading", "Paragraph", "Text", "Link", "Span", "Button"], t = fn(), [, n] = X(), [s, i] = M(Z);
1009
+ const e = ["Heading", "Paragraph", "Text", "Link", "Span", "Button"], t = fn(), [, n] = G(), [s, i] = M(X);
1016
1010
  return (l) => {
1017
1011
  var h;
1018
1012
  if (s)
@@ -1032,7 +1026,7 @@ const sr = () => {
1032
1026
  c.addEventListener("blur", f, !0), p.focus(), (h = c.querySelector(".ql-clipboard")) == null || h.remove(), i(d.getAttribute("data-block-id"));
1033
1027
  };
1034
1028
  }, ir = () => {
1035
- const [, e] = J(), [, t] = W(), [n] = M(Z);
1029
+ const [, e] = J(), [, t] = W(), [n] = M(X);
1036
1030
  return (s) => {
1037
1031
  if (n)
1038
1032
  return;
@@ -1048,7 +1042,7 @@ const sr = () => {
1048
1042
  const n = Se(e.target);
1049
1043
  n != null && n.getAttribute("data-style-id") && t(n.getAttribute("data-style-id"));
1050
1044
  }, 100), lr = () => {
1051
- const [, e] = X(), [t] = M(Z);
1045
+ const [, e] = G(), [t] = M(X);
1052
1046
  return (n) => {
1053
1047
  t || ar(n, e);
1054
1048
  };
@@ -1083,7 +1077,7 @@ const sr = () => {
1083
1077
  }
1084
1078
  );
1085
1079
  }, ht = (e, t) => e.querySelector(`[data-block-id="${t}"]`), dr = () => {
1086
- const { window: e } = ue(), [t, n] = W(), [s] = Ee(), [, i] = J(), { undo: l, redo: d } = Ge(), o = Ze(), [, c] = et(), p = tt(), { savePage: f } = hn(), [h] = M(Z), [, v] = M(gn), S = (m) => {
1080
+ const { window: e } = ue(), [t, n] = W(), [s] = Ee(), [, i] = J(), { undo: l, redo: d } = Qe(), o = Xe(), [, c] = et(), p = tt(), { savePage: f } = hn(), [h] = M(X), [, v] = M(gn), S = (m) => {
1087
1081
  m.key === "Enter" && (m.preventDefault(), t.length === 1 && v(ae(t)));
1088
1082
  }, O = (m) => {
1089
1083
  const g = s.find((I) => I._id === m);
@@ -1114,7 +1108,7 @@ const sr = () => {
1114
1108
  };
1115
1109
  }, [t, n, l, p, c, d, o, h, f, e]), null;
1116
1110
  }, ur = ({ block: e, label: t }) => {
1117
- const [, n] = W(), [, s] = X(), [, i] = M(nt), l = st("dnd");
1111
+ const [, n] = W(), [, s] = G(), [, i] = M(nt), l = st("dnd");
1118
1112
  return /* @__PURE__ */ r.jsxs(
1119
1113
  "div",
1120
1114
  {
@@ -1132,7 +1126,7 @@ const sr = () => {
1132
1126
  }
1133
1127
  );
1134
1128
  }, pr = ({ selectedBlockElement: e, block: t }) => {
1135
- const n = tt(), s = Ze(), [, i] = W(), [, l] = J(), [d] = M(Z), { floatingStyles: o, refs: c, update: p } = Dn({
1129
+ const n = tt(), s = Xe(), [, i] = W(), [, l] = J(), [d] = M(X), { floatingStyles: o, refs: c, update: p } = Dn({
1136
1130
  placement: "top-start",
1137
1131
  middleware: [_n(), Sn()],
1138
1132
  elements: {
@@ -1166,13 +1160,13 @@ const sr = () => {
1166
1160
  }
1167
1161
  ),
1168
1162
  mn(D(t, "_type", "")) ? /* @__PURE__ */ r.jsx(Wt, { className: "hover:scale-105", onClick: () => s([t == null ? void 0 : t._id]) }) : null,
1169
- yn(D(t, "_type", "")) ? /* @__PURE__ */ r.jsx(Ht, { className: "hover:scale-105", onClick: () => n([t == null ? void 0 : t._id]) }) : null
1163
+ yn(D(t, "_type", "")) ? /* @__PURE__ */ r.jsx(qt, { className: "hover:scale-105", onClick: () => n([t == null ? void 0 : t._id]) }) : null
1170
1164
  ] })
1171
1165
  ]
1172
1166
  }
1173
1167
  );
1174
1168
  }, fr = ({ model: e }) => {
1175
- const [t] = vn(), [n] = W(), [s] = Qe(), [i] = X(), [l] = J(), [d] = M(nt), { document: o, window: c } = ue(), [p] = $(o == null ? void 0 : o.getElementById("highlighted-block")), [f] = $(
1169
+ const [t] = vn(), [n] = W(), [s] = Ze(), [i] = G(), [l] = J(), [d] = M(nt), { document: o, window: c } = ue(), [p] = $(o == null ? void 0 : o.getElementById("highlighted-block")), [f] = $(
1176
1170
  o == null ? void 0 : o.getElementById("selected-block")
1177
1171
  ), [h] = $(
1178
1172
  o == null ? void 0 : o.getElementById("selected-styling-block")
@@ -1187,7 +1181,7 @@ const sr = () => {
1187
1181
  names: ["primary", "secondary"]
1188
1182
  });
1189
1183
  I.primary.DEFAULT = m, I.secondary.DEFAULT = g;
1190
- const H = D(t, "roundedCorners", "0");
1184
+ const q = D(t, "roundedCorners", "0");
1191
1185
  !c || !c.tailwind || (c.tailwind.config = {
1192
1186
  darkMode: "class",
1193
1187
  theme: {
@@ -1197,19 +1191,19 @@ const sr = () => {
1197
1191
  },
1198
1192
  extend: {
1199
1193
  borderRadius: {
1200
- global: `${H || "0"}px`
1194
+ global: `${q || "0"}px`
1201
1195
  },
1202
1196
  colors: I
1203
1197
  }
1204
1198
  },
1205
1199
  plugins: [
1206
1200
  // @ts-ignore
1207
- c.tailwind.plugin.withOptions(({ prefix: V = "ui" } = {}) => ({ addVariant: G }) => {
1201
+ c.tailwind.plugin.withOptions(({ prefix: V = "ui" } = {}) => ({ addVariant: Q }) => {
1208
1202
  for (const L of ["open", "checked", "selected", "active", "disabled"])
1209
- G(`${V}-${L}`, [
1203
+ Q(`${V}-${L}`, [
1210
1204
  `&[data-headlessui-state~="${L}"]`,
1211
1205
  `:where([data-headlessui-state~="${L}"]) &`
1212
- ]), G(`${V}-not-${L}`, [
1206
+ ]), Q(`${V}-not-${L}`, [
1213
1207
  `&[data-headlessui-state]:not([data-headlessui-state~="${L}"])`,
1214
1208
  `:where([data-headlessui-state]:not([data-headlessui-state~="${L}"])) &:not([data-headlessui-state])`
1215
1209
  ]);
@@ -1233,8 +1227,8 @@ const sr = () => {
1233
1227
  outline: 1px solid #42a1fc !important; outline-offset: -1px;
1234
1228
  }`);
1235
1229
  }, [l, h]), R(() => {
1236
- const m = D(t, "bodyTextLightColor", "#64748b"), g = D(t, "bodyTextDarkColor", "#94a3b8"), I = D(t, "bodyBgLightColor", "#FFFFFF"), H = D(t, "bodyBgDarkColor", "#0f172a");
1237
- o.body.className = `font-body antialiased text-[${m}] bg-[${I}] dark:text-[${g}] dark:bg-[${H}]`;
1230
+ const m = D(t, "bodyTextLightColor", "#64748b"), g = D(t, "bodyTextDarkColor", "#94a3b8"), I = D(t, "bodyBgLightColor", "#FFFFFF"), q = D(t, "bodyBgDarkColor", "#0f172a");
1231
+ o.body.className = `font-body antialiased text-[${m}] bg-[${I}] dark:text-[${g}] dark:bg-[${q}]`;
1238
1232
  }, [t, o, e]), e === "page" ? /* @__PURE__ */ r.jsxs(r.Fragment, { children: [
1239
1233
  S && /* @__PURE__ */ r.jsx(
1240
1234
  "link",
@@ -1298,7 +1292,7 @@ function vr(e, t) {
1298
1292
  }), e);
1299
1293
  }
1300
1294
  function we({ blocks: e }) {
1301
- const [t] = Ee(), n = ke((l) => yr(l), []), [s] = jn(), [i] = M(Z);
1295
+ const [t] = Ee(), n = ke((l) => yr(l), []), [s] = jn(), [i] = M(X);
1302
1296
  return /* @__PURE__ */ r.jsx(r.Fragment, { children: K.Children.toArray(
1303
1297
  e.map((l, d) => {
1304
1298
  if (i === l._id)
@@ -1331,12 +1325,12 @@ const xr = () => {
1331
1325
  const [e] = Ee(), t = z(e) ? null : /* @__PURE__ */ r.jsx(Tn, { children: /* @__PURE__ */ r.jsx(we, { blocks: Ve(e, (n) => z(n._parent)) }) });
1332
1326
  return /* @__PURE__ */ r.jsx(An, { children: t });
1333
1327
  }, br = (e, t) => e.querySelector(`[data-style-id="${t}"]`), wr = () => {
1334
- const [e] = M(xn), [t] = et(), [n] = Te(), [, s] = W(), i = bn(), [, l] = X(), d = Be(null), o = Be(null), [c, p] = $({ width: 0, height: 0 }), f = Un(c), [h, v] = $(0), [S, O] = $([]), [, m] = $([]), [, g] = M(wn), [I, H] = J(), V = Ce("loadingCanvas", !1);
1328
+ const [e] = M(xn), [t] = et(), [n] = Te(), [, s] = W(), i = bn(), [, l] = G(), d = Be(null), o = Be(null), [c, p] = $({ width: 0, height: 0 }), f = Hn(c), [h, v] = $(0), [S, O] = $([]), [, m] = $([]), [, g] = M(wn), [I, q] = J(), V = Ce("loading", !1);
1335
1329
  R(() => {
1336
1330
  const { clientWidth: _, clientHeight: N } = o.current;
1337
1331
  p({ width: _, height: N }), h === 0 && v(_);
1338
1332
  }, [o, n, h]);
1339
- const G = (_, N = 0) => {
1333
+ const Q = (_, N = 0) => {
1340
1334
  const { top: F } = _.getBoundingClientRect();
1341
1335
  return F + N >= 0 && F - N <= window.innerHeight;
1342
1336
  };
@@ -1344,7 +1338,7 @@ const xr = () => {
1344
1338
  var _, N;
1345
1339
  if (i && i.type !== "Multiple" && d.current) {
1346
1340
  const F = ht(d.current.contentDocument, i._id);
1347
- F && (G(F) || (N = (_ = d.current) == null ? void 0 : _.contentWindow) == null || N.scrollTo({ top: F.offsetTop, behavior: "smooth" }), O([F]));
1341
+ F && (Q(F) || (N = (_ = d.current) == null ? void 0 : _.contentWindow) == null || N.scrollTo({ top: F.offsetTop, behavior: "smooth" }), O([F]));
1348
1342
  }
1349
1343
  }, [i]), R(() => {
1350
1344
  if (!z(I) && d.current) {
@@ -1357,7 +1351,7 @@ const xr = () => {
1357
1351
  m([null]);
1358
1352
  }, [I]);
1359
1353
  const L = Ct(() => {
1360
- let _ = Hn;
1354
+ let _ = qn;
1361
1355
  return e === "offline" && (_ = _.replace(
1362
1356
  "https://old.chaibuilder.com/offline/tailwind.cdn.js",
1363
1357
  "/offline/tailwind.cdn.js"
@@ -1367,14 +1361,14 @@ const xr = () => {
1367
1361
  "div",
1368
1362
  {
1369
1363
  onClick: () => {
1370
- s([]), H([]);
1364
+ s([]), q([]);
1371
1365
  },
1372
1366
  onMouseLeave: () => setTimeout(() => l(""), 300),
1373
- className: "relative mx-auto overflow-hidden h-full w-full",
1367
+ className: "relative mx-auto h-full w-full overflow-hidden",
1374
1368
  style: h > 0 && !z(f) ? { width: t ? "100%" : h } : {},
1375
1369
  ref: o,
1376
1370
  children: /* @__PURE__ */ r.jsxs(
1377
- Xn,
1371
+ Gn,
1378
1372
  {
1379
1373
  contentDidMount: () => g(d.current),
1380
1374
  ref: d,
@@ -1394,16 +1388,16 @@ const xr = () => {
1394
1388
  /* @__PURE__ */ r.jsx(fr, { model: "page" }),
1395
1389
  /* @__PURE__ */ r.jsx(cr, { children: V ? /* @__PURE__ */ r.jsx("div", { className: "h-full p-4", children: /* @__PURE__ */ r.jsx(rt, { className: "h-full" }) }) : /* @__PURE__ */ r.jsx(xr, {}) }),
1396
1390
  /* @__PURE__ */ r.jsx("br", {}),
1397
- /* @__PURE__ */ r.jsx("div", { id: "placeholder", className: "absolute bg-green-500 z-[99999] max-w-full transition-transform" })
1391
+ /* @__PURE__ */ r.jsx("div", { id: "placeholder", className: "absolute z-[99999] max-w-full bg-green-500 transition-transform" })
1398
1392
  ]
1399
1393
  }
1400
1394
  )
1401
1395
  }
1402
1396
  );
1403
- }, Do = () => /* @__PURE__ */ r.jsxs("div", { className: "flex h-full w-full flex-col", children: [
1397
+ }, jo = () => /* @__PURE__ */ r.jsxs("div", { className: "flex h-full w-full flex-col", children: [
1404
1398
  /* @__PURE__ */ r.jsx(Wn, {}),
1405
1399
  /* @__PURE__ */ r.jsx("div", { className: "relative h-full overflow-hidden bg-slate-800/90 bg-[linear-gradient(to_right,#222_0.5px,transparent_0.5px),linear-gradient(to_bottom,#222_0.5px,transparent_0.5px)] bg-[size:12px_12px] px-2", children: /* @__PURE__ */ r.jsx(Ke, { fallback: /* @__PURE__ */ r.jsx(rt, { className: "h-full" }), children: /* @__PURE__ */ r.jsx(Cn, { children: /* @__PURE__ */ r.jsx(wr, {}) }) }) })
1406
1400
  ] });
1407
1401
  export {
1408
- Do as default
1402
+ jo as default
1409
1403
  };