@chaibuilder/sdk 1.1.1 → 1.1.2
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/{CanvasArea-rC2E_4eS.cjs → CanvasArea-UtFK5IS6.cjs} +1 -1
- package/dist/{CanvasArea-JzBGfXSp.js → CanvasArea-dkwSFbQA.js} +1 -1
- package/dist/{CurrentPage-v7RxefU-.cjs → CurrentPage-hHwsHam-.cjs} +1 -1
- package/dist/{CurrentPage-2Hqp8dwp.js → CurrentPage-uRwS0DQC.js} +1 -1
- package/dist/{Layers-1H-MUoKM.cjs → Layers--5nyqOjK.cjs} +1 -1
- package/dist/{Layers-K_1pMZK5.js → Layers-eXMT1ncm.js} +1 -1
- package/dist/{PagesPanel-Qt66yy3K.cjs → PagesPanel-WZgw7xVs.cjs} +1 -1
- package/dist/{PagesPanel-uMZT46fo.js → PagesPanel-xRUnAMIb.js} +2 -2
- package/dist/{ProjectPanel-nhhdOgSP.js → ProjectPanel-8l4Bi3Kh.js} +2 -2
- package/dist/{ProjectPanel-g92sgZ-g.cjs → ProjectPanel-FC03TiyG.cjs} +1 -1
- package/dist/{Settings-pYbQsClt.js → Settings-4v3M1bRS.js} +126 -128
- package/dist/Settings-kcmKFymH.cjs +1 -0
- package/dist/{SidePanels-9AjWdvVI.js → SidePanels-0xaw3Td6.js} +2 -2
- package/dist/{SidePanels-CBkl8HgT.cjs → SidePanels-5e5q3c7J.cjs} +1 -1
- package/dist/{add-page-modal-eahhWw2b.cjs → add-page-modal-JRSQ_N56.cjs} +1 -1
- package/dist/{add-page-modal-Ny4uAvWB.js → add-page-modal-K5isTZOT.js} +1 -1
- package/dist/core.cjs +1 -1
- package/dist/core.js +1 -1
- package/dist/{delete-page-modal-07nDpZpj.cjs → delete-page-modal-c8nB2y7w.cjs} +1 -1
- package/dist/{delete-page-modal-4qrgJQ0x.js → delete-page-modal-x81Ed4jF.js} +1 -1
- package/dist/{index-Ua5E0Syv.cjs → index-7NRFGya_.cjs} +1 -1
- package/dist/{index-aDqFUJ8v.js → index-HjvZqhVh.js} +2 -2
- package/dist/{page-viewer-1Eb7ypob.js → page-viewer-fFaDQOOI.js} +2 -2
- package/dist/{page-viewer-X8h3FMwb.cjs → page-viewer-huD5B1om.cjs} +1 -1
- package/dist/{project-general-setting-TCl_JNdl.js → project-general-setting-rH_1r38b.js} +1 -1
- package/dist/{project-general-setting-I4z0C7PE.cjs → project-general-setting-rNNI-K6l.cjs} +1 -1
- package/dist/{single-page-detail-sdTzXA5i.cjs → single-page-detail-52_cuxNe.cjs} +1 -1
- package/dist/{single-page-detail-W5sW6771.js → single-page-detail-CrgTQFUX.js} +2 -2
- package/dist/studio.cjs +1 -1
- package/dist/studio.js +1 -1
- package/package.json +1 -1
- package/dist/Settings-IcmgBZm9.cjs +0 -1
|
@@ -11,7 +11,7 @@ import Tr from "@rjsf/validator-ajv8";
|
|
|
11
11
|
import { u as Sr } from "./controls-G0puEH71.js";
|
|
12
12
|
import { Check as Rr, EditIcon as Vr, TrashIcon as Hr } from "lucide-react";
|
|
13
13
|
import { getBlockComponent as et, getChaiDataProviders as Br } from "@chaibuilder/runtime";
|
|
14
|
-
import { E as tt, u as rt } from "./index-
|
|
14
|
+
import { E as tt, u as rt } from "./index-HjvZqhVh.js";
|
|
15
15
|
import { useAtom as Ar } from "jotai";
|
|
16
16
|
import Dr from "react-autosuggest";
|
|
17
17
|
import Ir from "fuse.js";
|
|
@@ -65,10 +65,10 @@ import "sonner";
|
|
|
65
65
|
const Or = I.lazy(() => import("react-json-view"));
|
|
66
66
|
function Mr(t) {
|
|
67
67
|
const s = [], r = {};
|
|
68
|
-
function l(o,
|
|
69
|
-
Ce(
|
|
70
|
-
const
|
|
71
|
-
s.push(
|
|
68
|
+
function l(o, n) {
|
|
69
|
+
Ce(n, (d, i) => {
|
|
70
|
+
const a = o ? `${o}.${i}` : i, p = ae(d) ? "list" : typeof d;
|
|
71
|
+
s.push(a), r[a] = p === "string" ? "text" : p === "object" ? "model" : p, p === "object" && !ae(d) && l(a, d);
|
|
72
72
|
});
|
|
73
73
|
}
|
|
74
74
|
return l("", ct(t, ["styles", "_type", "_id", "_name", "_bindings"])), { paths: s, pathsType: r };
|
|
@@ -101,12 +101,12 @@ const je = ({ data: t, fullView: s }) => {
|
|
|
101
101
|
setValue: r,
|
|
102
102
|
data: l,
|
|
103
103
|
onChange: o,
|
|
104
|
-
dataType:
|
|
104
|
+
dataType: n,
|
|
105
105
|
appliedBindings: d
|
|
106
106
|
}) => {
|
|
107
|
-
const { paths: i, pathsType:
|
|
107
|
+
const { paths: i, pathsType: a } = Mr(l), p = t === "PROP" ? et(l == null ? void 0 : l._type) : {}, g = t === "PROP", [c, m] = w(!1), h = N(() => t === "PROP" ? i.filter(
|
|
108
108
|
(x) => !M(d, x) && u(p, `props.${pe(ut(x, "."))}.binding`)
|
|
109
|
-
) : i.filter((x) =>
|
|
109
|
+
) : i.filter((x) => n === u(a, x, "")), [t, i, d, n, p]);
|
|
110
110
|
return _(() => {
|
|
111
111
|
s && o(s);
|
|
112
112
|
}, [s, t]), /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
@@ -121,7 +121,7 @@ const je = ({ data: t, fullView: s }) => {
|
|
|
121
121
|
className: ` ${b(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"}`,
|
|
122
122
|
children: s ? /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
123
123
|
/* @__PURE__ */ e.jsxs("span", { className: "text-sm pr-8", children: [
|
|
124
|
-
g && /* @__PURE__ */ e.jsx("span", { className: "text-[10px] text-purple-500 bg-purple-100 px-2 py-0.5 mr-2 rounded-full", children: Y(
|
|
124
|
+
g && /* @__PURE__ */ e.jsx("span", { className: "text-[10px] text-purple-500 bg-purple-100 px-2 py-0.5 mr-2 rounded-full", children: Y(n) }),
|
|
125
125
|
s
|
|
126
126
|
] }),
|
|
127
127
|
/* @__PURE__ */ e.jsx("span", { className: "text-[9px] text-blue-400 underline cursor-pointer hover:text-blue-700", children: "Change" })
|
|
@@ -148,7 +148,7 @@ const je = ({ data: t, fullView: s }) => {
|
|
|
148
148
|
/* @__PURE__ */ e.jsx(Rr, { className: `w-4 h-4 text-green-500 ${s === x ? "" : "opacity-0"}` }),
|
|
149
149
|
x
|
|
150
150
|
] }),
|
|
151
|
-
g ? /* @__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(u(
|
|
151
|
+
g ? /* @__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(u(a, x, "")) }) }) : /* @__PURE__ */ e.jsx("div", { className: "pl-6", children: /* @__PURE__ */ e.jsx(je, { data: u(l, x) }) })
|
|
152
152
|
]
|
|
153
153
|
},
|
|
154
154
|
x
|
|
@@ -165,19 +165,19 @@ const je = ({ data: t, fullView: s }) => {
|
|
|
165
165
|
editMode: r,
|
|
166
166
|
item: l
|
|
167
167
|
}) => {
|
|
168
|
-
const [o,
|
|
168
|
+
const [o, n] = w(r ? l.key : ""), [d, i] = w(r ? l.value : ""), a = G(), [p] = rt(), g = A(
|
|
169
169
|
(h, x) => {
|
|
170
170
|
if (b(h))
|
|
171
171
|
return "";
|
|
172
172
|
{
|
|
173
|
-
const f = u(x === "PROP" ?
|
|
173
|
+
const f = u(x === "PROP" ? a : p, h, "");
|
|
174
174
|
if (ae(f))
|
|
175
175
|
return "list";
|
|
176
176
|
const T = typeof f;
|
|
177
177
|
return T === "string" ? "text" : T === "object" ? "model" : T;
|
|
178
178
|
}
|
|
179
179
|
},
|
|
180
|
-
[
|
|
180
|
+
[a, p]
|
|
181
181
|
), [c, m] = w(r ? g(l.key, "PROP") : "");
|
|
182
182
|
return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
183
183
|
/* @__PURE__ */ e.jsxs(qt, { children: [
|
|
@@ -192,12 +192,12 @@ const je = ({ data: t, fullView: s }) => {
|
|
|
192
192
|
isDisabled: !1,
|
|
193
193
|
placeholder: "Enter prop key",
|
|
194
194
|
value: o,
|
|
195
|
-
setValue:
|
|
195
|
+
setValue: n,
|
|
196
196
|
onChange: (h) => {
|
|
197
197
|
const x = g(h, "PROP");
|
|
198
|
-
|
|
198
|
+
n(h), c !== x && i(""), m(x);
|
|
199
199
|
},
|
|
200
|
-
data:
|
|
200
|
+
data: a,
|
|
201
201
|
dataType: c,
|
|
202
202
|
appliedBindings: t
|
|
203
203
|
}
|
|
@@ -232,18 +232,18 @@ const je = ({ data: t, fullView: s }) => {
|
|
|
232
232
|
}
|
|
233
233
|
) })
|
|
234
234
|
] });
|
|
235
|
-
}, st = ({ disabled: t, children: s, onAddBinding: r, appliedBindings: l, editMode: o = !0, item:
|
|
235
|
+
}, st = ({ disabled: t, children: s, onAddBinding: r, appliedBindings: l, editMode: o = !0, item: n = {} }) => {
|
|
236
236
|
const [d, i] = w(!1);
|
|
237
237
|
return /* @__PURE__ */ e.jsxs(tr, { children: [
|
|
238
238
|
/* @__PURE__ */ e.jsx(rr, { disabled: t, asChild: !0, onClick: () => i(!0), children: s }),
|
|
239
239
|
d && /* @__PURE__ */ e.jsx(sr, { children: /* @__PURE__ */ e.jsx(
|
|
240
240
|
Er,
|
|
241
241
|
{
|
|
242
|
-
item:
|
|
242
|
+
item: n,
|
|
243
243
|
editMode: o,
|
|
244
244
|
appliedBindings: l,
|
|
245
|
-
onAddBinding: (
|
|
246
|
-
r(
|
|
245
|
+
onAddBinding: (a) => {
|
|
246
|
+
r(a), i(!1);
|
|
247
247
|
}
|
|
248
248
|
}
|
|
249
249
|
) })
|
|
@@ -254,9 +254,9 @@ const je = ({ data: t, fullView: s }) => {
|
|
|
254
254
|
onRemove: r,
|
|
255
255
|
selectedBlock: l,
|
|
256
256
|
dataProvider: o,
|
|
257
|
-
appliedBindings:
|
|
257
|
+
appliedBindings: n
|
|
258
258
|
}) => {
|
|
259
|
-
const [d, i] = w("string"),
|
|
259
|
+
const [d, i] = w("string"), a = (p, g) => {
|
|
260
260
|
if (b(p))
|
|
261
261
|
return "";
|
|
262
262
|
{
|
|
@@ -267,12 +267,12 @@ const je = ({ data: t, fullView: s }) => {
|
|
|
267
267
|
return m === "string" ? "text" : m === "object" ? "model" : m;
|
|
268
268
|
}
|
|
269
269
|
};
|
|
270
|
-
return _(() => i(() =>
|
|
270
|
+
return _(() => i(() => a(t.key, "PROP")), [t.key]), /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col border border-gray-200 relative rounded-md p-2", children: [
|
|
271
271
|
/* @__PURE__ */ e.jsx("div", { className: "text-gray-500 font-normal text-sm", children: t.key }),
|
|
272
272
|
/* @__PURE__ */ e.jsx("div", { className: "font-medium leading-5", children: t.value }),
|
|
273
273
|
/* @__PURE__ */ e.jsx(je, { data: u(o, t.value, "") }),
|
|
274
274
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center justify-end gap-x-2", children: [
|
|
275
|
-
/* @__PURE__ */ e.jsx(st, { editMode: !0, onAddBinding: s, appliedBindings:
|
|
275
|
+
/* @__PURE__ */ e.jsx(st, { editMode: !0, onAddBinding: s, appliedBindings: n, item: t, children: /* @__PURE__ */ e.jsx(Vr, { 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" }) }),
|
|
276
276
|
/* @__PURE__ */ e.jsx(
|
|
277
277
|
Hr,
|
|
278
278
|
{
|
|
@@ -284,7 +284,7 @@ const je = ({ data: t, fullView: s }) => {
|
|
|
284
284
|
!b(d) && !b(t.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(d) })
|
|
285
285
|
] });
|
|
286
286
|
}, Fr = ({ bindingData: t, onChange: s }) => {
|
|
287
|
-
const r = G(), [l] = rt(), o = Br(), [
|
|
287
|
+
const r = G(), [l] = rt(), o = Br(), [n, d] = w(
|
|
288
288
|
C(t, (c, m) => ({ key: m, value: c }))
|
|
289
289
|
);
|
|
290
290
|
_(() => {
|
|
@@ -293,15 +293,15 @@ const je = ({ data: t, fullView: s }) => {
|
|
|
293
293
|
const i = N(() => {
|
|
294
294
|
if (b(l))
|
|
295
295
|
return !0;
|
|
296
|
-
if (b(
|
|
296
|
+
if (b(n))
|
|
297
297
|
return !1;
|
|
298
|
-
const c = fe(
|
|
298
|
+
const c = fe(n);
|
|
299
299
|
return b(c == null ? void 0 : c.key) || b(c == null ? void 0 : c.value);
|
|
300
|
-
}, [l,
|
|
301
|
-
const m = ve(
|
|
300
|
+
}, [l, n]), a = (c) => {
|
|
301
|
+
const m = ve(n, (h) => h.key !== c.key);
|
|
302
302
|
d([...m, c]), g([...m, c]);
|
|
303
303
|
}, p = (c) => {
|
|
304
|
-
const m = ve(
|
|
304
|
+
const m = ve(n, (h, x) => c !== x);
|
|
305
305
|
g([...m]);
|
|
306
306
|
}, g = A(
|
|
307
307
|
(c = []) => {
|
|
@@ -321,15 +321,15 @@ const je = ({ data: t, fullView: s }) => {
|
|
|
321
321
|
/* @__PURE__ */ e.jsx("br", {}),
|
|
322
322
|
/* @__PURE__ */ e.jsx("a", { className: "text-blue-500", href: "https://chaibuilder.com/docs/registering-data-providers", target: "_blank", children: "Learn more" })
|
|
323
323
|
] }) }) : /* @__PURE__ */ e.jsxs("div", { className: "space-y-2", children: [
|
|
324
|
-
C(
|
|
324
|
+
C(n, (c, m) => /* @__PURE__ */ e.jsx(
|
|
325
325
|
_r,
|
|
326
326
|
{
|
|
327
327
|
item: c,
|
|
328
|
-
onAddBinding:
|
|
328
|
+
onAddBinding: a,
|
|
329
329
|
onRemove: () => p(m),
|
|
330
330
|
selectedBlock: r,
|
|
331
331
|
dataProvider: l,
|
|
332
|
-
appliedBindings: C(
|
|
332
|
+
appliedBindings: C(n, "key")
|
|
333
333
|
},
|
|
334
334
|
c.key
|
|
335
335
|
)),
|
|
@@ -338,8 +338,8 @@ const je = ({ data: t, fullView: s }) => {
|
|
|
338
338
|
st,
|
|
339
339
|
{
|
|
340
340
|
disabled: i,
|
|
341
|
-
appliedBindings: C(
|
|
342
|
-
onAddBinding:
|
|
341
|
+
appliedBindings: C(n, "key"),
|
|
342
|
+
onAddBinding: a,
|
|
343
343
|
children: /* @__PURE__ */ e.jsx(
|
|
344
344
|
"span",
|
|
345
345
|
{
|
|
@@ -359,13 +359,13 @@ const je = ({ data: t, fullView: s }) => {
|
|
|
359
359
|
formData: r,
|
|
360
360
|
onChange: l
|
|
361
361
|
}) => {
|
|
362
|
-
const [o] = lr(),
|
|
362
|
+
const [o] = lr(), n = { type: "object", properties: {} }, d = {};
|
|
363
363
|
return Object.keys(s).forEach((i) => {
|
|
364
|
-
const
|
|
365
|
-
if (M(["slot", "styles"],
|
|
364
|
+
const a = s[i];
|
|
365
|
+
if (M(["slot", "styles"], a.type))
|
|
366
366
|
return;
|
|
367
|
-
const p = u(
|
|
368
|
-
|
|
367
|
+
const p = u(a, "i18n", !1) ? `${i}-${o}` : i;
|
|
368
|
+
n.properties[p] = or(a, o), d[p] = nr(a, o);
|
|
369
369
|
}), /* @__PURE__ */ e.jsx(
|
|
370
370
|
Nr,
|
|
371
371
|
{
|
|
@@ -386,7 +386,7 @@ const je = ({ data: t, fullView: s }) => {
|
|
|
386
386
|
validator: Tr,
|
|
387
387
|
uiSchema: d,
|
|
388
388
|
onBlur: t,
|
|
389
|
-
schema:
|
|
389
|
+
schema: n,
|
|
390
390
|
formData: r,
|
|
391
391
|
onChange: l
|
|
392
392
|
}
|
|
@@ -394,22 +394,20 @@ const je = ({ data: t, fullView: s }) => {
|
|
|
394
394
|
}
|
|
395
395
|
);
|
|
396
396
|
function Wr() {
|
|
397
|
-
const t = G(), { createSnapshot: s } = ze(), r = Ue(), l = et(t._type), o = { ...t },
|
|
397
|
+
const t = G(), { createSnapshot: s } = ze(), r = Ue(), l = et(t._type), o = { ...t }, n = pr("dataBindingSupport", !1), d = () => s(), i = ({ formData: c }, m) => {
|
|
398
398
|
if (m) {
|
|
399
399
|
const h = m.replace("root.", "");
|
|
400
400
|
r([t._id], { [h]: u(c, h) });
|
|
401
401
|
}
|
|
402
|
-
},
|
|
402
|
+
}, a = {
|
|
403
403
|
_name: Sr({
|
|
404
404
|
title: "Name",
|
|
405
405
|
default: u(t, "_name", t._type)
|
|
406
406
|
})
|
|
407
407
|
}, p = gt(u(o, "_bindings", {})), g = N(() => {
|
|
408
408
|
const c = ht(u(l, "props", {}));
|
|
409
|
-
return mt(p, (m) =>
|
|
410
|
-
|
|
411
|
-
}), c;
|
|
412
|
-
}, [l, p]);
|
|
409
|
+
return n && mt(p, (m) => delete c[m]), c;
|
|
410
|
+
}, [l, p, n]);
|
|
413
411
|
return /* @__PURE__ */ e.jsxs("div", { className: "overflow-x-hidden", children: [
|
|
414
412
|
/* @__PURE__ */ e.jsx(
|
|
415
413
|
me,
|
|
@@ -417,11 +415,11 @@ function Wr() {
|
|
|
417
415
|
onChange: i,
|
|
418
416
|
createHistorySnapshot: d,
|
|
419
417
|
formData: o,
|
|
420
|
-
properties:
|
|
418
|
+
properties: a
|
|
421
419
|
}
|
|
422
420
|
),
|
|
423
421
|
/* @__PURE__ */ e.jsx("hr", { className: "mt-4" }),
|
|
424
|
-
|
|
422
|
+
n ? /* @__PURE__ */ e.jsxs(Ge, { type: "multiple", defaultValue: ["STATIC", "BINDING"], className: "h-full w-full", children: [
|
|
425
423
|
/* @__PURE__ */ e.jsxs(ie, { value: "BINDING", children: [
|
|
426
424
|
/* @__PURE__ */ e.jsx(de, { className: "px-3 py-2 text-xs hover:no-underline bg-gray-100 ml-1", children: /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-x-2", children: [
|
|
427
425
|
/* @__PURE__ */ e.jsx(
|
|
@@ -486,8 +484,8 @@ const Pe = new Ir(Pr, {
|
|
|
486
484
|
});
|
|
487
485
|
function Xr() {
|
|
488
486
|
var D;
|
|
489
|
-
const [t] = Te(), s = G(), r = Ke(), l = qe(), [o] = Je(), [
|
|
490
|
-
const j =
|
|
487
|
+
const [t] = Te(), s = G(), r = Ke(), l = qe(), [o] = Je(), [n, d] = w(""), i = (D = pe(t)) == null ? void 0 : D.prop, a = bt((u(s, i, "").replace(Lr, "").split(",").pop() || "").split(" "), b), p = () => {
|
|
488
|
+
const j = n.trim().toLowerCase().replace(/ +(?= )/g, "").split(" ");
|
|
491
489
|
r(o, j, !0), d("");
|
|
492
490
|
}, [g, c] = w([]), m = ({ value: j }) => {
|
|
493
491
|
const L = j.trim().toLowerCase(), P = L.match(/.+:/g);
|
|
@@ -509,9 +507,9 @@ function Xr() {
|
|
|
509
507
|
autoCapitalize: "off",
|
|
510
508
|
spellCheck: !1,
|
|
511
509
|
placeholder: "Enter class name",
|
|
512
|
-
value:
|
|
510
|
+
value: n,
|
|
513
511
|
onKeyDown: (j) => {
|
|
514
|
-
j.key === "Enter" &&
|
|
512
|
+
j.key === "Enter" && n.trim() !== "" && p();
|
|
515
513
|
},
|
|
516
514
|
onChange: (j, { newValue: L }) => d(L),
|
|
517
515
|
className: "w-full rounded-md text-xs px-2 hover:outline-0 bg-background border-border py-1"
|
|
@@ -548,16 +546,16 @@ function Xr() {
|
|
|
548
546
|
variant: "outline",
|
|
549
547
|
className: "h-6 border-gray-700",
|
|
550
548
|
onClick: p,
|
|
551
|
-
disabled:
|
|
549
|
+
disabled: n.trim() === "",
|
|
552
550
|
size: "sm",
|
|
553
551
|
children: /* @__PURE__ */ e.jsx(ke, {})
|
|
554
552
|
}
|
|
555
553
|
)
|
|
556
554
|
] }),
|
|
557
555
|
/* @__PURE__ */ e.jsxs("div", { className: "flex w-full flex-wrap gap-2", children: [
|
|
558
|
-
b(
|
|
556
|
+
b(a) && /* @__PURE__ */ e.jsx("div", { className: "flex h-10 w-full items-center justify-center text-center text-sm text-gray-400", children: "No class added" }),
|
|
559
557
|
ne.Children.toArray(
|
|
560
|
-
|
|
558
|
+
a.map((j) => /* @__PURE__ */ e.jsxs(
|
|
561
559
|
"div",
|
|
562
560
|
{
|
|
563
561
|
className: "group relative flex cursor-default items-center gap-x-1 rounded-full border border-blue-600 bg-blue-500 p-px px-1.5 text-[11px] text-white hover:border-blue-900",
|
|
@@ -1202,9 +1200,9 @@ const B = ["px", "%", "em", "rem", "ch", "vh", "vw"], Zr = {
|
|
|
1202
1200
|
// eslint-disable-next-line react/jsx-no-constructed-context-values
|
|
1203
1201
|
/* @__PURE__ */ e.jsx(se.Provider, { value: { canReset: s, canChange: r }, children: t })
|
|
1204
1202
|
), ot = ({ label: t, property: s, onChange: r }) => {
|
|
1205
|
-
const l = N(() => u(ge, `${s}.classes`, [""]), [s]), o = le(s),
|
|
1203
|
+
const l = N(() => u(ge, `${s}.classes`, [""]), [s]), o = le(s), n = N(() => u(o, "cls", ""), [o]), { canChange: d } = re(se), i = /\[.*\]/g.test(n);
|
|
1206
1204
|
return /* @__PURE__ */ e.jsx("div", { className: t ? "w-full rounded " : "grow", children: i ? /* @__PURE__ */ e.jsxs("div", { className: "flex items-center", children: [
|
|
1207
|
-
/* @__PURE__ */ e.jsx(ur, { className: "w-[70%] rounded py-1", readOnly: !0, value:
|
|
1205
|
+
/* @__PURE__ */ e.jsx(ur, { className: "w-[70%] rounded py-1", readOnly: !0, value: n }),
|
|
1208
1206
|
/* @__PURE__ */ e.jsxs(W, { delayDuration: 100, children: [
|
|
1209
1207
|
/* @__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(Ne, {}) }) }),
|
|
1210
1208
|
/* @__PURE__ */ e.jsx(Z, { children: "Current value is using a Tailwind arbitrary value." })
|
|
@@ -1213,37 +1211,37 @@ const B = ["px", "%", "em", "rem", "ch", "vh", "vw"], Zr = {
|
|
|
1213
1211
|
we,
|
|
1214
1212
|
{
|
|
1215
1213
|
rounded: t,
|
|
1216
|
-
onChange: (
|
|
1217
|
-
selected:
|
|
1214
|
+
onChange: (a) => r(a, s),
|
|
1215
|
+
selected: n,
|
|
1218
1216
|
options: l,
|
|
1219
1217
|
disabled: !d
|
|
1220
1218
|
}
|
|
1221
1219
|
) });
|
|
1222
1220
|
};
|
|
1223
1221
|
function we({ selected: t, onChange: s, rounded: r = !1, options: l, disabled: o = !1 }) {
|
|
1224
|
-
const
|
|
1222
|
+
const n = t.replace(/.*:/g, "").trim(), { undo: d, redo: i } = ze();
|
|
1225
1223
|
return /* @__PURE__ */ e.jsxs(
|
|
1226
1224
|
"select",
|
|
1227
1225
|
{
|
|
1228
1226
|
disabled: !l.length || o,
|
|
1229
1227
|
className: `${r ? "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`,
|
|
1230
|
-
onChange: (
|
|
1231
|
-
onKeyDown: (
|
|
1232
|
-
|
|
1228
|
+
onChange: (a) => s(a.target.value),
|
|
1229
|
+
onKeyDown: (a) => {
|
|
1230
|
+
a.ctrlKey && (a.key === "z" && d(), a.key === "y" && i());
|
|
1233
1231
|
},
|
|
1234
|
-
value:
|
|
1232
|
+
value: n,
|
|
1235
1233
|
children: [
|
|
1236
1234
|
/* @__PURE__ */ e.jsx("option", { className: "bg-transparent", value: "" }),
|
|
1237
1235
|
I.Children.toArray(
|
|
1238
|
-
l.map((
|
|
1236
|
+
l.map((a) => /* @__PURE__ */ e.jsx("option", { className: "bg-transparent", value: a, children: a }))
|
|
1239
1237
|
)
|
|
1240
1238
|
]
|
|
1241
1239
|
}
|
|
1242
1240
|
);
|
|
1243
1241
|
}
|
|
1244
1242
|
const Kr = ({ property: t, onChange: s }) => {
|
|
1245
|
-
const { canReset: r, canChange: l } = re(se), o = le(t),
|
|
1246
|
-
return /* @__PURE__ */ e.jsx("div", { className: "flex flex-row divide-x divide-solid divide-border rounded border border-border text-xs", children:
|
|
1243
|
+
const { canReset: r, canChange: l } = re(se), o = le(t), n = N(() => u(o, "cls", ""), [o]), d = N(() => u(ge, `${t}.classes`, [""]), [t]), i = d.indexOf(n) > -1 ? d.indexOf(n) : 0, a = /\[.*\]/g.test(n);
|
|
1244
|
+
return /* @__PURE__ */ e.jsx("div", { className: "flex flex-row divide-x divide-solid divide-border rounded border border-border text-xs", children: a ? /* @__PURE__ */ e.jsx("div", { className: "py-[5px] px-2", children: n }) : /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
1247
1245
|
/* @__PURE__ */ e.jsx(
|
|
1248
1246
|
"button",
|
|
1249
1247
|
{
|
|
@@ -1277,7 +1275,7 @@ const Kr = ({ property: t, onChange: s }) => {
|
|
|
1277
1275
|
)
|
|
1278
1276
|
] }) });
|
|
1279
1277
|
}, qr = ({ property: t, onChange: s }) => {
|
|
1280
|
-
const r = N(() => u(ge, `${t}.classes`, [""]), [t]), { canChange: l } = re(se), o = le(t),
|
|
1278
|
+
const r = N(() => u(ge, `${t}.classes`, [""]), [t]), { canChange: l } = re(se), o = le(t), n = N(() => u(o, "cls", ""), [o]);
|
|
1281
1279
|
return /* @__PURE__ */ e.jsx("div", { className: "flex grow flex-wrap gap-1", children: C(r, (d) => /* @__PURE__ */ e.jsxs(W, { children: [
|
|
1282
1280
|
/* @__PURE__ */ e.jsx(X, { asChild: !0, children: /* @__PURE__ */ e.jsx(
|
|
1283
1281
|
"button",
|
|
@@ -1285,7 +1283,7 @@ const Kr = ({ property: t, onChange: s }) => {
|
|
|
1285
1283
|
type: "button",
|
|
1286
1284
|
disabled: !l,
|
|
1287
1285
|
onClick: () => s(d, t),
|
|
1288
|
-
className: `cursor-pointer rounded border border-gray-600 p-1 disabled:cursor-not-allowed ${
|
|
1286
|
+
className: `cursor-pointer rounded border border-gray-600 p-1 disabled:cursor-not-allowed ${n === d ? " bg-blue-500 text-white" : "disabled:bg-gray-600 disabled:text-gray-400"}`,
|
|
1289
1287
|
children: I.createElement(u(lt, d, Xe))
|
|
1290
1288
|
}
|
|
1291
1289
|
) }),
|
|
@@ -1304,12 +1302,12 @@ const Kr = ({ property: t, onChange: s }) => {
|
|
|
1304
1302
|
ringColor: "ring",
|
|
1305
1303
|
ringOffsetColor: "ring-offset"
|
|
1306
1304
|
}, Qr = ({ property: t, onChange: s }) => {
|
|
1307
|
-
const r = le(t), l = N(() => u(r, "cls", ""), [r]), { canChange: o } = re(se), [
|
|
1305
|
+
const r = le(t), l = N(() => u(r, "cls", ""), [r]), { canChange: o } = re(se), [n, d] = w([]), [i, a] = w({ color: "", shade: "" }), p = l.split("-"), g = u(p, "1", ""), c = u(p, "2", ""), m = A(
|
|
1308
1306
|
// eslint-disable-next-line no-shadow
|
|
1309
1307
|
(x) => {
|
|
1310
|
-
["current", "inherit", "transparent", "black", "white"].includes(x) ? (d([]),
|
|
1308
|
+
["current", "inherit", "transparent", "black", "white"].includes(x) ? (d([]), a({ color: x })) : (d(["50", "100", "200", "300", "400", "500", "600", "700", "800", "900"]), a((f) => ({ ...f, color: x, shade: f.shade ? f.shade : "500" })));
|
|
1311
1309
|
},
|
|
1312
|
-
[d,
|
|
1310
|
+
[d, a]
|
|
1313
1311
|
);
|
|
1314
1312
|
_(() => {
|
|
1315
1313
|
if (["current", "inherit", "transparent", "black", "white"].includes(g))
|
|
@@ -1319,12 +1317,12 @@ const Kr = ({ property: t, onChange: s }) => {
|
|
|
1319
1317
|
const h = A(
|
|
1320
1318
|
// eslint-disable-next-line no-shadow
|
|
1321
1319
|
(x) => {
|
|
1322
|
-
|
|
1320
|
+
a({ color: g, shade: x });
|
|
1323
1321
|
},
|
|
1324
1322
|
[g]
|
|
1325
1323
|
);
|
|
1326
1324
|
return _(() => {
|
|
1327
|
-
|
|
1325
|
+
a({ color: "", shade: "" });
|
|
1328
1326
|
}, [r]), _(() => {
|
|
1329
1327
|
const f = `${u(Jr, t, "")}-${i.color}${i.shade ? `-${i.shade}` : ""}`;
|
|
1330
1328
|
f.match(new RegExp(u(ge, `${t}.regExp`, ""))) && s(f, t);
|
|
@@ -1368,7 +1366,7 @@ const Kr = ({ property: t, onChange: s }) => {
|
|
|
1368
1366
|
]
|
|
1369
1367
|
}
|
|
1370
1368
|
) }),
|
|
1371
|
-
/* @__PURE__ */ e.jsx("button", { type: "button", className: "grow text-center", children: /* @__PURE__ */ e.jsx(we, { rounded: !0, selected: c, disabled: !g || !o, onChange: h, options:
|
|
1369
|
+
/* @__PURE__ */ e.jsx("button", { type: "button", className: "grow text-center", children: /* @__PURE__ */ e.jsx(we, { rounded: !0, selected: c, disabled: !g || !o, onChange: h, options: n }) })
|
|
1372
1370
|
] });
|
|
1373
1371
|
}, $e = (t, s) => {
|
|
1374
1372
|
t = t.toLowerCase();
|
|
@@ -1377,8 +1375,8 @@ const Kr = ({ property: t, onChange: s }) => {
|
|
|
1377
1375
|
return { value: "", unit: r };
|
|
1378
1376
|
const l = s.length ? new RegExp(s.join("|"), "g") : /XXXXXX/g;
|
|
1379
1377
|
r = r.replace(l, "");
|
|
1380
|
-
const o = t.match(l),
|
|
1381
|
-
return
|
|
1378
|
+
const o = t.match(l), n = o && o.length > 1, d = !b(r) && Number.isNaN(Number(r));
|
|
1379
|
+
return n || d ? { error: "Invalid value" } : o && (o[0] === "auto" || o[0] === "none") ? { value: o[0], unit: "" } : { value: r, unit: o ? o[0] : "" };
|
|
1382
1380
|
};
|
|
1383
1381
|
const es = (t) => {
|
|
1384
1382
|
const s = t.startsWith("-") ? "-" : "", r = t.split("-").pop();
|
|
@@ -1504,7 +1502,7 @@ const es = (t) => {
|
|
|
1504
1502
|
if (["max", "min", "fit"].includes(r))
|
|
1505
1503
|
return { value: t, unit: "class" };
|
|
1506
1504
|
if (r.includes("/")) {
|
|
1507
|
-
const [l, o] = C(r.split("/"), (
|
|
1505
|
+
const [l, o] = C(r.split("/"), (n) => parseInt(n, 10));
|
|
1508
1506
|
return { value: s + (l / o * 100).toFixed(2).replace(".00", ""), unit: "%" };
|
|
1509
1507
|
}
|
|
1510
1508
|
return ft(parseFloat(r)) ? { value: `${s + parseFloat(r) * 4}`, unit: "px" } : { value: r, unit: "class" };
|
|
@@ -1526,7 +1524,7 @@ const ts = (t) => {
|
|
|
1526
1524
|
onDrag: r,
|
|
1527
1525
|
onDragEnd: l,
|
|
1528
1526
|
onDragStart: o,
|
|
1529
|
-
negative:
|
|
1527
|
+
negative: n,
|
|
1530
1528
|
cssProperty: d
|
|
1531
1529
|
}) => {
|
|
1532
1530
|
const { setDragData: i } = re(nt);
|
|
@@ -1534,15 +1532,15 @@ const ts = (t) => {
|
|
|
1534
1532
|
"button",
|
|
1535
1533
|
{
|
|
1536
1534
|
type: "button",
|
|
1537
|
-
onMouseDown: (
|
|
1535
|
+
onMouseDown: (a) => {
|
|
1538
1536
|
const p = {
|
|
1539
1537
|
onDrag: r,
|
|
1540
1538
|
onDragEnd: l,
|
|
1541
1539
|
dragging: !0,
|
|
1542
|
-
dragStartY:
|
|
1540
|
+
dragStartY: a.pageY,
|
|
1543
1541
|
dragStartValue: `${s}`,
|
|
1544
1542
|
dragUnit: t,
|
|
1545
|
-
negative:
|
|
1543
|
+
negative: n,
|
|
1546
1544
|
cssProperty: d
|
|
1547
1545
|
};
|
|
1548
1546
|
o(p), i(p);
|
|
@@ -1565,15 +1563,15 @@ const ts = (t) => {
|
|
|
1565
1563
|
},
|
|
1566
1564
|
l
|
|
1567
1565
|
)) }), Le = 50, os = (t) => {
|
|
1568
|
-
const [s, r] = w(!1), [l, o] = w(""), { currentClass:
|
|
1566
|
+
const [s, r] = w(!1), [l, o] = w(""), { currentClass: n, onChange: d, classPrefix: i, cssProperty: a, units: p, negative: g } = t, [c, m] = w(a != null && a.toLowerCase().includes("width") ? "%" : p[0]), [h, x] = w(!1), [f, T] = w(""), [D, j] = w(!1), [L, P] = w(!1);
|
|
1569
1567
|
_(() => {
|
|
1570
|
-
const { value: y, unit: v } = ts(
|
|
1568
|
+
const { value: y, unit: v } = ts(n);
|
|
1571
1569
|
if (v === "") {
|
|
1572
|
-
o(y), m(
|
|
1570
|
+
o(y), m(a != null && a.toLowerCase().includes("width") ? "%" : pe(p));
|
|
1573
1571
|
return;
|
|
1574
1572
|
}
|
|
1575
1573
|
m(v), o(v === "class" || b(y) ? "" : y);
|
|
1576
|
-
}, [
|
|
1574
|
+
}, [n, a, p]);
|
|
1577
1575
|
const k = be((y) => d(y), [d], Le), $ = be((y) => d(y, !1), [d], Le), F = A(
|
|
1578
1576
|
(y = !1) => {
|
|
1579
1577
|
const v = $e(`${l}`, p);
|
|
@@ -1611,7 +1609,7 @@ const ts = (t) => {
|
|
|
1611
1609
|
[k, l, i, p]
|
|
1612
1610
|
);
|
|
1613
1611
|
return /* @__PURE__ */ e.jsx("div", { className: "flex w-full flex-col", children: /* @__PURE__ */ e.jsx("div", { className: "flex items-center justify-start", children: c === "class" ? /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
1614
|
-
/* @__PURE__ */ e.jsx("input", { className: "w-20 rounded py-1", readOnly: !0, value:
|
|
1612
|
+
/* @__PURE__ */ e.jsx("input", { className: "w-20 rounded py-1", readOnly: !0, value: n }),
|
|
1615
1613
|
/* @__PURE__ */ e.jsxs(W, { children: [
|
|
1616
1614
|
/* @__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(Ne, {}) }) }),
|
|
1617
1615
|
/* @__PURE__ */ e.jsx(Z, { children: "Current value is using a Tailwind preset class." })
|
|
@@ -1698,7 +1696,7 @@ const ts = (t) => {
|
|
|
1698
1696
|
currentValue: l,
|
|
1699
1697
|
unit: c,
|
|
1700
1698
|
negative: g,
|
|
1701
|
-
cssProperty:
|
|
1699
|
+
cssProperty: a
|
|
1702
1700
|
}
|
|
1703
1701
|
)
|
|
1704
1702
|
] }) }) });
|
|
@@ -1790,14 +1788,14 @@ const ts = (t) => {
|
|
|
1790
1788
|
"2xl": "1536px"
|
|
1791
1789
|
}, is = (t) => `${t.toUpperCase()} ${Oe[t] ? `(${Oe[t]} & up)` : ""}`, Re = (t) => {
|
|
1792
1790
|
const { type: s = "icons", label: r, property: l, onEmitChange: o = () => {
|
|
1793
|
-
}, units:
|
|
1791
|
+
}, units: n, negative: d = !1 } = t, [i] = gr(), [a] = Qe(), [, p] = Be(), g = le(l), c = Ke(), m = qe(), [h] = Je(), x = N(() => u(g, "fullCls", ""), [g]), f = A(
|
|
1794
1792
|
(k, $ = !0) => {
|
|
1795
|
-
const F = { dark: i, mq: p, mod:
|
|
1796
|
-
(i ||
|
|
1793
|
+
const F = { dark: i, mq: p, mod: a, cls: k, property: l, fullCls: "" };
|
|
1794
|
+
(i || a !== "") && (F.mq = "xs");
|
|
1797
1795
|
const oe = $r(F);
|
|
1798
1796
|
c(h, [oe], $);
|
|
1799
1797
|
},
|
|
1800
|
-
[h, i, p,
|
|
1798
|
+
[h, i, p, a, l, c]
|
|
1801
1799
|
), T = A(() => {
|
|
1802
1800
|
m(h, [x]);
|
|
1803
1801
|
}, [h, x, m]), D = N(() => ns(g, p), [g, p]);
|
|
@@ -1816,7 +1814,7 @@ const ts = (t) => {
|
|
|
1816
1814
|
}[k]);
|
|
1817
1815
|
},
|
|
1818
1816
|
[j]
|
|
1819
|
-
), P = u(g, "dark", null) === i && u(g, "mod", null) ===
|
|
1817
|
+
), P = u(g, "dark", null) === i && u(g, "mod", null) === a && u(g, "mq", null) === p;
|
|
1820
1818
|
return /* @__PURE__ */ e.jsx(Gr, { canChange: D, canReset: g && P, children: /* @__PURE__ */ e.jsxs("div", { className: "group flex flex-row items-center py-2 first:pt-0 last:pb-0", children: [
|
|
1821
1819
|
/* @__PURE__ */ e.jsx("div", { className: "relative w-[70px] truncate text-xs text-foreground", children: /* @__PURE__ */ e.jsx("span", { className: `text-[11px] ${g && !P ? "text-foreground" : ""}`, children: r }) }),
|
|
1822
1820
|
/* @__PURE__ */ e.jsxs("div", { className: "flex flex-row items-center", children: [
|
|
@@ -1826,7 +1824,7 @@ const ts = (t) => {
|
|
|
1826
1824
|
{
|
|
1827
1825
|
currentClass: u(g, "cls", ""),
|
|
1828
1826
|
classPrefix: u(as, l, ""),
|
|
1829
|
-
units:
|
|
1827
|
+
units: n || [],
|
|
1830
1828
|
onChange: f,
|
|
1831
1829
|
negative: d,
|
|
1832
1830
|
cssProperty: l
|
|
@@ -1875,10 +1873,10 @@ const ts = (t) => {
|
|
|
1875
1873
|
borderB: r = !1,
|
|
1876
1874
|
borderT: l = !1,
|
|
1877
1875
|
type: o = "arbitrary",
|
|
1878
|
-
units:
|
|
1876
|
+
units: n = ds,
|
|
1879
1877
|
negative: d = !1
|
|
1880
1878
|
}) => {
|
|
1881
|
-
const [i,
|
|
1879
|
+
const [i, a] = w(s[0].key), p = xe(), g = A((c) => C(p, "property").includes(c), [p]);
|
|
1882
1880
|
return /* @__PURE__ */ e.jsxs(
|
|
1883
1881
|
"div",
|
|
1884
1882
|
{
|
|
@@ -1892,7 +1890,7 @@ const ts = (t) => {
|
|
|
1892
1890
|
"button",
|
|
1893
1891
|
{
|
|
1894
1892
|
type: "button",
|
|
1895
|
-
onClick: () =>
|
|
1893
|
+
onClick: () => a(m),
|
|
1896
1894
|
className: `relative cursor-pointer rounded-full p-1 text-[8px] ${m === i ? " bg-[#3E57F0] text-white" : "text-gray-600 dark:text-gray-300"}`,
|
|
1897
1895
|
children: [
|
|
1898
1896
|
I.createElement("div", {
|
|
@@ -1910,7 +1908,7 @@ const ts = (t) => {
|
|
|
1910
1908
|
Re,
|
|
1911
1909
|
{
|
|
1912
1910
|
type: o,
|
|
1913
|
-
units: [...
|
|
1911
|
+
units: [...n],
|
|
1914
1912
|
label: "",
|
|
1915
1913
|
property: i,
|
|
1916
1914
|
negative: d
|
|
@@ -1922,11 +1920,11 @@ const ts = (t) => {
|
|
|
1922
1920
|
}, cs = ({ heading: t, items: s }) => {
|
|
1923
1921
|
const r = xe(), l = N(() => {
|
|
1924
1922
|
const o = (i) => U(
|
|
1925
|
-
i.map((
|
|
1926
|
-
),
|
|
1923
|
+
i.map((a) => a.styleType === "multiple" ? C(a.options, "key") : a.property)
|
|
1924
|
+
), n = U(
|
|
1927
1925
|
s.map((i) => i.styleType === "accordion" ? o(i.items) : i.styleType === "multiple" ? C(i.options, "key") : i.property)
|
|
1928
1926
|
), d = C(r, "property");
|
|
1929
|
-
return Fe(
|
|
1927
|
+
return Fe(n, d).length > 0;
|
|
1930
1928
|
}, [r, s]);
|
|
1931
1929
|
return /* @__PURE__ */ e.jsxs("details", { children: [
|
|
1932
1930
|
/* @__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: [
|
|
@@ -1942,13 +1940,13 @@ const ts = (t) => {
|
|
|
1942
1940
|
] });
|
|
1943
1941
|
}, ps = Me({}), ye = ({ section: t }) => {
|
|
1944
1942
|
const s = xe(), r = A(
|
|
1945
|
-
(
|
|
1943
|
+
(n = []) => {
|
|
1946
1944
|
const d = {};
|
|
1947
|
-
for (let
|
|
1948
|
-
d[s[
|
|
1945
|
+
for (let a = 0; a < s.length; a++)
|
|
1946
|
+
d[s[a].property] = s[a].cls;
|
|
1949
1947
|
let i = !0;
|
|
1950
|
-
for (const
|
|
1951
|
-
if (!he(d,
|
|
1948
|
+
for (const a in n)
|
|
1949
|
+
if (!he(d, a) || d[a] !== n[a]) {
|
|
1952
1950
|
i = !1;
|
|
1953
1951
|
break;
|
|
1954
1952
|
}
|
|
@@ -1958,10 +1956,10 @@ const ts = (t) => {
|
|
|
1958
1956
|
), l = N(() => {
|
|
1959
1957
|
if (s.length > 0 && t.heading === "Classes")
|
|
1960
1958
|
return !0;
|
|
1961
|
-
const
|
|
1962
|
-
|
|
1959
|
+
const n = (a) => U(
|
|
1960
|
+
a.map((p) => p.styleType === "multiple" ? U(C(p.options, "key")) : p.property)
|
|
1963
1961
|
), d = U(
|
|
1964
|
-
t.items.map((
|
|
1962
|
+
t.items.map((a) => a.styleType === "accordion" ? n(a.items) : a.styleType === "multiple" ? U(C(a.options, "key")) : a.property)
|
|
1965
1963
|
), i = C(s, "property");
|
|
1966
1964
|
return Fe(d, i).length > 0;
|
|
1967
1965
|
}, [s, t.heading, t.items]), o = N(() => ({}), []);
|
|
@@ -1971,7 +1969,7 @@ const ts = (t) => {
|
|
|
1971
1969
|
t.heading
|
|
1972
1970
|
] }) }),
|
|
1973
1971
|
/* @__PURE__ */ e.jsx(ce, { className: "bg-gray-100 px-3.5 py-2", children: I.Children.toArray(
|
|
1974
|
-
t.items.map((
|
|
1972
|
+
t.items.map((n) => he(n, "component") ? I.createElement(n.component, { key: n.label }) : he(n, "styleType") ? n.styleType === "multiple" ? /* @__PURE__ */ e.jsx(at, { ...n }, n.label) : n.styleType === "accordion" && r(n == null ? void 0 : n.conditions) ? /* @__PURE__ */ e.jsx(cs, { ...n }, n.label) : null : /* @__PURE__ */ e.jsx(Re, { ...n }, n.label))
|
|
1975
1973
|
) })
|
|
1976
1974
|
] }) });
|
|
1977
1975
|
}, us = ({
|
|
@@ -1985,7 +1983,7 @@ const ts = (t) => {
|
|
|
1985
1983
|
"input",
|
|
1986
1984
|
{
|
|
1987
1985
|
name: "key",
|
|
1988
|
-
onChange: (
|
|
1986
|
+
onChange: (n) => l(n, s),
|
|
1989
1987
|
value: t.key,
|
|
1990
1988
|
placeholder: "Key",
|
|
1991
1989
|
className: "w-full rounded border-gray-300 bg-background p-0.5 pl-2 text-sm focus-visible:outline-0",
|
|
@@ -1998,7 +1996,7 @@ const ts = (t) => {
|
|
|
1998
1996
|
"input",
|
|
1999
1997
|
{
|
|
2000
1998
|
name: "value",
|
|
2001
|
-
onChange: (
|
|
1999
|
+
onChange: (n) => b(t.key) ? {} : l(n, s),
|
|
2002
2000
|
value: t.value,
|
|
2003
2001
|
placeholder: "Value",
|
|
2004
2002
|
className: "w-full rounded border-gray-300 bg-background p-0.5 pl-2 text-sm focus-visible:outline-0",
|
|
@@ -2016,12 +2014,12 @@ const ts = (t) => {
|
|
|
2016
2014
|
] })
|
|
2017
2015
|
] }), xs = ({ section: t }) => {
|
|
2018
2016
|
var m;
|
|
2019
|
-
const { setSyncState: s } = hr(), r = G(), [l, o] = w([]), [
|
|
2017
|
+
const { setSyncState: s } = hr(), r = G(), [l, o] = w([]), [n] = Te(), d = Ue(), i = `${u(n, "0.prop")}_attrs`;
|
|
2020
2018
|
ne.useEffect(() => {
|
|
2021
2019
|
const h = C(u(r, i), (x, f) => ({ key: f, value: x }));
|
|
2022
2020
|
b(h) ? o([]) : o(h);
|
|
2023
2021
|
}, [u(r, i)]);
|
|
2024
|
-
const
|
|
2022
|
+
const a = () => o([...l, { key: "", value: "" }]), p = (h) => {
|
|
2025
2023
|
const x = ve(l, (f, T) => h !== T);
|
|
2026
2024
|
c(x);
|
|
2027
2025
|
}, g = (h, x) => {
|
|
@@ -2055,7 +2053,7 @@ const ts = (t) => {
|
|
|
2055
2053
|
className: `flex h-6 w-max items-center justify-center gap-x-0.5 rounded-full border p-1 px-2 text-xs ${!b(l) && b((m = fe(l)) == null ? void 0 : m.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"}`,
|
|
2056
2054
|
onClick: () => {
|
|
2057
2055
|
var h;
|
|
2058
|
-
!b(l) && b((h = fe(l)) == null ? void 0 : h.key) ||
|
|
2056
|
+
!b(l) && b((h = fe(l)) == null ? void 0 : h.key) || a();
|
|
2059
2057
|
},
|
|
2060
2058
|
children: [
|
|
2061
2059
|
/* @__PURE__ */ e.jsx(ke, { width: 12, height: 12 }),
|
|
@@ -2086,10 +2084,10 @@ const ts = (t) => {
|
|
|
2086
2084
|
] });
|
|
2087
2085
|
};
|
|
2088
2086
|
function gs() {
|
|
2089
|
-
const [t, s] = Qe(), { flexChild: r, gridChild: l } = mr(), [, o] = Ar(yr), { t:
|
|
2087
|
+
const [t, s] = Qe(), { flexChild: r, gridChild: l } = mr(), [, o] = Ar(yr), { t: n } = Ye(), [d] = Te();
|
|
2090
2088
|
return b(d) ? /* @__PURE__ */ e.jsx("div", { className: "p-4 text-center", children: /* @__PURE__ */ e.jsxs("div", { className: "space-y-4 rounded-xl p-4", children: [
|
|
2091
2089
|
/* @__PURE__ */ e.jsx(Ze, { className: "mx-auto text-3xl" }),
|
|
2092
|
-
/* @__PURE__ */ e.jsx("h1", { children:
|
|
2090
|
+
/* @__PURE__ */ e.jsx("h1", { children: n("no_styling_block_selected") }),
|
|
2093
2091
|
/* @__PURE__ */ e.jsxs("p", { className: "text-xs ", children: [
|
|
2094
2092
|
"Hint: Styling allowed blocks are highlighted with",
|
|
2095
2093
|
" ",
|
|
@@ -2143,9 +2141,9 @@ const hs = {
|
|
|
2143
2141
|
deg: 1,
|
|
2144
2142
|
ms: 0.1
|
|
2145
2143
|
}, Nl = () => {
|
|
2146
|
-
const t = G(), { t: s } = Ye(), [r, l] = I.useState(""), [o,
|
|
2147
|
-
onDrag: (
|
|
2148
|
-
onDragEnd: (
|
|
2144
|
+
const t = G(), { t: s } = Ye(), [r, l] = I.useState(""), [o, n] = I.useState({
|
|
2145
|
+
onDrag: (a) => a,
|
|
2146
|
+
onDragEnd: (a) => a,
|
|
2149
2147
|
dragStartY: 0,
|
|
2150
2148
|
dragging: !1,
|
|
2151
2149
|
dragStartValue: 0,
|
|
@@ -2153,21 +2151,21 @@ const hs = {
|
|
|
2153
2151
|
negative: !1,
|
|
2154
2152
|
cssProperty: ""
|
|
2155
2153
|
}), d = be(
|
|
2156
|
-
(
|
|
2154
|
+
(a) => {
|
|
2157
2155
|
const p = !u(o, "negative", !1), g = u(o, "cssProperty", "");
|
|
2158
2156
|
let c = parseFloat(o.dragStartValue);
|
|
2159
2157
|
c = _e(c) ? 0 : c;
|
|
2160
2158
|
let m = hs[o.dragUnit];
|
|
2161
2159
|
(z(g, "scale") || g === "opacity") && (m = 10);
|
|
2162
|
-
let x = (o.dragStartY -
|
|
2160
|
+
let x = (o.dragStartY - a.pageY) / m + c;
|
|
2163
2161
|
p && x < 0 && (x = 0), g === "opacity" && x > 1 && (x = 1), o.onDrag(`${x}`), l(`${x}`);
|
|
2164
2162
|
},
|
|
2165
2163
|
[o],
|
|
2166
2164
|
50
|
|
2167
2165
|
), i = A(() => {
|
|
2168
|
-
setTimeout(() => o.onDragEnd(`${r}`), 100),
|
|
2169
|
-
onDrag: (
|
|
2170
|
-
onDragEnd: (
|
|
2166
|
+
setTimeout(() => o.onDragEnd(`${r}`), 100), n({
|
|
2167
|
+
onDrag: (a) => a,
|
|
2168
|
+
onDragEnd: (a) => a,
|
|
2171
2169
|
dragStartY: 0,
|
|
2172
2170
|
dragging: !1,
|
|
2173
2171
|
dragStartValue: 0,
|
|
@@ -2175,11 +2173,11 @@ const hs = {
|
|
|
2175
2173
|
negative: !1,
|
|
2176
2174
|
cssProperty: ""
|
|
2177
2175
|
});
|
|
2178
|
-
}, [o, r,
|
|
2176
|
+
}, [o, r, n]);
|
|
2179
2177
|
return wt(t) ? /* @__PURE__ */ e.jsx("div", { className: "p-4 text-center", children: /* @__PURE__ */ e.jsxs("div", { className: "space-y-4 rounded-xl p-4", children: [
|
|
2180
2178
|
/* @__PURE__ */ e.jsx(Ze, { className: "mx-auto text-3xl" }),
|
|
2181
2179
|
/* @__PURE__ */ e.jsx("h1", { children: s("no_block_selected_for_styling") })
|
|
2182
|
-
] }) }) : /* @__PURE__ */ e.jsx(tt, { children: /* @__PURE__ */ e.jsxs(nt.Provider, { value: { setDragData:
|
|
2180
|
+
] }) }) : /* @__PURE__ */ e.jsx(tt, { children: /* @__PURE__ */ e.jsxs(nt.Provider, { value: { setDragData: n }, children: [
|
|
2183
2181
|
o.dragging ? /* @__PURE__ */ e.jsx(
|
|
2184
2182
|
"div",
|
|
2185
2183
|
{
|