@atlaskit/smart-card 32.7.2 → 32.7.4
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 +20 -0
- package/analytics.spec.yaml +112 -53
- package/dist/cjs/extractors/common/context/extractAccessContext.js +1 -1
- package/dist/cjs/utils/analytics/analytics.js +1 -1
- package/dist/cjs/view/BlockCard/actions/{flexible/AuthorizeAction.js → AuthorizeAction.js} +2 -2
- package/dist/cjs/view/BlockCard/actions/ForbiddenAction.js +16 -13
- package/dist/cjs/view/BlockCard/actions/{flexible/RetryAction.js → RetryAction.js} +2 -2
- package/dist/cjs/view/BlockCard/index.js +14 -14
- package/dist/cjs/view/BlockCard/views/{flexible/FlexibleErroredView.js → ErroredView.js} +5 -5
- package/dist/cjs/view/BlockCard/views/{flexible/FlexibleForbiddenView.js → ForbiddenView.js} +9 -9
- package/dist/cjs/view/BlockCard/views/{flexible/FlexibleNotFoundView.js → NotFoundView.js} +4 -4
- package/dist/cjs/view/BlockCard/views/{flexible/FlexibleResolvedView.js → ResolvedView.js} +5 -5
- package/dist/cjs/view/BlockCard/views/{flexible/FlexibleUnauthorisedView.js → UnauthorisedView.js} +7 -7
- package/dist/cjs/view/BlockCard/views/{flexible/unresolved-view → unresolved-view}/index.js +2 -2
- package/dist/cjs/view/BlockCard/views/{flexible/utils → utils}/index.js +3 -3
- package/dist/cjs/view/CardWithUrl/component.js +26 -9
- package/dist/cjs/view/CardWithUrl/loader.js +21 -7
- package/dist/cjs/view/EmbedCard/components/ExpandedFrame.js +2 -2
- package/dist/cjs/view/EmbedCard/index.js +8 -8
- package/dist/cjs/view/EmbedCard/views/ErroredView.js +2 -2
- package/dist/cjs/view/HoverCard/components/views/resolved/index.js +35 -8
- package/dist/cjs/view/HoverCard/index.js +25 -8
- package/dist/cjs/view/LinkUrl/index.js +1 -1
- package/dist/cjs/view/common/access/ForbiddenAction.js +28 -0
- package/dist/cjs/view/common/utils.js +9 -2
- package/dist/es2019/extractors/common/context/extractAccessContext.js +1 -1
- package/dist/es2019/utils/analytics/analytics.js +1 -1
- package/dist/es2019/view/BlockCard/actions/{flexible/AuthorizeAction.js → AuthorizeAction.js} +2 -2
- package/dist/es2019/view/BlockCard/actions/ForbiddenAction.js +16 -6
- package/dist/es2019/view/BlockCard/actions/{flexible/RetryAction.js → RetryAction.js} +2 -2
- package/dist/es2019/view/BlockCard/index.js +13 -13
- package/dist/es2019/view/BlockCard/views/{flexible/FlexibleErroredView.js → ErroredView.js} +5 -5
- package/dist/es2019/view/BlockCard/views/{flexible/FlexibleForbiddenView.js → ForbiddenView.js} +9 -9
- package/dist/es2019/view/BlockCard/views/{flexible/FlexibleNotFoundView.js → NotFoundView.js} +4 -4
- package/dist/es2019/view/BlockCard/views/{flexible/FlexibleResolvedView.js → ResolvedView.js} +5 -5
- package/dist/es2019/view/BlockCard/views/{flexible/FlexibleUnauthorisedView.js → UnauthorisedView.js} +7 -7
- package/dist/es2019/view/BlockCard/views/{flexible/unresolved-view → unresolved-view}/index.js +2 -2
- package/dist/es2019/view/BlockCard/views/{flexible/utils → utils}/index.js +3 -3
- package/dist/es2019/view/CardWithUrl/component.js +26 -9
- package/dist/es2019/view/CardWithUrl/loader.js +21 -7
- package/dist/es2019/view/EmbedCard/components/ExpandedFrame.js +1 -1
- package/dist/es2019/view/EmbedCard/index.js +3 -3
- package/dist/es2019/view/EmbedCard/views/ErroredView.js +1 -1
- package/dist/es2019/view/HoverCard/components/views/resolved/index.js +33 -9
- package/dist/es2019/view/HoverCard/index.js +26 -8
- package/dist/es2019/view/LinkUrl/index.js +1 -1
- package/dist/es2019/view/common/access/ForbiddenAction.js +12 -0
- package/dist/es2019/view/common/utils.js +8 -1
- package/dist/esm/extractors/common/context/extractAccessContext.js +1 -1
- package/dist/esm/utils/analytics/analytics.js +1 -1
- package/dist/esm/view/BlockCard/actions/{flexible/AuthorizeAction.js → AuthorizeAction.js} +2 -2
- package/dist/esm/view/BlockCard/actions/ForbiddenAction.js +16 -13
- package/dist/esm/view/BlockCard/actions/{flexible/RetryAction.js → RetryAction.js} +2 -2
- package/dist/esm/view/BlockCard/index.js +13 -13
- package/dist/esm/view/BlockCard/views/{flexible/FlexibleErroredView.js → ErroredView.js} +5 -5
- package/dist/esm/view/BlockCard/views/{flexible/FlexibleForbiddenView.js → ForbiddenView.js} +9 -9
- package/dist/esm/view/BlockCard/views/{flexible/FlexibleNotFoundView.js → NotFoundView.js} +4 -4
- package/dist/esm/view/BlockCard/views/{flexible/FlexibleResolvedView.js → ResolvedView.js} +5 -5
- package/dist/esm/view/BlockCard/views/{flexible/FlexibleUnauthorisedView.js → UnauthorisedView.js} +7 -7
- package/dist/esm/view/BlockCard/views/{flexible/unresolved-view → unresolved-view}/index.js +2 -2
- package/dist/esm/view/BlockCard/views/{flexible/utils → utils}/index.js +3 -3
- package/dist/esm/view/CardWithUrl/component.js +26 -9
- package/dist/esm/view/CardWithUrl/loader.js +21 -7
- package/dist/esm/view/EmbedCard/components/ExpandedFrame.js +1 -1
- package/dist/esm/view/EmbedCard/index.js +3 -3
- package/dist/esm/view/EmbedCard/views/ErroredView.js +1 -1
- package/dist/esm/view/HoverCard/components/views/resolved/index.js +36 -9
- package/dist/esm/view/HoverCard/index.js +25 -8
- package/dist/esm/view/LinkUrl/index.js +1 -1
- package/dist/esm/view/common/access/ForbiddenAction.js +21 -0
- package/dist/esm/view/common/utils.js +8 -1
- package/dist/types/common/analytics/generated/analytics.types.d.ts +35 -1
- package/dist/types/types.d.ts +4 -11
- package/dist/{types-ts4.5/view/BlockCard/actions/flexible → types/view/BlockCard/actions}/AuthorizeAction.d.ts +1 -1
- package/dist/types/view/BlockCard/actions/ForbiddenAction.d.ts +12 -2
- package/dist/types/view/BlockCard/actions/{flexible/RetryAction.d.ts → RetryAction.d.ts} +1 -1
- package/dist/types/view/BlockCard/views/{flexible/types.d.ts → types.d.ts} +1 -1
- package/dist/{types-ts4.5/view/BlockCard/views/flexible → types/view/BlockCard/views}/unresolved-view/types.d.ts +2 -2
- package/dist/{types-ts4.5/view/BlockCard/views/flexible → types/view/BlockCard/views}/utils/index.d.ts +5 -5
- package/dist/types/view/EmbedCard/types.d.ts +1 -2
- package/dist/types/view/HoverCard/components/views/resolved/index.d.ts +1 -1
- package/dist/types/view/common/access/ForbiddenAction.d.ts +2 -0
- package/dist/types/view/common/utils.d.ts +2 -0
- package/dist/types/view/types.d.ts +8 -6
- package/dist/types-ts4.5/common/analytics/generated/analytics.types.d.ts +35 -1
- package/dist/types-ts4.5/types.d.ts +4 -11
- package/dist/{types/view/BlockCard/actions/flexible → types-ts4.5/view/BlockCard/actions}/AuthorizeAction.d.ts +1 -1
- package/dist/types-ts4.5/view/BlockCard/actions/ForbiddenAction.d.ts +12 -2
- package/dist/types-ts4.5/view/BlockCard/actions/{flexible/RetryAction.d.ts → RetryAction.d.ts} +1 -1
- package/dist/types-ts4.5/view/BlockCard/views/{flexible/types.d.ts → types.d.ts} +1 -1
- package/dist/{types/view/BlockCard/views/flexible → types-ts4.5/view/BlockCard/views}/unresolved-view/types.d.ts +2 -2
- package/dist/{types/view/BlockCard/views/flexible → types-ts4.5/view/BlockCard/views}/utils/index.d.ts +5 -5
- package/dist/types-ts4.5/view/EmbedCard/types.d.ts +1 -2
- package/dist/types-ts4.5/view/HoverCard/components/views/resolved/index.d.ts +1 -1
- package/dist/types-ts4.5/view/common/access/ForbiddenAction.d.ts +2 -0
- package/dist/types-ts4.5/view/common/utils.d.ts +2 -0
- package/dist/types-ts4.5/view/types.d.ts +8 -6
- package/package.json +1 -1
- package/dist/cjs/view/BlockCard/actions/flexible/ForbiddenAction.js +0 -31
- package/dist/cjs/view/BlockCard/components/Action.js +0 -5
- package/dist/cjs/view/BlockCard/utils/handlers.js +0 -13
- package/dist/es2019/view/BlockCard/actions/flexible/ForbiddenAction.js +0 -22
- package/dist/es2019/view/BlockCard/components/Action.js +0 -1
- package/dist/es2019/view/BlockCard/utils/handlers.js +0 -7
- package/dist/esm/view/BlockCard/actions/flexible/ForbiddenAction.js +0 -24
- package/dist/esm/view/BlockCard/components/Action.js +0 -1
- package/dist/esm/view/BlockCard/utils/handlers.js +0 -7
- package/dist/types/view/BlockCard/actions/flexible/ForbiddenAction.d.ts +0 -12
- package/dist/types/view/BlockCard/components/Action.d.ts +0 -8
- package/dist/types/view/BlockCard/utils/handlers.d.ts +0 -2
- package/dist/types-ts4.5/view/BlockCard/actions/flexible/ForbiddenAction.d.ts +0 -12
- package/dist/types-ts4.5/view/BlockCard/components/Action.d.ts +0 -8
- package/dist/types-ts4.5/view/BlockCard/utils/handlers.d.ts +0 -2
- /package/dist/cjs/view/BlockCard/views/{flexible/styled.js → styled.js} +0 -0
- /package/dist/cjs/view/BlockCard/views/{flexible/types.js → types.js} +0 -0
- /package/dist/cjs/view/BlockCard/views/{flexible/unresolved-view → unresolved-view}/types.js +0 -0
- /package/dist/cjs/view/BlockCard/views/{flexible/utils → utils}/withFlexibleUIBlockCardStyle.js +0 -0
- /package/dist/cjs/view/{BlockCard/components/Frame.js → EmbedCard/components/ErrorFrame.js} +0 -0
- /package/dist/es2019/view/BlockCard/views/{flexible/styled.js → styled.js} +0 -0
- /package/dist/es2019/view/BlockCard/views/{flexible/types.js → types.js} +0 -0
- /package/dist/es2019/view/BlockCard/views/{flexible/unresolved-view → unresolved-view}/types.js +0 -0
- /package/dist/es2019/view/BlockCard/views/{flexible/utils → utils}/withFlexibleUIBlockCardStyle.js +0 -0
- /package/dist/es2019/view/{BlockCard/components/Frame.js → EmbedCard/components/ErrorFrame.js} +0 -0
- /package/dist/esm/view/BlockCard/views/{flexible/styled.js → styled.js} +0 -0
- /package/dist/esm/view/BlockCard/views/{flexible/types.js → types.js} +0 -0
- /package/dist/esm/view/BlockCard/views/{flexible/unresolved-view → unresolved-view}/types.js +0 -0
- /package/dist/esm/view/BlockCard/views/{flexible/utils → utils}/withFlexibleUIBlockCardStyle.js +0 -0
- /package/dist/esm/view/{BlockCard/components/Frame.js → EmbedCard/components/ErrorFrame.js} +0 -0
- /package/dist/types/view/BlockCard/views/{flexible/FlexibleErroredView.d.ts → ErroredView.d.ts} +0 -0
- /package/dist/types/view/BlockCard/views/{flexible/FlexibleForbiddenView.d.ts → ForbiddenView.d.ts} +0 -0
- /package/dist/types/view/BlockCard/views/{flexible/FlexibleNotFoundView.d.ts → NotFoundView.d.ts} +0 -0
- /package/dist/types/view/BlockCard/views/{flexible/FlexibleResolvedView.d.ts → ResolvedView.d.ts} +0 -0
- /package/dist/types/view/BlockCard/views/{flexible/FlexibleUnauthorisedView.d.ts → UnauthorisedView.d.ts} +0 -0
- /package/dist/types/view/BlockCard/views/{flexible/styled.d.ts → styled.d.ts} +0 -0
- /package/dist/types/view/BlockCard/views/{flexible/unresolved-view → unresolved-view}/index.d.ts +0 -0
- /package/dist/types/view/BlockCard/views/{flexible/utils → utils}/withFlexibleUIBlockCardStyle.d.ts +0 -0
- /package/dist/types/view/{BlockCard/components/Frame.d.ts → EmbedCard/components/ErrorFrame.d.ts} +0 -0
- /package/dist/types-ts4.5/view/BlockCard/views/{flexible/FlexibleErroredView.d.ts → ErroredView.d.ts} +0 -0
- /package/dist/types-ts4.5/view/BlockCard/views/{flexible/FlexibleForbiddenView.d.ts → ForbiddenView.d.ts} +0 -0
- /package/dist/types-ts4.5/view/BlockCard/views/{flexible/FlexibleNotFoundView.d.ts → NotFoundView.d.ts} +0 -0
- /package/dist/types-ts4.5/view/BlockCard/views/{flexible/FlexibleResolvedView.d.ts → ResolvedView.d.ts} +0 -0
- /package/dist/types-ts4.5/view/BlockCard/views/{flexible/FlexibleUnauthorisedView.d.ts → UnauthorisedView.d.ts} +0 -0
- /package/dist/types-ts4.5/view/BlockCard/views/{flexible/styled.d.ts → styled.d.ts} +0 -0
- /package/dist/types-ts4.5/view/BlockCard/views/{flexible/unresolved-view → unresolved-view}/index.d.ts +0 -0
- /package/dist/types-ts4.5/view/BlockCard/views/{flexible/utils → utils}/withFlexibleUIBlockCardStyle.d.ts +0 -0
- /package/dist/types-ts4.5/view/{BlockCard/components/Frame.d.ts → EmbedCard/components/ErrorFrame.d.ts} +0 -0
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import React from 'react';
|
|
3
|
+
import { handleClickCommon } from '../common/utils';
|
|
3
4
|
import { CardLinkView } from '../LinkView';
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import FlexibleUnauthorisedView from './views/flexible/FlexibleUnauthorisedView';
|
|
5
|
+
import ErroredView from './views/ErroredView';
|
|
6
|
+
import ForbiddenView from './views/ForbiddenView';
|
|
7
|
+
import NotFoundView from './views/NotFoundView';
|
|
8
|
+
import ResolvedView from './views/ResolvedView';
|
|
9
|
+
import UnauthorisedView from './views/UnauthorisedView';
|
|
10
10
|
export var BlockCard = function BlockCard(_ref) {
|
|
11
11
|
var id = _ref.id,
|
|
12
12
|
url = _ref.url,
|
|
@@ -22,7 +22,7 @@ export var BlockCard = function BlockCard(_ref) {
|
|
|
22
22
|
analytics = _ref.analytics,
|
|
23
23
|
actionOptions = _ref.actionOptions;
|
|
24
24
|
var status = cardState.status;
|
|
25
|
-
var
|
|
25
|
+
var blockCardProps = {
|
|
26
26
|
id: id,
|
|
27
27
|
cardState: cardState,
|
|
28
28
|
url: url,
|
|
@@ -39,21 +39,21 @@ export var BlockCard = function BlockCard(_ref) {
|
|
|
39
39
|
switch (status) {
|
|
40
40
|
case 'pending':
|
|
41
41
|
case 'resolving':
|
|
42
|
-
return /*#__PURE__*/React.createElement(
|
|
42
|
+
return /*#__PURE__*/React.createElement(ResolvedView, _extends({}, blockCardProps, {
|
|
43
43
|
testId: 'smart-block-resolving-view'
|
|
44
44
|
}));
|
|
45
45
|
case 'resolved':
|
|
46
|
-
return /*#__PURE__*/React.createElement(
|
|
46
|
+
return /*#__PURE__*/React.createElement(ResolvedView, blockCardProps);
|
|
47
47
|
case 'unauthorized':
|
|
48
|
-
return /*#__PURE__*/React.createElement(
|
|
48
|
+
return /*#__PURE__*/React.createElement(UnauthorisedView, _extends({}, blockCardProps, {
|
|
49
49
|
onAuthorize: handleAuthorize
|
|
50
50
|
}));
|
|
51
51
|
case 'forbidden':
|
|
52
|
-
return /*#__PURE__*/React.createElement(
|
|
52
|
+
return /*#__PURE__*/React.createElement(ForbiddenView, _extends({}, blockCardProps, {
|
|
53
53
|
onAuthorize: handleAuthorize
|
|
54
54
|
}));
|
|
55
55
|
case 'not_found':
|
|
56
|
-
return /*#__PURE__*/React.createElement(
|
|
56
|
+
return /*#__PURE__*/React.createElement(NotFoundView, _extends({}, blockCardProps, {
|
|
57
57
|
onAuthorize: handleAuthorize
|
|
58
58
|
}));
|
|
59
59
|
case 'fallback':
|
|
@@ -73,7 +73,7 @@ export var BlockCard = function BlockCard(_ref) {
|
|
|
73
73
|
testId: "".concat(testId, "-").concat(status)
|
|
74
74
|
});
|
|
75
75
|
}
|
|
76
|
-
return /*#__PURE__*/React.createElement(
|
|
76
|
+
return /*#__PURE__*/React.createElement(ErroredView, _extends({}, blockCardProps, {
|
|
77
77
|
onAuthorize: handleAuthorize
|
|
78
78
|
}));
|
|
79
79
|
}
|
|
@@ -4,9 +4,9 @@ var _excluded = ["testId"];
|
|
|
4
4
|
import React, { useMemo } from 'react';
|
|
5
5
|
import WarningIcon from '@atlaskit/icon/glyph/warning';
|
|
6
6
|
import { R300 } from '@atlaskit/theme/colors';
|
|
7
|
-
import { messages } from '
|
|
8
|
-
import Text from '
|
|
9
|
-
import { RetryAction } from '
|
|
7
|
+
import { messages } from '../../../messages';
|
|
8
|
+
import Text from '../../FlexibleCard/components/elements/text';
|
|
9
|
+
import { RetryAction } from '../actions/RetryAction';
|
|
10
10
|
import UnresolvedView from './unresolved-view';
|
|
11
11
|
import { withFlexibleUIBlockCardStyle } from './utils/withFlexibleUIBlockCardStyle';
|
|
12
12
|
|
|
@@ -16,7 +16,7 @@ import { withFlexibleUIBlockCardStyle } from './utils/withFlexibleUIBlockCardSty
|
|
|
16
16
|
* @see SmartLinkStatus
|
|
17
17
|
* @see FlexibleCardProps
|
|
18
18
|
*/
|
|
19
|
-
var
|
|
19
|
+
var ErroredView = function ErroredView(_ref) {
|
|
20
20
|
var _ref$testId = _ref.testId,
|
|
21
21
|
testId = _ref$testId === void 0 ? 'smart-block-errored-view' : _ref$testId,
|
|
22
22
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
@@ -38,4 +38,4 @@ var FlexibleErroredView = function FlexibleErroredView(_ref) {
|
|
|
38
38
|
}
|
|
39
39
|
}));
|
|
40
40
|
};
|
|
41
|
-
export default withFlexibleUIBlockCardStyle(
|
|
41
|
+
export default withFlexibleUIBlockCardStyle(ErroredView);
|
package/dist/esm/view/BlockCard/views/{flexible/FlexibleForbiddenView.js → ForbiddenView.js}
RENAMED
|
@@ -8,13 +8,13 @@ import { useAnalyticsEvents } from '@atlaskit/analytics-next';
|
|
|
8
8
|
import LockIcon from '@atlaskit/icon/glyph/lock';
|
|
9
9
|
import { extractProvider } from '@atlaskit/link-extractors';
|
|
10
10
|
import { R300 } from '@atlaskit/theme/colors';
|
|
11
|
-
import { extractRequestAccessContextImproved } from '
|
|
12
|
-
import extractHostname from '
|
|
13
|
-
import { messages } from '
|
|
14
|
-
import { toMessage } from '
|
|
15
|
-
import { getForbiddenJsonLd } from '
|
|
16
|
-
import Text from '
|
|
17
|
-
import { ForbiddenAction } from '
|
|
11
|
+
import { extractRequestAccessContextImproved } from '../../../extractors/common/context/extractAccessContext';
|
|
12
|
+
import extractHostname from '../../../extractors/common/hostname/extractHostname';
|
|
13
|
+
import { messages } from '../../../messages';
|
|
14
|
+
import { toMessage } from '../../../utils/intl-utils';
|
|
15
|
+
import { getForbiddenJsonLd } from '../../../utils/jsonld';
|
|
16
|
+
import Text from '../../FlexibleCard/components/elements/text';
|
|
17
|
+
import { ForbiddenAction } from '../actions/ForbiddenAction';
|
|
18
18
|
import UnresolvedView from './unresolved-view';
|
|
19
19
|
import { withFlexibleUIBlockCardStyle } from './utils/withFlexibleUIBlockCardStyle';
|
|
20
20
|
|
|
@@ -25,7 +25,7 @@ import { withFlexibleUIBlockCardStyle } from './utils/withFlexibleUIBlockCardSty
|
|
|
25
25
|
* @see SmartLinkStatus
|
|
26
26
|
* @see FlexibleCardProps
|
|
27
27
|
*/
|
|
28
|
-
var
|
|
28
|
+
var ForbiddenView = function ForbiddenView(_ref) {
|
|
29
29
|
var _details$meta;
|
|
30
30
|
var _ref$testId = _ref.testId,
|
|
31
31
|
testId = _ref$testId === void 0 ? 'smart-block-forbidden-view' : _ref$testId,
|
|
@@ -89,4 +89,4 @@ var FlexibleForbiddenView = function FlexibleForbiddenView(_ref) {
|
|
|
89
89
|
}
|
|
90
90
|
}));
|
|
91
91
|
};
|
|
92
|
-
export default withFlexibleUIBlockCardStyle(
|
|
92
|
+
export default withFlexibleUIBlockCardStyle(ForbiddenView);
|
|
@@ -6,8 +6,8 @@ import { useIntl } from 'react-intl-next';
|
|
|
6
6
|
import LockIcon from '@atlaskit/icon/glyph/lock';
|
|
7
7
|
import { extractProvider } from '@atlaskit/link-extractors';
|
|
8
8
|
import { R300 } from '@atlaskit/theme/colors';
|
|
9
|
-
import { messages } from '
|
|
10
|
-
import Text from '
|
|
9
|
+
import { messages } from '../../../messages';
|
|
10
|
+
import Text from '../../FlexibleCard/components/elements/text';
|
|
11
11
|
import UnresolvedView from './unresolved-view';
|
|
12
12
|
import { withFlexibleUIBlockCardStyle } from './utils/withFlexibleUIBlockCardStyle';
|
|
13
13
|
|
|
@@ -17,7 +17,7 @@ import { withFlexibleUIBlockCardStyle } from './utils/withFlexibleUIBlockCardSty
|
|
|
17
17
|
* @see SmartLinkStatus
|
|
18
18
|
* @see FlexibleCardProps
|
|
19
19
|
*/
|
|
20
|
-
var
|
|
20
|
+
var NotFoundView = function NotFoundView(_ref) {
|
|
21
21
|
var _cardState$details2;
|
|
22
22
|
var _ref$testId = _ref.testId,
|
|
23
23
|
testId = _ref$testId === void 0 ? 'smart-block-not-found-view' : _ref$testId,
|
|
@@ -53,4 +53,4 @@ var FlexibleNotFoundView = function FlexibleNotFoundView(_ref) {
|
|
|
53
53
|
maxLines: 3
|
|
54
54
|
}));
|
|
55
55
|
};
|
|
56
|
-
export default withFlexibleUIBlockCardStyle(
|
|
56
|
+
export default withFlexibleUIBlockCardStyle(NotFoundView);
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
3
3
|
import React, { useEffect, useMemo, useState } from 'react';
|
|
4
|
-
import { ActionName, ElementName, SmartLinkPosition } from '
|
|
5
|
-
import FlexibleCard from '
|
|
6
|
-
import { FooterBlock, MetadataBlock, PreviewBlock, SnippetBlock, TitleBlock } from '
|
|
4
|
+
import { ActionName, ElementName, SmartLinkPosition } from '../../../constants';
|
|
5
|
+
import FlexibleCard from '../../FlexibleCard';
|
|
6
|
+
import { FooterBlock, MetadataBlock, PreviewBlock, SnippetBlock, TitleBlock } from '../../FlexibleCard/components/blocks';
|
|
7
7
|
import { metadataBlockCss } from './styled';
|
|
8
8
|
import { FlexibleCardUiOptions, FooterBlockOptions, getSimulatedBetterMetadata, PreviewBlockOptions, titleBlockOptions } from './utils';
|
|
9
9
|
import { withFlexibleUIBlockCardStyle } from './utils/withFlexibleUIBlockCardStyle';
|
|
@@ -13,7 +13,7 @@ import { withFlexibleUIBlockCardStyle } from './utils/withFlexibleUIBlockCardSty
|
|
|
13
13
|
* @see SmartLinkStatus
|
|
14
14
|
* @see FlexibleCardProps
|
|
15
15
|
*/
|
|
16
|
-
var
|
|
16
|
+
var ResolvedView = function ResolvedView(_ref) {
|
|
17
17
|
var cardState = _ref.cardState,
|
|
18
18
|
onClick = _ref.onClick,
|
|
19
19
|
onError = _ref.onError,
|
|
@@ -80,4 +80,4 @@ var FlexibleResolvedView = function FlexibleResolvedView(_ref) {
|
|
|
80
80
|
actions: footerActions
|
|
81
81
|
})));
|
|
82
82
|
};
|
|
83
|
-
export default withFlexibleUIBlockCardStyle(
|
|
83
|
+
export default withFlexibleUIBlockCardStyle(ResolvedView);
|
package/dist/esm/view/BlockCard/views/{flexible/FlexibleUnauthorisedView.js → UnauthorisedView.js}
RENAMED
|
@@ -11,11 +11,11 @@ import { useCallback, useMemo } from 'react';
|
|
|
11
11
|
import { css, jsx } from '@emotion/react';
|
|
12
12
|
import { FormattedMessage } from 'react-intl-next';
|
|
13
13
|
import { extractProvider } from '@atlaskit/link-extractors';
|
|
14
|
-
import { useAnalyticsEvents } from '
|
|
15
|
-
import { messages } from '
|
|
16
|
-
import { hasAuthScopeOverrides } from '
|
|
17
|
-
import UnauthorisedViewContent from '
|
|
18
|
-
import { AuthorizeAction } from '
|
|
14
|
+
import { useAnalyticsEvents } from '../../../common/analytics/generated/use-analytics-events';
|
|
15
|
+
import { messages } from '../../../messages';
|
|
16
|
+
import { hasAuthScopeOverrides } from '../../../state/helpers';
|
|
17
|
+
import UnauthorisedViewContent from '../../common/UnauthorisedViewContent';
|
|
18
|
+
import { AuthorizeAction } from '../actions/AuthorizeAction';
|
|
19
19
|
import UnresolvedView from './unresolved-view';
|
|
20
20
|
import { withFlexibleUIBlockCardStyle } from './utils/withFlexibleUIBlockCardStyle';
|
|
21
21
|
var contentStyles = css({
|
|
@@ -31,7 +31,7 @@ var contentStyles = css({
|
|
|
31
31
|
* @see SmartLinkStatus
|
|
32
32
|
* @see FlexibleCardProps
|
|
33
33
|
*/
|
|
34
|
-
var
|
|
34
|
+
var UnauthorisedView = function UnauthorisedView(_ref) {
|
|
35
35
|
var _cardState$details, _extractProvider;
|
|
36
36
|
var _ref$testId = _ref.testId,
|
|
37
37
|
testId = _ref$testId === void 0 ? 'smart-block-unauthorized-view' : _ref$testId,
|
|
@@ -73,4 +73,4 @@ var FlexibleUnauthorisedView = function FlexibleUnauthorisedView(_ref) {
|
|
|
73
73
|
"data-testid": "".concat(testId, "-content")
|
|
74
74
|
}, content));
|
|
75
75
|
};
|
|
76
|
-
export default withFlexibleUIBlockCardStyle(
|
|
76
|
+
export default withFlexibleUIBlockCardStyle(UnauthorisedView);
|
|
@@ -3,8 +3,8 @@ import React from 'react';
|
|
|
3
3
|
|
|
4
4
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
5
5
|
import { css } from '@emotion/react';
|
|
6
|
-
import FlexibleCard from '
|
|
7
|
-
import { CustomBlock, InternalFooterBlock, PreviewBlock, TitleBlock } from '
|
|
6
|
+
import FlexibleCard from '../../../FlexibleCard';
|
|
7
|
+
import { CustomBlock, InternalFooterBlock, PreviewBlock, TitleBlock } from '../../../FlexibleCard/components/blocks';
|
|
8
8
|
import { FlexibleCardUiOptions, FooterBlockOptions, PreviewBlockOptions, titleBlockOptions } from '../utils';
|
|
9
9
|
var customBlockStyles = css({
|
|
10
10
|
alignItems: 'flex-start'
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
2
|
-
import { ElementName, MediaPlacement, SmartLinkPosition, SmartLinkSize } from '
|
|
3
|
-
import { extractOwnedBy } from '
|
|
4
|
-
import { getExtensionKey } from '
|
|
2
|
+
import { ElementName, MediaPlacement, SmartLinkPosition, SmartLinkSize } from '../../../../constants';
|
|
3
|
+
import { extractOwnedBy } from '../../../../extractors/flexible/utils';
|
|
4
|
+
import { getExtensionKey } from '../../../../state/helpers';
|
|
5
5
|
import { footerBlockCss, titleBlockCss } from '../styled';
|
|
6
6
|
var baseTopMetadata = [{
|
|
7
7
|
name: ElementName.ModifiedOn
|
|
@@ -4,6 +4,7 @@ import { fg } from '@atlaskit/platform-feature-flags';
|
|
|
4
4
|
import { useAnalyticsEvents } from '../../common/analytics/generated/use-analytics-events';
|
|
5
5
|
import { CardDisplay } from '../../constants';
|
|
6
6
|
import { useSmartLink } from '../../state';
|
|
7
|
+
import { succeedUfoExperience } from '../../state/analytics';
|
|
7
8
|
import { getCanBeDatasource, getClickUrl, getDefinitionId, getExtensionKey, getProduct, getResourceType, getServices, getSubproduct, isFinalState } from '../../state/helpers';
|
|
8
9
|
import { SmartLinkModalProvider } from '../../state/modal';
|
|
9
10
|
import { isSpecialEvent } from '../../utils';
|
|
@@ -156,16 +157,32 @@ function Component(_ref) {
|
|
|
156
157
|
// - the unresolved states: viz. forbidden, not_found, unauthorized, errored.
|
|
157
158
|
useEffect(function () {
|
|
158
159
|
if (isFinalState(state.status)) {
|
|
159
|
-
analytics
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
160
|
+
if (fg('platform-smart-card-migrate-embed-modal-analytics')) {
|
|
161
|
+
succeedUfoExperience('smart-link-rendered', id || 'NULL', {
|
|
162
|
+
extensionKey: extensionKey,
|
|
163
|
+
display: isFlexibleUi ? 'flexible' : appearance
|
|
164
|
+
});
|
|
165
|
+
|
|
166
|
+
// UFO will disregard this if authentication experience has not yet been started
|
|
167
|
+
succeedUfoExperience('smart-link-authenticated', id || 'NULL', {
|
|
168
|
+
display: isFlexibleUi ? 'flexible' : appearance
|
|
169
|
+
});
|
|
170
|
+
fireEvent('ui.smartLink.renderSuccess', {
|
|
171
|
+
definitionId: definitionId !== null && definitionId !== void 0 ? definitionId : null,
|
|
172
|
+
display: isFlexibleUi ? 'flexible' : appearance
|
|
173
|
+
});
|
|
174
|
+
} else {
|
|
175
|
+
analytics.ui.renderSuccessEvent({
|
|
176
|
+
display: isFlexibleUi ? 'flexible' : appearance,
|
|
177
|
+
status: state.status,
|
|
178
|
+
id: id,
|
|
179
|
+
definitionId: definitionId,
|
|
180
|
+
extensionKey: extensionKey,
|
|
181
|
+
canBeDatasource: canBeDatasource
|
|
182
|
+
});
|
|
183
|
+
}
|
|
167
184
|
}
|
|
168
|
-
}, [isFlexibleUi, appearance, state.status, url, definitionId, extensionKey, analytics.ui, id, canBeDatasource]);
|
|
185
|
+
}, [isFlexibleUi, appearance, state.status, url, definitionId, extensionKey, analytics.ui, id, canBeDatasource, fireEvent]);
|
|
169
186
|
var onIframeDwell = useCallback(function (dwellTime, dwellPercentVisible) {
|
|
170
187
|
fireEvent('ui.smartLinkIframe.dwelled', {
|
|
171
188
|
id: id,
|
|
@@ -3,8 +3,10 @@ import React, { lazy, Suspense, useCallback, useEffect, useState } from 'react';
|
|
|
3
3
|
import { ErrorBoundary } from 'react-error-boundary';
|
|
4
4
|
import { di } from 'react-magnetic-di';
|
|
5
5
|
import uuid from 'uuid';
|
|
6
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
6
7
|
import { useAnalyticsEvents } from '../../common/analytics/generated/use-analytics-events';
|
|
7
|
-
import { useSmartLinkAnalytics } from '../../state
|
|
8
|
+
import { useSmartLinkAnalytics } from '../../state';
|
|
9
|
+
import { failUfoExperience, startUfoExperience } from '../../state/analytics';
|
|
8
10
|
import { importWithRetry } from '../../utils';
|
|
9
11
|
import { isFlexibleUiCard } from '../../utils/flexible';
|
|
10
12
|
import { clearMarks, clearMeasures } from '../../utils/performance';
|
|
@@ -75,12 +77,24 @@ export function CardWithURLRenderer(props) {
|
|
|
75
77
|
definitionId: null
|
|
76
78
|
});
|
|
77
79
|
} else if (error.name !== 'APIError') {
|
|
78
|
-
analytics
|
|
79
|
-
|
|
80
|
-
id
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
80
|
+
if (fg('platform-smart-card-migrate-embed-modal-analytics')) {
|
|
81
|
+
startUfoExperience('smart-link-rendered', id || 'NULL');
|
|
82
|
+
failUfoExperience('smart-link-rendered', id || 'NULL');
|
|
83
|
+
failUfoExperience('smart-link-authenticated', id || 'NULL');
|
|
84
|
+
fireEvent('ui.smartLink.renderFailed', {
|
|
85
|
+
display: isFlexibleUi ? 'flexible' : appearance,
|
|
86
|
+
id: id !== null && id !== void 0 ? id : null,
|
|
87
|
+
error: error,
|
|
88
|
+
errorInfo: errorInfo
|
|
89
|
+
});
|
|
90
|
+
} else {
|
|
91
|
+
analytics.ui.renderFailedEvent({
|
|
92
|
+
display: isFlexibleUi ? 'flexible' : appearance,
|
|
93
|
+
id: id,
|
|
94
|
+
error: error,
|
|
95
|
+
errorInfo: errorInfo
|
|
96
|
+
});
|
|
97
|
+
}
|
|
84
98
|
}
|
|
85
99
|
onError && onError({
|
|
86
100
|
status: 'errored',
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import Tooltip from '@atlaskit/tooltip';
|
|
3
3
|
import { useMouseDownEvent } from '../../../state/analytics/useLinkClicked';
|
|
4
|
-
import { handleClickCommon } from '../../
|
|
4
|
+
import { handleClickCommon } from '../../common/utils';
|
|
5
5
|
import { className, Content, Header, IconWrapper, LinkWrapper, TextWrapper, TooltipWrapper, Wrapper } from './styled';
|
|
6
6
|
export var ExpandedFrame = function ExpandedFrame(_ref) {
|
|
7
7
|
var _ref$isPlaceholder = _ref.isPlaceholder,
|
|
@@ -6,7 +6,7 @@ import { extractEmbedProps } from '../../extractors/embed';
|
|
|
6
6
|
import { extractInlineProps } from '../../extractors/inline';
|
|
7
7
|
import { getExtensionKey, hasAuthScopeOverrides } from '../../state/helpers';
|
|
8
8
|
import { getEmptyJsonLd, getForbiddenJsonLd } from '../../utils/jsonld';
|
|
9
|
-
import
|
|
9
|
+
import BlockCardResolvedView from '../BlockCard/views/ResolvedView';
|
|
10
10
|
import { InlineCardResolvedView } from '../InlineCard/ResolvedView';
|
|
11
11
|
import { EmbedCardErroredView } from './views/ErroredView';
|
|
12
12
|
import ForbiddenView from './views/forbidden-view';
|
|
@@ -44,7 +44,7 @@ export var EmbedCard = /*#__PURE__*/React.forwardRef(function (_ref, iframeRef)
|
|
|
44
44
|
switch (status) {
|
|
45
45
|
case 'pending':
|
|
46
46
|
case 'resolving':
|
|
47
|
-
return /*#__PURE__*/React.createElement(
|
|
47
|
+
return /*#__PURE__*/React.createElement(BlockCardResolvedView, {
|
|
48
48
|
url: url,
|
|
49
49
|
cardState: cardState,
|
|
50
50
|
onClick: handleFrameClick,
|
|
@@ -85,7 +85,7 @@ export var EmbedCard = /*#__PURE__*/React.forwardRef(function (_ref, iframeRef)
|
|
|
85
85
|
onClick: handleFrameClick
|
|
86
86
|
}));
|
|
87
87
|
}
|
|
88
|
-
return /*#__PURE__*/React.createElement(
|
|
88
|
+
return /*#__PURE__*/React.createElement(BlockCardResolvedView, {
|
|
89
89
|
url: url,
|
|
90
90
|
cardState: cardState,
|
|
91
91
|
onClick: handleFrameClick,
|
|
@@ -10,8 +10,8 @@ import ErrorIcon from '@atlaskit/icon/core/migration/error';
|
|
|
10
10
|
import { Box, Inline, xcss } from '@atlaskit/primitives';
|
|
11
11
|
import { R300 } from '@atlaskit/theme/colors';
|
|
12
12
|
import { messages } from '../../../messages';
|
|
13
|
-
import { Frame } from '../../BlockCard/components/Frame';
|
|
14
13
|
import { gs } from '../../common/utils';
|
|
14
|
+
import { Frame } from '../components/ErrorFrame';
|
|
15
15
|
var messageStyles = css({
|
|
16
16
|
font: "var(--ds-font-heading-xsmall, normal 600 14px/16px ui-sans-serif, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Ubuntu, system-ui, \"Helvetica Neue\", sans-serif)",
|
|
17
17
|
fontWeight: "var(--ds-font-weight-regular, 400)",
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import React, { useCallback, useEffect, useMemo, useRef } from 'react';
|
|
3
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
4
|
+
import { useAnalyticsEvents } from '../../../../../common/analytics/generated/use-analytics-events';
|
|
3
5
|
import { CardDisplay, SmartLinkPosition, SmartLinkSize, SmartLinkStatus } from '../../../../../constants';
|
|
4
|
-
import {
|
|
6
|
+
import { succeedUfoExperience } from '../../../../../state/analytics';
|
|
7
|
+
import { getCanBeDatasource, getDefinitionId } from '../../../../../state/helpers';
|
|
5
8
|
import FlexibleCard from '../../../../FlexibleCard';
|
|
6
9
|
import { ActionBlock, AIFooterBlock, AISummaryBlock, MetadataBlock, SnippetBlock, TitleBlock } from '../../../../FlexibleCard/components/blocks';
|
|
7
10
|
import { getMetadata } from '../../../utils';
|
|
@@ -15,17 +18,41 @@ var HoverCardResolvedView = function HoverCardResolvedView(_ref) {
|
|
|
15
18
|
flexibleCardProps = _ref.flexibleCardProps,
|
|
16
19
|
isAISummaryEnabled = _ref.isAISummaryEnabled,
|
|
17
20
|
onActionClick = _ref.onActionClick,
|
|
18
|
-
titleBlockProps = _ref.titleBlockProps
|
|
19
|
-
|
|
21
|
+
titleBlockProps = _ref.titleBlockProps,
|
|
22
|
+
id = _ref.id;
|
|
23
|
+
var _useAnalyticsEvents = useAnalyticsEvents(),
|
|
24
|
+
fireEvent = _useAnalyticsEvents.fireEvent;
|
|
25
|
+
var definitionId = React.useMemo(function () {
|
|
26
|
+
return getDefinitionId(cardState.details);
|
|
27
|
+
}, [cardState.details]);
|
|
28
|
+
var canBeDatasource = React.useMemo(function () {
|
|
29
|
+
return getCanBeDatasource(cardState.details);
|
|
30
|
+
}, [cardState.details]);
|
|
20
31
|
useEffect(function () {
|
|
21
32
|
// Since this hover view is only rendered on resolved status,
|
|
22
33
|
// there is no need to check for statuses.
|
|
23
|
-
analytics
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
34
|
+
if (fg('platform-smart-card-migrate-embed-modal-analytics')) {
|
|
35
|
+
succeedUfoExperience('smart-link-rendered', id || 'NULL', {
|
|
36
|
+
extensionKey: extensionKey,
|
|
37
|
+
display: CardDisplay.HoverCardPreview
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
// UFO will disregard this if authentication experience has not yet been started
|
|
41
|
+
succeedUfoExperience('smart-link-authenticated', id || 'NULL', {
|
|
42
|
+
display: CardDisplay.HoverCardPreview
|
|
43
|
+
});
|
|
44
|
+
fireEvent('ui.smartLink.renderSuccess', {
|
|
45
|
+
definitionId: definitionId !== null && definitionId !== void 0 ? definitionId : null,
|
|
46
|
+
display: CardDisplay.HoverCardPreview
|
|
47
|
+
});
|
|
48
|
+
} else {
|
|
49
|
+
analytics.ui.renderSuccessEvent({
|
|
50
|
+
display: CardDisplay.HoverCardPreview,
|
|
51
|
+
status: cardState.status,
|
|
52
|
+
canBeDatasource: canBeDatasource
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
}, [analytics.ui, cardState.status, canBeDatasource, fireEvent, definitionId, extensionKey, id]);
|
|
29
56
|
var data = (_cardState$details = cardState.details) === null || _cardState$details === void 0 ? void 0 : _cardState$details.data;
|
|
30
57
|
var _useMemo = useMemo(function () {
|
|
31
58
|
return getMetadata(extensionKey, data);
|
|
@@ -9,23 +9,40 @@ import { jsx } from '@emotion/react';
|
|
|
9
9
|
import { ErrorBoundary } from 'react-error-boundary';
|
|
10
10
|
import { di } from 'react-magnetic-di';
|
|
11
11
|
import { withAnalyticsEvents } from '@atlaskit/analytics-next';
|
|
12
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
13
|
+
import { useAnalyticsEvents } from '../../common/analytics/generated/use-analytics-events';
|
|
12
14
|
import { CardDisplay } from '../../constants';
|
|
13
|
-
import { useSmartLinkAnalytics } from '../../state
|
|
15
|
+
import { useSmartLinkAnalytics } from '../../state';
|
|
16
|
+
import { failUfoExperience, startUfoExperience } from '../../state/analytics';
|
|
14
17
|
import { SmartLinkModalProvider } from '../../state/modal';
|
|
15
18
|
import { HoverCardComponent } from './components/HoverCardComponent';
|
|
16
19
|
var HoverCardWithErrorBoundary = function HoverCardWithErrorBoundary(props) {
|
|
20
|
+
var _useAnalyticsEvents = useAnalyticsEvents(),
|
|
21
|
+
fireEvent = _useAnalyticsEvents.fireEvent;
|
|
17
22
|
var url = props.url,
|
|
18
23
|
id = props.id,
|
|
19
24
|
children = props.children;
|
|
20
25
|
var analytics = useSmartLinkAnalytics(url, id);
|
|
21
26
|
var onError = useCallback(function (error, info) {
|
|
22
|
-
analytics
|
|
23
|
-
|
|
24
|
-
id
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
27
|
+
if (fg('platform-smart-card-migrate-embed-modal-analytics')) {
|
|
28
|
+
startUfoExperience('smart-link-rendered', id || 'NULL');
|
|
29
|
+
failUfoExperience('smart-link-rendered', id || 'NULL');
|
|
30
|
+
failUfoExperience('smart-link-authenticated', id || 'NULL');
|
|
31
|
+
fireEvent('ui.smartLink.renderFailed', {
|
|
32
|
+
display: CardDisplay.HoverCardPreview,
|
|
33
|
+
id: id !== null && id !== void 0 ? id : null,
|
|
34
|
+
error: error,
|
|
35
|
+
errorInfo: info
|
|
36
|
+
});
|
|
37
|
+
} else {
|
|
38
|
+
analytics.ui.renderFailedEvent({
|
|
39
|
+
display: CardDisplay.HoverCardPreview,
|
|
40
|
+
id: id,
|
|
41
|
+
error: error,
|
|
42
|
+
errorInfo: info
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
}, [analytics.ui, id, fireEvent]);
|
|
29
46
|
return jsx(ErrorBoundary, {
|
|
30
47
|
fallback: children,
|
|
31
48
|
onError: onError
|
|
@@ -13,7 +13,7 @@ import LinkWarningModal from './LinkWarningModal';
|
|
|
13
13
|
import { useLinkWarningModal } from './LinkWarningModal/hooks/use-link-warning-modal';
|
|
14
14
|
var PACKAGE_DATA = {
|
|
15
15
|
packageName: "@atlaskit/smart-card",
|
|
16
|
-
packageVersion: "32.7.
|
|
16
|
+
packageVersion: "32.7.4",
|
|
17
17
|
componentName: 'linkUrl'
|
|
18
18
|
};
|
|
19
19
|
var Anchor = withLinkClickedEvent('a');
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { FormattedMessage } from 'react-intl-next';
|
|
4
|
+
import { messages } from '../../../messages';
|
|
5
|
+
export var ForbiddenAction = function ForbiddenAction(handler) {
|
|
6
|
+
var id = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'connect-other-account';
|
|
7
|
+
var message = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : messages.try_another_account;
|
|
8
|
+
var values = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
|
|
9
|
+
return {
|
|
10
|
+
id: id,
|
|
11
|
+
text: /*#__PURE__*/React.createElement(FormattedMessage, _extends({}, message, {
|
|
12
|
+
values: values
|
|
13
|
+
})),
|
|
14
|
+
promise: function promise() {
|
|
15
|
+
return new Promise(function (resolve) {
|
|
16
|
+
return resolve(handler());
|
|
17
|
+
});
|
|
18
|
+
},
|
|
19
|
+
buttonAppearance: 'default'
|
|
20
|
+
};
|
|
21
|
+
};
|
|
@@ -11,4 +11,11 @@ var br = function br() {
|
|
|
11
11
|
return "".concat(3 * times, "px");
|
|
12
12
|
};
|
|
13
13
|
var mq = facepaint(['@media(min-width: 576px)']);
|
|
14
|
-
export { gs, br, mq };
|
|
14
|
+
export { gs, br, mq };
|
|
15
|
+
export var handleClickCommon = function handleClickCommon(event, onClick) {
|
|
16
|
+
if (onClick) {
|
|
17
|
+
event.preventDefault();
|
|
18
|
+
event.stopPropagation();
|
|
19
|
+
onClick(event);
|
|
20
|
+
}
|
|
21
|
+
};
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Generates Typescript types for analytics events from analytics.spec.yaml
|
|
5
5
|
*
|
|
6
|
-
* @codegen <<SignedSource::
|
|
6
|
+
* @codegen <<SignedSource::1e6835b50307a44a077c38d864a2c66e>>
|
|
7
7
|
* @codegenCommand yarn workspace @atlassian/analytics-tooling run analytics:codegen smart-card
|
|
8
8
|
*/
|
|
9
9
|
export type PackageMetaDataContextType = {
|
|
@@ -61,6 +61,13 @@ export type ButtonClickedShortcutGoToLinkAttributesType = {
|
|
|
61
61
|
display: 'inline' | 'block' | 'embed' | 'embedPreview' | 'flexible' | 'hoverCardPreview' | null;
|
|
62
62
|
resourceType: string | null;
|
|
63
63
|
};
|
|
64
|
+
export type ButtonClickedIssueStatusUpdateAttributesType = {
|
|
65
|
+
actionType: string | null;
|
|
66
|
+
id: string | null;
|
|
67
|
+
definitionId: string | null;
|
|
68
|
+
display: 'inline' | 'block' | 'embed' | 'embedPreview' | 'flexible' | 'hoverCardPreview' | null;
|
|
69
|
+
resourceType: string | null;
|
|
70
|
+
};
|
|
64
71
|
export type ButtonClickedAiSummaryAttributesType = {};
|
|
65
72
|
export type ButtonClickedCopySummaryAttributesType = {};
|
|
66
73
|
export type SummaryViewedAttributesType = {
|
|
@@ -200,6 +207,21 @@ export type ButtonClickedSmartLinkStatusOpenPreviewAttributesType = {};
|
|
|
200
207
|
export type ButtonClickedSmartLinkFollowButtonAttributesType = {};
|
|
201
208
|
export type ButtonClickedStatusUpdateActionAttributesType = {};
|
|
202
209
|
export type ButtonClickedGetStatusTransitionsActionAttributesType = {};
|
|
210
|
+
export type ButtonClickedEmbedPreviewResizeAttributesType = {
|
|
211
|
+
newSize: 'large' | 'small';
|
|
212
|
+
origin: 'smartLinkCard' | 'smartLinkEmbed' | 'smartLinkInline' | 'smartLinkPreviewHoverCard' | null;
|
|
213
|
+
previousSize: 'large' | 'small';
|
|
214
|
+
};
|
|
215
|
+
export type SmartLinkRenderSuccessAttributesType = {
|
|
216
|
+
display: 'inline' | 'block' | 'embed' | 'embedPreview' | 'flexible' | 'hoverCardPreview';
|
|
217
|
+
definitionId: string | null;
|
|
218
|
+
};
|
|
219
|
+
export type SmartLinkRenderFailedAttributesType = {
|
|
220
|
+
display: 'inline' | 'block' | 'embed' | 'embedPreview' | 'flexible' | 'hoverCardPreview';
|
|
221
|
+
error: Record<string, unknown>;
|
|
222
|
+
errorInfo: Record<string, unknown>;
|
|
223
|
+
id: string | null;
|
|
224
|
+
};
|
|
203
225
|
export type AnalyticsEventAttributes = {
|
|
204
226
|
/**
|
|
205
227
|
* Fired when an copy link is clicked */
|
|
@@ -213,6 +235,9 @@ export type AnalyticsEventAttributes = {
|
|
|
213
235
|
/**
|
|
214
236
|
* Fired when an view link is clicked */
|
|
215
237
|
'ui.button.clicked.shortcutGoToLink': ButtonClickedShortcutGoToLinkAttributesType;
|
|
238
|
+
/**
|
|
239
|
+
* fires an event that represents a user clicking on the preview action button */
|
|
240
|
+
'ui.button.clicked.issueStatusUpdate': ButtonClickedIssueStatusUpdateAttributesType;
|
|
216
241
|
/**
|
|
217
242
|
* fired when an ai summary is clicked */
|
|
218
243
|
'ui.button.clicked.aiSummary': ButtonClickedAiSummaryAttributesType;
|
|
@@ -337,5 +362,14 @@ export type AnalyticsEventAttributes = {
|
|
|
337
362
|
'ui.button.clicked.StatusUpdateAction': ButtonClickedStatusUpdateActionAttributesType;
|
|
338
363
|
/** */
|
|
339
364
|
'ui.button.clicked.GetStatusTransitionsAction': ButtonClickedGetStatusTransitionsActionAttributesType;
|
|
365
|
+
/**
|
|
366
|
+
* fires an event that represents a user clicking on the resize button in the embed preview */
|
|
367
|
+
'ui.button.clicked.embedPreviewResize': ButtonClickedEmbedPreviewResizeAttributesType;
|
|
368
|
+
/**
|
|
369
|
+
* fires an event that represents when a Smart Link was rendered successfully (even if the Smart Link errors out) */
|
|
370
|
+
'ui.smartLink.renderSuccess': SmartLinkRenderSuccessAttributesType;
|
|
371
|
+
/**
|
|
372
|
+
* fires an event that represents when a Smart Link renders unsuccessfully. */
|
|
373
|
+
'ui.smartLink.renderFailed': SmartLinkRenderFailedAttributesType;
|
|
340
374
|
};
|
|
341
375
|
export type EventKey = keyof AnalyticsEventAttributes;
|
package/dist/types/types.d.ts
CHANGED
|
@@ -1,17 +1,10 @@
|
|
|
1
1
|
import { type JsonLd } from 'json-ld-types';
|
|
2
|
-
export type
|
|
2
|
+
export { type CardContext } from '@atlaskit/link-provider';
|
|
3
3
|
import { type LozengeProps as AtlaskitLozengeProps } from '@atlaskit/lozenge';
|
|
4
|
-
|
|
5
|
-
import { type ActionProps } from './view/BlockCard/components/Action';
|
|
6
|
-
import { type AccessContext } from './view/types';
|
|
4
|
+
/** @deprecated {@link https://hello.atlassian.net/browse/ENGHEALTH-15961 Internal documentation for deprecation (no external access)} */
|
|
7
5
|
export type ResolveResponse = JsonLd.Response;
|
|
8
|
-
export type
|
|
9
|
-
export type
|
|
10
|
-
export interface RequestAccessContextProps extends AccessContext {
|
|
11
|
-
action?: ActionProps;
|
|
12
|
-
callToActionMessageKey?: RequestAccessMessageKey;
|
|
13
|
-
descriptiveMessageKey?: RequestAccessMessageKey;
|
|
14
|
-
}
|
|
6
|
+
export { type ProviderProps, type CardType } from './state';
|
|
7
|
+
export { type CardProps, type CardAppearance, type CardPlatform } from './view/Card/types';
|
|
15
8
|
export type InlinePreloaderStyle = 'on-left-with-skeleton' | 'on-right-without-skeleton';
|
|
16
9
|
export type LozengeColor = 'default' | 'success' | 'removed' | 'inprogress' | 'new' | 'moved';
|
|
17
10
|
export interface LozengeProps {
|