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