@atlaskit/smart-card 26.50.13 → 26.50.15

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.
Files changed (78) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/dist/cjs/extractors/flexible/actions/index.js +17 -0
  3. package/dist/cjs/extractors/flexible/index.js +4 -3
  4. package/dist/cjs/state/flexible-ui-context/types.js +1 -3
  5. package/dist/cjs/state/hooks/use-ai-summary/ai-summary-service/index.js +6 -3
  6. package/dist/cjs/state/hooks/use-ai-summary/index.js +4 -2
  7. package/dist/cjs/utils/analytics/analytics.js +1 -1
  8. package/dist/cjs/view/FlexibleCard/components/actions/index.js +8 -12
  9. package/dist/cjs/view/FlexibleCard/components/actions/preview-action/index.js +83 -0
  10. package/dist/cjs/view/FlexibleCard/components/actions/types.js +5 -0
  11. package/dist/cjs/view/FlexibleCard/components/actions/utils.js +0 -13
  12. package/dist/cjs/view/FlexibleCard/components/blocks/action-group/action-group-item/index.js +8 -6
  13. package/dist/cjs/view/FlexibleCard/components/blocks/ai-summary-block/resolved/index.js +3 -1
  14. package/dist/cjs/view/FlexibleCard/components/blocks/utils.js +45 -11
  15. package/dist/cjs/view/HoverCard/components/ContentContainer.js +6 -3
  16. package/dist/cjs/view/HoverCard/components/views/resolved/index.js +7 -3
  17. package/dist/cjs/view/LinkUrl/index.js +1 -1
  18. package/dist/es2019/extractors/flexible/actions/index.js +9 -0
  19. package/dist/es2019/extractors/flexible/index.js +5 -4
  20. package/dist/es2019/state/flexible-ui-context/types.js +6 -1
  21. package/dist/es2019/state/hooks/use-ai-summary/ai-summary-service/index.js +6 -3
  22. package/dist/es2019/state/hooks/use-ai-summary/index.js +4 -2
  23. package/dist/es2019/utils/analytics/analytics.js +1 -1
  24. package/dist/es2019/view/FlexibleCard/components/actions/index.js +1 -11
  25. package/dist/es2019/view/FlexibleCard/components/actions/preview-action/index.js +52 -0
  26. package/dist/es2019/view/FlexibleCard/components/actions/utils.js +0 -14
  27. package/dist/es2019/view/FlexibleCard/components/blocks/action-group/action-group-item/index.js +8 -6
  28. package/dist/es2019/view/FlexibleCard/components/blocks/ai-summary-block/resolved/index.js +3 -1
  29. package/dist/es2019/view/FlexibleCard/components/blocks/utils.js +42 -33
  30. package/dist/es2019/view/HoverCard/components/ContentContainer.js +7 -4
  31. package/dist/es2019/view/HoverCard/components/views/resolved/index.js +8 -4
  32. package/dist/es2019/view/LinkUrl/index.js +1 -1
  33. package/dist/esm/extractors/flexible/actions/index.js +10 -0
  34. package/dist/esm/extractors/flexible/index.js +5 -4
  35. package/dist/esm/state/flexible-ui-context/types.js +6 -1
  36. package/dist/esm/state/hooks/use-ai-summary/ai-summary-service/index.js +6 -3
  37. package/dist/esm/state/hooks/use-ai-summary/index.js +4 -2
  38. package/dist/esm/utils/analytics/analytics.js +1 -1
  39. package/dist/esm/view/FlexibleCard/components/actions/index.js +1 -11
  40. package/dist/esm/view/FlexibleCard/components/actions/preview-action/index.js +73 -0
  41. package/dist/esm/view/FlexibleCard/components/actions/preview-action/types.js +1 -0
  42. package/dist/esm/view/FlexibleCard/components/actions/types.js +1 -0
  43. package/dist/esm/view/FlexibleCard/components/actions/utils.js +0 -13
  44. package/dist/esm/view/FlexibleCard/components/blocks/action-group/action-group-item/index.js +8 -6
  45. package/dist/esm/view/FlexibleCard/components/blocks/ai-summary-block/resolved/index.js +3 -1
  46. package/dist/esm/view/FlexibleCard/components/blocks/utils.js +45 -11
  47. package/dist/esm/view/HoverCard/components/ContentContainer.js +7 -4
  48. package/dist/esm/view/HoverCard/components/views/resolved/index.js +8 -4
  49. package/dist/esm/view/LinkUrl/index.js +1 -1
  50. package/dist/types/extractors/flexible/actions/index.d.ts +5 -0
  51. package/dist/types/state/flexible-ui-context/types.d.ts +14 -7
  52. package/dist/types/state/hooks/use-ai-summary/ai-summary-service/index.d.ts +1 -0
  53. package/dist/types/state/hooks/use-ai-summary/ai-summary-service/types.d.ts +7 -3
  54. package/dist/types/view/FlexibleCard/components/actions/index.d.ts +1 -7
  55. package/dist/types/view/FlexibleCard/components/actions/preview-action/index.d.ts +4 -0
  56. package/dist/types/view/FlexibleCard/components/actions/preview-action/types.d.ts +2 -0
  57. package/dist/types/view/FlexibleCard/components/actions/types.d.ts +7 -0
  58. package/dist/types/view/FlexibleCard/types.d.ts +20 -2
  59. package/dist/types-ts4.5/extractors/flexible/actions/index.d.ts +5 -0
  60. package/dist/types-ts4.5/state/flexible-ui-context/types.d.ts +14 -7
  61. package/dist/types-ts4.5/state/hooks/use-ai-summary/ai-summary-service/index.d.ts +1 -0
  62. package/dist/types-ts4.5/state/hooks/use-ai-summary/ai-summary-service/types.d.ts +7 -3
  63. package/dist/types-ts4.5/view/FlexibleCard/components/actions/index.d.ts +1 -7
  64. package/dist/types-ts4.5/view/FlexibleCard/components/actions/preview-action/index.d.ts +4 -0
  65. package/dist/types-ts4.5/view/FlexibleCard/components/actions/preview-action/types.d.ts +2 -0
  66. package/dist/types-ts4.5/view/FlexibleCard/components/actions/types.d.ts +7 -0
  67. package/dist/types-ts4.5/view/FlexibleCard/types.d.ts +20 -2
  68. package/package.json +3 -3
  69. package/dist/cjs/view/FlexibleCard/components/actions/action/preview-action/index.js +0 -87
  70. package/dist/es2019/view/FlexibleCard/components/actions/action/preview-action/index.js +0 -63
  71. package/dist/esm/view/FlexibleCard/components/actions/action/preview-action/index.js +0 -80
  72. package/dist/types/view/FlexibleCard/components/actions/action/preview-action/index.d.ts +0 -4
  73. package/dist/types/view/FlexibleCard/components/actions/action/preview-action/types.d.ts +0 -12
  74. package/dist/types-ts4.5/view/FlexibleCard/components/actions/action/preview-action/index.d.ts +0 -4
  75. package/dist/types-ts4.5/view/FlexibleCard/components/actions/action/preview-action/types.d.ts +0 -12
  76. /package/dist/cjs/view/FlexibleCard/components/actions/{action/preview-action → preview-action}/types.js +0 -0
  77. /package/dist/es2019/view/FlexibleCard/components/actions/{action/preview-action → preview-action}/types.js +0 -0
  78. /package/dist/{esm/view/FlexibleCard/components/actions/action/preview-action → es2019/view/FlexibleCard/components/actions}/types.js +0 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/smart-card",
