@jetbrains/ring-ui 6.0.18 → 6.0.19

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.
@@ -16,7 +16,28 @@ import styles from './popup.css';
16
16
  import { DEFAULT_DIRECTIONS, Dimension, Directions, Display, MaxHeight, MinWidth } from './popup.consts';
17
17
  import { PopupTargetContext, PopupTarget } from './popup.target';
18
18
  export { PopupTargetContext, PopupTarget };
19
- const stop = (e) => e.stopPropagation();
19
+ const isPossibleClientSideNavigation = (event) => {
20
+ const target = event.target;
21
+ const link = target.closest('a');
22
+ // Taken from https://github.com/nanostores/router/blob/80a333db4cf0789fda21a02715ebabca15192642/index.js#L58-L69
23
+ return link &&
24
+ event.button === 0 && // Left mouse button
25
+ link.target !== '_blank' && // Not for new tab
26
+ link.origin === location.origin && // Not external link
27
+ link.rel !== 'external' && // Not external link
28
+ link.target !== '_self' && // Now manually disabled
29
+ !link.download && // Not download link
30
+ !event.altKey && // Not download link by user
31
+ !event.metaKey && // Not open in new tab by user
32
+ !event.ctrlKey && // Not open in new tab by user
33
+ !event.shiftKey && // Not open in new window by user
34
+ event.defaultPrevented;
35
+ };
36
+ const stop = (event) => {
37
+ if (!isPossibleClientSideNavigation(event)) {
38
+ event.stopPropagation();
39
+ }
40
+ };
20
41
  export const getPopupContainer = (target) => (typeof target === 'string' ? document.querySelector(`[data-portaltarget=${target}]`) : target);
21
42
  /**
22
43
  * @constructor
@@ -198,7 +198,7 @@ export default class UserAgreementService {
198
198
  };
199
199
  hideDialog = (withoutNotifications) => {
200
200
  const { onDialogHide } = this.config;
201
- this.reactRoot.unmount();
201
+ this.reactRoot.render(null);
202
202
  if (onDialogHide) {
203
203
  onDialogHide();
204
204
  this._dialogPromise = null;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jetbrains/ring-ui",
3
- "version": "6.0.18",
3
+ "version": "6.0.19",
4
4
  "description": "JetBrains UI library",
5
5
  "author": "JetBrains",
6
6
  "license": "Apache-2.0",
@@ -94,13 +94,13 @@
94
94
  "@storybook/addon-storyshots-puppeteer": "7.6.17",
95
95
  "@storybook/addon-storysource": "8.0.8",
96
96
  "@storybook/addons": "7.6.17",
97
- "@storybook/components": "8.0.6",
97
+ "@storybook/components": "8.0.8",
98
98
  "@storybook/preview-api": "7.6.17",
99
99
  "@storybook/react": "7.6.17",
100
100
  "@storybook/react-webpack5": "7.6.17",
101
- "@storybook/source-loader": "8.0.6",
102
- "@storybook/theming": "8.0.6",
103
- "@testing-library/react": "^15.0.0",
101
+ "@storybook/source-loader": "8.0.8",
102
+ "@storybook/theming": "8.0.8",
103
+ "@testing-library/react": "^15.0.2",
104
104
  "@testing-library/user-event": "^14.5.2",
105
105
  "@types/chai": "^4.3.14",
106
106
  "@types/chai-as-promised": "^7.1.8",
@@ -108,22 +108,22 @@
108
108
  "@types/chai-enzyme": "^0.6.13",
109
109
  "@types/enzyme": "^3.10.18",
110
110
  "@types/markdown-it": "^14.0.1",
111
- "@types/react": "^18.2.77",
111
+ "@types/react": "^18.2.79",
112
112
  "@types/react-dom": "^18.2.25",
113
113
  "@types/sinon": "^17.0.3",
114
114
  "@types/sinon-chai": "^3.2.12",
115
- "@typescript-eslint/eslint-plugin": "^7.6.0",
116
- "@typescript-eslint/parser": "^7.6.0",
115
+ "@typescript-eslint/eslint-plugin": "^7.7.0",
116
+ "@typescript-eslint/parser": "^7.7.0",
117
117
  "@wojtekmaj/enzyme-adapter-react-17": "^0.8.0",
118
118
  "acorn": "^8.11.3",
119
119
  "babel-plugin-require-context-hook": "^1.0.0",
120
- "caniuse-lite": "^1.0.30001610",
120
+ "caniuse-lite": "^1.0.30001611",
121
121
  "chai": "^5.1.0",
122
122
  "chai-as-promised": "^7.1.1",
123
123
  "chai-dom": "^1.10.0",
124
124
  "chai-enzyme": "1.0.0-beta.1",
125
125
  "cheerio": "^1.0.0-rc.12",
126
- "core-js": "^3.36.1",
126
+ "core-js": "^3.37.0",
127
127
  "cpy-cli": "^3.1.1",
128
128
  "enzyme": "^3.11.0",
129
129
  "eslint": "^8.57.0",