magic-editor-x 1.5.0 → 1.6.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.
Files changed (38) hide show
  1. package/README.md +6 -110
  2. package/dist/{_chunks/App-CKlB5p92.mjs → admin/App-BwMEZnS-.mjs} +35 -34
  3. package/dist/{_chunks/App-3CjSGQyL.js → admin/App-HNr2tizR.js} +65 -64
  4. package/dist/{_chunks/CustomBlocksPage-CnJxygIw.js → admin/CustomBlocksPage-BjcA7MGz.js} +13 -13
  5. package/dist/{_chunks/LicensePage-B2STSez2.mjs → admin/LicensePage-D0DMTF41.mjs} +39 -38
  6. package/dist/{_chunks/LicensePage-vJxKYZGQ.js → admin/LicensePage-D0_9yPkw.js} +45 -44
  7. package/dist/{_chunks/LiveCollaborationPanel-D70o6EGf.js → admin/LiveCollaborationPanel-CZAbgAVr.js} +9 -8
  8. package/dist/{_chunks/LiveCollaborationPanel-uLIJs5z_.mjs → admin/LiveCollaborationPanel-D8z72afw.mjs} +4 -3
  9. package/dist/admin/Settings-DRenvRcG.js +441 -0
  10. package/dist/{_chunks/Settings-CdGL1OCi.mjs → admin/Settings-DjyNURlS.mjs} +83 -82
  11. package/dist/{_chunks/getTranslation-bLklCCaI.mjs → admin/getTranslation-2OiEgVGt.mjs} +15204 -16731
  12. package/dist/{_chunks/getTranslation--JcqVOd5.js → admin/getTranslation-DQ_WJ-7M.js} +15612 -17139
  13. package/dist/admin/index-Bn2tfJrC.js +2186 -0
  14. package/dist/{_chunks/index-CRALSDLD.js → admin/index-DAtClhqy.js} +184 -183
  15. package/dist/admin/index-FVEbTfqO.mjs +2187 -0
  16. package/dist/{_chunks/index-CdFFlQdx.mjs → admin/index-gjWl-6E2.mjs} +34 -33
  17. package/dist/admin/index.js +3 -2
  18. package/dist/admin/index.mjs +2 -2
  19. package/dist/{_chunks/tools-uudZx91W.mjs → admin/tools-CzHTZaY_.mjs} +42 -39
  20. package/dist/{_chunks/tools-BSMn5LLQ.js → admin/tools-DALFhvPO.js} +49 -46
  21. package/dist/server/index.js +63527 -37942
  22. package/dist/server/index.mjs +63546 -37934
  23. package/package.json +43 -30
  24. package/dist/_chunks/Settings-CwSNO4_t.js +0 -440
  25. package/dist/_chunks/index-CAPc_Y1F.mjs +0 -2551
  26. package/dist/_chunks/index-CPs6WJDY.js +0 -2550
  27. /package/dist/{_chunks → admin}/CustomBlocksPage-COPOZ2-_.mjs +0 -0
  28. /package/dist/{_chunks → admin}/de-C_0Mj-Zo.mjs +0 -0
  29. /package/dist/{_chunks → admin}/de-DVNVpAt9.js +0 -0
  30. /package/dist/{_chunks → admin}/en-B7AAf1ie.mjs +0 -0
  31. /package/dist/{_chunks → admin}/en-C2hv5GsA.js +0 -0
  32. /package/dist/{_chunks → admin}/es-BzJqcIST.js +0 -0
  33. /package/dist/{_chunks → admin}/es-zdP8sd-f.mjs +0 -0
  34. /package/dist/{_chunks → admin}/fr-CtAgOgH1.mjs +0 -0
  35. /package/dist/{_chunks → admin}/fr-D3GwqAAJ.js +0 -0
  36. /package/dist/{style.css → admin/magic-editor-x.css} +0 -0
  37. /package/dist/{_chunks → admin}/pt-BmUw6YMP.mjs +0 -0
  38. /package/dist/{_chunks → admin}/pt-CFo0nTbj.js +0 -0
package/README.md CHANGED
@@ -9,6 +9,8 @@
9
9
 
10
10
  > **ALPHA RELEASE v1.4.0-alpha.1** - Custom Blocks with Tier-based Limits now available! Create your own editor blocks without writing code.
11
11
 
12
+ Project site: https://schero94.github.io/Magic-Editor-X/
13
+
12
14
  ---
13
15
 
14
16
  ## What's New in v1.4.0-alpha.1
@@ -138,7 +140,7 @@ server/
138
140
  - **Socket.io 4.8** - WebSocket server
139
141
  - **Y.js 13.6** - Server-side CRDT state
140
142
  - **Open Graph Scraper** - Link metadata extraction
141
- - **Strapi 5.31** - Backend framework
143
+ - **Strapi 5.57 or later in the 5.x line** - Backend framework
142
144
 
143
145
  ### Data Flow
144
146
 
@@ -788,117 +790,11 @@ console.log(editorContent.blocks); // Array of blocks
788
790
 
789
791
  ## API Reference
790
792
 
