@easybits.cloud/html-tailwind-generator 0.2.138 → 0.2.140

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.
@@ -1177,7 +1177,7 @@ function ImageSrcEditor({ editor }) {
1177
1177
  }
1178
1178
 
1179
1179
  // src/components4/grapesDarkCss.ts
1180
- var GRAPES_DARK_CSS = `
1180
+ var GRAPES_DARK_CSS_CLASSIC = `
1181
1181
  /* Dark theme for GrapesJS editor \u2014 matches EasyBits dark sidebar */
1182
1182
 
1183
1183
  /* Main editor background */
@@ -1277,16 +1277,184 @@ var GRAPES_DARK_CSS = `
1277
1277
  .gjs-rte-actionbar { background-color: #1f2937 !important; }
1278
1278
  .gjs-rte-action { color: #e5e7eb !important; }
1279
1279
  `;
1280
+ var DENIK_OVERRIDES = `
1281
+ /* \u2550\u2550\u2550 Denik variant overrides \u2550\u2550\u2550 */
1282
+
1283
+ /* Editor chrome */
1284
+ .gjs-editor { background-color: white !important; }
1285
+
1286
+ /* Block manager \u2014 flat list */
1287
+ .gjs-blocks-cs { background: transparent !important; }
1288
+ .gjs-block-categories { background: transparent !important; padding: 0 !important; }
1289
+
1290
+ /* All blocks: horizontal row \u2014 [icon-box] [label] */
1291
+ .gjs-blocks-c .gjs-block.gjs-block {
1292
+ background: transparent !important;
1293
+ color: #e5e7eb !important;
1294
+ border: none !important;
1295
+ border-radius: 6px !important;
1296
+ display: flex !important;
1297
+ flex-direction: row !important;
1298
+ align-items: center !important;
1299
+ justify-content: flex-start !important;
1300
+ text-align: left !important;
1301
+ gap: 10px !important;
1302
+ padding: 0 10px !important;
1303
+ margin: 0 !important;
1304
+ width: 100% !important;
1305
+ min-height: unset !important;
1306
+ height: 24px !important;
1307
+ box-shadow: none !important;
1308
+ cursor: grab !important;
1309
+ }
1310
+ .gjs-blocks-c .gjs-block.gjs-block:hover { background: rgba(255,255,255,0.06) !important; }
1311
+
1312
+ /* Icon box: 24x24 rounded square #2D2D2D \u2014 target BOTH class variants */
1313
+ .gjs-block .gjs-block__media,
1314
+ .gjs-block .gjs-block-media {
1315
+ width: 24px !important;
1316
+ height: 24px !important;
1317
+ min-width: 24px !important;
1318
+ max-width: 24px !important;
1319
+ min-height: 24px !important;
1320
+ max-height: 24px !important;
1321
+ line-height: 0 !important;
1322
+ background: #2D2D2D !important;
1323
+ border-radius: 5px !important;
1324
+ display: flex !important;
1325
+ align-items: center !important;
1326
+ justify-content: center !important;
1327
+ padding: 4px !important;
1328
+ flex-shrink: 0 !important;
1329
+ }
1330
+ .gjs-block .gjs-block__media svg,
1331
+ .gjs-block .gjs-block-media svg {
1332
+ width: 14px !important;
1333
+ height: 14px !important;
1334
+ display: block !important;
1335
+ }
1336
+ .gjs-block svg { fill: #9ca3af !important; stroke: #9ca3af !important; }
1337
+
1338
+ /* Label: 14px, left-aligned */
1339
+ .gjs-blocks-c .gjs-block .gjs-block-label {
1340
+ color: #d1d5db !important;
1341
+ font-size: 14px !important;
1342
+ font-weight: 400 !important;
1343
+ text-align: left !important;
1344
+ padding: 0 !important;
1345
+ width: auto !important;
1346
+ flex: 1 !important;
1347
+ line-height: 24px !important;
1348
+ }
1349
+
1350
+ /* Blocks container: vertical single-column list */
1351
+ .gjs-block-category:first-child .gjs-blocks-c { display: flex !important; gap: 12px !important; }
1352
+ .gjs-blocks-c {
1353
+ flex-direction: column !important;
1354
+ flex-wrap: nowrap !important;
1355
+ gap: 8px !important;
1356
+ padding: 4px 0 !important;
1357
+ width: 100% !important;
1358
+ }
1359
+ /* Respect GrapesJS collapse: when inline style has display:none, honor it */
1360
+ .gjs-blocks-c[style*="none"] { display: none !important; }
1361
+
1362
+ /* All categories: no border, transparent */
1363
+ .gjs-block-category {
1364
+ background: transparent !important;
1365
+ border: none !important;
1366
+ border-bottom: none !important;
1367
+ }
1368
+
1369
+ /* \u2500\u2500\u2500 B\xE1sicos (first category): NOT collapsible, always open, flat \u2500\u2500\u2500 */
1370
+ .gjs-block-category:first-child .gjs-title {
1371
+ background: transparent !important;
1372
+ color: #9ca3af !important;
1373
+ font-size: 11px !important;
1374
+ font-weight: 600 !important;
1375
+ text-transform: uppercase !important;
1376
+ letter-spacing: 0.05em !important;
1377
+ padding: 14px 10px 6px !important;
1378
+ border: none !important;
1379
+ cursor: default !important;
1380
+ pointer-events: none !important;
1381
+ }
1382
+ .gjs-block-category:first-child .gjs-caret-icon { display: none !important; }
1383
+ /* Force always open even if GrapesJS collapsed it */
1384
+ .gjs-block-category:first-child .gjs-blocks-c { display: flex !important; }
1385
+
1386
+ /* \u2500\u2500\u2500 Secciones (all other categories): collapsible \u2500\u2500\u2500 */
1387
+ .gjs-block-category:not(:first-child) .gjs-title {
1388
+ background: transparent !important;
1389
+ color: #e5e7eb !important;
1390
+ font-size: 14px !important;
1391
+ font-weight: 500 !important;
1392
+ padding: 8px 10px !important;
1393
+ border: none !important;
1394
+ display: flex !important;
1395
+ align-items: center !important;
1396
+ gap: 10px !important;
1397
+ cursor: pointer !important;
1398
+ }
1399
+ .gjs-block-category:not(:first-child) .gjs-title:hover { background: rgba(255,255,255,0.04) !important; }
1400
+ .gjs-block-category:not(:first-child) .gjs-caret-icon { color: #6b7280 !important; margin-left: auto !important; font-size: 12px !important; }
1401
+
1402
+ /* "Secciones" label above the section categories */
1403
+ .gjs-block-category:nth-child(2)::before {
1404
+ content: 'Secciones';
1405
+ display: block;
1406
+ font-size: 11px;
1407
+ font-weight: 600;
1408
+ text-transform: uppercase;
1409
+ letter-spacing: 0.05em;
1410
+ color: #9ca3af;
1411
+ padding: 18px 10px 6px;
1412
+ }
1413
+
1414
+ /* Section category title icons: colored cubes (override the title text with an icon prefix) */
1415
+ .gjs-block-category:not(:first-child) .gjs-title::before {
1416
+ content: '';
1417
+ display: inline-block;
1418
+ width: 24px;
1419
+ height: 24px;
1420
+ min-width: 24px;
1421
+ border-radius: 5px;
1422
+ background: #ec4899;
1423
+ }
1424
+ /* Per-category colors for the title icon */
1425
+ .gjs-block-category:nth-child(2) .gjs-title::before { background: #f472b6; }
1426
+ .gjs-block-category:nth-child(3) .gjs-title::before { background: #fb923c; }
1427
+ .gjs-block-category:nth-child(4) .gjs-title::before { background: #f87171; }
1428
+ .gjs-block-category:nth-child(5) .gjs-title::before { background: #facc15; }
1429
+ .gjs-block-category:nth-child(6) .gjs-title::before { background: #4ade80; }
1430
+ .gjs-block-category:nth-child(7) .gjs-title::before { background: #60a5fa; }
1431
+ .gjs-block-category:nth-child(8) .gjs-title::before { background: #c084fc; }
1432
+ .gjs-block-category:nth-child(9) .gjs-title::before { background: #a8a29e; }
1433
+
1434
+ /* Section title: [icon] [text] ... [arrow] */
1435
+ .gjs-block-category:not(:first-child) .gjs-title { justify-content: flex-start !important; }
1436
+ .gjs-block-category:not(:first-child) .gjs-caret-icon { order: 99 !important; margin-left: auto !important; }
1437
+
1438
+ /* Canvas \u2014 white floating frame with 32px margin */
1439
+ .gjs-cv-canvas { background-color: white !important; width: 100% !important; height: 100% !important; top: 0 !important; left: 0 !important; }
1440
+ .gjs-frame-wrapper { background: white !important; top: 32px !important; left: 32px !important; right: 32px !important; bottom: 32px !important; width: auto !important; height: auto !important; padding: 0 !important; }
1441
+ .gjs-frame { left: 0 !important; }
1442
+ `;
1443
+ var GRAPES_DARK_CSS_DENIK = GRAPES_DARK_CSS_CLASSIC + DENIK_OVERRIDES;
1444
+ function getGrapesCss(variant = "classic") {
1445
+ return variant === "denik" ? GRAPES_DARK_CSS_DENIK : GRAPES_DARK_CSS_CLASSIC;
1446
+ }
1280
1447
 
