@chaibuilder/sdk 1.0.13 → 1.0.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (168) hide show
  1. package/dist/{AddBlocks-H7BZYHUC.js → AddBlocks-eoo1CzaK.js} +114 -111
  2. package/dist/AddBlocks-jU0NwP_s.cjs +3 -0
  3. package/dist/BrandingOptions-WSCFnWAf.cjs +1 -0
  4. package/dist/{BrandingOptions-PAgY-kvj.js → BrandingOptions-_Og7VUHA.js} +57 -41
  5. package/dist/{CanvasArea-zn2ox-5h.js → CanvasArea-cky_d2Lu.js} +517 -519
  6. package/dist/CanvasArea-hT9uHhkz.cjs +46 -0
  7. package/dist/Class-RZuPYbUS.cjs +1 -0
  8. package/dist/{Class-l7qYbuoN.js → Class-nQk08vqd.js} +204 -124
  9. package/dist/{CurrentPage-6Jp4xAWK.js → CurrentPage--OlBwyNE.js} +58 -40
  10. package/dist/CurrentPage-x6Ez11gP.cjs +1 -0
  11. package/dist/Layers-gEA0qWYP.cjs +1 -0
  12. package/dist/{Layers-WkZ48AUm.js → Layers-uzA3QA-4.js} +158 -141
  13. package/dist/MarkAsGlobalBlock-lYL8cO9x.cjs +1 -0
  14. package/dist/MarkAsGlobalBlock-ySc-D4SB.js +84 -0
  15. package/dist/PagesPanel-5t0bV9T2.cjs +1 -0
  16. package/dist/PagesPanel-tH6c9Mnv.js +70 -0
  17. package/dist/ProjectPanel-NdrR6a8t.cjs +1 -0
  18. package/dist/ProjectPanel-Q2-15-In.js +91 -0
  19. package/dist/Settings-DBiwm1hY.cjs +1 -0
  20. package/dist/{Settings-fH8fZKpm.js → Settings-LOqpvQ_1.js} +411 -408
  21. package/dist/SidePanels-8JWYXGqN.cjs +1 -0
  22. package/dist/{SidePanels-w8ZHKJaR.js → SidePanels-F7ccs2Xf.js} +106 -88
  23. package/dist/{Topbar-hm1D_5sb.js → Topbar-lX9OMPwj.js} +47 -45
  24. package/dist/Topbar-qi5ab8rR.cjs +1 -0
  25. package/dist/UnsplashImages-a2r7b3kB.cjs +1 -0
  26. package/dist/{UnsplashImages-gPcBLjgB.js → UnsplashImages-u_QTABzi.js} +56 -44
  27. package/dist/{UploadImages-_ZyUU66E.js → UploadImages-gV5xDHIu.js} +55 -34
  28. package/dist/UploadImages-jLQgLujd.cjs +1 -0
  29. package/dist/add-page-modal-U5ramelz.js +110 -0
  30. package/dist/add-page-modal-tIt3N8jH.cjs +1 -0
  31. package/dist/confirm-alert-ZQ-sxX0X.js +58 -0
  32. package/dist/confirm-alert-z74-fGOT.cjs +1 -0
  33. package/dist/core.cjs +1 -1
  34. package/dist/core.js +99 -124
  35. package/dist/delete-page-modal-5XuSfQT0.cjs +1 -0
  36. package/dist/delete-page-modal-_E87bVUZ.js +89 -0
  37. package/dist/form-Osm1AmO5.cjs +1 -0
  38. package/dist/{form-dVpOAyRl.js → form-zZJyZuNH.js} +12 -12
  39. package/dist/index-2EHcmZqL.js +2947 -0
  40. package/dist/index-RVm8Txnj.js +1149 -0
  41. package/dist/index-_jFEo7h5.cjs +206 -0
  42. package/dist/index-c8zW_D2V.cjs +1 -0
  43. package/dist/index-cU5eyVRU.js +40872 -0
  44. package/dist/index-fwo4wa7u.cjs +1 -0
  45. package/dist/index-gmZcUXyn.js +25 -0
  46. package/dist/index-m2muA80V.cjs +9 -0
  47. package/dist/{jsx-runtime-JYMCiFoE.cjs → jsx-runtime-WKRPbKtm.cjs} +7 -7
  48. package/dist/{jsx-runtime-Sp0orL4X.js → jsx-runtime-qAwJ85SY.js} +109 -106
  49. package/dist/lib.cjs +2 -1
  50. package/dist/lib.js +1333 -71
  51. package/dist/page-viewer-BSc-5M4B.cjs +1 -0
  52. package/dist/{page-viewer-Y4YiaZ_m.js → page-viewer-nLqIs_9w.js} +62 -44
  53. package/dist/project-general-setting-14MA_cX5.cjs +1 -0
  54. package/dist/{project-general-setting-U4S_KlhU.js → project-general-setting-kXh5myAr.js} +46 -36
  55. package/dist/project-seo-setting-POGPEJZ8.cjs +1 -0
  56. package/dist/project-seo-setting-nT1qo1Bb.js +89 -0
  57. package/dist/render.cjs +1 -1
  58. package/dist/render.js +23 -19
  59. package/dist/server.cjs +1 -1
  60. package/dist/server.js +1 -1
  61. package/dist/single-page-detail-EgQd9TSA.cjs +1 -0
  62. package/dist/{single-page-detail-pAxCy_Pe.js → single-page-detail-fV-A6vJR.js} +90 -80
  63. package/dist/studio.cjs +1 -1
  64. package/dist/studio.js +45 -25
  65. package/dist/ui.cjs +1 -1
  66. package/dist/ui.js +156 -357
  67. package/package.json +1 -1
  68. package/dist/AddBlocks-7ACJv8LW.cjs +0 -3
  69. package/dist/BrandingOptions-5j-XszLM.cjs +0 -1
  70. package/dist/CanvasArea-Dnm-yeus.cjs +0 -46
  71. package/dist/ChaiBuilderEditor-BoE-sArB.cjs +0 -163
  72. package/dist/ChaiBuilderEditor-hEuUONQ3.js +0 -27094
  73. package/dist/Class-_uCzl5v1.cjs +0 -1
  74. package/dist/CurrentPage-YMpqOqx7.cjs +0 -1
  75. package/dist/ImagesPanel-6us7hiLN.cjs +0 -1
  76. package/dist/ImagesPanel-oaHOD-Ex.js +0 -27
  77. package/dist/Layers-EzOZdWvd.cjs +0 -1
  78. package/dist/MODIFIERS-DsEzQ3aH.js +0 -73
  79. package/dist/MODIFIERS-Fx6WAZcw.cjs +0 -1
  80. package/dist/MarkAsGlobalBlock-0HubcRkY.js +0 -77
  81. package/dist/MarkAsGlobalBlock-HmeIyLCP.cjs +0 -1
  82. package/dist/PagesPanel-6JuwBLFQ.js +0 -50
  83. package/dist/PagesPanel-zJq8p1ja.cjs +0 -1
  84. package/dist/ProjectPanel-Zml2F8b9.cjs +0 -1
  85. package/dist/ProjectPanel-cu2QSDW9.js +0 -73
  86. package/dist/Settings-lc9PfnmG.cjs +0 -1
  87. package/dist/SidePanels-VH72zFE2.cjs +0 -1
  88. package/dist/Topbar-vQPo9xSY.cjs +0 -1
  89. package/dist/UnsplashImages-BoBBSi1a.cjs +0 -1
  90. package/dist/UploadImages-T6kW0s3G.cjs +0 -1
  91. package/dist/accordion-oPUeqPCZ.js +0 -42
  92. package/dist/accordion-ynvFtV_p.cjs +0 -1
  93. package/dist/add-page-modal--qZSwJuB.cjs +0 -1
  94. package/dist/add-page-modal-bj7qbZuK.js +0 -99
  95. package/dist/alert-dialog-GNfnpqFB.js +0 -64
  96. package/dist/alert-dialog-Mv0-wAvS.cjs +0 -1
  97. package/dist/command-ThdTuUxt.cjs +0 -1
  98. package/dist/command-VHca6CcN.js +0 -97
  99. package/dist/confirm-alert-8EHe0OOd.cjs +0 -1
  100. package/dist/confirm-alert-b0e_BLhF.js +0 -36
  101. package/dist/context-menu-8dC9uGXj.js +0 -122
  102. package/dist/context-menu-IgLbIuth.cjs +0 -1
  103. package/dist/controls-Ni5kEzLz.js +0 -103
  104. package/dist/controls-W97-POR_.cjs +0 -1
  105. package/dist/controls-enQY7NI8.js +0 -118
  106. package/dist/controls-xUKa23ic.cjs +0 -1
  107. package/dist/delete-page-modal-2LuDLEiP.cjs +0 -1
  108. package/dist/delete-page-modal-cnrR8tWH.js +0 -69
  109. package/dist/dialog-S_QbL1iq.cjs +0 -1
  110. package/dist/dialog-jrw9DF1f.js +0 -65
  111. package/dist/dropdown-menu-S03K_fNs.js +0 -164
  112. package/dist/dropdown-menu-sMXR59cB.cjs +0 -1
  113. package/dist/form-nRAvKPQj.cjs +0 -1
  114. package/dist/functions-nNTuSTsR.js +0 -1106
  115. package/dist/functions-pcUZhFJM.js +0 -12
  116. package/dist/functions-sCuB7nvZ.cjs +0 -2
  117. package/dist/functions-uw7QP2kT.cjs +0 -1
  118. package/dist/html-to-json-P6GpbcQX.cjs +0 -1
  119. package/dist/html-to-json-pdHQfRkN.js +0 -178
  120. package/dist/index-HAue58ea.cjs +0 -1
  121. package/dist/index-T4_wfKl5.js +0 -2256
  122. package/dist/index-X9ZgD09V.cjs +0 -1
  123. package/dist/index-ehKdBRUK.js +0 -18
  124. package/dist/label-KaP7MRrs.js +0 -10
  125. package/dist/label-tFm8HZdb.cjs +0 -1
  126. package/dist/link-6o6n2Tnd.js +0 -204
  127. package/dist/link-ece8dZGH.cjs +0 -1
  128. package/dist/page-viewer-IARz6OSp.cjs +0 -1
  129. package/dist/popover-a84pbVhQ.js +0 -23
  130. package/dist/popover-fKjgcRUx.cjs +0 -1
  131. package/dist/project-general-setting-eSl3t-VH.cjs +0 -1
  132. package/dist/project-seo-setting-Ga9v_ECU.js +0 -67
  133. package/dist/project-seo-setting-rankm1z3.cjs +0 -1
  134. package/dist/scroll-area-FiHvy-TZ.cjs +0 -1
  135. package/dist/scroll-area-ewXbxc3n.js +0 -30
  136. package/dist/select-7bjg-rr9.cjs +0 -1
  137. package/dist/select-POGdEDHT.js +0 -75
  138. package/dist/separator-3Civ-6hb.cjs +0 -1
  139. package/dist/separator-SctTn0Qi.js +0 -18
  140. package/dist/single-page-detail-yPgnu2AI.cjs +0 -1
  141. package/dist/skeleton-CU_FIbg3.js +0 -239
  142. package/dist/skeleton-JHP9zwL2.cjs +0 -1
  143. package/dist/tabs-Gb9v5dVb.js +0 -46
  144. package/dist/tabs-iWeaaVrg.cjs +0 -1
  145. package/dist/textarea-1kZEh7ki.cjs +0 -1
  146. package/dist/textarea-b2QvVhrK.js +0 -73
  147. package/dist/toggle-ASJRAaGP.js +0 -30
  148. package/dist/toggle-ehNIPmme.cjs +0 -1
  149. package/dist/useAddBlock-WJc3OgG8.js +0 -86
  150. package/dist/useAddBlock-dCKRFPRU.cjs +0 -1
  151. package/dist/useAllBlocks-6hvuNuyw.cjs +0 -1
  152. package/dist/useAllBlocks-PQKYvs-e.js +0 -20
  153. package/dist/useChaiExternalData-4K9WxANa.js +0 -6
  154. package/dist/useChaiExternalData-DkyBJ81C.cjs +0 -1
  155. package/dist/useDarkMode-ZKCO_gkt.js +0 -23
  156. package/dist/useDarkMode-dV6FM6l-.cjs +0 -1
  157. package/dist/useFeatureSupport-OLwNgEZb.js +0 -16
  158. package/dist/useFeatureSupport-c9IgPW2t.cjs +0 -1
  159. package/dist/useHiddenBlocks-3MsGOJ1s.js +0 -15
  160. package/dist/useHiddenBlocks-oJuQDmTy.cjs +0 -1
  161. package/dist/useLanguage-NKKKaxVM.cjs +0 -1
  162. package/dist/useLanguage-gVC5rxO5.js +0 -216
  163. package/dist/useMarkAsGlobalBlock-X73Vny8u.js +0 -25
  164. package/dist/useMarkAsGlobalBlock-ebBVGHg4.cjs +0 -1
  165. package/dist/useUiLibraries-4hPOi8DI.js +0 -12
  166. package/dist/useUiLibraries-9FhQCpKo.cjs +0 -1
  167. package/dist/utils-dze1SGvB.js +0 -6
  168. package/dist/utils-qK_SjzzV.cjs +0 -1
