@atlaskit/smart-card 25.6.0 → 25.7.0
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/ssr.js +9 -6
- package/dist/cjs/state/flexible-ui-context/index.js +13 -2
- package/dist/cjs/state/hooks/useSmartLink.js +6 -1
- package/dist/cjs/version.json +1 -1
- package/dist/cjs/view/CardWithUrl/component.js +2 -1
- package/dist/cjs/view/FlexibleCard/components/blocks/action-group/index.js +4 -2
- package/dist/cjs/view/FlexibleCard/components/common/lozenge-action/index.js +4 -2
- package/dist/cjs/view/FlexibleCard/components/container/index.js +7 -3
- package/dist/cjs/view/FlexibleCard/components/elements/lozenge/index.js +4 -1
- package/dist/cjs/view/FlexibleCard/index.js +5 -2
- package/dist/cjs/view/HoverCard/components/HoverCardComponent.js +6 -3
- package/dist/cjs/view/HoverCard/components/HoverCardContent.js +3 -1
- package/dist/cjs/view/HoverCard/styled.js +6 -2
- package/dist/cjs/view/InlineCard/ResolvedView/index.js +4 -1
- package/dist/cjs/view/InlineCard/index.js +3 -1
- package/dist/es2019/ssr.js +11 -6
- package/dist/es2019/state/flexible-ui-context/index.js +8 -1
- package/dist/es2019/state/hooks/useSmartLink.js +6 -1
- package/dist/es2019/version.json +1 -1
- package/dist/es2019/view/CardWithUrl/component.js +2 -1
- package/dist/es2019/view/FlexibleCard/components/blocks/action-group/index.js +5 -3
- package/dist/es2019/view/FlexibleCard/components/common/lozenge-action/index.js +4 -2
- package/dist/es2019/view/FlexibleCard/components/container/index.js +5 -2
- package/dist/es2019/view/FlexibleCard/components/elements/lozenge/index.js +4 -1
- package/dist/es2019/view/FlexibleCard/index.js +6 -3
- package/dist/es2019/view/HoverCard/components/HoverCardComponent.js +6 -4
- package/dist/es2019/view/HoverCard/components/HoverCardContent.js +3 -1
- package/dist/es2019/view/HoverCard/styled.js +4 -1
- package/dist/es2019/view/InlineCard/ResolvedView/index.js +3 -1
- package/dist/es2019/view/InlineCard/index.js +3 -1
- package/dist/esm/ssr.js +9 -6
- package/dist/esm/state/flexible-ui-context/index.js +9 -0
- package/dist/esm/state/hooks/useSmartLink.js +6 -1
- package/dist/esm/version.json +1 -1
- package/dist/esm/view/CardWithUrl/component.js +2 -1
- package/dist/esm/view/FlexibleCard/components/blocks/action-group/index.js +5 -3
- package/dist/esm/view/FlexibleCard/components/common/lozenge-action/index.js +4 -2
- package/dist/esm/view/FlexibleCard/components/container/index.js +7 -3
- package/dist/esm/view/FlexibleCard/components/elements/lozenge/index.js +4 -1
- package/dist/esm/view/FlexibleCard/index.js +6 -3
- package/dist/esm/view/HoverCard/components/HoverCardComponent.js +7 -4
- package/dist/esm/view/HoverCard/components/HoverCardContent.js +3 -1
- package/dist/esm/view/HoverCard/styled.js +4 -1
- package/dist/esm/view/InlineCard/ResolvedView/index.js +4 -1
- package/dist/esm/view/InlineCard/index.js +3 -1
- package/dist/types/__fixtures__/bitbucket-pull-request.d.ts +73 -0
- package/dist/types/__fixtures__/confluence-blog.d.ts +49 -0
- package/dist/types/__fixtures__/confluence-page.d.ts +49 -0
- package/dist/types/__fixtures__/confluence-space.d.ts +36 -0
- package/dist/types/__fixtures__/confluence-template.d.ts +31 -0
- package/dist/types/__fixtures__/figma.d.ts +43 -0
- package/dist/types/__fixtures__/jira-roadmap.d.ts +35 -0
- package/dist/types/__fixtures__/jira-task.d.ts +78 -0
- package/dist/types/__fixtures__/youtube-video.d.ts +44 -0
- package/dist/types/state/flexible-ui-context/index.d.ts +7 -0
- package/dist/types/state/hooks/useSmartLink.d.ts +6 -1
- package/dist/types/view/Card/index.d.ts +1 -1
- package/dist/types/view/CardWithUrl/types.d.ts +5 -1
- package/dist/types/view/FlexibleCard/components/common/lozenge-action/types.d.ts +1 -0
- package/dist/types/view/FlexibleCard/components/container/types.d.ts +2 -13
- package/dist/types/view/FlexibleCard/types.d.ts +8 -3
- package/dist/types/view/HoverCard/index.d.ts +1 -1
- package/dist/types/view/HoverCard/styled.d.ts +1 -0
- package/dist/types/view/HoverCard/types.d.ts +5 -0
- package/dist/types/view/InlineCard/ResolvedView/index.d.ts +2 -0
- package/dist/types/view/InlineCard/types.d.ts +1 -0
- package/package.json +2 -2
- package/report.api.md +2 -1
- package/tmp/api-report-tmp.d.ts +2 -1
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { css } from '@emotion/react';
|
|
2
2
|
import { loadingPlaceholderClassName } from '../../index';
|
|
3
3
|
import { SmartLinkSize, SmartLinkTheme } from '../../constants';
|
|
4
|
+
// Temporary fix for Confluence inline comment on editor mod has z-index of 500, Jira issue view has z-index of 510
|
|
5
|
+
export const HOVER_CARD_Z_INDEX = 511;
|
|
4
6
|
export const flexibleUiOptions = {
|
|
5
7
|
hideBackground: true,
|
|
6
8
|
hideElevation: true,
|
|
@@ -8,7 +10,8 @@ export const flexibleUiOptions = {
|
|
|
8
10
|
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage
|
|
9
11
|
theme: SmartLinkTheme.Black,
|
|
10
12
|
hidePadding: true,
|
|
11
|
-
hideHoverCardPreviewButton: false
|
|
13
|
+
hideHoverCardPreviewButton: false,
|
|
14
|
+
zIndex: HOVER_CARD_Z_INDEX + 1
|
|
12
15
|
};
|
|
13
16
|
export const CARD_WIDTH_REM = 24;
|
|
14
17
|
// gap between mouse cursor and hover card
|
|
@@ -29,7 +29,8 @@ export class InlineCardResolvedView extends React.Component {
|
|
|
29
29
|
testId = 'inline-card-resolved-view',
|
|
30
30
|
titleTextColor,
|
|
31
31
|
titlePrefix,
|
|
32
|
-
showHoverPreview = false
|
|
32
|
+
showHoverPreview = false,
|
|
33
|
+
showServerActions = false
|
|
33
34
|
} = this.props;
|
|
34
35
|
const inlineCardResolvedView = /*#__PURE__*/React.createElement(Frame, {
|
|
35
36
|
testId: testId,
|
|
@@ -45,6 +46,7 @@ export class InlineCardResolvedView extends React.Component {
|
|
|
45
46
|
if (showHoverPreview && link) {
|
|
46
47
|
return /*#__PURE__*/React.createElement(HoverCard, {
|
|
47
48
|
id: id,
|
|
49
|
+
showServerActions: showServerActions,
|
|
48
50
|
url: link
|
|
49
51
|
}, inlineCardResolvedView);
|
|
50
52
|
}
|
|
@@ -27,7 +27,8 @@ export const InlineCard = ({
|
|
|
27
27
|
testId,
|
|
28
28
|
inlinePreloaderStyle,
|
|
29
29
|
showHoverPreview,
|
|
30
|
-
showAuthTooltip
|
|
30
|
+
showAuthTooltip,
|
|
31
|
+
showServerActions
|
|
31
32
|
}) => {
|
|
32
33
|
var _details$meta;
|
|
33
34
|
const {
|
|
@@ -62,6 +63,7 @@ export const InlineCard = ({
|
|
|
62
63
|
return /*#__PURE__*/React.createElement(InlineCardResolvedView, _extends({}, resolvedProps, {
|
|
63
64
|
id: id,
|
|
64
65
|
showHoverPreview: showHoverPreview,
|
|
66
|
+
showServerActions: showServerActions,
|
|
65
67
|
link: url,
|
|
66
68
|
isSelected: isSelected,
|
|
67
69
|
onClick: handleFrameClick,
|
package/dist/esm/ssr.js
CHANGED
|
@@ -6,25 +6,28 @@ import React from 'react';
|
|
|
6
6
|
import { useState } from 'react';
|
|
7
7
|
import uuid from 'uuid';
|
|
8
8
|
import { ErrorBoundary } from 'react-error-boundary';
|
|
9
|
+
import { AnalyticsContext } from '@atlaskit/analytics-next';
|
|
9
10
|
import { CardWithUrlContent } from './view/CardWithUrl/component';
|
|
10
11
|
import { LoadingCardLink } from './view/CardWithUrl/component-lazy/LazyFallback';
|
|
12
|
+
import { context } from './utils/analytics/analytics';
|
|
11
13
|
// SSR friendly version of smart-card
|
|
12
14
|
// simplifies the logic around rendering and loading placeholders and
|
|
13
15
|
// only contains whats necessary to render the card on SSR mode
|
|
14
16
|
export var CardSSR = function CardSSR(props) {
|
|
15
17
|
var _useState = useState(function () {
|
|
16
|
-
|
|
18
|
+
var _props$id;
|
|
19
|
+
return (_props$id = props.id) !== null && _props$id !== void 0 ? _props$id : uuid();
|
|
17
20
|
}),
|
|
18
21
|
_useState2 = _slicedToArray(_useState, 1),
|
|
19
22
|
id = _useState2[0];
|
|
20
|
-
var dispatchAnalytics = function dispatchAnalytics() {}; // we can't dispatch events on SSR, after hydration the we will provide the real callback
|
|
21
23
|
var cardProps = _objectSpread(_objectSpread({}, props), {}, {
|
|
22
|
-
id: id
|
|
23
|
-
dispatchAnalytics: dispatchAnalytics
|
|
24
|
+
id: id
|
|
24
25
|
});
|
|
25
|
-
return /*#__PURE__*/React.createElement(
|
|
26
|
+
return /*#__PURE__*/React.createElement(AnalyticsContext, {
|
|
27
|
+
data: context
|
|
28
|
+
}, /*#__PURE__*/React.createElement(ErrorBoundary, {
|
|
26
29
|
FallbackComponent: function FallbackComponent() {
|
|
27
30
|
return /*#__PURE__*/React.createElement(LoadingCardLink, cardProps);
|
|
28
31
|
}
|
|
29
|
-
}, /*#__PURE__*/React.createElement(CardWithUrlContent, cardProps));
|
|
32
|
+
}, /*#__PURE__*/React.createElement(CardWithUrlContent, cardProps)));
|
|
30
33
|
};
|
|
@@ -15,4 +15,13 @@ export var useFlexibleUiContext = function useFlexibleUiContext() {
|
|
|
15
15
|
export var FlexibleUiAnalyticsContext = /*#__PURE__*/createContext(undefined);
|
|
16
16
|
export var useFlexibleUiAnalyticsContext = function useFlexibleUiAnalyticsContext() {
|
|
17
17
|
return useContext(FlexibleUiAnalyticsContext);
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* This provides the ui options that will be used by Smart Links Flexible UI
|
|
22
|
+
* to render its underlying elements.
|
|
23
|
+
*/
|
|
24
|
+
export var FlexibleUiOptionContext = /*#__PURE__*/createContext(undefined);
|
|
25
|
+
export var useFlexibleUiOptionContext = function useFlexibleUiOptionContext() {
|
|
26
|
+
return useContext(FlexibleUiOptionContext);
|
|
18
27
|
};
|
|
@@ -6,7 +6,12 @@ import { useSmartLinkConfig } from '../config';
|
|
|
6
6
|
import { useSmartLinkAnalytics } from '../analytics';
|
|
7
7
|
import { useSmartLinkRenderers } from '../renderers';
|
|
8
8
|
import { useSmartLinkContext } from '@atlaskit/link-provider';
|
|
9
|
-
export function useSmartLink(id, url,
|
|
9
|
+
export function useSmartLink(id, url,
|
|
10
|
+
/**
|
|
11
|
+
* @deprecated {@link https://hello.atlassian.net/browse/ENGHEALTH-2681 Internal documentation for deprecation (no external access)}
|
|
12
|
+
* Avoid prop drilling analytics handlers. Continue passing a handler for now if there's already one in place.
|
|
13
|
+
*/
|
|
14
|
+
dispatchAnalytics) {
|
|
10
15
|
var state = useSmartLinkState(url);
|
|
11
16
|
var _useSmartLinkContext = useSmartLinkContext(),
|
|
12
17
|
store = _useSmartLinkContext.store;
|
package/dist/esm/version.json
CHANGED
|
@@ -208,7 +208,8 @@ export function CardWithUrlContent(_ref) {
|
|
|
208
208
|
testId: testId,
|
|
209
209
|
inlinePreloaderStyle: inlinePreloaderStyle,
|
|
210
210
|
showHoverPreview: showHoverPreview,
|
|
211
|
-
showAuthTooltip: showAuthTooltip
|
|
211
|
+
showAuthTooltip: showAuthTooltip,
|
|
212
|
+
showServerActions: showServerActions
|
|
212
213
|
});
|
|
213
214
|
case 'block':
|
|
214
215
|
return /*#__PURE__*/React.createElement(BlockCard, {
|
|
@@ -16,7 +16,7 @@ import Button from '@atlaskit/button/standard-button';
|
|
|
16
16
|
import MoreIcon from '@atlaskit/icon/glyph/more';
|
|
17
17
|
import { sizeToButtonSpacing } from '../../utils';
|
|
18
18
|
import { messages } from '../../../../../messages';
|
|
19
|
-
import { useFlexibleUiContext } from '../../../../../state/flexible-ui-context';
|
|
19
|
+
import { useFlexibleUiContext, useFlexibleUiOptionContext } from '../../../../../state/flexible-ui-context';
|
|
20
20
|
import ActionGroupItem from './action-group-item';
|
|
21
21
|
var styles = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: inline-flex;\n line-height: 1rem;\n > div {\n align-items: center;\n button:focus-visible {\n // AK button removes the default browser outline on focus and apply\n // box-shadow styling to create the outline appearance.\n // Due to our container elements (Container/Block/ElementGroup) has\n // overflow hidden to prevent the metadata element from leaking outside\n // of its container, the box-shadow doesn't show properly.\n // Invert the AK box-shadow styling.\n outline-offset: -2px;\n }\n }\n"])));
|
|
22
22
|
var renderActionItems = function renderActionItems() {
|
|
@@ -73,6 +73,7 @@ var ActionGroup = function ActionGroup(_ref) {
|
|
|
73
73
|
onDropdownOpenChange = _ref.onDropdownOpenChange,
|
|
74
74
|
testId = _ref.testId;
|
|
75
75
|
var context = useFlexibleUiContext();
|
|
76
|
+
var ui = useFlexibleUiOptionContext();
|
|
76
77
|
var _useState = useState(false),
|
|
77
78
|
_useState2 = _slicedToArray(_useState, 2),
|
|
78
79
|
isOpen = _useState2[0],
|
|
@@ -124,11 +125,12 @@ var ActionGroup = function ActionGroup(_ref) {
|
|
|
124
125
|
ref: triggerRef
|
|
125
126
|
})));
|
|
126
127
|
},
|
|
127
|
-
testId: "action-group-dropdown"
|
|
128
|
+
testId: "action-group-dropdown",
|
|
129
|
+
zIndex: ui === null || ui === void 0 ? void 0 : ui.zIndex
|
|
128
130
|
}, renderActionItems(actionItems, size, appearance, true, onActionItemClick));
|
|
129
131
|
}
|
|
130
132
|
return null;
|
|
131
|
-
}, [appearance, isMoreThenTwoItems, isOpen, onActionItemClick, onOpenChange, renderableActionItems, size, visibleButtonsNum]);
|
|
133
|
+
}, [appearance, isMoreThenTwoItems, isOpen, onActionItemClick, onOpenChange, renderableActionItems, size, ui === null || ui === void 0 ? void 0 : ui.zIndex, visibleButtonsNum]);
|
|
132
134
|
return renderableActionItems.length > 0 ? jsx("div", {
|
|
133
135
|
css: styles,
|
|
134
136
|
className: "actions-button-group"
|
|
@@ -29,7 +29,8 @@ var LozengeAction = function LozengeAction(_ref) {
|
|
|
29
29
|
appearance = _ref.appearance,
|
|
30
30
|
_ref$testId = _ref.testId,
|
|
31
31
|
testId = _ref$testId === void 0 ? 'smart-element-lozenge-action' : _ref$testId,
|
|
32
|
-
text = _ref.text
|
|
32
|
+
text = _ref.text,
|
|
33
|
+
zIndex = _ref.zIndex;
|
|
33
34
|
var _useState = useState(false),
|
|
34
35
|
_useState2 = _slicedToArray(_useState, 2),
|
|
35
36
|
isLoaded = _useState2[0],
|
|
@@ -181,7 +182,8 @@ var LozengeAction = function LozengeAction(_ref) {
|
|
|
181
182
|
isOpen: isOpen,
|
|
182
183
|
onOpenChange: handleOpenChange,
|
|
183
184
|
testId: testId,
|
|
184
|
-
trigger: trigger
|
|
185
|
+
trigger: trigger,
|
|
186
|
+
zIndex: zIndex
|
|
185
187
|
}, dropdownItemGroup);
|
|
186
188
|
};
|
|
187
189
|
export default withErrorBoundary(LozengeAction);
|
|
@@ -71,6 +71,7 @@ export var getContainerStyles = function getContainerStyles(size, hideBackground
|
|
|
71
71
|
};
|
|
72
72
|
var renderChildren = function renderChildren(children, containerSize, containerTheme, status, retry, onClick, onActionMenuOpenChange) {
|
|
73
73
|
return React.Children.map(children, function (child) {
|
|
74
|
+
// TODO: EDM-6468: Use useFlexibleUiOptionContext for rendering options inside block/element instead
|
|
74
75
|
if ( /*#__PURE__*/React.isValidElement(child) && isFlexibleUiBlock(child)) {
|
|
75
76
|
var blockSize = child.props.size;
|
|
76
77
|
var size = blockSize || containerSize;
|
|
@@ -141,10 +142,12 @@ var Container = function Container(_ref3) {
|
|
|
141
142
|
hideHoverCardPreviewButton = _ref3$hideHoverCardPr === void 0 ? false : _ref3$hideHoverCardPr,
|
|
142
143
|
_ref3$hidePadding = _ref3.hidePadding,
|
|
143
144
|
hidePadding = _ref3$hidePadding === void 0 ? false : _ref3$hidePadding,
|
|
144
|
-
_ref3$showHoverPrevie = _ref3.showHoverPreview,
|
|
145
|
-
showHoverPreview = _ref3$showHoverPrevie === void 0 ? false : _ref3$showHoverPrevie,
|
|
146
145
|
onClick = _ref3.onClick,
|
|
147
146
|
retry = _ref3.retry,
|
|
147
|
+
_ref3$showHoverPrevie = _ref3.showHoverPreview,
|
|
148
|
+
showHoverPreview = _ref3$showHoverPrevie === void 0 ? false : _ref3$showHoverPrevie,
|
|
149
|
+
_ref3$showServerActio = _ref3.showServerActions,
|
|
150
|
+
showServerActions = _ref3$showServerActio === void 0 ? false : _ref3$showServerActio,
|
|
148
151
|
_ref3$size = _ref3.size,
|
|
149
152
|
size = _ref3$size === void 0 ? SmartLinkSize.Medium : _ref3$size,
|
|
150
153
|
status = _ref3.status,
|
|
@@ -171,7 +174,8 @@ var Container = function Container(_ref3) {
|
|
|
171
174
|
url: context === null || context === void 0 ? void 0 : context.url,
|
|
172
175
|
canOpen: hoverCardCanOpen,
|
|
173
176
|
closeOnChildClick: true,
|
|
174
|
-
hidePreviewButton: hideHoverCardPreviewButton
|
|
177
|
+
hidePreviewButton: hideHoverCardPreviewButton,
|
|
178
|
+
showServerActions: showServerActions
|
|
175
179
|
}, containerContent);
|
|
176
180
|
}
|
|
177
181
|
return containerContent;
|
|
@@ -6,6 +6,7 @@ import React, { useCallback, useState } from 'react';
|
|
|
6
6
|
import { css, jsx } from '@emotion/react';
|
|
7
7
|
import AtlaskitLozenge from '@atlaskit/lozenge';
|
|
8
8
|
import LozengeAction from '../../common/lozenge-action';
|
|
9
|
+
import { useFlexibleUiOptionContext } from '../../../../../state/flexible-ui-context';
|
|
9
10
|
var styles = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: inline-flex;\n line-height: inherit;\n"])));
|
|
10
11
|
var actionStyles = css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n overflow: visible;\n"])));
|
|
11
12
|
|
|
@@ -25,6 +26,7 @@ var Lozenge = function Lozenge(_ref) {
|
|
|
25
26
|
text = _ref.text,
|
|
26
27
|
_ref$testId = _ref.testId,
|
|
27
28
|
testId = _ref$testId === void 0 ? 'smart-element-lozenge' : _ref$testId;
|
|
29
|
+
var ui = useFlexibleUiOptionContext();
|
|
28
30
|
var _useState = useState(false),
|
|
29
31
|
_useState2 = _slicedToArray(_useState, 2),
|
|
30
32
|
isBold = _useState2[0],
|
|
@@ -47,7 +49,8 @@ var Lozenge = function Lozenge(_ref) {
|
|
|
47
49
|
action: action,
|
|
48
50
|
appearance: appearance,
|
|
49
51
|
testId: testId,
|
|
50
|
-
text: text
|
|
52
|
+
text: text,
|
|
53
|
+
zIndex: ui === null || ui === void 0 ? void 0 : ui.zIndex
|
|
51
54
|
}) : jsx(AtlaskitLozenge, {
|
|
52
55
|
appearance: appearance,
|
|
53
56
|
isBold: isBold,
|
|
@@ -3,7 +3,7 @@ import React, { useEffect, useMemo } from 'react';
|
|
|
3
3
|
import { useFeatureFlag } from '@atlaskit/link-provider';
|
|
4
4
|
import { SmartLinkStatus } from '../../constants';
|
|
5
5
|
import Container from './components/container';
|
|
6
|
-
import { FlexibleUiAnalyticsContext, FlexibleUiContext } from '../../state/flexible-ui-context';
|
|
6
|
+
import { FlexibleUiAnalyticsContext, FlexibleUiContext, FlexibleUiOptionContext } from '../../state/flexible-ui-context';
|
|
7
7
|
import { getContextByStatus, getRetryOptions } from './utils';
|
|
8
8
|
|
|
9
9
|
/**
|
|
@@ -76,15 +76,18 @@ var FlexibleCard = function FlexibleCard(_ref) {
|
|
|
76
76
|
}, [onError, onResolve, status, title, url]);
|
|
77
77
|
return /*#__PURE__*/React.createElement(FlexibleUiAnalyticsContext.Provider, {
|
|
78
78
|
value: analytics
|
|
79
|
+
}, /*#__PURE__*/React.createElement(FlexibleUiOptionContext.Provider, {
|
|
80
|
+
value: ui
|
|
79
81
|
}, /*#__PURE__*/React.createElement(FlexibleUiContext.Provider, {
|
|
80
82
|
value: context
|
|
81
83
|
}, /*#__PURE__*/React.createElement(Container, _extends({
|
|
82
84
|
testId: testId
|
|
83
85
|
}, ui, {
|
|
84
|
-
showHoverPreview: showHoverPreview,
|
|
85
86
|
onClick: onClick,
|
|
86
87
|
retry: retry,
|
|
88
|
+
showHoverPreview: showHoverPreview,
|
|
89
|
+
showServerActions: showServerActions,
|
|
87
90
|
status: status
|
|
88
|
-
}), children)));
|
|
91
|
+
}), children))));
|
|
89
92
|
};
|
|
90
93
|
export default FlexibleCard;
|
|
@@ -8,7 +8,7 @@ import { useSmartLinkActions } from '../../../state/hooks-external/useSmartLinkA
|
|
|
8
8
|
import { useSmartLinkRenderers } from '../../../state/renderers';
|
|
9
9
|
import { useSmartCardState as useLinkState } from '../../../state/store';
|
|
10
10
|
import HoverCardContent from '../components/HoverCardContent';
|
|
11
|
-
import { CARD_GAP_PX } from '../styled';
|
|
11
|
+
import { CARD_GAP_PX, HOVER_CARD_Z_INDEX } from '../styled';
|
|
12
12
|
import { CardDisplay } from '../../../constants';
|
|
13
13
|
export var HoverCardComponent = function HoverCardComponent(_ref) {
|
|
14
14
|
var children = _ref.children,
|
|
@@ -20,7 +20,9 @@ export var HoverCardComponent = function HoverCardComponent(_ref) {
|
|
|
20
20
|
_ref$closeOnChildClic = _ref.closeOnChildClick,
|
|
21
21
|
closeOnChildClick = _ref$closeOnChildClic === void 0 ? false : _ref$closeOnChildClic,
|
|
22
22
|
_ref$hidePreviewButto = _ref.hidePreviewButton,
|
|
23
|
-
hidePreviewButton = _ref$hidePreviewButto === void 0 ? false : _ref$hidePreviewButto
|
|
23
|
+
hidePreviewButton = _ref$hidePreviewButto === void 0 ? false : _ref$hidePreviewButto,
|
|
24
|
+
_ref$showServerAction = _ref.showServerActions,
|
|
25
|
+
showServerActions = _ref$showServerAction === void 0 ? false : _ref$showServerAction;
|
|
24
26
|
var delay = 300;
|
|
25
27
|
var _React$useState = React.useState(false),
|
|
26
28
|
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
@@ -129,9 +131,10 @@ export var HoverCardComponent = function HoverCardComponent(_ref) {
|
|
|
129
131
|
onActionClick: onActionClick,
|
|
130
132
|
onResolve: update,
|
|
131
133
|
renderers: renderers,
|
|
134
|
+
showServerActions: showServerActions,
|
|
132
135
|
url: url
|
|
133
136
|
});
|
|
134
|
-
}, [analytics, initHideCard, initShowCard, filteredActions, linkState, onActionClick, renderers, url]);
|
|
137
|
+
}, [analytics, initHideCard, initShowCard, filteredActions, linkState, onActionClick, renderers, showServerActions, url]);
|
|
135
138
|
var trigger = useCallback(function (triggerProps) {
|
|
136
139
|
return jsx("span", {
|
|
137
140
|
ref: parentSpan
|
|
@@ -152,6 +155,6 @@ export var HoverCardComponent = function HoverCardComponent(_ref) {
|
|
|
152
155
|
autoFocus: false,
|
|
153
156
|
content: content,
|
|
154
157
|
trigger: trigger,
|
|
155
|
-
zIndex:
|
|
158
|
+
zIndex: HOVER_CARD_Z_INDEX
|
|
156
159
|
});
|
|
157
160
|
};
|
|
@@ -89,7 +89,8 @@ var HoverCardContent = function HoverCardContent(_ref) {
|
|
|
89
89
|
renderers = _ref.renderers,
|
|
90
90
|
url = _ref.url,
|
|
91
91
|
onMouseEnter = _ref.onMouseEnter,
|
|
92
|
-
onMouseLeave = _ref.onMouseLeave
|
|
92
|
+
onMouseLeave = _ref.onMouseLeave,
|
|
93
|
+
showServerActions = _ref.showServerActions;
|
|
93
94
|
var _useAnalyticsEvents = useAnalyticsEvents(),
|
|
94
95
|
createAnalyticsEvent = _useAnalyticsEvents.createAnalyticsEvent;
|
|
95
96
|
var extensionKey = useMemo(function () {
|
|
@@ -130,6 +131,7 @@ var HoverCardContent = function HoverCardContent(_ref) {
|
|
|
130
131
|
onClick: onClick,
|
|
131
132
|
onResolve: onResolve,
|
|
132
133
|
renderers: renderers,
|
|
134
|
+
showServerActions: showServerActions,
|
|
133
135
|
ui: flexibleUiOptions,
|
|
134
136
|
url: url,
|
|
135
137
|
children: {}
|
|
@@ -3,6 +3,8 @@ var _templateObject, _templateObject2, _templateObject3, _templateObject4;
|
|
|
3
3
|
import { css } from '@emotion/react';
|
|
4
4
|
import { loadingPlaceholderClassName } from '../../index';
|
|
5
5
|
import { SmartLinkSize, SmartLinkTheme } from '../../constants';
|
|
6
|
+
// Temporary fix for Confluence inline comment on editor mod has z-index of 500, Jira issue view has z-index of 510
|
|
7
|
+
export var HOVER_CARD_Z_INDEX = 511;
|
|
6
8
|
export var flexibleUiOptions = {
|
|
7
9
|
hideBackground: true,
|
|
8
10
|
hideElevation: true,
|
|
@@ -10,7 +12,8 @@ export var flexibleUiOptions = {
|
|
|
10
12
|
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage
|
|
11
13
|
theme: SmartLinkTheme.Black,
|
|
12
14
|
hidePadding: true,
|
|
13
|
-
hideHoverCardPreviewButton: false
|
|
15
|
+
hideHoverCardPreviewButton: false,
|
|
16
|
+
zIndex: HOVER_CARD_Z_INDEX + 1
|
|
14
17
|
};
|
|
15
18
|
export var CARD_WIDTH_REM = 24;
|
|
16
19
|
// gap between mouse cursor and hover card
|
|
@@ -47,7 +47,9 @@ export var InlineCardResolvedView = /*#__PURE__*/function (_React$Component) {
|
|
|
47
47
|
titleTextColor = _this$props.titleTextColor,
|
|
48
48
|
titlePrefix = _this$props.titlePrefix,
|
|
49
49
|
_this$props$showHover = _this$props.showHoverPreview,
|
|
50
|
-
showHoverPreview = _this$props$showHover === void 0 ? false : _this$props$showHover
|
|
50
|
+
showHoverPreview = _this$props$showHover === void 0 ? false : _this$props$showHover,
|
|
51
|
+
_this$props$showServe = _this$props.showServerActions,
|
|
52
|
+
showServerActions = _this$props$showServe === void 0 ? false : _this$props$showServe;
|
|
51
53
|
var inlineCardResolvedView = /*#__PURE__*/React.createElement(Frame, {
|
|
52
54
|
testId: testId,
|
|
53
55
|
link: link,
|
|
@@ -62,6 +64,7 @@ export var InlineCardResolvedView = /*#__PURE__*/function (_React$Component) {
|
|
|
62
64
|
if (showHoverPreview && link) {
|
|
63
65
|
return /*#__PURE__*/React.createElement(HoverCard, {
|
|
64
66
|
id: id,
|
|
67
|
+
showServerActions: showServerActions,
|
|
65
68
|
url: link
|
|
66
69
|
}, inlineCardResolvedView);
|
|
67
70
|
}
|
|
@@ -28,7 +28,8 @@ export var InlineCard = function InlineCard(_ref) {
|
|
|
28
28
|
testId = _ref.testId,
|
|
29
29
|
inlinePreloaderStyle = _ref.inlinePreloaderStyle,
|
|
30
30
|
showHoverPreview = _ref.showHoverPreview,
|
|
31
|
-
showAuthTooltip = _ref.showAuthTooltip
|
|
31
|
+
showAuthTooltip = _ref.showAuthTooltip,
|
|
32
|
+
showServerActions = _ref.showServerActions;
|
|
32
33
|
var status = cardState.status,
|
|
33
34
|
details = cardState.details;
|
|
34
35
|
var cardDetails = details && details.data || getEmptyJsonLd();
|
|
@@ -59,6 +60,7 @@ export var InlineCard = function InlineCard(_ref) {
|
|
|
59
60
|
return /*#__PURE__*/React.createElement(InlineCardResolvedView, _extends({}, resolvedProps, {
|
|
60
61
|
id: id,
|
|
61
62
|
showHoverPreview: showHoverPreview,
|
|
63
|
+
showServerActions: showServerActions,
|
|
62
64
|
link: url,
|
|
63
65
|
isSelected: isSelected,
|
|
64
66
|
onClick: handleFrameClick,
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
meta: {
|
|
3
|
+
visibility: string;
|
|
4
|
+
access: string;
|
|
5
|
+
resourceType: string;
|
|
6
|
+
key: string;
|
|
7
|
+
};
|
|
8
|
+
data: {
|
|
9
|
+
'@id': string;
|
|
10
|
+
'@context': {
|
|
11
|
+
'@vocab': string;
|
|
12
|
+
atlassian: string;
|
|
13
|
+
schema: string;
|
|
14
|
+
};
|
|
15
|
+
'@type': string[];
|
|
16
|
+
url: string;
|
|
17
|
+
attributedTo: {
|
|
18
|
+
'@type': string;
|
|
19
|
+
name: string;
|
|
20
|
+
icon: string;
|
|
21
|
+
};
|
|
22
|
+
'schema:dateCreated': string;
|
|
23
|
+
generator: {
|
|
24
|
+
'@type': string;
|
|
25
|
+
name: string;
|
|
26
|
+
icon: {
|
|
27
|
+
'@type': string;
|
|
28
|
+
url: string;
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
icon: {
|
|
32
|
+
'@type': string;
|
|
33
|
+
url: string;
|
|
34
|
+
};
|
|
35
|
+
name: string;
|
|
36
|
+
summary: string;
|
|
37
|
+
'atlassian:mergeSource': {
|
|
38
|
+
'@type': string;
|
|
39
|
+
href: string;
|
|
40
|
+
name: string;
|
|
41
|
+
};
|
|
42
|
+
'atlassian:mergeDestination': {
|
|
43
|
+
'@type': string;
|
|
44
|
+
href: string;
|
|
45
|
+
name: string;
|
|
46
|
+
};
|
|
47
|
+
updated: string;
|
|
48
|
+
'atlassian:internalId': string;
|
|
49
|
+
'atlassian:isMerged': boolean;
|
|
50
|
+
'atlassian:state': string;
|
|
51
|
+
'atlassian:reviewer': {
|
|
52
|
+
'@type': string;
|
|
53
|
+
name: string;
|
|
54
|
+
icon: string;
|
|
55
|
+
}[];
|
|
56
|
+
'atlassian:updatedBy': {
|
|
57
|
+
'@type': string;
|
|
58
|
+
name: string;
|
|
59
|
+
icon: string;
|
|
60
|
+
};
|
|
61
|
+
audience: {
|
|
62
|
+
'@type': string;
|
|
63
|
+
name: string;
|
|
64
|
+
icon: string;
|
|
65
|
+
}[];
|
|
66
|
+
context: {
|
|
67
|
+
'@type': string;
|
|
68
|
+
name: string;
|
|
69
|
+
url: string;
|
|
70
|
+
};
|
|
71
|
+
};
|
|
72
|
+
};
|
|
73
|
+
export default _default;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
meta: {
|
|
3
|
+
auth: never[];
|
|
4
|
+
definitionId: string;
|
|
5
|
+
visibility: string;
|
|
6
|
+
access: string;
|
|
7
|
+
resourceType: string;
|
|
8
|
+
key: string;
|
|
9
|
+
};
|
|
10
|
+
data: {
|
|
11
|
+
'@context': {
|
|
12
|
+
'@vocab': string;
|
|
13
|
+
atlassian: string;
|
|
14
|
+
schema: string;
|
|
15
|
+
};
|
|
16
|
+
generator: {
|
|
17
|
+
'@type': string;
|
|
18
|
+
'@id': string;
|
|
19
|
+
name: string;
|
|
20
|
+
};
|
|
21
|
+
'@type': string[];
|
|
22
|
+
url: string;
|
|
23
|
+
name: string;
|
|
24
|
+
'atlassian:state': string;
|
|
25
|
+
summary: string;
|
|
26
|
+
'schema:commentCount': number;
|
|
27
|
+
'atlassian:subscriberCount': number;
|
|
28
|
+
'atlassian:titlePrefix': {
|
|
29
|
+
text: string;
|
|
30
|
+
'@type': string;
|
|
31
|
+
};
|
|
32
|
+
'atlassian:attributedTo': {
|
|
33
|
+
'@type': string;
|
|
34
|
+
name: string;
|
|
35
|
+
icon: string;
|
|
36
|
+
};
|
|
37
|
+
'atlassian:ownedBy': {
|
|
38
|
+
'@type': string;
|
|
39
|
+
name: string;
|
|
40
|
+
icon: string;
|
|
41
|
+
};
|
|
42
|
+
preview: {
|
|
43
|
+
'@type': string;
|
|
44
|
+
href: string;
|
|
45
|
+
'atlassian:supportedPlatforms': string[];
|
|
46
|
+
};
|
|
47
|
+
};
|
|
48
|
+
};
|
|
49
|
+
export default _default;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
meta: {
|
|
3
|
+
auth: never[];
|
|
4
|
+
definitionId: string;
|
|
5
|
+
visibility: string;
|
|
6
|
+
access: string;
|
|
7
|
+
resourceType: string;
|
|
8
|
+
key: string;
|
|
9
|
+
};
|
|
10
|
+
data: {
|
|
11
|
+
'@context': {
|
|
12
|
+
'@vocab': string;
|
|
13
|
+
atlassian: string;
|
|
14
|
+
schema: string;
|
|
15
|
+
};
|
|
16
|
+
generator: {
|
|
17
|
+
'@type': string;
|
|
18
|
+
'@id': string;
|
|
19
|
+
name: string;
|
|
20
|
+
};
|
|
21
|
+
'@type': string[];
|
|
22
|
+
url: string;
|
|
23
|
+
name: string;
|
|
24
|
+
'atlassian:state': string;
|
|
25
|
+
summary: string;
|
|
26
|
+
'schema:commentCount': number;
|
|
27
|
+
'atlassian:subscriberCount': number;
|
|
28
|
+
'atlassian:titlePrefix': {
|
|
29
|
+
text: string;
|
|
30
|
+
'@type': string;
|
|
31
|
+
};
|
|
32
|
+
'atlassian:attributedTo': {
|
|
33
|
+
'@type': string;
|
|
34
|
+
name: string;
|
|
35
|
+
icon: string;
|
|
36
|
+
};
|
|
37
|
+
'atlassian:ownedBy': {
|
|
38
|
+
'@type': string;
|
|
39
|
+
name: string;
|
|
40
|
+
icon: string;
|
|
41
|
+
};
|
|
42
|
+
preview: {
|
|
43
|
+
'@type': string;
|
|
44
|
+
href: string;
|
|
45
|
+
'atlassian:supportedPlatforms': string[];
|
|
46
|
+
};
|
|
47
|
+
};
|
|
48
|
+
};
|
|
49
|
+
export default _default;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
meta: {
|
|
3
|
+
auth: never[];
|
|
4
|
+
definitionId: string;
|
|
5
|
+
visibility: string;
|
|
6
|
+
access: string;
|
|
7
|
+
resourceType: string;
|
|
8
|
+
key: string;
|
|
9
|
+
};
|
|
10
|
+
data: {
|
|
11
|
+
'@context': {
|
|
12
|
+
'@vocab': string;
|
|
13
|
+
atlassian: string;
|
|
14
|
+
schema: string;
|
|
15
|
+
};
|
|
16
|
+
generator: {
|
|
17
|
+
'@type': string;
|
|
18
|
+
'@id': string;
|
|
19
|
+
name: string;
|
|
20
|
+
};
|
|
21
|
+
'@type': string[];
|
|
22
|
+
url: string;
|
|
23
|
+
icon: {
|
|
24
|
+
'@type': string;
|
|
25
|
+
url: string;
|
|
26
|
+
};
|
|
27
|
+
name: string;
|
|
28
|
+
'atlassian:state': string;
|
|
29
|
+
summary: string;
|
|
30
|
+
'atlassian:titlePrefix': {
|
|
31
|
+
text: string;
|
|
32
|
+
'@type': string;
|
|
33
|
+
};
|
|
34
|
+
};
|
|
35
|
+
};
|
|
36
|
+
export default _default;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
data: {
|
|
3
|
+
'@context': {
|
|
4
|
+
'@vocab': string;
|
|
5
|
+
atlassian: string;
|
|
6
|
+
schema: string;
|
|
7
|
+
};
|
|
8
|
+
'@type': string[];
|
|
9
|
+
generator: {
|
|
10
|
+
'@id': string;
|
|
11
|
+
'@type': string;
|
|
12
|
+
name: string;
|
|
13
|
+
};
|
|
14
|
+
icon: undefined;
|
|
15
|
+
name: string;
|
|
16
|
+
summary: string;
|
|
17
|
+
'atlassian:titlePrefix': {
|
|
18
|
+
'@type': string;
|
|
19
|
+
text: string;
|
|
20
|
+
};
|
|
21
|
+
url: string;
|
|
22
|
+
};
|
|
23
|
+
meta: {
|
|
24
|
+
access: string;
|
|
25
|
+
auth: never[];
|
|
26
|
+
definitionId: string;
|
|
27
|
+
resourceType: string;
|
|
28
|
+
visibility: string;
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
export default _default;
|