@haex-space/vault-sdk 2.3.0 → 2.3.3

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