@moontra/moonui-pro 2.32.12 → 2.32.14

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
@@ -90,9 +90,10 @@ var init_cli_token_reader = __esm({
90
90
  CLITokenReader = class {
91
91
  constructor() {
92
92
  this.cachedToken = null;
93
+ this.cachedAuthInfo = null;
93
94
  this.lastCheck = 0;
94
- this.CACHE_DURATION = 5 * 60 * 1e3;
95
- // 5 minutes
95
+ this.CACHE_DURATION = 30 * 1e3;
96
+ // 30 seconds - check frequently in dev
96
97
  this.apiCheckAttempted = false;
97
98
  }
98
99
  static getInstance() {
@@ -110,22 +111,33 @@ var init_cli_token_reader = __esm({
110
111
  return this.cachedToken;
111
112
  }
112
113
  {
114
+ if (typeof window === "undefined") {
115
+ try {
116
+ const { cliAuthBridge } = await import('./cli-auth-bridge');
117
+ const authInfo = await cliAuthBridge.getCLIAuthInfo();
118
+ if (authInfo && authInfo.token) {
119
+ console.log("[MoonUI Pro] CLI authentication found via auth bridge");
120
+ console.log("[MoonUI Pro] User:", authInfo.user?.email);
121
+ console.log("[MoonUI Pro] Plan:", authInfo.user?.plan);
122
+ console.log("[MoonUI Pro] Has Pro Access:", authInfo.user?.hasProAccess);
123
+ this.cachedToken = authInfo.token;
124
+ this.cachedAuthInfo = authInfo;
125
+ this.lastCheck = now;
126
+ return authInfo.token;
127
+ }
128
+ } catch (error) {
129
+ if (typeof window === "undefined") {
130
+ console.log("[MoonUI Pro] Could not read CLI auth directly:", error.message);
131
+ }
132
+ }
133
+ }
113
134
  if (typeof window !== "undefined" && window.__MOONUI_CLI_TOKEN__) {
114
135
  console.log("[MoonUI Pro] CLI token found in window object");
115
136
  this.cachedToken = window.__MOONUI_CLI_TOKEN__;
116
137
  this.lastCheck = now;
117
138
  return this.cachedToken;
118
139
  }
119
- if (typeof window !== "undefined") {
120
- const devToken = localStorage.getItem("moonui_dev_cli_token");
121
- if (devToken) {
122
- console.log("[MoonUI Pro] CLI token found in localStorage (dev)");
123
- this.cachedToken = devToken;
124
- this.lastCheck = now;
125
- return devToken;
126
- }
127
- }
128
- console.log("[MoonUI Pro] No CLI token available. See documentation for setup instructions.");
140
+ console.log("[MoonUI Pro] No CLI authentication found. Please run: moonui login");
129
141
  }
130
142
  return null;
131
143
  }
@@ -154,12 +166,18 @@ var init_cli_token_reader = __esm({
154
166
  */
155
167
  clearCache() {
156
168
  this.cachedToken = null;
169
+ this.cachedAuthInfo = null;
157
170
  this.lastCheck = 0;
158
171
  if (typeof window !== "undefined") {
159
- localStorage.removeItem("moonui_dev_cli_token");
160
172
  delete window.__MOONUI_CLI_TOKEN__;
161
173
  }
162
174
  }
175
+ /**
176
+ * Get cached auth info (if available)
177
+ */
178
+ getCachedAuthInfo() {
179
+ return this.cachedAuthInfo;
180
+ }
163
181
  };
164
182
  cliTokenReader = CLITokenReader.getInstance();
165
183
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@moontra/moonui-pro",
3
- "version": "2.32.12",
3
+ "version": "2.32.14",
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",