magic-editor-x 1.5.1 → 2.0.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 +268 -0
  2. package/LICENSE +1 -7
  3. package/README.md +317 -1078
  4. package/dist/admin/ConfigurationPage-B1uCIE3J.js +767 -0
  5. package/dist/admin/ConfigurationPage-DvAifELO.mjs +767 -0
  6. package/dist/admin/CustomBlocksPage-6-OQwpXQ.mjs +1741 -0
  7. package/dist/admin/CustomBlocksPage-6eWCOreU.js +1743 -0
  8. package/dist/admin/EditorField-DocyD2Q3.js +5506 -0
  9. package/dist/admin/EditorField-ThSoOCPm.mjs +5471 -0
  10. package/dist/admin/api-B-RsxJCs.js +34 -0
  11. package/dist/admin/api-C4XsDZxd.mjs +35 -0
  12. package/dist/admin/de-B8XFFhHh.js +95 -0
  13. package/dist/admin/de-BMxADn2Z.mjs +231 -0
  14. package/dist/admin/de-DBR893G4.js +13 -0
  15. package/dist/admin/de-DcDPRzV4.js +155 -0
  16. package/dist/admin/de-Dx7vUW0Z.js +231 -0
  17. package/dist/admin/de-RAxzvrwm.mjs +95 -0
  18. package/dist/admin/de-fBFh09Wl.mjs +13 -0
  19. package/dist/admin/de-n5V6c5RT.mjs +155 -0
  20. package/dist/admin/en-BQ5Pxe2o.mjs +231 -0
  21. package/dist/admin/en-BqNm3nMQ.mjs +155 -0
  22. package/dist/admin/en-BzfyifEU.mjs +95 -0
  23. package/dist/admin/en-D-DGftl0.js +155 -0
  24. package/dist/admin/en-D9Nfccux.mjs +13 -0
  25. package/dist/admin/en-DcWUTE2J.js +95 -0
  26. package/dist/admin/en-gueRT44P.js +13 -0
  27. package/dist/admin/en-sNn4z9lA.js +231 -0
  28. package/dist/admin/es-B0Zy8DVg.mjs +13 -0
  29. package/dist/admin/es-B6NYq0VH.mjs +231 -0
  30. package/dist/admin/es-BOtVc9qv.js +95 -0
  31. package/dist/admin/es-C2OJVYkV.mjs +95 -0
  32. package/dist/admin/es-DRGs7meF.js +13 -0
  33. package/dist/admin/es-DVsXnS0N.js +231 -0
  34. package/dist/admin/es-Di0pyQCh.js +155 -0
  35. package/dist/admin/es-SzeTV4q8.mjs +155 -0
  36. package/dist/admin/fr-B8rdLAIL.js +13 -0
  37. package/dist/admin/fr-Bpo5Uq1f.mjs +95 -0
  38. package/dist/admin/fr-D6F--jIB.js +155 -0
  39. package/dist/admin/fr-DfxKaOc_.js +95 -0
  40. package/dist/admin/fr-DhgPYHIH.mjs +155 -0
  41. package/dist/admin/fr-DmG3_Cn-.mjs +231 -0
  42. package/dist/admin/fr-Fwxcj4SM.js +231 -0
  43. package/dist/admin/fr-oiUb2bb_.mjs +13 -0
  44. package/dist/admin/index-CwfaB5-e.js +155 -0
  45. package/dist/admin/index-D1Q5Rlt6.mjs +156 -0
  46. package/dist/admin/index.js +3 -2
  47. package/dist/admin/index.mjs +1 -1
  48. package/dist/admin/pt-B3Jce6uT.mjs +13 -0
  49. package/dist/admin/pt-BPo0ex21.js +155 -0
  50. package/dist/admin/pt-BbdwHlWF.mjs +231 -0
  51. package/dist/admin/pt-BiWuSBcH.js +13 -0
  52. package/dist/admin/pt-BvSl1btT.mjs +155 -0
  53. package/dist/admin/pt-C6nr71Yw.js +231 -0
  54. package/dist/admin/pt-DqCXuI4S.mjs +95 -0
  55. package/dist/admin/pt-LCvjwk0y.js +95 -0
  56. package/dist/admin/sanitize-9UVcXFfc.js +552 -0
  57. package/dist/admin/sanitize-D4kfZ_ly.mjs +551 -0
  58. package/dist/admin/useT-B5M49wGH.js +130 -0
  59. package/dist/admin/useT-CjX6fL2m.mjs +131 -0
  60. package/dist/server/index.js +4531 -39542
  61. package/dist/server/index.mjs +4534 -39527
  62. package/package.json +111 -74
  63. package/strapi-admin.js +3 -0
  64. package/strapi-server.js +3 -0
  65. package/COPYRIGHT_NOTICE.txt +0 -20
  66. package/dist/_chunks/App-DImBvISP.js +0 -2146
  67. package/dist/_chunks/App-iNfbV7cz.mjs +0 -2143
  68. package/dist/_chunks/CustomBlocksPage-COPOZ2-_.mjs +0 -1517
  69. package/dist/_chunks/CustomBlocksPage-Cj-0TTUs.js +0 -1519
  70. package/dist/_chunks/LicensePage-CmvILX9m.js +0 -393
  71. package/dist/_chunks/LicensePage-gLRoo8WJ.mjs +0 -391
  72. package/dist/_chunks/LiveCollaborationPanel-BFybu8h0.js +0 -222
  73. package/dist/_chunks/LiveCollaborationPanel-CVgl4IyR.mjs +0 -220
  74. package/dist/_chunks/Settings-ButYcfrm.mjs +0 -438
  75. package/dist/_chunks/Settings-BzGqgrxD.js +0 -440
  76. package/dist/_chunks/de-C_0Mj-Zo.mjs +0 -296
  77. package/dist/_chunks/de-DVNVpAt9.js +0 -296
  78. package/dist/_chunks/en-B7AAf1ie.mjs +0 -296
  79. package/dist/_chunks/en-C2hv5GsA.js +0 -296
  80. package/dist/_chunks/es-BzJqcIST.js +0 -274
  81. package/dist/_chunks/es-zdP8sd-f.mjs +0 -274
  82. package/dist/_chunks/fr-CtAgOgH1.mjs +0 -274
  83. package/dist/_chunks/fr-D3GwqAAJ.js +0 -274
  84. package/dist/_chunks/getTranslation-BADoesEn.js +0 -57807
  85. package/dist/_chunks/getTranslation-D3h3Z3gU.mjs +0 -57791
  86. package/dist/_chunks/index-BXBnwuRw.js +0 -2158
  87. package/dist/_chunks/index-BvEdg518.mjs +0 -2159
  88. package/dist/_chunks/index-DDFAuQNT.js +0 -6955
  89. package/dist/_chunks/index-DEi6nwfM.mjs +0 -6933
  90. package/dist/_chunks/pt-BmUw6YMP.mjs +0 -274
  91. package/dist/_chunks/pt-CFo0nTbj.js +0 -274
  92. package/dist/_chunks/tools-BXzd0lx5.mjs +0 -2265
  93. package/dist/_chunks/tools-Q0uwDS9E.js +0 -2296
  94. package/dist/style.css +0 -1103
  95. package/pics/collab-magiceditorX.png +0 -0
  96. package/pics/editorX.png +0 -0
  97. package/pics/liveCollabwidget1.png +0 -0
