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