@proveanything/smartlinks 1.3.11 → 1.3.12
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/docs/API_SUMMARY.md +1 -1
- package/dist/iframeResponder.js +28 -11
- package/docs/API_SUMMARY.md +1 -1
- package/package.json +1 -1
package/dist/docs/API_SUMMARY.md
CHANGED
package/dist/iframeResponder.js
CHANGED
|
@@ -216,20 +216,37 @@ export class IframeResponder {
|
|
|
216
216
|
// Ignore encoding errors
|
|
217
217
|
}
|
|
218
218
|
}
|
|
219
|
-
// Build URL
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
219
|
+
// Build URL - respect the URL format from server (hash routing or not)
|
|
220
|
+
const url = new URL(this.appUrl);
|
|
221
|
+
// If there's an initialPath, append it appropriately
|
|
222
|
+
if (this.options.initialPath) {
|
|
223
|
+
const path = this.options.initialPath;
|
|
224
|
+
// If URL has hash, append to hash (for hash-routed apps)
|
|
225
|
+
if (url.hash) {
|
|
226
|
+
// Remove trailing slash from hash, add path
|
|
227
|
+
const cleanHash = url.hash.replace(/\/$/, '');
|
|
228
|
+
const cleanPath = path.startsWith('/') ? path : '/' + path;
|
|
229
|
+
url.hash = cleanHash + cleanPath;
|
|
230
|
+
}
|
|
231
|
+
else {
|
|
232
|
+
// No hash, append to pathname (for path-routed apps)
|
|
233
|
+
const cleanPath = path.startsWith('/') ? path : '/' + path;
|
|
234
|
+
url.pathname = url.pathname.replace(/\/$/, '') + cleanPath;
|
|
235
|
+
}
|
|
223
236
|
}
|
|
224
|
-
//
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
237
|
+
// Add query params (to hash if present, otherwise to search)
|
|
238
|
+
if (url.hash && url.hash.includes('#')) {
|
|
239
|
+
// Hash routing - add params after hash
|
|
240
|
+
const hashParts = url.hash.split('?');
|
|
241
|
+
const existingParams = hashParts[1] ? new URLSearchParams(hashParts[1]) : new URLSearchParams();
|
|
242
|
+
params.forEach((value, key) => existingParams.set(key, value));
|
|
243
|
+
url.hash = hashParts[0] + '?' + existingParams.toString();
|
|
228
244
|
}
|
|
229
|
-
|
|
230
|
-
|
|
245
|
+
else {
|
|
246
|
+
// Regular routing - add params to search
|
|
247
|
+
params.forEach((value, key) => url.searchParams.set(key, value));
|
|
231
248
|
}
|
|
232
|
-
const finalUrl =
|
|
249
|
+
const finalUrl = url.toString();
|
|
233
250
|
console.log('[IframeResponder] Final iframe URL:', finalUrl);
|
|
234
251
|
return finalUrl;
|
|
235
252
|
}
|
package/docs/API_SUMMARY.md
CHANGED