magic-editor-x 1.4.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.
- package/dist/_chunks/{App-ByYQ99dO.js → App-DImBvISP.js} +59 -59
- package/dist/_chunks/{App-C8q91Ico.mjs → App-iNfbV7cz.mjs} +32 -32
- package/dist/_chunks/{CustomBlocksPage-rLRB05j0.mjs → CustomBlocksPage-COPOZ2-_.mjs} +2 -1
- package/dist/_chunks/{CustomBlocksPage-BkmF2iOQ.js → CustomBlocksPage-Cj-0TTUs.js} +14 -13
- package/dist/_chunks/{LicensePage-Bdn7zWU2.js → LicensePage-CmvILX9m.js} +43 -43
- package/dist/_chunks/{LicensePage-DR_Cwyfw.mjs → LicensePage-gLRoo8WJ.mjs} +38 -38
- package/dist/_chunks/{LiveCollaborationPanel-BUHIq0CQ.js → LiveCollaborationPanel-BFybu8h0.js} +7 -7
- package/dist/_chunks/{LiveCollaborationPanel-0tplv17N.mjs → LiveCollaborationPanel-CVgl4IyR.mjs} +3 -3
- package/dist/_chunks/{Settings-FfpVHlpw.mjs → Settings-ButYcfrm.mjs} +82 -82
- package/dist/_chunks/Settings-BzGqgrxD.js +440 -0
- package/dist/_chunks/{getTranslation-DOJ3x1SL.js → getTranslation-BADoesEn.js} +19120 -12315
- package/dist/_chunks/{getTranslation-Bk8tKbUs.mjs → getTranslation-D3h3Z3gU.mjs} +18708 -11903
- package/dist/_chunks/index-BXBnwuRw.js +2158 -0
- package/dist/_chunks/index-BvEdg518.mjs +2159 -0
- package/dist/_chunks/{index-DzixAi6O.js → index-DDFAuQNT.js} +360 -180
- package/dist/_chunks/{index-zOiCW1bZ.mjs → index-DEi6nwfM.mjs} +215 -35
- package/dist/_chunks/{tools-uudZx91W.mjs → tools-BXzd0lx5.mjs} +3 -3
- package/dist/_chunks/{tools-BSMn5LLQ.js → tools-Q0uwDS9E.js} +10 -10
- package/dist/admin/index.js +1 -1
- package/dist/admin/index.mjs +2 -2
- package/dist/server/index.js +142 -135
- package/dist/server/index.mjs +142 -135
- package/package.json +7 -7
- package/dist/_chunks/Settings-B5mffA2O.js +0 -440
- package/dist/_chunks/index-C5DuaTDl.js +0 -2550
- package/dist/_chunks/index-DkpTkVe7.mjs +0 -2551
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
3
|
const jsxRuntime = require("react/jsx-runtime");
|
|
4
|
-
const
|
|
4
|
+
const m = require("react");
|
|
5
5
|
const reactRouterDom = require("react-router-dom");
|
|
6
6
|
const admin = require("@strapi/strapi/admin");
|
|
7
7
|
const styled = require("styled-components");
|
|
8
8
|
const outline = require("@heroicons/react/24/outline");
|
|
9
9
|
const EditorJS = require("@editorjs/editorjs");
|
|
10
|
-
const getTranslation = require("./getTranslation-
|
|
11
|
-
const tools = require("./tools-
|
|
12
|
-
const index = require("./index-
|
|
13
|
-
const LicensePage = require("./LicensePage-
|
|
10
|
+
const getTranslation = require("./getTranslation-BADoesEn.js");
|
|
11
|
+
const tools = require("./tools-Q0uwDS9E.js");
|
|
12
|
+
const index = require("./index-BXBnwuRw.js");
|
|
13
|
+
const LicensePage = require("./LicensePage-CmvILX9m.js");
|
|
14
14
|
const _interopDefault = (e) => e && e.__esModule ? e : { default: e };
|
|
15
15
|
const styled__default = /* @__PURE__ */ _interopDefault(styled);
|
|
16
16
|
const EditorJS__default = /* @__PURE__ */ _interopDefault(EditorJS);
|
|
@@ -517,12 +517,12 @@ const HomePage = () => {
|
|
|
517
517
|
const navigate = reactRouterDom.useNavigate();
|
|
518
518
|
const { formatMessage } = getTranslation.useIntl();
|
|
519
519
|
const t = (id, defaultMessage, values) => formatMessage({ id: getTranslation.getTranslation(id), defaultMessage }, values);
|
|
520
|
-
const [activeTab, setActiveTab] =
|
|
521
|
-
const [editorData, setEditorData] =
|
|
522
|
-
const [isLoading, setIsLoading] =
|
|
523
|
-
const [hasContent, setHasContent] =
|
|
524
|
-
const editorRef =
|
|
525
|
-
const editorInstanceRef =
|
|
520
|
+
const [activeTab, setActiveTab] = m.useState("playground");
|
|
521
|
+
const [editorData, setEditorData] = m.useState(null);
|
|
522
|
+
const [isLoading, setIsLoading] = m.useState(false);
|
|
523
|
+
const [hasContent, setHasContent] = m.useState(false);
|
|
524
|
+
const editorRef = m.useRef(null);
|
|
525
|
+
const editorInstanceRef = m.useRef(null);
|
|
526
526
|
const toolsData = [
|
|
527
527
|
{ name: t("tools.header", "Header"), desc: t("tools.header.desc", "H1-H6 Headings"), icon: outline.HashtagIcon, color: "linear-gradient(135deg, #7C3AED, #6366f1)" },
|
|
528
528
|
{ name: t("tools.paragraph", "Paragraph"), desc: t("tools.paragraph.desc", "Text paragraphs"), icon: outline.DocumentTextIcon, color: "linear-gradient(135deg, #334155, #475569)" },
|
|
@@ -547,7 +547,7 @@ const HomePage = () => {
|
|
|
547
547
|
{ keys: ["Tab"], label: t("shortcuts.blockMenu", "Block Menu") },
|
|
548
548
|
{ keys: ["⌘", "Z"], label: t("shortcuts.undo", "Undo") }
|
|
549
549
|
];
|
|
550
|
-
|
|
550
|
+
m.useEffect(() => {
|
|
551
551
|
if (activeTab === "playground" && editorRef.current && !editorInstanceRef.current) {
|
|
552
552
|
const tools$1 = tools.getTools({
|
|
553
553
|
mediaLibToggleFunc: () => {
|
|
@@ -1274,17 +1274,17 @@ const CollaborationSettings = () => {
|
|
|
1274
1274
|
const { formatMessage } = getTranslation.useIntl();
|
|
1275
1275
|
const t = (id, defaultMessage, values) => formatMessage({ id: getTranslation.getTranslation(id), defaultMessage }, values);
|
|
1276
1276
|
const { get, post, put, del } = admin.useFetchClient();
|
|
1277
|
-
const [loading, setLoading] =
|
|
1278
|
-
const [permissions, setPermissions] =
|
|
1279
|
-
const [users, setUsers] =
|
|
1280
|
-
const [contentTypes, setContentTypes] =
|
|
1281
|
-
const [showAddModal, setShowAddModal] =
|
|
1282
|
-
const [selectedUser, setSelectedUser] =
|
|
1283
|
-
const [selectedRole, setSelectedRole] =
|
|
1284
|
-
const [contentType, setContentType] =
|
|
1285
|
-
const [saving, setSaving] =
|
|
1286
|
-
const [limits, setLimits] =
|
|
1287
|
-
|
|
1277
|
+
const [loading, setLoading] = m.useState(true);
|
|
1278
|
+
const [permissions, setPermissions] = m.useState([]);
|
|
1279
|
+
const [users, setUsers] = m.useState([]);
|
|
1280
|
+
const [contentTypes, setContentTypes] = m.useState([]);
|
|
1281
|
+
const [showAddModal, setShowAddModal] = m.useState(false);
|
|
1282
|
+
const [selectedUser, setSelectedUser] = m.useState("");
|
|
1283
|
+
const [selectedRole, setSelectedRole] = m.useState("editor");
|
|
1284
|
+
const [contentType, setContentType] = m.useState("");
|
|
1285
|
+
const [saving, setSaving] = m.useState(false);
|
|
1286
|
+
const [limits, setLimits] = m.useState({ current: 0, max: 2, unlimited: false, canAdd: true });
|
|
1287
|
+
m.useEffect(() => {
|
|
1288
1288
|
loadData();
|
|
1289
1289
|
loadLimits();
|
|
1290
1290
|
}, []);
|
|
@@ -1428,7 +1428,7 @@ const CollaborationSettings = () => {
|
|
|
1428
1428
|
return `${first}${last}`.trim();
|
|
1429
1429
|
};
|
|
1430
1430
|
if (loading) {
|
|
1431
|
-
return /* @__PURE__ */ jsxRuntime.jsx(Container, { children: /* @__PURE__ */ jsxRuntime.jsx(LoadingContainer, { children: /* @__PURE__ */ jsxRuntime.jsx(getTranslation.
|
|
1431
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Container, { children: /* @__PURE__ */ jsxRuntime.jsx(LoadingContainer, { children: /* @__PURE__ */ jsxRuntime.jsx(getTranslation.Vd, {}) }) });
|
|
1432
1432
|
}
|
|
1433
1433
|
return /* @__PURE__ */ jsxRuntime.jsxs(Container, { children: [
|
|
1434
1434
|
/* @__PURE__ */ jsxRuntime.jsxs(Header, { children: [
|
|
@@ -1747,7 +1747,7 @@ const ModalOverlay = styled__default.default.div`
|
|
|
1747
1747
|
animation: ${fadeIn} 0.3s ease-out;
|
|
1748
1748
|
padding: 20px;
|
|
1749
1749
|
`;
|
|
1750
|
-
const ModalContent = styled__default.default(getTranslation.
|
|
1750
|
+
const ModalContent = styled__default.default(getTranslation.R)`
|
|
1751
1751
|
background: white;
|
|
1752
1752
|
border-radius: 16px;
|
|
1753
1753
|
width: 100%;
|
|
@@ -1756,7 +1756,7 @@ const ModalContent = styled__default.default(getTranslation.Box)`
|
|
|
1756
1756
|
animation: ${slideUp} 0.4s cubic-bezier(0.4, 0, 0.2, 1);
|
|
1757
1757
|
overflow: hidden;
|
|
1758
1758
|
`;
|
|
1759
|
-
const GradientHeader = styled__default.default(getTranslation.
|
|
1759
|
+
const GradientHeader = styled__default.default(getTranslation.R)`
|
|
1760
1760
|
background: linear-gradient(135deg, #7C3AED 0%, #6d28d9 100%);
|
|
1761
1761
|
padding: 32px 40px;
|
|
1762
1762
|
position: relative;
|
|
@@ -1841,7 +1841,7 @@ const ToggleButton = styled__default.default.button`
|
|
|
1841
1841
|
cursor: not-allowed;
|
|
1842
1842
|
}
|
|
1843
1843
|
`;
|
|
1844
|
-
const InfoBox = styled__default.default(getTranslation.
|
|
1844
|
+
const InfoBox = styled__default.default(getTranslation.R)`
|
|
1845
1845
|
background: #f0fdf4;
|
|
1846
1846
|
border: 2px solid #bbf7d0;
|
|
1847
1847
|
border-radius: 8px;
|
|
@@ -1854,14 +1854,14 @@ const LicenseGuard = ({ children }) => {
|
|
|
1854
1854
|
const { get, post } = admin.useFetchClient();
|
|
1855
1855
|
const { toggleNotification } = admin.useNotification();
|
|
1856
1856
|
const navigate = reactRouterDom.useNavigate();
|
|
1857
|
-
const [isChecking, setIsChecking] =
|
|
1858
|
-
const [needsLicense, setNeedsLicense] =
|
|
1859
|
-
const [isCreating, setIsCreating] =
|
|
1860
|
-
const [useExistingKey, setUseExistingKey] =
|
|
1861
|
-
const [existingLicenseKey, setExistingLicenseKey] =
|
|
1862
|
-
const [existingEmail, setExistingEmail] =
|
|
1863
|
-
const [adminUser, setAdminUser] =
|
|
1864
|
-
|
|
1857
|
+
const [isChecking, setIsChecking] = m.useState(true);
|
|
1858
|
+
const [needsLicense, setNeedsLicense] = m.useState(false);
|
|
1859
|
+
const [isCreating, setIsCreating] = m.useState(false);
|
|
1860
|
+
const [useExistingKey, setUseExistingKey] = m.useState(false);
|
|
1861
|
+
const [existingLicenseKey, setExistingLicenseKey] = m.useState("");
|
|
1862
|
+
const [existingEmail, setExistingEmail] = m.useState("");
|
|
1863
|
+
const [adminUser, setAdminUser] = m.useState(null);
|
|
1864
|
+
m.useEffect(() => {
|
|
1865
1865
|
checkLicenseStatus();
|
|
1866
1866
|
fetchAdminUser();
|
|
1867
1867
|
}, []);
|
|
@@ -1961,16 +1961,16 @@ const LicenseGuard = ({ children }) => {
|
|
|
1961
1961
|
navigate("/content-manager");
|
|
1962
1962
|
};
|
|
1963
1963
|
if (isChecking) {
|
|
1964
|
-
return /* @__PURE__ */ jsxRuntime.jsx(getTranslation.
|
|
1964
|
+
return /* @__PURE__ */ jsxRuntime.jsx(getTranslation.R, { padding: 8, style: { textAlign: "center" }, children: /* @__PURE__ */ jsxRuntime.jsx(getTranslation.Vd, { children: t("license.checking", "Checking license...") }) });
|
|
1965
1965
|
}
|
|
1966
1966
|
if (needsLicense) {
|
|
1967
1967
|
return /* @__PURE__ */ jsxRuntime.jsx(ModalOverlay, { children: /* @__PURE__ */ jsxRuntime.jsxs(ModalContent, { children: [
|
|
1968
1968
|
/* @__PURE__ */ jsxRuntime.jsxs(GradientHeader, { children: [
|
|
1969
1969
|
/* @__PURE__ */ jsxRuntime.jsx(CloseButton, { onClick: handleClose, type: "button", children: /* @__PURE__ */ jsxRuntime.jsx(outline.XMarkIcon, {}) }),
|
|
1970
1970
|
/* @__PURE__ */ jsxRuntime.jsx(IconWrapper, { children: /* @__PURE__ */ jsxRuntime.jsx(outline.KeyIcon, {}) }),
|
|
1971
|
-
/* @__PURE__ */ jsxRuntime.jsxs(getTranslation.
|
|
1971
|
+
/* @__PURE__ */ jsxRuntime.jsxs(getTranslation.R, { style: { textAlign: "center", position: "relative" }, children: [
|
|
1972
1972
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1973
|
-
getTranslation.
|
|
1973
|
+
getTranslation.I,
|
|
1974
1974
|
{
|
|
1975
1975
|
variant: "alpha",
|
|
1976
1976
|
style: {
|
|
@@ -1984,7 +1984,7 @@ const LicenseGuard = ({ children }) => {
|
|
|
1984
1984
|
}
|
|
1985
1985
|
),
|
|
1986
1986
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1987
|
-
getTranslation.
|
|
1987
|
+
getTranslation.I,
|
|
1988
1988
|
{
|
|
1989
1989
|
variant: "epsilon",
|
|
1990
1990
|
style: {
|
|
@@ -1997,12 +1997,12 @@ const LicenseGuard = ({ children }) => {
|
|
|
1997
1997
|
)
|
|
1998
1998
|
] })
|
|
1999
1999
|
] }),
|
|
2000
|
-
/* @__PURE__ */ jsxRuntime.jsx("form", { onSubmit: useExistingKey ? handleValidateExistingKey : handleAutoCreateLicense, children: /* @__PURE__ */ jsxRuntime.jsx(getTranslation.
|
|
2001
|
-
/* @__PURE__ */ jsxRuntime.jsx(InfoBox, { children: /* @__PURE__ */ jsxRuntime.jsxs(getTranslation.
|
|
2000
|
+
/* @__PURE__ */ jsxRuntime.jsx("form", { onSubmit: useExistingKey ? handleValidateExistingKey : handleAutoCreateLicense, children: /* @__PURE__ */ jsxRuntime.jsx(getTranslation.R, { padding: 6, paddingLeft: 8, paddingRight: 8, children: /* @__PURE__ */ jsxRuntime.jsxs(getTranslation.T, { direction: "column", gap: 5, style: { width: "100%" }, children: [
|
|
2001
|
+
/* @__PURE__ */ jsxRuntime.jsx(InfoBox, { children: /* @__PURE__ */ jsxRuntime.jsxs(getTranslation.I, { variant: "omega", style: { fontSize: "13px", lineHeight: "1.6" }, children: [
|
|
2002
2002
|
"[FREE] ",
|
|
2003
2003
|
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
2004
|
] }) }),
|
|
2005
|
-
/* @__PURE__ */ jsxRuntime.jsx(getTranslation.
|
|
2005
|
+
/* @__PURE__ */ jsxRuntime.jsx(getTranslation.R, { style: { textAlign: "center", width: "100%" }, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
2006
2006
|
ToggleButton,
|
|
2007
2007
|
{
|
|
2008
2008
|
type: "button",
|
|
@@ -2012,9 +2012,9 @@ const LicenseGuard = ({ children }) => {
|
|
|
2012
2012
|
}
|
|
2013
2013
|
) }),
|
|
2014
2014
|
useExistingKey ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
2015
|
-
/* @__PURE__ */ jsxRuntime.jsxs(getTranslation.
|
|
2015
|
+
/* @__PURE__ */ jsxRuntime.jsxs(getTranslation.R, { style: { width: "100%" }, children: [
|
|
2016
2016
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
2017
|
-
getTranslation.
|
|
2017
|
+
getTranslation.I,
|
|
2018
2018
|
{
|
|
2019
2019
|
variant: "pi",
|
|
2020
2020
|
fontWeight: "bold",
|
|
@@ -2026,7 +2026,7 @@ const LicenseGuard = ({ children }) => {
|
|
|
2026
2026
|
}
|
|
2027
2027
|
),
|
|
2028
2028
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2029
|
-
getTranslation.
|
|
2029
|
+
getTranslation.X0,
|
|
2030
2030
|
{
|
|
2031
2031
|
placeholder: t("licenseGuard.email.placeholder", "admin@example.com"),
|
|
2032
2032
|
type: "email",
|
|
@@ -2037,9 +2037,9 @@ const LicenseGuard = ({ children }) => {
|
|
|
2037
2037
|
}
|
|
2038
2038
|
)
|
|
2039
2039
|
] }),
|
|
2040
|
-
/* @__PURE__ */ jsxRuntime.jsxs(getTranslation.
|
|
2040
|
+
/* @__PURE__ */ jsxRuntime.jsxs(getTranslation.R, { style: { width: "100%" }, children: [
|
|
2041
2041
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
2042
|
-
getTranslation.
|
|
2042
|
+
getTranslation.I,
|
|
2043
2043
|
{
|
|
2044
2044
|
variant: "pi",
|
|
2045
2045
|
fontWeight: "bold",
|
|
@@ -2051,7 +2051,7 @@ const LicenseGuard = ({ children }) => {
|
|
|
2051
2051
|
}
|
|
2052
2052
|
),
|
|
2053
2053
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2054
|
-
getTranslation.
|
|
2054
|
+
getTranslation.X0,
|
|
2055
2055
|
{
|
|
2056
2056
|
placeholder: t("licenseGuard.licenseKey.placeholder", "MAGIC-EDITOR-XXXX-XXXX-XXXX"),
|
|
2057
2057
|
value: existingLicenseKey,
|
|
@@ -2062,7 +2062,7 @@ const LicenseGuard = ({ children }) => {
|
|
|
2062
2062
|
)
|
|
2063
2063
|
] })
|
|
2064
2064
|
] }) : adminUser ? /* @__PURE__ */ jsxRuntime.jsxs(
|
|
2065
|
-
getTranslation.
|
|
2065
|
+
getTranslation.R,
|
|
2066
2066
|
{
|
|
2067
2067
|
background: "success100",
|
|
2068
2068
|
padding: 5,
|
|
@@ -2072,22 +2072,22 @@ const LicenseGuard = ({ children }) => {
|
|
|
2072
2072
|
textAlign: "center"
|
|
2073
2073
|
},
|
|
2074
2074
|
children: [
|
|
2075
|
-
/* @__PURE__ */ jsxRuntime.jsx(getTranslation.
|
|
2076
|
-
/* @__PURE__ */ jsxRuntime.jsxs(getTranslation.
|
|
2075
|
+
/* @__PURE__ */ jsxRuntime.jsx(getTranslation.I, { variant: "omega", fontWeight: "bold", style: { marginBottom: "12px", display: "block" }, children: t("licenseGuard.readyToActivate", "Ready to activate with your account:") }),
|
|
2076
|
+
/* @__PURE__ */ jsxRuntime.jsxs(getTranslation.I, { variant: "pi", style: { marginBottom: "4px", display: "block" }, children: [
|
|
2077
2077
|
adminUser.firstname || "Admin",
|
|
2078
2078
|
" ",
|
|
2079
2079
|
adminUser.lastname || "User"
|
|
2080
2080
|
] }),
|
|
2081
|
-
/* @__PURE__ */ jsxRuntime.jsx(getTranslation.
|
|
2081
|
+
/* @__PURE__ */ jsxRuntime.jsx(getTranslation.I, { variant: "pi", textColor: "neutral600", children: adminUser.email || "Loading..." })
|
|
2082
2082
|
]
|
|
2083
2083
|
}
|
|
2084
|
-
) : /* @__PURE__ */ jsxRuntime.jsxs(getTranslation.
|
|
2085
|
-
/* @__PURE__ */ jsxRuntime.jsx(getTranslation.
|
|
2086
|
-
/* @__PURE__ */ jsxRuntime.jsx(getTranslation.
|
|
2084
|
+
) : /* @__PURE__ */ jsxRuntime.jsxs(getTranslation.R, { padding: 4, background: "neutral100", hasRadius: true, style: { textAlign: "center" }, children: [
|
|
2085
|
+
/* @__PURE__ */ jsxRuntime.jsx(getTranslation.Vd, { small: true }),
|
|
2086
|
+
/* @__PURE__ */ jsxRuntime.jsx(getTranslation.I, { variant: "pi", marginTop: 2, children: t("licenseGuard.loadingUser", "Loading admin user data...") })
|
|
2087
2087
|
] }),
|
|
2088
|
-
/* @__PURE__ */ jsxRuntime.jsxs(getTranslation.
|
|
2088
|
+
/* @__PURE__ */ jsxRuntime.jsxs(getTranslation.T, { gap: 3, justifyContent: "center", style: { marginTop: "16px" }, children: [
|
|
2089
2089
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2090
|
-
getTranslation.
|
|
2090
|
+
getTranslation.zn,
|
|
2091
2091
|
{
|
|
2092
2092
|
variant: "tertiary",
|
|
2093
2093
|
onClick: handleSkip,
|
|
@@ -2096,7 +2096,7 @@ const LicenseGuard = ({ children }) => {
|
|
|
2096
2096
|
}
|
|
2097
2097
|
),
|
|
2098
2098
|
useExistingKey ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
2099
|
-
getTranslation.
|
|
2099
|
+
getTranslation.zn,
|
|
2100
2100
|
{
|
|
2101
2101
|
type: "submit",
|
|
2102
2102
|
size: "L",
|
|
@@ -2112,7 +2112,7 @@ const LicenseGuard = ({ children }) => {
|
|
|
2112
2112
|
children: t("licenseGuard.validate", "Validate License")
|
|
2113
2113
|
}
|
|
2114
2114
|
) : /* @__PURE__ */ jsxRuntime.jsx(
|
|
2115
|
-
getTranslation.
|
|
2115
|
+
getTranslation.zn,
|
|
2116
2116
|
{
|
|
2117
2117
|
type: "submit",
|
|
2118
2118
|
size: "L",
|
|
@@ -5,10 +5,10 @@ import { useFetchClient, useNotification, Page } from "@strapi/strapi/admin";
|
|
|
5
5
|
import styled, { css, keyframes } from "styled-components";
|
|
6
6
|
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
7
|
import EditorJS from "@editorjs/editorjs";
|
|
8
|
-
import { u as useIntl, g as getTranslation,
|
|
9
|
-
import { g as getTools } from "./tools-
|
|
10
|
-
import { P as PLUGIN_ID } from "./index-
|
|
11
|
-
import LicensePage from "./LicensePage-
|
|
8
|
+
import { u as useIntl, g as getTranslation, V as Vd, R, I, T, X as X0, z as zn } from "./getTranslation-D3h3Z3gU.mjs";
|
|
9
|
+
import { g as getTools } from "./tools-BXzd0lx5.mjs";
|
|
10
|
+
import { P as PLUGIN_ID } from "./index-BvEdg518.mjs";
|
|
11
|
+
import LicensePage from "./LicensePage-gLRoo8WJ.mjs";
|
|
12
12
|
const fadeInUp = keyframes`
|
|
13
13
|
from { opacity: 0; transform: translateY(20px); }
|
|
14
14
|
to { opacity: 1; transform: translateY(0); }
|
|
@@ -1423,7 +1423,7 @@ const CollaborationSettings = () => {
|
|
|
1423
1423
|
return `${first}${last}`.trim();
|
|
1424
1424
|
};
|
|
1425
1425
|
if (loading) {
|
|
1426
|
-
return /* @__PURE__ */ jsx(Container, { children: /* @__PURE__ */ jsx(LoadingContainer, { children: /* @__PURE__ */ jsx(
|
|
1426
|
+
return /* @__PURE__ */ jsx(Container, { children: /* @__PURE__ */ jsx(LoadingContainer, { children: /* @__PURE__ */ jsx(Vd, {}) }) });
|
|
1427
1427
|
}
|
|
1428
1428
|
return /* @__PURE__ */ jsxs(Container, { children: [
|
|
1429
1429
|
/* @__PURE__ */ jsxs(Header, { children: [
|
|
@@ -1742,7 +1742,7 @@ const ModalOverlay = styled.div`
|
|
|
1742
1742
|
animation: ${fadeIn} 0.3s ease-out;
|
|
1743
1743
|
padding: 20px;
|
|
1744
1744
|
`;
|
|
1745
|
-
const ModalContent = styled(
|
|
1745
|
+
const ModalContent = styled(R)`
|
|
1746
1746
|
background: white;
|
|
1747
1747
|
border-radius: 16px;
|
|
1748
1748
|
width: 100%;
|
|
@@ -1751,7 +1751,7 @@ const ModalContent = styled(Box)`
|
|
|
1751
1751
|
animation: ${slideUp} 0.4s cubic-bezier(0.4, 0, 0.2, 1);
|
|
1752
1752
|
overflow: hidden;
|
|
1753
1753
|
`;
|
|
1754
|
-
const GradientHeader = styled(
|
|
1754
|
+
const GradientHeader = styled(R)`
|
|
1755
1755
|
background: linear-gradient(135deg, #7C3AED 0%, #6d28d9 100%);
|
|
1756
1756
|
padding: 32px 40px;
|
|
1757
1757
|
position: relative;
|
|
@@ -1836,7 +1836,7 @@ const ToggleButton = styled.button`
|
|
|
1836
1836
|
cursor: not-allowed;
|
|
1837
1837
|
}
|
|
1838
1838
|
`;
|
|
1839
|
-
const InfoBox = styled(
|
|
1839
|
+
const InfoBox = styled(R)`
|
|
1840
1840
|
background: #f0fdf4;
|
|
1841
1841
|
border: 2px solid #bbf7d0;
|
|
1842
1842
|
border-radius: 8px;
|
|
@@ -1956,16 +1956,16 @@ const LicenseGuard = ({ children }) => {
|
|
|
1956
1956
|
navigate("/content-manager");
|
|
1957
1957
|
};
|
|
1958
1958
|
if (isChecking) {
|
|
1959
|
-
return /* @__PURE__ */ jsx(
|
|
1959
|
+
return /* @__PURE__ */ jsx(R, { padding: 8, style: { textAlign: "center" }, children: /* @__PURE__ */ jsx(Vd, { children: t("license.checking", "Checking license...") }) });
|
|
1960
1960
|
}
|
|
1961
1961
|
if (needsLicense) {
|
|
1962
1962
|
return /* @__PURE__ */ jsx(ModalOverlay, { children: /* @__PURE__ */ jsxs(ModalContent, { children: [
|
|
1963
1963
|
/* @__PURE__ */ jsxs(GradientHeader, { children: [
|
|
1964
1964
|
/* @__PURE__ */ jsx(CloseButton, { onClick: handleClose, type: "button", children: /* @__PURE__ */ jsx(XMarkIcon, {}) }),
|
|
1965
1965
|
/* @__PURE__ */ jsx(IconWrapper, { children: /* @__PURE__ */ jsx(KeyIcon, {}) }),
|
|
1966
|
-
/* @__PURE__ */ jsxs(
|
|
1966
|
+
/* @__PURE__ */ jsxs(R, { style: { textAlign: "center", position: "relative" }, children: [
|
|
1967
1967
|
/* @__PURE__ */ jsx(
|
|
1968
|
-
|
|
1968
|
+
I,
|
|
1969
1969
|
{
|
|
1970
1970
|
variant: "alpha",
|
|
1971
1971
|
style: {
|
|
@@ -1979,7 +1979,7 @@ const LicenseGuard = ({ children }) => {
|
|
|
1979
1979
|
}
|
|
1980
1980
|
),
|
|
1981
1981
|
/* @__PURE__ */ jsx(
|
|
1982
|
-
|
|
1982
|
+
I,
|
|
1983
1983
|
{
|
|
1984
1984
|
variant: "epsilon",
|
|
1985
1985
|
style: {
|
|
@@ -1992,12 +1992,12 @@ const LicenseGuard = ({ children }) => {
|
|
|
1992
1992
|
)
|
|
1993
1993
|
] })
|
|
1994
1994
|
] }),
|
|
1995
|
-
/* @__PURE__ */ jsx("form", { onSubmit: useExistingKey ? handleValidateExistingKey : handleAutoCreateLicense, children: /* @__PURE__ */ jsx(
|
|
1996
|
-
/* @__PURE__ */ jsx(InfoBox, { children: /* @__PURE__ */ jsxs(
|
|
1995
|
+
/* @__PURE__ */ jsx("form", { onSubmit: useExistingKey ? handleValidateExistingKey : handleAutoCreateLicense, children: /* @__PURE__ */ jsx(R, { padding: 6, paddingLeft: 8, paddingRight: 8, children: /* @__PURE__ */ jsxs(T, { direction: "column", gap: 5, style: { width: "100%" }, children: [
|
|
1996
|
+
/* @__PURE__ */ jsx(InfoBox, { children: /* @__PURE__ */ jsxs(I, { variant: "omega", style: { fontSize: "13px", lineHeight: "1.6" }, children: [
|
|
1997
1997
|
"[FREE] ",
|
|
1998
1998
|
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
1999
|
] }) }),
|
|
2000
|
-
/* @__PURE__ */ jsx(
|
|
2000
|
+
/* @__PURE__ */ jsx(R, { style: { textAlign: "center", width: "100%" }, children: /* @__PURE__ */ jsx(
|
|
2001
2001
|
ToggleButton,
|
|
2002
2002
|
{
|
|
2003
2003
|
type: "button",
|
|
@@ -2007,9 +2007,9 @@ const LicenseGuard = ({ children }) => {
|
|
|
2007
2007
|
}
|
|
2008
2008
|
) }),
|
|
2009
2009
|
useExistingKey ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
2010
|
-
/* @__PURE__ */ jsxs(
|
|
2010
|
+
/* @__PURE__ */ jsxs(R, { style: { width: "100%" }, children: [
|
|
2011
2011
|
/* @__PURE__ */ jsxs(
|
|
2012
|
-
|
|
2012
|
+
I,
|
|
2013
2013
|
{
|
|
2014
2014
|
variant: "pi",
|
|
2015
2015
|
fontWeight: "bold",
|
|
@@ -2021,7 +2021,7 @@ const LicenseGuard = ({ children }) => {
|
|
|
2021
2021
|
}
|
|
2022
2022
|
),
|
|
2023
2023
|
/* @__PURE__ */ jsx(
|
|
2024
|
-
|
|
2024
|
+
X0,
|
|
2025
2025
|
{
|
|
2026
2026
|
placeholder: t("licenseGuard.email.placeholder", "admin@example.com"),
|
|
2027
2027
|
type: "email",
|
|
@@ -2032,9 +2032,9 @@ const LicenseGuard = ({ children }) => {
|
|
|
2032
2032
|
}
|
|
2033
2033
|
)
|
|
2034
2034
|
] }),
|
|
2035
|
-
/* @__PURE__ */ jsxs(
|
|
2035
|
+
/* @__PURE__ */ jsxs(R, { style: { width: "100%" }, children: [
|
|
2036
2036
|
/* @__PURE__ */ jsxs(
|
|
2037
|
-
|
|
2037
|
+
I,
|
|
2038
2038
|
{
|
|
2039
2039
|
variant: "pi",
|
|
2040
2040
|
fontWeight: "bold",
|
|
@@ -2046,7 +2046,7 @@ const LicenseGuard = ({ children }) => {
|
|
|
2046
2046
|
}
|
|
2047
2047
|
),
|
|
2048
2048
|
/* @__PURE__ */ jsx(
|
|
2049
|
-
|
|
2049
|
+
X0,
|
|
2050
2050
|
{
|
|
2051
2051
|
placeholder: t("licenseGuard.licenseKey.placeholder", "MAGIC-EDITOR-XXXX-XXXX-XXXX"),
|
|
2052
2052
|
value: existingLicenseKey,
|
|
@@ -2057,7 +2057,7 @@ const LicenseGuard = ({ children }) => {
|
|
|
2057
2057
|
)
|
|
2058
2058
|
] })
|
|
2059
2059
|
] }) : adminUser ? /* @__PURE__ */ jsxs(
|
|
2060
|
-
|
|
2060
|
+
R,
|
|
2061
2061
|
{
|
|
2062
2062
|
background: "success100",
|
|
2063
2063
|
padding: 5,
|
|
@@ -2067,22 +2067,22 @@ const LicenseGuard = ({ children }) => {
|
|
|
2067
2067
|
textAlign: "center"
|
|
2068
2068
|
},
|
|
2069
2069
|
children: [
|
|
2070
|
-
/* @__PURE__ */ jsx(
|
|
2071
|
-
/* @__PURE__ */ jsxs(
|
|
2070
|
+
/* @__PURE__ */ jsx(I, { variant: "omega", fontWeight: "bold", style: { marginBottom: "12px", display: "block" }, children: t("licenseGuard.readyToActivate", "Ready to activate with your account:") }),
|
|
2071
|
+
/* @__PURE__ */ jsxs(I, { variant: "pi", style: { marginBottom: "4px", display: "block" }, children: [
|
|
2072
2072
|
adminUser.firstname || "Admin",
|
|
2073
2073
|
" ",
|
|
2074
2074
|
adminUser.lastname || "User"
|
|
2075
2075
|
] }),
|
|
2076
|
-
/* @__PURE__ */ jsx(
|
|
2076
|
+
/* @__PURE__ */ jsx(I, { variant: "pi", textColor: "neutral600", children: adminUser.email || "Loading..." })
|
|
2077
2077
|
]
|
|
2078
2078
|
}
|
|
2079
|
-
) : /* @__PURE__ */ jsxs(
|
|
2080
|
-
/* @__PURE__ */ jsx(
|
|
2081
|
-
/* @__PURE__ */ jsx(
|
|
2079
|
+
) : /* @__PURE__ */ jsxs(R, { padding: 4, background: "neutral100", hasRadius: true, style: { textAlign: "center" }, children: [
|
|
2080
|
+
/* @__PURE__ */ jsx(Vd, { small: true }),
|
|
2081
|
+
/* @__PURE__ */ jsx(I, { variant: "pi", marginTop: 2, children: t("licenseGuard.loadingUser", "Loading admin user data...") })
|
|
2082
2082
|
] }),
|
|
2083
|
-
/* @__PURE__ */ jsxs(
|
|
2083
|
+
/* @__PURE__ */ jsxs(T, { gap: 3, justifyContent: "center", style: { marginTop: "16px" }, children: [
|
|
2084
2084
|
/* @__PURE__ */ jsx(
|
|
2085
|
-
|
|
2085
|
+
zn,
|
|
2086
2086
|
{
|
|
2087
2087
|
variant: "tertiary",
|
|
2088
2088
|
onClick: handleSkip,
|
|
@@ -2091,7 +2091,7 @@ const LicenseGuard = ({ children }) => {
|
|
|
2091
2091
|
}
|
|
2092
2092
|
),
|
|
2093
2093
|
useExistingKey ? /* @__PURE__ */ jsx(
|
|
2094
|
-
|
|
2094
|
+
zn,
|
|
2095
2095
|
{
|
|
2096
2096
|
type: "submit",
|
|
2097
2097
|
size: "L",
|
|
@@ -2107,7 +2107,7 @@ const LicenseGuard = ({ children }) => {
|
|
|
2107
2107
|
children: t("licenseGuard.validate", "Validate License")
|
|
2108
2108
|
}
|
|
2109
2109
|
) : /* @__PURE__ */ jsx(
|
|
2110
|
-
|
|
2110
|
+
zn,
|
|
2111
2111
|
{
|
|
2112
2112
|
type: "submit",
|
|
2113
2113
|
size: "L",
|
|
@@ -1438,7 +1438,8 @@ const CustomBlocksPage = () => {
|
|
|
1438
1438
|
/* @__PURE__ */ jsx("option", { value: "textarea", children: "Textarea" }),
|
|
1439
1439
|
/* @__PURE__ */ jsx("option", { value: "select", children: "Select" }),
|
|
1440
1440
|
/* @__PURE__ */ jsx("option", { value: "color", children: "Color" }),
|
|
1441
|
-
/* @__PURE__ */ jsx("option", { value: "checkbox", children: "Checkbox" })
|
|
1441
|
+
/* @__PURE__ */ jsx("option", { value: "checkbox", children: "Checkbox" }),
|
|
1442
|
+
/* @__PURE__ */ jsx("option", { value: "image", children: "Image" })
|
|
1442
1443
|
]
|
|
1443
1444
|
}
|
|
1444
1445
|
),
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
3
|
const jsxRuntime = require("react/jsx-runtime");
|
|
4
|
-
const
|
|
4
|
+
const m = require("react");
|
|
5
5
|
const admin = require("@strapi/strapi/admin");
|
|
6
6
|
const styled = require("styled-components");
|
|
7
7
|
const outline = require("@heroicons/react/24/outline");
|
|
@@ -802,13 +802,13 @@ const FeatureLockedBadge = styled__default.default.span`
|
|
|
802
802
|
const CustomBlocksPage = () => {
|
|
803
803
|
const { toggleNotification } = admin.useNotification();
|
|
804
804
|
const { get, post, put, del } = admin.useFetchClient();
|
|
805
|
-
const [blocks, setBlocks] =
|
|
806
|
-
const [contentTypes, setContentTypes] =
|
|
807
|
-
const [isLoading, setIsLoading] =
|
|
808
|
-
const [isModalOpen, setIsModalOpen] =
|
|
809
|
-
const [editingBlock, setEditingBlock] =
|
|
810
|
-
const [formData, setFormData] =
|
|
811
|
-
const [limits, setLimits] =
|
|
805
|
+
const [blocks, setBlocks] = m.useState([]);
|
|
806
|
+
const [contentTypes, setContentTypes] = m.useState([]);
|
|
807
|
+
const [isLoading, setIsLoading] = m.useState(true);
|
|
808
|
+
const [isModalOpen, setIsModalOpen] = m.useState(false);
|
|
809
|
+
const [editingBlock, setEditingBlock] = m.useState(null);
|
|
810
|
+
const [formData, setFormData] = m.useState(getEmptyFormData());
|
|
811
|
+
const [limits, setLimits] = m.useState(null);
|
|
812
812
|
function getEmptyFormData() {
|
|
813
813
|
return {
|
|
814
814
|
name: "",
|
|
@@ -831,7 +831,7 @@ const CustomBlocksPage = () => {
|
|
|
831
831
|
enabled: true
|
|
832
832
|
};
|
|
833
833
|
}
|
|
834
|
-
const fetchBlocks =
|
|
834
|
+
const fetchBlocks = m.useCallback(async () => {
|
|
835
835
|
try {
|
|
836
836
|
setIsLoading(true);
|
|
837
837
|
const response = await get(`/${PLUGIN_ID}/custom-blocks?enabledOnly=false`);
|
|
@@ -846,7 +846,7 @@ const CustomBlocksPage = () => {
|
|
|
846
846
|
setIsLoading(false);
|
|
847
847
|
}
|
|
848
848
|
}, [get, toggleNotification]);
|
|
849
|
-
const fetchContentTypes =
|
|
849
|
+
const fetchContentTypes = m.useCallback(async () => {
|
|
850
850
|
try {
|
|
851
851
|
const response = await get(`/${PLUGIN_ID}/content-types`);
|
|
852
852
|
setContentTypes(response.data?.contentTypes || []);
|
|
@@ -854,7 +854,7 @@ const CustomBlocksPage = () => {
|
|
|
854
854
|
console.error("[CustomBlocksPage] Error fetching content types:", error);
|
|
855
855
|
}
|
|
856
856
|
}, [get]);
|
|
857
|
-
const fetchLimits =
|
|
857
|
+
const fetchLimits = m.useCallback(async () => {
|
|
858
858
|
try {
|
|
859
859
|
const response = await get(`/${PLUGIN_ID}/custom-blocks/limits`);
|
|
860
860
|
setLimits(response.data?.data || null);
|
|
@@ -862,7 +862,7 @@ const CustomBlocksPage = () => {
|
|
|
862
862
|
console.error("[CustomBlocksPage] Error fetching limits:", error);
|
|
863
863
|
}
|
|
864
864
|
}, [get]);
|
|
865
|
-
|
|
865
|
+
m.useEffect(() => {
|
|
866
866
|
fetchBlocks();
|
|
867
867
|
fetchContentTypes();
|
|
868
868
|
fetchLimits();
|
|
@@ -1442,7 +1442,8 @@ const CustomBlocksPage = () => {
|
|
|
1442
1442
|
/* @__PURE__ */ jsxRuntime.jsx("option", { value: "textarea", children: "Textarea" }),
|
|
1443
1443
|
/* @__PURE__ */ jsxRuntime.jsx("option", { value: "select", children: "Select" }),
|
|
1444
1444
|
/* @__PURE__ */ jsxRuntime.jsx("option", { value: "color", children: "Color" }),
|
|
1445
|
-
/* @__PURE__ */ jsxRuntime.jsx("option", { value: "checkbox", children: "Checkbox" })
|
|
1445
|
+
/* @__PURE__ */ jsxRuntime.jsx("option", { value: "checkbox", children: "Checkbox" }),
|
|
1446
|
+
/* @__PURE__ */ jsxRuntime.jsx("option", { value: "image", children: "Image" })
|
|
1446
1447
|
]
|
|
1447
1448
|
}
|
|
1448
1449
|
),
|