791
- ### Public API Endpoints
792
-
793
- These endpoints are available for content-api usage:
794
-
795
- #### Fetch Link Metadata
796
-
797
- ```http
798
- GET /api/magic-editor-x/link?url=https://example.com
799
- ```
800
-
801
- **Response:**
802
- ```json
803
- {
804
- "success": 1,
805
- "meta": {
806
- "title": "Example Domain",
807
- "description": "Example domain for documentation",
808
- "image": {
809
- "url": "https://example.com/og-image.jpg"
810
- }
811
- }
812
- }
813
- ```
814
-
815
- #### Upload Image by File
816
-
817
- ```http
818
- POST /api/magic-editor-x/image/byFile
819
- Content-Type: multipart/form-data
793
+ The plugin currently registers admin routes only. It does not register public Content API routes. Admin routes use Strapi's admin API base and require authentication and the route-specific permissions defined in `server/src/routes/admin.js`.
820
794
 
821
- files.image: <file>
822
- ```
823
-
824
- **Response:**
825
- ```json
826
- {
827
- "success": 1,
828
- "file": {
829
- "url": "https://cdn.example.com/image.jpg",
830
- "name": "image.jpg",
831
- "size": 123456
832
- }
833
- }
834
- ```
835
-
836
- #### Upload Image by URL
837
-
838
- ```http
839
- POST /api/magic-editor-x/image/byUrl
840
- Content-Type: application/json
841
-
842
- {
843
- "url": "https://example.com/image.jpg"
844
- }
845
- ```
795
+ Editor routes include `GET /magic-editor-x/link`, `POST /magic-editor-x/image/byFile`, `POST /magic-editor-x/image/byUrl`, and `POST /magic-editor-x/file/upload`. Link preview and URL upload accept remote URLs; the implementation restricts these requests to public HTTP(S) destinations and applies response size, MIME-type, redirect, and timeout limits. Upload routes require the admin plugin access and Strapi upload-create permissions.
846
796
 
847
- **Response:**
848
- ```json
849
- {
850
- "success": 1,
851
- "file": {
852
- "url": "https://cdn.example.com/image.jpg",
853
- "name": "image.jpg",
854
- "size": 123456
855
- }
856
- }
857
- ```
858
-
859
- ### Admin API Endpoints
860
-
861
- These endpoints require authentication and admin permissions:
862
-
863
- #### License Management
864
-
865
- ```http
866
- GET /magic-editor-x/license/status
867
- GET /magic-editor-x/license/limits
868
- POST /magic-editor-x/license/auto-create
869
- POST /magic-editor-x/license/store-key
870
- ```
871
-
872
- #### Collaboration Permissions
873
-
874
- ```http
875
- GET /magic-editor-x/collaboration/permissions
876
- POST /magic-editor-x/collaboration/permissions
877
- PUT /magic-editor-x/collaboration/permissions/:id
878
- DELETE /magic-editor-x/collaboration/permissions/:id
879
- ```
880
-
881
- #### Real-Time Sessions
882
-
883
- ```http
884
- POST /magic-editor-x/realtime/session-token
885
- ```
886
-
887
- **Request:**
888
- ```json
889
- {
890
- "roomId": "api::article.article|abc123|content",
891
- "fieldName": "content"
892
- }
893
- ```
894
-
895
- **Response:**
896
- ```json
897
- {
898
- "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
899
- "expiresAt": 1699999999999
900
- }
901
- ```
797
+ Other admin route groups manage collaboration sessions and permissions, license status and limits, snapshots, and custom blocks. Collaboration session creation checks the configured collaboration access rules. See `server/src/routes/admin.js` for the current route and policy definitions.
902
798
 
903
799
  ---
904
800
 
@@ -2,13 +2,14 @@ import { jsx, jsxs, Fragment } from "react/jsx-runtime";
2
2
  import { useState, useRef, useEffect } from "react";
3
3
  import { useNavigate, Routes, Route } from "react-router-dom";
4
4
  import { useFetchClient, useNotification, Page } from "@strapi/strapi/admin";
5
+ import { P as PLUGIN_ID, p as pluginPermissions } from "./index-FVEbTfqO.mjs";
5
6
  import styled, { css, keyframes } from "styled-components";
6
7
  import { HashtagIcon, DocumentTextIcon, ListBulletIcon, CheckIcon, ChatBubbleBottomCenterTextIcon, CodeBracketIcon, PhotoIcon, TableCellsIcon, LinkIcon, ExclamationTriangleIcon, PaperClipIcon, BellAlertIcon, SparklesIcon, BeakerIcon, PlayCircleIcon, ArrowPathIcon, EyeIcon, DocumentDuplicateIcon, ChevronRightIcon, CubeTransparentIcon, Cog6ToothIcon, UserGroupIcon, BookOpenIcon, CommandLineIcon, UserPlusIcon, TrashIcon, CheckCircleIcon, XMarkIcon, KeyIcon } from "@heroicons/react/24/outline";
7
8
  import EditorJS from "@editorjs/editorjs";
8
- import { u as useIntl, g as getTranslation, L as Loader, a as Box, T as Typography, F as Flex, c as TextInput, B as Button$2 } from "./getTranslation-bLklCCaI.mjs";
9
- import { g as getTools } from "./tools-uudZx91W.mjs";
10
- import { P as PLUGIN_ID } from "./index-CAPc_Y1F.mjs";
11
- import LicensePage from "./LicensePage-B2STSez2.mjs";
9
+ import { useIntl } from "react-intl";
10
+ import { g as getTools } from "./tools-CzHTZaY_.mjs";
11
+ import { g as getTranslation, k as kt, S, A, C, P as Pc, a as Ct } from "./getTranslation-2OiEgVGt.mjs";
12
+ import LicensePage from "./LicensePage-D0DMTF41.mjs";
12
13
  const fadeInUp = keyframes`
13
14
  from { opacity: 0; transform: translateY(20px); }
14
15
  to { opacity: 1; transform: translateY(0); }
@@ -1423,7 +1424,7 @@ const CollaborationSettings = () => {
1423
1424
  return `${first}${last}`.trim();
1424
1425
  };
1425
1426
  if (loading) {
1426
- return /* @__PURE__ */ jsx(Container, { children: /* @__PURE__ */ jsx(LoadingContainer, { children: /* @__PURE__ */ jsx(Loader, {}) }) });
1427
+ return /* @__PURE__ */ jsx(Container, { children: /* @__PURE__ */ jsx(LoadingContainer, { children: /* @__PURE__ */ jsx(kt, {}) }) });
1427
1428
  }
1428
1429
  return /* @__PURE__ */ jsxs(Container, { children: [
1429
1430
  /* @__PURE__ */ jsxs(Header, { children: [
@@ -1742,7 +1743,7 @@ const ModalOverlay = styled.div`
1742
1743
  animation: ${fadeIn} 0.3s ease-out;
1743
1744
  padding: 20px;
