@moontra/moonui-pro 2.33.19 → 2.33.20
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.d.ts +19 -19
- package/dist/index.global.js +1 -1
- package/dist/index.global.js.map +1 -1
- package/dist/index.mjs +62 -5
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -2835,6 +2835,64 @@ function createAIProvider(provider, config) {
|
|
|
2835
2835
|
|
|
2836
2836
|
// src/index.ts
|
|
2837
2837
|
init_use_subscription();
|
|
2838
|
+
async function sha256(message) {
|
|
2839
|
+
const msgBuffer = new TextEncoder().encode(message);
|
|
2840
|
+
const hashBuffer = await crypto.subtle.digest("SHA-256", msgBuffer);
|
|
2841
|
+
const hashArray = Array.from(new Uint8Array(hashBuffer));
|
|
2842
|
+
const hashHex = hashArray.map((b) => b.toString(16).padStart(2, "0")).join("");
|
|
2843
|
+
return hashHex;
|
|
2844
|
+
}
|
|
2845
|
+
async function generateStableBrowserFingerprint() {
|
|
2846
|
+
const components = [];
|
|
2847
|
+
try {
|
|
2848
|
+
const canvas = document.createElement("canvas");
|
|
2849
|
+
canvas.width = 200;
|
|
2850
|
+
canvas.height = 50;
|
|
2851
|
+
const ctx = canvas.getContext("2d");
|
|
2852
|
+
if (ctx) {
|
|
2853
|
+
ctx.textBaseline = "top";
|
|
2854
|
+
ctx.font = "14px Arial";
|
|
2855
|
+
ctx.textAlign = "center";
|
|
2856
|
+
ctx.fillStyle = "#f60";
|
|
2857
|
+
ctx.fillRect(125, 1, 62, 20);
|
|
2858
|
+
ctx.fillStyle = "#069";
|
|
2859
|
+
ctx.fillText("\u{1F510}MoonUI", 50, 25);
|
|
2860
|
+
ctx.fillStyle = "rgba(102, 204, 0, 0.7)";
|
|
2861
|
+
ctx.fillText("\u{1F510}MoonUI", 100, 25);
|
|
2862
|
+
const canvasData = canvas.toDataURL();
|
|
2863
|
+
const canvasHash = await sha256(canvasData);
|
|
2864
|
+
components.push(canvasHash.slice(0, 8));
|
|
2865
|
+
}
|
|
2866
|
+
const canvas2 = document.createElement("canvas");
|
|
2867
|
+
const gl = canvas2.getContext("webgl") || canvas2.getContext("experimental-webgl");
|
|
2868
|
+
if (gl) {
|
|
2869
|
+
const debugInfo = gl.getExtension("WEBGL_debug_renderer_info");
|
|
2870
|
+
if (debugInfo) {
|
|
2871
|
+
const vendor = gl.getParameter(debugInfo.UNMASKED_VENDOR_WEBGL);
|
|
2872
|
+
const renderer = gl.getParameter(debugInfo.UNMASKED_RENDERER_WEBGL);
|
|
2873
|
+
const glHash = await sha256(`${vendor}|${renderer}`);
|
|
2874
|
+
components.push(glHash.slice(0, 8));
|
|
2875
|
+
} else {
|
|
2876
|
+
const vendor = gl.getParameter(gl.VENDOR);
|
|
2877
|
+
const renderer = gl.getParameter(gl.RENDERER);
|
|
2878
|
+
const glHash = await sha256(`${vendor}|${renderer}`);
|
|
2879
|
+
components.push(glHash.slice(0, 8));
|
|
2880
|
+
}
|
|
2881
|
+
}
|
|
2882
|
+
const screenData = `${window.screen.width}x${window.screen.height}x${window.screen.colorDepth}`;
|
|
2883
|
+
const screenHash = await sha256(screenData);
|
|
2884
|
+
components.push(screenHash.slice(0, 8));
|
|
2885
|
+
const timezone = Intl.DateTimeFormat().resolvedOptions().timeZone;
|
|
2886
|
+
const language = navigator.language;
|
|
2887
|
+
const localeHash = await sha256(`${timezone}|${language}`);
|
|
2888
|
+
components.push(localeHash.slice(0, 6));
|
|
2889
|
+
} catch (error) {
|
|
2890
|
+
console.error("[MoonUI Pro] Error generating browser fingerprint:", error);
|
|
2891
|
+
const fallbackHash = await sha256(`${Date.now()}-${Math.random()}`);
|
|
2892
|
+
components.push(fallbackHash.slice(0, 8));
|
|
2893
|
+
}
|
|
2894
|
+
return `browser-${components.join("-")}`;
|
|
2895
|
+
}
|
|
2838
2896
|
var CACHE_KEY2 = "moonui_license_cache";
|
|
2839
2897
|
var CLI_AUTH_CACHE_KEY2 = "moonui_cli_auth_cache";
|
|
2840
2898
|
var CACHE_DURATION = !process.env.VERCEL ? 1 * 60 * 1e3 : 24 * 60 * 60 * 1e3;
|
|
@@ -2879,14 +2937,13 @@ function SubscriptionProvider({ children }) {
|
|
|
2879
2937
|
try {
|
|
2880
2938
|
const decoded = JSON.parse(atob(devToken));
|
|
2881
2939
|
const jwtToken = decoded.token;
|
|
2882
|
-
const
|
|
2883
|
-
const userHash = deviceId.split("-")[2];
|
|
2884
|
-
const browserHash = Math.random().toString(36).substring(2, 8);
|
|
2940
|
+
const browserFingerprint = await generateStableBrowserFingerprint();
|
|
2885
2941
|
const requestBody = {
|
|
2886
2942
|
deviceId,
|
|
2887
|
-
browserDeviceId:
|
|
2943
|
+
browserDeviceId: browserFingerprint,
|
|
2888
2944
|
timestamp: Date.now(),
|
|
2889
|
-
validationType: "hybrid-
|
|
2945
|
+
validationType: "hybrid-browser-register",
|
|
2946
|
+
action: "registerBrowserIfNeeded"
|
|
2890
2947
|
};
|
|
2891
2948
|
console.log("[MoonUI Pro] Sending request to moonui.dev/api/cli/validate-session");
|
|
2892
2949
|
console.log("[MoonUI Pro] DeviceId:", deviceId);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@moontra/moonui-pro",
|
|
3
|
-
"version": "2.33.
|
|
3
|
+
"version": "2.33.20",
|
|
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",
|