@atlaskit/smart-card 17.7.9 → 17.7.10

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 CHANGED
@@ -1,5 +1,11 @@
1
1
  # @atlaskit/smart-card
2
2
 
3
+ ## 17.7.10
4
+
5
+ ### Patch Changes
6
+
7
+ - [`e04b58c623e`](https://bitbucket.org/atlassian/atlassian-frontend/commits/e04b58c623e) - Add EditAction
8
+
3
9
  ## 17.7.9
4
10
 
5
11
  ### Patch Changes
@@ -156,6 +156,7 @@ exports.ActionName = ActionName;
156
156
 
157
157
  (function (ActionName) {
158
158
  ActionName["DeleteAction"] = "DeleteAction";
159
+ ActionName["EditAction"] = "EditAction";
159
160
  ActionName["CustomAction"] = "CustomAction";
160
161
  })(ActionName || (exports.ActionName = ActionName = {}));
161
162
 
@@ -43,6 +43,11 @@ var messages = (0, _reactIntlNext.defineMessages)({
43
43
  defaultMessage: 'Delete',
44
44
  description: 'Allow a user to delete a link'
45
45
  },
46
+ edit: {
47
+ id: 'fabric.linking.edit',
48
+ defaultMessage: 'Edit',
49
+ description: 'Allow a user to edit a link'
50
+ },
46
51
  modified_by: {
47
52
  id: 'fabric.linking.updated_by',
48
53
  defaultMessage: 'Modified by {context}',
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/smart-card",
3
- "version": "17.7.9",
3
+ "version": "17.7.10",
4
4
  "sideEffects": false
5
5
  }
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.DeleteAction = exports.CustomAction = void 0;
6
+ exports.EditAction = exports.DeleteAction = exports.CustomAction = void 0;
7
7
 
8
8
  var _constants = require("../../../../constants");
9
9
 
@@ -16,5 +16,7 @@ var _utils = require("./utils");
16
16
  // DataActions infer that the action depends on the data from the context.
17
17
  var DeleteAction = (0, _utils.createUIAction)(_constants.ActionName.DeleteAction);
18
18
  exports.DeleteAction = DeleteAction;
19
+ var EditAction = (0, _utils.createUIAction)(_constants.ActionName.EditAction);
20
+ exports.EditAction = EditAction;
19
21
  var CustomAction = (0, _utils.createUIAction)(_constants.ActionName.CustomAction);
20
22
  exports.CustomAction = CustomAction;
@@ -27,6 +27,8 @@ var _messages = require("../../../../messages");
27
27
 
28
28
  var _cross = _interopRequireDefault(require("@atlaskit/icon/glyph/cross"));
29
29
 
30
+ var _edit = _interopRequireDefault(require("@atlaskit/icon/glyph/edit"));
31
+
30
32
  var _actionMappings;
31
33
 
32
34
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
@@ -50,6 +52,16 @@ var actionMappings = (_actionMappings = {}, (0, _defineProperty2.default)(_actio
50
52
  }),
51
53
  toolTipMessage: /*#__PURE__*/_react.default.createElement(_reactIntlNext.FormattedMessage, _messages.messages.delete)
52
54
  }
55
+ }), (0, _defineProperty2.default)(_actionMappings, _constants.ActionName.EditAction, {
56
+ component: _action.default,
57
+ props: {
58
+ testId: 'smart-action-edit-action',
59
+ content: /*#__PURE__*/_react.default.createElement(_reactIntlNext.FormattedMessage, _messages.messages.edit),
60
+ icon: /*#__PURE__*/_react.default.createElement(_edit.default, {
61
+ label: "Edit"
62
+ }),
63
+ toolTipMessage: /*#__PURE__*/_react.default.createElement(_reactIntlNext.FormattedMessage, _messages.messages.edit)
64
+ }
53
65
  }), _actionMappings);
54
66
 
55
67
  var getContextKey = function getContextKey(name) {
@@ -131,6 +131,7 @@ export let ActionName;
131
131
 
132
132
  (function (ActionName) {
133
133
  ActionName["DeleteAction"] = "DeleteAction";
134
+ ActionName["EditAction"] = "EditAction";
134
135
  ActionName["CustomAction"] = "CustomAction";
135
136
  })(ActionName || (ActionName = {}));
136
137
 
@@ -35,6 +35,11 @@ export const messages = defineMessages({
35
35
  defaultMessage: 'Delete',
36
36
  description: 'Allow a user to delete a link'
37
37
  },
38
+ edit: {
39
+ id: 'fabric.linking.edit',
40
+ defaultMessage: 'Edit',
41
+ description: 'Allow a user to edit a link'
42
+ },
38
43
  modified_by: {
39
44
  id: 'fabric.linking.updated_by',
40
45
  defaultMessage: 'Modified by {context}',
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/smart-card",
3
- "version": "17.7.9",
3
+ "version": "17.7.10",
4
4
  "sideEffects": false
5
5
  }
@@ -6,4 +6,5 @@ import { createUIAction } from './utils'; // Attention: Keep the export name and
6
6
  // DataActions infer that the action depends on the data from the context.
7
7
 
8
8
  export const DeleteAction = createUIAction(ActionName.DeleteAction);
9
+ export const EditAction = createUIAction(ActionName.EditAction);
9
10
  export const CustomAction = createUIAction(ActionName.CustomAction);
@@ -6,6 +6,7 @@ import Action from './action';
6
6
  import { FormattedMessage } from 'react-intl-next';
7
7
  import { messages } from '../../../../messages';
8
8
  import CrossIcon from '@atlaskit/icon/glyph/cross';
9
+ import EditIcon from '@atlaskit/icon/glyph/edit';
9
10
  const actionMappings = {
10
11
  [ActionName.CustomAction]: {
11
12
  component: Action,
@@ -21,6 +22,17 @@ const actionMappings = {
21
22
  }),
22
23
  toolTipMessage: /*#__PURE__*/React.createElement(FormattedMessage, messages.delete)
23
24
  }
25
+ },
26
+ [ActionName.EditAction]: {
27
+ component: Action,
28
+ props: {
29
+ testId: 'smart-action-edit-action',
30
+ content: /*#__PURE__*/React.createElement(FormattedMessage, messages.edit),
31
+ icon: /*#__PURE__*/React.createElement(EditIcon, {
32
+ label: "Edit"
33
+ }),
34
+ toolTipMessage: /*#__PURE__*/React.createElement(FormattedMessage, messages.edit)
35
+ }
24
36
  }
25
37
  };
