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