1281
1448
  // src/components4/GrapesEditor.tsx
1282
1449
  import { Fragment, jsx as jsx3, jsxs as jsxs3 } from "react/jsx-runtime";
1283
- var darkCssInjected = false;
1284
- function injectDarkCss() {
1285
- if (darkCssInjected || typeof document === "undefined") return;
1286
- darkCssInjected = true;
1450
+ var injectedVariants = /* @__PURE__ */ new Set();
1451
+ function injectDarkCss(variant) {
1452
+ if (typeof document === "undefined") return;
1453
+ if (injectedVariants.has(variant)) return;
1454
+ injectedVariants.add(variant);
1287
1455
  const style = document.createElement("style");
1288
- style.setAttribute("data-grapes-dark", "");
1289
- style.textContent = GRAPES_DARK_CSS;
1456
+ style.setAttribute("data-grapes-css", variant);
1457
+ style.textContent = getGrapesCss(variant);
1290
1458
  document.head.appendChild(style);
1291
1459
  }
1292
1460
  function flattenColors(colors) {
@@ -1305,17 +1473,27 @@ function flattenColors(colors) {
1305
1473
  }
1306
1474
  return Object.keys(out).length ? out : void 0;
1307
1475
  }
1308
- var PANEL_TABS = [
1309
- { id: "blocks", label: "Bloques", icon: "\u229E" },
1310
- { id: "layers", label: "Capas", icon: "\u2630" },
1311
- { id: "styles", label: "Estilos", icon: "\u25D1" },
1312
- { id: "themes", label: "Temas", icon: "\u25C8" }
1313
- ];
1476
+ function getPanelTabs(variant) {
1477
+ if (variant === "denik") {
1478
+ return [
1479
+ { id: "blocks", label: "+ Secci\xF3n", icon: "\u229E" },
1480
+ { id: "layers", label: "Capas", icon: "\u25C7" },
1481
+ { id: "styles", label: "Estilos", icon: "\u25D1" },
1482
+ { id: "themes", label: "Temas", icon: "\u25C8" }
1483
+ ];
1484
+ }
1485
+ return [
1486
+ { id: "blocks", label: "Bloques", icon: "\u229E" },
1487
+ { id: "layers", label: "Capas", icon: "\u2630" },
1488
+ { id: "styles", label: "Estilos", icon: "\u25D1" },
1489
+ { id: "themes", label: "Temas", icon: "\u25C8" }
1490
+ ];
1491
+ }
1314
1492
  var GrapesEditor = forwardRef(
1315
- ({ initialHtml, theme = "minimal", customColors: rawCustomColors, brandKits, onChange, onAiAction, onThemeChange, onBrandKitChange, initialBrandKitId, hiddenTabs = [], canvasStyles, devices, panelSide = "left", blocks: customBlocks, onVisibleSectionChange }, ref) => {
1493
+ ({ initialHtml, theme = "minimal", customColors: rawCustomColors, brandKits, onChange, onAiAction, onThemeChange, onBrandKitChange, initialBrandKitId, hiddenTabs = [], canvasStyles, devices, panelSide = "left", blocks: customBlocks, onVisibleSectionChange, editorVariant = "classic" }, ref) => {
1316
1494
  useEffect3(() => {
1317
- injectDarkCss();
1318
- }, []);
1495
+ injectDarkCss(editorVariant);
1496
+ }, [editorVariant]);
1319
1497
  const customColors = flattenColors(rawCustomColors);
1320
1498
  const editorContainerRef = useRef3(null);
1321
1499
  const blocksRef = useRef3(null);
@@ -1336,7 +1514,7 @@ var GrapesEditor = forwardRef(
1336
1514
  const customColorsRef = useRef3(customColors);
1337
1515
  customColorsRef.current = customColors;
1338
1516
  const [activeBrandKitId, setActiveBrandKitId] = useState3(initialBrandKitId || null);
1339
- const visibleTabs = PANEL_TABS.filter((t) => !hiddenTabs.includes(t.id));
1517
+ const visibleTabs = getPanelTabs(editorVariant).filter((t) => !hiddenTabs.includes(t.id));
1340
1518
  const [activePanel, setActivePanel] = useState3(
1341
1519
  () => visibleTabs.find((t) => t.id === "styles")?.id ?? visibleTabs[0]?.id ?? "styles"
1342
1520
  );
@@ -1587,7 +1765,7 @@ ${vars}
1587
1765
  }
1588
1766
  });
