@comet/cms-admin 7.25.3 → 7.25.5

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 +1 @@
1
- {"version":3,"file":"SitePreview.d.ts","sourceRoot":"","sources":["../../../src/preview/site/SitePreview.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,SAAS,EAAyB,MAAM,OAAO,CAAC;AAEzD,OAAO,EAAE,mBAAmB,EAA2B,MAAM,cAAc,CAAC;AAG5E,OAAO,EAAE,qBAAqB,EAAmB,MAAM,6BAA6B,CAAC;AAarF,UAAU,KAAM,SAAQ,mBAAmB;IACvC,WAAW,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,qBAAqB,KAAK,MAAM,CAAC;IACrE,IAAI,CAAC,EAAE,SAAS,CAAC;CACpB;AAqBD,iBAAS,WAAW,CAAC,EAAE,WAAW,EAAE,IAA2C,EAAE,EAAE,KAAK,eA+IvF;AAED,OAAO,EAAE,WAAW,EAAE,CAAC"}
1
+ {"version":3,"file":"SitePreview.d.ts","sourceRoot":"","sources":["../../../src/preview/site/SitePreview.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,SAAS,EAAyB,MAAM,OAAO,CAAC;AAEzD,OAAO,EAAE,mBAAmB,EAA2B,MAAM,cAAc,CAAC;AAG5E,OAAO,EAAE,qBAAqB,EAAmB,MAAM,6BAA6B,CAAC;AAarF,UAAU,KAAM,SAAQ,mBAAmB;IACvC,WAAW,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,qBAAqB,KAAK,MAAM,CAAC;IACrE,IAAI,CAAC,EAAE,SAAS,CAAC;CACpB;AAqBD,iBAAS,WAAW,CAAC,EAAE,WAAW,EAAE,IAA2C,EAAE,EAAE,KAAK,eA8IvF;AAED,OAAO,EAAE,WAAW,EAAE,CAAC"}
@@ -54,6 +54,9 @@ function SitePreview(_ref) {
54
54
  }) : _ref$logo;
55
55
  var _useContentScope = (0, _Provider.useContentScope)(),
56
56
  scope = _useContentScope.scope;
57
+ var siteConfig = (0, _useSiteConfig.useSiteConfig)({
58
+ scope: scope
59
+ });
57
60
 
58
61
  //initialPath: path the preview is initialized with; WITHOUT resolvePath called, might be not the path actually used in site
59
62
  //doesn't change during navigation within site
@@ -67,11 +70,11 @@ function SitePreview(_ref) {
67
70
  //use case for resolvePath: i18n urls, for example `/${scope.language}${path}`;
68
71
  //changes during navigation within site (iframe bridge reports new path)
69
72
  var _useSearchState3 = useSearchState("sitePath", function (v) {
70
- if (v) {
71
- return v;
72
- } else {
73
- return resolvePath ? resolvePath(initialPath, scope) : initialPath;
73
+ if (!v) {
74
+ v = resolvePath ? resolvePath(initialPath, scope) : initialPath;
74
75
  }
76
+ var url = new URL(v, siteConfig.url); // prevents phishing attacks
77
+ return url.pathname;
75
78
  }),
76
79
  _useSearchState4 = _slicedToArray(_useSearchState3, 2),
77
80
  sitePath = _useSearchState4[0],
@@ -104,9 +107,6 @@ function SitePreview(_ref) {
104
107
  _useState4 = _slicedToArray(_useState3, 2),
105
108
  linkToOpen = _useState4[0],
106
109
  setLinkToOpen = _useState4[1];
107
- var siteConfig = (0, _useSiteConfig.useSiteConfig)({
108
- scope: scope
109
- });
110
110
  var intl = (0, _reactIntl.useIntl)();
111
111
 
112
112
  // the site in the iframe notifies us about it's current location
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@comet/cms-admin",
3
- "version": "7.25.3",
3
+ "version": "7.25.5",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/vivid-planet/comet",
@@ -54,12 +54,12 @@
54
54
  "split.js": "^1.6.4",
55
55
  "use-debounce": "^6.0.0",
56
56
  "uuid": "^9.0.0",
57
- "@comet/admin": "7.25.3",
58
- "@comet/admin-icons": "7.25.3",
59
- "@comet/admin-rte": "7.25.3",
60
- "@comet/admin-theme": "7.25.3",
61
- "@comet/admin-date-time": "7.25.3",
62
- "@comet/blocks-admin": "7.25.3"
57
+ "@comet/admin": "7.25.5",
58
+ "@comet/admin-date-time": "7.25.5",
59
+ "@comet/admin-icons": "7.25.5",
60
+ "@comet/admin-rte": "7.25.5",
61
+ "@comet/admin-theme": "7.25.5",
62
+ "@comet/blocks-admin": "7.25.5"
63
63
  },
64
64
  "devDependencies": {
65
65
  "@apollo/client": "^3.7.0",
@@ -121,9 +121,9 @@
121
121
  "ts-jest": "^29.0.5",
122
122
  "ts-node": "^10.9.1",
123
123
  "typescript": "^4.0.0",
124
- "@comet/admin-babel-preset": "7.25.3",
125
- "@comet/cli": "7.25.3",
126
- "@comet/eslint-config": "7.25.3"
124
+ "@comet/admin-babel-preset": "7.25.5",
125
+ "@comet/cli": "7.25.5",
126
+ "@comet/eslint-config": "7.25.5"
127
127
  },
128
128
  "peerDependencies": {
129
129
  "@apollo/client": "^3.7.0",