@atlaskit/smart-card 26.43.10 → 26.44.1
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 +13 -0
- package/dist/cjs/extractors/flexible/extract-state.js +3 -4
- package/dist/cjs/utils/analytics/analytics.js +1 -1
- package/dist/cjs/view/FlexibleCard/components/container/hover-card-control/index.js +2 -6
- package/dist/cjs/view/FlexibleCard/components/elements/lozenge/lozenge-action/index.js +1 -2
- package/dist/cjs/view/FlexibleCard/components/elements/lozenge/lozenge-action/lozenge-action-trigger/index.js +2 -7
- package/dist/cjs/view/HoverCard/components/HoverCardContent.js +1 -3
- package/dist/cjs/view/InlineCard/Frame/styled.js +64 -15
- package/dist/cjs/view/LinkUrl/index.js +1 -1
- package/dist/es2019/extractors/flexible/extract-state.js +3 -4
- package/dist/es2019/utils/analytics/analytics.js +1 -1
- package/dist/es2019/view/FlexibleCard/components/container/hover-card-control/index.js +2 -6
- package/dist/es2019/view/FlexibleCard/components/elements/lozenge/lozenge-action/index.js +1 -2
- package/dist/es2019/view/FlexibleCard/components/elements/lozenge/lozenge-action/lozenge-action-trigger/index.js +1 -6
- package/dist/es2019/view/HoverCard/components/HoverCardContent.js +1 -3
- package/dist/es2019/view/InlineCard/Frame/styled.js +69 -62
- package/dist/es2019/view/LinkUrl/index.js +1 -1
- package/dist/esm/extractors/flexible/extract-state.js +3 -4
- package/dist/esm/utils/analytics/analytics.js +1 -1
- package/dist/esm/view/FlexibleCard/components/container/hover-card-control/index.js +2 -6
- package/dist/esm/view/FlexibleCard/components/elements/lozenge/lozenge-action/index.js +1 -2
- package/dist/esm/view/FlexibleCard/components/elements/lozenge/lozenge-action/lozenge-action-trigger/index.js +2 -7
- package/dist/esm/view/HoverCard/components/HoverCardContent.js +1 -3
- package/dist/esm/view/InlineCard/Frame/styled.js +64 -15
- package/dist/esm/view/LinkUrl/index.js +1 -1
- package/dist/types/extractors/common/lozenge/types.d.ts +1 -3
- package/dist/types/extractors/flexible/actions/extract-follow-action.d.ts +1 -2
- package/dist/types/extractors/flexible/extract-state.d.ts +1 -2
- package/dist/types/view/FlexibleCard/components/elements/lozenge/lozenge-action/lozenge-action-trigger/type.d.ts +0 -1
- package/dist/types/view/FlexibleCard/types.d.ts +1 -22
- package/dist/types-ts4.5/extractors/common/lozenge/types.d.ts +1 -3
- package/dist/types-ts4.5/extractors/flexible/actions/extract-follow-action.d.ts +1 -2
- package/dist/types-ts4.5/extractors/flexible/extract-state.d.ts +1 -2
- package/dist/types-ts4.5/view/FlexibleCard/components/elements/lozenge/lozenge-action/lozenge-action-trigger/type.d.ts +0 -1
- package/dist/types-ts4.5/view/FlexibleCard/types.d.ts +1 -22
- package/package.json +7 -8
- package/dist/cjs/view/FlexibleCard/components/elements/lozenge/lozenge-action/feature-discovery/index.js +0 -57
- package/dist/cjs/view/FlexibleCard/components/elements/lozenge/lozenge-action/feature-discovery/styled.js +0 -31
- package/dist/cjs/view/FlexibleCard/components/elements/lozenge/lozenge-action/feature-discovery/types.js +0 -5
- package/dist/es2019/view/FlexibleCard/components/elements/lozenge/lozenge-action/feature-discovery/index.js +0 -47
- package/dist/es2019/view/FlexibleCard/components/elements/lozenge/lozenge-action/feature-discovery/styled.js +0 -29
- package/dist/es2019/view/FlexibleCard/components/elements/lozenge/lozenge-action/feature-discovery/types.js +0 -1
- package/dist/esm/view/FlexibleCard/components/elements/lozenge/lozenge-action/feature-discovery/index.js +0 -50
- package/dist/esm/view/FlexibleCard/components/elements/lozenge/lozenge-action/feature-discovery/styled.js +0 -24
- package/dist/esm/view/FlexibleCard/components/elements/lozenge/lozenge-action/feature-discovery/types.js +0 -1
- package/dist/types/view/FlexibleCard/components/elements/lozenge/lozenge-action/feature-discovery/index.d.ts +0 -10
- package/dist/types/view/FlexibleCard/components/elements/lozenge/lozenge-action/feature-discovery/styled.d.ts +0 -2
- package/dist/types/view/FlexibleCard/components/elements/lozenge/lozenge-action/feature-discovery/types.d.ts +0 -7
- package/dist/types-ts4.5/view/FlexibleCard/components/elements/lozenge/lozenge-action/feature-discovery/index.d.ts +0 -10
- package/dist/types-ts4.5/view/FlexibleCard/components/elements/lozenge/lozenge-action/feature-discovery/styled.d.ts +0 -2
- package/dist/types-ts4.5/view/FlexibleCard/components/elements/lozenge/lozenge-action/feature-discovery/types.d.ts +0 -7
|
@@ -1,30 +1,55 @@
|
|
|
1
|
-
import
|
|
2
|
-
var
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
3
4
|
import styled from '@emotion/styled';
|
|
4
5
|
import { B50, B100, B200, B400, N40 } from '@atlaskit/theme/colors';
|
|
5
|
-
var
|
|
6
|
+
var selectedStyles = {
|
|
7
|
+
cursor: 'pointer',
|
|
8
|
+
boxShadow: "0 0 0 2px ".concat("var(--ds-border-selected, ".concat(B100, ")")),
|
|
9
|
+
outline: 'none',
|
|
10
|
+
userSelect: 'none',
|
|
11
|
+
'&, :hover, :focus, :active': {
|
|
12
|
+
textDecoration: 'none'
|
|
13
|
+
},
|
|
14
|
+
'&:hover': {
|
|
15
|
+
border: "1px solid ".concat("var(--ds-border, ".concat(N40, ")"))
|
|
16
|
+
}
|
|
17
|
+
};
|
|
6
18
|
var isInteractive = function isInteractive(_ref) {
|
|
7
19
|
var isInteractive = _ref.isInteractive;
|
|
8
20
|
if (isInteractive) {
|
|
9
|
-
return
|
|
10
|
-
|
|
11
|
-
|
|
21
|
+
return {
|
|
22
|
+
':active': {
|
|
23
|
+
backgroundColor: "var(--ds-background-selected, ".concat(B50, ")")
|
|
24
|
+
},
|
|
25
|
+
':focus': selectedStyles
|
|
26
|
+
};
|
|
12
27
|
}
|
|
28
|
+
return undefined;
|
|
13
29
|
};
|
|
14
30
|
var isSelected = function isSelected(_ref2) {
|
|
15
31
|
var isSelected = _ref2.isSelected;
|
|
16
32
|
if (isSelected) {
|
|
17
|
-
return
|
|
33
|
+
return selectedStyles;
|
|
18
34
|
} else {
|
|
19
|
-
return
|
|
35
|
+
return {
|
|
36
|
+
userSelect: 'text'
|
|
37
|
+
};
|
|
20
38
|
}
|
|
21
39
|
};
|
|
22
|
-
var hoveredStyles =
|
|
40
|
+
var hoveredStyles = {
|
|
41
|
+
borderColor: "var(--ds-border-accent-blue, ".concat(B200, ")")
|
|
42
|
+
};
|
|
23
43
|
var activeHoveredFocusedStyles = function activeHoveredFocusedStyles(props) {
|
|
24
|
-
|
|
44
|
+
if (props.withoutBackground) {
|
|
45
|
+
return undefined;
|
|
46
|
+
}
|
|
47
|
+
return {
|
|
48
|
+
textDecoration: 'none'
|
|
49
|
+
};
|
|
25
50
|
};
|
|
26
51
|
var hoveredWihBorderStyles = function hoveredWihBorderStyles(props) {
|
|
27
|
-
return
|
|
52
|
+
return _objectSpread(_objectSpread({}, hoveredStyles), activeHoveredFocusedStyles(props));
|
|
28
53
|
};
|
|
29
54
|
|
|
30
55
|
/*
|
|
@@ -39,10 +64,34 @@ var hoveredWihBorderStyles = function hoveredWihBorderStyles(props) {
|
|
|
39
64
|
// NB: `padding` consistent with @mentions.
|
|
40
65
|
// NB: `display: inline` required for `box-decoration-break` to work.
|
|
41
66
|
// NB: `box-decoration-break` required for retaining properties (border-radius) on wrap.
|
|
42
|
-
var
|
|
43
|
-
return
|
|
67
|
+
var baseWrapperStyles = function baseWrapperStyles(props) {
|
|
68
|
+
return _objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread({
|
|
69
|
+
lineHeight: '22px',
|
|
70
|
+
padding: "var(--ds-space-025, 2px)".concat(" 0px")
|
|
71
|
+
}, props.withoutBackground ? {
|
|
72
|
+
paddingLeft: 0,
|
|
73
|
+
marginLeft: "var(--ds-space-negative-025, -2px)"
|
|
74
|
+
} : undefined), {}, {
|
|
75
|
+
display: 'inline',
|
|
76
|
+
boxDecorationBreak: 'clone',
|
|
77
|
+
borderRadius: "var(--ds-border-radius-100, 4px)",
|
|
78
|
+
color: "var(--ds-link, ".concat(B400, ")")
|
|
79
|
+
}, props.withoutBackground ? undefined : {
|
|
80
|
+
backgroundColor: "var(--ds-surface-raised, white)"
|
|
81
|
+
}), isSelected(props)), props.withoutBackground ? undefined : {
|
|
82
|
+
border: "1px solid ".concat("var(--ds-border, ".concat(N40, ")"))
|
|
83
|
+
}), {}, {
|
|
84
|
+
'&:hover': hoveredStyles,
|
|
85
|
+
'&, :hover, :focus, :active': activeHoveredFocusedStyles(props),
|
|
86
|
+
transition: '0.1s all ease-in-out',
|
|
87
|
+
MozUserSelect: 'none'
|
|
88
|
+
}, props.isHovered ? hoveredWihBorderStyles(props) : undefined);
|
|
44
89
|
};
|
|
45
|
-
export var WrapperAnchor = styled.a(
|
|
90
|
+
export var WrapperAnchor = styled.a(function (props) {
|
|
91
|
+
return _objectSpread(_objectSpread({}, baseWrapperStyles(props)), isInteractive(props));
|
|
92
|
+
});
|
|
46
93
|
WrapperAnchor.displayName = 'WrapperAnchor';
|
|
47
|
-
export var WrapperSpan = styled.span(
|
|
94
|
+
export var WrapperSpan = styled.span(function (props) {
|
|
95
|
+
return _objectSpread({}, baseWrapperStyles(props));
|
|
96
|
+
});
|
|
48
97
|
WrapperSpan.displayName = 'WrapperSpan';
|
|
@@ -10,7 +10,7 @@ import { useLinkWarningModal } from './LinkWarningModal/hooks/use-link-warning-m
|
|
|
10
10
|
import LinkWarningModal from './LinkWarningModal';
|
|
11
11
|
var PACKAGE_DATA = {
|
|
12
12
|
packageName: "@atlaskit/smart-card",
|
|
13
|
-
packageVersion: "26.
|
|
13
|
+
packageVersion: "26.44.1",
|
|
14
14
|
componentName: 'linkUrl'
|
|
15
15
|
};
|
|
16
16
|
var Link = withLinkClickedEvent('a');
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import { InvokeActions } from '../../../state/hooks/use-invoke/types';
|
|
2
2
|
export type LinkLozengeColor = 'default' | 'success' | 'removed' | 'inprogress' | 'new' | 'moved';
|
|
3
|
-
export type LinkLozengeInvokeActions = InvokeActions
|
|
4
|
-
showFeatureDiscovery?: boolean;
|
|
5
|
-
};
|
|
3
|
+
export type LinkLozengeInvokeActions = InvokeActions;
|
|
6
4
|
export interface LinkLozenge {
|
|
7
5
|
action?: LinkLozengeInvokeActions;
|
|
8
6
|
text: string;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import type { JsonLd } from 'json-ld-types';
|
|
2
2
|
import { ServerActionProp } from '../../../state/flexible-ui-context/types';
|
|
3
|
-
|
|
4
|
-
declare const extractFollowAction: (response?: JsonLd.Response, showServerActions?: boolean | ServerActionOptions, id?: string) => ServerActionProp<boolean> | undefined;
|
|
3
|
+
declare const extractFollowAction: (response?: JsonLd.Response, showServerActions?: boolean, id?: string) => ServerActionProp<boolean> | undefined;
|
|
5
4
|
export default extractFollowAction;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import type { JsonLd } from 'json-ld-types';
|
|
2
2
|
import type { LinkLozenge } from '../common/lozenge/types';
|
|
3
|
-
|
|
4
|
-
declare const extractState: (response?: JsonLd.Response, showServerActions?: boolean | ServerActionOptions, id?: string) => LinkLozenge | undefined;
|
|
3
|
+
declare const extractState: (response?: JsonLd.Response, showServerActions?: boolean, id?: string) => LinkLozenge | undefined;
|
|
5
4
|
export default extractState;
|
|
@@ -4,7 +4,6 @@ import type { CustomTriggerProps } from '@atlaskit/dropdown-menu';
|
|
|
4
4
|
export type LozengeActionTriggerProps = {
|
|
5
5
|
appearance?: ThemeAppearance;
|
|
6
6
|
isOpen?: boolean;
|
|
7
|
-
showFeatureDiscovery?: boolean;
|
|
8
7
|
testId?: string;
|
|
9
8
|
text: string | React.ReactNode;
|
|
10
9
|
} & CustomTriggerProps<HTMLButtonElement>;
|
|
@@ -59,7 +59,7 @@ export type FlexibleCardProps = {
|
|
|
59
59
|
/**
|
|
60
60
|
* Determines whether to show available server actions.
|
|
61
61
|
*/
|
|
62
|
-
showServerActions?: boolean
|
|
62
|
+
showServerActions?: boolean;
|
|
63
63
|
/**
|
|
64
64
|
* A `testId` prop is provided for specified elements, which is a unique
|
|
65
65
|
* string that appears as a data attribute `data-testid` in the rendered code,
|
|
@@ -124,27 +124,6 @@ export type FlexibleUiOptions = {
|
|
|
124
124
|
*/
|
|
125
125
|
zIndex?: number;
|
|
126
126
|
};
|
|
127
|
-
/**
|
|
128
|
-
* Server action options to control action behaviour.
|
|
129
|
-
*
|
|
130
|
-
* If the type is applied to exported component (<Card />, <HoverCard />)
|
|
131
|
-
* please verify with the team if the deprecated prop can be removed prior.
|
|
132
|
-
*
|
|
133
|
-
* In the case that it is being exposed in HoverCard, please remove
|
|
134
|
-
* boolean conversion `Boolean(showServerActions)` in
|
|
135
|
-
* /src/view/FlexibleCard/components/container/index.tsx line 287
|
|
136
|
-
* @internal
|
|
137
|
-
*/
|
|
138
|
-
export type ServerActionOptions = {
|
|
139
|
-
/**
|
|
140
|
-
* DO NOT USE: This prop is part of an experiment. It will be removed once
|
|
141
|
-
* the experiment is completed.
|
|
142
|
-
* @see https://team.atlassian.com/project/ATLAS-13099/about
|
|
143
|
-
* @internal
|
|
144
|
-
* @deprecated
|
|
145
|
-
*/
|
|
146
|
-
showStateActionFeatureDiscovery?: boolean;
|
|
147
|
-
};
|
|
148
127
|
/**
|
|
149
128
|
* Retry options used if Smart Link resolves to an errored state.
|
|
150
129
|
*/
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import { InvokeActions } from '../../../state/hooks/use-invoke/types';
|
|
2
2
|
export type LinkLozengeColor = 'default' | 'success' | 'removed' | 'inprogress' | 'new' | 'moved';
|
|
3
|
-
export type LinkLozengeInvokeActions = InvokeActions
|
|
4
|
-
showFeatureDiscovery?: boolean;
|
|
5
|
-
};
|
|
3
|
+
export type LinkLozengeInvokeActions = InvokeActions;
|
|
6
4
|
export interface LinkLozenge {
|
|
7
5
|
action?: LinkLozengeInvokeActions;
|
|
8
6
|
text: string;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import type { JsonLd } from 'json-ld-types';
|
|
2
2
|
import { ServerActionProp } from '../../../state/flexible-ui-context/types';
|
|
3
|
-
|
|
4
|
-
declare const extractFollowAction: (response?: JsonLd.Response, showServerActions?: boolean | ServerActionOptions, id?: string) => ServerActionProp<boolean> | undefined;
|
|
3
|
+
declare const extractFollowAction: (response?: JsonLd.Response, showServerActions?: boolean, id?: string) => ServerActionProp<boolean> | undefined;
|
|
5
4
|
export default extractFollowAction;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import type { JsonLd } from 'json-ld-types';
|
|
2
2
|
import type { LinkLozenge } from '../common/lozenge/types';
|
|
3
|
-
|
|
4
|
-
declare const extractState: (response?: JsonLd.Response, showServerActions?: boolean | ServerActionOptions, id?: string) => LinkLozenge | undefined;
|
|
3
|
+
declare const extractState: (response?: JsonLd.Response, showServerActions?: boolean, id?: string) => LinkLozenge | undefined;
|
|
5
4
|
export default extractState;
|
|
@@ -4,7 +4,6 @@ import type { CustomTriggerProps } from '@atlaskit/dropdown-menu';
|
|
|
4
4
|
export type LozengeActionTriggerProps = {
|
|
5
5
|
appearance?: ThemeAppearance;
|
|
6
6
|
isOpen?: boolean;
|
|
7
|
-
showFeatureDiscovery?: boolean;
|
|
8
7
|
testId?: string;
|
|
9
8
|
text: string | React.ReactNode;
|
|
10
9
|
} & CustomTriggerProps<HTMLButtonElement>;
|
|
@@ -59,7 +59,7 @@ export type FlexibleCardProps = {
|
|
|
59
59
|
/**
|
|
60
60
|
* Determines whether to show available server actions.
|
|
61
61
|
*/
|
|
62
|
-
showServerActions?: boolean
|
|
62
|
+
showServerActions?: boolean;
|
|
63
63
|
/**
|
|
64
64
|
* A `testId` prop is provided for specified elements, which is a unique
|
|
65
65
|
* string that appears as a data attribute `data-testid` in the rendered code,
|
|
@@ -124,27 +124,6 @@ export type FlexibleUiOptions = {
|
|
|
124
124
|
*/
|
|
125
125
|
zIndex?: number;
|
|
126
126
|
};
|
|
127
|
-
/**
|
|
128
|
-
* Server action options to control action behaviour.
|
|
129
|
-
*
|
|
130
|
-
* If the type is applied to exported component (<Card />, <HoverCard />)
|
|
131
|
-
* please verify with the team if the deprecated prop can be removed prior.
|
|
132
|
-
*
|
|
133
|
-
* In the case that it is being exposed in HoverCard, please remove
|
|
134
|
-
* boolean conversion `Boolean(showServerActions)` in
|
|
135
|
-
* /src/view/FlexibleCard/components/container/index.tsx line 287
|
|
136
|
-
* @internal
|
|
137
|
-
*/
|
|
138
|
-
export type ServerActionOptions = {
|
|
139
|
-
/**
|
|
140
|
-
* DO NOT USE: This prop is part of an experiment. It will be removed once
|
|
141
|
-
* the experiment is completed.
|
|
142
|
-
* @see https://team.atlassian.com/project/ATLAS-13099/about
|
|
143
|
-
* @internal
|
|
144
|
-
* @deprecated
|
|
145
|
-
*/
|
|
146
|
-
showStateActionFeatureDiscovery?: boolean;
|
|
147
|
-
};
|
|
148
127
|
/**
|
|
149
128
|
* Retry options used if Smart Link resolves to an errored state.
|
|
150
129
|
*/
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/smart-card",
|
|
3
|
-
"version": "26.
|
|
3
|
+
"version": "26.44.1",
|
|
4
4
|
"description": "Smart card component",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -27,9 +27,8 @@
|
|
|
27
27
|
"@atlaskit/avatar": "^21.4.0",
|
|
28
28
|
"@atlaskit/avatar-group": "^9.5.0",
|
|
29
29
|
"@atlaskit/badge": "^15.2.0",
|
|
30
|
-
"@atlaskit/button": "^17.
|
|
30
|
+
"@atlaskit/button": "^17.2.0",
|
|
31
31
|
"@atlaskit/dropdown-menu": "^12.1.0",
|
|
32
|
-
"@atlaskit/frontend-utilities": "^2.7.0",
|
|
33
32
|
"@atlaskit/icon": "^22.0.0",
|
|
34
33
|
"@atlaskit/icon-file-type": "^6.4.0",
|
|
35
34
|
"@atlaskit/icon-object": "^6.3.0",
|
|
@@ -38,15 +37,15 @@
|
|
|
38
37
|
"@atlaskit/link-analytics": "^8.3.0",
|
|
39
38
|
"@atlaskit/link-client-extension": "^1.8.0",
|
|
40
39
|
"@atlaskit/link-extractors": "^1.2.0",
|
|
41
|
-
"@atlaskit/linking-common": "^5.
|
|
40
|
+
"@atlaskit/linking-common": "^5.3.0",
|
|
42
41
|
"@atlaskit/linking-types": "^8.5.0",
|
|
43
|
-
"@atlaskit/logo": "^13.
|
|
44
|
-
"@atlaskit/lozenge": "^11.
|
|
42
|
+
"@atlaskit/logo": "^13.15.0",
|
|
43
|
+
"@atlaskit/lozenge": "^11.6.0",
|
|
45
44
|
"@atlaskit/modal-dialog": "^12.10.0",
|
|
46
45
|
"@atlaskit/outbound-auth-flow-client": "^3.4.0",
|
|
47
46
|
"@atlaskit/platform-feature-flags": "^0.2.1",
|
|
48
47
|
"@atlaskit/popup": "^1.11.0",
|
|
49
|
-
"@atlaskit/primitives": "^1.
|
|
48
|
+
"@atlaskit/primitives": "^1.17.0",
|
|
50
49
|
"@atlaskit/spinner": "^16.0.0",
|
|
51
50
|
"@atlaskit/theme": "^12.6.0",
|
|
52
51
|
"@atlaskit/tokens": "^1.33.0",
|
|
@@ -74,7 +73,7 @@
|
|
|
74
73
|
},
|
|
75
74
|
"devDependencies": {
|
|
76
75
|
"@af/visual-regression": "*",
|
|
77
|
-
"@atlaskit/analytics-listeners": "^8.
|
|
76
|
+
"@atlaskit/analytics-listeners": "^8.9.0",
|
|
78
77
|
"@atlaskit/css-reset": "^6.6.0",
|
|
79
78
|
"@atlaskit/link-test-helpers": "^6.2.0",
|
|
80
79
|
"@atlaskit/media-test-helpers": "^33.0.0",
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
var _react = require("@emotion/react");
|
|
8
|
-
var _react2 = require("react");
|
|
9
|
-
var _storageClient = require("@atlaskit/frontend-utilities/storage-client");
|
|
10
|
-
var _styled = require("./styled");
|
|
11
|
-
/** @jsx jsx */
|
|
12
|
-
|
|
13
|
-
var LOCAL_STORAGE_CLIENT_KEY = '@atlaskit/smart-card';
|
|
14
|
-
var LOCAL_STORAGE_DISCOVERY_KEY = 'action-discovery-status';
|
|
15
|
-
var LOCAL_STORAGE_DISCOVERY_VALUE = 'discovered';
|
|
16
|
-
var LOCAL_STORAGE_DISCOVERY_EXPIRY_IN_MS = 15552000000; // 180 days
|
|
17
|
-
var LOCAL_STORAGE_DISCOVERY_REQUIRED_TIME = 2000; // 2s
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
* This is a hacky solution to help with the feature discovery.
|
|
21
|
-
* This implementation must be removed once the experiment is completed.
|
|
22
|
-
* Cleanup on https://product-fabric.atlassian.net/browse/EDM-5795
|
|
23
|
-
* @see https://team.atlassian.com/project/ATLAS-13099/about
|
|
24
|
-
*/
|
|
25
|
-
var FeatureDiscovery = function FeatureDiscovery(_ref) {
|
|
26
|
-
var appearance = _ref.appearance,
|
|
27
|
-
children = _ref.children,
|
|
28
|
-
testId = _ref.testId;
|
|
29
|
-
var renderedTime = (0, _react2.useRef)();
|
|
30
|
-
var storageClient = (0, _react2.useMemo)(function () {
|
|
31
|
-
return new _storageClient.StorageClient(LOCAL_STORAGE_CLIENT_KEY);
|
|
32
|
-
}, []);
|
|
33
|
-
var discovered = (0, _react2.useMemo)(function () {
|
|
34
|
-
return storageClient.getItem(LOCAL_STORAGE_DISCOVERY_KEY) === LOCAL_STORAGE_DISCOVERY_VALUE;
|
|
35
|
-
}, [storageClient]);
|
|
36
|
-
(0, _react2.useEffect)(function () {
|
|
37
|
-
renderedTime.current = Date.now();
|
|
38
|
-
return function () {
|
|
39
|
-
if (!discovered && renderedTime.current) {
|
|
40
|
-
var duration = Date.now() - renderedTime.current;
|
|
41
|
-
if (duration > LOCAL_STORAGE_DISCOVERY_REQUIRED_TIME) {
|
|
42
|
-
storageClient.setItemWithExpiry(LOCAL_STORAGE_DISCOVERY_KEY, LOCAL_STORAGE_DISCOVERY_VALUE, LOCAL_STORAGE_DISCOVERY_EXPIRY_IN_MS);
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
};
|
|
46
|
-
}, [storageClient, discovered]);
|
|
47
|
-
var component = (0, _react2.useMemo)(function () {
|
|
48
|
-
if (!discovered) {
|
|
49
|
-
return (0, _react.jsx)("span", {
|
|
50
|
-
css: (0, _styled.getPulseStyles)(appearance),
|
|
51
|
-
"data-testid": "".concat(testId, "-discovery")
|
|
52
|
-
}, children);
|
|
53
|
-
}
|
|
54
|
-
}, [appearance, children, discovered, testId]);
|
|
55
|
-
return component !== null && component !== void 0 ? component : children;
|
|
56
|
-
};
|
|
57
|
-
var _default = exports.default = FeatureDiscovery;
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.getPulseStyles = void 0;
|
|
8
|
-
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
9
|
-
var _react = require("@emotion/react");
|
|
10
|
-
var _templateObject, _templateObject2;
|
|
11
|
-
var pulseKeyframes = (0, _react.keyframes)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n to {\n box-shadow: 0 0 0 7px rgba(0, 0, 0, 0);\n }\n"])));
|
|
12
|
-
var getPulseColor = function getPulseColor(appearance) {
|
|
13
|
-
switch (appearance) {
|
|
14
|
-
case 'inprogress':
|
|
15
|
-
return "var(--ds-background-information-bold, #0052CC)";
|
|
16
|
-
case 'moved':
|
|
17
|
-
return "var(--ds-background-warning-bold, #FFAB00)";
|
|
18
|
-
case 'new':
|
|
19
|
-
return "var(--ds-background-discovery-bold, #5243AA)";
|
|
20
|
-
case 'removed':
|
|
21
|
-
return "var(--ds-background-danger-bold, #DE350B)";
|
|
22
|
-
case 'success':
|
|
23
|
-
return "var(--ds-background-success-bold, #00875A)";
|
|
24
|
-
case 'default':
|
|
25
|
-
default:
|
|
26
|
-
return "var(--ds-background-neutral-bold, #42526E)";
|
|
27
|
-
}
|
|
28
|
-
};
|
|
29
|
-
var getPulseStyles = exports.getPulseStyles = function getPulseStyles(appearance) {
|
|
30
|
-
return (0, _react.css)(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n display: inline-flex;\n border-radius: 3px;\n box-shadow: 0 0 0 0 ", ";\n animation: ", " 1.45s cubic-bezier(0.5, 0, 0, 1) 3;\n"])), getPulseColor(appearance), pulseKeyframes);
|
|
31
|
-
};
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
/** @jsx jsx */
|
|
2
|
-
import { jsx } from '@emotion/react';
|
|
3
|
-
import { useEffect, useMemo, useRef } from 'react';
|
|
4
|
-
import { StorageClient } from '@atlaskit/frontend-utilities/storage-client';
|
|
5
|
-
import { getPulseStyles } from './styled';
|
|
6
|
-
const LOCAL_STORAGE_CLIENT_KEY = '@atlaskit/smart-card';
|
|
7
|
-
const LOCAL_STORAGE_DISCOVERY_KEY = 'action-discovery-status';
|
|
8
|
-
const LOCAL_STORAGE_DISCOVERY_VALUE = 'discovered';
|
|
9
|
-
const LOCAL_STORAGE_DISCOVERY_EXPIRY_IN_MS = 15552000000; // 180 days
|
|
10
|
-
const LOCAL_STORAGE_DISCOVERY_REQUIRED_TIME = 2000; // 2s
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* This is a hacky solution to help with the feature discovery.
|
|
14
|
-
* This implementation must be removed once the experiment is completed.
|
|
15
|
-
* Cleanup on https://product-fabric.atlassian.net/browse/EDM-5795
|
|
16
|
-
* @see https://team.atlassian.com/project/ATLAS-13099/about
|
|
17
|
-
*/
|
|
18
|
-
const FeatureDiscovery = ({
|
|
19
|
-
appearance,
|
|
20
|
-
children,
|
|
21
|
-
testId
|
|
22
|
-
}) => {
|
|
23
|
-
const renderedTime = useRef();
|
|
24
|
-
const storageClient = useMemo(() => new StorageClient(LOCAL_STORAGE_CLIENT_KEY), []);
|
|
25
|
-
const discovered = useMemo(() => storageClient.getItem(LOCAL_STORAGE_DISCOVERY_KEY) === LOCAL_STORAGE_DISCOVERY_VALUE, [storageClient]);
|
|
26
|
-
useEffect(() => {
|
|
27
|
-
renderedTime.current = Date.now();
|
|
28
|
-
return () => {
|
|
29
|
-
if (!discovered && renderedTime.current) {
|
|
30
|
-
const duration = Date.now() - renderedTime.current;
|
|
31
|
-
if (duration > LOCAL_STORAGE_DISCOVERY_REQUIRED_TIME) {
|
|
32
|
-
storageClient.setItemWithExpiry(LOCAL_STORAGE_DISCOVERY_KEY, LOCAL_STORAGE_DISCOVERY_VALUE, LOCAL_STORAGE_DISCOVERY_EXPIRY_IN_MS);
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
};
|
|
36
|
-
}, [storageClient, discovered]);
|
|
37
|
-
const component = useMemo(() => {
|
|
38
|
-
if (!discovered) {
|
|
39
|
-
return jsx("span", {
|
|
40
|
-
css: getPulseStyles(appearance),
|
|
41
|
-
"data-testid": `${testId}-discovery`
|
|
42
|
-
}, children);
|
|
43
|
-
}
|
|
44
|
-
}, [appearance, children, discovered, testId]);
|
|
45
|
-
return component !== null && component !== void 0 ? component : children;
|
|
46
|
-
};
|
|
47
|
-
export default FeatureDiscovery;
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { css, keyframes } from '@emotion/react';
|
|
2
|
-
const pulseKeyframes = keyframes`
|
|
3
|
-
to {
|
|
4
|
-
box-shadow: 0 0 0 7px rgba(0, 0, 0, 0);
|
|
5
|
-
}
|
|
6
|
-
`;
|
|
7
|
-
const getPulseColor = appearance => {
|
|
8
|
-
switch (appearance) {
|
|
9
|
-
case 'inprogress':
|
|
10
|
-
return "var(--ds-background-information-bold, #0052CC)";
|
|
11
|
-
case 'moved':
|
|
12
|
-
return "var(--ds-background-warning-bold, #FFAB00)";
|
|
13
|
-
case 'new':
|
|
14
|
-
return "var(--ds-background-discovery-bold, #5243AA)";
|
|
15
|
-
case 'removed':
|
|
16
|
-
return "var(--ds-background-danger-bold, #DE350B)";
|
|
17
|
-
case 'success':
|
|
18
|
-
return "var(--ds-background-success-bold, #00875A)";
|
|
19
|
-
case 'default':
|
|
20
|
-
default:
|
|
21
|
-
return "var(--ds-background-neutral-bold, #42526E)";
|
|
22
|
-
}
|
|
23
|
-
};
|
|
24
|
-
export const getPulseStyles = appearance => css`
|
|
25
|
-
display: inline-flex;
|
|
26
|
-
border-radius: 3px;
|
|
27
|
-
box-shadow: 0 0 0 0 ${getPulseColor(appearance)};
|
|
28
|
-
animation: ${pulseKeyframes} 1.45s cubic-bezier(0.5, 0, 0, 1) 3;
|
|
29
|
-
`;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
/** @jsx jsx */
|
|
2
|
-
import { jsx } from '@emotion/react';
|
|
3
|
-
import { useEffect, useMemo, useRef } from 'react';
|
|
4
|
-
import { StorageClient } from '@atlaskit/frontend-utilities/storage-client';
|
|
5
|
-
import { getPulseStyles } from './styled';
|
|
6
|
-
var LOCAL_STORAGE_CLIENT_KEY = '@atlaskit/smart-card';
|
|
7
|
-
var LOCAL_STORAGE_DISCOVERY_KEY = 'action-discovery-status';
|
|
8
|
-
var LOCAL_STORAGE_DISCOVERY_VALUE = 'discovered';
|
|
9
|
-
var LOCAL_STORAGE_DISCOVERY_EXPIRY_IN_MS = 15552000000; // 180 days
|
|
10
|
-
var LOCAL_STORAGE_DISCOVERY_REQUIRED_TIME = 2000; // 2s
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* This is a hacky solution to help with the feature discovery.
|
|
14
|
-
* This implementation must be removed once the experiment is completed.
|
|
15
|
-
* Cleanup on https://product-fabric.atlassian.net/browse/EDM-5795
|
|
16
|
-
* @see https://team.atlassian.com/project/ATLAS-13099/about
|
|
17
|
-
*/
|
|
18
|
-
var FeatureDiscovery = function FeatureDiscovery(_ref) {
|
|
19
|
-
var appearance = _ref.appearance,
|
|
20
|
-
children = _ref.children,
|
|
21
|
-
testId = _ref.testId;
|
|
22
|
-
var renderedTime = useRef();
|
|
23
|
-
var storageClient = useMemo(function () {
|
|
24
|
-
return new StorageClient(LOCAL_STORAGE_CLIENT_KEY);
|
|
25
|
-
}, []);
|
|
26
|
-
var discovered = useMemo(function () {
|
|
27
|
-
return storageClient.getItem(LOCAL_STORAGE_DISCOVERY_KEY) === LOCAL_STORAGE_DISCOVERY_VALUE;
|
|
28
|
-
}, [storageClient]);
|
|
29
|
-
useEffect(function () {
|
|
30
|
-
renderedTime.current = Date.now();
|
|
31
|
-
return function () {
|
|
32
|
-
if (!discovered && renderedTime.current) {
|
|
33
|
-
var duration = Date.now() - renderedTime.current;
|
|
34
|
-
if (duration > LOCAL_STORAGE_DISCOVERY_REQUIRED_TIME) {
|
|
35
|
-
storageClient.setItemWithExpiry(LOCAL_STORAGE_DISCOVERY_KEY, LOCAL_STORAGE_DISCOVERY_VALUE, LOCAL_STORAGE_DISCOVERY_EXPIRY_IN_MS);
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
};
|
|
39
|
-
}, [storageClient, discovered]);
|
|
40
|
-
var component = useMemo(function () {
|
|
41
|
-
if (!discovered) {
|
|
42
|
-
return jsx("span", {
|
|
43
|
-
css: getPulseStyles(appearance),
|
|
44
|
-
"data-testid": "".concat(testId, "-discovery")
|
|
45
|
-
}, children);
|
|
46
|
-
}
|
|
47
|
-
}, [appearance, children, discovered, testId]);
|
|
48
|
-
return component !== null && component !== void 0 ? component : children;
|
|
49
|
-
};
|
|
50
|
-
export default FeatureDiscovery;
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
|
2
|
-
var _templateObject, _templateObject2;
|
|
3
|
-
import { css, keyframes } from '@emotion/react';
|
|
4
|
-
var pulseKeyframes = keyframes(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n to {\n box-shadow: 0 0 0 7px rgba(0, 0, 0, 0);\n }\n"])));
|
|
5
|
-
var getPulseColor = function getPulseColor(appearance) {
|
|
6
|
-
switch (appearance) {
|
|
7
|
-
case 'inprogress':
|
|
8
|
-
return "var(--ds-background-information-bold, #0052CC)";
|
|
9
|
-
case 'moved':
|
|
10
|
-
return "var(--ds-background-warning-bold, #FFAB00)";
|
|
11
|
-
case 'new':
|
|
12
|
-
return "var(--ds-background-discovery-bold, #5243AA)";
|
|
13
|
-
case 'removed':
|
|
14
|
-
return "var(--ds-background-danger-bold, #DE350B)";
|
|
15
|
-
case 'success':
|
|
16
|
-
return "var(--ds-background-success-bold, #00875A)";
|
|
17
|
-
case 'default':
|
|
18
|
-
default:
|
|
19
|
-
return "var(--ds-background-neutral-bold, #42526E)";
|
|
20
|
-
}
|
|
21
|
-
};
|
|
22
|
-
export var getPulseStyles = function getPulseStyles(appearance) {
|
|
23
|
-
return css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n display: inline-flex;\n border-radius: 3px;\n box-shadow: 0 0 0 0 ", ";\n animation: ", " 1.45s cubic-bezier(0.5, 0, 0, 1) 3;\n"])), getPulseColor(appearance), pulseKeyframes);
|
|
24
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import type { FC } from 'react';
|
|
2
|
-
import type { FeatureDiscoveryProps } from './types';
|
|
3
|
-
/**
|
|
4
|
-
* This is a hacky solution to help with the feature discovery.
|
|
5
|
-
* This implementation must be removed once the experiment is completed.
|
|
6
|
-
* Cleanup on https://product-fabric.atlassian.net/browse/EDM-5795
|
|
7
|
-
* @see https://team.atlassian.com/project/ATLAS-13099/about
|
|
8
|
-
*/
|
|
9
|
-
declare const FeatureDiscovery: FC<FeatureDiscoveryProps>;
|
|
10
|
-
export default FeatureDiscovery;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import type { FC } from 'react';
|
|
2
|
-
import type { FeatureDiscoveryProps } from './types';
|
|
3
|
-
/**
|
|
4
|
-
* This is a hacky solution to help with the feature discovery.
|
|
5
|
-
* This implementation must be removed once the experiment is completed.
|
|
6
|
-
* Cleanup on https://product-fabric.atlassian.net/browse/EDM-5795
|
|
7
|
-
* @see https://team.atlassian.com/project/ATLAS-13099/about
|
|
8
|
-
*/
|
|
9
|
-
declare const FeatureDiscovery: FC<FeatureDiscoveryProps>;
|
|
10
|
-
export default FeatureDiscovery;
|