@crashbytes/contentful-richtext-editor 1.0.8 → 1.0.11
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 +126 -251
- package/dist/index.css +1 -1
- package/dist/index.esm.css +1 -1
- package/dist/index.esm.js +628 -185
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +633 -183
- package/dist/index.js.map +1 -1
- package/package.json +32 -9
- package/dist/components/ContentfulDocument.d.ts +0 -2
- package/dist/components/ContentfulEditor.d.ts +0 -29
- package/dist/components/ContentfulEditor.stories.d.ts +0 -18
- package/dist/components/ContentfulEmbedded.d.ts +0 -3
- package/dist/components/Toolbar.d.ts +0 -12
- package/dist/components/Toolbar.stories.d.ts +0 -10
- package/dist/index.d.ts +0 -5
- package/dist/testData/samples.d.ts +0 -11
- package/dist/utils/contentfulTransform.d.ts +0 -28
- package/dist/utils/contentfulTransform.stories.d.ts +0 -6
- package/dist/utils/types.d.ts +0 -28
package/README.md
CHANGED
|
@@ -1,304 +1,179 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Release v2.0.0 - Major Feature Update 🎉
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
## 🚀 What's New
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
This major release introduces **automatic configuration** from Contentful field settings, significantly enhancing the developer experience and ensuring your editor UI always matches your Contentful configuration.
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
- ✅ **Modern UI** - Clean, intuitive interface matching Contentful's design
|
|
9
|
-
- ✅ **TypeScript Support** - Complete type safety with Contentful's rich text types
|
|
10
|
-
- ✅ **Extensible** - Built on Tiptap v2 for easy customization
|
|
11
|
-
- ✅ **Lightweight** - Tree-shakeable, only import what you need
|
|
12
|
-
- ✅ **Responsive** - Works on desktop and mobile devices
|
|
7
|
+
### ✨ Major New Features
|
|
13
8
|
|
|
14
|
-
|
|
9
|
+
- **🔄 Automatic Contentful Configuration**: The editor now reads your Contentful field validation settings and automatically enables/disables toolbar features
|
|
10
|
+
- **📝 Inline Entry Support**: Added support for inline embedded entries (as configured in Contentful)
|
|
11
|
+
- **⌨️ Keyboard Shortcuts**: Built-in shortcuts for common actions (`Cmd/Ctrl + Shift + E` for entries, `Cmd/Ctrl + Shift + A` for assets, etc.)
|
|
12
|
+
- **🔍 Enhanced TypeScript Support**: Comprehensive type definitions and better developer experience
|
|
13
|
+
- **📊 Content Analysis Utilities**: New utilities for word counting, plain text extraction, and content validation
|
|
15
14
|
|
|
16
|
-
|
|
17
|
-
- **Headings**: H1 through H6
|
|
18
|
-
- **Lists**: Ordered and unordered lists
|
|
19
|
-
- **Links**: Hyperlinks with URL validation
|
|
20
|
-
- **Tables**: Full table support with headers
|
|
21
|
-
- **Quotes**: Blockquotes
|
|
22
|
-
- **Embedded Content**: Callbacks for Contentful entries and assets
|
|
23
|
-
- **Undo/Redo**: Full history support
|
|
15
|
+
### 🔧 Enhanced Features
|
|
24
16
|
|
|
25
|
-
|
|
17
|
+
- **Smart Toolbar**: Toolbar buttons now appear/disappear based on your Contentful field configuration
|
|
18
|
+
- **Better Error Handling**: Improved error messages and validation
|
|
19
|
+
- **Performance Optimizations**: Faster rendering and better memory usage
|
|
20
|
+
- **Accessibility Improvements**: Enhanced ARIA support and keyboard navigation
|
|
26
21
|
|
|
27
|
-
|
|
28
|
-
npm install @crashbytes/contentful-richtext-editor
|
|
29
|
-
```
|
|
22
|
+
### 🎨 Developer Experience
|
|
30
23
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
import { ContentfulRichTextEditor } from '@crashbytes/contentful-richtext-editor';
|
|
36
|
-
import '@crashbytes/contentful-richtext-editor/dist/index.css';
|
|
37
|
-
import { Document } from '@contentful/rich-text-types';
|
|
38
|
-
|
|
39
|
-
function App() {
|
|
40
|
-
const [content, setContent] = useState();
|
|
41
|
-
|
|
42
|
-
const handleChange = (document) => {
|
|
43
|
-
setContent(document);
|
|
44
|
-
console.log('Contentful document:', document);
|
|
45
|
-
};
|
|
46
|
-
|
|
47
|
-
return (
|
|
48
|
-
<div>
|
|
49
|
-
<h1>My Rich Text Editor</h1>
|
|
50
|
-
<ContentfulRichTextEditor
|
|
51
|
-
placeholder="Start writing your content..."
|
|
52
|
-
onChange={handleChange}
|
|
53
|
-
initialValue={content}
|
|
54
|
-
/>
|
|
55
|
-
</div>
|
|
56
|
-
);
|
|
57
|
-
}
|
|
24
|
+
- **Configuration Parser**: New utility to parse Contentful field settings
|
|
25
|
+
- **Mock Configuration**: Easy testing with `createMockFieldConfig()`
|
|
26
|
+
- **Backward Compatibility**: Existing manual configuration still works
|
|
27
|
+
- **Comprehensive Documentation**: Updated with examples and API reference
|
|
58
28
|
|
|
59
|
-
|
|
60
|
-
```
|
|
29
|
+
## 🛠️ Installation
|
|
61
30
|
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
### With Contentful Entry/Asset Embedding
|
|
65
|
-
|
|
66
|
-
```jsx
|
|
67
|
-
import { ContentfulRichTextEditor } from '@crashbytes/contentful-richtext-editor';
|
|
68
|
-
import '@crashbytes/contentful-richtext-editor/dist/index.css';
|
|
69
|
-
|
|
70
|
-
function ContentfulEditor() {
|
|
71
|
-
const handleEmbedEntry = async () => {
|
|
72
|
-
// Your logic to select a Contentful entry
|
|
73
|
-
const entry = await openEntrySelector();
|
|
74
|
-
return entry;
|
|
75
|
-
};
|
|
76
|
-
|
|
77
|
-
const handleEmbedAsset = async () => {
|
|
78
|
-
// Your logic to select a Contentful asset
|
|
79
|
-
const asset = await openAssetSelector();
|
|
80
|
-
return asset;
|
|
81
|
-
};
|
|
82
|
-
|
|
83
|
-
return (
|
|
84
|
-
<ContentfulRichTextEditor
|
|
85
|
-
placeholder="Write your travel tip..."
|
|
86
|
-
onChange={(doc) => saveToContentful(doc)}
|
|
87
|
-
onEmbedEntry={handleEmbedEntry}
|
|
88
|
-
onEmbedAsset={handleEmbedAsset}
|
|
89
|
-
theme="contentful"
|
|
90
|
-
/>
|
|
91
|
-
);
|
|
92
|
-
}
|
|
31
|
+
```bash
|
|
32
|
+
npm install @crashbytes/contentful-richtext-editor@2.0.0
|
|
93
33
|
```
|
|
94
34
|
|
|
95
|
-
|
|
35
|
+
## 🔄 Migration from v1.x
|
|
96
36
|
|
|
97
|
-
|
|
37
|
+
### Automatic Configuration (Recommended)
|
|
38
|
+
```tsx
|
|
39
|
+
// Before (v1.x)
|
|
98
40
|
<ContentfulRichTextEditor
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
readonly={false}
|
|
103
|
-
onChange={handleChange}
|
|
41
|
+
availableHeadings={[1, 2, 3]}
|
|
42
|
+
availableMarks={['bold', 'italic']}
|
|
43
|
+
disabledFeatures={['table']}
|
|
104
44
|
/>
|
|
105
|
-
```
|
|
106
45
|
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
```jsx
|
|
46
|
+
// After (v2.x) - Automatically configured!
|
|
110
47
|
<ContentfulRichTextEditor
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
availableMarks={['bold', 'italic']} // Only bold and italic, no underline
|
|
114
|
-
onChange={handleChange}
|
|
48
|
+
fieldConfiguration={contentfulFieldConfig}
|
|
49
|
+
onEmbedInlineEntry={handleInlineEntry} // New!
|
|
115
50
|
/>
|
|
116
51
|
```
|
|
117
52
|
|
|
118
|
-
###
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
content: [
|
|
131
|
-
{
|
|
132
|
-
nodeType: 'text',
|
|
133
|
-
value: 'Hello world!',
|
|
134
|
-
marks: [{ type: 'bold' }],
|
|
135
|
-
data: {}
|
|
136
|
-
}
|
|
137
|
-
]
|
|
138
|
-
}
|
|
139
|
-
]
|
|
140
|
-
};
|
|
141
|
-
|
|
142
|
-
<ContentfulRichTextEditor
|
|
143
|
-
initialValue={initialContent}
|
|
144
|
-
onChange={handleChange}
|
|
145
|
-
/>
|
|
53
|
+
### New Props Available
|
|
54
|
+
```tsx
|
|
55
|
+
interface ContentfulRichTextEditorProps {
|
|
56
|
+
// New in v2.0
|
|
57
|
+
fieldConfiguration?: ContentfulFieldConfiguration;
|
|
58
|
+
onEmbedInlineEntry?: () => Promise<any> | void;
|
|
59
|
+
|
|
60
|
+
// Existing props still work (backward compatible)
|
|
61
|
+
availableHeadings?: Array<1 | 2 | 3 | 4 | 5 | 6>;
|
|
62
|
+
availableMarks?: Array<'bold' | 'italic' | 'underline'>;
|
|
63
|
+
disabledFeatures?: Array<string>;
|
|
64
|
+
}
|
|
146
65
|
```
|
|
147
66
|
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
| Prop | Type | Default | Description |
|
|
153
|
-
|------|------|---------|-------------|
|
|
154
|
-
| `initialValue` | `Document` | `undefined` | Initial Contentful rich text document |
|
|
155
|
-
| `onChange` | `(document: Document) => void` | `undefined` | Callback when content changes |
|
|
156
|
-
| `onEmbedEntry` | `() => Promise<any> \| void` | `undefined` | Callback for embedding Contentful entries |
|
|
157
|
-
| `onEmbedAsset` | `() => Promise<any> \| void` | `undefined` | Callback for embedding Contentful assets |
|
|
158
|
-
| `placeholder` | `string` | `'Start writing...'` | Placeholder text |
|
|
159
|
-
| `readonly` | `boolean` | `false` | Whether editor is read-only |
|
|
160
|
-
| `className` | `string` | `''` | Additional CSS classes |
|
|
161
|
-
| `theme` | `'default' \| 'minimal' \| 'contentful'` | `'contentful'` | Visual theme |
|
|
162
|
-
| `disabledFeatures` | `Array<string>` | `[]` | Features to disable |
|
|
163
|
-
| `availableHeadings` | `Array<1\|2\|3\|4\|5\|6>` | `[1,2,3,4,5,6]` | Which heading levels to show |
|
|
164
|
-
| `availableMarks` | `Array<'bold'\|'italic'\|'underline'>` | `['bold','italic','underline']` | Which text formatting options to show |
|
|
165
|
-
|
|
166
|
-
### Disabled Features
|
|
167
|
-
|
|
168
|
-
You can disable specific features by passing them in the `disabledFeatures` array:
|
|
169
|
-
|
|
170
|
-
- `'bold'` - Bold text formatting
|
|
171
|
-
- `'italic'` - Italic text formatting
|
|
172
|
-
- `'underline'` - Underline text formatting
|
|
173
|
-
- `'link'` - Hyperlinks
|
|
174
|
-
- `'lists'` - Ordered and unordered lists
|
|
175
|
-
- `'headings'` - All heading levels
|
|
176
|
-
- `'quote'` - Blockquotes
|
|
177
|
-
- `'table'` - Tables
|
|
178
|
-
- `'embed'` - Embedded content
|
|
179
|
-
|
|
180
|
-
### Utility Functions
|
|
181
|
-
|
|
182
|
-
```jsx
|
|
183
|
-
import {
|
|
184
|
-
contentfulToTiptap,
|
|
185
|
-
tiptapToContentful,
|
|
186
|
-
validateContentfulDocument,
|
|
187
|
-
createEmptyDocument
|
|
188
|
-
} from '@crashbytes/contentful-richtext-editor';
|
|
189
|
-
|
|
190
|
-
// Convert between formats
|
|
191
|
-
const tiptapJson = contentfulToTiptap(contentfulDocument);
|
|
192
|
-
const contentfulDoc = tiptapToContentful(tiptapJson);
|
|
193
|
-
|
|
194
|
-
// Validation
|
|
195
|
-
const isValid = validateContentfulDocument(someDocument);
|
|
67
|
+
### Fetching Configuration from Contentful
|
|
68
|
+
```tsx
|
|
69
|
+
import { fetchContentfulFieldConfig } from '@crashbytes/contentful-richtext-editor';
|
|
196
70
|
|
|
197
|
-
|
|
198
|
-
|
|
71
|
+
const fieldConfig = await fetchContentfulFieldConfig(
|
|
72
|
+
'space-id',
|
|
73
|
+
'content-type-id',
|
|
74
|
+
'field-id',
|
|
75
|
+
'management-token'
|
|
76
|
+
);
|
|
199
77
|
```
|
|
200
78
|
|
|
201
|
-
##
|
|
79
|
+
## 📋 New Utilities
|
|
202
80
|
|
|
203
|
-
|
|
81
|
+
### Content Analysis
|
|
82
|
+
```tsx
|
|
83
|
+
import {
|
|
84
|
+
extractPlainText,
|
|
85
|
+
countWords,
|
|
86
|
+
findEmbeddedContent,
|
|
87
|
+
sanitizeContentfulDocument
|
|
88
|
+
} from '@crashbytes/contentful-richtext-editor';
|
|
204
89
|
|
|
205
|
-
|
|
206
|
-
|
|
90
|
+
const plainText = extractPlainText(document);
|
|
91
|
+
const wordCount = countWords(document);
|
|
92
|
+
const embedded = findEmbeddedContent(document);
|
|
207
93
|
```
|
|
208
94
|
|
|
209
|
-
###
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
border: 2px solid #your-color;
|
|
216
|
-
}
|
|
95
|
+
### Configuration Management
|
|
96
|
+
```tsx
|
|
97
|
+
import {
|
|
98
|
+
parseContentfulFieldConfig,
|
|
99
|
+
createMockFieldConfig
|
|
100
|
+
} from '@crashbytes/contentful-richtext-editor';
|
|
217
101
|
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
}
|
|
102
|
+
// Parse Contentful config
|
|
103
|
+
const parsed = parseContentfulFieldConfig(fieldConfig);
|
|
221
104
|
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
105
|
+
// Create mock for testing
|
|
106
|
+
const mockConfig = createMockFieldConfig({
|
|
107
|
+
enabledMarks: ['bold', 'italic'],
|
|
108
|
+
enabledNodeTypes: ['paragraph', 'heading-1', 'unordered-list']
|
|
109
|
+
});
|
|
225
110
|
```
|
|
226
111
|
|
|
227
|
-
##
|
|
228
|
-
|
|
229
|
-
### Contentful Theme (Default)
|
|
230
|
-
Matches Contentful's native editor appearance.
|
|
112
|
+
## ⌨️ New Keyboard Shortcuts
|
|
231
113
|
|
|
232
|
-
|
|
233
|
-
|
|
114
|
+
- `Cmd/Ctrl + Shift + E` - Embed entry
|
|
115
|
+
- `Cmd/Ctrl + Shift + A` - Embed asset
|
|
116
|
+
- `Cmd/Ctrl + Shift + I` - Embed inline entry
|
|
117
|
+
- `Cmd/Ctrl + K` - Add/edit link
|
|
118
|
+
- Standard formatting shortcuts (Bold, Italic, Underline)
|
|
234
119
|
|
|
235
|
-
|
|
236
|
-
Standard rich text editor appearance with serif fonts.
|
|
120
|
+
## 🐛 Bug Fixes
|
|
237
121
|
|
|
238
|
-
|
|
122
|
+
- Fixed TypeScript compilation warnings
|
|
123
|
+
- Improved link handling in complex nested structures
|
|
124
|
+
- Fixed table rendering issues
|
|
125
|
+
- Better handling of embedded content transformation
|
|
126
|
+
- Resolved build process issues
|
|
239
127
|
|
|
240
|
-
|
|
241
|
-
// pages/editor.tsx or app/editor/page.tsx
|
|
242
|
-
import dynamic from 'next/dynamic';
|
|
128
|
+
## 🔧 Technical Improvements
|
|
243
129
|
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
export default function EditorPage() {
|
|
250
|
-
return (
|
|
251
|
-
<div>
|
|
252
|
-
<ContentfulEditor
|
|
253
|
-
placeholder="Write something amazing..."
|
|
254
|
-
onChange={(doc) => console.log(doc)}
|
|
255
|
-
/>
|
|
256
|
-
</div>
|
|
257
|
-
);
|
|
258
|
-
}
|
|
259
|
-
```
|
|
130
|
+
- **Build System**: Improved Rollup configuration
|
|
131
|
+
- **Type Safety**: Better TypeScript definitions throughout
|
|
132
|
+
- **Performance**: Optimized re-renders and memory usage
|
|
133
|
+
- **Code Quality**: Enhanced error boundaries and validation
|
|
260
134
|
|
|
261
|
-
##
|
|
135
|
+
## 📚 Documentation
|
|
262
136
|
|
|
263
|
-
|
|
137
|
+
- **Complete API Reference**: Full documentation of all props and methods
|
|
138
|
+
- **Usage Examples**: 5 different implementation examples
|
|
139
|
+
- **Migration Guide**: Step-by-step upgrade instructions
|
|
140
|
+
- **TypeScript Support**: Full type definitions and examples
|
|
264
141
|
|
|
265
|
-
|
|
266
|
-
import type {
|
|
267
|
-
Document,
|
|
268
|
-
Block,
|
|
269
|
-
Inline,
|
|
270
|
-
Text,
|
|
271
|
-
ContentfulRichTextEditorProps
|
|
272
|
-
} from '@crashbytes/contentful-richtext-editor';
|
|
273
|
-
```
|
|
142
|
+
## 🎯 What's Next
|
|
274
143
|
|
|
275
|
-
|
|
144
|
+
We're already working on v2.1 with:
|
|
145
|
+
- Real-time collaboration support
|
|
146
|
+
- Advanced table editing features
|
|
147
|
+
- Plugin system for custom extensions
|
|
148
|
+
- More keyboard shortcuts and accessibility improvements
|
|
276
149
|
|
|
277
|
-
|
|
278
|
-
- Firefox 78+
|
|
279
|
-
- Safari 13+
|
|
280
|
-
- Edge 80+
|
|
150
|
+
## 🤝 Contributing
|
|
281
151
|
|
|
282
|
-
|
|
152
|
+
We welcome contributions! Please see our [Contributing Guide](CONTRIBUTING.md) for details.
|
|
283
153
|
|
|
284
|
-
|
|
154
|
+
## 📖 Full Documentation
|
|
285
155
|
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
5. Open a Pull Request
|
|
156
|
+
- [README](README.md) - Complete setup and usage guide
|
|
157
|
+
- [API Reference](docs/API.md) - Detailed prop and method documentation
|
|
158
|
+
- [Examples](examples/) - Implementation examples
|
|
159
|
+
- [Changelog](CHANGELOG.md) - Complete version history
|
|
291
160
|
|
|
292
|
-
##
|
|
161
|
+
## 🔗 Links
|
|
293
162
|
|
|
294
|
-
|
|
163
|
+
- **GitHub**: https://github.com/your-org/contentful-richtext-editor
|
|
164
|
+
- **npm**: https://www.npmjs.com/package/@crashbytes/contentful-richtext-editor
|
|
165
|
+
- **Issues**: https://github.com/your-org/contentful-richtext-editor/issues
|
|
166
|
+
- **Discussions**: https://github.com/your-org/contentful-richtext-editor/discussions
|
|
295
167
|
|
|
296
|
-
##
|
|
168
|
+
## 💝 Acknowledgments
|
|
297
169
|
|
|
298
|
-
|
|
299
|
-
-
|
|
300
|
-
-
|
|
170
|
+
Special thanks to:
|
|
171
|
+
- The Contentful team for their excellent Rich Text API
|
|
172
|
+
- The TipTap team for the amazing editor framework
|
|
173
|
+
- All early adopters and contributors who provided feedback
|
|
301
174
|
|
|
302
175
|
---
|
|
303
176
|
|
|
304
|
-
**
|
|
177
|
+
**Full Changelog**: https://github.com/your-org/contentful-richtext-editor/compare/v1.0.10...v2.0.0
|
|
178
|
+
|
|
179
|
+
**Happy editing! 🎉**
|
package/dist/index.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.contentful-editor{background:#fff;border:1px solid #d3dce6;border-radius:6px;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif}.contentful-editor--loading{align-items:center;color:#68737d;display:flex;justify-content:center;min-height:200px}.contentful-toolbar{background:#f7f9fa;border-bottom:1px solid #d3dce6;border-radius:6px 6px 0 0;padding:8px 12px}.contentful-toolbar,.contentful-toolbar__group{align-items:center;display:flex;gap:4px}.contentful-toolbar__group--right{margin-left:auto}.contentful-toolbar__separator{background:#d3dce6;height:24px;margin:0 8px;width:1px}.contentful-toolbar__select{background:#fff;border:1px solid #d3dce6;border-radius:4px;font-size:14px;min-width:120px;padding:4px 8px}.contentful-toolbar__select:focus{border-color:#2e75d4;box-shadow:0 0 0 2px rgba(46,117,212,.2);outline:none}.contentful-toolbar__button{align-items:center;background:transparent;border:1px solid transparent;border-radius:4px;cursor:pointer;display:flex;font-size:14px;height:32px;justify-content:center;line-height:1;min-width:32px;padding:6px 8px}.contentful-toolbar__button:hover{background:#e5ebed;border-color:#d3dce6}.contentful-toolbar__button:disabled{cursor:not-allowed;opacity:.5}.contentful-toolbar__button--active{background:#2e75d4;border-color:#2e75d4;color:#fff}.contentful-toolbar__button--active:hover{background:#1e5aa8;border-color:#1e5aa8}.contentful-toolbar__link-input{align-items:center;display:flex;gap:4px;margin-left:8px}.contentful-toolbar__link-input input{border:1px solid #d3dce6;border-radius:4px;font-size:14px;padding:4px 8px;width:200px}.contentful-toolbar__link-input input:focus{border-color:#2e75d4;box-shadow:0 0 0 2px rgba(46,117,212,.2);outline:none}.contentful-toolbar__link-input button{background:#fff;border:1px solid #d3dce6;border-radius:4px;cursor:pointer;font-size:12px;padding:4px 8px}.contentful-toolbar__embed-dropdown{position:relative}.contentful-toolbar__embed-button{background:#2e75d4;border:1px solid #2e75d4;border-radius:4px;color:#fff;cursor:pointer;font-size:14px;font-weight:500;padding:6px 12px}.contentful-toolbar__embed-button:hover{background:#1e5aa8;border-color:#1e5aa8}.contentful-toolbar__embed-dropdown:hover .contentful-toolbar__embed-menu{display:block}.contentful-toolbar__embed-menu{background:#fff;border:1px solid #d3dce6;border-radius:4px;box-shadow:0 2px 8px rgba(0,0,0,.15);display:none;min-width:120px;position:absolute;right:0;top:100%;z-index:100}.contentful-toolbar__embed-option{background:none;border:none;cursor:pointer;display:block;font-size:14px;padding:8px 12px;text-align:left;width:100%}.contentful-toolbar__embed-option:hover{background:#f7f9fa}.contentful-editor__content-wrapper{position:relative}.contentful-editor__content{min-height:200px}.contentful-editor-content{color:#2c3e50;font-size:16px;line-height:1.6;outline:none;padding:16px}.contentful-editor-content:empty:before{color:#68737d;content:attr(data-placeholder);pointer-events:none}.contentful-editor-content h1{font-size:2em;font-weight:600;line-height:1.2;margin:1em 0 .5em}.contentful-editor-content h2{font-size:1.5em;font-weight:600;line-height:1.3;margin:1em 0 .5em}.contentful-editor-content h3{font-size:1.25em;font-weight:600;line-height:1.4;margin:1em 0 .5em}.contentful-editor-content h4,.contentful-editor-content h5,.contentful-editor-content h6{font-size:1em;font-weight:600;line-height:1.5;margin:1em 0 .5em}.contentful-editor-content p{margin:0 0 1em}.contentful-editor-content p:last-child{margin-bottom:0}.contentful-bullet-list,.contentful-ordered-list{margin:1em 0;padding-left:1.5em}.contentful-bullet-list li,.contentful-ordered-list li{margin:.25em 0}.contentful-blockquote{border-left:4px solid #2e75d4;color:#68737d;font-style:italic;margin:1em 0;padding-left:1em}.contentful-link{color:#2e75d4;text-decoration:underline}.contentful-link:hover{color:#1e5aa8}.contentful-table{border:1px solid #d3dce6;border-collapse:collapse;margin:1em 0;width:100%}.contentful-table-cell,.contentful-table-header{border:1px solid #d3dce6;padding:8px 12px;text-align:left}.contentful-table-header{background:#f7f9fa;font-weight:600}.contentful-editor--minimal{border:none;border-radius:0}.contentful-editor--minimal .contentful-toolbar{background:#fff;border-bottom:1px solid #e1e8ed;border-radius:0}.contentful-editor--default .contentful-editor-content{font-family:Georgia,serif}.contentful-editor:focus-within{border-color:#2e75d4;box-shadow:0 0 0 2px rgba(46,117,212,.2)}@media (max-width:768px){.contentful-toolbar{flex-wrap:wrap}.contentful-toolbar__select{min-width:100px}.contentful-editor-content{font-size:14px;padding:12px}}
|
|
1
|
+
.contentful-editor{background:#fff;border:1px solid #d3dce6;border-radius:6px;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif}.contentful-editor--borderless{border:none!important}.contentful-editor--loading{align-items:center;color:#68737d;display:flex;justify-content:center;min-height:200px}.contentful-toolbar{background:#f7f9fa;border-bottom:1px solid #d3dce6;border-radius:6px 6px 0 0;padding:8px 12px}.contentful-toolbar,.contentful-toolbar__group{align-items:center;display:flex;gap:4px}.contentful-toolbar__group--right{margin-left:auto}.contentful-toolbar__separator{background:#d3dce6;height:24px;margin:0 8px;width:1px}.contentful-toolbar__select{background:#fff;border:1px solid #d3dce6;border-radius:4px;font-size:14px;min-width:120px;padding:4px 8px}.contentful-toolbar__select:focus{border-color:#2e75d4;box-shadow:0 0 0 2px rgba(46,117,212,.2);outline:none}.contentful-toolbar__button{align-items:center;background:transparent;border:1px solid transparent;border-radius:4px;cursor:pointer;display:flex;font-size:14px;height:32px;justify-content:center;line-height:1;min-width:32px;padding:6px 8px}.contentful-toolbar__button:hover{background:#e5ebed;border-color:#d3dce6}.contentful-toolbar__button:disabled{cursor:not-allowed;opacity:.5}.contentful-toolbar__button--active{background:#2e75d4;border-color:#2e75d4;color:#fff}.contentful-toolbar__button--active:hover{background:#1e5aa8;border-color:#1e5aa8}.contentful-toolbar__link-input{align-items:center;display:flex;gap:4px;margin-left:8px}.contentful-toolbar__link-input input{border:1px solid #d3dce6;border-radius:4px;font-size:14px;padding:4px 8px;width:200px}.contentful-toolbar__link-input input:focus{border-color:#2e75d4;box-shadow:0 0 0 2px rgba(46,117,212,.2);outline:none}.contentful-toolbar__link-input button{background:#fff;border:1px solid #d3dce6;border-radius:4px;cursor:pointer;font-size:12px;padding:4px 8px}.contentful-toolbar__embed-dropdown{position:relative}.contentful-toolbar__embed-button{background:#2e75d4;border:1px solid #2e75d4;border-radius:4px;color:#fff;cursor:pointer;font-size:14px;font-weight:500;padding:6px 12px}.contentful-toolbar__embed-button:hover{background:#1e5aa8;border-color:#1e5aa8}.contentful-toolbar__embed-dropdown:hover .contentful-toolbar__embed-menu{display:block}.contentful-toolbar__embed-menu{background:#fff;border:1px solid #d3dce6;border-radius:4px;box-shadow:0 2px 8px rgba(0,0,0,.15);display:none;min-width:120px;position:absolute;right:0;top:100%;z-index:100}.contentful-toolbar__embed-option{background:none;border:none;cursor:pointer;display:block;font-size:14px;padding:8px 12px;text-align:left;width:100%}.contentful-toolbar__embed-option:hover{background:#f7f9fa}.contentful-editor__content-wrapper{position:relative}.contentful-editor__content{min-height:200px}.contentful-editor-content{color:#2c3e50;font-size:16px;line-height:1.6;outline:none;padding:16px}.contentful-editor-content:empty:before{color:#68737d;content:attr(data-placeholder);pointer-events:none}.contentful-editor-content h1{font-size:2em;font-weight:600;line-height:1.2;margin:1em 0 .5em}.contentful-editor-content h2{font-size:1.5em;font-weight:600;line-height:1.3;margin:1em 0 .5em}.contentful-editor-content h3{font-size:1.25em;font-weight:600;line-height:1.4;margin:1em 0 .5em}.contentful-editor-content h4,.contentful-editor-content h5,.contentful-editor-content h6{font-size:1em;font-weight:600;line-height:1.5;margin:1em 0 .5em}.contentful-editor-content p{margin:0 0 1em}.contentful-editor-content p:last-child{margin-bottom:0}.contentful-bullet-list,.contentful-ordered-list{margin:1em 0;padding-left:1.5em}.contentful-bullet-list li,.contentful-ordered-list li{margin:.25em 0}.contentful-blockquote{border-left:4px solid #2e75d4;color:#68737d;font-style:italic;margin:1em 0;padding-left:1em}.contentful-link{color:#2e75d4;text-decoration:underline}.contentful-link:hover{color:#1e5aa8}.contentful-table{border:1px solid #d3dce6;border-collapse:collapse;margin:1em 0;width:100%}.contentful-table-cell,.contentful-table-header{border:1px solid #d3dce6;padding:8px 12px;text-align:left}.contentful-table-header{background:#f7f9fa;font-weight:600}.contentful-editor--minimal{border:none;border-radius:0}.contentful-editor--minimal .contentful-toolbar{background:#fff;border-bottom:1px solid #e1e8ed;border-radius:0}.contentful-editor--default .contentful-editor-content{font-family:Georgia,serif}.contentful-editor:focus-within{border-color:#2e75d4;box-shadow:0 0 0 2px rgba(46,117,212,.2)}@media (max-width:768px){.contentful-toolbar{flex-wrap:wrap}.contentful-toolbar__select{min-width:100px}.contentful-editor-content{font-size:14px;padding:12px}}
|
package/dist/index.esm.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.contentful-editor{background:#fff;border:1px solid #d3dce6;border-radius:6px;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif}.contentful-editor--loading{align-items:center;color:#68737d;display:flex;justify-content:center;min-height:200px}.contentful-toolbar{background:#f7f9fa;border-bottom:1px solid #d3dce6;border-radius:6px 6px 0 0;padding:8px 12px}.contentful-toolbar,.contentful-toolbar__group{align-items:center;display:flex;gap:4px}.contentful-toolbar__group--right{margin-left:auto}.contentful-toolbar__separator{background:#d3dce6;height:24px;margin:0 8px;width:1px}.contentful-toolbar__select{background:#fff;border:1px solid #d3dce6;border-radius:4px;font-size:14px;min-width:120px;padding:4px 8px}.contentful-toolbar__select:focus{border-color:#2e75d4;box-shadow:0 0 0 2px rgba(46,117,212,.2);outline:none}.contentful-toolbar__button{align-items:center;background:transparent;border:1px solid transparent;border-radius:4px;cursor:pointer;display:flex;font-size:14px;height:32px;justify-content:center;line-height:1;min-width:32px;padding:6px 8px}.contentful-toolbar__button:hover{background:#e5ebed;border-color:#d3dce6}.contentful-toolbar__button:disabled{cursor:not-allowed;opacity:.5}.contentful-toolbar__button--active{background:#2e75d4;border-color:#2e75d4;color:#fff}.contentful-toolbar__button--active:hover{background:#1e5aa8;border-color:#1e5aa8}.contentful-toolbar__link-input{align-items:center;display:flex;gap:4px;margin-left:8px}.contentful-toolbar__link-input input{border:1px solid #d3dce6;border-radius:4px;font-size:14px;padding:4px 8px;width:200px}.contentful-toolbar__link-input input:focus{border-color:#2e75d4;box-shadow:0 0 0 2px rgba(46,117,212,.2);outline:none}.contentful-toolbar__link-input button{background:#fff;border:1px solid #d3dce6;border-radius:4px;cursor:pointer;font-size:12px;padding:4px 8px}.contentful-toolbar__embed-dropdown{position:relative}.contentful-toolbar__embed-button{background:#2e75d4;border:1px solid #2e75d4;border-radius:4px;color:#fff;cursor:pointer;font-size:14px;font-weight:500;padding:6px 12px}.contentful-toolbar__embed-button:hover{background:#1e5aa8;border-color:#1e5aa8}.contentful-toolbar__embed-dropdown:hover .contentful-toolbar__embed-menu{display:block}.contentful-toolbar__embed-menu{background:#fff;border:1px solid #d3dce6;border-radius:4px;box-shadow:0 2px 8px rgba(0,0,0,.15);display:none;min-width:120px;position:absolute;right:0;top:100%;z-index:100}.contentful-toolbar__embed-option{background:none;border:none;cursor:pointer;display:block;font-size:14px;padding:8px 12px;text-align:left;width:100%}.contentful-toolbar__embed-option:hover{background:#f7f9fa}.contentful-editor__content-wrapper{position:relative}.contentful-editor__content{min-height:200px}.contentful-editor-content{color:#2c3e50;font-size:16px;line-height:1.6;outline:none;padding:16px}.contentful-editor-content:empty:before{color:#68737d;content:attr(data-placeholder);pointer-events:none}.contentful-editor-content h1{font-size:2em;font-weight:600;line-height:1.2;margin:1em 0 .5em}.contentful-editor-content h2{font-size:1.5em;font-weight:600;line-height:1.3;margin:1em 0 .5em}.contentful-editor-content h3{font-size:1.25em;font-weight:600;line-height:1.4;margin:1em 0 .5em}.contentful-editor-content h4,.contentful-editor-content h5,.contentful-editor-content h6{font-size:1em;font-weight:600;line-height:1.5;margin:1em 0 .5em}.contentful-editor-content p{margin:0 0 1em}.contentful-editor-content p:last-child{margin-bottom:0}.contentful-bullet-list,.contentful-ordered-list{margin:1em 0;padding-left:1.5em}.contentful-bullet-list li,.contentful-ordered-list li{margin:.25em 0}.contentful-blockquote{border-left:4px solid #2e75d4;color:#68737d;font-style:italic;margin:1em 0;padding-left:1em}.contentful-link{color:#2e75d4;text-decoration:underline}.contentful-link:hover{color:#1e5aa8}.contentful-table{border:1px solid #d3dce6;border-collapse:collapse;margin:1em 0;width:100%}.contentful-table-cell,.contentful-table-header{border:1px solid #d3dce6;padding:8px 12px;text-align:left}.contentful-table-header{background:#f7f9fa;font-weight:600}.contentful-editor--minimal{border:none;border-radius:0}.contentful-editor--minimal .contentful-toolbar{background:#fff;border-bottom:1px solid #e1e8ed;border-radius:0}.contentful-editor--default .contentful-editor-content{font-family:Georgia,serif}.contentful-editor:focus-within{border-color:#2e75d4;box-shadow:0 0 0 2px rgba(46,117,212,.2)}@media (max-width:768px){.contentful-toolbar{flex-wrap:wrap}.contentful-toolbar__select{min-width:100px}.contentful-editor-content{font-size:14px;padding:12px}}
|
|
1
|
+
.contentful-editor{background:#fff;border:1px solid #d3dce6;border-radius:6px;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif}.contentful-editor--borderless{border:none!important}.contentful-editor--loading{align-items:center;color:#68737d;display:flex;justify-content:center;min-height:200px}.contentful-toolbar{background:#f7f9fa;border-bottom:1px solid #d3dce6;border-radius:6px 6px 0 0;padding:8px 12px}.contentful-toolbar,.contentful-toolbar__group{align-items:center;display:flex;gap:4px}.contentful-toolbar__group--right{margin-left:auto}.contentful-toolbar__separator{background:#d3dce6;height:24px;margin:0 8px;width:1px}.contentful-toolbar__select{background:#fff;border:1px solid #d3dce6;border-radius:4px;font-size:14px;min-width:120px;padding:4px 8px}.contentful-toolbar__select:focus{border-color:#2e75d4;box-shadow:0 0 0 2px rgba(46,117,212,.2);outline:none}.contentful-toolbar__button{align-items:center;background:transparent;border:1px solid transparent;border-radius:4px;cursor:pointer;display:flex;font-size:14px;height:32px;justify-content:center;line-height:1;min-width:32px;padding:6px 8px}.contentful-toolbar__button:hover{background:#e5ebed;border-color:#d3dce6}.contentful-toolbar__button:disabled{cursor:not-allowed;opacity:.5}.contentful-toolbar__button--active{background:#2e75d4;border-color:#2e75d4;color:#fff}.contentful-toolbar__button--active:hover{background:#1e5aa8;border-color:#1e5aa8}.contentful-toolbar__link-input{align-items:center;display:flex;gap:4px;margin-left:8px}.contentful-toolbar__link-input input{border:1px solid #d3dce6;border-radius:4px;font-size:14px;padding:4px 8px;width:200px}.contentful-toolbar__link-input input:focus{border-color:#2e75d4;box-shadow:0 0 0 2px rgba(46,117,212,.2);outline:none}.contentful-toolbar__link-input button{background:#fff;border:1px solid #d3dce6;border-radius:4px;cursor:pointer;font-size:12px;padding:4px 8px}.contentful-toolbar__embed-dropdown{position:relative}.contentful-toolbar__embed-button{background:#2e75d4;border:1px solid #2e75d4;border-radius:4px;color:#fff;cursor:pointer;font-size:14px;font-weight:500;padding:6px 12px}.contentful-toolbar__embed-button:hover{background:#1e5aa8;border-color:#1e5aa8}.contentful-toolbar__embed-dropdown:hover .contentful-toolbar__embed-menu{display:block}.contentful-toolbar__embed-menu{background:#fff;border:1px solid #d3dce6;border-radius:4px;box-shadow:0 2px 8px rgba(0,0,0,.15);display:none;min-width:120px;position:absolute;right:0;top:100%;z-index:100}.contentful-toolbar__embed-option{background:none;border:none;cursor:pointer;display:block;font-size:14px;padding:8px 12px;text-align:left;width:100%}.contentful-toolbar__embed-option:hover{background:#f7f9fa}.contentful-editor__content-wrapper{position:relative}.contentful-editor__content{min-height:200px}.contentful-editor-content{color:#2c3e50;font-size:16px;line-height:1.6;outline:none;padding:16px}.contentful-editor-content:empty:before{color:#68737d;content:attr(data-placeholder);pointer-events:none}.contentful-editor-content h1{font-size:2em;font-weight:600;line-height:1.2;margin:1em 0 .5em}.contentful-editor-content h2{font-size:1.5em;font-weight:600;line-height:1.3;margin:1em 0 .5em}.contentful-editor-content h3{font-size:1.25em;font-weight:600;line-height:1.4;margin:1em 0 .5em}.contentful-editor-content h4,.contentful-editor-content h5,.contentful-editor-content h6{font-size:1em;font-weight:600;line-height:1.5;margin:1em 0 .5em}.contentful-editor-content p{margin:0 0 1em}.contentful-editor-content p:last-child{margin-bottom:0}.contentful-bullet-list,.contentful-ordered-list{margin:1em 0;padding-left:1.5em}.contentful-bullet-list li,.contentful-ordered-list li{margin:.25em 0}.contentful-blockquote{border-left:4px solid #2e75d4;color:#68737d;font-style:italic;margin:1em 0;padding-left:1em}.contentful-link{color:#2e75d4;text-decoration:underline}.contentful-link:hover{color:#1e5aa8}.contentful-table{border:1px solid #d3dce6;border-collapse:collapse;margin:1em 0;width:100%}.contentful-table-cell,.contentful-table-header{border:1px solid #d3dce6;padding:8px 12px;text-align:left}.contentful-table-header{background:#f7f9fa;font-weight:600}.contentful-editor--minimal{border:none;border-radius:0}.contentful-editor--minimal .contentful-toolbar{background:#fff;border-bottom:1px solid #e1e8ed;border-radius:0}.contentful-editor--default .contentful-editor-content{font-family:Georgia,serif}.contentful-editor:focus-within{border-color:#2e75d4;box-shadow:0 0 0 2px rgba(46,117,212,.2)}@media (max-width:768px){.contentful-toolbar{flex-wrap:wrap}.contentful-toolbar__select{min-width:100px}.contentful-editor-content{font-size:14px;padding:12px}}
|