cms-block-editor 1.0.14 → 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/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;
@@ -134,75 +313,213 @@ interface ThemeColors {
134
313
  primaryHover: string;
135
314
  primaryLight: string;
136
315
  primaryDark: string;
316
+ primaryContrast: string;
137
317
  secondary: string;
138
318
  secondaryHover: string;
319
+ secondaryLight: string;
320
+ secondaryDark: string;
321
+ secondaryContrast: string;
322
+ accent: string;
323
+ accentHover: string;
324
+ accentLight: string;
325
+ accentDark: string;
139
326
  background: string;
327
+ backgroundAlt: string;
140
328
  surface: string;
329
+ surfaceHover: string;
330
+ surfaceActive: string;
141
331
  border: string;
332
+ borderHover: string;
142
333
  divider: string;
334
+ overlay: string;
143
335
  textPrimary: string;
144
336
  textSecondary: string;
337
+ textTertiary: string;
145
338
  textDisabled: string;
339
+ textInverse: string;
146
340
  success: string;
341
+ successLight: string;
342
+ successDark: string;
147
343
  warning: string;
344
+ warningLight: string;
345
+ warningDark: string;
148
346
  error: string;
347
+ errorLight: string;
348
+ errorDark: string;
149
349
  info: string;
350
+ infoLight: string;
351
+ infoDark: string;
150
352
  editorBackground: string;
151
353
  editorText: string;
152
354
  editorPlaceholder: string;
355
+ editorCursor: string;
153
356
  toolbarBackground: string;
154
357
  toolbarText: string;
155
358
  toolbarBorder: string;
359
+ toolbarIconHover: string;
156
360
  selection: string;
361
+ selectionText: string;
157
362
  highlight: string;
363
+ highlightText: string;
158
364
  focus: string;
365
+ focusRing: string;
366
+ codeBackground: string;
367
+ codeText: string;
368
+ codeComment: string;
369
+ codeKeyword: string;
370
+ codeString: string;
371
+ codeNumber: string;
372
+ codeFunction: string;
373
+ codeOperator: string;
159
374
  }
160
375
  interface ThemeTypography {
161
376
  fontFamily: string;
377
+ fontFamilyHeading: string;
162
378
  fontFamilyMono: string;
379
+ fontSizeXxs: string;
163
380
  fontSizeXs: string;
164
381
  fontSizeSm: string;
165
382
  fontSizeMd: string;
166
383
  fontSizeLg: string;
167
384
  fontSizeXl: string;
385
+ fontSizeXxl: string;
386
+ fontSize3xl: string;
387
+ fontSize4xl: string;
388
+ fontWeightLight: number;
168
389
  fontWeightNormal: number;
169
390
  fontWeightMedium: number;
391
+ fontWeightSemibold: number;
170
392
  fontWeightBold: number;
393
+ fontWeightExtrabold: number;
171
394
  lineHeightTight: number;
395
+ lineHeightSnug: number;
172
396
  lineHeightNormal: number;
173
397
  lineHeightRelaxed: number;
398
+ lineHeightLoose: number;
399
+ letterSpacingTight: string;
400
+ letterSpacingNormal: string;
401
+ letterSpacingWide: string;
402
+ letterSpacingWider: string;
174
403
  }
175
404
  interface ThemeSpacing {
405
+ xxs: string;
176
406
  xs: string;
177
407
  sm: string;
178
408
  md: string;
179
409
  lg: string;
180
410
  xl: string;
181
411
  xxl: string;
412
+ xxxl: string;
182
413
  }
183
414
  interface ThemeBorderRadius {
184
415
  none: string;
416
+ xs: string;
185
417
  sm: string;
186
418
  md: string;
187
419
  lg: string;
420
+ xl: string;
421
+ xxl: string;
188
422
  full: string;
189
423
  }
190
424
  interface ThemeShadows {
191
425
  none: string;
426
+ xs: string;
427
+ sm: string;
428
+ md: string;
429
+ lg: string;
430
+ xl: string;
431
+ xxl: string;
432
+ inner: string;
433
+ outline: string;
434
+ }
435
+ interface ThemeTransitions {
436
+ fast: string;
437
+ normal: string;
438
+ slow: string;
439
+ verySlow: string;
440
+ }
441
+ interface ThemeBreakpoints {
442
+ xs: string;
192
443
  sm: string;
193
444
  md: string;
194
445
  lg: string;
195
446
  xl: string;
447
+ xxl: string;
448
+ }
449
+ interface ThemeZIndex {
450
+ dropdown: number;
451
+ sticky: number;
452
+ fixed: number;
453
+ modalBackdrop: number;
454
+ modal: number;
455
+ popover: number;
456
+ tooltip: number;
457
+ }
458
+ interface ThemeAnimations {
459
+ fadeIn: string;
460
+ fadeOut: string;
461
+ slideUp: string;
462
+ slideDown: string;
463
+ slideLeft: string;
464
+ slideRight: string;
465
+ scaleUp: string;
466
+ scaleDown: string;
467
+ spin: string;
468
+ pulse: string;
469
+ bounce: string;
470
+ }
471
+ interface ThemeGradients {
472
+ primary: string;
473
+ secondary: string;
474
+ accent: string;
475
+ sunset: string;
476
+ ocean: string;
477
+ forest: string;
478
+ fire: string;
479
+ ice: string;
480
+ purple: string;
481
+ rainbow: string;
482
+ }
483
+ interface ThemeCustom {
484
+ [key: string]: any;
196
485
  }
