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,394 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const jsxRuntime = require("react/jsx-runtime");
4
- const s = require("react");
5
- const admin = require("@strapi/strapi/admin");
6
- const reactIntl = require("react-intl");
7
- const getTranslation = require("./getTranslation-DQ_WJ-7M.js");
8
- const styled = require("styled-components");
9
- const index = require("./index-Bn2tfJrC.js");
10
- const _interopDefault = (e) => e && e.__esModule ? e : { default: e };
11
- const styled__default = /* @__PURE__ */ _interopDefault(styled);
12
- const Container = styled__default.default(getTranslation.S)`
13
- padding: 32px;
14
- max-width: 1400px;
15
- margin: 0 auto;
16
- `;
17
- const Header = styled__default.default(getTranslation.S)`
18
- text-align: center;
19
- margin-bottom: 48px;
20
- display: flex;
21
- flex-direction: column;
22
- align-items: center;
23
- gap: 8px;
24
- `;
25
- const Title = styled__default.default(getTranslation.A)`
26
- font-size: 2.5rem;
27
- font-weight: 700;
28
- margin-bottom: 8px;
29
- background: linear-gradient(135deg, #7C3AED, #6d28d9);
30
- -webkit-background-clip: text;
31
- -webkit-text-fill-color: transparent;
32
- display: block;
33
- `;
34
- const Subtitle = styled__default.default(getTranslation.A)`
35
- font-size: 1.125rem;
36
- color: ${(props) => props.theme.colors.neutral600};
37
- line-height: 1.6;
38
- display: block;
39
- `;
40
- const TierGrid = styled__default.default(getTranslation.C)`
41
- gap: 32px;
42
- margin: 0 auto 48px;
43
- max-width: 1080px;
44
- justify-content: center;
45
- flex-wrap: wrap;
46
- align-items: stretch;
47
- `;
48
- const TierWrapper = styled__default.default(getTranslation.S)`
49
- flex: 1;
50
- min-width: 280px;
51
- max-width: 340px;
52
- display: flex;
53
- `;
54
- const TierCard = styled__default.default(getTranslation.S)`
55
- background: ${(props) => props.theme.colors.neutral0};
56
- border-radius: 16px;
57
- padding: 32px;
58
- border: 2px solid ${(props) => props.$featured ? "#7C3AED" : props.theme.colors.neutral200};
59
- position: relative;
60
- transition: all 0.3s ease;
61
- 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)"};
62
- display: flex;
63
- flex-direction: column;
64
- width: 100%;
65
-
66
- &:hover {
67
- transform: translateY(-4px);
68
- box-shadow: 0 20px 25px -5px rgba(15, 23, 42, 0.15), 0 8px 10px -6px rgba(15, 23, 42, 0.1);
69
- }
70
- `;
71
- const PopularBadge = styled__default.default(getTranslation.Nr)`
72
- position: absolute;
73
- top: -12px;
74
- right: 24px;
75
- background: linear-gradient(135deg, #7C3AED, #6d28d9);
76
- color: white;
77
- padding: 4px 16px;
78
- font-size: 12px;
79
- font-weight: 600;
80
- `;
81
- const TierIcon = styled__default.default(getTranslation.S)`
82
- width: 48px;
83
- height: 48px;
84
- border-radius: 12px;
85
- display: flex;
86
- align-items: center;
87
- justify-content: center;
88
- margin-bottom: 16px;
89
- background: ${(props) => props.$color};
90
-
91
- svg {
92
- width: 28px;
93
- height: 28px;
94
- color: white;
95
- }
96
- `;
97
- const TierName = styled__default.default(getTranslation.A)`
98
- font-size: 1.5rem;
99
- font-weight: 700;
100
- margin-bottom: 8px;
101
- `;
102
- const TierPrice = styled__default.default(getTranslation.A)`
103
- font-size: 2rem;
104
- font-weight: 800;
105
- margin-bottom: 4px;
106
- `;
107
- const TierDescription = styled__default.default(getTranslation.A)`
108
- color: ${(props) => props.theme.colors.neutral600};
109
- margin-bottom: 24px;
110
- `;
111
- const FeatureList = styled__default.default(getTranslation.S)`
112
- margin-bottom: 24px;
113
- flex: 1;
114
- `;
115
- const Feature = styled__default.default(getTranslation.C)`
116
- gap: 12px;
117
- margin-bottom: 12px;
118
- align-items: flex-start;
119
- `;
120
- const FeatureIcon = styled__default.default(getTranslation.S)`
121
- width: 20px;
122
- height: 20px;
123
- border-radius: 50%;
124
- display: flex;
125
- align-items: center;
126
- justify-content: center;
127
- flex-shrink: 0;
128
- margin-top: 2px;
129
-
130
- ${(props) => props.$included ? `
131
- background: #DCFCE7;
132
- svg { color: #16A34A; }
133
- ` : `
134
- background: #FEE2E2;
135
- svg { color: #DC2626; }
136
- `}
137
- `;
138
- const UpgradeButton = styled__default.default(getTranslation.Ct)`
139
- width: 100%;
140
- height: 48px;
141
- font-weight: 600;
142
- font-size: 15px;
143
- background: ${(props) => props.$gradient};
144
- border: none;
145
- color: white;
146
-
147
- &:hover {
148
- transform: translateY(-2px);
149
- box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
150
- }
151
- `;
152
- const CurrentPlanBadge = styled__default.default(getTranslation.Nr)`
153
- width: 100%;
154
- height: 48px;
155
- display: flex;
156
- align-items: center;
157
- justify-content: center;
158
- background: ${(props) => props.theme.colors.neutral100};
159
- color: ${(props) => props.theme.colors.neutral600};
160
- font-weight: 600;
161
- font-size: 15px;
162
- `;
163
- const UsageBox = styled__default.default(getTranslation.S)`
164
- background: ${(props) => props.theme.colors.neutral100};
165
- border: 1px solid ${(props) => props.theme.colors.neutral200};
166
- border-radius: 12px;
167
- padding: 20px;
168
- margin-bottom: 32px;
169
- `;
170
- const UsageBar = styled__default.default.div`
171
- height: 8px;
172
- background: ${(props) => props.theme.colors.neutral200};
173
- border-radius: 4px;
174
- overflow: hidden;
175
- margin-top: 8px;
176
- `;
177
- const UsageProgress = styled__default.default.div`
178
- height: 100%;
179
- background: ${(props) => props.$percentage > 80 ? "#ef4444" : props.$percentage > 50 ? "#f59e0b" : "#10b981"};
180
- width: ${(props) => Math.min(props.$percentage, 100)}%;
181
- transition: width 0.3s ease;
182
- `;
183
- const LicensePage = () => {
184
- const { formatMessage } = reactIntl.useIntl();
185
- const t = (id, defaultMessage, values) => formatMessage({ id: getTranslation.getTranslation(id), defaultMessage }, values);
186
- const { get } = admin.useFetchClient();
187
- const { toggleNotification } = admin.useNotification();
188
- const [currentTier, setCurrentTier] = s.useState("free");
189
- const [limits, setLimits] = s.useState(null);
190
- const [loading, setLoading] = s.useState(true);
191
- s.useEffect(() => {
192
- fetchLicenseInfo();
193
- }, []);
194
- const fetchLicenseInfo = async () => {
195
- try {
196
- const response = await get("/magic-editor-x/license/limits");
197
- const licenseData = response.data || {};
198
- setCurrentTier(licenseData.tier || "free");
199
- setLimits(licenseData.limits);
200
- setLoading(false);
201
- } catch (error) {
202
- console.error("Failed to fetch license info:", error);
203
- setLoading(false);
204
- }
205
- };
206
- const getTierRank = (tierId) => {
207
- const ranks = {
208
- "free": 0,
209
- "premium": 1,
210
- "advanced": 2,
211
- "enterprise": 3
212
- };
213
- return ranks[tierId] || 0;
214
- };
215
- const getButtonText = (tierId) => {
216
- const currentRank = getTierRank(currentTier);
217
- const targetRank = getTierRank(tierId);
218
- if (currentRank === targetRank) {
219
- return t("upgradePage.currentPlan", "Current Plan");
220
- } else if (targetRank > currentRank) {
221
- return t("upgradePage.upgradeNow", "Upgrade Now");
222
- } else {
223
- return t("upgradePage.downgrade", "Downgrade");
224
- }
225
- };
226
- const tiers = [
227
- {
228
- id: "free",
229
- name: "FREE",
230
- price: "$0",
231
- period: "forever",
232
- description: "Perfect for small projects and testing",
233
- icon: /* @__PURE__ */ jsxRuntime.jsx(index.Vn, {}),
234
- color: "linear-gradient(135deg, #6B7280, #4B5563)",
235
- features: [
236
- { name: "Full Editor Access", included: true },
237
- { name: "All Editor Tools", included: true },
238
- { name: "2 Collaborators", included: true },
239
- { name: "3 Custom Blocks (Simple)", included: true },
240
- { name: "Real-time Sync", included: true },
241
- { name: "Embedded Entry Blocks", included: false },
242
- { name: "Block Export/Import", included: false },
243
- { name: "AI Style + Rewrite", included: false },
244
- { name: "Version History", included: false },
245
- { name: "Priority Support", included: false }
246
- ],
247
- limits: {
248
- collaborators: "2",
249
- customBlocks: "3 Simple"
250
- }
251
- },
252
- {
253
- id: "premium",
254
- name: "PREMIUM",
255
- price: "$9.90",
256
- period: "/month",
257
- description: "Enhanced collaboration for teams",
258
- icon: /* @__PURE__ */ jsxRuntime.jsx(index.F3, {}),
259
- color: "linear-gradient(135deg, #8B5CF6, #7C3AED)",
260
- featured: true,
261
- features: [
262
- { name: "Full Editor Access", included: true },
263
- { name: "All Editor Tools", included: true },
264
- { name: "10 Collaborators", included: true },
265
- { name: "10 Custom Blocks", included: true },
266
- { name: "Embedded Entry Blocks", included: true },
267
- { name: "Real-time Sync", included: true },
268
- { name: "AI Grammar + Style (10/day)", included: true },
269
- { name: "Block Export/Import", included: false },
270
- { name: "Version History", included: true },
271
- { name: "Priority Support", included: true }
272
- ],
273
- limits: {
274
- collaborators: "10",
275
- customBlocks: "10 Total"
276
- }
277
- },
278
- {
279
- id: "advanced",
280
- name: "ADVANCED",
281
- price: "$24.90",
282
- period: "/month",
283
- description: "Unlimited collaboration for enterprises",
284
- icon: /* @__PURE__ */ jsxRuntime.jsx(index.mn, {}),
285
- color: "linear-gradient(135deg, #7C3AED, #6d28d9)",
286
- features: [
287
- { name: "Full Editor Access", included: true },
288
- { name: "All Editor Tools", included: true },
289
- { name: "Unlimited Collaborators", included: true },
290
- { name: "Unlimited Custom Blocks", included: true },
291
- { name: "Embedded Entry Blocks", included: true },
292
- { name: "Block Export/Import + API", included: true },
293
- { name: "Real-time Sync", included: true },
294
- { name: "AI All Types (Unlimited)", included: true },
295
- { name: "Version History", included: true },
296
- { name: "Priority Support", included: true }
297
- ],
298
- limits: {
299
- collaborators: "Unlimited",
300
- customBlocks: "Unlimited"
301
- }
302
- }
303
- ];
304
- const handleUpgrade = (tierId) => {
305
- window.open("https://store.magicdx.dev/", "_blank");
306
- };
307
- if (loading) {
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...") }) }) });
309
- }
310
- const collaboratorUsage = limits?.collaborators ? {
311
- current: limits.collaborators.current || 0,
312
- max: limits.collaborators.max,
313
- unlimited: limits.collaborators.unlimited,
314
- percentage: limits.collaborators.unlimited ? 0 : limits.collaborators.current / limits.collaborators.max * 100
315
- } : { current: 0, max: 2, unlimited: false, percentage: 0 };
316
- return /* @__PURE__ */ jsxRuntime.jsxs(Container, { children: [
317
- /* @__PURE__ */ jsxRuntime.jsxs(Header, { children: [
318
- /* @__PURE__ */ jsxRuntime.jsx(Title, { variant: "alpha", children: t("upgradePage.title", "Magic Editor X") }),
319
- /* @__PURE__ */ jsxRuntime.jsx(Subtitle, { variant: "omega", children: t("upgradePage.subtitle", "Choose your plan for collaborative editing") })
320
- ] }),
321
- /* @__PURE__ */ jsxRuntime.jsxs(UsageBox, { children: [
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() })
325
- ] }),
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: [
330
- collaboratorUsage.current,
331
- " / ",
332
- collaboratorUsage.unlimited ? t("license.unlimited", "Unlimited") : collaboratorUsage.max
333
- ] })
334
- ] }),
335
- !collaboratorUsage.unlimited && /* @__PURE__ */ jsxRuntime.jsx(UsageBar, { children: /* @__PURE__ */ jsxRuntime.jsx(UsageProgress, { $percentage: collaboratorUsage.percentage }) })
336
- ] })
337
- ] }),
338
- /* @__PURE__ */ jsxRuntime.jsx(TierGrid, { children: tiers.map((tier) => /* @__PURE__ */ jsxRuntime.jsx(TierWrapper, { children: /* @__PURE__ */ jsxRuntime.jsxs(TierCard, { $featured: tier.featured, children: [
339
- tier.featured && /* @__PURE__ */ jsxRuntime.jsx(PopularBadge, { children: t("upgradePage.mostPopular", "MOST POPULAR") }),
340
- /* @__PURE__ */ jsxRuntime.jsx(TierIcon, { $color: tier.color, children: tier.icon }),
341
- /* @__PURE__ */ jsxRuntime.jsx(TierName, { variant: "beta", children: tier.name }),
342
- /* @__PURE__ */ jsxRuntime.jsxs(getTranslation.C, { alignItems: "baseline", gap: 1, children: [
343
- /* @__PURE__ */ jsxRuntime.jsx(TierPrice, { variant: "alpha", children: tier.price }),
344
- /* @__PURE__ */ jsxRuntime.jsx(getTranslation.A, { variant: "omega", style: { color: "#6B7280" }, children: tier.period })
345
- ] }),
346
- /* @__PURE__ */ jsxRuntime.jsx(TierDescription, { variant: "omega", children: tier.description }),
347
- /* @__PURE__ */ jsxRuntime.jsxs(
348
- getTranslation.S,
349
- {
350
- background: "neutral100",
351
- hasRadius: true,
352
- padding: 3,
353
- marginBottom: 5,
354
- children: [
355
- /* @__PURE__ */ jsxRuntime.jsxs(getTranslation.A, { variant: "pi", style: { fontSize: "13px", display: "block", marginBottom: "4px" }, children: [
356
- /* @__PURE__ */ jsxRuntime.jsx("strong", { children: "Collaborators:" }),
357
- " ",
358
- tier.limits.collaborators
359
- ] }),
360
- /* @__PURE__ */ jsxRuntime.jsxs(getTranslation.A, { variant: "pi", style: { fontSize: "13px", display: "block" }, children: [
361
- /* @__PURE__ */ jsxRuntime.jsx("strong", { children: "Custom Blocks:" }),
362
- " ",
363
- tier.limits.customBlocks
364
- ] })
365
- ]
366
- }
367
- ),
368
- /* @__PURE__ */ jsxRuntime.jsx(FeatureList, { children: tier.features.map((feature, index$1) => /* @__PURE__ */ jsxRuntime.jsxs(Feature, { children: [
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 } }) }),
370
- /* @__PURE__ */ jsxRuntime.jsx(
371
- getTranslation.A,
372
- {
373
- variant: "omega",
374
- textColor: feature.included ? "neutral800" : "neutral500",
375
- style: {
376
- fontSize: "14px",
377
- textDecoration: feature.included ? "none" : "line-through"
378
- },
379
- children: feature.name
380
- }
381
- )
382
- ] }, index$1)) }),
383
- currentTier === tier.id ? /* @__PURE__ */ jsxRuntime.jsx(CurrentPlanBadge, { children: t("upgradePage.currentPlan", "Current Plan") }) : /* @__PURE__ */ jsxRuntime.jsx(
384
- UpgradeButton,
385
- {
386
- $gradient: tier.color,
387
- onClick: () => handleUpgrade(tier.id),
388
- children: getButtonText(tier.id)
389
- }
390
- )
391
- ] }) }, tier.id)) })
392
- ] });
393
- };
394
- exports.default = LicensePage;
@@ -1,223 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const jsxRuntime = require("react/jsx-runtime");
4
- const s = require("react");
5
- const reactIntl = require("react-intl");
6
- const getTranslation = require("./getTranslation-DQ_WJ-7M.js");
7
- const styled = require("styled-components");
8
- const _interopDefault = (e) => e && e.__esModule ? e : { default: e };
9
- const styled__default = /* @__PURE__ */ _interopDefault(styled);
10
- const pulse = styled.keyframes`
11
- 0%, 100% {
12
- box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.2);
13
- transform: scale(1);
14
- }
15
- 50% {
16
- box-shadow: 0 0 0 6px rgba(34, 197, 94, 0.1);
17
- transform: scale(1.1);
18
- }
19
- `;
20
- const StatusCard = styled__default.default.div`
21
- background: ${(props) => props.theme.colors.neutral0};
22
- border: 1px solid ${({ $status, theme }) => $status === "connected" ? "rgba(34, 197, 94, 0.3)" : $status === "denied" ? "rgba(239, 68, 68, 0.3)" : theme.colors.neutral200};
23
- border-radius: 10px;
24
- padding: 14px 16px;
25
- display: flex;
26
- align-items: center;
27
- gap: 12px;
28
- `;
29
- const StatusDot = styled__default.default.div`
30
- width: 12px;
31
- height: 12px;
32
- border-radius: 50%;
33
- flex-shrink: 0;
34
- background: ${({ $status }) => $status === "connected" ? "#22c55e" : $status === "connecting" || $status === "requesting" ? "#f59e0b" : $status === "denied" ? "#ef4444" : "#94a3b8"};
35
-
36
- ${({ $status }) => $status === "connected" && styled.css`
37
- animation: ${pulse} 2s ease-in-out infinite;
38
- `}
39
- `;
40
- const StatusText = styled__default.default.div`
41
- display: flex;
42
- flex-direction: column;
43
- gap: 2px;
44
- `;
45
- const StatusLabel = styled__default.default.span`
46
- font-size: 14px;
47
- font-weight: 600;
48
- color: ${({ $status, theme }) => $status === "connected" ? theme.colors.success600 : $status === "connecting" || $status === "requesting" ? theme.colors.warning600 : $status === "denied" ? theme.colors.danger600 : theme.colors.neutral600};
49
- `;
50
- const StatusSubtext = styled__default.default.span`
51
- font-size: 12px;
52
- color: ${(props) => props.theme.colors.neutral500};
53
- `;
54
- const SectionTitle = styled__default.default.div`
55
- font-size: 11px;
56
- font-weight: 600;
57
- color: ${(props) => props.theme.colors.neutral600};
58
- text-transform: uppercase;
59
- letter-spacing: 0.5px;
60
- margin-bottom: 10px;
61
- `;
62
- const PeerItem = styled__default.default.div`
63
- display: flex;
64
- align-items: center;
65
- gap: 12px;
66
- padding: 12px 14px;
67
- background: ${(props) => props.theme.colors.neutral0};
68
- border-radius: 10px;
69
- border: 1px solid ${(props) => props.theme.colors.neutral150};
70
- transition: all 0.2s ease;
71
-
72
- &:hover {
73
- border-color: ${(props) => props.theme.colors.primary200};
74
- box-shadow: 0 2px 8px rgba(124, 58, 237, 0.08);
75
- transform: translateY(-1px);
76
- }
77
- `;
78
- const PEER_COLORS = [
79
- "linear-gradient(135deg, #7C3AED 0%, #a855f7 100%)",
80
- "linear-gradient(135deg, #3b82f6 0%, #60a5fa 100%)",
81
- "linear-gradient(135deg, #10b981 0%, #34d399 100%)",
82
- "linear-gradient(135deg, #f59e0b 0%, #fbbf24 100%)",
83
- "linear-gradient(135deg, #ef4444 0%, #f87171 100%)",
84
- "linear-gradient(135deg, #ec4899 0%, #f472b6 100%)"
85
- ];
86
- const PeerAvatar = styled__default.default.div`
87
- width: 36px;
88
- height: 36px;
89
- border-radius: 50%;
90
- background: ${({ $color }) => $color || PEER_COLORS[0]};
91
- color: white;
92
- font-size: 12px;
93
- font-weight: 700;
94
- display: flex;
95
- align-items: center;
96
- justify-content: center;
97
- flex-shrink: 0;
98
- box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
99
- `;
100
- const PeerInfo = styled__default.default.div`
101
- flex: 1;
102
- min-width: 0;
103
- display: flex;
104
- flex-direction: column;
105
- gap: 2px;
106
- `;
107
- const PeerName = styled__default.default.span`
108
- font-size: 13px;
109
- font-weight: 600;
110
- color: ${(props) => props.theme.colors.neutral800};
111
- white-space: nowrap;
112
- overflow: hidden;
113
- text-overflow: ellipsis;
114
- `;
115
- const PeerEmail = styled__default.default.span`
116
- font-size: 11px;
117
- color: ${(props) => props.theme.colors.neutral500};
118
- white-space: nowrap;
119
- overflow: hidden;
120
- text-overflow: ellipsis;
121
- `;
122
- const OnlineBadge = styled__default.default.span`
123
- font-size: 10px;
124
- font-weight: 600;
125
- color: #166534;
126
- background: #dcfce7;
127
- padding: 4px 8px;
128
- border-radius: 12px;
129
- flex-shrink: 0;
130
- `;
131
- const EmptyState = styled__default.default.div`
132
- text-align: center;
133
- padding: 16px;
134
- background: ${(props) => props.theme.colors.neutral100};
135
- border-radius: 10px;
136
- border: 1px dashed ${(props) => props.theme.colors.neutral300};
137
- `;
138
- const EmptyText = styled__default.default.span`
139
- font-size: 13px;
140
- color: ${(props) => props.theme.colors.neutral500};
141
- `;
142
- const getPeerInitials = (user = {}) => {
143
- const first = (user.firstname?.[0] || user.email?.[0] || "?").toUpperCase();
144
- const last = (user.lastname?.[0] || "").toUpperCase();
145
- return `${first}${last}`.trim();
146
- };
147
- const getPeerName = (user = {}, t) => {
148
- if (user.firstname) {
149
- return `${user.firstname} ${user.lastname || ""}`.trim();
150
- }
151
- return user.email || t("collab.unknown", "Unknown");
152
- };
153
- const LiveCollaborationPanel = ({ documentId, model, document }) => {
154
- const { formatMessage } = reactIntl.useIntl();
155
- const t = (id, defaultMessage, values) => formatMessage({ id: getTranslation.getTranslation(id), defaultMessage }, values);
156
- const [collabState, setCollabState] = s.useState({
157
- status: "disabled",
158
- peers: [],
159
- error: null
160
- });
161
- s.useEffect(() => {
162
- const handleCollabUpdate = (event) => {
163
- if (event.detail) {
164
- setCollabState(event.detail);
165
- }
166
- };
167
- window.addEventListener("magic-editor-collab-update", handleCollabUpdate);
168
- if (window.__MAGIC_EDITOR_COLLAB_STATE__) {
169
- setCollabState(window.__MAGIC_EDITOR_COLLAB_STATE__);
170
- }
171
- return () => {
172
- window.removeEventListener("magic-editor-collab-update", handleCollabUpdate);
173
- };
174
- }, []);
175
- const { status, peers, error } = collabState;
176
- const statusLabel = s.useMemo(() => {
177
- switch (status) {
178
- case "connected":
179
- return t("collab.live", "Live");
180
- case "connecting":
181
- return t("collab.connecting", "Connecting...");
182
- case "requesting":
183
- return t("collab.checkingPermission", "Checking permission");
184
- case "denied":
185
- return t("collab.noPermission", "No permission");
186
- case "disconnected":
187
- return t("collab.disconnected", "Disconnected");
188
- case "disabled":
189
- return t("collab.disabled", "Disabled");
190
- default:
191
- return t("collab.ready", "Ready");
192
- }
193
- }, [status, t]);
194
- if (status === "disabled" || status === "idle") {
195
- return null;
196
- }
197
- const isConnected = status === "connected";
198
- return {
199
- title: t("collab.title", "Live Collaboration"),
200
- content: /* @__PURE__ */ jsxRuntime.jsxs(getTranslation.C, { direction: "column", gap: 4, alignItems: "stretch", style: { width: "100%" }, children: [
201
- /* @__PURE__ */ jsxRuntime.jsxs(StatusCard, { $status: status, children: [
202
- /* @__PURE__ */ jsxRuntime.jsx(StatusDot, { $status: status }),
203
- /* @__PURE__ */ jsxRuntime.jsxs(StatusText, { children: [
204
- /* @__PURE__ */ jsxRuntime.jsx(StatusLabel, { $status: status, children: statusLabel }),
205
- /* @__PURE__ */ jsxRuntime.jsx(StatusSubtext, { children: isConnected ? t("collab.realtimeActive", "Realtime sync active") : error || t("collab.connectionEstablishing", "Connection is being established...") })
206
- ] })
207
- ] }),
208
- isConnected && peers.length > 0 && /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
209
- /* @__PURE__ */ jsxRuntime.jsx(SectionTitle, { children: t("collab.activePeers", "Active Collaborators ({count})", { count: peers.length }) }),
210
- /* @__PURE__ */ jsxRuntime.jsx(getTranslation.C, { direction: "column", gap: 2, alignItems: "stretch", children: peers.map((peer, idx) => /* @__PURE__ */ jsxRuntime.jsxs(PeerItem, { children: [
211
- /* @__PURE__ */ jsxRuntime.jsx(PeerAvatar, { $color: PEER_COLORS[idx % PEER_COLORS.length], children: getPeerInitials(peer) }),
212
- /* @__PURE__ */ jsxRuntime.jsxs(PeerInfo, { children: [
213
- /* @__PURE__ */ jsxRuntime.jsx(PeerName, { children: getPeerName(peer, t) }),
214
- peer.email && peer.firstname && /* @__PURE__ */ jsxRuntime.jsx(PeerEmail, { children: peer.email })
215
- ] }),
216
- /* @__PURE__ */ jsxRuntime.jsx(OnlineBadge, { children: t("collab.online", "Online") })
217
- ] }, peer.id)) })
218
- ] }),
219
- isConnected && peers.length === 0 && /* @__PURE__ */ jsxRuntime.jsx(EmptyState, { children: /* @__PURE__ */ jsxRuntime.jsx(EmptyText, { children: t("collab.workingAlone", "You are working alone") }) })
220
- ] })
221
- };
222
- };
223
- exports.default = LiveCollaborationPanel;