@chaibuilder/sdk 1.2.65 → 1.2.67

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 (125) hide show
  1. package/dist/AddBlocks-TVOOPK2w.cjs +1 -0
  2. package/dist/AddBlocks-mbuhydG3.js +123 -0
  3. package/dist/CanvasArea-KJMcis97.cjs +1 -0
  4. package/dist/CanvasArea-kg3Rgg9t.js +136 -0
  5. package/dist/CodeEditor-QP6l0mv4.cjs +1 -0
  6. package/dist/{CodeEditor-Qff4q7sx.js → CodeEditor-q5unEaUI.js} +60 -46
  7. package/dist/STRINGS--j49GZJP.js +7 -0
  8. package/dist/STRINGS-gPz7CUOk.cjs +1 -0
  9. package/dist/SettingsPanel-MWeQjDWs.cjs +1 -0
  10. package/dist/SettingsPanel-pomLrOxB.js +81 -0
  11. package/dist/SidePanels-9sbERNEv.cjs +1 -0
  12. package/dist/{SidePanels-ijaUKSek.js → SidePanels-YpRrvfiH.js} +87 -93
  13. package/dist/{Topbar-vHlnfxPs.js → Topbar-kVBx7pp4.js} +56 -61
  14. package/dist/Topbar-veJ2_blW.cjs +1 -0
  15. package/dist/{UILibrariesPanel-NVUMUPUj.js → UILibrariesPanel-ES8YzN9C.js} +92 -101
  16. package/dist/UILibrariesPanel-H8t36R6M.cjs +1 -0
  17. package/dist/UnsplashImages--MXx-DYM.cjs +1 -0
  18. package/dist/{UnsplashImages-UkHihhA5.js → UnsplashImages-sotLcz6r.js} +72 -57
  19. package/dist/{UploadImages-HtuJZJlo.js → UploadImages-I0QQ6vj1.js} +57 -44
  20. package/dist/UploadImages-xhxeYKkl.cjs +1 -0
  21. package/dist/badge-7BVT3zxN.cjs +1 -0
  22. package/dist/badge-pJqQSA13.js +23 -0
  23. package/dist/context-menu-_8TFbFEJ.cjs +1 -0
  24. package/dist/context-menu-sks9vdzC.js +906 -0
  25. package/dist/core.cjs +1 -1
  26. package/dist/core.d.ts +45 -20
  27. package/dist/core.js +85 -87
  28. package/dist/iconBase-vJD0OXxU.cjs +1 -0
  29. package/dist/iconBase-zweRWSz0.js +323 -0
  30. package/dist/index-5hfuDpYs.cjs +223 -0
  31. package/dist/index-Zu-K_BX7.js +33933 -0
  32. package/dist/jsx-runtime-JYMCiFoE.cjs +27 -0
  33. package/dist/{jsx-runtime-WbnYoNE9.js → jsx-runtime-Sp0orL4X.js} +106 -109
  34. package/dist/plugin-P0tpo_XZ.cjs +1 -0
  35. package/dist/plugin-_F-KZp1i.cjs +1 -0
  36. package/dist/plugin-f5uJtdXY.js +43 -0
  37. package/dist/plugin-sJ3Hzvpv.js +57 -0
  38. package/dist/render.cjs +3 -1
  39. package/dist/render.d.ts +19 -52
  40. package/dist/render.js +136 -183
  41. package/dist/select-JW3OMYm-.js +75 -0
  42. package/dist/select-fXj5tdMX.cjs +1 -0
  43. package/dist/separator-hT24N-xp.cjs +1 -0
  44. package/dist/separator-sgwOa1FE.js +18 -0
  45. package/dist/style.css +1 -1
  46. package/dist/tailwind.cjs +1 -1
  47. package/dist/tailwind.d.ts +41 -1
  48. package/dist/tailwind.js +16 -8
  49. package/dist/ui.cjs +1 -1
  50. package/dist/ui.d.ts +0 -10
  51. package/dist/ui.js +345 -163
  52. package/dist/web-blocks.cjs +1 -1
  53. package/dist/web-blocks.d.ts +1 -1
  54. package/dist/web-blocks.js +489 -724
  55. package/package.json +15 -45
  56. package/dist/CanvasArea-fSdH_RiN.cjs +0 -1
  57. package/dist/CanvasArea-ut5yknzX.js +0 -168
  58. package/dist/CodeEditor-ypUx3RAV.cjs +0 -1
  59. package/dist/CurrentPage-jHSVy3hq.js +0 -120
  60. package/dist/CurrentPage-p_AM4lrF.cjs +0 -1
  61. package/dist/Functions-7jnEwJyw.js +0 -15
  62. package/dist/Functions-N3yhPYKY.cjs +0 -1
  63. package/dist/MODIFIERS-fd5XOmum.js +0 -60
  64. package/dist/MODIFIERS-mVmfEGgo.cjs +0 -1
  65. package/dist/PagesPanel-U3InJ9Db.js +0 -78
  66. package/dist/PagesPanel-wqDb4D-x.cjs +0 -1
  67. package/dist/ProjectPanel-XODJTO4J.js +0 -99
  68. package/dist/ProjectPanel-fWESzHr6.cjs +0 -1
  69. package/dist/SidePanels-lrMQqc0h.cjs +0 -1
  70. package/dist/Topbar-RrCDxd0i.cjs +0 -1
  71. package/dist/UILibrariesPanel-7btHgBD0.cjs +0 -1
  72. package/dist/UnsplashImages-6UjgojvF.cjs +0 -1
  73. package/dist/UploadImages-3h0cRsvr.cjs +0 -1
  74. package/dist/_commonjsHelpers-UyOWmZb0.js +0 -8
  75. package/dist/_commonjsHelpers-wDK0ZLPo.cjs +0 -1
  76. package/dist/add-page-modal-RwIj1FxH.cjs +0 -1
  77. package/dist/add-page-modal-TOfMfmPA.js +0 -115
  78. package/dist/confirm-alert-eIp2cAkc.js +0 -60
  79. package/dist/confirm-alert-v1lG8ex4.cjs +0 -1
  80. package/dist/controls-rRZhz0vu.cjs +0 -1
  81. package/dist/controls-yjgoZzB6.js +0 -199
  82. package/dist/delete-page-modal-4bxjpVBD.js +0 -97
  83. package/dist/delete-page-modal-qYDZmpgT.cjs +0 -1
  84. package/dist/email-blocks.cjs +0 -1
  85. package/dist/email-blocks.d.ts +0 -3
  86. package/dist/email-blocks.js +0 -294
  87. package/dist/email.cjs +0 -1
  88. package/dist/email.d.ts +0 -171
  89. package/dist/email.js +0 -90
  90. package/dist/empty-slot-Lsxjts7Q.js +0 -6
  91. package/dist/empty-slot-Sy930lX6.cjs +0 -1
  92. package/dist/form-4jTocVbZ.cjs +0 -1
  93. package/dist/form-NAzFjGs0.js +0 -125
  94. package/dist/functions--tdNWQDW.js +0 -30
  95. package/dist/functions-EVUeSwX1.cjs +0 -1
  96. package/dist/html-to-json-NqRjgFqp.cjs +0 -1
  97. package/dist/html-to-json-l_mw5y-e.js +0 -243
  98. package/dist/index--k2M8kzI.cjs +0 -1
  99. package/dist/index--mLLy7QQ.cjs +0 -1
  100. package/dist/index-5XyNUAjc.cjs +0 -290
  101. package/dist/index-C7mB4XFm.js +0 -3141
  102. package/dist/index-VBXQixVm.js +0 -117
  103. package/dist/index-YZhtVcj_.js +0 -2201
  104. package/dist/index-aeDphKpP.cjs +0 -1
  105. package/dist/index-lFgDm1oa.js +0 -83780
  106. package/dist/jsx-runtime-Z_BpKhVy.cjs +0 -27
  107. package/dist/lib.cjs +0 -3
  108. package/dist/lib.d.ts +0 -80
  109. package/dist/lib.js +0 -1350
  110. package/dist/page-viewer-4wrnWnK0.js +0 -124
  111. package/dist/page-viewer-ra0GLx1p.cjs +0 -1
  112. package/dist/project-general-setting-IwZUkYF3.js +0 -90
  113. package/dist/project-general-setting-lFjTUhHD.cjs +0 -1
  114. package/dist/project-seo-setting-e1fTqVsd.js +0 -83
  115. package/dist/project-seo-setting-o0V9acCV.cjs +0 -1
  116. package/dist/server.cjs +0 -1
  117. package/dist/server.d.ts +0 -299
  118. package/dist/server.js +0 -216
  119. package/dist/single-page-detail-ZNWFKqLW.js +0 -229
  120. package/dist/single-page-detail-g55Anu7R.cjs +0 -1
  121. package/dist/studio.cjs +0 -1
  122. package/dist/studio.d.ts +0 -176
  123. package/dist/studio.js +0 -67
  124. package/dist/utils-D_vtk3zK.cjs +0 -1
  125. package/dist/utils-VpVqnC9m.js +0 -1075
