@chaibuilder/sdk 1.2.20 → 1.2.22
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-X9eh8OWJ.cjs → AddBlocks-157fSrJX.cjs} +1 -1
- package/dist/{AddBlocks-VIWJkaHJ.js → AddBlocks-WgpssWmQ.js} +2 -2
- package/dist/{BrandingOptions-5ss0k1nb.js → BrandingOptions-4961TxX2.js} +2 -2
- package/dist/{BrandingOptions-PzPdafIT.cjs → BrandingOptions-nwXR9TMl.cjs} +1 -1
- package/dist/{CanvasArea-TTGqlBKO.js → CanvasArea-MajWGr9z.js} +3 -3
- package/dist/{CanvasArea-hoyr4dfb.cjs → CanvasArea-MmTlc5Vb.cjs} +1 -1
- package/dist/{CurrentPage-EddxgHU-.cjs → CurrentPage-LpLr0lDI.cjs} +1 -1
- package/dist/{CurrentPage-a3T2uy8Q.js → CurrentPage-oPZN6Gwj.js} +3 -3
- package/dist/ListTree-dvxHTXs4.js +167 -0
- package/dist/ListTree-gTmusfso.cjs +1 -0
- package/dist/{Outline-rNFJGkap.js → Outline-2OxsXs1-.js} +3 -3
- package/dist/{Outline-3IHYlOzF.cjs → Outline-7CCnnzmK.cjs} +1 -1
- package/dist/{PagesPanel-B33hWN11.cjs → PagesPanel-8536oBWB.cjs} +1 -1
- package/dist/{PagesPanel-0bL28ofN.js → PagesPanel-pRKHw-AZ.js} +4 -4
- package/dist/{ProjectPanel-sBRkUXnY.js → ProjectPanel-iU6DY-Yp.js} +4 -4
- package/dist/{ProjectPanel-qtRTXNOP.cjs → ProjectPanel-oILsUWOH.cjs} +1 -1
- package/dist/{Settings-HgGe1ANj.js → Settings-BhSrj-cE.js} +552 -532
- package/dist/Settings-jHiYmt0y.cjs +1 -0
- package/dist/{SidePanels-R_g9rSjP.js → SidePanels-OLOUpKn4.js} +45 -45
- package/dist/{SidePanels-aAm-2A3s.cjs → SidePanels-bcJJocSq.cjs} +1 -1
- package/dist/{Topbar-cXtxVswU.cjs → Topbar-NMvzqQHW.cjs} +1 -1
- package/dist/{Topbar-AUTKpVHO.js → Topbar-Ny9T-7Zb.js} +1 -1
- package/dist/{UnsplashImages-p34UJJWJ.cjs → UnsplashImages-6tZv1q2_.cjs} +1 -1
- package/dist/{UnsplashImages-1RFHZIte.js → UnsplashImages-Y8RGFVSh.js} +1 -1
- package/dist/{UploadImages-CLfyNo1i.cjs → UploadImages-VLlVg9Ur.cjs} +1 -1
- package/dist/{UploadImages-G2orrhmZ.js → UploadImages-dd8LfyFr.js} +1 -1
- package/dist/{add-page-modal-KCy_Khfe.cjs → add-page-modal-IsqDdK7X.cjs} +1 -1
- package/dist/{add-page-modal-DUthvJNJ.js → add-page-modal-Jni6CY1x.js} +4 -4
- package/dist/{confirm-alert-T8vimDRx.cjs → confirm-alert-f26zJ7Js.cjs} +1 -1
- package/dist/{confirm-alert-nk2WQHud.js → confirm-alert-sc8RaWvD.js} +1 -1
- package/dist/core.cjs +1 -1
- package/dist/core.js +2 -2
- package/dist/{delete-page-modal-WvWRQUgU.js → delete-page-modal-0WiMZFxr.js} +3 -3
- package/dist/{delete-page-modal-_pFjWLJn.cjs → delete-page-modal-c3b-GCap.cjs} +1 -1
- package/dist/email.cjs +1 -1
- package/dist/email.js +2 -2
- package/dist/{form-kXQX4L2W.js → form-Nj6Kdn3g.js} +1 -1
- package/dist/{form-YnnWtUGk.cjs → form-n1Q6u16z.cjs} +1 -1
- package/dist/{index-e5cgISUO.cjs → index-0bwkNnA0.cjs} +2 -2
- package/dist/index-9PHdn80L.cjs +1 -0
- package/dist/{index-la4rqGKN.js → index-IPJAbzzO.js} +965 -928
- package/dist/{index-QIbDWoML.js → index-UP_4awU9.js} +2 -2
- package/dist/{index--Pt4B5bv.js → index-_VPpjzJu.js} +3 -3
- package/dist/{index-JqRQZLN5.cjs → index-nwAgi0aD.cjs} +1 -1
- package/dist/{page-viewer-s_lHBVfx.js → page-viewer-L1Dmgj-c.js} +4 -4
- package/dist/{page-viewer-6phtctz6.cjs → page-viewer-TnxHhq7S.cjs} +1 -1
- package/dist/{project-general-setting-SaNOMXEl.cjs → project-general-setting-1Ot1RU43.cjs} +1 -1
- package/dist/{project-general-setting-gj4A0X5W.js → project-general-setting-sUP7JqWK.js} +4 -4
- package/dist/{project-seo-setting-bMDdgKRZ.cjs → project-seo-setting-3-vBkx2v.cjs} +1 -1
- package/dist/{project-seo-setting-aCPg-IIc.js → project-seo-setting-NNvAGt4T.js} +2 -2
- package/dist/{single-page-detail-TP-cxVIT.js → single-page-detail-FXg_NebW.js} +5 -5
- package/dist/{single-page-detail-er8i2FIF.cjs → single-page-detail-btEKYXjE.cjs} +1 -1
- package/dist/studio.cjs +1 -1
- package/dist/studio.js +3 -3
- package/dist/ui.cjs +1 -1
- package/dist/ui.js +1 -1
- package/dist/{useAddBlockByDrop-_vczk5o_.js → useAddBlockByDrop-V8xo-PNQ.js} +1 -1
- package/dist/{useAddBlockByDrop-LSV8adwE.cjs → useAddBlockByDrop-qRHgy8_0.cjs} +1 -1
- package/package.json +24 -25
- package/dist/ListTree-kergCZrw.js +0 -126
- package/dist/ListTree-tADrgsqZ.cjs +0 -1
- package/dist/Settings-rXxS3RGM.cjs +0 -1
- package/dist/index-DeHH1q_1.cjs +0 -1
package/dist/ui.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { b9 as q, bc as y, ba as z, bb as J, bp as K, bC as W, A as X, ai as Y, g as Z, b as _, e as $, f as N, c as O, d as Q, a as U, bq as aa, as as ea, B as oa, bj as ta, bm as ra, bl as sa, bo as na, bk as ia, bE as ba, aY as pa, cc as ua, a$ as la, b0 as ma, aZ as ca, b1 as da, a_ as ga, ce as Ca, cd as Ma, bu as Sa, cf as Da, bt as Ta, ck as xa, bs as Aa, ch as ha, cl as Ia, cp as wa, cg as Pa, ci as ka, cj as Fa, cm as Ga, cn as La, co as va, bv as Ha, ad as Ra, ae as Ba, ah as Va, b2 as fa, af as Ea, ag as ja, ao as qa, aG as ya, aL as za, aI as Ja, bg as Ka, bh as Wa, aJ as Xa, c4 as Ya, c8 as Za, c3 as _a, aK as $a, bi as Na, c5 as Oa, c6 as Qa, c7 as Ua, aH as ae, aD as ee, aF as oe, aE as te, b6 as re, b7 as se, bd as ne, aB as ie, b8 as be, bG as pe, bN as ue, bJ as le, bT as me, bK as ce, bM as de, bH as ge, bQ as Ce, bO as Me, bP as Se, bL as De, bV as Te, bU as xe, bR as Ae, bS as he, bI as Ie, aV as we, aX as Pe, aW as ke, b5 as Fe, bf as Ge, bF as Le, aj as ve, am as He, ay as Re, an as Be, az as Ve, bW as fe, ak as Ee, al as je, aA as qe, bX as ye, bZ as ze, b_ as Je, c2 as Ke, c0 as We, b$ as Xe, c1 as Ye, bY as Ze, S as _e, aC as $e, au as Ne, ax as Oe, av as Qe, aw as Ue, bn as ao, I as eo, bz as oo, ap as to, ar as ro, be as so, T as no, aq as io, bD as bo, bB as po, c9 as uo, cb as lo, bA as mo, ca as co } from "./index-
|
|
1
|
+
import { b9 as q, bc as y, ba as z, bb as J, bp as K, bC as W, A as X, ai as Y, g as Z, b as _, e as $, f as N, c as O, d as Q, a as U, bq as aa, as as ea, B as oa, bj as ta, bm as ra, bl as sa, bo as na, bk as ia, bE as ba, aY as pa, cc as ua, a$ as la, b0 as ma, aZ as ca, b1 as da, a_ as ga, ce as Ca, cd as Ma, bu as Sa, cf as Da, bt as Ta, ck as xa, bs as Aa, ch as ha, cl as Ia, cp as wa, cg as Pa, ci as ka, cj as Fa, cm as Ga, cn as La, co as va, bv as Ha, ad as Ra, ae as Ba, ah as Va, b2 as fa, af as Ea, ag as ja, ao as qa, aG as ya, aL as za, aI as Ja, bg as Ka, bh as Wa, aJ as Xa, c4 as Ya, c8 as Za, c3 as _a, aK as $a, bi as Na, c5 as Oa, c6 as Qa, c7 as Ua, aH as ae, aD as ee, aF as oe, aE as te, b6 as re, b7 as se, bd as ne, aB as ie, b8 as be, bG as pe, bN as ue, bJ as le, bT as me, bK as ce, bM as de, bH as ge, bQ as Ce, bO as Me, bP as Se, bL as De, bV as Te, bU as xe, bR as Ae, bS as he, bI as Ie, aV as we, aX as Pe, aW as ke, b5 as Fe, bf as Ge, bF as Le, aj as ve, am as He, ay as Re, an as Be, az as Ve, bW as fe, ak as Ee, al as je, aA as qe, bX as ye, bZ as ze, b_ as Je, c2 as Ke, c0 as We, b$ as Xe, c1 as Ye, bY as Ze, S as _e, aC as $e, au as Ne, ax as Oe, av as Qe, aw as Ue, bn as ao, I as eo, bz as oo, ap as to, ar as ro, be as so, T as no, aq as io, bD as bo, bB as po, c9 as uo, cb as lo, bA as mo, ca as co } from "./index-IPJAbzzO.js";
|
|
2
2
|
import "react";
|
|
3
3
|
import "lodash-es";
|
|
4
4
|
import "./Functions-7jnEwJyw.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useCallback as d } from "react";
|
|
2
2
|
import { noop as s, has as a } from "lodash-es";
|
|
3
|
-
import { L as u, h as i } from "./index-
|
|
3
|
+
import { L as u, h as i } from "./index-IPJAbzzO.js";
|
|
4
4
|
const f = () => {
|
|
5
5
|
const { addCoreBlock: r } = u(), l = i("getExternalPredefinedBlock", s);
|
|
6
6
|
return d(
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const u=require("react"),t=require("lodash-es"),l=require("./index-
|
|
1
|
+
"use strict";const u=require("react"),t=require("lodash-es"),l=require("./index-9PHdn80L.cjs"),a=()=>{const{addCoreBlock:o}=l.useAddBlock(),s=l.useBuilderProp("getExternalPredefinedBlock",t.noop);return u.useCallback(async n=>{const{block:r,dropTargetId:e,relativeIndex:c}=n;if(t.has(r,"format")){const d=await s(r);return o({blocks:d},e===0?null:e,c)}return o(r,e===0?null:e,c)},[o])};exports.useAddBlockByDrop=a;
|
package/package.json
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
"author": "Suraj Air",
|
|
6
6
|
"license": "BSD-3-Clause",
|
|
7
7
|
"homepage": "https://chaibuilder.com",
|
|
8
|
-
"version": "1.2.
|
|
8
|
+
"version": "1.2.22",
|
|
9
9
|
"type": "module",
|
|
10
10
|
"repository": {
|
|
11
11
|
"type": "git",
|
|
@@ -61,7 +61,6 @@
|
|
|
61
61
|
"require": "./dist/web-blocks.cjs",
|
|
62
62
|
"types": "./dist/web-blocks.d.ts"
|
|
63
63
|
},
|
|
64
|
-
|
|
65
64
|
"./email": {
|
|
66
65
|
"import": "./dist/email.js",
|
|
67
66
|
"require": "./dist/email.cjs",
|
|
@@ -95,25 +94,25 @@
|
|
|
95
94
|
"@mhsdesign/jit-browser-tailwindcss": "0.4.0",
|
|
96
95
|
"@minoru/react-dnd-treeview": "3.4.4",
|
|
97
96
|
"@radix-ui/react-accordion": "^1.1.2",
|
|
98
|
-
"@radix-ui/react-alert-dialog": "^1.0.
|
|
99
|
-
"@radix-ui/react-context-menu": "^2.1.
|
|
100
|
-
"@radix-ui/react-dialog": "^1.0.
|
|
101
|
-
"@radix-ui/react-dropdown-menu": "^2.0.
|
|
102
|
-
"@radix-ui/react-hover-card": "^1.0.
|
|
97
|
+
"@radix-ui/react-alert-dialog": "^1.0.5",
|
|
98
|
+
"@radix-ui/react-context-menu": "^2.1.5",
|
|
99
|
+
"@radix-ui/react-dialog": "^1.0.5",
|
|
100
|
+
"@radix-ui/react-dropdown-menu": "^2.0.6",
|
|
101
|
+
"@radix-ui/react-hover-card": "^1.0.7",
|
|
103
102
|
"@radix-ui/react-icons": "^1.3.0",
|
|
104
103
|
"@radix-ui/react-label": "^2.0.2",
|
|
105
|
-
"@radix-ui/react-menubar": "^1.0.
|
|
106
|
-
"@radix-ui/react-navigation-menu": "^1.1.
|
|
107
|
-
"@radix-ui/react-popover": "^1.0.
|
|
108
|
-
"@radix-ui/react-scroll-area": "^1.0.
|
|
104
|
+
"@radix-ui/react-menubar": "^1.0.4",
|
|
105
|
+
"@radix-ui/react-navigation-menu": "^1.1.4",
|
|
106
|
+
"@radix-ui/react-popover": "^1.0.7",
|
|
107
|
+
"@radix-ui/react-scroll-area": "^1.0.5",
|
|
109
108
|
"@radix-ui/react-select": "^1.2.2",
|
|
110
109
|
"@radix-ui/react-separator": "^1.0.3",
|
|
111
110
|
"@radix-ui/react-slot": "^1.0.2",
|
|
112
111
|
"@radix-ui/react-switch": "^1.0.3",
|
|
113
112
|
"@radix-ui/react-tabs": "^1.0.4",
|
|
114
|
-
"@radix-ui/react-toast": "^1.1.
|
|
113
|
+
"@radix-ui/react-toast": "^1.1.5",
|
|
115
114
|
"@radix-ui/react-toggle": "^1.0.3",
|
|
116
|
-
"@radix-ui/react-tooltip": "^1.0.
|
|
115
|
+
"@radix-ui/react-tooltip": "^1.0.7",
|
|
117
116
|
"@react-email/components": "^0.0.18",
|
|
118
117
|
"@react-email/render": "^0.0.14",
|
|
119
118
|
"@react-hookz/web": "23.1.0",
|
|
@@ -132,26 +131,26 @@
|
|
|
132
131
|
"fuse.js": "6.6.2",
|
|
133
132
|
"himalaya": "^1.1.0",
|
|
134
133
|
"html-formatter": "0.1.9",
|
|
135
|
-
"i18next": "^23.
|
|
134
|
+
"i18next": "^23.6.0",
|
|
136
135
|
"jotai": "2.2.2",
|
|
137
136
|
"lodash": "^4.17.21",
|
|
138
137
|
"lodash-es": "4.17.21",
|
|
139
138
|
"lucide-react": "^0.244.0",
|
|
140
|
-
"react": "^18",
|
|
139
|
+
"react": "^18.2.0",
|
|
141
140
|
"react-arborist": "^3.4.0",
|
|
142
141
|
"react-autosuggest": "10.1.0",
|
|
143
142
|
"react-colorful": "5.6.1",
|
|
144
143
|
"react-dnd": "16.0.1",
|
|
145
144
|
"react-dnd-html5-backend": "16.0.1",
|
|
146
|
-
"react-dom": "^18",
|
|
145
|
+
"react-dom": "^18.2.0",
|
|
147
146
|
"react-email": "^2.1.3",
|
|
148
147
|
"react-hotkeys-hook": "4.4.1",
|
|
149
148
|
"react-i18next": "13.0.1",
|
|
150
|
-
"react-icons": "^4.
|
|
149
|
+
"react-icons": "^4.11.0",
|
|
151
150
|
"react-icons-picker": "^1.0.9",
|
|
152
151
|
"react-json-view-lite": "^1.4.0",
|
|
153
152
|
"react-quill": "^2.0.0",
|
|
154
|
-
"react-wrap-balancer": "^1.
|
|
153
|
+
"react-wrap-balancer": "^1.1.0",
|
|
155
154
|
"sonner": "^1.2.0",
|
|
156
155
|
"tailwind-merge": "2.3.0",
|
|
157
156
|
"tippy.js": "^6.3.7",
|
|
@@ -171,19 +170,19 @@
|
|
|
171
170
|
"@types/jest": "^29.5.7",
|
|
172
171
|
"@types/lodash": "^4.14.200",
|
|
173
172
|
"@types/node": "^20.8.10",
|
|
174
|
-
"@types/react": "^18.2.
|
|
175
|
-
"@types/react-dom": "^18.2.
|
|
176
|
-
"@typescript-eslint/eslint-plugin": "^6.
|
|
177
|
-
"@typescript-eslint/parser": "^6.
|
|
178
|
-
"@vitejs/plugin-react-swc": "^3.
|
|
173
|
+
"@types/react": "^18.2.34",
|
|
174
|
+
"@types/react-dom": "^18.2.14",
|
|
175
|
+
"@typescript-eslint/eslint-plugin": "^6.9.1",
|
|
176
|
+
"@typescript-eslint/parser": "^6.9.1",
|
|
177
|
+
"@vitejs/plugin-react-swc": "^3.4.1",
|
|
179
178
|
"autoprefixer": "^10.4.16",
|
|
180
179
|
"better-docs": "^2.7.2",
|
|
181
180
|
"better-sqlite3": "^9.1.1",
|
|
182
181
|
"drizzle-kit": "^0.20.4",
|
|
183
182
|
"drizzle-orm": "^0.29.0",
|
|
184
|
-
"eslint": "^8.
|
|
183
|
+
"eslint": "^8.53.0",
|
|
185
184
|
"eslint-plugin-react-hooks": "^4.6.0",
|
|
186
|
-
"eslint-plugin-react-refresh": "^0.4.
|
|
185
|
+
"eslint-plugin-react-refresh": "^0.4.4",
|
|
187
186
|
"husky": "^9.0.10",
|
|
188
187
|
"jest": "^29.7.0",
|
|
189
188
|
"jest-environment-jsdom": "^29.7.0",
|
|
@@ -1,126 +0,0 @@
|
|
|
1
|
-
import { j as e } from "./jsx-runtime-WbnYoNE9.js";
|
|
2
|
-
import { Tree as f } from "react-arborist";
|
|
3
|
-
import { c as x } from "./Functions-7jnEwJyw.js";
|
|
4
|
-
import { Y as g, h as v, ap as b, aq as j, ar as y, by as w, r as N, ac as S, bf as k } from "./index-la4rqGKN.js";
|
|
5
|
-
import { T } from "./TypeIcon-qO96rNbV.js";
|
|
6
|
-
import { useDebouncedCallback as C } from "@react-hookz/web";
|
|
7
|
-
import { TriangleRightIcon as B } from "@radix-ui/react-icons";
|
|
8
|
-
import { useAtom as D } from "jotai";
|
|
9
|
-
import "./_commonjsHelpers-UyOWmZb0.js";
|
|
10
|
-
import "react";
|
|
11
|
-
import "lodash-es";
|
|
12
|
-
import "clsx";
|
|
13
|
-
import "tailwind-merge";
|
|
14
|
-
import "@chaibuilder/runtime";
|
|
15
|
-
import "./MODIFIERS-WQdaNvb8.js";
|
|
16
|
-
import "@radix-ui/react-toggle";
|
|
17
|
-
import "class-variance-authority";
|
|
18
|
-
import "./Class-3k8xjeiM.js";
|
|
19
|
-
import "@radix-ui/react-switch";
|
|
20
|
-
import "@radix-ui/react-slot";
|
|
21
|
-
import "@radix-ui/react-accordion";
|
|
22
|
-
import "@radix-ui/react-alert-dialog";
|
|
23
|
-
import "@radix-ui/react-dialog";
|
|
24
|
-
import "@radix-ui/react-label";
|
|
25
|
-
import "@radix-ui/react-scroll-area";
|
|
26
|
-
import "@radix-ui/react-tabs";
|
|
27
|
-
import "@radix-ui/react-tooltip";
|
|
28
|
-
import "@radix-ui/react-popover";
|
|
29
|
-
import "@radix-ui/react-menubar";
|
|
30
|
-
import "@radix-ui/react-hover-card";
|
|
31
|
-
import "@radix-ui/react-select";
|
|
32
|
-
import "@radix-ui/react-dropdown-menu";
|
|
33
|
-
import "@radix-ui/react-separator";
|
|
34
|
-
import "@radix-ui/react-toast";
|
|
35
|
-
import "cmdk";
|
|
36
|
-
import "@radix-ui/react-context-menu";
|
|
37
|
-
import "react-icons-picker";
|
|
38
|
-
import "react-dom";
|
|
39
|
-
import "react-quill";
|
|
40
|
-
import "react-i18next";
|
|
41
|
-
import "lucide-react";
|
|
42
|
-
function I({ node: s, style: a, dragHandle: n }) {
|
|
43
|
-
var u;
|
|
44
|
-
const [, c] = g(), m = v("outlineMenuItems", []), { id: l, isSelected: p, data: r, handleClick: d } = s, t = C((o) => c(o), [], 300), i = (o) => {
|
|
45
|
-
o.stopPropagation(), s.toggle();
|
|
46
|
-
}, h = (o) => {
|
|
47
|
-
o.stopPropagation(), d(o);
|
|
48
|
-
};
|
|
49
|
-
return /* @__PURE__ */ e.jsxs(
|
|
50
|
-
"div",
|
|
51
|
-
{
|
|
52
|
-
onClick: h,
|
|
53
|
-
onMouseEnter: () => t(l),
|
|
54
|
-
style: a,
|
|
55
|
-
ref: n,
|
|
56
|
-
className: x(
|
|
57
|
-
"group relative flex !h-fit w-full items-center justify-between space-x-px overflow-hidden py-px",
|
|
58
|
-
p ? "bg-blue-500 text-white" : "text-gray-600 hover:bg-gray-200 dark:hover:bg-gray-800"
|
|
59
|
-
),
|
|
60
|
-
children: [
|
|
61
|
-
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center", children: [
|
|
62
|
-
/* @__PURE__ */ e.jsx(
|
|
63
|
-
"div",
|
|
64
|
-
{
|
|
65
|
-
className: `flex h-4 w-4 rotate-0 transform cursor-pointer items-center justify-center text-xs transition-transform duration-100 ${s.isOpen ? "rotate-90" : ""}`,
|
|
66
|
-
children: ((u = s.children) == null ? void 0 : u.length) > 0 && /* @__PURE__ */ e.jsx("button", { onClick: i, type: "button", children: /* @__PURE__ */ e.jsx(B, {}) })
|
|
67
|
-
}
|
|
68
|
-
),
|
|
69
|
-
/* @__PURE__ */ e.jsxs("button", { type: "button", className: "flex items-center", children: [
|
|
70
|
-
/* @__PURE__ */ e.jsx("div", { className: "-mt-0.5 h-3 w-3", children: /* @__PURE__ */ e.jsx(T, { type: r == null ? void 0 : r._type }) }),
|
|
71
|
-
/* @__PURE__ */ e.jsx("div", { className: "ml-2 truncate text-[11px]", children: r == null ? void 0 : r._type })
|
|
72
|
-
] })
|
|
73
|
-
] }),
|
|
74
|
-
/* @__PURE__ */ e.jsx("div", { className: "invisible flex items-center space-x-1 pr-2 group-hover:visible", children: m.map((o) => /* @__PURE__ */ e.jsxs(b, { children: [
|
|
75
|
-
/* @__PURE__ */ e.jsx(
|
|
76
|
-
j,
|
|
77
|
-
{
|
|
78
|
-
className: "cursor-pointer rounded bg-transparent hover:bg-white hover:text-blue-500",
|
|
79
|
-
asChild: !0,
|
|
80
|
-
children: o.item(l)
|
|
81
|
-
}
|
|
82
|
-
),
|
|
83
|
-
/* @__PURE__ */ e.jsx(y, { className: "z-[9999]", children: o.tooltip })
|
|
84
|
-
] })) })
|
|
85
|
-
]
|
|
86
|
-
},
|
|
87
|
-
l
|
|
88
|
-
);
|
|
89
|
-
}
|
|
90
|
-
const ve = () => {
|
|
91
|
-
const [s] = D(w), [a, n] = N(), [, c] = S(), m = () => {
|
|
92
|
-
n([]), c([]);
|
|
93
|
-
}, l = ({ id: t, name: i }) => {
|
|
94
|
-
console.log("onRename", { id: t, name: i });
|
|
95
|
-
}, p = ({ dragIds: t, parentId: i, index: h }) => {
|
|
96
|
-
console.log("onMove", { dragIds: t, parentId: i, index: h });
|
|
97
|
-
}, r = ({ ids: t }) => {
|
|
98
|
-
console.log("onDelete", { ids: t });
|
|
99
|
-
}, d = (t) => {
|
|
100
|
-
if (t.length === 0)
|
|
101
|
-
return;
|
|
102
|
-
const i = t[0] ? t[0].id : "";
|
|
103
|
-
c([]), n([i]);
|
|
104
|
-
};
|
|
105
|
-
return /* @__PURE__ */ e.jsx("div", { className: x("-mx-1 -mt-1 flex h-full select-none flex-col space-y-1"), onClick: () => m(), children: /* @__PURE__ */ e.jsx(k, { id: "outline-view", className: "no-scrollbar h-full overflow-y-auto p-1 px-2 text-xs", children: /* @__PURE__ */ e.jsx(
|
|
106
|
-
f,
|
|
107
|
-
{
|
|
108
|
-
className: "max-w-full !overflow-hidden",
|
|
109
|
-
selection: a[0] || "",
|
|
110
|
-
onRename: l,
|
|
111
|
-
openByDefault: !1,
|
|
112
|
-
onMove: p,
|
|
113
|
-
rowHeight: 20,
|
|
114
|
-
onDelete: r,
|
|
115
|
-
data: s,
|
|
116
|
-
width: "100%",
|
|
117
|
-
indent: 10,
|
|
118
|
-
idAccessor: "_id",
|
|
119
|
-
onSelect: d,
|
|
120
|
-
children: I
|
|
121
|
-
}
|
|
122
|
-
) }) });
|
|
123
|
-
};
|
|
124
|
-
export {
|
|
125
|
-
ve as default
|
|
126
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-Z_BpKhVy.cjs"),j=require("react-arborist"),q=require("./Functions-N3yhPYKY.cjs"),i=require("./index-DeHH1q_1.cjs"),g=require("./TypeIcon-ElNNPazl.cjs"),f=require("@react-hookz/web"),v=require("@radix-ui/react-icons"),b=require("jotai");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("react");require("lodash-es");require("clsx");require("tailwind-merge");require("@chaibuilder/runtime");require("./MODIFIERS-9EwxLM8V.cjs");require("@radix-ui/react-toggle");require("class-variance-authority");require("./Class-MmCxz2Ay.cjs");require("@radix-ui/react-switch");require("@radix-ui/react-slot");require("@radix-ui/react-accordion");require("@radix-ui/react-alert-dialog");require("@radix-ui/react-dialog");require("@radix-ui/react-label");require("@radix-ui/react-scroll-area");require("@radix-ui/react-tabs");require("@radix-ui/react-tooltip");require("@radix-ui/react-popover");require("@radix-ui/react-menubar");require("@radix-ui/react-hover-card");require("@radix-ui/react-select");require("@radix-ui/react-dropdown-menu");require("@radix-ui/react-separator");require("@radix-ui/react-toast");require("cmdk");require("@radix-ui/react-context-menu");require("react-icons-picker");require("react-dom");require("react-quill");require("react-i18next");require("lucide-react");function y({node:n,style:x,dragHandle:c}){var m;const[,u]=i.useHighlightBlockId(),a=i.useBuilderProp("outlineMenuItems",[]),{id:l,isSelected:d,data:s,handleClick:p}=n,r=f.useDebouncedCallback(t=>u(t),[],300),o=t=>{t.stopPropagation(),n.toggle()},h=t=>{t.stopPropagation(),p(t)};return e.jsxRuntimeExports.jsxs("div",{onClick:h,onMouseEnter:()=>r(l),style:x,ref:c,className:q.cn("group relative flex !h-fit w-full items-center justify-between space-x-px overflow-hidden py-px",d?"bg-blue-500 text-white":"text-gray-600 hover:bg-gray-200 dark:hover:bg-gray-800"),children:[e.jsxRuntimeExports.jsxs("div",{className:"flex items-center",children:[e.jsxRuntimeExports.jsx("div",{className:`flex h-4 w-4 rotate-0 transform cursor-pointer items-center justify-center text-xs transition-transform duration-100 ${n.isOpen?"rotate-90":""}`,children:((m=n.children)==null?void 0:m.length)>0&&e.jsxRuntimeExports.jsx("button",{onClick:o,type:"button",children:e.jsxRuntimeExports.jsx(v.TriangleRightIcon,{})})}),e.jsxRuntimeExports.jsxs("button",{type:"button",className:"flex items-center",children:[e.jsxRuntimeExports.jsx("div",{className:"-mt-0.5 h-3 w-3",children:e.jsxRuntimeExports.jsx(g.TypeIcon,{type:s==null?void 0:s._type})}),e.jsxRuntimeExports.jsx("div",{className:"ml-2 truncate text-[11px]",children:s==null?void 0:s._type})]})]}),e.jsxRuntimeExports.jsx("div",{className:"invisible flex items-center space-x-1 pr-2 group-hover:visible",children:a.map(t=>e.jsxRuntimeExports.jsxs(i.Tooltip,{children:[e.jsxRuntimeExports.jsx(i.TooltipTrigger,{className:"cursor-pointer rounded bg-transparent hover:bg-white hover:text-blue-500",asChild:!0,children:t.item(l)}),e.jsxRuntimeExports.jsx(i.TooltipContent,{className:"z-[9999]",children:t.tooltip})]}))})]},l)}const R=()=>{const[n]=b.useAtom(i.treeDSBlocks),[x,c]=i.useSelectedBlockIds(),[,u]=i.useSelectedStylingBlocks(),a=()=>{c([]),u([])},l=({id:r,name:o})=>{console.log("onRename",{id:r,name:o})},d=({dragIds:r,parentId:o,index:h})=>{console.log("onMove",{dragIds:r,parentId:o,index:h})},s=({ids:r})=>{console.log("onDelete",{ids:r})},p=r=>{if(r.length===0)return;const o=r[0]?r[0].id:"";u([]),c([o])};return e.jsxRuntimeExports.jsx("div",{className:q.cn("-mx-1 -mt-1 flex h-full select-none flex-col space-y-1"),onClick:()=>a(),children:e.jsxRuntimeExports.jsx(i.ScrollArea,{id:"outline-view",className:"no-scrollbar h-full overflow-y-auto p-1 px-2 text-xs",children:e.jsxRuntimeExports.jsx(j.Tree,{className:"max-w-full !overflow-hidden",selection:x[0]||"",onRename:l,openByDefault:!1,onMove:d,rowHeight:20,onDelete:s,data:n,width:"100%",indent:10,idAccessor:"_id",onSelect:p,children:y})})})};exports.default=R;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-Z_BpKhVy.cjs"),g=require("react"),Z=require("@react-hookz/web"),t=require("lodash-es"),A=require("react-i18next"),u=require("@radix-ui/react-icons"),o=require("./index-DeHH1q_1.cjs"),pe=require("./controls-KK2oLIa8.cjs"),F=require("lucide-react"),$=require("@chaibuilder/runtime"),W=require("./index-e5cgISUO.cjs"),z=require("./index-gi1LIOCw.cjs"),ue=require("@rjsf/core"),de=require("@rjsf/validator-ajv8"),ce=require("react-autosuggest"),xe=require("fuse.js"),D=require("./Class-MmCxz2Ay.cjs"),me=require("./MODIFIERS-9EwxLM8V.cjs"),N=require("lodash");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("./Functions-N3yhPYKY.cjs");require("clsx");require("tailwind-merge");require("jotai");require("@radix-ui/react-toggle");require("class-variance-authority");require("@radix-ui/react-switch");require("@radix-ui/react-slot");require("@radix-ui/react-accordion");require("@radix-ui/react-alert-dialog");require("@radix-ui/react-dialog");require("@radix-ui/react-label");require("@radix-ui/react-scroll-area");require("@radix-ui/react-tabs");require("@radix-ui/react-tooltip");require("@radix-ui/react-popover");require("@radix-ui/react-menubar");require("@radix-ui/react-hover-card");require("@radix-ui/react-select");require("@radix-ui/react-dropdown-menu");require("@radix-ui/react-separator");require("@radix-ui/react-toast");require("cmdk");require("@radix-ui/react-context-menu");require("react-icons-picker");require("react-dom");require("react-quill");require("i18next");require("@floating-ui/react-dom");require("flagged");require("react-dnd");require("@minoru/react-dnd-treeview");require("react-hotkeys-hook");function ge(r){const l=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(r){for(const s in r)if(s!=="default"){const n=Object.getOwnPropertyDescriptor(r,s);Object.defineProperty(l,s,n.get?n:{enumerable:!0,get:()=>r[s]})}}return l.default=r,Object.freeze(l)}const O=ge(g);function he(r){const l=[],s={};function n(i,d){t.forEach(d,(a,x)=>{const p=i?`${i}.${x}`:x,m=t.isArray(a)?"list":typeof a;l.push(p),s[p]=m==="string"?"text":m==="object"?"model":m,m==="object"&&!t.isArray(a)&&n(p,a)})}return n("",t.omit(r,["styles","_type","_id","_name","_bindings"])),{paths:l,pathsType:s}}const U=({data:r,fullView:l})=>{if(!r)return null;const s=typeof r;return l?typeof r=="object"?e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx("div",{className:"h-3"}),e.jsxRuntimeExports.jsx(W.ErrorBoundary,{children:e.jsxRuntimeExports.jsx(z.JsonView,{data:r,shouldExpandNode:z.allExpanded,style:{...z.defaultStyles,container:"max-h-[40vh] overflow-y-auto text-[12px] leading-[1.5] tracking-wide font-mono",stringValue:"text-orange-600",label:"text-green-900 font-semibold pr-1 tracking-wider"}})})]}):e.jsxRuntimeExports.jsxs("div",{className:"max-h-36 w-full overflow-y-auto overflow-x-hidden text-[12px] leading-4 text-gray-800/50",children:[e.jsxRuntimeExports.jsx("span",{className:"font-medium text-gray-800/80",children:"Content: "}),r]}):e.jsxRuntimeExports.jsx("div",{className:"w-full overflow-hidden whitespace-nowrap text-[10px] leading-3 text-gray-800/50",children:t.truncate(s==="object"?JSON.stringify(r):r,{length:40})})},J=({type:r,value:l="",setValue:s,data:n,onChange:i,dataType:d,appliedBindings:a})=>{const{paths:x,pathsType:p}=he(n),m=r==="PROP"?$.getBlockComponent(n==null?void 0:n._type):{},b=r==="PROP",[c,f]=g.useState(!1),y=g.useMemo(()=>r==="PROP"?x.filter(h=>!t.includes(a,h)&&t.get(m,`props.${t.first(t.split(h,"."))}.binding`)):x.filter(h=>d===t.get(p,h,"")),[r,x,a,d,m]);return g.useEffect(()=>{l&&i(l)},[l,r]),e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsxs("div",{className:"flex items-center space-x-4",children:[e.jsxRuntimeExports.jsx("p",{className:"text-sm text-muted-foreground",children:t.startCase(t.toLower(r))}),e.jsxRuntimeExports.jsxs(o.Popover,{open:c,onOpenChange:f,children:[e.jsxRuntimeExports.jsx(o.PopoverTrigger,{asChild:!0,children:e.jsxRuntimeExports.jsx(o.Button,{variant:"outline",size:"sm",className:` ${t.isEmpty(l)?"w-44 justify-center bg-blue-500 text-gray-100 hover:bg-blue-400 hover:text-white":"min-w-[350px] items-center justify-between"}`,children:l?e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsxs("span",{className:"pr-8 text-sm",children:[b&&e.jsxRuntimeExports.jsx("span",{className:"mr-2 rounded-full bg-purple-100 px-2 py-0.5 text-[10px] text-purple-500",children:t.startCase(d)}),l]}),e.jsxRuntimeExports.jsx("span",{className:"cursor-pointer text-[9px] text-blue-400 underline hover:text-blue-700",children:"Change"})]}):e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:["+ Set ",t.startCase(t.toLower(r))]})})}),e.jsxRuntimeExports.jsx(o.PopoverContent,{className:"z-[999] min-w-[300px] p-0",side:"right",align:"start",children:e.jsxRuntimeExports.jsxs(o.Command,{children:[e.jsxRuntimeExports.jsx(o.CommandInput,{placeholder:`Choose ${t.toLower(r)}...`}),e.jsxRuntimeExports.jsxs(o.CommandList,{children:[e.jsxRuntimeExports.jsx(o.CommandEmpty,{children:"No results found."}),e.jsxRuntimeExports.jsx(o.CommandGroup,{children:t.map(y,h=>e.jsxRuntimeExports.jsxs(o.CommandItem,{value:h,className:`cursor-pointer ${b?"flex items-center justify-between":"flex flex-col items-start justify-start"}`,onSelect:v=>{s(t.find(y,E=>E===v)||null),f(!1)},children:[e.jsxRuntimeExports.jsxs("div",{className:"flex items-center gap-x-2",children:[e.jsxRuntimeExports.jsx(F.Check,{className:`h-4 w-4 text-green-500 ${l===h?"":"opacity-0"}`}),h]}),b?e.jsxRuntimeExports.jsx("div",{children:e.jsxRuntimeExports.jsx("span",{className:"rounded-full bg-purple-100 px-2 py-0.5 text-[10px] text-purple-500",children:t.startCase(t.get(p,h,""))})}):e.jsxRuntimeExports.jsx("div",{className:"pl-6",children:e.jsxRuntimeExports.jsx(U,{data:t.get(n,h)})})]},h))})]})]})})]})]}),!b&&!t.isEmpty(l)&&e.jsxRuntimeExports.jsx("div",{className:"pt-2",children:e.jsxRuntimeExports.jsx(U,{data:t.get(n,l,""),fullView:!0})})]})},ye=({appliedBindings:r=[],onAddBinding:l,editMode:s,item:n})=>{const[i,d]=g.useState(s?n.key:""),[a,x]=g.useState(s?n.value:""),p=o.useSelectedBlock(),[m]=W.useChaiExternalData(),b=g.useCallback((y,h)=>{if(t.isEmpty(y))return"";{const v=t.get(h==="PROP"?p:m,y,"");if(t.isArray(v))return"list";const E=typeof v;return E==="string"?"text":E==="object"?"model":E}},[p,m]),[c,f]=g.useState(s?b(n.key,"PROP"):"");return e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsxs(o.DialogHeader,{children:[e.jsxRuntimeExports.jsx(o.DialogTitle,{children:"Add Data Binding"}),e.jsxRuntimeExports.jsx(o.DialogDescription,{className:"text-xs",children:"Add prop and path of binding. Click save when you're done."})]}),e.jsxRuntimeExports.jsxs("div",{className:"relative flex flex-col gap-1",children:[e.jsxRuntimeExports.jsx(J,{type:"PROP",isDisabled:!1,placeholder:"Enter prop key",value:i,setValue:d,onChange:y=>{const h=b(y,"PROP");d(y),c!==h&&x(""),f(h)},data:p,dataType:c,appliedBindings:r}),e.jsxRuntimeExports.jsx("div",{className:"h-2"}),e.jsxRuntimeExports.jsx(J,{type:"PATH",isDisabled:t.isEmpty(i),placeholder:"Enter data path",value:a,setValue:x,onChange:y=>{const h=b(y,"PATH");x(c===h?y:"")},data:m,dataType:c,appliedBindings:r})]}),e.jsxRuntimeExports.jsx(o.DialogFooter,{children:e.jsxRuntimeExports.jsx(o.Button,{type:"submit",className:"mt-4",disabled:t.isEmpty(i)&&t.isEmpty(a),onClick:()=>l({key:i,value:a}),children:"Save"})})]})},re=({disabled:r,children:l,onAddBinding:s,appliedBindings:n,editMode:i=!0,item:d={}})=>{const[a,x]=g.useState(!1);return e.jsxRuntimeExports.jsxs(o.Dialog,{children:[e.jsxRuntimeExports.jsx(o.DialogTrigger,{disabled:r,asChild:!0,onClick:()=>x(!0),children:l}),a&&e.jsxRuntimeExports.jsx(o.DialogContent,{children:e.jsxRuntimeExports.jsx(ye,{item:d,editMode:i,appliedBindings:n,onAddBinding:p=>{s(p),x(!1)}})})]})},be=({item:r,onAddBinding:l,onRemove:s,selectedBlock:n,dataProvider:i,appliedBindings:d})=>{const[a,x]=g.useState("string"),p=(m,b)=>{if(t.isEmpty(m))return"";{const c=t.get(b==="PROP"?n:i,m,"");if(t.isArray(c))return"list";const f=typeof c;return f==="string"?"text":f==="object"?"model":f}};return g.useEffect(()=>x(()=>p(r.key,"PROP")),[r.key]),e.jsxRuntimeExports.jsxs("div",{className:"relative flex flex-col rounded-md border border-gray-200 p-2",children:[e.jsxRuntimeExports.jsx("div",{className:"text-sm font-normal text-gray-500",children:r.key}),e.jsxRuntimeExports.jsx("div",{className:"font-medium leading-5",children:r.value}),e.jsxRuntimeExports.jsx(U,{data:t.get(i,r.value,"")}),e.jsxRuntimeExports.jsxs("div",{className:"flex items-center justify-end gap-x-2",children:[e.jsxRuntimeExports.jsx(re,{editMode:!0,onAddBinding:l,appliedBindings:d,item:r,children:e.jsxRuntimeExports.jsx(F.EditIcon,{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"})}),e.jsxRuntimeExports.jsx(F.TrashIcon,{onClick:()=>s(),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"})]}),!t.isEmpty(a)&&!t.isEmpty(r.key)&&e.jsxRuntimeExports.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:t.startCase(a)})]})},fe=({bindingData:r,onChange:l})=>{const s=o.useSelectedBlock(),[n]=W.useChaiExternalData(),i=$.getChaiDataProviders(),[d,a]=g.useState(t.map(r,(c,f)=>({key:f,value:c})));g.useEffect(()=>{a(t.map(r,(c,f)=>({key:f,value:c})))},[s==null?void 0:s._id,r]);const x=g.useMemo(()=>{if(t.isEmpty(n))return!0;if(t.isEmpty(d))return!1;const c=t.last(d);return t.isEmpty(c==null?void 0:c.key)||t.isEmpty(c==null?void 0:c.value)},[n,d]),p=c=>{const f=t.filter(d,y=>y.key!==c.key);a([...f,c]),b([...f,c])},m=c=>{const f=t.filter(d,(y,h)=>c!==h);b([...f])},b=g.useCallback((c=[])=>{if(a(c),t.isEmpty(c)){l({});return}const f={};t.forEach(c,y=>{!t.isEmpty(y==null?void 0:y.key)&&!t.isEmpty(y==null?void 0:y.value)&&t.set(f,y.key,y.value)}),l(f)},[l]);return t.isEmpty(i)?e.jsxRuntimeExports.jsx("div",{className:"flex w-full items-center justify-center",children:e.jsxRuntimeExports.jsxs("p",{className:"mb-1.5 text-xs text-gray-500",children:["You have no data providers registered. Please add a data provider to your project. ",e.jsxRuntimeExports.jsx("br",{}),e.jsxRuntimeExports.jsx("a",{className:"text-blue-500",href:"https://chaibuilder.com/docs/registering-data-providers",target:"_blank",children:"Learn more"})]})}):e.jsxRuntimeExports.jsxs("div",{className:"space-y-2",children:[t.map(d,(c,f)=>e.jsxRuntimeExports.jsx(be,{item:c,onAddBinding:p,onRemove:()=>m(f),selectedBlock:s,dataProvider:n,appliedBindings:t.map(d,"key")},c.key)),e.jsxRuntimeExports.jsxs(o.Tooltip,{delayDuration:200,children:[e.jsxRuntimeExports.jsx(o.TooltipTrigger,{disabled:t.isEmpty(n),className:"w-full",children:e.jsxRuntimeExports.jsx(re,{disabled:x,appliedBindings:t.map(d,"key"),onAddBinding:p,children:e.jsxRuntimeExports.jsx("span",{className:`w-full rounded-md px-5 py-1.5 text-xs font-medium duration-200 ${x?"cursor-not-allowed bg-gray-200 text-gray-400":"bg-blue-700/20 text-blue-800 hover:bg-blue-700/30"}`,children:t.isEmpty(n)?e.jsxRuntimeExports.jsx("small",{className:"text-[9.5px] text-gray-500",children:"No data provider has been set up for this page"}):"+ Add Data Binding"})})}),x&&e.jsxRuntimeExports.jsx(o.TooltipContent,{sideOffset:-55,className:"text-[11px]",children:t.isEmpty(n)?"No data provider has been set up for this page.":"Complete last added data binding to add more"})]})]})},je=()=>e.jsxRuntimeExports.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"}),Y=g.memo(({properties:r,formData:l,onChange:s})=>{const n={type:"object",properties:{}},i={};return Object.keys(r).forEach(d=>{const a=r[d];if(t.includes(["slot","styles"],a.type))return;const x=d;n.properties[x]=o.getBlockJSONFromSchemas(a),i[x]=o.getBlockJSONFromUISchemas(a)}),e.jsxRuntimeExports.jsx(ue,{widgets:{binding:je,richtext:o.RichTextEditorField,icon:o.IconPickerField,image:o.ImagePickerField},fields:{link:o.LinkField},idSeparator:".",autoComplete:"off",omitExtraData:!1,liveOmit:!1,liveValidate:!1,validator:de,uiSchema:i,schema:n,formData:l,onChange:s})});function ve(){const r=o.useSelectedBlock(),l=o.useUpdateBlocksPropsRealtime(),s=o.useUpdateBlocksProps(),n=$.getBlockComponent(r._type),i={...r},[d,a]=g.useState(i),x=o.useBuilderProp("dataBindingSupport",!1),p=({formData:h},v,E)=>{if(v){const T=v.replace("root.","");s([r._id],{[T]:t.get(h,T)},E)}},m=g.useCallback(t.debounce(({formData:h},v,E)=>{p({formData:h},v,E),a(h)},1500),[]),b=({formData:h},v)=>{if(v){const E=v.replace("root.","");l([r._id],{[E]:t.get(h,E)}),m({formData:h},v,{[E]:t.get(d,E)})}},c={_name:pe.u({title:"Name",default:t.get(r,"_name",r._type)})},f=t.keys(t.get(i,"_bindings",{})),y=g.useMemo(()=>{const h=t.cloneDeep(t.get(n,"props",{}));return x&&t.each(f,v=>delete h[v]),h},[n,f,x]);return e.jsxRuntimeExports.jsxs("div",{className:"overflow-x-hidden",children:[e.jsxRuntimeExports.jsx(Y,{onChange:b,formData:i,properties:c}),e.jsxRuntimeExports.jsx("hr",{className:"mt-4"}),x?e.jsxRuntimeExports.jsxs(o.Accordion,{type:"multiple",defaultValue:["STATIC","BINDING"],className:"h-full w-full",children:[e.jsxRuntimeExports.jsxs(o.AccordionItem,{value:"BINDING",children:[e.jsxRuntimeExports.jsx(o.AccordionTrigger,{className:"bg-gray-100 px-3 py-2 text-xs hover:no-underline",children:e.jsxRuntimeExports.jsxs("div",{className:"flex items-center gap-x-2",children:[e.jsxRuntimeExports.jsx("div",{className:`h-[8px] w-[8px] rounded-full ${t.isEmpty(t.get(r,"_bindings",{}))?"bg-gray-300":"bg-blue-500"}`}),"Data Binding"]})}),e.jsxRuntimeExports.jsx(o.AccordionContent,{className:"px-4 pt-4",children:e.jsxRuntimeExports.jsx(fe,{bindingData:t.get(r,"_bindings",{}),onChange:h=>{p({formData:{_bindings:h}},"root._bindings")}})})]}),e.jsxRuntimeExports.jsxs(o.AccordionItem,{value:"STATIC",children:[e.jsxRuntimeExports.jsx(o.AccordionTrigger,{className:"bg-gray-100 px-3 py-2 text-xs hover:no-underline",children:e.jsxRuntimeExports.jsxs("div",{className:"flex items-center gap-x-2",children:[e.jsxRuntimeExports.jsx("div",{className:"h-[8px] w-[8px] rounded-full bg-blue-500"}),"Static Content"]})}),e.jsxRuntimeExports.jsxs(o.AccordionContent,{className:"pt-4",children:[t.isEmpty(f)?null:e.jsxRuntimeExports.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:["Data binding is set for ",e.jsxRuntimeExports.jsx("b",{children:t.map(f,t.capitalize).join(", ")})," ",f.length===1?"property":"properties",". Remove data binding to edit static content."]}),e.jsxRuntimeExports.jsx(Y,{onChange:b,formData:i,properties:y})]})]})]}):e.jsxRuntimeExports.jsx(Y,{onChange:b,formData:i,properties:y}),e.jsxRuntimeExports.jsx("div",{className:"pb-60"})]})}const Q=new xe(D.ALL_TW_CLASSES,{isCaseSensitive:!1,threshold:.2,minMatchCharLength:2,keys:["name"]});function Re(){var T;const[r]=o.useSelectedStylingBlocks(),l=o.useSelectedBlock(),s=o.useAddClassesToBlocks(),n=o.useRemoveClassesFromBlocks(),[i]=o.useSelectedBlockIds(),[d,a]=g.useState(""),x=(T=t.first(r))==null?void 0:T.prop,p=t.reject((t.get(l,x,"").replace(me.STYLES_KEY,"").split(",").pop()||"").split(" "),t.isEmpty),m=()=>{const w=d.trim().toLowerCase().replace(/ +(?= )/g,"").split(" ");s(i,w,!0),a("")},[b,c]=g.useState([]),f=({value:w})=>{const _=w.trim().toLowerCase(),B=_.match(/.+:/g);let C=[];if(B&&B.length>0){const[I]=B,V=_.replace(I,"");C=Q.search(V).map(j=>({...j,item:{...j.item,name:I+j.item.name}}))}else C=Q.search(_);c(t.map(C,"item"))},y=()=>{c([])},h=w=>w.name,v=w=>e.jsxRuntimeExports.jsx("div",{className:"rounded-md p-1",children:w.name}),E={autoComplete:"off",autoCorrect:"off",autoCapitalize:"off",spellCheck:!1,placeholder:"Enter class name",value:d,onKeyDown:w=>{w.key==="Enter"&&d.trim()!==""&&m()},onChange:(w,{newValue:_})=>a(_),className:"w-full rounded-md text-xs px-2 hover:outline-0 bg-background border-border py-1"};return e.jsxRuntimeExports.jsxs("div",{className:`no-scrollbar flex ${b.length>0?"min-h-[300px]":"min-h-max"} w-full flex-col gap-y-5 overflow-y-auto bg-gray-100 px-px`,children:[e.jsxRuntimeExports.jsx(o.Label,{className:"mt-2",children:"Add Tailwind classes"}),e.jsxRuntimeExports.jsxs("div",{className:"relative -mt-4 flex items-center gap-x-3",children:[e.jsxRuntimeExports.jsx("div",{className:"relative flex w-full items-center gap-x-3",children:e.jsxRuntimeExports.jsx(ce,{suggestions:b,onSuggestionsFetchRequested:f,onSuggestionsClearRequested:y,getSuggestionValue:h,renderSuggestion:v,inputProps:E,containerProps:{className:"relative h-8 w-full gap-y-1 py-1 border-gray-600"},theme:{suggestion:"bg-transparent",suggestionHighlighted:"bg-gray-700 ",suggestionsContainerOpen:"absolute bg-gray-100 z-50 max-h-[230px] overflow-y-auto w-full border border-gray-600 rounded-md"}})}),e.jsxRuntimeExports.jsx(o.Button,{variant:"outline",className:"h-6 border-gray-700",onClick:m,disabled:d.trim()==="",size:"sm",children:e.jsxRuntimeExports.jsx(u.PlusIcon,{})})]}),e.jsxRuntimeExports.jsxs("div",{className:"flex w-full flex-wrap gap-2",children:[t.isEmpty(p)&&e.jsxRuntimeExports.jsx("div",{className:"flex h-10 w-full items-center justify-center text-center text-sm text-gray-400",children:"No class added"}),O.Children.toArray(p.map(w=>e.jsxRuntimeExports.jsxs("div",{className:"group relative flex cursor-default items-center gap-x-1 rounded-full border border-blue-600 bg-blue-500 p-px px-1.5 text-[11px] text-white hover:border-blue-900",children:[w,e.jsxRuntimeExports.jsx(u.Cross2Icon,{onClick:()=>n(i,[w]),className:"invisible absolute right-1 hover:text-white group-hover:visible group-hover:cursor-pointer"})]},w)))]})]})}const S=["px","%","em","rem","ch","vh","vw"],Ee={heading:"flex.heading",items:[{type:"arbitrary",label:"flex.basis",units:S,property:"flexBasis"},{type:"range",label:"flex.order",property:"order"},{type:"dropdown",label:"flex.flex",property:"flexGrowShrink"},{type:"dropdown",label:"flex.grow",property:"flexGrow"},{type:"dropdown",label:"flex.shrink",property:"flexShrink"}]},we={heading:"grid.heading",items:[{type:"range",label:"grid.col_span",property:"gridColSpan"},{type:"range",label:"grid.col_start",property:"gridColStart"},{type:"range",label:"grid.col_end",property:"gridColEnd"},{type:"range",label:"grid.row_span",property:"gridRowSpan"},{type:"range",label:"grid.row_start",property:"gridRowStart"},{type:"range",label:"grid.row_end",property:"gridRowEnd"},{type:"range",label:"grid.order",property:"order"}]},Ce=[{heading:"layout.heading",items:[{type:"arbitrary",label:"layout.width",units:S.concat("auto"),property:"width"},{type:"arbitrary",label:"layout.height",units:S.concat("auto"),property:"height"},{styleType:"multiple",label:"layout.margin",negative:!0,units:[...S,"auto"],options:[{key:"margin",label:"layout.margin_all"},{key:"marginX",label:"layout.margin_lr"},{key:"marginY",label:"layout.margin_tb"},{key:"marginTop",label:"layout.margin_top"},{key:"marginRight",label:"layout.margin_right"},{key:"marginBottom",label:"layout.margin_bottom"},{key:"marginLeft",label:"layout.margin_left"}]},{styleType:"multiple",label:"layout.padding",options:[{key:"padding",label:"layout.padding_all"},{key:"paddingX",label:"layout.padding_lr"},{key:"paddingY",label:"layout.padding_tb"},{key:"paddingTop",label:"layout.padding_top"},{key:"paddingRight",label:"layout.padding_right"},{key:"paddingBottom",label:"layout.padding_bottom"},{key:"paddingLeft",label:"layout.padding_left"}]},{styleType:"multiple",label:"layout.space_bt",options:[{key:"spaceX",label:"layout.space_lr"},{key:"spaceY",label:"layout.space_tb"}]}]},{heading:"size.heading",items:[{styleType:"accordion",heading:"size.min_width_height",items:[{type:"arbitrary",label:"size.min_width",units:S.concat("auto"),property:"minWidth"},{type:"arbitrary",label:"size.min_height",units:S.concat("auto"),property:"minHeight"}]},{styleType:"accordion",heading:"size.max_width_height",items:[{type:"arbitrary",label:"size.max_width",units:S.concat("auto"),property:"maxWidth"},{type:"arbitrary",label:"size.max_height",units:S.concat("auto"),property:"maxHeight"}]},{styleType:"accordion",heading:"size.object_options_aspect_ratio",items:[{type:"dropdown",label:"size.aspect",property:"aspectRatio"},{type:"dropdown",label:"size.fit",property:"objectFit"},{type:"dropdown",label:"size.position",property:"objectPosition"}]}]},{heading:"display.heading",items:[{type:"dropdown",label:"display.display",property:"display",units:S},{styleType:"accordion",heading:"display.flex_options",items:[{type:"dropdown",label:"display.flex_direction",property:"flexDirection"},{type:"dropdown",label:"display.flex_wrap",property:"flexWrap"},{type:"dropdown",label:"display.justify_content",property:"justifyContent"},{type:"dropdown",label:"display.align_content",property:"alignContent"},{type:"dropdown",label:"display.align_items",property:"alignItems"},{styleType:"multiple",label:"display.gap",options:[{key:"gap",label:"display.gap_all"},{key:"gapX",label:"display.gap_lr"},{key:"gapY",label:"display.gap_tb"}]}],conditions:{display:"flex"}},{styleType:"accordion",heading:"display.grid_options",items:[{type:"range",label:"display.grid_columns",property:"gridColumns"},{type:"range",label:"display.grid_rows",property:"gridRows"},{type:"dropdown",label:"display.grid_auto_flow",property:"gridAutoFlow"},{type:"dropdown",label:"display.grid_auto_cols",property:"gridAutoColumns"},{type:"dropdown",label:"display.grid_auto_rows",property:"gridAutoRows"},{type:"dropdown",label:"display.justify_content",property:"justifyContent"},{type:"dropdown",label:"display.align_content",property:"alignContent"},{type:"dropdown",label:"display.align_items",property:"alignItems"},{styleType:"multiple",label:"display.gap",units:["px","rem"],options:[{key:"gap",label:"display.gap_all"},{key:"gapX",label:"display.gap_lr"},{key:"gapY",label:"display.gap_tb"}]}],conditions:{display:"grid"}},{styleType:"accordion",heading:"display.visibility_opacity",items:[{type:"dropdown",label:"display.visibility",property:"visibility",units:S},{type:"arbitrary",label:"display.opacity",property:"opacity",units:["-"]}]}]},{heading:"position.heading",items:[{type:"icons",label:"position.position",property:"position"},{styleType:"accordion",heading:"position.options",items:[{styleType:"multiple",label:"position.direction",options:[{key:"top",label:"position.top"},{key:"right",label:"position.right"},{key:"bottom",label:"position.bottom"},{key:"left",label:"position.left"}]},{styleType:"multiple",label:"position.inset",options:[{key:"inset",label:"position.all"},{key:"insetX",label:"position.lr"},{key:"insetY",label:"position.tb"}]},{type:"arbitrary",label:"position.z_index",units:["-","auto"],property:"zIndex"}]},{styleType:"accordion",heading:"position.float_clear",items:[{type:"icons",label:"position.float",property:"float"},{type:"dropdown",label:"position.clear",property:"clear"}]},{styleType:"accordion",heading:"position.overflow_overscroll",items:[{styleType:"multiple",type:"dropdown",label:"position.overflow",options:[{key:"overflow",label:"position.all"},{key:"overflowX",label:"position.lr"},{key:"overflowY",label:"position.tb"}]},{styleType:"multiple",type:"dropdown",label:"position.overscroll",options:[{key:"overscroll",label:"position.all"},{key:"overscrollX",label:"position.lr"},{key:"overscrollY",label:"position.tb"}]}]}]},{heading:"typography.heading",items:[{type:"dropdown",property:"fontFamily",label:"typography.font"},{type:"arbitrary",property:"fontSize",label:"typography.size",units:S},{type:"arbitrary",property:"lineHeight",label:"typography.height",units:S.concat("-")},{type:"range",property:"fontWeight",label:"typography.weight"},{type:"color",property:"textColor",label:"typography.color"},{styleType:"accordion",heading:"typography.alignments",items:[{type:"dropdown",property:"textAlign",label:"typography.align"},{type:"dropdown",property:"verticalAlign",label:"typography.valign"}]},{styleType:"accordion",heading:"typography.spacing_decoration_more",items:[{type:"dropdown",property:"letterSpacing",label:"typography.spacing"},{type:"dropdown",property:"textDecoration",label:"typography.decoration"},{type:"range",property:"textDecorationThickness",label:"typography.thickness"},{type:"dropdown",property:"textTransform",label:"typography.transform"}]},{styleType:"accordion",heading:"typography.whitespace_breaks",items:[{type:"dropdown",property:"whitespace",label:"typography.whitespace"},{type:"dropdown",property:"wordbreak",label:"typography.wordbreak"}]}]},{heading:"background.heading",items:[{type:"color",label:"background.bgcolor",property:"backgroundColor"},{styleType:"accordion",heading:"background.position_size_more",items:[{type:"dropdown",label:"background.attachment",property:"backgroundAttachment"},{type:"dropdown",label:"background.clipping",property:"backgroundClip"},{type:"dropdown",label:"background.origin",property:"backgroundOrigin"},{type:"dropdown",label:"background.position",property:"backgroundPosition"},{type:"dropdown",label:"background.repeat",property:"backgroundRepeat"},{type:"dropdown",label:"background.size",property:"backgroundSize"}]},{type:"dropdown",label:"background.gradient",property:"backgroundGradient"},{styleType:"accordion",heading:"background.gradient_colors",items:[{type:"color",label:"background.from_color",property:"fromColor"},{type:"color",label:"background.via_color",property:"viaColor"},{type:"color",label:"background.to_color",property:"toColor"}]}]},{heading:"border.heading",items:[{styleType:"multiple",type:"dropdown",label:"border.width",options:[{key:"border",label:"border.all"},{key:"borderX",label:"border.lr"},{key:"borderY",label:"border.tb"},{key:"borderTop",label:"border.top"},{key:"borderRight",label:"border.right"},{key:"borderBottom",label:"border.bottom"},{key:"borderLeft",label:"border.left"}]},{styleType:"multiple",type:"dropdown",label:"border.corners",options:[{key:"borderRadius",label:"border.all"},{key:"borderRadiusTop",label:"border.top"},{key:"borderRadiusRight",label:"border.right"},{key:"borderRadiusBottom",label:"border.bottom"},{key:"borderRadiusLeft",label:"border.left"},{key:"borderRadiusTopLeft",label:"border.top_left"},{key:"borderRadiusTopRight",label:"border.top_right"},{key:"borderRadiusBottomRight",label:"border.bottom_right"},{key:"borderRadiusBottomLeft",label:"border.bottom_left"}]},{type:"color",label:"border.color",property:"borderColor"},{type:"dropdown",label:"border.style",property:"borderStyle"},{styleType:"accordion",heading:"border.divide_options",items:[{styleType:"multiple",type:"range",label:"border.width",options:[{key:"divideXWidth",label:"border.lr"},{key:"divideYWidth",label:"border.tb"}]},{type:"color",label:"border.divide_color",property:"divideColor"},{type:"dropdown",label:"border.divide_style",property:"divideStyle"}]},{styleType:"accordion",heading:"border.outline_styling",items:[{type:"range",label:"border.outline_width",property:"outlineWidth"},{type:"range",label:"border.outline_offset",property:"outlineOffset"},{type:"dropdown",label:"border.outline_style",property:"outlineStyle"}]},{styleType:"accordion",heading:"border.ring_options",items:[{type:"range",label:"border.ring_width",property:"ringWidth"},{type:"color",label:"border.ring_color",property:"ringColor"},{type:"range",label:"border.ring_offset_width",property:"ringOffsetWidth"},{type:"color",label:"border.ring_offset_color",property:"ringOffsetColor"}]}]},{heading:"effect.heading",items:[{type:"range",label:"effect.shadow",property:"boxShadow"},{type:"color",label:"effect.color",property:"boxShadowColor"},{type:"dropdown",label:"effect.cursor",property:"cursor"},{styleType:"accordion",heading:"effect.blend_cursor",items:[{type:"dropdown",label:"effect.mix_blend",property:"mixBlendMode"},{type:"dropdown",label:"effect.bg_blend",property:"bgBlendMode"}]},{styleType:"accordion",heading:"effect.transform",items:[{type:"dropdown",label:"effect.origin",property:"transformOrigin"},{styleType:"multiple",label:"effect.scale",units:["-"],options:[{key:"scale",label:"effect.all"},{key:"scaleX",label:"effect.lr"},{key:"scaleY",label:"effect.tb"}]},{styleType:"multiple",label:"effect.skew",units:["deg"],options:[{key:"skewX",label:"effect.lr"},{key:"skewY",label:"effect.tb"}]},{styleType:"multiple",label:"effect.translate",negative:!0,options:[{key:"translateX",label:"effect.lr"},{key:"translateY",label:"effect.tb"}]},{type:"arbitrary",units:["deg"],negative:!0,label:"effect.rotate",property:"rotate"}]},{styleType:"accordion",heading:"effect.animation",items:[{type:"dropdown",label:"effect.animation",property:"animation"},{type:"dropdown",label:"effect.transition",property:"transition"},{type:"dropdown",label:"effect.easing",property:"transitionEase"},{type:"arbitrary",units:["ms"],label:"effect.duration",property:"duration"},{type:"arbitrary",units:["ms"],label:"effect.delay",property:"delay"}]}]},{heading:"classes.heading",items:[{component:Re}]}],oe={"not-italic":()=>e.jsxRuntimeExports.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.jsxRuntimeExports.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9 3H11V5H9V11H11V13H5V11H7V5H5V3H9Z",fill:"white"})}),visible:u.EyeOpenIcon,invisible:u.EyeClosedIcon,hidden:u.EyeClosedIcon,gap:u.BorderAllIcon,gapX:u.WidthIcon,gapY:u.HeightIcon,spaceX:u.WidthIcon,spaceY:u.HeightIcon,overscroll:u.BorderAllIcon,overscrollX:u.WidthIcon,overscrollY:u.HeightIcon,overflow:u.BorderAllIcon,overflowX:u.WidthIcon,overflowY:u.HeightIcon,top:u.ArrowUpIcon,right:u.ArrowRightIcon,bottom:u.ArrowDownIcon,left:u.ArrowLeftIcon,inset:u.BorderAllIcon,insetX:u.WidthIcon,insetY:u.HeightIcon,border:u.BorderAllIcon,borderX:u.WidthIcon,borderY:u.HeightIcon,borderTop:u.ArrowUpIcon,borderRight:u.ArrowRightIcon,borderBottom:u.ArrowDownIcon,borderLeft:u.ArrowLeftIcon,borderRadius:u.BorderAllIcon,borderRadiusX:u.WidthIcon,borderRadiusY:u.HeightIcon,borderRadiusTop:u.ArrowUpIcon,borderRadiusRight:u.ArrowRightIcon,borderRadiusBottom:u.ArrowDownIcon,borderRadiusLeft:u.ArrowLeftIcon,borderRadiusTopLeft:u.ArrowTopLeftIcon,borderRadiusTopRight:u.ArrowTopRightIcon,borderRadiusBottomRight:u.ArrowBottomRightIcon,borderRadiusBottomLeft:u.ArrowBottomLeftIcon,divideXWidth:u.WidthIcon,divideYWidth:u.HeightIcon,scale:u.BorderAllIcon,scaleX:u.WidthIcon,scaleY:u.HeightIcon,skewX:u.WidthIcon,skewY:u.HeightIcon,translateX:u.WidthIcon,translateY:u.HeightIcon,padding:u.BorderAllIcon,paddingX:u.WidthIcon,paddingY:u.HeightIcon,paddingTop:u.ArrowUpIcon,paddingRight:u.ArrowRightIcon,paddingBottom:u.ArrowDownIcon,paddingLeft:u.ArrowLeftIcon,margin:u.BorderAllIcon,marginX:u.WidthIcon,marginY:u.HeightIcon,marginTop:u.ArrowUpIcon,marginRight:u.ArrowRightIcon,marginBottom:u.ArrowDownIcon,marginLeft:u.ArrowLeftIcon,textLeft:u.AlignLeftIcon,textCenter:u.AlignCenterHorizontallyIcon,textRight:u.AlignRightIcon,textJustify:u.StretchHorizontallyIcon,italic:u.FontItalicIcon,underline:u.UnderlineIcon,overline:u.OverlineIcon,uppercase:u.LetterCaseUppercaseIcon,block:()=>e.jsxRuntimeExports.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[e.jsxRuntimeExports.jsx("path",{opacity:"0.6",fillRule:"evenodd",clipRule:"evenodd",d:"M2 2H14V14H2V2ZM1 1H15V15H1V1Z",fill:"currentColor"}),e.jsxRuntimeExports.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7 4H4V12H7V4ZM9 4H12V12H9V4Z",fill:"currentColor"})]}),"float-right":()=>e.jsxRuntimeExports.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[e.jsxRuntimeExports.jsx("path",{d:"M8 4H16V12H8V4Z",fill:"currentColor"}),e.jsxRuntimeExports.jsx("path",{opacity:"0.6",fillRule:"evenodd",clipRule:"evenodd",d:"M0 4H6V6H0V4ZM0 7H6V9H0V7ZM4 10H0V12H4V10Z",fill:"currentColor"})]}),"float-left":()=>e.jsxRuntimeExports.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[e.jsxRuntimeExports.jsx("path",{d:"M0 4H8V12H0V4Z",fill:"currentColor"}),e.jsxRuntimeExports.jsx("path",{opacity:"0.6",fillRule:"evenodd",clipRule:"evenodd",d:"M10 4H16V6H10V4ZM10 7H16V9H10V7ZM14 10H10V12H14V10Z",fill:"currentColor"})]}),"float-none":u.Cross2Icon,fixed:()=>e.jsxRuntimeExports.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[e.jsxRuntimeExports.jsx("path",{opacity:"0.6",fillRule:"evenodd",clipRule:"evenodd",d:"M15 2H14V4H13V5H14V6H15V2ZM10 5V4H9V2H1V8H2V5H10ZM7 4V3H5V4H7ZM4 4V3H2V4H4ZM1 13H7V14H1V13Z",fill:"currentColor"}),e.jsxRuntimeExports.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M11 2H10V3H11V6H12V3H13V2H11ZM2 9H1V12H2V11H7V10H2V9ZM15 7H8V14H15V7Z",fill:"currentColor"})]}),absolute:()=>e.jsxRuntimeExports.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[e.jsxRuntimeExports.jsx("path",{opacity:"0.6",fillRule:"evenodd",clipRule:"evenodd",d:"M14 2H15V6H14V2ZM9 3V2H1V8H2V3H9ZM7 13H1V14H7V13Z",fill:"currentColor"}),e.jsxRuntimeExports.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M11 2H10V3H11V6H12V3H13V2H11ZM2 9H1V12H2V11H7V10H2V9ZM15 7H8V14H15V7Z",fill:"currentColor"})]}),relative:()=>e.jsxRuntimeExports.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.jsxRuntimeExports.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M11 2H9V3H11V6H12V3H14V2H11ZM2 8H1V13H2V11H7V10H2V8ZM15 7H8V14H15V7Z",fill:"currentColor"})}),sticky:()=>e.jsxRuntimeExports.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[e.jsxRuntimeExports.jsx("path",{d:"M12.9998 7C13.6558 7 14.2937 6.78498 14.8158 6.38787C15.338 5.99076 15.7156 5.43345 15.8908 4.80128C16.066 4.16912 16.0292 3.49694 15.7859 2.8877C15.5427 2.27846 15.1065 1.76573 14.5441 1.42804C13.9817 1.09034 13.3241 0.946293 12.672 1.01795C12.02 1.08961 11.4094 1.37303 10.9337 1.8248C10.4581 2.27658 10.1436 2.8718 10.0385 3.51932C9.93341 4.16685 10.0434 4.83097 10.3518 5.41L6.88176 8.88C6.80034 8.96122 6.73572 9.05769 6.69158 9.16388C6.64744 9.27008 6.62465 9.38393 6.62451 9.49894C6.62437 9.61395 6.64689 9.72785 6.69077 9.83416C6.73465 9.94046 6.79904 10.0371 6.88026 10.1185C6.96149 10.1999 7.05795 10.2645 7.16415 10.3087C7.27035 10.3528 7.3842 10.3756 7.4992 10.3758C7.61421 10.3759 7.72812 10.3534 7.83442 10.3095C7.94072 10.2656 8.03734 10.2012 8.11876 10.12L11.5888 6.648C12.0088 6.873 12.4888 7 12.9988 7H12.9998Z",fill:"currentColor"}),e.jsxRuntimeExports.jsx("path",{opacity:"0.6",fillRule:"evenodd",clipRule:"evenodd",d:"M9.535 2H1V14H15V7.465C14.69 7.645 14.355 7.783 14 7.875V13H2V5H9.126C8.86504 3.98486 9.01223 2.90789 9.536 2H9.535ZM7 3V4H5V3H7ZM4 3V4H2V3H4Z",fill:"currentColor"})]}),static:u.Cross1Icon},L=g.createContext({canReset:!1,canChange:!0}),ke=({children:r,canReset:l=!1,canChange:s=!0})=>e.jsxRuntimeExports.jsx(L.Provider,{value:{canReset:l,canChange:s},children:r}),ne=({label:r,property:l,onChange:s})=>{const n=g.useMemo(()=>t.get(D.CLASSES_LIST,`${l}.classes`,[""]),[l]),i=q(l),d=g.useMemo(()=>t.get(i,"cls",""),[i]),{canChange:a}=g.useContext(L),x=/\[.*\]/g.test(d);return e.jsxRuntimeExports.jsx("div",{className:r?"w-full rounded":"grow",children:x?e.jsxRuntimeExports.jsxs("div",{className:"flex items-center",children:[e.jsxRuntimeExports.jsx(o.Input,{className:"w-[70%] rounded py-1",readOnly:!0,value:d}),e.jsxRuntimeExports.jsxs(o.Tooltip,{delayDuration:100,children:[e.jsxRuntimeExports.jsx(o.TooltipTrigger,{asChild:!0,children:e.jsxRuntimeExports.jsx("button",{type:"button",className:"invisible ml-3 mt-1 text-blue-600 group-hover:visible",children:e.jsxRuntimeExports.jsx(u.InfoCircledIcon,{})})}),e.jsxRuntimeExports.jsx(o.TooltipContent,{children:"Current value is using a Tailwind arbitrary value."})]})]}):e.jsxRuntimeExports.jsx(G,{rounded:r,onChange:p=>s(p,l),selected:d,options:n,disabled:!a})})};function G({selected:r,onChange:l,rounded:s=!1,options:n,disabled:i=!1}){const d=r.replace(/.*:/g,"").trim(),{undo:a,redo:x}=o.useUndoManager();return e.jsxRuntimeExports.jsxs("select",{disabled:!n.length||i,className:`${s?"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`,onChange:p=>l(p.target.value),onKeyDown:p=>{p.ctrlKey&&(p.key==="z"&&a(),p.key==="y"&&x())},value:d,children:[e.jsxRuntimeExports.jsx("option",{className:"bg-transparent",value:""}),g.Children.toArray(n.map(p=>e.jsxRuntimeExports.jsx("option",{className:"bg-transparent",value:p,children:p})))]})}const Ne=({property:r,onChange:l})=>{const{canReset:s,canChange:n}=g.useContext(L),i=q(r),d=g.useMemo(()=>t.get(i,"cls",""),[i]),a=g.useMemo(()=>t.get(D.CLASSES_LIST,`${r}.classes`,[""]),[r]),x=a.indexOf(d)>-1?a.indexOf(d):0,p=/\[.*\]/g.test(d);return e.jsxRuntimeExports.jsx("div",{className:"flex flex-row divide-x divide-solid divide-border rounded border border-border text-xs",children:p?e.jsxRuntimeExports.jsx("div",{className:"py-[5px] px-2",children:d}):e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx("button",{type:"button",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",disabled:!n&&(!s||x-1<0),onClick:()=>l(t.nth(a,x-1),r),children:e.jsxRuntimeExports.jsx("span",{className:"flex items-center justify-center",children:e.jsxRuntimeExports.jsx(u.MinusIcon,{className:!n&&(!s||x-1<0)?"text-gray-500":"text-black/60 dark:text-white/60"})})}),e.jsxRuntimeExports.jsx("div",{className:"w-8/12 text-center",children:e.jsxRuntimeExports.jsx(ne,{label:!1,property:r,onChange:l})}),e.jsxRuntimeExports.jsx("button",{type:"button",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",disabled:!n&&(!s||x+1>=a.length),onClick:()=>l(t.nth(a,x+1),r),children:e.jsxRuntimeExports.jsx("span",{className:"flex items-center justify-center",children:e.jsxRuntimeExports.jsx(u.PlusIcon,{className:!n&&(!s||x+1>=a.length)?"text-gray-500":"text-black/60 dark:text-white/60"})})})]})})},Se=({property:r,onChange:l})=>{const s=g.useMemo(()=>t.get(D.CLASSES_LIST,`${r}.classes`,[""]),[r]),{canChange:n}=g.useContext(L),i=q(r),d=g.useMemo(()=>t.get(i,"cls",""),[i]);return e.jsxRuntimeExports.jsx("div",{className:"flex grow flex-wrap gap-1",children:t.map(s,a=>e.jsxRuntimeExports.jsxs(o.Tooltip,{children:[e.jsxRuntimeExports.jsx(o.TooltipTrigger,{asChild:!0,children:e.jsxRuntimeExports.jsx("button",{type:"button",disabled:!n,onClick:()=>l(a,r),className:`cursor-pointer rounded border border-gray-600 p-1 disabled:cursor-not-allowed ${d===a?" bg-blue-500 text-white":"disabled:bg-gray-600 disabled:text-gray-400"}`,children:g.createElement(t.get(oe,a,u.BoxIcon))})}),e.jsxRuntimeExports.jsx(o.TooltipContent,{children:t.startCase(t.toLower(a))})]}))})},Te={backgroundColor:"bg",textColor:"text",borderColor:"border",boxShadowColor:"shadow",outlineColor:"outline",divideColor:"divide",fromColor:"from",viaColor:"via",toColor:"to",ringColor:"ring",ringOffsetColor:"ring-offset"},Ie=({property:r,onChange:l})=>{const s=q(r),n=g.useMemo(()=>t.get(s,"cls",""),[s]),{canChange:i}=g.useContext(L),[d,a]=g.useState([]),[x,p]=g.useState({color:"",shade:""}),m=n.split("-"),b=t.get(m,"1",""),c=t.get(m,"2",""),f=g.useCallback(h=>{["current","inherit","transparent","black","white"].includes(h)?(a([]),p({color:h})):(a(["50","100","200","300","400","500","600","700","800","900"]),p(v=>({...v,color:h,shade:v.shade?v.shade:"500"})))},[a,p]);g.useEffect(()=>{if(["current","inherit","transparent","black","white"].includes(b))return a([]);a(["50","100","200","300","400","500","600","700","800","900"])},[b]);const y=g.useCallback(h=>{p({color:b,shade:h})},[b]);return g.useEffect(()=>{p({color:"",shade:""})},[s]),g.useEffect(()=>{const v=`${t.get(Te,r,"")}-${x.color}${x.shade?`-${x.shade}`:""}`;v.match(new RegExp(t.get(D.CLASSES_LIST,`${r}.regExp`,"")))&&l(v,r)},[x,l,r]),e.jsxRuntimeExports.jsxs("div",{className:"flex flex-row divide-x divide-solid divide-border rounded-lg border border-border text-xs",children:[e.jsxRuntimeExports.jsx("div",{className:"grow text-center",children:e.jsxRuntimeExports.jsx(G,{disabled:!i,rounded:!0,selected:b,onChange:f,options:["current","transparent","primary","secondary","black","white","slate","gray","zinc","neutral","stone","red","orange","amber","yellow","lime","green","emerald","teal","cyan","sky","blue","indigo","violet","purple","fuchsia","pink","rose"]})}),e.jsxRuntimeExports.jsx("button",{type:"button",className:"grow text-center",children:e.jsxRuntimeExports.jsx(G,{rounded:!0,selected:c,disabled:!b||!i,onChange:y,options:d})})]})},ee=(r,l)=>{r=r.toLowerCase();let s=r.trim().replace(/ |\+/g,"");if((s==="auto"||s==="none")&&l.includes(s))return{value:"",unit:s};const n=l.length?new RegExp(l.join("|"),"g"):/XXXXXX/g;s=s.replace(n,"");const i=r.match(n),d=i&&i.length>1,a=!t.isEmpty(s)&&Number.isNaN(Number(s));return d||a?{error:"Invalid value"}:i&&(i[0]==="auto"||i[0]==="none")?{value:i[0],unit:""}:{value:s,unit:i?i[0]:""}};const _e=r=>{const l=r.startsWith("-")?"-":"",s=r.split("-").pop();if(["auto","none"].includes(s))return{value:"",unit:s};if(s==="px")return{value:"1",unit:"px"};if(s==="screen")return{value:"100",unit:r.indexOf("w-")!==-1?"vw":"vh"};if(s==="full")return{value:"100",unit:"%"};if(t.includes(r,"skew-"))return{value:`${l}${s}`,unit:"deg"};if(t.includes(r,"rotate-"))return{value:`${l}${s}`,unit:"deg"};if(t.includes(r,"opacity-"))return{value:`${s/100}`,unit:"-"};if(t.includes(r,"duration-")||t.includes(r,"delay-"))return{value:`${s}`,unit:"ms"};if(t.includes(r,"translate-")&&!s.includes("/"))return{value:`${l}${`${s/4}`}`,unit:"rem"};if(t.includes(r,"scale-"))return{value:`${l}${`${s/100}`}`,unit:"-"};if(t.startsWith(r,"border")){const n=r.match(/border-?(x|y|t|r|b|l)?\d+/g);if(n)return{value:n[0].split("-").pop(),unit:"px"};if(r.match(/border-?(x|y|t|r|b|l)?/g))return{value:"1",unit:"px"}}if(t.startsWith(r,"max-w-")){if(r==="max-w-screen-sm")return{value:"640",unit:"px"};if(r==="max-w-screen-md")return{value:"768",unit:"px"};if(r==="max-w-screen-lg")return{value:"1024",unit:"px"};if(r==="max-w-screen-xl")return{value:"1280",unit:"px"};if(r==="max-w-screen-2xl")return{value:"1536",unit:"px"};if(s==="xs")return{value:"320",unit:"px"};if(s==="sm")return{value:"384",unit:"px"};if(s==="md")return{value:"448",unit:"px"};if(s==="lg")return{value:"512",unit:"px"};if(s==="xl")return{value:"576",unit:"px"};if(s==="2xl")return{value:"672",unit:"px"};if(s==="3xl")return{value:"768",unit:"px"};if(s==="4xl")return{value:"896",unit:"px"};if(s==="5xl")return{value:"1024",unit:"px"};if(s==="6xl")return{value:"1152",unit:"px"};if(s==="7xl")return{value:"1280",unit:"px"};if(s==="prose")return{value:"65",unit:"ch"}}if(t.startsWith(r,"text-")){if(s==="xs")return{value:"12",unit:"px"};if(s==="sm")return{value:"14",unit:"px"};if(s==="base")return{value:"16",unit:"px"};if(s==="lg")return{value:"18",unit:"px"};if(s==="xl")return{value:"20",unit:"px"};if(s==="2xl")return{value:"24",unit:"px"};if(s==="3xl")return{value:"30",unit:"px"};if(s==="4xl")return{value:"36",unit:"px"};if(s==="5xl")return{value:"48",unit:"px"};if(s==="6xl")return{value:"60",unit:"px"};if(s==="7xl")return{value:"72",unit:"px"};if(s==="8xl")return{value:"96",unit:"px"};if(s==="9xl")return{value:"128",unit:"px"}}if(t.startsWith(r,"leading-")){if(s==="none")return{value:"1",unit:"-"};if(s==="tight")return{value:"1.25",unit:"-"};if(s==="snug")return{value:"1.375",unit:"-"};if(s==="normal")return{value:"1.5",unit:"-"};if(s==="relaxed")return{value:"1.625",unit:"-"};if(s==="loose")return{value:"2",unit:"-"}}if(t.startsWith(r,"tracking-")){if(s==="tighter")return{value:"-0.05",unit:"em"};if(s==="tight")return{value:"-0.025",unit:"em"};if(s==="normal")return{value:"0",unit:"em"};if(s==="wide")return{value:"0.025",unit:"em"};if(s==="wider")return{value:"0.05",unit:"em"};if(s==="widest")return{value:"0.1",unit:"em"}}if(["max","min","fit"].includes(s))return{value:r,unit:"class"};if(s.includes("/")){const[n,i]=t.map(s.split("/"),d=>parseInt(d,10));return{value:l+(n/i*100).toFixed(2).replace(".00",""),unit:"%"}}return t.isNumber(parseFloat(s))?{value:`${l+parseFloat(s)*4}`,unit:"px"}:{value:s,unit:"class"}};const Be=r=>{if(t.isEmpty(r))return{value:"",unit:""};const l=r.match(/\[.*\]/g);if(l===null)return He(r);const s=t.get(l,"0","").replace(/\[|\]/g,""),n=r.startsWith("-")?"-":"",i=t.first(s.match(/\d+.\d+|\d+/g));return{value:`${n}${i}`,unit:s.replace(i,"")}},He=r=>t.isEmpty(r)?{value:"",unit:""}:_e(r),ie=g.createContext({setDragData:()=>{}}),Ve=({unit:r,currentValue:l,onDrag:s,onDragEnd:n,onDragStart:i,negative:d,cssProperty:a})=>{const{setDragData:x}=g.useContext(ie);return e.jsxRuntimeExports.jsx("button",{type:"button",onMouseDown:p=>{const m={onDrag:s,onDragEnd:n,dragging:!0,dragStartY:p.pageY,dragStartValue:`${l}`,dragUnit:r,negative:d,cssProperty:a};i(m),x(m)},color:void 0,className:"relative z-50 ml-1 hidden h-6 cursor-row-resize rounded bg-background/70 px-2 group-hover:inline",children:e.jsxRuntimeExports.jsx(u.RowSpacingIcon,{})})},Ae=({onSelect:r,current:l,units:s})=>e.jsxRuntimeExports.jsx("div",{"data-theme":"light",className:"-m-[7px] -mx-[13px] flex w-9 flex-col",children:s.map(n=>e.jsxRuntimeExports.jsx(o.Button,{className:"h-max rounded-none px-1 py-1 text-right text-[11px] hover:bg-blue-400",color:l===n?"primary":void 0,size:"sm",onClick:i=>{i.stopPropagation(),r(n)},children:n},n))}),te=50,De=r=>{const[l,s]=g.useState(!1),[n,i]=g.useState(""),{currentClass:d,onChange:a,classPrefix:x,cssProperty:p,units:m,negative:b}=r,[c,f]=g.useState(p!=null&&p.toLowerCase().includes("width")?"%":m[0]),[y,h]=g.useState(!1),[v,E]=g.useState(""),[T,w]=g.useState(!1),[_,B]=g.useState(!1);g.useEffect(()=>{const{value:j,unit:R}=Be(d);if(R===""){i(j),f(p!=null&&p.toLowerCase().includes("width")?"%":t.first(m));return}f(R),i(R==="class"||t.isEmpty(j)?"":j)},[d,p,m]);const C=Z.useThrottledCallback(j=>a(j),[a],te),I=Z.useThrottledCallback(j=>a(j,!1),[a],te),V=g.useCallback((j=!1)=>{const R=ee(`${n}`,m);if(t.get(R,"error",!1)){h(!0);return}const k=t.get(R,"unit")!==""?t.get(R,"unit"):c;if(k==="auto"||k==="none"){C(`${x}${k}`);return}if(t.get(R,"value")==="")return;const M=`${t.get(R,"value","").startsWith("-")?"-":""}${x}[${t.get(R,"value","").replace("-","")}${k==="-"?"":k}]`;j?I(M):C(M)},[C,I,n,c,x,m]),P=g.useCallback(j=>{const R=ee(`${n}`,m);if(t.get(R,"error",!1)){h(!0);return}if(j==="auto"||j==="none"){C(`${x}${j}`);return}if(t.get(R,"value")==="")return;const k=t.get(R,"unit")!==""?t.get(R,"unit"):j,M=`${t.get(R,"value","").startsWith("-")?"-":""}${x}[${t.get(R,"value","").replace("-","")}${k==="-"?"":k}]`;C(M)},[C,n,x,m]);return e.jsxRuntimeExports.jsx("div",{className:"flex w-full flex-col",children:e.jsxRuntimeExports.jsx("div",{className:"flex items-center justify-start",children:c==="class"?e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx("input",{className:"w-20 rounded py-1",readOnly:!0,value:d}),e.jsxRuntimeExports.jsxs(o.Tooltip,{children:[e.jsxRuntimeExports.jsx(o.TooltipTrigger,{asChild:!0,children:e.jsxRuntimeExports.jsx("button",{type:"button",className:"invisible ml-3 mt-1 text-blue-600 group-hover:visible",children:e.jsxRuntimeExports.jsx(u.InfoCircledIcon,{})})}),e.jsxRuntimeExports.jsx(o.TooltipContent,{children:"Current value is using a Tailwind preset class."})]})]}):e.jsxRuntimeExports.jsxs("div",{className:`group relative flex items-center ${T?"z-auto":""}`,children:[e.jsxRuntimeExports.jsxs("div",{className:"flex items-center rounded-md border border-border",children:[["none","auto"].indexOf(c)!==-1?null:e.jsxRuntimeExports.jsx("input",{readOnly:c==="class",onKeyPress:j=>{j.key==="Enter"&&V()},onKeyDown:j=>{if(j.keyCode!==38&&j.keyCode!==40)return;j.preventDefault(),B(!0);const R=t.parseInt(j.target.value);let k=t.isNaN(R)?0:R;j.keyCode===38&&(k+=1),j.keyCode===40&&(k-=1);const H=`${k}`,ae=`${H.startsWith("-")?"-":""}${x}[${H.replace("-","")}${c==="-"?"":c}]`;I(ae)},onKeyUp:j=>{_&&(j.preventDefault(),B(!1))},onBlur:()=>V(),onChange:j=>{h(!1),i(j.target.value)},onClick:j=>{var R;(R=j==null?void 0:j.target)==null||R.select(),s(!1)},value:T?v:n,className:"h-6 w-14 rounded rounded-r-none bg-background pl-2 text-sm focus-visible:outline-0 ".concat(" ",y?"border-red-500 text-red-500":"border-foreground/20")}),e.jsxRuntimeExports.jsxs(o.Tooltip,{open:l,delayDuration:100,children:[e.jsxRuntimeExports.jsx(o.TooltipTrigger,{asChild:!0,children:e.jsxRuntimeExports.jsxs("button",{type:"button",onClick:()=>s(!l),className:"flex h-6 cursor-pointer items-center gap-x-1 rounded rounded-l-none bg-background p-px px-1 text-[11px] uppercase",children:[e.jsxRuntimeExports.jsx("span",{className:`inline-block ${m.length===1?"px-2 font-semibold":""}`,children:c}),m.length>1?e.jsxRuntimeExports.jsx(u.TriangleDownIcon,{}):null]})}),e.jsxRuntimeExports.jsx(o.TooltipPortal,{children:e.jsxRuntimeExports.jsx(o.TooltipContent,{className:"bg-background",children:e.jsxRuntimeExports.jsx(Ae,{units:m,current:c,onSelect:j=>{s(!1),f(j),P(j)}})})})]})]}),["none","auto"].indexOf(c)!==-1||T?null:e.jsxRuntimeExports.jsx(Ve,{onDragStart:()=>w(!0),onDragEnd:j=>{if(E(()=>""),w(!1),t.isEmpty(j))return;const R=`${j}`,H=`${R.startsWith("-")?"-":""}${x}[${R.replace("-","")}${c==="-"?"":c}]`;C(H)},onDrag:j=>{if(t.isEmpty(j))return;E(j);const R=`${j}`,H=`${R.startsWith("-")?"-":""}${x}[${R.replace("-","")}${c==="-"?"":c}]`;I(H)},currentValue:n,unit:c,negative:b,cssProperty:p})]})})})},q=r=>{const l=o.useSelectedBlockCurrentClasses();return t.findLast(l,{property:r})},Pe=(r,l)=>{const s={xs:0,sm:1,md:2,lg:3,xl:4,"2xl":5};return s[t.get(r,"mq","xs")]<=s[l]},Me={width:"w-",height:"h-",minWidth:"min-w-",minHeight:"min-h-",maxWidth:"max-w-",maxHeight:"max-h-",zIndex:"z-",gap:"gap-",gapX:"gap-x-",gapY:"gap-y-",margin:"m-",marginX:"mx-",marginY:"my-",marginTop:"mt-",marginBottom:"mb-",marginLeft:"ml-",marginRight:"mr-",padding:"p-",paddingX:"px-",paddingY:"py-",paddingTop:"pt-",paddingBottom:"pb-",paddingLeft:"pl-",paddingRight:"pr-",spaceX:"space-x-",spaceY:"space-y-",border:"border-",borderTop:"border-t-",borderBottom:"border-b-",borderLeft:"border-l-",borderRight:"border-r-",borderX:"border-x-",borderY:"border-y-",borderRadius:"rounded-",borderRadiusTop:"rounded-t-",borderRadiusRight:"rounded-r-",borderRadiusBottom:"rounded-b-",borderRadiusLeft:"rounded-l-",borderRadiusTopLeft:"rounded-tl-",borderRadiusTopRight:"rounded-tr-",borderRadiusBottomRight:"rounded-br-",borderRadiusBottomLeft:"rounded-bl-",fontSize:"text-",lineHeight:"leading-",letterSpacing:"tracking-",textIndent:"indent-",rotate:"rotate-",duration:"duration-",transitionDelay:"delay-",scale:"scale-",scaleX:"scale-x-",scaleY:"scale-y-",translateX:"translate-x-",translateY:"translate-y-",skewX:"skew-x-",skewY:"skew-y-",top:"top-",bottom:"bottom-",left:"left-",right:"right-",inset:"inset-",insetX:"inset-x-",insetY:"inset-y-",opacity:"opacity-",flexBasis:"basis-"},se={xs:"",sm:"640px",md:"768px",lg:"1024px",xl:"1280px","2xl":"1536px"},$e=r=>`${r.toUpperCase()} ${se[r]?`(${se[r]} & up)`:""}`,K=r=>{const{t:l}=A.useTranslation(),{type:s="icons",label:n,property:i,onEmitChange:d=()=>{},units:a,negative:x=!1}=r,[p]=o.useDarkMode(),[m]=o.useStylingState(),[,b]=o.useCanvasWidth(),c=q(i),f=o.useAddClassesToBlocks(),y=o.useRemoveClassesFromBlocks(),[h]=o.useSelectedBlockIds(),v=g.useMemo(()=>t.get(c,"fullCls",""),[c]),E=g.useCallback((I,V=!0)=>{const P={dark:p,mq:b,mod:m,cls:I,property:i,fullCls:""};(p||m!=="")&&(P.mq="xs");const j=D.generateFullClsName(P);f(h,[j],V)},[h,p,b,m,i,f]),T=g.useCallback(()=>{y(h,[v])},[h,v,y]),w=g.useMemo(()=>Pe(c,b),[c,b]);g.useEffect(()=>{d(w,c)},[w,d,c]);const[,,_]=o.useCanvasWidth(),B=g.useCallback(I=>{_({xs:400,sm:640,md:800,lg:1024,xl:1420,"2xl":1920}[I])},[_]),C=t.get(c,"dark",null)===p&&t.get(c,"mod",null)===m&&t.get(c,"mq",null)===b;return e.jsxRuntimeExports.jsx(ke,{canChange:w,canReset:c&&C,children:e.jsxRuntimeExports.jsxs("div",{className:"group flex flex-row items-center py-2 first:pt-0 last:pb-0",children:[e.jsxRuntimeExports.jsx("div",{className:"relative w-[70px] truncate text-xs text-foreground",children:e.jsxRuntimeExports.jsx("span",{className:`text-[11px] ${c&&!C?"text-foreground":""}`,children:l(n)})}),e.jsxRuntimeExports.jsxs("div",{className:"flex flex-row items-center",children:[e.jsxRuntimeExports.jsxs("div",{className:"w-[150px]",children:[s==="arbitrary"?e.jsxRuntimeExports.jsx(De,{currentClass:t.get(c,"cls",""),classPrefix:t.get(Me,i,""),units:a||[],onChange:E,negative:x,cssProperty:i}):null,s==="icons"&&e.jsxRuntimeExports.jsx(Se,{property:i,onChange:E}),s==="range"&&e.jsxRuntimeExports.jsx(Ne,{property:i,onChange:E}),s==="color"&&e.jsxRuntimeExports.jsx(Ie,{property:i,onChange:E}),s==="dropdown"&&e.jsxRuntimeExports.jsx(ne,{label:n,property:i,onChange:E})]}),e.jsxRuntimeExports.jsx("div",{className:`w-[30px] cursor-pointer ${v?"visible":"invisible"}`,children:C?e.jsxRuntimeExports.jsx("button",{type:"button",onClick:()=>T(),title:"Reset",className:"flex px-1.5 text-xs",children:e.jsxRuntimeExports.jsx(u.CrossCircledIcon,{className:"h-5 w-5 text-blue-500 hover:opacity-80"})}):w&&c?e.jsxRuntimeExports.jsxs(o.Tooltip,{delayDuration:100,children:[e.jsxRuntimeExports.jsx(o.TooltipTrigger,{asChild:!0,children:e.jsxRuntimeExports.jsx("button",{type:"button",className:"invisible ml-3 mt-1 rounded-full bg-blue-500 text-white group-hover:visible",children:e.jsxRuntimeExports.jsx(u.InfoCircledIcon,{})})}),e.jsxRuntimeExports.jsx(o.TooltipContent,{children:e.jsxRuntimeExports.jsx("div",{className:"text-right",children:e.jsxRuntimeExports.jsxs("div",{children:["Current style is set at ",e.jsxRuntimeExports.jsxs("span",{className:"font-bold",children:[$e(t.get(c,"mq")),p&&!c.dark?"(Light mode)":""]}),e.jsxRuntimeExports.jsx("br",{}),e.jsxRuntimeExports.jsxs("button",{type:"button",onClick:()=>B(t.get(c,"mq")),className:"block w-full cursor-default text-right font-semibold text-blue-500",children:["Switch to ",t.get(c,"mq").toUpperCase()]})]})})})]}):null})]})]})})},Le=["px","%","em","rem","ch","vh","vw"],le=({label:r,options:l,borderB:s=!1,borderT:n=!1,type:i="arbitrary",units:d=Le,negative:a=!1})=>{const{t:x}=A.useTranslation(),[p,m]=g.useState(l[0].key),b=o.useSelectedBlockCurrentClasses(),c=g.useCallback(f=>t.map(b,"property").includes(f),[b]);return e.jsxRuntimeExports.jsxs("div",{className:`mb-2 border-gray-800 py-2 first:pt-0 last:pb-0 ${s?"border-b":""} ${n?"border-t":""}`,children:[e.jsxRuntimeExports.jsxs("div",{className:"flex flex-row text-xs",children:[r&&e.jsxRuntimeExports.jsx("span",{className:"relative w-[70px] flex-none text-xs text-foreground",children:x(r)}),e.jsxRuntimeExports.jsx("div",{className:"mb-3 flex grow flex-row flex-wrap gap-x-px",children:g.Children.toArray(l.map(({label:f,key:y})=>e.jsxRuntimeExports.jsx("div",{className:"first:rounded-l last:rounded-r",children:e.jsxRuntimeExports.jsxs(o.Tooltip,{children:[e.jsxRuntimeExports.jsx(o.TooltipTrigger,{asChild:!0,children:e.jsxRuntimeExports.jsxs("button",{type:"button",onClick:()=>m(y),className:`relative cursor-pointer rounded-full p-1 text-[8px] ${y===p?" bg-[#3E57F0] text-white":"text-gray-600 dark:text-gray-300"}`,children:[g.createElement("div",{className:c(y)?"-bottom-1.5 absolute bg-[#3E57F0] h-[2px] left-0 w-full":""}),g.createElement(t.get(oe,y,u.BoxIcon),{className:"text-inherit w-3 h-3"})]})}),e.jsxRuntimeExports.jsx(o.TooltipContent,{children:t.startCase(t.toLower(f))})]})})))})]}),e.jsxRuntimeExports.jsx("div",{className:"mt-0 flex items-center",children:e.jsxRuntimeExports.jsx(K,{type:i,units:[...d],label:"",property:p,negative:a})})]})},qe=({heading:r,items:l})=>{const{t:s}=A.useTranslation(),n=o.useSelectedBlockCurrentClasses(),i=g.useMemo(()=>{const d=p=>t.flatten(p.map(m=>m.styleType==="multiple"?t.map(m.options,"key"):m.property)),a=t.flatten(l.map(p=>p.styleType==="accordion"?d(p.items):p.styleType==="multiple"?t.map(p.options,"key"):p.property)),x=t.map(n,"property");return t.intersection(a,x).length>0},[n,l]);return e.jsxRuntimeExports.jsxs("details",{children:[e.jsxRuntimeExports.jsx("summary",{className:"my-px cursor-default rounded-md bg-background p-px px-2 text-[11px] text-foreground",children:e.jsxRuntimeExports.jsxs("div",{className:"inline",children:[s(r),i?e.jsxRuntimeExports.jsx("span",{className:`ml-1 mr-2 inline-block h-[8px] w-[8px] rounded-full ${i?"bg-blue-500":"bg-gray-300"}`}):null]})}),e.jsxRuntimeExports.jsx("div",{className:"p-2",children:l.map(d=>d.styleType==="multiple"?e.jsxRuntimeExports.jsx(le,{...d},d.label):e.jsxRuntimeExports.jsx(K,{...d},d.label))})]})},Oe=g.createContext({}),X=({section:r})=>{const{t:l}=A.useTranslation(),s=o.useSelectedBlockCurrentClasses(),n=g.useCallback((a=[])=>{const x={};for(let m=0;m<s.length;m++)x[s[m].property]=s[m].cls;let p=!0;for(const m in a)if(!t.has(x,m)||x[m]!==a[m]){p=!1;break}return p},[s]),i=g.useMemo(()=>{if(s.length>0&&r.heading==="classes.heading")return!0;const a=m=>t.flatten(m.map(b=>b.styleType==="multiple"?t.flatten(t.map(b.options,"key")):b.property)),x=t.flatten(r.items.map(m=>m.styleType==="accordion"?a(m.items):m.styleType==="multiple"?t.flatten(t.map(m.options,"key")):m.property)),p=t.map(s,"property");return t.intersection(x,p).length>0},[s,r.heading,r.items]),d=g.useMemo(()=>({}),[]);return e.jsxRuntimeExports.jsx(Oe.Provider,{value:d,children:e.jsxRuntimeExports.jsxs(o.AccordionItem,{value:r.heading,children:[e.jsxRuntimeExports.jsx(o.AccordionTrigger,{className:"px-3 py-2 text-xs hover:no-underline",children:e.jsxRuntimeExports.jsxs("div",{className:"flex items-center gap-x-2",children:[e.jsxRuntimeExports.jsx("div",{className:`h-[8px] w-[8px] rounded-full ${i?"bg-blue-500":"bg-gray-300"}`}),l(r.heading)]})}),e.jsxRuntimeExports.jsx(o.AccordionContent,{className:"bg-gray-100 px-3.5 py-2",children:g.Children.toArray(r.items.map(a=>t.has(a,"component")?g.createElement(a.component,{key:a.label}):t.has(a,"styleType")?a.styleType==="multiple"?e.jsxRuntimeExports.jsx(le,{...a},a.label):a.styleType==="accordion"&&n(a==null?void 0:a.conditions)?e.jsxRuntimeExports.jsx(qe,{...a},a.label):null:e.jsxRuntimeExports.jsx(K,{...a},a.label)))})]})})},Fe=({item:r,index:l,canDelete:s,onChange:n,onRemove:i})=>e.jsxRuntimeExports.jsxs("div",{className:`flex flex-col gap-1 border-gray-400 py-2 ${s?"border-b":""}`,children:[e.jsxRuntimeExports.jsx("input",{name:"key",onChange:d=>n(d,l),value:r.key,placeholder:"Key",className:"w-full rounded border-gray-300 bg-background p-0.5 pl-2 text-sm focus-visible:outline-0",autoComplete:"off",autoCapitalize:"off"}),e.jsxRuntimeExports.jsxs("div",{className:"flex items-center gap-x-1.5",children:[e.jsxRuntimeExports.jsx("input",{name:"value",onChange:d=>t.isEmpty(r.key)?{}:n(d,l),value:r.value,placeholder:"Value",className:"w-full rounded border-gray-300 bg-background p-0.5 pl-2 text-sm focus-visible:outline-0",autoComplete:"off",autoCapitalize:"off"}),e.jsxRuntimeExports.jsx(u.TrashIcon,{onClick:i,className:"h-6 w-6 cursor-pointer rounded border border-red-400 p-1 text-red-400 hover:opacity-80"})]})]}),We=({section:r})=>{var f;const{setSyncState:l}=o.useSavePage(),s=o.useSelectedBlock(),[n,i]=g.useState([]),[d]=o.useSelectedStylingBlocks(),a=o.useUpdateBlocksPropsRealtime(),x=`${t.get(d,"0.prop")}_attrs`;O.useEffect(()=>{const y=t.map(t.get(s,x),(h,v)=>({key:v,value:h}));t.isEmpty(y)?i([]):i(y)},[t.get(s,x)]);const p=()=>i([...n,{key:"",value:""}]),m=y=>{const h=t.filter(n,(v,E)=>y!==E);c(h)},b=(y,h)=>{const v=[...n];v[h][y.target.name]=y.target.value,c(v)},c=O.useCallback((y=[])=>{const h={};t.forEach(y,v=>{t.isEmpty(v.key)||t.set(h,v.key,v.value)}),a([t.get(s,"_id")],{[x]:h}),l("UNSAVED")},[s,l,a,x]);return e.jsxRuntimeExports.jsxs(o.AccordionItem,{value:r.heading,children:[e.jsxRuntimeExports.jsx(o.AccordionTrigger,{className:"px-3 py-2 text-xs hover:no-underline",children:e.jsxRuntimeExports.jsxs("div",{className:"flex items-center gap-x-2",children:[e.jsxRuntimeExports.jsx("div",{className:`h-[8px] w-[8px] rounded-full ${t.isEmpty(t.get(s,x))?"bg-gray-300":"bg-blue-500"}`}),"Attributes"]})}),e.jsxRuntimeExports.jsx(o.AccordionContent,{className:"bg-gray-100 px-3.5 py-2",children:e.jsxRuntimeExports.jsxs("div",{className:"no-scrollbar flex min-h-max flex-col gap-y-2 overflow-y-auto bg-gray-100 p-px",children:[e.jsxRuntimeExports.jsxs(o.Label,{className:"mt-2 flex w-full items-center justify-between",children:["Add Custom attributes",e.jsxRuntimeExports.jsxs("div",{className:`flex h-6 w-max items-center justify-center gap-x-0.5 rounded-full border p-1 px-2 text-xs ${!t.isEmpty(n)&&t.isEmpty((f=t.last(n))==null?void 0:f.key)?"cursor-not-allowed border-gray-400 text-gray-400":"cursor-pointer border-blue-400 text-blue-400 hover:bg-blue-400 hover:text-white"}`,onClick:()=>{var y;!t.isEmpty(n)&&t.isEmpty((y=t.last(n))==null?void 0:y.key)||p()},children:[e.jsxRuntimeExports.jsx(u.PlusIcon,{width:12,height:12})," Add"]})]}),e.jsxRuntimeExports.jsxs("div",{className:"flex flex-col",children:[t.isEmpty(n)&&e.jsxRuntimeExports.jsx("div",{className:"flex h-12 items-center justify-center text-sm text-gray-400",children:"Click + Add to add attributes"}),O.Children.toArray(t.map(n,(y,h)=>{const v=n.length>0&&h<n.length-1;return e.jsxRuntimeExports.jsx(Fe,{item:y,index:h,canDelete:v,onChange:b,onRemove:()=>m(h)})}))]})]})})]})},ze=()=>{const r=o.useSelectedBlock(),[l]=o.useSelectedStylingBlocks(),{t:s}=A.useTranslation(),n=$.useGlobalStylingPresets(),i=o.useAddClassesToBlocks(),d=$.getBlockComponent(r._type),a=N.get(N.first(l),"prop"),x=N.get(d.props,`${a}.presets`,{});if(N.isEmpty(n)&&(!N.has(d,"props")||N.isEmpty(x)))return null;const p=m=>{const b=m.trim().toLowerCase().replace(/ +(?= )/g,"").split(" ");i([r._id],b,!0)};return e.jsxRuntimeExports.jsx("div",{className:"h-10",children:e.jsxRuntimeExports.jsxs(o.DropdownMenu,{children:[e.jsxRuntimeExports.jsx(o.DropdownMenuTrigger,{asChild:!0,children:e.jsxRuntimeExports.jsx("div",{className:"px-4",children:e.jsxRuntimeExports.jsxs(o.Button,{variant:"default",className:"w-full",size:"sm",children:[s("Apply Presets"),e.jsxRuntimeExports.jsx(u.CaretDownIcon,{})]})})}),e.jsxRuntimeExports.jsx(o.DropdownMenuContent,{className:"max-h-80 w-56",children:e.jsxRuntimeExports.jsxs(o.ScrollArea,{className:"no-scrollbar h-full",children:[N.isEmpty(x)?null:e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsxs(o.DropdownMenuLabel,{children:[d.type," ",s("presets")]}),e.jsxRuntimeExports.jsx(o.DropdownMenuSeparator,{}),e.jsxRuntimeExports.jsx(o.DropdownMenuGroup,{children:N.keys(x).map(m=>e.jsxRuntimeExports.jsxs(o.DropdownMenuItem,{className:"group text-xs",onClick:()=>p(x[m]),children:[N.capitalize(N.startCase(s(m))),e.jsxRuntimeExports.jsx(o.DropdownMenuShortcut,{className:"invisible hover:font-bold hover:text-blue-600 group-hover:visible",children:s("apply")})]}))})]}),N.isEmpty(n)?null:e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx(o.DropdownMenuLabel,{children:s("Global presets")}),e.jsxRuntimeExports.jsx(o.DropdownMenuSeparator,{}),e.jsxRuntimeExports.jsx(o.DropdownMenuGroup,{children:N.keys(n).map(m=>e.jsxRuntimeExports.jsxs(o.DropdownMenuItem,{className:"group text-xs",onClick:()=>p(n[m]),children:[N.capitalize(N.startCase(s(m))),e.jsxRuntimeExports.jsx(o.DropdownMenuShortcut,{className:"invisible hover:font-bold hover:text-blue-600 group-hover:visible",children:s("apply")})]}))})]})]})})]})})};function Ye(){const[r,l]=o.useStylingState(),{flexChild:s,gridChild:n}=o.useSelectedBlocksDisplayChild(),{t:i}=A.useTranslation(),[d]=o.useSelectedStylingBlocks();return t.isEmpty(d)?e.jsxRuntimeExports.jsx("div",{className:"p-4 text-center",children:e.jsxRuntimeExports.jsxs("div",{className:"space-y-4 rounded-xl p-4",children:[e.jsxRuntimeExports.jsx(u.MixerHorizontalIcon,{className:"mx-auto text-3xl"}),e.jsxRuntimeExports.jsx("h1",{children:i("no_styling_block_selected")})]})}):e.jsxRuntimeExports.jsxs("div",{className:"flex h-full flex-col",children:[e.jsxRuntimeExports.jsx(ze,{}),e.jsxRuntimeExports.jsx("div",{className:"flex h-12 flex-col space-x-4 px-4 py-1",children:e.jsxRuntimeExports.jsxs("div",{className:"flex items-center justify-end gap-x-1.5",children:[e.jsxRuntimeExports.jsx(o.Label,{htmlFor:"",className:"flex gap-x-1.5 text-xs italic",children:"State"}),e.jsxRuntimeExports.jsxs(o.Select,{defaultValue:r,onValueChange:a=>l(a),children:[e.jsxRuntimeExports.jsx(o.SelectTrigger,{className:"h-auto w-fit p-1 px-3",children:e.jsxRuntimeExports.jsx(o.SelectValue,{placeholder:"State"})}),e.jsxRuntimeExports.jsxs(o.SelectContent,{children:[e.jsxRuntimeExports.jsx(o.SelectItem,{value:"",children:"Normal"}),e.jsxRuntimeExports.jsx(o.SelectItem,{value:"hover",children:"Hover"}),e.jsxRuntimeExports.jsx(o.SelectItem,{value:"active",children:"Active"}),e.jsxRuntimeExports.jsx(o.SelectItem,{value:"focus",children:"Focus"}),e.jsxRuntimeExports.jsx(o.SelectItem,{value:"before",children:"Before"}),e.jsxRuntimeExports.jsx(o.SelectItem,{value:"after",children:"After"}),e.jsxRuntimeExports.jsx(o.SelectItem,{value:"only",children:"Only"}),e.jsxRuntimeExports.jsx(o.SelectItem,{value:"first",children:"First"}),e.jsxRuntimeExports.jsx(o.SelectItem,{value:"last",children:"Last"}),e.jsxRuntimeExports.jsx(o.SelectItem,{value:"first-letter",children:"First Letter"}),e.jsxRuntimeExports.jsx(o.SelectItem,{value:"first-line",children:"First Line"}),e.jsxRuntimeExports.jsx(o.SelectItem,{value:"disabled",children:"Disabled"})]})]})]})}),r!==""?e.jsxRuntimeExports.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:[e.jsxRuntimeExports.jsx(F.BrushIcon,{className:"w-3"}),e.jsxRuntimeExports.jsx("span",{children:i(`Styles will be applied for (:${r}) state`)})]}):null,e.jsxRuntimeExports.jsx(o.ScrollArea,{className:"no-scrollbar -mx-1 max-h-full flex-1 overflow-x-hidden overflow-y-hidden border-t border-border",children:e.jsxRuntimeExports.jsxs(o.Accordion,{defaultValue:["Layout"],type:"multiple",className:"w-full",children:[s&&e.jsxRuntimeExports.jsx(X,{section:Ee}),n?e.jsxRuntimeExports.jsx(X,{section:we}):null,Ce.map(a=>e.jsxRuntimeExports.jsx(X,{section:a},a.heading)),e.jsxRuntimeExports.jsx(We,{section:{heading:"Attributes"}})]})})]})}const Xe={px:1,"%":1,em:100,rem:100,ch:1,vw:1,vh:1,"-":1,deg:1,ms:.1},Ze=()=>{const r=o.useSelectedBlock(),{t:l}=A.useTranslation(),[s,n]=g.useState(""),[i,d]=g.useState({onDrag:p=>p,onDragEnd:p=>p,dragStartY:0,dragging:!1,dragStartValue:0,dragUnit:"",negative:!1,cssProperty:""}),a=Z.useThrottledCallback(p=>{const m=!t.get(i,"negative",!1),b=t.get(i,"cssProperty","");let c=parseFloat(i.dragStartValue);c=t.isNaN(c)?0:c;let f=Xe[i.dragUnit];(t.startsWith(b,"scale")||b==="opacity")&&(f=10);let h=(i.dragStartY-p.pageY)/f+c;m&&h<0&&(h=0),b==="opacity"&&h>1&&(h=1),i.onDrag(`${h}`),n(`${h}`)},[i],50),x=g.useCallback(()=>{setTimeout(()=>i.onDragEnd(`${s}`),100),d({onDrag:p=>p,onDragEnd:p=>p,dragStartY:0,dragging:!1,dragStartValue:0,dragUnit:"",negative:!1,cssProperty:""})},[i,s,d]);return t.isNull(r)?e.jsxRuntimeExports.jsx("div",{className:"p-4 text-center",children:e.jsxRuntimeExports.jsxs("div",{className:"space-y-4 rounded-xl p-4",children:[e.jsxRuntimeExports.jsx(u.MixerHorizontalIcon,{className:"mx-auto text-3xl"}),e.jsxRuntimeExports.jsx("h1",{children:l("no_block_selected_for_styling")})]})}):e.jsxRuntimeExports.jsx(W.ErrorBoundary,{children:e.jsxRuntimeExports.jsxs(ie.Provider,{value:{setDragData:d},children:[i.dragging?e.jsxRuntimeExports.jsx("div",{onMouseMove:a,onMouseUp:()=>x(),className:"absolute inset-0 z-30 cursor-row-resize bg-gray-300/10"}):null,e.jsxRuntimeExports.jsxs(o.Tabs,{defaultValue:"settings",className:"flex h-full w-full flex-col py-1",children:[e.jsxRuntimeExports.jsxs(o.TabsList,{className:"mx-1 grid grid-cols-2",children:[e.jsxRuntimeExports.jsx(o.TabsTrigger,{value:"settings",children:l("settings")}),e.jsxRuntimeExports.jsx(o.TabsTrigger,{value:"styling",children:l("styling")})]}),e.jsxRuntimeExports.jsx(o.TabsContent,{value:"settings",className:"no-scrollbar h-full flex-1 overflow-y-auto overflow-x-hidden",children:e.jsxRuntimeExports.jsx(o.ScrollArea,{className:"no-scrollbar max-h-full flex-1 overflow-x-hidden overflow-y-hidden pb-5",children:e.jsxRuntimeExports.jsx(ve,{})})}),e.jsxRuntimeExports.jsx(o.TabsContent,{value:"styling",className:"h-full flex-1 overflow-y-auto overflow-x-hidden",children:e.jsxRuntimeExports.jsx(Ye,{})})]})]})})};exports.default=Ze;
|