@easybits.cloud/html-tailwind-generator 0.2.133 → 0.2.135
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/{chunk-3ZI65T2J.js → chunk-32JWNJFY.js} +6 -1
- package/dist/{chunk-3ZI65T2J.js.map → chunk-32JWNJFY.js.map} +1 -1
- package/dist/{chunk-JKZWFEJW.js → chunk-B3TDPWJD.js} +2 -2
- package/dist/{chunk-7GRVEMK4.js → chunk-QSEPSXL7.js} +2 -2
- package/dist/{chunk-Z3BBTSEK.js → chunk-UQELTLRO.js} +2 -2
- package/dist/components4.d.ts +10 -5
- package/dist/components4.js +210 -54
- package/dist/components4.js.map +1 -1
- package/dist/directions.js +1 -1
- package/dist/generate.js +2 -2
- package/dist/generateDocument.js +2 -2
- package/dist/images.js +1 -1
- package/dist/index.js +4 -4
- package/dist/refine.js +2 -2
- package/package.json +1 -1
- /package/dist/{chunk-JKZWFEJW.js.map → chunk-B3TDPWJD.js.map} +0 -0
- /package/dist/{chunk-7GRVEMK4.js.map → chunk-QSEPSXL7.js.map} +0 -0
- /package/dist/{chunk-Z3BBTSEK.js.map → chunk-UQELTLRO.js.map} +0 -0
package/dist/components4.js
CHANGED
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
} from "./chunk-VV5I53WR.js";
|
|
6
6
|
|
|
7
7
|
// src/components4/GrapesEditor.tsx
|
|
8
|
-
import { useEffect as
|
|
8
|
+
import { useEffect as useEffect3, useRef as useRef2, useState as useState3, forwardRef, useImperativeHandle } from "react";
|
|
9
9
|
|
|
10
10
|
// src/components4/blocks.ts
|
|
11
11
|
var LANDING_BLOCKS = [
|
|
@@ -1015,6 +1015,158 @@ function TailwindClassEditor({ editor, themeVersion = 0, themeColors = {} }) {
|
|
|
1015
1015
|
] });
|
|
1016
1016
|
}
|
|
1017
1017
|
|
|
1018
|
+
// src/components4/ImageSrcEditor.tsx
|
|
1019
|
+
import { useEffect as useEffect2, useState as useState2, useCallback as useCallback2 } from "react";
|
|
1020
|
+
import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
1021
|
+
function readSrc(component) {
|
|
1022
|
+
if (!component) return "";
|
|
1023
|
+
const attrs = component.getAttributes?.() || {};
|
|
1024
|
+
return attrs.src || "";
|
|
1025
|
+
}
|
|
1026
|
+
function readAlt(component) {
|
|
1027
|
+
if (!component) return "";
|
|
1028
|
+
const attrs = component.getAttributes?.() || {};
|
|
1029
|
+
return attrs.alt || "";
|
|
1030
|
+
}
|
|
1031
|
+
function isImageComponent(component) {
|
|
1032
|
+
if (!component) return false;
|
|
1033
|
+
if (component.get?.("type") === "image") return true;
|
|
1034
|
+
const el = component.getEl?.();
|
|
1035
|
+
return el?.tagName === "IMG";
|
|
1036
|
+
}
|
|
1037
|
+
function isValidHttpUrl(value) {
|
|
1038
|
+
if (!value) return false;
|
|
1039
|
+
try {
|
|
1040
|
+
const u = new URL(value);
|
|
1041
|
+
return u.protocol === "http:" || u.protocol === "https:";
|
|
1042
|
+
} catch {
|
|
1043
|
+
return false;
|
|
1044
|
+
}
|
|
1045
|
+
}
|
|
1046
|
+
function ImageSrcEditor({ editor }) {
|
|
1047
|
+
const [selectedComponent, setSelectedComponent] = useState2(null);
|
|
1048
|
+
const [isImg, setIsImg] = useState2(false);
|
|
1049
|
+
const [src, setSrc] = useState2("");
|
|
1050
|
+
const [alt, setAlt] = useState2("");
|
|
1051
|
+
const [previewError, setPreviewError] = useState2(false);
|
|
1052
|
+
const apply = useCallback2((next) => {
|
|
1053
|
+
if (!selectedComponent) return;
|
|
1054
|
+
selectedComponent.addAttributes?.(next);
|
|
1055
|
+
const el = selectedComponent.getEl?.();
|
|
1056
|
+
if (el) {
|
|
1057
|
+
if (next.src !== void 0) el.setAttribute("src", next.src);
|
|
1058
|
+
if (next.alt !== void 0) el.setAttribute("alt", next.alt);
|
|
1059
|
+
}
|
|
1060
|
+
editor?.trigger("sidebar:change");
|
|
1061
|
+
}, [editor, selectedComponent]);
|
|
1062
|
+
const applySrc = useCallback2(() => {
|
|
1063
|
+
if (!isValidHttpUrl(src)) return;
|
|
1064
|
+
apply({ src });
|
|
1065
|
+
}, [apply, src]);
|
|
1066
|
+
const applyAlt = useCallback2(() => {
|
|
1067
|
+
apply({ alt });
|
|
1068
|
+
}, [apply, alt]);
|
|
1069
|
+
useEffect2(() => {
|
|
1070
|
+
if (!editor) return;
|
|
1071
|
+
const onSelected = (component) => {
|
|
1072
|
+
setSelectedComponent(component);
|
|
1073
|
+
const img = isImageComponent(component);
|
|
1074
|
+
setIsImg(img);
|
|
1075
|
+
if (img) {
|
|
1076
|
+
setSrc(readSrc(component));
|
|
1077
|
+
setAlt(readAlt(component));
|
|
1078
|
+
setPreviewError(false);
|
|
1079
|
+
} else {
|
|
1080
|
+
setSrc("");
|
|
1081
|
+
setAlt("");
|
|
1082
|
+
}
|
|
1083
|
+
};
|
|
1084
|
+
const onDeselected = () => {
|
|
1085
|
+
setSelectedComponent(null);
|
|
1086
|
+
setIsImg(false);
|
|
1087
|
+
setSrc("");
|
|
1088
|
+
setAlt("");
|
|
1089
|
+
};
|
|
1090
|
+
editor.on("component:selected", onSelected);
|
|
1091
|
+
editor.on("component:deselected", onDeselected);
|
|
1092
|
+
const current = editor.getSelected();
|
|
1093
|
+
if (current) onSelected(current);
|
|
1094
|
+
return () => {
|
|
1095
|
+
editor.off("component:selected", onSelected);
|
|
1096
|
+
editor.off("component:deselected", onDeselected);
|
|
1097
|
+
};
|
|
1098
|
+
}, [editor]);
|
|
1099
|
+
if (!isImg) return null;
|
|
1100
|
+
const urlValid = isValidHttpUrl(src);
|
|
1101
|
+
return /* @__PURE__ */ jsxs2("div", { className: "p-3 border-b border-gray-800 bg-gray-900/50", children: [
|
|
1102
|
+
/* @__PURE__ */ jsx2("p", { className: "text-[10px] text-gray-400 font-bold uppercase tracking-wider mb-2", children: "Imagen" }),
|
|
1103
|
+
src && !previewError && /* @__PURE__ */ jsx2("div", { className: "mb-2 rounded-md overflow-hidden border border-gray-700 bg-gray-950", style: { aspectRatio: "16 / 9" }, children: /* @__PURE__ */ jsx2(
|
|
1104
|
+
"img",
|
|
1105
|
+
{
|
|
1106
|
+
src,
|
|
1107
|
+
alt: "",
|
|
1108
|
+
className: "w-full h-full object-cover",
|
|
1109
|
+
onError: () => setPreviewError(true),
|
|
1110
|
+
onLoad: () => setPreviewError(false)
|
|
1111
|
+
}
|
|
1112
|
+
) }),
|
|
1113
|
+
/* @__PURE__ */ jsx2("label", { className: "block text-[10px] text-gray-500 uppercase tracking-wider mb-1", children: "URL" }),
|
|
1114
|
+
/* @__PURE__ */ jsxs2("div", { className: "flex items-center gap-1 mb-2", children: [
|
|
1115
|
+
/* @__PURE__ */ jsx2(
|
|
1116
|
+
"input",
|
|
1117
|
+
{
|
|
1118
|
+
type: "text",
|
|
1119
|
+
value: src,
|
|
1120
|
+
onChange: (e) => {
|
|
1121
|
+
setSrc(e.target.value);
|
|
1122
|
+
setPreviewError(false);
|
|
1123
|
+
},
|
|
1124
|
+
onKeyDown: (e) => {
|
|
1125
|
+
if (e.key === "Enter") applySrc();
|
|
1126
|
+
},
|
|
1127
|
+
placeholder: "https://...",
|
|
1128
|
+
className: "flex-1 bg-gray-800 text-xs text-white rounded px-2 py-1.5 outline-none border border-transparent focus:border-brand-500 min-w-0"
|
|
1129
|
+
}
|
|
1130
|
+
),
|
|
1131
|
+
/* @__PURE__ */ jsx2(
|
|
1132
|
+
"button",
|
|
1133
|
+
{
|
|
1134
|
+
onClick: applySrc,
|
|
1135
|
+
disabled: !urlValid,
|
|
1136
|
+
className: "px-2.5 py-1.5 text-[10px] font-bold rounded bg-brand-500 hover:bg-brand-600 transition-colors shrink-0 disabled:opacity-40 disabled:cursor-not-allowed",
|
|
1137
|
+
children: "Aplicar"
|
|
1138
|
+
}
|
|
1139
|
+
)
|
|
1140
|
+
] }),
|
|
1141
|
+
src && !urlValid && /* @__PURE__ */ jsx2("p", { className: "text-[10px] text-amber-500 mb-2", children: "URL inv\xE1lida \u2014 debe empezar con http:// o https://" }),
|
|
1142
|
+
previewError && urlValid && /* @__PURE__ */ jsx2("p", { className: "text-[10px] text-red-400 mb-2", children: "No se pudo cargar la imagen desde esa URL." }),
|
|
1143
|
+
/* @__PURE__ */ jsx2("label", { className: "block text-[10px] text-gray-500 uppercase tracking-wider mb-1", children: "Alt" }),
|
|
1144
|
+
/* @__PURE__ */ jsxs2("div", { className: "flex items-center gap-1", children: [
|
|
1145
|
+
/* @__PURE__ */ jsx2(
|
|
1146
|
+
"input",
|
|
1147
|
+
{
|
|
1148
|
+
type: "text",
|
|
1149
|
+
value: alt,
|
|
1150
|
+
onChange: (e) => setAlt(e.target.value),
|
|
1151
|
+
onKeyDown: (e) => {
|
|
1152
|
+
if (e.key === "Enter") applyAlt();
|
|
1153
|
+
},
|
|
1154
|
+
placeholder: "Descripci\xF3n...",
|
|
1155
|
+
className: "flex-1 bg-gray-800 text-xs text-white rounded px-2 py-1.5 outline-none border border-transparent focus:border-brand-500 min-w-0"
|
|
1156
|
+
}
|
|
1157
|
+
),
|
|
1158
|
+
/* @__PURE__ */ jsx2(
|
|
1159
|
+
"button",
|
|
1160
|
+
{
|
|
1161
|
+
onClick: applyAlt,
|
|
1162
|
+
className: "px-2.5 py-1.5 text-[10px] font-bold rounded bg-gray-700 hover:bg-gray-600 transition-colors shrink-0",
|
|
1163
|
+
children: "Aplicar"
|
|
1164
|
+
}
|
|
1165
|
+
)
|
|
1166
|
+
] })
|
|
1167
|
+
] });
|
|
1168
|
+
}
|
|
1169
|
+
|
|
1018
1170
|
// src/components4/grapesDarkCss.ts
|
|
1019
1171
|
var GRAPES_DARK_CSS = `
|
|
1020
1172
|
/* Dark theme for GrapesJS editor \u2014 matches EasyBits dark sidebar */
|
|
@@ -1118,7 +1270,7 @@ var GRAPES_DARK_CSS = `
|
|
|
1118
1270
|
`;
|
|
1119
1271
|
|
|
1120
1272
|
// src/components4/GrapesEditor.tsx
|
|
1121
|
-
import { Fragment, jsx as
|
|
1273
|
+
import { Fragment, jsx as jsx3, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
1122
1274
|
var darkCssInjected = false;
|
|
1123
1275
|
function injectDarkCss() {
|
|
1124
1276
|
if (darkCssInjected || typeof document === "undefined") return;
|
|
@@ -1152,7 +1304,7 @@ var PANEL_TABS = [
|
|
|
1152
1304
|
];
|
|
1153
1305
|
var GrapesEditor = forwardRef(
|
|
1154
1306
|
({ initialHtml, theme = "minimal", customColors: rawCustomColors, brandKits, onChange, onAiAction, onThemeChange, onBrandKitChange, initialBrandKitId, hiddenTabs = [], canvasStyles, devices, panelSide = "left", blocks: customBlocks, onVisibleSectionChange }, ref) => {
|
|
1155
|
-
|
|
1307
|
+
useEffect3(() => {
|
|
1156
1308
|
injectDarkCss();
|
|
1157
1309
|
}, []);
|
|
1158
1310
|
const customColors = flattenColors(rawCustomColors);
|
|
@@ -1174,13 +1326,13 @@ var GrapesEditor = forwardRef(
|
|
|
1174
1326
|
themeRef.current = theme;
|
|
1175
1327
|
const customColorsRef = useRef2(customColors);
|
|
1176
1328
|
customColorsRef.current = customColors;
|
|
1177
|
-
const [activeBrandKitId, setActiveBrandKitId] =
|
|
1329
|
+
const [activeBrandKitId, setActiveBrandKitId] = useState3(initialBrandKitId || null);
|
|
1178
1330
|
const visibleTabs = PANEL_TABS.filter((t) => !hiddenTabs.includes(t.id));
|
|
1179
|
-
const [activePanel, setActivePanel] =
|
|
1331
|
+
const [activePanel, setActivePanel] = useState3(
|
|
1180
1332
|
() => visibleTabs.find((t) => t.id === "styles")?.id ?? visibleTabs[0]?.id ?? "styles"
|
|
1181
1333
|
);
|
|
1182
|
-
const [ready, setReady] =
|
|
1183
|
-
const [themeVersion, setThemeVersion] =
|
|
1334
|
+
const [ready, setReady] = useState3(false);
|
|
1335
|
+
const [themeVersion, setThemeVersion] = useState3(0);
|
|
1184
1336
|
useImperativeHandle(ref, () => ({
|
|
1185
1337
|
getEditor: () => editorRef.current,
|
|
1186
1338
|
getHtml: () => {
|
|
@@ -1316,7 +1468,7 @@ ${vars}
|
|
|
1316
1468
|
}
|
|
1317
1469
|
return null;
|
|
1318
1470
|
}
|
|
1319
|
-
|
|
1471
|
+
useEffect3(() => {
|
|
1320
1472
|
if (!editorContainerRef.current || editorRef.current) return;
|
|
1321
1473
|
let mounted = true;
|
|
1322
1474
|
(async () => {
|
|
@@ -1668,7 +1820,7 @@ ${html}` : html;
|
|
|
1668
1820
|
editorRef.current = null;
|
|
1669
1821
|
};
|
|
1670
1822
|
}, []);
|
|
1671
|
-
|
|
1823
|
+
useEffect3(() => {
|
|
1672
1824
|
const ed = editorRef.current;
|
|
1673
1825
|
if (!ed) return;
|
|
1674
1826
|
const doc = ed.Canvas.getDocument();
|
|
@@ -1691,52 +1843,55 @@ ${html}` : html;
|
|
|
1691
1843
|
setTimeout(() => setThemeVersion((v) => v + 1), 100);
|
|
1692
1844
|
}, [theme, customColors]);
|
|
1693
1845
|
const sidebarBorder = panelSide === "right" ? "border-l" : "border-r";
|
|
1694
|
-
const sidebar = /* @__PURE__ */
|
|
1695
|
-
/* @__PURE__ */
|
|
1846
|
+
const sidebar = /* @__PURE__ */ jsxs3("div", { className: `w-80 shrink-0 flex flex-col bg-black ${sidebarBorder} border-gray-700 overflow-hidden`, children: [
|
|
1847
|
+
/* @__PURE__ */ jsx3("div", { className: "flex border-b border-gray-700", children: visibleTabs.map((tab) => /* @__PURE__ */ jsxs3(
|
|
1696
1848
|
"button",
|
|
1697
1849
|
{
|
|
1698
1850
|
onClick: () => setActivePanel(tab.id),
|
|
1699
1851
|
className: `flex-1 py-2.5 text-xs font-bold transition-colors ${activePanel === tab.id ? "bg-gray-800 text-white border-b-2 border-brand-500" : "text-gray-400 hover:text-gray-200 hover:bg-gray-800/50"}`,
|
|
1700
1852
|
title: tab.label,
|
|
1701
1853
|
children: [
|
|
1702
|
-
/* @__PURE__ */
|
|
1854
|
+
/* @__PURE__ */ jsx3("span", { className: "block text-base mb-0.5", children: tab.icon }),
|
|
1703
1855
|
tab.label
|
|
1704
1856
|
]
|
|
1705
1857
|
},
|
|
1706
1858
|
tab.id
|
|
1707
1859
|
)) }),
|
|
1708
|
-
!hiddenTabs.includes("blocks") && /* @__PURE__ */
|
|
1860
|
+
!hiddenTabs.includes("blocks") && /* @__PURE__ */ jsx3(
|
|
1709
1861
|
"div",
|
|
1710
1862
|
{
|
|
1711
1863
|
ref: blocksRef,
|
|
1712
1864
|
className: `flex-1 overflow-auto p-2 ${activePanel === "blocks" ? "" : "hidden"}`
|
|
1713
1865
|
}
|
|
1714
1866
|
),
|
|
1715
|
-
/* @__PURE__ */
|
|
1867
|
+
/* @__PURE__ */ jsx3(
|
|
1716
1868
|
"div",
|
|
1717
1869
|
{
|
|
1718
1870
|
ref: layersRef,
|
|
1719
1871
|
className: `flex-1 overflow-auto ${activePanel === "layers" ? "" : "hidden"}`
|
|
1720
1872
|
}
|
|
1721
1873
|
),
|
|
1722
|
-
/* @__PURE__ */
|
|
1723
|
-
|
|
1724
|
-
|
|
1725
|
-
|
|
1726
|
-
|
|
1727
|
-
|
|
1728
|
-
|
|
1729
|
-
|
|
1730
|
-
|
|
1731
|
-
|
|
1732
|
-
|
|
1733
|
-
|
|
1734
|
-
|
|
1735
|
-
|
|
1736
|
-
|
|
1874
|
+
/* @__PURE__ */ jsxs3("div", { className: `flex-1 overflow-auto ${activePanel === "styles" ? "" : "hidden"}`, children: [
|
|
1875
|
+
ready && /* @__PURE__ */ jsx3(ImageSrcEditor, { editor: editorRef.current }),
|
|
1876
|
+
ready && /* @__PURE__ */ jsx3(
|
|
1877
|
+
TailwindClassEditor,
|
|
1878
|
+
{
|
|
1879
|
+
editor: editorRef.current,
|
|
1880
|
+
themeVersion,
|
|
1881
|
+
themeColors: (() => {
|
|
1882
|
+
if (customColors && Object.keys(customColors).length) return customColors;
|
|
1883
|
+
const t = LANDING_THEMES.find((t2) => t2.id === theme);
|
|
1884
|
+
return t?.colors || {};
|
|
1885
|
+
})()
|
|
1886
|
+
}
|
|
1887
|
+
)
|
|
1888
|
+
] }),
|
|
1889
|
+
/* @__PURE__ */ jsxs3("div", { className: `flex-1 overflow-auto p-3 ${activePanel === "themes" ? "" : "hidden"}`, children: [
|
|
1890
|
+
/* @__PURE__ */ jsx3("p", { className: "text-xs text-gray-400 font-bold uppercase tracking-wider mb-3", children: "Temas" }),
|
|
1891
|
+
/* @__PURE__ */ jsx3("div", { className: "grid grid-cols-2 gap-2", children: LANDING_THEMES.map((t) => {
|
|
1737
1892
|
const isActive = theme === t.id;
|
|
1738
1893
|
const displayColors = isActive && customColors && Object.keys(customColors).length ? { ...t.colors, ...customColors } : t.colors;
|
|
1739
|
-
return /* @__PURE__ */
|
|
1894
|
+
return /* @__PURE__ */ jsxs3(
|
|
1740
1895
|
"button",
|
|
1741
1896
|
{
|
|
1742
1897
|
onClick: () => {
|
|
@@ -1746,12 +1901,12 @@ ${html}` : html;
|
|
|
1746
1901
|
},
|
|
1747
1902
|
className: `flex flex-col items-center gap-1.5 p-2.5 rounded-xl border-2 transition-all ${isActive ? "border-brand-500 bg-brand-500/10" : "border-gray-700 hover:border-gray-500"}`,
|
|
1748
1903
|
children: [
|
|
1749
|
-
/* @__PURE__ */
|
|
1750
|
-
/* @__PURE__ */
|
|
1751
|
-
/* @__PURE__ */
|
|
1752
|
-
/* @__PURE__ */
|
|
1904
|
+
/* @__PURE__ */ jsxs3("div", { className: "flex gap-1", children: [
|
|
1905
|
+
/* @__PURE__ */ jsx3("div", { className: "w-5 h-5 rounded-full border border-gray-600", style: { background: displayColors.primary }, title: "Primary" }),
|
|
1906
|
+
/* @__PURE__ */ jsx3("div", { className: "w-5 h-5 rounded-full border border-gray-600", style: { background: displayColors.surface }, title: "Surface" }),
|
|
1907
|
+
/* @__PURE__ */ jsx3("div", { className: "w-5 h-5 rounded-full border border-gray-600", style: { background: displayColors.accent }, title: "Accent" })
|
|
1753
1908
|
] }),
|
|
1754
|
-
/* @__PURE__ */
|
|
1909
|
+
/* @__PURE__ */ jsx3("span", { className: "text-[10px] font-bold text-gray-300", children: t.label })
|
|
1755
1910
|
]
|
|
1756
1911
|
},
|
|
1757
1912
|
t.id
|
|
@@ -1776,12 +1931,12 @@ ${html}` : html;
|
|
|
1776
1931
|
"on-secondary": "On Secondary",
|
|
1777
1932
|
"on-accent": "On Accent"
|
|
1778
1933
|
};
|
|
1779
|
-
return /* @__PURE__ */
|
|
1934
|
+
return /* @__PURE__ */ jsx3("div", { className: "mt-3 space-y-1", children: Object.entries(currentColors).map(([key, hex]) => /* @__PURE__ */ jsxs3(
|
|
1780
1935
|
"label",
|
|
1781
1936
|
{
|
|
1782
1937
|
className: "flex items-center gap-2 w-full px-2 py-1 rounded-lg hover:bg-gray-800 transition-colors group text-left cursor-pointer",
|
|
1783
1938
|
children: [
|
|
1784
|
-
/* @__PURE__ */
|
|
1939
|
+
/* @__PURE__ */ jsx3(
|
|
1785
1940
|
"input",
|
|
1786
1941
|
{
|
|
1787
1942
|
type: "color",
|
|
@@ -1793,19 +1948,19 @@ ${html}` : html;
|
|
|
1793
1948
|
className: "w-4 h-4 rounded border border-gray-600 shrink-0 cursor-pointer p-0 bg-transparent [&::-webkit-color-swatch-wrapper]:p-0 [&::-webkit-color-swatch]:border-none [&::-webkit-color-swatch]:rounded"
|
|
1794
1949
|
}
|
|
1795
1950
|
),
|
|
1796
|
-
/* @__PURE__ */
|
|
1797
|
-
/* @__PURE__ */
|
|
1951
|
+
/* @__PURE__ */ jsx3("span", { className: "text-[10px] text-gray-400 flex-1 truncate", children: COLOR_LABELS[key] || key }),
|
|
1952
|
+
/* @__PURE__ */ jsx3("code", { className: "text-[10px] text-gray-500 group-hover:text-gray-300 font-mono", children: hex })
|
|
1798
1953
|
]
|
|
1799
1954
|
},
|
|
1800
1955
|
key
|
|
1801
1956
|
)) });
|
|
1802
1957
|
})(),
|
|
1803
|
-
brandKits && brandKits.length > 0 && /* @__PURE__ */
|
|
1804
|
-
/* @__PURE__ */
|
|
1805
|
-
/* @__PURE__ */
|
|
1958
|
+
brandKits && brandKits.length > 0 && /* @__PURE__ */ jsxs3(Fragment, { children: [
|
|
1959
|
+
/* @__PURE__ */ jsx3("p", { className: "text-xs text-gray-400 font-bold uppercase tracking-wider mt-5 mb-3", children: "Brand Kits" }),
|
|
1960
|
+
/* @__PURE__ */ jsx3("div", { className: "grid grid-cols-2 gap-2", children: brandKits.map((bk) => {
|
|
1806
1961
|
const bkBase = flattenColors(bk.colors) || {};
|
|
1807
1962
|
const displayColors = activeBrandKitId === bk.id && customColors && Object.keys(customColors).length ? { ...bkBase, ...customColors } : bkBase;
|
|
1808
|
-
return /* @__PURE__ */
|
|
1963
|
+
return /* @__PURE__ */ jsxs3(
|
|
1809
1964
|
"button",
|
|
1810
1965
|
{
|
|
1811
1966
|
onClick: () => {
|
|
@@ -1815,7 +1970,7 @@ ${html}` : html;
|
|
|
1815
1970
|
},
|
|
1816
1971
|
className: `flex flex-col items-center gap-1.5 p-2.5 rounded-xl border-2 transition-all ${activeBrandKitId === bk.id ? "border-brand-500 bg-brand-500/10" : "border-gray-700 hover:border-gray-500"}`,
|
|
1817
1972
|
children: [
|
|
1818
|
-
/* @__PURE__ */
|
|
1973
|
+
/* @__PURE__ */ jsx3("div", { className: "flex gap-1", children: ["primary", "surface", "accent"].map((key) => /* @__PURE__ */ jsx3(
|
|
1819
1974
|
"div",
|
|
1820
1975
|
{
|
|
1821
1976
|
className: "w-5 h-5 rounded-full border border-gray-600",
|
|
@@ -1823,7 +1978,7 @@ ${html}` : html;
|
|
|
1823
1978
|
},
|
|
1824
1979
|
key
|
|
1825
1980
|
)) }),
|
|
1826
|
-
/* @__PURE__ */
|
|
1981
|
+
/* @__PURE__ */ jsx3("span", { className: "text-[10px] font-bold text-gray-300 truncate max-w-full", children: bk.name })
|
|
1827
1982
|
]
|
|
1828
1983
|
},
|
|
1829
1984
|
bk.id
|
|
@@ -1834,12 +1989,12 @@ ${html}` : html;
|
|
|
1834
1989
|
if (!bk) return null;
|
|
1835
1990
|
const baseColors = flattenColors(bk.colors) || {};
|
|
1836
1991
|
const colors = customColors && Object.keys(customColors).length ? { ...baseColors, ...customColors } : baseColors;
|
|
1837
|
-
return /* @__PURE__ */
|
|
1992
|
+
return /* @__PURE__ */ jsx3("div", { className: "mt-3 space-y-1", children: Object.entries(colors).map(([key, hex]) => /* @__PURE__ */ jsxs3(
|
|
1838
1993
|
"label",
|
|
1839
1994
|
{
|
|
1840
1995
|
className: "flex items-center gap-2 w-full px-2 py-1 rounded-lg hover:bg-gray-800 transition-colors group text-left cursor-pointer",
|
|
1841
1996
|
children: [
|
|
1842
|
-
/* @__PURE__ */
|
|
1997
|
+
/* @__PURE__ */ jsx3(
|
|
1843
1998
|
"input",
|
|
1844
1999
|
{
|
|
1845
2000
|
type: "color",
|
|
@@ -1851,8 +2006,8 @@ ${html}` : html;
|
|
|
1851
2006
|
className: "w-4 h-4 rounded border border-gray-600 shrink-0 cursor-pointer p-0 bg-transparent [&::-webkit-color-swatch-wrapper]:p-0 [&::-webkit-color-swatch]:border-none [&::-webkit-color-swatch]:rounded"
|
|
1852
2007
|
}
|
|
1853
2008
|
),
|
|
1854
|
-
/* @__PURE__ */
|
|
1855
|
-
/* @__PURE__ */
|
|
2009
|
+
/* @__PURE__ */ jsx3("span", { className: "text-[10px] text-gray-400 flex-1 truncate", children: key }),
|
|
2010
|
+
/* @__PURE__ */ jsx3("code", { className: "text-[10px] text-gray-500 group-hover:text-gray-300 font-mono", children: hex })
|
|
1856
2011
|
]
|
|
1857
2012
|
},
|
|
1858
2013
|
key
|
|
@@ -1861,16 +2016,16 @@ ${html}` : html;
|
|
|
1861
2016
|
] })
|
|
1862
2017
|
] })
|
|
1863
2018
|
] });
|
|
1864
|
-
const canvas = /* @__PURE__ */
|
|
1865
|
-
return /* @__PURE__ */
|
|
1866
|
-
panelSide === "right" ? /* @__PURE__ */
|
|
2019
|
+
const canvas = /* @__PURE__ */ jsx3("div", { ref: editorContainerRef, className: "flex-1 h-full bg-black" });
|
|
2020
|
+
return /* @__PURE__ */ jsxs3("div", { className: "flex h-full w-full relative", children: [
|
|
2021
|
+
panelSide === "right" ? /* @__PURE__ */ jsxs3(Fragment, { children: [
|
|
1867
2022
|
canvas,
|
|
1868
2023
|
sidebar
|
|
1869
|
-
] }) : /* @__PURE__ */
|
|
2024
|
+
] }) : /* @__PURE__ */ jsxs3(Fragment, { children: [
|
|
1870
2025
|
sidebar,
|
|
1871
2026
|
canvas
|
|
1872
2027
|
] }),
|
|
1873
|
-
/* @__PURE__ */
|
|
2028
|
+
/* @__PURE__ */ jsx3(
|
|
1874
2029
|
"div",
|
|
1875
2030
|
{
|
|
1876
2031
|
className: `absolute inset-0 z-50 pointer-events-none bg-gray-950/40 backdrop-blur-[2px] transition-all duration-500 ${ready ? "opacity-0 invisible" : "opacity-100"}`
|
|
@@ -1883,6 +2038,7 @@ GrapesEditor.displayName = "GrapesEditor";
|
|
|
1883
2038
|
var GrapesEditor_default = GrapesEditor;
|
|
1884
2039
|
export {
|
|
1885
2040
|
GrapesEditor_default as GrapesEditor,
|
|
2041
|
+
ImageSrcEditor,
|
|
1886
2042
|
LANDING_BLOCKS,
|
|
1887
2043
|
TailwindClassEditor
|
|
1888
2044
|
};
|