@moontra/moonui-pro 2.32.36 → 2.32.38

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
@@ -105,19 +105,25 @@ var init_cli_token_reader = __esm({
105
105
  */
106
106
  async getRealExternalIP() {
107
107
  try {
108
+ console.log("[MoonUI Pro] Starting real external IP detection...");
108
109
  const ip = await this.getWebRTCIP();
110
+ console.log("[MoonUI Pro] WebRTC returned IP:", ip);
109
111
  if (ip && ip !== "unknown") {
112
+ console.log("[MoonUI Pro] Using WebRTC IP:", ip);
110
113
  return ip;
111
114
  }
112
115
  if (typeof window !== "undefined") {
113
116
  const currentHost = window.location.hostname;
117
+ console.log("[MoonUI Pro] Fallback hostname check:", currentHost);
114
118
  if (currentHost !== "localhost" && currentHost !== "127.0.0.1") {
119
+ console.log("[MoonUI Pro] Using fallback hostname:", currentHost);
115
120
  return currentHost;
116
121
  }
117
122
  }
123
+ console.log("[MoonUI Pro] Using last resort IP: 192.168.1.2");
118
124
  return "192.168.1.2";
119
125
  } catch (error) {
120
- console.warn("[MoonUI Pro] External IP detection failed, using fallback");
126
+ console.warn("[MoonUI Pro] External IP detection failed, using fallback:", error);
121
127
  return "192.168.1.2";
122
128
  }
123
129
  }
@@ -126,31 +132,50 @@ var init_cli_token_reader = __esm({
126
132
  */
127
133
  async getWebRTCIP() {
128
134
  return new Promise((resolve) => {
135
+ console.log("[MoonUI Pro] WebRTC IP detection starting...");
129
136
  try {
130
137
  const pc = new RTCPeerConnection({
131
138
  iceServers: [{ urls: "stun:stun.l.google.com:19302" }]
132
139
  });
133
140
  pc.createDataChannel("ip-detection");
141
+ let candidateCount = 0;
134
142
  pc.onicecandidate = (event) => {
143
+ candidateCount++;
144
+ console.log(`[MoonUI Pro] WebRTC candidate ${candidateCount}:`, event.candidate?.candidate);
135
145
  if (event.candidate) {
136
146
  const candidate = event.candidate.candidate;
137
147
  const ipMatch = candidate.match(/(\d+\.\d+\.\d+\.\d+)/);
138
148
  if (ipMatch && ipMatch[1]) {
139
149
  const ip = ipMatch[1];
140
- if (!ip.startsWith("127.") && !ip.startsWith("0.")) {
150
+ console.log(`[MoonUI Pro] WebRTC IP found: ${ip}`);
151
+ if (!ip.startsWith("127.") && !ip.startsWith("0.") && ip !== "0.0.0.0") {
152
+ console.log(`[MoonUI Pro] WebRTC IP accepted: ${ip}`);
141
153
  pc.close();
142
154
  resolve(ip);
143
155
  return;
156
+ } else {
157
+ console.log(`[MoonUI Pro] WebRTC IP rejected (localhost): ${ip}`);
144
158
  }
145
159
  }
146
160
  }
147
161
  };
148
- pc.createOffer().then((offer) => pc.setLocalDescription(offer)).catch(() => resolve("unknown"));
162
+ pc.onicecandidateerror = (event) => {
163
+ console.error("[MoonUI Pro] WebRTC ICE candidate error:", event);
164
+ };
165
+ pc.createOffer().then((offer) => {
166
+ console.log("[MoonUI Pro] WebRTC offer created successfully");
167
+ return pc.setLocalDescription(offer);
168
+ }).catch((error) => {
169
+ console.error("[MoonUI Pro] WebRTC offer creation failed:", error);
170
+ resolve("unknown");
171
+ });
149
172
  setTimeout(() => {
173
+ console.log(`[MoonUI Pro] WebRTC timeout after ${candidateCount} candidates`);
150
174
  pc.close();
151
175
  resolve("unknown");
152
- }, 3e3);
176
+ }, 5e3);
153
177
  } catch (error) {
178
+ console.error("[MoonUI Pro] WebRTC initialization failed:", error);
154
179
  resolve("unknown");
155
180
  }
156
181
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@moontra/moonui-pro",
3
- "version": "2.32.36",
3
+ "version": "2.32.38",
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",