cms-block-editor 1.0.16 → 1.0.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +59 -0
- package/dist/index.css +383 -0
- package/dist/index.css.map +1 -1
- package/dist/index.d.mts +233 -2
- package/dist/index.mjs +1084 -201
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -6420,37 +6420,903 @@ function EmbedPlugin() {
|
|
|
6420
6420
|
] });
|
|
6421
6421
|
}
|
|
6422
6422
|
|
|
6423
|
-
// src/
|
|
6423
|
+
// src/plugins/SEOPlugin.tsx
|
|
6424
|
+
import { useState as useState16, useEffect as useEffect17 } from "react";
|
|
6425
|
+
import { useLexicalComposerContext as useLexicalComposerContext14 } from "@lexical/react/LexicalComposerContext";
|
|
6426
|
+
import { $generateHtmlFromNodes as $generateHtmlFromNodes2 } from "@lexical/html";
|
|
6427
|
+
|
|
6428
|
+
// src/seo/seoAnalyzer.ts
|
|
6429
|
+
function analyzeSEO(content, metadata) {
|
|
6430
|
+
const issues = [];
|
|
6431
|
+
const suggestions = [];
|
|
6432
|
+
const metrics = calculateMetrics(content, metadata);
|
|
6433
|
+
if (!metadata.title) {
|
|
6434
|
+
issues.push({
|
|
6435
|
+
type: "error",
|
|
6436
|
+
category: "meta",
|
|
6437
|
+
message: "Missing page title",
|
|
6438
|
+
impact: "high"
|
|
6439
|
+
});
|
|
6440
|
+
} else {
|
|
6441
|
+
if (metrics.titleLength < 30) {
|
|
6442
|
+
issues.push({
|
|
6443
|
+
type: "warning",
|
|
6444
|
+
category: "meta",
|
|
6445
|
+
message: "Title is too short (recommended: 50-60 characters)",
|
|
6446
|
+
impact: "medium"
|
|
6447
|
+
});
|
|
6448
|
+
} else if (metrics.titleLength > 60) {
|
|
6449
|
+
issues.push({
|
|
6450
|
+
type: "warning",
|
|
6451
|
+
category: "meta",
|
|
6452
|
+
message: "Title is too long (recommended: 50-60 characters)",
|
|
6453
|
+
impact: "medium"
|
|
6454
|
+
});
|
|
6455
|
+
}
|
|
6456
|
+
}
|
|
6457
|
+
if (!metadata.description) {
|
|
6458
|
+
issues.push({
|
|
6459
|
+
type: "error",
|
|
6460
|
+
category: "meta",
|
|
6461
|
+
message: "Missing meta description",
|
|
6462
|
+
impact: "high"
|
|
6463
|
+
});
|
|
6464
|
+
} else {
|
|
6465
|
+
if (metrics.descriptionLength < 120) {
|
|
6466
|
+
issues.push({
|
|
6467
|
+
type: "warning",
|
|
6468
|
+
category: "meta",
|
|
6469
|
+
message: "Description is too short (recommended: 150-160 characters)",
|
|
6470
|
+
impact: "medium"
|
|
6471
|
+
});
|
|
6472
|
+
} else if (metrics.descriptionLength > 160) {
|
|
6473
|
+
issues.push({
|
|
6474
|
+
type: "warning",
|
|
6475
|
+
category: "meta",
|
|
6476
|
+
message: "Description is too long (recommended: 150-160 characters)",
|
|
6477
|
+
impact: "medium"
|
|
6478
|
+
});
|
|
6479
|
+
}
|
|
6480
|
+
}
|
|
6481
|
+
if (metrics.headingCount.h1 === 0) {
|
|
6482
|
+
issues.push({
|
|
6483
|
+
type: "error",
|
|
6484
|
+
category: "structure",
|
|
6485
|
+
message: "Missing H1 heading",
|
|
6486
|
+
impact: "high"
|
|
6487
|
+
});
|
|
6488
|
+
} else if (metrics.headingCount.h1 > 1) {
|
|
6489
|
+
issues.push({
|
|
6490
|
+
type: "warning",
|
|
6491
|
+
category: "structure",
|
|
6492
|
+
message: "Multiple H1 headings found (recommended: 1)",
|
|
6493
|
+
impact: "medium"
|
|
6494
|
+
});
|
|
6495
|
+
}
|
|
6496
|
+
if (metrics.imageCount > 0) {
|
|
6497
|
+
const altPercentage = metrics.imagesWithAlt / metrics.imageCount * 100;
|
|
6498
|
+
if (altPercentage < 100) {
|
|
6499
|
+
issues.push({
|
|
6500
|
+
type: "warning",
|
|
6501
|
+
category: "accessibility",
|
|
6502
|
+
message: `${metrics.imageCount - metrics.imagesWithAlt} images missing alt text`,
|
|
6503
|
+
impact: "medium"
|
|
6504
|
+
});
|
|
6505
|
+
}
|
|
6506
|
+
}
|
|
6507
|
+
if (metrics.wordCount < 300) {
|
|
6508
|
+
issues.push({
|
|
6509
|
+
type: "warning",
|
|
6510
|
+
category: "content",
|
|
6511
|
+
message: "Content is too short (recommended: 300+ words)",
|
|
6512
|
+
impact: "medium"
|
|
6513
|
+
});
|
|
6514
|
+
}
|
|
6515
|
+
if (!metadata.ogTitle && !metadata.ogDescription) {
|
|
6516
|
+
suggestions.push({
|
|
6517
|
+
category: "Social Media",
|
|
6518
|
+
message: "Add Open Graph tags for better social media sharing",
|
|
6519
|
+
priority: "medium"
|
|
6520
|
+
});
|
|
6521
|
+
}
|
|
6522
|
+
if (!metadata.twitterCard) {
|
|
6523
|
+
suggestions.push({
|
|
6524
|
+
category: "Social Media",
|
|
6525
|
+
message: "Add Twitter Card tags for better Twitter sharing",
|
|
6526
|
+
priority: "low"
|
|
6527
|
+
});
|
|
6528
|
+
}
|
|
6529
|
+
if (!metadata.schema || metadata.schema.length === 0) {
|
|
6530
|
+
suggestions.push({
|
|
6531
|
+
category: "Structured Data",
|
|
6532
|
+
message: "Add Schema.org structured data for rich snippets",
|
|
6533
|
+
priority: "medium"
|
|
6534
|
+
});
|
|
6535
|
+
}
|
|
6536
|
+
if (!metadata.canonical) {
|
|
6537
|
+
suggestions.push({
|
|
6538
|
+
category: "Technical SEO",
|
|
6539
|
+
message: "Add canonical URL to prevent duplicate content issues",
|
|
6540
|
+
priority: "medium"
|
|
6541
|
+
});
|
|
6542
|
+
}
|
|
6543
|
+
const score = calculateSEOScore(issues, metrics);
|
|
6544
|
+
return {
|
|
6545
|
+
score,
|
|
6546
|
+
issues,
|
|
6547
|
+
suggestions,
|
|
6548
|
+
metrics
|
|
6549
|
+
};
|
|
6550
|
+
}
|
|
6551
|
+
function calculateMetrics(content, metadata) {
|
|
6552
|
+
const parser = new DOMParser();
|
|
6553
|
+
const doc = parser.parseFromString(content, "text/html");
|
|
6554
|
+
const headingCount = {
|
|
6555
|
+
h1: doc.querySelectorAll("h1").length,
|
|
6556
|
+
h2: doc.querySelectorAll("h2").length,
|
|
6557
|
+
h3: doc.querySelectorAll("h3").length,
|
|
6558
|
+
h4: doc.querySelectorAll("h4").length,
|
|
6559
|
+
h5: doc.querySelectorAll("h5").length,
|
|
6560
|
+
h6: doc.querySelectorAll("h6").length
|
|
6561
|
+
};
|
|
6562
|
+
const images = doc.querySelectorAll("img");
|
|
6563
|
+
const imageCount = images.length;
|
|
6564
|
+
const imagesWithAlt = Array.from(images).filter((img) => img.hasAttribute("alt")).length;
|
|
6565
|
+
const links = doc.querySelectorAll("a");
|
|
6566
|
+
const linkCount = links.length;
|
|
6567
|
+
const internalLinks = Array.from(links).filter((a) => {
|
|
6568
|
+
const href = a.getAttribute("href") || "";
|
|
6569
|
+
return href.startsWith("/") || href.startsWith("#");
|
|
6570
|
+
}).length;
|
|
6571
|
+
const externalLinks = linkCount - internalLinks;
|
|
6572
|
+
const text = doc.body.textContent || "";
|
|
6573
|
+
const words = text.trim().split(/\s+/).filter((word) => word.length > 0);
|
|
6574
|
+
const wordCount = words.length;
|
|
6575
|
+
const readingTime = Math.ceil(wordCount / 200);
|
|
6576
|
+
const keywordDensity = calculateKeywordDensity(words, metadata.keywords || []);
|
|
6577
|
+
return {
|
|
6578
|
+
titleLength: metadata.title?.length || 0,
|
|
6579
|
+
descriptionLength: metadata.description?.length || 0,
|
|
6580
|
+
headingCount,
|
|
6581
|
+
imageCount,
|
|
6582
|
+
imagesWithAlt,
|
|
6583
|
+
linkCount,
|
|
6584
|
+
internalLinks,
|
|
6585
|
+
externalLinks,
|
|
6586
|
+
wordCount,
|
|
6587
|
+
readingTime,
|
|
6588
|
+
keywordDensity
|
|
6589
|
+
};
|
|
6590
|
+
}
|
|
6591
|
+
function calculateKeywordDensity(words, keywords) {
|
|
6592
|
+
const density = {};
|
|
6593
|
+
const totalWords = words.length;
|
|
6594
|
+
keywords.forEach((keyword) => {
|
|
6595
|
+
const keywordLower = keyword.toLowerCase();
|
|
6596
|
+
const count = words.filter((word) => word.toLowerCase() === keywordLower).length;
|
|
6597
|
+
density[keyword] = totalWords > 0 ? count / totalWords * 100 : 0;
|
|
6598
|
+
});
|
|
6599
|
+
return density;
|
|
6600
|
+
}
|
|
6601
|
+
function calculateSEOScore(issues, metrics) {
|
|
6602
|
+
let score = 100;
|
|
6603
|
+
issues.forEach((issue) => {
|
|
6604
|
+
if (issue.type === "error") {
|
|
6605
|
+
score -= issue.impact === "high" ? 15 : issue.impact === "medium" ? 10 : 5;
|
|
6606
|
+
} else if (issue.type === "warning") {
|
|
6607
|
+
score -= issue.impact === "high" ? 10 : issue.impact === "medium" ? 5 : 2;
|
|
6608
|
+
}
|
|
6609
|
+
});
|
|
6610
|
+
if (metrics.wordCount >= 300) score += 5;
|
|
6611
|
+
if (metrics.headingCount.h1 === 1) score += 5;
|
|
6612
|
+
if (metrics.imageCount > 0 && metrics.imagesWithAlt === metrics.imageCount) score += 5;
|
|
6613
|
+
return Math.max(0, Math.min(100, score));
|
|
6614
|
+
}
|
|
6615
|
+
function generateSlug(text) {
|
|
6616
|
+
return text.toLowerCase().trim().replace(/[^\w\s-]/g, "").replace(/[\s_-]+/g, "-").replace(/^-+|-+$/g, "");
|
|
6617
|
+
}
|
|
6618
|
+
function extractKeywords(content, limit = 10) {
|
|
6619
|
+
const text = content.toLowerCase().replace(/<[^>]*>/g, " ");
|
|
6620
|
+
const words = text.split(/\s+/).filter((word) => word.length > 3);
|
|
6621
|
+
const frequency = {};
|
|
6622
|
+
words.forEach((word) => {
|
|
6623
|
+
frequency[word] = (frequency[word] || 0) + 1;
|
|
6624
|
+
});
|
|
6625
|
+
return Object.entries(frequency).sort((a, b) => b[1] - a[1]).slice(0, limit).map(([word]) => word);
|
|
6626
|
+
}
|
|
6627
|
+
|
|
6628
|
+
// src/seo/seoUtils.ts
|
|
6629
|
+
function generateMetaTags(metadata) {
|
|
6630
|
+
const tags = [];
|
|
6631
|
+
if (metadata.title) {
|
|
6632
|
+
tags.push(`<title>${escapeHtml(metadata.title)}</title>`);
|
|
6633
|
+
}
|
|
6634
|
+
if (metadata.description) {
|
|
6635
|
+
tags.push(`<meta name="description" content="${escapeHtml(metadata.description)}">`);
|
|
6636
|
+
}
|
|
6637
|
+
if (metadata.keywords && metadata.keywords.length > 0) {
|
|
6638
|
+
tags.push(`<meta name="keywords" content="${escapeHtml(metadata.keywords.join(", "))}">`);
|
|
6639
|
+
}
|
|
6640
|
+
if (metadata.author) {
|
|
6641
|
+
tags.push(`<meta name="author" content="${escapeHtml(metadata.author)}">`);
|
|
6642
|
+
}
|
|
6643
|
+
if (metadata.canonical) {
|
|
6644
|
+
tags.push(`<link rel="canonical" href="${escapeHtml(metadata.canonical)}">`);
|
|
6645
|
+
}
|
|
6646
|
+
if (metadata.robots) {
|
|
6647
|
+
tags.push(`<meta name="robots" content="${escapeHtml(metadata.robots)}">`);
|
|
6648
|
+
}
|
|
6649
|
+
if (metadata.ogTitle) {
|
|
6650
|
+
tags.push(`<meta property="og:title" content="${escapeHtml(metadata.ogTitle)}">`);
|
|
6651
|
+
}
|
|
6652
|
+
if (metadata.ogDescription) {
|
|
6653
|
+
tags.push(`<meta property="og:description" content="${escapeHtml(metadata.ogDescription)}">`);
|
|
6654
|
+
}
|
|
6655
|
+
if (metadata.ogImage) {
|
|
6656
|
+
tags.push(`<meta property="og:image" content="${escapeHtml(metadata.ogImage)}">`);
|
|
6657
|
+
}
|
|
6658
|
+
if (metadata.ogImageAlt) {
|
|
6659
|
+
tags.push(`<meta property="og:image:alt" content="${escapeHtml(metadata.ogImageAlt)}">`);
|
|
6660
|
+
}
|
|
6661
|
+
if (metadata.ogUrl) {
|
|
6662
|
+
tags.push(`<meta property="og:url" content="${escapeHtml(metadata.ogUrl)}">`);
|
|
6663
|
+
}
|
|
6664
|
+
if (metadata.ogType) {
|
|
6665
|
+
tags.push(`<meta property="og:type" content="${metadata.ogType}">`);
|
|
6666
|
+
}
|
|
6667
|
+
if (metadata.ogSiteName) {
|
|
6668
|
+
tags.push(`<meta property="og:site_name" content="${escapeHtml(metadata.ogSiteName)}">`);
|
|
6669
|
+
}
|
|
6670
|
+
if (metadata.ogLocale) {
|
|
6671
|
+
tags.push(`<meta property="og:locale" content="${metadata.ogLocale}">`);
|
|
6672
|
+
}
|
|
6673
|
+
if (metadata.twitterCard) {
|
|
6674
|
+
tags.push(`<meta name="twitter:card" content="${metadata.twitterCard}">`);
|
|
6675
|
+
}
|
|
6676
|
+
if (metadata.twitterSite) {
|
|
6677
|
+
tags.push(`<meta name="twitter:site" content="${escapeHtml(metadata.twitterSite)}">`);
|
|
6678
|
+
}
|
|
6679
|
+
if (metadata.twitterCreator) {
|
|
6680
|
+
tags.push(`<meta name="twitter:creator" content="${escapeHtml(metadata.twitterCreator)}">`);
|
|
6681
|
+
}
|
|
6682
|
+
if (metadata.twitterTitle) {
|
|
6683
|
+
tags.push(`<meta name="twitter:title" content="${escapeHtml(metadata.twitterTitle)}">`);
|
|
6684
|
+
}
|
|
6685
|
+
if (metadata.twitterDescription) {
|
|
6686
|
+
tags.push(`<meta name="twitter:description" content="${escapeHtml(metadata.twitterDescription)}">`);
|
|
6687
|
+
}
|
|
6688
|
+
if (metadata.twitterImage) {
|
|
6689
|
+
tags.push(`<meta name="twitter:image" content="${escapeHtml(metadata.twitterImage)}">`);
|
|
6690
|
+
}
|
|
6691
|
+
if (metadata.twitterImageAlt) {
|
|
6692
|
+
tags.push(`<meta name="twitter:image:alt" content="${escapeHtml(metadata.twitterImageAlt)}">`);
|
|
6693
|
+
}
|
|
6694
|
+
if (metadata.articlePublishedTime) {
|
|
6695
|
+
tags.push(`<meta property="article:published_time" content="${metadata.articlePublishedTime}">`);
|
|
6696
|
+
}
|
|
6697
|
+
if (metadata.articleModifiedTime) {
|
|
6698
|
+
tags.push(`<meta property="article:modified_time" content="${metadata.articleModifiedTime}">`);
|
|
6699
|
+
}
|
|
6700
|
+
if (metadata.articleAuthor) {
|
|
6701
|
+
tags.push(`<meta property="article:author" content="${escapeHtml(metadata.articleAuthor)}">`);
|
|
6702
|
+
}
|
|
6703
|
+
if (metadata.articleSection) {
|
|
6704
|
+
tags.push(`<meta property="article:section" content="${escapeHtml(metadata.articleSection)}">`);
|
|
6705
|
+
}
|
|
6706
|
+
if (metadata.articleTags && metadata.articleTags.length > 0) {
|
|
6707
|
+
metadata.articleTags.forEach((tag) => {
|
|
6708
|
+
tags.push(`<meta property="article:tag" content="${escapeHtml(tag)}">`);
|
|
6709
|
+
});
|
|
6710
|
+
}
|
|
6711
|
+
return tags.join("\n");
|
|
6712
|
+
}
|
|
6713
|
+
function generateStructuredData(schemas) {
|
|
6714
|
+
if (!schemas || schemas.length === 0) return "";
|
|
6715
|
+
const scripts = schemas.map((schema) => {
|
|
6716
|
+
return `<script type="application/ld+json">
|
|
6717
|
+
${JSON.stringify(schema, null, 2)}
|
|
6718
|
+
</script>`;
|
|
6719
|
+
});
|
|
6720
|
+
return scripts.join("\n");
|
|
6721
|
+
}
|
|
6722
|
+
function escapeHtml(text) {
|
|
6723
|
+
const map = {
|
|
6724
|
+
"&": "&",
|
|
6725
|
+
"<": "<",
|
|
6726
|
+
">": ">",
|
|
6727
|
+
'"': """,
|
|
6728
|
+
"'": "'"
|
|
6729
|
+
};
|
|
6730
|
+
return text.replace(/[&<>"']/g, (char) => map[char]);
|
|
6731
|
+
}
|
|
6732
|
+
function createDefaultMetadata(title, description) {
|
|
6733
|
+
return {
|
|
6734
|
+
title,
|
|
6735
|
+
description,
|
|
6736
|
+
ogTitle: title,
|
|
6737
|
+
ogDescription: description,
|
|
6738
|
+
ogType: "website",
|
|
6739
|
+
twitterCard: "summary_large_image",
|
|
6740
|
+
robots: "index, follow"
|
|
6741
|
+
};
|
|
6742
|
+
}
|
|
6743
|
+
function mergeMetadata(base, override) {
|
|
6744
|
+
return {
|
|
6745
|
+
...base,
|
|
6746
|
+
...override,
|
|
6747
|
+
keywords: override.keywords || base.keywords,
|
|
6748
|
+
schema: override.schema || base.schema,
|
|
6749
|
+
articleTags: override.articleTags || base.articleTags
|
|
6750
|
+
};
|
|
6751
|
+
}
|
|
6752
|
+
function validateMetadata(metadata) {
|
|
6753
|
+
const errors = [];
|
|
6754
|
+
if (!metadata.title) {
|
|
6755
|
+
errors.push("Title is required");
|
|
6756
|
+
} else if (metadata.title.length > 60) {
|
|
6757
|
+
errors.push("Title should be 60 characters or less");
|
|
6758
|
+
}
|
|
6759
|
+
if (!metadata.description) {
|
|
6760
|
+
errors.push("Description is required");
|
|
6761
|
+
} else if (metadata.description.length > 160) {
|
|
6762
|
+
errors.push("Description should be 160 characters or less");
|
|
6763
|
+
}
|
|
6764
|
+
if (metadata.ogImage && !isValidUrl(metadata.ogImage)) {
|
|
6765
|
+
errors.push("Open Graph image must be a valid URL");
|
|
6766
|
+
}
|
|
6767
|
+
if (metadata.canonical && !isValidUrl(metadata.canonical)) {
|
|
6768
|
+
errors.push("Canonical URL must be a valid URL");
|
|
6769
|
+
}
|
|
6770
|
+
return {
|
|
6771
|
+
valid: errors.length === 0,
|
|
6772
|
+
errors
|
|
6773
|
+
};
|
|
6774
|
+
}
|
|
6775
|
+
function isValidUrl(url) {
|
|
6776
|
+
try {
|
|
6777
|
+
new URL(url);
|
|
6778
|
+
return true;
|
|
6779
|
+
} catch {
|
|
6780
|
+
return false;
|
|
6781
|
+
}
|
|
6782
|
+
}
|
|
6783
|
+
async function copyMetadataToClipboard(metadata) {
|
|
6784
|
+
const metaTags = generateMetaTags(metadata);
|
|
6785
|
+
const structuredData = metadata.schema ? generateStructuredData(metadata.schema) : "";
|
|
6786
|
+
const fullContent = `${metaTags}
|
|
6787
|
+
|
|
6788
|
+
${structuredData}`;
|
|
6789
|
+
await navigator.clipboard.writeText(fullContent);
|
|
6790
|
+
}
|
|
6791
|
+
function downloadMetadata(metadata, filename = "seo-metadata.html") {
|
|
6792
|
+
const metaTags = generateMetaTags(metadata);
|
|
6793
|
+
const structuredData = metadata.schema ? generateStructuredData(metadata.schema) : "";
|
|
6794
|
+
const html = `<!DOCTYPE html>
|
|
6795
|
+
<html lang="en">
|
|
6796
|
+
<head>
|
|
6797
|
+
<meta charset="UTF-8">
|
|
6798
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
6799
|
+
${metaTags}
|
|
6800
|
+
${structuredData}
|
|
6801
|
+
</head>
|
|
6802
|
+
<body>
|
|
6803
|
+
<!-- Your content here -->
|
|
6804
|
+
</body>
|
|
6805
|
+
</html>`;
|
|
6806
|
+
const blob = new Blob([html], { type: "text/html" });
|
|
6807
|
+
const url = URL.createObjectURL(blob);
|
|
6808
|
+
const a = document.createElement("a");
|
|
6809
|
+
a.href = url;
|
|
6810
|
+
a.download = filename;
|
|
6811
|
+
a.click();
|
|
6812
|
+
URL.revokeObjectURL(url);
|
|
6813
|
+
}
|
|
6814
|
+
|
|
6815
|
+
// src/plugins/SEOPlugin.tsx
|
|
6424
6816
|
import { jsx as jsx16, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
6817
|
+
function SEOPlugin({ metadata: initialMetadata, onMetadataChange, showAnalysis = true }) {
|
|
6818
|
+
const [editor] = useLexicalComposerContext14();
|
|
6819
|
+
const [showPanel, setShowPanel] = useState16(false);
|
|
6820
|
+
const [metadata, setMetadata] = useState16(
|
|
6821
|
+
initialMetadata || createDefaultMetadata("", "")
|
|
6822
|
+
);
|
|
6823
|
+
const [analysis, setAnalysis] = useState16(null);
|
|
6824
|
+
const [activeTab, setActiveTab] = useState16("basic");
|
|
6825
|
+
useEffect17(() => {
|
|
6826
|
+
if (initialMetadata) {
|
|
6827
|
+
setMetadata(initialMetadata);
|
|
6828
|
+
}
|
|
6829
|
+
}, [initialMetadata]);
|
|
6830
|
+
const handleAnalyze = () => {
|
|
6831
|
+
editor.getEditorState().read(() => {
|
|
6832
|
+
const html = $generateHtmlFromNodes2(editor);
|
|
6833
|
+
const result = analyzeSEO(html, metadata);
|
|
6834
|
+
setAnalysis(result);
|
|
6835
|
+
});
|
|
6836
|
+
};
|
|
6837
|
+
const handleMetadataUpdate = (updates) => {
|
|
6838
|
+
const updated = { ...metadata, ...updates };
|
|
6839
|
+
setMetadata(updated);
|
|
6840
|
+
onMetadataChange?.(updated);
|
|
6841
|
+
};
|
|
6842
|
+
const handleGenerateSlug = () => {
|
|
6843
|
+
if (metadata.title) {
|
|
6844
|
+
const slug = generateSlug(metadata.title);
|
|
6845
|
+
handleMetadataUpdate({ canonical: `https://example.com/${slug}` });
|
|
6846
|
+
}
|
|
6847
|
+
};
|
|
6848
|
+
const handleExtractKeywords = () => {
|
|
6849
|
+
editor.getEditorState().read(() => {
|
|
6850
|
+
const html = $generateHtmlFromNodes2(editor);
|
|
6851
|
+
const keywords = extractKeywords(html, 10);
|
|
6852
|
+
handleMetadataUpdate({ keywords });
|
|
6853
|
+
});
|
|
6854
|
+
};
|
|
6855
|
+
const handleCopy = async () => {
|
|
6856
|
+
await copyMetadataToClipboard(metadata);
|
|
6857
|
+
alert("Metadata copied to clipboard!");
|
|
6858
|
+
};
|
|
6859
|
+
const handleDownload = () => {
|
|
6860
|
+
downloadMetadata(metadata);
|
|
6861
|
+
};
|
|
6862
|
+
if (!showPanel) {
|
|
6863
|
+
return /* @__PURE__ */ jsx16(
|
|
6864
|
+
"button",
|
|
6865
|
+
{
|
|
6866
|
+
onClick: () => setShowPanel(true),
|
|
6867
|
+
className: "cms-seo-trigger",
|
|
6868
|
+
title: "SEO Settings",
|
|
6869
|
+
children: "\u{1F50D} SEO"
|
|
6870
|
+
}
|
|
6871
|
+
);
|
|
6872
|
+
}
|
|
6873
|
+
return /* @__PURE__ */ jsxs16("div", { className: "cms-seo-panel", children: [
|
|
6874
|
+
/* @__PURE__ */ jsx16("div", { className: "cms-seo-overlay", onClick: () => setShowPanel(false) }),
|
|
6875
|
+
/* @__PURE__ */ jsxs16("div", { className: "cms-seo-content", children: [
|
|
6876
|
+
/* @__PURE__ */ jsxs16("div", { className: "cms-seo-header", children: [
|
|
6877
|
+
/* @__PURE__ */ jsx16("h2", { children: "\u{1F50D} SEO Manager" }),
|
|
6878
|
+
/* @__PURE__ */ jsx16("button", { onClick: () => setShowPanel(false), className: "cms-seo-close", children: "\xD7" })
|
|
6879
|
+
] }),
|
|
6880
|
+
/* @__PURE__ */ jsxs16("div", { className: "cms-seo-tabs", children: [
|
|
6881
|
+
/* @__PURE__ */ jsx16(
|
|
6882
|
+
"button",
|
|
6883
|
+
{
|
|
6884
|
+
className: activeTab === "basic" ? "active" : "",
|
|
6885
|
+
onClick: () => setActiveTab("basic"),
|
|
6886
|
+
children: "Basic"
|
|
6887
|
+
}
|
|
6888
|
+
),
|
|
6889
|
+
/* @__PURE__ */ jsx16(
|
|
6890
|
+
"button",
|
|
6891
|
+
{
|
|
6892
|
+
className: activeTab === "social" ? "active" : "",
|
|
6893
|
+
onClick: () => setActiveTab("social"),
|
|
6894
|
+
children: "Social"
|
|
6895
|
+
}
|
|
6896
|
+
),
|
|
6897
|
+
/* @__PURE__ */ jsx16(
|
|
6898
|
+
"button",
|
|
6899
|
+
{
|
|
6900
|
+
className: activeTab === "advanced" ? "active" : "",
|
|
6901
|
+
onClick: () => setActiveTab("advanced"),
|
|
6902
|
+
children: "Advanced"
|
|
6903
|
+
}
|
|
6904
|
+
),
|
|
6905
|
+
showAnalysis && /* @__PURE__ */ jsx16(
|
|
6906
|
+
"button",
|
|
6907
|
+
{
|
|
6908
|
+
className: activeTab === "analysis" ? "active" : "",
|
|
6909
|
+
onClick: () => setActiveTab("analysis"),
|
|
6910
|
+
children: "Analysis"
|
|
6911
|
+
}
|
|
6912
|
+
)
|
|
6913
|
+
] }),
|
|
6914
|
+
/* @__PURE__ */ jsxs16("div", { className: "cms-seo-body", children: [
|
|
6915
|
+
activeTab === "basic" && /* @__PURE__ */ jsx16(BasicTab, { metadata, onUpdate: handleMetadataUpdate, onGenerateSlug: handleGenerateSlug, onExtractKeywords: handleExtractKeywords }),
|
|
6916
|
+
activeTab === "social" && /* @__PURE__ */ jsx16(SocialTab, { metadata, onUpdate: handleMetadataUpdate }),
|
|
6917
|
+
activeTab === "advanced" && /* @__PURE__ */ jsx16(AdvancedTab, { metadata, onUpdate: handleMetadataUpdate }),
|
|
6918
|
+
activeTab === "analysis" && showAnalysis && /* @__PURE__ */ jsx16(AnalysisTab, { analysis, onAnalyze: handleAnalyze })
|
|
6919
|
+
] }),
|
|
6920
|
+
/* @__PURE__ */ jsxs16("div", { className: "cms-seo-footer", children: [
|
|
6921
|
+
/* @__PURE__ */ jsx16("button", { onClick: handleCopy, className: "cms-btn-secondary", children: "\u{1F4CB} Copy Tags" }),
|
|
6922
|
+
/* @__PURE__ */ jsx16("button", { onClick: handleDownload, className: "cms-btn-secondary", children: "\u2B07 Download" }),
|
|
6923
|
+
/* @__PURE__ */ jsx16("button", { onClick: () => setShowPanel(false), className: "cms-btn-primary", children: "Done" })
|
|
6924
|
+
] })
|
|
6925
|
+
] })
|
|
6926
|
+
] });
|
|
6927
|
+
}
|
|
6928
|
+
function BasicTab({ metadata, onUpdate, onGenerateSlug, onExtractKeywords }) {
|
|
6929
|
+
const validation = validateMetadata(metadata);
|
|
6930
|
+
return /* @__PURE__ */ jsxs16("div", { className: "cms-seo-tab", children: [
|
|
6931
|
+
/* @__PURE__ */ jsxs16("div", { className: "cms-seo-field", children: [
|
|
6932
|
+
/* @__PURE__ */ jsxs16("label", { children: [
|
|
6933
|
+
"Title ",
|
|
6934
|
+
/* @__PURE__ */ jsxs16("span", { className: "cms-char-count", children: [
|
|
6935
|
+
metadata.title?.length || 0,
|
|
6936
|
+
"/60"
|
|
6937
|
+
] })
|
|
6938
|
+
] }),
|
|
6939
|
+
/* @__PURE__ */ jsx16(
|
|
6940
|
+
"input",
|
|
6941
|
+
{
|
|
6942
|
+
type: "text",
|
|
6943
|
+
value: metadata.title || "",
|
|
6944
|
+
onChange: (e) => onUpdate({ title: e.target.value }),
|
|
6945
|
+
placeholder: "Page title",
|
|
6946
|
+
maxLength: 60
|
|
6947
|
+
}
|
|
6948
|
+
)
|
|
6949
|
+
] }),
|
|
6950
|
+
/* @__PURE__ */ jsxs16("div", { className: "cms-seo-field", children: [
|
|
6951
|
+
/* @__PURE__ */ jsxs16("label", { children: [
|
|
6952
|
+
"Description ",
|
|
6953
|
+
/* @__PURE__ */ jsxs16("span", { className: "cms-char-count", children: [
|
|
6954
|
+
metadata.description?.length || 0,
|
|
6955
|
+
"/160"
|
|
6956
|
+
] })
|
|
6957
|
+
] }),
|
|
6958
|
+
/* @__PURE__ */ jsx16(
|
|
6959
|
+
"textarea",
|
|
6960
|
+
{
|
|
6961
|
+
value: metadata.description || "",
|
|
6962
|
+
onChange: (e) => onUpdate({ description: e.target.value }),
|
|
6963
|
+
placeholder: "Meta description",
|
|
6964
|
+
maxLength: 160,
|
|
6965
|
+
rows: 3
|
|
6966
|
+
}
|
|
6967
|
+
)
|
|
6968
|
+
] }),
|
|
6969
|
+
/* @__PURE__ */ jsxs16("div", { className: "cms-seo-field", children: [
|
|
6970
|
+
/* @__PURE__ */ jsx16("label", { children: "Keywords" }),
|
|
6971
|
+
/* @__PURE__ */ jsxs16("div", { className: "cms-seo-field-with-action", children: [
|
|
6972
|
+
/* @__PURE__ */ jsx16(
|
|
6973
|
+
"input",
|
|
6974
|
+
{
|
|
6975
|
+
type: "text",
|
|
6976
|
+
value: metadata.keywords?.join(", ") || "",
|
|
6977
|
+
onChange: (e) => onUpdate({ keywords: e.target.value.split(",").map((k) => k.trim()) }),
|
|
6978
|
+
placeholder: "keyword1, keyword2, keyword3"
|
|
6979
|
+
}
|
|
6980
|
+
),
|
|
6981
|
+
/* @__PURE__ */ jsx16("button", { onClick: onExtractKeywords, className: "cms-btn-icon", title: "Extract from content", children: "\u2728" })
|
|
6982
|
+
] })
|
|
6983
|
+
] }),
|
|
6984
|
+
/* @__PURE__ */ jsxs16("div", { className: "cms-seo-field", children: [
|
|
6985
|
+
/* @__PURE__ */ jsx16("label", { children: "Canonical URL" }),
|
|
6986
|
+
/* @__PURE__ */ jsxs16("div", { className: "cms-seo-field-with-action", children: [
|
|
6987
|
+
/* @__PURE__ */ jsx16(
|
|
6988
|
+
"input",
|
|
6989
|
+
{
|
|
6990
|
+
type: "url",
|
|
6991
|
+
value: metadata.canonical || "",
|
|
6992
|
+
onChange: (e) => onUpdate({ canonical: e.target.value }),
|
|
6993
|
+
placeholder: "https://example.com/page"
|
|
6994
|
+
}
|
|
6995
|
+
),
|
|
6996
|
+
/* @__PURE__ */ jsx16("button", { onClick: onGenerateSlug, className: "cms-btn-icon", title: "Generate from title", children: "\u{1F517}" })
|
|
6997
|
+
] })
|
|
6998
|
+
] }),
|
|
6999
|
+
/* @__PURE__ */ jsxs16("div", { className: "cms-seo-field", children: [
|
|
7000
|
+
/* @__PURE__ */ jsx16("label", { children: "Author" }),
|
|
7001
|
+
/* @__PURE__ */ jsx16(
|
|
7002
|
+
"input",
|
|
7003
|
+
{
|
|
7004
|
+
type: "text",
|
|
7005
|
+
value: metadata.author || "",
|
|
7006
|
+
onChange: (e) => onUpdate({ author: e.target.value }),
|
|
7007
|
+
placeholder: "Author name"
|
|
7008
|
+
}
|
|
7009
|
+
)
|
|
7010
|
+
] }),
|
|
7011
|
+
/* @__PURE__ */ jsxs16("div", { className: "cms-seo-field", children: [
|
|
7012
|
+
/* @__PURE__ */ jsx16("label", { children: "Robots" }),
|
|
7013
|
+
/* @__PURE__ */ jsxs16(
|
|
7014
|
+
"select",
|
|
7015
|
+
{
|
|
7016
|
+
value: metadata.robots || "index, follow",
|
|
7017
|
+
onChange: (e) => onUpdate({ robots: e.target.value }),
|
|
7018
|
+
children: [
|
|
7019
|
+
/* @__PURE__ */ jsx16("option", { value: "index, follow", children: "Index, Follow" }),
|
|
7020
|
+
/* @__PURE__ */ jsx16("option", { value: "noindex, follow", children: "No Index, Follow" }),
|
|
7021
|
+
/* @__PURE__ */ jsx16("option", { value: "index, nofollow", children: "Index, No Follow" }),
|
|
7022
|
+
/* @__PURE__ */ jsx16("option", { value: "noindex, nofollow", children: "No Index, No Follow" })
|
|
7023
|
+
]
|
|
7024
|
+
}
|
|
7025
|
+
)
|
|
7026
|
+
] }),
|
|
7027
|
+
!validation.valid && /* @__PURE__ */ jsxs16("div", { className: "cms-seo-validation-errors", children: [
|
|
7028
|
+
/* @__PURE__ */ jsx16("strong", { children: "\u26A0\uFE0F Validation Errors:" }),
|
|
7029
|
+
/* @__PURE__ */ jsx16("ul", { children: validation.errors.map((error, i) => /* @__PURE__ */ jsx16("li", { children: error }, i)) })
|
|
7030
|
+
] })
|
|
7031
|
+
] });
|
|
7032
|
+
}
|
|
7033
|
+
function SocialTab({ metadata, onUpdate }) {
|
|
7034
|
+
return /* @__PURE__ */ jsxs16("div", { className: "cms-seo-tab", children: [
|
|
7035
|
+
/* @__PURE__ */ jsx16("h3", { children: "Open Graph" }),
|
|
7036
|
+
/* @__PURE__ */ jsxs16("div", { className: "cms-seo-field", children: [
|
|
7037
|
+
/* @__PURE__ */ jsx16("label", { children: "OG Title" }),
|
|
7038
|
+
/* @__PURE__ */ jsx16(
|
|
7039
|
+
"input",
|
|
7040
|
+
{
|
|
7041
|
+
type: "text",
|
|
7042
|
+
value: metadata.ogTitle || "",
|
|
7043
|
+
onChange: (e) => onUpdate({ ogTitle: e.target.value }),
|
|
7044
|
+
placeholder: "Title for social media"
|
|
7045
|
+
}
|
|
7046
|
+
)
|
|
7047
|
+
] }),
|
|
7048
|
+
/* @__PURE__ */ jsxs16("div", { className: "cms-seo-field", children: [
|
|
7049
|
+
/* @__PURE__ */ jsx16("label", { children: "OG Description" }),
|
|
7050
|
+
/* @__PURE__ */ jsx16(
|
|
7051
|
+
"textarea",
|
|
7052
|
+
{
|
|
7053
|
+
value: metadata.ogDescription || "",
|
|
7054
|
+
onChange: (e) => onUpdate({ ogDescription: e.target.value }),
|
|
7055
|
+
placeholder: "Description for social media",
|
|
7056
|
+
rows: 2
|
|
7057
|
+
}
|
|
7058
|
+
)
|
|
7059
|
+
] }),
|
|
7060
|
+
/* @__PURE__ */ jsxs16("div", { className: "cms-seo-field", children: [
|
|
7061
|
+
/* @__PURE__ */ jsx16("label", { children: "OG Image URL" }),
|
|
7062
|
+
/* @__PURE__ */ jsx16(
|
|
7063
|
+
"input",
|
|
7064
|
+
{
|
|
7065
|
+
type: "url",
|
|
7066
|
+
value: metadata.ogImage || "",
|
|
7067
|
+
onChange: (e) => onUpdate({ ogImage: e.target.value }),
|
|
7068
|
+
placeholder: "https://example.com/image.jpg"
|
|
7069
|
+
}
|
|
7070
|
+
)
|
|
7071
|
+
] }),
|
|
7072
|
+
/* @__PURE__ */ jsxs16("div", { className: "cms-seo-field", children: [
|
|
7073
|
+
/* @__PURE__ */ jsx16("label", { children: "OG Type" }),
|
|
7074
|
+
/* @__PURE__ */ jsxs16(
|
|
7075
|
+
"select",
|
|
7076
|
+
{
|
|
7077
|
+
value: metadata.ogType || "website",
|
|
7078
|
+
onChange: (e) => onUpdate({ ogType: e.target.value }),
|
|
7079
|
+
children: [
|
|
7080
|
+
/* @__PURE__ */ jsx16("option", { value: "website", children: "Website" }),
|
|
7081
|
+
/* @__PURE__ */ jsx16("option", { value: "article", children: "Article" }),
|
|
7082
|
+
/* @__PURE__ */ jsx16("option", { value: "blog", children: "Blog" }),
|
|
7083
|
+
/* @__PURE__ */ jsx16("option", { value: "product", children: "Product" })
|
|
7084
|
+
]
|
|
7085
|
+
}
|
|
7086
|
+
)
|
|
7087
|
+
] }),
|
|
7088
|
+
/* @__PURE__ */ jsx16("h3", { children: "Twitter Card" }),
|
|
7089
|
+
/* @__PURE__ */ jsxs16("div", { className: "cms-seo-field", children: [
|
|
7090
|
+
/* @__PURE__ */ jsx16("label", { children: "Card Type" }),
|
|
7091
|
+
/* @__PURE__ */ jsxs16(
|
|
7092
|
+
"select",
|
|
7093
|
+
{
|
|
7094
|
+
value: metadata.twitterCard || "summary_large_image",
|
|
7095
|
+
onChange: (e) => onUpdate({ twitterCard: e.target.value }),
|
|
7096
|
+
children: [
|
|
7097
|
+
/* @__PURE__ */ jsx16("option", { value: "summary", children: "Summary" }),
|
|
7098
|
+
/* @__PURE__ */ jsx16("option", { value: "summary_large_image", children: "Summary Large Image" }),
|
|
7099
|
+
/* @__PURE__ */ jsx16("option", { value: "app", children: "App" }),
|
|
7100
|
+
/* @__PURE__ */ jsx16("option", { value: "player", children: "Player" })
|
|
7101
|
+
]
|
|
7102
|
+
}
|
|
7103
|
+
)
|
|
7104
|
+
] }),
|
|
7105
|
+
/* @__PURE__ */ jsxs16("div", { className: "cms-seo-field", children: [
|
|
7106
|
+
/* @__PURE__ */ jsx16("label", { children: "Twitter Site" }),
|
|
7107
|
+
/* @__PURE__ */ jsx16(
|
|
7108
|
+
"input",
|
|
7109
|
+
{
|
|
7110
|
+
type: "text",
|
|
7111
|
+
value: metadata.twitterSite || "",
|
|
7112
|
+
onChange: (e) => onUpdate({ twitterSite: e.target.value }),
|
|
7113
|
+
placeholder: "@username"
|
|
7114
|
+
}
|
|
7115
|
+
)
|
|
7116
|
+
] }),
|
|
7117
|
+
/* @__PURE__ */ jsxs16("div", { className: "cms-seo-field", children: [
|
|
7118
|
+
/* @__PURE__ */ jsx16("label", { children: "Twitter Creator" }),
|
|
7119
|
+
/* @__PURE__ */ jsx16(
|
|
7120
|
+
"input",
|
|
7121
|
+
{
|
|
7122
|
+
type: "text",
|
|
7123
|
+
value: metadata.twitterCreator || "",
|
|
7124
|
+
onChange: (e) => onUpdate({ twitterCreator: e.target.value }),
|
|
7125
|
+
placeholder: "@username"
|
|
7126
|
+
}
|
|
7127
|
+
)
|
|
7128
|
+
] })
|
|
7129
|
+
] });
|
|
7130
|
+
}
|
|
7131
|
+
function AdvancedTab({ metadata, onUpdate }) {
|
|
7132
|
+
return /* @__PURE__ */ jsxs16("div", { className: "cms-seo-tab", children: [
|
|
7133
|
+
/* @__PURE__ */ jsx16("h3", { children: "Article Metadata" }),
|
|
7134
|
+
/* @__PURE__ */ jsxs16("div", { className: "cms-seo-field", children: [
|
|
7135
|
+
/* @__PURE__ */ jsx16("label", { children: "Published Time" }),
|
|
7136
|
+
/* @__PURE__ */ jsx16(
|
|
7137
|
+
"input",
|
|
7138
|
+
{
|
|
7139
|
+
type: "datetime-local",
|
|
7140
|
+
value: metadata.articlePublishedTime || "",
|
|
7141
|
+
onChange: (e) => onUpdate({ articlePublishedTime: e.target.value })
|
|
7142
|
+
}
|
|
7143
|
+
)
|
|
7144
|
+
] }),
|
|
7145
|
+
/* @__PURE__ */ jsxs16("div", { className: "cms-seo-field", children: [
|
|
7146
|
+
/* @__PURE__ */ jsx16("label", { children: "Modified Time" }),
|
|
7147
|
+
/* @__PURE__ */ jsx16(
|
|
7148
|
+
"input",
|
|
7149
|
+
{
|
|
7150
|
+
type: "datetime-local",
|
|
7151
|
+
value: metadata.articleModifiedTime || "",
|
|
7152
|
+
onChange: (e) => onUpdate({ articleModifiedTime: e.target.value })
|
|
7153
|
+
}
|
|
7154
|
+
)
|
|
7155
|
+
] }),
|
|
7156
|
+
/* @__PURE__ */ jsxs16("div", { className: "cms-seo-field", children: [
|
|
7157
|
+
/* @__PURE__ */ jsx16("label", { children: "Article Author" }),
|
|
7158
|
+
/* @__PURE__ */ jsx16(
|
|
7159
|
+
"input",
|
|
7160
|
+
{
|
|
7161
|
+
type: "text",
|
|
7162
|
+
value: metadata.articleAuthor || "",
|
|
7163
|
+
onChange: (e) => onUpdate({ articleAuthor: e.target.value }),
|
|
7164
|
+
placeholder: "Author name"
|
|
7165
|
+
}
|
|
7166
|
+
)
|
|
7167
|
+
] }),
|
|
7168
|
+
/* @__PURE__ */ jsxs16("div", { className: "cms-seo-field", children: [
|
|
7169
|
+
/* @__PURE__ */ jsx16("label", { children: "Section" }),
|
|
7170
|
+
/* @__PURE__ */ jsx16(
|
|
7171
|
+
"input",
|
|
7172
|
+
{
|
|
7173
|
+
type: "text",
|
|
7174
|
+
value: metadata.articleSection || "",
|
|
7175
|
+
onChange: (e) => onUpdate({ articleSection: e.target.value }),
|
|
7176
|
+
placeholder: "Technology, Business, etc."
|
|
7177
|
+
}
|
|
7178
|
+
)
|
|
7179
|
+
] }),
|
|
7180
|
+
/* @__PURE__ */ jsxs16("div", { className: "cms-seo-field", children: [
|
|
7181
|
+
/* @__PURE__ */ jsx16("label", { children: "Article Tags" }),
|
|
7182
|
+
/* @__PURE__ */ jsx16(
|
|
7183
|
+
"input",
|
|
7184
|
+
{
|
|
7185
|
+
type: "text",
|
|
7186
|
+
value: metadata.articleTags?.join(", ") || "",
|
|
7187
|
+
onChange: (e) => onUpdate({ articleTags: e.target.value.split(",").map((t) => t.trim()) }),
|
|
7188
|
+
placeholder: "tag1, tag2, tag3"
|
|
7189
|
+
}
|
|
7190
|
+
)
|
|
7191
|
+
] }),
|
|
7192
|
+
/* @__PURE__ */ jsx16("div", { className: "cms-seo-info", children: /* @__PURE__ */ jsx16("p", { children: "\u{1F4A1} Structured data (Schema.org) can be added programmatically via the API" }) })
|
|
7193
|
+
] });
|
|
7194
|
+
}
|
|
7195
|
+
function AnalysisTab({ analysis, onAnalyze }) {
|
|
7196
|
+
if (!analysis) {
|
|
7197
|
+
return /* @__PURE__ */ jsxs16("div", { className: "cms-seo-tab cms-seo-analysis-empty", children: [
|
|
7198
|
+
/* @__PURE__ */ jsx16("p", { children: "Click the button below to analyze your content for SEO optimization." }),
|
|
7199
|
+
/* @__PURE__ */ jsx16("button", { onClick: onAnalyze, className: "cms-btn-primary", children: "\u{1F50D} Analyze Content" })
|
|
7200
|
+
] });
|
|
7201
|
+
}
|
|
7202
|
+
const scoreColor = analysis.score >= 80 ? "#10b981" : analysis.score >= 60 ? "#f59e0b" : "#ef4444";
|
|
7203
|
+
return /* @__PURE__ */ jsxs16("div", { className: "cms-seo-tab", children: [
|
|
7204
|
+
/* @__PURE__ */ jsxs16("div", { className: "cms-seo-score", style: { borderColor: scoreColor }, children: [
|
|
7205
|
+
/* @__PURE__ */ jsx16("div", { className: "cms-seo-score-circle", style: { background: scoreColor }, children: analysis.score }),
|
|
7206
|
+
/* @__PURE__ */ jsx16("div", { className: "cms-seo-score-label", children: analysis.score >= 80 ? "Excellent" : analysis.score >= 60 ? "Good" : "Needs Improvement" })
|
|
7207
|
+
] }),
|
|
7208
|
+
/* @__PURE__ */ jsx16("button", { onClick: onAnalyze, className: "cms-btn-secondary", style: { marginBottom: "1rem" }, children: "\u{1F504} Re-analyze" }),
|
|
7209
|
+
analysis.issues.length > 0 && /* @__PURE__ */ jsxs16("div", { className: "cms-seo-issues", children: [
|
|
7210
|
+
/* @__PURE__ */ jsx16("h3", { children: "Issues" }),
|
|
7211
|
+
analysis.issues.map((issue, i) => /* @__PURE__ */ jsxs16("div", { className: `cms-seo-issue cms-seo-issue-${issue.type}`, children: [
|
|
7212
|
+
/* @__PURE__ */ jsx16("span", { className: "cms-seo-issue-icon", children: issue.type === "error" ? "\u274C" : "\u26A0\uFE0F" }),
|
|
7213
|
+
/* @__PURE__ */ jsxs16("div", { children: [
|
|
7214
|
+
/* @__PURE__ */ jsx16("div", { className: "cms-seo-issue-message", children: issue.message }),
|
|
7215
|
+
/* @__PURE__ */ jsxs16("div", { className: "cms-seo-issue-meta", children: [
|
|
7216
|
+
issue.category,
|
|
7217
|
+
" \u2022 ",
|
|
7218
|
+
issue.impact,
|
|
7219
|
+
" impact"
|
|
7220
|
+
] })
|
|
7221
|
+
] })
|
|
7222
|
+
] }, i))
|
|
7223
|
+
] }),
|
|
7224
|
+
analysis.suggestions.length > 0 && /* @__PURE__ */ jsxs16("div", { className: "cms-seo-suggestions", children: [
|
|
7225
|
+
/* @__PURE__ */ jsx16("h3", { children: "Suggestions" }),
|
|
7226
|
+
analysis.suggestions.map((suggestion, i) => /* @__PURE__ */ jsxs16("div", { className: "cms-seo-suggestion", children: [
|
|
7227
|
+
/* @__PURE__ */ jsx16("span", { className: "cms-seo-suggestion-icon", children: "\u{1F4A1}" }),
|
|
7228
|
+
/* @__PURE__ */ jsxs16("div", { children: [
|
|
7229
|
+
/* @__PURE__ */ jsx16("div", { className: "cms-seo-suggestion-message", children: suggestion.message }),
|
|
7230
|
+
/* @__PURE__ */ jsxs16("div", { className: "cms-seo-suggestion-meta", children: [
|
|
7231
|
+
suggestion.category,
|
|
7232
|
+
" \u2022 ",
|
|
7233
|
+
suggestion.priority,
|
|
7234
|
+
" priority"
|
|
7235
|
+
] })
|
|
7236
|
+
] })
|
|
7237
|
+
] }, i))
|
|
7238
|
+
] }),
|
|
7239
|
+
/* @__PURE__ */ jsxs16("div", { className: "cms-seo-metrics", children: [
|
|
7240
|
+
/* @__PURE__ */ jsx16("h3", { children: "Metrics" }),
|
|
7241
|
+
/* @__PURE__ */ jsxs16("div", { className: "cms-seo-metrics-grid", children: [
|
|
7242
|
+
/* @__PURE__ */ jsxs16("div", { className: "cms-seo-metric", children: [
|
|
7243
|
+
/* @__PURE__ */ jsx16("div", { className: "cms-seo-metric-value", children: analysis.metrics.wordCount }),
|
|
7244
|
+
/* @__PURE__ */ jsx16("div", { className: "cms-seo-metric-label", children: "Words" })
|
|
7245
|
+
] }),
|
|
7246
|
+
/* @__PURE__ */ jsxs16("div", { className: "cms-seo-metric", children: [
|
|
7247
|
+
/* @__PURE__ */ jsxs16("div", { className: "cms-seo-metric-value", children: [
|
|
7248
|
+
analysis.metrics.readingTime,
|
|
7249
|
+
" min"
|
|
7250
|
+
] }),
|
|
7251
|
+
/* @__PURE__ */ jsx16("div", { className: "cms-seo-metric-label", children: "Reading Time" })
|
|
7252
|
+
] }),
|
|
7253
|
+
/* @__PURE__ */ jsxs16("div", { className: "cms-seo-metric", children: [
|
|
7254
|
+
/* @__PURE__ */ jsx16("div", { className: "cms-seo-metric-value", children: analysis.metrics.headingCount.h1 }),
|
|
7255
|
+
/* @__PURE__ */ jsx16("div", { className: "cms-seo-metric-label", children: "H1 Tags" })
|
|
7256
|
+
] }),
|
|
7257
|
+
/* @__PURE__ */ jsxs16("div", { className: "cms-seo-metric", children: [
|
|
7258
|
+
/* @__PURE__ */ jsx16("div", { className: "cms-seo-metric-value", children: analysis.metrics.imageCount }),
|
|
7259
|
+
/* @__PURE__ */ jsx16("div", { className: "cms-seo-metric-label", children: "Images" })
|
|
7260
|
+
] }),
|
|
7261
|
+
/* @__PURE__ */ jsxs16("div", { className: "cms-seo-metric", children: [
|
|
7262
|
+
/* @__PURE__ */ jsx16("div", { className: "cms-seo-metric-value", children: analysis.metrics.linkCount }),
|
|
7263
|
+
/* @__PURE__ */ jsx16("div", { className: "cms-seo-metric-label", children: "Links" })
|
|
7264
|
+
] }),
|
|
7265
|
+
/* @__PURE__ */ jsxs16("div", { className: "cms-seo-metric", children: [
|
|
7266
|
+
/* @__PURE__ */ jsxs16("div", { className: "cms-seo-metric-value", children: [
|
|
7267
|
+
analysis.metrics.imagesWithAlt,
|
|
7268
|
+
"/",
|
|
7269
|
+
analysis.metrics.imageCount
|
|
7270
|
+
] }),
|
|
7271
|
+
/* @__PURE__ */ jsx16("div", { className: "cms-seo-metric-label", children: "Alt Text" })
|
|
7272
|
+
] })
|
|
7273
|
+
] })
|
|
7274
|
+
] })
|
|
7275
|
+
] });
|
|
7276
|
+
}
|
|
7277
|
+
|
|
7278
|
+
// src/core/EditorShell.tsx
|
|
7279
|
+
import { jsx as jsx17, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
6425
7280
|
function EditorShell({
|
|
6426
7281
|
onChange,
|
|
6427
7282
|
onImageAdded,
|
|
6428
7283
|
onVideoAdded,
|
|
6429
|
-
useBase64Url
|
|
7284
|
+
useBase64Url,
|
|
7285
|
+
seoMetadata,
|
|
7286
|
+
onSEOMetadataChange,
|
|
7287
|
+
showSEO
|
|
6430
7288
|
}) {
|
|
6431
|
-
return /* @__PURE__ */
|
|
6432
|
-
/* @__PURE__ */
|
|
6433
|
-
/* @__PURE__ */
|
|
7289
|
+
return /* @__PURE__ */ jsxs17("div", { className: "cms-editor-shell", children: [
|
|
7290
|
+
/* @__PURE__ */ jsx17(ToolbarPlugin, {}),
|
|
7291
|
+
showSEO && /* @__PURE__ */ jsx17("div", { className: "cms-toolbar-seo", children: /* @__PURE__ */ jsx17(
|
|
7292
|
+
SEOPlugin,
|
|
7293
|
+
{
|
|
7294
|
+
metadata: seoMetadata,
|
|
7295
|
+
onMetadataChange: onSEOMetadataChange,
|
|
7296
|
+
showAnalysis: true
|
|
7297
|
+
}
|
|
7298
|
+
) }),
|
|
7299
|
+
/* @__PURE__ */ jsx17(
|
|
6434
7300
|
RichTextPlugin,
|
|
6435
7301
|
{
|
|
6436
|
-
contentEditable: /* @__PURE__ */
|
|
6437
|
-
placeholder: /* @__PURE__ */
|
|
7302
|
+
contentEditable: /* @__PURE__ */ jsx17(ContentEditable, { className: "cms-editor-content" }),
|
|
7303
|
+
placeholder: /* @__PURE__ */ jsx17("div", { className: "cms-editor-placeholder", children: "Start typing or press / for commands..." }),
|
|
6438
7304
|
ErrorBoundary: LexicalErrorBoundary
|
|
6439
7305
|
}
|
|
6440
7306
|
),
|
|
6441
|
-
/* @__PURE__ */
|
|
6442
|
-
/* @__PURE__ */
|
|
6443
|
-
/* @__PURE__ */
|
|
6444
|
-
/* @__PURE__ */
|
|
6445
|
-
/* @__PURE__ */
|
|
6446
|
-
/* @__PURE__ */
|
|
6447
|
-
/* @__PURE__ */
|
|
6448
|
-
/* @__PURE__ */
|
|
6449
|
-
/* @__PURE__ */
|
|
6450
|
-
/* @__PURE__ */
|
|
6451
|
-
/* @__PURE__ */
|
|
6452
|
-
/* @__PURE__ */
|
|
6453
|
-
onChange && /* @__PURE__ */
|
|
7307
|
+
/* @__PURE__ */ jsx17(HistoryPlugin, {}),
|
|
7308
|
+
/* @__PURE__ */ jsx17(ListPlugin, {}),
|
|
7309
|
+
/* @__PURE__ */ jsx17(LexicalLinkPlugin, {}),
|
|
7310
|
+
/* @__PURE__ */ jsx17(LexicalTablePlugin, {}),
|
|
7311
|
+
/* @__PURE__ */ jsx17(SlashCommandPlugin, {}),
|
|
7312
|
+
/* @__PURE__ */ jsx17(ImageUploadPlugin, { onImageAdded, useBase64Url }),
|
|
7313
|
+
/* @__PURE__ */ jsx17(VideoUploadPlugin, { onVideoAdded, useBase64Url }),
|
|
7314
|
+
/* @__PURE__ */ jsx17(ImageEditorPlugin, {}),
|
|
7315
|
+
/* @__PURE__ */ jsx17(LinkPlugin, {}),
|
|
7316
|
+
/* @__PURE__ */ jsx17(SectionEditorPlugin, {}),
|
|
7317
|
+
/* @__PURE__ */ jsx17(EmbedPlugin, {}),
|
|
7318
|
+
/* @__PURE__ */ jsx17(TablePlugin, {}),
|
|
7319
|
+
onChange && /* @__PURE__ */ jsx17(
|
|
6454
7320
|
OnChangePlugin,
|
|
6455
7321
|
{
|
|
6456
7322
|
onChange: (editorState) => {
|
|
@@ -6510,21 +7376,27 @@ function createEditorConfig(value) {
|
|
|
6510
7376
|
}
|
|
6511
7377
|
|
|
6512
7378
|
// src/core/CMSBlockEditor.tsx
|
|
6513
|
-
import { jsx as
|
|
7379
|
+
import { jsx as jsx18 } from "react/jsx-runtime";
|
|
6514
7380
|
function CMSBlockEditor({
|
|
6515
7381
|
value,
|
|
6516
7382
|
onChange,
|
|
6517
7383
|
onImageAdded,
|
|
6518
7384
|
onVideoAdded,
|
|
6519
|
-
useBase64Url = true
|
|
7385
|
+
useBase64Url = true,
|
|
7386
|
+
seoMetadata,
|
|
7387
|
+
onSEOMetadataChange,
|
|
7388
|
+
showSEO = true
|
|
6520
7389
|
}) {
|
|
6521
|
-
return /* @__PURE__ */
|
|
7390
|
+
return /* @__PURE__ */ jsx18(LexicalComposer, { initialConfig: createEditorConfig(value), children: /* @__PURE__ */ jsx18(
|
|
6522
7391
|
EditorShell,
|
|
6523
7392
|
{
|
|
6524
7393
|
onChange,
|
|
6525
7394
|
onImageAdded,
|
|
6526
7395
|
onVideoAdded,
|
|
6527
|
-
useBase64Url
|
|
7396
|
+
useBase64Url,
|
|
7397
|
+
seoMetadata,
|
|
7398
|
+
onSEOMetadataChange,
|
|
7399
|
+
showSEO
|
|
6528
7400
|
}
|
|
6529
7401
|
) });
|
|
6530
7402
|
}
|
|
@@ -6534,12 +7406,12 @@ import { LexicalComposer as LexicalComposer2 } from "@lexical/react/LexicalCompo
|
|
|
6534
7406
|
import { RichTextPlugin as RichTextPlugin2 } from "@lexical/react/LexicalRichTextPlugin";
|
|
6535
7407
|
import { ContentEditable as ContentEditable2 } from "@lexical/react/LexicalContentEditable";
|
|
6536
7408
|
import LexicalErrorBoundary2 from "@lexical/react/LexicalErrorBoundary";
|
|
6537
|
-
import { useEffect as
|
|
6538
|
-
import { useLexicalComposerContext as
|
|
6539
|
-
import { jsx as
|
|
7409
|
+
import { useEffect as useEffect18 } from "react";
|
|
7410
|
+
import { useLexicalComposerContext as useLexicalComposerContext15 } from "@lexical/react/LexicalComposerContext";
|
|
7411
|
+
import { jsx as jsx19, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
6540
7412
|
function ReadOnlyPlugin() {
|
|
6541
|
-
const [editor] =
|
|
6542
|
-
|
|
7413
|
+
const [editor] = useLexicalComposerContext15();
|
|
7414
|
+
useEffect18(() => {
|
|
6543
7415
|
editor.setEditable(false);
|
|
6544
7416
|
}, [editor]);
|
|
6545
7417
|
return null;
|
|
@@ -6549,21 +7421,21 @@ function CMSRenderer({ content, className = "" }) {
|
|
|
6549
7421
|
...createEditorConfig(content),
|
|
6550
7422
|
editable: false
|
|
6551
7423
|
};
|
|
6552
|
-
return /* @__PURE__ */
|
|
6553
|
-
/* @__PURE__ */
|
|
7424
|
+
return /* @__PURE__ */ jsx19(LexicalComposer2, { initialConfig: config, children: /* @__PURE__ */ jsxs18("div", { className: `cms-renderer ${className}`, children: [
|
|
7425
|
+
/* @__PURE__ */ jsx19(
|
|
6554
7426
|
RichTextPlugin2,
|
|
6555
7427
|
{
|
|
6556
|
-
contentEditable: /* @__PURE__ */
|
|
7428
|
+
contentEditable: /* @__PURE__ */ jsx19(ContentEditable2, { className: "cms-renderer-content" }),
|
|
6557
7429
|
placeholder: null,
|
|
6558
7430
|
ErrorBoundary: LexicalErrorBoundary2
|
|
6559
7431
|
}
|
|
6560
7432
|
),
|
|
6561
|
-
/* @__PURE__ */
|
|
7433
|
+
/* @__PURE__ */ jsx19(ReadOnlyPlugin, {})
|
|
6562
7434
|
] }) });
|
|
6563
7435
|
}
|
|
6564
7436
|
|
|
6565
7437
|
// src/themes/ThemeProvider.tsx
|
|
6566
|
-
import { createContext, useContext, useEffect as
|
|
7438
|
+
import { createContext, useContext, useEffect as useEffect19, useState as useState17 } from "react";
|
|
6567
7439
|
|
|
6568
7440
|
// src/themes/lightTheme.ts
|
|
6569
7441
|
var lightTheme = {
|
|
@@ -7121,7 +7993,7 @@ var presetThemes = {
|
|
|
7121
7993
|
};
|
|
7122
7994
|
|
|
7123
7995
|
// src/themes/ThemeProvider.tsx
|
|
7124
|
-
import { jsx as
|
|
7996
|
+
import { jsx as jsx20 } from "react/jsx-runtime";
|
|
7125
7997
|
var ThemeContext = createContext(void 0);
|
|
7126
7998
|
function ThemeProvider({
|
|
7127
7999
|
children,
|
|
@@ -7129,13 +8001,13 @@ function ThemeProvider({
|
|
|
7129
8001
|
defaultMode = "light",
|
|
7130
8002
|
storageKey = "cms-editor-theme"
|
|
7131
8003
|
}) {
|
|
7132
|
-
const [theme, setThemeState] =
|
|
8004
|
+
const [theme, setThemeState] = useState17(() => {
|
|
7133
8005
|
if (typeof defaultTheme === "string") {
|
|
7134
8006
|
return presetThemes[defaultTheme] || lightTheme;
|
|
7135
8007
|
}
|
|
7136
8008
|
return defaultTheme;
|
|
7137
8009
|
});
|
|
7138
|
-
const [mode, setModeState] =
|
|
8010
|
+
const [mode, setModeState] = useState17(() => {
|
|
7139
8011
|
if (typeof window !== "undefined" && storageKey) {
|
|
7140
8012
|
const stored = localStorage.getItem(`${storageKey}-mode`);
|
|
7141
8013
|
if (stored === "light" || stored === "dark" || stored === "auto") {
|
|
@@ -7144,7 +8016,7 @@ function ThemeProvider({
|
|
|
7144
8016
|
}
|
|
7145
8017
|
return defaultMode;
|
|
7146
8018
|
});
|
|
7147
|
-
|
|
8019
|
+
useEffect19(() => {
|
|
7148
8020
|
if (mode === "auto" && typeof window !== "undefined") {
|
|
7149
8021
|
const mediaQuery = window.matchMedia("(prefers-color-scheme: dark)");
|
|
7150
8022
|
const handleChange = (e) => {
|
|
@@ -7176,12 +8048,12 @@ function ThemeProvider({
|
|
|
7176
8048
|
root.style.setProperty(`--cms-shadow-${key}`, value);
|
|
7177
8049
|
});
|
|
7178
8050
|
};
|
|
7179
|
-
|
|
8051
|
+
useEffect19(() => {
|
|
7180
8052
|
if (mode !== "auto") {
|
|
7181
8053
|
applyTheme(theme);
|
|
7182
8054
|
}
|
|
7183
8055
|
}, [theme, mode]);
|
|
7184
|
-
|
|
8056
|
+
useEffect19(() => {
|
|
7185
8057
|
if (typeof window !== "undefined" && storageKey) {
|
|
7186
8058
|
localStorage.setItem(`${storageKey}-mode`, mode);
|
|
7187
8059
|
localStorage.setItem(`${storageKey}-name`, theme.name);
|
|
@@ -7208,7 +8080,7 @@ function ThemeProvider({
|
|
|
7208
8080
|
const newMode = mode === "light" ? "dark" : "light";
|
|
7209
8081
|
setMode(newMode);
|
|
7210
8082
|
};
|
|
7211
|
-
return /* @__PURE__ */
|
|
8083
|
+
return /* @__PURE__ */ jsx20(ThemeContext.Provider, { value: { theme, mode, setTheme, setMode, toggleMode }, children });
|
|
7212
8084
|
}
|
|
7213
8085
|
function useTheme() {
|
|
7214
8086
|
const context = useContext(ThemeContext);
|
|
@@ -7222,18 +8094,18 @@ function camelToKebab(str) {
|
|
|
7222
8094
|
}
|
|
7223
8095
|
|
|
7224
8096
|
// src/themes/ThemeSwitcher.tsx
|
|
7225
|
-
import { useState as
|
|
7226
|
-
import { Fragment as Fragment10, jsx as
|
|
8097
|
+
import { useState as useState18 } from "react";
|
|
8098
|
+
import { Fragment as Fragment10, jsx as jsx21, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
7227
8099
|
function ThemeSwitcher({
|
|
7228
8100
|
className = "",
|
|
7229
8101
|
showModeToggle = true,
|
|
7230
8102
|
showPresets = true
|
|
7231
8103
|
}) {
|
|
7232
8104
|
const { theme, mode, setTheme, setMode, toggleMode } = useTheme();
|
|
7233
|
-
const [isOpen, setIsOpen] =
|
|
8105
|
+
const [isOpen, setIsOpen] = useState18(false);
|
|
7234
8106
|
const themeNames = Object.keys(presetThemes);
|
|
7235
|
-
return /* @__PURE__ */
|
|
7236
|
-
showModeToggle && /* @__PURE__ */
|
|
8107
|
+
return /* @__PURE__ */ jsxs19("div", { className: `cms-theme-switcher ${className}`, children: [
|
|
8108
|
+
showModeToggle && /* @__PURE__ */ jsx21(
|
|
7237
8109
|
"button",
|
|
7238
8110
|
{
|
|
7239
8111
|
onClick: toggleMode,
|
|
@@ -7242,8 +8114,8 @@ function ThemeSwitcher({
|
|
|
7242
8114
|
children: mode === "light" ? "\u{1F319}" : "\u2600\uFE0F"
|
|
7243
8115
|
}
|
|
7244
8116
|
),
|
|
7245
|
-
showPresets && /* @__PURE__ */
|
|
7246
|
-
/* @__PURE__ */
|
|
8117
|
+
showPresets && /* @__PURE__ */ jsxs19("div", { className: "cms-theme-selector", children: [
|
|
8118
|
+
/* @__PURE__ */ jsxs19(
|
|
7247
8119
|
"button",
|
|
7248
8120
|
{
|
|
7249
8121
|
onClick: () => setIsOpen(!isOpen),
|
|
@@ -7254,22 +8126,22 @@ function ThemeSwitcher({
|
|
|
7254
8126
|
]
|
|
7255
8127
|
}
|
|
7256
8128
|
),
|
|
7257
|
-
isOpen && /* @__PURE__ */
|
|
7258
|
-
/* @__PURE__ */
|
|
8129
|
+
isOpen && /* @__PURE__ */ jsxs19(Fragment10, { children: [
|
|
8130
|
+
/* @__PURE__ */ jsx21(
|
|
7259
8131
|
"div",
|
|
7260
8132
|
{
|
|
7261
8133
|
className: "cms-theme-selector-overlay",
|
|
7262
8134
|
onClick: () => setIsOpen(false)
|
|
7263
8135
|
}
|
|
7264
8136
|
),
|
|
7265
|
-
/* @__PURE__ */
|
|
7266
|
-
/* @__PURE__ */
|
|
7267
|
-
/* @__PURE__ */
|
|
7268
|
-
/* @__PURE__ */
|
|
8137
|
+
/* @__PURE__ */ jsxs19("div", { className: "cms-theme-selector-dropdown", children: [
|
|
8138
|
+
/* @__PURE__ */ jsxs19("div", { className: "cms-theme-selector-header", children: [
|
|
8139
|
+
/* @__PURE__ */ jsx21("h3", { children: "Choose Theme" }),
|
|
8140
|
+
/* @__PURE__ */ jsx21("button", { onClick: () => setIsOpen(false), children: "\xD7" })
|
|
7269
8141
|
] }),
|
|
7270
|
-
/* @__PURE__ */
|
|
8142
|
+
/* @__PURE__ */ jsx21("div", { className: "cms-theme-selector-grid", children: themeNames.map((themeName) => {
|
|
7271
8143
|
const presetTheme = presetThemes[themeName];
|
|
7272
|
-
return /* @__PURE__ */
|
|
8144
|
+
return /* @__PURE__ */ jsxs19(
|
|
7273
8145
|
"button",
|
|
7274
8146
|
{
|
|
7275
8147
|
onClick: () => {
|
|
@@ -7278,7 +8150,7 @@ function ThemeSwitcher({
|
|
|
7278
8150
|
},
|
|
7279
8151
|
className: `cms-theme-option ${theme.name === themeName ? "active" : ""}`,
|
|
7280
8152
|
children: [
|
|
7281
|
-
/* @__PURE__ */
|
|
8153
|
+
/* @__PURE__ */ jsx21(
|
|
7282
8154
|
"div",
|
|
7283
8155
|
{
|
|
7284
8156
|
className: "cms-theme-preview",
|
|
@@ -7286,7 +8158,7 @@ function ThemeSwitcher({
|
|
|
7286
8158
|
background: presetTheme.colors.primary,
|
|
7287
8159
|
borderColor: presetTheme.colors.border
|
|
7288
8160
|
},
|
|
7289
|
-
children: /* @__PURE__ */
|
|
8161
|
+
children: /* @__PURE__ */ jsx21(
|
|
7290
8162
|
"div",
|
|
7291
8163
|
{
|
|
7292
8164
|
className: "cms-theme-preview-accent",
|
|
@@ -7295,16 +8167,16 @@ function ThemeSwitcher({
|
|
|
7295
8167
|
)
|
|
7296
8168
|
}
|
|
7297
8169
|
),
|
|
7298
|
-
/* @__PURE__ */
|
|
7299
|
-
theme.name === themeName && /* @__PURE__ */
|
|
8170
|
+
/* @__PURE__ */ jsx21("span", { className: "cms-theme-name", children: themeName }),
|
|
8171
|
+
theme.name === themeName && /* @__PURE__ */ jsx21("span", { className: "cms-theme-check", children: "\u2713" })
|
|
7300
8172
|
]
|
|
7301
8173
|
},
|
|
7302
8174
|
themeName
|
|
7303
8175
|
);
|
|
7304
8176
|
}) }),
|
|
7305
|
-
/* @__PURE__ */
|
|
7306
|
-
/* @__PURE__ */
|
|
7307
|
-
/* @__PURE__ */
|
|
8177
|
+
/* @__PURE__ */ jsxs19("div", { className: "cms-theme-selector-modes", children: [
|
|
8178
|
+
/* @__PURE__ */ jsxs19("label", { children: [
|
|
8179
|
+
/* @__PURE__ */ jsx21(
|
|
7308
8180
|
"input",
|
|
7309
8181
|
{
|
|
7310
8182
|
type: "radio",
|
|
@@ -7316,8 +8188,8 @@ function ThemeSwitcher({
|
|
|
7316
8188
|
),
|
|
7317
8189
|
"Light"
|
|
7318
8190
|
] }),
|
|
7319
|
-
/* @__PURE__ */
|
|
7320
|
-
/* @__PURE__ */
|
|
8191
|
+
/* @__PURE__ */ jsxs19("label", { children: [
|
|
8192
|
+
/* @__PURE__ */ jsx21(
|
|
7321
8193
|
"input",
|
|
7322
8194
|
{
|
|
7323
8195
|
type: "radio",
|
|
@@ -7329,8 +8201,8 @@ function ThemeSwitcher({
|
|
|
7329
8201
|
),
|
|
7330
8202
|
"Dark"
|
|
7331
8203
|
] }),
|
|
7332
|
-
/* @__PURE__ */
|
|
7333
|
-
/* @__PURE__ */
|
|
8204
|
+
/* @__PURE__ */ jsxs19("label", { children: [
|
|
8205
|
+
/* @__PURE__ */ jsx21(
|
|
7334
8206
|
"input",
|
|
7335
8207
|
{
|
|
7336
8208
|
type: "radio",
|
|
@@ -7350,7 +8222,7 @@ function ThemeSwitcher({
|
|
|
7350
8222
|
}
|
|
7351
8223
|
|
|
7352
8224
|
// src/themes/ThemeCustomizer.tsx
|
|
7353
|
-
import { useState as
|
|
8225
|
+
import { useState as useState19 } from "react";
|
|
7354
8226
|
|
|
7355
8227
|
// src/themes/themeBuilder.ts
|
|
7356
8228
|
function deepMerge(target, source) {
|
|
@@ -7530,15 +8402,15 @@ function generateThemeFromBrand(brandColor, themeName, mode = "light") {
|
|
|
7530
8402
|
}
|
|
7531
8403
|
|
|
7532
8404
|
// src/themes/ThemeCustomizer.tsx
|
|
7533
|
-
import { Fragment as Fragment11, jsx as
|
|
8405
|
+
import { Fragment as Fragment11, jsx as jsx22, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
7534
8406
|
function ThemeCustomizer({ onClose }) {
|
|
7535
8407
|
const { theme, setTheme } = useTheme();
|
|
7536
|
-
const [activeTab, setActiveTab] =
|
|
7537
|
-
const [customTheme, setCustomTheme] =
|
|
7538
|
-
const [searchQuery, setSearchQuery] =
|
|
7539
|
-
const [showColorPicker, setShowColorPicker] =
|
|
7540
|
-
const [history, setHistory] =
|
|
7541
|
-
const [historyIndex, setHistoryIndex] =
|
|
8408
|
+
const [activeTab, setActiveTab] = useState19("colors");
|
|
8409
|
+
const [customTheme, setCustomTheme] = useState19(theme);
|
|
8410
|
+
const [searchQuery, setSearchQuery] = useState19("");
|
|
8411
|
+
const [showColorPicker, setShowColorPicker] = useState19(null);
|
|
8412
|
+
const [history, setHistory] = useState19([theme]);
|
|
8413
|
+
const [historyIndex, setHistoryIndex] = useState19(0);
|
|
7542
8414
|
const updateTheme = (override) => {
|
|
7543
8415
|
const updated = createTheme(customTheme, override);
|
|
7544
8416
|
setCustomTheme(updated);
|
|
@@ -7568,7 +8440,7 @@ function ThemeCustomizer({ onClose }) {
|
|
|
7568
8440
|
setHistory([theme]);
|
|
7569
8441
|
setHistoryIndex(0);
|
|
7570
8442
|
};
|
|
7571
|
-
return /* @__PURE__ */
|
|
8443
|
+
return /* @__PURE__ */ jsx22("div", { className: "cms-theme-customizer-advanced", children: /* @__PURE__ */ jsx22(
|
|
7572
8444
|
ThemeCustomizerContent,
|
|
7573
8445
|
{
|
|
7574
8446
|
activeTab,
|
|
@@ -7646,16 +8518,16 @@ function ThemeCustomizerContent(props) {
|
|
|
7646
8518
|
}
|
|
7647
8519
|
});
|
|
7648
8520
|
};
|
|
7649
|
-
return /* @__PURE__ */
|
|
7650
|
-
/* @__PURE__ */
|
|
7651
|
-
/* @__PURE__ */
|
|
7652
|
-
/* @__PURE__ */
|
|
7653
|
-
/* @__PURE__ */
|
|
7654
|
-
/* @__PURE__ */
|
|
7655
|
-
/* @__PURE__ */
|
|
8521
|
+
return /* @__PURE__ */ jsxs20(Fragment11, { children: [
|
|
8522
|
+
/* @__PURE__ */ jsx22("div", { className: "cms-theme-customizer-overlay", onClick: onClose }),
|
|
8523
|
+
/* @__PURE__ */ jsxs20("div", { className: "cms-theme-customizer-panel-advanced", children: [
|
|
8524
|
+
/* @__PURE__ */ jsxs20("div", { className: "cms-theme-customizer-header-advanced", children: [
|
|
8525
|
+
/* @__PURE__ */ jsxs20("div", { className: "cms-header-left", children: [
|
|
8526
|
+
/* @__PURE__ */ jsx22("h2", { children: "\u{1F3A8} Theme Studio" }),
|
|
8527
|
+
/* @__PURE__ */ jsx22("span", { className: "cms-theme-name-badge", children: customTheme.name })
|
|
7656
8528
|
] }),
|
|
7657
|
-
/* @__PURE__ */
|
|
7658
|
-
/* @__PURE__ */
|
|
8529
|
+
/* @__PURE__ */ jsxs20("div", { className: "cms-header-actions", children: [
|
|
8530
|
+
/* @__PURE__ */ jsx22(
|
|
7659
8531
|
"button",
|
|
7660
8532
|
{
|
|
7661
8533
|
onClick: undo,
|
|
@@ -7665,7 +8537,7 @@ function ThemeCustomizerContent(props) {
|
|
|
7665
8537
|
children: "\u21B6"
|
|
7666
8538
|
}
|
|
7667
8539
|
),
|
|
7668
|
-
/* @__PURE__ */
|
|
8540
|
+
/* @__PURE__ */ jsx22(
|
|
7669
8541
|
"button",
|
|
7670
8542
|
{
|
|
7671
8543
|
onClick: redo,
|
|
@@ -7675,10 +8547,10 @@ function ThemeCustomizerContent(props) {
|
|
|
7675
8547
|
children: "\u21B7"
|
|
7676
8548
|
}
|
|
7677
8549
|
),
|
|
7678
|
-
/* @__PURE__ */
|
|
7679
|
-
/* @__PURE__ */
|
|
8550
|
+
/* @__PURE__ */ jsx22("button", { onClick: handleExport, className: "cms-icon-btn", title: "Export", children: "\u2B07" }),
|
|
8551
|
+
/* @__PURE__ */ jsxs20("label", { className: "cms-icon-btn", title: "Import", children: [
|
|
7680
8552
|
"\u2B06",
|
|
7681
|
-
/* @__PURE__ */
|
|
8553
|
+
/* @__PURE__ */ jsx22(
|
|
7682
8554
|
"input",
|
|
7683
8555
|
{
|
|
7684
8556
|
type: "file",
|
|
@@ -7688,10 +8560,10 @@ function ThemeCustomizerContent(props) {
|
|
|
7688
8560
|
}
|
|
7689
8561
|
)
|
|
7690
8562
|
] }),
|
|
7691
|
-
/* @__PURE__ */
|
|
8563
|
+
/* @__PURE__ */ jsx22("button", { onClick: onClose, className: "cms-close-btn-advanced", children: "\xD7" })
|
|
7692
8564
|
] })
|
|
7693
8565
|
] }),
|
|
7694
|
-
/* @__PURE__ */
|
|
8566
|
+
/* @__PURE__ */ jsx22("div", { className: "cms-search-bar", children: /* @__PURE__ */ jsx22(
|
|
7695
8567
|
"input",
|
|
7696
8568
|
{
|
|
7697
8569
|
type: "text",
|
|
@@ -7701,16 +8573,16 @@ function ThemeCustomizerContent(props) {
|
|
|
7701
8573
|
className: "cms-search-input"
|
|
7702
8574
|
}
|
|
7703
8575
|
) }),
|
|
7704
|
-
/* @__PURE__ */
|
|
7705
|
-
/* @__PURE__ */
|
|
7706
|
-
/* @__PURE__ */
|
|
7707
|
-
/* @__PURE__ */
|
|
7708
|
-
/* @__PURE__ */
|
|
7709
|
-
/* @__PURE__ */
|
|
7710
|
-
/* @__PURE__ */
|
|
8576
|
+
/* @__PURE__ */ jsxs20("div", { className: "cms-theme-tabs-advanced", children: [
|
|
8577
|
+
/* @__PURE__ */ jsx22(TabButton, { active: activeTab === "colors", onClick: () => setActiveTab("colors"), icon: "\u{1F3A8}", children: "Colors" }),
|
|
8578
|
+
/* @__PURE__ */ jsx22(TabButton, { active: activeTab === "typography", onClick: () => setActiveTab("typography"), icon: "Aa", children: "Typography" }),
|
|
8579
|
+
/* @__PURE__ */ jsx22(TabButton, { active: activeTab === "spacing", onClick: () => setActiveTab("spacing"), icon: "\u{1F4CF}", children: "Spacing" }),
|
|
8580
|
+
/* @__PURE__ */ jsx22(TabButton, { active: activeTab === "effects", onClick: () => setActiveTab("effects"), icon: "\u2728", children: "Effects" }),
|
|
8581
|
+
/* @__PURE__ */ jsx22(TabButton, { active: activeTab === "advanced", onClick: () => setActiveTab("advanced"), icon: "\u2699\uFE0F", children: "Advanced" }),
|
|
8582
|
+
/* @__PURE__ */ jsx22(TabButton, { active: activeTab === "preview", onClick: () => setActiveTab("preview"), icon: "\u{1F441}\uFE0F", children: "Preview" })
|
|
7711
8583
|
] }),
|
|
7712
|
-
/* @__PURE__ */
|
|
7713
|
-
activeTab === "colors" && /* @__PURE__ */
|
|
8584
|
+
/* @__PURE__ */ jsxs20("div", { className: "cms-theme-content-advanced", children: [
|
|
8585
|
+
activeTab === "colors" && /* @__PURE__ */ jsx22(
|
|
7714
8586
|
ColorsTab,
|
|
7715
8587
|
{
|
|
7716
8588
|
theme: customTheme,
|
|
@@ -7721,31 +8593,31 @@ function ThemeCustomizerContent(props) {
|
|
|
7721
8593
|
generateFromBrand
|
|
7722
8594
|
}
|
|
7723
8595
|
),
|
|
7724
|
-
activeTab === "typography" && /* @__PURE__ */
|
|
7725
|
-
activeTab === "spacing" && /* @__PURE__ */
|
|
7726
|
-
activeTab === "effects" && /* @__PURE__ */
|
|
7727
|
-
activeTab === "advanced" && /* @__PURE__ */
|
|
7728
|
-
activeTab === "preview" && /* @__PURE__ */
|
|
8596
|
+
activeTab === "typography" && /* @__PURE__ */ jsx22(TypographyTab, { theme: customTheme, updateTheme, searchQuery }),
|
|
8597
|
+
activeTab === "spacing" && /* @__PURE__ */ jsx22(SpacingTab, { theme: customTheme, updateTheme, searchQuery }),
|
|
8598
|
+
activeTab === "effects" && /* @__PURE__ */ jsx22(EffectsTab, { theme: customTheme, updateTheme, searchQuery }),
|
|
8599
|
+
activeTab === "advanced" && /* @__PURE__ */ jsx22(AdvancedTab2, { theme: customTheme, updateTheme }),
|
|
8600
|
+
activeTab === "preview" && /* @__PURE__ */ jsx22(PreviewTab, { theme: customTheme })
|
|
7729
8601
|
] }),
|
|
7730
|
-
/* @__PURE__ */
|
|
7731
|
-
/* @__PURE__ */
|
|
7732
|
-
/* @__PURE__ */
|
|
7733
|
-
/* @__PURE__ */
|
|
7734
|
-
/* @__PURE__ */
|
|
8602
|
+
/* @__PURE__ */ jsxs20("div", { className: "cms-theme-footer-advanced", children: [
|
|
8603
|
+
/* @__PURE__ */ jsx22("button", { onClick: resetTheme, className: "cms-btn-secondary", children: "Reset All" }),
|
|
8604
|
+
/* @__PURE__ */ jsxs20("div", { className: "cms-footer-actions", children: [
|
|
8605
|
+
/* @__PURE__ */ jsx22("button", { onClick: onClose, className: "cms-btn-secondary", children: "Cancel" }),
|
|
8606
|
+
/* @__PURE__ */ jsx22("button", { onClick: applyTheme, className: "cms-btn-primary", children: "Apply Theme" })
|
|
7735
8607
|
] })
|
|
7736
8608
|
] })
|
|
7737
8609
|
] })
|
|
7738
8610
|
] });
|
|
7739
8611
|
}
|
|
7740
8612
|
function TabButton({ active, onClick, icon, children }) {
|
|
7741
|
-
return /* @__PURE__ */
|
|
8613
|
+
return /* @__PURE__ */ jsxs20(
|
|
7742
8614
|
"button",
|
|
7743
8615
|
{
|
|
7744
8616
|
className: `cms-tab-btn-advanced ${active ? "active" : ""}`,
|
|
7745
8617
|
onClick,
|
|
7746
8618
|
children: [
|
|
7747
|
-
/* @__PURE__ */
|
|
7748
|
-
/* @__PURE__ */
|
|
8619
|
+
/* @__PURE__ */ jsx22("span", { className: "cms-tab-icon", children: icon }),
|
|
8620
|
+
/* @__PURE__ */ jsx22("span", { className: "cms-tab-label", children })
|
|
7749
8621
|
]
|
|
7750
8622
|
}
|
|
7751
8623
|
);
|
|
@@ -7758,7 +8630,7 @@ function ColorsTab({
|
|
|
7758
8630
|
setShowColorPicker,
|
|
7759
8631
|
generateFromBrand
|
|
7760
8632
|
}) {
|
|
7761
|
-
const [brandColor, setBrandColor] =
|
|
8633
|
+
const [brandColor, setBrandColor] = useState19("#667eea");
|
|
7762
8634
|
const colorGroups = [
|
|
7763
8635
|
{ title: "Primary", keys: ["primary", "primaryHover", "primaryLight", "primaryDark", "primaryContrast"] },
|
|
7764
8636
|
{ title: "Secondary", keys: ["secondary", "secondaryHover", "secondaryLight", "secondaryDark", "secondaryContrast"] },
|
|
@@ -7777,11 +8649,11 @@ function ColorsTab({
|
|
|
7777
8649
|
(key) => key.toLowerCase().includes(searchQuery.toLowerCase()) || group.title.toLowerCase().includes(searchQuery.toLowerCase())
|
|
7778
8650
|
)
|
|
7779
8651
|
})).filter((group) => group.keys.length > 0);
|
|
7780
|
-
return /* @__PURE__ */
|
|
7781
|
-
/* @__PURE__ */
|
|
7782
|
-
/* @__PURE__ */
|
|
7783
|
-
/* @__PURE__ */
|
|
7784
|
-
/* @__PURE__ */
|
|
8652
|
+
return /* @__PURE__ */ jsxs20("div", { className: "cms-colors-tab", children: [
|
|
8653
|
+
/* @__PURE__ */ jsxs20("div", { className: "cms-brand-generator", children: [
|
|
8654
|
+
/* @__PURE__ */ jsx22("h3", { children: "\u{1F3A8} Generate from Brand Color" }),
|
|
8655
|
+
/* @__PURE__ */ jsxs20("div", { className: "cms-brand-input-group", children: [
|
|
8656
|
+
/* @__PURE__ */ jsx22(
|
|
7785
8657
|
"input",
|
|
7786
8658
|
{
|
|
7787
8659
|
type: "color",
|
|
@@ -7790,7 +8662,7 @@ function ColorsTab({
|
|
|
7790
8662
|
className: "cms-brand-color-picker"
|
|
7791
8663
|
}
|
|
7792
8664
|
),
|
|
7793
|
-
/* @__PURE__ */
|
|
8665
|
+
/* @__PURE__ */ jsx22(
|
|
7794
8666
|
"input",
|
|
7795
8667
|
{
|
|
7796
8668
|
type: "text",
|
|
@@ -7800,7 +8672,7 @@ function ColorsTab({
|
|
|
7800
8672
|
placeholder: "#667eea"
|
|
7801
8673
|
}
|
|
7802
8674
|
),
|
|
7803
|
-
/* @__PURE__ */
|
|
8675
|
+
/* @__PURE__ */ jsx22(
|
|
7804
8676
|
"button",
|
|
7805
8677
|
{
|
|
7806
8678
|
onClick: () => generateFromBrand(brandColor),
|
|
@@ -7810,9 +8682,9 @@ function ColorsTab({
|
|
|
7810
8682
|
)
|
|
7811
8683
|
] })
|
|
7812
8684
|
] }),
|
|
7813
|
-
filteredGroups.map((group) => /* @__PURE__ */
|
|
7814
|
-
/* @__PURE__ */
|
|
7815
|
-
/* @__PURE__ */
|
|
8685
|
+
filteredGroups.map((group) => /* @__PURE__ */ jsxs20("div", { className: "cms-color-group", children: [
|
|
8686
|
+
/* @__PURE__ */ jsx22("h3", { children: group.title }),
|
|
8687
|
+
/* @__PURE__ */ jsx22("div", { className: "cms-color-grid-advanced", children: group.keys.map((key) => /* @__PURE__ */ jsx22(
|
|
7816
8688
|
AdvancedColorInput,
|
|
7817
8689
|
{
|
|
7818
8690
|
label: formatLabel(key),
|
|
@@ -7840,9 +8712,9 @@ function TypographyTab({ theme, updateTheme, searchQuery }) {
|
|
|
7840
8712
|
(key) => key.toLowerCase().includes(searchQuery.toLowerCase()) || group.title.toLowerCase().includes(searchQuery.toLowerCase())
|
|
7841
8713
|
)
|
|
7842
8714
|
})).filter((group) => group.keys.length > 0) : typographyGroups;
|
|
7843
|
-
return /* @__PURE__ */
|
|
7844
|
-
/* @__PURE__ */
|
|
7845
|
-
/* @__PURE__ */
|
|
8715
|
+
return /* @__PURE__ */ jsx22("div", { className: "cms-typography-tab", children: filteredGroups.map((group) => /* @__PURE__ */ jsxs20("div", { className: "cms-property-group", children: [
|
|
8716
|
+
/* @__PURE__ */ jsx22("h3", { children: group.title }),
|
|
8717
|
+
/* @__PURE__ */ jsx22("div", { className: "cms-property-grid", children: group.keys.map((key) => /* @__PURE__ */ jsx22(
|
|
7846
8718
|
PropertyInput,
|
|
7847
8719
|
{
|
|
7848
8720
|
label: formatLabel(key),
|
|
@@ -7855,13 +8727,13 @@ function TypographyTab({ theme, updateTheme, searchQuery }) {
|
|
|
7855
8727
|
] }, group.title)) });
|
|
7856
8728
|
}
|
|
7857
8729
|
function SpacingTab({ theme, updateTheme, searchQuery }) {
|
|
7858
|
-
return /* @__PURE__ */
|
|
7859
|
-
/* @__PURE__ */
|
|
7860
|
-
/* @__PURE__ */
|
|
7861
|
-
/* @__PURE__ */
|
|
7862
|
-
/* @__PURE__ */
|
|
7863
|
-
/* @__PURE__ */
|
|
7864
|
-
/* @__PURE__ */
|
|
8730
|
+
return /* @__PURE__ */ jsxs20("div", { className: "cms-spacing-tab", children: [
|
|
8731
|
+
/* @__PURE__ */ jsxs20("div", { className: "cms-property-group", children: [
|
|
8732
|
+
/* @__PURE__ */ jsx22("h3", { children: "Spacing Scale" }),
|
|
8733
|
+
/* @__PURE__ */ jsx22("div", { className: "cms-spacing-visual", children: Object.entries(theme.spacing).map(([key, value]) => /* @__PURE__ */ jsxs20("div", { className: "cms-spacing-item", children: [
|
|
8734
|
+
/* @__PURE__ */ jsx22("div", { className: "cms-spacing-label", children: key.toUpperCase() }),
|
|
8735
|
+
/* @__PURE__ */ jsx22("div", { className: "cms-spacing-bar", style: { width: value }, children: /* @__PURE__ */ jsx22("span", { children: value }) }),
|
|
8736
|
+
/* @__PURE__ */ jsx22(
|
|
7865
8737
|
"input",
|
|
7866
8738
|
{
|
|
7867
8739
|
type: "text",
|
|
@@ -7872,11 +8744,11 @@ function SpacingTab({ theme, updateTheme, searchQuery }) {
|
|
|
7872
8744
|
)
|
|
7873
8745
|
] }, key)) })
|
|
7874
8746
|
] }),
|
|
7875
|
-
/* @__PURE__ */
|
|
7876
|
-
/* @__PURE__ */
|
|
7877
|
-
/* @__PURE__ */
|
|
7878
|
-
/* @__PURE__ */
|
|
7879
|
-
/* @__PURE__ */
|
|
8747
|
+
/* @__PURE__ */ jsxs20("div", { className: "cms-property-group", children: [
|
|
8748
|
+
/* @__PURE__ */ jsx22("h3", { children: "Border Radius" }),
|
|
8749
|
+
/* @__PURE__ */ jsx22("div", { className: "cms-radius-grid", children: Object.entries(theme.borderRadius).map(([key, value]) => /* @__PURE__ */ jsxs20("div", { className: "cms-radius-item", children: [
|
|
8750
|
+
/* @__PURE__ */ jsx22("div", { className: "cms-radius-preview", style: { borderRadius: value } }),
|
|
8751
|
+
/* @__PURE__ */ jsx22(
|
|
7880
8752
|
PropertyInput,
|
|
7881
8753
|
{
|
|
7882
8754
|
label: key.toUpperCase(),
|
|
@@ -7889,12 +8761,12 @@ function SpacingTab({ theme, updateTheme, searchQuery }) {
|
|
|
7889
8761
|
] });
|
|
7890
8762
|
}
|
|
7891
8763
|
function EffectsTab({ theme, updateTheme, searchQuery }) {
|
|
7892
|
-
return /* @__PURE__ */
|
|
7893
|
-
/* @__PURE__ */
|
|
7894
|
-
/* @__PURE__ */
|
|
7895
|
-
/* @__PURE__ */
|
|
7896
|
-
/* @__PURE__ */
|
|
7897
|
-
/* @__PURE__ */
|
|
8764
|
+
return /* @__PURE__ */ jsxs20("div", { className: "cms-effects-tab", children: [
|
|
8765
|
+
/* @__PURE__ */ jsxs20("div", { className: "cms-property-group", children: [
|
|
8766
|
+
/* @__PURE__ */ jsx22("h3", { children: "Shadows" }),
|
|
8767
|
+
/* @__PURE__ */ jsx22("div", { className: "cms-shadow-grid", children: Object.entries(theme.shadows).map(([key, value]) => /* @__PURE__ */ jsxs20("div", { className: "cms-shadow-item", children: [
|
|
8768
|
+
/* @__PURE__ */ jsx22("div", { className: "cms-shadow-preview", style: { boxShadow: value } }),
|
|
8769
|
+
/* @__PURE__ */ jsx22(
|
|
7898
8770
|
PropertyInput,
|
|
7899
8771
|
{
|
|
7900
8772
|
label: key.toUpperCase(),
|
|
@@ -7904,9 +8776,9 @@ function EffectsTab({ theme, updateTheme, searchQuery }) {
|
|
|
7904
8776
|
)
|
|
7905
8777
|
] }, key)) })
|
|
7906
8778
|
] }),
|
|
7907
|
-
/* @__PURE__ */
|
|
7908
|
-
/* @__PURE__ */
|
|
7909
|
-
/* @__PURE__ */
|
|
8779
|
+
/* @__PURE__ */ jsxs20("div", { className: "cms-property-group", children: [
|
|
8780
|
+
/* @__PURE__ */ jsx22("h3", { children: "Transitions" }),
|
|
8781
|
+
/* @__PURE__ */ jsx22("div", { className: "cms-property-grid", children: Object.entries(theme.transitions).map(([key, value]) => /* @__PURE__ */ jsx22(
|
|
7910
8782
|
PropertyInput,
|
|
7911
8783
|
{
|
|
7912
8784
|
label: formatLabel(key),
|
|
@@ -7916,11 +8788,11 @@ function EffectsTab({ theme, updateTheme, searchQuery }) {
|
|
|
7916
8788
|
key
|
|
7917
8789
|
)) })
|
|
7918
8790
|
] }),
|
|
7919
|
-
/* @__PURE__ */
|
|
7920
|
-
/* @__PURE__ */
|
|
7921
|
-
/* @__PURE__ */
|
|
7922
|
-
/* @__PURE__ */
|
|
7923
|
-
/* @__PURE__ */
|
|
8791
|
+
/* @__PURE__ */ jsxs20("div", { className: "cms-property-group", children: [
|
|
8792
|
+
/* @__PURE__ */ jsx22("h3", { children: "Gradients" }),
|
|
8793
|
+
/* @__PURE__ */ jsx22("div", { className: "cms-gradient-grid", children: Object.entries(theme.gradients).map(([key, value]) => /* @__PURE__ */ jsxs20("div", { className: "cms-gradient-item", children: [
|
|
8794
|
+
/* @__PURE__ */ jsx22("div", { className: "cms-gradient-preview", style: { background: value } }),
|
|
8795
|
+
/* @__PURE__ */ jsx22(
|
|
7924
8796
|
PropertyInput,
|
|
7925
8797
|
{
|
|
7926
8798
|
label: formatLabel(key),
|
|
@@ -7932,12 +8804,12 @@ function EffectsTab({ theme, updateTheme, searchQuery }) {
|
|
|
7932
8804
|
] })
|
|
7933
8805
|
] });
|
|
7934
8806
|
}
|
|
7935
|
-
function
|
|
8807
|
+
function AdvancedTab2({ theme, updateTheme }) {
|
|
7936
8808
|
const validation = validateTheme(theme);
|
|
7937
|
-
return /* @__PURE__ */
|
|
7938
|
-
/* @__PURE__ */
|
|
7939
|
-
/* @__PURE__ */
|
|
7940
|
-
/* @__PURE__ */
|
|
8809
|
+
return /* @__PURE__ */ jsxs20("div", { className: "cms-advanced-tab", children: [
|
|
8810
|
+
/* @__PURE__ */ jsxs20("div", { className: "cms-property-group", children: [
|
|
8811
|
+
/* @__PURE__ */ jsx22("h3", { children: "Theme Information" }),
|
|
8812
|
+
/* @__PURE__ */ jsx22(
|
|
7941
8813
|
PropertyInput,
|
|
7942
8814
|
{
|
|
7943
8815
|
label: "Theme Name",
|
|
@@ -7945,32 +8817,32 @@ function AdvancedTab({ theme, updateTheme }) {
|
|
|
7945
8817
|
onChange: (value) => updateTheme({ name: value })
|
|
7946
8818
|
}
|
|
7947
8819
|
),
|
|
7948
|
-
/* @__PURE__ */
|
|
7949
|
-
/* @__PURE__ */
|
|
7950
|
-
/* @__PURE__ */
|
|
8820
|
+
/* @__PURE__ */ jsxs20("div", { className: "cms-theme-mode", children: [
|
|
8821
|
+
/* @__PURE__ */ jsx22("label", { children: "Mode" }),
|
|
8822
|
+
/* @__PURE__ */ jsxs20(
|
|
7951
8823
|
"select",
|
|
7952
8824
|
{
|
|
7953
8825
|
value: theme.mode,
|
|
7954
8826
|
onChange: (e) => updateTheme({ mode: e.target.value }),
|
|
7955
8827
|
className: "cms-select",
|
|
7956
8828
|
children: [
|
|
7957
|
-
/* @__PURE__ */
|
|
7958
|
-
/* @__PURE__ */
|
|
8829
|
+
/* @__PURE__ */ jsx22("option", { value: "light", children: "Light" }),
|
|
8830
|
+
/* @__PURE__ */ jsx22("option", { value: "dark", children: "Dark" })
|
|
7959
8831
|
]
|
|
7960
8832
|
}
|
|
7961
8833
|
)
|
|
7962
8834
|
] })
|
|
7963
8835
|
] }),
|
|
7964
|
-
/* @__PURE__ */
|
|
7965
|
-
/* @__PURE__ */
|
|
7966
|
-
/* @__PURE__ */
|
|
7967
|
-
/* @__PURE__ */
|
|
7968
|
-
/* @__PURE__ */
|
|
8836
|
+
/* @__PURE__ */ jsxs20("div", { className: "cms-property-group", children: [
|
|
8837
|
+
/* @__PURE__ */ jsx22("h3", { children: "Validation" }),
|
|
8838
|
+
/* @__PURE__ */ jsx22("div", { className: `cms-validation ${validation.valid ? "valid" : "invalid"}`, children: validation.valid ? /* @__PURE__ */ jsx22("div", { className: "cms-validation-success", children: "\u2713 Theme is valid" }) : /* @__PURE__ */ jsxs20("div", { className: "cms-validation-errors", children: [
|
|
8839
|
+
/* @__PURE__ */ jsx22("strong", { children: "Errors:" }),
|
|
8840
|
+
/* @__PURE__ */ jsx22("ul", { children: validation.errors.map((error, i) => /* @__PURE__ */ jsx22("li", { children: error }, i)) })
|
|
7969
8841
|
] }) })
|
|
7970
8842
|
] }),
|
|
7971
|
-
/* @__PURE__ */
|
|
7972
|
-
/* @__PURE__ */
|
|
7973
|
-
/* @__PURE__ */
|
|
8843
|
+
/* @__PURE__ */ jsxs20("div", { className: "cms-property-group", children: [
|
|
8844
|
+
/* @__PURE__ */ jsx22("h3", { children: "Breakpoints" }),
|
|
8845
|
+
/* @__PURE__ */ jsx22("div", { className: "cms-property-grid", children: Object.entries(theme.breakpoints).map(([key, value]) => /* @__PURE__ */ jsx22(
|
|
7974
8846
|
PropertyInput,
|
|
7975
8847
|
{
|
|
7976
8848
|
label: key.toUpperCase(),
|
|
@@ -7980,9 +8852,9 @@ function AdvancedTab({ theme, updateTheme }) {
|
|
|
7980
8852
|
key
|
|
7981
8853
|
)) })
|
|
7982
8854
|
] }),
|
|
7983
|
-
/* @__PURE__ */
|
|
7984
|
-
/* @__PURE__ */
|
|
7985
|
-
/* @__PURE__ */
|
|
8855
|
+
/* @__PURE__ */ jsxs20("div", { className: "cms-property-group", children: [
|
|
8856
|
+
/* @__PURE__ */ jsx22("h3", { children: "Z-Index Layers" }),
|
|
8857
|
+
/* @__PURE__ */ jsx22("div", { className: "cms-property-grid", children: Object.entries(theme.zIndex).map(([key, value]) => /* @__PURE__ */ jsx22(
|
|
7986
8858
|
PropertyInput,
|
|
7987
8859
|
{
|
|
7988
8860
|
label: formatLabel(key),
|
|
@@ -7996,26 +8868,26 @@ function AdvancedTab({ theme, updateTheme }) {
|
|
|
7996
8868
|
] });
|
|
7997
8869
|
}
|
|
7998
8870
|
function PreviewTab({ theme }) {
|
|
7999
|
-
return /* @__PURE__ */
|
|
8871
|
+
return /* @__PURE__ */ jsx22("div", { className: "cms-preview-tab", style: {
|
|
8000
8872
|
background: theme.colors.background,
|
|
8001
8873
|
color: theme.colors.textPrimary,
|
|
8002
8874
|
fontFamily: theme.typography.fontFamily
|
|
8003
|
-
}, children: /* @__PURE__ */
|
|
8004
|
-
/* @__PURE__ */
|
|
8005
|
-
/* @__PURE__ */
|
|
8006
|
-
/* @__PURE__ */
|
|
8007
|
-
/* @__PURE__ */
|
|
8008
|
-
/* @__PURE__ */
|
|
8875
|
+
}, children: /* @__PURE__ */ jsxs20("div", { className: "cms-preview-section", children: [
|
|
8876
|
+
/* @__PURE__ */ jsx22("h2", { style: { color: theme.colors.textPrimary }, children: "Theme Preview" }),
|
|
8877
|
+
/* @__PURE__ */ jsxs20("div", { className: "cms-preview-colors", children: [
|
|
8878
|
+
/* @__PURE__ */ jsx22("div", { className: "cms-preview-color-box", style: { background: theme.colors.primary, color: theme.colors.primaryContrast }, children: "Primary" }),
|
|
8879
|
+
/* @__PURE__ */ jsx22("div", { className: "cms-preview-color-box", style: { background: theme.colors.secondary, color: theme.colors.secondaryContrast }, children: "Secondary" }),
|
|
8880
|
+
/* @__PURE__ */ jsx22("div", { className: "cms-preview-color-box", style: { background: theme.colors.accent }, children: "Accent" })
|
|
8009
8881
|
] }),
|
|
8010
|
-
/* @__PURE__ */
|
|
8882
|
+
/* @__PURE__ */ jsxs20("div", { className: "cms-preview-card", style: {
|
|
8011
8883
|
background: theme.colors.surface,
|
|
8012
8884
|
borderRadius: theme.borderRadius.lg,
|
|
8013
8885
|
boxShadow: theme.shadows.md,
|
|
8014
8886
|
padding: theme.spacing.lg
|
|
8015
8887
|
}, children: [
|
|
8016
|
-
/* @__PURE__ */
|
|
8017
|
-
/* @__PURE__ */
|
|
8018
|
-
/* @__PURE__ */
|
|
8888
|
+
/* @__PURE__ */ jsx22("h3", { style: { color: theme.colors.textPrimary }, children: "Card Component" }),
|
|
8889
|
+
/* @__PURE__ */ jsx22("p", { style: { color: theme.colors.textSecondary }, children: "This is how your theme looks in a card component with surface background and shadow." }),
|
|
8890
|
+
/* @__PURE__ */ jsx22("button", { style: {
|
|
8019
8891
|
background: theme.colors.primary,
|
|
8020
8892
|
color: theme.colors.primaryContrast,
|
|
8021
8893
|
padding: `${theme.spacing.sm} ${theme.spacing.lg}`,
|
|
@@ -8024,11 +8896,11 @@ function PreviewTab({ theme }) {
|
|
|
8024
8896
|
cursor: "pointer"
|
|
8025
8897
|
}, children: "Primary Button" })
|
|
8026
8898
|
] }),
|
|
8027
|
-
/* @__PURE__ */
|
|
8028
|
-
/* @__PURE__ */
|
|
8029
|
-
/* @__PURE__ */
|
|
8030
|
-
/* @__PURE__ */
|
|
8031
|
-
/* @__PURE__ */
|
|
8899
|
+
/* @__PURE__ */ jsxs20("div", { className: "cms-preview-typography", children: [
|
|
8900
|
+
/* @__PURE__ */ jsx22("h1", { style: { fontSize: theme.typography.fontSize4xl }, children: "Heading 1" }),
|
|
8901
|
+
/* @__PURE__ */ jsx22("h2", { style: { fontSize: theme.typography.fontSize3xl }, children: "Heading 2" }),
|
|
8902
|
+
/* @__PURE__ */ jsx22("h3", { style: { fontSize: theme.typography.fontSizeXxl }, children: "Heading 3" }),
|
|
8903
|
+
/* @__PURE__ */ jsx22("p", { style: { fontSize: theme.typography.fontSizeMd, lineHeight: theme.typography.lineHeightNormal }, children: "Body text with normal line height and medium font size." })
|
|
8032
8904
|
] })
|
|
8033
8905
|
] }) });
|
|
8034
8906
|
}
|
|
@@ -8039,10 +8911,10 @@ function AdvancedColorInput({
|
|
|
8039
8911
|
showPicker,
|
|
8040
8912
|
onTogglePicker
|
|
8041
8913
|
}) {
|
|
8042
|
-
return /* @__PURE__ */
|
|
8043
|
-
/* @__PURE__ */
|
|
8044
|
-
/* @__PURE__ */
|
|
8045
|
-
/* @__PURE__ */
|
|
8914
|
+
return /* @__PURE__ */ jsxs20("div", { className: "cms-advanced-color-input", children: [
|
|
8915
|
+
/* @__PURE__ */ jsx22("label", { children: label }),
|
|
8916
|
+
/* @__PURE__ */ jsxs20("div", { className: "cms-color-input-wrapper-advanced", children: [
|
|
8917
|
+
/* @__PURE__ */ jsx22(
|
|
8046
8918
|
"div",
|
|
8047
8919
|
{
|
|
8048
8920
|
className: "cms-color-swatch",
|
|
@@ -8050,7 +8922,7 @@ function AdvancedColorInput({
|
|
|
8050
8922
|
onClick: onTogglePicker
|
|
8051
8923
|
}
|
|
8052
8924
|
),
|
|
8053
|
-
/* @__PURE__ */
|
|
8925
|
+
/* @__PURE__ */ jsx22(
|
|
8054
8926
|
"input",
|
|
8055
8927
|
{
|
|
8056
8928
|
type: "text",
|
|
@@ -8060,8 +8932,8 @@ function AdvancedColorInput({
|
|
|
8060
8932
|
placeholder: "#000000"
|
|
8061
8933
|
}
|
|
8062
8934
|
),
|
|
8063
|
-
showPicker && /* @__PURE__ */
|
|
8064
|
-
/* @__PURE__ */
|
|
8935
|
+
showPicker && /* @__PURE__ */ jsxs20("div", { className: "cms-color-picker-popover", children: [
|
|
8936
|
+
/* @__PURE__ */ jsx22(
|
|
8065
8937
|
"input",
|
|
8066
8938
|
{
|
|
8067
8939
|
type: "color",
|
|
@@ -8070,7 +8942,7 @@ function AdvancedColorInput({
|
|
|
8070
8942
|
className: "cms-color-picker-native"
|
|
8071
8943
|
}
|
|
8072
8944
|
),
|
|
8073
|
-
/* @__PURE__ */
|
|
8945
|
+
/* @__PURE__ */ jsx22("div", { className: "cms-color-presets", children: ["#667eea", "#764ba2", "#f59e0b", "#10b981", "#ef4444", "#3b82f6", "#8b5cf6", "#ec4899"].map((preset) => /* @__PURE__ */ jsx22(
|
|
8074
8946
|
"div",
|
|
8075
8947
|
{
|
|
8076
8948
|
className: "cms-color-preset",
|
|
@@ -8089,9 +8961,9 @@ function PropertyInput({
|
|
|
8089
8961
|
onChange,
|
|
8090
8962
|
type = "text"
|
|
8091
8963
|
}) {
|
|
8092
|
-
return /* @__PURE__ */
|
|
8093
|
-
/* @__PURE__ */
|
|
8094
|
-
/* @__PURE__ */
|
|
8964
|
+
return /* @__PURE__ */ jsxs20("div", { className: "cms-property-input", children: [
|
|
8965
|
+
/* @__PURE__ */ jsx22("label", { children: label }),
|
|
8966
|
+
/* @__PURE__ */ jsx22(
|
|
8095
8967
|
"input",
|
|
8096
8968
|
{
|
|
8097
8969
|
type,
|
|
@@ -8110,25 +8982,34 @@ export {
|
|
|
8110
8982
|
CMSRenderer,
|
|
8111
8983
|
ImageNode,
|
|
8112
8984
|
OPEN_IMAGE_EDITOR_COMMAND,
|
|
8985
|
+
SEOPlugin,
|
|
8113
8986
|
ThemeCustomizer,
|
|
8114
8987
|
ThemeProvider,
|
|
8115
8988
|
ThemeSwitcher,
|
|
8116
8989
|
VideoNode,
|
|
8990
|
+
analyzeSEO,
|
|
8117
8991
|
appendHTML,
|
|
8118
8992
|
copyMarkdownToClipboard,
|
|
8993
|
+
copyMetadataToClipboard,
|
|
8994
|
+
createDefaultMetadata,
|
|
8119
8995
|
createGradient,
|
|
8120
8996
|
createTheme,
|
|
8121
8997
|
darkTheme,
|
|
8122
8998
|
downloadHTML,
|
|
8123
8999
|
downloadMarkdown,
|
|
9000
|
+
downloadMetadata,
|
|
8124
9001
|
draculaTheme,
|
|
8125
9002
|
exportTheme,
|
|
8126
9003
|
exportToHTML,
|
|
8127
9004
|
exportToHTMLWithWrapper,
|
|
8128
9005
|
exportToMarkdown,
|
|
9006
|
+
extractKeywords,
|
|
8129
9007
|
forestTheme,
|
|
8130
9008
|
generateColorVariations,
|
|
9009
|
+
generateMetaTags,
|
|
8131
9010
|
generatePalette,
|
|
9011
|
+
generateSlug,
|
|
9012
|
+
generateStructuredData,
|
|
8132
9013
|
generateThemeFromBrand,
|
|
8133
9014
|
importFromHTML,
|
|
8134
9015
|
importFromMarkdown,
|
|
@@ -8136,6 +9017,7 @@ export {
|
|
|
8136
9017
|
lightTheme,
|
|
8137
9018
|
loadHTMLFromFile,
|
|
8138
9019
|
loadMarkdownFromFile,
|
|
9020
|
+
mergeMetadata,
|
|
8139
9021
|
midnightTheme,
|
|
8140
9022
|
minimalTheme,
|
|
8141
9023
|
monokaiTheme,
|
|
@@ -8146,6 +9028,7 @@ export {
|
|
|
8146
9028
|
sunsetTheme,
|
|
8147
9029
|
themeToCSSVariables,
|
|
8148
9030
|
useTheme,
|
|
9031
|
+
validateMetadata,
|
|
8149
9032
|
validateTheme
|
|
8150
9033
|
};
|
|
8151
9034
|
//# sourceMappingURL=index.mjs.map
|