magic-editor-x 2.3.0 → 2.3.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 CHANGED
@@ -1,5 +1,18 @@
1
1
  # Changelog
2
2
 
3
+ ## [2.3.1](https://github.com/Schero94/Magic-Editor-X/compare/v2.3.0...v2.3.1) (2026-11-12)
4
+
5
+
6
+ ### Bug Fixes
7
+
8
+ * no live room, history or comments for editor fields with positional paths ([#7](https://github.com/Schero94/Magic-Editor-X/issues/7)) ([4663f82](https://github.com/Schero94/Magic-Editor-X/commit/4663f82a82088a931cd3ca9b51c418075e1fc2a2))
9
+
10
+
11
+ ### Fixed
12
+
13
+ - Version history and block comments are no longer offered for editor fields inside a repeatable component or a dynamic zone. Versions and comments are keyed by the positional path, so after an entry was removed or moved a version of another entry was listed, and restoring it would have put that entry's content into the editor. In 2.2 these fields had no version history (the routes answered 404). Keying versions and comments by component entry is planned for a later release.
14
+ - Editor fields inside a repeatable component or a dynamic zone no longer use live collaboration. Their path is positional (`sections.0.body`): after an entry whose editor had been opened was removed or moved before saving, the next entry joined the old room and showed the removed entry's content, and typing there would have saved it into the wrong entry. These fields are now edited without a live room; top-level fields and fields in single components keep live collaboration.
15
+
3
16
  # [2.3.0](https://github.com/Schero94/Magic-Editor-X/compare/v2.2.0...v2.3.0) (2026-11-12)
4
17
 
5
18
 
@@ -4,8 +4,8 @@ const jsxRuntime = require("react/jsx-runtime");
4
4
  const designSystem = require("@strapi/design-system");
5
5
  const admin = require("@strapi/strapi/admin");
6
6
  const icons = require("@strapi/icons");
7
- const index = require("./index-BHBRr562.js");
8
- const useT = require("./useT-D3sM9Zf7.js");
7
+ const index = require("./index-DR8sHkTk.js");
8
+ const useT = require("./useT-DNphiBQR.js");
9
9
  const ConfirmAction = require("./ConfirmAction-zLuIFj8t.js");
10
10
  const DraftSync = require("./DraftSync-BIA8cZgA.js");
11
11
  const ReactNamespace = require("react");
@@ -2,8 +2,8 @@ import { jsx, jsxs } from "react/jsx-runtime";
2
2
  import { Box, Flex, Typography, Switch, Grid, Field, SingleSelect, SingleSelectOption, TextInput, TextButton, NumberInput, Button, Badge, Alert, IconButton } from "@strapi/design-system";
3
3
  import { useFetchClient, useClipboard, useNotification, useRBAC, Page, Form, Blocker } from "@strapi/strapi/admin";
4
4
  import { Duplicate, Check } from "@strapi/icons";
5
- import { P as PERMISSIONS } from "./index-CQk1XeNb.mjs";
6
- import { u as useT, S as SectionCard, P as PageShell } from "./useT-CmaeZbCr.mjs";
5
+ import { P as PERMISSIONS } from "./index-My6FjjHB.mjs";
6
+ import { u as useT, S as SectionCard, P as PageShell } from "./useT-Cmg1jwwG.mjs";
7
7
  import { A as API, r as readApiError, C as ConfirmAction } from "./ConfirmAction-DuQwvRYi.mjs";
8
8
  import { D as DraftSync } from "./DraftSync-CUxOMG-E.mjs";
9
9
  import { useState, useRef, useEffect, useCallback, useMemo } from "react";
@@ -4,9 +4,9 @@ import { Box, Typography, Flex, Badge, Table, Thead, Tr, Th, VisuallyHidden, Tbo
4
4
  import { Pencil, Duplicate, ArrowUp, ArrowDown, Trash, Plus, Upload, Download } from "@strapi/icons";
5
5
  import { EmptyDocuments } from "@strapi/icons/symbols";
6
6
  import { useFetchClient, useNotification, useRBAC, Page } from "@strapi/strapi/admin";
7
- import { s as sanitizeSvg, a as sanitizeTemplate, m as mergeCodeBlocks, c as codeBlocks, P as PERMISSIONS } from "./index-CQk1XeNb.mjs";
7
+ import { s as sanitizeSvg, a as sanitizeTemplate, m as mergeCodeBlocks, c as codeBlocks, P as PERMISSIONS } from "./index-My6FjjHB.mjs";
8
8
  import { A as API, C as ConfirmAction, r as readApiError, a as refocusIfLost } from "./ConfirmAction-DuQwvRYi.mjs";
9
- import { u as useT, S as SectionCard, P as PageShell } from "./useT-CmaeZbCr.mjs";
9
+ import { u as useT, S as SectionCard, P as PageShell } from "./useT-Cmg1jwwG.mjs";
10
10
  import styled from "styled-components";
11
11
  import { u as useBreakpoint } from "./useBreakpoint-DCfn6pDG.mjs";
12
12
  import { useIntl } from "react-intl";
@@ -6,9 +6,9 @@ const designSystem = require("@strapi/design-system");
6
6
  const icons = require("@strapi/icons");
7
7
  const symbols = require("@strapi/icons/symbols");
8
8
  const admin = require("@strapi/strapi/admin");
9
- const index = require("./index-BHBRr562.js");
9
+ const index = require("./index-DR8sHkTk.js");
10
10
  const ConfirmAction = require("./ConfirmAction-zLuIFj8t.js");
11
- const useT = require("./useT-D3sM9Zf7.js");
11
+ const useT = require("./useT-DNphiBQR.js");
12
12
  const styled = require("styled-components");
13
13
  const useBreakpoint = require("./useBreakpoint-D30eNTkF.js");
14
14
  const reactIntl = require("react-intl");
@@ -5,11 +5,11 @@ import { Flex, Box, Badge, Typography, Table, Thead, Tr, Th, VisuallyHidden, Tbo
5
5
  import { Eye, Pencil, Duplicate, ArrowUp, ArrowDown, Trash, ArrowLeft, Check, Plus } from "@strapi/icons";
6
6
  import { EmptyDocuments } from "@strapi/icons/symbols";
7
7
  import { useFetchClient, Form, Blocker, useNotification, useRBAC, Page } from "@strapi/strapi/admin";
8
- import { P as PERMISSIONS } from "./index-CQk1XeNb.mjs";
8
+ import { P as PERMISSIONS } from "./index-My6FjjHB.mjs";
9
9
  import { A as API, C as ConfirmAction, a as refocusIfLost, r as readApiError } from "./ConfirmAction-DuQwvRYi.mjs";
10
- import { u as useT, P as PageShell, S as SectionCard } from "./useT-CmaeZbCr.mjs";
10
+ import { u as useT, P as PageShell, S as SectionCard } from "./useT-Cmg1jwwG.mjs";
11
11
  import "styled-components";
12
- import { n as normalizeScope, T as TEMPLATE_LIMITS, i as isEmptyDocument, c as containsSynced, P as PRESET_NAMES, E as EditorFieldBody, R as RenderedContent, r as resetEditorConfigCache } from "./index-XgfwqLfV.mjs";
12
+ import { n as normalizeScope, T as TEMPLATE_LIMITS, i as isEmptyDocument, c as containsSynced, P as PRESET_NAMES, E as EditorFieldBody, R as RenderedContent, r as resetEditorConfigCache } from "./index-k8_a5o1A.mjs";
13
13
  import { u as useBreakpoint } from "./useBreakpoint-DCfn6pDG.mjs";
14
14
  import { D as DraftSync } from "./DraftSync-CUxOMG-E.mjs";
15
15
  const fieldKey = (entry) => `${entry.uid}|${entry.field}`;
@@ -7,11 +7,11 @@ const designSystem = require("@strapi/design-system");
7
7
  const icons = require("@strapi/icons");
8
8
  const symbols = require("@strapi/icons/symbols");
9
9
  const admin = require("@strapi/strapi/admin");
10
- const index$1 = require("./index-BHBRr562.js");
10
+ const index$1 = require("./index-DR8sHkTk.js");
11
11
  const ConfirmAction = require("./ConfirmAction-zLuIFj8t.js");
12
- const useT = require("./useT-D3sM9Zf7.js");
12
+ const useT = require("./useT-DNphiBQR.js");
13
13
  require("styled-components");
14
- const index = require("./index-Cm-fFUhE.js");
14
+ const index = require("./index-DQVE0ymw.js");
15
15
  const useBreakpoint = require("./useBreakpoint-D30eNTkF.js");
16
16
  const DraftSync = require("./DraftSync-BIA8cZgA.js");
17
17
  const fieldKey = (entry) => `${entry.uid}|${entry.field}`;
@@ -20,7 +20,7 @@ const Raw = require("@editorjs/raw");
20
20
  const Attaches = require("@editorjs/attaches");
21
21
  const InlineCode = require("@editorjs/inline-code");
22
22
  const IndentTune = require("editorjs-indent-tune");
23
- const index$1 = require("./index-BHBRr562.js");
23
+ const index$1 = require("./index-DR8sHkTk.js");
24
24
  const ConfirmAction = require("./ConfirmAction-zLuIFj8t.js");
25
25
  const ImageTool = require("@editorjs/image");
26
26
  const Prism = require("prismjs");
@@ -17359,6 +17359,7 @@ const FieldAiDialog = ({
17359
17359
  }
17360
17360
  ) });
17361
17361
  };
17362
+ const isPositionalFieldPath = (path) => typeof path === "string" && path.split(".").some((part) => /^\d+$/.test(part));
17362
17363
  const SAVE_DEBOUNCE_MS = 150;
17363
17364
  const EditorStyles = styled.createGlobalStyle`${editorStyles}`;
17364
17365
  const styleOwners = createStyleOwners();
@@ -17588,7 +17589,9 @@ const EditorFieldBody = ({
17588
17589
  const grammarAllowed = Boolean(
17589
17590
  config && config.grammar && config.grammar.enabled && permissions.grammar && preset.grammar && target.uid
17590
17591
  );
17591
- const collaborationTarget = config && config.collaboration.enabled && permissions.collaborate && preset.collaboration && target.uid && target.documentId ? target : null;
17592
+ const collaborationTarget = config && config.collaboration.enabled && permissions.collaborate && preset.collaboration && target.uid && target.documentId && // Positional paths (`sections.0.body`) can point to another entry after entries are removed or
17593
+ // reordered before saving; their room would show the other entry's content (editor/field-path.mjs).
17594
+ !isPositionalFieldPath(target.field) ? target : null;
17592
17595
  const emit2 = ReactNamespace.useCallback(
17593
17596
  (data, { baselineOnly = false } = {}) => {
17594
17597
  const meaningful = data && Array.isArray(data.blocks) && data.blocks.some(
@@ -17767,7 +17770,9 @@ const EditorFieldBody = ({
17767
17770
  }, [ready, collabUndo, collaboration.client]);
17768
17771
  const announcement = usePresenceAnnouncements(collaboration.peers, t);
17769
17772
  const commentsEnabled = Boolean(
17770
- config && config.comments && config.comments.enabled && permissions.commentsRead && target.uid && target.documentId
17773
+ config && config.comments && config.comments.enabled && permissions.commentsRead && target.uid && target.documentId && // Comments and versions are keyed by the field path; a positional path (`sections.0.body`)
17774
+ // can name another entry after entries are removed or moved (editor/field-path.mjs).
17775
+ !isPositionalFieldPath(target.field)
17771
17776
  );
17772
17777
  const comments = useComments({
17773
17778
  target,
@@ -18573,7 +18578,9 @@ const EditorFieldBody = ({
18573
18578
  canRedo: collabUndo ? collaboration.canRedo : undoState.canRedo,
18574
18579
  onUndo: () => undoRef.current && undoRef.current.undo(),
18575
18580
  onRedo: () => undoRef.current && undoRef.current.redo(),
18576
- historyAvailable: Boolean(target.uid && target.documentId),
18581
+ historyAvailable: Boolean(
18582
+ target.uid && target.documentId && !isPositionalFieldPath(target.field)
18583
+ ),
18577
18584
  onOpenHistory: () => setHistoryOpen(true),
18578
18585
  historyButtonRef,
18579
18586
  collaboration,
@@ -1654,7 +1654,7 @@ const index = {
1654
1654
  },
1655
1655
  icon: PluginIcon,
1656
1656
  components: {
1657
- Input: () => Promise.resolve().then(() => require("./index-Cm-fFUhE.js")).then((n) => n.index)
1657
+ Input: () => Promise.resolve().then(() => require("./index-DQVE0ymw.js")).then((n) => n.index)
1658
1658
  },
1659
1659
  options: {
1660
1660
  base: [
@@ -1852,21 +1852,21 @@ const index = {
1852
1852
  intlLabel: { id: getTranslation("settings.link.configuration"), defaultMessage: "Configuration" },
1853
1853
  to: `${PLUGIN_ID}/configuration`,
1854
1854
  permissions: PERMISSIONS.settingsRead,
1855
- Component: () => Promise.resolve().then(() => require("./ConfigurationPage-C-UktL1x.js"))
1855
+ Component: () => Promise.resolve().then(() => require("./ConfigurationPage-CFP3lp9p.js"))
1856
1856
  },
1857
1857
  {
1858
1858
  id: `${PLUGIN_ID}-custom-blocks`,
1859
1859
  intlLabel: { id: getTranslation("settings.link.customBlocks"), defaultMessage: "Custom blocks" },
1860
1860
  to: `${PLUGIN_ID}/custom-blocks`,
1861
1861
  permissions: PERMISSIONS.customBlocksManage,
1862
- Component: () => Promise.resolve().then(() => require("./CustomBlocksPage-CxcTfdOT.js"))
1862
+ Component: () => Promise.resolve().then(() => require("./CustomBlocksPage-DzPOSpfn.js"))
1863
1863
  },
1864
1864
  {
1865
1865
  id: `${PLUGIN_ID}-templates`,
1866
1866
  intlLabel: { id: getTranslation("settings.link.templates"), defaultMessage: "Templates" },
1867
1867
  to: `${PLUGIN_ID}/templates`,
1868
1868
  permissions: PERMISSIONS.templatesManage,
1869
- Component: () => Promise.resolve().then(() => require("./TemplatesPage-Hn6gyu2l.js"))
1869
+ Component: () => Promise.resolve().then(() => require("./TemplatesPage-BVkgafCK.js"))
1870
1870
  }
1871
1871
  ]
1872
1872
  );
@@ -1651,7 +1651,7 @@ const index = {
1651
1651
  },
1652
1652
  icon: PluginIcon,
1653
1653
  components: {
1654
- Input: () => import("./index-XgfwqLfV.mjs").then((n) => n.a)
1654
+ Input: () => import("./index-k8_a5o1A.mjs").then((n) => n.a)
1655
1655
  },
1656
1656
  options: {
1657
1657
  base: [
@@ -1849,21 +1849,21 @@ const index = {
1849
1849
  intlLabel: { id: getTranslation("settings.link.configuration"), defaultMessage: "Configuration" },
1850
1850
  to: `${PLUGIN_ID}/configuration`,
1851
1851
  permissions: PERMISSIONS.settingsRead,
1852
- Component: () => import("./ConfigurationPage-BxLHIQdo.mjs")
1852
+ Component: () => import("./ConfigurationPage-CYGDLjM7.mjs")
1853
1853
  },
1854
1854
  {
1855
1855
  id: `${PLUGIN_ID}-custom-blocks`,
1856
1856
  intlLabel: { id: getTranslation("settings.link.customBlocks"), defaultMessage: "Custom blocks" },
1857
1857
  to: `${PLUGIN_ID}/custom-blocks`,
1858
1858
  permissions: PERMISSIONS.customBlocksManage,
1859
- Component: () => import("./CustomBlocksPage-D8aMbVXc.mjs")
1859
+ Component: () => import("./CustomBlocksPage-B5Q33N-s.mjs")
1860
1860
  },
1861
1861
  {
1862
1862
  id: `${PLUGIN_ID}-templates`,
1863
1863
  intlLabel: { id: getTranslation("settings.link.templates"), defaultMessage: "Templates" },
1864
1864
  to: `${PLUGIN_ID}/templates`,
1865
1865
  permissions: PERMISSIONS.templatesManage,
1866
- Component: () => import("./TemplatesPage-jhYi6Zdf.mjs")
1866
+ Component: () => import("./TemplatesPage-4A8JNO_Z.mjs")
1867
1867
  }
1868
1868
  ]
1869
1869
  );
@@ -20,7 +20,7 @@ import Raw from "@editorjs/raw";
20
20
  import Attaches from "@editorjs/attaches";
21
21
  import InlineCode from "@editorjs/inline-code";
22
22
  import IndentTune from "editorjs-indent-tune";
23
- import { e as el$1, b as select, i as input, f as field, I as INTERNAL_LINK_ATTRIBUTES, d as ICONS, g as button, h as sanitizeUrl, B as BLOCK_POLICIES, M as MAX_GALLERY_IMAGES, j as cleanFocalPoint, k as MAX_MEDIA_TRACKS, l as editable, n as sanitizeInline, s as sanitizeSvg, a as sanitizeTemplate, T as TRACK_KINDS, o as BUILT_IN_MARKER_VERSION, p as isBuiltInBlock, q as BUILT_IN_MARKER, r as INLINE_TAGS, t as INLINE_ATTRIBUTES, u as sanitizeTarget, v as INLINE_CLASSES, w as cleanInternalLinkAttributes, x as isMentionLink, y as activeBlocks, z as computeStats, A as isPlainObject, C as registeredBlockOf, D as buildCodeBlockTools, E as MARKED_BLOCKS, F as EDITOR_DATA_LIMITS, G as cloneJsonSafe, H as normalizeEditorDataSafe, J as byteLength, K as hashString, L as compileBlockList, N as sanitizeTunes, O as cleanMediaFile, Q as LINK_SCHEMES, R as escapeHtml$1, S as prepareEditorValue, U as getTranslation, V as prepareRemoteData } from "./index-CQk1XeNb.mjs";
23
+ import { e as el$1, b as select, i as input, f as field, I as INTERNAL_LINK_ATTRIBUTES, d as ICONS, g as button, h as sanitizeUrl, B as BLOCK_POLICIES, M as MAX_GALLERY_IMAGES, j as cleanFocalPoint, k as MAX_MEDIA_TRACKS, l as editable, n as sanitizeInline, s as sanitizeSvg, a as sanitizeTemplate, T as TRACK_KINDS, o as BUILT_IN_MARKER_VERSION, p as isBuiltInBlock, q as BUILT_IN_MARKER, r as INLINE_TAGS, t as INLINE_ATTRIBUTES, u as sanitizeTarget, v as INLINE_CLASSES, w as cleanInternalLinkAttributes, x as isMentionLink, y as activeBlocks, z as computeStats, A as isPlainObject, C as registeredBlockOf, D as buildCodeBlockTools, E as MARKED_BLOCKS, F as EDITOR_DATA_LIMITS, G as cloneJsonSafe, H as normalizeEditorDataSafe, J as byteLength, K as hashString, L as compileBlockList, N as sanitizeTunes, O as cleanMediaFile, Q as LINK_SCHEMES, R as escapeHtml$1, S as prepareEditorValue, U as getTranslation, V as prepareRemoteData } from "./index-My6FjjHB.mjs";
24
24
  import { A as API, r as readApiError, C as ConfirmAction } from "./ConfirmAction-DuQwvRYi.mjs";
25
25
  import ImageTool from "@editorjs/image";
26
26
  import Prism from "prismjs";
@@ -17322,6 +17322,7 @@ const FieldAiDialog = ({
17322
17322
  }
17323
17323
  ) });
17324
17324
  };
17325
+ const isPositionalFieldPath = (path) => typeof path === "string" && path.split(".").some((part) => /^\d+$/.test(part));
17325
17326
  const SAVE_DEBOUNCE_MS = 150;
17326
17327
  const EditorStyles = createGlobalStyle`${editorStyles}`;
17327
17328
  const styleOwners = createStyleOwners();
@@ -17551,7 +17552,9 @@ const EditorFieldBody = ({
17551
17552
  const grammarAllowed = Boolean(
17552
17553
  config && config.grammar && config.grammar.enabled && permissions.grammar && preset.grammar && target.uid
17553
17554
  );
17554
- const collaborationTarget = config && config.collaboration.enabled && permissions.collaborate && preset.collaboration && target.uid && target.documentId ? target : null;
17555
+ const collaborationTarget = config && config.collaboration.enabled && permissions.collaborate && preset.collaboration && target.uid && target.documentId && // Positional paths (`sections.0.body`) can point to another entry after entries are removed or
17556
+ // reordered before saving; their room would show the other entry's content (editor/field-path.mjs).
17557
+ !isPositionalFieldPath(target.field) ? target : null;
17555
17558
  const emit2 = useCallback(
17556
17559
  (data, { baselineOnly = false } = {}) => {
17557
17560
  const meaningful = data && Array.isArray(data.blocks) && data.blocks.some(
@@ -17730,7 +17733,9 @@ const EditorFieldBody = ({
17730
17733
  }, [ready, collabUndo, collaboration.client]);
17731
17734
  const announcement = usePresenceAnnouncements(collaboration.peers, t);
17732
17735
  const commentsEnabled = Boolean(
17733
- config && config.comments && config.comments.enabled && permissions.commentsRead && target.uid && target.documentId
17736
+ config && config.comments && config.comments.enabled && permissions.commentsRead && target.uid && target.documentId && // Comments and versions are keyed by the field path; a positional path (`sections.0.body`)
17737
+ // can name another entry after entries are removed or moved (editor/field-path.mjs).
17738
+ !isPositionalFieldPath(target.field)
17734
17739
  );
17735
17740
  const comments = useComments({
17736
17741
  target,
@@ -18536,7 +18541,9 @@ const EditorFieldBody = ({
18536
18541
  canRedo: collabUndo ? collaboration.canRedo : undoState.canRedo,
18537
18542
  onUndo: () => undoRef.current && undoRef.current.undo(),
18538
18543
  onRedo: () => undoRef.current && undoRef.current.redo(),
18539
- historyAvailable: Boolean(target.uid && target.documentId),
18544
+ historyAvailable: Boolean(
18545
+ target.uid && target.documentId && !isPositionalFieldPath(target.field)
18546
+ ),
18540
18547
  onOpenHistory: () => setHistoryOpen(true),
18541
18548
  historyButtonRef,
18542
18549
  collaboration,
@@ -1,4 +1,4 @@
1
1
  "use strict";
2
2
  Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
3
- const index = require("./index-BHBRr562.js");
3
+ const index = require("./index-DR8sHkTk.js");
4
4
  exports.default = index.index;
@@ -1,4 +1,4 @@
1
- import { W } from "./index-CQk1XeNb.mjs";
1
+ import { W } from "./index-My6FjjHB.mjs";
2
2
  export {
3
3
  W as default
4
4
  };
@@ -3,7 +3,7 @@ import { useId, useCallback } from "react";
3
3
  import { Flex, Box, Typography } from "@strapi/design-system";
4
4
  import { Page, Layouts } from "@strapi/strapi/admin";
5
5
  import { useIntl } from "react-intl";
6
- import { U as getTranslation } from "./index-CQk1XeNb.mjs";
6
+ import { U as getTranslation } from "./index-My6FjjHB.mjs";
7
7
  const PageShell = ({
8
8
  title,
9
9
  subtitle,
@@ -4,7 +4,7 @@ const ReactNamespace = require("react");
4
4
  const designSystem = require("@strapi/design-system");
5
5
  const admin = require("@strapi/strapi/admin");
6
6
  const reactIntl = require("react-intl");
7
- const index = require("./index-BHBRr562.js");
7
+ const index = require("./index-DR8sHkTk.js");
8
8
  const PageShell = ({
9
9
  title,
10
10
  subtitle,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "magic-editor-x",
3
- "version": "2.3.0",
3
+ "version": "2.3.1",
4
4
  "description": "Free, open-source block editor for Strapi 5: Editor.js custom field with Media Library uploads, custom blocks, version history, live collaboration across several servers and an optional AI assistant with your own provider.",
5
5
  "keywords": [
6
6
  "strapi",