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/README.md
CHANGED
|
@@ -18,6 +18,7 @@ A powerful, feature-rich block editor for CMS applications built with Lexical an
|
|
|
18
18
|
🔗 **Links** - Custom link insertion with labels and options
|
|
19
19
|
📊 **Tables** - Visual table builder with configurable rows/columns and professional styling
|
|
20
20
|
🎨 **Styling** - Background colors, images, gradients, opacity controls
|
|
21
|
+
🌈 **Themes** - 10 preset themes with light/dark mode and custom theme support
|
|
21
22
|
📱 **Responsive** - Mobile-first design with automatic responsive behavior
|
|
22
23
|
💾 **Export/Import** - HTML and Markdown support
|
|
23
24
|
🎯 **Section Editor** - Full control over section layout, spacing, and styling
|
|
@@ -32,19 +33,21 @@ npm install cms-block-editor
|
|
|
32
33
|
## Quick Start
|
|
33
34
|
|
|
34
35
|
```tsx
|
|
35
|
-
import { CMSBlockEditor } from 'cms-block-editor';
|
|
36
|
+
import { CMSBlockEditor, ThemeProvider } from 'cms-block-editor';
|
|
36
37
|
import 'cms-block-editor/dist/index.css';
|
|
37
38
|
|
|
38
39
|
function App() {
|
|
39
40
|
const [content, setContent] = useState('');
|
|
40
41
|
|
|
41
42
|
return (
|
|
42
|
-
<
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
43
|
+
<ThemeProvider defaultTheme="light" defaultMode="auto">
|
|
44
|
+
<CMSBlockEditor
|
|
45
|
+
value={content}
|
|
46
|
+
onChange={(editorState) => {
|
|
47
|
+
setContent(JSON.stringify(editorState));
|
|
48
|
+
}}
|
|
49
|
+
/>
|
|
50
|
+
</ThemeProvider>
|
|
48
51
|
);
|
|
49
52
|
}
|
|
50
53
|
```
|
|
@@ -137,6 +140,46 @@ Read-only renderer for displaying saved content.
|
|
|
137
140
|
|
|
138
141
|
## Advanced Usage
|
|
139
142
|
|
|
143
|
+
### Theme System
|
|
144
|
+
|
|
145
|
+
Use preset themes or create custom ones:
|
|
146
|
+
|
|
147
|
+
```typescript
|
|
148
|
+
import { CMSBlockEditor, ThemeProvider, ThemeSwitcher } from 'cms-block-editor';
|
|
149
|
+
|
|
150
|
+
function App() {
|
|
151
|
+
return (
|
|
152
|
+
<ThemeProvider defaultTheme="ocean" defaultMode="auto">
|
|
153
|
+
<div>
|
|
154
|
+
<ThemeSwitcher />
|
|
155
|
+
<CMSBlockEditor value={content} onChange={setContent} />
|
|
156
|
+
</div>
|
|
157
|
+
</ThemeProvider>
|
|
158
|
+
);
|
|
159
|
+
}
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
**Available Themes**: light, dark, ocean, forest, sunset, rose, midnight, dracula, monokai, minimal
|
|
163
|
+
|
|
164
|
+
**Custom Theme**:
|
|
165
|
+
```typescript
|
|
166
|
+
import { Theme, lightTheme } from 'cms-block-editor';
|
|
167
|
+
|
|
168
|
+
const myTheme: Theme = {
|
|
169
|
+
...lightTheme,
|
|
170
|
+
name: 'my-theme',
|
|
171
|
+
colors: {
|
|
172
|
+
...lightTheme.colors,
|
|
173
|
+
primary: '#ff6b6b',
|
|
174
|
+
primaryHover: '#ee5a52',
|
|
175
|
+
},
|
|
176
|
+
};
|
|
177
|
+
|
|
178
|
+
<ThemeProvider defaultTheme={myTheme}>
|
|
179
|
+
<CMSBlockEditor />
|
|
180
|
+
</ThemeProvider>
|
|
181
|
+
```
|
|
182
|
+
|
|
140
183
|
### Custom Video Upload
|
|
141
184
|
|
|
142
185
|
Upload videos to your server:
|
|
@@ -329,6 +372,8 @@ Check out the [example app](./example-app) for a complete implementation with:
|
|
|
329
372
|
## Documentation
|
|
330
373
|
|
|
331
374
|
Comprehensive guides available:
|
|
375
|
+
- [Features Summary](./docs/FEATURES-SUMMARY.md) - Complete overview of all features
|
|
376
|
+
- [Theme System Guide](./docs/THEME-GUIDE.md) - Complete theming and customization
|
|
332
377
|
- [Video Upload Guide](./docs/VIDEO-GUIDE.md) - Native HTML5 video upload and playback
|
|
333
378
|
- [Image Editing Guide](./docs/IMAGE-EDITING-GUIDE.md) - Advanced image filters and effects
|
|
334
379
|
- [Section Creator Guide](./SECTION-CREATOR-GUIDE.md)
|