magic-editor-x 2.1.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 +53 -0
- package/README.md +215 -89
- package/bin/magic-editor-x.mjs +190 -0
- package/dist/admin/{ConfigurationPage-CK2AbfGW.mjs → ConfigurationPage-3Dir3dAf.mjs} +3 -3
- package/dist/admin/{ConfigurationPage-CzsT_dO_.js → ConfigurationPage-YvnPnna6.js} +3 -3
- package/dist/admin/{CustomBlocksPage-CvLrsBds.js → CustomBlocksPage-BiiL2ORG.js} +4 -4
- package/dist/admin/{CustomBlocksPage-B2A8S5MV.mjs → CustomBlocksPage-CR2BaP9O.mjs} +4 -4
- package/dist/admin/{EditorField-7YCdXx-v.mjs → EditorField-B8pyAxPE.mjs} +5384 -278
- package/dist/admin/{EditorField-BdBCW15Q.js → EditorField-Diq1j8kc.js} +5378 -272
- package/dist/admin/{api-CmccMxlN.js → api-Dsq53giv.js} +1 -0
- package/dist/admin/{api-D5CAH0nh.mjs → api-RZ0Fz0BD.mjs} +1 -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-CkUYGb7U.js → de-BteRx2iA.js} +7 -1
- package/dist/admin/{de-rRIutpYJ.mjs → de-CFX5atOk.mjs} +7 -1
- package/dist/admin/de-DaJwN6nk.js +41 -0
- package/dist/admin/en-Cg2Ak5Cr.mjs +250 -0
- package/dist/admin/en-Cn78RZs-.js +41 -0
- package/dist/admin/{en-DulOcmXb.js → en-CyjAcccB.js} +7 -1
- package/dist/admin/en-D7mZWLGp.mjs +41 -0
- package/dist/admin/en-VlkaIzrM.js +250 -0
- package/dist/admin/{en-Puup8TFi.mjs → en-ea0tfA5i.mjs} +7 -1
- package/dist/admin/es-BT9oAcHf.js +250 -0
- package/dist/admin/es-BmGtLkJD.js +41 -0
- package/dist/admin/{es-BoQZC86B.js → es-C8GZFGjv.js} +7 -1
- package/dist/admin/es-C9-cXdb6.mjs +250 -0
- package/dist/admin/{es-257SSB7f.mjs → es-CEi_ycX8.mjs} +7 -1
- package/dist/admin/es-joykG5I9.mjs +41 -0
- package/dist/admin/{fr-C5rSdKU4.mjs → fr-BAMSvQbR.mjs} +7 -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-HxFcPpv4.js → fr-oRCJNdeJ.js} +7 -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-D6UuEtPy.mjs → pt-CQrfqsCN.mjs} +7 -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-Cjn2Sc9k.js → pt-tUeJ2Ywd.js} +7 -1
- package/dist/admin/{sanitize-DP5aeU7V.js → sanitize-Cb4jvBhj.js} +42 -11
- package/dist/admin/{sanitize-jjCot5PM.mjs → sanitize-ClkX823p.mjs} +45 -14
- package/dist/admin/{useT-91ruePzq.js → useT-BWZ_-Hel.js} +1 -1
- package/dist/admin/{useT-vgY88N_H.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 +8081 -348
- package/dist/server/index.mjs +8084 -351
- 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/de-BHPyA2S-.mjs +0 -103
- package/dist/admin/de-DBR893G4.js +0 -13
- package/dist/admin/de-RMs-_SCK.js +0 -103
- package/dist/admin/de-fBFh09Wl.mjs +0 -13
- package/dist/admin/en-BluCStLw.mjs +0 -103
- package/dist/admin/en-C81faOHP.js +0 -103
- package/dist/admin/en-D9Nfccux.mjs +0 -13
- package/dist/admin/en-gueRT44P.js +0 -13
- package/dist/admin/es-B0Zy8DVg.mjs +0 -13
- package/dist/admin/es-CQRI2Prp.mjs +0 -103
- package/dist/admin/es-D1QzY0JW.js +0 -103
- package/dist/admin/es-DRGs7meF.js +0 -13
- package/dist/admin/fr-B8rdLAIL.js +0 -13
- package/dist/admin/fr-Di3R6gOX.mjs +0 -103
- package/dist/admin/fr-R3_MbzT5.js +0 -103
- package/dist/admin/fr-oiUb2bb_.mjs +0 -13
- package/dist/admin/index-0_b1iroK.mjs +0 -156
- package/dist/admin/index-6SZLli70.js +0 -155
- package/dist/admin/pt-B3Jce6uT.mjs +0 -13
- package/dist/admin/pt-BCW1u_Hp.js +0 -103
- package/dist/admin/pt-BiWuSBcH.js +0 -13
- package/dist/admin/pt-Cr9AL408.mjs +0 -103
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,58 @@
|
|
|
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
|
+
|
|
3
56
|
# [2.1.0](https://github.com/Schero94/Magic-Editor-X/compare/v2.0.0...v2.1.0) (2026-11-11)
|
|
4
57
|
|
|
5
58
|
|