197
486
  interface Theme {
198
487
  name: string;
488
+ mode: 'light' | 'dark';
199
489
  colors: ThemeColors;
200
490
  typography: ThemeTypography;
201
491
  spacing: ThemeSpacing;
202
492
  borderRadius: ThemeBorderRadius;
203
493
  shadows: ThemeShadows;
494
+ transitions: ThemeTransitions;
495
+ breakpoints: ThemeBreakpoints;
496
+ zIndex: ThemeZIndex;
497
+ animations: ThemeAnimations;
498
+ gradients: ThemeGradients;
499
+ custom?: ThemeCustom;
204
500
  }
205
501
  type ThemeMode = 'light' | 'dark' | 'auto';
502
+ interface ThemeOverride {
503
+ colors?: Partial<ThemeColors>;
504
+ typography?: Partial<ThemeTypography>;
505
+ spacing?: Partial<ThemeSpacing>;
506
+ borderRadius?: Partial<ThemeBorderRadius>;
507
+ shadows?: Partial<ThemeShadows>;
508
+ transitions?: Partial<ThemeTransitions>;
509
+ breakpoints?: Partial<ThemeBreakpoints>;
510
+ zIndex?: Partial<ThemeZIndex>;
511
+ animations?: Partial<ThemeAnimations>;
512
+ gradients?: Partial<ThemeGradients>;
513
+ custom?: ThemeCustom;
514
+ }
515
+ interface ThemeConfig {
516
+ theme: Theme;
517
+ override?: ThemeOverride;
518
+ cssVariablePrefix?: string;
519
+ enableAnimations?: boolean;
520
+ enableTransitions?: boolean;
521
+ enableGradients?: boolean;
522
+ }
206
523
 
207
524
  declare const oceanTheme: Theme;
208
525
  declare const forestTheme: Theme;
@@ -249,8 +566,116 @@ interface ThemeSwitcherProps {
249
566
  }
250
567
  declare function ThemeSwitcher({ className, showModeToggle, showPresets }: ThemeSwitcherProps): react_jsx_runtime.JSX.Element;
251
568
 
569
+ interface ThemeCustomizerProps {
570
+ onClose?: () => void;
571
+ }
572
+ declare function ThemeCustomizer({ onClose }: ThemeCustomizerProps): react_jsx_runtime.JSX.Element;
573
+
252
574
  declare const lightTheme: Theme;
253
575
 
254
576
  declare const darkTheme: Theme;
255
577
 
256
- export { CMSBlockEditor, CMSRenderer, ImageNode, OPEN_IMAGE_EDITOR_COMMAND, type PresetThemeName, type Theme, type ThemeColors, type ThemeMode, ThemeProvider, ThemeSwitcher, VideoNode, appendHTML, copyMarkdownToClipboard, darkTheme, downloadHTML, downloadMarkdown, draculaTheme, exportToHTML, exportToHTMLWithWrapper, exportToMarkdown, forestTheme, importFromHTML, importFromMarkdown, lightTheme, loadHTMLFromFile, loadMarkdownFromFile, midnightTheme, minimalTheme, monokaiTheme, oceanTheme, pasteMarkdownFromClipboard, presetThemes, roseTheme, sunsetTheme, useTheme };
578
+ /**
579
+ * Create a custom theme by extending a base theme
580
+ */
581
+ declare function createTheme(baseTheme: Theme, override: ThemeOverride): Theme;
582
+ /**
583
+ * Generate color variations from a base color
584
+ */
585
+ declare function generateColorVariations(baseColor: string): {
586
+ base: string;
587
+ light: string;
588
+ lighter: string;
589
+ dark: string;
590
+ darker: string;
591
+ contrast: string;
592
+ };
593
+ /**
594
+ * Create a gradient from two colors
595
+ */
596
+ declare function createGradient(color1: string, color2: string, angle?: number): string;
597
+ /**
598
+ * Generate a complete color palette from a primary color
599
+ */
600
+ declare function generatePalette(primaryColor: string): {
601
+ primary: ReturnType<typeof generateColorVariations>;
602
+ secondary: ReturnType<typeof generateColorVariations>;
603
+ accent: ReturnType<typeof generateColorVariations>;
604
+ };
605
+ /**
606
+ * Validate theme structure
607
+ */
608
+ declare function validateTheme(theme: Theme): {
609
+ valid: boolean;
610
+ errors: string[];
611
+ };
612
+ /**
613
+ * Export theme as JSON
614
+ */
615
+ declare function exportTheme(theme: Theme): string;
616
+ /**
617
+ * Import theme from JSON
618
+ */
619
+ declare function importTheme(json: string): Theme;
620
+ /**
621
+ * Convert theme to CSS variables
622
+ */
623
+ declare function themeToCSSVariables(theme: Theme, prefix?: string): Record<string, string>;
624
+ /**
625
+ * Generate theme from brand colors
626
+ */
627
+ declare function generateThemeFromBrand(brandColor: string, themeName: string, mode?: 'light' | 'dark'): Partial<Theme>;
628
+
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 };