magic-editor-x 1.6.0 → 2.1.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 (97) hide show
  1. package/CHANGELOG.md +322 -0
  2. package/LICENSE +1 -7
  3. package/README.md +398 -969
  4. package/dist/admin/ConfigurationPage-CK2AbfGW.mjs +886 -0
  5. package/dist/admin/ConfigurationPage-CzsT_dO_.js +888 -0
  6. package/dist/admin/CustomBlocksPage-B2A8S5MV.mjs +1741 -0
  7. package/dist/admin/CustomBlocksPage-CvLrsBds.js +1743 -0
  8. package/dist/admin/EditorField-7YCdXx-v.mjs +6829 -0
  9. package/dist/admin/EditorField-BdBCW15Q.js +6864 -0
  10. package/dist/admin/api-CmccMxlN.js +36 -0
  11. package/dist/admin/api-D5CAH0nh.mjs +37 -0
  12. package/dist/admin/de-BHPyA2S-.mjs +103 -0
  13. package/dist/admin/de-Bt6pYIWi.mjs +246 -0
  14. package/dist/admin/de-CVbi685U.js +246 -0
  15. package/dist/admin/de-CkUYGb7U.js +176 -0
  16. package/dist/admin/de-DBR893G4.js +13 -0
  17. package/dist/admin/de-RMs-_SCK.js +103 -0
  18. package/dist/admin/de-fBFh09Wl.mjs +13 -0
  19. package/dist/admin/de-rRIutpYJ.mjs +176 -0
  20. package/dist/admin/en-BX362fTp.js +246 -0
  21. package/dist/admin/en-B_HltUxZ.mjs +246 -0
  22. package/dist/admin/en-BluCStLw.mjs +103 -0
  23. package/dist/admin/en-C81faOHP.js +103 -0
  24. package/dist/admin/en-D9Nfccux.mjs +13 -0
  25. package/dist/admin/en-DulOcmXb.js +176 -0
  26. package/dist/admin/en-Puup8TFi.mjs +176 -0
  27. package/dist/admin/en-gueRT44P.js +13 -0
  28. package/dist/admin/es-257SSB7f.mjs +176 -0
  29. package/dist/admin/es-B0Zy8DVg.mjs +13 -0
  30. package/dist/admin/es-BoQZC86B.js +176 -0
  31. package/dist/admin/es-CHHEZi44.js +246 -0
  32. package/dist/admin/es-CQRI2Prp.mjs +103 -0
  33. package/dist/admin/es-CrhwOq-5.mjs +246 -0
  34. package/dist/admin/es-D1QzY0JW.js +103 -0
  35. package/dist/admin/es-DRGs7meF.js +13 -0
  36. package/dist/admin/fr-5djKfQ3s.mjs +246 -0
  37. package/dist/admin/fr-B3SL0TBV.js +246 -0
  38. package/dist/admin/fr-B8rdLAIL.js +13 -0
  39. package/dist/admin/fr-C5rSdKU4.mjs +176 -0
  40. package/dist/admin/fr-Di3R6gOX.mjs +103 -0
  41. package/dist/admin/fr-HxFcPpv4.js +176 -0
  42. package/dist/admin/fr-R3_MbzT5.js +103 -0
  43. package/dist/admin/fr-oiUb2bb_.mjs +13 -0
  44. package/dist/admin/index-0_b1iroK.mjs +156 -0
  45. package/dist/admin/index-6SZLli70.js +155 -0
  46. package/dist/admin/index.js +1 -1
  47. package/dist/admin/index.mjs +2 -2
  48. package/dist/admin/pt-B3Jce6uT.mjs +13 -0
  49. package/dist/admin/pt-BCW1u_Hp.js +103 -0
  50. package/dist/admin/pt-BdnY2Cth.mjs +246 -0
  51. package/dist/admin/pt-BiWuSBcH.js +13 -0
  52. package/dist/admin/pt-Cjn2Sc9k.js +176 -0
  53. package/dist/admin/pt-Cr9AL408.mjs +103 -0
  54. package/dist/admin/pt-D6UuEtPy.mjs +176 -0
  55. package/dist/admin/pt-EVwCuBUK.js +246 -0
  56. package/dist/admin/sanitize-DP5aeU7V.js +597 -0
  57. package/dist/admin/sanitize-jjCot5PM.mjs +596 -0
  58. package/dist/admin/useT-91ruePzq.js +130 -0
  59. package/dist/admin/useT-vgY88N_H.mjs +131 -0
  60. package/dist/server/index.js +5373 -64722
  61. package/dist/server/index.mjs +5373 -64731
  62. package/package.json +90 -66
  63. package/strapi-admin.js +3 -0
  64. package/strapi-server.js +3 -0
  65. package/COPYRIGHT_NOTICE.txt +0 -20
  66. package/dist/admin/App-BwMEZnS-.mjs +0 -2144
  67. package/dist/admin/App-HNr2tizR.js +0 -2147
  68. package/dist/admin/CustomBlocksPage-BjcA7MGz.js +0 -1519
  69. package/dist/admin/CustomBlocksPage-COPOZ2-_.mjs +0 -1517
  70. package/dist/admin/LicensePage-D0DMTF41.mjs +0 -392
  71. package/dist/admin/LicensePage-D0_9yPkw.js +0 -394
  72. package/dist/admin/LiveCollaborationPanel-CZAbgAVr.js +0 -223
  73. package/dist/admin/LiveCollaborationPanel-D8z72afw.mjs +0 -221
  74. package/dist/admin/Settings-DRenvRcG.js +0 -441
  75. package/dist/admin/Settings-DjyNURlS.mjs +0 -439
  76. package/dist/admin/de-C_0Mj-Zo.mjs +0 -296
  77. package/dist/admin/de-DVNVpAt9.js +0 -296
  78. package/dist/admin/en-B7AAf1ie.mjs +0 -296
  79. package/dist/admin/en-C2hv5GsA.js +0 -296
  80. package/dist/admin/es-BzJqcIST.js +0 -274
  81. package/dist/admin/es-zdP8sd-f.mjs +0 -274
  82. package/dist/admin/fr-CtAgOgH1.mjs +0 -274
  83. package/dist/admin/fr-D3GwqAAJ.js +0 -274
  84. package/dist/admin/getTranslation-2OiEgVGt.mjs +0 -49459
  85. package/dist/admin/getTranslation-DQ_WJ-7M.js +0 -49475
  86. package/dist/admin/index-Bn2tfJrC.js +0 -2186
  87. package/dist/admin/index-DAtClhqy.js +0 -6956
  88. package/dist/admin/index-FVEbTfqO.mjs +0 -2187
  89. package/dist/admin/index-gjWl-6E2.mjs +0 -6934
  90. package/dist/admin/magic-editor-x.css +0 -1103
  91. package/dist/admin/pt-BmUw6YMP.mjs +0 -274
  92. package/dist/admin/pt-CFo0nTbj.js +0 -274
  93. package/dist/admin/tools-CzHTZaY_.mjs +0 -2268
  94. package/dist/admin/tools-DALFhvPO.js +0 -2299
  95. package/pics/collab-magiceditorX.png +0 -0
  96. package/pics/editorX.png +0 -0
  97. package/pics/liveCollabwidget1.png +0 -0
