@chaibuilder/sdk 1.2.10 → 1.2.11
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/README.md +10 -12
- package/dist/AddBlocks-TSt8uJY4.js +218 -0
- package/dist/AddBlocks-k2p8Hy1n.cjs +1 -0
- package/dist/BrandingOptions-WyVWfFVz.cjs +1 -0
- package/dist/{BrandingOptions-10jJO8mG.js → BrandingOptions-uFTyYJZj.js} +18 -21
- package/dist/{CanvasArea-6O8dMPug.cjs → CanvasArea-5erOZYLy.cjs} +4 -4
- package/dist/{CanvasArea-jgBDM5Qd.js → CanvasArea-iRQqpOak.js} +187 -188
- package/dist/{utils-AvyFzbPC.js → Class-17XFhL48.js} +15 -16
- package/dist/Class-5ARpH_Tu.cjs +1 -0
- package/dist/CurrentPage-NzmJloN7.cjs +1 -0
- package/dist/{CurrentPage-lakeZviD.js → CurrentPage-RCxTz9Mc.js} +24 -25
- package/dist/{Layers-R7TfREUd.js → Layers-tXB5Pwid.js} +40 -41
- package/dist/Layers-xDG7oltg.cjs +1 -0
- package/dist/PagesPanel-72nzYB1k.cjs +1 -0
- package/dist/{PagesPanel-4mqxCFHq.js → PagesPanel-Jaz9jvye.js} +14 -15
- package/dist/{ProjectPanel-Wy2nw-1w.js → ProjectPanel--S014Xx3.js} +17 -18
- package/dist/ProjectPanel-RU0QvH6e.cjs +1 -0
- package/dist/Settings-5EuwaVb3.cjs +1 -0
- package/dist/{Settings-_K28Ontt.js → Settings-gjvl5V1k.js} +153 -154
- package/dist/{SidePanels-6slnxdSj.js → SidePanels-Fq3kRwR0.js} +37 -38
- package/dist/SidePanels-uNCxnGte.cjs +1 -0
- package/dist/Topbar-JqW89xI5.cjs +1 -0
- package/dist/{Topbar-bwt6HjlL.js → Topbar-m5dbbI1f.js} +14 -15
- package/dist/{UnsplashImages-V29UE-57.js → UnsplashImages-GhBD6owT.js} +28 -29
- package/dist/UnsplashImages-vACw5hbK.cjs +1 -0
- package/dist/UploadImages-PzHdEKHT.cjs +1 -0
- package/dist/{UploadImages-E0mi_qn8.js → UploadImages-S1HgxeGb.js} +23 -24
- package/dist/{add-page-modal-FJEAqfD3.js → add-page-modal-2P5hGXOQ.js} +19 -20
- package/dist/add-page-modal-GAizM2Jw.cjs +1 -0
- package/dist/{confirm-alert-5hfE116f.js → confirm-alert-57Xq5foA.js} +12 -13
- package/dist/confirm-alert-Uf84DpdR.cjs +1 -0
- package/dist/core.cjs +1 -1
- package/dist/core.d.ts +1 -50
- package/dist/core.js +45 -56
- package/dist/defaultTheme-IH19g4fv.cjs +1 -0
- package/dist/defaultTheme-YY8mlQS3.js +1055 -0
- package/dist/delete-page-modal-MG42FdnU.cjs +1 -0
- package/dist/{delete-page-modal-wH0yLiQI.js → delete-page-modal-ix5IjaFW.js} +14 -15
- package/dist/email-blocks.cjs +1 -1
- package/dist/email-blocks.js +100 -81
- package/dist/email.cjs +1 -0
- package/dist/email.d.ts +116 -0
- package/dist/email.js +79 -0
- package/dist/{controls-XPXGHKht.js → empty-slot-MWycClTb.js} +61 -50
- package/dist/empty-slot-TF2kd-0X.cjs +1 -0
- package/dist/{form-1j01gADS.cjs → form-KBb3kA8g.cjs} +1 -1
- package/dist/{form-UVHCD9N3.js → form-SYcFyACJ.js} +1 -1
- package/dist/{index-c2VLKuhY.js → index-Fj3ead-J.js} +5 -5
- package/dist/index-aiHDvS5v.cjs +1 -0
- package/dist/{index-xbQL0wpz.cjs → index-cM3eKmlx.cjs} +2 -2
- package/dist/{index-B4sL0YTN.js → index-pNYv0oAF.js} +1427 -1557
- package/dist/lib.cjs +3 -3
- package/dist/lib.js +95 -1125
- package/dist/page-viewer-Sh99FGYk.cjs +1 -0
- package/dist/{page-viewer-TcK0I240.js → page-viewer-VxqOevr4.js} +16 -17
- package/dist/project-general-setting-VTLHa-Ik.cjs +1 -0
- package/dist/{project-general-setting-4ruKl033.js → project-general-setting-nWOjPiin.js} +15 -16
- package/dist/{project-seo-setting-d1EZlacB.js → project-seo-setting-70bWTwsB.js} +14 -15
- package/dist/project-seo-setting-ENAKc2Dl.cjs +1 -0
- package/dist/render.cjs +1 -1
- package/dist/render.d.ts +2 -0
- package/dist/render.js +111 -70
- package/dist/{single-page-detail-PihQi-dP.js → single-page-detail-3z7TF-Yy.js} +44 -45
- package/dist/single-page-detail-6L38HJC4.cjs +1 -0
- package/dist/studio.cjs +1 -1
- package/dist/studio.js +13 -14
- package/dist/ui.cjs +1 -1
- package/dist/ui.d.ts +3 -3
- package/dist/ui.js +138 -139
- package/dist/{useAddBlockByDrop-nLzs79He.cjs → useAddBlockByDrop-7mUMwNSG.cjs} +1 -1
- package/dist/{useAddBlockByDrop-rcDR-z9_.js → useAddBlockByDrop-tjQ5DgiO.js} +1 -1
- package/dist/web-blocks.cjs +1 -1
- package/dist/web-blocks.js +313 -322
- package/package.json +8 -2
- package/dist/AddBlocks-GiMnBMeQ.js +0 -224
- package/dist/AddBlocks-SzURo9Bj.cjs +0 -1
- package/dist/BrandingOptions-yK-54R-c.cjs +0 -1
- package/dist/CurrentPage-1y62Ne77.cjs +0 -1
- package/dist/Layers-Z4nmm9xK.cjs +0 -1
- package/dist/PagesPanel-ouHdxyOH.cjs +0 -1
- package/dist/ProjectPanel-hHolYZjt.cjs +0 -1
- package/dist/Settings-EYOw02iE.cjs +0 -1
- package/dist/SidePanels-U-_O1QN8.cjs +0 -1
- package/dist/Topbar-dQEoY2P8.cjs +0 -1
- package/dist/UnsplashImages-pGgaUPQy.cjs +0 -1
- package/dist/UploadImages-7oLycdSh.cjs +0 -1
- package/dist/add-page-modal-In6XI-vZ.cjs +0 -1
- package/dist/confirm-alert-Vwd3OzL9.cjs +0 -1
- package/dist/controls-Dy1qa8Dc.cjs +0 -1
- package/dist/delete-page-modal-tl7FLK9J.cjs +0 -1
- package/dist/functions-Ox_svtKm.cjs +0 -1
- package/dist/functions-xIebp8Aw.js +0 -23
- package/dist/index-7ogwGh39.cjs +0 -1
- package/dist/page-viewer-SfQUe0SI.cjs +0 -1
- package/dist/project-general-setting-t7E2Y_w9.cjs +0 -1
- package/dist/project-seo-setting-4b_BJZDF.cjs +0 -1
- package/dist/single-page-detail-KuXd9Mur.cjs +0 -1
- package/dist/utils-PTxFk6qT.cjs +0 -1
|
@@ -1,24 +1,28 @@
|
|
|
1
1
|
import { j as e } from "./jsx-runtime-WbnYoNE9.js";
|
|
2
2
|
import * as ne from "react";
|
|
3
|
-
import
|
|
3
|
+
import P, { useState as C, useMemo as _, useEffect as O, useCallback as V, memo as dt, createContext as Me, useContext as se } from "react";
|
|
4
4
|
import { useThrottledCallback as fe } from "@react-hookz/web";
|
|
5
|
-
import { forEach as ke, isArray as ie, omit as ct, truncate as pt, includes as E, get as x, first as ue, split as ut, startCase as
|
|
5
|
+
import { forEach as ke, isArray as ie, omit as ct, truncate as pt, includes as E, get as x, first as ue, split as ut, startCase as F, toLower as le, isEmpty as f, map as k, find as xt, last as ve, filter as we, set as Oe, debounce as gt, keys as ht, cloneDeep as yt, each as mt, capitalize as bt, reject as ft, nth as Ve, startsWith as W, isNumber as vt, parseInt as wt, isNaN as Ye, findLast as jt, flatten as U, intersection as Fe, has as ye, isNull as Ct } from "lodash-es";
|
|
6
6
|
import { useTranslation as K } from "react-i18next";
|
|
7
|
-
import { PlusIcon as Ne, Cross2Icon as Xe, EyeOpenIcon as kt, EyeClosedIcon as He, BorderAllIcon as A, 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
|
|
8
|
-
import {
|
|
9
|
-
import { u as _r } from "./
|
|
7
|
+
import { PlusIcon as Ne, Cross2Icon as Xe, EyeOpenIcon as kt, EyeClosedIcon as He, BorderAllIcon as A, 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 Et, BoxIcon as ze, RowSpacingIcon as Lt, TriangleDownIcon as Mt, CrossCircledIcon as Ot, TrashIcon as Yt, MixerHorizontalIcon as Ze } from "@radix-ui/react-icons";
|
|
8
|
+
import { aS as Ft, aT as Xt, B as xe, aU as zt, aV as Zt, aW as Wt, aX as Ut, aY as Kt, aZ as qt, a_ as Gt, $ as q, ae as Jt, af as Qt, ag as er, a$ as tr, ac as rr, b0 as lr, ad as sr, au as X, av as z, aw as Z, b1 as or, b2 as ar, b3 as nr, b4 as ir, b5 as dr, b6 as cr, a4 as We, a3 as pr, i as ur, b7 as Ue, b8 as de, b9 as ce, ba as pe, ab as Se, L as Ke, Y as qe, j as Ge, ay as Te, bb as xr, m as gr, bc as hr, Z as ge, R as yr, a2 as Je, M as Be, a8 as mr, a5 as br, bd as fr, ai as vr, aj as wr, ak as jr, al as Cr, am as H, be as Qe, ao as kr, ap as Nr, aq as De, ar as $e } from "./index-pNYv0oAF.js";
|
|
9
|
+
import { u as _r } from "./empty-slot-MWycClTb.js";
|
|
10
10
|
import { Check as Sr, EditIcon as Tr, TrashIcon as Rr } from "lucide-react";
|
|
11
11
|
import { getBlockComponent as et, getChaiDataProviders as Vr } from "@chaibuilder/runtime";
|
|
12
|
-
import { E as tt, u as rt } from "./index-
|
|
12
|
+
import { E as tt, u as rt } from "./index-Fj3ead-J.js";
|
|
13
13
|
import { J as Hr, a as Br, d as Dr } from "./index-e0c8PmRQ.js";
|
|
14
|
-
import
|
|
15
|
-
import
|
|
16
|
-
import { useAtom as
|
|
14
|
+
import $r from "@rjsf/core";
|
|
15
|
+
import Ir from "@rjsf/validator-ajv8";
|
|
16
|
+
import { useAtom as Pr } from "jotai";
|
|
17
17
|
import Ar from "react-autosuggest";
|
|
18
18
|
import Er from "fuse.js";
|
|
19
|
-
import { A as Lr, C as he, g as Mr } from "./
|
|
19
|
+
import { A as Lr, C as he, g as Mr } from "./Class-17XFhL48.js";
|
|
20
20
|
import { a as Or } from "./MODIFIERS-RiXS5Mn1.js";
|
|
21
21
|
import "./_commonjsHelpers-UyOWmZb0.js";
|
|
22
|
+
import "./Functions-7jnEwJyw.js";
|
|
23
|
+
import "clsx";
|
|
24
|
+
import "tailwind-merge";
|
|
25
|
+
import "flat-to-nested";
|
|
22
26
|
import "@radix-ui/react-toggle";
|
|
23
27
|
import "class-variance-authority";
|
|
24
28
|
import "@radix-ui/react-switch";
|
|
@@ -42,11 +46,6 @@ import "@radix-ui/react-context-menu";
|
|
|
42
46
|
import "react-icons-picker";
|
|
43
47
|
import "react-dom";
|
|
44
48
|
import "react-quill";
|
|
45
|
-
import "flat-to-nested";
|
|
46
|
-
import "./Functions-7jnEwJyw.js";
|
|
47
|
-
import "clsx";
|
|
48
|
-
import "tailwind-merge";
|
|
49
|
-
import "redux-undo";
|
|
50
49
|
import "i18next";
|
|
51
50
|
import "@floating-ui/react-dom";
|
|
52
51
|
import "react-textarea-autosize";
|
|
@@ -58,7 +57,7 @@ import "sonner";
|
|
|
58
57
|
import "./html-to-json-57841sEK.js";
|
|
59
58
|
import "himalaya";
|
|
60
59
|
import "./web-blocks.js";
|
|
61
|
-
function
|
|
60
|
+
function Yr(r) {
|
|
62
61
|
const o = [], t = {};
|
|
63
62
|
function s(l, d) {
|
|
64
63
|
ke(d, (a, c) => {
|
|
@@ -91,7 +90,7 @@ const je = ({ data: r, fullView: o }) => {
|
|
|
91
90
|
/* @__PURE__ */ e.jsx("span", { className: "font-medium text-gray-800/80", children: "Content: " }),
|
|
92
91
|
r
|
|
93
92
|
] }) : /* @__PURE__ */ e.jsx("div", { className: "w-full overflow-hidden whitespace-nowrap text-[10px] leading-3 text-gray-800/50", children: pt(t === "object" ? JSON.stringify(r) : r, { length: 40 }) });
|
|
94
|
-
},
|
|
93
|
+
}, Ie = ({
|
|
95
94
|
type: r,
|
|
96
95
|
value: o = "",
|
|
97
96
|
setValue: t,
|
|
@@ -100,15 +99,15 @@ const je = ({ data: r, fullView: o }) => {
|
|
|
100
99
|
dataType: d,
|
|
101
100
|
appliedBindings: a
|
|
102
101
|
}) => {
|
|
103
|
-
const { paths: c, pathsType: n } =
|
|
102
|
+
const { paths: c, pathsType: n } = Yr(s), u = r === "PROP" ? et(s == null ? void 0 : s._type) : {}, y = r === "PROP", [i, h] = C(!1), g = _(() => r === "PROP" ? c.filter(
|
|
104
103
|
(p) => !E(a, p) && x(u, `props.${ue(ut(p, "."))}.binding`)
|
|
105
104
|
) : c.filter((p) => d === x(n, p, "")), [r, c, a, d, u]);
|
|
106
105
|
return O(() => {
|
|
107
106
|
o && l(o);
|
|
108
107
|
}, [o, r]), /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
109
108
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-4", children: [
|
|
110
|
-
/* @__PURE__ */ e.jsx("p", { className: "text-sm text-muted-foreground", children:
|
|
111
|
-
/* @__PURE__ */ e.jsxs(
|
|
109
|
+
/* @__PURE__ */ e.jsx("p", { className: "text-sm text-muted-foreground", children: F(le(r)) }),
|
|
110
|
+
/* @__PURE__ */ e.jsxs(Ft, { open: i, onOpenChange: h, children: [
|
|
112
111
|
/* @__PURE__ */ e.jsx(Xt, { asChild: !0, children: /* @__PURE__ */ e.jsx(
|
|
113
112
|
xe,
|
|
114
113
|
{
|
|
@@ -117,13 +116,13 @@ const je = ({ data: r, fullView: o }) => {
|
|
|
117
116
|
className: ` ${f(o) ? "w-44 justify-center bg-blue-500 text-gray-100 hover:bg-blue-400 hover:text-white" : "min-w-[350px] items-center justify-between"}`,
|
|
118
117
|
children: o ? /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
119
118
|
/* @__PURE__ */ e.jsxs("span", { className: "pr-8 text-sm", children: [
|
|
120
|
-
y && /* @__PURE__ */ e.jsx("span", { className: "mr-2 rounded-full bg-purple-100 px-2 py-0.5 text-[10px] text-purple-500", children:
|
|
119
|
+
y && /* @__PURE__ */ e.jsx("span", { className: "mr-2 rounded-full bg-purple-100 px-2 py-0.5 text-[10px] text-purple-500", children: F(d) }),
|
|
121
120
|
o
|
|
122
121
|
] }),
|
|
123
122
|
/* @__PURE__ */ e.jsx("span", { className: "cursor-pointer text-[9px] text-blue-400 underline hover:text-blue-700", children: "Change" })
|
|
124
123
|
] }) : /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
125
124
|
"+ Set ",
|
|
126
|
-
|
|
125
|
+
F(le(r))
|
|
127
126
|
] })
|
|
128
127
|
}
|
|
129
128
|
) }),
|
|
@@ -136,15 +135,15 @@ const je = ({ data: r, fullView: o }) => {
|
|
|
136
135
|
{
|
|
137
136
|
value: p,
|
|
138
137
|
className: `cursor-pointer ${y ? "flex items-center justify-between" : "flex flex-col items-start justify-start"}`,
|
|
139
|
-
onSelect: (
|
|
140
|
-
t(xt(g, (w) => w ===
|
|
138
|
+
onSelect: (b) => {
|
|
139
|
+
t(xt(g, (w) => w === b) || null), h(!1);
|
|
141
140
|
},
|
|
142
141
|
children: [
|
|
143
142
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-x-2", children: [
|
|
144
143
|
/* @__PURE__ */ e.jsx(Sr, { className: `h-4 w-4 text-green-500 ${o === p ? "" : "opacity-0"}` }),
|
|
145
144
|
p
|
|
146
145
|
] }),
|
|
147
|
-
y ? /* @__PURE__ */ e.jsx("div", { children: /* @__PURE__ */ e.jsx("span", { className: "rounded-full bg-purple-100 px-2 py-0.5 text-[10px] text-purple-500", children:
|
|
146
|
+
y ? /* @__PURE__ */ e.jsx("div", { children: /* @__PURE__ */ e.jsx("span", { className: "rounded-full bg-purple-100 px-2 py-0.5 text-[10px] text-purple-500", children: F(x(n, p, "")) }) }) : /* @__PURE__ */ e.jsx("div", { className: "pl-6", children: /* @__PURE__ */ e.jsx(je, { data: x(s, p) }) })
|
|
148
147
|
]
|
|
149
148
|
},
|
|
150
149
|
p
|
|
@@ -155,7 +154,7 @@ const je = ({ data: r, fullView: o }) => {
|
|
|
155
154
|
] }),
|
|
156
155
|
!y && !f(o) && /* @__PURE__ */ e.jsx("div", { className: "pt-2", children: /* @__PURE__ */ e.jsx(je, { data: x(s, o, ""), fullView: !0 }) })
|
|
157
156
|
] });
|
|
158
|
-
},
|
|
157
|
+
}, Fr = ({
|
|
159
158
|
appliedBindings: r = [],
|
|
160
159
|
onAddBinding: o,
|
|
161
160
|
editMode: t,
|
|
@@ -166,10 +165,10 @@ const je = ({ data: r, fullView: o }) => {
|
|
|
166
165
|
if (f(g))
|
|
167
166
|
return "";
|
|
168
167
|
{
|
|
169
|
-
const
|
|
170
|
-
if (ie(
|
|
168
|
+
const b = x(p === "PROP" ? n : u, g, "");
|
|
169
|
+
if (ie(b))
|
|
171
170
|
return "list";
|
|
172
|
-
const w = typeof
|
|
171
|
+
const w = typeof b;
|
|
173
172
|
return w === "string" ? "text" : w === "object" ? "model" : w;
|
|
174
173
|
}
|
|
175
174
|
},
|
|
@@ -182,7 +181,7 @@ const je = ({ data: r, fullView: o }) => {
|
|
|
182
181
|
] }),
|
|
183
182
|
/* @__PURE__ */ e.jsxs("div", { className: "relative flex flex-col gap-1", children: [
|
|
184
183
|
/* @__PURE__ */ e.jsx(
|
|
185
|
-
|
|
184
|
+
Ie,
|
|
186
185
|
{
|
|
187
186
|
type: "PROP",
|
|
188
187
|
isDisabled: !1,
|
|
@@ -200,7 +199,7 @@ const je = ({ data: r, fullView: o }) => {
|
|
|
200
199
|
),
|
|
201
200
|
/* @__PURE__ */ e.jsx("div", { className: "h-2" }),
|
|
202
201
|
/* @__PURE__ */ e.jsx(
|
|
203
|
-
|
|
202
|
+
Ie,
|
|
204
203
|
{
|
|
205
204
|
type: "PATH",
|
|
206
205
|
isDisabled: f(l),
|
|
@@ -233,7 +232,7 @@ const je = ({ data: r, fullView: o }) => {
|
|
|
233
232
|
return /* @__PURE__ */ e.jsxs(rr, { children: [
|
|
234
233
|
/* @__PURE__ */ e.jsx(lr, { disabled: r, asChild: !0, onClick: () => c(!0), children: o }),
|
|
235
234
|
a && /* @__PURE__ */ e.jsx(sr, { children: /* @__PURE__ */ e.jsx(
|
|
236
|
-
|
|
235
|
+
Fr,
|
|
237
236
|
{
|
|
238
237
|
item: d,
|
|
239
238
|
editMode: l,
|
|
@@ -277,7 +276,7 @@ const je = ({ data: r, fullView: o }) => {
|
|
|
277
276
|
}
|
|
278
277
|
)
|
|
279
278
|
] }),
|
|
280
|
-
!f(a) && !f(r.key) && /* @__PURE__ */ e.jsx("div", { className: "absolute right-0 top-1 mt-px flex h-4 items-center rounded-full px-2 text-[10px] font-medium text-purple-600", children:
|
|
279
|
+
!f(a) && !f(r.key) && /* @__PURE__ */ e.jsx("div", { className: "absolute right-0 top-1 mt-px flex h-4 items-center rounded-full px-2 text-[10px] font-medium text-purple-600", children: F(a) })
|
|
281
280
|
] });
|
|
282
281
|
}, zr = ({ bindingData: r, onChange: o }) => {
|
|
283
282
|
const t = q(), [s] = rt(), l = Vr(), [d, a] = C(
|
|
@@ -348,7 +347,7 @@ const je = ({ data: r, fullView: o }) => {
|
|
|
348
347
|
c && /* @__PURE__ */ e.jsx(Z, { sideOffset: -55, className: "text-[11px]", children: f(s) ? "No data provider has been set up for this page." : "Complete last added data binding to add more" })
|
|
349
348
|
] })
|
|
350
349
|
] });
|
|
351
|
-
}, 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" }),
|
|
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" }), me = dt(({ properties: r, formData: o, onChange: t }) => {
|
|
352
351
|
const s = { type: "object", properties: {} }, l = {};
|
|
353
352
|
return Object.keys(r).forEach((d) => {
|
|
354
353
|
const a = r[d];
|
|
@@ -357,7 +356,7 @@ const je = ({ data: r, fullView: o }) => {
|
|
|
357
356
|
const c = d;
|
|
358
357
|
s.properties[c] = or(a), l[c] = ar(a);
|
|
359
358
|
}), /* @__PURE__ */ e.jsx(
|
|
360
|
-
|
|
359
|
+
$r,
|
|
361
360
|
{
|
|
362
361
|
widgets: {
|
|
363
362
|
binding: Zr,
|
|
@@ -371,7 +370,7 @@ const je = ({ data: r, fullView: o }) => {
|
|
|
371
370
|
omitExtraData: !1,
|
|
372
371
|
liveOmit: !1,
|
|
373
372
|
liveValidate: !1,
|
|
374
|
-
validator:
|
|
373
|
+
validator: Ir,
|
|
375
374
|
uiSchema: l,
|
|
376
375
|
schema: s,
|
|
377
376
|
formData: o,
|
|
@@ -380,20 +379,20 @@ const je = ({ data: r, fullView: o }) => {
|
|
|
380
379
|
);
|
|
381
380
|
});
|
|
382
381
|
function Wr() {
|
|
383
|
-
const r = q(), o = We(), t = pr(), s = et(r._type), l = { ...r }, [d, a] = C(l), c = ur("dataBindingSupport", !1), n = ({ formData: p },
|
|
384
|
-
if (
|
|
385
|
-
const D =
|
|
382
|
+
const r = q(), o = We(), t = pr(), s = et(r._type), l = { ...r }, [d, a] = C(l), c = ur("dataBindingSupport", !1), n = ({ formData: p }, b, w) => {
|
|
383
|
+
if (b) {
|
|
384
|
+
const D = b.replace("root.", "");
|
|
386
385
|
t([r._id], { [D]: x(p, D) }, w);
|
|
387
386
|
}
|
|
388
387
|
}, u = V(
|
|
389
|
-
gt(({ formData: p },
|
|
390
|
-
n({ formData: p },
|
|
388
|
+
gt(({ formData: p }, b, w) => {
|
|
389
|
+
n({ formData: p }, b, w), a(p);
|
|
391
390
|
}, 1500),
|
|
392
391
|
[]
|
|
393
|
-
), y = ({ formData: p },
|
|
394
|
-
if (
|
|
395
|
-
const w =
|
|
396
|
-
o([r._id], { [w]: x(p, w) }), u({ formData: p },
|
|
392
|
+
), y = ({ formData: p }, b) => {
|
|
393
|
+
if (b) {
|
|
394
|
+
const w = b.replace("root.", "");
|
|
395
|
+
o([r._id], { [w]: x(p, w) }), u({ formData: p }, b, { [w]: x(d, w) });
|
|
397
396
|
}
|
|
398
397
|
}, i = {
|
|
399
398
|
_name: _r({
|
|
@@ -402,10 +401,10 @@ function Wr() {
|
|
|
402
401
|
})
|
|
403
402
|
}, h = ht(x(l, "_bindings", {})), g = _(() => {
|
|
404
403
|
const p = yt(x(s, "props", {}));
|
|
405
|
-
return c &&
|
|
404
|
+
return c && mt(h, (b) => delete p[b]), p;
|
|
406
405
|
}, [s, h, c]);
|
|
407
406
|
return /* @__PURE__ */ e.jsxs("div", { className: "overflow-x-hidden", children: [
|
|
408
|
-
/* @__PURE__ */ e.jsx(
|
|
407
|
+
/* @__PURE__ */ e.jsx(me, { onChange: y, formData: l, properties: i }),
|
|
409
408
|
/* @__PURE__ */ e.jsx("hr", { className: "mt-4" }),
|
|
410
409
|
c ? /* @__PURE__ */ e.jsxs(Ue, { type: "multiple", defaultValue: ["STATIC", "BINDING"], className: "h-full w-full", children: [
|
|
411
410
|
/* @__PURE__ */ e.jsxs(de, { value: "BINDING", children: [
|
|
@@ -436,19 +435,19 @@ function Wr() {
|
|
|
436
435
|
/* @__PURE__ */ e.jsxs(pe, { className: "pt-4", children: [
|
|
437
436
|
f(h) ? null : /* @__PURE__ */ e.jsxs("div", { className: "mx-4 mb-1 mt-0 rounded-sm border border-orange-500 bg-orange-100 p-1 text-xs text-orange-500", children: [
|
|
438
437
|
"Data binding is set for ",
|
|
439
|
-
/* @__PURE__ */ e.jsx("b", { children: k(h,
|
|
438
|
+
/* @__PURE__ */ e.jsx("b", { children: k(h, bt).join(", ") }),
|
|
440
439
|
" ",
|
|
441
440
|
h.length === 1 ? "property" : "properties",
|
|
442
441
|
". Remove data binding to edit static content."
|
|
443
442
|
] }),
|
|
444
|
-
/* @__PURE__ */ e.jsx(
|
|
443
|
+
/* @__PURE__ */ e.jsx(me, { onChange: y, formData: l, properties: g })
|
|
445
444
|
] })
|
|
446
445
|
] })
|
|
447
|
-
] }) : /* @__PURE__ */ e.jsx(
|
|
446
|
+
] }) : /* @__PURE__ */ e.jsx(me, { onChange: y, formData: l, properties: g }),
|
|
448
447
|
/* @__PURE__ */ e.jsx("div", { className: "pb-60" })
|
|
449
448
|
] });
|
|
450
449
|
}
|
|
451
|
-
const
|
|
450
|
+
const Pe = new Er(Lr, {
|
|
452
451
|
isCaseSensitive: !1,
|
|
453
452
|
threshold: 0.2,
|
|
454
453
|
minMatchCharLength: 2,
|
|
@@ -460,20 +459,20 @@ function Ur() {
|
|
|
460
459
|
const j = d.trim().toLowerCase().replace(/ +(?= )/g, "").split(" ");
|
|
461
460
|
t(l, j, !0), a("");
|
|
462
461
|
}, [y, i] = C([]), h = ({ value: j }) => {
|
|
463
|
-
const
|
|
462
|
+
const I = j.trim().toLowerCase(), L = I.match(/.+:/g);
|
|
464
463
|
let N = [];
|
|
465
464
|
if (L && L.length > 0) {
|
|
466
|
-
const [
|
|
467
|
-
N =
|
|
468
|
-
...
|
|
469
|
-
item: { ...
|
|
465
|
+
const [$] = L, Y = I.replace($, "");
|
|
466
|
+
N = Pe.search(Y).map((m) => ({
|
|
467
|
+
...m,
|
|
468
|
+
item: { ...m.item, name: $ + m.item.name }
|
|
470
469
|
}));
|
|
471
470
|
} else
|
|
472
|
-
N =
|
|
471
|
+
N = Pe.search(I);
|
|
473
472
|
i(k(N, "item"));
|
|
474
473
|
}, g = () => {
|
|
475
474
|
i([]);
|
|
476
|
-
}, p = (j) => j.name,
|
|
475
|
+
}, p = (j) => j.name, b = (j) => /* @__PURE__ */ e.jsx("div", { className: "rounded-md p-1", children: j.name }), w = {
|
|
477
476
|
autoComplete: "off",
|
|
478
477
|
autoCorrect: "off",
|
|
479
478
|
autoCapitalize: "off",
|
|
@@ -483,7 +482,7 @@ function Ur() {
|
|
|
483
482
|
onKeyDown: (j) => {
|
|
484
483
|
j.key === "Enter" && d.trim() !== "" && u();
|
|
485
484
|
},
|
|
486
|
-
onChange: (j, { newValue:
|
|
485
|
+
onChange: (j, { newValue: I }) => a(I),
|
|
487
486
|
className: "w-full rounded-md text-xs px-2 hover:outline-0 bg-background border-border py-1"
|
|
488
487
|
};
|
|
489
488
|
return /* @__PURE__ */ e.jsxs(
|
|
@@ -500,7 +499,7 @@ function Ur() {
|
|
|
500
499
|
onSuggestionsFetchRequested: h,
|
|
501
500
|
onSuggestionsClearRequested: g,
|
|
502
501
|
getSuggestionValue: p,
|
|
503
|
-
renderSuggestion:
|
|
502
|
+
renderSuggestion: b,
|
|
504
503
|
inputProps: w,
|
|
505
504
|
containerProps: {
|
|
506
505
|
className: "relative h-8 w-full gap-y-1 py-1 border-gray-600"
|
|
@@ -1051,10 +1050,10 @@ const B = ["px", "%", "em", "rem", "ch", "vh", "vw"], Kr = {
|
|
|
1051
1050
|
italic: Dt,
|
|
1052
1051
|
// "not-italic": "",
|
|
1053
1052
|
// decoration
|
|
1054
|
-
underline:
|
|
1055
|
-
overline:
|
|
1053
|
+
underline: $t,
|
|
1054
|
+
overline: It,
|
|
1056
1055
|
// transform
|
|
1057
|
-
uppercase:
|
|
1056
|
+
uppercase: Pt,
|
|
1058
1057
|
block: () => /* @__PURE__ */ e.jsxs("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [
|
|
1059
1058
|
/* @__PURE__ */ e.jsx(
|
|
1060
1059
|
"path",
|
|
@@ -1204,7 +1203,7 @@ function Ce({ selected: r, onChange: o, rounded: t = !1, options: s, disabled: l
|
|
|
1204
1203
|
value: d,
|
|
1205
1204
|
children: [
|
|
1206
1205
|
/* @__PURE__ */ e.jsx("option", { className: "bg-transparent", value: "" }),
|
|
1207
|
-
|
|
1206
|
+
P.Children.toArray(
|
|
1208
1207
|
s.map((n) => /* @__PURE__ */ e.jsx("option", { className: "bg-transparent", value: n, children: n }))
|
|
1209
1208
|
)
|
|
1210
1209
|
]
|
|
@@ -1256,10 +1255,10 @@ const Qr = ({ property: r, onChange: o }) => {
|
|
|
1256
1255
|
disabled: !s,
|
|
1257
1256
|
onClick: () => o(a, r),
|
|
1258
1257
|
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"}`,
|
|
1259
|
-
children:
|
|
1258
|
+
children: P.createElement(x(st, a, ze))
|
|
1260
1259
|
}
|
|
1261
1260
|
) }),
|
|
1262
|
-
/* @__PURE__ */ e.jsx(Z, { children:
|
|
1261
|
+
/* @__PURE__ */ e.jsx(Z, { children: F(le(a)) })
|
|
1263
1262
|
] })) });
|
|
1264
1263
|
}, tl = {
|
|
1265
1264
|
backgroundColor: "bg",
|
|
@@ -1277,7 +1276,7 @@ const Qr = ({ property: r, onChange: o }) => {
|
|
|
1277
1276
|
const t = ae(r), s = _(() => x(t, "cls", ""), [t]), { canChange: l } = se(oe), [d, a] = C([]), [c, n] = C({ color: "", shade: "" }), u = s.split("-"), y = x(u, "1", ""), i = x(u, "2", ""), h = V(
|
|
1278
1277
|
// eslint-disable-next-line no-shadow
|
|
1279
1278
|
(p) => {
|
|
1280
|
-
["current", "inherit", "transparent", "black", "white"].includes(p) ? (a([]), n({ color: p })) : (a(["50", "100", "200", "300", "400", "500", "600", "700", "800", "900"]), n((
|
|
1279
|
+
["current", "inherit", "transparent", "black", "white"].includes(p) ? (a([]), n({ color: p })) : (a(["50", "100", "200", "300", "400", "500", "600", "700", "800", "900"]), n((b) => ({ ...b, color: p, shade: b.shade ? b.shade : "500" })));
|
|
1281
1280
|
},
|
|
1282
1281
|
[a, n]
|
|
1283
1282
|
);
|
|
@@ -1296,8 +1295,8 @@ const Qr = ({ property: r, onChange: o }) => {
|
|
|
1296
1295
|
return O(() => {
|
|
1297
1296
|
n({ color: "", shade: "" });
|
|
1298
1297
|
}, [t]), O(() => {
|
|
1299
|
-
const
|
|
1300
|
-
|
|
1298
|
+
const b = `${x(tl, r, "")}-${c.color}${c.shade ? `-${c.shade}` : ""}`;
|
|
1299
|
+
b.match(new RegExp(x(he, `${r}.regExp`, ""))) && o(b, r);
|
|
1301
1300
|
}, [c, o, r]), /* @__PURE__ */ e.jsxs("div", { className: "flex flex-row divide-x divide-solid divide-border rounded-lg border border-border text-xs", children: [
|
|
1302
1301
|
/* @__PURE__ */ e.jsx("div", { className: "grow text-center", children: /* @__PURE__ */ e.jsx(
|
|
1303
1302
|
Ce,
|
|
@@ -1487,7 +1486,7 @@ const sl = (r) => {
|
|
|
1487
1486
|
return ol(r);
|
|
1488
1487
|
const t = x(o, "0", "").replace(/\[|\]/g, ""), s = r.startsWith("-") ? "-" : "", l = ue(t.match(/\d+.\d+|\d+/g));
|
|
1489
1488
|
return { value: `${s}${l}`, unit: t.replace(l, "") };
|
|
1490
|
-
}, ol = (r) => f(r) ? { value: "", unit: "" } : ll(r), at =
|
|
1489
|
+
}, ol = (r) => f(r) ? { value: "", unit: "" } : ll(r), at = P.createContext({
|
|
1491
1490
|
setDragData: () => {
|
|
1492
1491
|
}
|
|
1493
1492
|
}), al = ({
|
|
@@ -1535,17 +1534,17 @@ const sl = (r) => {
|
|
|
1535
1534
|
},
|
|
1536
1535
|
s
|
|
1537
1536
|
)) }), Ee = 50, il = (r) => {
|
|
1538
|
-
const [o, t] = C(!1), [s, l] = C(""), { currentClass: d, onChange: a, classPrefix: c, cssProperty: n, units: u, negative: y } = r, [i, h] = C(n != null && n.toLowerCase().includes("width") ? "%" : u[0]), [g, p] = C(!1), [
|
|
1537
|
+
const [o, t] = C(!1), [s, l] = C(""), { currentClass: d, onChange: a, classPrefix: c, cssProperty: n, units: u, negative: y } = r, [i, h] = C(n != null && n.toLowerCase().includes("width") ? "%" : u[0]), [g, p] = C(!1), [b, w] = C(""), [D, j] = C(!1), [I, L] = C(!1);
|
|
1539
1538
|
O(() => {
|
|
1540
|
-
const { value:
|
|
1539
|
+
const { value: m, unit: v } = sl(d);
|
|
1541
1540
|
if (v === "") {
|
|
1542
|
-
l(
|
|
1541
|
+
l(m), h(n != null && n.toLowerCase().includes("width") ? "%" : ue(u));
|
|
1543
1542
|
return;
|
|
1544
1543
|
}
|
|
1545
|
-
h(v), l(v === "class" || f(
|
|
1544
|
+
h(v), l(v === "class" || f(m) ? "" : m);
|
|
1546
1545
|
}, [d, n, u]);
|
|
1547
|
-
const N = fe((
|
|
1548
|
-
(
|
|
1546
|
+
const N = fe((m) => a(m), [a], Ee), $ = fe((m) => a(m, !1), [a], Ee), Y = V(
|
|
1547
|
+
(m = !1) => {
|
|
1549
1548
|
const v = Ae(`${s}`, u);
|
|
1550
1549
|
if (x(v, "error", !1)) {
|
|
1551
1550
|
p(!0);
|
|
@@ -1559,23 +1558,23 @@ const sl = (r) => {
|
|
|
1559
1558
|
if (x(v, "value") === "")
|
|
1560
1559
|
return;
|
|
1561
1560
|
const J = `${x(v, "value", "").startsWith("-") ? "-" : ""}${c}[${x(v, "value", "").replace("-", "")}${S === "-" ? "" : S}]`;
|
|
1562
|
-
|
|
1561
|
+
m ? $(J) : N(J);
|
|
1563
1562
|
},
|
|
1564
|
-
[N,
|
|
1563
|
+
[N, $, s, i, c, u]
|
|
1565
1564
|
), G = V(
|
|
1566
|
-
(
|
|
1565
|
+
(m) => {
|
|
1567
1566
|
const v = Ae(`${s}`, u);
|
|
1568
1567
|
if (x(v, "error", !1)) {
|
|
1569
1568
|
p(!0);
|
|
1570
1569
|
return;
|
|
1571
1570
|
}
|
|
1572
|
-
if (
|
|
1573
|
-
N(`${c}${
|
|
1571
|
+
if (m === "auto" || m === "none") {
|
|
1572
|
+
N(`${c}${m}`);
|
|
1574
1573
|
return;
|
|
1575
1574
|
}
|
|
1576
1575
|
if (x(v, "value") === "")
|
|
1577
1576
|
return;
|
|
1578
|
-
const S = x(v, "unit") !== "" ? x(v, "unit") :
|
|
1577
|
+
const S = x(v, "unit") !== "" ? x(v, "unit") : m, J = `${x(v, "value", "").startsWith("-") ? "-" : ""}${c}[${x(v, "value", "").replace("-", "")}${S === "-" ? "" : S}]`;
|
|
1579
1578
|
N(J);
|
|
1580
1579
|
},
|
|
1581
1580
|
[N, s, c, u]
|
|
@@ -1592,31 +1591,31 @@ const sl = (r) => {
|
|
|
1592
1591
|
"input",
|
|
1593
1592
|
{
|
|
1594
1593
|
readOnly: i === "class",
|
|
1595
|
-
onKeyPress: (
|
|
1596
|
-
|
|
1594
|
+
onKeyPress: (m) => {
|
|
1595
|
+
m.key === "Enter" && Y();
|
|
1597
1596
|
},
|
|
1598
|
-
onKeyDown: (
|
|
1599
|
-
if (
|
|
1597
|
+
onKeyDown: (m) => {
|
|
1598
|
+
if (m.keyCode !== 38 && m.keyCode !== 40)
|
|
1600
1599
|
return;
|
|
1601
|
-
|
|
1602
|
-
const v = wt(
|
|
1603
|
-
let S =
|
|
1604
|
-
|
|
1600
|
+
m.preventDefault(), L(!0);
|
|
1601
|
+
const v = wt(m.target.value);
|
|
1602
|
+
let S = Ye(v) ? 0 : v;
|
|
1603
|
+
m.keyCode === 38 && (S += 1), m.keyCode === 40 && (S -= 1);
|
|
1605
1604
|
const M = `${S}`, it = `${M.startsWith("-") ? "-" : ""}${c}[${M.replace("-", "")}${i === "-" ? "" : i}]`;
|
|
1606
|
-
|
|
1605
|
+
$(it);
|
|
1607
1606
|
},
|
|
1608
|
-
onKeyUp: (
|
|
1609
|
-
|
|
1607
|
+
onKeyUp: (m) => {
|
|
1608
|
+
I && (m.preventDefault(), L(!1));
|
|
1610
1609
|
},
|
|
1611
|
-
onBlur: () =>
|
|
1612
|
-
onChange: (
|
|
1613
|
-
p(!1), l(
|
|
1610
|
+
onBlur: () => Y(),
|
|
1611
|
+
onChange: (m) => {
|
|
1612
|
+
p(!1), l(m.target.value);
|
|
1614
1613
|
},
|
|
1615
|
-
onClick: (
|
|
1614
|
+
onClick: (m) => {
|
|
1616
1615
|
var v;
|
|
1617
|
-
(v =
|
|
1616
|
+
(v = m == null ? void 0 : m.target) == null || v.select(), t(!1);
|
|
1618
1617
|
},
|
|
1619
|
-
value: D ?
|
|
1618
|
+
value: D ? b : s,
|
|
1620
1619
|
className: "h-6 w-14 rounded rounded-r-none bg-background pl-2 text-sm focus-visible:outline-0 ".concat(
|
|
1621
1620
|
" ",
|
|
1622
1621
|
g ? "border-red-500 text-red-500" : "border-foreground/20"
|
|
@@ -1641,8 +1640,8 @@ const sl = (r) => {
|
|
|
1641
1640
|
{
|
|
1642
1641
|
units: u,
|
|
1643
1642
|
current: i,
|
|
1644
|
-
onSelect: (
|
|
1645
|
-
t(!1), h(
|
|
1643
|
+
onSelect: (m) => {
|
|
1644
|
+
t(!1), h(m), G(m);
|
|
1646
1645
|
}
|
|
1647
1646
|
}
|
|
1648
1647
|
) }) })
|
|
@@ -1652,18 +1651,18 @@ const sl = (r) => {
|
|
|
1652
1651
|
al,
|
|
1653
1652
|
{
|
|
1654
1653
|
onDragStart: () => j(!0),
|
|
1655
|
-
onDragEnd: (
|
|
1656
|
-
if (w(() => ""), j(!1), f(
|
|
1654
|
+
onDragEnd: (m) => {
|
|
1655
|
+
if (w(() => ""), j(!1), f(m))
|
|
1657
1656
|
return;
|
|
1658
|
-
const v = `${
|
|
1657
|
+
const v = `${m}`, M = `${v.startsWith("-") ? "-" : ""}${c}[${v.replace("-", "")}${i === "-" ? "" : i}]`;
|
|
1659
1658
|
N(M);
|
|
1660
1659
|
},
|
|
1661
|
-
onDrag: (
|
|
1662
|
-
if (f(
|
|
1660
|
+
onDrag: (m) => {
|
|
1661
|
+
if (f(m))
|
|
1663
1662
|
return;
|
|
1664
|
-
w(
|
|
1665
|
-
const v = `${
|
|
1666
|
-
|
|
1663
|
+
w(m);
|
|
1664
|
+
const v = `${m}`, M = `${v.startsWith("-") ? "-" : ""}${c}[${v.replace("-", "")}${i === "-" ? "" : i}]`;
|
|
1665
|
+
$(M);
|
|
1667
1666
|
},
|
|
1668
1667
|
currentValue: s,
|
|
1669
1668
|
unit: i,
|
|
@@ -1760,32 +1759,32 @@ const sl = (r) => {
|
|
|
1760
1759
|
"2xl": "1536px"
|
|
1761
1760
|
}, pl = (r) => `${r.toUpperCase()} ${Le[r] ? `(${Le[r]} & up)` : ""}`, Re = (r) => {
|
|
1762
1761
|
const { t: o } = K(), { type: t = "icons", label: s, property: l, onEmitChange: d = () => {
|
|
1763
|
-
}, units: a, negative: c = !1 } = r, [n] = yr(), [u] = Je(), [, y] = Be(), i = ae(l), h = Ke(), g = qe(), [p] = Ge(),
|
|
1764
|
-
(
|
|
1765
|
-
const G = { dark: n, mq: y, mod: u, cls:
|
|
1762
|
+
}, units: a, negative: c = !1 } = r, [n] = yr(), [u] = Je(), [, y] = Be(), i = ae(l), h = Ke(), g = qe(), [p] = Ge(), b = _(() => x(i, "fullCls", ""), [i]), w = V(
|
|
1763
|
+
($, Y = !0) => {
|
|
1764
|
+
const G = { dark: n, mq: y, mod: u, cls: $, property: l, fullCls: "" };
|
|
1766
1765
|
(n || u !== "") && (G.mq = "xs");
|
|
1767
|
-
const
|
|
1768
|
-
h(p, [
|
|
1766
|
+
const m = Mr(G);
|
|
1767
|
+
h(p, [m], Y);
|
|
1769
1768
|
},
|
|
1770
1769
|
[p, n, y, u, l, h]
|
|
1771
1770
|
), D = V(() => {
|
|
1772
|
-
g(p, [
|
|
1773
|
-
}, [p,
|
|
1771
|
+
g(p, [b]);
|
|
1772
|
+
}, [p, b, g]), j = _(() => dl(i, y), [i, y]);
|
|
1774
1773
|
O(() => {
|
|
1775
1774
|
d(j, i);
|
|
1776
1775
|
}, [j, d, i]);
|
|
1777
|
-
const [, ,
|
|
1778
|
-
(
|
|
1779
|
-
|
|
1776
|
+
const [, , I] = Be(), L = V(
|
|
1777
|
+
($) => {
|
|
1778
|
+
I({
|
|
1780
1779
|
xs: 400,
|
|
1781
1780
|
sm: 640,
|
|
1782
1781
|
md: 800,
|
|
1783
1782
|
lg: 1024,
|
|
1784
1783
|
xl: 1420,
|
|
1785
1784
|
"2xl": 1920
|
|
1786
|
-
}[
|
|
1785
|
+
}[$]);
|
|
1787
1786
|
},
|
|
1788
|
-
[
|
|
1787
|
+
[I]
|
|
1789
1788
|
), N = x(i, "dark", null) === n && x(i, "mod", null) === u && x(i, "mq", null) === y;
|
|
1790
1789
|
return /* @__PURE__ */ e.jsx(Jr, { canChange: j, canReset: i && N, children: /* @__PURE__ */ e.jsxs("div", { className: "group flex flex-row items-center py-2 first:pt-0 last:pb-0", children: [
|
|
1791
1790
|
/* @__PURE__ */ e.jsx("div", { className: "relative w-[70px] truncate text-xs text-foreground", children: /* @__PURE__ */ e.jsx("span", { className: `text-[11px] ${i && !N ? "text-foreground" : ""}`, children: o(s) }) }),
|
|
@@ -1807,7 +1806,7 @@ const sl = (r) => {
|
|
|
1807
1806
|
t === "color" && /* @__PURE__ */ e.jsx(rl, { property: l, onChange: w }),
|
|
1808
1807
|
t === "dropdown" && /* @__PURE__ */ e.jsx(ot, { label: s, property: l, onChange: w })
|
|
1809
1808
|
] }),
|
|
1810
|
-
/* @__PURE__ */ e.jsx("div", { className: `w-[30px] cursor-pointer ${
|
|
1809
|
+
/* @__PURE__ */ e.jsx("div", { className: `w-[30px] cursor-pointer ${b ? "visible" : "invisible"}`, children: N ? /* @__PURE__ */ e.jsx("button", { type: "button", onClick: () => D(), title: "Reset", className: "flex px-1.5 text-xs", children: /* @__PURE__ */ e.jsx(Ot, { className: "h-5 w-5 text-blue-500 hover:opacity-80" }) }) : j && i ? /* @__PURE__ */ e.jsxs(X, { delayDuration: 100, children: [
|
|
1811
1810
|
/* @__PURE__ */ e.jsx(z, { asChild: !0, children: /* @__PURE__ */ e.jsx(
|
|
1812
1811
|
"button",
|
|
1813
1812
|
{
|
|
@@ -1856,7 +1855,7 @@ const sl = (r) => {
|
|
|
1856
1855
|
children: [
|
|
1857
1856
|
/* @__PURE__ */ e.jsxs("div", { className: "flex flex-row text-xs", children: [
|
|
1858
1857
|
r && /* @__PURE__ */ e.jsx("span", { className: "relative w-[70px] flex-none text-xs text-foreground", children: c(r) }),
|
|
1859
|
-
/* @__PURE__ */ e.jsx("div", { className: "mb-3 flex grow flex-row flex-wrap gap-x-px", children:
|
|
1858
|
+
/* @__PURE__ */ e.jsx("div", { className: "mb-3 flex grow flex-row flex-wrap gap-x-px", children: P.Children.toArray(
|
|
1860
1859
|
o.map(({ label: h, key: g }) => /* @__PURE__ */ e.jsx("div", { className: "first:rounded-l last:rounded-r", children: /* @__PURE__ */ e.jsxs(X, { children: [
|
|
1861
1860
|
/* @__PURE__ */ e.jsx(z, { asChild: !0, children: /* @__PURE__ */ e.jsxs(
|
|
1862
1861
|
"button",
|
|
@@ -1865,14 +1864,14 @@ const sl = (r) => {
|
|
|
1865
1864
|
onClick: () => u(g),
|
|
1866
1865
|
className: `relative cursor-pointer rounded-full p-1 text-[8px] ${g === n ? " bg-[#3E57F0] text-white" : "text-gray-600 dark:text-gray-300"}`,
|
|
1867
1866
|
children: [
|
|
1868
|
-
|
|
1867
|
+
P.createElement("div", {
|
|
1869
1868
|
className: i(g) ? "-bottom-1.5 absolute bg-[#3E57F0] h-[2px] left-0 w-full" : ""
|
|
1870
1869
|
}),
|
|
1871
|
-
|
|
1870
|
+
P.createElement(x(st, g, ze), { className: "text-inherit w-3 h-3" })
|
|
1872
1871
|
]
|
|
1873
1872
|
}
|
|
1874
1873
|
) }),
|
|
1875
|
-
/* @__PURE__ */ e.jsx(Z, { children:
|
|
1874
|
+
/* @__PURE__ */ e.jsx(Z, { children: F(le(h)) })
|
|
1876
1875
|
] }) }))
|
|
1877
1876
|
) })
|
|
1878
1877
|
] }),
|
|
@@ -1896,7 +1895,7 @@ const sl = (r) => {
|
|
|
1896
1895
|
), a = U(
|
|
1897
1896
|
o.map((n) => n.styleType === "accordion" ? d(n.items) : n.styleType === "multiple" ? k(n.options, "key") : n.property)
|
|
1898
1897
|
), c = k(s, "property");
|
|
1899
|
-
return
|
|
1898
|
+
return Fe(a, c).length > 0;
|
|
1900
1899
|
}, [s, o]);
|
|
1901
1900
|
return /* @__PURE__ */ e.jsxs("details", { children: [
|
|
1902
1901
|
/* @__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: [
|
|
@@ -1910,7 +1909,7 @@ const sl = (r) => {
|
|
|
1910
1909
|
] }) }),
|
|
1911
1910
|
/* @__PURE__ */ e.jsx("div", { className: "p-2", children: o.map((d) => d.styleType === "multiple" ? /* @__PURE__ */ e.jsx(nt, { ...d }, d.label) : /* @__PURE__ */ e.jsx(Re, { ...d }, d.label)) })
|
|
1912
1911
|
] });
|
|
1913
|
-
}, gl = Me({}),
|
|
1912
|
+
}, gl = Me({}), be = ({ section: r }) => {
|
|
1914
1913
|
const { t: o } = K(), t = ge(), s = V(
|
|
1915
1914
|
(a = []) => {
|
|
1916
1915
|
const c = {};
|
|
@@ -1933,15 +1932,15 @@ const sl = (r) => {
|
|
|
1933
1932
|
), c = U(
|
|
1934
1933
|
r.items.map((u) => u.styleType === "accordion" ? a(u.items) : u.styleType === "multiple" ? U(k(u.options, "key")) : u.property)
|
|
1935
1934
|
), n = k(t, "property");
|
|
1936
|
-
return
|
|
1935
|
+
return Fe(c, n).length > 0;
|
|
1937
1936
|
}, [t, r.heading, r.items]), d = _(() => ({}), []);
|
|
1938
1937
|
return /* @__PURE__ */ e.jsx(gl.Provider, { value: d, children: /* @__PURE__ */ e.jsxs(de, { value: r.heading, children: [
|
|
1939
1938
|
/* @__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: [
|
|
1940
1939
|
/* @__PURE__ */ e.jsx("div", { className: `h-[8px] w-[8px] rounded-full ${l ? "bg-blue-500" : "bg-gray-300"}` }),
|
|
1941
1940
|
o(r.heading)
|
|
1942
1941
|
] }) }),
|
|
1943
|
-
/* @__PURE__ */ e.jsx(pe, { className: "bg-gray-100 px-3.5 py-2", children:
|
|
1944
|
-
r.items.map((a) => ye(a, "component") ?
|
|
1942
|
+
/* @__PURE__ */ e.jsx(pe, { className: "bg-gray-100 px-3.5 py-2", children: P.Children.toArray(
|
|
1943
|
+
r.items.map((a) => ye(a, "component") ? P.createElement(a.component, { key: a.label }) : ye(a, "styleType") ? a.styleType === "multiple" ? /* @__PURE__ */ e.jsx(nt, { ...a }, a.label) : a.styleType === "accordion" && s(a == null ? void 0 : a.conditions) ? /* @__PURE__ */ e.jsx(xl, { ...a }, a.label) : null : /* @__PURE__ */ e.jsx(Re, { ...a }, a.label))
|
|
1945
1944
|
) })
|
|
1946
1945
|
] }) });
|
|
1947
1946
|
}, hl = ({
|
|
@@ -1977,7 +1976,7 @@ const sl = (r) => {
|
|
|
1977
1976
|
}
|
|
1978
1977
|
),
|
|
1979
1978
|
/* @__PURE__ */ e.jsx(
|
|
1980
|
-
|
|
1979
|
+
Yt,
|
|
1981
1980
|
{
|
|
1982
1981
|
onClick: l,
|
|
1983
1982
|
className: "h-6 w-6 cursor-pointer rounded border border-red-400 p-1 text-red-400 hover:opacity-80"
|
|
@@ -1986,22 +1985,22 @@ const sl = (r) => {
|
|
|
1986
1985
|
] })
|
|
1987
1986
|
] }), yl = ({ section: r }) => {
|
|
1988
1987
|
var h;
|
|
1989
|
-
const { setSyncState: o } =
|
|
1988
|
+
const { setSyncState: o } = mr(), t = q(), [s, l] = C([]), [d] = Se(), a = We(), c = `${x(d, "0.prop")}_attrs`;
|
|
1990
1989
|
ne.useEffect(() => {
|
|
1991
|
-
const g = k(x(t, c), (p,
|
|
1990
|
+
const g = k(x(t, c), (p, b) => ({ key: b, value: p }));
|
|
1992
1991
|
f(g) ? l([]) : l(g);
|
|
1993
1992
|
}, [x(t, c)]);
|
|
1994
1993
|
const n = () => l([...s, { key: "", value: "" }]), u = (g) => {
|
|
1995
|
-
const p = we(s, (
|
|
1994
|
+
const p = we(s, (b, w) => g !== w);
|
|
1996
1995
|
i(p);
|
|
1997
1996
|
}, y = (g, p) => {
|
|
1998
|
-
const
|
|
1999
|
-
|
|
1997
|
+
const b = [...s];
|
|
1998
|
+
b[p][g.target.name] = g.target.value, i(b);
|
|
2000
1999
|
}, i = ne.useCallback(
|
|
2001
2000
|
(g = []) => {
|
|
2002
2001
|
const p = {};
|
|
2003
|
-
ke(g, (
|
|
2004
|
-
f(
|
|
2002
|
+
ke(g, (b) => {
|
|
2003
|
+
f(b.key) || Oe(p, b.key, b.value);
|
|
2005
2004
|
}), a([x(t, "_id")], { [c]: p }), o("UNSAVED");
|
|
2006
2005
|
},
|
|
2007
2006
|
[t, o, a, c]
|
|
@@ -2038,13 +2037,13 @@ const sl = (r) => {
|
|
|
2038
2037
|
f(s) && /* @__PURE__ */ e.jsx("div", { className: "flex h-12 items-center justify-center text-sm text-gray-400", children: "Click + Add to add attributes" }),
|
|
2039
2038
|
ne.Children.toArray(
|
|
2040
2039
|
k(s, (g, p) => {
|
|
2041
|
-
const
|
|
2040
|
+
const b = s.length > 0 && p < s.length - 1;
|
|
2042
2041
|
return /* @__PURE__ */ e.jsx(
|
|
2043
2042
|
hl,
|
|
2044
2043
|
{
|
|
2045
2044
|
item: g,
|
|
2046
2045
|
index: p,
|
|
2047
|
-
canDelete:
|
|
2046
|
+
canDelete: b,
|
|
2048
2047
|
onChange: y,
|
|
2049
2048
|
onRemove: () => u(p)
|
|
2050
2049
|
}
|
|
@@ -2055,8 +2054,8 @@ const sl = (r) => {
|
|
|
2055
2054
|
] }) })
|
|
2056
2055
|
] });
|
|
2057
2056
|
};
|
|
2058
|
-
function
|
|
2059
|
-
const [r, o] = Je(), { flexChild: t, gridChild: s } =
|
|
2057
|
+
function ml() {
|
|
2058
|
+
const [r, o] = Je(), { flexChild: t, gridChild: s } = br(), [, l] = Pr(fr), { t: d } = K(), [a] = Se();
|
|
2060
2059
|
return f(a) ? /* @__PURE__ */ e.jsx("div", { className: "p-4 text-center", children: /* @__PURE__ */ e.jsxs("div", { className: "space-y-4 rounded-xl p-4", children: [
|
|
2061
2060
|
/* @__PURE__ */ e.jsx(Ze, { className: "mx-auto text-3xl" }),
|
|
2062
2061
|
/* @__PURE__ */ e.jsx("h1", { children: d("no_styling_block_selected") })
|
|
@@ -2084,15 +2083,15 @@ function bl() {
|
|
|
2084
2083
|
] })
|
|
2085
2084
|
] }) }),
|
|
2086
2085
|
/* @__PURE__ */ e.jsx(Qe, { className: "no-scrollbar -mx-1 max-h-full flex-1 overflow-x-hidden overflow-y-hidden", children: /* @__PURE__ */ e.jsxs(Ue, { defaultValue: ["Layout"], type: "multiple", className: "w-full", children: [
|
|
2087
|
-
t && /* @__PURE__ */ e.jsx(
|
|
2088
|
-
s ? /* @__PURE__ */ e.jsx(
|
|
2089
|
-
Gr.map((c) => /* @__PURE__ */ e.jsx(
|
|
2086
|
+
t && /* @__PURE__ */ e.jsx(be, { section: Kr }),
|
|
2087
|
+
s ? /* @__PURE__ */ e.jsx(be, { section: qr }) : null,
|
|
2088
|
+
Gr.map((c) => /* @__PURE__ */ e.jsx(be, { section: c }, c.heading)),
|
|
2090
2089
|
/* @__PURE__ */ e.jsx(yl, { section: { heading: "Attributes" } })
|
|
2091
2090
|
] }) })
|
|
2092
2091
|
] })
|
|
2093
2092
|
);
|
|
2094
2093
|
}
|
|
2095
|
-
const
|
|
2094
|
+
const bl = {
|
|
2096
2095
|
px: 1,
|
|
2097
2096
|
"%": 1,
|
|
2098
2097
|
em: 100,
|
|
@@ -2103,8 +2102,8 @@ const ml = {
|
|
|
2103
2102
|
"-": 1,
|
|
2104
2103
|
deg: 1,
|
|
2105
2104
|
ms: 0.1
|
|
2106
|
-
},
|
|
2107
|
-
const r = q(), { t: o } = K(), [t, s] =
|
|
2105
|
+
}, Cs = () => {
|
|
2106
|
+
const r = q(), { t: o } = K(), [t, s] = P.useState(""), [l, d] = P.useState({
|
|
2108
2107
|
onDrag: (n) => n,
|
|
2109
2108
|
onDragEnd: (n) => n,
|
|
2110
2109
|
dragStartY: 0,
|
|
@@ -2117,8 +2116,8 @@ const ml = {
|
|
|
2117
2116
|
(n) => {
|
|
2118
2117
|
const u = !x(l, "negative", !1), y = x(l, "cssProperty", "");
|
|
2119
2118
|
let i = parseFloat(l.dragStartValue);
|
|
2120
|
-
i =
|
|
2121
|
-
let h =
|
|
2119
|
+
i = Ye(i) ? 0 : i;
|
|
2120
|
+
let h = bl[l.dragUnit];
|
|
2122
2121
|
(W(y, "scale") || y === "opacity") && (h = 10);
|
|
2123
2122
|
let p = (l.dragStartY - n.pageY) / h + i;
|
|
2124
2123
|
u && p < 0 && (p = 0), y === "opacity" && p > 1 && (p = 1), l.onDrag(`${p}`), s(`${p}`);
|
|
@@ -2154,11 +2153,11 @@ const ml = {
|
|
|
2154
2153
|
/* @__PURE__ */ e.jsx(De, { value: "settings", children: o("settings") }),
|
|
2155
2154
|
/* @__PURE__ */ e.jsx(De, { value: "styling", children: o("styling") })
|
|
2156
2155
|
] }),
|
|
2157
|
-
/* @__PURE__ */ e.jsx(
|
|
2158
|
-
/* @__PURE__ */ e.jsx(
|
|
2156
|
+
/* @__PURE__ */ e.jsx($e, { value: "settings", className: "no-scrollbar h-full flex-1 overflow-y-auto overflow-x-hidden", children: /* @__PURE__ */ e.jsx(Qe, { className: "no-scrollbar max-h-full flex-1 overflow-x-hidden overflow-y-hidden pb-5", children: /* @__PURE__ */ e.jsx(Wr, {}) }) }),
|
|
2157
|
+
/* @__PURE__ */ e.jsx($e, { value: "styling", className: "h-full flex-1 overflow-y-auto overflow-x-hidden", children: /* @__PURE__ */ e.jsx(ml, {}) })
|
|
2159
2158
|
] })
|
|
2160
2159
|
] }) });
|
|
2161
2160
|
};
|
|
2162
2161
|
export {
|
|
2163
|
-
|
|
2162
|
+
Cs as default
|
|
2164
2163
|
};
|