@chaibuilder/sdk 1.2.48 → 1.2.50
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-cX8vIt0V.js → AddBlocks-IX7HKzSe.js} +15 -15
- package/dist/AddBlocks-zwZ63DdP.cjs +1 -0
- package/dist/CanvasArea-URgoG1jc.cjs +56 -0
- package/dist/{CanvasArea-HRipTJFS.js → CanvasArea-ehmBje_E.js} +285 -269
- package/dist/{ChaiBuilderEditor-dKHRL-Es.js → ChaiBuilderEditor-3xIN-AP_.js} +7592 -7645
- package/dist/{ChaiBuilderEditor-EtQOC5uy.cjs → ChaiBuilderEditor-ZRHqW7Gd.cjs} +50 -50
- package/dist/CodeEditor-0F7Dz3AB.js +97 -0
- package/dist/CodeEditor-1vu-qNgT.cjs +1 -0
- package/dist/CurrentPage-HOPNdQZ-.cjs +1 -0
- package/dist/{CurrentPage-U8ms8Hs7.js → CurrentPage-qhBjm7th.js} +10 -10
- package/dist/ListTree-DkbFFDXB.cjs +1 -0
- package/dist/{ListTree-OgLdyfQs.js → ListTree-sTwXvXST.js} +123 -114
- package/dist/{MODIFIERS-cBT31iqE.js → MODIFIERS-fd5XOmum.js} +8 -4
- package/dist/MODIFIERS-mVmfEGgo.cjs +1 -0
- package/dist/{PagesPanel-MsUBq9Xx.js → PagesPanel-5iVsbDP1.js} +7 -7
- package/dist/PagesPanel-kdl4A0IN.cjs +1 -0
- package/dist/{ProjectPanel-hsZG_Btj.js → ProjectPanel-c8oTzhQd.js} +7 -7
- package/dist/ProjectPanel-mXPBI-TU.cjs +1 -0
- package/dist/{Settings-WcLqIeQy.js → Settings-0uSGoECC.js} +536 -514
- package/dist/Settings-3kBSStO6.cjs +1 -0
- package/dist/{SidePanels-PmCljlnf.js → SidePanels-YLWdBer9.js} +108 -115
- package/dist/SidePanels-kKram02Q.cjs +1 -0
- package/dist/ThemeConfiguration-8W1CM4tW.cjs +1 -0
- package/dist/{ThemeConfiguration-mkbFdePB.js → ThemeConfiguration-AAGFJieC.js} +5 -5
- package/dist/Topbar-CLNUPx7K.cjs +1 -0
- package/dist/{Topbar-FPywhpub.js → Topbar-nX9Muoem.js} +8 -8
- package/dist/UILibrariesPanel-cp0Mkaq_.cjs +1 -0
- package/dist/UILibrariesPanel-fKn2nlgI.js +196 -0
- package/dist/UnsplashImages-56HoW_ZA.cjs +1 -0
- package/dist/{UnsplashImages-7uAXYHPH.js → UnsplashImages-zTZa3LjG.js} +4 -4
- package/dist/{UploadImages-5M0Q27R-.js → UploadImages-SnfaTrlz.js} +4 -4
- package/dist/UploadImages-okNGjkXb.cjs +1 -0
- package/dist/add-page-modal-Y2RY3x01.cjs +1 -0
- package/dist/{add-page-modal-6o7MAbq-.js → add-page-modal-uDoO0zws.js} +12 -12
- package/dist/{confirm-alert-jL0z_gFv.js → confirm-alert-9XiVxCc0.js} +4 -4
- package/dist/confirm-alert-aD7AMK_6.cjs +1 -0
- package/dist/controls-rRZhz0vu.cjs +1 -0
- package/dist/{controls-VTdJhdSz.js → controls-yjgoZzB6.js} +31 -18
- package/dist/core.cjs +1 -1
- package/dist/core.js +6 -6
- package/dist/{delete-page-modal-U5_JYYp7.js → delete-page-modal-7sfoFf9r.js} +6 -6
- package/dist/delete-page-modal-ieJ367JA.cjs +1 -0
- package/dist/email-blocks.cjs +1 -1
- package/dist/email-blocks.js +1 -1
- package/dist/email.cjs +1 -1
- package/dist/email.js +4 -4
- package/dist/{form-KBtrnNWh.cjs → form-KWYHDVIf.cjs} +1 -1
- package/dist/{form-Sgpl2fXL.js → form-PQSmqcIl.js} +1 -1
- package/dist/{functions-7ybAMUuA.js → functions-JO0EW8GX.js} +6 -7
- package/dist/functions-ZZVUnIjD.cjs +1 -0
- package/dist/{html-to-json-Z6R2o_fA.js → html-to-json-GJ6RioQf.js} +1 -1
- package/dist/html-to-json-O1OpqICe.cjs +1 -0
- package/dist/index-VOrp9ZpX.cjs +1 -0
- package/dist/index-YpnaudSM.js +63 -0
- package/dist/index-ecnGWzh9.cjs +1 -0
- package/dist/{index-po-naEa5.js → index-i2kgLkjC.js} +15 -14
- package/dist/lib.cjs +2 -2
- package/dist/lib.d.ts +1 -1
- package/dist/lib.js +19 -21
- package/dist/page-viewer-aoro5JxT.cjs +1 -0
- package/dist/{page-viewer-nLRRk7DR.js → page-viewer-qkwZJ6e-.js} +7 -7
- package/dist/{project-general-setting-D1UJdZ2D.js → project-general-setting-3gkaXq1F.js} +8 -8
- package/dist/project-general-setting-arXitV5_.cjs +1 -0
- package/dist/{project-seo-setting-VIZWEMRk.js → project-seo-setting-X8pykTmc.js} +6 -6
- package/dist/project-seo-setting-kjtUt-er.cjs +1 -0
- package/dist/render.cjs +1 -1
- package/dist/render.js +89 -90
- package/dist/single-page-detail-UsWG0gfh.cjs +1 -0
- package/dist/{single-page-detail-lQ8fujC5.js → single-page-detail-ZXZX6Xmw.js} +21 -21
- package/dist/studio.cjs +1 -1
- package/dist/studio.js +6 -6
- package/dist/ui.cjs +1 -1
- package/dist/ui.js +93 -93
- package/dist/useCodeEditor-CtjbxWLf.cjs +1 -0
- package/dist/useCodeEditor-yl5V3Hte.js +7 -0
- package/dist/{utils-K3Zk762G.cjs → utils-D_vtk3zK.cjs} +1 -1
- package/dist/{utils-iMv3T4WT.js → utils-VpVqnC9m.js} +1 -1
- package/dist/web-blocks.cjs +1 -33
- package/dist/web-blocks.js +468 -616
- package/package.json +4 -2
- package/dist/AddBlocks-_fhhS7Lm.cjs +0 -1
- package/dist/CanvasArea-N3rYeBJV.cjs +0 -55
- package/dist/CurrentPage-9FijxWbn.cjs +0 -1
- package/dist/ListTree-jOvHpo3_.cjs +0 -1
- package/dist/MODIFIERS-YPHRtwrM.cjs +0 -1
- package/dist/PagesPanel-8Cd6UYsh.cjs +0 -1
- package/dist/ProjectPanel-KmnXPfxx.cjs +0 -1
- package/dist/STRINGS--j49GZJP.js +0 -7
- package/dist/STRINGS-gPz7CUOk.cjs +0 -1
- package/dist/Settings-xVjTnVSf.cjs +0 -1
- package/dist/SidePanels-6zRgfZpi.cjs +0 -1
- package/dist/ThemeConfiguration-pt7TTAty.cjs +0 -1
- package/dist/Topbar--m1E08Jl.cjs +0 -1
- package/dist/UILibrariesPanel-HhHGcexY.cjs +0 -1
- package/dist/UILibrariesPanel-VrA2X4LO.js +0 -145
- package/dist/UnsplashImages-Yu0msAD8.cjs +0 -1
- package/dist/UploadImages-jS51ZcPG.cjs +0 -1
- package/dist/add-page-modal-KAbflupJ.cjs +0 -1
- package/dist/confirm-alert-dow0GlxC.cjs +0 -1
- package/dist/controls-jWJDao88.cjs +0 -1
- package/dist/delete-page-modal-EDQZneVM.cjs +0 -1
- package/dist/functions-yvRwasT2.cjs +0 -1
- package/dist/html-to-json-VPWiWWGH.cjs +0 -1
- package/dist/index-HjN7LtDT.cjs +0 -1
- package/dist/page-viewer-PfZEbcDZ.cjs +0 -1
- package/dist/project-general-setting-HO6zeum2.cjs +0 -1
- package/dist/project-seo-setting-gT9N1tnB.cjs +0 -1
- package/dist/single-page-detail-To8TcpgJ.cjs +0 -1
- package/dist/useCanvasSettings-7BXlDuLG.cjs +0 -1
- package/dist/useCanvasSettings-UzjYHFG5.js +0 -6
|
@@ -1,21 +1,21 @@
|
|
|
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 w, useMemo as T, useEffect as A, useCallback as H, memo as bt, useRef as mt, createContext as Fe, useContext as se } from "react";
|
|
4
4
|
import { useThrottledCallback as de } from "@react-hookz/web";
|
|
5
|
-
import { forEach as Ne, isArray as ce, omit as
|
|
6
|
-
import { useTranslation as
|
|
7
|
-
import { CopyIcon as
|
|
8
|
-
import {
|
|
9
|
-
import { Check as
|
|
10
|
-
import { getBlockComponent as Re, getChaiDataProviders as Er, useGlobalStylingPresets as
|
|
11
|
-
import { J as
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import { u as Zr } from "./
|
|
5
|
+
import { forEach as Ne, isArray as ce, omit as ft, truncate as vt, includes as X, get as y, first as oe, split as wt, startCase as F, toLower as re, isEmpty as m, map as _, find as Ze, last as jt, filter as ye, set as We, debounce as Ct, keys as he, cloneDeep as kt, each as Nt, capitalize as be, reject as _t, startsWith as W, nth as He, isNumber as St, parseInt as Tt, isNaN as Ue, findLast as Rt, flatten as De, intersection as Vt, has as ie, isNull as Ht } from "lodash-es";
|
|
6
|
+
import { useTranslation as I } from "react-i18next";
|
|
7
|
+
import { CopyIcon as Dt, PlusIcon as _e, Cross2Icon as Ke, EyeOpenIcon as Bt, EyeClosedIcon as Be, BorderAllIcon as Y, WidthIcon as R, HeightIcon as V, ArrowUpIcon as J, ArrowRightIcon as Q, ArrowDownIcon as ee, ArrowLeftIcon as te, ArrowTopLeftIcon as It, ArrowTopRightIcon as Pt, ArrowBottomRightIcon as At, ArrowBottomLeftIcon as $t, AlignLeftIcon as Et, AlignCenterHorizontallyIcon as Mt, AlignRightIcon as Lt, StretchHorizontallyIcon as Ot, FontItalicIcon as zt, UnderlineIcon as Yt, OverlineIcon as Xt, LetterCaseUppercaseIcon as Ft, Cross1Icon as Zt, InfoCircledIcon as Se, MinusIcon as Wt, BoxIcon as Ge, RowSpacingIcon as Ut, TriangleDownIcon as Kt, CrossCircledIcon as Gt, CaretDownIcon as qt, MixerHorizontalIcon as Jt } from "@radix-ui/react-icons";
|
|
8
|
+
import { a1 as qe, aP as Je, aQ as Qe, B, aR as et, aS as Qt, aT as er, aU as tr, aV as rr, aW as sr, aX as or, L as U, aK as tt, _ as lr, $ as ar, a0 as nr, aY as ir, Y as dr, aa as cr, Z as pr, ab as $, ac as E, ad as M, aZ as ur, a_ as gr, a$ as xr, b0 as yr, b1 as hr, b2 as br, b3 as mr, Q as rt, P as st, h as ot, b4 as fr, b5 as lt, b6 as me, b7 as fe, b8 as ve, b9 as vr, ba as wr, ag as jr, bb as Cr, X as pe, n as Te, H as at, K as nt, bc as it, bd as we, j as kr, be as Nr, I as ue, v as _r, O as Sr, o as Ie, au as Tr, av as Rr, aw as Vr, bf as dt, ax as Pe, ay as Ae, bg as $e, bh as Ee, bi as Me, R as Hr } from "./ChaiBuilderEditor-3xIN-AP_.js";
|
|
9
|
+
import { Check as Dr, EditIcon as Br, TrashIcon as Ir, Loader as Pr, SparklesIcon as Ar, DeleteIcon as $r } from "lucide-react";
|
|
10
|
+
import { getBlockComponent as Re, getChaiDataProviders as Er, useGlobalStylingPresets as Mr } from "@chaibuilder/runtime";
|
|
11
|
+
import { J as Lr, a as Or, d as zr } from "./index-e0c8PmRQ.js";
|
|
12
|
+
import Yr from "@rjsf/core";
|
|
13
|
+
import Xr from "@rjsf/validator-ajv8";
|
|
14
|
+
import { a as Fr, u as Zr } from "./useCodeEditor-yl5V3Hte.js";
|
|
15
15
|
import Wr from "react-autosuggest";
|
|
16
16
|
import Ur from "fuse.js";
|
|
17
|
-
import { A as
|
|
18
|
-
import { a as qr } from "./
|
|
17
|
+
import { A as Kr, C as ge, g as Gr } from "./utils-VpVqnC9m.js";
|
|
18
|
+
import { a as qr } from "./MODIFIERS-fd5XOmum.js";
|
|
19
19
|
import "./_commonjsHelpers-UyOWmZb0.js";
|
|
20
20
|
import "clsx";
|
|
21
21
|
import "react-dom";
|
|
@@ -26,7 +26,6 @@ import "i18next";
|
|
|
26
26
|
import "flagged";
|
|
27
27
|
import "./Functions-7jnEwJyw.js";
|
|
28
28
|
import "tailwind-merge";
|
|
29
|
-
import "./MODIFIERS-cBT31iqE.js";
|
|
30
29
|
import "tree-model";
|
|
31
30
|
import "@radix-ui/react-toggle";
|
|
32
31
|
import "class-variance-authority";
|
|
@@ -50,29 +49,30 @@ import "@radix-ui/react-context-menu";
|
|
|
50
49
|
import "react-icons-picker";
|
|
51
50
|
import "react-quill";
|
|
52
51
|
import "react-hotkeys-hook";
|
|
52
|
+
import "./index-YpnaudSM.js";
|
|
53
53
|
function Jr(r) {
|
|
54
|
-
const
|
|
55
|
-
function
|
|
54
|
+
const o = [], t = {};
|
|
55
|
+
function a(l, s) {
|
|
56
56
|
Ne(s, (d, c) => {
|
|
57
|
-
const
|
|
58
|
-
|
|
57
|
+
const n = l ? `${l}.${c}` : c, p = ce(d) ? "list" : typeof d;
|
|
58
|
+
o.push(n), t[n] = p === "string" ? "text" : p === "object" ? "model" : p, p === "object" && !ce(d) && a(n, d);
|
|
59
59
|
});
|
|
60
60
|
}
|
|
61
|
-
return
|
|
61
|
+
return a("", ft(r, ["styles", "_type", "_id", "_name", "_bindings"])), { paths: o, pathsType: t };
|
|
62
62
|
}
|
|
63
|
-
const
|
|
63
|
+
const je = ({ data: r, fullView: o }) => {
|
|
64
64
|
if (!r)
|
|
65
65
|
return null;
|
|
66
66
|
const t = typeof r;
|
|
67
|
-
return
|
|
67
|
+
return o ? typeof r == "object" ? /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
68
68
|
/* @__PURE__ */ e.jsx("div", { className: "h-3" }),
|
|
69
|
-
/* @__PURE__ */ e.jsx(
|
|
70
|
-
|
|
69
|
+
/* @__PURE__ */ e.jsx(qe, { children: /* @__PURE__ */ e.jsx(
|
|
70
|
+
Lr,
|
|
71
71
|
{
|
|
72
72
|
data: r,
|
|
73
|
-
shouldExpandNode:
|
|
73
|
+
shouldExpandNode: Or,
|
|
74
74
|
style: {
|
|
75
|
-
...
|
|
75
|
+
...zr,
|
|
76
76
|
container: "max-h-[40vh] overflow-y-auto text-[12px] leading-[1.5] tracking-wide font-mono",
|
|
77
77
|
stringValue: "text-orange-600",
|
|
78
78
|
label: "text-green-900 font-semibold pr-1 tracking-wider"
|
|
@@ -82,35 +82,35 @@ const we = ({ data: r, fullView: a }) => {
|
|
|
82
82
|
] }) : /* @__PURE__ */ e.jsxs("div", { className: "max-h-36 w-full overflow-y-auto overflow-x-hidden text-[12px] leading-4 text-gray-800/50", children: [
|
|
83
83
|
/* @__PURE__ */ e.jsx("span", { className: "font-medium text-gray-800/80", children: "Content: " }),
|
|
84
84
|
r
|
|
85
|
-
] }) : /* @__PURE__ */ e.jsx("div", { className: "w-full overflow-hidden whitespace-nowrap text-[10px] leading-3 text-gray-800/50", children:
|
|
85
|
+
] }) : /* @__PURE__ */ e.jsx("div", { className: "w-full overflow-hidden whitespace-nowrap text-[10px] leading-3 text-gray-800/50", children: vt(t === "object" ? JSON.stringify(r) : r, { length: 40 }) });
|
|
86
86
|
}, Le = ({
|
|
87
87
|
type: r,
|
|
88
|
-
value:
|
|
88
|
+
value: o = "",
|
|
89
89
|
setValue: t,
|
|
90
|
-
data:
|
|
90
|
+
data: a,
|
|
91
91
|
onChange: l,
|
|
92
92
|
dataType: s,
|
|
93
93
|
appliedBindings: d
|
|
94
94
|
}) => {
|
|
95
|
-
const { paths: c, pathsType:
|
|
96
|
-
(
|
|
97
|
-
) : c.filter((
|
|
98
|
-
return
|
|
99
|
-
|
|
100
|
-
}, [
|
|
95
|
+
const { paths: c, pathsType: n } = Jr(a), p = r === "PROP" ? Re(a == null ? void 0 : a._type) : {}, h = r === "PROP", [i, u] = w(!1), x = T(() => r === "PROP" ? c.filter(
|
|
96
|
+
(g) => !X(d, g) && y(p, `props.${oe(wt(g, "."))}.binding`)
|
|
97
|
+
) : c.filter((g) => s === y(n, g, "")), [r, c, d, s, p]);
|
|
98
|
+
return A(() => {
|
|
99
|
+
o && l(o);
|
|
100
|
+
}, [o, r]), /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
101
101
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-4", children: [
|
|
102
102
|
/* @__PURE__ */ e.jsx("p", { className: "text-sm text-muted-foreground", children: F(re(r)) }),
|
|
103
|
-
/* @__PURE__ */ e.jsxs(
|
|
104
|
-
/* @__PURE__ */ e.jsx(
|
|
105
|
-
|
|
103
|
+
/* @__PURE__ */ e.jsxs(Je, { open: i, onOpenChange: u, children: [
|
|
104
|
+
/* @__PURE__ */ e.jsx(Qe, { asChild: !0, children: /* @__PURE__ */ e.jsx(
|
|
105
|
+
B,
|
|
106
106
|
{
|
|
107
107
|
variant: "outline",
|
|
108
108
|
size: "sm",
|
|
109
|
-
className: ` ${m(
|
|
110
|
-
children:
|
|
109
|
+
className: ` ${m(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"}`,
|
|
110
|
+
children: o ? /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
111
111
|
/* @__PURE__ */ e.jsxs("span", { className: "pr-8 text-sm", children: [
|
|
112
112
|
h && /* @__PURE__ */ e.jsx("span", { className: "mr-2 rounded-full bg-purple-100 px-2 py-0.5 text-[10px] text-purple-500", children: F(s) }),
|
|
113
|
-
|
|
113
|
+
o
|
|
114
114
|
] }),
|
|
115
115
|
/* @__PURE__ */ e.jsx("span", { className: "cursor-pointer text-[9px] text-blue-400 underline hover:text-blue-700", children: "Change" })
|
|
116
116
|
] }) : /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
@@ -119,58 +119,58 @@ const we = ({ data: r, fullView: a }) => {
|
|
|
119
119
|
] })
|
|
120
120
|
}
|
|
121
121
|
) }),
|
|
122
|
-
/* @__PURE__ */ e.jsx(
|
|
123
|
-
/* @__PURE__ */ e.jsx(
|
|
124
|
-
/* @__PURE__ */ e.jsxs(
|
|
125
|
-
/* @__PURE__ */ e.jsx(
|
|
126
|
-
/* @__PURE__ */ e.jsx(
|
|
127
|
-
|
|
122
|
+
/* @__PURE__ */ e.jsx(et, { className: "z-[999] min-w-[300px] p-0", side: "right", align: "start", children: /* @__PURE__ */ e.jsxs(Qt, { children: [
|
|
123
|
+
/* @__PURE__ */ e.jsx(er, { placeholder: `Choose ${re(r)}...` }),
|
|
124
|
+
/* @__PURE__ */ e.jsxs(tr, { children: [
|
|
125
|
+
/* @__PURE__ */ e.jsx(rr, { children: "No results found." }),
|
|
126
|
+
/* @__PURE__ */ e.jsx(sr, { children: _(x, (g) => /* @__PURE__ */ e.jsxs(
|
|
127
|
+
or,
|
|
128
128
|
{
|
|
129
|
-
value:
|
|
129
|
+
value: g,
|
|
130
130
|
className: `cursor-pointer ${h ? "flex items-center justify-between" : "flex flex-col items-start justify-start"}`,
|
|
131
131
|
onSelect: (v) => {
|
|
132
|
-
t(Ze(x, (C) => C === v) || null),
|
|
132
|
+
t(Ze(x, (C) => C === v) || null), u(!1);
|
|
133
133
|
},
|
|
134
134
|
children: [
|
|
135
135
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-x-2", children: [
|
|
136
|
-
/* @__PURE__ */ e.jsx(
|
|
137
|
-
|
|
136
|
+
/* @__PURE__ */ e.jsx(Dr, { className: `h-4 w-4 text-green-500 ${o === g ? "" : "opacity-0"}` }),
|
|
137
|
+
g
|
|
138
138
|
] }),
|
|
139
|
-
h ? /* @__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(y(
|
|
139
|
+
h ? /* @__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(y(n, g, "")) }) }) : /* @__PURE__ */ e.jsx("div", { className: "pl-6", children: /* @__PURE__ */ e.jsx(je, { data: y(a, g) }) })
|
|
140
140
|
]
|
|
141
141
|
},
|
|
142
|
-
|
|
142
|
+
g
|
|
143
143
|
)) })
|
|
144
144
|
] })
|
|
145
145
|
] }) })
|
|
146
146
|
] })
|
|
147
147
|
] }),
|
|
148
|
-
!h && !m(
|
|
148
|
+
!h && !m(o) && /* @__PURE__ */ e.jsx("div", { className: "pt-2", children: /* @__PURE__ */ e.jsx(je, { data: y(a, o, ""), fullView: !0 }) })
|
|
149
149
|
] });
|
|
150
150
|
}, Qr = ({
|
|
151
151
|
appliedBindings: r = [],
|
|
152
|
-
onAddBinding:
|
|
152
|
+
onAddBinding: o,
|
|
153
153
|
editMode: t,
|
|
154
|
-
item:
|
|
154
|
+
item: a
|
|
155
155
|
}) => {
|
|
156
|
-
const [l, s] =
|
|
157
|
-
(x,
|
|
156
|
+
const [l, s] = w(t ? a.key : ""), [d, c] = w(t ? a.value : ""), n = U(), [p] = tt(), h = H(
|
|
157
|
+
(x, g) => {
|
|
158
158
|
if (m(x))
|
|
159
159
|
return "";
|
|
160
160
|
{
|
|
161
|
-
const v = y(
|
|
161
|
+
const v = y(g === "PROP" ? n : p, x, "");
|
|
162
162
|
if (ce(v))
|
|
163
163
|
return "list";
|
|
164
164
|
const C = typeof v;
|
|
165
165
|
return C === "string" ? "text" : C === "object" ? "model" : C;
|
|
166
166
|
}
|
|
167
167
|
},
|
|
168
|
-
[
|
|
169
|
-
), [i,
|
|
168
|
+
[n, p]
|
|
169
|
+
), [i, u] = w(t ? h(a.key, "PROP") : "");
|
|
170
170
|
return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
171
|
-
/* @__PURE__ */ e.jsxs(
|
|
172
|
-
/* @__PURE__ */ e.jsx(
|
|
173
|
-
/* @__PURE__ */ e.jsx(
|
|
171
|
+
/* @__PURE__ */ e.jsxs(lr, { children: [
|
|
172
|
+
/* @__PURE__ */ e.jsx(ar, { children: "Add Data Binding" }),
|
|
173
|
+
/* @__PURE__ */ e.jsx(nr, { className: "text-xs", children: "Add prop and path of binding. Click save when you're done." })
|
|
174
174
|
] }),
|
|
175
175
|
/* @__PURE__ */ e.jsxs("div", { className: "relative flex flex-col gap-1", children: [
|
|
176
176
|
/* @__PURE__ */ e.jsx(
|
|
@@ -182,10 +182,10 @@ const we = ({ data: r, fullView: a }) => {
|
|
|
182
182
|
value: l,
|
|
183
183
|
setValue: s,
|
|
184
184
|
onChange: (x) => {
|
|
185
|
-
const
|
|
186
|
-
s(x), i !==
|
|
185
|
+
const g = h(x, "PROP");
|
|
186
|
+
s(x), i !== g && c(""), u(g);
|
|
187
187
|
},
|
|
188
|
-
data:
|
|
188
|
+
data: n,
|
|
189
189
|
dataType: i,
|
|
190
190
|
appliedBindings: r
|
|
191
191
|
}
|
|
@@ -200,8 +200,8 @@ const we = ({ data: r, fullView: a }) => {
|
|
|
200
200
|
value: d,
|
|
201
201
|
setValue: c,
|
|
202
202
|
onChange: (x) => {
|
|
203
|
-
const
|
|
204
|
-
c(i ===
|
|
203
|
+
const g = h(x, "PATH");
|
|
204
|
+
c(i === g ? x : "");
|
|
205
205
|
},
|
|
206
206
|
data: p,
|
|
207
207
|
dataType: i,
|
|
@@ -209,60 +209,60 @@ const we = ({ data: r, fullView: a }) => {
|
|
|
209
209
|
}
|
|
210
210
|
)
|
|
211
211
|
] }),
|
|
212
|
-
/* @__PURE__ */ e.jsx(
|
|
213
|
-
|
|
212
|
+
/* @__PURE__ */ e.jsx(ir, { children: /* @__PURE__ */ e.jsx(
|
|
213
|
+
B,
|
|
214
214
|
{
|
|
215
215
|
type: "submit",
|
|
216
216
|
className: "mt-4",
|
|
217
217
|
disabled: m(l) && m(d),
|
|
218
|
-
onClick: () =>
|
|
218
|
+
onClick: () => o({ key: l, value: d }),
|
|
219
219
|
children: "Save"
|
|
220
220
|
}
|
|
221
221
|
) })
|
|
222
222
|
] });
|
|
223
|
-
},
|
|
224
|
-
const [d, c] =
|
|
225
|
-
return /* @__PURE__ */ e.jsxs(
|
|
226
|
-
/* @__PURE__ */ e.jsx(
|
|
227
|
-
d && /* @__PURE__ */ e.jsx(
|
|
223
|
+
}, ct = ({ disabled: r, children: o, onAddBinding: t, appliedBindings: a, editMode: l = !0, item: s = {} }) => {
|
|
224
|
+
const [d, c] = w(!1);
|
|
225
|
+
return /* @__PURE__ */ e.jsxs(dr, { children: [
|
|
226
|
+
/* @__PURE__ */ e.jsx(cr, { disabled: r, asChild: !0, onClick: () => c(!0), children: o }),
|
|
227
|
+
d && /* @__PURE__ */ e.jsx(pr, { children: /* @__PURE__ */ e.jsx(
|
|
228
228
|
Qr,
|
|
229
229
|
{
|
|
230
230
|
item: s,
|
|
231
231
|
editMode: l,
|
|
232
|
-
appliedBindings:
|
|
233
|
-
onAddBinding: (
|
|
234
|
-
t(
|
|
232
|
+
appliedBindings: a,
|
|
233
|
+
onAddBinding: (n) => {
|
|
234
|
+
t(n), c(!1);
|
|
235
235
|
}
|
|
236
236
|
}
|
|
237
237
|
) })
|
|
238
238
|
] });
|
|
239
239
|
}, es = ({
|
|
240
240
|
item: r,
|
|
241
|
-
onAddBinding:
|
|
241
|
+
onAddBinding: o,
|
|
242
242
|
onRemove: t,
|
|
243
|
-
selectedBlock:
|
|
243
|
+
selectedBlock: a,
|
|
244
244
|
dataProvider: l,
|
|
245
245
|
appliedBindings: s
|
|
246
246
|
}) => {
|
|
247
|
-
const [d, c] =
|
|
247
|
+
const [d, c] = w("string"), n = (p, h) => {
|
|
248
248
|
if (m(p))
|
|
249
249
|
return "";
|
|
250
250
|
{
|
|
251
|
-
const i = y(h === "PROP" ?
|
|
251
|
+
const i = y(h === "PROP" ? a : l, p, "");
|
|
252
252
|
if (ce(i))
|
|
253
253
|
return "list";
|
|
254
|
-
const
|
|
255
|
-
return
|
|
254
|
+
const u = typeof i;
|
|
255
|
+
return u === "string" ? "text" : u === "object" ? "model" : u;
|
|
256
256
|
}
|
|
257
257
|
};
|
|
258
|
-
return
|
|
258
|
+
return A(() => c(() => n(r.key, "PROP")), [r.key]), /* @__PURE__ */ e.jsxs("div", { className: "relative flex flex-col rounded-md border border-gray-200 p-2", children: [
|
|
259
259
|
/* @__PURE__ */ e.jsx("div", { className: "text-sm font-normal text-gray-500", children: r.key }),
|
|
260
260
|
/* @__PURE__ */ e.jsx("div", { className: "font-medium leading-5", children: r.value }),
|
|
261
|
-
/* @__PURE__ */ e.jsx(
|
|
261
|
+
/* @__PURE__ */ e.jsx(je, { data: y(l, r.value, "") }),
|
|
262
262
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center justify-end gap-x-2", children: [
|
|
263
|
-
/* @__PURE__ */ e.jsx(
|
|
263
|
+
/* @__PURE__ */ e.jsx(ct, { editMode: !0, onAddBinding: o, appliedBindings: s, item: r, children: /* @__PURE__ */ e.jsx(Br, { className: "mt-1 h-6 w-6 cursor-pointer rounded border border-blue-400 p-1 text-blue-400 duration-200 hover:scale-105 hover:bg-blue-400 hover:text-white" }) }),
|
|
264
264
|
/* @__PURE__ */ e.jsx(
|
|
265
|
-
|
|
265
|
+
Ir,
|
|
266
266
|
{
|
|
267
267
|
onClick: () => t(),
|
|
268
268
|
className: "mt-1 h-6 w-6 cursor-pointer rounded border border-red-400 p-1 text-red-400 duration-200 hover:scale-105 hover:bg-red-400 hover:text-white"
|
|
@@ -271,121 +271,141 @@ const we = ({ data: r, fullView: a }) => {
|
|
|
271
271
|
] }),
|
|
272
272
|
!m(d) && !m(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(d) })
|
|
273
273
|
] });
|
|
274
|
-
}, ts = ({ bindingData: r, onChange:
|
|
275
|
-
const t =
|
|
276
|
-
_(r, (i,
|
|
274
|
+
}, ts = ({ bindingData: r, onChange: o }) => {
|
|
275
|
+
const t = U(), [a] = tt(), l = Er(), [s, d] = w(
|
|
276
|
+
_(r, (i, u) => ({ key: u, value: i }))
|
|
277
277
|
);
|
|
278
|
-
|
|
279
|
-
d(_(r, (i,
|
|
278
|
+
A(() => {
|
|
279
|
+
d(_(r, (i, u) => ({ key: u, value: i })));
|
|
280
280
|
}, [t == null ? void 0 : t._id, r]);
|
|
281
281
|
const c = T(() => {
|
|
282
|
-
if (m(
|
|
282
|
+
if (m(a))
|
|
283
283
|
return !0;
|
|
284
284
|
if (m(s))
|
|
285
285
|
return !1;
|
|
286
|
-
const i =
|
|
286
|
+
const i = jt(s);
|
|
287
287
|
return m(i == null ? void 0 : i.key) || m(i == null ? void 0 : i.value);
|
|
288
|
-
}, [
|
|
289
|
-
const
|
|
290
|
-
d([...
|
|
288
|
+
}, [a, s]), n = (i) => {
|
|
289
|
+
const u = ye(s, (x) => x.key !== i.key);
|
|
290
|
+
d([...u, i]), h([...u, i]);
|
|
291
291
|
}, p = (i) => {
|
|
292
|
-
const
|
|
293
|
-
h([...
|
|
292
|
+
const u = ye(s, (x, g) => i !== g);
|
|
293
|
+
h([...u]);
|
|
294
294
|
}, h = H(
|
|
295
295
|
(i = []) => {
|
|
296
296
|
if (d(i), m(i)) {
|
|
297
|
-
|
|
297
|
+
o({});
|
|
298
298
|
return;
|
|
299
299
|
}
|
|
300
|
-
const
|
|
300
|
+
const u = {};
|
|
301
301
|
Ne(i, (x) => {
|
|
302
|
-
!m(x == null ? void 0 : x.key) && !m(x == null ? void 0 : x.value) && We(
|
|
303
|
-
}),
|
|
302
|
+
!m(x == null ? void 0 : x.key) && !m(x == null ? void 0 : x.value) && We(u, x.key, x.value);
|
|
303
|
+
}), o(u);
|
|
304
304
|
},
|
|
305
|
-
[
|
|
305
|
+
[o]
|
|
306
306
|
);
|
|
307
307
|
return m(l) ? /* @__PURE__ */ e.jsx("div", { className: "flex w-full items-center justify-center", children: /* @__PURE__ */ e.jsxs("p", { className: "mb-1.5 text-xs text-gray-500", children: [
|
|
308
308
|
"You have no data providers registered. Please add a data provider to your project. ",
|
|
309
309
|
/* @__PURE__ */ e.jsx("br", {}),
|
|
310
310
|
/* @__PURE__ */ e.jsx("a", { className: "text-blue-500", href: "https://chaibuilder.com/docs/registering-data-providers", target: "_blank", children: "Learn more" })
|
|
311
311
|
] }) }) : /* @__PURE__ */ e.jsxs("div", { className: "space-y-2", children: [
|
|
312
|
-
_(s, (i,
|
|
312
|
+
_(s, (i, u) => /* @__PURE__ */ e.jsx(
|
|
313
313
|
es,
|
|
314
314
|
{
|
|
315
315
|
item: i,
|
|
316
|
-
onAddBinding:
|
|
317
|
-
onRemove: () => p(
|
|
316
|
+
onAddBinding: n,
|
|
317
|
+
onRemove: () => p(u),
|
|
318
318
|
selectedBlock: t,
|
|
319
|
-
dataProvider:
|
|
319
|
+
dataProvider: a,
|
|
320
320
|
appliedBindings: _(s, "key")
|
|
321
321
|
},
|
|
322
322
|
i.key
|
|
323
323
|
)),
|
|
324
324
|
/* @__PURE__ */ e.jsxs($, { delayDuration: 200, children: [
|
|
325
|
-
/* @__PURE__ */ e.jsx(
|
|
326
|
-
|
|
325
|
+
/* @__PURE__ */ e.jsx(E, { disabled: m(a), className: "w-full", children: /* @__PURE__ */ e.jsx(
|
|
326
|
+
ct,
|
|
327
327
|
{
|
|
328
328
|
disabled: c,
|
|
329
329
|
appliedBindings: _(s, "key"),
|
|
330
|
-
onAddBinding:
|
|
330
|
+
onAddBinding: n,
|
|
331
331
|
children: /* @__PURE__ */ e.jsx(
|
|
332
332
|
"span",
|
|
333
333
|
{
|
|
334
334
|
className: `w-full rounded-md px-5 py-1.5 text-xs font-medium duration-200 ${c ? "cursor-not-allowed bg-gray-200 text-gray-400" : "bg-blue-700/20 text-blue-800 hover:bg-blue-700/30"}`,
|
|
335
|
-
children: m(
|
|
335
|
+
children: m(a) ? /* @__PURE__ */ e.jsx("small", { className: "text-[9.5px] text-gray-500", children: "No data provider has been set up for this page" }) : "+ Add Data Binding"
|
|
336
336
|
}
|
|
337
337
|
)
|
|
338
338
|
}
|
|
339
339
|
) }),
|
|
340
|
-
c && /* @__PURE__ */ e.jsx(
|
|
340
|
+
c && /* @__PURE__ */ e.jsx(M, { sideOffset: -55, className: "text-[11px]", children: m(a) ? "No data provider has been set up for this page." : "Complete last added data binding to add more" })
|
|
341
341
|
] })
|
|
342
342
|
] });
|
|
343
|
-
}, rs = () => /* @__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" }),
|
|
344
|
-
const
|
|
345
|
-
|
|
346
|
-
|
|
343
|
+
}, rs = () => /* @__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" }), ss = ({ id: r, placeholder: o, value: t }) => {
|
|
344
|
+
const { t: a } = I(), [, l] = Fr(), s = U();
|
|
345
|
+
if (typeof window > "u")
|
|
346
|
+
return null;
|
|
347
|
+
const d = () => {
|
|
348
|
+
const c = s == null ? void 0 : s._id, n = r.replace("root.", "");
|
|
349
|
+
l({ blockId: c, blockProp: n, placeholder: o, initialCode: t });
|
|
350
|
+
};
|
|
351
|
+
return /* @__PURE__ */ e.jsxs("div", { className: "mt-2 flex flex-col gap-y-1", children: [
|
|
352
|
+
/* @__PURE__ */ e.jsx(
|
|
353
|
+
"button",
|
|
354
|
+
{
|
|
355
|
+
onClick: d,
|
|
356
|
+
className: "text-pretty w-[90%] max-w-full cursor-default truncate rounded border bg-white p-2 text-left text-[10px]",
|
|
357
|
+
children: t.trim().length > 0 ? t.substring(0, 46) : o || "Eg: <script>console.log('Hello, world!');<\/script>"
|
|
358
|
+
}
|
|
359
|
+
),
|
|
360
|
+
/* @__PURE__ */ e.jsx(B, { onClick: d, size: "sm", variant: "outline", className: "w-fit", children: a("Open code editor") })
|
|
361
|
+
] });
|
|
362
|
+
}, Ce = bt(({ id: r, properties: o, formData: t, onChange: a }) => {
|
|
363
|
+
const [l, s] = w(t), d = { type: "object", properties: {} }, c = {};
|
|
364
|
+
Object.keys(o).forEach((p) => {
|
|
365
|
+
const h = o[p];
|
|
347
366
|
if (X(["slot", "styles"], h.type))
|
|
348
367
|
return;
|
|
349
368
|
const i = p;
|
|
350
|
-
d.properties[i] =
|
|
351
|
-
}),
|
|
369
|
+
d.properties[i] = ur(h), c[i] = gr(h);
|
|
370
|
+
}), A(() => {
|
|
352
371
|
s(t);
|
|
353
372
|
}, [r]);
|
|
354
|
-
const
|
|
373
|
+
const n = de(
|
|
355
374
|
async ({ formData: p }, h) => {
|
|
356
|
-
|
|
375
|
+
a({ formData: p }, h);
|
|
357
376
|
},
|
|
358
|
-
[
|
|
377
|
+
[a],
|
|
359
378
|
1e3
|
|
360
379
|
// save only every 5 seconds
|
|
361
380
|
);
|
|
362
381
|
return /* @__PURE__ */ e.jsx(
|
|
363
|
-
|
|
382
|
+
Yr,
|
|
364
383
|
{
|
|
365
384
|
widgets: {
|
|
366
385
|
binding: rs,
|
|
367
|
-
richtext:
|
|
368
|
-
icon:
|
|
369
|
-
image:
|
|
386
|
+
richtext: xr,
|
|
387
|
+
icon: yr,
|
|
388
|
+
image: hr,
|
|
389
|
+
code: ss
|
|
370
390
|
},
|
|
371
|
-
fields: { link:
|
|
391
|
+
fields: { link: br },
|
|
372
392
|
idSeparator: ".",
|
|
373
393
|
autoComplete: "off",
|
|
374
394
|
omitExtraData: !1,
|
|
375
395
|
liveOmit: !1,
|
|
376
396
|
liveValidate: !1,
|
|
377
|
-
validator:
|
|
397
|
+
validator: Xr,
|
|
378
398
|
uiSchema: c,
|
|
379
399
|
schema: d,
|
|
380
400
|
formData: l,
|
|
381
401
|
onChange: ({ formData: p }, h) => {
|
|
382
|
-
h && (s(p),
|
|
402
|
+
h && (s(p), n({ formData: p }, h));
|
|
383
403
|
}
|
|
384
404
|
}
|
|
385
405
|
);
|
|
386
|
-
}),
|
|
387
|
-
const [r,
|
|
388
|
-
|
|
406
|
+
}), os = () => {
|
|
407
|
+
const [r, o] = Zr(), t = mr(), a = (d, c) => {
|
|
408
|
+
o((n) => ({ ...n, [d]: c }));
|
|
389
409
|
};
|
|
390
410
|
if (m(t))
|
|
391
411
|
return null;
|
|
@@ -399,39 +419,39 @@ const we = ({ data: r, fullView: a }) => {
|
|
|
399
419
|
Ce,
|
|
400
420
|
{
|
|
401
421
|
id: l == null ? void 0 : l._id,
|
|
402
|
-
onChange: ({ formData: d }) =>
|
|
422
|
+
onChange: ({ formData: d }) => a(l._id, d),
|
|
403
423
|
formData: y(r, l._id, {}),
|
|
404
424
|
properties: s
|
|
405
425
|
}
|
|
406
426
|
) })
|
|
407
427
|
] });
|
|
408
428
|
};
|
|
409
|
-
function
|
|
410
|
-
const r =
|
|
411
|
-
if (
|
|
412
|
-
const C =
|
|
429
|
+
function ls() {
|
|
430
|
+
const r = U(), o = rt(), t = st(), a = Re(r._type), l = { ...r }, [s, d] = w(l), c = ot("dataBindingSupport", !1), n = ({ formData: x }, g, v) => {
|
|
431
|
+
if (g && (s == null ? void 0 : s._id) === r._id) {
|
|
432
|
+
const C = g.replace("root.", "");
|
|
413
433
|
t([r._id], { [C]: y(x, C) }, v);
|
|
414
434
|
}
|
|
415
435
|
}, p = H(
|
|
416
|
-
|
|
417
|
-
|
|
436
|
+
Ct(({ formData: x }, g, v) => {
|
|
437
|
+
n({ formData: x }, g, v), d(x);
|
|
418
438
|
}, 1500),
|
|
419
439
|
[r == null ? void 0 : r._id]
|
|
420
|
-
), h = ({ formData: x },
|
|
421
|
-
if (
|
|
422
|
-
const v =
|
|
423
|
-
|
|
440
|
+
), h = ({ formData: x }, g) => {
|
|
441
|
+
if (g) {
|
|
442
|
+
const v = g.replace("root.", "");
|
|
443
|
+
o(
|
|
424
444
|
[r._id],
|
|
425
|
-
|
|
426
|
-
), p({ formData: x },
|
|
445
|
+
fr(v, y(x, v.split(".")))
|
|
446
|
+
), p({ formData: x }, g, { [v]: y(s, v) });
|
|
427
447
|
}
|
|
428
|
-
}, i = he(y(l, "_bindings", {})),
|
|
429
|
-
const x =
|
|
430
|
-
return c &&
|
|
431
|
-
}, [
|
|
448
|
+
}, i = he(y(l, "_bindings", {})), u = T(() => {
|
|
449
|
+
const x = kt(y(a, "props", {}));
|
|
450
|
+
return c && Nt(i, (g) => delete x[g]), x;
|
|
451
|
+
}, [a, i, c]);
|
|
432
452
|
return /* @__PURE__ */ e.jsxs("div", { className: "overflow-x-hidden", children: [
|
|
433
|
-
/* @__PURE__ */ e.jsx(
|
|
434
|
-
c ? /* @__PURE__ */ e.jsxs(
|
|
453
|
+
/* @__PURE__ */ e.jsx(os, {}),
|
|
454
|
+
c ? /* @__PURE__ */ e.jsxs(lt, { type: "multiple", defaultValue: ["STATIC", "BINDING"], className: "h-full w-full", children: [
|
|
435
455
|
/* @__PURE__ */ e.jsxs(me, { value: "BINDING", children: [
|
|
436
456
|
/* @__PURE__ */ e.jsx(fe, { className: "bg-gray-100 px-3 py-2 text-xs hover:no-underline", children: /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-x-2", children: [
|
|
437
457
|
/* @__PURE__ */ e.jsx(
|
|
@@ -447,7 +467,7 @@ function as() {
|
|
|
447
467
|
{
|
|
448
468
|
bindingData: y(r, "_bindings", {}),
|
|
449
469
|
onChange: (x) => {
|
|
450
|
-
|
|
470
|
+
n({ formData: { _bindings: x } }, "root._bindings");
|
|
451
471
|
}
|
|
452
472
|
}
|
|
453
473
|
) })
|
|
@@ -471,7 +491,7 @@ function as() {
|
|
|
471
491
|
id: r == null ? void 0 : r._id,
|
|
472
492
|
onChange: h,
|
|
473
493
|
formData: l,
|
|
474
|
-
properties:
|
|
494
|
+
properties: u
|
|
475
495
|
}
|
|
476
496
|
)
|
|
477
497
|
] })
|
|
@@ -482,74 +502,74 @@ function as() {
|
|
|
482
502
|
id: r == null ? void 0 : r._id,
|
|
483
503
|
onChange: h,
|
|
484
504
|
formData: l,
|
|
485
|
-
properties:
|
|
505
|
+
properties: u
|
|
486
506
|
}
|
|
487
507
|
)
|
|
488
508
|
] });
|
|
489
509
|
}
|
|
490
|
-
const
|
|
491
|
-
const { t:
|
|
492
|
-
|
|
510
|
+
const as = ({ blockId: r }) => {
|
|
511
|
+
const { t: o } = I(), { askAi: t, loading: a, error: l } = vr(), [s, d] = w(""), c = mt(null);
|
|
512
|
+
A(() => {
|
|
493
513
|
var p;
|
|
494
514
|
(p = c.current) == null || p.focus();
|
|
495
515
|
}, []);
|
|
496
|
-
const
|
|
516
|
+
const n = () => {
|
|
497
517
|
l || d("");
|
|
498
518
|
};
|
|
499
519
|
return /* @__PURE__ */ e.jsxs("div", { className: "", children: [
|
|
500
|
-
/* @__PURE__ */ e.jsx("h2", { className: "mb-1 text-sm font-semibold leading-none tracking-tight", children:
|
|
520
|
+
/* @__PURE__ */ e.jsx("h2", { className: "mb-1 text-sm font-semibold leading-none tracking-tight", children: o("Ask AI") }),
|
|
501
521
|
/* @__PURE__ */ e.jsx(
|
|
502
522
|
wr,
|
|
503
523
|
{
|
|
504
524
|
ref: c,
|
|
505
525
|
value: s,
|
|
506
526
|
onChange: (p) => d(p.target.value),
|
|
507
|
-
placeholder:
|
|
527
|
+
placeholder: o("Ask AI to edit styles"),
|
|
508
528
|
className: "w-full border border-gray-400 focus:border-0",
|
|
509
529
|
rows: 3,
|
|
510
530
|
onKeyDown: (p) => {
|
|
511
|
-
p.key === "Enter" && (p.preventDefault(), t("styles", r, s,
|
|
531
|
+
p.key === "Enter" && (p.preventDefault(), t("styles", r, s, n));
|
|
512
532
|
}
|
|
513
533
|
}
|
|
514
534
|
),
|
|
515
535
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2 my-2", children: [
|
|
516
|
-
|
|
517
|
-
|
|
536
|
+
a ? null : /* @__PURE__ */ e.jsx(
|
|
537
|
+
B,
|
|
518
538
|
{
|
|
519
|
-
disabled: s.trim().length < 5 ||
|
|
520
|
-
onClick: () => t("styles", r, s,
|
|
539
|
+
disabled: s.trim().length < 5 || a,
|
|
540
|
+
onClick: () => t("styles", r, s, n),
|
|
521
541
|
variant: "default",
|
|
522
542
|
className: "w-fit",
|
|
523
543
|
size: "sm",
|
|
524
|
-
children:
|
|
525
|
-
/* @__PURE__ */ e.jsx(
|
|
526
|
-
|
|
527
|
-
] }) :
|
|
544
|
+
children: a ? /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
545
|
+
/* @__PURE__ */ e.jsx(Pr, { className: "w-5 h-5 animate-spin" }),
|
|
546
|
+
o("Generating... Please wait")
|
|
547
|
+
] }) : o("Edit with AI")
|
|
528
548
|
}
|
|
529
549
|
),
|
|
530
|
-
|
|
531
|
-
/* @__PURE__ */ e.jsxs(
|
|
532
|
-
/* @__PURE__ */ e.jsx(
|
|
533
|
-
/* @__PURE__ */ e.jsx("p", { className: "text-xs", children:
|
|
550
|
+
a ? /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col gap-2", children: [
|
|
551
|
+
/* @__PURE__ */ e.jsxs(jr, { className: "flex items-center w-full px-4 py-1 pl-2 space-x-1", children: [
|
|
552
|
+
/* @__PURE__ */ e.jsx(Cr, { className: "w-4 h-4 text-gray-500 animate-spin" }),
|
|
553
|
+
/* @__PURE__ */ e.jsx("p", { className: "text-xs", children: o("Generating... Please wait") })
|
|
534
554
|
] }),
|
|
535
|
-
/* @__PURE__ */ e.jsx(
|
|
555
|
+
/* @__PURE__ */ e.jsx(B, { variant: "destructive", onClick: () => stop(), className: "hidden w-fit", size: "sm", children: o("Stop") })
|
|
536
556
|
] }) : null
|
|
537
557
|
] }),
|
|
538
558
|
/* @__PURE__ */ e.jsx("div", { className: "max-w-full", children: l && /* @__PURE__ */ e.jsx("p", { className: "p-1 text-xs text-red-500 break-words bg-red-100 border border-red-500 rounded", children: l.message }) })
|
|
539
559
|
] });
|
|
540
|
-
}, Oe = new Ur(
|
|
560
|
+
}, Oe = new Ur(Kr, {
|
|
541
561
|
isCaseSensitive: !1,
|
|
542
562
|
threshold: 0.2,
|
|
543
563
|
minMatchCharLength: 2,
|
|
544
564
|
keys: ["name"]
|
|
545
565
|
});
|
|
546
|
-
function
|
|
566
|
+
function pt() {
|
|
547
567
|
var S;
|
|
548
|
-
const { t: r } =
|
|
549
|
-
const
|
|
550
|
-
|
|
551
|
-
}, [x,
|
|
552
|
-
const D =
|
|
568
|
+
const { t: r } = I(), [o] = pe(), t = U(), a = Te(), l = at(), [s] = nt(), d = ot("askAiCallBack", null), [c, n] = w(""), { toast: p } = it(), h = (S = oe(o)) == null ? void 0 : S.prop, i = _t((y(t, h, "").replace(qr, "").split(",").pop() || "").split(" "), m), u = () => {
|
|
569
|
+
const j = c.trim().toLowerCase().replace(/ +(?= )/g, "").split(" ");
|
|
570
|
+
a(s, j, !0), n("");
|
|
571
|
+
}, [x, g] = w([]), v = ({ value: j }) => {
|
|
572
|
+
const D = j.trim().toLowerCase(), Z = D.match(/.+:/g);
|
|
553
573
|
let b = [];
|
|
554
574
|
if (Z && Z.length > 0) {
|
|
555
575
|
const [f] = Z, N = D.replace(f, "");
|
|
@@ -559,20 +579,20 @@ function ut() {
|
|
|
559
579
|
}));
|
|
560
580
|
} else
|
|
561
581
|
b = Oe.search(D);
|
|
562
|
-
return
|
|
582
|
+
return g(_(b, "item"));
|
|
563
583
|
}, C = () => {
|
|
564
|
-
|
|
565
|
-
},
|
|
584
|
+
g([]);
|
|
585
|
+
}, K = (j) => j.name, L = (j) => /* @__PURE__ */ e.jsx("div", { className: "rounded-md p-1", children: j.name }), G = {
|
|
566
586
|
autoComplete: "off",
|
|
567
587
|
autoCorrect: "off",
|
|
568
588
|
autoCapitalize: "off",
|
|
569
589
|
spellCheck: !1,
|
|
570
590
|
placeholder: r("Enter classes separated by space"),
|
|
571
591
|
value: c,
|
|
572
|
-
onKeyDown: (
|
|
573
|
-
|
|
592
|
+
onKeyDown: (j) => {
|
|
593
|
+
j.key === "Enter" && c.trim() !== "" && u();
|
|
574
594
|
},
|
|
575
|
-
onChange: (
|
|
595
|
+
onChange: (j, { newValue: D }) => n(D),
|
|
576
596
|
className: "w-full rounded-md text-xs px-2 hover:outline-0 bg-background border-border py-1"
|
|
577
597
|
}, q = () => {
|
|
578
598
|
if (navigator.clipboard === void 0) {
|
|
@@ -597,16 +617,16 @@ function ut() {
|
|
|
597
617
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-x-2", children: [
|
|
598
618
|
/* @__PURE__ */ e.jsx("span", { children: r("Classes") }),
|
|
599
619
|
/* @__PURE__ */ e.jsxs($, { children: [
|
|
600
|
-
/* @__PURE__ */ e.jsx(
|
|
601
|
-
/* @__PURE__ */ e.jsx(
|
|
620
|
+
/* @__PURE__ */ e.jsx(E, { asChild: !0, children: /* @__PURE__ */ e.jsx(Dt, { onClick: q, className: "cursor-pointer" }) }),
|
|
621
|
+
/* @__PURE__ */ e.jsx(M, { children: /* @__PURE__ */ e.jsx("p", { children: r("Copy classes to clipboard") }) })
|
|
602
622
|
] })
|
|
603
623
|
] }),
|
|
604
|
-
d ? /* @__PURE__ */ e.jsxs(
|
|
605
|
-
/* @__PURE__ */ e.jsx(
|
|
606
|
-
/* @__PURE__ */ e.jsx(
|
|
624
|
+
d ? /* @__PURE__ */ e.jsxs(Je, { children: [
|
|
625
|
+
/* @__PURE__ */ e.jsx(Qe, { children: /* @__PURE__ */ e.jsxs(B, { variant: "default", className: "h-6 w-fit", size: "sm", children: [
|
|
626
|
+
/* @__PURE__ */ e.jsx(Ar, { className: "h-4 w-4" }),
|
|
607
627
|
/* @__PURE__ */ e.jsx("span", { className: "ml-2", children: r("Ask AI") })
|
|
608
628
|
] }) }),
|
|
609
|
-
/* @__PURE__ */ e.jsx(
|
|
629
|
+
/* @__PURE__ */ e.jsx(et, { side: "left", className: "p-2", children: /* @__PURE__ */ e.jsx(as, { blockId: t == null ? void 0 : t._id }) })
|
|
610
630
|
] }) : null
|
|
611
631
|
] }),
|
|
612
632
|
/* @__PURE__ */ e.jsxs("div", { className: "relative flex items-center gap-x-3", children: [
|
|
@@ -616,9 +636,9 @@ function ut() {
|
|
|
616
636
|
suggestions: x,
|
|
617
637
|
onSuggestionsFetchRequested: v,
|
|
618
638
|
onSuggestionsClearRequested: C,
|
|
619
|
-
getSuggestionValue:
|
|
639
|
+
getSuggestionValue: K,
|
|
620
640
|
renderSuggestion: L,
|
|
621
|
-
inputProps:
|
|
641
|
+
inputProps: G,
|
|
622
642
|
containerProps: {
|
|
623
643
|
className: "relative h-8 w-full gap-y-1 py-1 border-gray-600"
|
|
624
644
|
},
|
|
@@ -630,11 +650,11 @@ function ut() {
|
|
|
630
650
|
}
|
|
631
651
|
) }),
|
|
632
652
|
/* @__PURE__ */ e.jsx(
|
|
633
|
-
|
|
653
|
+
B,
|
|
634
654
|
{
|
|
635
655
|
variant: "outline",
|
|
636
656
|
className: "h-6 border-gray-700",
|
|
637
|
-
onClick:
|
|
657
|
+
onClick: u,
|
|
638
658
|
disabled: c.trim() === "",
|
|
639
659
|
size: "sm",
|
|
640
660
|
children: /* @__PURE__ */ e.jsx(_e, {})
|
|
@@ -642,41 +662,41 @@ function ut() {
|
|
|
642
662
|
)
|
|
643
663
|
] }),
|
|
644
664
|
/* @__PURE__ */ e.jsx("div", { className: "flex w-full flex-wrap gap-2 overflow-x-hidden", children: ne.Children.toArray(
|
|
645
|
-
i.map((
|
|
665
|
+
i.map((j) => /* @__PURE__ */ e.jsxs(
|
|
646
666
|
"div",
|
|
647
667
|
{
|
|
648
668
|
className: "group relative flex max-w-[260px] cursor-default items-center gap-x-1 truncate rounded border border-gray-300 bg-gray-200 p-px px-1.5 text-[11px] text-gray-600 hover:border-gray-300",
|
|
649
669
|
children: [
|
|
650
|
-
|
|
670
|
+
j,
|
|
651
671
|
/* @__PURE__ */ e.jsx(
|
|
652
|
-
|
|
672
|
+
Ke,
|
|
653
673
|
{
|
|
654
|
-
onClick: () => l(s, [
|
|
674
|
+
onClick: () => l(s, [j]),
|
|
655
675
|
className: "invisible absolute right-1 rounded-full bg-red-400 hover:text-white group-hover:visible group-hover:cursor-pointer"
|
|
656
676
|
}
|
|
657
677
|
)
|
|
658
678
|
]
|
|
659
679
|
},
|
|
660
|
-
|
|
680
|
+
j
|
|
661
681
|
))
|
|
662
682
|
) })
|
|
663
683
|
]
|
|
664
684
|
}
|
|
665
685
|
);
|
|
666
686
|
}
|
|
667
|
-
const
|
|
668
|
-
const { t:
|
|
669
|
-
m(t.key) || (r({ ...t, key:
|
|
687
|
+
const ns = ({ onAdd: r }) => {
|
|
688
|
+
const { t: o } = I(), [t, a] = w({ key: "", value: "" }), l = () => {
|
|
689
|
+
m(t.key) || (r({ ...t, key: t.key }), a({ key: "", value: "" }));
|
|
670
690
|
};
|
|
671
691
|
return /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col gap-1 border-gray-200", children: [
|
|
672
692
|
/* @__PURE__ */ e.jsx(
|
|
673
|
-
|
|
693
|
+
we,
|
|
674
694
|
{
|
|
675
695
|
name: "key",
|
|
676
696
|
className: "h-6",
|
|
677
|
-
onChange: (s) =>
|
|
697
|
+
onChange: (s) => a({ ...t, key: s.target.value }),
|
|
678
698
|
value: t.key,
|
|
679
|
-
placeholder:
|
|
699
|
+
placeholder: o("Name"),
|
|
680
700
|
autoComplete: "off",
|
|
681
701
|
autoCapitalize: "off",
|
|
682
702
|
onKeyDown: (s) => {
|
|
@@ -685,13 +705,13 @@ const os = ({ onAdd: r }) => {
|
|
|
685
705
|
}
|
|
686
706
|
),
|
|
687
707
|
/* @__PURE__ */ e.jsx("div", { className: "flex items-center gap-x-1.5", children: /* @__PURE__ */ e.jsx(
|
|
688
|
-
|
|
708
|
+
we,
|
|
689
709
|
{
|
|
690
710
|
className: "h-6",
|
|
691
711
|
name: "value",
|
|
692
|
-
onChange: (s) =>
|
|
712
|
+
onChange: (s) => a({ ...t, value: s.target.value }),
|
|
693
713
|
value: t.value,
|
|
694
|
-
placeholder:
|
|
714
|
+
placeholder: o("Value"),
|
|
695
715
|
autoComplete: "off",
|
|
696
716
|
autoCapitalize: "off",
|
|
697
717
|
onKeyDown: (s) => {
|
|
@@ -700,91 +720,93 @@ const os = ({ onAdd: r }) => {
|
|
|
700
720
|
}
|
|
701
721
|
) }),
|
|
702
722
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-x-2", children: [
|
|
703
|
-
/* @__PURE__ */ e.jsxs(
|
|
723
|
+
/* @__PURE__ */ e.jsxs(B, { disabled: m(t.key), onClick: l, size: "sm", className: "flex items-center", children: [
|
|
704
724
|
/* @__PURE__ */ e.jsxs("span", { children: [
|
|
705
|
-
|
|
725
|
+
o("Add"),
|
|
706
726
|
" "
|
|
707
727
|
] }),
|
|
708
728
|
/* @__PURE__ */ e.jsx(_e, {})
|
|
709
729
|
] }),
|
|
710
|
-
m(t.key) ? null : /* @__PURE__ */ e.jsx(
|
|
730
|
+
m(t.key) ? null : /* @__PURE__ */ e.jsx(B, { variant: "ghost", onClick: () => a({ key: "", value: "" }), children: o("Cancel") })
|
|
711
731
|
] })
|
|
712
732
|
] });
|
|
713
|
-
},
|
|
714
|
-
const r =
|
|
733
|
+
}, is = () => {
|
|
734
|
+
const r = U(), [o, t] = w([]), [a] = pe(), l = rt(), s = st(), { t: d } = I(), { toast: c } = it(), n = `${y(a, "0.prop")}_attrs`;
|
|
715
735
|
ne.useEffect(() => {
|
|
716
|
-
const
|
|
717
|
-
m(
|
|
718
|
-
}, [y(r,
|
|
719
|
-
const p = (
|
|
720
|
-
const x = ye(
|
|
736
|
+
const u = _(y(r, n), (x, g) => ({ key: g, value: x }));
|
|
737
|
+
m(u) ? t([]) : t(u);
|
|
738
|
+
}, [y(r, n)]);
|
|
739
|
+
const p = (u) => {
|
|
740
|
+
const x = ye(o, (g, v) => u !== v);
|
|
721
741
|
i(x);
|
|
722
|
-
}, h = (
|
|
723
|
-
const x = Ze(
|
|
742
|
+
}, h = (u) => {
|
|
743
|
+
const x = Ze(o, { key: u.key });
|
|
724
744
|
if (x && (x.value.startsWith("dnd-") || x.value.startsWith("#dnd-"))) {
|
|
725
745
|
c({
|
|
726
746
|
title: d("Cannot add predefined attribute"),
|
|
727
747
|
variant: "destructive",
|
|
728
|
-
description: d(`"(${
|
|
748
|
+
description: d(`"(${u.key})" cannot be added as it is a predefined attribute for this block`)
|
|
729
749
|
});
|
|
730
750
|
return;
|
|
731
751
|
}
|
|
732
|
-
const
|
|
733
|
-
i(
|
|
752
|
+
const g = [...o, u];
|
|
753
|
+
i(g);
|
|
734
754
|
}, i = ne.useCallback(
|
|
735
|
-
(
|
|
755
|
+
(u = []) => {
|
|
736
756
|
const x = {};
|
|
737
|
-
Ne(
|
|
738
|
-
m(
|
|
739
|
-
}), s([y(r, "_id")], { [
|
|
757
|
+
Ne(u, (g) => {
|
|
758
|
+
m(g.key) || We(x, g.key, g.value);
|
|
759
|
+
}), s([y(r, "_id")], { [n]: x });
|
|
740
760
|
},
|
|
741
|
-
[r, l,
|
|
761
|
+
[r, l, n]
|
|
742
762
|
);
|
|
743
|
-
return /* @__PURE__ */ e.jsx("div", { className: "flex min-h-max flex-col gap-y-2 overflow-y-auto", children: /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col", children: [
|
|
744
|
-
/* @__PURE__ */ e.jsx("div", { children: /* @__PURE__ */ e.jsxs("ul", { className: "overflow-hidden rounded-md bg-gray-100
|
|
745
|
-
m(
|
|
763
|
+
return /* @__PURE__ */ e.jsx("div", { className: "mb-20 flex min-h-max flex-col gap-y-2 overflow-y-auto", children: /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col", children: [
|
|
764
|
+
/* @__PURE__ */ e.jsx("div", { children: /* @__PURE__ */ e.jsxs("ul", { className: "overflow-hidden rounded-md bg-gray-100 text-xs text-gray-700", children: [
|
|
765
|
+
m(o) ? /* @__PURE__ */ e.jsx("li", { className: "flex h-4 items-center justify-center", children: /* @__PURE__ */ e.jsx("p", { children: d("No attributes added") }) }) : null,
|
|
746
766
|
ne.Children.toArray(
|
|
747
|
-
_(
|
|
767
|
+
_(o, (u) => /* @__PURE__ */ e.jsxs("li", { className: "group flex w-full max-w-full items-center justify-between", children: [
|
|
748
768
|
/* @__PURE__ */ e.jsxs($, { delayDuration: 1e3, children: [
|
|
749
|
-
/* @__PURE__ */ e.jsx(
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
769
|
+
/* @__PURE__ */ e.jsx(E, { asChild: !0, children: /* @__PURE__ */ e.jsxs("div", { className: "max-w-[230px] cursor-default truncate px-1 hover:bg-gray-200", children: [
|
|
770
|
+
u.key,
|
|
771
|
+
u.value.trim() ? /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
772
|
+
" ",
|
|
773
|
+
/* @__PURE__ */ e.jsx("span", { className: "font-bold text-orange-500", children: "=" }),
|
|
774
|
+
" ",
|
|
775
|
+
u.value.trim()
|
|
776
|
+
] }) : null
|
|
755
777
|
] }) }),
|
|
756
|
-
/* @__PURE__ */ e.jsxs(
|
|
778
|
+
/* @__PURE__ */ e.jsxs(M, { className: "max-w-[200px]", children: [
|
|
757
779
|
/* @__PURE__ */ e.jsxs("div", { children: [
|
|
758
780
|
d("Name"),
|
|
759
781
|
": ",
|
|
760
|
-
|
|
782
|
+
u.key
|
|
761
783
|
] }),
|
|
762
784
|
/* @__PURE__ */ e.jsxs("div", { children: [
|
|
763
785
|
d("Value"),
|
|
764
786
|
": ",
|
|
765
|
-
|
|
787
|
+
u.value
|
|
766
788
|
] })
|
|
767
789
|
] })
|
|
768
790
|
] }),
|
|
769
791
|
/* @__PURE__ */ e.jsxs($, { children: [
|
|
770
|
-
/* @__PURE__ */ e.jsx(
|
|
792
|
+
/* @__PURE__ */ e.jsx(E, { asChild: !0, children: /* @__PURE__ */ e.jsx(
|
|
771
793
|
"button",
|
|
772
794
|
{
|
|
773
|
-
disabled: W(
|
|
795
|
+
disabled: W(u.value, "dnd-"),
|
|
774
796
|
className: "invisible group-hover:visible",
|
|
775
|
-
onClick: () => p(
|
|
776
|
-
children: /* @__PURE__ */ e.jsx(
|
|
797
|
+
onClick: () => p(o.indexOf(u)),
|
|
798
|
+
children: /* @__PURE__ */ e.jsx($r, { className: "w-4 text-gray-500" })
|
|
777
799
|
}
|
|
778
800
|
) }),
|
|
779
|
-
/* @__PURE__ */ e.jsx(
|
|
801
|
+
/* @__PURE__ */ e.jsx(M, { className: "max-w-[200px]", children: W(u.value, "dnd-") ? d("Predefined attribute. Cannot be deleted") : d("Remove attribute") })
|
|
780
802
|
] })
|
|
781
803
|
] }))
|
|
782
804
|
)
|
|
783
805
|
] }) }),
|
|
784
806
|
/* @__PURE__ */ e.jsx("div", { className: "py-2" }),
|
|
785
|
-
/* @__PURE__ */ e.jsx(
|
|
807
|
+
/* @__PURE__ */ e.jsx(ns, { onAdd: (u) => h(u) })
|
|
786
808
|
] }) });
|
|
787
|
-
}, k = ["px", "%", "em", "rem", "ch", "vh", "vw"],
|
|
809
|
+
}, k = ["px", "%", "em", "rem", "ch", "vh", "vw"], ds = {
|
|
788
810
|
heading: "flex.heading",
|
|
789
811
|
items: [
|
|
790
812
|
{ type: "arbitrary", label: "flex.basis", units: k, property: "flexBasis" },
|
|
@@ -793,7 +815,7 @@ const os = ({ onAdd: r }) => {
|
|
|
793
815
|
{ type: "dropdown", label: "flex.grow", property: "flexGrow" },
|
|
794
816
|
{ type: "dropdown", label: "flex.shrink", property: "flexShrink" }
|
|
795
817
|
]
|
|
796
|
-
},
|
|
818
|
+
}, cs = {
|
|
797
819
|
heading: "grid.heading",
|
|
798
820
|
items: [
|
|
799
821
|
{ type: "range", label: "grid.col_span", property: "gridColSpan" },
|
|
@@ -804,11 +826,11 @@ const os = ({ onAdd: r }) => {
|
|
|
804
826
|
{ type: "range", label: "grid.row_end", property: "gridRowEnd" },
|
|
805
827
|
{ type: "range", label: "grid.order", property: "order" }
|
|
806
828
|
]
|
|
807
|
-
},
|
|
829
|
+
}, ps = [
|
|
808
830
|
{
|
|
809
831
|
heading: "Styles",
|
|
810
832
|
items: [
|
|
811
|
-
{ component:
|
|
833
|
+
{ component: pt },
|
|
812
834
|
{ type: "arbitrary", label: "layout.width", units: k.concat("auto"), property: "width" },
|
|
813
835
|
{ type: "arbitrary", label: "layout.height", units: k.concat("auto"), property: "height" },
|
|
814
836
|
{
|
|
@@ -868,9 +890,9 @@ const os = ({ onAdd: r }) => {
|
|
|
868
890
|
},
|
|
869
891
|
{
|
|
870
892
|
heading: "Attributes",
|
|
871
|
-
items: [{ component:
|
|
893
|
+
items: [{ component: is }]
|
|
872
894
|
}
|
|
873
|
-
],
|
|
895
|
+
], Vo = [
|
|
874
896
|
{
|
|
875
897
|
heading: "layout.heading",
|
|
876
898
|
items: [
|
|
@@ -1272,12 +1294,12 @@ const os = ({ onAdd: r }) => {
|
|
|
1272
1294
|
},
|
|
1273
1295
|
{
|
|
1274
1296
|
heading: "classes.heading",
|
|
1275
|
-
items: [{ component:
|
|
1297
|
+
items: [{ component: pt }]
|
|
1276
1298
|
}
|
|
1277
|
-
],
|
|
1299
|
+
], ut = {
|
|
1278
1300
|
"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" }) }),
|
|
1279
1301
|
// visibility
|
|
1280
|
-
visible:
|
|
1302
|
+
visible: Bt,
|
|
1281
1303
|
invisible: Be,
|
|
1282
1304
|
// display
|
|
1283
1305
|
hidden: Be,
|
|
@@ -1313,10 +1335,10 @@ const os = ({ onAdd: r }) => {
|
|
|
1313
1335
|
borderRadiusRight: Q,
|
|
1314
1336
|
borderRadiusBottom: ee,
|
|
1315
1337
|
borderRadiusLeft: te,
|
|
1316
|
-
borderRadiusTopLeft:
|
|
1317
|
-
borderRadiusTopRight:
|
|
1318
|
-
borderRadiusBottomRight:
|
|
1319
|
-
borderRadiusBottomLeft:
|
|
1338
|
+
borderRadiusTopLeft: It,
|
|
1339
|
+
borderRadiusTopRight: Pt,
|
|
1340
|
+
borderRadiusBottomRight: At,
|
|
1341
|
+
borderRadiusBottomLeft: $t,
|
|
1320
1342
|
divideXWidth: R,
|
|
1321
1343
|
divideYWidth: V,
|
|
1322
1344
|
scale: Y,
|
|
@@ -1343,18 +1365,18 @@ const os = ({ onAdd: r }) => {
|
|
|
1343
1365
|
marginBottom: ee,
|
|
1344
1366
|
marginLeft: te,
|
|
1345
1367
|
// text-align
|
|
1346
|
-
textLeft:
|
|
1347
|
-
textCenter:
|
|
1348
|
-
textRight:
|
|
1349
|
-
textJustify:
|
|
1368
|
+
textLeft: Et,
|
|
1369
|
+
textCenter: Mt,
|
|
1370
|
+
textRight: Lt,
|
|
1371
|
+
textJustify: Ot,
|
|
1350
1372
|
// font style
|
|
1351
|
-
italic:
|
|
1373
|
+
italic: zt,
|
|
1352
1374
|
// "not-italic": "",
|
|
1353
1375
|
// decoration
|
|
1354
|
-
underline:
|
|
1355
|
-
overline:
|
|
1376
|
+
underline: Yt,
|
|
1377
|
+
overline: Xt,
|
|
1356
1378
|
// transform
|
|
1357
|
-
uppercase:
|
|
1379
|
+
uppercase: Ft,
|
|
1358
1380
|
block: () => /* @__PURE__ */ e.jsxs("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [
|
|
1359
1381
|
/* @__PURE__ */ e.jsx(
|
|
1360
1382
|
"path",
|
|
@@ -1395,7 +1417,7 @@ const os = ({ onAdd: r }) => {
|
|
|
1395
1417
|
}
|
|
1396
1418
|
)
|
|
1397
1419
|
] }),
|
|
1398
|
-
"float-none":
|
|
1420
|
+
"float-none": Ke,
|
|
1399
1421
|
// position
|
|
1400
1422
|
fixed: () => /* @__PURE__ */ e.jsxs("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [
|
|
1401
1423
|
/* @__PURE__ */ e.jsx(
|
|
@@ -1467,101 +1489,101 @@ const os = ({ onAdd: r }) => {
|
|
|
1467
1489
|
}
|
|
1468
1490
|
)
|
|
1469
1491
|
] }),
|
|
1470
|
-
static:
|
|
1471
|
-
}, le = Fe({ canReset: !1, canChange: !0 }),
|
|
1492
|
+
static: Zt
|
|
1493
|
+
}, le = Fe({ canReset: !1, canChange: !0 }), us = ({ children: r, canReset: o = !1, canChange: t = !0 }) => (
|
|
1472
1494
|
// eslint-disable-next-line react/jsx-no-constructed-context-values
|
|
1473
|
-
/* @__PURE__ */ e.jsx(le.Provider, { value: { canReset:
|
|
1474
|
-
),
|
|
1475
|
-
const
|
|
1495
|
+
/* @__PURE__ */ e.jsx(le.Provider, { value: { canReset: o, canChange: t }, children: r })
|
|
1496
|
+
), gt = ({ label: r, property: o, onChange: t }) => {
|
|
1497
|
+
const a = T(() => y(ge, `${o}.classes`, [""]), [o]), l = ae(o), s = T(() => y(l, "cls", ""), [l]), { canChange: d } = se(le), c = /\[.*\]/g.test(s);
|
|
1476
1498
|
return /* @__PURE__ */ e.jsx("div", { className: r ? "w-full rounded" : "grow", children: c ? /* @__PURE__ */ e.jsxs("div", { className: "flex items-center", children: [
|
|
1477
|
-
/* @__PURE__ */ e.jsx(
|
|
1499
|
+
/* @__PURE__ */ e.jsx(we, { className: "w-[70%] rounded py-1", readOnly: !0, value: s }),
|
|
1478
1500
|
/* @__PURE__ */ e.jsxs($, { delayDuration: 100, children: [
|
|
1479
|
-
/* @__PURE__ */ e.jsx(
|
|
1480
|
-
/* @__PURE__ */ e.jsx(
|
|
1501
|
+
/* @__PURE__ */ e.jsx(E, { 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(Se, {}) }) }),
|
|
1502
|
+
/* @__PURE__ */ e.jsx(M, { children: "Current value is using a Tailwind arbitrary value." })
|
|
1481
1503
|
] })
|
|
1482
1504
|
] }) : /* @__PURE__ */ e.jsx(
|
|
1483
1505
|
ke,
|
|
1484
1506
|
{
|
|
1485
1507
|
rounded: r,
|
|
1486
|
-
onChange: (
|
|
1508
|
+
onChange: (n) => t(n, o),
|
|
1487
1509
|
selected: s,
|
|
1488
|
-
options:
|
|
1510
|
+
options: a,
|
|
1489
1511
|
disabled: !d
|
|
1490
1512
|
}
|
|
1491
1513
|
) });
|
|
1492
1514
|
};
|
|
1493
|
-
function ke({ selected: r, onChange:
|
|
1494
|
-
const s = r.replace(/.*:/g, "").trim(), { undo: d, redo: c } =
|
|
1515
|
+
function ke({ selected: r, onChange: o, rounded: t = !1, options: a, disabled: l = !1 }) {
|
|
1516
|
+
const s = r.replace(/.*:/g, "").trim(), { undo: d, redo: c } = kr();
|
|
1495
1517
|
return /* @__PURE__ */ e.jsxs(
|
|
1496
1518
|
"select",
|
|
1497
1519
|
{
|
|
1498
|
-
disabled: !
|
|
1520
|
+
disabled: !a.length || l,
|
|
1499
1521
|
className: `${t ? "rounded-md border border-border" : "border-0"} disable:bg-gray-500 h-full w-full truncate rounded bg-background px-2 py-1 text-xs outline-none disabled:cursor-not-allowed`,
|
|
1500
|
-
onChange: (
|
|
1501
|
-
onKeyDown: (
|
|
1502
|
-
|
|
1522
|
+
onChange: (n) => o(n.target.value),
|
|
1523
|
+
onKeyDown: (n) => {
|
|
1524
|
+
n.ctrlKey && (n.key === "z" && d(), n.key === "y" && c());
|
|
1503
1525
|
},
|
|
1504
1526
|
value: s,
|
|
1505
1527
|
children: [
|
|
1506
1528
|
/* @__PURE__ */ e.jsx("option", { className: "bg-transparent", value: "" }),
|
|
1507
|
-
|
|
1508
|
-
|
|
1529
|
+
P.Children.toArray(
|
|
1530
|
+
a.map((n) => /* @__PURE__ */ e.jsx("option", { className: "bg-transparent", value: n, children: n }))
|
|
1509
1531
|
)
|
|
1510
1532
|
]
|
|
1511
1533
|
}
|
|
1512
1534
|
);
|
|
1513
1535
|
}
|
|
1514
|
-
const
|
|
1515
|
-
const { canReset: t, canChange:
|
|
1516
|
-
return /* @__PURE__ */ e.jsx("div", { className: "flex flex-row divide-x divide-solid divide-border rounded border border-border text-xs", children:
|
|
1536
|
+
const gs = ({ property: r, onChange: o }) => {
|
|
1537
|
+
const { canReset: t, canChange: a } = se(le), l = ae(r), s = T(() => y(l, "cls", ""), [l]), d = T(() => y(ge, `${r}.classes`, [""]), [r]), c = d.indexOf(s) > -1 ? d.indexOf(s) : 0, n = /\[.*\]/g.test(s);
|
|
1538
|
+
return /* @__PURE__ */ e.jsx("div", { className: "flex flex-row divide-x divide-solid divide-border rounded border border-border text-xs", children: n ? /* @__PURE__ */ e.jsx("div", { className: "py-[5px] px-2", children: s }) : /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
1517
1539
|
/* @__PURE__ */ e.jsx(
|
|
1518
1540
|
"button",
|
|
1519
1541
|
{
|
|
1520
1542
|
type: "button",
|
|
1521
1543
|
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",
|
|
1522
|
-
disabled: !
|
|
1523
|
-
onClick: () =>
|
|
1544
|
+
disabled: !a && (!t || c - 1 < 0),
|
|
1545
|
+
onClick: () => o(He(d, c - 1), r),
|
|
1524
1546
|
children: /* @__PURE__ */ e.jsx("span", { className: "flex items-center justify-center", children: /* @__PURE__ */ e.jsx(
|
|
1525
|
-
|
|
1547
|
+
Wt,
|
|
1526
1548
|
{
|
|
1527
|
-
className: !
|
|
1549
|
+
className: !a && (!t || c - 1 < 0) ? "text-gray-500" : "text-black/60 dark:text-white/60"
|
|
1528
1550
|
}
|
|
1529
1551
|
) })
|
|
1530
1552
|
}
|
|
1531
1553
|
),
|
|
1532
|
-
/* @__PURE__ */ e.jsx("div", { className: "w-8/12 text-center", children: /* @__PURE__ */ e.jsx(
|
|
1554
|
+
/* @__PURE__ */ e.jsx("div", { className: "w-8/12 text-center", children: /* @__PURE__ */ e.jsx(gt, { label: !1, property: r, onChange: o }) }),
|
|
1533
1555
|
/* @__PURE__ */ e.jsx(
|
|
1534
1556
|
"button",
|
|
1535
1557
|
{
|
|
1536
1558
|
type: "button",
|
|
1537
1559
|
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",
|
|
1538
|
-
disabled: !
|
|
1539
|
-
onClick: () =>
|
|
1560
|
+
disabled: !a && (!t || c + 1 >= d.length),
|
|
1561
|
+
onClick: () => o(He(d, c + 1), r),
|
|
1540
1562
|
children: /* @__PURE__ */ e.jsx("span", { className: "flex items-center justify-center", children: /* @__PURE__ */ e.jsx(
|
|
1541
1563
|
_e,
|
|
1542
1564
|
{
|
|
1543
|
-
className: !
|
|
1565
|
+
className: !a && (!t || c + 1 >= d.length) ? "text-gray-500" : "text-black/60 dark:text-white/60"
|
|
1544
1566
|
}
|
|
1545
1567
|
) })
|
|
1546
1568
|
}
|
|
1547
1569
|
)
|
|
1548
1570
|
] }) });
|
|
1549
|
-
},
|
|
1550
|
-
const t = T(() => y(ge, `${r}.classes`, [""]), [r]), { canChange:
|
|
1571
|
+
}, xs = ({ property: r, onChange: o }) => {
|
|
1572
|
+
const t = T(() => y(ge, `${r}.classes`, [""]), [r]), { canChange: a } = se(le), l = ae(r), s = T(() => y(l, "cls", ""), [l]);
|
|
1551
1573
|
return /* @__PURE__ */ e.jsx("div", { className: "flex grow flex-wrap gap-1", children: _(t, (d) => /* @__PURE__ */ e.jsxs($, { children: [
|
|
1552
|
-
/* @__PURE__ */ e.jsx(
|
|
1574
|
+
/* @__PURE__ */ e.jsx(E, { asChild: !0, children: /* @__PURE__ */ e.jsx(
|
|
1553
1575
|
"button",
|
|
1554
1576
|
{
|
|
1555
1577
|
type: "button",
|
|
1556
|
-
disabled: !
|
|
1557
|
-
onClick: () =>
|
|
1578
|
+
disabled: !a,
|
|
1579
|
+
onClick: () => o(d, r),
|
|
1558
1580
|
className: `cursor-pointer rounded border border-gray-600 p-1 disabled:cursor-not-allowed ${s === d ? " bg-blue-500 text-white" : "disabled:bg-gray-600 disabled:text-gray-400"}`,
|
|
1559
|
-
children:
|
|
1581
|
+
children: P.createElement(y(ut, d, Ge))
|
|
1560
1582
|
}
|
|
1561
1583
|
) }),
|
|
1562
|
-
/* @__PURE__ */ e.jsx(
|
|
1584
|
+
/* @__PURE__ */ e.jsx(M, { children: F(re(d)) })
|
|
1563
1585
|
] })) });
|
|
1564
|
-
},
|
|
1586
|
+
}, ys = {
|
|
1565
1587
|
backgroundColor: "bg",
|
|
1566
1588
|
textColor: "text",
|
|
1567
1589
|
borderColor: "border",
|
|
@@ -1573,39 +1595,39 @@ const us = ({ property: r, onChange: a }) => {
|
|
|
1573
1595
|
toColor: "to",
|
|
1574
1596
|
ringColor: "ring",
|
|
1575
1597
|
ringOffsetColor: "ring-offset"
|
|
1576
|
-
},
|
|
1577
|
-
const t =
|
|
1598
|
+
}, hs = ({ property: r, onChange: o }) => {
|
|
1599
|
+
const t = ae(r), a = T(() => y(t, "cls", ""), [t]), { canChange: l } = se(le), [s, d] = w([]), [c, n] = w({ color: "", shade: "" }), p = a.split("-"), h = y(p, "1", ""), i = y(p, "2", ""), u = H(
|
|
1578
1600
|
// eslint-disable-next-line no-shadow
|
|
1579
|
-
(
|
|
1580
|
-
["current", "inherit", "transparent", "black", "white"].includes(
|
|
1601
|
+
(g) => {
|
|
1602
|
+
["current", "inherit", "transparent", "black", "white"].includes(g) ? (d([]), n({ color: g })) : (d(["50", "100", "200", "300", "400", "500", "600", "700", "800", "900"]), n((v) => ({ ...v, color: g, shade: v.shade ? v.shade : "500" })));
|
|
1581
1603
|
},
|
|
1582
|
-
[d,
|
|
1604
|
+
[d, n]
|
|
1583
1605
|
);
|
|
1584
|
-
|
|
1606
|
+
A(() => {
|
|
1585
1607
|
if (["current", "inherit", "transparent", "black", "white"].includes(h))
|
|
1586
1608
|
return d([]);
|
|
1587
1609
|
d(["50", "100", "200", "300", "400", "500", "600", "700", "800", "900"]);
|
|
1588
1610
|
}, [h]);
|
|
1589
1611
|
const x = H(
|
|
1590
1612
|
// eslint-disable-next-line no-shadow
|
|
1591
|
-
(
|
|
1592
|
-
|
|
1613
|
+
(g) => {
|
|
1614
|
+
n({ color: h, shade: g });
|
|
1593
1615
|
},
|
|
1594
1616
|
[h]
|
|
1595
1617
|
);
|
|
1596
|
-
return
|
|
1597
|
-
|
|
1598
|
-
}, [t]),
|
|
1599
|
-
const v = `${y(
|
|
1600
|
-
v.match(new RegExp(y(ge, `${r}.regExp`, ""))) &&
|
|
1601
|
-
}, [c,
|
|
1618
|
+
return A(() => {
|
|
1619
|
+
n({ color: "", shade: "" });
|
|
1620
|
+
}, [t]), A(() => {
|
|
1621
|
+
const v = `${y(ys, r, "")}-${c.color}${c.shade ? `-${c.shade}` : ""}`;
|
|
1622
|
+
v.match(new RegExp(y(ge, `${r}.regExp`, ""))) && o(v, r);
|
|
1623
|
+
}, [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: [
|
|
1602
1624
|
/* @__PURE__ */ e.jsx("div", { className: "grow text-center", children: /* @__PURE__ */ e.jsx(
|
|
1603
1625
|
ke,
|
|
1604
1626
|
{
|
|
1605
1627
|
disabled: !l,
|
|
1606
1628
|
rounded: !0,
|
|
1607
1629
|
selected: h,
|
|
1608
|
-
onChange:
|
|
1630
|
+
onChange: u,
|
|
1609
1631
|
options: [
|
|
1610
1632
|
"current",
|
|
1611
1633
|
"transparent",
|
|
@@ -1640,18 +1662,18 @@ const us = ({ property: r, onChange: a }) => {
|
|
|
1640
1662
|
) }),
|
|
1641
1663
|
/* @__PURE__ */ e.jsx("button", { type: "button", className: "grow text-center", children: /* @__PURE__ */ e.jsx(ke, { rounded: !0, selected: i, disabled: !h || !l, onChange: x, options: s }) })
|
|
1642
1664
|
] });
|
|
1643
|
-
}, ze = (r,
|
|
1665
|
+
}, ze = (r, o) => {
|
|
1644
1666
|
r = r.toLowerCase();
|
|
1645
1667
|
let t = r.trim().replace(/ |\+/g, "");
|
|
1646
|
-
if ((t === "auto" || t === "none") &&
|
|
1668
|
+
if ((t === "auto" || t === "none") && o.includes(t))
|
|
1647
1669
|
return { value: "", unit: t };
|
|
1648
|
-
const
|
|
1649
|
-
t = t.replace(
|
|
1650
|
-
const l = r.match(
|
|
1670
|
+
const a = o.length ? new RegExp(o.join("|"), "g") : /XXXXXX/g;
|
|
1671
|
+
t = t.replace(a, "");
|
|
1672
|
+
const l = r.match(a), s = l && l.length > 1, d = !m(t) && Number.isNaN(Number(t));
|
|
1651
1673
|
return s || d ? { error: "Invalid value" } : l && (l[0] === "auto" || l[0] === "none") ? { value: l[0], unit: "" } : { value: t, unit: l ? l[0] : "" };
|
|
1652
1674
|
};
|
|
1653
|
-
const
|
|
1654
|
-
const
|
|
1675
|
+
const bs = (r) => {
|
|
1676
|
+
const o = r.startsWith("-") ? "-" : "", t = r.split("-").pop();
|
|
1655
1677
|
if (["auto", "none"].includes(t))
|
|
1656
1678
|
return { value: "", unit: t };
|
|
1657
1679
|
if (t === "px")
|
|
@@ -1661,21 +1683,21 @@ const hs = (r) => {
|
|
|
1661
1683
|
if (t === "full")
|
|
1662
1684
|
return { value: "100", unit: "%" };
|
|
1663
1685
|
if (X(r, "skew-"))
|
|
1664
|
-
return { value: `${
|
|
1686
|
+
return { value: `${o}${t}`, unit: "deg" };
|
|
1665
1687
|
if (X(r, "rotate-"))
|
|
1666
|
-
return { value: `${
|
|
1688
|
+
return { value: `${o}${t}`, unit: "deg" };
|
|
1667
1689
|
if (X(r, "opacity-"))
|
|
1668
1690
|
return { value: `${t / 100}`, unit: "-" };
|
|
1669
1691
|
if (X(r, "duration-") || X(r, "delay-"))
|
|
1670
1692
|
return { value: `${t}`, unit: "ms" };
|
|
1671
1693
|
if (X(r, "translate-") && !t.includes("/"))
|
|
1672
|
-
return { value: `${
|
|
1694
|
+
return { value: `${o}${`${t / 4}`}`, unit: "rem" };
|
|
1673
1695
|
if (X(r, "scale-"))
|
|
1674
|
-
return { value: `${
|
|
1696
|
+
return { value: `${o}${`${t / 100}`}`, unit: "-" };
|
|
1675
1697
|
if (W(r, "border")) {
|
|
1676
|
-
const
|
|
1677
|
-
if (
|
|
1678
|
-
return { value:
|
|
1698
|
+
const a = r.match(/border-?(x|y|t|r|b|l)?\d+/g);
|
|
1699
|
+
if (a)
|
|
1700
|
+
return { value: a[0].split("-").pop(), unit: "px" };
|
|
1679
1701
|
if (r.match(/border-?(x|y|t|r|b|l)?/g))
|
|
1680
1702
|
return { value: "1", unit: "px" };
|
|
1681
1703
|
}
|
|
@@ -1774,43 +1796,43 @@ const hs = (r) => {
|
|
|
1774
1796
|
if (["max", "min", "fit"].includes(t))
|
|
1775
1797
|
return { value: r, unit: "class" };
|
|
1776
1798
|
if (t.includes("/")) {
|
|
1777
|
-
const [
|
|
1778
|
-
return { value:
|
|
1799
|
+
const [a, l] = _(t.split("/"), (s) => parseInt(s, 10));
|
|
1800
|
+
return { value: o + (a / l * 100).toFixed(2).replace(".00", ""), unit: "%" };
|
|
1779
1801
|
}
|
|
1780
|
-
return
|
|
1802
|
+
return St(parseFloat(t)) ? { value: `${o + parseFloat(t) * 4}`, unit: "px" } : { value: t, unit: "class" };
|
|
1781
1803
|
};
|
|
1782
|
-
const
|
|
1804
|
+
const ms = (r) => {
|
|
1783
1805
|
if (m(r))
|
|
1784
1806
|
return { value: "", unit: "" };
|
|
1785
|
-
const
|
|
1786
|
-
if (
|
|
1787
|
-
return
|
|
1788
|
-
const t = y(
|
|
1789
|
-
return { value: `${
|
|
1790
|
-
},
|
|
1807
|
+
const o = r.match(/\[.*\]/g);
|
|
1808
|
+
if (o === null)
|
|
1809
|
+
return fs(r);
|
|
1810
|
+
const t = y(o, "0", "").replace(/\[|\]/g, ""), a = r.startsWith("-") ? "-" : "", l = oe(t.match(/\d+.\d+|\d+/g));
|
|
1811
|
+
return { value: `${a}${l}`, unit: t.replace(l, "") };
|
|
1812
|
+
}, fs = (r) => m(r) ? { value: "", unit: "" } : bs(r), xt = P.createContext({
|
|
1791
1813
|
setDragData: () => {
|
|
1792
1814
|
}
|
|
1793
|
-
}),
|
|
1815
|
+
}), vs = ({
|
|
1794
1816
|
unit: r,
|
|
1795
|
-
currentValue:
|
|
1817
|
+
currentValue: o,
|
|
1796
1818
|
onDrag: t,
|
|
1797
|
-
onDragEnd:
|
|
1819
|
+
onDragEnd: a,
|
|
1798
1820
|
onDragStart: l,
|
|
1799
1821
|
negative: s,
|
|
1800
1822
|
cssProperty: d
|
|
1801
1823
|
}) => {
|
|
1802
|
-
const { setDragData: c } = se(
|
|
1824
|
+
const { setDragData: c } = se(xt);
|
|
1803
1825
|
return /* @__PURE__ */ e.jsx(
|
|
1804
1826
|
"button",
|
|
1805
1827
|
{
|
|
1806
1828
|
type: "button",
|
|
1807
|
-
onMouseDown: (
|
|
1829
|
+
onMouseDown: (n) => {
|
|
1808
1830
|
const p = {
|
|
1809
1831
|
onDrag: t,
|
|
1810
|
-
onDragEnd:
|
|
1832
|
+
onDragEnd: a,
|
|
1811
1833
|
dragging: !0,
|
|
1812
|
-
dragStartY:
|
|
1813
|
-
dragStartValue: `${
|
|
1834
|
+
dragStartY: n.pageY,
|
|
1835
|
+
dragStartValue: `${o}`,
|
|
1814
1836
|
dragUnit: r,
|
|
1815
1837
|
negative: s,
|
|
1816
1838
|
cssProperty: d
|
|
@@ -1819,36 +1841,36 @@ const bs = (r) => {
|
|
|
1819
1841
|
},
|
|
1820
1842
|
color: void 0,
|
|
1821
1843
|
className: "relative z-50 ml-1 hidden h-6 cursor-row-resize rounded bg-background/70 px-2 group-hover:inline",
|
|
1822
|
-
children: /* @__PURE__ */ e.jsx(
|
|
1844
|
+
children: /* @__PURE__ */ e.jsx(Ut, {})
|
|
1823
1845
|
}
|
|
1824
1846
|
);
|
|
1825
|
-
},
|
|
1826
|
-
|
|
1847
|
+
}, ws = ({ onSelect: r, current: o, units: t }) => /* @__PURE__ */ e.jsx("div", { "data-theme": "light", className: "-m-[7px] -mx-[13px] flex w-9 flex-col", children: t.map((a) => /* @__PURE__ */ e.jsx(
|
|
1848
|
+
B,
|
|
1827
1849
|
{
|
|
1828
1850
|
className: "h-max rounded-none px-1 py-1 text-right text-[11px] hover:bg-blue-400",
|
|
1829
|
-
color:
|
|
1851
|
+
color: o === a ? "primary" : void 0,
|
|
1830
1852
|
size: "sm",
|
|
1831
1853
|
onClick: (l) => {
|
|
1832
|
-
l.stopPropagation(), r(
|
|
1854
|
+
l.stopPropagation(), r(a);
|
|
1833
1855
|
},
|
|
1834
|
-
children:
|
|
1856
|
+
children: a
|
|
1835
1857
|
},
|
|
1836
|
-
|
|
1858
|
+
a
|
|
1837
1859
|
)) }), Ye = 50, js = (r) => {
|
|
1838
|
-
const [
|
|
1839
|
-
|
|
1840
|
-
const { value: b, unit: f } =
|
|
1860
|
+
const [o, t] = w(!1), [a, l] = w(""), { currentClass: s, onChange: d, classPrefix: c, cssProperty: n, units: p, negative: h } = r, [i, u] = w(n != null && n.toLowerCase().includes("width") ? "%" : p[0]), [x, g] = w(!1), [v, C] = w(""), [K, L] = w(!1), [G, q] = w(!1);
|
|
1861
|
+
A(() => {
|
|
1862
|
+
const { value: b, unit: f } = ms(s);
|
|
1841
1863
|
if (f === "") {
|
|
1842
|
-
l(b),
|
|
1864
|
+
l(b), u(n != null && n.toLowerCase().includes("width") ? "%" : oe(p));
|
|
1843
1865
|
return;
|
|
1844
1866
|
}
|
|
1845
|
-
|
|
1846
|
-
}, [s,
|
|
1847
|
-
const S = de((b) => d(b), [d], Ye),
|
|
1867
|
+
u(f), l(f === "class" || m(b) ? "" : b);
|
|
1868
|
+
}, [s, n, p]);
|
|
1869
|
+
const S = de((b) => d(b), [d], Ye), j = de((b) => d(b, !1), [d], Ye), D = H(
|
|
1848
1870
|
(b = !1) => {
|
|
1849
|
-
const f = ze(`${
|
|
1871
|
+
const f = ze(`${a}`, p);
|
|
1850
1872
|
if (y(f, "error", !1)) {
|
|
1851
|
-
|
|
1873
|
+
g(!0);
|
|
1852
1874
|
return;
|
|
1853
1875
|
}
|
|
1854
1876
|
const N = y(f, "unit") !== "" ? y(f, "unit") : i;
|
|
@@ -1859,14 +1881,14 @@ const bs = (r) => {
|
|
|
1859
1881
|
if (y(f, "value") === "")
|
|
1860
1882
|
return;
|
|
1861
1883
|
const z = `${y(f, "value", "").startsWith("-") ? "-" : ""}${c}[${y(f, "value", "").replace("-", "")}${N === "-" ? "" : N}]`;
|
|
1862
|
-
b ?
|
|
1884
|
+
b ? j(z) : S(z);
|
|
1863
1885
|
},
|
|
1864
|
-
[S,
|
|
1886
|
+
[S, j, a, i, c, p]
|
|
1865
1887
|
), Z = H(
|
|
1866
1888
|
(b) => {
|
|
1867
|
-
const f = ze(`${
|
|
1889
|
+
const f = ze(`${a}`, p);
|
|
1868
1890
|
if (y(f, "error", !1)) {
|
|
1869
|
-
|
|
1891
|
+
g(!0);
|
|
1870
1892
|
return;
|
|
1871
1893
|
}
|
|
1872
1894
|
if (b === "auto" || b === "none") {
|
|
@@ -1878,15 +1900,15 @@ const bs = (r) => {
|
|
|
1878
1900
|
const N = y(f, "unit") !== "" ? y(f, "unit") : b, z = `${y(f, "value", "").startsWith("-") ? "-" : ""}${c}[${y(f, "value", "").replace("-", "")}${N === "-" ? "" : N}]`;
|
|
1879
1901
|
S(z);
|
|
1880
1902
|
},
|
|
1881
|
-
[S,
|
|
1903
|
+
[S, a, c, p]
|
|
1882
1904
|
);
|
|
1883
1905
|
return /* @__PURE__ */ e.jsx("div", { className: "flex w-full flex-col", children: /* @__PURE__ */ e.jsx("div", { className: "flex items-center justify-start", children: i === "class" ? /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
1884
1906
|
/* @__PURE__ */ e.jsx("input", { className: "w-20 rounded py-1", readOnly: !0, value: s }),
|
|
1885
1907
|
/* @__PURE__ */ e.jsxs($, { children: [
|
|
1886
|
-
/* @__PURE__ */ e.jsx(
|
|
1887
|
-
/* @__PURE__ */ e.jsx(
|
|
1908
|
+
/* @__PURE__ */ e.jsx(E, { 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(Se, {}) }) }),
|
|
1909
|
+
/* @__PURE__ */ e.jsx(M, { children: "Current value is using a Tailwind preset class." })
|
|
1888
1910
|
] })
|
|
1889
|
-
] }) : /* @__PURE__ */ e.jsxs("div", { className: `group relative flex items-center ${
|
|
1911
|
+
] }) : /* @__PURE__ */ e.jsxs("div", { className: `group relative flex items-center ${K ? "z-auto" : ""}`, children: [
|
|
1890
1912
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center rounded-md border border-border", children: [
|
|
1891
1913
|
["none", "auto"].indexOf(i) !== -1 ? null : /* @__PURE__ */ e.jsx(
|
|
1892
1914
|
"input",
|
|
@@ -1899,57 +1921,57 @@ const bs = (r) => {
|
|
|
1899
1921
|
if (b.keyCode !== 38 && b.keyCode !== 40)
|
|
1900
1922
|
return;
|
|
1901
1923
|
b.preventDefault(), q(!0);
|
|
1902
|
-
const f =
|
|
1924
|
+
const f = Tt(b.target.value);
|
|
1903
1925
|
let N = Ue(f) ? 0 : f;
|
|
1904
1926
|
b.keyCode === 38 && (N += 1), b.keyCode === 40 && (N -= 1);
|
|
1905
|
-
const O = `${N}`,
|
|
1906
|
-
|
|
1927
|
+
const O = `${N}`, ht = `${O.startsWith("-") ? "-" : ""}${c}[${O.replace("-", "")}${i === "-" ? "" : i}]`;
|
|
1928
|
+
j(ht);
|
|
1907
1929
|
},
|
|
1908
1930
|
onKeyUp: (b) => {
|
|
1909
|
-
|
|
1931
|
+
G && (b.preventDefault(), q(!1));
|
|
1910
1932
|
},
|
|
1911
1933
|
onBlur: () => D(),
|
|
1912
1934
|
onChange: (b) => {
|
|
1913
|
-
|
|
1935
|
+
g(!1), l(b.target.value);
|
|
1914
1936
|
},
|
|
1915
1937
|
onClick: (b) => {
|
|
1916
1938
|
var f;
|
|
1917
1939
|
(f = b == null ? void 0 : b.target) == null || f.select(), t(!1);
|
|
1918
1940
|
},
|
|
1919
|
-
value:
|
|
1941
|
+
value: K ? v : a,
|
|
1920
1942
|
className: "h-6 w-14 rounded rounded-r-none bg-background pl-2 text-sm focus-visible:outline-0 ".concat(
|
|
1921
1943
|
" ",
|
|
1922
1944
|
x ? "border-red-500 text-red-500" : "border-foreground/20"
|
|
1923
1945
|
)
|
|
1924
1946
|
}
|
|
1925
1947
|
),
|
|
1926
|
-
/* @__PURE__ */ e.jsxs($, { open:
|
|
1927
|
-
/* @__PURE__ */ e.jsx(
|
|
1948
|
+
/* @__PURE__ */ e.jsxs($, { open: o, delayDuration: 100, children: [
|
|
1949
|
+
/* @__PURE__ */ e.jsx(E, { asChild: !0, children: /* @__PURE__ */ e.jsxs(
|
|
1928
1950
|
"button",
|
|
1929
1951
|
{
|
|
1930
1952
|
type: "button",
|
|
1931
|
-
onClick: () => t(!
|
|
1953
|
+
onClick: () => t(!o),
|
|
1932
1954
|
className: "flex h-6 cursor-pointer items-center gap-x-1 rounded rounded-l-none bg-background p-px px-1 text-[11px] uppercase",
|
|
1933
1955
|
children: [
|
|
1934
1956
|
/* @__PURE__ */ e.jsx("span", { className: `inline-block ${p.length === 1 ? "px-2 font-semibold" : ""}`, children: i }),
|
|
1935
|
-
p.length > 1 ? /* @__PURE__ */ e.jsx(
|
|
1957
|
+
p.length > 1 ? /* @__PURE__ */ e.jsx(Kt, {}) : null
|
|
1936
1958
|
]
|
|
1937
1959
|
}
|
|
1938
1960
|
) }),
|
|
1939
|
-
/* @__PURE__ */ e.jsx(
|
|
1940
|
-
|
|
1961
|
+
/* @__PURE__ */ e.jsx(Nr, { children: /* @__PURE__ */ e.jsx(M, { className: "bg-background", children: /* @__PURE__ */ e.jsx(
|
|
1962
|
+
ws,
|
|
1941
1963
|
{
|
|
1942
1964
|
units: p,
|
|
1943
1965
|
current: i,
|
|
1944
1966
|
onSelect: (b) => {
|
|
1945
|
-
t(!1),
|
|
1967
|
+
t(!1), u(b), Z(b);
|
|
1946
1968
|
}
|
|
1947
1969
|
}
|
|
1948
1970
|
) }) })
|
|
1949
1971
|
] })
|
|
1950
1972
|
] }),
|
|
1951
|
-
["none", "auto"].indexOf(i) !== -1 ||
|
|
1952
|
-
|
|
1973
|
+
["none", "auto"].indexOf(i) !== -1 || K ? null : /* @__PURE__ */ e.jsx(
|
|
1974
|
+
vs,
|
|
1953
1975
|
{
|
|
1954
1976
|
onDragStart: () => L(!0),
|
|
1955
1977
|
onDragEnd: (b) => {
|
|
@@ -1963,19 +1985,19 @@ const bs = (r) => {
|
|
|
1963
1985
|
return;
|
|
1964
1986
|
C(b);
|
|
1965
1987
|
const f = `${b}`, O = `${f.startsWith("-") ? "-" : ""}${c}[${f.replace("-", "")}${i === "-" ? "" : i}]`;
|
|
1966
|
-
|
|
1988
|
+
j(O);
|
|
1967
1989
|
},
|
|
1968
|
-
currentValue:
|
|
1990
|
+
currentValue: a,
|
|
1969
1991
|
unit: i,
|
|
1970
1992
|
negative: h,
|
|
1971
|
-
cssProperty:
|
|
1993
|
+
cssProperty: n
|
|
1972
1994
|
}
|
|
1973
1995
|
)
|
|
1974
1996
|
] }) }) });
|
|
1975
|
-
},
|
|
1976
|
-
const
|
|
1977
|
-
return
|
|
1978
|
-
},
|
|
1997
|
+
}, ae = (r) => {
|
|
1998
|
+
const o = ue();
|
|
1999
|
+
return Rt(o, { property: r });
|
|
2000
|
+
}, Cs = (r, o) => {
|
|
1979
2001
|
const t = {
|
|
1980
2002
|
xs: 0,
|
|
1981
2003
|
sm: 1,
|
|
@@ -1984,8 +2006,8 @@ const bs = (r) => {
|
|
|
1984
2006
|
xl: 4,
|
|
1985
2007
|
"2xl": 5
|
|
1986
2008
|
};
|
|
1987
|
-
return t[y(r, "mq", "xs")] <= t[
|
|
1988
|
-
},
|
|
2009
|
+
return t[y(r, "mq", "xs")] <= t[o];
|
|
2010
|
+
}, ks = {
|
|
1989
2011
|
width: "w-",
|
|
1990
2012
|
height: "h-",
|
|
1991
2013
|
minWidth: "min-w-",
|
|
@@ -2058,57 +2080,57 @@ const bs = (r) => {
|
|
|
2058
2080
|
lg: "1024px",
|
|
2059
2081
|
xl: "1280px",
|
|
2060
2082
|
"2xl": "1536px"
|
|
2061
|
-
},
|
|
2062
|
-
const { t:
|
|
2063
|
-
}, units: d, negative: c = !1 } = r, [
|
|
2064
|
-
(
|
|
2065
|
-
const Z = { dark:
|
|
2066
|
-
(
|
|
2067
|
-
const b =
|
|
2068
|
-
g
|
|
2083
|
+
}, Ns = (r) => `${r.toUpperCase()} ${Xe[r] ? `(${Xe[r]} & up)` : ""}`, Ve = (r) => {
|
|
2084
|
+
const { t: o } = I(), { type: t = "icons", label: a, property: l, onEmitChange: s = () => {
|
|
2085
|
+
}, units: d, negative: c = !1 } = r, [n] = _r(), [p] = Sr(), [, h] = Ie(), i = ae(l), u = Te(), x = at(), [g] = nt(), v = T(() => y(i, "fullCls", ""), [i]), C = H(
|
|
2086
|
+
(j, D = !0) => {
|
|
2087
|
+
const Z = { dark: n, mq: h, mod: p, cls: j, property: l, fullCls: "" };
|
|
2088
|
+
(n || p !== "") && (Z.mq = "xs");
|
|
2089
|
+
const b = Gr(Z);
|
|
2090
|
+
u(g, [b], D);
|
|
2069
2091
|
},
|
|
2070
|
-
[
|
|
2071
|
-
),
|
|
2072
|
-
x(
|
|
2073
|
-
}, [
|
|
2074
|
-
|
|
2092
|
+
[g, n, h, p, l, u]
|
|
2093
|
+
), K = H(() => {
|
|
2094
|
+
x(g, [v]);
|
|
2095
|
+
}, [g, v, x]), L = T(() => Cs(i, h), [i, h]);
|
|
2096
|
+
A(() => {
|
|
2075
2097
|
s(L, i);
|
|
2076
2098
|
}, [L, s, i]);
|
|
2077
|
-
const [, ,
|
|
2078
|
-
(
|
|
2079
|
-
|
|
2099
|
+
const [, , G] = Ie(), q = H(
|
|
2100
|
+
(j) => {
|
|
2101
|
+
G({
|
|
2080
2102
|
xs: 400,
|
|
2081
2103
|
sm: 640,
|
|
2082
2104
|
md: 800,
|
|
2083
2105
|
lg: 1024,
|
|
2084
2106
|
xl: 1420,
|
|
2085
2107
|
"2xl": 1920
|
|
2086
|
-
}[
|
|
2108
|
+
}[j]);
|
|
2087
2109
|
},
|
|
2088
|
-
[
|
|
2089
|
-
), S = y(i, "dark", null) ===
|
|
2090
|
-
return /* @__PURE__ */ e.jsx(
|
|
2091
|
-
/* @__PURE__ */ e.jsx("div", { className: "relative w-[70px] truncate text-xs text-foreground", children: /* @__PURE__ */ e.jsx("span", { className: `text-[11px] ${i && !S ? "text-foreground" : ""}`, children: a
|
|
2110
|
+
[G]
|
|
2111
|
+
), S = y(i, "dark", null) === n && y(i, "mod", null) === p && y(i, "mq", null) === h;
|
|
2112
|
+
return /* @__PURE__ */ e.jsx(us, { canChange: L, canReset: i && S, children: /* @__PURE__ */ e.jsxs("div", { className: "group flex flex-row items-center py-2 first:pt-0 last:pb-0", children: [
|
|
2113
|
+
/* @__PURE__ */ e.jsx("div", { className: "relative w-[70px] truncate text-xs text-foreground", children: /* @__PURE__ */ e.jsx("span", { className: `text-[11px] ${i && !S ? "text-foreground" : ""}`, children: o(a) }) }),
|
|
2092
2114
|
/* @__PURE__ */ e.jsxs("div", { className: "flex flex-row items-center", children: [
|
|
2093
2115
|
/* @__PURE__ */ e.jsxs("div", { className: "w-[150px]", children: [
|
|
2094
2116
|
t === "arbitrary" ? /* @__PURE__ */ e.jsx(
|
|
2095
2117
|
js,
|
|
2096
2118
|
{
|
|
2097
2119
|
currentClass: y(i, "cls", ""),
|
|
2098
|
-
classPrefix: y(
|
|
2120
|
+
classPrefix: y(ks, l, ""),
|
|
2099
2121
|
units: d || [],
|
|
2100
2122
|
onChange: C,
|
|
2101
2123
|
negative: c,
|
|
2102
2124
|
cssProperty: l
|
|
2103
2125
|
}
|
|
2104
2126
|
) : null,
|
|
2105
|
-
t === "icons" && /* @__PURE__ */ e.jsx(
|
|
2106
|
-
t === "range" && /* @__PURE__ */ e.jsx(
|
|
2107
|
-
t === "color" && /* @__PURE__ */ e.jsx(
|
|
2108
|
-
t === "dropdown" && /* @__PURE__ */ e.jsx(
|
|
2127
|
+
t === "icons" && /* @__PURE__ */ e.jsx(xs, { property: l, onChange: C }),
|
|
2128
|
+
t === "range" && /* @__PURE__ */ e.jsx(gs, { property: l, onChange: C }),
|
|
2129
|
+
t === "color" && /* @__PURE__ */ e.jsx(hs, { property: l, onChange: C }),
|
|
2130
|
+
t === "dropdown" && /* @__PURE__ */ e.jsx(gt, { label: a, property: l, onChange: C })
|
|
2109
2131
|
] }),
|
|
2110
|
-
/* @__PURE__ */ e.jsx("div", { className: `w-[30px] cursor-pointer ${v ? "visible" : "invisible"}`, children: S ? /* @__PURE__ */ e.jsx("button", { type: "button", onClick: () =>
|
|
2111
|
-
/* @__PURE__ */ e.jsx(
|
|
2132
|
+
/* @__PURE__ */ e.jsx("div", { className: `w-[30px] cursor-pointer ${v ? "visible" : "invisible"}`, children: S ? /* @__PURE__ */ e.jsx("button", { type: "button", onClick: () => K(), title: "Reset", className: "flex px-1.5 text-xs", children: /* @__PURE__ */ e.jsx(Gt, { className: "h-5 w-5 text-blue-500 hover:opacity-80" }) }) : L && i ? /* @__PURE__ */ e.jsxs($, { delayDuration: 100, children: [
|
|
2133
|
+
/* @__PURE__ */ e.jsx(E, { asChild: !0, children: /* @__PURE__ */ e.jsx(
|
|
2112
2134
|
"button",
|
|
2113
2135
|
{
|
|
2114
2136
|
type: "button",
|
|
@@ -2116,11 +2138,11 @@ const bs = (r) => {
|
|
|
2116
2138
|
children: /* @__PURE__ */ e.jsx(Se, {})
|
|
2117
2139
|
}
|
|
2118
2140
|
) }),
|
|
2119
|
-
/* @__PURE__ */ e.jsx(
|
|
2141
|
+
/* @__PURE__ */ e.jsx(M, { children: /* @__PURE__ */ e.jsx("div", { className: "text-right", children: /* @__PURE__ */ e.jsxs("div", { children: [
|
|
2120
2142
|
"Current style is set at ",
|
|
2121
2143
|
/* @__PURE__ */ e.jsxs("span", { className: "font-bold", children: [
|
|
2122
|
-
|
|
2123
|
-
|
|
2144
|
+
Ns(y(i, "mq")),
|
|
2145
|
+
n && !i.dark ? "(Light mode)" : ""
|
|
2124
2146
|
] }),
|
|
2125
2147
|
/* @__PURE__ */ e.jsx("br", {}),
|
|
2126
2148
|
/* @__PURE__ */ e.jsxs(
|
|
@@ -2139,40 +2161,40 @@ const bs = (r) => {
|
|
|
2139
2161
|
] }) : null })
|
|
2140
2162
|
] })
|
|
2141
2163
|
] }) });
|
|
2142
|
-
},
|
|
2164
|
+
}, _s = ["px", "%", "em", "rem", "ch", "vh", "vw"], yt = ({
|
|
2143
2165
|
label: r,
|
|
2144
|
-
options:
|
|
2166
|
+
options: o,
|
|
2145
2167
|
borderB: t = !1,
|
|
2146
|
-
borderT:
|
|
2168
|
+
borderT: a = !1,
|
|
2147
2169
|
type: l = "arbitrary",
|
|
2148
|
-
units: s =
|
|
2170
|
+
units: s = _s,
|
|
2149
2171
|
negative: d = !1
|
|
2150
2172
|
}) => {
|
|
2151
|
-
const { t: c } =
|
|
2173
|
+
const { t: c } = I(), [n, p] = w(o[0].key), h = ue(), i = H((u) => _(h, "property").includes(u), [h]);
|
|
2152
2174
|
return /* @__PURE__ */ e.jsxs(
|
|
2153
2175
|
"div",
|
|
2154
2176
|
{
|
|
2155
|
-
className: `mb-2 border-gray-800 py-2 first:pt-0 last:pb-0 ${t ? "border-b" : ""} ${
|
|
2177
|
+
className: `mb-2 border-gray-800 py-2 first:pt-0 last:pb-0 ${t ? "border-b" : ""} ${a ? "border-t" : ""}`,
|
|
2156
2178
|
children: [
|
|
2157
2179
|
/* @__PURE__ */ e.jsxs("div", { className: "flex flex-row text-xs", children: [
|
|
2158
2180
|
r && /* @__PURE__ */ e.jsx("span", { className: "relative w-[70px] flex-none text-xs text-foreground", children: c(r) }),
|
|
2159
|
-
/* @__PURE__ */ e.jsx("div", { className: "mb-3 flex grow flex-row flex-wrap gap-x-px", children:
|
|
2160
|
-
|
|
2161
|
-
/* @__PURE__ */ e.jsx(
|
|
2181
|
+
/* @__PURE__ */ e.jsx("div", { className: "mb-3 flex grow flex-row flex-wrap gap-x-px", children: P.Children.toArray(
|
|
2182
|
+
o.map(({ label: u, key: x }) => /* @__PURE__ */ e.jsx("div", { className: "first:rounded-l last:rounded-r", children: /* @__PURE__ */ e.jsxs($, { children: [
|
|
2183
|
+
/* @__PURE__ */ e.jsx(E, { asChild: !0, children: /* @__PURE__ */ e.jsxs(
|
|
2162
2184
|
"button",
|
|
2163
2185
|
{
|
|
2164
2186
|
type: "button",
|
|
2165
2187
|
onClick: () => p(x),
|
|
2166
|
-
className: `relative cursor-pointer rounded-full p-1 text-[8px] ${x ===
|
|
2188
|
+
className: `relative cursor-pointer rounded-full p-1 text-[8px] ${x === n ? " bg-[#3E57F0] text-white" : "text-gray-600 dark:text-gray-300"}`,
|
|
2167
2189
|
children: [
|
|
2168
|
-
|
|
2190
|
+
P.createElement("div", {
|
|
2169
2191
|
className: i(x) ? "-bottom-1.5 absolute bg-[#3E57F0] h-[2px] left-0 w-full" : ""
|
|
2170
2192
|
}),
|
|
2171
|
-
|
|
2193
|
+
P.createElement(y(ut, x, Ge), { className: "text-inherit w-3 h-3" })
|
|
2172
2194
|
]
|
|
2173
2195
|
}
|
|
2174
2196
|
) }),
|
|
2175
|
-
/* @__PURE__ */ e.jsx(
|
|
2197
|
+
/* @__PURE__ */ e.jsx(M, { children: F(re(u)) })
|
|
2176
2198
|
] }) }))
|
|
2177
2199
|
) })
|
|
2178
2200
|
] }),
|
|
@@ -2182,22 +2204,22 @@ const bs = (r) => {
|
|
|
2182
2204
|
type: l,
|
|
2183
2205
|
units: [...s],
|
|
2184
2206
|
label: "",
|
|
2185
|
-
property:
|
|
2207
|
+
property: n,
|
|
2186
2208
|
negative: d
|
|
2187
2209
|
}
|
|
2188
2210
|
) })
|
|
2189
2211
|
]
|
|
2190
2212
|
}
|
|
2191
2213
|
);
|
|
2192
|
-
},
|
|
2193
|
-
const { t } =
|
|
2194
|
-
const s = (
|
|
2195
|
-
|
|
2214
|
+
}, Ss = ({ heading: r, items: o }) => {
|
|
2215
|
+
const { t } = I(), a = ue(), l = T(() => {
|
|
2216
|
+
const s = (n) => De(
|
|
2217
|
+
n.map((p) => p.styleType === "multiple" ? _(p.options, "key") : p.property)
|
|
2196
2218
|
), d = De(
|
|
2197
|
-
|
|
2198
|
-
), c = _(
|
|
2199
|
-
return
|
|
2200
|
-
}, [
|
|
2219
|
+
o.map((n) => n.styleType === "accordion" ? s(n.items) : n.styleType === "multiple" ? _(n.options, "key") : n.property)
|
|
2220
|
+
), c = _(a, "property");
|
|
2221
|
+
return Vt(d, c).length > 0;
|
|
2222
|
+
}, [a, o]);
|
|
2201
2223
|
return /* @__PURE__ */ e.jsxs("details", { children: [
|
|
2202
2224
|
/* @__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: [
|
|
2203
2225
|
t(r),
|
|
@@ -2208,17 +2230,17 @@ const bs = (r) => {
|
|
|
2208
2230
|
}
|
|
2209
2231
|
) : null
|
|
2210
2232
|
] }) }),
|
|
2211
|
-
/* @__PURE__ */ e.jsx("div", { className: "p-2", children:
|
|
2233
|
+
/* @__PURE__ */ e.jsx("div", { className: "p-2", children: o.map((s) => s.styleType === "multiple" ? /* @__PURE__ */ e.jsx(yt, { ...s }, s.label) : /* @__PURE__ */ e.jsx(Ve, { ...s }, s.label)) })
|
|
2212
2234
|
] });
|
|
2213
|
-
},
|
|
2214
|
-
const { t:
|
|
2235
|
+
}, Ts = Fe({}), xe = ({ section: r }) => {
|
|
2236
|
+
const { t: o } = I(), t = ue(), a = H(
|
|
2215
2237
|
(s = []) => {
|
|
2216
2238
|
const d = {};
|
|
2217
|
-
for (let
|
|
2218
|
-
d[t[
|
|
2239
|
+
for (let n = 0; n < t.length; n++)
|
|
2240
|
+
d[t[n].property] = t[n].cls;
|
|
2219
2241
|
let c = !0;
|
|
2220
|
-
for (const
|
|
2221
|
-
if (!ie(d,
|
|
2242
|
+
for (const n in s)
|
|
2243
|
+
if (!ie(d, n) || d[n] !== s[n]) {
|
|
2222
2244
|
c = !1;
|
|
2223
2245
|
break;
|
|
2224
2246
|
}
|
|
@@ -2226,26 +2248,26 @@ const bs = (r) => {
|
|
|
2226
2248
|
},
|
|
2227
2249
|
[t]
|
|
2228
2250
|
), l = T(() => ({}), []);
|
|
2229
|
-
return /* @__PURE__ */ e.jsx(
|
|
2230
|
-
/* @__PURE__ */ e.jsx(fe, { className: "bg-gray-200 px-3 py-2 text-xs hover:no-underline", children: /* @__PURE__ */ e.jsx("div", { className: "flex items-center gap-x-2", children:
|
|
2231
|
-
/* @__PURE__ */ e.jsx(ve, { className: "bg-gray-100 px-3.5 py-2", children:
|
|
2232
|
-
r.items.map((s) => ie(s, "component") ?
|
|
2251
|
+
return /* @__PURE__ */ e.jsx(Ts.Provider, { value: l, children: /* @__PURE__ */ e.jsxs(me, { value: r.heading, children: [
|
|
2252
|
+
/* @__PURE__ */ e.jsx(fe, { className: "bg-gray-200 px-3 py-2 text-xs hover:no-underline", children: /* @__PURE__ */ e.jsx("div", { className: "flex items-center gap-x-2", children: o(r.heading) }) }),
|
|
2253
|
+
/* @__PURE__ */ e.jsx(ve, { className: "bg-gray-100 px-3.5 py-2", children: P.Children.toArray(
|
|
2254
|
+
r.items.map((s) => ie(s, "component") ? P.createElement(s.component, { key: s.label }) : ie(s, "styleType") ? s.styleType === "multiple" ? /* @__PURE__ */ e.jsx(yt, { ...s }, s.label) : s.styleType === "accordion" && a(s == null ? void 0 : s.conditions) ? /* @__PURE__ */ e.jsx(Ss, { ...s }, s.label) : null : /* @__PURE__ */ e.jsx(Ve, { ...s }, s.label))
|
|
2233
2255
|
) })
|
|
2234
2256
|
] }) });
|
|
2235
|
-
},
|
|
2236
|
-
const r =
|
|
2237
|
-
if (m(
|
|
2257
|
+
}, Rs = () => {
|
|
2258
|
+
const r = U(), [o] = pe(), { t } = I(), a = Mr(), l = Te(), s = Re(r._type), d = y(oe(o), "prop"), c = y(s.props, `${d}.presets`, {});
|
|
2259
|
+
if (m(a) && (!ie(s, "props") || m(c)))
|
|
2238
2260
|
return null;
|
|
2239
|
-
const
|
|
2261
|
+
const n = (p) => {
|
|
2240
2262
|
const h = p.trim().toLowerCase().replace(/ +(?= )/g, "").split(" ");
|
|
2241
2263
|
l([r._id], h, !0);
|
|
2242
2264
|
};
|
|
2243
|
-
return /* @__PURE__ */ e.jsx("div", { className: "h-10", children: /* @__PURE__ */ e.jsxs(
|
|
2244
|
-
/* @__PURE__ */ e.jsx(
|
|
2265
|
+
return /* @__PURE__ */ e.jsx("div", { className: "h-10", children: /* @__PURE__ */ e.jsxs(Tr, { children: [
|
|
2266
|
+
/* @__PURE__ */ e.jsx(Rr, { asChild: !0, children: /* @__PURE__ */ e.jsx("div", { className: "px-4", children: /* @__PURE__ */ e.jsxs(B, { variant: "default", className: "w-full", size: "sm", children: [
|
|
2245
2267
|
t("Apply Presets"),
|
|
2246
|
-
/* @__PURE__ */ e.jsx(
|
|
2268
|
+
/* @__PURE__ */ e.jsx(qt, {})
|
|
2247
2269
|
] }) }) }),
|
|
2248
|
-
/* @__PURE__ */ e.jsx(
|
|
2270
|
+
/* @__PURE__ */ e.jsx(Vr, { className: "max-h-80 w-56", children: /* @__PURE__ */ e.jsxs(dt, { className: "no-scrollbar h-full", children: [
|
|
2249
2271
|
m(c) ? null : /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
2250
2272
|
/* @__PURE__ */ e.jsxs(Pe, { children: [
|
|
2251
2273
|
s.type,
|
|
@@ -2253,37 +2275,34 @@ const bs = (r) => {
|
|
|
2253
2275
|
t("presets")
|
|
2254
2276
|
] }),
|
|
2255
2277
|
/* @__PURE__ */ e.jsx(Ae, {}),
|
|
2256
|
-
/* @__PURE__ */ e.jsx($e, { children: he(c).map((p) => /* @__PURE__ */ e.jsxs(
|
|
2278
|
+
/* @__PURE__ */ e.jsx($e, { children: he(c).map((p) => /* @__PURE__ */ e.jsxs(Ee, { className: "group text-xs", onClick: () => n(c[p]), children: [
|
|
2257
2279
|
be(F(t(p))),
|
|
2258
|
-
/* @__PURE__ */ e.jsx(
|
|
2280
|
+
/* @__PURE__ */ e.jsx(Me, { className: "invisible hover:font-bold hover:text-blue-600 group-hover:visible", children: t("apply") })
|
|
2259
2281
|
] })) })
|
|
2260
2282
|
] }),
|
|
2261
|
-
m(
|
|
2283
|
+
m(a) ? null : /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
2262
2284
|
/* @__PURE__ */ e.jsx(Pe, { children: t("Global presets") }),
|
|
2263
2285
|
/* @__PURE__ */ e.jsx(Ae, {}),
|
|
2264
|
-
/* @__PURE__ */ e.jsx($e, { children: he(
|
|
2286
|
+
/* @__PURE__ */ e.jsx($e, { children: he(a).map((p) => /* @__PURE__ */ e.jsxs(Ee, { className: "group text-xs", onClick: () => n(a[p]), children: [
|
|
2265
2287
|
be(F(t(p))),
|
|
2266
|
-
/* @__PURE__ */ e.jsx(
|
|
2288
|
+
/* @__PURE__ */ e.jsx(Me, { className: "invisible hover:font-bold hover:text-blue-600 group-hover:visible", children: t("apply") })
|
|
2267
2289
|
] })) })
|
|
2268
2290
|
] })
|
|
2269
2291
|
] }) })
|
|
2270
2292
|
] }) });
|
|
2271
2293
|
};
|
|
2272
|
-
function
|
|
2273
|
-
const { flexChild: r, gridChild:
|
|
2274
|
-
return m(
|
|
2275
|
-
/* @__PURE__ */ e.jsx(
|
|
2276
|
-
/* @__PURE__ */ e.
|
|
2277
|
-
|
|
2278
|
-
|
|
2279
|
-
|
|
2280
|
-
r && /* @__PURE__ */ e.jsx(xe, { section: is }),
|
|
2281
|
-
a ? /* @__PURE__ */ e.jsx(xe, { section: ds }) : null,
|
|
2282
|
-
cs.map((l) => /* @__PURE__ */ e.jsx(xe, { section: l }, l.heading))
|
|
2294
|
+
function Vs() {
|
|
2295
|
+
const { flexChild: r, gridChild: o } = Hr(), [t] = pe();
|
|
2296
|
+
return m(t) ? null : /* @__PURE__ */ e.jsxs("div", { className: "flex h-full flex-col", children: [
|
|
2297
|
+
/* @__PURE__ */ e.jsx(Rs, {}),
|
|
2298
|
+
/* @__PURE__ */ e.jsxs(lt, { defaultValue: ["Styles"], type: "multiple", className: "w-full", children: [
|
|
2299
|
+
r && /* @__PURE__ */ e.jsx(xe, { section: ds }),
|
|
2300
|
+
o ? /* @__PURE__ */ e.jsx(xe, { section: cs }) : null,
|
|
2301
|
+
ps.map((a) => /* @__PURE__ */ e.jsx(xe, { section: a }, a.heading))
|
|
2283
2302
|
] })
|
|
2284
2303
|
] });
|
|
2285
2304
|
}
|
|
2286
|
-
const
|
|
2305
|
+
const Hs = {
|
|
2287
2306
|
px: 1,
|
|
2288
2307
|
"%": 1,
|
|
2289
2308
|
em: 100,
|
|
@@ -2294,10 +2313,10 @@ const Vs = {
|
|
|
2294
2313
|
"-": 1,
|
|
2295
2314
|
deg: 1,
|
|
2296
2315
|
ms: 0.1
|
|
2297
|
-
},
|
|
2298
|
-
const r =
|
|
2299
|
-
onDrag: (
|
|
2300
|
-
onDragEnd: (
|
|
2316
|
+
}, Ho = () => {
|
|
2317
|
+
const r = U(), { t: o } = I(), [t, a] = P.useState(""), [l, s] = P.useState({
|
|
2318
|
+
onDrag: (n) => n,
|
|
2319
|
+
onDragEnd: (n) => n,
|
|
2301
2320
|
dragStartY: 0,
|
|
2302
2321
|
dragging: !1,
|
|
2303
2322
|
dragStartValue: 0,
|
|
@@ -2305,21 +2324,21 @@ const Vs = {
|
|
|
2305
2324
|
negative: !1,
|
|
2306
2325
|
cssProperty: ""
|
|
2307
2326
|
}), d = de(
|
|
2308
|
-
(
|
|
2327
|
+
(n) => {
|
|
2309
2328
|
const p = !y(l, "negative", !1), h = y(l, "cssProperty", "");
|
|
2310
2329
|
let i = parseFloat(l.dragStartValue);
|
|
2311
2330
|
i = Ue(i) ? 0 : i;
|
|
2312
|
-
let
|
|
2313
|
-
(W(h, "scale") || h === "opacity") && (
|
|
2314
|
-
let
|
|
2315
|
-
p &&
|
|
2331
|
+
let u = Hs[l.dragUnit];
|
|
2332
|
+
(W(h, "scale") || h === "opacity") && (u = 10);
|
|
2333
|
+
let g = (l.dragStartY - n.pageY) / u + i;
|
|
2334
|
+
p && g < 0 && (g = 0), h === "opacity" && g > 1 && (g = 1), l.onDrag(`${g}`), a(`${g}`);
|
|
2316
2335
|
},
|
|
2317
2336
|
[l],
|
|
2318
2337
|
50
|
|
2319
2338
|
), c = H(() => {
|
|
2320
2339
|
setTimeout(() => l.onDragEnd(`${t}`), 100), s({
|
|
2321
|
-
onDrag: (
|
|
2322
|
-
onDragEnd: (
|
|
2340
|
+
onDrag: (n) => n,
|
|
2341
|
+
onDragEnd: (n) => n,
|
|
2323
2342
|
dragStartY: 0,
|
|
2324
2343
|
dragging: !1,
|
|
2325
2344
|
dragStartValue: 0,
|
|
@@ -2328,10 +2347,10 @@ const Vs = {
|
|
|
2328
2347
|
cssProperty: ""
|
|
2329
2348
|
});
|
|
2330
2349
|
}, [l, t, s]);
|
|
2331
|
-
return
|
|
2332
|
-
/* @__PURE__ */ e.jsx(
|
|
2333
|
-
/* @__PURE__ */ e.jsx("h1", { children:
|
|
2334
|
-
] }) }) : /* @__PURE__ */ e.jsx(
|
|
2350
|
+
return Ht(r) ? /* @__PURE__ */ e.jsx("div", { className: "p-4 text-center", children: /* @__PURE__ */ e.jsxs("div", { className: "space-y-4 rounded-xl p-4", children: [
|
|
2351
|
+
/* @__PURE__ */ e.jsx(Jt, { className: "mx-auto text-3xl" }),
|
|
2352
|
+
/* @__PURE__ */ e.jsx("h1", { children: o("no_block_selected_for_styling") })
|
|
2353
|
+
] }) }) : /* @__PURE__ */ e.jsx(qe, { children: /* @__PURE__ */ e.jsxs(xt.Provider, { value: { setDragData: s }, children: [
|
|
2335
2354
|
l.dragging ? /* @__PURE__ */ e.jsx(
|
|
2336
2355
|
"div",
|
|
2337
2356
|
{
|
|
@@ -2340,12 +2359,15 @@ const Vs = {
|
|
|
2340
2359
|
className: "absolute inset-0 z-30 cursor-row-resize bg-gray-300/10"
|
|
2341
2360
|
}
|
|
2342
2361
|
) : null,
|
|
2343
|
-
/* @__PURE__ */ e.jsxs(
|
|
2344
|
-
/* @__PURE__ */ e.jsx(
|
|
2345
|
-
/* @__PURE__ */ e.jsx(
|
|
2362
|
+
/* @__PURE__ */ e.jsxs(dt, { className: "no-scrollbar max-h-full flex-1 overflow-x-hidden overflow-y-hidden bg-gray-100 pb-5", children: [
|
|
2363
|
+
/* @__PURE__ */ e.jsx(ls, {}),
|
|
2364
|
+
/* @__PURE__ */ e.jsx(Vs, {}),
|
|
2365
|
+
/* @__PURE__ */ e.jsx("br", {}),
|
|
2366
|
+
/* @__PURE__ */ e.jsx("br", {}),
|
|
2367
|
+
/* @__PURE__ */ e.jsx("br", {})
|
|
2346
2368
|
] })
|
|
2347
2369
|
] }) });
|
|
2348
2370
|
};
|
|
2349
2371
|
export {
|
|
2350
|
-
|
|
2372
|
+
Ho as default
|
|
2351
2373
|
};
|