@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.
- package/dist/{AddBlocks-H7BZYHUC.js → AddBlocks-eoo1CzaK.js} +114 -111
- package/dist/AddBlocks-jU0NwP_s.cjs +3 -0
- package/dist/BrandingOptions-WSCFnWAf.cjs +1 -0
- package/dist/{BrandingOptions-PAgY-kvj.js → BrandingOptions-_Og7VUHA.js} +57 -41
- package/dist/{CanvasArea-zn2ox-5h.js → CanvasArea-cky_d2Lu.js} +517 -519
- package/dist/CanvasArea-hT9uHhkz.cjs +46 -0
- package/dist/Class-RZuPYbUS.cjs +1 -0
- package/dist/{Class-l7qYbuoN.js → Class-nQk08vqd.js} +204 -124
- package/dist/{CurrentPage-6Jp4xAWK.js → CurrentPage--OlBwyNE.js} +58 -40
- package/dist/CurrentPage-x6Ez11gP.cjs +1 -0
- package/dist/Layers-gEA0qWYP.cjs +1 -0
- package/dist/{Layers-WkZ48AUm.js → Layers-uzA3QA-4.js} +158 -141
- package/dist/MarkAsGlobalBlock-lYL8cO9x.cjs +1 -0
- package/dist/MarkAsGlobalBlock-ySc-D4SB.js +84 -0
- package/dist/PagesPanel-5t0bV9T2.cjs +1 -0
- package/dist/PagesPanel-tH6c9Mnv.js +70 -0
- package/dist/ProjectPanel-NdrR6a8t.cjs +1 -0
- package/dist/ProjectPanel-Q2-15-In.js +91 -0
- package/dist/Settings-DBiwm1hY.cjs +1 -0
- package/dist/{Settings-fH8fZKpm.js → Settings-LOqpvQ_1.js} +411 -408
- package/dist/SidePanels-8JWYXGqN.cjs +1 -0
- package/dist/{SidePanels-w8ZHKJaR.js → SidePanels-F7ccs2Xf.js} +106 -88
- package/dist/{Topbar-hm1D_5sb.js → Topbar-lX9OMPwj.js} +47 -45
- package/dist/Topbar-qi5ab8rR.cjs +1 -0
- package/dist/UnsplashImages-a2r7b3kB.cjs +1 -0
- package/dist/{UnsplashImages-gPcBLjgB.js → UnsplashImages-u_QTABzi.js} +56 -44
- package/dist/{UploadImages-_ZyUU66E.js → UploadImages-gV5xDHIu.js} +55 -34
- package/dist/UploadImages-jLQgLujd.cjs +1 -0
- package/dist/add-page-modal-U5ramelz.js +110 -0
- package/dist/add-page-modal-tIt3N8jH.cjs +1 -0
- package/dist/confirm-alert-ZQ-sxX0X.js +58 -0
- package/dist/confirm-alert-z74-fGOT.cjs +1 -0
- package/dist/core.cjs +1 -1
- package/dist/core.js +99 -124
- package/dist/delete-page-modal-5XuSfQT0.cjs +1 -0
- package/dist/delete-page-modal-_E87bVUZ.js +89 -0
- package/dist/form-Osm1AmO5.cjs +1 -0
- package/dist/{form-dVpOAyRl.js → form-zZJyZuNH.js} +12 -12
- package/dist/index-2EHcmZqL.js +2947 -0
- package/dist/index-RVm8Txnj.js +1149 -0
- package/dist/index-_jFEo7h5.cjs +206 -0
- package/dist/index-c8zW_D2V.cjs +1 -0
- package/dist/index-cU5eyVRU.js +40872 -0
- package/dist/index-fwo4wa7u.cjs +1 -0
- package/dist/index-gmZcUXyn.js +25 -0
- package/dist/index-m2muA80V.cjs +9 -0
- package/dist/{jsx-runtime-JYMCiFoE.cjs → jsx-runtime-WKRPbKtm.cjs} +7 -7
- package/dist/{jsx-runtime-Sp0orL4X.js → jsx-runtime-qAwJ85SY.js} +109 -106
- package/dist/lib.cjs +2 -1
- package/dist/lib.js +1333 -71
- package/dist/page-viewer-BSc-5M4B.cjs +1 -0
- package/dist/{page-viewer-Y4YiaZ_m.js → page-viewer-nLqIs_9w.js} +62 -44
- package/dist/project-general-setting-14MA_cX5.cjs +1 -0
- package/dist/{project-general-setting-U4S_KlhU.js → project-general-setting-kXh5myAr.js} +46 -36
- package/dist/project-seo-setting-POGPEJZ8.cjs +1 -0
- package/dist/project-seo-setting-nT1qo1Bb.js +89 -0
- package/dist/render.cjs +1 -1
- package/dist/render.js +23 -19
- package/dist/server.cjs +1 -1
- package/dist/server.js +1 -1
- package/dist/single-page-detail-EgQd9TSA.cjs +1 -0
- package/dist/{single-page-detail-pAxCy_Pe.js → single-page-detail-fV-A6vJR.js} +90 -80
- package/dist/studio.cjs +1 -1
- package/dist/studio.js +45 -25
- package/dist/ui.cjs +1 -1
- package/dist/ui.js +156 -357
- package/package.json +1 -1
- package/dist/AddBlocks-7ACJv8LW.cjs +0 -3
- package/dist/BrandingOptions-5j-XszLM.cjs +0 -1
- package/dist/CanvasArea-Dnm-yeus.cjs +0 -46
- package/dist/ChaiBuilderEditor-BoE-sArB.cjs +0 -163
- package/dist/ChaiBuilderEditor-hEuUONQ3.js +0 -27094
- package/dist/Class-_uCzl5v1.cjs +0 -1
- package/dist/CurrentPage-YMpqOqx7.cjs +0 -1
- package/dist/ImagesPanel-6us7hiLN.cjs +0 -1
- package/dist/ImagesPanel-oaHOD-Ex.js +0 -27
- package/dist/Layers-EzOZdWvd.cjs +0 -1
- package/dist/MODIFIERS-DsEzQ3aH.js +0 -73
- package/dist/MODIFIERS-Fx6WAZcw.cjs +0 -1
- package/dist/MarkAsGlobalBlock-0HubcRkY.js +0 -77
- package/dist/MarkAsGlobalBlock-HmeIyLCP.cjs +0 -1
- package/dist/PagesPanel-6JuwBLFQ.js +0 -50
- package/dist/PagesPanel-zJq8p1ja.cjs +0 -1
- package/dist/ProjectPanel-Zml2F8b9.cjs +0 -1
- package/dist/ProjectPanel-cu2QSDW9.js +0 -73
- package/dist/Settings-lc9PfnmG.cjs +0 -1
- package/dist/SidePanels-VH72zFE2.cjs +0 -1
- package/dist/Topbar-vQPo9xSY.cjs +0 -1
- package/dist/UnsplashImages-BoBBSi1a.cjs +0 -1
- package/dist/UploadImages-T6kW0s3G.cjs +0 -1
- package/dist/accordion-oPUeqPCZ.js +0 -42
- package/dist/accordion-ynvFtV_p.cjs +0 -1
- package/dist/add-page-modal--qZSwJuB.cjs +0 -1
- package/dist/add-page-modal-bj7qbZuK.js +0 -99
- package/dist/alert-dialog-GNfnpqFB.js +0 -64
- package/dist/alert-dialog-Mv0-wAvS.cjs +0 -1
- package/dist/command-ThdTuUxt.cjs +0 -1
- package/dist/command-VHca6CcN.js +0 -97
- package/dist/confirm-alert-8EHe0OOd.cjs +0 -1
- package/dist/confirm-alert-b0e_BLhF.js +0 -36
- package/dist/context-menu-8dC9uGXj.js +0 -122
- package/dist/context-menu-IgLbIuth.cjs +0 -1
- package/dist/controls-Ni5kEzLz.js +0 -103
- package/dist/controls-W97-POR_.cjs +0 -1
- package/dist/controls-enQY7NI8.js +0 -118
- package/dist/controls-xUKa23ic.cjs +0 -1
- package/dist/delete-page-modal-2LuDLEiP.cjs +0 -1
- package/dist/delete-page-modal-cnrR8tWH.js +0 -69
- package/dist/dialog-S_QbL1iq.cjs +0 -1
- package/dist/dialog-jrw9DF1f.js +0 -65
- package/dist/dropdown-menu-S03K_fNs.js +0 -164
- package/dist/dropdown-menu-sMXR59cB.cjs +0 -1
- package/dist/form-nRAvKPQj.cjs +0 -1
- package/dist/functions-nNTuSTsR.js +0 -1106
- package/dist/functions-pcUZhFJM.js +0 -12
- package/dist/functions-sCuB7nvZ.cjs +0 -2
- package/dist/functions-uw7QP2kT.cjs +0 -1
- package/dist/html-to-json-P6GpbcQX.cjs +0 -1
- package/dist/html-to-json-pdHQfRkN.js +0 -178
- package/dist/index-HAue58ea.cjs +0 -1
- package/dist/index-T4_wfKl5.js +0 -2256
- package/dist/index-X9ZgD09V.cjs +0 -1
- package/dist/index-ehKdBRUK.js +0 -18
- package/dist/label-KaP7MRrs.js +0 -10
- package/dist/label-tFm8HZdb.cjs +0 -1
- package/dist/link-6o6n2Tnd.js +0 -204
- package/dist/link-ece8dZGH.cjs +0 -1
- package/dist/page-viewer-IARz6OSp.cjs +0 -1
- package/dist/popover-a84pbVhQ.js +0 -23
- package/dist/popover-fKjgcRUx.cjs +0 -1
- package/dist/project-general-setting-eSl3t-VH.cjs +0 -1
- package/dist/project-seo-setting-Ga9v_ECU.js +0 -67
- package/dist/project-seo-setting-rankm1z3.cjs +0 -1
- package/dist/scroll-area-FiHvy-TZ.cjs +0 -1
- package/dist/scroll-area-ewXbxc3n.js +0 -30
- package/dist/select-7bjg-rr9.cjs +0 -1
- package/dist/select-POGdEDHT.js +0 -75
- package/dist/separator-3Civ-6hb.cjs +0 -1
- package/dist/separator-SctTn0Qi.js +0 -18
- package/dist/single-page-detail-yPgnu2AI.cjs +0 -1
- package/dist/skeleton-CU_FIbg3.js +0 -239
- package/dist/skeleton-JHP9zwL2.cjs +0 -1
- package/dist/tabs-Gb9v5dVb.js +0 -46
- package/dist/tabs-iWeaaVrg.cjs +0 -1
- package/dist/textarea-1kZEh7ki.cjs +0 -1
- package/dist/textarea-b2QvVhrK.js +0 -73
- package/dist/toggle-ASJRAaGP.js +0 -30
- package/dist/toggle-ehNIPmme.cjs +0 -1
- package/dist/useAddBlock-WJc3OgG8.js +0 -86
- package/dist/useAddBlock-dCKRFPRU.cjs +0 -1
- package/dist/useAllBlocks-6hvuNuyw.cjs +0 -1
- package/dist/useAllBlocks-PQKYvs-e.js +0 -20
- package/dist/useChaiExternalData-4K9WxANa.js +0 -6
- package/dist/useChaiExternalData-DkyBJ81C.cjs +0 -1
- package/dist/useDarkMode-ZKCO_gkt.js +0 -23
- package/dist/useDarkMode-dV6FM6l-.cjs +0 -1
- package/dist/useFeatureSupport-OLwNgEZb.js +0 -16
- package/dist/useFeatureSupport-c9IgPW2t.cjs +0 -1
- package/dist/useHiddenBlocks-3MsGOJ1s.js +0 -15
- package/dist/useHiddenBlocks-oJuQDmTy.cjs +0 -1
- package/dist/useLanguage-NKKKaxVM.cjs +0 -1
- package/dist/useLanguage-gVC5rxO5.js +0 -216
- package/dist/useMarkAsGlobalBlock-X73Vny8u.js +0 -25
- package/dist/useMarkAsGlobalBlock-ebBVGHg4.cjs +0 -1
- package/dist/useUiLibraries-4hPOi8DI.js +0 -12
- package/dist/useUiLibraries-9FhQCpKo.cjs +0 -1
- package/dist/utils-dze1SGvB.js +0 -6
- package/dist/utils-qK_SjzzV.cjs +0 -1
|
@@ -1,60 +1,72 @@
|
|
|
1
|
-
import { j as e } from "./jsx-runtime-
|
|
2
|
-
import { useState as
|
|
3
|
-
import { isEmpty as
|
|
1
|
+
import { j as e } from "./jsx-runtime-qAwJ85SY.js";
|
|
2
|
+
import { useState as p, useEffect as D } from "react";
|
|
3
|
+
import { isEmpty as d, startCase as E } from "lodash";
|
|
4
4
|
import { MixerHorizontalIcon as L } from "@radix-ui/react-icons";
|
|
5
5
|
import { createApi as B } from "unsplash-js";
|
|
6
|
-
import {
|
|
7
|
-
import { I as U } from "./command-VHca6CcN.js";
|
|
8
|
-
import { S as V } from "./scroll-area-ewXbxc3n.js";
|
|
9
|
-
import { P as O, a as Q, b as H } from "./popover-a84pbVhQ.js";
|
|
10
|
-
import { S as P, c as S, b as C, d as I, f as h } from "./select-POGdEDHT.js";
|
|
11
|
-
import "react-i18next";
|
|
6
|
+
import { i as F, bm as K, b1 as U, b2 as V, b3 as O, au as P, av as C, aw as S, ax as I, ay as h, bp as Q, B as H } from "./index-2EHcmZqL.js";
|
|
12
7
|
import { useDebouncedState as R } from "@react-hookz/web";
|
|
13
8
|
import { Loader as $ } from "lucide-react";
|
|
14
|
-
import "
|
|
15
|
-
import "@radix-ui/react-slot";
|
|
16
|
-
import "class-variance-authority";
|
|
17
|
-
import "./utils-dze1SGvB.js";
|
|
9
|
+
import "./Class-nQk08vqd.js";
|
|
18
10
|
import "clsx";
|
|
19
11
|
import "tailwind-merge";
|
|
20
|
-
import "@radix-ui/react-
|
|
21
|
-
import "
|
|
22
|
-
import "
|
|
23
|
-
import "
|
|
12
|
+
import "@radix-ui/react-toggle";
|
|
13
|
+
import "class-variance-authority";
|
|
14
|
+
import "@radix-ui/react-switch";
|
|
15
|
+
import "@radix-ui/react-slot";
|
|
16
|
+
import "@radix-ui/react-accordion";
|
|
17
|
+
import "@radix-ui/react-alert-dialog";
|
|
24
18
|
import "@radix-ui/react-dialog";
|
|
19
|
+
import "@radix-ui/react-label";
|
|
25
20
|
import "@radix-ui/react-scroll-area";
|
|
21
|
+
import "@radix-ui/react-tabs";
|
|
22
|
+
import "@radix-ui/react-tooltip";
|
|
26
23
|
import "@radix-ui/react-popover";
|
|
24
|
+
import "@radix-ui/react-menubar";
|
|
25
|
+
import "@radix-ui/react-hover-card";
|
|
27
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";
|
|
33
|
+
import "react-dom";
|
|
34
|
+
import "react-quill";
|
|
35
|
+
import "jotai";
|
|
36
|
+
import "flat-to-nested";
|
|
37
|
+
import "redux-undo";
|
|
38
|
+
import "./index-gmZcUXyn.js";
|
|
39
|
+
import "react-i18next";
|
|
28
40
|
const k = async (x, g) => new Promise((o, r) => {
|
|
29
|
-
B({ accessKey: g }).search.getPhotos(x).then((
|
|
30
|
-
o(
|
|
31
|
-
}).catch((
|
|
32
|
-
}),
|
|
33
|
-
const o = F("unsplashAccessKey"), [r, j] =
|
|
34
|
-
if (
|
|
41
|
+
B({ accessKey: g }).search.getPhotos(x).then((i) => {
|
|
42
|
+
o(i);
|
|
43
|
+
}).catch((i) => r(i));
|
|
44
|
+
}), Te = ({ isModalView: x, onSelect: g }) => {
|
|
45
|
+
const o = F("unsplashAccessKey"), [r, 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) => {
|
|
46
|
+
if (d(u))
|
|
35
47
|
return;
|
|
36
|
-
let t =
|
|
48
|
+
let t = i + 1;
|
|
37
49
|
s && (s.preventDefault(), t = 1), c(!0), v(t);
|
|
38
50
|
const m = { query: u, page: t };
|
|
39
|
-
|
|
40
|
-
var
|
|
41
|
-
j(t === 1 ? ((
|
|
51
|
+
l && (m.orientation = l), n && (m.color = n), k(m, o).then((a) => {
|
|
52
|
+
var b, N, w;
|
|
53
|
+
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);
|
|
42
54
|
}).catch(() => {
|
|
43
55
|
c(!1);
|
|
44
56
|
});
|
|
45
57
|
};
|
|
46
58
|
return D(() => {
|
|
47
|
-
if (!
|
|
59
|
+
if (!d(u)) {
|
|
48
60
|
c(!0);
|
|
49
61
|
const s = { query: u, page: 1 };
|
|
50
|
-
|
|
62
|
+
l && (s.orientation = l), n && (s.color = n), v(1), k(s, o).then((t) => {
|
|
51
63
|
var m, a;
|
|
52
64
|
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);
|
|
53
65
|
}).catch(() => {
|
|
54
66
|
c(!1);
|
|
55
67
|
});
|
|
56
68
|
}
|
|
57
|
-
}, [
|
|
69
|
+
}, [l, n, u, o]), d(o) ? /* @__PURE__ */ e.jsx("div", { className: "h-full flex flex-col items-center justify-center", children: /* @__PURE__ */ e.jsxs("p", { className: "max-w-3xl text-center text-gray-500", children: [
|
|
58
70
|
"To enable Unsplash, kindly provide your",
|
|
59
71
|
/* @__PURE__ */ e.jsx(
|
|
60
72
|
"a",
|
|
@@ -69,7 +81,7 @@ const k = async (x, g) => new Promise((o, r) => {
|
|
|
69
81
|
] }) }) : /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
70
82
|
/* @__PURE__ */ e.jsxs("form", { className: "flex items-center rounded-md border bg-gray-100 p-px", children: [
|
|
71
83
|
/* @__PURE__ */ e.jsx(
|
|
72
|
-
|
|
84
|
+
K,
|
|
73
85
|
{
|
|
74
86
|
type: "text",
|
|
75
87
|
name: "query",
|
|
@@ -78,17 +90,17 @@ const k = async (x, g) => new Promise((o, r) => {
|
|
|
78
90
|
onChange: (s) => T(s.target.value)
|
|
79
91
|
}
|
|
80
92
|
),
|
|
81
|
-
/* @__PURE__ */ e.jsxs(
|
|
82
|
-
/* @__PURE__ */ e.jsx(
|
|
93
|
+
/* @__PURE__ */ e.jsxs(U, { children: [
|
|
94
|
+
/* @__PURE__ */ e.jsx(V, { asChild: !0, className: "h-full w-10 cursor-pointer p-2.5 hover:bg-slate-200", children: /* @__PURE__ */ e.jsx(L, {}) }),
|
|
83
95
|
/* @__PURE__ */ e.jsx(
|
|
84
|
-
|
|
96
|
+
O,
|
|
85
97
|
{
|
|
86
98
|
side: x ? "bottom" : "right",
|
|
87
99
|
className: "z-[9999] flex w-max items-center justify-center",
|
|
88
100
|
children: /* @__PURE__ */ e.jsxs("div", { children: [
|
|
89
101
|
/* @__PURE__ */ e.jsx("div", { className: "py-1 text-sm font-medium", children: "Orientation" }),
|
|
90
|
-
/* @__PURE__ */ e.jsxs(P, { defaultValue:
|
|
91
|
-
/* @__PURE__ */ e.jsx(
|
|
102
|
+
/* @__PURE__ */ e.jsxs(P, { defaultValue: l, onValueChange: (s) => A(s), children: [
|
|
103
|
+
/* @__PURE__ */ e.jsx(C, { className: "h-auto w-40 p-1 px-3", children: /* @__PURE__ */ e.jsx(S, { placeholder: "Select" }) }),
|
|
92
104
|
/* @__PURE__ */ e.jsxs(I, { className: "z-[9999]", children: [
|
|
93
105
|
/* @__PURE__ */ e.jsx(h, { value: "", children: "All" }),
|
|
94
106
|
/* @__PURE__ */ e.jsx(h, { value: "landscape", children: "Landscape" }),
|
|
@@ -97,8 +109,8 @@ const k = async (x, g) => new Promise((o, r) => {
|
|
|
97
109
|
] })
|
|
98
110
|
] }),
|
|
99
111
|
/* @__PURE__ */ e.jsx("div", { className: "pb-1 pt-2 text-sm font-medium", children: "Color" }),
|
|
100
|
-
/* @__PURE__ */ e.jsxs(P, { defaultValue:
|
|
101
|
-
/* @__PURE__ */ e.jsx(
|
|
112
|
+
/* @__PURE__ */ e.jsxs(P, { defaultValue: n, onValueChange: (s) => q(s), children: [
|
|
113
|
+
/* @__PURE__ */ e.jsx(C, { className: "h-auto w-40 p-1 px-3", children: /* @__PURE__ */ e.jsx(S, { placeholder: "Select" }) }),
|
|
102
114
|
/* @__PURE__ */ e.jsxs(I, { className: "z-[9999]", children: [
|
|
103
115
|
/* @__PURE__ */ e.jsx(h, { value: "", children: "All" }),
|
|
104
116
|
[
|
|
@@ -122,11 +134,11 @@ const k = async (x, g) => new Promise((o, r) => {
|
|
|
122
134
|
] })
|
|
123
135
|
] }),
|
|
124
136
|
/* @__PURE__ */ e.jsxs(
|
|
125
|
-
|
|
137
|
+
Q,
|
|
126
138
|
{
|
|
127
|
-
className: `h-full ${x && !
|
|
139
|
+
className: `h-full ${x && !d(r) ? "-mx-2 flex flex-wrap px-2" : "-mx-2 flex flex-col pb-8 pt-2"}`,
|
|
128
140
|
children: [
|
|
129
|
-
|
|
141
|
+
d(r) && !f && /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col items-center justify-center py-6", children: [
|
|
130
142
|
/* @__PURE__ */ e.jsx("div", { className: "font-medium", children: "No Data" }),
|
|
131
143
|
/* @__PURE__ */ e.jsx("div", { className: "text-sm text-gray-500", children: "Enter query and press enter" })
|
|
132
144
|
] }),
|
|
@@ -162,8 +174,8 @@ const k = async (x, g) => new Promise((o, r) => {
|
|
|
162
174
|
/* @__PURE__ */ e.jsx($, { className: "animate-spin w-6 h-6" }),
|
|
163
175
|
" Loading..."
|
|
164
176
|
] }),
|
|
165
|
-
!
|
|
166
|
-
|
|
177
|
+
!d(r) && i < z && !f && /* @__PURE__ */ e.jsx(
|
|
178
|
+
H,
|
|
167
179
|
{
|
|
168
180
|
size: "sm",
|
|
169
181
|
variant: "link",
|
|
@@ -179,6 +191,6 @@ const k = async (x, g) => new Promise((o, r) => {
|
|
|
179
191
|
] });
|
|
180
192
|
};
|
|
181
193
|
export {
|
|
182
|
-
|
|
194
|
+
Te as default,
|
|
183
195
|
k as fetchImage
|
|
184
196
|
};
|
|
@@ -1,49 +1,70 @@
|
|
|
1
|
-
import { j as e } from "./jsx-runtime-
|
|
1
|
+
import { j as e } from "./jsx-runtime-qAwJ85SY.js";
|
|
2
2
|
import { useState as i, useEffect as w } from "react";
|
|
3
3
|
import { isEmpty as g, map as b } from "lodash";
|
|
4
4
|
import { GearIcon as C, UploadIcon as U, Cross1Icon as k } from "@radix-ui/react-icons";
|
|
5
5
|
import { atom as F, useAtom as E } from "jotai";
|
|
6
|
-
import {
|
|
7
|
-
import "
|
|
8
|
-
import { u as j } from "./skeleton-CU_FIbg3.js";
|
|
9
|
-
import "@radix-ui/react-scroll-area";
|
|
10
|
-
import "./utils-dze1SGvB.js";
|
|
6
|
+
import { i as j, bp as A } from "./index-2EHcmZqL.js";
|
|
7
|
+
import "./Class-nQk08vqd.js";
|
|
11
8
|
import "clsx";
|
|
12
9
|
import "tailwind-merge";
|
|
13
|
-
import "@radix-ui/react-
|
|
10
|
+
import "@radix-ui/react-toggle";
|
|
14
11
|
import "class-variance-authority";
|
|
12
|
+
import "@radix-ui/react-switch";
|
|
13
|
+
import "@radix-ui/react-slot";
|
|
14
|
+
import "@radix-ui/react-accordion";
|
|
15
|
+
import "@radix-ui/react-alert-dialog";
|
|
16
|
+
import "@radix-ui/react-dialog";
|
|
17
|
+
import "@radix-ui/react-label";
|
|
18
|
+
import "@radix-ui/react-scroll-area";
|
|
19
|
+
import "@radix-ui/react-tabs";
|
|
15
20
|
import "@radix-ui/react-tooltip";
|
|
21
|
+
import "@radix-ui/react-popover";
|
|
22
|
+
import "@radix-ui/react-menubar";
|
|
23
|
+
import "@radix-ui/react-hover-card";
|
|
24
|
+
import "@radix-ui/react-select";
|
|
25
|
+
import "@radix-ui/react-dropdown-menu";
|
|
26
|
+
import "@radix-ui/react-separator";
|
|
16
27
|
import "@radix-ui/react-toast";
|
|
17
|
-
|
|
18
|
-
|
|
28
|
+
import "cmdk";
|
|
29
|
+
import "@radix-ui/react-context-menu";
|
|
30
|
+
import "react-icons-picker";
|
|
31
|
+
import "react-dom";
|
|
32
|
+
import "react-quill";
|
|
33
|
+
import "flat-to-nested";
|
|
34
|
+
import "redux-undo";
|
|
35
|
+
import "./index-gmZcUXyn.js";
|
|
36
|
+
import "@react-hookz/web";
|
|
37
|
+
import "react-i18next";
|
|
38
|
+
const R = F([]), fe = ({ isModalView: s, onSelect: n }) => {
|
|
39
|
+
const v = j("uploadMediaCallback", () => ""), m = j("fetchMediaCallback", () => []), [r, o] = E(R), [l, p] = i(!1), [u, x] = i(!1), [d, c] = i(), [f, y] = i("");
|
|
19
40
|
w(() => {
|
|
20
41
|
(async () => {
|
|
21
|
-
|
|
22
|
-
const t = await
|
|
23
|
-
|
|
42
|
+
x(!0);
|
|
43
|
+
const t = await m();
|
|
44
|
+
o(t || []), x(!1);
|
|
24
45
|
})();
|
|
25
|
-
}, [
|
|
46
|
+
}, [m, o]);
|
|
26
47
|
const N = (t) => {
|
|
27
|
-
var
|
|
28
|
-
t && ((h = (
|
|
48
|
+
var a, h;
|
|
49
|
+
t && ((h = (a = t == null ? void 0 : t.target) == null ? void 0 : a.files) == null ? void 0 : h.length) > 0 && c(t.target.files[0]);
|
|
29
50
|
}, I = async () => {
|
|
30
|
-
|
|
51
|
+
p(!0);
|
|
31
52
|
try {
|
|
32
|
-
const { url: t } = await v(
|
|
33
|
-
n(t),
|
|
34
|
-
const
|
|
35
|
-
a
|
|
53
|
+
const { url: t } = await v(d);
|
|
54
|
+
n(t), c(void 0);
|
|
55
|
+
const a = await m();
|
|
56
|
+
o(a);
|
|
36
57
|
} catch (t) {
|
|
37
|
-
|
|
58
|
+
o([]), y((t == null ? void 0 : t.message) || "Something went wrong.");
|
|
38
59
|
}
|
|
39
|
-
|
|
60
|
+
p(!1);
|
|
40
61
|
};
|
|
41
62
|
return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
42
|
-
|
|
63
|
+
d ? /* @__PURE__ */ e.jsxs("div", { className: "relative flex w-full flex-col items-center justify-center rounded-md border bg-slate-50 p-2 px-1", children: [
|
|
43
64
|
/* @__PURE__ */ e.jsx(
|
|
44
65
|
"img",
|
|
45
66
|
{
|
|
46
|
-
src: URL.createObjectURL(
|
|
67
|
+
src: URL.createObjectURL(d),
|
|
47
68
|
alt: "",
|
|
48
69
|
className: "h-auto w-full max-w-sm rounded-md max-h-96 object-contain"
|
|
49
70
|
}
|
|
@@ -55,21 +76,21 @@ const R = F([]), W = ({ isModalView: s, onSelect: n }) => {
|
|
|
55
76
|
{
|
|
56
77
|
type: "button",
|
|
57
78
|
onClick: I,
|
|
58
|
-
disabled:
|
|
79
|
+
disabled: l,
|
|
59
80
|
className: "flex items-center rounded-full bg-blue-500 px-3 py-1 text-sm text-white hover:bg-blue-600 hover:text-white",
|
|
60
81
|
children: [
|
|
61
|
-
|
|
82
|
+
l ? /* @__PURE__ */ e.jsx(C, { className: "animate-spin" }) : /* @__PURE__ */ e.jsx(U, { className: "animate-bounce" }),
|
|
62
83
|
" ",
|
|
63
|
-
|
|
84
|
+
l ? "Uploading..." : "Upload"
|
|
64
85
|
]
|
|
65
86
|
}
|
|
66
87
|
),
|
|
67
|
-
!
|
|
88
|
+
!l && /* @__PURE__ */ e.jsxs(
|
|
68
89
|
"button",
|
|
69
90
|
{
|
|
70
91
|
type: "button",
|
|
71
92
|
className: "flex items-center rounded-full border border-gray-300 px-3 py-1 text-sm hover:bg-gray-200",
|
|
72
|
-
onClick: () =>
|
|
93
|
+
onClick: () => c(void 0),
|
|
73
94
|
children: [
|
|
74
95
|
/* @__PURE__ */ e.jsx(k, {}),
|
|
75
96
|
" Cancel"
|
|
@@ -85,16 +106,16 @@ const R = F([]), W = ({ isModalView: s, onSelect: n }) => {
|
|
|
85
106
|
/* @__PURE__ */ e.jsx("input", { type: "file", id: s ? "upload-in-modal" : "upload-in-panel", hidden: !0, onChange: N })
|
|
86
107
|
] }),
|
|
87
108
|
/* @__PURE__ */ e.jsxs(A, { className: `-mx-2 flex h-full flex-col pb-8 pt-2 ${s ? "px-2" : ""} pt-2`, children: [
|
|
88
|
-
g(
|
|
89
|
-
g(
|
|
90
|
-
s ? /* @__PURE__ */ e.jsx("div", { className: "h-full columns-5 py-2", children: b(
|
|
109
|
+
g(r) && u && /* @__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: "Fetching..." }) }),
|
|
110
|
+
g(r) && !u && /* @__PURE__ */ e.jsx("div", { className: "flex flex-col items-center justify-center py-6", children: /* @__PURE__ */ e.jsx("div", { className: "font-medium", children: "No Images" }) }),
|
|
111
|
+
s ? /* @__PURE__ */ e.jsx("div", { className: "h-full columns-5 py-2", children: b(r, (t) => /* @__PURE__ */ e.jsx("div", { role: "button", tabIndex: 0, className: "my-1 flex", onClick: () => n(t.url), children: /* @__PURE__ */ e.jsx("div", { className: "relative overflow-hidden rounded-md bg-cover bg-no-repeat", children: /* @__PURE__ */ e.jsx(
|
|
91
112
|
"img",
|
|
92
113
|
{
|
|
93
114
|
className: "h-auto flex-1 cursor-pointer rounded-md transition duration-300 ease-in-out hover:scale-105",
|
|
94
115
|
alt: t.name,
|
|
95
116
|
src: t.thumbUrl
|
|
96
117
|
}
|
|
97
|
-
) }) }, t.id)) }) : b(
|
|
118
|
+
) }) }, t.id)) }) : b(r, (t) => (
|
|
98
119
|
// TODO: Drag and Drop Image to Canvas from Here use `pic.url` for image quality
|
|
99
120
|
/* @__PURE__ */ e.jsx("div", { role: "button", tabIndex: 0, className: "px-2 py-1", onClick: () => n(t.url), children: /* @__PURE__ */ e.jsx("div", { className: "relative overflow-hidden rounded-md bg-cover bg-no-repeat", children: /* @__PURE__ */ e.jsx(
|
|
100
121
|
"img",
|
|
@@ -109,5 +130,5 @@ const R = F([]), W = ({ isModalView: s, onSelect: n }) => {
|
|
|
109
130
|
] });
|
|
110
131
|
};
|
|
111
132
|
export {
|
|
112
|
-
|
|
133
|
+
fe as default
|
|
113
134
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-WKRPbKtm.cjs"),r=require("react"),a=require("lodash"),m=require("@radix-ui/react-icons"),q=require("jotai"),p=require("./index-c8zW_D2V.cjs");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-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("./index-fwo4wa7u.cjs");require("@react-hookz/web");require("react-i18next");const N=q.atom([]),I=({isModalView:t,onSelect:u})=>{const E=p.useBuilderProp("uploadMediaCallback",()=>""),x=p.useBuilderProp("fetchMediaCallback",()=>[]),[i,n]=q.useAtom(N),[o,j]=r.useState(!1),[h,f]=r.useState(!1),[c,d]=r.useState(),[g,R]=r.useState("");r.useEffect(()=>{(async()=>{f(!0);const s=await x();n(s||[]),f(!1)})()},[x,n]);const v=s=>{var l,b;s&&((b=(l=s==null?void 0:s.target)==null?void 0:l.files)==null?void 0:b.length)>0&&d(s.target.files[0])},y=async()=>{j(!0);try{const{url:s}=await E(c);u(s),d(void 0);const l=await x();n(l)}catch(s){n([]),R((s==null?void 0:s.message)||"Something went wrong.")}j(!1)};return e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[c?e.jsxRuntimeExports.jsxs("div",{className:"relative flex w-full flex-col items-center justify-center rounded-md border bg-slate-50 p-2 px-1",children:[e.jsxRuntimeExports.jsx("img",{src:URL.createObjectURL(c),alt:"",className:"h-auto w-full max-w-sm rounded-md max-h-96 object-contain"}),g&&e.jsxRuntimeExports.jsx("div",{className:"w-full pt-2 text-center text-sm text-red-500",children:g}),e.jsxRuntimeExports.jsxs("div",{className:"flex w-full items-center justify-center gap-2 pt-2",children:[e.jsxRuntimeExports.jsxs("button",{type:"button",onClick:y,disabled:o,className:"flex items-center rounded-full bg-blue-500 px-3 py-1 text-sm text-white hover:bg-blue-600 hover:text-white",children:[o?e.jsxRuntimeExports.jsx(m.GearIcon,{className:"animate-spin"}):e.jsxRuntimeExports.jsx(m.UploadIcon,{className:"animate-bounce"})," ",o?"Uploading...":"Upload"]}),!o&&e.jsxRuntimeExports.jsxs("button",{type:"button",className:"flex items-center rounded-full border border-gray-300 px-3 py-1 text-sm hover:bg-gray-200",onClick:()=>d(void 0),children:[e.jsxRuntimeExports.jsx(m.Cross1Icon,{})," Cancel"]})]})]}):e.jsxRuntimeExports.jsxs("label",{htmlFor:t?"upload-in-modal":"upload-in-panel",children:[e.jsxRuntimeExports.jsxs("div",{className:"flex w-full cursor-pointer flex-col items-center justify-center rounded-md border border-dashed border-blue-900 bg-gray-200 py-8 hover:bg-blue-50",children:[e.jsxRuntimeExports.jsx("div",{className:"text-3xl",children:"+"}),e.jsxRuntimeExports.jsx("div",{children:"Click to choose file"})]}),e.jsxRuntimeExports.jsx("input",{type:"file",id:t?"upload-in-modal":"upload-in-panel",hidden:!0,onChange:v})]}),e.jsxRuntimeExports.jsxs(p.ScrollArea,{className:`-mx-2 flex h-full flex-col pb-8 pt-2 ${t?"px-2":""} pt-2`,children:[a.isEmpty(i)&&h&&e.jsxRuntimeExports.jsx("div",{className:"flex flex-col items-center justify-center py-6",children:e.jsxRuntimeExports.jsx("div",{className:"animate-pulse font-medium",children:"Fetching..."})}),a.isEmpty(i)&&!h&&e.jsxRuntimeExports.jsx("div",{className:"flex flex-col items-center justify-center py-6",children:e.jsxRuntimeExports.jsx("div",{className:"font-medium",children:"No Images"})}),t?e.jsxRuntimeExports.jsx("div",{className:"h-full columns-5 py-2",children:a.map(i,s=>e.jsxRuntimeExports.jsx("div",{role:"button",tabIndex:0,className:"my-1 flex",onClick:()=>u(s.url),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.name,src:s.thumbUrl})})},s.id))}):a.map(i,s=>e.jsxRuntimeExports.jsx("div",{role:"button",tabIndex:0,className:"px-2 py-1",onClick:()=>u(s.url),children:e.jsxRuntimeExports.jsx("div",{className:"relative overflow-hidden rounded-md bg-cover bg-no-repeat",children:e.jsxRuntimeExports.jsx("img",{className:"h-auto w-full cursor-pointer transition duration-300 ease-in-out hover:scale-105",alt:s.name,src:s.url})})},s.id))]})]})};exports.default=I;
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import { j as t } from "./jsx-runtime-qAwJ85SY.js";
|
|
2
|
+
import { useState as c } from "react";
|
|
3
|
+
import { kebabCase as j } from "lodash";
|
|
4
|
+
import { ap as b, B as u, ao as C, bb as A } from "./index-2EHcmZqL.js";
|
|
5
|
+
import { u as g } from "./index-RVm8Txnj.js";
|
|
6
|
+
import { F as D } from "./form-zZJyZuNH.js";
|
|
7
|
+
import { g as N } from "./index-cU5eyVRU.js";
|
|
8
|
+
import "./Class-nQk08vqd.js";
|
|
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";
|
|
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";
|
|
33
|
+
import "react-dom";
|
|
34
|
+
import "react-quill";
|
|
35
|
+
import "jotai";
|
|
36
|
+
import "flat-to-nested";
|
|
37
|
+
import "redux-undo";
|
|
38
|
+
import "./index-gmZcUXyn.js";
|
|
39
|
+
import "@react-hookz/web";
|
|
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
|
+
import "@rjsf/core";
|
|
50
|
+
import "@rjsf/validator-ajv8";
|
|
51
|
+
import "i18next";
|
|
52
|
+
import "@floating-ui/react-dom";
|
|
53
|
+
import "react-textarea-autosize";
|
|
54
|
+
import "flagged";
|
|
55
|
+
import "react-dnd";
|
|
56
|
+
import "@minoru/react-dnd-treeview";
|
|
57
|
+
import "react-hotkeys-hook";
|
|
58
|
+
import "sonner";
|
|
59
|
+
import "lucide-react";
|
|
60
|
+
const S = ({ closeModal: i }) => {
|
|
61
|
+
var a, s;
|
|
62
|
+
const r = N(), [o, f] = c({
|
|
63
|
+
name: "",
|
|
64
|
+
slug: "",
|
|
65
|
+
blocks: [],
|
|
66
|
+
type: "STATIC",
|
|
67
|
+
seoData: {}
|
|
68
|
+
}), x = () => {
|
|
69
|
+
r.mutate(o, {
|
|
70
|
+
onSuccess: () => i()
|
|
71
|
+
});
|
|
72
|
+
}, P = ({ formData: m }, e) => {
|
|
73
|
+
f((n) => {
|
|
74
|
+
var l, d;
|
|
75
|
+
const p = { [e]: m[e] };
|
|
76
|
+
return e === "name" ? p.slug = j((l = m[e]) == null ? void 0 : l.replace(/\d/g, "")) : e === "slug" && (p.slug = (d = m[e]) == null ? void 0 : d.replace(/\d/g, "").replace(/\s+/g, "").replace("--", "-").replace("__", "_")), {
|
|
77
|
+
...n,
|
|
78
|
+
...p
|
|
79
|
+
};
|
|
80
|
+
});
|
|
81
|
+
}, h = {
|
|
82
|
+
name: g({
|
|
83
|
+
title: "Page Name",
|
|
84
|
+
default: o.name
|
|
85
|
+
}),
|
|
86
|
+
slug: g({ title: "Page Slug", default: o.slug })
|
|
87
|
+
};
|
|
88
|
+
return /* @__PURE__ */ t.jsxs(b, { children: [
|
|
89
|
+
/* @__PURE__ */ t.jsx("div", { className: "px-1 font-bold", children: "Add Page" }),
|
|
90
|
+
/* @__PURE__ */ t.jsx(D, { formData: o, properties: h, onChange: P, disabled: r.isPending }),
|
|
91
|
+
/* @__PURE__ */ t.jsx("div", { className: "flex items-center justify-end", children: /* @__PURE__ */ t.jsx(
|
|
92
|
+
u,
|
|
93
|
+
{
|
|
94
|
+
type: "submit",
|
|
95
|
+
disabled: !o.name || !o.slug || ((a = o.name) == null ? void 0 : a.length) < 2 || ((s = o.slug) == null ? void 0 : s.length) < 2 || r.isPending,
|
|
96
|
+
onClick: x,
|
|
97
|
+
children: "Add Page"
|
|
98
|
+
}
|
|
99
|
+
) })
|
|
100
|
+
] });
|
|
101
|
+
}, Bt = () => {
|
|
102
|
+
const [i, r] = c(!1);
|
|
103
|
+
return /* @__PURE__ */ t.jsxs(C, { open: i, onOpenChange: () => r(!i), children: [
|
|
104
|
+
/* @__PURE__ */ t.jsx(A, { children: /* @__PURE__ */ t.jsx(u, { size: "sm", variant: "link", className: "text-blue-500", onClick: () => r(!i), children: "+ New Page" }) }),
|
|
105
|
+
i && /* @__PURE__ */ t.jsx(S, { closeModal: () => r(!i) })
|
|
106
|
+
] });
|
|
107
|
+
};
|
|
108
|
+
export {
|
|
109
|
+
Bt as default
|
|
110
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-WKRPbKtm.cjs"),x=require("react"),h=require("lodash"),t=require("./index-c8zW_D2V.cjs"),g=require("./index-m2muA80V.cjs"),R=require("./form-Osm1AmO5.cjs"),f=require("./index-_jFEo7h5.cjs");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");require("@rjsf/core");require("@rjsf/validator-ajv8");require("i18next");require("@floating-ui/react-dom");require("react-textarea-autosize");require("flagged");require("react-dnd");require("@minoru/react-dnd-treeview");require("react-hotkeys-hook");require("sonner");require("lucide-react");const b=({closeModal:i})=>{var q,l;const u=f.useAddPage(),[r,m]=x.useState({name:"",slug:"",blocks:[],type:"STATIC",seoData:{}}),p=()=>{u.mutate(r,{onSuccess:()=>i()})},j=({formData:n},s)=>{m(o=>{var d,c;const a={[s]:n[s]};return s==="name"?a.slug=h.kebabCase((d=n[s])==null?void 0:d.replace(/\d/g,"")):s==="slug"&&(a.slug=(c=n[s])==null?void 0:c.replace(/\d/g,"").replace(/\s+/g,"").replace("--","-").replace("__","_")),{...o,...a}})},P={name:g.u({title:"Page Name",default:r.name}),slug:g.u({title:"Page Slug",default:r.slug})};return e.jsxRuntimeExports.jsxs(t.DialogContent,{children:[e.jsxRuntimeExports.jsx("div",{className:"px-1 font-bold",children:"Add Page"}),e.jsxRuntimeExports.jsx(R.Form,{formData:r,properties:P,onChange:j,disabled:u.isPending}),e.jsxRuntimeExports.jsx("div",{className:"flex items-center justify-end",children:e.jsxRuntimeExports.jsx(t.Button,{type:"submit",disabled:!r.name||!r.slug||((q=r.name)==null?void 0:q.length)<2||((l=r.slug)==null?void 0:l.length)<2||u.isPending,onClick:p,children:"Add Page"})})]})},E=()=>{const[i,u]=x.useState(!1);return e.jsxRuntimeExports.jsxs(t.Dialog,{open:i,onOpenChange:()=>u(!i),children:[e.jsxRuntimeExports.jsx(t.DialogTrigger,{children:e.jsxRuntimeExports.jsx(t.Button,{size:"sm",variant:"link",className:"text-blue-500",onClick:()=>u(!i),children:"+ New Page"})}),i&&e.jsxRuntimeExports.jsx(b,{closeModal:()=>u(!i)})]})};exports.default=E;
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { j as i } from "./jsx-runtime-qAwJ85SY.js";
|
|
2
|
+
import { D as a, F as n, H as c, I as x, K as j, B as d } from "./index-2EHcmZqL.js";
|
|
3
|
+
import "./Class-nQk08vqd.js";
|
|
4
|
+
import "clsx";
|
|
5
|
+
import "tailwind-merge";
|
|
6
|
+
import "lodash";
|
|
7
|
+
import "react";
|
|
8
|
+
import "@radix-ui/react-toggle";
|
|
9
|
+
import "class-variance-authority";
|
|
10
|
+
import "@radix-ui/react-switch";
|
|
11
|
+
import "@radix-ui/react-slot";
|
|
12
|
+
import "@radix-ui/react-accordion";
|
|
13
|
+
import "@radix-ui/react-icons";
|
|
14
|
+
import "@radix-ui/react-alert-dialog";
|
|
15
|
+
import "@radix-ui/react-dialog";
|
|
16
|
+
import "@radix-ui/react-label";
|
|
17
|
+
import "@radix-ui/react-scroll-area";
|
|
18
|
+
import "@radix-ui/react-tabs";
|
|
19
|
+
import "@radix-ui/react-tooltip";
|
|
20
|
+
import "@radix-ui/react-popover";
|
|
21
|
+
import "@radix-ui/react-menubar";
|
|
22
|
+
import "@radix-ui/react-hover-card";
|
|
23
|
+
import "@radix-ui/react-select";
|
|
24
|
+
import "@radix-ui/react-dropdown-menu";
|
|
25
|
+
import "@radix-ui/react-separator";
|
|
26
|
+
import "@radix-ui/react-toast";
|
|
27
|
+
import "cmdk";
|
|
28
|
+
import "@radix-ui/react-context-menu";
|
|
29
|
+
import "react-icons-picker";
|
|
30
|
+
import "react-dom";
|
|
31
|
+
import "react-quill";
|
|
32
|
+
import "jotai";
|
|
33
|
+
import "flat-to-nested";
|
|
34
|
+
import "redux-undo";
|
|
35
|
+
import "./index-gmZcUXyn.js";
|
|
36
|
+
import "@react-hookz/web";
|
|
37
|
+
import "react-i18next";
|
|
38
|
+
const $ = ({
|
|
39
|
+
open: o,
|
|
40
|
+
onCancel: m = () => {
|
|
41
|
+
},
|
|
42
|
+
onConfirm: p,
|
|
43
|
+
title: e,
|
|
44
|
+
description: r,
|
|
45
|
+
disabled: t,
|
|
46
|
+
cancelText: l = "Discard",
|
|
47
|
+
confirmText: s = "Save"
|
|
48
|
+
}) => /* @__PURE__ */ i.jsx(a, { open: o, children: /* @__PURE__ */ i.jsxs(n, { children: [
|
|
49
|
+
/* @__PURE__ */ i.jsx(c, { children: e }),
|
|
50
|
+
r && /* @__PURE__ */ i.jsx(x, { children: r }),
|
|
51
|
+
/* @__PURE__ */ i.jsxs("div", { className: "flex items-center justify-end gap-x-3", children: [
|
|
52
|
+
/* @__PURE__ */ i.jsx(j, { disabled: t, onClick: m, children: l }),
|
|
53
|
+
/* @__PURE__ */ i.jsx(d, { variant: "default", onClick: p, disabled: t, children: s })
|
|
54
|
+
] })
|
|
55
|
+
] }) });
|
|
56
|
+
export {
|
|
57
|
+
$ as default
|
|
58
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-WKRPbKtm.cjs"),r=require("./index-c8zW_D2V.cjs");require("./Class-RZuPYbUS.cjs");require("clsx");require("tailwind-merge");require("lodash");require("react");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");const x=({open:t,onCancel:q=()=>{},onConfirm:s,title:n,description:i,disabled:u,cancelText:l="Discard",confirmText:o="Save"})=>e.jsxRuntimeExports.jsx(r.AlertDialog,{open:t,children:e.jsxRuntimeExports.jsxs(r.AlertDialogContent,{children:[e.jsxRuntimeExports.jsx(r.AlertDialogTitle,{children:n}),i&&e.jsxRuntimeExports.jsx(r.AlertDialogDescription,{children:i}),e.jsxRuntimeExports.jsxs("div",{className:"flex items-center justify-end gap-x-3",children:[e.jsxRuntimeExports.jsx(r.AlertDialogCancel,{disabled:u,onClick:q,children:l}),e.jsxRuntimeExports.jsx(r.Button,{variant:"default",onClick:s,disabled:u,children:o})]})]})});exports.default=x;
|
package/dist/core.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("./index-_jFEo7h5.cjs"),e=require("./index-c8zW_D2V.cjs"),u=require("react-i18next");require("i18next");require("./jsx-runtime-WKRPbKtm.cjs");require("./Class-RZuPYbUS.cjs");require("clsx");require("tailwind-merge");require("lodash");require("react");require("./index-m2muA80V.cjs");require("@radix-ui/react-icons");require("./index-fwo4wa7u.cjs");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");require("react-dom");require("@radix-ui/react-scroll-area");require("@floating-ui/react-dom");require("react-textarea-autosize");require("jotai");require("flagged");require("react-dnd");require("@minoru/react-dnd-treeview");require("react-hotkeys-hook");require("sonner");require("lucide-react");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-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-quill");require("flat-to-nested");require("redux-undo");require("@react-hookz/web");exports.ChaiBuilderEditor=s.ChaiBuilderEditor;exports.useActiveLanguage=e.useActiveLanguage;exports.useActiveModal=e.useActiveModal;exports.useActivePanel=e.useActivePanel;exports.useAddBlock=e.useAddBlock;exports.useAddBlockParent=e.useAddBlockParent;exports.useAddClassesToBlocks=e.useAddClassesToBlocks;exports.useAllBlocks=e.useAllBlocks;exports.useBlockContentByLanguage=e.useBlockContentByLanguage;exports.useBrandingOptions=e.useBrandingOptions;exports.useBuilderProp=e.useBuilderProp;exports.useBuilderReset=e.useBuilderReset;exports.useBuildingBlocks=e.useBuildingBlocks;exports.useCanvasHistory=e.useCanvasHistory;exports.useCanvasWidth=e.useCanvasWidth;exports.useCanvasZoom=e.useCanvasZoom;exports.useCopyBlockIds=e.useCopyBlockIds;exports.useCurrentPage=e.useCurrentPage;exports.useCutBlockIds=e.useCutBlockIds;exports.useDarkMode=e.useDarkMode;exports.useDeveloperPreviewMode=e.useDeveloperPreviewMode;exports.useDuplicateBlocks=e.useDuplicateBlocks;exports.useFeatureSupport=e.useFeatureSupport;exports.useGetPageData=e.useGetPageData;exports.useHiddenBlockIds=e.useHiddenBlockIds;exports.useHighlightBlockId=e.useHighlightBlockId;exports.useLanguages=e.useLanguages;exports.useMarkAsGlobalBlock=e.useMarkAsGlobalBlock;exports.useMoveBlocks=e.useMoveBlocks;exports.usePasteBlocks=e.usePasteBlocks;exports.usePreviewMode=e.usePreviewMode;exports.usePrimaryLanguage=e.usePrimaryLanguage;exports.useProject=e.useProject;exports.useReadOnlyMode=e.useReadOnlyMode;exports.useRemoveBlocks=e.useRemoveBlocks;exports.useRemoveClassesFromBlocks=e.useRemoveClassesFromBlocks;exports.useSavePage=e.useSavePage;exports.useSelectedBlock=e.useSelectedBlock;exports.useSelectedBlockAllClasses=e.useSelectedBlockAllClasses;exports.useSelectedBlockCurrentClasses=e.useSelectedBlockCurrentClasses;exports.useSelectedBlockIds=e.useSelectedBlockIds;exports.useSelectedBlocksDisplayChild=e.useSelectedBlocksDisplayChild;exports.useSelectedBreakpoints=e.useSelectedBreakpoints;exports.useSelectedStylingBlocks=e.useSelectedStylingBlocks;exports.useSetAllBlocks=e.useSetAllBlocks;exports.useStylingBreakpoint=e.useStylingBreakpoint;exports.useStylingState=e.useStylingState;exports.useTranslations=e.useTranslations;exports.useTreeData=e.useTreeData;exports.useUILibraryBlocks=e.useUILibraryBlocks;exports.useUpdateBlocksProps=e.useUpdateBlocksProps;exports.useUpdateBlocksPropsRealtime=e.useUpdateBlocksPropsRealtime;Object.defineProperty(exports,"useTranslation",{enumerable:!0,get:()=>u.useTranslation});
|