@chaibuilder/sdk 1.2.9 → 1.2.10-7.beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (122) hide show
  1. package/README.md +26 -21
  2. package/dist/CodeEditor-3Vp79cuE.cjs +1 -0
  3. package/dist/CodeEditor-bUqM7eCa.js +129 -0
  4. package/dist/STRINGS-Xxstm-7I.js +7 -0
  5. package/dist/STRINGS-Yl7cSWDc.cjs +1 -0
  6. package/dist/Topbar-P7-9Rps1.js +124 -0
  7. package/dist/Topbar-xwQ4JUZD.cjs +1 -0
  8. package/dist/UnsplashImages-BxgbXGB6.cjs +1 -0
  9. package/dist/UnsplashImages-nQSvWPU0.js +244 -0
  10. package/dist/UploadImages-L9LlI-jl.cjs +1 -0
  11. package/dist/UploadImages-SVnIHigg.js +153 -0
  12. package/dist/context-menu-YGd09SE1.js +979 -0
  13. package/dist/context-menu-sQn7ryJ6.cjs +1 -0
  14. package/dist/{controls-XPXGHKht.js → controls-lEwMTdPQ.js} +96 -44
  15. package/dist/controls-p9IwFnPx.cjs +1 -0
  16. package/dist/core.cjs +1 -1
  17. package/dist/core.d.ts +344 -119
  18. package/dist/core.js +111 -88
  19. package/dist/iconBase-Ief2hJUZ.js +130 -0
  20. package/dist/iconBase-aZzpqff_.cjs +1 -0
  21. package/dist/index-3NV_rst1.js +9051 -0
  22. package/dist/index-qTKBamQ6.cjs +63 -0
  23. package/dist/jsx-runtime-JYMCiFoE.cjs +27 -0
  24. package/dist/{jsx-runtime-WbnYoNE9.js → jsx-runtime-Sp0orL4X.js} +106 -109
  25. package/dist/mockServiceWorker.js +18 -10
  26. package/dist/plugin-UiUFs2fK.js +44 -0
  27. package/dist/plugin-f6SDZ_Or.js +108 -0
  28. package/dist/plugin-jum1MjXp.cjs +1 -0
  29. package/dist/plugin-xOpS-UNV.cjs +1 -0
  30. package/dist/render.cjs +3 -1
  31. package/dist/render.d.ts +21 -40
  32. package/dist/render.js +129 -85
  33. package/dist/runtime.cjs +1 -0
  34. package/dist/runtime.d.ts +5 -0
  35. package/dist/runtime.js +21 -0
  36. package/dist/style.css +2 -2
  37. package/dist/tailwind.cjs +1 -1
  38. package/dist/tailwind.d.ts +49 -8
  39. package/dist/tailwind.js +16 -20
  40. package/dist/ui.cjs +1 -1
  41. package/dist/ui.d.ts +3 -13
  42. package/dist/ui.js +363 -163
  43. package/dist/web-blocks.cjs +3 -9
  44. package/dist/web-blocks.d.ts +1 -1
  45. package/dist/web-blocks.js +722 -770
  46. package/package.json +66 -83
  47. package/dist/AddBlocks-tMxKPoen.js +0 -225
  48. package/dist/AddBlocks-x2LkOHSj.cjs +0 -1
  49. package/dist/BrandingOptions-EzT9UYd6.cjs +0 -1
  50. package/dist/BrandingOptions-QJJ1y5ez.js +0 -194
  51. package/dist/CanvasArea-mlNKmCOh.js +0 -1425
  52. package/dist/CanvasArea-xs4wM64L.cjs +0 -60
  53. package/dist/CurrentPage-aaU4F7wi.cjs +0 -1
  54. package/dist/CurrentPage-lBy25sZn.js +0 -111
  55. package/dist/Functions-7jnEwJyw.js +0 -15
  56. package/dist/Functions-N3yhPYKY.cjs +0 -1
  57. package/dist/Layers-3Xs4A5i8.js +0 -404
  58. package/dist/Layers-eaHy5PK9.cjs +0 -1
  59. package/dist/MODIFIERS-2FeVfZQ9.cjs +0 -1
  60. package/dist/MODIFIERS-RiXS5Mn1.js +0 -67
  61. package/dist/MarkAsGlobalBlock-BjP-Rqlf.js +0 -88
  62. package/dist/MarkAsGlobalBlock-X5dNmZcb.cjs +0 -1
  63. package/dist/PagesPanel--BZhafnt.js +0 -69
  64. package/dist/PagesPanel-gGKCV394.cjs +0 -1
  65. package/dist/ProjectPanel-YcLkM-DW.js +0 -90
  66. package/dist/ProjectPanel-yFJRy0_E.cjs +0 -1
  67. package/dist/Settings-7wlLcvoh.cjs +0 -1
  68. package/dist/Settings-TAgX4hov.js +0 -2186
  69. package/dist/SidePanels-5H4j0mIs.cjs +0 -1
  70. package/dist/SidePanels-btVQQkVK.js +0 -349
  71. package/dist/Topbar-V8xCetWF.cjs +0 -1
  72. package/dist/Topbar-j4t4AgCq.js +0 -116
  73. package/dist/UnsplashImages-41Y3q5_Q.js +0 -200
  74. package/dist/UnsplashImages-DbHky6cj.cjs +0 -1
  75. package/dist/UploadImages-DnQ95_NW.cjs +0 -1
  76. package/dist/UploadImages-xBg-kbKv.js +0 -138
  77. package/dist/_commonjsHelpers-UyOWmZb0.js +0 -8
  78. package/dist/_commonjsHelpers-wDK0ZLPo.cjs +0 -1
  79. package/dist/add-page-modal-MwS7iXn_.cjs +0 -1
  80. package/dist/add-page-modal-cm8damU2.js +0 -108
  81. package/dist/confirm-alert-U7-NcG7G.cjs +0 -1
  82. package/dist/confirm-alert-i4pM3mOt.js +0 -62
  83. package/dist/controls-Dy1qa8Dc.cjs +0 -1
  84. package/dist/delete-page-modal-5o4jXu-z.cjs +0 -1
  85. package/dist/delete-page-modal-YrIBvfFA.js +0 -88
  86. package/dist/email-blocks.cjs +0 -1
  87. package/dist/email-blocks.d.ts +0 -3
  88. package/dist/email-blocks.js +0 -274
  89. package/dist/form-OVmsLOrc.js +0 -125
  90. package/dist/form-VbouZlAW.cjs +0 -1
  91. package/dist/functions-Ox_svtKm.cjs +0 -1
  92. package/dist/functions-xIebp8Aw.js +0 -23
  93. package/dist/html-to-json-2PeOCVey.cjs +0 -1
  94. package/dist/html-to-json-57841sEK.js +0 -183
  95. package/dist/index-H6vIwGfD.cjs +0 -1
  96. package/dist/index-N50dZnlC.cjs +0 -206
  97. package/dist/index-e0c8PmRQ.js +0 -205
  98. package/dist/index-gi1LIOCw.cjs +0 -1
  99. package/dist/index-niHREMmR.js +0 -2938
  100. package/dist/index-pZhGT8uT.js +0 -41620
  101. package/dist/jsx-runtime-Z_BpKhVy.cjs +0 -27
  102. package/dist/lib.cjs +0 -4
  103. package/dist/lib.d.ts +0 -78
  104. package/dist/lib.js +0 -1322
  105. package/dist/page-viewer-SLt8XgYv.cjs +0 -1
  106. package/dist/page-viewer-feqJr1QI.js +0 -115
  107. package/dist/project-general-setting-SgagORzW.js +0 -83
  108. package/dist/project-general-setting-ym0yCdOq.cjs +0 -1
  109. package/dist/project-seo-setting-Snn2nZgS.cjs +0 -1
  110. package/dist/project-seo-setting-wxAGEkd_.js +0 -85
  111. package/dist/server.cjs +0 -1
  112. package/dist/server.d.ts +0 -299
  113. package/dist/server.js +0 -216
  114. package/dist/single-page-detail-IPod1o5P.cjs +0 -1
  115. package/dist/single-page-detail-dnWMyg6P.js +0 -222
  116. package/dist/studio.cjs +0 -1
  117. package/dist/studio.d.ts +0 -13
  118. package/dist/studio.js +0 -58
  119. package/dist/useAddBlockByDrop-_nwI4W3q.js +0 -20
  120. package/dist/useAddBlockByDrop-inkD7Lck.cjs +0 -1
  121. package/dist/utils-AvyFzbPC.js +0 -1075
  122. package/dist/utils-PTxFk6qT.cjs +0 -1