@@ -1,50 +1,22 @@
1
- import { j as e } from "./jsx-runtime-WbnYoNE9.js";
2
- import { noop as T, get as g, has as I, first as x, isEmpty as L, values as U, groupBy as D, map as _, capitalize as O } from "lodash-es";
1
+ import { j as e } from "./jsx-runtime-Sp0orL4X.js";
2
+ import { values as D, first as x, groupBy as U, get as g, map as _, capitalize as z, noop as T, has as I, isEmpty as L } from "lodash-es";
3
3
  import * as R from "react";
4
- import S, { useState as A, useCallback as z, useEffect as G, useRef as M } from "react";
5
- import { a4 as H, a5 as F, B as J, a6 as W, a7 as $, a8 as K, a9 as V, aa as Y, ab as q, ac as Q, h as C, U as X, j as Z, V as ee, T as te, v as se, w as oe, b5 as re, aO as ae, a3 as ie, aJ as ne } from "./index-C7mB4XFm.js";
6
- import { syncBlocksWithDefaults as le, useChaiBlocks as ce } from "@chaibuilder/runtime";
7
- import { Loader as me } from "lucide-react";
8
- import { useAtom as w, atom as de } from "jotai";
9
- import { c as E } from "./Functions-7jnEwJyw.js";
10
- import { CaretSortIcon as pe, CheckIcon as ue, CaretRightIcon as xe } from "@radix-ui/react-icons";
11
- import { O as fe } from "./MODIFIERS-fd5XOmum.js";
4
+ import S, { useState as A, useRef as O, useCallback as G, useEffect as M } from "react";
5
+ import { w as H, c as C, e as F, s as W, i as $, t as J, r as K } from "./index-Zu-K_BX7.js";
12
6
  import { useTranslation as P } from "react-i18next";
13
- import { c as he } from "./index-lFgDm1oa.js";
7
+ import { useChaiBlocks as X, syncBlocksWithDefaults as Y } from "@chaibuilder/runtime";
8
+ import { Loader as q } from "lucide-react";
9
+ import { atom as Q, useAtom as w } from "jotai";
10
+ import { c as E } from "./iconBase-zweRWSz0.js";
11
+ import { CaretSortIcon as V, CheckIcon as Z, CaretRightIcon as ee } from "@radix-ui/react-icons";
12
+ import { P as te, s as se, B as oe, t as re, u as ae, v as ie, w as ne, x as le, y as ce, z as de, S as me, X as ue, T as pe, d as xe, e as fe } from "./context-menu-sks9vdzC.js";
13
+ import { O as he } from "./STRINGS--j49GZJP.js";
14
14
  import ge from "clsx";
15
15
  import { useFeature as je } from "flagged";
16
- import "./_commonjsHelpers-UyOWmZb0.js";
17
- import "@radix-ui/react-toggle";
18
- import "class-variance-authority";
19
- import "./utils-VpVqnC9m.js";
20
- import "tailwind-merge";
21
- import "@radix-ui/react-switch";
22
- import "@radix-ui/react-slot";
23
- import "@radix-ui/react-accordion";
24
- import "@radix-ui/react-alert-dialog";
25
- import "@radix-ui/react-dialog";
26
- import "@radix-ui/react-label";
27
- import "@radix-ui/react-scroll-area";
28
- import "@radix-ui/react-tabs";
29
- import "@radix-ui/react-tooltip";
30
- import "@radix-ui/react-popover";
31
- import "@radix-ui/react-menubar";
32
- import "@radix-ui/react-hover-card";
33
- import "@radix-ui/react-select";
34
- import "@radix-ui/react-dropdown-menu";
35
- import "@radix-ui/react-separator";
36
- import "@radix-ui/react-toast";
37
- import "cmdk";
38
- import "@radix-ui/react-context-menu";
39
- import "react-icons-picker";
40
- import "react-dom";
41
- import "react-quill";
16
+ import "./plugin-sJ3Hzvpv.js";
42
17
  import "@react-hookz/web";
43
18
  import "tree-model";
44
- import "i18next";
45
- import "react-arborist";
46
- import "./index-VBXQixVm.js";
47
- import "prop-types";
19
+ import "react-quill";
48
20
  import "react-hotkeys-hook";
49
21
  import "@floating-ui/dom";
50
22
  import "@floating-ui/react-dom";
@@ -52,55 +24,74 @@ import "@tailwindcss/typography";
52
24
  import "@tailwindcss/forms";
53
25
  import "@tailwindcss/aspect-ratio";
54
26
  import "tailwindcss-palette-generator";
55
- import "./html-to-json-l_mw5y-e.js";
56
- import "himalaya";
57
- import "lodash";
27
+ import "tailwind-merge";
58
28
  import "react-wrap-balancer";
59
- import "@rjsf/core";
29
+ import "react-dom";
30
+ import "prop-types";
60
31
  import "@rjsf/validator-ajv8";
32
+ import "@rjsf/core";
33
+ import "react-arborist";
34
+ import "himalaya";
35
+ import "react-icons-picker";
61
36
  import "react-autosuggest";
62
37
  import "fuse.js";