26
38
 
@@ -131,6 +131,7 @@ export var ActionName;
131
131
 
132
132
  (function (ActionName) {
133
133
  ActionName["DeleteAction"] = "DeleteAction";
134
+ ActionName["EditAction"] = "EditAction";
134
135
  ActionName["CustomAction"] = "CustomAction";
135
136
  })(ActionName || (ActionName = {}));
136
137
 
@@ -35,6 +35,11 @@ export var messages = defineMessages({
35
35
  defaultMessage: 'Delete',
36
36
  description: 'Allow a user to delete a link'
37
37
  },
38
+ edit: {
39
+ id: 'fabric.linking.edit',
40
+ defaultMessage: 'Edit',
41
+ description: 'Allow a user to edit a link'
42
+ },
38
43
  modified_by: {
39
44
  id: 'fabric.linking.updated_by',
40
45
  defaultMessage: 'Modified by {context}',
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/smart-card",
3
- "version": "17.7.9",
3
+ "version": "17.7.10",
4
4
  "sideEffects": false
5
5
  }
@@ -6,4 +6,5 @@ import { createUIAction } from './utils'; // Attention: Keep the export name and
6
6
  // DataActions infer that the action depends on the data from the context.
7
7
 
8
8
  export var DeleteAction = createUIAction(ActionName.DeleteAction);
9
+ export var EditAction = createUIAction(ActionName.EditAction);
9
10
  export var CustomAction = createUIAction(ActionName.CustomAction);
@@ -14,6 +14,7 @@ import Action from './action';
14
14
  import { FormattedMessage } from 'react-intl-next';
15
15
  import { messages } from '../../../../messages';
16
16
  import CrossIcon from '@atlaskit/icon/glyph/cross';
17
+ import EditIcon from '@atlaskit/icon/glyph/edit';
17
18
  var actionMappings = (_actionMappings = {}, _defineProperty(_actionMappings, ActionName.CustomAction, {
18
19
  component: Action,
19
20
  props: {}
@@ -27,6 +28,16 @@ var actionMappings = (_actionMappings = {}, _defineProperty(_actionMappings, Act
27
28
  }),
28
29
  toolTipMessage: /*#__PURE__*/React.createElement(FormattedMessage, messages.delete)
29
30
  }
31
+ }), _defineProperty(_actionMappings, ActionName.EditAction, {
32
+ component: Action,
33
+ props: {
34
+ testId: 'smart-action-edit-action',
35
+ content: /*#__PURE__*/React.createElement(FormattedMessage, messages.edit),
36
+ icon: /*#__PURE__*/React.createElement(EditIcon, {
37
+ label: "Edit"
38
+ }),
39
+ toolTipMessage: /*#__PURE__*/React.createElement(FormattedMessage, messages.edit)
40
+ }
30
41
  }), _actionMappings);
31
42
 
32
43
  var getContextKey = function getContextKey(name) {
@@ -102,6 +102,7 @@ export declare enum ElementName {
102
102
  */
103
103
  export declare enum ActionName {
104
104
  DeleteAction = "DeleteAction",
105
+ EditAction = "EditAction",
105
106
  CustomAction = "CustomAction"
106
107
  }
107
108
  /**
@@ -1,5 +1,5 @@
1
1
  import { MessageDescriptor } from 'react-intl-next';
2
- export declare type MessageKey = 'cannot_find_link' | 'click_to_join' | 'connect_link_account' | 'created_by' | 'created_on' | 'delete' | 'modified_by' | 'modified_on' | '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' | 'restricted_link' | 'request_access' | 'request_denied';
2
+ export declare type MessageKey = 'cannot_find_link' | 'click_to_join' | 'connect_link_account' | 'created_by' | 'created_on' | 'delete' | 'edit' | 'modified_by' | 'modified_on' | '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' | 'restricted_link' | 'request_access' | 'request_denied';
3
3
  declare type Messages = {
4
4
  [K in MessageKey]: MessageDescriptor;
5
5
  };
@@ -1,4 +1,5 @@
1
1
  /// <reference types="react" />
2
2
  import { ActionProps } from './action/types';
3
3
  export declare const DeleteAction: import("react").FC<ActionProps>;
4
+ export declare const EditAction: import("react").FC<ActionProps>;
4
5
  export declare const CustomAction: import("react").FC<ActionProps>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/smart-card",
3
- "version": "17.7.9",
3
+ "version": "17.7.10",
4
4
  "description": "Smart card component",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"