@salesforce/ui-bundle 1.134.2 → 1.134.4

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.
@@ -1,4 +1,4 @@
1
- const version = "1.134.2";
1
+ const version = "1.134.4";
2
2
  export {
3
3
  version
4
4
  };
@@ -7,7 +7,7 @@ function normalizeRoute(route) {
7
7
  });
8
8
  }
9
9
  function matchRoute(pathname, basePath, rewrites, redirects) {
10
- const base = basePath || "";
10
+ const base = (basePath || "").replace(/\/$/, "");
11
11
  const services = [
12
12
  "graphql",
13
13
  "ui-api",
@@ -441,6 +441,44 @@
441
441
  true,
442
442
  );
443
443
 
444
+ // @W-21893287: Monkey-patch History API to detect SPA navigation.
445
+ // Frameworks like React Router use pushState/replaceState for client-side
446
+ // routing which doesn't fire the iframe load event. This keeps the
447
+ // toolbar URL input in sync with the iframe's actual path.
448
+ if (window.parent && window.parent !== window) {
449
+ function notifyRouteChange() {
450
+ try {
451
+ window.parent.postMessage(
452
+ {
453
+ command: "routeChanged",
454
+ route: window.location.pathname,
455
+ _source: "ui-bundle-proxy-injected-script",
456
+ },
457
+ "*",
458
+ );
459
+ } catch (err) {}
460
+ }
461
+
462
+ var originalPushState = history.pushState;
463
+ var originalReplaceState = history.replaceState;
464
+
465
+ history.pushState = function () {
466
+ var result = originalPushState.apply(this, arguments);
467
+ notifyRouteChange();
468
+ return result;
469
+ };
470
+
471
+ history.replaceState = function () {
472
+ var result = originalReplaceState.apply(this, arguments);
473
+ notifyRouteChange();
474
+ return result;
475
+ };
476
+
477
+ window.addEventListener("popstate", function () {
478
+ notifyRouteChange();
479
+ });
480
+ }
481
+
444
482
  // 1. Handle unhandled JavaScript errors (runtime - extension shows Refresh Panel)
445
483
  window.addEventListener(
446
484
  "error",
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@salesforce/ui-bundle",
3
3
  "description": "Core package for Salesforce UI Bundles",
4
- "version": "1.134.2",
4
+ "version": "1.134.4",
5
5
  "license": "SEE LICENSE IN LICENSE.txt",
6
6
  "type": "module",
7
7
  "main": "./dist/index.js",
@@ -44,7 +44,7 @@
44
44
  },
45
45
  "dependencies": {
46
46
  "@salesforce/core": "^8.23.4",
47
- "@salesforce/sdk-data": "^1.134.2",
47
+ "@salesforce/sdk-data": "^1.134.4",
48
48
  "micromatch": "^4.0.8",
49
49
  "path-to-regexp": "^8.3.0"
50
50
  },