magic-editor-x 1.5.0 → 1.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.
Files changed (25) hide show
  1. package/dist/_chunks/{App-3CjSGQyL.js → App-DImBvISP.js} +59 -59
  2. package/dist/_chunks/{App-CKlB5p92.mjs → App-iNfbV7cz.mjs} +32 -32
  3. package/dist/_chunks/{CustomBlocksPage-CnJxygIw.js → CustomBlocksPage-Cj-0TTUs.js} +12 -12
  4. package/dist/_chunks/{LicensePage-vJxKYZGQ.js → LicensePage-CmvILX9m.js} +43 -43
  5. package/dist/_chunks/{LicensePage-B2STSez2.mjs → LicensePage-gLRoo8WJ.mjs} +38 -38
  6. package/dist/_chunks/{LiveCollaborationPanel-D70o6EGf.js → LiveCollaborationPanel-BFybu8h0.js} +7 -7
  7. package/dist/_chunks/{LiveCollaborationPanel-uLIJs5z_.mjs → LiveCollaborationPanel-CVgl4IyR.mjs} +3 -3
  8. package/dist/_chunks/{Settings-CdGL1OCi.mjs → Settings-ButYcfrm.mjs} +82 -82
  9. package/dist/_chunks/Settings-BzGqgrxD.js +440 -0
  10. package/dist/_chunks/{getTranslation--JcqVOd5.js → getTranslation-BADoesEn.js} +19120 -12315
  11. package/dist/_chunks/{getTranslation-bLklCCaI.mjs → getTranslation-D3h3Z3gU.mjs} +18708 -11903
  12. package/dist/_chunks/index-BXBnwuRw.js +2158 -0
  13. package/dist/_chunks/index-BvEdg518.mjs +2159 -0
  14. package/dist/_chunks/{index-CRALSDLD.js → index-DDFAuQNT.js} +181 -181
  15. package/dist/_chunks/{index-CdFFlQdx.mjs → index-DEi6nwfM.mjs} +33 -33
  16. package/dist/_chunks/{tools-uudZx91W.mjs → tools-BXzd0lx5.mjs} +3 -3
  17. package/dist/_chunks/{tools-BSMn5LLQ.js → tools-Q0uwDS9E.js} +10 -10
  18. package/dist/admin/index.js +1 -1
  19. package/dist/admin/index.mjs +2 -2
  20. package/dist/server/index.js +142 -135
  21. package/dist/server/index.mjs +142 -135
  22. package/package.json +7 -7
  23. package/dist/_chunks/Settings-CwSNO4_t.js +0 -440
  24. package/dist/_chunks/index-CAPc_Y1F.mjs +0 -2551
  25. package/dist/_chunks/index-CPs6WJDY.js +0 -2550
@@ -1,12 +1,12 @@
1
1
  import { jsx, jsxs, Fragment } from "react/jsx-runtime";
2
- import React__default, { useState, useEffect, useCallback, useRef, useMemo, forwardRef } from "react";
3
- import { u as useIntl, F as Flex, T as Typography, B as Button$2, D as Divider, a as Box, g as getTranslation, b as Field, L as Loader } from "./getTranslation-bLklCCaI.mjs";
2
+ import m__default, { useState, useEffect, useCallback, useRef, useMemo, forwardRef } from "react";
3
+ import { u as useIntl, T, I, z as zn, b as bl, R, g as getTranslation, H as Hm, V as Vd } from "./getTranslation-D3h3Z3gU.mjs";
4
4
  import styled, { createGlobalStyle, css } from "styled-components";
5
5
  import { ClockIcon, ExclamationTriangleIcon, SparklesIcon as SparklesIcon$1, Bars3BottomLeftIcon, ListBulletIcon, CheckCircleIcon, PhotoIcon, LinkIcon, CodeBracketIcon, TableCellsIcon, ChatBubbleBottomCenterTextIcon, MinusIcon, DocumentDuplicateIcon, TrashIcon, ArrowsPointingInIcon, ArrowsPointingOutIcon, EyeIcon, PencilSquareIcon } from "@heroicons/react/24/outline";
6
6
  import EditorJS from "@editorjs/editorjs";
7
- import { M as MagicEditorAPI, t as toastManager, g as getTools, i as initUndoRedo, a as initDragDrop, A as AIToast, b as AIInlineToolbar } from "./tools-uudZx91W.mjs";
7
+ import { M as MagicEditorAPI, t as toastManager, g as getTools, i as initUndoRedo, a as initDragDrop, A as AIToast, b as AIInlineToolbar } from "./tools-BXzd0lx5.mjs";
8
8
  import { useStrapiApp, useFetchClient, useAuth } from "@strapi/strapi/admin";
