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.d.mts
CHANGED
|
@@ -2,14 +2,193 @@ import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
|
2
2
|
import { LexicalEditor, LexicalCommand, DecoratorNode, NodeKey, Spread, SerializedLexicalNode } from 'lexical';
|
|
3
3
|
import { JSX, ReactNode } from 'react';
|
|
4
4
|
|
|
5
|
+
interface SEOMetadata {
|
|
6
|
+
title?: string;
|
|
7
|
+
description?: string;
|
|
8
|
+
keywords?: string[];
|
|
9
|
+
author?: string;
|
|
10
|
+
canonical?: string;
|
|
11
|
+
robots?: string;
|
|
12
|
+
ogTitle?: string;
|
|
13
|
+
ogDescription?: string;
|
|
14
|
+
ogImage?: string;
|
|
15
|
+
ogImageAlt?: string;
|
|
16
|
+
ogUrl?: string;
|
|
17
|
+
ogType?: 'website' | 'article' | 'blog' | 'product';
|
|
18
|
+
ogSiteName?: string;
|
|
19
|
+
ogLocale?: string;
|
|
20
|
+
twitterCard?: 'summary' | 'summary_large_image' | 'app' | 'player';
|
|
21
|
+
twitterSite?: string;
|
|
22
|
+
twitterCreator?: string;
|
|
23
|
+
twitterTitle?: string;
|
|
24
|
+
twitterDescription?: string;
|
|
25
|
+
twitterImage?: string;
|
|
26
|
+
twitterImageAlt?: string;
|
|
27
|
+
articlePublishedTime?: string;
|
|
28
|
+
articleModifiedTime?: string;
|
|
29
|
+
articleAuthor?: string;
|
|
30
|
+
articleSection?: string;
|
|
31
|
+
articleTags?: string[];
|
|
32
|
+
schema?: SchemaType[];
|
|
33
|
+
}
|
|
34
|
+
type SchemaType = ArticleSchema | BreadcrumbSchema | OrganizationSchema | PersonSchema | ProductSchema | FAQSchema | HowToSchema;
|
|
35
|
+
interface ArticleSchema {
|
|
36
|
+
'@context': 'https://schema.org';
|
|
37
|
+
'@type': 'Article' | 'BlogPosting' | 'NewsArticle';
|
|
38
|
+
headline: string;
|
|
39
|
+
description?: string;
|
|
40
|
+
image?: string | string[];
|
|
41
|
+
datePublished?: string;
|
|
42
|
+
dateModified?: string;
|
|
43
|
+
author?: {
|
|
44
|
+
'@type': 'Person' | 'Organization';
|
|
45
|
+
name: string;
|
|
46
|
+
url?: string;
|
|
47
|
+
};
|
|
48
|
+
publisher?: {
|
|
49
|
+
'@type': 'Organization';
|
|
50
|
+
name: string;
|
|
51
|
+
logo?: {
|
|
52
|
+
'@type': 'ImageObject';
|
|
53
|
+
url: string;
|
|
54
|
+
};
|
|
55
|
+
};
|
|
56
|
+
mainEntityOfPage?: string;
|
|
57
|
+
}
|
|
58
|
+
interface BreadcrumbSchema {
|
|
59
|
+
'@context': 'https://schema.org';
|
|
60
|
+
'@type': 'BreadcrumbList';
|
|
61
|
+
itemListElement: Array<{
|
|
62
|
+
'@type': 'ListItem';
|
|
63
|
+
position: number;
|
|
64
|
+
name: string;
|
|
65
|
+
item?: string;
|
|
66
|
+
}>;
|
|
67
|
+
}
|
|
68
|
+
interface OrganizationSchema {
|
|
69
|
+
'@context': 'https://schema.org';
|
|
70
|
+
'@type': 'Organization';
|
|
71
|
+
name: string;
|
|
72
|
+
url?: string;
|
|
73
|
+
logo?: string;
|
|
74
|
+
description?: string;
|
|
75
|
+
contactPoint?: Array<{
|
|
76
|
+
'@type': 'ContactPoint';
|
|
77
|
+
telephone: string;
|
|
78
|
+
contactType: string;
|
|
79
|
+
}>;
|
|
80
|
+
sameAs?: string[];
|
|
81
|
+
}
|
|
82
|
+
interface PersonSchema {
|
|
83
|
+
'@context': 'https://schema.org';
|
|
84
|
+
'@type': 'Person';
|
|
85
|
+
name: string;
|
|
86
|
+
url?: string;
|
|
87
|
+
image?: string;
|
|
88
|
+
jobTitle?: string;
|
|
89
|
+
worksFor?: {
|
|
90
|
+
'@type': 'Organization';
|
|
91
|
+
name: string;
|
|
92
|
+
};
|
|
93
|
+
sameAs?: string[];
|
|
94
|
+
}
|
|
95
|
+
interface ProductSchema {
|
|
96
|
+
'@context': 'https://schema.org';
|
|
97
|
+
'@type': 'Product';
|
|
98
|
+
name: string;
|
|
99
|
+
image?: string | string[];
|
|
100
|
+
description?: string;
|
|
101
|
+
brand?: {
|
|
102
|
+
'@type': 'Brand';
|
|
103
|
+
name: string;
|
|
104
|
+
};
|
|
105
|
+
offers?: {
|
|
106
|
+
'@type': 'Offer';
|
|
107
|
+
price: string;
|
|
108
|
+
priceCurrency: string;
|
|
109
|
+
availability?: string;
|
|
110
|
+
};
|
|
111
|
+
aggregateRating?: {
|
|
112
|
+
'@type': 'AggregateRating';
|
|
113
|
+
ratingValue: number;
|
|
114
|
+
reviewCount: number;
|
|
115
|
+
};
|
|
116
|
+
}
|
|
117
|
+
interface FAQSchema {
|
|
118
|
+
'@context': 'https://schema.org';
|
|
119
|
+
'@type': 'FAQPage';
|
|
120
|
+
mainEntity: Array<{
|
|
121
|
+
'@type': 'Question';
|
|
122
|
+
name: string;
|
|
123
|
+
acceptedAnswer: {
|
|
124
|
+
'@type': 'Answer';
|
|
125
|
+
text: string;
|
|
126
|
+
};
|
|
127
|
+
}>;
|
|
128
|
+
}
|
|
129
|
+
interface HowToSchema {
|
|
130
|
+
'@context': 'https://schema.org';
|
|
131
|
+
'@type': 'HowTo';
|
|
132
|
+
name: string;
|
|
133
|
+
description?: string;
|
|
134
|
+
image?: string | string[];
|
|
135
|
+
totalTime?: string;
|
|
136
|
+
step: Array<{
|
|
137
|
+
'@type': 'HowToStep';
|
|
138
|
+
name: string;
|
|
139
|
+
text: string;
|
|
140
|
+
image?: string;
|
|
141
|
+
}>;
|
|
142
|
+
}
|
|
143
|
+
interface SEOAnalysis {
|
|
144
|
+
score: number;
|
|
145
|
+
issues: SEOIssue[];
|
|
146
|
+
suggestions: SEOSuggestion[];
|
|
147
|
+
metrics: SEOMetrics;
|
|
148
|
+
}
|
|
149
|
+
interface SEOIssue {
|
|
150
|
+
type: 'error' | 'warning' | 'info';
|
|
151
|
+
category: 'meta' | 'content' | 'structure' | 'performance' | 'accessibility';
|
|
152
|
+
message: string;
|
|
153
|
+
impact: 'high' | 'medium' | 'low';
|
|
154
|
+
}
|
|
155
|
+
interface SEOSuggestion {
|
|
156
|
+
category: string;
|
|
157
|
+
message: string;
|
|
158
|
+
priority: 'high' | 'medium' | 'low';
|
|
159
|
+
}
|
|
160
|
+
interface SEOMetrics {
|
|
161
|
+
titleLength: number;
|
|
162
|
+
descriptionLength: number;
|
|
163
|
+
headingCount: {
|
|
164
|
+
h1: number;
|
|
165
|
+
h2: number;
|
|
166
|
+
h3: number;
|
|
167
|
+
h4: number;
|
|
168
|
+
h5: number;
|
|
169
|
+
h6: number;
|
|
170
|
+
};
|
|
171
|
+
imageCount: number;
|
|
172
|
+
imagesWithAlt: number;
|
|
173
|
+
linkCount: number;
|
|
174
|
+
internalLinks: number;
|
|
175
|
+
externalLinks: number;
|
|
176
|
+
wordCount: number;
|
|
177
|
+
readingTime: number;
|
|
178
|
+
keywordDensity: Record<string, number>;
|
|
179
|
+
}
|
|
180
|
+
|
|
5
181
|
interface CMSBlockEditorProps {
|
|
6
182
|
value?: string;
|
|
7
183
|
onChange?: (state: any) => void;
|
|
8
184
|
onImageAdded?: (file: File) => Promise<string>;
|
|
9
185
|
onVideoAdded?: (file: File) => Promise<string>;
|
|
10
186
|
useBase64Url?: boolean;
|
|
187
|
+
seoMetadata?: SEOMetadata;
|
|
188
|
+
onSEOMetadataChange?: (metadata: SEOMetadata) => void;
|
|
189
|
+
showSEO?: boolean;
|
|
11
190
|
}
|
|
12
|
-
declare function CMSBlockEditor({ value, onChange, onImageAdded, onVideoAdded, useBase64Url }: CMSBlockEditorProps): react_jsx_runtime.JSX.Element;
|
|
191
|
+
declare function CMSBlockEditor({ value, onChange, onImageAdded, onVideoAdded, useBase64Url, seoMetadata, onSEOMetadataChange, showSEO }: CMSBlockEditorProps): react_jsx_runtime.JSX.Element;
|
|
13
192
|
|
|
14
193
|
interface CMSRendererProps {
|
|
15
194
|
content: string;
|
|
@@ -447,4 +626,56 @@ declare function themeToCSSVariables(theme: Theme, prefix?: string): Record<stri
|
|
|
447
626
|
*/
|
|
448
627
|
declare function generateThemeFromBrand(brandColor: string, themeName: string, mode?: 'light' | 'dark'): Partial<Theme>;
|
|
449
628
|
|
|
450
|
-
|
|
629
|
+
interface SEOPluginProps {
|
|
630
|
+
metadata?: SEOMetadata;
|
|
631
|
+
onMetadataChange?: (metadata: SEOMetadata) => void;
|
|
632
|
+
showAnalysis?: boolean;
|
|
633
|
+
}
|
|
634
|
+
declare function SEOPlugin({ metadata: initialMetadata, onMetadataChange, showAnalysis }: SEOPluginProps): react_jsx_runtime.JSX.Element;
|
|
635
|
+
|
|
636
|
+
/**
|
|
637
|
+
* Analyze content for SEO optimization
|
|
638
|
+
*/
|
|
639
|
+
declare function analyzeSEO(content: string, metadata: SEOMetadata): SEOAnalysis;
|
|
640
|
+
/**
|
|
641
|
+
* Generate SEO-friendly slug from text
|
|
642
|
+
*/
|
|
643
|
+
declare function generateSlug(text: string): string;
|
|
644
|
+
/**
|
|
645
|
+
* Extract keywords from content
|
|
646
|
+
*/
|
|
647
|
+
declare function extractKeywords(content: string, limit?: number): string[];
|
|
648
|
+
|
|
649
|
+
/**
|
|
650
|
+
* Generate HTML meta tags from SEO metadata
|
|
651
|
+
*/
|
|
652
|
+
declare function generateMetaTags(metadata: SEOMetadata): string;
|
|
653
|
+
/**
|
|
654
|
+
* Generate structured data JSON-LD script tags
|
|
655
|
+
*/
|
|
656
|
+
declare function generateStructuredData(schemas: SchemaType[]): string;
|
|
657
|
+
/**
|
|
658
|
+
* Create default SEO metadata
|
|
659
|
+
*/
|
|
660
|
+
declare function createDefaultMetadata(title: string, description: string): SEOMetadata;
|
|
661
|
+
/**
|
|
662
|
+
* Merge SEO metadata with defaults
|
|
663
|
+
*/
|
|
664
|
+
declare function mergeMetadata(base: SEOMetadata, override: Partial<SEOMetadata>): SEOMetadata;
|
|
665
|
+
/**
|
|
666
|
+
* Validate SEO metadata
|
|
667
|
+
*/
|
|
668
|
+
declare function validateMetadata(metadata: SEOMetadata): {
|
|
669
|
+
valid: boolean;
|
|
670
|
+
errors: string[];
|
|
671
|
+
};
|
|
672
|
+
/**
|
|
673
|
+
* Copy metadata to clipboard
|
|
674
|
+
*/
|
|
675
|
+
declare function copyMetadataToClipboard(metadata: SEOMetadata): Promise<void>;
|
|
676
|
+
/**
|
|
677
|
+
* Download metadata as HTML file
|
|
678
|
+
*/
|
|
679
|
+
declare function downloadMetadata(metadata: SEOMetadata, filename?: string): void;
|
|
680
|
+
|
|
681
|
+
export { type ArticleSchema, type BreadcrumbSchema, CMSBlockEditor, CMSRenderer, type FAQSchema, type HowToSchema, ImageNode, OPEN_IMAGE_EDITOR_COMMAND, type OrganizationSchema, type PersonSchema, type PresetThemeName, type ProductSchema, type SEOAnalysis, type SEOIssue, type SEOMetadata, type SEOMetrics, SEOPlugin, type SEOSuggestion, type SchemaType, type Theme, type ThemeAnimations, type ThemeBorderRadius, type ThemeBreakpoints, type ThemeColors, type ThemeConfig, ThemeCustomizer, type ThemeGradients, type ThemeMode, type ThemeOverride, ThemeProvider, type ThemeShadows, type ThemeSpacing, ThemeSwitcher, type ThemeTransitions, type ThemeTypography, type ThemeZIndex, VideoNode, analyzeSEO, appendHTML, copyMarkdownToClipboard, copyMetadataToClipboard, createDefaultMetadata, createGradient, createTheme, darkTheme, downloadHTML, downloadMarkdown, downloadMetadata, draculaTheme, exportTheme, exportToHTML, exportToHTMLWithWrapper, exportToMarkdown, extractKeywords, forestTheme, generateColorVariations, generateMetaTags, generatePalette, generateSlug, generateStructuredData, generateThemeFromBrand, importFromHTML, importFromMarkdown, importTheme, lightTheme, loadHTMLFromFile, loadMarkdownFromFile, mergeMetadata, midnightTheme, minimalTheme, monokaiTheme, oceanTheme, pasteMarkdownFromClipboard, presetThemes, roseTheme, sunsetTheme, themeToCSSVariables, useTheme, validateMetadata, validateTheme };
|