@chaibuilder/sdk 0.1.32 → 1.0.0
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-4f054351.cjs +3 -0
- package/dist/{AddBlocks-4b96d545.js → AddBlocks-f6836e71.js} +5 -4
- package/dist/{BrandingOptions-c91e9d44.js → BrandingOptions-33e6da26.js} +6 -5
- package/dist/BrandingOptions-cfa79ffe.cjs +1 -0
- package/dist/{CanvasArea-957f5f74.js → CanvasArea-1e5fa968.js} +42 -43
- package/dist/CanvasArea-971b3ff8.cjs +46 -0
- package/dist/{CurrentPage-fb4c55bc.js → CurrentPage-223cc3dd.js} +5 -4
- package/dist/CurrentPage-b2d12d83.cjs +1 -0
- package/dist/{ImagesPanel-3fb8087f.js → ImagesPanel-47ac13c3.js} +1 -1
- package/dist/{ImagesPanel-56ca0618.cjs → ImagesPanel-8b7a989d.cjs} +1 -1
- package/dist/Layers-860f5e42.cjs +1 -0
- package/dist/{Layers-6866cb0c.js → Layers-b2c5aa66.js} +48 -47
- package/dist/MarkAsGlobalBlock-1a3d5e53.cjs +1 -0
- package/dist/{MarkAsGlobalBlock-f28148d9.js → MarkAsGlobalBlock-9b0135aa.js} +8 -7
- package/dist/{PagesPanel-003201ca.js → PagesPanel-034efd4c.js} +8 -7
- package/dist/PagesPanel-2a80f9b2.cjs +1 -0
- package/dist/{ProjectPanel-83321040.js → ProjectPanel-3827a349.js} +7 -6
- package/dist/ProjectPanel-5deae7f1.cjs +1 -0
- package/dist/Settings-9f61cc69.cjs +1 -0
- package/dist/{Settings-ad55d8cb.js → Settings-a2d4e9c2.js} +82 -79
- package/dist/SidePanels-0d276d29.cjs +1 -0
- package/dist/{SidePanels-96bf29c6.js → SidePanels-b881185b.js} +33 -34
- package/dist/Topbar-68a0d125.cjs +1 -0
- package/dist/{Topbar-1c4964e5.js → Topbar-fda7588e.js} +38 -37
- package/dist/{UnsplashImages-fe480747.js → UnsplashImages-4edb97e7.js} +6 -5
- package/dist/UnsplashImages-98c085c2.cjs +1 -0
- package/dist/{UploadImages-b14bd152.js → UploadImages-52181c3e.js} +9 -8
- package/dist/UploadImages-61ef83ad.cjs +1 -0
- package/dist/{add-page-modal-2ef8a63c.js → add-page-modal-38af4548.js} +11 -10
- package/dist/add-page-modal-fb51b45b.cjs +1 -0
- package/dist/confirm-alert-c1fdf1e4.js +35 -0
- package/dist/confirm-alert-e1ea5110.cjs +1 -0
- package/dist/core.cjs +1 -1
- package/dist/core.d.ts +2 -1
- package/dist/core.js +56 -55
- package/dist/delete-page-modal-305c49fd.cjs +1 -0
- package/dist/{delete-page-modal-961dcc5f.js → delete-page-modal-a226ed3a.js} +18 -19
- package/dist/{form-046bcdbc.js → form-25e1af37.js} +1 -1
- package/dist/{form-2dc05f35.cjs → form-ea21db6c.cjs} +1 -1
- package/dist/{index-86352d44.cjs → index-6fc652ec.cjs} +41 -41
- package/dist/{index-370ce00c.js → index-914d197c.js} +7239 -7070
- package/dist/{link-e71b94f1.cjs → link-24679521.cjs} +1 -1
- package/dist/{link-e3a788f7.js → link-57de608a.js} +2 -2
- package/dist/{page-viewer-0c45ce74.js → page-viewer-682940be.js} +17 -16
- package/dist/page-viewer-857a82f4.cjs +1 -0
- package/dist/{project-general-setting-c5d96f79.js → project-general-setting-0fa55bb9.js} +9 -8
- package/dist/project-general-setting-280ccd16.cjs +1 -0
- package/dist/project-seo-setting-6eef8387.cjs +1 -0
- package/dist/{project-seo-setting-639e4f33.js → project-seo-setting-d81fc1e3.js} +7 -6
- package/dist/server.cjs +1 -1
- package/dist/server.d.ts +4 -2
- package/dist/server.js +27 -23
- package/dist/{single-page-detail-22e7bc3b.js → single-page-detail-8b715650.js} +11 -10
- package/dist/single-page-detail-b9c4ac1e.cjs +1 -0
- package/dist/ui.cjs +1 -1
- package/dist/ui.js +105 -106
- package/dist/useBuilderProp-21feb2da.js +296 -0
- package/dist/useBuilderProp-adacf42f.cjs +1 -0
- package/package.json +1 -1
- package/dist/AddBlocks-e4f51b58.cjs +0 -3
- package/dist/BrandingOptions-52f9691c.cjs +0 -1
- package/dist/CanvasArea-b8c26858.cjs +0 -46
- package/dist/CurrentPage-715fe809.cjs +0 -1
- package/dist/Layers-a955d0bb.cjs +0 -1
- package/dist/MarkAsGlobalBlock-cbcb3003.cjs +0 -1
- package/dist/PagesPanel-7b8f54e1.cjs +0 -1
- package/dist/ProjectPanel-6c5f2470.cjs +0 -1
- package/dist/Settings-8f07a4b7.cjs +0 -1
- package/dist/SidePanels-446b93e7.cjs +0 -1
- package/dist/Topbar-5eeea40a.cjs +0 -1
- package/dist/UnsplashImages-ef3b6388.cjs +0 -1
- package/dist/UploadImages-10439fde.cjs +0 -1
- package/dist/add-page-modal-56dc3c56.cjs +0 -1
- package/dist/alert-dialog-4ce6ed22.cjs +0 -1
- package/dist/alert-dialog-ee98f47e.js +0 -64
- package/dist/confirm-alert-4f50caa7.cjs +0 -1
- package/dist/confirm-alert-f2a47cc7.js +0 -36
- package/dist/delete-page-modal-88aeacfd.cjs +0 -1
- package/dist/page-viewer-e0d9895d.cjs +0 -1
- package/dist/project-general-setting-d4d96611.cjs +0 -1
- package/dist/project-seo-setting-6356c72f.cjs +0 -1
- package/dist/single-page-detail-36430438.cjs +0 -1
- package/dist/useBuilderProp-5e57d0c8.cjs +0 -1
- package/dist/useBuilderProp-81a14920.js +0 -238
|
@@ -1,26 +1,26 @@
|
|
|
1
1
|
import { j as e } from "./jsx-runtime-944c88e2.js";
|
|
2
2
|
import * as ne from "react";
|
|
3
|
-
import
|
|
3
|
+
import P, { useState as w, useEffect as E, useMemo as k, useCallback as A, createContext as Oe, useContext as re } from "react";
|
|
4
4
|
import { useThrottledCallback as me } from "@react-hookz/web";
|
|
5
5
|
import { map as C, isEmpty as b, last as ye, forEach as je, set as Me, get as p, startCase as Y, filter as be, truncate as it, isArray as ae, includes as M, first as we, split as dt, toLower as te, find as ct, omit as pt, keys as ut, cloneDeep as xt, each as gt, capitalize as ht, reject as mt, nth as Re, startsWith as z, isNumber as yt, parseInt as bt, isNaN as _e, findLast as ft, has as ge, flatten as U, intersection as Ee, isNull as vt } from "lodash";
|
|
6
6
|
import { useTranslation as Fe } from "react-i18next";
|
|
7
|
-
import { PlusIcon as Ce, Cross2Icon as Ye, EyeOpenIcon as jt, EyeClosedIcon as Ve, BorderAllIcon as O, WidthIcon as R, HeightIcon as V, ArrowUpIcon as q, ArrowRightIcon as J, ArrowDownIcon as Q, ArrowLeftIcon as ee, ArrowTopLeftIcon as wt, ArrowTopRightIcon as Ct, ArrowBottomRightIcon as
|
|
7
|
+
import { PlusIcon as Ce, Cross2Icon as Ye, EyeOpenIcon as jt, EyeClosedIcon as Ve, BorderAllIcon as O, WidthIcon as R, HeightIcon as V, ArrowUpIcon as q, ArrowRightIcon as J, ArrowDownIcon as Q, ArrowLeftIcon as ee, ArrowTopLeftIcon as wt, ArrowTopRightIcon as Ct, ArrowBottomRightIcon as Nt, ArrowBottomLeftIcon as kt, AlignLeftIcon as St, AlignCenterHorizontallyIcon as Tt, AlignRightIcon as Rt, StretchHorizontallyIcon as Vt, FontItalicIcon as Ht, UnderlineIcon as Bt, OverlineIcon as At, LetterCaseUppercaseIcon as Dt, Cross1Icon as Pt, InfoCircledIcon as Ne, MinusIcon as $t, BoxIcon as Xe, TriangleDownIcon as It, RowSpacingIcon as Lt, TrashIcon as We, MixerHorizontalIcon as Ze } from "@radix-ui/react-icons";
|
|
8
8
|
import { T as Ot, a as Mt, b as He, c as Be } from "./tabs-85caa1e8.js";
|
|
9
9
|
import _t from "@rjsf/core";
|
|
10
10
|
import Et from "@rjsf/validator-ajv8";
|
|
11
|
-
import { D as G, E as Ft, d as ze, G as Ue, H as Yt, I as Xt, J as Wt, j as
|
|
11
|
+
import { D as G, E as Ft, d as ze, G as Ue, H as Yt, I as Xt, J as Wt, j as ke, K as Ge, L as Ke, i as qe, e as Zt, M as Je, f as Ae, N as pe, c as zt, O as Ut, P as Gt } from "./index-914d197c.js";
|
|
12
12
|
import { getChaiDataProviders as Kt, getBlockComponent as Qe, SingleLineText as qt } from "@chaibuilder/blocks";
|
|
13
13
|
import { EditIcon as Jt, TrashIcon as Qt, Check as er } from "lucide-react";
|
|
14
14
|
import { u as et } from "./useChaiExternalData-192c7896.js";
|
|
15
|
-
import {
|
|
15
|
+
import { l as X, m as W, n as Z, B as ue, o as tr } from "./useBuilderProp-21feb2da.js";
|
|
16
16
|
import { D as rr, a as sr, b as lr, c as or, e as nr, f as ar, d as ir } from "./dialog-18207bef.js";
|
|
17
17
|
import { P as dr, a as cr, b as pr } from "./popover-f7addcf4.js";
|
|
18
18
|
import { C as ur, b as xr, c as gr, d as hr, e as mr, f as yr, I as br } from "./command-6f260f61.js";
|
|
19
19
|
import { A as tt, a as ie, b as de, c as ce } from "./accordion-c0176dc5.js";
|
|
20
|
-
import { R as fr, I as vr, a as jr, L as wr } from "./link-
|
|
20
|
+
import { R as fr, I as vr, a as jr, L as wr } from "./link-57de608a.js";
|
|
21
21
|
import { useAtom as Cr } from "jotai";
|
|
22
|
-
import
|
|
23
|
-
import
|
|
22
|
+
import Nr from "react-autosuggest";
|
|
23
|
+
import kr from "fuse.js";
|
|
24
24
|
import { A as Sr, C as xe, d as Tr } from "./html-to-json-45e0e3b5.js";
|
|
25
25
|
import { L as Se } from "./label-e770a087.js";
|
|
26
26
|
import { S as Rr } from "./MODIFIERS-2f19c314.js";
|
|
@@ -41,6 +41,7 @@ import "react-hotkeys-hook";
|
|
|
41
41
|
import "flat-to-nested";
|
|
42
42
|
import "redux-undo";
|
|
43
43
|
import "sonner";
|
|
44
|
+
import "@radix-ui/react-alert-dialog";
|
|
44
45
|
import "@radix-ui/react-slot";
|
|
45
46
|
import "class-variance-authority";
|
|
46
47
|
import "@radix-ui/react-tooltip";
|
|
@@ -50,13 +51,13 @@ import "@radix-ui/react-popover";
|
|
|
50
51
|
import "cmdk";
|
|
51
52
|
import "@radix-ui/react-accordion";
|
|
52
53
|
import "react-icons-picker";
|
|
53
|
-
import "./ImagesPanel-
|
|
54
|
+
import "./ImagesPanel-47ac13c3.js";
|
|
54
55
|
import "react-quill";
|
|
55
56
|
import "himalaya";
|
|
56
57
|
import "@radix-ui/react-label";
|
|
57
58
|
import "@radix-ui/react-select";
|
|
58
|
-
const
|
|
59
|
-
function
|
|
59
|
+
const Pr = P.lazy(() => import("react-json-view"));
|
|
60
|
+
function $r(t) {
|
|
60
61
|
const s = [], r = {};
|
|
61
62
|
function l(o, a) {
|
|
62
63
|
je(a, (d, i) => {
|
|
@@ -73,7 +74,7 @@ const fe = ({ data: t, fullView: s }) => {
|
|
|
73
74
|
return s ? typeof t == "object" ? /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
74
75
|
/* @__PURE__ */ e.jsx("div", { className: "h-3" }),
|
|
75
76
|
/* @__PURE__ */ e.jsx(Ft, { children: /* @__PURE__ */ e.jsx(
|
|
76
|
-
|
|
77
|
+
Pr,
|
|
77
78
|
{
|
|
78
79
|
style: { maxHeight: "40vh", overflowY: "auto" },
|
|
79
80
|
name: "Content",
|
|
@@ -97,7 +98,7 @@ const fe = ({ data: t, fullView: s }) => {
|
|
|
97
98
|
dataType: a,
|
|
98
99
|
appliedBindings: d
|
|
99
100
|
}) => {
|
|
100
|
-
const { paths: i, pathsType: n } =
|
|
101
|
+
const { paths: i, pathsType: n } = $r(l), u = t === "PROP" ? Qe(l == null ? void 0 : l._type) : {}, x = t === "PROP", [c, m] = w(!1), h = k(() => t === "PROP" ? i.filter(
|
|
101
102
|
(g) => !M(d, g) && p(u, `props.${we(dt(g, "."))}.binding`)
|
|
102
103
|
) : i.filter((g) => a === p(n, g, "")), [t, i, d, a, u]);
|
|
103
104
|
return E(() => {
|
|
@@ -283,12 +284,14 @@ const fe = ({ data: t, fullView: s }) => {
|
|
|
283
284
|
E(() => {
|
|
284
285
|
d(C(t, (c, m) => ({ key: m, value: c })));
|
|
285
286
|
}, [r == null ? void 0 : r._id]);
|
|
286
|
-
const i =
|
|
287
|
+
const i = k(() => {
|
|
288
|
+
if (b(l))
|
|
289
|
+
return !0;
|
|
287
290
|
if (b(a))
|
|
288
291
|
return !1;
|
|
289
292
|
const c = ye(a);
|
|
290
293
|
return b(c == null ? void 0 : c.key) || b(c == null ? void 0 : c.value);
|
|
291
|
-
}, [a]), n = (c) => {
|
|
294
|
+
}, [l, a]), n = (c) => {
|
|
292
295
|
const m = be(a, (h) => h.key !== c.key);
|
|
293
296
|
d([...m, c]), x([...m, c]);
|
|
294
297
|
}, u = (c) => {
|
|
@@ -329,14 +332,14 @@ const fe = ({ data: t, fullView: s }) => {
|
|
|
329
332
|
"button",
|
|
330
333
|
{
|
|
331
334
|
disabled: i,
|
|
332
|
-
className: `w-full px-5 py-1.5 text-xs rounded-md font-medium duration-200 ${
|
|
333
|
-
children: "+ Add Data Binding"
|
|
335
|
+
className: `w-full px-5 py-1.5 text-xs rounded-md font-medium duration-200 ${i ? "cursor-not-allowed bg-gray-200 text-gray-400" : "bg-blue-700/20 text-blue-800 hover:bg-blue-700/30"}`,
|
|
336
|
+
children: b(l) ? /* @__PURE__ */ e.jsx("small", { className: "text-gray-500 text-[9.5px]", children: "No data provider has been set up for this page" }) : "+ Add Data Binding"
|
|
334
337
|
}
|
|
335
338
|
) }) }),
|
|
336
|
-
i && /* @__PURE__ */ e.jsx(Z, { sideOffset: -55, className: "text-[11px]", children: "Complete last added data binding to add more" })
|
|
339
|
+
i && /* @__PURE__ */ e.jsx(Z, { sideOffset: -55, className: "text-[11px]", children: b(l) ? "No data provider has been set up for this page." : "Complete last added data binding to add more" })
|
|
337
340
|
] })
|
|
338
341
|
] });
|
|
339
|
-
}, Mr = Or, _r = () => /* @__PURE__ */ e.jsx("div", { className: "text-xs border rounded-sm p-1 mt-1 border-orange-500 text-orange-500 bg-orange-100", children: "Data binding is set for this field" }),
|
|
342
|
+
}, Mr = Or, _r = () => /* @__PURE__ */ e.jsx("div", { className: "text-xs border rounded-sm p-1 mt-1 border-orange-500 text-orange-500 bg-orange-100", children: "Data binding is set for this field" }), Pe = ({
|
|
340
343
|
createHistorySnapshot: t,
|
|
341
344
|
properties: s,
|
|
342
345
|
formData: r,
|
|
@@ -386,7 +389,7 @@ function Er() {
|
|
|
386
389
|
title: "Name",
|
|
387
390
|
default: p(t, "_name", t._type)
|
|
388
391
|
})
|
|
389
|
-
}, n = ut(p(o, "_bindings", {})), u =
|
|
392
|
+
}, n = ut(p(o, "_bindings", {})), u = k(() => {
|
|
390
393
|
const x = xt(p(l, "props", {}));
|
|
391
394
|
return gt(n, (c) => {
|
|
392
395
|
delete x[c];
|
|
@@ -394,7 +397,7 @@ function Er() {
|
|
|
394
397
|
}, [l, n]);
|
|
395
398
|
return /* @__PURE__ */ e.jsxs("div", { className: "overflow-x-hidden", children: [
|
|
396
399
|
/* @__PURE__ */ e.jsx(
|
|
397
|
-
|
|
400
|
+
Pe,
|
|
398
401
|
{
|
|
399
402
|
onChange: d,
|
|
400
403
|
createHistorySnapshot: a,
|
|
@@ -438,7 +441,7 @@ function Er() {
|
|
|
438
441
|
". Remove data binding to edit static content."
|
|
439
442
|
] }),
|
|
440
443
|
/* @__PURE__ */ e.jsx(
|
|
441
|
-
|
|
444
|
+
Pe,
|
|
442
445
|
{
|
|
443
446
|
onChange: d,
|
|
444
447
|
createHistorySnapshot: a,
|
|
@@ -452,7 +455,7 @@ function Er() {
|
|
|
452
455
|
/* @__PURE__ */ e.jsx("div", { className: "pb-60" })
|
|
453
456
|
] });
|
|
454
457
|
}
|
|
455
|
-
const
|
|
458
|
+
const $e = new kr(Sr, {
|
|
456
459
|
isCaseSensitive: !1,
|
|
457
460
|
threshold: 0.2,
|
|
458
461
|
minMatchCharLength: 2,
|
|
@@ -460,21 +463,21 @@ const Pe = new Nr(Sr, {
|
|
|
460
463
|
});
|
|
461
464
|
function Fr() {
|
|
462
465
|
var D;
|
|
463
|
-
const [t] =
|
|
466
|
+
const [t] = ke(), s = G(), r = Ge(), l = Ke(), [o] = qe(), [a, d] = w(""), i = (D = we(t)) == null ? void 0 : D.prop, n = mt((p(s, i, "").replace(Rr, "").split(",").pop() || "").split(" "), b), u = () => {
|
|
464
467
|
const j = a.trim().toLowerCase().replace(/ +(?= )/g, "").split(" ");
|
|
465
468
|
r(o, j, !0), d("");
|
|
466
469
|
}, [x, c] = w([]), m = ({ value: j }) => {
|
|
467
|
-
const L = j.trim().toLowerCase(),
|
|
468
|
-
let
|
|
469
|
-
if (
|
|
470
|
-
const [I] =
|
|
471
|
-
|
|
470
|
+
const L = j.trim().toLowerCase(), $ = L.match(/.+:/g);
|
|
471
|
+
let N = [];
|
|
472
|
+
if ($ && $.length > 0) {
|
|
473
|
+
const [I] = $, F = L.replace(I, "");
|
|
474
|
+
N = $e.search(F).map((y) => ({
|
|
472
475
|
...y,
|
|
473
476
|
item: { ...y.item, name: I + y.item.name }
|
|
474
477
|
}));
|
|
475
478
|
} else
|
|
476
|
-
|
|
477
|
-
c(C(
|
|
479
|
+
N = $e.search(L);
|
|
480
|
+
c(C(N, "item"));
|
|
478
481
|
}, h = () => {
|
|
479
482
|
c([]);
|
|
480
483
|
}, g = (j) => j.name, f = (j) => /* @__PURE__ */ e.jsx("div", { className: "rounded-md p-1", children: j.name }), S = {
|
|
@@ -498,7 +501,7 @@ function Fr() {
|
|
|
498
501
|
/* @__PURE__ */ e.jsx(Se, { className: "mt-2", children: "Add Tailwind classes" }),
|
|
499
502
|
/* @__PURE__ */ e.jsxs("div", { className: "relative -mt-4 flex items-center gap-x-3", children: [
|
|
500
503
|
/* @__PURE__ */ e.jsx("div", { className: "relative flex w-full items-center gap-x-3", children: /* @__PURE__ */ e.jsx(
|
|
501
|
-
|
|
504
|
+
Nr,
|
|
502
505
|
{
|
|
503
506
|
suggestions: x,
|
|
504
507
|
onSuggestionsFetchRequested: m,
|
|
@@ -1019,8 +1022,8 @@ const B = ["px", "%", "em", "rem", "ch", "vh", "vw"], Yr = {
|
|
|
1019
1022
|
borderRadiusLeft: ee,
|
|
1020
1023
|
borderRadiusTopLeft: wt,
|
|
1021
1024
|
borderRadiusTopRight: Ct,
|
|
1022
|
-
borderRadiusBottomRight:
|
|
1023
|
-
borderRadiusBottomLeft:
|
|
1025
|
+
borderRadiusBottomRight: Nt,
|
|
1026
|
+
borderRadiusBottomLeft: kt,
|
|
1024
1027
|
divideXWidth: R,
|
|
1025
1028
|
divideYWidth: V,
|
|
1026
1029
|
scale: O,
|
|
@@ -1171,16 +1174,16 @@ const B = ["px", "%", "em", "rem", "ch", "vh", "vw"], Yr = {
|
|
|
1171
1174
|
}
|
|
1172
1175
|
)
|
|
1173
1176
|
] }),
|
|
1174
|
-
static:
|
|
1177
|
+
static: Pt
|
|
1175
1178
|
}, se = Oe({ canReset: !1, canChange: !0 }), Zr = ({ children: t, canReset: s = !1, canChange: r = !0 }) => (
|
|
1176
1179
|
// eslint-disable-next-line react/jsx-no-constructed-context-values
|
|
1177
1180
|
/* @__PURE__ */ e.jsx(se.Provider, { value: { canReset: s, canChange: r }, children: t })
|
|
1178
1181
|
), lt = ({ label: t, property: s, onChange: r }) => {
|
|
1179
|
-
const l =
|
|
1182
|
+
const l = k(() => p(xe, `${s}.classes`, [""]), [s]), o = le(s), a = k(() => p(o, "cls", ""), [o]), { canChange: d } = re(se), i = /\[.*\]/g.test(a);
|
|
1180
1183
|
return /* @__PURE__ */ e.jsx("div", { className: t ? "w-full rounded " : "grow", children: i ? /* @__PURE__ */ e.jsxs("div", { className: "flex items-center", children: [
|
|
1181
1184
|
/* @__PURE__ */ e.jsx(br, { className: "w-[70%] rounded py-1", readOnly: !0, value: a }),
|
|
1182
1185
|
/* @__PURE__ */ e.jsxs(X, { delayDuration: 100, children: [
|
|
1183
|
-
/* @__PURE__ */ e.jsx(W, { asChild: !0, children: /* @__PURE__ */ e.jsx("button", { type: "button", className: "invisible ml-3 mt-1 text-blue-600 group-hover:visible", children: /* @__PURE__ */ e.jsx(
|
|
1186
|
+
/* @__PURE__ */ e.jsx(W, { asChild: !0, children: /* @__PURE__ */ e.jsx("button", { type: "button", className: "invisible ml-3 mt-1 text-blue-600 group-hover:visible", children: /* @__PURE__ */ e.jsx(Ne, {}) }) }),
|
|
1184
1187
|
/* @__PURE__ */ e.jsx(Z, { children: "Current value is using a Tailwind arbitrary value." })
|
|
1185
1188
|
] })
|
|
1186
1189
|
] }) : /* @__PURE__ */ e.jsx(
|
|
@@ -1208,7 +1211,7 @@ function ve({ selected: t, onChange: s, rounded: r = !1, options: l, disabled: o
|
|
|
1208
1211
|
value: a,
|
|
1209
1212
|
children: [
|
|
1210
1213
|
/* @__PURE__ */ e.jsx("option", { className: "bg-transparent", value: "" }),
|
|
1211
|
-
|
|
1214
|
+
P.Children.toArray(
|
|
1212
1215
|
l.map((n) => /* @__PURE__ */ e.jsx("option", { className: "bg-transparent", value: n, children: n }))
|
|
1213
1216
|
)
|
|
1214
1217
|
]
|
|
@@ -1216,7 +1219,7 @@ function ve({ selected: t, onChange: s, rounded: r = !1, options: l, disabled: o
|
|
|
1216
1219
|
);
|
|
1217
1220
|
}
|
|
1218
1221
|
const zr = ({ property: t, onChange: s }) => {
|
|
1219
|
-
const { canReset: r, canChange: l } = re(se), o = le(t), a =
|
|
1222
|
+
const { canReset: r, canChange: l } = re(se), o = le(t), a = k(() => p(o, "cls", ""), [o]), d = k(() => p(xe, `${t}.classes`, [""]), [t]), i = d.indexOf(a) > -1 ? d.indexOf(a) : 0, n = /\[.*\]/g.test(a);
|
|
1220
1223
|
return /* @__PURE__ */ e.jsx("div", { className: "flex flex-row divide-x divide-solid divide-border rounded border border-border text-xs", children: n ? /* @__PURE__ */ e.jsx("div", { className: "py-[5px] px-2", children: a }) : /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
1221
1224
|
/* @__PURE__ */ e.jsx(
|
|
1222
1225
|
"button",
|
|
@@ -1225,7 +1228,7 @@ const zr = ({ property: t, onChange: s }) => {
|
|
|
1225
1228
|
className: "box-border w-2/12 rounded-tl rounded-bl bg-background px-1 text-center hover:bg-bg-gray-700 disabled:cursor-not-allowed disabled:bg-gray-600",
|
|
1226
1229
|
disabled: !l && (!r || i - 1 < 0),
|
|
1227
1230
|
onClick: () => s(Re(d, i - 1), t),
|
|
1228
|
-
children: /* @__PURE__ */ e.jsx("span", { className: "flex items-center justify-center", children: /* @__PURE__ */ e.jsx(
|
|
1231
|
+
children: /* @__PURE__ */ e.jsx("span", { className: "flex items-center justify-center", children: /* @__PURE__ */ e.jsx($t, { className: !l && (!r || i - 1 < 0) ? "text-gray-500" : "text-white/60" }) })
|
|
1229
1232
|
}
|
|
1230
1233
|
),
|
|
1231
1234
|
/* @__PURE__ */ e.jsx("div", { className: "w-8/12 text-center", children: /* @__PURE__ */ e.jsx(lt, { label: !1, property: t, onChange: s }) }),
|
|
@@ -1246,7 +1249,7 @@ const zr = ({ property: t, onChange: s }) => {
|
|
|
1246
1249
|
)
|
|
1247
1250
|
] }) });
|
|
1248
1251
|
}, Ur = ({ property: t, onChange: s }) => {
|
|
1249
|
-
const r =
|
|
1252
|
+
const r = k(() => p(xe, `${t}.classes`, [""]), [t]), { canChange: l } = re(se), o = le(t), a = k(() => p(o, "cls", ""), [o]);
|
|
1250
1253
|
return /* @__PURE__ */ e.jsx("div", { className: "flex grow flex-wrap gap-1", children: C(r, (d) => /* @__PURE__ */ e.jsxs(X, { children: [
|
|
1251
1254
|
/* @__PURE__ */ e.jsx(W, { asChild: !0, children: /* @__PURE__ */ e.jsx(
|
|
1252
1255
|
"button",
|
|
@@ -1255,7 +1258,7 @@ const zr = ({ property: t, onChange: s }) => {
|
|
|
1255
1258
|
disabled: !l,
|
|
1256
1259
|
onClick: () => s(d, t),
|
|
1257
1260
|
className: `cursor-pointer rounded border border-gray-600 p-1 disabled:cursor-not-allowed ${a === d ? " bg-blue-500 text-white" : "disabled:bg-gray-600 disabled:text-gray-400"}`,
|
|
1258
|
-
children:
|
|
1261
|
+
children: P.createElement(p(st, d, Xe))
|
|
1259
1262
|
}
|
|
1260
1263
|
) }),
|
|
1261
1264
|
/* @__PURE__ */ e.jsx(Z, { children: Y(te(d)) })
|
|
@@ -1273,7 +1276,7 @@ const zr = ({ property: t, onChange: s }) => {
|
|
|
1273
1276
|
ringColor: "ring",
|
|
1274
1277
|
ringOffsetColor: "ring-offset"
|
|
1275
1278
|
}, Kr = ({ property: t, onChange: s }) => {
|
|
1276
|
-
const r = le(t), l =
|
|
1279
|
+
const r = le(t), l = k(() => p(r, "cls", ""), [r]), { canChange: o } = re(se), [a, d] = w([]), [i, n] = w({ color: "", shade: "" }), u = l.split("-"), x = p(u, "1", ""), c = p(u, "2", ""), m = A(
|
|
1277
1280
|
// eslint-disable-next-line no-shadow
|
|
1278
1281
|
(g) => {
|
|
1279
1282
|
["current", "inherit", "transparent", "black", "white"].includes(g) ? (d([]), n({ color: g })) : (d(["50", "100", "200", "300", "400", "500", "600", "700", "800", "900"]), n((f) => ({ ...f, color: g, shade: f.shade ? f.shade : "500" })));
|
|
@@ -1484,7 +1487,7 @@ const zr = ({ property: t, onChange: s }) => {
|
|
|
1484
1487
|
return Qr(t);
|
|
1485
1488
|
const r = p(s, "0", "").replace(/\[|\]/g, ""), l = t.startsWith("-") ? "-" : "", o = we(r.match(/\d+.\d+|\d+/g));
|
|
1486
1489
|
return { value: `${l}${o}`, unit: r.replace(o, "") };
|
|
1487
|
-
}, Qr = (t) => b(t) ? { value: "", unit: "" } : qr(t), ot =
|
|
1490
|
+
}, Qr = (t) => b(t) ? { value: "", unit: "" } : qr(t), ot = P.createContext({
|
|
1488
1491
|
setDragData: () => {
|
|
1489
1492
|
}
|
|
1490
1493
|
}), es = ({
|
|
@@ -1532,7 +1535,7 @@ const zr = ({ property: t, onChange: s }) => {
|
|
|
1532
1535
|
},
|
|
1533
1536
|
l
|
|
1534
1537
|
)) }), rs = (t) => {
|
|
1535
|
-
const [s, r] = w(!1), [l, o] = w(""), { currentClass: a, onChange: d, classPrefix: i, cssProperty: n, units: u, negative: x } = t, [c, m] = w(n != null && n.toLowerCase().includes("width") ? "%" : u[0]), [h, g] = w(!1), [f, S] = w(""), [D, j] = w(!1), [L,
|
|
1538
|
+
const [s, r] = w(!1), [l, o] = w(""), { currentClass: a, onChange: d, classPrefix: i, cssProperty: n, units: u, negative: x } = t, [c, m] = w(n != null && n.toLowerCase().includes("width") ? "%" : u[0]), [h, g] = w(!1), [f, S] = w(""), [D, j] = w(!1), [L, $] = w(!1);
|
|
1536
1539
|
E(() => {
|
|
1537
1540
|
const { value: y, unit: v } = Jr(a);
|
|
1538
1541
|
if (v === "") {
|
|
@@ -1541,7 +1544,7 @@ const zr = ({ property: t, onChange: s }) => {
|
|
|
1541
1544
|
}
|
|
1542
1545
|
m(v), o(v === "class" || b(y) ? "" : y);
|
|
1543
1546
|
}, [a, n, u]);
|
|
1544
|
-
const
|
|
1547
|
+
const N = me(
|
|
1545
1548
|
(y) => {
|
|
1546
1549
|
d(y);
|
|
1547
1550
|
},
|
|
@@ -1562,15 +1565,15 @@ const zr = ({ property: t, onChange: s }) => {
|
|
|
1562
1565
|
}
|
|
1563
1566
|
const T = p(v, "unit") !== "" ? p(v, "unit") : c;
|
|
1564
1567
|
if (T === "auto" || T === "none") {
|
|
1565
|
-
|
|
1568
|
+
N(`${i}${T}`);
|
|
1566
1569
|
return;
|
|
1567
1570
|
}
|
|
1568
1571
|
if (p(v, "value") === "")
|
|
1569
1572
|
return;
|
|
1570
1573
|
const K = `${p(v, "value", "").startsWith("-") ? "-" : ""}${i}[${p(v, "value", "").replace("-", "")}${T === "-" ? "" : T}]`;
|
|
1571
|
-
y ? I(K) :
|
|
1574
|
+
y ? I(K) : N(K);
|
|
1572
1575
|
},
|
|
1573
|
-
[
|
|
1576
|
+
[N, I, l, c, i, u]
|
|
1574
1577
|
), oe = A(
|
|
1575
1578
|
(y) => {
|
|
1576
1579
|
const v = Ie(`${l}`, u);
|
|
@@ -1579,20 +1582,20 @@ const zr = ({ property: t, onChange: s }) => {
|
|
|
1579
1582
|
return;
|
|
1580
1583
|
}
|
|
1581
1584
|
if (y === "auto" || y === "none") {
|
|
1582
|
-
|
|
1585
|
+
N(`${i}${y}`);
|
|
1583
1586
|
return;
|
|
1584
1587
|
}
|
|
1585
1588
|
if (p(v, "value") === "")
|
|
1586
1589
|
return;
|
|
1587
1590
|
const T = p(v, "unit") !== "" ? p(v, "unit") : y, K = `${p(v, "value", "").startsWith("-") ? "-" : ""}${i}[${p(v, "value", "").replace("-", "")}${T === "-" ? "" : T}]`;
|
|
1588
|
-
|
|
1591
|
+
N(K);
|
|
1589
1592
|
},
|
|
1590
|
-
[
|
|
1593
|
+
[N, l, i, u]
|
|
1591
1594
|
);
|
|
1592
1595
|
return /* @__PURE__ */ e.jsx("div", { className: "flex w-full flex-col", children: /* @__PURE__ */ e.jsx("div", { className: "flex items-center justify-start", children: c === "class" ? /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
1593
1596
|
/* @__PURE__ */ e.jsx("input", { className: "w-20 rounded py-1", readOnly: !0, value: a }),
|
|
1594
1597
|
/* @__PURE__ */ e.jsxs(X, { children: [
|
|
1595
|
-
/* @__PURE__ */ e.jsx(W, { asChild: !0, children: /* @__PURE__ */ e.jsx("button", { type: "button", className: "invisible ml-3 mt-1 text-blue-600 group-hover:visible", children: /* @__PURE__ */ e.jsx(
|
|
1598
|
+
/* @__PURE__ */ e.jsx(W, { asChild: !0, children: /* @__PURE__ */ e.jsx("button", { type: "button", className: "invisible ml-3 mt-1 text-blue-600 group-hover:visible", children: /* @__PURE__ */ e.jsx(Ne, {}) }) }),
|
|
1596
1599
|
/* @__PURE__ */ e.jsx(Z, { children: "Current value is using a Tailwind preset class." })
|
|
1597
1600
|
] })
|
|
1598
1601
|
] }) : /* @__PURE__ */ e.jsxs("div", { className: `group relative flex items-center ${D ? "z-auto" : ""}`, children: [
|
|
@@ -1607,7 +1610,7 @@ const zr = ({ property: t, onChange: s }) => {
|
|
|
1607
1610
|
onKeyDown: (y) => {
|
|
1608
1611
|
if (y.keyCode !== 38 && y.keyCode !== 40)
|
|
1609
1612
|
return;
|
|
1610
|
-
y.preventDefault(),
|
|
1613
|
+
y.preventDefault(), $(!0);
|
|
1611
1614
|
const v = bt(y.target.value);
|
|
1612
1615
|
let T = _e(v) ? 0 : v;
|
|
1613
1616
|
y.keyCode === 38 && (T += 1), y.keyCode === 40 && (T -= 1);
|
|
@@ -1615,7 +1618,7 @@ const zr = ({ property: t, onChange: s }) => {
|
|
|
1615
1618
|
I(at);
|
|
1616
1619
|
},
|
|
1617
1620
|
onKeyUp: (y) => {
|
|
1618
|
-
L && (y.preventDefault(),
|
|
1621
|
+
L && (y.preventDefault(), $(!1));
|
|
1619
1622
|
},
|
|
1620
1623
|
onBlur: () => F(),
|
|
1621
1624
|
onChange: (y) => {
|
|
@@ -1665,7 +1668,7 @@ const zr = ({ property: t, onChange: s }) => {
|
|
|
1665
1668
|
if (S(() => ""), j(!1), b(y))
|
|
1666
1669
|
return;
|
|
1667
1670
|
const v = `${y}`, _ = `${v.startsWith("-") ? "-" : ""}${i}[${v.replace("-", "")}${c === "-" ? "" : c}]`;
|
|
1668
|
-
|
|
1671
|
+
N(_);
|
|
1669
1672
|
},
|
|
1670
1673
|
onDrag: (y) => {
|
|
1671
1674
|
if (b(y))
|
|
@@ -1769,9 +1772,9 @@ const zr = ({ property: t, onChange: s }) => {
|
|
|
1769
1772
|
"2xl": "1536px"
|
|
1770
1773
|
}, os = (t) => `${t.toUpperCase()} ${Le[t] ? `(${Le[t]} & up)` : ""}`, Te = (t) => {
|
|
1771
1774
|
const { type: s = "icons", label: r, property: l, onEmitChange: o = () => {
|
|
1772
|
-
}, units: a, negative: d = !1 } = t, [i] = Zt(), [n] = Je(), [, u] = Ae(), x = le(l), c = Ge(), m = Ke(), [h] = qe(), g =
|
|
1773
|
-
(
|
|
1774
|
-
const F = { dark: i, mq: u, mod: n, cls:
|
|
1775
|
+
}, units: a, negative: d = !1 } = t, [i] = Zt(), [n] = Je(), [, u] = Ae(), x = le(l), c = Ge(), m = Ke(), [h] = qe(), g = k(() => p(x, "fullCls", ""), [x]), f = A(
|
|
1776
|
+
(N, I = !0) => {
|
|
1777
|
+
const F = { dark: i, mq: u, mod: n, cls: N, property: l, fullCls: "" };
|
|
1775
1778
|
(i || n !== "") && (F.mq = "xs");
|
|
1776
1779
|
const oe = Tr(F);
|
|
1777
1780
|
c(h, [oe], I);
|
|
@@ -1779,12 +1782,12 @@ const zr = ({ property: t, onChange: s }) => {
|
|
|
1779
1782
|
[h, i, u, n, l, c]
|
|
1780
1783
|
), S = A(() => {
|
|
1781
1784
|
m(h, [g]);
|
|
1782
|
-
}, [h, g, m]), D =
|
|
1785
|
+
}, [h, g, m]), D = k(() => ss(x, u), [x, u]);
|
|
1783
1786
|
E(() => {
|
|
1784
1787
|
o(D, x);
|
|
1785
1788
|
}, [D, o, x]);
|
|
1786
1789
|
const [, , j] = Ae(), L = A(
|
|
1787
|
-
(
|
|
1790
|
+
(N) => {
|
|
1788
1791
|
j({
|
|
1789
1792
|
xs: 400,
|
|
1790
1793
|
sm: 640,
|
|
@@ -1792,12 +1795,12 @@ const zr = ({ property: t, onChange: s }) => {
|
|
|
1792
1795
|
lg: 1024,
|
|
1793
1796
|
xl: 1420,
|
|
1794
1797
|
"2xl": 1920
|
|
1795
|
-
}[
|
|
1798
|
+
}[N]);
|
|
1796
1799
|
},
|
|
1797
1800
|
[j]
|
|
1798
|
-
),
|
|
1799
|
-
return /* @__PURE__ */ e.jsx(Zr, { canChange: D, canReset: x &&
|
|
1800
|
-
/* @__PURE__ */ e.jsx("div", { className: "relative w-[70px] truncate text-xs text-foreground", children: /* @__PURE__ */ e.jsx("span", { className: `text-[11px] ${x &&
|
|
1801
|
+
), $ = p(x, "dark", null) === i && p(x, "mod", null) === n && p(x, "mq", null) === u;
|
|
1802
|
+
return /* @__PURE__ */ e.jsx(Zr, { canChange: D, canReset: x && $, children: /* @__PURE__ */ e.jsxs("div", { className: "group flex flex-row items-center py-2 first:pt-0 last:pb-0", children: [
|
|
1803
|
+
/* @__PURE__ */ e.jsx("div", { className: "relative w-[70px] truncate text-xs text-foreground", children: /* @__PURE__ */ e.jsx("span", { className: `text-[11px] ${x && !$ ? "text-foreground" : ""}`, children: r }) }),
|
|
1801
1804
|
/* @__PURE__ */ e.jsxs("div", { className: "flex flex-row items-center", children: [
|
|
1802
1805
|
/* @__PURE__ */ e.jsxs("div", { className: "w-[150px]", children: [
|
|
1803
1806
|
s === "arbitrary" ? /* @__PURE__ */ e.jsx(
|
|
@@ -1816,13 +1819,13 @@ const zr = ({ property: t, onChange: s }) => {
|
|
|
1816
1819
|
s === "color" && /* @__PURE__ */ e.jsx(Kr, { property: l, onChange: f }),
|
|
1817
1820
|
s === "dropdown" && /* @__PURE__ */ e.jsx(lt, { label: r, property: l, onChange: f })
|
|
1818
1821
|
] }),
|
|
1819
|
-
/* @__PURE__ */ e.jsx("div", { className: `w-[30px] cursor-pointer ${g ? "visible" : "invisible"}`, children:
|
|
1822
|
+
/* @__PURE__ */ e.jsx("div", { className: `w-[30px] cursor-pointer ${g ? "visible" : "invisible"}`, children: $ ? /* @__PURE__ */ e.jsx("button", { type: "button", onClick: () => S(), title: "Reset", className: "flex px-1.5 text-xs", children: /* @__PURE__ */ e.jsx(We, { className: "h-5 w-5 text-blue-500 hover:opacity-80" }) }) : D && x ? /* @__PURE__ */ e.jsxs(X, { delayDuration: 100, children: [
|
|
1820
1823
|
/* @__PURE__ */ e.jsx(W, { asChild: !0, children: /* @__PURE__ */ e.jsx(
|
|
1821
1824
|
"button",
|
|
1822
1825
|
{
|
|
1823
1826
|
type: "button",
|
|
1824
1827
|
className: "invisible ml-3 mt-1 rounded-full bg-blue-500 text-white group-hover:visible",
|
|
1825
|
-
children: /* @__PURE__ */ e.jsx(
|
|
1828
|
+
children: /* @__PURE__ */ e.jsx(Ne, {})
|
|
1826
1829
|
}
|
|
1827
1830
|
) }),
|
|
1828
1831
|
/* @__PURE__ */ e.jsx(Z, { children: /* @__PURE__ */ e.jsx("div", { className: "text-right", children: /* @__PURE__ */ e.jsxs("div", { children: [
|
|
@@ -1865,7 +1868,7 @@ const zr = ({ property: t, onChange: s }) => {
|
|
|
1865
1868
|
children: [
|
|
1866
1869
|
/* @__PURE__ */ e.jsxs("div", { className: "flex flex-row text-xs", children: [
|
|
1867
1870
|
t && /* @__PURE__ */ e.jsx("span", { className: "relative w-[70px] flex-none text-xs text-foreground", children: t }),
|
|
1868
|
-
/* @__PURE__ */ e.jsx("div", { className: "mb-3 flex grow flex-row flex-wrap gap-x-px", children:
|
|
1871
|
+
/* @__PURE__ */ e.jsx("div", { className: "mb-3 flex grow flex-row flex-wrap gap-x-px", children: P.Children.toArray(
|
|
1869
1872
|
s.map(({ label: c, key: m }) => /* @__PURE__ */ e.jsx("div", { className: "first:rounded-l last:rounded-r", children: /* @__PURE__ */ e.jsxs(X, { children: [
|
|
1870
1873
|
/* @__PURE__ */ e.jsx(W, { asChild: !0, children: /* @__PURE__ */ e.jsxs(
|
|
1871
1874
|
"button",
|
|
@@ -1874,10 +1877,10 @@ const zr = ({ property: t, onChange: s }) => {
|
|
|
1874
1877
|
onClick: () => n(m),
|
|
1875
1878
|
className: `relative cursor-pointer rounded-full p-1 text-[8px] ${m === i ? " bg-[#3E57F0] text-white" : "text-gray-600 dark:text-gray-300"}`,
|
|
1876
1879
|
children: [
|
|
1877
|
-
|
|
1880
|
+
P.createElement("div", {
|
|
1878
1881
|
className: x(m) ? "-bottom-1.5 absolute bg-[#3E57F0] h-[2px] left-0 w-full" : ""
|
|
1879
1882
|
}),
|
|
1880
|
-
|
|
1883
|
+
P.createElement(p(st, m, Xe), { className: "text-inherit w-3 h-3" })
|
|
1881
1884
|
]
|
|
1882
1885
|
}
|
|
1883
1886
|
) }),
|
|
@@ -1899,7 +1902,7 @@ const zr = ({ property: t, onChange: s }) => {
|
|
|
1899
1902
|
}
|
|
1900
1903
|
);
|
|
1901
1904
|
}, as = ({ heading: t, items: s }) => {
|
|
1902
|
-
const r = pe(), l =
|
|
1905
|
+
const r = pe(), l = k(() => {
|
|
1903
1906
|
const o = (i) => U(
|
|
1904
1907
|
i.map((n) => n.styleType === "multiple" ? C(n.options, "key") : n.property)
|
|
1905
1908
|
), a = U(
|
|
@@ -1934,7 +1937,7 @@ const zr = ({ property: t, onChange: s }) => {
|
|
|
1934
1937
|
return i;
|
|
1935
1938
|
},
|
|
1936
1939
|
[s]
|
|
1937
|
-
), l =
|
|
1940
|
+
), l = k(() => {
|
|
1938
1941
|
if (s.length > 0 && t.heading === "Classes")
|
|
1939
1942
|
return !0;
|
|
1940
1943
|
const a = (n) => U(
|
|
@@ -1943,14 +1946,14 @@ const zr = ({ property: t, onChange: s }) => {
|
|
|
1943
1946
|
t.items.map((n) => n.styleType === "accordion" ? a(n.items) : n.styleType === "multiple" ? U(C(n.options, "key")) : n.property)
|
|
1944
1947
|
), i = C(s, "property");
|
|
1945
1948
|
return Ee(d, i).length > 0;
|
|
1946
|
-
}, [s, t.heading, t.items]), o =
|
|
1949
|
+
}, [s, t.heading, t.items]), o = k(() => ({}), []);
|
|
1947
1950
|
return /* @__PURE__ */ e.jsx(is.Provider, { value: o, children: /* @__PURE__ */ e.jsxs(ie, { value: t.heading, children: [
|
|
1948
1951
|
/* @__PURE__ */ e.jsx(de, { className: "px-3 py-2 text-xs hover:no-underline", children: /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-x-2", children: [
|
|
1949
1952
|
/* @__PURE__ */ e.jsx("div", { className: `h-[8px] w-[8px] rounded-full ${l ? "bg-blue-500" : "bg-gray-300"}` }),
|
|
1950
1953
|
t.heading
|
|
1951
1954
|
] }) }),
|
|
1952
|
-
/* @__PURE__ */ e.jsx(ce, { className: "bg-gray-100 px-3.5 py-2", children:
|
|
1953
|
-
t.items.map((a) => ge(a, "component") ?
|
|
1955
|
+
/* @__PURE__ */ e.jsx(ce, { className: "bg-gray-100 px-3.5 py-2", children: P.Children.toArray(
|
|
1956
|
+
t.items.map((a) => ge(a, "component") ? P.createElement(a.component, { key: a.label }) : ge(a, "styleType") ? a.styleType === "multiple" ? /* @__PURE__ */ e.jsx(nt, { ...a }, a.label) : a.styleType === "accordion" && r(a == null ? void 0 : a.conditions) ? /* @__PURE__ */ e.jsx(as, { ...a }, a.label) : null : /* @__PURE__ */ e.jsx(Te, { ...a }, a.label))
|
|
1954
1957
|
) })
|
|
1955
1958
|
] }) });
|
|
1956
1959
|
}, ds = ({
|
|
@@ -1995,7 +1998,7 @@ const zr = ({ property: t, onChange: s }) => {
|
|
|
1995
1998
|
] })
|
|
1996
1999
|
] }), cs = ({ section: t }) => {
|
|
1997
2000
|
var m;
|
|
1998
|
-
const { setSyncState: s } = zt(), r = G(), [l, o] = w([]), [a] =
|
|
2001
|
+
const { setSyncState: s } = zt(), r = G(), [l, o] = w([]), [a] = ke(), d = Ue(), i = `${p(a, "0.prop")}_attrs`;
|
|
1999
2002
|
ne.useEffect(() => {
|
|
2000
2003
|
const h = C(p(r, i), (g, f) => ({ key: f, value: g }));
|
|
2001
2004
|
b(h) ? o([]) : o(h);
|
|
@@ -2065,7 +2068,7 @@ const zr = ({ property: t, onChange: s }) => {
|
|
|
2065
2068
|
] });
|
|
2066
2069
|
};
|
|
2067
2070
|
function ps() {
|
|
2068
|
-
const [t, s] = Je(), { flexChild: r, gridChild: l } = Ut(), [, o] = Cr(Gt), { t: a } = Fe(), [d] =
|
|
2071
|
+
const [t, s] = Je(), { flexChild: r, gridChild: l } = Ut(), [, o] = Cr(Gt), { t: a } = Fe(), [d] = ke();
|
|
2069
2072
|
return b(d) ? /* @__PURE__ */ e.jsx("div", { className: "p-4 text-center", children: /* @__PURE__ */ e.jsxs("div", { className: "space-y-4 rounded-xl p-4", children: [
|
|
2070
2073
|
/* @__PURE__ */ e.jsx(Ze, { className: "mx-auto text-3xl" }),
|
|
2071
2074
|
/* @__PURE__ */ e.jsx("h1", { children: a("no_styling_block_selected") }),
|
|
@@ -2121,8 +2124,8 @@ const us = {
|
|
|
2121
2124
|
"-": 1,
|
|
2122
2125
|
deg: 1,
|
|
2123
2126
|
ms: 0.1
|
|
2124
|
-
},
|
|
2125
|
-
const t = G(), { t: s } = Fe(), [r, l] =
|
|
2127
|
+
}, ml = () => {
|
|
2128
|
+
const t = G(), { t: s } = Fe(), [r, l] = P.useState(""), [o, a] = P.useState({
|
|
2126
2129
|
onDrag: (n) => n,
|
|
2127
2130
|
onDragEnd: (n) => n,
|
|
2128
2131
|
dragStartY: 0,
|
|
@@ -2185,5 +2188,5 @@ const us = {
|
|
|
2185
2188
|
] });
|
|
2186
2189
|
};
|
|
2187
2190
|
export {
|
|
2188
|
-
|
|
2191
|
+
ml as default
|
|
2189
2192
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var P=Object.create;var q=Object.defineProperty;var A=Object.getOwnPropertyDescriptor;var T=Object.getOwnPropertyNames;var z=Object.getPrototypeOf,B=Object.prototype.hasOwnProperty;var K=(s,o,r,u)=>{if(o&&typeof o=="object"||typeof o=="function")for(let l of T(o))!B.call(s,l)&&l!==r&&q(s,l,{get:()=>o[l],enumerable:!(u=A(o,l))||u.enumerable});return s};var V=(s,o,r)=>(r=s!=null?P(z(s)):{},K(o||!s||!s.__esModule?q(r,"default",{value:s,enumerable:!0}):r,s));Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-5c3ac4f7.cjs"),k=require("@radix-ui/react-icons"),i=require("react"),N=require("jotai"),x=require("lodash"),n=require("./useBuilderProp-adacf42f.cjs"),h=require("./tabs-860e37aa.cjs"),E=require("./index-6fc652ec.cjs");require("react-i18next");const I=require("./utils-3c452dd0.cjs"),w=require("lucide-react"),L=require("@chaibuilder/blocks"),g=require("./dialog-170eaad9.cjs"),v=require("./select-0e32300c.cjs");require("@radix-ui/react-alert-dialog");require("@radix-ui/react-slot");require("class-variance-authority");require("@radix-ui/react-tooltip");require("@radix-ui/react-toast");require("@radix-ui/react-tabs");require("./MODIFIERS-4716c669.cjs");require("clsx");require("@radix-ui/react-scroll-area");require("react-dom");require("@floating-ui/react-dom");require("i18next");require("flagged");require("react-dnd");require("@minoru/react-dnd-treeview");require("react-hotkeys-hook");require("flat-to-nested");require("./html-to-json-aadcbf66.cjs");require("himalaya");require("redux-undo");require("@react-hookz/web");require("sonner");require("tailwind-merge");require("@radix-ui/react-dialog");require("@radix-ui/react-select");const M=i.lazy(()=>import("react-json-view")),H=({provider:s,onClose:o})=>{const[r,u]=i.useState(null);return i.useEffect(()=>{s&&(s.mockFn?s.mockFn:s.dataFn)().then(d=>u(d))},[s]),s?e.jsxRuntimeExports.jsx(g.Dialog,{onOpenChange:l=>l?"":o(),defaultOpen:!0,children:e.jsxRuntimeExports.jsxs(g.DialogContent,{children:[e.jsxRuntimeExports.jsxs(g.DialogHeader,{children:[e.jsxRuntimeExports.jsxs(g.DialogTitle,{children:["Data Provider: ",s.name]}),e.jsxRuntimeExports.jsx(g.DialogDescription,{children:s.description})]}),e.jsxRuntimeExports.jsx(E.ErrorBoundary,{children:e.jsxRuntimeExports.jsx(M,{style:{maxHeight:"80vh",overflowY:"auto"},name:s.providerKey,enableClipboard:!1,displayObjectSize:!1,displayDataTypes:!1,src:r})})]})}):null};function O({children:s,name:o,onRemove:r}){return e.jsxRuntimeExports.jsxs(n.AlertDialog,{children:[e.jsxRuntimeExports.jsx(n.AlertDialogTrigger,{asChild:!0,children:s}),e.jsxRuntimeExports.jsxs(n.AlertDialogContent,{children:[e.jsxRuntimeExports.jsxs(n.AlertDialogHeader,{children:[e.jsxRuntimeExports.jsxs(n.AlertDialogTitle,{children:["Are you sure, you want to remove ",e.jsxRuntimeExports.jsx("span",{className:"text-blue-500",children:o})," provider?"]}),e.jsxRuntimeExports.jsx(n.AlertDialogDescription,{children:"Your data provider will be removed from this page and all added data binding will be not visible on blocks."})]}),e.jsxRuntimeExports.jsxs(n.AlertDialogFooter,{children:[e.jsxRuntimeExports.jsx(n.AlertDialogCancel,{children:"Cancel"}),e.jsxRuntimeExports.jsx(n.AlertDialogAction,{onClick:r,className:"bg-red-600 hover:bg-red-700",children:"Remove"})]})]})]})}const F=()=>{const s=i.useMemo(()=>L.getChaiDataProviders(),[]),[o,r]=E.usePageDataProviders(),[,u]=N.useAtom(E.pageSyncStateAtom),[l,d]=i.useState(x.filter(s,t=>x.map(o,"providerKey").includes(t.providerKey))),[j,y]=i.useState(""),[R,c]=i.useState(null),b=x.filter(s.map(t=>x.map(l,"providerKey").includes(t.providerKey)?null:{value:t.providerKey,label:t.name}),t=>!x.isNull(t)),a=t=>{const p=x.find(s,{providerKey:t});d(m=>[...m,p]),r(m=>[...m,{providerKey:p.providerKey,args:{}}]),y(""),u("UNSAVED")},f=t=>{d(p=>x.filter(p,m=>m.providerKey!==t.providerKey)),r(p=>x.filter(p,m=>m.providerKey!==t.providerKey)),u("UNSAVED")},D=t=>c(t);return x.isEmpty(s)?e.jsxRuntimeExports.jsx("div",{children:e.jsxRuntimeExports.jsxs("p",{className:"text-gray-500 mb-1.5 text-xs p-4",children:["You have no data providers registered. Please add a data provider to your project. ",e.jsxRuntimeExports.jsx("br",{}),e.jsxRuntimeExports.jsx("a",{className:"text-blue-500",href:"https://chaibuilder.com/docs/registering-data-providers",target:"_blank",children:"Learn more"})]})}):e.jsxRuntimeExports.jsxs("div",{className:"px-1",children:[e.jsxRuntimeExports.jsx("br",{}),e.jsxRuntimeExports.jsx("label",{children:e.jsxRuntimeExports.jsx("p",{className:"text-gray-500 mb-1.5 text-xs",children:"Add data providers:"})}),e.jsxRuntimeExports.jsx("div",{className:"flex items-center space-x-1",children:e.jsxRuntimeExports.jsxs(v.Select,{value:j,onValueChange:t=>a(t),children:[e.jsxRuntimeExports.jsx(v.SelectTrigger,{className:"w-full",children:e.jsxRuntimeExports.jsx(v.SelectValue,{placeholder:"Select a provider"})}),e.jsxRuntimeExports.jsxs(v.SelectContent,{children:[e.jsxRuntimeExports.jsx(v.SelectItem,{value:"",children:"Choose"}),b.map(t=>e.jsxRuntimeExports.jsx(v.SelectItem,{value:t.value,children:t.label},t.value))]})]})}),e.jsxRuntimeExports.jsx("br",{}),e.jsxRuntimeExports.jsxs("div",{className:`border-t ${l.length?"block":"hidden"}`,children:[e.jsxRuntimeExports.jsx("p",{className:"text-gray-500 pt-4 pb-1.5 text-xs flex-1 font-medium",children:"Page data providers:"}),e.jsxRuntimeExports.jsx("div",{className:"space-y-2",children:l.map(t=>e.jsxRuntimeExports.jsxs("div",{className:"rounded-lg border bg-card text-card-foreground shadow-sm w-full","data-v0-t":"card",children:[e.jsxRuntimeExports.jsx("div",{className:"flex flex-col space-y-1.5 px-4 pt-4",children:e.jsxRuntimeExports.jsx("div",{className:"flex justify-between items-center",children:e.jsxRuntimeExports.jsxs("div",{children:[e.jsxRuntimeExports.jsx("h3",{className:"font-medium leading-4",children:t.name}),e.jsxRuntimeExports.jsx("p",{className:"text-xs text-gray-400 pt-1",children:t.description})]})})}),e.jsxRuntimeExports.jsxs("div",{className:"items-center p-2 py-2 flex justify-between",children:[e.jsxRuntimeExports.jsxs("button",{onClick:()=>D(t),className:"inline-flex items-center justify-center text-xs font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 underline-offset-4 hover:underline h-9 rounded-md px-3 text-blue-500",children:[e.jsxRuntimeExports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",className:"w-4 h-4 mr-2",children:[e.jsxRuntimeExports.jsx("path",{d:"M2 12s3-7 10-7 10 7 10 7-3 7-10 7-10-7-10-7Z"}),e.jsxRuntimeExports.jsx("circle",{cx:"12",cy:"12",r:"3"})]}),"View Data"]}),e.jsxRuntimeExports.jsx(O,{onRemove:()=>f(t),name:t.name,children:e.jsxRuntimeExports.jsxs("button",{className:"inline-flex items-center justify-center text-xs font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 underline-offset-4 hover:underline h-9 rounded-md px-3 text-red-500",children:[e.jsxRuntimeExports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",className:"w-4 h-4 mr-2",children:[e.jsxRuntimeExports.jsx("path",{d:"M3 6h18"}),e.jsxRuntimeExports.jsx("path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6"}),e.jsxRuntimeExports.jsx("path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2"})]}),"Remove"]})})]})]},t.providerKey))}),e.jsxRuntimeExports.jsx(H,{onClose:()=>c(null),provider:R})]})]})},C=i.lazy(()=>Promise.resolve().then(()=>require("./Layers-860f5e42.cjs"))),Y=i.lazy(()=>Promise.resolve().then(()=>require("./BrandingOptions-cfa79ffe.cjs"))),_=i.lazy(()=>Promise.resolve().then(()=>require("./ImagesPanel-8b7a989d.cjs")));let S=null;const U=()=>{const s=n.useBuilderProp("sideBarComponents.top",[]),o=n.useBuilderProp("sideBarComponents.bottom",[]),[r,u]=N.useAtom(E.activePanelAtom),[l,d]=i.useState(r),[j,y]=i.useState(null),R={layers:C,"branding-options":Y,images:_};x.each(s,({name:a,panel:f})=>{R[a]=f});const c=a=>{clearTimeout(S),b(!1),r!=="layers"&&a==="layers"?S=setTimeout(()=>d("layers"),500):d(a),u(a)},[,b]=N.useAtom(E.addBlocksModalAtom);return e.jsxRuntimeExports.jsxs("div",{className:"relative flex",children:[e.jsxRuntimeExports.jsxs("div",{className:"z-[100] flex h-full w-fit flex-col items-center justify-between border-b border-r border-border bg-background pt-2",children:[e.jsxRuntimeExports.jsxs("div",{className:"relative z-[100] flex w-14 flex-col items-center space-y-2",children:[e.jsxRuntimeExports.jsx(n.Button,{onClick:()=>{b(!0),u("layers")},size:"sm",variant:r==="add-blocks"?"default":"outline",children:e.jsxRuntimeExports.jsx(k.PlusIcon,{className:"text-xl"})}),e.jsxRuntimeExports.jsx(n.Button,{onClick:()=>c("layers"),size:"sm",variant:r==="layers"?"default":"outline",children:e.jsxRuntimeExports.jsx(w.ListTreeIcon,{className:"w-4"})}),e.jsxRuntimeExports.jsx(n.Button,{onClick:()=>c("branding-options"),size:"sm",variant:r==="branding-options"?"default":"outline",children:e.jsxRuntimeExports.jsx(k.Half2Icon,{className:"w-4 max-w-[40px] text-xs"})}),i.Children.toArray(s.map(({name:a,icon:f})=>e.jsxRuntimeExports.jsx(i.Suspense,{fallback:e.jsxRuntimeExports.jsx(n.Skeleton,{className:"h-10"}),children:e.jsxRuntimeExports.jsx(n.Button,{onClick:()=>c(a),size:"sm",className:"w-10",variant:r===a?"default":"outline",children:e.jsxRuntimeExports.jsx(f,{})})})))]}),e.jsxRuntimeExports.jsx("div",{className:"relative z-[100] flex w-14 flex-col items-center space-y-2",children:i.Children.toArray(o.map(a=>e.jsxRuntimeExports.jsx(i.Suspense,{fallback:e.jsxRuntimeExports.jsx(n.Skeleton,{className:"h-10"}),children:e.jsxRuntimeExports.jsx(a,{})})))})]}),e.jsxRuntimeExports.jsx("div",{onClick:()=>{c("layers")},className:"absolute inset-0 right-0 z-50 w-screen bg-black/20"+(r==="layers"?" hidden":"")}),e.jsxRuntimeExports.jsx("div",{className:`fixed left-14 z-[50] h-full w-96 border-r bg-background duration-500 ease-in-out ${r!=="layers"?"translate-x-0":"-translate-x-full"}`,children:e.jsxRuntimeExports.jsx(i.Suspense,{fallback:e.jsxRuntimeExports.jsxs("div",{className:"flex animate-pulse flex-col gap-y-2 bg-white p-4",children:[e.jsxRuntimeExports.jsx("div",{className:"h-6 w-1/2 bg-gray-300"}),e.jsxRuntimeExports.jsx("div",{className:"h-16 w-full bg-gray-200"}),e.jsxRuntimeExports.jsx("div",{className:"h-16 w-full bg-gray-200"})]}),children:e.jsxRuntimeExports.jsx("div",{className:I.cn("relative h-full max-h-[93%] bg-background p-1",r==="layers"?"":"z-[100]"),onMouseEnter:()=>{j&&clearTimeout(j)},onMouseLeave:()=>{const a=setTimeout(()=>{j&&(c("layers"),clearTimeout(j))},1e3);y(a)},children:i.createElement(x.get(R,l,()=>e.jsxRuntimeExports.jsx("div",{})))})})}),e.jsxRuntimeExports.jsx("div",{className:"h-full w-60 border-r p-1",children:e.jsxRuntimeExports.jsx(i.Suspense,{fallback:e.jsxRuntimeExports.jsxs("div",{className:"flex animate-pulse flex-col gap-y-2 p-4",children:[e.jsxRuntimeExports.jsx("div",{className:"h-6 w-1/2 bg-gray-300"}),e.jsxRuntimeExports.jsx("div",{className:"h-16 w-full bg-gray-200"}),e.jsxRuntimeExports.jsx("div",{className:"h-16 w-full bg-gray-200"})]}),children:e.jsxRuntimeExports.jsxs(h.Tabs,{defaultValue:"layers",className:"flex h-full w-full flex-col py-1",children:[e.jsxRuntimeExports.jsxs(h.TabsList,{className:"mx-1 h-10 grid grid-cols-2",children:[e.jsxRuntimeExports.jsxs(h.TabsTrigger,{value:"layers",children:[e.jsxRuntimeExports.jsx(w.ListTreeIcon,{className:"h-3 mr-2"})," Layers"]}),e.jsxRuntimeExports.jsxs(h.TabsTrigger,{value:"data-provider",children:[e.jsxRuntimeExports.jsx(w.DatabaseIcon,{className:"w-3 mr-2"}),"Data"]})]}),e.jsxRuntimeExports.jsx(h.TabsContent,{value:"layers",className:"no-scrollbar -mx-1 -mr-2 h-full flex-1 overflow-y-auto overflow-x-hidden",children:i.createElement(C)}),e.jsxRuntimeExports.jsx(h.TabsContent,{value:"data-provider",className:"flex-1 overflow-y-auto overflow-x-hidden",children:e.jsxRuntimeExports.jsx(F,{})})]})})})]})};exports.default=U;
|