9
- import { P as PLUGIN_ID } from "./index-CAPc_Y1F.mjs";
9
+ import { P as PLUGIN_ID } from "./index-BvEdg518.mjs";
10
10
  import { io } from "socket.io-client";
11
11
  import * as Y from "yjs";
12
12
  import { IndexeddbPersistence } from "y-indexeddb";
@@ -970,7 +970,7 @@ const MediaLibComponent = ({
970
970
  }
971
971
  ) });
972
972
  };
973
- class MediaLibErrorBoundary extends React__default.Component {
973
+ class MediaLibErrorBoundary extends m__default.Component {
974
974
  constructor(props) {
975
975
  super(props);
976
976
  this.state = { hasError: false, error: null };
@@ -1763,8 +1763,8 @@ const useLicense = () => {
1763
1763
  };
1764
1764
  };
1765
1765
  const useAIActions = ({ licenseKey, editorInstanceRef, isReady, onNoCredits }) => {
1766
- const apiClientRef = React__default.useRef(null);
1767
- React__default.useEffect(() => {
1766
+ const apiClientRef = m__default.useRef(null);
1767
+ m__default.useEffect(() => {
1768
1768
  if (licenseKey && !apiClientRef.current) {
1769
1769
  apiClientRef.current = new MagicEditorAPI(licenseKey);
1770
1770
  }
@@ -2983,7 +2983,7 @@ const AIAssistantPopup = ({ selectedText, licenseKey, onClose, onApply }) => {
2983
2983
  ] })
2984
2984
  ] }) });
2985
2985
  };
2986
- const PanelWrapper = styled(Box)`
2986
+ const PanelWrapper = styled(R)`
2987
2987
  width: 320px;
2988
2988
  background: ${({ theme }) => theme.colors.neutral0};
2989
2989
  border: 1px solid ${({ theme }) => theme.colors.neutral150};
@@ -2993,25 +2993,25 @@ const PanelWrapper = styled(Box)`
2993
2993
  flex-direction: column;
2994
2994
  max-height: 70vh;
2995
2995
  `;
2996
- const Header$1 = styled(Flex)`
2996
+ const Header$1 = styled(T)`
2997
2997
  padding: 12px 16px;
2998
2998
  border-bottom: 1px solid ${({ theme }) => theme.colors.neutral150};
2999
2999
  `;
3000
- const Content$1 = styled(Box)`
3000
+ const Content$1 = styled(R)`
3001
3001
  padding: 12px 16px;
3002
3002
  overflow-y: auto;
3003
3003
  `;
3004
- const Item = styled(Box)`
3004
+ const Item = styled(R)`
3005
3005
  padding: 10px 12px;
3006
3006
  border: 1px solid ${({ theme }) => theme.colors.neutral150};
3007
3007
  border-radius: 6px;
3008
3008
  margin-bottom: 10px;
3009
3009
  `;
3010
- const Meta = styled(Typography)`
3010
+ const Meta = styled(I)`
3011
3011
  color: ${({ theme }) => theme.colors.neutral500};
3012
3012
  font-size: 12px;
3013
3013
  `;
3014
- const PremiumBadge = styled(Box)`
3014
+ const PremiumBadge = styled(R)`
3015
3015
  background: ${({ theme }) => theme.colors.primary100};
3016
3016
  color: ${({ theme }) => theme.colors.primary600};
3017
3017
  border-radius: 6px;
