@chaibuilder/sdk 1.1.18 → 1.2.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-57-vroWk.cjs +1 -0
- package/dist/AddBlocks-QvCc-oag.js +225 -0
- package/dist/BrandingOptions-arKT1zCy.cjs +1 -0
- package/dist/{BrandingOptions-zFJ28xmJ.js → BrandingOptions-mZXO7thQ.js} +27 -25
- package/dist/{CanvasArea-vTV3O27-.js → CanvasArea-59Gm0EZx.js} +581 -598
- package/dist/CanvasArea-jRg53jrS.cjs +59 -0
- package/dist/CurrentPage-MLObvs0K.cjs +1 -0
- package/dist/{CurrentPage-Ay7X9h9y.js → CurrentPage-YPI5QTjk.js} +17 -14
- package/dist/Functions-7jnEwJyw.js +15 -0
- package/dist/Functions-N3yhPYKY.cjs +1 -0
- package/dist/{Layers-CWnzKXMo.js → Layers-no2keK4N.js} +149 -146
- package/dist/Layers-x_mWeT_q.cjs +1 -0
- package/dist/MODIFIERS-2FeVfZQ9.cjs +1 -0
- package/dist/{MODIFIERS-MLfpKQY1.js → MODIFIERS-RiXS5Mn1.js} +7 -13
- package/dist/MarkAsGlobalBlock-S2BhHTsK.cjs +1 -0
- package/dist/{MarkAsGlobalBlock-uhj0kGZo.js → MarkAsGlobalBlock-SPWd6Flk.js} +9 -7
- package/dist/{PagesPanel-ALbBHaO3.js → PagesPanel-Q08uN4X3.js} +12 -9
- package/dist/PagesPanel-pOIuFPOA.cjs +1 -0
- package/dist/ProjectPanel-4bN_GyNm.cjs +1 -0
- package/dist/{ProjectPanel-tIDarI9R.js → ProjectPanel-zzYV9yrV.js} +25 -22
- package/dist/{Settings-5uDMY9SU.js → Settings-28A7R61i.js} +334 -331
- package/dist/Settings-KlTtgu3w.cjs +1 -0
- package/dist/{SidePanels-D6U95ur1.js → SidePanels--ZK6Iqou.js} +80 -77
- package/dist/SidePanels-eJBA_cUu.cjs +1 -0
- package/dist/{Topbar-_-1HX-EE.js → Topbar-ks1ckGLz.js} +15 -13
- package/dist/Topbar-u5XKdWgQ.cjs +1 -0
- package/dist/{UnsplashImages-mqK09h8E.js → UnsplashImages-8vJPuqrF.js} +25 -23
- package/dist/UnsplashImages-V8oKEHfi.cjs +1 -0
- package/dist/{UploadImages-IDkkRuhx.js → UploadImages-6N6UrjLo.js} +26 -24
- package/dist/UploadImages-eHYxwWAp.cjs +1 -0
- package/dist/_commonjsHelpers-UyOWmZb0.js +8 -0
- package/dist/_commonjsHelpers-wDK0ZLPo.cjs +1 -0
- package/dist/{add-page-modal-C1UGoRkw.js → add-page-modal-EHIYTW4T.js} +27 -24
- package/dist/add-page-modal-OvNXLGf0.cjs +1 -0
- package/dist/{confirm-alert-ea5xpncD.js → confirm-alert-biqvaLT-.js} +9 -7
- package/dist/confirm-alert-f3DYO5Hj.cjs +1 -0
- package/dist/controls-Dy1qa8Dc.cjs +1 -0
- package/dist/controls-XPXGHKht.js +182 -0
- package/dist/core.cjs +1 -1
- package/dist/core.d.ts +10 -1
- package/dist/core.js +60 -57
- package/dist/delete-page-modal-U4yiuhx0.cjs +1 -0
- package/dist/{delete-page-modal-0GxR128b.js → delete-page-modal-qZJCk_JH.js} +15 -12
- package/dist/email-blocks.cjs +1 -0
- package/dist/email-blocks.d.ts +3 -0
- package/dist/email-blocks.js +35 -0
- package/dist/{form-irY39wvJ.js → form-Moz_psOw.js} +16 -16
- package/dist/form-lJhy9DEC.cjs +1 -0
- package/dist/functions-Ox_svtKm.cjs +1 -0
- package/dist/functions-xIebp8Aw.js +23 -0
- package/dist/html-to-json-dfALTAdG.cjs +1 -0
- package/dist/{html-to-json-wmbV9eZP.js → html-to-json-xKBERAI1.js} +47 -46
- package/dist/index-IIJ_o44s.cjs +1 -0
- package/dist/{index-qEix1meh.js → index-QEchoZ98.js} +8 -8
- package/dist/{index-0OqmBgqo.js → index-_OgCuSUz.js} +528 -533
- package/dist/{index-npVo1wi3.cjs → index-hMoPNZVn.cjs} +2 -2
- package/dist/{jsx-runtime-NV737rRe.js → jsx-runtime-WbnYoNE9.js} +1 -1
- package/dist/{jsx-runtime-WUGKV8jN.cjs → jsx-runtime-Z_BpKhVy.cjs} +7 -7
- package/dist/lib.cjs +2 -2
- package/dist/lib.d.ts +1 -1
- package/dist/lib.js +47 -44
- package/dist/page-viewer-WhM1FSU0.cjs +1 -0
- package/dist/{page-viewer-mgnZt6nO.js → page-viewer-zFLkUu2I.js} +17 -14
- package/dist/{project-general-setting-M52W-vUp.js → project-general-setting-MWGOOurD.js} +16 -13
- package/dist/project-general-setting-y8daY7V9.cjs +1 -0
- package/dist/project-seo-setting-9JGBPzcA.cjs +1 -0
- package/dist/{project-seo-setting-EhqUcTKy.js → project-seo-setting-dXclexQW.js} +15 -13
- package/dist/render.cjs +1 -1
- package/dist/render.d.ts +1 -1
- package/dist/render.js +50 -49
- package/dist/server.cjs +1 -1
- package/dist/server.d.ts +1 -1
- package/dist/server.js +11 -11
- package/dist/single-page-detail--xPv74bX.cjs +1 -0
- package/dist/{single-page-detail-61UDUgWG.js → single-page-detail-C48IPzbd.js} +77 -74
- package/dist/studio.cjs +1 -1
- package/dist/studio.js +11 -8
- package/dist/ui.cjs +1 -1
- package/dist/ui.d.ts +3 -3
- package/dist/ui.js +144 -142
- package/dist/useAddBlockByDrop-_nd8yZBa.cjs +1 -0
- package/dist/useAddBlockByDrop-uPXvrg4G.js +20 -0
- package/dist/{utils-XsPKXMVo.js → utils-AvyFzbPC.js} +26 -35
- package/dist/utils-PTxFk6qT.cjs +1 -0
- package/dist/web-blocks.cjs +9 -0
- package/dist/web-blocks.d.ts +3 -0
- package/dist/web-blocks.js +1033 -0
- package/package.json +5 -2
- package/dist/AddBlocks-sKF4ti68.js +0 -222
- package/dist/AddBlocks-yPovJXtD.cjs +0 -1
- package/dist/BrandingOptions-TRVyCvVq.cjs +0 -1
- package/dist/CanvasArea-xxqOiENt.cjs +0 -59
- package/dist/CurrentPage-ju6otPNk.cjs +0 -1
- package/dist/Layers-d9OU0HRE.cjs +0 -1
- package/dist/MODIFIERS-WFzDQfiT.cjs +0 -1
- package/dist/MarkAsGlobalBlock-CDmEHNx7.cjs +0 -1
- package/dist/PagesPanel-F9Cdi4Pf.cjs +0 -1
- package/dist/ProjectPanel-T49RUDyt.cjs +0 -1
- package/dist/Settings-eZnusNbR.cjs +0 -1
- package/dist/SidePanels-BVM5JwGC.cjs +0 -1
- package/dist/Topbar-gQxbcPtG.cjs +0 -1
- package/dist/UnsplashImages-PNp5fYCc.cjs +0 -1
- package/dist/UploadImages-BoSSsLtD.cjs +0 -1
- package/dist/add-page-modal-HP1yv9yJ.cjs +0 -1
- package/dist/confirm-alert-dHRDZrA1.cjs +0 -1
- package/dist/controls-QnyBNkXG.cjs +0 -36
- package/dist/controls-kEuiMMDf.js +0 -4600
- package/dist/delete-page-modal-yOgfPcHr.cjs +0 -1
- package/dist/form-6qGAOYI3.cjs +0 -1
- package/dist/functions-86L6n983.js +0 -23
- package/dist/functions-Jr7gX_RX.cjs +0 -1
- package/dist/html-to-json-AqLy6ye-.cjs +0 -1
- package/dist/index-d55M5MRz.cjs +0 -1
- package/dist/lodash-2us0VT8I.cjs +0 -36
- package/dist/lodash-3gkdNK5u.js +0 -4538
- package/dist/page-viewer-G2YIKVSt.cjs +0 -1
- package/dist/project-general-setting-sinIiBKe.cjs +0 -1
- package/dist/project-seo-setting-N0OnBCvh.cjs +0 -1
- package/dist/single-page-detail-oa-yTXhQ.cjs +0 -1
- package/dist/useAddBlockByDrop-5QW86HjG.js +0 -20
- package/dist/useAddBlockByDrop-Ckzuvu-s.cjs +0 -1
- package/dist/utils-37UXq2O5.cjs +0 -1
|
@@ -1,22 +1,23 @@
|
|
|
1
|
-
import { j as e } from "./jsx-runtime-
|
|
1
|
+
import { j as e } from "./jsx-runtime-WbnYoNE9.js";
|
|
2
2
|
import * as ne from "react";
|
|
3
|
-
import $, { useState as j, useMemo as _, useEffect as M, useCallback as B, memo as ct, createContext as Oe, useContext as
|
|
4
|
-
import { useThrottledCallback as
|
|
5
|
-
import {
|
|
3
|
+
import $, { useState as j, useMemo as _, useEffect as M, useCallback as B, memo as ct, createContext as Oe, useContext as se } from "react";
|
|
4
|
+
import { useThrottledCallback as fe } from "@react-hookz/web";
|
|
5
|
+
import { forEach as ke, isArray as ie, omit as pt, truncate as ut, includes as A, get as g, first as ue, split as gt, startCase as Y, toLower as le, isEmpty as m, map as C, find as xt, last as ve, filter as we, set as Me, keys as yt, cloneDeep as ht, each as bt, capitalize as mt, reject as ft, nth as Ve, startsWith as W, isNumber as vt, parseInt as wt, isNaN as ze, findLast as jt, flatten as U, intersection as Ye, has as he, isNull as Ct } from "lodash-es";
|
|
6
6
|
import { useTranslation as K } from "react-i18next";
|
|
7
|
-
import { PlusIcon as Ne, Cross2Icon as
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import { Check as
|
|
11
|
-
import { getBlockComponent as tt, getChaiDataProviders as
|
|
12
|
-
import { E as rt, u as
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
import { useAtom as
|
|
16
|
-
import
|
|
17
|
-
import
|
|
18
|
-
import { A as
|
|
19
|
-
import { a as
|
|
7
|
+
import { PlusIcon as Ne, Cross2Icon as Fe, EyeOpenIcon as kt, EyeClosedIcon as He, BorderAllIcon as P, WidthIcon as T, HeightIcon as R, ArrowUpIcon as Q, ArrowRightIcon as ee, ArrowDownIcon as te, ArrowLeftIcon as re, ArrowTopLeftIcon as Nt, ArrowTopRightIcon as _t, ArrowBottomRightIcon as St, ArrowBottomLeftIcon as Tt, AlignLeftIcon as Rt, AlignCenterHorizontallyIcon as Vt, AlignRightIcon as Ht, StretchHorizontallyIcon as Bt, FontItalicIcon as Dt, UnderlineIcon as $t, OverlineIcon as It, LetterCaseUppercaseIcon as Pt, Cross1Icon as At, InfoCircledIcon as _e, MinusIcon as Lt, BoxIcon as Xe, RowSpacingIcon as Et, TriangleDownIcon as Ot, CrossCircledIcon as Mt, TrashIcon as zt, MixerHorizontalIcon as Ze } from "@radix-ui/react-icons";
|
|
8
|
+
import { a$ as Yt, b0 as Ft, B as ge, b1 as Xt, b2 as Zt, b3 as Wt, b4 as Ut, b5 as Kt, b6 as qt, b7 as Gt, a6 as q, am as Jt, an as Qt, ao as er, b8 as tr, ak as rr, b9 as lr, al as sr, aC as F, aD as X, aF as Z, ba as or, bb as ar, bc as nr, bd as ir, be as dr, bf as cr, p as We, ac as Ue, i as pr, bg as Ke, bh as de, bi as ce, bj as pe, aj as Se, P as qe, a3 as Ge, j as Je, aH as Te, bk as ur, bl as gr, a4 as xe, W as xr, a9 as Qe, R as Be, ag as yr, ad as hr, bm as br, aq as mr, ar as fr, as as vr, at as wr, au as V, bn as et, aw as jr, ax as Cr, ay as De, az as $e } from "./index-_OgCuSUz.js";
|
|
9
|
+
import { u as kr } from "./controls-XPXGHKht.js";
|
|
10
|
+
import { Check as Nr, EditIcon as _r, TrashIcon as Sr } from "lucide-react";
|
|
11
|
+
import { getBlockComponent as tt, getChaiDataProviders as Tr } from "@chaibuilder/runtime";
|
|
12
|
+
import { E as rt, u as lt } from "./index-QEchoZ98.js";
|
|
13
|
+
import Rr from "@rjsf/core";
|
|
14
|
+
import Vr from "@rjsf/validator-ajv8";
|
|
15
|
+
import { useAtom as Hr } from "jotai";
|
|
16
|
+
import Br from "react-autosuggest";
|
|
17
|
+
import Dr from "fuse.js";
|
|
18
|
+
import { A as $r, C as ye, g as Ir } from "./utils-AvyFzbPC.js";
|
|
19
|
+
import { a as Pr } from "./MODIFIERS-RiXS5Mn1.js";
|
|
20
|
+
import "./_commonjsHelpers-UyOWmZb0.js";
|
|
20
21
|
import "@radix-ui/react-toggle";
|
|
21
22
|
import "class-variance-authority";
|
|
22
23
|
import "@radix-ui/react-switch";
|
|
@@ -41,9 +42,11 @@ import "react-icons-picker";
|
|
|
41
42
|
import "react-dom";
|
|
42
43
|
import "react-quill";
|
|
43
44
|
import "flat-to-nested";
|
|
45
|
+
import "./Functions-7jnEwJyw.js";
|
|
46
|
+
import "clsx";
|
|
47
|
+
import "tailwind-merge";
|
|
44
48
|
import "redux-undo";
|
|
45
49
|
import "i18next";
|
|
46
|
-
import "clsx";
|
|
47
50
|
import "@floating-ui/react-dom";
|
|
48
51
|
import "react-textarea-autosize";
|
|
49
52
|
import "flagged";
|
|
@@ -51,28 +54,28 @@ import "react-dnd";
|
|
|
51
54
|
import "@minoru/react-dnd-treeview";
|
|
52
55
|
import "react-hotkeys-hook";
|
|
53
56
|
import "sonner";
|
|
54
|
-
import "./html-to-json-
|
|
57
|
+
import "./html-to-json-xKBERAI1.js";
|
|
55
58
|
import "himalaya";
|
|
56
|
-
import "
|
|
57
|
-
const
|
|
58
|
-
function
|
|
59
|
-
const
|
|
60
|
-
function o(
|
|
61
|
-
|
|
62
|
-
const i =
|
|
63
|
-
|
|
59
|
+
import "lodash";
|
|
60
|
+
const Ar = $.lazy(() => import("react-json-view"));
|
|
61
|
+
function Lr(r) {
|
|
62
|
+
const s = [], t = {};
|
|
63
|
+
function o(l, d) {
|
|
64
|
+
ke(d, (a, c) => {
|
|
65
|
+
const i = l ? `${l}.${c}` : c, p = ie(a) ? "list" : typeof a;
|
|
66
|
+
s.push(i), t[i] = p === "string" ? "text" : p === "object" ? "model" : p, p === "object" && !ie(a) && o(i, a);
|
|
64
67
|
});
|
|
65
68
|
}
|
|
66
|
-
return o("", pt(r, ["styles", "_type", "_id", "_name", "_bindings"])), { paths:
|
|
69
|
+
return o("", pt(r, ["styles", "_type", "_id", "_name", "_bindings"])), { paths: s, pathsType: t };
|
|
67
70
|
}
|
|
68
|
-
const
|
|
71
|
+
const je = ({ data: r, fullView: s }) => {
|
|
69
72
|
if (!r)
|
|
70
73
|
return null;
|
|
71
74
|
const t = typeof r;
|
|
72
|
-
return
|
|
75
|
+
return s ? typeof r == "object" ? /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
73
76
|
/* @__PURE__ */ e.jsx("div", { className: "h-3" }),
|
|
74
77
|
/* @__PURE__ */ e.jsx(rt, { children: /* @__PURE__ */ e.jsx(
|
|
75
|
-
|
|
78
|
+
Ar,
|
|
76
79
|
{
|
|
77
80
|
style: { maxHeight: "40vh", overflowY: "auto" },
|
|
78
81
|
name: "Content",
|
|
@@ -89,46 +92,46 @@ const Ce = ({ data: r, fullView: l }) => {
|
|
|
89
92
|
] }) : /* @__PURE__ */ e.jsx("div", { className: "text-[10px] text-gray-800/50 leading-3 whitespace-nowrap overflow-hidden w-full", children: ut(t === "object" ? JSON.stringify(r) : r, { length: 40 }) });
|
|
90
93
|
}, Ie = ({
|
|
91
94
|
type: r,
|
|
92
|
-
value:
|
|
95
|
+
value: s = "",
|
|
93
96
|
setValue: t,
|
|
94
97
|
data: o,
|
|
95
|
-
onChange:
|
|
98
|
+
onChange: l,
|
|
96
99
|
dataType: d,
|
|
97
100
|
appliedBindings: a
|
|
98
101
|
}) => {
|
|
99
|
-
const { paths: c, pathsType: i } =
|
|
100
|
-
(u) => !A(a, u) && g(p, `props.${
|
|
102
|
+
const { paths: c, pathsType: i } = Lr(o), p = r === "PROP" ? tt(o == null ? void 0 : o._type) : {}, h = r === "PROP", [n, y] = j(!1), x = _(() => r === "PROP" ? c.filter(
|
|
103
|
+
(u) => !A(a, u) && g(p, `props.${ue(gt(u, "."))}.binding`)
|
|
101
104
|
) : c.filter((u) => d === g(i, u, "")), [r, c, a, d, p]);
|
|
102
105
|
return M(() => {
|
|
103
|
-
|
|
104
|
-
}, [
|
|
106
|
+
s && l(s);
|
|
107
|
+
}, [s, r]), /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
105
108
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-4", children: [
|
|
106
|
-
/* @__PURE__ */ e.jsx("p", { className: "text-sm text-muted-foreground", children: Y(
|
|
107
|
-
/* @__PURE__ */ e.jsxs(
|
|
108
|
-
/* @__PURE__ */ e.jsx(
|
|
109
|
-
|
|
109
|
+
/* @__PURE__ */ e.jsx("p", { className: "text-sm text-muted-foreground", children: Y(le(r)) }),
|
|
110
|
+
/* @__PURE__ */ e.jsxs(Yt, { open: n, onOpenChange: y, children: [
|
|
111
|
+
/* @__PURE__ */ e.jsx(Ft, { asChild: !0, children: /* @__PURE__ */ e.jsx(
|
|
112
|
+
ge,
|
|
110
113
|
{
|
|
111
114
|
variant: "outline",
|
|
112
115
|
size: "sm",
|
|
113
|
-
className: ` ${m(
|
|
114
|
-
children:
|
|
116
|
+
className: ` ${m(s) ? "bg-blue-500 text-gray-100 hover:bg-blue-400 hover:text-white w-44 justify-center" : "min-w-[350px] justify-between items-center"}`,
|
|
117
|
+
children: s ? /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
115
118
|
/* @__PURE__ */ e.jsxs("span", { className: "text-sm pr-8", children: [
|
|
116
119
|
h && /* @__PURE__ */ e.jsx("span", { className: "text-[10px] text-purple-500 bg-purple-100 px-2 py-0.5 mr-2 rounded-full", children: Y(d) }),
|
|
117
|
-
|
|
120
|
+
s
|
|
118
121
|
] }),
|
|
119
122
|
/* @__PURE__ */ e.jsx("span", { className: "text-[9px] text-blue-400 underline cursor-pointer hover:text-blue-700", children: "Change" })
|
|
120
123
|
] }) : /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
121
124
|
"+ Set ",
|
|
122
|
-
Y(
|
|
125
|
+
Y(le(r))
|
|
123
126
|
] })
|
|
124
127
|
}
|
|
125
128
|
) }),
|
|
126
|
-
/* @__PURE__ */ e.jsx(Xt, { className: "p-0 z-[999] min-w-[300px]", side: "right", align: "start", children: /* @__PURE__ */ e.jsxs(
|
|
127
|
-
/* @__PURE__ */ e.jsx(
|
|
128
|
-
/* @__PURE__ */ e.jsxs(
|
|
129
|
-
/* @__PURE__ */ e.jsx(
|
|
130
|
-
/* @__PURE__ */ e.jsx(
|
|
131
|
-
|
|
129
|
+
/* @__PURE__ */ e.jsx(Xt, { className: "p-0 z-[999] min-w-[300px]", side: "right", align: "start", children: /* @__PURE__ */ e.jsxs(Zt, { children: [
|
|
130
|
+
/* @__PURE__ */ e.jsx(Wt, { placeholder: `Choose ${le(r)}...` }),
|
|
131
|
+
/* @__PURE__ */ e.jsxs(Ut, { children: [
|
|
132
|
+
/* @__PURE__ */ e.jsx(Kt, { children: "No results found." }),
|
|
133
|
+
/* @__PURE__ */ e.jsx(qt, { children: C(x, (u) => /* @__PURE__ */ e.jsxs(
|
|
134
|
+
Gt,
|
|
132
135
|
{
|
|
133
136
|
value: u,
|
|
134
137
|
className: `cursor-pointer ${h ? "flex justify-between items-center" : "flex flex-col items-start justify-start"}`,
|
|
@@ -137,10 +140,10 @@ const Ce = ({ data: r, fullView: l }) => {
|
|
|
137
140
|
},
|
|
138
141
|
children: [
|
|
139
142
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-x-2", children: [
|
|
140
|
-
/* @__PURE__ */ e.jsx(
|
|
143
|
+
/* @__PURE__ */ e.jsx(Nr, { className: `w-4 h-4 text-green-500 ${s === u ? "" : "opacity-0"}` }),
|
|
141
144
|
u
|
|
142
145
|
] }),
|
|
143
|
-
h ? /* @__PURE__ */ e.jsx("div", { children: /* @__PURE__ */ e.jsx("span", { className: "text-[10px] text-purple-500 bg-purple-100 px-2 py-0.5 rounded-full", children: Y(g(i, u, "")) }) }) : /* @__PURE__ */ e.jsx("div", { className: "pl-6", children: /* @__PURE__ */ e.jsx(
|
|
146
|
+
h ? /* @__PURE__ */ e.jsx("div", { children: /* @__PURE__ */ e.jsx("span", { className: "text-[10px] text-purple-500 bg-purple-100 px-2 py-0.5 rounded-full", children: Y(g(i, u, "")) }) }) : /* @__PURE__ */ e.jsx("div", { className: "pl-6", children: /* @__PURE__ */ e.jsx(je, { data: g(o, u) }) })
|
|
144
147
|
]
|
|
145
148
|
},
|
|
146
149
|
u
|
|
@@ -149,15 +152,15 @@ const Ce = ({ data: r, fullView: l }) => {
|
|
|
149
152
|
] }) })
|
|
150
153
|
] })
|
|
151
154
|
] }),
|
|
152
|
-
!h && !m(
|
|
155
|
+
!h && !m(s) && /* @__PURE__ */ e.jsx("div", { className: "pt-2", children: /* @__PURE__ */ e.jsx(je, { data: g(o, s, ""), fullView: !0 }) })
|
|
153
156
|
] });
|
|
154
|
-
},
|
|
157
|
+
}, Er = ({
|
|
155
158
|
appliedBindings: r = [],
|
|
156
|
-
onAddBinding:
|
|
159
|
+
onAddBinding: s,
|
|
157
160
|
editMode: t,
|
|
158
161
|
item: o
|
|
159
162
|
}) => {
|
|
160
|
-
const [
|
|
163
|
+
const [l, d] = j(t ? o.key : ""), [a, c] = j(t ? o.value : ""), i = q(), [p] = lt(), h = B(
|
|
161
164
|
(x, u) => {
|
|
162
165
|
if (m(x))
|
|
163
166
|
return "";
|
|
@@ -172,9 +175,9 @@ const Ce = ({ data: r, fullView: l }) => {
|
|
|
172
175
|
[i, p]
|
|
173
176
|
), [n, y] = j(t ? h(o.key, "PROP") : "");
|
|
174
177
|
return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
175
|
-
/* @__PURE__ */ e.jsxs(
|
|
176
|
-
/* @__PURE__ */ e.jsx(
|
|
177
|
-
/* @__PURE__ */ e.jsx(
|
|
178
|
+
/* @__PURE__ */ e.jsxs(Jt, { children: [
|
|
179
|
+
/* @__PURE__ */ e.jsx(Qt, { children: "Add Data Binding" }),
|
|
180
|
+
/* @__PURE__ */ e.jsx(er, { className: "text-xs", children: "Add prop and path of binding. Click save when you're done." })
|
|
178
181
|
] }),
|
|
179
182
|
/* @__PURE__ */ e.jsxs("div", { className: "flex flex-col gap-1 relative", children: [
|
|
180
183
|
/* @__PURE__ */ e.jsx(
|
|
@@ -183,7 +186,7 @@ const Ce = ({ data: r, fullView: l }) => {
|
|
|
183
186
|
type: "PROP",
|
|
184
187
|
isDisabled: !1,
|
|
185
188
|
placeholder: "Enter prop key",
|
|
186
|
-
value:
|
|
189
|
+
value: l,
|
|
187
190
|
setValue: d,
|
|
188
191
|
onChange: (x) => {
|
|
189
192
|
const u = h(x, "PROP");
|
|
@@ -199,7 +202,7 @@ const Ce = ({ data: r, fullView: l }) => {
|
|
|
199
202
|
Ie,
|
|
200
203
|
{
|
|
201
204
|
type: "PATH",
|
|
202
|
-
isDisabled: m(
|
|
205
|
+
isDisabled: m(l),
|
|
203
206
|
placeholder: "Enter data path",
|
|
204
207
|
value: a,
|
|
205
208
|
setValue: c,
|
|
@@ -213,26 +216,26 @@ const Ce = ({ data: r, fullView: l }) => {
|
|
|
213
216
|
}
|
|
214
217
|
)
|
|
215
218
|
] }),
|
|
216
|
-
/* @__PURE__ */ e.jsx(
|
|
217
|
-
|
|
219
|
+
/* @__PURE__ */ e.jsx(tr, { children: /* @__PURE__ */ e.jsx(
|
|
220
|
+
ge,
|
|
218
221
|
{
|
|
219
222
|
type: "submit",
|
|
220
223
|
className: "mt-4",
|
|
221
|
-
disabled: m(
|
|
222
|
-
onClick: () =>
|
|
224
|
+
disabled: m(l) && m(a),
|
|
225
|
+
onClick: () => s({ key: l, value: a }),
|
|
223
226
|
children: "Save"
|
|
224
227
|
}
|
|
225
228
|
) })
|
|
226
229
|
] });
|
|
227
|
-
},
|
|
230
|
+
}, st = ({ disabled: r, children: s, onAddBinding: t, appliedBindings: o, editMode: l = !0, item: d = {} }) => {
|
|
228
231
|
const [a, c] = j(!1);
|
|
229
|
-
return /* @__PURE__ */ e.jsxs(
|
|
230
|
-
/* @__PURE__ */ e.jsx(
|
|
232
|
+
return /* @__PURE__ */ e.jsxs(rr, { children: [
|
|
233
|
+
/* @__PURE__ */ e.jsx(lr, { disabled: r, asChild: !0, onClick: () => c(!0), children: s }),
|
|
231
234
|
a && /* @__PURE__ */ e.jsx(sr, { children: /* @__PURE__ */ e.jsx(
|
|
232
|
-
|
|
235
|
+
Er,
|
|
233
236
|
{
|
|
234
237
|
item: d,
|
|
235
|
-
editMode:
|
|
238
|
+
editMode: l,
|
|
236
239
|
appliedBindings: o,
|
|
237
240
|
onAddBinding: (i) => {
|
|
238
241
|
t(i), c(!1);
|
|
@@ -240,19 +243,19 @@ const Ce = ({ data: r, fullView: l }) => {
|
|
|
240
243
|
}
|
|
241
244
|
) })
|
|
242
245
|
] });
|
|
243
|
-
},
|
|
246
|
+
}, Or = ({
|
|
244
247
|
item: r,
|
|
245
|
-
onAddBinding:
|
|
248
|
+
onAddBinding: s,
|
|
246
249
|
onRemove: t,
|
|
247
250
|
selectedBlock: o,
|
|
248
|
-
dataProvider:
|
|
251
|
+
dataProvider: l,
|
|
249
252
|
appliedBindings: d
|
|
250
253
|
}) => {
|
|
251
254
|
const [a, c] = j("string"), i = (p, h) => {
|
|
252
255
|
if (m(p))
|
|
253
256
|
return "";
|
|
254
257
|
{
|
|
255
|
-
const n = g(h === "PROP" ? o :
|
|
258
|
+
const n = g(h === "PROP" ? o : l, p, "");
|
|
256
259
|
if (ie(n))
|
|
257
260
|
return "list";
|
|
258
261
|
const y = typeof n;
|
|
@@ -262,11 +265,11 @@ const Ce = ({ data: r, fullView: l }) => {
|
|
|
262
265
|
return M(() => c(() => i(r.key, "PROP")), [r.key]), /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col border border-gray-200 relative rounded-md p-2", children: [
|
|
263
266
|
/* @__PURE__ */ e.jsx("div", { className: "text-gray-500 font-normal text-sm", children: r.key }),
|
|
264
267
|
/* @__PURE__ */ e.jsx("div", { className: "font-medium leading-5", children: r.value }),
|
|
265
|
-
/* @__PURE__ */ e.jsx(
|
|
268
|
+
/* @__PURE__ */ e.jsx(je, { data: g(l, r.value, "") }),
|
|
266
269
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center justify-end gap-x-2", children: [
|
|
267
|
-
/* @__PURE__ */ e.jsx(
|
|
270
|
+
/* @__PURE__ */ e.jsx(st, { editMode: !0, onAddBinding: s, appliedBindings: d, item: r, children: /* @__PURE__ */ e.jsx(_r, { className: "h-6 w-6 mt-1 cursor-pointer rounded border hover:bg-blue-400 hover:text-white border-blue-400 p-1 text-blue-400 hover:scale-105 duration-200" }) }),
|
|
268
271
|
/* @__PURE__ */ e.jsx(
|
|
269
|
-
|
|
272
|
+
Sr,
|
|
270
273
|
{
|
|
271
274
|
onClick: () => t(),
|
|
272
275
|
className: "h-6 w-6 mt-1 cursor-pointer rounded border hover:bg-red-400 hover:text-white border-red-400 p-1 text-red-400 hover:scale-105 duration-200"
|
|
@@ -275,8 +278,8 @@ const Ce = ({ data: r, fullView: l }) => {
|
|
|
275
278
|
] }),
|
|
276
279
|
!m(a) && !m(r.key) && /* @__PURE__ */ e.jsx("div", { className: "mt-px absolute right-0 top-1 text-purple-600 text-[10px] flex items-center font-medium h-4 px-2 rounded-full", children: Y(a) })
|
|
277
280
|
] });
|
|
278
|
-
},
|
|
279
|
-
const t = q(), [o] =
|
|
281
|
+
}, Mr = ({ bindingData: r, onChange: s }) => {
|
|
282
|
+
const t = q(), [o] = lt(), l = Tr(), [d, a] = j(
|
|
280
283
|
C(r, (n, y) => ({ key: y, value: n }))
|
|
281
284
|
);
|
|
282
285
|
M(() => {
|
|
@@ -287,34 +290,34 @@ const Ce = ({ data: r, fullView: l }) => {
|
|
|
287
290
|
return !0;
|
|
288
291
|
if (m(d))
|
|
289
292
|
return !1;
|
|
290
|
-
const n =
|
|
293
|
+
const n = ve(d);
|
|
291
294
|
return m(n == null ? void 0 : n.key) || m(n == null ? void 0 : n.value);
|
|
292
295
|
}, [o, d]), i = (n) => {
|
|
293
|
-
const y =
|
|
296
|
+
const y = we(d, (x) => x.key !== n.key);
|
|
294
297
|
a([...y, n]), h([...y, n]);
|
|
295
298
|
}, p = (n) => {
|
|
296
|
-
const y =
|
|
299
|
+
const y = we(d, (x, u) => n !== u);
|
|
297
300
|
h([...y]);
|
|
298
301
|
}, h = B(
|
|
299
302
|
(n = []) => {
|
|
300
303
|
if (a(n), m(n)) {
|
|
301
|
-
|
|
304
|
+
s({});
|
|
302
305
|
return;
|
|
303
306
|
}
|
|
304
307
|
const y = {};
|
|
305
|
-
|
|
308
|
+
ke(n, (x) => {
|
|
306
309
|
!m(x == null ? void 0 : x.key) && !m(x == null ? void 0 : x.value) && Me(y, x.key, x.value);
|
|
307
|
-
}),
|
|
310
|
+
}), s(y);
|
|
308
311
|
},
|
|
309
|
-
[
|
|
312
|
+
[s]
|
|
310
313
|
);
|
|
311
|
-
return m(
|
|
314
|
+
return m(l) ? /* @__PURE__ */ e.jsx("div", { className: "w-full flex items-center justify-center", children: /* @__PURE__ */ e.jsxs("p", { className: "text-gray-500 mb-1.5 text-xs", children: [
|
|
312
315
|
"You have no data providers registered. Please add a data provider to your project. ",
|
|
313
316
|
/* @__PURE__ */ e.jsx("br", {}),
|
|
314
317
|
/* @__PURE__ */ e.jsx("a", { className: "text-blue-500", href: "https://chaibuilder.com/docs/registering-data-providers", target: "_blank", children: "Learn more" })
|
|
315
318
|
] }) }) : /* @__PURE__ */ e.jsxs("div", { className: "space-y-2", children: [
|
|
316
319
|
C(d, (n, y) => /* @__PURE__ */ e.jsx(
|
|
317
|
-
|
|
320
|
+
Or,
|
|
318
321
|
{
|
|
319
322
|
item: n,
|
|
320
323
|
onAddBinding: i,
|
|
@@ -325,9 +328,9 @@ const Ce = ({ data: r, fullView: l }) => {
|
|
|
325
328
|
},
|
|
326
329
|
n.key
|
|
327
330
|
)),
|
|
328
|
-
/* @__PURE__ */ e.jsxs(
|
|
329
|
-
/* @__PURE__ */ e.jsx(
|
|
330
|
-
|
|
331
|
+
/* @__PURE__ */ e.jsxs(F, { delayDuration: 200, children: [
|
|
332
|
+
/* @__PURE__ */ e.jsx(X, { className: "w-full", children: /* @__PURE__ */ e.jsx(
|
|
333
|
+
st,
|
|
331
334
|
{
|
|
332
335
|
disabled: c,
|
|
333
336
|
appliedBindings: C(d, "key"),
|
|
@@ -344,60 +347,60 @@ const Ce = ({ data: r, fullView: l }) => {
|
|
|
344
347
|
c && /* @__PURE__ */ e.jsx(Z, { sideOffset: -55, className: "text-[11px]", children: m(o) ? "No data provider has been set up for this page." : "Complete last added data binding to add more" })
|
|
345
348
|
] })
|
|
346
349
|
] });
|
|
347
|
-
},
|
|
348
|
-
const
|
|
349
|
-
return Object.keys(
|
|
350
|
-
const c =
|
|
350
|
+
}, zr = () => /* @__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" }), be = ct(({ createHistorySnapshot: r, properties: s, formData: t, onChange: o }) => {
|
|
351
|
+
const l = { type: "object", properties: {} }, d = {};
|
|
352
|
+
return Object.keys(s).forEach((a) => {
|
|
353
|
+
const c = s[a];
|
|
351
354
|
if (A(["slot", "styles"], c.type))
|
|
352
355
|
return;
|
|
353
356
|
const i = a;
|
|
354
|
-
|
|
357
|
+
l.properties[i] = or(c), d[i] = ar(c);
|
|
355
358
|
}), /* @__PURE__ */ e.jsx(
|
|
356
|
-
|
|
359
|
+
Rr,
|
|
357
360
|
{
|
|
358
361
|
widgets: {
|
|
359
|
-
binding:
|
|
360
|
-
richtext:
|
|
361
|
-
icon:
|
|
362
|
-
image:
|
|
362
|
+
binding: zr,
|
|
363
|
+
richtext: nr,
|
|
364
|
+
icon: ir,
|
|
365
|
+
image: dr
|
|
363
366
|
},
|
|
364
|
-
fields: { link:
|
|
367
|
+
fields: { link: cr },
|
|
365
368
|
idSeparator: ".",
|
|
366
369
|
autoComplete: "off",
|
|
367
370
|
omitExtraData: !1,
|
|
368
371
|
liveOmit: !1,
|
|
369
|
-
liveValidate: !
|
|
370
|
-
validator:
|
|
372
|
+
liveValidate: !1,
|
|
373
|
+
validator: Vr,
|
|
371
374
|
uiSchema: d,
|
|
372
375
|
onBlur: r,
|
|
373
|
-
schema:
|
|
376
|
+
schema: l,
|
|
374
377
|
formData: t,
|
|
375
378
|
onChange: o
|
|
376
379
|
}
|
|
377
380
|
);
|
|
378
381
|
});
|
|
379
|
-
function
|
|
380
|
-
const r = q(), { createSnapshot:
|
|
382
|
+
function Yr() {
|
|
383
|
+
const r = q(), { createSnapshot: s } = We(), t = Ue(), o = tt(r._type), l = { ...r }, d = pr("dataBindingSupport", !1), a = () => s(), c = ({ formData: n }, y) => {
|
|
381
384
|
if (y) {
|
|
382
385
|
const x = y.replace("root.", "");
|
|
383
386
|
t([r._id], { [x]: g(n, x) });
|
|
384
387
|
}
|
|
385
388
|
}, i = {
|
|
386
|
-
_name:
|
|
389
|
+
_name: kr({
|
|
387
390
|
title: "Name",
|
|
388
391
|
default: g(r, "_name", r._type)
|
|
389
392
|
})
|
|
390
|
-
}, p = yt(g(
|
|
393
|
+
}, p = yt(g(l, "_bindings", {})), h = _(() => {
|
|
391
394
|
const n = ht(g(o, "props", {}));
|
|
392
|
-
return d &&
|
|
395
|
+
return d && bt(p, (y) => delete n[y]), n;
|
|
393
396
|
}, [o, p, d]);
|
|
394
397
|
return /* @__PURE__ */ e.jsxs("div", { className: "overflow-x-hidden", children: [
|
|
395
398
|
/* @__PURE__ */ e.jsx(
|
|
396
|
-
|
|
399
|
+
be,
|
|
397
400
|
{
|
|
398
401
|
onChange: c,
|
|
399
402
|
createHistorySnapshot: a,
|
|
400
|
-
formData:
|
|
403
|
+
formData: l,
|
|
401
404
|
properties: i
|
|
402
405
|
}
|
|
403
406
|
),
|
|
@@ -414,11 +417,11 @@ function zr() {
|
|
|
414
417
|
"Data Binding"
|
|
415
418
|
] }) }),
|
|
416
419
|
/* @__PURE__ */ e.jsx(pe, { className: "pt-4 px-4", children: /* @__PURE__ */ e.jsx(
|
|
417
|
-
|
|
420
|
+
Mr,
|
|
418
421
|
{
|
|
419
|
-
bindingData: g(
|
|
422
|
+
bindingData: g(l, "_bindings", {}),
|
|
420
423
|
onChange: (n) => {
|
|
421
|
-
c({ formData: { ...
|
|
424
|
+
c({ formData: { ...l, _bindings: n } }, "root._bindings");
|
|
422
425
|
}
|
|
423
426
|
}
|
|
424
427
|
) })
|
|
@@ -429,47 +432,47 @@ function zr() {
|
|
|
429
432
|
"Static Content"
|
|
430
433
|
] }) }),
|
|
431
434
|
/* @__PURE__ */ e.jsxs(pe, { className: "pt-4", children: [
|
|
432
|
-
m(p) ?
|
|
435
|
+
m(p) ? null : /* @__PURE__ */ e.jsxs("div", { className: "text-xs mx-4 border rounded-sm p-1 mb-1 mt-0 border-orange-500 text-orange-500 bg-orange-100", children: [
|
|
433
436
|
"Data binding is set for ",
|
|
434
|
-
/* @__PURE__ */ e.jsx("b", { children: C(p,
|
|
437
|
+
/* @__PURE__ */ e.jsx("b", { children: C(p, mt).join(", ") }),
|
|
435
438
|
" ",
|
|
436
439
|
p.length === 1 ? "property" : "properties",
|
|
437
440
|
". Remove data binding to edit static content."
|
|
438
441
|
] }),
|
|
439
442
|
/* @__PURE__ */ e.jsx(
|
|
440
|
-
|
|
443
|
+
be,
|
|
441
444
|
{
|
|
442
445
|
onChange: c,
|
|
443
446
|
createHistorySnapshot: a,
|
|
444
|
-
formData:
|
|
447
|
+
formData: l,
|
|
445
448
|
properties: h
|
|
446
449
|
}
|
|
447
450
|
)
|
|
448
451
|
] })
|
|
449
452
|
] })
|
|
450
453
|
] }) : /* @__PURE__ */ e.jsx(
|
|
451
|
-
|
|
454
|
+
be,
|
|
452
455
|
{
|
|
453
456
|
onChange: c,
|
|
454
457
|
createHistorySnapshot: a,
|
|
455
|
-
formData:
|
|
458
|
+
formData: l,
|
|
456
459
|
properties: h
|
|
457
460
|
}
|
|
458
461
|
),
|
|
459
462
|
/* @__PURE__ */ e.jsx("div", { className: "pb-60" })
|
|
460
463
|
] });
|
|
461
464
|
}
|
|
462
|
-
const Pe = new
|
|
465
|
+
const Pe = new Dr($r, {
|
|
463
466
|
isCaseSensitive: !1,
|
|
464
467
|
threshold: 0.2,
|
|
465
468
|
minMatchCharLength: 2,
|
|
466
469
|
keys: ["name"]
|
|
467
470
|
});
|
|
468
|
-
function
|
|
471
|
+
function Fr() {
|
|
469
472
|
var L;
|
|
470
|
-
const [r] = Se(),
|
|
473
|
+
const [r] = Se(), s = q(), t = qe(), o = Ge(), [l] = Je(), [d, a] = j(""), c = (L = ue(r)) == null ? void 0 : L.prop, i = ft((g(s, c, "").replace(Pr, "").split(",").pop() || "").split(" "), m), p = () => {
|
|
471
474
|
const w = d.trim().toLowerCase().replace(/ +(?= )/g, "").split(" ");
|
|
472
|
-
t(
|
|
475
|
+
t(l, w, !0), a("");
|
|
473
476
|
}, [h, n] = j([]), y = ({ value: w }) => {
|
|
474
477
|
const I = w.trim().toLowerCase(), E = I.match(/.+:/g);
|
|
475
478
|
let N = [];
|
|
@@ -505,7 +508,7 @@ function Yr() {
|
|
|
505
508
|
/* @__PURE__ */ e.jsx(Te, { className: "mt-2", children: "Add Tailwind classes" }),
|
|
506
509
|
/* @__PURE__ */ e.jsxs("div", { className: "relative -mt-4 flex items-center gap-x-3", children: [
|
|
507
510
|
/* @__PURE__ */ e.jsx("div", { className: "relative flex w-full items-center gap-x-3", children: /* @__PURE__ */ e.jsx(
|
|
508
|
-
|
|
511
|
+
Br,
|
|
509
512
|
{
|
|
510
513
|
suggestions: h,
|
|
511
514
|
onSuggestionsFetchRequested: y,
|
|
@@ -524,7 +527,7 @@ function Yr() {
|
|
|
524
527
|
}
|
|
525
528
|
) }),
|
|
526
529
|
/* @__PURE__ */ e.jsx(
|
|
527
|
-
|
|
530
|
+
ge,
|
|
528
531
|
{
|
|
529
532
|
variant: "outline",
|
|
530
533
|
className: "h-6 border-gray-700",
|
|
@@ -545,9 +548,9 @@ function Yr() {
|
|
|
545
548
|
children: [
|
|
546
549
|
w,
|
|
547
550
|
/* @__PURE__ */ e.jsx(
|
|
548
|
-
|
|
551
|
+
Fe,
|
|
549
552
|
{
|
|
550
|
-
onClick: () => o(
|
|
553
|
+
onClick: () => o(l, [w]),
|
|
551
554
|
className: "invisible absolute right-1 hover:text-white group-hover:visible group-hover:cursor-pointer"
|
|
552
555
|
}
|
|
553
556
|
)
|
|
@@ -570,7 +573,7 @@ const H = ["px", "%", "em", "rem", "ch", "vh", "vw"], Xr = {
|
|
|
570
573
|
{ type: "dropdown", label: "flex.grow", property: "flexGrow" },
|
|
571
574
|
{ type: "dropdown", label: "flex.shrink", property: "flexShrink" }
|
|
572
575
|
]
|
|
573
|
-
},
|
|
576
|
+
}, Zr = {
|
|
574
577
|
heading: "grid.heading",
|
|
575
578
|
items: [
|
|
576
579
|
{ type: "range", label: "grid.col_span", property: "gridColSpan" },
|
|
@@ -581,7 +584,7 @@ const H = ["px", "%", "em", "rem", "ch", "vh", "vw"], Xr = {
|
|
|
581
584
|
{ type: "range", label: "grid.row_end", property: "gridRowEnd" },
|
|
582
585
|
{ type: "range", label: "grid.order", property: "order" }
|
|
583
586
|
]
|
|
584
|
-
},
|
|
587
|
+
}, Wr = [
|
|
585
588
|
{
|
|
586
589
|
heading: "layout.heading",
|
|
587
590
|
items: [
|
|
@@ -983,12 +986,12 @@ const H = ["px", "%", "em", "rem", "ch", "vh", "vw"], Xr = {
|
|
|
983
986
|
},
|
|
984
987
|
{
|
|
985
988
|
heading: "classes.heading",
|
|
986
|
-
items: [{ component:
|
|
989
|
+
items: [{ component: Fr }]
|
|
987
990
|
}
|
|
988
991
|
], ot = {
|
|
989
992
|
"not-italic": () => /* @__PURE__ */ e.jsx("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ e.jsx("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M9 3H11V5H9V11H11V13H5V11H7V5H5V3H9Z", fill: "white" }) }),
|
|
990
993
|
// visibility
|
|
991
|
-
visible:
|
|
994
|
+
visible: kt,
|
|
992
995
|
invisible: He,
|
|
993
996
|
// display
|
|
994
997
|
hidden: He,
|
|
@@ -1024,10 +1027,10 @@ const H = ["px", "%", "em", "rem", "ch", "vh", "vw"], Xr = {
|
|
|
1024
1027
|
borderRadiusRight: ee,
|
|
1025
1028
|
borderRadiusBottom: te,
|
|
1026
1029
|
borderRadiusLeft: re,
|
|
1027
|
-
borderRadiusTopLeft:
|
|
1028
|
-
borderRadiusTopRight:
|
|
1029
|
-
borderRadiusBottomRight:
|
|
1030
|
-
borderRadiusBottomLeft:
|
|
1030
|
+
borderRadiusTopLeft: Nt,
|
|
1031
|
+
borderRadiusTopRight: _t,
|
|
1032
|
+
borderRadiusBottomRight: St,
|
|
1033
|
+
borderRadiusBottomLeft: Tt,
|
|
1031
1034
|
divideXWidth: T,
|
|
1032
1035
|
divideYWidth: R,
|
|
1033
1036
|
scale: P,
|
|
@@ -1054,18 +1057,18 @@ const H = ["px", "%", "em", "rem", "ch", "vh", "vw"], Xr = {
|
|
|
1054
1057
|
marginBottom: te,
|
|
1055
1058
|
marginLeft: re,
|
|
1056
1059
|
// text-align
|
|
1057
|
-
textLeft:
|
|
1058
|
-
textCenter:
|
|
1059
|
-
textRight:
|
|
1060
|
-
textJustify:
|
|
1060
|
+
textLeft: Rt,
|
|
1061
|
+
textCenter: Vt,
|
|
1062
|
+
textRight: Ht,
|
|
1063
|
+
textJustify: Bt,
|
|
1061
1064
|
// font style
|
|
1062
|
-
italic:
|
|
1065
|
+
italic: Dt,
|
|
1063
1066
|
// "not-italic": "",
|
|
1064
1067
|
// decoration
|
|
1065
|
-
underline:
|
|
1066
|
-
overline:
|
|
1068
|
+
underline: $t,
|
|
1069
|
+
overline: It,
|
|
1067
1070
|
// transform
|
|
1068
|
-
uppercase:
|
|
1071
|
+
uppercase: Pt,
|
|
1069
1072
|
block: () => /* @__PURE__ */ e.jsxs("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [
|
|
1070
1073
|
/* @__PURE__ */ e.jsx(
|
|
1071
1074
|
"path",
|
|
@@ -1106,7 +1109,7 @@ const H = ["px", "%", "em", "rem", "ch", "vh", "vw"], Xr = {
|
|
|
1106
1109
|
}
|
|
1107
1110
|
)
|
|
1108
1111
|
] }),
|
|
1109
|
-
"float-none":
|
|
1112
|
+
"float-none": Fe,
|
|
1110
1113
|
// position
|
|
1111
1114
|
fixed: () => /* @__PURE__ */ e.jsxs("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [
|
|
1112
1115
|
/* @__PURE__ */ e.jsx(
|
|
@@ -1178,37 +1181,37 @@ const H = ["px", "%", "em", "rem", "ch", "vh", "vw"], Xr = {
|
|
|
1178
1181
|
}
|
|
1179
1182
|
)
|
|
1180
1183
|
] }),
|
|
1181
|
-
static:
|
|
1182
|
-
}, oe = Oe({ canReset: !1, canChange: !0 }),
|
|
1184
|
+
static: At
|
|
1185
|
+
}, oe = Oe({ canReset: !1, canChange: !0 }), Ur = ({ children: r, canReset: s = !1, canChange: t = !0 }) => (
|
|
1183
1186
|
// eslint-disable-next-line react/jsx-no-constructed-context-values
|
|
1184
|
-
/* @__PURE__ */ e.jsx(oe.Provider, { value: { canReset:
|
|
1185
|
-
), at = ({ label: r, property:
|
|
1186
|
-
const o = _(() => g(
|
|
1187
|
+
/* @__PURE__ */ e.jsx(oe.Provider, { value: { canReset: s, canChange: t }, children: r })
|
|
1188
|
+
), at = ({ label: r, property: s, onChange: t }) => {
|
|
1189
|
+
const o = _(() => g(ye, `${s}.classes`, [""]), [s]), l = ae(s), d = _(() => g(l, "cls", ""), [l]), { canChange: a } = se(oe), c = /\[.*\]/g.test(d);
|
|
1187
1190
|
return /* @__PURE__ */ e.jsx("div", { className: r ? "w-full rounded " : "grow", children: c ? /* @__PURE__ */ e.jsxs("div", { className: "flex items-center", children: [
|
|
1188
|
-
/* @__PURE__ */ e.jsx(
|
|
1189
|
-
/* @__PURE__ */ e.jsxs(
|
|
1190
|
-
/* @__PURE__ */ e.jsx(
|
|
1191
|
+
/* @__PURE__ */ e.jsx(ur, { className: "w-[70%] rounded py-1", readOnly: !0, value: d }),
|
|
1192
|
+
/* @__PURE__ */ e.jsxs(F, { delayDuration: 100, children: [
|
|
1193
|
+
/* @__PURE__ */ e.jsx(X, { 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(_e, {}) }) }),
|
|
1191
1194
|
/* @__PURE__ */ e.jsx(Z, { children: "Current value is using a Tailwind arbitrary value." })
|
|
1192
1195
|
] })
|
|
1193
1196
|
] }) : /* @__PURE__ */ e.jsx(
|
|
1194
|
-
|
|
1197
|
+
Ce,
|
|
1195
1198
|
{
|
|
1196
1199
|
rounded: r,
|
|
1197
|
-
onChange: (i) => t(i,
|
|
1200
|
+
onChange: (i) => t(i, s),
|
|
1198
1201
|
selected: d,
|
|
1199
1202
|
options: o,
|
|
1200
1203
|
disabled: !a
|
|
1201
1204
|
}
|
|
1202
1205
|
) });
|
|
1203
1206
|
};
|
|
1204
|
-
function
|
|
1207
|
+
function Ce({ selected: r, onChange: s, rounded: t = !1, options: o, disabled: l = !1 }) {
|
|
1205
1208
|
const d = r.replace(/.*:/g, "").trim(), { undo: a, redo: c } = We();
|
|
1206
1209
|
return /* @__PURE__ */ e.jsxs(
|
|
1207
1210
|
"select",
|
|
1208
1211
|
{
|
|
1209
|
-
disabled: !o.length ||
|
|
1212
|
+
disabled: !o.length || l,
|
|
1210
1213
|
className: `${t ? "rounded-md border border-border" : "border-0"} w-full disable:bg-gray-500 h-full truncate rounded bg-background px-2 py-1 text-xs outline-none disabled:cursor-not-allowed`,
|
|
1211
|
-
onChange: (i) =>
|
|
1214
|
+
onChange: (i) => s(i.target.value),
|
|
1212
1215
|
onKeyDown: (i) => {
|
|
1213
1216
|
i.ctrlKey && (i.key === "z" && a(), i.key === "y" && c());
|
|
1214
1217
|
},
|
|
@@ -1222,8 +1225,8 @@ function ke({ selected: r, onChange: l, rounded: t = !1, options: o, disabled: s
|
|
|
1222
1225
|
}
|
|
1223
1226
|
);
|
|
1224
1227
|
}
|
|
1225
|
-
const
|
|
1226
|
-
const { canReset: t, canChange: o } =
|
|
1228
|
+
const Kr = ({ property: r, onChange: s }) => {
|
|
1229
|
+
const { canReset: t, canChange: o } = se(oe), l = ae(r), d = _(() => g(l, "cls", ""), [l]), a = _(() => g(ye, `${r}.classes`, [""]), [r]), c = a.indexOf(d) > -1 ? a.indexOf(d) : 0, i = /\[.*\]/g.test(d);
|
|
1227
1230
|
return /* @__PURE__ */ e.jsx("div", { className: "flex flex-row divide-x divide-solid divide-border rounded border border-border text-xs", children: i ? /* @__PURE__ */ e.jsx("div", { className: "py-[5px] px-2", children: d }) : /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
1228
1231
|
/* @__PURE__ */ e.jsx(
|
|
1229
1232
|
"button",
|
|
@@ -1231,23 +1234,23 @@ const Ur = ({ property: r, onChange: l }) => {
|
|
|
1231
1234
|
type: "button",
|
|
1232
1235
|
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",
|
|
1233
1236
|
disabled: !o && (!t || c - 1 < 0),
|
|
1234
|
-
onClick: () =>
|
|
1237
|
+
onClick: () => s(Ve(a, c - 1), r),
|
|
1235
1238
|
children: /* @__PURE__ */ e.jsx("span", { className: "flex items-center justify-center", children: /* @__PURE__ */ e.jsx(
|
|
1236
|
-
|
|
1239
|
+
Lt,
|
|
1237
1240
|
{
|
|
1238
1241
|
className: !o && (!t || c - 1 < 0) ? "text-gray-500" : "text-black/60 dark:text-white/60"
|
|
1239
1242
|
}
|
|
1240
1243
|
) })
|
|
1241
1244
|
}
|
|
1242
1245
|
),
|
|
1243
|
-
/* @__PURE__ */ e.jsx("div", { className: "w-8/12 text-center", children: /* @__PURE__ */ e.jsx(at, { label: !1, property: r, onChange:
|
|
1246
|
+
/* @__PURE__ */ e.jsx("div", { className: "w-8/12 text-center", children: /* @__PURE__ */ e.jsx(at, { label: !1, property: r, onChange: s }) }),
|
|
1244
1247
|
/* @__PURE__ */ e.jsx(
|
|
1245
1248
|
"button",
|
|
1246
1249
|
{
|
|
1247
1250
|
type: "button",
|
|
1248
1251
|
className: "w-2/12 rounded-tr rounded-br bg-background px-1 text-center hover:bg-bg-gray-700 disabled:cursor-not-allowed disabled:bg-gray-600",
|
|
1249
1252
|
disabled: !o && (!t || c + 1 >= a.length),
|
|
1250
|
-
onClick: () =>
|
|
1253
|
+
onClick: () => s(Ve(a, c + 1), r),
|
|
1251
1254
|
children: /* @__PURE__ */ e.jsx("span", { className: "flex items-center justify-center", children: /* @__PURE__ */ e.jsx(
|
|
1252
1255
|
Ne,
|
|
1253
1256
|
{
|
|
@@ -1257,22 +1260,22 @@ const Ur = ({ property: r, onChange: l }) => {
|
|
|
1257
1260
|
}
|
|
1258
1261
|
)
|
|
1259
1262
|
] }) });
|
|
1260
|
-
},
|
|
1261
|
-
const t = _(() => g(
|
|
1262
|
-
return /* @__PURE__ */ e.jsx("div", { className: "flex grow flex-wrap gap-1", children: C(t, (a) => /* @__PURE__ */ e.jsxs(
|
|
1263
|
-
/* @__PURE__ */ e.jsx(
|
|
1263
|
+
}, qr = ({ property: r, onChange: s }) => {
|
|
1264
|
+
const t = _(() => g(ye, `${r}.classes`, [""]), [r]), { canChange: o } = se(oe), l = ae(r), d = _(() => g(l, "cls", ""), [l]);
|
|
1265
|
+
return /* @__PURE__ */ e.jsx("div", { className: "flex grow flex-wrap gap-1", children: C(t, (a) => /* @__PURE__ */ e.jsxs(F, { children: [
|
|
1266
|
+
/* @__PURE__ */ e.jsx(X, { asChild: !0, children: /* @__PURE__ */ e.jsx(
|
|
1264
1267
|
"button",
|
|
1265
1268
|
{
|
|
1266
1269
|
type: "button",
|
|
1267
1270
|
disabled: !o,
|
|
1268
|
-
onClick: () =>
|
|
1271
|
+
onClick: () => s(a, r),
|
|
1269
1272
|
className: `cursor-pointer rounded border border-gray-600 p-1 disabled:cursor-not-allowed ${d === a ? " bg-blue-500 text-white" : "disabled:bg-gray-600 disabled:text-gray-400"}`,
|
|
1270
|
-
children: $.createElement(g(ot, a,
|
|
1273
|
+
children: $.createElement(g(ot, a, Xe))
|
|
1271
1274
|
}
|
|
1272
1275
|
) }),
|
|
1273
|
-
/* @__PURE__ */ e.jsx(Z, { children: Y(
|
|
1276
|
+
/* @__PURE__ */ e.jsx(Z, { children: Y(le(a)) })
|
|
1274
1277
|
] })) });
|
|
1275
|
-
},
|
|
1278
|
+
}, Gr = {
|
|
1276
1279
|
backgroundColor: "bg",
|
|
1277
1280
|
textColor: "text",
|
|
1278
1281
|
borderColor: "border",
|
|
@@ -1284,8 +1287,8 @@ const Ur = ({ property: r, onChange: l }) => {
|
|
|
1284
1287
|
toColor: "to",
|
|
1285
1288
|
ringColor: "ring",
|
|
1286
1289
|
ringOffsetColor: "ring-offset"
|
|
1287
|
-
},
|
|
1288
|
-
const t = ae(r), o = _(() => g(t, "cls", ""), [t]), { canChange:
|
|
1290
|
+
}, Jr = ({ property: r, onChange: s }) => {
|
|
1291
|
+
const t = ae(r), o = _(() => g(t, "cls", ""), [t]), { canChange: l } = se(oe), [d, a] = j([]), [c, i] = j({ color: "", shade: "" }), p = o.split("-"), h = g(p, "1", ""), n = g(p, "2", ""), y = B(
|
|
1289
1292
|
// eslint-disable-next-line no-shadow
|
|
1290
1293
|
(u) => {
|
|
1291
1294
|
["current", "inherit", "transparent", "black", "white"].includes(u) ? (a([]), i({ color: u })) : (a(["50", "100", "200", "300", "400", "500", "600", "700", "800", "900"]), i((f) => ({ ...f, color: u, shade: f.shade ? f.shade : "500" })));
|
|
@@ -1307,13 +1310,13 @@ const Ur = ({ property: r, onChange: l }) => {
|
|
|
1307
1310
|
return M(() => {
|
|
1308
1311
|
i({ color: "", shade: "" });
|
|
1309
1312
|
}, [t]), M(() => {
|
|
1310
|
-
const f = `${g(
|
|
1311
|
-
f.match(new RegExp(g(
|
|
1312
|
-
}, [c,
|
|
1313
|
+
const f = `${g(Gr, r, "")}-${c.color}${c.shade ? `-${c.shade}` : ""}`;
|
|
1314
|
+
f.match(new RegExp(g(ye, `${r}.regExp`, ""))) && s(f, r);
|
|
1315
|
+
}, [c, s, r]), /* @__PURE__ */ e.jsxs("div", { className: "flex flex-row divide-x divide-solid divide-border rounded-lg border border-border text-xs", children: [
|
|
1313
1316
|
/* @__PURE__ */ e.jsx("div", { className: "grow text-center", children: /* @__PURE__ */ e.jsx(
|
|
1314
|
-
|
|
1317
|
+
Ce,
|
|
1315
1318
|
{
|
|
1316
|
-
disabled: !
|
|
1319
|
+
disabled: !l,
|
|
1317
1320
|
rounded: !0,
|
|
1318
1321
|
selected: h,
|
|
1319
1322
|
onChange: y,
|
|
@@ -1349,20 +1352,20 @@ const Ur = ({ property: r, onChange: l }) => {
|
|
|
1349
1352
|
]
|
|
1350
1353
|
}
|
|
1351
1354
|
) }),
|
|
1352
|
-
/* @__PURE__ */ e.jsx("button", { type: "button", className: "grow text-center", children: /* @__PURE__ */ e.jsx(
|
|
1355
|
+
/* @__PURE__ */ e.jsx("button", { type: "button", className: "grow text-center", children: /* @__PURE__ */ e.jsx(Ce, { rounded: !0, selected: n, disabled: !h || !l, onChange: x, options: d }) })
|
|
1353
1356
|
] });
|
|
1354
|
-
}, Ae = (r,
|
|
1357
|
+
}, Ae = (r, s) => {
|
|
1355
1358
|
r = r.toLowerCase();
|
|
1356
1359
|
let t = r.trim().replace(/ |\+/g, "");
|
|
1357
|
-
if ((t === "auto" || t === "none") &&
|
|
1360
|
+
if ((t === "auto" || t === "none") && s.includes(t))
|
|
1358
1361
|
return { value: "", unit: t };
|
|
1359
|
-
const o =
|
|
1362
|
+
const o = s.length ? new RegExp(s.join("|"), "g") : /XXXXXX/g;
|
|
1360
1363
|
t = t.replace(o, "");
|
|
1361
|
-
const
|
|
1362
|
-
return d || a ? { error: "Invalid value" } :
|
|
1364
|
+
const l = r.match(o), d = l && l.length > 1, a = !m(t) && Number.isNaN(Number(t));
|
|
1365
|
+
return d || a ? { error: "Invalid value" } : l && (l[0] === "auto" || l[0] === "none") ? { value: l[0], unit: "" } : { value: t, unit: l ? l[0] : "" };
|
|
1363
1366
|
};
|
|
1364
|
-
const
|
|
1365
|
-
const
|
|
1367
|
+
const Qr = (r) => {
|
|
1368
|
+
const s = r.startsWith("-") ? "-" : "", t = r.split("-").pop();
|
|
1366
1369
|
if (["auto", "none"].includes(t))
|
|
1367
1370
|
return { value: "", unit: t };
|
|
1368
1371
|
if (t === "px")
|
|
@@ -1372,17 +1375,17 @@ const Jr = (r) => {
|
|
|
1372
1375
|
if (t === "full")
|
|
1373
1376
|
return { value: "100", unit: "%" };
|
|
1374
1377
|
if (A(r, "skew-"))
|
|
1375
|
-
return { value: `${
|
|
1378
|
+
return { value: `${s}${t}`, unit: "deg" };
|
|
1376
1379
|
if (A(r, "rotate-"))
|
|
1377
|
-
return { value: `${
|
|
1380
|
+
return { value: `${s}${t}`, unit: "deg" };
|
|
1378
1381
|
if (A(r, "opacity-"))
|
|
1379
1382
|
return { value: `${t / 100}`, unit: "-" };
|
|
1380
1383
|
if (A(r, "duration-") || A(r, "delay-"))
|
|
1381
1384
|
return { value: `${t}`, unit: "ms" };
|
|
1382
1385
|
if (A(r, "translate-") && !t.includes("/"))
|
|
1383
|
-
return { value: `${
|
|
1386
|
+
return { value: `${s}${`${t / 4}`}`, unit: "rem" };
|
|
1384
1387
|
if (A(r, "scale-"))
|
|
1385
|
-
return { value: `${
|
|
1388
|
+
return { value: `${s}${`${t / 100}`}`, unit: "-" };
|
|
1386
1389
|
if (W(r, "border")) {
|
|
1387
1390
|
const o = r.match(/border-?(x|y|t|r|b|l)?\d+/g);
|
|
1388
1391
|
if (o)
|
|
@@ -1485,32 +1488,32 @@ const Jr = (r) => {
|
|
|
1485
1488
|
if (["max", "min", "fit"].includes(t))
|
|
1486
1489
|
return { value: r, unit: "class" };
|
|
1487
1490
|
if (t.includes("/")) {
|
|
1488
|
-
const [o,
|
|
1489
|
-
return { value:
|
|
1491
|
+
const [o, l] = C(t.split("/"), (d) => parseInt(d, 10));
|
|
1492
|
+
return { value: s + (o / l * 100).toFixed(2).replace(".00", ""), unit: "%" };
|
|
1490
1493
|
}
|
|
1491
|
-
return
|
|
1494
|
+
return vt(parseFloat(t)) ? { value: `${s + parseFloat(t) * 4}`, unit: "px" } : { value: t, unit: "class" };
|
|
1492
1495
|
};
|
|
1493
|
-
const
|
|
1496
|
+
const el = (r) => {
|
|
1494
1497
|
if (m(r))
|
|
1495
1498
|
return { value: "", unit: "" };
|
|
1496
|
-
const
|
|
1497
|
-
if (
|
|
1498
|
-
return
|
|
1499
|
-
const t = g(
|
|
1500
|
-
return { value: `${o}${
|
|
1501
|
-
},
|
|
1499
|
+
const s = r.match(/\[.*\]/g);
|
|
1500
|
+
if (s === null)
|
|
1501
|
+
return tl(r);
|
|
1502
|
+
const t = g(s, "0", "").replace(/\[|\]/g, ""), o = r.startsWith("-") ? "-" : "", l = ue(t.match(/\d+.\d+|\d+/g));
|
|
1503
|
+
return { value: `${o}${l}`, unit: t.replace(l, "") };
|
|
1504
|
+
}, tl = (r) => m(r) ? { value: "", unit: "" } : Qr(r), nt = $.createContext({
|
|
1502
1505
|
setDragData: () => {
|
|
1503
1506
|
}
|
|
1504
|
-
}),
|
|
1507
|
+
}), rl = ({
|
|
1505
1508
|
unit: r,
|
|
1506
|
-
currentValue:
|
|
1509
|
+
currentValue: s,
|
|
1507
1510
|
onDrag: t,
|
|
1508
1511
|
onDragEnd: o,
|
|
1509
|
-
onDragStart:
|
|
1512
|
+
onDragStart: l,
|
|
1510
1513
|
negative: d,
|
|
1511
1514
|
cssProperty: a
|
|
1512
1515
|
}) => {
|
|
1513
|
-
const { setDragData: c } =
|
|
1516
|
+
const { setDragData: c } = se(nt);
|
|
1514
1517
|
return /* @__PURE__ */ e.jsx(
|
|
1515
1518
|
"button",
|
|
1516
1519
|
{
|
|
@@ -1521,41 +1524,41 @@ const Qr = (r) => {
|
|
|
1521
1524
|
onDragEnd: o,
|
|
1522
1525
|
dragging: !0,
|
|
1523
1526
|
dragStartY: i.pageY,
|
|
1524
|
-
dragStartValue: `${
|
|
1527
|
+
dragStartValue: `${s}`,
|
|
1525
1528
|
dragUnit: r,
|
|
1526
1529
|
negative: d,
|
|
1527
1530
|
cssProperty: a
|
|
1528
1531
|
};
|
|
1529
|
-
|
|
1532
|
+
l(p), c(p);
|
|
1530
1533
|
},
|
|
1531
1534
|
color: void 0,
|
|
1532
1535
|
className: "relative z-50 ml-1 hidden h-6 cursor-row-resize rounded bg-background/70 px-2 group-hover:inline",
|
|
1533
|
-
children: /* @__PURE__ */ e.jsx(
|
|
1536
|
+
children: /* @__PURE__ */ e.jsx(Et, {})
|
|
1534
1537
|
}
|
|
1535
1538
|
);
|
|
1536
|
-
},
|
|
1537
|
-
|
|
1539
|
+
}, ll = ({ onSelect: r, current: s, units: t }) => /* @__PURE__ */ e.jsx("div", { "data-theme": "light", className: "-m-[7px] -mx-[13px] flex w-9 flex-col", children: t.map((o) => /* @__PURE__ */ e.jsx(
|
|
1540
|
+
ge,
|
|
1538
1541
|
{
|
|
1539
1542
|
className: "h-max rounded-none px-1 py-1 text-right text-[11px] hover:bg-blue-400",
|
|
1540
|
-
color:
|
|
1543
|
+
color: s === o ? "primary" : void 0,
|
|
1541
1544
|
size: "sm",
|
|
1542
|
-
onClick: (
|
|
1543
|
-
|
|
1545
|
+
onClick: (l) => {
|
|
1546
|
+
l.stopPropagation(), r(o);
|
|
1544
1547
|
},
|
|
1545
1548
|
children: o
|
|
1546
1549
|
},
|
|
1547
1550
|
o
|
|
1548
|
-
)) }), Le = 50,
|
|
1549
|
-
const [
|
|
1551
|
+
)) }), Le = 50, sl = (r) => {
|
|
1552
|
+
const [s, t] = j(!1), [o, l] = j(""), { currentClass: d, onChange: a, classPrefix: c, cssProperty: i, units: p, negative: h } = r, [n, y] = j(i != null && i.toLowerCase().includes("width") ? "%" : p[0]), [x, u] = j(!1), [f, k] = j(""), [L, w] = j(!1), [I, E] = j(!1);
|
|
1550
1553
|
M(() => {
|
|
1551
|
-
const { value: b, unit: v } =
|
|
1554
|
+
const { value: b, unit: v } = el(d);
|
|
1552
1555
|
if (v === "") {
|
|
1553
|
-
|
|
1556
|
+
l(b), y(i != null && i.toLowerCase().includes("width") ? "%" : ue(p));
|
|
1554
1557
|
return;
|
|
1555
1558
|
}
|
|
1556
|
-
y(v),
|
|
1559
|
+
y(v), l(v === "class" || m(b) ? "" : b);
|
|
1557
1560
|
}, [d, i, p]);
|
|
1558
|
-
const N =
|
|
1561
|
+
const N = fe((b) => a(b), [a], Le), D = fe((b) => a(b, !1), [a], Le), z = B(
|
|
1559
1562
|
(b = !1) => {
|
|
1560
1563
|
const v = Ae(`${o}`, p);
|
|
1561
1564
|
if (g(v, "error", !1)) {
|
|
@@ -1593,8 +1596,8 @@ const Qr = (r) => {
|
|
|
1593
1596
|
);
|
|
1594
1597
|
return /* @__PURE__ */ e.jsx("div", { className: "flex w-full flex-col", children: /* @__PURE__ */ e.jsx("div", { className: "flex items-center justify-start", children: n === "class" ? /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
1595
1598
|
/* @__PURE__ */ e.jsx("input", { className: "w-20 rounded py-1", readOnly: !0, value: d }),
|
|
1596
|
-
/* @__PURE__ */ e.jsxs(
|
|
1597
|
-
/* @__PURE__ */ e.jsx(
|
|
1599
|
+
/* @__PURE__ */ e.jsxs(F, { children: [
|
|
1600
|
+
/* @__PURE__ */ e.jsx(X, { 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(_e, {}) }) }),
|
|
1598
1601
|
/* @__PURE__ */ e.jsx(Z, { children: "Current value is using a Tailwind preset class." })
|
|
1599
1602
|
] })
|
|
1600
1603
|
] }) : /* @__PURE__ */ e.jsxs("div", { className: `group relative flex items-center ${L ? "z-auto" : ""}`, children: [
|
|
@@ -1610,7 +1613,7 @@ const Qr = (r) => {
|
|
|
1610
1613
|
if (b.keyCode !== 38 && b.keyCode !== 40)
|
|
1611
1614
|
return;
|
|
1612
1615
|
b.preventDefault(), E(!0);
|
|
1613
|
-
const v =
|
|
1616
|
+
const v = wt(b.target.value);
|
|
1614
1617
|
let S = ze(v) ? 0 : v;
|
|
1615
1618
|
b.keyCode === 38 && (S += 1), b.keyCode === 40 && (S -= 1);
|
|
1616
1619
|
const O = `${S}`, dt = `${O.startsWith("-") ? "-" : ""}${c}[${O.replace("-", "")}${n === "-" ? "" : n}]`;
|
|
@@ -1621,7 +1624,7 @@ const Qr = (r) => {
|
|
|
1621
1624
|
},
|
|
1622
1625
|
onBlur: () => z(),
|
|
1623
1626
|
onChange: (b) => {
|
|
1624
|
-
u(!1),
|
|
1627
|
+
u(!1), l(b.target.value);
|
|
1625
1628
|
},
|
|
1626
1629
|
onClick: (b) => {
|
|
1627
1630
|
var v;
|
|
@@ -1634,21 +1637,21 @@ const Qr = (r) => {
|
|
|
1634
1637
|
)
|
|
1635
1638
|
}
|
|
1636
1639
|
),
|
|
1637
|
-
/* @__PURE__ */ e.jsxs(
|
|
1638
|
-
/* @__PURE__ */ e.jsx(
|
|
1640
|
+
/* @__PURE__ */ e.jsxs(F, { open: s, delayDuration: 100, children: [
|
|
1641
|
+
/* @__PURE__ */ e.jsx(X, { asChild: !0, children: /* @__PURE__ */ e.jsxs(
|
|
1639
1642
|
"button",
|
|
1640
1643
|
{
|
|
1641
1644
|
type: "button",
|
|
1642
|
-
onClick: () => t(!
|
|
1645
|
+
onClick: () => t(!s),
|
|
1643
1646
|
className: "flex h-6 cursor-pointer items-center gap-x-1 rounded rounded-l-none bg-background p-px px-1 text-[11px] uppercase",
|
|
1644
1647
|
children: [
|
|
1645
1648
|
/* @__PURE__ */ e.jsx("span", { className: `inline-block ${p.length === 1 ? "px-2 font-semibold" : ""}`, children: n }),
|
|
1646
|
-
p.length > 1 ? /* @__PURE__ */ e.jsx(
|
|
1649
|
+
p.length > 1 ? /* @__PURE__ */ e.jsx(Ot, {}) : null
|
|
1647
1650
|
]
|
|
1648
1651
|
}
|
|
1649
1652
|
) }),
|
|
1650
|
-
/* @__PURE__ */ e.jsx(
|
|
1651
|
-
|
|
1653
|
+
/* @__PURE__ */ e.jsx(gr, { children: /* @__PURE__ */ e.jsx(Z, { className: "bg-background", children: /* @__PURE__ */ e.jsx(
|
|
1654
|
+
ll,
|
|
1652
1655
|
{
|
|
1653
1656
|
units: p,
|
|
1654
1657
|
current: n,
|
|
@@ -1660,7 +1663,7 @@ const Qr = (r) => {
|
|
|
1660
1663
|
] })
|
|
1661
1664
|
] }),
|
|
1662
1665
|
["none", "auto"].indexOf(n) !== -1 || L ? null : /* @__PURE__ */ e.jsx(
|
|
1663
|
-
|
|
1666
|
+
rl,
|
|
1664
1667
|
{
|
|
1665
1668
|
onDragStart: () => w(!0),
|
|
1666
1669
|
onDragEnd: (b) => {
|
|
@@ -1684,9 +1687,9 @@ const Qr = (r) => {
|
|
|
1684
1687
|
)
|
|
1685
1688
|
] }) }) });
|
|
1686
1689
|
}, ae = (r) => {
|
|
1687
|
-
const
|
|
1688
|
-
return
|
|
1689
|
-
},
|
|
1690
|
+
const s = xe();
|
|
1691
|
+
return jt(s, { property: r });
|
|
1692
|
+
}, ol = (r, s) => {
|
|
1690
1693
|
const t = {
|
|
1691
1694
|
xs: 0,
|
|
1692
1695
|
sm: 1,
|
|
@@ -1695,8 +1698,8 @@ const Qr = (r) => {
|
|
|
1695
1698
|
xl: 4,
|
|
1696
1699
|
"2xl": 5
|
|
1697
1700
|
};
|
|
1698
|
-
return t[g(r, "mq", "xs")] <= t[
|
|
1699
|
-
},
|
|
1701
|
+
return t[g(r, "mq", "xs")] <= t[s];
|
|
1702
|
+
}, al = {
|
|
1700
1703
|
width: "w-",
|
|
1701
1704
|
height: "h-",
|
|
1702
1705
|
minWidth: "min-w-",
|
|
@@ -1769,19 +1772,19 @@ const Qr = (r) => {
|
|
|
1769
1772
|
lg: "1024px",
|
|
1770
1773
|
xl: "1280px",
|
|
1771
1774
|
"2xl": "1536px"
|
|
1772
|
-
},
|
|
1773
|
-
const { t:
|
|
1774
|
-
}, units: a, negative: c = !1 } = r, [i] =
|
|
1775
|
+
}, nl = (r) => `${r.toUpperCase()} ${Ee[r] ? `(${Ee[r]} & up)` : ""}`, Re = (r) => {
|
|
1776
|
+
const { t: s } = K(), { type: t = "icons", label: o, property: l, onEmitChange: d = () => {
|
|
1777
|
+
}, units: a, negative: c = !1 } = r, [i] = xr(), [p] = Qe(), [, h] = Be(), n = ae(l), y = qe(), x = Ge(), [u] = Je(), f = _(() => g(n, "fullCls", ""), [n]), k = B(
|
|
1775
1778
|
(D, z = !0) => {
|
|
1776
|
-
const G = { dark: i, mq: h, mod: p, cls: D, property:
|
|
1779
|
+
const G = { dark: i, mq: h, mod: p, cls: D, property: l, fullCls: "" };
|
|
1777
1780
|
(i || p !== "") && (G.mq = "xs");
|
|
1778
|
-
const b =
|
|
1781
|
+
const b = Ir(G);
|
|
1779
1782
|
y(u, [b], z);
|
|
1780
1783
|
},
|
|
1781
|
-
[u, i, h, p,
|
|
1784
|
+
[u, i, h, p, l, y]
|
|
1782
1785
|
), L = B(() => {
|
|
1783
1786
|
x(u, [f]);
|
|
1784
|
-
}, [u, f, x]), w = _(() =>
|
|
1787
|
+
}, [u, f, x]), w = _(() => ol(n, h), [n, h]);
|
|
1785
1788
|
M(() => {
|
|
1786
1789
|
d(w, n);
|
|
1787
1790
|
}, [w, d, n]);
|
|
@@ -1798,28 +1801,28 @@ const Qr = (r) => {
|
|
|
1798
1801
|
},
|
|
1799
1802
|
[I]
|
|
1800
1803
|
), N = g(n, "dark", null) === i && g(n, "mod", null) === p && g(n, "mq", null) === h;
|
|
1801
|
-
return /* @__PURE__ */ e.jsx(
|
|
1802
|
-
/* @__PURE__ */ e.jsx("div", { className: "relative w-[70px] truncate text-xs text-foreground", children: /* @__PURE__ */ e.jsx("span", { className: `text-[11px] ${n && !N ? "text-foreground" : ""}`, children:
|
|
1804
|
+
return /* @__PURE__ */ e.jsx(Ur, { canChange: w, canReset: n && N, children: /* @__PURE__ */ e.jsxs("div", { className: "group flex flex-row items-center py-2 first:pt-0 last:pb-0", children: [
|
|
1805
|
+
/* @__PURE__ */ e.jsx("div", { className: "relative w-[70px] truncate text-xs text-foreground", children: /* @__PURE__ */ e.jsx("span", { className: `text-[11px] ${n && !N ? "text-foreground" : ""}`, children: s(o) }) }),
|
|
1803
1806
|
/* @__PURE__ */ e.jsxs("div", { className: "flex flex-row items-center", children: [
|
|
1804
1807
|
/* @__PURE__ */ e.jsxs("div", { className: "w-[150px]", children: [
|
|
1805
1808
|
t === "arbitrary" ? /* @__PURE__ */ e.jsx(
|
|
1806
|
-
|
|
1809
|
+
sl,
|
|
1807
1810
|
{
|
|
1808
1811
|
currentClass: g(n, "cls", ""),
|
|
1809
|
-
classPrefix: g(
|
|
1812
|
+
classPrefix: g(al, l, ""),
|
|
1810
1813
|
units: a || [],
|
|
1811
1814
|
onChange: k,
|
|
1812
1815
|
negative: c,
|
|
1813
|
-
cssProperty:
|
|
1816
|
+
cssProperty: l
|
|
1814
1817
|
}
|
|
1815
1818
|
) : null,
|
|
1816
|
-
t === "icons" && /* @__PURE__ */ e.jsx(
|
|
1817
|
-
t === "range" && /* @__PURE__ */ e.jsx(
|
|
1818
|
-
t === "color" && /* @__PURE__ */ e.jsx(
|
|
1819
|
-
t === "dropdown" && /* @__PURE__ */ e.jsx(at, { label: o, property:
|
|
1819
|
+
t === "icons" && /* @__PURE__ */ e.jsx(qr, { property: l, onChange: k }),
|
|
1820
|
+
t === "range" && /* @__PURE__ */ e.jsx(Kr, { property: l, onChange: k }),
|
|
1821
|
+
t === "color" && /* @__PURE__ */ e.jsx(Jr, { property: l, onChange: k }),
|
|
1822
|
+
t === "dropdown" && /* @__PURE__ */ e.jsx(at, { label: o, property: l, onChange: k })
|
|
1820
1823
|
] }),
|
|
1821
|
-
/* @__PURE__ */ e.jsx("div", { className: `w-[30px] cursor-pointer ${f ? "visible" : "invisible"}`, children: N ? /* @__PURE__ */ e.jsx("button", { type: "button", onClick: () => L(), title: "Reset", className: "flex px-1.5 text-xs", children: /* @__PURE__ */ e.jsx(
|
|
1822
|
-
/* @__PURE__ */ e.jsx(
|
|
1824
|
+
/* @__PURE__ */ e.jsx("div", { className: `w-[30px] cursor-pointer ${f ? "visible" : "invisible"}`, children: N ? /* @__PURE__ */ e.jsx("button", { type: "button", onClick: () => L(), title: "Reset", className: "flex px-1.5 text-xs", children: /* @__PURE__ */ e.jsx(Mt, { className: "h-5 w-5 text-blue-500 hover:opacity-80" }) }) : w && n ? /* @__PURE__ */ e.jsxs(F, { delayDuration: 100, children: [
|
|
1825
|
+
/* @__PURE__ */ e.jsx(X, { asChild: !0, children: /* @__PURE__ */ e.jsx(
|
|
1823
1826
|
"button",
|
|
1824
1827
|
{
|
|
1825
1828
|
type: "button",
|
|
@@ -1830,7 +1833,7 @@ const Qr = (r) => {
|
|
|
1830
1833
|
/* @__PURE__ */ e.jsx(Z, { children: /* @__PURE__ */ e.jsx("div", { className: "text-right", children: /* @__PURE__ */ e.jsxs("div", { children: [
|
|
1831
1834
|
"Current style is set at ",
|
|
1832
1835
|
/* @__PURE__ */ e.jsxs("span", { className: "font-bold ", children: [
|
|
1833
|
-
|
|
1836
|
+
nl(g(n, "mq")),
|
|
1834
1837
|
i && !n.dark ? "(Light mode)" : ""
|
|
1835
1838
|
] }),
|
|
1836
1839
|
/* @__PURE__ */ e.jsx("br", {}),
|
|
@@ -1850,16 +1853,16 @@ const Qr = (r) => {
|
|
|
1850
1853
|
] }) : null })
|
|
1851
1854
|
] })
|
|
1852
1855
|
] }) });
|
|
1853
|
-
},
|
|
1856
|
+
}, il = ["px", "%", "em", "rem", "ch", "vh", "vw"], it = ({
|
|
1854
1857
|
label: r,
|
|
1855
|
-
options:
|
|
1858
|
+
options: s,
|
|
1856
1859
|
borderB: t = !1,
|
|
1857
1860
|
borderT: o = !1,
|
|
1858
|
-
type:
|
|
1859
|
-
units: d =
|
|
1861
|
+
type: l = "arbitrary",
|
|
1862
|
+
units: d = il,
|
|
1860
1863
|
negative: a = !1
|
|
1861
1864
|
}) => {
|
|
1862
|
-
const { t: c } = K(), [i, p] = j(
|
|
1865
|
+
const { t: c } = K(), [i, p] = j(s[0].key), h = xe(), n = B((y) => C(h, "property").includes(y), [h]);
|
|
1863
1866
|
return /* @__PURE__ */ e.jsxs(
|
|
1864
1867
|
"div",
|
|
1865
1868
|
{
|
|
@@ -1868,8 +1871,8 @@ const Qr = (r) => {
|
|
|
1868
1871
|
/* @__PURE__ */ e.jsxs("div", { className: "flex flex-row text-xs", children: [
|
|
1869
1872
|
r && /* @__PURE__ */ e.jsx("span", { className: "relative w-[70px] flex-none text-xs text-foreground", children: c(r) }),
|
|
1870
1873
|
/* @__PURE__ */ e.jsx("div", { className: "mb-3 flex grow flex-row flex-wrap gap-x-px", children: $.Children.toArray(
|
|
1871
|
-
|
|
1872
|
-
/* @__PURE__ */ e.jsx(
|
|
1874
|
+
s.map(({ label: y, key: x }) => /* @__PURE__ */ e.jsx("div", { className: "first:rounded-l last:rounded-r", children: /* @__PURE__ */ e.jsxs(F, { children: [
|
|
1875
|
+
/* @__PURE__ */ e.jsx(X, { asChild: !0, children: /* @__PURE__ */ e.jsxs(
|
|
1873
1876
|
"button",
|
|
1874
1877
|
{
|
|
1875
1878
|
type: "button",
|
|
@@ -1879,18 +1882,18 @@ const Qr = (r) => {
|
|
|
1879
1882
|
$.createElement("div", {
|
|
1880
1883
|
className: n(x) ? "-bottom-1.5 absolute bg-[#3E57F0] h-[2px] left-0 w-full" : ""
|
|
1881
1884
|
}),
|
|
1882
|
-
$.createElement(g(ot, x,
|
|
1885
|
+
$.createElement(g(ot, x, Xe), { className: "text-inherit w-3 h-3" })
|
|
1883
1886
|
]
|
|
1884
1887
|
}
|
|
1885
1888
|
) }),
|
|
1886
|
-
/* @__PURE__ */ e.jsx(Z, { children: Y(
|
|
1889
|
+
/* @__PURE__ */ e.jsx(Z, { children: Y(le(y)) })
|
|
1887
1890
|
] }) }))
|
|
1888
1891
|
) })
|
|
1889
1892
|
] }),
|
|
1890
1893
|
/* @__PURE__ */ e.jsx("div", { className: "mt-0 flex items-center", children: /* @__PURE__ */ e.jsx(
|
|
1891
1894
|
Re,
|
|
1892
1895
|
{
|
|
1893
|
-
type:
|
|
1896
|
+
type: l,
|
|
1894
1897
|
units: [...d],
|
|
1895
1898
|
label: "",
|
|
1896
1899
|
property: i,
|
|
@@ -1900,43 +1903,43 @@ const Qr = (r) => {
|
|
|
1900
1903
|
]
|
|
1901
1904
|
}
|
|
1902
1905
|
);
|
|
1903
|
-
},
|
|
1904
|
-
const { t } = K(), o =
|
|
1906
|
+
}, dl = ({ heading: r, items: s }) => {
|
|
1907
|
+
const { t } = K(), o = xe(), l = _(() => {
|
|
1905
1908
|
const d = (i) => U(
|
|
1906
1909
|
i.map((p) => p.styleType === "multiple" ? C(p.options, "key") : p.property)
|
|
1907
1910
|
), a = U(
|
|
1908
|
-
|
|
1911
|
+
s.map((i) => i.styleType === "accordion" ? d(i.items) : i.styleType === "multiple" ? C(i.options, "key") : i.property)
|
|
1909
1912
|
), c = C(o, "property");
|
|
1910
1913
|
return Ye(a, c).length > 0;
|
|
1911
|
-
}, [o,
|
|
1914
|
+
}, [o, s]);
|
|
1912
1915
|
return /* @__PURE__ */ e.jsxs("details", { children: [
|
|
1913
1916
|
/* @__PURE__ */ e.jsx("summary", { className: "my-px cursor-default rounded-md bg-background p-px px-2 text-[11px] text-foreground", children: /* @__PURE__ */ e.jsxs("div", { className: "inline", children: [
|
|
1914
1917
|
t(r),
|
|
1915
|
-
|
|
1918
|
+
l ? /* @__PURE__ */ e.jsx(
|
|
1916
1919
|
"span",
|
|
1917
1920
|
{
|
|
1918
|
-
className: `ml-1 mr-2 inline-block h-[8px] w-[8px] rounded-full ${
|
|
1921
|
+
className: `ml-1 mr-2 inline-block h-[8px] w-[8px] rounded-full ${l ? "bg-blue-500" : "bg-gray-300"}`
|
|
1919
1922
|
}
|
|
1920
1923
|
) : null
|
|
1921
1924
|
] }) }),
|
|
1922
|
-
/* @__PURE__ */ e.jsx("div", { className: "p-2", children:
|
|
1925
|
+
/* @__PURE__ */ e.jsx("div", { className: "p-2", children: s.map((d) => d.styleType === "multiple" ? /* @__PURE__ */ e.jsx(it, { ...d }, d.label) : /* @__PURE__ */ e.jsx(Re, { ...d }, d.label)) })
|
|
1923
1926
|
] });
|
|
1924
|
-
},
|
|
1925
|
-
const { t:
|
|
1927
|
+
}, cl = Oe({}), me = ({ section: r }) => {
|
|
1928
|
+
const { t: s } = K(), t = xe(), o = B(
|
|
1926
1929
|
(a = []) => {
|
|
1927
1930
|
const c = {};
|
|
1928
1931
|
for (let p = 0; p < t.length; p++)
|
|
1929
1932
|
c[t[p].property] = t[p].cls;
|
|
1930
1933
|
let i = !0;
|
|
1931
1934
|
for (const p in a)
|
|
1932
|
-
if (!
|
|
1935
|
+
if (!he(c, p) || c[p] !== a[p]) {
|
|
1933
1936
|
i = !1;
|
|
1934
1937
|
break;
|
|
1935
1938
|
}
|
|
1936
1939
|
return i;
|
|
1937
1940
|
},
|
|
1938
1941
|
[t]
|
|
1939
|
-
),
|
|
1942
|
+
), l = _(() => {
|
|
1940
1943
|
if (t.length > 0 && r.heading === "classes.heading")
|
|
1941
1944
|
return !0;
|
|
1942
1945
|
const a = (p) => U(
|
|
@@ -1946,27 +1949,27 @@ const Qr = (r) => {
|
|
|
1946
1949
|
), i = C(t, "property");
|
|
1947
1950
|
return Ye(c, i).length > 0;
|
|
1948
1951
|
}, [t, r.heading, r.items]), d = _(() => ({}), []);
|
|
1949
|
-
return /* @__PURE__ */ e.jsx(
|
|
1952
|
+
return /* @__PURE__ */ e.jsx(cl.Provider, { value: d, children: /* @__PURE__ */ e.jsxs(de, { value: r.heading, children: [
|
|
1950
1953
|
/* @__PURE__ */ e.jsx(ce, { className: "px-3 py-2 text-xs hover:no-underline", children: /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-x-2", children: [
|
|
1951
|
-
/* @__PURE__ */ e.jsx("div", { className: `h-[8px] w-[8px] rounded-full ${
|
|
1952
|
-
|
|
1954
|
+
/* @__PURE__ */ e.jsx("div", { className: `h-[8px] w-[8px] rounded-full ${l ? "bg-blue-500" : "bg-gray-300"}` }),
|
|
1955
|
+
s(r.heading)
|
|
1953
1956
|
] }) }),
|
|
1954
1957
|
/* @__PURE__ */ e.jsx(pe, { className: "bg-gray-100 px-3.5 py-2", children: $.Children.toArray(
|
|
1955
|
-
r.items.map((a) =>
|
|
1958
|
+
r.items.map((a) => he(a, "component") ? $.createElement(a.component, { key: a.label }) : he(a, "styleType") ? a.styleType === "multiple" ? /* @__PURE__ */ e.jsx(it, { ...a }, a.label) : a.styleType === "accordion" && o(a == null ? void 0 : a.conditions) ? /* @__PURE__ */ e.jsx(dl, { ...a }, a.label) : null : /* @__PURE__ */ e.jsx(Re, { ...a }, a.label))
|
|
1956
1959
|
) })
|
|
1957
1960
|
] }) });
|
|
1958
|
-
},
|
|
1961
|
+
}, pl = ({
|
|
1959
1962
|
item: r,
|
|
1960
|
-
index:
|
|
1963
|
+
index: s,
|
|
1961
1964
|
canDelete: t,
|
|
1962
1965
|
onChange: o,
|
|
1963
|
-
onRemove:
|
|
1966
|
+
onRemove: l
|
|
1964
1967
|
}) => /* @__PURE__ */ e.jsxs("div", { className: `flex flex-col gap-1 border-gray-400 py-2 ${t ? "border-b" : ""}`, children: [
|
|
1965
1968
|
/* @__PURE__ */ e.jsx(
|
|
1966
1969
|
"input",
|
|
1967
1970
|
{
|
|
1968
1971
|
name: "key",
|
|
1969
|
-
onChange: (d) => o(d,
|
|
1972
|
+
onChange: (d) => o(d, s),
|
|
1970
1973
|
value: r.key,
|
|
1971
1974
|
placeholder: "Key",
|
|
1972
1975
|
className: "w-full rounded border-gray-300 bg-background p-0.5 pl-2 text-sm focus-visible:outline-0",
|
|
@@ -1979,7 +1982,7 @@ const Qr = (r) => {
|
|
|
1979
1982
|
"input",
|
|
1980
1983
|
{
|
|
1981
1984
|
name: "value",
|
|
1982
|
-
onChange: (d) => m(r.key) ? {} : o(d,
|
|
1985
|
+
onChange: (d) => m(r.key) ? {} : o(d, s),
|
|
1983
1986
|
value: r.value,
|
|
1984
1987
|
placeholder: "Value",
|
|
1985
1988
|
className: "w-full rounded border-gray-300 bg-background p-0.5 pl-2 text-sm focus-visible:outline-0",
|
|
@@ -1988,22 +1991,22 @@ const Qr = (r) => {
|
|
|
1988
1991
|
}
|
|
1989
1992
|
),
|
|
1990
1993
|
/* @__PURE__ */ e.jsx(
|
|
1991
|
-
|
|
1994
|
+
zt,
|
|
1992
1995
|
{
|
|
1993
|
-
onClick:
|
|
1996
|
+
onClick: l,
|
|
1994
1997
|
className: "h-6 w-6 cursor-pointer rounded border border-red-400 p-1 text-red-400 hover:opacity-80"
|
|
1995
1998
|
}
|
|
1996
1999
|
)
|
|
1997
2000
|
] })
|
|
1998
|
-
] }),
|
|
2001
|
+
] }), ul = ({ section: r }) => {
|
|
1999
2002
|
var y;
|
|
2000
|
-
const { setSyncState:
|
|
2003
|
+
const { setSyncState: s } = yr(), t = q(), [o, l] = j([]), [d] = Se(), a = Ue(), c = `${g(d, "0.prop")}_attrs`;
|
|
2001
2004
|
ne.useEffect(() => {
|
|
2002
2005
|
const x = C(g(t, c), (u, f) => ({ key: f, value: u }));
|
|
2003
|
-
m(x) ?
|
|
2006
|
+
m(x) ? l([]) : l(x);
|
|
2004
2007
|
}, [g(t, c)]);
|
|
2005
|
-
const i = () =>
|
|
2006
|
-
const u =
|
|
2008
|
+
const i = () => l([...o, { key: "", value: "" }]), p = (x) => {
|
|
2009
|
+
const u = we(o, (f, k) => x !== k);
|
|
2007
2010
|
n(u);
|
|
2008
2011
|
}, h = (x, u) => {
|
|
2009
2012
|
const f = [...o];
|
|
@@ -2011,11 +2014,11 @@ const Qr = (r) => {
|
|
|
2011
2014
|
}, n = ne.useCallback(
|
|
2012
2015
|
(x = []) => {
|
|
2013
2016
|
const u = {};
|
|
2014
|
-
|
|
2017
|
+
ke(x, (f) => {
|
|
2015
2018
|
m(f.key) || Me(u, f.key, f.value);
|
|
2016
|
-
}), a([g(t, "_id")], { [c]: u }),
|
|
2019
|
+
}), a([g(t, "_id")], { [c]: u }), s("UNSAVED");
|
|
2017
2020
|
},
|
|
2018
|
-
[t,
|
|
2021
|
+
[t, s, a, c]
|
|
2019
2022
|
);
|
|
2020
2023
|
return /* @__PURE__ */ e.jsxs(de, { value: r.heading, children: [
|
|
2021
2024
|
/* @__PURE__ */ e.jsx(ce, { className: "px-3 py-2 text-xs hover:no-underline", children: /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-x-2", children: [
|
|
@@ -2033,10 +2036,10 @@ const Qr = (r) => {
|
|
|
2033
2036
|
/* @__PURE__ */ e.jsxs(
|
|
2034
2037
|
"div",
|
|
2035
2038
|
{
|
|
2036
|
-
className: `flex h-6 w-max items-center justify-center gap-x-0.5 rounded-full border p-1 px-2 text-xs ${!m(o) && m((y =
|
|
2039
|
+
className: `flex h-6 w-max items-center justify-center gap-x-0.5 rounded-full border p-1 px-2 text-xs ${!m(o) && m((y = ve(o)) == null ? void 0 : y.key) ? "cursor-not-allowed border-gray-400 text-gray-400" : "cursor-pointer border-blue-400 text-blue-400 hover:bg-blue-400 hover:text-white"}`,
|
|
2037
2040
|
onClick: () => {
|
|
2038
2041
|
var x;
|
|
2039
|
-
!m(o) && m((x =
|
|
2042
|
+
!m(o) && m((x = ve(o)) == null ? void 0 : x.key) || i();
|
|
2040
2043
|
},
|
|
2041
2044
|
children: [
|
|
2042
2045
|
/* @__PURE__ */ e.jsx(Ne, { width: 12, height: 12 }),
|
|
@@ -2051,7 +2054,7 @@ const Qr = (r) => {
|
|
|
2051
2054
|
C(o, (x, u) => {
|
|
2052
2055
|
const f = o.length > 0 && u < o.length - 1;
|
|
2053
2056
|
return /* @__PURE__ */ e.jsx(
|
|
2054
|
-
|
|
2057
|
+
pl,
|
|
2055
2058
|
{
|
|
2056
2059
|
item: x,
|
|
2057
2060
|
index: u,
|
|
@@ -2066,8 +2069,8 @@ const Qr = (r) => {
|
|
|
2066
2069
|
] }) })
|
|
2067
2070
|
] });
|
|
2068
2071
|
};
|
|
2069
|
-
function
|
|
2070
|
-
const [r,
|
|
2072
|
+
function gl() {
|
|
2073
|
+
const [r, s] = Qe(), { flexChild: t, gridChild: o } = hr(), [, l] = Hr(br), { t: d } = K(), [a] = Se();
|
|
2071
2074
|
return m(a) ? /* @__PURE__ */ e.jsx("div", { className: "p-4 text-center", children: /* @__PURE__ */ e.jsxs("div", { className: "space-y-4 rounded-xl p-4", children: [
|
|
2072
2075
|
/* @__PURE__ */ e.jsx(Ze, { className: "mx-auto text-3xl" }),
|
|
2073
2076
|
/* @__PURE__ */ e.jsx("h1", { children: d("no_styling_block_selected") }),
|
|
@@ -2079,12 +2082,12 @@ function us() {
|
|
|
2079
2082
|
] })
|
|
2080
2083
|
] }) }) : (
|
|
2081
2084
|
// eslint-disable-next-line jsx-a11y/click-events-have-key-events,jsx-a11y/no-static-element-interactions
|
|
2082
|
-
/* @__PURE__ */ e.jsxs("div", { onClick: () =>
|
|
2085
|
+
/* @__PURE__ */ e.jsxs("div", { onClick: () => l(!1), className: "flex h-full flex-col", children: [
|
|
2083
2086
|
/* @__PURE__ */ e.jsx("div", { className: "flex flex-col space-x-4 space-y-3 border-b h-12 border-border px-4 py-1", children: /* @__PURE__ */ e.jsxs("div", { className: "flex items-center justify-end gap-x-1.5", children: [
|
|
2084
2087
|
/* @__PURE__ */ e.jsx(Te, { htmlFor: "", className: "flex gap-x-1.5 text-xs italic", children: "State" }),
|
|
2085
|
-
/* @__PURE__ */ e.jsxs(
|
|
2086
|
-
/* @__PURE__ */ e.jsx(
|
|
2087
|
-
/* @__PURE__ */ e.jsxs(
|
|
2088
|
+
/* @__PURE__ */ e.jsxs(mr, { defaultValue: r, onValueChange: (c) => s(c), children: [
|
|
2089
|
+
/* @__PURE__ */ e.jsx(fr, { className: "h-auto w-fit p-1 px-3", children: /* @__PURE__ */ e.jsx(vr, { placeholder: "State" }) }),
|
|
2090
|
+
/* @__PURE__ */ e.jsxs(wr, { children: [
|
|
2088
2091
|
/* @__PURE__ */ e.jsx(V, { value: "", children: "Normal" }),
|
|
2089
2092
|
/* @__PURE__ */ e.jsx(V, { value: "hover", children: "Hover" }),
|
|
2090
2093
|
/* @__PURE__ */ e.jsx(V, { value: "active", children: "Active" }),
|
|
@@ -2101,15 +2104,15 @@ function us() {
|
|
|
2101
2104
|
] })
|
|
2102
2105
|
] }) }),
|
|
2103
2106
|
/* @__PURE__ */ e.jsx(et, { className: "no-scrollbar -mx-1 flex-1 max-h-full overflow-y-hidden overflow-x-hidden", children: /* @__PURE__ */ e.jsxs(Ke, { defaultValue: ["Layout"], type: "multiple", className: "w-full", children: [
|
|
2104
|
-
t && /* @__PURE__ */ e.jsx(
|
|
2105
|
-
o ? /* @__PURE__ */ e.jsx(
|
|
2106
|
-
|
|
2107
|
-
/* @__PURE__ */ e.jsx(
|
|
2107
|
+
t && /* @__PURE__ */ e.jsx(me, { section: Xr }),
|
|
2108
|
+
o ? /* @__PURE__ */ e.jsx(me, { section: Zr }) : null,
|
|
2109
|
+
Wr.map((c) => /* @__PURE__ */ e.jsx(me, { section: c }, c.heading)),
|
|
2110
|
+
/* @__PURE__ */ e.jsx(ul, { section: { heading: "Attributes" } })
|
|
2108
2111
|
] }) })
|
|
2109
2112
|
] })
|
|
2110
2113
|
);
|
|
2111
2114
|
}
|
|
2112
|
-
const
|
|
2115
|
+
const xl = {
|
|
2113
2116
|
px: 1,
|
|
2114
2117
|
"%": 1,
|
|
2115
2118
|
em: 100,
|
|
@@ -2120,8 +2123,8 @@ const gs = {
|
|
|
2120
2123
|
"-": 1,
|
|
2121
2124
|
deg: 1,
|
|
2122
2125
|
ms: 0.1
|
|
2123
|
-
},
|
|
2124
|
-
const r = q(), { t:
|
|
2126
|
+
}, fs = () => {
|
|
2127
|
+
const r = q(), { t: s } = K(), [t, o] = $.useState(""), [l, d] = $.useState({
|
|
2125
2128
|
onDrag: (i) => i,
|
|
2126
2129
|
onDragEnd: (i) => i,
|
|
2127
2130
|
dragStartY: 0,
|
|
@@ -2130,20 +2133,20 @@ const gs = {
|
|
|
2130
2133
|
dragUnit: "",
|
|
2131
2134
|
negative: !1,
|
|
2132
2135
|
cssProperty: ""
|
|
2133
|
-
}), a =
|
|
2136
|
+
}), a = fe(
|
|
2134
2137
|
(i) => {
|
|
2135
|
-
const p = !g(
|
|
2136
|
-
let n = parseFloat(
|
|
2138
|
+
const p = !g(l, "negative", !1), h = g(l, "cssProperty", "");
|
|
2139
|
+
let n = parseFloat(l.dragStartValue);
|
|
2137
2140
|
n = ze(n) ? 0 : n;
|
|
2138
|
-
let y =
|
|
2141
|
+
let y = xl[l.dragUnit];
|
|
2139
2142
|
(W(h, "scale") || h === "opacity") && (y = 10);
|
|
2140
|
-
let u = (
|
|
2141
|
-
p && u < 0 && (u = 0), h === "opacity" && u > 1 && (u = 1),
|
|
2143
|
+
let u = (l.dragStartY - i.pageY) / y + n;
|
|
2144
|
+
p && u < 0 && (u = 0), h === "opacity" && u > 1 && (u = 1), l.onDrag(`${u}`), o(`${u}`);
|
|
2142
2145
|
},
|
|
2143
|
-
[
|
|
2146
|
+
[l],
|
|
2144
2147
|
50
|
|
2145
2148
|
), c = B(() => {
|
|
2146
|
-
setTimeout(() =>
|
|
2149
|
+
setTimeout(() => l.onDragEnd(`${t}`), 100), d({
|
|
2147
2150
|
onDrag: (i) => i,
|
|
2148
2151
|
onDragEnd: (i) => i,
|
|
2149
2152
|
dragStartY: 0,
|
|
@@ -2153,12 +2156,12 @@ const gs = {
|
|
|
2153
2156
|
negative: !1,
|
|
2154
2157
|
cssProperty: ""
|
|
2155
2158
|
});
|
|
2156
|
-
}, [
|
|
2157
|
-
return
|
|
2159
|
+
}, [l, t, d]);
|
|
2160
|
+
return Ct(r) ? /* @__PURE__ */ e.jsx("div", { className: "p-4 text-center", children: /* @__PURE__ */ e.jsxs("div", { className: "space-y-4 rounded-xl p-4", children: [
|
|
2158
2161
|
/* @__PURE__ */ e.jsx(Ze, { className: "mx-auto text-3xl" }),
|
|
2159
|
-
/* @__PURE__ */ e.jsx("h1", { children:
|
|
2162
|
+
/* @__PURE__ */ e.jsx("h1", { children: s("no_block_selected_for_styling") })
|
|
2160
2163
|
] }) }) : /* @__PURE__ */ e.jsx(rt, { children: /* @__PURE__ */ e.jsxs(nt.Provider, { value: { setDragData: d }, children: [
|
|
2161
|
-
|
|
2164
|
+
l.dragging ? /* @__PURE__ */ e.jsx(
|
|
2162
2165
|
"div",
|
|
2163
2166
|
{
|
|
2164
2167
|
onMouseMove: a,
|
|
@@ -2166,23 +2169,23 @@ const gs = {
|
|
|
2166
2169
|
className: "absolute inset-0 z-30 cursor-row-resize bg-gray-300/10 "
|
|
2167
2170
|
}
|
|
2168
2171
|
) : null,
|
|
2169
|
-
/* @__PURE__ */ e.jsxs(
|
|
2170
|
-
/* @__PURE__ */ e.jsxs(
|
|
2171
|
-
/* @__PURE__ */ e.jsx(De, { value: "settings", children:
|
|
2172
|
-
/* @__PURE__ */ e.jsx(De, { value: "styling", children:
|
|
2172
|
+
/* @__PURE__ */ e.jsxs(jr, { defaultValue: "settings", className: "flex h-full w-full flex-col py-1", children: [
|
|
2173
|
+
/* @__PURE__ */ e.jsxs(Cr, { className: "mx-1 grid grid-cols-2", children: [
|
|
2174
|
+
/* @__PURE__ */ e.jsx(De, { value: "settings", children: s("settings") }),
|
|
2175
|
+
/* @__PURE__ */ e.jsx(De, { value: "styling", children: s("styling") })
|
|
2173
2176
|
] }),
|
|
2174
2177
|
/* @__PURE__ */ e.jsx(
|
|
2175
2178
|
$e,
|
|
2176
2179
|
{
|
|
2177
2180
|
value: "settings",
|
|
2178
2181
|
className: "no-scrollbar -mx-1 -mr-2 h-full flex-1 overflow-y-auto overflow-x-hidden",
|
|
2179
|
-
children: /* @__PURE__ */ e.jsx(et, { className: "no-scrollbar -mx-1 pb-5 flex-1 max-h-full overflow-y-hidden overflow-x-hidden", children: /* @__PURE__ */ e.jsx(
|
|
2182
|
+
children: /* @__PURE__ */ e.jsx(et, { className: "no-scrollbar -mx-1 pb-5 flex-1 max-h-full overflow-y-hidden overflow-x-hidden", children: /* @__PURE__ */ e.jsx(Yr, {}) })
|
|
2180
2183
|
}
|
|
2181
2184
|
),
|
|
2182
|
-
/* @__PURE__ */ e.jsx($e, { value: "styling", className: "flex-1 h-full overflow-y-auto overflow-x-hidden", children: /* @__PURE__ */ e.jsx(
|
|
2185
|
+
/* @__PURE__ */ e.jsx($e, { value: "styling", className: "flex-1 h-full overflow-y-auto overflow-x-hidden", children: /* @__PURE__ */ e.jsx(gl, {}) })
|
|
2183
2186
|
] })
|
|
2184
2187
|
] }) });
|
|
2185
2188
|
};
|
|
2186
2189
|
export {
|
|
2187
|
-
|
|
2190
|
+
fs as default
|
|
2188
2191
|
};
|