@atlaskit/inline-dialog 13.1.5 → 13.1.9
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/CHANGELOG.md +26 -1
- package/dist/cjs/InlineDialog/index.js +31 -10
- package/dist/cjs/InlineDialog/styled/container.js +6 -8
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/InlineDialog/index.js +28 -10
- package/dist/es2019/InlineDialog/styled/container.js +6 -7
- package/dist/es2019/version.json +1 -1
- package/dist/esm/InlineDialog/index.js +30 -10
- package/dist/esm/InlineDialog/styled/container.js +6 -7
- package/dist/esm/version.json +1 -1
- package/package.json +10 -7
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,30 @@
|
|
|
1
1
|
# @atlaskit/inline-dialog
|
|
2
2
|
|
|
3
|
+
## 13.1.9
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`f460cc7c411`](https://bitbucket.org/atlassian/atlassian-frontend/commits/f460cc7c411) - Builds for this package now pass through a tokens babel plugin, removing runtime invocations of the tokens() function and improving bundle size.
|
|
8
|
+
- Updated dependencies
|
|
9
|
+
|
|
10
|
+
## 13.1.8
|
|
11
|
+
|
|
12
|
+
### Patch Changes
|
|
13
|
+
|
|
14
|
+
- Updated dependencies
|
|
15
|
+
|
|
16
|
+
## 13.1.7
|
|
17
|
+
|
|
18
|
+
### Patch Changes
|
|
19
|
+
|
|
20
|
+
- [`34282240102`](https://bitbucket.org/atlassian/atlassian-frontend/commits/34282240102) - Adds explicit type to button usages components.
|
|
21
|
+
|
|
22
|
+
## 13.1.6
|
|
23
|
+
|
|
24
|
+
### Patch Changes
|
|
25
|
+
|
|
26
|
+
- [`cb79dfea5d9`](https://bitbucket.org/atlassian/atlassian-frontend/commits/cb79dfea5d9) - This fixes a bug in version 13.1.2 where inline dialog's `useEffect` was running synchronously and while the click event was still happening. This meant that if the open state was outside of inline dialog, there were instances where it failed to open.
|
|
27
|
+
|
|
3
28
|
## 13.1.5
|
|
4
29
|
|
|
5
30
|
### Patch Changes
|
|
@@ -22,7 +47,7 @@
|
|
|
22
47
|
|
|
23
48
|
### Patch Changes
|
|
24
49
|
|
|
25
|
-
- [`398904f14d9`](https://bitbucket.org/atlassian/atlassian-frontend/commits/398904f14d9) - [ux] Fixes a bug in version 13.1.0 where InlineDialog cannot be closed after it opens a Modal. There should be no other UI or UX changes.
|
|
50
|
+
- [`398904f14d9`](https://bitbucket.org/atlassian/atlassian-frontend/commits/398904f14d9) - [ux] Fixes a bug in version 13.1.0 where InlineDialog cannot be closed after it opens a Modal. There should be no other UI or UX changes. Note that the click event listener's `capture: false` has been changed to `capture: true`. This may cause some issues with the opening or closing of the inline dialog in some situations e.g. if the open state of the inline dialog is in an outer component. You can solve this by trying to add a `preventDefault` to the click handler in the outer component or changing the inline dialog's event handler to `{ capture: true }`.
|
|
26
51
|
|
|
27
52
|
## 13.1.1
|
|
28
53
|
|
|
@@ -13,6 +13,8 @@ var _react = _interopRequireWildcard(require("react"));
|
|
|
13
13
|
|
|
14
14
|
var _core = require("@emotion/core");
|
|
15
15
|
|
|
16
|
+
var _bindEventListener = require("bind-event-listener");
|
|
17
|
+
|
|
16
18
|
var _reactNodeResolver = _interopRequireDefault(require("react-node-resolver"));
|
|
17
19
|
|
|
18
20
|
var _analyticsNext = require("@atlaskit/analytics-next");
|
|
@@ -29,7 +31,7 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
|
|
|
29
31
|
|
|
30
32
|
/** @jsx jsx */
|
|
31
33
|
var packageName = "@atlaskit/inline-dialog";
|
|
32
|
-
var packageVersion = "13.1.
|
|
34
|
+
var packageVersion = "13.1.9";
|
|
33
35
|
|
|
34
36
|
var checkIsChildOfPortal = function checkIsChildOfPortal(node) {
|
|
35
37
|
if (!node) {
|
|
@@ -94,16 +96,35 @@ var InlineDialog = /*#__PURE__*/(0, _react.memo)(function InlineDialog(_ref) {
|
|
|
94
96
|
}
|
|
95
97
|
}, [onClose]);
|
|
96
98
|
(0, _react.useEffect)(function () {
|
|
97
|
-
if (isOpen) {
|
|
98
|
-
|
|
99
|
-
capture: false
|
|
100
|
-
});
|
|
101
|
-
return function () {
|
|
102
|
-
window.removeEventListener('click', handleClickOutside, {
|
|
103
|
-
capture: false
|
|
104
|
-
});
|
|
105
|
-
};
|
|
99
|
+
if (!isOpen) {
|
|
100
|
+
return;
|
|
106
101
|
}
|
|
102
|
+
|
|
103
|
+
var unbind; // Under most circumstances, `useEffect` should run after an event has ended
|
|
104
|
+
// In this particular case, the popperjs library has a setState inside of a ref,
|
|
105
|
+
// which cases `useEffect` to run synchronously instead. To avoid this, we use a
|
|
106
|
+
// `setTimeout` so `useEffect` after the event. We only want to start listening
|
|
107
|
+
// for clicks after the original click event that triggered the dialog
|
|
108
|
+
// has finished. You can see more in the Codesandbox here:
|
|
109
|
+
// https://codesandbox.io/s/useeffect-and-event-timing-refs-in-state-5tys3?file=/src/App.tsx
|
|
110
|
+
|
|
111
|
+
var timeoutId = setTimeout(function () {
|
|
112
|
+
unbind = (0, _bindEventListener.bind)(window, {
|
|
113
|
+
type: 'click',
|
|
114
|
+
listener: function listener(event) {
|
|
115
|
+
return handleClickOutside(event);
|
|
116
|
+
},
|
|
117
|
+
options: {
|
|
118
|
+
capture: false
|
|
119
|
+
}
|
|
120
|
+
});
|
|
121
|
+
});
|
|
122
|
+
return function () {
|
|
123
|
+
var _unbind;
|
|
124
|
+
|
|
125
|
+
window.clearTimeout(timeoutId);
|
|
126
|
+
(_unbind = unbind) === null || _unbind === void 0 ? void 0 : _unbind();
|
|
127
|
+
};
|
|
107
128
|
}, [handleClickOutside, isOpen]);
|
|
108
129
|
var popper = isOpen ? (0, _core.jsx)(_popper.Popper, {
|
|
109
130
|
placement: placement
|
|
@@ -21,8 +21,6 @@ var _components = require("@atlaskit/theme/components");
|
|
|
21
21
|
|
|
22
22
|
var _constants = require("@atlaskit/theme/constants");
|
|
23
23
|
|
|
24
|
-
var _tokens = require("@atlaskit/tokens");
|
|
25
|
-
|
|
26
24
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
27
25
|
|
|
28
26
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
@@ -32,16 +30,16 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
|
|
|
32
30
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
33
31
|
|
|
34
32
|
var themedBackground = (0, _components.themed)({
|
|
35
|
-
light: (
|
|
36
|
-
dark: (
|
|
33
|
+
light: "var(--ds-background-overlay, ".concat(_colors.N0, ")"),
|
|
34
|
+
dark: "var(--ds-background-overlay, ".concat(_colors.DN50, ")")
|
|
37
35
|
});
|
|
38
36
|
var themedColor = (0, _components.themed)({
|
|
39
|
-
light: (
|
|
40
|
-
dark: (
|
|
37
|
+
light: "var(--ds-text-highEmphasis, ".concat(_colors.N900, ")"),
|
|
38
|
+
dark: "var(--ds-text-highEmphasis, ".concat(_colors.DN600, ")")
|
|
41
39
|
});
|
|
42
40
|
var themedBoxShadow = (0, _components.themed)({
|
|
43
|
-
light: (
|
|
44
|
-
dark: (
|
|
41
|
+
light: "var(--ds-overlay, ".concat("0 4px 8px -2px ".concat(_colors.N50A, ", 0 0 1px ").concat(_colors.N60A), ")"),
|
|
42
|
+
dark: "var(--ds-overlay, ".concat("0 4px 8px -2px ".concat(_colors.DN50A, ", 0 0 1px ").concat(_colors.DN60A), ")")
|
|
45
43
|
});
|
|
46
44
|
var borderRadius = (0, _constants.borderRadius)();
|
|
47
45
|
var gridSize = (0, _constants.gridSize)();
|
package/dist/cjs/version.json
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
2
|
import React, { memo, useCallback, useEffect, useRef } from 'react';
|
|
3
3
|
import { jsx } from '@emotion/core';
|
|
4
|
+
import { bind } from 'bind-event-listener';
|
|
4
5
|
import NodeResolver from 'react-node-resolver';
|
|
5
6
|
import { createAndFireEvent, withAnalyticsContext, withAnalyticsEvents } from '@atlaskit/analytics-next';
|
|
6
7
|
import noop from '@atlaskit/ds-lib/noop';
|
|
7
8
|
import { Manager, Popper, Reference } from '@atlaskit/popper';
|
|
8
9
|
import { Container } from './styled/container';
|
|
9
10
|
const packageName = "@atlaskit/inline-dialog";
|
|
10
|
-
const packageVersion = "13.1.
|
|
11
|
+
const packageVersion = "13.1.9";
|
|
11
12
|
|
|
12
13
|
const checkIsChildOfPortal = node => {
|
|
13
14
|
if (!node) {
|
|
@@ -69,16 +70,33 @@ const InlineDialog = /*#__PURE__*/memo(function InlineDialog({
|
|
|
69
70
|
}
|
|
70
71
|
}, [onClose]);
|
|
71
72
|
useEffect(() => {
|
|
72
|
-
if (isOpen) {
|
|
73
|
-
|
|
74
|
-
capture: false
|
|
75
|
-
});
|
|
76
|
-
return () => {
|
|
77
|
-
window.removeEventListener('click', handleClickOutside, {
|
|
78
|
-
capture: false
|
|
79
|
-
});
|
|
80
|
-
};
|
|
73
|
+
if (!isOpen) {
|
|
74
|
+
return;
|
|
81
75
|
}
|
|
76
|
+
|
|
77
|
+
let unbind; // Under most circumstances, `useEffect` should run after an event has ended
|
|
78
|
+
// In this particular case, the popperjs library has a setState inside of a ref,
|
|
79
|
+
// which cases `useEffect` to run synchronously instead. To avoid this, we use a
|
|
80
|
+
// `setTimeout` so `useEffect` after the event. We only want to start listening
|
|
81
|
+
// for clicks after the original click event that triggered the dialog
|
|
82
|
+
// has finished. You can see more in the Codesandbox here:
|
|
83
|
+
// https://codesandbox.io/s/useeffect-and-event-timing-refs-in-state-5tys3?file=/src/App.tsx
|
|
84
|
+
|
|
85
|
+
const timeoutId = setTimeout(() => {
|
|
86
|
+
unbind = bind(window, {
|
|
87
|
+
type: 'click',
|
|
88
|
+
listener: event => handleClickOutside(event),
|
|
89
|
+
options: {
|
|
90
|
+
capture: false
|
|
91
|
+
}
|
|
92
|
+
});
|
|
93
|
+
});
|
|
94
|
+
return () => {
|
|
95
|
+
var _unbind;
|
|
96
|
+
|
|
97
|
+
window.clearTimeout(timeoutId);
|
|
98
|
+
(_unbind = unbind) === null || _unbind === void 0 ? void 0 : _unbind();
|
|
99
|
+
};
|
|
82
100
|
}, [handleClickOutside, isOpen]);
|
|
83
101
|
const popper = isOpen ? jsx(Popper, {
|
|
84
102
|
placement: placement
|
|
@@ -8,18 +8,17 @@ import { css, jsx } from '@emotion/core';
|
|
|
8
8
|
import { DN50, DN50A, DN600, DN60A, N0, N50A, N60A, N900 } from '@atlaskit/theme/colors';
|
|
9
9
|
import { themed, useGlobalTheme } from '@atlaskit/theme/components';
|
|
10
10
|
import { borderRadius as getBorderRadius, gridSize as getGridSize, layers } from '@atlaskit/theme/constants';
|
|
11
|
-
import { token } from '@atlaskit/tokens';
|
|
12
11
|
const themedBackground = themed({
|
|
13
|
-
light:
|
|
14
|
-
dark:
|
|
12
|
+
light: `var(--ds-background-overlay, ${N0})`,
|
|
13
|
+
dark: `var(--ds-background-overlay, ${DN50})`
|
|
15
14
|
});
|
|
16
15
|
const themedColor = themed({
|
|
17
|
-
light:
|
|
18
|
-
dark:
|
|
16
|
+
light: `var(--ds-text-highEmphasis, ${N900})`,
|
|
17
|
+
dark: `var(--ds-text-highEmphasis, ${DN600})`
|
|
19
18
|
});
|
|
20
19
|
const themedBoxShadow = themed({
|
|
21
|
-
light:
|
|
22
|
-
dark:
|
|
20
|
+
light: `var(--ds-overlay, ${`0 4px 8px -2px ${N50A}, 0 0 1px ${N60A}`})`,
|
|
21
|
+
dark: `var(--ds-overlay, ${`0 4px 8px -2px ${DN50A}, 0 0 1px ${DN60A}`})`
|
|
23
22
|
});
|
|
24
23
|
const borderRadius = getBorderRadius();
|
|
25
24
|
const gridSize = getGridSize();
|
package/dist/es2019/version.json
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
2
|
import React, { memo, useCallback, useEffect, useRef } from 'react';
|
|
3
3
|
import { jsx } from '@emotion/core';
|
|
4
|
+
import { bind } from 'bind-event-listener';
|
|
4
5
|
import NodeResolver from 'react-node-resolver';
|
|
5
6
|
import { createAndFireEvent, withAnalyticsContext, withAnalyticsEvents } from '@atlaskit/analytics-next';
|
|
6
7
|
import noop from '@atlaskit/ds-lib/noop';
|
|
7
8
|
import { Manager, Popper, Reference } from '@atlaskit/popper';
|
|
8
9
|
import { Container } from './styled/container';
|
|
9
10
|
var packageName = "@atlaskit/inline-dialog";
|
|
10
|
-
var packageVersion = "13.1.
|
|
11
|
+
var packageVersion = "13.1.9";
|
|
11
12
|
|
|
12
13
|
var checkIsChildOfPortal = function checkIsChildOfPortal(node) {
|
|
13
14
|
if (!node) {
|
|
@@ -72,16 +73,35 @@ var InlineDialog = /*#__PURE__*/memo(function InlineDialog(_ref) {
|
|
|
72
73
|
}
|
|
73
74
|
}, [onClose]);
|
|
74
75
|
useEffect(function () {
|
|
75
|
-
if (isOpen) {
|
|
76
|
-
|
|
77
|
-
capture: false
|
|
78
|
-
});
|
|
79
|
-
return function () {
|
|
80
|
-
window.removeEventListener('click', handleClickOutside, {
|
|
81
|
-
capture: false
|
|
82
|
-
});
|
|
83
|
-
};
|
|
76
|
+
if (!isOpen) {
|
|
77
|
+
return;
|
|
84
78
|
}
|
|
79
|
+
|
|
80
|
+
var unbind; // Under most circumstances, `useEffect` should run after an event has ended
|
|
81
|
+
// In this particular case, the popperjs library has a setState inside of a ref,
|
|
82
|
+
// which cases `useEffect` to run synchronously instead. To avoid this, we use a
|
|
83
|
+
// `setTimeout` so `useEffect` after the event. We only want to start listening
|
|
84
|
+
// for clicks after the original click event that triggered the dialog
|
|
85
|
+
// has finished. You can see more in the Codesandbox here:
|
|
86
|
+
// https://codesandbox.io/s/useeffect-and-event-timing-refs-in-state-5tys3?file=/src/App.tsx
|
|
87
|
+
|
|
88
|
+
var timeoutId = setTimeout(function () {
|
|
89
|
+
unbind = bind(window, {
|
|
90
|
+
type: 'click',
|
|
91
|
+
listener: function listener(event) {
|
|
92
|
+
return handleClickOutside(event);
|
|
93
|
+
},
|
|
94
|
+
options: {
|
|
95
|
+
capture: false
|
|
96
|
+
}
|
|
97
|
+
});
|
|
98
|
+
});
|
|
99
|
+
return function () {
|
|
100
|
+
var _unbind;
|
|
101
|
+
|
|
102
|
+
window.clearTimeout(timeoutId);
|
|
103
|
+
(_unbind = unbind) === null || _unbind === void 0 ? void 0 : _unbind();
|
|
104
|
+
};
|
|
85
105
|
}, [handleClickOutside, isOpen]);
|
|
86
106
|
var popper = isOpen ? jsx(Popper, {
|
|
87
107
|
placement: placement
|
|
@@ -14,18 +14,17 @@ import { css, jsx } from '@emotion/core';
|
|
|
14
14
|
import { DN50, DN50A, DN600, DN60A, N0, N50A, N60A, N900 } from '@atlaskit/theme/colors';
|
|
15
15
|
import { themed, useGlobalTheme } from '@atlaskit/theme/components';
|
|
16
16
|
import { borderRadius as getBorderRadius, gridSize as getGridSize, layers } from '@atlaskit/theme/constants';
|
|
17
|
-
import { token } from '@atlaskit/tokens';
|
|
18
17
|
var themedBackground = themed({
|
|
19
|
-
light:
|
|
20
|
-
dark:
|
|
18
|
+
light: "var(--ds-background-overlay, ".concat(N0, ")"),
|
|
19
|
+
dark: "var(--ds-background-overlay, ".concat(DN50, ")")
|
|
21
20
|
});
|
|
22
21
|
var themedColor = themed({
|
|
23
|
-
light:
|
|
24
|
-
dark:
|
|
22
|
+
light: "var(--ds-text-highEmphasis, ".concat(N900, ")"),
|
|
23
|
+
dark: "var(--ds-text-highEmphasis, ".concat(DN600, ")")
|
|
25
24
|
});
|
|
26
25
|
var themedBoxShadow = themed({
|
|
27
|
-
light:
|
|
28
|
-
dark:
|
|
26
|
+
light: "var(--ds-overlay, ".concat("0 4px 8px -2px ".concat(N50A, ", 0 0 1px ").concat(N60A), ")"),
|
|
27
|
+
dark: "var(--ds-overlay, ".concat("0 4px 8px -2px ".concat(DN50A, ", 0 0 1px ").concat(DN60A), ")")
|
|
29
28
|
});
|
|
30
29
|
var borderRadius = getBorderRadius();
|
|
31
30
|
var gridSize = getGridSize();
|
package/dist/esm/version.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/inline-dialog",
|
|
3
|
-
"version": "13.1.
|
|
3
|
+
"version": "13.1.9",
|
|
4
4
|
"description": "An inline dialog is a pop-up container for small amounts of information. It can also contain controls.",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -28,9 +28,10 @@
|
|
|
28
28
|
"@atlaskit/ds-lib": "^1.3.0",
|
|
29
29
|
"@atlaskit/popper": "^5.0.0",
|
|
30
30
|
"@atlaskit/theme": "^12.0.0",
|
|
31
|
-
"@atlaskit/tokens": "^0.
|
|
31
|
+
"@atlaskit/tokens": "^0.4.0",
|
|
32
32
|
"@babel/runtime": "^7.0.0",
|
|
33
33
|
"@emotion/core": "^10.0.9",
|
|
34
|
+
"bind-event-listener": "^1.0.2",
|
|
34
35
|
"react-node-resolver": "^1.0.1"
|
|
35
36
|
},
|
|
36
37
|
"peerDependencies": {
|
|
@@ -39,13 +40,12 @@
|
|
|
39
40
|
"devDependencies": {
|
|
40
41
|
"@atlaskit/build-utils": "*",
|
|
41
42
|
"@atlaskit/button": "^16.1.0",
|
|
42
|
-
"@atlaskit/datetime-picker": "^11.
|
|
43
|
+
"@atlaskit/datetime-picker": "^11.1.0",
|
|
43
44
|
"@atlaskit/docs": "*",
|
|
44
45
|
"@atlaskit/icon": "^21.9.0",
|
|
45
|
-
"@atlaskit/modal-dialog": "^12.0
|
|
46
|
+
"@atlaskit/modal-dialog": "^12.2.0",
|
|
46
47
|
"@atlaskit/section-message": "^6.1.0",
|
|
47
48
|
"@atlaskit/select": "^15.0.0",
|
|
48
|
-
"@atlaskit/single-select": "^10.0.0",
|
|
49
49
|
"@atlaskit/ssr": "*",
|
|
50
50
|
"@atlaskit/visual-regression": "*",
|
|
51
51
|
"@atlaskit/webdriver-runner": "*",
|
|
@@ -69,10 +69,13 @@
|
|
|
69
69
|
"@repo/internal": {
|
|
70
70
|
"analytics": "analytics-next",
|
|
71
71
|
"theming": [
|
|
72
|
-
"
|
|
72
|
+
"react-context",
|
|
73
73
|
"tokens"
|
|
74
74
|
],
|
|
75
|
-
"styling":
|
|
75
|
+
"styling": [
|
|
76
|
+
"static",
|
|
77
|
+
"emotion"
|
|
78
|
+
],
|
|
76
79
|
"design-system": "v1",
|
|
77
80
|
"deprecation": "no-deprecated-imports"
|
|
78
81
|
}
|