@@ -3060,33 +3060,33 @@ const VersionHistoryPanel = ({
3060
3060
  );
3061
3061
  return /* @__PURE__ */ jsxs(PanelWrapper, { "data-testid": "version-history-panel", children: [
3062
3062
  /* @__PURE__ */ jsxs(Header$1, { justifyContent: "space-between", alignItems: "center", children: [
3063
- /* @__PURE__ */ jsxs(Flex, { gap: 8, alignItems: "center", children: [
3063
+ /* @__PURE__ */ jsxs(T, { gap: 8, alignItems: "center", children: [
3064
3064
  /* @__PURE__ */ jsx(ClockIcon, { width: 18 }),
3065
- /* @__PURE__ */ jsx(Typography, { fontWeight: "bold", children: t("versionHistory.title", "Version History") })
3065
+ /* @__PURE__ */ jsx(I, { fontWeight: "bold", children: t("versionHistory.title", "Version History") })
3066
3066
  ] }),
3067
- /* @__PURE__ */ jsx(Button$2, { size: "S", variant: "tertiary", onClick: onClose, children: t("versionHistory.close", "Close") })
3067
+ /* @__PURE__ */ jsx(zn, { size: "S", variant: "tertiary", onClick: onClose, children: t("versionHistory.close", "Close") })
3068
3068
  ] }),
3069
3069
  /* @__PURE__ */ jsxs(Content$1, { children: [
3070
- loading && /* @__PURE__ */ jsx(Typography, { children: t("versionHistory.loading", "Loading versions...") }),
3071
- error && /* @__PURE__ */ jsx(Typography, { textColor: "danger600", children: error }),
3072
- !loading && !error && snapshots.length === 0 && /* @__PURE__ */ jsx(Typography, { children: t("versionHistory.noSnapshots", "No versions saved yet") }),
3070
+ loading && /* @__PURE__ */ jsx(I, { children: t("versionHistory.loading", "Loading versions...") }),
3071
+ error && /* @__PURE__ */ jsx(I, { textColor: "danger600", children: error }),
3072
+ !loading && !error && snapshots.length === 0 && /* @__PURE__ */ jsx(I, { children: t("versionHistory.noSnapshots", "No versions saved yet") }),
3073
3073
  !loading && !error && snapshots.map((snap) => /* @__PURE__ */ jsxs(Item, { children: [
3074
- /* @__PURE__ */ jsxs(Flex, { justifyContent: "space-between", alignItems: "center", children: [
3075
- /* @__PURE__ */ jsxs(Typography, { fontWeight: "bold", children: [
3074
+ /* @__PURE__ */ jsxs(T, { justifyContent: "space-between", alignItems: "center", children: [
3075
+ /* @__PURE__ */ jsxs(I, { fontWeight: "bold", children: [
3076
3076
  t("versionHistory.version", "Version"),
3077
3077
  " ",
3078
3078
  snap.version
3079
3079
  ] }),
3080
- /* @__PURE__ */ jsx(Typography, { variant: "pi", children: formatDate(snap.createdAt) })
3080
+ /* @__PURE__ */ jsx(I, { variant: "pi", children: formatDate(snap.createdAt) })
3081
3081
  ] }),
3082
3082
  /* @__PURE__ */ jsxs(Meta, { children: [
3083
3083
  t("versionHistory.createdBy", "By"),
3084
3084
  " ",
3085
3085
  snap.createdBy?.firstname ? `${snap.createdBy.firstname} ${snap.createdBy.lastname || ""}`.trim() : "—"
3086
3086
  ] }),
3087
- /* @__PURE__ */ jsx(Divider, { marginTop: 2, marginBottom: 2 }),
3088
- canRestore ? /* @__PURE__ */ jsx(Flex, { gap: 8, children: /* @__PURE__ */ jsx(
3089
- Button$2,
3087
+ /* @__PURE__ */ jsx(bl, { marginTop: 2, marginBottom: 2 }),
3088
+ canRestore ? /* @__PURE__ */ jsx(T, { gap: 8, children: /* @__PURE__ */ jsx(
3089
+ zn,
3090
3090
  {
3091
3091
  size: "S",
3092
3092
  variant: "secondary",
@@ -3098,9 +3098,9 @@ const VersionHistoryPanel = ({
3098
3098
  t("versionHistory.premiumOnly", "Premium feature")
3099
3099
  ] })
3100
3100
  ] }, snap.documentId || snap.id)),
3101
- /* @__PURE__ */ jsx(Divider, { marginTop: 4, marginBottom: 4 }),
3102
- canRestore ? /* @__PURE__ */ jsx(Button$2, { size: "S", fullWidth: true, variant: "default", onClick: onCreate, disabled: loading, children: t("versionHistory.create", "Create Snapshot") }) : /* @__PURE__ */ jsxs(Box, { children: [
3103
- /* @__PURE__ */ jsx(Button$2, { size: "S", fullWidth: true, variant: "default", disabled: true, children: t("versionHistory.create", "Create Snapshot") }),
3101
+ /* @__PURE__ */ jsx(bl, { marginTop: 4, marginBottom: 4 }),
3102
+ canRestore ? /* @__PURE__ */ jsx(zn, { size: "S", fullWidth: true, variant: "default", onClick: onCreate, disabled: loading, children: t("versionHistory.create", "Create Snapshot") }) : /* @__PURE__ */ jsxs(R, { children: [
3103
+ /* @__PURE__ */ jsx(zn, { size: "S", fullWidth: true, variant: "default", disabled: true, children: t("versionHistory.create", "Create Snapshot") }),
3104
3104
  /* @__PURE__ */ jsxs(PremiumBadge, { style: { marginTop: "8px", width: "100%", justifyContent: "center" }, children: [
3105
3105
  /* @__PURE__ */ jsx(ExclamationTriangleIcon, { width: 16 }),
3106
3106
  t("versionHistory.premiumOnly", "Premium feature")
@@ -6505,11 +6505,11 @@ const Editor = forwardRef(({
6505
6505
  { icon: ExclamationTriangleIcon, label: "Warning", block: "warning" },
6506
6506
  { icon: MinusIcon, label: "Divider", block: "delimiter" }
6507
6507
  ];
6508
- return /* @__PURE__ */ jsxs(Field.Root, { name, id: name, error, required, hint, children: [
6508
+ return /* @__PURE__ */ jsxs(Hm.Root, { name, id: name, error, required, hint, children: [
6509
6509
  /* @__PURE__ */ jsx(FullscreenGlobalStyle, {}),
6510
6510
  /* @__PURE__ */ jsx(EditorJSGlobalStyles, {}),
6511
6511
  /* @__PURE__ */ jsx(AIToast, {}),
6512
- label && !isFullscreen && /* @__PURE__ */ jsx(Field.Label, { action: labelAction, children: label }),
6512
+ label && !isFullscreen && /* @__PURE__ */ jsx(Hm.Label, { action: labelAction, children: label }),
6513
6513
  /* @__PURE__ */ jsx(
6514
6514
  EditorContainer,
6515
6515
  {
@@ -6723,7 +6723,7 @@ const Editor = forwardRef(({
6723
6723
  onBlur: () => setIsFocused(false),
6724
6724
  children: [
6725
6725
  !isReady && /* @__PURE__ */ jsxs(LoadingOverlay, { children: [
6726
- /* @__PURE__ */ jsx(Loader, { small: true }),
6726
+ /* @__PURE__ */ jsx(Vd, { small: true }),
6727
6727
  /* @__PURE__ */ jsx(LoadingText, { children: "Initializing editor..." })
6728
6728
  ] }),
6729
6729
  /* @__PURE__ */ jsx(
@@ -6808,8 +6808,8 @@ const Editor = forwardRef(({
6808
6808
  }
6809
6809
  ),
6810
6810
  !isFullscreen && /* @__PURE__ */ jsxs(Fragment, { children: [
6811
- /* @__PURE__ */ jsx(Field.Hint, {}),
6812
- /* @__PURE__ */ jsx(Field.Error, {})
6811
+ /* @__PURE__ */ jsx(Hm.Hint, {}),
6812
+ /* @__PURE__ */ jsx(Hm.Error, {})
6813
6813
  ] }),
6814
6814
  /* @__PURE__ */ jsx(
6815
6815
  MediaLibComponent,
@@ -17,7 +17,7 @@ import Personality from "@editorjs/personality";
17
17
  import Alert from "editorjs-alert";
18
18
  import ToggleBlock from "editorjs-toggle-block";
19
19
  import CodeFlask from "@calumk/editorjs-codeflask";
20
- import React__default, { useState, useRef, useEffect } from "react";
20
+ import m__default, { useState, useRef, useEffect } from "react";
21
21
  import { createRoot } from "react-dom/client";
22
22
  import { jsxs, jsx, Fragment } from "react/jsx-runtime";
23
23
  import styled, { keyframes } from "styled-components";
@@ -1436,7 +1436,7 @@ class AIAssistantTool {
1436
1436
  document.body.appendChild(this.toolbar);
1437
1437
  this.toolbarRoot = createRoot(this.toolbar);
1438
1438
  this.toolbarRoot.render(
1439
- React__default.createElement(AIInlineToolbar, {
1439
+ m__default.createElement(AIInlineToolbar, {
1440
1440
  position,
1441
1441
  onAction: this._handleAction.bind(this),
1442
1442
  loading: this.isLoading,
@@ -1574,7 +1574,7 @@ class AIAssistantTool {
1574
1574
  top: rect.bottom + 8
1575
1575
  };
1576
1576
  this.toolbarRoot.render(
1577
- React__default.createElement(AIInlineToolbar, {
1577
+ m__default.createElement(AIInlineToolbar, {
1578
1578
  position,
1579
1579
  onAction: this._handleAction.bind(this),
1580
1580
  loading: this.isLoading,
@@ -18,7 +18,7 @@ const Personality = require("@editorjs/personality");
18
18
  const Alert = require("editorjs-alert");
19
19
  const ToggleBlock = require("editorjs-toggle-block");
20
20
  const CodeFlask = require("@calumk/editorjs-codeflask");
21
- const React = require("react");
21
+ const m = require("react");
22
22
  const client = require("react-dom/client");
23
23
  const jsxRuntime = require("react/jsx-runtime");
24
24
  const styled = require("styled-components");
@@ -52,7 +52,7 @@ const Personality__default = /* @__PURE__ */ _interopDefault(Personality);
52
52
  const Alert__default = /* @__PURE__ */ _interopDefault(Alert);
53
53
  const ToggleBlock__default = /* @__PURE__ */ _interopDefault(ToggleBlock);
54
54
  const CodeFlask__default = /* @__PURE__ */ _interopDefault(CodeFlask);
55
- const React__default = /* @__PURE__ */ _interopDefault(React);
55
+ const m__default = /* @__PURE__ */ _interopDefault(m);
56
56
  const styled__default = /* @__PURE__ */ _interopDefault(styled);
57
57
  const Marker__default = /* @__PURE__ */ _interopDefault(Marker);
58
58
  const InlineCode__default = /* @__PURE__ */ _interopDefault(InlineCode);
@@ -948,9 +948,9 @@ const AIInlineToolbar = ({
948
948
  disabled = false,
949
949
  onClose
950
950
  }) => {
951
- const [activeSubmenu, setActiveSubmenu] = React.useState(null);
952
- const toolbarRef = React.useRef(null);
953
- React.useEffect(() => {
951
+ const [activeSubmenu, setActiveSubmenu] = m.useState(null);
952
+ const toolbarRef = m.useRef(null);
953
+ m.useEffect(() => {
954
954
  const handleClickOutside = (e) => {
955
955
  if (toolbarRef.current && !toolbarRef.current.contains(e.target)) {
956
956
  onClose?.();
@@ -1310,7 +1310,7 @@ class ToastManager {
1310
1310
  }
1311
1311
  const toastManager = new ToastManager();
1312
1312
  const Toast = ({ toast, onClose }) => {
1313
- const [closing, setClosing] = React.useState(false);
1313
+ const [closing, setClosing] = m.useState(false);
1314
1314
  const handleClose = () => {
1315
1315
  setClosing(true);
1316
1316
  setTimeout(() => {
@@ -1335,8 +1335,8 @@ const Toast = ({ toast, onClose }) => {
1335
1335
  ] });
1336
1336
  };
1337
1337
  const AIToast = () => {
1338
- const [toasts, setToasts] = React.useState([]);
1339
- React.useEffect(() => {
1338
+ const [toasts, setToasts] = m.useState([]);
1339
+ m.useEffect(() => {
1340
1340
  const unsubscribe = toastManager.subscribe(setToasts);
1341
1341
  return unsubscribe;
1342
1342
  }, []);
@@ -1469,7 +1469,7 @@ class AIAssistantTool {
1469
1469
  document.body.appendChild(this.toolbar);
1470
1470
  this.toolbarRoot = client.createRoot(this.toolbar);
1471
1471
  this.toolbarRoot.render(
1472
- React__default.default.createElement(AIInlineToolbar, {
1472
+ m__default.default.createElement(AIInlineToolbar, {
1473
1473
  position,
1474
1474
  onAction: this._handleAction.bind(this),
1475
1475
  loading: this.isLoading,
@@ -1607,7 +1607,7 @@ class AIAssistantTool {
1607
1607
  top: rect.bottom + 8
1608
1608
  };
1609
1609
  this.toolbarRoot.render(
1610
- React__default.default.createElement(AIInlineToolbar, {
1610
+ m__default.default.createElement(AIInlineToolbar, {
1611
1611
  position,
1612
1612
  onAction: this._handleAction.bind(this),
1613
1613
  loading: this.isLoading,
@@ -1,3 +1,3 @@
1
1
  "use strict";
2
- const index = require("../_chunks/index-CPs6WJDY.js");
2
+ const index = require("../_chunks/index-BXBnwuRw.js");
3
3
  module.exports = index.index;
@@ -1,4 +1,4 @@
1
- import { q } from "../_chunks/index-CAPc_Y1F.mjs";
1
+ import { i } from "../_chunks/index-BvEdg518.mjs";
2
2
  export {
3
- q as default
3
+ i as default
4
4
  };