1744
1745
  `;
1745
- const ModalContent = styled(Box)`
1746
+ const ModalContent = styled(S)`
1746
1747
  background: white;
1747
1748
  border-radius: 16px;
1748
1749
  width: 100%;
@@ -1751,7 +1752,7 @@ const ModalContent = styled(Box)`
1751
1752
  animation: ${slideUp} 0.4s cubic-bezier(0.4, 0, 0.2, 1);
1752
1753
  overflow: hidden;
1753
1754
  `;
1754
- const GradientHeader = styled(Box)`
1755
+ const GradientHeader = styled(S)`
1755
1756
  background: linear-gradient(135deg, #7C3AED 0%, #6d28d9 100%);
1756
1757
  padding: 32px 40px;
1757
1758
  position: relative;
@@ -1836,7 +1837,7 @@ const ToggleButton = styled.button`
1836
1837
  cursor: not-allowed;
1837
1838
  }
1838
1839
  `;
1839
- const InfoBox = styled(Box)`
1840
+ const InfoBox = styled(S)`
1840
1841
  background: #f0fdf4;
1841
1842
  border: 2px solid #bbf7d0;
1842
1843
  border-radius: 8px;
@@ -1956,16 +1957,16 @@ const LicenseGuard = ({ children }) => {
1956
1957
  navigate("/content-manager");
1957
1958
  };
1958
1959
  if (isChecking) {
1959
- return /* @__PURE__ */ jsx(Box, { padding: 8, style: { textAlign: "center" }, children: /* @__PURE__ */ jsx(Loader, { children: t("license.checking", "Checking license...") }) });
1960
+ return /* @__PURE__ */ jsx(S, { padding: 8, style: { textAlign: "center" }, children: /* @__PURE__ */ jsx(kt, { children: t("license.checking", "Checking license...") }) });
1960
1961
  }
1961
1962
  if (needsLicense) {
1962
1963
  return /* @__PURE__ */ jsx(ModalOverlay, { children: /* @__PURE__ */ jsxs(ModalContent, { children: [
1963
1964
  /* @__PURE__ */ jsxs(GradientHeader, { children: [
1964
1965
  /* @__PURE__ */ jsx(CloseButton, { onClick: handleClose, type: "button", children: /* @__PURE__ */ jsx(XMarkIcon, {}) }),
1965
1966
  /* @__PURE__ */ jsx(IconWrapper, { children: /* @__PURE__ */ jsx(KeyIcon, {}) }),
1966
- /* @__PURE__ */ jsxs(Box, { style: { textAlign: "center", position: "relative" }, children: [
1967
+ /* @__PURE__ */ jsxs(S, { style: { textAlign: "center", position: "relative" }, children: [
1967
1968
  /* @__PURE__ */ jsx(
1968
- Typography,
1969
+ A,
1969
1970
  {
1970
1971
  variant: "alpha",
1971
1972
  style: {
@@ -1979,7 +1980,7 @@ const LicenseGuard = ({ children }) => {
1979
1980
  }
1980
1981
  ),
1981
1982
  /* @__PURE__ */ jsx(
1982
- Typography,
1983
+ A,
1983
1984
  {
1984
1985
  variant: "epsilon",
1985
1986
  style: {
@@ -1992,12 +1993,12 @@ const LicenseGuard = ({ children }) => {
1992
1993
  )
1993
1994
  ] })
1994
1995
  ] }),
1995
- /* @__PURE__ */ jsx("form", { onSubmit: useExistingKey ? handleValidateExistingKey : handleAutoCreateLicense, children: /* @__PURE__ */ jsx(Box, { padding: 6, paddingLeft: 8, paddingRight: 8, children: /* @__PURE__ */ jsxs(Flex, { direction: "column", gap: 5, style: { width: "100%" }, children: [
1996
- /* @__PURE__ */ jsx(InfoBox, { children: /* @__PURE__ */ jsxs(Typography, { variant: "omega", style: { fontSize: "13px", lineHeight: "1.6" }, children: [
1996
+ /* @__PURE__ */ jsx("form", { onSubmit: useExistingKey ? handleValidateExistingKey : handleAutoCreateLicense, children: /* @__PURE__ */ jsx(S, { padding: 6, paddingLeft: 8, paddingRight: 8, children: /* @__PURE__ */ jsxs(C, { direction: "column", gap: 5, style: { width: "100%" }, children: [
1997
+ /* @__PURE__ */ jsx(InfoBox, { children: /* @__PURE__ */ jsxs(A, { variant: "omega", style: { fontSize: "13px", lineHeight: "1.6" }, children: [
1997
1998
  "[FREE] ",
1998
1999
  t("licenseGuard.info", "The editor is completely FREE to use! Creating a license helps us track usage and provide better support. You get 2 collaborators included.")
1999
2000
  ] }) }),
2000
- /* @__PURE__ */ jsx(Box, { style: { textAlign: "center", width: "100%" }, children: /* @__PURE__ */ jsx(
2001
+ /* @__PURE__ */ jsx(S, { style: { textAlign: "center", width: "100%" }, children: /* @__PURE__ */ jsx(
2001
2002
  ToggleButton,
2002
2003
  {
2003
2004
  type: "button",
@@ -2007,9 +2008,9 @@ const LicenseGuard = ({ children }) => {
2007
2008
  }
2008
2009
  ) }),
2009
2010
  useExistingKey ? /* @__PURE__ */ jsxs(Fragment, { children: [
2010
- /* @__PURE__ */ jsxs(Box, { style: { width: "100%" }, children: [
2011
+ /* @__PURE__ */ jsxs(S, { style: { width: "100%" }, children: [
2011
2012
  /* @__PURE__ */ jsxs(
2012
- Typography,
2013
+ A,
2013
2014
  {
2014
2015
  variant: "pi",
2015
2016
  fontWeight: "bold",
@@ -2021,7 +2022,7 @@ const LicenseGuard = ({ children }) => {
2021
2022
  }
2022
2023
  ),
2023
2024
  /* @__PURE__ */ jsx(
2024
- TextInput,
2025
+ Pc,
2025
2026
  {
2026
2027
  placeholder: t("licenseGuard.email.placeholder", "admin@example.com"),
2027
2028
  type: "email",
@@ -2032,9 +2033,9 @@ const LicenseGuard = ({ children }) => {
2032
2033
  }
2033
2034
  )
2034
2035
  ] }),
2035
- /* @__PURE__ */ jsxs(Box, { style: { width: "100%" }, children: [
2036
+ /* @__PURE__ */ jsxs(S, { style: { width: "100%" }, children: [
2036
2037
  /* @__PURE__ */ jsxs(
2037
- Typography,
2038
+ A,
2038
2039
  {
2039
2040
  variant: "pi",
2040
2041
  fontWeight: "bold",
@@ -2046,7 +2047,7 @@ const LicenseGuard = ({ children }) => {
2046
2047
  }
2047
2048
  ),
2048
2049
  /* @__PURE__ */ jsx(
2049
- TextInput,
2050
+ Pc,
2050
2051
  {
2051
2052
  placeholder: t("licenseGuard.licenseKey.placeholder", "MAGIC-EDITOR-XXXX-XXXX-XXXX"),
2052
2053
  value: existingLicenseKey,
@@ -2057,7 +2058,7 @@ const LicenseGuard = ({ children }) => {
2057
2058
  )
2058
2059
  ] })
2059
2060
  ] }) : adminUser ? /* @__PURE__ */ jsxs(
2060
- Box,
2061
+ S,
2061
2062
  {
2062
2063
  background: "success100",
2063
2064
  padding: 5,
@@ -2067,22 +2068,22 @@ const LicenseGuard = ({ children }) => {
2067
2068
  textAlign: "center"
2068
2069
  },
2069
2070
  children: [
2070
- /* @__PURE__ */ jsx(Typography, { variant: "omega", fontWeight: "bold", style: { marginBottom: "12px", display: "block" }, children: t("licenseGuard.readyToActivate", "Ready to activate with your account:") }),
2071
- /* @__PURE__ */ jsxs(Typography, { variant: "pi", style: { marginBottom: "4px", display: "block" }, children: [
2071
+ /* @__PURE__ */ jsx(A, { variant: "omega", fontWeight: "bold", style: { marginBottom: "12px", display: "block" }, children: t("licenseGuard.readyToActivate", "Ready to activate with your account:") }),
2072
+ /* @__PURE__ */ jsxs(A, { variant: "pi", style: { marginBottom: "4px", display: "block" }, children: [
2072
2073
  adminUser.firstname || "Admin",
2073
2074
  " ",
2074
2075
  adminUser.lastname || "User"
2075
2076
  ] }),
2076
- /* @__PURE__ */ jsx(Typography, { variant: "pi", textColor: "neutral600", children: adminUser.email || "Loading..." })
2077
+ /* @__PURE__ */ jsx(A, { variant: "pi", textColor: "neutral600", children: adminUser.email || "Loading..." })
2077
2078
  ]
2078
2079
  }
2079
- ) : /* @__PURE__ */ jsxs(Box, { padding: 4, background: "neutral100", hasRadius: true, style: { textAlign: "center" }, children: [
2080
- /* @__PURE__ */ jsx(Loader, { small: true }),
2081
- /* @__PURE__ */ jsx(Typography, { variant: "pi", marginTop: 2, children: t("licenseGuard.loadingUser", "Loading admin user data...") })
2080
+ ) : /* @__PURE__ */ jsxs(S, { padding: 4, background: "neutral100", hasRadius: true, style: { textAlign: "center" }, children: [
2081
+ /* @__PURE__ */ jsx(kt, { small: true }),
2082
+ /* @__PURE__ */ jsx(A, { variant: "pi", marginTop: 2, children: t("licenseGuard.loadingUser", "Loading admin user data...") })
2082
2083
  ] }),
2083
- /* @__PURE__ */ jsxs(Flex, { gap: 3, justifyContent: "center", style: { marginTop: "16px" }, children: [
2084
+ /* @__PURE__ */ jsxs(C, { gap: 3, justifyContent: "center", style: { marginTop: "16px" }, children: [
2084
2085
  /* @__PURE__ */ jsx(
2085
- Button$2,
2086
+ Ct,
2086
2087
  {
2087
2088
  variant: "tertiary",
2088
2089
  onClick: handleSkip,
@@ -2091,7 +2092,7 @@ const LicenseGuard = ({ children }) => {
2091
2092
  }
2092
2093
  ),
2093
2094
  useExistingKey ? /* @__PURE__ */ jsx(
2094
- Button$2,
2095
+ Ct,
2095
2096
  {
2096
2097
  type: "submit",
2097
2098
  size: "L",
@@ -2107,7 +2108,7 @@ const LicenseGuard = ({ children }) => {
2107
2108
  children: t("licenseGuard.validate", "Validate License")
2108
2109
  }
2109
2110
  ) : /* @__PURE__ */ jsx(
2110
- Button$2,
2111
+ Ct,
2111
2112
  {
2112
2113
  type: "submit",
2113
2114
  size: "L",
@@ -2130,12 +2131,12 @@ const LicenseGuard = ({ children }) => {
2130
2131
  return /* @__PURE__ */ jsx(Fragment, { children });
2131
2132
  };
2132
2133
  const App = () => {
2133
- return /* @__PURE__ */ jsx(LicenseGuard, { children: /* @__PURE__ */ jsxs(Routes, { children: [
2134
+ return /* @__PURE__ */ jsx(Page.Protect, { permissions: pluginPermissions.access, children: /* @__PURE__ */ jsx(LicenseGuard, { children: /* @__PURE__ */ jsxs(Routes, { children: [
2134
2135
  /* @__PURE__ */ jsx(Route, { index: true, element: /* @__PURE__ */ jsx(HomePage, {}) }),
2135
2136
  /* @__PURE__ */ jsx(Route, { path: "collaboration", element: /* @__PURE__ */ jsx(CollaborationSettings, {}) }),
2136
2137
  /* @__PURE__ */ jsx(Route, { path: "license", element: /* @__PURE__ */ jsx(LicensePage, {}) }),
2137
2138
  /* @__PURE__ */ jsx(Route, { path: "*", element: /* @__PURE__ */ jsx(Page.Error, {}) })
2138
- ] }) });
2139
+ ] }) }) });
2139
2140
  };
2140
2141
  export {
2141
2142
  App,
@@ -1,16 +1,17 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  const jsxRuntime = require("react/jsx-runtime");
4
- const React = require("react");
4
+ const s = require("react");
5
5
  const reactRouterDom = require("react-router-dom");
6
6
  const admin = require("@strapi/strapi/admin");
7
+ const index = require("./index-Bn2tfJrC.js");
7
8
  const styled = require("styled-components");
8
9
  const outline = require("@heroicons/react/24/outline");
9
10
  const EditorJS = require("@editorjs/editorjs");
10
- const getTranslation = require("./getTranslation--JcqVOd5.js");
11
- const tools = require("./tools-BSMn5LLQ.js");
12
- const index = require("./index-CPs6WJDY.js");
13
- const LicensePage = require("./LicensePage-vJxKYZGQ.js");
11
+ const reactIntl = require("react-intl");
12
+ const tools = require("./tools-DALFhvPO.js");
13
+ const getTranslation = require("./getTranslation-DQ_WJ-7M.js");
14
+ const LicensePage = require("./LicensePage-D0_9yPkw.js");
14
15
  const _interopDefault = (e) => e && e.__esModule ? e : { default: e };
15
16
  const styled__default = /* @__PURE__ */ _interopDefault(styled);
16
17
  const EditorJS__default = /* @__PURE__ */ _interopDefault(EditorJS);
@@ -515,14 +516,14 @@ const QuickLinkArrow = styled__default.default.div`
515
516
  `;
516
517
  const HomePage = () => {
517
518
  const navigate = reactRouterDom.useNavigate();
518
- const { formatMessage } = getTranslation.useIntl();
519
+ const { formatMessage } = reactIntl.useIntl();
519
520
  const t = (id, defaultMessage, values) => formatMessage({ id: getTranslation.getTranslation(id), defaultMessage }, values);
520
- const [activeTab, setActiveTab] = React.useState("playground");
521
- const [editorData, setEditorData] = React.useState(null);
522
- const [isLoading, setIsLoading] = React.useState(false);
523
- const [hasContent, setHasContent] = React.useState(false);
524
- const editorRef = React.useRef(null);
525
- const editorInstanceRef = React.useRef(null);
521
+ const [activeTab, setActiveTab] = s.useState("playground");
522
+ const [editorData, setEditorData] = s.useState(null);
523
+ const [isLoading, setIsLoading] = s.useState(false);
524
+ const [hasContent, setHasContent] = s.useState(false);
525
+ const editorRef = s.useRef(null);
526
+ const editorInstanceRef = s.useRef(null);
526
527
  const toolsData = [
527
528
  { name: t("tools.header", "Header"), desc: t("tools.header.desc", "H1-H6 Headings"), icon: outline.HashtagIcon, color: "linear-gradient(135deg, #7C3AED, #6366f1)" },
528
529
  { name: t("tools.paragraph", "Paragraph"), desc: t("tools.paragraph.desc", "Text paragraphs"), icon: outline.DocumentTextIcon, color: "linear-gradient(135deg, #334155, #475569)" },
@@ -547,7 +548,7 @@ const HomePage = () => {
547
548
  { keys: ["Tab"], label: t("shortcuts.blockMenu", "Block Menu") },
548
549
  { keys: ["⌘", "Z"], label: t("shortcuts.undo", "Undo") }
549
550
  ];
550
- React.useEffect(() => {
551
+ s.useEffect(() => {
551
552
  if (activeTab === "playground" && editorRef.current && !editorInstanceRef.current) {
552
553
  const tools$1 = tools.getTools({
553
554
  mediaLibToggleFunc: () => {
@@ -1271,20 +1272,20 @@ styled__default.default.span`
1271
1272
  }
