@haex-space/vault-sdk 2.3.0 → 2.3.1

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.js CHANGED
@@ -7,7 +7,7 @@ function installLocalStoragePolyfill() {
7
7
  if (typeof window === "undefined") {
8
8
  return;
9
9
  }
10
- console.log("[HaexHub] Storage Polyfill loading immediately");
10
+ console.log("[HaexSpace] Storage Polyfill loading immediately");
11
11
  let localStorageWorks = false;
12
12
  try {
13
13
  const testKey = "__ls_test__";
@@ -15,7 +15,7 @@ function installLocalStoragePolyfill() {
15
15
  localStorage.removeItem(testKey);
16
16
  localStorageWorks = true;
17
17
  } catch (e) {
18
- console.warn("[HaexHub] localStorage blocked \u2013 using in-memory fallback");
18
+ console.warn("[HaexSpace] localStorage blocked \u2013 using in-memory fallback");
19
19
  }
20
20
  if (!localStorageWorks) {
21
21
  const lsStorage = /* @__PURE__ */ new Map();
@@ -48,7 +48,7 @@ function installLocalStoragePolyfill() {
48
48
  } catch (e) {
49
49
  window.localStorage = localStoragePoly;
50
50
  }
51
- console.log("[HaexHub] localStorage replaced with in-memory polyfill");
51
+ console.log("[HaexSpace] localStorage replaced with in-memory polyfill");
52
52
  }
53
53
  }
54
54
  function installSessionStoragePolyfill() {
@@ -93,7 +93,7 @@ function installSessionStoragePolyfill() {
93
93
  key: () => null
94
94
  };
95
95
  }
96
- console.log("[HaexHub] sessionStorage polyfill installed");
96
+ console.log("[HaexSpace] sessionStorage polyfill installed");
97
97
  }
98
98
 
99
99
  // src/polyfills/cookies.ts
@@ -106,7 +106,7 @@ function installCookiePolyfill() {
106
106
  document.cookie = "__cookie_test__=1";
107
107
  cookiesWork = document.cookie.indexOf("__cookie_test__") !== -1;
108
108
  } catch (e) {
109
- console.warn("[HaexHub] Cookies blocked \u2013 using in-memory fallback");
109
+ console.warn("[HaexSpace] Cookies blocked \u2013 using in-memory fallback");
110
110
  }
111
111
  if (!cookiesWork) {
112
112
  const cookieStore = /* @__PURE__ */ new Map();
@@ -152,7 +152,7 @@ function installCookiePolyfill() {
152
152
  },
153
153
  configurable: true
154
154
  });
155
- console.log("[HaexHub] Cookie polyfill installed");
155
+ console.log("[HaexSpace] Cookie polyfill installed");
156
156
  }
157
157
  }
158
158
 
@@ -162,16 +162,16 @@ function installHistoryPolyfill() {
162
162
  return;
163
163
  }