@@ -1,220 +0,0 @@
1
- import { jsxs, jsx } from "react/jsx-runtime";
2
- import { useState, useEffect, useMemo } from "react";
3
- import { u as useIntl, T, g as getTranslation } from "./getTranslation-D3h3Z3gU.mjs";
4
- import styled, { css, keyframes } from "styled-components";
5
- const pulse = keyframes`
6
- 0%, 100% {
7
- box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.2);
8
- transform: scale(1);
9
- }
10
- 50% {
11
- box-shadow: 0 0 0 6px rgba(34, 197, 94, 0.1);
12
- transform: scale(1.1);
13
- }
14
- `;
15
- const StatusCard = styled.div`
16
- background: ${(props) => props.theme.colors.neutral0};
17
- border: 1px solid ${({ $status, theme }) => $status === "connected" ? "rgba(34, 197, 94, 0.3)" : $status === "denied" ? "rgba(239, 68, 68, 0.3)" : theme.colors.neutral200};
18
- border-radius: 10px;
19
- padding: 14px 16px;
20
- display: flex;
21
- align-items: center;
22
- gap: 12px;
23
- `;
24
- const StatusDot = styled.div`
25
- width: 12px;
26
- height: 12px;
27
- border-radius: 50%;
28
- flex-shrink: 0;
29
- background: ${({ $status }) => $status === "connected" ? "#22c55e" : $status === "connecting" || $status === "requesting" ? "#f59e0b" : $status === "denied" ? "#ef4444" : "#94a3b8"};
30
-
31
- ${({ $status }) => $status === "connected" && css`
32
- animation: ${pulse} 2s ease-in-out infinite;
33
- `}
34
- `;
35
- const StatusText = styled.div`
36
- display: flex;
37
- flex-direction: column;
38
- gap: 2px;
39
- `;
40
- const StatusLabel = styled.span`
41
- font-size: 14px;
42
- font-weight: 600;
43
- color: ${({ $status, theme }) => $status === "connected" ? theme.colors.success600 : $status === "connecting" || $status === "requesting" ? theme.colors.warning600 : $status === "denied" ? theme.colors.danger600 : theme.colors.neutral600};
44
- `;
45
- const StatusSubtext = styled.span`
46
- font-size: 12px;
47
- color: ${(props) => props.theme.colors.neutral500};
48
- `;
49
- const SectionTitle = styled.div`
50
- font-size: 11px;
51
- font-weight: 600;
52
- color: ${(props) => props.theme.colors.neutral600};
53
- text-transform: uppercase;
54
- letter-spacing: 0.5px;
55
- margin-bottom: 10px;
56
- `;
57
- const PeerItem = styled.div`
58
- display: flex;
59
- align-items: center;
60
- gap: 12px;
61
- padding: 12px 14px;
62
- background: ${(props) => props.theme.colors.neutral0};
63
- border-radius: 10px;
64
- border: 1px solid ${(props) => props.theme.colors.neutral150};
65
- transition: all 0.2s ease;
66
-
67
- &:hover {
68
- border-color: ${(props) => props.theme.colors.primary200};
69
- box-shadow: 0 2px 8px rgba(124, 58, 237, 0.08);
70
- transform: translateY(-1px);
71
- }
72
- `;
73
- const PEER_COLORS = [
74
- "linear-gradient(135deg, #7C3AED 0%, #a855f7 100%)",
75
- "linear-gradient(135deg, #3b82f6 0%, #60a5fa 100%)",
76
- "linear-gradient(135deg, #10b981 0%, #34d399 100%)",
77
- "linear-gradient(135deg, #f59e0b 0%, #fbbf24 100%)",
78
- "linear-gradient(135deg, #ef4444 0%, #f87171 100%)",
79
- "linear-gradient(135deg, #ec4899 0%, #f472b6 100%)"
80
- ];
81
- const PeerAvatar = styled.div`
82
- width: 36px;
83
- height: 36px;
84
- border-radius: 50%;
85
- background: ${({ $color }) => $color || PEER_COLORS[0]};
86
- color: white;
87
- font-size: 12px;
88
- font-weight: 700;
89
- display: flex;
90
- align-items: center;
91
- justify-content: center;
92
- flex-shrink: 0;
93
- box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
94
- `;
95
- const PeerInfo = styled.div`
96
- flex: 1;
97
- min-width: 0;
98
- display: flex;
99
- flex-direction: column;
100
- gap: 2px;
101
- `;
102
- const PeerName = styled.span`
103
- font-size: 13px;
104
- font-weight: 600;
105
- color: ${(props) => props.theme.colors.neutral800};
106
- white-space: nowrap;
107
- overflow: hidden;
108
- text-overflow: ellipsis;
109
- `;
110
- const PeerEmail = styled.span`
111
- font-size: 11px;
112
- color: ${(props) => props.theme.colors.neutral500};
113
- white-space: nowrap;
114
- overflow: hidden;
115
- text-overflow: ellipsis;
116
- `;
117
- const OnlineBadge = styled.span`
118
- font-size: 10px;
119
- font-weight: 600;
120
- color: #166534;
121
- background: #dcfce7;
122
- padding: 4px 8px;
123
- border-radius: 12px;
124
- flex-shrink: 0;
125
- `;
126
- const EmptyState = styled.div`
127
- text-align: center;
128
- padding: 16px;
129
- background: ${(props) => props.theme.colors.neutral100};
130
- border-radius: 10px;
131
- border: 1px dashed ${(props) => props.theme.colors.neutral300};
132
- `;
133
- const EmptyText = styled.span`
134
- font-size: 13px;
135
- color: ${(props) => props.theme.colors.neutral500};
136
- `;
137
- const getPeerInitials = (user = {}) => {
138
- const first = (user.firstname?.[0] || user.email?.[0] || "?").toUpperCase();
139
- const last = (user.lastname?.[0] || "").toUpperCase();
140
- return `${first}${last}`.trim();
141
- };
142
- const getPeerName = (user = {}, t) => {
143
- if (user.firstname) {
144
- return `${user.firstname} ${user.lastname || ""}`.trim();
145
- }
146
- return user.email || t("collab.unknown", "Unknown");
147
- };
148
- const LiveCollaborationPanel = ({ documentId, model, document }) => {
149
- const { formatMessage } = useIntl();
150
- const t = (id, defaultMessage, values) => formatMessage({ id: getTranslation(id), defaultMessage }, values);
151
- const [collabState, setCollabState] = useState({
152
- status: "disabled",
153
- peers: [],
154
- error: null
155
- });
156
- useEffect(() => {
157
- const handleCollabUpdate = (event) => {
158
- if (event.detail) {
159
- setCollabState(event.detail);
160
- }
161
- };
162
- window.addEventListener("magic-editor-collab-update", handleCollabUpdate);
163
- if (window.__MAGIC_EDITOR_COLLAB_STATE__) {
164
- setCollabState(window.__MAGIC_EDITOR_COLLAB_STATE__);
165
- }
166
- return () => {
167
- window.removeEventListener("magic-editor-collab-update", handleCollabUpdate);
168
- };
169
- }, []);
170
- const { status, peers, error } = collabState;
171
- const statusLabel = useMemo(() => {
172
- switch (status) {
173
- case "connected":
174
- return t("collab.live", "Live");
175
- case "connecting":
176
- return t("collab.connecting", "Connecting...");
177
- case "requesting":
178
- return t("collab.checkingPermission", "Checking permission");
179
- case "denied":
180
- return t("collab.noPermission", "No permission");
181
- case "disconnected":
182
- return t("collab.disconnected", "Disconnected");
183
- case "disabled":
184
- return t("collab.disabled", "Disabled");
185
- default:
186
- return t("collab.ready", "Ready");
187
- }
188
- }, [status, t]);
189
- if (status === "disabled" || status === "idle") {
190
- return null;
191
- }
192
- const isConnected = status === "connected";
193
- return {
194
- title: t("collab.title", "Live Collaboration"),
195
- content: /* @__PURE__ */ jsxs(T, { direction: "column", gap: 4, alignItems: "stretch", style: { width: "100%" }, children: [
196
- /* @__PURE__ */ jsxs(StatusCard, { $status: status, children: [
197
- /* @__PURE__ */ jsx(StatusDot, { $status: status }),
198
- /* @__PURE__ */ jsxs(StatusText, { children: [
199
- /* @__PURE__ */ jsx(StatusLabel, { $status: status, children: statusLabel }),
200
- /* @__PURE__ */ jsx(StatusSubtext, { children: isConnected ? t("collab.realtimeActive", "Realtime sync active") : error || t("collab.connectionEstablishing", "Connection is being established...") })
201
- ] })
202
- ] }),
203
- isConnected && peers.length > 0 && /* @__PURE__ */ jsxs("div", { children: [
204
- /* @__PURE__ */ jsx(SectionTitle, { children: t("collab.activePeers", "Active Collaborators ({count})", { count: peers.length }) }),
205
- /* @__PURE__ */ jsx(T, { direction: "column", gap: 2, alignItems: "stretch", children: peers.map((peer, idx) => /* @__PURE__ */ jsxs(PeerItem, { children: [
206
- /* @__PURE__ */ jsx(PeerAvatar, { $color: PEER_COLORS[idx % PEER_COLORS.length], children: getPeerInitials(peer) }),
207
- /* @__PURE__ */ jsxs(PeerInfo, { children: [
208
- /* @__PURE__ */ jsx(PeerName, { children: getPeerName(peer, t) }),
209
- peer.email && peer.firstname && /* @__PURE__ */ jsx(PeerEmail, { children: peer.email })
210
- ] }),
211
- /* @__PURE__ */ jsx(OnlineBadge, { children: t("collab.online", "Online") })
212
- ] }, peer.id)) })
213
- ] }),
214
- isConnected && peers.length === 0 && /* @__PURE__ */ jsx(EmptyState, { children: /* @__PURE__ */ jsx(EmptyText, { children: t("collab.workingAlone", "You are working alone") }) })
215
- ] })
216
- };
217
- };
218
- export {
219
- LiveCollaborationPanel as default
220
- };
@@ -1,438 +0,0 @@
1
- import { jsx, jsxs, Fragment } from "react/jsx-runtime";
2
- import { useState, useEffect } from "react";
3
- import { u as useIntl, V as Vd, R, C as Cm, T, I, z as zn, P as Ps, S as Sm, g as getTranslation } from "./getTranslation-D3h3Z3gU.mjs";
4
- import { useFetchClient, useNotification } from "@strapi/strapi/admin";
5
- import { ArrowPathIcon, DocumentDuplicateIcon, ArrowDownTrayIcon, UserIcon, UsersIcon, ShieldCheckIcon, SparklesIcon, ChartBarIcon } from "@heroicons/react/24/outline";
6
- import styled, { css, keyframes } from "styled-components";
7
- const theme = {
8
- borderRadius: { lg: "12px" }
9
- };
10
- const fadeIn = keyframes`
11
- from { opacity: 0; transform: translateY(10px); }
12
- to { opacity: 1; transform: translateY(0); }
13
- `;
14
- const shimmer = keyframes`
15
- 0% { background-position: -200% 0; }
16
- 100% { background-position: 200% 0; }
17
- `;
18
- const Container = styled(R)`
19
- ${css`animation: ${fadeIn} 0.5s;`}
20
- max-width: 1400px;
21
- margin: 0 auto;
22
- `;
23
- const StickySaveBar = styled(R)`
24
- position: sticky;
25
- top: 0;
26
- z-index: 10;
27
- background: ${(props) => props.theme.colors.neutral0};
28
- border-bottom: 1px solid ${(props) => props.theme.colors.neutral200};
29
- box-shadow: 0 1px 3px rgba(0,0,0,0.1);
30
- `;
31
- const LicenseKeyBanner = styled(R)`
32
- background: linear-gradient(135deg, #7C3AED 0%, #6d28d9 100%);
33
- border-radius: ${theme.borderRadius.lg};
34
- padding: 28px 32px;
35
- color: white;
36
- position: relative;
37
- overflow: hidden;
38
- box-shadow: 0 4px 20px rgba(124, 58, 237, 0.25);
39
- margin-bottom: 24px;
40
-
41
- &::after {
42
- content: '';
43
- position: absolute;
44
- top: -50%;
45
- right: -50%;
46
- width: 200%;
47
- height: 200%;
48
- background: linear-gradient(
49
- 45deg,
50
- transparent,
51
- rgba(255, 255, 255, 0.08),
52
- transparent
53
- );
54
- ${css`animation: ${shimmer} 3s infinite;`}
55
- pointer-events: none;
56
- z-index: 0;
57
- }
58
-
59
- & > * {
60
- position: relative;
61
- z-index: 1;
62
- }
63
- `;
64
- const LoaderContainer = styled(T)`
65
- min-height: 400px;
66
- align-items: center;
67
- justify-content: center;
68
- flex-direction: column;
69
- gap: 16px;
70
- `;
71
- const Settings = () => {
72
- const { formatMessage } = useIntl();
73
- const t = (id, defaultMessage, values) => formatMessage({ id: getTranslation(id), defaultMessage }, values);
74
- const { get } = useFetchClient();
75
- const { toggleNotification } = useNotification();
76
- const [loading, setLoading] = useState(true);
77
- const [licenseData, setLicenseData] = useState(null);
78
- const [limits, setLimits] = useState(null);
79
- const [error, setError] = useState(null);
80
- const fetchLicenseStatus = async () => {
81
- setLoading(true);
82
- setError(null);
83
- try {
84
- const [statusRes, limitsRes] = await Promise.all([
85
- get("/magic-editor-x/license/status"),
86
- get("/magic-editor-x/license/limits")
87
- ]);
88
- setLicenseData(statusRes.data);
89
- setLimits(limitsRes.data);
90
- } catch (err) {
91
- console.error("[Magic Editor X] Error fetching license:", err);
92
- setError("Failed to load license information");
93
- } finally {
94
- setLoading(false);
95
- }
96
- };
97
- const handleCopyLicenseKey = async () => {
98
- try {
99
- await navigator.clipboard.writeText(licenseData?.data?.licenseKey || "");
100
- toggleNotification({
101
- type: "success",
102
- message: t("license.copied", "License key copied to clipboard!")
103
- });
104
- } catch (err) {
105
- toggleNotification({
106
- type: "danger",
107
- message: t("license.copyFailed", "Failed to copy license key")
108
- });
109
- }
110
- };
111
- const handleDownloadLicenseKey = () => {
112
- try {
113
- const data2 = licenseData?.data || {};
114
- const licenseKey = data2.licenseKey || "";
115
- const email = data2.email || "N/A";
116
- const firstName = data2.firstName || "";
117
- const lastName = data2.lastName || "";
118
- const fullName = `${firstName} ${lastName}`.trim() || "N/A";
119
- const tier2 = licenseData?.tier || "free";
120
- const content = `Magic Editor X - License Key
121
- ===================================
122
-
123
- License Key: ${licenseKey}
124
-
125
- License Holder Information:
126
- ----------------------------------
127
- Name: ${fullName}
128
- Email: ${email}
129
-
130
- License Status:
131
- ----------------------------------
132
- Status: ${data2.isActive ? "ACTIVE" : "INACTIVE"}
133
- Tier: ${tier2.toUpperCase()}
134
- Expires: ${data2.expiresAt ? new Date(data2.expiresAt).toLocaleDateString() : "Never"}
135
-
136
- Features:
137
- ----------------------------------
138
- Premium: ${data2.features?.premium ? "Enabled" : "Disabled"}
139
- Advanced: ${data2.features?.advanced ? "Enabled" : "Disabled"}
140
- Enterprise: ${data2.features?.enterprise ? "Enabled" : "Disabled"}
141
-
142
- ===================================
143
- Generated: ${(/* @__PURE__ */ new Date()).toLocaleString()}
144
- `;
145
- const blob = new Blob([content], { type: "text/plain" });
146
- const url = window.URL.createObjectURL(blob);
147
- const link = document.createElement("a");
148
- link.href = url;
149
- link.download = `magic-editor-x-license-${licenseKey.substring(0, 8)}.txt`;
150
- document.body.appendChild(link);
151
- link.click();
152
- document.body.removeChild(link);
153
- window.URL.revokeObjectURL(url);
154
- toggleNotification({
155
- type: "success",
156
- message: t("license.downloaded", "License key downloaded successfully!")
157
- });
158
- } catch (err) {
159
- toggleNotification({
160
- type: "danger",
161
- message: t("license.downloadFailed", "Failed to download license key")
162
- });
163
- }
164
- };
165
- useEffect(() => {
166
- fetchLicenseStatus();
167
- }, []);
168
- if (loading) {
169
- return /* @__PURE__ */ jsx(Container, { children: /* @__PURE__ */ jsx(LoaderContainer, { children: /* @__PURE__ */ jsx(Vd, { children: t("license.loading", "Loading license information...") }) }) });
170
- }
171
- if (error) {
172
- return /* @__PURE__ */ jsx(Container, { children: /* @__PURE__ */ jsx(R, { padding: 8, children: /* @__PURE__ */ jsx(Cm, { variant: "danger", title: "Error", closeLabel: "Close", children: error }) }) });
173
- }
174
- const isValid = licenseData?.valid;
175
- const isDemo = licenseData?.demo;
176
- const tier = licenseData?.tier || "free";
177
- const data = licenseData?.data || {};
178
- const collaborators = limits?.limits?.collaborators || { current: 0, max: 2, unlimited: false };
179
- return /* @__PURE__ */ jsxs(Container, { children: [
180
- /* @__PURE__ */ jsx(StickySaveBar, { paddingTop: 5, paddingBottom: 5, paddingLeft: 6, paddingRight: 6, children: /* @__PURE__ */ jsxs(T, { justifyContent: "space-between", alignItems: "flex-start", children: [
181
- /* @__PURE__ */ jsxs(T, { direction: "column", gap: 1, alignItems: "flex-start", children: [
182
- /* @__PURE__ */ jsx(I, { variant: "alpha", fontWeight: "bold", children: t("license.title", "License Management") }),
183
- /* @__PURE__ */ jsx(I, { variant: "epsilon", textColor: "neutral600", children: t("license.subtitle", "View your Magic Editor X plugin license") })
184
- ] }),
185
- /* @__PURE__ */ jsx(
186
- zn,
187
- {
188
- startIcon: /* @__PURE__ */ jsx(ArrowPathIcon, { style: { width: 20, height: 20 } }),
189
- onClick: fetchLicenseStatus,
190
- size: "L",
191
- style: {
192
- background: "linear-gradient(135deg, #7C3AED 0%, #6d28d9 100%)",
193
- color: "white",
194
- fontWeight: "600",
195
- border: "none"
196
- },
197
- children: t("license.refresh", "Refresh Status")
198
- }
199
- )
200
- ] }) }),
201
- /* @__PURE__ */ jsxs(R, { paddingTop: 6, paddingLeft: 6, paddingRight: 6, paddingBottom: 10, children: [
202
- isDemo ? /* @__PURE__ */ jsx(Cm, { variant: "warning", title: t("license.alert.free", "FREE Mode"), closeLabel: "Close", children: t("license.alert.free.message", "You're using the FREE version with 2 collaborators. Upgrade for more features.") }) : isValid ? /* @__PURE__ */ jsx(Cm, { variant: "success", title: t("license.alert.active", "License Active"), closeLabel: "Close", children: t("license.alert.active.message", "Your license is active and all features are unlocked.") }) : /* @__PURE__ */ jsx(Cm, { variant: "danger", title: t("license.alert.issue", "License Issue"), closeLabel: "Close", children: t("license.alert.issue.message", "There's an issue with your license. Please check your license status.") }),
203
- data.licenseKey && /* @__PURE__ */ jsx(R, { marginTop: 6, children: /* @__PURE__ */ jsx(LicenseKeyBanner, { children: /* @__PURE__ */ jsxs(T, { justifyContent: "space-between", alignItems: "flex-start", children: [
204
- /* @__PURE__ */ jsxs(R, { style: { flex: 1 }, children: [
205
- /* @__PURE__ */ jsx(I, { variant: "pi", style: { color: "rgba(255,255,255,0.8)", marginBottom: "12px", textTransform: "uppercase", fontSize: "11px", letterSpacing: "0.5px", display: "block" }, children: t("license.key", "License Key") }),
206
- /* @__PURE__ */ jsx(I, { style: { color: "white", fontFamily: "monospace", fontSize: "28px", fontWeight: "bold", wordBreak: "break-all", marginBottom: "16px" }, children: data.licenseKey }),
207
- /* @__PURE__ */ jsxs(T, { gap: 2, children: [
208
- /* @__PURE__ */ jsx(
209
- zn,
210
- {
211
- onClick: handleCopyLicenseKey,
212
- startIcon: /* @__PURE__ */ jsx(DocumentDuplicateIcon, { style: { width: 16, height: 16 } }),
213
- size: "S",
214
- variant: "secondary",
215
- style: {
216
- backgroundColor: "rgba(255,255,255,0.2)",
217
- color: "white",
218
- border: "1px solid rgba(255,255,255,0.3)",
219
- fontWeight: "600"
220
- },
221
- children: t("license.copyKey", "Copy Key")
222
- }
223
- ),
224
- /* @__PURE__ */ jsx(
225
- zn,
226
- {
227
- onClick: handleDownloadLicenseKey,
228
- startIcon: /* @__PURE__ */ jsx(ArrowDownTrayIcon, { style: { width: 16, height: 16 } }),
229
- size: "S",
230
- variant: "secondary",
231
- style: {
232
- backgroundColor: "rgba(255,255,255,0.2)",
233
- color: "white",
234
- border: "1px solid rgba(255,255,255,0.3)",
235
- fontWeight: "600"
236
- },
237
- children: t("license.downloadTxt", "Download as TXT")
238
- }
239
- )
240
- ] })
241
- ] }),
242
- /* @__PURE__ */ jsxs(T, { direction: "column", gap: 2, alignItems: "flex-end", children: [
243
- /* @__PURE__ */ jsx(
244
- Ps,
245
- {
246
- backgroundColor: data.isActive ? "success100" : "danger100",
247
- textColor: data.isActive ? "success700" : "danger700",
248
- style: { fontSize: "11px", fontWeight: "700", padding: "6px 12px" },
249
- children: data.isActive ? "ACTIVE" : "INACTIVE"
250
- }
251
- ),
252
- /* @__PURE__ */ jsx(
253
- Ps,
254
- {
255
- style: {
256
- fontSize: "11px",
257
- fontWeight: "700",
258
- padding: "6px 12px",
259
- background: tier === "free" ? "#6B7280" : "#7C3AED",
260
- color: "white"
261
- },
262
- children: tier.toUpperCase()
263
- }
264
- )
265
- ] })
266
- ] }) }) }),
267
- /* @__PURE__ */ jsx(R, { marginTop: 6, children: /* @__PURE__ */ jsxs(Sm.Root, { defaultValue: "account", collapsible: true, children: [
268
- /* @__PURE__ */ jsxs(Sm.Item, { value: "account", children: [
269
- /* @__PURE__ */ jsx(Sm.Header, { children: /* @__PURE__ */ jsx(Sm.Trigger, { icon: () => /* @__PURE__ */ jsx(UserIcon, { style: { width: 16, height: 16 } }), children: t("license.section.account", "Account Information") }) }),
270
- /* @__PURE__ */ jsx(Sm.Content, { children: /* @__PURE__ */ jsx(R, { padding: 6, children: /* @__PURE__ */ jsxs(T, { gap: 8, wrap: "wrap", children: [
271
- /* @__PURE__ */ jsxs(R, { style: { flex: "1", minWidth: "200px" }, children: [
272
- /* @__PURE__ */ jsx(I, { variant: "sigma", textColor: "neutral600", textTransform: "uppercase", style: { marginBottom: "8px", display: "block" }, children: t("license.email", "Email Address") }),
273
- /* @__PURE__ */ jsx(I, { variant: "omega", fontWeight: "semiBold", children: data.email || t("license.notProvided", "Not provided") })
274
- ] }),
275
- /* @__PURE__ */ jsxs(R, { style: { flex: "1", minWidth: "200px" }, children: [
276
- /* @__PURE__ */ jsx(I, { variant: "sigma", textColor: "neutral600", textTransform: "uppercase", style: { marginBottom: "8px", display: "block" }, children: t("license.holder", "License Holder") }),
277
- /* @__PURE__ */ jsx(I, { variant: "omega", fontWeight: "semiBold", children: data.firstName && data.lastName ? `${data.firstName} ${data.lastName}` : t("license.notSpecified", "Not specified") })
278
- ] })
279
- ] }) }) })
280
- ] }),
281
- /* @__PURE__ */ jsxs(Sm.Item, { value: "collaborators", children: [
282
- /* @__PURE__ */ jsx(Sm.Header, { children: /* @__PURE__ */ jsx(Sm.Trigger, { icon: () => /* @__PURE__ */ jsx(UsersIcon, { style: { width: 16, height: 16 } }), children: t("license.section.collaborators", "Collaborator Limits") }) }),
283
- /* @__PURE__ */ jsx(Sm.Content, { children: /* @__PURE__ */ jsxs(R, { padding: 6, children: [
284
- /* @__PURE__ */ jsxs(T, { gap: 8, wrap: "wrap", alignItems: "center", children: [
285
- /* @__PURE__ */ jsxs(R, { style: { flex: "1", minWidth: "200px" }, children: [
286
- /* @__PURE__ */ jsx(I, { variant: "sigma", textColor: "neutral600", textTransform: "uppercase", style: { marginBottom: "8px", display: "block" }, children: t("license.currentUsage", "Current Usage") }),
287
- /* @__PURE__ */ jsxs(I, { variant: "omega", fontWeight: "semiBold", style: { fontSize: "24px" }, children: [
288
- collaborators.current,
289
- " / ",
290
- collaborators.unlimited ? t("license.unlimited", "Unlimited") : collaborators.max
291
- ] })
292
- ] }),
293
- /* @__PURE__ */ jsxs(R, { style: { flex: "1", minWidth: "200px" }, children: [
294
- /* @__PURE__ */ jsx(I, { variant: "sigma", textColor: "neutral600", textTransform: "uppercase", style: { marginBottom: "8px", display: "block" }, children: t("license.status", "Status") }),
295
- /* @__PURE__ */ jsx(
296
- Ps,
297
- {
298
- backgroundColor: collaborators.canAdd ? "success100" : "danger100",
299
- textColor: collaborators.canAdd ? "success700" : "danger700",
300
- style: { fontSize: "12px", fontWeight: "600", padding: "6px 12px" },
301
- children: collaborators.canAdd ? t("license.canAddMore", "Can add more") : t("license.limitReached", "Limit reached")
302
- }
303
- )
304
- ] })
305
- ] }),
306
- !collaborators.canAdd && !collaborators.unlimited && /* @__PURE__ */ jsx(R, { marginTop: 4, padding: 4, background: "warning100", hasRadius: true, children: /* @__PURE__ */ jsx(I, { variant: "omega", textColor: "warning700", children: t("license.upgradeMessage", "Upgrade your plan to add more collaborators. Visit https://store.magicdx.dev/") }) })
307
- ] }) })
308
- ] }),
309
- /* @__PURE__ */ jsxs(Sm.Item, { value: "details", children: [
310
- /* @__PURE__ */ jsx(Sm.Header, { children: /* @__PURE__ */ jsx(Sm.Trigger, { icon: () => /* @__PURE__ */ jsx(ShieldCheckIcon, { style: { width: 16, height: 16 } }), children: t("license.section.details", "License Details") }) }),
311
- /* @__PURE__ */ jsx(Sm.Content, { children: /* @__PURE__ */ jsx(R, { padding: 6, children: /* @__PURE__ */ jsxs(T, { gap: 8, wrap: "wrap", children: [
312
- /* @__PURE__ */ jsxs(R, { style: { flex: "1", minWidth: "180px" }, children: [
313
- /* @__PURE__ */ jsx(I, { variant: "sigma", textColor: "neutral600", textTransform: "uppercase", style: { marginBottom: "8px", display: "block" }, children: data.isExpired ? t("license.expiredOn", "Expired On") : t("license.expiresOn", "Expires On") }),
314
- /* @__PURE__ */ jsx(I, { variant: "omega", fontWeight: "semiBold", children: data.expiresAt ? new Date(data.expiresAt).toLocaleDateString("en-US", {
315
- year: "numeric",
316
- month: "long",
317
- day: "numeric"
318
- }) : t("license.never", "Never") })
319
- ] }),
320
- /* @__PURE__ */ jsxs(R, { style: { flex: "1", minWidth: "180px" }, children: [
321
- /* @__PURE__ */ jsx(I, { variant: "sigma", textColor: "neutral600", textTransform: "uppercase", style: { marginBottom: "8px", display: "block" }, children: t("license.deviceName", "Device Name") }),
322
- /* @__PURE__ */ jsx(I, { variant: "omega", fontWeight: "semiBold", children: data.deviceName || t("license.unknown", "Unknown") })
323
- ] })
324
- ] }) }) })
325
- ] }),
326
- /* @__PURE__ */ jsxs(Sm.Item, { value: "features", children: [
327
- /* @__PURE__ */ jsx(Sm.Header, { children: /* @__PURE__ */ jsx(Sm.Trigger, { icon: () => /* @__PURE__ */ jsx(SparklesIcon, { style: { width: 16, height: 16 } }), children: t("license.section.features", "Features & Capabilities") }) }),
328
- /* @__PURE__ */ jsx(Sm.Content, { children: /* @__PURE__ */ jsxs(R, { padding: 6, children: [
329
- /* @__PURE__ */ jsxs(T, { gap: 3, style: { marginBottom: "32px" }, children: [
330
- /* @__PURE__ */ jsxs(
331
- Ps,
332
- {
333
- backgroundColor: tier === "free" ? "success100" : "neutral100",
334
- textColor: tier === "free" ? "success700" : "neutral600",
335
- style: {
336
- fontSize: "13px",
337
- fontWeight: "700",
338
- padding: "8px 16px",
339
- border: tier === "free" ? "2px solid #dcfce7" : "2px solid #e5e7eb"
340
- },
341
- children: [
342
- tier === "free" ? "[ACTIVE]" : "",
343
- " FREE"
344
- ]
345
- }
346
- ),
347
- /* @__PURE__ */ jsxs(
348
- Ps,
349
- {
350
- backgroundColor: tier === "premium" ? "primary100" : "neutral100",
351
- textColor: tier === "premium" ? "primary700" : "neutral600",
352
- style: {
353
- fontSize: "13px",
354
- fontWeight: "700",
355
- padding: "8px 16px",
356
- border: tier === "premium" ? "2px solid #ede9fe" : "2px solid #e5e7eb"
357
- },
358
- children: [
359
- tier === "premium" ? "[ACTIVE]" : "",
360
- " PREMIUM"
361
- ]
362
- }
363
- ),
364
- /* @__PURE__ */ jsxs(
365
- Ps,
366
- {
367
- backgroundColor: tier === "advanced" || tier === "enterprise" ? "secondary100" : "neutral100",
368
- textColor: tier === "advanced" || tier === "enterprise" ? "secondary700" : "neutral600",
369
- style: {
370
- fontSize: "13px",
371
- fontWeight: "700",
372
- padding: "8px 16px",
373
- border: tier === "advanced" || tier === "enterprise" ? "2px solid #ddd6fe" : "2px solid #e5e7eb"
374
- },
375
- children: [
376
- tier === "advanced" || tier === "enterprise" ? "[ACTIVE]" : "",
377
- " ADVANCED"
378
- ]
379
- }
380
- )
381
- ] }),
382
- /* @__PURE__ */ jsxs(R, { padding: 5, background: "neutral100", hasRadius: true, children: [
383
- /* @__PURE__ */ jsx(I, { variant: "delta", fontWeight: "bold", style: { marginBottom: "16px", display: "block" }, children: t("license.yourPlanIncludes", "Your Plan Includes:") }),
384
- /* @__PURE__ */ jsxs(T, { direction: "column", gap: 2, children: [
385
- /* @__PURE__ */ jsxs(I, { variant: "omega", style: { fontSize: "14px" }, children: [
386
- "[OK] ",
387
- t("license.feature.fullAccess", "Full Editor Access (all tools)")
388
- ] }),
389
- /* @__PURE__ */ jsxs(I, { variant: "omega", style: { fontSize: "14px" }, children: [
390
- "[OK] ",
391
- t("license.feature.realtimeCollab", "Real-Time Collaboration")
392
- ] }),
393
- /* @__PURE__ */ jsxs(I, { variant: "omega", style: { fontSize: "14px" }, children: [
394
- "[OK] ",
395
- collaborators.unlimited ? t("license.feature.collaboratorsUnlimited", "Unlimited Collaborators") : t("license.feature.collaborators", "{count} Collaborator(s)", { count: collaborators.max })
396
- ] }),
397
- (tier === "premium" || tier === "advanced" || tier === "enterprise") && /* @__PURE__ */ jsxs(Fragment, { children: [
398
- /* @__PURE__ */ jsxs(I, { variant: "omega", style: { fontSize: "14px" }, children: [
399
- "[OK] ",
400
- t("license.feature.aiAssistant", "AI Assistant (Usage-based)")
401
- ] }),
402
- /* @__PURE__ */ jsxs(I, { variant: "omega", style: { fontSize: "14px" }, children: [
403
- "[OK] ",
404
- t("license.feature.versionHistory", "Version History")
405
- ] }),
406
- /* @__PURE__ */ jsxs(I, { variant: "omega", style: { fontSize: "14px" }, children: [
407
- "[OK] ",
408
- t("license.feature.prioritySupport", "Priority Support")
409
- ] })
410
- ] })
411
- ] })
412
- ] })
413
- ] }) })
414
- ] }),
415
- /* @__PURE__ */ jsxs(Sm.Item, { value: "status", children: [
416
- /* @__PURE__ */ jsx(Sm.Header, { children: /* @__PURE__ */ jsx(Sm.Trigger, { icon: () => /* @__PURE__ */ jsx(ChartBarIcon, { style: { width: 16, height: 16 } }), children: t("license.section.status", "System Status") }) }),
417
- /* @__PURE__ */ jsx(Sm.Content, { children: /* @__PURE__ */ jsx(R, { padding: 6, children: /* @__PURE__ */ jsxs(T, { gap: 8, wrap: "wrap", children: [
418
- /* @__PURE__ */ jsxs(R, { style: { flex: "1", minWidth: "150px" }, children: [
419
- /* @__PURE__ */ jsx(I, { variant: "sigma", textColor: "neutral600", textTransform: "uppercase", style: { marginBottom: "8px", display: "block" }, children: t("license.licenseStatus", "License Status") }),
420
- /* @__PURE__ */ jsx(I, { variant: "omega", fontWeight: "semiBold", children: data.isActive ? t("license.active", "Active") : t("license.inactive", "Inactive") })
421
- ] }),
422
- /* @__PURE__ */ jsxs(R, { style: { flex: "1", minWidth: "150px" }, children: [
423
- /* @__PURE__ */ jsx(I, { variant: "sigma", textColor: "neutral600", textTransform: "uppercase", style: { marginBottom: "8px", display: "block" }, children: t("license.connection", "Connection") }),
424
- /* @__PURE__ */ jsx(I, { variant: "omega", fontWeight: "semiBold", children: data.isOnline ? t("license.online", "Online") : t("license.offline", "Offline") })
425
- ] }),
426
- /* @__PURE__ */ jsxs(R, { style: { flex: "1", minWidth: "150px" }, children: [
427
- /* @__PURE__ */ jsx(I, { variant: "sigma", textColor: "neutral600", textTransform: "uppercase", style: { marginBottom: "8px", display: "block" }, children: t("license.lastSync", "Last Sync") }),
428
- /* @__PURE__ */ jsx(I, { variant: "omega", fontWeight: "semiBold", children: data.lastPingAt ? new Date(data.lastPingAt).toLocaleTimeString() : t("license.never", "Never") })
429
- ] })
430
- ] }) }) })
431
- ] })
432
- ] }) })
433
- ] })
434
- ] });
435
- };
436
- export {
437
- Settings as default
438
- };