@atlaskit/onboarding 10.6.7 → 10.6.8
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 +6 -0
- package/dist/cjs/components/animation.js +2 -13
- package/dist/cjs/components/clone.js +10 -16
- package/dist/cjs/components/index.js +0 -9
- package/dist/cjs/components/modal.js +11 -45
- package/dist/cjs/components/spotlight-card.js +26 -46
- package/dist/cjs/components/spotlight-dialog.js +19 -52
- package/dist/cjs/components/spotlight-inner.js +9 -44
- package/dist/cjs/components/spotlight-manager.js +8 -41
- package/dist/cjs/components/spotlight-target.js +1 -7
- package/dist/cjs/components/spotlight-transition.js +3 -27
- package/dist/cjs/components/spotlight.js +10 -19
- package/dist/cjs/components/theme.js +9 -32
- package/dist/cjs/components/use-spotlight.js +1 -5
- package/dist/cjs/components/value-changed.js +0 -14
- package/dist/cjs/index.js +0 -4
- package/dist/cjs/styled/blanket.js +3 -13
- package/dist/cjs/styled/dialog.js +6 -17
- package/dist/cjs/styled/modal.js +19 -33
- package/dist/cjs/styled/target.js +27 -41
- package/dist/cjs/utils/use-element-box.js +14 -26
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/components/animation.js +2 -2
- package/dist/es2019/components/clone.js +3 -6
- package/dist/es2019/components/modal.js +3 -10
- package/dist/es2019/components/spotlight-card.js +7 -11
- package/dist/es2019/components/spotlight-dialog.js +6 -11
- package/dist/es2019/components/spotlight-inner.js +2 -12
- package/dist/es2019/components/spotlight-manager.js +3 -13
- package/dist/es2019/components/spotlight-target.js +0 -2
- package/dist/es2019/components/spotlight-transition.js +4 -10
- package/dist/es2019/components/spotlight.js +0 -2
- package/dist/es2019/components/theme.js +6 -9
- package/dist/es2019/components/use-spotlight.js +1 -1
- package/dist/es2019/components/value-changed.js +0 -2
- package/dist/es2019/styled/blanket.js +5 -5
- package/dist/es2019/styled/dialog.js +5 -7
- package/dist/es2019/styled/modal.js +15 -14
- package/dist/es2019/styled/target.js +16 -15
- package/dist/es2019/utils/use-element-box.js +2 -5
- package/dist/es2019/version.json +1 -1
- package/dist/esm/components/animation.js +2 -8
- package/dist/esm/components/clone.js +10 -13
- package/dist/esm/components/modal.js +13 -32
- package/dist/esm/components/spotlight-card.js +26 -32
- package/dist/esm/components/spotlight-dialog.js +19 -35
- package/dist/esm/components/spotlight-inner.js +9 -29
- package/dist/esm/components/spotlight-manager.js +8 -32
- package/dist/esm/components/spotlight-target.js +1 -3
- package/dist/esm/components/spotlight-transition.js +3 -18
- package/dist/esm/components/spotlight.js +10 -13
- package/dist/esm/components/theme.js +9 -20
- package/dist/esm/components/use-spotlight.js +2 -3
- package/dist/esm/components/value-changed.js +0 -10
- package/dist/esm/styled/blanket.js +3 -7
- package/dist/esm/styled/dialog.js +6 -9
- package/dist/esm/styled/modal.js +18 -19
- package/dist/esm/styled/target.js +27 -32
- package/dist/esm/utils/use-element-box.js +14 -19
- package/dist/esm/version.json +1 -1
- package/package.json +1 -1
|
@@ -6,15 +6,10 @@ import _inherits from "@babel/runtime/helpers/inherits";
|
|
|
6
6
|
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
7
7
|
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
8
8
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
9
|
-
|
|
10
9
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
11
|
-
|
|
12
10
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
13
|
-
|
|
14
11
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
15
|
-
|
|
16
12
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
17
|
-
|
|
18
13
|
import React from 'react';
|
|
19
14
|
import { canUseDOM } from 'exenv';
|
|
20
15
|
import NodeResovler from 'react-node-resolver';
|
|
@@ -27,7 +22,6 @@ import { Fade } from './animation';
|
|
|
27
22
|
import Clone from './clone';
|
|
28
23
|
import SpotlightDialog from './spotlight-dialog';
|
|
29
24
|
import { SpotlightTransitionConsumer } from './spotlight-transition';
|
|
30
|
-
|
|
31
25
|
/**
|
|
32
26
|
* __Spotlight inner__
|
|
33
27
|
*
|
|
@@ -37,20 +31,14 @@ import { SpotlightTransitionConsumer } from './spotlight-transition';
|
|
|
37
31
|
*/
|
|
38
32
|
var SpotlightInner = /*#__PURE__*/function (_React$Component) {
|
|
39
33
|
_inherits(SpotlightInner, _React$Component);
|
|
40
|
-
|
|
41
34
|
var _super = _createSuper(SpotlightInner);
|
|
42
|
-
|
|
43
35
|
function SpotlightInner() {
|
|
44
36
|
var _this;
|
|
45
|
-
|
|
46
37
|
_classCallCheck(this, SpotlightInner);
|
|
47
|
-
|
|
48
38
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
49
39
|
args[_key] = arguments[_key];
|
|
50
40
|
}
|
|
51
|
-
|
|
52
41
|
_this = _super.call.apply(_super, [this].concat(args));
|
|
53
|
-
|
|
54
42
|
_defineProperty(_assertThisInitialized(_this), "state", {
|
|
55
43
|
// This is only used when targetReplacement is specified.
|
|
56
44
|
// In this case, we have to render the targetReplacement component,
|
|
@@ -58,20 +46,16 @@ var SpotlightInner = /*#__PURE__*/function (_React$Component) {
|
|
|
58
46
|
// that reference into SpotlightDialog (Popper).
|
|
59
47
|
replacementElement: null
|
|
60
48
|
});
|
|
61
|
-
|
|
62
49
|
_defineProperty(_assertThisInitialized(_this), "getTargetNodeStyle", function (box) {
|
|
63
50
|
if (!canUseDOM) {
|
|
64
51
|
return {};
|
|
65
52
|
}
|
|
66
|
-
|
|
67
53
|
return _objectSpread(_objectSpread({}, box), {}, {
|
|
68
54
|
position: 'fixed'
|
|
69
55
|
});
|
|
70
56
|
});
|
|
71
|
-
|
|
72
57
|
return _this;
|
|
73
58
|
}
|
|
74
|
-
|
|
75
59
|
_createClass(SpotlightInner, [{
|
|
76
60
|
key: "componentDidUpdate",
|
|
77
61
|
value: function componentDidUpdate(prevProps) {
|
|
@@ -98,20 +82,19 @@ var SpotlightInner = /*#__PURE__*/function (_React$Component) {
|
|
|
98
82
|
key: "render",
|
|
99
83
|
value: function render() {
|
|
100
84
|
var _this2 = this;
|
|
101
|
-
|
|
102
85
|
var _this$props = this.props,
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
86
|
+
pulse = _this$props.pulse,
|
|
87
|
+
target = _this$props.target,
|
|
88
|
+
targetNode = _this$props.targetNode,
|
|
89
|
+
targetBgColor = _this$props.targetBgColor,
|
|
90
|
+
targetOnClick = _this$props.targetOnClick,
|
|
91
|
+
targetRadius = _this$props.targetRadius,
|
|
92
|
+
testId = _this$props.testId,
|
|
93
|
+
TargetReplacement = _this$props.targetReplacement;
|
|
111
94
|
var replacementElement = this.state.replacementElement;
|
|
112
95
|
return /*#__PURE__*/React.createElement(SpotlightTransitionConsumer, null, function (_ref) {
|
|
113
96
|
var isOpen = _ref.isOpen,
|
|
114
|
-
|
|
97
|
+
onExited = _ref.onExited;
|
|
115
98
|
return /*#__PURE__*/React.createElement(Portal, {
|
|
116
99
|
zIndex: layers.spotlight() + 1
|
|
117
100
|
}, TargetReplacement ? /*#__PURE__*/React.createElement(NodeResovler, {
|
|
@@ -162,13 +145,10 @@ var SpotlightInner = /*#__PURE__*/function (_React$Component) {
|
|
|
162
145
|
});
|
|
163
146
|
}
|
|
164
147
|
}]);
|
|
165
|
-
|
|
166
148
|
return SpotlightInner;
|
|
167
149
|
}(React.Component);
|
|
168
|
-
|
|
169
150
|
_defineProperty(SpotlightInner, "defaultProps", {
|
|
170
151
|
dialogWidth: 400,
|
|
171
152
|
pulse: true
|
|
172
153
|
});
|
|
173
|
-
|
|
174
154
|
export default SpotlightInner;
|
|
@@ -5,15 +5,10 @@ import _inherits from "@babel/runtime/helpers/inherits";
|
|
|
5
5
|
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
6
6
|
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
7
7
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
8
|
-
|
|
9
8
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
10
|
-
|
|
11
9
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
12
|
-
|
|
13
10
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
14
|
-
|
|
15
11
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
16
|
-
|
|
17
12
|
import React, { createContext, PureComponent } from 'react';
|
|
18
13
|
import memoizeOne from 'memoize-one';
|
|
19
14
|
import noop from '@atlaskit/ds-lib/noop';
|
|
@@ -21,26 +16,24 @@ import Portal from '@atlaskit/portal';
|
|
|
21
16
|
import { layers } from '@atlaskit/theme/constants';
|
|
22
17
|
import Blanket from '../styled/blanket';
|
|
23
18
|
import { Fade } from './animation';
|
|
24
|
-
|
|
25
19
|
var _createContext = /*#__PURE__*/createContext(undefined),
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
20
|
+
TargetConsumer = _createContext.Consumer,
|
|
21
|
+
TargetProvider = _createContext.Provider;
|
|
29
22
|
var SpotlightContext = /*#__PURE__*/createContext({
|
|
30
23
|
opened: noop,
|
|
31
24
|
closed: noop,
|
|
32
25
|
targets: {}
|
|
33
26
|
});
|
|
34
27
|
var SpotlightStateConsumer = SpotlightContext.Consumer,
|
|
35
|
-
|
|
28
|
+
SpotlightStateProvider = SpotlightContext.Provider;
|
|
36
29
|
export { TargetConsumer };
|
|
37
30
|
export { SpotlightContext, SpotlightStateConsumer as SpotlightConsumer };
|
|
38
|
-
|
|
39
31
|
var Container = function Container(_ref) {
|
|
40
32
|
var Wrapper = _ref.component,
|
|
41
|
-
|
|
33
|
+
children = _ref.children;
|
|
42
34
|
return /*#__PURE__*/React.createElement(Wrapper, null, children);
|
|
43
35
|
};
|
|
36
|
+
|
|
44
37
|
/**
|
|
45
38
|
* __Spotlight manager__
|
|
46
39
|
*
|
|
@@ -50,29 +43,20 @@ var Container = function Container(_ref) {
|
|
|
50
43
|
* - [Code](https://atlassian.design/components/onboarding/code)
|
|
51
44
|
* - [Usage](https://atlassian.design/components/onboarding/usage)
|
|
52
45
|
*/
|
|
53
|
-
|
|
54
|
-
|
|
55
46
|
var SpotlightManager = /*#__PURE__*/function (_PureComponent) {
|
|
56
47
|
_inherits(SpotlightManager, _PureComponent);
|
|
57
|
-
|
|
58
48
|
var _super = _createSuper(SpotlightManager);
|
|
59
|
-
|
|
60
49
|
function SpotlightManager() {
|
|
61
50
|
var _this;
|
|
62
|
-
|
|
63
51
|
_classCallCheck(this, SpotlightManager);
|
|
64
|
-
|
|
65
52
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
66
53
|
args[_key] = arguments[_key];
|
|
67
54
|
}
|
|
68
|
-
|
|
69
55
|
_this = _super.call.apply(_super, [this].concat(args));
|
|
70
|
-
|
|
71
56
|
_defineProperty(_assertThisInitialized(_this), "state", {
|
|
72
57
|
spotlightCount: 0,
|
|
73
58
|
targets: {}
|
|
74
59
|
});
|
|
75
|
-
|
|
76
60
|
_defineProperty(_assertThisInitialized(_this), "targetRef", function (name) {
|
|
77
61
|
return function (element) {
|
|
78
62
|
_this.setState(function (state) {
|
|
@@ -82,7 +66,6 @@ var SpotlightManager = /*#__PURE__*/function (_PureComponent) {
|
|
|
82
66
|
});
|
|
83
67
|
};
|
|
84
68
|
});
|
|
85
|
-
|
|
86
69
|
_defineProperty(_assertThisInitialized(_this), "spotlightOpen", function () {
|
|
87
70
|
_this.setState(function (state) {
|
|
88
71
|
return {
|
|
@@ -90,7 +73,6 @@ var SpotlightManager = /*#__PURE__*/function (_PureComponent) {
|
|
|
90
73
|
};
|
|
91
74
|
});
|
|
92
75
|
});
|
|
93
|
-
|
|
94
76
|
_defineProperty(_assertThisInitialized(_this), "spotlightClose", function () {
|
|
95
77
|
_this.setState(function (state) {
|
|
96
78
|
return {
|
|
@@ -98,7 +80,6 @@ var SpotlightManager = /*#__PURE__*/function (_PureComponent) {
|
|
|
98
80
|
};
|
|
99
81
|
});
|
|
100
82
|
});
|
|
101
|
-
|
|
102
83
|
_defineProperty(_assertThisInitialized(_this), "getStateProviderValue", memoizeOne(function (targets) {
|
|
103
84
|
return {
|
|
104
85
|
opened: _this.spotlightOpen,
|
|
@@ -106,10 +87,8 @@ var SpotlightManager = /*#__PURE__*/function (_PureComponent) {
|
|
|
106
87
|
targets: targets
|
|
107
88
|
};
|
|
108
89
|
}));
|
|
109
|
-
|
|
110
90
|
return _this;
|
|
111
91
|
}
|
|
112
|
-
|
|
113
92
|
_createClass(SpotlightManager, [{
|
|
114
93
|
key: "componentDidMount",
|
|
115
94
|
value: function componentDidMount() {
|
|
@@ -124,9 +103,9 @@ var SpotlightManager = /*#__PURE__*/function (_PureComponent) {
|
|
|
124
103
|
key: "render",
|
|
125
104
|
value: function render() {
|
|
126
105
|
var _this$props = this.props,
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
106
|
+
blanketIsTinted = _this$props.blanketIsTinted,
|
|
107
|
+
children = _this$props.children,
|
|
108
|
+
Tag = _this$props.component;
|
|
130
109
|
return /*#__PURE__*/React.createElement(SpotlightStateProvider, {
|
|
131
110
|
value: this.getStateProviderValue(this.state.targets)
|
|
132
111
|
}, /*#__PURE__*/React.createElement(TargetProvider, {
|
|
@@ -145,12 +124,9 @@ var SpotlightManager = /*#__PURE__*/function (_PureComponent) {
|
|
|
145
124
|
}), children)));
|
|
146
125
|
}
|
|
147
126
|
}]);
|
|
148
|
-
|
|
149
127
|
return SpotlightManager;
|
|
150
128
|
}(PureComponent);
|
|
151
|
-
|
|
152
129
|
_defineProperty(SpotlightManager, "defaultProps", {
|
|
153
130
|
blanketIsTinted: true
|
|
154
131
|
});
|
|
155
|
-
|
|
156
132
|
export { SpotlightManager as default };
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import NodeResolver from 'react-node-resolver';
|
|
3
3
|
import { TargetConsumer } from './spotlight-manager';
|
|
4
|
-
|
|
5
4
|
/**
|
|
6
5
|
* __Spotlight target__
|
|
7
6
|
*
|
|
@@ -13,12 +12,11 @@ import { TargetConsumer } from './spotlight-manager';
|
|
|
13
12
|
*/
|
|
14
13
|
var SpotlightTarget = function SpotlightTarget(_ref) {
|
|
15
14
|
var children = _ref.children,
|
|
16
|
-
|
|
15
|
+
name = _ref.name;
|
|
17
16
|
return /*#__PURE__*/React.createElement(TargetConsumer, null, function (targetRef) {
|
|
18
17
|
return targetRef ? /*#__PURE__*/React.createElement(NodeResolver, {
|
|
19
18
|
innerRef: targetRef(name)
|
|
20
19
|
}, children) : children;
|
|
21
20
|
});
|
|
22
21
|
};
|
|
23
|
-
|
|
24
22
|
export default SpotlightTarget;
|
|
@@ -5,23 +5,22 @@ import _inherits from "@babel/runtime/helpers/inherits";
|
|
|
5
5
|
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
6
6
|
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
7
7
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
8
|
-
|
|
9
8
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
10
|
-
|
|
11
9
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
12
|
-
|
|
13
10
|
import React, { createContext } from 'react';
|
|
14
11
|
import noop from '@atlaskit/ds-lib/noop';
|
|
15
12
|
var SpotlightTransitionContext = /*#__PURE__*/createContext({
|
|
16
13
|
isOpen: true,
|
|
17
14
|
onExited: noop
|
|
18
|
-
});
|
|
15
|
+
});
|
|
19
16
|
|
|
17
|
+
// checks if children exist and are truthy
|
|
20
18
|
var hasChildren = function hasChildren(children) {
|
|
21
19
|
return React.Children.count(children) > 0 && React.Children.map(children, function (child) {
|
|
22
20
|
return !!child;
|
|
23
21
|
}).filter(Boolean).length > 0;
|
|
24
22
|
};
|
|
23
|
+
|
|
25
24
|
/**
|
|
26
25
|
* __Spotlight transition__
|
|
27
26
|
*
|
|
@@ -31,37 +30,26 @@ var hasChildren = function hasChildren(children) {
|
|
|
31
30
|
* - [Code](https://atlassian.design/components/onboarding/code)
|
|
32
31
|
* - [Usage](https://atlassian.design/components/onboarding/usage)
|
|
33
32
|
*/
|
|
34
|
-
|
|
35
|
-
|
|
36
33
|
var SpotlightTransition = /*#__PURE__*/function (_React$Component) {
|
|
37
34
|
_inherits(SpotlightTransition, _React$Component);
|
|
38
|
-
|
|
39
35
|
var _super = _createSuper(SpotlightTransition);
|
|
40
|
-
|
|
41
36
|
function SpotlightTransition() {
|
|
42
37
|
var _this;
|
|
43
|
-
|
|
44
38
|
_classCallCheck(this, SpotlightTransition);
|
|
45
|
-
|
|
46
39
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
47
40
|
args[_key] = arguments[_key];
|
|
48
41
|
}
|
|
49
|
-
|
|
50
42
|
_this = _super.call.apply(_super, [this].concat(args));
|
|
51
|
-
|
|
52
43
|
_defineProperty(_assertThisInitialized(_this), "state", {
|
|
53
44
|
currentChildren: undefined
|
|
54
45
|
});
|
|
55
|
-
|
|
56
46
|
_defineProperty(_assertThisInitialized(_this), "onExited", function () {
|
|
57
47
|
_this.setState({
|
|
58
48
|
currentChildren: _this.props.children
|
|
59
49
|
});
|
|
60
50
|
});
|
|
61
|
-
|
|
62
51
|
return _this;
|
|
63
52
|
}
|
|
64
|
-
|
|
65
53
|
_createClass(SpotlightTransition, [{
|
|
66
54
|
key: "render",
|
|
67
55
|
value: function render() {
|
|
@@ -82,7 +70,6 @@ var SpotlightTransition = /*#__PURE__*/function (_React$Component) {
|
|
|
82
70
|
};
|
|
83
71
|
}
|
|
84
72
|
}]);
|
|
85
|
-
|
|
86
73
|
return SpotlightTransition;
|
|
87
74
|
}(React.Component);
|
|
88
75
|
/**
|
|
@@ -92,7 +79,5 @@ var SpotlightTransition = /*#__PURE__*/function (_React$Component) {
|
|
|
92
79
|
*
|
|
93
80
|
* @internal
|
|
94
81
|
*/
|
|
95
|
-
|
|
96
|
-
|
|
97
82
|
export var SpotlightTransitionConsumer = SpotlightTransitionContext.Consumer;
|
|
98
83
|
export default SpotlightTransition;
|
|
@@ -4,7 +4,6 @@ var _excluded = ["dialogWidth", "pulse", "testId", "targetNode", "target"];
|
|
|
4
4
|
import React from 'react';
|
|
5
5
|
import SpotlightInner from './spotlight-inner';
|
|
6
6
|
import { SpotlightConsumer } from './spotlight-manager';
|
|
7
|
-
|
|
8
7
|
/**
|
|
9
8
|
* __Spotlight__
|
|
10
9
|
*
|
|
@@ -16,19 +15,18 @@ import { SpotlightConsumer } from './spotlight-manager';
|
|
|
16
15
|
*/
|
|
17
16
|
var Spotlight = function Spotlight(_ref) {
|
|
18
17
|
var _ref$dialogWidth = _ref.dialogWidth,
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
18
|
+
dialogWidth = _ref$dialogWidth === void 0 ? 400 : _ref$dialogWidth,
|
|
19
|
+
_ref$pulse = _ref.pulse,
|
|
20
|
+
pulse = _ref$pulse === void 0 ? true : _ref$pulse,
|
|
21
|
+
_ref$testId = _ref.testId,
|
|
22
|
+
testId = _ref$testId === void 0 ? 'spotlight' : _ref$testId,
|
|
23
|
+
targetNode = _ref.targetNode,
|
|
24
|
+
target = _ref.target,
|
|
25
|
+
rest = _objectWithoutProperties(_ref, _excluded);
|
|
28
26
|
return /*#__PURE__*/React.createElement(SpotlightConsumer, null, function (_ref2) {
|
|
29
27
|
var opened = _ref2.opened,
|
|
30
|
-
|
|
31
|
-
|
|
28
|
+
closed = _ref2.closed,
|
|
29
|
+
targets = _ref2.targets;
|
|
32
30
|
// use the targetNode prop or try get the target from context targets using name
|
|
33
31
|
var actualTargetNode = targetNode || (typeof target === 'string' ? targets[target] : undefined);
|
|
34
32
|
return actualTargetNode ? /*#__PURE__*/React.createElement(SpotlightInner, _extends({}, rest, {
|
|
@@ -42,5 +40,4 @@ var Spotlight = function Spotlight(_ref) {
|
|
|
42
40
|
})) : null;
|
|
43
41
|
});
|
|
44
42
|
};
|
|
45
|
-
|
|
46
43
|
export default Spotlight;
|
|
@@ -2,12 +2,9 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
|
2
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
3
|
import _typeof from "@babel/runtime/helpers/typeof";
|
|
4
4
|
var _excluded = ["buttonStyles"],
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
_excluded2 = ["buttonStyles"];
|
|
7
6
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
8
|
-
|
|
9
7
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
10
|
-
|
|
11
8
|
import * as colors from '@atlaskit/theme/colors';
|
|
12
9
|
var spotlightTheme = {
|
|
13
10
|
default: {
|
|
@@ -117,16 +114,13 @@ var modalTheme = {
|
|
|
117
114
|
}
|
|
118
115
|
}
|
|
119
116
|
};
|
|
120
|
-
|
|
121
117
|
function extract(newTheme, _ref) {
|
|
122
118
|
var mode = _ref.mode,
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
119
|
+
appearance = _ref.appearance,
|
|
120
|
+
state = _ref.state;
|
|
126
121
|
if (!newTheme[appearance]) {
|
|
127
122
|
return undefined;
|
|
128
123
|
}
|
|
129
|
-
|
|
130
124
|
var root = newTheme[appearance];
|
|
131
125
|
return Object.keys(root).reduce(function (acc, val) {
|
|
132
126
|
var node = root;
|
|
@@ -134,43 +128,38 @@ function extract(newTheme, _ref) {
|
|
|
134
128
|
if (!node[item]) {
|
|
135
129
|
return undefined;
|
|
136
130
|
}
|
|
137
|
-
|
|
138
131
|
if (_typeof(node[item]) !== 'object') {
|
|
139
132
|
acc[val] = node[item];
|
|
140
133
|
return undefined;
|
|
141
134
|
}
|
|
142
|
-
|
|
143
135
|
node = node[item];
|
|
144
136
|
return undefined;
|
|
145
137
|
});
|
|
146
138
|
return acc;
|
|
147
139
|
}, {});
|
|
148
140
|
}
|
|
141
|
+
|
|
149
142
|
/**
|
|
150
143
|
* @deprecated
|
|
151
144
|
* Custom button themes are deprecated and will be removed in the future.
|
|
152
145
|
*/
|
|
153
|
-
|
|
154
|
-
|
|
155
146
|
export var spotlightButtonTheme = function spotlightButtonTheme(current, themeProps) {
|
|
156
147
|
var _current = current(themeProps),
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
148
|
+
buttonStyles = _current.buttonStyles,
|
|
149
|
+
rest = _objectWithoutProperties(_current, _excluded);
|
|
160
150
|
return _objectSpread({
|
|
161
151
|
buttonStyles: _objectSpread(_objectSpread({}, buttonStyles), extract(spotlightTheme, themeProps))
|
|
162
152
|
}, rest);
|
|
163
153
|
};
|
|
154
|
+
|
|
164
155
|
/**
|
|
165
156
|
* @deprecated
|
|
166
157
|
* Custom button themes are deprecated and will be removed in the future.
|
|
167
158
|
*/
|
|
168
|
-
|
|
169
159
|
export var modalButtonTheme = function modalButtonTheme(current, themeProps) {
|
|
170
160
|
var _current2 = current(themeProps),
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
161
|
+
buttonStyles = _current2.buttonStyles,
|
|
162
|
+
rest = _objectWithoutProperties(_current2, _excluded2);
|
|
174
163
|
return _objectSpread({
|
|
175
164
|
buttonStyles: _objectSpread(_objectSpread({}, buttonStyles), extract(modalTheme, themeProps))
|
|
176
165
|
}, rest);
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
import { useCallback, useContext, useEffect, useMemo, useRef } from 'react';
|
|
2
2
|
import { SpotlightContext } from './spotlight-manager';
|
|
3
|
+
|
|
3
4
|
/**
|
|
4
5
|
* Use spotlight hook returns information about available spotlight targets.
|
|
5
6
|
*/
|
|
6
|
-
|
|
7
7
|
export default function useSpotlight() {
|
|
8
8
|
var _useContext = useContext(SpotlightContext),
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
targets = _useContext.targets;
|
|
11
10
|
var targetRef = useRef(targets);
|
|
12
11
|
useEffect(function () {
|
|
13
12
|
targetRef.current = targets;
|
|
@@ -3,28 +3,20 @@ import _createClass from "@babel/runtime/helpers/createClass";
|
|
|
3
3
|
import _inherits from "@babel/runtime/helpers/inherits";
|
|
4
4
|
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
5
5
|
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
6
|
-
|
|
7
6
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
8
|
-
|
|
9
7
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
10
|
-
|
|
11
8
|
import React from 'react';
|
|
12
|
-
|
|
13
9
|
// This component was born from the pain of using render props in lifecycle methods.
|
|
14
10
|
// On update, it checks whether the current value prop is equal to the previous value prop.
|
|
15
11
|
// If they are different, it calls the onChange function.
|
|
16
12
|
// We use this for updating Popper when the SpotlightDialog width changes.
|
|
17
13
|
var ValueChanged = /*#__PURE__*/function (_React$Component) {
|
|
18
14
|
_inherits(ValueChanged, _React$Component);
|
|
19
|
-
|
|
20
15
|
var _super = _createSuper(ValueChanged);
|
|
21
|
-
|
|
22
16
|
function ValueChanged() {
|
|
23
17
|
_classCallCheck(this, ValueChanged);
|
|
24
|
-
|
|
25
18
|
return _super.apply(this, arguments);
|
|
26
19
|
}
|
|
27
|
-
|
|
28
20
|
_createClass(ValueChanged, [{
|
|
29
21
|
key: "componentDidUpdate",
|
|
30
22
|
value: function componentDidUpdate(prevProps) {
|
|
@@ -38,8 +30,6 @@ var ValueChanged = /*#__PURE__*/function (_React$Component) {
|
|
|
38
30
|
return this.props.children;
|
|
39
31
|
}
|
|
40
32
|
}]);
|
|
41
|
-
|
|
42
33
|
return ValueChanged;
|
|
43
34
|
}(React.Component);
|
|
44
|
-
|
|
45
35
|
export { ValueChanged as default };
|
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
-
|
|
3
2
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
4
|
-
|
|
5
3
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
6
|
-
|
|
7
4
|
/** @jsx jsx */
|
|
8
5
|
import { css, jsx } from '@emotion/react';
|
|
9
6
|
import { DN90A, N100A } from '@atlaskit/theme/colors';
|
|
@@ -12,9 +9,10 @@ import { layers } from '@atlaskit/theme/constants';
|
|
|
12
9
|
var backgroundColor = themed({
|
|
13
10
|
light: "var(--ds-blanket, ".concat(N100A, ")"),
|
|
14
11
|
dark: "var(--ds-blanket, ".concat(DN90A, ")")
|
|
15
|
-
});
|
|
16
|
-
// to body instead of nearest stacking context (Portal in our case).
|
|
12
|
+
});
|
|
17
13
|
|
|
14
|
+
// IE11 and Edge: z-index needed because fixed position calculates z-index relative
|
|
15
|
+
// to body instead of nearest stacking context (Portal in our case).
|
|
18
16
|
var blanketStyles = css({
|
|
19
17
|
position: 'fixed',
|
|
20
18
|
zIndex: layers.spotlight(),
|
|
@@ -24,7 +22,6 @@ var blanketStyles = css({
|
|
|
24
22
|
left: 0,
|
|
25
23
|
transition: 'opacity 220ms'
|
|
26
24
|
});
|
|
27
|
-
|
|
28
25
|
/**
|
|
29
26
|
* __Blanket__
|
|
30
27
|
*
|
|
@@ -47,5 +44,4 @@ var Blanket = function Blanket(props) {
|
|
|
47
44
|
})
|
|
48
45
|
});
|
|
49
46
|
};
|
|
50
|
-
|
|
51
47
|
export default Blanket;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
3
|
var _excluded = ["alt"];
|
|
4
|
-
|
|
5
4
|
/** @jsx jsx */
|
|
6
5
|
import { css, jsx } from '@emotion/react';
|
|
7
6
|
var imageStyles = css({
|
|
@@ -10,15 +9,15 @@ var imageStyles = css({
|
|
|
10
9
|
});
|
|
11
10
|
var actionItemContainerStyles = css({
|
|
12
11
|
display: 'flex',
|
|
13
|
-
margin: "var(--ds-
|
|
14
|
-
|
|
12
|
+
margin: "var(--ds-space-0, 0px)".concat(" -4px"),
|
|
15
13
|
/* When there is more than one action, place primary action visually on the
|
|
16
14
|
right, but keep it's position as the first focusable element in the DOM */
|
|
17
15
|
flexDirection: 'row-reverse'
|
|
18
16
|
});
|
|
19
17
|
var actionItemStyles = css({
|
|
20
|
-
margin: "var(--ds-
|
|
18
|
+
margin: "var(--ds-space-0, 0px)".concat(" ", "var(--ds-space-050, 4px)")
|
|
21
19
|
});
|
|
20
|
+
|
|
22
21
|
/**
|
|
23
22
|
* __Dialog image__
|
|
24
23
|
*
|
|
@@ -26,16 +25,15 @@ var actionItemStyles = css({
|
|
|
26
25
|
*
|
|
27
26
|
* @internal
|
|
28
27
|
*/
|
|
29
|
-
|
|
30
28
|
export var DialogImage = function DialogImage(_ref) {
|
|
31
29
|
var alt = _ref.alt,
|
|
32
|
-
|
|
33
|
-
|
|
30
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
34
31
|
return jsx("img", _extends({
|
|
35
32
|
css: imageStyles,
|
|
36
33
|
alt: alt
|
|
37
34
|
}, props));
|
|
38
35
|
};
|
|
36
|
+
|
|
39
37
|
/**
|
|
40
38
|
* __Dialog action item container__
|
|
41
39
|
*
|
|
@@ -43,13 +41,13 @@ export var DialogImage = function DialogImage(_ref) {
|
|
|
43
41
|
*
|
|
44
42
|
* @internal
|
|
45
43
|
*/
|
|
46
|
-
|
|
47
44
|
export var DialogActionItemContainer = function DialogActionItemContainer(_ref2) {
|
|
48
45
|
var children = _ref2.children;
|
|
49
46
|
return jsx("div", {
|
|
50
47
|
css: actionItemContainerStyles
|
|
51
48
|
}, children);
|
|
52
49
|
};
|
|
50
|
+
|
|
53
51
|
/**
|
|
54
52
|
* __Dialog action item__
|
|
55
53
|
*
|
|
@@ -57,7 +55,6 @@ export var DialogActionItemContainer = function DialogActionItemContainer(_ref2)
|
|
|
57
55
|
*
|
|
58
56
|
* @internal
|
|
59
57
|
*/
|
|
60
|
-
|
|
61
58
|
export var DialogActionItem = function DialogActionItem(_ref3) {
|
|
62
59
|
var children = _ref3.children;
|
|
63
60
|
return jsx("div", {
|