@@ -1,64 +1,67 @@
1
- import { j as e } from "./jsx-runtime-Sp0orL4X.js";
2
- import v, { createElement as K, useState as j, useMemo as q, useCallback as V, useEffect as Q, Suspense as W } from "react";
3
- import { has as R, first as b, filter as w, values as k, groupBy as I, mergeWith as $, isArray as H, get as J, map as L, isEmpty as T, find as M, uniq as X, includes as P, reject as E } from "lodash";
1
+ import { j as e } from "./jsx-runtime-qAwJ85SY.js";
2
+ import B, { createElement as K, useState as j, useCallback as q, useMemo as V, useEffect as W, Suspense as J } from "react";
3
+ import { has as z, first as g, isEmpty as w, filter as k, values as v, groupBy as I, mergeWith as Q, isArray as H, get as X, map as L, includes as P, find as E, uniq as Y, reject as M } from "lodash";
4
4
  import { useAtom as h } from "jotai";
5
- import { A as Y, a as Z, b as ee, c as se } from "./accordion-oPUeqPCZ.js";
6
- import { S as re } from "./scroll-area-ewXbxc3n.js";
7
- import { T as oe, a as te, b as A } from "./tabs-Gb9v5dVb.js";
8
- import { T as le, a as ae, c as ce, u as ie, B as ne, S as de } from "./skeleton-CU_FIbg3.js";
9
- import { useDrag as _, DragPreviewImage as O } from "react-dnd";
10
- import { BoxIcon as me, ExclamationTriangleIcon as ue, Cross1Icon as pe } from "@radix-ui/react-icons";
11
- import { l as C, w as z, x as B, P as xe, Q as he } from "./ChaiBuilderEditor-hEuUONQ3.js";
12
- import { u as F } from "./useAddBlock-WJc3OgG8.js";
13
- import "react-i18next";
14
- import { P as G, C as U } from "./index-ehKdBRUK.js";
15
- import { u as D } from "./useUiLibraries-4hPOi8DI.js";
16
- import { Loader as fe } from "lucide-react";
17
- import { c as ge } from "./utils-dze1SGvB.js";
18
- import { u as be } from "./useAllBlocks-PQKYvs-e.js";
19
- import { C as je, c as ye, e as we, f as ke, g as Te, T as ve, d as Ce, A as Be, a as Ne } from "./textarea-b2QvVhrK.js";
20
- import { L as Ae } from "./label-KaP7MRrs.js";
21
- import { g as Ie } from "./html-to-json-pdHQfRkN.js";
5
+ import { O as F, j as C, az as O, aA as N, aH as Z, aI as $, aK as ee, i as se, a8 as R, bv as re, bw as te, bx as oe, by as le, bz as ae, bA as ie, aM as ce, bB as ne, bC as de, B as me, bD as pe, bE as ue, bF as xe, ae as he, aB as fe, aC as be, aD as A, bp as ge, bi as je, bj as ye, bk as we, bl as ke, S as ve } from "./index-2EHcmZqL.js";
6
+ import { useDrag as _, DragPreviewImage as D } from "react-dnd";
7
+ import { BoxIcon as Be, ExclamationTriangleIcon as Ce, Cross1Icon as Ne } from "@radix-ui/react-icons";
8
+ import { P as G, C as U } from "./index-gmZcUXyn.js";
9
+ import { Loader as Te } from "lucide-react";
10
+ import { getBlocksFromHTML as Ae } from "./lib.js";
11
+ import { b as Ie } from "./Class-nQk08vqd.js";
12
+ import "@radix-ui/react-toggle";
13
+ import "class-variance-authority";
14
+ import "@radix-ui/react-switch";
15
+ import "@radix-ui/react-slot";
22
16
  import "@radix-ui/react-accordion";
