@atlaskit/smart-card 43.10.1 → 43.10.2
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 +8 -0
- package/dist/cjs/state/actions/index.js +4 -1
- package/dist/cjs/state/hooks/use-resolve/index.js +13 -3
- package/dist/cjs/state/hooks/use-response/index.js +2 -0
- package/dist/cjs/utils/analytics/analytics.js +1 -1
- package/dist/cjs/utils/analytics/click.js +1 -0
- package/dist/cjs/view/FlexibleCard/components/actions/action/index.js +1 -0
- package/dist/cjs/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-container/manual-triggers-form/boolean-prompt/main.js +13 -9
- package/dist/cjs/view/LinkUrl/Hyperlink/index.js +1 -0
- package/dist/cjs/view/LinkUrl/index.js +3 -1
- package/dist/es2019/state/actions/index.js +4 -1
- package/dist/es2019/state/hooks/use-resolve/index.js +10 -1
- package/dist/es2019/state/hooks/use-response/index.js +2 -0
- package/dist/es2019/utils/analytics/analytics.js +1 -1
- package/dist/es2019/utils/analytics/click.js +1 -0
- package/dist/es2019/view/FlexibleCard/components/actions/action/index.js +1 -0
- package/dist/es2019/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-container/manual-triggers-form/boolean-prompt/main.js +12 -8
- package/dist/es2019/view/LinkUrl/Hyperlink/index.js +1 -0
- package/dist/es2019/view/LinkUrl/index.js +3 -1
- package/dist/esm/state/actions/index.js +4 -1
- package/dist/esm/state/hooks/use-resolve/index.js +13 -3
- package/dist/esm/state/hooks/use-response/index.js +2 -0
- package/dist/esm/utils/analytics/analytics.js +1 -1
- package/dist/esm/utils/analytics/click.js +1 -0
- package/dist/esm/view/FlexibleCard/components/actions/action/index.js +1 -0
- package/dist/esm/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-container/manual-triggers-form/boolean-prompt/main.js +13 -9
- package/dist/esm/view/LinkUrl/Hyperlink/index.js +1 -0
- package/dist/esm/view/LinkUrl/index.js +3 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# @atlaskit/smart-card
|
|
2
2
|
|
|
3
|
+
## 43.10.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`4d676bbdb3ce6`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/4d676bbdb3ce6) -
|
|
8
|
+
ts-ignore added temporarily to unblock local consumption for help-center, will be removed once
|
|
9
|
+
project refs are setup
|
|
10
|
+
|
|
3
11
|
## 43.10.1
|
|
4
12
|
|
|
5
13
|
### Patch Changes
|
|
@@ -58,7 +58,10 @@ var useSmartCardActions = exports.useSmartCardActions = function useSmartCardAct
|
|
|
58
58
|
resourceUrl = _args.length > 0 && _args[0] !== undefined ? _args[0] : url;
|
|
59
59
|
isReloading = _args.length > 1 && _args[1] !== undefined ? _args[1] : false;
|
|
60
60
|
isMetadataRequest = _args.length > 2 && _args[2] !== undefined ? _args[2] : false;
|
|
61
|
-
return _context.abrupt("return",
|
|
61
|
+
return _context.abrupt("return",
|
|
62
|
+
// @ts-ignore - Workaround for help-center local consumption
|
|
63
|
+
|
|
64
|
+
resolveUrl(resourceUrl, isReloading, isMetadataRequest, id));
|
|
62
65
|
case 4:
|
|
63
66
|
case "end":
|
|
64
67
|
return _context.stop();
|
|
@@ -49,12 +49,22 @@ var useResolve = function useResolve() {
|
|
|
49
49
|
_context.next = 9;
|
|
50
50
|
break;
|
|
51
51
|
}
|
|
52
|
-
return _context.abrupt("return", connections.client
|
|
53
|
-
|
|
54
|
-
|
|
52
|
+
return _context.abrupt("return", connections.client
|
|
53
|
+
// @ts-ignore - Workaround for help-center local consumption
|
|
54
|
+
.fetchData(url, isReloading).then(function (response) {
|
|
55
|
+
return (
|
|
56
|
+
// @ts-ignore - Workaround for help-center local consumption
|
|
57
|
+
|
|
58
|
+
handleResolvedLinkResponse(url, response, isReloading, isMetadataRequest)
|
|
59
|
+
);
|
|
60
|
+
})
|
|
61
|
+
// @ts-ignore - Workaround for help-center local consumption
|
|
62
|
+
.catch(function (error) {
|
|
55
63
|
return handleResolvedLinkError(url, error, undefined, isMetadataRequest);
|
|
56
64
|
}));
|
|
57
65
|
case 9:
|
|
66
|
+
// @ts-ignore - Workaround for help-center local consumption
|
|
67
|
+
|
|
58
68
|
(0, _analytics.addMetadataToExperience)('smart-link-rendered', id, {
|
|
59
69
|
cached: true
|
|
60
70
|
});
|
|
@@ -122,6 +122,8 @@ var useResponse = function useResponse() {
|
|
|
122
122
|
* https://react-redux.js.org/api/batch
|
|
123
123
|
*/
|
|
124
124
|
(0, _reactDom.unstable_batchedUpdates)(function () {
|
|
125
|
+
// @ts-ignore - Workaround for help-center local consumption
|
|
126
|
+
|
|
125
127
|
handleResolvedLinkSuccess(resourceUrl, response, isReloading, isMetadataRequest);
|
|
126
128
|
});
|
|
127
129
|
}, [handleResolvedLinkError, handleResolvedLinkSuccess, hasAuthFlowSupported]);
|
|
@@ -11,7 +11,7 @@ var ANALYTICS_CHANNEL = exports.ANALYTICS_CHANNEL = 'media';
|
|
|
11
11
|
var context = exports.context = {
|
|
12
12
|
componentName: 'smart-cards',
|
|
13
13
|
packageName: "@atlaskit/smart-card",
|
|
14
|
-
packageVersion: "
|
|
14
|
+
packageVersion: "0.0.0-development"
|
|
15
15
|
};
|
|
16
16
|
var TrackQuickActionType = exports.TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
|
|
17
17
|
TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
|
|
@@ -142,6 +142,7 @@ var getDisplayName = function getDisplayName(WrappedComponent) {
|
|
|
142
142
|
if (typeof WrappedComponent === 'string') {
|
|
143
143
|
return WrappedComponent;
|
|
144
144
|
}
|
|
145
|
+
// @ts-ignore - Workaround for help-center local consumption
|
|
145
146
|
return WrappedComponent.displayName || WrappedComponent.name || 'Component';
|
|
146
147
|
};
|
|
147
148
|
function withLinkClickedEvent(WrappedComponent) {
|
|
@@ -103,6 +103,7 @@ var Action = function Action(_ref) {
|
|
|
103
103
|
href: href,
|
|
104
104
|
ariaLabel: ariaLabel
|
|
105
105
|
});
|
|
106
|
+
// @ts-ignore - Workaround for help-center local consumption
|
|
106
107
|
return Wrapper !== undefined ? /*#__PURE__*/_react.default.createElement(Wrapper, null, button) : button;
|
|
107
108
|
};
|
|
108
109
|
var _default = exports.default = Action;
|
|
@@ -15,14 +15,18 @@ var BooleanInputPrompt = function BooleanInputPrompt(_ref) {
|
|
|
15
15
|
var variableName = userInputPrompt.variableName,
|
|
16
16
|
displayName = userInputPrompt.displayName,
|
|
17
17
|
defaultValue = userInputPrompt.defaultValue;
|
|
18
|
-
return
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
18
|
+
return (
|
|
19
|
+
/*#__PURE__*/
|
|
20
|
+
// @ts-ignore - Workaround for help-center local consumption
|
|
21
|
+
_react.default.createElement(_form.CheckboxField, {
|
|
22
|
+
name: variableName,
|
|
23
|
+
defaultIsChecked: defaultValue || false
|
|
24
|
+
}, function (_ref2) {
|
|
25
|
+
var fieldProps = _ref2.fieldProps;
|
|
26
|
+
return /*#__PURE__*/_react.default.createElement(_checkbox.default, (0, _extends2.default)({}, fieldProps, {
|
|
27
|
+
label: displayName
|
|
28
|
+
}));
|
|
29
|
+
})
|
|
30
|
+
);
|
|
27
31
|
};
|
|
28
32
|
var _default = exports.default = BooleanInputPrompt;
|
|
@@ -11,6 +11,7 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
11
11
|
var _link = _interopRequireDefault(require("@atlaskit/link"));
|
|
12
12
|
var _click = require("../../../utils/analytics/click");
|
|
13
13
|
var _excluded = ["href", "children", "testId", "isLinkComponent"];
|
|
14
|
+
// @ts-ignore - Workaround for help-center local consumption
|
|
14
15
|
var Anchor = (0, _click.withLinkClickedEvent)('a');
|
|
15
16
|
var LinkComponent = exports.LinkComponent = (0, _click.withLinkClickedEvent)(_link.default);
|
|
16
17
|
var Hyperlink = function Hyperlink(_ref) {
|
|
@@ -22,9 +22,11 @@ var _excluded = ["href", "children", "checkSafety", "onClick", "testId", "isLink
|
|
|
22
22
|
_excluded2 = ["isLinkSafe", "showSafetyWarningModal"];
|
|
23
23
|
var PACKAGE_DATA = {
|
|
24
24
|
packageName: "@atlaskit/smart-card",
|
|
25
|
-
packageVersion: "
|
|
25
|
+
packageVersion: "0.0.0-development",
|
|
26
26
|
componentName: 'linkUrl'
|
|
27
27
|
};
|
|
28
|
+
|
|
29
|
+
// @ts-ignore - Workaround for help-center local consumption
|
|
28
30
|
var Anchor = (0, _click.withLinkClickedEvent)('a');
|
|
29
31
|
var LinkComponent = exports.LinkComponent = (0, _click.withLinkClickedEvent)(_link.default);
|
|
30
32
|
var LinkUrl = function LinkUrl(_ref) {
|
|
@@ -43,7 +43,10 @@ export const useSmartCardActions = (id, url) => {
|
|
|
43
43
|
url
|
|
44
44
|
}, undefined, undefined, metadataStatus));
|
|
45
45
|
}, [dispatch, url]);
|
|
46
|
-
const resolve = useCallback(async (resourceUrl = url, isReloading = false, isMetadataRequest = false) =>
|
|
46
|
+
const resolve = useCallback(async (resourceUrl = url, isReloading = false, isMetadataRequest = false) =>
|
|
47
|
+
// @ts-ignore - Workaround for help-center local consumption
|
|
48
|
+
|
|
49
|
+
resolveUrl(resourceUrl, isReloading, isMetadataRequest, id), [id, resolveUrl, url]);
|
|
47
50
|
const register = useCallback(() => {
|
|
48
51
|
const {
|
|
49
52
|
details
|
|
@@ -29,8 +29,17 @@ const useResolve = () => {
|
|
|
29
29
|
};
|
|
30
30
|
const hasData = !!(details && details.data || isEntityPresent(details));
|
|
31
31
|
if (isReloading || !hasData || isMetadataRequest) {
|
|
32
|
-
return connections.client
|
|
32
|
+
return connections.client
|
|
33
|
+
// @ts-ignore - Workaround for help-center local consumption
|
|
34
|
+
.fetchData(url, isReloading).then(response =>
|
|
35
|
+
// @ts-ignore - Workaround for help-center local consumption
|
|
36
|
+
|
|
37
|
+
handleResolvedLinkResponse(url, response, isReloading, isMetadataRequest))
|
|
38
|
+
// @ts-ignore - Workaround for help-center local consumption
|
|
39
|
+
.catch(error => handleResolvedLinkError(url, error, undefined, isMetadataRequest));
|
|
33
40
|
} else {
|
|
41
|
+
// @ts-ignore - Workaround for help-center local consumption
|
|
42
|
+
|
|
34
43
|
addMetadataToExperience('smart-link-rendered', id, {
|
|
35
44
|
cached: true
|
|
36
45
|
});
|
|
@@ -118,6 +118,8 @@ const useResponse = () => {
|
|
|
118
118
|
* https://react-redux.js.org/api/batch
|
|
119
119
|
*/
|
|
120
120
|
unstable_batchedUpdates(() => {
|
|
121
|
+
// @ts-ignore - Workaround for help-center local consumption
|
|
122
|
+
|
|
121
123
|
handleResolvedLinkSuccess(resourceUrl, response, isReloading, isMetadataRequest);
|
|
122
124
|
});
|
|
123
125
|
}, [handleResolvedLinkError, handleResolvedLinkSuccess, hasAuthFlowSupported]);
|
|
@@ -2,7 +2,7 @@ export const ANALYTICS_CHANNEL = 'media';
|
|
|
2
2
|
export const context = {
|
|
3
3
|
componentName: 'smart-cards',
|
|
4
4
|
packageName: "@atlaskit/smart-card",
|
|
5
|
-
packageVersion: "
|
|
5
|
+
packageVersion: "0.0.0-development"
|
|
6
6
|
};
|
|
7
7
|
export let TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
|
|
8
8
|
TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
|
|
@@ -134,6 +134,7 @@ const getDisplayName = WrappedComponent => {
|
|
|
134
134
|
if (typeof WrappedComponent === 'string') {
|
|
135
135
|
return WrappedComponent;
|
|
136
136
|
}
|
|
137
|
+
// @ts-ignore - Workaround for help-center local consumption
|
|
137
138
|
return WrappedComponent.displayName || WrappedComponent.name || 'Component';
|
|
138
139
|
};
|
|
139
140
|
export function withLinkClickedEvent(WrappedComponent) {
|
|
@@ -11,13 +11,17 @@ const BooleanInputPrompt = ({
|
|
|
11
11
|
displayName,
|
|
12
12
|
defaultValue
|
|
13
13
|
} = userInputPrompt;
|
|
14
|
-
return
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
14
|
+
return (
|
|
15
|
+
/*#__PURE__*/
|
|
16
|
+
// @ts-ignore - Workaround for help-center local consumption
|
|
17
|
+
React.createElement(CheckboxField, {
|
|
18
|
+
name: variableName,
|
|
19
|
+
defaultIsChecked: defaultValue || false
|
|
20
|
+
}, ({
|
|
21
|
+
fieldProps
|
|
22
|
+
}) => /*#__PURE__*/React.createElement(Checkbox, _extends({}, fieldProps, {
|
|
23
|
+
label: displayName
|
|
24
|
+
})))
|
|
25
|
+
);
|
|
22
26
|
};
|
|
23
27
|
export default BooleanInputPrompt;
|
|
@@ -2,6 +2,7 @@ import _extends from "@babel/runtime/helpers/extends";
|
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import AKLink from '@atlaskit/link';
|
|
4
4
|
import { withLinkClickedEvent } from '../../../utils/analytics/click';
|
|
5
|
+
// @ts-ignore - Workaround for help-center local consumption
|
|
5
6
|
const Anchor = withLinkClickedEvent('a');
|
|
6
7
|
export const LinkComponent = withLinkClickedEvent(AKLink);
|
|
7
8
|
const Hyperlink = ({
|
|
@@ -12,9 +12,11 @@ import LinkWarningModal from './LinkWarningModal';
|
|
|
12
12
|
import { useLinkWarningModal } from './LinkWarningModal/hooks/use-link-warning-modal';
|
|
13
13
|
const PACKAGE_DATA = {
|
|
14
14
|
packageName: "@atlaskit/smart-card",
|
|
15
|
-
packageVersion: "
|
|
15
|
+
packageVersion: "0.0.0-development",
|
|
16
16
|
componentName: 'linkUrl'
|
|
17
17
|
};
|
|
18
|
+
|
|
19
|
+
// @ts-ignore - Workaround for help-center local consumption
|
|
18
20
|
const Anchor = withLinkClickedEvent('a');
|
|
19
21
|
export const LinkComponent = withLinkClickedEvent(AKLink);
|
|
20
22
|
const LinkUrl = ({
|
|
@@ -51,7 +51,10 @@ export var useSmartCardActions = function useSmartCardActions(id, url) {
|
|
|
51
51
|
resourceUrl = _args.length > 0 && _args[0] !== undefined ? _args[0] : url;
|
|
52
52
|
isReloading = _args.length > 1 && _args[1] !== undefined ? _args[1] : false;
|
|
53
53
|
isMetadataRequest = _args.length > 2 && _args[2] !== undefined ? _args[2] : false;
|
|
54
|
-
return _context.abrupt("return",
|
|
54
|
+
return _context.abrupt("return",
|
|
55
|
+
// @ts-ignore - Workaround for help-center local consumption
|
|
56
|
+
|
|
57
|
+
resolveUrl(resourceUrl, isReloading, isMetadataRequest, id));
|
|
55
58
|
case 4:
|
|
56
59
|
case "end":
|
|
57
60
|
return _context.stop();
|
|
@@ -42,12 +42,22 @@ var useResolve = function useResolve() {
|
|
|
42
42
|
_context.next = 9;
|
|
43
43
|
break;
|
|
44
44
|
}
|
|
45
|
-
return _context.abrupt("return", connections.client
|
|
46
|
-
|
|
47
|
-
|
|
45
|
+
return _context.abrupt("return", connections.client
|
|
46
|
+
// @ts-ignore - Workaround for help-center local consumption
|
|
47
|
+
.fetchData(url, isReloading).then(function (response) {
|
|
48
|
+
return (
|
|
49
|
+
// @ts-ignore - Workaround for help-center local consumption
|
|
50
|
+
|
|
51
|
+
handleResolvedLinkResponse(url, response, isReloading, isMetadataRequest)
|
|
52
|
+
);
|
|
53
|
+
})
|
|
54
|
+
// @ts-ignore - Workaround for help-center local consumption
|
|
55
|
+
.catch(function (error) {
|
|
48
56
|
return handleResolvedLinkError(url, error, undefined, isMetadataRequest);
|
|
49
57
|
}));
|
|
50
58
|
case 9:
|
|
59
|
+
// @ts-ignore - Workaround for help-center local consumption
|
|
60
|
+
|
|
51
61
|
addMetadataToExperience('smart-link-rendered', id, {
|
|
52
62
|
cached: true
|
|
53
63
|
});
|
|
@@ -116,6 +116,8 @@ var useResponse = function useResponse() {
|
|
|
116
116
|
* https://react-redux.js.org/api/batch
|
|
117
117
|
*/
|
|
118
118
|
unstable_batchedUpdates(function () {
|
|
119
|
+
// @ts-ignore - Workaround for help-center local consumption
|
|
120
|
+
|
|
119
121
|
handleResolvedLinkSuccess(resourceUrl, response, isReloading, isMetadataRequest);
|
|
120
122
|
});
|
|
121
123
|
}, [handleResolvedLinkError, handleResolvedLinkSuccess, hasAuthFlowSupported]);
|
|
@@ -4,7 +4,7 @@ export var ANALYTICS_CHANNEL = 'media';
|
|
|
4
4
|
export var context = {
|
|
5
5
|
componentName: 'smart-cards',
|
|
6
6
|
packageName: "@atlaskit/smart-card",
|
|
7
|
-
packageVersion: "
|
|
7
|
+
packageVersion: "0.0.0-development"
|
|
8
8
|
};
|
|
9
9
|
export var TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
|
|
10
10
|
TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
|
|
@@ -133,6 +133,7 @@ var getDisplayName = function getDisplayName(WrappedComponent) {
|
|
|
133
133
|
if (typeof WrappedComponent === 'string') {
|
|
134
134
|
return WrappedComponent;
|
|
135
135
|
}
|
|
136
|
+
// @ts-ignore - Workaround for help-center local consumption
|
|
136
137
|
return WrappedComponent.displayName || WrappedComponent.name || 'Component';
|
|
137
138
|
};
|
|
138
139
|
export function withLinkClickedEvent(WrappedComponent) {
|
|
@@ -96,6 +96,7 @@ var Action = function Action(_ref) {
|
|
|
96
96
|
href: href,
|
|
97
97
|
ariaLabel: ariaLabel
|
|
98
98
|
});
|
|
99
|
+
// @ts-ignore - Workaround for help-center local consumption
|
|
99
100
|
return Wrapper !== undefined ? /*#__PURE__*/React.createElement(Wrapper, null, button) : button;
|
|
100
101
|
};
|
|
101
102
|
export default Action;
|
|
@@ -8,14 +8,18 @@ var BooleanInputPrompt = function BooleanInputPrompt(_ref) {
|
|
|
8
8
|
var variableName = userInputPrompt.variableName,
|
|
9
9
|
displayName = userInputPrompt.displayName,
|
|
10
10
|
defaultValue = userInputPrompt.defaultValue;
|
|
11
|
-
return
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
11
|
+
return (
|
|
12
|
+
/*#__PURE__*/
|
|
13
|
+
// @ts-ignore - Workaround for help-center local consumption
|
|
14
|
+
React.createElement(CheckboxField, {
|
|
15
|
+
name: variableName,
|
|
16
|
+
defaultIsChecked: defaultValue || false
|
|
17
|
+
}, function (_ref2) {
|
|
18
|
+
var fieldProps = _ref2.fieldProps;
|
|
19
|
+
return /*#__PURE__*/React.createElement(Checkbox, _extends({}, fieldProps, {
|
|
20
|
+
label: displayName
|
|
21
|
+
}));
|
|
22
|
+
})
|
|
23
|
+
);
|
|
20
24
|
};
|
|
21
25
|
export default BooleanInputPrompt;
|
|
@@ -4,6 +4,7 @@ var _excluded = ["href", "children", "testId", "isLinkComponent"];
|
|
|
4
4
|
import React from 'react';
|
|
5
5
|
import AKLink from '@atlaskit/link';
|
|
6
6
|
import { withLinkClickedEvent } from '../../../utils/analytics/click';
|
|
7
|
+
// @ts-ignore - Workaround for help-center local consumption
|
|
7
8
|
var Anchor = withLinkClickedEvent('a');
|
|
8
9
|
export var LinkComponent = withLinkClickedEvent(AKLink);
|
|
9
10
|
var Hyperlink = function Hyperlink(_ref) {
|
|
@@ -15,9 +15,11 @@ import LinkWarningModal from './LinkWarningModal';
|
|
|
15
15
|
import { useLinkWarningModal } from './LinkWarningModal/hooks/use-link-warning-modal';
|
|
16
16
|
var PACKAGE_DATA = {
|
|
17
17
|
packageName: "@atlaskit/smart-card",
|
|
18
|
-
packageVersion: "
|
|
18
|
+
packageVersion: "0.0.0-development",
|
|
19
19
|
componentName: 'linkUrl'
|
|
20
20
|
};
|
|
21
|
+
|
|
22
|
+
// @ts-ignore - Workaround for help-center local consumption
|
|
21
23
|
var Anchor = withLinkClickedEvent('a');
|
|
22
24
|
export var LinkComponent = withLinkClickedEvent(AKLink);
|
|
23
25
|
var LinkUrl = function LinkUrl(_ref) {
|