@atlaskit/help-layout 4.4.5 → 4.4.7
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 +16 -0
- package/dist/cjs/analytics.js +1 -1
- package/dist/cjs/components/Header/BackButton.js +1 -1
- package/dist/cjs/components/Header/CloseButton.js +15 -2
- package/dist/cjs/components/Header/index.js +4 -2
- package/dist/cjs/components/Header/styled.js +26 -1
- package/dist/cjs/components/HelpLayoutContent.js +3 -1
- package/dist/es2019/analytics.js +1 -1
- package/dist/es2019/components/Header/BackButton.js +1 -1
- package/dist/es2019/components/Header/CloseButton.js +16 -3
- package/dist/es2019/components/Header/index.js +5 -3
- package/dist/es2019/components/Header/styled.js +25 -0
- package/dist/es2019/components/HelpLayoutContent.js +3 -1
- package/dist/esm/analytics.js +1 -1
- package/dist/esm/components/Header/BackButton.js +1 -1
- package/dist/esm/components/Header/CloseButton.js +16 -3
- package/dist/esm/components/Header/index.js +5 -3
- package/dist/esm/components/Header/styled.js +25 -0
- package/dist/esm/components/HelpLayoutContent.js +3 -1
- package/dist/types/components/Header/CloseButton.d.ts +1 -0
- package/dist/types/components/Header/styled.d.ts +8 -0
- package/dist/types/model/HelpLayout.d.ts +2 -0
- package/dist/types-ts4.5/components/Header/CloseButton.d.ts +1 -0
- package/dist/types-ts4.5/components/Header/styled.d.ts +8 -0
- package/dist/types-ts4.5/model/HelpLayout.d.ts +2 -0
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# @atlaskit/help-layout
|
|
2
2
|
|
|
3
|
+
## 4.4.7
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#107045](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/107045)
|
|
8
|
+
[`3c95bcb3b29aa`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/3c95bcb3b29aa) -
|
|
9
|
+
[ux] refactoring placement of title and close button in IPH header around the isAIEnabled prop
|
|
10
|
+
|
|
11
|
+
## 4.4.6
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- [#105756](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/105756)
|
|
16
|
+
[`1151bcad0025a`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/1151bcad0025a) -
|
|
17
|
+
[ux] refactoring placement of footer in IPH
|
|
18
|
+
|
|
3
19
|
## 4.4.5
|
|
4
20
|
|
|
5
21
|
### Patch Changes
|
package/dist/cjs/analytics.js
CHANGED
|
@@ -14,5 +14,5 @@ var createAndFire = exports.createAndFire = x.createAndFireEvent('atlaskit');
|
|
|
14
14
|
var defaultAnalyticsAttributes = exports.defaultAnalyticsAttributes = {
|
|
15
15
|
componentName: 'helpPanel',
|
|
16
16
|
packageName: "@atlaskit/help-layout",
|
|
17
|
-
packageVersion: "4.4.
|
|
17
|
+
packageVersion: "4.4.7"
|
|
18
18
|
};
|
|
@@ -76,7 +76,7 @@ var BackButtonWithContext = function BackButtonWithContext(props) {
|
|
|
76
76
|
data: {
|
|
77
77
|
componentName: 'backButton',
|
|
78
78
|
packageName: "@atlaskit/help-layout",
|
|
79
|
-
packageVersion: "4.4.
|
|
79
|
+
packageVersion: "4.4.7"
|
|
80
80
|
}
|
|
81
81
|
}, /*#__PURE__*/_react.default.createElement(BackButton, props));
|
|
82
82
|
};
|
|
@@ -21,6 +21,7 @@ var _styled = require("./styled");
|
|
|
21
21
|
*/
|
|
22
22
|
var CloseButton = exports.CloseButton = function CloseButton(_ref) {
|
|
23
23
|
var onClick = _ref.onClick,
|
|
24
|
+
isAiEnabled = _ref.isAiEnabled,
|
|
24
25
|
formatMessage = _ref.intl.formatMessage;
|
|
25
26
|
var _useAnalyticsEvents = (0, _analyticsNext.useAnalyticsEvents)(),
|
|
26
27
|
createAnalyticsEvent = _useAnalyticsEvents.createAnalyticsEvent;
|
|
@@ -32,7 +33,19 @@ var CloseButton = exports.CloseButton = function CloseButton(_ref) {
|
|
|
32
33
|
onClick(event, _analyticsEvent);
|
|
33
34
|
}
|
|
34
35
|
};
|
|
35
|
-
return /*#__PURE__*/_react.default.createElement(_styled.
|
|
36
|
+
return isAiEnabled ? /*#__PURE__*/_react.default.createElement(_styled.CloseButtonContainerAi, null, /*#__PURE__*/_react.default.createElement(_tooltip.default, {
|
|
37
|
+
content: formatMessage(_messages.messages.help_panel_header_close),
|
|
38
|
+
position: "left"
|
|
39
|
+
}, /*#__PURE__*/_react.default.createElement(_standardButton.default, {
|
|
40
|
+
onClick: handleOnClick,
|
|
41
|
+
appearance: "subtle",
|
|
42
|
+
"aria-label": formatMessage(_messages.messages.help_panel_header_close_button),
|
|
43
|
+
iconBefore: /*#__PURE__*/_react.default.createElement(_closeEditorClose.default, {
|
|
44
|
+
color: "currentColor",
|
|
45
|
+
label: formatMessage(_messages.messages.help_panel_header_close),
|
|
46
|
+
LEGACY_size: "medium"
|
|
47
|
+
})
|
|
48
|
+
}))) : /*#__PURE__*/_react.default.createElement(_styled.CloseButtonContainer, null, /*#__PURE__*/_react.default.createElement(_tooltip.default, {
|
|
36
49
|
content: formatMessage(_messages.messages.help_panel_header_close),
|
|
37
50
|
position: "left"
|
|
38
51
|
}, /*#__PURE__*/_react.default.createElement(_standardButton.default, {
|
|
@@ -51,7 +64,7 @@ var CloseButtonWithContext = function CloseButtonWithContext(props) {
|
|
|
51
64
|
data: {
|
|
52
65
|
componentName: 'closeButton',
|
|
53
66
|
packageName: "@atlaskit/help-layout",
|
|
54
|
-
packageVersion: "4.4.
|
|
67
|
+
packageVersion: "4.4.7"
|
|
55
68
|
}
|
|
56
69
|
}, /*#__PURE__*/_react.default.createElement(CloseButton, props));
|
|
57
70
|
};
|
|
@@ -18,6 +18,7 @@ var HelpContent = exports.HelpContent = function HelpContent(_ref) {
|
|
|
18
18
|
isBackbuttonVisible = _ref$isBackbuttonVisi === void 0 ? false : _ref$isBackbuttonVisi,
|
|
19
19
|
onCloseButtonClick = _ref.onCloseButtonClick,
|
|
20
20
|
onBackButtonClick = _ref.onBackButtonClick,
|
|
21
|
+
isAiEnabled = _ref.isAiEnabled,
|
|
21
22
|
formatMessage = _ref.intl.formatMessage;
|
|
22
23
|
var handleOnBackButtonClick = function handleOnBackButtonClick(event, analyticsEvent) {
|
|
23
24
|
if (onBackButtonClick) {
|
|
@@ -27,8 +28,9 @@ var HelpContent = exports.HelpContent = function HelpContent(_ref) {
|
|
|
27
28
|
return /*#__PURE__*/_react.default.createElement(_styled.HeaderContainer, null, /*#__PURE__*/_react.default.createElement(_BackButton.default, {
|
|
28
29
|
onClick: handleOnBackButtonClick,
|
|
29
30
|
isVisible: isBackbuttonVisible
|
|
30
|
-
}), /*#__PURE__*/_react.default.createElement(_styled.HeaderTitle, null, headerTitle ? headerTitle : formatMessage(_messages.messages.help_panel_header_title)), onCloseButtonClick && /*#__PURE__*/_react.default.createElement(_CloseButton.default, {
|
|
31
|
-
onClick: onCloseButtonClick
|
|
31
|
+
}), isAiEnabled ? /*#__PURE__*/_react.default.createElement(_styled.HeaderTitleAi, null, headerTitle ? headerTitle : formatMessage(_messages.messages.help_panel_header_title)) : /*#__PURE__*/_react.default.createElement(_styled.HeaderTitle, null, headerTitle ? headerTitle : formatMessage(_messages.messages.help_panel_header_title)), onCloseButtonClick && /*#__PURE__*/_react.default.createElement(_CloseButton.default, {
|
|
32
|
+
onClick: onCloseButtonClick,
|
|
33
|
+
isAiEnabled: isAiEnabled
|
|
32
34
|
}), headerContent && /*#__PURE__*/_react.default.createElement(_styled.HeaderContent, null, headerContent));
|
|
33
35
|
};
|
|
34
36
|
var _default = exports.default = (0, _reactIntlNext.injectIntl)(HelpContent);
|
|
@@ -5,7 +5,7 @@ var _typeof = require("@babel/runtime/helpers/typeof");
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
|
-
exports.HeaderTitle = exports.HeaderContent = exports.HeaderContainer = exports.CloseButtonContainer = exports.BackButtonContainer = void 0;
|
|
8
|
+
exports.HeaderTitleAi = exports.HeaderTitle = exports.HeaderContent = exports.HeaderContainer = exports.CloseButtonContainerAi = exports.CloseButtonContainer = exports.BackButtonContainer = void 0;
|
|
9
9
|
var _styled = _interopRequireDefault(require("@emotion/styled"));
|
|
10
10
|
var colors = _interopRequireWildcard(require("@atlaskit/theme/colors"));
|
|
11
11
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
@@ -33,6 +33,13 @@ var CloseButtonContainer = exports.CloseButtonContainer = _styled.default.div({
|
|
|
33
33
|
top: "var(--ds-space-150, 12px)"
|
|
34
34
|
});
|
|
35
35
|
|
|
36
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-styled, @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
|
|
37
|
+
var CloseButtonContainerAi = exports.CloseButtonContainerAi = _styled.default.div({
|
|
38
|
+
position: 'absolute',
|
|
39
|
+
right: "var(--ds-space-100, 8px)",
|
|
40
|
+
top: "var(--ds-space-200, 15px)"
|
|
41
|
+
});
|
|
42
|
+
|
|
36
43
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-styled, @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
|
|
37
44
|
var BackButtonContainer = exports.BackButtonContainer = _styled.default.div({
|
|
38
45
|
position: 'absolute',
|
|
@@ -57,6 +64,24 @@ var HeaderTitle = exports.HeaderTitle = _styled.default.h1({
|
|
|
57
64
|
verticalAlign: 'middle'
|
|
58
65
|
});
|
|
59
66
|
|
|
67
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-styled, @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
|
|
68
|
+
var HeaderTitleAi = exports.HeaderTitleAi = _styled.default.h1({
|
|
69
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
70
|
+
color: "var(--ds-text-subtle, ".concat(colors.N500, ")"),
|
|
71
|
+
textAlign: 'left',
|
|
72
|
+
font: "var(--ds-font-body-large, normal 400 16px/24px ui-sans-serif, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Ubuntu, system-ui, \"Helvetica Neue\", sans-serif)",
|
|
73
|
+
fontWeight: "var(--ds-font-weight-semibold, 600)",
|
|
74
|
+
paddingTop: "var(--ds-space-250, 18px)",
|
|
75
|
+
paddingBottom: "var(--ds-space-200, 16px)",
|
|
76
|
+
width: "calc(100% - ".concat("var(--ds-space-200, 16px)", ")"),
|
|
77
|
+
whiteSpace: 'nowrap',
|
|
78
|
+
textOverflow: 'ellipsis',
|
|
79
|
+
display: 'inline-block',
|
|
80
|
+
overflow: 'hidden',
|
|
81
|
+
verticalAlign: 'middle',
|
|
82
|
+
marginLeft: "var(--ds-space-200, 16px)"
|
|
83
|
+
});
|
|
84
|
+
|
|
60
85
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-styled, @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
|
|
61
86
|
var HeaderContent = exports.HeaderContent = _styled.default.div({
|
|
62
87
|
padding: "0 ".concat("var(--ds-space-200, 16px)", " ", "var(--ds-space-200, 16px)", " ", "var(--ds-space-200, 16px)")
|
|
@@ -43,6 +43,8 @@ var HelpContent = exports.HelpContent = function HelpContent(props) {
|
|
|
43
43
|
contentWidth: "80%"
|
|
44
44
|
}), /*#__PURE__*/_react.default.createElement(_styled.LoadingRectangle, {
|
|
45
45
|
contentWidth: "70%"
|
|
46
|
-
})) : /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, children), footer ? /*#__PURE__*/_react.default.createElement(_styled.HelpFooter,
|
|
46
|
+
})) : /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, children), footer ? /*#__PURE__*/_react.default.createElement(_styled.HelpFooter, {
|
|
47
|
+
"data-testid": "footer"
|
|
48
|
+
}, footer) : null));
|
|
47
49
|
};
|
|
48
50
|
var _default = exports.default = (0, _reactIntlNext.injectIntl)(HelpContent);
|
package/dist/es2019/analytics.js
CHANGED
|
@@ -5,7 +5,7 @@ import Tooltip from '@atlaskit/tooltip';
|
|
|
5
5
|
import Button from '@atlaskit/button/standard-button';
|
|
6
6
|
import EditorCloseIcon from '@atlaskit/icon/core/migration/close--editor-close';
|
|
7
7
|
import { messages } from '../../messages';
|
|
8
|
-
import { CloseButtonContainer } from './styled';
|
|
8
|
+
import { CloseButtonContainer, CloseButtonContainerAi } from './styled';
|
|
9
9
|
/**
|
|
10
10
|
* This function will return a CloseButton component only if the function
|
|
11
11
|
* to be executed on the onClick event is passed as a parameter
|
|
@@ -14,6 +14,7 @@ import { CloseButtonContainer } from './styled';
|
|
|
14
14
|
*/
|
|
15
15
|
export const CloseButton = ({
|
|
16
16
|
onClick,
|
|
17
|
+
isAiEnabled,
|
|
17
18
|
intl: {
|
|
18
19
|
formatMessage
|
|
19
20
|
}
|
|
@@ -29,7 +30,19 @@ export const CloseButton = ({
|
|
|
29
30
|
onClick(event, analyticsEvent);
|
|
30
31
|
}
|
|
31
32
|
};
|
|
32
|
-
return /*#__PURE__*/React.createElement(
|
|
33
|
+
return isAiEnabled ? /*#__PURE__*/React.createElement(CloseButtonContainerAi, null, /*#__PURE__*/React.createElement(Tooltip, {
|
|
34
|
+
content: formatMessage(messages.help_panel_header_close),
|
|
35
|
+
position: "left"
|
|
36
|
+
}, /*#__PURE__*/React.createElement(Button, {
|
|
37
|
+
onClick: handleOnClick,
|
|
38
|
+
appearance: "subtle",
|
|
39
|
+
"aria-label": formatMessage(messages.help_panel_header_close_button),
|
|
40
|
+
iconBefore: /*#__PURE__*/React.createElement(EditorCloseIcon, {
|
|
41
|
+
color: "currentColor",
|
|
42
|
+
label: formatMessage(messages.help_panel_header_close),
|
|
43
|
+
LEGACY_size: "medium"
|
|
44
|
+
})
|
|
45
|
+
}))) : /*#__PURE__*/React.createElement(CloseButtonContainer, null, /*#__PURE__*/React.createElement(Tooltip, {
|
|
33
46
|
content: formatMessage(messages.help_panel_header_close),
|
|
34
47
|
position: "left"
|
|
35
48
|
}, /*#__PURE__*/React.createElement(Button, {
|
|
@@ -48,7 +61,7 @@ const CloseButtonWithContext = props => {
|
|
|
48
61
|
data: {
|
|
49
62
|
componentName: 'closeButton',
|
|
50
63
|
packageName: "@atlaskit/help-layout",
|
|
51
|
-
packageVersion: "4.4.
|
|
64
|
+
packageVersion: "4.4.7"
|
|
52
65
|
}
|
|
53
66
|
}, /*#__PURE__*/React.createElement(CloseButton, props));
|
|
54
67
|
};
|
|
@@ -3,13 +3,14 @@ import { injectIntl } from 'react-intl-next';
|
|
|
3
3
|
import { messages } from '../../messages';
|
|
4
4
|
import CloseButton from './CloseButton';
|
|
5
5
|
import BackButton from './BackButton';
|
|
6
|
-
import { HeaderContainer, HeaderTitle, HeaderContent } from './styled';
|
|
6
|
+
import { HeaderContainer, HeaderTitle, HeaderContent, HeaderTitleAi } from './styled';
|
|
7
7
|
export const HelpContent = ({
|
|
8
8
|
headerTitle,
|
|
9
9
|
headerContent,
|
|
10
10
|
isBackbuttonVisible = false,
|
|
11
11
|
onCloseButtonClick,
|
|
12
12
|
onBackButtonClick,
|
|
13
|
+
isAiEnabled,
|
|
13
14
|
intl: {
|
|
14
15
|
formatMessage
|
|
15
16
|
}
|
|
@@ -22,8 +23,9 @@ export const HelpContent = ({
|
|
|
22
23
|
return /*#__PURE__*/React.createElement(HeaderContainer, null, /*#__PURE__*/React.createElement(BackButton, {
|
|
23
24
|
onClick: handleOnBackButtonClick,
|
|
24
25
|
isVisible: isBackbuttonVisible
|
|
25
|
-
}), /*#__PURE__*/React.createElement(HeaderTitle, null, headerTitle ? headerTitle : formatMessage(messages.help_panel_header_title)), onCloseButtonClick && /*#__PURE__*/React.createElement(CloseButton, {
|
|
26
|
-
onClick: onCloseButtonClick
|
|
26
|
+
}), isAiEnabled ? /*#__PURE__*/React.createElement(HeaderTitleAi, null, headerTitle ? headerTitle : formatMessage(messages.help_panel_header_title)) : /*#__PURE__*/React.createElement(HeaderTitle, null, headerTitle ? headerTitle : formatMessage(messages.help_panel_header_title)), onCloseButtonClick && /*#__PURE__*/React.createElement(CloseButton, {
|
|
27
|
+
onClick: onCloseButtonClick,
|
|
28
|
+
isAiEnabled: isAiEnabled
|
|
27
29
|
}), headerContent && /*#__PURE__*/React.createElement(HeaderContent, null, headerContent));
|
|
28
30
|
};
|
|
29
31
|
export default injectIntl(HelpContent);
|
|
@@ -22,6 +22,13 @@ export const CloseButtonContainer = styled.div({
|
|
|
22
22
|
top: "var(--ds-space-150, 12px)"
|
|
23
23
|
});
|
|
24
24
|
|
|
25
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-styled, @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
|
|
26
|
+
export const CloseButtonContainerAi = styled.div({
|
|
27
|
+
position: 'absolute',
|
|
28
|
+
right: "var(--ds-space-100, 8px)",
|
|
29
|
+
top: "var(--ds-space-200, 15px)"
|
|
30
|
+
});
|
|
31
|
+
|
|
25
32
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-styled, @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
|
|
26
33
|
export const BackButtonContainer = styled.div({
|
|
27
34
|
position: 'absolute',
|
|
@@ -46,6 +53,24 @@ export const HeaderTitle = styled.h1({
|
|
|
46
53
|
verticalAlign: 'middle'
|
|
47
54
|
});
|
|
48
55
|
|
|
56
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-styled, @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
|
|
57
|
+
export const HeaderTitleAi = styled.h1({
|
|
58
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
59
|
+
color: `var(--ds-text-subtle, ${colors.N500})`,
|
|
60
|
+
textAlign: 'left',
|
|
61
|
+
font: "var(--ds-font-body-large, normal 400 16px/24px ui-sans-serif, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Ubuntu, system-ui, \"Helvetica Neue\", sans-serif)",
|
|
62
|
+
fontWeight: "var(--ds-font-weight-semibold, 600)",
|
|
63
|
+
paddingTop: "var(--ds-space-250, 18px)",
|
|
64
|
+
paddingBottom: "var(--ds-space-200, 16px)",
|
|
65
|
+
width: `calc(100% - ${"var(--ds-space-200, 16px)"})`,
|
|
66
|
+
whiteSpace: 'nowrap',
|
|
67
|
+
textOverflow: 'ellipsis',
|
|
68
|
+
display: 'inline-block',
|
|
69
|
+
overflow: 'hidden',
|
|
70
|
+
verticalAlign: 'middle',
|
|
71
|
+
marginLeft: "var(--ds-space-200, 16px)"
|
|
72
|
+
});
|
|
73
|
+
|
|
49
74
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-styled, @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
|
|
50
75
|
export const HeaderContent = styled.div({
|
|
51
76
|
padding: `0 ${"var(--ds-space-200, 16px)"} ${"var(--ds-space-200, 16px)"} ${"var(--ds-space-200, 16px)"}`
|
|
@@ -37,6 +37,8 @@ export const HelpContent = props => {
|
|
|
37
37
|
contentWidth: "80%"
|
|
38
38
|
}), /*#__PURE__*/React.createElement(LoadingRectangle, {
|
|
39
39
|
contentWidth: "70%"
|
|
40
|
-
})) : /*#__PURE__*/React.createElement(React.Fragment, null, children), footer ? /*#__PURE__*/React.createElement(HelpFooter,
|
|
40
|
+
})) : /*#__PURE__*/React.createElement(React.Fragment, null, children), footer ? /*#__PURE__*/React.createElement(HelpFooter, {
|
|
41
|
+
"data-testid": "footer"
|
|
42
|
+
}, footer) : null));
|
|
41
43
|
};
|
|
42
44
|
export default injectIntl(HelpContent);
|
package/dist/esm/analytics.js
CHANGED
|
@@ -69,7 +69,7 @@ var BackButtonWithContext = function BackButtonWithContext(props) {
|
|
|
69
69
|
data: {
|
|
70
70
|
componentName: 'backButton',
|
|
71
71
|
packageName: "@atlaskit/help-layout",
|
|
72
|
-
packageVersion: "4.4.
|
|
72
|
+
packageVersion: "4.4.7"
|
|
73
73
|
}
|
|
74
74
|
}, /*#__PURE__*/React.createElement(BackButton, props));
|
|
75
75
|
};
|
|
@@ -5,7 +5,7 @@ import Tooltip from '@atlaskit/tooltip';
|
|
|
5
5
|
import Button from '@atlaskit/button/standard-button';
|
|
6
6
|
import EditorCloseIcon from '@atlaskit/icon/core/migration/close--editor-close';
|
|
7
7
|
import { messages } from '../../messages';
|
|
8
|
-
import { CloseButtonContainer } from './styled';
|
|
8
|
+
import { CloseButtonContainer, CloseButtonContainerAi } from './styled';
|
|
9
9
|
/**
|
|
10
10
|
* This function will return a CloseButton component only if the function
|
|
11
11
|
* to be executed on the onClick event is passed as a parameter
|
|
@@ -14,6 +14,7 @@ import { CloseButtonContainer } from './styled';
|
|
|
14
14
|
*/
|
|
15
15
|
export var CloseButton = function CloseButton(_ref) {
|
|
16
16
|
var onClick = _ref.onClick,
|
|
17
|
+
isAiEnabled = _ref.isAiEnabled,
|
|
17
18
|
formatMessage = _ref.intl.formatMessage;
|
|
18
19
|
var _useAnalyticsEvents = useAnalyticsEvents(),
|
|
19
20
|
createAnalyticsEvent = _useAnalyticsEvents.createAnalyticsEvent;
|
|
@@ -25,7 +26,19 @@ export var CloseButton = function CloseButton(_ref) {
|
|
|
25
26
|
onClick(event, _analyticsEvent);
|
|
26
27
|
}
|
|
27
28
|
};
|
|
28
|
-
return /*#__PURE__*/React.createElement(
|
|
29
|
+
return isAiEnabled ? /*#__PURE__*/React.createElement(CloseButtonContainerAi, null, /*#__PURE__*/React.createElement(Tooltip, {
|
|
30
|
+
content: formatMessage(messages.help_panel_header_close),
|
|
31
|
+
position: "left"
|
|
32
|
+
}, /*#__PURE__*/React.createElement(Button, {
|
|
33
|
+
onClick: handleOnClick,
|
|
34
|
+
appearance: "subtle",
|
|
35
|
+
"aria-label": formatMessage(messages.help_panel_header_close_button),
|
|
36
|
+
iconBefore: /*#__PURE__*/React.createElement(EditorCloseIcon, {
|
|
37
|
+
color: "currentColor",
|
|
38
|
+
label: formatMessage(messages.help_panel_header_close),
|
|
39
|
+
LEGACY_size: "medium"
|
|
40
|
+
})
|
|
41
|
+
}))) : /*#__PURE__*/React.createElement(CloseButtonContainer, null, /*#__PURE__*/React.createElement(Tooltip, {
|
|
29
42
|
content: formatMessage(messages.help_panel_header_close),
|
|
30
43
|
position: "left"
|
|
31
44
|
}, /*#__PURE__*/React.createElement(Button, {
|
|
@@ -44,7 +57,7 @@ var CloseButtonWithContext = function CloseButtonWithContext(props) {
|
|
|
44
57
|
data: {
|
|
45
58
|
componentName: 'closeButton',
|
|
46
59
|
packageName: "@atlaskit/help-layout",
|
|
47
|
-
packageVersion: "4.4.
|
|
60
|
+
packageVersion: "4.4.7"
|
|
48
61
|
}
|
|
49
62
|
}, /*#__PURE__*/React.createElement(CloseButton, props));
|
|
50
63
|
};
|
|
@@ -3,7 +3,7 @@ import { injectIntl } from 'react-intl-next';
|
|
|
3
3
|
import { messages } from '../../messages';
|
|
4
4
|
import CloseButton from './CloseButton';
|
|
5
5
|
import BackButton from './BackButton';
|
|
6
|
-
import { HeaderContainer, HeaderTitle, HeaderContent } from './styled';
|
|
6
|
+
import { HeaderContainer, HeaderTitle, HeaderContent, HeaderTitleAi } from './styled';
|
|
7
7
|
export var HelpContent = function HelpContent(_ref) {
|
|
8
8
|
var headerTitle = _ref.headerTitle,
|
|
9
9
|
headerContent = _ref.headerContent,
|
|
@@ -11,6 +11,7 @@ export var HelpContent = function HelpContent(_ref) {
|
|
|
11
11
|
isBackbuttonVisible = _ref$isBackbuttonVisi === void 0 ? false : _ref$isBackbuttonVisi,
|
|
12
12
|
onCloseButtonClick = _ref.onCloseButtonClick,
|
|
13
13
|
onBackButtonClick = _ref.onBackButtonClick,
|
|
14
|
+
isAiEnabled = _ref.isAiEnabled,
|
|
14
15
|
formatMessage = _ref.intl.formatMessage;
|
|
15
16
|
var handleOnBackButtonClick = function handleOnBackButtonClick(event, analyticsEvent) {
|
|
16
17
|
if (onBackButtonClick) {
|
|
@@ -20,8 +21,9 @@ export var HelpContent = function HelpContent(_ref) {
|
|
|
20
21
|
return /*#__PURE__*/React.createElement(HeaderContainer, null, /*#__PURE__*/React.createElement(BackButton, {
|
|
21
22
|
onClick: handleOnBackButtonClick,
|
|
22
23
|
isVisible: isBackbuttonVisible
|
|
23
|
-
}), /*#__PURE__*/React.createElement(HeaderTitle, null, headerTitle ? headerTitle : formatMessage(messages.help_panel_header_title)), onCloseButtonClick && /*#__PURE__*/React.createElement(CloseButton, {
|
|
24
|
-
onClick: onCloseButtonClick
|
|
24
|
+
}), isAiEnabled ? /*#__PURE__*/React.createElement(HeaderTitleAi, null, headerTitle ? headerTitle : formatMessage(messages.help_panel_header_title)) : /*#__PURE__*/React.createElement(HeaderTitle, null, headerTitle ? headerTitle : formatMessage(messages.help_panel_header_title)), onCloseButtonClick && /*#__PURE__*/React.createElement(CloseButton, {
|
|
25
|
+
onClick: onCloseButtonClick,
|
|
26
|
+
isAiEnabled: isAiEnabled
|
|
25
27
|
}), headerContent && /*#__PURE__*/React.createElement(HeaderContent, null, headerContent));
|
|
26
28
|
};
|
|
27
29
|
export default injectIntl(HelpContent);
|
|
@@ -22,6 +22,13 @@ export var CloseButtonContainer = styled.div({
|
|
|
22
22
|
top: "var(--ds-space-150, 12px)"
|
|
23
23
|
});
|
|
24
24
|
|
|
25
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-styled, @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
|
|
26
|
+
export var CloseButtonContainerAi = styled.div({
|
|
27
|
+
position: 'absolute',
|
|
28
|
+
right: "var(--ds-space-100, 8px)",
|
|
29
|
+
top: "var(--ds-space-200, 15px)"
|
|
30
|
+
});
|
|
31
|
+
|
|
25
32
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-styled, @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
|
|
26
33
|
export var BackButtonContainer = styled.div({
|
|
27
34
|
position: 'absolute',
|
|
@@ -46,6 +53,24 @@ export var HeaderTitle = styled.h1({
|
|
|
46
53
|
verticalAlign: 'middle'
|
|
47
54
|
});
|
|
48
55
|
|
|
56
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-styled, @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
|
|
57
|
+
export var HeaderTitleAi = styled.h1({
|
|
58
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
59
|
+
color: "var(--ds-text-subtle, ".concat(colors.N500, ")"),
|
|
60
|
+
textAlign: 'left',
|
|
61
|
+
font: "var(--ds-font-body-large, normal 400 16px/24px ui-sans-serif, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Ubuntu, system-ui, \"Helvetica Neue\", sans-serif)",
|
|
62
|
+
fontWeight: "var(--ds-font-weight-semibold, 600)",
|
|
63
|
+
paddingTop: "var(--ds-space-250, 18px)",
|
|
64
|
+
paddingBottom: "var(--ds-space-200, 16px)",
|
|
65
|
+
width: "calc(100% - ".concat("var(--ds-space-200, 16px)", ")"),
|
|
66
|
+
whiteSpace: 'nowrap',
|
|
67
|
+
textOverflow: 'ellipsis',
|
|
68
|
+
display: 'inline-block',
|
|
69
|
+
overflow: 'hidden',
|
|
70
|
+
verticalAlign: 'middle',
|
|
71
|
+
marginLeft: "var(--ds-space-200, 16px)"
|
|
72
|
+
});
|
|
73
|
+
|
|
49
74
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-styled, @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
|
|
50
75
|
export var HeaderContent = styled.div({
|
|
51
76
|
padding: "0 ".concat("var(--ds-space-200, 16px)", " ", "var(--ds-space-200, 16px)", " ", "var(--ds-space-200, 16px)")
|
|
@@ -36,6 +36,8 @@ export var HelpContent = function HelpContent(props) {
|
|
|
36
36
|
contentWidth: "80%"
|
|
37
37
|
}), /*#__PURE__*/React.createElement(LoadingRectangle, {
|
|
38
38
|
contentWidth: "70%"
|
|
39
|
-
})) : /*#__PURE__*/React.createElement(React.Fragment, null, children), footer ? /*#__PURE__*/React.createElement(HelpFooter,
|
|
39
|
+
})) : /*#__PURE__*/React.createElement(React.Fragment, null, children), footer ? /*#__PURE__*/React.createElement(HelpFooter, {
|
|
40
|
+
"data-testid": "footer"
|
|
41
|
+
}, footer) : null));
|
|
40
42
|
};
|
|
41
43
|
export default injectIntl(HelpContent);
|
|
@@ -3,6 +3,7 @@ import { type WrappedComponentProps } from 'react-intl-next';
|
|
|
3
3
|
import { type UIAnalyticsEvent } from '@atlaskit/analytics-next';
|
|
4
4
|
interface Props {
|
|
5
5
|
onClick(event: React.MouseEvent<HTMLElement, MouseEvent>, analyticsEvent?: UIAnalyticsEvent): void;
|
|
6
|
+
isAiEnabled?: boolean;
|
|
6
7
|
}
|
|
7
8
|
/**
|
|
8
9
|
* This function will return a CloseButton component only if the function
|
|
@@ -7,6 +7,10 @@ export declare const CloseButtonContainer: import("@emotion/styled").StyledCompo
|
|
|
7
7
|
theme?: import("@emotion/react").Theme | undefined;
|
|
8
8
|
as?: import("react").ElementType<any> | undefined;
|
|
9
9
|
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
10
|
+
export declare const CloseButtonContainerAi: import("@emotion/styled").StyledComponent<{
|
|
11
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
12
|
+
as?: import("react").ElementType<any> | undefined;
|
|
13
|
+
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
10
14
|
export declare const BackButtonContainer: import("@emotion/styled").StyledComponent<{
|
|
11
15
|
theme?: import("@emotion/react").Theme | undefined;
|
|
12
16
|
as?: import("react").ElementType<any> | undefined;
|
|
@@ -15,6 +19,10 @@ export declare const HeaderTitle: import("@emotion/styled").StyledComponent<{
|
|
|
15
19
|
theme?: import("@emotion/react").Theme | undefined;
|
|
16
20
|
as?: import("react").ElementType<any> | undefined;
|
|
17
21
|
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLHeadingElement>, HTMLHeadingElement>, {}>;
|
|
22
|
+
export declare const HeaderTitleAi: import("@emotion/styled").StyledComponent<{
|
|
23
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
24
|
+
as?: import("react").ElementType<any> | undefined;
|
|
25
|
+
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLHeadingElement>, HTMLHeadingElement>, {}>;
|
|
18
26
|
export declare const HeaderContent: import("@emotion/styled").StyledComponent<{
|
|
19
27
|
theme?: import("@emotion/react").Theme | undefined;
|
|
20
28
|
as?: import("react").ElementType<any> | undefined;
|
|
@@ -6,9 +6,11 @@ export interface HelpPanelHeader {
|
|
|
6
6
|
onCloseButtonClick?(event: React.MouseEvent<HTMLElement, MouseEvent>, analyticsEvent: UIAnalyticsEvent): void;
|
|
7
7
|
onBackButtonClick?(event: React.MouseEvent<HTMLElement, MouseEvent>, analyticsEvent: UIAnalyticsEvent): void;
|
|
8
8
|
isBackbuttonVisible?: boolean;
|
|
9
|
+
isAiEnabled?: boolean;
|
|
9
10
|
}
|
|
10
11
|
export interface HelpLayout extends HelpPanelHeader {
|
|
11
12
|
isLoading?: boolean;
|
|
12
13
|
footer?: React.ReactNode;
|
|
13
14
|
children?: React.ReactNode;
|
|
15
|
+
isAiEnabled?: boolean;
|
|
14
16
|
}
|
|
@@ -3,6 +3,7 @@ import { type WrappedComponentProps } from 'react-intl-next';
|
|
|
3
3
|
import { type UIAnalyticsEvent } from '@atlaskit/analytics-next';
|
|
4
4
|
interface Props {
|
|
5
5
|
onClick(event: React.MouseEvent<HTMLElement, MouseEvent>, analyticsEvent?: UIAnalyticsEvent): void;
|
|
6
|
+
isAiEnabled?: boolean;
|
|
6
7
|
}
|
|
7
8
|
/**
|
|
8
9
|
* This function will return a CloseButton component only if the function
|
|
@@ -7,6 +7,10 @@ export declare const CloseButtonContainer: import("@emotion/styled").StyledCompo
|
|
|
7
7
|
theme?: import("@emotion/react").Theme | undefined;
|
|
8
8
|
as?: import("react").ElementType<any> | undefined;
|
|
9
9
|
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
10
|
+
export declare const CloseButtonContainerAi: import("@emotion/styled").StyledComponent<{
|
|
11
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
12
|
+
as?: import("react").ElementType<any> | undefined;
|
|
13
|
+
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
10
14
|
export declare const BackButtonContainer: import("@emotion/styled").StyledComponent<{
|
|
11
15
|
theme?: import("@emotion/react").Theme | undefined;
|
|
12
16
|
as?: import("react").ElementType<any> | undefined;
|
|
@@ -15,6 +19,10 @@ export declare const HeaderTitle: import("@emotion/styled").StyledComponent<{
|
|
|
15
19
|
theme?: import("@emotion/react").Theme | undefined;
|
|
16
20
|
as?: import("react").ElementType<any> | undefined;
|
|
17
21
|
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLHeadingElement>, HTMLHeadingElement>, {}>;
|
|
22
|
+
export declare const HeaderTitleAi: import("@emotion/styled").StyledComponent<{
|
|
23
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
24
|
+
as?: import("react").ElementType<any> | undefined;
|
|
25
|
+
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLHeadingElement>, HTMLHeadingElement>, {}>;
|
|
18
26
|
export declare const HeaderContent: import("@emotion/styled").StyledComponent<{
|
|
19
27
|
theme?: import("@emotion/react").Theme | undefined;
|
|
20
28
|
as?: import("react").ElementType<any> | undefined;
|
|
@@ -6,9 +6,11 @@ export interface HelpPanelHeader {
|
|
|
6
6
|
onCloseButtonClick?(event: React.MouseEvent<HTMLElement, MouseEvent>, analyticsEvent: UIAnalyticsEvent): void;
|
|
7
7
|
onBackButtonClick?(event: React.MouseEvent<HTMLElement, MouseEvent>, analyticsEvent: UIAnalyticsEvent): void;
|
|
8
8
|
isBackbuttonVisible?: boolean;
|
|
9
|
+
isAiEnabled?: boolean;
|
|
9
10
|
}
|
|
10
11
|
export interface HelpLayout extends HelpPanelHeader {
|
|
11
12
|
isLoading?: boolean;
|
|
12
13
|
footer?: React.ReactNode;
|
|
13
14
|
children?: React.ReactNode;
|
|
15
|
+
isAiEnabled?: boolean;
|
|
14
16
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/help-layout",
|
|
3
|
-
"version": "4.4.
|
|
3
|
+
"version": "4.4.7",
|
|
4
4
|
"description": "Layout for the atlaskit/help component.",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -32,9 +32,9 @@
|
|
|
32
32
|
"dependencies": {
|
|
33
33
|
"@atlaskit/analytics-next": "^10.2.0",
|
|
34
34
|
"@atlaskit/button": "^20.3.0",
|
|
35
|
-
"@atlaskit/icon": "^23.
|
|
35
|
+
"@atlaskit/icon": "^23.4.0",
|
|
36
36
|
"@atlaskit/theme": "^14.0.0",
|
|
37
|
-
"@atlaskit/tokens": "^3.
|
|
37
|
+
"@atlaskit/tokens": "^3.2.0",
|
|
38
38
|
"@atlaskit/tooltip": "^19.0.0",
|
|
39
39
|
"@babel/runtime": "^7.0.0",
|
|
40
40
|
"@emotion/react": "^11.7.1",
|