17
+ import "@radix-ui/react-alert-dialog";
18
+ import "@radix-ui/react-dialog";
19
+ import "@radix-ui/react-label";
23
20
  import "@radix-ui/react-scroll-area";
24
21
  import "@radix-ui/react-tabs";
25
- import "@radix-ui/react-slot";
26
- import "class-variance-authority";
27
22
  import "@radix-ui/react-tooltip";
23
+ import "@radix-ui/react-popover";
24
+ import "@radix-ui/react-menubar";
25
+ import "@radix-ui/react-hover-card";
26
+ import "@radix-ui/react-select";
27
+ import "@radix-ui/react-dropdown-menu";
28
+ import "@radix-ui/react-separator";
28
29
  import "@radix-ui/react-toast";
29
- import "./MODIFIERS-DsEzQ3aH.js";
30
- import "clsx";
30
+ import "cmdk";
31
+ import "@radix-ui/react-context-menu";
32
+ import "react-icons-picker";
31
33
  import "react-dom";
32
- import "@floating-ui/react-dom";
33
- import "i18next";
34
- import "flagged";
35
- import "@minoru/react-dnd-treeview";
36
- import "react-hotkeys-hook";
34
+ import "react-quill";
37
35
  import "flat-to-nested";
38
- import "./functions-pcUZhFJM.js";
39
36
  import "redux-undo";
40
37
  import "@react-hookz/web";
41
- import "./controls-Ni5kEzLz.js";
42
- import "tailwind-merge";
43
- import "@radix-ui/react-label";
38
+ import "react-i18next";
44
39
  import "himalaya";