1272
1273
  `;
1273
1274
  const CollaborationSettings = () => {
1274
- const { formatMessage } = getTranslation.useIntl();
1275
+ const { formatMessage } = reactIntl.useIntl();
1275
1276
  const t = (id, defaultMessage, values) => formatMessage({ id: getTranslation.getTranslation(id), defaultMessage }, values);
1276
1277
  const { get, post, put, del } = admin.useFetchClient();
1277
- const [loading, setLoading] = React.useState(true);
1278
- const [permissions, setPermissions] = React.useState([]);
1279
- const [users, setUsers] = React.useState([]);
1280
- const [contentTypes, setContentTypes] = React.useState([]);
1281
- const [showAddModal, setShowAddModal] = React.useState(false);
1282
- const [selectedUser, setSelectedUser] = React.useState("");
1283
- const [selectedRole, setSelectedRole] = React.useState("editor");
1284
- const [contentType, setContentType] = React.useState("");
1285
- const [saving, setSaving] = React.useState(false);
1286
- const [limits, setLimits] = React.useState({ current: 0, max: 2, unlimited: false, canAdd: true });
1287
- React.useEffect(() => {
1278
+ const [loading, setLoading] = s.useState(true);
1279
+ const [permissions, setPermissions] = s.useState([]);
1280
+ const [users, setUsers] = s.useState([]);
1281
+ const [contentTypes, setContentTypes] = s.useState([]);
1282
+ const [showAddModal, setShowAddModal] = s.useState(false);
1283
+ const [selectedUser, setSelectedUser] = s.useState("");
1284
+ const [selectedRole, setSelectedRole] = s.useState("editor");
1285
+ const [contentType, setContentType] = s.useState("");
1286
+ const [saving, setSaving] = s.useState(false);
1287
+ const [limits, setLimits] = s.useState({ current: 0, max: 2, unlimited: false, canAdd: true });
1288
+ s.useEffect(() => {
1288
1289
  loadData();
1289
1290
  loadLimits();
1290
1291
  }, []);
@@ -1428,7 +1429,7 @@ const CollaborationSettings = () => {
1428
1429
  return `${first}${last}`.trim();
1429
1430
  };
1430
1431
  if (loading) {
1431
- return /* @__PURE__ */ jsxRuntime.jsx(Container, { children: /* @__PURE__ */ jsxRuntime.jsx(LoadingContainer, { children: /* @__PURE__ */ jsxRuntime.jsx(getTranslation.Loader, {}) }) });
1432
+ return /* @__PURE__ */ jsxRuntime.jsx(Container, { children: /* @__PURE__ */ jsxRuntime.jsx(LoadingContainer, { children: /* @__PURE__ */ jsxRuntime.jsx(getTranslation.kt, {}) }) });
1432
1433
  }
1433
1434
  return /* @__PURE__ */ jsxRuntime.jsxs(Container, { children: [
1434
1435
  /* @__PURE__ */ jsxRuntime.jsxs(Header, { children: [
@@ -1747,7 +1748,7 @@ const ModalOverlay = styled__default.default.div`
1747
1748
  animation: ${fadeIn} 0.3s ease-out;