@@ -0,0 +1,153 @@
1
+ import { j as e } from "./jsx-runtime-Sp0orL4X.js";
2
+ import { useState as l, useEffect as k } from "react";
3
+ import { isEmpty as j, map as b } from "lodash-es";
4
+ import { atom as F, useAtom as U } from "jotai";
5
+ import { S as C } from "./context-menu-YGd09SE1.js";
6
+ import { useTranslation as S } from "react-i18next";
7
+ import { d as N } from "./index-3NV_rst1.js";
8
+ import { Upload as E, Loader as G } from "lucide-react";
9
+ import "@radix-ui/react-switch";
10
+ import "@radix-ui/react-accordion";
11
+ import "@radix-ui/react-icons";
12
+ import "class-variance-authority";
13
+ import "@radix-ui/react-alert-dialog";
14
+ import "@radix-ui/react-slot";
15
+ import "@radix-ui/react-label";
16
+ import "@radix-ui/react-scroll-area";
17
+ import "@radix-ui/react-tabs";
18
+ import "@radix-ui/react-tooltip";
19
+ import "@radix-ui/react-popover";
20
+ import "@radix-ui/react-hover-card";
21
+ import "@radix-ui/react-select";
22
+ import "@radix-ui/react-dropdown-menu";
23
+ import "@radix-ui/react-separator";
24
+ import "@radix-ui/react-toast";
25
+ import "cmdk";
26
+ import "@radix-ui/react-dialog";
27
+ import "@radix-ui/react-context-menu";
28
+ import "clsx";
29
+ import "tailwind-merge";
30
+ import "./iconBase-Ief2hJUZ.js";
31
+ import "@chaibuilder/runtime";
32
+ import "./plugin-f6SDZ_Or.js";
33
+ import "@react-hookz/web";
34
+ import "tree-model";
35
+ import "react-quill";
36
+ import "./STRINGS-Xxstm-7I.js";
37
+ import "flagged";
38
+ import "react-hotkeys-hook";
39
+ import "@floating-ui/dom";
40
+ import "@floating-ui/react-dom";
41
+ import "react-event-hook";
42
+ import "@tailwindcss/typography";
43
+ import "@tailwindcss/forms";
44
+ import "@tailwindcss/aspect-ratio";
45
+ import "react-wrap-balancer";
46
+ import "react-dom";
47
+ import "prop-types";
48
+ import "react-error-boundary";
49
+ import "re-resizable";
50
+ import "@rjsf/validator-ajv8";
51
+ import "@rjsf/core";
52
+ import "./controls-lEwMTdPQ.js";
53
+ import "react-arborist";
54
+ import "himalaya";
55
+ import "react-icons-picker";
56
+ import "react-autosuggest";
57
+ import "fuse.js";
58
+ import "i18next";
59
+ import "framer-motion";
60
+ const P = F([]), Re = ({ isModalView: s, onSelect: m }) => {
61
+ const { t: r } = S(), c = N("uploadMediaCallback"), n = N("fetchMediaCallback"), [i, d] = U(P), [y, u] = l(!1), [x, f] = l(!1), [, v] = l(), [h, p] = l("");
62
+ k(() => {
63
+ (async () => {
64
+ if (!n)
65
+ return;
66
+ f(!0);
67
+ const t = await n();
68
+ d(t || []), f(!1);
69
+ })();
70
+ }, []);
71
+ const w = (t) => {
72
+ var o, a;
73
+ if (p(""), t && ((a = (o = t == null ? void 0 : t.target) == null ? void 0 : o.files) == null ? void 0 : a.length) > 0) {
74
+ const g = t.target.files[0];
75
+ g.type.startsWith("image") ? I(g) : p(r("Please select an image"));
76
+ }
77
+ }, I = async (t) => {
78
+ if (c) {
79
+ u(!0);
80
+ try {
81
+ const { url: o } = await c(t);
82
+ m(o), v(void 0);
83
+ const a = await n();
84
+ d(a);
85
+ } catch (o) {
86
+ d([]), p((o == null ? void 0 : o.message) || "Something went wrong.");
87
+ }
88
+ u(!1);
89
+ }
90
+ };
91
+ return /* @__PURE__ */ e.jsxs("div", { children: [
92
+ /* @__PURE__ */ e.jsxs("label", { htmlFor: s ? "upload-in-modal" : "upload-in-panel", children: [
93
+ /* @__PURE__ */ e.jsx("div", { className: "flex flex-col items-center rounded-lg", children: /* @__PURE__ */ e.jsxs(
94
+ "label",
95
+ {
96
+ htmlFor: "image-upload",
97
+ className: "flex w-full cursor-pointer flex-col items-center justify-center rounded-lg border-2 border-dashed border-border",
98
+ children: [
99
+ /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col items-center justify-center pb-6 pt-5", children: [
100
+ /* @__PURE__ */ e.jsx(E, { className: "mb-3 h-10 w-10 text-gray-400" }),
101
+ /* @__PURE__ */ e.jsx("p", { className: "mb-2 text-sm text-gray-500 dark:text-gray-400", children: /* @__PURE__ */ e.jsx("span", { className: "font-semibold", children: r("Click to upload") }) }),
102
+ /* @__PURE__ */ e.jsx("p", { className: "text-xs text-gray-500 dark:text-gray-400", children: r("SVG, PNG, JPG or GIF (Max. 2mb)") })
103
+ ] }),
104
+ y ? /* @__PURE__ */ e.jsxs("div", { className: "flex h-full w-full items-center justify-center", children: [
105
+ /* @__PURE__ */ e.jsx(G, { className: "h-6 w-6 animate-spin" }),
106
+ /* @__PURE__ */ e.jsx("span", { className: "ml-2 text-sm text-gray-500", children: r("Uploading...") })
107
+ ] }) : null,
108
+ h && /* @__PURE__ */ e.jsx("p", { className: "pb-2 text-xs text-red-500", children: h || r("Something went wrong") })
109
+ ]
110
+ }
111
+ ) }),
112
+ /* @__PURE__ */ e.jsx(
113
+ "input",
114
+ {
115
+ type: "file",
116
+ id: "image-upload",
117
+ accept: "image/*",
118
+ hidden: !0,
119
+ onChange: w
120
+ }
121
+ )
122
+ ] }),
123
+ /* @__PURE__ */ e.jsxs(C, { className: `-mx-2 flex h-full flex-col pb-8 pt-2 ${s ? "px-2" : ""} pt-2`, children: [
124
+ j(i) && x && /* @__PURE__ */ e.jsx("div", { className: "flex flex-col items-center justify-center py-6", children: /* @__PURE__ */ e.jsx("div", { className: "animate-pulse font-medium", children: r("Fetching...") }) }),
125
+ j(i) && !x && /* @__PURE__ */ e.jsxs("div", { className: "flex h-full flex-col items-center justify-center text-center", children: [
126
+ /* @__PURE__ */ e.jsx("div", { className: "mb-4 h-12 rounded-full p-6" }),
127
+ /* @__PURE__ */ e.jsx("h3", { className: "mb-2 text-sm font-semibold", children: r("No images found") }),
128
+ /* @__PURE__ */ e.jsx("p", { className: "mb-4 max-w-sm text-muted-foreground", children: r("It looks like you haven't uploaded any images yet. Start by clicking the upload button above.") })
129
+ ] }),
130
+ s ? /* @__PURE__ */ e.jsx("div", { className: "h-full columns-5 py-2", children: b(i, (t) => /* @__PURE__ */ e.jsx("div", { role: "button", tabIndex: 0, className: "my-1 flex", onClick: () => m(t.url), children: /* @__PURE__ */ e.jsx("div", { className: "relative overflow-hidden rounded-md bg-cover bg-no-repeat", children: /* @__PURE__ */ e.jsx(
131
+ "img",
132
+ {
133
+ className: "h-auto flex-1 cursor-pointer rounded-md transition duration-300 ease-in-out hover:scale-105",
134
+ alt: t.name,
135
+ src: t.thumbUrl
136
+ }
137
+ ) }) }, t.id)) }) : b(i, (t) => (
138
+ // TODO: Drag and Drop Image to Canvas from Here use `pic.url` for image quality
139
+ /* @__PURE__ */ e.jsx("div", { role: "button", tabIndex: 0, className: "px-2 py-1", onClick: () => m(t.url), children: /* @__PURE__ */ e.jsx("div", { className: "relative overflow-hidden rounded-md bg-cover bg-no-repeat", children: /* @__PURE__ */ e.jsx(
140
+ "img",
141
+ {
142
+ className: "h-auto w-full cursor-pointer transition duration-300 ease-in-out hover:scale-105",
143
+ alt: t.name,
144
+ src: t.url
145
+ }
146
+ ) }) }, t.id)
147
+ ))
148
+ ] })
149
+ ] });
150
+ };
151
+ export {
152
+ Re as default
153
+ };