@chaibuilder/sdk 1.2.25 → 1.2.26
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-l1JENNvq.js +206 -0
- package/dist/AddBlocks-zPPKkeKs.cjs +1 -0
- package/dist/BrandingOptions-DkpqGARR.cjs +1 -0
- package/dist/{BrandingOptions-iTyWpwTs.js → BrandingOptions-udtH5yJs.js} +54 -40
- package/dist/{CanvasArea-dZjng782.js → CanvasArea-h0W-Tyha.js} +324 -340
- package/dist/CanvasArea-zme1r3Zi.cjs +55 -0
- package/dist/Class-PoYusiA5.cjs +1 -0
- package/dist/{Class-ahc3NIbq.js → Class-lGzsNBOK.js} +29 -26
- package/dist/CurrentPage-Hl52iub_.cjs +1 -0
- package/dist/{CurrentPage-Kmfp-kFk.js → CurrentPage-tJUjXWdb.js} +54 -40
- package/dist/Functions-7jnEwJyw.js +15 -0
- package/dist/Functions-N3yhPYKY.cjs +1 -0
- package/dist/ListTree-WvTjY5rr.cjs +1 -0
- package/dist/{ListTree-N3jeD790.js → ListTree-cZ-Ihlt3.js} +96 -86
- package/dist/MODIFIERS-0g14w5RS.cjs +1 -0
- package/dist/{MODIFIERS-CNqNUapY.js → MODIFIERS-dytZ-osO.js} +4 -10
- package/dist/PagesPanel-6rrLXEO-.js +64 -0
- package/dist/PagesPanel-WzCocl6u.cjs +1 -0
- package/dist/ProjectPanel-o7gdcwPn.cjs +1 -0
- package/dist/ProjectPanel-tz3bjdXy.js +85 -0
- package/dist/{STRINGS-b432aBJJ.js → STRINGS--j49GZJP.js} +2 -2
- package/dist/{Settings-jCcd-VE6.js → Settings-4s2LUVmC.js} +401 -407
- package/dist/Settings-AqoKwR92.cjs +1 -0
- package/dist/SidePanels-3o6Okmvu.cjs +1 -0
- package/dist/{SidePanels-pHMYprpW.js → SidePanels-bugFfInz.js} +118 -108
- package/dist/Topbar-CqW7G360.cjs +1 -0
- package/dist/Topbar-pWzBEOed.js +132 -0
- package/dist/UnsplashImages-NGskB93R.cjs +1 -0
- package/dist/{UnsplashImages-L7x_3RQf.js → UnsplashImages-qvwFbV-E.js} +63 -50
- package/dist/{UploadImages-zdEJRLD8.js → UploadImages-9NapgXBq.js} +60 -37
- package/dist/UploadImages-Oh7Glr9A.cjs +1 -0
- package/dist/_commonjsHelpers-UyOWmZb0.js +8 -0
- package/dist/_commonjsHelpers-wDK0ZLPo.cjs +1 -0
- package/dist/add-page-modal--6TTBRYa.cjs +1 -0
- package/dist/add-page-modal-k2Kb92HS.js +104 -0
- package/dist/confirm-alert-C4M9eF-o.cjs +1 -0
- package/dist/confirm-alert-GUhZ_G8w.js +60 -0
- package/dist/controls-KK2oLIa8.cjs +1 -0
- package/dist/{controls-IS5qnRce.js → controls-OfJWSEqC.js} +85 -20
- package/dist/core.cjs +1 -1
- package/dist/core.js +75 -150
- package/dist/defaultTheme-7VqqhOcp.cjs +1 -0
- package/dist/{defaultTheme-4kA60XdB.js → defaultTheme-D8B4-wHO.js} +8 -6
- package/dist/delete-page-modal-cFoL-wdo.cjs +1 -0
- package/dist/delete-page-modal-zONvdebd.js +83 -0
- package/dist/email-blocks.cjs +1 -1
- package/dist/email-blocks.js +292 -3
- package/dist/email.cjs +1 -1
- package/dist/email.js +37 -18
- package/dist/empty-slot-ZBlsQi6m.js +15 -0
- package/dist/empty-slot-nzYOgZuS.cjs +1 -0
- package/dist/{form-0_RLz2TB.js → form-STUz-6nE.js} +12 -12
- package/dist/form-lBQ_76Uw.cjs +1 -0
- package/dist/{html-to-json-uSnxl72F.cjs → html-to-json-efmv1pCj.cjs} +1 -1
- package/dist/{html-to-json-2xtb7520.js → html-to-json-ngX9ef2u.js} +41 -41
- package/dist/index-Gk6sASBd.js +3080 -0
- package/dist/index-OB199Izc.cjs +206 -0
- package/dist/index-SkyM3d6Q.js +39503 -0
- package/dist/index-YpnaudSM.js +63 -0
- package/dist/index-e0c8PmRQ.js +205 -0
- package/dist/index-ecnGWzh9.cjs +1 -0
- package/dist/index-gi1LIOCw.cjs +1 -0
- package/dist/index-h-hd6EvN.cjs +1 -0
- package/dist/index-llTXLDGE.js +2201 -0
- package/dist/index-mbyqq81O.cjs +1 -0
- package/dist/{jsx-runtime-Sp0orL4X.js → jsx-runtime-WbnYoNE9.js} +109 -106
- package/dist/jsx-runtime-Z_BpKhVy.cjs +27 -0
- package/dist/lib.cjs +2 -2
- package/dist/lib.js +66 -62
- package/dist/page-viewer-2kwnKM6v.cjs +1 -0
- package/dist/{page-viewer-NnOwmAmu.js → page-viewer-Pdg9F5Hv.js} +57 -43
- package/dist/project-general-setting-CnNL98NM.cjs +1 -0
- package/dist/{project-general-setting-9ju3TDju.js → project-general-setting-f8Ebsn6K.js} +43 -35
- package/dist/project-seo-setting-mlxL_e2_.cjs +1 -0
- package/dist/{project-seo-setting-36CdUszM.js → project-seo-setting-pX34Qsym.js} +40 -23
- package/dist/render.cjs +1 -1
- package/dist/render.js +14 -13
- package/dist/single-page-detail-XfzrGlzA.cjs +1 -0
- package/dist/{single-page-detail-hD1jKZ8k.js → single-page-detail-dpe5LT0M.js} +74 -66
- package/dist/studio.cjs +1 -1
- package/dist/studio.js +40 -24
- package/dist/ui.cjs +1 -1
- package/dist/ui.js +160 -365
- package/dist/web-blocks.cjs +6 -1
- package/dist/web-blocks.js +1153 -3
- package/package.json +1 -1
- package/dist/AddBlocks-Ol3iIVKa.js +0 -207
- package/dist/AddBlocks-a1c-7Ewz.cjs +0 -1
- package/dist/BrandingOptions-6rnt0UaA.cjs +0 -1
- package/dist/CanvasArea-R4ogF9AT.cjs +0 -55
- package/dist/ChaiBuilderEditor-m30yoOgJ.cjs +0 -163
- package/dist/ChaiBuilderEditor-vP4at00I.js +0 -27974
- package/dist/Class-eieto7e-.cjs +0 -1
- package/dist/Controls-3Cc1XYXg.js +0 -105
- package/dist/Controls-ky25Ebo3.cjs +0 -1
- package/dist/CurrentPage-3gQTH0Zt.cjs +0 -1
- package/dist/Functions-Hvon6AMZ.cjs +0 -1
- package/dist/Functions-NzT2Six_.js +0 -15
- package/dist/ImagesPanel-J1RlG7xG.cjs +0 -1
- package/dist/ImagesPanel-Wb0GF_NA.js +0 -29
- package/dist/ListTree-CZ-mtjZ9.cjs +0 -1
- package/dist/MODIFIERS-o1p3VnpS.cjs +0 -1
- package/dist/PagesPanel-Gi0z6gaf.cjs +0 -1
- package/dist/PagesPanel-u1IB-nRr.js +0 -48
- package/dist/ProjectPanel-EydGZmMW.js +0 -71
- package/dist/ProjectPanel-kiiljG4H.cjs +0 -1
- package/dist/Settings-8ilCSH8b.cjs +0 -1
- package/dist/SidePanels-T36C6Lhc.cjs +0 -1
- package/dist/Topbar-CvWQuspR.cjs +0 -1
- package/dist/Topbar-pbIDUE_B.js +0 -122
- package/dist/UnsplashImages-KBZPd9dv.cjs +0 -1
- package/dist/UploadImages-GkkJVAgG.cjs +0 -1
- package/dist/accordion-oPUeqPCZ.js +0 -42
- package/dist/accordion-ynvFtV_p.cjs +0 -1
- package/dist/add-page-modal-9SGv2hgc.cjs +0 -1
- package/dist/add-page-modal-JCDXZIPW.js +0 -95
- package/dist/alert-dialog-P9xMMB6C.cjs +0 -1
- package/dist/alert-dialog-rypfO5ly.js +0 -64
- package/dist/badge-E-S7CqUt.cjs +0 -1
- package/dist/badge-tEwO7C51.js +0 -23
- package/dist/block-helpers-OKHmRRol.cjs +0 -1
- package/dist/block-helpers-oSFpSsGz.js +0 -23
- package/dist/command-BxR6jaCI.cjs +0 -1
- package/dist/command-Pn3HKDuV.js +0 -97
- package/dist/confirm-alert-uNm0lZ0y.cjs +0 -1
- package/dist/confirm-alert-wR5_VJ1l.js +0 -36
- package/dist/context-menu-8dC9uGXj.js +0 -122
- package/dist/context-menu-IgLbIuth.cjs +0 -1
- package/dist/controls-L7DPvB0m.cjs +0 -1
- package/dist/defaultTheme-mrkeGFGI.cjs +0 -1
- package/dist/delete-page-modal-7KmP1elv.js +0 -67
- package/dist/delete-page-modal-SgfwvfNu.cjs +0 -1
- package/dist/dropdown-menu-El86_9Uo.js +0 -124
- package/dist/dropdown-menu-SiHzqWwZ.cjs +0 -1
- package/dist/form-W58AVUdf.cjs +0 -1
- package/dist/hover-card-KUwpDkW8.cjs +0 -1
- package/dist/hover-card-q138xxXR.js +0 -45
- package/dist/iconBase-gbUAAO2L.cjs +0 -1
- package/dist/iconBase-h4DuR_XT.js +0 -63
- package/dist/index-9MmykVSc.cjs +0 -1
- package/dist/index-hElOGcFr.js +0 -2200
- package/dist/index-lDTsQp7h.js +0 -188
- package/dist/index-rq5Y9ZDy.cjs +0 -1
- package/dist/jsx-runtime-JYMCiFoE.cjs +0 -27
- package/dist/label-KaP7MRrs.js +0 -10
- package/dist/label-tFm8HZdb.cjs +0 -1
- package/dist/link-WbcKdQ9k.cjs +0 -1
- package/dist/link-xuhP-4dN.js +0 -196
- package/dist/page-viewer-Hx5hxHKm.cjs +0 -1
- package/dist/popover-a84pbVhQ.js +0 -23
- package/dist/popover-fKjgcRUx.cjs +0 -1
- package/dist/project-general-setting-FxkwjvJz.cjs +0 -1
- package/dist/project-seo-setting-RU7qiXxb.cjs +0 -1
- package/dist/scroll-area-FiHvy-TZ.cjs +0 -1
- package/dist/scroll-area-ewXbxc3n.js +0 -30
- package/dist/select-7bjg-rr9.cjs +0 -1
- package/dist/select-POGdEDHT.js +0 -75
- package/dist/separator-3Civ-6hb.cjs +0 -1
- package/dist/separator-SctTn0Qi.js +0 -18
- package/dist/single-page-detail-beY0MT1b.cjs +0 -1
- package/dist/skeleton-STeL9VrJ.cjs +0 -1
- package/dist/skeleton-lu8e7q2y.js +0 -239
- package/dist/tabs-_4WbA1cc.cjs +0 -1
- package/dist/tabs-yQ3oGziM.js +0 -106
- package/dist/textarea-1kZEh7ki.cjs +0 -1
- package/dist/textarea-b2QvVhrK.js +0 -73
- package/dist/useAddBlock-8pxOEYIl.cjs +0 -1
- package/dist/useAddBlock-FEKFJNwQ.js +0 -69
- package/dist/useChaiExternalData-fkFgoS80.js +0 -6
- package/dist/useChaiExternalData-rwoAZ6uU.cjs +0 -1
- package/dist/useDarkMode-7i57segK.cjs +0 -1
- package/dist/useDarkMode-8VHJlYyE.js +0 -23
- package/dist/useSelectedBreakpoints-6NK5qd7T.js +0 -10
- package/dist/useSelectedBreakpoints-7ONXb-vN.cjs +0 -1
- package/dist/useStylingState-Iuj84yvc.js +0 -186
- package/dist/useStylingState-OIvJMV6p.cjs +0 -1
- package/dist/useUiLibraries-nCdauJ4N.cjs +0 -1
- package/dist/useUiLibraries-psyWFbNc.js +0 -12
- package/dist/useUpdateBlocksProps-Unn8lUyj.cjs +0 -1
- package/dist/useUpdateBlocksProps-vWcDp-P9.js +0 -23
- package/dist/utils-dze1SGvB.js +0 -6
- package/dist/utils-qK_SjzzV.cjs +0 -1
|
@@ -1,86 +1,78 @@
|
|
|
1
|
-
import { j as e } from "./jsx-runtime-
|
|
1
|
+
import { j as e } from "./jsx-runtime-WbnYoNE9.js";
|
|
2
2
|
import * as de from "react";
|
|
3
|
-
import $, { useState as w,
|
|
4
|
-
import { useThrottledCallback as
|
|
5
|
-
import {
|
|
6
|
-
import { useTranslation as
|
|
7
|
-
import { PlusIcon as Ve, Cross2Icon as Qe, EyeOpenIcon as Dt, EyeClosedIcon as Ae, BorderAllIcon as A, WidthIcon as
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import
|
|
15
|
-
import
|
|
16
|
-
import
|
|
17
|
-
import
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import
|
|
21
|
-
import
|
|
22
|
-
import Dr from "@rjsf/core";
|
|
23
|
-
import Br from "@rjsf/validator-ajv8";
|
|
24
|
-
import { R as Pr, I as Ir, a as $r, L as Ar } from "./link-xuhP-4dN.js";
|
|
25
|
-
import { u as Pe, a as it, d as dt, b as xe } from "./useStylingState-Iuj84yvc.js";
|
|
26
|
-
import Mr from "react-autosuggest";
|
|
27
|
-
import Lr from "fuse.js";
|
|
28
|
-
import { A as Er, C as ge, g as Or } from "./Class-ahc3NIbq.js";
|
|
29
|
-
import { L as ct } from "./label-KaP7MRrs.js";
|
|
30
|
-
import { S as Fr } from "./STRINGS-b432aBJJ.js";
|
|
31
|
-
import { a as zr, u as Me } from "./useDarkMode-8VHJlYyE.js";
|
|
32
|
-
import { S as Yr, c as Xr, b as Zr, d as Wr, f as H } from "./select-POGdEDHT.js";
|
|
33
|
-
import { D as Ur, a as Kr, b as Gr, f as Le, g as Ee, i as Oe, c as Fe, h as ze } from "./dropdown-menu-El86_9Uo.js";
|
|
34
|
-
import "@radix-ui/react-scroll-area";
|
|
35
|
-
import "./utils-dze1SGvB.js";
|
|
3
|
+
import $, { useState as w, useMemo as _, useEffect as L, useCallback as V, memo as mt, createContext as Ke, useContext as oe } from "react";
|
|
4
|
+
import { useThrottledCallback as fe } from "@react-hookz/web";
|
|
5
|
+
import { forEach as Re, isArray as pe, omit as bt, truncate as ft, includes as M, get as x, first as ae, split as vt, startCase as E, toLower as le, isEmpty as b, map as k, find as jt, last as wt, filter as ve, set as Ge, debounce as Ct, keys as je, cloneDeep as kt, each as Nt, capitalize as we, reject as _t, nth as $e, startsWith as G, isNumber as Tt, parseInt as St, isNaN as qe, findLast as Rt, flatten as q, intersection as Je, has as ce, kebabCase as Vt, isNull as Ht } from "lodash-es";
|
|
6
|
+
import { useTranslation as z } from "react-i18next";
|
|
7
|
+
import { PlusIcon as Ve, Cross2Icon as Qe, EyeOpenIcon as Dt, EyeClosedIcon as Ae, BorderAllIcon as A, WidthIcon as S, HeightIcon as R, ArrowUpIcon as ee, ArrowRightIcon as te, ArrowDownIcon as re, ArrowLeftIcon as se, ArrowTopLeftIcon as Bt, ArrowTopRightIcon as Pt, ArrowBottomRightIcon as It, ArrowBottomLeftIcon as $t, AlignLeftIcon as At, AlignCenterHorizontallyIcon as Mt, AlignRightIcon as Et, StretchHorizontallyIcon as Lt, FontItalicIcon as Ot, UnderlineIcon as Ft, OverlineIcon as Yt, LetterCaseUppercaseIcon as zt, Cross1Icon as Xt, InfoCircledIcon as He, MinusIcon as Zt, BoxIcon as et, RowSpacingIcon as Wt, TriangleDownIcon as Ut, CrossCircledIcon as Kt, CaretDownIcon as Gt, MixerHorizontalIcon as tt } from "@radix-ui/react-icons";
|
|
8
|
+
import { aV as qt, aW as Jt, B as U, aX as Qt, aY as er, aZ as tr, a_ as rr, a$ as sr, b0 as lr, b1 as or, a1 as K, af as ar, ag as nr, ah as ir, b2 as dr, ad as cr, ao as pr, ae as ur, ap as O, aq as F, ar as Y, b3 as xr, b4 as gr, b5 as hr, b6 as yr, b7 as mr, b8 as br, a6 as rt, a5 as st, h as fr, b9 as lt, ba as Ce, bb as ke, bc as Ne, ac as ue, M as De, _ as ot, r as at, aB as nt, bd as _e, v as vr, be as jr, $ as xe, V as wr, a4 as it, N as Me, aG as Cr, aH as kr, aI as Nr, bf as Be, aJ as Ee, aK as Le, bg as Oe, bh as Fe, bi as Ye, a7 as _r, aj as Tr, ak as Sr, al as Rr, am as Vr, an as H, au as Hr, av as Dr, aw as he, ax as ye } from "./index-Gk6sASBd.js";
|
|
9
|
+
import { u as Br } from "./controls-OfJWSEqC.js";
|
|
10
|
+
import { Check as Pr, EditIcon as Ir, TrashIcon as $r, BrushIcon as Ar, DeleteIcon as Mr } from "lucide-react";
|
|
11
|
+
import { getBlockComponent as Pe, getChaiDataProviders as Er, useGlobalStylingPresets as Lr } from "@chaibuilder/runtime";
|
|
12
|
+
import { E as dt, u as ct } from "./index-SkyM3d6Q.js";
|
|
13
|
+
import { J as Or, a as Fr, d as Yr } from "./index-e0c8PmRQ.js";
|
|
14
|
+
import zr from "@rjsf/core";
|
|
15
|
+
import Xr from "@rjsf/validator-ajv8";
|
|
16
|
+
import Zr from "react-autosuggest";
|
|
17
|
+
import Wr from "fuse.js";
|
|
18
|
+
import { A as Ur, C as ge, g as Kr } from "./Class-lGzsNBOK.js";
|
|
19
|
+
import { a as Gr } from "./STRINGS--j49GZJP.js";
|
|
20
|
+
import "./_commonjsHelpers-UyOWmZb0.js";
|
|
21
|
+
import "./Functions-7jnEwJyw.js";
|
|
36
22
|
import "clsx";
|
|
37
23
|
import "tailwind-merge";
|
|
38
|
-
import "@radix-ui/react-dialog";
|
|
39
|
-
import "@radix-ui/react-tabs";
|
|
40
|
-
import "./MODIFIERS-CNqNUapY.js";
|
|
41
|
-
import "react-dom";
|
|
42
|
-
import "@floating-ui/react-dom";
|
|
43
24
|
import "jotai";
|
|
44
|
-
import "
|
|
45
|
-
import "
|
|
46
|
-
import "./Functions-NzT2Six_.js";
|
|
47
|
-
import "react-hotkeys-hook";
|
|
48
|
-
import "@radix-ui/react-slot";
|
|
25
|
+
import "./MODIFIERS-dytZ-osO.js";
|
|
26
|
+
import "@radix-ui/react-toggle";
|
|
49
27
|
import "class-variance-authority";
|
|
28
|
+
import "@radix-ui/react-switch";
|
|
29
|
+
import "@radix-ui/react-slot";
|
|
30
|
+
import "@radix-ui/react-accordion";
|
|
31
|
+
import "@radix-ui/react-alert-dialog";
|
|
32
|
+
import "@radix-ui/react-dialog";
|
|
33
|
+
import "@radix-ui/react-label";
|
|
34
|
+
import "@radix-ui/react-scroll-area";
|
|
35
|
+
import "@radix-ui/react-tabs";
|
|
50
36
|
import "@radix-ui/react-tooltip";
|
|
51
|
-
import "@radix-ui/react-toast";
|
|
52
37
|
import "@radix-ui/react-popover";
|
|
38
|
+
import "@radix-ui/react-menubar";
|
|
39
|
+
import "@radix-ui/react-hover-card";
|
|
40
|
+
import "@radix-ui/react-select";
|
|
41
|
+
import "@radix-ui/react-dropdown-menu";
|
|
42
|
+
import "@radix-ui/react-separator";
|
|
43
|
+
import "@radix-ui/react-toast";
|
|
53
44
|
import "cmdk";
|
|
54
|
-
import "@radix-ui/react-
|
|
45
|
+
import "@radix-ui/react-context-menu";
|
|
55
46
|
import "react-icons-picker";
|
|
56
|
-
import "
|
|
47
|
+
import "react-dom";
|
|
57
48
|
import "react-quill";
|
|
58
|
-
import "
|
|
59
|
-
import "@
|
|
60
|
-
import "
|
|
49
|
+
import "i18next";
|
|
50
|
+
import "@floating-ui/react-dom";
|
|
51
|
+
import "flagged";
|
|
52
|
+
import "react-hotkeys-hook";
|
|
61
53
|
function qr(r) {
|
|
62
54
|
const s = [], t = {};
|
|
63
|
-
function d(
|
|
64
|
-
Re(n, (
|
|
65
|
-
const i =
|
|
66
|
-
s.push(i), t[i] = c === "string" ? "text" : c === "object" ? "model" : c, c === "object" && !pe(
|
|
55
|
+
function d(l, n) {
|
|
56
|
+
Re(n, (o, p) => {
|
|
57
|
+
const i = l ? `${l}.${p}` : p, c = pe(o) ? "list" : typeof o;
|
|
58
|
+
s.push(i), t[i] = c === "string" ? "text" : c === "object" ? "model" : c, c === "object" && !pe(o) && d(i, o);
|
|
67
59
|
});
|
|
68
60
|
}
|
|
69
|
-
return d("",
|
|
61
|
+
return d("", bt(r, ["styles", "_type", "_id", "_name", "_bindings"])), { paths: s, pathsType: t };
|
|
70
62
|
}
|
|
71
|
-
const
|
|
63
|
+
const Te = ({ data: r, fullView: s }) => {
|
|
72
64
|
if (!r)
|
|
73
65
|
return null;
|
|
74
66
|
const t = typeof r;
|
|
75
67
|
return s ? typeof r == "object" ? /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
76
68
|
/* @__PURE__ */ e.jsx("div", { className: "h-3" }),
|
|
77
|
-
/* @__PURE__ */ e.jsx(
|
|
78
|
-
|
|
69
|
+
/* @__PURE__ */ e.jsx(dt, { children: /* @__PURE__ */ e.jsx(
|
|
70
|
+
Or,
|
|
79
71
|
{
|
|
80
72
|
data: r,
|
|
81
|
-
shouldExpandNode:
|
|
73
|
+
shouldExpandNode: Fr,
|
|
82
74
|
style: {
|
|
83
|
-
...
|
|
75
|
+
...Yr,
|
|
84
76
|
container: "max-h-[40vh] overflow-y-auto text-[12px] leading-[1.5] tracking-wide font-mono",
|
|
85
77
|
stringValue: "text-orange-600",
|
|
86
78
|
label: "text-green-900 font-semibold pr-1 tracking-wider"
|
|
@@ -90,61 +82,61 @@ const Se = ({ data: r, fullView: s }) => {
|
|
|
90
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: [
|
|
91
83
|
/* @__PURE__ */ e.jsx("span", { className: "font-medium text-gray-800/80", children: "Content: " }),
|
|
92
84
|
r
|
|
93
|
-
] }) : /* @__PURE__ */ e.jsx("div", { className: "w-full overflow-hidden whitespace-nowrap text-[10px] leading-3 text-gray-800/50", children:
|
|
94
|
-
},
|
|
85
|
+
] }) : /* @__PURE__ */ e.jsx("div", { className: "w-full overflow-hidden whitespace-nowrap text-[10px] leading-3 text-gray-800/50", children: ft(t === "object" ? JSON.stringify(r) : r, { length: 40 }) });
|
|
86
|
+
}, ze = ({
|
|
95
87
|
type: r,
|
|
96
88
|
value: s = "",
|
|
97
89
|
setValue: t,
|
|
98
90
|
data: d,
|
|
99
|
-
onChange:
|
|
91
|
+
onChange: l,
|
|
100
92
|
dataType: n,
|
|
101
|
-
appliedBindings:
|
|
93
|
+
appliedBindings: o
|
|
102
94
|
}) => {
|
|
103
|
-
const { paths: p, pathsType: i } = qr(d), c = r === "PROP" ?
|
|
104
|
-
(u) => !M(
|
|
105
|
-
) : p.filter((u) => n === x(i, u, "")), [r, p,
|
|
106
|
-
return
|
|
107
|
-
s &&
|
|
95
|
+
const { paths: p, pathsType: i } = qr(d), c = r === "PROP" ? Pe(d == null ? void 0 : d._type) : {}, h = r === "PROP", [a, g] = w(!1), y = _(() => r === "PROP" ? p.filter(
|
|
96
|
+
(u) => !M(o, u) && x(c, `props.${ae(vt(u, "."))}.binding`)
|
|
97
|
+
) : p.filter((u) => n === x(i, u, "")), [r, p, o, n, c]);
|
|
98
|
+
return L(() => {
|
|
99
|
+
s && l(s);
|
|
108
100
|
}, [s, r]), /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
109
101
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-4", children: [
|
|
110
|
-
/* @__PURE__ */ e.jsx("p", { className: "text-sm text-muted-foreground", children:
|
|
111
|
-
/* @__PURE__ */ e.jsxs(
|
|
112
|
-
/* @__PURE__ */ e.jsx(
|
|
102
|
+
/* @__PURE__ */ e.jsx("p", { className: "text-sm text-muted-foreground", children: E(le(r)) }),
|
|
103
|
+
/* @__PURE__ */ e.jsxs(qt, { open: a, onOpenChange: g, children: [
|
|
104
|
+
/* @__PURE__ */ e.jsx(Jt, { asChild: !0, children: /* @__PURE__ */ e.jsx(
|
|
113
105
|
U,
|
|
114
106
|
{
|
|
115
107
|
variant: "outline",
|
|
116
108
|
size: "sm",
|
|
117
|
-
className: ` ${
|
|
109
|
+
className: ` ${b(s) ? "w-44 justify-center bg-blue-500 text-gray-100 hover:bg-blue-400 hover:text-white" : "min-w-[350px] items-center justify-between"}`,
|
|
118
110
|
children: s ? /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
119
111
|
/* @__PURE__ */ e.jsxs("span", { className: "pr-8 text-sm", children: [
|
|
120
|
-
h && /* @__PURE__ */ e.jsx("span", { className: "mr-2 rounded-full bg-purple-100 px-2 py-0.5 text-[10px] text-purple-500", children:
|
|
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: E(n) }),
|
|
121
113
|
s
|
|
122
114
|
] }),
|
|
123
115
|
/* @__PURE__ */ e.jsx("span", { className: "cursor-pointer text-[9px] text-blue-400 underline hover:text-blue-700", children: "Change" })
|
|
124
116
|
] }) : /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
125
117
|
"+ Set ",
|
|
126
|
-
|
|
118
|
+
E(le(r))
|
|
127
119
|
] })
|
|
128
120
|
}
|
|
129
121
|
) }),
|
|
130
|
-
/* @__PURE__ */ e.jsx(
|
|
131
|
-
/* @__PURE__ */ e.jsx(
|
|
132
|
-
/* @__PURE__ */ e.jsxs(
|
|
133
|
-
/* @__PURE__ */ e.jsx(
|
|
134
|
-
/* @__PURE__ */ e.jsx(
|
|
135
|
-
|
|
122
|
+
/* @__PURE__ */ e.jsx(Qt, { className: "z-[999] min-w-[300px] p-0", side: "right", align: "start", children: /* @__PURE__ */ e.jsxs(er, { children: [
|
|
123
|
+
/* @__PURE__ */ e.jsx(tr, { placeholder: `Choose ${le(r)}...` }),
|
|
124
|
+
/* @__PURE__ */ e.jsxs(rr, { children: [
|
|
125
|
+
/* @__PURE__ */ e.jsx(sr, { children: "No results found." }),
|
|
126
|
+
/* @__PURE__ */ e.jsx(lr, { children: k(y, (u) => /* @__PURE__ */ e.jsxs(
|
|
127
|
+
or,
|
|
136
128
|
{
|
|
137
129
|
value: u,
|
|
138
130
|
className: `cursor-pointer ${h ? "flex items-center justify-between" : "flex flex-col items-start justify-start"}`,
|
|
139
|
-
onSelect: (
|
|
140
|
-
t(jt(y, (j) => j ===
|
|
131
|
+
onSelect: (f) => {
|
|
132
|
+
t(jt(y, (j) => j === f) || null), g(!1);
|
|
141
133
|
},
|
|
142
134
|
children: [
|
|
143
135
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-x-2", children: [
|
|
144
|
-
/* @__PURE__ */ e.jsx(
|
|
136
|
+
/* @__PURE__ */ e.jsx(Pr, { className: `h-4 w-4 text-green-500 ${s === u ? "" : "opacity-0"}` }),
|
|
145
137
|
u
|
|
146
138
|
] }),
|
|
147
|
-
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:
|
|
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: E(x(i, u, "")) }) }) : /* @__PURE__ */ e.jsx("div", { className: "pl-6", children: /* @__PURE__ */ e.jsx(Te, { data: x(d, u) }) })
|
|
148
140
|
]
|
|
149
141
|
},
|
|
150
142
|
u
|
|
@@ -153,7 +145,7 @@ const Se = ({ data: r, fullView: s }) => {
|
|
|
153
145
|
] }) })
|
|
154
146
|
] })
|
|
155
147
|
] }),
|
|
156
|
-
!h && !
|
|
148
|
+
!h && !b(s) && /* @__PURE__ */ e.jsx("div", { className: "pt-2", children: /* @__PURE__ */ e.jsx(Te, { data: x(d, s, ""), fullView: !0 }) })
|
|
157
149
|
] });
|
|
158
150
|
}, Jr = ({
|
|
159
151
|
appliedBindings: r = [],
|
|
@@ -161,33 +153,33 @@ const Se = ({ data: r, fullView: s }) => {
|
|
|
161
153
|
editMode: t,
|
|
162
154
|
item: d
|
|
163
155
|
}) => {
|
|
164
|
-
const [
|
|
156
|
+
const [l, n] = w(t ? d.key : ""), [o, p] = w(t ? d.value : ""), i = K(), [c] = ct(), h = V(
|
|
165
157
|
(y, u) => {
|
|
166
|
-
if (
|
|
158
|
+
if (b(y))
|
|
167
159
|
return "";
|
|
168
160
|
{
|
|
169
|
-
const
|
|
170
|
-
if (pe(
|
|
161
|
+
const f = x(u === "PROP" ? i : c, y, "");
|
|
162
|
+
if (pe(f))
|
|
171
163
|
return "list";
|
|
172
|
-
const j = typeof
|
|
164
|
+
const j = typeof f;
|
|
173
165
|
return j === "string" ? "text" : j === "object" ? "model" : j;
|
|
174
166
|
}
|
|
175
167
|
},
|
|
176
168
|
[i, c]
|
|
177
169
|
), [a, g] = w(t ? h(d.key, "PROP") : "");
|
|
178
170
|
return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
179
|
-
/* @__PURE__ */ e.jsxs(
|
|
180
|
-
/* @__PURE__ */ e.jsx(
|
|
181
|
-
/* @__PURE__ */ e.jsx(
|
|
171
|
+
/* @__PURE__ */ e.jsxs(ar, { children: [
|
|
172
|
+
/* @__PURE__ */ e.jsx(nr, { children: "Add Data Binding" }),
|
|
173
|
+
/* @__PURE__ */ e.jsx(ir, { className: "text-xs", children: "Add prop and path of binding. Click save when you're done." })
|
|
182
174
|
] }),
|
|
183
175
|
/* @__PURE__ */ e.jsxs("div", { className: "relative flex flex-col gap-1", children: [
|
|
184
176
|
/* @__PURE__ */ e.jsx(
|
|
185
|
-
|
|
177
|
+
ze,
|
|
186
178
|
{
|
|
187
179
|
type: "PROP",
|
|
188
180
|
isDisabled: !1,
|
|
189
181
|
placeholder: "Enter prop key",
|
|
190
|
-
value:
|
|
182
|
+
value: l,
|
|
191
183
|
setValue: n,
|
|
192
184
|
onChange: (y) => {
|
|
193
185
|
const u = h(y, "PROP");
|
|
@@ -200,12 +192,12 @@ const Se = ({ data: r, fullView: s }) => {
|
|
|
200
192
|
),
|
|
201
193
|
/* @__PURE__ */ e.jsx("div", { className: "h-2" }),
|
|
202
194
|
/* @__PURE__ */ e.jsx(
|
|
203
|
-
|
|
195
|
+
ze,
|
|
204
196
|
{
|
|
205
197
|
type: "PATH",
|
|
206
|
-
isDisabled:
|
|
198
|
+
isDisabled: b(l),
|
|
207
199
|
placeholder: "Enter data path",
|
|
208
|
-
value:
|
|
200
|
+
value: o,
|
|
209
201
|
setValue: p,
|
|
210
202
|
onChange: (y) => {
|
|
211
203
|
const u = h(y, "PATH");
|
|
@@ -217,26 +209,26 @@ const Se = ({ data: r, fullView: s }) => {
|
|
|
217
209
|
}
|
|
218
210
|
)
|
|
219
211
|
] }),
|
|
220
|
-
/* @__PURE__ */ e.jsx(
|
|
212
|
+
/* @__PURE__ */ e.jsx(dr, { children: /* @__PURE__ */ e.jsx(
|
|
221
213
|
U,
|
|
222
214
|
{
|
|
223
215
|
type: "submit",
|
|
224
216
|
className: "mt-4",
|
|
225
|
-
disabled:
|
|
226
|
-
onClick: () => s({ key:
|
|
217
|
+
disabled: b(l) && b(o),
|
|
218
|
+
onClick: () => s({ key: l, value: o }),
|
|
227
219
|
children: "Save"
|
|
228
220
|
}
|
|
229
221
|
) })
|
|
230
222
|
] });
|
|
231
|
-
}, pt = ({ disabled: r, children: s, onAddBinding: t, appliedBindings: d, editMode:
|
|
232
|
-
const [
|
|
233
|
-
return /* @__PURE__ */ e.jsxs(
|
|
234
|
-
/* @__PURE__ */ e.jsx(
|
|
235
|
-
|
|
223
|
+
}, pt = ({ disabled: r, children: s, onAddBinding: t, appliedBindings: d, editMode: l = !0, item: n = {} }) => {
|
|
224
|
+
const [o, p] = w(!1);
|
|
225
|
+
return /* @__PURE__ */ e.jsxs(cr, { children: [
|
|
226
|
+
/* @__PURE__ */ e.jsx(pr, { disabled: r, asChild: !0, onClick: () => p(!0), children: s }),
|
|
227
|
+
o && /* @__PURE__ */ e.jsx(ur, { children: /* @__PURE__ */ e.jsx(
|
|
236
228
|
Jr,
|
|
237
229
|
{
|
|
238
230
|
item: n,
|
|
239
|
-
editMode:
|
|
231
|
+
editMode: l,
|
|
240
232
|
appliedBindings: d,
|
|
241
233
|
onAddBinding: (i) => {
|
|
242
234
|
t(i), p(!1);
|
|
@@ -249,70 +241,70 @@ const Se = ({ data: r, fullView: s }) => {
|
|
|
249
241
|
onAddBinding: s,
|
|
250
242
|
onRemove: t,
|
|
251
243
|
selectedBlock: d,
|
|
252
|
-
dataProvider:
|
|
244
|
+
dataProvider: l,
|
|
253
245
|
appliedBindings: n
|
|
254
246
|
}) => {
|
|
255
|
-
const [
|
|
256
|
-
if (
|
|
247
|
+
const [o, p] = w("string"), i = (c, h) => {
|
|
248
|
+
if (b(c))
|
|
257
249
|
return "";
|
|
258
250
|
{
|
|
259
|
-
const a = x(h === "PROP" ? d :
|
|
251
|
+
const a = x(h === "PROP" ? d : l, c, "");
|
|
260
252
|
if (pe(a))
|
|
261
253
|
return "list";
|
|
262
254
|
const g = typeof a;
|
|
263
255
|
return g === "string" ? "text" : g === "object" ? "model" : g;
|
|
264
256
|
}
|
|
265
257
|
};
|
|
266
|
-
return
|
|
258
|
+
return L(() => p(() => i(r.key, "PROP")), [r.key]), /* @__PURE__ */ e.jsxs("div", { className: "relative flex flex-col rounded-md border border-gray-200 p-2", children: [
|
|
267
259
|
/* @__PURE__ */ e.jsx("div", { className: "text-sm font-normal text-gray-500", children: r.key }),
|
|
268
260
|
/* @__PURE__ */ e.jsx("div", { className: "font-medium leading-5", children: r.value }),
|
|
269
|
-
/* @__PURE__ */ e.jsx(
|
|
261
|
+
/* @__PURE__ */ e.jsx(Te, { data: x(l, r.value, "") }),
|
|
270
262
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center justify-end gap-x-2", children: [
|
|
271
|
-
/* @__PURE__ */ e.jsx(pt, { editMode: !0, onAddBinding: s, appliedBindings: n, item: r, children: /* @__PURE__ */ e.jsx(
|
|
263
|
+
/* @__PURE__ */ e.jsx(pt, { editMode: !0, onAddBinding: s, appliedBindings: n, item: r, children: /* @__PURE__ */ e.jsx(Ir, { 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" }) }),
|
|
272
264
|
/* @__PURE__ */ e.jsx(
|
|
273
|
-
|
|
265
|
+
$r,
|
|
274
266
|
{
|
|
275
267
|
onClick: () => t(),
|
|
276
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"
|
|
277
269
|
}
|
|
278
270
|
)
|
|
279
271
|
] }),
|
|
280
|
-
!
|
|
272
|
+
!b(o) && !b(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: E(o) })
|
|
281
273
|
] });
|
|
282
274
|
}, es = ({ bindingData: r, onChange: s }) => {
|
|
283
|
-
const t = K(), [d] =
|
|
275
|
+
const t = K(), [d] = ct(), l = Er(), [n, o] = w(
|
|
284
276
|
k(r, (a, g) => ({ key: g, value: a }))
|
|
285
277
|
);
|
|
286
|
-
|
|
287
|
-
|
|
278
|
+
L(() => {
|
|
279
|
+
o(k(r, (a, g) => ({ key: g, value: a })));
|
|
288
280
|
}, [t == null ? void 0 : t._id, r]);
|
|
289
281
|
const p = _(() => {
|
|
290
|
-
if (
|
|
282
|
+
if (b(d))
|
|
291
283
|
return !0;
|
|
292
|
-
if (
|
|
284
|
+
if (b(n))
|
|
293
285
|
return !1;
|
|
294
|
-
const a =
|
|
295
|
-
return
|
|
286
|
+
const a = wt(n);
|
|
287
|
+
return b(a == null ? void 0 : a.key) || b(a == null ? void 0 : a.value);
|
|
296
288
|
}, [d, n]), i = (a) => {
|
|
297
289
|
const g = ve(n, (y) => y.key !== a.key);
|
|
298
|
-
|
|
290
|
+
o([...g, a]), h([...g, a]);
|
|
299
291
|
}, c = (a) => {
|
|
300
292
|
const g = ve(n, (y, u) => a !== u);
|
|
301
293
|
h([...g]);
|
|
302
294
|
}, h = V(
|
|
303
295
|
(a = []) => {
|
|
304
|
-
if (
|
|
296
|
+
if (o(a), b(a)) {
|
|
305
297
|
s({});
|
|
306
298
|
return;
|
|
307
299
|
}
|
|
308
300
|
const g = {};
|
|
309
301
|
Re(a, (y) => {
|
|
310
|
-
!
|
|
302
|
+
!b(y == null ? void 0 : y.key) && !b(y == null ? void 0 : y.value) && Ge(g, y.key, y.value);
|
|
311
303
|
}), s(g);
|
|
312
304
|
},
|
|
313
305
|
[s]
|
|
314
306
|
);
|
|
315
|
-
return
|
|
307
|
+
return b(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: [
|
|
316
308
|
"You have no data providers registered. Please add a data provider to your project. ",
|
|
317
309
|
/* @__PURE__ */ e.jsx("br", {}),
|
|
318
310
|
/* @__PURE__ */ e.jsx("a", { className: "text-blue-500", href: "https://chaibuilder.com/docs/registering-data-providers", target: "_blank", children: "Learn more" })
|
|
@@ -330,7 +322,7 @@ const Se = ({ data: r, fullView: s }) => {
|
|
|
330
322
|
a.key
|
|
331
323
|
)),
|
|
332
324
|
/* @__PURE__ */ e.jsxs(O, { delayDuration: 200, children: [
|
|
333
|
-
/* @__PURE__ */ e.jsx(F, { disabled:
|
|
325
|
+
/* @__PURE__ */ e.jsx(F, { disabled: b(d), className: "w-full", children: /* @__PURE__ */ e.jsx(
|
|
334
326
|
pt,
|
|
335
327
|
{
|
|
336
328
|
disabled: p,
|
|
@@ -340,90 +332,90 @@ const Se = ({ data: r, fullView: s }) => {
|
|
|
340
332
|
"span",
|
|
341
333
|
{
|
|
342
334
|
className: `w-full rounded-md px-5 py-1.5 text-xs font-medium duration-200 ${p ? "cursor-not-allowed bg-gray-200 text-gray-400" : "bg-blue-700/20 text-blue-800 hover:bg-blue-700/30"}`,
|
|
343
|
-
children:
|
|
335
|
+
children: b(d) ? /* @__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"
|
|
344
336
|
}
|
|
345
337
|
)
|
|
346
338
|
}
|
|
347
339
|
) }),
|
|
348
|
-
p && /* @__PURE__ */ e.jsx(
|
|
340
|
+
p && /* @__PURE__ */ e.jsx(Y, { sideOffset: -55, className: "text-[11px]", children: b(d) ? "No data provider has been set up for this page." : "Complete last added data binding to add more" })
|
|
349
341
|
] })
|
|
350
342
|
] });
|
|
351
|
-
}, ts =
|
|
352
|
-
const [
|
|
343
|
+
}, ts = () => /* @__PURE__ */ e.jsx("div", { className: "text-xs border rounded-sm p-1 mt-1 border-orange-500 text-orange-500 bg-orange-100", children: "Data binding is set for this field" }), me = mt(({ id: r, properties: s, formData: t, onChange: d }) => {
|
|
344
|
+
const [l, n] = w(t), o = { type: "object", properties: {} }, p = {};
|
|
353
345
|
return Object.keys(s).forEach((i) => {
|
|
354
346
|
const c = s[i];
|
|
355
347
|
if (M(["slot", "styles"], c.type))
|
|
356
348
|
return;
|
|
357
349
|
const h = i;
|
|
358
|
-
|
|
359
|
-
}),
|
|
350
|
+
o.properties[h] = xr(c), p[h] = gr(c);
|
|
351
|
+
}), L(() => {
|
|
360
352
|
n(t);
|
|
361
353
|
}, [r]), /* @__PURE__ */ e.jsx(
|
|
362
|
-
|
|
354
|
+
zr,
|
|
363
355
|
{
|
|
364
356
|
widgets: {
|
|
365
|
-
binding:
|
|
366
|
-
richtext:
|
|
367
|
-
icon:
|
|
368
|
-
image:
|
|
357
|
+
binding: ts,
|
|
358
|
+
richtext: hr,
|
|
359
|
+
icon: yr,
|
|
360
|
+
image: mr
|
|
369
361
|
},
|
|
370
|
-
fields: { link:
|
|
362
|
+
fields: { link: br },
|
|
371
363
|
idSeparator: ".",
|
|
372
364
|
autoComplete: "off",
|
|
373
365
|
omitExtraData: !1,
|
|
374
366
|
liveOmit: !1,
|
|
375
367
|
liveValidate: !1,
|
|
376
|
-
validator:
|
|
368
|
+
validator: Xr,
|
|
377
369
|
uiSchema: p,
|
|
378
|
-
schema:
|
|
379
|
-
formData:
|
|
370
|
+
schema: o,
|
|
371
|
+
formData: l,
|
|
380
372
|
onChange: ({ formData: i }, c) => {
|
|
381
373
|
c && (n(i), d({ formData: i }, c));
|
|
382
374
|
}
|
|
383
375
|
}
|
|
384
376
|
);
|
|
385
377
|
});
|
|
386
|
-
function
|
|
387
|
-
const r = K(), s =
|
|
388
|
-
if (
|
|
389
|
-
const B =
|
|
378
|
+
function rs() {
|
|
379
|
+
const r = K(), s = rt(), t = st(), d = Pe(r._type), l = { ...r }, [n, o] = w(l), p = fr("dataBindingSupport", !1), i = ({ formData: u }, f, j) => {
|
|
380
|
+
if (f && (n == null ? void 0 : n._id) === r._id) {
|
|
381
|
+
const B = f.replace("root.", "");
|
|
390
382
|
t([r._id], { [B]: x(u, B) }, j);
|
|
391
383
|
}
|
|
392
384
|
}, c = V(
|
|
393
|
-
Ct(({ formData: u },
|
|
394
|
-
i({ formData: u },
|
|
385
|
+
Ct(({ formData: u }, f, j) => {
|
|
386
|
+
i({ formData: u }, f, j), o(u);
|
|
395
387
|
}, 1500),
|
|
396
388
|
[r == null ? void 0 : r._id]
|
|
397
|
-
), h = ({ formData: u },
|
|
398
|
-
if (
|
|
399
|
-
const j =
|
|
400
|
-
s([r._id], { [j]: x(u, j) }), c({ formData: u },
|
|
389
|
+
), h = ({ formData: u }, f) => {
|
|
390
|
+
if (f) {
|
|
391
|
+
const j = f.replace("root.", "");
|
|
392
|
+
s([r._id], { [j]: x(u, j) }), c({ formData: u }, f, { [j]: x(n, j) });
|
|
401
393
|
}
|
|
402
394
|
}, a = {
|
|
403
|
-
_name:
|
|
395
|
+
_name: Br({
|
|
404
396
|
title: "Name",
|
|
405
397
|
default: x(r, "_name", r._type)
|
|
406
398
|
})
|
|
407
|
-
}, g = je(x(
|
|
399
|
+
}, g = je(x(l, "_bindings", {})), y = _(() => {
|
|
408
400
|
const u = kt(x(d, "props", {}));
|
|
409
|
-
return p && Nt(g, (
|
|
401
|
+
return p && Nt(g, (f) => delete u[f]), u;
|
|
410
402
|
}, [d, g, p]);
|
|
411
403
|
return /* @__PURE__ */ e.jsxs("div", { className: "overflow-x-hidden", children: [
|
|
412
|
-
/* @__PURE__ */ e.jsx(me, { id: r == null ? void 0 : r._id, onChange: h, formData:
|
|
404
|
+
/* @__PURE__ */ e.jsx(me, { id: r == null ? void 0 : r._id, onChange: h, formData: l, properties: a }),
|
|
413
405
|
/* @__PURE__ */ e.jsx("hr", { className: "mt-4" }),
|
|
414
|
-
p ? /* @__PURE__ */ e.jsxs(
|
|
415
|
-
/* @__PURE__ */ e.jsxs(
|
|
416
|
-
/* @__PURE__ */ e.jsx(
|
|
406
|
+
p ? /* @__PURE__ */ e.jsxs(lt, { type: "multiple", defaultValue: ["STATIC", "BINDING"], className: "h-full w-full", children: [
|
|
407
|
+
/* @__PURE__ */ e.jsxs(Ce, { value: "BINDING", children: [
|
|
408
|
+
/* @__PURE__ */ e.jsx(ke, { 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: [
|
|
417
409
|
/* @__PURE__ */ e.jsx(
|
|
418
410
|
"div",
|
|
419
411
|
{
|
|
420
|
-
className: `h-[8px] w-[8px] rounded-full ${
|
|
412
|
+
className: `h-[8px] w-[8px] rounded-full ${b(x(r, "_bindings", {})) ? "bg-gray-300" : "bg-blue-500"}`
|
|
421
413
|
}
|
|
422
414
|
),
|
|
423
415
|
"Data Binding"
|
|
424
416
|
] }) }),
|
|
425
|
-
/* @__PURE__ */ e.jsx(
|
|
426
|
-
|
|
417
|
+
/* @__PURE__ */ e.jsx(Ne, { className: "px-4 pt-4", children: /* @__PURE__ */ e.jsx(
|
|
418
|
+
es,
|
|
427
419
|
{
|
|
428
420
|
bindingData: x(r, "_bindings", {}),
|
|
429
421
|
onChange: (u) => {
|
|
@@ -432,13 +424,13 @@ function ss() {
|
|
|
432
424
|
}
|
|
433
425
|
) })
|
|
434
426
|
] }),
|
|
435
|
-
/* @__PURE__ */ e.jsxs(
|
|
436
|
-
/* @__PURE__ */ e.jsx(
|
|
427
|
+
/* @__PURE__ */ e.jsxs(Ce, { value: "STATIC", children: [
|
|
428
|
+
/* @__PURE__ */ e.jsx(ke, { 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
429
|
/* @__PURE__ */ e.jsx("div", { className: "h-[8px] w-[8px] rounded-full bg-blue-500" }),
|
|
438
430
|
"Static Content"
|
|
439
431
|
] }) }),
|
|
440
|
-
/* @__PURE__ */ e.jsxs(
|
|
441
|
-
|
|
432
|
+
/* @__PURE__ */ e.jsxs(Ne, { className: "pt-4", children: [
|
|
433
|
+
b(g) ? null : /* @__PURE__ */ e.jsxs("div", { className: "mx-4 mb-1 mt-0 rounded-sm border border-orange-500 bg-orange-100 p-1 text-xs text-orange-500", children: [
|
|
442
434
|
"Data binding is set for ",
|
|
443
435
|
/* @__PURE__ */ e.jsx("b", { children: k(g, we).join(", ") }),
|
|
444
436
|
" ",
|
|
@@ -450,7 +442,7 @@ function ss() {
|
|
|
450
442
|
{
|
|
451
443
|
id: r == null ? void 0 : r._id,
|
|
452
444
|
onChange: h,
|
|
453
|
-
formData:
|
|
445
|
+
formData: l,
|
|
454
446
|
properties: y
|
|
455
447
|
}
|
|
456
448
|
)
|
|
@@ -461,24 +453,24 @@ function ss() {
|
|
|
461
453
|
{
|
|
462
454
|
id: r == null ? void 0 : r._id,
|
|
463
455
|
onChange: h,
|
|
464
|
-
formData:
|
|
456
|
+
formData: l,
|
|
465
457
|
properties: y
|
|
466
458
|
}
|
|
467
459
|
),
|
|
468
460
|
/* @__PURE__ */ e.jsx("div", { className: "pb-60" })
|
|
469
461
|
] });
|
|
470
462
|
}
|
|
471
|
-
const Xe = new
|
|
463
|
+
const Xe = new Wr(Ur, {
|
|
472
464
|
isCaseSensitive: !1,
|
|
473
465
|
threshold: 0.2,
|
|
474
466
|
minMatchCharLength: 2,
|
|
475
467
|
keys: ["name"]
|
|
476
468
|
});
|
|
477
|
-
function
|
|
469
|
+
function ss() {
|
|
478
470
|
var B;
|
|
479
|
-
const [r] = ue(), s = K(), t =
|
|
471
|
+
const [r] = ue(), s = K(), t = De(), d = ot(), [l] = at(), [n, o] = w(""), p = (B = ae(r)) == null ? void 0 : B.prop, i = _t((x(s, p, "").replace(Gr, "").split(",").pop() || "").split(" "), b), c = () => {
|
|
480
472
|
const C = n.trim().toLowerCase().replace(/ +(?= )/g, "").split(" ");
|
|
481
|
-
t(
|
|
473
|
+
t(l, C, !0), o("");
|
|
482
474
|
}, [h, a] = w([]), g = ({ value: C }) => {
|
|
483
475
|
const I = C.trim().toLowerCase(), X = I.match(/.+:/g);
|
|
484
476
|
let N = [];
|
|
@@ -493,7 +485,7 @@ function os() {
|
|
|
493
485
|
a(k(N, "item"));
|
|
494
486
|
}, y = () => {
|
|
495
487
|
a([]);
|
|
496
|
-
}, u = (C) => C.name,
|
|
488
|
+
}, u = (C) => C.name, f = (C) => /* @__PURE__ */ e.jsx("div", { className: "rounded-md p-1", children: C.name }), j = {
|
|
497
489
|
autoComplete: "off",
|
|
498
490
|
autoCorrect: "off",
|
|
499
491
|
autoCapitalize: "off",
|
|
@@ -503,7 +495,7 @@ function os() {
|
|
|
503
495
|
onKeyDown: (C) => {
|
|
504
496
|
C.key === "Enter" && n.trim() !== "" && c();
|
|
505
497
|
},
|
|
506
|
-
onChange: (C, { newValue: I }) =>
|
|
498
|
+
onChange: (C, { newValue: I }) => o(I),
|
|
507
499
|
className: "w-full rounded-md text-xs px-2 hover:outline-0 bg-background border-border py-1"
|
|
508
500
|
};
|
|
509
501
|
return /* @__PURE__ */ e.jsxs(
|
|
@@ -511,16 +503,16 @@ function os() {
|
|
|
511
503
|
{
|
|
512
504
|
className: `no-scrollbar flex ${h.length > 0 ? "min-h-[300px]" : "min-h-max"} w-full flex-col gap-y-5 overflow-y-auto bg-gray-100 px-px`,
|
|
513
505
|
children: [
|
|
514
|
-
/* @__PURE__ */ e.jsx(
|
|
506
|
+
/* @__PURE__ */ e.jsx(nt, { className: "mt-2", children: "Add Tailwind classes" }),
|
|
515
507
|
/* @__PURE__ */ e.jsxs("div", { className: "relative -mt-4 flex items-center gap-x-3", children: [
|
|
516
508
|
/* @__PURE__ */ e.jsx("div", { className: "relative flex w-full items-center gap-x-3", children: /* @__PURE__ */ e.jsx(
|
|
517
|
-
|
|
509
|
+
Zr,
|
|
518
510
|
{
|
|
519
511
|
suggestions: h,
|
|
520
512
|
onSuggestionsFetchRequested: g,
|
|
521
513
|
onSuggestionsClearRequested: y,
|
|
522
514
|
getSuggestionValue: u,
|
|
523
|
-
renderSuggestion:
|
|
515
|
+
renderSuggestion: f,
|
|
524
516
|
inputProps: j,
|
|
525
517
|
containerProps: {
|
|
526
518
|
className: "relative h-8 w-full gap-y-1 py-1 border-gray-600"
|
|
@@ -545,7 +537,7 @@ function os() {
|
|
|
545
537
|
)
|
|
546
538
|
] }),
|
|
547
539
|
/* @__PURE__ */ e.jsxs("div", { className: "flex w-full flex-wrap gap-2", children: [
|
|
548
|
-
|
|
540
|
+
b(i) && /* @__PURE__ */ e.jsx("div", { className: "flex h-10 w-full items-center justify-center text-center text-sm text-gray-400", children: "No class added" }),
|
|
549
541
|
de.Children.toArray(
|
|
550
542
|
i.map((C) => /* @__PURE__ */ e.jsxs(
|
|
551
543
|
"div",
|
|
@@ -556,7 +548,7 @@ function os() {
|
|
|
556
548
|
/* @__PURE__ */ e.jsx(
|
|
557
549
|
Qe,
|
|
558
550
|
{
|
|
559
|
-
onClick: () => d(
|
|
551
|
+
onClick: () => d(l, [C]),
|
|
560
552
|
className: "invisible absolute right-1 hover:text-white group-hover:visible group-hover:cursor-pointer"
|
|
561
553
|
}
|
|
562
554
|
)
|
|
@@ -579,7 +571,7 @@ const D = ["px", "%", "em", "rem", "ch", "vh", "vw"], ls = {
|
|
|
579
571
|
{ type: "dropdown", label: "flex.grow", property: "flexGrow" },
|
|
580
572
|
{ type: "dropdown", label: "flex.shrink", property: "flexShrink" }
|
|
581
573
|
]
|
|
582
|
-
},
|
|
574
|
+
}, os = {
|
|
583
575
|
heading: "grid.heading",
|
|
584
576
|
items: [
|
|
585
577
|
{ type: "range", label: "grid.col_span", property: "gridColSpan" },
|
|
@@ -590,7 +582,7 @@ const D = ["px", "%", "em", "rem", "ch", "vh", "vw"], ls = {
|
|
|
590
582
|
{ type: "range", label: "grid.row_end", property: "gridRowEnd" },
|
|
591
583
|
{ type: "range", label: "grid.order", property: "order" }
|
|
592
584
|
]
|
|
593
|
-
},
|
|
585
|
+
}, as = [
|
|
594
586
|
{
|
|
595
587
|
heading: "layout.heading",
|
|
596
588
|
items: [
|
|
@@ -992,7 +984,7 @@ const D = ["px", "%", "em", "rem", "ch", "vh", "vw"], ls = {
|
|
|
992
984
|
},
|
|
993
985
|
{
|
|
994
986
|
heading: "classes.heading",
|
|
995
|
-
items: [{ component:
|
|
987
|
+
items: [{ component: ss }]
|
|
996
988
|
}
|
|
997
989
|
], ut = {
|
|
998
990
|
"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" }) }),
|
|
@@ -1002,32 +994,32 @@ const D = ["px", "%", "em", "rem", "ch", "vh", "vw"], ls = {
|
|
|
1002
994
|
// display
|
|
1003
995
|
hidden: Ae,
|
|
1004
996
|
gap: A,
|
|
1005
|
-
gapX:
|
|
997
|
+
gapX: S,
|
|
1006
998
|
gapY: R,
|
|
1007
|
-
spaceX:
|
|
999
|
+
spaceX: S,
|
|
1008
1000
|
spaceY: R,
|
|
1009
1001
|
overscroll: A,
|
|
1010
|
-
overscrollX:
|
|
1002
|
+
overscrollX: S,
|
|
1011
1003
|
overscrollY: R,
|
|
1012
1004
|
overflow: A,
|
|
1013
|
-
overflowX:
|
|
1005
|
+
overflowX: S,
|
|
1014
1006
|
overflowY: R,
|
|
1015
1007
|
top: ee,
|
|
1016
1008
|
right: te,
|
|
1017
1009
|
bottom: re,
|
|
1018
1010
|
left: se,
|
|
1019
1011
|
inset: A,
|
|
1020
|
-
insetX:
|
|
1012
|
+
insetX: S,
|
|
1021
1013
|
insetY: R,
|
|
1022
1014
|
border: A,
|
|
1023
|
-
borderX:
|
|
1015
|
+
borderX: S,
|
|
1024
1016
|
borderY: R,
|
|
1025
1017
|
borderTop: ee,
|
|
1026
1018
|
borderRight: te,
|
|
1027
1019
|
borderBottom: re,
|
|
1028
1020
|
borderLeft: se,
|
|
1029
1021
|
borderRadius: A,
|
|
1030
|
-
borderRadiusX:
|
|
1022
|
+
borderRadiusX: S,
|
|
1031
1023
|
borderRadiusY: R,
|
|
1032
1024
|
borderRadiusTop: ee,
|
|
1033
1025
|
borderRadiusRight: te,
|
|
@@ -1037,18 +1029,18 @@ const D = ["px", "%", "em", "rem", "ch", "vh", "vw"], ls = {
|
|
|
1037
1029
|
borderRadiusTopRight: Pt,
|
|
1038
1030
|
borderRadiusBottomRight: It,
|
|
1039
1031
|
borderRadiusBottomLeft: $t,
|
|
1040
|
-
divideXWidth:
|
|
1032
|
+
divideXWidth: S,
|
|
1041
1033
|
divideYWidth: R,
|
|
1042
1034
|
scale: A,
|
|
1043
|
-
scaleX:
|
|
1035
|
+
scaleX: S,
|
|
1044
1036
|
scaleY: R,
|
|
1045
|
-
skewX:
|
|
1037
|
+
skewX: S,
|
|
1046
1038
|
skewY: R,
|
|
1047
|
-
translateX:
|
|
1039
|
+
translateX: S,
|
|
1048
1040
|
translateY: R,
|
|
1049
1041
|
// padding
|
|
1050
1042
|
padding: A,
|
|
1051
|
-
paddingX:
|
|
1043
|
+
paddingX: S,
|
|
1052
1044
|
paddingY: R,
|
|
1053
1045
|
paddingTop: ee,
|
|
1054
1046
|
paddingRight: te,
|
|
@@ -1056,7 +1048,7 @@ const D = ["px", "%", "em", "rem", "ch", "vh", "vw"], ls = {
|
|
|
1056
1048
|
paddingLeft: se,
|
|
1057
1049
|
// margin
|
|
1058
1050
|
margin: A,
|
|
1059
|
-
marginX:
|
|
1051
|
+
marginX: S,
|
|
1060
1052
|
marginY: R,
|
|
1061
1053
|
marginTop: ee,
|
|
1062
1054
|
marginRight: te,
|
|
@@ -1065,16 +1057,16 @@ const D = ["px", "%", "em", "rem", "ch", "vh", "vw"], ls = {
|
|
|
1065
1057
|
// text-align
|
|
1066
1058
|
textLeft: At,
|
|
1067
1059
|
textCenter: Mt,
|
|
1068
|
-
textRight:
|
|
1069
|
-
textJustify:
|
|
1060
|
+
textRight: Et,
|
|
1061
|
+
textJustify: Lt,
|
|
1070
1062
|
// font style
|
|
1071
1063
|
italic: Ot,
|
|
1072
1064
|
// "not-italic": "",
|
|
1073
1065
|
// decoration
|
|
1074
1066
|
underline: Ft,
|
|
1075
|
-
overline:
|
|
1067
|
+
overline: Yt,
|
|
1076
1068
|
// transform
|
|
1077
|
-
uppercase:
|
|
1069
|
+
uppercase: zt,
|
|
1078
1070
|
block: () => /* @__PURE__ */ e.jsxs("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [
|
|
1079
1071
|
/* @__PURE__ */ e.jsx(
|
|
1080
1072
|
"path",
|
|
@@ -1188,38 +1180,38 @@ const D = ["px", "%", "em", "rem", "ch", "vh", "vw"], ls = {
|
|
|
1188
1180
|
)
|
|
1189
1181
|
] }),
|
|
1190
1182
|
static: Xt
|
|
1191
|
-
}, ne = Ke({ canReset: !1, canChange: !0 }),
|
|
1183
|
+
}, ne = Ke({ canReset: !1, canChange: !0 }), ns = ({ children: r, canReset: s = !1, canChange: t = !0 }) => (
|
|
1192
1184
|
// eslint-disable-next-line react/jsx-no-constructed-context-values
|
|
1193
1185
|
/* @__PURE__ */ e.jsx(ne.Provider, { value: { canReset: s, canChange: t }, children: r })
|
|
1194
1186
|
), xt = ({ label: r, property: s, onChange: t }) => {
|
|
1195
|
-
const d = _(() => x(ge, `${s}.classes`, [""]), [s]),
|
|
1187
|
+
const d = _(() => x(ge, `${s}.classes`, [""]), [s]), l = ie(s), n = _(() => x(l, "cls", ""), [l]), { canChange: o } = oe(ne), p = /\[.*\]/g.test(n);
|
|
1196
1188
|
return /* @__PURE__ */ e.jsx("div", { className: r ? "w-full rounded" : "grow", children: p ? /* @__PURE__ */ e.jsxs("div", { className: "flex items-center", children: [
|
|
1197
|
-
/* @__PURE__ */ e.jsx(
|
|
1189
|
+
/* @__PURE__ */ e.jsx(_e, { className: "w-[70%] rounded py-1", readOnly: !0, value: n }),
|
|
1198
1190
|
/* @__PURE__ */ e.jsxs(O, { delayDuration: 100, children: [
|
|
1199
1191
|
/* @__PURE__ */ e.jsx(F, { 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(He, {}) }) }),
|
|
1200
|
-
/* @__PURE__ */ e.jsx(
|
|
1192
|
+
/* @__PURE__ */ e.jsx(Y, { children: "Current value is using a Tailwind arbitrary value." })
|
|
1201
1193
|
] })
|
|
1202
1194
|
] }) : /* @__PURE__ */ e.jsx(
|
|
1203
|
-
|
|
1195
|
+
Se,
|
|
1204
1196
|
{
|
|
1205
1197
|
rounded: r,
|
|
1206
1198
|
onChange: (i) => t(i, s),
|
|
1207
1199
|
selected: n,
|
|
1208
1200
|
options: d,
|
|
1209
|
-
disabled: !
|
|
1201
|
+
disabled: !o
|
|
1210
1202
|
}
|
|
1211
1203
|
) });
|
|
1212
1204
|
};
|
|
1213
|
-
function
|
|
1214
|
-
const n = r.replace(/.*:/g, "").trim(), { undo:
|
|
1205
|
+
function Se({ selected: r, onChange: s, rounded: t = !1, options: d, disabled: l = !1 }) {
|
|
1206
|
+
const n = r.replace(/.*:/g, "").trim(), { undo: o, redo: p } = vr();
|
|
1215
1207
|
return /* @__PURE__ */ e.jsxs(
|
|
1216
1208
|
"select",
|
|
1217
1209
|
{
|
|
1218
|
-
disabled: !d.length ||
|
|
1210
|
+
disabled: !d.length || l,
|
|
1219
1211
|
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`,
|
|
1220
1212
|
onChange: (i) => s(i.target.value),
|
|
1221
1213
|
onKeyDown: (i) => {
|
|
1222
|
-
i.ctrlKey && (i.key === "z" &&
|
|
1214
|
+
i.ctrlKey && (i.key === "z" && o(), i.key === "y" && p());
|
|
1223
1215
|
},
|
|
1224
1216
|
value: n,
|
|
1225
1217
|
children: [
|
|
@@ -1231,8 +1223,8 @@ function Te({ selected: r, onChange: s, rounded: t = !1, options: d, disabled: o
|
|
|
1231
1223
|
}
|
|
1232
1224
|
);
|
|
1233
1225
|
}
|
|
1234
|
-
const
|
|
1235
|
-
const { canReset: t, canChange: d } =
|
|
1226
|
+
const is = ({ property: r, onChange: s }) => {
|
|
1227
|
+
const { canReset: t, canChange: d } = oe(ne), l = ie(r), n = _(() => x(l, "cls", ""), [l]), o = _(() => x(ge, `${r}.classes`, [""]), [r]), p = o.indexOf(n) > -1 ? o.indexOf(n) : 0, i = /\[.*\]/g.test(n);
|
|
1236
1228
|
return /* @__PURE__ */ e.jsx("div", { className: "flex flex-row divide-x divide-solid divide-border rounded border border-border text-xs", children: i ? /* @__PURE__ */ e.jsx("div", { className: "py-[5px] px-2", children: n }) : /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
1237
1229
|
/* @__PURE__ */ e.jsx(
|
|
1238
1230
|
"button",
|
|
@@ -1240,7 +1232,7 @@ const ds = ({ property: r, onChange: s }) => {
|
|
|
1240
1232
|
type: "button",
|
|
1241
1233
|
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",
|
|
1242
1234
|
disabled: !d && (!t || p - 1 < 0),
|
|
1243
|
-
onClick: () => s($e(
|
|
1235
|
+
onClick: () => s($e(o, p - 1), r),
|
|
1244
1236
|
children: /* @__PURE__ */ e.jsx("span", { className: "flex items-center justify-center", children: /* @__PURE__ */ e.jsx(
|
|
1245
1237
|
Zt,
|
|
1246
1238
|
{
|
|
@@ -1255,33 +1247,33 @@ const ds = ({ property: r, onChange: s }) => {
|
|
|
1255
1247
|
{
|
|
1256
1248
|
type: "button",
|
|
1257
1249
|
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",
|
|
1258
|
-
disabled: !d && (!t || p + 1 >=
|
|
1259
|
-
onClick: () => s($e(
|
|
1250
|
+
disabled: !d && (!t || p + 1 >= o.length),
|
|
1251
|
+
onClick: () => s($e(o, p + 1), r),
|
|
1260
1252
|
children: /* @__PURE__ */ e.jsx("span", { className: "flex items-center justify-center", children: /* @__PURE__ */ e.jsx(
|
|
1261
1253
|
Ve,
|
|
1262
1254
|
{
|
|
1263
|
-
className: !d && (!t || p + 1 >=
|
|
1255
|
+
className: !d && (!t || p + 1 >= o.length) ? "text-gray-500" : "text-black/60 dark:text-white/60"
|
|
1264
1256
|
}
|
|
1265
1257
|
) })
|
|
1266
1258
|
}
|
|
1267
1259
|
)
|
|
1268
1260
|
] }) });
|
|
1269
|
-
},
|
|
1270
|
-
const t = _(() => x(ge, `${r}.classes`, [""]), [r]), { canChange: d } =
|
|
1271
|
-
return /* @__PURE__ */ e.jsx("div", { className: "flex grow flex-wrap gap-1", children: k(t, (
|
|
1261
|
+
}, ds = ({ property: r, onChange: s }) => {
|
|
1262
|
+
const t = _(() => x(ge, `${r}.classes`, [""]), [r]), { canChange: d } = oe(ne), l = ie(r), n = _(() => x(l, "cls", ""), [l]);
|
|
1263
|
+
return /* @__PURE__ */ e.jsx("div", { className: "flex grow flex-wrap gap-1", children: k(t, (o) => /* @__PURE__ */ e.jsxs(O, { children: [
|
|
1272
1264
|
/* @__PURE__ */ e.jsx(F, { asChild: !0, children: /* @__PURE__ */ e.jsx(
|
|
1273
1265
|
"button",
|
|
1274
1266
|
{
|
|
1275
1267
|
type: "button",
|
|
1276
1268
|
disabled: !d,
|
|
1277
|
-
onClick: () => s(
|
|
1278
|
-
className: `cursor-pointer rounded border border-gray-600 p-1 disabled:cursor-not-allowed ${n ===
|
|
1279
|
-
children: $.createElement(x(ut,
|
|
1269
|
+
onClick: () => s(o, r),
|
|
1270
|
+
className: `cursor-pointer rounded border border-gray-600 p-1 disabled:cursor-not-allowed ${n === o ? " bg-blue-500 text-white" : "disabled:bg-gray-600 disabled:text-gray-400"}`,
|
|
1271
|
+
children: $.createElement(x(ut, o, et))
|
|
1280
1272
|
}
|
|
1281
1273
|
) }),
|
|
1282
|
-
/* @__PURE__ */ e.jsx(
|
|
1274
|
+
/* @__PURE__ */ e.jsx(Y, { children: E(le(o)) })
|
|
1283
1275
|
] })) });
|
|
1284
|
-
},
|
|
1276
|
+
}, cs = {
|
|
1285
1277
|
backgroundColor: "bg",
|
|
1286
1278
|
textColor: "text",
|
|
1287
1279
|
borderColor: "border",
|
|
@@ -1293,18 +1285,18 @@ const ds = ({ property: r, onChange: s }) => {
|
|
|
1293
1285
|
toColor: "to",
|
|
1294
1286
|
ringColor: "ring",
|
|
1295
1287
|
ringOffsetColor: "ring-offset"
|
|
1296
|
-
},
|
|
1297
|
-
const t = ie(r), d = _(() => x(t, "cls", ""), [t]), { canChange:
|
|
1288
|
+
}, ps = ({ property: r, onChange: s }) => {
|
|
1289
|
+
const t = ie(r), d = _(() => x(t, "cls", ""), [t]), { canChange: l } = oe(ne), [n, o] = w([]), [p, i] = w({ color: "", shade: "" }), c = d.split("-"), h = x(c, "1", ""), a = x(c, "2", ""), g = V(
|
|
1298
1290
|
// eslint-disable-next-line no-shadow
|
|
1299
1291
|
(u) => {
|
|
1300
|
-
["current", "inherit", "transparent", "black", "white"].includes(u) ? (
|
|
1292
|
+
["current", "inherit", "transparent", "black", "white"].includes(u) ? (o([]), i({ color: u })) : (o(["50", "100", "200", "300", "400", "500", "600", "700", "800", "900"]), i((f) => ({ ...f, color: u, shade: f.shade ? f.shade : "500" })));
|
|
1301
1293
|
},
|
|
1302
|
-
[
|
|
1294
|
+
[o, i]
|
|
1303
1295
|
);
|
|
1304
|
-
|
|
1296
|
+
L(() => {
|
|
1305
1297
|
if (["current", "inherit", "transparent", "black", "white"].includes(h))
|
|
1306
|
-
return
|
|
1307
|
-
|
|
1298
|
+
return o([]);
|
|
1299
|
+
o(["50", "100", "200", "300", "400", "500", "600", "700", "800", "900"]);
|
|
1308
1300
|
}, [h]);
|
|
1309
1301
|
const y = V(
|
|
1310
1302
|
// eslint-disable-next-line no-shadow
|
|
@@ -1313,16 +1305,16 @@ const ds = ({ property: r, onChange: s }) => {
|
|
|
1313
1305
|
},
|
|
1314
1306
|
[h]
|
|
1315
1307
|
);
|
|
1316
|
-
return
|
|
1308
|
+
return L(() => {
|
|
1317
1309
|
i({ color: "", shade: "" });
|
|
1318
|
-
}, [t]),
|
|
1319
|
-
const
|
|
1320
|
-
|
|
1310
|
+
}, [t]), L(() => {
|
|
1311
|
+
const f = `${x(cs, r, "")}-${p.color}${p.shade ? `-${p.shade}` : ""}`;
|
|
1312
|
+
f.match(new RegExp(x(ge, `${r}.regExp`, ""))) && s(f, r);
|
|
1321
1313
|
}, [p, s, r]), /* @__PURE__ */ e.jsxs("div", { className: "flex flex-row divide-x divide-solid divide-border rounded-lg border border-border text-xs", children: [
|
|
1322
1314
|
/* @__PURE__ */ e.jsx("div", { className: "grow text-center", children: /* @__PURE__ */ e.jsx(
|
|
1323
|
-
|
|
1315
|
+
Se,
|
|
1324
1316
|
{
|
|
1325
|
-
disabled: !
|
|
1317
|
+
disabled: !l,
|
|
1326
1318
|
rounded: !0,
|
|
1327
1319
|
selected: h,
|
|
1328
1320
|
onChange: g,
|
|
@@ -1358,7 +1350,7 @@ const ds = ({ property: r, onChange: s }) => {
|
|
|
1358
1350
|
]
|
|
1359
1351
|
}
|
|
1360
1352
|
) }),
|
|
1361
|
-
/* @__PURE__ */ e.jsx("button", { type: "button", className: "grow text-center", children: /* @__PURE__ */ e.jsx(
|
|
1353
|
+
/* @__PURE__ */ e.jsx("button", { type: "button", className: "grow text-center", children: /* @__PURE__ */ e.jsx(Se, { rounded: !0, selected: a, disabled: !h || !l, onChange: y, options: n }) })
|
|
1362
1354
|
] });
|
|
1363
1355
|
}, Ze = (r, s) => {
|
|
1364
1356
|
r = r.toLowerCase();
|
|
@@ -1367,9 +1359,10 @@ const ds = ({ property: r, onChange: s }) => {
|
|
|
1367
1359
|
return { value: "", unit: t };
|
|
1368
1360
|
const d = s.length ? new RegExp(s.join("|"), "g") : /XXXXXX/g;
|
|
1369
1361
|
t = t.replace(d, "");
|
|
1370
|
-
const
|
|
1371
|
-
return n ||
|
|
1372
|
-
}
|
|
1362
|
+
const l = r.match(d), n = l && l.length > 1, o = !b(t) && Number.isNaN(Number(t));
|
|
1363
|
+
return n || o ? { error: "Invalid value" } : l && (l[0] === "auto" || l[0] === "none") ? { value: l[0], unit: "" } : { value: t, unit: l ? l[0] : "" };
|
|
1364
|
+
};
|
|
1365
|
+
const us = (r) => {
|
|
1373
1366
|
const s = r.startsWith("-") ? "-" : "", t = r.split("-").pop();
|
|
1374
1367
|
if (["auto", "none"].includes(t))
|
|
1375
1368
|
return { value: "", unit: t };
|
|
@@ -1493,31 +1486,32 @@ const ds = ({ property: r, onChange: s }) => {
|
|
|
1493
1486
|
if (["max", "min", "fit"].includes(t))
|
|
1494
1487
|
return { value: r, unit: "class" };
|
|
1495
1488
|
if (t.includes("/")) {
|
|
1496
|
-
const [d,
|
|
1497
|
-
return { value: s + (d /
|
|
1489
|
+
const [d, l] = k(t.split("/"), (n) => parseInt(n, 10));
|
|
1490
|
+
return { value: s + (d / l * 100).toFixed(2).replace(".00", ""), unit: "%" };
|
|
1498
1491
|
}
|
|
1499
|
-
return
|
|
1500
|
-
}
|
|
1501
|
-
|
|
1492
|
+
return Tt(parseFloat(t)) ? { value: `${s + parseFloat(t) * 4}`, unit: "px" } : { value: t, unit: "class" };
|
|
1493
|
+
};
|
|
1494
|
+
const xs = (r) => {
|
|
1495
|
+
if (b(r))
|
|
1502
1496
|
return { value: "", unit: "" };
|
|
1503
1497
|
const s = r.match(/\[.*\]/g);
|
|
1504
1498
|
if (s === null)
|
|
1505
|
-
return
|
|
1506
|
-
const t = x(s, "0", "").replace(/\[|\]/g, ""), d = r.startsWith("-") ? "-" : "",
|
|
1507
|
-
return { value: `${d}${
|
|
1508
|
-
},
|
|
1499
|
+
return gs(r);
|
|
1500
|
+
const t = x(s, "0", "").replace(/\[|\]/g, ""), d = r.startsWith("-") ? "-" : "", l = ae(t.match(/\d+.\d+|\d+/g));
|
|
1501
|
+
return { value: `${d}${l}`, unit: t.replace(l, "") };
|
|
1502
|
+
}, gs = (r) => b(r) ? { value: "", unit: "" } : us(r), gt = $.createContext({
|
|
1509
1503
|
setDragData: () => {
|
|
1510
1504
|
}
|
|
1511
|
-
}),
|
|
1505
|
+
}), hs = ({
|
|
1512
1506
|
unit: r,
|
|
1513
1507
|
currentValue: s,
|
|
1514
1508
|
onDrag: t,
|
|
1515
1509
|
onDragEnd: d,
|
|
1516
|
-
onDragStart:
|
|
1510
|
+
onDragStart: l,
|
|
1517
1511
|
negative: n,
|
|
1518
|
-
cssProperty:
|
|
1512
|
+
cssProperty: o
|
|
1519
1513
|
}) => {
|
|
1520
|
-
const { setDragData: p } =
|
|
1514
|
+
const { setDragData: p } = oe(gt);
|
|
1521
1515
|
return /* @__PURE__ */ e.jsx(
|
|
1522
1516
|
"button",
|
|
1523
1517
|
{
|
|
@@ -1531,52 +1525,52 @@ const ds = ({ property: r, onChange: s }) => {
|
|
|
1531
1525
|
dragStartValue: `${s}`,
|
|
1532
1526
|
dragUnit: r,
|
|
1533
1527
|
negative: n,
|
|
1534
|
-
cssProperty:
|
|
1528
|
+
cssProperty: o
|
|
1535
1529
|
};
|
|
1536
|
-
|
|
1530
|
+
l(c), p(c);
|
|
1537
1531
|
},
|
|
1538
1532
|
color: void 0,
|
|
1539
1533
|
className: "relative z-50 ml-1 hidden h-6 cursor-row-resize rounded bg-background/70 px-2 group-hover:inline",
|
|
1540
|
-
children: /* @__PURE__ */ e.jsx(
|
|
1534
|
+
children: /* @__PURE__ */ e.jsx(Wt, {})
|
|
1541
1535
|
}
|
|
1542
1536
|
);
|
|
1543
|
-
},
|
|
1537
|
+
}, ys = ({ onSelect: r, current: s, units: t }) => /* @__PURE__ */ e.jsx("div", { "data-theme": "light", className: "-m-[7px] -mx-[13px] flex w-9 flex-col", children: t.map((d) => /* @__PURE__ */ e.jsx(
|
|
1544
1538
|
U,
|
|
1545
1539
|
{
|
|
1546
1540
|
className: "h-max rounded-none px-1 py-1 text-right text-[11px] hover:bg-blue-400",
|
|
1547
1541
|
color: s === d ? "primary" : void 0,
|
|
1548
1542
|
size: "sm",
|
|
1549
|
-
onClick: (
|
|
1550
|
-
|
|
1543
|
+
onClick: (l) => {
|
|
1544
|
+
l.stopPropagation(), r(d);
|
|
1551
1545
|
},
|
|
1552
1546
|
children: d
|
|
1553
1547
|
},
|
|
1554
1548
|
d
|
|
1555
|
-
)) }), We = 50,
|
|
1556
|
-
const [s, t] = w(!1), [d,
|
|
1557
|
-
|
|
1558
|
-
const { value: m, unit: v } =
|
|
1549
|
+
)) }), We = 50, ms = (r) => {
|
|
1550
|
+
const [s, t] = w(!1), [d, l] = w(""), { currentClass: n, onChange: o, classPrefix: p, cssProperty: i, units: c, negative: h } = r, [a, g] = w(i != null && i.toLowerCase().includes("width") ? "%" : c[0]), [y, u] = w(!1), [f, j] = w(""), [B, C] = w(!1), [I, X] = w(!1);
|
|
1551
|
+
L(() => {
|
|
1552
|
+
const { value: m, unit: v } = xs(n);
|
|
1559
1553
|
if (v === "") {
|
|
1560
|
-
|
|
1554
|
+
l(m), g(i != null && i.toLowerCase().includes("width") ? "%" : ae(c));
|
|
1561
1555
|
return;
|
|
1562
1556
|
}
|
|
1563
|
-
g(v),
|
|
1557
|
+
g(v), l(v === "class" || b(m) ? "" : m);
|
|
1564
1558
|
}, [n, i, c]);
|
|
1565
|
-
const N =
|
|
1559
|
+
const N = fe((m) => o(m), [o], We), P = fe((m) => o(m, !1), [o], We), W = V(
|
|
1566
1560
|
(m = !1) => {
|
|
1567
1561
|
const v = Ze(`${d}`, c);
|
|
1568
1562
|
if (x(v, "error", !1)) {
|
|
1569
1563
|
u(!0);
|
|
1570
1564
|
return;
|
|
1571
1565
|
}
|
|
1572
|
-
const
|
|
1573
|
-
if (
|
|
1574
|
-
N(`${p}${
|
|
1566
|
+
const T = x(v, "unit") !== "" ? x(v, "unit") : a;
|
|
1567
|
+
if (T === "auto" || T === "none") {
|
|
1568
|
+
N(`${p}${T}`);
|
|
1575
1569
|
return;
|
|
1576
1570
|
}
|
|
1577
1571
|
if (x(v, "value") === "")
|
|
1578
1572
|
return;
|
|
1579
|
-
const Q = `${x(v, "value", "").startsWith("-") ? "-" : ""}${p}[${x(v, "value", "").replace("-", "")}${
|
|
1573
|
+
const Q = `${x(v, "value", "").startsWith("-") ? "-" : ""}${p}[${x(v, "value", "").replace("-", "")}${T === "-" ? "" : T}]`;
|
|
1580
1574
|
m ? P(Q) : N(Q);
|
|
1581
1575
|
},
|
|
1582
1576
|
[N, P, d, a, p, c]
|
|
@@ -1593,7 +1587,7 @@ const ds = ({ property: r, onChange: s }) => {
|
|
|
1593
1587
|
}
|
|
1594
1588
|
if (x(v, "value") === "")
|
|
1595
1589
|
return;
|
|
1596
|
-
const
|
|
1590
|
+
const T = x(v, "unit") !== "" ? x(v, "unit") : m, Q = `${x(v, "value", "").startsWith("-") ? "-" : ""}${p}[${x(v, "value", "").replace("-", "")}${T === "-" ? "" : T}]`;
|
|
1597
1591
|
N(Q);
|
|
1598
1592
|
},
|
|
1599
1593
|
[N, d, p, c]
|
|
@@ -1602,7 +1596,7 @@ const ds = ({ property: r, onChange: s }) => {
|
|
|
1602
1596
|
/* @__PURE__ */ e.jsx("input", { className: "w-20 rounded py-1", readOnly: !0, value: n }),
|
|
1603
1597
|
/* @__PURE__ */ e.jsxs(O, { children: [
|
|
1604
1598
|
/* @__PURE__ */ e.jsx(F, { 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(He, {}) }) }),
|
|
1605
|
-
/* @__PURE__ */ e.jsx(
|
|
1599
|
+
/* @__PURE__ */ e.jsx(Y, { children: "Current value is using a Tailwind preset class." })
|
|
1606
1600
|
] })
|
|
1607
1601
|
] }) : /* @__PURE__ */ e.jsxs("div", { className: `group relative flex items-center ${B ? "z-auto" : ""}`, children: [
|
|
1608
1602
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center rounded-md border border-border", children: [
|
|
@@ -1617,10 +1611,10 @@ const ds = ({ property: r, onChange: s }) => {
|
|
|
1617
1611
|
if (m.keyCode !== 38 && m.keyCode !== 40)
|
|
1618
1612
|
return;
|
|
1619
1613
|
m.preventDefault(), X(!0);
|
|
1620
|
-
const v =
|
|
1621
|
-
let
|
|
1622
|
-
m.keyCode === 38 && (
|
|
1623
|
-
const Z = `${
|
|
1614
|
+
const v = St(m.target.value);
|
|
1615
|
+
let T = qe(v) ? 0 : v;
|
|
1616
|
+
m.keyCode === 38 && (T += 1), m.keyCode === 40 && (T -= 1);
|
|
1617
|
+
const Z = `${T}`, yt = `${Z.startsWith("-") ? "-" : ""}${p}[${Z.replace("-", "")}${a === "-" ? "" : a}]`;
|
|
1624
1618
|
P(yt);
|
|
1625
1619
|
},
|
|
1626
1620
|
onKeyUp: (m) => {
|
|
@@ -1628,13 +1622,13 @@ const ds = ({ property: r, onChange: s }) => {
|
|
|
1628
1622
|
},
|
|
1629
1623
|
onBlur: () => W(),
|
|
1630
1624
|
onChange: (m) => {
|
|
1631
|
-
u(!1),
|
|
1625
|
+
u(!1), l(m.target.value);
|
|
1632
1626
|
},
|
|
1633
1627
|
onClick: (m) => {
|
|
1634
1628
|
var v;
|
|
1635
1629
|
(v = m == null ? void 0 : m.target) == null || v.select(), t(!1);
|
|
1636
1630
|
},
|
|
1637
|
-
value: B ?
|
|
1631
|
+
value: B ? f : d,
|
|
1638
1632
|
className: "h-6 w-14 rounded rounded-r-none bg-background pl-2 text-sm focus-visible:outline-0 ".concat(
|
|
1639
1633
|
" ",
|
|
1640
1634
|
y ? "border-red-500 text-red-500" : "border-foreground/20"
|
|
@@ -1650,12 +1644,12 @@ const ds = ({ property: r, onChange: s }) => {
|
|
|
1650
1644
|
className: "flex h-6 cursor-pointer items-center gap-x-1 rounded rounded-l-none bg-background p-px px-1 text-[11px] uppercase",
|
|
1651
1645
|
children: [
|
|
1652
1646
|
/* @__PURE__ */ e.jsx("span", { className: `inline-block ${c.length === 1 ? "px-2 font-semibold" : ""}`, children: a }),
|
|
1653
|
-
c.length > 1 ? /* @__PURE__ */ e.jsx(
|
|
1647
|
+
c.length > 1 ? /* @__PURE__ */ e.jsx(Ut, {}) : null
|
|
1654
1648
|
]
|
|
1655
1649
|
}
|
|
1656
1650
|
) }),
|
|
1657
|
-
/* @__PURE__ */ e.jsx(
|
|
1658
|
-
|
|
1651
|
+
/* @__PURE__ */ e.jsx(jr, { children: /* @__PURE__ */ e.jsx(Y, { className: "bg-background", children: /* @__PURE__ */ e.jsx(
|
|
1652
|
+
ys,
|
|
1659
1653
|
{
|
|
1660
1654
|
units: c,
|
|
1661
1655
|
current: a,
|
|
@@ -1667,17 +1661,17 @@ const ds = ({ property: r, onChange: s }) => {
|
|
|
1667
1661
|
] })
|
|
1668
1662
|
] }),
|
|
1669
1663
|
["none", "auto"].indexOf(a) !== -1 || B ? null : /* @__PURE__ */ e.jsx(
|
|
1670
|
-
|
|
1664
|
+
hs,
|
|
1671
1665
|
{
|
|
1672
1666
|
onDragStart: () => C(!0),
|
|
1673
1667
|
onDragEnd: (m) => {
|
|
1674
|
-
if (j(() => ""), C(!1),
|
|
1668
|
+
if (j(() => ""), C(!1), b(m))
|
|
1675
1669
|
return;
|
|
1676
1670
|
const v = `${m}`, Z = `${v.startsWith("-") ? "-" : ""}${p}[${v.replace("-", "")}${a === "-" ? "" : a}]`;
|
|
1677
1671
|
N(Z);
|
|
1678
1672
|
},
|
|
1679
1673
|
onDrag: (m) => {
|
|
1680
|
-
if (
|
|
1674
|
+
if (b(m))
|
|
1681
1675
|
return;
|
|
1682
1676
|
j(m);
|
|
1683
1677
|
const v = `${m}`, Z = `${v.startsWith("-") ? "-" : ""}${p}[${v.replace("-", "")}${a === "-" ? "" : a}]`;
|
|
@@ -1703,7 +1697,7 @@ const ds = ({ property: r, onChange: s }) => {
|
|
|
1703
1697
|
"2xl": 5
|
|
1704
1698
|
};
|
|
1705
1699
|
return t[x(r, "mq", "xs")] <= t[s];
|
|
1706
|
-
},
|
|
1700
|
+
}, fs = {
|
|
1707
1701
|
width: "w-",
|
|
1708
1702
|
height: "h-",
|
|
1709
1703
|
minWidth: "min-w-",
|
|
@@ -1776,20 +1770,20 @@ const ds = ({ property: r, onChange: s }) => {
|
|
|
1776
1770
|
lg: "1024px",
|
|
1777
1771
|
xl: "1280px",
|
|
1778
1772
|
"2xl": "1536px"
|
|
1779
|
-
},
|
|
1780
|
-
const { t: s } =
|
|
1781
|
-
}, units:
|
|
1773
|
+
}, vs = (r) => `${r.toUpperCase()} ${Ue[r] ? `(${Ue[r]} & up)` : ""}`, Ie = (r) => {
|
|
1774
|
+
const { t: s } = z(), { type: t = "icons", label: d, property: l, onEmitChange: n = () => {
|
|
1775
|
+
}, units: o, negative: p = !1 } = r, [i] = wr(), [c] = it(), [, h] = Me(), a = ie(l), g = De(), y = ot(), [u] = at(), f = _(() => x(a, "fullCls", ""), [a]), j = V(
|
|
1782
1776
|
(P, W = !0) => {
|
|
1783
|
-
const J = { dark: i, mq: h, mod: c, cls: P, property:
|
|
1777
|
+
const J = { dark: i, mq: h, mod: c, cls: P, property: l, fullCls: "" };
|
|
1784
1778
|
(i || c !== "") && (J.mq = "xs");
|
|
1785
|
-
const m =
|
|
1779
|
+
const m = Kr(J);
|
|
1786
1780
|
g(u, [m], W);
|
|
1787
1781
|
},
|
|
1788
|
-
[u, i, h, c,
|
|
1782
|
+
[u, i, h, c, l, g]
|
|
1789
1783
|
), B = V(() => {
|
|
1790
|
-
y(u, [
|
|
1791
|
-
}, [u,
|
|
1792
|
-
|
|
1784
|
+
y(u, [f]);
|
|
1785
|
+
}, [u, f, y]), C = _(() => bs(a, h), [a, h]);
|
|
1786
|
+
L(() => {
|
|
1793
1787
|
n(C, a);
|
|
1794
1788
|
}, [C, n, a]);
|
|
1795
1789
|
const [, , I] = Me(), X = V(
|
|
@@ -1805,27 +1799,27 @@ const ds = ({ property: r, onChange: s }) => {
|
|
|
1805
1799
|
},
|
|
1806
1800
|
[I]
|
|
1807
1801
|
), N = x(a, "dark", null) === i && x(a, "mod", null) === c && x(a, "mq", null) === h;
|
|
1808
|
-
return /* @__PURE__ */ e.jsx(
|
|
1802
|
+
return /* @__PURE__ */ e.jsx(ns, { canChange: C, canReset: a && N, children: /* @__PURE__ */ e.jsxs("div", { className: "group flex flex-row items-center py-2 first:pt-0 last:pb-0", children: [
|
|
1809
1803
|
/* @__PURE__ */ e.jsx("div", { className: "relative w-[70px] truncate text-xs text-foreground", children: /* @__PURE__ */ e.jsx("span", { className: `text-[11px] ${a && !N ? "text-foreground" : ""}`, children: s(d) }) }),
|
|
1810
1804
|
/* @__PURE__ */ e.jsxs("div", { className: "flex flex-row items-center", children: [
|
|
1811
1805
|
/* @__PURE__ */ e.jsxs("div", { className: "w-[150px]", children: [
|
|
1812
1806
|
t === "arbitrary" ? /* @__PURE__ */ e.jsx(
|
|
1813
|
-
|
|
1807
|
+
ms,
|
|
1814
1808
|
{
|
|
1815
1809
|
currentClass: x(a, "cls", ""),
|
|
1816
|
-
classPrefix: x(
|
|
1817
|
-
units:
|
|
1810
|
+
classPrefix: x(fs, l, ""),
|
|
1811
|
+
units: o || [],
|
|
1818
1812
|
onChange: j,
|
|
1819
1813
|
negative: p,
|
|
1820
|
-
cssProperty:
|
|
1814
|
+
cssProperty: l
|
|
1821
1815
|
}
|
|
1822
1816
|
) : null,
|
|
1823
|
-
t === "icons" && /* @__PURE__ */ e.jsx(
|
|
1824
|
-
t === "range" && /* @__PURE__ */ e.jsx(
|
|
1825
|
-
t === "color" && /* @__PURE__ */ e.jsx(
|
|
1826
|
-
t === "dropdown" && /* @__PURE__ */ e.jsx(xt, { label: d, property:
|
|
1817
|
+
t === "icons" && /* @__PURE__ */ e.jsx(ds, { property: l, onChange: j }),
|
|
1818
|
+
t === "range" && /* @__PURE__ */ e.jsx(is, { property: l, onChange: j }),
|
|
1819
|
+
t === "color" && /* @__PURE__ */ e.jsx(ps, { property: l, onChange: j }),
|
|
1820
|
+
t === "dropdown" && /* @__PURE__ */ e.jsx(xt, { label: d, property: l, onChange: j })
|
|
1827
1821
|
] }),
|
|
1828
|
-
/* @__PURE__ */ e.jsx("div", { className: `w-[30px] cursor-pointer ${
|
|
1822
|
+
/* @__PURE__ */ e.jsx("div", { className: `w-[30px] cursor-pointer ${f ? "visible" : "invisible"}`, children: N ? /* @__PURE__ */ e.jsx("button", { type: "button", onClick: () => B(), title: "Reset", className: "flex px-1.5 text-xs", children: /* @__PURE__ */ e.jsx(Kt, { className: "h-5 w-5 text-blue-500 hover:opacity-80" }) }) : C && a ? /* @__PURE__ */ e.jsxs(O, { delayDuration: 100, children: [
|
|
1829
1823
|
/* @__PURE__ */ e.jsx(F, { asChild: !0, children: /* @__PURE__ */ e.jsx(
|
|
1830
1824
|
"button",
|
|
1831
1825
|
{
|
|
@@ -1834,10 +1828,10 @@ const ds = ({ property: r, onChange: s }) => {
|
|
|
1834
1828
|
children: /* @__PURE__ */ e.jsx(He, {})
|
|
1835
1829
|
}
|
|
1836
1830
|
) }),
|
|
1837
|
-
/* @__PURE__ */ e.jsx(
|
|
1831
|
+
/* @__PURE__ */ e.jsx(Y, { children: /* @__PURE__ */ e.jsx("div", { className: "text-right", children: /* @__PURE__ */ e.jsxs("div", { children: [
|
|
1838
1832
|
"Current style is set at ",
|
|
1839
1833
|
/* @__PURE__ */ e.jsxs("span", { className: "font-bold", children: [
|
|
1840
|
-
|
|
1834
|
+
vs(x(a, "mq")),
|
|
1841
1835
|
i && !a.dark ? "(Light mode)" : ""
|
|
1842
1836
|
] }),
|
|
1843
1837
|
/* @__PURE__ */ e.jsx("br", {}),
|
|
@@ -1857,16 +1851,16 @@ const ds = ({ property: r, onChange: s }) => {
|
|
|
1857
1851
|
] }) : null })
|
|
1858
1852
|
] })
|
|
1859
1853
|
] }) });
|
|
1860
|
-
},
|
|
1854
|
+
}, js = ["px", "%", "em", "rem", "ch", "vh", "vw"], ht = ({
|
|
1861
1855
|
label: r,
|
|
1862
1856
|
options: s,
|
|
1863
1857
|
borderB: t = !1,
|
|
1864
1858
|
borderT: d = !1,
|
|
1865
|
-
type:
|
|
1866
|
-
units: n =
|
|
1867
|
-
negative:
|
|
1859
|
+
type: l = "arbitrary",
|
|
1860
|
+
units: n = js,
|
|
1861
|
+
negative: o = !1
|
|
1868
1862
|
}) => {
|
|
1869
|
-
const { t: p } =
|
|
1863
|
+
const { t: p } = z(), [i, c] = w(s[0].key), h = xe(), a = V((g) => k(h, "property").includes(g), [h]);
|
|
1870
1864
|
return /* @__PURE__ */ e.jsxs(
|
|
1871
1865
|
"div",
|
|
1872
1866
|
{
|
|
@@ -1890,127 +1884,127 @@ const ds = ({ property: r, onChange: s }) => {
|
|
|
1890
1884
|
]
|
|
1891
1885
|
}
|
|
1892
1886
|
) }),
|
|
1893
|
-
/* @__PURE__ */ e.jsx(
|
|
1887
|
+
/* @__PURE__ */ e.jsx(Y, { children: E(le(g)) })
|
|
1894
1888
|
] }) }))
|
|
1895
1889
|
) })
|
|
1896
1890
|
] }),
|
|
1897
1891
|
/* @__PURE__ */ e.jsx("div", { className: "mt-0 flex items-center", children: /* @__PURE__ */ e.jsx(
|
|
1898
1892
|
Ie,
|
|
1899
1893
|
{
|
|
1900
|
-
type:
|
|
1894
|
+
type: l,
|
|
1901
1895
|
units: [...n],
|
|
1902
1896
|
label: "",
|
|
1903
1897
|
property: i,
|
|
1904
|
-
negative:
|
|
1898
|
+
negative: o
|
|
1905
1899
|
}
|
|
1906
1900
|
) })
|
|
1907
1901
|
]
|
|
1908
1902
|
}
|
|
1909
1903
|
);
|
|
1910
|
-
},
|
|
1911
|
-
const { t } =
|
|
1904
|
+
}, ws = ({ heading: r, items: s }) => {
|
|
1905
|
+
const { t } = z(), d = xe(), l = _(() => {
|
|
1912
1906
|
const n = (i) => q(
|
|
1913
1907
|
i.map((c) => c.styleType === "multiple" ? k(c.options, "key") : c.property)
|
|
1914
|
-
),
|
|
1908
|
+
), o = q(
|
|
1915
1909
|
s.map((i) => i.styleType === "accordion" ? n(i.items) : i.styleType === "multiple" ? k(i.options, "key") : i.property)
|
|
1916
1910
|
), p = k(d, "property");
|
|
1917
|
-
return Je(
|
|
1911
|
+
return Je(o, p).length > 0;
|
|
1918
1912
|
}, [d, s]);
|
|
1919
1913
|
return /* @__PURE__ */ e.jsxs("details", { children: [
|
|
1920
1914
|
/* @__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: [
|
|
1921
1915
|
t(r),
|
|
1922
|
-
|
|
1916
|
+
l ? /* @__PURE__ */ e.jsx(
|
|
1923
1917
|
"span",
|
|
1924
1918
|
{
|
|
1925
|
-
className: `ml-1 mr-2 inline-block h-[8px] w-[8px] rounded-full ${
|
|
1919
|
+
className: `ml-1 mr-2 inline-block h-[8px] w-[8px] rounded-full ${l ? "bg-blue-500" : "bg-gray-300"}`
|
|
1926
1920
|
}
|
|
1927
1921
|
) : null
|
|
1928
1922
|
] }) }),
|
|
1929
1923
|
/* @__PURE__ */ e.jsx("div", { className: "p-2", children: s.map((n) => n.styleType === "multiple" ? /* @__PURE__ */ e.jsx(ht, { ...n }, n.label) : /* @__PURE__ */ e.jsx(Ie, { ...n }, n.label)) })
|
|
1930
1924
|
] });
|
|
1931
|
-
},
|
|
1932
|
-
const { t: s } =
|
|
1933
|
-
(
|
|
1925
|
+
}, Cs = Ke({}), be = ({ section: r }) => {
|
|
1926
|
+
const { t: s } = z(), t = xe(), d = V(
|
|
1927
|
+
(o = []) => {
|
|
1934
1928
|
const p = {};
|
|
1935
1929
|
for (let c = 0; c < t.length; c++)
|
|
1936
1930
|
p[t[c].property] = t[c].cls;
|
|
1937
1931
|
let i = !0;
|
|
1938
|
-
for (const c in
|
|
1939
|
-
if (!ce(p, c) || p[c] !==
|
|
1932
|
+
for (const c in o)
|
|
1933
|
+
if (!ce(p, c) || p[c] !== o[c]) {
|
|
1940
1934
|
i = !1;
|
|
1941
1935
|
break;
|
|
1942
1936
|
}
|
|
1943
1937
|
return i;
|
|
1944
1938
|
},
|
|
1945
1939
|
[t]
|
|
1946
|
-
),
|
|
1940
|
+
), l = _(() => {
|
|
1947
1941
|
if (t.length > 0 && r.heading === "classes.heading")
|
|
1948
1942
|
return !0;
|
|
1949
|
-
const
|
|
1943
|
+
const o = (c) => q(
|
|
1950
1944
|
c.map((h) => h.styleType === "multiple" ? q(k(h.options, "key")) : h.property)
|
|
1951
1945
|
), p = q(
|
|
1952
|
-
r.items.map((c) => c.styleType === "accordion" ?
|
|
1946
|
+
r.items.map((c) => c.styleType === "accordion" ? o(c.items) : c.styleType === "multiple" ? q(k(c.options, "key")) : c.property)
|
|
1953
1947
|
), i = k(t, "property");
|
|
1954
1948
|
return Je(p, i).length > 0;
|
|
1955
1949
|
}, [t, r.heading, r.items]), n = _(() => ({}), []);
|
|
1956
|
-
return /* @__PURE__ */ e.jsx(
|
|
1957
|
-
/* @__PURE__ */ e.jsx(
|
|
1958
|
-
/* @__PURE__ */ e.jsx("div", { className: `h-[8px] w-[8px] rounded-full ${
|
|
1950
|
+
return /* @__PURE__ */ e.jsx(Cs.Provider, { value: n, children: /* @__PURE__ */ e.jsxs(Ce, { value: r.heading, children: [
|
|
1951
|
+
/* @__PURE__ */ e.jsx(ke, { className: "px-3 py-2 text-xs hover:no-underline", children: /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-x-2", children: [
|
|
1952
|
+
/* @__PURE__ */ e.jsx("div", { className: `h-[8px] w-[8px] rounded-full ${l ? "bg-blue-500" : "bg-gray-300"}` }),
|
|
1959
1953
|
s(r.heading)
|
|
1960
1954
|
] }) }),
|
|
1961
|
-
/* @__PURE__ */ e.jsx(
|
|
1962
|
-
r.items.map((
|
|
1955
|
+
/* @__PURE__ */ e.jsx(Ne, { className: "bg-gray-100 px-3.5 py-2", children: $.Children.toArray(
|
|
1956
|
+
r.items.map((o) => ce(o, "component") ? $.createElement(o.component, { key: o.label }) : ce(o, "styleType") ? o.styleType === "multiple" ? /* @__PURE__ */ e.jsx(ht, { ...o }, o.label) : o.styleType === "accordion" && d(o == null ? void 0 : o.conditions) ? /* @__PURE__ */ e.jsx(ws, { ...o }, o.label) : null : /* @__PURE__ */ e.jsx(Ie, { ...o }, o.label))
|
|
1963
1957
|
) })
|
|
1964
1958
|
] }) });
|
|
1965
|
-
},
|
|
1966
|
-
const r = K(), [s] = ue(), { t } =
|
|
1967
|
-
if (
|
|
1959
|
+
}, ks = () => {
|
|
1960
|
+
const r = K(), [s] = ue(), { t } = z(), d = Lr(), l = De(), n = Pe(r._type), o = x(ae(s), "prop"), p = x(n.props, `${o}.presets`, {});
|
|
1961
|
+
if (b(d) && (!ce(n, "props") || b(p)))
|
|
1968
1962
|
return null;
|
|
1969
1963
|
const i = (c) => {
|
|
1970
1964
|
const h = c.trim().toLowerCase().replace(/ +(?= )/g, "").split(" ");
|
|
1971
|
-
|
|
1965
|
+
l([r._id], h, !0);
|
|
1972
1966
|
};
|
|
1973
|
-
return /* @__PURE__ */ e.jsx("div", { className: "h-10", children: /* @__PURE__ */ e.jsxs(
|
|
1974
|
-
/* @__PURE__ */ e.jsx(
|
|
1967
|
+
return /* @__PURE__ */ e.jsx("div", { className: "h-10", children: /* @__PURE__ */ e.jsxs(Cr, { children: [
|
|
1968
|
+
/* @__PURE__ */ e.jsx(kr, { asChild: !0, children: /* @__PURE__ */ e.jsx("div", { className: "px-4", children: /* @__PURE__ */ e.jsxs(U, { variant: "default", className: "w-full", size: "sm", children: [
|
|
1975
1969
|
t("Apply Presets"),
|
|
1976
1970
|
/* @__PURE__ */ e.jsx(Gt, {})
|
|
1977
1971
|
] }) }) }),
|
|
1978
|
-
/* @__PURE__ */ e.jsx(
|
|
1979
|
-
|
|
1980
|
-
/* @__PURE__ */ e.jsxs(
|
|
1972
|
+
/* @__PURE__ */ e.jsx(Nr, { className: "max-h-80 w-56", children: /* @__PURE__ */ e.jsxs(Be, { className: "no-scrollbar h-full", children: [
|
|
1973
|
+
b(p) ? null : /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
1974
|
+
/* @__PURE__ */ e.jsxs(Ee, { children: [
|
|
1981
1975
|
n.type,
|
|
1982
1976
|
" ",
|
|
1983
1977
|
t("presets")
|
|
1984
1978
|
] }),
|
|
1985
|
-
/* @__PURE__ */ e.jsx(
|
|
1979
|
+
/* @__PURE__ */ e.jsx(Le, {}),
|
|
1986
1980
|
/* @__PURE__ */ e.jsx(Oe, { children: je(p).map((c) => /* @__PURE__ */ e.jsxs(Fe, { className: "group text-xs", onClick: () => i(p[c]), children: [
|
|
1987
|
-
we(
|
|
1988
|
-
/* @__PURE__ */ e.jsx(
|
|
1981
|
+
we(E(t(c))),
|
|
1982
|
+
/* @__PURE__ */ e.jsx(Ye, { className: "invisible hover:font-bold hover:text-blue-600 group-hover:visible", children: t("apply") })
|
|
1989
1983
|
] })) })
|
|
1990
1984
|
] }),
|
|
1991
|
-
|
|
1992
|
-
/* @__PURE__ */ e.jsx(
|
|
1993
|
-
/* @__PURE__ */ e.jsx(
|
|
1985
|
+
b(d) ? null : /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
1986
|
+
/* @__PURE__ */ e.jsx(Ee, { children: t("Global presets") }),
|
|
1987
|
+
/* @__PURE__ */ e.jsx(Le, {}),
|
|
1994
1988
|
/* @__PURE__ */ e.jsx(Oe, { children: je(d).map((c) => /* @__PURE__ */ e.jsxs(Fe, { className: "group text-xs", onClick: () => i(d[c]), children: [
|
|
1995
|
-
we(
|
|
1996
|
-
/* @__PURE__ */ e.jsx(
|
|
1989
|
+
we(E(t(c))),
|
|
1990
|
+
/* @__PURE__ */ e.jsx(Ye, { className: "invisible hover:font-bold hover:text-blue-600 group-hover:visible", children: t("apply") })
|
|
1997
1991
|
] })) })
|
|
1998
1992
|
] })
|
|
1999
1993
|
] }) })
|
|
2000
1994
|
] }) });
|
|
2001
1995
|
};
|
|
2002
|
-
function
|
|
2003
|
-
const [r, s] =
|
|
2004
|
-
return
|
|
1996
|
+
function Ns() {
|
|
1997
|
+
const [r, s] = it(), { flexChild: t, gridChild: d } = _r(), { t: l } = z(), [n] = ue();
|
|
1998
|
+
return b(n) ? /* @__PURE__ */ e.jsx("div", { className: "p-4 text-center", children: /* @__PURE__ */ e.jsxs("div", { className: "space-y-4 rounded-xl p-4", children: [
|
|
2005
1999
|
/* @__PURE__ */ e.jsx(tt, { className: "mx-auto text-3xl" }),
|
|
2006
|
-
/* @__PURE__ */ e.jsx("h1", { children:
|
|
2000
|
+
/* @__PURE__ */ e.jsx("h1", { children: l("no_styling_block_selected") })
|
|
2007
2001
|
] }) }) : /* @__PURE__ */ e.jsxs("div", { className: "flex h-full flex-col", children: [
|
|
2008
|
-
/* @__PURE__ */ e.jsx(
|
|
2002
|
+
/* @__PURE__ */ e.jsx(ks, {}),
|
|
2009
2003
|
/* @__PURE__ */ e.jsx("div", { className: "flex h-12 flex-col space-x-4 px-4 py-1", children: /* @__PURE__ */ e.jsxs("div", { className: "flex items-center justify-end gap-x-1.5", children: [
|
|
2010
|
-
/* @__PURE__ */ e.jsx(
|
|
2011
|
-
/* @__PURE__ */ e.jsxs(
|
|
2012
|
-
/* @__PURE__ */ e.jsx(
|
|
2013
|
-
/* @__PURE__ */ e.jsxs(
|
|
2004
|
+
/* @__PURE__ */ e.jsx(nt, { htmlFor: "", className: "flex gap-x-1.5 text-xs italic", children: "State" }),
|
|
2005
|
+
/* @__PURE__ */ e.jsxs(Tr, { defaultValue: r, onValueChange: (o) => s(o), children: [
|
|
2006
|
+
/* @__PURE__ */ e.jsx(Sr, { className: "h-auto w-fit p-1 px-3", children: /* @__PURE__ */ e.jsx(Rr, { placeholder: "State" }) }),
|
|
2007
|
+
/* @__PURE__ */ e.jsxs(Vr, { children: [
|
|
2014
2008
|
/* @__PURE__ */ e.jsx(H, { value: "", children: "Normal" }),
|
|
2015
2009
|
/* @__PURE__ */ e.jsx(H, { value: "hover", children: "Hover" }),
|
|
2016
2010
|
/* @__PURE__ */ e.jsx(H, { value: "active", children: "Active" }),
|
|
@@ -2027,23 +2021,23 @@ function _s() {
|
|
|
2027
2021
|
] })
|
|
2028
2022
|
] }) }),
|
|
2029
2023
|
r !== "" ? /* @__PURE__ */ e.jsxs("div", { className: "m-1 flex items-center space-x-1 rounded border border-orange-500 bg-orange-200 p-px px-2 text-xs text-orange-900", children: [
|
|
2030
|
-
/* @__PURE__ */ e.jsx(
|
|
2031
|
-
/* @__PURE__ */ e.jsx("span", { children:
|
|
2024
|
+
/* @__PURE__ */ e.jsx(Ar, { className: "w-3" }),
|
|
2025
|
+
/* @__PURE__ */ e.jsx("span", { children: l(`Styles will be applied for (:${r}) state`) })
|
|
2032
2026
|
] }) : null,
|
|
2033
|
-
/* @__PURE__ */ e.jsx(
|
|
2034
|
-
t && /* @__PURE__ */ e.jsx(
|
|
2035
|
-
d ? /* @__PURE__ */ e.jsx(
|
|
2036
|
-
|
|
2027
|
+
/* @__PURE__ */ e.jsx(Be, { className: "no-scrollbar -mx-1 max-h-full flex-1 overflow-x-hidden overflow-y-hidden border-t border-border", children: /* @__PURE__ */ e.jsxs(lt, { defaultValue: ["Layout"], type: "multiple", className: "w-full", children: [
|
|
2028
|
+
t && /* @__PURE__ */ e.jsx(be, { section: ls }),
|
|
2029
|
+
d ? /* @__PURE__ */ e.jsx(be, { section: os }) : null,
|
|
2030
|
+
as.map((o) => /* @__PURE__ */ e.jsx(be, { section: o }, o.heading))
|
|
2037
2031
|
] }) })
|
|
2038
2032
|
] });
|
|
2039
2033
|
}
|
|
2040
|
-
const
|
|
2041
|
-
const { t: s } =
|
|
2042
|
-
|
|
2034
|
+
const _s = ({ onAdd: r }) => {
|
|
2035
|
+
const { t: s } = z(), [t, d] = w({ key: "", value: "" }), l = () => {
|
|
2036
|
+
b(t.key) || (r({ ...t, key: Vt(t.key) }), d({ key: "", value: "" }));
|
|
2043
2037
|
};
|
|
2044
2038
|
return /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col gap-1 border-gray-200 px-1", children: [
|
|
2045
2039
|
/* @__PURE__ */ e.jsx(
|
|
2046
|
-
|
|
2040
|
+
_e,
|
|
2047
2041
|
{
|
|
2048
2042
|
name: "key",
|
|
2049
2043
|
onChange: (n) => d({ ...t, key: n.target.value }),
|
|
@@ -2052,12 +2046,12 @@ const Ss = ({ onAdd: r }) => {
|
|
|
2052
2046
|
autoComplete: "off",
|
|
2053
2047
|
autoCapitalize: "off",
|
|
2054
2048
|
onKeyDown: (n) => {
|
|
2055
|
-
n.key === "Enter" && (n.preventDefault(),
|
|
2049
|
+
n.key === "Enter" && (n.preventDefault(), b(t.key) || l());
|
|
2056
2050
|
}
|
|
2057
2051
|
}
|
|
2058
2052
|
),
|
|
2059
2053
|
/* @__PURE__ */ e.jsx("div", { className: "flex items-center gap-x-1.5", children: /* @__PURE__ */ e.jsx(
|
|
2060
|
-
|
|
2054
|
+
_e,
|
|
2061
2055
|
{
|
|
2062
2056
|
name: "value",
|
|
2063
2057
|
onChange: (n) => d({ ...t, value: n.target.value }),
|
|
@@ -2066,26 +2060,26 @@ const Ss = ({ onAdd: r }) => {
|
|
|
2066
2060
|
autoComplete: "off",
|
|
2067
2061
|
autoCapitalize: "off",
|
|
2068
2062
|
onKeyDown: (n) => {
|
|
2069
|
-
n.key === "Enter" && (n.preventDefault(),
|
|
2063
|
+
n.key === "Enter" && (n.preventDefault(), b(t.key) || l());
|
|
2070
2064
|
}
|
|
2071
2065
|
}
|
|
2072
2066
|
) }),
|
|
2073
2067
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-x-2", children: [
|
|
2074
|
-
/* @__PURE__ */ e.jsxs(U, { disabled:
|
|
2068
|
+
/* @__PURE__ */ e.jsxs(U, { disabled: b(t.key), onClick: l, size: "sm", className: "flex items-center", children: [
|
|
2075
2069
|
/* @__PURE__ */ e.jsxs("span", { children: [
|
|
2076
2070
|
s("Add"),
|
|
2077
2071
|
" "
|
|
2078
2072
|
] }),
|
|
2079
2073
|
/* @__PURE__ */ e.jsx(Ve, {})
|
|
2080
2074
|
] }),
|
|
2081
|
-
|
|
2075
|
+
b(t.key) ? null : /* @__PURE__ */ e.jsx(U, { variant: "ghost", onClick: () => d({ key: "", value: "" }), children: s("Cancel") })
|
|
2082
2076
|
] })
|
|
2083
2077
|
] });
|
|
2084
2078
|
}, Ts = () => {
|
|
2085
|
-
const r = K(), [s, t] = w([]), [d] = ue(),
|
|
2079
|
+
const r = K(), [s, t] = w([]), [d] = ue(), l = rt(), n = st(), { t: o } = z(), p = `${x(d, "0.prop")}_attrs`;
|
|
2086
2080
|
de.useEffect(() => {
|
|
2087
2081
|
const a = k(x(r, p), (g, y) => ({ key: y, value: g }));
|
|
2088
|
-
|
|
2082
|
+
b(a) ? t([]) : t(a);
|
|
2089
2083
|
}, [x(r, p)]);
|
|
2090
2084
|
const i = (a) => {
|
|
2091
2085
|
const g = ve(s, (y, u) => a !== u);
|
|
@@ -2097,14 +2091,14 @@ const Ss = ({ onAdd: r }) => {
|
|
|
2097
2091
|
(a = []) => {
|
|
2098
2092
|
const g = {};
|
|
2099
2093
|
Re(a, (y) => {
|
|
2100
|
-
|
|
2094
|
+
b(y.key) || Ge(g, y.key, y.value);
|
|
2101
2095
|
}), n([x(r, "_id")], { [p]: g });
|
|
2102
2096
|
},
|
|
2103
|
-
[r,
|
|
2097
|
+
[r, l, p]
|
|
2104
2098
|
);
|
|
2105
2099
|
return /* @__PURE__ */ e.jsx("div", { className: "px-2", children: /* @__PURE__ */ e.jsx("div", { className: "no-scrollbar flex min-h-max flex-col gap-y-2 overflow-y-auto", children: /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col", children: [
|
|
2106
2100
|
/* @__PURE__ */ e.jsx("div", { children: /* @__PURE__ */ e.jsxs("ul", { className: "overflow-hidden rounded-md bg-gray-100 p-2 text-xs text-gray-700", children: [
|
|
2107
|
-
|
|
2101
|
+
b(s) ? /* @__PURE__ */ e.jsx("li", { className: "flex h-16 items-center justify-center", children: /* @__PURE__ */ e.jsx("p", { children: o("No custom attributes added yet") }) }) : /* @__PURE__ */ e.jsx("li", { children: /* @__PURE__ */ e.jsx("span", { className: "font-bold", children: o("Custom attributes") }) }),
|
|
2108
2102
|
de.Children.toArray(
|
|
2109
2103
|
k(s, (a) => /* @__PURE__ */ e.jsxs("li", { className: "group flex max-w-full items-center justify-between", children: [
|
|
2110
2104
|
/* @__PURE__ */ e.jsxs(O, { delayDuration: 1e3, children: [
|
|
@@ -2115,14 +2109,14 @@ const Ss = ({ onAdd: r }) => {
|
|
|
2115
2109
|
" ",
|
|
2116
2110
|
a.value
|
|
2117
2111
|
] }) }),
|
|
2118
|
-
/* @__PURE__ */ e.jsxs(
|
|
2112
|
+
/* @__PURE__ */ e.jsxs(Y, { className: "max-w-[200px]", children: [
|
|
2119
2113
|
/* @__PURE__ */ e.jsxs("div", { children: [
|
|
2120
|
-
|
|
2114
|
+
o("Name"),
|
|
2121
2115
|
": ",
|
|
2122
2116
|
a.key
|
|
2123
2117
|
] }),
|
|
2124
2118
|
/* @__PURE__ */ e.jsxs("div", { children: [
|
|
2125
|
-
|
|
2119
|
+
o("Value"),
|
|
2126
2120
|
": ",
|
|
2127
2121
|
a.value
|
|
2128
2122
|
] })
|
|
@@ -2134,18 +2128,18 @@ const Ss = ({ onAdd: r }) => {
|
|
|
2134
2128
|
{
|
|
2135
2129
|
className: "invisible group-hover:visible",
|
|
2136
2130
|
onClick: () => i(s.indexOf(a)),
|
|
2137
|
-
children: /* @__PURE__ */ e.jsx(
|
|
2131
|
+
children: /* @__PURE__ */ e.jsx(Mr, { className: "w-4 text-gray-500" })
|
|
2138
2132
|
}
|
|
2139
2133
|
) }),
|
|
2140
|
-
/* @__PURE__ */ e.jsx(
|
|
2134
|
+
/* @__PURE__ */ e.jsx(Y, { className: "max-w-[200px]", children: o("Remove attribute") })
|
|
2141
2135
|
] })
|
|
2142
2136
|
] }))
|
|
2143
2137
|
)
|
|
2144
2138
|
] }) }),
|
|
2145
2139
|
/* @__PURE__ */ e.jsx("div", { className: "py-2" }),
|
|
2146
|
-
/* @__PURE__ */ e.jsx(
|
|
2140
|
+
/* @__PURE__ */ e.jsx(_s, { onAdd: (a) => c(a) })
|
|
2147
2141
|
] }) }) });
|
|
2148
|
-
},
|
|
2142
|
+
}, Ss = {
|
|
2149
2143
|
px: 1,
|
|
2150
2144
|
"%": 1,
|
|
2151
2145
|
em: 100,
|
|
@@ -2156,8 +2150,8 @@ const Ss = ({ onAdd: r }) => {
|
|
|
2156
2150
|
"-": 1,
|
|
2157
2151
|
deg: 1,
|
|
2158
2152
|
ms: 0.1
|
|
2159
|
-
},
|
|
2160
|
-
const r = K(), { t: s } =
|
|
2153
|
+
}, _l = () => {
|
|
2154
|
+
const r = K(), { t: s } = z(), [t, d] = $.useState(""), [l, n] = $.useState({
|
|
2161
2155
|
onDrag: (i) => i,
|
|
2162
2156
|
onDragEnd: (i) => i,
|
|
2163
2157
|
dragStartY: 0,
|
|
@@ -2166,20 +2160,20 @@ const Ss = ({ onAdd: r }) => {
|
|
|
2166
2160
|
dragUnit: "",
|
|
2167
2161
|
negative: !1,
|
|
2168
2162
|
cssProperty: ""
|
|
2169
|
-
}),
|
|
2163
|
+
}), o = fe(
|
|
2170
2164
|
(i) => {
|
|
2171
|
-
const c = !x(
|
|
2172
|
-
let a = parseFloat(
|
|
2165
|
+
const c = !x(l, "negative", !1), h = x(l, "cssProperty", "");
|
|
2166
|
+
let a = parseFloat(l.dragStartValue);
|
|
2173
2167
|
a = qe(a) ? 0 : a;
|
|
2174
|
-
let g =
|
|
2168
|
+
let g = Ss[l.dragUnit];
|
|
2175
2169
|
(G(h, "scale") || h === "opacity") && (g = 10);
|
|
2176
|
-
let u = (
|
|
2177
|
-
c && u < 0 && (u = 0), h === "opacity" && u > 1 && (u = 1),
|
|
2170
|
+
let u = (l.dragStartY - i.pageY) / g + a;
|
|
2171
|
+
c && u < 0 && (u = 0), h === "opacity" && u > 1 && (u = 1), l.onDrag(`${u}`), d(`${u}`);
|
|
2178
2172
|
},
|
|
2179
|
-
[
|
|
2173
|
+
[l],
|
|
2180
2174
|
50
|
|
2181
2175
|
), p = V(() => {
|
|
2182
|
-
setTimeout(() =>
|
|
2176
|
+
setTimeout(() => l.onDragEnd(`${t}`), 100), n({
|
|
2183
2177
|
onDrag: (i) => i,
|
|
2184
2178
|
onDragEnd: (i) => i,
|
|
2185
2179
|
dragStartY: 0,
|
|
@@ -2189,31 +2183,31 @@ const Ss = ({ onAdd: r }) => {
|
|
|
2189
2183
|
negative: !1,
|
|
2190
2184
|
cssProperty: ""
|
|
2191
2185
|
});
|
|
2192
|
-
}, [
|
|
2186
|
+
}, [l, t, n]);
|
|
2193
2187
|
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: [
|
|
2194
2188
|
/* @__PURE__ */ e.jsx(tt, { className: "mx-auto text-3xl" }),
|
|
2195
2189
|
/* @__PURE__ */ e.jsx("h1", { children: s("no_block_selected_for_styling") })
|
|
2196
|
-
] }) }) : /* @__PURE__ */ e.jsx(
|
|
2197
|
-
|
|
2190
|
+
] }) }) : /* @__PURE__ */ e.jsx(dt, { children: /* @__PURE__ */ e.jsxs(gt.Provider, { value: { setDragData: n }, children: [
|
|
2191
|
+
l.dragging ? /* @__PURE__ */ e.jsx(
|
|
2198
2192
|
"div",
|
|
2199
2193
|
{
|
|
2200
|
-
onMouseMove:
|
|
2194
|
+
onMouseMove: o,
|
|
2201
2195
|
onMouseUp: () => p(),
|
|
2202
2196
|
className: "absolute inset-0 z-30 cursor-row-resize bg-gray-300/10"
|
|
2203
2197
|
}
|
|
2204
2198
|
) : null,
|
|
2205
|
-
/* @__PURE__ */ e.jsxs(
|
|
2206
|
-
/* @__PURE__ */ e.jsxs(
|
|
2199
|
+
/* @__PURE__ */ e.jsxs(Hr, { defaultValue: "settings", className: "flex h-full w-full flex-col py-1 text-xs", children: [
|
|
2200
|
+
/* @__PURE__ */ e.jsxs(Dr, { className: "mx-1 grid grid-cols-3", children: [
|
|
2207
2201
|
/* @__PURE__ */ e.jsx(he, { value: "settings", children: s("settings") }),
|
|
2208
2202
|
/* @__PURE__ */ e.jsx(he, { value: "styling", children: s("styling") }),
|
|
2209
2203
|
/* @__PURE__ */ e.jsx(he, { value: "attrs", children: s("Attributes") })
|
|
2210
2204
|
] }),
|
|
2211
|
-
/* @__PURE__ */ e.jsx(ye, { value: "settings", className: "no-scrollbar h-full flex-1 overflow-y-auto overflow-x-hidden", children: /* @__PURE__ */ e.jsx(
|
|
2212
|
-
/* @__PURE__ */ e.jsx(ye, { value: "styling", className: "h-full flex-1 overflow-y-auto overflow-x-hidden", children: /* @__PURE__ */ e.jsx(
|
|
2205
|
+
/* @__PURE__ */ e.jsx(ye, { value: "settings", className: "no-scrollbar h-full flex-1 overflow-y-auto overflow-x-hidden", children: /* @__PURE__ */ e.jsx(Be, { className: "no-scrollbar max-h-full flex-1 overflow-x-hidden overflow-y-hidden pb-5", children: /* @__PURE__ */ e.jsx(rs, {}) }) }),
|
|
2206
|
+
/* @__PURE__ */ e.jsx(ye, { value: "styling", className: "h-full flex-1 overflow-y-auto overflow-x-hidden", children: /* @__PURE__ */ e.jsx(Ns, {}) }),
|
|
2213
2207
|
/* @__PURE__ */ e.jsx(ye, { value: "attrs", className: "h-full flex-1 overflow-y-auto overflow-x-hidden", children: /* @__PURE__ */ e.jsx(Ts, {}) })
|
|
2214
2208
|
] })
|
|
2215
2209
|
] }) });
|
|
2216
2210
|
};
|
|
2217
2211
|
export {
|
|
2218
|
-
|
|
2212
|
+
_l as default
|
|
2219
2213
|
};
|