3
- "version": "26.50.13",
3
+ "version": "26.50.15",
4
4
  "description": "Smart card component",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -42,7 +42,7 @@
42
42
  "@atlaskit/in-product-testing": "^0.2.0",
43
43
  "@atlaskit/link-analytics": "^8.3.0",
44
44
  "@atlaskit/link-client-extension": "^1.8.0",
45
- "@atlaskit/link-extractors": "^1.2.0",
45
+ "@atlaskit/link-extractors": "^1.3.0",
46
46
  "@atlaskit/linking-common": "^5.6.0",
47
47
  "@atlaskit/linking-types": "^8.7.0",
48
48
  "@atlaskit/logo": "^13.15.0",
@@ -62,7 +62,7 @@
62
62
  "@emotion/styled": "^11.0.0",
63
63
  "@formatjs/intl-utils": "^3.8.4",
64
64
  "facepaint": "^1.2.1",
65
- "json-ld-types": "^3.11.0",
65
+ "json-ld-types": "^4.1.0",
66
66
  "lru_map": "^0.4.1",
67
67
  "markdown-to-jsx": "^7.1.7",
68
68
  "react-error-boundary": "^3.1.3",
@@ -1,87 +0,0 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
- Object.defineProperty(exports, "__esModule", {
5
- value: true
6
- });
7
- exports.default = void 0;
8
- var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
9
- var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
10
- var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
11
- var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
12
- var _react = _interopRequireDefault(require("react"));
13
- var _index = _interopRequireDefault(require("../index"));
14
- var _flexibleUiContext = require("../../../../../../state/flexible-ui-context");
15
- var _utils = require("../../../utils");
16
- var _useInvokeClientAction = _interopRequireDefault(require("../../../../../../state/hooks/use-invoke-client-action"));
17
- var _constants = require("../../../../../../constants");
18
- 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; }
19
- function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
20
- var PreviewAction = function PreviewAction(props) {
21
- var appearance = props.appearance,
22
- asDropDownItem = props.asDropDownItem,
23
- testId = props.testId,
24
- _onClick = props.onClick,
25
- linkIcon = props.linkIcon,
26
- src = props.src,
27
- url = props.url,
28
- title = props.title,
29
- providerName = props.providerName,
30
- downloadUrl = props.downloadUrl,
31
- isSupportTheming = props.isSupportTheming;
32
- var analytics = (0, _flexibleUiContext.useFlexibleUiAnalyticsContext)();
33
- var invoke = (0, _useInvokeClientAction.default)({
34
- analytics: analytics
35
- });
36
- if (src && url) {
37
- var actionFn = /*#__PURE__*/function () {
38
- var _ref = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
39
- return _regenerator.default.wrap(function _callee$(_context) {
40
- while (1) switch (_context.prev = _context.next) {
41
- case 0:
42
- return _context.abrupt("return", (0, _utils.openEmbedModalWithFlexibleUiIcon)({
43
- download: downloadUrl,
44
- extensionKey: analytics === null || analytics === void 0 ? void 0 : analytics.extensionKey,
45
- title: title,
46
- providerName: providerName,
47
- isSupportTheming: isSupportTheming,
48
- analytics: analytics,
49
- linkIcon: linkIcon,
50
- src: src,
51
- url: url
52
- }));
53
- case 1:
54
- case "end":
55
- return _context.stop();
56
- }
57
- }, _callee);
58
- }));
59
- return function actionFn() {
60
- return _ref.apply(this, arguments);
61
- };
62
- }();
63
- var action = _objectSpread(_objectSpread({}, props), {}, {
64
- onClick: function onClick() {
65
- invoke({
66
- actionType: _constants.ActionName.PreviewAction,
67
- actionFn: actionFn,
68
- // These values have already been set in analytics context.
69
- // We only pass these here for ufo experience.
70
- display: analytics === null || analytics === void 0 ? void 0 : analytics.display,
71
- extensionKey: analytics === null || analytics === void 0 ? void 0 : analytics.extensionKey
72
- });
73
- if (_onClick) {
74
- _onClick();
75
- }
76
- }
77
- });
78
- return /*#__PURE__*/_react.default.createElement(_index.default, (0, _extends2.default)({}, action, {
79
- appearance: appearance,
80
- asDropDownItem: asDropDownItem,
81
- testId: testId
82
- }));
83
- } else {
84
- return null;
85
- }
86
- };
87
- var _default = exports.default = PreviewAction;
@@ -1,63 +0,0 @@
1
- import _extends from "@babel/runtime/helpers/extends";
2
- import React from 'react';
3
- import Action from '../index';
4
- import { useFlexibleUiAnalyticsContext } from '../../../../../../state/flexible-ui-context';
5
- import { openEmbedModalWithFlexibleUiIcon } from '../../../utils';
6
- import useInvokeClientAction from '../../../../../../state/hooks/use-invoke-client-action';
7
- import { ActionName } from '../../../../../../constants';
8
- const PreviewAction = props => {
9
- const {
10
- appearance,
11
- asDropDownItem,
12
- testId,
13
- onClick,
14
- linkIcon,
15
- src,
16
- url,
17
- title,
18
- providerName,
19
- downloadUrl,
20
- isSupportTheming
21
- } = props;
22
- const analytics = useFlexibleUiAnalyticsContext();
23
- const invoke = useInvokeClientAction({
24
- analytics
25
- });
26
- if (src && url) {
27
- const actionFn = async () => openEmbedModalWithFlexibleUiIcon({
28
- download: downloadUrl,
29
- extensionKey: analytics === null || analytics === void 0 ? void 0 : analytics.extensionKey,
30
- title,
31
- providerName,
32
- isSupportTheming,
33
- analytics,
34
- linkIcon,
35
- src,
36
- url
37
- });
38
- const action = {
39
- ...props,
40
- onClick: () => {
41
- invoke({
42
- actionType: ActionName.PreviewAction,
43
- actionFn,
44
- // These values have already been set in analytics context.
45
- // We only pass these here for ufo experience.
46
- display: analytics === null || analytics === void 0 ? void 0 : analytics.display,
47
- extensionKey: analytics === null || analytics === void 0 ? void 0 : analytics.extensionKey
48
- });
49
- if (onClick) {
50
- onClick();
51
- }
52
- }
53
- };
54
- return /*#__PURE__*/React.createElement(Action, _extends({}, action, {
55
- appearance: appearance,
56
- asDropDownItem: asDropDownItem,
57
- testId: testId
58
- }));
59
- } else {
60
- return null;
61
- }
62
- };
63
- export default PreviewAction;
@@ -1,80 +0,0 @@
1
- import _extends from "@babel/runtime/helpers/extends";
2
- import _defineProperty from "@babel/runtime/helpers/defineProperty";
3
- import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
4
- 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; }
5
- function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
6
- import _regeneratorRuntime from "@babel/runtime/regenerator";
7
- import React from 'react';
8
- import Action from '../index';
9
- import { useFlexibleUiAnalyticsContext } from '../../../../../../state/flexible-ui-context';
10
- import { openEmbedModalWithFlexibleUiIcon } from '../../../utils';
11
- import useInvokeClientAction from '../../../../../../state/hooks/use-invoke-client-action';
12
- import { ActionName } from '../../../../../../constants';
13
- var PreviewAction = function PreviewAction(props) {
14
- var appearance = props.appearance,
15
- asDropDownItem = props.asDropDownItem,
16
- testId = props.testId,
17
- _onClick = props.onClick,
18
- linkIcon = props.linkIcon,
19
- src = props.src,
20
- url = props.url,
21
- title = props.title,
22
- providerName = props.providerName,
23
- downloadUrl = props.downloadUrl,
24
- isSupportTheming = props.isSupportTheming;
25
- var analytics = useFlexibleUiAnalyticsContext();
26
- var invoke = useInvokeClientAction({
27
- analytics: analytics
28
- });
29
- if (src && url) {
30
- var actionFn = /*#__PURE__*/function () {
31
- var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
32
- return _regeneratorRuntime.wrap(function _callee$(_context) {
33
- while (1) switch (_context.prev = _context.next) {
34
- case 0:
35
- return _context.abrupt("return", openEmbedModalWithFlexibleUiIcon({
36
- download: downloadUrl,
37
- extensionKey: analytics === null || analytics === void 0 ? void 0 : analytics.extensionKey,
38
- title: title,
39
- providerName: providerName,
40
- isSupportTheming: isSupportTheming,
41
- analytics: analytics,
42
- linkIcon: linkIcon,
43
- src: src,
44
- url: url
45
- }));
46
- case 1:
47
- case "end":
48
- return _context.stop();
49
- }
50
- }, _callee);
51
- }));
52
- return function actionFn() {
53
- return _ref.apply(this, arguments);
54
- };
55
- }();
56
- var action = _objectSpread(_objectSpread({}, props), {}, {
57
- onClick: function onClick() {
58
- invoke({
59
- actionType: ActionName.PreviewAction,
60
- actionFn: actionFn,
61
- // These values have already been set in analytics context.
62
- // We only pass these here for ufo experience.
63
- display: analytics === null || analytics === void 0 ? void 0 : analytics.display,
64
- extensionKey: analytics === null || analytics === void 0 ? void 0 : analytics.extensionKey
65
- });
66
- if (_onClick) {
67
- _onClick();
68
- }
69
- }
70
- });
71
- return /*#__PURE__*/React.createElement(Action, _extends({}, action, {
72
- appearance: appearance,
73
- asDropDownItem: asDropDownItem,
74
- testId: testId
75
- }));
76
- } else {
77
- return null;
78
- }
79
- };
80
- export default PreviewAction;
@@ -1,4 +0,0 @@
1
- import React from 'react';
2
- import { PreviewActionProps } from './types';
3
- declare const PreviewAction: React.FC<PreviewActionProps>;
4
- export default PreviewAction;
@@ -1,12 +0,0 @@
1
- import { Icon } from '../../../../../../state/flexible-ui-context/types';
2
- import { ActionProps } from '../types';
3
- export type PreviewActionProps = ActionProps & FlexibleEmbedProps;
4
- export type FlexibleEmbedProps = {
5
- downloadUrl?: string;
6
- linkIcon?: Icon;
7
- providerName?: string;
8
- src?: string;
9
- title?: string;
10
- url: string;
11
- isSupportTheming?: boolean;
12
- };
@@ -1,4 +0,0 @@
1
- import React from 'react';
2
- import { PreviewActionProps } from './types';
3
- declare const PreviewAction: React.FC<PreviewActionProps>;
4
- export default PreviewAction;
@@ -1,12 +0,0 @@
1
- import { Icon } from '../../../../../../state/flexible-ui-context/types';
2
- import { ActionProps } from '../types';
3
- export type PreviewActionProps = ActionProps & FlexibleEmbedProps;
4
- export type FlexibleEmbedProps = {
5
- downloadUrl?: string;
6
- linkIcon?: Icon;
7
- providerName?: string;
8
- src?: string;
9
- title?: string;
10
- url: string;
11
- isSupportTheming?: boolean;
12
- };