164
164
  const install = () => {
165
- console.log("[HaexHub] History Patch loading");
165
+ console.log("[HaexSpace] History Patch loading");
166
166
  const originalPushState = history.pushState;
167
167
  const originalReplaceState = history.replaceState;
168
168
  let skipNextPush = false;
169
169
  let skipNextReplace = false;
170
170
  history.pushState = function(state, title, url) {
171
- console.log("[HaexHub] pushState called:", url, "skip:", skipNextPush);
171
+ console.log("[HaexSpace] pushState called:", url, "skip:", skipNextPush);
172
172
  if (skipNextPush) {
173
173
  skipNextPush = false;
174
- console.log("[HaexHub] pushState skipped");
174
+ console.log("[HaexSpace] pushState skipped");
175
175
  return;
176
176
  }
177
177
  try {
@@ -181,7 +181,7 @@ function installHistoryPolyfill() {
181
181
  const urlString = url.toString();
182
182
  let hashUrl = urlString.replace(/^\/#/, "");
183
183
  hashUrl = hashUrl.startsWith("#") ? hashUrl : "#" + hashUrl;
184
- console.log("[HaexHub] SecurityError - setting hash to:", hashUrl);
184
+ console.log("[HaexSpace] SecurityError - setting hash to:", hashUrl);
185
185
  skipNextPush = true;
186
186
  window.location.hash = hashUrl.replace(/^#/, "");
187
187
  return;
@@ -190,10 +190,10 @@ function installHistoryPolyfill() {
190
190
  }
191
191
  };
192
192
  history.replaceState = function(state, title, url) {
193
- console.log("[HaexHub] replaceState called:", url, "skip:", skipNextReplace);
193
+ console.log("[HaexSpace] replaceState called:", url, "skip:", skipNextReplace);
194
194
  if (skipNextReplace) {
195
195
  skipNextReplace = false;
196
- console.log("[HaexHub] replaceState skipped");
196
+ console.log("[HaexSpace] replaceState skipped");
197
197
  return;
198
198
  }
199
199
  try {
@@ -203,7 +203,7 @@ function installHistoryPolyfill() {
203
203
  const urlString = url.toString();
204
204
  let hashUrl = urlString.replace(/^\/#/, "");
205
205
  hashUrl = hashUrl.startsWith("#") ? hashUrl : "#" + hashUrl;
206
- console.log("[HaexHub] SecurityError - setting hash to:", hashUrl);
206
+ console.log("[HaexSpace] SecurityError - setting hash to:", hashUrl);
207
207
  skipNextReplace = true;
208
208
  window.location.hash = hashUrl.replace(/^#/, "");
209
209
  return;
@@ -211,7 +211,7 @@ function installHistoryPolyfill() {
211
211
  throw e;
212
212
  }
213
213
  };
214
- console.log("[HaexHub] History API patched");
214
+ console.log("[HaexSpace] History API patched");
215
215
  };
216
216
  if (document.readyState === "loading") {
217
217
  document.addEventListener("DOMContentLoaded", install, { once: true });
@@ -253,27 +253,27 @@ function installBaseTag() {
253
253
  return;
254
254
  }
255
255
  if (window.__HAEXHUB_BASE_TAG_INSTALLING__) {
256
- console.log("[HaexHub] Base tag installation already in progress, skipping");
256
+ console.log("[HaexSpace] Base tag installation already in progress, skipping");
257
257
  return;
258
258
  }
259
- console.log("[HaexHub] Base tag installation starting");
259
+ console.log("[HaexSpace] Base tag installation starting");
260
260
  if (window.self === window.top) {
261
- console.log("[HaexHub] Not in iframe, skipping base tag");
261
+ console.log("[HaexSpace] Not in iframe, skipping base tag");
262
262
  return;
263
263
  }
264
264
  const existingBaseTag = document.querySelector("base#haexhub-base");
265
265
  if (existingBaseTag && existingBaseTag.href && existingBaseTag.href !== window.location.origin + "/") {
266
- console.log("[HaexHub] Base tag already configured, skipping");
266
+ console.log("[HaexSpace] Base tag already configured, skipping");
267
267
  return;
268
268
  }
269
269
  window.__HAEXHUB_BASE_TAG_INSTALLING__ = true;
270
270
  const pathname = window.location.pathname;
271
271
  const lastSlashIndex = pathname.lastIndexOf("/");
272
272
  const basePath = lastSlashIndex !== -1 ? pathname.substring(0, lastSlashIndex + 1) : "/";
273
- console.log("[HaexHub] Extracted base path from location:", basePath);
273
+ console.log("[HaexSpace] Extracted base path from location:", basePath);
274
274
  if (existingBaseTag) {
275
275
  existingBaseTag.href = basePath;
276
- console.log(`[HaexHub] Base tag updated: ${existingBaseTag.href}`);
276
+ console.log(`[HaexSpace] Base tag updated: ${existingBaseTag.href}`);
277
277
  } else {
278
278
  const baseTag = document.createElement("base");
279
279
  baseTag.id = "haexhub-base";
@@ -281,9 +281,9 @@ function installBaseTag() {
281
281
  const head = document.head || document.querySelector("head");
282
282
  if (head) {
283
283
  head.insertBefore(baseTag, head.firstChild);
284
- console.log(`[HaexHub] Base tag created: ${baseTag.href}`);
284
+ console.log(`[HaexSpace] Base tag created: ${baseTag.href}`);
285
285
  } else {
286
- console.warn("[HaexHub] No <head> found, cannot inject base tag");
286
+ console.warn("[HaexSpace] No <head> found, cannot inject base tag");
287
287
  }
288
288
  }
289
289
  }
@@ -330,7 +330,7 @@ function interceptConsole(level) {
330
330
  "*"
331
331
  );
332
332
  } catch (error) {
333
- originalConsole.error("[HaexHub] Failed to forward console message:", error);
333
+ originalConsole.error("[HaexSpace] Failed to forward console message:", error);
334
334
  }
335
335
  }
336
336
  };
@@ -343,7 +343,7 @@ function installConsoleForwarding(debug = false) {
343
343
  return;
344
344
  }
345
345
  if (!debug) {
346
- console.log("[HaexHub] Console forwarding disabled (not in debug mode)");
346
+ console.log("[HaexSpace] Console forwarding disabled (not in debug mode)");
347
347
  return;
348
348
  }
349
349
  interceptConsole("log");
@@ -351,7 +351,7 @@ function installConsoleForwarding(debug = false) {
351
351
  interceptConsole("warn");
352
352
  interceptConsole("error");
353
353
  interceptConsole("debug");
354
- console.log("[HaexHub] Console forwarding installed");
354
+ console.log("[HaexSpace] Console forwarding installed");
355
355
  }
356
356
 
357
357
  // src/polyfills/index.ts
@@ -363,7 +363,7 @@ function installPolyfills() {
363
363
  installSessionStoragePolyfill();
364
364
  installCookiePolyfill();
365
365
  installHistoryPolyfill();
366
- console.log("[HaexHub] All polyfills loaded successfully");
366
+ console.log("[HaexSpace] All polyfills loaded successfully");
367
367
  installDebugDiagnostics();
368
368
  }
369
369
  if (typeof window !== "undefined") {
@@ -888,13 +888,13 @@ var HaexVaultClient = class {
888
888
  async runSetupAsync() {
889
889
  if (!this.setupHook) return;
890
890
  try {
891
- this.log("[HaexHub] Running setup hook...");
891
+ this.log("[HaexSpace] Running setup hook...");
892
892
  await this.setupHook();
893
893
  this._setupCompleted = true;
894
- this.log("[HaexHub] Setup completed successfully");
894
+ this.log("[HaexSpace] Setup completed successfully");
895
895
  this.notifySubscribers();
896
896
  } catch (error) {
897
- this.log("[HaexHub] Setup failed:", error);
897
+ this.log("[HaexSpace] Setup failed:", error);
898
898
  throw error;
899
899
  }
900
900
  }
@@ -1223,26 +1223,26 @@ var HaexVaultClient = class {
1223
1223
  this.log("Application context:", this._context);
1224
1224
  this.notifySubscribers();
1225
1225
  const { listen } = window.__TAURI__.event;
1226
- console.log("[HaexHub SDK] Setting up Tauri event listener for:", HAEXTENSION_EVENTS.CONTEXT_CHANGED);
1226
+ console.log("[HaexSpace SDK] Setting up Tauri event listener for:", HAEXTENSION_EVENTS.CONTEXT_CHANGED);
1227
1227
  try {
1228
1228
  await listen(HAEXTENSION_EVENTS.CONTEXT_CHANGED, (event) => {
1229
- console.log("[HaexHub SDK] Received Tauri event:", HAEXTENSION_EVENTS.CONTEXT_CHANGED, event);
1229
+ console.log("[HaexSpace SDK] Received Tauri event:", HAEXTENSION_EVENTS.CONTEXT_CHANGED, event);
1230
1230
  this.log("Received context change event:", event);
1231
1231
  if (event.payload?.context) {
1232
1232
  this._context = event.payload.context;
1233
- console.log("[HaexHub SDK] Updated context to:", this._context);
1233
+ console.log("[HaexSpace SDK] Updated context to:", this._context);
1234
1234
  this.handleEvent({
1235
1235
  type: HAEXTENSION_EVENTS.CONTEXT_CHANGED,
1236
1236
  data: { context: this._context },
1237
1237
  timestamp: Date.now()
1238
1238
  });
1239
1239
  } else {
1240
- console.warn("[HaexHub SDK] Event received but no context in payload:", event);
1240
+ console.warn("[HaexSpace SDK] Event received but no context in payload:", event);
1241
1241
  }
1242
1242
  });
1243
- console.log("[HaexHub SDK] Context change listener registered successfully");
1243
+ console.log("[HaexSpace SDK] Context change listener registered successfully");
1244
1244
  } catch (error) {
1245
- console.error("[HaexHub SDK] Failed to setup context change listener:", error);
1245
+ console.error("[HaexSpace SDK] Failed to setup context change listener:", error);
1246
1246
  this.log("Failed to setup context change listener:", error);
1247
1247
  }
1248
1248
  this.resolveReady();
@@ -1259,7 +1259,7 @@ var HaexVaultClient = class {
1259
1259
  window.addEventListener("message", this.messageHandler);
1260
1260
  this.isNativeWindow = false;
1261
1261
  this.initialized = true;
1262
- this.log("HaexHub SDK initialized in iframe mode");
1262
+ this.log("HaexSpace SDK initialized in iframe mode");
1263
1263
  try {
1264
1264
  if (this.config.manifest) {
1265
1265
  this._extensionInfo = {
@@ -1427,7 +1427,7 @@ postMessage error: ${e}`);
1427
1427
  }
1428
1428
  log(...args) {
1429
1429
  if (this.config.debug) {
1430
- console.log("[HaexHub SDK]", ...args);
1430
+ console.log("[HaexSpace SDK]", ...args);
1431
1431
  }
1432
1432
  }
1433
1433
  };