40
+ import "@mhsdesign/jit-browser-tailwindcss";
41
+ import "@bobthered/tailwindcss-palette-generator";
42
+ import "@tailwindcss/forms";
43
+ import "@tailwindcss/typography";
44
+ import "@tailwindcss/aspect-ratio";
45
+ import "@tailwindcss/line-clamp";
46
+ import "clsx";
47
+ import "tailwind-merge";
45
48
  const Le = ({ block: s }) => {
46
- const { type: r, icon: o, label: a } = s, { addCoreBlock: i, addPredefinedBlock: d } = F(), [m] = C(), [, n] = h(z), [, t] = h(B), f = () => {
47
- R(s, "blocks") ? d(G(s.blocks), b(m)) : i(s, b(m)), t(!1), n("layers");
48
- }, [, x, u] = _(() => ({
49
+ const { type: r, icon: t, label: a } = s, { addCoreBlock: c, addPredefinedBlock: d } = F(), [m] = C(), [, n] = h(O), [, o] = h(N), f = () => {
50
+ z(s, "blocks") ? d(G(s.blocks), g(m)) : c(s, g(m)), o(!1), n("layers");
51
+ }, [, x, p] = _(() => ({
49
52
  type: "CHAI_BLOCK",
50
53
  item: s
51
54
  }));
52
55
  return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
53
56
  /* @__PURE__ */ e.jsx(
54
- O,
57
+ D,
55
58
  {
56
- connect: u,
59
+ connect: p,
57
60
  src: "https://placehold.co/100x30/000000/FFF?text=" + (a || r).replace(/ /g, "+")
58
61
  }
59
62
  ),
60
- /* @__PURE__ */ e.jsxs(le, { children: [
61
- /* @__PURE__ */ e.jsx(ae, { asChild: !0, children: /* @__PURE__ */ e.jsxs(
63
+ /* @__PURE__ */ e.jsxs(Z, { children: [
64
+ /* @__PURE__ */ e.jsx($, { asChild: !0, children: /* @__PURE__ */ e.jsxs(
62
65
  "button",
63
66
  {
64
67
  onClick: f,
@@ -66,52 +69,52 @@ const Le = ({ block: s }) => {
66
69
  ref: x,
67
70
  className: "cursor-grab space-y-2 rounded-lg border border-border p-3 text-center hover:bg-slate-300/50",
68
71
  children: [
69
- K(o || me, { className: "w-4 h-4 mx-auto" }),
72
+ K(t || Be, { className: "w-4 h-4 mx-auto" }),
70
73
  /* @__PURE__ */ e.jsx("p", { className: "truncate text-xs", children: a || r })
71
74
  ]
72
75
  }
73
76
  ) }),
74
- /* @__PURE__ */ e.jsx(ce, { children: /* @__PURE__ */ e.jsx("p", { children: a || r }) })
77
+ /* @__PURE__ */ e.jsx(ee, { children: /* @__PURE__ */ e.jsx("p", { children: a || r }) })
75
78
  ] })
76
79
  ] });
77
80
  }, Pe = ({ block: s, closePopover: r }) => {
78
- var u;
79
- const [o, a] = j(!1), i = ie("getExternalPredefinedBlock"), { addCoreBlock: d, addPredefinedBlock: m } = F(), [n] = C(), [, t, f] = _(
81
+ var p;
82
+ const [t, a] = j(!1), c = se("getExternalPredefinedBlock"), { addCoreBlock: d, addPredefinedBlock: m } = F(), [n] = C(), [, o, f] = _(
80
83
  () => ({
81
84
  type: "CHAI_BLOCK",
82
85
  item: s
83
86
  }),
84
87
  [s]
85
- ), x = V(
86
- async (g) => {
87
- if (g.stopPropagation(), R(s, "component")) {
88
- d(s, b(n)), r();
88
+ ), x = q(
89
+ async (b) => {
90
+ if (b.stopPropagation(), z(s, "component")) {
91
+ d(s, g(n)), r();
89
92
  return;
90
93
  }
91
94
  a(!0);
92
- const l = await i(s);
93
- T(l) || m(G(l), b(n)), r();
95
+ const l = await c(s);
96
+ w(l) || m(G(l), g(n)), r();
94
97
  },
95
98
  [s]
96
99
  );
97
100
  return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
98
101
  /* @__PURE__ */ e.jsx(
99
- O,
102
+ D,
100
103
  {
101
104
  connect: f,
102
- src: "https://placehold.co/100x30/000000/FFF?text=" + ((u = s.name || s.label) == null ? void 0 : u.replace(" ", "+"))
105
+ src: "https://placehold.co/100x30/000000/FFF?text=" + ((p = s.name || s.label) == null ? void 0 : p.replace(" ", "+"))
103
106
  }
104
107
  ),
105
108
  /* @__PURE__ */ e.jsxs(
106
109
  "div",
107
110
  {
108
- ref: t,
109
- onClick: o ? () => {
111
+ ref: o,
112
+ onClick: t ? () => {
110
113
  } : x,
111
114
  className: "relative cursor-grab overflow-hidden rounded-md border border-transparent duration-200 hover:scale-x-105 hover:border-foreground/20 hover:shadow-2xl",
112
115
  children: [
113
- o && /* @__PURE__ */ e.jsxs("div", { className: "absolute flex h-full w-full items-center justify-center bg-black bg-opacity-70", children: [
114
- /* @__PURE__ */ e.jsx(fe, { className: "animate-spin", size: 15, color: "white" }),
116
+ t && /* @__PURE__ */ e.jsxs("div", { className: "absolute flex h-full w-full items-center justify-center bg-black bg-opacity-70", children: [
117
+ /* @__PURE__ */ e.jsx(Te, { className: "animate-spin", size: 15, color: "white" }),
115
118
  " ",
116
119
  /* @__PURE__ */ e.jsx("span", { className: "pl-2 text-sm text-white", children: "Adding..." })
117
120
  ] }),
@@ -121,10 +124,10 @@ const Le = ({ block: s }) => {
121
124
  )
122
125
  ] });
123
126
  }, Fe = () => {
124
- const { data: s, isLoading: r } = D(), o = U(), a = w(k(o), { category: "custom" }), i = I(a, "group"), d = I(s, "group"), [m, n] = j(null), t = q(() => $(i, d, (l, p) => {
125
- if (H(l) && H(p))
126
- return [...l, ...p];
127
- }), [i, d]), [, f] = h(B), [x, u] = j("Navbar"), g = J(t, x, []);
127
+ const { data: s, isLoading: r } = R(), t = U(), a = k(v(t), { category: "custom" }), c = I(a, "group"), d = I(s, "group"), [m, n] = j(null), o = V(() => Q(c, d, (l, u) => {
128
+ if (H(l) && H(u))
129
+ return [...l, ...u];
130
+ }), [c, d]), [, f] = h(N), [x, p] = j("Navbar"), b = X(o, x, []);
128
131
  return /* @__PURE__ */ e.jsxs("div", { className: "relative flex h-full max-h-full overflow-hidden py-2", children: [
129
132
  /* @__PURE__ */ e.jsx("ul", { className: "sticky top-0 h-full w-48 space-y-1 overflow-y-auto border-r px-2", children: r ? /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
130
133
  /* @__PURE__ */ e.jsx("li", { className: "h-8 w-full animate-pulse bg-gray-200" }),
@@ -133,8 +136,8 @@ const Le = ({ block: s }) => {
133
136
  /* @__PURE__ */ e.jsx("li", { className: "mt-2 h-8 w-full animate-pulse bg-gray-200" }),
134
137
  /* @__PURE__ */ e.jsx("li", { className: "mt-2 h-8 w-full animate-pulse bg-gray-200" }),
135
138
  /* @__PURE__ */ e.jsx("li", { className: "mt-2 h-8 w-full animate-pulse bg-gray-200" })
136
- ] }) : v.Children.toArray(
137
- L(t, (l, p) => /* @__PURE__ */ e.jsx(
139
+ ] }) : B.Children.toArray(
140
+ L(o, (l, u) => /* @__PURE__ */ e.jsx(
138
141
  "li",
139
142
  {
140
143
  onMouseOut: () => {
@@ -142,43 +145,43 @@ const Le = ({ block: s }) => {
142
145
  },
143
146
  onMouseEnter: () => {
144
147
  const y = setTimeout(() => {
145
- u(p);
148
+ p(u);
146
149
  }, 300);
147
150
  n(y);
148
151
  },
149
- onClick: () => u(p),
150
- className: ge(
152
+ onClick: () => p(u),
153
+ className: Ie(
151
154
  "-mx-2 cursor-default rounded-md rounded-r-none px-2 py-1 text-sm font-medium capitalize",
152
- x === p ? "bg-blue-500 text-white" : " text-gray-700 hover:bg-foreground/10"
155
+ x === u ? "bg-blue-500 text-white" : " text-gray-700 hover:bg-foreground/10"
153
156
  ),
154
- children: p
157
+ children: u
155
158
  }
156
159
  ))
157
160
  ) }),
158
- /* @__PURE__ */ e.jsx("div", { className: "h-full w-full space-y-2 overflow-y-auto px-8", children: v.Children.toArray(
159
- g.map((l) => /* @__PURE__ */ e.jsx(Pe, { block: l, closePopover: () => f(!1) }))
161
+ /* @__PURE__ */ e.jsx("div", { className: "h-full w-full space-y-2 overflow-y-auto px-8", children: B.Children.toArray(
162
+ b.map((l) => /* @__PURE__ */ e.jsx(Pe, { block: l, closePopover: () => f(!1) }))
160
163
  ) })
161
164
  ] });
162
165
  }, He = () => {
163
- const [s, r] = j(""), { addPredefinedBlock: o } = F(), [a] = C(), [, i] = h(xe), [, d] = h(z), [, m] = h(B), n = () => {
164
- const t = Ie(s);
165
- o([...t], b(a) || null), r(""), i(!1), d("layers"), m(!1);
166
+ const [s, r] = j(""), { addPredefinedBlock: t } = F(), [a] = C(), [, c] = h(re), [, d] = h(O), [, m] = h(N), n = () => {
167
+ const o = Ae(s);
168
+ t([...o], g(a) || null), r(""), c(!1), d("layers"), m(!1);
166
169
  };
167
- return /* @__PURE__ */ e.jsxs(je, { className: "border-border/0 p-0 shadow-none", children: [
168
- /* @__PURE__ */ e.jsxs(ye, { className: "p-3", children: [
169
- /* @__PURE__ */ e.jsx(we, { children: "Import HTML" }),
170
- /* @__PURE__ */ e.jsx(ke, { children: "Use HTML snippets from component libraries like Tailwind UI, Flowbite, Preline, Kitwind, Tailblocks etc. or just copy paste your own HTML code. Only Tailwind CSS markup is supported." })
170
+ return /* @__PURE__ */ e.jsxs(te, { className: "border-border/0 p-0 shadow-none", children: [
171
+ /* @__PURE__ */ e.jsxs(oe, { className: "p-3", children: [
172
+ /* @__PURE__ */ e.jsx(le, { children: "Import HTML" }),
173
+ /* @__PURE__ */ e.jsx(ae, { children: "Use HTML snippets from component libraries like Tailwind UI, Flowbite, Preline, Kitwind, Tailblocks etc. or just copy paste your own HTML code. Only Tailwind CSS markup is supported." })
171
174
  ] }),
172
- /* @__PURE__ */ e.jsx(Te, { className: "space-y-2 px-3 py-0", children: /* @__PURE__ */ e.jsxs("div", { className: "space-y-1", children: [
173
- /* @__PURE__ */ e.jsx(Ae, { htmlFor: "current", className: "text-sm", children: "Enter HTML Code:" }),
175
+ /* @__PURE__ */ e.jsx(ie, { className: "space-y-2 px-3 py-0", children: /* @__PURE__ */ e.jsxs("div", { className: "space-y-1", children: [
176
+ /* @__PURE__ */ e.jsx(ce, { htmlFor: "current", className: "text-sm", children: "Enter HTML Code:" }),
174
177
  /* @__PURE__ */ e.jsx(
175
- ve,
178
+ ne,
176
179
  {
177
180
  autoFocus: !0,
178
181
  tabIndex: 1,
179
- ref: (t) => t && t.focus(),
182
+ ref: (o) => o && o.focus(),
180
183
  defaultValue: s,
181
- onChange: (t) => r(t.target.value),
184
+ onChange: (o) => r(o.target.value),
182
185
  rows: 12,
183
186
  placeholder: `<div>
184
187
  <h1>Enter code here</h1>
@@ -187,28 +190,28 @@ const Le = ({ block: s }) => {
187
190
  }
188
191
  )
189
192
  ] }) }),
190
- /* @__PURE__ */ e.jsxs(Ce, { className: "flex flex-col justify-end p-3", children: [
191
- /* @__PURE__ */ e.jsx(ne, { disabled: s.trim() === "", onClick: () => n(), size: "sm", className: "w-full", children: "Import" }),
192
- /* @__PURE__ */ e.jsxs(Be, { variant: "default", className: "mt-2 p-1 text-blue-400", children: [
193
- /* @__PURE__ */ e.jsx(ue, { className: "h-4 w-4" }),
194
- /* @__PURE__ */ e.jsx(Ne, { className: "text-sm leading-4", children: "Imported html will be added to the currently selected block. If no block is selected, the html will be added to the page." })
193
+ /* @__PURE__ */ e.jsxs(de, { className: "flex flex-col justify-end p-3", children: [
194
+ /* @__PURE__ */ e.jsx(me, { disabled: s.trim() === "", onClick: () => n(), size: "sm", className: "w-full", children: "Import" }),
195
+ /* @__PURE__ */ e.jsxs(pe, { variant: "default", className: "mt-2 p-1 text-blue-400", children: [
196
+ /* @__PURE__ */ e.jsx(Ce, { className: "h-4 w-4" }),
197
+ /* @__PURE__ */ e.jsx(ue, { className: "text-sm leading-4", children: "Imported html will be added to the currently selected block. If no block is selected, the html will be added to the page." })
195
198
  ] })
196
199
  ] })
197
200
  ] });
198
- }, Me = He, S = ["ListItem", "TableHead", "TableBody", "TableRow", "TableCell", "Column"], Ee = (s, r) => {
201
+ }, S = ["ListItem", "TableHead", "TableBody", "TableRow", "TableCell", "Column"], Ee = (s, r) => {
199
202
  if (!s)
200
203
  return !P(S, r);
201
- const o = s._type;
202
- return o === "List" ? r === "ListItem" : o === "Table" ? r === "TableHead" || r === "TableBody" : o === "TableHead" || o === "TableBody" ? r === "TableRow" : o === "TableRow" ? r === "TableCell" : o === "Row" ? r === "Column" : !P(S, r);
203
- }, Bs = () => {
204
- const [s, r] = j("core"), [o, a] = j("basic"), i = U(), [, d] = h(he), [, m] = h(B), [n] = C(), t = be(), f = M(t, { _id: b(n) }), { data: x, isLoading: u } = D(), g = I(
205
- w(i, (c) => Ee(f, c.type)),
204
+ const t = s._type;
205
+ return t === "List" ? r === "ListItem" : t === "Table" ? r === "TableHead" || r === "TableBody" : t === "TableHead" || t === "TableBody" ? r === "TableRow" : t === "TableRow" ? r === "TableCell" : t === "Row" ? r === "Column" : !P(S, r);
206
+ }, As = () => {
207
+ const [s, r] = j("core"), [t, a] = j("basic"), c = U(), [, d] = h(xe), [, m] = h(N), [n] = C(), o = he(), f = E(o, { _id: g(n) }), { data: x, isLoading: p } = R(), b = I(
208
+ k(c, (i) => Ee(f, i.type)),
206
209
  "category"
207
- ), l = X(L(g.core, "group"));
208
- Q(() => {
209
- !P(l, o) && !T(l) && !T(o) && a(b(l));
210
- }, [l, o]);
211
- const p = (c) => a((N) => N === c ? "" : c), y = !u && !T(x) || M(k(i), { category: "custom" }) !== void 0;
210
+ ), l = Y(L(b.core, "group"));
211
+ W(() => {
212
+ !P(l, t) && !w(l) && !w(t) && a(g(l));
213
+ }, [l, t]);
214
+ const u = (i) => a((T) => T === i ? "" : i), y = !p && !w(x) || E(v(c), { category: "custom" }) !== void 0;
212
215
  return /* @__PURE__ */ e.jsxs("div", { className: "flex h-full flex-col overflow-hidden", children: [
213
216
  /* @__PURE__ */ e.jsxs("div", { className: "mb-2 flex justify-between rounded-md bg-background/30 p-1", children: [
214
217
  /* @__PURE__ */ e.jsxs("h1", { className: "flex flex-col items-baseline px-1 text-2xl font-semibold xl:flex-row", children: [
@@ -221,44 +224,44 @@ const Le = ({ block: s }) => {
221
224
  onClick: () => m(!1),
222
225
  className: "flex h-max items-center gap-x-1 rounded-full border p-px text-xs text-gray-800 hover:bg-gray-100 md:p-2",
223
226
  children: [
224
- /* @__PURE__ */ e.jsx(pe, { width: 12 }),
227
+ /* @__PURE__ */ e.jsx(Ne, { width: 12 }),
225
228
  " Close"
226
229
  ]
227
230
  }
228
231
  )
229
232
  ] }),
230
233
  /* @__PURE__ */ e.jsx(
231
- oe,
234
+ fe,
232
235
  {
233
- onValueChange: (c) => {
234
- d(""), r(c);
236
+ onValueChange: (i) => {
237
+ d(""), r(i);
235
238
  },
236
239
  value: s,
237
240
  className: "h-max",
238
- children: /* @__PURE__ */ e.jsxs(te, { className: "grid w-full " + (y ? "grid-cols-3" : "grid-cols-2"), children: [
241
+ children: /* @__PURE__ */ e.jsxs(be, { className: "grid w-full " + (y ? "grid-cols-3" : "grid-cols-2"), children: [
239
242
  /* @__PURE__ */ e.jsx(A, { value: "core", children: "Core" }),
240
243
  y ? /* @__PURE__ */ e.jsx(A, { value: "ui-blocks", children: "UI Blocks" }) : null,
241
244
  /* @__PURE__ */ e.jsx(A, { value: "html", children: "Import" })
242
245
  ] })
243
246
  }
244
247
  ),
245
- s === "core" && /* @__PURE__ */ e.jsx(re, { className: "-mx-1.5 h-full", children: /* @__PURE__ */ e.jsx(Y, { type: "single", value: o, className: "w-full px-3", children: v.Children.toArray(
248
+ s === "core" && /* @__PURE__ */ e.jsx(ge, { className: "-mx-1.5 h-full", children: /* @__PURE__ */ e.jsx(je, { type: "single", value: t, className: "w-full px-3", children: B.Children.toArray(
246
249
  L(
247
250
  l,
248
- (c) => E(w(k(g.core), { group: c }), {
251
+ (i) => M(k(v(b.core), { group: i }), {
249
252
  hidden: !0
250
- }).length ? /* @__PURE__ */ e.jsxs(Z, { value: c, className: "border-border", children: [
251
- /* @__PURE__ */ e.jsx(ee, { onClick: () => p(c), className: "py-2 capitalize", children: c }),
252
- /* @__PURE__ */ e.jsx(se, { children: /* @__PURE__ */ e.jsx("div", { className: "grid grid-cols-4 gap-2", children: v.Children.toArray(
253
- E(w(k(g.core), { group: c }), { hidden: !0 }).map((N) => /* @__PURE__ */ e.jsx(Le, { block: N }))
253
+ }).length ? /* @__PURE__ */ e.jsxs(ye, { value: i, className: "border-border", children: [
254
+ /* @__PURE__ */ e.jsx(we, { onClick: () => u(i), className: "py-2 capitalize", children: i }),
255
+ /* @__PURE__ */ e.jsx(ke, { children: /* @__PURE__ */ e.jsx("div", { className: "grid grid-cols-4 gap-2", children: B.Children.toArray(
256
+ M(k(v(b.core), { group: i }), { hidden: !0 }).map((T) => /* @__PURE__ */ e.jsx(Le, { block: T }))
254
257
  ) }) })
255
258
  ] }) : null
256
259
  )
257
260
  ) }) }),
258
- s === "ui-blocks" && /* @__PURE__ */ e.jsx(W, { fallback: /* @__PURE__ */ e.jsx(de, { className: "h-32 w-full" }), children: /* @__PURE__ */ e.jsx(Fe, {}) }),
259
- s === "html" && /* @__PURE__ */ e.jsx(Me, {})
261
+ s === "ui-blocks" && /* @__PURE__ */ e.jsx(J, { fallback: /* @__PURE__ */ e.jsx(ve, { className: "h-32 w-full" }), children: /* @__PURE__ */ e.jsx(Fe, {}) }),
262
+ s === "html" && /* @__PURE__ */ e.jsx(He, {})
260
263
  ] });
261
264
  };
262
265
  export {
263
- Bs as default
266
+ As as default
264
267
  };
@@ -0,0 +1,3 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-WKRPbKtm.cjs"),n=require("react"),t=require("lodash"),g=require("jotai"),s=require("./index-c8zW_D2V.cjs"),y=require("react-dnd"),B=require("@radix-ui/react-icons"),k=require("./index-fwo4wa7u.cjs"),q=require("lucide-react"),A=require("./lib.cjs"),T=require("./Class-RZuPYbUS.cjs");require("@radix-ui/react-toggle");require("class-variance-authority");require("@radix-ui/react-switch");require("@radix-ui/react-slot");require("@radix-ui/react-accordion");require("@radix-ui/react-alert-dialog");require("@radix-ui/react-dialog");require("@radix-ui/react-label");require("@radix-ui/react-scroll-area");require("@radix-ui/react-tabs");require("@radix-ui/react-tooltip");require("@radix-ui/react-popover");require("@radix-ui/react-menubar");require("@radix-ui/react-hover-card");require("@radix-ui/react-select");require("@radix-ui/react-dropdown-menu");require("@radix-ui/react-separator");require("@radix-ui/react-toast");require("cmdk");require("@radix-ui/react-context-menu");require("react-icons-picker");require("react-dom");require("react-quill");require("flat-to-nested");require("redux-undo");require("@react-hookz/web");require("react-i18next");require("himalaya");require("@mhsdesign/jit-browser-tailwindcss");require("@bobthered/tailwindcss-palette-generator");require("@tailwindcss/forms");require("@tailwindcss/typography");require("@tailwindcss/aspect-ratio");require("@tailwindcss/line-clamp");require("clsx");require("tailwind-merge");const C=({block:r})=>{const{type:o,icon:l,label:c}=r,{addCoreBlock:d,addPredefinedBlock:m}=s.useAddBlock(),[p]=s.useSelectedBlockIds(),[,x]=g.useAtom(s.activePanelAtom),[,i]=g.useAtom(s.addBlocksModalAtom),E=()=>{t.has(r,"blocks")?m(k.P(r.blocks),t.first(p)):d(r,t.first(p)),i(!1),x("layers")},[,f,j]=y.useDrag(()=>({type:"CHAI_BLOCK",item:r}));return e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx(y.DragPreviewImage,{connect:j,src:"https://placehold.co/100x30/000000/FFF?text="+(c||o).replace(/ /g,"+")}),e.jsxRuntimeExports.jsxs(s.Tooltip,{children:[e.jsxRuntimeExports.jsx(s.TooltipTrigger,{asChild:!0,children:e.jsxRuntimeExports.jsxs("button",{onClick:E,type:"button",ref:f,className:"cursor-grab space-y-2 rounded-lg border border-border p-3 text-center hover:bg-slate-300/50",children:[n.createElement(l||B.BoxIcon,{className:"w-4 h-4 mx-auto"}),e.jsxRuntimeExports.jsx("p",{className:"truncate text-xs",children:c||o})]})}),e.jsxRuntimeExports.jsx(s.TooltipContent,{children:e.jsxRuntimeExports.jsx("p",{children:c||o})})]})]})},N=({block:r,closePopover:o})=>{var j;const[l,c]=n.useState(!1),d=s.useBuilderProp("getExternalPredefinedBlock"),{addCoreBlock:m,addPredefinedBlock:p}=s.useAddBlock(),[x]=s.useSelectedBlockIds(),[,i,E]=y.useDrag(()=>({type:"CHAI_BLOCK",item:r}),[r]),f=n.useCallback(async b=>{if(b.stopPropagation(),t.has(r,"component")){m(r,t.first(x)),o();return}c(!0);const a=await d(r);t.isEmpty(a)||p(k.P(a),t.first(x)),o()},[r]);return e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx(y.DragPreviewImage,{connect:E,src:"https://placehold.co/100x30/000000/FFF?text="+((j=r.name||r.label)==null?void 0:j.replace(" ","+"))}),e.jsxRuntimeExports.jsxs("div",{ref:i,onClick:l?()=>{}:f,className:"relative cursor-grab overflow-hidden rounded-md border border-transparent duration-200 hover:scale-x-105 hover:border-foreground/20 hover:shadow-2xl",children:[l&&e.jsxRuntimeExports.jsxs("div",{className:"absolute flex h-full w-full items-center justify-center bg-black bg-opacity-70",children:[e.jsxRuntimeExports.jsx(q.Loader,{className:"animate-spin",size:15,color:"white"})," ",e.jsxRuntimeExports.jsx("span",{className:"pl-2 text-sm text-white",children:"Adding..."})]}),r.preview?e.jsxRuntimeExports.jsx("img",{src:r.preview,className:"min-h-[50px] w-full rounded-md border border-gray-300",alt:r.name}):e.jsxRuntimeExports.jsx("div",{className:"flex h-20 items-center justify-center rounded-md border border-border border-gray-300 bg-gray-200",children:e.jsxRuntimeExports.jsx("p",{className:"max-w-xs text-center text-sm text-gray-700",children:r.name})})]})]})},I=()=>{const{data:r,isLoading:o}=s.useUILibraryBlocks(),l=k.C(),c=t.filter(t.values(l),{category:"custom"}),d=t.groupBy(c,"group"),m=t.groupBy(r,"group"),[p,x]=n.useState(null),i=n.useMemo(()=>t.mergeWith(d,m,(a,h)=>{if(t.isArray(a)&&t.isArray(h))return[...a,...h]}),[d,m]),[,E]=g.useAtom(s.addBlocksModalAtom),[f,j]=n.useState("Navbar"),b=t.get(i,f,[]);return e.jsxRuntimeExports.jsxs("div",{className:"relative flex h-full max-h-full overflow-hidden py-2",children:[e.jsxRuntimeExports.jsx("ul",{className:"sticky top-0 h-full w-48 space-y-1 overflow-y-auto border-r px-2",children:o?e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx("li",{className:"h-8 w-full animate-pulse bg-gray-200"}),e.jsxRuntimeExports.jsx("li",{className:"mt-2 h-8 w-full animate-pulse bg-gray-200"}),e.jsxRuntimeExports.jsx("li",{className:"mt-2 h-8 w-full animate-pulse bg-gray-200"}),e.jsxRuntimeExports.jsx("li",{className:"mt-2 h-8 w-full animate-pulse bg-gray-200"}),e.jsxRuntimeExports.jsx("li",{className:"mt-2 h-8 w-full animate-pulse bg-gray-200"}),e.jsxRuntimeExports.jsx("li",{className:"mt-2 h-8 w-full animate-pulse bg-gray-200"})]}):n.Children.toArray(t.map(i,(a,h)=>e.jsxRuntimeExports.jsx("li",{onMouseOut:()=>{clearTimeout(p),x(null)},onMouseEnter:()=>{const R=setTimeout(()=>{j(h)},300);x(R)},onClick:()=>j(h),className:T.cn("-mx-2 cursor-default rounded-md rounded-r-none px-2 py-1 text-sm font-medium capitalize",f===h?"bg-blue-500 text-white":" text-gray-700 hover:bg-foreground/10"),children:h})))}),e.jsxRuntimeExports.jsx("div",{className:"h-full w-full space-y-2 overflow-y-auto px-8",children:n.Children.toArray(b.map(a=>e.jsxRuntimeExports.jsx(N,{block:a,closePopover:()=>E(!1)})))})]})},P=()=>{const[r,o]=n.useState(""),{addPredefinedBlock:l}=s.useAddBlock(),[c]=s.useSelectedBlockIds(),[,d]=g.useAtom(s.addBlockOffCanvasAtom),[,m]=g.useAtom(s.activePanelAtom),[,p]=g.useAtom(s.addBlocksModalAtom),x=()=>{const i=A.getBlocksFromHTML(r);l([...i],t.first(c)||null),o(""),d(!1),m("layers"),p(!1)};return e.jsxRuntimeExports.jsxs(s.Card,{className:"border-border/0 p-0 shadow-none",children:[e.jsxRuntimeExports.jsxs(s.CardHeader,{className:"p-3",children:[e.jsxRuntimeExports.jsx(s.CardTitle,{children:"Import HTML"}),e.jsxRuntimeExports.jsx(s.CardDescription,{children:"Use HTML snippets from component libraries like Tailwind UI, Flowbite, Preline, Kitwind, Tailblocks etc. or just copy paste your own HTML code. Only Tailwind CSS markup is supported."})]}),e.jsxRuntimeExports.jsx(s.CardContent,{className:"space-y-2 px-3 py-0",children:e.jsxRuntimeExports.jsxs("div",{className:"space-y-1",children:[e.jsxRuntimeExports.jsx(s.Label,{htmlFor:"current",className:"text-sm",children:"Enter HTML Code:"}),e.jsxRuntimeExports.jsx(s.Textarea,{autoFocus:!0,tabIndex:1,ref:i=>i&&i.focus(),defaultValue:r,onChange:i=>o(i.target.value),rows:12,placeholder:`<div>
2
+ <h1>Enter code here</h1>
3
+ </div>`,className:"resize-none overflow-x-auto whitespace-pre font-mono font-normal"})]})}),e.jsxRuntimeExports.jsxs(s.CardFooter,{className:"flex flex-col justify-end p-3",children:[e.jsxRuntimeExports.jsx(s.Button,{disabled:r.trim()==="",onClick:()=>x(),size:"sm",className:"w-full",children:"Import"}),e.jsxRuntimeExports.jsxs(s.Alert,{variant:"default",className:"mt-2 p-1 text-blue-400",children:[e.jsxRuntimeExports.jsx(B.ExclamationTriangleIcon,{className:"h-4 w-4"}),e.jsxRuntimeExports.jsx(s.AlertTitle,{className:"text-sm leading-4",children:"Imported html will be added to the currently selected block. If no block is selected, the html will be added to the page."})]})]})]})},v=["ListItem","TableHead","TableBody","TableRow","TableCell","Column"],L=(r,o)=>{if(!r)return!t.includes(v,o);const l=r._type;return l==="List"?o==="ListItem":l==="Table"?o==="TableHead"||o==="TableBody":l==="TableHead"||l==="TableBody"?o==="TableRow":l==="TableRow"?o==="TableCell":l==="Row"?o==="Column":!t.includes(v,o)},S=()=>{const[r,o]=n.useState("core"),[l,c]=n.useState("basic"),d=k.C(),[,m]=g.useAtom(s.showPredefinedBlockCategoryAtom),[,p]=g.useAtom(s.addBlocksModalAtom),[x]=s.useSelectedBlockIds(),i=s.useAllBlocks(),E=t.find(i,{_id:t.first(x)}),{data:f,isLoading:j}=s.useUILibraryBlocks(),b=t.groupBy(t.filter(d,u=>L(E,u.type)),"category"),a=t.uniq(t.map(b.core,"group"));n.useEffect(()=>{!t.includes(a,l)&&!t.isEmpty(a)&&!t.isEmpty(l)&&c(t.first(a))},[a,l]);const h=u=>c(w=>w===u?"":u),R=!j&&!t.isEmpty(f)||t.find(t.values(d),{category:"custom"})!==void 0;return e.jsxRuntimeExports.jsxs("div",{className:"flex h-full flex-col overflow-hidden",children:[e.jsxRuntimeExports.jsxs("div",{className:"mb-2 flex justify-between rounded-md bg-background/30 p-1",children:[e.jsxRuntimeExports.jsxs("h1",{className:"flex flex-col items-baseline px-1 text-2xl font-semibold xl:flex-row",children:["Add block",e.jsxRuntimeExports.jsx("span",{className:"p-0 text-xs font-light leading-3 opacity-80 xl:pl-1",children:r==="html"?"(Enter or paste your own HTML code)":"(Drag & drop into tree view or click to add)"})]}),e.jsxRuntimeExports.jsxs("button",{onClick:()=>p(!1),className:"flex h-max items-center gap-x-1 rounded-full border p-px text-xs text-gray-800 hover:bg-gray-100 md:p-2",children:[e.jsxRuntimeExports.jsx(B.Cross1Icon,{width:12})," Close"]})]}),e.jsxRuntimeExports.jsx(s.Tabs,{onValueChange:u=>{m(""),o(u)},value:r,className:"h-max",children:e.jsxRuntimeExports.jsxs(s.TabsList,{className:"grid w-full "+(R?"grid-cols-3":"grid-cols-2"),children:[e.jsxRuntimeExports.jsx(s.TabsTrigger,{value:"core",children:"Core"}),R?e.jsxRuntimeExports.jsx(s.TabsTrigger,{value:"ui-blocks",children:"UI Blocks"}):null,e.jsxRuntimeExports.jsx(s.TabsTrigger,{value:"html",children:"Import"})]})}),r==="core"&&e.jsxRuntimeExports.jsx(s.ScrollArea,{className:"-mx-1.5 h-full",children:e.jsxRuntimeExports.jsx(s.Accordion,{type:"single",value:l,className:"w-full px-3",children:n.Children.toArray(t.map(a,u=>t.reject(t.filter(t.values(b.core),{group:u}),{hidden:!0}).length?e.jsxRuntimeExports.jsxs(s.AccordionItem,{value:u,className:"border-border",children:[e.jsxRuntimeExports.jsx(s.AccordionTrigger,{onClick:()=>h(u),className:"py-2 capitalize",children:u}),e.jsxRuntimeExports.jsx(s.AccordionContent,{children:e.jsxRuntimeExports.jsx("div",{className:"grid grid-cols-4 gap-2",children:n.Children.toArray(t.reject(t.filter(t.values(b.core),{group:u}),{hidden:!0}).map(w=>e.jsxRuntimeExports.jsx(C,{block:w})))})})]}):null))})}),r==="ui-blocks"&&e.jsxRuntimeExports.jsx(n.Suspense,{fallback:e.jsxRuntimeExports.jsx(s.Skeleton,{className:"h-32 w-full"}),children:e.jsxRuntimeExports.jsx(I,{})}),r==="html"&&e.jsxRuntimeExports.jsx(P,{})]})};exports.default=S;
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./jsx-runtime-WKRPbKtm.cjs"),C=require("react"),B=require("@rjsf/validator-ajv8"),j=require("@rjsf/core"),c=require("./index-c8zW_D2V.cjs"),e=require("./index-m2muA80V.cjs"),R=require("lodash");require("./Class-RZuPYbUS.cjs");require("clsx");require("tailwind-merge");require("@radix-ui/react-toggle");require("class-variance-authority");require("@radix-ui/react-switch");require("@radix-ui/react-slot");require("@radix-ui/react-accordion");require("@radix-ui/react-icons");require("@radix-ui/react-alert-dialog");require("@radix-ui/react-dialog");require("@radix-ui/react-label");require("@radix-ui/react-scroll-area");require("@radix-ui/react-tabs");require("@radix-ui/react-tooltip");require("@radix-ui/react-popover");require("@radix-ui/react-menubar");require("@radix-ui/react-hover-card");require("@radix-ui/react-select");require("@radix-ui/react-dropdown-menu");require("@radix-ui/react-separator");require("@radix-ui/react-toast");require("cmdk");require("@radix-ui/react-context-menu");require("react-icons-picker");require("react-dom");require("react-quill");require("jotai");require("flat-to-nested");require("redux-undo");require("./index-fwo4wa7u.cjs");require("@react-hookz/web");require("react-i18next");require("./lib.cjs");require("himalaya");require("@mhsdesign/jit-browser-tailwindcss");require("@bobthered/tailwindcss-palette-generator");require("@tailwindcss/forms");require("@tailwindcss/typography");require("@tailwindcss/aspect-ratio");require("@tailwindcss/line-clamp");function P(r){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(r){for(const i in r)if(i!=="default"){const a=Object.getOwnPropertyDescriptor(r,i);Object.defineProperty(t,i,a.get?a:{enumerable:!0,get:()=>r[i]})}}return t.default=r,Object.freeze(t)}const v=P(C),p=[{title:"Roboto",value:"Roboto"},{title:"Open Sans",value:"Open Sans"},{title:"Montserrat",value:"Montserrat"},{title:"Lato",value:"Lato"},{title:"Poppins",value:"Poppins"},{title:"Oswald",value:"Oswald"},{title:"Raleway",value:"Raleway"},{title:"Ubuntu",value:"Ubuntu"},{title:"Nunito",value:"Nunito"},{title:"Merriweather",value:"Merriweather"},{title:"Nunito Sans",value:"Nunito Sans"},{title:"Playfair Display",value:"Playfair Display"},{title:"Rubik",value:"Rubik"},{title:"Inter",value:"Inter"},{title:"Lora",value:"Lora"},{title:"Kanit",value:"Kanit"},{title:"Fira Sans",value:"Fira Sans"},{title:"Hind",value:"Hind"},{title:"Quicksand",value:"Quicksand"},{title:"Mulish",value:"Mulish"},{title:"Barlow",value:"Barlow"},{title:"Inconsolata",value:"Inconsolata"},{title:"Titillium Web",value:"Titillium Web"},{title:"Heebo",value:"Heebo"},{title:"IBM Plex Sans",value:"IBM Plex Sans"},{title:"DM Sans",value:"DM Sans"},{title:"Nanum Gothic",value:"Nanum Gothic"},{title:"Karla",value:"Karla"},{title:"Arimo",value:"Arimo"},{title:"Cabin",value:"Cabin"},{title:"Oxygen",value:"Oxygen"},{title:"Overpass",value:"Overpass"},{title:"Assistant",value:"Assistant"},{title:"Tajawal",value:"Tajawal"},{title:"Play",value:"Play"},{title:"Exo",value:"Exo"},{title:"Cinzel",value:"Cinzel"},{title:"Faustina",value:"Faustina"},{title:"Philosopher",value:"Philosopher"},{title:"Gelasio",value:"Gelasio"},{title:"Sofia Sans Condensed",value:"Sofia Sans Condensed"},{title:"Noto Sans Devanagari",value:"Noto Sans Devanagari"},{title:"Actor",value:"Actor"},{title:"Epilogue",value:"Epilogue"},{title:"Glegoo",value:"Glegoo"},{title:"Overlock",value:"Overlock"},{title:"Lustria",value:"Lustria"},{title:"Ovo",value:"Ovo"},{title:"Suranna",value:"Suranna"}],k=()=>{const r=c.useBuilderProp("onSaveBrandingOptions",async()=>{}),[t,i]=c.useBrandingOptions(),a=v.useRef(t);v.useEffect(()=>()=>{R.isEqual(t,a.current)||r(a.current)},[]);const q=({formData:l},n)=>{n&&(i(l),a.current=l)},{bodyFont:y,headingFont:f,primaryColor:g,bodyTextDarkColor:b,bodyTextLightColor:m,bodyBgDarkColor:x,secondaryColor:h,bodyBgLightColor:S,roundedCorners:O}=t,s={headingFont:e.f({title:"Heading font",default:f,options:p}),bodyFont:e.f({title:"Body font",default:y,options:p}),roundedCorners:e.c({title:"Rounded Corner",default:parseInt(O||5,10)}),primaryColor:e.y({title:"Primary",default:g}),secondaryColor:e.y({title:"Secondary",default:h}),bodyBgLightColor:e.y({title:"Body Background (Light)",default:S}),bodyBgDarkColor:e.y({title:"Body Background (Dark)",default:x}),bodyTextLightColor:e.y({title:"Body Text (Light)",default:b}),bodyTextDarkColor:e.y({title:"Body Text (Dark)",default:m})},u={type:"object",properties:{}},d={};return Object.keys(s).forEach(l=>{const n=s[l];return u.properties||(u.properties={}),u.properties[l]=n.schema,d[l]=n.uiSchema,!0}),o.jsxRuntimeExports.jsxs("div",{className:"flex h-full select-none flex-col",children:[o.jsxRuntimeExports.jsx("div",{className:"rounded-md bg-background/30 p-1",children:o.jsxRuntimeExports.jsx("h1",{className:"px-1 font-semibold",children:"Branding Options"})}),o.jsxRuntimeExports.jsx("div",{className:"-mx-2",children:o.jsxRuntimeExports.jsx(j,{idSeparator:".",autoComplete:"off",omitExtraData:!0,liveOmit:!0,liveValidate:!0,uiSchema:d,schema:u,formData:t,validator:B,onChange:q})})]})};exports.default=k;
@@ -1,36 +1,52 @@
1
- import { j as a } from "./jsx-runtime-Sp0orL4X.js";
1
+ import { j as i } from "./jsx-runtime-qAwJ85SY.js";
2
2
  import * as s from "react";
3
3
  import O from "@rjsf/validator-ajv8";
4
4
  import k from "@rjsf/core";
5
- import { j } from "./ChaiBuilderEditor-hEuUONQ3.js";
6
- import "react-i18next";
7
- import { u as D } from "./skeleton-CU_FIbg3.js";
8
- import { f as p, c as N, y as e } from "./controls-enQY7NI8.js";
9
- import { isEqual as P } from "lodash";
10
- import "./MODIFIERS-DsEzQ3aH.js";
5
+ import { i as D, x as N } from "./index-2EHcmZqL.js";
6
+ import { f as p, c as P, y as e } from "./index-RVm8Txnj.js";
7
+ import { isEqual as R } from "lodash";
8
+ import "./Class-nQk08vqd.js";
11
9
  import "clsx";
10
+ import "tailwind-merge";
11
+ import "@radix-ui/react-toggle";
12
+ import "class-variance-authority";
13
+ import "@radix-ui/react-switch";
14
+ import "@radix-ui/react-slot";
15
+ import "@radix-ui/react-accordion";
16
+ import "@radix-ui/react-icons";
17
+ import "@radix-ui/react-alert-dialog";
18
+ import "@radix-ui/react-dialog";
19
+ import "@radix-ui/react-label";
12
20
  import "@radix-ui/react-scroll-area";
21
+ import "@radix-ui/react-tabs";
22
+ import "@radix-ui/react-tooltip";
23
+ import "@radix-ui/react-popover";
24
+ import "@radix-ui/react-menubar";
25
+ import "@radix-ui/react-hover-card";
26
+ import "@radix-ui/react-select";
27
+ import "@radix-ui/react-dropdown-menu";
28
+ import "@radix-ui/react-separator";
29
+ import "@radix-ui/react-toast";
30
+ import "cmdk";
31
+ import "@radix-ui/react-context-menu";
32
+ import "react-icons-picker";
13
33
  import "react-dom";
14
- import "@floating-ui/react-dom";
34
+ import "react-quill";
15
35
  import "jotai";
16
- import "i18next";
17
- import "flagged";
18
- import "react-dnd";
19
- import "@minoru/react-dnd-treeview";
20
- import "./utils-dze1SGvB.js";
21
- import "tailwind-merge";
22
- import "react-hotkeys-hook";
23
36
  import "flat-to-nested";
24
- import "./functions-pcUZhFJM.js";
25
37
  import "redux-undo";
38
+ import "./index-gmZcUXyn.js";
26
39
  import "@react-hookz/web";
27
- import "./index-ehKdBRUK.js";
28
- import "@radix-ui/react-slot";
29
- import "class-variance-authority";
30
- import "@radix-ui/react-tooltip";
31
- import "@radix-ui/react-icons";
32
- import "@radix-ui/react-toast";
33
- const d = [
40
+ import "react-i18next";
41
+ import "./lib.js";
42
+ import "himalaya";
43
+ import "@mhsdesign/jit-browser-tailwindcss";
44
+ import "@bobthered/tailwindcss-palette-generator";
45
+ import "@tailwindcss/forms";
46
+ import "@tailwindcss/typography";
47
+ import "@tailwindcss/aspect-ratio";
48
+ import "@tailwindcss/line-clamp";
49
+ const m = [
34
50
  { title: "Roboto", value: "Roboto" },
35
51
  { title: "Open Sans", value: "Open Sans" },
36
52
  { title: "Montserrat", value: "Montserrat" },
@@ -80,11 +96,11 @@ const d = [
80
96
  { title: "Lustria", value: "Lustria" },
81
97
  { title: "Ovo", value: "Ovo" },
82
98
  { title: "Suranna", value: "Suranna" }
83
- ], nt = () => {
84
- const m = D("onSaveBrandingOptions", async () => {
85
- }), [o, v] = j(), r = s.useRef(o);
99
+ ], Bt = () => {
100
+ const d = D("onSaveBrandingOptions", async () => {
101
+ }), [o, v] = N(), r = s.useRef(o);
86
102
  s.useEffect(() => () => {
87
- P(o, r.current) || m(r.current);
103
+ R(o, r.current) || d(r.current);
88
104
  }, []);
89
105
  const c = ({ formData: t }, l) => {
90
106
  l && (v(t), r.current = t);
@@ -94,34 +110,34 @@ const d = [
94
110
  primaryColor: y,
95
111
  bodyTextDarkColor: h,
96
112
  bodyTextLightColor: b,
97
- bodyBgDarkColor: S,
98
- secondaryColor: x,
113
+ bodyBgDarkColor: x,
114
+ secondaryColor: S,
99
115
  bodyBgLightColor: C,
100
116
  roundedCorners: B
101
117
  } = o, n = {
102
118
  headingFont: p({
103
119
  title: "Heading font",
104
120
  default: g,
105
- options: d
121
+ options: m
106
122
  }),
107
123
  bodyFont: p({
108
124
  title: "Body font",
109
125
  default: f,
110
- options: d
126
+ options: m
111
127
  }),
112
- roundedCorners: N({
128
+ roundedCorners: P({
113
129
  title: "Rounded Corner",
114
130
  default: parseInt(B || 5, 10)
115
131
  }),
116
132
  primaryColor: e({ title: "Primary", default: y }),
117
- secondaryColor: e({ title: "Secondary", default: x }),
133
+ secondaryColor: e({ title: "Secondary", default: S }),
118
134
  bodyBgLightColor: e({
119
135
  title: "Body Background (Light)",
120
136
  default: C
121
137
  }),
122
138
  bodyBgDarkColor: e({
123
139
  title: "Body Background (Dark)",
124
- default: S
140
+ default: x
125
141
  }),
126
142
  bodyTextLightColor: e({
127
143
  title: "Body Text (Light)",
@@ -132,16 +148,16 @@ const d = [
132
148
  default: b
133
149
  })
134
150
  // TODO: exteend more options from user
135
- }, i = {
151
+ }, a = {
136
152
  type: "object",
137
153
  properties: {}
138
154
  }, u = {};
139
155
  return Object.keys(n).forEach((t) => {
140
156
  const l = n[t];
141
- return i.properties || (i.properties = {}), i.properties[t] = l.schema, u[t] = l.uiSchema, !0;
142
- }), /* @__PURE__ */ a.jsxs("div", { className: "flex h-full select-none flex-col", children: [
143
- /* @__PURE__ */ a.jsx("div", { className: "rounded-md bg-background/30 p-1", children: /* @__PURE__ */ a.jsx("h1", { className: "px-1 font-semibold", children: "Branding Options" }) }),
144
- /* @__PURE__ */ a.jsx("div", { className: "-mx-2", children: /* @__PURE__ */ a.jsx(
157
+ return a.properties || (a.properties = {}), a.properties[t] = l.schema, u[t] = l.uiSchema, !0;
158
+ }), /* @__PURE__ */ i.jsxs("div", { className: "flex h-full select-none flex-col", children: [
159
+ /* @__PURE__ */ i.jsx("div", { className: "rounded-md bg-background/30 p-1", children: /* @__PURE__ */ i.jsx("h1", { className: "px-1 font-semibold", children: "Branding Options" }) }),
160
+ /* @__PURE__ */ i.jsx("div", { className: "-mx-2", children: /* @__PURE__ */ i.jsx(
145
161
  k,
146
162
  {
147
163
  idSeparator: ".",
@@ -150,7 +166,7 @@ const d = [
150
166
  liveOmit: !0,
151
167
  liveValidate: !0,
152
168
  uiSchema: u,
153
- schema: i,
169
+ schema: a,
154
170
  formData: o,
155
171
  validator: O,
156
172
  onChange: c
@@ -159,5 +175,5 @@ const d = [
159
175
  ] });
160
176
  };
161
177
  export {
162
- nt as default
178
+ Bt as default
163
179
  };