1589
1767
  editor.on("component:selected", () => {
1590
- setActivePanel("styles");
1768
+ if (!hiddenTabs.includes("styles")) setActivePanel("styles");
1591
1769
  });
1592
1770
  editor.on("component:deselected", () => {
1593
1771
  });
@@ -1853,15 +2031,23 @@ ${html}` : html;
1853
2031
  setTimeout(() => setThemeVersion((v) => v + 1), 100);
1854
2032
  }, [theme, customColors]);
1855
2033
  const sidebarBorder = panelSide === "right" ? "border-l" : "border-r";
1856
- const sidebar = /* @__PURE__ */ jsxs3("div", { className: `w-80 shrink-0 flex flex-col bg-black ${sidebarBorder} border-gray-700 overflow-hidden`, children: [
1857
- /* @__PURE__ */ jsx3("div", { className: "flex border-b border-gray-700", children: visibleTabs.map((tab) => /* @__PURE__ */ jsxs3(
2034
+ const sidebarContainerClass = editorVariant === "denik" ? `w-60 shrink-0 flex flex-col bg-[#11151A] ${sidebarBorder} border-gray-700 overflow-hidden` : `w-80 shrink-0 flex flex-col bg-black ${sidebarBorder} border-gray-700 overflow-hidden`;
2035
+ const tabsRowClass = editorVariant === "denik" ? "flex gap-0 px-3 py-3" : "flex border-b border-gray-700";
2036
+ const tabButtonClass = (isActive) => {
2037
+ if (editorVariant === "denik") {
2038
+ return `px-4 py-2 text-sm font-medium transition-colors flex items-center gap-2 rounded-full ${isActive ? "bg-[#2A2B31] text-white" : "text-gray-400 hover:text-gray-200"}`;
2039
+ }
2040
+ return `flex-1 py-2.5 text-xs font-bold transition-colors ${isActive ? "bg-gray-800 text-white border-b-2 border-brand-500" : "text-gray-400 hover:text-gray-200 hover:bg-gray-800/50"}`;
2041
+ };
2042
+ const sidebar = /* @__PURE__ */ jsxs3("div", { className: sidebarContainerClass, children: [
2043
+ /* @__PURE__ */ jsx3("div", { className: tabsRowClass, children: visibleTabs.map((tab) => /* @__PURE__ */ jsxs3(
1858
2044
  "button",
1859
2045
  {
1860
2046
  onClick: () => setActivePanel(tab.id),
1861
- 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"}`,
2047
+ className: tabButtonClass(activePanel === tab.id),
1862
2048
  title: tab.label,
1863
2049
  children: [
1864
- /* @__PURE__ */ jsx3("span", { className: "block text-base mb-0.5", children: tab.icon }),
2050
+ editorVariant === "denik" ? /* @__PURE__ */ jsx3("span", { className: "text-sm", children: tab.icon }) : /* @__PURE__ */ jsx3("span", { className: "block text-base mb-0.5", children: tab.icon }),
1865
2051
  tab.label
1866
2052
  ]
1867
2053
  },
@@ -1881,7 +2067,7 @@ ${html}` : html;
1881
2067
  className: `flex-1 overflow-auto ${activePanel === "layers" ? "" : "hidden"}`
1882
2068
  }
1883
2069
  ),
1884
- /* @__PURE__ */ jsxs3("div", { className: `flex-1 overflow-auto ${activePanel === "styles" ? "" : "hidden"}`, children: [
2070
+ !hiddenTabs.includes("styles") && /* @__PURE__ */ jsxs3("div", { className: `flex-1 overflow-auto ${activePanel === "styles" ? "" : "hidden"}`, children: [
1885
2071
  ready && /* @__PURE__ */ jsx3(ImageSrcEditor, { editor: editorRef.current }),
1886
2072
  ready && /* @__PURE__ */ jsx3(
1887
2073
  TailwindClassEditor,
@@ -1896,7 +2082,7 @@ ${html}` : html;
1896
2082
  }
1897
2083
  )
1898
2084
  ] }),
1899
- /* @__PURE__ */ jsxs3("div", { className: `flex-1 overflow-auto p-3 ${activePanel === "themes" ? "" : "hidden"}`, children: [
2085
+ !hiddenTabs.includes("themes") && /* @__PURE__ */ jsxs3("div", { className: `flex-1 overflow-auto p-3 ${activePanel === "themes" ? "" : "hidden"}`, children: [
1900
2086
  /* @__PURE__ */ jsx3("p", { className: "text-xs text-gray-400 font-bold uppercase tracking-wider mb-3", children: "Temas" }),
1901
2087
  /* @__PURE__ */ jsx3("div", { className: "grid grid-cols-2 gap-2", children: LANDING_THEMES.map((t) => {
1902
2088
  const isActive = theme === t.id;
@@ -2026,7 +2212,8 @@ ${html}` : html;
2026
2212
  ] })
2027
2213
  ] })
2028
2214
  ] });
2029
- const canvas = /* @__PURE__ */ jsx3("div", { ref: editorContainerRef, className: "flex-1 h-full bg-black" });
2215
+ const canvasClass = editorVariant === "denik" ? "flex-1 h-full bg-white relative" : "flex-1 h-full bg-black";
2216
+ const canvas = /* @__PURE__ */ jsx3("div", { ref: editorContainerRef, className: canvasClass });
2030
2217
  return /* @__PURE__ */ jsxs3("div", { className: "flex h-full w-full relative", children: [
2031
2218
  panelSide === "right" ? /* @__PURE__ */ jsxs3(Fragment, { children: [
2032
2219
  canvas,