cms-block-editor 1.0.13 → 1.0.16
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 +52 -7
- package/dist/index.css +1099 -0
- package/dist/index.css.map +1 -1
- package/dist/index.d.mts +320 -2
- package/dist/index.mjs +1569 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import { LexicalEditor, LexicalCommand, DecoratorNode, NodeKey, Spread, SerializedLexicalNode } from 'lexical';
|
|
3
|
-
import { JSX } from 'react';
|
|
3
|
+
import { JSX, ReactNode } from 'react';
|
|
4
4
|
|
|
5
5
|
interface CMSBlockEditorProps {
|
|
6
6
|
value?: string;
|
|
@@ -129,4 +129,322 @@ declare class ImageNode extends DecoratorNode<JSX.Element> {
|
|
|
129
129
|
static importJSON(serializedNode: SerializedImageNode): ImageNode;
|
|
130
130
|
}
|
|
131
131
|
|
|
132
|
-
|
|
132
|
+
interface ThemeColors {
|
|
133
|
+
primary: string;
|
|
134
|
+
primaryHover: string;
|
|
135
|
+
primaryLight: string;
|
|
136
|
+
primaryDark: string;
|
|
137
|
+
primaryContrast: string;
|
|
138
|
+
secondary: string;
|
|
139
|
+
secondaryHover: string;
|
|
140
|
+
secondaryLight: string;
|
|
141
|
+
secondaryDark: string;
|
|
142
|
+
secondaryContrast: string;
|
|
143
|
+
accent: string;
|
|
144
|
+
accentHover: string;
|
|
145
|
+
accentLight: string;
|
|
146
|
+
accentDark: string;
|
|
147
|
+
background: string;
|
|
148
|
+
backgroundAlt: string;
|
|
149
|
+
surface: string;
|
|
150
|
+
surfaceHover: string;
|
|
151
|
+
surfaceActive: string;
|
|
152
|
+
border: string;
|
|
153
|
+
borderHover: string;
|
|
154
|
+
divider: string;
|
|
155
|
+
overlay: string;
|
|
156
|
+
textPrimary: string;
|
|
157
|
+
textSecondary: string;
|
|
158
|
+
textTertiary: string;
|
|
159
|
+
textDisabled: string;
|
|
160
|
+
textInverse: string;
|
|
161
|
+
success: string;
|
|
162
|
+
successLight: string;
|
|
163
|
+
successDark: string;
|
|
164
|
+
warning: string;
|
|
165
|
+
warningLight: string;
|
|
166
|
+
warningDark: string;
|
|
167
|
+
error: string;
|
|
168
|
+
errorLight: string;
|
|
169
|
+
errorDark: string;
|
|
170
|
+
info: string;
|
|
171
|
+
infoLight: string;
|
|
172
|
+
infoDark: string;
|
|
173
|
+
editorBackground: string;
|
|
174
|
+
editorText: string;
|
|
175
|
+
editorPlaceholder: string;
|
|
176
|
+
editorCursor: string;
|
|
177
|
+
toolbarBackground: string;
|
|
178
|
+
toolbarText: string;
|
|
179
|
+
toolbarBorder: string;
|
|
180
|
+
toolbarIconHover: string;
|
|
181
|
+
selection: string;
|
|
182
|
+
selectionText: string;
|
|
183
|
+
highlight: string;
|
|
184
|
+
highlightText: string;
|
|
185
|
+
focus: string;
|
|
186
|
+
focusRing: string;
|
|
187
|
+
codeBackground: string;
|
|
188
|
+
codeText: string;
|
|
189
|
+
codeComment: string;
|
|
190
|
+
codeKeyword: string;
|
|
191
|
+
codeString: string;
|
|
192
|
+
codeNumber: string;
|
|
193
|
+
codeFunction: string;
|
|
194
|
+
codeOperator: string;
|
|
195
|
+
}
|
|
196
|
+
interface ThemeTypography {
|
|
197
|
+
fontFamily: string;
|
|
198
|
+
fontFamilyHeading: string;
|
|
199
|
+
fontFamilyMono: string;
|
|
200
|
+
fontSizeXxs: string;
|
|
201
|
+
fontSizeXs: string;
|
|
202
|
+
fontSizeSm: string;
|
|
203
|
+
fontSizeMd: string;
|
|
204
|
+
fontSizeLg: string;
|
|
205
|
+
fontSizeXl: string;
|
|
206
|
+
fontSizeXxl: string;
|
|
207
|
+
fontSize3xl: string;
|
|
208
|
+
fontSize4xl: string;
|
|
209
|
+
fontWeightLight: number;
|
|
210
|
+
fontWeightNormal: number;
|
|
211
|
+
fontWeightMedium: number;
|
|
212
|
+
fontWeightSemibold: number;
|
|
213
|
+
fontWeightBold: number;
|
|
214
|
+
fontWeightExtrabold: number;
|
|
215
|
+
lineHeightTight: number;
|
|
216
|
+
lineHeightSnug: number;
|
|
217
|
+
lineHeightNormal: number;
|
|
218
|
+
lineHeightRelaxed: number;
|
|
219
|
+
lineHeightLoose: number;
|
|
220
|
+
letterSpacingTight: string;
|
|
221
|
+
letterSpacingNormal: string;
|
|
222
|
+
letterSpacingWide: string;
|
|
223
|
+
letterSpacingWider: string;
|
|
224
|
+
}
|
|
225
|
+
interface ThemeSpacing {
|
|
226
|
+
xxs: string;
|
|
227
|
+
xs: string;
|
|
228
|
+
sm: string;
|
|
229
|
+
md: string;
|
|
230
|
+
lg: string;
|
|
231
|
+
xl: string;
|
|
232
|
+
xxl: string;
|
|
233
|
+
xxxl: string;
|
|
234
|
+
}
|
|
235
|
+
interface ThemeBorderRadius {
|
|
236
|
+
none: string;
|
|
237
|
+
xs: string;
|
|
238
|
+
sm: string;
|
|
239
|
+
md: string;
|
|
240
|
+
lg: string;
|
|
241
|
+
xl: string;
|
|
242
|
+
xxl: string;
|
|
243
|
+
full: string;
|
|
244
|
+
}
|
|
245
|
+
interface ThemeShadows {
|
|
246
|
+
none: string;
|
|
247
|
+
xs: string;
|
|
248
|
+
sm: string;
|
|
249
|
+
md: string;
|
|
250
|
+
lg: string;
|
|
251
|
+
xl: string;
|
|
252
|
+
xxl: string;
|
|
253
|
+
inner: string;
|
|
254
|
+
outline: string;
|
|
255
|
+
}
|
|
256
|
+
interface ThemeTransitions {
|
|
257
|
+
fast: string;
|
|
258
|
+
normal: string;
|
|
259
|
+
slow: string;
|
|
260
|
+
verySlow: string;
|
|
261
|
+
}
|
|
262
|
+
interface ThemeBreakpoints {
|
|
263
|
+
xs: string;
|
|
264
|
+
sm: string;
|
|
265
|
+
md: string;
|
|
266
|
+
lg: string;
|
|
267
|
+
xl: string;
|
|
268
|
+
xxl: string;
|
|
269
|
+
}
|
|
270
|
+
interface ThemeZIndex {
|
|
271
|
+
dropdown: number;
|
|
272
|
+
sticky: number;
|
|
273
|
+
fixed: number;
|
|
274
|
+
modalBackdrop: number;
|
|
275
|
+
modal: number;
|
|
276
|
+
popover: number;
|
|
277
|
+
tooltip: number;
|
|
278
|
+
}
|
|
279
|
+
interface ThemeAnimations {
|
|
280
|
+
fadeIn: string;
|
|
281
|
+
fadeOut: string;
|
|
282
|
+
slideUp: string;
|
|
283
|
+
slideDown: string;
|
|
284
|
+
slideLeft: string;
|
|
285
|
+
slideRight: string;
|
|
286
|
+
scaleUp: string;
|
|
287
|
+
scaleDown: string;
|
|
288
|
+
spin: string;
|
|
289
|
+
pulse: string;
|
|
290
|
+
bounce: string;
|
|
291
|
+
}
|
|
292
|
+
interface ThemeGradients {
|
|
293
|
+
primary: string;
|
|
294
|
+
secondary: string;
|
|
295
|
+
accent: string;
|
|
296
|
+
sunset: string;
|
|
297
|
+
ocean: string;
|
|
298
|
+
forest: string;
|
|
299
|
+
fire: string;
|
|
300
|
+
ice: string;
|
|
301
|
+
purple: string;
|
|
302
|
+
rainbow: string;
|
|
303
|
+
}
|
|
304
|
+
interface ThemeCustom {
|
|
305
|
+
[key: string]: any;
|
|
306
|
+
}
|
|
307
|
+
interface Theme {
|
|
308
|
+
name: string;
|
|
309
|
+
mode: 'light' | 'dark';
|
|
310
|
+
colors: ThemeColors;
|
|
311
|
+
typography: ThemeTypography;
|
|
312
|
+
spacing: ThemeSpacing;
|
|
313
|
+
borderRadius: ThemeBorderRadius;
|
|
314
|
+
shadows: ThemeShadows;
|
|
315
|
+
transitions: ThemeTransitions;
|
|
316
|
+
breakpoints: ThemeBreakpoints;
|
|
317
|
+
zIndex: ThemeZIndex;
|
|
318
|
+
animations: ThemeAnimations;
|
|
319
|
+
gradients: ThemeGradients;
|
|
320
|
+
custom?: ThemeCustom;
|
|
321
|
+
}
|
|
322
|
+
type ThemeMode = 'light' | 'dark' | 'auto';
|
|
323
|
+
interface ThemeOverride {
|
|
324
|
+
colors?: Partial<ThemeColors>;
|
|
325
|
+
typography?: Partial<ThemeTypography>;
|
|
326
|
+
spacing?: Partial<ThemeSpacing>;
|
|
327
|
+
borderRadius?: Partial<ThemeBorderRadius>;
|
|
328
|
+
shadows?: Partial<ThemeShadows>;
|
|
329
|
+
transitions?: Partial<ThemeTransitions>;
|
|
330
|
+
breakpoints?: Partial<ThemeBreakpoints>;
|
|
331
|
+
zIndex?: Partial<ThemeZIndex>;
|
|
332
|
+
animations?: Partial<ThemeAnimations>;
|
|
333
|
+
gradients?: Partial<ThemeGradients>;
|
|
334
|
+
custom?: ThemeCustom;
|
|
335
|
+
}
|
|
336
|
+
interface ThemeConfig {
|
|
337
|
+
theme: Theme;
|
|
338
|
+
override?: ThemeOverride;
|
|
339
|
+
cssVariablePrefix?: string;
|
|
340
|
+
enableAnimations?: boolean;
|
|
341
|
+
enableTransitions?: boolean;
|
|
342
|
+
enableGradients?: boolean;
|
|
343
|
+
}
|
|
344
|
+
|
|
345
|
+
declare const oceanTheme: Theme;
|
|
346
|
+
declare const forestTheme: Theme;
|
|
347
|
+
declare const sunsetTheme: Theme;
|
|
348
|
+
declare const roseTheme: Theme;
|
|
349
|
+
declare const midnightTheme: Theme;
|
|
350
|
+
declare const draculaTheme: Theme;
|
|
351
|
+
declare const monokaiTheme: Theme;
|
|
352
|
+
declare const minimalTheme: Theme;
|
|
353
|
+
declare const presetThemes: {
|
|
354
|
+
light: Theme;
|
|
355
|
+
dark: Theme;
|
|
356
|
+
ocean: Theme;
|
|
357
|
+
forest: Theme;
|
|
358
|
+
sunset: Theme;
|
|
359
|
+
rose: Theme;
|
|
360
|
+
midnight: Theme;
|
|
361
|
+
dracula: Theme;
|
|
362
|
+
monokai: Theme;
|
|
363
|
+
minimal: Theme;
|
|
364
|
+
};
|
|
365
|
+
type PresetThemeName = keyof typeof presetThemes;
|
|
366
|
+
|
|
367
|
+
interface ThemeContextValue {
|
|
368
|
+
theme: Theme;
|
|
369
|
+
mode: ThemeMode;
|
|
370
|
+
setTheme: (theme: Theme | PresetThemeName) => void;
|
|
371
|
+
setMode: (mode: ThemeMode) => void;
|
|
372
|
+
toggleMode: () => void;
|
|
373
|
+
}
|
|
374
|
+
interface ThemeProviderProps {
|
|
375
|
+
children: ReactNode;
|
|
376
|
+
defaultTheme?: Theme | PresetThemeName;
|
|
377
|
+
defaultMode?: ThemeMode;
|
|
378
|
+
storageKey?: string;
|
|
379
|
+
}
|
|
380
|
+
declare function ThemeProvider({ children, defaultTheme, defaultMode, storageKey, }: ThemeProviderProps): react_jsx_runtime.JSX.Element;
|
|
381
|
+
declare function useTheme(): ThemeContextValue;
|
|
382
|
+
|
|
383
|
+
interface ThemeSwitcherProps {
|
|
384
|
+
className?: string;
|
|
385
|
+
showModeToggle?: boolean;
|
|
386
|
+
showPresets?: boolean;
|
|
387
|
+
}
|
|
388
|
+
declare function ThemeSwitcher({ className, showModeToggle, showPresets }: ThemeSwitcherProps): react_jsx_runtime.JSX.Element;
|
|
389
|
+
|
|
390
|
+
interface ThemeCustomizerProps {
|
|
391
|
+
onClose?: () => void;
|
|
392
|
+
}
|
|
393
|
+
declare function ThemeCustomizer({ onClose }: ThemeCustomizerProps): react_jsx_runtime.JSX.Element;
|
|
394
|
+
|
|
395
|
+
declare const lightTheme: Theme;
|
|
396
|
+
|
|
397
|
+
declare const darkTheme: Theme;
|
|
398
|
+
|
|
399
|
+
/**
|
|
400
|
+
* Create a custom theme by extending a base theme
|
|
401
|
+
*/
|
|
402
|
+
declare function createTheme(baseTheme: Theme, override: ThemeOverride): Theme;
|
|
403
|
+
/**
|
|
404
|
+
* Generate color variations from a base color
|
|
405
|
+
*/
|
|
406
|
+
declare function generateColorVariations(baseColor: string): {
|
|
407
|
+
base: string;
|
|
408
|
+
light: string;
|
|
409
|
+
lighter: string;
|
|
410
|
+
dark: string;
|
|
411
|
+
darker: string;
|
|
412
|
+
contrast: string;
|
|
413
|
+
};
|
|
414
|
+
/**
|
|
415
|
+
* Create a gradient from two colors
|
|
416
|
+
*/
|
|
417
|
+
declare function createGradient(color1: string, color2: string, angle?: number): string;
|
|
418
|
+
/**
|
|
419
|
+
* Generate a complete color palette from a primary color
|
|
420
|
+
*/
|
|
421
|
+
declare function generatePalette(primaryColor: string): {
|
|
422
|
+
primary: ReturnType<typeof generateColorVariations>;
|
|
423
|
+
secondary: ReturnType<typeof generateColorVariations>;
|
|
424
|
+
accent: ReturnType<typeof generateColorVariations>;
|
|
425
|
+
};
|
|
426
|
+
/**
|
|
427
|
+
* Validate theme structure
|
|
428
|
+
*/
|
|
429
|
+
declare function validateTheme(theme: Theme): {
|
|
430
|
+
valid: boolean;
|
|
431
|
+
errors: string[];
|
|
432
|
+
};
|
|
433
|
+
/**
|
|
434
|
+
* Export theme as JSON
|
|
435
|
+
*/
|
|
436
|
+
declare function exportTheme(theme: Theme): string;
|
|
437
|
+
/**
|
|
438
|
+
* Import theme from JSON
|
|
439
|
+
*/
|
|
440
|
+
declare function importTheme(json: string): Theme;
|
|
441
|
+
/**
|
|
442
|
+
* Convert theme to CSS variables
|
|
443
|
+
*/
|
|
444
|
+
declare function themeToCSSVariables(theme: Theme, prefix?: string): Record<string, string>;
|
|
445
|
+
/**
|
|
446
|
+
* Generate theme from brand colors
|
|
447
|
+
*/
|
|
448
|
+
declare function generateThemeFromBrand(brandColor: string, themeName: string, mode?: 'light' | 'dark'): Partial<Theme>;
|
|
449
|
+
|
|
450
|
+
export { CMSBlockEditor, CMSRenderer, ImageNode, OPEN_IMAGE_EDITOR_COMMAND, type PresetThemeName, 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, appendHTML, copyMarkdownToClipboard, createGradient, createTheme, darkTheme, downloadHTML, downloadMarkdown, draculaTheme, exportTheme, exportToHTML, exportToHTMLWithWrapper, exportToMarkdown, forestTheme, generateColorVariations, generatePalette, generateThemeFromBrand, importFromHTML, importFromMarkdown, importTheme, lightTheme, loadHTMLFromFile, loadMarkdownFromFile, midnightTheme, minimalTheme, monokaiTheme, oceanTheme, pasteMarkdownFromClipboard, presetThemes, roseTheme, sunsetTheme, themeToCSSVariables, useTheme, validateTheme };
|