magic-editor-x 1.5.1 → 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.
- package/README.md +6 -110
- package/dist/{_chunks/App-iNfbV7cz.mjs → admin/App-BwMEZnS-.mjs} +35 -34
- package/dist/{_chunks/App-DImBvISP.js → admin/App-HNr2tizR.js} +65 -64
- package/dist/{_chunks/CustomBlocksPage-Cj-0TTUs.js → admin/CustomBlocksPage-BjcA7MGz.js} +13 -13
- package/dist/{_chunks/LicensePage-gLRoo8WJ.mjs → admin/LicensePage-D0DMTF41.mjs} +39 -38
- package/dist/{_chunks/LicensePage-CmvILX9m.js → admin/LicensePage-D0_9yPkw.js} +45 -44
- package/dist/{_chunks/LiveCollaborationPanel-BFybu8h0.js → admin/LiveCollaborationPanel-CZAbgAVr.js} +9 -8
- package/dist/{_chunks/LiveCollaborationPanel-CVgl4IyR.mjs → admin/LiveCollaborationPanel-D8z72afw.mjs} +4 -3
- package/dist/{_chunks/Settings-BzGqgrxD.js → admin/Settings-DRenvRcG.js} +90 -89
- package/dist/{_chunks/Settings-ButYcfrm.mjs → admin/Settings-DjyNURlS.mjs} +83 -82
- package/dist/{_chunks/getTranslation-D3h3Z3gU.mjs → admin/getTranslation-2OiEgVGt.mjs} +10593 -18925
- package/dist/{_chunks/getTranslation-BADoesEn.js → admin/getTranslation-DQ_WJ-7M.js} +11076 -19408
- package/dist/{_chunks/index-BXBnwuRw.js → admin/index-Bn2tfJrC.js} +382 -354
- package/dist/{_chunks/index-DDFAuQNT.js → admin/index-DAtClhqy.js} +184 -183
- package/dist/{_chunks/index-BvEdg518.mjs → admin/index-FVEbTfqO.mjs} +290 -262
- package/dist/{_chunks/index-DEi6nwfM.mjs → admin/index-gjWl-6E2.mjs} +34 -33
- package/dist/admin/index.js +3 -2
- package/dist/admin/index.mjs +2 -2
- package/dist/{_chunks/tools-BXzd0lx5.mjs → admin/tools-CzHTZaY_.mjs} +42 -39
- package/dist/{_chunks/tools-Q0uwDS9E.js → admin/tools-DALFhvPO.js} +49 -46
- package/dist/server/index.js +63511 -37933
- package/dist/server/index.mjs +63511 -37906
- package/package.json +43 -30
- /package/dist/{_chunks → admin}/CustomBlocksPage-COPOZ2-_.mjs +0 -0
- /package/dist/{_chunks → admin}/de-C_0Mj-Zo.mjs +0 -0
- /package/dist/{_chunks → admin}/de-DVNVpAt9.js +0 -0
- /package/dist/{_chunks → admin}/en-B7AAf1ie.mjs +0 -0
- /package/dist/{_chunks → admin}/en-C2hv5GsA.js +0 -0
- /package/dist/{_chunks → admin}/es-BzJqcIST.js +0 -0
- /package/dist/{_chunks → admin}/es-zdP8sd-f.mjs +0 -0
- /package/dist/{_chunks → admin}/fr-CtAgOgH1.mjs +0 -0
- /package/dist/{_chunks → admin}/fr-D3GwqAAJ.js +0 -0
- /package/dist/{style.css → admin/magic-editor-x.css} +0 -0
- /package/dist/{_chunks → admin}/pt-BmUw6YMP.mjs +0 -0
- /package/dist/{_chunks → admin}/pt-CFo0nTbj.js +0 -0
|
@@ -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 s = 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] = s.useState([]);
|
|
806
|
+
const [contentTypes, setContentTypes] = s.useState([]);
|
|
807
|
+
const [isLoading, setIsLoading] = s.useState(true);
|
|
808
|
+
const [isModalOpen, setIsModalOpen] = s.useState(false);
|
|
809
|
+
const [editingBlock, setEditingBlock] = s.useState(null);
|
|
810
|
+
const [formData, setFormData] = s.useState(getEmptyFormData());
|
|
811
|
+
const [limits, setLimits] = s.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 = s.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 = s.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 = s.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
|
+
s.useEffect(() => {
|
|
866
866
|
fetchBlocks();
|
|
867
867
|
fetchContentTypes();
|
|
868
868
|
fetchLimits();
|
|
@@ -1371,7 +1371,7 @@ const CustomBlocksPage = () => {
|
|
|
1371
1371
|
value: formData.displayFields.join(", "),
|
|
1372
1372
|
onChange: (e) => updateFormField(
|
|
1373
1373
|
"displayFields",
|
|
1374
|
-
e.target.value.split(",").map((
|
|
1374
|
+
e.target.value.split(",").map((s2) => s2.trim())
|
|
1375
1375
|
),
|
|
1376
1376
|
placeholder: "title, name, id"
|
|
1377
1377
|
}
|
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useState, useEffect } from "react";
|
|
3
3
|
import { useFetchClient, useNotification } from "@strapi/strapi/admin";
|
|
4
|
-
import {
|
|
4
|
+
import { useIntl } from "react-intl";
|
|
5
|
+
import { C, k as kt, A, N as Nr, S, g as getTranslation, a as Ct } from "./getTranslation-2OiEgVGt.mjs";
|
|
5
6
|
import styled from "styled-components";
|
|
6
|
-
import {
|
|
7
|
-
const Container = styled(
|
|
7
|
+
import { h as h5, F as F5, V as Vn, a as F3, m as mn } from "./index-FVEbTfqO.mjs";
|
|
8
|
+
const Container = styled(S)`
|
|
8
9
|
padding: 32px;
|
|
9
10
|
max-width: 1400px;
|
|
10
11
|
margin: 0 auto;
|
|
11
12
|
`;
|
|
12
|
-
const Header = styled(
|
|
13
|
+
const Header = styled(S)`
|
|
13
14
|
text-align: center;
|
|
14
15
|
margin-bottom: 48px;
|
|
15
16
|
display: flex;
|
|
@@ -17,7 +18,7 @@ const Header = styled(R)`
|
|
|
17
18
|
align-items: center;
|
|
18
19
|
gap: 8px;
|
|
19
20
|
`;
|
|
20
|
-
const Title = styled(
|
|
21
|
+
const Title = styled(A)`
|
|
21
22
|
font-size: 2.5rem;
|
|
22
23
|
font-weight: 700;
|
|
23
24
|
margin-bottom: 8px;
|
|
@@ -26,13 +27,13 @@ const Title = styled(I)`
|
|
|
26
27
|
-webkit-text-fill-color: transparent;
|
|
27
28
|
display: block;
|
|
28
29
|
`;
|
|
29
|
-
const Subtitle = styled(
|
|
30
|
+
const Subtitle = styled(A)`
|
|
30
31
|
font-size: 1.125rem;
|
|
31
32
|
color: ${(props) => props.theme.colors.neutral600};
|
|
32
33
|
line-height: 1.6;
|
|
33
34
|
display: block;
|
|
34
35
|
`;
|
|
35
|
-
const TierGrid = styled(
|
|
36
|
+
const TierGrid = styled(C)`
|
|
36
37
|
gap: 32px;
|
|
37
38
|
margin: 0 auto 48px;
|
|
38
39
|
max-width: 1080px;
|
|
@@ -40,13 +41,13 @@ const TierGrid = styled(T)`
|
|
|
40
41
|
flex-wrap: wrap;
|
|
41
42
|
align-items: stretch;
|
|
42
43
|
`;
|
|
43
|
-
const TierWrapper = styled(
|
|
44
|
+
const TierWrapper = styled(S)`
|
|
44
45
|
flex: 1;
|
|
45
46
|
min-width: 280px;
|
|
46
47
|
max-width: 340px;
|
|
47
48
|
display: flex;
|
|
48
49
|
`;
|
|
49
|
-
const TierCard = styled(
|
|
50
|
+
const TierCard = styled(S)`
|
|
50
51
|
background: ${(props) => props.theme.colors.neutral0};
|
|
51
52
|
border-radius: 16px;
|
|
52
53
|
padding: 32px;
|
|
@@ -63,7 +64,7 @@ const TierCard = styled(R)`
|
|
|
63
64
|
box-shadow: 0 20px 25px -5px rgba(15, 23, 42, 0.15), 0 8px 10px -6px rgba(15, 23, 42, 0.1);
|
|
64
65
|
}
|
|
65
66
|
`;
|
|
66
|
-
const PopularBadge = styled(
|
|
67
|
+
const PopularBadge = styled(Nr)`
|
|
67
68
|
position: absolute;
|
|
68
69
|
top: -12px;
|
|
69
70
|
right: 24px;
|
|
@@ -73,7 +74,7 @@ const PopularBadge = styled(Ps)`
|
|
|
73
74
|
font-size: 12px;
|
|
74
75
|
font-weight: 600;
|
|
75
76
|
`;
|
|
76
|
-
const TierIcon = styled(
|
|
77
|
+
const TierIcon = styled(S)`
|
|
77
78
|
width: 48px;
|
|
78
79
|
height: 48px;
|
|
79
80
|
border-radius: 12px;
|
|
@@ -89,30 +90,30 @@ const TierIcon = styled(R)`
|
|
|
89
90
|
color: white;
|
|
90
91
|
}
|
|
91
92
|
`;
|
|
92
|
-
const TierName = styled(
|
|
93
|
+
const TierName = styled(A)`
|
|
93
94
|
font-size: 1.5rem;
|
|
94
95
|
font-weight: 700;
|
|
95
96
|
margin-bottom: 8px;
|
|
96
97
|
`;
|
|
97
|
-
const TierPrice = styled(
|
|
98
|
+
const TierPrice = styled(A)`
|
|
98
99
|
font-size: 2rem;
|
|
99
100
|
font-weight: 800;
|
|
100
101
|
margin-bottom: 4px;
|
|
101
102
|
`;
|
|
102
|
-
const TierDescription = styled(
|
|
103
|
+
const TierDescription = styled(A)`
|
|
103
104
|
color: ${(props) => props.theme.colors.neutral600};
|
|
104
105
|
margin-bottom: 24px;
|
|
105
106
|
`;
|
|
106
|
-
const FeatureList = styled(
|
|
107
|
+
const FeatureList = styled(S)`
|
|
107
108
|
margin-bottom: 24px;
|
|
108
109
|
flex: 1;
|
|
109
110
|
`;
|
|
110
|
-
const Feature = styled(
|
|
111
|
+
const Feature = styled(C)`
|
|
111
112
|
gap: 12px;
|
|
112
113
|
margin-bottom: 12px;
|
|
113
114
|
align-items: flex-start;
|
|
114
115
|
`;
|
|
115
|
-
const FeatureIcon = styled(
|
|
116
|
+
const FeatureIcon = styled(S)`
|
|
116
117
|
width: 20px;
|
|
117
118
|
height: 20px;
|
|
118
119
|
border-radius: 50%;
|
|
@@ -130,7 +131,7 @@ const FeatureIcon = styled(R)`
|
|
|
130
131
|
svg { color: #DC2626; }
|
|
131
132
|
`}
|
|
132
133
|
`;
|
|
133
|
-
const UpgradeButton = styled(
|
|
134
|
+
const UpgradeButton = styled(Ct)`
|
|
134
135
|
width: 100%;
|
|
135
136
|
height: 48px;
|
|
136
137
|
font-weight: 600;
|
|
@@ -144,7 +145,7 @@ const UpgradeButton = styled(zn)`
|
|
|
144
145
|
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
|
|
145
146
|
}
|
|
146
147
|
`;
|
|
147
|
-
const CurrentPlanBadge = styled(
|
|
148
|
+
const CurrentPlanBadge = styled(Nr)`
|
|
148
149
|
width: 100%;
|
|
149
150
|
height: 48px;
|
|
150
151
|
display: flex;
|
|
@@ -155,7 +156,7 @@ const CurrentPlanBadge = styled(Ps)`
|
|
|
155
156
|
font-weight: 600;
|
|
156
157
|
font-size: 15px;
|
|
157
158
|
`;
|
|
158
|
-
const UsageBox = styled(
|
|
159
|
+
const UsageBox = styled(S)`
|
|
159
160
|
background: ${(props) => props.theme.colors.neutral100};
|
|
160
161
|
border: 1px solid ${(props) => props.theme.colors.neutral200};
|
|
161
162
|
border-radius: 12px;
|
|
@@ -225,7 +226,7 @@ const LicensePage = () => {
|
|
|
225
226
|
price: "$0",
|
|
226
227
|
period: "forever",
|
|
227
228
|
description: "Perfect for small projects and testing",
|
|
228
|
-
icon: /* @__PURE__ */ jsx(
|
|
229
|
+
icon: /* @__PURE__ */ jsx(Vn, {}),
|
|
229
230
|
color: "linear-gradient(135deg, #6B7280, #4B5563)",
|
|
230
231
|
features: [
|
|
231
232
|
{ name: "Full Editor Access", included: true },
|
|
@@ -250,7 +251,7 @@ const LicensePage = () => {
|
|
|
250
251
|
price: "$9.90",
|
|
251
252
|
period: "/month",
|
|
252
253
|
description: "Enhanced collaboration for teams",
|
|
253
|
-
icon: /* @__PURE__ */ jsx(
|
|
254
|
+
icon: /* @__PURE__ */ jsx(F3, {}),
|
|
254
255
|
color: "linear-gradient(135deg, #8B5CF6, #7C3AED)",
|
|
255
256
|
featured: true,
|
|
256
257
|
features: [
|
|
@@ -276,7 +277,7 @@ const LicensePage = () => {
|
|
|
276
277
|
price: "$24.90",
|
|
277
278
|
period: "/month",
|
|
278
279
|
description: "Unlimited collaboration for enterprises",
|
|
279
|
-
icon: /* @__PURE__ */ jsx(
|
|
280
|
+
icon: /* @__PURE__ */ jsx(mn, {}),
|
|
280
281
|
color: "linear-gradient(135deg, #7C3AED, #6d28d9)",
|
|
281
282
|
features: [
|
|
282
283
|
{ name: "Full Editor Access", included: true },
|
|
@@ -300,7 +301,7 @@ const LicensePage = () => {
|
|
|
300
301
|
window.open("https://store.magicdx.dev/", "_blank");
|
|
301
302
|
};
|
|
302
303
|
if (loading) {
|
|
303
|
-
return /* @__PURE__ */ jsx(Container, { children: /* @__PURE__ */ jsx(
|
|
304
|
+
return /* @__PURE__ */ jsx(Container, { children: /* @__PURE__ */ jsx(C, { justifyContent: "center", alignItems: "center", style: { minHeight: "400px" }, children: /* @__PURE__ */ jsx(kt, { children: t("license.loading", "Loading license information...") }) }) });
|
|
304
305
|
}
|
|
305
306
|
const collaboratorUsage = limits?.collaborators ? {
|
|
306
307
|
current: limits.collaborators.current || 0,
|
|
@@ -314,14 +315,14 @@ const LicensePage = () => {
|
|
|
314
315
|
/* @__PURE__ */ jsx(Subtitle, { variant: "omega", children: t("upgradePage.subtitle", "Choose your plan for collaborative editing") })
|
|
315
316
|
] }),
|
|
316
317
|
/* @__PURE__ */ jsxs(UsageBox, { children: [
|
|
317
|
-
/* @__PURE__ */ jsxs(
|
|
318
|
-
/* @__PURE__ */ jsx(
|
|
319
|
-
/* @__PURE__ */ jsx(
|
|
318
|
+
/* @__PURE__ */ jsxs(C, { justifyContent: "space-between", alignItems: "center", children: [
|
|
319
|
+
/* @__PURE__ */ jsx(A, { variant: "beta", fontWeight: "bold", children: t("upgradePage.currentUsage", "Current Usage") }),
|
|
320
|
+
/* @__PURE__ */ jsx(Nr, { style: { background: currentTier === "free" ? "#6B7280" : "#7C3AED", color: "white" }, children: currentTier.toUpperCase() })
|
|
320
321
|
] }),
|
|
321
|
-
/* @__PURE__ */ jsxs(
|
|
322
|
-
/* @__PURE__ */ jsxs(
|
|
323
|
-
/* @__PURE__ */ jsx(
|
|
324
|
-
/* @__PURE__ */ jsxs(
|
|
322
|
+
/* @__PURE__ */ jsxs(S, { marginTop: 4, children: [
|
|
323
|
+
/* @__PURE__ */ jsxs(C, { justifyContent: "space-between", children: [
|
|
324
|
+
/* @__PURE__ */ jsx(A, { variant: "omega", children: t("upgradePage.collaborators", "Collaborators") }),
|
|
325
|
+
/* @__PURE__ */ jsxs(A, { variant: "omega", fontWeight: "bold", children: [
|
|
325
326
|
collaboratorUsage.current,
|
|
326
327
|
" / ",
|
|
327
328
|
collaboratorUsage.unlimited ? t("license.unlimited", "Unlimited") : collaboratorUsage.max
|
|
@@ -334,25 +335,25 @@ const LicensePage = () => {
|
|
|
334
335
|
tier.featured && /* @__PURE__ */ jsx(PopularBadge, { children: t("upgradePage.mostPopular", "MOST POPULAR") }),
|
|
335
336
|
/* @__PURE__ */ jsx(TierIcon, { $color: tier.color, children: tier.icon }),
|
|
336
337
|
/* @__PURE__ */ jsx(TierName, { variant: "beta", children: tier.name }),
|
|
337
|
-
/* @__PURE__ */ jsxs(
|
|
338
|
+
/* @__PURE__ */ jsxs(C, { alignItems: "baseline", gap: 1, children: [
|
|
338
339
|
/* @__PURE__ */ jsx(TierPrice, { variant: "alpha", children: tier.price }),
|
|
339
|
-
/* @__PURE__ */ jsx(
|
|
340
|
+
/* @__PURE__ */ jsx(A, { variant: "omega", style: { color: "#6B7280" }, children: tier.period })
|
|
340
341
|
] }),
|
|
341
342
|
/* @__PURE__ */ jsx(TierDescription, { variant: "omega", children: tier.description }),
|
|
342
343
|
/* @__PURE__ */ jsxs(
|
|
343
|
-
|
|
344
|
+
S,
|
|
344
345
|
{
|
|
345
346
|
background: "neutral100",
|
|
346
347
|
hasRadius: true,
|
|
347
348
|
padding: 3,
|
|
348
349
|
marginBottom: 5,
|
|
349
350
|
children: [
|
|
350
|
-
/* @__PURE__ */ jsxs(
|
|
351
|
+
/* @__PURE__ */ jsxs(A, { variant: "pi", style: { fontSize: "13px", display: "block", marginBottom: "4px" }, children: [
|
|
351
352
|
/* @__PURE__ */ jsx("strong", { children: "Collaborators:" }),
|
|
352
353
|
" ",
|
|
353
354
|
tier.limits.collaborators
|
|
354
355
|
] }),
|
|
355
|
-
/* @__PURE__ */ jsxs(
|
|
356
|
+
/* @__PURE__ */ jsxs(A, { variant: "pi", style: { fontSize: "13px", display: "block" }, children: [
|
|
356
357
|
/* @__PURE__ */ jsx("strong", { children: "Custom Blocks:" }),
|
|
357
358
|
" ",
|
|
358
359
|
tier.limits.customBlocks
|
|
@@ -361,9 +362,9 @@ const LicensePage = () => {
|
|
|
361
362
|
}
|
|
362
363
|
),
|
|
363
364
|
/* @__PURE__ */ jsx(FeatureList, { children: tier.features.map((feature, index) => /* @__PURE__ */ jsxs(Feature, { children: [
|
|
364
|
-
/* @__PURE__ */ jsx(FeatureIcon, { $included: feature.included, children: feature.included ? /* @__PURE__ */ jsx(
|
|
365
|
+
/* @__PURE__ */ jsx(FeatureIcon, { $included: feature.included, children: feature.included ? /* @__PURE__ */ jsx(h5, { style: { width: 14, height: 14 } }) : /* @__PURE__ */ jsx(F5, { style: { width: 14, height: 14 } }) }),
|
|
365
366
|
/* @__PURE__ */ jsx(
|
|
366
|
-
|
|
367
|
+
A,
|
|
367
368
|
{
|
|
368
369
|
variant: "omega",
|
|
369
370
|
textColor: feature.included ? "neutral800" : "neutral500",
|
|
@@ -1,19 +1,20 @@
|
|
|
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 s = require("react");
|
|
5
5
|
const admin = require("@strapi/strapi/admin");
|
|
6
|
-
const
|
|
6
|
+
const reactIntl = require("react-intl");
|
|
7
|
+
const getTranslation = require("./getTranslation-DQ_WJ-7M.js");
|
|
7
8
|
const styled = require("styled-components");
|
|
8
|
-
const index = require("./index-
|
|
9
|
+
const index = require("./index-Bn2tfJrC.js");
|
|
9
10
|
const _interopDefault = (e) => e && e.__esModule ? e : { default: e };
|
|
10
11
|
const styled__default = /* @__PURE__ */ _interopDefault(styled);
|
|
11
|
-
const Container = styled__default.default(getTranslation.
|
|
12
|
+
const Container = styled__default.default(getTranslation.S)`
|
|
12
13
|
padding: 32px;
|
|
13
14
|
max-width: 1400px;
|
|
14
15
|
margin: 0 auto;
|
|
15
16
|
`;
|
|
16
|
-
const Header = styled__default.default(getTranslation.
|
|
17
|
+
const Header = styled__default.default(getTranslation.S)`
|
|
17
18
|
text-align: center;
|
|
18
19
|
margin-bottom: 48px;
|
|
19
20
|
display: flex;
|
|
@@ -21,7 +22,7 @@ const Header = styled__default.default(getTranslation.R)`
|
|
|
21
22
|
align-items: center;
|
|
22
23
|
gap: 8px;
|
|
23
24
|
`;
|
|
24
|
-
const Title = styled__default.default(getTranslation.
|
|
25
|
+
const Title = styled__default.default(getTranslation.A)`
|
|
25
26
|
font-size: 2.5rem;
|
|
26
27
|
font-weight: 700;
|
|
27
28
|
margin-bottom: 8px;
|
|
@@ -30,13 +31,13 @@ const Title = styled__default.default(getTranslation.I)`
|
|
|
30
31
|
-webkit-text-fill-color: transparent;
|
|
31
32
|
display: block;
|
|
32
33
|
`;
|
|
33
|
-
const Subtitle = styled__default.default(getTranslation.
|
|
34
|
+
const Subtitle = styled__default.default(getTranslation.A)`
|
|
34
35
|
font-size: 1.125rem;
|
|
35
36
|
color: ${(props) => props.theme.colors.neutral600};
|
|
36
37
|
line-height: 1.6;
|
|
37
38
|
display: block;
|
|
38
39
|
`;
|
|
39
|
-
const TierGrid = styled__default.default(getTranslation.
|
|
40
|
+
const TierGrid = styled__default.default(getTranslation.C)`
|
|
40
41
|
gap: 32px;
|
|
41
42
|
margin: 0 auto 48px;
|
|
42
43
|
max-width: 1080px;
|
|
@@ -44,13 +45,13 @@ const TierGrid = styled__default.default(getTranslation.T)`
|
|
|
44
45
|
flex-wrap: wrap;
|
|
45
46
|
align-items: stretch;
|
|
46
47
|
`;
|
|
47
|
-
const TierWrapper = styled__default.default(getTranslation.
|
|
48
|
+
const TierWrapper = styled__default.default(getTranslation.S)`
|
|
48
49
|
flex: 1;
|
|
49
50
|
min-width: 280px;
|
|
50
51
|
max-width: 340px;
|
|
51
52
|
display: flex;
|
|
52
53
|
`;
|
|
53
|
-
const TierCard = styled__default.default(getTranslation.
|
|
54
|
+
const TierCard = styled__default.default(getTranslation.S)`
|
|
54
55
|
background: ${(props) => props.theme.colors.neutral0};
|
|
55
56
|
border-radius: 16px;
|
|
56
57
|
padding: 32px;
|
|
@@ -67,7 +68,7 @@ const TierCard = styled__default.default(getTranslation.R)`
|
|
|
67
68
|
box-shadow: 0 20px 25px -5px rgba(15, 23, 42, 0.15), 0 8px 10px -6px rgba(15, 23, 42, 0.1);
|
|
68
69
|
}
|
|
69
70
|
`;
|
|
70
|
-
const PopularBadge = styled__default.default(getTranslation.
|
|
71
|
+
const PopularBadge = styled__default.default(getTranslation.Nr)`
|
|
71
72
|
position: absolute;
|
|
72
73
|
top: -12px;
|
|
73
74
|
right: 24px;
|
|
@@ -77,7 +78,7 @@ const PopularBadge = styled__default.default(getTranslation.Ps)`
|
|
|
77
78
|
font-size: 12px;
|
|
78
79
|
font-weight: 600;
|
|
79
80
|
`;
|
|
80
|
-
const TierIcon = styled__default.default(getTranslation.
|
|
81
|
+
const TierIcon = styled__default.default(getTranslation.S)`
|
|
81
82
|
width: 48px;
|
|
82
83
|
height: 48px;
|
|
83
84
|
border-radius: 12px;
|
|
@@ -93,30 +94,30 @@ const TierIcon = styled__default.default(getTranslation.R)`
|
|
|
93
94
|
color: white;
|
|
94
95
|
}
|
|
95
96
|
`;
|
|
96
|
-
const TierName = styled__default.default(getTranslation.
|
|
97
|
+
const TierName = styled__default.default(getTranslation.A)`
|
|
97
98
|
font-size: 1.5rem;
|
|
98
99
|
font-weight: 700;
|
|
99
100
|
margin-bottom: 8px;
|
|
100
101
|
`;
|
|
101
|
-
const TierPrice = styled__default.default(getTranslation.
|
|
102
|
+
const TierPrice = styled__default.default(getTranslation.A)`
|
|
102
103
|
font-size: 2rem;
|
|
103
104
|
font-weight: 800;
|
|
104
105
|
margin-bottom: 4px;
|
|
105
106
|
`;
|
|
106
|
-
const TierDescription = styled__default.default(getTranslation.
|
|
107
|
+
const TierDescription = styled__default.default(getTranslation.A)`
|
|
107
108
|
color: ${(props) => props.theme.colors.neutral600};
|
|
108
109
|
margin-bottom: 24px;
|
|
109
110
|
`;
|
|
110
|
-
const FeatureList = styled__default.default(getTranslation.
|
|
111
|
+
const FeatureList = styled__default.default(getTranslation.S)`
|
|
111
112
|
margin-bottom: 24px;
|
|
112
113
|
flex: 1;
|
|
113
114
|
`;
|
|
114
|
-
const Feature = styled__default.default(getTranslation.
|
|
115
|
+
const Feature = styled__default.default(getTranslation.C)`
|
|
115
116
|
gap: 12px;
|
|
116
117
|
margin-bottom: 12px;
|
|
117
118
|
align-items: flex-start;
|
|
118
119
|
`;
|
|
119
|
-
const FeatureIcon = styled__default.default(getTranslation.
|
|
120
|
+
const FeatureIcon = styled__default.default(getTranslation.S)`
|
|
120
121
|
width: 20px;
|
|
121
122
|
height: 20px;
|
|
122
123
|
border-radius: 50%;
|
|
@@ -134,7 +135,7 @@ const FeatureIcon = styled__default.default(getTranslation.R)`
|
|
|
134
135
|
svg { color: #DC2626; }
|
|
135
136
|
`}
|
|
136
137
|
`;
|
|
137
|
-
const UpgradeButton = styled__default.default(getTranslation.
|
|
138
|
+
const UpgradeButton = styled__default.default(getTranslation.Ct)`
|
|
138
139
|
width: 100%;
|
|
139
140
|
height: 48px;
|
|
140
141
|
font-weight: 600;
|
|
@@ -148,7 +149,7 @@ const UpgradeButton = styled__default.default(getTranslation.zn)`
|
|
|
148
149
|
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
|
|
149
150
|
}
|
|
150
151
|
`;
|
|
151
|
-
const CurrentPlanBadge = styled__default.default(getTranslation.
|
|
152
|
+
const CurrentPlanBadge = styled__default.default(getTranslation.Nr)`
|
|
152
153
|
width: 100%;
|
|
153
154
|
height: 48px;
|
|
154
155
|
display: flex;
|
|
@@ -159,7 +160,7 @@ const CurrentPlanBadge = styled__default.default(getTranslation.Ps)`
|
|
|
159
160
|
font-weight: 600;
|
|
160
161
|
font-size: 15px;
|
|
161
162
|
`;
|
|
162
|
-
const UsageBox = styled__default.default(getTranslation.
|
|
163
|
+
const UsageBox = styled__default.default(getTranslation.S)`
|
|
163
164
|
background: ${(props) => props.theme.colors.neutral100};
|
|
164
165
|
border: 1px solid ${(props) => props.theme.colors.neutral200};
|
|
165
166
|
border-radius: 12px;
|
|
@@ -180,14 +181,14 @@ const UsageProgress = styled__default.default.div`
|
|
|
180
181
|
transition: width 0.3s ease;
|
|
181
182
|
`;
|
|
182
183
|
const LicensePage = () => {
|
|
183
|
-
const { formatMessage } =
|
|
184
|
+
const { formatMessage } = reactIntl.useIntl();
|
|
184
185
|
const t = (id, defaultMessage, values) => formatMessage({ id: getTranslation.getTranslation(id), defaultMessage }, values);
|
|
185
186
|
const { get } = admin.useFetchClient();
|
|
186
187
|
const { toggleNotification } = admin.useNotification();
|
|
187
|
-
const [currentTier, setCurrentTier] =
|
|
188
|
-
const [limits, setLimits] =
|
|
189
|
-
const [loading, setLoading] =
|
|
190
|
-
|
|
188
|
+
const [currentTier, setCurrentTier] = s.useState("free");
|
|
189
|
+
const [limits, setLimits] = s.useState(null);
|
|
190
|
+
const [loading, setLoading] = s.useState(true);
|
|
191
|
+
s.useEffect(() => {
|
|
191
192
|
fetchLicenseInfo();
|
|
192
193
|
}, []);
|
|
193
194
|
const fetchLicenseInfo = async () => {
|
|
@@ -229,7 +230,7 @@ const LicensePage = () => {
|
|
|
229
230
|
price: "$0",
|
|
230
231
|
period: "forever",
|
|
231
232
|
description: "Perfect for small projects and testing",
|
|
232
|
-
icon: /* @__PURE__ */ jsxRuntime.jsx(index.
|
|
233
|
+
icon: /* @__PURE__ */ jsxRuntime.jsx(index.Vn, {}),
|
|
233
234
|
color: "linear-gradient(135deg, #6B7280, #4B5563)",
|
|
234
235
|
features: [
|
|
235
236
|
{ name: "Full Editor Access", included: true },
|
|
@@ -254,7 +255,7 @@ const LicensePage = () => {
|
|
|
254
255
|
price: "$9.90",
|
|
255
256
|
period: "/month",
|
|
256
257
|
description: "Enhanced collaboration for teams",
|
|
257
|
-
icon: /* @__PURE__ */ jsxRuntime.jsx(index.
|
|
258
|
+
icon: /* @__PURE__ */ jsxRuntime.jsx(index.F3, {}),
|
|
258
259
|
color: "linear-gradient(135deg, #8B5CF6, #7C3AED)",
|
|
259
260
|
featured: true,
|
|
260
261
|
features: [
|
|
@@ -280,7 +281,7 @@ const LicensePage = () => {
|
|
|
280
281
|
price: "$24.90",
|
|
281
282
|
period: "/month",
|
|
282
283
|
description: "Unlimited collaboration for enterprises",
|
|
283
|
-
icon: /* @__PURE__ */ jsxRuntime.jsx(index.
|
|
284
|
+
icon: /* @__PURE__ */ jsxRuntime.jsx(index.mn, {}),
|
|
284
285
|
color: "linear-gradient(135deg, #7C3AED, #6d28d9)",
|
|
285
286
|
features: [
|
|
286
287
|
{ name: "Full Editor Access", included: true },
|
|
@@ -304,7 +305,7 @@ const LicensePage = () => {
|
|
|
304
305
|
window.open("https://store.magicdx.dev/", "_blank");
|
|
305
306
|
};
|
|
306
307
|
if (loading) {
|
|
307
|
-
return /* @__PURE__ */ jsxRuntime.jsx(Container, { children: /* @__PURE__ */ jsxRuntime.jsx(getTranslation.
|
|
308
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Container, { children: /* @__PURE__ */ jsxRuntime.jsx(getTranslation.C, { justifyContent: "center", alignItems: "center", style: { minHeight: "400px" }, children: /* @__PURE__ */ jsxRuntime.jsx(getTranslation.kt, { children: t("license.loading", "Loading license information...") }) }) });
|
|
308
309
|
}
|
|
309
310
|
const collaboratorUsage = limits?.collaborators ? {
|
|
310
311
|
current: limits.collaborators.current || 0,
|
|
@@ -318,14 +319,14 @@ const LicensePage = () => {
|
|
|
318
319
|
/* @__PURE__ */ jsxRuntime.jsx(Subtitle, { variant: "omega", children: t("upgradePage.subtitle", "Choose your plan for collaborative editing") })
|
|
319
320
|
] }),
|
|
320
321
|
/* @__PURE__ */ jsxRuntime.jsxs(UsageBox, { children: [
|
|
321
|
-
/* @__PURE__ */ jsxRuntime.jsxs(getTranslation.
|
|
322
|
-
/* @__PURE__ */ jsxRuntime.jsx(getTranslation.
|
|
323
|
-
/* @__PURE__ */ jsxRuntime.jsx(getTranslation.
|
|
322
|
+
/* @__PURE__ */ jsxRuntime.jsxs(getTranslation.C, { justifyContent: "space-between", alignItems: "center", children: [
|
|
323
|
+
/* @__PURE__ */ jsxRuntime.jsx(getTranslation.A, { variant: "beta", fontWeight: "bold", children: t("upgradePage.currentUsage", "Current Usage") }),
|
|
324
|
+
/* @__PURE__ */ jsxRuntime.jsx(getTranslation.Nr, { style: { background: currentTier === "free" ? "#6B7280" : "#7C3AED", color: "white" }, children: currentTier.toUpperCase() })
|
|
324
325
|
] }),
|
|
325
|
-
/* @__PURE__ */ jsxRuntime.jsxs(getTranslation.
|
|
326
|
-
/* @__PURE__ */ jsxRuntime.jsxs(getTranslation.
|
|
327
|
-
/* @__PURE__ */ jsxRuntime.jsx(getTranslation.
|
|
328
|
-
/* @__PURE__ */ jsxRuntime.jsxs(getTranslation.
|
|
326
|
+
/* @__PURE__ */ jsxRuntime.jsxs(getTranslation.S, { marginTop: 4, children: [
|
|
327
|
+
/* @__PURE__ */ jsxRuntime.jsxs(getTranslation.C, { justifyContent: "space-between", children: [
|
|
328
|
+
/* @__PURE__ */ jsxRuntime.jsx(getTranslation.A, { variant: "omega", children: t("upgradePage.collaborators", "Collaborators") }),
|
|
329
|
+
/* @__PURE__ */ jsxRuntime.jsxs(getTranslation.A, { variant: "omega", fontWeight: "bold", children: [
|
|
329
330
|
collaboratorUsage.current,
|
|
330
331
|
" / ",
|
|
331
332
|
collaboratorUsage.unlimited ? t("license.unlimited", "Unlimited") : collaboratorUsage.max
|
|
@@ -338,25 +339,25 @@ const LicensePage = () => {
|
|
|
338
339
|
tier.featured && /* @__PURE__ */ jsxRuntime.jsx(PopularBadge, { children: t("upgradePage.mostPopular", "MOST POPULAR") }),
|
|
339
340
|
/* @__PURE__ */ jsxRuntime.jsx(TierIcon, { $color: tier.color, children: tier.icon }),
|
|
340
341
|
/* @__PURE__ */ jsxRuntime.jsx(TierName, { variant: "beta", children: tier.name }),
|
|
341
|
-
/* @__PURE__ */ jsxRuntime.jsxs(getTranslation.
|
|
342
|
+
/* @__PURE__ */ jsxRuntime.jsxs(getTranslation.C, { alignItems: "baseline", gap: 1, children: [
|
|
342
343
|
/* @__PURE__ */ jsxRuntime.jsx(TierPrice, { variant: "alpha", children: tier.price }),
|
|
343
|
-
/* @__PURE__ */ jsxRuntime.jsx(getTranslation.
|
|
344
|
+
/* @__PURE__ */ jsxRuntime.jsx(getTranslation.A, { variant: "omega", style: { color: "#6B7280" }, children: tier.period })
|
|
344
345
|
] }),
|
|
345
346
|
/* @__PURE__ */ jsxRuntime.jsx(TierDescription, { variant: "omega", children: tier.description }),
|
|
346
347
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
347
|
-
getTranslation.
|
|
348
|
+
getTranslation.S,
|
|
348
349
|
{
|
|
349
350
|
background: "neutral100",
|
|
350
351
|
hasRadius: true,
|
|
351
352
|
padding: 3,
|
|
352
353
|
marginBottom: 5,
|
|
353
354
|
children: [
|
|
354
|
-
/* @__PURE__ */ jsxRuntime.jsxs(getTranslation.
|
|
355
|
+
/* @__PURE__ */ jsxRuntime.jsxs(getTranslation.A, { variant: "pi", style: { fontSize: "13px", display: "block", marginBottom: "4px" }, children: [
|
|
355
356
|
/* @__PURE__ */ jsxRuntime.jsx("strong", { children: "Collaborators:" }),
|
|
356
357
|
" ",
|
|
357
358
|
tier.limits.collaborators
|
|
358
359
|
] }),
|
|
359
|
-
/* @__PURE__ */ jsxRuntime.jsxs(getTranslation.
|
|
360
|
+
/* @__PURE__ */ jsxRuntime.jsxs(getTranslation.A, { variant: "pi", style: { fontSize: "13px", display: "block" }, children: [
|
|
360
361
|
/* @__PURE__ */ jsxRuntime.jsx("strong", { children: "Custom Blocks:" }),
|
|
361
362
|
" ",
|
|
362
363
|
tier.limits.customBlocks
|
|
@@ -365,9 +366,9 @@ const LicensePage = () => {
|
|
|
365
366
|
}
|
|
366
367
|
),
|
|
367
368
|
/* @__PURE__ */ jsxRuntime.jsx(FeatureList, { children: tier.features.map((feature, index$1) => /* @__PURE__ */ jsxRuntime.jsxs(Feature, { children: [
|
|
368
|
-
/* @__PURE__ */ jsxRuntime.jsx(FeatureIcon, { $included: feature.included, children: feature.included ? /* @__PURE__ */ jsxRuntime.jsx(index.
|
|
369
|
+
/* @__PURE__ */ jsxRuntime.jsx(FeatureIcon, { $included: feature.included, children: feature.included ? /* @__PURE__ */ jsxRuntime.jsx(index.h5, { style: { width: 14, height: 14 } }) : /* @__PURE__ */ jsxRuntime.jsx(index.F5, { style: { width: 14, height: 14 } }) }),
|
|
369
370
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
370
|
-
getTranslation.
|
|
371
|
+
getTranslation.A,
|
|
371
372
|
{
|
|
372
373
|
variant: "omega",
|
|
373
374
|
textColor: feature.included ? "neutral800" : "neutral500",
|
package/dist/{_chunks/LiveCollaborationPanel-BFybu8h0.js → admin/LiveCollaborationPanel-CZAbgAVr.js}
RENAMED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
3
|
const jsxRuntime = require("react/jsx-runtime");
|
|
4
|
-
const
|
|
5
|
-
const
|
|
4
|
+
const s = require("react");
|
|
5
|
+
const reactIntl = require("react-intl");
|
|
6
|
+
const getTranslation = require("./getTranslation-DQ_WJ-7M.js");
|
|
6
7
|
const styled = require("styled-components");
|
|
7
8
|
const _interopDefault = (e) => e && e.__esModule ? e : { default: e };
|
|
8
9
|
const styled__default = /* @__PURE__ */ _interopDefault(styled);
|
|
@@ -150,14 +151,14 @@ const getPeerName = (user = {}, t) => {
|
|
|
150
151
|
return user.email || t("collab.unknown", "Unknown");
|
|
151
152
|
};
|
|
152
153
|
const LiveCollaborationPanel = ({ documentId, model, document }) => {
|
|
153
|
-
const { formatMessage } =
|
|
154
|
+
const { formatMessage } = reactIntl.useIntl();
|
|
154
155
|
const t = (id, defaultMessage, values) => formatMessage({ id: getTranslation.getTranslation(id), defaultMessage }, values);
|
|
155
|
-
const [collabState, setCollabState] =
|
|
156
|
+
const [collabState, setCollabState] = s.useState({
|
|
156
157
|
status: "disabled",
|
|
157
158
|
peers: [],
|
|
158
159
|
error: null
|
|
159
160
|
});
|
|
160
|
-
|
|
161
|
+
s.useEffect(() => {
|
|
161
162
|
const handleCollabUpdate = (event) => {
|
|
162
163
|
if (event.detail) {
|
|
163
164
|
setCollabState(event.detail);
|
|
@@ -172,7 +173,7 @@ const LiveCollaborationPanel = ({ documentId, model, document }) => {
|
|
|
172
173
|
};
|
|
173
174
|
}, []);
|
|
174
175
|
const { status, peers, error } = collabState;
|
|
175
|
-
const statusLabel =
|
|
176
|
+
const statusLabel = s.useMemo(() => {
|
|
176
177
|
switch (status) {
|
|
177
178
|
case "connected":
|
|
178
179
|
return t("collab.live", "Live");
|
|
@@ -196,7 +197,7 @@ const LiveCollaborationPanel = ({ documentId, model, document }) => {
|
|
|
196
197
|
const isConnected = status === "connected";
|
|
197
198
|
return {
|
|
198
199
|
title: t("collab.title", "Live Collaboration"),
|
|
199
|
-
content: /* @__PURE__ */ jsxRuntime.jsxs(getTranslation.
|
|
200
|
+
content: /* @__PURE__ */ jsxRuntime.jsxs(getTranslation.C, { direction: "column", gap: 4, alignItems: "stretch", style: { width: "100%" }, children: [
|
|
200
201
|
/* @__PURE__ */ jsxRuntime.jsxs(StatusCard, { $status: status, children: [
|
|
201
202
|
/* @__PURE__ */ jsxRuntime.jsx(StatusDot, { $status: status }),
|
|
202
203
|
/* @__PURE__ */ jsxRuntime.jsxs(StatusText, { children: [
|
|
@@ -206,7 +207,7 @@ const LiveCollaborationPanel = ({ documentId, model, document }) => {
|
|
|
206
207
|
] }),
|
|
207
208
|
isConnected && peers.length > 0 && /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
208
209
|
/* @__PURE__ */ jsxRuntime.jsx(SectionTitle, { children: t("collab.activePeers", "Active Collaborators ({count})", { count: peers.length }) }),
|
|
209
|
-
/* @__PURE__ */ jsxRuntime.jsx(getTranslation.
|
|
210
|
+
/* @__PURE__ */ jsxRuntime.jsx(getTranslation.C, { direction: "column", gap: 2, alignItems: "stretch", children: peers.map((peer, idx) => /* @__PURE__ */ jsxRuntime.jsxs(PeerItem, { children: [
|
|
210
211
|
/* @__PURE__ */ jsxRuntime.jsx(PeerAvatar, { $color: PEER_COLORS[idx % PEER_COLORS.length], children: getPeerInitials(peer) }),
|
|
211
212
|
/* @__PURE__ */ jsxRuntime.jsxs(PeerInfo, { children: [
|
|
212
213
|
/* @__PURE__ */ jsxRuntime.jsx(PeerName, { children: getPeerName(peer, t) }),
|