@micromag/viewer 0.3.485 → 0.3.487

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.
Files changed (2) hide show
  1. package/lib/index.js +6 -5
  2. package/package.json +10 -10
package/lib/index.js CHANGED
@@ -474,13 +474,14 @@ function RoutesProvider(_ref) {
474
474
  RoutesProvider.propTypes = propTypes$o;
475
475
  RoutesProvider.defaultProps = defaultProps$o;
476
476
  var compilers = {};
477
- function generatePath(path, data) {
477
+ function generatePath(fullPath, data) {
478
478
  var opts = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
479
- if (typeof compilers[path] === 'undefined') {
480
- compilers[path] = pathToRegexp.compile(path, opts);
479
+ var fullUrlMatches = fullPath.match(/^(https?:\/\/[^/]+)\//);
480
+ if (typeof compilers[fullPath] === 'undefined') {
481
+ compilers[fullPath] = pathToRegexp.compile(fullPath.replace(/^(https?:\/\/[^/]+)\//, '/'), opts);
481
482
  }
482
- var compiler = compilers[path];
483
- return compiler(data);
483
+ var compiler = compilers[fullPath];
484
+ return fullUrlMatches !== null ? "".concat(fullUrlMatches[1].substr(0, -1)).concat(compiler(data)) : compiler(data);
484
485
  }
485
486
  var useUrlGeneratorPathToRepexp = function useUrlGeneratorPathToRepexp() {
486
487
  var _ref2 = useRoutesContext() || {},
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@micromag/viewer",
3
- "version": "0.3.485",
3
+ "version": "0.3.487",
4
4
  "private": false,
5
5
  "description": "",
6
6
  "keywords": [
@@ -65,14 +65,14 @@
65
65
  "dependencies": {
66
66
  "@babel/runtime": "^7.13.10",
67
67
  "@folklore/routes": "^0.2.27",
68
- "@micromag/core": "^0.3.485",
69
- "@micromag/element-badge": "^0.3.485",
70
- "@micromag/element-scroll": "^0.3.485",
71
- "@micromag/element-share-options": "^0.3.485",
72
- "@micromag/element-webview": "^0.3.485",
73
- "@micromag/elements": "^0.3.485",
74
- "@micromag/intl": "^0.3.485",
75
- "@micromag/screens": "^0.3.485",
68
+ "@micromag/core": "^0.3.487",
69
+ "@micromag/element-badge": "^0.3.487",
70
+ "@micromag/element-scroll": "^0.3.487",
71
+ "@micromag/element-share-options": "^0.3.487",
72
+ "@micromag/element-webview": "^0.3.487",
73
+ "@micromag/elements": "^0.3.487",
74
+ "@micromag/intl": "^0.3.487",
75
+ "@micromag/screens": "^0.3.487",
76
76
  "@react-spring/core": "^9.6.1",
77
77
  "@react-spring/web": "^9.6.1",
78
78
  "@use-gesture/react": "^10.3.0",
@@ -91,5 +91,5 @@
91
91
  "access": "public",
92
92
  "registry": "https://registry.npmjs.org/"
93
93
  },
94
- "gitHead": "7af4c126bdc155c5ea821e894957023b201c2b79"
94
+ "gitHead": "aaa0df7566c8291eca5aab8ab6c8b103152c110c"
95
95
  }