@atlaskit/smart-card 17.7.0 → 17.7.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/dist/cjs/constants.js +1 -0
- package/dist/cjs/version.json +1 -1
- package/dist/cjs/view/FlexibleCard/components/actions/index.js +4 -2
- package/dist/cjs/view/FlexibleCard/components/actions/utils.js +7 -2
- package/dist/es2019/constants.js +1 -0
- package/dist/es2019/version.json +1 -1
- package/dist/es2019/view/FlexibleCard/components/actions/index.js +2 -1
- package/dist/es2019/view/FlexibleCard/components/actions/utils.js +4 -0
- package/dist/esm/constants.js +1 -0
- package/dist/esm/version.json +1 -1
- package/dist/esm/view/FlexibleCard/components/actions/index.js +2 -1
- package/dist/esm/view/FlexibleCard/components/actions/utils.js +7 -3
- package/dist/types/constants.d.ts +2 -1
- package/dist/types/view/FlexibleCard/components/actions/index.d.ts +1 -0
- package/dist/types/view/FlexibleCard/components/blocks/types.d.ts +16 -2
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
package/dist/cjs/constants.js
CHANGED
package/dist/cjs/version.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.DeleteAction = void 0;
|
|
6
|
+
exports.DeleteAction = exports.CustomAction = void 0;
|
|
7
7
|
|
|
8
8
|
var _constants = require("../../../../constants");
|
|
9
9
|
|
|
@@ -15,4 +15,6 @@ var _utils = require("./utils");
|
|
|
15
15
|
// UIActions infer that you do not need to get any data from the context.
|
|
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
|
-
exports.DeleteAction = DeleteAction;
|
|
18
|
+
exports.DeleteAction = DeleteAction;
|
|
19
|
+
var CustomAction = (0, _utils.createUIAction)(_constants.ActionName.CustomAction);
|
|
20
|
+
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 _actionMappings;
|
|
31
|
+
|
|
30
32
|
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); }
|
|
31
33
|
|
|
32
34
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
@@ -35,7 +37,10 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
|
|
|
35
37
|
|
|
36
38
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
37
39
|
|
|
38
|
-
var actionMappings = (0, _defineProperty2.default)(
|
|
40
|
+
var actionMappings = (_actionMappings = {}, (0, _defineProperty2.default)(_actionMappings, _constants.ActionName.CustomAction, {
|
|
41
|
+
component: _action.default,
|
|
42
|
+
props: {}
|
|
43
|
+
}), (0, _defineProperty2.default)(_actionMappings, _constants.ActionName.DeleteAction, {
|
|
39
44
|
component: _action.default,
|
|
40
45
|
props: {
|
|
41
46
|
testId: 'smart-action-delete-action',
|
|
@@ -45,7 +50,7 @@ var actionMappings = (0, _defineProperty2.default)({}, _constants.ActionName.Del
|
|
|
45
50
|
}),
|
|
46
51
|
toolTipMessage: /*#__PURE__*/_react.default.createElement(_reactIntlNext.FormattedMessage, _messages.messages.delete)
|
|
47
52
|
}
|
|
48
|
-
});
|
|
53
|
+
}), _actionMappings);
|
|
49
54
|
|
|
50
55
|
var getContextKey = function getContextKey(name) {
|
|
51
56
|
// Attempt to predict context prop name in advance to reduce the amount of
|
package/dist/es2019/constants.js
CHANGED
package/dist/es2019/version.json
CHANGED
|
@@ -5,4 +5,5 @@ import { createUIAction } from './utils'; // Attention: Keep the export name and
|
|
|
5
5
|
// UIActions infer that you do not need to get any data from the context.
|
|
6
6
|
// DataActions infer that the action depends on the data from the context.
|
|
7
7
|
|
|
8
|
-
export const DeleteAction = createUIAction(ActionName.DeleteAction);
|
|
8
|
+
export const DeleteAction = createUIAction(ActionName.DeleteAction);
|
|
9
|
+
export const CustomAction = createUIAction(ActionName.CustomAction);
|
|
@@ -7,6 +7,10 @@ import { FormattedMessage } from 'react-intl-next';
|
|
|
7
7
|
import { messages } from '../../../../messages';
|
|
8
8
|
import CrossIcon from '@atlaskit/icon/glyph/cross';
|
|
9
9
|
const actionMappings = {
|
|
10
|
+
[ActionName.CustomAction]: {
|
|
11
|
+
component: Action,
|
|
12
|
+
props: {}
|
|
13
|
+
},
|
|
10
14
|
[ActionName.DeleteAction]: {
|
|
11
15
|
component: Action,
|
|
12
16
|
props: {
|
package/dist/esm/constants.js
CHANGED
package/dist/esm/version.json
CHANGED
|
@@ -5,4 +5,5 @@ import { createUIAction } from './utils'; // Attention: Keep the export name and
|
|
|
5
5
|
// UIActions infer that you do not need to get any data from the context.
|
|
6
6
|
// DataActions infer that the action depends on the data from the context.
|
|
7
7
|
|
|
8
|
-
export var DeleteAction = createUIAction(ActionName.DeleteAction);
|
|
8
|
+
export var DeleteAction = createUIAction(ActionName.DeleteAction);
|
|
9
|
+
export var CustomAction = createUIAction(ActionName.CustomAction);
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
3
3
|
|
|
4
|
+
var _actionMappings;
|
|
5
|
+
|
|
4
6
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
5
7
|
|
|
6
8
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
@@ -12,8 +14,10 @@ import Action from './action';
|
|
|
12
14
|
import { FormattedMessage } from 'react-intl-next';
|
|
13
15
|
import { messages } from '../../../../messages';
|
|
14
16
|
import CrossIcon from '@atlaskit/icon/glyph/cross';
|
|
15
|
-
|
|
16
|
-
|
|
17
|
+
var actionMappings = (_actionMappings = {}, _defineProperty(_actionMappings, ActionName.CustomAction, {
|
|
18
|
+
component: Action,
|
|
19
|
+
props: {}
|
|
20
|
+
}), _defineProperty(_actionMappings, ActionName.DeleteAction, {
|
|
17
21
|
component: Action,
|
|
18
22
|
props: {
|
|
19
23
|
testId: 'smart-action-delete-action',
|
|
@@ -23,7 +27,7 @@ var actionMappings = _defineProperty({}, ActionName.DeleteAction, {
|
|
|
23
27
|
}),
|
|
24
28
|
toolTipMessage: /*#__PURE__*/React.createElement(FormattedMessage, messages.delete)
|
|
25
29
|
}
|
|
26
|
-
});
|
|
30
|
+
}), _actionMappings);
|
|
27
31
|
|
|
28
32
|
var getContextKey = function getContextKey(name) {
|
|
29
33
|
// Attempt to predict context prop name in advance to reduce the amount of
|
|
@@ -101,7 +101,8 @@ export declare enum ElementName {
|
|
|
101
101
|
* Flexible UI action (button)
|
|
102
102
|
*/
|
|
103
103
|
export declare enum ActionName {
|
|
104
|
-
DeleteAction = "DeleteAction"
|
|
104
|
+
DeleteAction = "DeleteAction",
|
|
105
|
+
CustomAction = "CustomAction"
|
|
105
106
|
}
|
|
106
107
|
/**
|
|
107
108
|
* Flexible UI icons - each mapped to AK icons.
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { ActionName, ElementName, SmartLinkDirection, SmartLinkSize, SmartLinkStatus } from '../../../../constants';
|
|
2
|
+
import { ActionProps } from '../actions/action/types';
|
|
2
3
|
export declare type BlockProps = {
|
|
3
4
|
direction?: SmartLinkDirection;
|
|
4
5
|
size?: SmartLinkSize;
|
|
@@ -10,10 +11,23 @@ export declare type ElementItem = {
|
|
|
10
11
|
size?: SmartLinkSize;
|
|
11
12
|
testId?: string;
|
|
12
13
|
};
|
|
13
|
-
export declare type
|
|
14
|
-
name: ActionName;
|
|
14
|
+
export declare type BaseActionItem = {
|
|
15
15
|
testId?: string;
|
|
16
16
|
hideContent?: boolean;
|
|
17
17
|
hideIcon?: boolean;
|
|
18
18
|
onClick: () => any;
|
|
19
19
|
};
|
|
20
|
+
/**
|
|
21
|
+
* Customer can define named action item. Icon and label will be provided implicitly.
|
|
22
|
+
*/
|
|
23
|
+
export declare type NamedActionItem = BaseActionItem & {
|
|
24
|
+
name: Exclude<ActionName, ActionName.CustomAction>;
|
|
25
|
+
};
|
|
26
|
+
/**
|
|
27
|
+
* Customer can define a custom action item. This will require them to specify
|
|
28
|
+
* either `icon` and `iconPosition` OR `content` OR both BUT not neither of those things.
|
|
29
|
+
*/
|
|
30
|
+
export declare type CustomActionItem = BaseActionItem & {
|
|
31
|
+
name: ActionName.CustomAction;
|
|
32
|
+
} & ((Required<Pick<ActionProps, 'icon' | 'iconPosition'>> & Pick<ActionProps, 'content'>) | ((Required<Pick<ActionProps, 'content'>> & Pick<ActionProps, 'icon' | 'iconPosition'>) & Pick<ActionProps, 'tooltipMessage'>));
|
|
33
|
+
export declare type ActionItem = NamedActionItem | CustomActionItem;
|