63
- import "./controls-yjgoZzB6.js";
38
+ import "i18next";
39
+ import "@radix-ui/react-scroll-area";
40
+ import "@radix-ui/react-switch";
41
+ import "@radix-ui/react-accordion";
42
+ import "class-variance-authority";
43
+ import "@radix-ui/react-alert-dialog";
44
+ import "@radix-ui/react-slot";
45
+ import "@radix-ui/react-label";
46
+ import "@radix-ui/react-tabs";
47
+ import "@radix-ui/react-tooltip";
48
+ import "@radix-ui/react-popover";
49
+ import "@radix-ui/react-hover-card";
50
+ import "@radix-ui/react-dropdown-menu";
51
+ import "@radix-ui/react-toast";
52
+ import "cmdk";
53
+ import "@radix-ui/react-dialog";
54
+ import "@radix-ui/react-context-menu";
64
55
  function ke({
65
56
  uiLibraries: t,
66
57
  library: a,
67
58
  setLibrary: i
68
59
  }) {
69
- var p;
70
- const [m, l] = R.useState(!1), { t: s } = P();
71
- return a ? /* @__PURE__ */ e.jsxs(H, { open: m, onOpenChange: l, children: [
72
- /* @__PURE__ */ e.jsx(F, { asChild: !0, children: /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-x-2", children: [
60
+ var u;
61
+ const [d, l] = R.useState(!1), { t: s } = P();
62
+ return a ? /* @__PURE__ */ e.jsxs(te, { open: d, onOpenChange: l, children: [
63
+ /* @__PURE__ */ e.jsx(se, { asChild: !0, children: /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-x-2", children: [
73
64
  /* @__PURE__ */ e.jsx("span", { children: s("Choose Library") }),
74
65
  /* @__PURE__ */ e.jsxs(
75
- J,
66
+ oe,
76
67
  {
77
68
  variant: "outline",
78
69
  size: "sm",
79
70
  role: "combobox",
80
- "aria-expanded": m,
71
+ "aria-expanded": d,
81
72
  className: "w-[200px] justify-between",
82
73
  children: [
83
- a ? (p = t.find((o) => o.uuid === a)) == null ? void 0 : p.name : s("Select library"),
84
- /* @__PURE__ */ e.jsx(pe, { className: "ml-2 h-4 w-4 shrink-0 opacity-50" })
74
+ a ? (u = t.find((o) => o.uuid === a)) == null ? void 0 : u.name : s("Select library"),
75
+ /* @__PURE__ */ e.jsx(V, { className: "ml-2 h-4 w-4 shrink-0 opacity-50" })
85
76
  ]
86
77
  }
87
78
  )
88
79
  ] }) }),
89
- /* @__PURE__ */ e.jsx(W, { className: "w-[200px] p-0", children: /* @__PURE__ */ e.jsxs($, { children: [
90
- /* @__PURE__ */ e.jsx(K, { placeholder: "Search library...", className: "h-9" }),
91
- /* @__PURE__ */ e.jsxs(V, { children: [
92
- /* @__PURE__ */ e.jsx(Y, { children: "No library found." }),
93
- /* @__PURE__ */ e.jsx(q, { children: t.map((o) => /* @__PURE__ */ e.jsxs(
94
- Q,
80
+ /* @__PURE__ */ e.jsx(re, { className: "w-[200px] p-0", children: /* @__PURE__ */ e.jsxs(ae, { children: [
81
+ /* @__PURE__ */ e.jsx(ie, { placeholder: "Search library...", className: "h-9" }),
82
+ /* @__PURE__ */ e.jsxs(ne, { children: [
83
+ /* @__PURE__ */ e.jsx(le, { children: "No library found." }),
84
+ /* @__PURE__ */ e.jsx(ce, { children: t.map((o) => /* @__PURE__ */ e.jsxs(
85
+ de,
95
86
  {
96
87
  value: o.uuid,
97
- onSelect: (u) => {
98
- i(u), l(!1);
88
+ onSelect: (p) => {
89
+ i(p), l(!1);
99
90
  },
100
91
  children: [
101
92
  o.name,
102
93
  /* @__PURE__ */ e.jsx(
103
- ue,
94
+ Z,
104
95
  {
105
96
  className: E("ml-auto h-4 w-4", a === o.uuid ? "opacity-100" : "opacity-0")
106
97
  }
@@ -118,26 +109,26 @@ const we = ({
118
109
  closePopover: a,
119
110
  library: i
120
111
  }) => {
121
- const [m, l] = A(!1), s = C("getUILibraryBlock", T), { addCoreBlock: p, addPredefinedBlock: o } = X(), [u, j] = Z(), [, k] = ee(), f = g(t, "name", g(t, "label")), b = je("dnd"), [, v] = w(he), n = (r) => {
122
- const d = I(r, "styles_attrs.data-page-section");
123
- return r._type === "Box" && d;
124
- }, B = z(
112
+ const [d, l] = A(!1), s = C("getUILibraryBlock", T), { addCoreBlock: u, addPredefinedBlock: o } = W(), [p, j] = $(), [, k] = J(), f = g(t, "name", g(t, "label")), v = je("dnd"), [, B] = w(K), n = (r) => {
113
+ const m = I(r, "styles_attrs.data-page-section");
114
+ return r._type === "Box" && m;
115
+ }, b = G(
125
116
  async (r) => {
126
117
  if (r.stopPropagation(), I(t, "component")) {
127
- p(t, x(u)), a();
118
+ u(t, x(p)), a();
128
119
  return;
129
120
  }
130
121
  l(!0);
131
- const d = await s(i, t);
132
- let h = x(u);
133
- n(x(d)) && (h = null), L(d) || o(le(d), h), a();
122
+ const m = await s(i, t);
123
+ let h = x(p);
124
+ n(x(m)) && (h = null), L(m) || o(Y(m), h), a();
134
125
  },
135
126
  [t]
136
127
  ), c = async (r) => {
137
- const d = await s(i, t);
138
- let h = x(u);
139
- if (n(x(d)) && (h = null), !L(d)) {
140
- const y = { blocks: d, uiLibrary: !0, parent: h };
128
+ const m = await s(i, t);
129
+ let h = x(p);
130
+ if (n(x(m)) && (h = null), !L(m)) {
131
+ const y = { blocks: m, uiLibrary: !0, parent: h };
141
132
  if (r.dataTransfer.setData("text/plain", JSON.stringify(y)), t.preview) {
142
133
  const N = new Image();
143
134
  N.src = t.preview, N.onload = () => {
@@ -145,58 +136,58 @@ const we = ({
145
136
  };
146
137
  } else
147
138
  r.dataTransfer.setDragImage(new Image(), 0, 0);
148
- v(y), setTimeout(() => {
139
+ B(y), setTimeout(() => {
149
140
  j([]), k(null), a();
150
141
  }, 200);
151
142
  }
152
143
  };
153
- return /* @__PURE__ */ e.jsxs(te, { children: [
154
- /* @__PURE__ */ e.jsx(se, { asChild: !0, children: /* @__PURE__ */ e.jsxs(
144
+ return /* @__PURE__ */ e.jsxs(pe, { children: [
145
+ /* @__PURE__ */ e.jsx(xe, { asChild: !0, children: /* @__PURE__ */ e.jsxs(
155
146
  "div",
156
147
  {
157
- onClick: m ? () => {
158
- } : B,
159
- draggable: b ? "true" : "false",
148
+ onClick: d ? () => {
149
+ } : b,
150
+ draggable: v ? "true" : "false",
160
151
  onDragStart: c,
161
152
  className: ge(
162
153
  "relative mt-2 cursor-pointer overflow-hidden rounded-md border border-gray-300 bg-white duration-200 hover:border-blue-500 hover:shadow-xl"
163
154
  ),
164
155
  children: [
165
- m && /* @__PURE__ */ e.jsxs("div", { className: "absolute flex h-full w-full items-center justify-center bg-black/70", children: [
166
- /* @__PURE__ */ e.jsx(me, { className: "animate-spin", size: 15, color: "white" }),
156
+ d && /* @__PURE__ */ e.jsxs("div", { className: "absolute flex h-full w-full items-center justify-center bg-black/70", children: [
157
+ /* @__PURE__ */ e.jsx(q, { className: "animate-spin", size: 15, color: "white" }),
167
158
  /* @__PURE__ */ e.jsx("span", { className: "pl-2 text-sm text-white", children: "Adding..." })
168
159
  ] }),
169
160
  t.preview ? /* @__PURE__ */ e.jsx("img", { src: t.preview, className: "min-h-[25px] w-full rounded-md", alt: f }) : /* @__PURE__ */ e.jsx("div", { className: "flex h-20 items-center justify-center rounded-md border border-border border-gray-300 bg-gray-200", children: /* @__PURE__ */ e.jsx("p", { className: "max-w-xs text-center text-sm text-gray-700", children: f }) })
170
161
  ]
171
162
  }
172
163
  ) }),
173
- /* @__PURE__ */ e.jsx(oe, { children: /* @__PURE__ */ e.jsx("p", { children: f }) })
164
+ /* @__PURE__ */ e.jsx(fe, { children: /* @__PURE__ */ e.jsx("p", { children: f }) })
174
165
  ] });
175
- }, be = de({}), ve = (t) => {
176
- const [a, i] = w(be), m = C("getUILibraryBlocks", T), l = g(a, `${t == null ? void 0 : t.uuid}.blocks`, []), s = g(a, `${t == null ? void 0 : t.uuid}.loading`, !1);
177
- return G(() => {
166
+ }, ve = Q({}), Be = (t) => {
167
+ const [a, i] = w(ve), d = C("getUILibraryBlocks", T), l = g(a, `${t == null ? void 0 : t.uuid}.blocks`, []), s = g(a, `${t == null ? void 0 : t.uuid}.loading`, !1);
168
+ return M(() => {
178
169
  (async () => {
179
170
  if (s || l.length > 0 || !t)
180
171
  return;
181
172
  i((o) => ({ ...o, [t == null ? void 0 : t.uuid]: { loading: !0, blocks: [] } }));
182
- const p = await m(t);
183
- i((o) => ({ ...o, [t == null ? void 0 : t.uuid]: { loading: !1, blocks: p || [] } }));
173
+ const u = await d(t);
174
+ i((o) => ({ ...o, [t == null ? void 0 : t.uuid]: { loading: !1, blocks: u || [] } }));
184
175
  })();
185
176
  }, [t, l, s]), { data: l, isLoading: s };
186
- }, Be = re("_selectedLibrary", null), Ne = () => {
187
- const [t, a] = w(Be), i = C("uiLibraries", []), m = ce(), l = U(m).filter((c) => c.category === "custom"), s = i.find((c) => c.uuid === t) || x(i), { data: p, isLoading: o } = ve(s), u = D([...p, ...l], "group"), [j, k] = A("Hero"), [, f] = w(ae), b = g(u, j, []), { t: v } = P(), n = M(null), B = (c) => {
177
+ }, be = H("_selectedLibrary", null), Ne = () => {
178
+ const [t, a] = w(be), i = C("uiLibraries", []), d = X(), l = D(d).filter((c) => c.category === "custom"), s = i.find((c) => c.uuid === t) || x(i), { data: u, isLoading: o } = Be(s), p = U([...u, ...l], "group"), [j, k] = A("Hero"), [, f] = w(F), v = g(p, j, []), { t: B } = P(), n = O(null), b = (c) => {
188
179
  n.current && (clearTimeout(n.current), n.current = null), n.current = setTimeout(() => {
189
180
  n.current && k(c);
190
181
  }, 300);
191
182
  };
192
- return o ? /* @__PURE__ */ e.jsx(ie, { className: "h-full w-full" }) : /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsxs("div", { className: "relative flex h-full max-h-full w-[460px] flex-col overflow-hidden bg-background", children: [
183
+ return o ? /* @__PURE__ */ e.jsx(me, { className: "h-full w-full" }) : /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsxs("div", { className: "relative flex h-full max-h-full w-[460px] flex-col overflow-hidden bg-background", children: [
193
184
  s != null && s.uuid ? /* @__PURE__ */ e.jsx("div", { className: "sticky top-0 flex h-fit flex-col", children: /* @__PURE__ */ e.jsx("div", { className: "mb-2 flex flex-col justify-between rounded-md bg-background/30 p-1", children: /* @__PURE__ */ e.jsx("h1", { className: "flex w-full flex-col items-baseline truncate px-1 text-sm font-semibold xl:flex-col", children: /* @__PURE__ */ e.jsx(ke, { library: s == null ? void 0 : s.uuid, setLibrary: a, uiLibraries: i }) }) }) }) : null,
194
185
  /* @__PURE__ */ e.jsxs("div", { className: "flex h-[95%] border-t border-gray-300 pt-2", children: [
195
186
  /* @__PURE__ */ e.jsx("div", { className: "flex h-full w-40 flex-col gap-1 px-1", children: S.Children.toArray(
196
- _(u, (c, r) => /* @__PURE__ */ e.jsxs(
187
+ _(p, (c, r) => /* @__PURE__ */ e.jsxs(
197
188
  "div",
198
189
  {
199
- onMouseEnter: () => B(r),
190
+ onMouseEnter: () => b(r),
200
191
  onMouseLeave: () => clearTimeout(n.current),
201
192
  onClick: () => k(r),
202
193
  className: E(
@@ -204,22 +195,22 @@ const we = ({
204
195
  r === j ? "bg-blue-500 text-white hover:bg-blue-600" : ""
205
196
  ),
206
197
  children: [
207
- /* @__PURE__ */ e.jsx("span", { children: O(r) }),
208
- /* @__PURE__ */ e.jsx(xe, { className: "ml-2 h-5 w-5" })
198
+ /* @__PURE__ */ e.jsx("span", { children: z(r) }),
199
+ /* @__PURE__ */ e.jsx(ee, { className: "ml-2 h-5 w-5" })
209
200
  ]
210
201
  },
211
202
  r
212
203
  ))
213
204
  ) }),
214
205
  /* @__PURE__ */ e.jsxs(
215
- ne,
206
+ ue,
216
207
  {
217
208
  onMouseEnter: () => n.current ? clearTimeout(n.current) : null,
218
209
  className: "z-10 -mt-2 flex h-full max-h-full w-[300px] flex-col gap-2 border-l border-gray-300 transition-all ease-linear",
219
210
  children: [
220
- /* @__PURE__ */ e.jsx("div", { className: "sticky top-0 z-30 border-b border-gray-300 bg-gray-200 p-2 text-[9px] font-light leading-3 text-gray-500", children: v("Click on a block to add it to the page") }),
211
+ /* @__PURE__ */ e.jsx("div", { className: "sticky top-0 z-30 border-b border-gray-300 bg-gray-200 p-2 text-[9px] font-light leading-3 text-gray-500", children: B("Click on a block to add it to the page") }),
221
212
  /* @__PURE__ */ e.jsx("div", { className: "flex flex-col gap-2 px-2", children: S.Children.toArray(
222
- b.map((c) => /* @__PURE__ */ e.jsx(we, { block: c, library: s, closePopover: () => f(fe) }))
213
+ v.map((c) => /* @__PURE__ */ e.jsx(we, { block: c, library: s, closePopover: () => f(he) }))
223
214
  ) }),
224
215
  /* @__PURE__ */ e.jsx("br", {}),
225
216
  /* @__PURE__ */ e.jsx("br", {}),
@@ -229,7 +220,7 @@ const we = ({
229
220
  )
230
221
  ] })
231
222
  ] }) });
232
- }, Pt = () => /* @__PURE__ */ e.jsx(Ne, {});
223
+ }, Nt = () => /* @__PURE__ */ e.jsx(Ne, {});
233
224
  export {
234
- Pt as default
225
+ Nt as default
235
226
  };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-JYMCiFoE.cjs"),s=require("lodash-es"),g=require("react"),p=require("./index-5hfuDpYs.cjs"),S=require("react-i18next"),C=require("@chaibuilder/runtime"),T=require("lucide-react"),R=require("jotai"),I=require("./iconBase-vJD0OXxU.cjs"),N=require("@radix-ui/react-icons"),i=require("./context-menu-_8TFbFEJ.cjs"),L=require("./STRINGS-gPz7CUOk.cjs"),A=require("clsx"),P=require("flagged");require("./plugin-_F-KZp1i.cjs");require("@react-hookz/web");require("tree-model");require("react-quill");require("react-hotkeys-hook");require("@floating-ui/dom");require("@floating-ui/react-dom");require("@tailwindcss/typography");require("@tailwindcss/forms");require("@tailwindcss/aspect-ratio");require("tailwindcss-palette-generator");require("tailwind-merge");require("react-wrap-balancer");require("react-dom");require("prop-types");require("@rjsf/validator-ajv8");require("@rjsf/core");require("react-arborist");require("himalaya");require("react-icons-picker");require("react-autosuggest");require("fuse.js");require("i18next");require("@radix-ui/react-scroll-area");require("@radix-ui/react-switch");require("@radix-ui/react-accordion");require("class-variance-authority");require("@radix-ui/react-alert-dialog");require("@radix-ui/react-slot");require("@radix-ui/react-label");require("@radix-ui/react-tabs");require("@radix-ui/react-tooltip");require("@radix-ui/react-popover");require("@radix-ui/react-hover-card");require("@radix-ui/react-dropdown-menu");require("@radix-ui/react-toast");require("cmdk");require("@radix-ui/react-dialog");require("@radix-ui/react-context-menu");function O(t){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const o in t)if(o!=="default"){const l=Object.getOwnPropertyDescriptor(t,o);Object.defineProperty(n,o,l.get?l:{enumerable:!0,get:()=>t[o]})}}return n.default=t,Object.freeze(n)}const D=O(g);function _({uiLibraries:t,library:n,setLibrary:o}){var j;const[l,x]=D.useState(!1),{t:r}=S.useTranslation();return n?e.jsxRuntimeExports.jsxs(i.Popover,{open:l,onOpenChange:x,children:[e.jsxRuntimeExports.jsx(i.PopoverTrigger,{asChild:!0,children:e.jsxRuntimeExports.jsxs("div",{className:"flex items-center gap-x-2",children:[e.jsxRuntimeExports.jsx("span",{children:r("Choose Library")}),e.jsxRuntimeExports.jsxs(i.Button,{variant:"outline",size:"sm",role:"combobox","aria-expanded":l,className:"w-[200px] justify-between",children:[n?(j=t.find(u=>u.uuid===n))==null?void 0:j.name:r("Select library"),e.jsxRuntimeExports.jsx(N.CaretSortIcon,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})]})}),e.jsxRuntimeExports.jsx(i.PopoverContent,{className:"w-[200px] p-0",children:e.jsxRuntimeExports.jsxs(i.Command,{children:[e.jsxRuntimeExports.jsx(i.CommandInput,{placeholder:"Search library...",className:"h-9"}),e.jsxRuntimeExports.jsxs(i.CommandList,{children:[e.jsxRuntimeExports.jsx(i.CommandEmpty,{children:"No library found."}),e.jsxRuntimeExports.jsx(i.CommandGroup,{children:t.map(u=>e.jsxRuntimeExports.jsxs(i.CommandItem,{value:u.uuid,onSelect:f=>{o(f),x(!1)},children:[u.name,e.jsxRuntimeExports.jsx(N.CheckIcon,{className:I.cn("ml-auto h-4 w-4",n===u.uuid?"opacity-100":"opacity-0")})]},u.uuid))})]})]})})]}):null}const M=({block:t,closePopover:n,library:o})=>{const[l,x]=g.useState(!1),r=p.useBuilderProp("getUILibraryBlock",s.noop),{addCoreBlock:j,addPredefinedBlock:u}=p.useAddBlock(),[f,q]=p.useSelectedBlockIds(),[,b]=p.useHighlightBlockId(),h=s.get(t,"name",s.get(t,"label")),k=P.useFeature("dnd"),[,v]=R.useAtom(p.draggedBlockAtom),a=c=>{const m=s.has(c,"styles_attrs.data-page-section");return c._type==="Box"&&m},w=g.useCallback(async c=>{if(c.stopPropagation(),s.has(t,"component")){j(t,s.first(f)),n();return}x(!0);const m=await r(o,t);let E=s.first(f);a(s.first(m))&&(E=null),s.isEmpty(m)||u(C.syncBlocksWithDefaults(m),E),n()},[t]),d=async c=>{const m=await r(o,t);let E=s.first(f);if(a(s.first(m))&&(E=null),!s.isEmpty(m)){const y={blocks:m,uiLibrary:!0,parent:E};if(c.dataTransfer.setData("text/plain",JSON.stringify(y)),t.preview){const B=new Image;B.src=t.preview,B.onload=()=>{c.dataTransfer.setDragImage(B,0,0)}}else c.dataTransfer.setDragImage(new Image,0,0);v(y),setTimeout(()=>{q([]),b(null),n()},200)}};return e.jsxRuntimeExports.jsxs(i.Tooltip,{children:[e.jsxRuntimeExports.jsx(i.TooltipTrigger,{asChild:!0,children:e.jsxRuntimeExports.jsxs("div",{onClick:l?()=>{}:w,draggable:k?"true":"false",onDragStart:d,className:A("relative mt-2 cursor-pointer overflow-hidden rounded-md border border-gray-300 bg-white duration-200 hover:border-blue-500 hover:shadow-xl"),children:[l&&e.jsxRuntimeExports.jsxs("div",{className:"absolute flex h-full w-full items-center justify-center bg-black/70",children:[e.jsxRuntimeExports.jsx(T.Loader,{className:"animate-spin",size:15,color:"white"}),e.jsxRuntimeExports.jsx("span",{className:"pl-2 text-sm text-white",children:"Adding..."})]}),t.preview?e.jsxRuntimeExports.jsx("img",{src:t.preview,className:"min-h-[25px] w-full rounded-md",alt:h}):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:h})})]})}),e.jsxRuntimeExports.jsx(i.TooltipContent,{children:e.jsxRuntimeExports.jsx("p",{children:h})})]})},U=R.atom({}),z=t=>{const[n,o]=R.useAtom(U),l=p.useBuilderProp("getUILibraryBlocks",s.noop),x=s.get(n,`${t==null?void 0:t.uuid}.blocks`,[]),r=s.get(n,`${t==null?void 0:t.uuid}.loading`,!1);return g.useEffect(()=>{(async()=>{if(r||x.length>0||!t)return;o(u=>({...u,[t==null?void 0:t.uuid]:{loading:!0,blocks:[]}}));const j=await l(t);o(u=>({...u,[t==null?void 0:t.uuid]:{loading:!1,blocks:j||[]}}))})()},[t,x,r]),{data:x,isLoading:r}},G=p.atomWithStorage("_selectedLibrary",null),H=()=>{const[t,n]=R.useAtom(G),o=p.useBuilderProp("uiLibraries",[]),l=C.useChaiBlocks(),x=s.values(l).filter(d=>d.category==="custom"),r=o.find(d=>d.uuid===t)||s.first(o),{data:j,isLoading:u}=z(r),f=s.groupBy([...j,...x],"group"),[q,b]=g.useState("Hero"),[,h]=R.useAtom(p.activePanelAtom),k=s.get(f,q,[]),{t:v}=S.useTranslation(),a=g.useRef(null),w=d=>{a.current&&(clearTimeout(a.current),a.current=null),a.current=setTimeout(()=>{a.current&&b(d)},300)};return u?e.jsxRuntimeExports.jsx(i.Skeleton,{className:"h-full w-full"}):e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:e.jsxRuntimeExports.jsxs("div",{className:"relative flex h-full max-h-full w-[460px] flex-col overflow-hidden bg-background",children:[r!=null&&r.uuid?e.jsxRuntimeExports.jsx("div",{className:"sticky top-0 flex h-fit flex-col",children:e.jsxRuntimeExports.jsx("div",{className:"mb-2 flex flex-col justify-between rounded-md bg-background/30 p-1",children:e.jsxRuntimeExports.jsx("h1",{className:"flex w-full flex-col items-baseline truncate px-1 text-sm font-semibold xl:flex-col",children:e.jsxRuntimeExports.jsx(_,{library:r==null?void 0:r.uuid,setLibrary:n,uiLibraries:o})})})}):null,e.jsxRuntimeExports.jsxs("div",{className:"flex h-[95%] border-t border-gray-300 pt-2",children:[e.jsxRuntimeExports.jsx("div",{className:"flex h-full w-40 flex-col gap-1 px-1",children:g.Children.toArray(s.map(f,(d,c)=>e.jsxRuntimeExports.jsxs("div",{onMouseEnter:()=>w(c),onMouseLeave:()=>clearTimeout(a.current),onClick:()=>b(c),className:I.cn("flex w-full cursor-pointer items-center justify-between rounded-md p-1 text-sm transition-all ease-in-out hover:bg-gray-200",c===q?"bg-blue-500 text-white hover:bg-blue-600":""),children:[e.jsxRuntimeExports.jsx("span",{children:s.capitalize(c)}),e.jsxRuntimeExports.jsx(N.CaretRightIcon,{className:"ml-2 h-5 w-5"})]},c)))}),e.jsxRuntimeExports.jsxs(i.ScrollArea,{onMouseEnter:()=>a.current?clearTimeout(a.current):null,className:"z-10 -mt-2 flex h-full max-h-full w-[300px] flex-col gap-2 border-l border-gray-300 transition-all ease-linear",children:[e.jsxRuntimeExports.jsx("div",{className:"sticky top-0 z-30 border-b border-gray-300 bg-gray-200 p-2 text-[9px] font-light leading-3 text-gray-500",children:v("Click on a block to add it to the page")}),e.jsxRuntimeExports.jsx("div",{className:"flex flex-col gap-2 px-2",children:g.Children.toArray(k.map(d=>e.jsxRuntimeExports.jsx(M,{block:d,library:r,closePopover:()=>h(L.OUTLINE_KEY)})))}),e.jsxRuntimeExports.jsx("br",{}),e.jsxRuntimeExports.jsx("br",{}),e.jsxRuntimeExports.jsx("br",{})]})]})]})})},F=()=>e.jsxRuntimeExports.jsx(H,{});exports.default=F;
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-JYMCiFoE.cjs"),o=require("react"),l=require("lodash-es"),k=require("@radix-ui/react-icons"),A=require("unsplash-js"),d=require("./context-menu-_8TFbFEJ.cjs"),r=require("./select-fXj5tdMX.cjs");require("react-i18next");const T=require("./index-5hfuDpYs.cjs"),z=require("@react-hookz/web"),_=require("lucide-react");require("@radix-ui/react-switch");require("@radix-ui/react-accordion");require("class-variance-authority");require("@radix-ui/react-alert-dialog");require("@radix-ui/react-slot");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-hover-card");require("@radix-ui/react-dropdown-menu");require("@radix-ui/react-toast");require("cmdk");require("@radix-ui/react-dialog");require("@radix-ui/react-context-menu");require("clsx");require("tailwind-merge");require("@radix-ui/react-select");require("jotai");require("./iconBase-vJD0OXxU.cjs");require("@chaibuilder/runtime");require("./plugin-_F-KZp1i.cjs");require("tree-model");require("react-quill");require("./STRINGS-gPz7CUOk.cjs");require("react-hotkeys-hook");require("@floating-ui/dom");require("@floating-ui/react-dom");require("flagged");require("@tailwindcss/typography");require("@tailwindcss/forms");require("@tailwindcss/aspect-ratio");require("tailwindcss-palette-generator");require("react-wrap-balancer");require("react-dom");require("prop-types");require("@rjsf/validator-ajv8");require("@rjsf/core");require("react-arborist");require("himalaya");require("react-icons-picker");require("react-autosuggest");require("fuse.js");require("i18next");const g=async(j,E)=>new Promise((a,n)=>{A.createApi({accessKey:E}).search.getPhotos(j).then(u=>{a(u)}).catch(u=>n(u))}),D=({isModalView:j,onSelect:E})=>{const a=T.useBuilderProp("unsplashAccessKey",""),[n,f]=o.useState([]),[u,R]=o.useState(0),[c,b]=o.useState(),[x,I]=o.useState(),[w,y]=o.useState(0),[h,P]=z.useDebouncedState("",1e3),[q,m]=o.useState(!1),C=async s=>{if(l.isEmpty(h))return;let i=u+1;s&&(s.preventDefault(),i=1),m(!0),R(i);const p={query:h,page:i};c&&(p.orientation=c),x&&(p.color=x),g(p,a).then(t=>{var v,N,S;f(i===1?((v=t==null?void 0:t.response)==null?void 0:v.results)||[]:[...n,...((N=t==null?void 0:t.response)==null?void 0:N.results)||[]]),y((S=t==null?void 0:t.response)==null?void 0:S.total_pages),m(!1)}).catch(()=>{m(!1)})};return o.useEffect(()=>{if(!l.isEmpty(h)&&a){m(!0);const s={query:h,page:1};c&&(s.orientation=c),x&&(s.color=x),R(1),g(s,a).then(i=>{var p,t;f(((p=i==null?void 0:i.response)==null?void 0:p.results)||[]),y((t=i==null?void 0:i.response)==null?void 0:t.total_pages),m(!1)}).catch(()=>{m(!1)})}},[c,x,h,a]),l.isEmpty(a)?e.jsxRuntimeExports.jsx("div",{className:"h-full flex flex-col items-center justify-center",children:e.jsxRuntimeExports.jsxs("p",{className:"max-w-3xl text-center text-gray-500",children:["To enable Unsplash, kindly provide your",e.jsxRuntimeExports.jsx("a",{href:"https://unsplash.com/documentation#public-authentication",className:"underline px-1 hover:text-blue-400",target:"_blank",rel:"noopener noreferrer",children:"Unsplash Access Key"})]})}):e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsxs("form",{className:"flex items-center rounded-md border bg-gray-100 p-px",children:[e.jsxRuntimeExports.jsx(d.Input,{type:"text",name:"query",className:"input",placeholder:'Try "dog" or "apple"',onChange:s=>P(s.target.value)}),e.jsxRuntimeExports.jsxs(d.Popover,{children:[e.jsxRuntimeExports.jsx(d.PopoverTrigger,{asChild:!0,className:"h-full w-10 cursor-pointer p-2.5 hover:bg-slate-200",children:e.jsxRuntimeExports.jsx(k.MixerHorizontalIcon,{})}),e.jsxRuntimeExports.jsx(d.PopoverContent,{side:j?"bottom":"right",className:"z-[9999] flex w-max items-center justify-center",children:e.jsxRuntimeExports.jsxs("div",{children:[e.jsxRuntimeExports.jsx("div",{className:"py-1 text-sm font-medium",children:"Orientation"}),e.jsxRuntimeExports.jsxs(r.Select,{defaultValue:c,onValueChange:s=>b(s),children:[e.jsxRuntimeExports.jsx(r.SelectTrigger,{className:"h-auto w-40 p-1 px-3",children:e.jsxRuntimeExports.jsx(r.SelectValue,{placeholder:"Select"})}),e.jsxRuntimeExports.jsxs(r.SelectContent,{className:"z-[9999]",children:[e.jsxRuntimeExports.jsx(r.SelectItem,{value:"",children:"All"}),e.jsxRuntimeExports.jsx(r.SelectItem,{value:"landscape",children:"Landscape"}),e.jsxRuntimeExports.jsx(r.SelectItem,{value:"portrait",children:"Portrait"}),e.jsxRuntimeExports.jsx(r.SelectItem,{value:"squarish",children:"Square"})]})]}),e.jsxRuntimeExports.jsx("div",{className:"pb-1 pt-2 text-sm font-medium",children:"Color"}),e.jsxRuntimeExports.jsxs(r.Select,{defaultValue:x,onValueChange:s=>I(s),children:[e.jsxRuntimeExports.jsx(r.SelectTrigger,{className:"h-auto w-40 p-1 px-3",children:e.jsxRuntimeExports.jsx(r.SelectValue,{placeholder:"Select"})}),e.jsxRuntimeExports.jsxs(r.SelectContent,{className:"z-[9999]",children:[e.jsxRuntimeExports.jsx(r.SelectItem,{value:"",children:"All"}),["black_and_white","black","white","yellow","orange","red","purple","magenta","green","teal","blue"].map(s=>e.jsxRuntimeExports.jsx(r.SelectItem,{value:s,children:l.startCase(s)},s))]})]})]})})]})]}),e.jsxRuntimeExports.jsxs(d.ScrollArea,{className:`h-full ${j&&!l.isEmpty(n)?"-mx-2 flex flex-wrap px-2":"-mx-2 flex flex-col pb-8 pt-2"}`,children:[l.isEmpty(n)&&!q&&e.jsxRuntimeExports.jsxs("div",{className:"flex flex-col items-center justify-center py-6",children:[e.jsxRuntimeExports.jsx("div",{className:"font-medium",children:"No Data"}),e.jsxRuntimeExports.jsx("div",{className:"text-sm text-gray-500",children:"Enter query and press enter"})]}),j?e.jsxRuntimeExports.jsx("div",{className:"h-full columns-5 py-2",children:n.map(s=>e.jsxRuntimeExports.jsx("div",{role:"button",tabIndex:0,className:"my-1 flex",onClick:()=>E(s.urls.regular),children:e.jsxRuntimeExports.jsx("div",{className:"relative overflow-hidden rounded-md bg-cover bg-no-repeat",children:e.jsxRuntimeExports.jsx("img",{className:"h-auto flex-1 cursor-pointer rounded-md transition duration-300 ease-in-out hover:scale-105",alt:s.alt_description,src:s.urls.small})})},s.id))}):n.map(s=>e.jsxRuntimeExports.jsx("div",{className:"w-full px-2 py-1",children:e.jsxRuntimeExports.jsx("div",{className:"relative overflow-hidden rounded-md bg-cover bg-no-repeat",children:e.jsxRuntimeExports.jsx("img",{className:"h-auto cursor-pointer transition duration-300 ease-in-out hover:scale-105",alt:s.alt_description,src:s.urls.small})})},s.id)),q&&e.jsxRuntimeExports.jsxs("div",{className:"flex items-center justify-center py-8",children:[e.jsxRuntimeExports.jsx(_.Loader,{className:"animate-spin w-6 h-6"}),"  Loading..."]}),!l.isEmpty(n)&&u<w&&!q&&e.jsxRuntimeExports.jsx(d.Button,{size:"sm",variant:"link",className:"w-full",onClick:()=>C(void 0),disabled:q,children:q?"":"Load More"})]})]})};exports.default=D;exports.fetchImage=g;
@@ -1,58 +1,73 @@
1
- import { j as e } from "./jsx-runtime-WbnYoNE9.js";
1
+ import { j as e } from "./jsx-runtime-Sp0orL4X.js";
2
2
  import { useState as p, useEffect as D } from "react";
3
3
  import { isEmpty as d, startCase as E } from "lodash-es";
4
- import { MixerHorizontalIcon as F } from "@radix-ui/react-icons";
5
- import { createApi as L } from "unsplash-js";
6
- import { h as B, aF as K, a4 as U, a5 as V, a6 as O, bw as P, bx as C, by as S, bz as A, bA as h, aJ as Q, B as H } from "./index-C7mB4XFm.js";
7
- import { useDebouncedState as J } from "@react-hookz/web";
8
- import { Loader as R } from "lucide-react";
9
- import "./_commonjsHelpers-UyOWmZb0.js";
10
- import "@radix-ui/react-toggle";
11
- import "class-variance-authority";
12
- import "./utils-VpVqnC9m.js";
13
- import "./MODIFIERS-fd5XOmum.js";
14
- import "clsx";
15
- import "tailwind-merge";
4
+ import { MixerHorizontalIcon as L } from "@radix-ui/react-icons";
5
+ import { createApi as B } from "unsplash-js";
6
+ import { Q as F, P as K, s as Q, t as U, X as V, B as O } from "./context-menu-sks9vdzC.js";
7
+ import { S as P, c as S, b as C, d as I, f as h } from "./select-JW3OMYm-.js";
8
+ import "react-i18next";
9
+ import { c as H } from "./index-Zu-K_BX7.js";
10
+ import { useDebouncedState as R } from "@react-hookz/web";
11
+ import { Loader as X } from "lucide-react";
16
12
  import "@radix-ui/react-switch";
17
- import "@radix-ui/react-slot";
18
13
  import "@radix-ui/react-accordion";
14
+ import "class-variance-authority";
19
15
  import "@radix-ui/react-alert-dialog";
20
- import "@radix-ui/react-dialog";
16
+ import "@radix-ui/react-slot";
21
17
  import "@radix-ui/react-label";
22
18
  import "@radix-ui/react-scroll-area";
23
19
  import "@radix-ui/react-tabs";
24
20
  import "@radix-ui/react-tooltip";
25
21
  import "@radix-ui/react-popover";
26
- import "@radix-ui/react-menubar";
27
22
  import "@radix-ui/react-hover-card";
28
- import "@radix-ui/react-select";
29
23
  import "@radix-ui/react-dropdown-menu";
30
- import "@radix-ui/react-separator";
31
24
  import "@radix-ui/react-toast";
32
25
  import "cmdk";
26
+ import "@radix-ui/react-dialog";
33
27
  import "@radix-ui/react-context-menu";
34
- import "react-icons-picker";
35
- import "react-dom";
36
- import "react-quill";
37
- import "./Functions-7jnEwJyw.js";
38
- import "@chaibuilder/runtime";
28
+ import "clsx";
29
+ import "tailwind-merge";
30
+ import "@radix-ui/react-select";
39
31
  import "jotai";
32
+ import "./iconBase-zweRWSz0.js";
33
+ import "@chaibuilder/runtime";
34
+ import "./plugin-sJ3Hzvpv.js";
40
35
  import "tree-model";
41
- import "react-i18next";
42
- const I = async (x, g) => new Promise((o, r) => {
43
- L({ accessKey: g }).search.getPhotos(x).then((i) => {
36
+ import "react-quill";
37
+ import "./STRINGS--j49GZJP.js";
38
+ import "react-hotkeys-hook";
39
+ import "@floating-ui/dom";
40
+ import "@floating-ui/react-dom";
41
+ import "flagged";
42
+ import "@tailwindcss/typography";
43
+ import "@tailwindcss/forms";
44
+ import "@tailwindcss/aspect-ratio";
45
+ import "tailwindcss-palette-generator";
46
+ import "react-wrap-balancer";
47
+ import "react-dom";
48
+ import "prop-types";
49
+ import "@rjsf/validator-ajv8";
50
+ import "@rjsf/core";
51
+ import "react-arborist";
52
+ import "himalaya";
53
+ import "react-icons-picker";
54
+ import "react-autosuggest";
55
+ import "fuse.js";
56
+ import "i18next";
57
+ const k = async (x, g) => new Promise((o, a) => {
58
+ B({ accessKey: g }).search.getPhotos(x).then((i) => {
44
59
  o(i);
45
- }).catch((i) => r(i));
46
- }), De = ({ isModalView: x, onSelect: g }) => {
47
- const o = B("unsplashAccessKey", ""), [r, j] = p([]), [i, v] = p(0), [l, k] = p(), [n, q] = p(), [z, y] = p(0), [u, T] = J("", 1e3), [f, c] = p(!1), _ = async (s) => {
60
+ }).catch((i) => a(i));
61
+ }), Je = ({ isModalView: x, onSelect: g }) => {
62
+ const o = H("unsplashAccessKey", ""), [a, j] = p([]), [i, v] = p(0), [l, A] = p(), [n, q] = p(), [z, y] = p(0), [u, T] = R("", 1e3), [f, c] = p(!1), _ = async (s) => {
48
63
  if (d(u))
49
64
  return;
50
- let t = i + 1;
51
- s && (s.preventDefault(), t = 1), c(!0), v(t);
52
- const m = { query: u, page: t };
53
- l && (m.orientation = l), n && (m.color = n), I(m, o).then((a) => {
54
- var b, N, w;
55
- j(t === 1 ? ((b = a == null ? void 0 : a.response) == null ? void 0 : b.results) || [] : [...r, ...((N = a == null ? void 0 : a.response) == null ? void 0 : N.results) || []]), y((w = a == null ? void 0 : a.response) == null ? void 0 : w.total_pages), c(!1);
65
+ let r = i + 1;
66
+ s && (s.preventDefault(), r = 1), c(!0), v(r);
67
+ const m = { query: u, page: r };
68
+ l && (m.orientation = l), n && (m.color = n), k(m, o).then((t) => {
69
+ var N, b, w;
70
+ j(r === 1 ? ((N = t == null ? void 0 : t.response) == null ? void 0 : N.results) || [] : [...a, ...((b = t == null ? void 0 : t.response) == null ? void 0 : b.results) || []]), y((w = t == null ? void 0 : t.response) == null ? void 0 : w.total_pages), c(!1);
56
71
  }).catch(() => {
57
72
  c(!1);
58
73
  });
@@ -61,9 +76,9 @@ const I = async (x, g) => new Promise((o, r) => {
61
76
  if (!d(u) && o) {
62
77
  c(!0);
63
78
  const s = { query: u, page: 1 };
64
- l && (s.orientation = l), n && (s.color = n), v(1), I(s, o).then((t) => {
65
- var m, a;
66
- j(((m = t == null ? void 0 : t.response) == null ? void 0 : m.results) || []), y((a = t == null ? void 0 : t.response) == null ? void 0 : a.total_pages), c(!1);
79
+ l && (s.orientation = l), n && (s.color = n), v(1), k(s, o).then((r) => {
80
+ var m, t;
81
+ j(((m = r == null ? void 0 : r.response) == null ? void 0 : m.results) || []), y((t = r == null ? void 0 : r.response) == null ? void 0 : t.total_pages), c(!1);
67
82
  }).catch(() => {
68
83
  c(!1);
69
84
  });
@@ -83,7 +98,7 @@ const I = async (x, g) => new Promise((o, r) => {
83
98
  ] }) }) : /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
84
99
  /* @__PURE__ */ e.jsxs("form", { className: "flex items-center rounded-md border bg-gray-100 p-px", children: [
85
100
  /* @__PURE__ */ e.jsx(
86
- K,
101
+ F,
87
102
  {
88
103
  type: "text",
89
104
  name: "query",
@@ -92,18 +107,18 @@ const I = async (x, g) => new Promise((o, r) => {
92
107
  onChange: (s) => T(s.target.value)
93
108
  }
94
109
  ),
95
- /* @__PURE__ */ e.jsxs(U, { children: [
96
- /* @__PURE__ */ e.jsx(V, { asChild: !0, className: "h-full w-10 cursor-pointer p-2.5 hover:bg-slate-200", children: /* @__PURE__ */ e.jsx(F, {}) }),
110
+ /* @__PURE__ */ e.jsxs(K, { children: [
111
+ /* @__PURE__ */ e.jsx(Q, { asChild: !0, className: "h-full w-10 cursor-pointer p-2.5 hover:bg-slate-200", children: /* @__PURE__ */ e.jsx(L, {}) }),
97
112
  /* @__PURE__ */ e.jsx(
98
- O,
113
+ U,
99
114
  {
100
115
  side: x ? "bottom" : "right",
101
116
  className: "z-[9999] flex w-max items-center justify-center",
102
117
  children: /* @__PURE__ */ e.jsxs("div", { children: [
103
118
  /* @__PURE__ */ e.jsx("div", { className: "py-1 text-sm font-medium", children: "Orientation" }),
104
- /* @__PURE__ */ e.jsxs(P, { defaultValue: l, onValueChange: (s) => k(s), children: [
105
- /* @__PURE__ */ e.jsx(C, { className: "h-auto w-40 p-1 px-3", children: /* @__PURE__ */ e.jsx(S, { placeholder: "Select" }) }),
106
- /* @__PURE__ */ e.jsxs(A, { className: "z-[9999]", children: [
119
+ /* @__PURE__ */ e.jsxs(P, { defaultValue: l, onValueChange: (s) => A(s), children: [
120
+ /* @__PURE__ */ e.jsx(S, { className: "h-auto w-40 p-1 px-3", children: /* @__PURE__ */ e.jsx(C, { placeholder: "Select" }) }),
121
+ /* @__PURE__ */ e.jsxs(I, { className: "z-[9999]", children: [
107
122
  /* @__PURE__ */ e.jsx(h, { value: "", children: "All" }),
108
123
  /* @__PURE__ */ e.jsx(h, { value: "landscape", children: "Landscape" }),
109
124
  /* @__PURE__ */ e.jsx(h, { value: "portrait", children: "Portrait" }),
@@ -112,8 +127,8 @@ const I = async (x, g) => new Promise((o, r) => {
112
127
  ] }),
113
128
  /* @__PURE__ */ e.jsx("div", { className: "pb-1 pt-2 text-sm font-medium", children: "Color" }),
114
129
  /* @__PURE__ */ e.jsxs(P, { defaultValue: n, onValueChange: (s) => q(s), children: [
115
- /* @__PURE__ */ e.jsx(C, { className: "h-auto w-40 p-1 px-3", children: /* @__PURE__ */ e.jsx(S, { placeholder: "Select" }) }),
116
- /* @__PURE__ */ e.jsxs(A, { className: "z-[9999]", children: [
130
+ /* @__PURE__ */ e.jsx(S, { className: "h-auto w-40 p-1 px-3", children: /* @__PURE__ */ e.jsx(C, { placeholder: "Select" }) }),
131
+ /* @__PURE__ */ e.jsxs(I, { className: "z-[9999]", children: [
117
132
  /* @__PURE__ */ e.jsx(h, { value: "", children: "All" }),
118
133
  [
119
134
  "black_and_white",
@@ -136,15 +151,15 @@ const I = async (x, g) => new Promise((o, r) => {
136
151
  ] })
137
152
  ] }),
138
153
  /* @__PURE__ */ e.jsxs(
139
- Q,
154
+ V,
140
155
  {
141
- className: `h-full ${x && !d(r) ? "-mx-2 flex flex-wrap px-2" : "-mx-2 flex flex-col pb-8 pt-2"}`,
156
+ className: `h-full ${x && !d(a) ? "-mx-2 flex flex-wrap px-2" : "-mx-2 flex flex-col pb-8 pt-2"}`,
142
157
  children: [
143
- d(r) && !f && /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col items-center justify-center py-6", children: [
158
+ d(a) && !f && /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col items-center justify-center py-6", children: [
144
159
  /* @__PURE__ */ e.jsx("div", { className: "font-medium", children: "No Data" }),
145
160
  /* @__PURE__ */ e.jsx("div", { className: "text-sm text-gray-500", children: "Enter query and press enter" })
146
161
  ] }),
147
- x ? /* @__PURE__ */ e.jsx("div", { className: "h-full columns-5 py-2", children: r.map((s) => /* @__PURE__ */ e.jsx(
162
+ x ? /* @__PURE__ */ e.jsx("div", { className: "h-full columns-5 py-2", children: a.map((s) => /* @__PURE__ */ e.jsx(
148
163
  "div",
149
164
  {
150
165
  role: "button",
@@ -161,7 +176,7 @@ const I = async (x, g) => new Promise((o, r) => {
161
176
  ) })
162
177
  },
163
178
  s.id
164
- )) }) : r.map((s) => (
179
+ )) }) : a.map((s) => (
165
180
  // TODO: Drag and Drop Image to Canvas from Here use `pic.urls.[small, regular, full]` for image quality
166
181
  /* @__PURE__ */ e.jsx("div", { className: "w-full px-2 py-1", children: /* @__PURE__ */ e.jsx("div", { className: "relative overflow-hidden rounded-md bg-cover bg-no-repeat", children: /* @__PURE__ */ e.jsx(
167
182
  "img",
@@ -173,11 +188,11 @@ const I = async (x, g) => new Promise((o, r) => {
173
188
  ) }) }, s.id)
174
189
  )),
175
190
  f && /* @__PURE__ */ e.jsxs("div", { className: "flex items-center justify-center py-8", children: [
176
- /* @__PURE__ */ e.jsx(R, { className: "animate-spin w-6 h-6" }),
191
+ /* @__PURE__ */ e.jsx(X, { className: "animate-spin w-6 h-6" }),
177
192
  "  Loading..."
178
193
  ] }),
179
- !d(r) && i < z && !f && /* @__PURE__ */ e.jsx(
180
- H,
194
+ !d(a) && i < z && !f && /* @__PURE__ */ e.jsx(
195
+ O,
181
196
  {
182
197
  size: "sm",
183
198
  variant: "link",
@@ -193,6 +208,6 @@ const I = async (x, g) => new Promise((o, r) => {
193
208
  ] });
194
209
  };
195
210
  export {
196
- De as default,
197
- I as fetchImage
211
+ Je as default,
212
+ k as fetchImage
198
213
  };