@atlaskit/smart-card 26.56.4 → 26.56.5
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 +6 -0
- package/dist/cjs/extractors/flexible/actions/extract-follow-action.js +4 -1
- package/dist/cjs/extractors/flexible/actions/index.js +2 -1
- package/dist/cjs/extractors/flexible/index.js +1 -1
- package/dist/cjs/messages.js +40 -0
- package/dist/cjs/utils/analytics/analytics.js +1 -1
- package/dist/cjs/view/FlexibleCard/components/actions/follow-action/goal-icon/index.js +29 -0
- package/dist/cjs/view/FlexibleCard/components/actions/follow-action/index.js +53 -3
- package/dist/cjs/view/FlexibleCard/components/actions/follow-action/projects-icon/index.js +29 -0
- package/dist/cjs/view/FlexibleCard/components/utils.js +14 -1
- package/dist/cjs/view/LinkUrl/index.js +1 -1
- package/dist/es2019/extractors/flexible/actions/extract-follow-action.js +5 -2
- package/dist/es2019/extractors/flexible/actions/index.js +2 -1
- package/dist/es2019/extractors/flexible/index.js +1 -1
- package/dist/es2019/messages.js +40 -0
- package/dist/es2019/utils/analytics/analytics.js +1 -1
- package/dist/es2019/view/FlexibleCard/components/actions/follow-action/goal-icon/index.js +18 -0
- package/dist/es2019/view/FlexibleCard/components/actions/follow-action/index.js +40 -3
- package/dist/es2019/view/FlexibleCard/components/actions/follow-action/projects-icon/index.js +18 -0
- package/dist/es2019/view/FlexibleCard/components/utils.js +7 -0
- package/dist/es2019/view/LinkUrl/index.js +1 -1
- package/dist/esm/extractors/flexible/actions/extract-follow-action.js +5 -2
- package/dist/esm/extractors/flexible/actions/index.js +2 -1
- package/dist/esm/extractors/flexible/index.js +1 -1
- package/dist/esm/messages.js +40 -0
- package/dist/esm/utils/analytics/analytics.js +1 -1
- package/dist/esm/view/FlexibleCard/components/actions/follow-action/goal-icon/index.js +22 -0
- package/dist/esm/view/FlexibleCard/components/actions/follow-action/index.js +46 -3
- package/dist/esm/view/FlexibleCard/components/actions/follow-action/projects-icon/index.js +22 -0
- package/dist/esm/view/FlexibleCard/components/utils.js +13 -0
- package/dist/esm/view/LinkUrl/index.js +1 -1
- package/dist/types/extractors/flexible/actions/index.d.ts +1 -1
- package/dist/types/messages.d.ts +1 -1
- package/dist/types/state/flexible-ui-context/types.d.ts +1 -0
- package/dist/types/view/FlexibleCard/components/actions/follow-action/__fixtures__/follow-goal-context.d.ts +3 -0
- package/dist/types/view/FlexibleCard/components/actions/follow-action/goal-icon/index.d.ts +3 -0
- package/dist/types/view/FlexibleCard/components/actions/follow-action/projects-icon/index.d.ts +3 -0
- package/dist/types/view/FlexibleCard/components/utils.d.ts +1 -0
- package/dist/types-ts4.5/extractors/flexible/actions/index.d.ts +1 -1
- package/dist/types-ts4.5/messages.d.ts +1 -1
- package/dist/types-ts4.5/state/flexible-ui-context/types.d.ts +1 -0
- package/dist/types-ts4.5/view/FlexibleCard/components/actions/follow-action/__fixtures__/follow-goal-context.d.ts +3 -0
- package/dist/types-ts4.5/view/FlexibleCard/components/actions/follow-action/goal-icon/index.d.ts +3 -0
- package/dist/types-ts4.5/view/FlexibleCard/components/actions/follow-action/projects-icon/index.d.ts +3 -0
- package/dist/types-ts4.5/view/FlexibleCard/components/utils.d.ts +1 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# @atlaskit/smart-card
|
|
2
2
|
|
|
3
|
+
## 26.56.5
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#90940](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/90940) [`c74e41ce62aa`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/c74e41ce62aa) - [ux] Updating FollowAction to support ActionBlock
|
|
8
|
+
|
|
3
9
|
## 26.56.4
|
|
4
10
|
|
|
5
11
|
### Patch Changes
|
|
@@ -19,6 +19,8 @@ var extractFollowAction = function extractFollowAction(response, actionOptions,
|
|
|
19
19
|
var extensionKey = (0, _helpers.getExtensionKey)(response);
|
|
20
20
|
var data = response === null || response === void 0 ? void 0 : response.data;
|
|
21
21
|
var actions = (0, _extractServerAction.default)(data);
|
|
22
|
+
var type = (0, _linkExtractors.extractType)(data);
|
|
23
|
+
var isProject = type === null || type === void 0 ? void 0 : type.includes('atlassian:Project');
|
|
22
24
|
if (!extensionKey || actions.length === 0) {
|
|
23
25
|
return;
|
|
24
26
|
}
|
|
@@ -48,7 +50,8 @@ var extractFollowAction = function extractFollowAction(response, actionOptions,
|
|
|
48
50
|
providerKey: extensionKey,
|
|
49
51
|
reload: reload
|
|
50
52
|
},
|
|
51
|
-
value: actionType === _linkingTypes.SmartLinkActionType.FollowEntityAction
|
|
53
|
+
value: actionType === _linkingTypes.SmartLinkActionType.FollowEntityAction,
|
|
54
|
+
isProject: isProject
|
|
52
55
|
};
|
|
53
56
|
};
|
|
54
57
|
var _default = exports.default = extractFollowAction;
|
|
@@ -11,8 +11,9 @@ var _extractDownloadAction = require("./extract-download-action");
|
|
|
11
11
|
var _extractPreviewAction = require("./extract-preview-action");
|
|
12
12
|
var _extractFollowAction = _interopRequireDefault(require("./extract-follow-action"));
|
|
13
13
|
var _extractCopyLinkAction = require("./extract-copy-link-action");
|
|
14
|
-
var extractActions = function extractActions(response,
|
|
14
|
+
var extractActions = function extractActions(response, actionOptions, id) {
|
|
15
15
|
var _action;
|
|
16
|
+
var data = response.data;
|
|
16
17
|
var action = (_action = {}, (0, _defineProperty2.default)(_action, _constants.ActionName.CopyLinkAction, (0, _extractCopyLinkAction.extractCopyLinkAction)(data, actionOptions)), (0, _defineProperty2.default)(_action, _constants.ActionName.DownloadAction, (0, _extractDownloadAction.extractDownloadAction)(data, actionOptions)), (0, _defineProperty2.default)(_action, _constants.ActionName.FollowAction, (0, _extractFollowAction.default)(response, actionOptions, id)), (0, _defineProperty2.default)(_action, _constants.ActionName.PreviewAction, (0, _extractPreviewAction.extractPreviewAction)(response, actionOptions)), _action);
|
|
17
18
|
return Object.values(action).some(function (value) {
|
|
18
19
|
return Boolean(value);
|
|
@@ -29,7 +29,7 @@ var extractFlexibleUiContext = function extractFlexibleUiContext() {
|
|
|
29
29
|
var data = response.data;
|
|
30
30
|
var url = (0, _linkExtractors.extractLink)(data);
|
|
31
31
|
return {
|
|
32
|
-
actions: (0, _actions.default)(response,
|
|
32
|
+
actions: (0, _actions.default)(response, actionOptions, id),
|
|
33
33
|
assignedToGroup: (0, _utils.extractPersonAssignedToAsArray)(data),
|
|
34
34
|
attachmentCount: (0, _utils.extractAttachmentCount)(data),
|
|
35
35
|
authorGroup: (0, _linkExtractors.extractPersonCreatedBy)(data),
|
package/dist/cjs/messages.js
CHANGED
|
@@ -211,6 +211,26 @@ var messages = exports.messages = (0, _reactIntlNext.defineMessages)({
|
|
|
211
211
|
defaultMessage: 'Follow',
|
|
212
212
|
description: 'Click to follow a project.'
|
|
213
213
|
},
|
|
214
|
+
follow_project_description: {
|
|
215
|
+
id: 'fabric.linking.follow_project_description.nonfinal',
|
|
216
|
+
defaultMessage: 'Follow to get notifications on this project',
|
|
217
|
+
description: 'Description on what Follow does'
|
|
218
|
+
},
|
|
219
|
+
follow_project: {
|
|
220
|
+
id: 'fabric.linking.follow_project.nonfinal',
|
|
221
|
+
defaultMessage: 'Follow project',
|
|
222
|
+
description: 'Click to follow a project.'
|
|
223
|
+
},
|
|
224
|
+
follow_goal_description: {
|
|
225
|
+
id: 'fabric.linking.follow_goal_description.nonfinal',
|
|
226
|
+
defaultMessage: 'Follow this goal to get notifications on updates',
|
|
227
|
+
description: 'Description on what Follow does'
|
|
228
|
+
},
|
|
229
|
+
follow_goal: {
|
|
230
|
+
id: 'fabric.linking.follow_goal.nonfinal',
|
|
231
|
+
defaultMessage: 'Follow goal',
|
|
232
|
+
description: 'Click to follow a project.'
|
|
233
|
+
},
|
|
214
234
|
go_back: {
|
|
215
235
|
id: 'fabric.linking.go_back',
|
|
216
236
|
defaultMessage: 'Go back',
|
|
@@ -471,6 +491,26 @@ var messages = exports.messages = (0, _reactIntlNext.defineMessages)({
|
|
|
471
491
|
defaultMessage: 'Unfollow',
|
|
472
492
|
description: 'Click to unfollow a project.'
|
|
473
493
|
},
|
|
494
|
+
unfollow_project_description: {
|
|
495
|
+
id: 'fabric.linking.unfollow_project_description.nonfinal',
|
|
496
|
+
defaultMessage: 'Unfollow to stop receiving project notifications',
|
|
497
|
+
description: 'Description on what Unfollow does'
|
|
498
|
+
},
|
|
499
|
+
unfollow_project: {
|
|
500
|
+
id: 'fabric.linking.unfollow_project.nonfinal',
|
|
501
|
+
defaultMessage: 'Unfollow project',
|
|
502
|
+
description: 'Click to unfollow a project.'
|
|
503
|
+
},
|
|
504
|
+
unfollow_goal_description: {
|
|
505
|
+
id: 'fabric.linking.unfollow_goal_description.nonfinal',
|
|
506
|
+
defaultMessage: 'Unfollow to stop receiving notifications for this goal',
|
|
507
|
+
description: 'Description on what Unfollow does'
|
|
508
|
+
},
|
|
509
|
+
unfollow_goal: {
|
|
510
|
+
id: 'fabric.linking.unfollow_goal.nonfinal',
|
|
511
|
+
defaultMessage: 'Unfollow goal',
|
|
512
|
+
description: 'Click to unfollow a project.'
|
|
513
|
+
},
|
|
474
514
|
unlink_account: {
|
|
475
515
|
id: 'fabric.linking.unlink_account',
|
|
476
516
|
defaultMessage: 'Unlink Account',
|
|
@@ -22,7 +22,7 @@ var ANALYTICS_CHANNEL = exports.ANALYTICS_CHANNEL = 'media';
|
|
|
22
22
|
var context = exports.context = {
|
|
23
23
|
componentName: 'smart-cards',
|
|
24
24
|
packageName: "@atlaskit/smart-card",
|
|
25
|
-
packageVersion: "26.56.
|
|
25
|
+
packageVersion: "26.56.5"
|
|
26
26
|
};
|
|
27
27
|
var TrackQuickActionType = exports.TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
|
|
28
28
|
TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.GoalIcon = void 0;
|
|
8
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
9
|
+
var _icon = _interopRequireDefault(require("@atlaskit/icon"));
|
|
10
|
+
var _react = _interopRequireDefault(require("react"));
|
|
11
|
+
var GoalGlyph = function GoalGlyph(props) {
|
|
12
|
+
return /*#__PURE__*/_react.default.createElement("svg", {
|
|
13
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
14
|
+
width: "16",
|
|
15
|
+
height: "16",
|
|
16
|
+
viewBox: "0 0 16 16",
|
|
17
|
+
fill: "none"
|
|
18
|
+
}, /*#__PURE__*/_react.default.createElement("path", {
|
|
19
|
+
fillRule: "evenodd",
|
|
20
|
+
clipRule: "evenodd",
|
|
21
|
+
d: "M12.6667 8C12.6667 10.5773 10.5773 12.6667 8 12.6667C5.42267 12.6667 3.33333 10.5773 3.33333 8C3.33333 5.42267 5.42267 3.33333 8 3.33333C10.5773 3.33333 12.6667 5.42267 12.6667 8ZM14 8C14 11.3137 11.3137 14 8 14C4.68629 14 2 11.3137 2 8C2 4.68629 4.68629 2 8 2C11.3137 2 14 4.68629 14 8ZM9.33333 8C9.33333 8.73638 8.73638 9.33333 8 9.33333C7.26362 9.33333 6.66667 8.73638 6.66667 8C6.66667 7.26362 7.26362 6.66667 8 6.66667C8.73638 6.66667 9.33333 7.26362 9.33333 8ZM10.6667 8C10.6667 9.47276 9.47276 10.6667 8 10.6667C6.52724 10.6667 5.33333 9.47276 5.33333 8C5.33333 6.52724 6.52724 5.33333 8 5.33333C9.47276 5.33333 10.6667 6.52724 10.6667 8Z",
|
|
22
|
+
fill: "#0C66E4"
|
|
23
|
+
}));
|
|
24
|
+
};
|
|
25
|
+
var GoalIcon = exports.GoalIcon = function GoalIcon(props) {
|
|
26
|
+
return /*#__PURE__*/_react.default.createElement(_icon.default, (0, _extends2.default)({
|
|
27
|
+
glyph: GoalGlyph
|
|
28
|
+
}, props));
|
|
29
|
+
};
|
|
@@ -5,6 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
7
|
exports.default = void 0;
|
|
8
|
+
var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
|
|
8
9
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
9
10
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
10
11
|
var _inviteTeam = _interopRequireDefault(require("@atlaskit/icon/glyph/invite-team"));
|
|
@@ -15,7 +16,39 @@ var _messages = require("../../../../../messages");
|
|
|
15
16
|
var _flexibleUiContext = require("../../../../../state/flexible-ui-context");
|
|
16
17
|
var _serverAction = _interopRequireDefault(require("../action/server-action"));
|
|
17
18
|
var _unfollowIcon = _interopRequireDefault(require("./unfollow-icon"));
|
|
19
|
+
var _utils = require("../../utils");
|
|
18
20
|
var _excluded = ["value"];
|
|
21
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
22
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != (0, _typeof2.default)(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
23
|
+
var importIconMapper = {
|
|
24
|
+
goal: function goal() {
|
|
25
|
+
return Promise.resolve().then(function () {
|
|
26
|
+
return _interopRequireWildcard(require( /* webpackChunkName: "glyphGoal" */'./goal-icon'));
|
|
27
|
+
}).then(function (_ref) {
|
|
28
|
+
var GoalIcon = _ref.GoalIcon;
|
|
29
|
+
return {
|
|
30
|
+
default: GoalIcon
|
|
31
|
+
};
|
|
32
|
+
});
|
|
33
|
+
},
|
|
34
|
+
projects: function projects() {
|
|
35
|
+
return Promise.resolve().then(function () {
|
|
36
|
+
return _interopRequireWildcard(require( /* webpackChunkName: "glyphProjects" */'./projects-icon'));
|
|
37
|
+
}).then(function (_ref2) {
|
|
38
|
+
var ProjectsIcon = _ref2.ProjectsIcon;
|
|
39
|
+
return {
|
|
40
|
+
default: ProjectsIcon
|
|
41
|
+
};
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
var getIcon = function getIcon(stackIconType) {
|
|
46
|
+
var importFn = importIconMapper[stackIconType];
|
|
47
|
+
if (!importFn) {
|
|
48
|
+
return null;
|
|
49
|
+
}
|
|
50
|
+
return (0, _utils.importIcon)(importFn);
|
|
51
|
+
};
|
|
19
52
|
var FollowAction = function FollowAction(props) {
|
|
20
53
|
var _context$actions, _context$actions2;
|
|
21
54
|
var context = (0, _flexibleUiContext.useFlexibleUiContext)();
|
|
@@ -25,17 +58,34 @@ var FollowAction = function FollowAction(props) {
|
|
|
25
58
|
var _context$actions$Acti = context === null || context === void 0 || (_context$actions2 = context.actions) === null || _context$actions2 === void 0 ? void 0 : _context$actions2[_constants.ActionName.FollowAction],
|
|
26
59
|
value = _context$actions$Acti.value,
|
|
27
60
|
data = (0, _objectWithoutProperties2.default)(_context$actions$Acti, _excluded);
|
|
61
|
+
var isStackItem = props.as === 'stack-item';
|
|
62
|
+
var isProject = data.isProject;
|
|
28
63
|
var message = value ? _messages.messages.follow : _messages.messages.unfollow;
|
|
64
|
+
var projectMessage = value ? _messages.messages.follow_project : _messages.messages.unfollow_project;
|
|
65
|
+
var goalMessage = value ? _messages.messages.follow_goal : _messages.messages.unfollow_goal;
|
|
66
|
+
var stackMessage = isProject ? projectMessage : goalMessage;
|
|
67
|
+
var label = isStackItem ? stackMessage : message;
|
|
68
|
+
var projectTooltipMessage = value ? _messages.messages.follow_project_description : _messages.messages.unfollow_project_description;
|
|
69
|
+
var goalTooltipMessage = value ? _messages.messages.follow_goal_description : _messages.messages.unfollow_goal_description;
|
|
70
|
+
var stackTooltipMessage = isProject ? projectTooltipMessage : goalTooltipMessage;
|
|
71
|
+
var tooltipMessage = isStackItem ? stackTooltipMessage : message;
|
|
29
72
|
var icon = value ? /*#__PURE__*/_react.default.createElement(_inviteTeam.default, {
|
|
30
73
|
label: "Follow"
|
|
31
74
|
}) : /*#__PURE__*/_react.default.createElement(_unfollowIcon.default, {
|
|
32
75
|
label: "Unfollow"
|
|
33
76
|
});
|
|
77
|
+
var stackIconType = isProject ? 'projects' : 'goal';
|
|
78
|
+
var ImportedIcon = getIcon(stackIconType);
|
|
79
|
+
var stackIcon = /*#__PURE__*/_react.default.createElement(ImportedIcon, {
|
|
80
|
+
label: "Follow",
|
|
81
|
+
testId: "smart-action-follow-action-".concat(stackIconType, "-icon")
|
|
82
|
+
});
|
|
83
|
+
var followIcon = isStackItem ? stackIcon : icon;
|
|
34
84
|
return /*#__PURE__*/_react.default.createElement(_serverAction.default, (0, _extends2.default)({
|
|
35
|
-
content: /*#__PURE__*/_react.default.createElement(_reactIntlNext.FormattedMessage,
|
|
36
|
-
icon:
|
|
85
|
+
content: /*#__PURE__*/_react.default.createElement(_reactIntlNext.FormattedMessage, label),
|
|
86
|
+
icon: followIcon,
|
|
37
87
|
testId: "smart-action-follow-action",
|
|
38
|
-
tooltipMessage: /*#__PURE__*/_react.default.createElement(_reactIntlNext.FormattedMessage,
|
|
88
|
+
tooltipMessage: /*#__PURE__*/_react.default.createElement(_reactIntlNext.FormattedMessage, tooltipMessage)
|
|
39
89
|
}, data, props));
|
|
40
90
|
};
|
|
41
91
|
var _default = exports.default = FollowAction;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.ProjectsIcon = void 0;
|
|
8
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
9
|
+
var _icon = _interopRequireDefault(require("@atlaskit/icon"));
|
|
10
|
+
var _react = _interopRequireDefault(require("react"));
|
|
11
|
+
var ProjectsGlyph = function ProjectsGlyph(props) {
|
|
12
|
+
return /*#__PURE__*/_react.default.createElement("svg", {
|
|
13
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
14
|
+
width: "16",
|
|
15
|
+
height: "16",
|
|
16
|
+
viewBox: "0 0 16 16",
|
|
17
|
+
fill: "none"
|
|
18
|
+
}, /*#__PURE__*/_react.default.createElement("path", {
|
|
19
|
+
fillRule: "evenodd",
|
|
20
|
+
clipRule: "evenodd",
|
|
21
|
+
d: "M9.88573 4.00002C9.70892 4.00002 9.53935 4.07026 9.41433 4.19528L6.97282 6.63678L4.20525 6.94429C4.05479 6.96101 3.91451 7.02844 3.80746 7.13548L3.60959 7.33335L4.35367 8.07743C4.6791 8.40287 4.6791 8.93051 4.35367 9.25594L3.47152 10.1381C3.21117 10.3984 2.78906 10.3984 2.52871 10.1381C2.26836 9.87774 2.26836 9.45563 2.52871 9.19528L3.0573 8.66669L2.43108 8.04046C2.04055 7.64993 2.04055 7.01677 2.43108 6.62625L2.86465 6.19267C3.18578 5.87154 3.60664 5.66927 4.05801 5.61911L6.36073 5.36326L8.47152 3.25247C8.84659 2.8774 9.3553 2.66669 9.88573 2.66669H12.0001C12.7365 2.66669 13.3334 3.26364 13.3334 4.00002V6.1144C13.3334 6.64483 13.1227 7.15354 12.7477 7.52862L10.6369 9.6394L10.381 11.9421C10.3309 12.3935 10.1286 12.8143 9.80746 13.1355L9.37389 13.5691C8.98336 13.9596 8.3502 13.9596 7.95967 13.5691L7.33345 12.9428L6.80485 13.4714C6.5445 13.7318 6.12239 13.7318 5.86204 13.4714C5.60169 13.2111 5.60169 12.789 5.86204 12.5286L6.74419 11.6465C7.06963 11.321 7.59726 11.321 7.9227 11.6465L8.66678 12.3905L8.86466 12.1927C8.9717 12.0856 9.03912 11.9453 9.05584 11.7949L9.36335 9.02731L11.8049 6.58581C11.9299 6.46078 12.0001 6.29121 12.0001 6.1144V4.00002H9.88573ZM5.80486 10.1953C6.06521 10.4556 6.06521 10.8777 5.80486 11.1381L3.80486 13.1381C3.54451 13.3984 3.1224 13.3984 2.86205 13.1381C2.6017 12.8777 2.6017 12.4556 2.86205 12.1953L4.86205 10.1953C5.1224 9.93493 5.54451 9.93493 5.80486 10.1953ZM10.0001 6.66669C10.3683 6.66669 10.6668 6.36821 10.6668 6.00002C10.6668 5.63183 10.3683 5.33335 10.0001 5.33335C9.63193 5.33335 9.33346 5.63183 9.33346 6.00002C9.33346 6.36821 9.63193 6.66669 10.0001 6.66669Z",
|
|
22
|
+
fill: "#0C66E4"
|
|
23
|
+
}));
|
|
24
|
+
};
|
|
25
|
+
var ProjectsIcon = exports.ProjectsIcon = function ProjectsIcon(props) {
|
|
26
|
+
return /*#__PURE__*/_react.default.createElement(_icon.default, (0, _extends2.default)({
|
|
27
|
+
glyph: ProjectsGlyph
|
|
28
|
+
}, props));
|
|
29
|
+
};
|
|
@@ -4,7 +4,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
|
-
exports.sizeToButtonSpacing = exports.openEmbedModalWithFlexibleUiIcon = exports.hasWhiteSpace = exports.getTruncateStyles = exports.getPrimitivesPaddingSpaceBySize = exports.getPrimitivesInlineSpaceBySize = exports.getMaxLines = exports.getMaxLineHeight = exports.getLinkSizeStyles = exports.getLinkLineHeight = exports.getIconWidth = exports.getIconSizeStyles = exports.getFormattedMessageAsString = exports.getFormattedMessage = void 0;
|
|
7
|
+
exports.sizeToButtonSpacing = exports.openEmbedModalWithFlexibleUiIcon = exports.importIcon = exports.hasWhiteSpace = exports.getTruncateStyles = exports.getPrimitivesPaddingSpaceBySize = exports.getPrimitivesInlineSpaceBySize = exports.getMaxLines = exports.getMaxLineHeight = exports.getLinkSizeStyles = exports.getLinkLineHeight = exports.getIconWidth = exports.getIconSizeStyles = exports.getFormattedMessageAsString = exports.getFormattedMessage = void 0;
|
|
8
8
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
9
9
|
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
10
10
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
@@ -15,6 +15,7 @@ var _reactIntlNext = require("react-intl-next");
|
|
|
15
15
|
var _constants = require("../../../constants");
|
|
16
16
|
var _icon = _interopRequireDefault(require("./elements/icon"));
|
|
17
17
|
var _utils = require("../../EmbedModal/utils");
|
|
18
|
+
var _reactLoadable = _interopRequireDefault(require("react-loadable"));
|
|
18
19
|
var _excluded = ["linkIcon"];
|
|
19
20
|
var _sizeToButtonSpacing, _templateObject;
|
|
20
21
|
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; }
|
|
@@ -63,6 +64,18 @@ var getIconWidth = exports.getIconWidth = function getIconWidth(size) {
|
|
|
63
64
|
return '.75rem';
|
|
64
65
|
}
|
|
65
66
|
};
|
|
67
|
+
var importIcon = exports.importIcon = function importIcon(importFn) {
|
|
68
|
+
return (0, _reactLoadable.default)({
|
|
69
|
+
loader: function loader() {
|
|
70
|
+
return importFn().then(function (module) {
|
|
71
|
+
return module.default;
|
|
72
|
+
});
|
|
73
|
+
},
|
|
74
|
+
loading: function loading() {
|
|
75
|
+
return null;
|
|
76
|
+
}
|
|
77
|
+
}); // Because we're using dynamic loading here, TS will not be able to infer the type.
|
|
78
|
+
};
|
|
66
79
|
var getLinkLineHeight = exports.getLinkLineHeight = function getLinkLineHeight(size) {
|
|
67
80
|
switch (size) {
|
|
68
81
|
case _constants.SmartLinkSize.XLarge:
|
|
@@ -17,7 +17,7 @@ var _excluded = ["href", "children", "checkSafety", "onClick", "testId"],
|
|
|
17
17
|
_excluded2 = ["isLinkSafe", "showSafetyWarningModal"];
|
|
18
18
|
var PACKAGE_DATA = {
|
|
19
19
|
packageName: "@atlaskit/smart-card",
|
|
20
|
-
packageVersion: "26.56.
|
|
20
|
+
packageVersion: "26.56.5",
|
|
21
21
|
componentName: 'linkUrl'
|
|
22
22
|
};
|
|
23
23
|
var Link = (0, _click.withLinkClickedEvent)('a');
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { extractLink } from '@atlaskit/link-extractors';
|
|
1
|
+
import { extractLink, extractType } from '@atlaskit/link-extractors';
|
|
2
2
|
import { SmartLinkActionType } from '@atlaskit/linking-types';
|
|
3
3
|
import { getExtensionKey } from '../../../state/helpers';
|
|
4
4
|
import extractServerAction from '../extract-server-action';
|
|
@@ -12,6 +12,8 @@ const extractFollowAction = (response, actionOptions, id) => {
|
|
|
12
12
|
const extensionKey = getExtensionKey(response);
|
|
13
13
|
const data = response === null || response === void 0 ? void 0 : response.data;
|
|
14
14
|
const actions = extractServerAction(data);
|
|
15
|
+
const type = extractType(data);
|
|
16
|
+
const isProject = type === null || type === void 0 ? void 0 : type.includes('atlassian:Project');
|
|
15
17
|
if (!extensionKey || actions.length === 0) {
|
|
16
18
|
return;
|
|
17
19
|
}
|
|
@@ -41,7 +43,8 @@ const extractFollowAction = (response, actionOptions, id) => {
|
|
|
41
43
|
providerKey: extensionKey,
|
|
42
44
|
reload
|
|
43
45
|
},
|
|
44
|
-
value: actionType === SmartLinkActionType.FollowEntityAction
|
|
46
|
+
value: actionType === SmartLinkActionType.FollowEntityAction,
|
|
47
|
+
isProject
|
|
45
48
|
};
|
|
46
49
|
};
|
|
47
50
|
export default extractFollowAction;
|
|
@@ -3,7 +3,8 @@ import { extractDownloadAction } from './extract-download-action';
|
|
|
3
3
|
import { extractPreviewAction } from './extract-preview-action';
|
|
4
4
|
import extractFollowAction from './extract-follow-action';
|
|
5
5
|
import { extractCopyLinkAction } from './extract-copy-link-action';
|
|
6
|
-
const extractActions = (response,
|
|
6
|
+
const extractActions = (response, actionOptions, id) => {
|
|
7
|
+
const data = response.data;
|
|
7
8
|
const action = {
|
|
8
9
|
[ActionName.CopyLinkAction]: extractCopyLinkAction(data, actionOptions),
|
|
9
10
|
[ActionName.DownloadAction]: extractDownloadAction(data, actionOptions),
|
|
@@ -22,7 +22,7 @@ const extractFlexibleUiContext = ({
|
|
|
22
22
|
const data = response.data;
|
|
23
23
|
const url = extractLink(data);
|
|
24
24
|
return {
|
|
25
|
-
actions: extractActions(response,
|
|
25
|
+
actions: extractActions(response, actionOptions, id),
|
|
26
26
|
assignedToGroup: extractPersonAssignedToAsArray(data),
|
|
27
27
|
attachmentCount: extractAttachmentCount(data),
|
|
28
28
|
authorGroup: extractPersonCreatedBy(data),
|
package/dist/es2019/messages.js
CHANGED
|
@@ -205,6 +205,26 @@ export const messages = defineMessages({
|
|
|
205
205
|
defaultMessage: 'Follow',
|
|
206
206
|
description: 'Click to follow a project.'
|
|
207
207
|
},
|
|
208
|
+
follow_project_description: {
|
|
209
|
+
id: 'fabric.linking.follow_project_description.nonfinal',
|
|
210
|
+
defaultMessage: 'Follow to get notifications on this project',
|
|
211
|
+
description: 'Description on what Follow does'
|
|
212
|
+
},
|
|
213
|
+
follow_project: {
|
|
214
|
+
id: 'fabric.linking.follow_project.nonfinal',
|
|
215
|
+
defaultMessage: 'Follow project',
|
|
216
|
+
description: 'Click to follow a project.'
|
|
217
|
+
},
|
|
218
|
+
follow_goal_description: {
|
|
219
|
+
id: 'fabric.linking.follow_goal_description.nonfinal',
|
|
220
|
+
defaultMessage: 'Follow this goal to get notifications on updates',
|
|
221
|
+
description: 'Description on what Follow does'
|
|
222
|
+
},
|
|
223
|
+
follow_goal: {
|
|
224
|
+
id: 'fabric.linking.follow_goal.nonfinal',
|
|
225
|
+
defaultMessage: 'Follow goal',
|
|
226
|
+
description: 'Click to follow a project.'
|
|
227
|
+
},
|
|
208
228
|
go_back: {
|
|
209
229
|
id: 'fabric.linking.go_back',
|
|
210
230
|
defaultMessage: 'Go back',
|
|
@@ -465,6 +485,26 @@ export const messages = defineMessages({
|
|
|
465
485
|
defaultMessage: 'Unfollow',
|
|
466
486
|
description: 'Click to unfollow a project.'
|
|
467
487
|
},
|
|
488
|
+
unfollow_project_description: {
|
|
489
|
+
id: 'fabric.linking.unfollow_project_description.nonfinal',
|
|
490
|
+
defaultMessage: 'Unfollow to stop receiving project notifications',
|
|
491
|
+
description: 'Description on what Unfollow does'
|
|
492
|
+
},
|
|
493
|
+
unfollow_project: {
|
|
494
|
+
id: 'fabric.linking.unfollow_project.nonfinal',
|
|
495
|
+
defaultMessage: 'Unfollow project',
|
|
496
|
+
description: 'Click to unfollow a project.'
|
|
497
|
+
},
|
|
498
|
+
unfollow_goal_description: {
|
|
499
|
+
id: 'fabric.linking.unfollow_goal_description.nonfinal',
|
|
500
|
+
defaultMessage: 'Unfollow to stop receiving notifications for this goal',
|
|
501
|
+
description: 'Description on what Unfollow does'
|
|
502
|
+
},
|
|
503
|
+
unfollow_goal: {
|
|
504
|
+
id: 'fabric.linking.unfollow_goal.nonfinal',
|
|
505
|
+
defaultMessage: 'Unfollow goal',
|
|
506
|
+
description: 'Click to unfollow a project.'
|
|
507
|
+
},
|
|
468
508
|
unlink_account: {
|
|
469
509
|
id: 'fabric.linking.unlink_account',
|
|
470
510
|
defaultMessage: 'Unlink Account',
|
|
@@ -4,7 +4,7 @@ export const ANALYTICS_CHANNEL = 'media';
|
|
|
4
4
|
export const context = {
|
|
5
5
|
componentName: 'smart-cards',
|
|
6
6
|
packageName: "@atlaskit/smart-card",
|
|
7
|
-
packageVersion: "26.56.
|
|
7
|
+
packageVersion: "26.56.5"
|
|
8
8
|
};
|
|
9
9
|
export let TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
|
|
10
10
|
TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
+
import Icon from '@atlaskit/icon';
|
|
3
|
+
import React from 'react';
|
|
4
|
+
const GoalGlyph = props => /*#__PURE__*/React.createElement("svg", {
|
|
5
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
6
|
+
width: "16",
|
|
7
|
+
height: "16",
|
|
8
|
+
viewBox: "0 0 16 16",
|
|
9
|
+
fill: "none"
|
|
10
|
+
}, /*#__PURE__*/React.createElement("path", {
|
|
11
|
+
fillRule: "evenodd",
|
|
12
|
+
clipRule: "evenodd",
|
|
13
|
+
d: "M12.6667 8C12.6667 10.5773 10.5773 12.6667 8 12.6667C5.42267 12.6667 3.33333 10.5773 3.33333 8C3.33333 5.42267 5.42267 3.33333 8 3.33333C10.5773 3.33333 12.6667 5.42267 12.6667 8ZM14 8C14 11.3137 11.3137 14 8 14C4.68629 14 2 11.3137 2 8C2 4.68629 4.68629 2 8 2C11.3137 2 14 4.68629 14 8ZM9.33333 8C9.33333 8.73638 8.73638 9.33333 8 9.33333C7.26362 9.33333 6.66667 8.73638 6.66667 8C6.66667 7.26362 7.26362 6.66667 8 6.66667C8.73638 6.66667 9.33333 7.26362 9.33333 8ZM10.6667 8C10.6667 9.47276 9.47276 10.6667 8 10.6667C6.52724 10.6667 5.33333 9.47276 5.33333 8C5.33333 6.52724 6.52724 5.33333 8 5.33333C9.47276 5.33333 10.6667 6.52724 10.6667 8Z",
|
|
14
|
+
fill: "#0C66E4"
|
|
15
|
+
}));
|
|
16
|
+
export const GoalIcon = props => /*#__PURE__*/React.createElement(Icon, _extends({
|
|
17
|
+
glyph: GoalGlyph
|
|
18
|
+
}, props));
|
|
@@ -7,6 +7,26 @@ import { messages } from '../../../../../messages';
|
|
|
7
7
|
import { useFlexibleUiContext } from '../../../../../state/flexible-ui-context';
|
|
8
8
|
import ServerAction from '../action/server-action';
|
|
9
9
|
import UnfollowIcon from './unfollow-icon';
|
|
10
|
+
import { importIcon } from '../../utils';
|
|
11
|
+
const importIconMapper = {
|
|
12
|
+
goal: () => import( /* webpackChunkName: "glyphGoal" */'./goal-icon').then(({
|
|
13
|
+
GoalIcon
|
|
14
|
+
}) => ({
|
|
15
|
+
default: GoalIcon
|
|
16
|
+
})),
|
|
17
|
+
projects: () => import( /* webpackChunkName: "glyphProjects" */'./projects-icon').then(({
|
|
18
|
+
ProjectsIcon
|
|
19
|
+
}) => ({
|
|
20
|
+
default: ProjectsIcon
|
|
21
|
+
}))
|
|
22
|
+
};
|
|
23
|
+
const getIcon = stackIconType => {
|
|
24
|
+
const importFn = importIconMapper[stackIconType];
|
|
25
|
+
if (!importFn) {
|
|
26
|
+
return null;
|
|
27
|
+
}
|
|
28
|
+
return importIcon(importFn);
|
|
29
|
+
};
|
|
10
30
|
const FollowAction = props => {
|
|
11
31
|
var _context$actions, _context$actions2;
|
|
12
32
|
const context = useFlexibleUiContext();
|
|
@@ -17,17 +37,34 @@ const FollowAction = props => {
|
|
|
17
37
|
value,
|
|
18
38
|
...data
|
|
19
39
|
} = context === null || context === void 0 ? void 0 : (_context$actions2 = context.actions) === null || _context$actions2 === void 0 ? void 0 : _context$actions2[ActionName.FollowAction];
|
|
40
|
+
const isStackItem = props.as === 'stack-item';
|
|
41
|
+
const isProject = data.isProject;
|
|
20
42
|
const message = value ? messages.follow : messages.unfollow;
|
|
43
|
+
const projectMessage = value ? messages.follow_project : messages.unfollow_project;
|
|
44
|
+
const goalMessage = value ? messages.follow_goal : messages.unfollow_goal;
|
|
45
|
+
const stackMessage = isProject ? projectMessage : goalMessage;
|
|
46
|
+
const label = isStackItem ? stackMessage : message;
|
|
47
|
+
const projectTooltipMessage = value ? messages.follow_project_description : messages.unfollow_project_description;
|
|
48
|
+
const goalTooltipMessage = value ? messages.follow_goal_description : messages.unfollow_goal_description;
|
|
49
|
+
const stackTooltipMessage = isProject ? projectTooltipMessage : goalTooltipMessage;
|
|
50
|
+
const tooltipMessage = isStackItem ? stackTooltipMessage : message;
|
|
21
51
|
const icon = value ? /*#__PURE__*/React.createElement(InviteTeamIcon, {
|
|
22
52
|
label: "Follow"
|
|
23
53
|
}) : /*#__PURE__*/React.createElement(UnfollowIcon, {
|
|
24
54
|
label: "Unfollow"
|
|
25
55
|
});
|
|
56
|
+
const stackIconType = isProject ? 'projects' : 'goal';
|
|
57
|
+
const ImportedIcon = getIcon(stackIconType);
|
|
58
|
+
const stackIcon = /*#__PURE__*/React.createElement(ImportedIcon, {
|
|
59
|
+
label: "Follow",
|
|
60
|
+
testId: `smart-action-follow-action-${stackIconType}-icon`
|
|
61
|
+
});
|
|
62
|
+
const followIcon = isStackItem ? stackIcon : icon;
|
|
26
63
|
return /*#__PURE__*/React.createElement(ServerAction, _extends({
|
|
27
|
-
content: /*#__PURE__*/React.createElement(FormattedMessage,
|
|
28
|
-
icon:
|
|
64
|
+
content: /*#__PURE__*/React.createElement(FormattedMessage, label),
|
|
65
|
+
icon: followIcon,
|
|
29
66
|
testId: "smart-action-follow-action",
|
|
30
|
-
tooltipMessage: /*#__PURE__*/React.createElement(FormattedMessage,
|
|
67
|
+
tooltipMessage: /*#__PURE__*/React.createElement(FormattedMessage, tooltipMessage)
|
|
31
68
|
}, data, props));
|
|
32
69
|
};
|
|
33
70
|
export default FollowAction;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
+
import Icon from '@atlaskit/icon';
|
|
3
|
+
import React from 'react';
|
|
4
|
+
const ProjectsGlyph = props => /*#__PURE__*/React.createElement("svg", {
|
|
5
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
6
|
+
width: "16",
|
|
7
|
+
height: "16",
|
|
8
|
+
viewBox: "0 0 16 16",
|
|
9
|
+
fill: "none"
|
|
10
|
+
}, /*#__PURE__*/React.createElement("path", {
|
|
11
|
+
fillRule: "evenodd",
|
|
12
|
+
clipRule: "evenodd",
|
|
13
|
+
d: "M9.88573 4.00002C9.70892 4.00002 9.53935 4.07026 9.41433 4.19528L6.97282 6.63678L4.20525 6.94429C4.05479 6.96101 3.91451 7.02844 3.80746 7.13548L3.60959 7.33335L4.35367 8.07743C4.6791 8.40287 4.6791 8.93051 4.35367 9.25594L3.47152 10.1381C3.21117 10.3984 2.78906 10.3984 2.52871 10.1381C2.26836 9.87774 2.26836 9.45563 2.52871 9.19528L3.0573 8.66669L2.43108 8.04046C2.04055 7.64993 2.04055 7.01677 2.43108 6.62625L2.86465 6.19267C3.18578 5.87154 3.60664 5.66927 4.05801 5.61911L6.36073 5.36326L8.47152 3.25247C8.84659 2.8774 9.3553 2.66669 9.88573 2.66669H12.0001C12.7365 2.66669 13.3334 3.26364 13.3334 4.00002V6.1144C13.3334 6.64483 13.1227 7.15354 12.7477 7.52862L10.6369 9.6394L10.381 11.9421C10.3309 12.3935 10.1286 12.8143 9.80746 13.1355L9.37389 13.5691C8.98336 13.9596 8.3502 13.9596 7.95967 13.5691L7.33345 12.9428L6.80485 13.4714C6.5445 13.7318 6.12239 13.7318 5.86204 13.4714C5.60169 13.2111 5.60169 12.789 5.86204 12.5286L6.74419 11.6465C7.06963 11.321 7.59726 11.321 7.9227 11.6465L8.66678 12.3905L8.86466 12.1927C8.9717 12.0856 9.03912 11.9453 9.05584 11.7949L9.36335 9.02731L11.8049 6.58581C11.9299 6.46078 12.0001 6.29121 12.0001 6.1144V4.00002H9.88573ZM5.80486 10.1953C6.06521 10.4556 6.06521 10.8777 5.80486 11.1381L3.80486 13.1381C3.54451 13.3984 3.1224 13.3984 2.86205 13.1381C2.6017 12.8777 2.6017 12.4556 2.86205 12.1953L4.86205 10.1953C5.1224 9.93493 5.54451 9.93493 5.80486 10.1953ZM10.0001 6.66669C10.3683 6.66669 10.6668 6.36821 10.6668 6.00002C10.6668 5.63183 10.3683 5.33335 10.0001 5.33335C9.63193 5.33335 9.33346 5.63183 9.33346 6.00002C9.33346 6.36821 9.63193 6.66669 10.0001 6.66669Z",
|
|
14
|
+
fill: "#0C66E4"
|
|
15
|
+
}));
|
|
16
|
+
export const ProjectsIcon = props => /*#__PURE__*/React.createElement(Icon, _extends({
|
|
17
|
+
glyph: ProjectsGlyph
|
|
18
|
+
}, props));
|
|
@@ -5,6 +5,7 @@ import { FormattedMessage } from 'react-intl-next';
|
|
|
5
5
|
import { SmartLinkSize } from '../../../constants';
|
|
6
6
|
import Icon from './elements/icon';
|
|
7
7
|
import { openEmbedModal } from '../../EmbedModal/utils';
|
|
8
|
+
import Loadable from 'react-loadable';
|
|
8
9
|
export const sizeToButtonSpacing = {
|
|
9
10
|
[SmartLinkSize.Small]: 'none',
|
|
10
11
|
[SmartLinkSize.Medium]: 'compact',
|
|
@@ -67,6 +68,12 @@ export const getIconWidth = size => {
|
|
|
67
68
|
return '.75rem';
|
|
68
69
|
}
|
|
69
70
|
};
|
|
71
|
+
export const importIcon = importFn => {
|
|
72
|
+
return Loadable({
|
|
73
|
+
loader: () => importFn().then(module => module.default),
|
|
74
|
+
loading: () => null
|
|
75
|
+
}); // Because we're using dynamic loading here, TS will not be able to infer the type.
|
|
76
|
+
};
|
|
70
77
|
export const getLinkLineHeight = size => {
|
|
71
78
|
switch (size) {
|
|
72
79
|
case SmartLinkSize.XLarge:
|
|
@@ -7,7 +7,7 @@ import { useLinkWarningModal } from './LinkWarningModal/hooks/use-link-warning-m
|
|
|
7
7
|
import LinkWarningModal from './LinkWarningModal';
|
|
8
8
|
const PACKAGE_DATA = {
|
|
9
9
|
packageName: "@atlaskit/smart-card",
|
|
10
|
-
packageVersion: "26.56.
|
|
10
|
+
packageVersion: "26.56.5",
|
|
11
11
|
componentName: 'linkUrl'
|
|
12
12
|
};
|
|
13
13
|
const Link = withLinkClickedEvent('a');
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { extractLink } from '@atlaskit/link-extractors';
|
|
1
|
+
import { extractLink, extractType } from '@atlaskit/link-extractors';
|
|
2
2
|
import { SmartLinkActionType } from '@atlaskit/linking-types';
|
|
3
3
|
import { getExtensionKey } from '../../../state/helpers';
|
|
4
4
|
import extractServerAction from '../extract-server-action';
|
|
@@ -12,6 +12,8 @@ var extractFollowAction = function extractFollowAction(response, actionOptions,
|
|
|
12
12
|
var extensionKey = getExtensionKey(response);
|
|
13
13
|
var data = response === null || response === void 0 ? void 0 : response.data;
|
|
14
14
|
var actions = extractServerAction(data);
|
|
15
|
+
var type = extractType(data);
|
|
16
|
+
var isProject = type === null || type === void 0 ? void 0 : type.includes('atlassian:Project');
|
|
15
17
|
if (!extensionKey || actions.length === 0) {
|
|
16
18
|
return;
|
|
17
19
|
}
|
|
@@ -41,7 +43,8 @@ var extractFollowAction = function extractFollowAction(response, actionOptions,
|
|
|
41
43
|
providerKey: extensionKey,
|
|
42
44
|
reload: reload
|
|
43
45
|
},
|
|
44
|
-
value: actionType === SmartLinkActionType.FollowEntityAction
|
|
46
|
+
value: actionType === SmartLinkActionType.FollowEntityAction,
|
|
47
|
+
isProject: isProject
|
|
45
48
|
};
|
|
46
49
|
};
|
|
47
50
|
export default extractFollowAction;
|
|
@@ -4,8 +4,9 @@ import { extractDownloadAction } from './extract-download-action';
|
|
|
4
4
|
import { extractPreviewAction } from './extract-preview-action';
|
|
5
5
|
import extractFollowAction from './extract-follow-action';
|
|
6
6
|
import { extractCopyLinkAction } from './extract-copy-link-action';
|
|
7
|
-
var extractActions = function extractActions(response,
|
|
7
|
+
var extractActions = function extractActions(response, actionOptions, id) {
|
|
8
8
|
var _action;
|
|
9
|
+
var data = response.data;
|
|
9
10
|
var action = (_action = {}, _defineProperty(_action, ActionName.CopyLinkAction, extractCopyLinkAction(data, actionOptions)), _defineProperty(_action, ActionName.DownloadAction, extractDownloadAction(data, actionOptions)), _defineProperty(_action, ActionName.FollowAction, extractFollowAction(response, actionOptions, id)), _defineProperty(_action, ActionName.PreviewAction, extractPreviewAction(response, actionOptions)), _action);
|
|
10
11
|
return Object.values(action).some(function (value) {
|
|
11
12
|
return Boolean(value);
|
|
@@ -22,7 +22,7 @@ var extractFlexibleUiContext = function extractFlexibleUiContext() {
|
|
|
22
22
|
var data = response.data;
|
|
23
23
|
var url = extractLink(data);
|
|
24
24
|
return {
|
|
25
|
-
actions: extractActions(response,
|
|
25
|
+
actions: extractActions(response, actionOptions, id),
|
|
26
26
|
assignedToGroup: extractPersonAssignedToAsArray(data),
|
|
27
27
|
attachmentCount: extractAttachmentCount(data),
|
|
28
28
|
authorGroup: extractPersonCreatedBy(data),
|
package/dist/esm/messages.js
CHANGED
|
@@ -205,6 +205,26 @@ export var messages = defineMessages({
|
|
|
205
205
|
defaultMessage: 'Follow',
|
|
206
206
|
description: 'Click to follow a project.'
|
|
207
207
|
},
|
|
208
|
+
follow_project_description: {
|
|
209
|
+
id: 'fabric.linking.follow_project_description.nonfinal',
|
|
210
|
+
defaultMessage: 'Follow to get notifications on this project',
|
|
211
|
+
description: 'Description on what Follow does'
|
|
212
|
+
},
|
|
213
|
+
follow_project: {
|
|
214
|
+
id: 'fabric.linking.follow_project.nonfinal',
|
|
215
|
+
defaultMessage: 'Follow project',
|
|
216
|
+
description: 'Click to follow a project.'
|
|
217
|
+
},
|
|
218
|
+
follow_goal_description: {
|
|
219
|
+
id: 'fabric.linking.follow_goal_description.nonfinal',
|
|
220
|
+
defaultMessage: 'Follow this goal to get notifications on updates',
|
|
221
|
+
description: 'Description on what Follow does'
|
|
222
|
+
},
|
|
223
|
+
follow_goal: {
|
|
224
|
+
id: 'fabric.linking.follow_goal.nonfinal',
|
|
225
|
+
defaultMessage: 'Follow goal',
|
|
226
|
+
description: 'Click to follow a project.'
|
|
227
|
+
},
|
|
208
228
|
go_back: {
|
|
209
229
|
id: 'fabric.linking.go_back',
|
|
210
230
|
defaultMessage: 'Go back',
|
|
@@ -465,6 +485,26 @@ export var messages = defineMessages({
|
|
|
465
485
|
defaultMessage: 'Unfollow',
|
|
466
486
|
description: 'Click to unfollow a project.'
|
|
467
487
|
},
|
|
488
|
+
unfollow_project_description: {
|
|
489
|
+
id: 'fabric.linking.unfollow_project_description.nonfinal',
|
|
490
|
+
defaultMessage: 'Unfollow to stop receiving project notifications',
|
|
491
|
+
description: 'Description on what Unfollow does'
|
|
492
|
+
},
|
|
493
|
+
unfollow_project: {
|
|
494
|
+
id: 'fabric.linking.unfollow_project.nonfinal',
|
|
495
|
+
defaultMessage: 'Unfollow project',
|
|
496
|
+
description: 'Click to unfollow a project.'
|
|
497
|
+
},
|
|
498
|
+
unfollow_goal_description: {
|
|
499
|
+
id: 'fabric.linking.unfollow_goal_description.nonfinal',
|
|
500
|
+
defaultMessage: 'Unfollow to stop receiving notifications for this goal',
|
|
501
|
+
description: 'Description on what Unfollow does'
|
|
502
|
+
},
|
|
503
|
+
unfollow_goal: {
|
|
504
|
+
id: 'fabric.linking.unfollow_goal.nonfinal',
|
|
505
|
+
defaultMessage: 'Unfollow goal',
|
|
506
|
+
description: 'Click to unfollow a project.'
|
|
507
|
+
},
|
|
468
508
|
unlink_account: {
|
|
469
509
|
id: 'fabric.linking.unlink_account',
|
|
470
510
|
defaultMessage: 'Unlink Account',
|
|
@@ -15,7 +15,7 @@ export var ANALYTICS_CHANNEL = 'media';
|
|
|
15
15
|
export var context = {
|
|
16
16
|
componentName: 'smart-cards',
|
|
17
17
|
packageName: "@atlaskit/smart-card",
|
|
18
|
-
packageVersion: "26.56.
|
|
18
|
+
packageVersion: "26.56.5"
|
|
19
19
|
};
|
|
20
20
|
export var TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
|
|
21
21
|
TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
+
import Icon from '@atlaskit/icon';
|
|
3
|
+
import React from 'react';
|
|
4
|
+
var GoalGlyph = function GoalGlyph(props) {
|
|
5
|
+
return /*#__PURE__*/React.createElement("svg", {
|
|
6
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
7
|
+
width: "16",
|
|
8
|
+
height: "16",
|
|
9
|
+
viewBox: "0 0 16 16",
|
|
10
|
+
fill: "none"
|
|
11
|
+
}, /*#__PURE__*/React.createElement("path", {
|
|
12
|
+
fillRule: "evenodd",
|
|
13
|
+
clipRule: "evenodd",
|
|
14
|
+
d: "M12.6667 8C12.6667 10.5773 10.5773 12.6667 8 12.6667C5.42267 12.6667 3.33333 10.5773 3.33333 8C3.33333 5.42267 5.42267 3.33333 8 3.33333C10.5773 3.33333 12.6667 5.42267 12.6667 8ZM14 8C14 11.3137 11.3137 14 8 14C4.68629 14 2 11.3137 2 8C2 4.68629 4.68629 2 8 2C11.3137 2 14 4.68629 14 8ZM9.33333 8C9.33333 8.73638 8.73638 9.33333 8 9.33333C7.26362 9.33333 6.66667 8.73638 6.66667 8C6.66667 7.26362 7.26362 6.66667 8 6.66667C8.73638 6.66667 9.33333 7.26362 9.33333 8ZM10.6667 8C10.6667 9.47276 9.47276 10.6667 8 10.6667C6.52724 10.6667 5.33333 9.47276 5.33333 8C5.33333 6.52724 6.52724 5.33333 8 5.33333C9.47276 5.33333 10.6667 6.52724 10.6667 8Z",
|
|
15
|
+
fill: "#0C66E4"
|
|
16
|
+
}));
|
|
17
|
+
};
|
|
18
|
+
export var GoalIcon = function GoalIcon(props) {
|
|
19
|
+
return /*#__PURE__*/React.createElement(Icon, _extends({
|
|
20
|
+
glyph: GoalGlyph
|
|
21
|
+
}, props));
|
|
22
|
+
};
|
|
@@ -9,6 +9,32 @@ import { messages } from '../../../../../messages';
|
|
|
9
9
|
import { useFlexibleUiContext } from '../../../../../state/flexible-ui-context';
|
|
10
10
|
import ServerAction from '../action/server-action';
|
|
11
11
|
import UnfollowIcon from './unfollow-icon';
|
|
12
|
+
import { importIcon } from '../../utils';
|
|
13
|
+
var importIconMapper = {
|
|
14
|
+
goal: function goal() {
|
|
15
|
+
return import( /* webpackChunkName: "glyphGoal" */'./goal-icon').then(function (_ref) {
|
|
16
|
+
var GoalIcon = _ref.GoalIcon;
|
|
17
|
+
return {
|
|
18
|
+
default: GoalIcon
|
|
19
|
+
};
|
|
20
|
+
});
|
|
21
|
+
},
|
|
22
|
+
projects: function projects() {
|
|
23
|
+
return import( /* webpackChunkName: "glyphProjects" */'./projects-icon').then(function (_ref2) {
|
|
24
|
+
var ProjectsIcon = _ref2.ProjectsIcon;
|
|
25
|
+
return {
|
|
26
|
+
default: ProjectsIcon
|
|
27
|
+
};
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
var getIcon = function getIcon(stackIconType) {
|
|
32
|
+
var importFn = importIconMapper[stackIconType];
|
|
33
|
+
if (!importFn) {
|
|
34
|
+
return null;
|
|
35
|
+
}
|
|
36
|
+
return importIcon(importFn);
|
|
37
|
+
};
|
|
12
38
|
var FollowAction = function FollowAction(props) {
|
|
13
39
|
var _context$actions, _context$actions2;
|
|
14
40
|
var context = useFlexibleUiContext();
|
|
@@ -18,17 +44,34 @@ var FollowAction = function FollowAction(props) {
|
|
|
18
44
|
var _context$actions$Acti = context === null || context === void 0 || (_context$actions2 = context.actions) === null || _context$actions2 === void 0 ? void 0 : _context$actions2[ActionName.FollowAction],
|
|
19
45
|
value = _context$actions$Acti.value,
|
|
20
46
|
data = _objectWithoutProperties(_context$actions$Acti, _excluded);
|
|
47
|
+
var isStackItem = props.as === 'stack-item';
|
|
48
|
+
var isProject = data.isProject;
|
|
21
49
|
var message = value ? messages.follow : messages.unfollow;
|
|
50
|
+
var projectMessage = value ? messages.follow_project : messages.unfollow_project;
|
|
51
|
+
var goalMessage = value ? messages.follow_goal : messages.unfollow_goal;
|
|
52
|
+
var stackMessage = isProject ? projectMessage : goalMessage;
|
|
53
|
+
var label = isStackItem ? stackMessage : message;
|
|
54
|
+
var projectTooltipMessage = value ? messages.follow_project_description : messages.unfollow_project_description;
|
|
55
|
+
var goalTooltipMessage = value ? messages.follow_goal_description : messages.unfollow_goal_description;
|
|
56
|
+
var stackTooltipMessage = isProject ? projectTooltipMessage : goalTooltipMessage;
|
|
57
|
+
var tooltipMessage = isStackItem ? stackTooltipMessage : message;
|
|
22
58
|
var icon = value ? /*#__PURE__*/React.createElement(InviteTeamIcon, {
|
|
23
59
|
label: "Follow"
|
|
24
60
|
}) : /*#__PURE__*/React.createElement(UnfollowIcon, {
|
|
25
61
|
label: "Unfollow"
|
|
26
62
|
});
|
|
63
|
+
var stackIconType = isProject ? 'projects' : 'goal';
|
|
64
|
+
var ImportedIcon = getIcon(stackIconType);
|
|
65
|
+
var stackIcon = /*#__PURE__*/React.createElement(ImportedIcon, {
|
|
66
|
+
label: "Follow",
|
|
67
|
+
testId: "smart-action-follow-action-".concat(stackIconType, "-icon")
|
|
68
|
+
});
|
|
69
|
+
var followIcon = isStackItem ? stackIcon : icon;
|
|
27
70
|
return /*#__PURE__*/React.createElement(ServerAction, _extends({
|
|
28
|
-
content: /*#__PURE__*/React.createElement(FormattedMessage,
|
|
29
|
-
icon:
|
|
71
|
+
content: /*#__PURE__*/React.createElement(FormattedMessage, label),
|
|
72
|
+
icon: followIcon,
|
|
30
73
|
testId: "smart-action-follow-action",
|
|
31
|
-
tooltipMessage: /*#__PURE__*/React.createElement(FormattedMessage,
|
|
74
|
+
tooltipMessage: /*#__PURE__*/React.createElement(FormattedMessage, tooltipMessage)
|
|
32
75
|
}, data, props));
|
|
33
76
|
};
|
|
34
77
|
export default FollowAction;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
+
import Icon from '@atlaskit/icon';
|
|
3
|
+
import React from 'react';
|
|
4
|
+
var ProjectsGlyph = function ProjectsGlyph(props) {
|
|
5
|
+
return /*#__PURE__*/React.createElement("svg", {
|
|
6
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
7
|
+
width: "16",
|
|
8
|
+
height: "16",
|
|
9
|
+
viewBox: "0 0 16 16",
|
|
10
|
+
fill: "none"
|
|
11
|
+
}, /*#__PURE__*/React.createElement("path", {
|
|
12
|
+
fillRule: "evenodd",
|
|
13
|
+
clipRule: "evenodd",
|
|
14
|
+
d: "M9.88573 4.00002C9.70892 4.00002 9.53935 4.07026 9.41433 4.19528L6.97282 6.63678L4.20525 6.94429C4.05479 6.96101 3.91451 7.02844 3.80746 7.13548L3.60959 7.33335L4.35367 8.07743C4.6791 8.40287 4.6791 8.93051 4.35367 9.25594L3.47152 10.1381C3.21117 10.3984 2.78906 10.3984 2.52871 10.1381C2.26836 9.87774 2.26836 9.45563 2.52871 9.19528L3.0573 8.66669L2.43108 8.04046C2.04055 7.64993 2.04055 7.01677 2.43108 6.62625L2.86465 6.19267C3.18578 5.87154 3.60664 5.66927 4.05801 5.61911L6.36073 5.36326L8.47152 3.25247C8.84659 2.8774 9.3553 2.66669 9.88573 2.66669H12.0001C12.7365 2.66669 13.3334 3.26364 13.3334 4.00002V6.1144C13.3334 6.64483 13.1227 7.15354 12.7477 7.52862L10.6369 9.6394L10.381 11.9421C10.3309 12.3935 10.1286 12.8143 9.80746 13.1355L9.37389 13.5691C8.98336 13.9596 8.3502 13.9596 7.95967 13.5691L7.33345 12.9428L6.80485 13.4714C6.5445 13.7318 6.12239 13.7318 5.86204 13.4714C5.60169 13.2111 5.60169 12.789 5.86204 12.5286L6.74419 11.6465C7.06963 11.321 7.59726 11.321 7.9227 11.6465L8.66678 12.3905L8.86466 12.1927C8.9717 12.0856 9.03912 11.9453 9.05584 11.7949L9.36335 9.02731L11.8049 6.58581C11.9299 6.46078 12.0001 6.29121 12.0001 6.1144V4.00002H9.88573ZM5.80486 10.1953C6.06521 10.4556 6.06521 10.8777 5.80486 11.1381L3.80486 13.1381C3.54451 13.3984 3.1224 13.3984 2.86205 13.1381C2.6017 12.8777 2.6017 12.4556 2.86205 12.1953L4.86205 10.1953C5.1224 9.93493 5.54451 9.93493 5.80486 10.1953ZM10.0001 6.66669C10.3683 6.66669 10.6668 6.36821 10.6668 6.00002C10.6668 5.63183 10.3683 5.33335 10.0001 5.33335C9.63193 5.33335 9.33346 5.63183 9.33346 6.00002C9.33346 6.36821 9.63193 6.66669 10.0001 6.66669Z",
|
|
15
|
+
fill: "#0C66E4"
|
|
16
|
+
}));
|
|
17
|
+
};
|
|
18
|
+
export var ProjectsIcon = function ProjectsIcon(props) {
|
|
19
|
+
return /*#__PURE__*/React.createElement(Icon, _extends({
|
|
20
|
+
glyph: ProjectsGlyph
|
|
21
|
+
}, props));
|
|
22
|
+
};
|
|
@@ -12,6 +12,7 @@ import { FormattedMessage } from 'react-intl-next';
|
|
|
12
12
|
import { SmartLinkSize } from '../../../constants';
|
|
13
13
|
import Icon from './elements/icon';
|
|
14
14
|
import { openEmbedModal } from '../../EmbedModal/utils';
|
|
15
|
+
import Loadable from 'react-loadable';
|
|
15
16
|
export var sizeToButtonSpacing = (_sizeToButtonSpacing = {}, _defineProperty(_sizeToButtonSpacing, SmartLinkSize.Small, 'none'), _defineProperty(_sizeToButtonSpacing, SmartLinkSize.Medium, 'compact'), _defineProperty(_sizeToButtonSpacing, SmartLinkSize.Large, 'compact'), _defineProperty(_sizeToButtonSpacing, SmartLinkSize.XLarge, 'default'), _sizeToButtonSpacing);
|
|
16
17
|
export var getFormattedMessage = function getFormattedMessage(message) {
|
|
17
18
|
if (message) {
|
|
@@ -56,6 +57,18 @@ export var getIconWidth = function getIconWidth(size) {
|
|
|
56
57
|
return '.75rem';
|
|
57
58
|
}
|
|
58
59
|
};
|
|
60
|
+
export var importIcon = function importIcon(importFn) {
|
|
61
|
+
return Loadable({
|
|
62
|
+
loader: function loader() {
|
|
63
|
+
return importFn().then(function (module) {
|
|
64
|
+
return module.default;
|
|
65
|
+
});
|
|
66
|
+
},
|
|
67
|
+
loading: function loading() {
|
|
68
|
+
return null;
|
|
69
|
+
}
|
|
70
|
+
}); // Because we're using dynamic loading here, TS will not be able to infer the type.
|
|
71
|
+
};
|
|
59
72
|
export var getLinkLineHeight = function getLinkLineHeight(size) {
|
|
60
73
|
switch (size) {
|
|
61
74
|
case SmartLinkSize.XLarge:
|
|
@@ -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.56.
|
|
13
|
+
packageVersion: "26.56.5",
|
|
14
14
|
componentName: 'linkUrl'
|
|
15
15
|
};
|
|
16
16
|
var Link = withLinkClickedEvent('a');
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { JsonLd } from 'json-ld-types';
|
|
2
2
|
import type { FlexibleUiActions } from '../../../state/flexible-ui-context/types';
|
|
3
3
|
import type { CardActionOptions } from '../../../view/Card/types';
|
|
4
|
-
declare const extractActions: (response: JsonLd.Response,
|
|
4
|
+
declare const extractActions: (response: JsonLd.Response, actionOptions?: CardActionOptions, id?: string) => FlexibleUiActions | undefined;
|
|
5
5
|
export default extractActions;
|
package/dist/types/messages.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { MessageDescriptor } from 'react-intl-next';
|
|
2
2
|
export type RequestAccessMessageKey = 'click_to_join' | 'click_to_join_description' | 'forbidden_description' | 'request_access' | 'request_access_description' | 'request_access_pending' | 'request_access_pending_title' | 'request_access_pending_description' | 'request_denied_description' | 'default_no_access_title' | 'direct_access_title' | 'direct_access_description' | 'direct_access' | 'access_exists_description' | 'not_found_description' | 'not_found_title';
|
|
3
|
-
export type MessageKey = 'assigned_to' | 'ai_summarize' | 'ai_summarized' | 'ai_summarized_abbreviation' | 'ai_summarized_info' | 'ai_summarizing' | 'ai_summary_error_generic' | 'ai_summary_error_acceptable_use_violation' | 'ai_summary_error_hipaa_content_detected' | 'beta' | 'cannot_find_link' | 'connect_link_account_card' | 'connect_link_account_card_name' | 'connect_link_account_card_description' | 'connect_unauthorised_account_action' | 'connect_unauthorised_account_description' | 'connect_unauthorised_account_description_no_provider' | 'continue' | 'copy_url_to_clipboard' | 'copied_url_to_clipboard' | 'could_not_load_link' | 'download' | 'download_description' | 'download_file' | 'follow' | 'go_back' | 'invalid_permissions' | 'invalid_permissions_description' | 'join_to_view' | 'connect_link_account' | 'created_by' | 'created_on_relative' | 'created_on_absolute' | 'check_this_link' | 'delete' | 'edit' | 'learn_more_about_smart_links' | 'learn_more_about_connecting_account' | 'loading' | 'link_safety_warning_message' | 'modified_by' | 'modified_on_relative' | 'modified_on_absolute' | 'more_actions' | 'not_found_title' | 'not_found_description' | 'open_issue_in_jira' | 'open_link_in_a_new_tab' | 'owned_by' | 'preview_description' | 'preview_improved' | 'preview_close' | 'preview_max_size' | 'preview_min_size' | 'priority_blocker' | 'priority_critical' | 'priority_high' | 'priority_highest' | 'priority_low' | 'priority_lowest' | 'priority_major' | 'priority_medium' | 'priority_minor' | 'priority_trivial' | 'priority_undefined' | 'forbidden_access' | 'pending_request' | 'read_time' | 'restricted_link' | 'request_access_to_view' | 'request_denied' | 'sent_on_relative' | 'sent_on_absolute' | 'status_change_load_error' | 'status_change_permission_error' | 'status_change_update_error' | 'try_again' | 'try_another_account' | 'unauthorised_account_description' | 'unauthorised_account_description_no_provider' | 'unauthorised_account_name' | 'unauthorised_account_name_no_provider' | 'unassigned' | 'unfollow' | 'view' | 'viewIn' | 'viewOriginal' | 'actions' | 'add_account' | 'cancel' | 'close' | 'connect_to' | 'connect_account_description' | 'retry' | 'save' | 'unlink_account' | RequestAccessMessageKey | 'related_work_items_not_found' | 'last_mentioned_in' | 'related' | 'generic_error_message';
|
|
3
|
+
export type MessageKey = 'assigned_to' | 'ai_summarize' | 'ai_summarized' | 'ai_summarized_abbreviation' | 'ai_summarized_info' | 'ai_summarizing' | 'ai_summary_error_generic' | 'ai_summary_error_acceptable_use_violation' | 'ai_summary_error_hipaa_content_detected' | 'beta' | 'cannot_find_link' | 'connect_link_account_card' | 'connect_link_account_card_name' | 'connect_link_account_card_description' | 'connect_unauthorised_account_action' | 'connect_unauthorised_account_description' | 'connect_unauthorised_account_description_no_provider' | 'continue' | 'copy_url_to_clipboard' | 'copied_url_to_clipboard' | 'could_not_load_link' | 'download' | 'download_description' | 'download_file' | 'follow' | 'follow_project_description' | 'follow_project' | 'follow_goal' | 'follow_goal_description' | 'go_back' | 'invalid_permissions' | 'invalid_permissions_description' | 'join_to_view' | 'connect_link_account' | 'created_by' | 'created_on_relative' | 'created_on_absolute' | 'check_this_link' | 'delete' | 'edit' | 'learn_more_about_smart_links' | 'learn_more_about_connecting_account' | 'loading' | 'link_safety_warning_message' | 'modified_by' | 'modified_on_relative' | 'modified_on_absolute' | 'more_actions' | 'not_found_title' | 'not_found_description' | 'open_issue_in_jira' | 'open_link_in_a_new_tab' | 'owned_by' | 'preview_description' | 'preview_improved' | 'preview_close' | 'preview_max_size' | 'preview_min_size' | 'priority_blocker' | 'priority_critical' | 'priority_high' | 'priority_highest' | 'priority_low' | 'priority_lowest' | 'priority_major' | 'priority_medium' | 'priority_minor' | 'priority_trivial' | 'priority_undefined' | 'forbidden_access' | 'pending_request' | 'read_time' | 'restricted_link' | 'request_access_to_view' | 'request_denied' | 'sent_on_relative' | 'sent_on_absolute' | 'status_change_load_error' | 'status_change_permission_error' | 'status_change_update_error' | 'try_again' | 'try_another_account' | 'unauthorised_account_description' | 'unauthorised_account_description_no_provider' | 'unauthorised_account_name' | 'unauthorised_account_name_no_provider' | 'unassigned' | 'unfollow' | 'unfollow_project_description' | 'unfollow_project' | 'unfollow_goal' | 'unfollow_goal_description' | 'view' | 'viewIn' | 'viewOriginal' | 'actions' | 'add_account' | 'cancel' | 'close' | 'connect_to' | 'connect_account_description' | 'retry' | 'save' | 'unlink_account' | RequestAccessMessageKey | 'related_work_items_not_found' | 'last_mentioned_in' | 'related' | 'generic_error_message';
|
|
4
4
|
type Messages = {
|
|
5
5
|
[K in MessageKey]: MessageDescriptor;
|
|
6
6
|
};
|
|
@@ -12,6 +12,7 @@ export declare const getFormattedMessage: (message?: MessageProps) => JSX.Elemen
|
|
|
12
12
|
export declare const getFormattedMessageAsString: (intl: IntlShape, message: MessageDescriptor, context?: string) => string;
|
|
13
13
|
export declare const getIconSizeStyles: (width: string) => SerializedStyles;
|
|
14
14
|
export declare const getIconWidth: (size?: SmartLinkSize) => string;
|
|
15
|
+
export declare const importIcon: (importFn: () => Promise<any>) => any;
|
|
15
16
|
export declare const getLinkLineHeight: (size: SmartLinkSize) => string;
|
|
16
17
|
export declare const getLinkSizeStyles: (size: SmartLinkSize) => SerializedStyles;
|
|
17
18
|
export declare const getMaxLineHeight: (size: SmartLinkSize) => 1.5 | 1.75;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { JsonLd } from 'json-ld-types';
|
|
2
2
|
import type { FlexibleUiActions } from '../../../state/flexible-ui-context/types';
|
|
3
3
|
import type { CardActionOptions } from '../../../view/Card/types';
|
|
4
|
-
declare const extractActions: (response: JsonLd.Response,
|
|
4
|
+
declare const extractActions: (response: JsonLd.Response, actionOptions?: CardActionOptions, id?: string) => FlexibleUiActions | undefined;
|
|
5
5
|
export default extractActions;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { MessageDescriptor } from 'react-intl-next';
|
|
2
2
|
export type RequestAccessMessageKey = 'click_to_join' | 'click_to_join_description' | 'forbidden_description' | 'request_access' | 'request_access_description' | 'request_access_pending' | 'request_access_pending_title' | 'request_access_pending_description' | 'request_denied_description' | 'default_no_access_title' | 'direct_access_title' | 'direct_access_description' | 'direct_access' | 'access_exists_description' | 'not_found_description' | 'not_found_title';
|
|
3
|
-
export type MessageKey = 'assigned_to' | 'ai_summarize' | 'ai_summarized' | 'ai_summarized_abbreviation' | 'ai_summarized_info' | 'ai_summarizing' | 'ai_summary_error_generic' | 'ai_summary_error_acceptable_use_violation' | 'ai_summary_error_hipaa_content_detected' | 'beta' | 'cannot_find_link' | 'connect_link_account_card' | 'connect_link_account_card_name' | 'connect_link_account_card_description' | 'connect_unauthorised_account_action' | 'connect_unauthorised_account_description' | 'connect_unauthorised_account_description_no_provider' | 'continue' | 'copy_url_to_clipboard' | 'copied_url_to_clipboard' | 'could_not_load_link' | 'download' | 'download_description' | 'download_file' | 'follow' | 'go_back' | 'invalid_permissions' | 'invalid_permissions_description' | 'join_to_view' | 'connect_link_account' | 'created_by' | 'created_on_relative' | 'created_on_absolute' | 'check_this_link' | 'delete' | 'edit' | 'learn_more_about_smart_links' | 'learn_more_about_connecting_account' | 'loading' | 'link_safety_warning_message' | 'modified_by' | 'modified_on_relative' | 'modified_on_absolute' | 'more_actions' | 'not_found_title' | 'not_found_description' | 'open_issue_in_jira' | 'open_link_in_a_new_tab' | 'owned_by' | 'preview_description' | 'preview_improved' | 'preview_close' | 'preview_max_size' | 'preview_min_size' | 'priority_blocker' | 'priority_critical' | 'priority_high' | 'priority_highest' | 'priority_low' | 'priority_lowest' | 'priority_major' | 'priority_medium' | 'priority_minor' | 'priority_trivial' | 'priority_undefined' | 'forbidden_access' | 'pending_request' | 'read_time' | 'restricted_link' | 'request_access_to_view' | 'request_denied' | 'sent_on_relative' | 'sent_on_absolute' | 'status_change_load_error' | 'status_change_permission_error' | 'status_change_update_error' | 'try_again' | 'try_another_account' | 'unauthorised_account_description' | 'unauthorised_account_description_no_provider' | 'unauthorised_account_name' | 'unauthorised_account_name_no_provider' | 'unassigned' | 'unfollow' | 'view' | 'viewIn' | 'viewOriginal' | 'actions' | 'add_account' | 'cancel' | 'close' | 'connect_to' | 'connect_account_description' | 'retry' | 'save' | 'unlink_account' | RequestAccessMessageKey | 'related_work_items_not_found' | 'last_mentioned_in' | 'related' | 'generic_error_message';
|
|
3
|
+
export type MessageKey = 'assigned_to' | 'ai_summarize' | 'ai_summarized' | 'ai_summarized_abbreviation' | 'ai_summarized_info' | 'ai_summarizing' | 'ai_summary_error_generic' | 'ai_summary_error_acceptable_use_violation' | 'ai_summary_error_hipaa_content_detected' | 'beta' | 'cannot_find_link' | 'connect_link_account_card' | 'connect_link_account_card_name' | 'connect_link_account_card_description' | 'connect_unauthorised_account_action' | 'connect_unauthorised_account_description' | 'connect_unauthorised_account_description_no_provider' | 'continue' | 'copy_url_to_clipboard' | 'copied_url_to_clipboard' | 'could_not_load_link' | 'download' | 'download_description' | 'download_file' | 'follow' | 'follow_project_description' | 'follow_project' | 'follow_goal' | 'follow_goal_description' | 'go_back' | 'invalid_permissions' | 'invalid_permissions_description' | 'join_to_view' | 'connect_link_account' | 'created_by' | 'created_on_relative' | 'created_on_absolute' | 'check_this_link' | 'delete' | 'edit' | 'learn_more_about_smart_links' | 'learn_more_about_connecting_account' | 'loading' | 'link_safety_warning_message' | 'modified_by' | 'modified_on_relative' | 'modified_on_absolute' | 'more_actions' | 'not_found_title' | 'not_found_description' | 'open_issue_in_jira' | 'open_link_in_a_new_tab' | 'owned_by' | 'preview_description' | 'preview_improved' | 'preview_close' | 'preview_max_size' | 'preview_min_size' | 'priority_blocker' | 'priority_critical' | 'priority_high' | 'priority_highest' | 'priority_low' | 'priority_lowest' | 'priority_major' | 'priority_medium' | 'priority_minor' | 'priority_trivial' | 'priority_undefined' | 'forbidden_access' | 'pending_request' | 'read_time' | 'restricted_link' | 'request_access_to_view' | 'request_denied' | 'sent_on_relative' | 'sent_on_absolute' | 'status_change_load_error' | 'status_change_permission_error' | 'status_change_update_error' | 'try_again' | 'try_another_account' | 'unauthorised_account_description' | 'unauthorised_account_description_no_provider' | 'unauthorised_account_name' | 'unauthorised_account_name_no_provider' | 'unassigned' | 'unfollow' | 'unfollow_project_description' | 'unfollow_project' | 'unfollow_goal' | 'unfollow_goal_description' | 'view' | 'viewIn' | 'viewOriginal' | 'actions' | 'add_account' | 'cancel' | 'close' | 'connect_to' | 'connect_account_description' | 'retry' | 'save' | 'unlink_account' | RequestAccessMessageKey | 'related_work_items_not_found' | 'last_mentioned_in' | 'related' | 'generic_error_message';
|
|
4
4
|
type Messages = {
|
|
5
5
|
[K in MessageKey]: MessageDescriptor;
|
|
6
6
|
};
|
|
@@ -12,6 +12,7 @@ export declare const getFormattedMessage: (message?: MessageProps) => JSX.Elemen
|
|
|
12
12
|
export declare const getFormattedMessageAsString: (intl: IntlShape, message: MessageDescriptor, context?: string) => string;
|
|
13
13
|
export declare const getIconSizeStyles: (width: string) => SerializedStyles;
|
|
14
14
|
export declare const getIconWidth: (size?: SmartLinkSize) => string;
|
|
15
|
+
export declare const importIcon: (importFn: () => Promise<any>) => any;
|
|
15
16
|
export declare const getLinkLineHeight: (size: SmartLinkSize) => string;
|
|
16
17
|
export declare const getLinkSizeStyles: (size: SmartLinkSize) => SerializedStyles;
|
|
17
18
|
export declare const getMaxLineHeight: (size: SmartLinkSize) => 1.5 | 1.75;
|