magic-editor-x 2.0.0 → 2.2.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/CHANGELOG.md +107 -0
- package/README.md +315 -103
- package/bin/magic-editor-x.mjs +190 -0
- package/dist/admin/{ConfigurationPage-DvAifELO.mjs → ConfigurationPage-3Dir3dAf.mjs} +126 -7
- package/dist/admin/{ConfigurationPage-B1uCIE3J.js → ConfigurationPage-YvnPnna6.js} +125 -4
- package/dist/admin/{CustomBlocksPage-6eWCOreU.js → CustomBlocksPage-BiiL2ORG.js} +4 -4
- package/dist/admin/{CustomBlocksPage-6-OQwpXQ.mjs → CustomBlocksPage-CR2BaP9O.mjs} +4 -4
- package/dist/admin/EditorField-B8pyAxPE.mjs +11935 -0
- package/dist/admin/EditorField-Diq1j8kc.js +11970 -0
- package/dist/admin/{api-B-RsxJCs.js → api-Dsq53giv.js} +3 -0
- package/dist/admin/{api-C4XsDZxd.mjs → api-RZ0Fz0BD.mjs} +3 -0
- package/dist/admin/de-62Vxb2iw.js +250 -0
- package/dist/admin/de-BVvwSYYO.mjs +250 -0
- package/dist/admin/de-BmmLBJli.mjs +41 -0
- package/dist/admin/{de-BMxADn2Z.mjs → de-Bt6pYIWi.mjs} +16 -1
- package/dist/admin/{de-DcDPRzV4.js → de-BteRx2iA.js} +28 -1
- package/dist/admin/{de-n5V6c5RT.mjs → de-CFX5atOk.mjs} +28 -1
- package/dist/admin/{de-Dx7vUW0Z.js → de-CVbi685U.js} +16 -1
- package/dist/admin/de-DaJwN6nk.js +41 -0
- package/dist/admin/{en-sNn4z9lA.js → en-BX362fTp.js} +16 -1
- package/dist/admin/{en-BQ5Pxe2o.mjs → en-B_HltUxZ.mjs} +16 -1
- package/dist/admin/en-Cg2Ak5Cr.mjs +250 -0
- package/dist/admin/en-Cn78RZs-.js +41 -0
- package/dist/admin/{en-D-DGftl0.js → en-CyjAcccB.js} +28 -1
- package/dist/admin/en-D7mZWLGp.mjs +41 -0
- package/dist/admin/en-VlkaIzrM.js +250 -0
- package/dist/admin/{en-BqNm3nMQ.mjs → en-ea0tfA5i.mjs} +28 -1
- package/dist/admin/es-BT9oAcHf.js +250 -0
- package/dist/admin/es-BmGtLkJD.js +41 -0
- package/dist/admin/{es-Di0pyQCh.js → es-C8GZFGjv.js} +28 -1
- package/dist/admin/es-C9-cXdb6.mjs +250 -0
- package/dist/admin/{es-SzeTV4q8.mjs → es-CEi_ycX8.mjs} +28 -1
- package/dist/admin/{es-DVsXnS0N.js → es-CHHEZi44.js} +16 -1
- package/dist/admin/{es-B6NYq0VH.mjs → es-CrhwOq-5.mjs} +16 -1
- package/dist/admin/es-joykG5I9.mjs +41 -0
- package/dist/admin/{fr-DmG3_Cn-.mjs → fr-5djKfQ3s.mjs} +16 -1
- package/dist/admin/{fr-Fwxcj4SM.js → fr-B3SL0TBV.js} +16 -1
- package/dist/admin/{fr-DhgPYHIH.mjs → fr-BAMSvQbR.mjs} +28 -1
- package/dist/admin/fr-CrzxGe5e.mjs +41 -0
- package/dist/admin/fr-Ct_uPqxV.js +41 -0
- package/dist/admin/fr-D6KJqPWi.js +250 -0
- package/dist/admin/fr-DpU_qiXR.mjs +250 -0
- package/dist/admin/{fr-D6F--jIB.js → fr-oRCJNdeJ.js} +28 -1
- package/dist/admin/index-C-lyON1B.mjs +303 -0
- package/dist/admin/index-iA0lued_.js +302 -0
- package/dist/admin/index.js +1 -1
- package/dist/admin/index.mjs +1 -1
- package/dist/admin/pt-BOrl6x-r.js +250 -0
- package/dist/admin/{pt-BbdwHlWF.mjs → pt-BdnY2Cth.mjs} +16 -1
- package/dist/admin/{pt-BvSl1btT.mjs → pt-CQrfqsCN.mjs} +28 -1
- package/dist/admin/{pt-C6nr71Yw.js → pt-EVwCuBUK.js} +16 -1
- package/dist/admin/pt-Ga-4Hsv0.mjs +41 -0
- package/dist/admin/pt-chN2jrXl.js +41 -0
- package/dist/admin/pt-jUqOR7Xh.mjs +250 -0
- package/dist/admin/{pt-BPo0ex21.js → pt-tUeJ2Ywd.js} +28 -1
- package/dist/admin/{sanitize-9UVcXFfc.js → sanitize-Cb4jvBhj.js} +88 -12
- package/dist/admin/{sanitize-D4kfZ_ly.mjs → sanitize-ClkX823p.mjs} +89 -13
- package/dist/admin/{useT-B5M49wGH.js → useT-BWZ_-Hel.js} +1 -1
- package/dist/admin/{useT-CjX6fL2m.mjs → useT-pvHmgBFj.mjs} +1 -1
- package/dist/render/index.d.mts +75 -0
- package/dist/render/index.d.ts +75 -0
- package/dist/render/index.js +1420 -0
- package/dist/render/index.mjs +1398 -0
- package/dist/server/index.js +9562 -589
- package/dist/server/index.mjs +9565 -592
- package/package.json +21 -4
- package/schema/magic-editor-x.schema.json +967 -0
- package/types/index.d.ts +211 -0
- package/types/render.d.ts +75 -0
- package/dist/admin/EditorField-DocyD2Q3.js +0 -5506
- package/dist/admin/EditorField-ThSoOCPm.mjs +0 -5471
- package/dist/admin/de-B8XFFhHh.js +0 -95
- package/dist/admin/de-DBR893G4.js +0 -13
- package/dist/admin/de-RAxzvrwm.mjs +0 -95
- package/dist/admin/de-fBFh09Wl.mjs +0 -13
- package/dist/admin/en-BzfyifEU.mjs +0 -95
- package/dist/admin/en-D9Nfccux.mjs +0 -13
- package/dist/admin/en-DcWUTE2J.js +0 -95
- package/dist/admin/en-gueRT44P.js +0 -13
- package/dist/admin/es-B0Zy8DVg.mjs +0 -13
- package/dist/admin/es-BOtVc9qv.js +0 -95
- package/dist/admin/es-C2OJVYkV.mjs +0 -95
- package/dist/admin/es-DRGs7meF.js +0 -13
- package/dist/admin/fr-B8rdLAIL.js +0 -13
- package/dist/admin/fr-Bpo5Uq1f.mjs +0 -95
- package/dist/admin/fr-DfxKaOc_.js +0 -95
- package/dist/admin/fr-oiUb2bb_.mjs +0 -13
- package/dist/admin/index-CwfaB5-e.js +0 -155
- package/dist/admin/index-D1Q5Rlt6.mjs +0 -156
- package/dist/admin/pt-B3Jce6uT.mjs +0 -13
- package/dist/admin/pt-BiWuSBcH.js +0 -13
- package/dist/admin/pt-DqCXuI4S.mjs +0 -95
- package/dist/admin/pt-LCvjwk0y.js +0 -95
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,112 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
# [2.2.0](https://github.com/Schero94/Magic-Editor-X/compare/v2.1.0...v2.2.0) (2026-11-12)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Features
|
|
7
|
+
|
|
8
|
+
* field presets, renderers, paste cleanup, versions diff and quality checks ([#5](https://github.com/Schero94/Magic-Editor-X/issues/5)) ([583b86b](https://github.com/Schero94/Magic-Editor-X/commit/583b86b0f1a3eccbcc43099cd09c025f1e21f670))
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
Magic Editor X 2.2 makes one editor fit every field and every frontend: per-field presets enforced on the server, renderers with a published schema and types, clean paste and migrations, faster writing, version comparison and quality checks. No migration is needed; stored content keeps the same Editor.js JSON.
|
|
12
|
+
|
|
13
|
+
### Highlights
|
|
14
|
+
|
|
15
|
+
- **Field presets.** Each field gets its own rules in the Content-Type Builder: a preset (`full`, `article`, `basic`, `minimal`), allowed blocks and heading levels, block and character limits, required alternative text, allowed links (entries, web addresses, both or none), AI and live collaboration on or off, and a publishing guard. They are enforced on every save (Content Manager, Content API, imports, code) and over the live channel, not only in the editor. Content that no longer fits is listed with **Fix automatically**, and the Content Manager shows the reason on the field.
|
|
16
|
+
- **Render anywhere.** `magic-editor-x/render` renders stored content to HTML, plain text or Markdown in Node, browsers and edge runtimes, without dependencies and safe against XSS even for content that skipped the sanitiser; internal links can follow slug changes at render time, images get responsive `srcset` from the Media Library. `magic-editor-x/schema` (JSON Schema) and `magic-editor-x/types` (TypeScript) describe the stored data.
|
|
17
|
+
- **Paste and migrate.** Word, Google Docs, LibreOffice, web pages and Markdown paste as real blocks (headings, nested lists, checklists, tables, code, links), with images copied into the Media Library. `npx magic-editor-x migrate` converts Strapi Blocks, Markdown and HTML fields (dry run first, idempotent, report without content).
|
|
18
|
+
- **Write faster.** Markdown shortcuts, find and replace (regular expressions optional), a keyboard shortcut help (Ctrl/Cmd+/), focus mode, actions for several selected blocks (move, duplicate, delete, convert, copy as Markdown), characters and reading time with the field's limits, `lang` and right-to-left direction from the content locale.
|
|
19
|
+
- **Media.** Alternative text and "decorative image" on image blocks, required when the field asks for it; images keep their Media Library id and formats.
|
|
20
|
+
- **Versions.** Named versions, a comparison of any version with the current content (blocks and words, moves and formatting-only changes) and restore of a single block.
|
|
21
|
+
- **Quality checks.** An accessibility lint (alternative texts, heading order, link texts in five languages, table headers, contrast of custom colours) and a link check (internal entries with your permissions, Media Library files, external links only when the owner turns it on), with an optional publishing guard.
|
|
22
|
+
|
|
23
|
+
### Added
|
|
24
|
+
|
|
25
|
+
- Custom field options `preset`, `allowedBlocks`, `headingLevels`, `maxBlocks`, `maxCharacters`, `requireAlt`, `linkTargets`, `disableAi`, `disableCollaboration`, `publishGuard`.
|
|
26
|
+
- Package exports `magic-editor-x/render`, `magic-editor-x/schema`, `magic-editor-x/types`; the `magic-editor-x` CLI (`migrate`); services `migrate` (`run`) and `links.resolveHrefs`.
|
|
27
|
+
- Admin routes `PUT /magic-editor-x/history/:id` (rename a version) and `POST /magic-editor-x/quality/links`; `POST /history` accepts `label`; versions return `label`; `GET /config` returns `data.quality.externalLinks`.
|
|
28
|
+
- Config keys `qualityChecks.externalLinks` (`enabled` false, `timeoutMs` 5000, `perMinute` 30) and `collaboration.compaction` (`enabled` true, `idleSeconds` 60, `minBytes` 262144, `ratio` 4, `checkIntervalSeconds` 30).
|
|
29
|
+
- Stored data: `image.data.decorative`, `simpleImage.data.alt` and `simpleImage.data.decorative` (optional).
|
|
30
|
+
- Dependencies `marked` and `htmlparser2` (maintained; bundled into the server build).
|
|
31
|
+
|
|
32
|
+
### Changed
|
|
33
|
+
|
|
34
|
+
- `POST /magic-editor-x/ai/:action` requires `target: { uid, field }` (the field the text comes from); the admin sends it. Scripts that call this admin route directly must add it.
|
|
35
|
+
- Validation errors of Magic Editor X fields carry `details.errors` with the field path (next to `details.code`), so the Content Manager shows them on the field.
|
|
36
|
+
- Long-lived live rooms are rebuilt as a new generation when they are idle and much larger than their content; open editors switch without reconnecting.
|
|
37
|
+
|
|
38
|
+
### Fixed
|
|
39
|
+
|
|
40
|
+
- Internal links lost their entry reference (`data-mex-uid`) when content was shown again in the editor, so the next save stored a plain link (since 2.1).
|
|
41
|
+
- Opening a long document in a new live room froze the tab (about 40 s with 2,000 blocks); typing now stays responsive (25 keystrokes in under a second).
|
|
42
|
+
- An edit typed into a block that someone replaced at the same moment was acknowledged but not stored, and that editor's later edits did not reach other processes.
|
|
43
|
+
- Re-applying unsent edits after a room reset could drop or garble concurrent remote edits.
|
|
44
|
+
- `embed.service` and `codeFlask.language` only keep strings.
|
|
45
|
+
- The history dialog footer wraps at narrow widths; "Save current version" no longer overflows its button at 320 px (contrast finding of 2.1).
|
|
46
|
+
- The Content Manager no longer throws while showing a Magic Editor X validation error.
|
|
47
|
+
|
|
48
|
+
### Security
|
|
49
|
+
|
|
50
|
+
- See [docs/security-audit-2.2.md](./docs/security-audit-2.2.md): paste and import (MEX-22-01), renderers (MEX-22-02), server-side presets (MEX-22-03), AI per field (MEX-22-04), link check SSRF and existence leaks (MEX-22-05), migration (MEX-22-06), versions (MEX-22-07), internal-link integrity (MEX-22-08), lost edits (MEX-22-09), long documents (MEX-22-10).
|
|
51
|
+
|
|
52
|
+
### Migration
|
|
53
|
+
|
|
54
|
+
- No action needed. Rebuild the admin (`npm run build`) after updating. Fields without the new options behave as before (`full`).
|
|
55
|
+
|
|
56
|
+
# [2.1.0](https://github.com/Schero94/Magic-Editor-X/compare/v2.0.0...v2.1.0) (2026-11-11)
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
### Features
|
|
60
|
+
|
|
61
|
+
* conflict-free structured collaboration, presence and hardened realtime (2.1.0) ([#4](https://github.com/Schero94/Magic-Editor-X/issues/4)) ([edc2fac](https://github.com/Schero94/Magic-Editor-X/commit/edc2face5e1da174de8d95c86480792b411de86a))
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
Magic Editor X 2.1 makes live collaboration conflict-free for every kind of block, adds presence with carets, hardens the realtime server and closes the remaining limitations of 2.0. No migration is needed; stored content keeps the same Editor.js JSON.
|
|
65
|
+
|
|
66
|
+
### Highlights
|
|
67
|
+
|
|
68
|
+
- **Conflict-free structured collaboration.** Every table cell, list item, checklist entry, tune (alignment, text variant, indent) and custom block field is merged separately (collaboration schema 3). Two people can edit different cells of one table, different items of one list, or the text and alignment of one paragraph at the same time and both changes are kept. Same-value conflicts resolve the same way on every screen.
|
|
69
|
+
- **Presence.** Coloured carets and selections of the others, an "editing this block" marker, avatars with first name and last initial (never e-mail addresses), away state, polite screen-reader announcements of joins and leaves, light and dark theme, reduced motion respected.
|
|
70
|
+
- **Robust connections.** Offline editing with automatic resync, exponential backoff with jitter, immediate reconnect after sleep, tab switch or network return, no duplicated content after a reconnect or a room reset, clean leave on tab close, new states Reconnecting and Offline in the toolbar.
|
|
71
|
+
- **Per-user undo.** Undo and redo during live editing only revert your own changes.
|
|
72
|
+
- **Permission changes apply within about a second** on every process (role, permission and user changes); losing update access makes the editor read-only, losing read access ends live editing.
|
|
73
|
+
- **Hardened realtime server.** Every update is checked before it is stored or relayed (allowed structures only, dependencies present, valid blocks), remote content is sanitised before the editor renders it, rate limits per socket and per admin, protocol version check.
|
|
74
|
+
- **No lost work.** Rooms that are cleaned up with edits nobody saved get a final version first.
|
|
75
|
+
- **Cluster-wide limits.** The AI rate limit and the new session limit are shared by all processes.
|
|
76
|
+
- **Content Security Policy notice.** Settings > Magic Editor X > Configuration shows when the admin CSP blocks editor embeds (`frame-src`) or external images (`img-src`), with a ready-to-copy `config/middlewares.js` snippet. The plugin never changes the CSP. Blocked embeds and images show an accessible placeholder in the editor instead of a broken frame.
|
|
77
|
+
- **Internal links.** "Link to an entry" in the link tool searches entries of your content types and inserts a link; only types and entries you can read in the Content Manager appear. No paid add-on is needed.
|
|
78
|
+
|
|
79
|
+
### Added
|
|
80
|
+
|
|
81
|
+
- Admin routes `GET /magic-editor-x/links/types` and `GET /magic-editor-x/links/search`.
|
|
82
|
+
- `GET /magic-editor-x/settings` returns `data.environment.csp` (`active`, `frameSrcMissing`, `imgSrcMissing`, `snippet`).
|
|
83
|
+
- Config keys `collaboration.maxConnectionsPerAdmin` (20), `collaboration.maxRoomsPerAdmin` (20), `collaboration.revalidateSeconds` (60), `collaboration.rateLimit` (`sessionsPerMinute` 60, `updatesPer10s` 300, `bytesPer10s` 8 MiB) and `links.urlPattern` (placeholders `{documentId}`, `{locale}`, `{slug}`, `{collection}`, `{singular}`; default `/{collection}/{documentId}`).
|
|
84
|
+
- Internal links keep a plain `href` and carry `data-mex-uid`, `data-mex-document-id` and `data-mex-locale`; the shared sanitiser allows them on `<a>` only, with validated values.
|
|
85
|
+
- Table `magic_editor_x_counters` (created on startup) for cluster-wide rate limits.
|
|
86
|
+
- `scripts/soak.mjs` and a cluster acceptance run with process kills, network partitions, offline clients and 12 concurrent clients.
|
|
87
|
+
|
|
88
|
+
### Changed
|
|
89
|
+
|
|
90
|
+
- Collaboration protocol 3: the handshake carries `auth: { token, protocol: 3 }`; refusals arrive as `connect_error` with `data.code`. A browser tab still running the 2.0 admin is asked to reload.
|
|
91
|
+
- `POST /magic-editor-x/collaboration/session` also returns `seeded` and `protocol` and answers 429 above `collaboration.rateLimit.sessionsPerMinute`.
|
|
92
|
+
- `ai.requestsPerMinute` is counted per admin across all processes (was per process).
|
|
93
|
+
- Presence colours are Design System colour families instead of fixed hex values.
|
|
94
|
+
|
|
95
|
+
### Fixed
|
|
96
|
+
|
|
97
|
+
- Opening 1.x content no longer marks the form as changed.
|
|
98
|
+
- Enter in the link-preview and image-URL fields no longer adds an empty block.
|
|
99
|
+
- Automatic versions during live editing are taken when each period ends, not a few seconds after someone starts typing.
|
|
100
|
+
- The tamper check of the AES-GCM unit test no longer fails in 1 of 64 runs.
|
|
101
|
+
|
|
102
|
+
### Security
|
|
103
|
+
|
|
104
|
+
- See [docs/security-audit-2.1.md](./docs/security-audit-2.1.md): sanitising of remote content before rendering (MEX-21-01), update validation (MEX-21-02, -03), permission changes within seconds (MEX-21-04), rate limits (MEX-21-05, -06), protocol check (MEX-21-07), presence (MEX-21-08), no lost edits (MEX-21-09).
|
|
105
|
+
|
|
106
|
+
### Migration
|
|
107
|
+
|
|
108
|
+
- No action needed. Rebuild the admin (`npm run build`) after updating. Live rooms created by 2.0 keep working and are converted on the first edit; open 2.0 browser tabs show "Reload the page to keep editing live".
|
|
109
|
+
|
|
3
110
|
# [2.0.0](https://github.com/Schero94/Magic-Editor-X/compare/v1.6.0...v2.0.0) (2026-11-11)
|
|
4
111
|
|
|
5
112
|
|