magic-editor-x 1.3.7 → 1.4.0
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 +131 -2
- package/dist/_chunks/{App-BrAGe1KP.js → App-ByYQ99dO.js} +4 -4
- package/dist/_chunks/{App-SlDn2xdO.mjs → App-C8q91Ico.mjs} +4 -4
- package/dist/_chunks/CustomBlocksPage-BkmF2iOQ.js +1518 -0
- package/dist/_chunks/CustomBlocksPage-rLRB05j0.mjs +1516 -0
- package/dist/_chunks/{LicensePage-C6TBYCWM.js → LicensePage-Bdn7zWU2.js} +30 -12
- package/dist/_chunks/{LicensePage-zaYXFrKs.mjs → LicensePage-DR_Cwyfw.mjs} +30 -12
- package/dist/_chunks/{LiveCollaborationPanel-yNC8e1Qb.mjs → LiveCollaborationPanel-0tplv17N.mjs} +1 -1
- package/dist/_chunks/{LiveCollaborationPanel-CGt57XG1.js → LiveCollaborationPanel-BUHIq0CQ.js} +1 -1
- package/dist/_chunks/{Settings-BH0Ttu_5.js → Settings-B5mffA2O.js} +1 -1
- package/dist/_chunks/{Settings-BXoP5tm9.mjs → Settings-FfpVHlpw.mjs} +1 -1
- package/dist/_chunks/{getTranslation-D2oq0PyC.mjs → getTranslation-Bk8tKbUs.mjs} +1 -1
- package/dist/_chunks/{getTranslation-D21ValYk.js → getTranslation-DOJ3x1SL.js} +1 -1
- package/dist/_chunks/{index-BnTvuHf2.js → index-C5DuaTDl.js} +15 -5
- package/dist/_chunks/{index-tbHD7slZ.mjs → index-DkpTkVe7.mjs} +15 -5
- package/dist/_chunks/{index-Czk5HVLJ.js → index-DzixAi6O.js} +1183 -16
- package/dist/_chunks/{index-CUTx2oym.mjs → index-zOiCW1bZ.mjs} +1183 -16
- package/dist/_chunks/{tools-D4Y_iEui.js → tools-BSMn5LLQ.js} +17 -2
- package/dist/_chunks/{tools-BGR6Cw4p.mjs → tools-uudZx91W.mjs} +17 -2
- package/dist/admin/index.js +1 -1
- package/dist/admin/index.mjs +1 -1
- package/dist/server/index.js +1172 -9
- package/dist/server/index.mjs +1172 -9
- package/dist/style.css +116 -7
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -7,15 +7,36 @@
|
|
|
7
7
|
[](https://strapi.io)
|
|
8
8
|
[](https://editorjs.io)
|
|
9
9
|
|
|
10
|
+
> **ALPHA RELEASE v1.4.0-alpha.1** - Custom Blocks with Tier-based Limits now available! Create your own editor blocks without writing code.
|
|
11
|
+
|
|
10
12
|
---
|
|
11
13
|
|
|
12
|
-
##
|
|
14
|
+
## What's New in v1.4.0-alpha.1
|
|
15
|
+
|
|
16
|
+
### Custom Blocks (Contentful-style)
|
|
17
|
+
|
|
18
|
+
Create custom editor blocks directly from the Admin UI - no code required!
|
|
19
|
+
|
|
20
|
+
- **Simple Blocks** - Text/HTML blocks with configurable fields (text, textarea, select, color, checkbox)
|
|
21
|
+
- **Embedded Entry Blocks** - Reference other Strapi content types with preview fields (like Contentful Inline Entries)
|
|
22
|
+
- **HTML Templates** - Define custom templates with `{{fieldName}}` placeholders
|
|
23
|
+
- **Replaces Dynamic Zones** - Simpler alternative for structured content within the editor
|
|
24
|
+
|
|
25
|
+
### Tier-Based Limits
|
|
26
|
+
|
|
27
|
+
| Feature | FREE | PREMIUM | ADVANCED |
|
|
28
|
+
|---------|------|---------|----------|
|
|
29
|
+
| Simple Blocks | 3 | 10 (combined) | Unlimited |
|
|
30
|
+
| Embedded Entry | - | 10 (combined) | Unlimited |
|
|
31
|
+
| Export/Import | - | - | Yes |
|
|
32
|
+
| API Access | - | - | Yes |
|
|
33
|
+
|
|
34
|
+
### Previous Updates (v1.2.0)
|
|
13
35
|
|
|
14
36
|
- **Character-Level Collaboration** - Multiple users can now type in the same paragraph simultaneously without conflicts
|
|
15
37
|
- **Webtools Links Integration** - Optional integration with PluginPal's Webtools Links addon for internal/external link management
|
|
16
38
|
- **Direct Link Editing** - Click on any link to instantly open the link editor modal
|
|
17
39
|
- **Improved Fullscreen Mode** - Blocks now stretch to full width, Media Library modal works correctly
|
|
18
|
-
- **Performance Improvements** - Removed debug logging, optimized Y.js sync
|
|
19
40
|
|
|
20
41
|
---
|
|
21
42
|
|
|
@@ -314,6 +335,114 @@ Magic Editor X comes with a comprehensive collection of tools, categorized for e
|
|
|
314
335
|
| **Undo/Redo** | History management | `editorjs-undo` |
|
|
315
336
|
| **Drag & Drop** | Reorder blocks by dragging | `editorjs-drag-drop` |
|
|
316
337
|
|
|
338
|
+
### Custom Blocks (User-Defined)
|
|
339
|
+
|
|
340
|
+
Magic Editor X allows you to create your own custom blocks without writing code! This feature is similar to Contentful's embedded entries and can replace Strapi's Components + Dynamic Zones setup.
|
|
341
|
+
|
|
342
|
+
#### Creating Custom Blocks via Admin UI
|
|
343
|
+
|
|
344
|
+
1. Go to **Settings > Magic Editor X > Custom Blocks**
|
|
345
|
+
2. Click **Create Block**
|
|
346
|
+
3. Fill in the form:
|
|
347
|
+
- **Block Name** - Unique identifier (e.g., `productCard`)
|
|
348
|
+
- **Display Label** - Shown in the editor toolbox
|
|
349
|
+
- **Block Type**:
|
|
350
|
+
- **Simple Block** - Text/HTML content with custom fields
|
|
351
|
+
- **Embedded Entry** - Links to existing Strapi content
|
|
352
|
+
4. Configure additional options (fields, template, icon)
|
|
353
|
+
5. Click **Create Block**
|
|
354
|
+
|
|
355
|
+
The new block appears immediately in the editor toolbox!
|
|
356
|
+
|
|
357
|
+
#### Block Types
|
|
358
|
+
|
|
359
|
+
**Simple Blocks:**
|
|
360
|
+
Custom text/HTML blocks with configurable fields.
|
|
361
|
+
|
|
362
|
+
| Option | Description |
|
|
363
|
+
|--------|-------------|
|
|
364
|
+
| Placeholder | Hint text for empty content |
|
|
365
|
+
| Template | Custom HTML with `{{fieldName}}` placeholders |
|
|
366
|
+
| Fields | Add custom fields (text, select, color, checkbox) |
|
|
367
|
+
| Styles | Custom CSS as JSON object |
|
|
368
|
+
|
|
369
|
+
**Embedded Entry Blocks:**
|
|
370
|
+
Embed existing Strapi content directly in your editor.
|
|
371
|
+
|
|
372
|
+
| Option | Description |
|
|
373
|
+
|--------|-------------|
|
|
374
|
+
| Content Type | Target content type (e.g., `api::product.product`) |
|
|
375
|
+
| Title Field | Field to display as entry title |
|
|
376
|
+
| Display Fields | Fields shown in preview |
|
|
377
|
+
|
|
378
|
+
#### Creating Custom Blocks via Config (Developers)
|
|
379
|
+
|
|
380
|
+
For developers who prefer code-based configuration:
|
|
381
|
+
|
|
382
|
+
```javascript
|
|
383
|
+
// config/plugins.js
|
|
384
|
+
'magic-editor-x': {
|
|
385
|
+
enabled: true,
|
|
386
|
+
config: {
|
|
387
|
+
customBlocks: [
|
|
388
|
+
{
|
|
389
|
+
name: 'productCard',
|
|
390
|
+
label: 'Product Card',
|
|
391
|
+
blockType: 'embedded-entry',
|
|
392
|
+
contentType: 'api::product.product',
|
|
393
|
+
displayFields: ['title', 'price', 'thumbnail'],
|
|
394
|
+
titleField: 'title',
|
|
395
|
+
icon: '<svg>...</svg>',
|
|
396
|
+
},
|
|
397
|
+
{
|
|
398
|
+
name: 'callToAction',
|
|
399
|
+
label: 'Call to Action',
|
|
400
|
+
blockType: 'simple',
|
|
401
|
+
placeholder: 'Enter CTA text...',
|
|
402
|
+
fields: [
|
|
403
|
+
{ name: 'buttonText', label: 'Button Text', type: 'text' },
|
|
404
|
+
{ name: 'buttonUrl', label: 'Button URL', type: 'text' },
|
|
405
|
+
{ name: 'variant', label: 'Style', type: 'select', options: ['primary', 'secondary'] },
|
|
406
|
+
],
|
|
407
|
+
template: `
|
|
408
|
+
<div class="cta-block">
|
|
409
|
+
<p data-field="content">{{content}}</p>
|
|
410
|
+
<a href="{{buttonUrl}}" class="btn btn-{{variant}}">{{buttonText}}</a>
|
|
411
|
+
</div>
|
|
412
|
+
`,
|
|
413
|
+
},
|
|
414
|
+
],
|
|
415
|
+
},
|
|
416
|
+
},
|
|
417
|
+
```
|
|
418
|
+
|
|
419
|
+
#### Import/Export Custom Blocks
|
|
420
|
+
|
|
421
|
+
Custom blocks can be exported and imported between environments:
|
|
422
|
+
|
|
423
|
+
1. Go to **Settings > Magic Editor X > Custom Blocks**
|
|
424
|
+
2. Click **Export** to download a JSON file
|
|
425
|
+
3. On another instance, click **Import** and select the file
|
|
426
|
+
|
|
427
|
+
#### Custom Block Output Format
|
|
428
|
+
|
|
429
|
+
Custom blocks save their data in the standard Editor.js format:
|
|
430
|
+
|
|
431
|
+
```json
|
|
432
|
+
{
|
|
433
|
+
"type": "productCard",
|
|
434
|
+
"data": {
|
|
435
|
+
"entry": {
|
|
436
|
+
"id": 42,
|
|
437
|
+
"documentId": "abc123",
|
|
438
|
+
"title": "Product Name",
|
|
439
|
+
"price": 99.99
|
|
440
|
+
},
|
|
441
|
+
"contentType": "api::product.product"
|
|
442
|
+
}
|
|
443
|
+
}
|
|
444
|
+
```
|
|
445
|
+
|
|
317
446
|
### 4. Media Library Integration
|
|
318
447
|
|
|
319
448
|
Seamless integration with Strapi's built-in Media Library:
|
|
@@ -7,10 +7,10 @@ const admin = require("@strapi/strapi/admin");
|
|
|
7
7
|
const styled = require("styled-components");
|
|
8
8
|
const outline = require("@heroicons/react/24/outline");
|
|
9
9
|
const EditorJS = require("@editorjs/editorjs");
|
|
10
|
-
const getTranslation = require("./getTranslation-
|
|
11
|
-
const tools = require("./tools-
|
|
12
|
-
const index = require("./index-
|
|
13
|
-
const LicensePage = require("./LicensePage-
|
|
10
|
+
const getTranslation = require("./getTranslation-DOJ3x1SL.js");
|
|
11
|
+
const tools = require("./tools-BSMn5LLQ.js");
|
|
12
|
+
const index = require("./index-C5DuaTDl.js");
|
|
13
|
+
const LicensePage = require("./LicensePage-Bdn7zWU2.js");
|
|
14
14
|
const _interopDefault = (e) => e && e.__esModule ? e : { default: e };
|
|
15
15
|
const styled__default = /* @__PURE__ */ _interopDefault(styled);
|
|
16
16
|
const EditorJS__default = /* @__PURE__ */ _interopDefault(EditorJS);
|
|
@@ -5,10 +5,10 @@ import { useFetchClient, useNotification, Page } from "@strapi/strapi/admin";
|
|
|
5
5
|
import styled, { css, keyframes } from "styled-components";
|
|
6
6
|
import { HashtagIcon, DocumentTextIcon, ListBulletIcon, CheckIcon, ChatBubbleBottomCenterTextIcon, CodeBracketIcon, PhotoIcon, TableCellsIcon, LinkIcon, ExclamationTriangleIcon, PaperClipIcon, BellAlertIcon, SparklesIcon, BeakerIcon, PlayCircleIcon, ArrowPathIcon, EyeIcon, DocumentDuplicateIcon, ChevronRightIcon, CubeTransparentIcon, Cog6ToothIcon, UserGroupIcon, BookOpenIcon, CommandLineIcon, UserPlusIcon, TrashIcon, CheckCircleIcon, XMarkIcon, KeyIcon } from "@heroicons/react/24/outline";
|
|
7
7
|
import EditorJS from "@editorjs/editorjs";
|
|
8
|
-
import { u as useIntl, g as getTranslation, L as Loader, a as Box, T as Typography, F as Flex, c as TextInput, B as Button$2 } from "./getTranslation-
|
|
9
|
-
import { g as getTools } from "./tools-
|
|
10
|
-
import { P as PLUGIN_ID } from "./index-
|
|
11
|
-
import LicensePage from "./LicensePage-
|
|
8
|
+
import { u as useIntl, g as getTranslation, L as Loader, a as Box, T as Typography, F as Flex, c as TextInput, B as Button$2 } from "./getTranslation-Bk8tKbUs.mjs";
|
|
9
|
+
import { g as getTools } from "./tools-uudZx91W.mjs";
|
|
10
|
+
import { P as PLUGIN_ID } from "./index-DkpTkVe7.mjs";
|
|
11
|
+
import LicensePage from "./LicensePage-DR_Cwyfw.mjs";
|
|
12
12
|
const fadeInUp = keyframes`
|
|
13
13
|
from { opacity: 0; transform: translateY(20px); }
|
|
14
14
|
to { opacity: 1; transform: translateY(0); }
|