@moontra/moonui-pro 2.33.17 → 2.33.19

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -102,17 +102,17 @@ var init_cli_token_reader = __esm({
102
102
  /**
103
103
  * Generate TRULY secure browser-specific device fingerprint
104
104
  * COMPLETELY INDEPENDENT from environment variables
105
- * Format: platform-hostname-browser_user_hash-machine_hash
105
+ * Format: browser-hostname-browser_user_hash-machine_hash
106
106
  *
107
107
  * SECURITY: Environment copying CANNOT bypass this!
108
108
  */
109
109
  async getDeviceFingerprint() {
110
110
  try {
111
111
  const platform2 = this.detectBrowserPlatform();
112
- const hostname = process.env.NEXT_PUBLIC_MOONUI_HOSTNAME || (typeof window !== "undefined" ? window.location.hostname : "unknown");
112
+ const hostname = typeof window !== "undefined" ? window.location.hostname : "unknown";
113
113
  const browserUserHash = await this.generateBrowserSpecificUserHash();
114
114
  const browserMachineId = await this.generateBrowserMachineId();
115
- const fingerprint = `${platform2}-${hostname}-${browserUserHash}-${browserMachineId}`;
115
+ const fingerprint = `browser-${hostname}-${browserUserHash}-${browserMachineId}`;
116
116
  console.log("[MoonUI Pro] Environment-independent browser fingerprint generated:", {
117
117
  platform: platform2,
118
118
  hostname,
@@ -124,11 +124,7 @@ var init_cli_token_reader = __esm({
124
124
  return fingerprint;
125
125
  } catch (error) {
126
126
  console.error("[MoonUI Pro] Device fingerprint generation failed:", error);
127
- const fallbackPlatform = "browser";
128
- const fallbackHostname = typeof window !== "undefined" ? window.location.hostname : "localhost";
129
- const fallbackUserHash = "fallback";
130
- const fallbackMachineHash = "000000";
131
- return `${fallbackPlatform}-${fallbackHostname}-${fallbackUserHash}-${fallbackMachineHash}`;
127
+ return "browser-fallback-device";
132
128
  }
133
129
  }
134
130
  /**
@@ -161,7 +157,7 @@ var init_cli_token_reader = __esm({
161
157
  return hash.substring(0, 8);
162
158
  } catch (error) {
163
159
  console.warn("[MoonUI Pro] Browser user hash generation failed, using fallback");
164
- const fallback = `${navigator.userAgent.length}-${screen.width}-${navigator.language}`;
160
+ const fallback = `${navigator.userAgent.length}-${screen.width}-${Date.now() % 1e4}`;
165
161
  return this.fallbackHash(fallback);
166
162
  }
167
163
  }
@@ -289,47 +285,30 @@ var init_cli_token_reader = __esm({
289
285
  }
290
286
  }
291
287
  /**
292
- * Validate device compatibility (CLI vs Browser) with hybrid security model
288
+ * Validate device compatibility (CLI vs Browser)
293
289
  * CLI: platform-hostname-userHash-macHash
294
290
  * Browser: platform-hostname-userHash-browserHash
295
- * Security levels:
296
- * - STRICT: All parts must match (prevent .env.local copying)
297
- * - HYBRID: First 3 parts match, API validation required for hash differences
291
+ * Compatible if first 3 parts match
298
292
  */
299
293
  validateDeviceCompatibility(tokenDeviceId, currentDeviceId) {
300
294
  const tokenParts = tokenDeviceId.split("-");
301
295
  const currentParts = currentDeviceId.split("-");
302
296
  if (tokenParts.length < 3 || currentParts.length < 3) {
303
- return { compatible: false, requiresAPIValidation: false, reason: "Invalid device ID format" };
297
+ return { compatible: false, reason: "Invalid device ID format" };
304
298
  }
305
299
  const platformMatch = tokenParts[0] === currentParts[0];
306
300
  const hostnameMatch = tokenParts[1] === currentParts[1];
307
301
  const userHashMatch = tokenParts[2] === currentParts[2];
308
- console.log("[MoonUI Pro] Device ID comparison:", {
309
- platform: { token: tokenParts[0], current: currentParts[0], match: platformMatch },
310
- hostname: { token: tokenParts[1], current: currentParts[1], match: hostnameMatch },
311
- userHash: { token: tokenParts[2], current: currentParts[2], match: userHashMatch },
312
- machineHash: { token: tokenParts[3], current: currentParts[3], match: tokenParts[3] === currentParts[3] }
313
- });
314
302
  if (!platformMatch) {
315
- return { compatible: false, requiresAPIValidation: false, reason: `Platform mismatch: token=${tokenParts[0]}, current=${currentParts[0]}` };
303
+ return { compatible: false, reason: "Platform mismatch (different OS)" };
316
304
  }
317
305
  if (!hostnameMatch) {
318
- return { compatible: false, requiresAPIValidation: false, reason: `Hostname mismatch: token=${tokenParts[1]}, current=${currentParts[1]}` };
306
+ return { compatible: false, reason: "Hostname mismatch (different machine)" };
319
307
  }
320
308
  if (!userHashMatch) {
321
- console.log("[MoonUI Pro] User hash mismatch detected (CLI vs Browser) - this is normal");
322
- console.log("[MoonUI Pro] Requiring API validation for security");
323
- return { compatible: true, requiresAPIValidation: true, reason: `User hash difference expected: CLI=${tokenParts[2]}, Browser=${currentParts[2]}` };
324
- }
325
- const cliMachineHash = tokenParts[3] || "";
326
- const browserMachineHash = currentParts[3] || "";
327
- const machineHashMatch = cliMachineHash === browserMachineHash;
328
- if (machineHashMatch) {
329
- return { compatible: true, requiresAPIValidation: false };
330
- } else {
331
- return { compatible: true, requiresAPIValidation: true };
309
+ return { compatible: false, reason: "User account mismatch" };
332
310
  }
311
+ return { compatible: true };
333
312
  }
334
313
  /**
335
314
  * SHA256 hash function for consistency with CLI
@@ -448,12 +427,7 @@ var init_cli_token_reader = __esm({
448
427
  console.log(" \u2022 Contact support for multi-device licensing options");
449
428
  return null;
450
429
  }
451
- if (compatibility.requiresAPIValidation) {
452
- console.log("[MoonUI Pro] Device hash mismatch detected - performing API validation");
453
- console.log("[MoonUI Pro] This is normal for CLI-Browser authentication");
454
- } else {
455
- console.log("[MoonUI Pro] Perfect device match - skipping API validation");
456
- }
430
+ console.log("[MoonUI Pro] Device compatibility validated successfully");
457
431
  }
458
432
  const isValid2 = await this.validateWithAPI(tokenData.token, tokenDeviceId, currentDeviceId);
459
433
  if (!isValid2) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@moontra/moonui-pro",
3
- "version": "2.33.17",
3
+ "version": "2.33.19",
4
4
  "description": "Premium React components for MoonUI - Advanced UI library with 50+ pro components including performance, interactive, and gesture components",
5
5
  "type": "module",
6
6
  "main": "dist/index.mjs",