magic-editor-x 2.4.0 → 2.5.1
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/CHANGELOG.md +63 -0
- package/README.md +140 -62
- package/bin/magic-editor-x.mjs +55 -8
- package/dist/admin/{AuditPage-guB0SiGS.mjs → AuditPage-Be78C7EC.mjs} +4 -3
- package/dist/admin/{AuditPage-C2u6z4aN.js → AuditPage-iQzpjH8H.js} +7 -6
- package/dist/admin/{ConfigurationPage-DiEpF1Rr.mjs → ConfigurationPage-C9CPBfWy.mjs} +186 -6
- package/dist/admin/{ConfigurationPage-D6uya-J1.js → ConfigurationPage-DefuBeYO.js} +191 -11
- package/dist/admin/Content-BttG50Mc.mjs +360 -0
- package/dist/admin/Content-V5MRBsI3.js +362 -0
- package/dist/admin/{CustomBlocksPage-Byt10-6c.mjs → CustomBlocksPage-DB5nnCsn.mjs} +5 -4
- package/dist/admin/{CustomBlocksPage-DP3h_wNd.js → CustomBlocksPage-Dg2rM3F4.js} +8 -7
- package/dist/admin/EntryWidgets-B8YA0Zxy.mjs +199 -0
- package/dist/admin/EntryWidgets-BcXAAx3F.js +201 -0
- package/dist/admin/{MentionsWidget-sMkM9mHX.mjs → MentionsWidget-CJPZDk9Z.mjs} +2 -2
- package/dist/admin/{MentionsWidget-C2OCAmqq.js → MentionsWidget-DUz6YVIG.js} +2 -2
- package/dist/admin/{useT-CLPhBmBC.mjs → SectionCard-8ZNHkvn9.mjs} +2 -12
- package/dist/admin/{useT-BXJLIPN4.js → SectionCard-Bs-xiiH1.js} +0 -10
- package/dist/admin/{TemplatesPage-Yp4OqFE2.mjs → TemplatesPage-VsZ_Mc0R.mjs} +6 -5
- package/dist/admin/{TemplatesPage-DrSJdteI.js → TemplatesPage-dx4_yd_t.js} +13 -12
- package/dist/admin/{api-bix9RLLI.js → api-4AYzwS4-.js} +9 -1
- package/dist/admin/{api-2ZRpHM3d.mjs → api-CcTYyckq.mjs} +9 -1
- package/dist/admin/{de-zcV8D7nt.js → de-B6rdcOqQ.js} +103 -1
- package/dist/admin/{de-1cFMs-4c.mjs → de-BWfR2jTg.mjs} +8 -1
- package/dist/admin/{de-DiCZrmH8.mjs → de-Bip0sBRT.mjs} +19 -1
- package/dist/admin/{de-Dn8athM8.js → de-BrPR4sUB.js} +8 -1
- package/dist/admin/{de-CKz6CG3V.mjs → de-CQA8hOpl.mjs} +103 -1
- package/dist/admin/{de-CbBDnXeT.js → de-CnnxKXj7.js} +19 -1
- package/dist/admin/{de-BhhGss1l.js → de-Dss5POqk.js} +12 -1
- package/dist/admin/{de-BNPIGqhs.mjs → de-zgHCYTLH.mjs} +12 -1
- package/dist/admin/{en-CIZ5Ggod.js → en--JjAHbpP.js} +8 -1
- package/dist/admin/{en-cYzqbASF.mjs → en-BCKaVgBM.mjs} +103 -1
- package/dist/admin/{en-B9ApE1y1.js → en-CJ17Sp_e.js} +12 -1
- package/dist/admin/{en-BMWhILnj.js → en-CbGkcq0Q.js} +103 -1
- package/dist/admin/{en-DCPMqFIa.mjs → en-Cd6Jk-J0.mjs} +19 -1
- package/dist/admin/{en-CpehF0Kv.js → en-D69Fe9ZO.js} +19 -1
- package/dist/admin/{en-Dc9y-6n9.mjs → en-Dr58wBAo.mjs} +8 -1
- package/dist/admin/{en-gFLeK9Ng.mjs → en-Uhm7OouM.mjs} +12 -1
- package/dist/admin/entry-panel-events-0msyPrAD.js +18 -0
- package/dist/admin/entry-panel-events-XRuUoLZ9.mjs +19 -0
- package/dist/admin/{es-D2Kw6E4N.mjs → es-B2Hkkbw9.mjs} +8 -1
- package/dist/admin/{es-BmwBgEgz.mjs → es-BMkmfH88.mjs} +12 -1
- package/dist/admin/{es-Chs37IBR.mjs → es-Bz8d72Fa.mjs} +19 -1
- package/dist/admin/{es-CQPh8PXw.js → es-C8UotT8O.js} +103 -1
- package/dist/admin/{es-CawpzwyC.js → es-CcEDZpVQ.js} +19 -1
- package/dist/admin/{es-C0W31rl8.js → es-DJm3HFJt.js} +12 -1
- package/dist/admin/{es-C4IRHV5d.js → es-YvaTAtqY.js} +8 -1
- package/dist/admin/{es-DCamt1ek.mjs → es-pvPfNAld.mjs} +103 -1
- package/dist/admin/{fr-BOvvfEH7.mjs → fr-BvPjRiwr.mjs} +8 -1
- package/dist/admin/{fr-Dp5-XP29.mjs → fr-CKHZ0xxU.mjs} +19 -1
- package/dist/admin/{fr-iGeIfEcU.js → fr-CRM9VuAq.js} +12 -1
- package/dist/admin/{fr-CMWBNE5D.mjs → fr-CrIHmKYX.mjs} +12 -1
- package/dist/admin/{fr-COOsqexl.js → fr-Cx29jQ_g.js} +19 -1
- package/dist/admin/{fr-oW0t8bT5.mjs → fr-D4tL6Ag2.mjs} +103 -1
- package/dist/admin/{fr-Zkb8vfjN.js → fr-Di-U-rAH.js} +8 -1
- package/dist/admin/{fr-DpC44Ol8.js → fr-DrUYv2jh.js} +103 -1
- package/dist/admin/{index-BVjf1gVC.mjs → index-C4ksUkEm.mjs} +9183 -6353
- package/dist/admin/{index-64wc26Bl.js → index-C5D3VqLq.js} +9170 -6340
- package/dist/admin/{index-D_Fv8Non.mjs → index-CMYCZWOh.mjs} +1053 -190
- package/dist/admin/{index-D6Z7i8ba.js → index-DRyctF9s.js} +961 -98
- package/dist/admin/index.js +1 -1
- package/dist/admin/index.mjs +2 -2
- package/dist/admin/{math-vsK_06ZR.js → math-D6jmskGS.js} +1 -1
- package/dist/admin/{math-CIQ4Z_mY.mjs → math-DntdSWKX.mjs} +1 -1
- package/dist/admin/{pt-DALDvfBn.mjs → pt-B8x7v-Xw.mjs} +19 -1
- package/dist/admin/{pt-DXy7G1x7.js → pt-BYn2xx78.js} +19 -1
- package/dist/admin/{pt-Bo0Pm_Pt.js → pt-CojQcz-p.js} +103 -1
- package/dist/admin/{pt-uGpfRQLC.mjs → pt-CuoIihKx.mjs} +103 -1
- package/dist/admin/{pt-1IUyx6ae.js → pt-CzrN_3ui.js} +8 -1
- package/dist/admin/{pt-DFNgZ5_k.mjs → pt-DDlPJYtB.mjs} +12 -1
- package/dist/admin/{pt-BHmXk2d9.js → pt-DPVAycXJ.js} +12 -1
- package/dist/admin/{pt-etwsg3G4.mjs → pt-DdGagO99.mjs} +8 -1
- package/dist/admin/useT-Bpw__IXT.js +12 -0
- package/dist/admin/useT-Cb-R3kyA.mjs +13 -0
- package/dist/blocks/index.d.mts +124 -0
- package/dist/blocks/index.d.ts +124 -0
- package/dist/blocks/index.js +172 -3
- package/dist/blocks/index.mjs +172 -3
- package/dist/math/index.js +6 -2
- package/dist/math/index.mjs +6 -2
- package/dist/react/index.js +1376 -1067
- package/dist/react/index.mjs +1376 -1067
- package/dist/render/index.d.mts +22 -0
- package/dist/render/index.d.ts +22 -0
- package/dist/render/index.js +1376 -1067
- package/dist/render/index.mjs +1376 -1067
- package/dist/server/index.js +28894 -24197
- package/dist/server/index.mjs +28893 -24196
- package/dist/server/mcp-worker.js +11319 -0
- package/dist/vue/index.js +1376 -1067
- package/dist/vue/index.mjs +1376 -1067
- package/package.json +7 -7
- package/schema/magic-editor-x.schema.json +9 -1
- package/types/blocks.d.ts +124 -0
- package/types/index.d.ts +10 -1
- package/types/render.d.ts +22 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,68 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [2.5.1](https://github.com/Schero94/Magic-Editor-X/compare/v2.5.0...v2.5.1) (2026-11-17)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Bug Fixes
|
|
7
|
+
|
|
8
|
+
* **readme:** make images and links work on the Strapi marketplace ([#12](https://github.com/Schero94/Magic-Editor-X/issues/12)) ([85a95eb](https://github.com/Schero94/Magic-Editor-X/commit/85a95eb620ef8609de691f766cabf97bceaba7b4))
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Fixed
|
|
12
|
+
|
|
13
|
+
- The README now works outside GitHub, on npm and on the Strapi marketplace: images load from the docs site (absolute URLs) and links to the license, guides, security reviews and other repository files point to GitHub instead of relative paths that led nowhere. The Screenshots section shows eight chosen screens and links the full gallery on the docs site instead of 61 images. A test fails on any relative image or link in the README and caps the number of screenshots.
|
|
14
|
+
|
|
15
|
+
# [2.5.0](https://github.com/Schero94/Magic-Editor-X/compare/v2.4.0...v2.5.0) (2026-11-16)
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
### Features
|
|
19
|
+
|
|
20
|
+
* entry panel with presence, unsaved-work protection, reuse, palette colours, private media and MCP tools ([#9](https://github.com/Schero94/Magic-Editor-X/issues/9)) ([23d3127](https://github.com/Schero94/Magic-Editor-X/commit/23d31270a8d13aae90c91734af844be1171281d3))
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
Magic Editor X 2.5 shows who is editing an entry, keeps unsaved work, lets editors reuse content from other entries, starts long entries faster, adds palette colours, superscript, subscript and inline annotations, supports private upload providers and dropped files, and adds optional tools for Strapi's MCP server. Everything new is off by default or appears only when it is relevant; the field toolbar is unchanged.
|
|
24
|
+
|
|
25
|
+
### Features
|
|
26
|
+
|
|
27
|
+
- **Entry panel:** a Magic Editor X side panel in the Content Manager shows who else is editing the entry (names only, across processes, also without live collaboration), open comment threads and quality issues or broken links per field, each with a button that opens that field's panel. Optional soft lock `presence.softLock` (off): a dialog asks once per tab before you edit an entry someone else is editing; nobody is locked out. Homepage widgets **My open threads** and **Broken links**. Routes `POST /presence`, `GET /entry-summary`, `GET /widgets/open-threads`, `GET /widgets/broken-links`; config `presence.enabled` (true), `presence.softLock` (false), `presence.perMinute` (30).
|
|
28
|
+
- **Unsaved work is kept:** unsaved field content stays in your browser (IndexedDB) and is offered back after a reload, crash, closed tab or ended session with one notice: Restore (one Undo reverts it) or Discard. Never restored automatically over newer saved content. Removed on save, discard, expiry and logout. Config `drafts.enabled` (true), `drafts.ttlHours` (72).
|
|
29
|
+
- **Insert from another entry:** More tools > Write > Insert from another entry copies chosen blocks from any entry, field or language you can read, with a preview and one undo step. Blocks the field does not allow are listed with the reason; synced blocks stay synced; inserted blocks get new ids. Routes `GET /reuse/types`, `GET /reuse/source`; config `reuse.enabled` (true), `reuse.perMinute` (60).
|
|
30
|
+
- **Block clipboard:** blocks copied between Magic Editor X fields, entries and tabs keep all their data and alignment; new **Copy block** in the block menu.
|
|
31
|
+
- **Faster long entries:** Editor.js and the live room of a field start when the field comes near the screen or gets focus (`lazyInit.enabled`, `lazyInit.marginPx` 800). With 20 fields and a dynamic zone, 4 editors and live connections start instead of 20. The benchmark covers 20 fields and up to 250 repeatable and dynamic-zone items.
|
|
32
|
+
- **Palette colours, superscript, subscript, inline annotations:** text colour and highlight from named tokens in the new `palette` config (stored as `data-mex-color`/`data-mex-highlight`, rendered as classes, never inline styles), with a contrast check in Settings and the quality rule `color-contrast`; superscript and subscript; inline annotations with the built-in abbreviation and `registerInlineAnnotation` in `magic-editor-x/blocks` (server-side `resolve`, renderer options `annotations` and `resolveAnnotation`). Field options `inlineColors`, `inlineScript`, `inlineAnnotations`, all off by default.
|
|
33
|
+
- **Private upload providers:** Media Library files in Magic Editor X values are stored with their file id and unsigned URL and signed in batches on every Content API, GraphQL and `?mex=` read and in the editor. New route `POST /media/signed-urls`; `GET /config` adds `uploads.privateFiles`.
|
|
34
|
+
- **Drop files onto a field** (Strapi 5.61+): they are uploaded through Strapi's Media Library drop zone and inserted as image, video or audio blocks; older hosts keep the previous behaviour.
|
|
35
|
+
- **Tools for AI clients (MCP):** with `mcp.enabled` (false) and Strapi's `server.mcp.enabled`, tools `mex_from_markdown`, `mex_from_html`, `mex_validate`, `mex_render`, one JSON Schema resource per preset and the prompt `mex_content_guide`. Pure transformations in a worker thread with a time limit; new action `plugin::magic-editor-x.mcp.use` (no role gets it automatically).
|
|
36
|
+
|
|
37
|
+
### Bug Fixes
|
|
38
|
+
|
|
39
|
+
- Tab and other keys work in every Magic Editor X dialog and in other form fields while an editor has a current block (Editor.js handled keys typed anywhere on the page).
|
|
40
|
+
- Text typed into an empty field in a live room now reaches the other editors (0 of 1 edits arrived in 2.4.0), and other people's edits no longer move your focus.
|
|
41
|
+
- Discarding a draft keeps version history and comments of sections whose published version predates 2.4.
|
|
42
|
+
- A section emptied and saved keeps its history and comments (its `fieldKey` is remembered while the value is `null`).
|
|
43
|
+
- Saving a synced block without changes no longer creates a version.
|
|
44
|
+
- Mention e-mails use the recipient's admin language (en, de, fr, es, pt).
|
|
45
|
+
- The inline toolbar wraps inside the field on narrow screens instead of running off the left edge.
|
|
46
|
+
- Focus returns into gallery, video and audio blocks after the Media Library picker closes.
|
|
47
|
+
- No Radix accessibility warning in the console for the plugin's dialogs on Strapi 5.62 (Design System 2.3.1).
|
|
48
|
+
- Installing on Node 22 no longer warns with EBADENGINE (see the migration notes); CI installs the packed package on Node 22 and fails on any EBADENGINE.
|
|
49
|
+
|
|
50
|
+
### Deferred
|
|
51
|
+
|
|
52
|
+
- Component blocks (Content-Type Builder components as blocks) move to 2.6. They worked in single-editor tests, but a stress test of two editors in one live room (CPU throttled 4x) lost a collaborator's edit: the component form sent all its values on every keystroke, so a value that had arrived from the room but was not drawn yet was overwritten (3 of 8 rounds), and the same happened inside one attribute (1 of 4 rounds). The cause is found and a fix with regression tests is on the branch `feat/2.5-components`; it ships when the stress and cluster runs show no lost edit.
|
|
53
|
+
- Live Preview inline editing for Magic Editor X fields: in Strapi 5.61 the side editor and its messages are internal, live preview is experimental and needs a Growth or Enterprise plan, and content source maps skip JSON custom fields.
|
|
54
|
+
- Columns/layout block: the 2.5 spike measured blockers on Editor.js 2.31 (moving a block between columns while someone edits it loses the edit without a new collaboration schema; nested editors handle keys twice; comments, suggestions, quality, find/replace and AI address top-level blocks only). See `docs/engine-decision.md`.
|
|
55
|
+
- Session-expiry warning: Strapi does not expose to the browser when an admin session ends; local drafts cover lost sessions instead.
|
|
56
|
+
|
|
57
|
+
### Migration notes
|
|
58
|
+
|
|
59
|
+
- `engines.node` is now `>=22.12.0 <=26.x.x`. This declares the floor that the dependency sanitize-html 2.18 already required since 2.4.0; installs on Node 22.12 or later no longer warn with EBADENGINE.
|
|
60
|
+
- `@editorjs/embed` is pinned to 2.7.7, because 2.8.0 requires Node 24. YouTube Shorts and Figma embeds, which 2.8.0 added, are defined by the plugin, so nothing changes for editors; the Figma pattern now requires a Figma document URL.
|
|
61
|
+
- No breaking changes and nothing to do for public upload providers.
|
|
62
|
+
- With a private upload provider, migration `2.5.0-media-file-ids` adds `fileId` to media in Magic Editor X values once at startup (idempotent, under the migration lease). Dry run: `npx magic-editor-x media-file-ids`; apply again: `--apply`.
|
|
63
|
+
- Fields start lazily: scripts and tests that wait for `[data-mex-ready="true"]` must scroll the field into view first, or set `lazyInit.enabled: false`.
|
|
64
|
+
- New config keys `presence`, `drafts`, `lazyInit`, `reuse`, `palette` and `mcp` are optional.
|
|
65
|
+
|
|
3
66
|
# [2.4.0](https://github.com/Schero94/Magic-Editor-X/compare/v2.3.1...v2.4.0) (2026-11-12)
|
|
4
67
|
|
|
5
68
|
|
package/README.md
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<p align="center">
|
|
2
|
-
<img src="https://
|
|
2
|
+
<img src="https://schero94.github.io/Magic-Editor-X/img/icon.svg" alt="Magic Editor X" width="96" height="96" />
|
|
3
3
|
</p>
|
|
4
4
|
|
|
5
5
|
# Magic Editor X
|
|
@@ -7,12 +7,13 @@
|
|
|
7
7
|
Block editor for Strapi 5: an [Editor.js](https://editorjs.io/) custom field with Media Library uploads, custom blocks, templates, tables with merged cells, math and footnotes, comments on blocks and on selected text with @mentions, block suggestions, version history, an audit trail, live collaboration across several servers, rendered Content API and GraphQL output, React and Vue components, and optional AI and grammar assistants that use your own provider. Free and open source under the MIT license.
|
|
8
8
|
|
|
9
9
|
[](https://www.npmjs.com/package/magic-editor-x)
|
|
10
|
-
[](
|
|
10
|
+
[](https://github.com/Schero94/Magic-Editor-X/blob/main/LICENSE)
|
|
11
11
|
|
|
12
12
|
Live docs: <https://schero94.github.io/Magic-Editor-X/>
|
|
13
13
|
|
|
14
14
|
## Contents
|
|
15
15
|
|
|
16
|
+
- [Getting started in 3 steps](#getting-started-in-3-steps)
|
|
16
17
|
- [Features](#features)
|
|
17
18
|
- [Screenshots](#screenshots)
|
|
18
19
|
- [Core concepts](#core-concepts)
|
|
@@ -33,6 +34,7 @@ Live docs: <https://schero94.github.io/Magic-Editor-X/>
|
|
|
33
34
|
- [Version history](#version-history)
|
|
34
35
|
- [Quality checks](#quality-checks)
|
|
35
36
|
- [Audit trail](#audit-trail)
|
|
37
|
+
- [Working together and reusing content (2.5)](#working-together-and-reusing-content-25)
|
|
36
38
|
- [Data format](#data-format)
|
|
37
39
|
- [Rendering content](#rendering-content)
|
|
38
40
|
- [Content API and GraphQL output](#content-api-and-graphql-output)
|
|
@@ -41,6 +43,7 @@ Live docs: <https://schero94.github.io/Magic-Editor-X/>
|
|
|
41
43
|
- [Admin API and permissions](#admin-api-and-permissions)
|
|
42
44
|
- [Security and privacy](#security-and-privacy)
|
|
43
45
|
- [Troubleshooting](#troubleshooting)
|
|
46
|
+
- [Upgrading from 2.4](#upgrading-from-24)
|
|
44
47
|
- [Upgrading from 2.3](#upgrading-from-23)
|
|
45
48
|
- [Upgrading from 2.2](#upgrading-from-22)
|
|
46
49
|
- [Migrating from 1.x](#migrating-from-1x)
|
|
@@ -49,6 +52,14 @@ Live docs: <https://schero94.github.io/Magic-Editor-X/>
|
|
|
49
52
|
- [Languages](#languages)
|
|
50
53
|
- [License](#license)
|
|
51
54
|
|
|
55
|
+
## Getting started in 3 steps
|
|
56
|
+
|
|
57
|
+
For editors who open an entry with a Magic Editor X field for the first time:
|
|
58
|
+
|
|
59
|
+
1. **Write.** Click into the field and type. Press **+** at the start of an empty line, or type **/**, to add a heading, list, image, table or any other block. Select text to make it bold, add a link or start a comment.
|
|
60
|
+
2. **Find the extras.** Everything beyond writing is in one place: **More tools** above the field (Review: comments, history, quality, suggestions; Write: AI, templates, insert from another entry; View: preview, focus, shortcuts). A block's own menu (**⋮⋮** next to it) moves, copies or changes that block.
|
|
61
|
+
3. **Save.** Use **Save** in the Content Manager as usual. The **Magic Editor X** panel next to the entry shows who else is editing it, open comments and quality problems. If your browser crashes before you save, the field offers your unsaved changes back the next time you open the entry.
|
|
62
|
+
|
|
52
63
|
## Features
|
|
53
64
|
|
|
54
65
|
Every feature is available in every installation. There is nothing to activate, no tiers and no usage limits. The plugin makes outgoing requests only for link previews, images and media by URL, the external link check and the AI provider and LanguageTool server the owner configured, and only when someone uses one of these features (see [Security and privacy](#security-and-privacy)). Mention e-mails, when the owner turns them on, go through your own Strapi email plugin.
|
|
@@ -78,55 +89,27 @@ Every feature is available in every installation. There is nothing to activate,
|
|
|
78
89
|
- **Live collaboration:** several admins edit the same field at the same time with character-level merging, presence avatars and read-only viewers. Works with several Node processes behind a load balancer without sticky sessions.
|
|
79
90
|
- **AI assistant:** improve, fix grammar, shorten, expand, summarize, simplify, translate, change tone and continue writing, using Anthropic, OpenAI or any OpenAI-compatible server (for example a local model) with your own key, on selected text or on chosen blocks. Optional, each behind its own owner switch: alternative text suggestions for images and translate or summarize a whole field. See [AI assistant](#ai-assistant).
|
|
80
91
|
- **Grammar check:** spelling and grammar of a whole field with a LanguageTool server (self-hosted or hosted), off until the owner turns it on. See [Grammar check (LanguageTool)](#grammar-check-languagetool).
|
|
92
|
+
- **Entry panel (2.5):** a Magic Editor X panel next to every entry shows who else is editing it, open comment threads and quality problems per field; optional soft lock that asks once before you edit an entry someone else is editing. Homepage widgets "My open threads" and "Broken links".
|
|
93
|
+
- **Unsaved work is kept (2.5):** unsaved field content stays in your browser and is offered back after a reload, crash, closed tab or ended session.
|
|
94
|
+
- **Reuse (2.5):** insert blocks from another entry, field or language with a preview, and copy blocks between fields with everything they contain.
|
|
95
|
+
- **Many fields (2.5):** fields start only when they come near the screen, so long entries open fast.
|
|
96
|
+
- **Colours from your palette (2.5):** text colour and highlight from named tokens you define (no free colours, no inline styles), superscript and subscript, and inline annotations such as abbreviations. All off until a field turns them on.
|
|
97
|
+
- **Private upload providers (2.5):** files of private storage (for example a private S3 bucket) are signed on every read and never stored signed. Drop files onto a field to upload and insert them.
|
|
98
|
+
- **Tools for AI clients (2.5):** optional tools, preset schemas and a content guide for Strapi's MCP server.
|
|
81
99
|
- **Strapi-native admin:** built with the Strapi Design System, light and dark mode, keyboard accessible, admin in English, German, French, Spanish and Portuguese.
|
|
82
100
|
- **Safe content:** every value is normalised and sanitised on the server when it is saved, from the Content Manager, the Content API or code.
|
|
83
101
|
- **Strapi AI translations and Releases:** Strapi's AI translation sends only the text of Magic Editor X fields and rebuilds other locales from the source structure; Releases show entries the publishing guard would refuse as not ready. See [Strapi AI translations and Releases](#strapi-ai-translations-and-releases).
|
|
84
102
|
|
|
85
103
|
## Screenshots
|
|
86
104
|
|
|
87
|
-
|
|
|
88
|
-
|
|
|
89
|
-
|  |  |
|
|
96
|
-
|  |  |
|
|
97
|
-
|  |  |
|
|
98
|
-
|
|
99
|
-
New in 2.3:
|
|
100
|
-
|
|
101
|
-
| | |
|
|
102
|
-
| --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
103
|
-
|  |  |
|
|
104
|
-
|  |  |
|
|
105
|
-
|  |  |
|
|
106
|
-
|  |  |
|
|
107
|
-
|  |  |
|
|
108
|
-
|  |  |
|
|
109
|
-
|  |  |
|
|
110
|
-
|  |  |
|
|
111
|
-
|
|
112
|
-
| | | |
|
|
113
|
-
| ---------------------------------------------------------------------- | ------------------------------------------------------------------------- | ----------------------------------------------------------------- |
|
|
114
|
-
|  |  |  |
|
|
115
|
-
|
|
116
|
-
New in 2.4:
|
|
117
|
-
|
|
118
|
-
| | |
|
|
119
|
-
| ---------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
120
|
-
|  |  |
|
|
121
|
-
|  |  |
|
|
122
|
-
|  |  |
|
|
123
|
-
|  |  |
|
|
124
|
-
|  |  |
|
|
125
|
-
|  |  |
|
|
126
|
-
|  |  |
|
|
127
|
-
|  |  |
|
|
128
|
-
|
|
129
|
-
All screenshots use synthetic data (acceptance host: Strapi 5.61.1).
|
|
105
|
+
| | |
|
|
106
|
+
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
107
|
+
|  |  |
|
|
108
|
+
|  |  |
|
|
109
|
+
|  |  |
|
|
110
|
+
|  |  |
|
|
111
|
+
|
|
112
|
+
All screenshots use synthetic data (acceptance host: Strapi 5.61.1). Every screen, from tables, math and footnotes to suggestions, templates and the AI assistant, is in the [full gallery on the docs site](https://schero94.github.io/Magic-Editor-X/#screens).
|
|
130
113
|
|
|
131
114
|
## Core concepts
|
|
132
115
|
|
|
@@ -171,14 +154,16 @@ All screenshots use synthetic data (acceptance host: Strapi 5.61.1).
|
|
|
171
154
|
|
|
172
155
|
## Compatibility
|
|
173
156
|
|
|
174
|
-
| Plugin | Strapi
|
|
175
|
-
| ------ |
|
|
176
|
-
| 2.x | 5.38 or later (acceptance host: Strapi 5.61.1) | 22 or 24 | SQLite, PostgreSQL and MySQL/MariaDB through the Strapi database connection. Acceptance runs used SQLite and PostgreSQL 16. |
|
|
177
|
-
| 1.x | 5.x
|
|
157
|
+
| Plugin | Strapi | Node | Notes |
|
|
158
|
+
| ------ | -------------------------------------------------------------------------- | ------------------------- | --------------------------------------------------------------------------------------------------------------------------- |
|
|
159
|
+
| 2.x | 5.38 or later (acceptance host: Strapi 5.61.1; 2.5 also checked on 5.62.0) | 22.12 or later (22 or 24) | SQLite, PostgreSQL and MySQL/MariaDB through the Strapi database connection. Acceptance runs used SQLite and PostgreSQL 16. |
|
|
160
|
+
| 1.x | 5.x | 22 | No longer developed. |
|
|
178
161
|
|
|
179
|
-
- `engines.node` is `>=22.
|
|
180
|
-
- The admin uses the React, React Router, react-intl, styled-components and Design System versions of the Strapi admin (React 18, Design System 2.2.4).
|
|
181
|
-
-
|
|
162
|
+
- `engines.node` is `>=22.12.0 <=26.x.x` (2.5 declares the floor that sanitize-html 2.18 already required since 2.4.0); the 2.3 to 2.5 test runs used Node 22.23.1.
|
|
163
|
+
- The admin uses the React, React Router, react-intl, styled-components and Design System versions of the Strapi admin (React 18, Design System 2.2.4 in Strapi 5.61, 2.3.1 in 5.62).
|
|
164
|
+
- Dropping files onto a field uses the Media Library drop zone that Strapi registers from 5.61; with an older Strapi or the legacy Media Library (`useLegacyMediaLibrary`) Editor.js keeps its own file drop.
|
|
165
|
+
- Console messages you may see in the admin that come from Strapi itself, not from the plugin: the `useRBAC` deprecation warning, React Router future-flag warnings, the styled-components `attribute` prop warning, and the upgrade check to api.github.com when outgoing requests are blocked.
|
|
166
|
+
- The editor uses Editor.js 2.31.7. Editor.js 2.32.0 is still a release candidate on npm (`2.32.0-rc.3` on the `next` tag, checked 2026-11-12) and is not used. Why the plugin stays on Editor.js is explained in [docs/engine-decision.md](https://github.com/Schero94/Magic-Editor-X/blob/main/docs/engine-decision.md).
|
|
182
167
|
- Formulas are rendered with Temml 0.14 (MIT), loaded by the admin only when a field shows math.
|
|
183
168
|
- `magic-editor-x/react` works with React 18 and 19 (peer `^18.0.0 || ^19.0.0`), in the browser and in server rendering, including React Server Components.
|
|
184
169
|
- `magic-editor-x/vue` needs Vue 3.5 or later (optional peer `^3.5.0`; it is never installed by the plugin).
|
|
@@ -280,6 +265,18 @@ All keys are optional. Infrastructure options live in `config/plugins`; the AI p
|
|
|
280
265
|
| `qualityChecks.externalLinks.schedule.perHostConcurrency` | integer | `2` | Requests in flight per host (1 to 8). |
|
|
281
266
|
| `audit.enabled` | boolean | `true` | Records the [audit trail](#audit-trail) (2.4). It holds no content. `false` stops recording and the extra reads it needs. |
|
|
282
267
|
| `audit.retentionDays` | integer | `180` | Days an audit event is kept (0 keeps everything, at most 3660). One process prunes once an hour. |
|
|
268
|
+
| `presence.enabled` | boolean | `true` | The Magic Editor X entry panel shows who else has the entry open (2.5). Names only, never e-mail addresses. Works without live collaboration. |
|
|
269
|
+
| `presence.softLock` | boolean | `false` | Asks once per tab before you edit an entry someone else is editing ("Continue editing"). Never blocks anyone (2.5). |
|
|
270
|
+
| `presence.perMinute` | integer | `30` | Presence requests per admin per minute, shared by all processes. |
|
|
271
|
+
| `mcp.enabled` | boolean | `false` | Registers the Magic Editor X tools, preset schemas and content guide with Strapi's MCP server. Strapi's own `server.mcp.enabled` must be on too (2.5). |
|
|
272
|
+
| `reuse.enabled` | boolean | `true` | "Insert from another entry" in More tools > Write (2.5). |
|
|
273
|
+
| `reuse.perMinute` | integer | `60` | Requests of "Insert from another entry" per admin per minute. |
|
|
274
|
+
| `palette.colors` | `{ name, label, light, dark }[]` | `[]` | Named text colours editors may pick in fields with "Text colour and highlight" (2.5). `name` becomes the class `mex-color-<name>`; `light`/`dark` are hex colours for the editor display and the contrast check. At most 24. |
|
|
275
|
+
| `palette.highlights` | `{ name, label, light, dark }[]` | `[]` | Named highlight colours (`<mark>`, class `mex-highlight-<name>`), same rules (2.5). Optional `palette.background` and `palette.text` (`{ light, dark }`) set the page colours the contrast check compares with. |
|
|
276
|
+
| `drafts.enabled` | boolean | `true` | Keeps unsaved field content in the admin's browser (IndexedDB) and offers it back after a reload, crash, closed tab or ended session: one notice with Restore or Discard (2.5). Removed on save, discard, expiry and logout. |
|
|
277
|
+
| `drafts.ttlHours` | integer | `72` | Lifetime of a local draft in hours (1 to 720). |
|
|
278
|
+
| `lazyInit.enabled` | boolean | `true` | Starts the editor and the live room of a field only when it comes near the screen or gets focus; until then the saved content is shown (2.5). |
|
|
279
|
+
| `lazyInit.marginPx` | integer | `800` | Distance above and below the screen at which a field starts (0 to 10000 CSS pixels). |
|
|
283
280
|
|
|
284
281
|
The validator rejects wrong types and ranges at startup and names the key, never the value. Keys from 1.x that no longer exist are ignored with a warning; see [Migrating from 1.x](#migrating-from-1x).
|
|
285
282
|
|
|
@@ -350,7 +347,7 @@ The plugin creates these tables on startup. They are not content types, so Strap
|
|
|
350
347
|
|
|
351
348
|
Behind a proxy, also set `server.proxy` in `config/server` (`koa: true` and the number of trusted hops in `maxIpsCount`) so Strapi sees the real client address.
|
|
352
349
|
|
|
353
|
-
The acceptance run with several processes is described in [CONTRIBUTING.md](
|
|
350
|
+
The acceptance run with several processes is described in [CONTRIBUTING.md](https://github.com/Schero94/Magic-Editor-X/blob/main/CONTRIBUTING.md).
|
|
354
351
|
|
|
355
352
|
## AI assistant
|
|
356
353
|
|
|
@@ -554,6 +551,63 @@ Settings > Magic Editor X > **Audit trail** lists who changed what and when: per
|
|
|
554
551
|
- **Coverage:** field changes are recorded from the Document Service, so the Content Manager, the Content API, imports and code are all covered; writes around it (`db.query`, raw SQL) are not. Content API writes are recorded without a person. With Strapi's Enterprise audit logs available, the events are also sent there.
|
|
555
552
|
- The events are stored in the table `magic_editor_x_audit`, not in a content type.
|
|
556
553
|
|
|
554
|
+
## Working together and reusing content (2.5)
|
|
555
|
+
|
|
556
|
+
### Entry panel and who is editing
|
|
557
|
+
|
|
558
|
+
Every entry with a Magic Editor X field gets a **Magic Editor X** panel in the Content Manager (in the actions drawer on narrow screens):
|
|
559
|
+
|
|
560
|
+
- **Editing now** lists the other admins who have the entry open, with names only. It works across several server processes and also without live collaboration (`presence.enabled`, default `true`). Only admins who can read the entry see the list.
|
|
561
|
+
- **Comments** shows the open threads per field; **Show** opens that field's comments.
|
|
562
|
+
- **Quality** shows issues and broken links per field of the saved draft; **Check** opens that field's quality panel.
|
|
563
|
+
- Soft lock (`presence.softLock: true`, off by default): when someone else is editing, a dialog says so once per tab and you choose **Continue editing**. Nobody is ever locked out.
|
|
564
|
+
|
|
565
|
+
The admin home can show **My open threads** (threads you started or were mentioned in) and **Broken links** (entries you can read with broken links from the scheduled link check).
|
|
566
|
+
|
|
567
|
+
### Unsaved changes
|
|
568
|
+
|
|
569
|
+
While a field has unsaved changes, Magic Editor X keeps them in your browser (IndexedDB, `drafts.enabled`, default `true`). After a reload, a crash, a closed tab or an ended session the field shows "Unsaved changes from … were found." Choose **Restore** (one Undo reverts it) or **Discard**. If the saved content changed in the meantime, the notice says so and never restores automatically. Local drafts are removed when you save, discard, after `drafts.ttlHours` (72) and when you log out. While a field is live in a collaboration room the room keeps your edits, so nothing is stored locally; a draft is kept only during connection gaps. Strapi does not tell the browser when a session will end, so there is no countdown; the local draft covers that case.
|
|
570
|
+
|
|
571
|
+
### Insert from another entry and copy blocks
|
|
572
|
+
|
|
573
|
+
**More tools > Insert from another entry** copies blocks from any entry, field or language you can read: choose the entry (type, language and field are preselected and hidden when there is only one choice), tick the blocks in the preview and choose **Insert N blocks**. The source is the entry as last saved. Blocks the field does not allow are listed with the reason. Every inserted block gets a new id, so comments and suggestions stay with the source; synced blocks stay synced; images keep their Media Library file.
|
|
574
|
+
|
|
575
|
+
Copy blocks between fields, entries and browser tabs with Ctrl/Cmd+C (after selecting blocks) or **Copy block** in the block menu, and paste with Ctrl/Cmd+V: custom blocks, blocks registered in code and alignment are kept. Turn the dialog off with `reuse.enabled: false`.
|
|
576
|
+
|
|
577
|
+
### Long entries
|
|
578
|
+
|
|
579
|
+
Editors start when a field comes within `lazyInit.marginPx` (800 px) of the screen or gets focus; until then the field shows its saved content. With 20 fields plus a dynamic zone, 4 editors and live connections start instead of 20 and the page has fewer than 40 % of the DOM nodes. Turn it off with `lazyInit.enabled: false`.
|
|
580
|
+
|
|
581
|
+
### Colours, superscript, subscript and annotations
|
|
582
|
+
|
|
583
|
+
Define a palette in the plugin configuration and turn the tools on per field in the Content-Type Builder (Advanced settings > Extra formatting). All of them are off by default.
|
|
584
|
+
|
|
585
|
+
```js
|
|
586
|
+
// config/plugins.js
|
|
587
|
+
'magic-editor-x': {
|
|
588
|
+
config: {
|
|
589
|
+
palette: {
|
|
590
|
+
colors: [{ name: 'accent', label: 'Accent', light: '#b3261e', dark: '#ffb4ab' }],
|
|
591
|
+
highlights: [{ name: 'note', label: 'Note', light: '#fff3b0', dark: '#5c4a00' }],
|
|
592
|
+
},
|
|
593
|
+
},
|
|
594
|
+
},
|
|
595
|
+
```
|
|
596
|
+
|
|
597
|
+
- **Text colour and highlight** (`inlineColors`): one **Colour** button (Ctrl/Cmd+Shift+7) with your tokens. Content stores the token name (`<span data-mex-color="accent">`, `<mark data-mex-highlight="note">`), never a colour or a style; the renderers add the classes `mex-color-<name>` and `mex-highlight-<name>`, which your site styles. Settings > Magic Editor X > Configuration shows the CSS to copy and lists combinations below 4.5:1 contrast; the quality rule `color-contrast` flags them in fields.
|
|
598
|
+
- **Superscript and subscript** (`inlineScript`): Ctrl/Cmd+. and Ctrl/Cmd+Shift+. (footnote markers are not affected).
|
|
599
|
+
- **Inline annotations** (`inlineAnnotations`, a comma list): the built-in `abbreviation` (Ctrl/Cmd+Shift+9) renders `<abbr title="…">`. Register your own in code with `registerInlineAnnotation` (`magic-editor-x/blocks`, see [Custom blocks in code (SDK)](#custom-blocks-in-code-sdk)), for example a glossary term whose definition is looked up when content is read.
|
|
600
|
+
|
|
601
|
+
### Private upload providers and dropped files
|
|
602
|
+
|
|
603
|
+
With a private upload provider (`isPrivate()`, for example a private S3 bucket), Magic Editor X stores each Media Library file with its id and its unsigned URL and signs it fresh on every Content API, GraphQL and `?mex=` read and in the editor. Content saved before 2.5 is updated once at startup; run `npx magic-editor-x media-file-ids` to see what would change and `--apply` to run it again. Public providers are not affected.
|
|
604
|
+
|
|
605
|
+
On Strapi 5.61 and later, drag images, videos or audio files onto a field: they are uploaded to the Media Library and inserted as blocks. Older Strapi versions keep the previous behaviour.
|
|
606
|
+
|
|
607
|
+
### Tools for AI clients (MCP)
|
|
608
|
+
|
|
609
|
+
With `mcp.enabled: true` and Strapi's own MCP server on (`server.mcp.enabled`), Magic Editor X adds the tools `mex_from_markdown`, `mex_from_html`, `mex_validate` and `mex_render`, one JSON Schema resource per preset and the prompt `mex_content_guide`. They only convert and check content; they read and write no entries. The admin token of the AI client needs the action `plugin::magic-editor-x.mcp.use`.
|
|
610
|
+
|
|
557
611
|
## Data format
|
|
558
612
|
|
|
559
613
|
The field stores an Editor.js document as JSON:
|
|
@@ -715,7 +769,7 @@ import { MagicEditorXContent } from 'magic-editor-x/react';
|
|
|
715
769
|
|
|
716
770
|
- Props: `value`, `options` (every option above) and `components` (per block type, receives `{ block, helpers, children }`; `children` is the default output). Vue also takes scoped slots `block-<type>`, which win over `components`.
|
|
717
771
|
- React 18 and 19, server rendering and React Server Components (the copy button needs a client component or `enhanceCodeBlocks()`); Vue 3.5 or later, also with Nuxt server rendering.
|
|
718
|
-
- Guides: [React](docs/guides/react.md), [Vue and Nuxt](docs/guides/vue-nuxt.md), [Astro](docs/guides/astro.md) (`renderHtml` with `set:html`, or the components as server-rendered islands, plus the CSS for line numbers and copy buttons).
|
|
772
|
+
- Guides: [React](https://github.com/Schero94/Magic-Editor-X/blob/main/docs/guides/react.md), [Vue and Nuxt](https://github.com/Schero94/Magic-Editor-X/blob/main/docs/guides/vue-nuxt.md), [Astro](https://github.com/Schero94/Magic-Editor-X/blob/main/docs/guides/astro.md) (`renderHtml` with `set:html`, or the components as server-rendered islands, plus the CSS for line numbers and copy buttons).
|
|
719
773
|
|
|
720
774
|
## Content API and GraphQL output
|
|
721
775
|
|
|
@@ -788,7 +842,7 @@ export const calloutCard = defineBlock({
|
|
|
788
842
|
- **Frontend:** pass `blocks: [calloutCard]` to `renderHtml`, `renderText`, `renderMarkdown` or the React/Vue components; give the definition a `render`, `text` or `markdown` function for your own output, or get a neutral default.
|
|
789
843
|
- Field types: `text`, `inline`, `url`, `enum`, `number`, `boolean`, `array`, `object`. `blockJsonSchema(definition)` returns the JSON Schema of the stored shape.
|
|
790
844
|
|
|
791
|
-
The full guide with the admin tool, field types and security notes is [docs/guides/custom-blocks-sdk.md](docs/guides/custom-blocks-sdk.md).
|
|
845
|
+
The full guide with the admin tool, field types and security notes is [docs/guides/custom-blocks-sdk.md](https://github.com/Schero94/Magic-Editor-X/blob/main/docs/guides/custom-blocks-sdk.md).
|
|
792
846
|
|
|
793
847
|
## Strapi AI translations and Releases
|
|
794
848
|
|
|
@@ -818,6 +872,7 @@ Both run only when your Strapi plan includes the feature; on a Community Edition
|
|
|
818
872
|
| `plugin::magic-editor-x.audit.read` | Read the audit trail (who changed what and when) | The Activity tab of a field (with Content Manager read), Settings > Audit trail (with `settings.read`) |
|
|
819
873
|
| `plugin::magic-editor-x.suggestions.create` | Suggest block changes (read access to the entry is enough; withdraw own) | Suggest mode, sending suggestions, withdrawing your own |
|
|
820
874
|
| `plugin::magic-editor-x.suggestions.review` | Review block suggestions (accept or reject; needs update access to the entry) | Accepting and rejecting suggestions (with Content Manager update) |
|
|
875
|
+
| `plugin::magic-editor-x.mcp.use` | Use the Magic Editor X tools of the MCP server | The MCP tools, resources and prompt; the admin token that calls Strapi's `/mcp` needs this action (2.5) |
|
|
821
876
|
|
|
822
877
|
Uploads also need the Media Library action `plugin::upload.assets.create`. Version history and collaboration also apply the Content Manager permissions of the document: read access (including conditions such as "is creator", locale and field permissions) to list versions and join a room, update access to save versions, restore and type. A document you cannot read answers 404, the same as a document that does not exist.
|
|
823
878
|
|
|
@@ -896,6 +951,13 @@ All routes are admin routes served at `/magic-editor-x/...` and need an admin se
|
|
|
896
951
|
| POST | `/magic-editor-x/settings/language-tool/test` | settings.read, settings.update | `{ languageTool: {...} }` | `{ data: { ok: true } }` |
|
|
897
952
|
| GET | `/magic-editor-x/audit` | audit.read (field: + Content Manager read, 404; all documents: + settings.read, 403) | `?uid&documentId&locale&field&fieldKey&actor&event&from&to&page&pageSize` (`pageSize` 1-100, default 25) | `{ data: [event], meta: { scope: 'field' \| 'global', enabled, pagination } }`, newest first (2.4) |
|
|
898
953
|
| GET | `/magic-editor-x/audit/actors` | audit.read, settings.read | | `{ data: [{ id, name }] }` (people in the trail, up to 200) |
|
|
954
|
+
| POST | `/magic-editor-x/presence` | access (+ Content Manager read) | `{ uid, documentId, locale?, tabId, idle?, leave? }` | `{ data: { enabled, softLock, canEdit, editors: [{ id, name, color, idle, live }] } }`; names only (2.5) |
|
|
955
|
+
| GET | `/magic-editor-x/entry-summary` | access (+ Content Manager read) | `?uid&documentId&locale` | `{ data: { fields, comments, quality, links } }`: open threads, issues and broken links per readable field (2.5) |
|
|
956
|
+
| GET | `/magic-editor-x/widgets/open-threads` | access, comments.read | `?pageSize` (1 to 20) | `{ data: [{ threadId, started, mentioned, excerpt, updatedAt, target }], meta: { more } }` (2.5 homepage widget) |
|
|
957
|
+
| GET | `/magic-editor-x/widgets/broken-links` | access | `?pageSize` (1 to 20) | `{ data: [{ problems, target }], meta: { enabled, lastRun, more, truncated } }` (2.5 homepage widget; entries you can read) |
|
|
958
|
+
| GET | `/magic-editor-x/reuse/types` | access | | `{ data: [{ uid, kind, displayName, localized, locales }] }`: types with an editor field and an entry you can read (2.5) |
|
|
959
|
+
| GET | `/magic-editor-x/reuse/source` | access (+ Content Manager read on document, locale and field) | `?uid&documentId&locale&field` | `{ data: { uid, documentId, locale, title, status: 'draft', fields: [{ field, fieldKey, preset, blockCount, truncated, blocks }] } }` (2.5) |
|
|
960
|
+
| POST | `/magic-editor-x/media/signed-urls` | access (+ Content Manager read when `target` is sent) | `{ target?, urls: string[1..100] }` | `{ data: { private, urls: { <url>: <signed url> } } }` (2.5, private upload providers) |
|
|
899
961
|
|
|
900
962
|
`upload` means `plugin::upload.assets.create`.
|
|
901
963
|
|
|
@@ -948,17 +1010,17 @@ Content-Type: application/json
|
|
|
948
1010
|
Link previews, images and media by URL and the link checks only fetch public http(s) addresses: the host is resolved once, every address must be public, the connection is pinned to that address, redirects are re-checked (at most 3), and size, type and time are limited. AI and LanguageTool base URLs must be public https URLs unless `ai.allowPrivateBaseUrl` or `languageTool.allowPrivateBaseUrl` is on; origins on private networks need `qualityChecks.externalLinks.allowPrivateOrigins` (link checks), `uploads.allowPrivateOrigins` (images and media by URL) or `ai.altText.allowPrivateOrigins` (alt text images); redirects from them are never followed.
|
|
949
1011
|
|
|
950
1012
|
- **Uploads** are checked by their first bytes (not by the file name or the browser's MIME type) and stored through the Media Library with the admin as creator.
|
|
951
|
-
- **Collaboration:** tokens are signed, bound to admin, document, locale and field, expire after `collaboration.tokenTtlSeconds` and work once on any process; the socket accepts the admin and server origins and `collaboration.allowedOrigins` and only clients of the current protocol; every update is checked (allowed structures only, no prototype keys, dependencies present, touched blocks valid) before it is stored or relayed, and a socket that keeps sending invalid updates is closed; names and colours of other people come from the server, never from a client; remote content is sanitised before the editor renders it; updates, sessions, sockets and rooms per admin are rate limited; viewers cannot write. See [docs/security-audit-2.1.md](
|
|
1013
|
+
- **Collaboration:** tokens are signed, bound to admin, document, locale and field, expire after `collaboration.tokenTtlSeconds` and work once on any process; the socket accepts the admin and server origins and `collaboration.allowedOrigins` and only clients of the current protocol; every update is checked (allowed structures only, no prototype keys, dependencies present, touched blocks valid) before it is stored or relayed, and a socket that keeps sending invalid updates is closed; names and colours of other people come from the server, never from a client; remote content is sanitised before the editor renders it; updates, sessions, sockets and rooms per admin are rate limited; viewers cannot write. See [docs/security-audit-2.1.md](https://github.com/Schero94/Magic-Editor-X/blob/main/docs/security-audit-2.1.md).
|
|
952
1014
|
- **Field presets** are enforced on the server (save middleware and realtime guard), not only in the editor; see [Field presets](#field-presets).
|
|
953
|
-
- **Paste, import and rendering:** pasted and imported HTML/Markdown is parsed into an inert document and rebuilt from the editor's own tags only, then sanitised again on save; `magic-editor-x/render` re-parses stored inline HTML and never trusts it. The link check fetches external URLs only when the owner turns it on, through the SSRF-protected fetcher, rate limited, without logging URLs. See [docs/security-audit-2.2.md](
|
|
1015
|
+
- **Paste, import and rendering:** pasted and imported HTML/Markdown is parsed into an inert document and rebuilt from the editor's own tags only, then sanitised again on save; `magic-editor-x/render` re-parses stored inline HTML and never trusts it. The link check fetches external URLs only when the owner turns it on, through the SSRF-protected fetcher, rate limited, without logging URLs. See [docs/security-audit-2.2.md](https://github.com/Schero94/Magic-Editor-X/blob/main/docs/security-audit-2.2.md).
|
|
954
1016
|
- **Content API and GraphQL output (2.3):** `?mex=` and the GraphQL fields resolve internal links, mentions, embedded entries, media and synced blocks with the caller's own permissions (`find` on the target type, upload `find` for media), read published versions unless the request asks for drafts, and pass every row through Strapi's output sanitising. Targets the caller may not read are handled like missing ones, so the output reveals neither their existence nor their titles or slugs. Without `?mex` the response is the stored value, which still carries stored hrefs and embedded-entry snapshots, as in 2.2.
|
|
955
1017
|
- **React and Vue components (2.3)** use the same render tree as `renderHtml`; text is rendered as text and raw HTML only through your `sanitizeRaw`. The XSS corpus is rendered through all three outputs in the tests.
|
|
956
1018
|
- **Comments, templates and synced blocks (2.3):** comment routes check the plugin actions and Content Manager read on the document, locale and field (404 otherwise); admin ids are never returned; comment text is plain text. Templates and synced sources are cleaned with the field sanitiser on every write and filtered by the field preset when inserted or expanded; a synced source cannot contain another synced block. Synced sources have no Draft & Publish, so an edit is live in published output at once.
|
|
957
|
-
- **2.4 surfaces:** field keys come from the server, are checked against the stored draft and never decide access on their own; legacy rows are mapped only on block-id evidence and are otherwise read-only. Table merges, alignment and captions are validated and bounded on save and on the live channel. Math is rendered by Temml with `trust: false` and every renderer passes MathML through an allow-list (no links, styles, ids or event handlers); footnote notes follow the inline policy. Comment anchors, mentions and notifications are checked server-side (Content Manager read on the field for every mentioned person, ids only in notification rows, e-mails without comment text and with header-safe names). Suggestions are sanitised and preset-checked, decided once (conditional updates) and need update access to accept. The audit trail holds no content. AI translations by Strapi receive only text. See [docs/security-audit-2.4.md](
|
|
1019
|
+
- **2.4 surfaces:** field keys come from the server, are checked against the stored draft and never decide access on their own; legacy rows are mapped only on block-id evidence and are otherwise read-only. Table merges, alignment and captions are validated and bounded on save and on the live channel. Math is rendered by Temml with `trust: false` and every renderer passes MathML through an allow-list (no links, styles, ids or event handlers); footnote notes follow the inline policy. Comment anchors, mentions and notifications are checked server-side (Content Manager read on the field for every mentioned person, ids only in notification rows, e-mails without comment text and with header-safe names). Suggestions are sanitised and preset-checked, decided once (conditional updates) and need update access to accept. The audit trail holds no content. AI translations by Strapi receive only text. See [docs/security-audit-2.4.md](https://github.com/Schero94/Magic-Editor-X/blob/main/docs/security-audit-2.4.md).
|
|
958
1020
|
- **Secrets:** the AI key and the LanguageTool key are encrypted with AES-256-GCM (random IV, versioned format, separate key derivation per purpose) and never returned. Changing the AI provider or base URL, or the LanguageTool base URL or user name, requires entering the key again, so a stored key cannot be sent to another host.
|
|
959
1021
|
- **Logs** contain operation names and error codes only, never content, URLs with queries, tokens, user ids or email addresses.
|
|
960
1022
|
- **Stored data:** custom block definitions, versions (field content and the admin who saved it), live rooms (Yjs updates, removed `collaboration.roomTtlMinutes` after the last person left), presence rows (admin display name, colour, caret position; removed when the socket closes or after missed heartbeats), comments (text, author id and display name; deleted with the document locale, anonymised when the admin is deleted), templates, patterns and synced sources (with the creator's display name) and their versions (with the saver's name), suggestions (proposed blocks, author and decider names; deleted with the document locale, anonymised when the admin is deleted), notifications (ids only), the audit trail (event, target, counts, block ids, admin id and name; pruned after `audit.retentionDays`) and, with the scheduled link check, the external URLs of editor fields with their last status.
|
|
961
|
-
- **Reviews:** [docs/security-audit-2.4.md](
|
|
1023
|
+
- **Reviews:** [docs/security-audit-2.4.md](https://github.com/Schero94/Magic-Editor-X/blob/main/docs/security-audit-2.4.md) covers every 2.4 surface (findings MEX-24-01 to MEX-24-18), [docs/security-audit-2.3.md](https://github.com/Schero94/Magic-Editor-X/blob/main/docs/security-audit-2.3.md) every 2.3 surface (MEX-23-01 to MEX-23-15), each with controls, tests and residual risks.
|
|
962
1024
|
- **Content Security Policy:** Editor.js and the Design System add inline styles, which Strapi's default `style-src 'unsafe-inline'` allows. The socket connects to the same origin as the admin, which `connect-src 'self'` covers; add the `wss:` origin only when the admin runs on another host. Embeds and external images in the editor preview need `frame-src` and `img-src` sources; see [Content Security Policy](#content-security-policy) below.
|
|
963
1025
|
|
|
964
1026
|
Report vulnerabilities privately through GitHub security advisories on the repository.
|
|
@@ -1042,6 +1104,22 @@ Add only the services you use. Instead of `https:` in `img-src` you can list you
|
|
|
1042
1104
|
| Mention e-mails do not arrive | `comments.notifications.email` is off, the Strapi email plugin has no working provider, or the hourly limit per person was reached | Turn it on, configure the email provider (Settings > Configuration shows whether e-mails are on). |
|
|
1043
1105
|
| Settings > Audit trail answers 403 | Listings across documents need `settings.read` next to `audit.read` | Grant both, or use the Activity tab of a field. |
|
|
1044
1106
|
|
|
1107
|
+
## Upgrading from 2.4
|
|
1108
|
+
|
|
1109
|
+
2.5 is a minor release. Stored content, routes and configuration keep working; there are no breaking changes.
|
|
1110
|
+
|
|
1111
|
+
1. Update and rebuild the admin: `npm install magic-editor-x@latest && npm run build`.
|
|
1112
|
+
2. Nothing else is required. New features are off by default or appear only when they are relevant: the entry panel shows only when there is something to show, local drafts only when there is something to restore, colours and annotations only in fields that turn them on, MCP only with `mcp.enabled: true`.
|
|
1113
|
+
3. Optional: `presence.softLock: true`, a `palette`, the new action `plugin::magic-editor-x.mcp.use` for admin tokens of AI clients (no role gets it automatically).
|
|
1114
|
+
|
|
1115
|
+
What changes for existing data and clients:
|
|
1116
|
+
|
|
1117
|
+
- With a private upload provider, media in Magic Editor X values gets a `fileId` once at startup (migration `2.5.0-media-file-ids`, idempotent; `npx magic-editor-x media-file-ids [--apply]`) and Content API output carries freshly signed URLs. Stored values never contain signatures.
|
|
1118
|
+
- Fields start when they come near the screen. Scripts and tests that wait for `[data-mex-ready="true"]` must scroll the field into view first, or run with `lazyInit.enabled: false`.
|
|
1119
|
+
- Mention e-mails use the recipient's admin language.
|
|
1120
|
+
- A field emptied and saved keeps its `fieldKey` (the value stays `null`), and discarding a draft whose published version predates 2.4 keeps the keys.
|
|
1121
|
+
- Editor.js stays at 2.31.7.
|
|
1122
|
+
|
|
1045
1123
|
## Upgrading from 2.3
|
|
1046
1124
|
|
|
1047
1125
|
2.4 is a minor release. Stored content, routes and configuration keep working; there are no breaking changes.
|
|
@@ -1072,7 +1150,7 @@ A custom block named `toc`, `gallery`, `video`, `audio`, `synced` or `mention` t
|
|
|
1072
1150
|
|
|
1073
1151
|
## Migrating from 1.x
|
|
1074
1152
|
|
|
1075
|
-
2.0 is a major release. Stored content keeps working; routes, permissions and configuration changed. The full guide is in the [CHANGELOG](
|
|
1153
|
+
2.0 is a major release. Stored content keeps working; routes, permissions and configuration changed. The full guide is in the [CHANGELOG](https://github.com/Schero94/Magic-Editor-X/blob/main/CHANGELOG.md). In short:
|
|
1076
1154
|
|
|
1077
1155
|
1. Update the package and rebuild the admin: `npm install magic-editor-x@2 && npm run build`.
|
|
1078
1156
|
2. Remove 1.x configuration keys (`enabledTools`, `linkPreviewTimeout`, `maxImageSize`, `maxFileSize`, `allowedImageTypes`, `collaboration.wsPath`, `wsUrl`, `sessionTTL`, `allowedAdminRoles`, `allowedAdminUserIds`, `cors`) and use the new keys above.
|
|
@@ -1095,7 +1173,7 @@ npm run verify
|
|
|
1095
1173
|
MEX_HOST_URL=http://127.0.0.1:1421 MEX_CREDS=/path/to/creds.json npm run test:integration
|
|
1096
1174
|
```
|
|
1097
1175
|
|
|
1098
|
-
[docs/engine-decision.md](
|
|
1176
|
+
[docs/engine-decision.md](https://github.com/Schero94/Magic-Editor-X/blob/main/docs/engine-decision.md) records why the plugin stays on Editor.js for 2.x. [CONTRIBUTING.md](https://github.com/Schero94/Magic-Editor-X/blob/main/CONTRIBUTING.md) explains the isolated acceptance host, the integration suite on SQLite and PostgreSQL and the multi-process acceptance run. [AGENTS.md](https://github.com/Schero94/Magic-Editor-X/blob/main/AGENTS.md) is the contract for coding agents.
|
|
1099
1177
|
|
|
1100
1178
|
## Maintenance status
|
|
1101
1179
|
|
|
@@ -1107,4 +1185,4 @@ The admin is translated into English, German (formal Sie), French, Spanish and P
|
|
|
1107
1185
|
|
|
1108
1186
|
## License
|
|
1109
1187
|
|
|
1110
|
-
[MIT](
|
|
1188
|
+
[MIT](https://github.com/Schero94/Magic-Editor-X/blob/main/LICENSE) © 2025-2026 Schero D.
|
package/bin/magic-editor-x.mjs
CHANGED
|
@@ -3,11 +3,14 @@
|
|
|
3
3
|
* Magic Editor X command line.
|
|
4
4
|
*
|
|
5
5
|
* npx magic-editor-x migrate --uid api::article.article --from body --to content [--apply]
|
|
6
|
+
* npx magic-editor-x media-file-ids [--apply] (2.5)
|
|
6
7
|
*
|
|
7
8
|
* Run it from the root of the Strapi project. It loads the project with
|
|
8
9
|
* Strapi's programmatic API (compileStrapi, createStrapi().load(), destroy()),
|
|
9
10
|
* without starting the HTTP server, runs the plugin's `migrate` service and
|
|
10
11
|
* prints the report. Without `--apply` nothing is written (dry run).
|
|
12
|
+
* `media-file-ids` runs the plugin's `media` service `migrateFileIds`
|
|
13
|
+
* (the 2.5 migration, re-runnable).
|
|
11
14
|
*/
|
|
12
15
|
|
|
13
16
|
import { createRequire } from 'node:module';
|
|
@@ -36,7 +39,14 @@ Options:
|
|
|
36
39
|
--out <file> Also write the JSON report to a file
|
|
37
40
|
-h, --help Show this help
|
|
38
41
|
|
|
39
|
-
Exit code 1 when an option is invalid or a document failed
|
|
42
|
+
Exit code 1 when an option is invalid or a document failed.
|
|
43
|
+
|
|
44
|
+
Usage: magic-editor-x media-file-ids [--apply] [--json] [--batch <n>]
|
|
45
|
+
|
|
46
|
+
Links the Media Library files of every Magic Editor X field (image, gallery,
|
|
47
|
+
video, audio, poster, track and attachment files) to their Media Library
|
|
48
|
+
entry by URL, and removes stored signatures of a private upload provider.
|
|
49
|
+
Safe to run again; without --apply nothing is written (dry run).`;
|
|
40
50
|
|
|
41
51
|
/**
|
|
42
52
|
* Parses and validates the command line.
|
|
@@ -65,14 +75,25 @@ export const parseCommand = (argv) => {
|
|
|
65
75
|
},
|
|
66
76
|
});
|
|
67
77
|
if (values.help) return { help: true };
|
|
68
|
-
if (positionals.length !== 1 || positionals[0] !== 'migrate')
|
|
69
|
-
throw new Error('Unknown command (expected "migrate")');
|
|
70
|
-
for (const name of ['uid', 'from', 'to']) if (!values[name]) throw new Error(`--${name} is required`);
|
|
71
78
|
const integer = (name) => {
|
|
72
79
|
if (values[name] === undefined) return undefined;
|
|
73
80
|
if (!/^\d{1,7}$/.test(values[name])) throw new Error(`--${name} must be a positive integer`);
|
|
74
81
|
return Number(values[name]);
|
|
75
82
|
};
|
|
83
|
+
if (positionals.length === 1 && positionals[0] === 'media-file-ids') {
|
|
84
|
+
for (const name of ['uid', 'from', 'to', 'format', 'locale', 'overwrite', 'limit', 'out'])
|
|
85
|
+
if (values[name] !== undefined) throw new Error(`--${name} is not an option of media-file-ids`);
|
|
86
|
+
const batch = integer('batch');
|
|
87
|
+
return {
|
|
88
|
+
help: false,
|
|
89
|
+
command: 'media-file-ids',
|
|
90
|
+
json: Boolean(values.json),
|
|
91
|
+
options: { dryRun: !values.apply, ...(batch !== undefined ? { batchSize: batch } : {}) },
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
if (positionals.length !== 1 || positionals[0] !== 'migrate')
|
|
95
|
+
throw new Error('Unknown command (expected "migrate" or "media-file-ids")');
|
|
96
|
+
for (const name of ['uid', 'from', 'to']) if (!values[name]) throw new Error(`--${name} is required`);
|
|
76
97
|
const options = {
|
|
77
98
|
uid: values.uid,
|
|
78
99
|
from: values.from,
|
|
@@ -89,6 +110,26 @@ export const parseCommand = (argv) => {
|
|
|
89
110
|
return { help: false, json: Boolean(values.json), out: values.out, options };
|
|
90
111
|
};
|
|
91
112
|
|
|
113
|
+
/**
|
|
114
|
+
* Formats a media file id report for people (2.5).
|
|
115
|
+
* @param {object} report - `media.migrateFileIds` report.
|
|
116
|
+
* @returns {string} Text.
|
|
117
|
+
*/
|
|
118
|
+
export const formatMediaReport = (report) => {
|
|
119
|
+
const lines = [
|
|
120
|
+
`${report.dryRun ? 'Dry run' : 'Migration'}: Media Library file ids`,
|
|
121
|
+
` models ${report.models}`,
|
|
122
|
+
` rows scanned ${report.scanned}`,
|
|
123
|
+
` ${report.dryRun ? 'would change' : 'changed '} ${report.changedValues}`,
|
|
124
|
+
` files linked ${report.linked}`,
|
|
125
|
+
` signatures removed ${report.unsigned}`,
|
|
126
|
+
` not in library ${report.unmatched}`,
|
|
127
|
+
` failed ${report.failed}`,
|
|
128
|
+
];
|
|
129
|
+
if (report.dryRun) lines.push('Nothing was written. Run again with --apply to write.');
|
|
130
|
+
return lines.join('\n');
|
|
131
|
+
};
|
|
132
|
+
|
|
92
133
|
/**
|
|
93
134
|
* Formats a report for people.
|
|
94
135
|
* @param {object} report - Migration report.
|
|
@@ -153,10 +194,16 @@ export const main = async (argv) => {
|
|
|
153
194
|
throw Object.assign(new Error('Magic Editor X is not installed in this project'), {
|
|
154
195
|
code: 'NO_PLUGIN',
|
|
155
196
|
});
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
197
|
+
if (command.command === 'media-file-ids') {
|
|
198
|
+
const report = await plugin.service('media').migrateFileIds(command.options);
|
|
199
|
+
print(`${command.json ? JSON.stringify(report, null, 2) : formatMediaReport(report)}\n`);
|
|
200
|
+
code = report.failed > 0 ? 1 : 0;
|
|
201
|
+
} else {
|
|
202
|
+
const report = await plugin.service('migrate').run(command.options);
|
|
203
|
+
if (command.out) writeFileSync(command.out, `${JSON.stringify(report, null, 2)}\n`);
|
|
204
|
+
print(`${command.json ? JSON.stringify(report, null, 2) : formatReport(report)}\n`);
|
|
205
|
+
code = report.failed.length > 0 ? 1 : 0;
|
|
206
|
+
}
|
|
160
207
|
} catch (error) {
|
|
161
208
|
process.stderr.write(`${error && error.message ? error.message : 'Migration failed'}\n`);
|
|
162
209
|
code = 1;
|