1748
1749
  padding: 20px;
1749
1750
  `;
1750
- const ModalContent = styled__default.default(getTranslation.Box)`
1751
+ const ModalContent = styled__default.default(getTranslation.S)`
1751
1752
  background: white;
1752
1753
  border-radius: 16px;
1753
1754
  width: 100%;
@@ -1756,7 +1757,7 @@ const ModalContent = styled__default.default(getTranslation.Box)`
1756
1757
  animation: ${slideUp} 0.4s cubic-bezier(0.4, 0, 0.2, 1);
1757
1758
  overflow: hidden;
1758
1759
  `;
1759
- const GradientHeader = styled__default.default(getTranslation.Box)`
1760
+ const GradientHeader = styled__default.default(getTranslation.S)`
1760
1761
  background: linear-gradient(135deg, #7C3AED 0%, #6d28d9 100%);
1761
1762
  padding: 32px 40px;
1762
1763
  position: relative;
@@ -1841,7 +1842,7 @@ const ToggleButton = styled__default.default.button`
1841
1842
  cursor: not-allowed;
1842
1843
  }
1843
1844
  `;
1844
- const InfoBox = styled__default.default(getTranslation.Box)`
1845
+ const InfoBox = styled__default.default(getTranslation.S)`
1845
1846
  background: #f0fdf4;
1846
1847
  border: 2px solid #bbf7d0;
1847
1848
  border-radius: 8px;
@@ -1849,19 +1850,19 @@ const InfoBox = styled__default.default(getTranslation.Box)`
1849
1850
  margin-bottom: 20px;