@@ -1,392 +0,0 @@
1
- import { jsx, jsxs } from "react/jsx-runtime";
2
- import { useState, useEffect } from "react";
3
- import { useFetchClient, useNotification } from "@strapi/strapi/admin";
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";
6
- import styled from "styled-components";
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)`
9
- padding: 32px;
10
- max-width: 1400px;
11
- margin: 0 auto;
12
- `;
13
- const Header = styled(S)`
14
- text-align: center;
15
- margin-bottom: 48px;
16
- display: flex;
17
- flex-direction: column;
18
- align-items: center;
19
- gap: 8px;
20
- `;
21
- const Title = styled(A)`
22
- font-size: 2.5rem;
23
- font-weight: 700;
24
- margin-bottom: 8px;
25
- background: linear-gradient(135deg, #7C3AED, #6d28d9);
26
- -webkit-background-clip: text;
27
- -webkit-text-fill-color: transparent;
28
- display: block;
29
- `;
30
- const Subtitle = styled(A)`
31
- font-size: 1.125rem;
32
- color: ${(props) => props.theme.colors.neutral600};
33
- line-height: 1.6;
34
- display: block;
35
- `;
36
- const TierGrid = styled(C)`
37
- gap: 32px;
38
- margin: 0 auto 48px;
39
- max-width: 1080px;
40
- justify-content: center;
41
- flex-wrap: wrap;
42
- align-items: stretch;
43
- `;
44
- const TierWrapper = styled(S)`
45
- flex: 1;
46
- min-width: 280px;
47
- max-width: 340px;
48
- display: flex;
49
- `;
50
- const TierCard = styled(S)`
51
- background: ${(props) => props.theme.colors.neutral0};
52
- border-radius: 16px;
53
- padding: 32px;
54
- border: 2px solid ${(props) => props.$featured ? "#7C3AED" : props.theme.colors.neutral200};
55
- position: relative;
56
- transition: all 0.3s ease;
57
- box-shadow: ${(props) => props.$featured ? "0 20px 25px -5px rgba(124, 58, 237, 0.25), 0 8px 10px -6px rgba(124, 58, 237, 0.2)" : "0 10px 15px -3px rgba(15, 23, 42, 0.08), 0 4px 6px -4px rgba(15, 23, 42, 0.05)"};
58
- display: flex;
59
- flex-direction: column;
60
- width: 100%;
61
-
62
- &:hover {
63
- transform: translateY(-4px);
64
- box-shadow: 0 20px 25px -5px rgba(15, 23, 42, 0.15), 0 8px 10px -6px rgba(15, 23, 42, 0.1);
65
- }
66
- `;
67
- const PopularBadge = styled(Nr)`
68
- position: absolute;
69
- top: -12px;
70
- right: 24px;
71
- background: linear-gradient(135deg, #7C3AED, #6d28d9);
72
- color: white;
73
- padding: 4px 16px;
74
- font-size: 12px;
75
- font-weight: 600;
76
- `;
77
- const TierIcon = styled(S)`
78
- width: 48px;
79
- height: 48px;
80
- border-radius: 12px;
81
- display: flex;
82
- align-items: center;
83
- justify-content: center;
84
- margin-bottom: 16px;
85
- background: ${(props) => props.$color};
86
-
87
- svg {
88
- width: 28px;
89
- height: 28px;
90
- color: white;
91
- }
92
- `;
93
- const TierName = styled(A)`
94
- font-size: 1.5rem;
95
- font-weight: 700;
96
- margin-bottom: 8px;
97
- `;
98
- const TierPrice = styled(A)`
99
- font-size: 2rem;
100
- font-weight: 800;
101
- margin-bottom: 4px;
102
- `;
103
- const TierDescription = styled(A)`
104
- color: ${(props) => props.theme.colors.neutral600};
105
- margin-bottom: 24px;
106
- `;
107
- const FeatureList = styled(S)`
108
- margin-bottom: 24px;
109
- flex: 1;
110
- `;
111
- const Feature = styled(C)`
112
- gap: 12px;
113
- margin-bottom: 12px;
114
- align-items: flex-start;
115
- `;
116
- const FeatureIcon = styled(S)`
117
- width: 20px;
118
- height: 20px;
119
- border-radius: 50%;
120
- display: flex;
121
- align-items: center;
122
- justify-content: center;
123
- flex-shrink: 0;
124
- margin-top: 2px;
125
-
126
- ${(props) => props.$included ? `
127
- background: #DCFCE7;
128
- svg { color: #16A34A; }
129
- ` : `
130
- background: #FEE2E2;
131
- svg { color: #DC2626; }
132
- `}
133
- `;
134
- const UpgradeButton = styled(Ct)`
135
- width: 100%;
136
- height: 48px;
137
- font-weight: 600;
138
- font-size: 15px;
139
- background: ${(props) => props.$gradient};
140
- border: none;
141
- color: white;
142
-
143
- &:hover {
144
- transform: translateY(-2px);
145
- box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
146
- }
147
- `;
148
- const CurrentPlanBadge = styled(Nr)`
149
- width: 100%;
150
- height: 48px;
151
- display: flex;
152
- align-items: center;
153
- justify-content: center;
154
- background: ${(props) => props.theme.colors.neutral100};
155
- color: ${(props) => props.theme.colors.neutral600};
156
- font-weight: 600;
157
- font-size: 15px;
158
- `;
159
- const UsageBox = styled(S)`
160
- background: ${(props) => props.theme.colors.neutral100};
161
- border: 1px solid ${(props) => props.theme.colors.neutral200};
162
- border-radius: 12px;
163
- padding: 20px;
164
- margin-bottom: 32px;
165
- `;
166
- const UsageBar = styled.div`
167
- height: 8px;
168
- background: ${(props) => props.theme.colors.neutral200};
169
- border-radius: 4px;
170
- overflow: hidden;
171
- margin-top: 8px;
172
- `;
173
- const UsageProgress = styled.div`
174
- height: 100%;
175
- background: ${(props) => props.$percentage > 80 ? "#ef4444" : props.$percentage > 50 ? "#f59e0b" : "#10b981"};
176
- width: ${(props) => Math.min(props.$percentage, 100)}%;
177
- transition: width 0.3s ease;
178
- `;
179
- const LicensePage = () => {
180
- const { formatMessage } = useIntl();
181
- const t = (id, defaultMessage, values) => formatMessage({ id: getTranslation(id), defaultMessage }, values);
182
- const { get } = useFetchClient();
183
- const { toggleNotification } = useNotification();
184
- const [currentTier, setCurrentTier] = useState("free");
185
- const [limits, setLimits] = useState(null);
186
- const [loading, setLoading] = useState(true);
187
- useEffect(() => {
188
- fetchLicenseInfo();
189
- }, []);
190
- const fetchLicenseInfo = async () => {
191
- try {
192
- const response = await get("/magic-editor-x/license/limits");
193
- const licenseData = response.data || {};
194
- setCurrentTier(licenseData.tier || "free");
195
- setLimits(licenseData.limits);
196
- setLoading(false);
197
- } catch (error) {
198
- console.error("Failed to fetch license info:", error);
199
- setLoading(false);
200
- }
201
- };
202
- const getTierRank = (tierId) => {
203
- const ranks = {
204
- "free": 0,
205
- "premium": 1,
206
- "advanced": 2,
207
- "enterprise": 3
208
- };
209
- return ranks[tierId] || 0;
210
- };
211
- const getButtonText = (tierId) => {
212
- const currentRank = getTierRank(currentTier);
213
- const targetRank = getTierRank(tierId);
214
- if (currentRank === targetRank) {
215
- return t("upgradePage.currentPlan", "Current Plan");
216
- } else if (targetRank > currentRank) {
217
- return t("upgradePage.upgradeNow", "Upgrade Now");
218
- } else {
219
- return t("upgradePage.downgrade", "Downgrade");
220
- }
221
- };
222
- const tiers = [
223
- {
224
- id: "free",
225
- name: "FREE",
226
- price: "$0",
227
- period: "forever",
228
- description: "Perfect for small projects and testing",
229
- icon: /* @__PURE__ */ jsx(Vn, {}),
230
- color: "linear-gradient(135deg, #6B7280, #4B5563)",
231
- features: [
232
- { name: "Full Editor Access", included: true },
233
- { name: "All Editor Tools", included: true },
234
- { name: "2 Collaborators", included: true },
235
- { name: "3 Custom Blocks (Simple)", included: true },
236
- { name: "Real-time Sync", included: true },
237
- { name: "Embedded Entry Blocks", included: false },
238
- { name: "Block Export/Import", included: false },
239
- { name: "AI Style + Rewrite", included: false },
240
- { name: "Version History", included: false },
241
- { name: "Priority Support", included: false }
242
- ],
243
- limits: {
244
- collaborators: "2",
245
- customBlocks: "3 Simple"
246
- }
247
- },
248
- {
249
- id: "premium",
250
- name: "PREMIUM",
251
- price: "$9.90",
252
- period: "/month",
253
- description: "Enhanced collaboration for teams",
254
- icon: /* @__PURE__ */ jsx(F3, {}),
255
- color: "linear-gradient(135deg, #8B5CF6, #7C3AED)",
256
- featured: true,
257
- features: [
258
- { name: "Full Editor Access", included: true },
259
- { name: "All Editor Tools", included: true },
260
- { name: "10 Collaborators", included: true },
261
- { name: "10 Custom Blocks", included: true },
262
- { name: "Embedded Entry Blocks", included: true },
263
- { name: "Real-time Sync", included: true },
264
- { name: "AI Grammar + Style (10/day)", included: true },
265
- { name: "Block Export/Import", included: false },
266
- { name: "Version History", included: true },
267
- { name: "Priority Support", included: true }
268
- ],
269
- limits: {
270
- collaborators: "10",
271
- customBlocks: "10 Total"
272
- }
273
- },
274
- {
275
- id: "advanced",
276
- name: "ADVANCED",
277
- price: "$24.90",
278
- period: "/month",
279
- description: "Unlimited collaboration for enterprises",
280
- icon: /* @__PURE__ */ jsx(mn, {}),
281
- color: "linear-gradient(135deg, #7C3AED, #6d28d9)",
282
- features: [
283
- { name: "Full Editor Access", included: true },
284
- { name: "All Editor Tools", included: true },
285
- { name: "Unlimited Collaborators", included: true },
286
- { name: "Unlimited Custom Blocks", included: true },
287
- { name: "Embedded Entry Blocks", included: true },
288
- { name: "Block Export/Import + API", included: true },
289
- { name: "Real-time Sync", included: true },
290
- { name: "AI All Types (Unlimited)", included: true },
291
- { name: "Version History", included: true },
292
- { name: "Priority Support", included: true }
293
- ],
294
- limits: {
295
- collaborators: "Unlimited",
296
- customBlocks: "Unlimited"
297
- }
298
- }
299
- ];
300
- const handleUpgrade = (tierId) => {
301
- window.open("https://store.magicdx.dev/", "_blank");
302
- };
303
- if (loading) {
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...") }) }) });
305
- }
306
- const collaboratorUsage = limits?.collaborators ? {
307
- current: limits.collaborators.current || 0,
308
- max: limits.collaborators.max,
309
- unlimited: limits.collaborators.unlimited,
310
- percentage: limits.collaborators.unlimited ? 0 : limits.collaborators.current / limits.collaborators.max * 100
311
- } : { current: 0, max: 2, unlimited: false, percentage: 0 };
312
- return /* @__PURE__ */ jsxs(Container, { children: [
313
- /* @__PURE__ */ jsxs(Header, { children: [
314
- /* @__PURE__ */ jsx(Title, { variant: "alpha", children: t("upgradePage.title", "Magic Editor X") }),
315
- /* @__PURE__ */ jsx(Subtitle, { variant: "omega", children: t("upgradePage.subtitle", "Choose your plan for collaborative editing") })
316
- ] }),
317
- /* @__PURE__ */ jsxs(UsageBox, { children: [
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() })
321
- ] }),
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: [
326
- collaboratorUsage.current,
327
- " / ",
328
- collaboratorUsage.unlimited ? t("license.unlimited", "Unlimited") : collaboratorUsage.max
329
- ] })
330
- ] }),
331
- !collaboratorUsage.unlimited && /* @__PURE__ */ jsx(UsageBar, { children: /* @__PURE__ */ jsx(UsageProgress, { $percentage: collaboratorUsage.percentage }) })
332
- ] })
333
- ] }),
334
- /* @__PURE__ */ jsx(TierGrid, { children: tiers.map((tier) => /* @__PURE__ */ jsx(TierWrapper, { children: /* @__PURE__ */ jsxs(TierCard, { $featured: tier.featured, children: [
335
- tier.featured && /* @__PURE__ */ jsx(PopularBadge, { children: t("upgradePage.mostPopular", "MOST POPULAR") }),
336
- /* @__PURE__ */ jsx(TierIcon, { $color: tier.color, children: tier.icon }),
337
- /* @__PURE__ */ jsx(TierName, { variant: "beta", children: tier.name }),
338
- /* @__PURE__ */ jsxs(C, { alignItems: "baseline", gap: 1, children: [
339
- /* @__PURE__ */ jsx(TierPrice, { variant: "alpha", children: tier.price }),
340
- /* @__PURE__ */ jsx(A, { variant: "omega", style: { color: "#6B7280" }, children: tier.period })
341
- ] }),
342
- /* @__PURE__ */ jsx(TierDescription, { variant: "omega", children: tier.description }),
343
- /* @__PURE__ */ jsxs(
344
- S,
345
- {
346
- background: "neutral100",
347
- hasRadius: true,
348
- padding: 3,
349
- marginBottom: 5,
350
- children: [
351
- /* @__PURE__ */ jsxs(A, { variant: "pi", style: { fontSize: "13px", display: "block", marginBottom: "4px" }, children: [
352
- /* @__PURE__ */ jsx("strong", { children: "Collaborators:" }),
353
- " ",
354
- tier.limits.collaborators
355
- ] }),
356
- /* @__PURE__ */ jsxs(A, { variant: "pi", style: { fontSize: "13px", display: "block" }, children: [
357
- /* @__PURE__ */ jsx("strong", { children: "Custom Blocks:" }),
358
- " ",
359
- tier.limits.customBlocks
360
- ] })
361
- ]
362
- }
363
- ),
364
- /* @__PURE__ */ jsx(FeatureList, { children: tier.features.map((feature, index) => /* @__PURE__ */ jsxs(Feature, { children: [
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 } }) }),
366
- /* @__PURE__ */ jsx(
367
- A,
368
- {
369
- variant: "omega",
370
- textColor: feature.included ? "neutral800" : "neutral500",
371
- style: {
372
- fontSize: "14px",
373
- textDecoration: feature.included ? "none" : "line-through"
374
- },
375
- children: feature.name
376
- }
377
- )
378
- ] }, index)) }),
379
- currentTier === tier.id ? /* @__PURE__ */ jsx(CurrentPlanBadge, { children: t("upgradePage.currentPlan", "Current Plan") }) : /* @__PURE__ */ jsx(
380
- UpgradeButton,
381
- {
382
- $gradient: tier.color,
383
- onClick: () => handleUpgrade(tier.id),
384
- children: getButtonText(tier.id)
385
- }
386
- )
387
- ] }) }, tier.id)) })
388
- ] });
389
- };
390
- export {
391
- LicensePage as default
392
- };