1850
1851
  `;
1851
1852
  const LicenseGuard = ({ children }) => {
1852
- const { formatMessage } = getTranslation.useIntl();
1853
+ const { formatMessage } = reactIntl.useIntl();
1853
1854
  const t = (id, defaultMessage, values) => formatMessage({ id: getTranslation.getTranslation(id), defaultMessage }, values);
1854
1855
  const { get, post } = admin.useFetchClient();
1855
1856
  const { toggleNotification } = admin.useNotification();
1856
1857
  const navigate = reactRouterDom.useNavigate();
1857
- const [isChecking, setIsChecking] = React.useState(true);
1858
- const [needsLicense, setNeedsLicense] = React.useState(false);
1859
- const [isCreating, setIsCreating] = React.useState(false);
1860
- const [useExistingKey, setUseExistingKey] = React.useState(false);
1861
- const [existingLicenseKey, setExistingLicenseKey] = React.useState("");
1862
- const [existingEmail, setExistingEmail] = React.useState("");
1863
- const [adminUser, setAdminUser] = React.useState(null);
1864
- React.useEffect(() => {
1858
+ const [isChecking, setIsChecking] = s.useState(true);
1859
+ const [needsLicense, setNeedsLicense] = s.useState(false);
1860
+ const [isCreating, setIsCreating] = s.useState(false);
1861
+ const [useExistingKey, setUseExistingKey] = s.useState(false);
1862
+ const [existingLicenseKey, setExistingLicenseKey] = s.useState("");
1863
+ const [existingEmail, setExistingEmail] = s.useState("");
1864
+ const [adminUser, setAdminUser] = s.useState(null);
1865
+ s.useEffect(() => {
1865
1866
  checkLicenseStatus();
1866
1867
  fetchAdminUser();
1867
1868
  }, []);
@@ -1961,16 +1962,16 @@ const LicenseGuard = ({ children }) => {
1961
1962
  navigate("/content-manager");
1962
1963
  };
1963
1964
  if (isChecking) {
1964
- return /* @__PURE__ */ jsxRuntime.jsx(getTranslation.Box, { padding: 8, style: { textAlign: "center" }, children: /* @__PURE__ */ jsxRuntime.jsx(getTranslation.Loader, { children: t("license.checking", "Checking license...") }) });
1965
+ return /* @__PURE__ */ jsxRuntime.jsx(getTranslation.S, { padding: 8, style: { textAlign: "center" }, children: /* @__PURE__ */ jsxRuntime.jsx(getTranslation.kt, { children: t("license.checking", "Checking license...") }) });
1965
1966
  }
1966
1967
  if (needsLicense) {
1967
1968
  return /* @__PURE__ */ jsxRuntime.jsx(ModalOverlay, { children: /* @__PURE__ */ jsxRuntime.jsxs(ModalContent, { children: [
1968
1969
  /* @__PURE__ */ jsxRuntime.jsxs(GradientHeader, { children: [
1969
1970
  /* @__PURE__ */ jsxRuntime.jsx(CloseButton, { onClick: handleClose, type: "button", children: /* @__PURE__ */ jsxRuntime.jsx(outline.XMarkIcon, {}) }),
1970
1971
  /* @__PURE__ */ jsxRuntime.jsx(IconWrapper, { children: /* @__PURE__ */ jsxRuntime.jsx(outline.KeyIcon, {}) }),
1971
- /* @__PURE__ */ jsxRuntime.jsxs(getTranslation.Box, { style: { textAlign: "center", position: "relative" }, children: [
1972
+ /* @__PURE__ */ jsxRuntime.jsxs(getTranslation.S, { style: { textAlign: "center", position: "relative" }, children: [
1972
1973
  /* @__PURE__ */ jsxRuntime.jsx(
1973
- getTranslation.Typography,
1974
+ getTranslation.A,
1974
1975
  {
1975
1976
  variant: "alpha",
1976
1977
  style: {
@@ -1984,7 +1985,7 @@ const LicenseGuard = ({ children }) => {
1984
1985
  }
1985
1986
  ),
1986
1987
  /* @__PURE__ */ jsxRuntime.jsx(
1987
- getTranslation.Typography,
1988
+ getTranslation.A,
1988
1989
  {
1989
1990
  variant: "epsilon",
1990
1991
  style: {
@@ -1997,12 +1998,12 @@ const LicenseGuard = ({ children }) => {
1997
1998
  )
1998
1999
  ] })
1999
2000
  ] }),
2000
- /* @__PURE__ */ jsxRuntime.jsx("form", { onSubmit: useExistingKey ? handleValidateExistingKey : handleAutoCreateLicense, children: /* @__PURE__ */ jsxRuntime.jsx(getTranslation.Box, { padding: 6, paddingLeft: 8, paddingRight: 8, children: /* @__PURE__ */ jsxRuntime.jsxs(getTranslation.Flex, { direction: "column", gap: 5, style: { width: "100%" }, children: [
2001
- /* @__PURE__ */ jsxRuntime.jsx(InfoBox, { children: /* @__PURE__ */ jsxRuntime.jsxs(getTranslation.Typography, { variant: "omega", style: { fontSize: "13px", lineHeight: "1.6" }, children: [
2001
+ /* @__PURE__ */ jsxRuntime.jsx("form", { onSubmit: useExistingKey ? handleValidateExistingKey : handleAutoCreateLicense, children: /* @__PURE__ */ jsxRuntime.jsx(getTranslation.S, { padding: 6, paddingLeft: 8, paddingRight: 8, children: /* @__PURE__ */ jsxRuntime.jsxs(getTranslation.C, { direction: "column", gap: 5, style: { width: "100%" }, children: [
2002
+ /* @__PURE__ */ jsxRuntime.jsx(InfoBox, { children: /* @__PURE__ */ jsxRuntime.jsxs(getTranslation.A, { variant: "omega", style: { fontSize: "13px", lineHeight: "1.6" }, children: [
2002
2003
  "[FREE] ",
2003
2004
  t("licenseGuard.info", "The editor is completely FREE to use! Creating a license helps us track usage and provide better support. You get 2 collaborators included.")
2004
2005
  ] }) }),
2005
- /* @__PURE__ */ jsxRuntime.jsx(getTranslation.Box, { style: { textAlign: "center", width: "100%" }, children: /* @__PURE__ */ jsxRuntime.jsx(
2006
+ /* @__PURE__ */ jsxRuntime.jsx(getTranslation.S, { style: { textAlign: "center", width: "100%" }, children: /* @__PURE__ */ jsxRuntime.jsx(
2006
2007
  ToggleButton,
2007
2008
  {
2008
2009
  type: "button",
@@ -2012,9 +2013,9 @@ const LicenseGuard = ({ children }) => {
2012
2013
  }
2013
2014
  ) }),
2014
2015
  useExistingKey ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
2015
- /* @__PURE__ */ jsxRuntime.jsxs(getTranslation.Box, { style: { width: "100%" }, children: [
2016
+ /* @__PURE__ */ jsxRuntime.jsxs(getTranslation.S, { style: { width: "100%" }, children: [
2016
2017
  /* @__PURE__ */ jsxRuntime.jsxs(
2017
- getTranslation.Typography,
2018
+ getTranslation.A,
2018
2019
  {
2019
2020
  variant: "pi",
2020
2021
  fontWeight: "bold",
@@ -2026,7 +2027,7 @@ const LicenseGuard = ({ children }) => {
2026
2027
  }
2027
2028
  ),
2028
2029
  /* @__PURE__ */ jsxRuntime.jsx(
2029
- getTranslation.TextInput,
2030
+ getTranslation.Pc,
2030
2031
  {
2031
2032
  placeholder: t("licenseGuard.email.placeholder", "admin@example.com"),
2032
2033
  type: "email",
@@ -2037,9 +2038,9 @@ const LicenseGuard = ({ children }) => {
2037
2038
  }
2038
2039
  )
2039
2040
  ] }),
2040
- /* @__PURE__ */ jsxRuntime.jsxs(getTranslation.Box, { style: { width: "100%" }, children: [
2041
+ /* @__PURE__ */ jsxRuntime.jsxs(getTranslation.S, { style: { width: "100%" }, children: [
2041
2042
  /* @__PURE__ */ jsxRuntime.jsxs(
2042
- getTranslation.Typography,
2043
+ getTranslation.A,
2043
2044
  {
2044
2045
  variant: "pi",
2045
2046
  fontWeight: "bold",
@@ -2051,7 +2052,7 @@ const LicenseGuard = ({ children }) => {
2051
2052
  }
2052
2053
  ),
2053
2054
  /* @__PURE__ */ jsxRuntime.jsx(
2054
- getTranslation.TextInput,
2055
+ getTranslation.Pc,
2055
2056
  {
2056
2057
  placeholder: t("licenseGuard.licenseKey.placeholder", "MAGIC-EDITOR-XXXX-XXXX-XXXX"),
2057
2058
  value: existingLicenseKey,
@@ -2062,7 +2063,7 @@ const LicenseGuard = ({ children }) => {
2062
2063
  )
2063
2064
  ] })
2064
2065
  ] }) : adminUser ? /* @__PURE__ */ jsxRuntime.jsxs(
2065
- getTranslation.Box,
2066
+ getTranslation.S,
2066
2067
  {
2067
2068
  background: "success100",
2068
2069
  padding: 5,
@@ -2072,22 +2073,22 @@ const LicenseGuard = ({ children }) => {
2072
2073
  textAlign: "center"
2073
2074
  },
2074
2075
  children: [
2075
- /* @__PURE__ */ jsxRuntime.jsx(getTranslation.Typography, { variant: "omega", fontWeight: "bold", style: { marginBottom: "12px", display: "block" }, children: t("licenseGuard.readyToActivate", "Ready to activate with your account:") }),
2076
- /* @__PURE__ */ jsxRuntime.jsxs(getTranslation.Typography, { variant: "pi", style: { marginBottom: "4px", display: "block" }, children: [
2076
+ /* @__PURE__ */ jsxRuntime.jsx(getTranslation.A, { variant: "omega", fontWeight: "bold", style: { marginBottom: "12px", display: "block" }, children: t("licenseGuard.readyToActivate", "Ready to activate with your account:") }),
2077
+ /* @__PURE__ */ jsxRuntime.jsxs(getTranslation.A, { variant: "pi", style: { marginBottom: "4px", display: "block" }, children: [
2077
2078
  adminUser.firstname || "Admin",
2078
2079
  " ",
2079
2080
  adminUser.lastname || "User"
2080
2081
  ] }),
2081
- /* @__PURE__ */ jsxRuntime.jsx(getTranslation.Typography, { variant: "pi", textColor: "neutral600", children: adminUser.email || "Loading..." })
2082
+ /* @__PURE__ */ jsxRuntime.jsx(getTranslation.A, { variant: "pi", textColor: "neutral600", children: adminUser.email || "Loading..." })
2082
2083
  ]
2083
2084
  }
2084
- ) : /* @__PURE__ */ jsxRuntime.jsxs(getTranslation.Box, { padding: 4, background: "neutral100", hasRadius: true, style: { textAlign: "center" }, children: [
2085
- /* @__PURE__ */ jsxRuntime.jsx(getTranslation.Loader, { small: true }),
2086
- /* @__PURE__ */ jsxRuntime.jsx(getTranslation.Typography, { variant: "pi", marginTop: 2, children: t("licenseGuard.loadingUser", "Loading admin user data...") })
2085
+ ) : /* @__PURE__ */ jsxRuntime.jsxs(getTranslation.S, { padding: 4, background: "neutral100", hasRadius: true, style: { textAlign: "center" }, children: [
2086
+ /* @__PURE__ */ jsxRuntime.jsx(getTranslation.kt, { small: true }),
2087
+ /* @__PURE__ */ jsxRuntime.jsx(getTranslation.A, { variant: "pi", marginTop: 2, children: t("licenseGuard.loadingUser", "Loading admin user data...") })
2087
2088
  ] }),
2088
- /* @__PURE__ */ jsxRuntime.jsxs(getTranslation.Flex, { gap: 3, justifyContent: "center", style: { marginTop: "16px" }, children: [
2089
+ /* @__PURE__ */ jsxRuntime.jsxs(getTranslation.C, { gap: 3, justifyContent: "center", style: { marginTop: "16px" }, children: [
2089
2090
  /* @__PURE__ */ jsxRuntime.jsx(
2090
- getTranslation.Button,
2091
+ getTranslation.Ct,
2091
2092
  {
2092
2093
  variant: "tertiary",
2093
2094
  onClick: handleSkip,
@@ -2096,7 +2097,7 @@ const LicenseGuard = ({ children }) => {
2096
2097
  }
2097
2098
  ),
2098
2099
  useExistingKey ? /* @__PURE__ */ jsxRuntime.jsx(
2099
- getTranslation.Button,
2100
+ getTranslation.Ct,
2100
2101
  {
2101
2102
  type: "submit",
2102
2103
  size: "L",
@@ -2112,7 +2113,7 @@ const LicenseGuard = ({ children }) => {
2112
2113
  children: t("licenseGuard.validate", "Validate License")
2113
2114
  }
2114
2115
  ) : /* @__PURE__ */ jsxRuntime.jsx(
2115
- getTranslation.Button,
2116
+ getTranslation.Ct,
2116
2117
  {
2117
2118
  type: "submit",
2118
2119
  size: "L",
@@ -2135,12 +2136,12 @@ const LicenseGuard = ({ children }) => {
2135
2136
  return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children });
2136
2137
  };
2137
2138
  const App = () => {
2138
- return /* @__PURE__ */ jsxRuntime.jsx(LicenseGuard, { children: /* @__PURE__ */ jsxRuntime.jsxs(reactRouterDom.Routes, { children: [
2139
+ return /* @__PURE__ */ jsxRuntime.jsx(admin.Page.Protect, { permissions: index.pluginPermissions.access, children: /* @__PURE__ */ jsxRuntime.jsx(LicenseGuard, { children: /* @__PURE__ */ jsxRuntime.jsxs(reactRouterDom.Routes, { children: [
2139
2140
  /* @__PURE__ */ jsxRuntime.jsx(reactRouterDom.Route, { index: true, element: /* @__PURE__ */ jsxRuntime.jsx(HomePage, {}) }),
2140
2141
  /* @__PURE__ */ jsxRuntime.jsx(reactRouterDom.Route, { path: "collaboration", element: /* @__PURE__ */ jsxRuntime.jsx(CollaborationSettings, {}) }),
2141
2142
  /* @__PURE__ */ jsxRuntime.jsx(reactRouterDom.Route, { path: "license", element: /* @__PURE__ */ jsxRuntime.jsx(LicensePage.default, {}) }),
2142
2143
  /* @__PURE__ */ jsxRuntime.jsx(reactRouterDom.Route, { path: "*", element: /* @__PURE__ */ jsxRuntime.jsx(admin.Page.Error, {}) })
2143
- ] }) });
2144
+ ] }) }) });
2144
2145
  };
2145
2146
  exports.App = App;
2146
2147
  exports.default = App;